@dadado/agent-kit-cli 6.10.0 → 6.10.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.
|
@@ -53,3 +53,17 @@ export function buildFlightLogTickets(
|
|
|
53
53
|
tickets: Record<string, unknown>[] | null | undefined,
|
|
54
54
|
opts?: { cap?: number },
|
|
55
55
|
): FlightLogTicket[];
|
|
56
|
+
|
|
57
|
+
/** Mission Control snapshot slice (`missionControl`); typed loosely for the TUI tests. */
|
|
58
|
+
export type MissionControlView = {
|
|
59
|
+
now: Record<string, unknown> & { status: string; gaps: string | null };
|
|
60
|
+
flightLog: Record<string, unknown> & { current: string | null };
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export function buildMissionControlView(input: {
|
|
65
|
+
plans?: unknown[];
|
|
66
|
+
handoff?: HandoffMarkdown | null;
|
|
67
|
+
nowMs?: number;
|
|
68
|
+
[key: string]: unknown;
|
|
69
|
+
}): MissionControlView;
|
|
@@ -2044,6 +2044,9 @@ export function buildCurrentExecution(plans, handoff) {
|
|
|
2044
2044
|
planFile: null,
|
|
2045
2045
|
planPath: null,
|
|
2046
2046
|
mode: null,
|
|
2047
|
+
// Gaps outlive the plan: with `Plan: none` they still feed the Flight Log NOW
|
|
2048
|
+
// residual, so the cockpit never reads All clear over open Gaps.
|
|
2049
|
+
gaps: handoff?.gaps || null,
|
|
2047
2050
|
progress: { completed: 0, total: 0 },
|
|
2048
2051
|
previousTodo: null,
|
|
2049
2052
|
currentTodo: null,
|
|
@@ -323,6 +323,13 @@ function forgeApiMergeCall(command) {
|
|
|
323
323
|
(segment) => FORGE_API_CALL_RE.test(segment) && !segmentHasAllowMainPushEnv(segment)
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
|
+
var PR_MERGE_CALL_RE = /(?:^|[\s'"(;|&`$!{])(?:[\w./-]+\/)?(?:gh\s+pr|glab\s+mr)\s+merge(?![\w-])/;
|
|
327
|
+
function unresolvedPrMergeCall(command) {
|
|
328
|
+
if (!PR_MERGE_CALL_RE.test(command)) return false;
|
|
329
|
+
return shellSegments(command).some(
|
|
330
|
+
(segment) => PR_MERGE_CALL_RE.test(segment) && !segmentHasAllowMainPushEnv(segment) && parsePrMergeHead(canonicalGitHead(segment)) === null
|
|
331
|
+
);
|
|
332
|
+
}
|
|
326
333
|
function prMergeKey(target) {
|
|
327
334
|
return `${target.forge}\0${target.repo ?? ""}\0${target.selector ?? ""}`;
|
|
328
335
|
}
|
|
@@ -440,11 +447,14 @@ var SHELL_DENY_RULES = [
|
|
|
440
447
|
// skips the auto-mode classifier; this rule keeps that allowance to non-protected bases.
|
|
441
448
|
// A forge API merge (`gh api … pulls/<n>/merge`, a GraphQL merge mutation) has no base
|
|
442
449
|
// to resolve and no /git-staging use: it is denied outright, so neither the API nor
|
|
443
|
-
// Colony's host path (typed yes for main) can be bypassed that way.
|
|
450
|
+
// 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.
|
|
444
453
|
id: "pr-merge-protected-base",
|
|
445
|
-
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)",
|
|
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)",
|
|
446
455
|
test: (cmd, opts) => {
|
|
447
456
|
if (forgeApiMergeCall(cmd)) return true;
|
|
457
|
+
if (unresolvedPrMergeCall(cmd)) return true;
|
|
448
458
|
const bases = opts?.prMergeBases;
|
|
449
459
|
if (!bases) return false;
|
|
450
460
|
return shellSegments(cmd).some((segment) => {
|
|
@@ -579,7 +589,7 @@ var guardCommand = defineCommand({
|
|
|
579
589
|
shell: defineCommand({
|
|
580
590
|
meta: {
|
|
581
591
|
name: "shell",
|
|
582
|
-
description: "Evaluate a shell command against the git-workflow / protected-branch deny-list (git checkout|restore|reset --hard|clean -fd + pushes to main/master/prod + gh pr merge / glab mr merge into main/master/prod or an unresolved base + any gh api / glab api merge call + direct git push/gh pr create|merge against the public repo). Not a general destructive-command guard: rm -rf, chmod, dd are allowed."
|
|
592
|
+
description: "Evaluate a shell command against the git-workflow / protected-branch deny-list (git checkout|restore|reset --hard|clean -fd + pushes to main/master/prod + gh pr merge / glab mr merge into main/master/prod or an unresolved base + any gh pr merge / glab mr merge not at the head of its own segment (loop body, if, !, xargs, bash -c / sh -c) + any gh api / glab api merge call + direct git push/gh pr create|merge against the public repo). A script file that runs a merge is out of reach. Not a general destructive-command guard: rm -rf, chmod, dd are allowed."
|
|
583
593
|
},
|
|
584
594
|
args: {
|
|
585
595
|
json: {
|
package/dist/index.js
CHANGED
|
@@ -256,7 +256,7 @@ var main = defineCommand({
|
|
|
256
256
|
"dashboard-broadcast": () => import("./dashboard-broadcast-NK7PU72L.js").then((m) => m.dashboardBroadcastCommand),
|
|
257
257
|
"mission-control": () => import("./mission-control-C2QV5D25.js").then((m) => m.missionControlCommand),
|
|
258
258
|
hook: () => import("./hook-HJW5SXQG.js").then((m) => m.hookCommand),
|
|
259
|
-
guard: () => import("./guard-
|
|
259
|
+
guard: () => import("./guard-X6FNFZ27.js").then((m) => m.guardCommand),
|
|
260
260
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
261
261
|
sessions: () => import("./sessions-O7MYEMCT.js").then((m) => m.sessionsCommand),
|
|
262
262
|
"outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
|
package/package.json
CHANGED