toolroll 0.9.116 → 0.9.117
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 +36 -0
- package/README.md +43 -26
- package/dist/acp-agents.js +14 -1
- package/dist/acp-client.js +19 -1
- package/dist/agent-change-check.js +60 -0
- package/dist/agent-change-schema.js +19 -0
- package/dist/agent-detect.js +11 -1
- package/dist/agent-fence.js +39 -10
- package/dist/agent-network-request.js +108 -0
- package/dist/agent-requests.js +105 -0
- package/dist/approval-summary.js +3 -3
- package/dist/backup.js +17 -1
- package/dist/batch-checks.js +81 -18
- package/dist/browser/terminal.js +41 -41
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +36 -36
- package/dist/builder.js +3 -1
- package/dist/candidate-materialize.js +119 -0
- package/dist/central-enrollment-contract.js +156 -0
- package/dist/central-recovery-stage.js +329 -0
- package/dist/chat-actions.js +101 -2
- package/dist/chat-channel.js +40 -0
- package/dist/check-only-standing.js +13 -0
- package/dist/check-only.js +25 -13
- package/dist/check-recovery-hold.js +199 -0
- package/dist/check-recovery-index-schema.js +3 -0
- package/dist/check-screenshots.js +83 -0
- package/dist/cli.js +125 -6
- package/dist/codex-limits.js +4 -0
- package/dist/connect-cli.js +257 -11
- package/dist/contracts/chat-actions.js +4 -0
- package/dist/contracts/console-api.js +14 -3
- package/dist/contracts/engine-api.js +331 -2
- package/dist/contracts/lead-tools.js +56 -2
- package/dist/contracts/provider.js +1 -1
- package/dist/contracts/route.js +1 -1
- package/dist/contracts/terminal-connection.js +50 -0
- package/dist/converse.js +80 -4
- package/dist/device-pair.js +280 -0
- package/dist/direct-chat-artifacts.js +347 -0
- package/dist/direct-chat-catalog.js +311 -0
- package/dist/direct-chat-fence.js +96 -0
- package/dist/direct-chat-git.js +343 -0
- package/dist/direct-chat-laptop.js +19 -0
- package/dist/direct-chat-schema.js +181 -0
- package/dist/direct-chat-ship.js +861 -0
- package/dist/direct-chat-workspace.js +389 -0
- package/dist/direct-chat.js +2107 -0
- package/dist/doctor.js +1 -1
- package/dist/easy-start.js +18 -0
- package/dist/egress.js +25 -4
- package/dist/engine-chat.js +454 -0
- package/dist/engine-reads.js +141 -13
- package/dist/exec.js +4 -3
- package/dist/flexible-agents.js +8 -16
- package/dist/flexible-session.js +91 -47
- package/dist/flexible-ship.js +87 -7
- package/dist/flexible-start.js +4 -1
- package/dist/flexible-thread.js +2 -3
- package/dist/flexible-turns.js +26 -5
- package/dist/flow-triggers.js +13 -4
- package/dist/flows-ui.js +54 -20
- package/dist/handoff-cli.js +630 -0
- package/dist/invoke.js +55 -13
- package/dist/lead-contract.js +5 -4
- package/dist/lead-doors.js +80 -1
- package/dist/lead-progress.js +9 -0
- package/dist/lead-tools.js +681 -10
- package/dist/lead.js +37 -9
- package/dist/live-bus.js +11 -0
- package/dist/live-terminal.js +132 -12
- package/dist/local-handoff.js +363 -0
- package/dist/local-owner-acts.js +264 -2
- package/dist/local-owner.js +16 -1
- package/dist/multiplayer-handoff.js +528 -0
- package/dist/multiplayer-presence.js +471 -0
- package/dist/names.js +17 -4
- package/dist/needs-you.js +10 -0
- package/dist/operate.js +280 -19
- package/dist/policy.js +2 -2
- package/dist/project-delete-ui.js +18 -11
- package/dist/project-delete.js +65 -4
- package/dist/project-tools.js +1 -1
- package/dist/prompt.js +1 -1
- package/dist/provider-connection.js +2 -0
- package/dist/provider-home.js +251 -8
- package/dist/provider.js +3 -2
- package/dist/publish.js +119 -64
- package/dist/pull-request-flow.js +35 -14
- package/dist/read-executor-worker.js +1 -1
- package/dist/read-executor.js +95 -1
- package/dist/restore-retirement.js +152 -0
- package/dist/result-follow-ups.js +116 -37
- package/dist/route-change.js +44 -4
- package/dist/scope.js +62 -5
- package/dist/serve.js +49 -5
- package/dist/server/chat.js +94 -13
- package/dist/server/direct-chat.js +583 -0
- package/dist/server/engine-api.js +219 -21
- package/dist/server/flows.js +43 -10
- package/dist/server/found-repos.js +25 -0
- package/dist/server/guards.js +20 -6
- package/dist/server/live.js +81 -23
- package/dist/server/pages.js +67 -13
- package/dist/server/people-tokens.js +47 -6
- package/dist/server/remote.js +29 -0
- package/dist/server/render-results.js +6 -2
- package/dist/server/render-settings.js +4 -2
- package/dist/server/render-tasks.js +18 -17
- package/dist/server/route-table.js +69 -2
- package/dist/server/settings.js +22 -7
- package/dist/server/task-views.js +15 -3
- package/dist/server/tasks.js +39 -2
- package/dist/server/terminals.js +185 -11
- package/dist/settings-proofs.js +1 -1
- package/dist/store.js +499 -56
- package/dist/subscription-chat.js +33 -6
- package/dist/subscription-usage.js +233 -0
- package/dist/task-live.js +2 -1
- package/dist/teardown-git.js +34 -4
- package/dist/terminal-connection.js +159 -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-contract.js +1 -1
- package/dist/tui-launch.js +32 -1
- package/dist/workspace-identity-schema.js +21 -0
- package/package.json +3 -1
package/dist/server/terminals.js
CHANGED
|
@@ -10,16 +10,20 @@ import { loadPtySpawn, MAX_FRAME_BYTES, TerminalHost, MAX_VIEWERS, parseTerminal
|
|
|
10
10
|
import { logEvent } from "../log.js";
|
|
11
11
|
import { sessionStandsIn, soloNow } from "../install-mode.js";
|
|
12
12
|
import { localOwnerStandsNow } from "../local-owner.js";
|
|
13
|
-
import {
|
|
13
|
+
import { SHELL_NO_COMMIT, SHELL_NO_RESULT, takeOverRevisionOf, takeOverRunsOf } from "../engine-reads.js";
|
|
14
|
+
import { failedAttemptSentence } from "../needs-you.js";
|
|
14
15
|
import { checkEngineResponse } from "../contracts/engine-api.js";
|
|
15
16
|
import { projectName, rowVisible } from "../project.js";
|
|
16
17
|
import { transportOf } from "../public-access.js";
|
|
18
|
+
import { agentSaidOf } from "../store.js";
|
|
17
19
|
import { agentSetupOf } from "../agent-detect.js";
|
|
18
20
|
import { excludedFolders, launchPath, resolveLaunch, statusEnvironment } from "../status-probe.js";
|
|
19
21
|
import { boundedAcl } from "../trusted-path.js";
|
|
20
22
|
import { handlersOf } from "./handler-registry.js";
|
|
21
23
|
import { respond } from "./http.js";
|
|
22
24
|
import { rereadBrowser } from "./live.js";
|
|
25
|
+
import { remoteAllows, reproveRemote } from "../operate-remote.js";
|
|
26
|
+
import { admitRemoteTerminalRequest, isRemoteTerminalRequest } from "../terminal-connection.js";
|
|
23
27
|
const TERMINAL_ID = /^\/term\/([a-f0-9]{32})(?:\/(socket|close|remove))?$/;
|
|
24
28
|
const BEHIND_BYTES = 4 * 1024 * 1024;
|
|
25
29
|
const INPUT_BURST = 256 * 1024;
|
|
@@ -104,7 +108,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
104
108
|
const who = operatorOf(ctx.who);
|
|
105
109
|
if (who === null)
|
|
106
110
|
return checked(ctx, 403, "refusal", { error: "operator" });
|
|
107
|
-
const sessions = deps.host === null ? [] : deps.host.
|
|
111
|
+
const sessions = deps.host === null ? [] : deps.host.listAll().filter(one => one.agent === null && ((who.authority === "full" && one.localGeneration === null) || owned(who, one)) && projectAllowed(who.name, one.repo));
|
|
108
112
|
return checked(ctx, 200, "termState", {
|
|
109
113
|
available: deps.host !== null, problem: deps.host === null ? deps.problem ?? "Terminals aren't available on this install." : null,
|
|
110
114
|
programs: [...TERMINAL_PROGRAMS],
|
|
@@ -117,16 +121,16 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
117
121
|
const family = runtime.familyOf(taskId);
|
|
118
122
|
if (family === null || family.problem !== null)
|
|
119
123
|
return "No such task.";
|
|
120
|
-
const run =
|
|
124
|
+
const run = takeOverRunsOf(store, family).filter(one => runtime.runVisible(one)).find(one => one.id === runId) ?? null;
|
|
121
125
|
if (run === null)
|
|
122
126
|
return SHELL_NO_RESULT;
|
|
123
|
-
const revision = run
|
|
124
|
-
if (revision === null
|
|
127
|
+
const revision = takeOverRevisionOf(run);
|
|
128
|
+
if (revision === null)
|
|
125
129
|
return SHELL_NO_COMMIT;
|
|
126
130
|
const repo = runtime.taskRepoOf(run.taskRef);
|
|
127
131
|
if (repo === null)
|
|
128
132
|
return "This build's project isn't known here.";
|
|
129
|
-
return { repo, revision };
|
|
133
|
+
return { repo, revision, run, family };
|
|
130
134
|
};
|
|
131
135
|
async function start(ctx) {
|
|
132
136
|
const answer = (status, value) => checked(ctx, status, "termStarted", value);
|
|
@@ -139,7 +143,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
139
143
|
return answer(400, { ok: false, error: "Submit one value for each field." });
|
|
140
144
|
const program = body.get("program") ?? "";
|
|
141
145
|
if (!TERMINAL_PROGRAMS.includes(program))
|
|
142
|
-
return answer(400, { ok: false, error: "Choose Claude Code, Codex or a shell." });
|
|
146
|
+
return answer(400, { ok: false, error: "Choose Claude Code, Codex, Antigravity or a shell." });
|
|
143
147
|
const taskField = body.get("task"), runField = body.get("run");
|
|
144
148
|
if ((taskField === null) !== (runField === null))
|
|
145
149
|
return answer(400, { ok: false, error: "Name the task and its build." });
|
|
@@ -150,7 +154,12 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
150
154
|
const found = takeOverOf(taskField, Number(runField));
|
|
151
155
|
if (typeof found === "string")
|
|
152
156
|
return answer(404, { ok: false, error: found });
|
|
153
|
-
from = {
|
|
157
|
+
from = {
|
|
158
|
+
revision: found.revision,
|
|
159
|
+
task: taskField,
|
|
160
|
+
run: Number(runField),
|
|
161
|
+
...(program === "shell" ? {} : { prompt: takeOverPromptOf(store, found.family, found.run) }),
|
|
162
|
+
};
|
|
154
163
|
repo = found.repo;
|
|
155
164
|
}
|
|
156
165
|
else
|
|
@@ -221,7 +230,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
221
230
|
return answer(409, { ok: false, error: kind === "sign-in" ? "This agent signs in another way: its screen says how." : "Toolroll doesn't run this agent's installer: run the command shown in your own terminal." });
|
|
222
231
|
if (kind === "install" && body.get("confirm") !== shown)
|
|
223
232
|
return answer(409, { ok: false, error: "Confirm the exact install command first." });
|
|
224
|
-
if (agentId === "claude" || agentId === "codex") {
|
|
233
|
+
if (agentId === "claude" || agentId === "codex" || agentId === "antigravity") {
|
|
225
234
|
const stopped = store.sessionPolicyRefusal(agentId, null, "live terminals");
|
|
226
235
|
if (stopped !== null)
|
|
227
236
|
return answer(403, { ok: false, error: stopped });
|
|
@@ -304,6 +313,8 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
304
313
|
catch { }
|
|
305
314
|
socket.destroy();
|
|
306
315
|
};
|
|
316
|
+
const attachable = (who, terminal, request) => (who.authority === "full" && terminal !== null && terminal.agent === null && terminal.localGeneration === null && projectAllowed(who.name, terminal.repo))
|
|
317
|
+
|| reachable(who, terminal, request);
|
|
307
318
|
function upgrade(request, socket, head) {
|
|
308
319
|
let url;
|
|
309
320
|
try {
|
|
@@ -335,6 +346,33 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
335
346
|
refuseUpgrade(socket, 403, "Open the console over HTTPS to use a terminal from here.");
|
|
336
347
|
return true;
|
|
337
348
|
}
|
|
349
|
+
if (isRemoteTerminalRequest(request)) {
|
|
350
|
+
const identified = runtime.identify(request, false, true);
|
|
351
|
+
const principal = identified?.via === "bearer" ? identified.principal : undefined;
|
|
352
|
+
const admitted = admitRemoteTerminalRequest(request, store, principal, runtime.clock);
|
|
353
|
+
if (!admitted.ok) {
|
|
354
|
+
refuseUpgrade(socket, admitted.status, `Remote terminal rejected (${admitted.error}).`);
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
const account = store.accountOf(principal.account);
|
|
358
|
+
if (admitted.scope !== "act" || account === null || account.revokedAt !== null || account.role !== "approver"
|
|
359
|
+
|| store.isDemo() || !codingActorAllowed({ name: principal.account, generation: principal.generation })) {
|
|
360
|
+
refuseUpgrade(socket, 403, "Attaching to a remote terminal requires an approver act API token.");
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
const terminal = deps.host?.get(id) ?? null;
|
|
364
|
+
if (terminal === null || terminal.agent !== null || terminal.localGeneration !== null
|
|
365
|
+
|| !projectAllowed(principal.account, terminal.repo) || !remoteAllows(store, principal, terminal.repo)) {
|
|
366
|
+
refuseUpgrade(socket, 404, "No such terminal.");
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
if (deps.host.viewerCount(id) >= MAX_VIEWERS) {
|
|
370
|
+
refuseUpgrade(socket, 429, `This terminal is open in ${MAX_VIEWERS} places already.`);
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
wss.handleUpgrade(request, socket, head, ws => attachRemote(ws, request, principal, terminal));
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
338
376
|
const expected = deps.publicOrigin !== null && host === deps.publicOrigin.host ? deps.publicOrigin.origin : `${transport.https ? "https" : "http"}://${host}`;
|
|
339
377
|
if (request.headers.origin !== expected) {
|
|
340
378
|
refuseUpgrade(socket, 403, "A terminal opens only from this console's own page.");
|
|
@@ -355,7 +393,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
355
393
|
return true;
|
|
356
394
|
}
|
|
357
395
|
const terminal = deps.host?.get(id) ?? null;
|
|
358
|
-
if (!
|
|
396
|
+
if (!attachable(who, terminal, request)) {
|
|
359
397
|
refuseUpgrade(socket, 404, "No such terminal.");
|
|
360
398
|
return true;
|
|
361
399
|
}
|
|
@@ -387,7 +425,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
387
425
|
};
|
|
388
426
|
const prove = () => {
|
|
389
427
|
const again = rereadBrowser(runtime, request, who);
|
|
390
|
-
const ok = again !== null && operatorOf(again) !== null &&
|
|
428
|
+
const ok = again !== null && operatorOf(again) !== null && attachable(again, host.get(terminal.id), request);
|
|
391
429
|
if (ok)
|
|
392
430
|
provedAt = Date.now();
|
|
393
431
|
return ok;
|
|
@@ -396,6 +434,7 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
396
434
|
shut(4401, "signed out"); };
|
|
397
435
|
const stillProved = () => Date.now() - provedAt < REPROVE_MS || prove();
|
|
398
436
|
const viewer = {
|
|
437
|
+
actor: who.name,
|
|
399
438
|
output(data) {
|
|
400
439
|
if (closed)
|
|
401
440
|
return;
|
|
@@ -426,6 +465,17 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
426
465
|
const frame = parseTerminalFrame(text);
|
|
427
466
|
if (frame === null)
|
|
428
467
|
return shut(1003, "not a terminal frame");
|
|
468
|
+
if (frame.t === "take-control") {
|
|
469
|
+
if (host.takeControl(terminal.id, viewer))
|
|
470
|
+
record("take-control", who.name, terminal);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (frame.t === "release-control") {
|
|
474
|
+
host.releaseControl(terminal.id, viewer);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
if (!host.isController(terminal.id, viewer))
|
|
478
|
+
return;
|
|
429
479
|
if (frame.t === "resize")
|
|
430
480
|
return host.resize(terminal.id, frame.cols, frame.rows);
|
|
431
481
|
const now = Date.now();
|
|
@@ -451,6 +501,110 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
451
501
|
reprovers.add(reprove);
|
|
452
502
|
record("attach", who.name, terminal);
|
|
453
503
|
}
|
|
504
|
+
function attachRemote(ws, request, principal, terminal) {
|
|
505
|
+
const host = deps.host;
|
|
506
|
+
sockets.add(ws);
|
|
507
|
+
let provedAt = 0, closed = false, detach = null;
|
|
508
|
+
let budget = INPUT_BURST, filledAt = Date.now();
|
|
509
|
+
const shut = (code, reason) => {
|
|
510
|
+
if (closed)
|
|
511
|
+
return;
|
|
512
|
+
closed = true;
|
|
513
|
+
detach?.();
|
|
514
|
+
reprovers.delete(reprove);
|
|
515
|
+
try {
|
|
516
|
+
ws.close(code, reason);
|
|
517
|
+
}
|
|
518
|
+
catch {
|
|
519
|
+
ws.terminate();
|
|
520
|
+
}
|
|
521
|
+
setTimeout(() => ws.terminate(), 2_000).unref?.();
|
|
522
|
+
};
|
|
523
|
+
const prove = () => {
|
|
524
|
+
const admitted = admitRemoteTerminalRequest(request, store, principal, runtime.clock);
|
|
525
|
+
const live = reproveRemote(store, principal, runtime.clock());
|
|
526
|
+
const account = store.accountOf(principal.account);
|
|
527
|
+
const current = host.get(terminal.id);
|
|
528
|
+
const ok = admitted.ok && admitted.scope === "act" && live.ok && live.scope === "act"
|
|
529
|
+
&& account !== null && account.revokedAt === null && account.role === "approver"
|
|
530
|
+
&& !store.isDemo() && codingActorAllowed({ name: principal.account, generation: principal.generation })
|
|
531
|
+
&& current !== null && current.agent === null && current.localGeneration === null
|
|
532
|
+
&& projectAllowed(principal.account, current.repo) && remoteAllows(store, principal, current.repo);
|
|
533
|
+
if (ok)
|
|
534
|
+
provedAt = Date.now();
|
|
535
|
+
return ok;
|
|
536
|
+
};
|
|
537
|
+
const reprove = () => { if (!closed && !prove())
|
|
538
|
+
shut(4401, "signed out"); };
|
|
539
|
+
const stillProved = () => Date.now() - provedAt < REPROVE_MS || prove();
|
|
540
|
+
const viewer = {
|
|
541
|
+
actor: principal.account,
|
|
542
|
+
output(data) {
|
|
543
|
+
if (closed)
|
|
544
|
+
return;
|
|
545
|
+
if (!stillProved())
|
|
546
|
+
return shut(4401, "signed out");
|
|
547
|
+
if (ws.bufferedAmount > BEHIND_BYTES)
|
|
548
|
+
return shut(4008, "fell behind");
|
|
549
|
+
ws.send(data, { binary: true });
|
|
550
|
+
},
|
|
551
|
+
control(message) {
|
|
552
|
+
if (closed)
|
|
553
|
+
return;
|
|
554
|
+
if (!stillProved())
|
|
555
|
+
return shut(4401, "signed out");
|
|
556
|
+
ws.send(JSON.stringify(message));
|
|
557
|
+
},
|
|
558
|
+
backlog: () => closed ? 0 : ws.bufferedAmount,
|
|
559
|
+
overflow: () => shut(4008, "fell behind"),
|
|
560
|
+
};
|
|
561
|
+
ws.on("message", (data, isBinary) => {
|
|
562
|
+
if (closed)
|
|
563
|
+
return;
|
|
564
|
+
if (isBinary)
|
|
565
|
+
return shut(1003, "text frames only");
|
|
566
|
+
if (!prove())
|
|
567
|
+
return shut(4401, "signed out");
|
|
568
|
+
const text = Array.isArray(data) ? Buffer.concat(data).toString("utf8") : Buffer.from(data).toString("utf8");
|
|
569
|
+
const frame = parseTerminalFrame(text);
|
|
570
|
+
if (frame === null)
|
|
571
|
+
return shut(1003, "not a terminal frame");
|
|
572
|
+
if (frame.t === "take-control") {
|
|
573
|
+
if (host.takeControl(terminal.id, viewer))
|
|
574
|
+
record("take-control", principal.account, terminal);
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
if (frame.t === "release-control") {
|
|
578
|
+
host.releaseControl(terminal.id, viewer);
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
if (!host.isController(terminal.id, viewer))
|
|
582
|
+
return;
|
|
583
|
+
if (frame.t === "resize")
|
|
584
|
+
return host.resize(terminal.id, frame.cols, frame.rows);
|
|
585
|
+
const now = Date.now();
|
|
586
|
+
budget = Math.min(INPUT_BURST, budget + ((now - filledAt) / 1000) * INPUT_PER_SECOND);
|
|
587
|
+
filledAt = now;
|
|
588
|
+
const size = Buffer.byteLength(frame.d);
|
|
589
|
+
if (size > budget)
|
|
590
|
+
return shut(1008, "typing faster than a terminal reads");
|
|
591
|
+
budget -= size;
|
|
592
|
+
if (!host.input(terminal.id, frame.d))
|
|
593
|
+
ws.send(JSON.stringify({ t: "input-full" }));
|
|
594
|
+
});
|
|
595
|
+
ws.on("close", () => { closed = true; detach?.(); reprovers.delete(reprove); sockets.delete(ws); });
|
|
596
|
+
ws.on("error", () => shut(1011, "socket error"));
|
|
597
|
+
if (!prove())
|
|
598
|
+
return shut(4401, "signed out");
|
|
599
|
+
try {
|
|
600
|
+
detach = host.attach(terminal.id, viewer);
|
|
601
|
+
}
|
|
602
|
+
catch (error) {
|
|
603
|
+
return shut(error instanceof TerminalError && /open in/.test(error.message) ? 4429 : 4404, "unavailable");
|
|
604
|
+
}
|
|
605
|
+
reprovers.add(reprove);
|
|
606
|
+
record("attach-remote", principal.account, terminal);
|
|
607
|
+
}
|
|
454
608
|
deps.host?.alsoBuildWritable?.(runtime.consoleProjects);
|
|
455
609
|
deps.server.on("upgrade", (request, socket, head) => {
|
|
456
610
|
if (!upgrade(request, socket, head))
|
|
@@ -485,3 +639,23 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
485
639
|
},
|
|
486
640
|
};
|
|
487
641
|
}
|
|
642
|
+
function takeOverPromptOf(store, family, run) {
|
|
643
|
+
const lines = [`Task: ${family.root.title}`];
|
|
644
|
+
const goal = store.getScope(family.current.id)?.goal?.trim() ?? "";
|
|
645
|
+
if (goal !== "" && goal !== family.root.title.trim())
|
|
646
|
+
lines.push(`Goal: ${goal.slice(0, 400)}`);
|
|
647
|
+
if (run.finishedAt === null) {
|
|
648
|
+
lines.push("Status: background build is still running; you are on an isolated copy of its commit.");
|
|
649
|
+
}
|
|
650
|
+
else if (run.outcome === "failed" || run.outcome === "refused") {
|
|
651
|
+
lines.push(`Last build failed: ${failedAttemptSentence(run.reason)}`);
|
|
652
|
+
const said = agentSaidOf(store, run.id);
|
|
653
|
+
if (said !== null && said.length > 0)
|
|
654
|
+
lines.push(`Last output:\n${said.slice(-4).join("\n")}`);
|
|
655
|
+
}
|
|
656
|
+
else if (run.headRevision !== null) {
|
|
657
|
+
lines.push("Status: inspecting saved build changes on an isolated copy of its commit.");
|
|
658
|
+
}
|
|
659
|
+
lines.push("Help inspect what happened and take it from here.");
|
|
660
|
+
return lines.join("\n").slice(0, 1200);
|
|
661
|
+
}
|
package/dist/settings-proofs.js
CHANGED
|
@@ -69,7 +69,7 @@ export const PROOF_INVENTORY = [
|
|
|
69
69
|
{ id: "sign-in", action: "Change sign-in (SSO)", routes: ["/settings/sign-in"], form: "signIn", field: "password", proof: "credential", when: "every action except Test", ...CREDENTIAL, role: "operator", secrets: ["client-secret"], terms: [] },
|
|
70
70
|
{ id: "project-flexible", action: "Turn on Flexible", routes: ["/settings/project/flexible"], form: "projectFlexible", field: "password", proof: "credential", when: "only to turn it on (lowering and turning off need nothing)", ...CREDENTIAL, role: "approver", handlerRole: "an approver of the project", secrets: [], terms: ["repo", "action", "digest"], note: "`digest` is the terms the page showed; the handler rebuilds them and refuses a difference" },
|
|
71
71
|
{ id: "release-approval", action: "Approve releases automatically", routes: ["/settings/release-approval"], form: "releaseApproval", field: "password", proof: "credential", when: "only to approve automatically (Ask me needs nothing)", ...CREDENTIAL, role: "approver", handlerRole: "an approver of the project", secrets: [], terms: ["repo"] },
|
|
72
|
-
{ id: "project-network", action: "Change what builds may reach", routes: ["/settings/project/network"], form: "projectNetwork", field: "password", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: ["repo"] },
|
|
72
|
+
{ id: "project-network", action: "Change what builds may reach", routes: ["/settings/project/network"], form: "projectNetwork", field: "password", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: ["repo", "request", "digest"], note: "with `request`, an agent's request: `digest` is the terms the page showed; the handler rebuilds them from the setting now and refuses a difference" },
|
|
73
73
|
{ id: "project-fallback", action: "Change a project's fallback agents", routes: ["/settings/project/fallback"], form: "projectFallback", field: "password", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: [] },
|
|
74
74
|
{ id: "project-writes", action: "Change where builds may write", routes: ["/settings/project/writes"], form: "projectWrites", field: "password", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: ["repo"] },
|
|
75
75
|
{ id: "project-sandbox", action: "Change a project's sandbox", routes: ["/settings/project/sandbox"], form: "projectSandbox", field: "password", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: ["repo"] },
|