@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.
Files changed (163) hide show
  1. package/README.md +178 -14
  2. package/dist/action-PLZW5BGX.js +54 -0
  3. package/dist/action-PLZW5BGX.js.map +1 -0
  4. package/dist/{amp-YGV66GJT.js → amp-B524U6LO.js} +81 -5
  5. package/dist/amp-B524U6LO.js.map +1 -0
  6. package/dist/{antigravity-7IBYFO6P.js → antigravity-ANDKF3K7.js} +4 -4
  7. package/dist/{antigravity-cli-JEOUP2VN.js → antigravity-cli-LLRPDDOT.js} +4 -4
  8. package/dist/chunk-22Y24V7O.js +21 -0
  9. package/dist/chunk-22Y24V7O.js.map +1 -0
  10. package/dist/chunk-3PFFTFCU.js +190 -0
  11. package/dist/chunk-3PFFTFCU.js.map +1 -0
  12. package/dist/{chunk-SCVBYSF7.js → chunk-6XHB6BE3.js} +1 -1
  13. package/dist/chunk-76FUSVIA.js +43 -0
  14. package/dist/chunk-76FUSVIA.js.map +1 -0
  15. package/dist/{chunk-GSGDG2BV.js → chunk-ADTHT2FN.js} +109 -16
  16. package/dist/chunk-ADTHT2FN.js.map +1 -0
  17. package/dist/{chunk-ZAM4M7LI.js → chunk-BHUCB6LY.js} +135 -296
  18. package/dist/chunk-BHUCB6LY.js.map +1 -0
  19. package/dist/{chunk-MEH7GC7R.js → chunk-BXGFUENQ.js} +20 -3
  20. package/dist/chunk-BXGFUENQ.js.map +1 -0
  21. package/dist/chunk-CIRDOY2V.js +351 -0
  22. package/dist/chunk-CIRDOY2V.js.map +1 -0
  23. package/dist/{chunk-KMAKDD3Z.js → chunk-G3ER4SY5.js} +37 -12
  24. package/dist/chunk-G3ER4SY5.js.map +1 -0
  25. package/dist/{chunk-PD4VFEBY.js → chunk-IW77FFNX.js} +39 -1
  26. package/dist/chunk-IW77FFNX.js.map +1 -0
  27. package/dist/chunk-J3D5W5T2.js +83 -0
  28. package/dist/chunk-J3D5W5T2.js.map +1 -0
  29. package/dist/{openclaw-UZ5BMCGQ.js → chunk-KGGBNKI4.js} +125 -33
  30. package/dist/chunk-KGGBNKI4.js.map +1 -0
  31. package/dist/{chunk-3JCRUROU.js → chunk-KGJWE6A2.js} +13 -4
  32. package/dist/chunk-KGJWE6A2.js.map +1 -0
  33. package/dist/{chunk-3RBLIHPZ.js → chunk-KGXDYGNJ.js} +26 -16
  34. package/dist/chunk-KGXDYGNJ.js.map +1 -0
  35. package/dist/{chunk-KVAAFYRR.js → chunk-KHO5WNTP.js} +2 -18
  36. package/dist/chunk-KHO5WNTP.js.map +1 -0
  37. package/dist/{chunk-KQSNDFBN.js → chunk-LL4OBGRU.js} +3 -3
  38. package/dist/{chunk-WNREHWKL.js → chunk-MAH6QQTO.js} +3 -3
  39. package/dist/{claude-code-4275HQU4.js → claude-code-MLWS7CW6.js} +180 -28
  40. package/dist/claude-code-MLWS7CW6.js.map +1 -0
  41. package/dist/cli/sdk.js +4 -3
  42. package/dist/cli/sdk.js.map +1 -1
  43. package/dist/cli.js +1 -1
  44. package/dist/{codebuff-LE3KBZGM.js → codebuff-SH2S3QAN.js} +102 -5
  45. package/dist/codebuff-SH2S3QAN.js.map +1 -0
  46. package/dist/{codex-4BY2ZJIW.js → codex-BXA4FIF4.js} +3 -3
  47. package/dist/{copilot-cli-IPISKO3V.js → copilot-cli-ROIBTTDT.js} +3 -3
  48. package/dist/{crush-X3E25EQG.js → crush-QLEFLHUC.js} +3 -3
  49. package/dist/{cursor-UH3W622V.js → cursor-ASJPWZ4R.js} +6 -3
  50. package/dist/cursor-ASJPWZ4R.js.map +1 -0
  51. package/dist/{detect-U3E7NVNW.js → detect-ZIIS55LD.js} +4 -3
  52. package/dist/{detect-U3E7NVNW.js.map → detect-ZIIS55LD.js.map} +1 -1
  53. package/dist/{doctor-DZTWED4O.js → doctor-TJUGSQ5C.js} +16 -12
  54. package/dist/doctor-TJUGSQ5C.js.map +1 -0
  55. package/dist/{droid-T5VBRXZF.js → droid-NCSS3B5Y.js} +170 -4
  56. package/dist/droid-NCSS3B5Y.js.map +1 -0
  57. package/dist/{gemini-cli-ZSUK55UA.js → gemini-cli-SLVWLXJW.js} +3 -3
  58. package/dist/{goose-M3RR3CZG.js → goose-PBA7KTE5.js} +100 -5
  59. package/dist/goose-PBA7KTE5.js.map +1 -0
  60. package/dist/{hermes-CUNKIAR5.js → hermes-ONDCECP2.js} +3 -3
  61. package/dist/{hook-EVY7LOUQ.js → hook-OU522ABV.js} +12 -9
  62. package/dist/{hook-EVY7LOUQ.js.map → hook-OU522ABV.js.map} +1 -1
  63. package/dist/index.d.ts +71 -3
  64. package/dist/index.js +22 -3
  65. package/dist/{install-OWAS5UIE.js → install-UDCBL7HP.js} +11 -9
  66. package/dist/{install-OWAS5UIE.js.map → install-UDCBL7HP.js.map} +1 -1
  67. package/dist/introspect-DuZSPSHB.d.ts +53 -0
  68. package/dist/{jetbrains-copilot-C3HDGGML.js → jetbrains-copilot-YABZ3HFA.js} +3 -3
  69. package/dist/{kilo-PKAJCWPX.js → kilo-F3ZDZKCT.js} +3 -3
  70. package/dist/{kilo-cli-QWUVXG2O.js → kilo-cli-3HWPWBY4.js} +3 -3
  71. package/dist/{kimi-EVD7YKXS.js → kimi-NV72FVAO.js} +3 -3
  72. package/dist/{kiro-UQRY6EIO.js → kiro-C5W6AGDR.js} +3 -3
  73. package/dist/{leaderboard-CSWHI4UY.js → leaderboard-TIBVONVT.js} +3 -3
  74. package/dist/mimo-code-IMM5YM3M.js +754 -0
  75. package/dist/mimo-code-IMM5YM3M.js.map +1 -0
  76. package/dist/{mux-5CI5FP2W.js → mux-DSSH4AFS.js} +3 -3
  77. package/dist/nemoclaw-3EVNKD3I.js +58 -0
  78. package/dist/nemoclaw-3EVNKD3I.js.map +1 -0
  79. package/dist/{omp-AXA7XY22.js → omp-Z6FRNDPN.js} +3 -3
  80. package/dist/openclaw-7G437NT7.js +18 -0
  81. package/dist/openclaw-7G437NT7.js.map +1 -0
  82. package/dist/{opencode-NZBRLJN3.js → opencode-Q6KBSAKW.js} +3 -3
  83. package/dist/{package-WFOS4QVU.js → package-RMPN57YZ.js} +7 -6
  84. package/dist/{package-WFOS4QVU.js.map → package-RMPN57YZ.js.map} +1 -1
  85. package/dist/{pi-WMTUX6ES.js → pi-LZT6WWAZ.js} +2 -2
  86. package/dist/{qwen-code-MRRIUQ3P.js → qwen-code-WQBKRPWJ.js} +3 -3
  87. package/dist/{roo-code-NI5UU6JB.js → roo-code-GWSNU3OW.js} +137 -4
  88. package/dist/roo-code-GWSNU3OW.js.map +1 -0
  89. package/dist/runtime/index.d.ts +96 -2
  90. package/dist/runtime/index.js +18 -10
  91. package/dist/sdk/index.d.ts +52 -0
  92. package/dist/sdk/index.js +81 -0
  93. package/dist/sdk/index.js.map +1 -0
  94. package/dist/sdk/test.d.ts +74 -0
  95. package/dist/sdk/test.js +291 -0
  96. package/dist/sdk/test.js.map +1 -0
  97. package/dist/{serve-3C2VFPAY.js → serve-D3GO36UT.js} +12 -9
  98. package/dist/{serve-3C2VFPAY.js.map → serve-D3GO36UT.js.map} +1 -1
  99. package/dist/{status-MKQYX5MW.js → status-KOSKCETC.js} +9 -7
  100. package/dist/{status-MKQYX5MW.js.map → status-KOSKCETC.js.map} +1 -1
  101. package/dist/statusline-ZNTCL5YC.js +59 -0
  102. package/dist/statusline-ZNTCL5YC.js.map +1 -0
  103. package/dist/{telemetry-3DN6XGYB.js → telemetry-XIKUUGTQ.js} +5 -4
  104. package/dist/{telemetry-3DN6XGYB.js.map → telemetry-XIKUUGTQ.js.map} +1 -1
  105. package/dist/{trae-CQC72RHH.js → trae-NWT3TMSZ.js} +99 -5
  106. package/dist/trae-NWT3TMSZ.js.map +1 -0
  107. package/dist/{types-CNigfEuR.d.ts → types-BEKsAium.d.ts} +268 -6
  108. package/dist/{uninstall-WG6PFWF3.js → uninstall-2LBLQVFA.js} +11 -9
  109. package/dist/{uninstall-WG6PFWF3.js.map → uninstall-2LBLQVFA.js.map} +1 -1
  110. package/dist/{upgrade-32NC2RKI.js → upgrade-ZC2S7VRN.js} +11 -9
  111. package/dist/{upgrade-32NC2RKI.js.map → upgrade-ZC2S7VRN.js.map} +1 -1
  112. package/dist/{usage-CJOM2WQM.js → usage-E2A4O2CY.js} +3 -3
  113. package/dist/{usage-event-472X3DOY.js → usage-event-JKMC4QC4.js} +11 -8
  114. package/dist/{usage-event-472X3DOY.js.map → usage-event-JKMC4QC4.js.map} +1 -1
  115. package/dist/{vscode-copilot-4RVRTCKV.js → vscode-copilot-ALV45XF6.js} +3 -3
  116. package/dist/{warp-X6MB67NT.js → warp-H6IX4U3J.js} +3 -3
  117. package/dist/{zed-NTCYW4V2.js → zed-RH34TNSW.js} +3 -3
  118. package/package.json +9 -1
  119. package/dist/amp-YGV66GJT.js.map +0 -1
  120. package/dist/chunk-3JCRUROU.js.map +0 -1
  121. package/dist/chunk-3RBLIHPZ.js.map +0 -1
  122. package/dist/chunk-GSGDG2BV.js.map +0 -1
  123. package/dist/chunk-KMAKDD3Z.js.map +0 -1
  124. package/dist/chunk-KVAAFYRR.js.map +0 -1
  125. package/dist/chunk-MEH7GC7R.js.map +0 -1
  126. package/dist/chunk-NJU275US.js +0 -238
  127. package/dist/chunk-NJU275US.js.map +0 -1
  128. package/dist/chunk-PD4VFEBY.js.map +0 -1
  129. package/dist/chunk-ZAM4M7LI.js.map +0 -1
  130. package/dist/claude-code-4275HQU4.js.map +0 -1
  131. package/dist/codebuff-LE3KBZGM.js.map +0 -1
  132. package/dist/cursor-UH3W622V.js.map +0 -1
  133. package/dist/doctor-DZTWED4O.js.map +0 -1
  134. package/dist/droid-T5VBRXZF.js.map +0 -1
  135. package/dist/goose-M3RR3CZG.js.map +0 -1
  136. package/dist/openclaw-UZ5BMCGQ.js.map +0 -1
  137. package/dist/roo-code-NI5UU6JB.js.map +0 -1
  138. package/dist/trae-CQC72RHH.js.map +0 -1
  139. /package/dist/{antigravity-7IBYFO6P.js.map → antigravity-ANDKF3K7.js.map} +0 -0
  140. /package/dist/{antigravity-cli-JEOUP2VN.js.map → antigravity-cli-LLRPDDOT.js.map} +0 -0
  141. /package/dist/{chunk-SCVBYSF7.js.map → chunk-6XHB6BE3.js.map} +0 -0
  142. /package/dist/{chunk-KQSNDFBN.js.map → chunk-LL4OBGRU.js.map} +0 -0
  143. /package/dist/{chunk-WNREHWKL.js.map → chunk-MAH6QQTO.js.map} +0 -0
  144. /package/dist/{codex-4BY2ZJIW.js.map → codex-BXA4FIF4.js.map} +0 -0
  145. /package/dist/{copilot-cli-IPISKO3V.js.map → copilot-cli-ROIBTTDT.js.map} +0 -0
  146. /package/dist/{crush-X3E25EQG.js.map → crush-QLEFLHUC.js.map} +0 -0
  147. /package/dist/{gemini-cli-ZSUK55UA.js.map → gemini-cli-SLVWLXJW.js.map} +0 -0
  148. /package/dist/{hermes-CUNKIAR5.js.map → hermes-ONDCECP2.js.map} +0 -0
  149. /package/dist/{jetbrains-copilot-C3HDGGML.js.map → jetbrains-copilot-YABZ3HFA.js.map} +0 -0
  150. /package/dist/{kilo-PKAJCWPX.js.map → kilo-F3ZDZKCT.js.map} +0 -0
  151. /package/dist/{kilo-cli-QWUVXG2O.js.map → kilo-cli-3HWPWBY4.js.map} +0 -0
  152. /package/dist/{kimi-EVD7YKXS.js.map → kimi-NV72FVAO.js.map} +0 -0
  153. /package/dist/{kiro-UQRY6EIO.js.map → kiro-C5W6AGDR.js.map} +0 -0
  154. /package/dist/{leaderboard-CSWHI4UY.js.map → leaderboard-TIBVONVT.js.map} +0 -0
  155. /package/dist/{mux-5CI5FP2W.js.map → mux-DSSH4AFS.js.map} +0 -0
  156. /package/dist/{omp-AXA7XY22.js.map → omp-Z6FRNDPN.js.map} +0 -0
  157. /package/dist/{opencode-NZBRLJN3.js.map → opencode-Q6KBSAKW.js.map} +0 -0
  158. /package/dist/{pi-WMTUX6ES.js.map → pi-LZT6WWAZ.js.map} +0 -0
  159. /package/dist/{qwen-code-MRRIUQ3P.js.map → qwen-code-WQBKRPWJ.js.map} +0 -0
  160. /package/dist/{usage-CJOM2WQM.js.map → usage-E2A4O2CY.js.map} +0 -0
  161. /package/dist/{vscode-copilot-4RVRTCKV.js.map → vscode-copilot-ALV45XF6.js.map} +0 -0
  162. /package/dist/{warp-X6MB67NT.js.map → warp-H6IX4U3J.js.map} +0 -0
  163. /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-3JCRUROU.js";
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-GSGDG2BV.js";
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-PD4VFEBY.js";
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-MEH7GC7R.js";
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
- const namespace = configPatchNamespaceViolation(patch.key);
413
- if (namespace) {
414
- changes.push({
415
- platform: this.id,
416
- action: "warn",
417
- detail: `configPatch refused: ${namespace}`
418
- });
419
- continue;
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: `configPatch ${patch.key} skipped: "${leaf.atPath}" exists but is not an object \u2014 ${configPatchManualEdit(patch)}`
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: `configPatch ${patch.key}: <absent> \u2192 ${describeJsonValue(desired)} (${patch.reason})`
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: `configPatch ${patch.key} skipped: already set to ${describeJsonValue(leaf.value)} (not created by agent-connector; desired ${describeJsonValue(desired)}) \u2014 ` + configPatchManualEdit(patch)
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: `configPatch ${patch.key}: value changed since install (current ${describeJsonValue(leaf.value)}, wrote ${describeJsonValue(entry.writtenValue)}); leaving in place \u2014 ${configPatchManualEdit(patch)}`
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: `configPatch ${patch.key} already installed; registered as co-owner (co-owned with ${owners.join(", ")})`
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: `configPatch ${patch.key} already installed`
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: `configPatch ${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)
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: `configPatch ${entry.key} retained: still owned by ${entry.owners.map((o) => o.connectorId).join(", ")}`
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: `configPatch ${entry.key}: ${filePath} is not parseable; key left in place (ownership released)`
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: `configPatch ${entry.key} already absent (no settings file); ownership record dropped`
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: `configPatch ${entry.key} already absent; ownership record dropped`
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: `configPatch ${entry.key}: value changed since install (current ${describeJsonValue(leaf.value)}, wrote ${describeJsonValue(entry.writtenValue)}); left in place`
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: `configPatch ${entry.key} removed (was ${describeJsonValue(entry.writtenValue)})`
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((e) => e.platform === this.id);
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-4275HQU4.js.map
1584
+ //# sourceMappingURL=claude-code-MLWS7CW6.js.map