toolroll 0.9.109 → 0.9.111
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 +73 -0
- package/README.md +5 -1
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/agent-detect.js +244 -0
- package/dist/agent-fence.js +12 -1
- package/dist/agent-said-schema.js +4 -0
- package/dist/agent-said.js +23 -0
- package/dist/agentconfig.js +2 -2
- package/dist/approval-summary.js +375 -0
- package/dist/attest.js +2 -2
- package/dist/browser/THIRD_PARTY_NOTICES.txt +30 -0
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +27 -27
- package/dist/builder.js +42 -3
- package/dist/chat-actions.js +24 -17
- package/dist/chat-core.js +3 -1
- package/dist/chat-decide.js +101 -46
- 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-task-actions.js +6 -0
- package/dist/check-report.js +1 -1
- package/dist/claim.js +28 -13
- package/dist/cli-help.js +1 -1
- package/dist/cli.js +2 -0
- package/dist/codex-limits.js +21 -8
- package/dist/console-instance.js +11 -1
- package/dist/contracts/console-api.js +13 -7
- package/dist/contracts/engine-api.js +283 -0
- package/dist/contracts/route.js +1 -0
- package/dist/coordinator.js +2 -2
- package/dist/discord-api.js +4 -3
- package/dist/discord-chat.js +3 -1
- package/dist/dispatch.js +1 -1
- package/dist/dispose.js +15 -9
- package/dist/easy-start-args.js +7 -3
- package/dist/easy-start.js +40 -1
- package/dist/egress.js +72 -10
- package/dist/engine-handoff.js +34 -0
- package/dist/engine-reads.js +338 -0
- package/dist/eval-world.js +3 -2
- package/dist/evidence.js +2 -0
- package/dist/fast-start.js +68 -18
- 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-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-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.js +175 -25
- package/dist/flexible-turns-schema.js +69 -0
- package/dist/flexible-turns.js +490 -0
- package/dist/flexible.js +10 -1
- 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 +6 -3
- package/dist/install-mode.js +225 -0
- package/dist/integrations.js +6 -1
- package/dist/lead-doors.js +7 -1
- package/dist/limits-ui.js +7 -0
- package/dist/live-reply.js +6 -0
- package/dist/live-terminal.js +425 -29
- package/dist/local-owner.js +7 -0
- package/dist/model-choices.js +12 -6
- package/dist/needs-you.js +2 -0
- package/dist/notification-delivery.js +11 -0
- package/dist/operate.js +128 -37
- package/dist/outbound-privacy.js +204 -0
- package/dist/passwordless.js +2 -1
- package/dist/phase-routing.js +3 -1
- package/dist/plane-review.js +1 -1
- package/dist/project-delete.js +14 -0
- package/dist/proposal.js +2 -2
- package/dist/provider-connection.js +19 -5
- 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 +10 -1
- package/dist/route-store.js +3 -3
- 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 +62 -13
- package/dist/server/chrome.js +3 -1
- 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/http.js +7 -0
- package/dist/server/link-redemption.js +52 -0
- package/dist/server/mutation-key.js +21 -7
- package/dist/server/pages.js +72 -40
- package/dist/server/people-tokens.js +17 -41
- package/dist/server/render-chat.js +1 -0
- package/dist/server/render-new-task.js +3 -3
- package/dist/server/render-results.js +4 -4
- package/dist/server/render-tasks.js +133 -139
- package/dist/server/route-table.js +32 -1
- package/dist/server/settings-section-table.js +6 -0
- package/dist/server/settings-sections.js +69 -0
- package/dist/server/settings.js +120 -10
- package/dist/server/task-views.js +8 -2
- package/dist/server/tasks.js +56 -12
- package/dist/server/terminals.js +181 -28
- package/dist/server/welcome.js +35 -10
- package/dist/settings-groups-ui.js +2 -2
- package/dist/settings-proofs.js +14 -9
- package/dist/slack-api.js +4 -3
- package/dist/slack-chat.js +5 -3
- package/dist/spend.js +46 -12
- package/dist/status-probe.js +343 -0
- package/dist/store.js +181 -12
- package/dist/task-sizing-schema.js +14 -0
- package/dist/task-sizing.js +76 -10
- 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/toolroll-update.js +3 -1
- 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 +1 -1
- package/dist/webhooks.js +14 -4
- package/dist/welcome-facts.js +22 -15
- package/dist/work-index.js +2 -2
- package/dist/workspace-ui.js +5 -0
- package/package.json +1 -1
- package/scripts/crash-canary.mjs +1 -1
- package/scripts/pilot.mjs +1 -1
- package/scripts/provider-canary.mjs +5 -3
|
@@ -3,7 +3,7 @@ import { btn, stepRows } from "./kit.js";
|
|
|
3
3
|
import { whenUtc } from "../when-html.js";
|
|
4
4
|
import { networkWords } from "../egress.js";
|
|
5
5
|
import { wasInterrupted } from "../run-ending.js";
|
|
6
|
-
import {
|
|
6
|
+
import { liveChainFromJson, releaseAsksAgainWords, releaseCheckSentence, releaseTermsSentence } from "../scope.js";
|
|
7
7
|
import { SUBSCRIPTION_CAPABLE } from "../keys.js";
|
|
8
8
|
import { RELEASE_CI_RUNNING_WORDS } from "../release-ci-hold.js";
|
|
9
9
|
import { writesWords } from "../writes-mode.js";
|
|
@@ -15,6 +15,7 @@ import { closedQuestionReason, closedQuestionWords } from "../decision.js";
|
|
|
15
15
|
import {} from "../activity-line.js";
|
|
16
16
|
import {} from "../agentconfig.js";
|
|
17
17
|
import { gateWords } from "../approval-policy.js";
|
|
18
|
+
import { approvalSummaryOf, EVIDENCE_WORDS, REPAIR_BRIEF, revisionWords } from "../approval-summary.js";
|
|
18
19
|
import { assignmentCardOf, assignmentStatusOf, assignmentSummaryHtml } from "../assignment-ui.js";
|
|
19
20
|
import {} from "../assignment.js";
|
|
20
21
|
import { holdOwnerWords } from "../board.js";
|
|
@@ -31,7 +32,7 @@ import {} from "../gaps.js";
|
|
|
31
32
|
import { readAuthModeStrict } from "../keys.js";
|
|
32
33
|
import { failedAttemptSentence, retryNoteOf, START_BUILDER_COMMAND, startBuilderHref, STORAGE_HOLD_PREFIX } from "../needs-you.js";
|
|
33
34
|
import { planVersionWords } from "../plain-words.js";
|
|
34
|
-
import { chosenWords,
|
|
35
|
+
import { chosenWords, PHASES as ROUTE_PHASES, TASK_SIZES } from "../phase-routing.js";
|
|
35
36
|
import { parseExecutionPlanDocument } from "../plan.js";
|
|
36
37
|
import {} from "../planner-source.js";
|
|
37
38
|
import { projectName } from "../project.js";
|
|
@@ -222,8 +223,9 @@ export function approvalSheetHtml(input) {
|
|
|
222
223
|
]);
|
|
223
224
|
}
|
|
224
225
|
export function approvalSheetParts(input) {
|
|
225
|
-
const { scope
|
|
226
|
-
const repairText =
|
|
226
|
+
const { scope } = input;
|
|
227
|
+
const repairText = REPAIR_BRIEF.exec(scope.goal);
|
|
228
|
+
const summary = input.summary ?? approvalSummaryOf(scope);
|
|
227
229
|
const goalShown = repairText === null ? scope.goal : scope.goal.slice(0, repairText.index);
|
|
228
230
|
const statementsOf = (ids) => ids.split(",").map(id => id.trim()).map(id => scope.acceptance.find(one => one.id === id)?.statement ?? id).map(one => one.replace(/[.\s]+$/, "")).join("; ");
|
|
229
231
|
const repairBuild = input.revision?.sourceRun ?? input.repairChain?.sourceRun ?? null;
|
|
@@ -235,58 +237,28 @@ export function approvalSheetParts(input) {
|
|
|
235
237
|
: `Fixes the checks that failed in ${builtBy}.`;
|
|
236
238
|
const plan = input.planDocument === null ? null : parseExecutionPlanDocument(input.planDocument);
|
|
237
239
|
const milestones = plan !== null && plan.ok ? plan.document.milestones : [];
|
|
238
|
-
const permission = permissionWordsOf(scope.profile);
|
|
239
240
|
const money = (micro) => `$${(micro / 1_000_000).toFixed(2)}`;
|
|
240
241
|
const row = (label, body) => html `<div class="approval-row"><dt>${label}</dt><dd>${body}</dd></div>`;
|
|
241
|
-
const changes = joinHtml([
|
|
242
|
-
milestones.length > 0 ? html `<ol class="approval-steps">${milestones.map(one => html `<li>${one}</li>`)}</ol>` : "",
|
|
243
|
-
scope.touches.length > 0
|
|
244
|
-
? html `<p>Only in these paths:</p>${approvalPathsHtml(scope.touches)}`
|
|
245
|
-
: html `<p${milestones.length > 0 ? html ` class="meta"` : ""}>Any file in the project.</p>`,
|
|
246
|
-
]);
|
|
247
242
|
const doneWhen = scope.acceptance.length === 0
|
|
248
243
|
? html `<p>You decide when you review the result.</p>`
|
|
249
|
-
: html `<ul class="approval-done">${scope.acceptance.map(one => html `<li>${one.statement}</li>`)}</ul>`;
|
|
250
|
-
const legs = route?.projection?.legs ?? [];
|
|
251
|
-
const legOf = (phase) => legs.find(one => one.phase === phase);
|
|
252
|
-
const who = [];
|
|
253
|
-
const builder = legOf("build");
|
|
254
|
-
if (builder !== undefined)
|
|
255
|
-
who.push(`Builder ${agentNameWords(builder.provider, builder.model)}`);
|
|
256
|
-
else if (route?.legacy != null)
|
|
257
|
-
who.push(`Builder ${agentNameWords(route.legacy.provider, route.legacy.model)}`);
|
|
258
|
-
else if (scope.profile != null)
|
|
259
|
-
who.push(`Builder ${agentNameWords(scope.profile.provider, scope.profile.model)}`);
|
|
260
|
-
const planner = legOf("plan");
|
|
261
|
-
const sized = route?.projection?.size ?? null;
|
|
262
|
-
const unplanned = route?.projection != null && makesNoPlan(sized, route.projection.risk) && planner?.chosen === "recommended";
|
|
263
|
-
if (planner !== undefined && !unplanned)
|
|
264
|
-
who.push(`Planner ${agentNameWords(planner.provider, planner.model)}`);
|
|
244
|
+
: html `<ul class="approval-done">${scope.acceptance.map(one => html `<li>${one.statement} <span class="meta">${one.evidence.map(kind => EVIDENCE_SHEET[kind] ?? kind).join(" · ")}</span></li>`)}</ul>`;
|
|
265
245
|
const allowing = [];
|
|
266
246
|
const warnings = [];
|
|
267
247
|
const allowed = permissionPlainWords(scope.profile);
|
|
268
248
|
if (allowed !== null)
|
|
269
249
|
allowing.push(allowed);
|
|
270
250
|
allowing.push(scope.budgetMicrousd === null ? "no attempt limit" : `up to ${money(scope.budgetMicrousd)} per attempt`);
|
|
271
|
-
const chain = chainTermsLines(scope);
|
|
272
251
|
const fallbacks = liveChainFromJson(scope.proposedChainJson ?? null)?.slice(1) ?? [];
|
|
273
252
|
if (fallbacks.length > 0) {
|
|
274
253
|
const paid = fallbacks.filter(one => one.authMode === "api-key" || SUBSCRIPTION_CAPABLE[one.profile.provider] !== true);
|
|
275
254
|
const clause = `if it runs out of its plan, the work moves to ${fallbacks.map(one => `${agentNameWords(one.profile.provider, one.profile.model)}${paid.includes(one) ? " on an API key, which spends money" : ""}`).join(", then ")}`;
|
|
276
255
|
allowing.push(clause);
|
|
277
|
-
if (paid.length > 0)
|
|
278
|
-
warnings.push(clause);
|
|
279
256
|
}
|
|
280
257
|
const earlier = earlierVersionsWords(input.earlier.active, input.earlier.running);
|
|
281
258
|
if (earlier !== null) {
|
|
282
259
|
allowing.push(earlier);
|
|
283
260
|
warnings.push(earlier);
|
|
284
261
|
}
|
|
285
|
-
const yoursToCheck = scope.acceptance.filter(one => one.evidence.includes("manual-review")).map(one => one.statement.trim().replace(/[.\s]+$/, ""));
|
|
286
|
-
const consent = joinHtml([
|
|
287
|
-
allowing.length === 0 ? "" : html `<p class="approval-allowing" data-approval-allowing>You’re allowing: ${allowing.join(" · ")}</p>`,
|
|
288
|
-
yoursToCheck.length === 0 ? "" : html `<p class="approval-you-check" data-approval-you-check>You’ll check: ${yoursToCheck.join("; ")}</p>`,
|
|
289
|
-
]);
|
|
290
262
|
const rebuild = input.rebuild ?? null;
|
|
291
263
|
const after = rebuild !== null
|
|
292
264
|
? html `Build #${rebuild} was made to the earlier plan. Approving builds it again to this one.`
|
|
@@ -295,14 +267,15 @@ export function approvalSheetParts(input) {
|
|
|
295
267
|
: html `An agent starts in its own branch. You'll hear when it's ready to review.`;
|
|
296
268
|
const submit = rebuild !== null ? html `Approve and retry` : html `Approve`;
|
|
297
269
|
const detail = (title, body, attrs = html ``) => isEmptyHtml(body) ? html `` : html `<section class="approval-detail"${attrs}><h3>${title}</h3>${body}</section>`;
|
|
298
|
-
const
|
|
270
|
+
const revisionBodyOf = (sentenceToo) => input.revision === null ? html `` : joinHtml([
|
|
299
271
|
html `<div class="revision-card" data-revision-feedback>`,
|
|
300
272
|
html `<p><a href="${input.revisionSourceHref}"${input.surface === "chat" ? html ` data-revision-source` : ""}>${input.surface === "chat" ? html `Original result: build #${input.revision.sourceRun} →` : html `build #${input.revision.sourceRun}`}</a></p>`,
|
|
301
273
|
input.revision.comments.length === 0 ? "" : html `<ul>${input.revision.comments.map(one => html `<li>${revisionImageLink(one.image)}${one.path === null ? "" : html `<span class="mono">${one.path}${one.line === null ? "" : `:${one.line}`}</span> · `}${one.note} <span class="meta">— ${one.author}</span></li>`)}</ul>`,
|
|
302
|
-
|
|
274
|
+
!sentenceToo || summary.revision === null ? "" : html `<p data-revision-plain>${summary.revision}</p>`,
|
|
303
275
|
html `</div>`,
|
|
304
276
|
]);
|
|
305
|
-
const
|
|
277
|
+
const revisionBody = revisionBodyOf(true);
|
|
278
|
+
const revisionDetail = input.revision === null ? "" : detail("Earlier build", revisionBodyOf(false));
|
|
306
279
|
const contract = input.planContract;
|
|
307
280
|
const amendment = approvalAmendmentHtml(contract);
|
|
308
281
|
const contractDetail = input.planDocument === null || !isEmptyHtml(amendment) ? html ``
|
|
@@ -312,32 +285,12 @@ export function approvalSheetParts(input) {
|
|
|
312
285
|
: html `<p class="meta">${contract.revision === true ? "Same terms as the previous version." : "The plan keeps exactly what you filed."} <a href="/r/${contract.run}">Planner's record</a></p>`;
|
|
313
286
|
const criteriaDetail = scope.acceptance.length === 0 ? html ``
|
|
314
287
|
: html `<ul class="approval-signed-criteria">${scope.acceptance.map(one => html `<li><code>${one.id}</code> ${one.statement} <span class="meta">shown by ${one.evidence.map(kind => EVIDENCE_PLAIN[kind] ?? kind).join(", ")}</span></li>`)}</ul>`;
|
|
315
|
-
const projection = route?.projection ?? null;
|
|
316
|
-
const agentsDetail = route === null || route === undefined ? html ``
|
|
317
|
-
: projection === null
|
|
318
|
-
? route.legacy === null ? html `` : html `<p>${agentsSummaryWords(route)}</p>`
|
|
319
|
-
: joinHtml([
|
|
320
|
-
html `<p>${projection.summary}</p>`,
|
|
321
|
-
html `<p class="meta">Uses ${projection.postureWords}.</p>`,
|
|
322
|
-
projection.demands.length === 0 ? "" : html `<ul class="meta">${projection.demands.map(one => html `<li>${one}</li>`)}</ul>`,
|
|
323
|
-
html `<dl class="approval-roles">${projection.legs.map(leg => html `<div><dt>${ROLE_NOUN[leg.phase]}</dt><dd><span class="mono">${leg.provider} · ${leg.model}</span> <span class="meta">${chosenWords(leg)}</span><ul>${leg.reasons.map(reason => html `<li>${reason}</li>`)}${leg.problem === null ? "" : html `<li><strong>${leg.problem}</strong></li>`}</ul></dd></div>`)}</dl>`,
|
|
324
|
-
html `<p class="meta">These exact agents are part of what you approve. Changing any of them asks for a fresh approval.</p>`,
|
|
325
|
-
]);
|
|
326
|
-
const limits = joinHtml([
|
|
327
|
-
profileWords(scope),
|
|
328
|
-
html `<p class="meta">Checks level: ${qualityModeTitle(scope.qualityMode ?? "default")}${permission === null ? "" : ` · ${permission}`}</p>`,
|
|
329
|
-
scope.budgetMicrousd === null ? "" : html `<p class="meta">Each build attempt has a ${money(scope.budgetMicrousd)} agent-reported usage cap. On a subscription this limits work; it is not an API charge.</p>`,
|
|
330
|
-
]);
|
|
331
288
|
const details = joinHtml([
|
|
332
289
|
html `<details class="approval-details"${input.surface === "task" ? html ` open` : ""}><summary>Plan details</summary>`,
|
|
333
290
|
revisionDetail,
|
|
334
|
-
repairText === null ? "" : detail("Full goal", html `<p>${scope.goal}</p>`),
|
|
335
291
|
detail("Plan record", contractDetail),
|
|
336
292
|
detail("Requirements", criteriaDetail),
|
|
337
|
-
detail("
|
|
338
|
-
detail("Runtime limits", limits),
|
|
339
|
-
scope.candidate ? detail("Saved commit", html `<p><code class="approval-commit">${scope.candidate}</code></p>`) : "",
|
|
340
|
-
detail("Plan version", html `<p class="meta">Approving agrees to exactly this plan. <span class="seal mono" title="${planVersionWords(scope.digest)}">${planVersionWords(scope.digest)}</span></p>`),
|
|
293
|
+
detail("Plan version", html `<p class="meta"><span class="seal mono" title="${planVersionWords(scope.digest)}">${planVersionWords(scope.digest)}</span></p>`),
|
|
341
294
|
html `</details>`,
|
|
342
295
|
]);
|
|
343
296
|
const passwordNote = input.surface === "task" ? "approval-password-note" : "chat-approval-password-note";
|
|
@@ -386,26 +339,30 @@ export function approvalSheetParts(input) {
|
|
|
386
339
|
input.deliverable === "report" ? html `<p class="approval-note">Read-only: it reports back and changes nothing in the repository.</p>` : "",
|
|
387
340
|
originNote(input.origin) === null ? "" : html `<p class="approval-note" data-approval-origin>${originNote(input.origin)}</p>`,
|
|
388
341
|
]);
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
|
|
342
|
+
const releaseRows = summary.decisions.filter(one => one.fields.includes("releaseTerms") || one.fields.includes("releaseCheck"));
|
|
343
|
+
const releaseBody = releaseRows.length === 0 ? "" : joinHtml([
|
|
344
|
+
...releaseRows.map(one => html `<p>${one.words}</p>`),
|
|
392
345
|
input.releaseCiRunning === true ? html `<p class="meta">${RELEASE_CI_RUNNING_WORDS}</p>` : "",
|
|
393
|
-
|
|
346
|
+
...releaseRows.map(one => (one.lines ?? []).length === 0 ? "" : one.fields.includes("releaseTerms") && scope.releaseTerms?.policy.carry === true
|
|
347
|
+
? html `<p class="plan-sheet-sub">What asks again</p><ul class="plan-sheet-list">${one.lines.map(line => html `<li>${line}</li>`)}</ul>`
|
|
348
|
+
: html `${one.lines.map(line => html `<p>${line}</p>`)}`),
|
|
394
349
|
]);
|
|
350
|
+
const termRow = (one) => one.label === "Done when" ? row("Done when", doneWhen)
|
|
351
|
+
: one.fields.includes("touches") && scope.touches.length > 0 ? row(one.label, html `<p>Only ${joinHtml(scope.touches.map(path => html `<code class="approval-path">${path}</code>`), ", ")}</p>`)
|
|
352
|
+
: row(one.label, html `<p>${one.words}</p>${(one.lines ?? []).length === 0 ? "" : html `<ul>${one.lines.map(line => html `<li>${line}</li>`)}</ul>`}`);
|
|
395
353
|
const rows = joinHtml([
|
|
396
|
-
html `<
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
354
|
+
summary.revision === null ? "" : html `<p class="approval-revision-plain" data-terms-revision>${summary.revision}</p>`,
|
|
355
|
+
summary.revisionChanges.length === 0 ? "" : html `<dl class="approval-rows" data-terms-revision-changes>${summary.revisionChanges.map(termRow)}</dl>`,
|
|
356
|
+
summaryWarningsHtml(summary),
|
|
357
|
+
html `<dl class="approval-rows" data-terms-summary>`,
|
|
358
|
+
...summary.decisions.filter(one => !one.fields.includes("releaseTerms") && !one.fields.includes("releaseCheck")).map(one => one.label === "Goal" ? row("Goal", html `<p class="approval-goal">${one.words}</p>`) : termRow(one)),
|
|
359
|
+
milestones.length === 0 ? "" : row("Steps", html `<ol class="approval-steps">${milestones.map(one => html `<li>${one}</li>`)}</ol>`),
|
|
401
360
|
releaseBody === "" ? "" : html `<div class="approval-row" data-approval-release><dt>Release</dt><dd>${releaseBody}</dd></div>`,
|
|
402
|
-
|
|
361
|
+
...summary.differs.map(termRow),
|
|
362
|
+
summary.why === null ? "" : row("Why this model", html `<p>${summary.why}</p>`),
|
|
403
363
|
html `</dl>`,
|
|
404
364
|
amendment,
|
|
405
|
-
|
|
406
|
-
who.length === 0 ? "" : html `<p class="approval-who">${who.join(" · ")}</p>`,
|
|
407
|
-
routeEvidenceHtml(route, "approval-evidence"),
|
|
408
|
-
consent,
|
|
365
|
+
summaryUsualHtml(summary),
|
|
409
366
|
]);
|
|
410
367
|
const parsedPlan = plan !== null && plan.ok ? plan.document : null;
|
|
411
368
|
const approach = parsedPlan?.approach.trim() ?? "";
|
|
@@ -421,45 +378,86 @@ export function approvalSheetParts(input) {
|
|
|
421
378
|
extraProof.length === 0 ? "" : html `<ul class="plan-sheet-done plan-sheet-proof">${extraProof.map(line => html `<li><span>${line}</span><span class="plan-sheet-how">From the plan</span></li>`)}</ul>`,
|
|
422
379
|
]);
|
|
423
380
|
const reportNote = input.deliverable === "report" ? html `<p class="approval-note">Read-only: it reports back and changes nothing in the repository.</p>` : "";
|
|
424
|
-
const
|
|
381
|
+
const revisionTail = "";
|
|
382
|
+
const fixes = (text) => /^[A-Z][a-z]/.test(text) ? `${text.charAt(0).toLowerCase()}${text.slice(1)}` : text;
|
|
383
|
+
const revisionLead = (() => {
|
|
384
|
+
const tail = revisionTail === "" ? "" : ` ${revisionTail}`;
|
|
385
|
+
if (sentence !== null) {
|
|
386
|
+
const missed = /^Fixes what (.+?) missed: ([\s\S]*)$/.exec(sentence);
|
|
387
|
+
if (missed !== null)
|
|
388
|
+
return `Revises ${missed[1]}: fixes ${fixes(missed[2])}${tail}`;
|
|
389
|
+
const checks = /^Fixes the checks that failed in (.+)\.$/.exec(sentence);
|
|
390
|
+
if (checks !== null)
|
|
391
|
+
return `Revises ${checks[1]}: fixes the checks that failed.${tail}`;
|
|
392
|
+
const shows = /^Shows what (.+?) couldn't show for: ([\s\S]*)$/.exec(sentence);
|
|
393
|
+
if (shows !== null)
|
|
394
|
+
return `Revises ${shows[1]}: shows what it couldn't show for: ${shows[2]}${tail}`;
|
|
395
|
+
const back = /^Sends back (.+)\.$/.exec(sentence);
|
|
396
|
+
if (back !== null)
|
|
397
|
+
return `Revises ${back[1]}.${tail}`;
|
|
398
|
+
return `${sentence}${tail}`;
|
|
399
|
+
}
|
|
400
|
+
return summary.revision === null ? null : summary.revision.replace(/^This revises ([^.]+\.).*$/s, "Revises $1");
|
|
401
|
+
})();
|
|
402
|
+
const revising = revisionLead !== null;
|
|
403
|
+
const briefText = repairText === null ? null : scope.goal.slice(repairText.index).replace(/^\s*—\s*/, "");
|
|
404
|
+
const briefShown = briefText === null ? null : briefText.replace(/\b(c\d+)\b/g, id => {
|
|
405
|
+
const named = scope.acceptance.find(one => one.id === id);
|
|
406
|
+
return named === undefined ? id : `${id} (“${named.statement.replace(/[.\s]+$/, "")}”)`;
|
|
407
|
+
});
|
|
408
|
+
const goalBody = joinHtml([
|
|
409
|
+
goalShown.trim() === sheetLead && !revising ? "" : html `<p class="approval-goal">${goalShown}</p>`,
|
|
410
|
+
briefShown === null ? "" : html `<p class="approval-goal plan-sheet-brief" data-plan-brief>${briefShown}</p>`,
|
|
411
|
+
], " ");
|
|
412
|
+
const comments = input.revision === null || input.revision.comments.length === 0 ? "" : revisionBodyOf(false);
|
|
413
|
+
const leadHtml = joinHtml([
|
|
414
|
+
html `<p class="${sheetLead.length > 180 ? "plan-sheet-lead plan-sheet-lead-long" : "plan-sheet-lead"}">${sheetLead}</p>`,
|
|
415
|
+
approachRest === "" ? "" : html `<p class="plan-sheet-text">${approachRest}</p>`,
|
|
416
|
+
]);
|
|
417
|
+
const unparsedHtml = plan !== null && !plan.ok
|
|
418
|
+
? html `<section class="plan-sheet-part" data-plan-unparsed><p class="plan-sheet-sub">This plan couldn’t be read as steps, so it is shown as written.</p><pre class="recap plan-doc">${input.planDocument ?? ""}</pre></section>` : html ``;
|
|
419
|
+
const stepsHtml = milestones.length === 0 ? html `` : part("Steps", html `<ol class="plan-sheet-steps">${milestones.map(one => html `<li><span>${one}</span></li>`)}</ol>`);
|
|
420
|
+
const riskyRows = [...summary.decisions.filter(one => one.risky === true && !one.fields.includes("releaseTerms") && !one.fields.includes("releaseCheck")), ...summary.differs];
|
|
421
|
+
const contractNote = contract === null || contract === undefined || "problem" in contract || !contract.filed && contract.revision !== true ? contractDetail : html ``;
|
|
422
|
+
const before = joinHtml([
|
|
423
|
+
amendment,
|
|
424
|
+
summaryWarningsHtml(summary),
|
|
425
|
+
...summary.revisionNotes.filter(one => summary.revisionChanges.length === 0 || !/ from that build: /.test(one)).map(one => html `<p data-plan-revision-note>${one}</p>`),
|
|
426
|
+
summary.revisionChanges.length === 0 ? "" : html `<dl class="approval-rows" data-plan-revision-changes>${summary.revisionChanges.map(termRow)}</dl>`,
|
|
427
|
+
...warnings.map(one => html `<p class="plan-sheet-warn" data-plan-warning>${one.charAt(0).toUpperCase()}${one.slice(1)}.</p>`),
|
|
428
|
+
riskyRows.length === 0 ? "" : html `<dl class="approval-rows" data-terms-risky>${riskyRows.map(termRow)}</dl>`,
|
|
429
|
+
(parsedPlan?.risks.length ?? 0) === 0 ? "" : html `<ul class="plan-sheet-list">${parsedPlan.risks.map(one => html `<li>${one}</li>`)}</ul>`,
|
|
430
|
+
(parsedPlan?.dependencies.length ?? 0) === 0 ? "" : html `<p class="plan-sheet-sub">Depends on</p><ul class="plan-sheet-list">${parsedPlan.dependencies.map(one => html `<li>${one}</li>`)}</ul>`,
|
|
431
|
+
input.planDocument === null || !isEmptyHtml(amendment) ? "" : contractNote,
|
|
432
|
+
]);
|
|
433
|
+
const record = contract !== null && contract !== undefined && !("problem" in contract) && (contract.filed || contract.revision === true) && isEmptyHtml(amendment)
|
|
434
|
+
? html ` · <a href="/r/${contract.run}">Planner’s record</a>` : html ``;
|
|
425
435
|
const sheet = joinHtml([
|
|
426
436
|
html `<article class="plan-sheet" data-plan-sheet aria-label="${input.deliverable === "report" ? "The investigation" : "The plan"}">`,
|
|
427
|
-
sentence === null ? "" : html `<p class="approval-revision">${sentence}</p>`,
|
|
428
437
|
input.coordinator === null ? "" : html `<p class="approval-note">An agent filed this: <span class="mono">${input.coordinator.label}</span>${input.coordinator.filedAgo === null ? "" : html `, ${input.coordinator.filedAgo}`}. Nothing runs until you approve, and approving runs its request.</p>`,
|
|
429
438
|
reportNote,
|
|
430
439
|
originNote(input.origin) === null ? "" : html `<p class="approval-note" data-plan-origin>${originNote(input.origin)}</p>`,
|
|
431
|
-
html `<
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
440
|
+
html `<section class="plan-group" data-plan-group="plan">`,
|
|
441
|
+
revisionLead === null ? "" : html `<p class="approval-revision plan-sheet-revision" data-plan-revision>${revisionLead}</p>`,
|
|
442
|
+
revising ? "" : leadHtml,
|
|
443
|
+
unparsedHtml,
|
|
444
|
+
part("Goal", goalBody),
|
|
445
|
+
comments === "" ? "" : part("Asked for changes", comments),
|
|
437
446
|
releaseBody === "" ? "" : part("Release", releaseBody, html ` data-plan-release`),
|
|
438
|
-
|
|
447
|
+
revising ? "" : stepsHtml,
|
|
439
448
|
part("Done when", doneWhenSheet),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
html
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
who.length === 0 ? "" : html `<p class="approval-who">${who.join(" · ")}</p>`,
|
|
453
|
-
routeEvidenceHtml(route, "approval-evidence"),
|
|
454
|
-
agentsDetail,
|
|
455
|
-
limits,
|
|
456
|
-
notAllowingWarnings.length === 0 ? "" : html `<p class="approval-allowing" data-plan-allowing>You’re allowing: ${notAllowingWarnings.join(" · ")}</p>`,
|
|
457
|
-
yoursToCheck.length === 0 ? "" : html `<p class="approval-you-check" data-plan-you-check>You’ll check: ${yoursToCheck.join("; ")}</p>`,
|
|
458
|
-
chain.length === 0 ? "" : html `<p>${chain[0]}</p><ol class="plan-sheet-list" data-plan-fallback>${chain.slice(1).map(one => html `<li>${one.replace(/^\d+\. /, "")}</li>`)}</ol>`,
|
|
459
|
-
])),
|
|
460
|
-
part("Plan record", contractDetail),
|
|
461
|
-
scope.candidate ? part("Saved commit", html `<p><code class="approval-commit">${scope.candidate}</code></p>`) : "",
|
|
462
|
-
part("Plan version", html `<p class="meta">Approving agrees to exactly this plan. <span class="seal mono" title="${planVersionWords(scope.digest)}">${planVersionWords(scope.digest)}</span></p>`),
|
|
449
|
+
revising && parsedPlan !== null && (!isEmptyHtml(leadHtml) || !isEmptyHtml(stepsHtml))
|
|
450
|
+
? html `<details class="plan-sheet-full" data-plan-full><summary>Full plan</summary>${leadHtml}${stepsHtml}</details>` : "",
|
|
451
|
+
html `</section>`,
|
|
452
|
+
isEmptyHtml(before) ? "" : html `<section class="plan-group plan-group-before" data-plan-group="before"><h3 class="plan-sheet-h">Before you approve</h3><div class="plan-notice">${before}</div></section>`,
|
|
453
|
+
html `<section class="plan-group" data-plan-group="may-do"><h3 class="plan-sheet-h">What it may do</h3>`,
|
|
454
|
+
html `<dl class="approval-rows" data-terms-summary>`,
|
|
455
|
+
...summary.decisions.filter(one => one.risky !== true && !one.fields.some(field => field === "goal" || field === "acceptance" || field === "releaseTerms" || field === "releaseCheck")).map(termRow),
|
|
456
|
+
summary.why === null ? "" : row("Why this model", html `<p>${summary.why}</p>`),
|
|
457
|
+
html `</dl>`,
|
|
458
|
+
summaryUsualHtml(summary),
|
|
459
|
+
html `<p class="plan-sheet-foot" data-plan-version>Plan version <span class="mono">${scope.digest.slice(0, 8)}</span>${record}</p>`,
|
|
460
|
+
html `</section>`,
|
|
463
461
|
html `</article>`,
|
|
464
462
|
]);
|
|
465
463
|
return { lead, rows, editor, editorForm, details, submit, label: rebuild !== null ? "Approve and retry" : "Approve", after, allowing, passwordNote, sheet, sheetLead };
|
|
@@ -467,7 +465,15 @@ export function approvalSheetParts(input) {
|
|
|
467
465
|
export function planSheetHtml(input) {
|
|
468
466
|
return approvalSheetParts(input).sheet;
|
|
469
467
|
}
|
|
470
|
-
export
|
|
468
|
+
export function summaryWarningsHtml(summary) {
|
|
469
|
+
return joinHtml(summary.warnings.map(one => html `<p class="plan-sheet-warn" data-terms-warning>${one.words}</p>`));
|
|
470
|
+
}
|
|
471
|
+
export function summaryUsualHtml(summary) {
|
|
472
|
+
if (summary.usual.length === 0)
|
|
473
|
+
return html ``;
|
|
474
|
+
return html `<details class="approval-details terms-usual" data-terms-usual><summary>${summary.usualSummary === "" ? summary.usualLabel : `${summary.usualLabel}: ${summary.usualSummary}`}</summary><dl class="approval-rows">${summary.usual.map(one => html `<div class="approval-row"><dt>${one.label}</dt><dd><p>${one.words}</p></dd></div>`)}</dl></details>`;
|
|
475
|
+
}
|
|
476
|
+
export const EVIDENCE_SHEET = Object.fromEntries(Object.entries(EVIDENCE_WORDS).map(([kind, words]) => [kind, `${words.charAt(0).toUpperCase()}${words.slice(1)}`]));
|
|
471
477
|
export function earlierVersionsWords(active, running) {
|
|
472
478
|
if (active <= 0)
|
|
473
479
|
return null;
|
|
@@ -574,7 +580,7 @@ export function profileWords(scope) {
|
|
|
574
580
|
? html `<p class="meta">Runs on <span class="mono">${ACP_AGENTS[profile.provider].name} (via ACP) · ${profile.model}</span> — full access inside Toolroll's sandbox; the agent runs any tool it chooses and nothing asks. No turn limit: stops after ${Math.round(profile.timeoutSeconds / 60)} min, or ${Math.round(profile.idleTimeoutSeconds / 60)} min silent; repairs on ${repair}, ${Math.round(profile.repairTimeoutSeconds / 60)} min, or ${Math.round(profile.repairIdleTimeoutSeconds / 60)} min silent.</p>`
|
|
575
581
|
: html `<p class="meta">Runs on <span class="mono">${profile.provider} · ${profile.model}</span> — ${profile.sandboxMode === "danger-full-access" ? "FULL permissions via --dangerously-bypass-approvals-and-sandbox; nothing asks" : "workspace-write sandbox"}, no turn limit (${Math.round(profile.timeoutSeconds / 60)} min ${profile.timeoutKind === "idle" ? "without progress" : "per attempt"}); repairs on ${repair}, ${Math.round(profile.repairTimeoutSeconds / 60)} min</p>`;
|
|
576
582
|
const terms = sandboxTermsWords(profile);
|
|
577
|
-
return html `${base}<p class="meta" data-scope-network>${networkWords(profile.network ?? null)}</p><p class="meta" data-scope-writes>Writes: ${writesWords(profile.writes)}.</p>${profile.checkAccess === undefined ? "" : html `<p class="meta" data-scope-checks>Checks: ${checkAccessWords(profile.checkAccess)}.</p>`}<p class="meta" data-scope-reads>Reads: ${terms.reads}.</p>${terms.mach === null ? "" : html `<p class="meta" data-scope-mach>${terms.mach.charAt(0).toUpperCase()}${terms.mach.slice(1)}.</p>`}`;
|
|
583
|
+
return html `${base}<p class="meta" data-scope-network>${networkWords(profile.network ?? null, profile.provider)}</p><p class="meta" data-scope-writes>Writes: ${writesWords(profile.writes)}.</p>${profile.checkAccess === undefined ? "" : html `<p class="meta" data-scope-checks>Checks: ${checkAccessWords(profile.checkAccess)}.</p>`}<p class="meta" data-scope-reads>Reads: ${terms.reads}.</p>${terms.mach === null ? "" : html `<p class="meta" data-scope-mach>${terms.mach.charAt(0).toUpperCase()}${terms.mach.slice(1)}.</p>`}`;
|
|
578
584
|
}
|
|
579
585
|
export function routeEvidenceHtml(view, className = "meta") {
|
|
580
586
|
const words = view?.evidence ?? null;
|
|
@@ -792,14 +798,14 @@ export function approveRefusalWords(reason) {
|
|
|
792
798
|
return "That password didn't match.";
|
|
793
799
|
return `not approved: ${reason}`;
|
|
794
800
|
}
|
|
795
|
-
export function approvalFormDigest(scopeDigest, planSha) {
|
|
796
|
-
if (planSha === null)
|
|
801
|
+
export function approvalFormDigest(scopeDigest, planSha, termsKey = null) {
|
|
802
|
+
if (planSha === null && termsKey === null)
|
|
797
803
|
return scopeDigest;
|
|
798
804
|
return createHash("sha256")
|
|
799
805
|
.update("standing-orders/browser-approval/v1\0", "utf8")
|
|
800
806
|
.update(scopeDigest, "utf8")
|
|
801
807
|
.update("\0", "utf8")
|
|
802
|
-
.update("", "utf8")
|
|
808
|
+
.update(termsKey ?? "", "utf8")
|
|
803
809
|
.update("\0", "utf8")
|
|
804
810
|
.update(planSha ?? "", "utf8")
|
|
805
811
|
.digest("hex");
|
|
@@ -1116,31 +1122,12 @@ function revisionImageLink(image) {
|
|
|
1116
1122
|
return image == null ? html `` : html `<a href="/r/${image.run}/evidence/${image.artifact}">Screenshot ${image.artifact} · result #${image.run}</a> · `;
|
|
1117
1123
|
}
|
|
1118
1124
|
export function revisionLineageWords(lineage) {
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
words.push("the earlier version had no plan, so nothing was copied; the placeholder requirements wait for real ones");
|
|
1126
|
-
}
|
|
1127
|
-
else if (lineage.terms !== null) {
|
|
1128
|
-
const terms = lineage.terms;
|
|
1129
|
-
words.push(`inherited terms, as they stand now: ${qualityModeTitle(terms.qualityMode)} quality · ` +
|
|
1130
|
-
`${terms.permissionMode === "bypassPermissions" ? "full access" : "auto permissions"} · ` +
|
|
1131
|
-
`${terms.budgetMicrousd === null ? "no attempt cap" : `$${(terms.budgetMicrousd / 1_000_000).toFixed(2)} attempt cap`} · ` +
|
|
1132
|
-
`${terms.exclusions ? "its exclusions" : "no exclusions"} · ${terms.touches === 0 ? "any path" : `${terms.touches} path limit${terms.touches === 1 ? "" : "s"}`} · ` +
|
|
1133
|
-
`${terms.criteria} criteri${terms.criteria === 1 ? "on" : "a"}${terms.routeOverrides === 0 ? "" : ` · ${terms.routeOverrides} agent override${terms.routeOverrides === 1 ? "" : "s"}`}`);
|
|
1134
|
-
}
|
|
1135
|
-
words.push("re-resolved for this approval: the agents route — a yes on the source never covers it");
|
|
1136
|
-
words.push("never inherited: the source's approval, publication and merge grants");
|
|
1137
|
-
if (lineage.repair !== null) {
|
|
1138
|
-
const repair = lineage.repair;
|
|
1139
|
-
words.push(`repair chain rooted at ${repair.rootTask}: ${repair.attemptsUsed} attempt${repair.attemptsUsed === 1 ? "" : "s"} used` +
|
|
1140
|
-
`${repair.cap === null ? " — each further attempt needs your yes" : ` of ${repair.cap} automatic · ${repair.remaining} remaining`}` +
|
|
1141
|
-
`${repair.thisAttempt === null ? "" : ` · this is attempt ${repair.thisAttempt}`}${repair.via === null ? "" : ` · continued through ${repair.via}`}`);
|
|
1142
|
-
}
|
|
1143
|
-
return words;
|
|
1125
|
+
const facts = { sourceTask: lineage.sourceTask, sourceRun: lineage.sourceRun, hadPlan: lineage.sourceHadScope, changed: null,
|
|
1126
|
+
problem: lineage.problem ?? null, repair: lineage.repair === null ? null : { cap: lineage.repair.cap, remaining: lineage.repair.remaining } };
|
|
1127
|
+
return [
|
|
1128
|
+
...(facts.problem === null ? [] : [`Toolroll can’t check what this revises (${facts.problem}), so no fix runs on its own.`]),
|
|
1129
|
+
revisionWords(facts),
|
|
1130
|
+
];
|
|
1144
1131
|
}
|
|
1145
1132
|
export function revisionLineageHtml(lineage) {
|
|
1146
1133
|
if (lineage === null)
|
|
@@ -1188,6 +1175,8 @@ export function taskBodyParts(data) {
|
|
|
1188
1175
|
return html `<div class="card attempt-live" data-live-run="${liveRun.id}">${head}${peek}${door}</div>`;
|
|
1189
1176
|
})();
|
|
1190
1177
|
const dispatchStatus = (() => {
|
|
1178
|
+
if (data.dispatch?.action === "approve-scope" && (data.nonce ?? "") !== "" && task.state !== "cancelled")
|
|
1179
|
+
return html ``;
|
|
1191
1180
|
const workToken = resultStatus?.token ?? data.dispatch?.code ?? "unknown";
|
|
1192
1181
|
const headline = status.label;
|
|
1193
1182
|
const box = (kind, title, detail, code, controls = "") => html `<div class="${kind === "problem" && !inReview && headline === "Failed" ? "problem" : "answered"} dispatch-status" id="run-status" data-dispatch-status="${code ?? title.toLowerCase().replace(/[^a-z0-9]+/g, "-")}" data-work-status="${workToken}"><div class="dispatch-copy"><strong>${inReview ? "Recorded checks" : title}</strong><span class="meta">${detail}</span></div>${controls}</div>`;
|
|
@@ -1465,6 +1454,7 @@ export function taskBodyParts(data) {
|
|
|
1465
1454
|
csrf: data.csrf,
|
|
1466
1455
|
nonce: data.nonce,
|
|
1467
1456
|
digest: data.approvalDigest ?? scope.digest,
|
|
1457
|
+
summary: data.approvalSummary ?? null,
|
|
1468
1458
|
freshSince: data.approvalFresh ?? null,
|
|
1469
1459
|
localOwner: data.approvalLocal ?? null,
|
|
1470
1460
|
returnTo: null,
|
|
@@ -1769,7 +1759,7 @@ export function taskBodyParts(data) {
|
|
|
1769
1759
|
? postForm(`${taskHref(task.id)}/cancel`, joinHtml([
|
|
1770
1760
|
data.coordinator == null ? "" : html `<label>Reason for cancellation<textarea name="reason" rows="3" maxlength="500" required>${data.cancelDraft ?? ""}</textarea></label>`,
|
|
1771
1761
|
html `<button type="submit" class="danger">Confirm cancellation</button>`,
|
|
1772
|
-
]))
|
|
1762
|
+
]), { hidden: cancelPinsOf(task.state, data.runs) })
|
|
1773
1763
|
: "";
|
|
1774
1764
|
const cancelAct = cancelForm === "" ? "" : html `<details class="arm-danger"${data.cancelDraft === undefined ? "" : html ` open`}><summary>Cancel task</summary>${cancelForm}</details>`;
|
|
1775
1765
|
const sectionParts = [];
|
|
@@ -2079,7 +2069,7 @@ export function taskBodyParts(data) {
|
|
|
2079
2069
|
];
|
|
2080
2070
|
const plannerRun = familyRuns.filter(run => run.role === "planner" && run.outcome !== null).sort((a, b) => b.id - a.id)[0];
|
|
2081
2071
|
const sheetShown = scope === null ? null : sheetInput ?? {
|
|
2082
|
-
surface: "task", action: "", csrf: "", nonce: "", digest: scope.digest, returnTo: null, scope,
|
|
2072
|
+
surface: "task", action: "", csrf: "", nonce: "", digest: scope.digest, returnTo: null, scope, summary: data.approvalSummary ?? null,
|
|
2083
2073
|
planDocument: data.planDocument ?? null, planContract: data.planContract ?? null,
|
|
2084
2074
|
revision: data.revision == null || "problem" in data.revision ? null : data.revision,
|
|
2085
2075
|
revisionSourceHref: data.revision == null || "problem" in data.revision ? "" : `/r/${data.revision.sourceRun}`,
|
|
@@ -2194,6 +2184,7 @@ export function taskBodyParts(data) {
|
|
|
2194
2184
|
key === here.key && !outcomeFirst ? statusHtml : "",
|
|
2195
2185
|
key === "plan" ? planCard : "",
|
|
2196
2186
|
key === "approve" ? (approvalHtml !== "" ? approvalHtml : view.approved == null ? "" : html `<p class="meta">${view.approved.automatic ? `Approved automatically by ${view.approved.rule ?? "a rule"}` : `Approved by ${view.approved.by}`} · ${whenTime(view.approved.at)}</p>`) : "",
|
|
2187
|
+
key === "approve" && !rowFacts.some(row => row.key === "plan") ? planCard : "",
|
|
2197
2188
|
key === "build" ? joinHtml([controlHtml, progressCard, revisionLedgerCard]) : "",
|
|
2198
2189
|
key === "ready" && previousResult !== null ? html `<section class="task-previous-result" aria-label="${previousResult.title}">${previousResult.html}</section>` : "",
|
|
2199
2190
|
]);
|
|
@@ -2305,20 +2296,20 @@ export function approveKitOf(input, freshSince) {
|
|
|
2305
2296
|
const parts = approvalSheetParts(input);
|
|
2306
2297
|
const rebuild = input.rebuild ?? null;
|
|
2307
2298
|
const after = rebuild !== null ? "builds it again to this plan" : input.deliverable === "report" ? "starts the investigation" : "starts the build";
|
|
2308
|
-
const allowing = parts.allowing.length === 0 ? "" : ` You’re allowing ${parts.allowing.join(", ")}.`;
|
|
2309
2299
|
const until = freshSince === null ? null : freshUntil(freshSince);
|
|
2310
2300
|
return {
|
|
2311
2301
|
action: input.action,
|
|
2312
2302
|
fields: { nonce: input.nonce, digest: input.digest, ...(rebuild === null ? {} : { rebuild: String(rebuild) }) },
|
|
2313
2303
|
label: parts.label,
|
|
2314
2304
|
heading: rebuild !== null ? "The plan changed" : input.deliverable === "report" ? "Investigation ready" : "Plan ready",
|
|
2315
|
-
text: `Approving ${after}
|
|
2305
|
+
text: `Approving ${after}.`,
|
|
2316
2306
|
kind: "standard",
|
|
2317
2307
|
facts: { passwordless: passwordlessRendering() || input.localOwner?.eligible === true, remembered: until !== null },
|
|
2318
2308
|
rememberedUntil: until,
|
|
2319
2309
|
...(input.localOwner?.eligible === true ? { termsWords: "No password needed on this computer." } : {}),
|
|
2320
2310
|
planHtml: htmlString(joinHtml([parts.sheet, parts.editor ?? "", parts.editorForm])),
|
|
2321
2311
|
sheetHtml: htmlString(parts.sheet),
|
|
2312
|
+
editorHtml: htmlString(joinHtml([parts.editor ?? "", parts.editorForm])),
|
|
2322
2313
|
};
|
|
2323
2314
|
}
|
|
2324
2315
|
export function approvedKitOf(scope, approval, proof) {
|
|
@@ -2336,3 +2327,6 @@ export function planVersionDetailsHtml(digest) {
|
|
|
2336
2327
|
function agentlessRoute(dispatch, route) {
|
|
2337
2328
|
return dispatch?.summary === NO_AGENT_TITLE && route?.kind === "unreadable" && (route.problem ?? "").includes("has no exact model");
|
|
2338
2329
|
}
|
|
2330
|
+
export function cancelPinsOf(state, runs) {
|
|
2331
|
+
return { state, run: runs.length === 0 ? "none" : String(Math.max(...runs.map(one => one.id))) };
|
|
2332
|
+
}
|
|
@@ -47,6 +47,8 @@ const LOCAL_POSTS = Object.freeze({
|
|
|
47
47
|
"task.act.approve": "approve-plan",
|
|
48
48
|
"task.act.keep-grown": "approve-plan",
|
|
49
49
|
"decision.answer": "answer-question",
|
|
50
|
+
"agents.live.thread.answer": "answer-question",
|
|
51
|
+
"agents.live.thread.start": "start-thread",
|
|
50
52
|
"task.act.reply": "answer-question",
|
|
51
53
|
"task.act.stop": "stop-run",
|
|
52
54
|
"task.act.cancel": "stop-run",
|
|
@@ -61,6 +63,13 @@ const LOCAL_POSTS = Object.freeze({
|
|
|
61
63
|
"run.act.revise": "request-revision",
|
|
62
64
|
"run.act.note": "request-revision",
|
|
63
65
|
"run.act.comment": "request-revision",
|
|
66
|
+
"term.start": "take-over",
|
|
67
|
+
"term.close": "take-over",
|
|
68
|
+
"term.remove": "take-over",
|
|
69
|
+
"term.agent-sign-in": "agent-sign-in",
|
|
70
|
+
"term.agent-install": "agent-install",
|
|
71
|
+
"engine.agents-check": "check-agents",
|
|
72
|
+
"settings.models-agent": "change-models",
|
|
64
73
|
"task.act.archive": "archive-task",
|
|
65
74
|
"task.act.restore": "archive-task",
|
|
66
75
|
"projects.open": "add-project",
|
|
@@ -78,6 +87,7 @@ const LOCAL_POSTS = Object.freeze({
|
|
|
78
87
|
"settings.knowledge-note": "memory-review",
|
|
79
88
|
"settings.knowledge-tidy": "memory-review",
|
|
80
89
|
"settings.advanced": "view-preference",
|
|
90
|
+
"settings.task-sizing": "task-sizing-switch",
|
|
81
91
|
"agents.seen": "mark-seen",
|
|
82
92
|
"agents.watch": "watch-agent",
|
|
83
93
|
});
|
|
@@ -108,6 +118,7 @@ export const EDGE_LOCAL = Object.freeze({
|
|
|
108
118
|
"edge.desktop-health": { local: "allow", why: "public read" },
|
|
109
119
|
"edge.login-page": { local: "allow", why: "before sign-in" },
|
|
110
120
|
"edge.login-link": { local: "allow", why: "before sign-in: a one-time link" },
|
|
121
|
+
"edge.login-link-json": { local: "allow", why: "before sign-in: the same one-time local link, redeemed by a terminal client into the same local-owner session (engine-api.ts redeemLink)" },
|
|
111
122
|
"edge.sso-start": { local: "allow", why: "before sign-in" },
|
|
112
123
|
"edge.sso-callback": { local: "allow", why: "before sign-in" },
|
|
113
124
|
"edge.sso-finish": { local: "allow", why: "before sign-in" },
|
|
@@ -174,6 +185,7 @@ edge("pages", "edge.font", "GET", "^\\/fonts\\/geist-(sans|mono)-(400|500|600)\\
|
|
|
174
185
|
edge("pages", "edge.desktop-health", "GET", "/desktop/health");
|
|
175
186
|
edge("people", "edge.login-page", "GET", "/login");
|
|
176
187
|
edge("people", "edge.login-link", "GET", "^\\/login\\/once\\/[^/]+$", { sample: "/login/once/abc" });
|
|
188
|
+
edge("people", "edge.login-link-json", "POST", "/login/once");
|
|
177
189
|
edge("people", "edge.sso-start", "GET", "/login/sso");
|
|
178
190
|
edge("people", "edge.sso-callback", "GET", "/login/sso/callback", { callers: ["service"], proof: "adapter" });
|
|
179
191
|
edge("people", "edge.sso-finish", "GET", "/login/sso/finish");
|
|
@@ -208,6 +220,11 @@ get("pages", "projects.project", "^\\/projects\\/[^/]+$", { limited: "unscoped",
|
|
|
208
220
|
get("pages", "projects.map", "^\\/projects\\/[^/]+\\/map$", { limited: "unscoped", ...free, sample: "/projects/payments-api/map" });
|
|
209
221
|
get("pages", "projects.flaky", "^\\/projects\\/[^/]+\\/flaky$", { limited: "unscoped", ...free, sample: "/projects/payments-api/flaky" });
|
|
210
222
|
get("pages", "home", "/", { limited: "collection", ...free });
|
|
223
|
+
get("pages", "work.rows", "/work/rows", { limited: "collection", ...free });
|
|
224
|
+
get("pages", "engine.hello", "/engine/hello", { limited: "unscoped", ...free });
|
|
225
|
+
get("pages", "engine.agents", "/engine/agents", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
226
|
+
get("settings", "engine.models", "/engine/models", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
227
|
+
post("pages", "engine.agents-check", "/engine/agents/check", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
211
228
|
get("pages", "search", "/search", { limited: "collection", ...free });
|
|
212
229
|
const RETIRED = { limited: "collection", ...free, retired: true };
|
|
213
230
|
get("tasks", "inbox", "/inbox", RETIRED);
|
|
@@ -236,6 +253,11 @@ get("pages", "peek", "/peek", free);
|
|
|
236
253
|
get("pages", "agents", "/agents", { limited: "unscoped", ...free });
|
|
237
254
|
get("pages", "agents.live", "/agents/live", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
238
255
|
get("pages", "agents.live.read", `^\\/agents\\/live\\/${ID}$`, { limited: "unscoped", callers: ["cookie"], ...free, sample: "/agents/live/1" });
|
|
256
|
+
get("pages", "agents.live.run", `^\\/agents\\/live\\/run\\/${ID}$`, { limited: "unscoped", callers: ["cookie"], ...free, sample: "/agents/live/run/1" });
|
|
257
|
+
get("pages", "agents.live.thread", "^\\/agents\\/live\\/thread\\/[0-9a-f]{32}$", { limited: "unscoped", callers: ["cookie"], ...free, sample: `/agents/live/thread/${"a".repeat(32)}` });
|
|
258
|
+
get("pages", "agents.live.threads", "/agents/live/threads", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
259
|
+
post("pages", "agents.live.thread.answer", "^\\/agents\\/live\\/thread\\/[0-9a-f]{32}\\/answer$", { limited: "unscoped", callers: ["cookie"], project: "none", sample: `/agents/live/thread/${"a".repeat(32)}/answer` });
|
|
260
|
+
post("pages", "agents.live.thread.start", "/agents/live/thread", { limited: "unscoped", callers: ["cookie"], project: "none", ...approver("An approver starts threads.") });
|
|
239
261
|
get("pages", "agents.terminals", "/agents/terminals", TERM);
|
|
240
262
|
get("pages", "fleet", "/fleet", free);
|
|
241
263
|
get("tasks", "tasks.new", "/tasks/new", { limited: "collection", ...free });
|
|
@@ -243,6 +265,8 @@ get("tasks", "welcome", "/welcome", { limited: "collection", ...free });
|
|
|
243
265
|
post("tasks", "welcome.sample", "/welcome/sample", { callers: ["cookie"], project: "none", ...approver("An approver adds projects.", "/welcome") });
|
|
244
266
|
get("tasks", "task.page", `^\\/t\\/${TASK}$`, { project: "task", limited: "resource", ...free, sample: "/t/one" });
|
|
245
267
|
get("tasks", "task.evidence", `^\\/t\\/${TASK}\\/evidence$`, { project: "task", limited: "resource", ...free, sample: "/t/one/evidence" });
|
|
268
|
+
get("tasks", "task.steps", `^\\/t\\/${TASK}\\/steps$`, { project: "task", limited: "resource", ...free, sample: "/t/one/steps" });
|
|
269
|
+
get("tasks", "task.diff", `^\\/t\\/${TASK}\\/diff$`, { project: "task", limited: "resource", ...free, sample: "/t/one/diff" });
|
|
246
270
|
get("tasks", "task.release", `^\\/t\\/${TASK}\\/release$`, { project: "task", limited: "resource", ...free, sample: "/t/one/release" });
|
|
247
271
|
get("tasks", "release.locate", `^\\/approve\\/${ID}$`, { project: "task-ref", limited: "resource", ...free, sample: "/approve/1" });
|
|
248
272
|
get("pages", "ledger.export", "/ledger/export", { limited: "unscoped", ...free });
|
|
@@ -328,6 +352,8 @@ post("settings", "settings.advanced", "/settings/advanced", { ...free, limited:
|
|
|
328
352
|
const CODING_ACT = { scope: "step-up", project: "coding", limited: "self" };
|
|
329
353
|
post("tasks", "code.start", "/code/start", CODING_ACT);
|
|
330
354
|
post("tasks", "term.start", "/term/start", { ...TERM, scope: "step-up" });
|
|
355
|
+
for (const one of ["sign-in", "install"])
|
|
356
|
+
post("tasks", `term.agent-${one}`, `/term/agent/${one}`, { ...TERM, scope: "step-up" });
|
|
331
357
|
for (const one of ["close", "remove"])
|
|
332
358
|
post("tasks", `term.${one}`, `^\\/term\\/${TERMINAL}\\/${one}$`, { ...TERM, sample: `/term/${"a".repeat(32)}/${one}` });
|
|
333
359
|
for (const one of ["send", "stop", "resume", "recover", "continue", "ship", "answer"])
|
|
@@ -391,6 +417,8 @@ post("tasks", "sweep.cancel-rest", "^\\/sweeps\\/[1-9][0-9]{0,9}\\/cancel-rest$"
|
|
|
391
417
|
get("settings", "settings.passwordless", "/settings/passwordless", { ...free, ...operator("An instance operator sets Passwordless.", "/settings") });
|
|
392
418
|
post("settings", "settings.passwordless-send", "/settings/passwordless", { callers: ["cookie"], ...operator("An instance operator sets Passwordless.", "/settings") });
|
|
393
419
|
post("settings", "settings.local-mode-off", "/settings/local-mode/off", { callers: ["cookie"], scope: "step-up", ...operator("An instance operator turns off local mode.", "/settings/general?section=local-mode") });
|
|
420
|
+
post("settings", "settings.task-sizing", "/settings/task-sizing", { scope: "step-up", limited: "deny", ...operator("An instance operator chooses how tasks are sized.", "/settings/general?section=task-sizing") });
|
|
421
|
+
post("settings", "settings.just-me", "/settings/install-mode/solo", { callers: ["cookie"], scope: "step-up", ...operator("An instance operator says it's just them.", "/settings/general?section=install-mode") });
|
|
394
422
|
post("settings", "settings.release-approval-send", "/settings/release-approval", { callers: ["cookie"], ...approver("An approver sets how releases are approved.", "/settings/approval") });
|
|
395
423
|
post("pages", "ledger.checkpoint", "/ledger/checkpoint", operator("An instance operator makes ledger checkpoints.", "/ledger"));
|
|
396
424
|
const SETTINGS_ACT_ROLES = {
|
|
@@ -452,9 +480,12 @@ for (const one of ["confirm", "save", "off"])
|
|
|
452
480
|
post("settings", `settings.chat-approval-${one}`, `/settings/chat-approval/${one}`, { limited: "self", callers: ["cookie"], ...(one === "save" ? { scope: "step-up" } : {}), ...approver("An approver turns on approving from their own chat.", "/settings") });
|
|
453
481
|
post("settings", "settings.telegram-pair", "/settings/telegram/pair", { limited: "self", scope: "step-up", ...approver("An approver can pair their own phone.", "/settings") });
|
|
454
482
|
post("settings", "settings.telegram-unpair", "/settings/telegram/unpair", { limited: "self", scope: "step-up", ...approver("An approver can pair their own phone.", "/settings") });
|
|
455
|
-
for (const one of ["messaging", "permission-default", "quality-default", "notifications", "notifications/mute", "telegram-digest", "provider-key
|
|
483
|
+
for (const one of ["messaging", "permission-default", "quality-default", "notifications", "notifications/mute", "telegram-digest", "provider-key-clear", "email-test", "email-read-test", "google/disconnect"]) {
|
|
456
484
|
post("settings", `settings.${one.replaceAll("/", "-")}-send`, `/settings/${one}`);
|
|
457
485
|
}
|
|
486
|
+
for (const one of ["provider-key", "telegram-token", "email", "google"]) {
|
|
487
|
+
post("settings", `settings.${one}-send`, `/settings/${one}`, { callers: ["cookie"], scope: "step-up" });
|
|
488
|
+
}
|
|
458
489
|
post("pages", "projects.github-list", "/projects/github", { callers: ["cookie"], ...anyApprover("your login can watch — adding projects is an approver's act") });
|
|
459
490
|
post("pages", "projects.select", "/projects/select", { project: "form-path", limited: "unscoped", viewer: true });
|
|
460
491
|
post("pages", "projects.map-refresh", "^\\/projects\\/[^/]+\\/map\\/refresh$", { project: "form", sample: "/projects/payments-api/map/refresh", ...approver("An approver asks for a check of main.", "/projects") });
|