@dadado/agent-kit-cli 5.17.0 → 5.18.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 +10 -1
- package/dashboard/dashboard-data.mjs +12 -2
- package/dashboard/dashboard.html +58 -0
- package/dashboard/lib/run-logs.d.mts +34 -0
- package/dashboard/lib/run-logs.mjs +218 -0
- package/dist/{add-HTYIFKMN.js → add-KQJE3ZTG.js} +3 -3
- package/dist/{chunk-KD2MYBB6.js → chunk-3J3I2W22.js} +1 -1
- package/dist/{chunk-2RDRMGD3.js → chunk-6FXQINND.js} +2 -2
- package/dist/{chunk-OUQZC744.js → chunk-B5CH47OS.js} +852 -74
- package/dist/chunk-C26I6HTO.js +39 -0
- package/dist/{chunk-N3HTJVBR.js → chunk-GSCXFJB7.js} +1 -1
- package/dist/{chunk-STGFBAYT.js → chunk-HRILMD5N.js} +7 -15
- package/dist/{chunk-B73KQ5KX.js → chunk-KIXK7KOW.js} +7 -7
- package/dist/{chunk-S6GMFDKV.js → chunk-P6PMKYWU.js} +1 -1
- package/dist/{chunk-WW3YZKHW.js → chunk-RZ5TNBHU.js} +25 -4
- package/dist/{chunk-TFZ2JUXH.js → chunk-TOWH3XCJ.js} +520 -70
- package/dist/{chunk-W24CMQ32.js → chunk-TZYKLR5J.js} +1 -1
- package/dist/{chunk-DQA434Y4.js → chunk-UEKWZ7BN.js} +2 -2
- package/dist/chunk-WGLPZXNU.js +45 -0
- package/dist/{chunk-AW74INUW.js → chunk-WSJ77EHO.js} +1 -1
- package/dist/{chunk-F4VMYR7U.js → chunk-YJMZ6UM2.js} +2 -2
- package/dist/{chunk-SMGFN3Z4.js → chunk-YMYLO5LG.js} +2 -2
- package/dist/{chunk-PNG7LO2F.js → chunk-ZDCEAGD4.js} +1 -1
- package/dist/{contribute-C6AW2P6J.js → contribute-LFT762Y4.js} +4 -4
- package/dist/{diff-VHNR62SI.js → diff-56KMRCER.js} +5 -5
- package/dist/{doctor-PET2HRRJ.js → doctor-AA64XVEY.js} +9 -8
- package/dist/{handoff-3UI6VKVG.js → handoff-34SDU4FF.js} +2 -2
- package/dist/{hook-DYIMKJYL.js → hook-KRIXBLNW.js} +7 -7
- package/dist/index.js +19 -17
- package/dist/{init-Q4LBM6KT.js → init-XP5EAUSJ.js} +12 -11
- package/dist/{install-RHOS3OYZ.js → install-SHDEX54F.js} +12 -11
- package/dist/{plan-index-JMC7Z4DW.js → plan-index-O3545OA7.js} +2 -2
- package/dist/{run-I3BFGULT.js → run-FADX6QCP.js} +6 -5
- package/dist/{run-plan-FO7CL4M3.js → run-plan-MO4IFAKV.js} +36 -5
- package/dist/{setup-global-M42GEODI.js → setup-global-CBWLXOQG.js} +6 -6
- package/dist/{status-XPVQVQMX.js → status-BSIXWZMY.js} +7 -7
- package/dist/{update-FJ2EBZVO.js → update-FJX3DA6X.js} +9 -9
- package/package.json +1 -1
- package/dist/chunk-5VCOWTTP.js +0 -6
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/utils/kit-paths.ts
|
|
2
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
3
|
+
import path from "path";
|
|
4
|
+
var HANDOFF_REL = ".cursor/HANDOFF.md";
|
|
5
|
+
var STATE_ROOT_ENV = "AGENT_KIT_STATE_ROOT";
|
|
6
|
+
var STATE_ROOT_DIRS = [".cursor", ".agent-kit"];
|
|
7
|
+
function resolveStateDir(env = process.env) {
|
|
8
|
+
const raw = (env[STATE_ROOT_ENV] ?? "").trim().replace(/\/+$/, "");
|
|
9
|
+
if (!raw) return { stateDir: ".cursor" };
|
|
10
|
+
if (STATE_ROOT_DIRS.includes(raw))
|
|
11
|
+
return { stateDir: raw };
|
|
12
|
+
return { stateDir: ".cursor", invalid: raw };
|
|
13
|
+
}
|
|
14
|
+
function runnerStatePaths(root, env = process.env) {
|
|
15
|
+
const { stateDir, invalid } = resolveStateDir(env);
|
|
16
|
+
const base = path.join(root, stateDir);
|
|
17
|
+
return {
|
|
18
|
+
stateDir,
|
|
19
|
+
loopLogsDir: path.join(base, "loop-logs"),
|
|
20
|
+
stopFile: path.join(base, "loop.stop"),
|
|
21
|
+
...invalid !== void 0 ? { invalid } : {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async function ensureLoopLogsDir(paths) {
|
|
25
|
+
await mkdir(paths.loopLogsDir, { recursive: true });
|
|
26
|
+
if (paths.stateDir === ".cursor") return;
|
|
27
|
+
const ignore = path.join(paths.loopLogsDir, ".gitignore");
|
|
28
|
+
try {
|
|
29
|
+
await writeFile(ignore, "*\n", { flag: "wx" });
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
HANDOFF_REL,
|
|
36
|
+
STATE_ROOT_ENV,
|
|
37
|
+
runnerStatePaths,
|
|
38
|
+
ensureLoopLogsDir
|
|
39
|
+
};
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
RESOLVE_AGENT_KIT_REL,
|
|
6
6
|
SESSION_START_HOOK_MARKER,
|
|
7
7
|
discoverInstalledCommands
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TZYKLR5J.js";
|
|
9
|
+
import {
|
|
10
|
+
findOnPath
|
|
11
|
+
} from "./chunk-WGLPZXNU.js";
|
|
9
12
|
import {
|
|
10
13
|
createReadinessReport
|
|
11
14
|
} from "./chunk-PNFF6OU3.js";
|
|
@@ -66,13 +69,7 @@ async function resolveAgentKitCli(rootDir) {
|
|
|
66
69
|
for (const c of candidates) {
|
|
67
70
|
if (await exists(c)) return c;
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
const { stdout } = await execFileAsync("which", ["agent-kit"], { encoding: "utf8" });
|
|
71
|
-
const hit = stdout.trim().split("\n")[0]?.trim();
|
|
72
|
-
if (hit) return hit;
|
|
73
|
-
} catch {
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
72
|
+
return findOnPath("agent-kit");
|
|
76
73
|
}
|
|
77
74
|
function commandLooksLikeAdapter(command) {
|
|
78
75
|
const trimmed = command.trim();
|
|
@@ -176,13 +173,8 @@ async function resolveGuardProbeArgv(root) {
|
|
|
176
173
|
if (await isExecutable(local)) return [local];
|
|
177
174
|
const dist = path.join(root, "packages", "cli", "dist", "index.js");
|
|
178
175
|
if (await exists(dist)) return [process.execPath, dist];
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const hit = stdout.trim().split("\n")[0]?.trim();
|
|
182
|
-
if (hit) return [hit];
|
|
183
|
-
} catch {
|
|
184
|
-
}
|
|
185
|
-
return null;
|
|
176
|
+
const hit = await findOnPath("agent-kit");
|
|
177
|
+
return hit ? [hit] : null;
|
|
186
178
|
}
|
|
187
179
|
async function assessClaudeGuardProbe(rootDir) {
|
|
188
180
|
const root = path.resolve(rootDir);
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
NON_INTERACTIVE_ROOT_ARGS,
|
|
3
3
|
installL0,
|
|
4
4
|
syncFromManifest
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UEKWZ7BN.js";
|
|
6
6
|
import {
|
|
7
7
|
SkippedSymlinkError,
|
|
8
8
|
formatPersonalizationSkippedSymlinks,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
REGISTRY_CLI_ARGS,
|
|
13
13
|
resolveRegistryFromCli
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZDCEAGD4.js";
|
|
15
15
|
import {
|
|
16
16
|
assessClaudeCommandAdapters,
|
|
17
17
|
executeSafeReadinessFixes
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HRILMD5N.js";
|
|
19
19
|
import {
|
|
20
20
|
writeReadinessSnapshot
|
|
21
21
|
} from "./chunk-ZXKZBTXE.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
CLAUDE_HITL_FALLBACK,
|
|
24
24
|
generateClaudeCommandAdapters,
|
|
25
25
|
writeClaudeSessionStartHook
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-TZYKLR5J.js";
|
|
27
27
|
import {
|
|
28
28
|
shouldUseWelcomeColor,
|
|
29
29
|
withCliProgress
|
|
@@ -50,13 +50,13 @@ import {
|
|
|
50
50
|
npxPinned,
|
|
51
51
|
pathCliStatus,
|
|
52
52
|
syncPathCliToRuntime
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-YJMZ6UM2.js";
|
|
54
54
|
import {
|
|
55
55
|
assessEnvironment
|
|
56
56
|
} from "./chunk-4IWG5CVE.js";
|
|
57
57
|
import {
|
|
58
58
|
warnIfRunningCliBehindNpm
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-YMYLO5LG.js";
|
|
60
60
|
import {
|
|
61
61
|
DOMAIN_PACK_IDS,
|
|
62
62
|
allPacks,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
resolveProtectedGlobs,
|
|
74
74
|
saveManifest,
|
|
75
75
|
skillTargetDir
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-WSJ77EHO.js";
|
|
77
77
|
import {
|
|
78
78
|
KIT_VERSION,
|
|
79
79
|
pinnedCliSpec
|
|
@@ -5,17 +5,23 @@ import {
|
|
|
5
5
|
claudeHeadlessArgs,
|
|
6
6
|
claudeRedactions,
|
|
7
7
|
claudeRunCaps,
|
|
8
|
+
codexBackend,
|
|
9
|
+
cursorAcpBackend,
|
|
8
10
|
cursorAgentHeadlessArgs,
|
|
9
11
|
redactSecrets,
|
|
10
12
|
resolveHitlRunOptions,
|
|
11
13
|
spawnLogged
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-B5CH47OS.js";
|
|
15
|
+
import {
|
|
16
|
+
ensureLoopLogsDir,
|
|
17
|
+
runnerStatePaths
|
|
18
|
+
} from "./chunk-C26I6HTO.js";
|
|
13
19
|
import {
|
|
14
20
|
fileExists
|
|
15
21
|
} from "./chunk-77V75A7O.js";
|
|
16
22
|
|
|
17
23
|
// src/plan-loop/dispatch.ts
|
|
18
|
-
import {
|
|
24
|
+
import { readFile } from "fs/promises";
|
|
19
25
|
import path from "path";
|
|
20
26
|
var RUN_CATALOG = [
|
|
21
27
|
"run-plan",
|
|
@@ -99,6 +105,20 @@ function claudeDispatchArgs(opts = {}) {
|
|
|
99
105
|
return claudeHeadlessArgs(opts);
|
|
100
106
|
}
|
|
101
107
|
async function runHeadlessDispatch(opts) {
|
|
108
|
+
if (opts.backendId === "codex" || opts.backendId === "cursor-acp") {
|
|
109
|
+
const backend = opts.backendId === "codex" ? codexBackend : cursorAcpBackend;
|
|
110
|
+
return backend.run({
|
|
111
|
+
workspace: opts.workspace,
|
|
112
|
+
prompt: opts.prompt,
|
|
113
|
+
model: opts.model,
|
|
114
|
+
logPath: opts.logPath,
|
|
115
|
+
spawnFn: opts.spawnFn,
|
|
116
|
+
log: opts.log,
|
|
117
|
+
hitl: opts.hitl,
|
|
118
|
+
render: opts.render,
|
|
119
|
+
onSpawn: opts.onSpawn
|
|
120
|
+
});
|
|
121
|
+
}
|
|
102
122
|
if (opts.backendId === "claude") {
|
|
103
123
|
const log = opts.log ?? ((line) => console.log(line));
|
|
104
124
|
const env = claudeChildEnv();
|
|
@@ -147,8 +167,9 @@ async function runHeadlessDispatch(opts) {
|
|
|
147
167
|
});
|
|
148
168
|
}
|
|
149
169
|
async function ensureDispatchLogPath(root) {
|
|
150
|
-
const
|
|
151
|
-
await
|
|
170
|
+
const paths = runnerStatePaths(root);
|
|
171
|
+
await ensureLoopLogsDir(paths);
|
|
172
|
+
const logDir = paths.loopLogsDir;
|
|
152
173
|
return path.join(logDir, `run-${stamp()}.log`);
|
|
153
174
|
}
|
|
154
175
|
|