{"record":{"id":"33603ee94567252e","repo":"paperclipai/paperclip","slug":"invalid-category-options-category-expected-o","errorCode":null,"errorMessage":"Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(\", \")}","messagePattern":"Invalid category '(.+?)'\\. Expected one of: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/create-paperclip-plugin/src/index.ts","lineNumber":134,"sourceCode":"\n/**\n * Generate a complete Paperclip plugin starter project.\n *\n * Output includes manifest/worker/UI entries, SDK harness tests, bundler presets,\n * and a local dev server script for hot-reload workflow.\n */\nexport function scaffoldPluginProject(options: ScaffoldPluginOptions): string {\n  const template = options.template ?? \"default\";\n  if (!VALID_TEMPLATES.includes(template)) {\n    throw new Error(`Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(\", \")}`);\n  }\n\n  if (!isValidPluginName(options.pluginName)) {\n    throw new Error(\"Invalid plugin name. Must be lowercase and may include scope, dots, underscores, or hyphens.\");\n  }\n\n  if (options.category && !VALID_CATEGORIES.has(options.category)) {\n    throw new Error(`Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(\", \")}`);\n  }\n\n  const outputDir = path.resolve(options.outputDir);\n  if (fs.existsSync(outputDir)) {\n    throw new Error(`Directory already exists: ${outputDir}`);\n  }\n\n  const displayName = options.displayName ?? makeDisplayName(options.pluginName);\n  const description = options.description ?? \"A Paperclip plugin\";\n  const author = options.author ?? \"Plugin Author\";\n  const category = options.category ?? (template === \"workspace\" ? \"workspace\" : template === \"environment\" ? \"environment\" : \"connector\");\n  const manifestId = packageToManifestId(options.pluginName);\n  const localSdkPath = path.resolve(options.sdkPath ?? getLocalSdkPackagePath());\n  const localSharedPath = getLocalSharedPackagePath(localSdkPath);\n  const repoRoot = getRepoRootFromSdkPath(localSdkPath);\n  const useWorkspaceSdk = isInsideDir(outputDir, repoRoot);\n\n  fs.mkdirSync(outputDir, { recursive: true });","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/packages/plugins/create-paperclip-plugin/src/index.ts#L116-L152","documentation":"Argument validation in scaffoldPluginProject: an options.category was supplied but is not in the VALID_CATEGORIES set. The category is written into the generated plugin manifest and must match the catalog categories Paperclip recognizes; the check fires before scaffolding begins. Omit category to use the default.","triggerScenarios":"Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose one of the listed valid categories."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}