@methodts/runtime 0.1.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 (537) hide show
  1. package/dist/__fixtures__/executor-fixtures.d.ts +10 -0
  2. package/dist/__fixtures__/executor-fixtures.d.ts.map +1 -0
  3. package/dist/__fixtures__/executor-fixtures.js +36 -0
  4. package/dist/__fixtures__/executor-fixtures.js.map +1 -0
  5. package/dist/architecture.test.d.ts +2 -0
  6. package/dist/architecture.test.d.ts.map +1 -0
  7. package/dist/architecture.test.js +143 -0
  8. package/dist/architecture.test.js.map +1 -0
  9. package/dist/config/cost-governor-config.d.ts +40 -0
  10. package/dist/config/cost-governor-config.d.ts.map +1 -0
  11. package/dist/config/cost-governor-config.js +48 -0
  12. package/dist/config/cost-governor-config.js.map +1 -0
  13. package/dist/config/index.d.ts +7 -0
  14. package/dist/config/index.d.ts.map +1 -0
  15. package/dist/config/index.js +6 -0
  16. package/dist/config/index.js.map +1 -0
  17. package/dist/config/sessions-config.d.ts +29 -0
  18. package/dist/config/sessions-config.d.ts.map +1 -0
  19. package/dist/config/sessions-config.js +37 -0
  20. package/dist/config/sessions-config.js.map +1 -0
  21. package/dist/config/strategies-config.d.ts +38 -0
  22. package/dist/config/strategies-config.d.ts.map +1 -0
  23. package/dist/config/strategies-config.js +41 -0
  24. package/dist/config/strategies-config.js.map +1 -0
  25. package/dist/cost-governor/backpressure-queue.d.ts +20 -0
  26. package/dist/cost-governor/backpressure-queue.d.ts.map +1 -0
  27. package/dist/cost-governor/backpressure-queue.js +78 -0
  28. package/dist/cost-governor/backpressure-queue.js.map +1 -0
  29. package/dist/cost-governor/backpressure-queue.test.d.ts +2 -0
  30. package/dist/cost-governor/backpressure-queue.test.d.ts.map +1 -0
  31. package/dist/cost-governor/backpressure-queue.test.js +48 -0
  32. package/dist/cost-governor/backpressure-queue.test.js.map +1 -0
  33. package/dist/cost-governor/cost-events.d.ts +65 -0
  34. package/dist/cost-governor/cost-events.d.ts.map +1 -0
  35. package/dist/cost-governor/cost-events.js +48 -0
  36. package/dist/cost-governor/cost-events.js.map +1 -0
  37. package/dist/cost-governor/cost-governor-app-id.test.d.ts +19 -0
  38. package/dist/cost-governor/cost-governor-app-id.test.d.ts.map +1 -0
  39. package/dist/cost-governor/cost-governor-app-id.test.js +201 -0
  40. package/dist/cost-governor/cost-governor-app-id.test.js.map +1 -0
  41. package/dist/cost-governor/cost-oracle-impl.d.ts +19 -0
  42. package/dist/cost-governor/cost-oracle-impl.d.ts.map +1 -0
  43. package/dist/cost-governor/cost-oracle-impl.js +52 -0
  44. package/dist/cost-governor/cost-oracle-impl.js.map +1 -0
  45. package/dist/cost-governor/estimator.d.ts +22 -0
  46. package/dist/cost-governor/estimator.d.ts.map +1 -0
  47. package/dist/cost-governor/estimator.js +119 -0
  48. package/dist/cost-governor/estimator.js.map +1 -0
  49. package/dist/cost-governor/estimator.test.d.ts +2 -0
  50. package/dist/cost-governor/estimator.test.d.ts.map +1 -0
  51. package/dist/cost-governor/estimator.test.js +141 -0
  52. package/dist/cost-governor/estimator.test.js.map +1 -0
  53. package/dist/cost-governor/index.d.ts +75 -0
  54. package/dist/cost-governor/index.d.ts.map +1 -0
  55. package/dist/cost-governor/index.js +120 -0
  56. package/dist/cost-governor/index.js.map +1 -0
  57. package/dist/cost-governor/observations-store.d.ts +49 -0
  58. package/dist/cost-governor/observations-store.d.ts.map +1 -0
  59. package/dist/cost-governor/observations-store.js +179 -0
  60. package/dist/cost-governor/observations-store.js.map +1 -0
  61. package/dist/cost-governor/observations-store.test.d.ts +2 -0
  62. package/dist/cost-governor/observations-store.test.d.ts.map +1 -0
  63. package/dist/cost-governor/observations-store.test.js +191 -0
  64. package/dist/cost-governor/observations-store.test.js.map +1 -0
  65. package/dist/cost-governor/percentile.d.ts +17 -0
  66. package/dist/cost-governor/percentile.d.ts.map +1 -0
  67. package/dist/cost-governor/percentile.js +33 -0
  68. package/dist/cost-governor/percentile.js.map +1 -0
  69. package/dist/cost-governor/percentile.test.d.ts +2 -0
  70. package/dist/cost-governor/percentile.test.d.ts.map +1 -0
  71. package/dist/cost-governor/percentile.test.js +46 -0
  72. package/dist/cost-governor/percentile.test.js.map +1 -0
  73. package/dist/cost-governor/rate-governor-impl.d.ts +73 -0
  74. package/dist/cost-governor/rate-governor-impl.d.ts.map +1 -0
  75. package/dist/cost-governor/rate-governor-impl.js +148 -0
  76. package/dist/cost-governor/rate-governor-impl.js.map +1 -0
  77. package/dist/cost-governor/signature-builder.d.ts +22 -0
  78. package/dist/cost-governor/signature-builder.d.ts.map +1 -0
  79. package/dist/cost-governor/signature-builder.js +43 -0
  80. package/dist/cost-governor/signature-builder.js.map +1 -0
  81. package/dist/cost-governor/signature-builder.test.d.ts +2 -0
  82. package/dist/cost-governor/signature-builder.test.d.ts.map +1 -0
  83. package/dist/cost-governor/signature-builder.test.js +58 -0
  84. package/dist/cost-governor/signature-builder.test.js.map +1 -0
  85. package/dist/cost-governor/token-bucket.d.ts +57 -0
  86. package/dist/cost-governor/token-bucket.d.ts.map +1 -0
  87. package/dist/cost-governor/token-bucket.js +109 -0
  88. package/dist/cost-governor/token-bucket.js.map +1 -0
  89. package/dist/cost-governor/token-bucket.test.d.ts +2 -0
  90. package/dist/cost-governor/token-bucket.test.d.ts.map +1 -0
  91. package/dist/cost-governor/token-bucket.test.js +67 -0
  92. package/dist/cost-governor/token-bucket.test.js.map +1 -0
  93. package/dist/dlq/cortex-dlq-observer.d.ts +22 -0
  94. package/dist/dlq/cortex-dlq-observer.d.ts.map +1 -0
  95. package/dist/dlq/cortex-dlq-observer.js +29 -0
  96. package/dist/dlq/cortex-dlq-observer.js.map +1 -0
  97. package/dist/dlq/dlq-observer.test.d.ts +8 -0
  98. package/dist/dlq/dlq-observer.test.d.ts.map +1 -0
  99. package/dist/dlq/dlq-observer.test.js +103 -0
  100. package/dist/dlq/dlq-observer.test.js.map +1 -0
  101. package/dist/dlq/index.d.ts +6 -0
  102. package/dist/dlq/index.d.ts.map +1 -0
  103. package/dist/dlq/index.js +6 -0
  104. package/dist/dlq/index.js.map +1 -0
  105. package/dist/event-bus/adapters.d.ts +50 -0
  106. package/dist/event-bus/adapters.d.ts.map +1 -0
  107. package/dist/event-bus/adapters.js +51 -0
  108. package/dist/event-bus/adapters.js.map +1 -0
  109. package/dist/event-bus/adapters.test.d.ts +5 -0
  110. package/dist/event-bus/adapters.test.d.ts.map +1 -0
  111. package/dist/event-bus/adapters.test.js +73 -0
  112. package/dist/event-bus/adapters.test.js.map +1 -0
  113. package/dist/event-bus/agent-event-adapter.d.ts +22 -0
  114. package/dist/event-bus/agent-event-adapter.d.ts.map +1 -0
  115. package/dist/event-bus/agent-event-adapter.js +49 -0
  116. package/dist/event-bus/agent-event-adapter.js.map +1 -0
  117. package/dist/event-bus/agent-event-adapter.test.d.ts +5 -0
  118. package/dist/event-bus/agent-event-adapter.test.d.ts.map +1 -0
  119. package/dist/event-bus/agent-event-adapter.test.js +170 -0
  120. package/dist/event-bus/agent-event-adapter.test.js.map +1 -0
  121. package/dist/event-bus/channel-sink.d.ts +71 -0
  122. package/dist/event-bus/channel-sink.d.ts.map +1 -0
  123. package/dist/event-bus/channel-sink.js +159 -0
  124. package/dist/event-bus/channel-sink.js.map +1 -0
  125. package/dist/event-bus/channel-sink.test.d.ts +5 -0
  126. package/dist/event-bus/channel-sink.test.d.ts.map +1 -0
  127. package/dist/event-bus/channel-sink.test.js +234 -0
  128. package/dist/event-bus/channel-sink.test.js.map +1 -0
  129. package/dist/event-bus/event-types.snapshot.test.d.ts +27 -0
  130. package/dist/event-bus/event-types.snapshot.test.d.ts.map +1 -0
  131. package/dist/event-bus/event-types.snapshot.test.js +165 -0
  132. package/dist/event-bus/event-types.snapshot.test.js.map +1 -0
  133. package/dist/event-bus/genesis-sink.d.ts +55 -0
  134. package/dist/event-bus/genesis-sink.d.ts.map +1 -0
  135. package/dist/event-bus/genesis-sink.js +141 -0
  136. package/dist/event-bus/genesis-sink.js.map +1 -0
  137. package/dist/event-bus/genesis-sink.test.d.ts +5 -0
  138. package/dist/event-bus/genesis-sink.test.d.ts.map +1 -0
  139. package/dist/event-bus/genesis-sink.test.js +160 -0
  140. package/dist/event-bus/genesis-sink.test.js.map +1 -0
  141. package/dist/event-bus/in-memory-event-bus.d.ts +60 -0
  142. package/dist/event-bus/in-memory-event-bus.d.ts.map +1 -0
  143. package/dist/event-bus/in-memory-event-bus.js +274 -0
  144. package/dist/event-bus/in-memory-event-bus.js.map +1 -0
  145. package/dist/event-bus/in-memory-event-bus.test.d.ts +5 -0
  146. package/dist/event-bus/in-memory-event-bus.test.d.ts.map +1 -0
  147. package/dist/event-bus/in-memory-event-bus.test.js +457 -0
  148. package/dist/event-bus/in-memory-event-bus.test.js.map +1 -0
  149. package/dist/event-bus/index.d.ts +22 -0
  150. package/dist/event-bus/index.d.ts.map +1 -0
  151. package/dist/event-bus/index.js +17 -0
  152. package/dist/event-bus/index.js.map +1 -0
  153. package/dist/event-bus/persistence-sink.d.ts +74 -0
  154. package/dist/event-bus/persistence-sink.d.ts.map +1 -0
  155. package/dist/event-bus/persistence-sink.js +193 -0
  156. package/dist/event-bus/persistence-sink.js.map +1 -0
  157. package/dist/event-bus/persistence-sink.test.d.ts +6 -0
  158. package/dist/event-bus/persistence-sink.test.d.ts.map +1 -0
  159. package/dist/event-bus/persistence-sink.test.js +319 -0
  160. package/dist/event-bus/persistence-sink.test.js.map +1 -0
  161. package/dist/event-bus/session-checkpoint-sink.d.ts +91 -0
  162. package/dist/event-bus/session-checkpoint-sink.d.ts.map +1 -0
  163. package/dist/event-bus/session-checkpoint-sink.js +107 -0
  164. package/dist/event-bus/session-checkpoint-sink.js.map +1 -0
  165. package/dist/event-bus/session-checkpoint-sink.test.d.ts +5 -0
  166. package/dist/event-bus/session-checkpoint-sink.test.d.ts.map +1 -0
  167. package/dist/event-bus/session-checkpoint-sink.test.js +215 -0
  168. package/dist/event-bus/session-checkpoint-sink.test.js.map +1 -0
  169. package/dist/event-bus/webhook-connector.d.ts +59 -0
  170. package/dist/event-bus/webhook-connector.d.ts.map +1 -0
  171. package/dist/event-bus/webhook-connector.js +191 -0
  172. package/dist/event-bus/webhook-connector.js.map +1 -0
  173. package/dist/event-bus/webhook-connector.test.d.ts +5 -0
  174. package/dist/event-bus/webhook-connector.test.d.ts.map +1 -0
  175. package/dist/event-bus/webhook-connector.test.js +214 -0
  176. package/dist/event-bus/webhook-connector.test.js.map +1 -0
  177. package/dist/executors/cortex-job-backed-executor.d.ts +137 -0
  178. package/dist/executors/cortex-job-backed-executor.d.ts.map +1 -0
  179. package/dist/executors/cortex-job-backed-executor.js +441 -0
  180. package/dist/executors/cortex-job-backed-executor.js.map +1 -0
  181. package/dist/executors/cortex-job-backed-executor.test.d.ts +13 -0
  182. package/dist/executors/cortex-job-backed-executor.test.d.ts.map +1 -0
  183. package/dist/executors/cortex-job-backed-executor.test.js +303 -0
  184. package/dist/executors/cortex-job-backed-executor.test.js.map +1 -0
  185. package/dist/executors/index.d.ts +9 -0
  186. package/dist/executors/index.d.ts.map +1 -0
  187. package/dist/executors/index.js +9 -0
  188. package/dist/executors/index.js.map +1 -0
  189. package/dist/index.d.ts +2 -0
  190. package/dist/index.d.ts.map +1 -0
  191. package/dist/index.js +13 -0
  192. package/dist/index.js.map +1 -0
  193. package/dist/ports/checkpoint-sink.d.ts +69 -0
  194. package/dist/ports/checkpoint-sink.d.ts.map +1 -0
  195. package/dist/ports/checkpoint-sink.js +16 -0
  196. package/dist/ports/checkpoint-sink.js.map +1 -0
  197. package/dist/ports/checkpoint.d.ts +68 -0
  198. package/dist/ports/checkpoint.d.ts.map +1 -0
  199. package/dist/ports/checkpoint.js +14 -0
  200. package/dist/ports/checkpoint.js.map +1 -0
  201. package/dist/ports/continuation-envelope-cross-app.test.d.ts +10 -0
  202. package/dist/ports/continuation-envelope-cross-app.test.d.ts.map +1 -0
  203. package/dist/ports/continuation-envelope-cross-app.test.js +95 -0
  204. package/dist/ports/continuation-envelope-cross-app.test.js.map +1 -0
  205. package/dist/ports/continuation-envelope.d.ts +199 -0
  206. package/dist/ports/continuation-envelope.d.ts.map +1 -0
  207. package/dist/ports/continuation-envelope.js +69 -0
  208. package/dist/ports/continuation-envelope.js.map +1 -0
  209. package/dist/ports/conversation.d.ts +64 -0
  210. package/dist/ports/conversation.d.ts.map +1 -0
  211. package/dist/ports/conversation.js +19 -0
  212. package/dist/ports/conversation.js.map +1 -0
  213. package/dist/ports/cost-oracle.d.ts +26 -0
  214. package/dist/ports/cost-oracle.d.ts.map +1 -0
  215. package/dist/ports/cost-oracle.js +9 -0
  216. package/dist/ports/cost-oracle.js.map +1 -0
  217. package/dist/ports/cross-app-invoker.d.ts +198 -0
  218. package/dist/ports/cross-app-invoker.d.ts.map +1 -0
  219. package/dist/ports/cross-app-invoker.js +157 -0
  220. package/dist/ports/cross-app-invoker.js.map +1 -0
  221. package/dist/ports/dlq-observer.d.ts +40 -0
  222. package/dist/ports/dlq-observer.d.ts.map +1 -0
  223. package/dist/ports/dlq-observer.js +20 -0
  224. package/dist/ports/dlq-observer.js.map +1 -0
  225. package/dist/ports/event-bus.d.ts +169 -0
  226. package/dist/ports/event-bus.d.ts.map +1 -0
  227. package/dist/ports/event-bus.js +20 -0
  228. package/dist/ports/event-bus.js.map +1 -0
  229. package/dist/ports/event-reader.d.ts +21 -0
  230. package/dist/ports/event-reader.d.ts.map +1 -0
  231. package/dist/ports/event-reader.js +12 -0
  232. package/dist/ports/event-reader.js.map +1 -0
  233. package/dist/ports/event-rotator.d.ts +39 -0
  234. package/dist/ports/event-rotator.d.ts.map +1 -0
  235. package/dist/ports/event-rotator.js +15 -0
  236. package/dist/ports/event-rotator.js.map +1 -0
  237. package/dist/ports/file-system.d.ts +48 -0
  238. package/dist/ports/file-system.d.ts.map +1 -0
  239. package/dist/ports/file-system.js +10 -0
  240. package/dist/ports/file-system.js.map +1 -0
  241. package/dist/ports/historical-observations.d.ts +39 -0
  242. package/dist/ports/historical-observations.d.ts.map +1 -0
  243. package/dist/ports/historical-observations.js +12 -0
  244. package/dist/ports/historical-observations.js.map +1 -0
  245. package/dist/ports/in-memory-source.d.ts +46 -0
  246. package/dist/ports/in-memory-source.d.ts.map +1 -0
  247. package/dist/ports/in-memory-source.js +69 -0
  248. package/dist/ports/in-memory-source.js.map +1 -0
  249. package/dist/ports/index.d.ts +32 -0
  250. package/dist/ports/index.d.ts.map +1 -0
  251. package/dist/ports/index.js +10 -0
  252. package/dist/ports/index.js.map +1 -0
  253. package/dist/ports/job-backed-executor.d.ts +139 -0
  254. package/dist/ports/job-backed-executor.d.ts.map +1 -0
  255. package/dist/ports/job-backed-executor.js +56 -0
  256. package/dist/ports/job-backed-executor.js.map +1 -0
  257. package/dist/ports/methodology-source.d.ts +95 -0
  258. package/dist/ports/methodology-source.d.ts.map +1 -0
  259. package/dist/ports/methodology-source.js +26 -0
  260. package/dist/ports/methodology-source.js.map +1 -0
  261. package/dist/ports/native-session-discovery.d.ts +20 -0
  262. package/dist/ports/native-session-discovery.d.ts.map +1 -0
  263. package/dist/ports/native-session-discovery.js +13 -0
  264. package/dist/ports/native-session-discovery.js.map +1 -0
  265. package/dist/ports/projection-store.d.ts +48 -0
  266. package/dist/ports/projection-store.d.ts.map +1 -0
  267. package/dist/ports/projection-store.js +17 -0
  268. package/dist/ports/projection-store.js.map +1 -0
  269. package/dist/ports/projection.d.ts +29 -0
  270. package/dist/ports/projection.d.ts.map +1 -0
  271. package/dist/ports/projection.js +13 -0
  272. package/dist/ports/projection.js.map +1 -0
  273. package/dist/ports/rate-governor.d.ts +17 -0
  274. package/dist/ports/rate-governor.d.ts.map +1 -0
  275. package/dist/ports/rate-governor.js +11 -0
  276. package/dist/ports/rate-governor.js.map +1 -0
  277. package/dist/ports/schedule-client.d.ts +29 -0
  278. package/dist/ports/schedule-client.d.ts.map +1 -0
  279. package/dist/ports/schedule-client.js +2 -0
  280. package/dist/ports/schedule-client.js.map +1 -0
  281. package/dist/ports/session-pool.d.ts +162 -0
  282. package/dist/ports/session-pool.d.ts.map +1 -0
  283. package/dist/ports/session-pool.js +21 -0
  284. package/dist/ports/session-pool.js.map +1 -0
  285. package/dist/ports/session-store-errors.d.ts +22 -0
  286. package/dist/ports/session-store-errors.d.ts.map +1 -0
  287. package/dist/ports/session-store-errors.js +29 -0
  288. package/dist/ports/session-store-errors.js.map +1 -0
  289. package/dist/ports/session-store-types.d.ts +132 -0
  290. package/dist/ports/session-store-types.d.ts.map +1 -0
  291. package/dist/ports/session-store-types.js +14 -0
  292. package/dist/ports/session-store-types.js.map +1 -0
  293. package/dist/ports/session-store.d.ts +69 -0
  294. package/dist/ports/session-store.d.ts.map +1 -0
  295. package/dist/ports/session-store.js +23 -0
  296. package/dist/ports/session-store.js.map +1 -0
  297. package/dist/ports/yaml-loader.d.ts +15 -0
  298. package/dist/ports/yaml-loader.d.ts.map +1 -0
  299. package/dist/ports/yaml-loader.js +13 -0
  300. package/dist/ports/yaml-loader.js.map +1 -0
  301. package/dist/scheduling/index.d.ts +6 -0
  302. package/dist/scheduling/index.d.ts.map +1 -0
  303. package/dist/scheduling/index.js +6 -0
  304. package/dist/scheduling/index.js.map +1 -0
  305. package/dist/scheduling/scheduled-pact.d.ts +97 -0
  306. package/dist/scheduling/scheduled-pact.d.ts.map +1 -0
  307. package/dist/scheduling/scheduled-pact.js +89 -0
  308. package/dist/scheduling/scheduled-pact.js.map +1 -0
  309. package/dist/sessions/__tests__/cognitive-modules.test.d.ts +10 -0
  310. package/dist/sessions/__tests__/cognitive-modules.test.d.ts.map +1 -0
  311. package/dist/sessions/__tests__/cognitive-modules.test.js +535 -0
  312. package/dist/sessions/__tests__/cognitive-modules.test.js.map +1 -0
  313. package/dist/sessions/__tests__/cognitive-provider.test.d.ts +13 -0
  314. package/dist/sessions/__tests__/cognitive-provider.test.d.ts.map +1 -0
  315. package/dist/sessions/__tests__/cognitive-provider.test.js +331 -0
  316. package/dist/sessions/__tests__/cognitive-provider.test.js.map +1 -0
  317. package/dist/sessions/__tests__/cognitive-sink.test.d.ts +19 -0
  318. package/dist/sessions/__tests__/cognitive-sink.test.d.ts.map +1 -0
  319. package/dist/sessions/__tests__/cognitive-sink.test.js +334 -0
  320. package/dist/sessions/__tests__/cognitive-sink.test.js.map +1 -0
  321. package/dist/sessions/__tests__/runtime-tools.test.d.ts +2 -0
  322. package/dist/sessions/__tests__/runtime-tools.test.d.ts.map +1 -0
  323. package/dist/sessions/__tests__/runtime-tools.test.js +83 -0
  324. package/dist/sessions/__tests__/runtime-tools.test.js.map +1 -0
  325. package/dist/sessions/auto-retro.d.ts +29 -0
  326. package/dist/sessions/auto-retro.d.ts.map +1 -0
  327. package/dist/sessions/auto-retro.js +181 -0
  328. package/dist/sessions/auto-retro.js.map +1 -0
  329. package/dist/sessions/auto-retro.test.d.ts +2 -0
  330. package/dist/sessions/auto-retro.test.d.ts.map +1 -0
  331. package/dist/sessions/auto-retro.test.js +361 -0
  332. package/dist/sessions/auto-retro.test.js.map +1 -0
  333. package/dist/sessions/channels.d.ts +55 -0
  334. package/dist/sessions/channels.d.ts.map +1 -0
  335. package/dist/sessions/channels.js +118 -0
  336. package/dist/sessions/channels.js.map +1 -0
  337. package/dist/sessions/channels.test.d.ts +2 -0
  338. package/dist/sessions/channels.test.d.ts.map +1 -0
  339. package/dist/sessions/channels.test.js +285 -0
  340. package/dist/sessions/channels.test.js.map +1 -0
  341. package/dist/sessions/cognitive-modules.d.ts +100 -0
  342. package/dist/sessions/cognitive-modules.d.ts.map +1 -0
  343. package/dist/sessions/cognitive-modules.js +458 -0
  344. package/dist/sessions/cognitive-modules.js.map +1 -0
  345. package/dist/sessions/cognitive-provider.d.ts +42 -0
  346. package/dist/sessions/cognitive-provider.d.ts.map +1 -0
  347. package/dist/sessions/cognitive-provider.js +208 -0
  348. package/dist/sessions/cognitive-provider.js.map +1 -0
  349. package/dist/sessions/cognitive-sink.d.ts +73 -0
  350. package/dist/sessions/cognitive-sink.d.ts.map +1 -0
  351. package/dist/sessions/cognitive-sink.js +154 -0
  352. package/dist/sessions/cognitive-sink.js.map +1 -0
  353. package/dist/sessions/diagnostics.d.ts +70 -0
  354. package/dist/sessions/diagnostics.d.ts.map +1 -0
  355. package/dist/sessions/diagnostics.js +129 -0
  356. package/dist/sessions/diagnostics.js.map +1 -0
  357. package/dist/sessions/diagnostics.test.d.ts +2 -0
  358. package/dist/sessions/diagnostics.test.d.ts.map +1 -0
  359. package/dist/sessions/diagnostics.test.js +135 -0
  360. package/dist/sessions/diagnostics.test.js.map +1 -0
  361. package/dist/sessions/index.d.ts +32 -0
  362. package/dist/sessions/index.d.ts.map +1 -0
  363. package/dist/sessions/index.js +33 -0
  364. package/dist/sessions/index.js.map +1 -0
  365. package/dist/sessions/pool.d.ts +218 -0
  366. package/dist/sessions/pool.d.ts.map +1 -0
  367. package/dist/sessions/pool.js +991 -0
  368. package/dist/sessions/pool.js.map +1 -0
  369. package/dist/sessions/pool.test.d.ts +2 -0
  370. package/dist/sessions/pool.test.d.ts.map +1 -0
  371. package/dist/sessions/pool.test.js +633 -0
  372. package/dist/sessions/pool.test.js.map +1 -0
  373. package/dist/sessions/print-session.d.ts +142 -0
  374. package/dist/sessions/print-session.d.ts.map +1 -0
  375. package/dist/sessions/print-session.js +325 -0
  376. package/dist/sessions/print-session.js.map +1 -0
  377. package/dist/sessions/print-session.test.d.ts +2 -0
  378. package/dist/sessions/print-session.test.d.ts.map +1 -0
  379. package/dist/sessions/print-session.test.js +418 -0
  380. package/dist/sessions/print-session.test.js.map +1 -0
  381. package/dist/sessions/runtime-tools.d.ts +22 -0
  382. package/dist/sessions/runtime-tools.d.ts.map +1 -0
  383. package/dist/sessions/runtime-tools.js +162 -0
  384. package/dist/sessions/runtime-tools.js.map +1 -0
  385. package/dist/sessions/scope-hook.d.ts +77 -0
  386. package/dist/sessions/scope-hook.d.ts.map +1 -0
  387. package/dist/sessions/scope-hook.js +323 -0
  388. package/dist/sessions/scope-hook.js.map +1 -0
  389. package/dist/sessions/scope-hook.test.d.ts +2 -0
  390. package/dist/sessions/scope-hook.test.d.ts.map +1 -0
  391. package/dist/sessions/scope-hook.test.js +249 -0
  392. package/dist/sessions/scope-hook.test.js.map +1 -0
  393. package/dist/sessions/session-store/checkpoint-sink-impl.d.ts +16 -0
  394. package/dist/sessions/session-store/checkpoint-sink-impl.d.ts.map +1 -0
  395. package/dist/sessions/session-store/checkpoint-sink-impl.js +191 -0
  396. package/dist/sessions/session-store/checkpoint-sink-impl.js.map +1 -0
  397. package/dist/sessions/session-store/checkpoint-sink-impl.test.d.ts +5 -0
  398. package/dist/sessions/session-store/checkpoint-sink-impl.test.d.ts.map +1 -0
  399. package/dist/sessions/session-store/checkpoint-sink-impl.test.js +137 -0
  400. package/dist/sessions/session-store/checkpoint-sink-impl.test.js.map +1 -0
  401. package/dist/sessions/session-store/conformance.d.ts +59 -0
  402. package/dist/sessions/session-store/conformance.d.ts.map +1 -0
  403. package/dist/sessions/session-store/conformance.js +172 -0
  404. package/dist/sessions/session-store/conformance.js.map +1 -0
  405. package/dist/sessions/session-store/conformance.test.d.ts +7 -0
  406. package/dist/sessions/session-store/conformance.test.d.ts.map +1 -0
  407. package/dist/sessions/session-store/conformance.test.js +22 -0
  408. package/dist/sessions/session-store/conformance.test.js.map +1 -0
  409. package/dist/sessions/session-store/in-memory-session-store.d.ts +23 -0
  410. package/dist/sessions/session-store/in-memory-session-store.d.ts.map +1 -0
  411. package/dist/sessions/session-store/in-memory-session-store.js +197 -0
  412. package/dist/sessions/session-store/in-memory-session-store.js.map +1 -0
  413. package/dist/sessions/session-store/in-memory-session-store.test.d.ts +6 -0
  414. package/dist/sessions/session-store/in-memory-session-store.test.d.ts.map +1 -0
  415. package/dist/sessions/session-store/in-memory-session-store.test.js +183 -0
  416. package/dist/sessions/session-store/in-memory-session-store.test.js.map +1 -0
  417. package/dist/sessions/session-store/index.d.ts +20 -0
  418. package/dist/sessions/session-store/index.d.ts.map +1 -0
  419. package/dist/sessions/session-store/index.js +15 -0
  420. package/dist/sessions/session-store/index.js.map +1 -0
  421. package/dist/sessions/session-store/resume.d.ts +88 -0
  422. package/dist/sessions/session-store/resume.d.ts.map +1 -0
  423. package/dist/sessions/session-store/resume.js +96 -0
  424. package/dist/sessions/session-store/resume.js.map +1 -0
  425. package/dist/sessions/session-store/resume.test.d.ts +5 -0
  426. package/dist/sessions/session-store/resume.test.d.ts.map +1 -0
  427. package/dist/sessions/session-store/resume.test.js +119 -0
  428. package/dist/sessions/session-store/resume.test.js.map +1 -0
  429. package/dist/sessions/spawn-queue.d.ts +28 -0
  430. package/dist/sessions/spawn-queue.d.ts.map +1 -0
  431. package/dist/sessions/spawn-queue.js +63 -0
  432. package/dist/sessions/spawn-queue.js.map +1 -0
  433. package/dist/sessions/spawn-queue.test.d.ts +2 -0
  434. package/dist/sessions/spawn-queue.test.d.ts.map +1 -0
  435. package/dist/sessions/spawn-queue.test.js +65 -0
  436. package/dist/sessions/spawn-queue.test.js.map +1 -0
  437. package/dist/sessions/types.d.ts +16 -0
  438. package/dist/sessions/types.d.ts.map +1 -0
  439. package/dist/sessions/types.js +11 -0
  440. package/dist/sessions/types.js.map +1 -0
  441. package/dist/sessions/worktree-stale.test.d.ts +2 -0
  442. package/dist/sessions/worktree-stale.test.d.ts.map +1 -0
  443. package/dist/sessions/worktree-stale.test.js +468 -0
  444. package/dist/sessions/worktree-stale.test.js.map +1 -0
  445. package/dist/strategy/artifact-store.d.ts +12 -0
  446. package/dist/strategy/artifact-store.d.ts.map +1 -0
  447. package/dist/strategy/artifact-store.js +12 -0
  448. package/dist/strategy/artifact-store.js.map +1 -0
  449. package/dist/strategy/artifact-store.test.d.ts +2 -0
  450. package/dist/strategy/artifact-store.test.d.ts.map +1 -0
  451. package/dist/strategy/artifact-store.test.js +170 -0
  452. package/dist/strategy/artifact-store.test.js.map +1 -0
  453. package/dist/strategy/context-load-executor.d.ts +23 -0
  454. package/dist/strategy/context-load-executor.d.ts.map +1 -0
  455. package/dist/strategy/context-load-executor.js +87 -0
  456. package/dist/strategy/context-load-executor.js.map +1 -0
  457. package/dist/strategy/context-load-executor.test.d.ts +16 -0
  458. package/dist/strategy/context-load-executor.test.d.ts.map +1 -0
  459. package/dist/strategy/context-load-executor.test.js +158 -0
  460. package/dist/strategy/context-load-executor.test.js.map +1 -0
  461. package/dist/strategy/cortex-cross-app-invoker.stub.d.ts +65 -0
  462. package/dist/strategy/cortex-cross-app-invoker.stub.d.ts.map +1 -0
  463. package/dist/strategy/cortex-cross-app-invoker.stub.js +68 -0
  464. package/dist/strategy/cortex-cross-app-invoker.stub.js.map +1 -0
  465. package/dist/strategy/cross-app-node-executor.d.ts +54 -0
  466. package/dist/strategy/cross-app-node-executor.d.ts.map +1 -0
  467. package/dist/strategy/cross-app-node-executor.js +98 -0
  468. package/dist/strategy/cross-app-node-executor.js.map +1 -0
  469. package/dist/strategy/cross-app-node-executor.test.d.ts +13 -0
  470. package/dist/strategy/cross-app-node-executor.test.d.ts.map +1 -0
  471. package/dist/strategy/cross-app-node-executor.test.js +160 -0
  472. package/dist/strategy/cross-app-node-executor.test.js.map +1 -0
  473. package/dist/strategy/gates.d.ts +13 -0
  474. package/dist/strategy/gates.d.ts.map +1 -0
  475. package/dist/strategy/gates.js +13 -0
  476. package/dist/strategy/gates.js.map +1 -0
  477. package/dist/strategy/gates.test.d.ts +2 -0
  478. package/dist/strategy/gates.test.d.ts.map +1 -0
  479. package/dist/strategy/gates.test.js +299 -0
  480. package/dist/strategy/gates.test.js.map +1 -0
  481. package/dist/strategy/human-approval-resolver.d.ts +23 -0
  482. package/dist/strategy/human-approval-resolver.d.ts.map +1 -0
  483. package/dist/strategy/human-approval-resolver.js +94 -0
  484. package/dist/strategy/human-approval-resolver.js.map +1 -0
  485. package/dist/strategy/human-approval-resolver.test.d.ts +16 -0
  486. package/dist/strategy/human-approval-resolver.test.d.ts.map +1 -0
  487. package/dist/strategy/human-approval-resolver.test.js +200 -0
  488. package/dist/strategy/human-approval-resolver.test.js.map +1 -0
  489. package/dist/strategy/in-process-cross-app-invoker.d.ts +105 -0
  490. package/dist/strategy/in-process-cross-app-invoker.d.ts.map +1 -0
  491. package/dist/strategy/in-process-cross-app-invoker.js +206 -0
  492. package/dist/strategy/in-process-cross-app-invoker.js.map +1 -0
  493. package/dist/strategy/in-process-cross-app-invoker.test.d.ts +15 -0
  494. package/dist/strategy/in-process-cross-app-invoker.test.d.ts.map +1 -0
  495. package/dist/strategy/in-process-cross-app-invoker.test.js +190 -0
  496. package/dist/strategy/in-process-cross-app-invoker.test.js.map +1 -0
  497. package/dist/strategy/index.d.ts +29 -0
  498. package/dist/strategy/index.d.ts.map +1 -0
  499. package/dist/strategy/index.js +29 -0
  500. package/dist/strategy/index.js.map +1 -0
  501. package/dist/strategy/pacta-strategy.d.ts +97 -0
  502. package/dist/strategy/pacta-strategy.d.ts.map +1 -0
  503. package/dist/strategy/pacta-strategy.js +117 -0
  504. package/dist/strategy/pacta-strategy.js.map +1 -0
  505. package/dist/strategy/pacta-strategy.test.d.ts +2 -0
  506. package/dist/strategy/pacta-strategy.test.d.ts.map +1 -0
  507. package/dist/strategy/pacta-strategy.test.js +234 -0
  508. package/dist/strategy/pacta-strategy.test.js.map +1 -0
  509. package/dist/strategy/retro-generator.d.ts +18 -0
  510. package/dist/strategy/retro-generator.d.ts.map +1 -0
  511. package/dist/strategy/retro-generator.js +22 -0
  512. package/dist/strategy/retro-generator.js.map +1 -0
  513. package/dist/strategy/retro-writer.d.ts +25 -0
  514. package/dist/strategy/retro-writer.d.ts.map +1 -0
  515. package/dist/strategy/retro-writer.js +65 -0
  516. package/dist/strategy/retro-writer.js.map +1 -0
  517. package/dist/strategy/strategy-executor.d.ts +39 -0
  518. package/dist/strategy/strategy-executor.d.ts.map +1 -0
  519. package/dist/strategy/strategy-executor.js +253 -0
  520. package/dist/strategy/strategy-executor.js.map +1 -0
  521. package/dist/strategy/strategy-executor.test.d.ts +8 -0
  522. package/dist/strategy/strategy-executor.test.d.ts.map +1 -0
  523. package/dist/strategy/strategy-executor.test.js +1301 -0
  524. package/dist/strategy/strategy-executor.test.js.map +1 -0
  525. package/dist/strategy/strategy-parser.d.ts +30 -0
  526. package/dist/strategy/strategy-parser.d.ts.map +1 -0
  527. package/dist/strategy/strategy-parser.js +30 -0
  528. package/dist/strategy/strategy-parser.js.map +1 -0
  529. package/dist/strategy/sub-strategy-source.d.ts +27 -0
  530. package/dist/strategy/sub-strategy-source.d.ts.map +1 -0
  531. package/dist/strategy/sub-strategy-source.js +77 -0
  532. package/dist/strategy/sub-strategy-source.js.map +1 -0
  533. package/dist/strategy/types.d.ts +12 -0
  534. package/dist/strategy/types.d.ts.map +1 -0
  535. package/dist/strategy/types.js +9 -0
  536. package/dist/strategy/types.js.map +1 -0
  537. package/package.json +87 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * EventReader — cursor-based historical event replay port.
3
+ *
4
+ * Exposes historical event reading from the persistent event log for projection
5
+ * replay on startup. Implemented by PersistenceSink. Distinct from live event
6
+ * subscription (provided by EventBus) — this port is for catching up from disk.
7
+ *
8
+ * @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S3
9
+ */
10
+ import type { RuntimeEvent } from './event-bus.js';
11
+ export interface EventReader {
12
+ /**
13
+ * Read events from the persistent log where sequence > sinceSeq.
14
+ * Returns events in append order. Corrupt JSONL lines are skipped gracefully.
15
+ *
16
+ * @param sinceSeq — exclusive lower bound (returns events with sequence > sinceSeq)
17
+ * @returns events in append order
18
+ */
19
+ readEventsSince(sinceSeq: number): Promise<RuntimeEvent[]>;
20
+ }
21
+ //# sourceMappingURL=event-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-reader.d.ts","sourceRoot":"","sources":["../../src/ports/event-reader.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC5D"}
@@ -0,0 +1,12 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * EventReader — cursor-based historical event replay port.
4
+ *
5
+ * Exposes historical event reading from the persistent event log for projection
6
+ * replay on startup. Implemented by PersistenceSink. Distinct from live event
7
+ * subscription (provided by EventBus) — this port is for catching up from disk.
8
+ *
9
+ * @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S3
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=event-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-reader.js","sourceRoot":"","sources":["../../src/ports/event-reader.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;GAQG"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * EventRotator — archives events older than a cutoff window to keep the log bounded.
3
+ *
4
+ * Rotation compacts the main event log (`.method/events.jsonl`) by moving old
5
+ * events into gzipped daily archives (`.method/events.archive/YYYY-MM-DD.jsonl.gz`).
6
+ *
7
+ * Safety contract: rotation MUST NOT cross the cursor returned by safetyGuard —
8
+ * doing so would strand projection snapshots that haven't yet caught up, breaking
9
+ * their ability to recover on next restart.
10
+ *
11
+ * @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S-rotator
12
+ */
13
+ export interface EventRotator {
14
+ /** Archive events older than the cutoff, after checking rotation is safe. */
15
+ rotate(options: RotateOptions): Promise<RotateResult>;
16
+ }
17
+ export interface RotateOptions {
18
+ /** Archive events older than this many days. */
19
+ readonly olderThanDays: number;
20
+ /**
21
+ * Safety guard — returns the lowest cursor below which rotation is safe.
22
+ * Returns null if rotation is unsafe at any cursor (e.g. no projections registered).
23
+ * Called by rotate() before any archive operation.
24
+ */
25
+ readonly safetyGuard: () => number | null;
26
+ }
27
+ export interface RotateResult {
28
+ /** Number of events moved to the archive file. */
29
+ readonly archivedEvents: number;
30
+ /** Path to the written archive file, or null if no events were archived. */
31
+ readonly archivePath: string | null;
32
+ /** Size of the main log after rotation, in bytes. */
33
+ readonly newLogSize: number;
34
+ /** True if the safety guard blocked rotation (archivedEvents will be 0). */
35
+ readonly skipped: boolean;
36
+ /** Human-readable reason when `skipped` is true. */
37
+ readonly skipReason?: string;
38
+ }
39
+ //# sourceMappingURL=event-rotator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-rotator.d.ts","sourceRoot":"","sources":["../../src/ports/event-rotator.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,15 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * EventRotator — archives events older than a cutoff window to keep the log bounded.
4
+ *
5
+ * Rotation compacts the main event log (`.method/events.jsonl`) by moving old
6
+ * events into gzipped daily archives (`.method/events.archive/YYYY-MM-DD.jsonl.gz`).
7
+ *
8
+ * Safety contract: rotation MUST NOT cross the cursor returned by safetyGuard —
9
+ * doing so would strand projection snapshots that haven't yet caught up, breaking
10
+ * their ability to recover on next restart.
11
+ *
12
+ * @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S-rotator
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=event-rotator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-rotator.js","sourceRoot":"","sources":["../../src/ports/event-rotator.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;GAWG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * FileSystemProvider — Port interface for filesystem operations.
3
+ *
4
+ * PRD-057 / S2 §5.3: Only the interface lives in runtime. The Node impl
5
+ * (`NodeFileSystemProvider`) stays in bridge because it binds directly to
6
+ * `node:fs` — an OS-transport dependency runtime cannot take.
7
+ */
8
+ export interface DirEntry {
9
+ name: string;
10
+ isDirectory(): boolean;
11
+ isFile(): boolean;
12
+ }
13
+ export interface FileStat {
14
+ mtimeMs: number;
15
+ mtime: Date;
16
+ size: number;
17
+ isFile(): boolean;
18
+ isDirectory(): boolean;
19
+ }
20
+ export interface FileSystemProvider {
21
+ readFileSync(path: string, encoding: BufferEncoding): string;
22
+ writeFileSync(path: string, content: string, options?: {
23
+ encoding?: BufferEncoding;
24
+ mode?: number;
25
+ }): void;
26
+ existsSync(path: string): boolean;
27
+ readdirSync(path: string): string[];
28
+ readdirSync(path: string, options: {
29
+ withFileTypes: true;
30
+ }): DirEntry[];
31
+ statSync(path: string): FileStat;
32
+ unlinkSync(path: string): void;
33
+ mkdirSync(path: string, options?: {
34
+ recursive?: boolean;
35
+ }): void;
36
+ renameSync(oldPath: string, newPath: string): void;
37
+ realpathSync(path: string): string;
38
+ readFile(path: string, encoding: BufferEncoding): Promise<string>;
39
+ writeFile(path: string, content: string, encoding: BufferEncoding): Promise<void>;
40
+ appendFile(path: string, content: string, encoding: BufferEncoding): Promise<void>;
41
+ readdir(path: string): Promise<string[]>;
42
+ stat(path: string): Promise<FileStat>;
43
+ access(path: string): Promise<void>;
44
+ mkdir(path: string, options?: {
45
+ recursive?: boolean;
46
+ }): Promise<void>;
47
+ }
48
+ //# sourceMappingURL=file-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/ports/file-system.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAIH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,IAAI,OAAO,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,IAAI,OAAO,CAAC;IAClB,WAAW,IAAI,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;IAC7D,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3G,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,GAAG,QAAQ,EAAE,CAAC;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACjC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAGnC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
@@ -0,0 +1,10 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * FileSystemProvider — Port interface for filesystem operations.
4
+ *
5
+ * PRD-057 / S2 §5.3: Only the interface lives in runtime. The Node impl
6
+ * (`NodeFileSystemProvider`) stays in bridge because it binds directly to
7
+ * `node:fs` — an OS-transport dependency runtime cannot take.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=file-system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/ports/file-system.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;GAMG"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * HistoricalObservations — Port interface (PRD 051 S5).
3
+ *
4
+ * Consumed by cost-governor domain (CostOracle reads history).
5
+ * Implemented by ObservationsStore in cost-governor domain.
6
+ */
7
+ import type { InvocationSignature, ProviderClass, AccountId } from '@methodts/types';
8
+ export interface Observation {
9
+ readonly signature: InvocationSignature;
10
+ readonly costUsd: number;
11
+ readonly durationMs: number;
12
+ readonly tokensIn: number;
13
+ readonly tokensOut: number;
14
+ readonly tokensCacheRead: number;
15
+ readonly tokensCacheWrite: number;
16
+ readonly recordedAt: number;
17
+ readonly accountId: AccountId;
18
+ readonly providerClass: ProviderClass;
19
+ readonly hmac: string;
20
+ }
21
+ /**
22
+ * Opaque capability — only the composition root creates one and
23
+ * passes it to the RateGovernor. Prevents poisoning via hostile
24
+ * strategy authors.
25
+ */
26
+ declare const __appendTokenBrand: unique symbol;
27
+ export type AppendToken = {
28
+ readonly [__appendTokenBrand]: true;
29
+ };
30
+ /** Create an AppendToken. Only call this in the composition root. */
31
+ export declare function createAppendToken(): AppendToken;
32
+ export interface HistoricalObservations {
33
+ /** Query observations matching a signature, newest first. */
34
+ query(sig: InvocationSignature, limit?: number): readonly Observation[];
35
+ /** Append an observation. Requires a capability token. */
36
+ append(obs: Omit<Observation, 'hmac'>, token: AppendToken): void;
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=historical-observations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historical-observations.d.ts","sourceRoot":"","sources":["../../src/ports/historical-observations.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;;GAIG;AACH,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAElE,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C;AAID,MAAM,WAAW,sBAAsB;IACrC,6DAA6D;IAC7D,KAAK,CAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAAC;IAExE,0DAA0D;IAC1D,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAClE"}
@@ -0,0 +1,12 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * HistoricalObservations — Port interface (PRD 051 S5).
4
+ *
5
+ * Consumed by cost-governor domain (CostOracle reads history).
6
+ * Implemented by ObservationsStore in cost-governor domain.
7
+ */
8
+ /** Create an AppendToken. Only call this in the composition root. */
9
+ export function createAppendToken() {
10
+ return Object.freeze({});
11
+ }
12
+ //# sourceMappingURL=historical-observations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historical-observations.js","sourceRoot":"","sources":["../../src/ports/historical-observations.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;GAKG;AA8BH,qEAAqE;AACrE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,EAAiB,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * InMemorySource — Test MethodologySource for port substitutability proof.
3
+ *
4
+ * WS-1 success criterion 6: "a 20-line InMemorySource for tests proves
5
+ * the port interface is a real seam, not a port-shaped wrapper."
6
+ *
7
+ * PRD-057 / S2 §5.3: promoted from bridge to runtime.
8
+ * PRD-064 / S7: gains no-op lifecycle stubs + a controllable `onChange`
9
+ * trigger (`emitChange()`) so tests can simulate methodology-update
10
+ * fan-out without a real Cortex events port.
11
+ *
12
+ * Accepts catalog entries and typed values in the constructor.
13
+ * No I/O, no external dependencies — pure data container.
14
+ */
15
+ import type { MethodologySource, MethodologyChange } from './methodology-source.js';
16
+ import type { CatalogMethodologyEntry } from '@methodts/methodts/stdlib';
17
+ import type { Method } from '@methodts/methodts';
18
+ import type { Methodology } from '@methodts/methodts';
19
+ export declare class InMemorySource implements MethodologySource {
20
+ private readonly catalog;
21
+ private readonly methods;
22
+ private readonly methodologies;
23
+ private readonly listeners;
24
+ constructor(catalog: CatalogMethodologyEntry[], methods?: Array<{
25
+ key: string;
26
+ method: Method<any>;
27
+ }>, methodologies?: Array<{
28
+ id: string;
29
+ methodology: Methodology<any>;
30
+ }>);
31
+ list(): CatalogMethodologyEntry[];
32
+ getMethod(methodologyId: string, methodId: string): Method<any> | undefined;
33
+ getMethodology(methodologyId: string): Methodology<any> | undefined;
34
+ init(): Promise<void>;
35
+ reload(_methodologyId?: string): Promise<void>;
36
+ onChange(listener: (c: MethodologyChange) => void): () => void;
37
+ close(): Promise<void>;
38
+ /**
39
+ * Test-only hook — fires `change` to every registered listener. Lets
40
+ * tests exercise `onChange`-dependent paths (e.g. routing-cache
41
+ * invalidation in `MethodologySessionStore`) without wiring a full
42
+ * Cortex events port.
43
+ */
44
+ emitChange(change: MethodologyChange): void;
45
+ }
46
+ //# sourceMappingURL=in-memory-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory-source.d.ts","sourceRoot":"","sources":["../../src/ports/in-memory-source.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,cAAe,YAAW,iBAAiB;IAQpD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IAEnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;gBAGpD,OAAO,EAAE,uBAAuB,EAAE,EAEnD,OAAO,GAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,CAAM,EAEzD,aAAa,GAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;KAAE,CAAM;IAM1E,IAAI,IAAI,uBAAuB,EAAE;IAEjC,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS;IAI3E,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS;IAM7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI;IAOxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAG5C"}
@@ -0,0 +1,69 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * InMemorySource — Test MethodologySource for port substitutability proof.
4
+ *
5
+ * WS-1 success criterion 6: "a 20-line InMemorySource for tests proves
6
+ * the port interface is a real seam, not a port-shaped wrapper."
7
+ *
8
+ * PRD-057 / S2 §5.3: promoted from bridge to runtime.
9
+ * PRD-064 / S7: gains no-op lifecycle stubs + a controllable `onChange`
10
+ * trigger (`emitChange()`) so tests can simulate methodology-update
11
+ * fan-out without a real Cortex events port.
12
+ *
13
+ * Accepts catalog entries and typed values in the constructor.
14
+ * No I/O, no external dependencies — pure data container.
15
+ */
16
+ export class InMemorySource {
17
+ catalog;
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ methods;
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ methodologies;
22
+ listeners = new Set();
23
+ constructor(catalog,
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ methods = [],
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ methodologies = []) {
28
+ this.catalog = catalog;
29
+ this.methods = new Map(methods.map(m => [m.key, m.method]));
30
+ this.methodologies = new Map(methodologies.map(m => [m.id, m.methodology]));
31
+ }
32
+ list() { return this.catalog; }
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ getMethod(methodologyId, methodId) {
35
+ return this.methods.get(`${methodologyId}/${methodId}`);
36
+ }
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ getMethodology(methodologyId) {
39
+ return this.methodologies.get(methodologyId);
40
+ }
41
+ // ── PRD-064 / S7 lifecycle stubs ──────────────────────────────────
42
+ async init() {
43
+ /* no-op — data provided via constructor */
44
+ }
45
+ async reload(_methodologyId) {
46
+ /* no-op — data provided via constructor */
47
+ }
48
+ onChange(listener) {
49
+ this.listeners.add(listener);
50
+ return () => {
51
+ this.listeners.delete(listener);
52
+ };
53
+ }
54
+ async close() {
55
+ this.listeners.clear();
56
+ }
57
+ // ── Test helper ───────────────────────────────────────────────────
58
+ /**
59
+ * Test-only hook — fires `change` to every registered listener. Lets
60
+ * tests exercise `onChange`-dependent paths (e.g. routing-cache
61
+ * invalidation in `MethodologySessionStore`) without wiring a full
62
+ * Cortex events port.
63
+ */
64
+ emitChange(change) {
65
+ for (const l of this.listeners)
66
+ l(change);
67
+ }
68
+ }
69
+ //# sourceMappingURL=in-memory-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory-source.js","sourceRoot":"","sources":["../../src/ports/in-memory-source.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;GAaG;AAUH,MAAM,OAAO,cAAc;IAQN;IAPnB,8DAA8D;IAC7C,OAAO,CAA2B;IACnD,8DAA8D;IAC7C,aAAa,CAAgC;IAC7C,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;IAEvE,YACmB,OAAkC;IACnD,8DAA8D;IAC9D,UAAuD,EAAE;IACzD,8DAA8D;IAC9D,gBAAsE,EAAE;QAJvD,YAAO,GAAP,OAAO,CAA2B;QAMnD,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,KAAgC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,8DAA8D;IAC9D,SAAS,CAAC,aAAqB,EAAE,QAAgB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,aAAa,IAAI,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,8DAA8D;IAC9D,cAAc,CAAC,aAAqB;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,qEAAqE;IAErE,KAAK,CAAC,IAAI;QACR,2CAA2C;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,cAAuB;QAClC,2CAA2C;IAC7C,CAAC;IAED,QAAQ,CAAC,QAAwC;QAC/C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,qEAAqE;IAErE;;;;;OAKG;IACH,UAAU,CAAC,MAAyB;QAClC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS;YAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ export type { FileSystemProvider, DirEntry, FileStat } from './file-system.js';
2
+ export type { YamlLoader } from './yaml-loader.js';
3
+ export type { NativeSessionDiscovery, NativeSessionInfo } from './native-session-discovery.js';
4
+ export type { MethodologySource, MethodologyChange } from './methodology-source.js';
5
+ export { InMemorySource } from './in-memory-source.js';
6
+ export type { EventBus, EventSink, EventConnector, EventFilter, EventSubscription, ConnectorHealth, RuntimeEvent, RuntimeEventInput, EventDomain, EventSeverity, StrategyGateAwaitingApprovalPayload, StrategyGateApprovalResponsePayload, } from './event-bus.js';
7
+ export type { SessionBudget, SessionChainInfo, SessionMode, IsolationMode, WorktreeAction, WorktreeInfo, SessionStatusInfo, SessionSnapshot, StreamEvent, PtySessionHandle, SessionProviderOptions, SessionProviderFactory, } from './session-pool.js';
8
+ export type { CostOracle, NodeEstimate, StrategyEstimate } from './cost-oracle.js';
9
+ export type { RuntimeRateGovernor } from './rate-governor.js';
10
+ export type { HistoricalObservations, Observation, AppendToken } from './historical-observations.js';
11
+ export { createAppendToken } from './historical-observations.js';
12
+ export type { CheckpointPort, PipelineCheckpoint, PipelineCheckpointSummary, Phase, FeatureSpec, TestableAssertion, ConversationMessage, } from './checkpoint.js';
13
+ export type { ConversationPort, AgentMessage, HumanMessage, GateDecision, GateType, SkillRequest, StructuredCard, } from './conversation.js';
14
+ export { GATE_ACTIONS } from './conversation.js';
15
+ export type { Projection } from './projection.js';
16
+ export type { ProjectionStore, StartResult } from './projection-store.js';
17
+ export type { EventReader } from './event-reader.js';
18
+ export type { EventRotator, RotateOptions, RotateResult } from './event-rotator.js';
19
+ export type { SessionStore } from './session-store.js';
20
+ export type { SessionStatus, PactRef, SessionSnapshot as PersistedSessionSnapshot, EventCursor, AgentStateBlob, BudgetReservation, NextAction, Checkpoint, CheckpointMeta, ResumeOptions, ResumeContext, } from './session-store-types.js';
21
+ export type { SessionStoreErrorCode, SessionStoreErrorOptions, } from './session-store-errors.js';
22
+ export { SessionStoreError, isSessionStoreError, } from './session-store-errors.js';
23
+ export type { CheckpointSink, CheckpointSinkOptions, CheckpointCapture, } from './checkpoint-sink.js';
24
+ export type { ContinuationEnvelope, CheckpointRef, BudgetRef, BudgetCarryStrategy, TokenContext, CrossAppContinuationContext, NextAction as ContinuationNextAction, } from './continuation-envelope.js';
25
+ export { EnvelopeVersionError, BudgetExpiredError, ENVELOPE_SIZE_SOFT_CAP_BYTES, parseContinuationEnvelope, } from './continuation-envelope.js';
26
+ export type { JobBackedExecutor, JobClient, JobHandlerCtx, PactFactory, PactStartInput, } from './job-backed-executor.js';
27
+ export { DuplicateAttachError, PactRegistrationError, BudgetStrategyNotImplemented, } from './job-backed-executor.js';
28
+ export type { DlqObserver, DlqRecord, } from './dlq-observer.js';
29
+ export type { ScheduleClient } from './schedule-client.js';
30
+ export type { CrossAppInvoker, CrossAppInvokeRequest, CrossAppInvokeResult, CrossAppInvokerCapabilities, DelegationCarry, } from './cross-app-invoker.js';
31
+ export { CrossAppNotConfiguredError, CrossAppTargetNotDeclaredError, CrossAppScopeMissingError, CrossAppDelegationDepthExceededError, CrossAppTargetError, CrossAppTargetUnknownError, NullCrossAppInvoker, CROSS_APP_DEFAULT_MAX_DELEGATION_DEPTH, assertCrossAppTargetsAllowed, } from './cross-app-invoker.js';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAG/F,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1E,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMpF,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EACV,aAAa,EACb,OAAO,EACP,eAAe,IAAI,wBAAwB,EAC3C,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAQ9B,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,2BAA2B,EAC3B,UAAU,IAAI,sBAAsB,GACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,oCAAoC,EACpC,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,10 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // PRD-057 / S2 §3.1: @methodts/runtime/ports — unified public port surface.
3
+ export { InMemorySource } from './in-memory-source.js';
4
+ export { createAppendToken } from './historical-observations.js';
5
+ export { GATE_ACTIONS } from './conversation.js';
6
+ export { SessionStoreError, isSessionStoreError, } from './session-store-errors.js';
7
+ export { EnvelopeVersionError, BudgetExpiredError, ENVELOPE_SIZE_SOFT_CAP_BYTES, parseContinuationEnvelope, } from './continuation-envelope.js';
8
+ export { DuplicateAttachError, PactRegistrationError, BudgetStrategyNotImplemented, } from './job-backed-executor.js';
9
+ export { CrossAppNotConfiguredError, CrossAppTargetNotDeclaredError, CrossAppScopeMissingError, CrossAppDelegationDepthExceededError, CrossAppTargetError, CrossAppTargetUnknownError, NullCrossAppInvoker, CROSS_APP_DEFAULT_MAX_DELEGATION_DEPTH, assertCrossAppTargetsAllowed, } from './cross-app-invoker.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAS5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAsCvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAqBjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8BjD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAsBnC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAelC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,oCAAoC,EACpC,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * JobBackedExecutor — drives a pact across worker boundaries via ctx.jobs.
3
+ *
4
+ * PRD-062 / S5 §2.2. Frozen: 2026-04-14.
5
+ *
6
+ * Owner: @methodts/runtime
7
+ * Producer: @methodts/runtime (impl: CortexJobBackedExecutor)
8
+ * Consumer: tenant app composition root (wires ctx.jobs into the executor)
9
+ *
10
+ * The tenant app never calls `enqueue`/`dispatch` directly — it registers
11
+ * the executor once (`attach(ctx.jobs)`) and the runtime internally emits
12
+ * continuations whenever a pact yields.
13
+ */
14
+ import type { Pact } from '@methodts/pacta';
15
+ import type { ContinuationEnvelope, BudgetRef, NextAction } from './continuation-envelope.js';
16
+ export interface JobBackedExecutor {
17
+ /**
18
+ * Wire the executor into a tenant's ctx.jobs. Registers exactly ONE handler
19
+ * (`method.pact.continue`) that dispatches all pact continuations for the
20
+ * entire app. Safe to call in app boot or test harnesses.
21
+ *
22
+ * Must be called before `start()`. Throws `DuplicateAttachError` if called
23
+ * twice with different `JobClient` instances.
24
+ */
25
+ attach(jobs: JobClient): Promise<void>;
26
+ /**
27
+ * Register a pact factory under a stable key. Continuations reference pacts
28
+ * by key so the envelope stays small and forward-compatible across deploys.
29
+ *
30
+ * A factory returns a `Pact` given the rehydrated input context.
31
+ */
32
+ registerPact(key: string, factory: PactFactory): void;
33
+ /**
34
+ * Start a new pact as a job-backed execution. Returns the sessionId —
35
+ * results arrive via the tenant's `events` channel, not as a return value.
36
+ *
37
+ * The first turn runs inline (attempt to complete synchronously); if the
38
+ * pact yields, subsequent turns run in jobs.
39
+ */
40
+ start(input: PactStartInput): Promise<{
41
+ sessionId: string;
42
+ traceId: string;
43
+ }>;
44
+ /**
45
+ * Emit a continuation envelope. Called internally when a pact yields.
46
+ * Surface is exposed on the port so alternative executors (testkit) can
47
+ * observe + assert on envelope emission.
48
+ */
49
+ yield(envelope: ContinuationEnvelope): Promise<void>;
50
+ /**
51
+ * Graceful shutdown: stop accepting new pacts, drain in-flight continuations
52
+ * up to `timeoutMs`, unack anything still running so SQS re-delivers.
53
+ */
54
+ stop(timeoutMs: number): Promise<void>;
55
+ }
56
+ export interface PactStartInput {
57
+ pactKey: string;
58
+ initialPrompt: string;
59
+ userSub: string;
60
+ originatingRequestId: string;
61
+ /** Hard wall-clock cap across ALL continuations. Default 24h. */
62
+ maxLifetimeMs?: number;
63
+ /**
64
+ * Budget strategy for this invocation. Defaults to `'fresh-per-continuation'`
65
+ * in Wave 1 (S5 §5). Other strategies throw `BudgetStrategyNotImplemented`
66
+ * until Cortex O1 (`ctx.llm.reserve()/settle()`) lands.
67
+ */
68
+ budgetStrategy?: 'fresh-per-continuation' | 'batched-held' | 'predictive-prereserve';
69
+ /** Per-turn budget cap (USD) for `fresh-per-continuation`. Default 2.0. */
70
+ perTurnBudgetUsd?: number;
71
+ /** Absolute deadline for the whole pact (UTC ms). Default `now + 24h`. */
72
+ expiresAt?: number;
73
+ /** Optional initial context passed to the factory. */
74
+ initialContext?: Record<string, unknown>;
75
+ /** RFC 8693 exchange depth so far. Default 0. */
76
+ exchangeDepth?: number;
77
+ }
78
+ /**
79
+ * Factory signature. Called on every turn — the executor rehydrates
80
+ * checkpoint + budget + nextAction, then invokes the factory to produce
81
+ * a `Pact` that will execute this turn.
82
+ */
83
+ export type PactFactory = (rehydrated: {
84
+ /** Opaque — SessionStore deserializes. First turn sees `null`. */
85
+ checkpoint: unknown;
86
+ budget: BudgetRef;
87
+ nextAction: NextAction;
88
+ initialContext: Record<string, unknown>;
89
+ }) => Pact;
90
+ /**
91
+ * Minimal slice of ctx.jobs the runtime consumes. Cortex's JobClient is
92
+ * structurally compatible. A test-only LocalJobClient implements the same
93
+ * surface for `npm run bridge:test`.
94
+ */
95
+ export interface JobClient {
96
+ enqueue(jobType: string, payload: unknown): Promise<{
97
+ jobId: string;
98
+ }>;
99
+ handle(jobType: string, handler: (payload: unknown, ctx: JobHandlerCtx) => Promise<void>): void;
100
+ }
101
+ export interface JobHandlerCtx {
102
+ /** Attempt number (0 = first delivery, 1-4 = retries per PRD-071). */
103
+ attempt: number;
104
+ /**
105
+ * Called by runtime when the continuation is effectively DLQ'd (attempt=4
106
+ * failed). Signals Cortex that the job should be moved to the DLQ rather
107
+ * than retried further.
108
+ */
109
+ signalDeadLetter: (error: string) => Promise<void>;
110
+ }
111
+ /**
112
+ * Thrown when `attach()` is called twice on the same executor with
113
+ * structurally different `JobClient` instances. Re-attaching with the
114
+ * same instance is a no-op (idempotent, S5 §3).
115
+ */
116
+ export declare class DuplicateAttachError extends Error {
117
+ constructor();
118
+ }
119
+ /**
120
+ * Thrown when `registerPact` is called twice with the same key, or when
121
+ * `start`/dispatch references a pactKey that was never registered.
122
+ */
123
+ export declare class PactRegistrationError extends Error {
124
+ readonly pactKey: string;
125
+ constructor(pactKey: string, reason: 'duplicate' | 'missing');
126
+ }
127
+ /**
128
+ * Thrown when the envelope requests a budget strategy that isn't
129
+ * implemented in this wave (S5 §5).
130
+ *
131
+ * Wave 1 supports `'fresh-per-continuation'` only. `'batched-held'` and
132
+ * `'predictive-prereserve'` are gated on Cortex Open Question O1
133
+ * (`ctx.llm.reserve()/settle()` API).
134
+ */
135
+ export declare class BudgetStrategyNotImplemented extends Error {
136
+ readonly strategy: string;
137
+ constructor(strategy: string, reason?: string);
138
+ }
139
+ //# sourceMappingURL=job-backed-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-backed-executor.d.ts","sourceRoot":"","sources":["../../src/ports/job-backed-executor.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAEtD;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE9E;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;;OAGG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,wBAAwB,GAAG,cAAc,GAAG,uBAAuB,CAAC;IACrF,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE;IACrC,kEAAkE;IAClE,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC,KAAK,IAAI,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/D,IAAI,CAAC;CACT;AAED,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBACb,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS;CAS7D;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACd,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAA+B;CAKtE"}
@@ -0,0 +1,56 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * JobBackedExecutor — drives a pact across worker boundaries via ctx.jobs.
4
+ *
5
+ * PRD-062 / S5 §2.2. Frozen: 2026-04-14.
6
+ *
7
+ * Owner: @methodts/runtime
8
+ * Producer: @methodts/runtime (impl: CortexJobBackedExecutor)
9
+ * Consumer: tenant app composition root (wires ctx.jobs into the executor)
10
+ *
11
+ * The tenant app never calls `enqueue`/`dispatch` directly — it registers
12
+ * the executor once (`attach(ctx.jobs)`) and the runtime internally emits
13
+ * continuations whenever a pact yields.
14
+ */
15
+ /**
16
+ * Thrown when `attach()` is called twice on the same executor with
17
+ * structurally different `JobClient` instances. Re-attaching with the
18
+ * same instance is a no-op (idempotent, S5 §3).
19
+ */
20
+ export class DuplicateAttachError extends Error {
21
+ constructor() {
22
+ super('JobBackedExecutor.attach called twice with a different JobClient');
23
+ this.name = 'DuplicateAttachError';
24
+ }
25
+ }
26
+ /**
27
+ * Thrown when `registerPact` is called twice with the same key, or when
28
+ * `start`/dispatch references a pactKey that was never registered.
29
+ */
30
+ export class PactRegistrationError extends Error {
31
+ pactKey;
32
+ constructor(pactKey, reason) {
33
+ super(reason === 'duplicate'
34
+ ? `Pact '${pactKey}' already registered`
35
+ : `Pact '${pactKey}' not registered — call runtime.registerPact first`);
36
+ this.name = 'PactRegistrationError';
37
+ this.pactKey = pactKey;
38
+ }
39
+ }
40
+ /**
41
+ * Thrown when the envelope requests a budget strategy that isn't
42
+ * implemented in this wave (S5 §5).
43
+ *
44
+ * Wave 1 supports `'fresh-per-continuation'` only. `'batched-held'` and
45
+ * `'predictive-prereserve'` are gated on Cortex Open Question O1
46
+ * (`ctx.llm.reserve()/settle()` API).
47
+ */
48
+ export class BudgetStrategyNotImplemented extends Error {
49
+ strategy;
50
+ constructor(strategy, reason = 'blocked on Cortex O1') {
51
+ super(`Budget strategy '${strategy}' not implemented in Wave 1 — ${reason}`);
52
+ this.name = 'BudgetStrategyNotImplemented';
53
+ this.strategy = strategy;
54
+ }
55
+ }
56
+ //# sourceMappingURL=job-backed-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-backed-executor.js","sourceRoot":"","sources":["../../src/ports/job-backed-executor.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;GAYG;AA+GH;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,OAAO,CAAS;IACzB,YAAY,OAAe,EAAE,MAA+B;QAC1D,KAAK,CACH,MAAM,KAAK,WAAW;YACpB,CAAC,CAAC,SAAS,OAAO,sBAAsB;YACxC,CAAC,CAAC,SAAS,OAAO,oDAAoD,CACzE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAC5C,QAAQ,CAAS;IAC1B,YAAY,QAAgB,EAAE,SAAiB,sBAAsB;QACnE,KAAK,CAAC,oBAAoB,QAAQ,iCAAiC,MAAM,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}