@ken-jo/agent-connector 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -14
- package/dist/action-PLZW5BGX.js +54 -0
- package/dist/action-PLZW5BGX.js.map +1 -0
- package/dist/{amp-YGV66GJT.js → amp-B524U6LO.js} +81 -5
- package/dist/amp-B524U6LO.js.map +1 -0
- package/dist/{antigravity-7IBYFO6P.js → antigravity-ANDKF3K7.js} +4 -4
- package/dist/{antigravity-cli-JEOUP2VN.js → antigravity-cli-LLRPDDOT.js} +4 -4
- package/dist/chunk-22Y24V7O.js +21 -0
- package/dist/chunk-22Y24V7O.js.map +1 -0
- package/dist/chunk-3PFFTFCU.js +190 -0
- package/dist/chunk-3PFFTFCU.js.map +1 -0
- package/dist/{chunk-SCVBYSF7.js → chunk-6XHB6BE3.js} +1 -1
- package/dist/chunk-76FUSVIA.js +43 -0
- package/dist/chunk-76FUSVIA.js.map +1 -0
- package/dist/{chunk-GSGDG2BV.js → chunk-ADTHT2FN.js} +109 -16
- package/dist/chunk-ADTHT2FN.js.map +1 -0
- package/dist/{chunk-ZAM4M7LI.js → chunk-BHUCB6LY.js} +135 -296
- package/dist/chunk-BHUCB6LY.js.map +1 -0
- package/dist/{chunk-MEH7GC7R.js → chunk-BXGFUENQ.js} +20 -3
- package/dist/chunk-BXGFUENQ.js.map +1 -0
- package/dist/chunk-CIRDOY2V.js +351 -0
- package/dist/chunk-CIRDOY2V.js.map +1 -0
- package/dist/{chunk-KMAKDD3Z.js → chunk-G3ER4SY5.js} +37 -12
- package/dist/chunk-G3ER4SY5.js.map +1 -0
- package/dist/{chunk-PD4VFEBY.js → chunk-IW77FFNX.js} +39 -1
- package/dist/chunk-IW77FFNX.js.map +1 -0
- package/dist/chunk-J3D5W5T2.js +83 -0
- package/dist/chunk-J3D5W5T2.js.map +1 -0
- package/dist/{openclaw-UZ5BMCGQ.js → chunk-KGGBNKI4.js} +125 -33
- package/dist/chunk-KGGBNKI4.js.map +1 -0
- package/dist/{chunk-3JCRUROU.js → chunk-KGJWE6A2.js} +13 -4
- package/dist/chunk-KGJWE6A2.js.map +1 -0
- package/dist/{chunk-3RBLIHPZ.js → chunk-KGXDYGNJ.js} +26 -16
- package/dist/chunk-KGXDYGNJ.js.map +1 -0
- package/dist/{chunk-KVAAFYRR.js → chunk-KHO5WNTP.js} +2 -18
- package/dist/chunk-KHO5WNTP.js.map +1 -0
- package/dist/{chunk-KQSNDFBN.js → chunk-LL4OBGRU.js} +3 -3
- package/dist/{chunk-WNREHWKL.js → chunk-MAH6QQTO.js} +3 -3
- package/dist/{claude-code-4275HQU4.js → claude-code-MLWS7CW6.js} +180 -28
- package/dist/claude-code-MLWS7CW6.js.map +1 -0
- package/dist/cli/sdk.js +4 -3
- package/dist/cli/sdk.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/{codebuff-LE3KBZGM.js → codebuff-SH2S3QAN.js} +102 -5
- package/dist/codebuff-SH2S3QAN.js.map +1 -0
- package/dist/{codex-4BY2ZJIW.js → codex-BXA4FIF4.js} +3 -3
- package/dist/{copilot-cli-IPISKO3V.js → copilot-cli-ROIBTTDT.js} +3 -3
- package/dist/{crush-X3E25EQG.js → crush-QLEFLHUC.js} +3 -3
- package/dist/{cursor-UH3W622V.js → cursor-ASJPWZ4R.js} +6 -3
- package/dist/cursor-ASJPWZ4R.js.map +1 -0
- package/dist/{detect-U3E7NVNW.js → detect-ZIIS55LD.js} +4 -3
- package/dist/{detect-U3E7NVNW.js.map → detect-ZIIS55LD.js.map} +1 -1
- package/dist/{doctor-DZTWED4O.js → doctor-TJUGSQ5C.js} +16 -12
- package/dist/doctor-TJUGSQ5C.js.map +1 -0
- package/dist/{droid-T5VBRXZF.js → droid-NCSS3B5Y.js} +170 -4
- package/dist/droid-NCSS3B5Y.js.map +1 -0
- package/dist/{gemini-cli-ZSUK55UA.js → gemini-cli-SLVWLXJW.js} +3 -3
- package/dist/{goose-M3RR3CZG.js → goose-PBA7KTE5.js} +100 -5
- package/dist/goose-PBA7KTE5.js.map +1 -0
- package/dist/{hermes-CUNKIAR5.js → hermes-ONDCECP2.js} +3 -3
- package/dist/{hook-EVY7LOUQ.js → hook-OU522ABV.js} +12 -9
- package/dist/{hook-EVY7LOUQ.js.map → hook-OU522ABV.js.map} +1 -1
- package/dist/index.d.ts +71 -3
- package/dist/index.js +22 -3
- package/dist/{install-OWAS5UIE.js → install-UDCBL7HP.js} +11 -9
- package/dist/{install-OWAS5UIE.js.map → install-UDCBL7HP.js.map} +1 -1
- package/dist/introspect-DuZSPSHB.d.ts +53 -0
- package/dist/{jetbrains-copilot-C3HDGGML.js → jetbrains-copilot-YABZ3HFA.js} +3 -3
- package/dist/{kilo-PKAJCWPX.js → kilo-F3ZDZKCT.js} +3 -3
- package/dist/{kilo-cli-QWUVXG2O.js → kilo-cli-3HWPWBY4.js} +3 -3
- package/dist/{kimi-EVD7YKXS.js → kimi-NV72FVAO.js} +3 -3
- package/dist/{kiro-UQRY6EIO.js → kiro-C5W6AGDR.js} +3 -3
- package/dist/{leaderboard-CSWHI4UY.js → leaderboard-TIBVONVT.js} +3 -3
- package/dist/mimo-code-IMM5YM3M.js +754 -0
- package/dist/mimo-code-IMM5YM3M.js.map +1 -0
- package/dist/{mux-5CI5FP2W.js → mux-DSSH4AFS.js} +3 -3
- package/dist/nemoclaw-3EVNKD3I.js +58 -0
- package/dist/nemoclaw-3EVNKD3I.js.map +1 -0
- package/dist/{omp-AXA7XY22.js → omp-Z6FRNDPN.js} +3 -3
- package/dist/openclaw-7G437NT7.js +18 -0
- package/dist/openclaw-7G437NT7.js.map +1 -0
- package/dist/{opencode-NZBRLJN3.js → opencode-Q6KBSAKW.js} +3 -3
- package/dist/{package-WFOS4QVU.js → package-RMPN57YZ.js} +7 -6
- package/dist/{package-WFOS4QVU.js.map → package-RMPN57YZ.js.map} +1 -1
- package/dist/{pi-WMTUX6ES.js → pi-LZT6WWAZ.js} +2 -2
- package/dist/{qwen-code-MRRIUQ3P.js → qwen-code-WQBKRPWJ.js} +3 -3
- package/dist/{roo-code-NI5UU6JB.js → roo-code-GWSNU3OW.js} +137 -4
- package/dist/roo-code-GWSNU3OW.js.map +1 -0
- package/dist/runtime/index.d.ts +96 -2
- package/dist/runtime/index.js +18 -10
- package/dist/sdk/index.d.ts +52 -0
- package/dist/sdk/index.js +81 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/test.d.ts +74 -0
- package/dist/sdk/test.js +291 -0
- package/dist/sdk/test.js.map +1 -0
- package/dist/{serve-3C2VFPAY.js → serve-D3GO36UT.js} +12 -9
- package/dist/{serve-3C2VFPAY.js.map → serve-D3GO36UT.js.map} +1 -1
- package/dist/{status-MKQYX5MW.js → status-KOSKCETC.js} +9 -7
- package/dist/{status-MKQYX5MW.js.map → status-KOSKCETC.js.map} +1 -1
- package/dist/statusline-ZNTCL5YC.js +59 -0
- package/dist/statusline-ZNTCL5YC.js.map +1 -0
- package/dist/{telemetry-3DN6XGYB.js → telemetry-XIKUUGTQ.js} +5 -4
- package/dist/{telemetry-3DN6XGYB.js.map → telemetry-XIKUUGTQ.js.map} +1 -1
- package/dist/{trae-CQC72RHH.js → trae-NWT3TMSZ.js} +99 -5
- package/dist/trae-NWT3TMSZ.js.map +1 -0
- package/dist/{types-CNigfEuR.d.ts → types-BEKsAium.d.ts} +268 -6
- package/dist/{uninstall-WG6PFWF3.js → uninstall-2LBLQVFA.js} +11 -9
- package/dist/{uninstall-WG6PFWF3.js.map → uninstall-2LBLQVFA.js.map} +1 -1
- package/dist/{upgrade-32NC2RKI.js → upgrade-ZC2S7VRN.js} +11 -9
- package/dist/{upgrade-32NC2RKI.js.map → upgrade-ZC2S7VRN.js.map} +1 -1
- package/dist/{usage-CJOM2WQM.js → usage-E2A4O2CY.js} +3 -3
- package/dist/{usage-event-472X3DOY.js → usage-event-JKMC4QC4.js} +11 -8
- package/dist/{usage-event-472X3DOY.js.map → usage-event-JKMC4QC4.js.map} +1 -1
- package/dist/{vscode-copilot-4RVRTCKV.js → vscode-copilot-ALV45XF6.js} +3 -3
- package/dist/{warp-X6MB67NT.js → warp-H6IX4U3J.js} +3 -3
- package/dist/{zed-NTCYW4V2.js → zed-RH34TNSW.js} +3 -3
- package/package.json +9 -1
- package/dist/amp-YGV66GJT.js.map +0 -1
- package/dist/chunk-3JCRUROU.js.map +0 -1
- package/dist/chunk-3RBLIHPZ.js.map +0 -1
- package/dist/chunk-GSGDG2BV.js.map +0 -1
- package/dist/chunk-KMAKDD3Z.js.map +0 -1
- package/dist/chunk-KVAAFYRR.js.map +0 -1
- package/dist/chunk-MEH7GC7R.js.map +0 -1
- package/dist/chunk-NJU275US.js +0 -238
- package/dist/chunk-NJU275US.js.map +0 -1
- package/dist/chunk-PD4VFEBY.js.map +0 -1
- package/dist/chunk-ZAM4M7LI.js.map +0 -1
- package/dist/claude-code-4275HQU4.js.map +0 -1
- package/dist/codebuff-LE3KBZGM.js.map +0 -1
- package/dist/cursor-UH3W622V.js.map +0 -1
- package/dist/doctor-DZTWED4O.js.map +0 -1
- package/dist/droid-T5VBRXZF.js.map +0 -1
- package/dist/goose-M3RR3CZG.js.map +0 -1
- package/dist/openclaw-UZ5BMCGQ.js.map +0 -1
- package/dist/roo-code-NI5UU6JB.js.map +0 -1
- package/dist/trae-CQC72RHH.js.map +0 -1
- /package/dist/{antigravity-7IBYFO6P.js.map → antigravity-ANDKF3K7.js.map} +0 -0
- /package/dist/{antigravity-cli-JEOUP2VN.js.map → antigravity-cli-LLRPDDOT.js.map} +0 -0
- /package/dist/{chunk-SCVBYSF7.js.map → chunk-6XHB6BE3.js.map} +0 -0
- /package/dist/{chunk-KQSNDFBN.js.map → chunk-LL4OBGRU.js.map} +0 -0
- /package/dist/{chunk-WNREHWKL.js.map → chunk-MAH6QQTO.js.map} +0 -0
- /package/dist/{codex-4BY2ZJIW.js.map → codex-BXA4FIF4.js.map} +0 -0
- /package/dist/{copilot-cli-IPISKO3V.js.map → copilot-cli-ROIBTTDT.js.map} +0 -0
- /package/dist/{crush-X3E25EQG.js.map → crush-QLEFLHUC.js.map} +0 -0
- /package/dist/{gemini-cli-ZSUK55UA.js.map → gemini-cli-SLVWLXJW.js.map} +0 -0
- /package/dist/{hermes-CUNKIAR5.js.map → hermes-ONDCECP2.js.map} +0 -0
- /package/dist/{jetbrains-copilot-C3HDGGML.js.map → jetbrains-copilot-YABZ3HFA.js.map} +0 -0
- /package/dist/{kilo-PKAJCWPX.js.map → kilo-F3ZDZKCT.js.map} +0 -0
- /package/dist/{kilo-cli-QWUVXG2O.js.map → kilo-cli-3HWPWBY4.js.map} +0 -0
- /package/dist/{kimi-EVD7YKXS.js.map → kimi-NV72FVAO.js.map} +0 -0
- /package/dist/{kiro-UQRY6EIO.js.map → kiro-C5W6AGDR.js.map} +0 -0
- /package/dist/{leaderboard-CSWHI4UY.js.map → leaderboard-TIBVONVT.js.map} +0 -0
- /package/dist/{mux-5CI5FP2W.js.map → mux-DSSH4AFS.js.map} +0 -0
- /package/dist/{omp-AXA7XY22.js.map → omp-Z6FRNDPN.js.map} +0 -0
- /package/dist/{opencode-NZBRLJN3.js.map → opencode-Q6KBSAKW.js.map} +0 -0
- /package/dist/{pi-WMTUX6ES.js.map → pi-LZT6WWAZ.js.map} +0 -0
- /package/dist/{qwen-code-MRRIUQ3P.js.map → qwen-code-WQBKRPWJ.js.map} +0 -0
- /package/dist/{usage-CJOM2WQM.js.map → usage-E2A4O2CY.js.map} +0 -0
- /package/dist/{vscode-copilot-4RVRTCKV.js.map → vscode-copilot-ALV45XF6.js.map} +0 -0
- /package/dist/{warp-X6MB67NT.js.map → warp-H6IX4U3J.js.map} +0 -0
- /package/dist/{zed-NTCYW4V2.js.map → zed-RH34TNSW.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readRegisteredMeta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KGJWE6A2.js";
|
|
5
5
|
import {
|
|
6
6
|
addLedgerOwner,
|
|
7
7
|
configPatchManualEdit,
|
|
@@ -17,14 +17,15 @@ import {
|
|
|
17
17
|
loadConfigPatchLedger,
|
|
18
18
|
removeLedgerOwner,
|
|
19
19
|
saveConfigPatchLedger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ADTHT2FN.js";
|
|
21
|
+
import "./chunk-3PFFTFCU.js";
|
|
21
22
|
import {
|
|
22
23
|
resolveEnvRefsDeep,
|
|
23
24
|
rewriteEnvRefs
|
|
24
25
|
} from "./chunk-DBQMX75U.js";
|
|
25
26
|
import {
|
|
26
27
|
BaseAdapter
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-IW77FFNX.js";
|
|
28
29
|
import {
|
|
29
30
|
renderCommandMd,
|
|
30
31
|
renderSkillMd,
|
|
@@ -32,10 +33,12 @@ import {
|
|
|
32
33
|
} from "./chunk-7L6ITC4T.js";
|
|
33
34
|
import {
|
|
34
35
|
buildHomeBinHookCommand,
|
|
36
|
+
buildHomeBinStatuslineCommand,
|
|
35
37
|
buildServeWrapperCommand,
|
|
36
38
|
isHomeBinHookCommand,
|
|
39
|
+
isHomeBinStatuslineCommand,
|
|
37
40
|
shouldWrapForTelemetry
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-BXGFUENQ.js";
|
|
39
42
|
import {
|
|
40
43
|
linesOutsideFences,
|
|
41
44
|
listManagedBlocks,
|
|
@@ -80,6 +83,7 @@ function toolResponseToString(value) {
|
|
|
80
83
|
// src/adapters/claude-code/index.ts
|
|
81
84
|
var HOST = "claude-code";
|
|
82
85
|
var MCP_ROOT_KEY = "mcpServers";
|
|
86
|
+
var STATUSLINE_KEY = "statusLine";
|
|
83
87
|
var CLAUDE_AGENTS_IMPORT_BLOCK_ID = "_shared/claude-agents-import";
|
|
84
88
|
var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
85
89
|
id = HOST;
|
|
@@ -112,6 +116,11 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
112
116
|
// (set-if-absent leaf keys in settings.json, refcounted ownership ledger,
|
|
113
117
|
// sensitive-key denylist — see SENSITIVE_KEY_RULES below).
|
|
114
118
|
supportsConfigPatch: true,
|
|
119
|
+
// Statusline surface: claude-code is the ONLY v1 host. installStatusline
|
|
120
|
+
// wires settings.json.statusLine = {type:"command", command:<home-bin
|
|
121
|
+
// statusline cmd>} through the SAME set-if-absent ownership ledger as
|
|
122
|
+
// configPatch (never clobbers a statusLine agent-connector does not own).
|
|
123
|
+
supportsStatusline: true,
|
|
115
124
|
transports: ["stdio", "http"],
|
|
116
125
|
// Content surfaces: Claude Code is the reference implementation for all three.
|
|
117
126
|
supportsCommands: true,
|
|
@@ -374,6 +383,20 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
374
383
|
{ platform: this.id, action: "skip", detail: "connector declares no configPatch entries" }
|
|
375
384
|
];
|
|
376
385
|
}
|
|
386
|
+
return this.applyConfigPatches(ctx, patches);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* The shared set-if-absent / ownership-ledger apply loop behind BOTH
|
|
390
|
+
* {@link installConfigPatches} and {@link installStatusline}. Routing the
|
|
391
|
+
* statusline through the EXACT same path is how a connector's statusLine
|
|
392
|
+
* inherits the configPatch contract verbatim: never clobber a statusLine
|
|
393
|
+
* agent-connector does not own (skip-warn), record prior state + owner,
|
|
394
|
+
* refcounted across connectors, reversible by uninstallConfigPatches.
|
|
395
|
+
*/
|
|
396
|
+
applyConfigPatches(ctx, patches, opts = {}) {
|
|
397
|
+
const surfaceLabel = opts.surfaceLabel ?? "configPatch";
|
|
398
|
+
const internal = surfaceLabel !== "configPatch";
|
|
399
|
+
const { connector } = ctx;
|
|
377
400
|
const filePath = this.getPatchableConfigPath(ctx);
|
|
378
401
|
if (this.isPresentButUnparseable(filePath)) {
|
|
379
402
|
return [
|
|
@@ -409,14 +432,16 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
409
432
|
});
|
|
410
433
|
continue;
|
|
411
434
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
435
|
+
if (!internal) {
|
|
436
|
+
const namespace = configPatchNamespaceViolation(patch.key);
|
|
437
|
+
if (namespace) {
|
|
438
|
+
changes.push({
|
|
439
|
+
platform: this.id,
|
|
440
|
+
action: "warn",
|
|
441
|
+
detail: `configPatch refused: ${namespace}`
|
|
442
|
+
});
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
420
445
|
}
|
|
421
446
|
const sensitive = claudeSensitiveKeyViolation(patch.key);
|
|
422
447
|
if (sensitive) {
|
|
@@ -436,7 +461,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
436
461
|
platform: this.id,
|
|
437
462
|
action: "warn",
|
|
438
463
|
path: filePath,
|
|
439
|
-
detail:
|
|
464
|
+
detail: `${surfaceLabel} ${patch.key} skipped: "${leaf.atPath}" exists but is not an object \u2014 ${configPatchManualEdit(patch)}`
|
|
440
465
|
});
|
|
441
466
|
continue;
|
|
442
467
|
}
|
|
@@ -462,7 +487,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
462
487
|
platform: this.id,
|
|
463
488
|
action: "create",
|
|
464
489
|
path: filePath,
|
|
465
|
-
detail:
|
|
490
|
+
detail: `${surfaceLabel} ${patch.key}: <absent> \u2192 ${describeJsonValue(desired)} (${patch.reason})`
|
|
466
491
|
});
|
|
467
492
|
continue;
|
|
468
493
|
}
|
|
@@ -471,7 +496,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
471
496
|
platform: this.id,
|
|
472
497
|
action: "warn",
|
|
473
498
|
path: filePath,
|
|
474
|
-
detail:
|
|
499
|
+
detail: `${surfaceLabel} ${patch.key} skipped: already set to ${describeJsonValue(leaf.value)} (not created by agent-connector; desired ${describeJsonValue(desired)}) \u2014 ` + configPatchManualEdit(patch)
|
|
475
500
|
});
|
|
476
501
|
continue;
|
|
477
502
|
}
|
|
@@ -480,7 +505,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
480
505
|
platform: this.id,
|
|
481
506
|
action: "warn",
|
|
482
507
|
path: filePath,
|
|
483
|
-
detail:
|
|
508
|
+
detail: `${surfaceLabel} ${patch.key}: value changed since install (current ${describeJsonValue(leaf.value)}, wrote ${describeJsonValue(entry.writtenValue)}); leaving in place \u2014 ${configPatchManualEdit(patch)}`
|
|
484
509
|
});
|
|
485
510
|
continue;
|
|
486
511
|
}
|
|
@@ -492,14 +517,14 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
492
517
|
platform: this.id,
|
|
493
518
|
action: "skip",
|
|
494
519
|
path: filePath,
|
|
495
|
-
detail:
|
|
520
|
+
detail: `${surfaceLabel} ${patch.key} already installed; registered as co-owner (co-owned with ${owners.join(", ")})`
|
|
496
521
|
});
|
|
497
522
|
} else {
|
|
498
523
|
changes.push({
|
|
499
524
|
platform: this.id,
|
|
500
525
|
action: "skip",
|
|
501
526
|
path: filePath,
|
|
502
|
-
detail:
|
|
527
|
+
detail: `${surfaceLabel} ${patch.key} already installed`
|
|
503
528
|
});
|
|
504
529
|
}
|
|
505
530
|
continue;
|
|
@@ -508,7 +533,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
508
533
|
platform: this.id,
|
|
509
534
|
action: "warn",
|
|
510
535
|
path: filePath,
|
|
511
|
-
detail:
|
|
536
|
+
detail: `${surfaceLabel} ${patch.key} skipped: already owned by ${entry.owners.map((o) => o.connectorId).join(", ")} with a different value (current ${describeJsonValue(leaf.value)}, desired ${describeJsonValue(desired)}) \u2014 ` + configPatchManualEdit(patch)
|
|
512
537
|
});
|
|
513
538
|
}
|
|
514
539
|
if (fileMutated) this.writeJson(filePath, settings, ctx.dryRun);
|
|
@@ -518,7 +543,9 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
518
543
|
uninstallConfigPatches(ctx) {
|
|
519
544
|
const connectorId = ctx.connector.id;
|
|
520
545
|
const ledger = loadConfigPatchLedger(ctx.dataRoot);
|
|
521
|
-
const owned = ledgerEntriesOwnedBy(ledger, HOST, connectorId)
|
|
546
|
+
const owned = ledgerEntriesOwnedBy(ledger, HOST, connectorId).filter(
|
|
547
|
+
(e) => e.key !== STATUSLINE_KEY
|
|
548
|
+
);
|
|
522
549
|
const declared = ctx.connector.platforms[HOST]?.configPatch ?? [];
|
|
523
550
|
const changes = [];
|
|
524
551
|
const ownedKeys = new Set(owned.map((e) => e.key));
|
|
@@ -532,6 +559,20 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
532
559
|
}
|
|
533
560
|
}
|
|
534
561
|
if (owned.length === 0) return changes;
|
|
562
|
+
changes.push(...this.releaseOwnedConfigPatches(ctx, ledger, owned));
|
|
563
|
+
return changes;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* The shared last-owner-verified release loop behind BOTH
|
|
567
|
+
* {@link uninstallConfigPatches} and {@link uninstallStatusline}: for each
|
|
568
|
+
* already-selected owned ledger entry, drop this connector's ownership and
|
|
569
|
+
* remove the key ONLY when last-owner ∧ value-unchanged ∧ prior-absent (else
|
|
570
|
+
* skip-warn + leave the key). Saves the ledger when it mutated.
|
|
571
|
+
*/
|
|
572
|
+
releaseOwnedConfigPatches(ctx, ledger, owned, opts = {}) {
|
|
573
|
+
const surfaceLabel = opts.surfaceLabel ?? "configPatch";
|
|
574
|
+
const connectorId = ctx.connector.id;
|
|
575
|
+
const changes = [];
|
|
535
576
|
let ledgerMutated = false;
|
|
536
577
|
const backedUp = /* @__PURE__ */ new Set();
|
|
537
578
|
const byFile = /* @__PURE__ */ new Map();
|
|
@@ -552,7 +593,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
552
593
|
platform: this.id,
|
|
553
594
|
action: "skip",
|
|
554
595
|
path: filePath,
|
|
555
|
-
detail:
|
|
596
|
+
detail: `${surfaceLabel} ${entry.key} retained: still owned by ${entry.owners.map((o) => o.connectorId).join(", ")}`
|
|
556
597
|
});
|
|
557
598
|
continue;
|
|
558
599
|
}
|
|
@@ -562,7 +603,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
562
603
|
platform: this.id,
|
|
563
604
|
action: "warn",
|
|
564
605
|
path: filePath,
|
|
565
|
-
detail:
|
|
606
|
+
detail: `${surfaceLabel} ${entry.key}: ${filePath} is not parseable; key left in place (ownership released)`
|
|
566
607
|
});
|
|
567
608
|
continue;
|
|
568
609
|
}
|
|
@@ -571,7 +612,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
571
612
|
platform: this.id,
|
|
572
613
|
action: "skip",
|
|
573
614
|
path: filePath,
|
|
574
|
-
detail:
|
|
615
|
+
detail: `${surfaceLabel} ${entry.key} already absent (no settings file); ownership record dropped`
|
|
575
616
|
});
|
|
576
617
|
continue;
|
|
577
618
|
}
|
|
@@ -581,7 +622,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
581
622
|
platform: this.id,
|
|
582
623
|
action: "skip",
|
|
583
624
|
path: filePath,
|
|
584
|
-
detail:
|
|
625
|
+
detail: `${surfaceLabel} ${entry.key} already absent; ownership record dropped`
|
|
585
626
|
});
|
|
586
627
|
continue;
|
|
587
628
|
}
|
|
@@ -590,7 +631,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
590
631
|
platform: this.id,
|
|
591
632
|
action: "warn",
|
|
592
633
|
path: filePath,
|
|
593
|
-
detail:
|
|
634
|
+
detail: `${surfaceLabel} ${entry.key}: value changed since install (current ${describeJsonValue(leaf.value)}, wrote ${describeJsonValue(entry.writtenValue)}); left in place`
|
|
594
635
|
});
|
|
595
636
|
continue;
|
|
596
637
|
}
|
|
@@ -612,7 +653,7 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
612
653
|
platform: this.id,
|
|
613
654
|
action: "remove",
|
|
614
655
|
path: filePath,
|
|
615
|
-
detail:
|
|
656
|
+
detail: `${surfaceLabel} ${entry.key} removed (was ${describeJsonValue(entry.writtenValue)})`
|
|
616
657
|
});
|
|
617
658
|
}
|
|
618
659
|
if (fileMutated && settings) this.writeJson(filePath, settings, ctx.dryRun);
|
|
@@ -620,6 +661,91 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
620
661
|
if (ledgerMutated && !ctx.dryRun) saveConfigPatchLedger(ctx.dataRoot, ledger);
|
|
621
662
|
return changes;
|
|
622
663
|
}
|
|
664
|
+
// ── Statusline surface (a HUD/status line) ────────────────────────────────
|
|
665
|
+
// Wires settings.json.statusLine = { type:"command", command:<home-bin
|
|
666
|
+
// statusline cmd> } through the SAME ownership ledger as configPatch: a
|
|
667
|
+
// synthetic ConfigPatchDef routed through applyConfigPatches, so the statusLine
|
|
668
|
+
// inherits the full set-if-absent contract verbatim — never clobbers a
|
|
669
|
+
// statusLine agent-connector does not own (skip-warn), records prior state +
|
|
670
|
+
// owner, reversible. The home-bin command makes the host exec
|
|
671
|
+
// `<homeBin> statusline claude-code --connector <id>` for every status refresh,
|
|
672
|
+
// which re-imports the connector module and renders the line (runtime/
|
|
673
|
+
// statusline-entrypoint). No telemetry in v1.
|
|
674
|
+
/** The synthetic statusLine configPatch this connector would write. */
|
|
675
|
+
statuslineConfigPatch(ctx) {
|
|
676
|
+
const command = buildHomeBinStatuslineCommand(ctx.homeBinPath, HOST, ctx.connector.id);
|
|
677
|
+
return {
|
|
678
|
+
key: STATUSLINE_KEY,
|
|
679
|
+
value: { type: "command", command },
|
|
680
|
+
reason: "agent-connector statusline surface"
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
installStatusline(ctx) {
|
|
684
|
+
const { connector } = ctx;
|
|
685
|
+
if (connector.statusline == null) {
|
|
686
|
+
return [{ platform: this.id, action: "skip", detail: "connector declares no statusline" }];
|
|
687
|
+
}
|
|
688
|
+
if (connector.platforms[HOST]?.statusline === false) {
|
|
689
|
+
return [{ platform: this.id, action: "skip", detail: "statusline disabled for claude-code" }];
|
|
690
|
+
}
|
|
691
|
+
return this.applyConfigPatches(ctx, [this.statuslineConfigPatch(ctx)], {
|
|
692
|
+
surfaceLabel: "statusline"
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
uninstallStatusline(ctx) {
|
|
696
|
+
const ledger = loadConfigPatchLedger(ctx.dataRoot);
|
|
697
|
+
const owned = ledgerEntriesOwnedBy(ledger, HOST, ctx.connector.id).filter(
|
|
698
|
+
(e) => e.key === STATUSLINE_KEY
|
|
699
|
+
);
|
|
700
|
+
if (owned.length === 0) {
|
|
701
|
+
return [
|
|
702
|
+
{
|
|
703
|
+
platform: this.id,
|
|
704
|
+
action: "skip",
|
|
705
|
+
detail: "statusline: no ownership recorded; left untouched"
|
|
706
|
+
}
|
|
707
|
+
];
|
|
708
|
+
}
|
|
709
|
+
return this.releaseOwnedConfigPatches(ctx, ledger, owned, {
|
|
710
|
+
surfaceLabel: "statusline"
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Parse Claude Code's statusLine stdin JSON into the normalized
|
|
715
|
+
* {@link StatuslineContext}. Claude pipes a JSON object to the statusLine
|
|
716
|
+
* command on stdin (model, workspace, cost, etc.); fields the payload omits
|
|
717
|
+
* stay undefined. `raw` keeps the verbatim payload (incl. `version`).
|
|
718
|
+
*/
|
|
719
|
+
parseStatusInput(raw) {
|
|
720
|
+
const input = raw ?? {};
|
|
721
|
+
const model = {};
|
|
722
|
+
if (typeof input.model?.id === "string") model.id = input.model.id;
|
|
723
|
+
if (typeof input.model?.display_name === "string") {
|
|
724
|
+
model.displayName = input.model.display_name;
|
|
725
|
+
}
|
|
726
|
+
const cwd = typeof input.cwd === "string" ? input.cwd : typeof input.workspace?.current_dir === "string" ? input.workspace.current_dir : void 0;
|
|
727
|
+
const ctx = {
|
|
728
|
+
host: HOST,
|
|
729
|
+
capabilities: this.capabilities,
|
|
730
|
+
raw
|
|
731
|
+
};
|
|
732
|
+
if (typeof input.session_id === "string" && input.session_id !== "") {
|
|
733
|
+
ctx.sessionId = input.session_id;
|
|
734
|
+
}
|
|
735
|
+
if (cwd !== void 0) ctx.cwd = cwd;
|
|
736
|
+
if (model.id !== void 0 || model.displayName !== void 0) ctx.model = model;
|
|
737
|
+
if (typeof input.cost?.total_cost_usd === "number") {
|
|
738
|
+
ctx.cost = { totalUsd: input.cost.total_cost_usd };
|
|
739
|
+
}
|
|
740
|
+
if (typeof input.transcript_path === "string") {
|
|
741
|
+
ctx.transcriptPath = input.transcript_path;
|
|
742
|
+
}
|
|
743
|
+
return ctx;
|
|
744
|
+
}
|
|
745
|
+
/** Format the rendered status line into Claude's native reply: stdout = line, exit 0. */
|
|
746
|
+
formatStatusOutput(rendered) {
|
|
747
|
+
return { exitCode: 0, stdout: rendered };
|
|
748
|
+
}
|
|
623
749
|
/**
|
|
624
750
|
* Back up ONE exact file (the ledger-recorded patch target, which may belong
|
|
625
751
|
* to a different scope than the current ctx) into the standard backups dir.
|
|
@@ -651,7 +777,9 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
651
777
|
const results = [];
|
|
652
778
|
const ledger = loadConfigPatchLedger(ctx.dataRoot);
|
|
653
779
|
const connectorId = ctx.connector.id;
|
|
654
|
-
const platformEntries = ledger.entries.filter(
|
|
780
|
+
const platformEntries = ledger.entries.filter(
|
|
781
|
+
(e) => e.platform === this.id && e.key !== STATUSLINE_KEY
|
|
782
|
+
);
|
|
655
783
|
for (const entry of platformEntries) {
|
|
656
784
|
const ownedByThis = entry.owners.some((o) => o.connectorId === connectorId);
|
|
657
785
|
if (!ownedByThis) {
|
|
@@ -1144,6 +1272,30 @@ var ClaudeCodeAdapter = class extends BaseAdapter {
|
|
|
1144
1272
|
check: () => existsSync(p) ? { status: "OK", detail: p } : { status: "FAIL", detail: `not found: ${p}` }
|
|
1145
1273
|
});
|
|
1146
1274
|
}
|
|
1275
|
+
const statuslineLedgerOwned = ledgerEntriesOwnedBy(
|
|
1276
|
+
loadConfigPatchLedger(ctx.dataRoot),
|
|
1277
|
+
HOST,
|
|
1278
|
+
connectorId
|
|
1279
|
+
).some((e) => e.key === STATUSLINE_KEY);
|
|
1280
|
+
if ((ctx.connector.statusline != null || statuslineLedgerOwned) && ctx.connector.platforms[HOST]?.statusline !== false) {
|
|
1281
|
+
checks.push({
|
|
1282
|
+
name: `${this.name}: statusline wired`,
|
|
1283
|
+
check: () => {
|
|
1284
|
+
const settings = this.readJson(settingsPath);
|
|
1285
|
+
const command = settings?.statusLine?.command;
|
|
1286
|
+
if (command === void 0) {
|
|
1287
|
+
return { status: "FAIL", detail: `statusLine not set in ${settingsPath}` };
|
|
1288
|
+
}
|
|
1289
|
+
if (typeof command === "string" && isHomeBinStatuslineCommand(command, homeBin, connectorId)) {
|
|
1290
|
+
return { status: "OK", detail: "statusLine command present" };
|
|
1291
|
+
}
|
|
1292
|
+
return {
|
|
1293
|
+
status: "FAIL",
|
|
1294
|
+
detail: `statusLine in ${settingsPath} is not agent-connector's (left untouched)`
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1147
1299
|
return checks;
|
|
1148
1300
|
}
|
|
1149
1301
|
// ── Runtime: parse Claude stdin JSON → normalized event ──────────────────
|
|
@@ -1429,4 +1581,4 @@ export {
|
|
|
1429
1581
|
claudeSensitiveKeyViolation,
|
|
1430
1582
|
claude_code_default as default
|
|
1431
1583
|
};
|
|
1432
|
-
//# sourceMappingURL=claude-code-
|
|
1584
|
+
//# sourceMappingURL=claude-code-MLWS7CW6.js.map
|