@dadado/agent-kit-cli 6.25.0 → 6.26.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 (75) hide show
  1. package/dashboard/dashboard.html +3 -3
  2. package/dashboard/lib/guards.mjs +1 -0
  3. package/dist/{add-OYLOMCM6.js → add-G7KEZLWP.js} +7 -6
  4. package/dist/{chunk-7HDQEK6T.js → chunk-2G4K4ZI5.js} +7 -3
  5. package/dist/{chunk-QLTGHJB3.js → chunk-2GXN7HVG.js} +5 -5
  6. package/dist/{chunk-HSIHZWFF.js → chunk-5A72LTR3.js} +7 -7
  7. package/dist/{chunk-6WUKLS4D.js → chunk-BIFTTL2O.js} +1 -1
  8. package/dist/{chunk-NJ2SUSWX.js → chunk-BVZDPVUL.js} +1 -1
  9. package/dist/{chunk-QACMV46U.js → chunk-ENRXS5O6.js} +19 -12
  10. package/dist/{chunk-2F6NMQOA.js → chunk-FB6G6OD6.js} +3 -3
  11. package/dist/{chunk-MFKHIWEL.js → chunk-FOVHFMSH.js} +1 -1
  12. package/dist/{chunk-EO5NGAYV.js → chunk-FUSNEYGU.js} +29 -3
  13. package/dist/{chunk-GMG7ZH4E.js → chunk-H7KAXI5R.js} +13 -13
  14. package/dist/{chunk-SAQ3EE5R.js → chunk-HGB4DHXV.js} +3 -3
  15. package/dist/{chunk-IFBIO7VT.js → chunk-HXV6VQD4.js} +1402 -42
  16. package/dist/{chunk-XGZOU4DS.js → chunk-I3FGWNU5.js} +4 -4
  17. package/dist/{chunk-6M6UKECW.js → chunk-IHVJTGYR.js} +0 -32
  18. package/dist/{chunk-H7RAFRRZ.js → chunk-IUY24WPE.js} +68 -34
  19. package/dist/chunk-JG5MKMOM.js +248 -0
  20. package/dist/{chunk-KWYF7QNH.js → chunk-JWIJHO67.js} +17 -2
  21. package/dist/chunk-KMK4T4ZM.js +34 -0
  22. package/dist/{chunk-ZMYV6PRE.js → chunk-LEVNLHH3.js} +2 -1
  23. package/dist/{chunk-2XLI7XEY.js → chunk-MGVV6YC4.js} +1 -1
  24. package/dist/{chunk-C7SV7UP5.js → chunk-MWRYQLEG.js} +3 -3
  25. package/dist/{chunk-WKFE3RUC.js → chunk-NHJ4IAVN.js} +5 -3
  26. package/dist/{chunk-C4Q77GGJ.js → chunk-O7VMHCNN.js} +6 -0
  27. package/dist/{chunk-GQSSXDDK.js → chunk-OVRGTHZD.js} +1 -1
  28. package/dist/{chunk-CIV42JGT.js → chunk-PCIYXGB3.js} +2 -2
  29. package/dist/{chunk-7Y74KO7U.js → chunk-PLLXFSN2.js} +12 -12
  30. package/dist/{chunk-QX55T4UX.js → chunk-RJP47EGS.js} +6 -1
  31. package/dist/{chunk-JGG574RK.js → chunk-RRJVC35Y.js} +3 -3
  32. package/dist/{chunk-PIMGV3E5.js → chunk-SWJJW624.js} +1 -1
  33. package/dist/{chunk-G5MQRP6M.js → chunk-SYRJ5TTK.js} +13 -9
  34. package/dist/{chunk-L5V3W3DY.js → chunk-TTUFIE26.js} +60 -14
  35. package/dist/{chunk-JFS4GKP7.js → chunk-XXPI4H4D.js} +2 -2
  36. package/dist/{chunk-M4UL422I.js → chunk-Y5526WCN.js} +6 -6
  37. package/dist/{chunk-CXE6ASSX.js → chunk-Y575INEC.js} +1 -1
  38. package/dist/{chunk-JG3CNGQM.js → chunk-ZNZHDPS3.js} +6 -4
  39. package/dist/{commands-UW2C2ZN4.js → commands-K4HSDML5.js} +8 -6
  40. package/dist/{conflicts-RING6AHV.js → conflicts-4SUWIPWP.js} +9 -10
  41. package/dist/{contribute-LSY75JZH.js → contribute-HE4WCBRY.js} +7 -6
  42. package/dist/{countdown-SZ2P4XHB.js → countdown-TYQHVAIX.js} +74 -45
  43. package/dist/{dashboard-P65XHYCU.js → dashboard-6V6PCNYF.js} +1 -1
  44. package/dist/{dashboard-broadcast-GYK34QYL.js → dashboard-broadcast-PMVQ7PXU.js} +1 -1
  45. package/dist/{diff-NZVBVQSK.js → diff-3XUZM7ZT.js} +8 -7
  46. package/dist/{doctor-TJSXBVGV.js → doctor-KGUWU5SN.js} +16 -15
  47. package/dist/{engine-info-BBI5QO5Y.js → engine-info-VM4VPGQM.js} +2 -2
  48. package/dist/{ground-control-ZJXPUIQN.js → ground-control-ZIDHEOPW.js} +7 -4
  49. package/dist/{handoff-2OZSWGTE.js → handoff-LLT4CI6H.js} +2 -3
  50. package/dist/{hook-3VPKNSOO.js → hook-UPZ3CPYS.js} +22 -22
  51. package/dist/index.js +49 -32
  52. package/dist/{init-UW2BJBO2.js → init-ZHLVXEVT.js} +19 -18
  53. package/dist/{install-RQSI4CHG.js → install-XWOG64W3.js} +19 -18
  54. package/dist/{installs-7TR4H4QH.js → installs-2ROXPO6M.js} +5 -4
  55. package/dist/{mission-control-VSU6NT43.js → mission-control-IGOI3WHS.js} +2 -2
  56. package/dist/models-5BDXREWM.js +45 -0
  57. package/dist/paths-JTPV6SXH.js +107 -0
  58. package/dist/pi-DCMDOY65.js +248 -0
  59. package/dist/{plan-index-BNLUU6T5.js → plan-index-5QZJK4AG.js} +2 -3
  60. package/dist/{queue-JHYILLMX.js → queue-Z5VNNHM6.js} +11 -13
  61. package/dist/{run-CQF5RM5X.js → run-QURAXAR2.js} +24 -30
  62. package/dist/{run-plan-BEOCOJCF.js → run-plan-4MMHVCTS.js} +35 -23
  63. package/dist/{session-start-QV7CEFRX.js → session-start-NC2HE5X5.js} +16 -16
  64. package/dist/{sessions-AWAAO3DU.js → sessions-WWWLYPW6.js} +4 -4
  65. package/dist/{setup-global-ST4TT427.js → setup-global-WDMARD4Z.js} +11 -10
  66. package/dist/{status-HUBPBGUU.js → status-2WNJL7PP.js} +12 -11
  67. package/dist/update-YSVOYYK5.js +32 -0
  68. package/dist/{update-all-YYUTXHGR.js → update-all-5XLTCHPX.js} +20 -18
  69. package/package.json +14 -4
  70. package/pi/agent-kit.ts +224 -0
  71. package/dist/chunk-7ABY6DYH.js +0 -89
  72. package/dist/chunk-AQLBEEPD.js +0 -625
  73. package/dist/chunk-MUTTNRX4.js +0 -53
  74. package/dist/chunk-TOSAAQ5A.js +0 -71
  75. package/dist/update-DD5UZPGG.js +0 -31
@@ -1,27 +1,17 @@
1
1
  import {
2
+ NO_PROGRESS_REASON,
3
+ isNoProgressLine,
2
4
  isPlanExhaustedReason,
3
- loadRolesContext,
4
- parseAgentStopLine,
5
- resolveReviewJobRole,
6
- resolveWorkerRole
7
- } from "./chunk-AQLBEEPD.js";
5
+ parseAgentStopLine
6
+ } from "./chunk-JG5MKMOM.js";
8
7
  import {
9
8
  REVIEW_BACKENDS,
10
9
  REVIEW_PACK_DEFAULT_MAX_BYTES,
11
10
  REVIEW_PACK_SLASH,
12
11
  parseReviewPackMaxBytes,
13
12
  reviewBackendMessage
14
- } from "./chunk-HSIHZWFF.js";
15
- import "./chunk-GQSSXDDK.js";
16
- import {
17
- countPendingTodos,
18
- readPlan,
19
- resolveActivePlanPath
20
- } from "./chunk-7ABY6DYH.js";
21
- import {
22
- detectAgentBackend,
23
- listDetectBackendIds
24
- } from "./chunk-TOSAAQ5A.js";
13
+ } from "./chunk-5A72LTR3.js";
14
+ import "./chunk-OVRGTHZD.js";
25
15
  import {
26
16
  GATE_EXIT_MARKER_RELPATH,
27
17
  defaultExec,
@@ -32,30 +22,36 @@ import {
32
22
  readGateExitMarker,
33
23
  resolveGateExitRefs,
34
24
  writeGateExitMarker
35
- } from "./chunk-XGZOU4DS.js";
36
- import {
37
- parsePlanFrontmatter
38
- } from "./chunk-L5V3W3DY.js";
39
- import {
40
- ensurePathIgnored
41
- } from "./chunk-MUTTNRX4.js";
25
+ } from "./chunk-I3FGWNU5.js";
42
26
  import {
43
27
  classifySlash,
44
28
  normalizeSlashName,
45
29
  promoteBlockedMessage,
46
30
  unknownSlashMessage
47
- } from "./chunk-KWYF7QNH.js";
31
+ } from "./chunk-JWIJHO67.js";
48
32
  import {
49
33
  CLAUDE_MAX_BUDGET_USD_ENV,
50
34
  CLAUDE_MAX_TURNS_ENV,
51
35
  RedactingStreamBuffer,
52
36
  claudeRunCaps,
37
+ countPendingTodos,
38
+ detectAgentBackend,
39
+ listDetectBackendIds,
40
+ loadRolesContext,
53
41
  parseResultLine,
54
- redactSecrets
55
- } from "./chunk-IFBIO7VT.js";
42
+ readPlan,
43
+ redactSecrets,
44
+ resolveActivePlanPath,
45
+ resolveReviewJobRole,
46
+ resolveWorkerRole
47
+ } from "./chunk-HXV6VQD4.js";
56
48
  import {
57
49
  HITL_UNANSWERED_EXIT_CODE
58
50
  } from "./chunk-P7732A25.js";
51
+ import {
52
+ ensurePathIgnored,
53
+ parsePlanFrontmatter
54
+ } from "./chunk-TTUFIE26.js";
59
55
  import "./chunk-WGLPZXNU.js";
60
56
  import "./chunk-Q35TWISF.js";
61
57
  import "./chunk-QTON2GQX.js";
@@ -66,7 +62,7 @@ import "./chunk-PFEUZXVT.js";
66
62
  import {
67
63
  ensureLoopLogsDir,
68
64
  runnerStatePaths
69
- } from "./chunk-C4Q77GGJ.js";
65
+ } from "./chunk-O7VMHCNN.js";
70
66
  import "./chunk-5B4DVO6C.js";
71
67
 
72
68
  // src/commands/countdown.ts
@@ -82,7 +78,10 @@ var COUNTDOWN_EXIT = {
82
78
  * does not cover the job: waits for the operator.
83
79
  */
84
80
  pending: 2,
85
- /** Circuit's Dead: failed, stalled, over the window, dirty tree, fetch failed. */
81
+ /**
82
+ * Circuit's Dead: failed, stalled, over the window, dirty tree, fetch
83
+ * failed, or a tick that reported `continue` without progress.
84
+ */
86
85
  circuitsDead: 3,
87
86
  /**
88
87
  * Needs operator: the tick ended because the agent requested a stop (a
@@ -123,29 +122,52 @@ function createAgentStopWatcher() {
123
122
  function createCostWatcher() {
124
123
  let total = 0;
125
124
  let seen = false;
125
+ let unpriced = false;
126
126
  let last = null;
127
127
  let partial = "";
128
128
  const take = (line) => {
129
129
  const hit = parseResultLine(line);
130
- if (hit === null || hit.costUsd === null) return;
131
- const replaces = hit.sessionTotal && last !== null && hit.costUsd >= last;
132
- total += replaces && last !== null ? hit.costUsd - last : hit.costUsd;
133
- last = hit.costUsd;
130
+ if (hit === null) return;
131
+ if (hit.costBasis === "unknown") unpriced = true;
132
+ const figure = hit.reportedUsd;
133
+ if (figure === null) return;
134
+ const replaces = hit.sessionTotal && last !== null && figure >= last;
135
+ total += replaces && last !== null ? figure - last : figure;
136
+ last = figure;
134
137
  seen = true;
135
138
  };
139
+ const cost = () => {
140
+ if (partial) {
141
+ take(partial);
142
+ partial = "";
143
+ }
144
+ const reportedUsd = seen ? Math.round(total * 1e6) / 1e6 : null;
145
+ return {
146
+ costUsd: unpriced ? null : reportedUsd,
147
+ reportedUsd,
148
+ costBasis: unpriced ? "unknown" : null
149
+ };
150
+ };
136
151
  return {
137
152
  push(text) {
138
153
  const lines = (partial + text).split("\n");
139
154
  partial = lines.pop() ?? "";
140
155
  for (const line of lines) take(line);
141
156
  },
142
- costUsd() {
143
- if (partial) {
144
- take(partial);
145
- partial = "";
146
- }
147
- return seen ? Math.round(total * 1e6) / 1e6 : null;
148
- }
157
+ costUsd: () => cost().costUsd,
158
+ cost
159
+ };
160
+ }
161
+ function createNoProgressWatcher() {
162
+ let hit = false;
163
+ let partial = "";
164
+ return {
165
+ push(text) {
166
+ const lines = (partial + text).split("\n");
167
+ partial = lines.pop() ?? "";
168
+ if (lines.some(isNoProgressLine)) hit = true;
169
+ },
170
+ seen: () => hit || partial !== "" && isNoProgressLine(partial)
149
171
  };
150
172
  }
151
173
  var COST_LEDGER_RELPATH = ".cursor/context/cost-ledger.ndjson";
@@ -371,7 +393,9 @@ async function executeCountdown(input) {
371
393
  plan: end.plan ?? null,
372
394
  todo: end.todo ?? null,
373
395
  exit: end.exitCode,
374
- cost_usd: end.costUsd ?? null
396
+ cost_usd: end.cost?.costUsd ?? null,
397
+ cost_usd_reported: end.cost?.reportedUsd ?? null,
398
+ cost_basis: end.cost?.costBasis ?? null
375
399
  };
376
400
  if (end.exitCode !== COUNTDOWN_EXIT.usage && end.job) {
377
401
  const failed = await appendCostLedger({
@@ -390,7 +414,9 @@ async function executeCountdown(input) {
390
414
  input_tokens: null,
391
415
  output_tokens: null,
392
416
  exit: result.exit,
393
- outcome: result.outcome
417
+ outcome: result.outcome,
418
+ cost_usd_reported: result.cost_usd_reported,
419
+ cost_basis: result.cost_basis
394
420
  }
395
421
  });
396
422
  if (failed !== null) {
@@ -549,7 +575,6 @@ async function runCountdown(input) {
549
575
  reason: refusal,
550
576
  plan,
551
577
  ...ledger,
552
- costUsd: null,
553
578
  ...logPath ? { logPath } : {}
554
579
  };
555
580
  }
@@ -593,10 +618,12 @@ async function runCountdown(input) {
593
618
  }
594
619
  const jobOut = new RedactingStreamBuffer(redactions);
595
620
  const stopWatch = runsTick ? createAgentStopWatcher() : null;
621
+ const noProgressWatch = runsTick ? createNoProgressWatcher() : null;
596
622
  const costWatch = createCostWatcher();
597
623
  const emitJob = (out) => {
598
624
  if (!out) return;
599
625
  stopWatch?.push(out);
626
+ noProgressWatch?.push(out);
600
627
  costWatch.push(out);
601
628
  write(out);
602
629
  toLog(out);
@@ -633,7 +660,8 @@ async function runCountdown(input) {
633
660
  pendingGrew,
634
661
  needsOperator: stopReason !== null && !planExhausted
635
662
  });
636
- const deadReason = end.circuitsDead ? `Circuit's Dead: ${end.circuitsDead === "window" ? `window of ${windowMin} min exceeded` : `no stream event for ${stallMin} min`}` : `Circuit's Dead: job exited with ${end.code === null ? `signal ${end.signal ?? "unknown"}` : `code ${end.code}`}`;
663
+ const noProgress = end.code === 1 && noProgressWatch?.seen() === true;
664
+ const deadReason = end.circuitsDead ? `Circuit's Dead: ${end.circuitsDead === "window" ? `window of ${windowMin} min exceeded` : `no stream event for ${stallMin} min`}` : noProgress ? `Circuit's Dead: ${NO_PROGRESS_REASON} (job exited with code 1)` : `Circuit's Dead: job exited with ${end.code === null ? `signal ${end.signal ?? "unknown"}` : `code ${end.code}`}`;
637
665
  if (exitCode === COUNTDOWN_EXIT.circuitsDead && !pendingGrew) {
638
666
  const reason2 = deadReason;
639
667
  const outcome = {
@@ -660,14 +688,14 @@ async function runCountdown(input) {
660
688
  plan,
661
689
  todo,
662
690
  ...ledger,
663
- costUsd: costWatch.costUsd(),
691
+ cost: costWatch.cost(),
664
692
  ...logPath ? { logPath } : {}
665
693
  };
666
694
  }
667
695
  var countdownCommand = defineCommand({
668
696
  meta: {
669
697
  name: "countdown",
670
- description: "Countdown: one-shot launcher for a cron/systemd timer. Runs one headless job (tick, dispatch or review) with --no-hitl --land-on-gate; refused while a gate exit is pending or when --budget-remaining does not cover it. Exit 0 done, 2 gate, findings or budget pending, 3 Circuit's Dead, 5 the agent requested a stop (needs operator). Each fire appends one line to .cursor/context/cost-ledger.ndjson; the last stdout line is AGENT_KIT_RESULT {json}. Never git-prod."
698
+ description: "Countdown: one-shot launcher for a cron/systemd timer. Runs one headless job (tick, dispatch or review) with --no-hitl --land-on-gate; refused while a gate exit is pending or when --budget-remaining does not cover it. Exit 0 done, 2 gate, findings or budget pending, 3 Circuit's Dead (failed, stalled, or a tick that reported continue without progress), 5 the agent requested a stop (needs operator). Each fire appends one line to .cursor/context/cost-ledger.ndjson (cost_usd null when the model could not be priced; cost_usd_reported keeps the reported figure); the last stdout line is AGENT_KIT_RESULT {json}. Never git-prod."
671
699
  },
672
700
  args: {
673
701
  cwd: {
@@ -762,6 +790,7 @@ export {
762
790
  countdownPreflight,
763
791
  createAgentStopWatcher,
764
792
  createCostWatcher,
793
+ createNoProgressWatcher,
765
794
  defaultSpawnJob,
766
795
  executeCountdown,
767
796
  formatCostLedgerLine,
@@ -7,7 +7,7 @@ import {
7
7
  findDashboardStart,
8
8
  readPreferredBrowserFromWorkspace,
9
9
  resolveDashboardSnapshotRoot
10
- } from "./chunk-ZMYV6PRE.js";
10
+ } from "./chunk-LEVNLHH3.js";
11
11
  import "./chunk-ZB43YMHW.js";
12
12
  export {
13
13
  applyDashboardOpenEnv,
@@ -5,7 +5,7 @@ import {
5
5
  findDashboardStart,
6
6
  negatedFlag,
7
7
  resolveDashboardSnapshotRoot
8
- } from "./chunk-ZMYV6PRE.js";
8
+ } from "./chunk-LEVNLHH3.js";
9
9
  import {
10
10
  logger
11
11
  } from "./chunk-ZB43YMHW.js";
@@ -1,24 +1,25 @@
1
1
  import {
2
2
  REGISTRY_CLI_ARGS,
3
3
  resolveRegistryFromCli
4
- } from "./chunk-PIMGV3E5.js";
4
+ } from "./chunk-SWJJW624.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-ZB43YMHW.js";
8
8
  import {
9
9
  diffAgainstRegistry,
10
10
  summarizeDiff
11
- } from "./chunk-C7SV7UP5.js";
12
- import "./chunk-SAQ3EE5R.js";
11
+ } from "./chunk-MWRYQLEG.js";
12
+ import "./chunk-HGB4DHXV.js";
13
13
  import "./chunk-CGXLR77R.js";
14
14
  import {
15
15
  canonicalizePackIds,
16
16
  formatUnknownPack,
17
17
  loadAgentKitManifest
18
- } from "./chunk-JG3CNGQM.js";
19
- import "./chunk-QX55T4UX.js";
20
- import "./chunk-6M6UKECW.js";
21
- import "./chunk-C4Q77GGJ.js";
18
+ } from "./chunk-ZNZHDPS3.js";
19
+ import "./chunk-RJP47EGS.js";
20
+ import "./chunk-IHVJTGYR.js";
21
+ import "./chunk-KMK4T4ZM.js";
22
+ import "./chunk-O7VMHCNN.js";
22
23
  import "./chunk-5B4DVO6C.js";
23
24
 
24
25
  // src/commands/diff.ts
@@ -2,19 +2,19 @@ import {
2
2
  assessHooksHealth,
3
3
  executeSafeReadinessFixes,
4
4
  refreshRepositoryProfile
5
- } from "./chunk-CIV42JGT.js";
5
+ } from "./chunk-PCIYXGB3.js";
6
6
  import {
7
7
  assessInstallHealth,
8
8
  cachedCliNpmLatest,
9
9
  npmLatestCheckAllowed,
10
10
  writeInstallHealthSnapshot,
11
11
  writeReadinessSnapshot
12
- } from "./chunk-2F6NMQOA.js";
13
- import "./chunk-NJ2SUSWX.js";
14
- import "./chunk-EO5NGAYV.js";
12
+ } from "./chunk-FB6G6OD6.js";
13
+ import "./chunk-BVZDPVUL.js";
14
+ import "./chunk-FUSNEYGU.js";
15
15
  import {
16
16
  feedInstallsRegistry
17
- } from "./chunk-WKFE3RUC.js";
17
+ } from "./chunk-NHJ4IAVN.js";
18
18
  import "./chunk-WGLPZXNU.js";
19
19
  import "./chunk-Q35TWISF.js";
20
20
  import {
@@ -23,7 +23,7 @@ import {
23
23
  import {
24
24
  detectWorkspaceParent,
25
25
  workspaceParentAdvisoryLines
26
- } from "./chunk-2XLI7XEY.js";
26
+ } from "./chunk-MGVV6YC4.js";
27
27
  import {
28
28
  createReadinessReport
29
29
  } from "./chunk-PNFF6OU3.js";
@@ -45,22 +45,23 @@ import {
45
45
  CLI_NPM_PACKAGES,
46
46
  fetchLatestCliNpmVersion,
47
47
  warnIfRunningCliBehindNpm
48
- } from "./chunk-M4UL422I.js";
48
+ } from "./chunk-Y5526WCN.js";
49
+ import "./chunk-MWRYQLEG.js";
50
+ import "./chunk-HGB4DHXV.js";
51
+ import "./chunk-CGXLR77R.js";
49
52
  import {
50
53
  loadContextConfig
51
54
  } from "./chunk-PFEUZXVT.js";
52
- import "./chunk-C7SV7UP5.js";
53
- import "./chunk-SAQ3EE5R.js";
54
- import "./chunk-CGXLR77R.js";
55
55
  import {
56
56
  loadAgentKitManifest
57
- } from "./chunk-JG3CNGQM.js";
58
- import "./chunk-QX55T4UX.js";
59
- import "./chunk-6M6UKECW.js";
57
+ } from "./chunk-ZNZHDPS3.js";
58
+ import "./chunk-RJP47EGS.js";
59
+ import "./chunk-IHVJTGYR.js";
60
+ import "./chunk-KMK4T4ZM.js";
60
61
  import {
61
62
  KIT_VERSION
62
- } from "./chunk-7HDQEK6T.js";
63
- import "./chunk-C4Q77GGJ.js";
63
+ } from "./chunk-2G4K4ZI5.js";
64
+ import "./chunk-O7VMHCNN.js";
64
65
  import {
65
66
  readJson
66
67
  } from "./chunk-5B4DVO6C.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  bundledDashboardCandidates
3
- } from "./chunk-ZMYV6PRE.js";
3
+ } from "./chunk-LEVNLHH3.js";
4
4
  import {
5
5
  DRIVER_PROTOCOL_VERSION
6
- } from "./chunk-6WUKLS4D.js";
6
+ } from "./chunk-BIFTTL2O.js";
7
7
  import "./chunk-P7732A25.js";
8
8
  import "./chunk-ZB43YMHW.js";
9
9
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  blobId,
3
3
  isTicketMerged
4
- } from "./chunk-GQSSXDDK.js";
4
+ } from "./chunk-OVRGTHZD.js";
5
5
  import {
6
6
  GATE_EXIT_BRANCH_PREFIX,
7
7
  GATE_EXIT_MARKER_RELPATH,
@@ -16,12 +16,12 @@ import {
16
16
  readGateExitMarker,
17
17
  resolveGateExitRefs,
18
18
  writeGateExitMarker
19
- } from "./chunk-XGZOU4DS.js";
20
- import "./chunk-MUTTNRX4.js";
19
+ } from "./chunk-I3FGWNU5.js";
21
20
  import {
22
21
  redactSecrets
23
- } from "./chunk-IFBIO7VT.js";
22
+ } from "./chunk-HXV6VQD4.js";
24
23
  import "./chunk-P7732A25.js";
24
+ import "./chunk-TTUFIE26.js";
25
25
  import {
26
26
  findOnPath
27
27
  } from "./chunk-WGLPZXNU.js";
@@ -30,6 +30,9 @@ import "./chunk-QTON2GQX.js";
30
30
  import {
31
31
  logger
32
32
  } from "./chunk-ZB43YMHW.js";
33
+ import "./chunk-PFEUZXVT.js";
34
+ import "./chunk-O7VMHCNN.js";
35
+ import "./chunk-5B4DVO6C.js";
33
36
 
34
37
  // src/commands/ground-control.ts
35
38
  import path from "path";
@@ -6,8 +6,7 @@ import {
6
6
  extractHandoffNamedPlans,
7
7
  namedPlanCandidatePaths,
8
8
  parsePlanFrontmatter
9
- } from "./chunk-L5V3W3DY.js";
10
- import "./chunk-MUTTNRX4.js";
9
+ } from "./chunk-TTUFIE26.js";
11
10
  import {
12
11
  PM_TOOL_LABELS
13
12
  } from "./chunk-F6C3GFKV.js";
@@ -16,7 +15,7 @@ import {
16
15
  } from "./chunk-ZB43YMHW.js";
17
16
  import {
18
17
  HANDOFF_REL
19
- } from "./chunk-C4Q77GGJ.js";
18
+ } from "./chunk-O7VMHCNN.js";
20
19
  import {
21
20
  ensureDir,
22
21
  fileExists,
@@ -1,29 +1,29 @@
1
1
  import {
2
2
  buildSessionStartAdditionalContext,
3
3
  resolveSessionRoot
4
- } from "./chunk-G5MQRP6M.js";
5
- import "./chunk-JFS4GKP7.js";
4
+ } from "./chunk-SYRJ5TTK.js";
5
+ import "./chunk-XXPI4H4D.js";
6
6
  import "./chunk-2YU2H7I6.js";
7
7
  import {
8
8
  readStdinJson
9
9
  } from "./chunk-DE3LQFSJ.js";
10
- import "./chunk-L5V3W3DY.js";
11
- import "./chunk-MUTTNRX4.js";
12
- import "./chunk-MFKHIWEL.js";
10
+ import "./chunk-FOVHFMSH.js";
13
11
  import "./chunk-MCH3E46V.js";
14
12
  import "./chunk-4CRBUEJ6.js";
15
- import "./chunk-2F6NMQOA.js";
16
- import "./chunk-WKFE3RUC.js";
17
- import "./chunk-M4UL422I.js";
18
- import "./chunk-PFEUZXVT.js";
19
- import "./chunk-C7SV7UP5.js";
20
- import "./chunk-SAQ3EE5R.js";
13
+ import "./chunk-TTUFIE26.js";
14
+ import "./chunk-FB6G6OD6.js";
15
+ import "./chunk-NHJ4IAVN.js";
16
+ import "./chunk-Y5526WCN.js";
17
+ import "./chunk-MWRYQLEG.js";
18
+ import "./chunk-HGB4DHXV.js";
21
19
  import "./chunk-CGXLR77R.js";
22
- import "./chunk-JG3CNGQM.js";
23
- import "./chunk-QX55T4UX.js";
24
- import "./chunk-6M6UKECW.js";
25
- import "./chunk-7HDQEK6T.js";
26
- import "./chunk-C4Q77GGJ.js";
20
+ import "./chunk-PFEUZXVT.js";
21
+ import "./chunk-ZNZHDPS3.js";
22
+ import "./chunk-RJP47EGS.js";
23
+ import "./chunk-IHVJTGYR.js";
24
+ import "./chunk-KMK4T4ZM.js";
25
+ import "./chunk-2G4K4ZI5.js";
26
+ import "./chunk-O7VMHCNN.js";
27
27
  import "./chunk-5B4DVO6C.js";
28
28
 
29
29
  // src/commands/hook.ts
@@ -32,10 +32,10 @@ import { defineCommand } from "citty";
32
32
 
33
33
  // src/hooks/format-session-start.ts
34
34
  function resolveSessionStartFormat(value) {
35
- return value === "claude" ? "claude" : "cursor";
35
+ return value === "claude" || value === "pi" ? value : "cursor";
36
36
  }
37
37
  function formatSessionStartOutput(additionalContext, format) {
38
- if (format === "claude") return additionalContext;
38
+ if (format === "claude" || format === "pi") return additionalContext;
39
39
  return JSON.stringify({ additional_context: additionalContext });
40
40
  }
41
41
  var SESSION_START_DEGRADED_MESSAGE = "Agent Kit session-start context is unavailable this session (internal error, fail-open mode). Nothing else is affected; retry next session.";
@@ -59,7 +59,7 @@ async function runSessionStartHook(cwd, formatArg, deps = {}) {
59
59
  const buildContext = deps.buildContext ?? buildSessionStartAdditionalContext;
60
60
  const payload = await readStdin();
61
61
  const root = resolveSessionRoot(payload, path.resolve(cwd));
62
- const out = await buildContext(root, payload);
62
+ const out = await buildContext(root, payload, { host: format });
63
63
  return formatSessionStartOutput(out.additional_context, format);
64
64
  } catch {
65
65
  return formatSessionStartOutput(SESSION_START_DEGRADED_MESSAGE, format);
@@ -68,13 +68,13 @@ async function runSessionStartHook(cwd, formatArg, deps = {}) {
68
68
  var hookCommand = defineCommand({
69
69
  meta: {
70
70
  name: "hook",
71
- description: "Cursor + Claude Code hook adapters (session-start, pre-compact). CLI is SoT."
71
+ description: "Cursor, Claude Code and pi hook adapters (session-start, pre-compact). CLI is SoT."
72
72
  },
73
73
  subCommands: {
74
74
  "session-start": defineCommand({
75
75
  meta: {
76
76
  name: "session-start",
77
- description: "Emit sessionStart context (stdin: host payload). --format cursor (default, JSON additional_context) | claude (plain stdout)"
77
+ description: "Emit sessionStart context (stdin: host payload). --format cursor (default, JSON additional_context) | claude (plain stdout) | pi (plain stdout, numbered-list HITL)"
78
78
  },
79
79
  args: {
80
80
  cwd: {
@@ -84,7 +84,7 @@ var hookCommand = defineCommand({
84
84
  format: {
85
85
  type: "string",
86
86
  default: "cursor",
87
- description: "cursor (default) | claude"
87
+ description: "cursor (default) | claude | pi"
88
88
  }
89
89
  },
90
90
  async run({ args }) {
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  rewriteRootArgvToRun
4
- } from "./chunk-KWYF7QNH.js";
5
- import "./chunk-IFBIO7VT.js";
4
+ } from "./chunk-JWIJHO67.js";
5
+ import "./chunk-HXV6VQD4.js";
6
6
  import "./chunk-P7732A25.js";
7
+ import "./chunk-TTUFIE26.js";
7
8
  import "./chunk-WGLPZXNU.js";
8
9
  import "./chunk-Q35TWISF.js";
9
10
  import {
@@ -14,10 +15,11 @@ import {
14
15
  tipAt,
15
16
  withKoloristColor
16
17
  } from "./chunk-QTON2GQX.js";
18
+ import "./chunk-PFEUZXVT.js";
17
19
  import {
18
20
  KIT_VERSION
19
- } from "./chunk-7HDQEK6T.js";
20
- import "./chunk-C4Q77GGJ.js";
21
+ } from "./chunk-2G4K4ZI5.js";
22
+ import "./chunk-O7VMHCNN.js";
21
23
  import "./chunk-5B4DVO6C.js";
22
24
 
23
25
  // src/index.ts
@@ -114,7 +116,18 @@ var CLI_HELP_GROUPS = [
114
116
  {
115
117
  id: "setup",
116
118
  title: "SETUP",
117
- commands: ["init", "install", "doctor", "status", "update", "installs", "add", "scan"]
119
+ commands: [
120
+ "init",
121
+ "install",
122
+ "doctor",
123
+ "status",
124
+ "update",
125
+ "installs",
126
+ "add",
127
+ "scan",
128
+ "pi",
129
+ "models"
130
+ ]
118
131
  },
119
132
  {
120
133
  id: "mission",
@@ -158,7 +171,8 @@ var CLI_HELP_GROUPS = [
158
171
  "diff",
159
172
  "contribute",
160
173
  "engine-info",
161
- "commands"
174
+ "commands",
175
+ "paths"
162
176
  ]
163
177
  }
164
178
  ];
@@ -234,42 +248,45 @@ var main = defineCommand({
234
248
  version: KIT_VERSION
235
249
  },
236
250
  subCommands: {
237
- init: () => import("./init-UW2BJBO2.js").then((m) => m.initCommand),
238
- install: () => import("./install-RQSI4CHG.js").then((m) => m.installCommand),
251
+ init: () => import("./init-ZHLVXEVT.js").then((m) => m.initCommand),
252
+ install: () => import("./install-XWOG64W3.js").then((m) => m.installCommand),
239
253
  scan: () => import("./scan-7D3RMO34.js").then((m) => m.scanCommand),
240
- add: () => import("./add-OYLOMCM6.js").then((m) => m.addCommand),
241
- doctor: () => import("./doctor-TJSXBVGV.js").then((m) => m.doctorCommand),
242
- "setup-global": () => import("./setup-global-ST4TT427.js").then((m) => m.setupGlobalCommand),
243
- status: () => import("./status-HUBPBGUU.js").then((m) => m.statusCommand),
244
- update: () => import("./update-DD5UZPGG.js").then((m) => m.updateCommand),
245
- installs: () => import("./installs-7TR4H4QH.js").then((m) => m.installsCommand),
254
+ add: () => import("./add-G7KEZLWP.js").then((m) => m.addCommand),
255
+ doctor: () => import("./doctor-KGUWU5SN.js").then((m) => m.doctorCommand),
256
+ "setup-global": () => import("./setup-global-WDMARD4Z.js").then((m) => m.setupGlobalCommand),
257
+ status: () => import("./status-2WNJL7PP.js").then((m) => m.statusCommand),
258
+ update: () => import("./update-YSVOYYK5.js").then((m) => m.updateCommand),
259
+ installs: () => import("./installs-2ROXPO6M.js").then((m) => m.installsCommand),
246
260
  "cursor-awareness": () => import("./cursor-awareness-TN5JXD2C.js").then((m) => m.cursorAwarenessCommand),
247
261
  "public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
248
262
  "remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
249
263
  dogfood: () => import("./dogfood-2JAHSYQA.js").then((m) => m.dogfoodCommand),
250
- diff: () => import("./diff-NZVBVQSK.js").then((m) => m.diffCommand),
251
- contribute: () => import("./contribute-LSY75JZH.js").then((m) => m.contributeCommand),
252
- handoff: () => import("./handoff-2OZSWGTE.js").then((m) => m.handoffCommand),
253
- "plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
254
- run: () => import("./run-CQF5RM5X.js").then((m) => m.runCommand),
255
- "run-plan": () => import("./run-plan-BEOCOJCF.js").then((m) => m.runPlanCommand),
256
- "run-plan-all": () => import("./run-CQF5RM5X.js").then((m) => m.runPlanAllCommand),
257
- queue: () => import("./queue-JHYILLMX.js").then((m) => m.queueCommand),
264
+ diff: () => import("./diff-3XUZM7ZT.js").then((m) => m.diffCommand),
265
+ contribute: () => import("./contribute-HE4WCBRY.js").then((m) => m.contributeCommand),
266
+ handoff: () => import("./handoff-LLT4CI6H.js").then((m) => m.handoffCommand),
267
+ "plan-index": () => import("./plan-index-5QZJK4AG.js").then((m) => m.planIndexCommand),
268
+ run: () => import("./run-QURAXAR2.js").then((m) => m.runCommand),
269
+ "run-plan": () => import("./run-plan-4MMHVCTS.js").then((m) => m.runPlanCommand),
270
+ "run-plan-all": () => import("./run-QURAXAR2.js").then((m) => m.runPlanAllCommand),
271
+ queue: () => import("./queue-Z5VNNHM6.js").then((m) => m.queueCommand),
258
272
  promote: () => import("./promote-H5MIMVEB.js").then((m) => m.promoteCommand),
259
- countdown: () => import("./countdown-SZ2P4XHB.js").then((m) => m.countdownCommand),
260
- "ground-control": () => import("./ground-control-ZJXPUIQN.js").then((m) => m.groundControlCommand),
261
- conflicts: () => import("./conflicts-RING6AHV.js").then((m) => m.conflictsCommand),
262
- dashboard: () => import("./dashboard-P65XHYCU.js").then((m) => m.dashboardCommand),
263
- "dashboard-broadcast": () => import("./dashboard-broadcast-GYK34QYL.js").then((m) => m.dashboardBroadcastCommand),
264
- "mission-control": () => import("./mission-control-VSU6NT43.js").then((m) => m.missionControlCommand),
265
- hook: () => import("./hook-3VPKNSOO.js").then((m) => m.hookCommand),
273
+ countdown: () => import("./countdown-TYQHVAIX.js").then((m) => m.countdownCommand),
274
+ "ground-control": () => import("./ground-control-ZIDHEOPW.js").then((m) => m.groundControlCommand),
275
+ conflicts: () => import("./conflicts-4SUWIPWP.js").then((m) => m.conflictsCommand),
276
+ dashboard: () => import("./dashboard-6V6PCNYF.js").then((m) => m.dashboardCommand),
277
+ "dashboard-broadcast": () => import("./dashboard-broadcast-PMVQ7PXU.js").then((m) => m.dashboardBroadcastCommand),
278
+ "mission-control": () => import("./mission-control-IGOI3WHS.js").then((m) => m.missionControlCommand),
279
+ hook: () => import("./hook-UPZ3CPYS.js").then((m) => m.hookCommand),
266
280
  guard: () => import("./guard-ZO4Z3LLB.js").then((m) => m.guardCommand),
267
281
  monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
268
- sessions: () => import("./sessions-AWAAO3DU.js").then((m) => m.sessionsCommand),
282
+ sessions: () => import("./sessions-WWWLYPW6.js").then((m) => m.sessionsCommand),
269
283
  "outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
270
284
  validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
271
- "engine-info": () => import("./engine-info-BBI5QO5Y.js").then((m) => m.engineInfoCommand),
272
- commands: () => import("./commands-UW2C2ZN4.js").then((m) => m.commandsCommand)
285
+ "engine-info": () => import("./engine-info-VM4VPGQM.js").then((m) => m.engineInfoCommand),
286
+ commands: () => import("./commands-K4HSDML5.js").then((m) => m.commandsCommand),
287
+ paths: () => import("./paths-JTPV6SXH.js").then((m) => m.pathsCommand),
288
+ pi: () => import("./pi-DCMDOY65.js").then((m) => m.piCommand),
289
+ models: () => import("./models-5BDXREWM.js").then((m) => m.modelsCommand)
273
290
  },
274
291
  async run({ rawArgs }) {
275
292
  if (hasCliSubcommand(rawArgs)) return;