@ken-jo/agent-connector 0.4.75 → 0.4.91
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 +3 -3
- package/dist/{action-TCKBTTZX.js → action-L44DXFHT.js} +14 -14
- package/dist/{amazon-q-CB4XFX7T.js → amazon-q-B52EY2SV.js} +5 -5
- package/dist/{amp-6Q5OYHNW.js → amp-UXABVUKC.js} +5 -5
- package/dist/{antigravity-WIK3XBN5.js → antigravity-RZHN53VB.js} +6 -6
- package/dist/antigravity-cli-JO6GUTV7.js +436 -0
- package/dist/antigravity-cli-JO6GUTV7.js.map +1 -0
- package/dist/{chunk-Q5LECKZL.js → chunk-25CPWJA7.js} +116 -36
- package/dist/chunk-25CPWJA7.js.map +1 -0
- package/dist/{chunk-D6ZJS4ND.js → chunk-4FWETID5.js} +2 -2
- package/dist/{chunk-Q42SEI7W.js → chunk-4HVQ7IUM.js} +3 -3
- package/dist/{chunk-IU42THN7.js → chunk-4NSU3KWX.js} +2 -2
- package/dist/{chunk-7CZKXXBD.js → chunk-56R2ER7K.js} +2 -2
- package/dist/{chunk-HKM3HUOK.js → chunk-7HUUINPB.js} +18 -18
- package/dist/{chunk-TZ5KGCE2.js → chunk-AY3RGRTT.js} +2 -2
- package/dist/{chunk-MHDQWZ4A.js → chunk-BLTVZACS.js} +23 -13
- package/dist/chunk-BLTVZACS.js.map +1 -0
- package/dist/{chunk-7ITLLYWB.js → chunk-G4CEELKO.js} +5 -5
- package/dist/{chunk-TO57WYBB.js → chunk-HORHRHNG.js} +9 -3
- package/dist/chunk-HORHRHNG.js.map +1 -0
- package/dist/{chunk-2HCJV6UO.js → chunk-IXOQDZWC.js} +9 -2
- package/dist/chunk-IXOQDZWC.js.map +1 -0
- package/dist/{chunk-2L6LTQ6L.js → chunk-KIRCPLM4.js} +21 -10
- package/dist/chunk-KIRCPLM4.js.map +1 -0
- package/dist/{chunk-24K6JOKV.js → chunk-LAIITCMW.js} +8 -8
- package/dist/{chunk-OEQJGBBW.js → chunk-LF76VPGQ.js} +9 -9
- package/dist/{chunk-7QRUZAUG.js → chunk-LN76OGNR.js} +2 -2
- package/dist/{chunk-DI6OWKH2.js → chunk-NBUEL74R.js} +3 -3
- package/dist/{chunk-IRUYJD23.js → chunk-NLE2J5P4.js} +1 -1
- package/dist/{chunk-5LAFKXFM.js → chunk-NWLRJNXM.js} +3 -3
- package/dist/{chunk-ECSRTK4M.js → chunk-QARPXSIV.js} +4 -4
- package/dist/{chunk-AXAHW2KU.js → chunk-QKLJU4JX.js} +2 -2
- package/dist/{chunk-MDZG5QHB.js → chunk-R6LML2YS.js} +2 -2
- package/dist/{chunk-FUXUEXDP.js → chunk-UBB7T54N.js} +3 -3
- package/dist/{chunk-NUGMVVV2.js → chunk-VVFDU4IX.js} +4 -4
- package/dist/{chunk-ALVXORZM.js → chunk-YYNXIUR2.js} +2 -2
- package/dist/{chunk-TW4DVR4V.js → chunk-ZMLVR4J7.js} +7 -2
- package/dist/chunk-ZMLVR4J7.js.map +1 -0
- package/dist/{claude-code-HFBAAVWS.js → claude-code-WS4NAGZT.js} +9 -9
- package/dist/cli/sdk.js +7 -7
- package/dist/cli.js +1 -1
- package/dist/{cline-26W4FEZ6.js → cline-NNMVCECA.js} +5 -5
- package/dist/codebuddy-RBEZGXBG.js +643 -0
- package/dist/codebuddy-RBEZGXBG.js.map +1 -0
- package/dist/{codebuff-J5KEEBIL.js → codebuff-RJIDSEU3.js} +5 -5
- package/dist/{codex-JKQ6TLRI.js → codex-ZZ434GYR.js} +8 -8
- package/dist/{continue-KQSJUSWX.js → continue-MNM7YVJY.js} +6 -6
- package/dist/{copilot-cli-YBNKLYUB.js → copilot-cli-SMTX5F65.js} +5 -5
- package/dist/{crush-JTWTZIPB.js → crush-NYDBHIJE.js} +5 -5
- package/dist/{cursor-2NIZSDZ4.js → cursor-AOELDNZU.js} +6 -6
- package/dist/{detect-CWEIQCRC.js → detect-3S46RUMK.js} +4 -4
- package/dist/devin-PRJY2TTD.js +510 -0
- package/dist/devin-PRJY2TTD.js.map +1 -0
- package/dist/{doctor-AC437ZAW.js → doctor-3CUBPQKU.js} +22 -22
- package/dist/{droid-HF2AIFB2.js → droid-PTCH2K7Y.js} +5 -5
- package/dist/{gemini-cli-2EOK26S2.js → gemini-cli-QGLN2UMS.js} +5 -5
- package/dist/{goose-55JOTXS5.js → goose-DQ6GSZ5O.js} +6 -6
- package/dist/grok-cli-5QD235UB.js +482 -0
- package/dist/grok-cli-5QD235UB.js.map +1 -0
- package/dist/{hermes-QVZOZU4B.js → hermes-E47IG63A.js} +6 -6
- package/dist/{hook-VYD3OCLM.js → hook-P6EKDINW.js} +14 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{install-S6BYIJ62.js → install-7DMK53SB.js} +18 -18
- package/dist/{introspect-5o5ick0_.d.ts → introspect-DYOIX8Ov.d.ts} +1 -1
- package/dist/{jetbrains-copilot-DZ2ATXFN.js → jetbrains-copilot-T2EPKROP.js} +13 -7
- package/dist/jetbrains-copilot-T2EPKROP.js.map +1 -0
- package/dist/junie-SQ4SDLGK.js +227 -0
- package/dist/junie-SQ4SDLGK.js.map +1 -0
- package/dist/{kilo-GJNSBWVV.js → kilo-OU2ZLZKB.js} +8 -8
- package/dist/{kilo-cli-2CCB3DBI.js → kilo-cli-NMWGYF4F.js} +8 -8
- package/dist/{kimi-YRPCSB6N.js → kimi-Z7L2LEEI.js} +5 -5
- package/dist/{kiro-BUOQFASX.js → kiro-4IN5IH46.js} +81 -6
- package/dist/kiro-4IN5IH46.js.map +1 -0
- package/dist/{leaderboard-SUSUDKHR.js → leaderboard-LF5SP6X2.js} +7 -7
- package/dist/{mimo-code-V4FP5PUJ.js → mimo-code-G2CBZ4M6.js} +5 -5
- package/dist/mistral-vibe-TRQDHAWV.js +300 -0
- package/dist/mistral-vibe-TRQDHAWV.js.map +1 -0
- package/dist/{mux-CMJSM42O.js → mux-JNM3F2NW.js} +5 -5
- package/dist/{nemoclaw-VP56PGKC.js → nemoclaw-SHA4IUML.js} +6 -6
- package/dist/{omp-OOFGD3GG.js → omp-OOVUNXME.js} +5 -5
- package/dist/open-interpreter-4PKL56AA.js +264 -0
- package/dist/open-interpreter-4PKL56AA.js.map +1 -0
- package/dist/openclaw-BD56E5MV.js +17 -0
- package/dist/{opencode-MKLHSQRD.js → opencode-W2RK4M7G.js} +5 -5
- package/dist/openhands-5LNH3BKB.js +384 -0
- package/dist/openhands-5LNH3BKB.js.map +1 -0
- package/dist/{package-KOAAVKHH.js → package-2EAIYSJ4.js} +13 -13
- package/dist/{pi-NMVL7OFL.js → pi-BUADR5MJ.js} +143 -6
- package/dist/pi-BUADR5MJ.js.map +1 -0
- package/dist/{qwen-code-2XE2T6F4.js → qwen-code-TUJNHKNI.js} +9 -9
- package/dist/{roo-code-YJOIKCCS.js → roo-code-L5F7S6QH.js} +5 -5
- package/dist/runtime/index.d.ts +12 -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-BU23QUSJ.js → serve-K62FW3V7.js} +24 -17
- package/dist/serve-K62FW3V7.js.map +1 -0
- package/dist/{status-N5LCQQ3R.js → status-E5MCFZM6.js} +11 -11
- package/dist/{statusline-442XOF7R.js → statusline-LIPF2KVP.js} +13 -13
- package/dist/{telemetry-V4YQL2NU.js → telemetry-4OC56NTM.js} +10 -10
- package/dist/{trae-QSV2JZFT.js → trae-Z7CQ2A2Q.js} +5 -5
- package/dist/{types-D6RWGXm1.d.ts → types-C4qMgbJn.d.ts} +10 -9
- package/dist/{uninstall-WGEKTCDZ.js → uninstall-2YYKN5DX.js} +18 -18
- package/dist/{upgrade-IH7CKPTO.js → upgrade-55AFPJEF.js} +18 -18
- package/dist/{usage-DI7XRCKM.js → usage-3PB3WZSL.js} +3 -3
- package/dist/{usage-event-2FCU55AN.js → usage-event-KD5FW6W4.js} +13 -13
- package/dist/{vscode-copilot-R23RTVST.js → vscode-copilot-LU5NC4ZS.js} +5 -5
- package/dist/{warp-B72XSQ5G.js → warp-4PPG5LOM.js} +5 -5
- package/dist/{windsurf-642VBMQ2.js → windsurf-3T3RVXKM.js} +5 -5
- package/dist/{zed-6UJS7JKB.js → zed-ZF2OQ75O.js} +123 -7
- package/dist/zed-ZF2OQ75O.js.map +1 -0
- package/package.json +1 -1
- package/dist/antigravity-cli-L3RZMF6V.js +0 -87
- package/dist/antigravity-cli-L3RZMF6V.js.map +0 -1
- package/dist/chunk-2HCJV6UO.js.map +0 -1
- package/dist/chunk-2L6LTQ6L.js.map +0 -1
- package/dist/chunk-MHDQWZ4A.js.map +0 -1
- package/dist/chunk-Q5LECKZL.js.map +0 -1
- package/dist/chunk-TO57WYBB.js.map +0 -1
- package/dist/chunk-TW4DVR4V.js.map +0 -1
- package/dist/jetbrains-copilot-DZ2ATXFN.js.map +0 -1
- package/dist/kiro-BUOQFASX.js.map +0 -1
- package/dist/openclaw-V73XHPXP.js +0 -17
- package/dist/pi-NMVL7OFL.js.map +0 -1
- package/dist/serve-BU23QUSJ.js.map +0 -1
- package/dist/zed-6UJS7JKB.js.map +0 -1
- /package/dist/{action-TCKBTTZX.js.map → action-L44DXFHT.js.map} +0 -0
- /package/dist/{amazon-q-CB4XFX7T.js.map → amazon-q-B52EY2SV.js.map} +0 -0
- /package/dist/{amp-6Q5OYHNW.js.map → amp-UXABVUKC.js.map} +0 -0
- /package/dist/{antigravity-WIK3XBN5.js.map → antigravity-RZHN53VB.js.map} +0 -0
- /package/dist/{chunk-D6ZJS4ND.js.map → chunk-4FWETID5.js.map} +0 -0
- /package/dist/{chunk-Q42SEI7W.js.map → chunk-4HVQ7IUM.js.map} +0 -0
- /package/dist/{chunk-IU42THN7.js.map → chunk-4NSU3KWX.js.map} +0 -0
- /package/dist/{chunk-7CZKXXBD.js.map → chunk-56R2ER7K.js.map} +0 -0
- /package/dist/{chunk-HKM3HUOK.js.map → chunk-7HUUINPB.js.map} +0 -0
- /package/dist/{chunk-TZ5KGCE2.js.map → chunk-AY3RGRTT.js.map} +0 -0
- /package/dist/{chunk-7ITLLYWB.js.map → chunk-G4CEELKO.js.map} +0 -0
- /package/dist/{chunk-24K6JOKV.js.map → chunk-LAIITCMW.js.map} +0 -0
- /package/dist/{chunk-OEQJGBBW.js.map → chunk-LF76VPGQ.js.map} +0 -0
- /package/dist/{chunk-7QRUZAUG.js.map → chunk-LN76OGNR.js.map} +0 -0
- /package/dist/{chunk-DI6OWKH2.js.map → chunk-NBUEL74R.js.map} +0 -0
- /package/dist/{chunk-IRUYJD23.js.map → chunk-NLE2J5P4.js.map} +0 -0
- /package/dist/{chunk-5LAFKXFM.js.map → chunk-NWLRJNXM.js.map} +0 -0
- /package/dist/{chunk-ECSRTK4M.js.map → chunk-QARPXSIV.js.map} +0 -0
- /package/dist/{chunk-AXAHW2KU.js.map → chunk-QKLJU4JX.js.map} +0 -0
- /package/dist/{chunk-MDZG5QHB.js.map → chunk-R6LML2YS.js.map} +0 -0
- /package/dist/{chunk-FUXUEXDP.js.map → chunk-UBB7T54N.js.map} +0 -0
- /package/dist/{chunk-NUGMVVV2.js.map → chunk-VVFDU4IX.js.map} +0 -0
- /package/dist/{chunk-ALVXORZM.js.map → chunk-YYNXIUR2.js.map} +0 -0
- /package/dist/{claude-code-HFBAAVWS.js.map → claude-code-WS4NAGZT.js.map} +0 -0
- /package/dist/{cline-26W4FEZ6.js.map → cline-NNMVCECA.js.map} +0 -0
- /package/dist/{codebuff-J5KEEBIL.js.map → codebuff-RJIDSEU3.js.map} +0 -0
- /package/dist/{codex-JKQ6TLRI.js.map → codex-ZZ434GYR.js.map} +0 -0
- /package/dist/{continue-KQSJUSWX.js.map → continue-MNM7YVJY.js.map} +0 -0
- /package/dist/{copilot-cli-YBNKLYUB.js.map → copilot-cli-SMTX5F65.js.map} +0 -0
- /package/dist/{crush-JTWTZIPB.js.map → crush-NYDBHIJE.js.map} +0 -0
- /package/dist/{cursor-2NIZSDZ4.js.map → cursor-AOELDNZU.js.map} +0 -0
- /package/dist/{detect-CWEIQCRC.js.map → detect-3S46RUMK.js.map} +0 -0
- /package/dist/{doctor-AC437ZAW.js.map → doctor-3CUBPQKU.js.map} +0 -0
- /package/dist/{droid-HF2AIFB2.js.map → droid-PTCH2K7Y.js.map} +0 -0
- /package/dist/{gemini-cli-2EOK26S2.js.map → gemini-cli-QGLN2UMS.js.map} +0 -0
- /package/dist/{goose-55JOTXS5.js.map → goose-DQ6GSZ5O.js.map} +0 -0
- /package/dist/{hermes-QVZOZU4B.js.map → hermes-E47IG63A.js.map} +0 -0
- /package/dist/{hook-VYD3OCLM.js.map → hook-P6EKDINW.js.map} +0 -0
- /package/dist/{install-S6BYIJ62.js.map → install-7DMK53SB.js.map} +0 -0
- /package/dist/{kilo-GJNSBWVV.js.map → kilo-OU2ZLZKB.js.map} +0 -0
- /package/dist/{kilo-cli-2CCB3DBI.js.map → kilo-cli-NMWGYF4F.js.map} +0 -0
- /package/dist/{kimi-YRPCSB6N.js.map → kimi-Z7L2LEEI.js.map} +0 -0
- /package/dist/{leaderboard-SUSUDKHR.js.map → leaderboard-LF5SP6X2.js.map} +0 -0
- /package/dist/{mimo-code-V4FP5PUJ.js.map → mimo-code-G2CBZ4M6.js.map} +0 -0
- /package/dist/{mux-CMJSM42O.js.map → mux-JNM3F2NW.js.map} +0 -0
- /package/dist/{nemoclaw-VP56PGKC.js.map → nemoclaw-SHA4IUML.js.map} +0 -0
- /package/dist/{omp-OOFGD3GG.js.map → omp-OOVUNXME.js.map} +0 -0
- /package/dist/{openclaw-V73XHPXP.js.map → openclaw-BD56E5MV.js.map} +0 -0
- /package/dist/{opencode-MKLHSQRD.js.map → opencode-W2RK4M7G.js.map} +0 -0
- /package/dist/{package-KOAAVKHH.js.map → package-2EAIYSJ4.js.map} +0 -0
- /package/dist/{qwen-code-2XE2T6F4.js.map → qwen-code-TUJNHKNI.js.map} +0 -0
- /package/dist/{roo-code-YJOIKCCS.js.map → roo-code-L5F7S6QH.js.map} +0 -0
- /package/dist/{status-N5LCQQ3R.js.map → status-E5MCFZM6.js.map} +0 -0
- /package/dist/{statusline-442XOF7R.js.map → statusline-LIPF2KVP.js.map} +0 -0
- /package/dist/{telemetry-V4YQL2NU.js.map → telemetry-4OC56NTM.js.map} +0 -0
- /package/dist/{trae-QSV2JZFT.js.map → trae-Z7CQ2A2Q.js.map} +0 -0
- /package/dist/{uninstall-WGEKTCDZ.js.map → uninstall-2YYKN5DX.js.map} +0 -0
- /package/dist/{upgrade-IH7CKPTO.js.map → upgrade-55AFPJEF.js.map} +0 -0
- /package/dist/{usage-DI7XRCKM.js.map → usage-3PB3WZSL.js.map} +0 -0
- /package/dist/{usage-event-2FCU55AN.js.map → usage-event-KD5FW6W4.js.map} +0 -0
- /package/dist/{vscode-copilot-R23RTVST.js.map → vscode-copilot-LU5NC4ZS.js.map} +0 -0
- /package/dist/{warp-B72XSQ5G.js.map → warp-4PPG5LOM.js.map} +0 -0
- /package/dist/{windsurf-642VBMQ2.js.map → windsurf-3T3RVXKM.js.map} +0 -0
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
import {
|
|
3
3
|
marketplaceDoctorChecks,
|
|
4
4
|
syncConnector
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-KIRCPLM4.js";
|
|
6
|
+
import "./chunk-LF76VPGQ.js";
|
|
7
7
|
import {
|
|
8
8
|
readMarketplaceInstalls
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-QKLJU4JX.js";
|
|
10
|
+
import "./chunk-UM5S7DKK.js";
|
|
11
|
+
import "./chunk-NBUEL74R.js";
|
|
12
|
+
import "./chunk-OPXAP3AC.js";
|
|
11
13
|
import {
|
|
12
14
|
fail,
|
|
13
15
|
parseScope,
|
|
14
16
|
parseTargets,
|
|
15
17
|
print
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7HUUINPB.js";
|
|
17
19
|
import {
|
|
18
20
|
LineBuffer,
|
|
19
21
|
idKey,
|
|
@@ -21,42 +23,40 @@ import {
|
|
|
21
23
|
} from "./chunk-OP4KBXUO.js";
|
|
22
24
|
import {
|
|
23
25
|
spawnChild
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LN76OGNR.js";
|
|
25
27
|
import {
|
|
26
28
|
detectInstalledPlatforms
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZMLVR4J7.js";
|
|
28
30
|
import {
|
|
29
31
|
explainHooks
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-D6ZJS4ND.js";
|
|
32
|
+
} from "./chunk-QARPXSIV.js";
|
|
33
|
+
import "./chunk-LAIITCMW.js";
|
|
33
34
|
import "./chunk-KHO5WNTP.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-4FWETID5.js";
|
|
36
|
+
import "./chunk-R6LML2YS.js";
|
|
35
37
|
import {
|
|
36
38
|
findConnectorConfig,
|
|
37
39
|
listRegisteredConnectors,
|
|
38
40
|
loadConnectorFromPath,
|
|
39
41
|
readRegisteredMeta
|
|
40
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-NWLRJNXM.js";
|
|
41
43
|
import {
|
|
42
44
|
MCP_PROTOCOL_VERSION
|
|
43
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-G4CEELKO.js";
|
|
44
46
|
import {
|
|
45
47
|
REGISTERED_PLATFORM_IDS,
|
|
46
48
|
loadAdapter
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-OPXAP3AC.js";
|
|
50
|
-
import "./chunk-UM5S7DKK.js";
|
|
49
|
+
} from "./chunk-25CPWJA7.js";
|
|
50
|
+
import "./chunk-56R2ER7K.js";
|
|
51
51
|
import "./chunk-H53QZQJI.js";
|
|
52
52
|
import "./chunk-BEFVJ2OE.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-VVFDU4IX.js";
|
|
54
|
+
import "./chunk-HORHRHNG.js";
|
|
55
|
+
import "./chunk-YYNXIUR2.js";
|
|
56
56
|
import {
|
|
57
57
|
dataRoot,
|
|
58
58
|
homeBinPath
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-IXOQDZWC.js";
|
|
60
60
|
|
|
61
61
|
// src/cli/commands/doctor.ts
|
|
62
62
|
import { parseArgs } from "util";
|
|
@@ -623,4 +623,4 @@ async function run(argv) {
|
|
|
623
623
|
export {
|
|
624
624
|
run
|
|
625
625
|
};
|
|
626
|
-
//# sourceMappingURL=doctor-
|
|
626
|
+
//# sourceMappingURL=doctor-3CUBPQKU.js.map
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
BaseAdapter,
|
|
10
10
|
renderCommandMd
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VVFDU4IX.js";
|
|
12
12
|
import {
|
|
13
13
|
buildWrappedStdio,
|
|
14
14
|
isHomeBinHookCommand
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-HORHRHNG.js";
|
|
16
|
+
import "./chunk-YYNXIUR2.js";
|
|
17
|
+
import "./chunk-IXOQDZWC.js";
|
|
18
18
|
|
|
19
19
|
// src/adapters/droid/index.ts
|
|
20
20
|
import { existsSync } from "fs";
|
|
@@ -649,4 +649,4 @@ export {
|
|
|
649
649
|
adapter,
|
|
650
650
|
droid_default as default
|
|
651
651
|
};
|
|
652
|
-
//# sourceMappingURL=droid-
|
|
652
|
+
//# sourceMappingURL=droid-PTCH2K7Y.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
BaseAdapter,
|
|
13
13
|
renderSkillMd,
|
|
14
14
|
renderSubagentMd
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VVFDU4IX.js";
|
|
16
16
|
import {
|
|
17
17
|
buildHomeBinHookCommand,
|
|
18
18
|
buildUsageEventCommand,
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
isHomeBinHookCommand,
|
|
21
21
|
isHostNativeUsageEnabled,
|
|
22
22
|
isUsageEventCommand
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-HORHRHNG.js";
|
|
24
|
+
import "./chunk-YYNXIUR2.js";
|
|
25
|
+
import "./chunk-IXOQDZWC.js";
|
|
26
26
|
|
|
27
27
|
// src/adapters/gemini-cli/index.ts
|
|
28
28
|
import { existsSync } from "fs";
|
|
@@ -770,4 +770,4 @@ export {
|
|
|
770
770
|
adapter,
|
|
771
771
|
gemini_cli_default as default
|
|
772
772
|
};
|
|
773
|
-
//# sourceMappingURL=gemini-cli-
|
|
773
|
+
//# sourceMappingURL=gemini-cli-QGLN2UMS.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
readYaml,
|
|
4
4
|
yamlObjectMapCodec
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4NSU3KWX.js";
|
|
6
6
|
import {
|
|
7
7
|
roamingAppData
|
|
8
8
|
} from "./chunk-UM5S7DKK.js";
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
removeFromObjectMap,
|
|
18
18
|
renderSkillMd,
|
|
19
19
|
upsertInObjectMap
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VVFDU4IX.js";
|
|
21
21
|
import {
|
|
22
22
|
buildWrappedStdio,
|
|
23
23
|
isHomeBinHookCommand
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-HORHRHNG.js";
|
|
25
|
+
import "./chunk-YYNXIUR2.js";
|
|
26
|
+
import "./chunk-IXOQDZWC.js";
|
|
27
27
|
|
|
28
28
|
// src/adapters/goose/index.ts
|
|
29
29
|
import { existsSync } from "fs";
|
|
@@ -603,4 +603,4 @@ export {
|
|
|
603
603
|
adapter,
|
|
604
604
|
goose_default as default
|
|
605
605
|
};
|
|
606
|
-
//# sourceMappingURL=goose-
|
|
606
|
+
//# sourceMappingURL=goose-DQ6GSZ5O.js.map
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
normalizeSessionSource
|
|
4
|
+
} from "./chunk-H53QZQJI.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveEnvRefsDeep
|
|
7
|
+
} from "./chunk-BEFVJ2OE.js";
|
|
8
|
+
import {
|
|
9
|
+
BaseAdapter
|
|
10
|
+
} from "./chunk-VVFDU4IX.js";
|
|
11
|
+
import {
|
|
12
|
+
buildWrappedStdio,
|
|
13
|
+
isHomeBinHookCommand
|
|
14
|
+
} from "./chunk-HORHRHNG.js";
|
|
15
|
+
import "./chunk-YYNXIUR2.js";
|
|
16
|
+
import "./chunk-IXOQDZWC.js";
|
|
17
|
+
|
|
18
|
+
// src/adapters/grok-cli/index.ts
|
|
19
|
+
import { existsSync } from "fs";
|
|
20
|
+
import { homedir } from "os";
|
|
21
|
+
import { join } from "path";
|
|
22
|
+
var HOST = "grok-cli";
|
|
23
|
+
var SUPPORTED_EVENTS = /* @__PURE__ */ new Set([
|
|
24
|
+
"PreToolUse",
|
|
25
|
+
"PostToolUse",
|
|
26
|
+
"PostToolUseFailure",
|
|
27
|
+
"UserPromptSubmit",
|
|
28
|
+
"SessionStart",
|
|
29
|
+
"SessionEnd",
|
|
30
|
+
"Stop",
|
|
31
|
+
"SubagentStart",
|
|
32
|
+
"SubagentStop",
|
|
33
|
+
"PreCompact",
|
|
34
|
+
"PostCompact",
|
|
35
|
+
"Notification"
|
|
36
|
+
]);
|
|
37
|
+
var GrokCliAdapter = class extends BaseAdapter {
|
|
38
|
+
id = HOST;
|
|
39
|
+
name = "Grok CLI";
|
|
40
|
+
paradigm = "json-stdio";
|
|
41
|
+
capabilities = {
|
|
42
|
+
// Memory surface: Grok reads AGENTS.md ("merged from git root down to your
|
|
43
|
+
// cwd; AGENTS.override.md wins per directory" — README). The BaseAdapter
|
|
44
|
+
// AGENTS.md-first default handles it.
|
|
45
|
+
supportsMemory: true,
|
|
46
|
+
preToolUse: true,
|
|
47
|
+
postToolUse: true,
|
|
48
|
+
postToolUseFailure: true,
|
|
49
|
+
userPromptSubmit: true,
|
|
50
|
+
sessionStart: true,
|
|
51
|
+
sessionEnd: true,
|
|
52
|
+
stop: true,
|
|
53
|
+
notification: true,
|
|
54
|
+
preCompact: true,
|
|
55
|
+
// Grok fires PostCompact (its HOOK_EVENTS lists it beside PreCompact).
|
|
56
|
+
postCompact: true,
|
|
57
|
+
// Grok fires SubagentStart AND SubagentStop (both in HOOK_EVENTS).
|
|
58
|
+
subagentStart: true,
|
|
59
|
+
subagentStop: true,
|
|
60
|
+
// No PermissionRequest event in Grok's HOOK_EVENTS → warn/skip at install.
|
|
61
|
+
// Grok's reply protocol is block/approve/context only — it cannot rewrite
|
|
62
|
+
// tool args or already-emitted output.
|
|
63
|
+
canModifyArgs: false,
|
|
64
|
+
canModifyOutput: false,
|
|
65
|
+
// Grok injects `additionalContext` from a hook's stdout JSON.
|
|
66
|
+
canInjectSessionContext: true,
|
|
67
|
+
// Grok's settings.json hook keys are free-form event names (its HOOK_EVENTS
|
|
68
|
+
// superset includes StopFailure/TaskCreated/TaskCompleted/InstructionsLoaded/
|
|
69
|
+
// CwdChanged with no canonical analog), so any host event declared under
|
|
70
|
+
// platforms["grok-cli"].nativeHooks installs verbatim.
|
|
71
|
+
supportsNativeHooks: true,
|
|
72
|
+
// MCP entry supports stdio + remote (http / sse) per McpServerConfig.transport.
|
|
73
|
+
transports: ["stdio", "http", "sse"]
|
|
74
|
+
};
|
|
75
|
+
// ── Detection ────────────────────────────────────────────────────────────
|
|
76
|
+
detectInstalled(_projectDir) {
|
|
77
|
+
const userDir = join(homedir(), ".grok");
|
|
78
|
+
const userSettings = join(userDir, "user-settings.json");
|
|
79
|
+
const installed = existsSync(userDir) || existsSync(userSettings);
|
|
80
|
+
return {
|
|
81
|
+
id: this.id,
|
|
82
|
+
name: this.name,
|
|
83
|
+
installed,
|
|
84
|
+
paradigm: this.paradigm,
|
|
85
|
+
capabilities: this.capabilities,
|
|
86
|
+
// MCP + hooks both live in user-settings.json (user scope only).
|
|
87
|
+
configPath: userSettings,
|
|
88
|
+
scope: "user",
|
|
89
|
+
reason: installed ? `found Grok CLI config at ${userSettings}` : `no Grok CLI config at ${userDir}`,
|
|
90
|
+
confidence: installed ? "high" : "low"
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// ── Native paths ───────────────────────────────────────────────────────────
|
|
94
|
+
// BOTH MCP servers (mcp.servers array) and hooks (top-level hooks map) live in
|
|
95
|
+
// the SAME user-settings.json. Project .grok/settings.json holds neither, so
|
|
96
|
+
// every scope resolves to the user file.
|
|
97
|
+
getConfigDir(_ctx) {
|
|
98
|
+
return join(homedir(), ".grok");
|
|
99
|
+
}
|
|
100
|
+
getServerConfigPath(ctx) {
|
|
101
|
+
return join(this.getConfigDir(ctx), "user-settings.json");
|
|
102
|
+
}
|
|
103
|
+
getHookConfigPath(ctx) {
|
|
104
|
+
return join(this.getConfigDir(ctx), "user-settings.json");
|
|
105
|
+
}
|
|
106
|
+
// ── MCP server install / uninstall (JSON — nested mcp.servers ARRAY) ───────
|
|
107
|
+
installServer(ctx) {
|
|
108
|
+
const { connector, dryRun } = ctx;
|
|
109
|
+
const path = this.getServerConfigPath(ctx);
|
|
110
|
+
const override = connector.platforms[HOST]?.server;
|
|
111
|
+
if (!connector.server || override === false) {
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
platform: this.id,
|
|
115
|
+
action: "skip",
|
|
116
|
+
path,
|
|
117
|
+
detail: connector.server ? "server registration disabled for grok-cli" : "connector declares no MCP server"
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
const symlink = this.symlinkPathWarning(path);
|
|
122
|
+
if (symlink) return [symlink];
|
|
123
|
+
const server = override && typeof override === "object" ? { ...connector.server, ...override } : connector.server;
|
|
124
|
+
const entry = this.renderServerEntry(ctx, server);
|
|
125
|
+
if (this.isPresentButUnparseable(path)) {
|
|
126
|
+
return [
|
|
127
|
+
{
|
|
128
|
+
platform: this.id,
|
|
129
|
+
action: "warn",
|
|
130
|
+
path,
|
|
131
|
+
detail: `existing ${path} is not parseable; left untouched (back it up / fix it, then re-run)`
|
|
132
|
+
}
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
const cfg = this.readJson(path) ?? {};
|
|
136
|
+
const existingMcp = cfg.mcp;
|
|
137
|
+
if (existingMcp !== void 0 && (typeof existingMcp !== "object" || Array.isArray(existingMcp))) {
|
|
138
|
+
return [{ platform: this.id, action: "warn", path, detail: "mcp is not an object \u2014 left untouched (manual fix needed)" }];
|
|
139
|
+
}
|
|
140
|
+
const existingServers = existingMcp?.servers;
|
|
141
|
+
if (existingServers !== void 0 && !Array.isArray(existingServers)) {
|
|
142
|
+
return [{ platform: this.id, action: "warn", path, detail: "mcp.servers is not an array \u2014 left untouched (manual fix needed)" }];
|
|
143
|
+
}
|
|
144
|
+
const list = Array.isArray(existingServers) ? [...existingServers] : [];
|
|
145
|
+
const idx = list.findIndex((e) => e?.id === connector.id);
|
|
146
|
+
let action;
|
|
147
|
+
if (idx < 0) {
|
|
148
|
+
list.push(entry);
|
|
149
|
+
action = "create";
|
|
150
|
+
} else if (JSON.stringify(list[idx]) === JSON.stringify(entry)) {
|
|
151
|
+
action = "skip";
|
|
152
|
+
} else {
|
|
153
|
+
list[idx] = entry;
|
|
154
|
+
action = "update";
|
|
155
|
+
}
|
|
156
|
+
if (action !== "skip") {
|
|
157
|
+
cfg.mcp = { ...existingMcp ?? {}, servers: list };
|
|
158
|
+
this.writeJson(path, cfg, dryRun);
|
|
159
|
+
}
|
|
160
|
+
return [{ platform: this.id, action, path, detail: `mcp.servers[id=${connector.id}]` }];
|
|
161
|
+
}
|
|
162
|
+
uninstallServer(ctx) {
|
|
163
|
+
const { connector, dryRun } = ctx;
|
|
164
|
+
const path = this.getServerConfigPath(ctx);
|
|
165
|
+
const symlink = this.symlinkPathWarning(path);
|
|
166
|
+
if (symlink) return [symlink];
|
|
167
|
+
const cfg = this.readJson(path);
|
|
168
|
+
const rawList = cfg?.mcp?.servers;
|
|
169
|
+
if (!cfg || !Array.isArray(rawList)) {
|
|
170
|
+
return [{ platform: this.id, action: "skip", path, detail: `mcp.servers[id=${connector.id}] absent` }];
|
|
171
|
+
}
|
|
172
|
+
const list = rawList;
|
|
173
|
+
const kept = list.filter((e) => e?.id !== connector.id);
|
|
174
|
+
if (kept.length === list.length) {
|
|
175
|
+
return [{ platform: this.id, action: "skip", path, detail: `mcp.servers[id=${connector.id}] absent` }];
|
|
176
|
+
}
|
|
177
|
+
cfg.mcp = { ...cfg.mcp, servers: kept };
|
|
178
|
+
this.writeJson(path, cfg, dryRun);
|
|
179
|
+
return [{ platform: this.id, action: "remove", path, detail: `mcp.servers[id=${connector.id}]` }];
|
|
180
|
+
}
|
|
181
|
+
/** Render a normalized ServerDef into Grok's native McpServerConfig entry. */
|
|
182
|
+
renderServerEntry(ctx, server) {
|
|
183
|
+
const transport = server.transport;
|
|
184
|
+
const enabled = server.enabled !== false;
|
|
185
|
+
const id = ctx.connector.id;
|
|
186
|
+
const label = ctx.connector.displayName?.trim() || id;
|
|
187
|
+
if (transport === "stdio") {
|
|
188
|
+
let command = server.command ?? "";
|
|
189
|
+
let args = [...server.args ?? []];
|
|
190
|
+
({ command, args } = buildWrappedStdio(ctx, server, this.id, command, args));
|
|
191
|
+
const entry2 = {
|
|
192
|
+
id,
|
|
193
|
+
label,
|
|
194
|
+
enabled,
|
|
195
|
+
transport: "stdio",
|
|
196
|
+
command: resolveEnvRefsDeep(command)
|
|
197
|
+
};
|
|
198
|
+
if (args.length > 0) entry2.args = resolveEnvRefsDeep(args);
|
|
199
|
+
const env = this.renderEnv(server.env);
|
|
200
|
+
if (env) entry2.env = env;
|
|
201
|
+
if (typeof server.cwd === "string" && server.cwd.length > 0) {
|
|
202
|
+
entry2.cwd = resolveEnvRefsDeep(server.cwd);
|
|
203
|
+
}
|
|
204
|
+
return entry2;
|
|
205
|
+
}
|
|
206
|
+
const entry = {
|
|
207
|
+
id,
|
|
208
|
+
label,
|
|
209
|
+
enabled,
|
|
210
|
+
transport: transport === "sse" ? "sse" : "http",
|
|
211
|
+
url: resolveEnvRefsDeep(server.url ?? "")
|
|
212
|
+
};
|
|
213
|
+
const headers = this.renderEnv(server.headers);
|
|
214
|
+
if (headers) entry.headers = headers;
|
|
215
|
+
return entry;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Render env/header values. Grok documents no native ${VAR} server
|
|
219
|
+
* interpolation, so resolve `${env:VAR}` references to literals at install
|
|
220
|
+
* time (the safe path; matches continue/droid).
|
|
221
|
+
*/
|
|
222
|
+
renderEnv(env) {
|
|
223
|
+
if (!env || Object.keys(env).length === 0) return void 0;
|
|
224
|
+
return resolveEnvRefsDeep({ ...env });
|
|
225
|
+
}
|
|
226
|
+
// ── Hook install / uninstall (top-level hooks, Claude nested-rule shape) ───
|
|
227
|
+
installHooks(ctx) {
|
|
228
|
+
const { connector } = ctx;
|
|
229
|
+
const override = connector.platforms[HOST];
|
|
230
|
+
const normalizedEvents = override?.hooks === false ? [] : connector.hookEvents;
|
|
231
|
+
const nativeHooks = override?.nativeHooks ?? {};
|
|
232
|
+
const nativeEvents = Object.keys(nativeHooks);
|
|
233
|
+
if (normalizedEvents.length === 0 && nativeEvents.length === 0) {
|
|
234
|
+
return [
|
|
235
|
+
{
|
|
236
|
+
platform: this.id,
|
|
237
|
+
action: "skip",
|
|
238
|
+
detail: override?.hooks === false ? "hooks disabled for grok-cli" : "connector declares no hooks"
|
|
239
|
+
}
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
const pending = normalizedEvents.map((event) => ({
|
|
243
|
+
event,
|
|
244
|
+
matcher: connector.hooks[event]?.matcher ?? ""
|
|
245
|
+
}));
|
|
246
|
+
const native = nativeEvents.map((event) => ({
|
|
247
|
+
event,
|
|
248
|
+
matcher: nativeHooks[event]?.matcher ?? ""
|
|
249
|
+
}));
|
|
250
|
+
return this.upsertHookEntries(
|
|
251
|
+
ctx,
|
|
252
|
+
this.getHookConfigPath(ctx),
|
|
253
|
+
pending,
|
|
254
|
+
this.hookDescriptor(ctx),
|
|
255
|
+
native
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
uninstallHooks(ctx) {
|
|
259
|
+
return this.removeHookEntries(ctx, this.getHookConfigPath(ctx), this.hookDescriptor(ctx));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Grok's hook-merge descriptor (NESTED shape `{ matcher?, hooks: [...] }`).
|
|
263
|
+
* Connector-generic ownership (any of our home-bin commands in the inner
|
|
264
|
+
* `hooks`), matching droid:
|
|
265
|
+
* - mapEvent drops events outside SUPPORTED_EVENTS (Grok has no
|
|
266
|
+
* PermissionRequest); supported events map 1:1 (PascalCase identical);
|
|
267
|
+
* - the native pass installs free-form host-only event keys verbatim;
|
|
268
|
+
* - uninstall = inner-strip ONLY (ownsEntryForRemove never-true).
|
|
269
|
+
*/
|
|
270
|
+
hookDescriptor(ctx) {
|
|
271
|
+
const stripInner = (c) => (entry) => {
|
|
272
|
+
const innerBefore = entry.hooks?.length ?? 0;
|
|
273
|
+
const inner = (entry.hooks ?? []).filter((h) => !this.isOurCommand(h.command, c));
|
|
274
|
+
return {
|
|
275
|
+
next: inner.length > 0 ? { matcher: entry.matcher ?? "", hooks: inner } : null,
|
|
276
|
+
removed: innerBefore - inner.length
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
return {
|
|
280
|
+
mapEvent: (e) => SUPPORTED_EVENTS.has(e) ? e : void 0,
|
|
281
|
+
unmappedWarnDetail: (e) => `${e} has no Grok CLI hook equivalent \u2014 skipped`,
|
|
282
|
+
renderEntry: (_event, matcher, command) => ({
|
|
283
|
+
matcher,
|
|
284
|
+
hooks: [{ type: "command", command }]
|
|
285
|
+
}),
|
|
286
|
+
entryOwnsCommand: (entry, _command) => (entry.hooks ?? []).some((h) => this.isOurCommand(h.command, ctx)),
|
|
287
|
+
nativeOwnsCommand: (entry, command) => (entry.hooks ?? []).some((h) => h.command === command),
|
|
288
|
+
ownsEntryForRemove: () => () => false,
|
|
289
|
+
stripInner,
|
|
290
|
+
skipDetail: (event) => `hooks.${event} already registered`,
|
|
291
|
+
removeDetail: (event, removed) => `hooks.${event} (${removed})`,
|
|
292
|
+
nativeSkipDetail: (event) => `hooks.${event} already registered (native)`,
|
|
293
|
+
nativeMutateDetail: (event) => `hooks.${event} (native)`,
|
|
294
|
+
absentDetail: "no hooks section present",
|
|
295
|
+
noMatchDetail: "no matching hook entries"
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/** True when a hook command references our home binary AND this connector id. */
|
|
299
|
+
isOurCommand(command, ctx) {
|
|
300
|
+
return isHomeBinHookCommand(command, ctx.homeBinPath, ctx.connector.id);
|
|
301
|
+
}
|
|
302
|
+
// ── Diagnostics ──────────────────────────────────────────────────────────
|
|
303
|
+
getHealthChecks(ctx) {
|
|
304
|
+
const path = this.getServerConfigPath(ctx);
|
|
305
|
+
const connectorId = ctx.connector.id;
|
|
306
|
+
const homeBin = ctx.homeBinPath;
|
|
307
|
+
const hookEvents = ctx.connector.hookEvents;
|
|
308
|
+
return [
|
|
309
|
+
{
|
|
310
|
+
name: `${this.name}: user-settings.json present`,
|
|
311
|
+
check: () => existsSync(path) ? { status: "OK", detail: path } : { status: "FAIL", detail: `not found: ${path}` }
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: `${this.name}: server entry registered`,
|
|
315
|
+
check: () => {
|
|
316
|
+
if (!ctx.connector.server) {
|
|
317
|
+
return { status: "OK", detail: "no MCP server declared" };
|
|
318
|
+
}
|
|
319
|
+
const cfg = this.readJson(path);
|
|
320
|
+
const list = cfg?.mcp?.servers;
|
|
321
|
+
if (!cfg || !Array.isArray(list)) {
|
|
322
|
+
return { status: "FAIL", detail: `no mcp.servers array in ${path}` };
|
|
323
|
+
}
|
|
324
|
+
return list.some((e) => e?.id === connectorId) ? { status: "OK", detail: `mcp.servers[id=${connectorId}] present` } : { status: "FAIL", detail: `no mcp.servers[id=${connectorId}] in ${path}` };
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: `${this.name}: hook command registered`,
|
|
329
|
+
check: () => {
|
|
330
|
+
if (hookEvents.length === 0) {
|
|
331
|
+
return { status: "OK", detail: "no hooks declared" };
|
|
332
|
+
}
|
|
333
|
+
const cfg = this.readJson(path);
|
|
334
|
+
const hooks = cfg?.hooks ?? {};
|
|
335
|
+
const registered = Object.values(hooks).some(
|
|
336
|
+
(entries) => (entries ?? []).some(
|
|
337
|
+
(e) => (e.hooks ?? []).some((h) => isHomeBinHookCommand(h.command, homeBin, connectorId))
|
|
338
|
+
)
|
|
339
|
+
);
|
|
340
|
+
return registered ? { status: "OK", detail: "hook command present" } : { status: "FAIL", detail: `no hook for ${connectorId} in ${path}` };
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
}
|
|
345
|
+
// ── Runtime: parse Grok stdin JSON → normalized event ──────────────────────
|
|
346
|
+
parseEvent(event, raw) {
|
|
347
|
+
const input = raw ?? {};
|
|
348
|
+
const connectorId = typeof input.connector === "string" ? input.connector : "";
|
|
349
|
+
const sessionId = typeof input.session_id === "string" ? input.session_id : "";
|
|
350
|
+
const projectDir = typeof input.cwd === "string" ? input.cwd : void 0;
|
|
351
|
+
const base = {
|
|
352
|
+
hostPlatform: HOST,
|
|
353
|
+
connectorId,
|
|
354
|
+
sessionId,
|
|
355
|
+
raw,
|
|
356
|
+
...projectDir !== void 0 ? { projectDir } : {}
|
|
357
|
+
};
|
|
358
|
+
switch (event) {
|
|
359
|
+
case "PreToolUse": {
|
|
360
|
+
const ev = {
|
|
361
|
+
...base,
|
|
362
|
+
toolName: typeof input.tool_name === "string" ? input.tool_name : "",
|
|
363
|
+
toolInput: input.tool_input ?? {}
|
|
364
|
+
};
|
|
365
|
+
return ev;
|
|
366
|
+
}
|
|
367
|
+
case "PostToolUse": {
|
|
368
|
+
const ev = {
|
|
369
|
+
...base,
|
|
370
|
+
toolName: typeof input.tool_name === "string" ? input.tool_name : "",
|
|
371
|
+
toolInput: input.tool_input ?? {},
|
|
372
|
+
...toolOutputToString(input.tool_output) !== void 0 ? { toolOutput: toolOutputToString(input.tool_output) } : {}
|
|
373
|
+
};
|
|
374
|
+
return ev;
|
|
375
|
+
}
|
|
376
|
+
case "PostToolUseFailure": {
|
|
377
|
+
const ev = {
|
|
378
|
+
...base,
|
|
379
|
+
toolName: typeof input.tool_name === "string" ? input.tool_name : "",
|
|
380
|
+
toolInput: input.tool_input ?? {},
|
|
381
|
+
error: typeof input.error === "string" ? input.error : ""
|
|
382
|
+
};
|
|
383
|
+
return ev;
|
|
384
|
+
}
|
|
385
|
+
case "UserPromptSubmit": {
|
|
386
|
+
const ev = {
|
|
387
|
+
...base,
|
|
388
|
+
prompt: typeof input.user_prompt === "string" ? input.user_prompt : ""
|
|
389
|
+
};
|
|
390
|
+
return ev;
|
|
391
|
+
}
|
|
392
|
+
case "SessionStart": {
|
|
393
|
+
const ev = {
|
|
394
|
+
...base,
|
|
395
|
+
source: normalizeSessionSource(input.source)
|
|
396
|
+
};
|
|
397
|
+
return ev;
|
|
398
|
+
}
|
|
399
|
+
case "SessionEnd": {
|
|
400
|
+
const ev = { ...base };
|
|
401
|
+
return ev;
|
|
402
|
+
}
|
|
403
|
+
case "Stop": {
|
|
404
|
+
const ev = { ...base };
|
|
405
|
+
return ev;
|
|
406
|
+
}
|
|
407
|
+
case "Notification": {
|
|
408
|
+
const ev = {
|
|
409
|
+
...base,
|
|
410
|
+
message: typeof input.message === "string" ? input.message : ""
|
|
411
|
+
};
|
|
412
|
+
return ev;
|
|
413
|
+
}
|
|
414
|
+
case "PreCompact": {
|
|
415
|
+
const ev = {
|
|
416
|
+
...base,
|
|
417
|
+
...input.trigger === "auto" || input.trigger === "manual" ? { trigger: input.trigger } : {}
|
|
418
|
+
};
|
|
419
|
+
return ev;
|
|
420
|
+
}
|
|
421
|
+
case "PostCompact": {
|
|
422
|
+
const ev = {
|
|
423
|
+
...base,
|
|
424
|
+
...input.trigger === "auto" || input.trigger === "manual" ? { trigger: input.trigger } : {}
|
|
425
|
+
};
|
|
426
|
+
return ev;
|
|
427
|
+
}
|
|
428
|
+
case "SubagentStart": {
|
|
429
|
+
const ev = {
|
|
430
|
+
...base,
|
|
431
|
+
...typeof input.agent_type === "string" ? { agentType: input.agent_type } : {}
|
|
432
|
+
};
|
|
433
|
+
return ev;
|
|
434
|
+
}
|
|
435
|
+
case "SubagentStop": {
|
|
436
|
+
const ev = {
|
|
437
|
+
...base,
|
|
438
|
+
...typeof input.agent_type === "string" ? { agentType: input.agent_type } : {}
|
|
439
|
+
};
|
|
440
|
+
return ev;
|
|
441
|
+
}
|
|
442
|
+
default: {
|
|
443
|
+
throw new Error(`unsupported grok-cli hook event: ${String(event)}`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
// ── Runtime: normalized response → Grok native hook reply ──────────────────
|
|
448
|
+
// Grok parses stdout as JSON when it starts with `{` and aggregates:
|
|
449
|
+
// decision:"block" (or exit 2) → block; decision:"approve" → approve;
|
|
450
|
+
// additionalContext → injected context; continue:false + stopReason → halt.
|
|
451
|
+
// We emit exit 0 + a structured stdout object so the JSON is always parsed.
|
|
452
|
+
formatReply(_event, response) {
|
|
453
|
+
const decision = response.decision ?? "allow";
|
|
454
|
+
if (decision === "deny") {
|
|
455
|
+
return this.stdout({ decision: "block", reason: response.reason ?? "Blocked by hook" });
|
|
456
|
+
}
|
|
457
|
+
if (decision === "context" && response.additionalContext) {
|
|
458
|
+
return this.stdout({ additionalContext: response.additionalContext });
|
|
459
|
+
}
|
|
460
|
+
return { exitCode: 0 };
|
|
461
|
+
}
|
|
462
|
+
stdout(payload) {
|
|
463
|
+
return { exitCode: 0, stdout: JSON.stringify(payload) };
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
function toolOutputToString(value) {
|
|
467
|
+
if (value == null) return void 0;
|
|
468
|
+
if (typeof value === "string") return value;
|
|
469
|
+
try {
|
|
470
|
+
return JSON.stringify(value);
|
|
471
|
+
} catch {
|
|
472
|
+
return String(value);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
var adapter = new GrokCliAdapter();
|
|
476
|
+
var grok_cli_default = adapter;
|
|
477
|
+
export {
|
|
478
|
+
GrokCliAdapter,
|
|
479
|
+
adapter,
|
|
480
|
+
grok_cli_default as default
|
|
481
|
+
};
|
|
482
|
+
//# sourceMappingURL=grok-cli-5QD235UB.js.map
|