@stigmer/runner 3.11.0 → 3.12.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 (239) hide show
  1. package/README.md +2 -0
  2. package/dist/.build-fingerprint +1 -1
  3. package/dist/activities/discover-mcp-server.d.ts +7 -0
  4. package/dist/activities/discover-mcp-server.js +6 -4
  5. package/dist/activities/discover-mcp-server.js.map +1 -1
  6. package/dist/activities/emit-event.d.ts +14 -2
  7. package/dist/activities/emit-event.js +52 -17
  8. package/dist/activities/emit-event.js.map +1 -1
  9. package/dist/activities/execute-cursor/attachment-resolver.d.ts +11 -0
  10. package/dist/activities/execute-cursor/attachment-resolver.js +8 -0
  11. package/dist/activities/execute-cursor/attachment-resolver.js.map +1 -1
  12. package/dist/activities/execute-cursor/blueprint-resolver.d.ts +1 -9
  13. package/dist/activities/execute-cursor/blueprint-resolver.js +0 -1
  14. package/dist/activities/execute-cursor/blueprint-resolver.js.map +1 -1
  15. package/dist/activities/execute-cursor/error-classifier.d.ts +19 -0
  16. package/dist/activities/execute-cursor/error-classifier.js +34 -3
  17. package/dist/activities/execute-cursor/error-classifier.js.map +1 -1
  18. package/dist/activities/execute-cursor/index.d.ts +52 -12
  19. package/dist/activities/execute-cursor/index.js +141 -67
  20. package/dist/activities/execute-cursor/index.js.map +1 -1
  21. package/dist/activities/execute-cursor/model-pricing-data.d.ts +2 -0
  22. package/dist/activities/execute-cursor/model-pricing-data.js +13 -3
  23. package/dist/activities/execute-cursor/model-pricing-data.js.map +1 -1
  24. package/dist/activities/execute-cursor/prompt-builder.d.ts +48 -11
  25. package/dist/activities/execute-cursor/prompt-builder.js +57 -10
  26. package/dist/activities/execute-cursor/prompt-builder.js.map +1 -1
  27. package/dist/activities/execute-cursor/turn-recovery.d.ts +52 -0
  28. package/dist/activities/execute-cursor/turn-recovery.js +193 -0
  29. package/dist/activities/execute-cursor/turn-recovery.js.map +1 -0
  30. package/dist/activities/execute-deep-agent/attachment-injector.d.ts +11 -0
  31. package/dist/activities/execute-deep-agent/attachment-injector.js +7 -1
  32. package/dist/activities/execute-deep-agent/attachment-injector.js.map +1 -1
  33. package/dist/activities/execute-deep-agent/index.js +0 -15
  34. package/dist/activities/execute-deep-agent/index.js.map +1 -1
  35. package/dist/activities/execute-deep-agent/mcp-gate.d.ts +0 -2
  36. package/dist/activities/execute-deep-agent/mcp-gate.js +0 -1
  37. package/dist/activities/execute-deep-agent/mcp-gate.js.map +1 -1
  38. package/dist/activities/execute-deep-agent/prompt-builder.d.ts +7 -8
  39. package/dist/activities/execute-deep-agent/prompt-builder.js +14 -7
  40. package/dist/activities/execute-deep-agent/prompt-builder.js.map +1 -1
  41. package/dist/activities/execute-deep-agent/setup.d.ts +0 -10
  42. package/dist/activities/execute-deep-agent/setup.js +22 -49
  43. package/dist/activities/execute-deep-agent/setup.js.map +1 -1
  44. package/dist/activities/execute-deep-agent/shell-env.d.ts +5 -1
  45. package/dist/activities/execute-deep-agent/shell-env.js +7 -9
  46. package/dist/activities/execute-deep-agent/shell-env.js.map +1 -1
  47. package/dist/activities/execute-deep-agent/subagent-transformer.js +7 -1
  48. package/dist/activities/execute-deep-agent/subagent-transformer.js.map +1 -1
  49. package/dist/activities/execute-deep-agent/subagent-wiring.d.ts +17 -3
  50. package/dist/activities/execute-deep-agent/subagent-wiring.js +14 -2
  51. package/dist/activities/execute-deep-agent/subagent-wiring.js.map +1 -1
  52. package/dist/activities/hydrate-workflow-execution.js +8 -5
  53. package/dist/activities/hydrate-workflow-execution.js.map +1 -1
  54. package/dist/activities/run-command.d.ts +5 -2
  55. package/dist/activities/run-command.js +22 -10
  56. package/dist/activities/run-command.js.map +1 -1
  57. package/dist/activities/run-env.d.ts +40 -0
  58. package/dist/activities/run-env.js +66 -0
  59. package/dist/activities/run-env.js.map +1 -0
  60. package/dist/bootstrap.js +5 -0
  61. package/dist/bootstrap.js.map +1 -1
  62. package/dist/client/stigmer-client.d.ts +83 -26
  63. package/dist/client/stigmer-client.js +88 -24
  64. package/dist/client/stigmer-client.js.map +1 -1
  65. package/dist/config.d.ts +6 -5
  66. package/dist/config.js.map +1 -1
  67. package/dist/encryption/config.d.ts +41 -9
  68. package/dist/encryption/config.js +63 -23
  69. package/dist/encryption/config.js.map +1 -1
  70. package/dist/middleware/index.d.ts +3 -0
  71. package/dist/middleware/index.js +7 -0
  72. package/dist/middleware/index.js.map +1 -1
  73. package/dist/middleware/path-normalization.d.ts +57 -0
  74. package/dist/middleware/path-normalization.js +109 -0
  75. package/dist/middleware/path-normalization.js.map +1 -0
  76. package/dist/middleware/types.d.ts +8 -0
  77. package/dist/payload-codecs.d.ts +2 -1
  78. package/dist/payload-codecs.js +7 -3
  79. package/dist/payload-codecs.js.map +1 -1
  80. package/dist/runner-manager.js +17 -3
  81. package/dist/runner-manager.js.map +1 -1
  82. package/dist/runner.js +7 -3
  83. package/dist/runner.js.map +1 -1
  84. package/dist/shared/artifact-storage.d.ts +34 -1
  85. package/dist/shared/artifact-storage.js +53 -10
  86. package/dist/shared/artifact-storage.js.map +1 -1
  87. package/dist/shared/attachment-download-urls.d.ts +62 -0
  88. package/dist/shared/attachment-download-urls.js +79 -0
  89. package/dist/shared/attachment-download-urls.js.map +1 -0
  90. package/dist/shared/channel-attachment.d.ts +1 -1
  91. package/dist/shared/channel-attachment.js +1 -1
  92. package/dist/shared/checkpointer/http-saver.d.ts +4 -20
  93. package/dist/shared/checkpointer/http-saver.js +15 -57
  94. package/dist/shared/checkpointer/http-saver.js.map +1 -1
  95. package/dist/shared/conversation-attachment.d.ts +2 -3
  96. package/dist/shared/conversation-attachment.js +2 -3
  97. package/dist/shared/conversation-attachment.js.map +1 -1
  98. package/dist/shared/conversation-catchup.d.ts +9 -2
  99. package/dist/shared/conversation-catchup.js +39 -6
  100. package/dist/shared/conversation-catchup.js.map +1 -1
  101. package/dist/shared/grpc-retry.d.ts +5 -1
  102. package/dist/shared/grpc-retry.js +5 -1
  103. package/dist/shared/grpc-retry.js.map +1 -1
  104. package/dist/shared/http-retry.d.ts +51 -9
  105. package/dist/shared/http-retry.js +60 -9
  106. package/dist/shared/http-retry.js.map +1 -1
  107. package/dist/shared/mcp-manager.d.ts +8 -4
  108. package/dist/shared/mcp-manager.js +30 -4
  109. package/dist/shared/mcp-manager.js.map +1 -1
  110. package/dist/shared/mcp-schema-sanitizer.d.ts +70 -0
  111. package/dist/shared/mcp-schema-sanitizer.js +197 -0
  112. package/dist/shared/mcp-schema-sanitizer.js.map +1 -0
  113. package/dist/shared/mcp-transport-guard.d.ts +2 -2
  114. package/dist/shared/mcp-transport-guard.js +2 -2
  115. package/dist/shared/model-client.d.ts +6 -0
  116. package/dist/shared/model-client.js +14 -3
  117. package/dist/shared/model-client.js.map +1 -1
  118. package/dist/shared/model-pricing-data.d.ts +2 -0
  119. package/dist/shared/model-pricing-data.js +13 -3
  120. package/dist/shared/model-pricing-data.js.map +1 -1
  121. package/dist/shared/model-registry.js +3 -2
  122. package/dist/shared/model-registry.js.map +1 -1
  123. package/dist/shared/plan-mode-permissions.d.ts +7 -0
  124. package/dist/shared/plan-mode-permissions.js +7 -0
  125. package/dist/shared/plan-mode-permissions.js.map +1 -1
  126. package/dist/shared/registry-endpoint.d.ts +20 -0
  127. package/dist/shared/registry-endpoint.js +25 -0
  128. package/dist/shared/registry-endpoint.js.map +1 -1
  129. package/dist/shared/runner-credential-keys.d.ts +24 -0
  130. package/dist/shared/runner-credential-keys.js +47 -0
  131. package/dist/shared/runner-credential-keys.js.map +1 -0
  132. package/dist/shared/synthesized-attachment.d.ts +4 -4
  133. package/dist/shared/synthesized-attachment.js +4 -4
  134. package/dist/workflow-engine/resolve.d.ts +19 -1
  135. package/dist/workflow-engine/resolve.js +37 -2
  136. package/dist/workflow-engine/resolve.js.map +1 -1
  137. package/dist/workflows/connect-mcp-server.js +2 -0
  138. package/dist/workflows/connect-mcp-server.js.map +1 -1
  139. package/dist/workflows/types.d.ts +8 -0
  140. package/package.json +3 -4
  141. package/src/__test-utils__/__tests__/vitest-global-setup.test.ts +37 -0
  142. package/src/__test-utils__/fake-artifact-storage.ts +10 -1
  143. package/src/__test-utils__/vitest-global-setup.ts +50 -0
  144. package/src/__tests__/bootstrap.test.ts +43 -0
  145. package/src/__tests__/encryption-codec.test.ts +53 -0
  146. package/src/__tests__/preflight.test.ts +15 -0
  147. package/src/activities/__tests__/discover-mcp-server.test.ts +39 -1
  148. package/src/activities/__tests__/error-classifier.test.ts +94 -2
  149. package/src/activities/__tests__/run-command.test.ts +221 -0
  150. package/src/activities/discover-mcp-server.ts +16 -2
  151. package/src/activities/emit-event.ts +65 -21
  152. package/src/activities/execute-cursor/__tests__/attachment-resolver.test.ts +63 -3
  153. package/src/activities/execute-cursor/__tests__/build-prompt.test.ts +173 -31
  154. package/src/activities/execute-cursor/__tests__/model-pricing.test.ts +62 -1
  155. package/src/activities/execute-cursor/__tests__/turn-recovery.test.ts +160 -0
  156. package/src/activities/execute-cursor/attachment-resolver.ts +24 -0
  157. package/src/activities/execute-cursor/blueprint-resolver.ts +1 -10
  158. package/src/activities/execute-cursor/error-classifier.ts +40 -3
  159. package/src/activities/execute-cursor/index.ts +175 -74
  160. package/src/activities/execute-cursor/model-pricing-data.ts +22 -3
  161. package/src/activities/execute-cursor/prompt-builder.ts +89 -22
  162. package/src/activities/execute-cursor/turn-recovery.ts +208 -0
  163. package/src/activities/execute-deep-agent/__tests__/attachment-injector.test.ts +105 -0
  164. package/src/activities/execute-deep-agent/__tests__/hitl-reject.test.ts +0 -2
  165. package/src/activities/execute-deep-agent/__tests__/hitl-resume-approve-all.test.ts +0 -1
  166. package/src/activities/execute-deep-agent/__tests__/hitl-resume-history.test.ts +0 -1
  167. package/src/activities/execute-deep-agent/__tests__/mcp-gate.test.ts +2 -7
  168. package/src/activities/execute-deep-agent/__tests__/plan-mode-path-normalization.test.ts +174 -0
  169. package/src/activities/execute-deep-agent/__tests__/prompt-builder.test.ts +71 -0
  170. package/src/activities/execute-deep-agent/__tests__/sequential-gate-resume.test.ts +0 -1
  171. package/src/activities/execute-deep-agent/__tests__/shell-env.test.ts +24 -10
  172. package/src/activities/execute-deep-agent/__tests__/subagent-plan-mode-permissions.test.ts +22 -17
  173. package/src/activities/execute-deep-agent/attachment-injector.ts +20 -1
  174. package/src/activities/execute-deep-agent/index.ts +0 -19
  175. package/src/activities/execute-deep-agent/mcp-gate.ts +0 -3
  176. package/src/activities/execute-deep-agent/prompt-builder.ts +27 -15
  177. package/src/activities/execute-deep-agent/setup.ts +22 -73
  178. package/src/activities/execute-deep-agent/shell-env.ts +8 -9
  179. package/src/activities/execute-deep-agent/subagent-transformer.ts +7 -1
  180. package/src/activities/execute-deep-agent/subagent-wiring.ts +26 -3
  181. package/src/activities/hydrate-workflow-execution.ts +8 -5
  182. package/src/activities/run-command.ts +25 -12
  183. package/src/activities/run-env.ts +79 -0
  184. package/src/bootstrap.ts +5 -0
  185. package/src/client/__tests__/stigmer-client.test.ts +104 -5
  186. package/src/client/stigmer-client.ts +128 -29
  187. package/src/config.ts +6 -5
  188. package/src/encryption/config.ts +87 -23
  189. package/src/middleware/__tests__/path-normalization.test.ts +140 -0
  190. package/src/middleware/index.ts +8 -0
  191. package/src/middleware/path-normalization.ts +125 -0
  192. package/src/middleware/types.ts +11 -0
  193. package/src/payload-codecs.ts +8 -2
  194. package/src/runner-manager.ts +21 -3
  195. package/src/runner.ts +7 -3
  196. package/src/shared/__tests__/artifact-storage.test.ts +154 -2
  197. package/src/shared/__tests__/attachment-download-urls.test.ts +70 -0
  198. package/src/shared/__tests__/channel-attachment.test.ts +2 -2
  199. package/src/shared/__tests__/conversation-catchup.test.ts +24 -0
  200. package/src/shared/__tests__/http-retry.test.ts +5 -4
  201. package/src/shared/__tests__/mcp-manager.test.ts +53 -13
  202. package/src/shared/__tests__/mcp-schema-sanitizer.test.ts +267 -0
  203. package/src/shared/__tests__/model-client.test.ts +46 -0
  204. package/src/shared/__tests__/model-pricing.test.ts +62 -2
  205. package/src/shared/__tests__/model-registry.test.ts +22 -0
  206. package/src/shared/__tests__/synthesized-attachment.test.ts +19 -41
  207. package/src/shared/artifact-storage.ts +86 -10
  208. package/src/shared/attachment-download-urls.ts +98 -0
  209. package/src/shared/channel-attachment.ts +1 -1
  210. package/src/shared/checkpointer/http-saver.ts +15 -60
  211. package/src/shared/conversation-attachment.ts +2 -3
  212. package/src/shared/conversation-catchup.ts +39 -6
  213. package/src/shared/grpc-retry.ts +5 -1
  214. package/src/shared/http-retry.ts +98 -9
  215. package/src/shared/mcp-manager.ts +35 -4
  216. package/src/shared/mcp-schema-sanitizer.ts +224 -0
  217. package/src/shared/mcp-transport-guard.ts +2 -2
  218. package/src/shared/model-client.ts +21 -3
  219. package/src/shared/model-pricing-data.ts +22 -3
  220. package/src/shared/model-registry.ts +7 -2
  221. package/src/shared/plan-mode-permissions.ts +7 -0
  222. package/src/shared/registry-endpoint.ts +27 -0
  223. package/src/shared/runner-credential-keys.ts +46 -0
  224. package/src/shared/synthesized-attachment.ts +4 -4
  225. package/src/workflow-engine/__tests__/tasks/emit-event.test.ts +127 -49
  226. package/src/workflow-engine/resolve.ts +48 -2
  227. package/src/workflows/__tests__/connect-mcp-server.test.ts +25 -0
  228. package/src/workflows/connect-mcp-server.ts +2 -0
  229. package/src/workflows/types.ts +8 -0
  230. package/dist/activities/execute-cursor/mcp-config.d.ts +0 -30
  231. package/dist/activities/execute-cursor/mcp-config.js +0 -39
  232. package/dist/activities/execute-cursor/mcp-config.js.map +0 -1
  233. package/dist/shared/datastore-attachment.d.ts +0 -99
  234. package/dist/shared/datastore-attachment.js +0 -184
  235. package/dist/shared/datastore-attachment.js.map +0 -1
  236. package/src/activities/execute-cursor/mcp-config.ts +0 -66
  237. package/src/activities/execute-deep-agent/__tests__/datastore-degradation.test.ts +0 -104
  238. package/src/shared/__tests__/datastore-attachment.test.ts +0 -293
  239. package/src/shared/datastore-attachment.ts +0 -209
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Download-URL hand-off for execution attachments (issue #532) — the single
3
+ * owner of the mint policy and the prompt wording that lets an agent pass an
4
+ * attachment to a tool whose backend cannot read the sandbox filesystem.
5
+ *
6
+ * Both harnesses (Cursor and deep-agent) materialize attachments to disk and
7
+ * list the workspace paths in their input-files prompt section; that story is
8
+ * unchanged and this module never touches it. What this module adds is the
9
+ * *remote hand-off* story: a per-attachment download URL, minted from the
10
+ * artifact storage the runner already downloads through, surfaced beside the
11
+ * path so the model can quote a short URL string in a tool-call argument
12
+ * instead of the impossible alternative (base64 through the model caps out in
13
+ * the tens of KB; real attachments run 2–8 MB).
14
+ *
15
+ * Mint rule: any attachment with a `storageKey` and a usable storage gets a
16
+ * URL, regardless of which branch materialized the bytes — this covers the
17
+ * local-mode fast path when an uploaded copy also exists. Attachments with no
18
+ * storage key (pure CLI-local files) and extracted ZIP entries (no
19
+ * attachment-level object) get no URL, and their listing is unchanged.
20
+ *
21
+ * Failure is non-fatal and silent in the prompt: the file IS materialized —
22
+ * only the remote hand-off affordance is absent — so a presign hiccup must
23
+ * not abort a turn the way a missing input does (the resolver/injector
24
+ * fail-hard doctrine covers inputs, not affordances). This mirrors how vision
25
+ * delivery degrades without killing materialization. The degrade is logged;
26
+ * the URL value itself is never logged (a presigned URL in the log pipeline
27
+ * would outlive its purpose).
28
+ *
29
+ * What the URL actually is depends on the storage backend, and the prompt
30
+ * must not overpromise: proxy storage mints genuinely presigned, time-limited,
31
+ * single-object URLs a remote service can fetch; local storage returns the
32
+ * stigmer-server's loopback serve URL, which only same-machine tools can
33
+ * reach. The backend self-describes via {@link ArtifactStorage.downloadUrlKind}
34
+ * and {@link downloadUrlDisclosureLine} words each kind honestly.
35
+ */
36
+ import type { ArtifactStorage } from "./artifact-storage.js";
37
+ /**
38
+ * What kind of URL a storage backend's `getDownloadUrl` mints. A property of
39
+ * the backend, not of the runner's execution mode: storage follows transport
40
+ * (see loadArtifactStorageConfig), so a local desktop runner on a cloud proxy
41
+ * mints real presigned URLs.
42
+ */
43
+ export type DownloadUrlKind = "presigned" | "local-serve";
44
+ /**
45
+ * Mint a download URL for one attachment, or `undefined` when there is
46
+ * nothing to mint (no key / no storage) or the mint fails (logged, non-fatal
47
+ * — see module doc). The caller spreads the result into its per-attachment
48
+ * record with the conditional-spread convention, so an unminted URL leaves no
49
+ * field behind.
50
+ */
51
+ export declare function mintAttachmentDownloadUrl(storage: ArtifactStorage | undefined, storageKey: string, filename: string): Promise<string | undefined>;
52
+ /**
53
+ * The shared hand-off wording both harnesses embed into their input-files
54
+ * prompt section when at least one listed file carries a download URL (each
55
+ * wraps it in its own section framing). Kept here so the two prompts never
56
+ * drift apart in what they promise the agent.
57
+ *
58
+ * Each kind is worded to its real capability. "Time-limited" is deliberately
59
+ * unquantified: the presign TTL belongs to the serving side (the cloud
60
+ * proxy's constant today) and hardcoding it here would silently drift.
61
+ */
62
+ export declare function downloadUrlDisclosureLine(kind: DownloadUrlKind): string;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Download-URL hand-off for execution attachments (issue #532) — the single
3
+ * owner of the mint policy and the prompt wording that lets an agent pass an
4
+ * attachment to a tool whose backend cannot read the sandbox filesystem.
5
+ *
6
+ * Both harnesses (Cursor and deep-agent) materialize attachments to disk and
7
+ * list the workspace paths in their input-files prompt section; that story is
8
+ * unchanged and this module never touches it. What this module adds is the
9
+ * *remote hand-off* story: a per-attachment download URL, minted from the
10
+ * artifact storage the runner already downloads through, surfaced beside the
11
+ * path so the model can quote a short URL string in a tool-call argument
12
+ * instead of the impossible alternative (base64 through the model caps out in
13
+ * the tens of KB; real attachments run 2–8 MB).
14
+ *
15
+ * Mint rule: any attachment with a `storageKey` and a usable storage gets a
16
+ * URL, regardless of which branch materialized the bytes — this covers the
17
+ * local-mode fast path when an uploaded copy also exists. Attachments with no
18
+ * storage key (pure CLI-local files) and extracted ZIP entries (no
19
+ * attachment-level object) get no URL, and their listing is unchanged.
20
+ *
21
+ * Failure is non-fatal and silent in the prompt: the file IS materialized —
22
+ * only the remote hand-off affordance is absent — so a presign hiccup must
23
+ * not abort a turn the way a missing input does (the resolver/injector
24
+ * fail-hard doctrine covers inputs, not affordances). This mirrors how vision
25
+ * delivery degrades without killing materialization. The degrade is logged;
26
+ * the URL value itself is never logged (a presigned URL in the log pipeline
27
+ * would outlive its purpose).
28
+ *
29
+ * What the URL actually is depends on the storage backend, and the prompt
30
+ * must not overpromise: proxy storage mints genuinely presigned, time-limited,
31
+ * single-object URLs a remote service can fetch; local storage returns the
32
+ * stigmer-server's loopback serve URL, which only same-machine tools can
33
+ * reach. The backend self-describes via {@link ArtifactStorage.downloadUrlKind}
34
+ * and {@link downloadUrlDisclosureLine} words each kind honestly.
35
+ */
36
+ /**
37
+ * Mint a download URL for one attachment, or `undefined` when there is
38
+ * nothing to mint (no key / no storage) or the mint fails (logged, non-fatal
39
+ * — see module doc). The caller spreads the result into its per-attachment
40
+ * record with the conditional-spread convention, so an unminted URL leaves no
41
+ * field behind.
42
+ */
43
+ export async function mintAttachmentDownloadUrl(storage, storageKey, filename) {
44
+ if (!storageKey || !storage)
45
+ return undefined;
46
+ try {
47
+ return await storage.getDownloadUrl(storageKey);
48
+ }
49
+ catch (err) {
50
+ console.warn(`[attachment-download-urls] could not mint a download URL for ` +
51
+ `'${filename}' (key: ${storageKey}) — the file is materialized and the ` +
52
+ `turn proceeds without one: ${err instanceof Error ? err.message : String(err)}`);
53
+ return undefined;
54
+ }
55
+ }
56
+ /**
57
+ * The shared hand-off wording both harnesses embed into their input-files
58
+ * prompt section when at least one listed file carries a download URL (each
59
+ * wraps it in its own section framing). Kept here so the two prompts never
60
+ * drift apart in what they promise the agent.
61
+ *
62
+ * Each kind is worded to its real capability. "Time-limited" is deliberately
63
+ * unquantified: the presign TTL belongs to the serving side (the cloud
64
+ * proxy's constant today) and hardcoding it here would silently drift.
65
+ */
66
+ export function downloadUrlDisclosureLine(kind) {
67
+ switch (kind) {
68
+ case "presigned":
69
+ return ("Where a file lists a download URL, you can pass that URL to tools " +
70
+ "whose backends cannot read this workspace's filesystem (e.g. remote " +
71
+ "services) — the tool fetches the file's contents itself. These URLs " +
72
+ "are time-limited and each grants access to its single file only.");
73
+ case "local-serve":
74
+ return ("Where a file lists a download URL, it is served by the local Stigmer " +
75
+ "server and is reachable only from this machine — tools running on " +
76
+ "this machine can fetch it, but remote services cannot.");
77
+ }
78
+ }
79
+ //# sourceMappingURL=attachment-download-urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-download-urls.js","sourceRoot":"","sources":["../../src/shared/attachment-download-urls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAYH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAAoC,EACpC,UAAkB,EAClB,QAAgB;IAEhB,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC9C,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CACV,+DAA+D;YAC/D,IAAI,QAAQ,WAAW,UAAU,uCAAuC;YACxE,8BAA8B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACjF,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAqB;IAC7D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW;YACd,OAAO,CACL,oEAAoE;gBACpE,sEAAsE;gBACtE,sEAAsE;gBACtE,kEAAkE,CACnE,CAAC;QACJ,KAAK,aAAa;YAChB,OAAO,CACL,uEAAuE;gBACvE,oEAAoE;gBACpE,wDAAwD,CACzD,CAAC;IACN,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The runner-synthesized channel messaging attachment (proactive-messaging
3
- * DD-006 D7/D8) — the datastore records attachment's structural twin.
3
+ * DD-006 D7/D8).
4
4
  *
5
5
  * When the control plane says an agent serves at least one
6
6
  * proactive-messaging channel (the `listMessagingChannels` discovery
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The runner-synthesized channel messaging attachment (proactive-messaging
3
- * DD-006 D7/D8) — the datastore records attachment's structural twin.
3
+ * DD-006 D7/D8).
4
4
  *
5
5
  * When the control plane says an agent serves at least one
6
6
  * proactive-messaging channel (the `listMessagingChannels` discovery
@@ -14,9 +14,9 @@
14
14
  * The Java proxy calls Document.parse(json) which handles $binary
15
15
  * natively, and doc.toJson() emits the same format on reads.
16
16
  *
17
- * Every request runs through {@link HttpCheckpointSaver.fetchWithRetry}:
18
- * bounded exponential backoff on transient failures (classified by
19
- * http-retry.ts) with a per-request abort timeout. This loop is the ONLY
17
+ * Every request runs through the shared bounded-backoff loop
18
+ * (http-retry.ts's fetchWithRetry, with this saver's policy: transient
19
+ * classification + a per-request abort timeout). That loop is the ONLY
20
20
  * retry layer between an agent execution and its checkpoints — the deep
21
21
  * agent activity is deliberately non-retryable at the Temporal level
22
22
  * (maximumAttempts: 1; replaying a whole agent run is not safe), so before
@@ -43,25 +43,9 @@ export interface HttpCheckpointSaverOptions extends RetryOptions {
43
43
  export declare class HttpCheckpointSaver extends BaseCheckpointSaver {
44
44
  private readonly baseUrl;
45
45
  private readonly headers;
46
- private readonly baseDelayMs;
47
- private readonly backoffFactor;
48
- private readonly maxRetries;
49
- private readonly requestTimeoutMs;
50
- private readonly delay;
46
+ private readonly retryPolicy;
51
47
  constructor(proxyEndpoint: string, authToken: string, options?: HttpCheckpointSaverOptions);
52
- /**
53
- * `fetch` with bounded exponential backoff on transient failures and a
54
- * per-request abort timeout.
55
- *
56
- * Composition contract: on a non-retryable status — or when the budget is
57
- * exhausted on a retryable one — the last `Response` is RETURNED, so every
58
- * call site keeps its own `resp.ok` / 404 handling unchanged; this wrapper
59
- * changes when a response arrives, never what call sites do with it. It
60
- * throws only what `fetch` itself throws: a network-level rejection that is
61
- * non-retryable or has exhausted the budget.
62
- */
63
48
  private fetchWithRetry;
64
- private backOff;
65
49
  private serializeTyped;
66
50
  private deserializeTyped;
67
51
  getTuple(config: RunnableConfig): Promise<CheckpointTuple | undefined>;
@@ -14,9 +14,9 @@
14
14
  * The Java proxy calls Document.parse(json) which handles $binary
15
15
  * natively, and doc.toJson() emits the same format on reads.
16
16
  *
17
- * Every request runs through {@link HttpCheckpointSaver.fetchWithRetry}:
18
- * bounded exponential backoff on transient failures (classified by
19
- * http-retry.ts) with a per-request abort timeout. This loop is the ONLY
17
+ * Every request runs through the shared bounded-backoff loop
18
+ * (http-retry.ts's fetchWithRetry, with this saver's policy: transient
19
+ * classification + a per-request abort timeout). That loop is the ONLY
20
20
  * retry layer between an agent execution and its checkpoints — the deep
21
21
  * agent activity is deliberately non-retryable at the Temporal level
22
22
  * (maximumAttempts: 1; replaying a whole agent run is not safe), so before
@@ -28,7 +28,7 @@
28
28
  * dropping one would corrupt resume state.
29
29
  */
30
30
  import { BaseCheckpointSaver, } from "@langchain/langgraph-checkpoint";
31
- import { isRetryableFetchError, isRetryableHttpStatus } from "../http-retry.js";
31
+ import { fetchWithRetry } from "../http-retry.js";
32
32
  function encodeB64(data) {
33
33
  if (typeof Buffer !== "undefined") {
34
34
  return Buffer.from(data).toString("base64");
@@ -82,17 +82,10 @@ const DEFAULT_RETRY = {
82
82
  maxRetries: 5,
83
83
  requestTimeoutMs: 30_000,
84
84
  };
85
- function defaultDelay(ms) {
86
- return new Promise((resolve) => setTimeout(resolve, ms));
87
- }
88
85
  export class HttpCheckpointSaver extends BaseCheckpointSaver {
89
86
  baseUrl;
90
87
  headers;
91
- baseDelayMs;
92
- backoffFactor;
93
- maxRetries;
94
- requestTimeoutMs;
95
- delay;
88
+ retryPolicy;
96
89
  constructor(proxyEndpoint, authToken, options = {}) {
97
90
  super();
98
91
  this.baseUrl = `${proxyEndpoint.replace(/\/+$/, "")}/v1/proxy/checkpoints`;
@@ -100,52 +93,17 @@ export class HttpCheckpointSaver extends BaseCheckpointSaver {
100
93
  Authorization: `Bearer ${authToken}`,
101
94
  "Content-Type": "application/json",
102
95
  };
103
- this.baseDelayMs = options.baseDelayMs ?? DEFAULT_RETRY.baseDelayMs;
104
- this.backoffFactor = options.backoffFactor ?? DEFAULT_RETRY.backoffFactor;
105
- this.maxRetries = options.maxRetries ?? DEFAULT_RETRY.maxRetries;
106
- this.requestTimeoutMs = options.requestTimeoutMs ?? DEFAULT_RETRY.requestTimeoutMs;
107
- this.delay = options.delayFn ?? defaultDelay;
108
- }
109
- /**
110
- * `fetch` with bounded exponential backoff on transient failures and a
111
- * per-request abort timeout.
112
- *
113
- * Composition contract: on a non-retryable status — or when the budget is
114
- * exhausted on a retryable one — the last `Response` is RETURNED, so every
115
- * call site keeps its own `resp.ok` / 404 handling unchanged; this wrapper
116
- * changes when a response arrives, never what call sites do with it. It
117
- * throws only what `fetch` itself throws: a network-level rejection that is
118
- * non-retryable or has exhausted the budget.
119
- */
120
- async fetchWithRetry(url, init) {
121
- for (let attempt = 0;; attempt++) {
122
- const canRetry = attempt < this.maxRetries;
123
- let resp;
124
- try {
125
- resp = await fetch(url, {
126
- ...init,
127
- signal: AbortSignal.timeout(this.requestTimeoutMs),
128
- });
129
- }
130
- catch (err) {
131
- if (canRetry && isRetryableFetchError(err)) {
132
- await this.backOff(attempt, String(err));
133
- continue;
134
- }
135
- throw err;
136
- }
137
- if (canRetry && isRetryableHttpStatus(resp.status)) {
138
- await this.backOff(attempt, `HTTP ${resp.status} ${resp.statusText}`);
139
- continue;
140
- }
141
- return resp;
142
- }
96
+ this.retryPolicy = {
97
+ label: "HttpCheckpointSaver",
98
+ baseDelayMs: options.baseDelayMs ?? DEFAULT_RETRY.baseDelayMs,
99
+ backoffFactor: options.backoffFactor ?? DEFAULT_RETRY.backoffFactor,
100
+ maxRetries: options.maxRetries ?? DEFAULT_RETRY.maxRetries,
101
+ requestTimeoutMs: options.requestTimeoutMs ?? DEFAULT_RETRY.requestTimeoutMs,
102
+ delayFn: options.delayFn,
103
+ };
143
104
  }
144
- async backOff(attempt, reason) {
145
- const delayMs = this.baseDelayMs * Math.pow(this.backoffFactor, attempt);
146
- console.warn(`[HttpCheckpointSaver] retryable failure ` +
147
- `(attempt ${attempt + 1}/${this.maxRetries + 1}, retry in ${delayMs}ms): ${reason}`);
148
- await this.delay(delayMs);
105
+ fetchWithRetry(url, init) {
106
+ return fetchWithRetry(url, init, this.retryPolicy);
149
107
  }
150
108
  async serializeTyped(obj) {
151
109
  const [typeTag, payload] = await this.serde.dumpsTyped(obj);
@@ -1 +1 @@
1
- {"version":3,"file":"http-saver.js","sourceRoot":"","sources":["../../../src/shared/checkpointer/http-saver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EACL,mBAAmB,GAMpB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,SAAS,SAAS,CAAC,IAAgB;IACjC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,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AAC;YAC/B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * The runner-synthesized conversation participation attachment
3
- * (channel-conversations DD-008 D-c, A14) — the third synthesized
4
- * attachment, on the datastore module's shape (a cheap local predicate,
5
- * not the channel module's discovery machinery).
3
+ * (channel-conversations DD-008 D-c, A14) — a cheap local predicate,
4
+ * not the channel module's discovery machinery.
6
5
  *
7
6
  * When the session IS a live channel conversation, the runner
8
7
  * synthesizes ONE MCP attachment serving `escalate_to_human`, so the
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * The runner-synthesized conversation participation attachment
3
- * (channel-conversations DD-008 D-c, A14) — the third synthesized
4
- * attachment, on the datastore module's shape (a cheap local predicate,
5
- * not the channel module's discovery machinery).
3
+ * (channel-conversations DD-008 D-c, A14) — a cheap local predicate,
4
+ * not the channel module's discovery machinery.
6
5
  *
7
6
  * When the session IS a live channel conversation, the runner
8
7
  * synthesizes ONE MCP attachment serving `escalate_to_human`, so the
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-attachment.js","sourceRoot":"","sources":["../../src/shared/conversation-attachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAA0C;IAE1C,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC;IACrD,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC9C,SAA6B,EAC7B,OAAqC;IAErC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,CAAC,cAAc,KAAK,IAAI,IAAI,OAAO,CAAC,cAAc,KAAK,EAAE,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,mEAAmE;IACnE,OAAO;QACL,IAAI,EAAE,4BAA4B;QAClC,aAAa,EAAE,EAAE;QACjB,mBAAmB,EAAE,EAAE;QACvB,qBAAqB,EAAE,EAAE;QACzB,2BAA2B,EAAE,KAAK;QAClC,cAAc,EAAE,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,kBAAkB;QACpE,OAAO,EAAE,OAAO,CAAC,UAAU,KAAK,IAAI,IAAI,OAAO,CAAC,UAAU,KAAK,EAAE;YAC/D,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,UAAU,EAAE,EAAE;YACnD,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"conversation-attachment.js","sourceRoot":"","sources":["../../src/shared/conversation-attachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAKH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC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that the agent has not seen — customer messages
4
- * handled by a human teammate, the teammate's replies, platform notices the
5
- * customer received, notes, and the agent's own earlier escalations.
4
+ * handled by a human teammate, the teammate's replies, platform notices,
5
+ * notes, and the agent's own earlier escalations. Since cloud#347 a line
6
+ * whose send is known-undelivered carries a `(not delivered)` speaker
7
+ * annotation and an in-flight one carries `(sending)` — the digest no longer
8
+ * implies every public-lane line reached the customer. Since cloud#352 the
9
+ * digest also closes the feedback loop on send OUTCOMES: the agent's own
10
+ * dead-lettered sends surface as `You (not delivered):` lines, and a send
11
+ * that failed only after an earlier digest already conveyed it surfaces as a
12
+ * `System:` delivery-failure notice at the moment the failure became known.
6
13
  *
7
14
  * The cloud composes the CONTENT (bare `Customer:` / `Teammate:` / `System:` /
8
15
  * `You escalated:` / `Note:` lines, oldest first) on the execution spec's
@@ -1,8 +1,15 @@
1
1
  /**
2
2
  * Conversation catchup (cloud channel-conversations DD-006): what happened on
3
3
  * a live channel conversation that the agent has not seen — customer messages
4
- * handled by a human teammate, the teammate's replies, platform notices the
5
- * customer received, notes, and the agent's own earlier escalations.
4
+ * handled by a human teammate, the teammate's replies, platform notices,
5
+ * notes, and the agent's own earlier escalations. Since cloud#347 a line
6
+ * whose send is known-undelivered carries a `(not delivered)` speaker
7
+ * annotation and an in-flight one carries `(sending)` — the digest no longer
8
+ * implies every public-lane line reached the customer. Since cloud#352 the
9
+ * digest also closes the feedback loop on send OUTCOMES: the agent's own
10
+ * dead-lettered sends surface as `You (not delivered):` lines, and a send
11
+ * that failed only after an earlier digest already conveyed it surfaces as a
12
+ * `System:` delivery-failure notice at the moment the failure became known.
6
13
  *
7
14
  * The cloud composes the CONTENT (bare `Customer:` / `Teammate:` / `System:` /
8
15
  * `You escalated:` / `Note:` lines, oldest first) on the execution spec's
@@ -26,15 +33,41 @@
26
33
  * drift between them. Deliberately takeover-neutral: a digest can exist with
27
34
  * no human handoff at all (a failed turn's re-composed window), so the
28
35
  * preamble asserts only what is always true (the A15/A20 honesty bar).
36
+ *
37
+ * The send-status annotations (cloud#347) get an explicit exception from the
38
+ * don't-re-answer contract: a `(not delivered)` teammate reply is words the
39
+ * customer never got, so treating it as settled history would silently
40
+ * abandon whatever it was meant to convey. The preamble defines the
41
+ * annotations — the DD-013 split puts model-facing meaning here, while the
42
+ * cloud composer owns which lines earn them.
43
+ *
44
+ * The send-outcome lines (cloud#352, cloud triage DD-009) extend the same
45
+ * exception to the agent's OWN sends: `You (not delivered):` lines and
46
+ * `System:` delivery-failure notices mean the customer never got those
47
+ * words. The behavioral contract is owner-ruled (DD-009 Q-4): treat the
48
+ * failure as unfinished conversation business — weigh what still needs
49
+ * saying and re-say it naturally in the next turn — but never resend the
50
+ * failed text verbatim: a multi-chunk send can partially land, and a
51
+ * word-for-word repeat risks the customer reading the same message twice.
29
52
  */
30
53
  const CONVERSATION_CATCHUP_PREAMBLE = "Below is activity from this conversation that you have not seen — " +
31
54
  "oldest first. It may include customer messages that were handled by a " +
32
- "human teammate, the teammate's own replies, notices the customer " +
33
- "received, internal notes, and escalations you raised earlier. Treat it " +
55
+ "human teammate, the teammate's own replies, notices sent to the " +
56
+ "customer, internal notes, and escalations you raised earlier. Treat it " +
34
57
  "as conversation history you already know: do not answer or re-answer " +
35
58
  "these messages, do not repeat or summarize them back, and do not " +
36
- "mention any handoff unless asked. Continue from the customer's newest " +
37
- "message.";
59
+ "mention any handoff unless asked. One exception: lines marked " +
60
+ "(not delivered) never reached the customer, and lines marked (sending) " +
61
+ "were still on their way when this summary was built — the customer may " +
62
+ "not have seen those words, so weigh that when deciding what still needs " +
63
+ "saying. That includes your own words: a line marked " +
64
+ "You (not delivered), or a System line reporting that a message was not " +
65
+ "delivered, means the customer never received it. Treat such a failure " +
66
+ "as unfinished business — if what it said still matters, work it " +
67
+ "naturally into your reply in your own words, but never resend the " +
68
+ "failed text word-for-word (part of it may have reached the customer, " +
69
+ "and an exact repeat reads as a duplicate). " +
70
+ "Continue from the customer's newest message.";
38
71
  /**
39
72
  * Read the catchup digest from an execution spec's `conversation_catchup`.
40
73
  * Returns undefined when the field is absent or the digest is blank — the
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-catchup.js","sourceRoot":"","sources":["../../src/shared/conversation-catchup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,6BAA6B,GACjC,oEAAoE;IACpE,wEAAwE;IACxE,mEAAmE;IACnE,yEAAyE;IACzE,uEAAuE;IACvE,mEAAmE;IACnE,wEAAwE;IACxE,UAAU,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAwC;IAExC,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrC,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,6BAA6B,CAAC,MAAc;IAC1D,OAAO,GAAG,6BAA6B,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;AAChE,CAAC"}
1
+ {"version":3,"file":"conversation-catchup.js","sourceRoot":"","sources":["../../src/shared/conversation-catchup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,6BAA6B,GACjC,oEAAoE;IACpE,wEAAwE;IACxE,kEAAkE;IAClE,yEAAyE;IACzE,uEAAuE;IACvE,mEAAmE;IACnE,gEAAgE;IAChE,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,sDAAsD;IACtD,yEAAyE;IACzE,wEAAwE;IACxE,kEAAkE;IAClE,oEAAoE;IACpE,uEAAuE;IACvE,6CAA6C;IAC7C,8CAA8C,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAwC;IAExC,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACrC,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,6BAA6B,CAAC,MAAc;IAC1D,OAAO,GAAG,6BAA6B,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;AAChE,CAAC"}
@@ -6,7 +6,11 @@
6
6
  * `updateStatus` should back off and retry (transient transport errors) or
7
7
  * fail fast (deterministic errors). This module is intentionally just the
8
8
  * classification policy + its options type, kept small and separately tested;
9
- * the persist loop that consumes it lives with the rest of the persist logic.
9
+ * the persist loop that consumes it lives with the rest of the persist logic
10
+ * in status.ts — a single consumer whose loop is interwoven with persist
11
+ * semantics. (The HTTP twin, http-retry.ts, diverged there deliberately: with
12
+ * three fetch clients needing a byte-identical loop it hosts the shared
13
+ * fetchWithRetry too — see its module doc.)
10
14
  */
11
15
  export interface RetryOptions {
12
16
  /** Base delay before the first retry (ms). Default: 100. */
@@ -6,7 +6,11 @@
6
6
  * `updateStatus` should back off and retry (transient transport errors) or
7
7
  * fail fast (deterministic errors). This module is intentionally just the
8
8
  * classification policy + its options type, kept small and separately tested;
9
- * the persist loop that consumes it lives with the rest of the persist logic.
9
+ * the persist loop that consumes it lives with the rest of the persist logic
10
+ * in status.ts — a single consumer whose loop is interwoven with persist
11
+ * semantics. (The HTTP twin, http-retry.ts, diverged there deliberately: with
12
+ * three fetch clients needing a byte-identical loop it hosts the shared
13
+ * fetchWithRetry too — see its module doc.)
10
14
  */
11
15
  import { ConnectError, Code } from "@connectrpc/connect";
12
16
  const RETRYABLE_CODES = new Set([
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-retry.js","sourceRoot":"","sources":["../../src/shared/grpc-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAazD,MAAM,eAAe,G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D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,IAAI,GAAG,YAAY,YAAY,EAAE,CAAC;QAChC,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,14 +1,17 @@
1
1
  /**
2
- * HTTP error classification for side-channel proxy retries.
2
+ * HTTP error classification AND the shared bounded-backoff loop for
3
+ * side-channel proxy retries.
3
4
  *
4
5
  * The runner reaches stigmer-service's Side-Channel Proxy (`/v1/proxy/...`)
5
- * over plain `fetch` from several clients the checkpoint saver today;
6
- * artifact storage, the LLM proxy, and the registry endpoint are candidates
7
- * (stigmer/stigmer#468). This module is the one place that answers "is this
8
- * HTTP failure worth retrying?", the `fetch` twin of grpc-retry.ts: it holds
9
- * the classification policy only, kept small and separately tested. The
10
- * bounded-backoff loop that consumes it lives with each client (the
11
- * grpc-retry/status.ts split).
6
+ * over plain `fetch` from several clients: the checkpoint saver, artifact
7
+ * storage, and the model-registry fetches (stigmer/stigmer#468). This module
8
+ * is the one place that answers "is this HTTP failure worth retrying?" — the
9
+ * `fetch` twin of grpc-retry.ts and, since #468, also owns the
10
+ * {@link fetchWithRetry} loop those clients share. That is a deliberate
11
+ * divergence from grpc-retry.ts's policy-only split: the gRPC side has a
12
+ * single consumer whose loop is interwoven with persist-specific logic
13
+ * (status.ts), while the HTTP side grew three consumers needing a
14
+ * byte-identical loop — per-client copies were the drift risk, not the seam.
12
15
  *
13
16
  * The policy is grounded in what the proxy actually emits, not HTTP folklore.
14
17
  * CheckpointerProxyController returns exactly four deterministic errors —
@@ -17,7 +20,10 @@
17
20
  * reach the runner only as 5xx (Spring's error handler, ingress 502-504),
18
21
  * 408/429 (infrastructure between runner and service), or as network-level
19
22
  * fetch rejections. 401/403 stay terminal deliberately: retrying cannot fix
20
- * an expired or rejected credential.
23
+ * an expired or rejected credential. The same classification holds for the
24
+ * presigned R2 URLs artifact storage talks to: their deterministic failures
25
+ * (403 expired signature, 404 missing object) are 4xx, their transient ones
26
+ * are 5xx/network.
21
27
  */
22
28
  /**
23
29
  * True for HTTP statuses that signal a transient condition worth retrying:
@@ -41,3 +47,39 @@ export declare function isRetryableHttpStatus(status: number): boolean;
41
47
  * cancelled on purpose.
42
48
  */
43
49
  export declare function isRetryableFetchError(err: unknown): boolean;
50
+ /**
51
+ * A fully-resolved retry policy for {@link fetchWithRetry}. Every field is
52
+ * required on purpose: defaults differ per client (the checkpointer and the
53
+ * presign endpoints run 30 s requests, artifact transfers 120 s, registry
54
+ * fetches 10 s), so each client resolves its own defaults once and this
55
+ * module never guesses.
56
+ */
57
+ export interface FetchRetryPolicy {
58
+ /** Client name for retry logs, e.g. "HttpCheckpointSaver". */
59
+ readonly label: string;
60
+ /** Delay before the first retry (ms); doubles per attempt via the factor. */
61
+ readonly baseDelayMs: number;
62
+ readonly backoffFactor: number;
63
+ /** Retry attempts after the initial one. */
64
+ readonly maxRetries: number;
65
+ /**
66
+ * Milliseconds before an in-flight request is aborted and the attempt is
67
+ * classified retryable. Without it a hung connection (the realistic
68
+ * unplanned-pod-kill symptom) stalls forever and the retry never engages.
69
+ */
70
+ readonly requestTimeoutMs: number;
71
+ /** Injectable delay for tests; defaults to a real setTimeout sleep. */
72
+ readonly delayFn?: (ms: number) => Promise<void>;
73
+ }
74
+ /**
75
+ * `fetch` with bounded exponential backoff on transient failures and a
76
+ * per-request abort timeout.
77
+ *
78
+ * Composition contract: on a non-retryable status — or when the budget is
79
+ * exhausted on a retryable one — the last `Response` is RETURNED, so every
80
+ * call site keeps its own `resp.ok` / 404 handling unchanged; this wrapper
81
+ * changes when a response arrives, never what call sites do with it. It
82
+ * throws only what `fetch` itself throws: a network-level rejection that is
83
+ * non-retryable or has exhausted the budget.
84
+ */
85
+ export declare function fetchWithRetry(url: string, init: RequestInit | undefined, policy: FetchRetryPolicy): Promise<Response>;