@ken-jo/agent-connector 0.3.1 → 0.4.1
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 +180 -16
- package/dist/action-WT7GVRCC.js +55 -0
- package/dist/action-WT7GVRCC.js.map +1 -0
- package/dist/amazon-q-COAL3764.js +276 -0
- package/dist/amazon-q-COAL3764.js.map +1 -0
- package/dist/{amp-YGV66GJT.js → amp-4U33CU7E.js} +81 -5
- package/dist/amp-4U33CU7E.js.map +1 -0
- package/dist/{antigravity-7IBYFO6P.js → antigravity-AMKKKHS4.js} +4 -4
- package/dist/{antigravity-cli-JEOUP2VN.js → antigravity-cli-XERXEH5W.js} +4 -4
- package/dist/{chunk-3JCRUROU.js → chunk-24IDL5RW.js} +13 -4
- package/dist/chunk-24IDL5RW.js.map +1 -0
- package/dist/chunk-2AVLX7GH.js +351 -0
- package/dist/chunk-2AVLX7GH.js.map +1 -0
- package/dist/{chunk-GSGDG2BV.js → chunk-4ENJK5S2.js} +106 -176
- package/dist/chunk-4ENJK5S2.js.map +1 -0
- package/dist/{chunk-ZAM4M7LI.js → chunk-5OWS5CMA.js} +136 -296
- package/dist/chunk-5OWS5CMA.js.map +1 -0
- package/dist/{chunk-PD4VFEBY.js → chunk-CPLK7GTE.js} +79 -5
- package/dist/chunk-CPLK7GTE.js.map +1 -0
- package/dist/chunk-DCKFYWGM.js +237 -0
- package/dist/chunk-DCKFYWGM.js.map +1 -0
- package/dist/chunk-EGCBZ2DC.js +83 -0
- package/dist/chunk-EGCBZ2DC.js.map +1 -0
- package/dist/chunk-F5RX62T7.js +21 -0
- package/dist/chunk-F5RX62T7.js.map +1 -0
- package/dist/chunk-FAHIMJRU.js +177 -0
- package/dist/chunk-FAHIMJRU.js.map +1 -0
- package/dist/{chunk-MEH7GC7R.js → chunk-I5MLE6S7.js} +33 -3
- package/dist/chunk-I5MLE6S7.js.map +1 -0
- package/dist/{chunk-KVAAFYRR.js → chunk-KHO5WNTP.js} +2 -18
- package/dist/chunk-KHO5WNTP.js.map +1 -0
- package/dist/{chunk-KQSNDFBN.js → chunk-LQRAPXS4.js} +3 -3
- package/dist/{chunk-3RBLIHPZ.js → chunk-O5TWCIJN.js} +27 -17
- package/dist/chunk-O5TWCIJN.js.map +1 -0
- package/dist/{chunk-WNREHWKL.js → chunk-QREL7LZJ.js} +5 -4
- package/dist/chunk-QREL7LZJ.js.map +1 -0
- package/dist/{chunk-KMAKDD3Z.js → chunk-RIMVWCZY.js} +37 -12
- package/dist/chunk-RIMVWCZY.js.map +1 -0
- package/dist/{openclaw-UZ5BMCGQ.js → chunk-URHQMFB3.js} +210 -41
- package/dist/chunk-URHQMFB3.js.map +1 -0
- package/dist/chunk-WZA4CSGJ.js +28 -0
- package/dist/chunk-WZA4CSGJ.js.map +1 -0
- package/dist/chunk-XJ4S47CT.js +44 -0
- package/dist/chunk-XJ4S47CT.js.map +1 -0
- package/dist/{claude-code-4275HQU4.js → claude-code-W4PUFZL5.js} +194 -52
- package/dist/claude-code-W4PUFZL5.js.map +1 -0
- package/dist/cli/sdk.js +5 -3
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cline-WRYMNS7Z.js +442 -0
- package/dist/cline-WRYMNS7Z.js.map +1 -0
- package/dist/{codebuff-LE3KBZGM.js → codebuff-DH5Y7GAT.js} +106 -5
- package/dist/codebuff-DH5Y7GAT.js.map +1 -0
- package/dist/{codex-4BY2ZJIW.js → codex-DDHIV767.js} +43 -11
- package/dist/codex-DDHIV767.js.map +1 -0
- package/dist/continue-K43SUHLQ.js +790 -0
- package/dist/continue-K43SUHLQ.js.map +1 -0
- package/dist/{copilot-cli-IPISKO3V.js → copilot-cli-Q3SSPT4V.js} +70 -12
- package/dist/copilot-cli-Q3SSPT4V.js.map +1 -0
- package/dist/{crush-X3E25EQG.js → crush-MBEH2R3I.js} +130 -6
- package/dist/crush-MBEH2R3I.js.map +1 -0
- package/dist/{cursor-UH3W622V.js → cursor-TMBXDYR4.js} +119 -16
- package/dist/cursor-TMBXDYR4.js.map +1 -0
- package/dist/{detect-U3E7NVNW.js → detect-KG5FG3EV.js} +5 -3
- package/dist/{detect-U3E7NVNW.js.map → detect-KG5FG3EV.js.map} +1 -1
- package/dist/{doctor-DZTWED4O.js → doctor-FLZF34Y3.js} +226 -96
- package/dist/doctor-FLZF34Y3.js.map +1 -0
- package/dist/{droid-T5VBRXZF.js → droid-JC2NT6S4.js} +298 -10
- package/dist/droid-JC2NT6S4.js.map +1 -0
- package/dist/{gemini-cli-ZSUK55UA.js → gemini-cli-ILR7M5X3.js} +62 -10
- package/dist/gemini-cli-ILR7M5X3.js.map +1 -0
- package/dist/{goose-M3RR3CZG.js → goose-SFO5BBGW.js} +112 -10
- package/dist/goose-SFO5BBGW.js.map +1 -0
- package/dist/{hermes-CUNKIAR5.js → hermes-3N7WN4WS.js} +329 -15
- package/dist/hermes-3N7WN4WS.js.map +1 -0
- package/dist/{hook-EVY7LOUQ.js → hook-XR3Z45FB.js} +16 -10
- package/dist/hook-XR3Z45FB.js.map +1 -0
- package/dist/index.d.ts +71 -3
- package/dist/index.js +23 -3
- package/dist/{install-OWAS5UIE.js → install-BSR62UHJ.js} +12 -9
- package/dist/{install-OWAS5UIE.js.map → install-BSR62UHJ.js.map} +1 -1
- package/dist/introspect-Nw8hTReX.d.ts +53 -0
- package/dist/{jetbrains-copilot-C3HDGGML.js → jetbrains-copilot-NRZHI5PC.js} +85 -18
- package/dist/jetbrains-copilot-NRZHI5PC.js.map +1 -0
- package/dist/{kilo-PKAJCWPX.js → kilo-5NWOXVSD.js} +16 -16
- package/dist/kilo-5NWOXVSD.js.map +1 -0
- package/dist/{kilo-cli-QWUVXG2O.js → kilo-cli-UZ7R5UOP.js} +3 -3
- package/dist/{kimi-EVD7YKXS.js → kimi-2YFK2GBA.js} +87 -25
- package/dist/kimi-2YFK2GBA.js.map +1 -0
- package/dist/{kiro-UQRY6EIO.js → kiro-YL6AWUYG.js} +3 -3
- package/dist/{leaderboard-CSWHI4UY.js → leaderboard-MJG24O35.js} +2 -2
- package/dist/mimo-code-FTMGSKMQ.js +790 -0
- package/dist/mimo-code-FTMGSKMQ.js.map +1 -0
- package/dist/{mux-5CI5FP2W.js → mux-5XZFB44C.js} +156 -6
- package/dist/mux-5XZFB44C.js.map +1 -0
- package/dist/nemoclaw-W5KEJ3WX.js +58 -0
- package/dist/nemoclaw-W5KEJ3WX.js.map +1 -0
- package/dist/{omp-AXA7XY22.js → omp-2QMEY6HD.js} +138 -18
- package/dist/omp-2QMEY6HD.js.map +1 -0
- package/dist/openclaw-EXJEFNZI.js +18 -0
- package/dist/openclaw-EXJEFNZI.js.map +1 -0
- package/dist/{opencode-NZBRLJN3.js → opencode-WNXYJR4X.js} +84 -27
- package/dist/opencode-WNXYJR4X.js.map +1 -0
- package/dist/{package-WFOS4QVU.js → package-ACZXJHWB.js} +8 -6
- package/dist/{package-WFOS4QVU.js.map → package-ACZXJHWB.js.map} +1 -1
- package/dist/{pi-WMTUX6ES.js → pi-PVVPVWKG.js} +3 -2
- package/dist/{pi-WMTUX6ES.js.map → pi-PVVPVWKG.js.map} +1 -1
- package/dist/{qwen-code-MRRIUQ3P.js → qwen-code-G4CXKUHR.js} +426 -10
- package/dist/qwen-code-G4CXKUHR.js.map +1 -0
- package/dist/{roo-code-NI5UU6JB.js → roo-code-67TYJIQR.js} +137 -4
- package/dist/roo-code-67TYJIQR.js.map +1 -0
- package/dist/runtime/index.d.ts +96 -2
- package/dist/runtime/index.js +19 -10
- package/dist/sdk/index.d.ts +52 -0
- package/dist/sdk/index.js +82 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/test.d.ts +74 -0
- package/dist/sdk/test.js +292 -0
- package/dist/sdk/test.js.map +1 -0
- package/dist/{serve-3C2VFPAY.js → serve-GER7URPR.js} +13 -9
- package/dist/{serve-3C2VFPAY.js.map → serve-GER7URPR.js.map} +1 -1
- package/dist/{status-MKQYX5MW.js → status-LAJE3BM5.js} +10 -7
- package/dist/{status-MKQYX5MW.js.map → status-LAJE3BM5.js.map} +1 -1
- package/dist/statusline-L376ZPZU.js +60 -0
- package/dist/statusline-L376ZPZU.js.map +1 -0
- package/dist/{telemetry-3DN6XGYB.js → telemetry-B3DX3PWU.js} +6 -4
- package/dist/{telemetry-3DN6XGYB.js.map → telemetry-B3DX3PWU.js.map} +1 -1
- package/dist/{trae-CQC72RHH.js → trae-7CZZGOGI.js} +99 -5
- package/dist/trae-7CZZGOGI.js.map +1 -0
- package/dist/{types-CNigfEuR.d.ts → types-CRVrFWeU.d.ts} +322 -18
- package/dist/{uninstall-WG6PFWF3.js → uninstall-ZYTW7YMZ.js} +12 -9
- package/dist/{uninstall-WG6PFWF3.js.map → uninstall-ZYTW7YMZ.js.map} +1 -1
- package/dist/{upgrade-32NC2RKI.js → upgrade-4LUEEOZW.js} +12 -9
- package/dist/{upgrade-32NC2RKI.js.map → upgrade-4LUEEOZW.js.map} +1 -1
- package/dist/{usage-CJOM2WQM.js → usage-ZFBVQF3H.js} +2 -2
- package/dist/{usage-event-472X3DOY.js → usage-event-GZ32AGEB.js} +12 -8
- package/dist/{usage-event-472X3DOY.js.map → usage-event-GZ32AGEB.js.map} +1 -1
- package/dist/{vscode-copilot-4RVRTCKV.js → vscode-copilot-MF2CDNMT.js} +23 -10
- package/dist/vscode-copilot-MF2CDNMT.js.map +1 -0
- package/dist/{warp-X6MB67NT.js → warp-VKG55TAT.js} +55 -4
- package/dist/warp-VKG55TAT.js.map +1 -0
- package/dist/windsurf-FU5G4SHF.js +443 -0
- package/dist/windsurf-FU5G4SHF.js.map +1 -0
- package/dist/{zed-NTCYW4V2.js → zed-SFUHL3GS.js} +3 -3
- package/package.json +10 -2
- package/dist/amp-YGV66GJT.js.map +0 -1
- package/dist/chunk-3JCRUROU.js.map +0 -1
- package/dist/chunk-3RBLIHPZ.js.map +0 -1
- package/dist/chunk-GSGDG2BV.js.map +0 -1
- package/dist/chunk-KMAKDD3Z.js.map +0 -1
- package/dist/chunk-KVAAFYRR.js.map +0 -1
- package/dist/chunk-MEH7GC7R.js.map +0 -1
- package/dist/chunk-NJU275US.js +0 -238
- package/dist/chunk-NJU275US.js.map +0 -1
- package/dist/chunk-PD4VFEBY.js.map +0 -1
- package/dist/chunk-WNREHWKL.js.map +0 -1
- package/dist/chunk-ZAM4M7LI.js.map +0 -1
- package/dist/claude-code-4275HQU4.js.map +0 -1
- package/dist/codebuff-LE3KBZGM.js.map +0 -1
- package/dist/codex-4BY2ZJIW.js.map +0 -1
- package/dist/copilot-cli-IPISKO3V.js.map +0 -1
- package/dist/crush-X3E25EQG.js.map +0 -1
- package/dist/cursor-UH3W622V.js.map +0 -1
- package/dist/doctor-DZTWED4O.js.map +0 -1
- package/dist/droid-T5VBRXZF.js.map +0 -1
- package/dist/gemini-cli-ZSUK55UA.js.map +0 -1
- package/dist/goose-M3RR3CZG.js.map +0 -1
- package/dist/hermes-CUNKIAR5.js.map +0 -1
- package/dist/hook-EVY7LOUQ.js.map +0 -1
- package/dist/jetbrains-copilot-C3HDGGML.js.map +0 -1
- package/dist/kilo-PKAJCWPX.js.map +0 -1
- package/dist/kimi-EVD7YKXS.js.map +0 -1
- package/dist/mux-5CI5FP2W.js.map +0 -1
- package/dist/omp-AXA7XY22.js.map +0 -1
- package/dist/openclaw-UZ5BMCGQ.js.map +0 -1
- package/dist/opencode-NZBRLJN3.js.map +0 -1
- package/dist/qwen-code-MRRIUQ3P.js.map +0 -1
- package/dist/roo-code-NI5UU6JB.js.map +0 -1
- package/dist/trae-CQC72RHH.js.map +0 -1
- package/dist/vscode-copilot-4RVRTCKV.js.map +0 -1
- package/dist/warp-X6MB67NT.js.map +0 -1
- /package/dist/{antigravity-7IBYFO6P.js.map → antigravity-AMKKKHS4.js.map} +0 -0
- /package/dist/{antigravity-cli-JEOUP2VN.js.map → antigravity-cli-XERXEH5W.js.map} +0 -0
- /package/dist/{chunk-KQSNDFBN.js.map → chunk-LQRAPXS4.js.map} +0 -0
- /package/dist/{kilo-cli-QWUVXG2O.js.map → kilo-cli-UZ7R5UOP.js.map} +0 -0
- /package/dist/{kiro-UQRY6EIO.js.map → kiro-YL6AWUYG.js.map} +0 -0
- /package/dist/{leaderboard-CSWHI4UY.js.map → leaderboard-MJG24O35.js.map} +0 -0
- /package/dist/{usage-CJOM2WQM.js.map → usage-ZFBVQF3H.js.map} +0 -0
- /package/dist/{zed-NTCYW4V2.js.map → zed-SFUHL3GS.js.map} +0 -0
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@ken-jo/agent-connector)
|
|
10
10
|
[](LICENSE)
|
|
11
|
-

|
|
11
|
+

|
|
12
|
+

|
|
13
13
|

|
|
14
14
|

|
|
15
15
|

|
|
16
16
|

|
|
17
|
-

|
|
18
18
|
|
|
19
19
|
## Who this is for
|
|
20
20
|
|
|
@@ -57,14 +57,14 @@ agent-connector is the middleware that does it for you:
|
|
|
57
57
|
registered but **not wrapped** (the proxy cannot intercept remote transports),
|
|
58
58
|
so they yield no per-tool telemetry.
|
|
59
59
|
|
|
60
|
-
> Status: **
|
|
60
|
+
> Status: **35 platforms, all 3 hook paradigms** (exceeds the
|
|
61
61
|
> [tokscale](https://github.com/junhoyeo/tokscale) token-leaderboard coverage).
|
|
62
62
|
>
|
|
63
63
|
> | Paradigm | Platforms |
|
|
64
64
|
> |---|---|
|
|
65
|
-
> | `json-stdio` (full hook dispatch) | Claude Code · Codex CLI · Cursor · VS Code Copilot · JetBrains Copilot · GitHub Copilot CLI · Gemini CLI · Qwen CLI · Kiro · Kimi CLI · Crush · Goose · Hermes · Droid (Factory) · Antigravity · Antigravity CLI |
|
|
66
|
-
> | `mcp-only` (MCP registration only) | Warp ·
|
|
67
|
-
> | `ts-plugin` (generated bridge module) | OpenCode · Kilo CLI · OMP · OpenClaw |
|
|
65
|
+
> | `json-stdio` (full hook dispatch) | Claude Code · Codex CLI · Cursor · VS Code Copilot · JetBrains Copilot · GitHub Copilot CLI · Gemini CLI · Qwen CLI · Kiro · Kimi CLI · Crush · Goose · Hermes · Droid (Factory) · Antigravity · Antigravity CLI · Continue |
|
|
66
|
+
> | `mcp-only` (MCP registration only) | Warp · Roo Code · Cline · Trae · Zed · Amp · Codebuff · Mux · Pi · Amazon Q · Windsurf |
|
|
67
|
+
> | `ts-plugin` (generated bridge module) | OpenCode · MiMoCode · Kilo CLI · Kilo · OMP · NemoClaw · OpenClaw |
|
|
68
68
|
>
|
|
69
69
|
> …plus the telemetry core. Adding a platform = **one registry entry + one
|
|
70
70
|
> adapter**. (Google Antigravity is now fully supported, including the `agy` CLI,
|
|
@@ -72,10 +72,13 @@ agent-connector is the middleware that does it for you:
|
|
|
72
72
|
|
|
73
73
|
## Verification
|
|
74
74
|
|
|
75
|
-
The full single-API contract is **install-verified across
|
|
75
|
+
The full single-API contract is **install-verified across the platform set**. A
|
|
76
76
|
sample connector declaring **all four launch surfaces** — MCP server **+**
|
|
77
77
|
lifecycle hooks **+** slash commands **+** tools (skills + subagents) — was
|
|
78
|
-
installed into an isolated environment for every adapter and inspected on disk
|
|
78
|
+
installed into an isolated environment for every adapter and inspected on disk
|
|
79
|
+
(the 29-platform full sweep below; the two newest adapters — MiMoCode and
|
|
80
|
+
NemoClaw — were added with a focused isolated-HOME install check landing the MCP
|
|
81
|
+
server in the right file + root key):
|
|
79
82
|
|
|
80
83
|
- **29 / 29 platforms — zero missing, zero failed surfaces.** Each surface is
|
|
81
84
|
written where the host supports it and gracefully *skip-warned* (never silently
|
|
@@ -102,7 +105,7 @@ installed into an isolated environment for every adapter and inspected on disk:
|
|
|
102
105
|
- **Clean uninstall + `--purge`.** Every installed surface reverses; `--purge`
|
|
103
106
|
deregisters the connector record and tears down the home binary when no
|
|
104
107
|
connectors remain (29 / 29).
|
|
105
|
-
- **
|
|
108
|
+
- **1874 tests passing** · `tsc` clean · build green.
|
|
106
109
|
|
|
107
110
|
The 0.2.0 additions — the `memory` surface, the `nativeHooks` passthrough, and
|
|
108
111
|
`configPatch` — went through the same bar: dogfooded against real connector
|
|
@@ -192,7 +195,7 @@ npx @ken-jo/agent-connector install
|
|
|
192
195
|
|
|
193
196
|
> `install` targets only the hosts actually **detected** on this machine (or an
|
|
194
197
|
> explicit `--targets` / `connector.targets` list), intersected with the
|
|
195
|
-
>
|
|
198
|
+
> 35-adapter registry — there is no "install to all 35 unconditionally" path.
|
|
196
199
|
|
|
197
200
|
> **Optional convenience.** A global `npm i -g @ken-jo/agent-connector` is **not**
|
|
198
201
|
> required for the flow above — `npx @ken-jo/agent-connector …` runs it straight from
|
|
@@ -254,6 +257,72 @@ acme-db`, `acme-db install` ≈ `agent-connector install --connector
|
|
|
254
257
|
tools share that infrastructure. An explicit `--connector` / `--connector-id`
|
|
255
258
|
always overrides the injected default.
|
|
256
259
|
|
|
260
|
+
### Author + test offline — the Connector SDK (`/sdk`, `/sdk/test`)
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
import { defineConnector, defineHook, hostsSupporting } from "@ken-jo/agent-connector/sdk";
|
|
264
|
+
import { simulate, explain } from "@ken-jo/agent-connector/sdk/test";
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
`@ken-jo/agent-connector/sdk` is the consolidated **authoring** surface — it
|
|
268
|
+
re-exports `defineConnector`, the full `define*` family, the introspection
|
|
269
|
+
helpers, and public types from one import site (the root export is unchanged;
|
|
270
|
+
`/sdk` is additive).
|
|
271
|
+
|
|
272
|
+
**`define*` typed helpers** — each is a typed identity function (`(def) => def`)
|
|
273
|
+
that gives you per-surface type inference and a single import site:
|
|
274
|
+
`defineCommand`, `defineSkill`, `defineSubagent`, `defineMemory`,
|
|
275
|
+
`defineConfigPatch`, `defineNativeHook`. `defineHook` is event-parameterized
|
|
276
|
+
so the handler payload narrows to the concrete event type:
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
const guard = defineHook("PreToolUse", {
|
|
280
|
+
handler(evt) {
|
|
281
|
+
// evt.toolName is typed as PreToolUseEvent — not the union
|
|
282
|
+
return evt.toolName === "acme_write"
|
|
283
|
+
? { decision: "ask", reason: "Confirm write" }
|
|
284
|
+
: { decision: "allow" };
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**Introspection** (async — adapters load lazily):
|
|
290
|
+
|
|
291
|
+
- `hostsSupporting(surface)` → `Promise<PlatformId[]>` — which registered hosts
|
|
292
|
+
honor a surface (`"hooks"` | `"statusline"` | `"memory"` | …).
|
|
293
|
+
- `capabilitiesOf(host)` → `Promise<PlatformCapabilities | undefined>`.
|
|
294
|
+
- `surfaceSupport(host, surface)` → `Promise<boolean>` — convenience single-pair check.
|
|
295
|
+
|
|
296
|
+
**Offline harness** (`@ken-jo/agent-connector/sdk/test`) answers *"does my
|
|
297
|
+
handler / HUD actually work on host X?"* before you touch a real host:
|
|
298
|
+
|
|
299
|
+
- `explain(connector)` → `Promise<ExplainRow[]>` — the per-host × per-declared-surface
|
|
300
|
+
matrix. Each row is `{ host, surface, support: "native"|"skip-warn"|"disabled", reason }`.
|
|
301
|
+
Only surfaces the connector actually declares are included.
|
|
302
|
+
- `simulate(connector, { surface, host, event?, input })` → `Promise<{ honored, hostReply?, reason }>`
|
|
303
|
+
— runs the **real** adapter parse→handler→format chain offline and judges the
|
|
304
|
+
actual `(event, decision)` contract. It encodes each host's real honor / drop /
|
|
305
|
+
degrade quirks — not substring guessing:
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
// Does codex honor a context injection on UserPromptSubmit?
|
|
309
|
+
const result = await simulate(connector, {
|
|
310
|
+
surface: "hooks",
|
|
311
|
+
host: "codex",
|
|
312
|
+
event: "UserPromptSubmit",
|
|
313
|
+
input: { hookEventName: "UserPromptSubmit", prompt: "explain this" },
|
|
314
|
+
});
|
|
315
|
+
// → { honored: false, reason: "drops context on UserPromptSubmit (no stdout path)" }
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
> Other verdicts the harness encodes: a `deny` on `Stop`/`SubagentStop` is
|
|
319
|
+
> continuation/persistence → `honored:true` (reason explains); `deny` on
|
|
320
|
+
> `SubagentStart`/`PostToolUseFailure` degrades to a context note →
|
|
321
|
+
> `honored:false`; a PermissionRequest `ask` is honored by the host's native
|
|
322
|
+
> dialog → `honored:true`. Matcher-scoped handlers that don't match the input
|
|
323
|
+
> are not run. The harness mirrors the runtime exactly — tolerant stdin,
|
|
324
|
+
> matcher filtering, real verdict.
|
|
325
|
+
|
|
257
326
|
### Two ways to ship: direct install **or** a marketplace package
|
|
258
327
|
|
|
259
328
|
Same one definition, your choice of distribution:
|
|
@@ -332,14 +401,16 @@ export default defineConnector({
|
|
|
332
401
|
> Code only for now; other hosts skip-warn, never silently.
|
|
333
402
|
|
|
334
403
|
> **Host-config key patches.** For host-exclusive *settings keys* no other
|
|
335
|
-
> surface reaches (
|
|
336
|
-
> declare `platforms: { "claude-code": { configPatch: [{ key, value, reason }] } }`.
|
|
404
|
+
> surface reaches (e.g. an experimental `env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`
|
|
405
|
+
> flag), declare `platforms: { "claude-code": { configPatch: [{ key, value, reason }] } }`.
|
|
337
406
|
> Semantics are fixed: **set-if-absent + skip-warn on any conflict** — never
|
|
338
407
|
> overwrite, never deep-merge. Ownership is refcounted in a persisted ledger, so
|
|
339
408
|
> uninstall removes a key only when the last owning connector releases it and the
|
|
340
409
|
> value is untouched; security-relevant keys (`permissions*`, `apiKey*`,
|
|
341
|
-
> `env.ANTHROPIC_*`, token/secret env vars, …) are hard-refused
|
|
342
|
-
>
|
|
410
|
+
> `env.ANTHROPIC_*`, token/secret env vars, …) are hard-refused, as are keys
|
|
411
|
+
> agent-connector models as first-class surfaces (`hooks*`, `mcpServers*`,
|
|
412
|
+
> `statusLine` → use the `statusline` surface instead). Claude Code only for now;
|
|
413
|
+
> other hosts skip-warn with the exact manual edit.
|
|
343
414
|
|
|
344
415
|
`agent-connector install` turns that into, e.g.:
|
|
345
416
|
|
|
@@ -366,7 +437,7 @@ memory: [
|
|
|
366
437
|
```
|
|
367
438
|
|
|
368
439
|
**Write the guidance once — it lands in the standard
|
|
369
|
-
[AGENTS.md](https://agents.md) on
|
|
440
|
+
[AGENTS.md](https://agents.md) on 29 of the 35 hosts** (the open, Linux
|
|
370
441
|
Foundation-stewarded "README for agents" format): project scope targets
|
|
371
442
|
`<projectDir>/AGENTS.md` — and where a host resolves its rules file
|
|
372
443
|
exclusively, the target is *probed* so the block lands in the file the host
|
|
@@ -395,6 +466,99 @@ Uninstall excises exactly your blocks and `doctor` verifies them (present /
|
|
|
395
466
|
hash-intact / user-edited / file missing). Hosts with no writable memory file at
|
|
396
467
|
a scope skip-warn, never silently.
|
|
397
468
|
|
|
469
|
+
### Status line (`statusline`) — live HUD per connector
|
|
470
|
+
|
|
471
|
+
Ship a render function that the host calls on every status refresh:
|
|
472
|
+
|
|
473
|
+
```ts
|
|
474
|
+
import { defineConnector, defineStatusline } from "@ken-jo/agent-connector";
|
|
475
|
+
|
|
476
|
+
export default defineConnector({
|
|
477
|
+
id: "acme-db",
|
|
478
|
+
// ...
|
|
479
|
+
statusline: defineStatusline({
|
|
480
|
+
render(ctx) {
|
|
481
|
+
const model = ctx.model?.displayName ?? ctx.model?.id ?? "unknown";
|
|
482
|
+
return `acme-db · ${model} · $${(ctx.cost?.totalUsd ?? 0).toFixed(4)}`;
|
|
483
|
+
},
|
|
484
|
+
}),
|
|
485
|
+
});
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
`StatuslineContext` provides (where the host supplies them) `host`,
|
|
489
|
+
`connectorId`, `sessionId`, `cwd`, `model` (`id` / `displayName`),
|
|
490
|
+
`cost` (`totalUsd`), `context` (`usedTokens` / `maxTokens` / `percent`),
|
|
491
|
+
`transcriptPath`, and `raw` (the host's verbatim payload). Fields the host
|
|
492
|
+
does not provide are `undefined`.
|
|
493
|
+
|
|
494
|
+
> **`ctx.context` is reserved** — `context.usedTokens` / `maxTokens` / `percent`
|
|
495
|
+
> are declared in `StatuslineContext` for a future AC-usage integration but are
|
|
496
|
+
> **not populated by any v1 code path**. Rendering `ctx.context?.percent ?? 0`
|
|
497
|
+
> always produces `0%`. Use `ctx.cost?.totalUsd` and `ctx.model?.displayName`
|
|
498
|
+
> (both populated by claude-code) instead.
|
|
499
|
+
|
|
500
|
+
**v1: claude-code only.** Install registers `settings.json.statusLine` via the
|
|
501
|
+
same configPatch ownership ledger — **set-if-absent, never clobbers a
|
|
502
|
+
`statusLine` agent-connector doesn't own** (skip-warns and prints the manual
|
|
503
|
+
edit instead), refcounted, reversible. Every other host adapter skip-warns at
|
|
504
|
+
install time, never silently. The runtime is **fail-safe**: any error — a
|
|
505
|
+
throwing `render`, unknown connector, malformed stdin — exits 0 with empty
|
|
506
|
+
stdout so a HUD never wedges the host. `doctor` includes a dedicated
|
|
507
|
+
`statusline wired` check.
|
|
508
|
+
|
|
509
|
+
> `defineStatusline` is a typed identity helper and is optional — you can
|
|
510
|
+
> pass the `{ render }` object directly to `statusline:`. Both
|
|
511
|
+
> `StatuslineDef` and `StatuslineContext` are exported from
|
|
512
|
+
> `@ken-jo/agent-connector`.
|
|
513
|
+
|
|
514
|
+
### Actions (`defineAction`) — user-triggered dispatch
|
|
515
|
+
|
|
516
|
+
Declare named, user-invocable operations on your connector:
|
|
517
|
+
|
|
518
|
+
```ts
|
|
519
|
+
import { defineConnector, defineAction } from "@ken-jo/agent-connector";
|
|
520
|
+
|
|
521
|
+
export default defineConnector({
|
|
522
|
+
id: "acme-db",
|
|
523
|
+
// ...
|
|
524
|
+
actions: [
|
|
525
|
+
defineAction({
|
|
526
|
+
id: "flush-cache",
|
|
527
|
+
description: "Flush the acme-db query cache",
|
|
528
|
+
async run(ctx) {
|
|
529
|
+
// ctx is HostCtx — same context object as hooks
|
|
530
|
+
await flushCache();
|
|
531
|
+
return { message: "Cache flushed." };
|
|
532
|
+
},
|
|
533
|
+
}),
|
|
534
|
+
],
|
|
535
|
+
});
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
The **universal verb** runs any declared action from the shell (or from a
|
|
539
|
+
script / IDE task):
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
agent-connector action <platform> flush-cache --connector acme-db
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
`run(ctx)` executes and its optional `{ message }` return is printed to
|
|
546
|
+
stdout. **Error semantics are user-triggered**: an unknown action id or a
|
|
547
|
+
throw exits 1 and writes to stderr (unlike hooks and statusline, which are
|
|
548
|
+
fail-safe/silent on error).
|
|
549
|
+
|
|
550
|
+
`defineAction` is a typed identity helper and is exported from both
|
|
551
|
+
`@ken-jo/agent-connector` and `@ken-jo/agent-connector/sdk`.
|
|
552
|
+
`ActionDef = { id, description?, run, hosts? }` and `ActionResult = { message? }`.
|
|
553
|
+
|
|
554
|
+
**v1: dispatch backbone only.** `install` skip-warns on every host — there
|
|
555
|
+
is no host affordance emitter yet (binding a slash-command or keybinding to
|
|
556
|
+
the verb requires generated IDE extensions, a later phase). The `action`
|
|
557
|
+
verb is fully functional today; host-side registration is deferred.
|
|
558
|
+
`explain()` emits action rows (skip-warn everywhere in v1); `simulate()`
|
|
559
|
+
does not cover actions (actions take no host payload and have no host-honor
|
|
560
|
+
verdict — intentional).
|
|
561
|
+
|
|
398
562
|
## How it works (operating model)
|
|
399
563
|
|
|
400
564
|
- **Home-dir, single binary.** The runtime installs once under
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
fail
|
|
4
|
+
} from "./chunk-O5TWCIJN.js";
|
|
5
|
+
import {
|
|
6
|
+
runAction
|
|
7
|
+
} from "./chunk-5OWS5CMA.js";
|
|
8
|
+
import "./chunk-OP4KBXUO.js";
|
|
9
|
+
import "./chunk-F5RX62T7.js";
|
|
10
|
+
import "./chunk-EGCBZ2DC.js";
|
|
11
|
+
import "./chunk-2AVLX7GH.js";
|
|
12
|
+
import "./chunk-BCHWFTV4.js";
|
|
13
|
+
import "./chunk-KHO5WNTP.js";
|
|
14
|
+
import "./chunk-24IDL5RW.js";
|
|
15
|
+
import "./chunk-4ENJK5S2.js";
|
|
16
|
+
import "./chunk-DCKFYWGM.js";
|
|
17
|
+
import "./chunk-FAHIMJRU.js";
|
|
18
|
+
import "./chunk-I5MLE6S7.js";
|
|
19
|
+
import "./chunk-N6HH7K6P.js";
|
|
20
|
+
import "./chunk-TRQKHP7D.js";
|
|
21
|
+
|
|
22
|
+
// src/cli/commands/action.ts
|
|
23
|
+
import { parseArgs } from "util";
|
|
24
|
+
async function run(argv) {
|
|
25
|
+
const { values, positionals } = parseArgs({
|
|
26
|
+
args: argv,
|
|
27
|
+
options: {
|
|
28
|
+
connector: { type: "string" }
|
|
29
|
+
},
|
|
30
|
+
allowPositionals: true
|
|
31
|
+
});
|
|
32
|
+
const platformId = positionals[0];
|
|
33
|
+
const actionId = positionals[1];
|
|
34
|
+
if (!platformId || !actionId) {
|
|
35
|
+
return fail("usage: agent-connector action <platform> <actionId> --connector <id>");
|
|
36
|
+
}
|
|
37
|
+
const connectorId = values.connector;
|
|
38
|
+
if (!connectorId || connectorId.trim() === "") {
|
|
39
|
+
return fail("action requires --connector <id>");
|
|
40
|
+
}
|
|
41
|
+
const reply = await runAction({ platformId, actionId, connectorId });
|
|
42
|
+
if (reply.stdout !== void 0 && reply.stdout !== "") {
|
|
43
|
+
process.stdout.write(reply.stdout.endsWith("\n") ? reply.stdout : `${reply.stdout}
|
|
44
|
+
`);
|
|
45
|
+
}
|
|
46
|
+
if (reply.stderr !== void 0 && reply.stderr !== "") {
|
|
47
|
+
process.stderr.write(reply.stderr.endsWith("\n") ? reply.stderr : `${reply.stderr}
|
|
48
|
+
`);
|
|
49
|
+
}
|
|
50
|
+
process.exit(reply.exitCode);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
run
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=action-WT7GVRCC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/action.ts"],"sourcesContent":["/**\n * cli/commands/action — the universal user-invokable action entrypoint.\n *\n * agent-connector action <platform> <actionId> --connector <id>\n *\n * A future host affordance (slash command / keybinding) points at the single\n * stable home binary (via core/spawn.buildHomeBinActionCommand). This command\n * parses the positionals + --connector, dispatches through runAction, writes any\n * stdout/stderr the action produced, and exits with its code. It reads NO stdin\n * (an action takes no host payload, unlike a hook or status line).\n *\n * USER-TRIGGERED is the runtime's contract: unlike the fail-open hook command,\n * an unknown action id or a throwing run surfaces as exit 1 + a stderr message —\n * the user invoked it deliberately, so the failure is shown, never swallowed.\n */\n\nimport { parseArgs } from \"node:util\";\n\nimport { runAction } from \"../../runtime/index.js\";\nimport { fail } from \"../app.js\";\n\nexport async function run(argv: string[]): Promise<number> {\n const { values, positionals } = parseArgs({\n args: argv,\n options: {\n connector: { type: \"string\" },\n },\n allowPositionals: true,\n });\n\n const platformId = positionals[0];\n const actionId = positionals[1];\n if (!platformId || !actionId) {\n return fail(\"usage: agent-connector action <platform> <actionId> --connector <id>\");\n }\n const connectorId = values.connector;\n if (!connectorId || connectorId.trim() === \"\") {\n return fail(\"action requires --connector <id>\");\n }\n\n const reply = await runAction({ platformId, actionId, connectorId });\n if (reply.stdout !== undefined && reply.stdout !== \"\") {\n process.stdout.write(reply.stdout.endsWith(\"\\n\") ? reply.stdout : `${reply.stdout}\\n`);\n }\n if (reply.stderr !== undefined && reply.stderr !== \"\") {\n process.stderr.write(reply.stderr.endsWith(\"\\n\") ? reply.stderr : `${reply.stderr}\\n`);\n }\n process.exit(reply.exitCode);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB;AAK1B,eAAsB,IAAI,MAAiC;AACzD,QAAM,EAAE,QAAQ,YAAY,IAAI,UAAU;AAAA,IACxC,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,EAAE,MAAM,SAAS;AAAA,IAC9B;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AAED,QAAM,aAAa,YAAY,CAAC;AAChC,QAAM,WAAW,YAAY,CAAC;AAC9B,MAAI,CAAC,cAAc,CAAC,UAAU;AAC5B,WAAO,KAAK,sEAAsE;AAAA,EACpF;AACA,QAAM,cAAc,OAAO;AAC3B,MAAI,CAAC,eAAe,YAAY,KAAK,MAAM,IAAI;AAC7C,WAAO,KAAK,kCAAkC;AAAA,EAChD;AAEA,QAAM,QAAQ,MAAM,UAAU,EAAE,YAAY,UAAU,YAAY,CAAC;AACnE,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,MAAI,MAAM,WAAW,UAAa,MAAM,WAAW,IAAI;AACrD,YAAQ,OAAO,MAAM,MAAM,OAAO,SAAS,IAAI,IAAI,MAAM,SAAS,GAAG,MAAM,MAAM;AAAA,CAAI;AAAA,EACvF;AACA,UAAQ,KAAK,MAAM,QAAQ;AAC7B;","names":[]}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveEnvRefsDeep
|
|
4
|
+
} from "./chunk-DBQMX75U.js";
|
|
5
|
+
import {
|
|
6
|
+
BaseAdapter
|
|
7
|
+
} from "./chunk-CPLK7GTE.js";
|
|
8
|
+
import "./chunk-7L6ITC4T.js";
|
|
9
|
+
import {
|
|
10
|
+
buildServeWrapperCommand,
|
|
11
|
+
shouldWrapForTelemetry
|
|
12
|
+
} from "./chunk-I5MLE6S7.js";
|
|
13
|
+
import "./chunk-N6HH7K6P.js";
|
|
14
|
+
import "./chunk-TRQKHP7D.js";
|
|
15
|
+
|
|
16
|
+
// src/adapters/amazon-q/index.ts
|
|
17
|
+
import { existsSync, statSync } from "fs";
|
|
18
|
+
import { homedir } from "os";
|
|
19
|
+
import { join } from "path";
|
|
20
|
+
var HOST = "amazon-q";
|
|
21
|
+
var MCP_ROOT_KEY = "mcpServers";
|
|
22
|
+
var AmazonQAdapter = class extends BaseAdapter {
|
|
23
|
+
id = HOST;
|
|
24
|
+
name = "Amazon Q Developer CLI";
|
|
25
|
+
paradigm = "mcp-only";
|
|
26
|
+
capabilities = {
|
|
27
|
+
// Memory surface: WIRED. Amazon Q reads `.amazonq/rules` (NOT AGENTS.md), so
|
|
28
|
+
// the AGENTS.md-first BaseAdapter default does not apply — memoryTargets()
|
|
29
|
+
// below overrides it to write a DEDICATED agent-connector-owned file
|
|
30
|
+
// (<projectDir>/.amazonq/rules/agent-connector.md, plain Markdown, no
|
|
31
|
+
// frontmatter — auto-applied as context per the AWS docs). Project scope
|
|
32
|
+
// only; user scope skip-warns (no verified user/global rules dir).
|
|
33
|
+
supportsMemory: true,
|
|
34
|
+
//
|
|
35
|
+
// Amazon Q CLI: the hooks layer lives inside per-agent JSON files, not in
|
|
36
|
+
// the global/workspace mcp.json that AC targets. Every hook flag is false
|
|
37
|
+
// for this mcp-only adapter (hooks not wired into AC install yet).
|
|
38
|
+
preToolUse: false,
|
|
39
|
+
postToolUse: false,
|
|
40
|
+
preCompact: false,
|
|
41
|
+
sessionStart: false,
|
|
42
|
+
sessionEnd: false,
|
|
43
|
+
userPromptSubmit: false,
|
|
44
|
+
stop: false,
|
|
45
|
+
notification: false,
|
|
46
|
+
// No hook layer wired → no arg/output rewrite, no context injection.
|
|
47
|
+
canModifyArgs: false,
|
|
48
|
+
canModifyOutput: false,
|
|
49
|
+
canInjectSessionContext: false,
|
|
50
|
+
// Amazon Q registers stdio + Streamable HTTP MCP servers (primary-verified).
|
|
51
|
+
transports: ["stdio", "http"]
|
|
52
|
+
// Content surfaces: Amazon Q DOES have user-authored surfaces — agents
|
|
53
|
+
// (per-agent JSON in ~/.aws/amazonq/cli-agents/*.json or project
|
|
54
|
+
// .amazonq/cli-agents/*.json: name/description/prompt/tools/hooks/resources;
|
|
55
|
+
// agent-format.md) and a prompt library (~/.aws/amazonq/prompts/*.md). AC does
|
|
56
|
+
// not render either yet, so the supports* flags stay UNSET (base skip-warns) —
|
|
57
|
+
// a deferred wiring opportunity, NOT an absent surface.
|
|
58
|
+
};
|
|
59
|
+
// ── Detection ────────────────────────────────────────────────────────────
|
|
60
|
+
detectInstalled(projectDir) {
|
|
61
|
+
const userDir = join(homedir(), ".aws", "amazonq");
|
|
62
|
+
const userMcp = join(userDir, "mcp.json");
|
|
63
|
+
const projDir = join(projectDir, ".amazonq");
|
|
64
|
+
const projMcp = join(projDir, "mcp.json");
|
|
65
|
+
const userInstalled = existsSync(userDir) || existsSync(userMcp);
|
|
66
|
+
const projInstalled = existsSync(projDir) || existsSync(projMcp);
|
|
67
|
+
const installed = userInstalled || projInstalled;
|
|
68
|
+
const scope = projInstalled && !userInstalled ? "project" : "user";
|
|
69
|
+
const configPath = scope === "project" ? projMcp : userMcp;
|
|
70
|
+
return {
|
|
71
|
+
id: this.id,
|
|
72
|
+
name: this.name,
|
|
73
|
+
installed,
|
|
74
|
+
paradigm: this.paradigm,
|
|
75
|
+
capabilities: this.capabilities,
|
|
76
|
+
configPath,
|
|
77
|
+
scope,
|
|
78
|
+
reason: installed ? `found Amazon Q config (${scope}) at ${configPath}` : `no Amazon Q mcp.json at ${userDir} or ${projDir}`,
|
|
79
|
+
confidence: installed ? "high" : "low"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// ── Native paths ─────────────────────────────────────────────────────────
|
|
83
|
+
/**
|
|
84
|
+
* Config directory per scope. Amazon Q uses DIFFERENT basenames:
|
|
85
|
+
* user: ~/.aws/amazonq (two segments — NOT a single dotDir)
|
|
86
|
+
* project: <projectDir>/.amazonq
|
|
87
|
+
* This is the ONE deviation from droid/cursor's single-basename getConfigDir.
|
|
88
|
+
*/
|
|
89
|
+
getConfigDir(ctx) {
|
|
90
|
+
return ctx.scope === "project" ? join(ctx.projectDir, ".amazonq") : join(homedir(), ".aws", "amazonq");
|
|
91
|
+
}
|
|
92
|
+
getServerConfigPath(ctx) {
|
|
93
|
+
return join(this.getConfigDir(ctx), "mcp.json");
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Amazon Q has no separate hook file — hook config path aliases the MCP file
|
|
97
|
+
* so the generic doctor/backup helpers behave sensibly (roo-code idiom).
|
|
98
|
+
*/
|
|
99
|
+
getHookConfigPath(ctx) {
|
|
100
|
+
return this.getServerConfigPath(ctx);
|
|
101
|
+
}
|
|
102
|
+
// ── Memory surface: the `.amazonq/rules` content tree ─────────────────────
|
|
103
|
+
// Amazon Q uses `.amazonq/rules` (NOT AGENTS.md) for its OWN project rules, so
|
|
104
|
+
// this override replaces the AGENTS.md base default entirely:
|
|
105
|
+
// project → <projectDir>/.amazonq/rules/agent-connector.md (DEDICATED file
|
|
106
|
+
// AC owns; plain Markdown, auto-applied — no frontmatter needed)
|
|
107
|
+
// user → [] (no verified user/global rules dir → base installMemory
|
|
108
|
+
// skip-warns rather than guessing a path the CLI may not read)
|
|
109
|
+
// When `.amazonq/rules` exists as a single FILE (not a directory) we must NOT
|
|
110
|
+
// create `.amazonq/rules/agent-connector.md` underneath it (that would throw
|
|
111
|
+
// ENOTDIR), so memoryTargets() returns [] and installMemory() emits a precise
|
|
112
|
+
// skip-warn rather than crashing (the cline `.clinerules`-is-a-file precedent).
|
|
113
|
+
memoryTargets(ctx) {
|
|
114
|
+
if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);
|
|
115
|
+
if (ctx.scope === "project") {
|
|
116
|
+
if (this.rulesDirIsFile(ctx.projectDir)) return [];
|
|
117
|
+
return [
|
|
118
|
+
{
|
|
119
|
+
path: join(ctx.projectDir, ".amazonq", "rules", "agent-connector.md"),
|
|
120
|
+
reason: "amazon-q project rules dir (.amazonq/rules; agent-connector-owned file)"
|
|
121
|
+
}
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Override installMemory ONLY to surface a precise warn when `.amazonq/rules`
|
|
128
|
+
* exists as a single FILE at project scope (so memoryTargets() returned []):
|
|
129
|
+
* we never write under it. All other behavior delegates to the base
|
|
130
|
+
* implementation (the cline `.clinerules`-is-a-file precedent).
|
|
131
|
+
*/
|
|
132
|
+
installMemory(ctx) {
|
|
133
|
+
if (ctx.scope === "project" && !this.memoryOverride(ctx)?.path && (ctx.connector.memory ?? []).length > 0 && ctx.connector.platforms[this.id]?.memory !== false && this.rulesDirIsFile(ctx.projectDir)) {
|
|
134
|
+
return [
|
|
135
|
+
{
|
|
136
|
+
platform: this.id,
|
|
137
|
+
action: "warn",
|
|
138
|
+
path: join(ctx.projectDir, ".amazonq", "rules"),
|
|
139
|
+
detail: "existing .amazonq/rules is a file, not a directory; left untouched \u2014 convert it to a .amazonq/rules/ directory to receive agent-connector memory"
|
|
140
|
+
}
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
return super.installMemory(ctx);
|
|
144
|
+
}
|
|
145
|
+
/** True when `<dir>/.amazonq/rules` exists and is a regular FILE (not a dir). */
|
|
146
|
+
rulesDirIsFile(dir) {
|
|
147
|
+
const p = join(dir, ".amazonq", "rules");
|
|
148
|
+
if (!existsSync(p)) return false;
|
|
149
|
+
try {
|
|
150
|
+
return statSync(p).isFile();
|
|
151
|
+
} catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// ── MCP server install / uninstall ───────────────────────────────────────
|
|
156
|
+
installServer(ctx) {
|
|
157
|
+
const { connector } = ctx;
|
|
158
|
+
const override = connector.platforms[HOST]?.server;
|
|
159
|
+
if (!connector.server || override === false) {
|
|
160
|
+
return [
|
|
161
|
+
{
|
|
162
|
+
platform: this.id,
|
|
163
|
+
action: "skip",
|
|
164
|
+
detail: connector.server ? "server registration disabled for amazon-q" : "connector declares no MCP server"
|
|
165
|
+
}
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
|
|
169
|
+
const serverPath = this.getServerConfigPath(ctx);
|
|
170
|
+
const entry = this.renderServerEntry(ctx, server);
|
|
171
|
+
return [
|
|
172
|
+
this.upsertServerInJson(serverPath, MCP_ROOT_KEY, connector.id, entry, ctx.dryRun)
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
uninstallServer(ctx) {
|
|
176
|
+
const serverPath = this.getServerConfigPath(ctx);
|
|
177
|
+
return [
|
|
178
|
+
this.removeServerFromJson(serverPath, MCP_ROOT_KEY, ctx.connector.id, ctx.dryRun)
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
/** Render a normalized ServerDef into Amazon Q's native mcpServers entry. */
|
|
182
|
+
renderServerEntry(ctx, server) {
|
|
183
|
+
const transport = server.transport;
|
|
184
|
+
if (transport === "stdio") {
|
|
185
|
+
let command = server.command ?? "";
|
|
186
|
+
let args = [...server.args ?? []];
|
|
187
|
+
if (shouldWrapForTelemetry(server, ctx.connector.telemetry)) {
|
|
188
|
+
const wrapped = buildServeWrapperCommand(
|
|
189
|
+
ctx.homeBinPath,
|
|
190
|
+
ctx.connector.id,
|
|
191
|
+
command,
|
|
192
|
+
args,
|
|
193
|
+
ctx.scope,
|
|
194
|
+
this.id
|
|
195
|
+
);
|
|
196
|
+
command = wrapped.command;
|
|
197
|
+
args = wrapped.args;
|
|
198
|
+
}
|
|
199
|
+
const entry = {
|
|
200
|
+
command: resolveEnvRefsDeep(command)
|
|
201
|
+
};
|
|
202
|
+
if (args.length > 0) entry.args = resolveEnvRefsDeep(args);
|
|
203
|
+
const env = this.renderEnv(server.env);
|
|
204
|
+
if (env) entry.env = env;
|
|
205
|
+
if (server.timeoutMs !== void 0) entry.timeout = server.timeoutMs;
|
|
206
|
+
return entry;
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
type: "http",
|
|
210
|
+
url: resolveEnvRefsDeep(server.url ?? "")
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Render stdio env values. Amazon Q has no documented native interpolation
|
|
215
|
+
* token, so resolve `${env:VAR}` references to literals at install time.
|
|
216
|
+
*/
|
|
217
|
+
renderEnv(env) {
|
|
218
|
+
if (!env || Object.keys(env).length === 0) return void 0;
|
|
219
|
+
return resolveEnvRefsDeep({ ...env });
|
|
220
|
+
}
|
|
221
|
+
// ── Hooks (unavailable — Amazon Q CLI is mcp-only in this adapter) ────────
|
|
222
|
+
installHooks(_ctx) {
|
|
223
|
+
return [
|
|
224
|
+
{
|
|
225
|
+
platform: this.id,
|
|
226
|
+
action: "skip",
|
|
227
|
+
detail: "hooks unavailable (Amazon Q CLI is mcp-only)"
|
|
228
|
+
}
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
uninstallHooks(_ctx) {
|
|
232
|
+
return [
|
|
233
|
+
{
|
|
234
|
+
platform: this.id,
|
|
235
|
+
action: "skip",
|
|
236
|
+
detail: "hooks unavailable (Amazon Q CLI is mcp-only)"
|
|
237
|
+
}
|
|
238
|
+
];
|
|
239
|
+
}
|
|
240
|
+
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
241
|
+
getHealthChecks(ctx) {
|
|
242
|
+
const mcpPath = this.getServerConfigPath(ctx);
|
|
243
|
+
const connectorId = ctx.connector.id;
|
|
244
|
+
return [
|
|
245
|
+
{
|
|
246
|
+
name: `${this.name}: mcp.json present`,
|
|
247
|
+
check: () => existsSync(mcpPath) ? { status: "OK", detail: mcpPath } : { status: "FAIL", detail: `not found: ${mcpPath}` }
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: `${this.name}: server entry registered`,
|
|
251
|
+
check: () => {
|
|
252
|
+
if (!ctx.connector.server) {
|
|
253
|
+
return { status: "OK", detail: "no MCP server declared" };
|
|
254
|
+
}
|
|
255
|
+
const cfg = this.readJson(mcpPath);
|
|
256
|
+
const bucket = cfg?.[MCP_ROOT_KEY];
|
|
257
|
+
if (!cfg || !bucket) {
|
|
258
|
+
return { status: "FAIL", detail: `no ${MCP_ROOT_KEY} in ${mcpPath}` };
|
|
259
|
+
}
|
|
260
|
+
return connectorId in bucket ? { status: "OK", detail: `${MCP_ROOT_KEY}.${connectorId} present` } : {
|
|
261
|
+
status: "FAIL",
|
|
262
|
+
detail: `no ${MCP_ROOT_KEY}.${connectorId} in ${mcpPath}`
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
var adapter = new AmazonQAdapter();
|
|
270
|
+
var amazon_q_default = adapter;
|
|
271
|
+
export {
|
|
272
|
+
AmazonQAdapter,
|
|
273
|
+
adapter,
|
|
274
|
+
amazon_q_default as default
|
|
275
|
+
};
|
|
276
|
+
//# sourceMappingURL=amazon-q-COAL3764.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/amazon-q/index.ts"],"sourcesContent":["/**\n * adapters/amazon-q — Amazon Q Developer CLI platform adapter.\n *\n * Amazon Q Developer CLI (`q` / `qchat`) is an **mcp-only** host from\n * agent-connector's perspective. Although the agent JSON format exposes a\n * real hooks layer (agentSpawn / userPromptSubmit / preToolUse / postToolUse,\n * JSON-over-STDIN, exit-code 0/2 contract — primary-verified via\n * aws.github.io/amazon-q-developer-cli agent-format + hooks.md), the VERIFIED\n * CONTRACT classifies this adapter as mcp-only because the hook layer lives\n * inside per-agent JSON files (cli-agents/*.json), not in the global/workspace\n * mcp.json that AC targets for MCP registration. We install MCP entries only;\n * hook registration into agent files is a separate, unimplemented surface.\n *\n * MCP config (legacy files, primary-verified via AWS docs):\n * - user scope → ~/.aws/amazonq/mcp.json (global; applies to all workspaces)\n * - project scope → <projectDir>/.amazonq/mcp.json (local workspace)\n * Both are JSON, root key \"mcpServers\". Amazon Q reads BOTH when both exist\n * and merges them (union); workspace wins on same-name conflict with a warning.\n *\n * Server entry shape (primary-verified):\n * - stdio: { command: string; args?: string[]; env?: { [k: string]: string };\n * timeout?: number } (timeout in MILLISECONDS, e.g. 60000;\n * transport inferred from presence of `command` — no `type` key)\n * - http: { type: \"http\"; url: string }\n * (the remote/HTTP shape is written with an explicit `type: \"http\"`\n * discriminator + `url`, per command-line-mcp-config-CLI.html. No\n * `headers` field — Amazon Q remote auth is OAuth, not static\n * headers — and no `disabled` flag.)\n *\n * Path resolution — NOTE the nested user scope:\n * - user: join(homedir(), \".aws\", \"amazonq\") (two path segments)\n * - project: join(projectDir, \".amazonq\") (single dotDir, no .aws)\n * homedir() handles USERPROFILE on Windows automatically; no manual branch.\n *\n * Env interpolation: Amazon Q has no documented native ${env:VAR} token;\n * resolve all references to literals at install time (the safe path, same as\n * droid/crush).\n *\n * Memory / rules (primary-verified — docs.aws.amazon.com context-project-rules):\n * Project rules are plain Markdown files in <projectDir>/.amazonq/rules; Amazon\n * Q \"will automatically use them as context whenever a developer chats with\n * Amazon Q within your project\". NO frontmatter required. We write a DEDICATED\n * agent-connector-owned file there (`.amazonq/rules/agent-connector.md`),\n * mirroring the cline `.clinerules/agent-connector.md` approach: memoryTargets()\n * points at the dedicated file and the base managed-block engine performs the\n * surgical, hash-stamped, uninstall-reversible write. PROJECT SCOPE ONLY — the\n * AWS docs do not cleanly document a user/global rules directory for the CLI\n * (a `~/.aws/amazonq/.../rules` path is unverified), so user scope returns [] →\n * the base installMemory skip-warns rather than writing into an unread path.\n *\n * Hook \"config path\" is aliased to the MCP file (no separate hook file) so the\n * base doctor/backup helpers behave sensibly.\n */\n\nimport { existsSync, statSync } from \"node:fs\";\nimport { homedir } 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 DetectedPlatform,\n HealthCheck,\n HookParadigm,\n PlatformCapabilities,\n PlatformId,\n ServerDef,\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 = \"amazon-q\";\nconst MCP_ROOT_KEY = \"mcpServers\";\n\n/**\n * Native MCP server entry shapes Amazon Q accepts under `mcpServers`.\n * - stdio: BARE shape — NO `type` discriminator and NO `disabled` flag; the\n * transport is inferred from the presence of `command`. timeout is in\n * MILLISECONDS (pass timeoutMs through unchanged, do NOT divide).\n * - http: REMOTE shape — explicit `type: \"http\"` + `url`\n * (command-line-mcp-config-CLI.html). NO `headers` (remote auth is OAuth,\n * not static headers) and NO `disabled` flag.\n */\ninterface AmazonQStdioServer {\n command: string;\n args?: string[];\n env?: Record<string, string>;\n timeout?: number;\n}\ninterface AmazonQHttpServer {\n type: \"http\";\n url: string;\n}\n\nexport class AmazonQAdapter extends BaseAdapter implements Adapter {\n readonly id: PlatformId = HOST;\n readonly name = \"Amazon Q Developer CLI\";\n readonly paradigm: HookParadigm = \"mcp-only\";\n\n readonly capabilities: PlatformCapabilities = {\n // Memory surface: WIRED. Amazon Q reads `.amazonq/rules` (NOT AGENTS.md), so\n // the AGENTS.md-first BaseAdapter default does not apply — memoryTargets()\n // below overrides it to write a DEDICATED agent-connector-owned file\n // (<projectDir>/.amazonq/rules/agent-connector.md, plain Markdown, no\n // frontmatter — auto-applied as context per the AWS docs). Project scope\n // only; user scope skip-warns (no verified user/global rules dir).\n supportsMemory: true,\n //\n // Amazon Q CLI: the hooks layer lives inside per-agent JSON files, not in\n // the global/workspace mcp.json that AC targets. Every hook flag is false\n // for this mcp-only adapter (hooks not wired into AC install yet).\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 // No hook layer wired → no arg/output rewrite, no context injection.\n canModifyArgs: false,\n canModifyOutput: false,\n canInjectSessionContext: false,\n // Amazon Q registers stdio + Streamable HTTP MCP servers (primary-verified).\n transports: [\"stdio\", \"http\"],\n // Content surfaces: Amazon Q DOES have user-authored surfaces — agents\n // (per-agent JSON in ~/.aws/amazonq/cli-agents/*.json or project\n // .amazonq/cli-agents/*.json: name/description/prompt/tools/hooks/resources;\n // agent-format.md) and a prompt library (~/.aws/amazonq/prompts/*.md). AC does\n // not render either yet, so the supports* flags stay UNSET (base skip-warns) —\n // a deferred wiring opportunity, NOT an absent surface.\n };\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n detectInstalled(projectDir: string): DetectedPlatform {\n const userDir = join(homedir(), \".aws\", \"amazonq\");\n const userMcp = join(userDir, \"mcp.json\");\n const projDir = join(projectDir, \".amazonq\");\n const projMcp = join(projDir, \"mcp.json\");\n\n const userInstalled = existsSync(userDir) || existsSync(userMcp);\n const projInstalled = existsSync(projDir) || existsSync(projMcp);\n const installed = userInstalled || projInstalled;\n const scope = projInstalled && !userInstalled ? \"project\" : \"user\";\n const configPath = scope === \"project\" ? projMcp : userMcp;\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 Amazon Q config (${scope}) at ${configPath}`\n : `no Amazon Q mcp.json at ${userDir} or ${projDir}`,\n confidence: installed ? \"high\" : \"low\",\n };\n }\n\n // ── Native paths ─────────────────────────────────────────────────────────\n\n /**\n * Config directory per scope. Amazon Q uses DIFFERENT basenames:\n * user: ~/.aws/amazonq (two segments — NOT a single dotDir)\n * project: <projectDir>/.amazonq\n * This is the ONE deviation from droid/cursor's single-basename getConfigDir.\n */\n getConfigDir(ctx: InstallContext): string {\n return ctx.scope === \"project\"\n ? join(ctx.projectDir, \".amazonq\")\n : join(homedir(), \".aws\", \"amazonq\");\n }\n\n getServerConfigPath(ctx: InstallContext): string {\n return join(this.getConfigDir(ctx), \"mcp.json\");\n }\n\n /**\n * Amazon Q has no separate hook file — hook config path aliases the MCP file\n * so the generic doctor/backup helpers behave sensibly (roo-code idiom).\n */\n getHookConfigPath(ctx: InstallContext): string {\n return this.getServerConfigPath(ctx);\n }\n\n // ── Memory surface: the `.amazonq/rules` content tree ─────────────────────\n // Amazon Q uses `.amazonq/rules` (NOT AGENTS.md) for its OWN project rules, so\n // this override replaces the AGENTS.md base default entirely:\n // project → <projectDir>/.amazonq/rules/agent-connector.md (DEDICATED file\n // AC owns; plain Markdown, auto-applied — no frontmatter needed)\n // user → [] (no verified user/global rules dir → base installMemory\n // skip-warns rather than guessing a path the CLI may not read)\n // When `.amazonq/rules` exists as a single FILE (not a directory) we must NOT\n // create `.amazonq/rules/agent-connector.md` underneath it (that would throw\n // ENOTDIR), so memoryTargets() returns [] and installMemory() emits a precise\n // skip-warn rather than crashing (the cline `.clinerules`-is-a-file precedent).\n protected override memoryTargets(ctx: InstallContext): MemoryTarget[] {\n // An explicit platforms[amazon-q].memory.path override wins (escape hatch).\n if (this.memoryOverride(ctx)?.path) return super.memoryTargets(ctx);\n if (ctx.scope === \"project\") {\n if (this.rulesDirIsFile(ctx.projectDir)) return [];\n return [\n {\n path: join(ctx.projectDir, \".amazonq\", \"rules\", \"agent-connector.md\"),\n reason: \"amazon-q project rules dir (.amazonq/rules; agent-connector-owned file)\",\n },\n ];\n }\n // user scope: no primary-verified user/global rules dir → [] → skip-warn.\n return [];\n }\n\n /**\n * Override installMemory ONLY to surface a precise warn when `.amazonq/rules`\n * exists as a single FILE at project scope (so memoryTargets() returned []):\n * we never write under it. All other behavior delegates to the base\n * implementation (the cline `.clinerules`-is-a-file precedent).\n */\n override installMemory(ctx: InstallContext): ChangeRecord[] {\n if (\n ctx.scope === \"project\" &&\n !this.memoryOverride(ctx)?.path &&\n (ctx.connector.memory ?? []).length > 0 &&\n ctx.connector.platforms[this.id]?.memory !== false &&\n this.rulesDirIsFile(ctx.projectDir)\n ) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: join(ctx.projectDir, \".amazonq\", \"rules\"),\n detail:\n \"existing .amazonq/rules is a file, not a directory; left untouched — \" +\n \"convert it to a .amazonq/rules/ directory to receive agent-connector memory\",\n },\n ];\n }\n return super.installMemory(ctx);\n }\n\n /** True when `<dir>/.amazonq/rules` exists and is a regular FILE (not a dir). */\n private rulesDirIsFile(dir: string): boolean {\n const p = join(dir, \".amazonq\", \"rules\");\n if (!existsSync(p)) return false;\n try {\n return statSync(p).isFile();\n } catch {\n return false;\n }\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 amazon-q\"\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 Amazon Q's native mcpServers entry. */\n private renderServerEntry(\n ctx: InstallContext,\n server: ServerDef,\n ): AmazonQStdioServer | AmazonQHttpServer {\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 // Amazon Q has no documented native interpolation token — resolve every\n // ${env:VAR} to a literal at install time (safe path, matches droid/crush).\n const entry: AmazonQStdioServer = {\n command: resolveEnvRefsDeep(command),\n };\n if (args.length > 0) entry.args = resolveEnvRefsDeep(args);\n const env = this.renderEnv(server.env);\n if (env) entry.env = env;\n // timeout: Amazon Q uses MILLISECONDS — pass timeoutMs through unchanged.\n // Only emit when the connector explicitly sets one (do NOT invent a default).\n if (server.timeoutMs !== undefined) entry.timeout = server.timeoutMs;\n return entry;\n }\n\n // http (and any other remote transport) — Amazon Q registers a remote URL.\n // REMOTE shape: { type: \"http\", url } — explicit `type` discriminator, NO\n // `headers` (OAuth auth, not static headers), NO `disabled`.\n return {\n type: \"http\",\n url: resolveEnvRefsDeep(server.url ?? \"\"),\n };\n }\n\n /**\n * Render stdio env values. Amazon Q has no documented native interpolation\n * token, 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 — Amazon Q CLI is mcp-only in this adapter) ────────\n\n installHooks(_ctx: InstallContext): ChangeRecord[] {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"hooks unavailable (Amazon Q CLI 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 (Amazon Q CLI is mcp-only)\",\n },\n ];\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 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 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}\n\nexport const adapter = new AmazonQAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;AAsDA,SAAS,YAAY,gBAAgB;AACrC,SAAS,eAAe;AACxB,SAAS,YAAY;AAoBrB,IAAM,OAAmB;AACzB,IAAM,eAAe;AAsBd,IAAM,iBAAN,cAA6B,YAA+B;AAAA,EACxD,KAAiB;AAAA,EACjB,OAAO;AAAA,EACP,WAAyB;AAAA,EAEzB,eAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAO5C,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,IAKhB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,MAAM;AAAA,IACN,cAAc;AAAA;AAAA,IAEd,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,yBAAyB;AAAA;AAAA,IAEzB,YAAY,CAAC,SAAS,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO9B;AAAA;AAAA,EAIA,gBAAgB,YAAsC;AACpD,UAAM,UAAU,KAAK,QAAQ,GAAG,QAAQ,SAAS;AACjD,UAAM,UAAU,KAAK,SAAS,UAAU;AACxC,UAAM,UAAU,KAAK,YAAY,UAAU;AAC3C,UAAM,UAAU,KAAK,SAAS,UAAU;AAExC,UAAM,gBAAgB,WAAW,OAAO,KAAK,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