zelio-cli 0.0.0-stage → 0.1.0-beta.10
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 +71 -2
- package/dist/attachments.js +121 -0
- package/dist/attachments.js.map +1 -0
- package/dist/cli-main.js +521 -0
- package/dist/cli-main.js.map +1 -0
- package/dist/cli.js +22 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/account.js +109 -0
- package/dist/cloud/account.js.map +1 -0
- package/dist/cloud/board.js +311 -0
- package/dist/cloud/board.js.map +1 -0
- package/dist/cloud/command.js +265 -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 +166 -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 +1838 -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/area-notes.js +87 -0
- package/dist/orchestrator/area-notes.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 +327 -0
- package/dist/orchestrator/codex-session.js.map +1 -0
- package/dist/orchestrator/contract.js +189 -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 +234 -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 +193 -0
- package/dist/orchestrator/research.js.map +1 -0
- package/dist/orchestrator/retrieval.js +333 -0
- package/dist/orchestrator/retrieval.js.map +1 -0
- package/dist/orchestrator/runtime.js +1217 -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/code-map.js +152 -0
- package/dist/repo/code-map.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 +149 -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 +116 -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 +284 -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 +213 -0
- package/dist/run/codex-client.js.map +1 -0
- package/dist/run/codex-planner-config.js +26 -0
- package/dist/run/codex-planner-config.js.map +1 -0
- package/dist/run/codex-runtime.js +469 -0
- package/dist/run/codex-runtime.js.map +1 -0
- package/dist/run/consult.js +109 -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/developer-sandbox.js +67 -0
- package/dist/run/developer-sandbox.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 +430 -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 +293 -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 +183 -0
- package/dist/run/lead.js.map +1 -0
- package/dist/run/manager.js +2737 -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-packages.js +72 -0
- package/dist/run/pi-packages.js.map +1 -0
- package/dist/run/pi-rpc.js +464 -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 +405 -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 +28 -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 +266 -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 +3286 -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/provider-auth.js +206 -0
- package/dist/server/provider-auth.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 +71 -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 +157 -0
- package/dist/setup/onboarding.js.map +1 -0
- package/dist/setup/run.js +69 -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-TN5sUF2z.css +1 -0
- package/dist/web/assets/index-vB3Cucuc.js +258 -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/media/board.png +0 -0
- package/media/mobile.png +0 -0
- package/media/new-task.png +0 -0
- package/media/review.png +0 -0
- package/package.json +105 -4
|
@@ -0,0 +1,257 @@
|
|
|
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,GAAG,CAAC,CAAC;AAElC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,qFAAqF;AACrF,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,GAAW,EAAU,EAAE;IACzD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACjE,CAAC,CAAC;AAYF,iD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ACtC,OAAO;YACP,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { boundedText, fencedOr, lastJsonObject, listed, readOnlyAnswer } from "./consult.js";
|
|
2
|
+
/** Automatic reviews that may send one ticket back before the person decides. */
|
|
3
|
+
export const MAX_AUTO_REVIEWS = 2;
|
|
4
|
+
const REVIEW_TIMEOUT_MS = 180_000;
|
|
5
|
+
/** Characters kept from each earlier round's findings. */
|
|
6
|
+
const EARLIER_MAX = 2000;
|
|
7
|
+
export const AUTO_REVIEW_PROMPT = `You are the reviewer on a Zelio board. The developer says a ticket is done and the board's checks pass. Checks prove only what they test; your job is the question they cannot answer: does this change give the person what they asked for? You are read-only: you can read and search the worktree, and you never edit files, run commands, commit, or move tickets.
|
|
8
|
+
|
|
9
|
+
You get what the person asked for in their own words (the "Original user intent" line among the card's facts), the screenshots they attached, the card's goal, acceptance and out of scope, the optional planner handoff, and the diff. Open every screenshot before you judge: when the person attached one, it is the clearest statement of what they want. Read the code the diff touches when you need to be sure of a behaviour. The packet names the commit the diff starts from: a line that came from the base branch belongs to the base, not to this ticket. A new file appears in the diff only by name, on its "Untracked:" line: open it, because it is usually where the new behaviour lives.
|
|
10
|
+
|
|
11
|
+
Decide one thing:
|
|
12
|
+
|
|
13
|
+
Independently identify existing workflows affected by the change and challenge the evidence that their normal transitions remain usable, even when acceptance omitted them. Missing affected-workflow evidence requires a "changes" finding; green checks or earlier test approval do not waive it.
|
|
14
|
+
|
|
15
|
+
- "pass": the change delivers what the person asked for and what the acceptance describes. Style, naming, and things you would have built differently are not reasons to send it back; mention them in the summary at most.
|
|
16
|
+
- "changes": something the person asked for or the acceptance requires is missing or wrong, or the change has a bug they would hit. Write findings for the developer: what is missing or wrong, where (file:line), and what done looks like, most important first, under 1500 characters.
|
|
17
|
+
|
|
18
|
+
If you reviewed this ticket before, your earlier findings are included: check each one against the new diff, and do not raise a new minor point to keep the ticket back.
|
|
19
|
+
|
|
20
|
+
Answer with exactly one fenced json block and nothing after it, one of:
|
|
21
|
+
{"verdict":"pass","summary":"..."}
|
|
22
|
+
{"verdict":"changes","findings":"..."}`;
|
|
23
|
+
/** The review of the tests alone, before any implementation exists. */
|
|
24
|
+
export const TEST_REVIEW_PROMPT = `You are the reviewer on a Zelio board. The developer has written only the tests for a ticket, before any implementation, and the board has seen them fail on the code as it is. Your job is to decide whether these tests check what the person asked for. You are read-only: you can read and search the worktree, and you never edit files, run commands, commit, or move tickets.
|
|
25
|
+
|
|
26
|
+
You get what the person asked for in their own words (the "Original user intent" line among the card's facts), the screenshots they attached, the card's goal ("Today / After / Done when"), acceptance and out of scope, and the tests. Open every screenshot before you judge.
|
|
27
|
+
|
|
28
|
+
Decide one thing:
|
|
29
|
+
|
|
30
|
+
Independently identify existing workflows affected by the change and challenge the evidence that their normal transitions remain usable, even when acceptance omitted them. Missing affected-workflow evidence requires a "changes" finding; green checks or earlier test approval do not waive it.
|
|
31
|
+
|
|
32
|
+
- "pass": each part of the goal's "Done when" and each acceptance criterion, including its failure case, is checked by at least one test that would fail if that part were missing. Style, naming and test layout are not reasons to send it back.
|
|
33
|
+
- Tests protecting existing behavior affected by the change are valid and may be required even when the person did not explicitly ask for them.
|
|
34
|
+
- "changes": a test imposes unrelated behavior the person did not ask for, misses part of what they asked for, lacks affected-workflow evidence, or could pass without the behaviour (it asserts nothing that matters, or mocks the very thing it should check). Write findings for the developer: which part of the request is not tested, or which test is wrong and what it should check instead, under 1500 characters.
|
|
35
|
+
|
|
36
|
+
If you reviewed these tests before, your earlier findings are included: check each one, and do not raise a new minor point to hold the tests back.
|
|
37
|
+
|
|
38
|
+
Answer with exactly one fenced json block and nothing after it, one of:
|
|
39
|
+
{"verdict":"pass","summary":"..."}
|
|
40
|
+
{"verdict":"changes","findings":"..."}`;
|
|
41
|
+
/** Said to the final review when the tests were reviewed first. */
|
|
42
|
+
const TESTS_REVIEWED_NOTE = "The tests were reviewed against the person's request before the change was built. Independently challenge affected-workflow evidence again: missing evidence that normal transitions remain usable requires a changes finding, even with earlier test approval or green checks. Look at what tests cannot show: does the result match the screenshots, did the change pass the tests honestly rather than by special-casing them, and did anything outside the ticket change.";
|
|
43
|
+
export function reviewPacket(input) {
|
|
44
|
+
const earlier = input.earlier.length > 0
|
|
45
|
+
? [
|
|
46
|
+
"",
|
|
47
|
+
"Your earlier findings on this ticket (the developer was sent back with them):",
|
|
48
|
+
...input.earlier.flatMap((findings, index) => [
|
|
49
|
+
`${index + 1}.`,
|
|
50
|
+
findings.length > EARLIER_MAX ? `${findings.slice(0, EARLIER_MAX)}…` : findings,
|
|
51
|
+
]),
|
|
52
|
+
]
|
|
53
|
+
: [];
|
|
54
|
+
return [
|
|
55
|
+
`Ticket ${input.ticketId}: ${input.title}`,
|
|
56
|
+
input.focus === "tests"
|
|
57
|
+
? `This is test review ${input.round} on this ticket.`
|
|
58
|
+
: `This is automatic review ${input.round} on this ticket.`,
|
|
59
|
+
...(input.testsReviewed && input.focus !== "tests" ? ["", TESTS_REVIEWED_NOTE] : []),
|
|
60
|
+
...earlier,
|
|
61
|
+
"",
|
|
62
|
+
"What the person asked for, and what the planner verified:",
|
|
63
|
+
...listed(input.context),
|
|
64
|
+
"",
|
|
65
|
+
"Screenshots the person attached (open each one):",
|
|
66
|
+
...listed(input.screenshots),
|
|
67
|
+
"",
|
|
68
|
+
"Goal:",
|
|
69
|
+
input.goal,
|
|
70
|
+
"",
|
|
71
|
+
"Out of scope:",
|
|
72
|
+
input.outOfScope,
|
|
73
|
+
"",
|
|
74
|
+
"Acceptance:",
|
|
75
|
+
input.acceptance,
|
|
76
|
+
"",
|
|
77
|
+
"Planner handoff (guidance; verify it against code):",
|
|
78
|
+
input.plan?.trim() || "No plan was attached to this ticket.",
|
|
79
|
+
"",
|
|
80
|
+
...(input.diffBase
|
|
81
|
+
? [
|
|
82
|
+
`Reviewed against ${input.diffBase}: \`git diff ${input.diffBase}...HEAD\`. Lines that came from the base branch are not this ticket's change.`,
|
|
83
|
+
"",
|
|
84
|
+
]
|
|
85
|
+
: []),
|
|
86
|
+
input.focus === "tests" ? "The tests:" : "The change:",
|
|
87
|
+
...fencedOr(input.diff, "diff", "(no changes)"),
|
|
88
|
+
].join("\n");
|
|
89
|
+
}
|
|
90
|
+
export function readReviewVerdict(text) {
|
|
91
|
+
const record = lastJsonObject(text);
|
|
92
|
+
if (!record)
|
|
93
|
+
return null;
|
|
94
|
+
if (record.verdict === "pass") {
|
|
95
|
+
const summary = boundedText(record.summary, 1, 1500);
|
|
96
|
+
return summary === null ? null : { verdict: "pass", summary };
|
|
97
|
+
}
|
|
98
|
+
if (record.verdict === "changes") {
|
|
99
|
+
const findings = boundedText(record.findings, 1, 3000);
|
|
100
|
+
return findings === null ? null : { verdict: "changes", findings };
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/** One read-only review. Never throws; no usable answer is null. */
|
|
105
|
+
export async function consultReviewer(input, options) {
|
|
106
|
+
const text = await readOnlyAnswer(input.worktreePath, reviewPacket(input), {
|
|
107
|
+
runtime: options.runtime,
|
|
108
|
+
systemPrompt: input.focus === "tests" ? TEST_REVIEW_PROMPT : AUTO_REVIEW_PROMPT,
|
|
109
|
+
thinking: options.thinking ?? "high",
|
|
110
|
+
timeoutMs: options.timeoutMs ?? REVIEW_TIMEOUT_MS,
|
|
111
|
+
...(options.command ? { command: options.command } : {}),
|
|
112
|
+
...(options.model ? { model: options.model } : {}),
|
|
113
|
+
});
|
|
114
|
+
return text === null ? null : readReviewVerdict(text);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=auto-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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,183 @@
|
|
|
1
|
+
import { stripWorktreeCd } from "./actions.js";
|
|
2
|
+
/**
|
|
3
|
+
* The shell file-readers a developer run must not spend a turn on.
|
|
4
|
+
*
|
|
5
|
+
* The prompt already says to read and search with the tools; a prompt is a
|
|
6
|
+
* suggestion, and an agent that pipes `sed` over a file costs a trace row with
|
|
7
|
+
* the whole file inside it. `read`, `grep`, `find` and `ls` are on the run's
|
|
8
|
+
* tool allowlist, so every one of these names has a cheaper, bounded answer.
|
|
9
|
+
*/
|
|
10
|
+
export const SHELL_READERS = [
|
|
11
|
+
"cat",
|
|
12
|
+
"find",
|
|
13
|
+
"grep",
|
|
14
|
+
"head",
|
|
15
|
+
"ls",
|
|
16
|
+
"rg",
|
|
17
|
+
"sed",
|
|
18
|
+
"tail",
|
|
19
|
+
"wc",
|
|
20
|
+
];
|
|
21
|
+
/** The extension file Pi loads for a developer run. */
|
|
22
|
+
export const BASH_GUARD_EXTENSION = new URL("./bash-guard.js", import.meta.url);
|
|
23
|
+
const READER_NAME = new Set(SHELL_READERS);
|
|
24
|
+
/**
|
|
25
|
+
* The refusal is the agent's next instruction, not a scolding: name the tools
|
|
26
|
+
* that do the job and the run recovers on its next call.
|
|
27
|
+
*/
|
|
28
|
+
function bashGuardRefusal(reader) {
|
|
29
|
+
return (`zelio: \`${reader}\` is blocked in the developer bash tool. ` +
|
|
30
|
+
"Use the read tool for a file body, grep to search the repo, find to locate a path, and ls to list a directory.");
|
|
31
|
+
}
|
|
32
|
+
const QUOTES = new Set(["'", '"']);
|
|
33
|
+
/**
|
|
34
|
+
* Split a command line into the simple commands it runs. `&&`, `|`, `;` and a
|
|
35
|
+
* newline are four ways of putting two commands on one line, and each half is
|
|
36
|
+
* checked on its own: `cd src && grep -rn foo .` reads.
|
|
37
|
+
*
|
|
38
|
+
* Quotes are tracked so an operator or a reader name inside an argument stays
|
|
39
|
+
* text — `git commit -m "grep fix"` is a commit, not a search.
|
|
40
|
+
*/
|
|
41
|
+
function commandSegments(command) {
|
|
42
|
+
const segments = [];
|
|
43
|
+
let current = "";
|
|
44
|
+
let quote = "";
|
|
45
|
+
for (let index = 0; index < command.length; index += 1) {
|
|
46
|
+
const char = command[index] ?? "";
|
|
47
|
+
if (quote) {
|
|
48
|
+
current += char;
|
|
49
|
+
if (char === quote)
|
|
50
|
+
quote = "";
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (QUOTES.has(char)) {
|
|
54
|
+
quote = char;
|
|
55
|
+
current += char;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (char === "\\") {
|
|
59
|
+
current += char + (command[index + 1] ?? "");
|
|
60
|
+
index += 1;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (char === ";" || char === "&" || char === "|" || char === "\n") {
|
|
64
|
+
segments.push(current);
|
|
65
|
+
current = "";
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
current += char;
|
|
69
|
+
}
|
|
70
|
+
segments.push(current);
|
|
71
|
+
return segments;
|
|
72
|
+
}
|
|
73
|
+
/** The words of one simple command, unquoted, so `"grep"` is the word `grep`. */
|
|
74
|
+
function words(segment) {
|
|
75
|
+
const parts = [];
|
|
76
|
+
let current = "";
|
|
77
|
+
let quote = "";
|
|
78
|
+
const flush = () => {
|
|
79
|
+
if (!current)
|
|
80
|
+
return;
|
|
81
|
+
parts.push(current);
|
|
82
|
+
current = "";
|
|
83
|
+
};
|
|
84
|
+
for (let index = 0; index < segment.length; index += 1) {
|
|
85
|
+
const char = segment[index] ?? "";
|
|
86
|
+
if (quote) {
|
|
87
|
+
current += char;
|
|
88
|
+
if (char === quote)
|
|
89
|
+
quote = "";
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (QUOTES.has(char)) {
|
|
93
|
+
quote = char;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (/\s/.test(char)) {
|
|
97
|
+
flush();
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
current += char;
|
|
101
|
+
}
|
|
102
|
+
flush();
|
|
103
|
+
return parts;
|
|
104
|
+
}
|
|
105
|
+
/** `FOO=bar grep …` still runs grep, and the assignment is not the command. */
|
|
106
|
+
const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/;
|
|
107
|
+
/** Words that only introduce the command after them. */
|
|
108
|
+
const LEAD_INS = new Set([
|
|
109
|
+
"sudo",
|
|
110
|
+
"command",
|
|
111
|
+
"builtin",
|
|
112
|
+
"exec",
|
|
113
|
+
"env",
|
|
114
|
+
"nohup",
|
|
115
|
+
"time",
|
|
116
|
+
"then",
|
|
117
|
+
"do",
|
|
118
|
+
"else",
|
|
119
|
+
"!",
|
|
120
|
+
"{",
|
|
121
|
+
"(",
|
|
122
|
+
]);
|
|
123
|
+
/** The command a segment runs, once assignments and lead-ins are stepped over. */
|
|
124
|
+
function commandWord(segment) {
|
|
125
|
+
for (const part of words(segment)) {
|
|
126
|
+
if (ASSIGNMENT.test(part) || LEAD_INS.has(part))
|
|
127
|
+
continue;
|
|
128
|
+
return part;
|
|
129
|
+
}
|
|
130
|
+
return "";
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The refusal for a bash command that shell-reads, or null when the command is
|
|
134
|
+
* something else.
|
|
135
|
+
*
|
|
136
|
+
* Only a bare reader name in command position counts: a reader run from a path,
|
|
137
|
+
* or hidden behind `awk`, `rg`, `xargs` or `bash -c`, is a wrapped read and out
|
|
138
|
+
* of scope.
|
|
139
|
+
*
|
|
140
|
+
* The judgement is made here, on the command the agent wrote, and not by putting
|
|
141
|
+
* shims on the run's `PATH`. Shims look like the stronger refusal and are not:
|
|
142
|
+
* every process the run starts inherits that `PATH`, and the launchers the run
|
|
143
|
+
* depends on are themselves shell scripts that read through these very names —
|
|
144
|
+
* pnpm's own shim computes its install path with `sed`, so `pnpm check` died
|
|
145
|
+
* before it ran. A run that cannot run its check never reaches its status.
|
|
146
|
+
*/
|
|
147
|
+
export function bashGuardReason(command) {
|
|
148
|
+
for (const segment of commandSegments(stripWorktreeCd(command))) {
|
|
149
|
+
const word = commandWord(segment);
|
|
150
|
+
if (word && READER_NAME.has(word))
|
|
151
|
+
return bashGuardRefusal(word);
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/** The refusal text the guard returns, as the tool output that reports it. */
|
|
156
|
+
const REFUSAL_OUTPUT = /^zelio: `([^`]+)` is blocked in the developer bash tool\./;
|
|
157
|
+
/**
|
|
158
|
+
* The reader a guard refusal names, or null when the output is anything else.
|
|
159
|
+
* Used to recognise a blocked call in a finished run, so the board can count
|
|
160
|
+
* guard blocks without the guard having to report them separately.
|
|
161
|
+
*/
|
|
162
|
+
export function bashGuardBlockedReader(output) {
|
|
163
|
+
const match = REFUSAL_OUTPUT.exec(output?.trim() ?? "");
|
|
164
|
+
return match?.[1] ?? null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Pi loads this as an extension before a developer run starts. The hook fires
|
|
168
|
+
* before the bash tool executes, so a shell read is blocked at the tool layer
|
|
169
|
+
* instead of being executed and then hidden from the board's trace.
|
|
170
|
+
*/
|
|
171
|
+
export function registerBashGuard(pi) {
|
|
172
|
+
pi.on("tool_call", async (event) => {
|
|
173
|
+
if (event.toolName !== "bash")
|
|
174
|
+
return undefined;
|
|
175
|
+
const command = event.input?.command;
|
|
176
|
+
if (typeof command !== "string")
|
|
177
|
+
return undefined;
|
|
178
|
+
const reason = bashGuardReason(command);
|
|
179
|
+
return reason ? { block: true, reason } : undefined;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
export default registerBashGuard;
|
|
183
|
+
//# sourceMappingURL=bash-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash-guard.js","sourceRoot":"","sources":["../../src/run/bash-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,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