paperclipai/paperclip · error
Invalid category ' '. Expected one of
Error message
Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(", ")} What it means
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.
Solutions
- Choose one of the listed valid categories.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:134 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18).
Data as JSON: /api/errors/33603ee94567252e.
Report an issue: GitHub.
Appendix: source
Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:134
/**
* Generate a complete Paperclip plugin starter project.
*
* Output includes manifest/worker/UI entries, SDK harness tests, bundler presets,
* and a local dev server script for hot-reload workflow.
*/
export function scaffoldPluginProject(options: ScaffoldPluginOptions): string {
const template = options.template ?? "default";
if (!VALID_TEMPLATES.includes(template)) {
throw new Error(`Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(", ")}`);
}
if (!isValidPluginName(options.pluginName)) {
throw new Error("Invalid plugin name. Must be lowercase and may include scope, dots, underscores, or hyphens.");
}
if (options.category && !VALID_CATEGORIES.has(options.category)) {
throw new Error(`Invalid category '${options.category}'. Expected one of: ${[...VALID_CATEGORIES].join(", ")}`);
}
const outputDir = path.resolve(options.outputDir);
if (fs.existsSync(outputDir)) {
throw new Error(`Directory already exists: ${outputDir}`);
}
const displayName = options.displayName ?? makeDisplayName(options.pluginName);
const description = options.description ?? "A Paperclip plugin";
const author = options.author ?? "Plugin Author";
const category = options.category ?? (template === "workspace" ? "workspace" : template === "environment" ? "environment" : "connector");
const manifestId = packageToManifestId(options.pluginName);
const localSdkPath = path.resolve(options.sdkPath ?? getLocalSdkPackagePath());
const localSharedPath = getLocalSharedPackagePath(localSdkPath);
const repoRoot = getRepoRootFromSdkPath(localSdkPath);
const useWorkspaceSdk = isInsideDir(outputDir, repoRoot);
fs.mkdirSync(outputDir, { recursive: true });View on GitHub (pinned to a7e689b3c3)