@proofoftech/flowsafe 0.20.0 → 0.21.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 (233) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +55 -8
  3. package/deployment-identity-protocol.d.mts +28 -3
  4. package/deployment-identity-protocol.mjs +275 -21
  5. package/dist/agent-host/router.d.ts.map +1 -1
  6. package/dist/agent-host/router.js +11 -2
  7. package/dist/agent-host/router.js.map +1 -1
  8. package/dist/agent-host/thread-host.d.ts +3 -1
  9. package/dist/agent-host/thread-host.d.ts.map +1 -1
  10. package/dist/agent-host/thread-host.js +837 -332
  11. package/dist/agent-host/thread-host.js.map +1 -1
  12. package/dist/agent-host/thread-topology.d.ts +8 -0
  13. package/dist/agent-host/thread-topology.d.ts.map +1 -1
  14. package/dist/agent-host/thread-topology.js +239 -62
  15. package/dist/agent-host/thread-topology.js.map +1 -1
  16. package/dist/agent-runner/durable-agent-runner.d.ts +90 -6
  17. package/dist/agent-runner/durable-agent-runner.d.ts.map +1 -1
  18. package/dist/agent-runner/durable-agent-runner.js +371 -29
  19. package/dist/agent-runner/durable-agent-runner.js.map +1 -1
  20. package/dist/agent-runner/index.d.ts +1 -1
  21. package/dist/agent-runner/index.d.ts.map +1 -1
  22. package/dist/agent-runner/index.js.map +1 -1
  23. package/dist/approval-api/actor-context.d.ts +4 -0
  24. package/dist/approval-api/actor-context.d.ts.map +1 -1
  25. package/dist/approval-api/actor-context.js +53 -5
  26. package/dist/approval-api/actor-context.js.map +1 -1
  27. package/dist/approval-api/principal.d.ts +1 -1
  28. package/dist/approval-api/principal.js +1 -1
  29. package/dist/approval-api/retention.d.ts +1 -2
  30. package/dist/approval-api/retention.d.ts.map +1 -1
  31. package/dist/approval-api/retention.js.map +1 -1
  32. package/dist/approval-api/service.d.ts +10 -14
  33. package/dist/approval-api/service.d.ts.map +1 -1
  34. package/dist/approval-api/service.js +49 -22
  35. package/dist/approval-api/service.js.map +1 -1
  36. package/dist/audit-export/index.d.ts +2 -2
  37. package/dist/audit-export/index.js +2 -2
  38. package/dist/background-tasks/d1-storage.d.ts +4 -3
  39. package/dist/background-tasks/d1-storage.d.ts.map +1 -1
  40. package/dist/background-tasks/d1-storage.js +7 -13
  41. package/dist/background-tasks/d1-storage.js.map +1 -1
  42. package/dist/do-runner/constants.d.ts +3 -0
  43. package/dist/do-runner/constants.d.ts.map +1 -0
  44. package/dist/do-runner/constants.js +3 -0
  45. package/dist/do-runner/constants.js.map +1 -0
  46. package/dist/do-runner/d1-storage.d.ts +31 -157
  47. package/dist/do-runner/d1-storage.d.ts.map +1 -1
  48. package/dist/do-runner/d1-storage.js +933 -402
  49. package/dist/do-runner/d1-storage.js.map +1 -1
  50. package/dist/do-runner/durable-object.d.ts.map +1 -1
  51. package/dist/do-runner/durable-object.js +462 -175
  52. package/dist/do-runner/durable-object.js.map +1 -1
  53. package/dist/do-runner/execution-admission.d.ts +114 -0
  54. package/dist/do-runner/execution-admission.d.ts.map +1 -0
  55. package/dist/do-runner/execution-admission.js +206 -0
  56. package/dist/do-runner/execution-admission.js.map +1 -0
  57. package/dist/do-runner/execution-context.d.ts.map +1 -1
  58. package/dist/do-runner/execution-context.js +1 -0
  59. package/dist/do-runner/execution-context.js.map +1 -1
  60. package/dist/do-runner/execution-fence.d.ts +74 -30
  61. package/dist/do-runner/execution-fence.d.ts.map +1 -1
  62. package/dist/do-runner/execution-fence.js +684 -120
  63. package/dist/do-runner/execution-fence.js.map +1 -1
  64. package/dist/do-runner/fenced-workflow-capability.d.ts +64 -0
  65. package/dist/do-runner/fenced-workflow-capability.d.ts.map +1 -0
  66. package/dist/do-runner/fenced-workflow-capability.js +3 -0
  67. package/dist/do-runner/fenced-workflow-capability.js.map +1 -0
  68. package/dist/do-runner/fenced-workflows-d1.d.ts +15 -0
  69. package/dist/do-runner/fenced-workflows-d1.d.ts.map +1 -0
  70. package/dist/do-runner/fenced-workflows-d1.js +894 -0
  71. package/dist/do-runner/fenced-workflows-d1.js.map +1 -0
  72. package/dist/do-runner/index.d.ts +13 -8
  73. package/dist/do-runner/index.d.ts.map +1 -1
  74. package/dist/do-runner/index.js +6 -2
  75. package/dist/do-runner/index.js.map +1 -1
  76. package/dist/do-runner/initial-admission-refusal.d.ts +7 -0
  77. package/dist/do-runner/initial-admission-refusal.d.ts.map +1 -0
  78. package/dist/do-runner/initial-admission-refusal.js +41 -0
  79. package/dist/do-runner/initial-admission-refusal.js.map +1 -0
  80. package/dist/do-runner/inventory.d.ts +2 -1
  81. package/dist/do-runner/inventory.d.ts.map +1 -1
  82. package/dist/do-runner/inventory.js +28 -39
  83. package/dist/do-runner/inventory.js.map +1 -1
  84. package/dist/do-runner/notification-predicate.d.ts +7 -7
  85. package/dist/do-runner/notification-predicate.d.ts.map +1 -1
  86. package/dist/do-runner/notification-predicate.js +134 -7
  87. package/dist/do-runner/notification-predicate.js.map +1 -1
  88. package/dist/do-runner/run-lifecycle.d.ts +20 -1
  89. package/dist/do-runner/run-lifecycle.d.ts.map +1 -1
  90. package/dist/do-runner/run-lifecycle.js +67 -13
  91. package/dist/do-runner/run-lifecycle.js.map +1 -1
  92. package/dist/do-runner/run-provenance.d.ts +38 -0
  93. package/dist/do-runner/run-provenance.d.ts.map +1 -0
  94. package/dist/do-runner/run-provenance.js +152 -0
  95. package/dist/do-runner/run-provenance.js.map +1 -0
  96. package/dist/do-runner/run-storage-tables.d.ts +2 -0
  97. package/dist/do-runner/run-storage-tables.d.ts.map +1 -0
  98. package/dist/do-runner/run-storage-tables.js +4 -0
  99. package/dist/do-runner/run-storage-tables.js.map +1 -0
  100. package/dist/do-runner/run-terminal-state.d.ts +29 -0
  101. package/dist/do-runner/run-terminal-state.d.ts.map +1 -0
  102. package/dist/do-runner/run-terminal-state.js +105 -0
  103. package/dist/do-runner/run-terminal-state.js.map +1 -0
  104. package/dist/do-runner/runtime.d.ts +108 -46
  105. package/dist/do-runner/runtime.d.ts.map +1 -1
  106. package/dist/do-runner/runtime.js +927 -438
  107. package/dist/do-runner/runtime.js.map +1 -1
  108. package/dist/do-runner/start-idempotency.d.ts +35 -258
  109. package/dist/do-runner/start-idempotency.d.ts.map +1 -1
  110. package/dist/do-runner/start-idempotency.js +602 -494
  111. package/dist/do-runner/start-idempotency.js.map +1 -1
  112. package/dist/do-runner/start-reservation-contract.d.ts +103 -0
  113. package/dist/do-runner/start-reservation-contract.d.ts.map +1 -0
  114. package/dist/do-runner/start-reservation-contract.js +338 -0
  115. package/dist/do-runner/start-reservation-contract.js.map +1 -0
  116. package/dist/do-runner/suspension-deadline.d.ts +4 -11
  117. package/dist/do-runner/suspension-deadline.d.ts.map +1 -1
  118. package/dist/do-runner/suspension-deadline.js +8 -12
  119. package/dist/do-runner/suspension-deadline.js.map +1 -1
  120. package/dist/do-runner/table-prefix.d.ts.map +1 -1
  121. package/dist/do-runner/table-prefix.js +2 -1
  122. package/dist/do-runner/table-prefix.js.map +1 -1
  123. package/dist/do-runner/testing.d.ts +3 -0
  124. package/dist/do-runner/testing.d.ts.map +1 -0
  125. package/dist/do-runner/testing.js +3 -0
  126. package/dist/do-runner/testing.js.map +1 -0
  127. package/dist/do-runner/thread-do.d.ts +2 -1
  128. package/dist/do-runner/thread-do.d.ts.map +1 -1
  129. package/dist/do-runner/thread-do.js +14 -10
  130. package/dist/do-runner/thread-do.js.map +1 -1
  131. package/dist/do-runner/workflow-snapshot-row.d.ts +49 -0
  132. package/dist/do-runner/workflow-snapshot-row.d.ts.map +1 -0
  133. package/dist/do-runner/workflow-snapshot-row.js +97 -0
  134. package/dist/do-runner/workflow-snapshot-row.js.map +1 -0
  135. package/dist/goals/objective-routes.d.ts +1 -5
  136. package/dist/goals/objective-routes.d.ts.map +1 -1
  137. package/dist/goals/objective-routes.js +32 -53
  138. package/dist/goals/objective-routes.js.map +1 -1
  139. package/dist/host-kit/approval-bridge.d.ts.map +1 -1
  140. package/dist/host-kit/approval-bridge.js +10 -7
  141. package/dist/host-kit/approval-bridge.js.map +1 -1
  142. package/dist/host-kit/do-response.d.ts +16 -0
  143. package/dist/host-kit/do-response.d.ts.map +1 -1
  144. package/dist/host-kit/do-response.js +181 -0
  145. package/dist/host-kit/do-response.js.map +1 -1
  146. package/dist/host-kit/do-run-topology.d.ts +2 -14
  147. package/dist/host-kit/do-run-topology.d.ts.map +1 -1
  148. package/dist/host-kit/do-run-topology.js +31 -24
  149. package/dist/host-kit/do-run-topology.js.map +1 -1
  150. package/dist/host-kit/env-vars.d.ts.map +1 -1
  151. package/dist/host-kit/env-vars.js +5 -6
  152. package/dist/host-kit/env-vars.js.map +1 -1
  153. package/dist/host-kit/flowsafe-worker.d.ts +38 -6
  154. package/dist/host-kit/flowsafe-worker.d.ts.map +1 -1
  155. package/dist/host-kit/flowsafe-worker.js +110 -93
  156. package/dist/host-kit/flowsafe-worker.js.map +1 -1
  157. package/dist/host-kit/host-approval-service.d.ts +4 -14
  158. package/dist/host-kit/host-approval-service.d.ts.map +1 -1
  159. package/dist/host-kit/host-approval-service.js +23 -40
  160. package/dist/host-kit/host-approval-service.js.map +1 -1
  161. package/dist/host-kit/index.d.ts +7 -1
  162. package/dist/host-kit/index.d.ts.map +1 -1
  163. package/dist/host-kit/index.js +4 -0
  164. package/dist/host-kit/index.js.map +1 -1
  165. package/dist/host-kit/run-route-error.d.ts +3 -17
  166. package/dist/host-kit/run-route-error.d.ts.map +1 -1
  167. package/dist/host-kit/run-route-error.js +4 -24
  168. package/dist/host-kit/run-route-error.js.map +1 -1
  169. package/dist/host-kit/run-router.d.ts +6 -2
  170. package/dist/host-kit/run-router.d.ts.map +1 -1
  171. package/dist/host-kit/run-router.js +93 -80
  172. package/dist/host-kit/run-router.js.map +1 -1
  173. package/dist/host-kit/thread-topology.d.ts +1 -1
  174. package/dist/host-kit/thread-topology.d.ts.map +1 -1
  175. package/dist/host-kit/thread-topology.js +7 -3
  176. package/dist/host-kit/thread-topology.js.map +1 -1
  177. package/dist/internal-error-response.d.ts.map +1 -1
  178. package/dist/internal-error-response.js +16 -6
  179. package/dist/internal-error-response.js.map +1 -1
  180. package/dist/schedules/index.d.ts +1 -0
  181. package/dist/schedules/index.d.ts.map +1 -1
  182. package/dist/schedules/index.js +1 -7
  183. package/dist/schedules/index.js.map +1 -1
  184. package/dist/schedules/mutation-contract.d.ts +38 -0
  185. package/dist/schedules/mutation-contract.d.ts.map +1 -0
  186. package/dist/schedules/mutation-contract.js +21 -0
  187. package/dist/schedules/mutation-contract.js.map +1 -0
  188. package/dist/schedules/router.d.ts +11 -19
  189. package/dist/schedules/router.d.ts.map +1 -1
  190. package/dist/schedules/router.js +130 -49
  191. package/dist/schedules/router.js.map +1 -1
  192. package/dist/schedules/schedules-d1.d.ts +11 -5
  193. package/dist/schedules/schedules-d1.d.ts.map +1 -1
  194. package/dist/schedules/schedules-d1.js +570 -143
  195. package/dist/schedules/schedules-d1.js.map +1 -1
  196. package/dist/schedules/storage.d.ts +0 -7
  197. package/dist/schedules/storage.d.ts.map +1 -1
  198. package/dist/schedules/storage.js +0 -27
  199. package/dist/schedules/storage.js.map +1 -1
  200. package/dist/schedules/tick.d.ts.map +1 -1
  201. package/dist/schedules/tick.js +7 -1
  202. package/dist/schedules/tick.js.map +1 -1
  203. package/dist/signal-providers/webhook-route.d.ts +1 -1
  204. package/dist/signal-providers/webhook-route.d.ts.map +1 -1
  205. package/dist/signal-providers/webhook-route.js +99 -109
  206. package/dist/signal-providers/webhook-route.js.map +1 -1
  207. package/dist/signals/d1-shared.d.ts +11 -8
  208. package/dist/signals/d1-shared.d.ts.map +1 -1
  209. package/dist/signals/d1-shared.js +1 -6
  210. package/dist/signals/d1-shared.js.map +1 -1
  211. package/dist/signals/index.d.ts +1 -1
  212. package/dist/signals/index.d.ts.map +1 -1
  213. package/dist/signals/index.js +1 -1
  214. package/dist/signals/index.js.map +1 -1
  215. package/dist/signals/notification-dispatch.d.ts +96 -5
  216. package/dist/signals/notification-dispatch.d.ts.map +1 -1
  217. package/dist/signals/notification-dispatch.js +418 -53
  218. package/dist/signals/notification-dispatch.js.map +1 -1
  219. package/dist/signals/notifications-d1.d.ts +6 -1
  220. package/dist/signals/notifications-d1.d.ts.map +1 -1
  221. package/dist/signals/notifications-d1.js +215 -10
  222. package/dist/signals/notifications-d1.js.map +1 -1
  223. package/dist/signals/router.d.ts +6 -4
  224. package/dist/signals/router.d.ts.map +1 -1
  225. package/dist/signals/router.js +49 -84
  226. package/dist/signals/router.js.map +1 -1
  227. package/dist/signals/thread-do-routes.d.ts +2 -0
  228. package/dist/signals/thread-do-routes.d.ts.map +1 -1
  229. package/dist/signals/thread-do-routes.js +252 -73
  230. package/dist/signals/thread-do-routes.js.map +1 -1
  231. package/package.json +6 -3
  232. package/patches/@mastra__core@1.53.0.patch +54 -0
  233. package/scripts/seed-deployment-identity.mjs +12 -5
@@ -1 +1 @@
1
- {"version":3,"file":"durable-agent-runner.d.ts","sourceRoot":"","sources":["../../src/agent-runner/durable-agent-runner.ts"],"names":[],"mappings":"AAqOA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,qBAAqB,EAI1B,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAG/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIlD,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,yBAAyB,CAAC;AAMvE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAM/E,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,+BAA+B,EAAE,KAAK,CAAC;CACjD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;;;;;OAQG;cACsB,eAAe,CACtC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,2BAA2B,GACzC,OAAO,CAAC,IAAI,CAAC;CA6FjB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,OAAO,GAAG,SAAS,EAEnB,OAAO,EAAE,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,GAC9D,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAYjD"}
@@ -195,16 +195,70 @@
195
195
  // caveat as getWorkflow() returning a startable object, and reaching it takes a
196
196
  // deliberate private cast, which is a first-party act.
197
197
  //
198
- // Corroboration: breakwater's guarded handle reaches the same verdict on seven
199
- // of the eight members blocked here that live on Agent.prototype — network,
200
- // resumeNetwork, approveNetworkToolCall, declineNetworkToolCall,
201
- // generateLegacy, streamLegacy and sendToolApproval are all
202
- // `intentionallyUnavailable` (packages/breakwater/src/agent/agent.test.ts:824).
203
- // It diverges on listSuspendedRuns (:955), which it files under
204
- // `explicitlyNonExecution` — the same divergence as listActiveRuns (:935), and
205
- // for the same reason: a narrowed HANDLE can only omit, so a data-returning
206
- // member is harmless there, while an INSTANCE Mastra calls in-process must
207
- // throw.
198
+ // Corroboration: breakwater's guarded handle reaches the same verdict on the
199
+ // network four (network, resumeNetwork, approveNetworkToolCall,
200
+ // declineNetworkToolCall), the legacy pair (generateLegacy, streamLegacy) and
201
+ // sendToolApproval, which it files `intentionallyUnavailable`
202
+ // (packages/breakwater/src/agent/agent.test.ts). It diverges on
203
+ // listSuspendedRuns, which it files under `explicitlyNonExecution` — the same
204
+ // divergence as listActiveRuns, and for the same reason: a
205
+ // narrowed HANDLE can only omit, so a data-returning member is harmless there,
206
+ // while an INSTANCE Mastra calls in-process must throw. The two members
207
+ // blocked below for newer cores diverge the same way; each entry records it.
208
+ //
209
+ // Two more Agent-level members are blocked for cores NEWER than the pin. Read
210
+ // from the @mastra/core 1.67.0 dist, which the mastra-compat canary installs;
211
+ // offsets here are 1.67.0-vintage, in agent-Dk0N0Nlg.js unless another file is
212
+ // named, and the 1.53.0 offsets above are left as the provenance of that read.
213
+ // The pinned peer exposes neither member, so on 1.53.0 each refusal stands
214
+ // where the base would have raised a TypeError, and shadows a real
215
+ // implementation only once the peer moves.
216
+ //
217
+ // - listActiveThreadRuns() (:38214) is the discovery ground one scope wider
218
+ // than listActiveRuns. It takes no arguments and returns `{ runId,
219
+ // resourceId, threadId }` for every thread on the pubsub instance with a
220
+ // run in flight (storage-MbGlKLkB.js:1011-1023), and that state is keyed
221
+ // by pubsub instance rather than by agent (`#statesByPubSub`, :150, read
222
+ // through #getState :294), so it narrows by neither principal nor agent
223
+ // where the two listings above at least narrow by agentId. The in-process
224
+ // sibling getActiveThreadRunId() stays non-execution because it makes the
225
+ // caller name the (resourceId, threadId) pair: it confirms where this
226
+ // enumerates. Breakwater files it `explicitlyNonExecution`
227
+ // (agent.test.ts) for the reason it files listActiveRuns there: a
228
+ // narrowed HANDLE can only omit, so a data-returning member is harmless
229
+ // there, while an INSTANCE Mastra calls in-process must throw. Cost, stated
230
+ // rather than left to be rediscovered: core's AgentController aggregates
231
+ // this member across its backing agents
232
+ // (agent-controller-CKgKFyMR.js:5722-5725), so that aggregation now throws.
233
+ // It is already unusable over this class — the same controller calls the
234
+ // blocked sendToolApproval() at :4089 and :4118.
235
+ // - __setThreadRuntimeAgent() (:33609) installs another agent as the target
236
+ // the thread-runtime paths resolve through #getThreadRuntimeAgent()
237
+ // (:33612, `this.#threadRuntimeAgent ?? this`); the refusal in
238
+ // BLOCKED_RUN_ENTRIES names those paths, for the core it is written
239
+ // against. That is the fourth ground by installation rather than by call:
240
+ // the containment those inherited members rely on IS virtual dispatch on
241
+ // `this`, so one call moves every run those paths start onto an agent
242
+ // carrying none of these overrides — no caller-minted runId assertion, no
243
+ // executeWorkflow, no #startRequesters backstop. subscribeToThread drives
244
+ // no run of its own; the field moves its replay target all the same. It is
245
+ // public in the type surface (agent.d.ts:229 declares it with no
246
+ // modifier), so unlike getLegacyHandler it takes no private cast.
247
+ // Breakwater files it `explicitlyNonExecution` (agent.test.ts) for the
248
+ // reason it files the listings there: a narrowed HANDLE can only omit, so
249
+ // a setter is harmless there, while an INSTANCE Mastra calls in-process
250
+ // must throw.
251
+ //
252
+ // Neither carries the `override` keyword, and that is load-bearing rather than
253
+ // an oversight: TypeScript rejects `override` on a member the base does not
254
+ // declare, and 1.53.0 declares neither, so the keyword would fail the pinned
255
+ // typecheck that gates every merge. Each signature must still satisfy the base
256
+ // it acquires on newest; the caveat on each member says how. Both re-checks
257
+ // come due together, when the declared peer reaches a core that carries either
258
+ // member: the VERSION_SKEW expiry assertion in durable-agent-surface.test.ts
259
+ // goes red there, because each member's row claims the installed core carries
260
+ // it on neither prototype. That message speaks about the row alone; these two
261
+ // members' keyword and signature move with it.
208
262
  //
209
263
  // Blocking them keeps the single-resume and no-capability guarantees true by
210
264
  // construction: resumeViaRuntime() is the ONLY way a run resumes.
@@ -229,7 +283,17 @@
229
283
  import { isMastraSignalMessage, MessageList, mastraDBMessageToSignal, } from '@mastra/core/agent';
230
284
  import { DurableAgent, globalRunRegistry, prepareForDurableExecution, } from '@mastra/core/agent/durable';
231
285
  import { isExecutionPrincipalId, isExecutionPrincipalKind, } from '../approval-api/principal.js';
232
- import { InvalidRunRequestError, isPathSafeId, } from '../do-runner/index.js';
286
+ import { normalizeMutationEpoch, normalizeStartIdentity, } from '../do-runner/execution-admission.js';
287
+ import { InvalidRunRequestError, isPathSafeId, RunStateUnreadableError, } from '../do-runner/index.js';
288
+ import { resourceIdFromKey } from '../do-runner/memory-id.js';
289
+ import { captureReservation, } from '../do-runner/start-reservation-contract.js';
290
+ /** @internal A coherent snapshot belongs to another agent or thread. */
291
+ export class AgentRunSelectorMismatchError extends RunStateUnreadableError {
292
+ constructor(workflowId, runId) {
293
+ super(workflowId, runId);
294
+ this.name = 'AgentRunSelectorMismatchError';
295
+ }
296
+ }
233
297
  /**
234
298
  * The shared workflow id every durable-agent loop compiles to (core's
235
299
  * DurableAgentDefaults.AGENTIC_LOOP). Exposed so hosts and tests can reference
@@ -245,6 +309,77 @@ const UNREGISTERED_RUN_REFUSAL_PREFIX = 'Flowsafe durable-agent runner refused u
245
309
  */
246
310
  export const FLOWSAFE_PERSISTENCE_FORBIDDEN = 'flowsafe.persistence-forbidden';
247
311
  const BREAKWATER_GUARDED_AGENT_HOST_PROTOCOL = Symbol.for('@proofoftech/breakwater/guarded-agent-host/v1');
312
+ function captureAgentStartAuthority(source, requestedBy, requestedByKind) {
313
+ if (source === null || typeof source !== 'object' || Array.isArray(source)) {
314
+ throw new InvalidRunRequestError('agent start authority is required');
315
+ }
316
+ const { mutationEpoch: rawEpoch, startIdentity: rawIdentity, agentStart: rawAgentStart, onPreparedStartIdentity, runOwnerGuard: rawGuard, startReservation: rawReservation, } = source;
317
+ if (rawIdentity === undefined ||
318
+ rawAgentStart === undefined ||
319
+ !Object.hasOwn(source, 'onPreparedStartIdentity')) {
320
+ throw new InvalidRunRequestError('agent start authority is incomplete');
321
+ }
322
+ const startReservation = rawReservation === undefined
323
+ ? undefined
324
+ : captureReservation(rawReservation, 'started');
325
+ const mutationEpoch = normalizeMutationEpoch(rawEpoch);
326
+ const identity = normalizeStartIdentity(rawIdentity);
327
+ if (identity.target.kind !== 'agent') {
328
+ throw new InvalidRunRequestError('agent start authority requires an agent target');
329
+ }
330
+ if (identity.owner.id !== requestedBy ||
331
+ identity.owner.kind !== requestedByKind) {
332
+ throw new InvalidRunRequestError('startIdentity owner does not match requester');
333
+ }
334
+ if (rawAgentStart === null ||
335
+ typeof rawAgentStart !== 'object' ||
336
+ Array.isArray(rawAgentStart)) {
337
+ throw new InvalidRunRequestError('agentStart is malformed');
338
+ }
339
+ const { threaded } = rawAgentStart;
340
+ if (typeof threaded !== 'boolean') {
341
+ throw new InvalidRunRequestError('agentStart is malformed');
342
+ }
343
+ if (onPreparedStartIdentity !== undefined &&
344
+ typeof onPreparedStartIdentity !== 'function') {
345
+ throw new InvalidRunRequestError('onPreparedStartIdentity is malformed');
346
+ }
347
+ let runOwnerGuard;
348
+ if (rawGuard !== undefined) {
349
+ if (rawGuard === null ||
350
+ typeof rawGuard !== 'object' ||
351
+ Array.isArray(rawGuard)) {
352
+ throw new InvalidRunRequestError('runOwnerGuard is malformed');
353
+ }
354
+ const { owner: rawOwner, reservationToken } = rawGuard;
355
+ if (rawOwner === null ||
356
+ typeof rawOwner !== 'object' ||
357
+ Array.isArray(rawOwner)) {
358
+ throw new InvalidRunRequestError('runOwnerGuard is malformed');
359
+ }
360
+ const { kind, id } = rawOwner;
361
+ if (!isExecutionPrincipalKind(kind) ||
362
+ !isExecutionPrincipalId(id) ||
363
+ !isPathSafeId(reservationToken)) {
364
+ throw new InvalidRunRequestError('runOwnerGuard is malformed');
365
+ }
366
+ runOwnerGuard = Object.freeze({
367
+ owner: Object.freeze({ kind, id }),
368
+ reservationToken,
369
+ });
370
+ }
371
+ return Object.freeze({
372
+ mutationEpoch,
373
+ startIdentity: Object.freeze({
374
+ owner: identity.owner,
375
+ target: identity.target,
376
+ }),
377
+ agentStart: Object.freeze({ threaded }),
378
+ onPreparedStartIdentity,
379
+ runOwnerGuard,
380
+ startReservation,
381
+ });
382
+ }
248
383
  function snapshotDurableCallOptions(options) {
249
384
  if (options === undefined)
250
385
  return undefined;
@@ -332,8 +467,9 @@ const THREAD_TOOL_APPROVAL_REASON = 'the messages-plus-approved branch does not
332
467
  * 3. snapshot deletion owned by deployment-scoped retention;
333
468
  * 4. a SECOND execution surface that runs the agent outside RunnerRuntime
334
469
  * entirely, or that mints a run id below the caller — the network loop's
335
- * own workflow, the legacy handler, and the thread runtime's tool-approval
336
- * continuation.
470
+ * own workflow, the legacy handler, the thread runtime's tool-approval
471
+ * continuation, and the setter that installs a different agent as the
472
+ * thread runtime's execution target.
337
473
  *
338
474
  * Deliberately NOT re-exported from `./index.js` (a named-exports-only barrel),
339
475
  * so this stays off the public `@proofoftech/flowsafe/agent-runner` subpath.
@@ -350,6 +486,7 @@ export const BLOCKED_RUN_ENTRIES = {
350
486
  declineToolCallGenerate: RESUME_FAMILY_REASON,
351
487
  listActiveRuns: "core scopes the running-run listing by agentId plus the caller's own optional thread and resource ids, never by per-principal ownership, so it bypasses the host topology's run-ownership checks and returns run, thread and resource ids the caller does not own",
352
488
  listSuspendedRuns: "core scopes the suspended-run listing by agentId plus the caller's own optional thread and resource ids, never by per-principal ownership, so it bypasses the host topology's run-ownership checks and returns run, thread and resource ids the caller does not own",
489
+ listActiveThreadRuns: 'core scopes the active thread-run listing by nothing at all: it takes no arguments and returns the run, thread and resource ids of every thread on the pubsub instance with a run in flight, which core keys by pubsub instance rather than by agent, so it enumerates ids across every principal AND every agent that shares the instance',
353
490
  deleteRunSnapshots: 'durable-agent snapshot rows are retained until deployment-scoped retention purge removes them',
354
491
  network: `${NETWORK_FAMILY_REASON}, and it mints an unowned run id when the caller omits one`,
355
492
  resumeNetwork: NETWORK_FAMILY_REASON,
@@ -358,6 +495,7 @@ export const BLOCKED_RUN_ENTRIES = {
358
495
  generateLegacy: LEGACY_FAMILY_REASON,
359
496
  streamLegacy: LEGACY_FAMILY_REASON,
360
497
  sendToolApproval: THREAD_TOOL_APPROVAL_REASON,
498
+ __setThreadRuntimeAgent: "it installs the agent the thread-runtime paths resolve their target through — on @mastra/core 1.67.0 these are subscribeToThread, claimThreadOwnership, sendMessage, queueMessage, sendStateSignal, sendNotificationSignal and sendSignal, which read the field it writes — so one call moves every run those paths start, and subscribeToThread's replay target with them, onto an agent that carries none of this class's overrides: no caller-minted run id, no executeWorkflow, and no terminal refusal for a run the host start seam never registered",
361
499
  };
362
500
  /**
363
501
  * The refusal every blocked run entry point throws. A plain `Error`, not
@@ -444,6 +582,7 @@ export class FlowsafeDurableAgent extends DurableAgent {
444
582
  * `finally`, so nothing outlives the start it belongs to.
445
583
  */
446
584
  #startIdempotencyKeys = new Map();
585
+ #startAuthorities = new Map();
447
586
  #startScheduleDispatches = new Map();
448
587
  // The host's exact options object receives one private, single-use re-entry ticket.
449
588
  #hostStreamTickets = new WeakSet();
@@ -501,13 +640,17 @@ export class FlowsafeDurableAgent extends DurableAgent {
501
640
  * consumption make that exemption unavailable to callers.
502
641
  */
503
642
  #assertRunIdNotLive(runId) {
504
- if (this.#startRequesters.has(runId) ||
505
- this.#persistenceWaiters.has(runId) ||
506
- globalRunRegistry.has(runId) ||
507
- this.runRegistryInternal.has(runId)) {
643
+ if (this.isRunLive(runId)) {
508
644
  throw new InvalidRunRequestError('run id is live in the run registry — a registered run cannot be re-entered');
509
645
  }
510
646
  }
647
+ /** @internal */
648
+ isRunLive(runId) {
649
+ return (this.#startRequesters.has(runId) ||
650
+ this.#persistenceWaiters.has(runId) ||
651
+ globalRunRegistry.has(runId) ||
652
+ this.runRegistryInternal.has(runId));
653
+ }
511
654
  #assertGuardedStructuredOutput(options) {
512
655
  if (this.#isBreakwaterGuardedAgent &&
513
656
  options !== null &&
@@ -567,7 +710,7 @@ export class FlowsafeDurableAgent extends DurableAgent {
567
710
  * core, because core owns the call between `stream()` and
568
711
  * `executeWorkflow()` and carries no field this could ride in.
569
712
  */
570
- idempotencyKey) {
713
+ idempotencyKey, authority) {
571
714
  const callOptions = snapshotDurableCallOptions(options);
572
715
  this.#assertCallerRunId(callOptions?.runId);
573
716
  this.#assertGuardedStructuredOutput(callOptions);
@@ -580,6 +723,20 @@ export class FlowsafeDurableAgent extends DurableAgent {
580
723
  if (!isExecutionPrincipalKind(requestedByKind)) {
581
724
  throw new InvalidRunRequestError('requestedByKind is malformed');
582
725
  }
726
+ const capturedAuthority = captureAgentStartAuthority(authority, requestedBy, requestedByKind);
727
+ let capturedScheduleDispatch;
728
+ if (scheduleDispatch !== undefined) {
729
+ if (scheduleDispatch === null ||
730
+ typeof scheduleDispatch !== 'object' ||
731
+ Array.isArray(scheduleDispatch)) {
732
+ throw new Error('stored run lifecycle is malformed');
733
+ }
734
+ const { scheduleId, dispatchId } = scheduleDispatch;
735
+ if (!isPathSafeId(scheduleId) || !isPathSafeId(dispatchId)) {
736
+ throw new Error('stored run lifecycle is malformed');
737
+ }
738
+ capturedScheduleDispatch = Object.freeze({ scheduleId, dispatchId });
739
+ }
583
740
  const runId = callOptions.runId;
584
741
  this.#assertRunIdNotLive(runId);
585
742
  let resolve;
@@ -593,8 +750,9 @@ export class FlowsafeDurableAgent extends DurableAgent {
593
750
  this.#startRequesters.set(runId, requestedBy);
594
751
  this.#startRequesterKinds.set(runId, requestedByKind);
595
752
  this.#startAttemptTokens.set(runId, attemptToken);
596
- if (scheduleDispatch) {
597
- this.#startScheduleDispatches.set(runId, scheduleDispatch);
753
+ this.#startAuthorities.set(runId, capturedAuthority);
754
+ if (capturedScheduleDispatch) {
755
+ this.#startScheduleDispatches.set(runId, capturedScheduleDispatch);
598
756
  }
599
757
  if (idempotencyKey !== undefined) {
600
758
  this.#startIdempotencyKeys.set(runId, idempotencyKey);
@@ -622,6 +780,7 @@ export class FlowsafeDurableAgent extends DurableAgent {
622
780
  this.#startAttemptTokens.delete(runId);
623
781
  this.#startScheduleDispatches.delete(runId);
624
782
  this.#startIdempotencyKeys.delete(runId);
783
+ this.#startAuthorities.delete(runId);
625
784
  }
626
785
  }
627
786
  /**
@@ -727,6 +886,26 @@ export class FlowsafeDurableAgent extends DurableAgent {
727
886
  async listSuspendedRuns(_options) {
728
887
  throw unavailableRunEntry('listSuspendedRuns', BLOCKED_RUN_ENTRIES.listSuspendedRuns);
729
888
  }
889
+ /**
890
+ * Refuse the thread-level run enumerator newer cores add.
891
+ * `listActiveThreadRuns()` takes no arguments and returns a runId plus the
892
+ * resourceId and threadId parsed out of the key for every thread on the
893
+ * pubsub instance with a run in flight, and core keys that state by pubsub
894
+ * instance rather than by agent — so it is the same discovery ground as
895
+ * {@link FlowsafeDurableAgent.listActiveRuns} with the last scoping gone.
896
+ * The in-process sibling `getActiveThreadRunId()` stays inherited because it
897
+ * makes the caller name the (resourceId, threadId) pair it confirms.
898
+ *
899
+ * Signature caveat, and the reason this one is not `async`: the base declares
900
+ * it SYNCHRONOUS (`listActiveThreadRuns(): ActiveThreadRun[]`), so the
901
+ * `async … Promise<never>` shape every other refusal here carries would not
902
+ * be assignable to it. No `override` keyword either — the pinned 1.53.0
903
+ * declares no such member, and `override` on a member the base lacks is a
904
+ * type error. Both are re-checks for a peer bump.
905
+ */
906
+ listActiveThreadRuns() {
907
+ throw unavailableRunEntry('listActiveThreadRuns', BLOCKED_RUN_ENTRIES.listActiveThreadRuns);
908
+ }
730
909
  /**
731
910
  * Refuse the multi-agent network start. `network()` does not touch the
732
911
  * durable-agentic-loop at all: it compiles a SEPARATE workflow and drives it
@@ -806,6 +985,28 @@ export class FlowsafeDurableAgent extends DurableAgent {
806
985
  async sendToolApproval(_options) {
807
986
  throw unavailableRunEntry('sendToolApproval', BLOCKED_RUN_ENTRIES.sendToolApproval);
808
987
  }
988
+ /**
989
+ * Refuse the thread-runtime target swap newer cores add. It sets one private
990
+ * field that the thread-runtime paths resolve their target through, falling
991
+ * back to `this`; the refusal in `BLOCKED_RUN_ENTRIES` names those paths,
992
+ * for the core it is written against. So the containment those inherited
993
+ * members rely on is virtual dispatch on `this`, and one call to this setter
994
+ * moves every run they start, and their replay targets with them, onto an
995
+ * agent with none of these overrides in the chain. That is the fourth ground
996
+ * reached by installing a second execution surface rather than by calling
997
+ * one.
998
+ *
999
+ * Signature caveat: the parameter is `unknown` rather than core's
1000
+ * `Agent<any, any, any, any>` because the pinned 1.53.0 declares no such
1001
+ * member at all, while newest 1.x does — `unknown` is the one supertype of
1002
+ * core's parameter, so it satisfies that base without depending on method
1003
+ * bivariance, and it constrains nothing on the pin, where there is no base
1004
+ * member to satisfy. No `override` keyword, for the same reason as
1005
+ * {@link FlowsafeDurableAgent.listActiveThreadRuns}.
1006
+ */
1007
+ __setThreadRuntimeAgent(_agent) {
1008
+ throw unavailableRunEntry('__setThreadRuntimeAgent', BLOCKED_RUN_ENTRIES.__setThreadRuntimeAgent);
1009
+ }
809
1010
  /**
810
1011
  * Refuse core's terminal snapshot cleanup. Its only call sites are the base
811
1012
  * `executeWorkflow` (overridden here), the blocked `resume()` and the blocked
@@ -1079,6 +1280,133 @@ export class FlowsafeDurableAgent extends DurableAgent {
1079
1280
  clearTimeout(timeout);
1080
1281
  }
1081
1282
  }
1283
+ async authoritativeAgentStartState(expectedRuntime, threadId, runId, options) {
1284
+ const includeLegacy = options?.includeLegacy === true;
1285
+ const runtime = this.#runtime;
1286
+ const workflowId = this.getWorkflow().id;
1287
+ const agentId = this.#wrappedAgent.id;
1288
+ try {
1289
+ if (expectedRuntime !== runtime ||
1290
+ !isPathSafeId(threadId) ||
1291
+ !isPathSafeId(runId))
1292
+ throw new Error('agent observation selector is invalid');
1293
+ const state = includeLegacy
1294
+ ? await runtime.authoritativeStartState(workflowId, runId, {
1295
+ includeLegacy: true,
1296
+ })
1297
+ : await runtime.authoritativeStartState(workflowId, runId);
1298
+ if (state === null)
1299
+ return null;
1300
+ if (state.kind === 'legacy') {
1301
+ if (!includeLegacy)
1302
+ throw new Error('legacy agent observation requires explicit opt-in');
1303
+ const context = state.snapshot.requestContext;
1304
+ const input = state.snapshot.context?.input;
1305
+ const correlation = context?.['breakwater.auditContext'];
1306
+ const memory = input?.messageListState?.memoryInfo;
1307
+ const observedAgentId = input?.agentId;
1308
+ const observedThreadId = context?.threadId;
1309
+ if (!isPathSafeId(observedAgentId) || !isPathSafeId(observedThreadId))
1310
+ throw new Error('legacy agent observation identity is malformed');
1311
+ const observedResourceId = resourceIdFromKey(observedThreadId);
1312
+ if (state.address.workflowId !== workflowId ||
1313
+ state.address.runId !== runId ||
1314
+ (input?.runId !== undefined && input.runId !== runId) ||
1315
+ context?.runId !== runId ||
1316
+ context.resourceId !== observedResourceId ||
1317
+ correlation?.agentId !== observedAgentId ||
1318
+ correlation.threadId !== observedThreadId ||
1319
+ correlation.resourceId !== observedResourceId ||
1320
+ (memory !== null &&
1321
+ (memory?.threadId !== observedThreadId ||
1322
+ memory.resourceId !== observedResourceId)))
1323
+ throw new Error('legacy agent observation context contradicts identity');
1324
+ if (observedAgentId !== agentId || observedThreadId !== threadId)
1325
+ throw new AgentRunSelectorMismatchError(workflowId, runId);
1326
+ return { ...state, threaded: memory !== null };
1327
+ }
1328
+ const identity = state.provenance.startIdentity;
1329
+ const threaded = state.provenance.agentStart?.threaded;
1330
+ if (identity?.target.kind !== 'agent' ||
1331
+ typeof threaded !== 'boolean' ||
1332
+ state.execution.workflowId !== workflowId ||
1333
+ state.execution.runId !== runId)
1334
+ throw new Error('agent observation identity is malformed');
1335
+ const observedAgentId = identity.target.id;
1336
+ const observedThreadId = identity.target.threadId;
1337
+ const observedResourceId = resourceIdFromKey(observedThreadId);
1338
+ const context = state.snapshot.requestContext;
1339
+ const record = (value) => {
1340
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
1341
+ throw new Error('agent observation context is malformed');
1342
+ return value;
1343
+ };
1344
+ const check = (value, selectors) => {
1345
+ if (value === undefined)
1346
+ return;
1347
+ const values = record(value);
1348
+ for (const [key, expected] of Object.entries(selectors))
1349
+ if (Object.hasOwn(values, key) && values[key] !== expected)
1350
+ throw new Error('agent observation context contradicts identity');
1351
+ };
1352
+ check(context, {
1353
+ runId,
1354
+ threadId: observedThreadId,
1355
+ resourceId: observedResourceId,
1356
+ });
1357
+ check(context?.['breakwater.auditContext'], {
1358
+ agentId: observedAgentId,
1359
+ threadId: observedThreadId,
1360
+ resourceId: observedResourceId,
1361
+ });
1362
+ const input = state.snapshot.context?.input;
1363
+ if (input !== undefined) {
1364
+ check(input, { agentId: observedAgentId, runId });
1365
+ const messageList = record(input).messageListState;
1366
+ if (messageList !== undefined) {
1367
+ const values = record(messageList);
1368
+ if (Object.hasOwn(values, 'memoryInfo')) {
1369
+ const memory = values.memoryInfo;
1370
+ if (memory === null) {
1371
+ if (threaded)
1372
+ throw new Error('agent mode contradicts memory');
1373
+ }
1374
+ else {
1375
+ const selected = record(memory);
1376
+ if (!threaded ||
1377
+ selected.threadId !== observedThreadId ||
1378
+ selected.resourceId !== observedResourceId)
1379
+ throw new Error('agent mode contradicts memory');
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ if (observedAgentId !== agentId || observedThreadId !== threadId)
1385
+ throw new AgentRunSelectorMismatchError(workflowId, runId);
1386
+ return {
1387
+ ...state,
1388
+ execution: { ...state.execution, ...identity },
1389
+ threaded,
1390
+ };
1391
+ }
1392
+ catch (cause) {
1393
+ if (cause instanceof RunStateUnreadableError)
1394
+ throw cause;
1395
+ throw new RunStateUnreadableError(workflowId, runId, { cause });
1396
+ }
1397
+ }
1398
+ /** @internal Initial identity can correlate proof without granting replay success. */
1399
+ async proofExecutionFor(expectedRuntime, threadId, runId) {
1400
+ const state = await this.authoritativeAgentStartState(expectedRuntime, threadId, runId);
1401
+ if (state?.storage !== 'd1')
1402
+ return undefined;
1403
+ return {
1404
+ tablePrefix: state.execution.tablePrefix,
1405
+ workflowId: state.execution.workflowId,
1406
+ runId: state.execution.runId,
1407
+ startToken: state.execution.startToken,
1408
+ };
1409
+ }
1082
1410
  /**
1083
1411
  * Drive the durable-agentic-loop through RunnerRuntime instead of the base
1084
1412
  * `createRun + run.start`. stream()/generate() have already parked the
@@ -1101,13 +1429,7 @@ export class FlowsafeDurableAgent extends DurableAgent {
1101
1429
  const attemptToken = this.#startAttemptTokens.get(runId);
1102
1430
  const scheduleDispatch = this.#startScheduleDispatches.get(runId);
1103
1431
  const idempotencyKey = this.#startIdempotencyKeys.get(runId);
1104
- const startOptions = {
1105
- runId,
1106
- inputData: workflowInput,
1107
- ...(attemptToken === undefined ? {} : { attemptToken }),
1108
- ...(scheduleDispatch === undefined ? {} : { scheduleDispatch }),
1109
- ...(idempotencyKey === undefined ? {} : { idempotencyKey }),
1110
- };
1432
+ const authority = this.#startAuthorities.get(runId);
1111
1433
  if (requestedBy === undefined || requestedByKind === undefined) {
1112
1434
  if (requestedBy !== undefined || requestedByKind !== undefined) {
1113
1435
  throw new InvalidRunRequestError('requestedBy and requestedByKind must be provided together');
@@ -1133,10 +1455,30 @@ export class FlowsafeDurableAgent extends DurableAgent {
1133
1455
  throw refusal;
1134
1456
  return;
1135
1457
  }
1136
- summary = await this.#runtime.start(this.getWorkflow().id, {
1137
- ...startOptions,
1458
+ const { runId: coreRunId, agentId: coreAgentId, ...payload } = workflowInput;
1459
+ if (!authority) {
1460
+ throw new InvalidRunRequestError('registered run is missing agent start authority');
1461
+ }
1462
+ if (coreRunId !== runId ||
1463
+ authority.startIdentity.target.id !== this.#wrappedAgent.id ||
1464
+ coreAgentId !== authority.startIdentity.target.id) {
1465
+ throw new InvalidRunRequestError('Core input does not match agent start authority');
1466
+ }
1467
+ const workflow = this.getWorkflow();
1468
+ summary = await this.#runtime.start(workflow.id, {
1469
+ runId,
1470
+ inputData: { ...payload, runId: coreRunId, agentId: coreAgentId },
1471
+ ...(attemptToken === undefined ? {} : { attemptToken }),
1472
+ ...(scheduleDispatch === undefined ? {} : { scheduleDispatch }),
1473
+ ...(idempotencyKey === undefined ? {} : { idempotencyKey }),
1138
1474
  requestedBy,
1139
1475
  requestedByKind,
1476
+ mutationEpoch: authority.mutationEpoch,
1477
+ startIdentity: authority.startIdentity,
1478
+ agentStart: authority.agentStart,
1479
+ onPreparedStartIdentity: authority.onPreparedStartIdentity,
1480
+ runOwnerGuard: authority.runOwnerGuard,
1481
+ startReservation: authority.startReservation,
1140
1482
  });
1141
1483
  waiter?.resolve();
1142
1484
  }