toolroll 0.9.128 → 0.9.129

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 (48) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/accent-colors.js +3 -1
  3. package/dist/approval-authority.js +2 -1
  4. package/dist/assignment.js +55 -2
  5. package/dist/backup.js +6 -0
  6. package/dist/browser/terminal.css +1 -1
  7. package/dist/browser/workspace.css +1 -1
  8. package/dist/central-recovery-stage.js +3 -3
  9. package/dist/companion/access.js +161 -0
  10. package/dist/companion/actions.js +559 -0
  11. package/dist/companion/bonjour.js +45 -0
  12. package/dist/companion/daemon.js +1346 -0
  13. package/dist/companion/direct-server.js +177 -0
  14. package/dist/companion/framing.js +498 -0
  15. package/dist/companion/noise.js +461 -0
  16. package/dist/companion/passkey-gate.js +287 -0
  17. package/dist/companion/paths.js +90 -0
  18. package/dist/companion/reads.js +279 -0
  19. package/dist/companion/relay-auth.js +265 -0
  20. package/dist/companion/relay-server.js +870 -0
  21. package/dist/companion/schema.js +225 -0
  22. package/dist/companion/service.js +580 -0
  23. package/dist/companion/store.js +324 -0
  24. package/dist/companion/webauthn-test-support.js +44 -0
  25. package/dist/companion/webauthn.js +398 -0
  26. package/dist/contracts/console-api.js +18 -0
  27. package/dist/design/kit.css +30 -0
  28. package/dist/local-landing.js +47 -0
  29. package/dist/person-proof.js +5 -1
  30. package/dist/pull-request-flow.js +75 -2
  31. package/dist/qr.js +385 -0
  32. package/dist/release-adapters.js +2 -1
  33. package/dist/restore-retirement.js +2 -0
  34. package/dist/scope.js +67 -4
  35. package/dist/serve.js +31 -4
  36. package/dist/server/pages.js +9 -2
  37. package/dist/server/phone-engine-api.js +59 -0
  38. package/dist/server/route-table.js +11 -0
  39. package/dist/server/settings-phone.js +492 -0
  40. package/dist/server/settings-scripts.js +2 -0
  41. package/dist/server/settings-sections.js +6 -2
  42. package/dist/settings-groups-ui.js +2 -1
  43. package/dist/settings-proofs.js +6 -0
  44. package/dist/store.js +37 -4
  45. package/dist/tailnet.js +42 -0
  46. package/dist/toolroll-update.js +3 -1
  47. package/dist/youiyoux-intake.js +8 -0
  48. package/package.json +7 -2
package/dist/store.js CHANGED
@@ -41,6 +41,7 @@ import { V177_STEPS, V177_SCHEMA, V177_OBJECTS, WORKSPACE_ID_PATTERN, RECOVERY_G
41
41
  import { V174_OBJECTS, V174_SCHEMA, V174_STEPS } from "./flexible-everyday-schema.js";
42
42
  import { V185_OBJECTS, V185_SCHEMA, V185_STEPS } from "./flexible-conversation-schema.js";
43
43
  import { V186_OBJECTS, V186_SCHEMA, V186_STEPS } from "./skill-library-schema.js";
44
+ import { adoptLegacyCompanion, companionPasskeyShapeProblem, companionShapeProblem, V187_STEPS, V188_SCHEMA, V188_STEPS } from "./companion/schema.js";
44
45
  import { endThreadAuthorityFor } from "./flexible-authority-end.js";
45
46
  import { relayCancel } from "./flexible-relay-cancel.js";
46
47
  import { endLapsedFlexible } from "./flexible.js";
@@ -847,7 +848,7 @@ export function checkSuitesOf(value) {
847
848
  }
848
849
  }
849
850
  const REGISTERED_AT_FILING = "again, as it was filed";
850
- export const SCHEMA_VERSION = 186;
851
+ export const SCHEMA_VERSION = 188;
851
852
  export const V179_STEPS = Object.freeze(["antigravity-provider"]);
852
853
  export const V118_MERGED_TABLES = Object.freeze({ api_token: "person", coordinator_credential: "coordinator", lead_credential: "lead" });
853
854
  const V118_REFERENCES = /REFERENCES (?:coordinator_credential\(cid\)|api_token\(id\))/g;
@@ -913,7 +914,7 @@ export const V115_DROPPED_TABLES = Object.freeze([
913
914
  "fallback_config", "fallback_cycle", "fallback_transition",
914
915
  ]);
915
916
  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;
916
- 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, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186]);
917
+ 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, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188]);
917
918
  export const V119_ADDED_COLUMNS = Object.freeze({
918
919
  task_ref: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
919
920
  run: { planning_generation: { definition: "INTEGER NOT NULL DEFAULT 0", saved: "0" } },
@@ -1456,7 +1457,7 @@ export { V156_STEPS };
1456
1457
  export { V157_STEPS };
1457
1458
  export { V158_STEPS };
1458
1459
  export { V159_STEPS };
1459
- 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, V173_STEPS, V174_STEPS, V175_STEPS, V176_STEPS, V177_STEPS, V178_STEPS, V180_STEPS, V181_STEPS, V182_STEPS, V183_STEPS, V184_STEPS, V185_STEPS, V186_STEPS };
1460
+ 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, V173_STEPS, V174_STEPS, V175_STEPS, V176_STEPS, V177_STEPS, V178_STEPS, V180_STEPS, V181_STEPS, V182_STEPS, V183_STEPS, V184_STEPS, V185_STEPS, V186_STEPS, V187_STEPS, V188_STEPS };
1460
1461
  export const RELEASE_ONCE_SCHEMA = `
1461
1462
  CREATE TABLE IF NOT EXISTS release_authority (
1462
1463
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -4245,7 +4246,7 @@ function initializeStore(db, file, options = {}) {
4245
4246
  throw new Error(`${file}: ${problem}; refusing to move chat history it cannot name`);
4246
4247
  }
4247
4248
  if (preflight === SCHEMA_VERSION && !findingSourcesStale(db)) {
4248
- 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) ?? planProblemsShapeProblem(db) ?? flexibleEverydayShapeProblem(db) ?? flexibleInteractiveShapeProblem(db) ?? subagentBackupShapeProblem(db) ?? workspaceIdentityShapeProblem(db) ?? pendingAgentChangeShapeProblem(db) ?? directChatShapeProblem(db) ?? directChatPhase1bShapeProblem(db) ?? directChatHardeningShapeProblem(db) ?? flexibleConversationShapeProblem(db) ?? skillLibraryShapeProblem(db);
4249
+ 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) ?? planProblemsShapeProblem(db) ?? flexibleEverydayShapeProblem(db) ?? flexibleInteractiveShapeProblem(db) ?? subagentBackupShapeProblem(db) ?? workspaceIdentityShapeProblem(db) ?? pendingAgentChangeShapeProblem(db) ?? directChatShapeProblem(db) ?? directChatPhase1bShapeProblem(db) ?? directChatHardeningShapeProblem(db) ?? flexibleConversationShapeProblem(db) ?? skillLibraryShapeProblem(db) ?? companionShapeProblem(db) ?? companionPasskeyShapeProblem(db);
4249
4250
  if (missing !== null)
4250
4251
  throw new Error(`${file}: refusing to open — ${missing}, though the schema says v${SCHEMA_VERSION}`);
4251
4252
  db.exec("PRAGMA journal_mode = WAL; PRAGMA foreign_keys = ON;");
@@ -4740,6 +4741,36 @@ CREATE INDEX IF NOT EXISTS run_checkpoint_by_task ON run_checkpoint (task_ref, i
4740
4741
  if (skillLibraryDamaged !== null)
4741
4742
  throw new Error(`${file}: refusing to open — ${skillLibraryDamaged}`);
4742
4743
  step("skill-library");
4744
+ db.exec("BEGIN IMMEDIATE");
4745
+ try {
4746
+ adoptLegacyCompanion(db, new Date());
4747
+ const companionDamaged = companionShapeProblem(db);
4748
+ if (companionDamaged !== null)
4749
+ throw new Error(`${file}: refusing to open — ${companionDamaged}`);
4750
+ step("companion");
4751
+ db.exec("COMMIT");
4752
+ }
4753
+ catch (error) {
4754
+ db.exec("ROLLBACK");
4755
+ if (error instanceof Error && !error.message.startsWith(`${file}:`) && /unknown shape/.test(error.message))
4756
+ throw new Error(`${file}: refusing to open — ${error.message}`);
4757
+ throw error;
4758
+ }
4759
+ db.exec("BEGIN IMMEDIATE");
4760
+ try {
4761
+ db.exec(V188_SCHEMA);
4762
+ const passkeyDamaged = companionPasskeyShapeProblem(db);
4763
+ if (passkeyDamaged !== null)
4764
+ throw new Error(`${file}: refusing to open — ${passkeyDamaged}`);
4765
+ step("companion-passkey");
4766
+ db.exec("COMMIT");
4767
+ }
4768
+ catch (error) {
4769
+ db.exec("ROLLBACK");
4770
+ if (error instanceof Error && !error.message.startsWith(`${file}:`) && /unknown shape/.test(error.message))
4771
+ throw new Error(`${file}: refusing to open — ${error.message}`);
4772
+ throw error;
4773
+ }
4743
4774
  if (!fresh)
4744
4775
  reclaimDatabase(db, "migration");
4745
4776
  const expectedMarker = preflight < 0 ? preflight : -preflight;
@@ -7273,6 +7304,8 @@ export class Store {
7273
7304
  chat.revokeBinding({ id: Number(row["id"]) }, now, by);
7274
7305
  chat.prepare("UPDATE chat_pair SET consumed = ? WHERE provider = :provider AND approver = ? AND consumed IS NULL").run(stamp, approver);
7275
7306
  }
7307
+ this.db.prepare("UPDATE companion_paired_device SET revoked_at = ?, revoked_reason = ? WHERE account_name = ? AND revoked_at IS NULL")
7308
+ .run(stamp, by === "credential-rotation" ? "password_changed" : "access_changed", approver);
7276
7309
  const subscriptions = this.db
7277
7310
  .prepare("SELECT id FROM push_subscription WHERE approver = ? AND retired_at IS NULL")
7278
7311
  .all(approver)
package/dist/tailnet.js CHANGED
@@ -36,3 +36,45 @@ export async function readTailnetNames(runner = run, platform = process.platform
36
36
  }
37
37
  return [];
38
38
  }
39
+ export function tailnetIpv4Of(statusJson) {
40
+ let status;
41
+ try {
42
+ status = JSON.parse(statusJson);
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ if (typeof status !== "object" || status === null)
48
+ return null;
49
+ const body = status;
50
+ if (body.BackendState !== "Running" || !Array.isArray(body.Self?.TailscaleIPs))
51
+ return null;
52
+ for (const ip of body.Self.TailscaleIPs) {
53
+ if (typeof ip !== "string")
54
+ continue;
55
+ const m = /^100\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(ip);
56
+ if (m !== null && Number(m[1]) >= 64 && Number(m[1]) <= 127 && Number(m[2]) <= 255 && Number(m[3]) <= 255)
57
+ return ip;
58
+ }
59
+ return null;
60
+ }
61
+ export async function readTailnetIpv4(runner = run, platform = process.platform) {
62
+ return (await readTailnetStatus(runner, platform)).ipv4;
63
+ }
64
+ export async function readTailnetStatus(runner = run, platform = process.platform) {
65
+ const candidates = ["tailscale", ...(platform === "darwin" && existsSync(MAC_APP_CLI) ? [MAC_APP_CLI] : [])];
66
+ let found = false;
67
+ for (const file of candidates) {
68
+ try {
69
+ const answer = await runner(file, ["status", "--json"], { timeoutMs: 3_000 });
70
+ if (answer.notFound === true)
71
+ continue;
72
+ found = true;
73
+ if (answer.code === 0)
74
+ return { found, ipv4: tailnetIpv4Of(answer.stdout) };
75
+ }
76
+ catch {
77
+ }
78
+ }
79
+ return { found, ipv4: null };
80
+ }
@@ -329,6 +329,8 @@ const HISTORY_RULES = {
329
329
  ...Object.fromEntries(Object.entries(V117_RENAMED_TABLES).map(([old, now]) => [old, { moved: { into: now, where: "1" } }])),
330
330
  ...Object.fromEntries(V117_RENAMED_COLUMNS.filter(([table]) => !Object.values(V117_RENAMED_TABLES).includes(table)).map(([table, from, to]) => [table, { renamed: { [from]: to } }])),
331
331
  ...Object.fromEntries(Object.entries(V118_MERGED_TABLES).map(([table, kind]) => [table, { moved: { into: "credential", where: `kind = '${kind}'` } }])),
332
+ companion_push_token: { retired: true }, companion_idempotency: { retired: true },
333
+ companion_host_keys: { discarded: ["relay_url"] }, companion_paired_device: { discarded: ["next_device_psk", "psk_version"] },
332
334
  ...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, V173_ADDED_COLUMNS))
333
335
  .map(([table, rule]) => [table, { ...EARLIER_RULES[table], ...rule }])),
334
336
  };
@@ -468,7 +470,7 @@ export function changedHistory(db, before) {
468
470
  return move === undefined || t.moved === undefined || arrived(db, move) - t.moved.found !== t.moved.rows;
469
471
  }
470
472
  const rule = HISTORY_RULES[t.name], present = new Set(tableColumns(db, t.name));
471
- const kept = (c) => present.has(c) || (rule?.renamed?.[c] !== undefined && present.has(rule.renamed[c]));
473
+ const kept = (c) => present.has(c) || (rule?.renamed?.[c] !== undefined && present.has(rule.renamed[c])) || rule?.discarded?.includes(c) === true;
472
474
  if (t.columns.some(c => !kept(c) && (!rule?.dropped?.includes(c) || (t.nonNull?.[c] !== 0 && !accounted(rule, t)))))
473
475
  return true;
474
476
  const columns = t.columns.filter(c => present.has(c));
@@ -159,6 +159,8 @@ function readRequests(dir, taken) {
159
159
  }
160
160
  if (parsed.value.kind === "comment" || parsed.value.status !== "open")
161
161
  continue;
162
+ if (canvasDraft(raw))
163
+ continue;
162
164
  const options = optionsProblem(parsed.value);
163
165
  if (options !== null) {
164
166
  out.invalid.push(`${name}: ${options}`);
@@ -170,6 +172,12 @@ function readRequests(dir, taken) {
170
172
  }
171
173
  return out;
172
174
  }
175
+ function canvasDraft(raw) {
176
+ if (typeof raw !== "object" || raw === null)
177
+ return false;
178
+ const canvas = raw.canvas;
179
+ return typeof canvas === "object" && canvas !== null && canvas.isDraft === true;
180
+ }
173
181
  function line(text, max) {
174
182
  const clean = text.replace(/[\p{Cc}\p{Cf}\u2028\u2029]+/gu, " ").replace(/\s+/g, " ").trim();
175
183
  return clean.length > max ? `${clean.slice(0, max - 1).trimEnd()}…` : clean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolroll",
3
- "version": "0.9.128",
3
+ "version": "0.9.129",
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"
@@ -35,7 +35,12 @@
35
35
  "e2e:app": "npm run build && node scripts/app-e2e.mjs",
36
36
  "e2e:app:parallel": "npm run build && node scripts/e2e-parallel.mjs scripts/app-e2e.mjs",
37
37
  "e2e": "npm run build && node scripts/flows-e2e.mjs && node scripts/app-e2e.mjs",
38
- "e2e:click-paths": "npm run build && node scripts/click-paths-journey.mjs"
38
+ "e2e:click-paths": "npm run build && node scripts/click-paths-journey.mjs",
39
+ "relay:install": "npm ci --prefix relay/cloudflare --no-audit --no-fund",
40
+ "relay:typecheck": "tsc -p relay/cloudflare/tsconfig.json && tsc -p relay/reference/tsconfig.json",
41
+ "relay:test": "vitest run --config relay/vitest.config.ts",
42
+ "relay:smoke": "tsx relay/cloudflare/scripts/smoke.ts",
43
+ "relay:deploy": "node relay/cloudflare/scripts/deploy.mjs"
39
44
  },
40
45
  "repository": {
41
46
  "type": "git",