{"record":{"id":"6bfc8acb1f201f62","repo":"paperclipai/paperclip","slug":"capability-denied","errorCode":"CAPABILITY_DENIED","errorMessage":"Plugin \"${pluginId}\" is missing required capability \"${required}\" for method \"${method}\"","messagePattern":"Plugin \"(.+?)\" is missing required capability \"(.+?)\" for method \"(.+?)\"","errorType":"error_code","errorClass":"CapabilityDeniedError","httpStatus":null,"severity":"error","filePath":"packages/plugins/sdk/src/host-client-factory.ts","lineNumber":681,"sourceCode":"      return scopedCompanyId;\n    }\n\n    if (scopedCompanyId) return scopedCompanyId;\n\n    throw new InvocationScopeDeniedError(pluginId, method, \"company context is required\");\n  }\n\n  /**\n   * Assert that the plugin has the required capability for a method.\n   * Throws `CapabilityDeniedError` if the capability is missing.\n   */\n  function requireCapability(\n    method: WorkerToHostMethodName,\n  ): void {\n    const required = METHOD_CAPABILITY_MAP[method];\n    if (required === null) return; // No capability required\n    if (capabilitySet.has(required)) return;\n    throw new CapabilityDeniedError(pluginId, method, required);\n  }\n\n  /**\n   * Create a capability-gated proxy handler for a method.\n   *\n   * @param method - The RPC method name (used for capability lookup)\n   * @param handler - The actual handler implementation\n   * @returns A wrapper that checks capabilities before delegating\n   */\n  function gated<M extends WorkerToHostMethodName>(\n    method: M,\n    handler: HostHandler<M>,\n  ): HostHandler<M> {\n    return async (params: WorkerToHostMethods[M][0], context?: WorkerHostCallContext) => {\n      requireCapability(method);\n      requireInvocationCompanyScope(method, params, context);\n      return handler(params, context);\n    };","sourceCodeStart":663,"sourceCodeEnd":699,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sdk/src/host-client-factory.ts#L663-L699","documentation":"Error \"Plugin \"${pluginId}\" is missing required capability \"${required}\" for method \"${method}\"\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sdk/src/host-client-factory.ts:681 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Declare the required capability in the plugin manifest and reinstall/approve the plugin."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}