@ken-jo/agent-connector 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +9 -2
  2. package/dist/chunk-44HUXXC6.js +284 -0
  3. package/dist/chunk-44HUXXC6.js.map +1 -0
  4. package/dist/{chunk-AKJGNTU3.js → chunk-DS3LUFVN.js} +21 -21
  5. package/dist/chunk-DS3LUFVN.js.map +1 -0
  6. package/dist/{chunk-KHO5WNTP.js → chunk-KVAAFYRR.js} +18 -2
  7. package/dist/chunk-KVAAFYRR.js.map +1 -0
  8. package/dist/{chunk-O2SBA5KR.js → chunk-NJU275US.js} +9 -9
  9. package/dist/{chunk-WCETQWWK.js → chunk-OP4KBXUO.js} +1 -17
  10. package/dist/chunk-OP4KBXUO.js.map +1 -0
  11. package/dist/chunk-QADSG2JY.js +1989 -0
  12. package/dist/chunk-QADSG2JY.js.map +1 -0
  13. package/dist/{package-O63K4S7T.js → chunk-WNREHWKL.js} +20 -114
  14. package/dist/chunk-WNREHWKL.js.map +1 -0
  15. package/dist/{chunk-4ML7SZ7R.js → chunk-ZAM4M7LI.js} +7 -7
  16. package/dist/cli/sdk.js +1 -1
  17. package/dist/cli.js +1 -1
  18. package/dist/{detect-JK7T46N6.js → detect-MNDHGLSV.js} +3 -3
  19. package/dist/{doctor-62BHIXOR.js → doctor-N5KZDD55.js} +35 -5
  20. package/dist/doctor-N5KZDD55.js.map +1 -0
  21. package/dist/{hook-AC7APC66.js → hook-7LUOKIXH.js} +6 -6
  22. package/dist/{install-DMW2C7SV.js → install-TQTT4F3I.js} +31 -7
  23. package/dist/install-TQTT4F3I.js.map +1 -0
  24. package/dist/kilo-PKAJCWPX.js +852 -0
  25. package/dist/kilo-PKAJCWPX.js.map +1 -0
  26. package/dist/{kilo-cli-2RNODHWY.js → kilo-cli-QWUVXG2O.js} +157 -6
  27. package/dist/kilo-cli-QWUVXG2O.js.map +1 -0
  28. package/dist/{kimi-Q5RG7CYT.js → kimi-EVD7YKXS.js} +79 -4
  29. package/dist/kimi-EVD7YKXS.js.map +1 -0
  30. package/dist/{kiro-EKTRW424.js → kiro-UQRY6EIO.js} +68 -3
  31. package/dist/kiro-UQRY6EIO.js.map +1 -0
  32. package/dist/{leaderboard-R5HRJHNU.js → leaderboard-MUJ7DURM.js} +2 -2
  33. package/dist/package-SYPA5POO.js +130 -0
  34. package/dist/package-SYPA5POO.js.map +1 -0
  35. package/dist/{pi-SJPIL4VE.js → pi-WMTUX6ES.js} +102 -23
  36. package/dist/pi-WMTUX6ES.js.map +1 -0
  37. package/dist/{qwen-code-IFCM6BJY.js → qwen-code-MRRIUQ3P.js} +78 -5
  38. package/dist/qwen-code-MRRIUQ3P.js.map +1 -0
  39. package/dist/runtime/index.js +4 -4
  40. package/dist/{serve-LFOUSZAD.js → serve-XJOSA7BY.js} +6 -6
  41. package/dist/{status-M7JLZVLC.js → status-DYSS6BOR.js} +16 -7
  42. package/dist/status-DYSS6BOR.js.map +1 -0
  43. package/dist/{telemetry-3NVEXPYX.js → telemetry-IJ4GP2Q3.js} +2 -2
  44. package/dist/uninstall-3DXIBRCV.js +162 -0
  45. package/dist/uninstall-3DXIBRCV.js.map +1 -0
  46. package/dist/{upgrade-76BQZBMA.js → upgrade-GJEB3ITY.js} +26 -8
  47. package/dist/upgrade-GJEB3ITY.js.map +1 -0
  48. package/dist/{usage-G3GSCX23.js → usage-2BJLM3GJ.js} +2 -2
  49. package/dist/{usage-event-QUTMNBS5.js → usage-event-472X3DOY.js} +5 -5
  50. package/dist/{warp-LLOSXR7A.js → warp-X6MB67NT.js} +81 -3
  51. package/dist/warp-X6MB67NT.js.map +1 -0
  52. package/dist/{zed-HYOITK7F.js → zed-NTCYW4V2.js} +68 -3
  53. package/dist/zed-NTCYW4V2.js.map +1 -0
  54. package/package.json +1 -1
  55. package/dist/chunk-AKJGNTU3.js.map +0 -1
  56. package/dist/chunk-KHO5WNTP.js.map +0 -1
  57. package/dist/chunk-WCETQWWK.js.map +0 -1
  58. package/dist/chunk-Z2BVYKZL.js +0 -369
  59. package/dist/chunk-Z2BVYKZL.js.map +0 -1
  60. package/dist/doctor-62BHIXOR.js.map +0 -1
  61. package/dist/install-DMW2C7SV.js.map +0 -1
  62. package/dist/kilo-ISR5FBBJ.js +0 -408
  63. package/dist/kilo-ISR5FBBJ.js.map +0 -1
  64. package/dist/kilo-cli-2RNODHWY.js.map +0 -1
  65. package/dist/kimi-Q5RG7CYT.js.map +0 -1
  66. package/dist/kiro-EKTRW424.js.map +0 -1
  67. package/dist/package-O63K4S7T.js.map +0 -1
  68. package/dist/pi-SJPIL4VE.js.map +0 -1
  69. package/dist/qwen-code-IFCM6BJY.js.map +0 -1
  70. package/dist/status-M7JLZVLC.js.map +0 -1
  71. package/dist/uninstall-H6FGMIHN.js +0 -73
  72. package/dist/uninstall-H6FGMIHN.js.map +0 -1
  73. package/dist/upgrade-76BQZBMA.js.map +0 -1
  74. package/dist/warp-LLOSXR7A.js.map +0 -1
  75. package/dist/zed-HYOITK7F.js.map +0 -1
  76. /package/dist/{chunk-O2SBA5KR.js.map → chunk-NJU275US.js.map} +0 -0
  77. /package/dist/{chunk-4ML7SZ7R.js.map → chunk-ZAM4M7LI.js.map} +0 -0
  78. /package/dist/{detect-JK7T46N6.js.map → detect-MNDHGLSV.js.map} +0 -0
  79. /package/dist/{hook-AC7APC66.js.map → hook-7LUOKIXH.js.map} +0 -0
  80. /package/dist/{leaderboard-R5HRJHNU.js.map → leaderboard-MUJ7DURM.js.map} +0 -0
  81. /package/dist/{serve-LFOUSZAD.js.map → serve-XJOSA7BY.js.map} +0 -0
  82. /package/dist/{telemetry-3NVEXPYX.js.map → telemetry-IJ4GP2Q3.js.map} +0 -0
  83. /package/dist/{usage-G3GSCX23.js.map → usage-2BJLM3GJ.js.map} +0 -0
  84. /package/dist/{usage-event-QUTMNBS5.js.map → usage-event-472X3DOY.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/commands/doctor.ts","../src/runtime/probe.ts"],"sourcesContent":["/**\n * cli/commands/doctor — health-check every detected platform.\n *\n * For each detected host (or the explicit --targets list) we load its adapter,\n * build a uniform InstallContext, and run adapter.doctor(ctx). Results are\n * printed as pass/warn/fail with any suggested fix. Exit code is non-zero when\n * any check fails (warns alone do not fail the command).\n *\n * The connector context comes from the local config when present; otherwise a\n * minimal id-only connector is used so path-only checks still run.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport type {\n DiagnosticResult,\n InstallScope,\n PlatformId,\n ResolvedConnector,\n} from \"../../core/types.js\";\nimport type { InstallContext } from \"../../adapters/spi.js\";\nimport { detectInstalledPlatforms } from \"../../adapters/detect.js\";\nimport { loadAdapter, REGISTERED_PLATFORM_IDS } from \"../../adapters/registry.js\";\nimport {\n findConnectorConfig,\n listRegisteredConnectors,\n loadConnectorFromPath,\n} from \"../../core/load-connector.js\";\nimport { dataRoot, homeBinPath } from \"../../core/paths.js\";\nimport { probeStdioServer } from \"../../runtime/probe.js\";\nimport { fail, parseScope, parseTargets, print } from \"../app.js\";\n\nconst STATUS_GLYPH: Record<DiagnosticResult[\"status\"], string> = {\n pass: \"[pass]\",\n warn: \"[warn]\",\n fail: \"[FAIL]\",\n};\n\n/**\n * Resolve which connector(s) doctor should health-check, in precedence order:\n * 1. An explicit --connector path, or a local agent-connector.config.* file.\n * 2. Every connector registered under the data-root (what is actually\n * installed). This is the common case — `doctor` from anywhere reports on\n * the real installs, not a guess from the working directory.\n * 3. A minimal id-only placeholder so path-only checks still run.\n */\nasync function resolveDoctorConnectors(\n connectorPath: string | undefined,\n projectDir: string,\n): Promise<ResolvedConnector[]> {\n const configPath = connectorPath ?? findConnectorConfig(projectDir);\n if (configPath) {\n try {\n const { connector } = await loadConnectorFromPath(configPath);\n return [connector];\n } catch {\n /* fall through */\n }\n }\n\n const registered = listRegisteredConnectors();\n if (registered.length > 0) return registered;\n\n return [\n {\n id: \"agent-connector\",\n displayName: \"agent-connector\",\n version: \"0.0.0\",\n hooks: {},\n hookEvents: [],\n telemetry: {\n enabled: true,\n modelFamilyHint: \"auto\",\n measureToolDefs: true,\n hostNativeUsage: false,\n store: \"ndjson\",\n calibration: { anthropicCountTokens: false },\n },\n commands: [],\n skills: [],\n subagents: [],\n memory: [],\n platforms: {},\n targets: \"auto\",\n },\n ];\n}\n\nfunction buildContext(\n connector: ResolvedConnector,\n id: PlatformId,\n scope: InstallScope,\n projectDir: string,\n): InstallContext {\n return {\n connector,\n scope: connector.platforms[id]?.scope ?? scope,\n projectDir,\n homeBinPath: homeBinPath(),\n dataRoot: dataRoot(),\n dryRun: true,\n };\n}\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n scope: { type: \"string\", default: \"user\" },\n targets: { type: \"string\" },\n connector: { type: \"string\" },\n project: { type: \"string\" },\n json: { type: \"boolean\", default: false },\n probe: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n const projectDir = values.project ?? process.cwd();\n\n const scope = parseScope(values.scope);\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\n\n const connectors = await resolveDoctorConnectors(values.connector, projectDir);\n const multi = connectors.length > 1;\n\n // Target set: explicit --targets (intersected with the registry), else the\n // same chain install uses — connector-declared targets ∩ detected platforms\n // (\"auto\" = everything detected). Without this, doctor red-flags every\n // detected host the connector never targeted (found dogfooding context-mode:\n // targets:[5 ids] installed clean, doctor FAILed the other 9 detected hosts).\n const explicit = parseTargets(values.targets);\n let ids: PlatformId[];\n if (explicit && explicit.length > 0) {\n ids = explicit.filter((id) => REGISTERED_PLATFORM_IDS.has(id));\n } else {\n const detected = await detectInstalledPlatforms(projectDir);\n ids = detected.map((p) => p.id);\n const anyAuto = connectors.some((c) => c.targets === \"auto\");\n if (!anyAuto) {\n const targeted = new Set(connectors.flatMap((c) => c.targets as PlatformId[]));\n ids = ids.filter((id) => targeted.has(id));\n }\n }\n\n if (ids.length === 0 && !values.probe) {\n print(\"doctor: no target platforms (none detected; pass --targets to force).\");\n return 0;\n }\n\n const byPlatform: { platform: PlatformId; results: DiagnosticResult[] }[] = [];\n let anyFail = false;\n\n for (const id of ids) {\n const adapter = await loadAdapter(id);\n if (!adapter) {\n byPlatform.push({\n platform: id,\n results: [\n {\n check: `${id}: adapter`,\n status: \"fail\",\n message: `no adapter registered for ${id}`,\n },\n ],\n });\n anyFail = true;\n continue;\n }\n const results: DiagnosticResult[] = [];\n for (const connector of connectors) {\n // A connector with an explicit target list is only checked on those hosts.\n if (connector.targets !== \"auto\" && !connector.targets.includes(id)) continue;\n const ctx = buildContext(connector, id, scope, projectDir);\n let r: DiagnosticResult[];\n try {\n r = adapter.doctor(ctx);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n r = [{ check: `${adapter.name}: doctor`, status: \"fail\", message }];\n }\n // When checking multiple connectors, tag each check with the connector id.\n results.push(\n ...(multi\n ? r.map((d) => ({ ...d, check: `(${connector.id}) ${d.check}` }))\n : r),\n );\n }\n if (results.some((d) => d.status === \"fail\")) anyFail = true;\n byPlatform.push({ platform: id, results });\n }\n\n // ── Live MCP probe (--probe): connector-scoped, not platform-scoped ──────\n // Spawns each connector's REAL stdio server and runs initialize → ping →\n // tools/list. Probe FAILs fold into the doctor exit code.\n const probes: { connector: string; results: DiagnosticResult[] }[] = [];\n if (values.probe) {\n for (const connector of connectors) {\n const s = connector.server;\n if (!s || s.transport !== \"stdio\" || !s.command) {\n probes.push({\n connector: connector.id,\n results: [\n {\n check: `${connector.id}: MCP probe`,\n status: \"warn\",\n message: s\n ? `transport \"${s.transport}\" is not stdio — live probe skipped`\n : \"no server to probe\",\n },\n ],\n });\n continue;\n }\n const results = await probeStdioServer(s.command, s.args ?? [], {\n label: connector.id,\n ...(s.env ? { env: s.env } : {}),\n });\n if (results.some((d) => d.status === \"fail\")) anyFail = true;\n probes.push({ connector: connector.id, results });\n }\n }\n\n if (values.json) {\n print(JSON.stringify(values.probe ? { platforms: byPlatform, probes } : byPlatform, null, 2));\n return anyFail ? 1 : 0;\n }\n\n for (const { platform, results } of byPlatform) {\n print(`${platform}:`);\n for (const r of results) {\n print(` ${STATUS_GLYPH[r.status]} ${r.check} — ${r.message}`);\n if (r.fix) print(` fix: ${r.fix}`);\n }\n print(\"\");\n }\n for (const { connector, results } of probes) {\n print(`probe ${connector}:`);\n for (const r of results) {\n print(` ${STATUS_GLYPH[r.status]} ${r.check} — ${r.message}`);\n if (r.fix) print(` fix: ${r.fix}`);\n }\n print(\"\");\n }\n print(anyFail ? \"doctor: one or more checks FAILED.\" : \"doctor: all checks passed.\");\n return anyFail ? 1 : 0;\n}\n","/**\n * runtime/probe — a live MCP connection-lifecycle probe for `doctor --probe`.\n *\n * Where `doctor` checks files on disk, this spawns the connector's REAL stdio\n * server and speaks the MCP wire protocol to it: initialize → (read negotiated\n * protocolVersion + capabilities + serverInfo) → notifications/initialized →\n * ping (liveness) → tools/list (gated on the tools capability). It reuses the\n * SAME newline-delimited JSON-RPC framing + id-correlation as the telemetry\n * proxy (telemetry/jsonrpc), so the probe and the serve path read the wire\n * identically. Each step becomes a DiagnosticResult so doctor renders/aggregates\n * it uniformly; a dead/unlaunchable server FAILs (non-zero doctor exit).\n *\n * Negotiation rule: we OFFER {@link MCP_PROTOCOL_VERSION} but ACCEPT whatever\n * version the server returns (we only report it), per the spec — never a\n * hardcoded equality. There is no MCP shutdown message; we close stdin then\n * SIGTERM/SIGKILL.\n */\n\nimport type { DiagnosticResult } from \"../core/types.js\";\nimport { MCP_PROTOCOL_VERSION } from \"../core/mcp-standard.js\";\nimport { spawnChild } from \"../core/spawn-child.js\";\nimport { type JsonRpcMessage, LineBuffer, idKey, isObject } from \"../telemetry/jsonrpc.js\";\n\nconst DEFAULT_TIMEOUT_MS = 5000;\n\nexport interface ProbeOptions {\n /** Per-step timeout in ms (default 5000). */\n timeoutMs?: number;\n /** Prefix for each DiagnosticResult.check (e.g. the connector id). */\n label?: string;\n /** Env merged over process.env for the spawned server (${env:VAR} resolved). */\n env?: Record<string, string>;\n /** Protocol version offered in initialize. Default {@link MCP_PROTOCOL_VERSION}. */\n protocolVersion?: string;\n}\n\nfunction diag(\n status: DiagnosticResult[\"status\"],\n check: string,\n message: string,\n fix?: string,\n): DiagnosticResult {\n return { check, status, message, ...(fix ? { fix } : {}) };\n}\n\nfunction errMsg(e: unknown): string {\n return e instanceof Error ? e.message : String(e);\n}\n\n/** Resolve `${env:VAR}` references in env values against the current process env. */\nfunction resolveEnv(env: Record<string, string> | undefined): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(env ?? {})) {\n out[k] = v.replace(/\\$\\{env:([A-Za-z_][A-Za-z0-9_]*)\\}/g, (_m, name) => process.env[name] ?? \"\");\n }\n return out;\n}\n\n/**\n * Spawn the stdio MCP server `command args` and run a real lifecycle probe.\n * Always resolves (never rejects) with one DiagnosticResult per step.\n */\nexport async function probeStdioServer(\n command: string,\n args: string[],\n opts: ProbeOptions = {},\n): Promise<DiagnosticResult[]> {\n const label = opts.label ? `${opts.label}: ` : \"\";\n const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const protocolVersion = opts.protocolVersion ?? MCP_PROTOCOL_VERSION;\n const results: DiagnosticResult[] = [];\n\n // spawnChild resolves a bare Windows package runner (npx/uvx → .cmd/.exe) so\n // the probe agrees with the live serve path; no-op on macOS/Linux.\n const child = spawnChild(command, args, {\n stdio: [\"pipe\", \"pipe\", \"inherit\"],\n env: { ...process.env, ...resolveEnv(opts.env) },\n });\n\n interface Pending {\n resolve: (m: JsonRpcMessage) => void;\n reject: (e: Error) => void;\n }\n const pending = new Map<string, Pending>();\n let spawnErr: Error | null = null;\n let exitCode: number | null = null;\n\n const rejectAll = (e: Error): void => {\n for (const p of pending.values()) p.reject(e);\n pending.clear();\n };\n child.on(\"error\", (e) => {\n spawnErr = e;\n rejectAll(e);\n });\n child.on(\"exit\", (code) => {\n exitCode = code ?? 0;\n rejectAll(new Error(`server exited (code ${exitCode}) before responding`));\n });\n\n const lines = new LineBuffer((line) => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(line);\n } catch {\n return; // non-JSON stdout noise — ignore\n }\n if (!isObject(parsed)) return;\n const k = idKey((parsed as JsonRpcMessage).id);\n if (k && pending.has(k)) {\n const p = pending.get(k)!;\n pending.delete(k);\n p.resolve(parsed as JsonRpcMessage);\n }\n });\n child.stdout?.on(\"data\", (c: Buffer) => lines.push(c));\n\n const send = (m: JsonRpcMessage): void => {\n if (child.stdin && child.stdin.writable) child.stdin.write(`${JSON.stringify(m)}\\n`);\n };\n const request = (id: number | string, method: string, params?: unknown): Promise<JsonRpcMessage> => {\n const key = idKey(id)!;\n return new Promise<JsonRpcMessage>((resolve, reject) => {\n const timer = setTimeout(() => {\n pending.delete(key);\n reject(new Error(`no response within ${timeoutMs}ms`));\n }, timeoutMs);\n if (typeof timer.unref === \"function\") timer.unref();\n pending.set(key, {\n resolve: (m) => {\n clearTimeout(timer);\n resolve(m);\n },\n reject: (e) => {\n clearTimeout(timer);\n reject(e);\n },\n });\n send({ jsonrpc: \"2.0\", id, method, ...(params !== undefined ? { params } : {}) });\n });\n };\n\n const cleanup = (): DiagnosticResult[] => {\n try {\n if (child.stdin && child.stdin.writable) child.stdin.end();\n } catch {\n /* ignore */\n }\n try {\n child.kill(\"SIGTERM\");\n } catch {\n /* ignore */\n }\n const killTimer = setTimeout(() => {\n try {\n child.kill(\"SIGKILL\");\n } catch {\n /* ignore */\n }\n }, 500);\n if (typeof killTimer.unref === \"function\") killTimer.unref();\n return results;\n };\n\n // 1. initialize\n let initResult: Record<string, unknown>;\n try {\n const res = await request(1, \"initialize\", {\n protocolVersion,\n capabilities: {},\n clientInfo: { name: \"agent-connector-probe\", version: \"1\" },\n });\n if (isObject(res.error)) {\n results.push(\n diag(\"fail\", `${label}MCP initialize`, `server returned error: ${JSON.stringify(res.error)}`),\n );\n return cleanup();\n }\n initResult = isObject(res.result) ? res.result : {};\n } catch (e) {\n if (spawnErr) {\n results.push(\n diag(\n \"fail\",\n `${label}MCP initialize`,\n `server not launchable: ${errMsg(spawnErr)}`,\n `check that \"${command}\" is installed and on PATH`,\n ),\n );\n } else if (exitCode !== null) {\n // On Windows an unresolvable command surfaces as an early non-zero exit\n // (cmd.exe \"command not found\") rather than a spawn 'error' event, so fold\n // the not-launchable hint in here too — useful whether the command is\n // missing or the server genuinely crashed before initialize.\n results.push(\n diag(\n \"fail\",\n `${label}MCP initialize`,\n `server not launchable, or it exited (code ${exitCode}) before initialize`,\n `check that \"${command}\" is installed and on PATH`,\n ),\n );\n } else {\n results.push(diag(\"fail\", `${label}MCP initialize`, errMsg(e)));\n }\n return cleanup();\n }\n\n const serverInfo = isObject(initResult.serverInfo) ? initResult.serverInfo : {};\n const sName = typeof serverInfo.name === \"string\" ? serverInfo.name : \"unknown\";\n const sVer = typeof serverInfo.version === \"string\" ? serverInfo.version : \"?\";\n const negotiated =\n typeof initResult.protocolVersion === \"string\" ? initResult.protocolVersion : \"(none)\";\n results.push(diag(\"pass\", `${label}MCP initialize`, `serverInfo ${sName}@${sVer}, protocol ${negotiated}`));\n\n // capabilities (presence = feature offered)\n const caps = isObject(initResult.capabilities) ? initResult.capabilities : {};\n const capNames = [\"tools\", \"resources\", \"prompts\", \"logging\", \"completions\"].filter((c) => c in caps);\n results.push(\n diag(\"pass\", `${label}capabilities`, capNames.length > 0 ? capNames.join(\", \") : \"(none advertised)\"),\n );\n\n // 2. initialized notification (required before normal requests)\n send({ jsonrpc: \"2.0\", method: \"notifications/initialized\" });\n\n // 3. ping — liveness confirm (warn, not fail, on timeout)\n try {\n await request(\"probe-ping\", \"ping\");\n results.push(diag(\"pass\", `${label}ping`, \"alive\"));\n } catch (e) {\n results.push(diag(\"warn\", `${label}ping`, `no ping response (${errMsg(e)})`));\n }\n\n // 4. tools/list — only if the server advertised a tools capability\n if (\"tools\" in caps) {\n try {\n const res = await request(2, \"tools/list\", {});\n const r = isObject(res.result) ? res.result : {};\n const tools = Array.isArray(r.tools) ? r.tools : [];\n results.push(diag(\"pass\", `${label}tools/list`, `${tools.length} tool(s)`));\n } catch (e) {\n results.push(diag(\"fail\", `${label}tools/list`, `no tools/list response (${errMsg(e)})`));\n }\n } else {\n results.push(\n diag(\"warn\", `${label}tools/list`, \"skipped — server advertised no tools capability\"),\n );\n }\n\n return cleanup();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,iBAAiB;;;ACW1B,IAAM,qBAAqB;AAa3B,SAAS,KACP,QACA,OACA,SACA,KACkB;AAClB,SAAO,EAAE,OAAO,QAAQ,SAAS,GAAI,MAAM,EAAE,IAAI,IAAI,CAAC,EAAG;AAC3D;AAEA,SAAS,OAAO,GAAoB;AAClC,SAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAClD;AAGA,SAAS,WAAW,KAAiE;AACnF,QAAM,MAA8B,CAAC;AACrC,aAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,OAAO,CAAC,CAAC,GAAG;AAC9C,QAAI,CAAC,IAAI,EAAE,QAAQ,uCAAuC,CAAC,IAAI,SAAS,QAAQ,IAAI,IAAI,KAAK,EAAE;AAAA,EACjG;AACA,SAAO;AACT;AAMA,eAAsB,iBACpB,SACA,MACA,OAAqB,CAAC,GACO;AAC7B,QAAM,QAAQ,KAAK,QAAQ,GAAG,KAAK,KAAK,OAAO;AAC/C,QAAM,YAAY,KAAK,aAAa;AACpC,QAAM,kBAAkB,KAAK,mBAAmB;AAChD,QAAM,UAA8B,CAAC;AAIrC,QAAM,QAAQ,WAAW,SAAS,MAAM;AAAA,IACtC,OAAO,CAAC,QAAQ,QAAQ,SAAS;AAAA,IACjC,KAAK,EAAE,GAAG,QAAQ,KAAK,GAAG,WAAW,KAAK,GAAG,EAAE;AAAA,EACjD,CAAC;AAMD,QAAM,UAAU,oBAAI,IAAqB;AACzC,MAAI,WAAyB;AAC7B,MAAI,WAA0B;AAE9B,QA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A,EACV;AACA,aAAW,EAAE,WAAW,QAAQ,KAAK,QAAQ;AAC3C,UAAM,SAAS,SAAS,GAAG;AAC3B,eAAW,KAAK,SAAS;AACvB,YAAM,KAAK,aAAa,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,WAAM,EAAE,OAAO,EAAE;AAC7D,UAAI,EAAE,IAAK,OAAM,iBAAiB,EAAE,GAAG,EAAE;AAAA,IAC3C;AACA,UAAM,EAAE;AAAA,EACV;AACA,QAAM,UAAU,uCAAuC,4BAA4B;AACnF,SAAO,UAAU,IAAI;AACvB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/commands/install.ts"],"sourcesContent":["/**\n * cli/commands/install — deploy a connector across its target platforms.\n *\n * Resolves the connector config (--connector <path>, else findConnectorConfig\n * walking up from the project dir), loads it into a live ResolvedConnector, and\n * hands it to the installer orchestration. The resulting ChangeRecords are\n * rendered as a readable diff; --dry-run renders the plan without writing.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { installConnector } from \"../../core/installer.js\";\nimport { findConnectorConfig, loadConnectorFromPath } from \"../../core/load-connector.js\";\nimport { fail, parseScope, parseTargets, print, renderInstallResult } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n const { values } = parseArgs({\n args: argv,\n options: {\n scope: { type: \"string\", default: \"user\" },\n targets: { type: \"string\" },\n connector: { type: \"string\" },\n project: { type: \"string\" },\n \"dry-run\": { type: \"boolean\", default: false },\n // Memory surface: overwrite USER-EDITED managed blocks (hash drift).\n // Default behavior is warn-and-leave; --force backs the file up first.\n force: { type: \"boolean\", default: false },\n },\n allowPositionals: false,\n });\n\n const projectDir = values.project ?? process.cwd();\n const configPath = values.connector ?? findConnectorConfig(projectDir);\n if (!configPath) {\n return fail(\n \"no connector config found. Pass --connector <path> or add an \" +\n \"agent-connector.config.{mjs,js,json} to your project.\",\n );\n }\n\n const scope = parseScope(values.scope);\n if (scope == null) return fail(`invalid --scope \"${values.scope}\" (use user|project)`);\n\n const { connector, modulePath } = await loadConnectorFromPath(configPath);\n const targets = parseTargets(values.targets);\n\n const result = await installConnector({\n connector,\n modulePath,\n scope,\n projectDir,\n dryRun: values[\"dry-run\"],\n force: values.force,\n ...(targets ? { targets } : {}),\n });\n\n print(renderInstallResult(result, \"install\"));\n return result.changes.some((c) => c.action === \"warn\") ? 1 : 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,iBAAiB;AAM1B,eAAsB,IAAI,MAAiC;AACzD,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC3B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,OAAO,EAAE,MAAM,UAAU,SAAS,OAAO;AAAA,MACzC,SAAS,EAAE,MAAM,SAAS;AAAA,MAC1B,WAAW,EAAE,MAAM,SAAS;AAAA,MAC5B,SAAS,EAAE,MAAM,SAAS;AAAA,MAC1B,WAAW,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA;AAAA;AAAA,MAG7C,OAAO,EAAE,MAAM,WAAW,SAAS,MAAM;AAAA,IAC3C;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,aAAa,OAAO,WAAW,QAAQ,IAAI;AACjD,QAAM,aAAa,OAAO,aAAa,oBAAoB,UAAU;AACrE,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,MACL;AAAA,IAEF;AAAA,EACF;AAEA,QAAM,QAAQ,WAAW,OAAO,KAAK;AACrC,MAAI,SAAS,KAAM,QAAO,KAAK,oBAAoB,OAAO,KAAK,sBAAsB;AAErF,QAAM,EAAE,WAAW,WAAW,IAAI,MAAM,sBAAsB,UAAU;AACxE,QAAM,UAAU,aAAa,OAAO,OAAO;AAE3C,QAAM,SAAS,MAAM,iBAAiB;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,OAAO,SAAS;AAAA,IACxB,OAAO,OAAO;AAAA,IACd,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC/B,CAAC;AAED,QAAM,oBAAoB,QAAQ,SAAS,CAAC;AAC5C,SAAO,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,WAAW,MAAM,IAAI,IAAI;AAC/D;","names":[]}
@@ -1,408 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- resolveEnvRefsDeep
4
- } from "./chunk-DBQMX75U.js";
5
- import {
6
- BaseAdapter
7
- } from "./chunk-PD4VFEBY.js";
8
- import "./chunk-7L6ITC4T.js";
9
- import {
10
- buildServeWrapperCommand,
11
- shouldWrapForTelemetry
12
- } from "./chunk-MEH7GC7R.js";
13
- import "./chunk-N6HH7K6P.js";
14
- import "./chunk-TRQKHP7D.js";
15
-
16
- // src/adapters/kilo/index.ts
17
- import { existsSync } from "fs";
18
- import { homedir, platform as osPlatform } from "os";
19
- import { join } from "path";
20
- var HOST = "kilo";
21
- var MCP_ROOT_KEY = "mcp";
22
- var CONFIG_FILE = "kilo.json";
23
- var KILO_EXTENSION_ID = "kilocode.kilo-code";
24
- var LEGACY_MCP_SETTINGS_FILE = "mcp_settings.json";
25
- var LEGACY_CLINE_SETTINGS_FILE = "cline_mcp_settings.json";
26
- function kiloConfigDir() {
27
- const xdg = process.env.XDG_CONFIG_HOME;
28
- const base = xdg && xdg.trim() !== "" ? xdg : join(homedir(), ".config");
29
- return join(base, "kilo");
30
- }
31
- function vscodeUserDir() {
32
- const home = homedir();
33
- switch (osPlatform()) {
34
- case "darwin":
35
- return join(home, "Library", "Application Support", "Code", "User");
36
- case "win32": {
37
- const appData = process.env.APPDATA ?? join(home, "AppData", "Roaming");
38
- return join(appData, "Code", "User");
39
- }
40
- default:
41
- return join(home, ".config", "Code", "User");
42
- }
43
- }
44
- var KiloAdapter = class extends BaseAdapter {
45
- id = HOST;
46
- name = "Kilo Code";
47
- paradigm = "mcp-only";
48
- capabilities = {
49
- // Memory surface: AGENTS.md-first managed block (project <projectDir>/AGENTS.md
50
- // via the base default; user scope → ~/.kilocode/rules/agent-connector.md below).
51
- supportsMemory: true,
52
- // Kilo Code has no lifecycle hook system — every hook capability is false.
53
- preToolUse: false,
54
- postToolUse: false,
55
- preCompact: false,
56
- sessionStart: false,
57
- sessionEnd: false,
58
- userPromptSubmit: false,
59
- stop: false,
60
- notification: false,
61
- canModifyArgs: false,
62
- canModifyOutput: false,
63
- canInjectSessionContext: false,
64
- // Kilo Code registers stdio, SSE, and Streamable HTTP MCP servers.
65
- transports: ["stdio", "sse", "http"],
66
- // Content surfaces: Kilo Code authors slash commands and subagents natively,
67
- // but has NO Agent Skill (SKILL.md) surface — skills inherit the BaseAdapter
68
- // warn/skip. Both surfaces live under the extension's .kilocode/ dir.
69
- supportsCommands: true,
70
- supportsSkills: false,
71
- supportsSubagents: true
72
- };
73
- // ── Detection ────────────────────────────────────────────────────────────
74
- detectInstalled(projectDir) {
75
- const userConfig = this.userConfigPath();
76
- const userBackendDir = kiloConfigDir();
77
- const legacyExtDir = join(vscodeUserDir(), "globalStorage", KILO_EXTENSION_ID);
78
- const legacySettings = join(legacyExtDir, "settings", LEGACY_MCP_SETTINGS_FILE);
79
- const legacyClineSettings = join(
80
- legacyExtDir,
81
- "settings",
82
- LEGACY_CLINE_SETTINGS_FILE
83
- );
84
- const projectConfig = join(projectDir, ".kilo", CONFIG_FILE);
85
- const userMatch = existsSync(userConfig) || existsSync(userBackendDir) || existsSync(legacySettings) || existsSync(legacyClineSettings) || existsSync(legacyExtDir);
86
- const projectMatch = existsSync(projectConfig);
87
- const installed = userMatch || projectMatch;
88
- const scope = userMatch || !projectMatch ? "user" : "project";
89
- const configPath = scope === "user" ? userConfig : projectConfig;
90
- const reason = installed ? userMatch ? `found Kilo Code config under ${userBackendDir}` : `found Kilo Code project config at ${projectConfig}` : `no Kilo Code config at ${userBackendDir} or ${projectConfig}`;
91
- return {
92
- id: this.id,
93
- name: this.name,
94
- installed,
95
- paradigm: this.paradigm,
96
- capabilities: this.capabilities,
97
- configPath,
98
- scope,
99
- reason,
100
- confidence: installed ? "high" : "low"
101
- };
102
- }
103
- // ── Native paths ─────────────────────────────────────────────────────────
104
- /** Absolute path to the user-scope kilo.json (kilo backend, XDG dir). */
105
- userConfigPath() {
106
- return join(kiloConfigDir(), CONFIG_FILE);
107
- }
108
- // ── Memory surface: global rules dir at user scope ──────────────────────
109
- // Project scope stays on the AGENTS.md base default. User scope targets a
110
- // dedicated agent-connector.md in the legacy-compatible ~/.kilocode/rules/
111
- // dir (always loaded; avoids JSONC `instructions` edits in kilo.jsonc; the
112
- // AC-created file is cleanly deletable on uninstall). Shared backend with
113
- // kilo-cli — the convergent write dedupes via the content hash.
114
- memoryTargets(ctx) {
115
- if (this.memoryOverride(ctx)?.path || ctx.scope !== "user") {
116
- return super.memoryTargets(ctx);
117
- }
118
- return [
119
- {
120
- path: join(homedir(), ".kilocode", "rules", "agent-connector.md"),
121
- reason: "kilo global rules dir (~/.kilocode/rules; agent-connector-owned file)"
122
- }
123
- ];
124
- }
125
- /**
126
- * MCP config dir. Note the project surface is `.kilo/` (kilo backend), NOT the
127
- * extension's `.kilocode/` content tree (which still hosts commands/subagents).
128
- */
129
- getConfigDir(ctx) {
130
- return ctx.scope === "project" ? join(ctx.projectDir, ".kilo") : kiloConfigDir();
131
- }
132
- getServerConfigPath(ctx) {
133
- return ctx.scope === "project" ? join(ctx.projectDir, ".kilo", CONFIG_FILE) : this.userConfigPath();
134
- }
135
- /**
136
- * Kilo Code has no hook file — hooks are not a thing here. The hook "config
137
- * path" is the same kilo.json so the generic doctor/backup behave sensibly.
138
- */
139
- getHookConfigPath(ctx) {
140
- return this.getServerConfigPath(ctx);
141
- }
142
- // ── MCP server install / uninstall ───────────────────────────────────────
143
- installServer(ctx) {
144
- const { connector } = ctx;
145
- const override = connector.platforms[HOST]?.server;
146
- if (!connector.server || override === false) {
147
- return [
148
- {
149
- platform: this.id,
150
- action: "skip",
151
- detail: connector.server ? "server registration disabled for kilo" : "connector declares no MCP server"
152
- }
153
- ];
154
- }
155
- const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
156
- const serverPath = this.getServerConfigPath(ctx);
157
- const entry = this.renderServerEntry(ctx, server);
158
- return [
159
- this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
160
- ];
161
- }
162
- uninstallServer(ctx) {
163
- const serverPath = this.getServerConfigPath(ctx);
164
- return [
165
- this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
166
- ];
167
- }
168
- /**
169
- * Render a normalized ServerDef into kilo.json's native `mcp` entry. Local
170
- * (stdio) servers fold the executable + args into a SINGLE `command` array and
171
- * carry env under `environment`; remote servers use a `type:"remote"` URL entry.
172
- */
173
- renderServerEntry(ctx, server) {
174
- const transport = server.transport;
175
- if (transport === "stdio") {
176
- let command = server.command ?? "";
177
- let args = [...server.args ?? []];
178
- if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
179
- const wrapped = buildServeWrapperCommand(
180
- ctx.homeBinPath,
181
- ctx.connector.id,
182
- command,
183
- args,
184
- ctx.scope,
185
- this.id
186
- );
187
- command = wrapped.command;
188
- args = wrapped.args;
189
- }
190
- const argv = [
191
- resolveEnvRefsDeep(command),
192
- ...resolveEnvRefsDeep(args)
193
- ];
194
- const entry2 = {
195
- type: "local",
196
- command: argv,
197
- environment: this.renderEnv(server.env) ?? {}
198
- };
199
- return entry2;
200
- }
201
- const entry = {
202
- type: "remote",
203
- url: resolveEnvRefsDeep(server.url ?? "")
204
- };
205
- const headers = this.renderEnv(server.headers);
206
- if (headers) entry.headers = headers;
207
- return entry;
208
- }
209
- /**
210
- * Render env/header values. kilo.json documents no native interpolation token,
211
- * so resolve `${env:VAR}` references to literals at install time.
212
- */
213
- renderEnv(env) {
214
- if (!env || Object.keys(env).length === 0) return void 0;
215
- return resolveEnvRefsDeep({ ...env });
216
- }
217
- // ── Hooks (unavailable — Kilo Code is mcp-only) ──────────────────────────
218
- installHooks(_ctx) {
219
- return [
220
- {
221
- platform: this.id,
222
- action: "skip",
223
- detail: "hooks unavailable (Kilo Code is mcp-only)"
224
- }
225
- ];
226
- }
227
- uninstallHooks(_ctx) {
228
- return [
229
- {
230
- platform: this.id,
231
- action: "skip",
232
- detail: "hooks unavailable (Kilo Code is mcp-only)"
233
- }
234
- ];
235
- }
236
- // ── Content surfaces: commands / subagents (NO skills) ───────────────────
237
- // CONTENT-ONLY: pure native-file writers. No runtime dispatch, no home-bin
238
- // pointer, no telemetry wrap. Each method is idempotent (byte-identical →
239
- // skip) via BaseAdapter.writeContentFile and reversible via removeContentFile.
240
- // Honors platforms["kilo"] per-surface false to skip. Kilo Code has NO
241
- // SKILL.md surface, so skills inherit BaseAdapter's warn/skip default.
242
- //
243
- // NOTE on dirs: the .kilocode/ tree is the EXTENSION's content surface — kept
244
- // SEPARATE from the MCP backend dir (~/.config/kilo). Commands live under
245
- // .kilocode/commands (project) / ~/.kilocode/commands (user); subagents live
246
- // under .kilocode/agents (project) / ~/.kilocode/agents (user).
247
- /** The extension's user-scope content home (~/.kilocode), distinct from the MCP backend dir. */
248
- userContentDir() {
249
- return join(homedir(), ".kilocode");
250
- }
251
- /** Commands root: project → <projectDir>/.kilocode/commands; user → ~/.kilocode/commands. */
252
- commandsDir(ctx) {
253
- return ctx.scope === "project" ? join(ctx.projectDir, ".kilocode", "commands") : join(this.userContentDir(), "commands");
254
- }
255
- /** Subagents root: project → <projectDir>/.kilocode/agents; user → ~/.kilocode/agents. */
256
- agentsDir(ctx) {
257
- return ctx.scope === "project" ? join(ctx.projectDir, ".kilocode", "agents") : join(this.userContentDir(), "agents");
258
- }
259
- /** Native command file path: <commandsDir>/<name>.md. */
260
- commandPath(ctx, name) {
261
- return join(this.commandsDir(ctx), `${name}.md`);
262
- }
263
- /** Native subagent file path: <agentsDir>/<name>.md. */
264
- subagentPath(ctx, name) {
265
- return join(this.agentsDir(ctx), `${name}.md`);
266
- }
267
- // ── Commands ──────────────────────────────────────────────────────────────
268
- installCommands(ctx) {
269
- const { connector } = ctx;
270
- if (connector.platforms[HOST]?.commands === false) {
271
- return [{ platform: this.id, action: "skip", detail: "commands disabled for kilo" }];
272
- }
273
- if (connector.commands.length === 0) {
274
- return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
275
- }
276
- return connector.commands.map(
277
- (cmd) => this.writeContentFile(
278
- this.commandPath(ctx, cmd.name),
279
- this.renderCommand(cmd),
280
- ctx.dryRun
281
- )
282
- );
283
- }
284
- uninstallCommands(ctx) {
285
- const { connector } = ctx;
286
- if (connector.commands.length === 0) {
287
- return [{ platform: this.id, action: "skip", detail: "connector declares no commands" }];
288
- }
289
- return connector.commands.map(
290
- (cmd) => this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun)
291
- );
292
- }
293
- /** Render a command to md+frontmatter (description, argument-hint, mode, model). */
294
- renderCommand(cmd) {
295
- const frontmatter = {};
296
- if (cmd.description !== void 0) frontmatter.description = cmd.description;
297
- if (cmd.argumentHint !== void 0) frontmatter["argument-hint"] = cmd.argumentHint;
298
- if (cmd.model !== void 0) frontmatter.model = cmd.model;
299
- if (cmd.extra) Object.assign(frontmatter, cmd.extra);
300
- return this.renderFrontmatterMd(frontmatter, cmd.prompt);
301
- }
302
- // ── Subagents ───────────────────────────────────────────────────────────────
303
- installSubagents(ctx) {
304
- const { connector } = ctx;
305
- if (connector.platforms[HOST]?.subagents === false) {
306
- return [{ platform: this.id, action: "skip", detail: "subagents disabled for kilo" }];
307
- }
308
- if (connector.subagents.length === 0) {
309
- return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
310
- }
311
- return connector.subagents.map(
312
- (agent) => this.writeContentFile(
313
- this.subagentPath(ctx, agent.name),
314
- this.renderSubagent(agent),
315
- ctx.dryRun
316
- )
317
- );
318
- }
319
- uninstallSubagents(ctx) {
320
- const { connector } = ctx;
321
- if (connector.subagents.length === 0) {
322
- return [{ platform: this.id, action: "skip", detail: "connector declares no subagents" }];
323
- }
324
- return connector.subagents.map(
325
- (agent) => this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun)
326
- );
327
- }
328
- /**
329
- * Render a subagent to md+frontmatter. Kilo Code's shape is
330
- * (description, mode:"subagent", model, permission) with the system prompt as
331
- * the body. `name` is NOT a frontmatter field — it comes from the filename.
332
- * `permission` is derived from the coarse `readonly` knob: a readonly agent
333
- * gets a per-tool deny map (edit/bash) so it cannot mutate the workspace.
334
- */
335
- renderSubagent(agent) {
336
- const frontmatter = {
337
- description: agent.description,
338
- mode: "subagent"
339
- };
340
- if (agent.model !== void 0) frontmatter.model = agent.model;
341
- if (agent.readonly === true) {
342
- frontmatter.permission = { edit: "deny", bash: "deny" };
343
- }
344
- if (agent.extra) Object.assign(frontmatter, agent.extra);
345
- return this.renderFrontmatterMd(frontmatter, agent.prompt);
346
- }
347
- // ── Diagnostics ──────────────────────────────────────────────────────────
348
- getHealthChecks(ctx) {
349
- const mcpPath = this.getServerConfigPath(ctx);
350
- const connectorId = ctx.connector.id;
351
- const checks = [
352
- {
353
- name: `${this.name}: kilo.json present`,
354
- check: () => existsSync(mcpPath) ? { status: "OK", detail: mcpPath } : { status: "FAIL", detail: `not found: ${mcpPath}` }
355
- },
356
- {
357
- // Non-fatal note: the live MCP target is the delegated kilo backend
358
- // (kilo.json under ~/.config/kilo). The legacy globalStorage
359
- // mcp_settings.json is migration-only and is no longer written.
360
- name: `${this.name}: MCP delegated to kilo backend`,
361
- check: () => ({
362
- status: "OK",
363
- detail: ctx.scope === "user" ? `using ${CONFIG_FILE} under ${kiloConfigDir()} (legacy globalStorage is migration-only)` : `project scope uses .kilo/${CONFIG_FILE}`
364
- })
365
- },
366
- {
367
- name: `${this.name}: server entry registered`,
368
- check: () => {
369
- if (!ctx.connector.server) {
370
- return { status: "OK", detail: "no MCP server declared" };
371
- }
372
- const cfg = this.readJson(mcpPath);
373
- const bucket = cfg?.[MCP_ROOT_KEY];
374
- if (!cfg || !bucket) {
375
- return { status: "FAIL", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };
376
- }
377
- return connectorId in bucket ? { status: "OK", detail: `${MCP_ROOT_KEY}.${connectorId} present` } : {
378
- status: "FAIL",
379
- detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`
380
- };
381
- }
382
- }
383
- ];
384
- for (const cmd of ctx.connector.commands) {
385
- const p = this.commandPath(ctx, cmd.name);
386
- checks.push({
387
- name: `${this.name}: command ${cmd.name} present`,
388
- check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
389
- });
390
- }
391
- for (const agent of ctx.connector.subagents) {
392
- const p = this.subagentPath(ctx, agent.name);
393
- checks.push({
394
- name: `${this.name}: subagent ${agent.name} present`,
395
- check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
396
- });
397
- }
398
- return checks;
399
- }
400
- };
401
- var adapter = new KiloAdapter();
402
- var kilo_default = adapter;
403
- export {
404
- KiloAdapter,
405
- adapter,
406
- kilo_default as default
407
- };
408
- //# sourceMappingURL=kilo-ISR5FBBJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/adapters/kilo/index.ts"],"sourcesContent":["/**\n * adapters/kilo — Kilo Code (VS Code extension) platform adapter.\n *\n * Kilo Code (`kilocode.kilo-code`) is a Roo/Cline-fork VS Code extension, but as\n * of vsix 7.3.28 it DELEGATES MCP to the shared kilo backend — the SAME backend\n * the Kilo CLI (adapter id \"kilo-cli\") drives. It is an **mcp-only** host from\n * agent-connector's perspective: it exposes no lifecycle hook system, so MCP\n * server registration is the only thing we install and hooks are reported\n * unavailable.\n *\n * MCP config (vsix 7.3.28 — delegated to the kilo backend):\n * - user scope → ~/.config/kilo/kilo.json (XDG: $XDG_CONFIG_HOME/kilo)\n * - project scope → <projectDir>/.kilo/kilo.json\n * Both are JSON, root key **\"mcp\"**, entry shape\n * { type:\"local\", command:[exe,...args], environment:{} } (array command).\n * The legacy globalStorage `<vscodeUserDir>/globalStorage/kilocode.kilo-code/\n * settings/mcp_settings.json` (root \"mcpServers\") is MIGRATION-ONLY in 7.3.28\n * and is no longer the live write target — detectInstalled() still probes it so\n * an older install is recognized, but we install into kilo.json.\n *\n * COLLISION NOTE (kilo ext vs kilo-cli): both now share the SAME backend dir\n * `~/.config/kilo` AND the SAME root key `\"mcp\"`, but DIFFERENT filenames — the\n * VS Code extension writes **kilo.json**, the CLI writes **kilo.jsonc** (and the\n * CLI additionally carries a `plugin` array; the ext does not). They are kept\n * distinct platformIds with distinct files; their MCP dialect is now shared but\n * their config files never merge.\n *\n * Env interpolation: kilo.json documents no native `${env:VAR}` token, so we\n * resolve every `${env:VAR}` reference to a literal at install time — the\n * no-native-token path.\n *\n * The hook \"config path\" is the SAME kilo.json file (there is no hook file), so\n * the generic doctor/backup behave sensibly.\n *\n * Content surfaces (the `.kilocode/` dir is the extension's): Kilo Code authors\n * slash COMMANDS and SUBAGENTS natively but has NO Agent Skill (SKILL.md)\n * surface — skills inherit the BaseAdapter warn/skip. Commands are md+frontmatter\n * files under <projectDir>/.kilocode/commands (project) / <userConfigDir>/commands\n * (user); subagents are md+frontmatter files under .kilocode/agents. These are\n * pure file writers (no telemetry wrap, no home-bin pointer), idempotent on\n * byte-identical content, and removed on uninstall.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir, platform as osPlatform } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, InstallContext, MemoryTarget } from \"../spi.js\";\nimport type {\n ChangeRecord,\n CommandDef,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n SubagentDef,\n Transport,\n} from \"../../core/types.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildServeWrapperCommand,\n shouldWrapForTelemetry,\n} from \"../../core/spawn.js\";\n\nconst HOST: PlatformId = \"kilo\";\n/** vsix 7.3.28 root key in kilo.json (delegated kilo backend). */\nconst MCP_ROOT_KEY = \"mcp\";\n/** Live config filename for the VS Code ext (DISTINCT from the CLI's kilo.jsonc). */\nconst CONFIG_FILE = \"kilo.json\";\n\n/** Kilo Code extension id → its (legacy, migration-only) VS Code globalStorage folder. */\nconst KILO_EXTENSION_ID = \"kilocode.kilo-code\";\n/**\n * Legacy globalStorage MCP settings filenames (MIGRATION-ONLY in 7.3.28). The\n * Cline-family alternative is probed during detection so an older install is\n * still recognized; we no longer WRITE there.\n */\nconst LEGACY_MCP_SETTINGS_FILE = \"mcp_settings.json\";\nconst LEGACY_CLINE_SETTINGS_FILE = \"cline_mcp_settings.json\";\n\n/**\n * Native MCP server entry shapes kilo.json accepts under `mcp` (the delegated\n * kilo backend). Local (stdio) servers use a SINGLE array command that folds the\n * executable and its args together; env lives under `environment`.\n */\ninterface KiloLocalServer {\n type: \"local\";\n command: string[];\n environment: Record<string, string>;\n}\ninterface KiloRemoteServer {\n type: \"remote\";\n url: string;\n headers?: Record<string, string>;\n}\n\n/**\n * Resolve the kilo backend user config dir: `$XDG_CONFIG_HOME/kilo` when set,\n * else `~/.config/kilo`. This is the SAME backend dir kilo-cli uses (the two\n * differ only by filename — kilo.json here vs kilo.jsonc for the CLI).\n */\nfunction kiloConfigDir(): string {\n const xdg = process.env.XDG_CONFIG_HOME;\n const base =\n xdg && xdg.trim() !== \"\" ? xdg : join(homedir(), \".config\");\n return join(base, \"kilo\");\n}\n\n/**\n * Resolve the cross-OS VS Code per-user data directory (the \"User\" folder that\n * contains `globalStorage`) — used ONLY to probe the legacy migration-only MCP\n * settings file during detection. See module header for the per-platform mapping.\n */\nfunction vscodeUserDir(): string {\n const home = homedir();\n switch (osPlatform()) {\n case \"darwin\":\n return join(home, \"Library\", \"Application Support\", \"Code\", \"User\");\n case \"win32\": {\n const appData = process.env.APPDATA ?? join(home, \"AppData\", \"Roaming\");\n return join(appData, \"Code\", \"User\");\n }\n default:\n // Linux / other POSIX: XDG-style config dir.\n return join(home, \".config\", \"Code\", \"User\");\n }\n}\n\nexport class KiloAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Kilo Code\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block (project <projectDir>/AGENTS.md\n // via the base default; user scope → ~/.kilocode/rules/agent-connector.md below).\n supportsMemory: true,\n // Kilo Code has no lifecycle hook system — every hook capability is false.\n preToolUse: false,\n postToolUse: false,\n preCompact: false,\n sessionStart: false,\n sessionEnd: false,\n userPromptSubmit: false,\n stop: false,\n notification: false,\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Kilo Code registers stdio, SSE, and Streamable HTTP MCP servers.\n transports: [\"stdio\", \"sse\", \"http\"],\n // Content surfaces: Kilo Code authors slash commands and subagents natively,\n // but has NO Agent Skill (SKILL.md) surface — skills inherit the BaseAdapter\n // warn/skip. Both surfaces live under the extension's .kilocode/ dir.\n supportsCommands: true,\n supportsSkills: false,\n supportsSubagents: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userConfig = this.userConfigPath();\n const userBackendDir = kiloConfigDir();\n // Probe the legacy (migration-only) globalStorage MCP settings too so an\n // older install is still recognized; we never WRITE there anymore.\n const legacyExtDir = join(vscodeUserDir(), \"globalStorage\", KILO_EXTENSION_ID);\n const legacySettings = join(legacyExtDir, \"settings\", LEGACY_MCP_SETTINGS_FILE);\n const legacyClineSettings = join(\n legacyExtDir,\n \"settings\",\n LEGACY_CLINE_SETTINGS_FILE,\n );\n const projectConfig = join(projectDir, \".kilo\", CONFIG_FILE);\n\n const userMatch =\n existsSync(userConfig) ||\n existsSync(userBackendDir) ||\n existsSync(legacySettings) ||\n existsSync(legacyClineSettings) ||\n existsSync(legacyExtDir);\n const projectMatch = existsSync(projectConfig);\n const installed = userMatch || projectMatch;\n\n // Prefer the user scope/path when present; otherwise surface the project one.\n const scope = userMatch || !projectMatch ? \"user\" : \"project\";\n const configPath = scope === \"user\" ? userConfig : projectConfig;\n const reason = installed\n ? userMatch\n ? `found Kilo Code config under ${userBackendDir}`\n : `found Kilo Code project config at ${projectConfig}`\n : `no Kilo Code config at ${userBackendDir} or ${projectConfig}`;\n\n return {\n id: this.id,\n name: this.name,\n installed,\n paradigm: this.paradigm,\n capabilities: this.capabilities,\n configPath,\n scope,\n reason,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /** Absolute path to the user-scope kilo.json (kilo backend, XDG dir). */\n private userConfigPath(): string {\n return join(kiloConfigDir(), CONFIG_FILE);\n }\n\n // ── Memory surface: global rules dir at user scope ──────────────────────\n // Project scope stays on the AGENTS.md base default. User scope targets a\n // dedicated agent-connector.md in the legacy-compatible ~/.kilocode/rules/\n // dir (always loaded; avoids JSONC `instructions` edits in kilo.jsonc; the\n // AC-created file is cleanly deletable on uninstall). Shared backend with\n // kilo-cli — the convergent write dedupes via the content hash.\n protected override memoryTargets(ctx: InstallContext): MemoryTarget[] {\n if (this.memoryOverride(ctx)?.path || ctx.scope !== \"user\") {\n return super.memoryTargets(ctx);\n }\n return [\n {\n path: join(homedir(), \".kilocode\", \"rules\", \"agent-connector.md\"),\n reason: \"kilo global rules dir (~/.kilocode/rules; agent-connector-owned file)\",\n },\n ];\n }\n\n /**\n * MCP config dir. Note the project surface is `.kilo/` (kilo backend), NOT the\n * extension's `.kilocode/` content tree (which still hosts commands/subagents).\n */\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kilo\")\n : kiloConfigDir();\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kilo\", CONFIG_FILE)\n : this.userConfigPath();\n }\n\n /**\n * Kilo Code has no hook file — hooks are not a thing here. The hook \"config\n * path\" is the same kilo.json so the generic doctor/backup behave sensibly.\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── MCP server install / uninstall ───────────────────────────────────────\n\n installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n const override = connector.platforms[HOST]?.server;\n if (!connector.server || override === false) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: connector.server\n ? \"server registration disabled for kilo\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n // Shallow-merge any per-platform server override into the base ServerDef.\n const server: ServerDef =\n override && typeof override === \"object\"\n ? { ...connector.server, ...override }\n : connector.server;\n\n const serverPath = this.getServerConfigPath(ctx);\n const entry = this.renderServerEntry(ctx, server);\n\n return [\n this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun),\n ];\n }\n\n uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const serverPath = this.getServerConfigPath(ctx);\n return [\n this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun),\n ];\n }\n\n /**\n * Render a normalized ServerDef into kilo.json's native `mcp` entry. Local\n * (stdio) servers fold the executable + args into a SINGLE `command` array and\n * carry env under `environment`; remote servers use a `type:\"remote\"` URL entry.\n */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): KiloLocalServer | KiloRemoteServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n // Transparent telemetry wrapping: route the real command through\n // `<homeBin> serve --connector <id> -- <command> <args...>`.\n if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {\n const wrapped = buildServeWrapperCommand(\n ctx.homeBinPath,\n ctx.connector.id,\n command,\n args,\n ctx.scope,\n this.id,\n );\n command = wrapped.command;\n args = wrapped.args;\n }\n\n // kilo.json documents no native interpolation token, so resolve every\n // ${env:VAR} to a literal at install time. The command + args fold into a\n // single array (exe first), matching the kilo backend's `command` shape.\n const argv: string[] = [\n resolveEnvRefsDeep(command),\n ...resolveEnvRefsDeep(args),\n ];\n const entry: KiloLocalServer = {\n type: \"local\",\n command: argv,\n environment: this.renderEnv(server.env) ?? {},\n };\n return entry;\n }\n\n // sse / http (and any other remote transport) — kilo registers a remote URL.\n const entry: KiloRemoteServer = {\n type: \"remote\",\n url: resolveEnvRefsDeep(server.url ?? \"\"),\n };\n const headers = this.renderEnv(server.headers);\n if (headers) entry.headers = headers;\n return entry;\n }\n\n /**\n * Render env/header values. kilo.json documents no native interpolation token,\n * so resolve `${env:VAR}` references to literals at install time.\n */\n private renderEnv(\n env: Record<string, string> | undefined,\n ): Record<string, string> | undefined {\n if (!env || Object.keys(env).length === 0) return undefined;\n return resolveEnvRefsDeep({ ...env });\n }\n\n // ── Hooks (unavailable — Kilo Code is mcp-only) ──────────────────────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Kilo Code is mcp-only)\",\n },\n ];\n }\n\n uninstallHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Kilo Code is mcp-only)\",\n },\n ];\n }\n\n // ── Content surfaces: commands / subagents (NO skills) ───────────────────\n // CONTENT-ONLY: pure native-file writers. No runtime dispatch, no home-bin\n // pointer, no telemetry wrap. Each method is idempotent (byte-identical →\n // skip) via BaseAdapter.writeContentFile and reversible via removeContentFile.\n // Honors platforms[\"kilo\"] per-surface false to skip. Kilo Code has NO\n // SKILL.md surface, so skills inherit BaseAdapter's warn/skip default.\n //\n // NOTE on dirs: the .kilocode/ tree is the EXTENSION's content surface — kept\n // SEPARATE from the MCP backend dir (~/.config/kilo). Commands live under\n // .kilocode/commands (project) / ~/.kilocode/commands (user); subagents live\n // under .kilocode/agents (project) / ~/.kilocode/agents (user).\n\n /** The extension's user-scope content home (~/.kilocode), distinct from the MCP backend dir. */\n private userContentDir(): string {\n return join(homedir(), \".kilocode\");\n }\n\n /** Commands root: project → <projectDir>/.kilocode/commands; user → ~/.kilocode/commands. */\n private commandsDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kilocode\", \"commands\")\n : join(this.userContentDir(), \"commands\");\n }\n /** Subagents root: project → <projectDir>/.kilocode/agents; user → ~/.kilocode/agents. */\n private agentsDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kilocode\", \"agents\")\n : join(this.userContentDir(), \"agents\");\n }\n\n /** Native command file path: <commandsDir>/<name>.md. */\n private commandPath(ctx: InstallContext, name: string): string {\n return join(this.commandsDir(ctx), `${name}.md`);\n }\n /** Native subagent file path: <agentsDir>/<name>.md. */\n private subagentPath(ctx: InstallContext, name: string): string {\n return join(this.agentsDir(ctx), `${name}.md`);\n }\n\n // ── Commands ──────────────────────────────────────────────────────────────\n\n override installCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.commands === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"commands disabled for kilo\" }];\n }\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.writeContentFile(\n this.commandPath(ctx, cmd.name),\n this.renderCommand(cmd),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallCommands(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.commands.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no commands\" }];\n }\n return connector.commands.map((cmd) =>\n this.removeContentFile(this.commandPath(ctx, cmd.name), ctx.dryRun),\n );\n }\n\n /** Render a command to md+frontmatter (description, argument-hint, mode, model). */\n private renderCommand(cmd: CommandDef): string {\n const frontmatter: Record<string, unknown> = {};\n if (cmd.description !== undefined) frontmatter.description = cmd.description;\n if (cmd.argumentHint !== undefined) frontmatter[\"argument-hint\"] = cmd.argumentHint;\n // `mode` is not a core CommandDef field; it arrives via `extra` (escape\n // hatch) so a connector can pin a specific Kilo mode. Merged below.\n if (cmd.model !== undefined) frontmatter.model = cmd.model;\n if (cmd.extra) Object.assign(frontmatter, cmd.extra);\n return this.renderFrontmatterMd(frontmatter, cmd.prompt);\n }\n\n // ── Subagents ───────────────────────────────────────────────────────────────\n\n override installSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.subagents === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"subagents disabled for kilo\" }];\n }\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.writeContentFile(\n this.subagentPath(ctx, agent.name),\n this.renderSubagent(agent),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallSubagents(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.subagents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no subagents\" }];\n }\n return connector.subagents.map((agent) =>\n this.removeContentFile(this.subagentPath(ctx, agent.name), ctx.dryRun),\n );\n }\n\n /**\n * Render a subagent to md+frontmatter. Kilo Code's shape is\n * (description, mode:\"subagent\", model, permission) with the system prompt as\n * the body. `name` is NOT a frontmatter field — it comes from the filename.\n * `permission` is derived from the coarse `readonly` knob: a readonly agent\n * gets a per-tool deny map (edit/bash) so it cannot mutate the workspace.\n */\n private renderSubagent(agent: SubagentDef): string {\n const frontmatter: Record<string, unknown> = {\n description: agent.description,\n mode: \"subagent\",\n };\n if (agent.model !== undefined) frontmatter.model = agent.model;\n if (agent.readonly === true) {\n frontmatter.permission = { edit: \"deny\", bash: \"deny\" };\n }\n if (agent.extra) Object.assign(frontmatter, agent.extra);\n return this.renderFrontmatterMd(frontmatter, agent.prompt);\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const mcpPath = this.getServerConfigPath(ctx);\n const connectorId = ctx.connector.id;\n const checks: HealthCheck[] = [\n {\n name: `${this.name}: kilo.json present`,\n check: () =>\n existsSync(mcpPath)\n ? { status: \"OK\", detail: mcpPath }\n : { status: \"FAIL\", detail: `not found: ${mcpPath}` },\n },\n {\n // Non-fatal note: the live MCP target is the delegated kilo backend\n // (kilo.json under ~/.config/kilo). The legacy globalStorage\n // mcp_settings.json is migration-only and is no longer written.\n name: `${this.name}: MCP delegated to kilo backend`,\n check: () => ({\n status: \"OK\",\n detail:\n ctx.scope === \"user\"\n ? `using ${CONFIG_FILE} under ${kiloConfigDir()} (legacy globalStorage is migration-only)`\n : `project scope uses .kilo/${CONFIG_FILE}`,\n }),\n },\n {\n name: `${this.name}: server entry registered`,\n check: () => {\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<{ [k: string]: Record<string, unknown> }>(mcpPath);\n const bucket = cfg?.[MCP_ROOT_KEY];\n if (!cfg || !bucket) {\n return { status: \"FAIL\", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };\n }\n return connectorId in bucket\n ? { status: \"OK\", detail: `${MCP_ROOT_KEY}.${connectorId} present` }\n : {\n status: \"FAIL\",\n detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`,\n };\n },\n },\n ];\n\n // Content-surface checks: only assert presence of the files this connector\n // declares (skills are unsupported on Kilo Code, so none are asserted here).\n for (const cmd of ctx.connector.commands) {\n const p = this.commandPath(ctx, cmd.name);\n checks.push({\n name: `${this.name}: command ${cmd.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n for (const agent of ctx.connector.subagents) {\n const p = this.subagentPath(ctx, agent.name);\n checks.push({\n name: `${this.name}: subagent ${agent.name} present`,\n check: () =>\n existsSync(p) ? { status: \"OK\", detail: p } : { status: \"FAIL\", detail: `not found: ${p}` },\n });\n }\n return checks;\n }\n}\n\nexport const adapter = new KiloAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;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