@dadado/agent-kit-cli 6.12.0 → 6.13.1

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 (44) hide show
  1. package/dashboard/dashboard-data.mjs +19 -3
  2. package/dashboard/lib/live-refresh.mjs +1 -0
  3. package/dashboard/lib/workspace-docs.d.mts +49 -0
  4. package/dashboard/lib/workspace-docs.mjs +231 -0
  5. package/dist/{add-CLRIMPN4.js → add-FTPXOOZD.js} +3 -3
  6. package/dist/{chunk-I2SG2VPJ.js → chunk-2KATW2O4.js} +2 -2
  7. package/dist/{chunk-2KIOZMTV.js → chunk-4PL57BZ5.js} +4 -0
  8. package/dist/{chunk-DVCNJNCF.js → chunk-6QBU4DQF.js} +3 -3
  9. package/dist/{chunk-5RWTDCJ7.js → chunk-A4PHFHYO.js} +4 -1
  10. package/dist/{chunk-UX6FHSO7.js → chunk-AEUE74EZ.js} +1 -1
  11. package/dist/{chunk-WAWCS5PJ.js → chunk-CFJRCJWD.js} +12 -2
  12. package/dist/{chunk-2R4HYPQH.js → chunk-DONKV6MA.js} +2 -2
  13. package/dist/{chunk-XJWCL4PO.js → chunk-DQLIEJFK.js} +1 -1
  14. package/dist/{chunk-TFKEHC2D.js → chunk-GYPCR4UO.js} +8 -4
  15. package/dist/{chunk-LAYMAMPL.js → chunk-JGEGTOF6.js} +1 -1
  16. package/dist/{chunk-OKQ3SAHK.js → chunk-JRCI2GNS.js} +1 -1
  17. package/dist/{chunk-IBE2EJZS.js → chunk-LQJNGECA.js} +2 -1
  18. package/dist/{chunk-HWYVLEET.js → chunk-N7HMTWS5.js} +4 -4
  19. package/dist/{chunk-7TEEGAED.js → chunk-NDKSOPP7.js} +1 -0
  20. package/dist/{chunk-FX6BIH4C.js → chunk-OVRWRZ5S.js} +2 -2
  21. package/dist/{chunk-5T4CHRRR.js → chunk-PHH3H5EQ.js} +1 -1
  22. package/dist/{chunk-ODI2N2BN.js → chunk-PXURVVVO.js} +2 -2
  23. package/dist/{chunk-4WHPZGF4.js → chunk-SKC6QZW4.js} +30 -5
  24. package/dist/{chunk-PGCRP5A6.js → chunk-W6U3Z2RU.js} +8 -8
  25. package/dist/{chunk-LFWPB2JR.js → chunk-ZFJIJUZ4.js} +1 -0
  26. package/dist/{commands-DVEZOEEO.js → commands-MVUJZEJ6.js} +4 -4
  27. package/dist/{contribute-E3COXKH4.js → contribute-EKTMMEYU.js} +5 -5
  28. package/dist/{countdown-F6EIHGDR.js → countdown-TFKPAYIQ.js} +2 -2
  29. package/dist/{diff-SCGNC4SF.js → diff-RFW6K4X5.js} +6 -6
  30. package/dist/{doctor-QGO4QB7R.js → doctor-3KNZI3CK.js} +10 -10
  31. package/dist/{engine-info-MNCKB55Y.js → engine-info-CYDRD7SW.js} +1 -1
  32. package/dist/{guard-X6FNFZ27.js → guard-RJZEEKSL.js} +50 -8
  33. package/dist/{hook-R7V4NG3C.js → hook-VXHZ4ICK.js} +6 -6
  34. package/dist/index.js +20 -20
  35. package/dist/{init-ONPKZS63.js → init-BDWKZGMP.js} +13 -13
  36. package/dist/{install-NHTYTVSG.js → install-NXNO4RTU.js} +13 -13
  37. package/dist/{mission-control-C2QV5D25.js → mission-control-JIF6GFSV.js} +1 -1
  38. package/dist/{queue-XI4HUFLJ.js → queue-VLIWWVKM.js} +3 -3
  39. package/dist/{run-EO5P2YZG.js → run-NKCDKMTC.js} +7 -7
  40. package/dist/{run-plan-VMW34QY6.js → run-plan-3PCINKTY.js} +3 -3
  41. package/dist/{setup-global-PMKGHX2S.js → setup-global-K53H3ZEH.js} +7 -7
  42. package/dist/{status-P2I6LE6Y.js → status-GFV3KCUR.js} +8 -8
  43. package/dist/{update-K6L24JDP.js → update-25WSBSWM.js} +11 -11
  44. package/package.json +2 -2
@@ -5,7 +5,7 @@ import {
5
5
  DEFAULT_REGISTRY_REF,
6
6
  DEFAULT_REGISTRY_URL,
7
7
  resolveRegistryRoot
8
- } from "./chunk-XJWCL4PO.js";
8
+ } from "./chunk-DQLIEJFK.js";
9
9
 
10
10
  // src/lifecycle/resolve-cli.ts
11
11
  async function resolveRegistryFromCli(options) {
@@ -3,11 +3,11 @@ import {
3
3
  GUARD_SHELL_HOOK_MARKER,
4
4
  RESOLVE_AGENT_KIT_REL,
5
5
  SESSION_START_HOOK_MARKER
6
- } from "./chunk-LAYMAMPL.js";
6
+ } from "./chunk-JGEGTOF6.js";
7
7
  import {
8
8
  CLAUDE_COMMANDS_DIR_REL,
9
9
  discoverInstalledCommands
10
- } from "./chunk-IBE2EJZS.js";
10
+ } from "./chunk-LQJNGECA.js";
11
11
  import {
12
12
  findOnPath
13
13
  } from "./chunk-WGLPZXNU.js";
@@ -6,7 +6,7 @@ import {
6
6
  import { createInterface } from "readline";
7
7
  import { StringDecoder } from "string_decoder";
8
8
  var DRIVER_PROTOCOL_MAJOR = 1;
9
- var DRIVER_PROTOCOL_VERSION = "1.4.0";
9
+ var DRIVER_PROTOCOL_VERSION = "1.5.0";
10
10
  var DRIVER_EVENTS_FORMATS = ["ndjson"];
11
11
  var INBOUND_MAX_CHARS = 64 * 1024;
12
12
  var AGENT_PENDING_MAX_CHARS = 4 * 1024 * 1024;
@@ -38,6 +38,7 @@ function driverReplies(replies) {
38
38
  function driverStop(stop) {
39
39
  return stop ? { askId: stop.askId, cause: stop.cause, message: stop.message, exitCode: stop.exitCode } : null;
40
40
  }
41
+ var STOPPED_BY_REQUEST_REASON = "stopped by request";
41
42
  function parseDriverInbound(line) {
42
43
  const text = line.trim();
43
44
  if (text.length > INBOUND_MAX_CHARS) return { ok: false, error: "line too long" };
@@ -54,10 +55,13 @@ function parseDriverInbound(line) {
54
55
  if (msg.v !== void 0 && msg.v !== DRIVER_PROTOCOL_MAJOR) {
55
56
  return { ok: false, error: `unsupported protocol v${String(msg.v)}` };
56
57
  }
57
- if (msg.type === "stop") {
58
+ if (msg.type === "stop" || msg.type === "stop_after_tick") {
58
59
  return {
59
60
  ok: true,
60
- message: { type: "stop", ...typeof msg.reason === "string" ? { reason: msg.reason } : {} }
61
+ message: {
62
+ type: msg.type,
63
+ ...typeof msg.reason === "string" ? { reason: msg.reason } : {}
64
+ }
61
65
  };
62
66
  }
63
67
  if (msg.type !== "hitl_reply")
@@ -90,6 +94,9 @@ function inboundToRawAnswer(gate, parsed) {
90
94
  if (!parsed.ok) return { kind: "stop", cause: "protocol error", detail: parsed.error };
91
95
  const message = parsed.message;
92
96
  if (message.type === "stop") return { kind: "stop", cause: "driver stop" };
97
+ if (message.type === "stop_after_tick") {
98
+ return { kind: "stop", cause: "driver stop", detail: "stop_after_tick at an open gate" };
99
+ }
93
100
  if (message.askId !== gate.askId) {
94
101
  return {
95
102
  kind: "stop",
@@ -103,6 +110,7 @@ function createDriverAnswerReader(opts) {
103
110
  const input = opts.input ?? process.stdin;
104
111
  const queue = [];
105
112
  let ended = false;
113
+ let stopRequested = false;
106
114
  let waiter = null;
107
115
  let rl = null;
108
116
  const ensure = () => {
@@ -114,7 +122,17 @@ function createDriverAnswerReader(opts) {
114
122
  const w = waiter;
115
123
  waiter = null;
116
124
  w(line);
117
- } else queue.push(line);
125
+ return;
126
+ }
127
+ const parsed = parseDriverInbound(line);
128
+ if (parsed.ok && parsed.message.type === "stop_after_tick") {
129
+ if (!stopRequested) {
130
+ stopRequested = true;
131
+ opts.onStopRequested?.(parsed.message.reason);
132
+ }
133
+ return;
134
+ }
135
+ queue.push(line);
118
136
  });
119
137
  rl.on("close", () => {
120
138
  ended = true;
@@ -150,9 +168,14 @@ function createDriverAnswerReader(opts) {
150
168
  signal?.addEventListener("abort", onAbort, { once: true });
151
169
  waiter = settle;
152
170
  });
171
+ ensure();
153
172
  return {
154
173
  read: async (gate, readOpts) => {
155
174
  ensure();
175
+ if (stopRequested) {
176
+ return { kind: "stop", cause: "driver stop", detail: "stop_after_tick before the gate" };
177
+ }
178
+ const pending = nextLine(readOpts.signal);
156
179
  opts.emitter.emit({
157
180
  type: "hitl_gate",
158
181
  tick: opts.tick(),
@@ -162,10 +185,11 @@ function createDriverAnswerReader(opts) {
162
185
  line: formatHitlGateLine(gate),
163
186
  usage: readOpts.usage ?? null
164
187
  });
165
- const line = await nextLine(readOpts.signal);
188
+ const line = await pending;
166
189
  if (line === null) return { kind: "eof" };
167
190
  return inboundToRawAnswer(gate, parseDriverInbound(line));
168
191
  },
192
+ stopRequested: () => stopRequested,
169
193
  close: () => {
170
194
  const r = rl;
171
195
  rl = null;
@@ -243,6 +267,7 @@ export {
243
267
  createDriverEmitter,
244
268
  driverReplies,
245
269
  driverStop,
270
+ STOPPED_BY_REQUEST_REASON,
246
271
  createDriverAnswerReader,
247
272
  DriverAgentSink
248
273
  };
@@ -6,7 +6,7 @@ import {
6
6
  formatStaleCliRefusal,
7
7
  installL0,
8
8
  syncFromManifest
9
- } from "./chunk-HWYVLEET.js";
9
+ } from "./chunk-N7HMTWS5.js";
10
10
  import {
11
11
  SkippedSymlinkError,
12
12
  formatPersonalizationSkippedSymlinks,
@@ -15,21 +15,21 @@ import {
15
15
  import {
16
16
  REGISTRY_CLI_ARGS,
17
17
  resolveRegistryFromCli
18
- } from "./chunk-5T4CHRRR.js";
18
+ } from "./chunk-PHH3H5EQ.js";
19
19
  import {
20
20
  assessClaudeCommandAdapters,
21
21
  executeSafeReadinessFixes
22
- } from "./chunk-ODI2N2BN.js";
22
+ } from "./chunk-PXURVVVO.js";
23
23
  import {
24
24
  writeReadinessSnapshot
25
25
  } from "./chunk-HAFRAXGV.js";
26
26
  import {
27
27
  writeClaudeSessionStartHook
28
- } from "./chunk-LAYMAMPL.js";
28
+ } from "./chunk-JGEGTOF6.js";
29
29
  import {
30
30
  CLAUDE_HITL_FALLBACK,
31
31
  generateClaudeCommandAdapters
32
- } from "./chunk-IBE2EJZS.js";
32
+ } from "./chunk-LQJNGECA.js";
33
33
  import {
34
34
  shouldUseWelcomeColor,
35
35
  withCliProgress
@@ -56,13 +56,13 @@ import {
56
56
  npxPinned,
57
57
  pathCliStatus,
58
58
  syncPathCliToRuntime
59
- } from "./chunk-I2SG2VPJ.js";
59
+ } from "./chunk-2KATW2O4.js";
60
60
  import {
61
61
  assessEnvironment
62
62
  } from "./chunk-B3VR5YBQ.js";
63
63
  import {
64
64
  warnIfRunningCliBehindNpm
65
- } from "./chunk-2R4HYPQH.js";
65
+ } from "./chunk-DONKV6MA.js";
66
66
  import {
67
67
  DOMAIN_PACK_IDS,
68
68
  allPacks,
@@ -79,7 +79,7 @@ import {
79
79
  resolveProtectedGlobs,
80
80
  saveManifest,
81
81
  skillTargetDir
82
- } from "./chunk-XJWCL4PO.js";
82
+ } from "./chunk-DQLIEJFK.js";
83
83
  import {
84
84
  KIT_VERSION,
85
85
  pinnedCliSpec
@@ -33,6 +33,7 @@ var SNAPSHOT_REPO_SOURCE_RELS = Object.freeze([
33
33
  ".cursor/HANDOFF.md",
34
34
  ".cursor/agents",
35
35
  ".cursor/commands",
36
+ ".cursor/rules",
36
37
  ".cursor/memory",
37
38
  ".cursor/context/config.json",
38
39
  ".cursor/context/current",
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  RUN_CATALOG
3
- } from "./chunk-7TEEGAED.js";
3
+ } from "./chunk-NDKSOPP7.js";
4
4
  import "./chunk-GDKTTV2A.js";
5
5
  import "./chunk-WRCXRV2U.js";
6
6
  import {
7
7
  discoverInstalledCommands
8
- } from "./chunk-IBE2EJZS.js";
8
+ } from "./chunk-LQJNGECA.js";
9
9
  import "./chunk-WGLPZXNU.js";
10
10
  import "./chunk-6RRG3WOE.js";
11
11
  import "./chunk-QTON2GQX.js";
12
12
  import {
13
13
  L0_ARTIFACTS
14
- } from "./chunk-2KIOZMTV.js";
15
- import "./chunk-5RWTDCJ7.js";
14
+ } from "./chunk-4PL57BZ5.js";
15
+ import "./chunk-A4PHFHYO.js";
16
16
  import {
17
17
  KIT_VERSION
18
18
  } from "./chunk-7HDQEK6T.js";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  REGISTRY_CLI_ARGS,
3
3
  resolveRegistryFromCli
4
- } from "./chunk-5T4CHRRR.js";
4
+ } from "./chunk-PHH3H5EQ.js";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-ZB43YMHW.js";
8
8
  import {
9
9
  managedPairs
10
- } from "./chunk-FX6BIH4C.js";
11
- import "./chunk-2KIOZMTV.js";
10
+ } from "./chunk-OVRWRZ5S.js";
11
+ import "./chunk-4PL57BZ5.js";
12
12
  import {
13
13
  loadAgentKitManifest,
14
14
  normalizeRelPath
15
- } from "./chunk-XJWCL4PO.js";
15
+ } from "./chunk-DQLIEJFK.js";
16
16
  import {
17
17
  resolveContained
18
- } from "./chunk-5RWTDCJ7.js";
18
+ } from "./chunk-A4PHFHYO.js";
19
19
  import "./chunk-C4Q77GGJ.js";
20
20
  import "./chunk-5B4DVO6C.js";
21
21
 
@@ -4,7 +4,7 @@ import {
4
4
  REVIEW_PACK_SLASH,
5
5
  parseReviewPackMaxBytes,
6
6
  reviewBackendMessage
7
- } from "./chunk-UX6FHSO7.js";
7
+ } from "./chunk-AEUE74EZ.js";
8
8
  import {
9
9
  detectAgentBackend,
10
10
  listDetectBackendIds
@@ -27,7 +27,7 @@ import {
27
27
  normalizeSlashName,
28
28
  promoteBlockedMessage,
29
29
  unknownSlashMessage
30
- } from "./chunk-7TEEGAED.js";
30
+ } from "./chunk-NDKSOPP7.js";
31
31
  import {
32
32
  CLAUDE_MAX_BUDGET_USD_ENV,
33
33
  CLAUDE_MAX_TURNS_ENV,
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  REGISTRY_CLI_ARGS,
3
3
  resolveRegistryFromCli
4
- } from "./chunk-5T4CHRRR.js";
4
+ } from "./chunk-PHH3H5EQ.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-DVCNJNCF.js";
12
- import "./chunk-FX6BIH4C.js";
13
- import "./chunk-2KIOZMTV.js";
11
+ } from "./chunk-6QBU4DQF.js";
12
+ import "./chunk-OVRWRZ5S.js";
13
+ import "./chunk-4PL57BZ5.js";
14
14
  import {
15
15
  loadAgentKitManifest
16
- } from "./chunk-XJWCL4PO.js";
17
- import "./chunk-5RWTDCJ7.js";
16
+ } from "./chunk-DQLIEJFK.js";
17
+ import "./chunk-A4PHFHYO.js";
18
18
  import "./chunk-C4Q77GGJ.js";
19
19
  import "./chunk-5B4DVO6C.js";
20
20
 
@@ -2,12 +2,12 @@ import {
2
2
  assessHooksHealth,
3
3
  executeSafeReadinessFixes,
4
4
  refreshRepositoryProfile
5
- } from "./chunk-ODI2N2BN.js";
5
+ } from "./chunk-PXURVVVO.js";
6
6
  import {
7
7
  writeReadinessSnapshot
8
8
  } from "./chunk-HAFRAXGV.js";
9
- import "./chunk-LAYMAMPL.js";
10
- import "./chunk-IBE2EJZS.js";
9
+ import "./chunk-JGEGTOF6.js";
10
+ import "./chunk-LQJNGECA.js";
11
11
  import "./chunk-WGLPZXNU.js";
12
12
  import "./chunk-6RRG3WOE.js";
13
13
  import {
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  detectWorkspaceParent,
18
18
  workspaceParentAdvisoryLines
19
- } from "./chunk-OKQ3SAHK.js";
19
+ } from "./chunk-JRCI2GNS.js";
20
20
  import {
21
21
  createReadinessReport
22
22
  } from "./chunk-PNFF6OU3.js";
@@ -33,13 +33,13 @@ import {
33
33
  } from "./chunk-B3VR5YBQ.js";
34
34
  import {
35
35
  warnIfRunningCliBehindNpm
36
- } from "./chunk-2R4HYPQH.js";
36
+ } from "./chunk-DONKV6MA.js";
37
37
  import "./chunk-PFEUZXVT.js";
38
- import "./chunk-DVCNJNCF.js";
39
- import "./chunk-FX6BIH4C.js";
40
- import "./chunk-2KIOZMTV.js";
41
- import "./chunk-XJWCL4PO.js";
42
- import "./chunk-5RWTDCJ7.js";
38
+ import "./chunk-6QBU4DQF.js";
39
+ import "./chunk-OVRWRZ5S.js";
40
+ import "./chunk-4PL57BZ5.js";
41
+ import "./chunk-DQLIEJFK.js";
42
+ import "./chunk-A4PHFHYO.js";
43
43
  import {
44
44
  KIT_VERSION
45
45
  } from "./chunk-7HDQEK6T.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DRIVER_PROTOCOL_VERSION
3
- } from "./chunk-4WHPZGF4.js";
3
+ } from "./chunk-SKC6QZW4.js";
4
4
  import {
5
5
  bundledDashboardCandidates
6
6
  } from "./chunk-XDCCYBCJ.js";
@@ -157,6 +157,32 @@ var GIT_GLOBAL_OPTS = /* @__PURE__ */ new Map([
157
157
  ["-P", false],
158
158
  ["--literal-pathspecs", false]
159
159
  ]);
160
+ var SHELL_RESERVED_HEADS = /* @__PURE__ */ new Set([
161
+ "do",
162
+ "then",
163
+ "else",
164
+ "elif",
165
+ "if",
166
+ "while",
167
+ "until",
168
+ "!"
169
+ ]);
170
+ var SHELL_C_RE = /^(?:[\w./-]+\/)?(?:ba|z|da)?sh$/;
171
+ var SHELL_ARG_FLAGS = /* @__PURE__ */ new Set(["-o", "+o", "-O", "+O"]);
172
+ function shellCScriptIndex(tokens) {
173
+ let i = 1;
174
+ let hasC = false;
175
+ while (i < tokens.length && /^[-+]/.test(tokens[i])) {
176
+ const f = tokens[i];
177
+ if (SHELL_ARG_FLAGS.has(f)) {
178
+ i += 2;
179
+ continue;
180
+ }
181
+ if (/^-[a-zA-Z]+$/.test(f) && f.includes("c")) hasC = true;
182
+ i++;
183
+ }
184
+ return hasC ? i : -1;
185
+ }
160
186
  function canonicalGitHead(segment) {
161
187
  let tokens = normalizeShellCommand(segment).split(" ").filter(Boolean);
162
188
  for (; ; ) {
@@ -167,10 +193,17 @@ function canonicalGitHead(segment) {
167
193
  tokens = rest ? [rest, ...tokens.slice(1)] : tokens.slice(1);
168
194
  continue;
169
195
  }
170
- if (/^\w+=/.test(t)) {
196
+ if (/^\w+=/.test(t) || SHELL_RESERVED_HEADS.has(t)) {
171
197
  tokens = tokens.slice(1);
172
198
  continue;
173
199
  }
200
+ if (SHELL_C_RE.test(t)) {
201
+ const i = shellCScriptIndex(tokens);
202
+ if (i < 0) break;
203
+ const script = (tokens[i] ?? "").replace(/^\$?['"]/, "");
204
+ tokens = script ? [script, ...tokens.slice(i + 1)] : tokens.slice(i + 1);
205
+ continue;
206
+ }
174
207
  const argFlags = WRAPPER_ARG_FLAGS.get(t);
175
208
  if (argFlags) {
176
209
  let i = 1;
@@ -183,7 +216,7 @@ function canonicalGitHead(segment) {
183
216
  break;
184
217
  }
185
218
  if (tokens.length > 0) {
186
- const last = tokens[tokens.length - 1].replace(/[)}]+$/, "");
219
+ const last = tokens[tokens.length - 1].replace(/[)}'"]+$/, "");
187
220
  tokens = last ? [...tokens.slice(0, -1), last] : tokens.slice(0, -1);
188
221
  }
189
222
  if (tokens.length > 0 && /^(?:[\w./-]+\/)?git$/.test(tokens[0])) {
@@ -327,14 +360,22 @@ var PR_MERGE_CALL_RE = /(?:^|[\s'"(;|&`$!{])(?:[\w./-]+\/)?(?:gh\s+pr|glab\s+mr)
327
360
  function unresolvedPrMergeCall(command) {
328
361
  if (!PR_MERGE_CALL_RE.test(command)) return false;
329
362
  return shellSegments(command).some(
330
- (segment) => PR_MERGE_CALL_RE.test(segment) && !segmentHasAllowMainPushEnv(segment) && parsePrMergeHead(canonicalGitHead(segment)) === null
363
+ (segment) => PR_MERGE_CALL_RE.test(segment) && !segmentHasAllowMainPushEnv(segment) && literalPrMergeTarget(segment) === null
331
364
  );
332
365
  }
366
+ var SHELL_EXPANSION_RE = /[$`'"\\]/;
367
+ function literalPrMergeTarget(segment) {
368
+ const target = parsePrMergeHead(canonicalGitHead(segment));
369
+ if (!target) return null;
370
+ if (SHELL_EXPANSION_RE.test(target.selector ?? "")) return null;
371
+ if (SHELL_EXPANSION_RE.test(target.repo ?? "")) return null;
372
+ return target;
373
+ }
333
374
  function prMergeKey(target) {
334
375
  return `${target.forge}\0${target.repo ?? ""}\0${target.selector ?? ""}`;
335
376
  }
336
377
  function prMergeTargets(command) {
337
- return shellSegments(command).map((segment) => parsePrMergeHead(canonicalGitHead(segment))).filter((t) => t !== null);
378
+ return shellSegments(command).map(literalPrMergeTarget).filter((t) => t !== null);
338
379
  }
339
380
  function anyHeadMatches(command, re) {
340
381
  return shellInvocationHeads(command).some((head) => re.test(head));
@@ -448,10 +489,11 @@ var SHELL_DENY_RULES = [
448
489
  // A forge API merge (`gh api … pulls/<n>/merge`, a GraphQL merge mutation) has no base
449
490
  // to resolve and no /git-staging use: it is denied outright, so neither the API nor
450
491
  // Colony's host path (typed yes for main) can be bypassed that way. A merge behind a head
451
- // the parser does not read (loop body, `then`, `!`, `xargs`, `bash -c`) has no target
452
- // either: denied outright too, so an unrecognized head cannot skip the base check.
492
+ // the parser does not read (`xargs`) has no target either: denied outright too, so an
493
+ // unrecognized head cannot skip the base check. Loop bodies, `then`, `!` and `bash -c`
494
+ // are read by `canonicalGitHead` and go through the base check.
453
495
  id: "pr-merge-protected-base",
454
- description: "merging a PR/MR into main/master/prod bypasses /git-prod; an unresolved base (gh/glab could not read the PR/MR: not logged in, wrong selector, or no such PR) is denied too, and so is any gh api / glab api merge call (REST merge endpoint or GraphQL merge mutation) and any gh pr merge / glab mr merge the guard cannot resolve to a literal target (inside a loop, if, xargs, bash -c or sh -c, or after !: run a literal `gh pr merge <n>` at the head of its own segment; text that only mentions the command is denied too)",
496
+ description: "merging a PR/MR into main/master/prod bypasses /git-prod; an unresolved base (gh/glab could not read the PR/MR: not logged in, wrong selector, or no such PR) is denied too, and so is any gh api / glab api merge call (REST merge endpoint or GraphQL merge mutation) and any gh pr merge / glab mr merge the guard cannot resolve to a literal target (one run by xargs, or a loop over `$n`: run a literal `gh pr merge <n>` at the head of its own segment; text that only mentions the command is denied too)",
455
497
  test: (cmd, opts) => {
456
498
  if (forgeApiMergeCall(cmd)) return true;
457
499
  if (unresolvedPrMergeCall(cmd)) return true;
@@ -459,7 +501,7 @@ var SHELL_DENY_RULES = [
459
501
  if (!bases) return false;
460
502
  return shellSegments(cmd).some((segment) => {
461
503
  if (segmentHasAllowMainPushEnv(segment)) return false;
462
- const target = parsePrMergeHead(canonicalGitHead(segment));
504
+ const target = literalPrMergeTarget(segment);
463
505
  if (!target) return false;
464
506
  const base = bases[prMergeKey(target)];
465
507
  return typeof base !== "string" || isProtectedBranch(base);
@@ -23,17 +23,17 @@ import {
23
23
  } from "./chunk-HAFRAXGV.js";
24
24
  import {
25
25
  stampLastCheckedAt
26
- } from "./chunk-2R4HYPQH.js";
26
+ } from "./chunk-DONKV6MA.js";
27
27
  import {
28
28
  loadContextConfig
29
29
  } from "./chunk-PFEUZXVT.js";
30
- import "./chunk-DVCNJNCF.js";
31
- import "./chunk-FX6BIH4C.js";
32
- import "./chunk-2KIOZMTV.js";
30
+ import "./chunk-6QBU4DQF.js";
31
+ import "./chunk-OVRWRZ5S.js";
32
+ import "./chunk-4PL57BZ5.js";
33
33
  import {
34
34
  MANIFEST_RELATIVE_PATH
35
- } from "./chunk-XJWCL4PO.js";
36
- import "./chunk-5RWTDCJ7.js";
35
+ } from "./chunk-DQLIEJFK.js";
36
+ import "./chunk-A4PHFHYO.js";
37
37
  import "./chunk-7HDQEK6T.js";
38
38
  import {
39
39
  HANDOFF_REL
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  rewriteRootArgvToRun
4
- } from "./chunk-7TEEGAED.js";
4
+ } from "./chunk-NDKSOPP7.js";
5
5
  import "./chunk-GDKTTV2A.js";
6
6
  import "./chunk-WRCXRV2U.js";
7
7
  import "./chunk-WGLPZXNU.js";
@@ -232,39 +232,39 @@ var main = defineCommand({
232
232
  version: KIT_VERSION
233
233
  },
234
234
  subCommands: {
235
- init: () => import("./init-ONPKZS63.js").then((m) => m.initCommand),
236
- install: () => import("./install-NHTYTVSG.js").then((m) => m.installCommand),
235
+ init: () => import("./init-BDWKZGMP.js").then((m) => m.initCommand),
236
+ install: () => import("./install-NXNO4RTU.js").then((m) => m.installCommand),
237
237
  scan: () => import("./scan-BWA64R7I.js").then((m) => m.scanCommand),
238
- add: () => import("./add-CLRIMPN4.js").then((m) => m.addCommand),
239
- doctor: () => import("./doctor-QGO4QB7R.js").then((m) => m.doctorCommand),
240
- "setup-global": () => import("./setup-global-PMKGHX2S.js").then((m) => m.setupGlobalCommand),
241
- status: () => import("./status-P2I6LE6Y.js").then((m) => m.statusCommand),
242
- update: () => import("./update-K6L24JDP.js").then((m) => m.updateCommand),
238
+ add: () => import("./add-FTPXOOZD.js").then((m) => m.addCommand),
239
+ doctor: () => import("./doctor-3KNZI3CK.js").then((m) => m.doctorCommand),
240
+ "setup-global": () => import("./setup-global-K53H3ZEH.js").then((m) => m.setupGlobalCommand),
241
+ status: () => import("./status-GFV3KCUR.js").then((m) => m.statusCommand),
242
+ update: () => import("./update-25WSBSWM.js").then((m) => m.updateCommand),
243
243
  "cursor-awareness": () => import("./cursor-awareness-TN5JXD2C.js").then((m) => m.cursorAwarenessCommand),
244
244
  "public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
245
245
  "remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
246
246
  dogfood: () => import("./dogfood-2JAHSYQA.js").then((m) => m.dogfoodCommand),
247
- diff: () => import("./diff-SCGNC4SF.js").then((m) => m.diffCommand),
248
- contribute: () => import("./contribute-E3COXKH4.js").then((m) => m.contributeCommand),
247
+ diff: () => import("./diff-RFW6K4X5.js").then((m) => m.diffCommand),
248
+ contribute: () => import("./contribute-EKTMMEYU.js").then((m) => m.contributeCommand),
249
249
  handoff: () => import("./handoff-5AGE2D3T.js").then((m) => m.handoffCommand),
250
250
  "plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
251
- run: () => import("./run-EO5P2YZG.js").then((m) => m.runCommand),
252
- "run-plan": () => import("./run-plan-VMW34QY6.js").then((m) => m.runPlanCommand),
253
- "run-plan-all": () => import("./run-EO5P2YZG.js").then((m) => m.runPlanAllCommand),
254
- queue: () => import("./queue-XI4HUFLJ.js").then((m) => m.queueCommand),
255
- countdown: () => import("./countdown-F6EIHGDR.js").then((m) => m.countdownCommand),
251
+ run: () => import("./run-NKCDKMTC.js").then((m) => m.runCommand),
252
+ "run-plan": () => import("./run-plan-3PCINKTY.js").then((m) => m.runPlanCommand),
253
+ "run-plan-all": () => import("./run-NKCDKMTC.js").then((m) => m.runPlanAllCommand),
254
+ queue: () => import("./queue-VLIWWVKM.js").then((m) => m.queueCommand),
255
+ countdown: () => import("./countdown-TFKPAYIQ.js").then((m) => m.countdownCommand),
256
256
  "ground-control": () => import("./ground-control-DB5RSYAT.js").then((m) => m.groundControlCommand),
257
257
  dashboard: () => import("./dashboard-YNCFISNO.js").then((m) => m.dashboardCommand),
258
258
  "dashboard-broadcast": () => import("./dashboard-broadcast-NK7PU72L.js").then((m) => m.dashboardBroadcastCommand),
259
- "mission-control": () => import("./mission-control-C2QV5D25.js").then((m) => m.missionControlCommand),
260
- hook: () => import("./hook-R7V4NG3C.js").then((m) => m.hookCommand),
261
- guard: () => import("./guard-X6FNFZ27.js").then((m) => m.guardCommand),
259
+ "mission-control": () => import("./mission-control-JIF6GFSV.js").then((m) => m.missionControlCommand),
260
+ hook: () => import("./hook-VXHZ4ICK.js").then((m) => m.hookCommand),
261
+ guard: () => import("./guard-RJZEEKSL.js").then((m) => m.guardCommand),
262
262
  monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
263
263
  sessions: () => import("./sessions-O7MYEMCT.js").then((m) => m.sessionsCommand),
264
264
  "outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
265
265
  validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
266
- "engine-info": () => import("./engine-info-MNCKB55Y.js").then((m) => m.engineInfoCommand),
267
- commands: () => import("./commands-DVEZOEEO.js").then((m) => m.commandsCommand)
266
+ "engine-info": () => import("./engine-info-CYDRD7SW.js").then((m) => m.engineInfoCommand),
267
+ commands: () => import("./commands-MVUJZEJ6.js").then((m) => m.commandsCommand)
268
268
  },
269
269
  async run({ rawArgs }) {
270
270
  if (hasCliSubcommand(rawArgs)) return;
@@ -2,19 +2,19 @@ import {
2
2
  nextStepAfterInstall,
3
3
  performInstall,
4
4
  printInstallEpilogue
5
- } from "./chunk-PGCRP5A6.js";
5
+ } from "./chunk-W6U3Z2RU.js";
6
6
  import {
7
7
  NON_INTERACTIVE_ROOT_ARGS
8
- } from "./chunk-HWYVLEET.js";
8
+ } from "./chunk-N7HMTWS5.js";
9
9
  import {
10
10
  SkippedSymlinkError,
11
11
  logApplyStats
12
12
  } from "./chunk-HS7LVVLO.js";
13
- import "./chunk-5T4CHRRR.js";
14
- import "./chunk-ODI2N2BN.js";
13
+ import "./chunk-PHH3H5EQ.js";
14
+ import "./chunk-PXURVVVO.js";
15
15
  import "./chunk-HAFRAXGV.js";
16
- import "./chunk-LAYMAMPL.js";
17
- import "./chunk-IBE2EJZS.js";
16
+ import "./chunk-JGEGTOF6.js";
17
+ import "./chunk-LQJNGECA.js";
18
18
  import "./chunk-WGLPZXNU.js";
19
19
  import "./chunk-6RRG3WOE.js";
20
20
  import {
@@ -32,17 +32,17 @@ import {
32
32
  confirmProjectRoot,
33
33
  isNonInteractive,
34
34
  syncPathCliToRuntime
35
- } from "./chunk-I2SG2VPJ.js";
35
+ } from "./chunk-2KATW2O4.js";
36
36
  import {
37
37
  assessEnvironment
38
38
  } from "./chunk-B3VR5YBQ.js";
39
- import "./chunk-2R4HYPQH.js";
39
+ import "./chunk-DONKV6MA.js";
40
40
  import "./chunk-PFEUZXVT.js";
41
- import "./chunk-DVCNJNCF.js";
42
- import "./chunk-FX6BIH4C.js";
43
- import "./chunk-2KIOZMTV.js";
44
- import "./chunk-XJWCL4PO.js";
45
- import "./chunk-5RWTDCJ7.js";
41
+ import "./chunk-6QBU4DQF.js";
42
+ import "./chunk-OVRWRZ5S.js";
43
+ import "./chunk-4PL57BZ5.js";
44
+ import "./chunk-DQLIEJFK.js";
45
+ import "./chunk-A4PHFHYO.js";
46
46
  import {
47
47
  KIT_VERSION
48
48
  } from "./chunk-7HDQEK6T.js";
@@ -3,14 +3,14 @@ import {
3
3
  nextStepAfterInstall,
4
4
  performInstall,
5
5
  printInstallEpilogue
6
- } from "./chunk-PGCRP5A6.js";
7
- import "./chunk-HWYVLEET.js";
6
+ } from "./chunk-W6U3Z2RU.js";
7
+ import "./chunk-N7HMTWS5.js";
8
8
  import "./chunk-HS7LVVLO.js";
9
- import "./chunk-5T4CHRRR.js";
10
- import "./chunk-ODI2N2BN.js";
9
+ import "./chunk-PHH3H5EQ.js";
10
+ import "./chunk-PXURVVVO.js";
11
11
  import "./chunk-HAFRAXGV.js";
12
- import "./chunk-LAYMAMPL.js";
13
- import "./chunk-IBE2EJZS.js";
12
+ import "./chunk-JGEGTOF6.js";
13
+ import "./chunk-LQJNGECA.js";
14
14
  import "./chunk-WGLPZXNU.js";
15
15
  import "./chunk-6RRG3WOE.js";
16
16
  import "./chunk-QTON2GQX.js";
@@ -18,15 +18,15 @@ import "./chunk-PNFF6OU3.js";
18
18
  import "./chunk-SC2DBY2R.js";
19
19
  import "./chunk-F6C3GFKV.js";
20
20
  import "./chunk-ZB43YMHW.js";
21
- import "./chunk-I2SG2VPJ.js";
21
+ import "./chunk-2KATW2O4.js";
22
22
  import "./chunk-B3VR5YBQ.js";
23
- import "./chunk-2R4HYPQH.js";
23
+ import "./chunk-DONKV6MA.js";
24
24
  import "./chunk-PFEUZXVT.js";
25
- import "./chunk-DVCNJNCF.js";
26
- import "./chunk-FX6BIH4C.js";
27
- import "./chunk-2KIOZMTV.js";
28
- import "./chunk-XJWCL4PO.js";
29
- import "./chunk-5RWTDCJ7.js";
25
+ import "./chunk-6QBU4DQF.js";
26
+ import "./chunk-OVRWRZ5S.js";
27
+ import "./chunk-4PL57BZ5.js";
28
+ import "./chunk-DQLIEJFK.js";
29
+ import "./chunk-A4PHFHYO.js";
30
30
  import "./chunk-7HDQEK6T.js";
31
31
  import "./chunk-C4Q77GGJ.js";
32
32
  import "./chunk-5B4DVO6C.js";
@@ -3,7 +3,7 @@ import {
3
3
  findDashboardDataScript,
4
4
  loadDashboardSnapshot,
5
5
  runMcTuiLoop
6
- } from "./chunk-LFWPB2JR.js";
6
+ } from "./chunk-ZFJIJUZ4.js";
7
7
  import {
8
8
  resolveDashboardSnapshotRoot
9
9
  } from "./chunk-XDCCYBCJ.js";