zelio-cli 0.0.0-stage → 0.1.0-beta.3
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/README.md +185 -2
- package/dist/attachments.js +121 -0
- package/dist/attachments.js.map +1 -0
- package/dist/cli.js +496 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/board.js +311 -0
- package/dist/cloud/board.js.map +1 -0
- package/dist/cloud/command.js +281 -0
- package/dist/cloud/command.js.map +1 -0
- package/dist/cloud/config.js +132 -0
- package/dist/cloud/config.js.map +1 -0
- package/dist/cloud/credentials.js +134 -0
- package/dist/cloud/credentials.js.map +1 -0
- package/dist/cloud/login.js +165 -0
- package/dist/cloud/login.js.map +1 -0
- package/dist/cloud/pair.js +110 -0
- package/dist/cloud/pair.js.map +1 -0
- package/dist/cloud/pkce.js +16 -0
- package/dist/cloud/pkce.js.map +1 -0
- package/dist/cloud/push-nudge.js +65 -0
- package/dist/cloud/push-nudge.js.map +1 -0
- package/dist/cloud/relay.js +134 -0
- package/dist/cloud/relay.js.map +1 -0
- package/dist/cloud/token.js +66 -0
- package/dist/cloud/token.js.map +1 -0
- package/dist/cloud/tunnel.js +474 -0
- package/dist/cloud/tunnel.js.map +1 -0
- package/dist/db/db.js +1741 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/lifecycle.js +146 -0
- package/dist/db/lifecycle.js.map +1 -0
- package/dist/limits.js +35 -0
- package/dist/limits.js.map +1 -0
- package/dist/metrics.js +30 -0
- package/dist/metrics.js.map +1 -0
- package/dist/orchestrator/claude-session.js +208 -0
- package/dist/orchestrator/claude-session.js.map +1 -0
- package/dist/orchestrator/codex-session.js +326 -0
- package/dist/orchestrator/codex-session.js.map +1 -0
- package/dist/orchestrator/contract.js +184 -0
- package/dist/orchestrator/contract.js.map +1 -0
- package/dist/orchestrator/explore.js +176 -0
- package/dist/orchestrator/explore.js.map +1 -0
- package/dist/orchestrator/new-task-prompt.js +51 -0
- package/dist/orchestrator/new-task-prompt.js.map +1 -0
- package/dist/orchestrator/pi-session.js +228 -0
- package/dist/orchestrator/pi-session.js.map +1 -0
- package/dist/orchestrator/prompt.js +110 -0
- package/dist/orchestrator/prompt.js.map +1 -0
- package/dist/orchestrator/research.js +178 -0
- package/dist/orchestrator/research.js.map +1 -0
- package/dist/orchestrator/runtime.js +1207 -0
- package/dist/orchestrator/runtime.js.map +1 -0
- package/dist/orchestrator/session.js +2 -0
- package/dist/orchestrator/session.js.map +1 -0
- package/dist/orchestrator/types.js +2 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/web.js +276 -0
- package/dist/orchestrator/web.js.map +1 -0
- package/dist/repo/index.js +188 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/instructions.js +58 -0
- package/dist/repo/instructions.js.map +1 -0
- package/dist/repo/linked-boards.js +137 -0
- package/dist/repo/linked-boards.js.map +1 -0
- package/dist/repo/project-repos.js +78 -0
- package/dist/repo/project-repos.js.map +1 -0
- package/dist/run/actions.js +257 -0
- package/dist/run/actions.js.map +1 -0
- package/dist/run/auto-review.js +102 -0
- package/dist/run/auto-review.js.map +1 -0
- package/dist/run/bash-guard.js +183 -0
- package/dist/run/bash-guard.js.map +1 -0
- package/dist/run/claude-runtime.js +270 -0
- package/dist/run/claude-runtime.js.map +1 -0
- package/dist/run/claude-stream.js +306 -0
- package/dist/run/claude-stream.js.map +1 -0
- package/dist/run/codex-client.js +202 -0
- package/dist/run/codex-client.js.map +1 -0
- package/dist/run/codex-runtime.js +460 -0
- package/dist/run/codex-runtime.js.map +1 -0
- package/dist/run/consult.js +105 -0
- package/dist/run/consult.js.map +1 -0
- package/dist/run/context.js +87 -0
- package/dist/run/context.js.map +1 -0
- package/dist/run/diff.js +238 -0
- package/dist/run/diff.js.map +1 -0
- package/dist/run/evidence.js +48 -0
- package/dist/run/evidence.js.map +1 -0
- package/dist/run/finish.js +408 -0
- package/dist/run/finish.js.map +1 -0
- package/dist/run/handoff.js +51 -0
- package/dist/run/handoff.js.map +1 -0
- package/dist/run/harness-runtime.js +31 -0
- package/dist/run/harness-runtime.js.map +1 -0
- package/dist/run/harnesses.js +273 -0
- package/dist/run/harnesses.js.map +1 -0
- package/dist/run/issue.js +79 -0
- package/dist/run/issue.js.map +1 -0
- package/dist/run/keep-awake.js +58 -0
- package/dist/run/keep-awake.js.map +1 -0
- package/dist/run/lead.js +159 -0
- package/dist/run/lead.js.map +1 -0
- package/dist/run/manager.js +2546 -0
- package/dist/run/manager.js.map +1 -0
- package/dist/run/mentions.js +35 -0
- package/dist/run/mentions.js.map +1 -0
- package/dist/run/merge-watch.js +425 -0
- package/dist/run/merge-watch.js.map +1 -0
- package/dist/run/models.js +88 -0
- package/dist/run/models.js.map +1 -0
- package/dist/run/phases.js +23 -0
- package/dist/run/phases.js.map +1 -0
- package/dist/run/pi-rpc.js +439 -0
- package/dist/run/pi-rpc.js.map +1 -0
- package/dist/run/piped-check.js +56 -0
- package/dist/run/piped-check.js.map +1 -0
- package/dist/run/pr-checks.js +67 -0
- package/dist/run/pr-checks.js.map +1 -0
- package/dist/run/pr-merge.js +121 -0
- package/dist/run/pr-merge.js.map +1 -0
- package/dist/run/profiles.js +43 -0
- package/dist/run/profiles.js.map +1 -0
- package/dist/run/prompt.js +388 -0
- package/dist/run/prompt.js.map +1 -0
- package/dist/run/pull-request.js +23 -0
- package/dist/run/pull-request.js.map +1 -0
- package/dist/run/red-check.js +130 -0
- package/dist/run/red-check.js.map +1 -0
- package/dist/run/result-tool.js +93 -0
- package/dist/run/result-tool.js.map +1 -0
- package/dist/run/result.js +113 -0
- package/dist/run/result.js.map +1 -0
- package/dist/run/retro.js +346 -0
- package/dist/run/retro.js.map +1 -0
- package/dist/run/settings.js +27 -0
- package/dist/run/settings.js.map +1 -0
- package/dist/run/skills.js +146 -0
- package/dist/run/skills.js.map +1 -0
- package/dist/run/tests-first.js +146 -0
- package/dist/run/tests-first.js.map +1 -0
- package/dist/run/thinking.js +41 -0
- package/dist/run/thinking.js.map +1 -0
- package/dist/run/types.js +2 -0
- package/dist/run/types.js.map +1 -0
- package/dist/run/watchdog.js +259 -0
- package/dist/run/watchdog.js.map +1 -0
- package/dist/run/workflow.js +277 -0
- package/dist/run/workflow.js.map +1 -0
- package/dist/run/worktree.js +354 -0
- package/dist/run/worktree.js.map +1 -0
- package/dist/server/app.js +2946 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/auth.js +93 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/demo.js +96 -0
- package/dist/server/demo.js.map +1 -0
- package/dist/server/idempotency.js +104 -0
- package/dist/server/idempotency.js.map +1 -0
- package/dist/server/port.js +36 -0
- package/dist/server/port.js.map +1 -0
- package/dist/server/principal.js +93 -0
- package/dist/server/principal.js.map +1 -0
- package/dist/server/repo-picker.js +18 -0
- package/dist/server/repo-picker.js.map +1 -0
- package/dist/server/terminal.js +285 -0
- package/dist/server/terminal.js.map +1 -0
- package/dist/setup/components.js +98 -0
- package/dist/setup/components.js.map +1 -0
- package/dist/setup/config.js +102 -0
- package/dist/setup/config.js.map +1 -0
- package/dist/setup/ink-ui.js +189 -0
- package/dist/setup/ink-ui.js.map +1 -0
- package/dist/setup/onboarding.js +167 -0
- package/dist/setup/onboarding.js.map +1 -0
- package/dist/setup/run.js +70 -0
- package/dist/setup/run.js.map +1 -0
- package/dist/skills.js +151 -0
- package/dist/skills.js.map +1 -0
- package/dist/ticket-cli.js +157 -0
- package/dist/ticket-cli.js.map +1 -0
- package/dist/version.js +13 -0
- package/dist/version.js.map +1 -0
- package/dist/voice/index.js +69 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/moonshine.js +247 -0
- package/dist/voice/moonshine.js.map +1 -0
- package/dist/voice/wav.js +54 -0
- package/dist/voice/wav.js.map +1 -0
- package/dist/voice/whisper.js +491 -0
- package/dist/voice/whisper.js.map +1 -0
- package/dist/web/assets/index-CCQMrUIF.js +255 -0
- package/dist/web/assets/index-lzGSgTRQ.css +1 -0
- package/dist/web/icons/apple-touch-icon.png +0 -0
- package/dist/web/icons/icon-192.png +0 -0
- package/dist/web/icons/icon-512.png +0 -0
- package/dist/web/icons/maskable-512.png +0 -0
- package/dist/web/index.html +21 -0
- package/dist/web/manifest.webmanifest +30 -0
- package/dist/web/sw.js +185 -0
- package/package.json +96 -4
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* The files a repository uses to tell an agent how to work in it. Both are read
|
|
5
|
+
* because both are common: `AGENTS.md` is the cross-harness convention, and
|
|
6
|
+
* `CLAUDE.md` is the same idea from the other toolchain. A repo that has both
|
|
7
|
+
* gets both, in this order.
|
|
8
|
+
*/
|
|
9
|
+
export const REPO_INSTRUCTION_FILES = ["AGENTS.md", "CLAUDE.md"];
|
|
10
|
+
/**
|
|
11
|
+
* The budget for the whole section. These files are written by hand for a
|
|
12
|
+
* human, so a long one is not an error — but a prompt is not a place to paste
|
|
13
|
+
* ten pages, and the run can always read the file itself. Sized to fit this
|
|
14
|
+
* repo's own AGENTS.md whole, so the file that governs the board is never the
|
|
15
|
+
* one that gets cut.
|
|
16
|
+
*/
|
|
17
|
+
export const MAX_INSTRUCTION_CHARS = 6_000;
|
|
18
|
+
/**
|
|
19
|
+
* Read the repository's own workflow docs. A missing or empty file is normal,
|
|
20
|
+
* so nothing here throws: an unreadable file is treated as absent, and a board
|
|
21
|
+
* pointed at a directory that is not a repo still boots.
|
|
22
|
+
*
|
|
23
|
+
* Synchronous on purpose: this runs once when a run starts, two small files,
|
|
24
|
+
* and a run's start path is not somewhere to introduce another await point.
|
|
25
|
+
*/
|
|
26
|
+
export function readRepoInstructions(root, budget = MAX_INSTRUCTION_CHARS, harnessLoads = []) {
|
|
27
|
+
const parts = [];
|
|
28
|
+
const files = [];
|
|
29
|
+
const loadedByHarness = [];
|
|
30
|
+
for (const name of REPO_INSTRUCTION_FILES) {
|
|
31
|
+
let body;
|
|
32
|
+
try {
|
|
33
|
+
body = readFileSync(join(root, name), "utf8");
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (!body.trim())
|
|
39
|
+
continue;
|
|
40
|
+
if (harnessLoads.includes(name)) {
|
|
41
|
+
loadedByHarness.push(name);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
files.push(name);
|
|
45
|
+
parts.push(`### ${name}\n\n${body.trim()}`);
|
|
46
|
+
}
|
|
47
|
+
const loaded = loadedByHarness.length > 0 ? { loadedByHarness } : {};
|
|
48
|
+
if (parts.length === 0)
|
|
49
|
+
return { files: [], text: "", ...loaded };
|
|
50
|
+
let text = parts.join("\n\n");
|
|
51
|
+
if (text.length > budget) {
|
|
52
|
+
// Cut on a line boundary so the tail cannot end mid-instruction.
|
|
53
|
+
const cut = text.lastIndexOf("\n", budget);
|
|
54
|
+
text = `${text.slice(0, cut > 0 ? cut : budget)}\n\n[truncated here: the file is longer. Read ${files.join(" or ")} in the repository for the rest.]`;
|
|
55
|
+
}
|
|
56
|
+
return { files, text, ...loaded };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/repo/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAU,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAc3C;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,MAAM,GAAG,qBAAqB,EAC9B,YAAY,GAAsB,EAAE;IAEpC,MAAM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AC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,iDAAiD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,mCAAmC,CAAC;IACxJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The machine's registry of Zelio boards, and one line about a repository.
|
|
3
|
+
*
|
|
4
|
+
* Every board writes itself into `~/.zelio/boards.json` (or
|
|
5
|
+
* `$ZELIO_HOME/boards.json`) when it starts listening, and removes its own row
|
|
6
|
+
* when it closes. A repository attached to a board as a project repo is refused
|
|
7
|
+
* while its own board runs there (see project-repos.ts): two boards must never
|
|
8
|
+
* drive the same checkout.
|
|
9
|
+
*/
|
|
10
|
+
import { mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { dirname, join, resolve } from "node:path";
|
|
13
|
+
const MAX_DESCRIPTION_CHARS = 200;
|
|
14
|
+
export function defaultRegistryFile() {
|
|
15
|
+
const home = process.env.ZELIO_HOME?.trim() || join(homedir(), ".zelio");
|
|
16
|
+
return join(home, "boards.json");
|
|
17
|
+
}
|
|
18
|
+
function canonical(root) {
|
|
19
|
+
try {
|
|
20
|
+
return realpathSync(resolve(root));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return resolve(root);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function readRegistry(file) {
|
|
27
|
+
let raw;
|
|
28
|
+
try {
|
|
29
|
+
raw = JSON.parse(readFileSync(file, "utf8"));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const boards = raw?.boards;
|
|
35
|
+
if (!Array.isArray(boards))
|
|
36
|
+
return [];
|
|
37
|
+
const entries = [];
|
|
38
|
+
for (const item of boards) {
|
|
39
|
+
if (!item || typeof item !== "object")
|
|
40
|
+
continue;
|
|
41
|
+
const entry = item;
|
|
42
|
+
if (typeof entry.root !== "string" || !entry.root)
|
|
43
|
+
continue;
|
|
44
|
+
if (!Number.isInteger(entry.port) || !Number.isInteger(entry.pid))
|
|
45
|
+
continue;
|
|
46
|
+
entries.push({
|
|
47
|
+
root: entry.root,
|
|
48
|
+
port: entry.port,
|
|
49
|
+
pid: entry.pid,
|
|
50
|
+
updatedAt: typeof entry.updatedAt === "string" ? entry.updatedAt : "",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return entries;
|
|
54
|
+
}
|
|
55
|
+
function writeRegistry(file, entries) {
|
|
56
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
57
|
+
// Two boards starting together must not leave half a file for a third to read.
|
|
58
|
+
const temporary = `${file}.${process.pid}.tmp`;
|
|
59
|
+
writeFileSync(temporary, `${JSON.stringify({ boards: entries }, null, 2)}\n`, { mode: 0o600 });
|
|
60
|
+
renameSync(temporary, file);
|
|
61
|
+
}
|
|
62
|
+
/** Upserts this board by its repository root. Never throws: a board runs without it. */
|
|
63
|
+
export function registerBoard(file, board) {
|
|
64
|
+
try {
|
|
65
|
+
const root = canonical(board.root);
|
|
66
|
+
const others = readRegistry(file).filter((entry) => canonical(entry.root) !== root);
|
|
67
|
+
writeRegistry(file, [
|
|
68
|
+
...others,
|
|
69
|
+
{ root, port: board.port, pid: board.pid, updatedAt: new Date().toISOString() },
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Linking is a convenience; an unwritable home directory is not a failed start.
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Forgets this board when it closes. Only its own row: another process that
|
|
78
|
+
* has since registered the same repository keeps its entry.
|
|
79
|
+
*/
|
|
80
|
+
export function unregisterBoard(file, board) {
|
|
81
|
+
try {
|
|
82
|
+
const root = canonical(board.root);
|
|
83
|
+
const entries = readRegistry(file);
|
|
84
|
+
const kept = entries.filter((entry) => !(canonical(entry.root) === root && entry.pid === board.pid));
|
|
85
|
+
if (kept.length !== entries.length)
|
|
86
|
+
writeRegistry(file, kept);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Same as registering: never the reason a board fails to close.
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export function processAlive(pid) {
|
|
93
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
94
|
+
return false;
|
|
95
|
+
try {
|
|
96
|
+
process.kill(pid, 0);
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
// EPERM: the process exists and belongs to someone else.
|
|
101
|
+
return error.code === "EPERM";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function clipLine(text) {
|
|
105
|
+
const line = text.replace(/\s+/g, " ").trim();
|
|
106
|
+
return line.length > MAX_DESCRIPTION_CHARS
|
|
107
|
+
? `${line.slice(0, MAX_DESCRIPTION_CHARS - 1)}…`
|
|
108
|
+
: line;
|
|
109
|
+
}
|
|
110
|
+
/** One line about a repository: its package description, else its README's first sentence. */
|
|
111
|
+
export function describeRepo(root) {
|
|
112
|
+
try {
|
|
113
|
+
const manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
114
|
+
if (typeof manifest.description === "string" && manifest.description.trim()) {
|
|
115
|
+
return clipLine(manifest.description);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// No manifest, or not JSON: try the README.
|
|
120
|
+
}
|
|
121
|
+
for (const name of ["README.md", "readme.md", "README"]) {
|
|
122
|
+
try {
|
|
123
|
+
const lines = readFileSync(join(root, name), "utf8").split("\n");
|
|
124
|
+
const prose = lines.find((line) => {
|
|
125
|
+
const trimmed = line.trim();
|
|
126
|
+
return trimmed && !/^(#|!\[|\[!|<|```|---|===)/.test(trimmed);
|
|
127
|
+
});
|
|
128
|
+
if (prose)
|
|
129
|
+
return clipLine(prose);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// Next candidate.
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=linked-boards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linked-boards.js","sourceRoot":"","sources":["../../src/repo/linked-boards.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBnD,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,UAAU,mBAAmB;IACjC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IACzE,OAAO,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAAI,GAAmC,EAAE,M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I,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACjE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC5B,OAAO,OAAO,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;YACH,IAAI,KAAK;gBAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git repositories attached to a board besides its home repo.
|
|
3
|
+
*
|
|
4
|
+
* A board covers the folder `zelio-cli` ran in. The person can attach more local
|
|
5
|
+
* repositories; each card then names the one it works in, and its worktree,
|
|
6
|
+
* branch, AGENTS.md and merge watching happen there. This file decides which
|
|
7
|
+
* folders may be attached. The refusals are about correctness: a folder that is
|
|
8
|
+
* not a repository's top level, the home repo itself, a second board's repo, or
|
|
9
|
+
* a name that would make two repos indistinguishable on the board.
|
|
10
|
+
*/
|
|
11
|
+
import { execFile } from "node:child_process";
|
|
12
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
13
|
+
import { basename, isAbsolute, resolve } from "node:path";
|
|
14
|
+
import { promisify } from "node:util";
|
|
15
|
+
import { defaultRegistryFile, processAlive, readRegistry } from "./linked-boards.js";
|
|
16
|
+
const execFileAsync = promisify(execFile);
|
|
17
|
+
/** A refusal the person can read. `status` is the HTTP status the route answers with. */
|
|
18
|
+
export class ProjectRepoError extends Error {
|
|
19
|
+
status;
|
|
20
|
+
constructor(message, status) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.status = status;
|
|
23
|
+
this.name = "ProjectRepoError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function canonical(path) {
|
|
27
|
+
try {
|
|
28
|
+
return realpathSync(resolve(path));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return resolve(path);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Checks a folder the person typed and returns the name and canonical root it
|
|
36
|
+
* would be attached under. Nothing is written: the caller stores the result.
|
|
37
|
+
*/
|
|
38
|
+
export async function validateRepoFolder(input, opts) {
|
|
39
|
+
const typed = typeof input === "string" ? input.trim() : "";
|
|
40
|
+
if (!typed)
|
|
41
|
+
throw new ProjectRepoError("Enter the folder of a git repository.", 400);
|
|
42
|
+
if (!isAbsolute(typed))
|
|
43
|
+
throw new ProjectRepoError("Use the full path to the folder.", 400);
|
|
44
|
+
if (!existsSync(typed))
|
|
45
|
+
throw new ProjectRepoError(`${typed} does not exist.`, 400);
|
|
46
|
+
const root = canonical(typed);
|
|
47
|
+
let topLevel;
|
|
48
|
+
try {
|
|
49
|
+
const { stdout } = await execFileAsync("git", ["-C", root, "rev-parse", "--show-toplevel"]);
|
|
50
|
+
topLevel = canonical(stdout.trim());
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new ProjectRepoError(`${root} is not a git repository.`, 400);
|
|
54
|
+
}
|
|
55
|
+
if (topLevel !== root) {
|
|
56
|
+
throw new ProjectRepoError(`${root} is inside a git repository, not at its top level. Add ${topLevel} instead.`, 400);
|
|
57
|
+
}
|
|
58
|
+
const home = canonical(opts.home);
|
|
59
|
+
if (root === home)
|
|
60
|
+
throw new ProjectRepoError("That is this board's own repository.", 409);
|
|
61
|
+
if (opts.existing.some((repo) => canonical(repo.root) === root)) {
|
|
62
|
+
throw new ProjectRepoError(`${root} is already attached to this board.`, 409);
|
|
63
|
+
}
|
|
64
|
+
const name = basename(root);
|
|
65
|
+
if (name === basename(home)) {
|
|
66
|
+
throw new ProjectRepoError(`A repository named ${name} is already this board's home. Rename the folder first.`, 409);
|
|
67
|
+
}
|
|
68
|
+
if (opts.existing.some((repo) => repo.name === name)) {
|
|
69
|
+
throw new ProjectRepoError(`A repository named ${name} is already attached.`, 409);
|
|
70
|
+
}
|
|
71
|
+
const registry = readRegistry(opts.registryFile ?? defaultRegistryFile());
|
|
72
|
+
const running = registry.find((entry) => canonical(entry.root) === root && processAlive(entry.pid));
|
|
73
|
+
if (running) {
|
|
74
|
+
throw new ProjectRepoError(`${root} has a Zelio board running right now. Stop that board before adding its repository here.`, 409);
|
|
75
|
+
}
|
|
76
|
+
return { name, root };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=project-repos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-repos.js","sourceRoot":"","sources":["../../src/repo/project-repos.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAErF,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,yFAAyF;AACzF,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAG9B,MAAM;IAFjB,YACE,OAAe,EACN,MAAiB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;sBAFN,MAAM;QAGf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CA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|
|
1
|
+
/**
|
|
2
|
+
* The activity trace both agents share. A run is a sequence of tool calls, and
|
|
3
|
+
* a row per call is the part a person can act on: what it touched, whether it
|
|
4
|
+
* worked, and what it said when it did not. Raw output is not a surface; it is
|
|
5
|
+
* evidence attached to the failed row that produced it.
|
|
6
|
+
*/
|
|
7
|
+
/** Bounded, because a turn that ran for ten minutes is not ten minutes of rows. */
|
|
8
|
+
export const MAX_ACTIONS = 12;
|
|
9
|
+
/** The tail of a failed call is enough to name the cause; the head is context. */
|
|
10
|
+
export const MAX_ACTION_OUTPUT = 1200;
|
|
11
|
+
/** A row names the tests that broke, not every assertion in the file. */
|
|
12
|
+
export const MAX_FAILED_TESTS = 5;
|
|
13
|
+
/** Enough of the failure body to see the assertion, not the whole stack. */
|
|
14
|
+
export const MAX_TEST_EXCERPT = 400;
|
|
15
|
+
/** Long paths and commands are clipped: a trace row is one line, not a paragraph. */
|
|
16
|
+
export const clip = (value, max) => {
|
|
17
|
+
const text = value.replace(/\s+/g, " ").trim();
|
|
18
|
+
return text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
19
|
+
};
|
|
20
|
+
/** Color codes are not part of a test's name. */
|
|
21
|
+
const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
|
|
22
|
+
/**
|
|
23
|
+
* Vitest names a failing test on a `FAIL` line (default reporter) or a `×` line
|
|
24
|
+
* (verbose one). Both carry the file and the test path; a tsc error carries
|
|
25
|
+
* neither, which is how a compiler failure stays a plain failed row.
|
|
26
|
+
*/
|
|
27
|
+
const FAILURE_LINE = /^\s*(?:FAIL|×|✗|✕)\s+(\S.*)$/;
|
|
28
|
+
const excerpt = (lines) => {
|
|
29
|
+
const body = lines.join("\n").trim();
|
|
30
|
+
return body.length > MAX_TEST_EXCERPT ? `${body.slice(0, MAX_TEST_EXCERPT - 1)}…` : body;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The tests a failed call named, in the order the reporter printed them. Only
|
|
34
|
+
* the harness's failed state reaches this function with output at all, so a
|
|
35
|
+
* `done` row full of failure-looking prose is never marked.
|
|
36
|
+
*/
|
|
37
|
+
export function failedTests(output) {
|
|
38
|
+
const body = output?.replace(ANSI, "").trim();
|
|
39
|
+
if (!body)
|
|
40
|
+
return [];
|
|
41
|
+
const lines = body.split(/\r?\n/);
|
|
42
|
+
const found = [];
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
45
|
+
const match = FAILURE_LINE.exec(lines[index] ?? "");
|
|
46
|
+
if (!match)
|
|
47
|
+
continue;
|
|
48
|
+
const name = clip((match[1] ?? "").replace(/\s+\d+(?:\.\d+)?m?s$/, ""), 160);
|
|
49
|
+
if (!name || seen.has(name))
|
|
50
|
+
continue;
|
|
51
|
+
const following = [];
|
|
52
|
+
for (let next = index + 1; next < lines.length; next += 1) {
|
|
53
|
+
const line = lines[next] ?? "";
|
|
54
|
+
if (FAILURE_LINE.test(line))
|
|
55
|
+
break;
|
|
56
|
+
// The body ends at the reporter's blank separator; the run summary that
|
|
57
|
+
// follows is not this test's excerpt.
|
|
58
|
+
if (!line.trim() && following.length > 0)
|
|
59
|
+
break;
|
|
60
|
+
following.push(line);
|
|
61
|
+
if (following.join("\n").length >= MAX_TEST_EXCERPT)
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
const detail = excerpt(following);
|
|
65
|
+
if (!detail)
|
|
66
|
+
continue;
|
|
67
|
+
seen.add(name);
|
|
68
|
+
found.push({ name, excerpt: detail });
|
|
69
|
+
if (found.length >= MAX_FAILED_TESTS)
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
return found;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A ticket command usually opens with `cd <worktree> &&` or `cd <worktree>;`.
|
|
76
|
+
* The worktree is already implied by the ticket, so drop it and keep the rest.
|
|
77
|
+
*/
|
|
78
|
+
export const stripWorktreeCd = (command) => command
|
|
79
|
+
.trim()
|
|
80
|
+
.replace(/^cd\s+(?:"[^"]*"|'[^']*'|[^\s;&|]+)\s*(?:&&|;)\s*/, "")
|
|
81
|
+
.trim();
|
|
82
|
+
const text = (args, ...keys) => {
|
|
83
|
+
const fields = (args ?? {});
|
|
84
|
+
for (const key of keys) {
|
|
85
|
+
if (typeof fields[key] === "string")
|
|
86
|
+
return fields[key];
|
|
87
|
+
}
|
|
88
|
+
return "";
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The tool's short name. An unknown tool keeps its own name, title-cased: the
|
|
92
|
+
* row still says what ran, and inventing a friendlier word would be a guess.
|
|
93
|
+
*/
|
|
94
|
+
export function actionName(tool) {
|
|
95
|
+
if (!tool)
|
|
96
|
+
return "Think";
|
|
97
|
+
const words = tool.replace(/[_-]+/g, " ").trim();
|
|
98
|
+
return words ? words.charAt(0).toUpperCase() + words.slice(1) : "Tool";
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* What the call touched, in the tool's own terms: the command for a shell, the
|
|
102
|
+
* path for a file, the query for a search. Empty when the harness gave nothing
|
|
103
|
+
* worth showing, and the row then falls back to its label.
|
|
104
|
+
*/
|
|
105
|
+
export function actionDetail(tool, args) {
|
|
106
|
+
switch (tool) {
|
|
107
|
+
case "read":
|
|
108
|
+
case "edit":
|
|
109
|
+
case "write":
|
|
110
|
+
return clip(text(args, "path", "file_path"), 120);
|
|
111
|
+
case "bash":
|
|
112
|
+
return clip(stripWorktreeCd(text(args, "command")), 160);
|
|
113
|
+
case "grep":
|
|
114
|
+
return clip(text(args, "pattern", "query"), 120);
|
|
115
|
+
case "find":
|
|
116
|
+
return clip(text(args, "pattern"), 120);
|
|
117
|
+
case "ls":
|
|
118
|
+
return clip(text(args, "path") || ".", 120);
|
|
119
|
+
case "web_search":
|
|
120
|
+
return clip(text(args, "query", "q"), 120);
|
|
121
|
+
case "web_fetch": {
|
|
122
|
+
const url = text(args, "url");
|
|
123
|
+
if (!url)
|
|
124
|
+
return "";
|
|
125
|
+
try {
|
|
126
|
+
return clip(new URL(url).host, 120);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return clip(url, 120);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
default:
|
|
133
|
+
return "";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The raw file a file-tool call names, unclipped, so two reads of one file can
|
|
138
|
+
* be matched. Null for every other tool and for a file tool with no path.
|
|
139
|
+
*/
|
|
140
|
+
export function actionPath(tool, args) {
|
|
141
|
+
switch (tool) {
|
|
142
|
+
case "read":
|
|
143
|
+
case "edit":
|
|
144
|
+
case "write": {
|
|
145
|
+
const path = text(args, "path", "file_path").trim();
|
|
146
|
+
return path || null;
|
|
147
|
+
}
|
|
148
|
+
default:
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Tool results arrive as `content` parts. Only text is useful on the board, and
|
|
154
|
+
* a huge result is cut from the head: the last lines are what just happened.
|
|
155
|
+
*/
|
|
156
|
+
export function toolResultText(result, max = 8_000) {
|
|
157
|
+
const content = result?.content;
|
|
158
|
+
if (!Array.isArray(content))
|
|
159
|
+
return "";
|
|
160
|
+
const body = content
|
|
161
|
+
.map((part) => {
|
|
162
|
+
if (!part || typeof part !== "object")
|
|
163
|
+
return "";
|
|
164
|
+
const { type, text: value } = part;
|
|
165
|
+
return type === "text" && typeof value === "string" ? value : "";
|
|
166
|
+
})
|
|
167
|
+
.join("");
|
|
168
|
+
return body.length > max ? body.slice(-max) : body;
|
|
169
|
+
}
|
|
170
|
+
let sequence = 0;
|
|
171
|
+
/**
|
|
172
|
+
* Correlated calls may run in parallel. Adapters without call IDs retain the
|
|
173
|
+
* legacy sequential behavior, closing the preceding row before starting one.
|
|
174
|
+
*/
|
|
175
|
+
export function startAction(actions, start) {
|
|
176
|
+
const startedAt = start.startedAt ?? Date.now();
|
|
177
|
+
const closed = start.callId
|
|
178
|
+
? actions
|
|
179
|
+
: finishAction(actions, { endedAt: startedAt, isError: false });
|
|
180
|
+
const action = {
|
|
181
|
+
id: start.callId ?? `action-${++sequence}`,
|
|
182
|
+
tool: start.tool,
|
|
183
|
+
name: actionName(start.tool),
|
|
184
|
+
detail: start.detail || "",
|
|
185
|
+
label: start.label,
|
|
186
|
+
state: "running",
|
|
187
|
+
startedAt,
|
|
188
|
+
};
|
|
189
|
+
return [...closed, action].slice(-MAX_ACTIONS);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Close the correlated row, or the latest legacy row. Only a failure keeps output: everything else is already
|
|
193
|
+
* said by the row itself, and a trace that carries every file body is a tail
|
|
194
|
+
* with extra steps.
|
|
195
|
+
*/
|
|
196
|
+
export function finishAction(actions, end) {
|
|
197
|
+
const index = actions.findLastIndex((action) => action.state === "running" && (!end.callId || action.id === end.callId));
|
|
198
|
+
if (index === -1)
|
|
199
|
+
return actions;
|
|
200
|
+
const action = actions[index];
|
|
201
|
+
if (!action)
|
|
202
|
+
return actions;
|
|
203
|
+
const output = end.isError && end.output?.trim() ? end.output.trim().slice(-MAX_ACTION_OUTPUT) : "";
|
|
204
|
+
const next = actions.slice();
|
|
205
|
+
next[index] = {
|
|
206
|
+
...action,
|
|
207
|
+
state: end.isError ? "failed" : "done",
|
|
208
|
+
endedAt: end.endedAt ?? Date.now(),
|
|
209
|
+
...(output ? { output } : {}),
|
|
210
|
+
};
|
|
211
|
+
return next;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* A run or turn that ends with a call still live is saying the process is gone,
|
|
215
|
+
* not that the call finished. The caller names the honest state — cancelled for
|
|
216
|
+
* a stop, failed for a process that died mid-call — and the row stops claiming
|
|
217
|
+
* to be running.
|
|
218
|
+
*/
|
|
219
|
+
export function closeActions(actions, state, endedAt = Date.now(), output) {
|
|
220
|
+
const next = actions.map((action) => {
|
|
221
|
+
if (action.state !== "running")
|
|
222
|
+
return action;
|
|
223
|
+
const evidence = state === "failed" && output?.trim() ? output.trim().slice(-MAX_ACTION_OUTPUT) : "";
|
|
224
|
+
return {
|
|
225
|
+
...action,
|
|
226
|
+
state,
|
|
227
|
+
endedAt,
|
|
228
|
+
...(evidence ? { output: evidence } : {}),
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
return next;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The board's own Verify checks as trace rows, after the agent's calls. A check
|
|
235
|
+
* the board stopped at its time limit is `timed_out`, not `failed`: the two need
|
|
236
|
+
* different fixes, and a row that says "failed" for a slow file sends the
|
|
237
|
+
* developer hunting for a broken test that does not exist.
|
|
238
|
+
*/
|
|
239
|
+
export function checkActions(actions, results, endedAt = Date.now()) {
|
|
240
|
+
const rows = results.map((result) => {
|
|
241
|
+
const state = result.passed ? "done" : result.timedOut ? "timed_out" : "failed";
|
|
242
|
+
const output = result.passed ? "" : result.output.trim().slice(-MAX_ACTION_OUTPUT);
|
|
243
|
+
return {
|
|
244
|
+
id: `check-${++sequence}`,
|
|
245
|
+
tool: "check",
|
|
246
|
+
name: "Check",
|
|
247
|
+
detail: result.command,
|
|
248
|
+
label: result.label,
|
|
249
|
+
state,
|
|
250
|
+
startedAt: endedAt - result.durationMs,
|
|
251
|
+
endedAt,
|
|
252
|
+
...(output ? { output } : {}),
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
return [...actions, ...rows].slice(-MAX_ACTIONS);
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/run/actions.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,kFAAkF;AAClF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC,yEAAyE;AACzE,MAAM,CAAC,MAAM,gBAAgB,GAA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