can1357/oh-my-pi · error · Error

Invalid marketplace plugin package name: ${JSON.stringify(na

Error message

Invalid marketplace plugin package name: ${JSON.stringify(name)}

What it means

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.

Source

Thrown at packages/coding-agent/src/extensibility/plugins/marketplace/manager.ts:49

	writeMarketplacesRegistry,
} from "./registry";
import { resolvePluginSource } from "./source-resolver";
import type {
	InstalledPluginEntry,
	InstalledPluginSummary,
	InstalledPluginsRegistry,
	MarketplaceCatalog,
	MarketplacePluginEntry,
	MarketplaceRegistryEntry,
} from "./types";
import { buildPluginId, parsePluginId } from "./types";

const RUNTIME_PACKAGE_NAME_RE = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
const MAX_RUNTIME_PACKAGE_NAME_LENGTH = 214;

function assertRuntimePackageName(name: string): string {
	if (name.length > MAX_RUNTIME_PACKAGE_NAME_LENGTH || !RUNTIME_PACKAGE_NAME_RE.test(name)) {
		throw new Error(`Invalid marketplace plugin package name: ${JSON.stringify(name)}`);
	}
	return name;
}

// ── Options ──────────────────────────────────────────────────────────────────

export interface MarketplaceManagerOptions {
	marketplacesRegistryPath: string;
	installedRegistryPath: string;
	/**
	 * Path to the project-scoped installed_plugins.json.
	 * Required when installPlugin / uninstallPlugin is called with scope: "project".
	 * Resolved by resolveActiveProjectRegistryPath(cwd) in callers.
	 */
	projectInstalledRegistryPath?: string;
	marketplacesCacheDir: string;
	pluginsCacheDir: string;
	/** Injected for testing; production callers pass clearClaudePluginRootsCache.

View on GitHub (pinned to 9690622007)

Solutions

  1. 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.
  2. Shorten names longer than 214 characters (usually pathological scope+name combinations).
  3. Report the fix upstream if you don't control the marketplace catalog, or fork the catalog and correct the entry.

Example fix

// before (catalog.json)
{ "name": "My Plugin" }
// after
{ "name": "my-plugin" }
Defensive patterns

Strategy: validation

Validate before calling

const NAME_RE = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
if (name.length > 214 || !NAME_RE.test(name)) {
  throw new Error(`Plugin package name must be lowercase npm-style, max 214 chars: ${name}`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/59dac99e6eabe870. Report an issue: GitHub.