{"record":{"id":"59dac99e6eabe870","repo":"can1357/oh-my-pi","slug":"invalid-marketplace-plugin-package-name-json-st","errorCode":null,"errorMessage":"Invalid marketplace plugin package name: ${JSON.stringify(name)}","messagePattern":"Invalid marketplace plugin package name: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/plugins/marketplace/manager.ts","lineNumber":49,"sourceCode":"\twriteMarketplacesRegistry,\n} from \"./registry\";\nimport { resolvePluginSource } from \"./source-resolver\";\nimport type {\n\tInstalledPluginEntry,\n\tInstalledPluginSummary,\n\tInstalledPluginsRegistry,\n\tMarketplaceCatalog,\n\tMarketplacePluginEntry,\n\tMarketplaceRegistryEntry,\n} from \"./types\";\nimport { buildPluginId, parsePluginId } from \"./types\";\n\nconst RUNTIME_PACKAGE_NAME_RE = /^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$/;\nconst MAX_RUNTIME_PACKAGE_NAME_LENGTH = 214;\n\nfunction assertRuntimePackageName(name: string): string {\n\tif (name.length > MAX_RUNTIME_PACKAGE_NAME_LENGTH || !RUNTIME_PACKAGE_NAME_RE.test(name)) {\n\t\tthrow new Error(`Invalid marketplace plugin package name: ${JSON.stringify(name)}`);\n\t}\n\treturn name;\n}\n\n// ── Options ──────────────────────────────────────────────────────────────────\n\nexport interface MarketplaceManagerOptions {\n\tmarketplacesRegistryPath: string;\n\tinstalledRegistryPath: string;\n\t/**\n\t * Path to the project-scoped installed_plugins.json.\n\t * Required when installPlugin / uninstallPlugin is called with scope: \"project\".\n\t * Resolved by resolveActiveProjectRegistryPath(cwd) in callers.\n\t */\n\tprojectInstalledRegistryPath?: string;\n\tmarketplacesCacheDir: string;\n\tpluginsCacheDir: string;\n\t/** Injected for testing; production callers pass clearClaudePluginRootsCache.","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/plugins/marketplace/manager.ts#L31-L67","documentation":"assertRuntimePackageName validates package names used for marketplace plugin runtime packages: lowercase npm-style names (optional @scope/), max 214 chars. It throws when the name contains uppercase letters, spaces, or other disallowed characters, or exceeds the length limit. The invalid name is shown JSON-quoted for clarity.","triggerScenarios":"A marketplace catalog declares a plugin whose package name (or a name resolved via #resolvePluginPackageName / linkPath) violates RUNTIME_PACKAGE_NAME_RE — uppercase, invalid characters like spaces or ~ misuse, empty segment, or length > 214.","commonSituations":"Catalog author writing \"My Plugin\" or camelCase names in the plugins list; a name with a typo like \"@Scope/pkg\"; an overly long monorepo-scoped name exceeding npm's 214-char limit.","solutions":["Edit the marketplace catalog so the plugin's package name is lowercase and matches the npm name rules: optional @scope/ plus [a-z0-9][a-z0-9._~-]* segments.","Shorten names longer than 214 characters (usually pathological scope+name combinations).","Report the fix upstream if you don't control the marketplace catalog, or fork the catalog and correct the entry."],"exampleFix":"// before (catalog.json)\n{ \"name\": \"My Plugin\" }\n// after\n{ \"name\": \"my-plugin\" }","handlingStrategy":"validation","validationCode":"const NAME_RE = /^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$/;\nif (name.length > 214 || !NAME_RE.test(name)) {\n  throw new Error(`Plugin package name must be lowercase npm-style, max 214 chars: ${name}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Author catalog entries with lowercase, npm-conformant package names only.","Validate plugin package names in CI against the npm naming rules before publishing the catalog.","Keep scope+name under 214 characters."],"tags":["validation","naming","npm","marketplace"],"backgroundTag":"invalid-package-name","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}