toolroll 0.9.112 → 0.9.114
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 +58 -0
- package/README.md +28 -29
- package/dist/backup.js +29 -0
- package/dist/contracts/console-api.js +5 -1
- package/dist/contracts/engine-api.js +12 -0
- package/dist/easy-start.js +12 -7
- package/dist/engine-reads.js +20 -2
- package/dist/fast-terms.js +8 -4
- package/dist/flexible-agents.js +2 -8
- package/dist/flexible-answers.js +4 -26
- package/dist/flexible-available.js +31 -1
- package/dist/flexible-import.js +2 -14
- package/dist/flexible-launch.js +15 -3
- package/dist/flexible-launcher.js +0 -5
- package/dist/flexible-relay.js +66 -75
- package/dist/flexible-session.js +130 -36
- package/dist/flexible-setting-schema.js +10 -0
- package/dist/flexible-ship.js +8 -18
- package/dist/flexible-sign-in-schema.js +47 -0
- package/dist/flexible-sign-in-slot.js +4 -0
- package/dist/flexible-sign-in.js +470 -0
- package/dist/flexible-start.js +27 -8
- package/dist/flexible-thread.js +21 -27
- package/dist/flexible-turns.js +22 -17
- package/dist/flexible.js +9 -11
- package/dist/flow-triggers.js +4 -1
- package/dist/live-terminal.js +28 -0
- package/dist/local-owner.js +1 -0
- package/dist/operate.js +170 -4
- package/dist/release.js +1 -0
- package/dist/serve.js +9 -0
- package/dist/server/engine-api.js +112 -32
- package/dist/server/mutation-key.js +6 -0
- package/dist/server/people-tokens.js +10 -1
- package/dist/server/route-table.js +6 -0
- package/dist/server/settings-section-table.js +7 -0
- package/dist/server/settings-sections.js +87 -1
- package/dist/server/settings.js +123 -3
- package/dist/server/terminals.js +3 -3
- package/dist/settings-groups-ui.js +3 -0
- package/dist/settings-proofs.js +5 -0
- package/dist/store.js +71 -5
- package/dist/tool-secret-store.js +105 -0
- package/dist/toolroll-update.js +2 -1
- 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 +2 -1
- package/dist/tui-launch.js +3 -1
- package/dist/work-index.js +4 -0
- package/package.json +1 -1
package/dist/server/settings.js
CHANGED
|
@@ -58,7 +58,10 @@ import { resolvePhaseAgent } from "../agentconfig.js";
|
|
|
58
58
|
import { parseProtectedPaths } from "../approval-policy.js";
|
|
59
59
|
import { approvalRulesHtml, releaseApprovalHtml } from "../approval-rules-ui.js";
|
|
60
60
|
import { releaseApprovalSetting, setReleaseApproval } from "../release-auto.js";
|
|
61
|
-
import {
|
|
61
|
+
import { flexibleAvailable, flexibleSetting, setFlexibleSetting } from "../flexible-available.js";
|
|
62
|
+
import { flexibleSignInStatus, recheckFlexibleSignIn, removeFlexibleSignIn, saveFlexibleSignIn, setupTokenFromPaste, signInCheckWords, tidyFlexibleSignIns } from "../flexible-sign-in.js";
|
|
63
|
+
import { passwordFreeOwner } from "../task-outcome-cli.js";
|
|
64
|
+
import { realpathSync } from "node:fs";
|
|
62
65
|
import { enableFlexible, FLEXIBLE_LEVEL_WORDS, FLEXIBLE_UNAVAILABLE, flexibleSettingsView, isFlexibleLevel, lowerFlexible, turnFlexibleOff } from "../flexible.js";
|
|
63
66
|
import { backupHtml } from "../backup-ui.js";
|
|
64
67
|
import { BACKUP_EVERY_HOURS, backupFolderOf, backupNow, checkBackupFolder, defaultBackupFolder, MAX_KEEP } from "../backup.js";
|
|
@@ -2766,6 +2769,10 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
2766
2769
|
"settings.lead-about": leadAbout,
|
|
2767
2770
|
"settings.lead-quick": leadQuick,
|
|
2768
2771
|
"settings.task-sizing": taskSizingAct,
|
|
2772
|
+
"settings.flexible": flexibleSwitchAct,
|
|
2773
|
+
"settings.flexible-sign-in": flexibleSignInAct,
|
|
2774
|
+
"settings.flexible-sign-in-check": flexibleSignInCheckAct,
|
|
2775
|
+
"settings.flexible-sign-in-clear": flexibleSignInClearAct,
|
|
2769
2776
|
"settings.lead-promise-cancel": leadPromiseCancel,
|
|
2770
2777
|
"settings.lead-on": leadOn,
|
|
2771
2778
|
"settings.code-map": codeMapAct("switch"),
|
|
@@ -3020,6 +3027,39 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3020
3027
|
const read = taskSizingSetting(store);
|
|
3021
3028
|
return done("said", wanted === "on" ? `Task sizing is on. Each new task is sized by ${read.available === "jev" ? "Jev through your OpenRouter key" : "a quick call to Claude Haiku on your plan"} before you approve.` : "Task sizing is off. No model call before you approve; uncertain tasks get a plan first.");
|
|
3022
3029
|
}
|
|
3030
|
+
async function flexibleSwitchAct(ctx) {
|
|
3031
|
+
const { response, now, posted } = ctx;
|
|
3032
|
+
const who = browserCaller(ctx.who);
|
|
3033
|
+
const body = readForm(posted, CONSOLE_FORMS.flexibleSwitch);
|
|
3034
|
+
const done = sayTo(response, "/settings/general?section=flexible");
|
|
3035
|
+
const back = sayTo(response, "/settings/change/flexible");
|
|
3036
|
+
if (["password", "enabled"].some(field => body.sent.getAll(field).length > 1))
|
|
3037
|
+
return back("problem", "That form was sent twice over. Nothing changed.");
|
|
3038
|
+
const wanted = body.get("enabled");
|
|
3039
|
+
if (wanted !== "on" && wanted !== "off")
|
|
3040
|
+
return back("problem", "Choose on or off.");
|
|
3041
|
+
const saved = store.transact(() => {
|
|
3042
|
+
if (!store.isInstanceOperator(who.name))
|
|
3043
|
+
return false;
|
|
3044
|
+
if (wanted === "on") {
|
|
3045
|
+
if (!authenticateCredential(who, body.get("password") ?? "").ok)
|
|
3046
|
+
return false;
|
|
3047
|
+
}
|
|
3048
|
+
else {
|
|
3049
|
+
if (who.authority !== "full" && localActNow(store, "flexible-switch") === null)
|
|
3050
|
+
return false;
|
|
3051
|
+
if (!authenticateApprover(who, body.get("password") ?? "").ok)
|
|
3052
|
+
return false;
|
|
3053
|
+
}
|
|
3054
|
+
setFlexibleSetting(store, wanted === "on", who.name, now);
|
|
3055
|
+
return true;
|
|
3056
|
+
});
|
|
3057
|
+
if (!saved)
|
|
3058
|
+
return back("problem", wanted === "on" ? "Turning interactive agent threads on needs your Toolroll password, typed now." : "Enter your Toolroll password to change interactive agent threads.");
|
|
3059
|
+
if (wanted === "on")
|
|
3060
|
+
return sayTo(response, "/settings/general?section=flexible-sign-in")("said", "Threads are on. Next, add your Claude sign-in.");
|
|
3061
|
+
return done("said", "Interactive agent threads are off. Any thread still running is stopped.");
|
|
3062
|
+
}
|
|
3023
3063
|
async function justMe(ctx) {
|
|
3024
3064
|
const { response, now, posted } = ctx;
|
|
3025
3065
|
const who = browserCaller(ctx.who);
|
|
@@ -3156,8 +3196,6 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3156
3196
|
async function projectFlexible(ctx) {
|
|
3157
3197
|
const { response, now, posted } = ctx;
|
|
3158
3198
|
const who = browserCaller(ctx.who);
|
|
3159
|
-
if (!FLEXIBLE_AVAILABLE)
|
|
3160
|
-
return refuse(response, who, 403, FLEXIBLE_UNAVAILABLE, "/settings/project");
|
|
3161
3199
|
const body = readForm(posted, CONSOLE_FORMS.projectFlexible);
|
|
3162
3200
|
const repo = body.get("repo") ?? "";
|
|
3163
3201
|
if (!consoleProjects().includes(repo) || !visible(repo))
|
|
@@ -3179,6 +3217,8 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3179
3217
|
}
|
|
3180
3218
|
if (action !== "enable")
|
|
3181
3219
|
return back("problem", "Choose to turn Flexible on, lower it or turn it off. Nothing changed.");
|
|
3220
|
+
if (!flexibleAvailable(store))
|
|
3221
|
+
return refuse(response, who, 403, FLEXIBLE_UNAVAILABLE, "/settings/project");
|
|
3182
3222
|
const proved = authenticateCredential(who, body.get("password") ?? "", repo);
|
|
3183
3223
|
if (!proved.ok)
|
|
3184
3224
|
return back("problem", "Enter your Toolroll password to turn on Flexible.");
|
|
@@ -3199,6 +3239,9 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3199
3239
|
localModeOn: () => localModeOf(store)?.enabled === true,
|
|
3200
3240
|
installMode: () => installModeNow(store),
|
|
3201
3241
|
taskSizing: () => taskSizingSetting(store),
|
|
3242
|
+
flexible: () => flexibleSetting(store),
|
|
3243
|
+
flexibleSignIn: name => flexibleSignInStatus(store, name),
|
|
3244
|
+
passwordFree: () => passwordFreeOwner(store),
|
|
3202
3245
|
});
|
|
3203
3246
|
const computersDeps = {
|
|
3204
3247
|
computers: (now, manage) => computersOf(store, now, visible, manage),
|
|
@@ -3288,5 +3331,82 @@ ${postForm("/settings/chat-approval/save", html `\
|
|
|
3288
3331
|
return sendScreen(response, 200, screen(answer.title, answer.body, { chrome: chromeFor(project, "settings"), forceSensitive: true }));
|
|
3289
3332
|
};
|
|
3290
3333
|
}
|
|
3334
|
+
const signInState = () => {
|
|
3335
|
+
const file = store.databaseFile();
|
|
3336
|
+
if (file === null || file === "" || file === ":memory:")
|
|
3337
|
+
return null;
|
|
3338
|
+
try {
|
|
3339
|
+
return dirname(realpathSync(file));
|
|
3340
|
+
}
|
|
3341
|
+
catch {
|
|
3342
|
+
return null;
|
|
3343
|
+
}
|
|
3344
|
+
};
|
|
3345
|
+
async function flexibleSignInAct(ctx) {
|
|
3346
|
+
const { response, now, posted } = ctx;
|
|
3347
|
+
const who = browserCaller(ctx.who);
|
|
3348
|
+
const body = readForm(posted, CONSOLE_FORMS.flexibleSignIn);
|
|
3349
|
+
const done = sayTo(response, "/settings/general?section=flexible-sign-in");
|
|
3350
|
+
const back = sayTo(response, "/settings/change/flexible-sign-in");
|
|
3351
|
+
if (["token", "password"].some(field => body.sent.getAll(field).length > 1))
|
|
3352
|
+
return back("problem", "That form was sent twice over. Nothing was saved.");
|
|
3353
|
+
if (body.sent.has("person"))
|
|
3354
|
+
return back("problem", "Your Claude sign-in is always your own. Nothing was saved.");
|
|
3355
|
+
if (who.authority !== "full")
|
|
3356
|
+
return back("problem", "Saving your Claude sign-in needs your Toolroll password, typed now. Nothing was saved.");
|
|
3357
|
+
const paste = setupTokenFromPaste(body.get("token") ?? "");
|
|
3358
|
+
if (!paste.ok)
|
|
3359
|
+
return back("problem", paste.message);
|
|
3360
|
+
const state = signInState();
|
|
3361
|
+
if (state === null)
|
|
3362
|
+
return back("problem", "Toolroll's state folder can't be found. Nothing was saved.");
|
|
3363
|
+
const saved = await saveFlexibleSignIn(store, { state, person: who.name, password: body.get("password") ?? "", token: paste.token, check: true, clock: () => now });
|
|
3364
|
+
if (!saved.ok)
|
|
3365
|
+
return back("problem", saved.message);
|
|
3366
|
+
return done("said", `${saved.replaced ? "Replaced" : "Saved"}. ${signInCheckWords(saved.check ?? { outcome: "not-checked" })}`);
|
|
3367
|
+
}
|
|
3368
|
+
async function flexibleSignInCheckAct(ctx) {
|
|
3369
|
+
const { response, now, posted } = ctx;
|
|
3370
|
+
const who = browserCaller(ctx.who);
|
|
3371
|
+
const body = readForm(posted, CONSOLE_FORMS.flexibleSignInCheck);
|
|
3372
|
+
const done = sayTo(response, "/settings/general?section=flexible-sign-in");
|
|
3373
|
+
const back = sayTo(response, "/settings/change/flexible-sign-in-check");
|
|
3374
|
+
if (body.sent.getAll("password").length > 1)
|
|
3375
|
+
return back("problem", "That form was sent twice over. Nothing was checked.");
|
|
3376
|
+
const proved = store.transact(() => authenticateApprover(who, body.get("password") ?? "").ok);
|
|
3377
|
+
if (!proved)
|
|
3378
|
+
return back("problem", "Enter your Toolroll password to check your Claude sign-in.");
|
|
3379
|
+
const state = signInState();
|
|
3380
|
+
const again = state === null ? null : await recheckFlexibleSignIn(store, state, { person: who.name, clock: () => now });
|
|
3381
|
+
if (again === null || !again.ok)
|
|
3382
|
+
return back("problem", "You have no Claude sign-in for threads saved. Add one first.");
|
|
3383
|
+
return done("said", signInCheckWords(again.check));
|
|
3384
|
+
}
|
|
3385
|
+
async function flexibleSignInClearAct(ctx) {
|
|
3386
|
+
const { response, now, posted } = ctx;
|
|
3387
|
+
const who = browserCaller(ctx.who);
|
|
3388
|
+
const body = readForm(posted, CONSOLE_FORMS.flexibleSignInClear);
|
|
3389
|
+
const person = (body.get("person") ?? "").trim() || who.name;
|
|
3390
|
+
const self = person === who.name;
|
|
3391
|
+
const done = sayTo(response, self ? "/settings/general?section=flexible-sign-in" : "/people");
|
|
3392
|
+
const back = sayTo(response, self ? "/settings/change/flexible-sign-in-clear" : "/people");
|
|
3393
|
+
if (["person", "password"].some(field => body.sent.getAll(field).length > 1))
|
|
3394
|
+
return back("problem", "That form was sent twice over. Nothing changed.");
|
|
3395
|
+
const removed = store.transact(() => {
|
|
3396
|
+
if (!self && !store.isInstanceOperator(who.name))
|
|
3397
|
+
return null;
|
|
3398
|
+
if (!authenticateApprover(who, body.get("password") ?? "").ok)
|
|
3399
|
+
return null;
|
|
3400
|
+
return removeFlexibleSignIn(store, { person, by: who.name, now });
|
|
3401
|
+
});
|
|
3402
|
+
if (removed === null)
|
|
3403
|
+
return back("problem", self ? "Enter your Toolroll password to remove your Claude sign-in." : "An instance operator removes someone's Claude sign-in for threads, with their password.");
|
|
3404
|
+
const state = signInState();
|
|
3405
|
+
if (state !== null)
|
|
3406
|
+
void tidyFlexibleSignIns(store, state, { now, person }).catch(() => { });
|
|
3407
|
+
return done("said", !removed.removed ? (self ? "You had no Claude sign-in for threads saved." : `${person} had no Claude sign-in for threads saved.`)
|
|
3408
|
+
: self ? "Removed. Your threads can't reach Claude until you add one again. The token still works at Claude until you revoke it in your Claude account."
|
|
3409
|
+
: `Removed ${person}'s Claude sign-in for threads. Their threads can't reach Claude until they add one again.`);
|
|
3410
|
+
}
|
|
3291
3411
|
return { registrations, modelsView };
|
|
3292
3412
|
}
|
package/dist/server/terminals.js
CHANGED
|
@@ -10,7 +10,7 @@ import { loadPtySpawn, MAX_FRAME_BYTES, TerminalHost, MAX_VIEWERS, parseTerminal
|
|
|
10
10
|
import { logEvent } from "../log.js";
|
|
11
11
|
import { sessionStandsIn, soloNow } from "../install-mode.js";
|
|
12
12
|
import { localOwnerStandsNow } from "../local-owner.js";
|
|
13
|
-
import { resultRunsOf } from "../engine-reads.js";
|
|
13
|
+
import { resultRunsOf, SHELL_NO_COMMIT, SHELL_NO_RESULT } from "../engine-reads.js";
|
|
14
14
|
import { checkEngineResponse } from "../contracts/engine-api.js";
|
|
15
15
|
import { projectName, rowVisible } from "../project.js";
|
|
16
16
|
import { transportOf } from "../public-access.js";
|
|
@@ -119,10 +119,10 @@ export function createTerminalHandlers(runtime, deps) {
|
|
|
119
119
|
return "No such task.";
|
|
120
120
|
const run = resultRunsOf(store, family).filter(one => runtime.runVisible(one)).find(one => one.id === runId) ?? null;
|
|
121
121
|
if (run === null)
|
|
122
|
-
return
|
|
122
|
+
return SHELL_NO_RESULT;
|
|
123
123
|
const revision = run.headRevision;
|
|
124
124
|
if (revision === null || !/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/.test(revision))
|
|
125
|
-
return
|
|
125
|
+
return SHELL_NO_COMMIT;
|
|
126
126
|
const repo = runtime.taskRepoOf(run.taskRef);
|
|
127
127
|
if (repo === null)
|
|
128
128
|
return "This build's project isn't known here.";
|
|
@@ -483,6 +483,9 @@ export function peopleHtml(view) {
|
|
|
483
483
|
confirm: `Change ${one.name}’s projects`, body: joinHtml([accessFields(`${slug}-access`, view.projects, one.projects), note("Changing access signs this person out and ends their sessions and modes. Work they approved stays recorded.")]) }),
|
|
484
484
|
one.you ? "" : kitSectionForm({ proof: "people-close", action: "/people/revoke", id: `${slug}-remove`, hidden: { name: one.name }, save: { label: `Remove ${one.name}`, variant: "danger" },
|
|
485
485
|
confirm: `Remove ${one.name}’s sign-in`, body: note("Ends their access and everything it signed. History stays.") }),
|
|
486
|
+
!one.threadSignIn ? "" : kitSectionForm({ proof: "flexible-sign-in-clear", action: "/settings/flexible-sign-in-clear", id: `${slug}-thread-sign-in`, hidden: { person: one.name },
|
|
487
|
+
save: { label: "Remove their Claude sign-in for threads", variant: "outline" }, confirm: `Remove ${one.name}’s Claude sign-in for threads`,
|
|
488
|
+
body: note("Their threads can't reach Claude until they add one again. Toolroll never shows or sets anyone's sign-in.") }),
|
|
486
489
|
]);
|
|
487
490
|
const recent = one.acts.length === 0 ? note("No recorded acts yet.") : note(`Recent: ${one.acts.slice(0, 3).join(" · ")}`);
|
|
488
491
|
return settingsRecord({
|
package/dist/settings-proofs.js
CHANGED
|
@@ -55,6 +55,11 @@ export const PROOF_INVENTORY = [
|
|
|
55
55
|
{ id: "mode-sign-chat-approve", action: "Sign an operating mode that lets your chat app approve", routes: ["/mode/sign"], select: { field: "chat-approve", value: "1" }, form: "mode", field: "token", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: MODE_TERMS },
|
|
56
56
|
{ id: "mode-sign-repair", action: "Sign an operating mode that repairs failed checks by itself", routes: ["/mode/sign"], select: { field: "repair-auto", value: "1" }, form: "mode", field: "token", proof: "credential", ...CREDENTIAL, role: "any", handlerRole: "an approver of the project", secrets: [], terms: MODE_TERMS },
|
|
57
57
|
{ id: "install-solo", action: "Say it's just you", routes: ["/settings/install-mode/solo"], form: "justMe", field: "password", proof: "credential", ...CREDENTIAL, role: "operator", handlerRole: "a full session (never the local owner)", secrets: [], terms: [] },
|
|
58
|
+
{ id: "flexible-switch", action: "Turn interactive agent threads off", routes: ["/settings/flexible"], form: "flexibleSwitch", field: "password", proof: "step-up", ...ACCEPT, role: "operator", secrets: [], terms: ["enabled"] },
|
|
59
|
+
{ id: "flexible-switch-on", action: "Turn interactive agent threads on", routes: ["/settings/flexible"], select: { field: "enabled", value: "on" }, form: "flexibleSwitch", field: "password", proof: "credential", ...CREDENTIAL, role: "operator", handlerRole: "a full session (never the local owner)", secrets: [], terms: ["enabled"] },
|
|
60
|
+
{ id: "flexible-sign-in", action: "Save your Claude sign-in for threads", routes: ["/settings/flexible-sign-in"], form: "flexibleSignIn", field: "password", proof: "credential", ...CREDENTIAL, role: "approver", handlerRole: "a full session, for themselves only", secrets: ["token"], notProof: ["token"], terms: [] },
|
|
61
|
+
{ id: "flexible-sign-in-check", action: "Check your Claude sign-in for threads again", routes: ["/settings/flexible-sign-in-check"], form: "flexibleSignInCheck", field: "password", proof: "step-up", ...ACCEPT, role: "approver", secrets: [], terms: [] },
|
|
62
|
+
{ id: "flexible-sign-in-clear", action: "Remove a Claude sign-in for threads", routes: ["/settings/flexible-sign-in-clear"], form: "flexibleSignInClear", field: "password", proof: "step-up", ...ACCEPT, role: "any", handlerRole: "that person, or an instance operator", secrets: [], terms: ["person"] },
|
|
58
63
|
{ id: "task-sizing", action: "Turn task sizing by a quick model call on or off", routes: ["/settings/task-sizing"], form: "taskSizing", field: "password", proof: "step-up", ...ACCEPT, role: "operator", secrets: [], terms: ["enabled", "sizer"] },
|
|
59
64
|
{ id: "provider-key", action: "Save an AI provider key", routes: ["/settings/provider-key"], form: "providerKey", field: "password", proof: "credential", ...CREDENTIAL, role: "any", secrets: ["value"], terms: [] },
|
|
60
65
|
{ id: "telegram-token", action: "Save the Telegram bot token", routes: ["/settings/telegram-token"], form: "telegramToken", field: "password", proof: "credential", ...CREDENTIAL, role: "any", secrets: ["token"], notProof: ["token"], terms: [] },
|
package/dist/store.js
CHANGED
|
@@ -28,6 +28,9 @@ import { V167_OBJECTS, V167_SCHEMA, V167_STEPS } from "./flexible-answers-schema
|
|
|
28
28
|
import { V168_OBJECTS, V168_SCHEMA, V168_STEPS } from "./flexible-ship-schema.js";
|
|
29
29
|
import { V169_ADDED_COLUMNS, V169_SCHEMA, V169_STEPS } from "./task-sizing-schema.js";
|
|
30
30
|
import { V170_ADDED_COLUMNS, V170_STEPS } from "./agent-said-schema.js";
|
|
31
|
+
import { V171_SCHEMA, V171_STEPS } from "./flexible-setting-schema.js";
|
|
32
|
+
import { V172_ADDED_COLUMNS, V172_OBJECTS, V172_SCHEMA, V172_STEPS } from "./flexible-sign-in-schema.js";
|
|
33
|
+
import { relayCancel } from "./flexible-relay-cancel.js";
|
|
31
34
|
import { endLapsedFlexible } from "./flexible.js";
|
|
32
35
|
import { refArchived, taskArchived, taskCancelled } from "./task-archive.js";
|
|
33
36
|
export { refArchived, taskArchived } from "./task-archive.js";
|
|
@@ -832,7 +835,7 @@ export function checkSuitesOf(value) {
|
|
|
832
835
|
}
|
|
833
836
|
}
|
|
834
837
|
const REGISTERED_AT_FILING = "again, as it was filed";
|
|
835
|
-
export const SCHEMA_VERSION =
|
|
838
|
+
export const SCHEMA_VERSION = 172;
|
|
836
839
|
export const V118_MERGED_TABLES = Object.freeze({ api_token: "person", coordinator_credential: "coordinator", lead_credential: "lead" });
|
|
837
840
|
const V118_REFERENCES = /REFERENCES (?:coordinator_credential\(cid\)|api_token\(id\))/g;
|
|
838
841
|
const V118_COORDINATOR_COLUMNS = [["task_ref", "coordinator_cid"], ["coordinator_event", "cid"], ["mcp_idempotency", "cid"], ["coordinator_proposal", "cid"]];
|
|
@@ -897,7 +900,7 @@ export const V115_DROPPED_TABLES = Object.freeze([
|
|
|
897
900
|
"fallback_config", "fallback_cycle", "fallback_transition",
|
|
898
901
|
]);
|
|
899
902
|
const V115_DROPPED_REFERENCES = /\s+REFERENCES (?:contestant|contest|tournament_terms|session_turn|attended_authorization|held_session|fallback_cycle|fallback_config|fallback_transition|routine|routine_fire)\(id\)(?: ON DELETE CASCADE)?/g;
|
|
900
|
-
export const UPDATE_SAFE_MIGRATIONS = Object.freeze([108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170]);
|
|
903
|
+
export const UPDATE_SAFE_MIGRATIONS = Object.freeze([108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172]);
|
|
901
904
|
export const V119_ADDED_COLUMNS = Object.freeze({
|
|
902
905
|
task_ref: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
|
|
903
906
|
run: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
|
|
@@ -1440,7 +1443,7 @@ export { V156_STEPS };
|
|
|
1440
1443
|
export { V157_STEPS };
|
|
1441
1444
|
export { V158_STEPS };
|
|
1442
1445
|
export { V159_STEPS };
|
|
1443
|
-
export { V160_STEPS, V161_STEPS, V162_STEPS, V163_STEPS, V164_STEPS, V165_STEPS, V166_STEPS, V167_STEPS, V168_STEPS, V169_STEPS, V170_STEPS };
|
|
1446
|
+
export { V160_STEPS, V161_STEPS, V162_STEPS, V163_STEPS, V164_STEPS, V165_STEPS, V166_STEPS, V167_STEPS, V168_STEPS, V169_STEPS, V170_STEPS, V171_STEPS, V172_STEPS };
|
|
1444
1447
|
export const RELEASE_ONCE_SCHEMA = `
|
|
1445
1448
|
CREATE TABLE IF NOT EXISTS release_authority (
|
|
1446
1449
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -4218,7 +4221,7 @@ function initializeStore(db, file, options = {}) {
|
|
|
4218
4221
|
throw new Error(`${file}: ${problem}; refusing to move chat history it cannot name`);
|
|
4219
4222
|
}
|
|
4220
4223
|
if (preflight === SCHEMA_VERSION && !findingSourcesStale(db)) {
|
|
4221
|
-
const missing = codeMapShapeProblem(db) ?? viewPreferenceShapeProblem(db) ?? flexibleTermsShapeProblem(db) ?? flexibleThreadShapeProblem(db) ?? typedByPersonShapeProblem(db) ?? flexibleTurnsShapeProblem(db) ?? flexibleLaunchShapeProblem(db) ?? flexibleRelayShapeProblem(db) ?? flexibleAnswersShapeProblem(db) ?? flexibleShipShapeProblem(db) ?? taskSizingShapeProblem(db) ?? agentSaidShapeProblem(db);
|
|
4224
|
+
const missing = codeMapShapeProblem(db) ?? viewPreferenceShapeProblem(db) ?? flexibleTermsShapeProblem(db) ?? flexibleThreadShapeProblem(db) ?? typedByPersonShapeProblem(db) ?? flexibleTurnsShapeProblem(db) ?? flexibleLaunchShapeProblem(db) ?? flexibleRelayShapeProblem(db) ?? flexibleAnswersShapeProblem(db) ?? flexibleShipShapeProblem(db) ?? taskSizingShapeProblem(db) ?? agentSaidShapeProblem(db) ?? flexibleSettingShapeProblem(db) ?? flexibleSignInShapeProblem(db);
|
|
4222
4225
|
if (missing !== null)
|
|
4223
4226
|
throw new Error(`${file}: refusing to open — ${missing}, though the schema says v${SCHEMA_VERSION}`);
|
|
4224
4227
|
db.exec("PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;");
|
|
@@ -4613,6 +4616,20 @@ CREATE INDEX IF NOT EXISTS run_checkpoint_by_task ON run_checkpoint (task_ref, i
|
|
|
4613
4616
|
for (const [column, { definition }] of Object.entries(columns))
|
|
4614
4617
|
addColumn(db, table, column, definition);
|
|
4615
4618
|
step("agent-said-column");
|
|
4619
|
+
db.exec(V171_SCHEMA);
|
|
4620
|
+
const flexibleSettingDamaged = flexibleSettingShapeProblem(db);
|
|
4621
|
+
if (flexibleSettingDamaged !== null)
|
|
4622
|
+
throw new Error(`${file}: refusing to open — ${flexibleSettingDamaged}`);
|
|
4623
|
+
step("flexible-setting");
|
|
4624
|
+
for (const [table, columns] of Object.entries(V172_ADDED_COLUMNS))
|
|
4625
|
+
for (const [column, { definition }] of Object.entries(columns))
|
|
4626
|
+
addColumn(db, table, column, definition);
|
|
4627
|
+
step("flexible-sign-in-columns");
|
|
4628
|
+
db.exec(V172_SCHEMA);
|
|
4629
|
+
const signInDamaged = flexibleSignInShapeProblem(db);
|
|
4630
|
+
if (signInDamaged !== null)
|
|
4631
|
+
throw new Error(`${file}: refusing to open — ${signInDamaged}`);
|
|
4632
|
+
step("flexible-sign-in");
|
|
4616
4633
|
if (!fresh)
|
|
4617
4634
|
reclaimDatabase(db, "migration");
|
|
4618
4635
|
const expectedMarker = preflight < 0 ? preflight : -preflight;
|
|
@@ -6878,6 +6895,7 @@ export class Store {
|
|
|
6878
6895
|
generation = approver.generation + 1`)
|
|
6879
6896
|
.run(name, credentialHash, now.toISOString());
|
|
6880
6897
|
this.revokeDerivedAuthority(name, "credential-rotation", now);
|
|
6898
|
+
relayCancel({ person: name });
|
|
6881
6899
|
});
|
|
6882
6900
|
return null;
|
|
6883
6901
|
});
|
|
@@ -7925,6 +7943,8 @@ export class Store {
|
|
|
7925
7943
|
this.db
|
|
7926
7944
|
.prepare("UPDATE approver SET revoked_at = ?, revoked_by = ?, generation = generation + 1 WHERE name = ?")
|
|
7927
7945
|
.run(stamp, by, name);
|
|
7946
|
+
this.db.prepare("UPDATE flexible_sign_in SET state = 'retiring', save_op = NULL, retire_after = NULL, retired_at = ? WHERE person = ? AND state IN ('staged', 'active')").run(stamp, name);
|
|
7947
|
+
relayCancel({ person: name });
|
|
7928
7948
|
this.db.exec("SAVEPOINT view_preference_cleanup");
|
|
7929
7949
|
try {
|
|
7930
7950
|
this.db.prepare("DELETE FROM view_preference WHERE account = ?").run(name);
|
|
@@ -18895,7 +18915,8 @@ function flexibleRelayShapeProblem(db) {
|
|
|
18895
18915
|
if (row === undefined)
|
|
18896
18916
|
return `the Flexible relay calls ${type} ${name} is missing`;
|
|
18897
18917
|
const want = statements.find(one => new RegExp(`^CREATE (?:UNIQUE )?${type.toUpperCase()} IF NOT EXISTS ${name}\\b`).test(one));
|
|
18898
|
-
|
|
18918
|
+
const stored = type === "table" ? withoutAddedColumns(String(row["sql"]).replace(/;$/, ""), V172_ADDED_COLUMNS[name] ?? {}) : canonicalDdl(String(row["sql"]).replace(/;$/, ""));
|
|
18919
|
+
if (want === undefined || stored === null || stored.trim() !== canonicalDdl(want).trim())
|
|
18899
18920
|
return `the Flexible relay calls ${type} ${name} has an unknown shape`;
|
|
18900
18921
|
}
|
|
18901
18922
|
return null;
|
|
@@ -18961,3 +18982,48 @@ export function agentSaidOf(store, runId) {
|
|
|
18961
18982
|
return null;
|
|
18962
18983
|
}
|
|
18963
18984
|
}
|
|
18985
|
+
function flexibleSettingShapeProblem(db) {
|
|
18986
|
+
const row = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'flexible_setting'").get();
|
|
18987
|
+
if (row === undefined)
|
|
18988
|
+
return "the interactive agent threads setting table is missing";
|
|
18989
|
+
if (canonicalDdl(String(row["sql"]).replace(/;$/, "")).trim() !== canonicalDdl(V171_SCHEMA.trim().replace(/;$/, "")).trim())
|
|
18990
|
+
return "the interactive agent threads setting table has an unknown shape";
|
|
18991
|
+
return null;
|
|
18992
|
+
}
|
|
18993
|
+
function withoutAddedColumns(sql, columns) {
|
|
18994
|
+
let out = canonicalDdl(sql);
|
|
18995
|
+
for (const [name, { definition }] of Object.entries(columns)) {
|
|
18996
|
+
const piece = canonicalDdl(`, ${name} ${definition}`).trim();
|
|
18997
|
+
const at = out.indexOf(piece);
|
|
18998
|
+
if (at < 0)
|
|
18999
|
+
continue;
|
|
19000
|
+
if (out.indexOf(piece, at + 1) >= 0)
|
|
19001
|
+
return null;
|
|
19002
|
+
out = out.slice(0, at) + out.slice(at + piece.length);
|
|
19003
|
+
}
|
|
19004
|
+
for (const name of Object.keys(columns))
|
|
19005
|
+
if (new RegExp(`\\b${name}\\b`).test(out))
|
|
19006
|
+
return null;
|
|
19007
|
+
return out;
|
|
19008
|
+
}
|
|
19009
|
+
function flexibleSignInShapeProblem(db) {
|
|
19010
|
+
const statements = V172_SCHEMA.split(/;\s*\n(?=CREATE )/).map(one => one.trim().replace(/;$/, "")).filter(one => one !== "");
|
|
19011
|
+
for (const [type, name] of V172_OBJECTS) {
|
|
19012
|
+
const row = db.prepare("SELECT sql FROM sqlite_master WHERE type = ? AND name = ?").get(type, name);
|
|
19013
|
+
if (row === undefined)
|
|
19014
|
+
return `the Claude sign-ins ${type} ${name} is missing`;
|
|
19015
|
+
const want = statements.find(one => new RegExp(`^CREATE (?:UNIQUE )?${type.toUpperCase()} IF NOT EXISTS ${name}\\b`).test(one));
|
|
19016
|
+
if (want === undefined || canonicalDdl(String(row["sql"]).replace(/;$/, "")).trim() !== canonicalDdl(want).trim())
|
|
19017
|
+
return `the Claude sign-ins ${type} ${name} has an unknown shape`;
|
|
19018
|
+
}
|
|
19019
|
+
for (const [table, columns] of Object.entries(V172_ADDED_COLUMNS)) {
|
|
19020
|
+
const row = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?").get(table);
|
|
19021
|
+
for (const [column, { definition }] of Object.entries(columns)) {
|
|
19022
|
+
if (!hasColumn(db, table, column))
|
|
19023
|
+
return `${table}.${column} is missing`;
|
|
19024
|
+
if (row === undefined || !canonicalDdl(String(row["sql"])).includes(canonicalDdl(`, ${column} ${definition}`).trim()))
|
|
19025
|
+
return `${table}.${column} has an unknown shape`;
|
|
19026
|
+
}
|
|
19027
|
+
}
|
|
19028
|
+
return null;
|
|
19029
|
+
}
|
|
@@ -5,6 +5,7 @@ import { closeSync, constants, fstatSync, fsyncSync, linkSync, lstatSync, mkdirS
|
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { envValue } from "./names.js";
|
|
7
7
|
import { sleep } from "./sleep.js";
|
|
8
|
+
import { signInSlot } from "./flexible-sign-in-slot.js";
|
|
8
9
|
export class SecretStoreError extends Error {
|
|
9
10
|
}
|
|
10
11
|
export const STORE_WORDS = {
|
|
@@ -709,3 +710,107 @@ export function writeHeldSecret(state, name, file, value) {
|
|
|
709
710
|
writeSealed(backend, folder, item, value);
|
|
710
711
|
});
|
|
711
712
|
}
|
|
713
|
+
const SIGN_IN_SLOT = /^[0-9a-f]{16}$/;
|
|
714
|
+
const SIGN_IN_GENERATION = /^[0-9a-f]{32}$/;
|
|
715
|
+
const SIGN_IN_VALUE = /^sk-ant-oat\d{2}-[A-Za-z0-9_-]{20,400}$/;
|
|
716
|
+
const WRONG_PERSON = "A saved Claude sign-in isn't the one its record names, so it isn't used.";
|
|
717
|
+
function signInAddress(folder, person, generation, make = false) {
|
|
718
|
+
if (typeof person !== "string" || person.length < 1 || person.length > 200 || typeof generation !== "string" || !SIGN_IN_GENERATION.test(generation))
|
|
719
|
+
throw new SecretStoreError("A secret's address can't be used.");
|
|
720
|
+
const slot = signInSlot(person);
|
|
721
|
+
if (!SIGN_IN_SLOT.test(slot))
|
|
722
|
+
throw new SecretStoreError("A secret's address can't be used.");
|
|
723
|
+
return { item: { service: serviceOf(folder), account: `flexible-sign-in.${slot}.${generation}` },
|
|
724
|
+
file: pathIn(folder.dir, ["flexible-sign-in", `${slot}.${generation}.json`], { make }), lock: `flexible-sign-in.${slot}` };
|
|
725
|
+
}
|
|
726
|
+
function signInOf(text, person, generation) {
|
|
727
|
+
let parsed;
|
|
728
|
+
try {
|
|
729
|
+
parsed = JSON.parse(text);
|
|
730
|
+
}
|
|
731
|
+
catch {
|
|
732
|
+
throw new SecretStoreError(WRONG_PERSON);
|
|
733
|
+
}
|
|
734
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
735
|
+
throw new SecretStoreError(WRONG_PERSON);
|
|
736
|
+
const one = parsed;
|
|
737
|
+
if (Object.keys(one).sort().join(",") !== "generation,kind,person,value" || one["person"] !== person || one["generation"] !== generation || one["kind"] !== "setup-token"
|
|
738
|
+
|| typeof one["value"] !== "string" || !SIGN_IN_VALUE.test(one["value"]))
|
|
739
|
+
throw new SecretStoreError(WRONG_PERSON);
|
|
740
|
+
return { person, generation, kind: "setup-token", value: one["value"] };
|
|
741
|
+
}
|
|
742
|
+
export function createSignInSecret(state, secret) {
|
|
743
|
+
if (secret.kind !== "setup-token" || typeof secret.value !== "string" || !SIGN_IN_VALUE.test(secret.value))
|
|
744
|
+
throw new SecretStoreError("A sign-in's form can't be used.");
|
|
745
|
+
const folder = secretFolder(state);
|
|
746
|
+
const address = signInAddress(folder, secret.person, secret.generation, true);
|
|
747
|
+
const text = JSON.stringify({ person: secret.person, generation: secret.generation, kind: secret.kind, value: secret.value });
|
|
748
|
+
const backend = secretBackend();
|
|
749
|
+
if (backend !== null)
|
|
750
|
+
return writeSealed(backend, folder, address.item, text, { create: true });
|
|
751
|
+
const staged = `${address.file}.${process.pid}.${randomBytes(4).toString("hex")}.new`;
|
|
752
|
+
const fd = openSync(staged, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600);
|
|
753
|
+
try {
|
|
754
|
+
writeSync(fd, text);
|
|
755
|
+
fsyncSync(fd);
|
|
756
|
+
}
|
|
757
|
+
finally {
|
|
758
|
+
closeSync(fd);
|
|
759
|
+
}
|
|
760
|
+
try {
|
|
761
|
+
linkSync(staged, address.file);
|
|
762
|
+
}
|
|
763
|
+
catch (error) {
|
|
764
|
+
rmSync(staged, { force: true });
|
|
765
|
+
if (codeOf(error) === "EEXIST")
|
|
766
|
+
return "exists";
|
|
767
|
+
throw new SecretStoreError("A sign-in couldn't be saved in Toolroll's folder for secrets.");
|
|
768
|
+
}
|
|
769
|
+
rmSync(staged, { force: true });
|
|
770
|
+
return "ok";
|
|
771
|
+
}
|
|
772
|
+
export function readSignInSecret(state, person, generation) {
|
|
773
|
+
const folder = secretFolder(state);
|
|
774
|
+
const address = signInAddress(folder, person, generation);
|
|
775
|
+
const backend = secretBackend();
|
|
776
|
+
const text = backend === null ? readOwnFile(address.file) : readSealed(backend, folder, address.item);
|
|
777
|
+
return text === null ? null : signInOf(text, person, generation);
|
|
778
|
+
}
|
|
779
|
+
export function removeSignInSecret(state, person, generation) {
|
|
780
|
+
const folder = secretFolder(state);
|
|
781
|
+
const address = signInAddress(folder, person, generation);
|
|
782
|
+
const backend = secretBackend();
|
|
783
|
+
let text;
|
|
784
|
+
try {
|
|
785
|
+
text = backend === null ? readOwnFile(address.file) : readSealed(backend, folder, address.item);
|
|
786
|
+
}
|
|
787
|
+
catch (error) {
|
|
788
|
+
if (backend !== null && error instanceof SecretStoreError && /refused|couldn't be reached/.test(error.message))
|
|
789
|
+
throw error;
|
|
790
|
+
text = "";
|
|
791
|
+
}
|
|
792
|
+
if (text === null)
|
|
793
|
+
return "absent";
|
|
794
|
+
if (text !== "") {
|
|
795
|
+
let parsed = null;
|
|
796
|
+
try {
|
|
797
|
+
parsed = JSON.parse(text);
|
|
798
|
+
}
|
|
799
|
+
catch {
|
|
800
|
+
parsed = null;
|
|
801
|
+
}
|
|
802
|
+
const named = parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
803
|
+
if (named !== null && (named["person"] !== person || named["generation"] !== generation))
|
|
804
|
+
return "not-theirs";
|
|
805
|
+
}
|
|
806
|
+
if (backend === null)
|
|
807
|
+
destroyOwnFile(address.file);
|
|
808
|
+
else
|
|
809
|
+
removeValue(backend, address.item);
|
|
810
|
+
return "removed";
|
|
811
|
+
}
|
|
812
|
+
export function withSignInLockAsync(state, person, work, options = {}) {
|
|
813
|
+
const folder = secretFolder(state);
|
|
814
|
+
const address = signInAddress(folder, person, "0".repeat(32));
|
|
815
|
+
return withSecretLockAsync(folder, address.lock, work, { staleMs: 120_000, waitMs: options.waitMs ?? 30_000 });
|
|
816
|
+
}
|
package/dist/toolroll-update.js
CHANGED
|
@@ -22,6 +22,7 @@ import { V153_ADDED_COLUMNS } from "./plain-schema.js";
|
|
|
22
22
|
import { V158_ADDED_COLUMNS } from "./lead-latency-schema.js";
|
|
23
23
|
import { V169_ADDED_COLUMNS } from "./task-sizing-schema.js";
|
|
24
24
|
import { V170_ADDED_COLUMNS } from "./agent-said-schema.js";
|
|
25
|
+
import { V172_ADDED_COLUMNS } from "./flexible-sign-in-schema.js";
|
|
25
26
|
import { V159_ADDED_COLUMNS } from "./one-step-chat-schema.js";
|
|
26
27
|
import { isNewer, REGISTRY } from "./releases.js";
|
|
27
28
|
import { markNeverIndex } from "./never-index.js";
|
|
@@ -326,7 +327,7 @@ const HISTORY_RULES = {
|
|
|
326
327
|
...Object.fromEntries(Object.entries(V117_RENAMED_TABLES).map(([old, now]) => [old, { moved: { into: now, where: "1" } }])),
|
|
327
328
|
...Object.fromEntries(V117_RENAMED_COLUMNS.filter(([table]) => !Object.values(V117_RENAMED_TABLES).includes(table)).map(([table, from, to]) => [table, { renamed: { [from]: to } }])),
|
|
328
329
|
...Object.fromEntries(Object.entries(V118_MERGED_TABLES).map(([table, kind]) => [table, { moved: { into: "credential", where: `kind = '${kind}'` } }])),
|
|
329
|
-
...Object.fromEntries(Object.entries(addedColumns(V119_ADDED_COLUMNS, V120_ADDED_COLUMNS, V121_ADDED_COLUMNS, V122_ADDED_COLUMNS, V123_ADDED_COLUMNS, V125_ADDED_COLUMNS, V126_ADDED_COLUMNS, V128_ADDED_COLUMNS, V129_ADDED_COLUMNS, V134_ADDED_COLUMNS, V135_ADDED_COLUMNS, V138_ADDED_COLUMNS, V143_ADDED_COLUMNS, V147_ADDED_COLUMNS, V148_ADDED_COLUMNS, V150_ADDED_COLUMNS, V151_ADDED_COLUMNS, V152_ADDED_COLUMNS, V153_ADDED_COLUMNS, V158_ADDED_COLUMNS, V159_ADDED_COLUMNS, V169_ADDED_COLUMNS, V170_ADDED_COLUMNS))
|
|
330
|
+
...Object.fromEntries(Object.entries(addedColumns(V119_ADDED_COLUMNS, V120_ADDED_COLUMNS, V121_ADDED_COLUMNS, V122_ADDED_COLUMNS, V123_ADDED_COLUMNS, V125_ADDED_COLUMNS, V126_ADDED_COLUMNS, V128_ADDED_COLUMNS, V129_ADDED_COLUMNS, V134_ADDED_COLUMNS, V135_ADDED_COLUMNS, V138_ADDED_COLUMNS, V143_ADDED_COLUMNS, V147_ADDED_COLUMNS, V148_ADDED_COLUMNS, V150_ADDED_COLUMNS, V151_ADDED_COLUMNS, V152_ADDED_COLUMNS, V153_ADDED_COLUMNS, V158_ADDED_COLUMNS, V159_ADDED_COLUMNS, V169_ADDED_COLUMNS, V170_ADDED_COLUMNS, V172_ADDED_COLUMNS))
|
|
330
331
|
.map(([table, rule]) => [table, { ...EARLIER_RULES[table], ...rule }])),
|
|
331
332
|
};
|
|
332
333
|
export const RETIRED_TABLES = Object.freeze(Object.keys(HISTORY_RULES).filter(name => HISTORY_RULES[name].retired));
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/tui-contract.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const TUI_PAGES = Object.freeze(["flexible", "flexible-sign-in", "project"]);
|
|
2
|
+
export const isTuiPage = (value) => typeof value === "string" && TUI_PAGES.includes(value);
|
package/dist/tui-launch.js
CHANGED
|
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
import { spawnHoldingLink } from "./engine-handoff.js";
|
|
6
6
|
import { trustedBinary } from "./trusted-path.js";
|
|
7
7
|
export { aclVerdictOf, trustedBinary } from "./trusted-path.js";
|
|
8
|
+
import { isTuiPage } from "./tui-contract.js";
|
|
8
9
|
export const TUI_EXIT = { leave: 0, stop: 40, keep: 41, classic: 42, unprotected: 43 };
|
|
9
10
|
export const TUI_PACKAGES = Object.freeze({
|
|
10
11
|
"darwin-arm64": "@toolroll/tui-darwin-arm64", "darwin-x64": "@toolroll/tui-darwin-x64",
|
|
@@ -249,7 +250,8 @@ export async function runTuiBinary(input) {
|
|
|
249
250
|
continue;
|
|
250
251
|
}
|
|
251
252
|
if (ask !== null && typeof ask === "object" && ask["want"] === "browser") {
|
|
252
|
-
|
|
253
|
+
const page = ask["page"];
|
|
254
|
+
void (isTuiPage(page) ? input.session.openBrowser(page) : input.session.openBrowser()).catch(() => "The browser couldn't be opened.").then(said => {
|
|
253
255
|
if ("write" in asks && !child.killed && child.exitCode === null)
|
|
254
256
|
asks.write(`${JSON.stringify({ said })}\n`);
|
|
255
257
|
});
|
package/dist/work-index.js
CHANGED
|
@@ -790,6 +790,10 @@ function itemOf(row, principal, probe, leadName, readiness, readable = false, no
|
|
|
790
790
|
...(lead === null ? {} : { lead, ...(leadName === undefined ? {} : { leadName }) }) });
|
|
791
791
|
label = code === 'cancelled' && shared.headline === 'Stopped' && !shared.sentence.startsWith('Replaced by ') ? 'Cancelled' : shared.headline;
|
|
792
792
|
detail = shared.sentence;
|
|
793
|
+
if (code === 'held' && s(row, 'hold_reason') === 'stopped retrying from the terminal') {
|
|
794
|
+
label = 'On hold';
|
|
795
|
+
detail = 'you stopped retrying';
|
|
796
|
+
}
|
|
793
797
|
const firstSignIn = code === 'signed-out' && n(row, 'no_agent') > 0 && s(row, 'signed_out') === null;
|
|
794
798
|
if (shared.need != null && shared.need.key !== 'other' && shared.need.key !== 'review-result' && primaryAction !== null && !firstSignIn) {
|
|
795
799
|
actionLabel = shared.need.action.label;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolroll",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.114",
|
|
4
4
|
"description": "Your agents build. You decide. A control plane for coding agents — Claude Code, Codex, Gemini: approve the exact scope once, get results back Ready with the diff, the passing check and screenshots. Runs on your machine.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"doc": "docs"
|