@farmslot/protocol 0.74.9 → 0.75.0

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 (170) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/agents/roles.d.ts +2 -0
  3. package/dist/agents/roles.d.ts.map +1 -1
  4. package/dist/agents/roles.js +8 -1
  5. package/dist/agents/roles.js.map +1 -1
  6. package/dist/client-cache/artifact-response.d.ts +15 -0
  7. package/dist/client-cache/artifact-response.d.ts.map +1 -0
  8. package/dist/client-cache/artifact-response.js +103 -0
  9. package/dist/client-cache/artifact-response.js.map +1 -0
  10. package/dist/client-cache/cache.d.ts +6 -1
  11. package/dist/client-cache/cache.d.ts.map +1 -1
  12. package/dist/client-cache/cache.js +207 -33
  13. package/dist/client-cache/cache.js.map +1 -1
  14. package/dist/client-cache/command-method.d.ts +17 -4
  15. package/dist/client-cache/command-method.d.ts.map +1 -1
  16. package/dist/client-cache/command-method.js +221 -1
  17. package/dist/client-cache/command-method.js.map +1 -1
  18. package/dist/client-cache/conformance.d.ts +2 -5
  19. package/dist/client-cache/conformance.d.ts.map +1 -1
  20. package/dist/client-cache/conformance.js +4 -0
  21. package/dist/client-cache/conformance.js.map +1 -1
  22. package/dist/client-cache/content.d.ts +11 -0
  23. package/dist/client-cache/content.d.ts.map +1 -1
  24. package/dist/client-cache/content.js +43 -0
  25. package/dist/client-cache/content.js.map +1 -1
  26. package/dist/client-cache/index.d.ts +5 -2
  27. package/dist/client-cache/index.d.ts.map +1 -1
  28. package/dist/client-cache/index.js +5 -2
  29. package/dist/client-cache/index.js.map +1 -1
  30. package/dist/client-cache/native-history.d.ts +22 -1
  31. package/dist/client-cache/native-history.d.ts.map +1 -1
  32. package/dist/client-cache/native-history.js +59 -4
  33. package/dist/client-cache/native-history.js.map +1 -1
  34. package/dist/client-cache/network-cost.d.ts +4 -0
  35. package/dist/client-cache/network-cost.d.ts.map +1 -0
  36. package/dist/client-cache/network-cost.js +24 -0
  37. package/dist/client-cache/network-cost.js.map +1 -0
  38. package/dist/client-cache/prefetch.d.ts +17 -0
  39. package/dist/client-cache/prefetch.d.ts.map +1 -1
  40. package/dist/client-cache/prefetch.js +110 -47
  41. package/dist/client-cache/prefetch.js.map +1 -1
  42. package/dist/client-cache/read-stored.d.ts +7 -0
  43. package/dist/client-cache/read-stored.d.ts.map +1 -0
  44. package/dist/client-cache/read-stored.js +18 -0
  45. package/dist/client-cache/read-stored.js.map +1 -0
  46. package/dist/client-cache/registry.d.ts +309 -16
  47. package/dist/client-cache/registry.d.ts.map +1 -1
  48. package/dist/client-cache/registry.js +422 -27
  49. package/dist/client-cache/registry.js.map +1 -1
  50. package/dist/client-cache/run-details.d.ts +29 -0
  51. package/dist/client-cache/run-details.d.ts.map +1 -0
  52. package/dist/client-cache/run-details.js +145 -0
  53. package/dist/client-cache/run-details.js.map +1 -0
  54. package/dist/client-cache/run-list-versions.d.ts +2 -0
  55. package/dist/client-cache/run-list-versions.d.ts.map +1 -1
  56. package/dist/client-cache/run-list-versions.js +9 -0
  57. package/dist/client-cache/run-list-versions.js.map +1 -1
  58. package/dist/client-cache/store.d.ts +6 -0
  59. package/dist/client-cache/store.d.ts.map +1 -1
  60. package/dist/client-cache/store.js +25 -0
  61. package/dist/client-cache/store.js.map +1 -1
  62. package/dist/client-cache/transport.d.ts +8 -1
  63. package/dist/client-cache/transport.d.ts.map +1 -1
  64. package/dist/client-cache/transport.js +8 -0
  65. package/dist/client-cache/transport.js.map +1 -1
  66. package/dist/client-cache/types.d.ts +11 -1
  67. package/dist/client-cache/types.d.ts.map +1 -1
  68. package/dist/contracts/agents.d.ts +2 -0
  69. package/dist/contracts/agents.d.ts.map +1 -1
  70. package/dist/contracts/agents.js.map +1 -1
  71. package/dist/contracts/config.d.ts +10 -0
  72. package/dist/contracts/config.d.ts.map +1 -1
  73. package/dist/contracts/config.js +7 -0
  74. package/dist/contracts/config.js.map +1 -1
  75. package/dist/contracts/dispatch.d.ts +18 -0
  76. package/dist/contracts/dispatch.d.ts.map +1 -1
  77. package/dist/contracts/run-lifecycle-view.d.ts +9 -0
  78. package/dist/contracts/run-lifecycle-view.d.ts.map +1 -1
  79. package/dist/contracts/run-lifecycle-view.js +8 -0
  80. package/dist/contracts/run-lifecycle-view.js.map +1 -1
  81. package/dist/contracts/runs.d.ts +76 -7
  82. package/dist/contracts/runs.d.ts.map +1 -1
  83. package/dist/contracts/runs.js +33 -2
  84. package/dist/contracts/runs.js.map +1 -1
  85. package/dist/contracts/slot-recovery.d.ts +11 -0
  86. package/dist/contracts/slot-recovery.d.ts.map +1 -1
  87. package/dist/contracts/slot-recovery.js +11 -1
  88. package/dist/contracts/slot-recovery.js.map +1 -1
  89. package/dist/contracts/slots.d.ts +17 -0
  90. package/dist/contracts/slots.d.ts.map +1 -1
  91. package/dist/index.d.ts +5 -0
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +5 -0
  94. package/dist/index.js.map +1 -1
  95. package/dist/markdown-fence.d.ts +6 -0
  96. package/dist/markdown-fence.d.ts.map +1 -0
  97. package/dist/markdown-fence.js +12 -0
  98. package/dist/markdown-fence.js.map +1 -0
  99. package/dist/recipe/recording.d.ts +1 -1
  100. package/dist/recipe/recording.d.ts.map +1 -1
  101. package/dist/recipe/recording.js +2 -2
  102. package/dist/recipe/recording.js.map +1 -1
  103. package/dist/rpc/auth.d.ts +5 -2
  104. package/dist/rpc/auth.d.ts.map +1 -1
  105. package/dist/rpc/auth.js.map +1 -1
  106. package/dist/rpc/dispatch.d.ts +8 -0
  107. package/dist/rpc/dispatch.d.ts.map +1 -1
  108. package/dist/rpc/dispatch.js +8 -0
  109. package/dist/rpc/dispatch.js.map +1 -1
  110. package/dist/rpc/fleet.d.ts +3 -1
  111. package/dist/rpc/fleet.d.ts.map +1 -1
  112. package/dist/rpc/fleet.js.map +1 -1
  113. package/dist/rpc/index.d.ts +1 -0
  114. package/dist/rpc/index.d.ts.map +1 -1
  115. package/dist/rpc/index.js +1 -0
  116. package/dist/rpc/index.js.map +1 -1
  117. package/dist/rpc/native-session.d.ts +11 -0
  118. package/dist/rpc/native-session.d.ts.map +1 -1
  119. package/dist/rpc/native-session.js +9 -0
  120. package/dist/rpc/native-session.js.map +1 -1
  121. package/dist/rpc/nodes.d.ts +2 -0
  122. package/dist/rpc/nodes.d.ts.map +1 -1
  123. package/dist/rpc/nodes.js.map +1 -1
  124. package/dist/rpc/run.d.ts +4 -0
  125. package/dist/rpc/run.d.ts.map +1 -1
  126. package/dist/rpc/run.js.map +1 -1
  127. package/dist/rpc/runner-models.d.ts +14 -3
  128. package/dist/rpc/runner-models.d.ts.map +1 -1
  129. package/dist/rpc/runner-models.js +37 -13
  130. package/dist/rpc/runner-models.js.map +1 -1
  131. package/dist/rpc/slot.d.ts +3 -2
  132. package/dist/rpc/slot.d.ts.map +1 -1
  133. package/dist/rpc/slot.js.map +1 -1
  134. package/dist/rpc/terminal-input-record.d.ts +20 -0
  135. package/dist/rpc/terminal-input-record.d.ts.map +1 -0
  136. package/dist/rpc/terminal-input-record.js +42 -0
  137. package/dist/rpc/terminal-input-record.js.map +1 -0
  138. package/dist/rpc/terminal.d.ts +1 -1
  139. package/dist/rpc/terminal.d.ts.map +1 -1
  140. package/dist/runs/list-trim.d.ts +13 -0
  141. package/dist/runs/list-trim.d.ts.map +1 -0
  142. package/dist/runs/list-trim.js +71 -0
  143. package/dist/runs/list-trim.js.map +1 -0
  144. package/dist/runs/list-version.d.ts +4 -0
  145. package/dist/runs/list-version.d.ts.map +1 -0
  146. package/dist/runs/list-version.js +9 -0
  147. package/dist/runs/list-version.js.map +1 -0
  148. package/dist/runs/review-chain.d.ts.map +1 -1
  149. package/dist/runs/review-chain.js +2 -1
  150. package/dist/runs/review-chain.js.map +1 -1
  151. package/dist/runs/run-engine-label.d.ts +40 -0
  152. package/dist/runs/run-engine-label.d.ts.map +1 -0
  153. package/dist/runs/run-engine-label.js +27 -0
  154. package/dist/runs/run-engine-label.js.map +1 -0
  155. package/dist/runs/run-family-groups.d.ts.map +1 -1
  156. package/dist/runs/run-family-groups.js +5 -4
  157. package/dist/runs/run-family-groups.js.map +1 -1
  158. package/dist/runs/run-list-view.d.ts.map +1 -1
  159. package/dist/runs/run-list-view.js +2 -1
  160. package/dist/runs/run-list-view.js.map +1 -1
  161. package/dist/slots/tracking-branch.d.ts +7 -0
  162. package/dist/slots/tracking-branch.d.ts.map +1 -1
  163. package/dist/slots/tracking-branch.js.map +1 -1
  164. package/dist/text-order.d.ts +7 -0
  165. package/dist/text-order.d.ts.map +1 -0
  166. package/dist/text-order.js +7 -0
  167. package/dist/text-order.js.map +1 -0
  168. package/dist/version.d.ts +1 -1
  169. package/dist/version.js +1 -1
  170. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,45 @@ All notable changes to `@farmslot/protocol` are tracked here.
6
6
 
7
7
  - Active-development baseline; add user-facing changes here before release or package publication.
8
8
 
9
+ ## 0.75.0 - 2026-11-03
10
+
11
+ - `SlotReleaseParams.skipArtifacts` is removed: a slot release no longer copies artifacts, so there is nothing to skip (F313).
12
+ - `SlotStatus.retained` (`{ items, bytes }`): the nested checkouts that slot releases moved aside on the slot host instead of deleting them, and their total size there (F310).
13
+ - `ReadyGatePayload.mergeConflicts`/`behindMain` are probed against the publication base (a stacked run's upstream branch), and a conflict on a publication gate now blocks its advancing actions (doc only; no shape change).
14
+ - A client-cache observer that throws no longer stops the other observers or the cache's reads; each failing observer is logged once with `console.error`. Before, an observer that threw as a read started, or on its first delivery from `observe`, left that query loading with no request sent until the next reconnect.
15
+ - `DispatchPreview.inheritedAcceptance`: the parent run and its original criteria a pr-complete run is held to, or `unavailable` with the reason.
16
+ - `Run.parkedCommits` (`ParkedRunCommits[]`): an artifact-only run's own branch commits, parked under `refs/farmslot/parked/<run>/<head>` when its slot returned to idle (append-only).
17
+ - `Run.releasedCheckout`: the branch and head an artifact-only run left on its slot when COMPLETE released the slot's ownership; a later ownerless return to idle parks only that head.
18
+ - `RunEngineState.publishGate.refusedEvidencePackageId`: the prepared package a human-gate replay found the worker's evidence refused against; while it is still `packageId`, the gate rebuilds rather than reuses it.
19
+ - `RunPipelineReviewPolicy` (`'default' | 'none'`) on `Run`, `RunCreateParams` and `DispatchPreviewParams` (with `completionPolicy`), `DispatchPreview.pipelineReview`, and the shared `pipelineReviewOffReason` / `pipelineReviewPolicyError` rule. Only an artifact-only dev or fix-bug run may turn its pipeline review off, and not alongside `reviewSequence`, `reviewPolicy` or an eval experiment; an unknown value is refused.
20
+ - `compareText` orders strings as `localeCompare` does, through one shared `Intl.Collator`. Run lists and family groups sort with it.
21
+ - Content prefetch hashes files and artifacts in 16 KB slices, one per macrotask, so a large file no longer blocks a frame; content a person opens still verifies at once.
22
+ - Change notifications match queries by dependency ids computed when the query is first observed.
23
+ - `ContentPrefetchOptions.media` (`ContentPrefetchMedia`, `ContentPrefetchMediaEntry`): a pending gate's videos and images over the content row cap go to a client media holder by digest, with the gate's age, instead of loading only when opened. `base64Bytes` and `createSha256` (chunked SHA-256) are exported from the client cache.
24
+ - A gate or run whose first `run.get` fails (a timeout on a busy gateway, not a refusal), or a gate whose package does not fully load, is prefetched again after 5 s, 30 s, then every 2 minutes until a read succeeds or the run leaves the targets. Before, nothing read it again until the gateway connection changed, so a pending gate's evidence, videos included, never reached the device. A gate whose review diff cannot be read still hands its videos and large images to the media holder.
25
+ - `awaitsHumanDecision(run)` is exported: a run at its human gate (also while a review it requested is still running and its ready decision is already resolved) or blocked at an open one, the runs the review queues show as waiting on a decision. Prefetch treats such a run as a gate and keeps prefetching its current package after its ready decision is resolved.
26
+ - `CommandMethod` is now the closed `GATEWAY_COMMAND_METHODS` list, and `GATEWAY_READ_EXCEPTIONS` names the only reads a client sends outside the shared cache (ADR-071 Amendment 2: offline-first reads).
27
+ - New `AppBindingMismatchPayload` (`kind: 'app_binding_mismatch'`) in `RunDecisionPayload`: the slot, the run's app, the slot's app and its source, and the project's slots bound to the run's app when they could be listed, and `operatorPick` when the slot came from a slot picker (F306).
28
+ - New `projectDefaultApp(project)`: `recipe.app`, else the project's only declared app.
29
+ - `PoolConfig` slots may carry `app`.
30
+ - Record the question-tool setting of native worker processes and terminal worker contexts so retained task handoffs can resume or relaunch when it changes.
31
+ - `trimRunForList`, `trimDecisionForList` and `RUN_LIST_PAYLOAD_VALUE_LIMIT` move here from the gateway (`runs/list-trim`), beside the new `runHasTrimmedDetail(run)`, moved from Command Center: whether a run.list row left out its output manifest or any decision payload value, which a view shows as not loaded until `run.get` lands. One module now holds what run.list leaves out and how a client tells.
32
+ - `readRefused(error)` (client-cache): whether a read error is a gateway refusal (`RUN_NOT_FOUND`, `NOT_FOUND`, `RESOURCE_NOT_FOUND`, `AUTH_REQUIRED`, `AUTH_FORBIDDEN`), the same codes on which the cache evicts saved data. A network failure or timeout is not one.
33
+ - `currentReviewChainEntry` reports `unresolvedCount: null` when the review result's `lineComments` is missing, as on a run.list row that trimmed it, instead of throwing.
34
+ - `slotRecoveryEligibility` treats a clean ownerless checkout with unpushed commits as safe for bulk release with no confirmation, because the release parks those commits. New `parksSlotCommits`, `SlotParkedCommits` and `slotParkedDetail`. `SlotRefreshResult` and `FleetRefreshSlotUpdateEvent` gain an optional `parked` report.
35
+ - `FleetStatus.poolErrors` lists pool files the last fleet refresh could not parse, and `SlotStatus.configError` gives why a slot's config could not be loaded.
36
+ - Recording timelines accept equal adjacent presentation timestamps without dropping decoded frames; backwards, invalid and out-of-duration timestamps remain invalid.
37
+ - Template previews and options on Dispatch accept an execution template id of the form `<flow>/<name>` (for example `pr-complete/default`). Before, every preview failed with "Invalid configuration selector: executionTemplateId". Command Center checks the selector before sending, and the gateway checks it again on marked reads, so both must run this version. The id still refuses `\`, empty segments, and `.` or `..` segments, and other configuration selectors stay single segments (F319).
38
+ - `isPickerCatalogModel` and `runnerModelProviderLabel` hold the one rule for which node catalog models a picker shows: LiteLLM ("Consensys LiteLLM"), xAI, Anthropic and local omlx/lmstudio models, without Claude 4.x or older or Grok before 4.7. `RunnerCatalogModel.nodes` names the execution nodes that list a model when some node does not. Pi and OpenCode have no `RUNNER_PICKER_MODELS` seed any more, `PI_ANTHROPIC_MODELS` is removed, and `DEFAULT_PI_MODEL` and `DEFAULT_GROK_MODEL` are `grok-4.7`. `NativeRunnerOption.nodeModels` holds each execution node's models for Pi and OpenCode, and `nativeRunnerModels(option, executionNodeId)` picks the list for a session's node. `DispatchCandidatesParams` takes the chosen `runner` and `model`.
39
+ - Keep bounded Dispatch candidate and ticket-match snapshots in the shared client store, with candidate invalidation when fleet, run, configuration or model catalogs change.
40
+
41
+ ## 0.74.10 - 2026-11-01
42
+
43
+ - `runWorkerEffort` names a run's worker effort (the worker context, then its native session, the dispatch effort, then the execution-profile choice for its runner and model), and `runEngineLabel` formats `runner/model · effort` with the effort only when known.
44
+ - `nativeImplementableKey` picks the proposed plan a client can offer Implement on (the latest turn of an idle, standalone plan-mode session ended with it, nothing pending); `nativeImplementSession` gives the new default-mode session's create parameters (the planning session's node, runner, model, effort, profile and directory) and `nativeImplementPrompt` its first message (ADR-057 Amendment 9).
45
+ - `markdownFence(content, info?)` fences text as a Markdown code block that it cannot close early, and `nativeTailLines(lines, max)` keeps the last lines after a "… N earlier lines" line; the command card, recipe-cli artifacts, publication receipts and Command Center's terminal context share them.
46
+ - `GatewayAuthConnectResult.capabilities.terminalInputSequence.durable` says panes keep the typed-input record across gateway restarts; otherwise `instance` names the process that has it. `NodeInfo.terminalInputSequence` marks a node whose `tmux.send` takes `seq`. The pane record helpers (`terminalInputRecordOption`, `parseTerminalInputRecord`, `staleTerminalInputRecords`, `isTerminalInputStream`) define the `@farmslot-input-<stream>` tmux pane option both write.
47
+
9
48
  ## 0.74.9 - 2026-11-01
10
49
 
11
50
  - `turn.changes` (`NativeTurnChanges`, `NativeTurnFile`) lists the files a native turn changed in its Git working tree, with line counts, between the host's checkpoints before and after it (`from`, `to`), or why they are `unavailable`. `native.session.turn.diff` (`NativeSessionTurnDiffParams`, `NativeSessionTurnDiffResult`) returns one listed file's diff between those checkpoints. The client-cache timeline has a `changes` entry (none for a turn that changed nothing) with `nativeTurnChangesText` ("Changed 3 files · +12 −4"), and the history projection is bumped so cached histories are read again once (ADR-057 Amendment 9).
@@ -21,6 +21,8 @@ export declare const PRIMARY_WORKER_WINDOW = "worker";
21
21
  export declare function agentDispatchWindow(role: AgentRole): string | null;
22
22
  export declare const AGENT_ROLE_RANKS: Record<AgentRole, number>;
23
23
  export declare function primaryRoleForFlow(flowType?: FlowType | string | null): AgentRole;
24
+ /** The worker role of a flow, or null for a flow type this build doesn't know. */
25
+ export declare function workerRoleForFlow(flowType?: FlowType | string | null): AgentRole | null;
24
26
  export declare function contextIdFor(role: AgentRole): string;
25
27
  export declare function agentRoleLabel(role: AgentRole): string;
26
28
  export declare function agentRoleShortLabel(role: AgentRole): string;
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,wEAEpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAQvD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAQ7D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQ/D,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAGlE;AAKD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,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;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAGlE;AAKD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAQtD,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAIjF;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAUvF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEtD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CASrD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAazE;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,GAAG,IAAI,CAEf"}
@@ -60,6 +60,13 @@ export const AGENT_ROLE_RANKS = {
60
60
  subtask: 40,
61
61
  };
62
62
  export function primaryRoleForFlow(flowType) {
63
+ const role = workerRoleForFlow(flowType);
64
+ if (role)
65
+ return role;
66
+ throw new Error(`primaryRoleForFlow: unknown flow type '${flowType}'`);
67
+ }
68
+ /** The worker role of a flow, or null for a flow type this build doesn't know. */
69
+ export function workerRoleForFlow(flowType) {
63
70
  if (flowType === 'dev')
64
71
  return 'dev';
65
72
  if (flowType === 'fix-bug')
@@ -71,7 +78,7 @@ export function primaryRoleForFlow(flowType) {
71
78
  // chained run directly to its parent's flow-owned window.
72
79
  if (!flowType || flowType === 'qa' || flowType === 'pr-complete' || flowType === 'update-branch')
73
80
  return 'primary';
74
- throw new Error(`primaryRoleForFlow: unknown flow type '${flowType}'`);
81
+ return null;
75
82
  }
76
83
  export function contextIdFor(role) {
77
84
  return role;
@@ -1 +1 @@
1
- {"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/agents/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiC,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC,MAAM,CACxD,CAAC,IAAI,EAAyC,EAAE,CAAC,IAAI,KAAK,SAAS,CACpE,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,YAAY;IAC1B,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,UAAU;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,OAAO;IACrB,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAqC;IAClE,OAAO,EAAE,IAAI;IACb,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,IAAI,EAAE,0DAA0D;IAC9E,QAAQ,EAAE,QAAQ;IAClB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,UAAU,oBAAoB,CAClC,QAAwB,EACxB,cAA8B;IAE9B,OAAO,mBAAmB,CAAC,QAAQ,CAAC,IAAI,mBAAmB,CAAC,cAAc,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAwB;IACnD,MAAM,SAAS,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnC,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrF,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { GatewayResourceCache } from './types.js';
2
+ export interface StoredArtifactRead {
3
+ current(): GatewayResourceCache | undefined;
4
+ url: string;
5
+ online: boolean;
6
+ read(): Promise<Response>;
7
+ signal?: AbortSignal;
8
+ /** Explicit reloads wait for fresh bytes; ordinary display opens saved bytes immediately. */
9
+ refresh?: boolean;
10
+ onStored?(response: Response): unknown;
11
+ onRefreshError?(error: unknown | undefined): void;
12
+ }
13
+ /** Retained text uses the same verified, bounded content store as images and files. */
14
+ export declare function readStoredArtifactResponse({ current, url, online, read, signal, refresh, onRefreshError, onStored, }: StoredArtifactRead): Promise<Response>;
15
+ //# sourceMappingURL=artifact-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-response.d.ts","sourceRoot":"","sources":["../../src/client-cache/artifact-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,OAAO,IAAI,oBAAoB,GAAG,SAAS,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IACvC,cAAc,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;CACnD;AAeD,uFAAuF;AACvF,wBAAsB,0BAA0B,CAAC,EAC/C,OAAO,EACP,GAAG,EACH,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAe,EACf,cAAc,EACd,QAAQ,GACT,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsFxC"}
@@ -0,0 +1,103 @@
1
+ import { createSha256, RESOURCE_CONTENT_LIMITS } from './content.js';
2
+ function textResponse(data, init) {
3
+ const response = new Response(data.slice().buffer, init);
4
+ // React Native's Response polyfill decodes ArrayBuffers one byte per character.
5
+ Object.defineProperty(response, 'text', { value: async () => new TextDecoder().decode(data) });
6
+ return response;
7
+ }
8
+ function digest(data) {
9
+ const hash = createSha256();
10
+ hash.update(data);
11
+ return hash.hex();
12
+ }
13
+ /** Retained text uses the same verified, bounded content store as images and files. */
14
+ export async function readStoredArtifactResponse({ current, url, online, read, signal, refresh = false, onRefreshError, onStored, }) {
15
+ const cache = current();
16
+ if (!cache)
17
+ throw new Error('The offline store is not open yet');
18
+ const source = new URL(url, 'https://artifact.invalid');
19
+ if (source.pathname !== '/api/run-artifact')
20
+ throw new Error('Expected a retained artifact URL');
21
+ refresh ||= source.searchParams.has('m');
22
+ // Mirror refresh is an explicit reread, not part of the retained file's identity.
23
+ for (const name of ['token', 'password', 'm'])
24
+ source.searchParams.delete(name);
25
+ source.hash = '';
26
+ source.searchParams.sort();
27
+ // No URL, query credential or document body is written into an alias.
28
+ const alias = `artifact-response:${digest(new TextEncoder().encode(source.href))}`;
29
+ const token = cache.contentWriteToken();
30
+ const assertCurrent = () => {
31
+ if (signal?.aborted)
32
+ throw Object.assign(new Error('Artifact read aborted'), { name: 'AbortError' });
33
+ if (cache !== current() || cache.contentWriteToken().ownerVersion !== token.ownerVersion)
34
+ throw new Error('The artifact source changed');
35
+ };
36
+ assertCurrent();
37
+ const held = await cache.openContentByAlias(alias);
38
+ assertCurrent();
39
+ if (held && !online)
40
+ return textResponse(held);
41
+ if (!online)
42
+ throw new Error('This artifact has not been stored on this device');
43
+ const fetchFresh = async () => {
44
+ const response = await read();
45
+ assertCurrent();
46
+ if (!response.ok) {
47
+ if (held && (response.status === 401 || response.status === 403))
48
+ await cache.forgetContent({ kind: 'artifact', id: digest(held) });
49
+ return response;
50
+ }
51
+ const data = new Uint8Array(await response.arrayBuffer());
52
+ assertCurrent();
53
+ // Over-cap files remain the named large-media exception and are fetched only on open.
54
+ if (data.byteLength <= RESOURCE_CONTENT_LIMITS.fileBytes)
55
+ await cache.storeContent({
56
+ key: { kind: 'artifact', id: digest(data) },
57
+ data,
58
+ alias,
59
+ origin: 'opened',
60
+ cohort: 'run',
61
+ token,
62
+ });
63
+ assertCurrent();
64
+ return textResponse(data, {
65
+ status: response.status,
66
+ statusText: response.statusText,
67
+ headers: response.headers,
68
+ });
69
+ };
70
+ if (held && !refresh && onStored) {
71
+ await onStored(textResponse(held));
72
+ assertCurrent();
73
+ try {
74
+ const response = await fetchFresh();
75
+ if (response.status >= 500 && onRefreshError) {
76
+ onRefreshError(new Error(`HTTP ${response.status}`));
77
+ return textResponse(held);
78
+ }
79
+ onRefreshError?.(response.ok ? undefined : new Error(`HTTP ${response.status}`));
80
+ return response;
81
+ }
82
+ catch (error) {
83
+ assertCurrent();
84
+ if (!onRefreshError)
85
+ throw error;
86
+ onRefreshError(error);
87
+ return textResponse(held);
88
+ }
89
+ }
90
+ if (held && !refresh && onRefreshError) {
91
+ // The saved response is the display fallback. Report refresh failures separately so
92
+ // temporary network loss cannot hide it or leave a rejected background promise.
93
+ void fetchFresh().then((response) => onRefreshError(response.ok ? undefined : new Error(`HTTP ${response.status}`)), (error) => {
94
+ if (cache === current() &&
95
+ !signal?.aborted &&
96
+ cache.contentWriteToken().ownerVersion === token.ownerVersion)
97
+ onRefreshError(error);
98
+ });
99
+ return textResponse(held);
100
+ }
101
+ return fetchFresh();
102
+ }
103
+ //# sourceMappingURL=artifact-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-response.js","sourceRoot":"","sources":["../../src/client-cache/artifact-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAerE,SAAS,YAAY,CAAC,IAAgB,EAAE,IAAmB;IACzD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACzD,gFAAgF;IAChF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,MAAM,CAAC,IAAgB;IAC9B,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAC/C,OAAO,EACP,GAAG,EACH,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,GAAG,KAAK,EACf,cAAc,EACd,QAAQ,GACW;IACnB,MAAM,KAAK,GAAG,OAAO,EAAE,CAAC;IACxB,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,QAAQ,KAAK,mBAAmB;QAAE,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@
1
- import type { GatewayResourceCache, GatewayResourceCacheOptions } from './types.js';
1
+ import type { GatewayResourceCache, GatewayResourceCacheOptions, ResourceQueryError } from './types.js';
2
+ /**
3
+ * The gateway refused the read: the resource is gone or not this principal's. The
4
+ * cache evicts saved data on these; a network failure or timeout is not one.
5
+ */
6
+ export declare function readRefused(error: ResourceQueryError | undefined): boolean;
2
7
  export declare function createGatewayResourceCache(options: GatewayResourceCacheOptions): GatewayResourceCache;
3
8
  //# sourceMappingURL=cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/client-cache/cache.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAS5B,MAAM,YAAY,CAAC;AAgGpB,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,oBAAoB,CA+qCtB"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/client-cache/cache.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAM3B,kBAAkB,EAInB,MAAM,YAAY,CAAC;AAuDpB;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAE1E;AA8CD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,oBAAoB,CAu2CtB"}