{"record":{"id":"0ba6a51c8ff7c1dd","repo":"agalwood/Motrix","slug":"pluginruntimefault-0ba6a5","errorCode":"PluginRuntimeFault","errorMessage":"plugin.command.not_public","messagePattern":"plugin\\.command\\.not_public","errorType":"exception","errorClass":"AppError","httpStatus":null,"severity":"error","filePath":"src/core/plugin/commands/schema-cache.ts","lineNumber":76,"sourceCode":"        // on Ajv to throw on malformed input (caught below).\n        args = this.ajv.compile(cmd.argsSchema as AnySchema)\n        result = this.ajv.compile(cmd.resultSchema as AnySchema)\n      } catch (cause) {\n        throw new AppError(\n          ErrorCode.PluginManifestInvalid,\n          `plugin.command.schema_compile_failed: ${cmd.id}`,\n          cause instanceof Error ? cause.message : String(cause)\n        )\n      }\n      compiled.set(cmd.id, { args, result })\n    }\n    this.byPlugin.set(pluginId, compiled)\n  }\n\n  validateArgs(pluginId: string, commandId: string, args: unknown): void {\n    const pair = this.byPlugin.get(pluginId)?.get(commandId)\n    if (!pair) {\n      throw new AppError(\n        ErrorCode.PluginRuntimeFault,\n        'plugin.command.not_public'\n      )\n    }\n    if (!pair.args(args)) {\n      throw new AppError(\n        ErrorCode.PluginRuntimeFault,\n        `plugin.command.args_invalid: ${this.ajv.errorsText(pair.args.errors)}`\n      )\n    }\n  }\n\n  validateResult(pluginId: string, commandId: string, result: unknown): void {\n    const pair = this.byPlugin.get(pluginId)?.get(commandId)\n    if (!pair) {\n      // No validator installed — defensive no-op. CrossPluginInvoker only\n      // reaches this branch after a successful validateArgs lookup, so\n      // absence here means \"no compiled validator for this command\", not","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/agalwood/Motrix/blob/1a708ee57746c434e2c67a44bbf0906a976afea4/src/core/plugin/commands/schema-cache.ts#L58-L94","documentation":"Thrown by SchemaCache.validateArgs when no compiled validator pair exists for (pluginId, commandId). A pair only exists when the command was public:true AND had BOTH argsSchema and resultSchema compiled at install time; everything else is treated as 'not part of the public surface'. So this means the command is not exposed for cross-plugin invocation at all.","triggerScenarios":"validateArgs is called for a commandId that is private (public missing/false), missing one of its schemas, failed to compile (which would have aborted install), or belongs to a plugin whose schemas were never installed (or were uninstalled).","commonSituations":"A caller tries to invoke a command the callee never marked public; the callee forgot to ship argsSchema/resultSchema for a public command; the callee was uninstalled mid-flight; or a typo in the commandId resolves to a private command with the same name prefix.","solutions":["Confirm the callee command is declared with public:true and includes both argsSchema and resultSchema in its manifest.","Verify the exact commandId spelling against contributes.commands[].id in the callee manifest.","If reached from the invoker pipeline, note this is treated as a host bookkeeping problem (not the caller's fault) — the caller is not throttled for it.","Ensure SchemaCache.installCommandSchemas ran for the callee plugin and SchemaCache.uninstall was not prematurely called."],"exampleFix":"// before (callee manifest)\n{ id: \"acme.f.run\", argsSchema: {...}, resultSchema: {...} }\n\n// after\n{ id: \"acme.f.run\", public: true, argsSchema: {...}, resultSchema: {...} }","handlingStrategy":"validation","validationCode":"const cmd = callee.manifest.contributes.commands?.find((c) => c.id === commandId)\nif (!cmd || cmd.public !== true || !cmd.argsSchema || !cmd.resultSchema) { /* not invokable */ }","typeGuard":null,"tryCatchPattern":"try { schemas.validateArgs(pluginId, commandId, args) }\ncatch (e) { if (e.message === 'plugin.command.not_public') { /* command is private or missing schemas */ } else throw e }","preventionTips":["Only invoke commands declared public:true with both schemas.","Cross-check commandId spelling against contributes.commands[].id.","Ensure installCommandSchemas ran and uninstall wasn't called early."],"tags":["plugin","commands","schema","access-control"],"backgroundTag":null,"analyzedSha":"1a708ee57746c434e2c67a44bbf0906a976afea4","analyzedAt":"2026-08-12T16:18:09.346Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}