@dadado/agent-kit-cli 6.17.0 → 6.19.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/dashboard-data.mjs +8 -3
- package/dashboard/dashboard.html +140 -0
- package/dashboard/lib/guards.d.mts +20 -0
- package/dashboard/lib/guards.mjs +307 -0
- package/dashboard/lib/semantic-model.mjs +228 -1
- package/dist/{add-DRV3T42D.js → add-MRI5BXHH.js} +3 -3
- package/dist/{chunk-3IEE6Q37.js → chunk-2TX6NJEG.js} +1 -1
- package/dist/{chunk-IOQ6YXA3.js → chunk-3HNTNYPR.js} +1 -1
- package/dist/{chunk-MEZU47IB.js → chunk-5EBT3V7G.js} +1 -1
- package/dist/{chunk-5IJQGIOY.js → chunk-677W4QO3.js} +63 -1
- package/dist/{chunk-SKC6QZW4.js → chunk-6WUKLS4D.js} +1 -1
- package/dist/{chunk-YO4BLHDT.js → chunk-6XJZLH53.js} +149 -18
- package/dist/{chunk-J3YLSHRK.js → chunk-7MUTZHWP.js} +23 -4
- package/dist/{chunk-CJ3JAH7L.js → chunk-BGL5DRK2.js} +2 -2
- package/dist/{chunk-IJQAFPY3.js → chunk-C4LCOOL4.js} +3 -1
- package/dist/chunk-DTSL2RH7.js +433 -0
- package/dist/{chunk-4DLMU44M.js → chunk-EBDQYFA4.js} +71 -4
- package/dist/{chunk-AQTCXUYS.js → chunk-EOQMAU2J.js} +1 -1
- package/dist/{chunk-RAMT55TC.js → chunk-G2Z37XFM.js} +3 -3
- package/dist/{chunk-HKZH2IEE.js → chunk-GTP224FI.js} +1 -1
- package/dist/{chunk-QYIV6ZP6.js → chunk-HJWSOZXS.js} +52 -12
- package/dist/{chunk-AZCPUJJO.js → chunk-IQQQDEQ4.js} +2 -2
- package/dist/{chunk-ZFJIJUZ4.js → chunk-MPCNPZJZ.js} +1 -1
- package/dist/{hook-2YEC7GT5.js → chunk-NL3I2BWA.js} +104 -113
- package/dist/{chunk-WGAOM37Y.js → chunk-OKQ37A7E.js} +9 -9
- package/dist/{chunk-WRCXRV2U.js → chunk-P7732A25.js} +10 -0
- package/dist/{chunk-6RRG3WOE.js → chunk-Q35TWISF.js} +22 -1
- package/dist/{chunk-WA7IBNIL.js → chunk-QBYJNGCD.js} +2 -2
- package/dist/chunk-QWTBYXHN.js +751 -0
- package/dist/{chunk-SC2DBY2R.js → chunk-R4DUO5DA.js} +1 -0
- package/dist/{chunk-2Y27P6KC.js → chunk-SGTTC2JP.js} +4 -3
- package/dist/{chunk-TICKIKCQ.js → chunk-U23SLQGX.js} +5 -5
- package/dist/chunk-UATQQDVR.js +297 -0
- package/dist/{chunk-3YTFXTXH.js → chunk-UXQH2CNC.js} +2 -1
- package/dist/{chunk-VBQHBSIB.js → chunk-VJWWJA36.js} +3 -3
- package/dist/{chunk-OQNJRQPZ.js → chunk-W3ZJVBNY.js} +7 -4
- package/dist/{chunk-XDCCYBCJ.js → chunk-ZMYV6PRE.js} +13 -0
- package/dist/{commands-3O2HFLTW.js → commands-NL6UOEP7.js} +51 -17
- package/dist/{conflicts-UY6VTYIO.js → conflicts-XMN4PBCZ.js} +8 -8
- package/dist/{contribute-RF47NPZ2.js → contribute-QDTEJ42W.js} +4 -4
- package/dist/{countdown-JX3DZ2QU.js → countdown-7ONIVAG6.js} +40 -12
- package/dist/{dashboard-YNCFISNO.js → dashboard-P65XHYCU.js} +1 -1
- package/dist/{dashboard-broadcast-NK7PU72L.js → dashboard-broadcast-GYK34QYL.js} +1 -1
- package/dist/{diff-SVFAUOVP.js → diff-RLB7R2NE.js} +5 -5
- package/dist/{doctor-ATKYRCT4.js → doctor-OXMDSOXL.js} +11 -11
- package/dist/{engine-info-R6GXZ2VO.js → engine-info-BBI5QO5Y.js} +3 -3
- package/dist/{ground-control-D2X6CI66.js → ground-control-IDCXN5FK.js} +5 -5
- package/dist/hook-B4VUQOQF.js +108 -0
- package/dist/index.js +28 -28
- package/dist/{init-LUJRWMHC.js → init-BYONEUCW.js} +14 -14
- package/dist/{install-VQSO2JR7.js → install-HOR6VR44.js} +14 -14
- package/dist/{mission-control-JIF6GFSV.js → mission-control-QJBSZVNI.js} +2 -2
- package/dist/{queue-IEOXOBNL.js → queue-OJHKFKK3.js} +55 -11
- package/dist/{run-L63NZHAJ.js → run-PFANZJ5Y.js} +175 -27
- package/dist/{run-plan-BWJX6R7Q.js → run-plan-7EB4ERSQ.js} +46 -16
- package/dist/{scan-BWA64R7I.js → scan-K3T5RQLC.js} +1 -1
- package/dist/session-start-OSFSF4OZ.js +74 -0
- package/dist/sessions-WQU5DONU.js +102 -0
- package/dist/{setup-global-2X5TMDCB.js → setup-global-O34KFL2C.js} +6 -6
- package/dist/{status-MOOZCB5D.js → status-QB2FFYUP.js} +8 -8
- package/dist/{update-NMSO56CQ.js → update-N2EKKSE7.js} +16 -11
- package/package.json +1 -1
- package/dist/sessions-O7MYEMCT.js +0 -343
|
@@ -4,12 +4,17 @@ import {
|
|
|
4
4
|
REVIEW_PACK_SLASH,
|
|
5
5
|
parseReviewPackMaxBytes,
|
|
6
6
|
reviewBackendMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U23SLQGX.js";
|
|
8
|
+
import {
|
|
9
|
+
loadRolesContext,
|
|
10
|
+
resolveWorkerRole
|
|
11
|
+
} from "./chunk-UATQQDVR.js";
|
|
12
|
+
import "./chunk-7ABY6DYH.js";
|
|
8
13
|
import {
|
|
9
14
|
detectAgentBackend,
|
|
10
15
|
listDetectBackendIds
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-C4LCOOL4.js";
|
|
17
|
+
import "./chunk-5EBT3V7G.js";
|
|
13
18
|
import {
|
|
14
19
|
GATE_EXIT_MARKER_RELPATH,
|
|
15
20
|
defaultExec,
|
|
@@ -20,29 +25,31 @@ import {
|
|
|
20
25
|
readGateExitMarker,
|
|
21
26
|
resolveGateExitRefs,
|
|
22
27
|
writeGateExitMarker
|
|
23
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BGL5DRK2.js";
|
|
29
|
+
import "./chunk-L5V3W3DY.js";
|
|
24
30
|
import "./chunk-MUTTNRX4.js";
|
|
25
31
|
import {
|
|
26
32
|
classifySlash,
|
|
27
33
|
normalizeSlashName,
|
|
28
34
|
promoteBlockedMessage,
|
|
29
35
|
unknownSlashMessage
|
|
30
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-SGTTC2JP.js";
|
|
31
37
|
import {
|
|
32
38
|
CLAUDE_MAX_BUDGET_USD_ENV,
|
|
33
39
|
CLAUDE_MAX_TURNS_ENV,
|
|
34
40
|
RedactingStreamBuffer,
|
|
35
41
|
redactSecrets
|
|
36
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-W3ZJVBNY.js";
|
|
37
43
|
import {
|
|
38
44
|
HITL_UNANSWERED_EXIT_CODE
|
|
39
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-P7732A25.js";
|
|
40
46
|
import "./chunk-WGLPZXNU.js";
|
|
41
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-Q35TWISF.js";
|
|
42
48
|
import "./chunk-QTON2GQX.js";
|
|
43
49
|
import {
|
|
44
50
|
logger
|
|
45
51
|
} from "./chunk-ZB43YMHW.js";
|
|
52
|
+
import "./chunk-PFEUZXVT.js";
|
|
46
53
|
import {
|
|
47
54
|
ensureLoopLogsDir,
|
|
48
55
|
runnerStatePaths
|
|
@@ -265,7 +272,27 @@ async function executeCountdown(input) {
|
|
|
265
272
|
if (job !== "review" && input.includeReviewed) {
|
|
266
273
|
return usage("--include-reviewed only applies to --job review");
|
|
267
274
|
}
|
|
268
|
-
|
|
275
|
+
let backendRequest = input.backend.trim() || "auto";
|
|
276
|
+
let model = input.model?.trim() || void 0;
|
|
277
|
+
const rolesNotes = [];
|
|
278
|
+
if (job === "tick") {
|
|
279
|
+
const ctx = await loadRolesContext(root, true);
|
|
280
|
+
if (!ctx.ok) return usage(ctx.error);
|
|
281
|
+
const worker = resolveWorkerRole({
|
|
282
|
+
flagBackend: input.backend,
|
|
283
|
+
flagModel: input.model,
|
|
284
|
+
plan: ctx.plan,
|
|
285
|
+
roles: ctx.roles,
|
|
286
|
+
defaultBackend: "auto"
|
|
287
|
+
});
|
|
288
|
+
backendRequest = worker.backend;
|
|
289
|
+
model = worker.model;
|
|
290
|
+
rolesNotes.push(...worker.warnings.map((w) => `roles: ${w}`));
|
|
291
|
+
rolesNotes.push(
|
|
292
|
+
`roles: worker ${worker.backend} (${worker.backendSource}), model ${worker.model ? `${worker.model} (${worker.modelSource})` : "backend default"}`
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
const detected = await detectAgentBackend(backendRequest, input.whichFn);
|
|
269
296
|
if (!detected.ok) return usage(detected.message);
|
|
270
297
|
let maxPackBytes;
|
|
271
298
|
if (job === "review") {
|
|
@@ -306,6 +333,7 @@ async function executeCountdown(input) {
|
|
|
306
333
|
};
|
|
307
334
|
const jobLabel = job === "tick" ? "run-plan" : job === "review" ? `run ${REVIEW_PACK_SLASH}` : `run ${slash}`;
|
|
308
335
|
say(`fire ${gateExitStamp(now)}: job ${job} (${jobLabel}) on ${detected.id}`);
|
|
336
|
+
for (const note of rolesNotes) say(note);
|
|
309
337
|
const preflight = await countdownPreflight({ root, env, exec, now, log: say });
|
|
310
338
|
if (!preflight.ok) {
|
|
311
339
|
say(`refused: ${preflight.reason} (exit ${preflight.exitCode})`);
|
|
@@ -323,7 +351,7 @@ async function executeCountdown(input) {
|
|
|
323
351
|
slash,
|
|
324
352
|
backend: detected.id,
|
|
325
353
|
maxTicks,
|
|
326
|
-
...
|
|
354
|
+
...model ? { model } : {},
|
|
327
355
|
...maxPackBytes !== void 0 ? { maxPackBytes } : {},
|
|
328
356
|
...job === "review" && input.includeReviewed ? { includeReviewed: true } : {}
|
|
329
357
|
});
|
|
@@ -412,8 +440,8 @@ var countdownCommand = defineCommand({
|
|
|
412
440
|
},
|
|
413
441
|
backend: {
|
|
414
442
|
type: "string",
|
|
415
|
-
description: `Agent backend (${listDetectBackendIds().join(" | ")}; default: auto)`,
|
|
416
|
-
default: "
|
|
443
|
+
description: `Agent backend (${listDetectBackendIds().join(" | ")}; default: auto; the tick job reads plan worker_backend and config roles.worker first)`,
|
|
444
|
+
default: ""
|
|
417
445
|
},
|
|
418
446
|
model: {
|
|
419
447
|
type: "string",
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTRY_CLI_ARGS,
|
|
3
3
|
resolveRegistryFromCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GTP224FI.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-
|
|
11
|
+
} from "./chunk-VJWWJA36.js";
|
|
12
|
+
import "./chunk-EOQMAU2J.js";
|
|
13
13
|
import "./chunk-WS6OX2IG.js";
|
|
14
14
|
import {
|
|
15
15
|
loadAgentKitManifest
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-3HNTNYPR.js";
|
|
17
|
+
import "./chunk-677W4QO3.js";
|
|
18
18
|
import "./chunk-C4Q77GGJ.js";
|
|
19
19
|
import "./chunk-5B4DVO6C.js";
|
|
20
20
|
|
|
@@ -2,27 +2,27 @@ import {
|
|
|
2
2
|
assessHooksHealth,
|
|
3
3
|
executeSafeReadinessFixes,
|
|
4
4
|
refreshRepositoryProfile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7MUTZHWP.js";
|
|
6
6
|
import {
|
|
7
7
|
writeReadinessSnapshot
|
|
8
8
|
} from "./chunk-HAFRAXGV.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-EBDQYFA4.js";
|
|
10
|
+
import "./chunk-UXQH2CNC.js";
|
|
11
11
|
import "./chunk-WGLPZXNU.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-Q35TWISF.js";
|
|
13
13
|
import {
|
|
14
14
|
withCliProgress
|
|
15
15
|
} from "./chunk-QTON2GQX.js";
|
|
16
16
|
import {
|
|
17
17
|
detectWorkspaceParent,
|
|
18
18
|
workspaceParentAdvisoryLines
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2TX6NJEG.js";
|
|
20
20
|
import {
|
|
21
21
|
createReadinessReport
|
|
22
22
|
} from "./chunk-PNFF6OU3.js";
|
|
23
23
|
import {
|
|
24
24
|
runScanner
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-R4DUO5DA.js";
|
|
26
26
|
import "./chunk-F6C3GFKV.js";
|
|
27
27
|
import {
|
|
28
28
|
logger
|
|
@@ -33,13 +33,13 @@ import {
|
|
|
33
33
|
} from "./chunk-B3VR5YBQ.js";
|
|
34
34
|
import {
|
|
35
35
|
warnIfRunningCliBehindNpm
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-IQQQDEQ4.js";
|
|
37
37
|
import "./chunk-PFEUZXVT.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-VJWWJA36.js";
|
|
39
|
+
import "./chunk-EOQMAU2J.js";
|
|
40
40
|
import "./chunk-WS6OX2IG.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-3HNTNYPR.js";
|
|
42
|
+
import "./chunk-677W4QO3.js";
|
|
43
43
|
import {
|
|
44
44
|
KIT_VERSION
|
|
45
45
|
} from "./chunk-7HDQEK6T.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bundledDashboardCandidates
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZMYV6PRE.js";
|
|
4
4
|
import {
|
|
5
5
|
DRIVER_PROTOCOL_VERSION
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6WUKLS4D.js";
|
|
7
|
+
import "./chunk-P7732A25.js";
|
|
8
8
|
import "./chunk-ZB43YMHW.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/engine-info.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
blobId,
|
|
3
3
|
isTicketMerged
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5EBT3V7G.js";
|
|
5
5
|
import {
|
|
6
6
|
GATE_EXIT_BRANCH_PREFIX,
|
|
7
7
|
GATE_EXIT_MARKER_RELPATH,
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
readGateExitMarker,
|
|
17
17
|
resolveGateExitRefs,
|
|
18
18
|
writeGateExitMarker
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BGL5DRK2.js";
|
|
20
20
|
import "./chunk-MUTTNRX4.js";
|
|
21
21
|
import {
|
|
22
22
|
redactSecrets
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-W3ZJVBNY.js";
|
|
24
|
+
import "./chunk-P7732A25.js";
|
|
25
25
|
import {
|
|
26
26
|
findOnPath
|
|
27
27
|
} from "./chunk-WGLPZXNU.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-Q35TWISF.js";
|
|
29
29
|
import "./chunk-QTON2GQX.js";
|
|
30
30
|
import {
|
|
31
31
|
logger
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildSessionStartAdditionalContext,
|
|
3
|
+
resolveSessionRoot
|
|
4
|
+
} from "./chunk-NL3I2BWA.js";
|
|
5
|
+
import "./chunk-2YU2H7I6.js";
|
|
6
|
+
import {
|
|
7
|
+
readStdinJson
|
|
8
|
+
} from "./chunk-DE3LQFSJ.js";
|
|
9
|
+
import "./chunk-QWTBYXHN.js";
|
|
10
|
+
import "./chunk-DTSL2RH7.js";
|
|
11
|
+
import "./chunk-MCH3E46V.js";
|
|
12
|
+
import "./chunk-4CRBUEJ6.js";
|
|
13
|
+
import "./chunk-L5V3W3DY.js";
|
|
14
|
+
import "./chunk-MUTTNRX4.js";
|
|
15
|
+
import "./chunk-HAFRAXGV.js";
|
|
16
|
+
import "./chunk-IQQQDEQ4.js";
|
|
17
|
+
import "./chunk-PFEUZXVT.js";
|
|
18
|
+
import "./chunk-VJWWJA36.js";
|
|
19
|
+
import "./chunk-EOQMAU2J.js";
|
|
20
|
+
import "./chunk-WS6OX2IG.js";
|
|
21
|
+
import "./chunk-3HNTNYPR.js";
|
|
22
|
+
import "./chunk-677W4QO3.js";
|
|
23
|
+
import "./chunk-7HDQEK6T.js";
|
|
24
|
+
import "./chunk-C4Q77GGJ.js";
|
|
25
|
+
import "./chunk-5B4DVO6C.js";
|
|
26
|
+
|
|
27
|
+
// src/commands/hook.ts
|
|
28
|
+
import path from "path";
|
|
29
|
+
import { defineCommand } from "citty";
|
|
30
|
+
|
|
31
|
+
// src/hooks/format-session-start.ts
|
|
32
|
+
function resolveSessionStartFormat(value) {
|
|
33
|
+
return value === "claude" ? "claude" : "cursor";
|
|
34
|
+
}
|
|
35
|
+
function formatSessionStartOutput(additionalContext, format) {
|
|
36
|
+
if (format === "claude") return additionalContext;
|
|
37
|
+
return JSON.stringify({ additional_context: additionalContext });
|
|
38
|
+
}
|
|
39
|
+
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.";
|
|
40
|
+
|
|
41
|
+
// src/hooks/pre-compact.ts
|
|
42
|
+
var CONTEXT_USAGE_CAP_PERCENT = 50;
|
|
43
|
+
function buildPreCompactUserMessage(payload = {}) {
|
|
44
|
+
const pct = payload.context_usage_percent;
|
|
45
|
+
const trigger = payload.trigger || "auto";
|
|
46
|
+
const pctTxt = pct !== void 0 && pct !== null ? `~${pct}%` : "high";
|
|
47
|
+
const overCap = pct === void 0 || pct === null || pct >= CONTEXT_USAGE_CAP_PERCENT;
|
|
48
|
+
const msg = overCap ? `Context compacting (${trigger}, usage ${pctTxt}) \u2014 over the ${CONTEXT_USAGE_CAP_PERCENT}% per-agent context-usage cap. Update \`.cursor/HANDOFF.md\` now (forced checkpoint) and open a new chat with \`/continue-plan\` so the next agent starts fresh.` : `Context compacting (${trigger}, usage ${pctTxt}). Update \`.cursor/HANDOFF.md\` and open a new chat with \`/continue-plan\` so the next agent starts fresh.`;
|
|
49
|
+
return { user_message: msg };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/commands/hook.ts
|
|
53
|
+
async function runSessionStartHook(cwd, formatArg, deps = {}) {
|
|
54
|
+
const format = resolveSessionStartFormat(formatArg);
|
|
55
|
+
try {
|
|
56
|
+
const readStdin = deps.readStdin ?? readStdinJson;
|
|
57
|
+
const buildContext = deps.buildContext ?? buildSessionStartAdditionalContext;
|
|
58
|
+
const payload = await readStdin();
|
|
59
|
+
const root = resolveSessionRoot(payload, path.resolve(cwd));
|
|
60
|
+
const out = await buildContext(root, payload);
|
|
61
|
+
return formatSessionStartOutput(out.additional_context, format);
|
|
62
|
+
} catch {
|
|
63
|
+
return formatSessionStartOutput(SESSION_START_DEGRADED_MESSAGE, format);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
var hookCommand = defineCommand({
|
|
67
|
+
meta: {
|
|
68
|
+
name: "hook",
|
|
69
|
+
description: "Cursor + Claude Code hook adapters (session-start, pre-compact). CLI is SoT."
|
|
70
|
+
},
|
|
71
|
+
subCommands: {
|
|
72
|
+
"session-start": defineCommand({
|
|
73
|
+
meta: {
|
|
74
|
+
name: "session-start",
|
|
75
|
+
description: "Emit sessionStart context (stdin: host payload). --format cursor (default, JSON additional_context) | claude (plain stdout)"
|
|
76
|
+
},
|
|
77
|
+
args: {
|
|
78
|
+
cwd: {
|
|
79
|
+
type: "string",
|
|
80
|
+
default: process.cwd()
|
|
81
|
+
},
|
|
82
|
+
format: {
|
|
83
|
+
type: "string",
|
|
84
|
+
default: "cursor",
|
|
85
|
+
description: "cursor (default) | claude"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
async run({ args }) {
|
|
89
|
+
const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
|
|
90
|
+
console.log(await runSessionStartHook(cwd, args.format));
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
"pre-compact": defineCommand({
|
|
94
|
+
meta: {
|
|
95
|
+
name: "pre-compact",
|
|
96
|
+
description: "Emit preCompact user_message JSON (stdin: Cursor payload)"
|
|
97
|
+
},
|
|
98
|
+
async run() {
|
|
99
|
+
const payload = await readStdinJson();
|
|
100
|
+
console.log(JSON.stringify(buildPreCompactUserMessage(payload)));
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export {
|
|
106
|
+
hookCommand,
|
|
107
|
+
runSessionStartHook
|
|
108
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
rewriteRootArgvToRun
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SGTTC2JP.js";
|
|
5
|
+
import "./chunk-W3ZJVBNY.js";
|
|
6
|
+
import "./chunk-P7732A25.js";
|
|
7
7
|
import "./chunk-WGLPZXNU.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Q35TWISF.js";
|
|
9
9
|
import {
|
|
10
10
|
HELMET_OUTLINE,
|
|
11
11
|
SPACE_MARKS,
|
|
@@ -234,41 +234,41 @@ var main = defineCommand({
|
|
|
234
234
|
version: KIT_VERSION
|
|
235
235
|
},
|
|
236
236
|
subCommands: {
|
|
237
|
-
init: () => import("./init-
|
|
238
|
-
install: () => import("./install-
|
|
239
|
-
scan: () => import("./scan-
|
|
240
|
-
add: () => import("./add-
|
|
241
|
-
doctor: () => import("./doctor-
|
|
242
|
-
"setup-global": () => import("./setup-global-
|
|
243
|
-
status: () => import("./status-
|
|
244
|
-
update: () => import("./update-
|
|
237
|
+
init: () => import("./init-BYONEUCW.js").then((m) => m.initCommand),
|
|
238
|
+
install: () => import("./install-HOR6VR44.js").then((m) => m.installCommand),
|
|
239
|
+
scan: () => import("./scan-K3T5RQLC.js").then((m) => m.scanCommand),
|
|
240
|
+
add: () => import("./add-MRI5BXHH.js").then((m) => m.addCommand),
|
|
241
|
+
doctor: () => import("./doctor-OXMDSOXL.js").then((m) => m.doctorCommand),
|
|
242
|
+
"setup-global": () => import("./setup-global-O34KFL2C.js").then((m) => m.setupGlobalCommand),
|
|
243
|
+
status: () => import("./status-QB2FFYUP.js").then((m) => m.statusCommand),
|
|
244
|
+
update: () => import("./update-N2EKKSE7.js").then((m) => m.updateCommand),
|
|
245
245
|
"cursor-awareness": () => import("./cursor-awareness-TN5JXD2C.js").then((m) => m.cursorAwarenessCommand),
|
|
246
246
|
"public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
|
|
247
247
|
"remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
|
|
248
248
|
dogfood: () => import("./dogfood-2JAHSYQA.js").then((m) => m.dogfoodCommand),
|
|
249
|
-
diff: () => import("./diff-
|
|
250
|
-
contribute: () => import("./contribute-
|
|
249
|
+
diff: () => import("./diff-RLB7R2NE.js").then((m) => m.diffCommand),
|
|
250
|
+
contribute: () => import("./contribute-QDTEJ42W.js").then((m) => m.contributeCommand),
|
|
251
251
|
handoff: () => import("./handoff-5AGE2D3T.js").then((m) => m.handoffCommand),
|
|
252
252
|
"plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
|
|
253
|
-
run: () => import("./run-
|
|
254
|
-
"run-plan": () => import("./run-plan-
|
|
255
|
-
"run-plan-all": () => import("./run-
|
|
256
|
-
queue: () => import("./queue-
|
|
253
|
+
run: () => import("./run-PFANZJ5Y.js").then((m) => m.runCommand),
|
|
254
|
+
"run-plan": () => import("./run-plan-7EB4ERSQ.js").then((m) => m.runPlanCommand),
|
|
255
|
+
"run-plan-all": () => import("./run-PFANZJ5Y.js").then((m) => m.runPlanAllCommand),
|
|
256
|
+
queue: () => import("./queue-OJHKFKK3.js").then((m) => m.queueCommand),
|
|
257
257
|
promote: () => import("./promote-H5MIMVEB.js").then((m) => m.promoteCommand),
|
|
258
|
-
countdown: () => import("./countdown-
|
|
259
|
-
"ground-control": () => import("./ground-control-
|
|
260
|
-
conflicts: () => import("./conflicts-
|
|
261
|
-
dashboard: () => import("./dashboard-
|
|
262
|
-
"dashboard-broadcast": () => import("./dashboard-broadcast-
|
|
263
|
-
"mission-control": () => import("./mission-control-
|
|
264
|
-
hook: () => import("./hook-
|
|
258
|
+
countdown: () => import("./countdown-7ONIVAG6.js").then((m) => m.countdownCommand),
|
|
259
|
+
"ground-control": () => import("./ground-control-IDCXN5FK.js").then((m) => m.groundControlCommand),
|
|
260
|
+
conflicts: () => import("./conflicts-XMN4PBCZ.js").then((m) => m.conflictsCommand),
|
|
261
|
+
dashboard: () => import("./dashboard-P65XHYCU.js").then((m) => m.dashboardCommand),
|
|
262
|
+
"dashboard-broadcast": () => import("./dashboard-broadcast-GYK34QYL.js").then((m) => m.dashboardBroadcastCommand),
|
|
263
|
+
"mission-control": () => import("./mission-control-QJBSZVNI.js").then((m) => m.missionControlCommand),
|
|
264
|
+
hook: () => import("./hook-B4VUQOQF.js").then((m) => m.hookCommand),
|
|
265
265
|
guard: () => import("./guard-RJZEEKSL.js").then((m) => m.guardCommand),
|
|
266
266
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
267
|
-
sessions: () => import("./sessions-
|
|
267
|
+
sessions: () => import("./sessions-WQU5DONU.js").then((m) => m.sessionsCommand),
|
|
268
268
|
"outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
|
|
269
269
|
validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
|
|
270
|
-
"engine-info": () => import("./engine-info-
|
|
271
|
-
commands: () => import("./commands-
|
|
270
|
+
"engine-info": () => import("./engine-info-BBI5QO5Y.js").then((m) => m.engineInfoCommand),
|
|
271
|
+
commands: () => import("./commands-NL6UOEP7.js").then((m) => m.commandsCommand)
|
|
272
272
|
},
|
|
273
273
|
async run({ rawArgs }) {
|
|
274
274
|
if (hasCliSubcommand(rawArgs)) return;
|
|
@@ -2,26 +2,26 @@ import {
|
|
|
2
2
|
nextStepAfterInstall,
|
|
3
3
|
performInstall,
|
|
4
4
|
printInstallEpilogue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OKQ37A7E.js";
|
|
6
6
|
import {
|
|
7
7
|
NON_INTERACTIVE_ROOT_ARGS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-G2Z37XFM.js";
|
|
9
9
|
import {
|
|
10
10
|
SkippedSymlinkError,
|
|
11
11
|
logApplyStats
|
|
12
12
|
} from "./chunk-HS7LVVLO.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-GTP224FI.js";
|
|
14
|
+
import "./chunk-7MUTZHWP.js";
|
|
15
15
|
import "./chunk-HAFRAXGV.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-EBDQYFA4.js";
|
|
17
|
+
import "./chunk-UXQH2CNC.js";
|
|
18
18
|
import "./chunk-WGLPZXNU.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Q35TWISF.js";
|
|
20
20
|
import {
|
|
21
21
|
withCliProgress
|
|
22
22
|
} from "./chunk-QTON2GQX.js";
|
|
23
23
|
import "./chunk-PNFF6OU3.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-R4DUO5DA.js";
|
|
25
25
|
import "./chunk-F6C3GFKV.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
@@ -32,17 +32,17 @@ import {
|
|
|
32
32
|
confirmProjectRoot,
|
|
33
33
|
isNonInteractive,
|
|
34
34
|
syncPathCliToRuntime
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QBYJNGCD.js";
|
|
36
36
|
import {
|
|
37
37
|
assessEnvironment
|
|
38
38
|
} from "./chunk-B3VR5YBQ.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-IQQQDEQ4.js";
|
|
40
40
|
import "./chunk-PFEUZXVT.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-VJWWJA36.js";
|
|
42
|
+
import "./chunk-EOQMAU2J.js";
|
|
43
43
|
import "./chunk-WS6OX2IG.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-3HNTNYPR.js";
|
|
45
|
+
import "./chunk-677W4QO3.js";
|
|
46
46
|
import {
|
|
47
47
|
KIT_VERSION
|
|
48
48
|
} from "./chunk-7HDQEK6T.js";
|
|
@@ -3,30 +3,30 @@ import {
|
|
|
3
3
|
nextStepAfterInstall,
|
|
4
4
|
performInstall,
|
|
5
5
|
printInstallEpilogue
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-OKQ37A7E.js";
|
|
7
|
+
import "./chunk-G2Z37XFM.js";
|
|
8
8
|
import "./chunk-HS7LVVLO.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-GTP224FI.js";
|
|
10
|
+
import "./chunk-7MUTZHWP.js";
|
|
11
11
|
import "./chunk-HAFRAXGV.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-EBDQYFA4.js";
|
|
13
|
+
import "./chunk-UXQH2CNC.js";
|
|
14
14
|
import "./chunk-WGLPZXNU.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-Q35TWISF.js";
|
|
16
16
|
import "./chunk-QTON2GQX.js";
|
|
17
17
|
import "./chunk-PNFF6OU3.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-R4DUO5DA.js";
|
|
19
19
|
import "./chunk-F6C3GFKV.js";
|
|
20
20
|
import "./chunk-ZB43YMHW.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-QBYJNGCD.js";
|
|
22
22
|
import "./chunk-B3VR5YBQ.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-IQQQDEQ4.js";
|
|
24
24
|
import "./chunk-PFEUZXVT.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-VJWWJA36.js";
|
|
26
|
+
import "./chunk-EOQMAU2J.js";
|
|
27
27
|
import "./chunk-WS6OX2IG.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-3HNTNYPR.js";
|
|
29
|
+
import "./chunk-677W4QO3.js";
|
|
30
30
|
import "./chunk-7HDQEK6T.js";
|
|
31
31
|
import "./chunk-C4Q77GGJ.js";
|
|
32
32
|
import "./chunk-5B4DVO6C.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
findDashboardDataScript,
|
|
4
4
|
loadDashboardSnapshot,
|
|
5
5
|
runMcTuiLoop
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MPCNPZJZ.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveDashboardSnapshotRoot
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZMYV6PRE.js";
|
|
10
10
|
import "./chunk-QTON2GQX.js";
|
|
11
11
|
import {
|
|
12
12
|
logger
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readHandoffText
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HJWSOZXS.js";
|
|
4
|
+
import "./chunk-6WUKLS4D.js";
|
|
5
|
+
import {
|
|
6
|
+
QUEUE_LEASE_RELPATH,
|
|
7
|
+
formatQueueLeaseRefusal,
|
|
8
|
+
inspectQueueLease
|
|
9
|
+
} from "./chunk-DTSL2RH7.js";
|
|
4
10
|
import "./chunk-7ABY6DYH.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-CJ3JAH7L.js";
|
|
11
|
+
import "./chunk-C4LCOOL4.js";
|
|
12
|
+
import "./chunk-BGL5DRK2.js";
|
|
8
13
|
import {
|
|
9
14
|
extractFieldBlock
|
|
10
15
|
} from "./chunk-L5V3W3DY.js";
|
|
11
16
|
import "./chunk-MUTTNRX4.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-SGTTC2JP.js";
|
|
18
|
+
import "./chunk-W3ZJVBNY.js";
|
|
19
|
+
import "./chunk-P7732A25.js";
|
|
15
20
|
import "./chunk-WGLPZXNU.js";
|
|
16
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-Q35TWISF.js";
|
|
17
22
|
import "./chunk-QTON2GQX.js";
|
|
18
23
|
import "./chunk-C4Q77GGJ.js";
|
|
19
24
|
import "./chunk-5B4DVO6C.js";
|
|
@@ -159,14 +164,53 @@ var gatesCommand = defineCommand({
|
|
|
159
164
|
process.stdout.write(renderQueueGates(handoff, format, String(args.backend || "claude")));
|
|
160
165
|
}
|
|
161
166
|
});
|
|
167
|
+
function renderQueueLease(verdict, json) {
|
|
168
|
+
const exitCode = verdict.kind === "held" ? 1 : 0;
|
|
169
|
+
if (json) return { text: `${JSON.stringify(verdict, null, 2)}
|
|
170
|
+
`, exitCode };
|
|
171
|
+
switch (verdict.kind) {
|
|
172
|
+
case "free":
|
|
173
|
+
return { text: `Queue lease: free (no ${QUEUE_LEASE_RELPATH}).
|
|
174
|
+
`, exitCode };
|
|
175
|
+
case "own":
|
|
176
|
+
return { text: `Queue lease: held by this session (${verdict.lease.session}).
|
|
177
|
+
`, exitCode };
|
|
178
|
+
case "stale":
|
|
179
|
+
return {
|
|
180
|
+
text: `Queue lease: stale (${verdict.reason}); the next run-plan-all takes it over and logs it in HANDOFF.
|
|
181
|
+
`,
|
|
182
|
+
exitCode
|
|
183
|
+
};
|
|
184
|
+
case "held":
|
|
185
|
+
return { text: `${formatQueueLeaseRefusal(verdict)}
|
|
186
|
+
`, exitCode };
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
var leaseCommand = defineCommand({
|
|
190
|
+
meta: {
|
|
191
|
+
name: "lease",
|
|
192
|
+
description: "Check the /run-plan-all queue owner lease (read-only): exit 0 free, stale or own session; exit 1 held by another live owner"
|
|
193
|
+
},
|
|
194
|
+
args: {
|
|
195
|
+
json: { type: "boolean", description: "Print the lease verdict as JSON", default: false },
|
|
196
|
+
cwd: { type: "string", description: "Workspace folder (default: current directory)" }
|
|
197
|
+
},
|
|
198
|
+
run({ args }) {
|
|
199
|
+
const root = path.resolve(typeof args.cwd === "string" && args.cwd ? args.cwd : ".");
|
|
200
|
+
const out = renderQueueLease(inspectQueueLease(root), Boolean(args.json));
|
|
201
|
+
process.stdout.write(out.text);
|
|
202
|
+
process.exitCode = out.exitCode;
|
|
203
|
+
}
|
|
204
|
+
});
|
|
162
205
|
var queueCommand = defineCommand({
|
|
163
206
|
meta: {
|
|
164
207
|
name: "queue",
|
|
165
|
-
description: "Read the /run-plan-all queue
|
|
208
|
+
description: "Read the /run-plan-all queue (`gates`: deferred operator gates from HANDOFF; `lease`: the queue owner lease)"
|
|
166
209
|
},
|
|
167
|
-
subCommands: { gates: gatesCommand }
|
|
210
|
+
subCommands: { gates: gatesCommand, lease: leaseCommand }
|
|
168
211
|
});
|
|
169
212
|
export {
|
|
170
213
|
queueCommand,
|
|
171
|
-
renderQueueGates
|
|
214
|
+
renderQueueGates,
|
|
215
|
+
renderQueueLease
|
|
172
216
|
};
|