@dadado/agent-kit-cli 6.12.0 → 6.14.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/dashboard/README.md +8 -8
- package/dashboard/dashboard-data.mjs +19 -3
- package/dashboard/lib/live-refresh.mjs +1 -0
- package/dashboard/lib/workspace-docs.d.mts +49 -0
- package/dashboard/lib/workspace-docs.mjs +231 -0
- package/dist/{add-CLRIMPN4.js → add-LJAE4FRZ.js} +3 -3
- package/dist/{chunk-PGCRP5A6.js → chunk-2DYKEP5V.js} +8 -8
- package/dist/{chunk-ODI2N2BN.js → chunk-7DFEN3FF.js} +2 -2
- package/dist/{chunk-UX6FHSO7.js → chunk-AEUE74EZ.js} +1 -1
- package/dist/{chunk-DVCNJNCF.js → chunk-AXQJX4DC.js} +3 -3
- package/dist/{chunk-2KIOZMTV.js → chunk-BMU74QWR.js} +8 -0
- package/dist/{chunk-WAWCS5PJ.js → chunk-CFJRCJWD.js} +12 -2
- package/dist/{chunk-I2SG2VPJ.js → chunk-GBHOP62P.js} +2 -2
- package/dist/{chunk-TFKEHC2D.js → chunk-GYPCR4UO.js} +8 -4
- package/dist/{chunk-2R4HYPQH.js → chunk-H5OSZ7HQ.js} +2 -2
- package/dist/{chunk-HWYVLEET.js → chunk-IS35XTGX.js} +4 -4
- package/dist/{chunk-IBE2EJZS.js → chunk-KTWDHHIO.js} +2 -1
- package/dist/{chunk-7TEEGAED.js → chunk-NDKSOPP7.js} +1 -0
- package/dist/{chunk-5RWTDCJ7.js → chunk-NEMOV327.js} +11 -1
- package/dist/{chunk-OKQ3SAHK.js → chunk-OLDRCWHE.js} +1 -1
- package/dist/{chunk-4WHPZGF4.js → chunk-SKC6QZW4.js} +30 -5
- package/dist/{chunk-FX6BIH4C.js → chunk-TR6AC5FW.js} +2 -2
- package/dist/{chunk-LAYMAMPL.js → chunk-UNDPOCWT.js} +1 -1
- package/dist/{chunk-5T4CHRRR.js → chunk-WSJLLK3U.js} +1 -1
- package/dist/{chunk-XJWCL4PO.js → chunk-YZSPNXR2.js} +1 -1
- package/dist/{chunk-LFWPB2JR.js → chunk-ZFJIJUZ4.js} +1 -0
- package/dist/{commands-DVEZOEEO.js → commands-K7OOH3AR.js} +4 -4
- package/dist/{contribute-E3COXKH4.js → contribute-QPBEPIKP.js} +5 -5
- package/dist/{countdown-F6EIHGDR.js → countdown-TFKPAYIQ.js} +2 -2
- package/dist/{diff-SCGNC4SF.js → diff-5IQGV5VL.js} +6 -6
- package/dist/{doctor-QGO4QB7R.js → doctor-TKYJ3VRI.js} +10 -10
- package/dist/{engine-info-MNCKB55Y.js → engine-info-R6GXZ2VO.js} +3 -3
- package/dist/{guard-X6FNFZ27.js → guard-RJZEEKSL.js} +50 -8
- package/dist/{hook-R7V4NG3C.js → hook-SHR3NXPV.js} +6 -6
- package/dist/index.js +22 -20
- package/dist/{init-ONPKZS63.js → init-E2HI3TJY.js} +13 -13
- package/dist/{install-NHTYTVSG.js → install-3TGZ4TIY.js} +13 -13
- package/dist/{mission-control-C2QV5D25.js → mission-control-JIF6GFSV.js} +1 -1
- package/dist/promote-H5MIMVEB.js +367 -0
- package/dist/{queue-XI4HUFLJ.js → queue-VLIWWVKM.js} +3 -3
- package/dist/{run-EO5P2YZG.js → run-O6IDZ6WI.js} +10 -10
- package/dist/{run-plan-VMW34QY6.js → run-plan-2HIJ4CD2.js} +6 -6
- package/dist/{setup-global-PMKGHX2S.js → setup-global-G27JZ2IN.js} +7 -7
- package/dist/{status-P2I6LE6Y.js → status-3J26V7QS.js} +8 -8
- package/dist/{update-K6L24JDP.js → update-KWIHFGPI.js} +11 -11
- package/package.json +5 -5
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
compareSemver,
|
|
3
3
|
normalizeSemver,
|
|
4
4
|
readLocalKitVersion
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H5OSZ7HQ.js";
|
|
6
6
|
import {
|
|
7
7
|
L0_ARTIFACTS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BMU74QWR.js";
|
|
9
9
|
import {
|
|
10
10
|
copyRegistryFile,
|
|
11
11
|
emptyStats,
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
mergeStats,
|
|
16
16
|
recordOutcome,
|
|
17
17
|
resolveProtectedGlobs
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YZSPNXR2.js";
|
|
19
19
|
import {
|
|
20
20
|
loadManagedHashLedger,
|
|
21
21
|
saveManagedHashLedger
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NEMOV327.js";
|
|
23
23
|
import {
|
|
24
24
|
KIT_PACKAGE_SPEC,
|
|
25
25
|
KIT_VERSION
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveContained,
|
|
6
6
|
saveManagedHashLedger,
|
|
7
7
|
shouldPreserveCustomizedOverlay
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NEMOV327.js";
|
|
9
9
|
import {
|
|
10
10
|
ensureDir,
|
|
11
11
|
fileExists
|
|
@@ -33,6 +33,7 @@ var MODEL_INVOCATION_DISABLED = /* @__PURE__ */ new Set([
|
|
|
33
33
|
"kit-prod",
|
|
34
34
|
"backlog-delete",
|
|
35
35
|
"backlog-cancel",
|
|
36
|
+
"cancel-plan",
|
|
36
37
|
"archive-plan",
|
|
37
38
|
"hotfix",
|
|
38
39
|
"run-plan-all"
|
|
@@ -374,7 +374,17 @@ var KNOWN_SHIPPED_OVERLAY_HASHES = /* @__PURE__ */ new Set([
|
|
|
374
374
|
"2bd11cdf44d1fd536d9a52206b79b78ecb7e0276efdf0e598d3cec5f831c35b6",
|
|
375
375
|
"88fa5ebe0d0fc29f8dac3de140797a85fbc8dc00e9b9c461b0e9e10bb9ef4e64",
|
|
376
376
|
"c746b0424dfc3a9e36c588e48526b1f14e9c2c3032397f2ba721fa7f50390230",
|
|
377
|
-
"9f0e1cf2e28f6949a98b7ffa0eb9c3237d8868460014f35edd9122a30fb4367c"
|
|
377
|
+
"9f0e1cf2e28f6949a98b7ffa0eb9c3237d8868460014f35edd9122a30fb4367c",
|
|
378
|
+
"22683e3bb4e85c1224b9a2fab7c3322b5dd5a2c91657a80616e29da2d5b21a19",
|
|
379
|
+
"99f0825be20a8f05a1e31490f0bf92b329a4bdf5e5a0dfc283ddbe8e87067dfa",
|
|
380
|
+
"d67f8fadb27f0cb65a8bf1672d760a0296baad60ac82cf280e91436bf95b1f71",
|
|
381
|
+
"59e08def22bb0c6e27043cb76105ba67bbc81a8bf2c72e5b1e850290f70692ae",
|
|
382
|
+
"bb27fd7f988910ff599aeba41c2f726a342dc2ce9836246b6814810bbd3940be",
|
|
383
|
+
"c9f54d1a144292efe4aa96bd046fa74b676fd6a61504ed977b9a753d9a52415c",
|
|
384
|
+
"d4a260a22ca4ac5330ebc0002e82aef623112a00eaea4b9518189b2eed9002b7",
|
|
385
|
+
"26525753f5db7574c04c1ffd220258570d3b8c8b801933ea7781d8b4b56b687f",
|
|
386
|
+
"aad0506e016641e19e7dd7274d0b5c9adf93f21a0a0dbbb60cce646f632bd1ef",
|
|
387
|
+
"d50d76c52214e2c20fe4e4632b4a98d92576437ab4315c1df39cc21324c971a6"
|
|
378
388
|
]);
|
|
379
389
|
|
|
380
390
|
// src/lifecycle/paths.ts
|
|
@@ -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.
|
|
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: {
|
|
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
|
-
|
|
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
|
|
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
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
L0_ARTIFACTS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BMU74QWR.js";
|
|
4
4
|
import {
|
|
5
5
|
allSkills,
|
|
6
6
|
loadPackManifest,
|
|
7
7
|
loadRegistry,
|
|
8
8
|
packMemberFileTargets,
|
|
9
9
|
skillFileTargets
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YZSPNXR2.js";
|
|
11
11
|
|
|
12
12
|
// src/lifecycle/targets.ts
|
|
13
13
|
import path from "path";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RUN_CATALOG
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
8
|
+
} from "./chunk-KTWDHHIO.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-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-BMU74QWR.js";
|
|
15
|
+
import "./chunk-NEMOV327.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-
|
|
4
|
+
} from "./chunk-WSJLLK3U.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-ZB43YMHW.js";
|
|
8
8
|
import {
|
|
9
9
|
managedPairs
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-TR6AC5FW.js";
|
|
11
|
+
import "./chunk-BMU74QWR.js";
|
|
12
12
|
import {
|
|
13
13
|
loadAgentKitManifest,
|
|
14
14
|
normalizeRelPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YZSPNXR2.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveContained
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NEMOV327.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-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-WSJLLK3U.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-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-AXQJX4DC.js";
|
|
12
|
+
import "./chunk-TR6AC5FW.js";
|
|
13
|
+
import "./chunk-BMU74QWR.js";
|
|
14
14
|
import {
|
|
15
15
|
loadAgentKitManifest
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-YZSPNXR2.js";
|
|
17
|
+
import "./chunk-NEMOV327.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-
|
|
5
|
+
} from "./chunk-7DFEN3FF.js";
|
|
6
6
|
import {
|
|
7
7
|
writeReadinessSnapshot
|
|
8
8
|
} from "./chunk-HAFRAXGV.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-UNDPOCWT.js";
|
|
10
|
+
import "./chunk-KTWDHHIO.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-
|
|
19
|
+
} from "./chunk-OLDRCWHE.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-
|
|
36
|
+
} from "./chunk-H5OSZ7HQ.js";
|
|
37
37
|
import "./chunk-PFEUZXVT.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-AXQJX4DC.js";
|
|
39
|
+
import "./chunk-TR6AC5FW.js";
|
|
40
|
+
import "./chunk-BMU74QWR.js";
|
|
41
|
+
import "./chunk-YZSPNXR2.js";
|
|
42
|
+
import "./chunk-NEMOV327.js";
|
|
43
43
|
import {
|
|
44
44
|
KIT_VERSION
|
|
45
45
|
} from "./chunk-7HDQEK6T.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DRIVER_PROTOCOL_VERSION
|
|
3
|
-
} from "./chunk-4WHPZGF4.js";
|
|
4
1
|
import {
|
|
5
2
|
bundledDashboardCandidates
|
|
6
3
|
} from "./chunk-XDCCYBCJ.js";
|
|
4
|
+
import {
|
|
5
|
+
DRIVER_PROTOCOL_VERSION
|
|
6
|
+
} from "./chunk-SKC6QZW4.js";
|
|
7
7
|
import "./chunk-WRCXRV2U.js";
|
|
8
8
|
import "./chunk-ZB43YMHW.js";
|
|
9
9
|
|
|
@@ -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) &&
|
|
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(
|
|
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 (
|
|
452
|
-
//
|
|
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 (
|
|
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 =
|
|
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-
|
|
26
|
+
} from "./chunk-H5OSZ7HQ.js";
|
|
27
27
|
import {
|
|
28
28
|
loadContextConfig
|
|
29
29
|
} from "./chunk-PFEUZXVT.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-AXQJX4DC.js";
|
|
31
|
+
import "./chunk-TR6AC5FW.js";
|
|
32
|
+
import "./chunk-BMU74QWR.js";
|
|
33
33
|
import {
|
|
34
34
|
MANIFEST_RELATIVE_PATH
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-YZSPNXR2.js";
|
|
36
|
+
import "./chunk-NEMOV327.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-
|
|
4
|
+
} from "./chunk-NDKSOPP7.js";
|
|
5
5
|
import "./chunk-GDKTTV2A.js";
|
|
6
6
|
import "./chunk-WRCXRV2U.js";
|
|
7
7
|
import "./chunk-WGLPZXNU.js";
|
|
@@ -126,6 +126,7 @@ var CLI_HELP_GROUPS = [
|
|
|
126
126
|
"run-plan",
|
|
127
127
|
"run-plan-all",
|
|
128
128
|
"queue",
|
|
129
|
+
"promote",
|
|
129
130
|
"countdown",
|
|
130
131
|
"ground-control"
|
|
131
132
|
]
|
|
@@ -232,39 +233,40 @@ var main = defineCommand({
|
|
|
232
233
|
version: KIT_VERSION
|
|
233
234
|
},
|
|
234
235
|
subCommands: {
|
|
235
|
-
init: () => import("./init-
|
|
236
|
-
install: () => import("./install-
|
|
236
|
+
init: () => import("./init-E2HI3TJY.js").then((m) => m.initCommand),
|
|
237
|
+
install: () => import("./install-3TGZ4TIY.js").then((m) => m.installCommand),
|
|
237
238
|
scan: () => import("./scan-BWA64R7I.js").then((m) => m.scanCommand),
|
|
238
|
-
add: () => import("./add-
|
|
239
|
-
doctor: () => import("./doctor-
|
|
240
|
-
"setup-global": () => import("./setup-global-
|
|
241
|
-
status: () => import("./status-
|
|
242
|
-
update: () => import("./update-
|
|
239
|
+
add: () => import("./add-LJAE4FRZ.js").then((m) => m.addCommand),
|
|
240
|
+
doctor: () => import("./doctor-TKYJ3VRI.js").then((m) => m.doctorCommand),
|
|
241
|
+
"setup-global": () => import("./setup-global-G27JZ2IN.js").then((m) => m.setupGlobalCommand),
|
|
242
|
+
status: () => import("./status-3J26V7QS.js").then((m) => m.statusCommand),
|
|
243
|
+
update: () => import("./update-KWIHFGPI.js").then((m) => m.updateCommand),
|
|
243
244
|
"cursor-awareness": () => import("./cursor-awareness-TN5JXD2C.js").then((m) => m.cursorAwarenessCommand),
|
|
244
245
|
"public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
|
|
245
246
|
"remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
|
|
246
247
|
dogfood: () => import("./dogfood-2JAHSYQA.js").then((m) => m.dogfoodCommand),
|
|
247
|
-
diff: () => import("./diff-
|
|
248
|
-
contribute: () => import("./contribute-
|
|
248
|
+
diff: () => import("./diff-5IQGV5VL.js").then((m) => m.diffCommand),
|
|
249
|
+
contribute: () => import("./contribute-QPBEPIKP.js").then((m) => m.contributeCommand),
|
|
249
250
|
handoff: () => import("./handoff-5AGE2D3T.js").then((m) => m.handoffCommand),
|
|
250
251
|
"plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
|
|
251
|
-
run: () => import("./run-
|
|
252
|
-
"run-plan": () => import("./run-plan-
|
|
253
|
-
"run-plan-all": () => import("./run-
|
|
254
|
-
queue: () => import("./queue-
|
|
255
|
-
|
|
252
|
+
run: () => import("./run-O6IDZ6WI.js").then((m) => m.runCommand),
|
|
253
|
+
"run-plan": () => import("./run-plan-2HIJ4CD2.js").then((m) => m.runPlanCommand),
|
|
254
|
+
"run-plan-all": () => import("./run-O6IDZ6WI.js").then((m) => m.runPlanAllCommand),
|
|
255
|
+
queue: () => import("./queue-VLIWWVKM.js").then((m) => m.queueCommand),
|
|
256
|
+
promote: () => import("./promote-H5MIMVEB.js").then((m) => m.promoteCommand),
|
|
257
|
+
countdown: () => import("./countdown-TFKPAYIQ.js").then((m) => m.countdownCommand),
|
|
256
258
|
"ground-control": () => import("./ground-control-DB5RSYAT.js").then((m) => m.groundControlCommand),
|
|
257
259
|
dashboard: () => import("./dashboard-YNCFISNO.js").then((m) => m.dashboardCommand),
|
|
258
260
|
"dashboard-broadcast": () => import("./dashboard-broadcast-NK7PU72L.js").then((m) => m.dashboardBroadcastCommand),
|
|
259
|
-
"mission-control": () => import("./mission-control-
|
|
260
|
-
hook: () => import("./hook-
|
|
261
|
-
guard: () => import("./guard-
|
|
261
|
+
"mission-control": () => import("./mission-control-JIF6GFSV.js").then((m) => m.missionControlCommand),
|
|
262
|
+
hook: () => import("./hook-SHR3NXPV.js").then((m) => m.hookCommand),
|
|
263
|
+
guard: () => import("./guard-RJZEEKSL.js").then((m) => m.guardCommand),
|
|
262
264
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
263
265
|
sessions: () => import("./sessions-O7MYEMCT.js").then((m) => m.sessionsCommand),
|
|
264
266
|
"outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
|
|
265
267
|
validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
|
|
266
|
-
"engine-info": () => import("./engine-info-
|
|
267
|
-
commands: () => import("./commands-
|
|
268
|
+
"engine-info": () => import("./engine-info-R6GXZ2VO.js").then((m) => m.engineInfoCommand),
|
|
269
|
+
commands: () => import("./commands-K7OOH3AR.js").then((m) => m.commandsCommand)
|
|
268
270
|
},
|
|
269
271
|
async run({ rawArgs }) {
|
|
270
272
|
if (hasCliSubcommand(rawArgs)) return;
|