@ken-jo/agent-connector 0.4.79 → 0.4.92
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.
- package/README.md +302 -561
- package/dist/{action-OHGFVKMC.js → action-CVIEPX4U.js} +14 -14
- package/dist/{amazon-q-B52EY2SV.js → amazon-q-TIT7FIW3.js} +5 -5
- package/dist/{amp-UXABVUKC.js → amp-NF3OAAUG.js} +5 -5
- package/dist/{antigravity-RZHN53VB.js → antigravity-7LPK7QOY.js} +6 -6
- package/dist/antigravity-cli-MDEMPPAH.js +467 -0
- package/dist/antigravity-cli-MDEMPPAH.js.map +1 -0
- package/dist/{chunk-QKLJU4JX.js → chunk-2Y2MZRLP.js} +56 -2
- package/dist/chunk-2Y2MZRLP.js.map +1 -0
- package/dist/{chunk-UBB7T54N.js → chunk-3C5AASHM.js} +3 -3
- package/dist/{chunk-LKAVD4HP.js → chunk-447JWFZO.js} +12 -12
- package/dist/{chunk-HORHRHNG.js → chunk-4NHXLXSD.js} +2 -2
- package/dist/chunk-5Z36KVU2.js +590 -0
- package/dist/chunk-5Z36KVU2.js.map +1 -0
- package/dist/{chunk-AY3RGRTT.js → chunk-6TF7MHG5.js} +2 -2
- package/dist/{chunk-AMK2K6XZ.js → chunk-7UT6OB52.js} +2 -2
- package/dist/{chunk-PZHB5TVA.js → chunk-AY3VFNOH.js} +5 -5
- package/dist/{chunk-4HVQ7IUM.js → chunk-DI5S6TXJ.js} +17 -4
- package/dist/chunk-DI5S6TXJ.js.map +1 -0
- package/dist/{chunk-ZXX5DVSE.js → chunk-FBCBHEGB.js} +8 -8
- package/dist/{chunk-4NSU3KWX.js → chunk-FJCUKXGX.js} +2 -2
- package/dist/{chunk-S4E6QQEM.js → chunk-FO5CEXXN.js} +7 -2
- package/dist/chunk-FO5CEXXN.js.map +1 -0
- package/dist/{chunk-IXOQDZWC.js → chunk-GZGLCCEE.js} +5 -1
- package/dist/chunk-GZGLCCEE.js.map +1 -0
- package/dist/{chunk-UYZ53KWS.js → chunk-IBLYVAWH.js} +31 -9
- package/dist/chunk-IBLYVAWH.js.map +1 -0
- package/dist/{chunk-4FWETID5.js → chunk-IVAWP6HH.js} +2 -2
- package/dist/{chunk-NBUEL74R.js → chunk-JFXL4HYA.js} +3 -3
- package/dist/{chunk-VD4EG6SG.js → chunk-JO2IM2JL.js} +538 -226
- package/dist/chunk-JO2IM2JL.js.map +1 -0
- package/dist/{chunk-7NXEHZAK.js → chunk-JVO6NBTT.js} +3 -3
- package/dist/{chunk-X457NOFE.js → chunk-KA55FISM.js} +116 -36
- package/dist/chunk-KA55FISM.js.map +1 -0
- package/dist/{chunk-YJP3KGLM.js → chunk-L26PSQTY.js} +4 -4
- package/dist/{chunk-YYNXIUR2.js → chunk-M2H7JURF.js} +2 -2
- package/dist/{chunk-56R2ER7K.js → chunk-NBYKLUF6.js} +2 -2
- package/dist/{chunk-IRUYJD23.js → chunk-NLE2J5P4.js} +1 -1
- package/dist/{chunk-VVFDU4IX.js → chunk-WFEHWTLM.js} +12 -5
- package/dist/{chunk-VVFDU4IX.js.map → chunk-WFEHWTLM.js.map} +1 -1
- package/dist/{chunk-LN76OGNR.js → chunk-Z2MRSS2I.js} +2 -2
- package/dist/{claude-code-T6ZRCMA7.js → claude-code-7RS4YVGZ.js} +9 -9
- package/dist/cli/sdk.js +7 -7
- package/dist/cli.js +1 -1
- package/dist/{cline-NNMVCECA.js → cline-BZQAUYPC.js} +5 -5
- package/dist/codebuddy-G42IKGKB.js +643 -0
- package/dist/codebuddy-G42IKGKB.js.map +1 -0
- package/dist/{codebuff-RJIDSEU3.js → codebuff-5RLTLZAU.js} +5 -5
- package/dist/{codex-RHKQKNNG.js → codex-XHAMJILX.js} +14 -8
- package/dist/{codex-RHKQKNNG.js.map → codex-XHAMJILX.js.map} +1 -1
- package/dist/{continue-MNM7YVJY.js → continue-JLIB7R7X.js} +6 -6
- package/dist/{copilot-cli-SMTX5F65.js → copilot-cli-XZSUYNQZ.js} +5 -5
- package/dist/{crush-NYDBHIJE.js → crush-ESERLVLT.js} +5 -5
- package/dist/{cursor-AOELDNZU.js → cursor-FUDOV5VK.js} +6 -6
- package/dist/{detect-ALAKE54S.js → detect-Z5BDTY6B.js} +4 -4
- package/dist/devin-Y7PWKVHY.js +510 -0
- package/dist/devin-Y7PWKVHY.js.map +1 -0
- package/dist/{doctor-UNF7FCF4.js → doctor-GAP27PP2.js} +27 -23
- package/dist/doctor-GAP27PP2.js.map +1 -0
- package/dist/{droid-PTCH2K7Y.js → droid-DTO5POTK.js} +5 -5
- package/dist/{gemini-cli-QGLN2UMS.js → gemini-cli-RBIG6U2F.js} +5 -5
- package/dist/{goose-DQ6GSZ5O.js → goose-VGNOP5J2.js} +6 -6
- package/dist/grok-cli-2RFBK6J3.js +482 -0
- package/dist/grok-cli-2RFBK6J3.js.map +1 -0
- package/dist/{hermes-E47IG63A.js → hermes-NUKFWZI5.js} +6 -6
- package/dist/{hook-GM2IDA3C.js → hook-XPR3AHDI.js} +14 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/install-O32TDIZP.js +382 -0
- package/dist/install-O32TDIZP.js.map +1 -0
- package/dist/{introspect-5o5ick0_.d.ts → introspect-BkId4LGP.d.ts} +1 -1
- package/dist/{jetbrains-copilot-4IOT3I2Y.js → jetbrains-copilot-FXZ5AOTS.js} +31 -9
- package/dist/jetbrains-copilot-FXZ5AOTS.js.map +1 -0
- package/dist/junie-TSXIZSCE.js +227 -0
- package/dist/junie-TSXIZSCE.js.map +1 -0
- package/dist/{kilo-TAHOPT2Q.js → kilo-JLH3KVZJ.js} +8 -8
- package/dist/{kilo-cli-X4NPJWGX.js → kilo-cli-5W36VJQZ.js} +8 -8
- package/dist/{kimi-Z7L2LEEI.js → kimi-R62W7HKZ.js} +5 -5
- package/dist/{kiro-YZ4TTZGD.js → kiro-AUJMGIBL.js} +81 -6
- package/dist/kiro-AUJMGIBL.js.map +1 -0
- package/dist/{leaderboard-DVW4WYJ6.js → leaderboard-YWMOSJBC.js} +7 -7
- package/dist/{mimo-code-G2CBZ4M6.js → mimo-code-PGLFFVER.js} +5 -5
- package/dist/mistral-vibe-36CZVQNQ.js +300 -0
- package/dist/mistral-vibe-36CZVQNQ.js.map +1 -0
- package/dist/{mux-JNM3F2NW.js → mux-HWL4N5KH.js} +5 -5
- package/dist/{nemoclaw-SHA4IUML.js → nemoclaw-QPHETUXM.js} +6 -6
- package/dist/{omp-OOVUNXME.js → omp-3TFMTJ5U.js} +5 -5
- package/dist/open-interpreter-UTBKE2EH.js +264 -0
- package/dist/open-interpreter-UTBKE2EH.js.map +1 -0
- package/dist/openclaw-RYFO5TLY.js +17 -0
- package/dist/{opencode-W2RK4M7G.js → opencode-JX7GBE5Q.js} +5 -5
- package/dist/openhands-AZW4PXJ3.js +384 -0
- package/dist/openhands-AZW4PXJ3.js.map +1 -0
- package/dist/{package-H5V3AZHR.js → package-2KKUGZFS.js} +13 -13
- package/dist/{pi-I7BLL4EI.js → pi-MRI3EBWU.js} +143 -6
- package/dist/pi-MRI3EBWU.js.map +1 -0
- package/dist/{qwen-code-JG7AF442.js → qwen-code-ISR6BEET.js} +9 -9
- package/dist/{roo-code-L5F7S6QH.js → roo-code-6TSCME4R.js} +5 -5
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +12 -12
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.js +6 -6
- package/dist/sdk/test.d.ts +2 -2
- package/dist/sdk/test.js +10 -10
- package/dist/{serve-WMO2TUW3.js → serve-EPRN7F2X.js} +14 -14
- package/dist/{status-WRLBTBRE.js → status-B2PG6YKR.js} +11 -11
- package/dist/{statusline-EUD4DMIP.js → statusline-5ERFMYSM.js} +13 -13
- package/dist/{telemetry-U3LGMR3D.js → telemetry-ZMCAWBWB.js} +10 -10
- package/dist/{trae-Z7CQ2A2Q.js → trae-7KDCYIMN.js} +5 -5
- package/dist/{types-D6RWGXm1.d.ts → types-D0RqWxT8.d.ts} +53 -9
- package/dist/{uninstall-TWPUEJEC.js → uninstall-M76BHLTH.js} +37 -27
- package/dist/uninstall-M76BHLTH.js.map +1 -0
- package/dist/{upgrade-EM6Y7QLH.js → upgrade-JLSCNAQA.js} +25 -19
- package/dist/upgrade-JLSCNAQA.js.map +1 -0
- package/dist/{usage-3HQDTXGY.js → usage-5I72HWCR.js} +3 -3
- package/dist/{usage-event-DWIGKO7V.js → usage-event-HIX4ZI45.js} +13 -13
- package/dist/{vscode-copilot-LU5NC4ZS.js → vscode-copilot-LILHAPJI.js} +20 -5
- package/dist/vscode-copilot-LILHAPJI.js.map +1 -0
- package/dist/{warp-4PPG5LOM.js → warp-KJUCWEA3.js} +5 -5
- package/dist/{windsurf-3T3RVXKM.js → windsurf-5TGGQR5I.js} +5 -5
- package/dist/{zed-LLOAUXSA.js → zed-EL3JCZ25.js} +123 -7
- package/dist/zed-EL3JCZ25.js.map +1 -0
- package/package.json +1 -1
- package/dist/antigravity-cli-KODEKUTM.js +0 -87
- package/dist/antigravity-cli-KODEKUTM.js.map +0 -1
- package/dist/chunk-4HVQ7IUM.js.map +0 -1
- package/dist/chunk-IXOQDZWC.js.map +0 -1
- package/dist/chunk-QKLJU4JX.js.map +0 -1
- package/dist/chunk-S4E6QQEM.js.map +0 -1
- package/dist/chunk-UYZ53KWS.js.map +0 -1
- package/dist/chunk-VD4EG6SG.js.map +0 -1
- package/dist/chunk-VKRGQLY4.js +0 -201
- package/dist/chunk-VKRGQLY4.js.map +0 -1
- package/dist/chunk-X457NOFE.js.map +0 -1
- package/dist/doctor-UNF7FCF4.js.map +0 -1
- package/dist/install-7O4XWH7T.js +0 -96
- package/dist/install-7O4XWH7T.js.map +0 -1
- package/dist/jetbrains-copilot-4IOT3I2Y.js.map +0 -1
- package/dist/kiro-YZ4TTZGD.js.map +0 -1
- package/dist/openclaw-BD56E5MV.js +0 -17
- package/dist/pi-I7BLL4EI.js.map +0 -1
- package/dist/uninstall-TWPUEJEC.js.map +0 -1
- package/dist/upgrade-EM6Y7QLH.js.map +0 -1
- package/dist/vscode-copilot-LU5NC4ZS.js.map +0 -1
- package/dist/zed-LLOAUXSA.js.map +0 -1
- /package/dist/{action-OHGFVKMC.js.map → action-CVIEPX4U.js.map} +0 -0
- /package/dist/{amazon-q-B52EY2SV.js.map → amazon-q-TIT7FIW3.js.map} +0 -0
- /package/dist/{amp-UXABVUKC.js.map → amp-NF3OAAUG.js.map} +0 -0
- /package/dist/{antigravity-RZHN53VB.js.map → antigravity-7LPK7QOY.js.map} +0 -0
- /package/dist/{chunk-UBB7T54N.js.map → chunk-3C5AASHM.js.map} +0 -0
- /package/dist/{chunk-LKAVD4HP.js.map → chunk-447JWFZO.js.map} +0 -0
- /package/dist/{chunk-HORHRHNG.js.map → chunk-4NHXLXSD.js.map} +0 -0
- /package/dist/{chunk-AY3RGRTT.js.map → chunk-6TF7MHG5.js.map} +0 -0
- /package/dist/{chunk-AMK2K6XZ.js.map → chunk-7UT6OB52.js.map} +0 -0
- /package/dist/{chunk-PZHB5TVA.js.map → chunk-AY3VFNOH.js.map} +0 -0
- /package/dist/{chunk-ZXX5DVSE.js.map → chunk-FBCBHEGB.js.map} +0 -0
- /package/dist/{chunk-4NSU3KWX.js.map → chunk-FJCUKXGX.js.map} +0 -0
- /package/dist/{chunk-4FWETID5.js.map → chunk-IVAWP6HH.js.map} +0 -0
- /package/dist/{chunk-NBUEL74R.js.map → chunk-JFXL4HYA.js.map} +0 -0
- /package/dist/{chunk-7NXEHZAK.js.map → chunk-JVO6NBTT.js.map} +0 -0
- /package/dist/{chunk-YJP3KGLM.js.map → chunk-L26PSQTY.js.map} +0 -0
- /package/dist/{chunk-YYNXIUR2.js.map → chunk-M2H7JURF.js.map} +0 -0
- /package/dist/{chunk-56R2ER7K.js.map → chunk-NBYKLUF6.js.map} +0 -0
- /package/dist/{chunk-IRUYJD23.js.map → chunk-NLE2J5P4.js.map} +0 -0
- /package/dist/{chunk-LN76OGNR.js.map → chunk-Z2MRSS2I.js.map} +0 -0
- /package/dist/{claude-code-T6ZRCMA7.js.map → claude-code-7RS4YVGZ.js.map} +0 -0
- /package/dist/{cline-NNMVCECA.js.map → cline-BZQAUYPC.js.map} +0 -0
- /package/dist/{codebuff-RJIDSEU3.js.map → codebuff-5RLTLZAU.js.map} +0 -0
- /package/dist/{continue-MNM7YVJY.js.map → continue-JLIB7R7X.js.map} +0 -0
- /package/dist/{copilot-cli-SMTX5F65.js.map → copilot-cli-XZSUYNQZ.js.map} +0 -0
- /package/dist/{crush-NYDBHIJE.js.map → crush-ESERLVLT.js.map} +0 -0
- /package/dist/{cursor-AOELDNZU.js.map → cursor-FUDOV5VK.js.map} +0 -0
- /package/dist/{detect-ALAKE54S.js.map → detect-Z5BDTY6B.js.map} +0 -0
- /package/dist/{droid-PTCH2K7Y.js.map → droid-DTO5POTK.js.map} +0 -0
- /package/dist/{gemini-cli-QGLN2UMS.js.map → gemini-cli-RBIG6U2F.js.map} +0 -0
- /package/dist/{goose-DQ6GSZ5O.js.map → goose-VGNOP5J2.js.map} +0 -0
- /package/dist/{hermes-E47IG63A.js.map → hermes-NUKFWZI5.js.map} +0 -0
- /package/dist/{hook-GM2IDA3C.js.map → hook-XPR3AHDI.js.map} +0 -0
- /package/dist/{kilo-TAHOPT2Q.js.map → kilo-JLH3KVZJ.js.map} +0 -0
- /package/dist/{kilo-cli-X4NPJWGX.js.map → kilo-cli-5W36VJQZ.js.map} +0 -0
- /package/dist/{kimi-Z7L2LEEI.js.map → kimi-R62W7HKZ.js.map} +0 -0
- /package/dist/{leaderboard-DVW4WYJ6.js.map → leaderboard-YWMOSJBC.js.map} +0 -0
- /package/dist/{mimo-code-G2CBZ4M6.js.map → mimo-code-PGLFFVER.js.map} +0 -0
- /package/dist/{mux-JNM3F2NW.js.map → mux-HWL4N5KH.js.map} +0 -0
- /package/dist/{nemoclaw-SHA4IUML.js.map → nemoclaw-QPHETUXM.js.map} +0 -0
- /package/dist/{omp-OOVUNXME.js.map → omp-3TFMTJ5U.js.map} +0 -0
- /package/dist/{openclaw-BD56E5MV.js.map → openclaw-RYFO5TLY.js.map} +0 -0
- /package/dist/{opencode-W2RK4M7G.js.map → opencode-JX7GBE5Q.js.map} +0 -0
- /package/dist/{package-H5V3AZHR.js.map → package-2KKUGZFS.js.map} +0 -0
- /package/dist/{qwen-code-JG7AF442.js.map → qwen-code-ISR6BEET.js.map} +0 -0
- /package/dist/{roo-code-L5F7S6QH.js.map → roo-code-6TSCME4R.js.map} +0 -0
- /package/dist/{serve-WMO2TUW3.js.map → serve-EPRN7F2X.js.map} +0 -0
- /package/dist/{status-WRLBTBRE.js.map → status-B2PG6YKR.js.map} +0 -0
- /package/dist/{statusline-EUD4DMIP.js.map → statusline-5ERFMYSM.js.map} +0 -0
- /package/dist/{telemetry-U3LGMR3D.js.map → telemetry-ZMCAWBWB.js.map} +0 -0
- /package/dist/{trae-Z7CQ2A2Q.js.map → trae-7KDCYIMN.js.map} +0 -0
- /package/dist/{usage-3HQDTXGY.js.map → usage-5I72HWCR.js.map} +0 -0
- /package/dist/{usage-event-DWIGKO7V.js.map → usage-event-HIX4ZI45.js.map} +0 -0
- /package/dist/{warp-4PPG5LOM.js.map → warp-KJUCWEA3.js.map} +0 -0
- /package/dist/{windsurf-3T3RVXKM.js.map → windsurf-5TGGQR5I.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/kiro/index.ts"],"sourcesContent":["/**\n * adapters/kiro — Kiro (AWS) platform adapter for agent-connector.\n *\n * Kiro is a json-stdio host with TWO native config surfaces that live in\n * DIFFERENT files (so getServerConfigPath ≠ getHookConfigPath):\n *\n * 1. MCP servers — `mcp.json` under `~/.kiro/settings/` (user) or\n * `<projectDir>/.kiro/settings/` (project). The file is JSONC; we WRITE\n * plain JSON (valid JSONC), mirroring the other JSON-config adapters. Root\n * key `mcpServers`; a stdio server is `{ command, args, env }`.\n * Ref: https://kiro.dev/docs/mcp/configuration/\n *\n * 2. Hooks — NOT a settings file but an AGENT file:\n * `~/.kiro/agents/kiro_default.json`. Kiro auto-loads the built-in default\n * agent `kiro_default` for a new chat session, so hooks must register on\n * THAT agent (a file literally named `default.json` would define an inactive\n * custom agent the user must `/agent`-swap to). We merge a `hooks` key into\n * the existing agent JSON, creating a minimal agent object if absent.\n * Ref: kiro.dev/docs/cli/custom-agents/configuration-reference#hooks-field\n *\n * Hook protocol is EXIT-CODE based (unlike Claude's JSON-decision wrapper):\n * - exit 0 → allow the action.\n * - exit 2 → block the action; the reason is written to stderr (PreToolUse).\n * - context injection → exit 0 with the guidance text written as PLAIN STDOUT\n * (NOT a JSON envelope). Kiro adds a hook's STDOUT to the agent's context\n * ONLY for agentSpawn and userPromptSubmit; for preToolUse / postToolUse /\n * stop the docs say STDOUT is \"captured but not shown\" — there is no\n * context channel, so a `context` decision on those degrades to exit 0.\n * Ref: https://kiro.dev/docs/cli/hooks (Hook output / Hook types).\n * Kiro CANNOT rewrite tool arguments or output (exit codes only), so\n * canModifyArgs / canModifyOutput are false; `modify` degrades to allow.\n *\n * Native hook event vocabulary differs from the canonical names and is mapped:\n * PreToolUse → preToolUse\n * PostToolUse → postToolUse\n * SessionStart → agentSpawn (Kiro's session-start equivalent)\n * UserPromptSubmit → userPromptSubmit\n * Stop → stop (documented Kiro hook)\n * Kiro has no equivalent for PreCompact / SessionEnd / Notification; those are\n * reported as a warn/skip at install time.\n *\n * Env handling: Kiro documents no `${env:VAR}` token of the framework's syntax,\n * so env/header/url refs are resolved to literals at install time via\n * resolveEnvRefsDeep — the safe default matching the Gemini/Codex adapters.\n *\n * Actions surface: Kiro reads `.kiro/hooks/<id>.kiro.hook` files (JSON) where a\n * `{ when:{ type:\"manual\" } }` Manual-Trigger paired with a\n * `{ then:{ type:\"runCommand\", command } }` Shell-Command action runs a local\n * shell command (NO LLM) and is user-invokable from the Agent Hooks panel /\n * Command Palette (kiro.dev/docs/hooks — \"Run Command\" action; verified against\n * real `.kiro.hook` files in the wild). For each AC action we write ONE fully\n * owned `.kiro/hooks/<id>.kiro.hook` that execs `<homeBin> action kiro <id>\n * --connector <id>`. CONSTRAINT (verified): Kiro discovers hooks ONLY from the\n * WORKSPACE `.kiro/hooks/` dir — `~/.kiro/hooks/` is NOT scanned — so actions\n * install at PROJECT scope only and warn-skip at user scope (mirrors warp's\n * project-only skills/actions precedent).\n *\n * Grounded in context-mode's proven Kiro adapter (src/adapters/kiro/*).\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, HookReply, InstallContext, MemoryTarget, NormalizedEvent } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookEventName,\n HookParadigm,\n HookResponse,\n PlatformCapabilities,\n PlatformId,\n PostToolUseEvent,\n PreToolUseEvent,\n ServerDef,\n SessionStartEvent,\n SkillDef,\n StopEvent,\n Transport,\n UserPromptSubmitEvent,\n} from \"../../core/types.js\";\nimport { renderSkillMd } from \"../claude-code/render.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport {\n buildHomeBinHookCommand,\n buildWrappedStdio,\n isHomeBinHookCommand,\n} from \"../../core/spawn.js\";\nimport { normalizeSessionSource } from \"../claude-code/wire.js\";\n\nconst HOST: PlatformId = \"kiro\";\nconst MCP_ROOT_KEY = \"mcpServers\";\n\n/** The built-in agent Kiro auto-loads for a new chat session. */\nconst DEFAULT_AGENT_FILE = \"kiro_default.json\";\n\n/**\n * Kiro-native hook event names (the keys under an agent file's `hooks` object).\n * Only the events Kiro actually fires for the json-stdio command paradigm.\n */\nconst KIRO_EVENT = {\n preToolUse: \"preToolUse\",\n postToolUse: \"postToolUse\",\n agentSpawn: \"agentSpawn\",\n userPromptSubmit: \"userPromptSubmit\",\n stop: \"stop\",\n} as const;\n\n/**\n * Map canonical event names → Kiro's native hook event names. Only the events\n * Kiro supports are present; PreCompact / SessionEnd / Notification have no Kiro\n * equivalent and are reported as a warn/skip at install time.\n */\nconst EVENT_MAP: Partial<Record<HookEventName, string>> = {\n PreToolUse: KIRO_EVENT.preToolUse,\n PostToolUse: KIRO_EVENT.postToolUse,\n SessionStart: KIRO_EVENT.agentSpawn,\n UserPromptSubmit: KIRO_EVENT.userPromptSubmit,\n Stop: KIRO_EVENT.stop,\n};\n\n/**\n * Kiro events whose hook STDOUT is added to the agent's context: agentSpawn\n * (≈ SessionStart) and userPromptSubmit. For preToolUse / postToolUse / stop the\n * docs say STDOUT is \"captured but not shown to user\" — no context channel — so a\n * `context` decision on those degrades to a plain exit-0 pass-through.\n * Ref: https://kiro.dev/docs/cli/hooks\n */\nconst CONTEXT_EVENTS: ReadonlySet<string> = new Set([\n KIRO_EVENT.agentSpawn,\n KIRO_EVENT.userPromptSubmit,\n]);\n\n/** A single Kiro native hook registration entry (Claude-shaped, nested). */\ninterface KiroHookEntry {\n matcher: string;\n hooks: Array<{ type: \"command\"; command: string }>;\n}\n\n/** The shape of a Kiro agent file (only the parts we touch). */\ninterface KiroAgentFile {\n hooks?: Record<string, KiroHookEntry[]>;\n [key: string]: unknown;\n}\n\n/** The shape of Kiro's mcp.json (only the parts we touch). */\ninterface KiroMcpFile {\n mcpServers?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\n/** Native MCP server entry shapes Kiro accepts under `mcpServers`. */\ninterface KiroStdioServer {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n cwd?: string;\n}\ninterface KiroHttpServer {\n url: string;\n headers?: Record<string, string>;\n}\n\n/**\n * Raw Kiro CLI hook stdin payload (snake_case wire fields).\n *\n * Fields are the ones Kiro ACTUALLY serializes onto a hook's stdin per\n * kiro.dev/docs/cli/hooks. NOTE the stop hook: its stdin is exactly\n * `{ hook_event_name, cwd, session_id, assistant_response }` — there is NO\n * `stop_hook_active` field (Kiro does not model a re-entrant stop-hook flag),\n * so we read `assistant_response` (the agent's last response text) rather than a\n * never-emitted boolean. Ref: kiro.dev/docs/cli/hooks (Stop Hook → Hook Event).\n */\ninterface KiroWireInput {\n connector?: unknown;\n hook_event_name?: string;\n cwd?: string;\n session_id?: string;\n tool_name?: string;\n tool_input?: Record<string, unknown>;\n tool_response?: unknown;\n source?: string;\n prompt?: string;\n /** Stop hook only: the text of the assistant's last response. */\n assistant_response?: string;\n}\n\nexport class KiroAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Kiro\";\n readonly paradigm: HookParadigm = \"json-stdio\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: AGENTS.md-first managed block (project <projectDir>/AGENTS.md\n // via the base default — always included, no inclusion modes; user scope →\n // ~/.kiro/steering/agent-connector.md below).\n supportsMemory: true,\n preToolUse: true,\n postToolUse: true,\n preCompact: false,\n sessionStart: true,\n sessionEnd: false,\n // Kiro fires userPromptSubmit and stop, but it has no PreCompact /\n // SessionEnd / Notification equivalent.\n userPromptSubmit: true,\n stop: true,\n notification: false,\n // Newer events: Kiro's native set (agentSpawn / userPromptSubmit /\n // preToolUse / postToolUse / stop) has no permission-dialog, tool-failure,\n // or subagent lifecycle events, so permissionRequest / postToolUseFailure /\n // subagentStart / subagentStop stay unset — install reports the standard\n // skip-warn for them.\n // Kiro's hook protocol is exit-code only — a hook can allow (0), block (2),\n // or inject agentSpawn context, but it CANNOT rewrite tool args or output.\n canModifyArgs: false,\n canModifyOutput: false,\n // agentSpawn (and userPromptSubmit) add the hook's plain STDOUT to context.\n canInjectSessionContext: true,\n transports: [\"stdio\", \"http\"],\n // Skills: Kiro reads SKILL.md from .kiro/skills/<name>/SKILL.md (project)\n // and ~/.kiro/skills/<name>/SKILL.md (user).\n supportsSkills: true,\n // Actions: Kiro reads `.kiro/hooks/<id>.kiro.hook` Manual-Trigger +\n // Shell-Command hooks (when.type \"manual\" + then.type \"runCommand\"),\n // user-invokable from the Agent Hooks panel / Command Palette. WORKSPACE\n // (project) scope ONLY — Kiro does not scan ~/.kiro/hooks/ — so user scope\n // warn-skips (see installActions).\n supportsActions: true,\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".kiro\");\n const userMcp = this.userMcpPath();\n const projectDirKiro = join(projectDir, \".kiro\");\n const projectMcp = this.projectMcpPath(projectDir);\n\n const userInstalled = existsSync(userDir) || existsSync(userMcp);\n const projInstalled = existsSync(projectDirKiro) || existsSync(projectMcp);\n const installed = userInstalled || projInstalled;\n // Report the scope/path that actually matched, so a project-only install\n // isn't misreported as a (non-existent) user install.\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projectMcp : userMcp;\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: installed\n ? scope === \"project\"\n ? `found project Kiro config at ${projectMcp}`\n : `found Kiro config under ${userDir}`\n : `no Kiro config at ${userDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Memory surface: global steering dir at user scope ───────────────────\n // Project scope stays on the AGENTS.md base default (workspace-root\n // AGENTS.md is always included, with no inclusion modes). User scope targets\n // a dedicated agent-connector.md in Kiro's documented ~/.kiro/steering/ dir\n // (default-always inclusion; AC-created → cleanly deletable on uninstall).\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(), \".kiro\", \"steering\", \"agent-connector.md\"),\n reason: \"kiro global steering dir (~/.kiro/steering; agent-connector-owned file)\",\n },\n ];\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kiro\")\n : join(homedir(), \".kiro\");\n }\n\n /** MCP servers live in mcp.json under the scope's `.kiro/settings/`. */\n getServerConfigPath(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? this.projectMcpPath(ctx.projectDir)\n : this.userMcpPath();\n }\n\n /**\n * Hooks live in an AGENT file, NOT a settings file. Kiro auto-loads the\n * built-in default agent (`kiro_default`) for a new chat session, so we always\n * register hooks on the user-scope default agent — that is the agent Kiro\n * actually loads regardless of install scope.\n */\n getHookConfigPath(_ctx: InstallContext): string {\n return join(homedir(), \".kiro\", \"agents\", DEFAULT_AGENT_FILE);\n }\n\n private userMcpPath(): string {\n return join(homedir(), \".kiro\", \"settings\", \"mcp.json\");\n }\n\n private projectMcpPath(projectDir: string): string {\n return join(projectDir, \".kiro\", \"settings\", \"mcp.json\");\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 kiro\"\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 /** Render a normalized ServerDef into Kiro's native mcpServers entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): KiroStdioServer | KiroHttpServer {\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 ({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));\n\n // Kiro documents no native interpolation token, so resolve every\n // ${env:VAR} to a literal at install time.\n const entry: KiroStdioServer = { command: resolveEnvRefsDeep(command) };\n if (args.length > 0) entry.args = resolveEnvRefsDeep(args);\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n if (server.cwd) entry.cwd = resolveEnvRefsDeep(server.cwd);\n return entry;\n }\n\n // http (and any other remote transport) — Kiro registers a URL.\n const entry: KiroHttpServer = { url: resolveEnvRefsDeep(server.url ?? \"\") };\n const headers = this.renderEnv(server.headers);\n if (headers) entry.headers = headers;\n return entry;\n }\n\n /**\n * Render env/header values. Kiro documents no native interpolation token, so\n * 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 // ── Skills surface ───────────────────────────────────────────────────────\n // Kiro reads SKILL.md from:\n // project scope → <projectDir>/.kiro/skills/<name>/SKILL.md\n // user scope → ~/.kiro/skills/<name>/SKILL.md\n\n private skillsDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".kiro\", \"skills\")\n : join(homedir(), \".kiro\", \"skills\");\n }\n\n private skillDir(ctx: InstallContext, name: string): string {\n return join(this.skillsDir(ctx), name);\n }\n\n override installSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.skills === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"skills disabled for kiro\" }];\n }\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(\n this.writeContentFile(join(dir, \"SKILL.md\"), this.renderSkill(skill), ctx.dryRun),\n );\n for (const [rel, contents] of Object.entries(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n detail: `skill resource \"${rel}\" escapes the skill dir; skipped`,\n });\n continue;\n }\n changes.push(this.writeContentFile(target, contents, ctx.dryRun));\n }\n }\n return changes;\n }\n\n override uninstallSkills(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.skills.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no skills\" }];\n }\n const changes: ChangeRecord[] = [];\n for (const skill of connector.skills) {\n const dir = this.skillDir(ctx, skill.name);\n changes.push(this.removeContentFile(join(dir, \"SKILL.md\"), ctx.dryRun));\n for (const rel of Object.keys(skill.resources ?? {})) {\n const target = this.resolveWithin(dir, rel);\n if (target === null) continue;\n changes.push(this.removeContentFile(target, ctx.dryRun));\n }\n changes.push(this.removeDirIfEmpty(dir, ctx.dryRun));\n }\n return changes;\n }\n\n private renderSkill(skill: SkillDef): string {\n return renderSkillMd(skill);\n }\n\n // ── Action surface (one owned .kiro.hook per action; PROJECT scope only) ──\n // Kiro reads `<projectDir>/.kiro/hooks/<id>.kiro.hook` (JSON): a Manual-Trigger\n // (`when.type \"manual\"`) + Shell-Command (`then.type \"runCommand\"`, `command`)\n // hook, user-invokable from the Agent Hooks panel / Command Palette\n // (kiro.dev/docs/hooks). The command execs `<homeBin> action kiro <id>\n // --connector <id>`. Each file is FULLY OWNED → uninstall removes it.\n // SCOPE: Kiro discovers hooks ONLY from the workspace `.kiro/hooks/` dir\n // (~/.kiro/hooks/ is NOT scanned), so user scope warn-skips (mirrors warp's\n // project-only precedent) rather than writing a file Kiro would never load.\n\n private actionHookPath(ctx: InstallContext, id: string): string {\n return join(ctx.projectDir, \".kiro\", \"hooks\", `${id}.kiro.hook`);\n }\n\n override installActions(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.actions === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"actions disabled for kiro\" }];\n }\n const triggers = this.actionTriggers(ctx);\n if (triggers.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no actions\" }];\n }\n if (ctx.scope !== \"project\") {\n return [\n {\n platform: this.id,\n action: \"warn\",\n detail: `kiro actions are project-scoped only (Kiro does not scan ~/.kiro/hooks/); ${triggers.length} skipped`,\n },\n ];\n }\n return triggers.map((trigger) =>\n this.writeContentFile(\n this.actionHookPath(ctx, trigger.id),\n this.renderActionHook(trigger.label, trigger.description, trigger.command),\n ctx.dryRun,\n ),\n );\n }\n\n override uninstallActions(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.actions.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no actions\" }];\n }\n if (ctx.scope !== \"project\") {\n return [{ platform: this.id, action: \"skip\", detail: \"kiro actions are project-scoped only\" }];\n }\n return connector.actions.map((action) =>\n this.removeContentFile(this.actionHookPath(ctx, action.id), ctx.dryRun),\n );\n }\n\n /**\n * Render a Kiro `.kiro.hook` JSON: a Manual-Trigger (`when.type \"manual\"`) +\n * Shell-Command (`then.type \"runCommand\"`) hook. The key order matches the\n * files Kiro itself emits (enabled, name, description, version, when, then).\n */\n private renderActionHook(name: string, description: string, command: string): string {\n return (\n JSON.stringify(\n {\n enabled: true,\n name,\n description,\n version: \"1\",\n when: { type: \"manual\" },\n then: { type: \"runCommand\", command },\n },\n null,\n 2,\n ) + \"\\n\"\n );\n }\n\n // ── Hook install / uninstall (merge into the agent file) ─────────────────\n\n installHooks(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.platforms[HOST]?.hooks === false) {\n return [{ platform: this.id, action: \"skip\", detail: \"hooks disabled for kiro\" }];\n }\n if (connector.hookEvents.length === 0) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no hooks\" }];\n }\n\n const agentPath = this.getHookConfigPath(ctx);\n // Merge into the existing agent JSON; create a minimal agent object if absent.\n const agent = this.readJson<KiroAgentFile>(agentPath) ?? {};\n const __skip = this.malformedHookRootSkip(agentPath, (agent as Record<string, unknown>).hooks);\n if (__skip) return [__skip];\n const hooks = (agent.hooks ??= {});\n\n const changes: ChangeRecord[] = [];\n let mutated = false;\n\n for (const event of connector.hookEvents) {\n const kiroEvent = EVENT_MAP[event];\n if (!kiroEvent) {\n // No Kiro equivalent for this canonical event — report and continue.\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: agentPath,\n detail: `${event} has no Kiro hook equivalent — skipped`,\n });\n continue;\n }\n\n const command = buildHomeBinHookCommand(ctx.homeBinPath, HOST, event, connector.id);\n const matcher = connector.hooks[event]?.matcher ?? \"\";\n const entry: KiroHookEntry = {\n matcher,\n hooks: [{ type: \"command\", command }],\n };\n\n const bucket = (hooks[kiroEvent] ??= []);\n const existingIdx = bucket.findIndex((e) => this.entryHasOurCommand(e, ctx));\n\n if (existingIdx >= 0) {\n if (JSON.stringify(bucket[existingIdx]) === JSON.stringify(entry)) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: agentPath,\n detail: `hooks.${kiroEvent} already registered`,\n });\n continue;\n }\n bucket[existingIdx] = entry;\n changes.push({\n platform: this.id,\n action: \"update\",\n path: agentPath,\n detail: `hooks.${kiroEvent}`,\n });\n } else {\n bucket.push(entry);\n changes.push({\n platform: this.id,\n action: \"create\",\n path: agentPath,\n detail: `hooks.${kiroEvent}`,\n });\n }\n mutated = true;\n }\n\n if (mutated) this.writeJson(agentPath, agent, ctx.dryRun);\n return changes;\n }\n\n uninstallHooks(ctx: InstallContext): ChangeRecord[] {\n const agentPath = this.getHookConfigPath(ctx);\n const agent = this.readJson<KiroAgentFile>(agentPath);\n const hooks = agent?.hooks;\n if (!agent || !hooks) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: agentPath,\n detail: \"no hooks section present\",\n },\n ];\n }\n\n const changes: ChangeRecord[] = [];\n let mutated = false;\n\n for (const kiroEvent of Object.keys(hooks)) {\n const bucket = hooks[kiroEvent];\n if (!Array.isArray(bucket)) continue;\n\n // Strip our hook command from each entry; drop entries left empty so we\n // never remove another connector's (or the user's own) hook commands.\n const next: KiroHookEntry[] = [];\n let removed = 0;\n for (const e of bucket) {\n const innerBefore = e.hooks?.length ?? 0;\n const inner = (e.hooks ?? []).filter((h) => !this.isOurCommand(h.command, ctx));\n removed += innerBefore - inner.length;\n if (inner.length > 0) next.push({ matcher: e.matcher ?? \"\", hooks: inner });\n }\n\n if (removed > 0) {\n if (next.length > 0) hooks[kiroEvent] = next;\n else delete hooks[kiroEvent];\n changes.push({\n platform: this.id,\n action: \"remove\",\n path: agentPath,\n detail: `hooks.${kiroEvent} (${removed})`,\n });\n mutated = true;\n }\n }\n\n if (mutated) this.writeJson(agentPath, agent, ctx.dryRun);\n if (changes.length === 0) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: agentPath,\n detail: \"no matching hook entries\",\n });\n }\n return changes;\n }\n\n private entryHasOurCommand(entry: KiroHookEntry, ctx: InstallContext): boolean {\n return (entry.hooks ?? []).some((h) => this.isOurCommand(h.command, ctx));\n }\n\n /** True when a hook command references our home binary AND this connector id\n * (anchored so a shared-prefix id can't collide — see isHomeBinHookCommand). */\n private isOurCommand(command: string | undefined, ctx: InstallContext): boolean {\n return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const mcpPath = this.getServerConfigPath(ctx);\n const agentPath = this.getHookConfigPath(ctx);\n const connectorId = ctx.connector.id;\n const homeBin = ctx.homeBinPath;\n const hookEvents = ctx.connector.hookEvents;\n return [\n {\n name: `${this.name}: mcp.json present`,\n check: () =>\n existsSync(mcpPath)\n ? { status: \"OK\", detail: mcpPath }\n : { status: \"FAIL\", detail: `not found: ${mcpPath}` },\n },\n {\n name: `${this.name}: server entry registered`,\n check: () => {\n // Only assert what the connector declares (same rule as the hook\n // check below): a server-less connector never writes an mcpServers\n // entry, so its absence is healthy.\n if (!ctx.connector.server) {\n return { status: \"OK\", detail: \"no MCP server declared\" };\n }\n const cfg = this.readJson<KiroMcpFile>(mcpPath);\n const bucket = cfg?.mcpServers;\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 : { status: \"FAIL\", detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}` };\n },\n },\n {\n name: `${this.name}: hook command registered`,\n check: () => {\n if (hookEvents.length === 0) {\n return { status: \"OK\", detail: \"no hooks declared\" };\n }\n const agent = this.readJson<KiroAgentFile>(agentPath);\n if (!agent) return { status: \"FAIL\", detail: `cannot read ${agentPath}` };\n const hooks = agent.hooks ?? {};\n const registered = Object.values(hooks).some((entries) =>\n (entries ?? []).some((e) =>\n (e.hooks ?? []).some((h) =>\n isHomeBinHookCommand(h.command, homeBin, connectorId),\n ),\n ),\n );\n return registered\n ? { status: \"OK\", detail: \"hook command present\" }\n : { status: \"FAIL\", detail: `no hook for ${connectorId} in ${agentPath}` };\n },\n },\n ];\n }\n\n // ── Runtime: parse Kiro stdin JSON → normalized event ────────────────────\n\n parseEvent(event: HookEventName, raw: unknown): NormalizedEvent {\n const input = (raw ?? {}) as KiroWireInput;\n const connectorId = typeof input.connector === \"string\" ? input.connector : \"\";\n const sessionId = typeof input.session_id === \"string\" ? input.session_id : \"\";\n const projectDir = typeof input.cwd === \"string\" ? input.cwd : undefined;\n\n const base = {\n hostPlatform: HOST,\n connectorId,\n sessionId,\n raw,\n ...(projectDir !== undefined ? { projectDir } : {}),\n } as const;\n\n switch (event) {\n case \"PreToolUse\": {\n const ev: PreToolUseEvent = {\n ...base,\n toolName: input.tool_name ?? \"\",\n toolInput: input.tool_input ?? {},\n };\n return ev;\n }\n case \"PostToolUse\": {\n const ev: PostToolUseEvent = {\n ...base,\n toolName: input.tool_name ?? \"\",\n toolInput: input.tool_input ?? {},\n ...(toolResponseToString(input.tool_response) !== undefined\n ? { toolOutput: toolResponseToString(input.tool_response) }\n : {}),\n };\n return ev;\n }\n case \"SessionStart\": {\n const ev: SessionStartEvent = {\n ...base,\n source: normalizeSessionSource(input.source),\n };\n return ev;\n }\n case \"UserPromptSubmit\": {\n const ev: UserPromptSubmitEvent = {\n ...base,\n prompt: typeof input.prompt === \"string\" ? input.prompt : \"\",\n };\n return ev;\n }\n case \"Stop\": {\n // Kiro's stop stdin is EXACTLY { hook_event_name, cwd, session_id,\n // assistant_response } — there is no `stop_hook_active` flag (reading it\n // always yielded undefined), so we read the real `assistant_response`\n // (the agent's last response text) instead and surface it as\n // lastAssistantMessage. Ref: kiro.dev/docs/cli/hooks (Stop Hook Event).\n const ev: StopEvent & { lastAssistantMessage?: string } = {\n ...base,\n ...(typeof input.assistant_response === \"string\"\n ? { lastAssistantMessage: input.assistant_response }\n : {}),\n };\n return ev;\n }\n default: {\n // Kiro never delivers PreCompact / SessionEnd / Notification nor the\n // newer PermissionRequest / PostToolUseFailure / SubagentStart /\n // SubagentStop (no native equivalents). If the runtime dispatches one\n // anyway, surface it loudly rather than silently mis-parse.\n throw new Error(`unsupported kiro hook event: ${String(event)}`);\n }\n }\n }\n\n // ── Runtime: normalized response → Kiro native (exit-code) hook reply ─────\n\n formatReply(event: HookEventName, response: HookResponse): HookReply {\n const decision = response.decision ?? \"allow\";\n\n // deny → block the action: exit 2 with the reason on stderr.\n if (decision === \"deny\") {\n return { exitCode: 2, stderr: response.reason ?? \"Blocked by hook\" };\n }\n\n // ask → Kiro has no native \"ask\"; degrade to deny (exit 2) to stay fail-safe.\n if (decision === \"ask\") {\n return {\n exitCode: 2,\n stderr: response.reason ?? \"Action requires user confirmation (security policy)\",\n };\n }\n\n // Stop → exit-code only (deny already handled above as exit 2). There is no\n // context/additionalContext channel on a Stop hook, so anything non-deny\n // passes through with exit 0 (do not fall into the context branch).\n if (event === \"Stop\") {\n return { exitCode: 0 };\n }\n\n // context → inject soft guidance. Kiro adds a hook's PLAIN STDOUT to the\n // agent's context (no JSON envelope), but ONLY for the agentSpawn and\n // userPromptSubmit events; preToolUse / postToolUse have no context channel\n // (their STDOUT is \"captured but not shown\"). So emit the raw text on stdout\n // only when the FIRING event maps to a context-supporting Kiro event;\n // otherwise the context decision degrades to a plain exit-0 pass-through\n // rather than a mislabeled/ineffective payload. exit 0 = allow.\n // Ref: https://kiro.dev/docs/cli/hooks\n const kiroEvent = EVENT_MAP[event];\n if (\n decision === \"context\" &&\n response.additionalContext &&\n kiroEvent !== undefined &&\n CONTEXT_EVENTS.has(kiroEvent)\n ) {\n return { exitCode: 0, stdout: response.additionalContext };\n }\n\n // modify is unsupported on Kiro (exit-code protocol — cannot rewrite\n // args/output); allow / void → pass through with exit 0.\n return { exitCode: 0 };\n }\n}\n\n/** Coerce a Kiro PostToolUse `tool_response` into a string for the normalized event. */\nfunction toolResponseToString(value: unknown): string | undefined {\n if (value == null) return undefined;\n if (typeof value === \"string\") return value;\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport const adapter = new KiroAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4DA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,YAAY;AA+BrB,IAAM,OAAmB;AACzB,IAAM,eAAe;AAGrB,IAAM,qBAAqB;AAM3B,IAAM,aAAa;AAAA,EACjB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,MAAM;AACR;AAOA,IAAM,YAAoD;AAAA,EACxD,YAAY,WAAW;AAAA,EACvB,aAAa,WAAW;AAAA,EACxB,cAAc,WAAW;AAAA,EACzB,kBAAkB,WAAW;AAAA,EAC7B,MAAM,WAAW;AACnB;AASA,IAAM,iBAAsC,oBAAI,IAAI;AAAA,EAClD,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAwDM,IAAM,cAAN,cAA0B,YAA+B;AAAA,EACrD,KAAiB;AAAA,EACjB,OA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M,WAAW,SAAS,YAAY;AAGtC,QAAI,aAAa,QAAQ;AACvB,aAAO,EAAE,UAAU,GAAG,QAAQ,SAAS,UAAU,kBAAkB;AAAA,IACrE;AAGA,QAAI,aAAa,OAAO;AACtB,aAAO;AAAA,QACL,UAAU;AAAA,QACV,QAAQ,SAAS,UAAU;AAAA,MAC7B;AAAA,IACF;AAKA,QAAI,UAAU,QAAQ;AACpB,aAAO,EAAE,UAAU,EAAE;AAAA,IACvB;AAUA,UAAM,YAAY,UAAU,KAAK;AACjC,QACE,aAAa,aACb,SAAS,qBACT,cAAc,UACd,eAAe,IAAI,SAAS,GAC5B;AACA,aAAO,EAAE,UAAU,GAAG,QAAQ,SAAS,kBAAkB;AAAA,IAC3D;AAIA,WAAO,EAAE,UAAU,EAAE;AAAA,EACvB;AACF;AAGA,SAAS,qBAAqB,OAAoC;AAChE,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI;AACF,WAAO,KAAK,UAAU,KAAK;AAAA,EAC7B,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAEO,IAAM,UAAU,IAAI,YAAY;AACvC,IAAO,eAAQ;","names":["entry"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatHostLeaderboard,
|
|
4
4
|
hostLeaderboard
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NLE2J5P4.js";
|
|
6
|
+
import "./chunk-XD7MY6HB.js";
|
|
6
7
|
import {
|
|
7
8
|
SCOPE_FILTER_VALUES,
|
|
8
9
|
formatHostNativeTurns,
|
|
@@ -10,14 +11,13 @@ import {
|
|
|
10
11
|
hostNativeTurns,
|
|
11
12
|
isScopeFilter,
|
|
12
13
|
mcpLeaderboard
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-XD7MY6HB.js";
|
|
14
|
+
} from "./chunk-6TF7MHG5.js";
|
|
15
15
|
import {
|
|
16
16
|
fail,
|
|
17
17
|
print
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-5Z36KVU2.js";
|
|
19
|
+
import "./chunk-IVAWP6HH.js";
|
|
20
|
+
import "./chunk-GZGLCCEE.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/commands/leaderboard.ts
|
|
23
23
|
import { parseArgs } from "util";
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
parseSince,
|
|
135
135
|
run
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=leaderboard-
|
|
137
|
+
//# sourceMappingURL=leaderboard-YWMOSJBC.js.map
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
BaseAdapter,
|
|
10
10
|
renderOpenCodeSubagentMd,
|
|
11
11
|
renderSkillMd
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WFEHWTLM.js";
|
|
13
13
|
import {
|
|
14
14
|
buildWrappedStdio
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-4NHXLXSD.js";
|
|
16
|
+
import "./chunk-M2H7JURF.js";
|
|
17
|
+
import "./chunk-GZGLCCEE.js";
|
|
18
18
|
|
|
19
19
|
// src/adapters/mimo-code/index.ts
|
|
20
20
|
import { existsSync } from "fs";
|
|
@@ -716,4 +716,4 @@ export {
|
|
|
716
716
|
adapter,
|
|
717
717
|
mimo_code_default as default
|
|
718
718
|
};
|
|
719
|
-
//# sourceMappingURL=mimo-code-
|
|
719
|
+
//# sourceMappingURL=mimo-code-PGLFFVER.js.map
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveEnvRefsDeep
|
|
4
|
+
} from "./chunk-BEFVJ2OE.js";
|
|
5
|
+
import {
|
|
6
|
+
BaseAdapter
|
|
7
|
+
} from "./chunk-WFEHWTLM.js";
|
|
8
|
+
import {
|
|
9
|
+
buildWrappedStdio
|
|
10
|
+
} from "./chunk-4NHXLXSD.js";
|
|
11
|
+
import "./chunk-M2H7JURF.js";
|
|
12
|
+
import {
|
|
13
|
+
ensureDir
|
|
14
|
+
} from "./chunk-GZGLCCEE.js";
|
|
15
|
+
|
|
16
|
+
// src/adapters/mistral-vibe/index.ts
|
|
17
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
18
|
+
import { homedir } from "os";
|
|
19
|
+
import { dirname, join } from "path";
|
|
20
|
+
import TOML from "@iarna/toml";
|
|
21
|
+
var HOST = "mistral-vibe";
|
|
22
|
+
var MCP_ROOT_KEY = "mcp_servers";
|
|
23
|
+
var MistralVibeAdapter = class extends BaseAdapter {
|
|
24
|
+
id = HOST;
|
|
25
|
+
name = "Mistral Vibe";
|
|
26
|
+
paradigm = "mcp-only";
|
|
27
|
+
capabilities = {
|
|
28
|
+
// mcp-only: no hook layer wired (experimental host hooks are not
|
|
29
|
+
// byte-confirmed — see header HONEST CEILING). No memory/content surfaces
|
|
30
|
+
// wired either; only the MCP server is installed. Every hook capability is
|
|
31
|
+
// false.
|
|
32
|
+
preToolUse: false,
|
|
33
|
+
postToolUse: false,
|
|
34
|
+
preCompact: false,
|
|
35
|
+
sessionStart: false,
|
|
36
|
+
sessionEnd: false,
|
|
37
|
+
userPromptSubmit: false,
|
|
38
|
+
stop: false,
|
|
39
|
+
notification: false,
|
|
40
|
+
canModifyArgs: false,
|
|
41
|
+
canModifyOutput: false,
|
|
42
|
+
canInjectSessionContext: false,
|
|
43
|
+
// Mistral Vibe registers stdio + remote (http / streamable-http) MCP
|
|
44
|
+
// servers. The framework's `http` transport maps to Vibe's "http"; `sse`
|
|
45
|
+
// maps to Vibe's "streamable-http" (its closest remote form).
|
|
46
|
+
transports: ["stdio", "http", "sse"]
|
|
47
|
+
};
|
|
48
|
+
// ── Detection ────────────────────────────────────────────────────────────
|
|
49
|
+
detectInstalled(projectDir) {
|
|
50
|
+
const userDir = this.userConfigDir();
|
|
51
|
+
const userCfg = join(userDir, "config.toml");
|
|
52
|
+
const projDir = join(projectDir, ".vibe");
|
|
53
|
+
const projCfg = join(projDir, "config.toml");
|
|
54
|
+
const userInstalled = existsSync(userDir) || existsSync(userCfg);
|
|
55
|
+
const projInstalled = existsSync(projDir) || existsSync(projCfg);
|
|
56
|
+
const installed = userInstalled || projInstalled;
|
|
57
|
+
const scope = projInstalled && !userInstalled ? "project" : "user";
|
|
58
|
+
const configPath = scope === "project" ? projCfg : userCfg;
|
|
59
|
+
return {
|
|
60
|
+
id: this.id,
|
|
61
|
+
name: this.name,
|
|
62
|
+
installed,
|
|
63
|
+
paradigm: this.paradigm,
|
|
64
|
+
capabilities: this.capabilities,
|
|
65
|
+
configPath,
|
|
66
|
+
scope,
|
|
67
|
+
reason: installed ? `found Mistral Vibe config (${scope}) at ${configPath}` : `no .vibe config at ${userDir} or ${projDir}`,
|
|
68
|
+
confidence: installed ? "high" : "low"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// ── Native paths ─────────────────────────────────────────────────────────
|
|
72
|
+
/** ~/.vibe (user) or <projectDir>/.vibe (project). */
|
|
73
|
+
getConfigDir(ctx) {
|
|
74
|
+
return ctx.scope === "project" ? join(ctx.projectDir, ".vibe") : this.userConfigDir();
|
|
75
|
+
}
|
|
76
|
+
/** MCP config: config.toml under the per-scope .vibe dir. */
|
|
77
|
+
getServerConfigPath(ctx) {
|
|
78
|
+
return join(this.getConfigDir(ctx), "config.toml");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Mistral Vibe has no AC-wired hook file (mcp-only — see header). The hook
|
|
82
|
+
* "config path" is the same config.toml so the generic doctor/backup behave
|
|
83
|
+
* sensibly (mirrors warp/zed).
|
|
84
|
+
*/
|
|
85
|
+
getHookConfigPath(ctx) {
|
|
86
|
+
return this.getServerConfigPath(ctx);
|
|
87
|
+
}
|
|
88
|
+
/** ~/.vibe — homedir() covers %USERPROFILE% on Windows. */
|
|
89
|
+
userConfigDir() {
|
|
90
|
+
return join(homedir(), ".vibe");
|
|
91
|
+
}
|
|
92
|
+
// ── TOML config IO ─────────────────────────────────────────────────────────
|
|
93
|
+
readToml(path) {
|
|
94
|
+
if (!existsSync(path)) return {};
|
|
95
|
+
try {
|
|
96
|
+
return TOML.parse(readFileSync(path, "utf8"));
|
|
97
|
+
} catch {
|
|
98
|
+
return {};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
writeToml(path, data, dryRun) {
|
|
102
|
+
if (dryRun) return;
|
|
103
|
+
ensureDir(dirname(path));
|
|
104
|
+
writeFileSync(path, TOML.stringify(data), "utf8");
|
|
105
|
+
}
|
|
106
|
+
// ── MCP server install / uninstall (TOML — ARRAY-OF-TABLES, by `name`) ──────
|
|
107
|
+
installServer(ctx) {
|
|
108
|
+
const { connector, dryRun } = ctx;
|
|
109
|
+
const path = this.getServerConfigPath(ctx);
|
|
110
|
+
const server = this.effectiveServer(ctx);
|
|
111
|
+
if (!server) {
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
platform: this.id,
|
|
115
|
+
action: "skip",
|
|
116
|
+
path,
|
|
117
|
+
detail: connector.server ? "server registration disabled for mistral-vibe" : "connector declares no MCP server"
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
const symlink = this.symlinkPathWarning(path);
|
|
122
|
+
if (symlink) return [symlink];
|
|
123
|
+
const entry = this.renderServerEntry(ctx, server);
|
|
124
|
+
const cfg = this.readToml(path);
|
|
125
|
+
const existingRoot = cfg[MCP_ROOT_KEY];
|
|
126
|
+
if (existingRoot !== void 0 && !Array.isArray(existingRoot)) {
|
|
127
|
+
return [
|
|
128
|
+
{
|
|
129
|
+
platform: this.id,
|
|
130
|
+
action: "skip",
|
|
131
|
+
path,
|
|
132
|
+
detail: `${MCP_ROOT_KEY} is not a TOML array \u2014 left untouched (manual fix needed)`
|
|
133
|
+
}
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
const list = Array.isArray(existingRoot) ? existingRoot : [];
|
|
137
|
+
const idx = list.findIndex((e) => this.entryName(e) === connector.id);
|
|
138
|
+
let action;
|
|
139
|
+
if (idx < 0) {
|
|
140
|
+
list.push(entry);
|
|
141
|
+
action = "create";
|
|
142
|
+
} else if (JSON.stringify(list[idx]) === JSON.stringify(entry)) {
|
|
143
|
+
action = "skip";
|
|
144
|
+
} else {
|
|
145
|
+
list[idx] = entry;
|
|
146
|
+
action = "update";
|
|
147
|
+
}
|
|
148
|
+
if (action !== "skip") {
|
|
149
|
+
cfg[MCP_ROOT_KEY] = list;
|
|
150
|
+
this.writeToml(path, cfg, dryRun);
|
|
151
|
+
}
|
|
152
|
+
return [{ platform: this.id, action, path, detail: `${MCP_ROOT_KEY}[name=${connector.id}]` }];
|
|
153
|
+
}
|
|
154
|
+
uninstallServer(ctx) {
|
|
155
|
+
const { connector, dryRun } = ctx;
|
|
156
|
+
const path = this.getServerConfigPath(ctx);
|
|
157
|
+
const symlink = this.symlinkPathWarning(path);
|
|
158
|
+
if (symlink) return [symlink];
|
|
159
|
+
const cfg = this.readToml(path);
|
|
160
|
+
const rawList = cfg[MCP_ROOT_KEY];
|
|
161
|
+
if (!Array.isArray(rawList)) {
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
platform: this.id,
|
|
165
|
+
action: "skip",
|
|
166
|
+
path,
|
|
167
|
+
detail: `${MCP_ROOT_KEY}[name=${connector.id}] absent`
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
const list = rawList;
|
|
172
|
+
const kept = list.filter((e) => this.entryName(e) !== connector.id);
|
|
173
|
+
if (kept.length === list.length) {
|
|
174
|
+
return [
|
|
175
|
+
{
|
|
176
|
+
platform: this.id,
|
|
177
|
+
action: "skip",
|
|
178
|
+
path,
|
|
179
|
+
detail: `${MCP_ROOT_KEY}[name=${connector.id}] absent`
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
cfg[MCP_ROOT_KEY] = kept;
|
|
184
|
+
this.writeToml(path, cfg, dryRun);
|
|
185
|
+
return [
|
|
186
|
+
{ platform: this.id, action: "remove", path, detail: `${MCP_ROOT_KEY}[name=${connector.id}]` }
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Render a normalized ServerDef into Mistral Vibe's native mcp_servers entry.
|
|
191
|
+
* TOML has no native ${env:VAR} token — resolve every reference to a literal at
|
|
192
|
+
* install time (the safe path, matching codex/droid). Honors the telemetry
|
|
193
|
+
* serve-wrapper for stdio.
|
|
194
|
+
*/
|
|
195
|
+
renderServerEntry(ctx, server) {
|
|
196
|
+
const transport = server.transport;
|
|
197
|
+
if (transport === "stdio") {
|
|
198
|
+
let command = server.command ?? "";
|
|
199
|
+
let args = [...server.args ?? []];
|
|
200
|
+
({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));
|
|
201
|
+
command = resolveEnvRefsDeep(command);
|
|
202
|
+
args = resolveEnvRefsDeep(args);
|
|
203
|
+
const entry2 = {
|
|
204
|
+
name: ctx.connector.id,
|
|
205
|
+
transport: "stdio",
|
|
206
|
+
command
|
|
207
|
+
};
|
|
208
|
+
if (args.length > 0) entry2.args = args;
|
|
209
|
+
const env = this.renderEnv(server.env);
|
|
210
|
+
if (env) entry2.env = env;
|
|
211
|
+
return entry2;
|
|
212
|
+
}
|
|
213
|
+
const vibeTransport = transport === "http" ? "http" : "streamable-http";
|
|
214
|
+
const entry = {
|
|
215
|
+
name: ctx.connector.id,
|
|
216
|
+
transport: vibeTransport,
|
|
217
|
+
url: resolveEnvRefsDeep(server.url ?? "")
|
|
218
|
+
};
|
|
219
|
+
const headers = this.renderEnv(server.headers);
|
|
220
|
+
if (headers) entry.headers = headers;
|
|
221
|
+
return entry;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Render env/header values. Resolve `${env:VAR}` references to literals at
|
|
225
|
+
* install time (TOML cannot interpolate).
|
|
226
|
+
*/
|
|
227
|
+
renderEnv(env) {
|
|
228
|
+
if (!env || Object.keys(env).length === 0) return void 0;
|
|
229
|
+
const out = {};
|
|
230
|
+
for (const [k, v] of Object.entries(resolveEnvRefsDeep({ ...env }))) {
|
|
231
|
+
out[k] = String(v);
|
|
232
|
+
}
|
|
233
|
+
return out;
|
|
234
|
+
}
|
|
235
|
+
// ── Hooks (unavailable — Mistral Vibe is mcp-only) ───────────────────────
|
|
236
|
+
// HONEST CEILING: Vibe ships only an experimental hook surface with no
|
|
237
|
+
// byte-confirmed format/event-name contract, so AC wires no hooks here.
|
|
238
|
+
installHooks(_ctx) {
|
|
239
|
+
return [
|
|
240
|
+
{
|
|
241
|
+
platform: this.id,
|
|
242
|
+
action: "skip",
|
|
243
|
+
detail: "hooks unavailable (Mistral Vibe is mcp-only)"
|
|
244
|
+
}
|
|
245
|
+
];
|
|
246
|
+
}
|
|
247
|
+
uninstallHooks(_ctx) {
|
|
248
|
+
return [
|
|
249
|
+
{
|
|
250
|
+
platform: this.id,
|
|
251
|
+
action: "skip",
|
|
252
|
+
detail: "hooks unavailable (Mistral Vibe is mcp-only)"
|
|
253
|
+
}
|
|
254
|
+
];
|
|
255
|
+
}
|
|
256
|
+
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
257
|
+
getHealthChecks(ctx) {
|
|
258
|
+
const path = this.getServerConfigPath(ctx);
|
|
259
|
+
const id = ctx.connector.id;
|
|
260
|
+
return [
|
|
261
|
+
{
|
|
262
|
+
name: `${this.name}: config.toml present`,
|
|
263
|
+
check: () => existsSync(path) ? { status: "OK", detail: path } : { status: "FAIL", detail: `not found: ${path}` }
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: `${this.name}: ${MCP_ROOT_KEY}[name=${id}] registered`,
|
|
267
|
+
check: () => {
|
|
268
|
+
if (!ctx.connector.server) return { status: "OK", detail: "no MCP server declared" };
|
|
269
|
+
const cfg = this.readToml(path);
|
|
270
|
+
const list = cfg[MCP_ROOT_KEY];
|
|
271
|
+
const present = Array.isArray(list) && list.some((e) => this.entryName(e) === id);
|
|
272
|
+
return present ? { status: "OK", detail: `${MCP_ROOT_KEY}[name=${id}]` } : { status: "FAIL", detail: `${MCP_ROOT_KEY}[name=${id}] not found in ${path}` };
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
];
|
|
276
|
+
}
|
|
277
|
+
// ── Internal helpers ──────────────────────────────────────────────────────
|
|
278
|
+
/** The `name` of an array entry, or undefined when it is not a named object. */
|
|
279
|
+
entryName(entry) {
|
|
280
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return void 0;
|
|
281
|
+
const name = entry.name;
|
|
282
|
+
return typeof name === "string" ? name : void 0;
|
|
283
|
+
}
|
|
284
|
+
/** Resolve the per-platform server override into an effective ServerDef. */
|
|
285
|
+
effectiveServer(ctx) {
|
|
286
|
+
const override = ctx.connector.platforms[this.id]?.server;
|
|
287
|
+
if (override === false) return void 0;
|
|
288
|
+
const base = ctx.connector.server;
|
|
289
|
+
if (!base) return void 0;
|
|
290
|
+
return override && typeof override === "object" ? { ...base, ...override } : base;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
var adapter = new MistralVibeAdapter();
|
|
294
|
+
var mistral_vibe_default = adapter;
|
|
295
|
+
export {
|
|
296
|
+
MistralVibeAdapter,
|
|
297
|
+
adapter,
|
|
298
|
+
mistral_vibe_default as default
|
|
299
|
+
};
|
|
300
|
+
//# sourceMappingURL=mistral-vibe-36CZVQNQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/mistral-vibe/index.ts"],"sourcesContent":["/**\n * adapters/mistral-vibe — Mistral Vibe (Mistral's coding-agent CLI) adapter.\n *\n * Mistral Vibe is an **mcp-only** host: it registers MCP servers but exposes no\n * user-installable lifecycle-hook surface AC can wire today. Its native config\n * is TOML, with a two-level lookup order (project precedes user):\n * 1. <projectDir>/.vibe/config.toml (PROJECT — takes precedence)\n * 2. ~/.vibe/config.toml (USER)\n *\n * MCP shape — byte-confirmed from the OFFICIAL repo README\n * (github.com/mistralai/mistral-vibe) + docs (docs.mistral.ai/vibe/code/cli/\n * configuration + /mcp-servers): the root key `mcp_servers` is a TOML\n * ARRAY-OF-TABLES (`[[mcp_servers]]`), NOT codex's table-keyed\n * `[mcp_servers.<name>]`. Each entry carries a REQUIRED short-alias `name` field\n * — AC writes the CONNECTOR ID there and keys ownership on it (the array-by-name\n * merge the `continue` adapter uses for YAML, applied over TOML):\n *\n * [[mcp_servers]]\n * name = \"fetch_server\"\n * transport = \"stdio\"\n * command = \"uvx\"\n * args = [\"mcp-server-fetch\"]\n * env = { \"DEBUG\" = \"1\", \"LOG_LEVEL\" = \"info\" }\n *\n * [[mcp_servers]]\n * name = \"my_http_server\"\n * transport = \"http\"\n * url = \"http://localhost:8000\"\n * headers = { \"Authorization\" = \"Bearer my_token\" }\n * api_key_env = \"MY_API_KEY_ENV_VAR\"\n *\n * Per-entry fields:\n * - name (required short alias — the connector id)\n * - transport (\"stdio\" | \"http\" | \"streamable-http\")\n * - stdio → command / args / env\n * - http/sse → url / headers / api_key_env / api_key_header / api_key_format\n * - optional startup_timeout_sec / tool_timeout_sec\n *\n * TOML has NO native interpolation token, so every `${env:VAR}` is resolved to a\n * literal at install time (the safe path matching codex/droid). The stdio entry\n * is routed through the telemetry serve-wrapper (`<homeBin> serve --connector\n * <id> -- <command> <args...>`); remote transports are registered but never\n * wrapped (they cannot be intercepted).\n *\n * HOOKS: HONEST CEILING — Mistral Vibe ships only an experimental, unstable hook\n * surface (no byte-confirmed format/event-name contract), so AC wires NO hooks\n * here. The capability flags stay unset and the host is reported mcp-only (the\n * generic installHooks reports \"hooks unavailable\"). When a first-party hook\n * contract is byte-confirmed this becomes a normal capability addition.\n */\n\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\n\nimport TOML from \"@iarna/toml\";\n\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\n Transport,\n} from \"../../core/types.js\";\nimport { ensureDir } from \"../../core/paths.js\";\nimport { resolveEnvRefsDeep } from \"../../core/interpolate.js\";\nimport { buildWrappedStdio } from \"../../core/spawn.js\";\nimport { BaseAdapter } from \"../base.js\";\nimport type { Adapter, InstallContext } from \"../spi.js\";\n\nconst HOST: PlatformId = \"mistral-vibe\";\n/** Root key under which Mistral Vibe stores MCP servers — a TOML ARRAY-OF-TABLES. */\nconst MCP_ROOT_KEY = \"mcp_servers\";\n\n/**\n * Native Mistral Vibe MCP server entry shapes. `name` is the required short\n * alias (we key ownership on it). A stdio entry carries an explicit\n * `transport: \"stdio\"` + command/args/env; a remote entry carries the chosen\n * transport + url/headers. NO api_key_* / *_timeout_sec unless declared.\n */\ninterface VibeStdioServer {\n name: string;\n transport: \"stdio\";\n command: string;\n args?: string[];\n env?: Record<string, string>;\n}\ninterface VibeRemoteServer {\n name: string;\n transport: \"http\" | \"streamable-http\";\n url: string;\n headers?: Record<string, string>;\n}\ntype VibeServer = VibeStdioServer | VibeRemoteServer;\n\nexport class MistralVibeAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Mistral Vibe\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // mcp-only: no hook layer wired (experimental host hooks are not\n // byte-confirmed — see header HONEST CEILING). No memory/content surfaces\n // wired either; only the MCP server is installed. Every hook capability is\n // 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 // Mistral Vibe registers stdio + remote (http / streamable-http) MCP\n // servers. The framework's `http` transport maps to Vibe's \"http\"; `sse`\n // maps to Vibe's \"streamable-http\" (its closest remote form).\n transports: [\"stdio\", \"http\", \"sse\"],\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = this.userConfigDir();\n const userCfg = join(userDir, \"config.toml\");\n const projDir = join(projectDir, \".vibe\");\n const projCfg = join(projDir, \"config.toml\");\n\n const userInstalled = existsSync(userDir) || existsSync(userCfg);\n const projInstalled = existsSync(projDir) || existsSync(projCfg);\n const installed = userInstalled || projInstalled;\n // Project config.toml takes precedence in Vibe's lookup order, so a\n // project-only install reports project scope.\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projCfg : userCfg;\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: installed\n ? `found Mistral Vibe config (${scope}) at ${configPath}`\n : `no .vibe config at ${userDir} or ${projDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /** ~/.vibe (user) or <projectDir>/.vibe (project). */\n override getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".vibe\")\n : this.userConfigDir();\n }\n\n /** MCP config: config.toml under the per-scope .vibe dir. */\n override getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"config.toml\");\n }\n\n /**\n * Mistral Vibe has no AC-wired hook file (mcp-only — see header). The hook\n * \"config path\" is the same config.toml so the generic doctor/backup behave\n * sensibly (mirrors warp/zed).\n */\n override getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n /** ~/.vibe — homedir() covers %USERPROFILE% on Windows. */\n private userConfigDir(): string {\n return join(homedir(), \".vibe\");\n }\n\n // ── TOML config IO ─────────────────────────────────────────────────────────\n\n private readToml(path: string): Record<string, unknown> {\n if (!existsSync(path)) return {};\n try {\n return TOML.parse(readFileSync(path, \"utf8\")) as Record<string, unknown>;\n } catch {\n return {};\n }\n }\n\n private writeToml(path: string, data: Record<string, unknown>, dryRun: boolean): void {\n if (dryRun) return;\n ensureDir(dirname(path));\n // @iarna/toml's stringify type wants its JsonMap; our object is structurally compatible.\n writeFileSync(path, TOML.stringify(data as never), \"utf8\");\n }\n\n // ── MCP server install / uninstall (TOML — ARRAY-OF-TABLES, by `name`) ──────\n\n override installServer(ctx: InstallContext): ChangeRecord[] {\n const { connector, dryRun } = ctx;\n const path = this.getServerConfigPath(ctx);\n const server = this.effectiveServer(ctx);\n\n if (!server) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path,\n detail: connector.server\n ? \"server registration disabled for mistral-vibe\"\n : \"connector declares no MCP server\",\n },\n ];\n }\n\n const symlink = this.symlinkPathWarning(path);\n if (symlink) return [symlink];\n\n const entry = this.renderServerEntry(ctx, server);\n\n // Merge into existing TOML, preserving every other config key + sibling\n // mcp_servers entry. mcp_servers is a TOML ARRAY-OF-TABLES; we key on `name`.\n const cfg = this.readToml(path);\n // NEVER clobber a malformed `mcp_servers`: if it exists and is not an array,\n // skip-and-warn (symmetric with uninstallServer) rather than silently\n // replacing the user's hand-written value.\n const existingRoot = cfg[MCP_ROOT_KEY];\n if (existingRoot !== undefined && !Array.isArray(existingRoot)) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path,\n detail: `${MCP_ROOT_KEY} is not a TOML array — left untouched (manual fix needed)`,\n },\n ];\n }\n\n const list = Array.isArray(existingRoot) ? (existingRoot as VibeServer[]) : [];\n const idx = list.findIndex((e) => this.entryName(e) === connector.id);\n\n let action: ChangeRecord[\"action\"];\n if (idx < 0) {\n list.push(entry);\n action = \"create\";\n } else if (JSON.stringify(list[idx]) === JSON.stringify(entry)) {\n action = \"skip\";\n } else {\n list[idx] = entry;\n action = \"update\";\n }\n\n if (action !== \"skip\") {\n cfg[MCP_ROOT_KEY] = list;\n this.writeToml(path, cfg, dryRun);\n }\n return [{ platform: this.id, action, path, detail: `${MCP_ROOT_KEY}[name=${connector.id}]` }];\n }\n\n override uninstallServer(ctx: InstallContext): ChangeRecord[] {\n const { connector, dryRun } = ctx;\n const path = this.getServerConfigPath(ctx);\n const symlink = this.symlinkPathWarning(path);\n if (symlink) return [symlink];\n\n const cfg = this.readToml(path);\n const rawList = cfg[MCP_ROOT_KEY];\n if (!Array.isArray(rawList)) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path,\n detail: `${MCP_ROOT_KEY}[name=${connector.id}] absent`,\n },\n ];\n }\n\n const list = rawList as VibeServer[];\n const kept = list.filter((e) => this.entryName(e) !== connector.id);\n if (kept.length === list.length) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n path,\n detail: `${MCP_ROOT_KEY}[name=${connector.id}] absent`,\n },\n ];\n }\n\n cfg[MCP_ROOT_KEY] = kept;\n this.writeToml(path, cfg, dryRun);\n return [\n { platform: this.id, action: \"remove\", path, detail: `${MCP_ROOT_KEY}[name=${connector.id}]` },\n ];\n }\n\n /**\n * Render a normalized ServerDef into Mistral Vibe's native mcp_servers entry.\n * TOML has no native ${env:VAR} token — resolve every reference to a literal at\n * install time (the safe path, matching codex/droid). Honors the telemetry\n * serve-wrapper for stdio.\n */\n private renderServerEntry(ctx: InstallContext, server: ServerDef): VibeServer {\n const transport: Transport = server.transport;\n\n if (transport === \"stdio\") {\n let command = server.command ?? \"\";\n let args = [...(server.args ?? [])];\n\n ({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));\n\n command = resolveEnvRefsDeep(command);\n args = resolveEnvRefsDeep(args);\n\n const entry: VibeStdioServer = {\n name: ctx.connector.id,\n transport: \"stdio\",\n command,\n };\n if (args.length > 0) entry.args = args;\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n return entry;\n }\n\n // Remote (sse / http / ws) — Vibe registers an explicit transport + url. The\n // framework's `http` transport maps to Vibe's \"http\"; `sse` maps to\n // \"streamable-http\" (ws has no Vibe analog → also \"streamable-http\", the\n // closest documented remote form).\n const vibeTransport: VibeRemoteServer[\"transport\"] =\n transport === \"http\" ? \"http\" : \"streamable-http\";\n const entry: VibeRemoteServer = {\n name: ctx.connector.id,\n transport: vibeTransport,\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. Resolve `${env:VAR}` references to literals at\n * install time (TOML cannot interpolate).\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 const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(resolveEnvRefsDeep({ ...env }))) {\n out[k] = String(v);\n }\n return out;\n }\n\n // ── Hooks (unavailable — Mistral Vibe is mcp-only) ───────────────────────\n // HONEST CEILING: Vibe ships only an experimental hook surface with no\n // byte-confirmed format/event-name contract, so AC wires no hooks here.\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Mistral Vibe 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 (Mistral Vibe is mcp-only)\",\n },\n ];\n }\n\n // ── Diagnostics ──────────────────────────────────────────────────────────\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const path = this.getServerConfigPath(ctx);\n const id = ctx.connector.id;\n return [\n {\n name: `${this.name}: config.toml present`,\n check: () =>\n existsSync(path)\n ? { status: \"OK\", detail: path }\n : { status: \"FAIL\", detail: `not found: ${path}` },\n },\n {\n name: `${this.name}: ${MCP_ROOT_KEY}[name=${id}] registered`,\n check: () => {\n if (!ctx.connector.server) return { status: \"OK\", detail: \"no MCP server declared\" };\n const cfg = this.readToml(path);\n const list = cfg[MCP_ROOT_KEY];\n const present =\n Array.isArray(list) &&\n (list as VibeServer[]).some((e) => this.entryName(e) === id);\n return present\n ? { status: \"OK\", detail: `${MCP_ROOT_KEY}[name=${id}]` }\n : { status: \"FAIL\", detail: `${MCP_ROOT_KEY}[name=${id}] not found in ${path}` };\n },\n },\n ];\n }\n\n // ── Internal helpers ──────────────────────────────────────────────────────\n\n /** The `name` of an array entry, or undefined when it is not a named object. */\n private entryName(entry: unknown): string | undefined {\n if (!entry || typeof entry !== \"object\" || Array.isArray(entry)) return undefined;\n const name = (entry as { name?: unknown }).name;\n return typeof name === \"string\" ? name : undefined;\n }\n\n /** Resolve the per-platform server override into an effective ServerDef. */\n private effectiveServer(ctx: InstallContext): ServerDef | undefined {\n const override = ctx.connector.platforms[this.id]?.server;\n if (override === false) return undefined;\n const base = ctx.connector.server;\n if (!base) return undefined;\n return override && typeof override === \"object\" ? { ...base, ...override } : base;\n }\n}\n\nexport const adapter = new MistralVibeAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAS,YAAY,cAAc,qBAAqB;AACxD,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAE9B,OAAO,UAAU;AAkBjB,IAAM,OAAmB;AAEzB,IAAM,eAAe;AAuBd,IAAM,qBAAN,cAAiC,YAA+B;AAAA,EAC5D,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK5C,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA,IACd,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA;AAAA;AAAA;AAAA,IAIzB,YAAY,CAAC,SAAS,QAAQ,KAAK;AAAA,EACrC;AAAA;AAAA,EAIA,gBAAgB,YAAsC;AACpD,UAAM,UAAU,KAAK,cAAc;AACnC,UAAM,UAAU,KAAK,SAAS,aAAa;AAC3C,UAAM,UAAU,KAAK,Y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O;AAClB,WAAO,YAAY,OAAO,aAAa,WAAW,EAAE,GAAG,MAAM,GAAG,SAAS,IAAI;AAAA,EAC/E;AACF;AAEO,IAAM,UAAU,IAAI,mBAAmB;AAC9C,IAAO,uBAAQ;","names":["entry"]}
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
BaseAdapter,
|
|
8
8
|
renderSkillMd
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WFEHWTLM.js";
|
|
10
10
|
import {
|
|
11
11
|
buildWrappedStdio
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-4NHXLXSD.js";
|
|
13
|
+
import "./chunk-M2H7JURF.js";
|
|
14
|
+
import "./chunk-GZGLCCEE.js";
|
|
15
15
|
|
|
16
16
|
// src/adapters/mux/index.ts
|
|
17
17
|
import { existsSync, statSync } from "fs";
|
|
@@ -319,4 +319,4 @@ export {
|
|
|
319
319
|
adapter,
|
|
320
320
|
mux_default as default
|
|
321
321
|
};
|
|
322
|
-
//# sourceMappingURL=mux-
|
|
322
|
+
//# sourceMappingURL=mux-HWL4N5KH.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
OpenClawAdapter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3C5AASHM.js";
|
|
5
5
|
import "./chunk-BEFVJ2OE.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-WFEHWTLM.js";
|
|
7
|
+
import "./chunk-4NHXLXSD.js";
|
|
8
|
+
import "./chunk-M2H7JURF.js";
|
|
9
|
+
import "./chunk-GZGLCCEE.js";
|
|
10
10
|
|
|
11
11
|
// src/adapters/nemoclaw/index.ts
|
|
12
12
|
import { existsSync } from "fs";
|
|
@@ -54,4 +54,4 @@ export {
|
|
|
54
54
|
adapter,
|
|
55
55
|
nemoclaw_default as default
|
|
56
56
|
};
|
|
57
|
-
//# sourceMappingURL=nemoclaw-
|
|
57
|
+
//# sourceMappingURL=nemoclaw-QPHETUXM.js.map
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "./chunk-BEFVJ2OE.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WFEHWTLM.js";
|
|
11
11
|
import {
|
|
12
12
|
buildWrappedStdio
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-4NHXLXSD.js";
|
|
14
|
+
import "./chunk-M2H7JURF.js";
|
|
15
|
+
import "./chunk-GZGLCCEE.js";
|
|
16
16
|
|
|
17
17
|
// src/adapters/omp/index.ts
|
|
18
18
|
import { existsSync } from "fs";
|
|
@@ -652,4 +652,4 @@ export {
|
|
|
652
652
|
adapter,
|
|
653
653
|
omp_default as default
|
|
654
654
|
};
|
|
655
|
-
//# sourceMappingURL=omp-
|
|
655
|
+
//# sourceMappingURL=omp-3TFMTJ5U.js.map
|