toolroll 0.9.115 → 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 +55 -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 +15 -4
- package/dist/contracts/engine-api.js +344 -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-authority-end.js +2 -0
- package/dist/flexible-interactive-schema.js +133 -0
- package/dist/flexible-interactive.js +94 -0
- package/dist/flexible-session.js +117 -49
- package/dist/flexible-ship.js +87 -7
- package/dist/flexible-sign-in.js +10 -0
- package/dist/flexible-start.js +21 -3
- package/dist/flexible-thread.js +2 -3
- package/dist/flexible-turns.js +26 -5
- package/dist/flexible.js +13 -0
- 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 +682 -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/console.css +9 -9
- package/dist/server/direct-chat.js +583 -0
- package/dist/server/engine-api.js +219 -21
- package/dist/server/flows.js +47 -13
- 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/spend-report.js +2 -2
- package/dist/spend.js +3 -3
- package/dist/store.js +600 -59
- package/dist/subagent-admin.js +23 -10
- package/dist/subagent-backup-schema.js +36 -0
- package/dist/subagent-backup.js +92 -0
- package/dist/subagent-week.js +2 -2
- package/dist/subagent-work.js +70 -47
- package/dist/subagents-ui.js +6 -2
- package/dist/subagents.js +5 -2
- package/dist/subscription-chat.js +36 -5
- 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/terminal-safety.js +114 -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 +4 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { archivedWords } from "../tidy.js";
|
|
2
2
|
import { btn, stepRows } from "./kit.js";
|
|
3
3
|
import { whenUtc } from "../when-html.js";
|
|
4
|
-
import { networkWords } from "../egress.js";
|
|
4
|
+
import { codexCommandsOffline, networkWords } from "../egress.js";
|
|
5
5
|
import { wasInterrupted } from "../run-ending.js";
|
|
6
6
|
import { liveChainFromJson, releaseAsksAgainWords, releaseCheckSentence, releaseTermsSentence } from "../scope.js";
|
|
7
7
|
import { SUBSCRIPTION_CAPABLE } from "../keys.js";
|
|
@@ -580,7 +580,7 @@ export function profileWords(scope) {
|
|
|
580
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>`
|
|
581
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>`;
|
|
582
582
|
const terms = sandboxTermsWords(profile);
|
|
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>`}`;
|
|
583
|
+
return html `${base}<p class="meta" data-scope-network>${networkWords(profile.network ?? null, profile.provider, { commandsOffline: codexCommandsOffline(profile) })}</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>`}`;
|
|
584
584
|
}
|
|
585
585
|
export function routeEvidenceHtml(view, className = "meta") {
|
|
586
586
|
const words = view?.evidence ?? null;
|
|
@@ -682,7 +682,7 @@ export function runtimeDetailsHtml(scope) {
|
|
|
682
682
|
return html ``;
|
|
683
683
|
return html `<details class="agents-runtime"><summary>Runtime limits</summary>${words}</details>`;
|
|
684
684
|
}
|
|
685
|
-
export function agentsCardHtml(taskId, view, canEdit) {
|
|
685
|
+
export function agentsCardHtml(taskId, view, canEdit, signIn) {
|
|
686
686
|
if (view === null || view === undefined)
|
|
687
687
|
return html ``;
|
|
688
688
|
const p = view.projection;
|
|
@@ -692,7 +692,7 @@ export function agentsCardHtml(taskId, view, canEdit) {
|
|
|
692
692
|
? ""
|
|
693
693
|
: html `<ul class="agents-overrides">${view.overrides.map(one => joinHtml([
|
|
694
694
|
html `<li><span>${ROLE_NOUN[one.phase]} → <span class="mono">${one.provider} · ${one.model}</span> <span class="meta">by ${one.by} ${whenTime(one.at)}</span></span>`,
|
|
695
|
-
canEdit && view.editable
|
|
695
|
+
canEdit && view.editable && !signIn
|
|
696
696
|
? postForm(route, html `<button type="submit" class="secondary" aria-label="clear the ${ROLE_NOUN[one.phase].toLowerCase()} choice">Clear</button>`, { attrs: { class: "agents-clear" }, hidden: { sawDigest, "clear-phase": one.phase } })
|
|
697
697
|
: "",
|
|
698
698
|
html `</li>`,
|
|
@@ -714,18 +714,19 @@ export function agentsCardHtml(taskId, view, canEdit) {
|
|
|
714
714
|
? ""
|
|
715
715
|
: !view.editable
|
|
716
716
|
? html `<p class="meta">${view.editableWhy ?? "the agents cannot change right now"}</p>`
|
|
717
|
-
: joinHtml([
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
717
|
+
: signIn ? joinHtml([html `<a class="button secondary" data-builder-password href="${signIn.href}">${signIn.action} to change agents</a>`, overrides])
|
|
718
|
+
: joinHtml([
|
|
719
|
+
html `<details class="agents-change"><summary>Change agents</summary>`,
|
|
720
|
+
postForm(route, joinHtml([
|
|
721
|
+
html `<label>Size<select name="size" aria-label="task size">${TASK_SIZES.map(one => html `<option value="${one}"${one === (p?.size?.size ?? "medium") ? html ` selected` : ""}>${sizeConsequence(one, false)}</option>`)}</select></label>`,
|
|
722
|
+
html `<input type="hidden" name="risky" value="no"><label class="agents-risky"><input type="checkbox" name="risky" value="yes"${p?.size?.risky === true ? html ` checked` : ""}> Risky</label>`,
|
|
723
|
+
html `<button type="submit" class="secondary">Set size</button>`,
|
|
724
|
+
]), { attrs: { class: "agents-form-risk" }, hidden: { sawDigest } }),
|
|
725
|
+
html `<div class="agents-role-forms">${roleForms}</div>`,
|
|
726
|
+
html `<p class="meta">Only agents you have configured are offered; each choice is recorded as you. ${view.replanOnPlanChange ? "Changing the planner asks for a new plan — the drafted one is not relabeled. " : ""}An approval given under the earlier agents needs renewing.</p>`,
|
|
727
|
+
overrides,
|
|
728
|
+
html `</details>`,
|
|
729
|
+
]);
|
|
729
730
|
return joinHtml([
|
|
730
731
|
html `<section class="card agents-card" id="agents" aria-label="agents">`,
|
|
731
732
|
html `<div class="agents-head"><h3>Agents</h3><div class="agents-badges">${agentsBadgesHtml(view)}</div></div>`,
|
|
@@ -1836,7 +1837,7 @@ export function taskBodyParts(data) {
|
|
|
1836
1837
|
: html `<details class="task-secondary-approval"><summary>Updated approval terms</summary>${approveForm}</details>`;
|
|
1837
1838
|
const optionsHtml = html `${identity}${dispatchStatus}${dependencyChoiceNeeded ? "" : actsBar}`;
|
|
1838
1839
|
const optionsOpen = data.assignment?.primaryAction?.code === "unhold" || data.assignment?.primaryAction?.code === "retry-task";
|
|
1839
|
-
const scopeRest = [releaseCardHtml(task.id, data.release ?? null, data.canStopRelease === true), html `<p class="meta">${data.repo !== null && data.scope !== null ? html `<a href="/recipes/from-task?task=${encodeURIComponent(task.id)}">Reuse this plan as a recipe →</a> · ` : ""}<a href="${taskHref(data.rootId ?? task.id)}/evidence">Audit record →</a></p>`, agentsCardHtml(task.id, agentlessRoute(data.dispatch ?? null, data.route) ? null : data.route, data.canEditRoute === true), revisionInApproval ? "" : revisionCard, data.completion != null ? "" : repairChainHtml(data.repairChain ?? null), scopeForm];
|
|
1840
|
+
const scopeRest = [releaseCardHtml(task.id, data.release ?? null, data.canStopRelease === true), html `<p class="meta">${data.repo !== null && data.scope !== null ? html `<a href="/recipes/from-task?task=${encodeURIComponent(task.id)}">Reuse this plan as a recipe →</a> · ` : ""}<a href="${taskHref(data.rootId ?? task.id)}/evidence">Audit record →</a></p>`, agentsCardHtml(task.id, agentlessRoute(data.dispatch ?? null, data.route) ? null : data.route, data.canEditRoute === true, data.routeSignIn), revisionInApproval ? "" : revisionCard, data.completion != null ? "" : repairChainHtml(data.repairChain ?? null), scopeForm];
|
|
1840
1841
|
const layoutTail = joinHtml([
|
|
1841
1842
|
html `<div class="task-layout"><div class="task-main">`,
|
|
1842
1843
|
attemptPanel,
|
|
@@ -66,12 +66,28 @@ const LOCAL_POSTS = Object.freeze({
|
|
|
66
66
|
"task.act.complete": "complete-task",
|
|
67
67
|
"task.act.plan": "request-plan",
|
|
68
68
|
"task.act.requeue": "retry-build",
|
|
69
|
+
"task.act.route": "change-task-agents",
|
|
70
|
+
"flow.trigger.pause": "trigger-pause",
|
|
71
|
+
"flow.trigger.resume": "trigger-resume",
|
|
72
|
+
"flow.trigger.check": "trigger-run",
|
|
73
|
+
"flow.trigger.press": "trigger-run",
|
|
69
74
|
"run.act.revise": "request-revision",
|
|
70
75
|
"run.act.note": "request-revision",
|
|
71
76
|
"run.act.comment": "request-revision",
|
|
72
77
|
"term.start": "take-over",
|
|
73
78
|
"term.close": "take-over",
|
|
74
79
|
"term.remove": "take-over",
|
|
80
|
+
"direct-chat.start": "direct-chat-start",
|
|
81
|
+
"direct-chat.send": "direct-chat-send",
|
|
82
|
+
"direct-chat.stop": "direct-chat-stop",
|
|
83
|
+
"direct-chat.model": "direct-chat-manage",
|
|
84
|
+
"direct-chat.delete": "direct-chat-manage",
|
|
85
|
+
"direct-chat.attach": "direct-chat-send",
|
|
86
|
+
"direct-chat.apply-main": "direct-chat-manage",
|
|
87
|
+
"direct-chat.repair": "direct-chat-manage",
|
|
88
|
+
"direct-chat.ship-preview": "read",
|
|
89
|
+
"direct-chat.ship": "direct-chat-ship",
|
|
90
|
+
"direct-chat.ship-cancel": "direct-chat-manage",
|
|
75
91
|
"term.agent-sign-in": "agent-sign-in",
|
|
76
92
|
"term.agent-install": "agent-install",
|
|
77
93
|
"engine.agents-check": "check-agents",
|
|
@@ -99,6 +115,8 @@ const LOCAL_POSTS = Object.freeze({
|
|
|
99
115
|
"settings.flexible-sign-in-check": "flexible-sign-in-check",
|
|
100
116
|
"settings.flexible-sign-in-clear": "flexible-sign-in-clear",
|
|
101
117
|
"settings.project-flexible": "project-flexible",
|
|
118
|
+
"settings.project-network": "project-network",
|
|
119
|
+
"settings.project-live-view": "project-live-view",
|
|
102
120
|
"agents.seen": "mark-seen",
|
|
103
121
|
"agents.watch": "watch-agent",
|
|
104
122
|
});
|
|
@@ -121,6 +139,21 @@ export const EDGE_LOCAL = Object.freeze({
|
|
|
121
139
|
"edge.team-read": { local: "deny", why: "team conversations are a remote feature: authenticate refuses a local owner" },
|
|
122
140
|
"edge.team-send": { local: "deny", why: "team conversations are a remote feature: authenticate refuses a local owner" },
|
|
123
141
|
"edge.cli": { local: "deny", why: "bearer only" },
|
|
142
|
+
"edge.terminal-connection": { local: "deny", why: "ordinary person API token only; never a local-owner cookie or credential conversion" },
|
|
143
|
+
"edge.handoff-pull": { local: "deny", why: "ordinary person API token only for local code handoff export" },
|
|
144
|
+
"edge.handoff-push": { local: "deny", why: "ordinary person API token only for local code handoff candidate upload" },
|
|
145
|
+
"edge.presence": { local: "allow", why: "observational read of active task viewers, terminal controllers, and task owners within the caller's visible projects" },
|
|
146
|
+
"edge.approval-ping": { local: "deny", why: "ordinary person API token only for remote out-of-band approval ping" },
|
|
147
|
+
"edge.remote-terminals": { local: "deny", why: "ordinary person act API token only for remote terminal relay discovery" },
|
|
148
|
+
"edge.remote-terminal-start": { local: "deny", why: "ordinary person act API token only to start or reuse a central live terminal on a visible task" },
|
|
149
|
+
"edge.task-handoff-person": { local: "allow", why: "hand a visible task to a project-authorized teammate (CSRF/key or pinned remote act token)" },
|
|
150
|
+
"edge.handoff-candidates": { local: "allow", why: "observational read of uploaded local code candidates for a visible task" },
|
|
151
|
+
"edge.handoff-promote": { local: "allow", why: "queue a SHA-256 verified local code candidate for central worker checks (approver CSRF/key or remote act token)" },
|
|
152
|
+
"edge.handoff-open-pr": { local: "deny", why: "opening a pull request publishes outside this computer; requires a password-authenticated approver session or remote act token" },
|
|
153
|
+
"edge.connect-pair-start": { local: "deny", why: "CLI device pairing initiation; never uses a cookie" },
|
|
154
|
+
"edge.connect-pair-poll": { local: "deny", why: "CLI device pairing one-time token pickup; never uses a cookie" },
|
|
155
|
+
"edge.connect-pair-page": { local: "deny", why: "browser pairing confirmation requires a full password-authenticated session" },
|
|
156
|
+
"edge.connect-pair-confirm": { local: "deny", why: "minting an API token is a credential step-up act; refuses local-owner sessions" },
|
|
124
157
|
"edge.teams": { local: "deny", why: "signed service only" },
|
|
125
158
|
"edge.browser-asset": { local: "allow", why: "public asset" },
|
|
126
159
|
"edge.workspace-style": { local: "allow", why: "public asset" },
|
|
@@ -188,6 +221,21 @@ edge("settings", "edge.connect-callback", "GET", "/settings/tools/connected", {
|
|
|
188
221
|
edge("remote", "edge.team-read", "GET", "/api/team", { callers: ["cookie", "bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
189
222
|
edge("remote", "edge.team-send", "POST", "/api/team", { callers: ["cookie", "bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
190
223
|
edge("remote", "edge.cli", "POST", "/api/cli", { callers: ["bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
224
|
+
edge("remote", "edge.terminal-connection", "GET", "/engine/connection", { callers: ["bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
225
|
+
edge("remote", "edge.handoff-pull", "GET", `^\\/api\\/handoff\\/task\\/${TASK}$`, { callers: ["bearer"], scope: "read", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one" });
|
|
226
|
+
edge("remote", "edge.handoff-push", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/candidate$`, { callers: ["bearer"], scope: "act", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one/candidate" });
|
|
227
|
+
edge("remote", "edge.task-handoff-person", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/assign-person$`, { callers: ["cookie", "bearer"], scope: "act", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one/assign-person" });
|
|
228
|
+
edge("remote", "edge.handoff-candidates", "GET", `^\\/api\\/handoff\\/task\\/${TASK}\\/candidates$`, { callers: ["cookie", "bearer"], scope: "read", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one/candidates" });
|
|
229
|
+
edge("remote", "edge.handoff-promote", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/candidate\\/cand-[a-f0-9]{16}\\/promote$`, { callers: ["cookie", "bearer"], scope: "act", project: "adapter", proof: "adapter", sample: `/api/handoff/task/one/candidate/cand-${"a".repeat(16)}/promote` });
|
|
230
|
+
edge("remote", "edge.handoff-open-pr", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/candidate\\/cand-[a-f0-9]{16}\\/open-pr$`, { callers: ["cookie", "bearer"], scope: "act", project: "adapter", proof: "adapter", sample: `/api/handoff/task/one/candidate/cand-${"a".repeat(16)}/open-pr` });
|
|
231
|
+
edge("remote", "edge.approval-ping", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/approval-ping$`, { callers: ["bearer"], scope: "act", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one/approval-ping" });
|
|
232
|
+
edge("remote", "edge.remote-terminals", "GET", "/api/handoff/terminals", { callers: ["bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
233
|
+
edge("remote", "edge.remote-terminal-start", "POST", `^\\/api\\/handoff\\/task\\/${TASK}\\/terminal$`, { callers: ["bearer"], scope: "act", project: "adapter", proof: "adapter", sample: "/api/handoff/task/one/terminal" });
|
|
234
|
+
edge("remote", "edge.presence", "GET", "/api/presence", { callers: ["cookie", "bearer"], scope: "read", project: "adapter", proof: "adapter" });
|
|
235
|
+
edge("remote", "edge.connect-pair-start", "POST", "/api/connect/pair/start");
|
|
236
|
+
edge("remote", "edge.connect-pair-poll", "POST", "/api/connect/pair/poll");
|
|
237
|
+
edge("remote", "edge.connect-pair-page", "GET", "^\\/connect\\/pair\\/[A-Z2-9]{4}-[A-Z2-9]{4}$", { sample: "/connect/pair/ABCD-EFGH" });
|
|
238
|
+
edge("remote", "edge.connect-pair-confirm", "POST", "^\\/connect\\/pair\\/[A-Z2-9]{4}-[A-Z2-9]{4}$", { callers: ["cookie"], scope: "step-up", viewer: true, proof: "adapter", sample: "/connect/pair/ABCD-EFGH" });
|
|
191
239
|
edge("remote", "edge.teams", "POST", "/teams/messages", { callers: ["service"], proof: "adapter" });
|
|
192
240
|
edge("pages", "edge.browser-asset", "GET,HEAD", "^\\/assets\\/(workspace\\.js|workspace\\.css|terminal\\.js|terminal\\.css|THIRD_PARTY_NOTICES\\.txt)$", { sample: "/assets/workspace.js" });
|
|
193
241
|
edge("pages", "edge.workspace-style", "GET,HEAD", "^\\/assets\\/workspace-[0-9a-f]{64}\\.css$", { sample: `/assets/workspace-${"0".repeat(64)}.css` });
|
|
@@ -222,6 +270,10 @@ get("tasks", "term.page", "/term", TERM);
|
|
|
222
270
|
get("tasks", "term.state", "/term/state", TERM);
|
|
223
271
|
get("tasks", "term.session", `^\\/term\\/${TERMINAL}$`, { ...TERM, sample: `/term/${"a".repeat(32)}` });
|
|
224
272
|
get("tasks", "term.socket", `^\\/term\\/${TERMINAL}\\/socket$`, { ...TERM, sample: `/term/${"a".repeat(32)}/socket` });
|
|
273
|
+
const DIRECT_CHAT = { ...free, callers: ["cookie"], project: "none", limited: "deny", ...operator("Direct chat is for local solo operators.", "/") };
|
|
274
|
+
get("tasks", "direct-chat.list", "/engine/direct-chats", DIRECT_CHAT);
|
|
275
|
+
get("tasks", "direct-chat.detail", `^\\/engine\\/direct-chats\\/${TERMINAL}$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}` });
|
|
276
|
+
get("tasks", "direct-chat.artifact", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/artifacts\\/${TERMINAL}$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/artifacts/${"b".repeat(32)}` });
|
|
225
277
|
get("pages", "projects.browse", "/projects/browse", free);
|
|
226
278
|
get("pages", "projects.pick", "/projects/pick", { ...free, callers: ["cookie"], project: "none", ...approver("Sign in as an approver to add projects.", "/projects") });
|
|
227
279
|
get("pages", "projects.github", "/projects/github", { ...free, callers: ["cookie"], callerRefusal: { status: 403, type: "text/plain; charset=utf-8", body: "listing repositories feeds a browser session's act" },
|
|
@@ -235,6 +287,9 @@ get("pages", "work.rows", "/work/rows", { limited: "collection", ...free });
|
|
|
235
287
|
get("pages", "engine.hello", "/engine/hello", { limited: "unscoped", ...free });
|
|
236
288
|
get("pages", "engine.agents", "/engine/agents", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
237
289
|
get("settings", "engine.models", "/engine/models", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
290
|
+
get("flows", "engine.automations", "/engine/automations", { limited: "resource", ...free });
|
|
291
|
+
get("pages", "engine.projects", "/engine/projects", { limited: "unscoped", ...free });
|
|
292
|
+
get("pages", "engine.chat", "/engine/chat", { project: "conversation", limited: "conversation", callers: ["cookie", "bearer"], ...free });
|
|
238
293
|
post("pages", "engine.agents-check", "/engine/agents/check", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
239
294
|
get("pages", "search", "/search", { limited: "collection", ...free });
|
|
240
295
|
const RETIRED = { limited: "collection", ...free, retired: true };
|
|
@@ -264,7 +319,7 @@ get("pages", "peek", "/peek", free);
|
|
|
264
319
|
get("pages", "agents", "/agents", { limited: "unscoped", ...free });
|
|
265
320
|
get("pages", "agents.live", "/agents/live", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
266
321
|
get("pages", "agents.live.read", `^\\/agents\\/live\\/${ID}$`, { limited: "unscoped", callers: ["cookie"], ...free, sample: "/agents/live/1" });
|
|
267
|
-
get("pages", "agents.live.run", `^\\/agents\\/live\\/run\\/${ID}$`, { limited: "unscoped", callers: ["cookie"], ...free, sample: "/agents/live/run/1" });
|
|
322
|
+
get("pages", "agents.live.run", `^\\/agents\\/live\\/run\\/${ID}$`, { limited: "unscoped", callers: ["cookie", "bearer"], ...free, sample: "/agents/live/run/1" });
|
|
268
323
|
get("pages", "agents.live.thread", "^\\/agents\\/live\\/thread\\/[0-9a-f]{32}$", { limited: "unscoped", callers: ["cookie"], ...free, sample: `/agents/live/thread/${"a".repeat(32)}` });
|
|
269
324
|
get("pages", "agents.live.threads", "/agents/live/threads", { limited: "unscoped", callers: ["cookie"], ...free });
|
|
270
325
|
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` });
|
|
@@ -284,6 +339,7 @@ get("tasks", "task.page", `^\\/t\\/${TASK}$`, { project: "task", limited: "resou
|
|
|
284
339
|
get("tasks", "task.evidence", `^\\/t\\/${TASK}\\/evidence$`, { project: "task", limited: "resource", ...free, sample: "/t/one/evidence" });
|
|
285
340
|
get("tasks", "task.steps", `^\\/t\\/${TASK}\\/steps$`, { project: "task", limited: "resource", ...free, sample: "/t/one/steps" });
|
|
286
341
|
get("tasks", "task.diff", `^\\/t\\/${TASK}\\/diff$`, { project: "task", limited: "resource", ...free, sample: "/t/one/diff" });
|
|
342
|
+
get("tasks", "task.result", `^\\/t\\/${TASK}\\/result$`, { project: "task", limited: "resource", ...free, sample: "/t/one/result" });
|
|
287
343
|
get("tasks", "task.approval", `^\\/t\\/${TASK}\\/approval$`, { project: "task", limited: "resource", callers: ["cookie"], ...free, sample: "/t/one/approval" });
|
|
288
344
|
get("tasks", "task.release", `^\\/t\\/${TASK}\\/release$`, { project: "task", limited: "resource", ...free, sample: "/t/one/release" });
|
|
289
345
|
get("tasks", "release.locate", `^\\/approve\\/${ID}$`, { project: "task-ref", limited: "resource", ...free, sample: "/approve/1" });
|
|
@@ -374,6 +430,17 @@ for (const one of ["sign-in", "install"])
|
|
|
374
430
|
post("tasks", `term.agent-${one}`, `/term/agent/${one}`, { ...TERM, scope: "step-up" });
|
|
375
431
|
for (const one of ["close", "remove"])
|
|
376
432
|
post("tasks", `term.${one}`, `^\\/term\\/${TERMINAL}\\/${one}$`, { ...TERM, sample: `/term/${"a".repeat(32)}/${one}` });
|
|
433
|
+
post("tasks", "direct-chat.start", "/engine/direct-chats", { ...DIRECT_CHAT, scope: "step-up" });
|
|
434
|
+
post("tasks", "direct-chat.send", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/messages$`, { ...DIRECT_CHAT, scope: "step-up", sample: `/engine/direct-chats/${"a".repeat(32)}/messages` });
|
|
435
|
+
post("tasks", "direct-chat.stop", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/stop$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/stop` });
|
|
436
|
+
post("tasks", "direct-chat.model", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/model$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/model` });
|
|
437
|
+
post("tasks", "direct-chat.delete", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/delete$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/delete` });
|
|
438
|
+
post("tasks", "direct-chat.attach", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/attachments$`, { ...DIRECT_CHAT, bodyCap: 16 * 1024 * 1024, sample: `/engine/direct-chats/${"a".repeat(32)}/attachments` });
|
|
439
|
+
post("tasks", "direct-chat.apply-main", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/apply-main-edits$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/apply-main-edits` });
|
|
440
|
+
post("tasks", "direct-chat.repair", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/repair$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/repair` });
|
|
441
|
+
post("tasks", "direct-chat.ship-preview", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/ship-preview$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/ship-preview` });
|
|
442
|
+
post("tasks", "direct-chat.ship", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/ship$`, { ...DIRECT_CHAT, scope: "step-up", sample: `/engine/direct-chats/${"a".repeat(32)}/ship` });
|
|
443
|
+
post("tasks", "direct-chat.ship-cancel", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/ship-cancel$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/ship-cancel` });
|
|
377
444
|
for (const one of ["send", "stop", "resume", "recover", "continue", "ship", "answer"])
|
|
378
445
|
post("tasks", `code.${one}-send`, `^\\/code\\/${SESSION}\\/${one}$`, { ...CODING_ACT, sample: `/code/${"a".repeat(32)}/${one}` });
|
|
379
446
|
post("tasks", "code.changes-read", `^\\/code\\/${SESSION}\\/changes$`, { project: "coding", limited: "self", callers: ["cookie"], sample: `/code/${"a".repeat(32)}/changes` });
|
|
@@ -577,7 +644,7 @@ for (const one of ["confirm", "dismiss"])
|
|
|
577
644
|
post("chat", `chat.proposal.${one}`, `^\\/chat\\/proposal\\/${ID}\\/${one}$`, { project: "proposal", limited: "proposal", sample: `/chat/proposal/1/${one}`, ...(one === "confirm" ? { freshness: "allowlist" } : {}) });
|
|
578
645
|
for (const one of ["confirm", "dismiss"])
|
|
579
646
|
post("chat", `coordinator.proposal.${one}`, `^\\/proposals\\/${ID}\\/${one}$`, { sample: `/proposals/1/${one}` });
|
|
580
|
-
post("chat", "chat.send", "/chat", { scope: "step-up", project: "conversation", freshness: "allowlist" });
|
|
647
|
+
post("chat", "chat.send", "/chat", { scope: "step-up", project: "conversation", freshness: "allowlist", bodyCap: 16 * 1024 * 1024 });
|
|
581
648
|
post("chat", "chat.file", "^\\/chat\\/file\\/[0-9a-f]{32}$", { scope: "step-up", sample: `/chat/file/${"a".repeat(32)}` });
|
|
582
649
|
post("chat", "chat.ack-send", `^\\/chat\\/ack\\/${ID}$`, { scope: "step-up", sample: "/chat/ack/1" });
|
|
583
650
|
for (const one of ["prepare", "preview", "import", "save"])
|
package/dist/server/settings.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PASSWORDLESS_TRADE, passwordlessSetting, setPasswordless } from "../passwordless.js";
|
|
2
|
+
import { approveNetworkRequest } from "../agent-network-request.js";
|
|
2
3
|
import { declareJustMe, installModeNow, sessionStandsIn, soloNow, TEAM_FACT_WORDS } from "../install-mode.js";
|
|
3
4
|
import { ACP_AGENTS, isKeyedProvider } from "../acp-agents.js";
|
|
4
5
|
import { LIVE_VIEW_CONSENT, liveViewConsentDigest, setLiveCommands } from "../live-detail.js";
|
|
@@ -116,7 +117,7 @@ import { advancedShownNow } from "../advanced-view.js";
|
|
|
116
117
|
import { parseMachLookup, parseReadDeny } from "../project-sandbox.js";
|
|
117
118
|
import { projectDeleteConfirmHtml, projectSettingsHtml } from "../project-delete-ui.js";
|
|
118
119
|
import { endHoldout, setCodeMapSwitch } from "../code-map-acts.js";
|
|
119
|
-
import { deleteProject, holdingsWords } from "../project-delete.js";
|
|
120
|
+
import { deleteProject, holdingsWords, PROJECT_RECOVERY_DELETE_MESSAGE } from "../project-delete.js";
|
|
120
121
|
import { applySavedKnowledge, changeKnowledge, knowledgeVersion, knowledgeView } from "../project-knowledge.js";
|
|
121
122
|
import { changeLearning } from "../project-learning.js";
|
|
122
123
|
import { listDecisions, recordDecision, retireDecision, searchMemory } from "../project-memory.js";
|
|
@@ -170,6 +171,7 @@ import { personChip, ROLE_TITLES } from "./chrome.js";
|
|
|
170
171
|
import { chatReturnWithSaid, goOutside } from "./http.js";
|
|
171
172
|
import { leadSettingsHtml, notificationProjects, SETTINGS_AUTOSAVE_SCRIPT, settingsWorkers, telegramDeliveryWords, telegramTrouble } from "./render-settings.js";
|
|
172
173
|
import { loginHelpOf } from "./login-help.js";
|
|
174
|
+
import { proposeNetworkChanges } from "../route-change.js";
|
|
173
175
|
export function createSettingsHandlers(runtime) {
|
|
174
176
|
const { identities, store, providerHome, managedRepos, consoleProjects, sendScreen, chromeFor, connectionCheck, connectionKnown, lastChecks, checkRelease, clock, modelCatalog, modelSeams, toolsViewOf, codexServers, projectViewOf, sessions, restricted, options, integrations, consoleOrigin, evidenceRoot, storagePool, visible, ssoSettings, checkLocalAgents, chatKeyFor, chatCatalog, chatCatalogKnown, leadWords, agentSignInCommand, settingsUpdates, phoneSetup, authenticateApprover, authenticateCredential, deletedRepos, projectOf, providerFor, admissionList, toolHome, connectVisits, mintApprovalNonce, consumeApprovalNonce, googleVisits } = runtime;
|
|
175
177
|
async function spendPage(ctx) {
|
|
@@ -1002,16 +1004,24 @@ ${restoreHtml(chosen, retired, undoableMerges(store, chosen), disabledLessons(st
|
|
|
1002
1004
|
if (who.via !== "cookie" || who.role !== "approver" || store.isDemo() || !store.accountCanAccess(who.name, repo))
|
|
1003
1005
|
return refuse(response, who, 403, "An approver for this project changes what its builds may reach.", "/settings/project");
|
|
1004
1006
|
const back = sayTo(response, `/settings/project?repo=${encodeURIComponent(repo)}`, "#network");
|
|
1005
|
-
const
|
|
1007
|
+
const request = body.get("request") ?? "";
|
|
1008
|
+
const hosts = request !== "" ? [] : (body.get("hosts") ?? "").split(/[\s,]+/).filter(Boolean).map(normalizeHost);
|
|
1006
1009
|
if (hosts.some(one => one === null))
|
|
1007
1010
|
return back("problem", "A host is a name like api.stripe.com or *.stripe.com: no address, port or path. Nothing changed.");
|
|
1008
1011
|
if (hosts.length > MAX_NETWORK_HOSTS)
|
|
1009
1012
|
return back("problem", `A project lists at most ${MAX_NETWORK_HOSTS} hosts. Nothing changed.`);
|
|
1010
1013
|
if (!authenticateCredential(who, body.get("password") ?? "").ok)
|
|
1011
1014
|
return back("problem", "Enter your Toolroll password to change what builds may reach.");
|
|
1012
|
-
|
|
1015
|
+
if (request !== "") {
|
|
1016
|
+
const approved = approveNetworkRequest(store, { id: request, repo, digest: body.get("digest") ?? "", by: who.name, now });
|
|
1017
|
+
return back(approved.ok ? "said" : "problem", approved.ok ? `Approved the agent's request.${waitingWords(approved.waiting)}` : approved.problem);
|
|
1018
|
+
}
|
|
1019
|
+
const { changed, waiting } = store.transact(() => {
|
|
1020
|
+
const changed = store.setProjectNetwork(repo, { mode: body.get("mode") === "open" ? "open" : "allowlist", hosts: hosts, loopback: body.get("local") === "any" ? "any" : "proxy-only" }, who.name, now);
|
|
1021
|
+
return { changed, waiting: proposeNetworkChanges(store, repo, now) };
|
|
1022
|
+
});
|
|
1013
1023
|
const same = JSON.stringify(changed.before) === JSON.stringify(changed.after);
|
|
1014
|
-
return back("said", same ? "Nothing changed." :
|
|
1024
|
+
return back("said", same ? "Nothing changed." : `Saved.${waitingWords(waiting)}`);
|
|
1015
1025
|
}
|
|
1016
1026
|
async function projectDelete(ctx) {
|
|
1017
1027
|
const { response, now, posted } = ctx;
|
|
@@ -1026,6 +1036,8 @@ ${restoreHtml(chosen, retired, undoableMerges(store, chosen), disabledLessons(st
|
|
|
1026
1036
|
if ((body.get("name") ?? "").trim() !== view.name)
|
|
1027
1037
|
return back("problem", `Type ${view.name} exactly to delete it.`);
|
|
1028
1038
|
const confirm = (problem) => sendScreen(response, 200, screen(`Delete ${view.name}?`, settingsSubPage("projects", `Delete ${view.name}?`, html `<p class="k-note"><a class="k-link" href="/settings/project?repo=${encodeURIComponent(repo)}">Back to ${view.name}, and delete nothing</a></p>${projectDeleteConfirmHtml(view, problem)}`), { chrome: chromeFor(repo, "settings"), forceSensitive: true }));
|
|
1039
|
+
if (view.running.includes(PROJECT_RECOVERY_DELETE_MESSAGE))
|
|
1040
|
+
return back("problem", PROJECT_RECOVERY_DELETE_MESSAGE);
|
|
1029
1041
|
if (view.running.length > 0)
|
|
1030
1042
|
return back("problem", `Nothing was deleted: ${view.running.join(", ")}. Stop it, then try again.`);
|
|
1031
1043
|
if (body.get("step") !== "delete")
|
|
@@ -2451,11 +2463,13 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
2451
2463
|
const words = asked === null ? `No agent is signed in on this computer yet. Run ${agentSignInCommand()}, then try again.` : `${asked === "claude" ? "Claude Code" : "Codex"} isn't signed in on this computer yet.`;
|
|
2452
2464
|
return redirect(response, back ?? chatReturnWithSaid("/settings/lead", words));
|
|
2453
2465
|
}
|
|
2466
|
+
const fromLeadChat = body.get("return") === "/chat";
|
|
2454
2467
|
store.transact(() => {
|
|
2455
|
-
|
|
2456
|
-
|
|
2468
|
+
const current = store.getChatConfig();
|
|
2469
|
+
if (current?.provider !== provider)
|
|
2470
|
+
store.setChatConfig({ provider, model: "default", dailyTurns: (fromLeadChat ? current?.dailyTurns : undefined) ?? 50, weeklyCeilingMicrousd: 0, priceInMicrousd: 0, priceOutMicrousd: 0 }, who.name, now);
|
|
2457
2471
|
const agent = defaultAgentOf(provider);
|
|
2458
|
-
if (who.via === "cookie" && who.authority === "local-owner" && agent !== null)
|
|
2472
|
+
if (!fromLeadChat && who.via === "cookie" && who.authority === "local-owner" && agent !== null)
|
|
2459
2473
|
fillDefaultRouting(store, agent, who.name, { kind: "local-owner" }, now);
|
|
2460
2474
|
});
|
|
2461
2475
|
return redirect(response, back ?? "/chat");
|
|
@@ -3424,3 +3438,4 @@ function savedLoginOf(store) {
|
|
|
3424
3438
|
const help = loginHelpOf(store, { here: true });
|
|
3425
3439
|
return help.kind === "password" ? help.savedAt : null;
|
|
3426
3440
|
}
|
|
3441
|
+
const waitingWords = (count) => count === 0 ? "" : ` ${count === 1 ? "1 task waits" : `${count} tasks wait`} for your Approve to use it.`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { localOwnerRefusal } from "../local-owner.js";
|
|
1
2
|
import { requestContext } from "./request-context.js";
|
|
2
3
|
import { heldFindingCount } from "../findings.js";
|
|
3
4
|
import { familyInWebReach } from "../findings.js";
|
|
@@ -8,7 +9,7 @@ import { feedbackImageProblem } from "../result-actions.js";
|
|
|
8
9
|
import { parseFeedbackImage } from "../result-review.js";
|
|
9
10
|
import { releaseViewOf } from "../release-view.js";
|
|
10
11
|
import { RELEASE_STEPS } from "../release.js";
|
|
11
|
-
import { releaseProgressFor, shipChecksForTask } from "../store.js";
|
|
12
|
+
import { agentSaidOf, releaseProgressFor, shipChecksForTask } from "../store.js";
|
|
12
13
|
import { releaseCiRunningOf } from "../release-ci-hold.js";
|
|
13
14
|
import { releaseObligationsOf } from "../release-recheck.js";
|
|
14
15
|
import { approvalProofOf, freshnessFor, withFreshness } from "../scope.js";
|
|
@@ -23,7 +24,7 @@ import { html, htmlString, joinHtml } from "../html.js";
|
|
|
23
24
|
import { assignmentStatusOf, assignmentWithEvidence } from '../assignment-ui.js';
|
|
24
25
|
import { assignmentOf, personCompletionRefusal } from '../assignment.js';
|
|
25
26
|
import { knowledgeContextHtml } from "../knowledge-ui.js";
|
|
26
|
-
import { failedAttemptSentence, failingCheckSuggestion, GENERAL_SUGGESTION, isInternalErrorReason, latestFinishedAttempt, missedRequirementLine, missedRequirementSuggestion, NO_REASON_RECORDED, stopSuggestionOf } from '../needs-you.js';
|
|
27
|
+
import { codexOfflineDependencySuggestion, failedAttemptSentence, failingCheckSuggestion, GENERAL_SUGGESTION, isInternalErrorReason, latestFinishedAttempt, missedRequirementLine, missedRequirementSuggestion, NO_REASON_RECORDED, stopSuggestionOf } from '../needs-you.js';
|
|
27
28
|
import { planAutoPending } from "../plan-auto.js";
|
|
28
29
|
import { planSourceOf, retryPinsOf } from "../local-owner-acts.js";
|
|
29
30
|
import { planBackoffFor, planStoppedFor } from "../engine-reads.js";
|
|
@@ -414,6 +415,8 @@ export function createTaskViews(runtime) {
|
|
|
414
415
|
approvalSummary,
|
|
415
416
|
route: routeView,
|
|
416
417
|
canEditRoute: who.role === "approver",
|
|
418
|
+
...(who.via === "cookie" && who.authority === "local-owner" && who.role === "approver"
|
|
419
|
+
? { routeSignIn: localOwnerRefusal(runtime.store.accountOf(who.name)?.passwordSet === true, taskHref(taskId)) } : {}),
|
|
417
420
|
resultRecord: resultRecordWordsOf(runtime.store, taskId, runtime.evidenceRoot, now),
|
|
418
421
|
spendDefaults: runtime.store.getSpendDefaults(),
|
|
419
422
|
permissionDefault: runtime.store.permissionDefault().mode,
|
|
@@ -643,7 +646,16 @@ export function createTaskViews(runtime) {
|
|
|
643
646
|
suggestion: missedRequirementSuggestion(missed.statement), link: see };
|
|
644
647
|
}
|
|
645
648
|
const internal = isInternalErrorReason(run.reason);
|
|
646
|
-
|
|
649
|
+
let codexHint = null;
|
|
650
|
+
if (run.provider === "codex") {
|
|
651
|
+
const repo = taskId === "" ? null : runtime.store.lookupRef(taskId)?.repo ?? null;
|
|
652
|
+
codexHint = codexOfflineDependencySuggestion({
|
|
653
|
+
provider: run.provider,
|
|
654
|
+
agentSaid: agentSaidOf(runtime.store, run.id),
|
|
655
|
+
hasSetup: repo !== null && runtime.store.liveWorktreeSetup(repo) !== null,
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
return { kind: "reason", line: failedAttemptSentence(run.reason), evidence: null, suggestion: codexHint ?? stopSuggestionOf(run.reason),
|
|
647
659
|
link: internal ? { label: "The recorded error", href: `/r/${run.id}?record=1#run-reason-detail` } : see };
|
|
648
660
|
}
|
|
649
661
|
function runChecksHere(runId, who, returnTo) {
|
package/dist/server/tasks.js
CHANGED
|
@@ -29,7 +29,7 @@ import { codingShippingHtml } from '../coding-shipping-ui.js';
|
|
|
29
29
|
import { codingWorkspaceHtml, codingWorkspaceScript } from '../coding-ui.js';
|
|
30
30
|
import { CodingActionError } from '../coding-workspace.js';
|
|
31
31
|
import { checkResponse, CONSOLE_FORMS, readForm } from "../contracts/console-api.js";
|
|
32
|
-
import { LOCAL_TASK_CHANGED, PLAN_AGAIN_FIRST, planAgainAsLocalOwner, planSourceOf, RESOLVE_INCIDENT_FIRST, requestPlanAsLocalOwner, retryAsLocalOwner, retryPinsOf } from "../local-owner-acts.js";
|
|
32
|
+
import { AGENTS_PICK_AGAIN, LOCAL_TASK_CHANGED, localOwnerChangeAgents, PLAN_AGAIN_FIRST, planAgainAsLocalOwner, planSourceOf, RESOLVE_INCIDENT_FIRST, requestPlanAsLocalOwner, retryAsLocalOwner, retryPinsOf } from "../local-owner-acts.js";
|
|
33
33
|
import { hasForbiddenControls, validateNote } from "../decision.js";
|
|
34
34
|
import { builderReadyFor, diagnoseTaskDispatch, firstRunBuilderRepo } from "../dispatch.js";
|
|
35
35
|
import { firstTaskSuggestions, withBuilderStep } from "../first-run.js";
|
|
@@ -1821,12 +1821,22 @@ export function createTasksHandlers(runtime) {
|
|
|
1821
1821
|
? "Enter a reason for cancelling this coordinator filing."
|
|
1822
1822
|
: "Use at most 500 plain characters, without hidden or control characters.", 400, undefined, reason ?? "");
|
|
1823
1823
|
}
|
|
1824
|
-
|
|
1824
|
+
const words = cancelled.reason === "claimed" ? "This task is running right now. Stop it first, then cancel it."
|
|
1825
|
+
: cancelled.reason === "already-terminal" ? "This task has already ended."
|
|
1826
|
+
: `not cancelled: ${cancelled.reason}`;
|
|
1827
|
+
return taskScreen(response, who, taskId, words, 409);
|
|
1825
1828
|
}
|
|
1826
1829
|
return redirect(response, taskHref(taskId));
|
|
1827
1830
|
}
|
|
1828
1831
|
case "route": {
|
|
1829
1832
|
const body = readForm(posted, CONSOLE_FORMS.taskRoute);
|
|
1833
|
+
if (who.via === "cookie" && who.authority === "local-owner") {
|
|
1834
|
+
const changed = localOwnerRoute(store, taskId, body, now);
|
|
1835
|
+
if (!changed.ok)
|
|
1836
|
+
return taskScreen(response, who, taskId, changed.message, changed.status);
|
|
1837
|
+
const back = body.get("return") === "chat" ? taskChatHref(taskId) : taskHref(taskId);
|
|
1838
|
+
return redirect(response, body.get("return") === "chat" ? chatReturnWithSaid(back, changed.words) : `${chatReturnWithSaid(back, changed.words)}#agents`);
|
|
1839
|
+
}
|
|
1830
1840
|
const sizeGiven = body.get("size");
|
|
1831
1841
|
const riskyGiven = body.getAll("risky");
|
|
1832
1842
|
const phaseGiven = body.get("phase");
|
|
@@ -2989,3 +2999,30 @@ export function requeueBlockedWords(store, taskId, run, digest, local) {
|
|
|
2989
2999
|
return PLAN_AGAIN_FIRST;
|
|
2990
3000
|
return local ? RESOLVE_INCIDENT_FIRST : null;
|
|
2991
3001
|
}
|
|
3002
|
+
const LOCAL_ROUTE_REFUSED_FIELDS = ["size", "risky", "clear-phase", "provider", "model"];
|
|
3003
|
+
export function localOwnerRoute(store, taskId, body, now) {
|
|
3004
|
+
if (LOCAL_ROUTE_REFUSED_FIELDS.some(field => body.has(field)))
|
|
3005
|
+
return { ok: false, status: 400, message: "Only the planner's or the builder's model can be changed here." };
|
|
3006
|
+
const phase = body.get("phase");
|
|
3007
|
+
if (phase !== "plan" && phase !== "build")
|
|
3008
|
+
return { ok: false, status: 400, message: "Pick a model for the planner or the builder." };
|
|
3009
|
+
const agent = (body.get("agent") ?? "").trim();
|
|
3010
|
+
const bar = agent.indexOf("|");
|
|
3011
|
+
const provider = bar === -1 ? agent : agent.slice(0, bar), model = bar === -1 ? "" : agent.slice(bar + 1).trim();
|
|
3012
|
+
if (!isProviderId(provider) || model === "")
|
|
3013
|
+
return { ok: false, status: 400, message: "Pick one of the models offered." };
|
|
3014
|
+
const valid = validateSpec({ provider, model });
|
|
3015
|
+
if (!valid.ok)
|
|
3016
|
+
return { ok: false, status: 400, message: `That model can't be used: ${valid.problem}` };
|
|
3017
|
+
if (phase === "plan" && isAcpProvider(provider))
|
|
3018
|
+
return { ok: false, status: 400, message: `${ACP_AGENTS[provider].name} builds and repairs only. Choose another agent to plan.` };
|
|
3019
|
+
const sawDigest = body.get("sawDigest") ?? "";
|
|
3020
|
+
if (!/^[a-f0-9]{32}$/.test(sawDigest))
|
|
3021
|
+
return { ok: false, status: 409, message: AGENTS_PICK_AGAIN };
|
|
3022
|
+
const whenGiven = body.get("when") ?? "";
|
|
3023
|
+
const when = whenGiven === "" || whenGiven === "now" ? "now" : whenGiven === "next-run" || whenGiven === "restart" ? whenGiven : null;
|
|
3024
|
+
if (when === null)
|
|
3025
|
+
return { ok: false, status: 400, message: "Say when: now, next run, or restart." };
|
|
3026
|
+
const done = localOwnerChangeAgents(store, taskId, { phase, provider, model, sawDigest }, when, now);
|
|
3027
|
+
return done.ok ? { ok: true, words: done.words } : done;
|
|
3028
|
+
}
|