@alneas/eaos-server 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +41 -0
- package/LICENSE +21 -0
- package/README.ja.md +49 -0
- package/README.md +46 -2
- package/dist/agentic/agent-jobs.d.ts +333 -0
- package/dist/agentic/agent-jobs.js +15 -0
- package/dist/agentic/agent-jobs.js.map +1 -0
- package/dist/agentic/agent-node.d.ts +40 -0
- package/dist/agentic/agent-node.js +7 -0
- package/dist/agentic/agent-node.js.map +1 -0
- package/dist/agentic/agent-runner.d.ts +33 -0
- package/dist/agentic/agent-runner.js +7 -0
- package/dist/agentic/agent-runner.js.map +1 -0
- package/dist/agentic/ai-broker.d.ts +169 -0
- package/dist/agentic/ai-broker.js +8 -0
- package/dist/agentic/ai-broker.js.map +1 -0
- package/dist/agentic/atomic-checkpointer.d.ts +137 -0
- package/dist/agentic/atomic-checkpointer.js +9 -0
- package/dist/agentic/atomic-checkpointer.js.map +1 -0
- package/dist/agentic/autonomous-worker.d.ts +122 -0
- package/dist/agentic/autonomous-worker.js +10 -0
- package/dist/agentic/autonomous-worker.js.map +1 -0
- package/dist/agentic/event-bridge.d.ts +350 -0
- package/dist/agentic/event-bridge.js +9 -0
- package/dist/agentic/event-bridge.js.map +1 -0
- package/dist/agentic/executor.d.ts +91 -0
- package/dist/agentic/executor.js +12 -0
- package/dist/agentic/executor.js.map +1 -0
- package/dist/agentic/graph-projection.d.ts +119 -0
- package/dist/agentic/graph-projection.js +7 -0
- package/dist/agentic/graph-projection.js.map +1 -0
- package/dist/agentic/graph.d.ts +524 -0
- package/dist/agentic/graph.js +7 -0
- package/dist/agentic/graph.js.map +1 -0
- package/dist/agentic/index.d.ts +28 -0
- package/dist/agentic/index.js +87 -0
- package/dist/agentic/index.js.map +1 -0
- package/dist/agentic/local-runner.d.ts +106 -0
- package/dist/agentic/local-runner.js +7 -0
- package/dist/agentic/local-runner.js.map +1 -0
- package/dist/agentic/remote-executor.d.ts +67 -0
- package/dist/agentic/remote-executor.js +8 -0
- package/dist/agentic/remote-executor.js.map +1 -0
- package/dist/agentic/types.d.ts +157 -0
- package/dist/agentic/types.js +7 -0
- package/dist/agentic/types.js.map +1 -0
- package/dist/agentic/workflow-catalog.d.ts +152 -0
- package/dist/agentic/workflow-catalog.js +7 -0
- package/dist/agentic/workflow-catalog.js.map +1 -0
- package/dist/agentic/workflow-compiler.d.ts +44 -0
- package/dist/agentic/workflow-compiler.js +8 -0
- package/dist/agentic/workflow-compiler.js.map +1 -0
- package/dist/agentic/workflow-coordinator.d.ts +170 -0
- package/dist/agentic/workflow-coordinator.js +8 -0
- package/dist/agentic/workflow-coordinator.js.map +1 -0
- package/dist/agentic/workflow-manager.d.ts +91 -0
- package/dist/agentic/workflow-manager.js +7 -0
- package/dist/agentic/workflow-manager.js.map +1 -0
- package/dist/agentic/workflow-registry.d.ts +334 -0
- package/dist/agentic/workflow-registry.js +7 -0
- package/dist/agentic/workflow-registry.js.map +1 -0
- package/dist/artifacts-CteHmCMI.d.ts +614 -0
- package/dist/auth-hooks/api-key.d.ts +75 -0
- package/dist/auth-hooks/api-key.js +7 -0
- package/dist/auth-hooks/api-key.js.map +1 -0
- package/dist/auth-hooks/index.d.ts +80 -0
- package/dist/auth-hooks/index.js +28 -0
- package/dist/auth-hooks/index.js.map +1 -0
- package/dist/browser-auth/account-memberships.d.ts +213 -0
- package/dist/browser-auth/account-memberships.js +13 -0
- package/dist/browser-auth/account-memberships.js.map +1 -0
- package/dist/browser-auth/index.d.ts +8 -0
- package/dist/browser-auth/index.js +59 -0
- package/dist/browser-auth/index.js.map +1 -0
- package/dist/browser-auth/kratos-session.d.ts +37 -0
- package/dist/browser-auth/kratos-session.js +7 -0
- package/dist/browser-auth/kratos-session.js.map +1 -0
- package/dist/browser-auth/platform-session.d.ts +120 -0
- package/dist/browser-auth/platform-session.js +7 -0
- package/dist/browser-auth/platform-session.js.map +1 -0
- package/dist/browser-auth/public-memberships.d.ts +22 -0
- package/dist/browser-auth/public-memberships.js +7 -0
- package/dist/browser-auth/public-memberships.js.map +1 -0
- package/dist/cache/index.d.ts +181 -0
- package/dist/cache/index.js +197 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/chunk-32746UQZ.js +131 -0
- package/dist/chunk-32746UQZ.js.map +1 -0
- package/dist/chunk-3NLSWP2Y.js +223 -0
- package/dist/chunk-3NLSWP2Y.js.map +1 -0
- package/dist/chunk-3P4XTTQH.js +346 -0
- package/dist/chunk-3P4XTTQH.js.map +1 -0
- package/dist/chunk-3VITSHN3.js +15 -0
- package/dist/chunk-3VITSHN3.js.map +1 -0
- package/dist/chunk-46UWPEW2.js +226 -0
- package/dist/chunk-46UWPEW2.js.map +1 -0
- package/dist/chunk-4BARRLJR.js +180 -0
- package/dist/chunk-4BARRLJR.js.map +1 -0
- package/dist/chunk-4VORUFKR.js +45 -0
- package/dist/chunk-4VORUFKR.js.map +1 -0
- package/dist/chunk-55D4ERWO.js +1 -0
- package/dist/chunk-55D4ERWO.js.map +1 -0
- package/dist/chunk-5TBBZIND.js +18 -0
- package/dist/chunk-5TBBZIND.js.map +1 -0
- package/dist/chunk-5WOZWPZA.js +211 -0
- package/dist/chunk-5WOZWPZA.js.map +1 -0
- package/dist/chunk-6CBVZ6CT.js +168 -0
- package/dist/chunk-6CBVZ6CT.js.map +1 -0
- package/dist/chunk-6XZXYNJR.js +74 -0
- package/dist/chunk-6XZXYNJR.js.map +1 -0
- package/dist/chunk-753HWDSC.js +222 -0
- package/dist/chunk-753HWDSC.js.map +1 -0
- package/dist/chunk-7AHSS7SO.js +81 -0
- package/dist/chunk-7AHSS7SO.js.map +1 -0
- package/dist/chunk-7FTJN4SA.js +1 -0
- package/dist/chunk-7FTJN4SA.js.map +1 -0
- package/dist/chunk-AVDMLTPF.js +24 -0
- package/dist/chunk-AVDMLTPF.js.map +1 -0
- package/dist/chunk-BKAHUEIT.js +95 -0
- package/dist/chunk-BKAHUEIT.js.map +1 -0
- package/dist/chunk-CJ7OFEF7.js +134 -0
- package/dist/chunk-CJ7OFEF7.js.map +1 -0
- package/dist/chunk-EJKWDZIU.js +111 -0
- package/dist/chunk-EJKWDZIU.js.map +1 -0
- package/dist/chunk-F2J6IQ6I.js +247 -0
- package/dist/chunk-F2J6IQ6I.js.map +1 -0
- package/dist/chunk-F3O7CELI.js +23 -0
- package/dist/chunk-F3O7CELI.js.map +1 -0
- package/dist/chunk-F4IITPGX.js +221 -0
- package/dist/chunk-F4IITPGX.js.map +1 -0
- package/dist/chunk-FD6VC2NA.js +66 -0
- package/dist/chunk-FD6VC2NA.js.map +1 -0
- package/dist/chunk-FRRRWAHO.js +14 -0
- package/dist/chunk-FRRRWAHO.js.map +1 -0
- package/dist/chunk-HCKAGLLB.js +17 -0
- package/dist/chunk-HCKAGLLB.js.map +1 -0
- package/dist/chunk-HVC7FG6B.js +191 -0
- package/dist/chunk-HVC7FG6B.js.map +1 -0
- package/dist/chunk-HXFVOR7Z.js +496 -0
- package/dist/chunk-HXFVOR7Z.js.map +1 -0
- package/dist/chunk-IJWYS2PF.js +122 -0
- package/dist/chunk-IJWYS2PF.js.map +1 -0
- package/dist/chunk-INCHXAFK.js +1395 -0
- package/dist/chunk-INCHXAFK.js.map +1 -0
- package/dist/chunk-JT6BRGQM.js +1 -0
- package/dist/chunk-JT6BRGQM.js.map +1 -0
- package/dist/chunk-L6PMAEMB.js +115 -0
- package/dist/chunk-L6PMAEMB.js.map +1 -0
- package/dist/chunk-LOUGW6MU.js +126 -0
- package/dist/chunk-LOUGW6MU.js.map +1 -0
- package/dist/chunk-LYPZPE53.js +129 -0
- package/dist/chunk-LYPZPE53.js.map +1 -0
- package/dist/chunk-NNCCN7JP.js +186 -0
- package/dist/chunk-NNCCN7JP.js.map +1 -0
- package/dist/chunk-PBC3MZUL.js +212 -0
- package/dist/chunk-PBC3MZUL.js.map +1 -0
- package/dist/chunk-R4ADP2DC.js +20 -0
- package/dist/chunk-R4ADP2DC.js.map +1 -0
- package/dist/chunk-RHN4Y6VS.js +44 -0
- package/dist/chunk-RHN4Y6VS.js.map +1 -0
- package/dist/chunk-SDJNYPYK.js +770 -0
- package/dist/chunk-SDJNYPYK.js.map +1 -0
- package/dist/chunk-UGNTCOVR.js +28 -0
- package/dist/chunk-UGNTCOVR.js.map +1 -0
- package/dist/chunk-VC2PCK2S.js +31 -0
- package/dist/chunk-VC2PCK2S.js.map +1 -0
- package/dist/chunk-VF5YDZJC.js +305 -0
- package/dist/chunk-VF5YDZJC.js.map +1 -0
- package/dist/chunk-VISRDVTK.js +675 -0
- package/dist/chunk-VISRDVTK.js.map +1 -0
- package/dist/chunk-W6O3LVBY.js +102 -0
- package/dist/chunk-W6O3LVBY.js.map +1 -0
- package/dist/chunk-WFEAKJLR.js +47 -0
- package/dist/chunk-WFEAKJLR.js.map +1 -0
- package/dist/chunk-XIEY2OF4.js +67 -0
- package/dist/chunk-XIEY2OF4.js.map +1 -0
- package/dist/chunk-XITLHDG3.js +37 -0
- package/dist/chunk-XITLHDG3.js.map +1 -0
- package/dist/chunk-XMWPYZWZ.js +61 -0
- package/dist/chunk-XMWPYZWZ.js.map +1 -0
- package/dist/chunk-XUP6CNOM.js +34 -0
- package/dist/chunk-XUP6CNOM.js.map +1 -0
- package/dist/chunk-YABTQZDJ.js +25 -0
- package/dist/chunk-YABTQZDJ.js.map +1 -0
- package/dist/chunk-YMHVRBUU.js +199 -0
- package/dist/chunk-YMHVRBUU.js.map +1 -0
- package/dist/chunk-YMJ7BRKU.js +510 -0
- package/dist/chunk-YMJ7BRKU.js.map +1 -0
- package/dist/chunk-ZC3XWU7B.js +28 -0
- package/dist/chunk-ZC3XWU7B.js.map +1 -0
- package/dist/chunk-ZHMTD5KV.js +90 -0
- package/dist/chunk-ZHMTD5KV.js.map +1 -0
- package/dist/chunk-ZWZDLOE7.js +160 -0
- package/dist/chunk-ZWZDLOE7.js.map +1 -0
- package/dist/db-package/db/local-first-sqlite-adapter.d.ts +432 -0
- package/dist/db-package/db/local-first-sqlite-adapter.js +7 -0
- package/dist/db-package/db/local-first-sqlite-adapter.js.map +1 -0
- package/dist/db-package/index.d.ts +7 -0
- package/dist/db-package/index.js +16 -0
- package/dist/db-package/index.js.map +1 -0
- package/dist/db-package/migration/aggregator.d.ts +86 -0
- package/dist/db-package/migration/aggregator.js +7 -0
- package/dist/db-package/migration/aggregator.js.map +1 -0
- package/dist/db-package/migration/index.d.ts +3 -0
- package/dist/db-package/migration/index.js +8 -0
- package/dist/db-package/migration/index.js.map +1 -0
- package/dist/engine.d.ts +205 -0
- package/dist/engine.js +20 -0
- package/dist/engine.js.map +1 -0
- package/dist/entitlements/index.d.ts +313 -0
- package/dist/entitlements/index.js +23 -0
- package/dist/entitlements/index.js.map +1 -0
- package/dist/execution/chat.d.ts +7 -0
- package/dist/execution/chat.js +7 -0
- package/dist/execution/chat.js.map +1 -0
- package/dist/execution/index.d.ts +342 -0
- package/dist/execution/index.js +66 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/tool-agent.d.ts +7 -0
- package/dist/execution/tool-agent.js +8 -0
- package/dist/execution/tool-agent.js.map +1 -0
- package/dist/extensions/index.d.ts +172 -0
- package/dist/extensions/index.js +95 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/health/index.d.ts +35 -0
- package/dist/health/index.js +7 -0
- package/dist/health/index.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +161 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle/index.d.ts +133 -0
- package/dist/lifecycle/index.js +13 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle-engine/backend-migration.d.ts +2 -0
- package/dist/lifecycle-engine/backend-migration.js +11 -0
- package/dist/lifecycle-engine/backend-migration.js.map +1 -0
- package/dist/lifecycle-engine/baseline.d.ts +2 -0
- package/dist/lifecycle-engine/baseline.js +9 -0
- package/dist/lifecycle-engine/baseline.js.map +1 -0
- package/dist/lifecycle-engine/index.d.ts +1497 -0
- package/dist/lifecycle-engine/index.js +41 -0
- package/dist/lifecycle-engine/index.js.map +1 -0
- package/dist/lifecycle-engine/platform/artifacts.d.ts +4 -0
- package/dist/lifecycle-engine/platform/artifacts.js +7 -0
- package/dist/lifecycle-engine/platform/artifacts.js.map +1 -0
- package/dist/lifecycle-engine/platform/control-plane.d.ts +12 -0
- package/dist/lifecycle-engine/platform/control-plane.js +2 -0
- package/dist/lifecycle-engine/platform/control-plane.js.map +1 -0
- package/dist/lifecycle-engine/platform/database-router.d.ts +118 -0
- package/dist/lifecycle-engine/platform/database-router.js +7 -0
- package/dist/lifecycle-engine/platform/database-router.js.map +1 -0
- package/dist/lifecycle-engine/platform/deployment-placements.d.ts +464 -0
- package/dist/lifecycle-engine/platform/deployment-placements.js +16 -0
- package/dist/lifecycle-engine/platform/deployment-placements.js.map +1 -0
- package/dist/lifecycle-engine/platform/deployment.d.ts +4 -0
- package/dist/lifecycle-engine/platform/deployment.js +17 -0
- package/dist/lifecycle-engine/platform/deployment.js.map +1 -0
- package/dist/lifecycle-engine/platform/index.d.ts +737 -0
- package/dist/lifecycle-engine/platform/index.js +60 -0
- package/dist/lifecycle-engine/platform/index.js.map +1 -0
- package/dist/lifecycle-engine/platform/runtime.d.ts +80 -0
- package/dist/lifecycle-engine/platform/runtime.js +11 -0
- package/dist/lifecycle-engine/platform/runtime.js.map +1 -0
- package/dist/lifecycle-engine/platform/site-publication.d.ts +102 -0
- package/dist/lifecycle-engine/platform/site-publication.js +7 -0
- package/dist/lifecycle-engine/platform/site-publication.js.map +1 -0
- package/dist/lifecycle-engine/platform/user-directory.d.ts +139 -0
- package/dist/lifecycle-engine/platform/user-directory.js +13 -0
- package/dist/lifecycle-engine/platform/user-directory.js.map +1 -0
- package/dist/mcp.d.ts +92 -0
- package/dist/mcp.js +10 -0
- package/dist/mcp.js.map +1 -0
- package/dist/middleware/auth.d.ts +118 -0
- package/dist/middleware/auth.js +7 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +35 -0
- package/dist/middleware/error-handler.js +7 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/module-guard.d.ts +33 -0
- package/dist/middleware/module-guard.js +7 -0
- package/dist/middleware/module-guard.js.map +1 -0
- package/dist/platform-admin/index.d.ts +37 -0
- package/dist/platform-admin/index.js +11 -0
- package/dist/platform-admin/index.js.map +1 -0
- package/dist/platform-admin/store.d.ts +346 -0
- package/dist/platform-admin/store.js +7 -0
- package/dist/platform-admin/store.js.map +1 -0
- package/dist/plugin-data/annotations.d.ts +6 -0
- package/dist/plugin-data/annotations.js +12 -0
- package/dist/plugin-data/annotations.js.map +1 -0
- package/dist/plugin-data/atomic-context.d.ts +41 -0
- package/dist/plugin-data/atomic-context.js +9 -0
- package/dist/plugin-data/atomic-context.js.map +1 -0
- package/dist/plugin-data/atomic.d.ts +6 -0
- package/dist/plugin-data/atomic.js +26 -0
- package/dist/plugin-data/atomic.js.map +1 -0
- package/dist/plugin-data/audit.d.ts +6 -0
- package/dist/plugin-data/audit.js +12 -0
- package/dist/plugin-data/audit.js.map +1 -0
- package/dist/plugin-data/commands.d.ts +6 -0
- package/dist/plugin-data/commands.js +8 -0
- package/dist/plugin-data/commands.js.map +1 -0
- package/dist/plugin-data/composite.d.ts +6 -0
- package/dist/plugin-data/composite.js +8 -0
- package/dist/plugin-data/composite.js.map +1 -0
- package/dist/plugin-data/delivery.d.ts +6 -0
- package/dist/plugin-data/delivery.js +16 -0
- package/dist/plugin-data/delivery.js.map +1 -0
- package/dist/plugin-data/index.d.ts +2798 -0
- package/dist/plugin-data/index.js +102 -0
- package/dist/plugin-data/index.js.map +1 -0
- package/dist/plugin-data/json-documents.d.ts +6 -0
- package/dist/plugin-data/json-documents.js +16 -0
- package/dist/plugin-data/json-documents.js.map +1 -0
- package/dist/plugin-data/outbox.d.ts +6 -0
- package/dist/plugin-data/outbox.js +16 -0
- package/dist/plugin-data/outbox.js.map +1 -0
- package/dist/plugin-data/scoped-records.d.ts +6 -0
- package/dist/plugin-data/scoped-records.js +10 -0
- package/dist/plugin-data/scoped-records.js.map +1 -0
- package/dist/plugin-sdk.d.ts +41 -0
- package/dist/plugin-sdk.js +10 -0
- package/dist/plugin-sdk.js.map +1 -0
- package/dist/sql-lifecycle/index.d.ts +138 -0
- package/dist/sql-lifecycle/index.js +167 -0
- package/dist/sql-lifecycle/index.js.map +1 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +13 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/s3-compatible.d.ts +139 -0
- package/dist/storage/s3-compatible.js +11 -0
- package/dist/storage/s3-compatible.js.map +1 -0
- package/dist/tenant.d.ts +108 -0
- package/dist/tenant.js +9 -0
- package/dist/tenant.js.map +1 -0
- package/dist/workspace-context.d.ts +119 -0
- package/dist/workspace-context.js +9 -0
- package/dist/workspace-context.js.map +1 -0
- package/docs/api.md +30560 -0
- package/docs/db/README.md +49 -0
- package/docs/db/docs/api.md +1613 -0
- package/docs/db/docs/guide.md +47 -0
- package/docs/entitlements.md +60 -0
- package/docs/guide.md +92 -0
- package/docs/index.md +57 -0
- package/docs/ja/db/README.md +46 -0
- package/docs/ja/db/docs/guide.md +53 -0
- package/docs/ja/guide.md +46 -0
- package/docs/ja/lifecycle/README.md +46 -0
- package/docs/ja/lifecycle/docs/guide.md +45 -0
- package/docs/ja/storage/README.md +46 -0
- package/docs/ja/storage/docs/guide.md +43 -0
- package/docs/lifecycle/README.md +49 -0
- package/docs/lifecycle/docs/api.md +3770 -0
- package/docs/lifecycle/docs/baseline.md +50 -0
- package/docs/lifecycle/docs/guide.md +47 -0
- package/docs/storage/README.md +49 -0
- package/docs/storage/docs/api.md +470 -0
- package/docs/storage/docs/guide.md +47 -0
- package/package.json +354 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @alneas/eaos-server
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Expose canonical `createChatClient` and `createToolAgent` execution APIs backed by existing Appkit chat, Action and execution-session primitives. Connect live authorization, model routes, limits, cancellation, guards, budgets, usage and observations.
|
|
8
|
+
- Route built-in LiteLLM tasks through the same chat client. Support Host-owned authentication headers and optional shared chat configuration without changing injected-executor priority or Goose/Hermes process execution.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Align English/Japanese setup and support guidance with actual package requirements; link the existing GitHub private reporting channel without adding a support guarantee.
|
|
13
|
+
|
|
14
|
+
- Consume EAOS Core ^0.2.0 and reauthorize after asynchronous guards/accounting/telemetry, before returning output. Recheck retained tool history before each subsequent model request.
|
|
15
|
+
- Require explicit model-to-adapter bindings when a model registry is configured. Reject protocol-reserved provider parameters rather than allowing them to override the selected model or messages.
|
|
16
|
+
|
|
17
|
+
### Upgrade
|
|
18
|
+
|
|
19
|
+
- Built-in LiteLLM now requests OpenAI-compatible SSE streams. JSON-only custom endpoints must provide a compatible Host adapter or injected executor. Existing task result envelopes, endpoint/model/fetch options, HTTP status errors, output ceilings and process dispatch remain supported; common stream, cancellation and validation failures use shared chat diagnostics.
|
|
20
|
+
- Provider usage may be unavailable in Appkit events. Host accounting receives unknown usage explicitly and must reconcile it instead of treating it as zero; accounting failures propagate. Keep external side-effect idempotency and durable accounting in the Host.
|
|
21
|
+
- Install Core 0.2.0 before Server 0.2.0. This update performs no migrations or tenant activation.
|
|
22
|
+
|
|
23
|
+
## 0.1.0
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Allow unrestricted, unmetered Public entitlement rules to skip an external paid entitlement runtime. Authentication and host lifecycle/resource admission remain mandatory.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Adopt public `@alneas/appkit-core@0.2.0`, require Node.js 24 or later, and consume `@alneas/eaos-core@^0.1.0`.
|
|
32
|
+
- Use the portable storage download contract: downloads return `Uint8Array` or `null`. Decode text with `TextDecoder`; Node hosts can explicitly wrap bytes with `Buffer`.
|
|
33
|
+
- Ship English guides, source-derived API references, complete installation requirements and package history.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Read current tenant contracts inside the quota reservation's existing transaction instead of nesting a control database transaction.
|
|
38
|
+
|
|
39
|
+
### Upgrade
|
|
40
|
+
|
|
41
|
+
- 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,49 @@
|
|
|
1
|
+
# Server の実行と永続化
|
|
2
|
+
|
|
3
|
+
[English](https://github.com/dataarthub/eaos/blob/main/packages/server/README.md) | [日本語](https://github.com/dataarthub/eaos/blob/main/packages/server/README.ja.md)
|
|
4
|
+
|
|
5
|
+
[ドキュメントサイトの日本語ページ](https://tech-docs.alneas.com/ja/eaos-workspace/server/)でプロジェクト全体の日本語ドキュメントを案内しています。未翻訳・レビュー待ちのページは英語にフォールバックする場合があります。公開サイトは公開済みバージョンの案内であり、この README の 0.2.0 候補と一致しない場合は、対応する英語ガイドと変更履歴を確認してください。
|
|
6
|
+
|
|
7
|
+
[](https://www.typescriptlang.org/docs/) [](https://nodejs.org/en/about/previous-releases) [](https://hono.dev/docs/)
|
|
8
|
+
|
|
9
|
+
## Elevator Pitch
|
|
10
|
+
|
|
11
|
+
ホスト開発者は Server を使い、HTTP/MCP、ライフサイクル、永続データサービスを構成できます。
|
|
12
|
+
|
|
13
|
+
## Why & Value
|
|
14
|
+
|
|
15
|
+
共通実装により、認可、CAS、監査、Outbox の振る舞いを揃えます。プロバイダーへの接続、現在の識別情報、デプロイ方針はホストが管理します。この MIT パッケージの実装と型宣言は公開モノレポで管理します。
|
|
16
|
+
|
|
17
|
+
## Key Highlights
|
|
18
|
+
|
|
19
|
+
- Hono と MCP の連携
|
|
20
|
+
- レビューを経たライフサイクル計画
|
|
21
|
+
- 永続的な CAS と監査
|
|
22
|
+
- スコープを限定したデータベースとストレージ
|
|
23
|
+
|
|
24
|
+
## Quickstart
|
|
25
|
+
|
|
26
|
+
この checkout は 0.2.0 のリリース準備用です。0.1.0 は公開済みです。0.2.0 の公開まではチェックサムを固定した候補 tarball を導入し、以下のコマンドは公開後に使用してください。
|
|
27
|
+
|
|
28
|
+
### 公開 API の import
|
|
29
|
+
|
|
30
|
+
Node.js 24 以上と、必須 peer の Appkit Core 0.2.0 を使用してください。以下の正規化の例は純粋な処理で、データベース接続や認証情報は不要です。Server の実行には、別途ホストが管理する識別情報、認可、永続化の接続が必要です。subpath は import の対象であり、個別にインストールするパッケージではありません。
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bun add @alneas/eaos-server@0.2.0 @alneas/appkit-core@0.2.0
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { canonical } from '@alneas/eaos-server/lifecycle-engine'
|
|
38
|
+
|
|
39
|
+
console.log(canonical({ format: 1, operation: 'inspect' }))
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Next Steps
|
|
43
|
+
|
|
44
|
+
- [変更履歴](https://github.com/dataarthub/eaos/blob/main/packages/server/CHANGELOG.md)
|
|
45
|
+
- [アーキテクチャと境界](docs/guide.md)
|
|
46
|
+
- [API リファレンス](docs/api.md)
|
|
47
|
+
- [EAOS の構成](https://tech-docs.alneas.com/eaos-workspace/architecture/)
|
|
48
|
+
|
|
49
|
+
英語での質問・不具合報告を [GitHub Issues](https://github.com/dataarthub/eaos/issues) で受け付けています。非公開の脆弱性報告には [GitHubの非公開報告機能](https://github.com/dataarthub/eaos/security/advisories/new)を利用できます。
|
package/README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Server execution and persistence
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](https://github.com/dataarthub/eaos/blob/main/packages/server/README.md) | [日本語](https://github.com/dataarthub/eaos/blob/main/packages/server/README.ja.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.typescriptlang.org/docs/) [](https://nodejs.org/en/about/previous-releases) [](https://hono.dev/docs/)
|
|
6
|
+
|
|
7
|
+
## Elevator Pitch
|
|
8
|
+
|
|
9
|
+
Host developers use Server to compose HTTP/MCP, lifecycle and durable data services.
|
|
10
|
+
|
|
11
|
+
## Why & Value
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
## Key Highlights
|
|
16
|
+
|
|
17
|
+
- Hono and MCP integration
|
|
18
|
+
- Reviewed lifecycle plans
|
|
19
|
+
- Durable CAS and audit
|
|
20
|
+
- Scoped database and storage
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
This checkout prepares version 0.2.0; version 0.1.0 is already published. Until 0.2.0 is published, install the checksum-pinned candidate tarball. The command below applies after that release.
|
|
25
|
+
|
|
26
|
+
### Public import
|
|
27
|
+
|
|
28
|
+
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.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun add @alneas/eaos-server@0.2.0 @alneas/appkit-core@0.2.0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { canonical } from '@alneas/eaos-server/lifecycle-engine'
|
|
36
|
+
|
|
37
|
+
console.log(canonical({ format: 1, operation: 'inspect' }))
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Next Steps
|
|
41
|
+
|
|
42
|
+
- [Change history](https://github.com/dataarthub/eaos/blob/main/packages/server/CHANGELOG.md)
|
|
43
|
+
- [Architecture and boundaries](docs/guide.md)
|
|
44
|
+
- [API reference](docs/api.md)
|
|
45
|
+
- [EAOS composition](https://tech-docs.alneas.com/eaos-workspace/architecture/)
|
|
46
|
+
|
|
47
|
+
Questions and issue reports in English are welcome in [GitHub Issues](https://github.com/dataarthub/eaos/issues). Private vulnerability reports can use [GitHub private reporting](https://github.com/dataarthub/eaos/security/advisories/new).
|
|
@@ -0,0 +1,333 @@
|
|
|
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 '@alneas/appkit-core/ai/ai-chat';
|
|
6
|
+
import '../execution/index.js';
|
|
7
|
+
import '@alneas/appkit-core/ai/action';
|
|
8
|
+
import 'hono/types';
|
|
9
|
+
import 'hono';
|
|
10
|
+
import '@alneas/appkit-core/ai';
|
|
11
|
+
import '@alneas/eaos-core/plugin-sdk';
|
|
12
|
+
import '@alneas/eaos-server/lifecycle-engine';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Host durable queue boundary with atomic claims and lease-checked transitions.
|
|
16
|
+
* @see createAtomicAgentJobStore for the canonical implementation.
|
|
17
|
+
*/
|
|
18
|
+
interface AgentJobStore {
|
|
19
|
+
/**
|
|
20
|
+
* Claims due/recoverable jobs using durable transaction/lease exclusion.
|
|
21
|
+
* @param now - Claim clock used for due and stale checks.
|
|
22
|
+
* @param limit - Maximum job count, validated by the implementation.
|
|
23
|
+
* @param filter - Optional dispatch/user/runner/route eligibility.
|
|
24
|
+
* @returns Leased jobs, or an empty array.
|
|
25
|
+
* @throws Queue persistence or admission failures propagate.
|
|
26
|
+
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import type { AgentJobStore } from "@alneas/eaos-server";
|
|
30
|
+
* export async function claimHostJobs(
|
|
31
|
+
* store: AgentJobStore, eligibility: Parameters<AgentJobStore["claim"]>[2],
|
|
32
|
+
* ) {
|
|
33
|
+
* // Supply a store already scoped to verified tenant admission.
|
|
34
|
+
* return await store.claim(new Date(), 10, eligibility);
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
claim(now: Date, limit: number, filter?: AgentJobClaimFilter): Promise<readonly AgentJobRecord<ServerAgentTaskRequest>[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Transitions the leased job to succeeded and persists its result.
|
|
41
|
+
* @param jobId - Stored job ID.
|
|
42
|
+
* @param leaseToken - Current claim token; stale tokens must be rejected.
|
|
43
|
+
* @param result - Normalized task outcome to persist.
|
|
44
|
+
* @param now - Transition clock; the atomic implementation uses its configured clock instead.
|
|
45
|
+
* @returns No value; resolves after the durable transition.
|
|
46
|
+
* @throws Lease/integrity/admission or persistence failures propagate.
|
|
47
|
+
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* import type { AgentJobStore } from "@alneas/eaos-server";
|
|
51
|
+
* export async function completeClaimedJob(
|
|
52
|
+
* store: AgentJobStore, jobId: string, currentLeaseToken: string,
|
|
53
|
+
* verifiedResult: Parameters<AgentJobStore["markCompleted"]>[2],
|
|
54
|
+
* ) {
|
|
55
|
+
* await store.markCompleted(jobId, currentLeaseToken, verifiedResult, new Date());
|
|
56
|
+
* // Completion is durable under the host store contract; stale leases reject.
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
markCompleted(jobId: string, leaseToken: string, result: ServerAgentTaskResult, now: Date): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Transitions the leased job to waiting_approval and persists approval result data.
|
|
63
|
+
* @param jobId - Stored job ID.
|
|
64
|
+
* @param leaseToken - Current claim token; stale tokens must be rejected.
|
|
65
|
+
* @param result - Normalized task outcome to persist.
|
|
66
|
+
* @param now - Transition clock; the atomic implementation uses its configured clock instead.
|
|
67
|
+
* @returns No value; resolves after the durable transition.
|
|
68
|
+
* @throws Lease/integrity/admission or persistence failures propagate.
|
|
69
|
+
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* import type { AgentJobStore } from "@alneas/eaos-server";
|
|
73
|
+
* export async function deferClaimedJobForReview(
|
|
74
|
+
* store: AgentJobStore, jobId: string, currentLeaseToken: string,
|
|
75
|
+
* approvalResult: Parameters<AgentJobStore["markWaitingApproval"]>[2],
|
|
76
|
+
* ) {
|
|
77
|
+
* await store.markWaitingApproval(jobId, currentLeaseToken, approvalResult, new Date());
|
|
78
|
+
* // This records pending review; it does not approve or execute the proposed action.
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
markWaitingApproval(jobId: string, leaseToken: string, result: ServerAgentTaskResult, now: Date): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Releases the lease and schedules the job for a later attempt.
|
|
85
|
+
* @param jobId - Stored job ID.
|
|
86
|
+
* @param leaseToken - Current claim token; stale tokens must be rejected.
|
|
87
|
+
* @param error - Persisted failure description.
|
|
88
|
+
* @param failureCode - Optional stable runtime classification.
|
|
89
|
+
* @param retryAt - Earliest eligible next-claim timestamp.
|
|
90
|
+
* @param now - Transition clock; the atomic implementation uses its configured clock instead.
|
|
91
|
+
* @returns No value; resolves after the durable transition.
|
|
92
|
+
* @throws Lease/integrity/admission or persistence failures propagate.
|
|
93
|
+
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* import type { AgentJobStore } from "@alneas/eaos-server";
|
|
97
|
+
* export async function rescheduleClaimedJob(
|
|
98
|
+
* store: AgentJobStore, jobId: string, currentLeaseToken: string,
|
|
99
|
+
* sanitizedError: string, failureCode: string | undefined, reviewedRetryAt: Date,
|
|
100
|
+
* ) {
|
|
101
|
+
* // Reconcile any uncertain external effect before deciding a retry is safe.
|
|
102
|
+
* await store.markRetryable(
|
|
103
|
+
* jobId, currentLeaseToken, sanitizedError, failureCode, reviewedRetryAt, new Date(),
|
|
104
|
+
* );
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
markRetryable(jobId: string, leaseToken: string, error: string, failureCode: string | undefined, retryAt: Date, now: Date): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Releases the lease and marks a terminal failed result.
|
|
111
|
+
* @param jobId - Stored job ID.
|
|
112
|
+
* @param leaseToken - Current claim token; stale tokens must be rejected.
|
|
113
|
+
* @param error - Persisted failure description.
|
|
114
|
+
* @param failureCode - Optional stable runtime classification.
|
|
115
|
+
* @param now - Transition clock; the atomic implementation uses its configured clock instead.
|
|
116
|
+
* @returns No value; resolves after the durable transition.
|
|
117
|
+
* @throws Lease/integrity/admission or persistence failures propagate.
|
|
118
|
+
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* import type { AgentJobStore } from "@alneas/eaos-server";
|
|
122
|
+
* export async function failClaimedJob(
|
|
123
|
+
* store: AgentJobStore, jobId: string, currentLeaseToken: string,
|
|
124
|
+
* sanitizedError: string, failureCode: string | undefined,
|
|
125
|
+
* ) {
|
|
126
|
+
* await store.markFailed(jobId, currentLeaseToken, sanitizedError, failureCode, new Date());
|
|
127
|
+
* // The host persisted terminal failure; no automatic retry is requested.
|
|
128
|
+
* }
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
markFailed(jobId: string, leaseToken: string, error: string, failureCode: string | undefined, now: Date): Promise<void>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Optional eligibility constraints for durable queue claims; omitted fields impose no restriction.
|
|
135
|
+
* @see AgentJobStore.claim.
|
|
136
|
+
*/
|
|
137
|
+
interface AgentJobClaimFilter {
|
|
138
|
+
/** Delivery mode; legacy jobs without a mode are treated as server-queue by the atomic implementation. */
|
|
139
|
+
dispatchMode?: ServerAgentDispatchMode;
|
|
140
|
+
/** Eligible registered route IDs; jobs without a matching route are excluded. */
|
|
141
|
+
routeIds?: readonly string[];
|
|
142
|
+
/** Verified runner ID; jobs with a different explicit runner binding are excluded, unbound jobs remain eligible. */
|
|
143
|
+
runnerId?: string;
|
|
144
|
+
/** Verified owning user ID to require. */
|
|
145
|
+
userId?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Host queue/worker and one-pass retry policy for {@link DurableAgentJobDispatcher}.
|
|
149
|
+
*/
|
|
150
|
+
interface AgentJobDispatcherOptions {
|
|
151
|
+
/** Durable queue enforcing claim leases and tenant admission. */
|
|
152
|
+
store: AgentJobStore;
|
|
153
|
+
/** Worker executing each cloned claimed task. */
|
|
154
|
+
worker: ServerAutonomousWorker;
|
|
155
|
+
/** Jobs requested per pass, safe integer 1–100; defaults to 1. */
|
|
156
|
+
batchSize?: number;
|
|
157
|
+
/** Dispatcher attempt ceiling, safe integer 1–100; defaults to 5 and is combined with each job ceiling. */
|
|
158
|
+
maxAttempts?: number;
|
|
159
|
+
/** Finite nonnegative initial exponential retry delay in milliseconds; defaults to 1000. */
|
|
160
|
+
baseDelayMs?: number;
|
|
161
|
+
/** Finite retry delay ceiling at least baseDelayMs; defaults to 60000 milliseconds. */
|
|
162
|
+
maxDelayMs?: number;
|
|
163
|
+
/** Clock for claims, transitions, and retry availability; defaults to fresh Date. */
|
|
164
|
+
now?: () => Date;
|
|
165
|
+
/** Resume a LangGraph thread or publish a domain event after a successful agent result. */
|
|
166
|
+
onCompleted?: (job: Readonly<AgentJobRecord<ServerAgentTaskRequest>>, result: ServerAgentTaskResult) => Promise<void>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Counts of one dispatcher pass; jobs missing lease tokens increment failed without a store transition.
|
|
170
|
+
* @see DurableAgentJobDispatcher.runOnce.
|
|
171
|
+
*/
|
|
172
|
+
interface AgentJobDispatchResult {
|
|
173
|
+
/** Number of rows returned by the claim. */
|
|
174
|
+
claimed: number;
|
|
175
|
+
/** Jobs whose completion callback and completed transition succeeded. */
|
|
176
|
+
succeeded: number;
|
|
177
|
+
/** Jobs transitioned to waiting_approval. */
|
|
178
|
+
waitingApproval: number;
|
|
179
|
+
/** Jobs scheduled for a later retry. */
|
|
180
|
+
retried: number;
|
|
181
|
+
/** Jobs marked terminal failure plus claimed jobs missing a lease token. */
|
|
182
|
+
failed: number;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Durable boundary between Micro 2 and an ARM agent runtime.
|
|
186
|
+
*
|
|
187
|
+
* The store is host-owned and must persist leases, attempts and results. This
|
|
188
|
+
* class owns only one bounded pass; a host scheduler calls runOnce again.
|
|
189
|
+
* @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.
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* import { DurableAgentJobDispatcher, type AgentJobDispatcherOptions } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
193
|
+
* export async function dispatch(options: AgentJobDispatcherOptions) {
|
|
194
|
+
* return new DurableAgentJobDispatcher(options).runOnce();
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
declare class DurableAgentJobDispatcher {
|
|
199
|
+
private readonly options;
|
|
200
|
+
/**
|
|
201
|
+
* Validates one-pass claim and exponential retry settings.
|
|
202
|
+
* @param options - Store/worker plus bounded batch, attempt, delay, clock, and completion settings.
|
|
203
|
+
* @throws Missing store/worker, batchSize/maxAttempts outside safe integer 1–100, or nonfinite/negative/inverted retry delays.
|
|
204
|
+
*/
|
|
205
|
+
constructor(options: AgentJobDispatcherOptions);
|
|
206
|
+
/**
|
|
207
|
+
* Claims one batch and executes jobs sequentially, persisting completion, approval wait, retry, or failure.
|
|
208
|
+
* @returns Per-outcome counts after all claimed jobs have been processed.
|
|
209
|
+
* @throws Rejects claim/transition/clock failures; worker errors become retryable failure results. Completion callback/markCompleted errors trigger retry-or-fail handling.
|
|
210
|
+
* @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.
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* import { DurableAgentJobDispatcher, type AgentJobDispatcherOptions } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
214
|
+
* export async function runOnce(options: AgentJobDispatcherOptions) { return new DurableAgentJobDispatcher(options).runOnce(); }
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
runOnce(): Promise<AgentJobDispatchResult>;
|
|
218
|
+
private retryOrFail;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Creates a cloned, hashed queued job record without persisting or executing it.
|
|
222
|
+
* @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.
|
|
223
|
+
* @returns A new queued record with generated jobId, attempt zero, request hash, and matching available/created/updated timestamps.
|
|
224
|
+
* @throws Clone/hash/invalid Date failures; this factory does not independently validate every task or attempt field.
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* import { createAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
228
|
+
* import type { ServerAgentTaskRequest } from "@alneas/eaos-server/agentic/types";
|
|
229
|
+
* export function queued(request: ServerAgentTaskRequest) { return createAgentJob({ request, kind: "workflow" }); }
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
declare function createAgentJob(input: {
|
|
233
|
+
/**
|
|
234
|
+
* Host-verified task cloned into the durable job and hashed for idempotency integrity.
|
|
235
|
+
*/
|
|
236
|
+
request: ServerAgentTaskRequest;
|
|
237
|
+
/**
|
|
238
|
+
* Queue kind used together with tenant and idempotencyKey to partition durable deduplication.
|
|
239
|
+
*/
|
|
240
|
+
kind: string;
|
|
241
|
+
/**
|
|
242
|
+
* Optional companion workflow instance ID retained in the queued record.
|
|
243
|
+
*/
|
|
244
|
+
workflowInstanceId?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Queue trace label; defaults to request.executionContext.correlationId, then request.id.
|
|
247
|
+
*/
|
|
248
|
+
correlationId?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Durable deduplication identity; defaults to request.executionContext.idempotencyKey, then request.id.
|
|
251
|
+
*/
|
|
252
|
+
idempotencyKey?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Job attempt ceiling retained without validation here; defaults to 5 and is later combined with dispatcher policy.
|
|
255
|
+
*/
|
|
256
|
+
maxAttempts?: number;
|
|
257
|
+
/**
|
|
258
|
+
* Timestamp for availableAt, createdAt, and updatedAt; defaults to a fresh Date and must support toISOString.
|
|
259
|
+
*/
|
|
260
|
+
now?: Date;
|
|
261
|
+
}): AgentJobRecord<ServerAgentTaskRequest>;
|
|
262
|
+
/**
|
|
263
|
+
* Persists a job and tenant/kind/idempotency index in the caller's atomic transaction.
|
|
264
|
+
* @param tx - Authorized active atomic session; the caller owns commit/rollback.
|
|
265
|
+
* @param job - Created job whose tenant/kind/key define deduplication and whose requestHash binds input.
|
|
266
|
+
* @returns A clone of the saved job, or existing indexed job when its request hash matches; existing lifecycle state is preserved.
|
|
267
|
+
* @throws Reused idempotency key with a different request hash, missing indexed job, or propagated transaction/clone errors.
|
|
268
|
+
* @remarks This helper neither executes the job nor opens a transaction; host transaction isolation/CAS must prevent concurrent index creation races.
|
|
269
|
+
* @example
|
|
270
|
+
* ```typescript
|
|
271
|
+
* import { enqueueAgentJob, createAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
272
|
+
* import type { AtomicSession } from "@alneas/eaos-server/plugin-data/atomic";
|
|
273
|
+
* import type { ServerAgentTaskRequest } from "@alneas/eaos-server/agentic/types";
|
|
274
|
+
* export async function enqueue(tx: AtomicSession, request: ServerAgentTaskRequest) {
|
|
275
|
+
* return enqueueAgentJob(tx, createAgentJob({ request, kind: "workflow" }));
|
|
276
|
+
* }
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
declare function enqueueAgentJob(tx: AtomicSession, job: AgentJobRecord<ServerAgentTaskRequest>): Promise<AgentJobRecord<ServerAgentTaskRequest>>;
|
|
280
|
+
/**
|
|
281
|
+
* Tenant-scoped CAS persistence, lease timing, admission, and transactional completion hook.
|
|
282
|
+
* @see createAtomicAgentJobStore.
|
|
283
|
+
*/
|
|
284
|
+
interface AtomicAgentJobStoreOptions {
|
|
285
|
+
/** Host atomic repository enforcing durable CAS and tenant isolation. */
|
|
286
|
+
repository: AtomicRepository;
|
|
287
|
+
/** Verified tenant/plugin/user repository scope, retained by reference. */
|
|
288
|
+
principal: PluginPrincipal;
|
|
289
|
+
/** Additional stale grace after lease expiry in milliseconds; finite and at least 1000, defaults to 300000. */
|
|
290
|
+
staleAfterMs?: number;
|
|
291
|
+
/** Lease duration in milliseconds; finite and at least 1000, defaults to 900000. */
|
|
292
|
+
leaseMs?: number;
|
|
293
|
+
/** Clock for state transitions; defaults to fresh Date. */
|
|
294
|
+
now?: () => Date;
|
|
295
|
+
/** Current host admission is checked before and after durable mutations. */
|
|
296
|
+
verifyCurrent?: () => Promise<void>;
|
|
297
|
+
/** Persist the domain result in the same transaction as the succeeded job state. */
|
|
298
|
+
onCompleted?: (tx: AtomicSession, job: Readonly<AgentJobRecord<ServerAgentTaskRequest>>, result: Readonly<ServerAgentTaskResult>) => Promise<void>;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Creates a lease-checked agent queue over an existing tenant-scoped atomic repository.
|
|
302
|
+
* @param options - Repository/principal plus clocks, leases, optional current-admission checks, and transactional result persistence.
|
|
303
|
+
* @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.
|
|
304
|
+
* @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.
|
|
305
|
+
* @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.
|
|
306
|
+
* @example
|
|
307
|
+
* ```typescript
|
|
308
|
+
* import { createAtomicAgentJobStore, type AtomicAgentJobStoreOptions } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
309
|
+
* export function jobStore(options: AtomicAgentJobStoreOptions) { return createAtomicAgentJobStore(options); }
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
312
|
+
declare function createAtomicAgentJobStore(options: AtomicAgentJobStoreOptions): AgentJobStore;
|
|
313
|
+
/**
|
|
314
|
+
* Marks an owned unstarted job cancelled in the caller's atomic session.
|
|
315
|
+
* @param tx - Authorized atomic session; caller commits/rolls back.
|
|
316
|
+
* @param principal - Verified tenant/user who owns the job.
|
|
317
|
+
* @param jobId - Stored queue job identifier.
|
|
318
|
+
* @param now - Cancellation timestamp; defaults to a fresh Date.
|
|
319
|
+
* @returns A cloned cancelled job, unchanged when already cancelled.
|
|
320
|
+
* @throws Missing/foreign job, request integrity mismatch, status other than queued/retryable/waiting_approval/cancelled, or transaction/clock errors.
|
|
321
|
+
* @remarks Running leases cannot be interrupted by this edit. This function performs no external runtime cancellation, approval-ticket revocation, or live admission callback.
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* import { cancelAgentJob } from "@alneas/eaos-server/agentic/agent-jobs";
|
|
325
|
+
* import type { AtomicSession } from "@alneas/eaos-server/plugin-data/atomic";
|
|
326
|
+
* import type { PluginPrincipal } from "@alneas/eaos-server/plugin-data";
|
|
327
|
+
* export async function cancel(tx: AtomicSession, principal: PluginPrincipal, jobId: string) { return cancelAgentJob(tx, principal, jobId); }
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
declare function cancelAgentJob(tx: AtomicSession, principal: PluginPrincipal, jobId: string, now?: Date): Promise<AgentJobRecord<ServerAgentTaskRequest>>;
|
|
331
|
+
|
|
332
|
+
export { DurableAgentJobDispatcher, cancelAgentJob, createAgentJob, createAtomicAgentJobStore, enqueueAgentJob };
|
|
333
|
+
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|