{"record":{"id":"98f7f14d10eecfcb","repo":"moeru-ai/airi","slug":"kit-kitid-is-not-registered","errorCode":null,"errorMessage":"Kit `${kitId}` is not registered.","messagePattern":"Kit `(.+?)` is not registered\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugin-sdk/src/plugin-host/core.ts","lineNumber":571,"sourceCode":"    }\n    await this.cleanupExtensionSessionModules(session)\n    await session.subscriptions.dispose()\n    this.extensionSessionService.remove(session.id)\n  }\n\n  private getModuleOrThrow(moduleId: string) {\n    const module = this.modules.get(moduleId)\n    if (!module) {\n      throw new Error(`Module \\`${moduleId}\\` was not found.`)\n    }\n\n    return module\n  }\n\n  private assertKitAvailableForRuntime(kitId: string, runtime: PluginRuntime) {\n    const kit = this.kits.get(kitId)\n    if (!kit) {\n      throw new Error(`Kit \\`${kitId}\\` is not registered.`)\n    }\n\n    if (!kit.runtimes.includes(runtime)) {\n      throw new Error(`Kit \\`${kitId}\\` is not available for runtime \\`${runtime}\\`.`)\n    }\n\n    return kit\n  }\n\n  listSessions() {\n    return this.extensionSessionService.list()\n  }\n\n  getSession(sessionId: string) {\n    return this.extensionSessionService.get(sessionId)\n  }\n\n  registerKit(kit: KitDescriptor) {","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/plugin-sdk/src/plugin-host/core.ts#L553-L589","documentation":"Thrown by assertKitAvailableForRuntime() when the kitId referenced by a binding operation is not present in the host's KitRegistryService. The host cannot announce a binding for a kit it does not know about, so it fails fast before creating any module record.","triggerScenarios":"Calling host.announceBinding(sessionId, { kitId, ... }) or host.bindExtensionKitModule(sessionId, { kitId, ... }) with a kitId that was never registered via host.registerKit() / the install context's registerKit.","commonSituations":"The host contribution that registers the kit (e.g. gameletKit descriptor via registerKit) was not installed before the extension tried to announce a binding. A typo in the kitId. The kit was unregistered before the binding call.","solutions":["Register the kit descriptor via host.registerKit(kitDescriptor) (or a host contribution's install context) before extensions announce bindings against it.","Verify the kitId string exactly matches the kit's declared id (e.g. 'kit.gamelet', not 'gamelet').","Use host.getKit(kitId) or host.listKits() to confirm registration before announcing."],"exampleFix":"// before\nawait host.announceBinding(sessionId, { kitId: 'kit.gamelet', ... }) // kit not registered\n\n// after\nhost.registerKit({ kitId: 'kit.gamelet', runtimes: ['electron'], capabilities: [] })\nawait host.announceBinding(sessionId, { kitId: 'kit.gamelet', ... })","handlingStrategy":"validation","validationCode":"const kit = host.getKit(kitId)\nif (!kit) {\n  throw new Error(`Kit '${kitId}' is not registered. Register it via host.registerKit(...) first.`)\n}\nhost.announceBinding(sessionId, { kitId, ... })","typeGuard":"function isKitRegistered(host: ExtensionHost, kitId: string): boolean {\n  return host.getKit(kitId) !== undefined\n}","tryCatchPattern":"try {\n  host.announceBinding(sessionId, { kitId, ... })\n} catch (error) {\n  if (error instanceof Error && /is not registered/.test(error.message)) {\n    // register the kit descriptor before retrying the binding\n  } else {\n    throw error\n  }\n}","preventionTips":["Install all kit contributions before starting extensions that bind against them.","Use the exact kit id string (e.g. 'kit.gamelet') declared by the kit descriptor.","Assert host.getKit(kitId) is defined in host bootstrap tests."],"tags":["kit","registry","not-found","binding","host-configuration"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}