@dadado/agent-kit-cli 5.15.1 → 5.17.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 +69 -65
- package/dashboard/lib/guards.d.mts +5 -0
- package/dashboard/lib/guards.mjs +31 -0
- package/dashboard/lib/identity-probe.mjs +56 -0
- package/dashboard/lib/pipeline-cache.mjs +58 -0
- package/dashboard/lib/processes.mjs +71 -0
- package/dashboard/serve.mjs +43 -1
- package/dashboard/start-broadcast.mjs +2 -12
- package/dashboard/start.mjs +2 -13
- package/dist/add-HTYIFKMN.js +150 -0
- package/dist/chunk-2IPXQFJE.js +253 -0
- package/dist/chunk-2RDRMGD3.js +82 -0
- package/dist/chunk-2YU2H7I6.js +42 -0
- package/dist/chunk-4IWG5CVE.js +214 -0
- package/dist/chunk-5VCOWTTP.js +6 -0
- package/dist/chunk-77V75A7O.js +39 -0
- package/dist/chunk-7HDQEK6T.js +26 -0
- package/dist/chunk-AW74INUW.js +1456 -0
- package/dist/chunk-B73KQ5KX.js +972 -0
- package/dist/chunk-CBCW5R5J.js +484 -0
- package/dist/chunk-DE3LQFSJ.js +18 -0
- package/dist/chunk-DQA434Y4.js +106 -0
- package/dist/chunk-F4VMYR7U.js +318 -0
- package/dist/chunk-F6C3GFKV.js +57 -0
- package/dist/chunk-HFUH3HVS.js +282 -0
- package/dist/chunk-HS7LVVLO.js +74 -0
- package/dist/chunk-IHROBTNM.js +135 -0
- package/dist/chunk-KD2MYBB6.js +213 -0
- package/dist/chunk-MAPOQEA2.js +43 -0
- package/dist/chunk-N3HTJVBR.js +341 -0
- package/dist/chunk-NQ7IQ5XT.js +26 -0
- package/dist/chunk-OUQZC744.js +1315 -0
- package/dist/chunk-PCCQUWE5.js +817 -0
- package/dist/chunk-PNFF6OU3.js +273 -0
- package/dist/chunk-PNG7LO2F.js +53 -0
- package/dist/chunk-QTON2GQX.js +203 -0
- package/dist/chunk-S6GMFDKV.js +50 -0
- package/dist/chunk-SMGFN3Z4.js +503 -0
- package/dist/chunk-STGFBAYT.js +641 -0
- package/dist/chunk-TFZ2JUXH.js +1081 -0
- package/dist/chunk-VY7MTPJ2.js +205 -0
- package/dist/chunk-W24CMQ32.js +525 -0
- package/dist/chunk-WW3YZKHW.js +165 -0
- package/dist/chunk-ZB43YMHW.js +20 -0
- package/dist/chunk-ZCTSUQRR.js +874 -0
- package/dist/chunk-ZXKZBTXE.js +17 -0
- package/dist/contribute-C6AW2P6J.js +367 -0
- package/dist/cursor-awareness-KTL2RGKD.js +77 -0
- package/dist/dashboard-YSNUGBFY.js +21 -0
- package/dist/dashboard-broadcast-M4CMW7RX.js +119 -0
- package/dist/diff-VHNR62SI.js +74 -0
- package/dist/doctor-PET2HRRJ.js +236 -0
- package/dist/dogfood-KKFVRWT6.js +366 -0
- package/dist/guard-EHXF76ID.js +530 -0
- package/dist/handoff-3UI6VKVG.js +302 -0
- package/dist/hook-DYIMKJYL.js +1074 -0
- package/dist/index.js +62 -14068
- package/dist/init-Q4LBM6KT.js +127 -0
- package/dist/install-RHOS3OYZ.js +34 -0
- package/dist/mission-control-LJACEVVN.js +89 -0
- package/dist/monitors-QV2IS3MP.js +176 -0
- package/dist/plan-index-JMC7Z4DW.js +44 -0
- package/dist/public-inbound-radar-WP3XF7GS.js +68 -0
- package/dist/remote-issues-SZ4HDQL5.js +44 -0
- package/dist/run-I3BFGULT.js +243 -0
- package/dist/run-plan-FO7CL4M3.js +118 -0
- package/dist/scan-NI2SWJ2E.js +33 -0
- package/dist/setup-global-M42GEODI.js +340 -0
- package/dist/status-XPVQVQMX.js +150 -0
- package/dist/update-FJ2EBZVO.js +283 -0
- package/dist/validate-V2CW7J4B.js +201 -0
- package/package.json +3 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
nextStepAfterInstall,
|
|
3
|
+
performInstall,
|
|
4
|
+
printInstallEpilogue
|
|
5
|
+
} from "./chunk-B73KQ5KX.js";
|
|
6
|
+
import {
|
|
7
|
+
NON_INTERACTIVE_ROOT_ARGS
|
|
8
|
+
} from "./chunk-DQA434Y4.js";
|
|
9
|
+
import {
|
|
10
|
+
SkippedSymlinkError,
|
|
11
|
+
logApplyStats
|
|
12
|
+
} from "./chunk-HS7LVVLO.js";
|
|
13
|
+
import "./chunk-PNG7LO2F.js";
|
|
14
|
+
import "./chunk-STGFBAYT.js";
|
|
15
|
+
import "./chunk-ZXKZBTXE.js";
|
|
16
|
+
import "./chunk-W24CMQ32.js";
|
|
17
|
+
import "./chunk-MAPOQEA2.js";
|
|
18
|
+
import {
|
|
19
|
+
withCliProgress
|
|
20
|
+
} from "./chunk-QTON2GQX.js";
|
|
21
|
+
import "./chunk-PNFF6OU3.js";
|
|
22
|
+
import "./chunk-ZCTSUQRR.js";
|
|
23
|
+
import "./chunk-F6C3GFKV.js";
|
|
24
|
+
import {
|
|
25
|
+
logger
|
|
26
|
+
} from "./chunk-ZB43YMHW.js";
|
|
27
|
+
import {
|
|
28
|
+
RootRefusedError,
|
|
29
|
+
classifyInstallError,
|
|
30
|
+
confirmProjectRoot,
|
|
31
|
+
isNonInteractive,
|
|
32
|
+
syncPathCliToRuntime
|
|
33
|
+
} from "./chunk-F4VMYR7U.js";
|
|
34
|
+
import {
|
|
35
|
+
assessEnvironment
|
|
36
|
+
} from "./chunk-4IWG5CVE.js";
|
|
37
|
+
import "./chunk-SMGFN3Z4.js";
|
|
38
|
+
import "./chunk-NQ7IQ5XT.js";
|
|
39
|
+
import "./chunk-2RDRMGD3.js";
|
|
40
|
+
import "./chunk-N3HTJVBR.js";
|
|
41
|
+
import "./chunk-AW74INUW.js";
|
|
42
|
+
import "./chunk-5VCOWTTP.js";
|
|
43
|
+
import {
|
|
44
|
+
KIT_VERSION
|
|
45
|
+
} from "./chunk-7HDQEK6T.js";
|
|
46
|
+
import "./chunk-77V75A7O.js";
|
|
47
|
+
|
|
48
|
+
// src/commands/init.ts
|
|
49
|
+
import { intro, outro } from "@clack/prompts";
|
|
50
|
+
import { defineCommand } from "citty";
|
|
51
|
+
async function runInitCompatibility(cwd, installer = performInstall) {
|
|
52
|
+
return installer({ cwd });
|
|
53
|
+
}
|
|
54
|
+
var initCommand = defineCommand({
|
|
55
|
+
meta: {
|
|
56
|
+
name: "init",
|
|
57
|
+
description: "Guided setup entry (compat path to install + readiness)."
|
|
58
|
+
},
|
|
59
|
+
args: {
|
|
60
|
+
cwd: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Project root directory",
|
|
63
|
+
default: process.cwd()
|
|
64
|
+
},
|
|
65
|
+
...NON_INTERACTIVE_ROOT_ARGS
|
|
66
|
+
},
|
|
67
|
+
async run({ args }) {
|
|
68
|
+
const nonInteractive = args.yes || isNonInteractive();
|
|
69
|
+
if (!nonInteractive) {
|
|
70
|
+
intro(`agent-kit v${KIT_VERSION}`);
|
|
71
|
+
} else {
|
|
72
|
+
logger.info(`agent-kit v${KIT_VERSION} (non-interactive mode)`);
|
|
73
|
+
}
|
|
74
|
+
logger.info("init now uses the canonical install and readiness workflow.");
|
|
75
|
+
let projectRoot;
|
|
76
|
+
try {
|
|
77
|
+
projectRoot = await confirmProjectRoot(args.cwd, {
|
|
78
|
+
nonInteractive,
|
|
79
|
+
command: "install",
|
|
80
|
+
forceRoot: args["force-root"]
|
|
81
|
+
});
|
|
82
|
+
} catch (err) {
|
|
83
|
+
if (err instanceof RootRefusedError) {
|
|
84
|
+
logger.error(err.message);
|
|
85
|
+
if (err.recovery) console.error(`
|
|
86
|
+
${err.recovery}
|
|
87
|
+
`);
|
|
88
|
+
process.exitCode = 1;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const result = await withCliProgress("init", () => runInitCompatibility(projectRoot));
|
|
95
|
+
const pending = result.readiness.pendingActions.length;
|
|
96
|
+
logger.success(`L0 and readiness prepared in ${result.projectRoot}`);
|
|
97
|
+
const nextStep = nextStepAfterInstall(pending);
|
|
98
|
+
const env = await assessEnvironment();
|
|
99
|
+
const sync = await syncPathCliToRuntime({ runtimeVersion: KIT_VERSION, env });
|
|
100
|
+
for (const line of sync.lines) console.log(line);
|
|
101
|
+
printInstallEpilogue(sync.env, { runtimeVersion: KIT_VERSION });
|
|
102
|
+
if (!nonInteractive) {
|
|
103
|
+
outro(nextStep);
|
|
104
|
+
} else {
|
|
105
|
+
logger.info(nextStep);
|
|
106
|
+
}
|
|
107
|
+
} catch (err) {
|
|
108
|
+
if (err instanceof SkippedSymlinkError) {
|
|
109
|
+
logApplyStats(err.stats);
|
|
110
|
+
logger.error(err.message);
|
|
111
|
+
process.exitCode = 1;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const hint = classifyInstallError(err);
|
|
115
|
+
logger.error(hint.message);
|
|
116
|
+
console.error(`
|
|
117
|
+
${hint.recovery}
|
|
118
|
+
`);
|
|
119
|
+
process.exitCode = 1;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export {
|
|
125
|
+
initCommand,
|
|
126
|
+
runInitCompatibility
|
|
127
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installCommand,
|
|
3
|
+
nextStepAfterInstall,
|
|
4
|
+
performInstall,
|
|
5
|
+
printInstallEpilogue
|
|
6
|
+
} from "./chunk-B73KQ5KX.js";
|
|
7
|
+
import "./chunk-DQA434Y4.js";
|
|
8
|
+
import "./chunk-HS7LVVLO.js";
|
|
9
|
+
import "./chunk-PNG7LO2F.js";
|
|
10
|
+
import "./chunk-STGFBAYT.js";
|
|
11
|
+
import "./chunk-ZXKZBTXE.js";
|
|
12
|
+
import "./chunk-W24CMQ32.js";
|
|
13
|
+
import "./chunk-MAPOQEA2.js";
|
|
14
|
+
import "./chunk-QTON2GQX.js";
|
|
15
|
+
import "./chunk-PNFF6OU3.js";
|
|
16
|
+
import "./chunk-ZCTSUQRR.js";
|
|
17
|
+
import "./chunk-F6C3GFKV.js";
|
|
18
|
+
import "./chunk-ZB43YMHW.js";
|
|
19
|
+
import "./chunk-F4VMYR7U.js";
|
|
20
|
+
import "./chunk-4IWG5CVE.js";
|
|
21
|
+
import "./chunk-SMGFN3Z4.js";
|
|
22
|
+
import "./chunk-NQ7IQ5XT.js";
|
|
23
|
+
import "./chunk-2RDRMGD3.js";
|
|
24
|
+
import "./chunk-N3HTJVBR.js";
|
|
25
|
+
import "./chunk-AW74INUW.js";
|
|
26
|
+
import "./chunk-5VCOWTTP.js";
|
|
27
|
+
import "./chunk-7HDQEK6T.js";
|
|
28
|
+
import "./chunk-77V75A7O.js";
|
|
29
|
+
export {
|
|
30
|
+
installCommand,
|
|
31
|
+
nextStepAfterInstall,
|
|
32
|
+
performInstall,
|
|
33
|
+
printInstallEpilogue
|
|
34
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildMcTuiView,
|
|
3
|
+
findDashboardDataScript,
|
|
4
|
+
loadDashboardSnapshot,
|
|
5
|
+
runMcTuiLoop
|
|
6
|
+
} from "./chunk-PCCQUWE5.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveDashboardSnapshotRoot
|
|
9
|
+
} from "./chunk-HFUH3HVS.js";
|
|
10
|
+
import "./chunk-QTON2GQX.js";
|
|
11
|
+
import {
|
|
12
|
+
logger
|
|
13
|
+
} from "./chunk-ZB43YMHW.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/mission-control.ts
|
|
16
|
+
import { defineCommand } from "citty";
|
|
17
|
+
var missionControlCommand = defineCommand({
|
|
18
|
+
meta: {
|
|
19
|
+
name: "mission-control",
|
|
20
|
+
description: "ASCII Mission Control (mission, flight log, checklist, crew monitor) without a browser."
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
cwd: {
|
|
24
|
+
type: "string",
|
|
25
|
+
default: process.cwd(),
|
|
26
|
+
description: "Workspace to snapshot (nearest .cursor/agent-kit.json, else git root)"
|
|
27
|
+
},
|
|
28
|
+
once: {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Print one frame and exit (Claude Code / non-TTY / CI)"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
async run({ args }) {
|
|
35
|
+
const snapshotRoot = resolveDashboardSnapshotRoot(args.cwd);
|
|
36
|
+
const dataScript = await findDashboardDataScript(args.cwd);
|
|
37
|
+
if (!dataScript) {
|
|
38
|
+
logger.error("No dashboard/dashboard-data.mjs found.");
|
|
39
|
+
console.error(
|
|
40
|
+
[
|
|
41
|
+
"",
|
|
42
|
+
"The Mission Control snapshot script is not available in this workspace.",
|
|
43
|
+
"The TUI reuses the Path C dashboard data collector; it does not start an HTTP server.",
|
|
44
|
+
"",
|
|
45
|
+
"Recovery (pick one):",
|
|
46
|
+
" 1. Upgrade the CLI: npx @dadado/agent-kit-cli@latest mission-control",
|
|
47
|
+
" 2. Set MISSION_CONTROL_KIT_ROOT or AGENT_KIT_HOME to an agent-kit checkout",
|
|
48
|
+
" 3. Place an agent-kit sibling: ../agent-kit/dashboard/dashboard-data.mjs",
|
|
49
|
+
""
|
|
50
|
+
].join("\n")
|
|
51
|
+
);
|
|
52
|
+
process.exitCode = 1;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const handle = await runMcTuiLoop({
|
|
56
|
+
once: Boolean(args.once),
|
|
57
|
+
stdoutIsTTY: Boolean(process.stdout.isTTY),
|
|
58
|
+
env: process.env,
|
|
59
|
+
renderOpts: { stdoutIsTTY: Boolean(process.stdout.isTTY) },
|
|
60
|
+
loadView: async () => {
|
|
61
|
+
const loaded = await loadDashboardSnapshot({
|
|
62
|
+
dataScript,
|
|
63
|
+
snapshotRoot
|
|
64
|
+
});
|
|
65
|
+
if (!loaded.ok) return buildMcTuiView(null, loaded.error);
|
|
66
|
+
return buildMcTuiView(loaded.snapshot);
|
|
67
|
+
},
|
|
68
|
+
hooks: {
|
|
69
|
+
write: (chunk) => {
|
|
70
|
+
process.stdout.write(chunk);
|
|
71
|
+
},
|
|
72
|
+
stdin: process.stdin,
|
|
73
|
+
exit: (code) => {
|
|
74
|
+
process.exit(code);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
if (!handle) return;
|
|
79
|
+
const onSignal = () => {
|
|
80
|
+
handle.stop();
|
|
81
|
+
process.exit(0);
|
|
82
|
+
};
|
|
83
|
+
process.on("SIGINT", onSignal);
|
|
84
|
+
process.on("SIGTERM", onSignal);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
missionControlCommand
|
|
89
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// src/commands/monitors.ts
|
|
2
|
+
import path2 from "path";
|
|
3
|
+
import { defineCommand } from "citty";
|
|
4
|
+
|
|
5
|
+
// src/invariants/monitors-untriaged.ts
|
|
6
|
+
import { execFile } from "child_process";
|
|
7
|
+
import { readFile, readdir, stat } from "fs/promises";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import { promisify } from "util";
|
|
10
|
+
|
|
11
|
+
// src/invariants/triage-heading.ts
|
|
12
|
+
var TRIAGE_HEADING_RE = /^#{2,6}\s+(?:Triage note|Follow-?up plan|Residuals plan)\b/im;
|
|
13
|
+
|
|
14
|
+
// src/invariants/monitors-untriaged.ts
|
|
15
|
+
var execFileAsync = promisify(execFile);
|
|
16
|
+
var CITE = "agent-kit monitors --untriaged (ADR 2026-07-27_plan-review-triage-untriaged-not-mtime; never newest-mtime-wins)";
|
|
17
|
+
function hasOpenGaps(content) {
|
|
18
|
+
if (/###\s+Still open[^\n]*\n+(?:\s*\n)*(?:None\.|none\.|\*None\*)/i.test(content)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (/###\s+Still open/i.test(content) && !/###\s+Still open[^\n]*\n+(?:\s*\n)*(?:None\.|none\.)/i.test(content)) {
|
|
22
|
+
const m = content.match(/###\s+Still open[^\n]*\n([\s\S]*?)(?=\n### |\n## |$)/i);
|
|
23
|
+
if (m?.[1]?.trim() && !/^(none\.?|\*none\*)$/i.test(m[1].trim())) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (/^#{2,6}\s+.*\bResidual items?\b/im.test(content)) return true;
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
async function listMonitorFiles(memoryDir) {
|
|
31
|
+
try {
|
|
32
|
+
const names = await readdir(memoryDir);
|
|
33
|
+
return names.filter((n) => n.startsWith("plan-monitor-") && n.endsWith(".md")).sort();
|
|
34
|
+
} catch {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function gitFreshMonitorNames(rootDir) {
|
|
39
|
+
const names = /* @__PURE__ */ new Set();
|
|
40
|
+
try {
|
|
41
|
+
const { stdout } = await execFileAsync(
|
|
42
|
+
"git",
|
|
43
|
+
["status", "--porcelain", "--", ".cursor/memory"],
|
|
44
|
+
{ cwd: rootDir, maxBuffer: 2 * 1024 * 1024 }
|
|
45
|
+
);
|
|
46
|
+
for (const line of stdout.split("\n")) {
|
|
47
|
+
if (!line.trim()) continue;
|
|
48
|
+
const file = line.slice(3).trim().replace(/^.* -> /, "");
|
|
49
|
+
const base = path.basename(file);
|
|
50
|
+
if (base.startsWith("plan-monitor-") && base.endsWith(".md")) {
|
|
51
|
+
names.add(base);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
|
56
|
+
return names;
|
|
57
|
+
}
|
|
58
|
+
function extractHandoffPlanSlugs(handoff) {
|
|
59
|
+
const slugs = /* @__PURE__ */ new Set();
|
|
60
|
+
for (const m of handoff.matchAll(/`([a-z0-9][a-z0-9._-]*)\.plan\.md`/gi)) {
|
|
61
|
+
if (m[1]) slugs.add(m[1].toLowerCase());
|
|
62
|
+
}
|
|
63
|
+
for (const m of handoff.matchAll(/plan-monitor-([a-z0-9][a-z0-9._-]*)\.md/gi)) {
|
|
64
|
+
if (m[1]) slugs.add(m[1].toLowerCase());
|
|
65
|
+
}
|
|
66
|
+
return slugs;
|
|
67
|
+
}
|
|
68
|
+
function monitorSlugFromName(fileName) {
|
|
69
|
+
return fileName.replace(/^plan-monitor-/, "").replace(/\.md$/, "").toLowerCase();
|
|
70
|
+
}
|
|
71
|
+
async function selectUntriagedMonitors(rootDir) {
|
|
72
|
+
const root = path.resolve(rootDir);
|
|
73
|
+
const memoryDir = path.join(root, ".cursor", "memory");
|
|
74
|
+
const allNames = await listMonitorFiles(memoryDir);
|
|
75
|
+
const selectionOrder = ["git-fresh", "handoff-aligned", "untriaged-scan"];
|
|
76
|
+
const byName = /* @__PURE__ */ new Map();
|
|
77
|
+
for (const name of allNames) {
|
|
78
|
+
const abs = path.join(memoryDir, name);
|
|
79
|
+
try {
|
|
80
|
+
const [content, st] = await Promise.all([readFile(abs, "utf8"), stat(abs)]);
|
|
81
|
+
byName.set(name, { content, mtimeMs: st.mtimeMs });
|
|
82
|
+
} catch {
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const untriaged = (name) => {
|
|
86
|
+
const row = byName.get(name);
|
|
87
|
+
return !!row && !TRIAGE_HEADING_RE.test(row.content);
|
|
88
|
+
};
|
|
89
|
+
const gitFresh = await gitFreshMonitorNames(root);
|
|
90
|
+
const gitFreshSet = [...gitFresh].filter(untriaged).sort();
|
|
91
|
+
let handoff = "";
|
|
92
|
+
try {
|
|
93
|
+
handoff = await readFile(path.join(root, ".cursor", "HANDOFF.md"), "utf8");
|
|
94
|
+
} catch {
|
|
95
|
+
handoff = "";
|
|
96
|
+
}
|
|
97
|
+
const handoffSlugs = extractHandoffPlanSlugs(handoff);
|
|
98
|
+
const handoffAligned = allNames.filter((n) => untriaged(n) && handoffSlugs.has(monitorSlugFromName(n))).sort();
|
|
99
|
+
const scanAll = allNames.filter(untriaged);
|
|
100
|
+
let chosen;
|
|
101
|
+
if (gitFreshSet.length > 0) {
|
|
102
|
+
chosen = { names: gitFreshSet, bucket: "git-fresh" };
|
|
103
|
+
} else if (handoffAligned.length > 0) {
|
|
104
|
+
chosen = { names: handoffAligned, bucket: "handoff-aligned" };
|
|
105
|
+
} else {
|
|
106
|
+
chosen = { names: scanAll, bucket: "untriaged-scan" };
|
|
107
|
+
}
|
|
108
|
+
const entries = [];
|
|
109
|
+
for (const name of chosen.names) {
|
|
110
|
+
const row = byName.get(name);
|
|
111
|
+
if (!row) continue;
|
|
112
|
+
entries.push({
|
|
113
|
+
path: path.join(memoryDir, name),
|
|
114
|
+
relativePath: path.relative(root, path.join(memoryDir, name)).split(path.sep).join("/"),
|
|
115
|
+
mtimeMs: row.mtimeMs,
|
|
116
|
+
hasTriageHeading: false,
|
|
117
|
+
hasOpenGaps: hasOpenGaps(row.content),
|
|
118
|
+
selectionBucket: chosen.bucket
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
entries.sort((a, b) => {
|
|
122
|
+
if (a.hasOpenGaps !== b.hasOpenGaps) return a.hasOpenGaps ? -1 : 1;
|
|
123
|
+
return b.mtimeMs - a.mtimeMs;
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
selectionOrder: [...selectionOrder],
|
|
127
|
+
monitors: entries,
|
|
128
|
+
cite: CITE
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/commands/monitors.ts
|
|
133
|
+
var monitorsCommand = defineCommand({
|
|
134
|
+
meta: {
|
|
135
|
+
name: "monitors",
|
|
136
|
+
description: "Select untriaged plan monitors (--untriaged; SoT for chat triage)."
|
|
137
|
+
},
|
|
138
|
+
args: {
|
|
139
|
+
cwd: {
|
|
140
|
+
type: "string",
|
|
141
|
+
default: process.cwd()
|
|
142
|
+
},
|
|
143
|
+
untriaged: {
|
|
144
|
+
type: "boolean",
|
|
145
|
+
default: false,
|
|
146
|
+
description: "Select untriaged monitors (never newest-mtime-wins alone)"
|
|
147
|
+
},
|
|
148
|
+
json: {
|
|
149
|
+
type: "boolean",
|
|
150
|
+
default: false,
|
|
151
|
+
description: "Machine-readable JSON"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
async run({ args }) {
|
|
155
|
+
if (!args.untriaged) {
|
|
156
|
+
console.error("Usage: agent-kit monitors --untriaged [--json] [--cwd <dir>]");
|
|
157
|
+
process.exitCode = 2;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const result = await selectUntriagedMonitors(path2.resolve(args.cwd));
|
|
161
|
+
if (args.json) {
|
|
162
|
+
console.log(JSON.stringify(result, null, 2));
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (result.monitors.length === 0) {
|
|
166
|
+
console.log("No untriaged plan-monitor files.");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
for (const m of result.monitors) {
|
|
170
|
+
console.log(m.relativePath);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
export {
|
|
175
|
+
monitorsCommand
|
|
176
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatPlanIndexLines,
|
|
3
|
+
writePlanIndex
|
|
4
|
+
} from "./chunk-KD2MYBB6.js";
|
|
5
|
+
import "./chunk-5VCOWTTP.js";
|
|
6
|
+
import "./chunk-77V75A7O.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/plan-index.ts
|
|
9
|
+
import path from "path";
|
|
10
|
+
import { defineCommand } from "citty";
|
|
11
|
+
var planIndexCommand = defineCommand({
|
|
12
|
+
meta: {
|
|
13
|
+
name: "plan-index",
|
|
14
|
+
description: "Write pending-only plan index from HANDOFF-named plans (no directory glob)."
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
cwd: {
|
|
18
|
+
type: "string",
|
|
19
|
+
default: process.cwd()
|
|
20
|
+
},
|
|
21
|
+
json: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
default: false,
|
|
24
|
+
description: "Print the index JSON after writing"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
async run({ args }) {
|
|
28
|
+
const root = path.resolve(args.cwd);
|
|
29
|
+
const index = await writePlanIndex(root);
|
|
30
|
+
if (args.json) {
|
|
31
|
+
console.log(JSON.stringify(index, null, 2));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const lines = formatPlanIndexLines(index);
|
|
35
|
+
if (lines.length === 0) {
|
|
36
|
+
console.log("No pending plans in the HANDOFF-named set.");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
for (const line of lines) console.log(line);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
planIndexCommand
|
|
44
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkPublicInbound
|
|
3
|
+
} from "./chunk-2IPXQFJE.js";
|
|
4
|
+
import {
|
|
5
|
+
logger
|
|
6
|
+
} from "./chunk-ZB43YMHW.js";
|
|
7
|
+
import "./chunk-NQ7IQ5XT.js";
|
|
8
|
+
import "./chunk-77V75A7O.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/public-inbound-radar.ts
|
|
11
|
+
import { defineCommand } from "citty";
|
|
12
|
+
var publicInboundRadarCommand = defineCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: "public-inbound-radar",
|
|
15
|
+
description: "Factory-only: list open public issues/PRs on agent-kit-startup/agent-kit (read-only JSON)."
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
cwd: {
|
|
19
|
+
type: "string",
|
|
20
|
+
default: process.cwd()
|
|
21
|
+
},
|
|
22
|
+
json: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
description: "Print machine-readable JSON (default true for scripting)",
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
offline: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
description: "Skip GitHub fetch; fail-open skipped-offline",
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
"respect-prefs": {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: "Honor publicInboundCheck.enabled and intervalDays from .cursor/context/config.json",
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
stamp: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
description: "Persist publicInboundCheck.lastCheckedAt after an ok check",
|
|
40
|
+
default: false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
async run({ args }) {
|
|
44
|
+
const result = await checkPublicInbound(args.cwd, {
|
|
45
|
+
offline: Boolean(args.offline),
|
|
46
|
+
respectPrefs: Boolean(args["respect-prefs"]),
|
|
47
|
+
stamp: Boolean(args.stamp)
|
|
48
|
+
});
|
|
49
|
+
if (args.json) {
|
|
50
|
+
console.log(JSON.stringify(result, null, 2));
|
|
51
|
+
} else {
|
|
52
|
+
const line = `[${result.status}] ${result.message}`;
|
|
53
|
+
if (result.status === "error") logger.error(line);
|
|
54
|
+
else if (result.status.startsWith("skipped-")) logger.warn(line);
|
|
55
|
+
else logger.info(line);
|
|
56
|
+
for (const item of result.items.slice(0, 20)) {
|
|
57
|
+
logger.info(`- ${item.class} ${item.cite}: ${item.title} (@${item.author})`);
|
|
58
|
+
}
|
|
59
|
+
if (result.items.length > 20) {
|
|
60
|
+
logger.info(`\u2026 and ${result.items.length - 20} more (use --json)`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (result.status === "error") process.exitCode = 2;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
export {
|
|
67
|
+
publicInboundRadarCommand
|
|
68
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readRemoteIssues
|
|
3
|
+
} from "./chunk-VY7MTPJ2.js";
|
|
4
|
+
import "./chunk-2IPXQFJE.js";
|
|
5
|
+
import {
|
|
6
|
+
logger
|
|
7
|
+
} from "./chunk-ZB43YMHW.js";
|
|
8
|
+
import "./chunk-NQ7IQ5XT.js";
|
|
9
|
+
import "./chunk-77V75A7O.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/remote-issues.ts
|
|
12
|
+
import { defineCommand } from "citty";
|
|
13
|
+
var remoteIssuesCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "remote-issues",
|
|
16
|
+
description: "Read-only: list remote dogfood issues (provenance label or [Dogfood] title) for the current lane, GitHub or GitLab (JSON)."
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
cwd: {
|
|
20
|
+
type: "string",
|
|
21
|
+
default: process.cwd()
|
|
22
|
+
},
|
|
23
|
+
json: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
description: "Print machine-readable JSON (default true for scripting)",
|
|
26
|
+
default: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
async run({ args }) {
|
|
30
|
+
const result = await readRemoteIssues(args.cwd);
|
|
31
|
+
if (args.json) {
|
|
32
|
+
console.log(JSON.stringify(result, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
logger.info(`[${result.lane}] ${result.items.length} remote dogfood issue(s)`);
|
|
36
|
+
for (const item of result.items) {
|
|
37
|
+
logger.info(`- ${item.cite}: ${item.title} (${item.url})`);
|
|
38
|
+
}
|
|
39
|
+
for (const note of result.notes) logger.warn(note.message);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
remoteIssuesCommand
|
|
44
|
+
};
|