toolroll 0.9.108 → 0.9.110
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/CHANGELOG.md +69 -0
- package/dist/advanced-view.js +0 -1
- package/dist/agent-detect.js +244 -0
- package/dist/agent-fence.js +47 -5
- package/dist/agent-state.js +5 -2
- package/dist/agentconfig.js +2 -2
- package/dist/approval-summary.js +344 -0
- package/dist/assignment-ui.js +5 -5
- package/dist/assignment.js +5 -2
- package/dist/attest.js +2 -2
- package/dist/browser/terminal.js +1 -1
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +37 -34
- package/dist/browser-crew.js +4 -4
- package/dist/browser-workspace.js +4 -11
- package/dist/builder.js +45 -3
- package/dist/chat-actions.js +24 -17
- package/dist/chat-controls.js +6 -5
- package/dist/chat-core.js +3 -1
- package/dist/chat-decide.js +102 -47
- package/dist/chat-delivery-state.js +2 -0
- package/dist/chat-delivery.js +3 -2
- package/dist/chat-live.js +2 -1
- package/dist/chat-quiet.js +3 -3
- package/dist/chat-task-actions.js +6 -0
- package/dist/chat-voice.js +2 -2
- package/dist/check-report.js +1 -1
- package/dist/cli-help.js +12 -13
- package/dist/cli.js +6 -3
- package/dist/console-chrome.js +10 -3
- package/dist/console-instance.js +10 -1
- package/dist/contracts/console-api.js +14 -8
- package/dist/contracts/engine-api.js +271 -0
- package/dist/contracts/handoff.js +4 -0
- package/dist/coordinator.js +2 -2
- package/dist/decision.js +17 -0
- package/dist/demo-chat.js +1 -1
- package/dist/demo.js +6 -0
- package/dist/design/kit.js +4 -3
- package/dist/discord-api.js +4 -3
- package/dist/discord-chat.js +3 -1
- package/dist/dispatch.js +3 -8
- package/dist/easy-start-args.js +7 -3
- package/dist/easy-start.js +25 -0
- package/dist/egress.js +72 -10
- package/dist/engine-handoff.js +34 -0
- package/dist/engine-reads.js +261 -0
- package/dist/eval-world.js +3 -2
- package/dist/evidence.js +2 -0
- package/dist/fast-start.js +55 -14
- package/dist/fast-terms.js +2 -2
- package/dist/first-run.js +10 -2
- package/dist/flexible-agents.js +234 -0
- package/dist/flexible-answers-schema.js +61 -0
- package/dist/flexible-answers.js +889 -0
- package/dist/flexible-available.js +1 -0
- package/dist/flexible-custody.js +494 -0
- package/dist/flexible-import.js +782 -0
- package/dist/flexible-launch-schema.js +72 -0
- package/dist/flexible-launch.js +331 -0
- package/dist/flexible-launcher.js +88 -0
- package/dist/flexible-levels.js +34 -0
- package/dist/flexible-merge-guard.js +47 -0
- package/dist/flexible-refs.js +47 -0
- package/dist/flexible-relay-cancel.js +19 -0
- package/dist/flexible-relay-schema.js +55 -0
- package/dist/flexible-relay-upstreams.js +36 -0
- package/dist/flexible-relay.js +1032 -0
- package/dist/flexible-schema.js +32 -0
- package/dist/flexible-session.js +732 -0
- package/dist/flexible-ship-schema.js +81 -0
- package/dist/flexible-ship.js +694 -0
- package/dist/flexible-start.js +80 -0
- package/dist/flexible-thread-schema.js +30 -0
- package/dist/flexible-thread.js +676 -0
- package/dist/flexible-turns-schema.js +69 -0
- package/dist/flexible-turns.js +490 -0
- package/dist/flexible-ui.js +44 -0
- package/dist/flexible.js +368 -0
- package/dist/flow-actions.js +6 -4
- package/dist/flow-steps.js +1 -1
- package/dist/flows-cli.js +2 -1
- package/dist/git-views.js +44 -41
- package/dist/guides.js +11 -10
- package/dist/install-mode.js +225 -0
- package/dist/keymap.js +1 -1
- package/dist/lead-context.js +1 -1
- package/dist/lead-doors.js +7 -1
- package/dist/limits-ui.js +8 -1
- package/dist/live-bus.js +70 -13
- package/dist/live-reply.js +6 -0
- package/dist/live-terminal.js +425 -29
- package/dist/local-owner.js +6 -0
- package/dist/model-choices.js +12 -6
- package/dist/needs-you.js +3 -3
- package/dist/nightly-github.js +2 -2
- package/dist/notification-delivery.js +11 -0
- package/dist/operate.js +185 -33
- package/dist/outbound-privacy.js +204 -0
- package/dist/passwordless.js +2 -1
- package/dist/project-delete-ui.js +2 -1
- package/dist/project-delete.js +15 -0
- package/dist/provider-auth.js +1 -1
- package/dist/provider-connection.js +5 -3
- package/dist/publish.js +5 -0
- package/dist/pull-request-flow.js +26 -7
- package/dist/push.js +5 -1
- package/dist/release-card.js +11 -3
- package/dist/release.js +11 -1
- package/dist/result-actions.js +3 -0
- package/dist/result-evidence-readers.js +8 -2
- package/dist/result-review.js +20 -9
- package/dist/route-store.js +2 -2
- package/dist/sandbox-launch.js +32 -8
- package/dist/sandbox-runtime.js +16 -7
- package/dist/sandbox-tools.js +176 -0
- package/dist/scope.js +12 -36
- package/dist/scout-net.js +7 -2
- package/dist/serve.js +90 -40
- package/dist/server/chat.js +9 -9
- package/dist/server/chrome.js +19 -17
- package/dist/server/console.css +33 -6
- package/dist/server/engine-api.js +378 -0
- package/dist/server/flows.js +2 -2
- package/dist/server/guards.js +10 -4
- package/dist/server/home.js +37 -5
- package/dist/server/http.js +11 -2
- package/dist/server/in-place.js +5 -4
- package/dist/server/kit.js +2 -2
- package/dist/server/link-redemption.js +52 -0
- package/dist/server/live.js +100 -10
- package/dist/server/mutation-key.js +21 -7
- package/dist/server/pages.js +129 -74
- package/dist/server/people-tokens.js +17 -41
- package/dist/server/render-chat.js +2 -1
- package/dist/server/render-history.js +18 -4
- package/dist/server/render-new-task.js +4 -4
- package/dist/server/render-pages.js +21 -39
- package/dist/server/render-people.js +2 -2
- package/dist/server/render-projects.js +5 -5
- package/dist/server/render-results.js +30 -14
- package/dist/server/render-tasks.js +155 -155
- package/dist/server/retired-routes.js +37 -4
- package/dist/server/route-policy.js +8 -0
- package/dist/server/route-table.js +43 -5
- package/dist/server/settings-computers.js +140 -0
- package/dist/server/settings-scripts.js +15 -0
- package/dist/server/settings-section-table.js +59 -0
- package/dist/server/settings-sections.js +291 -0
- package/dist/server/settings.js +247 -28
- package/dist/server/task-views.js +55 -15
- package/dist/server/tasks.js +168 -98
- package/dist/server/terminals.js +181 -28
- package/dist/server/welcome.js +40 -14
- package/dist/settings-groups-ui.js +26 -107
- package/dist/settings-proofs.js +18 -11
- package/dist/slack-api.js +4 -3
- package/dist/slack-chat.js +5 -3
- package/dist/spend.js +46 -12
- package/dist/sqlite-telemetry.js +70 -21
- package/dist/status-probe.js +343 -0
- package/dist/store.js +206 -10
- package/dist/task-link.js +64 -0
- package/dist/teams-api.js +4 -3
- package/dist/teams-chat.js +4 -2
- package/dist/telegram-lead.js +2 -1
- package/dist/telegram-live.js +2 -1
- package/dist/telegram-team.js +2 -1
- package/dist/telegram.js +17 -5
- package/dist/trusted-path.js +162 -0
- package/dist/tui/darwin-arm64/toolroll-tui +0 -0
- package/dist/tui/darwin-x64/toolroll-tui +0 -0
- package/dist/tui/linux-arm64/toolroll-tui +0 -0
- package/dist/tui/linux-x64/toolroll-tui +0 -0
- package/dist/tui-launch.js +282 -0
- package/dist/tui-source.js +5 -3
- package/dist/tui.js +2 -2
- package/dist/typed-words-schema.js +18 -0
- package/dist/webhooks.js +8 -4
- package/dist/welcome-facts.js +25 -17
- package/dist/work-index.js +126 -29
- package/dist/work-reads.js +279 -0
- package/dist/workspace-ui.js +5 -0
- package/package.json +4 -2
- package/scripts/crash-canary.mjs +1 -1
- package/scripts/pilot.mjs +1 -1
- package/scripts/provider-canary.mjs +5 -3
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { writesSoFar } from "./sqlite-telemetry.js";
|
|
3
|
+
import { statementEffect } from "./workspace-revision.js";
|
|
4
|
+
export const WORK_READ_REUSE_MS = 5_000;
|
|
5
|
+
const MAX_SAVED = 50_000;
|
|
6
|
+
const FILL_TRIES = 3;
|
|
7
|
+
const scopes = new AsyncLocalStorage();
|
|
8
|
+
const busy = new WeakMap();
|
|
9
|
+
const tableOf = (slot) => `so_work_ranked_${slot}`;
|
|
10
|
+
export function withWorkReads(run) {
|
|
11
|
+
if (scopes.getStore() !== undefined)
|
|
12
|
+
return run();
|
|
13
|
+
const scope = { connections: new Map() };
|
|
14
|
+
let result;
|
|
15
|
+
try {
|
|
16
|
+
result = scopes.run(scope, run);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
close(scope);
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
if (result instanceof Promise)
|
|
23
|
+
return result.finally(() => close(scope));
|
|
24
|
+
close(scope);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
export function outsideWorkReads(run) {
|
|
28
|
+
return scopes.exit(run);
|
|
29
|
+
}
|
|
30
|
+
function close(scope) {
|
|
31
|
+
for (const [db, connection] of scope.connections) {
|
|
32
|
+
for (const slot of connection.slots)
|
|
33
|
+
release(db, slot);
|
|
34
|
+
connection.answers.clear();
|
|
35
|
+
connection.values.clear();
|
|
36
|
+
connection.ranked.clear();
|
|
37
|
+
connection.slots.clear();
|
|
38
|
+
}
|
|
39
|
+
scope.connections.clear();
|
|
40
|
+
}
|
|
41
|
+
function release(db, slot) {
|
|
42
|
+
try {
|
|
43
|
+
db.exec(`DROP TABLE IF EXISTS temp."${tableOf(slot)}"`);
|
|
44
|
+
busy.get(db)?.delete(slot);
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
}
|
|
48
|
+
const savingFor = new WeakMap();
|
|
49
|
+
export function readerOf(store) {
|
|
50
|
+
if (savingFor.has(store))
|
|
51
|
+
return store;
|
|
52
|
+
return workReadsOf(store)?.store ?? store;
|
|
53
|
+
}
|
|
54
|
+
export function workReadsOf(given) {
|
|
55
|
+
const scope = scopes.getStore();
|
|
56
|
+
if (scope === undefined)
|
|
57
|
+
return null;
|
|
58
|
+
const store = savingFor.get(given) ?? given;
|
|
59
|
+
const db = store.handle;
|
|
60
|
+
let connection = scope.connections.get(db);
|
|
61
|
+
if (connection === undefined) {
|
|
62
|
+
const created = { stamp: null, version: null, answers: new Map(), values: new Map(), ranked: new Map(), slots: new Set(), store: store };
|
|
63
|
+
created.store = Object.create(store, { db: { value: savingHandle(db, created) } });
|
|
64
|
+
savingFor.set(created.store, store);
|
|
65
|
+
scope.connections.set(db, created);
|
|
66
|
+
connection = created;
|
|
67
|
+
}
|
|
68
|
+
const current = connection;
|
|
69
|
+
prove(db, current);
|
|
70
|
+
return {
|
|
71
|
+
store: current.store,
|
|
72
|
+
value(name, compute) {
|
|
73
|
+
prove(db, current);
|
|
74
|
+
if (current.values.has(name))
|
|
75
|
+
return current.values.get(name);
|
|
76
|
+
const value = compute();
|
|
77
|
+
current.values.set(name, value);
|
|
78
|
+
return value;
|
|
79
|
+
},
|
|
80
|
+
ranked(key, now, fill) {
|
|
81
|
+
prove(db, current);
|
|
82
|
+
const held = current.ranked.get(key);
|
|
83
|
+
if (held !== undefined && Math.abs(now.getTime() - held.at) < WORK_READ_REUSE_MS)
|
|
84
|
+
return held.table;
|
|
85
|
+
if (held !== undefined)
|
|
86
|
+
forgetRanked(db, current, key);
|
|
87
|
+
const taken = busy.get(db) ?? new Set();
|
|
88
|
+
busy.set(db, taken);
|
|
89
|
+
let slot = 0;
|
|
90
|
+
while (taken.has(slot))
|
|
91
|
+
slot++;
|
|
92
|
+
const table = tableOf(slot);
|
|
93
|
+
for (let attempt = 0; attempt < FILL_TRIES; attempt++) {
|
|
94
|
+
const before = stampOf(db, current, true);
|
|
95
|
+
if (before === null || before !== current.stamp)
|
|
96
|
+
reset(db, current, before);
|
|
97
|
+
try {
|
|
98
|
+
db.exec(`DROP TABLE IF EXISTS temp."${table}"`);
|
|
99
|
+
fill(table);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
try {
|
|
103
|
+
db.exec(`DROP TABLE IF EXISTS temp."${table}"`);
|
|
104
|
+
}
|
|
105
|
+
catch { }
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const after = stampOf(db, current, true);
|
|
109
|
+
if (before !== null && before === after) {
|
|
110
|
+
taken.add(slot);
|
|
111
|
+
current.slots.add(slot);
|
|
112
|
+
current.ranked.set(key, { table, slot, at: now.getTime() });
|
|
113
|
+
current.stamp = after;
|
|
114
|
+
return table;
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
db.exec(`DROP TABLE IF EXISTS temp."${table}"`);
|
|
118
|
+
}
|
|
119
|
+
catch { }
|
|
120
|
+
prove(db, current);
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
},
|
|
124
|
+
forget(key) { forgetRanked(db, current, key); },
|
|
125
|
+
seed(sql, method, entries) {
|
|
126
|
+
if (!pureRead(sql))
|
|
127
|
+
return;
|
|
128
|
+
prove(db, current);
|
|
129
|
+
for (const [params, answer] of entries) {
|
|
130
|
+
const key = keyOf(sql, method, params);
|
|
131
|
+
if (key === null || current.answers.size >= MAX_SAVED)
|
|
132
|
+
continue;
|
|
133
|
+
current.answers.set(key, answer === undefined ? undefined : Array.isArray(answer) ? answer.map(copied) : copied(answer));
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function forgetRanked(db, connection, key) {
|
|
139
|
+
const held = connection.ranked.get(key);
|
|
140
|
+
if (held === undefined)
|
|
141
|
+
return;
|
|
142
|
+
connection.ranked.delete(key);
|
|
143
|
+
connection.slots.delete(held.slot);
|
|
144
|
+
release(db, held.slot);
|
|
145
|
+
}
|
|
146
|
+
let turn = 0, turning = false;
|
|
147
|
+
function currentTurn() {
|
|
148
|
+
if (!turning) {
|
|
149
|
+
turning = true;
|
|
150
|
+
queueMicrotask(() => { turning = false; turn++; });
|
|
151
|
+
}
|
|
152
|
+
return turn;
|
|
153
|
+
}
|
|
154
|
+
function stampOf(db, connection, exact = false) {
|
|
155
|
+
const now = currentTurn();
|
|
156
|
+
if (exact || connection.version === null || connection.version.turn !== now) {
|
|
157
|
+
try {
|
|
158
|
+
connection.version = { turn: now, value: String(db.prepare("PRAGMA data_version").get()?.["data_version"]) };
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
connection.version = null;
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return `${writesSoFar()}:${connection.version.value}`;
|
|
166
|
+
}
|
|
167
|
+
function prove(db, connection) {
|
|
168
|
+
const stamp = stampOf(db, connection);
|
|
169
|
+
if (stamp !== null && stamp === connection.stamp)
|
|
170
|
+
return;
|
|
171
|
+
reset(db, connection, stamp);
|
|
172
|
+
}
|
|
173
|
+
function reset(db, connection, stamp) {
|
|
174
|
+
connection.answers.clear();
|
|
175
|
+
connection.values.clear();
|
|
176
|
+
for (const key of [...connection.ranked.keys()])
|
|
177
|
+
forgetRanked(db, connection, key);
|
|
178
|
+
connection.stamp = stamp;
|
|
179
|
+
}
|
|
180
|
+
function pureRead(sql) {
|
|
181
|
+
const text = sql.replace(/^(?:\s|--[^\n]*(?:\n|$)|\/\*[\s\S]*?\*\/)+/, "");
|
|
182
|
+
return /^(?:SELECT|WITH)\b/i.test(text) && statementEffect(text).kind === "none"
|
|
183
|
+
&& !/'now'|\b(?:random|randomblob|changes|total_changes|last_insert_rowid|data_version)\b/i.test(text);
|
|
184
|
+
}
|
|
185
|
+
function keyOf(sql, method, params) {
|
|
186
|
+
try {
|
|
187
|
+
return `${method}\u0000${sql}\u0000${JSON.stringify(params, (_, value) => {
|
|
188
|
+
if (typeof value === "bigint")
|
|
189
|
+
throw Error("unsaved");
|
|
190
|
+
if (value instanceof Uint8Array)
|
|
191
|
+
return `\u0000bytes:${Buffer.from(value).toString("base64")}`;
|
|
192
|
+
return value;
|
|
193
|
+
})}`;
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function copied(row) {
|
|
200
|
+
const out = Object.create(Object.getPrototypeOf(row));
|
|
201
|
+
for (const [name, value] of Object.entries(row))
|
|
202
|
+
out[name] = value instanceof Uint8Array ? value.slice() : value;
|
|
203
|
+
return out;
|
|
204
|
+
}
|
|
205
|
+
function savingHandle(db, connection) {
|
|
206
|
+
const forgetAll = () => { connection.answers.clear(); connection.values.clear(); };
|
|
207
|
+
const handle = {
|
|
208
|
+
exec(sql) { forgetAll(); try {
|
|
209
|
+
db.exec(sql);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
forgetAll();
|
|
213
|
+
} },
|
|
214
|
+
prepare(sql) {
|
|
215
|
+
const statement = db.prepare(sql);
|
|
216
|
+
let saving = pureRead(sql);
|
|
217
|
+
const saved = (method) => (...params) => {
|
|
218
|
+
const key = saving ? keyOf(sql, method, params) : null;
|
|
219
|
+
if (key === null) {
|
|
220
|
+
if (!pureRead(sql))
|
|
221
|
+
forgetAll();
|
|
222
|
+
try {
|
|
223
|
+
return statement[method](...params);
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
if (!pureRead(sql))
|
|
227
|
+
forgetAll();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
prove(db, connection);
|
|
231
|
+
if (connection.answers.has(key)) {
|
|
232
|
+
const answer = connection.answers.get(key);
|
|
233
|
+
return answer === undefined ? undefined : Array.isArray(answer) ? answer.map(copied) : copied(answer);
|
|
234
|
+
}
|
|
235
|
+
const answer = statement[method](...params);
|
|
236
|
+
if (connection.answers.size < MAX_SAVED)
|
|
237
|
+
connection.answers.set(key, answer === undefined ? undefined : Array.isArray(answer) ? answer.map(copied) : copied(answer));
|
|
238
|
+
return answer;
|
|
239
|
+
};
|
|
240
|
+
return new Proxy(statement, {
|
|
241
|
+
get(target, property) {
|
|
242
|
+
if (property === "get" || property === "all")
|
|
243
|
+
return saved(property);
|
|
244
|
+
if (property === "run" || property === "iterate") {
|
|
245
|
+
const method = Reflect.get(target, property, target);
|
|
246
|
+
return (...params) => {
|
|
247
|
+
if (property === "run" || !pureRead(sql))
|
|
248
|
+
forgetAll();
|
|
249
|
+
try {
|
|
250
|
+
return method.apply(target, params);
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
if (property === "run" || !pureRead(sql))
|
|
254
|
+
forgetAll();
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const value = Reflect.get(target, property, target);
|
|
259
|
+
if (typeof value !== "function")
|
|
260
|
+
return value;
|
|
261
|
+
if (typeof property === "string" && property.startsWith("set"))
|
|
262
|
+
saving = false;
|
|
263
|
+
return value.bind(target);
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
close() { db.close(); },
|
|
268
|
+
};
|
|
269
|
+
return new Proxy(handle, {
|
|
270
|
+
get(target, property) {
|
|
271
|
+
if (Object.hasOwn(target, property))
|
|
272
|
+
return Reflect.get(target, property);
|
|
273
|
+
const value = Reflect.get(db, property, db);
|
|
274
|
+
return typeof value === "function" ? value.bind(db) : value;
|
|
275
|
+
},
|
|
276
|
+
has: (target, property) => Reflect.has(target, property) || Reflect.has(db, property),
|
|
277
|
+
getPrototypeOf: () => Object.getPrototypeOf(db),
|
|
278
|
+
});
|
|
279
|
+
}
|
package/dist/workspace-ui.js
CHANGED
|
@@ -594,6 +594,11 @@ export function stepRowsOf(view) {
|
|
|
594
594
|
const opens = step.state !== "todo" || (step.key === "ready" && hasResult) || (step.key === "build" && hasHistory) || approvalHere;
|
|
595
595
|
return { key: step.key, label: step.label, state: step.state, mark, sentence: said.sentence, at: said.at, needsYou, opens, open: here || approvalHere };
|
|
596
596
|
});
|
|
597
|
+
if (view.approve != null) {
|
|
598
|
+
const at = rows.findIndex(row => row.key === "plan" && (row.state === "done" || row.state === "skipped"));
|
|
599
|
+
if (at !== -1)
|
|
600
|
+
rows.splice(at, 1);
|
|
601
|
+
}
|
|
597
602
|
const waitsOnViewer = headline === "Ready for review" || headline === "Needs you";
|
|
598
603
|
if (waitsOnViewer && !rows.some(row => row.state === "current" || row.state === "stuck")) {
|
|
599
604
|
const last = [...rows].reverse().find(row => row.state === "done");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolroll",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.110",
|
|
4
4
|
"description": "Your agents build. You decide. A control plane for coding agents — Claude Code, Codex, Gemini: approve the exact scope once, get results back Ready with the diff, the passing check and screenshots. Runs on your machine.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"doc": "docs"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"test:slow": "vitest run .slow.test",
|
|
12
12
|
"test:all": "vitest run",
|
|
13
13
|
"test:attacks": "vitest run --config test/attacks/vitest.config.ts",
|
|
14
|
+
"test:perf:wire": "TZ=UTC vitest run --config test/perf/vitest.config.ts",
|
|
14
15
|
"test:git": "vitest run test/attacks/checkout-git- test/attacks/fence-git-views test/attacks/repository-context-git test/attacks/discover-dirty src/teardown-git.test.ts src/worktree.slow.test.ts",
|
|
15
16
|
"check:quick": "node scripts/quick-check.mjs",
|
|
16
17
|
"dev": "tsx src/cli.ts",
|
|
@@ -30,7 +31,8 @@
|
|
|
30
31
|
"e2e:flows": "npm run build && node scripts/flows-e2e.mjs",
|
|
31
32
|
"e2e:app": "npm run build && node scripts/app-e2e.mjs",
|
|
32
33
|
"e2e:app:parallel": "npm run build && node scripts/e2e-parallel.mjs scripts/app-e2e.mjs",
|
|
33
|
-
"e2e": "npm run build && node scripts/flows-e2e.mjs && node scripts/app-e2e.mjs"
|
|
34
|
+
"e2e": "npm run build && node scripts/flows-e2e.mjs && node scripts/app-e2e.mjs",
|
|
35
|
+
"e2e:click-paths": "npm run build && node scripts/click-paths-journey.mjs"
|
|
34
36
|
},
|
|
35
37
|
"repository": {
|
|
36
38
|
"type": "git",
|
package/scripts/crash-canary.mjs
CHANGED
|
@@ -131,7 +131,7 @@ async function one(stage, round) {
|
|
|
131
131
|
} else {
|
|
132
132
|
await cli(["task", "scope", "work", "--goal", "Write the result and verify it.", "--acceptance", acceptance.map(c => `${c.statement}|${c.evidence.join(",")}`).join(";")]);
|
|
133
133
|
const preview = await cli(["task", "show", "work"]);
|
|
134
|
-
await cli(["task", "approve", "work", "--yes", "--digest", preview.scope.digest, ...auth]);
|
|
134
|
+
await cli(["task", "approve", "work", "--yes", "--digest", preview.scope.digest, "--terms", preview.approvalTerms, ...auth]);
|
|
135
135
|
}
|
|
136
136
|
const workerArgs = ["watch", "--runner", "worker", "--token-file", join(control,"token"), "--repo", repo, "--pool", pool, "--tick-every", "200", "--reconcile-every", "500", "--bridge-every", "3600000", "--stop-grace", "1000", "--db", db, "--json"];
|
|
137
137
|
worker = start([...workerArgs, "--for", "180000"], opts);
|
package/scripts/pilot.mjs
CHANGED
|
@@ -77,7 +77,7 @@ async function one(id,provider,wave) {
|
|
|
77
77
|
].join(';');
|
|
78
78
|
await cli('file fixed scope',['task','scope','work','--goal',spec.goal,'--touches',spec.paths.join(','),'--acceptance',rubric,'--not','Changing tests or dependency definitions, external publication, or unrelated files.']);
|
|
79
79
|
const preview=await cli('read scope',['task','show','work']);
|
|
80
|
-
await cli('approve exact fixture scope',['task','approve','work','--yes','--digest',preview.scope.digest,...auth]);
|
|
80
|
+
await cli('approve exact fixture scope',['task','approve','work','--yes','--digest',preview.scope.digest,'--terms',preview.approvalTerms,...auth]);
|
|
81
81
|
await writeFile(join(dir,'runner-token'),registered.token,{mode:0o600});
|
|
82
82
|
console.log(name+': starting unattended build and check');
|
|
83
83
|
const start=Date.now();
|
|
@@ -313,11 +313,13 @@ async function runtimeIdentity() {
|
|
|
313
313
|
export async function checkCheckoutGit({ provider, worktree, databaseFile, repository, home = homedir() }, execute = run) {
|
|
314
314
|
if (!["claude", "codex", "gemini"].includes(provider)) return null;
|
|
315
315
|
if (typeof worktree !== "string" || worktree === "") throw new Error("the builder did not retain its worktree for the Git fence check");
|
|
316
|
-
const { agentFence, taskBoundary, trustedWorktreeBinding, checkoutGitEnv, HARDENED_GIT_ARGS, fenceGrants, codexFenceArgv, macosFenceAvailable, linuxFenceAvailable, sandboxedSpawn } = await import(join(root, "dist", "agent-fence.js"));
|
|
316
|
+
const { agentFence, taskBoundary, trustedWorktreeBinding, checkoutGitEnv, installDenied, HARDENED_GIT_ARGS, fenceGrants, codexFenceArgv, macosFenceAvailable, linuxFenceAvailable, sandboxedSpawn } = await import(join(root, "dist", "agent-fence.js"));
|
|
317
317
|
const binding = trustedWorktreeBinding(repository, worktree);
|
|
318
318
|
const boundary = taskBoundary({ worktree, provider, home, binding });
|
|
319
319
|
const fence = agentFence({ databaseFile, worktree, home, boundary, binding });
|
|
320
|
-
|
|
320
|
+
// As fenceFor makes them: Toolroll's own install write-denied, which the Linux fence needs before it runs a seccomp
|
|
321
|
+
// helper Toolroll's user owns (a user npm install).
|
|
322
|
+
const grants = installDenied(fenceGrants({ databaseFile, worktree, boundary }), worktree, home, binding?.main ?? null);
|
|
321
323
|
const codexHome = provider === "codex" ? await mkdtemp(join(tmpdir(), "so-codex-canary-")) : null;
|
|
322
324
|
try {
|
|
323
325
|
let head = null;
|
|
@@ -488,7 +490,7 @@ async function main() {
|
|
|
488
490
|
throw new Error("the unchanged plan did not receive the exact signed mode approval");
|
|
489
491
|
}
|
|
490
492
|
} else await cli("approve the exact planned scope", [
|
|
491
|
-
"task", "approve", TASK_ID, "--yes", "--digest", digest,
|
|
493
|
+
"task", "approve", TASK_ID, "--yes", "--digest", digest, "--terms", afterPlan.approvalTerms,
|
|
492
494
|
"--as", "canary", "--token", password,
|
|
493
495
|
]);
|
|
494
496
|
|