@alneas/eaos-server 0.0.0-stage → 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 (350) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.ja.md +39 -0
  4. package/README.md +40 -2
  5. package/dist/agentic/agent-jobs.d.ts +329 -0
  6. package/dist/agentic/agent-jobs.js +15 -0
  7. package/dist/agentic/agent-jobs.js.map +1 -0
  8. package/dist/agentic/agent-node.d.ts +40 -0
  9. package/dist/agentic/agent-node.js +7 -0
  10. package/dist/agentic/agent-node.js.map +1 -0
  11. package/dist/agentic/agent-runner.d.ts +33 -0
  12. package/dist/agentic/agent-runner.js +7 -0
  13. package/dist/agentic/agent-runner.js.map +1 -0
  14. package/dist/agentic/ai-broker.d.ts +169 -0
  15. package/dist/agentic/ai-broker.js +8 -0
  16. package/dist/agentic/ai-broker.js.map +1 -0
  17. package/dist/agentic/atomic-checkpointer.d.ts +137 -0
  18. package/dist/agentic/atomic-checkpointer.js +9 -0
  19. package/dist/agentic/atomic-checkpointer.js.map +1 -0
  20. package/dist/agentic/autonomous-worker.d.ts +95 -0
  21. package/dist/agentic/autonomous-worker.js +9 -0
  22. package/dist/agentic/autonomous-worker.js.map +1 -0
  23. package/dist/agentic/event-bridge.d.ts +344 -0
  24. package/dist/agentic/event-bridge.js +9 -0
  25. package/dist/agentic/event-bridge.js.map +1 -0
  26. package/dist/agentic/executor.d.ts +91 -0
  27. package/dist/agentic/executor.js +12 -0
  28. package/dist/agentic/executor.js.map +1 -0
  29. package/dist/agentic/graph-projection.d.ts +119 -0
  30. package/dist/agentic/graph-projection.js +7 -0
  31. package/dist/agentic/graph-projection.js.map +1 -0
  32. package/dist/agentic/graph.d.ts +524 -0
  33. package/dist/agentic/graph.js +7 -0
  34. package/dist/agentic/graph.js.map +1 -0
  35. package/dist/agentic/index.d.ts +24 -0
  36. package/dist/agentic/index.js +86 -0
  37. package/dist/agentic/index.js.map +1 -0
  38. package/dist/agentic/local-runner.d.ts +102 -0
  39. package/dist/agentic/local-runner.js +7 -0
  40. package/dist/agentic/local-runner.js.map +1 -0
  41. package/dist/agentic/remote-executor.d.ts +67 -0
  42. package/dist/agentic/remote-executor.js +8 -0
  43. package/dist/agentic/remote-executor.js.map +1 -0
  44. package/dist/agentic/types.d.ts +157 -0
  45. package/dist/agentic/types.js +7 -0
  46. package/dist/agentic/types.js.map +1 -0
  47. package/dist/agentic/workflow-catalog.d.ts +152 -0
  48. package/dist/agentic/workflow-catalog.js +7 -0
  49. package/dist/agentic/workflow-catalog.js.map +1 -0
  50. package/dist/agentic/workflow-compiler.d.ts +44 -0
  51. package/dist/agentic/workflow-compiler.js +8 -0
  52. package/dist/agentic/workflow-compiler.js.map +1 -0
  53. package/dist/agentic/workflow-coordinator.d.ts +170 -0
  54. package/dist/agentic/workflow-coordinator.js +8 -0
  55. package/dist/agentic/workflow-coordinator.js.map +1 -0
  56. package/dist/agentic/workflow-manager.d.ts +91 -0
  57. package/dist/agentic/workflow-manager.js +7 -0
  58. package/dist/agentic/workflow-manager.js.map +1 -0
  59. package/dist/agentic/workflow-registry.d.ts +334 -0
  60. package/dist/agentic/workflow-registry.js +7 -0
  61. package/dist/agentic/workflow-registry.js.map +1 -0
  62. package/dist/artifacts-CteHmCMI.d.ts +614 -0
  63. package/dist/auth-hooks/api-key.d.ts +75 -0
  64. package/dist/auth-hooks/api-key.js +7 -0
  65. package/dist/auth-hooks/api-key.js.map +1 -0
  66. package/dist/auth-hooks/index.d.ts +80 -0
  67. package/dist/auth-hooks/index.js +28 -0
  68. package/dist/auth-hooks/index.js.map +1 -0
  69. package/dist/browser-auth/account-memberships.d.ts +213 -0
  70. package/dist/browser-auth/account-memberships.js +13 -0
  71. package/dist/browser-auth/account-memberships.js.map +1 -0
  72. package/dist/browser-auth/index.d.ts +8 -0
  73. package/dist/browser-auth/index.js +59 -0
  74. package/dist/browser-auth/index.js.map +1 -0
  75. package/dist/browser-auth/kratos-session.d.ts +37 -0
  76. package/dist/browser-auth/kratos-session.js +7 -0
  77. package/dist/browser-auth/kratos-session.js.map +1 -0
  78. package/dist/browser-auth/platform-session.d.ts +120 -0
  79. package/dist/browser-auth/platform-session.js +7 -0
  80. package/dist/browser-auth/platform-session.js.map +1 -0
  81. package/dist/browser-auth/public-memberships.d.ts +22 -0
  82. package/dist/browser-auth/public-memberships.js +7 -0
  83. package/dist/browser-auth/public-memberships.js.map +1 -0
  84. package/dist/cache/index.d.ts +181 -0
  85. package/dist/cache/index.js +197 -0
  86. package/dist/cache/index.js.map +1 -0
  87. package/dist/chunk-32746UQZ.js +131 -0
  88. package/dist/chunk-32746UQZ.js.map +1 -0
  89. package/dist/chunk-3NLSWP2Y.js +223 -0
  90. package/dist/chunk-3NLSWP2Y.js.map +1 -0
  91. package/dist/chunk-3P4XTTQH.js +346 -0
  92. package/dist/chunk-3P4XTTQH.js.map +1 -0
  93. package/dist/chunk-3VITSHN3.js +15 -0
  94. package/dist/chunk-3VITSHN3.js.map +1 -0
  95. package/dist/chunk-46UWPEW2.js +226 -0
  96. package/dist/chunk-46UWPEW2.js.map +1 -0
  97. package/dist/chunk-4VORUFKR.js +45 -0
  98. package/dist/chunk-4VORUFKR.js.map +1 -0
  99. package/dist/chunk-55D4ERWO.js +1 -0
  100. package/dist/chunk-55D4ERWO.js.map +1 -0
  101. package/dist/chunk-5TBBZIND.js +18 -0
  102. package/dist/chunk-5TBBZIND.js.map +1 -0
  103. package/dist/chunk-5WOZWPZA.js +211 -0
  104. package/dist/chunk-5WOZWPZA.js.map +1 -0
  105. package/dist/chunk-6CBVZ6CT.js +168 -0
  106. package/dist/chunk-6CBVZ6CT.js.map +1 -0
  107. package/dist/chunk-6KV5CJBW.js +221 -0
  108. package/dist/chunk-6KV5CJBW.js.map +1 -0
  109. package/dist/chunk-6XZXYNJR.js +74 -0
  110. package/dist/chunk-6XZXYNJR.js.map +1 -0
  111. package/dist/chunk-753HWDSC.js +222 -0
  112. package/dist/chunk-753HWDSC.js.map +1 -0
  113. package/dist/chunk-7AHSS7SO.js +81 -0
  114. package/dist/chunk-7AHSS7SO.js.map +1 -0
  115. package/dist/chunk-7FTJN4SA.js +1 -0
  116. package/dist/chunk-7FTJN4SA.js.map +1 -0
  117. package/dist/chunk-AVDMLTPF.js +24 -0
  118. package/dist/chunk-AVDMLTPF.js.map +1 -0
  119. package/dist/chunk-BKAHUEIT.js +95 -0
  120. package/dist/chunk-BKAHUEIT.js.map +1 -0
  121. package/dist/chunk-CJ7OFEF7.js +134 -0
  122. package/dist/chunk-CJ7OFEF7.js.map +1 -0
  123. package/dist/chunk-DHQGNP4T.js +770 -0
  124. package/dist/chunk-DHQGNP4T.js.map +1 -0
  125. package/dist/chunk-EJKWDZIU.js +111 -0
  126. package/dist/chunk-EJKWDZIU.js.map +1 -0
  127. package/dist/chunk-F3O7CELI.js +23 -0
  128. package/dist/chunk-F3O7CELI.js.map +1 -0
  129. package/dist/chunk-FD6VC2NA.js +66 -0
  130. package/dist/chunk-FD6VC2NA.js.map +1 -0
  131. package/dist/chunk-FRRRWAHO.js +14 -0
  132. package/dist/chunk-FRRRWAHO.js.map +1 -0
  133. package/dist/chunk-HCKAGLLB.js +17 -0
  134. package/dist/chunk-HCKAGLLB.js.map +1 -0
  135. package/dist/chunk-HVC7FG6B.js +191 -0
  136. package/dist/chunk-HVC7FG6B.js.map +1 -0
  137. package/dist/chunk-HXFVOR7Z.js +496 -0
  138. package/dist/chunk-HXFVOR7Z.js.map +1 -0
  139. package/dist/chunk-IJWYS2PF.js +122 -0
  140. package/dist/chunk-IJWYS2PF.js.map +1 -0
  141. package/dist/chunk-INCHXAFK.js +1395 -0
  142. package/dist/chunk-INCHXAFK.js.map +1 -0
  143. package/dist/chunk-JT6BRGQM.js +1 -0
  144. package/dist/chunk-JT6BRGQM.js.map +1 -0
  145. package/dist/chunk-L6PMAEMB.js +115 -0
  146. package/dist/chunk-L6PMAEMB.js.map +1 -0
  147. package/dist/chunk-LOUGW6MU.js +126 -0
  148. package/dist/chunk-LOUGW6MU.js.map +1 -0
  149. package/dist/chunk-LYPZPE53.js +129 -0
  150. package/dist/chunk-LYPZPE53.js.map +1 -0
  151. package/dist/chunk-NNCCN7JP.js +186 -0
  152. package/dist/chunk-NNCCN7JP.js.map +1 -0
  153. package/dist/chunk-PBC3MZUL.js +212 -0
  154. package/dist/chunk-PBC3MZUL.js.map +1 -0
  155. package/dist/chunk-R4ADP2DC.js +20 -0
  156. package/dist/chunk-R4ADP2DC.js.map +1 -0
  157. package/dist/chunk-RHN4Y6VS.js +44 -0
  158. package/dist/chunk-RHN4Y6VS.js.map +1 -0
  159. package/dist/chunk-THYUY5ZZ.js +204 -0
  160. package/dist/chunk-THYUY5ZZ.js.map +1 -0
  161. package/dist/chunk-UGNTCOVR.js +28 -0
  162. package/dist/chunk-UGNTCOVR.js.map +1 -0
  163. package/dist/chunk-VC2PCK2S.js +31 -0
  164. package/dist/chunk-VC2PCK2S.js.map +1 -0
  165. package/dist/chunk-VF5YDZJC.js +305 -0
  166. package/dist/chunk-VF5YDZJC.js.map +1 -0
  167. package/dist/chunk-VISRDVTK.js +675 -0
  168. package/dist/chunk-VISRDVTK.js.map +1 -0
  169. package/dist/chunk-W6O3LVBY.js +102 -0
  170. package/dist/chunk-W6O3LVBY.js.map +1 -0
  171. package/dist/chunk-WFEAKJLR.js +47 -0
  172. package/dist/chunk-WFEAKJLR.js.map +1 -0
  173. package/dist/chunk-XIEY2OF4.js +67 -0
  174. package/dist/chunk-XIEY2OF4.js.map +1 -0
  175. package/dist/chunk-XITLHDG3.js +37 -0
  176. package/dist/chunk-XITLHDG3.js.map +1 -0
  177. package/dist/chunk-XMWPYZWZ.js +61 -0
  178. package/dist/chunk-XMWPYZWZ.js.map +1 -0
  179. package/dist/chunk-XUP6CNOM.js +34 -0
  180. package/dist/chunk-XUP6CNOM.js.map +1 -0
  181. package/dist/chunk-YABTQZDJ.js +25 -0
  182. package/dist/chunk-YABTQZDJ.js.map +1 -0
  183. package/dist/chunk-YMJ7BRKU.js +510 -0
  184. package/dist/chunk-YMJ7BRKU.js.map +1 -0
  185. package/dist/chunk-ZC3XWU7B.js +28 -0
  186. package/dist/chunk-ZC3XWU7B.js.map +1 -0
  187. package/dist/chunk-ZHMTD5KV.js +90 -0
  188. package/dist/chunk-ZHMTD5KV.js.map +1 -0
  189. package/dist/chunk-ZWZDLOE7.js +160 -0
  190. package/dist/chunk-ZWZDLOE7.js.map +1 -0
  191. package/dist/db-package/db/local-first-sqlite-adapter.d.ts +432 -0
  192. package/dist/db-package/db/local-first-sqlite-adapter.js +7 -0
  193. package/dist/db-package/db/local-first-sqlite-adapter.js.map +1 -0
  194. package/dist/db-package/index.d.ts +7 -0
  195. package/dist/db-package/index.js +16 -0
  196. package/dist/db-package/index.js.map +1 -0
  197. package/dist/db-package/migration/aggregator.d.ts +86 -0
  198. package/dist/db-package/migration/aggregator.js +7 -0
  199. package/dist/db-package/migration/aggregator.js.map +1 -0
  200. package/dist/db-package/migration/index.d.ts +3 -0
  201. package/dist/db-package/migration/index.js +8 -0
  202. package/dist/db-package/migration/index.js.map +1 -0
  203. package/dist/engine.d.ts +205 -0
  204. package/dist/engine.js +20 -0
  205. package/dist/engine.js.map +1 -0
  206. package/dist/entitlements/index.d.ts +313 -0
  207. package/dist/entitlements/index.js +23 -0
  208. package/dist/entitlements/index.js.map +1 -0
  209. package/dist/execution/index.d.ts +50 -0
  210. package/dist/execution/index.js +57 -0
  211. package/dist/execution/index.js.map +1 -0
  212. package/dist/extensions/index.d.ts +172 -0
  213. package/dist/extensions/index.js +95 -0
  214. package/dist/extensions/index.js.map +1 -0
  215. package/dist/health/index.d.ts +35 -0
  216. package/dist/health/index.js +7 -0
  217. package/dist/health/index.js.map +1 -0
  218. package/dist/index.d.ts +39 -0
  219. package/dist/index.js +160 -0
  220. package/dist/index.js.map +1 -0
  221. package/dist/lifecycle/index.d.ts +133 -0
  222. package/dist/lifecycle/index.js +13 -0
  223. package/dist/lifecycle/index.js.map +1 -0
  224. package/dist/lifecycle-engine/backend-migration.d.ts +2 -0
  225. package/dist/lifecycle-engine/backend-migration.js +11 -0
  226. package/dist/lifecycle-engine/backend-migration.js.map +1 -0
  227. package/dist/lifecycle-engine/baseline.d.ts +2 -0
  228. package/dist/lifecycle-engine/baseline.js +9 -0
  229. package/dist/lifecycle-engine/baseline.js.map +1 -0
  230. package/dist/lifecycle-engine/index.d.ts +1497 -0
  231. package/dist/lifecycle-engine/index.js +41 -0
  232. package/dist/lifecycle-engine/index.js.map +1 -0
  233. package/dist/lifecycle-engine/platform/artifacts.d.ts +4 -0
  234. package/dist/lifecycle-engine/platform/artifacts.js +7 -0
  235. package/dist/lifecycle-engine/platform/artifacts.js.map +1 -0
  236. package/dist/lifecycle-engine/platform/control-plane.d.ts +12 -0
  237. package/dist/lifecycle-engine/platform/control-plane.js +2 -0
  238. package/dist/lifecycle-engine/platform/control-plane.js.map +1 -0
  239. package/dist/lifecycle-engine/platform/database-router.d.ts +118 -0
  240. package/dist/lifecycle-engine/platform/database-router.js +7 -0
  241. package/dist/lifecycle-engine/platform/database-router.js.map +1 -0
  242. package/dist/lifecycle-engine/platform/deployment-placements.d.ts +464 -0
  243. package/dist/lifecycle-engine/platform/deployment-placements.js +16 -0
  244. package/dist/lifecycle-engine/platform/deployment-placements.js.map +1 -0
  245. package/dist/lifecycle-engine/platform/deployment.d.ts +4 -0
  246. package/dist/lifecycle-engine/platform/deployment.js +17 -0
  247. package/dist/lifecycle-engine/platform/deployment.js.map +1 -0
  248. package/dist/lifecycle-engine/platform/index.d.ts +737 -0
  249. package/dist/lifecycle-engine/platform/index.js +60 -0
  250. package/dist/lifecycle-engine/platform/index.js.map +1 -0
  251. package/dist/lifecycle-engine/platform/runtime.d.ts +80 -0
  252. package/dist/lifecycle-engine/platform/runtime.js +11 -0
  253. package/dist/lifecycle-engine/platform/runtime.js.map +1 -0
  254. package/dist/lifecycle-engine/platform/site-publication.d.ts +102 -0
  255. package/dist/lifecycle-engine/platform/site-publication.js +7 -0
  256. package/dist/lifecycle-engine/platform/site-publication.js.map +1 -0
  257. package/dist/lifecycle-engine/platform/user-directory.d.ts +139 -0
  258. package/dist/lifecycle-engine/platform/user-directory.js +13 -0
  259. package/dist/lifecycle-engine/platform/user-directory.js.map +1 -0
  260. package/dist/mcp.d.ts +92 -0
  261. package/dist/mcp.js +10 -0
  262. package/dist/mcp.js.map +1 -0
  263. package/dist/middleware/auth.d.ts +118 -0
  264. package/dist/middleware/auth.js +7 -0
  265. package/dist/middleware/auth.js.map +1 -0
  266. package/dist/middleware/error-handler.d.ts +35 -0
  267. package/dist/middleware/error-handler.js +7 -0
  268. package/dist/middleware/error-handler.js.map +1 -0
  269. package/dist/middleware/module-guard.d.ts +33 -0
  270. package/dist/middleware/module-guard.js +7 -0
  271. package/dist/middleware/module-guard.js.map +1 -0
  272. package/dist/platform-admin/index.d.ts +37 -0
  273. package/dist/platform-admin/index.js +11 -0
  274. package/dist/platform-admin/index.js.map +1 -0
  275. package/dist/platform-admin/store.d.ts +346 -0
  276. package/dist/platform-admin/store.js +7 -0
  277. package/dist/platform-admin/store.js.map +1 -0
  278. package/dist/plugin-data/annotations.d.ts +6 -0
  279. package/dist/plugin-data/annotations.js +12 -0
  280. package/dist/plugin-data/annotations.js.map +1 -0
  281. package/dist/plugin-data/atomic-context.d.ts +41 -0
  282. package/dist/plugin-data/atomic-context.js +9 -0
  283. package/dist/plugin-data/atomic-context.js.map +1 -0
  284. package/dist/plugin-data/atomic.d.ts +6 -0
  285. package/dist/plugin-data/atomic.js +26 -0
  286. package/dist/plugin-data/atomic.js.map +1 -0
  287. package/dist/plugin-data/audit.d.ts +6 -0
  288. package/dist/plugin-data/audit.js +12 -0
  289. package/dist/plugin-data/audit.js.map +1 -0
  290. package/dist/plugin-data/commands.d.ts +6 -0
  291. package/dist/plugin-data/commands.js +8 -0
  292. package/dist/plugin-data/commands.js.map +1 -0
  293. package/dist/plugin-data/composite.d.ts +6 -0
  294. package/dist/plugin-data/composite.js +8 -0
  295. package/dist/plugin-data/composite.js.map +1 -0
  296. package/dist/plugin-data/delivery.d.ts +6 -0
  297. package/dist/plugin-data/delivery.js +16 -0
  298. package/dist/plugin-data/delivery.js.map +1 -0
  299. package/dist/plugin-data/index.d.ts +2798 -0
  300. package/dist/plugin-data/index.js +102 -0
  301. package/dist/plugin-data/index.js.map +1 -0
  302. package/dist/plugin-data/json-documents.d.ts +6 -0
  303. package/dist/plugin-data/json-documents.js +16 -0
  304. package/dist/plugin-data/json-documents.js.map +1 -0
  305. package/dist/plugin-data/outbox.d.ts +6 -0
  306. package/dist/plugin-data/outbox.js +16 -0
  307. package/dist/plugin-data/outbox.js.map +1 -0
  308. package/dist/plugin-data/scoped-records.d.ts +6 -0
  309. package/dist/plugin-data/scoped-records.js +10 -0
  310. package/dist/plugin-data/scoped-records.js.map +1 -0
  311. package/dist/plugin-sdk.d.ts +41 -0
  312. package/dist/plugin-sdk.js +10 -0
  313. package/dist/plugin-sdk.js.map +1 -0
  314. package/dist/sql-lifecycle/index.d.ts +138 -0
  315. package/dist/sql-lifecycle/index.js +167 -0
  316. package/dist/sql-lifecycle/index.js.map +1 -0
  317. package/dist/storage/index.d.ts +2 -0
  318. package/dist/storage/index.js +13 -0
  319. package/dist/storage/index.js.map +1 -0
  320. package/dist/storage/s3-compatible.d.ts +139 -0
  321. package/dist/storage/s3-compatible.js +11 -0
  322. package/dist/storage/s3-compatible.js.map +1 -0
  323. package/dist/tenant.d.ts +108 -0
  324. package/dist/tenant.js +9 -0
  325. package/dist/tenant.js.map +1 -0
  326. package/dist/workspace-context.d.ts +119 -0
  327. package/dist/workspace-context.js +9 -0
  328. package/dist/workspace-context.js.map +1 -0
  329. package/docs/api.md +29753 -0
  330. package/docs/db/README.md +49 -0
  331. package/docs/db/docs/api.md +1613 -0
  332. package/docs/db/docs/guide.md +47 -0
  333. package/docs/entitlements.md +60 -0
  334. package/docs/guide.md +48 -0
  335. package/docs/index.md +53 -0
  336. package/docs/ja/db/README.md +46 -0
  337. package/docs/ja/db/docs/guide.md +53 -0
  338. package/docs/ja/guide.md +46 -0
  339. package/docs/ja/lifecycle/README.md +46 -0
  340. package/docs/ja/lifecycle/docs/guide.md +45 -0
  341. package/docs/ja/storage/README.md +46 -0
  342. package/docs/ja/storage/docs/guide.md +43 -0
  343. package/docs/lifecycle/README.md +49 -0
  344. package/docs/lifecycle/docs/api.md +3770 -0
  345. package/docs/lifecycle/docs/baseline.md +50 -0
  346. package/docs/lifecycle/docs/guide.md +47 -0
  347. package/docs/storage/README.md +49 -0
  348. package/docs/storage/docs/api.md +470 -0
  349. package/docs/storage/docs/guide.md +47 -0
  350. package/package.json +345 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # @alneas/eaos-server
2
+
3
+ ## 0.1.0
4
+
5
+ ### Added
6
+
7
+ - Allow unrestricted, unmetered Public entitlement rules to skip an external paid entitlement runtime. Authentication and host lifecycle/resource admission remain mandatory.
8
+
9
+ ### Changed
10
+
11
+ - Adopt public `@alneas/appkit-core@0.2.0`, require Node.js 24 or later, and consume `@alneas/eaos-core@^0.1.0`.
12
+ - Use the portable storage download contract: downloads return `Uint8Array` or `null`. Decode text with `TextDecoder`; Node hosts can explicitly wrap bytes with `Buffer`.
13
+ - Ship English guides, source-derived API references, complete installation requirements and package history.
14
+
15
+ ### Fixed
16
+
17
+ - Read current tenant contracts inside the quota reservation's existing transaction instead of nesting a control database transaction.
18
+
19
+ ### Upgrade
20
+
21
+ - Install the exact Appkit Core 0.2.0 peer, upgrade Node.js to 24 or later, and update adapters expecting a Buffer-only download result.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 EAOS contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,39 @@
1
+ # eaos-server
2
+
3
+ ## 概要
4
+
5
+ EAOSを組み込む開発者向けに、所有する公開機能と型付きの利用入口を提供します。
6
+
7
+ ## 目的と利点
8
+
9
+ 共通の実装を再利用し、業務機能とホストの接続・認可を分離します。実装の正本は公開Monorepoにあり、本番の設定や運用証拠は含めません。コードの導入、スキーマ適用、組織への有効化は別操作です。
10
+
11
+ ## 主な機能
12
+
13
+ - 公開パッケージの型付きAPI
14
+ - 明示的なホスト接続と現在の認可
15
+ - パッケージ単位の検証と配布
16
+
17
+ ## クイックスタート
18
+
19
+ registryからの導入には公開済みの版が必要です。公開前はworkspaceが作成・検証したSHA固定tarballを使用してください。パッケージのsubpath自体をbun addの引数にはしません。
20
+
21
+ Node.js 24以上が必要です。Appkit Core 0.2.0の必須peerを一緒に導入します。実行ホストが認証・認可・接続を設定してください。
22
+
23
+ ```bash
24
+ bun add @alneas/eaos-server @alneas/appkit-core@0.2.0
25
+ ```
26
+
27
+ ```typescript
28
+ import { canonical } from '@alneas/eaos-server/lifecycle-engine'
29
+
30
+ console.log(canonical({ format: 1, operation: 'inspect' }))
31
+ ```
32
+
33
+ ## 次の手順
34
+
35
+ - [Architecture and boundaries](docs/guide.md)
36
+ - [API reference](docs/api.md)
37
+ - [EAOS composition](https://tech-docs.alneas.com/eaos-workspace/architecture/)
38
+
39
+ - [変更履歴](https://github.com/dataarthub/eaos/blob/main/packages/server/CHANGELOG.md)
package/README.md CHANGED
@@ -1,3 +1,41 @@
1
- # Temporary Holding Version
1
+ # Server execution and persistence
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ## Elevator Pitch
4
+
5
+ Host developers use Server to compose HTTP/MCP, lifecycle and durable data services.
6
+
7
+ ## Why & Value
8
+
9
+ Shared implementations keep authorization, CAS, audit and Outbox consistent. The host retains provider connections, current identity and deployment policy. This MIT package owns its implementation and declarations in the public monorepo.
10
+
11
+ ## Key Highlights
12
+
13
+ - Hono and MCP integration
14
+ - Reviewed lifecycle plans
15
+ - Durable CAS and audit
16
+ - Scoped database and storage
17
+
18
+ ## Quickstart
19
+
20
+ Registry installation requires a published release. During pre-publication development, install the checksum-pinned tarballs produced by the workspace build instead of assuming these names exist in a registry.
21
+
22
+ ### Public import
23
+
24
+ Use Node.js 24 or later and the required Appkit Core 0.2.0 peer. The canonicalization example is pure and needs no database connection or credentials. Server execution later requires host-owned identity, authorization and persistence bindings. The subpath is an import target, not a separately installed package.
25
+
26
+ ```bash
27
+ bun add @alneas/eaos-server @alneas/appkit-core@0.2.0
28
+ ```
29
+
30
+ ```typescript
31
+ import { canonical } from '@alneas/eaos-server/lifecycle-engine'
32
+
33
+ console.log(canonical({ format: 1, operation: 'inspect' }))
34
+ ```
35
+
36
+ ## Next Steps
37
+
38
+ - [Change history](https://github.com/dataarthub/eaos/blob/main/packages/server/CHANGELOG.md)
39
+ - [Architecture and boundaries](docs/guide.md)
40
+ - [API reference](docs/api.md)
41
+ - [EAOS composition](https://tech-docs.alneas.com/eaos-workspace/architecture/)
@@ -0,0 +1,329 @@
1
+ import { AgentJobRecord } from '@alneas/eaos-core';
2
+ import { ServerAgentDispatchMode, ServerAgentTaskRequest, ServerAgentTaskResult } from './types.js';
3
+ import { ServerAutonomousWorker } from './autonomous-worker.js';
4
+ import { AtomicRepository, PluginPrincipal, AtomicSession } from '../plugin-data/index.js';
5
+ import 'hono/types';
6
+ import '@alneas/eaos-core/plugin-sdk';
7
+ import 'hono';
8
+ import '@alneas/eaos-server/lifecycle-engine';
9
+
10
+ /**
11
+ * Host durable queue boundary with atomic claims and lease-checked transitions.
12
+ * @see createAtomicAgentJobStore for the canonical implementation.
13
+ */
14
+ interface AgentJobStore {
15
+ /**
16
+ * Claims due/recoverable jobs using durable transaction/lease exclusion.
17
+ * @param now - Claim clock used for due and stale checks.
18
+ * @param limit - Maximum job count, validated by the implementation.
19
+ * @param filter - Optional dispatch/user/runner/route eligibility.
20
+ * @returns Leased jobs, or an empty array.
21
+ * @throws Queue persistence or admission failures propagate.
22
+
23
+ * @example
24
+ * ```typescript
25
+ * import type { AgentJobStore } from "@alneas/eaos-server";
26
+ * export async function claimHostJobs(
27
+ * store: AgentJobStore, eligibility: Parameters<AgentJobStore["claim"]>[2],
28
+ * ) {
29
+ * // Supply a store already scoped to verified tenant admission.
30
+ * return await store.claim(new Date(), 10, eligibility);
31
+ * }
32
+ * ```
33
+ */
34
+ claim(now: Date, limit: number, filter?: AgentJobClaimFilter): Promise<readonly AgentJobRecord<ServerAgentTaskRequest>[]>;
35
+ /**
36
+ * Transitions the leased job to succeeded and persists its result.
37
+ * @param jobId - Stored job ID.
38
+ * @param leaseToken - Current claim token; stale tokens must be rejected.
39
+ * @param result - Normalized task outcome to persist.
40
+ * @param now - Transition clock; the atomic implementation uses its configured clock instead.
41
+ * @returns No value; resolves after the durable transition.
42
+ * @throws Lease/integrity/admission or persistence failures propagate.
43
+
44
+ * @example
45
+ * ```typescript
46
+ * import type { AgentJobStore } from "@alneas/eaos-server";
47
+ * export async function completeClaimedJob(
48
+ * store: AgentJobStore, jobId: string, currentLeaseToken: string,
49
+ * verifiedResult: Parameters<AgentJobStore["markCompleted"]>[2],
50
+ * ) {
51
+ * await store.markCompleted(jobId, currentLeaseToken, verifiedResult, new Date());
52
+ * // Completion is durable under the host store contract; stale leases reject.
53
+ * }
54
+ * ```
55
+ */
56
+ markCompleted(jobId: string, leaseToken: string, result: ServerAgentTaskResult, now: Date): Promise<void>;
57
+ /**
58
+ * Transitions the leased job to waiting_approval and persists approval result data.
59
+ * @param jobId - Stored job ID.
60
+ * @param leaseToken - Current claim token; stale tokens must be rejected.
61
+ * @param result - Normalized task outcome to persist.
62
+ * @param now - Transition clock; the atomic implementation uses its configured clock instead.
63
+ * @returns No value; resolves after the durable transition.
64
+ * @throws Lease/integrity/admission or persistence failures propagate.
65
+
66
+ * @example
67
+ * ```typescript
68
+ * import type { AgentJobStore } from "@alneas/eaos-server";
69
+ * export async function deferClaimedJobForReview(
70
+ * store: AgentJobStore, jobId: string, currentLeaseToken: string,
71
+ * approvalResult: Parameters<AgentJobStore["markWaitingApproval"]>[2],
72
+ * ) {
73
+ * await store.markWaitingApproval(jobId, currentLeaseToken, approvalResult, new Date());
74
+ * // This records pending review; it does not approve or execute the proposed action.
75
+ * }
76
+ * ```
77
+ */
78
+ markWaitingApproval(jobId: string, leaseToken: string, result: ServerAgentTaskResult, now: Date): Promise<void>;
79
+ /**
80
+ * Releases the lease and schedules the job for a later attempt.
81
+ * @param jobId - Stored job ID.
82
+ * @param leaseToken - Current claim token; stale tokens must be rejected.
83
+ * @param error - Persisted failure description.
84
+ * @param failureCode - Optional stable runtime classification.
85
+ * @param retryAt - Earliest eligible next-claim timestamp.
86
+ * @param now - Transition clock; the atomic implementation uses its configured clock instead.
87
+ * @returns No value; resolves after the durable transition.
88
+ * @throws Lease/integrity/admission or persistence failures propagate.
89
+
90
+ * @example
91
+ * ```typescript
92
+ * import type { AgentJobStore } from "@alneas/eaos-server";
93
+ * export async function rescheduleClaimedJob(
94
+ * store: AgentJobStore, jobId: string, currentLeaseToken: string,
95
+ * sanitizedError: string, failureCode: string | undefined, reviewedRetryAt: Date,
96
+ * ) {
97
+ * // Reconcile any uncertain external effect before deciding a retry is safe.
98
+ * await store.markRetryable(
99
+ * jobId, currentLeaseToken, sanitizedError, failureCode, reviewedRetryAt, new Date(),
100
+ * );
101
+ * }
102
+ * ```
103
+ */
104
+ markRetryable(jobId: string, leaseToken: string, error: string, failureCode: string | undefined, retryAt: Date, now: Date): Promise<void>;
105
+ /**
106
+ * Releases the lease and marks a terminal failed result.
107
+ * @param jobId - Stored job ID.
108
+ * @param leaseToken - Current claim token; stale tokens must be rejected.
109
+ * @param error - Persisted failure description.
110
+ * @param failureCode - Optional stable runtime classification.
111
+ * @param now - Transition clock; the atomic implementation uses its configured clock instead.
112
+ * @returns No value; resolves after the durable transition.
113
+ * @throws Lease/integrity/admission or persistence failures propagate.
114
+
115
+ * @example
116
+ * ```typescript
117
+ * import type { AgentJobStore } from "@alneas/eaos-server";
118
+ * export async function failClaimedJob(
119
+ * store: AgentJobStore, jobId: string, currentLeaseToken: string,
120
+ * sanitizedError: string, failureCode: string | undefined,
121
+ * ) {
122
+ * await store.markFailed(jobId, currentLeaseToken, sanitizedError, failureCode, new Date());
123
+ * // The host persisted terminal failure; no automatic retry is requested.
124
+ * }
125
+ * ```
126
+ */
127
+ markFailed(jobId: string, leaseToken: string, error: string, failureCode: string | undefined, now: Date): Promise<void>;
128
+ }
129
+ /**
130
+ * Optional eligibility constraints for durable queue claims; omitted fields impose no restriction.
131
+ * @see AgentJobStore.claim.
132
+ */
133
+ interface AgentJobClaimFilter {
134
+ /** Delivery mode; legacy jobs without a mode are treated as server-queue by the atomic implementation. */
135
+ dispatchMode?: ServerAgentDispatchMode;
136
+ /** Eligible registered route IDs; jobs without a matching route are excluded. */
137
+ routeIds?: readonly string[];
138
+ /** Verified runner ID; jobs with a different explicit runner binding are excluded, unbound jobs remain eligible. */
139
+ runnerId?: string;
140
+ /** Verified owning user ID to require. */
141
+ userId?: string;
142
+ }
143
+ /**
144
+ * Host queue/worker and one-pass retry policy for {@link DurableAgentJobDispatcher}.
145
+ */
146
+ interface AgentJobDispatcherOptions {
147
+ /** Durable queue enforcing claim leases and tenant admission. */
148
+ store: AgentJobStore;
149
+ /** Worker executing each cloned claimed task. */
150
+ worker: ServerAutonomousWorker;
151
+ /** Jobs requested per pass, safe integer 1–100; defaults to 1. */
152
+ batchSize?: number;
153
+ /** Dispatcher attempt ceiling, safe integer 1–100; defaults to 5 and is combined with each job ceiling. */
154
+ maxAttempts?: number;
155
+ /** Finite nonnegative initial exponential retry delay in milliseconds; defaults to 1000. */
156
+ baseDelayMs?: number;
157
+ /** Finite retry delay ceiling at least baseDelayMs; defaults to 60000 milliseconds. */
158
+ maxDelayMs?: number;
159
+ /** Clock for claims, transitions, and retry availability; defaults to fresh Date. */
160
+ now?: () => Date;
161
+ /** Resume a LangGraph thread or publish a domain event after a successful agent result. */
162
+ onCompleted?: (job: Readonly<AgentJobRecord<ServerAgentTaskRequest>>, result: ServerAgentTaskResult) => Promise<void>;
163
+ }
164
+ /**
165
+ * Counts of one dispatcher pass; jobs missing lease tokens increment failed without a store transition.
166
+ * @see DurableAgentJobDispatcher.runOnce.
167
+ */
168
+ interface AgentJobDispatchResult {
169
+ /** Number of rows returned by the claim. */
170
+ claimed: number;
171
+ /** Jobs whose completion callback and completed transition succeeded. */
172
+ succeeded: number;
173
+ /** Jobs transitioned to waiting_approval. */
174
+ waitingApproval: number;
175
+ /** Jobs scheduled for a later retry. */
176
+ retried: number;
177
+ /** Jobs marked terminal failure plus claimed jobs missing a lease token. */
178
+ failed: number;
179
+ }
180
+ /**
181
+ * Durable boundary between Micro 2 and an ARM agent runtime.
182
+ *
183
+ * The store is host-owned and must persist leases, attempts and results. This
184
+ * class owns only one bounded pass; a host scheduler calls runOnce again.
185
+ * @remarks Jobs execute sequentially within each pass, but concurrent runOnce calls are not serialized here. Leases and admission must be enforced by the host store. Completion callbacks run before markCompleted and can be repeated after retry; make external effects idempotent.
186
+ * @example
187
+ * ```typescript
188
+ * import { DurableAgentJobDispatcher, type AgentJobDispatcherOptions } from "@alneas/eaos-server/agentic/agent-jobs";
189
+ * export async function dispatch(options: AgentJobDispatcherOptions) {
190
+ * return new DurableAgentJobDispatcher(options).runOnce();
191
+ * }
192
+ * ```
193
+ */
194
+ declare class DurableAgentJobDispatcher {
195
+ private readonly options;
196
+ /**
197
+ * Validates one-pass claim and exponential retry settings.
198
+ * @param options - Store/worker plus bounded batch, attempt, delay, clock, and completion settings.
199
+ * @throws Missing store/worker, batchSize/maxAttempts outside safe integer 1–100, or nonfinite/negative/inverted retry delays.
200
+ */
201
+ constructor(options: AgentJobDispatcherOptions);
202
+ /**
203
+ * Claims one batch and executes jobs sequentially, persisting completion, approval wait, retry, or failure.
204
+ * @returns Per-outcome counts after all claimed jobs have been processed.
205
+ * @throws Rejects claim/transition/clock failures; worker errors become retryable failure results. Completion callback/markCompleted errors trigger retry-or-fail handling.
206
+ * @remarks Retry delay is min(maxDelayMs, baseDelayMs * 2^(attempt-1)), using job.attempt + 1 for the attempt calculation. No timer or automatic second pass is installed. Results marked PENDING_APPROVAL do not count as success.
207
+ * @example
208
+ * ```typescript
209
+ * import { DurableAgentJobDispatcher, type AgentJobDispatcherOptions } from "@alneas/eaos-server/agentic/agent-jobs";
210
+ * export async function runOnce(options: AgentJobDispatcherOptions) { return new DurableAgentJobDispatcher(options).runOnce(); }
211
+ * ```
212
+ */
213
+ runOnce(): Promise<AgentJobDispatchResult>;
214
+ private retryOrFail;
215
+ }
216
+ /**
217
+ * Creates a cloned, hashed queued job record without persisting or executing it.
218
+ * @param input - request supplies verified task identity; kind groups idempotency; workflowInstanceId is optional; correlationId defaults to request executionContext correlation then request.id; idempotencyKey defaults to executionContext key then request.id; maxAttempts defaults to 5; now defaults to the current Date.
219
+ * @returns A new queued record with generated jobId, attempt zero, request hash, and matching available/created/updated timestamps.
220
+ * @throws Clone/hash/invalid Date failures; this factory does not independently validate every task or attempt field.
221
+ * @example
222
+ * ```typescript
223
+ * import { createAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
224
+ * import type { ServerAgentTaskRequest } from "@alneas/eaos-server/agentic/types";
225
+ * export function queued(request: ServerAgentTaskRequest) { return createAgentJob({ request, kind: "workflow" }); }
226
+ * ```
227
+ */
228
+ declare function createAgentJob(input: {
229
+ /**
230
+ * Host-verified task cloned into the durable job and hashed for idempotency integrity.
231
+ */
232
+ request: ServerAgentTaskRequest;
233
+ /**
234
+ * Queue kind used together with tenant and idempotencyKey to partition durable deduplication.
235
+ */
236
+ kind: string;
237
+ /**
238
+ * Optional companion workflow instance ID retained in the queued record.
239
+ */
240
+ workflowInstanceId?: string;
241
+ /**
242
+ * Queue trace label; defaults to request.executionContext.correlationId, then request.id.
243
+ */
244
+ correlationId?: string;
245
+ /**
246
+ * Durable deduplication identity; defaults to request.executionContext.idempotencyKey, then request.id.
247
+ */
248
+ idempotencyKey?: string;
249
+ /**
250
+ * Job attempt ceiling retained without validation here; defaults to 5 and is later combined with dispatcher policy.
251
+ */
252
+ maxAttempts?: number;
253
+ /**
254
+ * Timestamp for availableAt, createdAt, and updatedAt; defaults to a fresh Date and must support toISOString.
255
+ */
256
+ now?: Date;
257
+ }): AgentJobRecord<ServerAgentTaskRequest>;
258
+ /**
259
+ * Persists a job and tenant/kind/idempotency index in the caller's atomic transaction.
260
+ * @param tx - Authorized active atomic session; the caller owns commit/rollback.
261
+ * @param job - Created job whose tenant/kind/key define deduplication and whose requestHash binds input.
262
+ * @returns A clone of the saved job, or existing indexed job when its request hash matches; existing lifecycle state is preserved.
263
+ * @throws Reused idempotency key with a different request hash, missing indexed job, or propagated transaction/clone errors.
264
+ * @remarks This helper neither executes the job nor opens a transaction; host transaction isolation/CAS must prevent concurrent index creation races.
265
+ * @example
266
+ * ```typescript
267
+ * import { enqueueAgentJob, createAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
268
+ * import type { AtomicSession } from "@alneas/eaos-server/plugin-data/atomic";
269
+ * import type { ServerAgentTaskRequest } from "@alneas/eaos-server/agentic/types";
270
+ * export async function enqueue(tx: AtomicSession, request: ServerAgentTaskRequest) {
271
+ * return enqueueAgentJob(tx, createAgentJob({ request, kind: "workflow" }));
272
+ * }
273
+ * ```
274
+ */
275
+ declare function enqueueAgentJob(tx: AtomicSession, job: AgentJobRecord<ServerAgentTaskRequest>): Promise<AgentJobRecord<ServerAgentTaskRequest>>;
276
+ /**
277
+ * Tenant-scoped CAS persistence, lease timing, admission, and transactional completion hook.
278
+ * @see createAtomicAgentJobStore.
279
+ */
280
+ interface AtomicAgentJobStoreOptions {
281
+ /** Host atomic repository enforcing durable CAS and tenant isolation. */
282
+ repository: AtomicRepository;
283
+ /** Verified tenant/plugin/user repository scope, retained by reference. */
284
+ principal: PluginPrincipal;
285
+ /** Additional stale grace after lease expiry in milliseconds; finite and at least 1000, defaults to 300000. */
286
+ staleAfterMs?: number;
287
+ /** Lease duration in milliseconds; finite and at least 1000, defaults to 900000. */
288
+ leaseMs?: number;
289
+ /** Clock for state transitions; defaults to fresh Date. */
290
+ now?: () => Date;
291
+ /** Current host admission is checked before and after durable mutations. */
292
+ verifyCurrent?: () => Promise<void>;
293
+ /** Persist the domain result in the same transaction as the succeeded job state. */
294
+ onCompleted?: (tx: AtomicSession, job: Readonly<AgentJobRecord<ServerAgentTaskRequest>>, result: Readonly<ServerAgentTaskResult>) => Promise<void>;
295
+ }
296
+ /**
297
+ * Creates a lease-checked agent queue over an existing tenant-scoped atomic repository.
298
+ * @param options - Repository/principal plus clocks, leases, optional current-admission checks, and transactional result persistence.
299
+ * @returns Store operations validating tenant/request integrity and lease token before transitions. claim increments attempt and leases due queued/retryable jobs or sufficiently stale running jobs.
300
+ * @throws Synchronously for missing dependencies or lease/stale durations below 1000 ms/nonfinite. Operations reject integrity/tenant/lease/admission errors, invalid claim limits, bounded-scan exhaustion, or propagated repository/hook errors.
301
+ * @remarks claim scans at most 100 pages of 100 rows and permits safe-integer limits 1–100. Running jobs recover only when leaseUntil is at least staleAfterMs before the claim clock. Transition timestamps use options.now, ignoring the interface-supplied now argument. No lease renewal or worker cancellation exists; stale execution can overlap a reclaimed attempt, so side effects need host idempotency. verifyCurrent runs around durable mutations when supplied. Transactional onCompleted runs before succeeded state persistence in the same session.
302
+ * @example
303
+ * ```typescript
304
+ * import { createAtomicAgentJobStore, type AtomicAgentJobStoreOptions } from "@alneas/eaos-server/agentic/agent-jobs";
305
+ * export function jobStore(options: AtomicAgentJobStoreOptions) { return createAtomicAgentJobStore(options); }
306
+ * ```
307
+ */
308
+ declare function createAtomicAgentJobStore(options: AtomicAgentJobStoreOptions): AgentJobStore;
309
+ /**
310
+ * Marks an owned unstarted job cancelled in the caller's atomic session.
311
+ * @param tx - Authorized atomic session; caller commits/rolls back.
312
+ * @param principal - Verified tenant/user who owns the job.
313
+ * @param jobId - Stored queue job identifier.
314
+ * @param now - Cancellation timestamp; defaults to a fresh Date.
315
+ * @returns A cloned cancelled job, unchanged when already cancelled.
316
+ * @throws Missing/foreign job, request integrity mismatch, status other than queued/retryable/waiting_approval/cancelled, or transaction/clock errors.
317
+ * @remarks Running leases cannot be interrupted by this edit. This function performs no external runtime cancellation, approval-ticket revocation, or live admission callback.
318
+ * @example
319
+ * ```typescript
320
+ * import { cancelAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
321
+ * import type { AtomicSession } from "@alneas/eaos-server/plugin-data/atomic";
322
+ * import type { PluginPrincipal } from "@alneas/eaos-server/plugin-data";
323
+ * export async function cancel(tx: AtomicSession, principal: PluginPrincipal, jobId: string) { return cancelAgentJob(tx, principal, jobId); }
324
+ * ```
325
+ */
326
+ declare function cancelAgentJob(tx: AtomicSession, principal: PluginPrincipal, jobId: string, now?: Date): Promise<AgentJobRecord<ServerAgentTaskRequest>>;
327
+
328
+ export { DurableAgentJobDispatcher, cancelAgentJob, createAgentJob, createAtomicAgentJobStore, enqueueAgentJob };
329
+ export type { AgentJobClaimFilter, AgentJobDispatchResult, AgentJobDispatcherOptions, AgentJobStore, AtomicAgentJobStoreOptions };
@@ -0,0 +1,15 @@
1
+ import {
2
+ DurableAgentJobDispatcher,
3
+ cancelAgentJob,
4
+ createAgentJob,
5
+ createAtomicAgentJobStore,
6
+ enqueueAgentJob
7
+ } from "../chunk-PBC3MZUL.js";
8
+ export {
9
+ DurableAgentJobDispatcher,
10
+ cancelAgentJob,
11
+ createAgentJob,
12
+ createAtomicAgentJobStore,
13
+ enqueueAgentJob
14
+ };
15
+ //# sourceMappingURL=agent-jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,40 @@
1
+ import { WorkflowAgentRunner, WorkflowAgentRequest, WorkflowAgentProposal } from '@alneas/eaos-core';
2
+ import { AgentGraphState, GraphNodeHandler } from './graph.js';
3
+ import '@langchain/langgraph';
4
+
5
+ /**
6
+ * Host runner, request construction, and output validation for {@link createWorkflowAgentNode}.
7
+ * @typeParam TOutput - Domain output expected from the proposal; defaults to unknown and runtime validation remains plugin-owned.
8
+ */
9
+ interface WorkflowAgentNodeOptions<TOutput = unknown> {
10
+ /** Host-owned runner that returns proposals; this node performs no proposed action. */
11
+ runner: WorkflowAgentRunner;
12
+ /** Called per node invocation with a structured clone of state; must resolve a request matching tenantId, userId, and sessionId/workflowId. */
13
+ createRequest: (state: AgentGraphState) => WorkflowAgentRequest | Promise<WorkflowAgentRequest>;
14
+ /** Called after a completed proposal with output, full proposal, and original current state; resolves the domain-validated output stored beside the proposal. Errors reject node execution. */
15
+ validateOutput?: (output: TOutput, proposal: WorkflowAgentProposal<TOutput>, state: AgentGraphState) => TOutput | Promise<TOutput>;
16
+ /** Context property receiving cloned proposal and validated output; existing data at this key is overwritten. @defaultValue "agentProposal" */
17
+ contextKey?: string;
18
+ }
19
+ /**
20
+ * Creates a LangGraph node that records an agent proposal in workflow state.
21
+ * It deliberately does not execute proposed actions or create approvals.
22
+ * @typeParam TOutput - Domain-specific proposal output passed to optional plugin validation; defaults to unknown.
23
+ * @param options - Runner, request builder, output validator, and context key.
24
+ * @returns An async graph handler resolving merged context and history with an agent summary entry.
25
+ * @throws Synchronously if runner or request builder is missing. Node execution rejects principal/workflow mismatch, noncompleted runner results, and callback or structuredClone failures.
26
+ * @remarks validateOutput receives proposal output, proposal, and the current state after a completed run; its result is stored alongside the proposal. Unlike createRequest, this callback receives the original state. Host admission, durable checkpointing, and action approval remain outside this node.
27
+ * @example
28
+ * ```typescript
29
+ * import { createWorkflowAgentNode } from "@alneas/eaos-server/agentic/agent-node";
30
+ * import type { WorkflowAgentNodeOptions } from "@alneas/eaos-server/agentic/agent-node";
31
+ * export function proposalNode(options: WorkflowAgentNodeOptions) {
32
+ * // Host callbacks build authorized requests and validate domain output.
33
+ * return createWorkflowAgentNode(options);
34
+ * }
35
+ * ```
36
+ */
37
+ declare function createWorkflowAgentNode<TOutput = unknown>(options: WorkflowAgentNodeOptions<TOutput>): GraphNodeHandler;
38
+
39
+ export { createWorkflowAgentNode };
40
+ export type { WorkflowAgentNodeOptions };
@@ -0,0 +1,7 @@
1
+ import {
2
+ createWorkflowAgentNode
3
+ } from "../chunk-UGNTCOVR.js";
4
+ export {
5
+ createWorkflowAgentNode
6
+ };
7
+ //# sourceMappingURL=agent-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,33 @@
1
+ import { WorkflowAgentRunner } from '@alneas/eaos-core';
2
+ import { ServerAgentExecutor } from './types.js';
3
+
4
+ /**
5
+ * Host executor configuration for {@link createWorkflowAgentRunner}.
6
+ */
7
+ interface ServerWorkflowAgentRunnerOptions {
8
+ /** Host-owned executor. It may be backed by Goose, Hermes or another runtime. */
9
+ executor: ServerAgentExecutor;
10
+ /** Optional host runtime label copied into every normalized run result. */
11
+ runtimeId?: string;
12
+ }
13
+ /**
14
+ * Bridges the host/server executor contract to the vendor-neutral workflow
15
+ * runner contract. The executor output is parsed as a proposal; it is never
16
+ * treated as an instruction to perform a side effect.
17
+ * @param options - Host-owned executor and optional runtime label.
18
+ * @returns A runner whose generic run method accepts a WorkflowAgentRequest and resolves a parsed proposal or a failure result. Executor errors become FAILED/UNAVAILABLE data; parse errors become nonretryable INVALID_PROPOSAL data.
19
+ * @throws Synchronously when executor is missing. run may reject before execution when request serialization fails.
20
+ * @remarks The runner forwards workflow/correlation/idempotency/tool context but does not independently authorize, retry, deduplicate, execute tools, or enforce timeouts. Those boundaries belong to the host executor. Runtime text must parse as a version 1.0 proposal; domain-specific output still needs plugin validation.
21
+ * @example
22
+ * ```typescript
23
+ * import { createWorkflowAgentRunner } from "@alneas/eaos-server/agentic/agent-runner";
24
+ * import type { ServerAgentExecutor } from "@alneas/eaos-server/agentic/types";
25
+ * export function workflowRunner(executor: ServerAgentExecutor) {
26
+ * return createWorkflowAgentRunner({ executor, runtimeId: "host-runtime" });
27
+ * }
28
+ * ```
29
+ */
30
+ declare function createWorkflowAgentRunner(options: ServerWorkflowAgentRunnerOptions): WorkflowAgentRunner;
31
+
32
+ export { createWorkflowAgentRunner };
33
+ export type { ServerWorkflowAgentRunnerOptions };
@@ -0,0 +1,7 @@
1
+ import {
2
+ createWorkflowAgentRunner
3
+ } from "../chunk-6XZXYNJR.js";
4
+ export {
5
+ createWorkflowAgentRunner
6
+ };
7
+ //# sourceMappingURL=agent-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}