toolroll 0.9.123 → 0.9.126
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 +60 -0
- package/README.md +1 -1
- package/dist/advanced-view.js +0 -1
- package/dist/agent-detect.js +23 -3
- package/dist/bounded-spawn.js +5 -36
- package/dist/browser/workspace.css +1 -1
- package/dist/browser/workspace.js +29 -29
- package/dist/browser-open.js +49 -0
- package/dist/chat-acceptance.js +1 -1
- package/dist/chat-actions.js +1 -1
- package/dist/check-only.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/connect-cli.js +2 -8
- package/dist/contracts/engine-api.js +5 -0
- package/dist/direct-chat-git.js +20 -0
- package/dist/direct-chat-ship.js +5 -5
- package/dist/direct-chat.js +29 -20
- package/dist/doctor.js +30 -3
- package/dist/easy-start.js +43 -17
- package/dist/engine-reads.js +14 -0
- package/dist/evals.js +17 -19
- package/dist/first-run.js +5 -1
- package/dist/flexible-import.js +3 -2
- package/dist/flexible-save.js +2 -0
- package/dist/flexible-session.js +1 -1
- package/dist/flexible-thread.js +14 -2
- package/dist/flow-code.js +2 -2
- package/dist/git-identity.js +65 -0
- package/dist/invoke.js +4 -4
- package/dist/laptop-background.js +2 -11
- package/dist/linux-packages.js +46 -0
- package/dist/local-landing.js +35 -5
- package/dist/merge-checklist.js +33 -4
- package/dist/operate.js +19 -20
- package/dist/passwordless.js +10 -2
- package/dist/preflight.js +14 -0
- package/dist/process-identity.js +155 -0
- package/dist/project-skills.js +2 -2
- package/dist/quick-start.js +6 -1
- package/dist/release.js +8 -0
- package/dist/runner-process.js +9 -25
- package/dist/sandbox-launch.js +3 -2
- package/dist/sandbox-runtime.js +115 -15
- package/dist/sandbox-tools.js +91 -6
- package/dist/server/direct-chat.js +33 -6
- package/dist/server/merge-ready-view.js +4 -2
- package/dist/server/pages.js +1 -1
- package/dist/server/render-pages.js +1 -0
- package/dist/server/render-results.js +6 -6
- package/dist/server/render-tasks.js +7 -2
- package/dist/server/route-table.js +3 -0
- package/dist/server/settings-sections.js +1 -1
- package/dist/server/settings.js +55 -33
- package/dist/server/task-views.js +14 -8
- package/dist/server/tasks.js +14 -3
- package/dist/settings-groups-ui.js +6 -6
- package/dist/shown-text.js +14 -0
- package/dist/skill-library.js +22 -5
- package/dist/skills-ui.js +24 -11
- package/dist/status-probe.js +32 -0
- package/dist/task-base.js +2 -2
- package/dist/task-status.js +7 -4
- package/dist/telegram-status.js +1 -1
- package/dist/toolroll-update.js +4 -0
- package/dist/trust-repair.js +187 -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/work-index.js +51 -3
- package/dist/workspace-ui.js +4 -2
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { cancelDirectChatShip, executeDirectChatShip, listDirectChatShips, previ
|
|
|
10
10
|
import { soloNow } from "../install-mode.js";
|
|
11
11
|
import { backgroundInstalled } from "../laptop-background.js";
|
|
12
12
|
import { localOwnerStandsNow } from "../local-owner.js";
|
|
13
|
+
import { gitCommand, UNSAFE_FOLDER } from "../local-landing.js";
|
|
13
14
|
import { projectName, rowVisible } from "../project.js";
|
|
14
15
|
import { handlersOf } from "./handler-registry.js";
|
|
15
16
|
import { redirect, respond } from "./http.js";
|
|
@@ -231,7 +232,7 @@ export function createDirectChatHandlers(runtime, deps) {
|
|
|
231
232
|
})),
|
|
232
233
|
attachments: found.attachments.map(toArtifactView),
|
|
233
234
|
ships,
|
|
234
|
-
diff: responseDiff,
|
|
235
|
+
diff: { changedFiles: responseDiff.changedFiles, diffText: responseDiff.diffText, dirty: responseDiff.dirty, ...(responseDiff.unread === true ? { unread: true } : {}) },
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
async function start(ctx) {
|
|
@@ -594,15 +595,25 @@ export function createDirectChatHandlers(runtime, deps) {
|
|
|
594
595
|
const { thread, turns, diff, running } = found;
|
|
595
596
|
const turnHtml = turns.map(turn => html `<section class="card" data-turn="${turn.id}"><p><b>You</b> · <span class="k-note">${STATUS_WORDS[turn.status] ?? turn.status}</span></p><p class="pre-wrap">${turn.userPrompt}</p>${turn.assistantText.trim() === "" ? "" : html `<p><b>${thread.provider === "claude" ? "Claude" : thread.provider === "codex" ? "Codex" : "Gemini"}</b></p><p class="pre-wrap">${turn.assistantText}</p>`}${turn.errorText === null ? "" : html `<p class="problem">${turn.errorText}</p>`}</section>`);
|
|
596
597
|
const shownDiff = diff.diffText.length > DIFF_SHOWN ? `${diff.diffText.slice(0, DIFF_SHOWN)}\n… (shortened)` : diff.diffText;
|
|
597
|
-
const
|
|
598
|
-
|
|
598
|
+
const unread = diff.unread === true ? html `<p class="k-note" data-direct-chat-diff-unread>Toolroll couldn't read its copy of the project after its last turn${diff.changedFiles.length === 0 ? "" : ", so these are the changes it saw before"}.</p>` : "";
|
|
599
|
+
const changes = diff.changedFiles.length === 0 ? unread !== "" ? unread : html `<p class="k-note">No changes in its copy of the project.</p>`
|
|
600
|
+
: html `${unread}<p class="k-note">${diff.changedFiles.length} ${diff.changedFiles.length === 1 ? "file" : "files"} changed in its own copy of the project, as of its last turn${running ? " (it's still working)" : ""}.</p><ul>${diff.changedFiles.map(file => html `<li class="k-mono">${file}</li>`)}</ul>${shownDiff === "" ? "" : html `<details><summary>The changes</summary><pre class="k-mono" data-direct-chat-diff>${shownDiff}</pre></details>`}`;
|
|
599
601
|
const ships = listDirectChatShips(store, thread.id);
|
|
600
|
-
const
|
|
602
|
+
const bringIn = (one) => {
|
|
603
|
+
if (one.mode !== "keep-branch" || one.state !== "kept" || !/^[0-9a-f]{40}$/.test(one.candidateSha))
|
|
604
|
+
return "";
|
|
605
|
+
const command = gitCommand(one.repo, ["merge", "--ff-only", one.candidateSha]);
|
|
606
|
+
return command === null ? html `<br><span class="k-note">${UNSAFE_FOLDER(`git merge --ff-only ${one.candidateSha}`)}</span>`
|
|
607
|
+
: html `<br>To bring it in: <code class="k-mono" data-direct-chat-merge>${command}</code>`;
|
|
608
|
+
};
|
|
609
|
+
const shipped = ships.length === 0 ? "" : html `<ul>${ships.map(one => html `<li>${one.mode === "keep-branch" ? "Saved as branch" : "Shipped"} <span class="k-mono">${one.branch}</span> · ${one.state}${one.taskId === null ? "" : html ` · <a class="k-link" href="/t/${encodeURIComponent(one.taskId)}">Open task</a>`}${bringIn(one)}</li>`)}</ul>`;
|
|
610
|
+
const again = ctx.url.searchParams.get("review") === "again" && !running && diff.changedFiles.length > 0
|
|
611
|
+
? html `<p class="k-note" data-direct-chat-review-again>That Ship review isn't kept after you leave it. Press Review Ship to see it again.</p>` : "";
|
|
601
612
|
const shipAct = running || diff.changedFiles.length === 0 ? "" : postForm(`/direct-chats/${thread.id}/ship-review`, btn("Review Ship", { variant: "primary", type: "submit" }));
|
|
602
613
|
const reply = thread.isLegacy ? html `<p class="k-note" data-direct-chat-read-only>Imported from an earlier version: read only. Start a new Direct Chat to go on.</p>`
|
|
603
614
|
: running ? html `<p class="k-note">It's working on your last message. Reply when it finishes.</p>`
|
|
604
615
|
: postForm(`/direct-chats/${thread.id}/reply`, html `${field({ id: "direct-chat-reply", label: "Reply", control: textarea({ id: "direct-chat-reply", name: "prompt", rows: 3, attrs: { required: true, maxlength: "20000" } }) })}${btn("Send", { variant: "primary", type: "submit" })}`, { hidden: { request: randomBytes(16).toString("hex") } });
|
|
605
|
-
const body = html `<h1>${thread.title || "Direct Chat"}</h1><p class="k-note">${thread.project} · ${thread.provider}${thread.modelId ? ` · ${thread.modelId}` : ""}${running ? " · Working" : ""}</p>${turnHtml}${reply}<h2>Changes</h2>${changes}<h2>Ship</h2>${shipped}${shipAct === "" && ships.length === 0 ? html `<p class="k-note">${running ? "Ship opens when it finishes." : "Nothing to ship yet."}</p>` : shipAct}<p><a class="k-link" href="/direct-chats">All Direct Chats</a></p>`;
|
|
616
|
+
const body = html `<h1>${thread.title || "Direct Chat"}</h1><p class="k-note">${thread.project} · ${thread.provider}${thread.modelId ? ` · ${thread.modelId}` : ""}${running ? " · Working" : ""}</p>${turnHtml}${reply}<h2>Changes</h2>${changes}<h2>Ship</h2>${again}${shipped}${shipAct === "" && ships.length === 0 ? html `<p class="k-note">${running ? "Ship opens when it finishes." : "Nothing to ship yet."}</p>` : shipAct}<p><a class="k-link" href="/direct-chats">All Direct Chats</a></p>`;
|
|
606
617
|
return runtime.sendScreen(ctx.response, 200, screen(thread.title || "Direct Chat", body, { chrome: runtime.chromeFor(thread.repo, "tasks") }));
|
|
607
618
|
}
|
|
608
619
|
async function pageReply(ctx) {
|
|
@@ -634,10 +645,24 @@ export function createDirectChatHandlers(runtime, deps) {
|
|
|
634
645
|
return pageRefusal(ctx, res.status, res.error);
|
|
635
646
|
const preview = res.preview;
|
|
636
647
|
const local = gate.who.authority === "local-owner";
|
|
637
|
-
const facts = html `<ul><li>${preview.mode === "keep-branch" ? "
|
|
648
|
+
const facts = html `<ul><li>${preview.mode === "keep-branch" ? "Save the branch" : "Ship from branch"} <span class="k-mono">${preview.branch}</span></li><li>${preview.changedFiles.length} ${preview.changedFiles.length === 1 ? "file" : "files"}: ${preview.changedFiles.slice(0, 20).join(", ")}${preview.changedFiles.length > 20 ? "…" : ""}</li><li>${preview.checkCommand === null ? "No check command" : html `Check: <span class="k-mono">${preview.checkCommand}</span>`}</li><li>${preview.mergeSummary}</li>${preview.autoMergeReason === null ? "" : html `<li>${preview.autoMergeReason}</li>`}</ul>`;
|
|
638
649
|
const form = postForm(`/direct-chats/${threadId}/ship`, html `${local ? "" : html `<label>Password<input type="password" name="password" autocomplete="current-password" required></label>`}${btn(preview.mode === "keep-branch" ? "Save the branch" : "Ship it", { variant: "primary", type: "submit" })} ${btn("Cancel", { variant: "ghost", href: `/direct-chats/${threadId}` })}`, { hidden: { mode: preview.mode, termsDigest: preview.termsDigest, title: preview.title, goal: preview.goal } });
|
|
639
650
|
return runtime.sendScreen(ctx.response, 200, screen("Ship", html `<h1>Ship ${preview.title}</h1>${facts}${form}`, { chrome: runtime.chromeFor(thread.repo, "tasks") }));
|
|
640
651
|
}
|
|
652
|
+
async function pageShipReviewAgain(ctx) {
|
|
653
|
+
const gate = admit(ctx, null);
|
|
654
|
+
if (!gate.ok)
|
|
655
|
+
return pageRefusal(ctx, gate.status, gate.error);
|
|
656
|
+
const threadId = PAGE_PATH.exec(ctx.url.pathname)?.[1] ?? "";
|
|
657
|
+
return redirect(ctx.response, `/direct-chats/${threadId}?review=again`);
|
|
658
|
+
}
|
|
659
|
+
async function pageShipDone(ctx) {
|
|
660
|
+
const gate = admit(ctx, null);
|
|
661
|
+
if (!gate.ok)
|
|
662
|
+
return pageRefusal(ctx, gate.status, gate.error);
|
|
663
|
+
const threadId = PAGE_PATH.exec(ctx.url.pathname)?.[1] ?? "";
|
|
664
|
+
return redirect(ctx.response, `/direct-chats/${threadId}`);
|
|
665
|
+
}
|
|
641
666
|
async function pageShip(ctx) {
|
|
642
667
|
const gate = admit(ctx, "direct-chat-ship");
|
|
643
668
|
if (!gate.ok)
|
|
@@ -667,6 +692,8 @@ export function createDirectChatHandlers(runtime, deps) {
|
|
|
667
692
|
"direct-chat.page": pageDetail,
|
|
668
693
|
"direct-chat.page-ship-review": pageShipReview,
|
|
669
694
|
"direct-chat.page-ship": pageShip,
|
|
695
|
+
"direct-chat.page-ship-review-again": pageShipReviewAgain,
|
|
696
|
+
"direct-chat.page-ship-done": pageShipDone,
|
|
670
697
|
"direct-chat.page-reply": pageReply,
|
|
671
698
|
"direct-chat.list": list,
|
|
672
699
|
"direct-chat.detail": detail,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
2
|
import { checklistFromAssignment } from "../merge-checklist.js";
|
|
3
3
|
import { isRevisionFeedback, revisionBatchOf, revisionSourceOf } from "../result-review.js";
|
|
4
|
-
export function mergeReadyViewOf(store, taskId, assignment, who, runChecks, returnTo) {
|
|
4
|
+
export function mergeReadyViewOf(store, taskId, assignment, who, runChecks, returnTo, landed = null, base = null) {
|
|
5
5
|
if (assignment == null || assignment.receipt === null)
|
|
6
6
|
return null;
|
|
7
|
-
const list = checklistFromAssignment(store, taskId, assignment);
|
|
7
|
+
const list = checklistFromAssignment(store, taskId, assignment, landed, base);
|
|
8
|
+
if (list.answer === "landed")
|
|
9
|
+
return null;
|
|
8
10
|
const person = who.via === "cookie" && who.role === "approver" && !store.isDemo();
|
|
9
11
|
const receipt = assignment.receipt;
|
|
10
12
|
const notes = store.liveDiffComments(receipt.runId).filter(one => isRevisionFeedback(one));
|
package/dist/server/pages.js
CHANGED
|
@@ -1308,7 +1308,7 @@ export function createPagesHandlers(runtime, work) {
|
|
|
1308
1308
|
const body = {
|
|
1309
1309
|
version: ENGINE_API_VERSION, project: view.project, projectName: view.projectName, needsCount: view.needsCount, groups: list.groups,
|
|
1310
1310
|
rows: list.rows.map(row => ({ id: row.id, title: row.title, href: row.href, project: row.project, age: row.age, status: row.status, word: row.word, ask: row.ask,
|
|
1311
|
-
chip: row.chip, group: row.group, rank: row.rank, detail: row.detail, problem: row.problem, need: row.need === undefined ? null : needOf(row.need),
|
|
1311
|
+
chip: row.chip, group: row.group, rank: row.rank, ...(row.check === undefined ? {} : { check: row.check }), detail: row.detail, problem: row.problem, need: row.need === undefined ? null : needOf(row.need),
|
|
1312
1312
|
waiting: waiting.get(row.id) ?? null })),
|
|
1313
1313
|
needs: view.needs.map(group => ({ key: group.key, label: group.label, count: group.count, rows: group.rows.map(needOf) })),
|
|
1314
1314
|
next: list.pages.next, room: "workspace", spend, limits,
|
|
@@ -344,6 +344,7 @@ export function workPage(chrome, data) {
|
|
|
344
344
|
id: row.rootId, title: row.title, href: taskHref(row.rootId), project: projectOf(row), age: relativeAge(row.updatedAt, data.now),
|
|
345
345
|
status: { label: row.status.label, tone: row.status.tone, token: row.status.token }, chip: row.chip, word: chip,
|
|
346
346
|
ask: row.ask, group: row.ask ?? (row.status.rank === 1 ? 'building' : 'rest'), rank: row.status.rank,
|
|
347
|
+
...(row.check === undefined ? {} : { check: row.check }),
|
|
347
348
|
action: actionHref === null || row.primaryAction === null || row.ask === null ? null : { label: row.primaryAction.label, href: actionHref },
|
|
348
349
|
detail: needsYouDetail ? row.status.detail : row.progress ?? (row.ask === null && row.status.detail !== row.status.label ? row.status.detail : null),
|
|
349
350
|
problem: row.familyProblem,
|
|
@@ -591,7 +591,7 @@ export function reviewCockpitDetailParts(view, csrf, noted, canRetryReview, tab,
|
|
|
591
591
|
const matrix = proof === null || proof.proofProblem !== null ? [] : proof.matrix;
|
|
592
592
|
const unanswered = accepted || youCheck == null ? [] : youCheck.items.length > 0 ? youCheck.items.map(one => one.statement === "" ? one.words : one.statement) : youCheck.lines;
|
|
593
593
|
const base = !acceptsHere ? null : acceptWordsOf({
|
|
594
|
-
checks: checks === undefined ? null : { passed: "passed", failed: "failed", running: "running", "not-run": "not-run", off: "off", unreadable: "unavailable" }[approvedCheckStateOf(checks)],
|
|
594
|
+
checks: checks === undefined ? null : { passed: "passed", failed: "failed", running: "running", "not-run": "not-run", off: "off", stale: "unavailable", unreadable: "unavailable" }[approvedCheckStateOf(checks)],
|
|
595
595
|
unmet: matrix.filter(row => !["Met", "You check", CHECKED_AT_RELEASE].includes(requirementWordOf(row, null, checks === undefined ? undefined : checkBackingOf(checks)))).length,
|
|
596
596
|
action: complete !== null ? "complete" : "accept",
|
|
597
597
|
publishing: view.detail?.publishing ?? "other",
|
|
@@ -603,7 +603,7 @@ export function reviewCockpitDetailParts(view, csrf, noted, canRetryReview, tab,
|
|
|
603
603
|
const followUps = view.detail.followUps ?? null;
|
|
604
604
|
const checksRunning = checks?.running != null || (followUps?.checks.some(one => one.state === "waiting" || one.state === "running") ?? false);
|
|
605
605
|
const runChecks = canRetryReview && csrf !== "" && followUps !== null && (followUps.full || followUps.quick) && !checksRunning &&
|
|
606
|
-
(checks === undefined || ((checks.status === "not-run" || checks.status === "unavailable") && checks.release == null))
|
|
606
|
+
(checks === undefined || ((checks.status === "not-run" || checks.status === "unavailable" || (checks.status === "failed" && assignment?.state === "complete")) && checks.release == null))
|
|
607
607
|
? { action: `/r/${run.id}/checks`, level: followUps.full ? "full" : "quick", returnTo: at("checks") } : null;
|
|
608
608
|
const need = panel.panel.need;
|
|
609
609
|
const nextKind = selected.next?.kind;
|
|
@@ -1378,7 +1378,7 @@ export function resultPanelParts(detail, o) {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
if (detail.ciFailing && publication !== null && taskStatus === null)
|
|
1380
1380
|
attention.push(`CI is failing on PR #${publication.prNumber} at the last check.`);
|
|
1381
|
-
const personChecks = proof === null || proof.accepted !== null ? [] : [
|
|
1381
|
+
const personChecks = proof === null || proof.accepted !== null || detail.landed === true ? [] : [
|
|
1382
1382
|
...proof.matrix.filter(row => row.state === "manual-review").map(row => personCheckWords(row.statement)),
|
|
1383
1383
|
...(proof.matrix.length > 0 ? [] : proof.reasons.filter(reason => manualReviewCriterionOf(reason) !== null).map(() => personCheckWords(null))),
|
|
1384
1384
|
];
|
|
@@ -1657,9 +1657,9 @@ export function resultPanelParts(detail, o) {
|
|
|
1657
1657
|
views: [{ key: "summary", html: htmlString(joinHtml(summaryParts, "\n")) }, { key: "changes", html: htmlString(joinHtml(changeParts, "\n")) }, { key: "checks", html: htmlString(joinHtml(checkParts, "\n")) }],
|
|
1658
1658
|
history: detail.history === undefined ? "" : htmlString(detail.history),
|
|
1659
1659
|
learning: detail.learning === undefined ? "" : htmlString(detail.learning),
|
|
1660
|
-
request: detail.skillTest ? null : htmlString(joinHtml(requestParts, "\n")),
|
|
1661
|
-
canRequest: detail.canAnnotate && o.csrf !== "",
|
|
1662
|
-
sendBack: detail.skillTest || !detail.canAnnotate || o.csrf === "" ? null
|
|
1660
|
+
request: detail.skillTest || detail.landed === true ? null : htmlString(joinHtml(requestParts, "\n")),
|
|
1661
|
+
canRequest: detail.canAnnotate && o.csrf !== "" && detail.landed !== true,
|
|
1662
|
+
sendBack: detail.skillTest || !detail.canAnnotate || o.csrf === "" || detail.landed === true ? null
|
|
1663
1663
|
: { action: `/r/${runId}/comment`, batch: revisionBatchOf(detail.comments), source: revisionSourceOf(detail.sourceDigest), request: o.requestToken },
|
|
1664
1664
|
need,
|
|
1665
1665
|
requestQuiet: detail.canAnnotate && o.csrf !== "" && detail.comments.length === 0 && (detail.pastComments?.length ?? 0) === 0 && detail.revisions.length === 0,
|
|
@@ -1979,7 +1979,7 @@ export function taskBodyParts(data) {
|
|
|
1979
1979
|
if (data.repo !== null)
|
|
1980
1980
|
work.push({ label: "Project", parts: [projectName(data.repo)] });
|
|
1981
1981
|
if (data.base != null)
|
|
1982
|
-
work.push({ label: "Base", parts: [baseStandingWords(data.base)] });
|
|
1982
|
+
work.push({ label: "Base", parts: [baseStandingWords(data.base, data.landing?.onBranch === true)] });
|
|
1983
1983
|
work.push({ label: "Agent", parts: [lastRunForAgent !== undefined ? `${lastRunForAgent.provider}${lastRunForAgent.model === null ? "" : ` · ${lastRunForAgent.model}`} on ${lastRunForAgent.runner}`
|
|
1984
1984
|
: data.route?.legacy != null ? `${data.route.legacy.provider} · ${data.route.legacy.model}` : "The project's default"] });
|
|
1985
1985
|
if (scope !== null)
|
|
@@ -2150,7 +2150,7 @@ export function taskBodyParts(data) {
|
|
|
2150
2150
|
{ key: "route-change", html: data.routeChange == null ? "" : htmlString(html `<div class="card"><p>${data.routeChange}</p></div>`) },
|
|
2151
2151
|
{ key: "fast-grown", html: data.fastGrown == null || data.csrf === "" ? "" : htmlString(html `<div class="card"><p>${data.fastGrown}</p>${postForm(`${taskHref(task.id)}/keep-grown`, btn("Approve it", { variant: "primary", type: "submit" }))}</div>`) },
|
|
2152
2152
|
{ key: "pull-request", html: fragmentString(pullRequestCard) },
|
|
2153
|
-
{ key: "landing", html: data.landing == null ? "" : htmlString(landingCardHtml(data.landing, data.csrf)) },
|
|
2153
|
+
{ key: data.landing?.onBranch === true ? "landed" : "landing", html: data.landing == null ? "" : htmlString(landingCardHtml(data.landing, data.csrf)) },
|
|
2154
2154
|
{ key: "needs-scope", html: fragmentString(needsScopeCard) },
|
|
2155
2155
|
{ key: "mirror", html: fragmentString(mirrorCard) }, { key: "attempt", html: fragmentString(attemptPanel), ...(liveRunId === null ? {} : { instance: String(liveRunId) }) },
|
|
2156
2156
|
].filter(one => one.html !== ""),
|
|
@@ -2345,6 +2345,11 @@ export function landingCardHtml(landing, csrf) {
|
|
|
2345
2345
|
const act = csrf === "" ? "" : landing.canLand
|
|
2346
2346
|
? postForm(`${taskHref(landing.taskId)}/land`, btn("Land it", { type: "submit" }))
|
|
2347
2347
|
: landing.canUndo ? postForm(`${taskHref(landing.taskId)}/land`, btn("Undo landing", { variant: "ghost", type: "submit" }), { hidden: { undo: "1" } }) : "";
|
|
2348
|
+
const kept = landing.landed === null ? landing.kept ?? null : null;
|
|
2349
|
+
if (kept !== null) {
|
|
2350
|
+
const how = kept.command === null ? html `<p>${kept.words}</p>` : html `<p>To bring it in: <code class="k-mono" data-land-command>${kept.command}</code></p>`;
|
|
2351
|
+
return html `<section class="card" id="land" data-landing="kept"><strong>Landing commit ${kept.commit.slice(0, 7)} is ready</strong><p class="meta">Your project folder has ${kept.branch} checked out, so Toolroll didn't touch it.</p>${how}</section>`;
|
|
2352
|
+
}
|
|
2348
2353
|
const title = landing.landed !== null && !landing.canLand ? landing.landed : "Not on your branch yet";
|
|
2349
2354
|
const meta = landing.canLand ? "You see where it lands before anything moves." : "";
|
|
2350
2355
|
return html `<section class="card" id="land" data-landing="${landing.landed === null ? "no" : "yes"}"><strong>${title}</strong>${meta === "" ? "" : html `<p class="meta">${meta}</p>`}${act}</section>`;
|
|
@@ -282,6 +282,8 @@ get("tasks", "direct-chat.list", "/engine/direct-chats", DIRECT_CHAT);
|
|
|
282
282
|
get("tasks", "direct-chat.detail", `^\\/engine\\/direct-chats\\/${TERMINAL}$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}` });
|
|
283
283
|
get("tasks", "direct-chat.page-list", "/direct-chats", DIRECT_CHAT);
|
|
284
284
|
get("tasks", "direct-chat.page", `^\\/direct-chats\\/${TERMINAL}$`, { ...DIRECT_CHAT, sample: `/direct-chats/${"a".repeat(32)}` });
|
|
285
|
+
get("tasks", "direct-chat.page-ship-review-again", `^\\/direct-chats\\/${TERMINAL}\\/ship-review$`, { ...DIRECT_CHAT, sample: `/direct-chats/${"a".repeat(32)}/ship-review` });
|
|
286
|
+
get("tasks", "direct-chat.page-ship-done", `^\\/direct-chats\\/${TERMINAL}\\/ship$`, { ...DIRECT_CHAT, sample: `/direct-chats/${"a".repeat(32)}/ship` });
|
|
285
287
|
get("tasks", "direct-chat.artifact", `^\\/engine\\/direct-chats\\/${TERMINAL}\\/artifacts\\/${TERMINAL}$`, { ...DIRECT_CHAT, sample: `/engine/direct-chats/${"a".repeat(32)}/artifacts/${"b".repeat(32)}` });
|
|
286
288
|
get("pages", "projects.browse", "/projects/browse", free);
|
|
287
289
|
get("pages", "projects.pick", "/projects/pick", { ...free, callers: ["cookie"], project: "none", ...approver("Sign in as an approver to add projects.", "/projects") });
|
|
@@ -353,6 +355,7 @@ get("tasks", "task.diff", `^\\/t\\/${TASK}\\/diff$`, { project: "task", limited:
|
|
|
353
355
|
get("tasks", "task.result", `^\\/t\\/${TASK}\\/result$`, { project: "task", limited: "resource", ...free, sample: "/t/one/result" });
|
|
354
356
|
get("tasks", "task.approval", `^\\/t\\/${TASK}\\/approval$`, { project: "task", limited: "resource", callers: ["cookie"], ...free, sample: "/t/one/approval" });
|
|
355
357
|
get("tasks", "task.release", `^\\/t\\/${TASK}\\/release$`, { project: "task", limited: "resource", ...free, sample: "/t/one/release" });
|
|
358
|
+
get("tasks", "task.land-again", `^\\/t\\/${TASK}\\/land$`, { project: "task", limited: "resource", ...free, sample: "/t/one/land" });
|
|
356
359
|
get("tasks", "release.locate", `^\\/approve\\/${ID}$`, { project: "task-ref", limited: "resource", ...free, sample: "/approve/1" });
|
|
357
360
|
get("pages", "ledger.export", "/ledger/export", { limited: "unscoped", ...free });
|
|
358
361
|
get("tasks", "runs", "/runs", { limited: "collection", ...free });
|
|
@@ -170,7 +170,7 @@ function yourPasswordSection(deps) {
|
|
|
170
170
|
? [formRow("Forgot it?", "On the computer running Toolroll, run this to choose a new one:", html ``, "wide"), codeLine("toolroll password reset")]
|
|
171
171
|
: [formRow("Where it is", "Your first password is saved on the computer running Toolroll. Toolroll never shows it in a browser. To read it, run this there:", html ``, "wide"), codeLine(`cat ${saved}`)];
|
|
172
172
|
})(),
|
|
173
|
-
summary.passwordless === null ? "" : formRow("Passwordless", "Sign in once; most approvals then need no password.", btn(`${summary.passwordless ? "On" : "Off"} · Change`, { sm: true, href: "/settings/passwordless" }), "inline"),
|
|
173
|
+
summary.passwordless === null ? "" : formRow("Passwordless", "Sign in once; most approvals then need no password. Settings → Passwordless lists what still asks.", btn(`${summary.passwordless ? "On" : "Off"} · Change`, { sm: true, href: "/settings/passwordless" }), "inline"),
|
|
174
174
|
]),
|
|
175
175
|
}),
|
|
176
176
|
};
|
package/dist/server/settings.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PASSWORDLESS_TRADE, passwordlessSetting, setPasswordless } from "../passwordless.js";
|
|
1
|
+
import { PASSWORDLESS_OTHERS, PASSWORDLESS_STILL_ASKS, PASSWORDLESS_TRADE, passwordlessSetting, setPasswordless } from "../passwordless.js";
|
|
2
2
|
import { approveNetworkRequest } from "../agent-network-request.js";
|
|
3
3
|
import { declareJustMe, installModeNow, sessionStandsIn, soloNow, TEAM_FACT_WORDS } from "../install-mode.js";
|
|
4
4
|
import { ACP_AGENTS, isKeyedProvider } from "../acp-agents.js";
|
|
@@ -121,9 +121,9 @@ import { deleteProject, holdingsWords, PROJECT_RECOVERY_DELETE_MESSAGE } from ".
|
|
|
121
121
|
import { applySavedKnowledge, changeKnowledge, knowledgeVersion, knowledgeView } from "../project-knowledge.js";
|
|
122
122
|
import { changeLearning } from "../project-learning.js";
|
|
123
123
|
import { listDecisions, recordDecision, retireDecision, searchMemory } from "../project-memory.js";
|
|
124
|
-
import { changeSkills, githubSkill, importSkill, reviseSkillTest, skillsView, testSkill } from "../project-skills.js";
|
|
124
|
+
import { changeSkills, effectiveSkillsForRepo, githubSkill, importSkill, reviseSkillTest, skillsView, testSkill } from "../project-skills.js";
|
|
125
125
|
import { changeLibrarySkill, currentLibrary, dismissHeldBundleUpdate, enabledLibrarySkills, importGithubSkillBundle, importLibrarySkill, rollbackSkillBundle, setBundleAutoUpdate, setProjectSkillOptOut, skillLibraryView, sweepSkillBundleUpdates } from "../skill-library.js";
|
|
126
|
-
import { LOCAL_SKILL_TOOLS, setLocalSkillSync, syncEnabledLocalTools } from "../skill-local-sync.js";
|
|
126
|
+
import { LOCAL_SKILL_TOOLS, LOCAL_TOOL_LABELS, setLocalSkillSync, syncEnabledLocalTools } from "../skill-local-sync.js";
|
|
127
127
|
import { skillLibrarySectionHtml } from "../skills-ui.js";
|
|
128
128
|
import { signedIn } from "../oauth-run-token.js";
|
|
129
129
|
import { addToolTo, catalogTool, localAppOf, removeToolFrom, setToolSecret, splitCommandLine, testToolOf, toolSecretStorage } from "../project-tools.js";
|
|
@@ -317,32 +317,7 @@ ${connectionHtml(asked, connection, task)}${command === null ? "" : html `<p>On
|
|
|
317
317
|
const chosen = url.searchParams.get("repo") ?? project ?? projects[0] ?? "";
|
|
318
318
|
if (chosen && !projects.includes(chosen))
|
|
319
319
|
return refuse(response, who, 403, "That project is outside your access.", "/projects");
|
|
320
|
-
|
|
321
|
-
const canManage = who.role === "approver";
|
|
322
|
-
const csrf = who.via === "cookie" ? who.session.csrf : "";
|
|
323
|
-
let globalContent = html ``;
|
|
324
|
-
try {
|
|
325
|
-
const libView = skillLibraryView(store, { repo: chosen || null });
|
|
326
|
-
globalContent = skillLibrarySectionHtml(libView, libView.localSync, csrf, canManage, {
|
|
327
|
-
repo: chosen,
|
|
328
|
-
said: url.searchParams.get("said"),
|
|
329
|
-
error: url.searchParams.get("problem"),
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
catch (error) {
|
|
333
|
-
globalContent = html `<p class="problem" role="alert">${error instanceof Error ? error.message : "Global skill library is unavailable."}</p>`;
|
|
334
|
-
}
|
|
335
|
-
let content = html `<p>Add a project to manage project-specific skills.</p>`;
|
|
336
|
-
if (chosen) {
|
|
337
|
-
try {
|
|
338
|
-
const agent = resolvePhaseAgent(store, 'build', chosen, {});
|
|
339
|
-
content = (skillsHtml(skillsView(store, chosen, who.name), csrf, canManage, { focus: url.searchParams.get('skill') ?? '', agent: agent.ok ? `Report agent: ${agent.spec.provider} · ${agent.spec.model ?? 'default'}. Change it on the test task before approval` : 'Choose a report agent on the test task before approval' }));
|
|
340
|
-
}
|
|
341
|
-
catch (error) {
|
|
342
|
-
content = html `<p class="problem" role="alert">${error instanceof Error ? error.message : 'Skills are unavailable. Reload to retry.'}</p>`;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
return sendScreen(response, 200, screen('Skills', settingsSubPage("agents", "Skills", html `${url.searchParams.get('saved') === '1' ? html `<p role="status">Saved.</p>` : ''}${globalContent}${selector}${content}`), { chrome: chromeFor(chosen || project, 'settings'), functional: { script: skillsScript() } }));
|
|
320
|
+
return skillsScreen(ctx, chosen, { said: url.searchParams.get("said"), problem: url.searchParams.get("problem") }, 200);
|
|
346
321
|
}
|
|
347
322
|
async function toolsPage(ctx) {
|
|
348
323
|
const { url, who, response, project } = ctx;
|
|
@@ -573,7 +548,7 @@ ${connectionHtml(asked, connection, task)}${command === null ? "" : html `<p>On
|
|
|
573
548
|
const setting = passwordlessSetting(store);
|
|
574
549
|
const said = url.searchParams.get("said"), problem = url.searchParams.get("problem");
|
|
575
550
|
const since = setting.at === null ? null : `${setting.on ? "on" : "off"} since ${new Date(setting.at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}, by ${setting.setBy ?? "someone"}`;
|
|
576
|
-
return sendScreen(response, 200, screen("Passwordless", passwordlessHtml({ on: sessionStandsIn(store), since, trade: PASSWORDLESS_TRADE, said, problem }), { chrome: chromeFor(project, "settings") }));
|
|
551
|
+
return sendScreen(response, 200, screen("Passwordless", passwordlessHtml({ on: sessionStandsIn(store), since, trade: PASSWORDLESS_TRADE, stillAsks: PASSWORDLESS_STILL_ASKS, others: PASSWORDLESS_OTHERS, said, problem }), { chrome: chromeFor(project, "settings") }));
|
|
577
552
|
}
|
|
578
553
|
async function passwordlessSave(ctx) {
|
|
579
554
|
const { response, now, posted } = ctx;
|
|
@@ -3589,8 +3564,8 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3589
3564
|
const lib = enabledLibrarySkills(store);
|
|
3590
3565
|
const res = setLocalSkillSync(store, { tool: tool, enabled, actor: who.name, skills: lib.packages, libraryRevision: lib.revision }, now);
|
|
3591
3566
|
said = enabled && res
|
|
3592
|
-
? `Synced ${res.written.length} skill${res.written.length === 1 ? "" : "s"} to ${tool}${res.skippedForeign.length ? ` (left ${res.skippedForeign.length} of your own skills untouched)` : ""}.`
|
|
3593
|
-
: `Turned off local sync for ${tool} and removed Toolroll-managed skills.`;
|
|
3567
|
+
? `Synced ${res.written.length} skill${res.written.length === 1 ? "" : "s"} to ${LOCAL_TOOL_LABELS[tool]}${res.skippedForeign.length ? ` (left ${res.skippedForeign.length} of your own skills untouched)` : ""}.`
|
|
3568
|
+
: `Turned off local sync for ${LOCAL_TOOL_LABELS[tool]} and removed Toolroll-managed skills.`;
|
|
3594
3569
|
}
|
|
3595
3570
|
else if (action === "local-sync-now") {
|
|
3596
3571
|
const lib = enabledLibrarySkills(store);
|
|
@@ -3603,8 +3578,55 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3603
3578
|
return backWith("said", said);
|
|
3604
3579
|
}
|
|
3605
3580
|
catch (error) {
|
|
3606
|
-
|
|
3581
|
+
const why = error instanceof Error ? error.message : "Could not update the skill library.";
|
|
3582
|
+
if (action === "import-bundle")
|
|
3583
|
+
return skillsScreen(ctx, repo, { problem: `${why.replace(/\.?$/, ".")} Nothing was imported.`, bundleUrl: (body.get("url") ?? "").slice(0, 2000) }, 409);
|
|
3584
|
+
return backWith("problem", why);
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
function skillsScreen(ctx, chosen, extra, status) {
|
|
3588
|
+
const { url, who, response, project } = ctx;
|
|
3589
|
+
const projects = consoleProjects();
|
|
3590
|
+
const selector = projectPicker("/settings/skills", projects.map(repo => ({ repo, name: projectName(repo) })), chosen, { evenOne: true });
|
|
3591
|
+
const canManage = who.role === "approver";
|
|
3592
|
+
const csrf = who.via === "cookie" ? who.session.csrf : "";
|
|
3593
|
+
let view = null, viewProblem = null;
|
|
3594
|
+
if (chosen) {
|
|
3595
|
+
try {
|
|
3596
|
+
view = skillsView(store, chosen, who.name);
|
|
3597
|
+
}
|
|
3598
|
+
catch (error) {
|
|
3599
|
+
viewProblem = error instanceof Error ? error.message : "Skills are unavailable. Reload to retry.";
|
|
3600
|
+
}
|
|
3601
|
+
}
|
|
3602
|
+
let globalContent = html ``;
|
|
3603
|
+
try {
|
|
3604
|
+
const libView = skillLibraryView(store, { repo: chosen || null });
|
|
3605
|
+
globalContent = skillLibrarySectionHtml(libView, libView.localSync, csrf, canManage, {
|
|
3606
|
+
repo: chosen,
|
|
3607
|
+
said: extra.said ?? null,
|
|
3608
|
+
error: extra.problem ?? null,
|
|
3609
|
+
...(view === null ? {} : { projectSelection: view.selection }),
|
|
3610
|
+
...(extra.bundleUrl === undefined ? {} : { bundleUrl: extra.bundleUrl }),
|
|
3611
|
+
});
|
|
3612
|
+
}
|
|
3613
|
+
catch (error) {
|
|
3614
|
+
globalContent = html `<p class="problem" role="alert">${error instanceof Error ? error.message : "Global skill library is unavailable."}</p>`;
|
|
3615
|
+
}
|
|
3616
|
+
let content = html `<p>Add a project to manage project-specific skills.</p>`;
|
|
3617
|
+
if (viewProblem !== null)
|
|
3618
|
+
content = html `<p class="problem" role="alert">${viewProblem}</p>`;
|
|
3619
|
+
else if (view !== null) {
|
|
3620
|
+
try {
|
|
3621
|
+
const agent = resolvePhaseAgent(store, 'build', chosen, {});
|
|
3622
|
+
content = (skillsHtml(view, csrf, canManage, { focus: url.searchParams.get('skill') ?? '', effective: effectiveSkillsForRepo(store, chosen).packages, agent: agent.ok ? `Report agent: ${agent.spec.provider} · ${agent.spec.model ?? 'default'}. Change it on the test task before approval` : 'Choose a report agent on the test task before approval' }));
|
|
3623
|
+
}
|
|
3624
|
+
catch (error) {
|
|
3625
|
+
content = html `<p class="problem" role="alert">${error instanceof Error ? error.message : 'Skills are unavailable. Reload to retry.'}</p>`;
|
|
3626
|
+
}
|
|
3607
3627
|
}
|
|
3628
|
+
const title = chosen ? `Skills for ${projectName(chosen)}` : "Skills";
|
|
3629
|
+
return sendScreen(response, status, screen('Skills', settingsSubPage("agents", title, html `${url.searchParams.get('saved') === '1' ? html `<p role="status">Saved.</p>` : ''}${selector}${globalContent}${content}`), { chrome: chromeFor(chosen || project, 'settings'), functional: { script: skillsScript() } }));
|
|
3608
3630
|
}
|
|
3609
3631
|
return { registrations, modelsView };
|
|
3610
3632
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { localOwnerRefusal } from "../local-owner.js";
|
|
2
|
-
import { broughtInOnBranch,
|
|
2
|
+
import { broughtInOnBranch, keptHandoffOf, landingHistoryOf, landingOf, publishesThroughPullRequests } from "../local-landing.js";
|
|
3
3
|
import { requestContext } from "./request-context.js";
|
|
4
4
|
import { heldFindingCount } from "../findings.js";
|
|
5
5
|
import { familyInWebReach } from "../findings.js";
|
|
@@ -21,6 +21,7 @@ import { routeChangeOf } from "../route-change.js";
|
|
|
21
21
|
import { liveAttemptOf, steerControlsFor } from "../steer-controls.js";
|
|
22
22
|
import { originOf } from "../task-source.js";
|
|
23
23
|
import { recentGitReads, taskBaseOf } from "../task-base.js";
|
|
24
|
+
import { landedNowOf } from "../merge-checklist.js";
|
|
24
25
|
import { assignmentPresentationOf, historicalAssessmentReason } from '../assignment-presentation.js';
|
|
25
26
|
import { html, htmlString, joinHtml } from "../html.js";
|
|
26
27
|
import { assignmentStatusOf, assignmentWithEvidence } from '../assignment-ui.js';
|
|
@@ -618,11 +619,13 @@ export function createTaskViews(runtime) {
|
|
|
618
619
|
if (!complete && record === null)
|
|
619
620
|
return null;
|
|
620
621
|
const person = who.via === "cookie" && who.role === "approver";
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
623
|
-
return { taskId: rootId, landed:
|
|
624
|
-
const standing =
|
|
625
|
-
|
|
622
|
+
const history = landingHistoryOf(runtime.store, repo, rootId, complete ? assignment?.receipt?.head ?? null : null, baseGit);
|
|
623
|
+
if (history !== null && !history.recorded)
|
|
624
|
+
return { taskId: rootId, landed: history.words, onBranch: true, canLand: false, canUndo: person && !history.reverted && broughtInOnBranch(runtime.store, repo, rootId, baseGit) };
|
|
625
|
+
const standing = history;
|
|
626
|
+
const kept = complete && (record === null || record.undone) ? keptHandoffOf(runtime.store, repo, rootId, assignment?.receipt?.head ?? null) : null;
|
|
627
|
+
return { taskId: rootId, landed: standing?.words ?? null, onBranch: standing?.landed === true, canLand: person && complete && (record === null || record.undone), canUndo: person && record !== null && !record.undone && standing?.reverted !== true,
|
|
628
|
+
...(kept === null ? {} : { kept }) };
|
|
626
629
|
}
|
|
627
630
|
function failureOf(runs, assignment, readLog = true) {
|
|
628
631
|
const last = latestFinishedAttempt(runs);
|
|
@@ -785,7 +788,7 @@ export function createTaskViews(runtime) {
|
|
|
785
788
|
const rootId = family?.root.id ?? taskId;
|
|
786
789
|
const oneTaskView = onePage?.kind === "task" ? { ...onePage, ship: shipViewOf(shipChecksForTask(runtime.store, rootId), runtime.clock()),
|
|
787
790
|
release: releaseStepsViewOf(releaseProgressFor(runtime.store, rootId), runtime.clock()),
|
|
788
|
-
mergeReady: mergeReadyViewOf(runtime.store, taskId, data.assignment, who, presentedData.runChecks ?? null, taskHref(taskId)) } : onePage;
|
|
791
|
+
mergeReady: mergeReadyViewOf(runtime.store, taskId, data.assignment, who, presentedData.runChecks ?? null, taskHref(taskId), landedOf(presentedData), data.base ?? null) } : onePage;
|
|
789
792
|
if (oneTaskView?.kind === "task" && machineChecked(runtime.store, taskId)) {
|
|
790
793
|
const words = machineCheckWords(runtime.store, taskId, data.liveRunId ?? null, oneTaskView.release ?? null, runtime.clock());
|
|
791
794
|
const card = oneTaskView.status;
|
|
@@ -1051,7 +1054,7 @@ export function createTaskViews(runtime) {
|
|
|
1051
1054
|
const assignment = value?.receipt?.runId === run.id && value.activeTaskId === taskId ? freshAssignment(value, receipt) : null;
|
|
1052
1055
|
const completeRefusal = assignment?.state !== "ready-to-check" || assignment.receipt === null ? null
|
|
1053
1056
|
: personCompletionRefusal(runtime.store, assignment.receipt.taskId, run.id, who.via === "cookie" ? who.name : null, runtime.evidenceRoot, who.via === "cookie" && who.authority === "local-owner" ? { rootId: assignment.rootId } : null);
|
|
1054
|
-
return { assignment, completeRefusal };
|
|
1057
|
+
return { assignment, completeRefusal, landed: assignment !== null && landedNowOf(runtime.store, assignment) !== null };
|
|
1055
1058
|
})(),
|
|
1056
1059
|
handoff,
|
|
1057
1060
|
proof,
|
|
@@ -1172,3 +1175,6 @@ export function releaseStepsViewOf(progress, now) {
|
|
|
1172
1175
|
startedAt: progress.startedAt,
|
|
1173
1176
|
};
|
|
1174
1177
|
}
|
|
1178
|
+
function landedOf(data) {
|
|
1179
|
+
return data.landing?.onBranch === true ? data.landing.landed : null;
|
|
1180
|
+
}
|
package/dist/server/tasks.js
CHANGED
|
@@ -94,7 +94,7 @@ import {} from "./session.js";
|
|
|
94
94
|
import { approveReleaseCard, releaseApprovalCard, releaseSheetHref, releaseTaskOf } from "../release-approval.js";
|
|
95
95
|
import { releaseSheetPage } from "./render-release.js";
|
|
96
96
|
import { approvalFactsNow, btn } from "./kit.js";
|
|
97
|
-
import { handoffWords, land, landingWords, publishesThroughPullRequests, PULL_REQUESTS_INSTEAD, readLanding } from "../local-landing.js";
|
|
97
|
+
import { handoffWords, land, landedLine, landingWords, publishesThroughPullRequests, PULL_REQUESTS_INSTEAD, readLanding } from "../local-landing.js";
|
|
98
98
|
import { localActNow, localOwnerRefusal, withLocalAct } from "../local-owner.js";
|
|
99
99
|
import { localChecksRefusal } from "../local-checks.js";
|
|
100
100
|
import { sessionYesPossible } from "./send-back-build.js";
|
|
@@ -2662,6 +2662,7 @@ export function createTasksHandlers(runtime) {
|
|
|
2662
2662
|
"task.act.complete": taskAct("complete"),
|
|
2663
2663
|
"task.act.merge": taskMerge,
|
|
2664
2664
|
"task.act.land": taskLand,
|
|
2665
|
+
"task.land-again": taskLandAgain,
|
|
2665
2666
|
"task.act.recheck-stopped": taskRecheckStopped,
|
|
2666
2667
|
"task.act.stop": taskAct("stop"),
|
|
2667
2668
|
"task.act.stop-carrying": taskAct("stop-carrying"),
|
|
@@ -2830,7 +2831,7 @@ export function createTasksHandlers(runtime) {
|
|
|
2830
2831
|
return taskScreen(response, who, shown, read.message, 409);
|
|
2831
2832
|
if (!("plan" in read)) {
|
|
2832
2833
|
if (answersInPlace(ctx.request))
|
|
2833
|
-
return answerActInPlace(response, "done", `Already on ${read.landed.ref.replace(/^refs\/heads\//, "")} (${read.landed.commit.slice(0, 7)}).`, 200);
|
|
2834
|
+
return answerActInPlace(response, "done", read.landed.reverted === true ? landedLine(read.landed) : `Already on ${read.landed.ref.replace(/^refs\/heads\//, "")} (${read.landed.commit.slice(0, 7)}).`, 200);
|
|
2834
2835
|
return redirect(response, taskHref(shown));
|
|
2835
2836
|
}
|
|
2836
2837
|
const plan = read.plan;
|
|
@@ -2844,12 +2845,22 @@ export function createTasksHandlers(runtime) {
|
|
|
2844
2845
|
return taskScreen(response, who, shown, done.message, done.reason === "authority" ? 403 : 409);
|
|
2845
2846
|
if (done.handoff !== null) {
|
|
2846
2847
|
const words = `Landing commit ${done.commit.slice(0, 7)} is ready. Your project folder has ${done.branch} checked out, so Toolroll didn't touch it. ${handoffWords(done.handoff, done.commit)}`;
|
|
2847
|
-
return answersInPlace(ctx.request) ? answerActInPlace(response, "done", words, 200, done.handoff.command) :
|
|
2848
|
+
return answersInPlace(ctx.request) ? answerActInPlace(response, "done", words, 200, done.handoff.command) : redirect(response, `${taskHref(shown)}#land`);
|
|
2848
2849
|
}
|
|
2849
2850
|
if (answersInPlace(ctx.request))
|
|
2850
2851
|
return answerActInPlace(response, "done", `${done.kind === "undo" ? "Undone" : "Landed"} on ${done.branch} (${done.commit.slice(0, 7)}).`, 200);
|
|
2851
2852
|
return redirect(response, taskHref(shown));
|
|
2852
2853
|
}
|
|
2854
|
+
async function taskLandAgain(ctx) {
|
|
2855
|
+
const { url, who, response } = ctx;
|
|
2856
|
+
const act = matchTaskPath(url.pathname, "/land$");
|
|
2857
|
+
if (act === null)
|
|
2858
|
+
return noPage(who, response);
|
|
2859
|
+
const ref = store.lookupRef(act.taskId);
|
|
2860
|
+
if (ref === null || !visible(ref.repo))
|
|
2861
|
+
return refuse(response, who, 404, "no such task", "/");
|
|
2862
|
+
return redirect(response, `${taskHref(store.taskFamilyOf(act.taskId, null, true)?.current.id ?? act.taskId)}#land`);
|
|
2863
|
+
}
|
|
2853
2864
|
return { registrations, workListFor, showOrder, runListPane, peekFragment, taskMutation, queueRegionFor, ciFailingFor, completedRowFor, attemptRowFor, resultRowOf, reviewCockpitViewOf, decisionEvidence, runEvidence, sendArtifact, peekGuards, liveRunIds };
|
|
2854
2865
|
}
|
|
2855
2866
|
export function createTidyHandlers(runtime) {
|
|
@@ -136,7 +136,7 @@ export function agentsGroup(facts, flags) {
|
|
|
136
136
|
settingsLink({ href: "/settings/lead", title: "Chat", status: "The assistant you chat with" }),
|
|
137
137
|
...(advancedOn(facts) ? [settingsLink({ href: "/settings/lead/subagents", title: "Subagents", status: "Helpers the lead looks after" })] : []),
|
|
138
138
|
settingsLink({ href: "/settings/tools", title: "Tools", status: "What builds can use, per project" }),
|
|
139
|
-
|
|
139
|
+
settingsLink({ href: "/settings/skills", title: "Skills", status: "Reusable instructions for agents" }),
|
|
140
140
|
settingsLink({ href: "/settings/knowledge", title: "Knowledge", status: "What agents know about each project" }),
|
|
141
141
|
...(advancedOn(facts) ? [settingsLink({ href: "/settings/learning", title: "Learning", status: "Lessons kept from finished work" })] : []),
|
|
142
142
|
]);
|
|
@@ -365,7 +365,7 @@ export function accessGroup(facts, flags) {
|
|
|
365
365
|
settingsLink({ href: "/settings/sign-in", title: "Sign-in with a provider", status: facts.sso === null ? "Not set up: everyone uses a password" : `People sign in with ${facts.sso}` })
|
|
366
366
|
] : []),
|
|
367
367
|
...(facts.operator && (advancedOn(facts) || facts.passwordless === true) ? [
|
|
368
|
-
settingsLink({ href: "/settings/passwordless", title: "Passwordless", status: facts.passwordless ? "On: approvals need no password" : "Off: approvals ask for your password" })
|
|
368
|
+
settingsLink({ href: "/settings/passwordless", title: "Passwordless", status: facts.passwordless ? "On: most approvals need no password" : "Off: approvals ask for your password" })
|
|
369
369
|
] : []),
|
|
370
370
|
...(facts.local?.canTurnOff === true ? [html `<div id="local-mode">${settingsLink({ href: "/settings/general?section=local-mode", title: "Local mode", status: "On · in General" })}</div>`] : []),
|
|
371
371
|
];
|
|
@@ -541,12 +541,12 @@ export function passwordlessHtml(view) {
|
|
|
541
541
|
return settingsSubPage("access", "Passwordless", joinHtml([
|
|
542
542
|
answer,
|
|
543
543
|
settingsSection({ id: "passwordless", title: `Passwordless is ${view.on ? "on" : "off"}`, state: view.since === null ? "" : ` · ${view.since}`,
|
|
544
|
-
lead: "When it’s on, approvals, settings, budgets, signing a mode and starting a terminal no longer ask for your password again, in the browser, on the phone, and in this computer’s toolroll command (through its remembered login).
|
|
545
|
-
body: joinHtml([note(view.trade), control]) }),
|
|
544
|
+
lead: "When it’s on, approvals, settings, budgets, signing a mode and starting a terminal no longer ask for your password again, in the browser, on the phone, and in this computer’s toolroll command (through its remembered login).",
|
|
545
|
+
body: joinHtml([html `<p><strong>Still asks for your password</strong></p><ul data-passwordless-still-asks>${view.stillAsks.map(one => html `<li>${one}</li>`)}</ul>`, note(view.trade), note(view.others), control]) }),
|
|
546
546
|
]), { lead: "Sign in once; most approvals then need no password." });
|
|
547
547
|
}
|
|
548
|
-
export function projectPicker(action, projects, chosen) {
|
|
549
|
-
if (projects.length < 2)
|
|
548
|
+
export function projectPicker(action, projects, chosen, options = {}) {
|
|
549
|
+
if (projects.length < (options.evenOne === true ? 1 : 2))
|
|
550
550
|
return html ``;
|
|
551
551
|
return html `<form method="get" action="${action}" class="k-acts k-picker">${select({ name: "repo", label: "Project", current: chosen, items: projects.map(one => [one.repo, one.name]) })}${btn("Show", { sm: true, type: "submit" })}</form>`;
|
|
552
552
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const UNSAFE = new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029\\p{Cf}]", "gu");
|
|
2
|
+
const NAMED = { "\n": "\\n", "\r": "\\r", "\t": "\\t" };
|
|
3
|
+
export function shownText(text) {
|
|
4
|
+
return text.replace(UNSAFE, char => {
|
|
5
|
+
const named = NAMED[char];
|
|
6
|
+
if (named !== undefined)
|
|
7
|
+
return named;
|
|
8
|
+
const code = char.codePointAt(0);
|
|
9
|
+
return code <= 0xff ? `\\x${code.toString(16).padStart(2, "0")}` : `\\u${code.toString(16).padStart(4, "0")}`;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function hasUnsafeText(text) {
|
|
13
|
+
return new RegExp(UNSAFE.source, "u").test(text);
|
|
14
|
+
}
|
package/dist/skill-library.js
CHANGED
|
@@ -310,12 +310,29 @@ export function parseGithubBundleUrl(rawUrl) {
|
|
|
310
310
|
: `https://github.com/${owner}/${repoName}`;
|
|
311
311
|
return { id, repoUrl, owner: owner, repoName: repoName, ref: ref ?? null, subpath };
|
|
312
312
|
}
|
|
313
|
+
function unreachableWhy(error) {
|
|
314
|
+
const cause = error?.cause;
|
|
315
|
+
const code = typeof cause?.code === "string" ? cause.code : "";
|
|
316
|
+
if (error?.name === "TimeoutError")
|
|
317
|
+
return "it didn't answer within 20 seconds";
|
|
318
|
+
if (code === "ENOTFOUND" || code === "EAI_AGAIN")
|
|
319
|
+
return "its address couldn't be looked up (this computer may be offline)";
|
|
320
|
+
if (code === "ECONNREFUSED" || code === "ECONNRESET" || code === "EPERM" || code === "EACCES")
|
|
321
|
+
return "the connection was refused or blocked";
|
|
322
|
+
return "the connection failed (this computer may be offline, or a firewall blocks it)";
|
|
323
|
+
}
|
|
313
324
|
async function githubJson(owner, repoName, path, fetcher, budget) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
325
|
+
let response;
|
|
326
|
+
try {
|
|
327
|
+
response = await fetcher(`https://api.github.com/repos/${owner}/${repoName}${path}`, {
|
|
328
|
+
redirect: "error",
|
|
329
|
+
signal: AbortSignal.timeout(20_000),
|
|
330
|
+
headers: { Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28" },
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
throw Error(`Couldn't reach GitHub: ${unreachableWhy(error)}.`);
|
|
335
|
+
}
|
|
319
336
|
if (!response.ok) {
|
|
320
337
|
throw Error(`GitHub returned ${response.status} for ${owner}/${repoName}${path.split("?")[0]}.`);
|
|
321
338
|
}
|