@relkit/langchain 0.0.0-stage → 0.7.10

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 (663) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -2
  3. package/dist/client-contract-metadata.d.ts +31 -0
  4. package/dist/client-contract-metadata.d.ts.map +1 -0
  5. package/dist/client-contract-metadata.js +129 -0
  6. package/dist/client-contract-metadata.js.map +1 -0
  7. package/dist/client-contract-metadata.types.d.ts +59 -0
  8. package/dist/client-contract-metadata.types.d.ts.map +1 -0
  9. package/dist/client-contract-metadata.types.js +3 -0
  10. package/dist/client-contract-metadata.types.js.map +1 -0
  11. package/dist/client-contract-schema.d.ts +66 -0
  12. package/dist/client-contract-schema.d.ts.map +1 -0
  13. package/dist/client-contract-schema.js +153 -0
  14. package/dist/client-contract-schema.js.map +1 -0
  15. package/dist/continuation-validation.d.ts +9 -0
  16. package/dist/continuation-validation.d.ts.map +1 -0
  17. package/dist/continuation-validation.js +9 -0
  18. package/dist/continuation-validation.js.map +1 -0
  19. package/dist/deepagent-bucket-backend.d.ts +33 -0
  20. package/dist/deepagent-bucket-backend.d.ts.map +1 -0
  21. package/dist/deepagent-bucket-backend.js +47 -0
  22. package/dist/deepagent-bucket-backend.js.map +1 -0
  23. package/dist/deepagent-bucket-backend.types.d.ts +6 -0
  24. package/dist/deepagent-bucket-backend.types.d.ts.map +1 -0
  25. package/dist/deepagent-bucket-backend.types.js +2 -0
  26. package/dist/deepagent-bucket-backend.types.js.map +1 -0
  27. package/dist/deepagent-bucket-client.types.d.ts +25 -0
  28. package/dist/deepagent-bucket-client.types.d.ts.map +1 -0
  29. package/dist/deepagent-bucket-client.types.js +3 -0
  30. package/dist/deepagent-bucket-client.types.js.map +1 -0
  31. package/dist/deepagent-bucket-delete.d.ts +28 -0
  32. package/dist/deepagent-bucket-delete.d.ts.map +1 -0
  33. package/dist/deepagent-bucket-delete.js +64 -0
  34. package/dist/deepagent-bucket-delete.js.map +1 -0
  35. package/dist/deepagent-bucket-error.d.ts +17 -0
  36. package/dist/deepagent-bucket-error.d.ts.map +1 -0
  37. package/dist/deepagent-bucket-error.js +17 -0
  38. package/dist/deepagent-bucket-error.js.map +1 -0
  39. package/dist/deepagent-bucket-file-data.d.ts +40 -0
  40. package/dist/deepagent-bucket-file-data.d.ts.map +1 -0
  41. package/dist/deepagent-bucket-file-data.js +115 -0
  42. package/dist/deepagent-bucket-file-data.js.map +1 -0
  43. package/dist/deepagent-bucket-file-index.d.ts +34 -0
  44. package/dist/deepagent-bucket-file-index.d.ts.map +1 -0
  45. package/dist/deepagent-bucket-file-index.js +82 -0
  46. package/dist/deepagent-bucket-file-index.js.map +1 -0
  47. package/dist/deepagent-bucket-files.d.ts +5 -0
  48. package/dist/deepagent-bucket-files.d.ts.map +1 -0
  49. package/dist/deepagent-bucket-files.js +4 -0
  50. package/dist/deepagent-bucket-files.js.map +1 -0
  51. package/dist/deepagent-bucket-files.types.d.ts +8 -0
  52. package/dist/deepagent-bucket-files.types.d.ts.map +1 -0
  53. package/dist/deepagent-bucket-files.types.js +3 -0
  54. package/dist/deepagent-bucket-files.types.js.map +1 -0
  55. package/dist/deepagent-bucket-format.d.ts +59 -0
  56. package/dist/deepagent-bucket-format.d.ts.map +1 -0
  57. package/dist/deepagent-bucket-format.js +72 -0
  58. package/dist/deepagent-bucket-format.js.map +1 -0
  59. package/dist/deepagent-bucket-glob.d.ts +26 -0
  60. package/dist/deepagent-bucket-glob.d.ts.map +1 -0
  61. package/dist/deepagent-bucket-glob.js +66 -0
  62. package/dist/deepagent-bucket-glob.js.map +1 -0
  63. package/dist/deepagent-bucket-grep.d.ts +32 -0
  64. package/dist/deepagent-bucket-grep.d.ts.map +1 -0
  65. package/dist/deepagent-bucket-grep.js +73 -0
  66. package/dist/deepagent-bucket-grep.js.map +1 -0
  67. package/dist/deepagent-bucket-path.d.ts +67 -0
  68. package/dist/deepagent-bucket-path.d.ts.map +1 -0
  69. package/dist/deepagent-bucket-path.js +121 -0
  70. package/dist/deepagent-bucket-path.js.map +1 -0
  71. package/dist/deepagent-bucket-read.d.ts +65 -0
  72. package/dist/deepagent-bucket-read.d.ts.map +1 -0
  73. package/dist/deepagent-bucket-read.js +77 -0
  74. package/dist/deepagent-bucket-read.js.map +1 -0
  75. package/dist/deepagent-bucket-scope.d.ts +43 -0
  76. package/dist/deepagent-bucket-scope.d.ts.map +1 -0
  77. package/dist/deepagent-bucket-scope.js +40 -0
  78. package/dist/deepagent-bucket-scope.js.map +1 -0
  79. package/dist/deepagent-bucket-search.d.ts +22 -0
  80. package/dist/deepagent-bucket-search.d.ts.map +1 -0
  81. package/dist/deepagent-bucket-search.js +60 -0
  82. package/dist/deepagent-bucket-search.js.map +1 -0
  83. package/dist/deepagent-bucket-service.d.ts +17 -0
  84. package/dist/deepagent-bucket-service.d.ts.map +1 -0
  85. package/dist/deepagent-bucket-service.js +16 -0
  86. package/dist/deepagent-bucket-service.js.map +1 -0
  87. package/dist/deepagent-bucket-transfer.d.ts +52 -0
  88. package/dist/deepagent-bucket-transfer.d.ts.map +1 -0
  89. package/dist/deepagent-bucket-transfer.js +73 -0
  90. package/dist/deepagent-bucket-transfer.js.map +1 -0
  91. package/dist/deepagent-bucket-write.d.ts +55 -0
  92. package/dist/deepagent-bucket-write.d.ts.map +1 -0
  93. package/dist/deepagent-bucket-write.js +88 -0
  94. package/dist/deepagent-bucket-write.js.map +1 -0
  95. package/dist/define-agent-build.d.ts +12 -0
  96. package/dist/define-agent-build.d.ts.map +1 -0
  97. package/dist/define-agent-build.js +60 -0
  98. package/dist/define-agent-build.js.map +1 -0
  99. package/dist/define-agent-deep.d.ts +30 -0
  100. package/dist/define-agent-deep.d.ts.map +1 -0
  101. package/dist/define-agent-deep.js +125 -0
  102. package/dist/define-agent-deep.js.map +1 -0
  103. package/dist/define-agent-deep.types.d.ts +23 -0
  104. package/dist/define-agent-deep.types.d.ts.map +1 -0
  105. package/dist/define-agent-deep.types.js +3 -0
  106. package/dist/define-agent-deep.types.js.map +1 -0
  107. package/dist/define-agent-native-middleware.d.ts +34 -0
  108. package/dist/define-agent-native-middleware.d.ts.map +1 -0
  109. package/dist/define-agent-native-middleware.js +83 -0
  110. package/dist/define-agent-native-middleware.js.map +1 -0
  111. package/dist/define-agent-native-model.d.ts +16 -0
  112. package/dist/define-agent-native-model.d.ts.map +1 -0
  113. package/dist/define-agent-native-model.js +23 -0
  114. package/dist/define-agent-native-model.js.map +1 -0
  115. package/dist/define-agent-native-tools.d.ts +30 -0
  116. package/dist/define-agent-native-tools.d.ts.map +1 -0
  117. package/dist/define-agent-native-tools.js +72 -0
  118. package/dist/define-agent-native-tools.js.map +1 -0
  119. package/dist/define-agent-native.d.ts +6 -0
  120. package/dist/define-agent-native.d.ts.map +1 -0
  121. package/dist/define-agent-native.js +5 -0
  122. package/dist/define-agent-native.js.map +1 -0
  123. package/dist/define-agent-native.types.d.ts +36 -0
  124. package/dist/define-agent-native.types.d.ts.map +1 -0
  125. package/dist/define-agent-native.types.js +3 -0
  126. package/dist/define-agent-native.types.js.map +1 -0
  127. package/dist/define-agent-validation.d.ts +45 -0
  128. package/dist/define-agent-validation.d.ts.map +1 -0
  129. package/dist/define-agent-validation.js +92 -0
  130. package/dist/define-agent-validation.js.map +1 -0
  131. package/dist/define-agent.d.ts +41 -0
  132. package/dist/define-agent.d.ts.map +1 -0
  133. package/dist/define-agent.js +59 -0
  134. package/dist/define-agent.js.map +1 -0
  135. package/dist/define-agent.types.d.ts +54 -0
  136. package/dist/define-agent.types.d.ts.map +1 -0
  137. package/dist/define-agent.types.js +3 -0
  138. package/dist/define-agent.types.js.map +1 -0
  139. package/dist/define-graph-build.d.ts +12 -0
  140. package/dist/define-graph-build.d.ts.map +1 -0
  141. package/dist/define-graph-build.js +86 -0
  142. package/dist/define-graph-build.js.map +1 -0
  143. package/dist/define-graph-error.d.ts +17 -0
  144. package/dist/define-graph-error.d.ts.map +1 -0
  145. package/dist/define-graph-error.js +17 -0
  146. package/dist/define-graph-error.js.map +1 -0
  147. package/dist/define-graph-node.d.ts +42 -0
  148. package/dist/define-graph-node.d.ts.map +1 -0
  149. package/dist/define-graph-node.js +97 -0
  150. package/dist/define-graph-node.js.map +1 -0
  151. package/dist/define-graph-node.types.d.ts +38 -0
  152. package/dist/define-graph-node.types.d.ts.map +1 -0
  153. package/dist/define-graph-node.types.js +3 -0
  154. package/dist/define-graph-node.types.js.map +1 -0
  155. package/dist/define-graph.d.ts +44 -0
  156. package/dist/define-graph.d.ts.map +1 -0
  157. package/dist/define-graph.js +72 -0
  158. package/dist/define-graph.js.map +1 -0
  159. package/dist/define-graph.types.d.ts +69 -0
  160. package/dist/define-graph.types.d.ts.map +1 -0
  161. package/dist/define-graph.types.js +3 -0
  162. package/dist/define-graph.types.js.map +1 -0
  163. package/dist/define-persistence-guards.d.ts +32 -0
  164. package/dist/define-persistence-guards.d.ts.map +1 -0
  165. package/dist/define-persistence-guards.js +55 -0
  166. package/dist/define-persistence-guards.js.map +1 -0
  167. package/dist/define-persistence.d.ts +33 -0
  168. package/dist/define-persistence.d.ts.map +1 -0
  169. package/dist/define-persistence.js +112 -0
  170. package/dist/define-persistence.js.map +1 -0
  171. package/dist/define-persistence.types.d.ts +30 -0
  172. package/dist/define-persistence.types.d.ts.map +1 -0
  173. package/dist/define-persistence.types.js +3 -0
  174. package/dist/define-persistence.types.js.map +1 -0
  175. package/dist/graph-compile-error.d.ts +17 -0
  176. package/dist/graph-compile-error.d.ts.map +1 -0
  177. package/dist/graph-compile-error.js +17 -0
  178. package/dist/graph-compile-error.js.map +1 -0
  179. package/dist/graph-compile.d.ts +32 -0
  180. package/dist/graph-compile.d.ts.map +1 -0
  181. package/dist/graph-compile.js +94 -0
  182. package/dist/graph-compile.js.map +1 -0
  183. package/dist/graph-continuation-error.d.ts +17 -0
  184. package/dist/graph-continuation-error.d.ts.map +1 -0
  185. package/dist/graph-continuation-error.js +17 -0
  186. package/dist/graph-continuation-error.js.map +1 -0
  187. package/dist/graph-continuation-validation.d.ts +22 -0
  188. package/dist/graph-continuation-validation.d.ts.map +1 -0
  189. package/dist/graph-continuation-validation.js +67 -0
  190. package/dist/graph-continuation-validation.js.map +1 -0
  191. package/dist/graph-continuation-waiting.d.ts +23 -0
  192. package/dist/graph-continuation-waiting.d.ts.map +1 -0
  193. package/dist/graph-continuation-waiting.js +53 -0
  194. package/dist/graph-continuation-waiting.js.map +1 -0
  195. package/dist/graph-continuation.d.ts +43 -0
  196. package/dist/graph-continuation.d.ts.map +1 -0
  197. package/dist/graph-continuation.js +82 -0
  198. package/dist/graph-continuation.js.map +1 -0
  199. package/dist/graph-continuation.types.d.ts +11 -0
  200. package/dist/graph-continuation.types.d.ts.map +1 -0
  201. package/dist/graph-continuation.types.js +3 -0
  202. package/dist/graph-continuation.types.js.map +1 -0
  203. package/dist/graph-definition.d.ts +36 -0
  204. package/dist/graph-definition.d.ts.map +1 -0
  205. package/dist/graph-definition.js +90 -0
  206. package/dist/graph-definition.js.map +1 -0
  207. package/dist/graph-edge-destinations.d.ts +42 -0
  208. package/dist/graph-edge-destinations.d.ts.map +1 -0
  209. package/dist/graph-edge-destinations.js +100 -0
  210. package/dist/graph-edge-destinations.js.map +1 -0
  211. package/dist/graph-edge-mutations.d.ts +19 -0
  212. package/dist/graph-edge-mutations.d.ts.map +1 -0
  213. package/dist/graph-edge-mutations.js +62 -0
  214. package/dist/graph-edge-mutations.js.map +1 -0
  215. package/dist/graph-edge-mutations.types.d.ts +9 -0
  216. package/dist/graph-edge-mutations.types.d.ts.map +1 -0
  217. package/dist/graph-edge-mutations.types.js +2 -0
  218. package/dist/graph-edge-mutations.types.js.map +1 -0
  219. package/dist/graph-edges.d.ts +24 -0
  220. package/dist/graph-edges.d.ts.map +1 -0
  221. package/dist/graph-edges.js +37 -0
  222. package/dist/graph-edges.js.map +1 -0
  223. package/dist/graph-edges.types.d.ts +47 -0
  224. package/dist/graph-edges.types.d.ts.map +1 -0
  225. package/dist/graph-edges.types.js +3 -0
  226. package/dist/graph-edges.types.js.map +1 -0
  227. package/dist/graph-execution-symbol.d.ts +3 -0
  228. package/dist/graph-execution-symbol.d.ts.map +1 -0
  229. package/dist/graph-execution-symbol.js +3 -0
  230. package/dist/graph-execution-symbol.js.map +1 -0
  231. package/dist/graph-interruption.d.ts +84 -0
  232. package/dist/graph-interruption.d.ts.map +1 -0
  233. package/dist/graph-interruption.js +119 -0
  234. package/dist/graph-interruption.js.map +1 -0
  235. package/dist/graph-interruption.types.d.ts +16 -0
  236. package/dist/graph-interruption.types.d.ts.map +1 -0
  237. package/dist/graph-interruption.types.js +3 -0
  238. package/dist/graph-interruption.types.js.map +1 -0
  239. package/dist/graph-node-schema-validation.d.ts +9 -0
  240. package/dist/graph-node-schema-validation.d.ts.map +1 -0
  241. package/dist/graph-node-schema-validation.js +16 -0
  242. package/dist/graph-node-schema-validation.js.map +1 -0
  243. package/dist/graph-node-symbol.d.ts +3 -0
  244. package/dist/graph-node-symbol.d.ts.map +1 -0
  245. package/dist/graph-node-symbol.js +3 -0
  246. package/dist/graph-node-symbol.js.map +1 -0
  247. package/dist/graph-node-validation-error.d.ts +17 -0
  248. package/dist/graph-node-validation-error.d.ts.map +1 -0
  249. package/dist/graph-node-validation-error.js +17 -0
  250. package/dist/graph-node-validation-error.js.map +1 -0
  251. package/dist/graph-node-validation-value.d.ts +64 -0
  252. package/dist/graph-node-validation-value.d.ts.map +1 -0
  253. package/dist/graph-node-validation-value.js +117 -0
  254. package/dist/graph-node-validation-value.js.map +1 -0
  255. package/dist/graph-node-validation.d.ts +65 -0
  256. package/dist/graph-node-validation.d.ts.map +1 -0
  257. package/dist/graph-node-validation.js +113 -0
  258. package/dist/graph-node-validation.js.map +1 -0
  259. package/dist/graph-persistence-release.d.ts +16 -0
  260. package/dist/graph-persistence-release.d.ts.map +1 -0
  261. package/dist/graph-persistence-release.js +43 -0
  262. package/dist/graph-persistence-release.js.map +1 -0
  263. package/dist/graph-persistence.d.ts +39 -0
  264. package/dist/graph-persistence.d.ts.map +1 -0
  265. package/dist/graph-persistence.js +111 -0
  266. package/dist/graph-persistence.js.map +1 -0
  267. package/dist/graph-persistence.types.d.ts +21 -0
  268. package/dist/graph-persistence.types.d.ts.map +1 -0
  269. package/dist/graph-persistence.types.js +3 -0
  270. package/dist/graph-persistence.types.js.map +1 -0
  271. package/dist/graph-runtime-error.d.ts +17 -0
  272. package/dist/graph-runtime-error.d.ts.map +1 -0
  273. package/dist/graph-runtime-error.js +17 -0
  274. package/dist/graph-runtime-error.js.map +1 -0
  275. package/dist/graph-runtime-execution.d.ts +28 -0
  276. package/dist/graph-runtime-execution.d.ts.map +1 -0
  277. package/dist/graph-runtime-execution.js +69 -0
  278. package/dist/graph-runtime-execution.js.map +1 -0
  279. package/dist/graph-runtime-identity.d.ts +15 -0
  280. package/dist/graph-runtime-identity.d.ts.map +1 -0
  281. package/dist/graph-runtime-identity.js +14 -0
  282. package/dist/graph-runtime-identity.js.map +1 -0
  283. package/dist/graph-runtime-identity.types.d.ts +5 -0
  284. package/dist/graph-runtime-identity.types.d.ts.map +1 -0
  285. package/dist/graph-runtime-identity.types.js +2 -0
  286. package/dist/graph-runtime-identity.types.js.map +1 -0
  287. package/dist/graph-runtime-stream-state.d.ts +8 -0
  288. package/dist/graph-runtime-stream-state.d.ts.map +1 -0
  289. package/dist/graph-runtime-stream-state.js +67 -0
  290. package/dist/graph-runtime-stream-state.js.map +1 -0
  291. package/dist/graph-runtime-stream.d.ts +16 -0
  292. package/dist/graph-runtime-stream.d.ts.map +1 -0
  293. package/dist/graph-runtime-stream.js +49 -0
  294. package/dist/graph-runtime-stream.js.map +1 -0
  295. package/dist/graph-runtime-stream.types.d.ts +13 -0
  296. package/dist/graph-runtime-stream.types.d.ts.map +1 -0
  297. package/dist/graph-runtime-stream.types.js +2 -0
  298. package/dist/graph-runtime-stream.types.js.map +1 -0
  299. package/dist/graph-runtime.d.ts +21 -0
  300. package/dist/graph-runtime.d.ts.map +1 -0
  301. package/dist/graph-runtime.js +74 -0
  302. package/dist/graph-runtime.js.map +1 -0
  303. package/dist/graph-runtime.types.d.ts +8 -0
  304. package/dist/graph-runtime.types.d.ts.map +1 -0
  305. package/dist/graph-runtime.types.js +3 -0
  306. package/dist/graph-runtime.types.js.map +1 -0
  307. package/dist/graph-state-schema.d.ts +35 -0
  308. package/dist/graph-state-schema.d.ts.map +1 -0
  309. package/dist/graph-state-schema.js +65 -0
  310. package/dist/graph-state-schema.js.map +1 -0
  311. package/dist/graph-subgraph-symbol.d.ts +5 -0
  312. package/dist/graph-subgraph-symbol.d.ts.map +1 -0
  313. package/dist/graph-subgraph-symbol.js +5 -0
  314. package/dist/graph-subgraph-symbol.js.map +1 -0
  315. package/dist/graph-subgraph.d.ts +46 -0
  316. package/dist/graph-subgraph.d.ts.map +1 -0
  317. package/dist/graph-subgraph.js +82 -0
  318. package/dist/graph-subgraph.js.map +1 -0
  319. package/dist/graph-subgraph.types.d.ts +20 -0
  320. package/dist/graph-subgraph.types.d.ts.map +1 -0
  321. package/dist/graph-subgraph.types.js +3 -0
  322. package/dist/graph-subgraph.types.js.map +1 -0
  323. package/dist/graph-workflow-error.d.ts +17 -0
  324. package/dist/graph-workflow-error.d.ts.map +1 -0
  325. package/dist/graph-workflow-error.js +17 -0
  326. package/dist/graph-workflow-error.js.map +1 -0
  327. package/dist/graph-workflow.d.ts +37 -0
  328. package/dist/graph-workflow.d.ts.map +1 -0
  329. package/dist/graph-workflow.js +86 -0
  330. package/dist/graph-workflow.js.map +1 -0
  331. package/dist/graph-workflow.types.d.ts +41 -0
  332. package/dist/graph-workflow.types.d.ts.map +1 -0
  333. package/dist/graph-workflow.types.js +3 -0
  334. package/dist/graph-workflow.types.js.map +1 -0
  335. package/dist/index.d.ts +32 -0
  336. package/dist/index.d.ts.map +1 -0
  337. package/dist/index.js +28 -0
  338. package/dist/index.js.map +1 -0
  339. package/dist/native-agent-interruption-error.d.ts +17 -0
  340. package/dist/native-agent-interruption-error.d.ts.map +1 -0
  341. package/dist/native-agent-interruption-error.js +17 -0
  342. package/dist/native-agent-interruption-error.js.map +1 -0
  343. package/dist/native-agent-interruption-schema.d.ts +66 -0
  344. package/dist/native-agent-interruption-schema.d.ts.map +1 -0
  345. package/dist/native-agent-interruption-schema.js +141 -0
  346. package/dist/native-agent-interruption-schema.js.map +1 -0
  347. package/dist/native-agent-interruption-schema.types.d.ts +16 -0
  348. package/dist/native-agent-interruption-schema.types.d.ts.map +1 -0
  349. package/dist/native-agent-interruption-schema.types.js +3 -0
  350. package/dist/native-agent-interruption-schema.types.js.map +1 -0
  351. package/dist/native-agent-interruption-validation.d.ts +19 -0
  352. package/dist/native-agent-interruption-validation.d.ts.map +1 -0
  353. package/dist/native-agent-interruption-validation.js +107 -0
  354. package/dist/native-agent-interruption-validation.js.map +1 -0
  355. package/dist/native-agent-interruption.d.ts +55 -0
  356. package/dist/native-agent-interruption.d.ts.map +1 -0
  357. package/dist/native-agent-interruption.js +85 -0
  358. package/dist/native-agent-interruption.js.map +1 -0
  359. package/dist/native-agent-interruption.types.d.ts +5 -0
  360. package/dist/native-agent-interruption.types.d.ts.map +1 -0
  361. package/dist/native-agent-interruption.types.js +2 -0
  362. package/dist/native-agent-interruption.types.js.map +1 -0
  363. package/dist/persistence-error.d.ts +17 -0
  364. package/dist/persistence-error.d.ts.map +1 -0
  365. package/dist/persistence-error.js +17 -0
  366. package/dist/persistence-error.js.map +1 -0
  367. package/dist/persistence-symbol.d.ts +3 -0
  368. package/dist/persistence-symbol.d.ts.map +1 -0
  369. package/dist/persistence-symbol.js +3 -0
  370. package/dist/persistence-symbol.js.map +1 -0
  371. package/dist/runtime-approval-decision.d.ts +13 -0
  372. package/dist/runtime-approval-decision.d.ts.map +1 -0
  373. package/dist/runtime-approval-decision.js +21 -0
  374. package/dist/runtime-approval-decision.js.map +1 -0
  375. package/dist/runtime-dependencies.d.ts +7 -0
  376. package/dist/runtime-dependencies.d.ts.map +1 -0
  377. package/dist/runtime-dependencies.js +10 -0
  378. package/dist/runtime-dependencies.js.map +1 -0
  379. package/dist/runtime-effect-error.d.ts +18 -0
  380. package/dist/runtime-effect-error.d.ts.map +1 -0
  381. package/dist/runtime-effect-error.js +19 -0
  382. package/dist/runtime-effect-error.js.map +1 -0
  383. package/dist/runtime-errors.d.ts +11 -0
  384. package/dist/runtime-errors.d.ts.map +1 -0
  385. package/dist/runtime-errors.js +15 -0
  386. package/dist/runtime-errors.js.map +1 -0
  387. package/dist/runtime-failure-diagnostics.d.ts +10 -0
  388. package/dist/runtime-failure-diagnostics.d.ts.map +1 -0
  389. package/dist/runtime-failure-diagnostics.js +61 -0
  390. package/dist/runtime-failure-diagnostics.js.map +1 -0
  391. package/dist/runtime-integration.d.ts +10 -0
  392. package/dist/runtime-integration.d.ts.map +1 -0
  393. package/dist/runtime-integration.js +9 -0
  394. package/dist/runtime-integration.js.map +1 -0
  395. package/dist/runtime-invoke.d.ts +27 -0
  396. package/dist/runtime-invoke.d.ts.map +1 -0
  397. package/dist/runtime-invoke.js +77 -0
  398. package/dist/runtime-invoke.js.map +1 -0
  399. package/dist/runtime-loop-context.types.d.ts +22 -0
  400. package/dist/runtime-loop-context.types.d.ts.map +1 -0
  401. package/dist/runtime-loop-context.types.js +2 -0
  402. package/dist/runtime-loop-context.types.js.map +1 -0
  403. package/dist/runtime-loop-execution.d.ts +4 -0
  404. package/dist/runtime-loop-execution.d.ts.map +1 -0
  405. package/dist/runtime-loop-execution.js +61 -0
  406. package/dist/runtime-loop-execution.js.map +1 -0
  407. package/dist/runtime-loop-state.d.ts +13 -0
  408. package/dist/runtime-loop-state.d.ts.map +1 -0
  409. package/dist/runtime-loop-state.js +57 -0
  410. package/dist/runtime-loop-state.js.map +1 -0
  411. package/dist/runtime-loop-telemetry.d.ts +5 -0
  412. package/dist/runtime-loop-telemetry.d.ts.map +1 -0
  413. package/dist/runtime-loop-telemetry.js +62 -0
  414. package/dist/runtime-loop-telemetry.js.map +1 -0
  415. package/dist/runtime-loop-values.d.ts +52 -0
  416. package/dist/runtime-loop-values.d.ts.map +1 -0
  417. package/dist/runtime-loop-values.js +85 -0
  418. package/dist/runtime-loop-values.js.map +1 -0
  419. package/dist/runtime-loop.d.ts +36 -0
  420. package/dist/runtime-loop.d.ts.map +1 -0
  421. package/dist/runtime-loop.js +45 -0
  422. package/dist/runtime-loop.js.map +1 -0
  423. package/dist/runtime-loop.types.d.ts +8 -0
  424. package/dist/runtime-loop.types.d.ts.map +1 -0
  425. package/dist/runtime-loop.types.js +3 -0
  426. package/dist/runtime-loop.types.js.map +1 -0
  427. package/dist/runtime-model-error.d.ts +17 -0
  428. package/dist/runtime-model-error.d.ts.map +1 -0
  429. package/dist/runtime-model-error.js +17 -0
  430. package/dist/runtime-model-error.js.map +1 -0
  431. package/dist/runtime-model.d.ts +31 -0
  432. package/dist/runtime-model.d.ts.map +1 -0
  433. package/dist/runtime-model.js +126 -0
  434. package/dist/runtime-model.js.map +1 -0
  435. package/dist/runtime-model.types.d.ts +22 -0
  436. package/dist/runtime-model.types.d.ts.map +1 -0
  437. package/dist/runtime-model.types.js +3 -0
  438. package/dist/runtime-model.types.js.map +1 -0
  439. package/dist/runtime-native-agent-build.d.ts +40 -0
  440. package/dist/runtime-native-agent-build.d.ts.map +1 -0
  441. package/dist/runtime-native-agent-build.js +77 -0
  442. package/dist/runtime-native-agent-build.js.map +1 -0
  443. package/dist/runtime-native-agent.d.ts +30 -0
  444. package/dist/runtime-native-agent.d.ts.map +1 -0
  445. package/dist/runtime-native-agent.js +84 -0
  446. package/dist/runtime-native-agent.js.map +1 -0
  447. package/dist/runtime-native-agent.types.d.ts +21 -0
  448. package/dist/runtime-native-agent.types.d.ts.map +1 -0
  449. package/dist/runtime-native-agent.types.js +3 -0
  450. package/dist/runtime-native-agent.types.js.map +1 -0
  451. package/dist/runtime-native-event-tools.d.ts +28 -0
  452. package/dist/runtime-native-event-tools.d.ts.map +1 -0
  453. package/dist/runtime-native-event-tools.js +88 -0
  454. package/dist/runtime-native-event-tools.js.map +1 -0
  455. package/dist/runtime-native-events-helpers.d.ts +30 -0
  456. package/dist/runtime-native-events-helpers.d.ts.map +1 -0
  457. package/dist/runtime-native-events-helpers.js +74 -0
  458. package/dist/runtime-native-events-helpers.js.map +1 -0
  459. package/dist/runtime-native-events.d.ts +45 -0
  460. package/dist/runtime-native-events.d.ts.map +1 -0
  461. package/dist/runtime-native-events.js +89 -0
  462. package/dist/runtime-native-events.js.map +1 -0
  463. package/dist/runtime-native-limits.d.ts +18 -0
  464. package/dist/runtime-native-limits.d.ts.map +1 -0
  465. package/dist/runtime-native-limits.js +59 -0
  466. package/dist/runtime-native-limits.js.map +1 -0
  467. package/dist/runtime-native-messages.d.ts +24 -0
  468. package/dist/runtime-native-messages.d.ts.map +1 -0
  469. package/dist/runtime-native-messages.js +83 -0
  470. package/dist/runtime-native-messages.js.map +1 -0
  471. package/dist/runtime-native-messages.types.d.ts +7 -0
  472. package/dist/runtime-native-messages.types.d.ts.map +1 -0
  473. package/dist/runtime-native-messages.types.js +2 -0
  474. package/dist/runtime-native-messages.types.js.map +1 -0
  475. package/dist/runtime-native-public-state.d.ts +22 -0
  476. package/dist/runtime-native-public-state.d.ts.map +1 -0
  477. package/dist/runtime-native-public-state.js +44 -0
  478. package/dist/runtime-native-public-state.js.map +1 -0
  479. package/dist/runtime-native-public-tools.d.ts +15 -0
  480. package/dist/runtime-native-public-tools.d.ts.map +1 -0
  481. package/dist/runtime-native-public-tools.js +39 -0
  482. package/dist/runtime-native-public-tools.js.map +1 -0
  483. package/dist/runtime-native-public.d.ts +28 -0
  484. package/dist/runtime-native-public.d.ts.map +1 -0
  485. package/dist/runtime-native-public.js +165 -0
  486. package/dist/runtime-native-public.js.map +1 -0
  487. package/dist/runtime-native-public.types.d.ts +5 -0
  488. package/dist/runtime-native-public.types.d.ts.map +1 -0
  489. package/dist/runtime-native-public.types.js +3 -0
  490. package/dist/runtime-native-public.types.js.map +1 -0
  491. package/dist/runtime-native-response-format.d.ts +15 -0
  492. package/dist/runtime-native-response-format.d.ts.map +1 -0
  493. package/dist/runtime-native-response-format.js +46 -0
  494. package/dist/runtime-native-response-format.js.map +1 -0
  495. package/dist/runtime-native-subagents.d.ts +47 -0
  496. package/dist/runtime-native-subagents.d.ts.map +1 -0
  497. package/dist/runtime-native-subagents.js +50 -0
  498. package/dist/runtime-native-subagents.js.map +1 -0
  499. package/dist/runtime-native-subagents.types.d.ts +7 -0
  500. package/dist/runtime-native-subagents.types.d.ts.map +1 -0
  501. package/dist/runtime-native-subagents.types.js +2 -0
  502. package/dist/runtime-native-subagents.types.js.map +1 -0
  503. package/dist/runtime-native-support.d.ts +67 -0
  504. package/dist/runtime-native-support.d.ts.map +1 -0
  505. package/dist/runtime-native-support.js +112 -0
  506. package/dist/runtime-native-support.js.map +1 -0
  507. package/dist/runtime-native-support.types.d.ts +9 -0
  508. package/dist/runtime-native-support.types.d.ts.map +1 -0
  509. package/dist/runtime-native-support.types.js +2 -0
  510. package/dist/runtime-native-support.types.js.map +1 -0
  511. package/dist/runtime-native-tool-build.d.ts +12 -0
  512. package/dist/runtime-native-tool-build.d.ts.map +1 -0
  513. package/dist/runtime-native-tool-build.js +81 -0
  514. package/dist/runtime-native-tool-build.js.map +1 -0
  515. package/dist/runtime-native-tool-build.types.d.ts +14 -0
  516. package/dist/runtime-native-tool-build.types.d.ts.map +1 -0
  517. package/dist/runtime-native-tool-build.types.js +2 -0
  518. package/dist/runtime-native-tool-build.types.js.map +1 -0
  519. package/dist/runtime-native-tools-identity.d.ts +15 -0
  520. package/dist/runtime-native-tools-identity.d.ts.map +1 -0
  521. package/dist/runtime-native-tools-identity.js +14 -0
  522. package/dist/runtime-native-tools-identity.js.map +1 -0
  523. package/dist/runtime-native-tools.d.ts +29 -0
  524. package/dist/runtime-native-tools.d.ts.map +1 -0
  525. package/dist/runtime-native-tools.js +65 -0
  526. package/dist/runtime-native-tools.js.map +1 -0
  527. package/dist/runtime-native-tools.types.d.ts +21 -0
  528. package/dist/runtime-native-tools.types.d.ts.map +1 -0
  529. package/dist/runtime-native-tools.types.js +3 -0
  530. package/dist/runtime-native-tools.types.js.map +1 -0
  531. package/dist/runtime-service.d.ts +15 -0
  532. package/dist/runtime-service.d.ts.map +1 -0
  533. package/dist/runtime-service.js +20 -0
  534. package/dist/runtime-service.js.map +1 -0
  535. package/dist/runtime-service.types.d.ts +12 -0
  536. package/dist/runtime-service.types.d.ts.map +1 -0
  537. package/dist/runtime-service.types.js +3 -0
  538. package/dist/runtime-service.types.js.map +1 -0
  539. package/dist/runtime-state-schemas.d.ts +19 -0
  540. package/dist/runtime-state-schemas.d.ts.map +1 -0
  541. package/dist/runtime-state-schemas.js +58 -0
  542. package/dist/runtime-state-schemas.js.map +1 -0
  543. package/dist/runtime-strict-response-schema.d.ts +9 -0
  544. package/dist/runtime-strict-response-schema.d.ts.map +1 -0
  545. package/dist/runtime-strict-response-schema.js +67 -0
  546. package/dist/runtime-strict-response-schema.js.map +1 -0
  547. package/dist/runtime-tool-adapter.d.ts +34 -0
  548. package/dist/runtime-tool-adapter.d.ts.map +1 -0
  549. package/dist/runtime-tool-adapter.js +66 -0
  550. package/dist/runtime-tool-adapter.js.map +1 -0
  551. package/dist/runtime-tool-dispatcher.d.ts +32 -0
  552. package/dist/runtime-tool-dispatcher.d.ts.map +1 -0
  553. package/dist/runtime-tool-dispatcher.js +67 -0
  554. package/dist/runtime-tool-dispatcher.js.map +1 -0
  555. package/dist/runtime-tool-events.d.ts +49 -0
  556. package/dist/runtime-tool-events.d.ts.map +1 -0
  557. package/dist/runtime-tool-events.js +106 -0
  558. package/dist/runtime-tool-events.js.map +1 -0
  559. package/dist/runtime-tool-events.types.d.ts +8 -0
  560. package/dist/runtime-tool-events.types.d.ts.map +1 -0
  561. package/dist/runtime-tool-events.types.js +3 -0
  562. package/dist/runtime-tool-events.types.js.map +1 -0
  563. package/dist/runtime-tool-invocation.d.ts +19 -0
  564. package/dist/runtime-tool-invocation.d.ts.map +1 -0
  565. package/dist/runtime-tool-invocation.js +74 -0
  566. package/dist/runtime-tool-invocation.js.map +1 -0
  567. package/dist/runtime-tool-lookup.d.ts +56 -0
  568. package/dist/runtime-tool-lookup.d.ts.map +1 -0
  569. package/dist/runtime-tool-lookup.js +71 -0
  570. package/dist/runtime-tool-lookup.js.map +1 -0
  571. package/dist/runtime-tools.d.ts +35 -0
  572. package/dist/runtime-tools.d.ts.map +1 -0
  573. package/dist/runtime-tools.js +78 -0
  574. package/dist/runtime-tools.js.map +1 -0
  575. package/dist/runtime-tools.types.d.ts +7 -0
  576. package/dist/runtime-tools.types.d.ts.map +1 -0
  577. package/dist/runtime-tools.types.js +2 -0
  578. package/dist/runtime-tools.types.js.map +1 -0
  579. package/dist/runtime-utils.d.ts +56 -0
  580. package/dist/runtime-utils.d.ts.map +1 -0
  581. package/dist/runtime-utils.js +106 -0
  582. package/dist/runtime-utils.js.map +1 -0
  583. package/dist/runtime.d.ts +47 -0
  584. package/dist/runtime.d.ts.map +1 -0
  585. package/dist/runtime.js +90 -0
  586. package/dist/runtime.js.map +1 -0
  587. package/dist/runtime.types.d.ts +77 -0
  588. package/dist/runtime.types.d.ts.map +1 -0
  589. package/dist/runtime.types.js +3 -0
  590. package/dist/runtime.types.js.map +1 -0
  591. package/dist/signal-deadline.d.ts +12 -0
  592. package/dist/signal-deadline.d.ts.map +1 -0
  593. package/dist/signal-deadline.js +21 -0
  594. package/dist/signal-deadline.js.map +1 -0
  595. package/dist/signal.d.ts +64 -0
  596. package/dist/signal.d.ts.map +1 -0
  597. package/dist/signal.js +136 -0
  598. package/dist/signal.js.map +1 -0
  599. package/dist/signal.types.d.ts +35 -0
  600. package/dist/signal.types.d.ts.map +1 -0
  601. package/dist/signal.types.js +3 -0
  602. package/dist/signal.types.js.map +1 -0
  603. package/dist/testing/agent-approvals.d.ts +8 -0
  604. package/dist/testing/agent-approvals.d.ts.map +1 -0
  605. package/dist/testing/agent-approvals.js +98 -0
  606. package/dist/testing/agent-approvals.js.map +1 -0
  607. package/dist/testing/agent-approvals.types.d.ts +24 -0
  608. package/dist/testing/agent-approvals.types.d.ts.map +1 -0
  609. package/dist/testing/agent-approvals.types.js +3 -0
  610. package/dist/testing/agent-approvals.types.js.map +1 -0
  611. package/dist/testing/agent-harness.types.d.ts +25 -0
  612. package/dist/testing/agent-harness.types.d.ts.map +1 -0
  613. package/dist/testing/agent-harness.types.js +3 -0
  614. package/dist/testing/agent-harness.types.js.map +1 -0
  615. package/dist/testing/agent-state-invocation.d.ts +4 -0
  616. package/dist/testing/agent-state-invocation.d.ts.map +1 -0
  617. package/dist/testing/agent-state-invocation.js +41 -0
  618. package/dist/testing/agent-state-invocation.js.map +1 -0
  619. package/dist/testing/agent-state-lifecycle.d.ts +6 -0
  620. package/dist/testing/agent-state-lifecycle.d.ts.map +1 -0
  621. package/dist/testing/agent-state-lifecycle.js +36 -0
  622. package/dist/testing/agent-state-lifecycle.js.map +1 -0
  623. package/dist/testing/agent-state-setup.d.ts +18 -0
  624. package/dist/testing/agent-state-setup.d.ts.map +1 -0
  625. package/dist/testing/agent-state-setup.js +52 -0
  626. package/dist/testing/agent-state-setup.js.map +1 -0
  627. package/dist/testing/agent-state.d.ts +12 -0
  628. package/dist/testing/agent-state.d.ts.map +1 -0
  629. package/dist/testing/agent-state.js +40 -0
  630. package/dist/testing/agent-state.js.map +1 -0
  631. package/dist/testing/agents-model-native.d.ts +37 -0
  632. package/dist/testing/agents-model-native.d.ts.map +1 -0
  633. package/dist/testing/agents-model-native.js +111 -0
  634. package/dist/testing/agents-model-native.js.map +1 -0
  635. package/dist/testing/agents-model-operations.d.ts +28 -0
  636. package/dist/testing/agents-model-operations.d.ts.map +1 -0
  637. package/dist/testing/agents-model-operations.js +91 -0
  638. package/dist/testing/agents-model-operations.js.map +1 -0
  639. package/dist/testing/agents-model.d.ts +25 -0
  640. package/dist/testing/agents-model.d.ts.map +1 -0
  641. package/dist/testing/agents-model.js +72 -0
  642. package/dist/testing/agents-model.js.map +1 -0
  643. package/dist/testing/agents-model.types.d.ts +24 -0
  644. package/dist/testing/agents-model.types.d.ts.map +1 -0
  645. package/dist/testing/agents-model.types.js +3 -0
  646. package/dist/testing/agents-model.types.js.map +1 -0
  647. package/dist/testing/agents-types.d.ts +3 -0
  648. package/dist/testing/agents-types.d.ts.map +1 -0
  649. package/dist/testing/agents-types.js +2 -0
  650. package/dist/testing/agents-types.js.map +1 -0
  651. package/dist/testing/agents-utils.d.ts +26 -0
  652. package/dist/testing/agents-utils.d.ts.map +1 -0
  653. package/dist/testing/agents-utils.js +79 -0
  654. package/dist/testing/agents-utils.js.map +1 -0
  655. package/dist/testing/agents.d.ts +26 -0
  656. package/dist/testing/agents.d.ts.map +1 -0
  657. package/dist/testing/agents.js +64 -0
  658. package/dist/testing/agents.js.map +1 -0
  659. package/dist/testing/agents.types.d.ts +113 -0
  660. package/dist/testing/agents.types.d.ts.map +1 -0
  661. package/dist/testing/agents.types.js +3 -0
  662. package/dist/testing/agents.types.js.map +1 -0
  663. package/package.json +191 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-error.js","sourceRoot":"","sources":["../src/persistence-error.ts"],"names":[],"mappings":"AAAA,mIAAmI;AAEnI,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,mEAAmE;AACnE,MAAM,OAAO,uBAAwB,SAAQ,MAAM,CAAC,WAAW,EAA2B,CACxF,yBAAyB,EACzB,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CAClD;CAAG;AAEJ;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,OAAO,IAAI,uBAAuB,CAAC;QACjC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Shared marker used to recognize RELKIT persistence descriptors. */
2
+ export declare const RELKIT_PERSISTENCE: unique symbol;
3
+ //# sourceMappingURL=persistence-symbol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-symbol.d.ts","sourceRoot":"","sources":["../src/persistence-symbol.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,eAAyC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Shared marker used to recognize RELKIT persistence descriptors. */
2
+ export const RELKIT_PERSISTENCE = Symbol.for("relkit.agent-persistence");
3
+ //# sourceMappingURL=persistence-symbol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-symbol.js","sourceRoot":"","sources":["../src/persistence-symbol.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Converts supported approval reply forms to the canonical record while keeping
3
+ * approval policy, tracing and tool lifecycle in their existing owners.
4
+ */
5
+ import { Effect } from "effect";
6
+ import { type PendingApproval } from "@relkit/agents/internal/approval";
7
+ /** Normalizes the supported reply forms without changing approval semantics.
8
+ * @param approval - Pending decision being resolved.
9
+ * @param response - Supported handler reply or canonical record.
10
+ * @returns Canonical decision or a tagged approval failure.
11
+ */
12
+ export declare const resolveApprovalDecisionEffect: (approval: PendingApproval, response: boolean | "denied" | "approved" | import("@relkit/agents/internal/approval").ApprovalRecord) => Effect.Effect<import("@relkit/agents/internal/approval").ApprovalRecord, import("./runtime-effect-error.js").AgentInvocationFailure, never>;
13
+ //# sourceMappingURL=runtime-approval-decision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-approval-decision.d.ts","sourceRoot":"","sources":["../src/runtime-approval-decision.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAI1C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,mRAczC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Converts supported approval reply forms to the canonical record while keeping
3
+ * approval policy, tracing and tool lifecycle in their existing owners.
4
+ */
5
+ import { Effect } from "effect";
6
+ import { approveApprovalEffect, denyApprovalEffect, } from "@relkit/agents/internal/approval";
7
+ import { agentInvocationFailure } from "./runtime-effect-error.js";
8
+ /** Normalizes the supported reply forms without changing approval semantics.
9
+ * @param approval - Pending decision being resolved.
10
+ * @param response - Supported handler reply or canonical record.
11
+ * @returns Canonical decision or a tagged approval failure.
12
+ */
13
+ export const resolveApprovalDecisionEffect = Effect.fn("Agents.runtime.approvalDecision")(function* (approval, response) {
14
+ const decision = response === "approved" || response === true
15
+ ? yield* approveApprovalEffect(approval).pipe(Effect.mapError((failure) => agentInvocationFailure(failure.cause)))
16
+ : response === "denied" || response === false
17
+ ? yield* denyApprovalEffect(approval).pipe(Effect.mapError((failure) => agentInvocationFailure(failure.cause)))
18
+ : response;
19
+ return decision;
20
+ });
21
+ //# sourceMappingURL=runtime-approval-decision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-approval-decision.js","sourceRoot":"","sources":["../src/runtime-approval-decision.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,EAAE,CAAC,iCAAiC,CAAC,CACvF,QAAQ,CAAC,EAAE,QAAyB,EAAE,QAAmD;IACvF,MAAM,QAAQ,GACZ,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,IAAI;QAC1C,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,IAAI,CACzC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CACpE;QACH,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,KAAK;YAC3C,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,IAAI,CACtC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CACpE;YACH,CAAC,CAAC,QAAQ,CAAC;IACjB,OAAO,QAAQ,CAAC;AAClB,CAAC,CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { AgentDescriptor } from "./define-agent.js";
2
+ /** Checks selected native capabilities and preserves the original loader failure and lifecycle.
3
+ * @param agents - Authored native agent descriptors whose requested capabilities determine peers.
4
+ * @returns The existing owned dependency check; optional native modules load only when selected.
5
+ */
6
+ export declare function assertAgentRuntimeDependencies(agents: readonly AgentDescriptor<string, unknown, unknown>[]): Promise<void>;
7
+ //# sourceMappingURL=runtime-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-dependencies.d.ts","sourceRoot":"","sources":["../src/runtime-dependencies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAC3D,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,10 @@
1
+ /** Exposes dependency preflight without making optional DeepAgents declarations part of ordinary native authoring. */
2
+ import { assertAgentRuntimeDependencies as assertNativeDependencies } from "./runtime-native-support.js";
3
+ /** Checks selected native capabilities and preserves the original loader failure and lifecycle.
4
+ * @param agents - Authored native agent descriptors whose requested capabilities determine peers.
5
+ * @returns The existing owned dependency check; optional native modules load only when selected.
6
+ */
7
+ export function assertAgentRuntimeDependencies(agents) {
8
+ return assertNativeDependencies(agents);
9
+ }
10
+ //# sourceMappingURL=runtime-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-dependencies.js","sourceRoot":"","sources":["../src/runtime-dependencies.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,OAAO,EAAE,8BAA8B,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGzG;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,MAA4D;IAE5D,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** Normalizes Effect failures from native invocation adapters while retaining the original failure cause at the public runtime boundary. */
2
+ import { Schema } from "effect";
3
+ declare const AgentInvocationFailure_base: Schema.Class<AgentInvocationFailure, Schema.TaggedStruct<"AgentInvocationFailure", {
4
+ readonly code: Schema.String;
5
+ readonly message: Schema.String;
6
+ readonly cause: Schema.Unknown;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ /** A typed Effect failure that retains the public invocation error as its cause. */
9
+ export declare class AgentInvocationFailure extends AgentInvocationFailure_base {
10
+ }
11
+ /** Captures an invocation failure without losing compatibility error details.
12
+ * @param cause - Rejected dependency, validation, or runtime error.
13
+ * @returns A tagged failure carrying its original cause.
14
+ * @example agentInvocationFailure(new Error("model unavailable"));
15
+ */
16
+ export declare function agentInvocationFailure(cause: unknown): AgentInvocationFailure;
17
+ export {};
18
+ //# sourceMappingURL=runtime-effect-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-effect-error.d.ts","sourceRoot":"","sources":["../src/runtime-effect-error.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAE5I,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;AAGhC,oFAAoF;AACpF,qBAAa,sBAAuB,SAAQ,2BAG3C;CAAG;AAEJ;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAM7E"}
@@ -0,0 +1,19 @@
1
+ /** Normalizes Effect failures from native invocation adapters while retaining the original failure cause at the public runtime boundary. */
2
+ import { Schema } from "effect";
3
+ import { AgentRuntimeError } from "./runtime-errors.js";
4
+ /** A typed Effect failure that retains the public invocation error as its cause. */
5
+ export class AgentInvocationFailure extends Schema.TaggedError()("AgentInvocationFailure", { code: Schema.String, message: Schema.String, cause: Schema.Unknown }) {
6
+ }
7
+ /** Captures an invocation failure without losing compatibility error details.
8
+ * @param cause - Rejected dependency, validation, or runtime error.
9
+ * @returns A tagged failure carrying its original cause.
10
+ * @example agentInvocationFailure(new Error("model unavailable"));
11
+ */
12
+ export function agentInvocationFailure(cause) {
13
+ return new AgentInvocationFailure({
14
+ code: cause instanceof AgentRuntimeError ? cause.code : "RELKIT_AGENT_INVOCATION_FAILED",
15
+ message: cause instanceof Error ? cause.message : String(cause),
16
+ cause,
17
+ });
18
+ }
19
+ //# sourceMappingURL=runtime-effect-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-effect-error.js","sourceRoot":"","sources":["../src/runtime-effect-error.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAE5I,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,oFAAoF;AACpF,MAAM,OAAO,sBAAuB,SAAQ,MAAM,CAAC,WAAW,EAA0B,CACtF,wBAAwB,EACxB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,CACvE;CAAG;AAEJ;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,OAAO,IAAI,sBAAsB,CAAC;QAChC,IAAI,EAAE,KAAK,YAAY,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC;QACxF,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,KAAK;KACN,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Constructs invocation failures with agent identity and native causes, including selected dependency failures and execution errors. */
2
+ import type { StandardIssue } from "@relkit/schema";
3
+ /** Safe public failure fields; a non-enumerable native cause is private diagnostic data. */
4
+ export declare class AgentRuntimeError extends Error {
5
+ readonly code: string;
6
+ readonly issues?: readonly StandardIssue[] | undefined;
7
+ /** @param code - Stable failure code. @param message - Safe public description.
8
+ * @param issues - Validation issues. @param options - Private cause; never serialize or log raw. */
9
+ constructor(code: string, message: string, issues?: readonly StandardIssue[] | undefined, options?: ErrorOptions);
10
+ }
11
+ //# sourceMappingURL=runtime-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-errors.d.ts","sourceRoot":"","sources":["../src/runtime-errors.ts"],"names":[],"mappings":"AAAA,yIAAyI;AAEzI,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,4FAA4F;AAC5F,qBAAa,iBAAkB,SAAQ,KAAK;IAIxC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAErB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE;IAL5C;wGACoG;gBAEzF,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACN,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,YAAA,EAC1C,OAAO,CAAC,EAAE,YAAY;CAKzB"}
@@ -0,0 +1,15 @@
1
+ /** Constructs invocation failures with agent identity and native causes, including selected dependency failures and execution errors. */
2
+ /** Safe public failure fields; a non-enumerable native cause is private diagnostic data. */
3
+ export class AgentRuntimeError extends Error {
4
+ code;
5
+ issues;
6
+ /** @param code - Stable failure code. @param message - Safe public description.
7
+ * @param issues - Validation issues. @param options - Private cause; never serialize or log raw. */
8
+ constructor(code, message, issues, options) {
9
+ super(message, options);
10
+ this.code = code;
11
+ this.issues = issues;
12
+ this.name = "AgentRuntimeError";
13
+ }
14
+ }
15
+ //# sourceMappingURL=runtime-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-errors.js","sourceRoot":"","sources":["../src/runtime-errors.ts"],"names":[],"mappings":"AAAA,yIAAyI;AAIzI,4FAA4F;AAC5F,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAI/B;IAEA;IALX;wGACoG;IACpG,YACW,IAAY,EACrB,OAAe,EACN,MAAiC,EAC1C,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QALf,SAAI,GAAJ,IAAI,CAAQ;QAEZ,WAAM,GAAN,MAAM,CAA2B;QAI1C,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ /** Records bounded failure categories at the invocation boundary; native causes remain private and are never logged raw. */
2
+ import { Effect } from "effect";
3
+ import type { AgentInvocationFailure } from "./runtime-effect-error.js";
4
+ import type { AgentInvocationOptions, AgentRuntimeOptions } from "./runtime.types.js";
5
+ /** Logs one safe diagnostic before public failure mapping, without retrying execution.
6
+ * @param failure - Typed invocation failure retaining the private cause.
7
+ * @param options - Authored agent and invocation identities; input/output are excluded.
8
+ * @returns Logging effect, or no operation for waiting/cancelled control flow. */
9
+ export declare function logAgentFailure(failure: AgentInvocationFailure, options: AgentRuntimeOptions & AgentInvocationOptions): Effect.Effect<void, never, never>;
10
+ //# sourceMappingURL=runtime-failure-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-failure-diagnostics.d.ts","sourceRoot":"","sources":["../src/runtime-failure-diagnostics.ts"],"names":[],"mappings":"AAAA,4HAA4H;AAC5H,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmCtF;;;kFAGkF;AAClF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,mBAAmB,GAAG,sBAAsB,qCAoBtD"}
@@ -0,0 +1,61 @@
1
+ /** Records bounded failure categories at the invocation boundary; native causes remain private and are never logged raw. */
2
+ import { Effect } from "effect";
3
+ import { GraphInterruptedError } from "./graph-interruption.js";
4
+ import { AgentRuntimeError } from "./runtime-errors.js";
5
+ const codes = new Set([
6
+ "RELKIT_AGENT_INPUT_VALIDATION",
7
+ "RELKIT_AGENT_OUTPUT_VALIDATION",
8
+ "RELKIT_AGENT_MODEL_ERROR",
9
+ "RELKIT_AGENT_MODEL_UNAVAILABLE",
10
+ "RELKIT_AGENT_RESPONSE_LIMIT",
11
+ "RELKIT_AGENT_STEP_LIMIT",
12
+ "RELKIT_AGENT_TOOL_LIMIT",
13
+ "RELKIT_AGENT_TIMEOUT",
14
+ "RELKIT_AGENT_JSON_INVALID",
15
+ "RELKIT_AGENT_LIMIT_INVALID",
16
+ "RELKIT_SCHEMA_UNAVAILABLE",
17
+ "RELKIT_TOOL_UNKNOWN",
18
+ ]);
19
+ const nativeNames = new Set([
20
+ "Error",
21
+ "TypeError",
22
+ "SyntaxError",
23
+ "RangeError",
24
+ "APIError",
25
+ "BadRequestError",
26
+ "AuthenticationError",
27
+ "PermissionDeniedError",
28
+ "NotFoundError",
29
+ "ConflictError",
30
+ "UnprocessableEntityError",
31
+ "RateLimitError",
32
+ "InternalServerError",
33
+ "APIConnectionError",
34
+ "APIConnectionTimeoutError",
35
+ "StructuredOutputParsingError",
36
+ ]);
37
+ /** Logs one safe diagnostic before public failure mapping, without retrying execution.
38
+ * @param failure - Typed invocation failure retaining the private cause.
39
+ * @param options - Authored agent and invocation identities; input/output are excluded.
40
+ * @returns Logging effect, or no operation for waiting/cancelled control flow. */
41
+ export function logAgentFailure(failure, options) {
42
+ const cause = failure.cause;
43
+ if (cause instanceof GraphInterruptedError)
44
+ return Effect.void;
45
+ if (cause instanceof AgentRuntimeError && cause.code === "RELKIT_AGENT_CANCELLED")
46
+ return Effect.void;
47
+ const native = cause instanceof Error && cause.cause instanceof Error ? cause.cause : cause;
48
+ const status = native instanceof Error && "status" in native ? native.status : undefined;
49
+ return Effect.logError("Agent invocation failed", {
50
+ agentId: options.agent.id,
51
+ invocationId: options.invocationId,
52
+ traceId: options.traceId,
53
+ threadId: options.threadId,
54
+ code: codes.has(failure.code) ? failure.code : "RELKIT_AGENT_INVOCATION_FAILED",
55
+ nativeType: native instanceof Error && nativeNames.has(native.name) ? native.name : "unclassified",
56
+ ...(typeof status === "number" && Number.isInteger(status) && status >= 100 && status <= 599
57
+ ? { providerStatus: status }
58
+ : {}),
59
+ });
60
+ }
61
+ //# sourceMappingURL=runtime-failure-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-failure-diagnostics.js","sourceRoot":"","sources":["../src/runtime-failure-diagnostics.ts"],"names":[],"mappings":"AAAA,4HAA4H;AAC5H,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC;IACpB,+BAA+B;IAC/B,gCAAgC;IAChC,0BAA0B;IAC1B,gCAAgC;IAChC,6BAA6B;IAC7B,yBAAyB;IACzB,yBAAyB;IACzB,sBAAsB;IACtB,2BAA2B;IAC3B,4BAA4B;IAC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;QAC/E,UAAU,EACR,MAAM,YAAY,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;QACxF,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG;YAC1F,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE;YAC5B,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const runtimeIntegration: Readonly<{
2
+ kind: "runtime-integration";
3
+ integrationId: "langchain";
4
+ registrations: readonly {
5
+ capability: string;
6
+ adapterId: string;
7
+ protocolVersion: number;
8
+ }[];
9
+ }>;
10
+ //# sourceMappingURL=runtime-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-integration.d.ts","sourceRoot":"","sources":["../src/runtime-integration.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;;;EAOc,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const runtimeIntegration = Object.freeze({
2
+ kind: "runtime-integration",
3
+ integrationId: "langchain",
4
+ registrations: Object.freeze([
5
+ { capability: "agent-execution", adapterId: "langchain", protocolVersion: 1 },
6
+ { capability: "agent-deep", adapterId: "deepagents", protocolVersion: 1 },
7
+ ]),
8
+ });
9
+ //# sourceMappingURL=runtime-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-integration.js","sourceRoot":"","sources":["../src/runtime-integration.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,qBAAqB;IAC3B,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;QAC3B,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,EAAE;QAC7E,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC,EAAE;KAC1E,CAAC;CACH,CAA4C,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Effect } from "effect";
2
+ import type { AgentExecutionService } from "./runtime-service.types.js";
3
+ import type { NativeAgentRuntimeOptions } from "./runtime-native-agent.types.js";
4
+ /** Resolves validated invocation identity, capture policy and native model.
5
+ * @param options - Agent runtime and invocation inputs.
6
+ * @param service - Selected native execution service.
7
+ * @returns Validated native dependencies or the original tagged failure.
8
+ */
9
+ export declare const resolveNativeInvocationEffect: (options: NativeAgentRuntimeOptions, service: AgentExecutionService) => Effect.Effect<{
10
+ capture: import("@relkit/agents/internal/capture").AgentCapturePolicy;
11
+ invocationId: import("@relkit/contracts").StableId;
12
+ traceId: import("@relkit/contracts").StableId;
13
+ runtimeModel: import("./runtime-model.types.js").ResolvedRuntimeModel;
14
+ }, import("./runtime-effect-error.js").AgentInvocationFailure, never>;
15
+ /** Runs native work inside the original scoped signal and trace boundary.
16
+ * @param options - Agent runtime and invocation inputs.
17
+ * @param service - Selected native execution service.
18
+ * @param invocation - Resolved identity, model and capture policy.
19
+ * @returns Native output with linked cancellation and scoped cleanup.
20
+ */
21
+ export declare const invokeNativeWithContextEffect: (options: NativeAgentRuntimeOptions, service: AgentExecutionService, invocation: {
22
+ capture: import("@relkit/agents/internal/capture").AgentCapturePolicy;
23
+ invocationId: import("@relkit/contracts").StableId;
24
+ traceId: import("@relkit/contracts").StableId;
25
+ runtimeModel: import("./runtime-model.types.js").ResolvedRuntimeModel;
26
+ }) => Effect.Effect<unknown, import("./runtime-effect-error.js").AgentInvocationFailure, never>;
27
+ //# sourceMappingURL=runtime-invoke.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-invoke.d.ts","sourceRoot":"","sources":["../src/runtime-invoke.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;qEA6BzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;+FAoDxC,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Resolves model and invocation identities before acquiring the scoped native
3
+ * signal; stream work inherits the same tracing and cancellation context.
4
+ */
5
+ import { normalizeId } from "@relkit/contracts";
6
+ import { frameworkTrace } from "@relkit/invocation";
7
+ import { Effect } from "effect";
8
+ import { createAgentCapturePolicyEffect } from "@relkit/agents/internal/capture-policy";
9
+ import { generatedAgentFunctionId } from "@relkit/agents/internal/generated-function";
10
+ import { signalFailure, validateValue, withSignal } from "./runtime-utils.js";
11
+ import { acquireExecutionSignalEffect, ExecutionSignalClockLive } from "./signal.js";
12
+ import { agentInvocationFailure } from "./runtime-effect-error.js";
13
+ /** Resolves validated invocation identity, capture policy and native model.
14
+ * @param options - Agent runtime and invocation inputs.
15
+ * @param service - Selected native execution service.
16
+ * @returns Validated native dependencies or the original tagged failure.
17
+ */
18
+ export const resolveNativeInvocationEffect = Effect.fn("Agents.runtime.resolveInvocation")(function* (options, service) {
19
+ const agent = options.agent;
20
+ const capture = yield* createAgentCapturePolicyEffect(options.capture).pipe(Effect.mapError((error) => agentInvocationFailure(new TypeError(error.message))));
21
+ const invocationId = yield* Effect.try({
22
+ try: () => normalizeId(options.invocationId ?? `agent-${service.randomUUID()}`),
23
+ catch: agentInvocationFailure,
24
+ });
25
+ const traceId = yield* Effect.try({
26
+ try: () => normalizeId(options.traceId ?? invocationId),
27
+ catch: agentInvocationFailure,
28
+ });
29
+ const runtimeModel = yield* Effect.tryPromise({
30
+ try: () => service.resolveModel({
31
+ ...(agent.model === undefined ? {} : { model: agent.model }),
32
+ registry: options.modelRegistry,
33
+ environment: options.environment ?? {},
34
+ ...(options.maxInputBytes === undefined ? {} : { maxInputBytes: options.maxInputBytes }),
35
+ ...(options.maxOutputBytes === undefined
36
+ ? {}
37
+ : { maxOutputBytes: options.maxOutputBytes }),
38
+ }),
39
+ catch: agentInvocationFailure,
40
+ });
41
+ return { capture, invocationId, traceId, runtimeModel };
42
+ });
43
+ /** Runs native work inside the original scoped signal and trace boundary.
44
+ * @param options - Agent runtime and invocation inputs.
45
+ * @param service - Selected native execution service.
46
+ * @param invocation - Resolved identity, model and capture policy.
47
+ * @returns Native output with linked cancellation and scoped cleanup.
48
+ */
49
+ export const invokeNativeWithContextEffect = Effect.fn("Agents.runtime.invokeNative")(function* (options, service, invocation) {
50
+ const { capture, invocationId, traceId, runtimeModel } = invocation;
51
+ return yield* Effect.scoped(Effect.gen(function* () {
52
+ const execution = yield* acquireExecutionSignalEffect(options).pipe(Effect.provide(ExecutionSignalClockLive));
53
+ return yield* Effect.tryPromise({
54
+ try: (effectSignal) => {
55
+ const signal = AbortSignal.any([execution.signal, effectSignal]);
56
+ return frameworkTrace.span(`relkit.agent.${options.agent.id}.invoke`, {
57
+ input: options.input,
58
+ attributes: {
59
+ "relkit.agent.id": options.agent.id,
60
+ "relkit.function.id": generatedAgentFunctionId(options.agent.id),
61
+ "relkit.invocation.id": invocationId,
62
+ "relkit.model.id": runtimeModel.id,
63
+ },
64
+ }, async () => {
65
+ if (signal.aborted)
66
+ throw signalFailure(signal);
67
+ const input = options.resume
68
+ ? options.input
69
+ : await withSignal(validateValue(options.agent.input, options.input, "input"), signal);
70
+ return service.runLoop(options, runtimeModel.model, runtimeModel.id, signal, input, runtimeModel.maxInputBytes, runtimeModel.maxOutputBytes, invocationId, traceId, capture);
71
+ });
72
+ },
73
+ catch: agentInvocationFailure,
74
+ });
75
+ }));
76
+ });
77
+ //# sourceMappingUR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C3B,YAAY,EACZ,OAAO,EACP,OAAO,CACR,CAAC;gBACJ,CAAC,CACF,CAAC;YACJ,CAAC;YACD,KAAK,EAAE,sBAAsB;SAC9B,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Carries one native loop's already acquired runnable, identity, state selection
3
+ * and signal to stream/settlement helpers without allocating another lifetime.
4
+ */
5
+ import type { AgentLoopOptions } from "./runtime-loop.types.js";
6
+ import type { createNativeAgent } from "./runtime-native-agent.js";
7
+ import type { createLoopTelemetry } from "./runtime-loop-telemetry.js";
8
+ export interface NativeAgentLoopContext {
9
+ readonly options: AgentLoopOptions;
10
+ readonly native: Awaited<ReturnType<typeof createNativeAgent>>;
11
+ readonly config: {
12
+ readonly configurable?: {
13
+ readonly thread_id: string;
14
+ };
15
+ };
16
+ readonly input: unknown;
17
+ readonly signal: AbortSignal;
18
+ readonly maxInputBytes: number;
19
+ readonly maxOutputBytes: number;
20
+ readonly observe: ReturnType<typeof createLoopTelemetry>;
21
+ }
22
+ //# sourceMappingURL=runtime-loop-context.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-context.types.d.ts","sourceRoot":"","sources":["../src/runtime-loop-context.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,YAAY,CAAC,EAAE;YAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAC5E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;CAC1D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtime-loop-context.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-context.types.js","sourceRoot":"","sources":["../src/runtime-loop-context.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { AgentCapturePolicy } from "@relkit/agents/internal/observability";
2
+ import type { AgentLoopOptions, NativeModel } from "./runtime-loop.types.js";
3
+ export declare function runAgentLoopCore(options: AgentLoopOptions, model: NativeModel, modelId: string, signal: AbortSignal, input: unknown, maxInputBytes: number, maxOutputBytes: number, invocationId: string, traceId: string, capture: AgentCapturePolicy): Promise<unknown>;
4
+ //# sourceMappingURL=runtime-loop-execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-execution.d.ts","sourceRoot":"","sources":["../src/runtime-loop-execution.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAQhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG7E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,OAAO,CAAC,CA+ClB"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Executes one native agent stream while retaining model failure precedence.
3
+ * Public wrappers own Effect interruption; state helpers use the same signal.
4
+ */
5
+ import { frameworkTrace } from "@relkit/invocation";
6
+ import { AgentRuntimeError } from "./runtime-errors.js";
7
+ import { createLoopTelemetry } from "./runtime-loop-telemetry.js";
8
+ import { createNativeAgent, StructuredOutputParsingError } from "./runtime-native-agent.js";
9
+ import { GraphInterruptedError } from "./graph-interruption.js";
10
+ import { modelFailure, signalFailure } from "./runtime-utils.js";
11
+ import { unwrapNativeCause } from "./runtime-loop-values.js";
12
+ import { streamNativeAgentLoop, settleNativeAgentLoop } from "./runtime-loop-state.js";
13
+ export async function runAgentLoopCore(options, model, modelId, signal, input, maxInputBytes, maxOutputBytes, invocationId, traceId, capture) {
14
+ const native = await createNativeAgent({
15
+ runtime: {
16
+ ...options,
17
+ agent: options.agent,
18
+ },
19
+ model,
20
+ signal,
21
+ maxOutputBytes,
22
+ invocationId,
23
+ traceId,
24
+ });
25
+ const observe = createLoopTelemetry(options, modelId);
26
+ const config = options.threadId === undefined ? {} : { configurable: { thread_id: options.threadId } };
27
+ const context = {
28
+ options,
29
+ native,
30
+ config,
31
+ input,
32
+ signal,
33
+ maxInputBytes,
34
+ maxOutputBytes,
35
+ observe,
36
+ };
37
+ try {
38
+ const state = await frameworkTrace.span(`relkit.agent.${options.agent.id}.model`, {
39
+ input,
40
+ kind: "client",
41
+ attributes: { "relkit.agent.id": options.agent.id, "relkit.model.id": modelId },
42
+ }, () => streamNativeAgentLoop(context));
43
+ return settleNativeAgentLoop(context, state);
44
+ }
45
+ catch (cause) {
46
+ const nativeCause = unwrapNativeCause(cause);
47
+ if (signal.aborted)
48
+ throw signalFailure(signal);
49
+ if (native.tools.failure() !== undefined)
50
+ throw native.tools.failure();
51
+ if (nativeCause instanceof AgentRuntimeError)
52
+ throw nativeCause;
53
+ if (nativeCause instanceof GraphInterruptedError)
54
+ throw nativeCause;
55
+ if (nativeCause instanceof StructuredOutputParsingError) {
56
+ throw new AgentRuntimeError("RELKIT_AGENT_OUTPUT_VALIDATION", "Output validation failed");
57
+ }
58
+ throw modelFailure(nativeCause, signal);
59
+ }
60
+ }
61
+ //# sourceMappingURL=runtime-loop-execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-execution.js","sourceRoot":"","sources":["../src/runtime-loop-execution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAyB,EACzB,KAAkB,EAClB,OAAe,EACf,MAAmB,EACnB,KAAc,EACd,aAAqB,EACrB,cAAsB,EACtB,YAAoB,EACpB,OAAe,EACf,OAA2B;IAE3B,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC;QACrC,OAAO,EAAE;YACP,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,CAAC,KAAkD;SAClE;QACD,KAAK;QACL,MAAM;QACN,cAAc;QACd,YAAY;QACZ,OAAO;KACR,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,mBAAmB,CAAC,O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AM,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { NativeAgentLoopContext } from "./runtime-loop-context.types.js";
2
+ /** Collects the native stream under its caller's existing trace and signal.
3
+ * @param context - Runnable and per-invocation dependencies.
4
+ * @returns The native final state after stream collection.
5
+ */
6
+ export declare function streamNativeAgentLoop(context: NativeAgentLoopContext): Promise<any>;
7
+ /** Publishes waiting state or validated output without changing persistence identity.
8
+ * @param context - Existing runnable, checkpoint config and content sink.
9
+ * @param state - Native final state before public output validation.
10
+ * @returns Validated output, or the existing graph interruption error.
11
+ */
12
+ export declare function settleNativeAgentLoop(context: NativeAgentLoopContext, state: unknown): Promise<unknown>;
13
+ //# sourceMappingURL=runtime-loop-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-state.d.ts","sourceRoot":"","sources":["../src/runtime-loop-state.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,gBAiC1E;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,OAAO,oBA6B1F"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Streams one already acquired native runnable and settles its public output or
3
+ * interruption using the same checkpoint identity, byte limits and content sink.
4
+ */
5
+ import { isInterrupted } from "@langchain/langgraph";
6
+ import { collectNativeEvents } from "./runtime-native-events.js";
7
+ import { selectedStateSchemas } from "./runtime-state-schemas.js";
8
+ import { nativeAgentResumeCommand, nativeAgentWaitingInterrupts, } from "./native-agent-interruption.js";
9
+ import { GraphInterruptedError, graphWaitingResponse, publicWaitingRequests, } from "./graph-interruption.js";
10
+ import { jsonValue, validateValue, withSignal } from "./runtime-utils.js";
11
+ import { nativeMessages, responseValue } from "./runtime-loop-values.js";
12
+ /** Collects the native stream under its caller's existing trace and signal.
13
+ * @param context - Runnable and per-invocation dependencies.
14
+ * @returns The native final state after stream collection.
15
+ */
16
+ export async function streamNativeAgentLoop(context) {
17
+ const { options, native, config, input, signal, maxInputBytes, observe } = context;
18
+ if (options.resume && options.threadId === undefined) {
19
+ throw new TypeError("Agent resume requires threadId");
20
+ }
21
+ const nativeInput = options.resume
22
+ ? await nativeAgentResumeCommand(native.agent, config, input)
23
+ : { messages: nativeMessages(options, input, maxInputBytes) };
24
+ const run = await withSignal(native.agent.streamEvents(nativeInput, {
25
+ version: "v3",
26
+ signal,
27
+ ...config,
28
+ }), signal);
29
+ await collectNativeEvents(run, options.contentSink, native.tools.publicIds, native.tools.relkitNames, signal, options.agent.limits, selectedStateSchemas(options.agent.middleware.map((middleware) => middleware.stateSchema), options.agent.client?.state ?? []), native.tools.failure, observe, (reason) => run.abort(reason), options.agent.client?.events);
30
+ return withSignal(run.output, signal);
31
+ }
32
+ /** Publishes waiting state or validated output without changing persistence identity.
33
+ * @param context - Existing runnable, checkpoint config and content sink.
34
+ * @param state - Native final state before public output validation.
35
+ * @returns Validated output, or the existing graph interruption error.
36
+ */
37
+ export async function settleNativeAgentLoop(context, state) {
38
+ const { options, native, config, signal, maxOutputBytes } = context;
39
+ if (isInterrupted(state)) {
40
+ if (options.threadId === undefined) {
41
+ throw new TypeError("Agent interruption requires threadId");
42
+ }
43
+ const interrupts = await nativeAgentWaitingInterrupts(native.agent, config);
44
+ await withSignal(options.contentSink?.emitWaiting?.({
45
+ response: graphWaitingResponse(interrupts),
46
+ requests: publicWaitingRequests(interrupts),
47
+ }, signal), signal);
48
+ throw new GraphInterruptedError(options.threadId, interrupts);
49
+ }
50
+ const output = await validateValue(options.agent.output, jsonValue(responseValue(state), maxOutputBytes, "agent output"), "output");
51
+ if (options.contentSink !== undefined) {
52
+ await withSignal(options.contentSink.emitOutput(output, signal), signal);
53
+ await withSignal(options.contentSink.finishOutput?.(signal), signal);
54
+ }
55
+ return output;
56
+ }
57
+ //# sourceMappingURL=runtime-loop-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-loop-state.js","sourceRoot":"","sources":["../src/runtime-loop-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAA+B;IACzE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACnF,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM;QAChC,CAAC,CAAC,MAAM,wBAAwB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;QAC7D,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC;IAChE,MAAM,GAAG,GAAG,MAAM,UAAU,CAC1B,MAAM,CAAC,KAAK,CAAC,YA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