toolroll 0.9.84 → 0.9.86

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 (132) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +94 -1193
  3. package/dist/agent-fence.d.ts +9 -5
  4. package/dist/agent-fence.js +6 -5
  5. package/dist/agent-onboard.d.ts +2 -0
  6. package/dist/agent-onboard.js +3 -0
  7. package/dist/assignment.js +4 -3
  8. package/dist/browser/workspace.css +1 -1
  9. package/dist/browser/workspace.js +33 -31
  10. package/dist/browser-workspace.d.ts +45 -0
  11. package/dist/chat-actions.d.ts +11 -1
  12. package/dist/chat-actions.js +53 -1
  13. package/dist/chat-channel.d.ts +10 -1
  14. package/dist/chat-channel.js +36 -5
  15. package/dist/chat-decide.d.ts +16 -4
  16. package/dist/chat-decide.js +239 -31
  17. package/dist/chat-messages.d.ts +5 -0
  18. package/dist/chat-messages.js +1 -1
  19. package/dist/chat-quiet.js +6 -4
  20. package/dist/chat-review.d.ts +4 -0
  21. package/dist/chat-review.js +13 -4
  22. package/dist/chat-terms.d.ts +9 -0
  23. package/dist/chat-terms.js +46 -0
  24. package/dist/claim.d.ts +3 -0
  25. package/dist/claim.js +4 -1
  26. package/dist/contracts/chat-actions.d.ts +9 -0
  27. package/dist/contracts/chat-actions.js +3 -0
  28. package/dist/contracts/console-api.d.ts +6 -2
  29. package/dist/contracts/console-api.js +6 -2
  30. package/dist/contracts/flow-propose.d.ts +4 -1
  31. package/dist/contracts/flow-propose.js +1 -1
  32. package/dist/contracts/flow.d.ts +41 -0
  33. package/dist/contracts/flow.js +4 -2
  34. package/dist/contracts/lead-tools.d.ts +51 -0
  35. package/dist/contracts/lead-tools.js +5 -0
  36. package/dist/contracts/store-json.d.ts +2 -0
  37. package/dist/contracts/trigger-payloads.d.ts +20 -0
  38. package/dist/contracts/trigger-payloads.js +4 -0
  39. package/dist/contracts/youiyoux-request.d.ts +248 -0
  40. package/dist/contracts/youiyoux-request.js +152 -0
  41. package/dist/coordinator.js +1 -0
  42. package/dist/deploy-gate.js +4 -0
  43. package/dist/dispatch.d.ts +3 -0
  44. package/dist/dispatch.js +4 -1
  45. package/dist/flow-browser.d.ts +103 -0
  46. package/dist/flow-browser.js +204 -0
  47. package/dist/flow-cadence.d.ts +8 -2
  48. package/dist/flow-cadence.js +16 -3
  49. package/dist/flow-card-task.d.ts +9 -0
  50. package/dist/flow-card-task.js +15 -6
  51. package/dist/flow-code.d.ts +5 -1
  52. package/dist/flow-code.js +4 -1
  53. package/dist/flow-engine.js +16 -0
  54. package/dist/flow-live.js +9 -1
  55. package/dist/flow-pull-request.js +15 -7
  56. package/dist/flow-share.js +3 -1
  57. package/dist/flow-steps.d.ts +9 -1
  58. package/dist/flow-steps.js +55 -5
  59. package/dist/flow-triggers.js +55 -0
  60. package/dist/flows-cli.d.ts +19 -0
  61. package/dist/flows-cli.js +47 -2
  62. package/dist/flows-ui.js +11 -2
  63. package/dist/flows.js +5 -2
  64. package/dist/integrations-ui.js +9 -4
  65. package/dist/integrations.d.ts +9 -1
  66. package/dist/integrations.js +43 -2
  67. package/dist/landed-cleanup.d.ts +4 -0
  68. package/dist/landed-cleanup.js +3 -2
  69. package/dist/lead-capabilities.js +2 -1
  70. package/dist/lead-cli.js +3 -1
  71. package/dist/lead-tools.d.ts +2 -0
  72. package/dist/lead-tools.js +65 -10
  73. package/dist/lead-voice.js +16 -5
  74. package/dist/lead.d.ts +2 -0
  75. package/dist/lead.js +3 -3
  76. package/dist/operate.d.ts +2 -3
  77. package/dist/operate.js +226 -21
  78. package/dist/project-activity.d.ts +20 -0
  79. package/dist/project-activity.js +23 -0
  80. package/dist/project-cli.d.ts +1 -0
  81. package/dist/project-cli.js +36 -19
  82. package/dist/project-delete.js +7 -3
  83. package/dist/project-knowledge.d.ts +3 -3
  84. package/dist/project-outcomes.d.ts +119 -0
  85. package/dist/project-outcomes.js +79 -0
  86. package/dist/pull-request-flow.js +35 -4
  87. package/dist/result-actions.d.ts +4 -0
  88. package/dist/result-actions.js +41 -9
  89. package/dist/result-follow-ups.js +4 -0
  90. package/dist/result-review.d.ts +9 -0
  91. package/dist/result-review.js +45 -5
  92. package/dist/scope.d.ts +5 -0
  93. package/dist/scope.js +7 -0
  94. package/dist/server/chat.js +4 -2
  95. package/dist/server/console.css +41 -0
  96. package/dist/server/flows.js +15 -0
  97. package/dist/server/pages.js +11 -1
  98. package/dist/server/render-chat.js +3 -2
  99. package/dist/server/render-pages.d.ts +15 -2
  100. package/dist/server/render-pages.js +52 -4
  101. package/dist/server/render-results.d.ts +2 -0
  102. package/dist/server/render-results.js +20 -7
  103. package/dist/server/render-tasks.d.ts +9 -0
  104. package/dist/server/render-tasks.js +32 -11
  105. package/dist/server/route-table.js +12 -0
  106. package/dist/server/settings.js +18 -1
  107. package/dist/server/task-views.js +11 -0
  108. package/dist/server/tasks.d.ts +10 -0
  109. package/dist/server/tasks.js +95 -7
  110. package/dist/settings-proofs.js +1 -0
  111. package/dist/store.d.ts +116 -5
  112. package/dist/store.js +385 -24
  113. package/dist/surface.js +18 -2
  114. package/dist/task-archive.d.ts +10 -0
  115. package/dist/task-archive.js +16 -0
  116. package/dist/task-control.d.ts +1 -1
  117. package/dist/task-source.d.ts +13 -1
  118. package/dist/task-source.js +17 -1
  119. package/dist/telegram-lead.js +7 -5
  120. package/dist/telegram.js +1 -1
  121. package/dist/tidy.d.ts +130 -0
  122. package/dist/tidy.js +503 -0
  123. package/dist/toolroll-update.js +2 -2
  124. package/dist/webhooks.d.ts +6 -0
  125. package/dist/webhooks.js +25 -0
  126. package/dist/work-index.d.ts +28 -0
  127. package/dist/work-index.js +82 -28
  128. package/dist/workspace-ui.d.ts +1 -1
  129. package/dist/workspace-ui.js +3 -2
  130. package/dist/youiyoux-intake.d.ts +234 -0
  131. package/dist/youiyoux-intake.js +908 -0
  132. package/package.json +11 -8
@@ -98,8 +98,9 @@ export type FenceGrants = {
98
98
  * SEATBELT_NO_KEYCHAIN). Only fenceFor gives it, to a build's agent. Never a check's (one with sign-ins gets those in
99
99
  * its environment, invoke.ts keychainSignIns), never a tool server's (serverGrantsOf). */
100
100
  keychain?: true;
101
- /** macOS: a project check's launch, whose Chromium may start (sandbox-runtime.ts SEATBELT_CHROMIUM). Only fenceFor
102
- * sets it, only for kind "check". */
101
+ /** macOS: a project check's launch, or a flow script zone's with approved browser use, whose Chromium may start
102
+ * (sandbox-runtime.ts SEATBELT_CHROMIUM). Only fenceFor sets it: always for kind "check", for kind "flow" only when
103
+ * its caller proved the approval (flow-browser.ts). */
103
104
  browser?: true;
104
105
  /** A `sign-ins` check's exact sign-in files, read again inside the home denies (check-access.ts, signInGrants). */
105
106
  signIns?: SignInGrants;
@@ -309,15 +310,15 @@ export declare function sandboxedSpawn(file: string, args: readonly string[], fe
309
310
  env: Record<string, string>;
310
311
  };
311
312
  /**
312
- * What each agent's fence gives it, by permission mode: the one table README's "What an agent can reach" shows
313
- * (fenceSummaryMarkdown; a test holds them equal).
313
+ * What each agent's fence gives it, by permission mode: the one table "What an agent can reach" in
314
+ * docs/guide/security.md shows (fenceSummaryMarkdown; a test holds them equal).
314
315
  */
315
316
  export declare const FENCE_SUMMARY: readonly {
316
317
  agent: string;
317
318
  auto: string;
318
319
  full: string;
319
320
  }[];
320
- /** FENCE_SUMMARY as README's markdown table. */
321
+ /** FENCE_SUMMARY as the security guide's markdown table. */
321
322
  export declare function fenceSummaryMarkdown(): string;
322
323
  /** What a `sign-ins` check reads and writes beyond its fence (check-access.ts): its exact sign-in files, its own Claude
323
324
  * transcript folder (macOS) and Codex's session and log folders. */
@@ -391,6 +392,9 @@ export type FenceContext = {
391
392
  provider?: string;
392
393
  /** Scratch folders (a flow's) that stay denied whole inside the pool, whatever the policy. */
393
394
  scratchRoots?: readonly string[];
395
+ /** A flow's script zone whose browser use a person approved, proved at launch (flow-browser.ts browserStanding):
396
+ * Chromium's one service, as a check gets it. Read for kind "flow" only; every other kind ignores it. */
397
+ browser?: true;
394
398
  };
395
399
  /** A launch's sealed sandbox terms (builder.ts launchSandboxOf): its policy version, read denies and mach services. A
396
400
  * launch with none sealed is v1 with none of them. */
@@ -1075,8 +1075,8 @@ export function sandboxedSpawn(file, args, fence, grants = NO_GRANTS, cwd, temp)
1075
1075
  return srtSpawn(file, args, srtTermsOf(fence, grants), cwd ?? process.cwd(), temp);
1076
1076
  }
1077
1077
  /**
1078
- * What each agent's fence gives it, by permission mode: the one table README's "What an agent can reach" shows
1079
- * (fenceSummaryMarkdown; a test holds them equal).
1078
+ * What each agent's fence gives it, by permission mode: the one table "What an agent can reach" in
1079
+ * docs/guide/security.md shows (fenceSummaryMarkdown; a test holds them equal).
1080
1080
  */
1081
1081
  export const FENCE_SUMMARY = [
1082
1082
  {
@@ -1090,7 +1090,7 @@ export const FENCE_SUMMARY = [
1090
1090
  full: "the same reads and writes, with the fence; its commands reach the network only when the project's network is open",
1091
1091
  },
1092
1092
  ];
1093
- /** FENCE_SUMMARY as README's markdown table. */
1093
+ /** FENCE_SUMMARY as the security guide's markdown table. */
1094
1094
  export function fenceSummaryMarkdown() {
1095
1095
  return ["| | Auto | Full access |", "|---|---|---|", ...FENCE_SUMMARY.map(row => `| ${row.agent} | ${row.auto} | ${row.full} |`)].join("\n");
1096
1096
  }
@@ -1167,8 +1167,9 @@ export function fenceFor(kind, ctx) {
1167
1167
  ...(written === null ? {} : { writes: written.writes, readOnly: [...new Set([...made.readOnly, ...written.readOnly])].sort() }),
1168
1168
  ...(ctx.network === undefined ? {} : { network: ctx.network }),
1169
1169
  ...(ctx.machLookup === undefined || ctx.machLookup.length === 0 ? {} : { machLookup: [...ctx.machLookup] }),
1170
- // A project's checks may drive a browser (Playwright's Chromium); builds, flows and tool servers don't get it.
1171
- ...(kind === "check" ? { browser: true } : {}),
1170
+ // A project's checks may drive a browser (Playwright's Chromium), and so may a flow's script zone whose browser use
1171
+ // a person approved (the caller proves it at launch); builds, tool servers and every other flow launch don't get it.
1172
+ ...(kind === "check" || (kind === "flow" && ctx.browser === true) ? { browser: true } : {}),
1172
1173
  // A build's agent signs in from the keychain (Claude Code does); nothing else it launches reaches it.
1173
1174
  ...(kind === "build" ? { keychain: true } : {}),
1174
1175
  // Under a write allowlist these are out of reach already; where the launch writes anywhere, they are denied by name.
@@ -125,6 +125,8 @@ export type OnboardIo = {
125
125
  /** Whether the project can open pull requests at Complete, in one line: on, the one command that turns it on, or
126
126
  * what to fix first. Turning it on stays a person's password step. */
127
127
  pullRequests?: (repo: string) => Promise<string>;
128
+ /** For a project that uses youiyoux, the one line that says its change requests become tasks; null otherwise. */
129
+ youiyoux?: (repo: string) => Promise<string | null>;
128
130
  /** --starter, as typed: a comma list of starter flow ids to switch on. */
129
131
  starterFlag?: string | undefined;
130
132
  /** The project's starter flows, and switching one on — its trigger and zones. */
@@ -381,6 +381,7 @@ export async function runOnboard(io) {
381
381
  const mcp = agents.map(agent => ({ agent, command: mcpLine(agent) }));
382
382
  const projectData = project.state === "added" || project.state === "already" ? { path: project.path, added: project.state === "added" } : null;
383
383
  const pullRequests = projectData === null || io.pullRequests === undefined ? null : await io.pullRequests(projectData.path);
384
+ const youiyoux = projectData === null || io.youiyoux === undefined ? null : await io.youiyoux(projectData.path);
384
385
  const offered = projectData === null ? [] : await offerStarters(io, projectData.path);
385
386
  if (!Array.isArray(offered))
386
387
  return refuse("usage", offered.usage, 2);
@@ -401,6 +402,7 @@ export async function runOnboard(io) {
401
402
  project: projectData,
402
403
  ...(projectProblem === null ? {} : { projectProblem }),
403
404
  ...(pullRequests === null ? {} : { pullRequests }),
405
+ ...(youiyoux === null ? {} : { youiyoux }),
404
406
  ...(offered.length === 0 ? {} : { starters: offered.map(one => ({ ...one, ...(one.state === "off" ? { command: `toolroll onboard --starter ${one.id}` } : {}) })) }),
405
407
  agents: reports,
406
408
  skill: skillData,
@@ -415,6 +417,7 @@ export async function runOnboard(io) {
415
417
  io.write([
416
418
  projectLine,
417
419
  ...(pullRequests === null ? [] : [`pull requests ${pullRequests}`]),
420
+ ...(youiyoux === null ? [] : [`youiyoux ${youiyoux}`]),
418
421
  ...starterLines(offered),
419
422
  `agents ${reports.map(one => `${one.name}: ${[one.words, one.plan].filter(Boolean).join(" · ")}`).join("; ")}`,
420
423
  skillLine(),
@@ -6,7 +6,7 @@ import { currentActor, withActor } from "./actor.js";
6
6
  import { replacedWords } from "./task-status.js";
7
7
  import { COMPLETER_ACTOR, COMPLETION_ACTION, COMPLETION_BY_MACHINE, COMPLETION_BY_PERSON, familyChangedFiles, landedReasonOf, personCompletionOwed } from "./result-completion.js";
8
8
  import { homedir } from "node:os";
9
- import { readSchemaVersion, stopFactOf } from "./store.js";
9
+ import { readSchemaVersion, refArchived, stopFactOf } from "./store.js";
10
10
  import { approvalOf, liveReleaseOf, machineActing } from "./scope.js";
11
11
  import { openWorkDecisionOf, taskWorkSummaryOf, workDecisionAction } from "./work-summary.js";
12
12
  import { evidenceRoot, readVerifiedArtifact, readVerifiedReport, verifyArtifact } from "./evidence.js";
@@ -170,14 +170,15 @@ export function assignmentOf(store, taskId, now, access, root, memo) {
170
170
  const attention = family.problem === null ? [] : [family.problem];
171
171
  // Family admission above precedes question bodies. The newest result
172
172
  // does not settle an unanswered question on any earlier version.
173
- const questions = [current, ...family.versions.filter(version => version.id !== current.id)].flatMap(version => {
173
+ // A put-away earlier version (v145) is history: its question and its queue place never hold the current one up.
174
+ const questions = [current, ...family.versions.filter(version => version.id !== current.id && !refArchived(store, version.refId))].flatMap(version => {
174
175
  const decision = openWorkDecisionOf(store, version.refId, now);
175
176
  return decision === null ? [] : [{ taskId: version.id, decision }];
176
177
  });
177
178
  // A finished task label cannot hide a lease or an unfinished process record.
178
179
  const busy = (version) => version.state === "running" || store.currentLiveLease(version.refId, now) !== null ||
179
180
  store.runsFor(version.refId).some(run => run.outcome === null || store.stopQuiescenceProblem(run.id) !== null);
180
- const earlierActive = family.versions.filter(version => version.id !== current.id && (version.state === "queued" || busy(version)));
181
+ const earlierActive = family.versions.filter(version => version.id !== current.id && ((version.state === "queued" && !refArchived(store, version.refId)) || busy(version)));
181
182
  // Of those, how many have work under way (the rest only wait in the queue).
182
183
  const earlierRunning = earlierActive.filter(busy).length;
183
184
  const unfinished = store.runsFor(current.refId).find(run => run.outcome === null) ?? null;