@ken-jo/agent-connector 0.4.91 → 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 +301 -560
- package/dist/{action-L44DXFHT.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-JO6GUTV7.js → antigravity-cli-MDEMPPAH.js} +47 -16
- 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-BLTVZACS.js → chunk-447JWFZO.js} +9 -9
- 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-R6LML2YS.js → chunk-7UT6OB52.js} +2 -2
- package/dist/{chunk-G4CEELKO.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-LAIITCMW.js → chunk-FBCBHEGB.js} +5 -5
- package/dist/{chunk-4NSU3KWX.js → chunk-FJCUKXGX.js} +2 -2
- package/dist/{chunk-ZMLVR4J7.js → chunk-FO5CEXXN.js} +2 -2
- package/dist/{chunk-IXOQDZWC.js → chunk-GZGLCCEE.js} +5 -1
- package/dist/chunk-GZGLCCEE.js.map +1 -0
- package/dist/{chunk-LF76VPGQ.js → chunk-IBLYVAWH.js} +28 -6
- 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-KIRCPLM4.js → chunk-JO2IM2JL.js} +538 -226
- package/dist/chunk-JO2IM2JL.js.map +1 -0
- package/dist/{chunk-NWLRJNXM.js → chunk-JVO6NBTT.js} +3 -3
- package/dist/{chunk-25CPWJA7.js → chunk-KA55FISM.js} +43 -43
- package/dist/{chunk-QARPXSIV.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-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-WS4NAGZT.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-RBEZGXBG.js → codebuddy-G42IKGKB.js} +5 -5
- package/dist/{codebuff-RJIDSEU3.js → codebuff-5RLTLZAU.js} +5 -5
- package/dist/{codex-ZZ434GYR.js → codex-XHAMJILX.js} +11 -5
- package/dist/{codex-ZZ434GYR.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-3S46RUMK.js → detect-Z5BDTY6B.js} +4 -4
- package/dist/{devin-PRJY2TTD.js → devin-Y7PWKVHY.js} +5 -5
- package/dist/{doctor-3CUBPQKU.js → doctor-GAP27PP2.js} +25 -21
- 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-5QD235UB.js → grok-cli-2RFBK6J3.js} +5 -5
- package/dist/{hermes-E47IG63A.js → hermes-NUKFWZI5.js} +6 -6
- package/dist/{hook-P6EKDINW.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-DYOIX8Ov.d.ts → introspect-BkId4LGP.d.ts} +1 -1
- package/dist/{jetbrains-copilot-T2EPKROP.js → jetbrains-copilot-FXZ5AOTS.js} +23 -7
- package/dist/jetbrains-copilot-FXZ5AOTS.js.map +1 -0
- package/dist/{junie-SQ4SDLGK.js → junie-TSXIZSCE.js} +5 -5
- package/dist/{kilo-OU2ZLZKB.js → kilo-JLH3KVZJ.js} +5 -5
- package/dist/{kilo-cli-NMWGYF4F.js → kilo-cli-5W36VJQZ.js} +5 -5
- package/dist/{kimi-Z7L2LEEI.js → kimi-R62W7HKZ.js} +5 -5
- package/dist/{kiro-4IN5IH46.js → kiro-AUJMGIBL.js} +5 -5
- package/dist/{leaderboard-LF5SP6X2.js → leaderboard-YWMOSJBC.js} +5 -5
- package/dist/{mimo-code-G2CBZ4M6.js → mimo-code-PGLFFVER.js} +5 -5
- package/dist/{mistral-vibe-TRQDHAWV.js → mistral-vibe-36CZVQNQ.js} +5 -5
- 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-4PKL56AA.js → open-interpreter-UTBKE2EH.js} +5 -5
- package/dist/openclaw-RYFO5TLY.js +17 -0
- package/dist/{opencode-W2RK4M7G.js → opencode-JX7GBE5Q.js} +5 -5
- package/dist/{openhands-5LNH3BKB.js → openhands-AZW4PXJ3.js} +5 -5
- package/dist/{package-2EAIYSJ4.js → package-2KKUGZFS.js} +12 -12
- package/dist/{pi-BUADR5MJ.js → pi-MRI3EBWU.js} +5 -5
- package/dist/{qwen-code-TUJNHKNI.js → qwen-code-ISR6BEET.js} +6 -6
- 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-K62FW3V7.js → serve-EPRN7F2X.js} +14 -14
- package/dist/{status-E5MCFZM6.js → status-B2PG6YKR.js} +10 -10
- package/dist/{statusline-LIPF2KVP.js → statusline-5ERFMYSM.js} +13 -13
- package/dist/{telemetry-4OC56NTM.js → telemetry-ZMCAWBWB.js} +10 -10
- package/dist/{trae-Z7CQ2A2Q.js → trae-7KDCYIMN.js} +5 -5
- package/dist/{types-C4qMgbJn.d.ts → types-D0RqWxT8.d.ts} +43 -0
- package/dist/{uninstall-2YYKN5DX.js → uninstall-M76BHLTH.js} +35 -25
- package/dist/uninstall-M76BHLTH.js.map +1 -0
- package/dist/{upgrade-55AFPJEF.js → upgrade-JLSCNAQA.js} +23 -17
- package/dist/upgrade-JLSCNAQA.js.map +1 -0
- package/dist/{usage-3PB3WZSL.js → usage-5I72HWCR.js} +2 -2
- package/dist/{usage-event-KD5FW6W4.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-ZF2OQ75O.js → zed-EL3JCZ25.js} +5 -5
- package/package.json +1 -1
- package/dist/antigravity-cli-JO6GUTV7.js.map +0 -1
- package/dist/chunk-4HVQ7IUM.js.map +0 -1
- package/dist/chunk-7HUUINPB.js +0 -201
- package/dist/chunk-7HUUINPB.js.map +0 -1
- package/dist/chunk-IXOQDZWC.js.map +0 -1
- package/dist/chunk-KIRCPLM4.js.map +0 -1
- package/dist/chunk-LF76VPGQ.js.map +0 -1
- package/dist/chunk-QKLJU4JX.js.map +0 -1
- package/dist/doctor-3CUBPQKU.js.map +0 -1
- package/dist/install-7DMK53SB.js +0 -96
- package/dist/install-7DMK53SB.js.map +0 -1
- package/dist/jetbrains-copilot-T2EPKROP.js.map +0 -1
- package/dist/openclaw-BD56E5MV.js +0 -17
- package/dist/uninstall-2YYKN5DX.js.map +0 -1
- package/dist/upgrade-55AFPJEF.js.map +0 -1
- package/dist/vscode-copilot-LU5NC4ZS.js.map +0 -1
- /package/dist/{action-L44DXFHT.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-BLTVZACS.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-R6LML2YS.js.map → chunk-7UT6OB52.js.map} +0 -0
- /package/dist/{chunk-G4CEELKO.js.map → chunk-AY3VFNOH.js.map} +0 -0
- /package/dist/{chunk-LAIITCMW.js.map → chunk-FBCBHEGB.js.map} +0 -0
- /package/dist/{chunk-4NSU3KWX.js.map → chunk-FJCUKXGX.js.map} +0 -0
- /package/dist/{chunk-ZMLVR4J7.js.map → chunk-FO5CEXXN.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-NWLRJNXM.js.map → chunk-JVO6NBTT.js.map} +0 -0
- /package/dist/{chunk-25CPWJA7.js.map → chunk-KA55FISM.js.map} +0 -0
- /package/dist/{chunk-QARPXSIV.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-LN76OGNR.js.map → chunk-Z2MRSS2I.js.map} +0 -0
- /package/dist/{claude-code-WS4NAGZT.js.map → claude-code-7RS4YVGZ.js.map} +0 -0
- /package/dist/{cline-NNMVCECA.js.map → cline-BZQAUYPC.js.map} +0 -0
- /package/dist/{codebuddy-RBEZGXBG.js.map → codebuddy-G42IKGKB.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-3S46RUMK.js.map → detect-Z5BDTY6B.js.map} +0 -0
- /package/dist/{devin-PRJY2TTD.js.map → devin-Y7PWKVHY.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/{grok-cli-5QD235UB.js.map → grok-cli-2RFBK6J3.js.map} +0 -0
- /package/dist/{hermes-E47IG63A.js.map → hermes-NUKFWZI5.js.map} +0 -0
- /package/dist/{hook-P6EKDINW.js.map → hook-XPR3AHDI.js.map} +0 -0
- /package/dist/{junie-SQ4SDLGK.js.map → junie-TSXIZSCE.js.map} +0 -0
- /package/dist/{kilo-OU2ZLZKB.js.map → kilo-JLH3KVZJ.js.map} +0 -0
- /package/dist/{kilo-cli-NMWGYF4F.js.map → kilo-cli-5W36VJQZ.js.map} +0 -0
- /package/dist/{kimi-Z7L2LEEI.js.map → kimi-R62W7HKZ.js.map} +0 -0
- /package/dist/{kiro-4IN5IH46.js.map → kiro-AUJMGIBL.js.map} +0 -0
- /package/dist/{leaderboard-LF5SP6X2.js.map → leaderboard-YWMOSJBC.js.map} +0 -0
- /package/dist/{mimo-code-G2CBZ4M6.js.map → mimo-code-PGLFFVER.js.map} +0 -0
- /package/dist/{mistral-vibe-TRQDHAWV.js.map → mistral-vibe-36CZVQNQ.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/{open-interpreter-4PKL56AA.js.map → open-interpreter-UTBKE2EH.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/{openhands-5LNH3BKB.js.map → openhands-AZW4PXJ3.js.map} +0 -0
- /package/dist/{package-2EAIYSJ4.js.map → package-2KKUGZFS.js.map} +0 -0
- /package/dist/{pi-BUADR5MJ.js.map → pi-MRI3EBWU.js.map} +0 -0
- /package/dist/{qwen-code-TUJNHKNI.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-K62FW3V7.js.map → serve-EPRN7F2X.js.map} +0 -0
- /package/dist/{status-E5MCFZM6.js.map → status-B2PG6YKR.js.map} +0 -0
- /package/dist/{statusline-LIPF2KVP.js.map → statusline-5ERFMYSM.js.map} +0 -0
- /package/dist/{telemetry-4OC56NTM.js.map → telemetry-ZMCAWBWB.js.map} +0 -0
- /package/dist/{trae-Z7CQ2A2Q.js.map → trae-7KDCYIMN.js.map} +0 -0
- /package/dist/{usage-3PB3WZSL.js.map → usage-5I72HWCR.js.map} +0 -0
- /package/dist/{usage-event-KD5FW6W4.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
- /package/dist/{zed-ZF2OQ75O.js.map → zed-EL3JCZ25.js.map} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
fail
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5Z36KVU2.js";
|
|
5
5
|
import {
|
|
6
6
|
runAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-447JWFZO.js";
|
|
8
8
|
import "./chunk-OP4KBXUO.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-Z2MRSS2I.js";
|
|
10
|
+
import "./chunk-FO5CEXXN.js";
|
|
11
|
+
import "./chunk-FBCBHEGB.js";
|
|
12
12
|
import "./chunk-KHO5WNTP.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-IVAWP6HH.js";
|
|
14
|
+
import "./chunk-JVO6NBTT.js";
|
|
15
|
+
import "./chunk-AY3VFNOH.js";
|
|
16
|
+
import "./chunk-KA55FISM.js";
|
|
17
|
+
import "./chunk-NBYKLUF6.js";
|
|
18
|
+
import "./chunk-4NHXLXSD.js";
|
|
19
|
+
import "./chunk-M2H7JURF.js";
|
|
20
|
+
import "./chunk-GZGLCCEE.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/commands/action.ts
|
|
23
23
|
import { parseArgs } from "util";
|
|
@@ -52,4 +52,4 @@ async function run(argv) {
|
|
|
52
52
|
export {
|
|
53
53
|
run
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=action-
|
|
55
|
+
//# sourceMappingURL=action-CVIEPX4U.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-BEFVJ2OE.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WFEHWTLM.js";
|
|
8
8
|
import {
|
|
9
9
|
buildWrappedStdio,
|
|
10
10
|
isHomeBinHookCommand
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-4NHXLXSD.js";
|
|
12
|
+
import "./chunk-M2H7JURF.js";
|
|
13
|
+
import "./chunk-GZGLCCEE.js";
|
|
14
14
|
|
|
15
15
|
// src/adapters/amazon-q/index.ts
|
|
16
16
|
import { existsSync, statSync } from "fs";
|
|
@@ -563,4 +563,4 @@ export {
|
|
|
563
563
|
adapter,
|
|
564
564
|
amazon_q_default as default
|
|
565
565
|
};
|
|
566
|
-
//# sourceMappingURL=amazon-q-
|
|
566
|
+
//# sourceMappingURL=amazon-q-TIT7FIW3.js.map
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
BaseAdapter,
|
|
10
10
|
renderSkillMd
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WFEHWTLM.js";
|
|
12
12
|
import {
|
|
13
13
|
buildWrappedStdio
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-4NHXLXSD.js";
|
|
15
|
+
import "./chunk-M2H7JURF.js";
|
|
16
|
+
import "./chunk-GZGLCCEE.js";
|
|
17
17
|
|
|
18
18
|
// src/adapters/amp/index.ts
|
|
19
19
|
import { existsSync } from "fs";
|
|
@@ -608,4 +608,4 @@ export {
|
|
|
608
608
|
adapter,
|
|
609
609
|
amp_default as default
|
|
610
610
|
};
|
|
611
|
-
//# sourceMappingURL=amp-
|
|
611
|
+
//# sourceMappingURL=amp-NF3OAAUG.js.map
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
AntigravityAdapter,
|
|
4
4
|
adapter,
|
|
5
5
|
antigravity_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DI5S6TXJ.js";
|
|
7
7
|
import "./chunk-H53QZQJI.js";
|
|
8
8
|
import "./chunk-BEFVJ2OE.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-WFEHWTLM.js";
|
|
10
|
+
import "./chunk-4NHXLXSD.js";
|
|
11
|
+
import "./chunk-M2H7JURF.js";
|
|
12
|
+
import "./chunk-GZGLCCEE.js";
|
|
13
13
|
export {
|
|
14
14
|
AntigravityAdapter,
|
|
15
15
|
adapter,
|
|
16
16
|
antigravity_default as default
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=antigravity-
|
|
18
|
+
//# sourceMappingURL=antigravity-7LPK7QOY.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AntigravityAdapter,
|
|
4
4
|
adapter
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DI5S6TXJ.js";
|
|
6
6
|
import {
|
|
7
7
|
addLedgerOwner,
|
|
8
8
|
createLedgerEntry,
|
|
@@ -15,16 +15,16 @@ import {
|
|
|
15
15
|
loadConfigPatchLedger,
|
|
16
16
|
removeLedgerOwner,
|
|
17
17
|
saveConfigPatchLedger
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NBYKLUF6.js";
|
|
19
19
|
import "./chunk-H53QZQJI.js";
|
|
20
20
|
import "./chunk-BEFVJ2OE.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-WFEHWTLM.js";
|
|
22
22
|
import {
|
|
23
23
|
buildHomeBinStatuslineCommand,
|
|
24
24
|
isHomeBinStatuslineCommand
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-4NHXLXSD.js";
|
|
26
|
+
import "./chunk-M2H7JURF.js";
|
|
27
|
+
import "./chunk-GZGLCCEE.js";
|
|
28
28
|
|
|
29
29
|
// src/adapters/antigravity-cli/index.ts
|
|
30
30
|
import { existsSync } from "fs";
|
|
@@ -36,19 +36,50 @@ var AntigravityCliAdapter = class _AntigravityCliAdapter extends AntigravityAdap
|
|
|
36
36
|
id = HOST;
|
|
37
37
|
name = "Antigravity CLI";
|
|
38
38
|
/**
|
|
39
|
-
* Capabilities = the inherited IDE surface
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
39
|
+
* Capabilities = the inherited IDE surface, with the two CLI-specific
|
|
40
|
+
* divergences applied on top:
|
|
41
|
+
*
|
|
42
|
+
* - `supportsStatusline: true` — the `agy` custom status line, live-verified
|
|
43
|
+
* above (the IDE app does NOT advertise statusline; its payload is unverified).
|
|
44
|
+
* - `sessionStart: false` — the `agy` CLI does NOT recognize a SessionStart
|
|
45
|
+
* hook. LIVE-VERIFIED (agy): the binary's recognized hook events are exactly
|
|
46
|
+
* PreToolUse / PostToolUse / PreInvocation / PostInvocation / Stop — the
|
|
47
|
+
* `/hooks` UI lists only those five and writing both SessionStart + PreToolUse
|
|
48
|
+
* into hooks.json loads ONLY PreToolUse. Declaring SessionStart on the IDE
|
|
49
|
+
* `antigravity` adapter is left UNCHANGED (this finding is agy-CLI-specific
|
|
50
|
+
* and was NOT verified for the IDE app). This flag is the source of truth for
|
|
51
|
+
* the docs hooks-matrix + the fleet-wide never-silent-drop contract; the
|
|
52
|
+
* matching install-time warn-skip is driven by {@link supportedHookEvents}.
|
|
53
|
+
*
|
|
54
|
+
* Everything else is spread from the IDE adapter's own capabilities so the two
|
|
55
|
+
* surfaces stay in lock-step (a parent field added later flows in automatically).
|
|
56
|
+
* `super.capabilities` is unusable here: the parent's `capabilities` is an
|
|
57
|
+
* instance FIELD (not on the prototype), so it resolves to undefined in a
|
|
58
|
+
* subclass field initializer — spread the IDE singleton instead.
|
|
47
59
|
*/
|
|
48
60
|
capabilities = {
|
|
49
61
|
...adapter.capabilities,
|
|
50
|
-
supportsStatusline: true
|
|
62
|
+
supportsStatusline: true,
|
|
63
|
+
sessionStart: false
|
|
51
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* The hook events the `agy` CLI actually recognizes. LIVE-VERIFIED: agy's hook
|
|
67
|
+
* event tokens are exactly PreToolUse / PostToolUse / PreInvocation /
|
|
68
|
+
* PostInvocation / Stop — confirmed by the `/hooks` UI listing only those five,
|
|
69
|
+
* by the binary's hook-event tokens, and by agy loading ONLY PreToolUse when
|
|
70
|
+
* both SessionStart + PreToolUse are written into hooks.json. SessionStart is
|
|
71
|
+
* therefore DROPPED: a declared SessionStart hook warn-skips at install rather
|
|
72
|
+
* than writing an inert hooks.json entry that never loads / never fires / never
|
|
73
|
+
* shows in `/hooks`. NOTE: PreInvocation / PostInvocation are agy-only events
|
|
74
|
+
* with no canonical AC analog — left unmapped here (a possible future
|
|
75
|
+
* nativeHooks enhancement, NOT this fix). This narrows the IDE's
|
|
76
|
+
* {@link AntigravityAdapter.supportedHookEvents} (which still includes
|
|
77
|
+
* SessionStart for the IDE app, where this finding was not verified).
|
|
78
|
+
*/
|
|
79
|
+
static CLI_SUPPORTED_EVENTS = /* @__PURE__ */ new Set(["PreToolUse", "PostToolUse", "Stop"]);
|
|
80
|
+
supportedHookEvents() {
|
|
81
|
+
return _AntigravityCliAdapter.CLI_SUPPORTED_EVENTS;
|
|
82
|
+
}
|
|
52
83
|
// ── Detection ────────────────────────────────────────────────────────────
|
|
53
84
|
/**
|
|
54
85
|
* Probe the CLI's runtime markers, DISTINCT from the IDE app even though the
|
|
@@ -433,4 +464,4 @@ export {
|
|
|
433
464
|
adapter2 as adapter,
|
|
434
465
|
antigravity_cli_default as default
|
|
435
466
|
};
|
|
436
|
-
//# sourceMappingURL=antigravity-cli-
|
|
467
|
+
//# sourceMappingURL=antigravity-cli-MDEMPPAH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/antigravity-cli/index.ts"],"sourcesContent":["/**\n * adapters/antigravity-cli — Google Antigravity CLI (`agy`) platform adapter.\n *\n * Antigravity ships in two distinct runtimes that share the Gemini-family\n * `~/.gemini` tree and ALL of the same native formats (the JSON `mcp_config.json`\n * shape, the `hooks.json` lifecycle-hook shape, markdown Workflows, and Agent\n * Skills `SKILL.md`): the IDE/desktop app (the parent `AntigravityAdapter`,\n * id \"antigravity\") and this standalone CLI binary `agy` (id \"antigravity-cli\").\n *\n * This adapter is a thin fork of the IDE adapter. It REUSES every render / hook /\n * parse / surface path from {@link AntigravityAdapter} unchanged — the only\n * differences are identity and detection:\n *\n * - id = \"antigravity-cli\", name = \"Antigravity CLI\". Identity flows into the\n * universal hook command (`<homeBin> hook antigravity-cli <event> …`) and the\n * `hostPlatform` stamp, so a CLI-installed hook dispatches back to THIS\n * adapter at runtime — the reason the parent's install/parse logic was made\n * to read `this.id` rather than a fixed host constant.\n * - Detection probes the `agy` binary at ~/.local/bin/agy and/or the SHARED\n * ~/.gemini/antigravity/ presence (distinct runtime markers from the IDE).\n *\n * CONFIRMED-BY-INSTALL (2026-06-03, docs/research/antigravity-paths-confirmed.md):\n * the `agy` CLI v1.0.0 has NO separate config dir — `~/.gemini/antigravity-cli/`,\n * `~/.config/antigravity*`, and `~/.agy` are ALL ABSENT. `agy` SHARES the IDE's\n * `~/.gemini/antigravity/` tree (mcp_config.json, hooks.json, workflows, skills).\n * So the user-scope config resolution here is IDENTICAL to the IDE adapter (the\n * inherited USER_CONFIG_CANDIDATES) — installing both the IDE and CLI connectors\n * therefore writes the SAME files and is idempotent (observed as skip), which is\n * expected and correct. `agy`'s own extension surface is the `agy plugin` system\n * (install/uninstall/list/enable/disable) — future work would deploy as an agy\n * plugin; for now the MCP/workflows/skills surfaces ride the shared IDE files.\n *\n * LIVE-TEST RESOLUTION (2026-06-04, real `agy` v1.0.5 login + spawn): the prior\n * \"shares the IDE's ~/.gemini/antigravity/ file\" claim was WRONG for the CLI. The\n * standalone `agy` reads user MCP from **~/.gemini/config/mcp_config.json**\n * (root key `mcpServers`; project scope <proj>/.agents/mcp_config.json) — PROVEN:\n * a live `agy -p` session spawned an MCP server placed in `config/` and completed\n * a real initialize+tools/list+tools/call handshake; a negative control in\n * `antigravity/` was ignored. The binary carries \"failed to read mcp_config.json\"\n * + a literal \"/.gemini/config\" path; there is NO `--mcp-config` flag and `agy\n * mcp` is TUI-only. So this adapter now OVERRIDES userConfigCandidates to prefer\n * `~/.gemini/config/mcp_config.json` (canonical) over the inherited IDE\n * `antigravity/` default (kept as a prefer-existing fallback). Telemetry-wrap is\n * compatible: agy spawns command+args verbatim, so the home-bin serve wrapper is\n * spawned as written — i.e. a real agy session now emits a per-MCP telemetry row.\n * (agy also keeps its own home ~/.gemini/antigravity-cli/ for auth/state, but MCP\n * config lives in the shared ~/.gemini/config/.)\n *\n * Project scope is IDENTICAL to the IDE adapter (`<proj>/.agents/…`), as is every\n * hook/command/skill render and the runtime parse/format — all inherited.\n *\n * The user-scope config paths shared with the IDE (hooks.json + the global skills\n * dir) remain MEDIUM-CONFIDENCE / PATH-PROBED in the parent (not present on the\n * observed install) and surfaced by the doctor; user-scope mcp_config + workflows\n * are CONFIRMED at ~/.gemini/antigravity/.\n *\n * STATUSLINE SURFACE (LIVE-VERIFIED 2026-06-21, agy v1.0.10): the `agy` CLI ships\n * a first-party custom status line — `/statusline <command>` configures a shell\n * command that agy execs on each refresh, piping a JSON status payload on stdin.\n * The config is persisted in the GLOBAL `~/.gemini/antigravity-cli/settings.json`\n * under the top-level `statusLine` key, value shape `{ enabled: true, command }`\n * — NOT claude-code's `{ type:\"command\", command }` and NOT qwen-code's nested\n * `ui.statusLine`. This was confirmed by a real headless `agy -p` turn with the\n * statusLine command pointed at a stdin-logging script: the captured payload is\n * { cwd, session_id, conversation_id, transcript_path,\n * model:{ id, display_name },\n * workspace:{ current_dir, project_dir },\n * version,\n * context_window:{ total_input_tokens, total_output_tokens,\n * context_window_size, used_percentage,\n * remaining_percentage,\n * current_usage:{ input_tokens, output_tokens, … } },\n * exceeds_200k_tokens, product, quota, agent_state, vcs, sandbox,\n * plan_tier, email, terminal_width }\n * Only the antigravity-cli FORK wires this (the IDE app's payload is not verified),\n * so the CLI adapter overrides `capabilities` to add `supportsStatusline: true`\n * and the statusline parse/format/install/uninstall here — every other path stays\n * inherited from {@link AntigravityAdapter}.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { AntigravityAdapter, adapter as antigravityIdeAdapter } from \"../antigravity/index.js\";\nimport type { Adapter, HookReply, InstallContext } from \"../spi.js\";\nimport type {\n ChangeRecord,\n DetectedPlatform,\n HealthCheck,\n HookEventName,\n JsonValue,\n PlatformCapabilities,\n PlatformId,\n StatuslineContext,\n} from \"../../core/types.js\";\nimport {\n buildHomeBinStatuslineCommand,\n isHomeBinStatuslineCommand,\n} from \"../../core/spawn.js\";\nimport {\n type ConfigPatchLedgerEntry,\n addLedgerOwner,\n createLedgerEntry,\n describeJsonValue,\n dropLedgerEntry,\n findLedgerEntry,\n hashJsonValue,\n jsonDeepEquals,\n ledgerEntriesOwnedBy,\n loadConfigPatchLedger,\n removeLedgerOwner,\n saveConfigPatchLedger,\n} from \"../../core/config-patch-ledger.js\";\n\nconst HOST: PlatformId = \"antigravity-cli\";\n\n/**\n * settings.json key the statusline surface owns on `agy`. The agy CLI stores its\n * custom status line under the TOP-LEVEL `statusLine` key (a single segment —\n * unlike qwen-code's nested `ui.statusLine`). LIVE-VERIFIED against agy v1.0.10\n * (binary StatusLineConfig JSON tags `statusLine`/`command`/`enabled`; a real turn\n * accepted and fired this shape). We own the `statusLine` leaf via the SAME\n * refcounted ownership ledger as configPatch — never clobbering a `statusLine` a\n * user (or another tool) already set.\n */\nconst STATUSLINE_KEY = \"statusLine\";\n\n/**\n * The `agy` statusLine custom-command stdin payload (the documented status-line\n * input agy pipes on stdin, read once). Every field optional — a refresh only\n * carries what the host knows. LIVE-CAPTURED (agy v1.0.10, 2026-06-21). Unmodeled\n * fields (version, agent_state, vcs, plan_tier, quota, product, email,\n * terminal_width) stay in StatuslineContext.raw.\n *\n * NOTE the divergence from qwen-code: agy's `context_window.current_usage` is an\n * OBJECT (`{ input_tokens, output_tokens, … }`), NOT a number — so used tokens are\n * derived from the top-level `total_input_tokens + total_output_tokens`, and the\n * percent from `used_percentage`.\n */\ninterface AgyStatuslineInput {\n cwd?: string;\n session_id?: string;\n conversation_id?: string;\n transcript_path?: string;\n version?: string;\n model?: { id?: string; display_name?: string };\n workspace?: { current_dir?: string; project_dir?: string };\n context_window?: {\n total_input_tokens?: number;\n total_output_tokens?: number;\n context_window_size?: number;\n used_percentage?: number;\n remaining_percentage?: number;\n current_usage?: {\n input_tokens?: number;\n output_tokens?: number;\n cache_creation_input_tokens?: number;\n cache_read_input_tokens?: number;\n };\n };\n}\n\nexport class AntigravityCliAdapter extends AntigravityAdapter implements Adapter {\n override readonly id: PlatformId = HOST;\n override readonly name = \"Antigravity CLI\";\n\n /**\n * Capabilities = the inherited IDE surface, with the two CLI-specific\n * divergences applied on top:\n *\n * - `supportsStatusline: true` — the `agy` custom status line, live-verified\n * above (the IDE app does NOT advertise statusline; its payload is unverified).\n * - `sessionStart: false` — the `agy` CLI does NOT recognize a SessionStart\n * hook. LIVE-VERIFIED (agy): the binary's recognized hook events are exactly\n * PreToolUse / PostToolUse / PreInvocation / PostInvocation / Stop — the\n * `/hooks` UI lists only those five and writing both SessionStart + PreToolUse\n * into hooks.json loads ONLY PreToolUse. Declaring SessionStart on the IDE\n * `antigravity` adapter is left UNCHANGED (this finding is agy-CLI-specific\n * and was NOT verified for the IDE app). This flag is the source of truth for\n * the docs hooks-matrix + the fleet-wide never-silent-drop contract; the\n * matching install-time warn-skip is driven by {@link supportedHookEvents}.\n *\n * Everything else is spread from the IDE adapter's own capabilities so the two\n * surfaces stay in lock-step (a parent field added later flows in automatically).\n * `super.capabilities` is unusable here: the parent's `capabilities` is an\n * instance FIELD (not on the prototype), so it resolves to undefined in a\n * subclass field initializer — spread the IDE singleton instead.\n */\n override readonly capabilities: PlatformCapabilities = {\n ...antigravityIdeAdapter.capabilities,\n supportsStatusline: true,\n sessionStart: false,\n };\n\n /**\n * The hook events the `agy` CLI actually recognizes. LIVE-VERIFIED: agy's hook\n * event tokens are exactly PreToolUse / PostToolUse / PreInvocation /\n * PostInvocation / Stop — confirmed by the `/hooks` UI listing only those five,\n * by the binary's hook-event tokens, and by agy loading ONLY PreToolUse when\n * both SessionStart + PreToolUse are written into hooks.json. SessionStart is\n * therefore DROPPED: a declared SessionStart hook warn-skips at install rather\n * than writing an inert hooks.json entry that never loads / never fires / never\n * shows in `/hooks`. NOTE: PreInvocation / PostInvocation are agy-only events\n * with no canonical AC analog — left unmapped here (a possible future\n * nativeHooks enhancement, NOT this fix). This narrows the IDE's\n * {@link AntigravityAdapter.supportedHookEvents} (which still includes\n * SessionStart for the IDE app, where this finding was not verified).\n */\n private static readonly CLI_SUPPORTED_EVENTS: ReadonlySet<HookEventName> =\n new Set<HookEventName>([\"PreToolUse\", \"PostToolUse\", \"Stop\"]);\n\n protected override supportedHookEvents(): ReadonlySet<HookEventName> {\n return AntigravityCliAdapter.CLI_SUPPORTED_EVENTS;\n }\n\n // ── Detection ────────────────────────────────────────────────────────────\n\n /**\n * Probe the CLI's runtime markers, DISTINCT from the IDE app even though the\n * two share `~/.gemini/antigravity/`: the `agy` binary at ~/.local/bin/agy\n * (the definitive CLI marker, CONFIRMED present) and the shared\n * ~/.gemini/antigravity/ tree (or a user-scope mcp_config candidate / the\n * project config). Reported before the IDE adapter in the registry so the\n * more-specific CLI marker (the `agy` binary) wins host detection. Note: a\n * machine with ONLY the IDE (no `agy` binary) will not match here, while one\n * with the CLI matches on the binary regardless of the shared config dir.\n */\n override detectInstalled(projectDir: string): DetectedPlatform {\n const home = homedir();\n const userConfig = this.resolveUserConfigPath();\n const agyBin = join(home, \".local\", \"bin\", \"agy\");\n const sharedDir = join(home, \".gemini\", \"antigravity\");\n const projectConfig = join(projectDir, \".agents\", \"mcp_config.json\");\n\n // The `agy` binary is the definitive CLI marker. The shared antigravity dir\n // and the user-scope mcp_config candidates are secondary signals (they also\n // match a pure-IDE install, so the binary is what truly distinguishes the CLI).\n const cliMarker = existsSync(agyBin);\n const userInstalled =\n cliMarker ||\n existsSync(sharedDir) ||\n this.userConfigCandidates().some((parts) => existsSync(join(home, ...parts)));\n const projInstalled = existsSync(projectConfig);\n const installed = userInstalled || projInstalled;\n\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\" ? projectConfig : userConfig;\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 ? scope === \"project\"\n ? `found project Antigravity CLI config at ${projectConfig}`\n : `found Antigravity CLI (agy) at ${agyBin} / shared ${sharedDir}`\n : `no Antigravity CLI install at ${agyBin}, ${sharedDir}, or ${projectConfig}`,\n // The `agy` binary is a high-confidence CLI marker; matching only the shared\n // config dir is weaker (it could be a pure-IDE install).\n confidence: cliMarker ? \"high\" : installed ? \"medium\" : \"low\",\n };\n }\n\n /**\n * MCP user-config path — LIVE-PROVEN for `agy` v1.0.5 (2026-06-04). The\n * standalone CLI reads user MCP servers from `~/.gemini/config/mcp_config.json`\n * (root key `mcpServers`), NOT the IDE's `~/.gemini/antigravity/mcp_config.json`:\n * a real `agy -p` session spawned an MCP server ONLY when it was placed in\n * `config/` (negative control: a server in `antigravity/` was ignored), and the\n * binary carries the error string \"failed to read mcp_config.json\" + a literal\n * \"/.gemini/config\" path. `agy mcp` is TUI-only (no headless add) and there is\n * no `--mcp-config` flag. So the CLI must PREFER `config/` over the inherited\n * `antigravity/` default; the IDE path stays as a prefer-existing fallback.\n * (Skills/workflows/hooks dirs remain inherited; project scope\n * `<proj>/.agents/mcp_config.json` is already correct and live-proven.)\n */\n private static readonly CLI_USER_CONFIG_CANDIDATES = [\n [\".gemini\", \"config\", \"mcp_config.json\"], // CONFIRMED canonical for agy v1.0.5\n [\".gemini\", \"antigravity\", \"mcp_config.json\"], // legacy IDE layout (prefer-existing)\n ] as const;\n\n protected override userConfigCandidates(): ReadonlyArray<readonly string[]> {\n return AntigravityCliAdapter.CLI_USER_CONFIG_CANDIDATES;\n }\n\n // ── Statusline surface (the `agy` custom status line) ─────────────────────\n // Wires settings.json `statusLine` = { enabled:true, command:<home-bin\n // statusline cmd> } through the SAME refcounted ownership ledger as configPatch\n // (the ledger primitives are surface-agnostic). antigravity-cli does NOT\n // advertise supportsConfigPatch, so — like qwen-code — this adapter performs the\n // set-if-absent write directly with the exported ledger primitives. Semantics\n // are identical to claude-code/qwen-code: never clobber a `statusLine`\n // agent-connector does not own (skip-warn), record prior state + owner\n // (refcounted across connectors), reversible by uninstallStatusline\n // (last-owner-verified delete).\n //\n // The home-bin command makes agy exec\n // `<homeBin> statusline antigravity-cli --connector <id>` on every refresh,\n // which re-imports the connector module and renders the line (runtime/\n // statusline-entrypoint). The status line lives in the GLOBAL\n // ~/.gemini/antigravity-cli/settings.json (agy has no project-scope statusLine),\n // so this surface is user-scope regardless of the install scope. No telemetry\n // in v1.\n\n /**\n * The `agy` settings.json that holds the statusLine config. LIVE-VERIFIED at\n * ~/.gemini/antigravity-cli/settings.json (the CLI's own global home — distinct\n * from the shared ~/.gemini/config/mcp_config.json the MCP surface writes). agy\n * stores statusLine as a GLOBAL UI setting with no project-scope variant, so the\n * path is scope-independent.\n */\n private statuslineSettingsPath(): string {\n return join(homedir(), \".gemini\", \"antigravity-cli\", \"settings.json\");\n }\n\n /** The statusLine config value agent-connector writes at `statusLine`. */\n private statuslineValue(ctx: InstallContext): JsonValue {\n const command = buildHomeBinStatuslineCommand(ctx.homeBinPath, HOST, ctx.connector.id);\n return { enabled: true, command };\n }\n\n override installStatusline(ctx: InstallContext): ChangeRecord[] {\n const { connector } = ctx;\n if (connector.statusline == null) {\n return [{ platform: this.id, action: \"skip\", detail: \"connector declares no statusline\" }];\n }\n if (connector.platforms[HOST]?.statusline === false) {\n return [{ platform: this.id, action: \"skip\", detail: `statusline disabled for ${HOST}` }];\n }\n\n const filePath = this.statuslineSettingsPath();\n const symlink = this.symlinkPathWarning(filePath);\n if (symlink) return [symlink];\n\n // OVERWRITE GUARD (upsertServerInJson precedent): never round-trip a\n // present-but-unparseable settings file into `{}`.\n if (this.isPresentButUnparseable(filePath)) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `existing ${filePath} is not parseable; statusline left unapplied (back it up / fix it, then re-run)`,\n },\n ];\n }\n const settings = this.readJson<Record<string, unknown>>(filePath) ?? {};\n if (typeof settings !== \"object\" || Array.isArray(settings)) {\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `existing ${filePath} is not a JSON object; statusline left unapplied`,\n },\n ];\n }\n\n const ledger = loadConfigPatchLedger(ctx.dataRoot);\n const desired = this.statuslineValue(ctx);\n const leaf = settings[STATUSLINE_KEY];\n const entry = findLedgerEntry(ledger, HOST, filePath, STATUSLINE_KEY);\n const changes: ChangeRecord[] = [];\n\n if (leaf === undefined) {\n // SET-IF-ABSENT: the one write path.\n settings[STATUSLINE_KEY] = desired;\n this.writeJson(filePath, settings, ctx.dryRun);\n if (entry) {\n // Stale ledger row (key deleted out from under us): re-assert the value,\n // keep existing owners (they still rely on the key), record what we wrote.\n entry.writtenValue = desired;\n entry.writtenValueHash = hashJsonValue(desired);\n addLedgerOwner(entry, connector.id, connector.version);\n } else {\n createLedgerEntry(ledger, {\n platform: HOST,\n file: filePath,\n key: STATUSLINE_KEY,\n value: desired,\n connectorId: connector.id,\n connectorVersion: connector.version,\n });\n }\n if (!ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n changes.push({\n platform: this.id,\n action: \"create\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY}: <absent> → ${describeJsonValue(desired)}`,\n });\n return changes;\n }\n\n // Key PRESENT — never overwrite; the only question is ownership/refcount.\n const leafValue = leaf as JsonValue;\n if (!entry) {\n // User- (or other-tool-) owned. No ownership is taken even when the values\n // happen to match — uninstall must never delete a key we did not create.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY} skipped: already set to ${describeJsonValue(leafValue)} ` +\n `(not created by agent-connector) — left untouched`,\n },\n ];\n }\n\n if (!jsonDeepEquals(leafValue, entry.writtenValue)) {\n // DRIFT: the user edited the value after we wrote it. Never revert.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY}: value changed since install ` +\n `(current ${describeJsonValue(leafValue)}, wrote ${describeJsonValue(entry.writtenValue)}); ` +\n `leaving in place`,\n },\n ];\n }\n\n if (jsonDeepEquals(desired, leafValue)) {\n // Same value we own: register as co-owner (refcount++) or idempotent skip.\n const owners = entry.owners.map((o) => o.connectorId);\n if (addLedgerOwner(entry, connector.id, connector.version)) {\n if (!ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY} already installed; registered as co-owner (co-owned with ${owners.join(\", \")})`,\n },\n ];\n }\n return [\n {\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${STATUSLINE_KEY} already installed`,\n },\n ];\n }\n\n // FIRST-WRITER-WINS: another connector owns the key with a different value.\n return [\n {\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${STATUSLINE_KEY} skipped: already owned by ${entry.owners\n .map((o) => o.connectorId)\n .join(\", \")} with a different value — left untouched`,\n },\n ];\n }\n\n override uninstallStatusline(ctx: InstallContext): ChangeRecord[] {\n const ledger = loadConfigPatchLedger(ctx.dataRoot);\n // Release ONLY the statusLine ledger row this connector owns (keyed off the\n // ledger, not the declaration, so an id-only synthetic uninstall still reclaims\n // it). Last-owner-verified delete: remove the key ONLY when last-owner ∧\n // value-unchanged ∧ prior-absent (else skip-warn + leave the key).\n const owned = ledgerEntriesOwnedBy(ledger, HOST, ctx.connector.id).filter(\n (e) => e.key === STATUSLINE_KEY,\n );\n if (owned.length === 0) {\n return [\n {\n platform: this.id,\n action: \"skip\",\n detail: \"statusline: no ownership recorded; left untouched\",\n },\n ];\n }\n\n const changes: ChangeRecord[] = [];\n let ledgerMutated = false;\n\n // Group by file (one global settings.json in practice, but stay robust to a\n // scope drift between install and uninstall).\n const byFile = new Map<string, ConfigPatchLedgerEntry[]>();\n for (const entry of owned) {\n const bucket = byFile.get(entry.file) ?? [];\n bucket.push(entry);\n byFile.set(entry.file, bucket);\n }\n\n for (const [filePath, entries] of byFile) {\n const symlink = this.symlinkPathWarning(filePath);\n if (symlink) {\n changes.push(symlink);\n continue;\n }\n\n const unparseable = this.isPresentButUnparseable(filePath);\n const settings = unparseable ? null : this.readJson<Record<string, unknown>>(filePath);\n let fileMutated = false;\n\n for (const entry of entries) {\n const { lastOwner } = removeLedgerOwner(entry, ctx.connector.id);\n ledgerMutated = true;\n\n if (!lastOwner) {\n // Shared-flag case: A uninstalls, B still relies on the key.\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} retained: still owned by ${entry.owners\n .map((o) => o.connectorId)\n .join(\", \")}`,\n });\n continue;\n }\n\n // Last owner out → the ledger row is dropped on every branch below; the\n // KEY is removed only on the fully-verified branch.\n dropLedgerEntry(ledger, entry);\n\n if (unparseable) {\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail: `statusline ${entry.key}: ${filePath} is not parseable; key left in place (ownership released)`,\n });\n continue;\n }\n if (!settings || typeof settings !== \"object\" || Array.isArray(settings)) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} already absent (no settings file); ownership record dropped`,\n });\n continue;\n }\n const leaf = settings[entry.key];\n if (leaf === undefined) {\n changes.push({\n platform: this.id,\n action: \"skip\",\n path: filePath,\n detail: `statusline ${entry.key} already absent; ownership record dropped`,\n });\n continue;\n }\n if (entry.prior?.present !== false || !jsonDeepEquals(leaf as JsonValue, entry.writtenValue)) {\n // User edited the value after install (or the row predates the\n // set-if-absent guarantee): deleting would clobber them. Leave it.\n changes.push({\n platform: this.id,\n action: \"warn\",\n path: filePath,\n detail:\n `statusline ${entry.key}: value changed since install ` +\n `(current ${describeJsonValue(leaf as JsonValue)}, wrote ${describeJsonValue(entry.writtenValue)}); ` +\n `left in place`,\n });\n continue;\n }\n\n // VERIFIED: last owner + current === writtenValue + prior absent.\n delete settings[entry.key];\n fileMutated = true;\n changes.push({\n platform: this.id,\n action: \"remove\",\n path: filePath,\n detail: `statusline ${entry.key} removed (was ${describeJsonValue(entry.writtenValue)})`,\n });\n }\n\n if (fileMutated && settings) this.writeJson(filePath, settings, ctx.dryRun);\n }\n\n if (ledgerMutated && !ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);\n return changes;\n }\n\n /**\n * Parse the `agy` statusLine stdin JSON into the normalized\n * {@link StatuslineContext}. agy pipes a JSON object on stdin\n * (model/context_window/workspace/…); fields the payload omits stay undefined.\n * `raw` keeps the verbatim payload (incl. version/agent_state/vcs/plan_tier/\n * quota/email/terminal_width). agy has no cost analog, so `ctx.cost` is left\n * undefined. LIVE-CAPTURED against agy v1.0.10 (see header / AgyStatuslineInput).\n */\n parseStatusInput(raw: unknown): StatuslineContext {\n const input = (raw ?? {}) as AgyStatuslineInput;\n\n const ctx: StatuslineContext = {\n host: HOST,\n capabilities: this.capabilities,\n raw,\n };\n // Stable session id: prefer conversation_id (the active agent conversation),\n // fall back to session_id (the capture showed them equal).\n const sessionId =\n typeof input.conversation_id === \"string\" && input.conversation_id !== \"\"\n ? input.conversation_id\n : typeof input.session_id === \"string\" && input.session_id !== \"\"\n ? input.session_id\n : undefined;\n if (sessionId !== undefined) ctx.sessionId = sessionId;\n // cwd: prefer the top-level cwd, else the workspace.current_dir.\n const cwd =\n typeof input.cwd === \"string\"\n ? input.cwd\n : typeof input.workspace?.current_dir === \"string\"\n ? input.workspace.current_dir\n : undefined;\n if (cwd !== undefined) ctx.cwd = cwd;\n if (typeof input.transcript_path === \"string\") ctx.transcriptPath = input.transcript_path;\n\n const model: { id?: string; displayName?: string } = {};\n if (typeof input.model?.id === \"string\") model.id = input.model.id;\n if (typeof input.model?.display_name === \"string\") model.displayName = input.model.display_name;\n if (model.id !== undefined || model.displayName !== undefined) ctx.model = model;\n\n const cw = input.context_window;\n if (cw) {\n const context: { usedTokens?: number; maxTokens?: number; percent?: number } = {};\n if (typeof cw.context_window_size === \"number\") context.maxTokens = cw.context_window_size;\n // agy's current_usage is an OBJECT (not a number like qwen) — used tokens are\n // the documented top-level total_input_tokens + total_output_tokens sum.\n if (\n typeof cw.total_input_tokens === \"number\" ||\n typeof cw.total_output_tokens === \"number\"\n ) {\n context.usedTokens = (cw.total_input_tokens ?? 0) + (cw.total_output_tokens ?? 0);\n }\n if (typeof cw.used_percentage === \"number\") context.percent = cw.used_percentage;\n if (\n context.usedTokens !== undefined ||\n context.maxTokens !== undefined ||\n context.percent !== undefined\n ) {\n ctx.context = context;\n }\n }\n // ctx.cost stays undefined: agy's status payload has no cost analog.\n return ctx;\n }\n\n /** Format the rendered status line into agy's native reply: stdout = line, exit 0. */\n formatStatusOutput(rendered: string): HookReply {\n return { exitCode: 0, stdout: rendered };\n }\n\n // ── Diagnostics: add the statusline check on top of the inherited IDE checks ─\n\n override getHealthChecks(ctx: InstallContext): readonly HealthCheck[] {\n const checks = [...super.getHealthChecks(ctx)];\n\n // Statusline check: assert it when the connector declares a statusline AND it\n // is not disabled for this host, OR when the ownership ledger holds a\n // statusLine row this connector owns (the REGISTERED-connector path:\n // connectorFromMeta can't re-expose the render fn, so statusline comes back\n // undefined — but the ledger row proves the surface was wired). Mirrors\n // claude-code/qwen-code's \"statusline wired\" check.\n const settingsPath = this.statuslineSettingsPath();\n const connectorId = ctx.connector.id;\n const homeBin = ctx.homeBinPath;\n const statuslineLedgerOwned = ledgerEntriesOwnedBy(\n loadConfigPatchLedger(ctx.dataRoot),\n HOST,\n connectorId,\n ).some((e) => e.key === STATUSLINE_KEY);\n if (\n (ctx.connector.statusline != null || statuslineLedgerOwned) &&\n ctx.connector.platforms[HOST]?.statusline !== false\n ) {\n checks.push({\n name: `${this.name}: statusline wired`,\n check: () => {\n const settings = this.readJson<{ statusLine?: { command?: unknown } }>(settingsPath);\n const command = settings?.statusLine?.command;\n if (command === undefined) {\n return { status: \"FAIL\", detail: `statusLine not set in ${settingsPath}` };\n }\n if (\n typeof command === \"string\" &&\n isHomeBinStatuslineCommand(command, homeBin, connectorId)\n ) {\n return { status: \"OK\", detail: \"statusLine command present\" };\n }\n // Present but not ours — a non-AC statusLine we must never clobber.\n return {\n status: \"FAIL\",\n detail: `statusLine in ${settingsPath} is not agent-connector's (left untouched)`,\n };\n },\n });\n }\n return checks;\n }\n}\n\nexport const adapter = new AntigravityCliAdapter();\nexport default adapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,YAAY;AAiCrB,IAAM,OAAmB;AAWzB,IAAM,iBAAiB;AAqChB,IAAM,wBAAN,MAAM,+BAA8B,mBAAsC;AAAA,EAC7D,KAAiB;AAAA,EACjB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBP,eAAqC;AAAA,IACrD,GAAG,QAAsB;AAAA,IACzB,oBAAoB;AAAA,IACpB,cAAc;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,OAAwB,uBACtB,oBAAI,IAAmB,CAAC,cAAc,eAAe,MAAM,CAAC;AAAA,EAE3C,sBAAkD;AACnE,WAAO,uBAAsB;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcS,gBAAgB,YAAsC;AAC7D,UAAM,OAAO,QAAQ;AACrB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X,gBAAM,WAAW,KAAK,SAAiD,YAAY;AACnF,gBAAM,UAAU,UAAU,YAAY;AACtC,cAAI,YAAY,QAAW;AACzB,mBAAO,EAAE,QAAQ,QAAQ,QAAQ,yBAAyB,YAAY,GAAG;AAAA,UAC3E;AACA,cACE,OAAO,YAAY,YACnB,2BAA2B,SAAS,SAAS,WAAW,GACxD;AACA,mBAAO,EAAE,QAAQ,MAAM,QAAQ,6BAA6B;AAAA,UAC9D;AAEA,iBAAO;AAAA,YACL,QAAQ;AAAA,YACR,QAAQ,iBAAiB,YAAY;AAAA,UACvC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO;AAAA,EACT;AACF;AAEO,IAAMA,WAAU,IAAI,sBAAsB;AACjD,IAAO,0BAAQA;","names":["adapter"]}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
connectorsDir,
|
|
10
10
|
dataRoot,
|
|
11
11
|
ensureDir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GZGLCCEE.js";
|
|
13
13
|
|
|
14
14
|
// src/core/marketplace-state.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -77,6 +77,9 @@ function claudeStagingRoot() {
|
|
|
77
77
|
function codexStagingRoot() {
|
|
78
78
|
return join(marketplaceRoot(), "codex");
|
|
79
79
|
}
|
|
80
|
+
function copilotStagingRoot() {
|
|
81
|
+
return join(marketplaceRoot(), "copilot");
|
|
82
|
+
}
|
|
80
83
|
function agyStagingRoot() {
|
|
81
84
|
return join(marketplaceRoot(), "agy");
|
|
82
85
|
}
|
|
@@ -178,6 +181,50 @@ function codexMarketplaceSource(name) {
|
|
|
178
181
|
const source = entry.source;
|
|
179
182
|
return typeof source === "string" ? source : null;
|
|
180
183
|
}
|
|
184
|
+
function copilotConfigDir() {
|
|
185
|
+
return join(homedir(), ".copilot");
|
|
186
|
+
}
|
|
187
|
+
function copilotPluginKey(connectorId) {
|
|
188
|
+
return `${connectorId}@${MARKETPLACE_NAME}`;
|
|
189
|
+
}
|
|
190
|
+
function readCopilotInstalledPlugins() {
|
|
191
|
+
let raw;
|
|
192
|
+
try {
|
|
193
|
+
raw = readFileSync(join(copilotConfigDir(), "config.json"), "utf8");
|
|
194
|
+
} catch {
|
|
195
|
+
return [];
|
|
196
|
+
}
|
|
197
|
+
const parsed = parseJsonc(raw);
|
|
198
|
+
const plugins = parsed?.["installedPlugins"];
|
|
199
|
+
if (!Array.isArray(plugins)) return [];
|
|
200
|
+
return plugins.filter(
|
|
201
|
+
(e) => e != null && typeof e === "object" && !Array.isArray(e)
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function copilotPluginInstalled(connectorId) {
|
|
205
|
+
return readCopilotInstalledPlugins().some(
|
|
206
|
+
(e) => e["name"] === connectorId && e["marketplace"] === MARKETPLACE_NAME && e["enabled"] !== false
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
function anyCopilotAgentConnectorPlugins() {
|
|
210
|
+
return readCopilotInstalledPlugins().some(
|
|
211
|
+
(e) => e["marketplace"] === MARKETPLACE_NAME && e["enabled"] !== false
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
function copilotMarketplaceSource(name) {
|
|
215
|
+
const parsed = readJsonFile(join(copilotConfigDir(), "settings.json"));
|
|
216
|
+
const known = parsed?.["extraKnownMarketplaces"];
|
|
217
|
+
if (!known || typeof known !== "object" || Array.isArray(known)) return null;
|
|
218
|
+
const entry = known[name];
|
|
219
|
+
if (entry == null) return null;
|
|
220
|
+
const source = entry.source;
|
|
221
|
+
if (typeof source === "string") return source;
|
|
222
|
+
if (source && typeof source === "object" && !Array.isArray(source)) {
|
|
223
|
+
const path = source.path;
|
|
224
|
+
if (typeof path === "string") return path;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
181
228
|
function factorySettingsPath() {
|
|
182
229
|
return join(homedir(), ".factory", "settings.json");
|
|
183
230
|
}
|
|
@@ -431,6 +478,8 @@ function marketplaceEvidence(connectorId, platform) {
|
|
|
431
478
|
);
|
|
432
479
|
return existsSync(dir) ? `codex plugin cache ${dir} exists` : null;
|
|
433
480
|
}
|
|
481
|
+
case "copilot-cli":
|
|
482
|
+
return copilotPluginInstalled(connectorId) ? `${copilotPluginKey(connectorId)} listed in Copilot's config.json` : null;
|
|
434
483
|
default:
|
|
435
484
|
return null;
|
|
436
485
|
}
|
|
@@ -480,6 +529,7 @@ export {
|
|
|
480
529
|
marketplaceRoot,
|
|
481
530
|
claudeStagingRoot,
|
|
482
531
|
codexStagingRoot,
|
|
532
|
+
copilotStagingRoot,
|
|
483
533
|
agyStagingRoot,
|
|
484
534
|
geminiStagingRoot,
|
|
485
535
|
qwenStagingRoot,
|
|
@@ -493,6 +543,10 @@ export {
|
|
|
493
543
|
codexPluginInstalled,
|
|
494
544
|
anyCodexAgentConnectorPlugins,
|
|
495
545
|
codexMarketplaceSource,
|
|
546
|
+
copilotPluginKey,
|
|
547
|
+
copilotPluginInstalled,
|
|
548
|
+
anyCopilotAgentConnectorPlugins,
|
|
549
|
+
copilotMarketplaceSource,
|
|
496
550
|
droidPluginKey,
|
|
497
551
|
droidPluginInstalled,
|
|
498
552
|
anyDroidAgentConnectorPlugins,
|
|
@@ -507,4 +561,4 @@ export {
|
|
|
507
561
|
marketplaceEvidence,
|
|
508
562
|
hashDirectory
|
|
509
563
|
};
|
|
510
|
-
//# sourceMappingURL=chunk-
|
|
564
|
+
//# sourceMappingURL=chunk-2Y2MZRLP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/marketplace-state.ts"],"sourcesContent":["/**\n * core/marketplace-state — pure read/write helpers for MARKETPLACE-method\n * install state. A LEAF module (fs + paths only, no adapters, no spawning) so\n * the installer, the marketplace orchestration, doctor, and status can all\n * import it without cycles.\n *\n * Two kinds of state live here:\n *\n * 1. The per-connector state record `connectorDir(id)/marketplace-installs.json`\n * — one entry per platform a connector was marketplace-installed on\n * ({ format, bundleDir, marketplace, scope, version, contentHash,\n * installedAt }). It drives `uninstall --method auto`, upgrade staleness\n * warnings, doctor, and the double-install guard.\n *\n * 2. Read-only fs EVIDENCE probes of the hosts' own plugin state (e.g.\n * Claude Code's `$CLAUDE_CONFIG_DIR/plugins/installed_plugins.json`).\n * These catch installs the user performed manually from `package`'s\n * printed instructions, which the state record alone would miss. Probes\n * read undocumented host internals, so every reader degrades to null/false\n * on absence or parse failure — the guard convention is \"refuse only on\n * positive evidence\" (docs: design risk 4).\n */\n\nimport { createHash } from \"node:crypto\";\nimport {\n existsSync,\n readdirSync,\n readFileSync,\n realpathSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport TOML from \"@iarna/toml\";\n\nimport type { InstallScope, PlatformId } from \"./types.js\";\nimport type { PackageFormat } from \"./package.js\";\nimport {\n assertNoSymlinkInPath,\n connectorDir,\n connectorsDir,\n dataRoot,\n ensureDir,\n} from \"./paths.js\";\nimport { codexConfigHome, xdgConfigHome } from \"./host-paths.js\";\n\n// ─────────────────────────────────────────────────────────────────────────\n// State record: connectorDir(id)/marketplace-installs.json\n// ─────────────────────────────────────────────────────────────────────────\n\n/** The catalog name every staged local marketplace is registered under. */\nexport const MARKETPLACE_NAME = \"agent-connector\";\n\n/** One marketplace install of one connector on one platform. */\nexport interface MarketplaceInstallRecord {\n /** Bundle format that was staged + installed (e.g. \"claude-plugin\"). */\n format: PackageFormat;\n /** Absolute path of the staged plugin dir the host references/copied. */\n bundleDir: string;\n /** Marketplace/catalog name the install is keyed under ({@link MARKETPLACE_NAME}). */\n marketplace: string;\n /** Install scope (v1: always \"user\"). */\n scope: InstallScope;\n /** connector.version at install time (staleness warnings key off this). */\n version: string;\n /** sha256 over the staged plugin dir at install time (drift detection). */\n contentHash: string;\n /** ISO timestamp of the recorded install. */\n installedAt: string;\n}\n\n/** platform → record map persisted per connector. */\nexport type MarketplaceInstalls = Partial<\n Record<PlatformId, MarketplaceInstallRecord>\n>;\n\n/** Path of the per-connector marketplace state record. */\nexport function marketplaceInstallsPath(connectorId: string): string {\n return join(connectorDir(connectorId), \"marketplace-installs.json\");\n}\n\n/** Read the state record ({} on absence/parse failure — never throws). */\nexport function readMarketplaceInstalls(connectorId: string): MarketplaceInstalls {\n try {\n const raw = readFileSync(marketplaceInstallsPath(connectorId), \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as MarketplaceInstalls;\n }\n } catch {\n /* absent / unreadable → empty */\n }\n return {};\n}\n\n/** Write the state record; an empty map DELETES the file (uninstall leaves no husk). */\nexport function writeMarketplaceInstalls(\n connectorId: string,\n installs: MarketplaceInstalls,\n): void {\n const path = marketplaceInstallsPath(connectorId);\n assertNoSymlinkInPath(path);\n if (Object.keys(installs).length === 0) {\n rmSync(path, { force: true });\n return;\n }\n ensureDir(dirname(path));\n writeFileSync(path, `${JSON.stringify(installs, null, 2)}\\n`, \"utf8\");\n}\n\n/** True when THIS connector has any recorded marketplace install. */\nexport function connectorHasMarketplaceRecords(connectorId: string): boolean {\n return Object.keys(readMarketplaceInstalls(connectorId)).length > 0;\n}\n\n/**\n * True when ANY registered connector (optionally excluding one) still records a\n * marketplace install. Guards home-bin removal on purge: an installed plugin's\n * hooks exec the home-bin OUTSIDE any adapter-managed config, so removing the\n * launcher while a marketplace install survives would silently kill its hooks.\n */\nexport function anyMarketplaceRecordsRemain(excludeConnectorId?: string): boolean {\n const dir = connectorsDir();\n if (!existsSync(dir)) return false;\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return false;\n }\n return entries.some(\n (id) => id !== excludeConnectorId && connectorHasMarketplaceRecords(id),\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Staging roots — bundles staged by-reference must survive cwd changes and\n// `rm -rf dist-plugin`, so they live under the data-root, one shared root per\n// host family, holding every marketplace-installed connector's bundle plus ONE\n// regenerated catalog named \"agent-connector\" listing them all.\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Root for every marketplace staging tree: <dataRoot>/marketplace. */\nexport function marketplaceRoot(): string {\n return join(dataRoot(), \"marketplace\");\n}\n\n/** Shared Claude-family staging root: <dataRoot>/marketplace/claude. */\nexport function claudeStagingRoot(): string {\n return join(marketplaceRoot(), \"claude\");\n}\n\n/** Shared Codex-family staging root: <dataRoot>/marketplace/codex. */\nexport function codexStagingRoot(): string {\n return join(marketplaceRoot(), \"codex\");\n}\n\n/** Shared GitHub Copilot CLI staging root: <dataRoot>/marketplace/copilot. */\nexport function copilotStagingRoot(): string {\n return join(marketplaceRoot(), \"copilot\");\n}\n\n/** Shared agy (Antigravity) staging root: <dataRoot>/marketplace/agy. */\nexport function agyStagingRoot(): string {\n return join(marketplaceRoot(), \"agy\");\n}\n\n/** Shared Gemini-CLI staging root: <dataRoot>/marketplace/gemini. */\nexport function geminiStagingRoot(): string {\n return join(marketplaceRoot(), \"gemini\");\n}\n\n/** Shared Qwen-Code staging root: <dataRoot>/marketplace/qwen. */\nexport function qwenStagingRoot(): string {\n return join(marketplaceRoot(), \"qwen\");\n}\n\n/** Shared droid (Factory) staging root: <dataRoot>/marketplace/droid. */\nexport function droidStagingRoot(): string {\n return join(marketplaceRoot(), \"droid\");\n}\n\n/**\n * Shared npm-local staging root: <dataRoot>/marketplace/npm. Every npm-plugin\n * host (opencode / kilo / kilo-cli) stages here; the host config's `plugin`\n * array references the bundle by `file://<this>/<id>`, so it MUST live under the\n * stable data-root (it survives cwd changes and `rm -rf dist-plugin`).\n */\nexport function npmStagingRoot(): string {\n return join(marketplaceRoot(), \"npm\");\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Claude Code host-state readers ($CLAUDE_CONFIG_DIR || ~/.claude)\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Claude Code's config dir, honoring the CLAUDE_CONFIG_DIR override. */\nexport function claudeConfigDir(): string {\n const override = process.env.CLAUDE_CONFIG_DIR;\n if (override && override.trim() !== \"\") return resolve(override);\n return join(homedir(), \".claude\");\n}\n\n/** The installed_plugins.json key our marketplace install creates for `id`. */\nexport function claudePluginKey(connectorId: string): string {\n return `${connectorId}@${MARKETPLACE_NAME}`;\n}\n\nfunction readJsonFile(path: string): Record<string, unknown> | null {\n try {\n const parsed = JSON.parse(readFileSync(path, \"utf8\")) as unknown;\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as Record<string, unknown>;\n }\n } catch {\n /* absent / unreadable → null */\n }\n return null;\n}\n\n/** The `plugins` map from Claude's installed_plugins.json (null when unreadable). */\nexport function readClaudeInstalledPlugins(): Record<string, unknown> | null {\n const file = join(claudeConfigDir(), \"plugins\", \"installed_plugins.json\");\n const parsed = readJsonFile(file);\n const plugins = parsed?.plugins;\n if (plugins && typeof plugins === \"object\" && !Array.isArray(plugins)) {\n return plugins as Record<string, unknown>;\n }\n return null;\n}\n\n/** True when Claude's own state lists `<id>@agent-connector` as installed. */\nexport function claudePluginInstalled(connectorId: string): boolean {\n const plugins = readClaudeInstalledPlugins();\n if (!plugins) return false;\n const entry = plugins[claudePluginKey(connectorId)];\n return Array.isArray(entry) ? entry.length > 0 : entry != null;\n}\n\n/** True when ANY `*@agent-connector` plugin remains in Claude's state. */\nexport function anyClaudeAgentConnectorPlugins(): boolean {\n const plugins = readClaudeInstalledPlugins();\n if (!plugins) return false;\n return Object.entries(plugins).some(\n ([key, entry]) =>\n key.endsWith(`@${MARKETPLACE_NAME}`) &&\n (Array.isArray(entry) ? entry.length > 0 : entry != null),\n );\n}\n\n/**\n * The directory Claude's known_marketplaces.json records for `name`, or null\n * when not registered / unreadable. Used both as a presence probe and as the\n * NAME-COLLISION check: a registration pointing somewhere other than our\n * staging root belongs to the user and must never be touched.\n */\nexport function claudeKnownMarketplacePath(name: string): string | null {\n const file = join(claudeConfigDir(), \"plugins\", \"known_marketplaces.json\");\n const parsed = readJsonFile(file);\n const entry = parsed?.[name];\n if (!entry || typeof entry !== \"object\") return null;\n const e = entry as { installLocation?: unknown; source?: { path?: unknown } };\n if (typeof e.installLocation === \"string\") return e.installLocation;\n const sourcePath = e.source?.path;\n return typeof sourcePath === \"string\" ? sourcePath : null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Codex host-state readers ($CODEX_HOME || ~/.codex → config.toml)\n// ─────────────────────────────────────────────────────────────────────────\n\n/** The config.toml key our marketplace install creates for `id` (== claude's). */\nexport function codexPluginKey(connectorId: string): string {\n return `${connectorId}@${MARKETPLACE_NAME}`;\n}\n\n/** Parse <CODEX_HOME>/config.toml ({} on absence/parse failure — never throws). */\nfunction readCodexConfig(): Record<string, unknown> {\n const file = join(codexConfigHome(), \"config.toml\");\n try {\n return TOML.parse(readFileSync(file, \"utf8\")) as Record<string, unknown>;\n } catch {\n return {};\n }\n}\n\n/**\n * True when Codex's config.toml carries the `[plugins.\"<id>@agent-connector\"]`\n * table. The DEFINITIVE install probe — empty `plugins/cache/...` dirs linger\n * after uninstall, so the cache dir must NOT be used (docs: codex quirk).\n */\nexport function codexPluginInstalled(connectorId: string): boolean {\n const cfg = readCodexConfig();\n const plugins = cfg[\"plugins\"];\n if (!plugins || typeof plugins !== \"object\" || Array.isArray(plugins)) return false;\n return codexPluginKey(connectorId) in (plugins as Record<string, unknown>);\n}\n\n/** True when ANY `*@agent-connector` plugin remains in Codex's config.toml. */\nexport function anyCodexAgentConnectorPlugins(): boolean {\n const cfg = readCodexConfig();\n const plugins = cfg[\"plugins\"];\n if (!plugins || typeof plugins !== \"object\" || Array.isArray(plugins)) return false;\n return Object.keys(plugins as Record<string, unknown>).some((k) =>\n k.endsWith(`@${MARKETPLACE_NAME}`),\n );\n}\n\n/**\n * The directory config.toml records as `[marketplaces.agent-connector].source`,\n * or null when not registered / unreadable. Both a presence probe and the\n * NAME-COLLISION check: a registration pointing somewhere other than our\n * staging root belongs to the user and must never be touched.\n */\nexport function codexMarketplaceSource(name: string): string | null {\n const cfg = readCodexConfig();\n const marketplaces = cfg[\"marketplaces\"];\n if (!marketplaces || typeof marketplaces !== \"object\" || Array.isArray(marketplaces)) {\n return null;\n }\n const entry = (marketplaces as Record<string, unknown>)[name];\n if (!entry || typeof entry !== \"object\") return null;\n const source = (entry as { source?: unknown }).source;\n return typeof source === \"string\" ? source : null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// GitHub Copilot CLI host-state readers (~/.copilot, NO env — HOME isolation)\n//\n// LIVE-VERIFIED against GitHub Copilot CLI 1.0.63:\n// • ~/.copilot/config.json — JSONC (leading `// …` comment header, \"managed\n// automatically\") carrying `installedPlugins: [{ name, marketplace,\n// version, installed_at, enabled, cache_path }]`. The DEFINITIVE install\n// probe (an uninstall empties this array). Parsed JSONC-tolerantly so the\n// comment header does not break JSON.parse.\n// • ~/.copilot/settings.json — `extraKnownMarketplaces[\"<name>\"].source.path`\n// records the registered local marketplace dir (a `{source:\"directory\",\n// path}` object); `enabledPlugins[\"<id>@agent-connector\"]: true`. The\n// `.source.path` is both the presence probe and the NAME-COLLISION check.\n// Both readers degrade to false/null on absence/parse failure (refuse only on\n// positive evidence).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Copilot CLI's config dir: ~/.copilot (NO dedicated env — HOME isolation). */\nexport function copilotConfigDir(): string {\n return join(homedir(), \".copilot\");\n}\n\n/** The state key our marketplace install creates for `id` (== claude/codex). */\nexport function copilotPluginKey(connectorId: string): string {\n return `${connectorId}@${MARKETPLACE_NAME}`;\n}\n\n/** The `installedPlugins` array from Copilot's config.json (JSONC; [] when unreadable). */\nfunction readCopilotInstalledPlugins(): Array<Record<string, unknown>> {\n let raw: string;\n try {\n raw = readFileSync(join(copilotConfigDir(), \"config.json\"), \"utf8\");\n } catch {\n return [];\n }\n const parsed = parseJsonc(raw);\n const plugins = parsed?.[\"installedPlugins\"];\n if (!Array.isArray(plugins)) return [];\n return plugins.filter(\n (e): e is Record<string, unknown> =>\n e != null && typeof e === \"object\" && !Array.isArray(e),\n );\n}\n\n/**\n * True when Copilot's config.json lists `id` installed from our marketplace\n * (`installedPlugins[]` carries an entry with `name === id`, `marketplace ===\n * agent-connector`, and not `enabled: false`). The DEFINITIVE probe — an\n * uninstall empties this array (live-verified on CLI 1.0.63).\n */\nexport function copilotPluginInstalled(connectorId: string): boolean {\n return readCopilotInstalledPlugins().some(\n (e) =>\n e[\"name\"] === connectorId &&\n e[\"marketplace\"] === MARKETPLACE_NAME &&\n e[\"enabled\"] !== false,\n );\n}\n\n/** True when ANY plugin from our marketplace remains in Copilot's config.json. */\nexport function anyCopilotAgentConnectorPlugins(): boolean {\n return readCopilotInstalledPlugins().some(\n (e) => e[\"marketplace\"] === MARKETPLACE_NAME && e[\"enabled\"] !== false,\n );\n}\n\n/**\n * The directory settings.json records as `extraKnownMarketplaces[\"<name>\"]\n * .source.path`, or null when not registered / unreadable. Both a presence probe\n * and the NAME-COLLISION check (a registration pointing somewhere other than our\n * staging root belongs to the user and must never be touched). `source` is a\n * `{ source: \"directory\", path }` object on CLI 1.0.63; a bare string source is\n * accepted defensively.\n */\nexport function copilotMarketplaceSource(name: string): string | null {\n const parsed = readJsonFile(join(copilotConfigDir(), \"settings.json\"));\n const known = parsed?.[\"extraKnownMarketplaces\"];\n if (!known || typeof known !== \"object\" || Array.isArray(known)) return null;\n const entry = (known as Record<string, unknown>)[name];\n if (entry == null) return null;\n const source = (entry as { source?: unknown }).source;\n if (typeof source === \"string\") return source;\n if (source && typeof source === \"object\" && !Array.isArray(source)) {\n const path = (source as { path?: unknown }).path;\n if (typeof path === \"string\") return path;\n }\n return null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// droid (Factory) host-state readers (~/.factory/settings.json, JSON, NO env)\n//\n// DOCS-ONLY: no droid binary is present on this box. The settings.json key\n// shapes below (`enabledPlugins[\"<id>@agent-connector\"] === true` +\n// `extraKnownMarketplaces[\"agent-connector\"].source`) follow the documented\n// factory plugin model — confirm the exact JSON shapes live when a droid binary\n// is available. Both readers read defensively (refuse only on positive evidence).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** Factory's settings file: ~/.factory/settings.json (NO dedicated env). */\nexport function factorySettingsPath(): string {\n return join(homedir(), \".factory\", \"settings.json\");\n}\n\n/** The settings.json key our marketplace install creates for `id` (== codex's). */\nexport function droidPluginKey(connectorId: string): string {\n return `${connectorId}@${MARKETPLACE_NAME}`;\n}\n\n/** The `enabledPlugins` map from droid's settings.json (null when unreadable). */\nfunction readDroidEnabledPlugins(): Record<string, unknown> | null {\n const parsed = readJsonFile(factorySettingsPath());\n const plugins = parsed?.enabledPlugins;\n if (plugins && typeof plugins === \"object\" && !Array.isArray(plugins)) {\n return plugins as Record<string, unknown>;\n }\n return null;\n}\n\n/**\n * True when droid's settings.json carries\n * `enabledPlugins[\"<id>@agent-connector\"] === true`. DOCS-only: the strict\n * `=== true` value shape is unverified live (a future droid may store an object).\n */\nexport function droidPluginInstalled(connectorId: string): boolean {\n const plugins = readDroidEnabledPlugins();\n if (!plugins) return false;\n return plugins[droidPluginKey(connectorId)] === true;\n}\n\n/** True when ANY `*@agent-connector` plugin remains enabled in droid's settings. */\nexport function anyDroidAgentConnectorPlugins(): boolean {\n const plugins = readDroidEnabledPlugins();\n if (!plugins) return false;\n return Object.entries(plugins).some(\n ([key, value]) => key.endsWith(`@${MARKETPLACE_NAME}`) && value === true,\n );\n}\n\n/**\n * The directory droid's settings.json records as\n * `extraKnownMarketplaces[\"<name>\"].source`, or null when not registered /\n * unreadable. Both a presence probe and the NAME-COLLISION check (a registration\n * pointing somewhere other than our staging root belongs to the user). DOCS-only:\n * the local-path `source` field shape is undocumented, so this reads defensively\n * — accepts either a bare string source or an object carrying a `path`/`source`\n * string, and NORMALIZES to a single string for the samePath compare.\n */\nexport function droidMarketplaceSource(name: string): string | null {\n const parsed = readJsonFile(factorySettingsPath());\n const known = parsed?.extraKnownMarketplaces;\n if (!known || typeof known !== \"object\" || Array.isArray(known)) return null;\n const entry = (known as Record<string, unknown>)[name];\n if (entry == null) return null;\n if (typeof entry === \"string\") return entry;\n if (typeof entry === \"object\" && !Array.isArray(entry)) {\n const e = entry as { source?: unknown; path?: unknown };\n if (typeof e.source === \"string\") return e.source;\n if (typeof e.path === \"string\") return e.path;\n }\n return null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// agy (Antigravity) host-state readers (~/.gemini/config/plugins, NO env)\n// ─────────────────────────────────────────────────────────────────────────\n\n/** agy's config dir: ~/.gemini/config (NO dedicated env — HOME isolation). */\nexport function agyConfigDir(): string {\n return join(homedir(), \".gemini\", \"config\");\n}\n\n/** agy's plugins dir: ~/.gemini/config/plugins. */\nexport function agyPluginsDir(): string {\n return join(agyConfigDir(), \"plugins\");\n}\n\n/**\n * Candidate `import_manifest.json` locations. agy 1.0.7 records the manifest at\n * `<config>/plugins/import_manifest.json` on POSIX but at\n * `<config>/import_manifest.json` on Windows (live-confirmed on the my-window\n * box) — both are probed, then the copied plugin dir is the final fallback.\n */\nexport function agyImportManifestPaths(): string[] {\n return [\n join(agyConfigDir(), \"import_manifest.json\"), // win32 location\n join(agyPluginsDir(), \"import_manifest.json\"), // posix location\n ];\n}\n\n/** @deprecated single-location accessor — prefer {@link agyImportManifestPaths}. */\nexport function agyImportManifestPath(): string {\n return join(agyPluginsDir(), \"import_manifest.json\");\n}\n\n/**\n * True when `id` is installed per agy's import manifest (`imports[].name`),\n * checking BOTH the win32 and posix manifest locations, with a fallback probe of\n * the copied plugin dir's plugin.json. agy's uninstall removes the plugin dir\n * and clears the manifest entry (live-verified on Windows: install → dir +\n * manifest present, uninstall → both gone, re-install idempotent).\n */\nexport function agyPluginInstalled(connectorId: string): boolean {\n for (const manifest of agyImportManifestPaths()) {\n try {\n const parsed = JSON.parse(readFileSync(manifest, \"utf8\")) as {\n imports?: unknown;\n };\n const imports = parsed.imports;\n if (\n Array.isArray(imports) &&\n imports.some(\n (e) =>\n e != null &&\n typeof e === \"object\" &&\n (e as { name?: unknown }).name === connectorId,\n )\n ) {\n return true;\n }\n } catch {\n /* absent / unreadable manifest → try the next candidate */\n }\n }\n return existsSync(join(agyPluginsDir(), connectorId, \"plugin.json\"));\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Gemini CLI host-state readers (~/.gemini/extensions, NO env — HOME isolation)\n// ─────────────────────────────────────────────────────────────────────────\n\n/**\n * Gemini CLI's config dir: ~/.gemini (NO dedicated config-dir env — isolation is\n * via HOME, live-confirmed on gemini 0.36.0). DISTINCT from agy's ~/.gemini/config\n * tree: gemini extensions land under ~/.gemini/extensions/<id>/.\n */\nexport function geminiConfigDir(): string {\n return join(homedir(), \".gemini\");\n}\n\n/**\n * True when `id` is installed per Gemini's own extension store: the marker file\n * ~/.gemini/extensions/<id>/gemini-extension.json exists. Gemini exits 0 even on\n * a logical failure, so this fs probe — not the exit code — is the source of\n * truth (the driver re-probes after every spawn).\n */\nexport function geminiExtensionInstalled(connectorId: string): boolean {\n return existsSync(\n join(geminiConfigDir(), \"extensions\", connectorId, \"gemini-extension.json\"),\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Qwen Code host-state readers (~/.qwen/extensions, NO env — HOME isolation)\n//\n// DOCS-ONLY: no qwen binary is present on this box. qwen-code is a gemini-cli\n// fork, so the extension store SHAPE (~/.qwen/extensions/<id>/qwen-extension.json)\n// mirrors gemini's — confirm the marker filename live when a qwen binary lands.\n// ─────────────────────────────────────────────────────────────────────────\n\n/**\n * Qwen Code's config dir: ~/.qwen (NO dedicated config-dir env — isolation is\n * via HOME, like its gemini-cli parent). DOCS-only: confirm live when a qwen\n * binary is available. DISTINCT from ~/.gemini (the gemini-cli store).\n */\nexport function qwenConfigDir(): string {\n return join(homedir(), \".qwen\");\n}\n\n/**\n * True when `id` is installed per Qwen's own extension store: the marker file\n * ~/.qwen/extensions/<id>/qwen-extension.json exists. Mirrors gemini's fs probe\n * (qwen is a gemini fork); the driver re-probes after every spawn. DOCS-only:\n * the marker filename (`qwen-extension.json`) is unverified live.\n */\nexport function qwenExtensionInstalled(connectorId: string): boolean {\n return existsSync(\n join(qwenConfigDir(), \"extensions\", connectorId, \"qwen-extension.json\"),\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// npm-local host-state readers (opencode / kilo / kilo-cli — XDG_CONFIG_HOME)\n//\n// These hosts have NO uninstall verb; installs are recorded as `file://<dir>`\n// entries in a `plugin` array inside an opencode-style config file, which the\n// driver EDITS to remove. This module is a spawn/shared-free LEAF, so a tiny\n// posix-resolve path comparison is inlined here rather than importing\n// shared.ts's samePath (and samePath does not strip the `file://` scheme).\n// ─────────────────────────────────────────────────────────────────────────\n\n/** opencode's config dir: $XDG_CONFIG_HOME/opencode (or ~/.config/opencode). */\nexport function opencodeConfigDir(): string {\n return join(xdgConfigHome(), \"opencode\");\n}\n\n/** kilo / kilo-cli's config dir: $XDG_CONFIG_HOME/kilo (or ~/.config/kilo). */\nexport function kiloConfigDir(): string {\n return join(xdgConfigHome(), \"kilo\");\n}\n\n/**\n * Candidate config filenames per npm-local host, most-preferred first. opencode\n * accepts opencode.jsonc / opencode.json / config.json (JSONC — comments\n * tolerated); kilo / kilo-cli use opencode.json (plain JSON).\n */\nfunction npmConfigCandidates(platform: PlatformId): string[] {\n return platform === \"opencode\"\n ? [\"opencode.jsonc\", \"opencode.json\", \"config.json\"]\n : [\"opencode.json\"];\n}\n\n/** The config DIR for an npm-local host (opencode vs kilo/kilo-cli). */\nfunction npmConfigDir(platform: PlatformId): string {\n return platform === \"opencode\" ? opencodeConfigDir() : kiloConfigDir();\n}\n\n/**\n * The config FILE path for `platform`: the first existing candidate, else the\n * most-preferred candidate (the path a fresh install would write). Never throws.\n */\nexport function npmConfigFilePath(platform: PlatformId): string {\n const dir = npmConfigDir(platform);\n const candidates = npmConfigCandidates(platform);\n for (const name of candidates) {\n if (existsSync(join(dir, name))) return join(dir, name);\n }\n return join(dir, candidates[0]!);\n}\n\n/** Strip a single leading `file://` (and `file://localhost/`) scheme prefix. */\nexport function stripFileScheme(entry: string): string {\n let s = entry;\n if (s.startsWith(\"file://localhost/\")) s = s.slice(\"file://localhost\".length);\n else if (s.startsWith(\"file://\")) s = s.slice(\"file://\".length);\n return s;\n}\n\n/**\n * Strip `//` line and `/* */` block comments from JSONC, STRING-AWARE: a `//`\n * or `/*` inside a JSON string literal (e.g. the `file://` in a plugin entry) is\n * left intact. Scans char-by-char tracking string + escape state — a naive\n * regex would corrupt `\"file:///dir\"` by eating from the embedded `//`.\n */\nfunction stripJsoncComments(text: string): string {\n let out = \"\";\n let inString = false;\n let inLine = false;\n let inBlock = false;\n for (let i = 0; i < text.length; i++) {\n const c = text[i]!;\n const next = i + 1 < text.length ? text[i + 1]! : \"\";\n if (inLine) {\n if (c === \"\\n\") {\n inLine = false;\n out += c;\n }\n continue;\n }\n if (inBlock) {\n if (c === \"*\" && next === \"/\") {\n inBlock = false;\n i++;\n }\n continue;\n }\n if (inString) {\n out += c;\n if (c === \"\\\\\") {\n // Copy the escaped char verbatim (covers \\\" and \\\\).\n if (next !== \"\") {\n out += next;\n i++;\n }\n } else if (c === '\"') {\n inString = false;\n }\n continue;\n }\n if (c === '\"') {\n inString = true;\n out += c;\n continue;\n }\n if (c === \"/\" && next === \"/\") {\n inLine = true;\n i++;\n continue;\n }\n if (c === \"/\" && next === \"*\") {\n inBlock = true;\n i++;\n continue;\n }\n out += c;\n }\n return out;\n}\n\n/** Tolerant JSONC → object: strip // line and block comments, then JSON.parse. */\nfunction parseJsonc(text: string): Record<string, unknown> | null {\n // A parse failure degrades to null (the \"refuse only on positive evidence\"\n // convention) rather than throwing.\n try {\n const parsed = JSON.parse(stripJsoncComments(text)) as unknown;\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as Record<string, unknown>;\n }\n } catch {\n /* unreadable / not JSONC → null */\n }\n return null;\n}\n\n/** Read + parse an npm-local host's config file ({}-shaped or null). Never throws. */\nexport function readNpmConfig(platform: PlatformId): Record<string, unknown> | null {\n const file = npmConfigFilePath(platform);\n try {\n return parseJsonc(readFileSync(file, \"utf8\"));\n } catch {\n return null;\n }\n}\n\n/**\n * Convert an npm `plugin`-array entry to a native absolute path. opencode/kilo\n * record a proper `file://` URL — on Windows that is `file:///C:/Users/…` (drive\n * letter + forward slashes), which a textual `file://`-strip leaves as the broken\n * `/C:/Users/…`. `fileURLToPath` does the correct cross-platform decode\n * (`file:///C:/x`→`C:\\x`, `file:///tmp/x`→`/tmp/x`). Bare-path entries (also\n * accepted by the hosts) and any malformed URL fall back to a textual strip.\n */\nfunction npmEntryToPath(entry: string): string {\n if (/^file:\\/\\//i.test(entry)) {\n try {\n return fileURLToPath(entry);\n } catch {\n /* malformed file URL (e.g. backslashes) → manual strip below */\n }\n }\n return stripFileScheme(entry);\n}\n\n/**\n * Path equality for the npm probe. Resolve symlinks with `realpathSync.native`\n * when the path exists (catches macOS `/var/folders`→`/private/var/folders` and\n * win32 8.3 short paths — the host records the realpath, we hold the symlink),\n * else lexical `resolve()`; case-fold on win32. Inlined here (leaf module)\n * rather than importing shared.ts's samePath, which pulls in the spawn layer.\n */\nfunction npmPathEquals(a: string, b: string): boolean {\n const norm = (p: string): string => {\n let s: string;\n try {\n s = realpathSync.native(p);\n } catch {\n s = resolve(p);\n }\n return process.platform === \"win32\" ? s.toLowerCase() : s;\n };\n return norm(a) === norm(b);\n}\n\n/**\n * The `plugin`-array ENTRY (the raw string, including any `file://`) whose value\n * — after stripping a leading `file://` — path-equals `id`'s staged bundle dir,\n * or null when no entry references it. Used both as the install probe and to\n * locate the exact entry the uninstall edit must drop.\n */\nexport function npmPluginArrayEntry(\n platform: PlatformId,\n connectorId: string,\n): string | null {\n const cfg = readNpmConfig(platform);\n if (!cfg) return null;\n const arr = cfg[\"plugin\"];\n if (!Array.isArray(arr)) return null;\n const target = join(npmStagingRoot(), connectorId);\n for (const raw of arr) {\n if (typeof raw !== \"string\") continue;\n if (npmPathEquals(npmEntryToPath(raw), target)) return raw;\n }\n return null;\n}\n\n/** True when `platform`'s config `plugin` array references `id`'s staged bundle. */\nexport function npmPluginInstalled(platform: PlatformId, connectorId: string): boolean {\n return npmPluginArrayEntry(platform, connectorId) != null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Cross-host marketplace-install EVIDENCE (the double-install guard's probe)\n// ─────────────────────────────────────────────────────────────────────────\n\n/**\n * Read-only evidence that `connectorId` is marketplace/plugin-installed on\n * `platform`: the state record first, then a cheap fs probe of the host's own\n * plugin state (catches manual installs from `package`'s printed instructions).\n * Returns a human-readable description of the evidence, or null when none.\n */\nexport function marketplaceEvidence(\n connectorId: string,\n platform: PlatformId,\n): string | null {\n if (readMarketplaceInstalls(connectorId)[platform]) {\n return \"recorded in marketplace-installs.json\";\n }\n switch (platform) {\n case \"claude-code\":\n if (claudePluginInstalled(connectorId)) {\n return `${claudePluginKey(connectorId)} listed in Claude's installed_plugins.json`;\n }\n return null;\n case \"gemini-cli\":\n return geminiExtensionInstalled(connectorId)\n ? `extension ${connectorId} listed in Gemini's extensions store`\n : null;\n case \"qwen-code\":\n return qwenExtensionInstalled(connectorId)\n ? `extension ${connectorId} listed in Qwen's extensions store`\n : null;\n case \"droid\":\n return droidPluginInstalled(connectorId)\n ? `${droidPluginKey(connectorId)} enabled in droid's settings.json`\n : null;\n case \"antigravity\":\n case \"antigravity-cli\": {\n const dir = join(homedir(), \".gemini\", \"config\", \"plugins\", connectorId);\n return existsSync(dir) ? `plugin dir ${dir} exists` : null;\n }\n case \"opencode\":\n case \"kilo\":\n case \"kilo-cli\":\n return npmPluginInstalled(platform, connectorId)\n ? `${connectorId} listed in ${platform}'s config plugin array`\n : null;\n case \"codex\": {\n const dir = join(\n codexConfigHome(),\n \"plugins\",\n \"cache\",\n MARKETPLACE_NAME,\n connectorId,\n );\n return existsSync(dir) ? `codex plugin cache ${dir} exists` : null;\n }\n case \"copilot-cli\":\n return copilotPluginInstalled(connectorId)\n ? `${copilotPluginKey(connectorId)} listed in Copilot's config.json`\n : null;\n default:\n return null;\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Content hashing — staged-bundle drift detection\n// ─────────────────────────────────────────────────────────────────────────\n\n/**\n * Deterministic sha256 over every file under `dir` (sorted relative paths +\n * bytes). Empty string when the dir is missing/unreadable. Used to record the\n * staged bundle's content at install time and detect drift later (claude caches\n * a versioned COPY, so an edited connector goes silently stale without this).\n */\nexport function hashDirectory(dir: string): string {\n if (!existsSync(dir)) return \"\";\n const files: string[] = [];\n const walk = (d: string): void => {\n let entries: string[];\n try {\n entries = readdirSync(d);\n } catch {\n return;\n }\n for (const name of entries.sort()) {\n const full = join(d, name);\n let st;\n try {\n st = statSync(full);\n } catch {\n continue;\n }\n if (st.isDirectory()) walk(full);\n else if (st.isFile()) files.push(full);\n }\n };\n walk(dir);\n const hash = createHash(\"sha256\");\n for (const file of files.sort()) {\n hash.update(relative(dir, file).split(\"\\\\\").join(\"/\"));\n hash.update(\"\\0\");\n try {\n hash.update(readFileSync(file));\n } catch {\n /* unreadable file contributes only its path */\n }\n hash.update(\"\\0\");\n }\n return hash.digest(\"hex\");\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,SAAS,MAAM,UAAU,eAAe;AACjD,SAAS,qBAAqB;AAE9B,OAAO,UAAU;AAkBV,IAAM,mBAAmB;AA0BzB,SAAS,wBAAwB,aAA6B;AACnE,SAAO,KAAK,aAAa,WAAW,GAAG,2BAA2B;AACpE;AAGO,SAAS,wBAAwB,aAA0C;AAChF,MAAI;AACF,UAAM,MAAM,aAAa,wBAAwB,WAAW,GAAG,MAAM;AACrE,UAAM,SAAS,KAAK,MAAM,GAAG;AAC7B,QAAI,UAAU,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,MAAM,GAAG;AAClE,aAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AAC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BAAiB,WAAW,CAAC,qCAChC;AAAA,IACN;AACE,aAAO;AAAA,EACX;AACF;AAYO,SAAS,cAAc,KAAqB;AACjD,MAAI,CAAC,WAAW,GAAG,EAAG,QAAO;AAC7B,QAAM,QAAkB,CAAC;AACzB,QAAM,OAAO,CAAC,MAAoB;AAChC,QAAI;AACJ,QAAI;AACF,gBAAU,YAAY,CAAC;AAAA,IACzB,QAAQ;AACN;AAAA,IACF;AACA,eAAW,QAAQ,QAAQ,KAAK,GAAG;AACjC,YAAM,OAAO,KAAK,GAAG,IAAI;AACzB,UAAI;AACJ,UAAI;AACF,aAAK,SAAS,IAAI;AAAA,MACpB,QAAQ;AACN;AAAA,MACF;AACA,UAAI,GAAG,YAAY,EAAG,MAAK,IAAI;AAAA,eACtB,GAAG,OAAO,EAAG,OAAM,KAAK,IAAI;AAAA,IACvC;AAAA,EACF;AACA,OAAK,GAAG;AACR,QAAM,OAAO,WAAW,QAAQ;AAChC,aAAW,QAAQ,MAAM,KAAK,GAAG;AAC/B,SAAK,OAAO,SAAS,KAAK,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK,GAAG,CAAC;AACrD,SAAK,OAAO,IAAI;AAChB,QAAI;AACF,WAAK,OAAO,aAAa,IAAI,CAAC;AAAA,IAChC,QAAQ;AAAA,IAER;AACA,SAAK,OAAO,IAAI;AAAA,EAClB;AACA,SAAO,KAAK,OAAO,KAAK;AAC1B;","names":[]}
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
BaseAdapter,
|
|
7
7
|
parseJsonc,
|
|
8
8
|
renderSkillMd
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WFEHWTLM.js";
|
|
10
10
|
import {
|
|
11
11
|
buildWrappedStdio
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4NHXLXSD.js";
|
|
13
13
|
|
|
14
14
|
// src/adapters/openclaw/index.ts
|
|
15
15
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -1008,4 +1008,4 @@ export {
|
|
|
1008
1008
|
adapter,
|
|
1009
1009
|
openclaw_default
|
|
1010
1010
|
};
|
|
1011
|
-
//# sourceMappingURL=chunk-
|
|
1011
|
+
//# sourceMappingURL=chunk-3C5AASHM.js.map
|
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-OP4KBXUO.js";
|
|
7
7
|
import {
|
|
8
8
|
spawnChild
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z2MRSS2I.js";
|
|
10
10
|
import {
|
|
11
11
|
detectRuntimeHost
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FO5CEXXN.js";
|
|
13
13
|
import {
|
|
14
14
|
attachLazyTelemetryUsage,
|
|
15
15
|
buildTelemetryAccessor,
|
|
16
16
|
measureToolCall,
|
|
17
17
|
measureToolDefs
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FBCBHEGB.js";
|
|
19
19
|
import {
|
|
20
20
|
log
|
|
21
21
|
} from "./chunk-KHO5WNTP.js";
|
|
@@ -24,23 +24,23 @@ import {
|
|
|
24
24
|
inferModelFamily,
|
|
25
25
|
newRecordId,
|
|
26
26
|
openStore
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IVAWP6HH.js";
|
|
28
28
|
import {
|
|
29
29
|
loadRegisteredConnector,
|
|
30
30
|
readRegisteredMeta
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JVO6NBTT.js";
|
|
32
32
|
import {
|
|
33
33
|
REGISTERED_PLATFORM_IDS,
|
|
34
34
|
loadAdapter
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KA55FISM.js";
|
|
36
36
|
import {
|
|
37
37
|
detectLaunchMethod
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-4NHXLXSD.js";
|
|
39
39
|
import {
|
|
40
40
|
dataRoot,
|
|
41
41
|
ensureDir,
|
|
42
42
|
projectIdentity
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GZGLCCEE.js";
|
|
44
44
|
|
|
45
45
|
// src/runtime/serve.ts
|
|
46
46
|
import { randomUUID } from "crypto";
|
|
@@ -701,4 +701,4 @@ export {
|
|
|
701
701
|
runStatusline,
|
|
702
702
|
runAction
|
|
703
703
|
};
|
|
704
|
-
//# sourceMappingURL=chunk-
|
|
704
|
+
//# sourceMappingURL=chunk-447JWFZO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
isNonDefaultDataRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GZGLCCEE.js";
|
|
5
5
|
|
|
6
6
|
// src/core/spawn.ts
|
|
7
7
|
import { existsSync } from "fs";
|
|
@@ -158,4 +158,4 @@ export {
|
|
|
158
158
|
resolveSpawnCommand,
|
|
159
159
|
detectLaunchMethod
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-4NHXLXSD.js.map
|