toolroll 0.9.112 → 0.9.113

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +28 -29
  3. package/dist/contracts/console-api.js +2 -1
  4. package/dist/contracts/engine-api.js +12 -0
  5. package/dist/easy-start.js +4 -1
  6. package/dist/engine-reads.js +15 -0
  7. package/dist/fast-terms.js +8 -4
  8. package/dist/flexible-agents.js +2 -8
  9. package/dist/flexible-answers.js +4 -26
  10. package/dist/flexible-available.js +31 -1
  11. package/dist/flexible-import.js +2 -14
  12. package/dist/flexible-launch.js +15 -3
  13. package/dist/flexible-launcher.js +0 -5
  14. package/dist/flexible-relay.js +7 -4
  15. package/dist/flexible-session.js +123 -32
  16. package/dist/flexible-setting-schema.js +10 -0
  17. package/dist/flexible-ship.js +8 -18
  18. package/dist/flexible-start.js +2 -2
  19. package/dist/flexible-thread.js +21 -27
  20. package/dist/flexible-turns.js +7 -17
  21. package/dist/flexible.js +9 -11
  22. package/dist/flow-triggers.js +4 -1
  23. package/dist/live-terminal.js +28 -0
  24. package/dist/local-owner.js +1 -0
  25. package/dist/operate.js +60 -4
  26. package/dist/release.js +1 -0
  27. package/dist/serve.js +9 -0
  28. package/dist/server/engine-api.js +91 -27
  29. package/dist/server/mutation-key.js +6 -0
  30. package/dist/server/route-table.js +3 -0
  31. package/dist/server/settings-section-table.js +3 -0
  32. package/dist/server/settings-sections.js +23 -0
  33. package/dist/server/settings.js +36 -3
  34. package/dist/server/terminals.js +3 -3
  35. package/dist/settings-proofs.js +2 -0
  36. package/dist/store.js +18 -4
  37. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  38. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  39. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  40. package/dist/tui/linux-x64/toolroll-tui +0 -0
  41. package/dist/work-index.js +4 -0
  42. package/package.json +1 -1
@@ -88,6 +88,7 @@ const LOCAL_POSTS = Object.freeze({
88
88
  "settings.knowledge-tidy": "memory-review",
89
89
  "settings.advanced": "view-preference",
90
90
  "settings.task-sizing": "task-sizing-switch",
91
+ "settings.flexible": "flexible-switch",
91
92
  "agents.seen": "mark-seen",
92
93
  "agents.watch": "watch-agent",
93
94
  });
@@ -267,6 +268,7 @@ get("tasks", "task.page", `^\\/t\\/${TASK}$`, { project: "task", limited: "resou
267
268
  get("tasks", "task.evidence", `^\\/t\\/${TASK}\\/evidence$`, { project: "task", limited: "resource", ...free, sample: "/t/one/evidence" });
268
269
  get("tasks", "task.steps", `^\\/t\\/${TASK}\\/steps$`, { project: "task", limited: "resource", ...free, sample: "/t/one/steps" });
269
270
  get("tasks", "task.diff", `^\\/t\\/${TASK}\\/diff$`, { project: "task", limited: "resource", ...free, sample: "/t/one/diff" });
271
+ get("tasks", "task.approval", `^\\/t\\/${TASK}\\/approval$`, { project: "task", limited: "resource", callers: ["cookie"], ...free, sample: "/t/one/approval" });
270
272
  get("tasks", "task.release", `^\\/t\\/${TASK}\\/release$`, { project: "task", limited: "resource", ...free, sample: "/t/one/release" });
271
273
  get("tasks", "release.locate", `^\\/approve\\/${ID}$`, { project: "task-ref", limited: "resource", ...free, sample: "/approve/1" });
272
274
  get("pages", "ledger.export", "/ledger/export", { limited: "unscoped", ...free });
@@ -418,6 +420,7 @@ get("settings", "settings.passwordless", "/settings/passwordless", { ...free, ..
418
420
  post("settings", "settings.passwordless-send", "/settings/passwordless", { callers: ["cookie"], ...operator("An instance operator sets Passwordless.", "/settings") });
419
421
  post("settings", "settings.local-mode-off", "/settings/local-mode/off", { callers: ["cookie"], scope: "step-up", ...operator("An instance operator turns off local mode.", "/settings/general?section=local-mode") });
420
422
  post("settings", "settings.task-sizing", "/settings/task-sizing", { scope: "step-up", limited: "deny", ...operator("An instance operator chooses how tasks are sized.", "/settings/general?section=task-sizing") });
423
+ post("settings", "settings.flexible", "/settings/flexible", { callers: ["cookie"], scope: "step-up", limited: "deny", ...operator("An instance operator turns interactive agent threads on or off.", "/settings/general?section=flexible") });
421
424
  post("settings", "settings.just-me", "/settings/install-mode/solo", { callers: ["cookie"], scope: "step-up", ...operator("An instance operator says it's just them.", "/settings/general?section=install-mode") });
422
425
  post("settings", "settings.release-approval-send", "/settings/release-approval", { callers: ["cookie"], ...approver("An approver sets how releases are approved.", "/settings/approval") });
423
426
  post("pages", "ledger.checkpoint", "/ledger/checkpoint", operator("An instance operator makes ledger checkpoints.", "/ledger"));
@@ -20,6 +20,9 @@ export const SETTINGS_SECTIONS = Object.freeze([
20
20
  { id: "task-sizing", area: "general", title: "Size tasks with a quick model call (Claude Haiku, on your plan)", pinnedFrom: "settings.group-general", policy: GROUP_PAGE,
21
21
  read: ["installation"], scope: {}, act: { switch: ["cookie-session", "operator"] }, changes: [{ id: "task-sizing", act: "switch", proof: "task-sizing" }],
22
22
  opens: false, scripts: [], oldIds: [] },
23
+ { id: "flexible", area: "general", title: "Interactive agent threads (beta)", pinnedFrom: "settings.group-general", policy: GROUP_PAGE,
24
+ read: ["installation"], scope: {}, act: { switch: ["cookie-session", "operator"] }, changes: [{ id: "flexible", act: "switch", proof: "flexible-switch" }],
25
+ opens: false, scripts: [], oldIds: [] },
23
26
  { id: "advanced", area: "general", title: "Show advanced features", pinnedFrom: "settings.group-advanced", policy: GROUP_PAGE,
24
27
  read: [], scope: { "operator-pages": ["operator"] }, act: { switch: ["cookie-session"] }, changes: [], opens: true, scripts: [], oldIds: ["show-advanced"] },
25
28
  { id: "local-mode", area: "general", title: "Local mode", pinnedFrom: "settings.group-access", policy: GROUP_PAGE,
@@ -304,6 +304,28 @@ function taskSizingSection(deps) {
304
304
  },
305
305
  };
306
306
  }
307
+ export const FLEXIBLE_SETTING_WORDS = "Claude Code only for now. Runs inside Toolroll's sandbox with your Claude sign-in relayed; Toolroll never gives the agent your key.";
308
+ function flexibleSection(deps) {
309
+ return {
310
+ loadSummary: ctx => ({ on: deps.flexible().on, canSwitch: ctx.can["switch"] === true }),
311
+ render: ({ summary, attrs }) => settingsSection({ id: "flexible", title: "Interactive agent threads (beta)", state: summary.on ? " · on" : " · off", attrs,
312
+ lead: `${summary.on ? "On" : "Off"}. ${FLEXIBLE_SETTING_WORDS}`,
313
+ ...(summary.canSwitch ? { right: btn(summary.on ? "Turn off" : "Turn on", { sm: true, href: "/settings/change/flexible" }) } : {}), body: html `` }),
314
+ refusal: "An instance operator turns interactive agent threads on or off.",
315
+ renderChange: ({ declaration, summary, problem }) => {
316
+ const home = sectionHref(declaration);
317
+ const on = summary?.on === true;
318
+ const title = "Interactive agent threads (beta)";
319
+ const words = joinHtml([
320
+ html `<p>${on ? "Turn them off. No new thread or turn starts, and any thread running now is stopped." : `Turn them on. Press T in the workbench to work with Claude Code in a thread. ${FLEXIBLE_SETTING_WORDS} Each project still needs its own Flexible terms, and each thread shows its terms before it starts.`}</p>`,
321
+ problem === null ? "" : notice(problem),
322
+ kitSectionForm({ proof: on ? "flexible-switch" : "flexible-switch-on", action: "/settings/flexible", id: "flexible-form", native: true, save: { label: on ? "Turn off" : "Turn on" }, confirm: on ? "Turn off interactive agent threads" : "Turn on interactive agent threads", hidden: { enabled: on ? "off" : "on" }, body: html `` }),
323
+ html `<div class="k-acts">${btn("Cancel", { variant: "ghost", href: home })}</div>`,
324
+ ]);
325
+ return { title, body: html `<div data-kit-page>${phoneHeader(title, { back: home })}${doc(docHeader({ title, back: [home, "General"], same: true }), words)}</div>` };
326
+ },
327
+ };
328
+ }
307
329
  export function generalSections(deps) {
308
330
  return {
309
331
  appearance: appearanceSection(),
@@ -312,6 +334,7 @@ export function generalSections(deps) {
312
334
  version: versionSection(deps),
313
335
  "install-mode": installModeSection(deps),
314
336
  "task-sizing": taskSizingSection(deps),
337
+ flexible: flexibleSection(deps),
315
338
  advanced: advancedSection(),
316
339
  "local-mode": localModeSection(deps),
317
340
  };
@@ -58,7 +58,7 @@ 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 { FLEXIBLE_AVAILABLE } from "../flexible-available.js";
61
+ import { flexibleAvailable, flexibleSetting, setFlexibleSetting } from "../flexible-available.js";
62
62
  import { enableFlexible, FLEXIBLE_LEVEL_WORDS, FLEXIBLE_UNAVAILABLE, flexibleSettingsView, isFlexibleLevel, lowerFlexible, turnFlexibleOff } from "../flexible.js";
63
63
  import { backupHtml } from "../backup-ui.js";
64
64
  import { BACKUP_EVERY_HOURS, backupFolderOf, backupNow, checkBackupFolder, defaultBackupFolder, MAX_KEEP } from "../backup.js";
@@ -2766,6 +2766,7 @@ ${postForm("/settings/chat-approval/save", html `\
2766
2766
  "settings.lead-about": leadAbout,
2767
2767
  "settings.lead-quick": leadQuick,
2768
2768
  "settings.task-sizing": taskSizingAct,
2769
+ "settings.flexible": flexibleSwitchAct,
2769
2770
  "settings.lead-promise-cancel": leadPromiseCancel,
2770
2771
  "settings.lead-on": leadOn,
2771
2772
  "settings.code-map": codeMapAct("switch"),
@@ -3020,6 +3021,37 @@ ${postForm("/settings/chat-approval/save", html `\
3020
3021
  const read = taskSizingSetting(store);
3021
3022
  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
3023
  }
3024
+ async function flexibleSwitchAct(ctx) {
3025
+ const { response, now, posted } = ctx;
3026
+ const who = browserCaller(ctx.who);
3027
+ const body = readForm(posted, CONSOLE_FORMS.flexibleSwitch);
3028
+ const done = sayTo(response, "/settings/general?section=flexible");
3029
+ const back = sayTo(response, "/settings/change/flexible");
3030
+ if (["password", "enabled"].some(field => body.sent.getAll(field).length > 1))
3031
+ return back("problem", "That form was sent twice over. Nothing changed.");
3032
+ const wanted = body.get("enabled");
3033
+ if (wanted !== "on" && wanted !== "off")
3034
+ return back("problem", "Choose on or off.");
3035
+ const saved = store.transact(() => {
3036
+ if (!store.isInstanceOperator(who.name))
3037
+ return false;
3038
+ if (wanted === "on") {
3039
+ if (!authenticateCredential(who, body.get("password") ?? "").ok)
3040
+ return false;
3041
+ }
3042
+ else {
3043
+ if (who.authority !== "full" && localActNow(store, "flexible-switch") === null)
3044
+ return false;
3045
+ if (!authenticateApprover(who, body.get("password") ?? "").ok)
3046
+ return false;
3047
+ }
3048
+ setFlexibleSetting(store, wanted === "on", who.name, now);
3049
+ return true;
3050
+ });
3051
+ if (!saved)
3052
+ 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.");
3053
+ return done("said", wanted === "on" ? "Interactive agent threads are on. Press T in the workbench to start one with Claude Code." : "Interactive agent threads are off. Any thread still running is stopped.");
3054
+ }
3023
3055
  async function justMe(ctx) {
3024
3056
  const { response, now, posted } = ctx;
3025
3057
  const who = browserCaller(ctx.who);
@@ -3156,8 +3188,6 @@ ${postForm("/settings/chat-approval/save", html `\
3156
3188
  async function projectFlexible(ctx) {
3157
3189
  const { response, now, posted } = ctx;
3158
3190
  const who = browserCaller(ctx.who);
3159
- if (!FLEXIBLE_AVAILABLE)
3160
- return refuse(response, who, 403, FLEXIBLE_UNAVAILABLE, "/settings/project");
3161
3191
  const body = readForm(posted, CONSOLE_FORMS.projectFlexible);
3162
3192
  const repo = body.get("repo") ?? "";
3163
3193
  if (!consoleProjects().includes(repo) || !visible(repo))
@@ -3179,6 +3209,8 @@ ${postForm("/settings/chat-approval/save", html `\
3179
3209
  }
3180
3210
  if (action !== "enable")
3181
3211
  return back("problem", "Choose to turn Flexible on, lower it or turn it off. Nothing changed.");
3212
+ if (!flexibleAvailable(store))
3213
+ return refuse(response, who, 403, FLEXIBLE_UNAVAILABLE, "/settings/project");
3182
3214
  const proved = authenticateCredential(who, body.get("password") ?? "", repo);
3183
3215
  if (!proved.ok)
3184
3216
  return back("problem", "Enter your Toolroll password to turn on Flexible.");
@@ -3199,6 +3231,7 @@ ${postForm("/settings/chat-approval/save", html `\
3199
3231
  localModeOn: () => localModeOf(store)?.enabled === true,
3200
3232
  installMode: () => installModeNow(store),
3201
3233
  taskSizing: () => taskSizingSetting(store),
3234
+ flexible: () => flexibleSetting(store),
3202
3235
  });
3203
3236
  const computersDeps = {
3204
3237
  computers: (now, manage) => computersOf(store, now, visible, manage),
@@ -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 "This build has no saved result yet. Wait for it to finish (or stop it), then take over.";
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 "This build has no saved commit to open a terminal on.";
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.";
@@ -55,6 +55,8 @@ 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"] },
58
60
  { 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
61
  { 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
62
  { 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,7 @@ 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";
31
32
  import { endLapsedFlexible } from "./flexible.js";
32
33
  import { refArchived, taskArchived, taskCancelled } from "./task-archive.js";
33
34
  export { refArchived, taskArchived } from "./task-archive.js";
@@ -832,7 +833,7 @@ export function checkSuitesOf(value) {
832
833
  }
833
834
  }
834
835
  const REGISTERED_AT_FILING = "again, as it was filed";
835
- export const SCHEMA_VERSION = 170;
836
+ export const SCHEMA_VERSION = 171;
836
837
  export const V118_MERGED_TABLES = Object.freeze({ api_token: "person", coordinator_credential: "coordinator", lead_credential: "lead" });
837
838
  const V118_REFERENCES = /REFERENCES (?:coordinator_credential\(cid\)|api_token\(id\))/g;
838
839
  const V118_COORDINATOR_COLUMNS = [["task_ref", "coordinator_cid"], ["coordinator_event", "cid"], ["mcp_idempotency", "cid"], ["coordinator_proposal", "cid"]];
@@ -897,7 +898,7 @@ export const V115_DROPPED_TABLES = Object.freeze([
897
898
  "fallback_config", "fallback_cycle", "fallback_transition",
898
899
  ]);
899
900
  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]);
901
+ 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]);
901
902
  export const V119_ADDED_COLUMNS = Object.freeze({
902
903
  task_ref: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
903
904
  run: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
@@ -1440,7 +1441,7 @@ export { V156_STEPS };
1440
1441
  export { V157_STEPS };
1441
1442
  export { V158_STEPS };
1442
1443
  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 };
1444
+ 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 };
1444
1445
  export const RELEASE_ONCE_SCHEMA = `
1445
1446
  CREATE TABLE IF NOT EXISTS release_authority (
1446
1447
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -4218,7 +4219,7 @@ function initializeStore(db, file, options = {}) {
4218
4219
  throw new Error(`${file}: ${problem}; refusing to move chat history it cannot name`);
4219
4220
  }
4220
4221
  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);
4222
+ 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);
4222
4223
  if (missing !== null)
4223
4224
  throw new Error(`${file}: refusing to open — ${missing}, though the schema says v${SCHEMA_VERSION}`);
4224
4225
  db.exec("PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;");
@@ -4613,6 +4614,11 @@ CREATE INDEX IF NOT EXISTS run_checkpoint_by_task ON run_checkpoint (task_ref, i
4613
4614
  for (const [column, { definition }] of Object.entries(columns))
4614
4615
  addColumn(db, table, column, definition);
4615
4616
  step("agent-said-column");
4617
+ db.exec(V171_SCHEMA);
4618
+ const flexibleSettingDamaged = flexibleSettingShapeProblem(db);
4619
+ if (flexibleSettingDamaged !== null)
4620
+ throw new Error(`${file}: refusing to open — ${flexibleSettingDamaged}`);
4621
+ step("flexible-setting");
4616
4622
  if (!fresh)
4617
4623
  reclaimDatabase(db, "migration");
4618
4624
  const expectedMarker = preflight < 0 ? preflight : -preflight;
@@ -18961,3 +18967,11 @@ export function agentSaidOf(store, runId) {
18961
18967
  return null;
18962
18968
  }
18963
18969
  }
18970
+ function flexibleSettingShapeProblem(db) {
18971
+ const row = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'flexible_setting'").get();
18972
+ if (row === undefined)
18973
+ return "the interactive agent threads setting table is missing";
18974
+ if (canonicalDdl(String(row["sql"]).replace(/;$/, "")).trim() !== canonicalDdl(V171_SCHEMA.trim().replace(/;$/, "")).trim())
18975
+ return "the interactive agent threads setting table has an unknown shape";
18976
+ return null;
18977
+ }
Binary file
Binary file
Binary file
Binary file
@@ -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.112",
3
+ "version": "0.9.113",
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"