@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
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { AIExecutionDecision, AgentJobRecord, AIExecutionRequest, AgentJobKind, AIExecutionCandidate } from '@alneas/eaos-core';
|
|
2
|
+
import { AtomicSession } from '../plugin-data/index.js';
|
|
3
|
+
import { ServerAgentTaskRequest, ServerAgentExecutionContext, ServerAgentWorkerType, ServerAgentDispatchMode } from './types.js';
|
|
4
|
+
import 'hono/types';
|
|
5
|
+
import '@alneas/eaos-core/plugin-sdk';
|
|
6
|
+
import 'hono';
|
|
7
|
+
import '@alneas/eaos-server/lifecycle-engine';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Host-advertised AI candidate with server worker and queue/local-runner delivery binding.
|
|
11
|
+
* @see DurableAIExecutionBroker.
|
|
12
|
+
*/
|
|
13
|
+
interface ServerAIExecutionRoute extends AIExecutionCandidate {
|
|
14
|
+
/** Executor key bound to the selected host route. */
|
|
15
|
+
workerType: ServerAgentWorkerType;
|
|
16
|
+
/** Local CLI/MLX candidates must use local-pull; nonlocal candidates cannot use local-pull. */
|
|
17
|
+
dispatchMode: ServerAgentDispatchMode;
|
|
18
|
+
/** Pin a route to one registered local runner when the host requires it. */
|
|
19
|
+
runnerId?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Verified task input before the broker chooses immutable runtime routing fields.
|
|
23
|
+
* @see DurableAIExecutionBroker.plan.
|
|
24
|
+
*/
|
|
25
|
+
interface AIJobTaskInput {
|
|
26
|
+
/** Stable task identifier. */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Verified tenant, required to match routing context. */
|
|
29
|
+
tenantId: string;
|
|
30
|
+
/** Verified user, required to match routing context. */
|
|
31
|
+
userId: string;
|
|
32
|
+
/** Human task label forwarded to runtime. */
|
|
33
|
+
title: string;
|
|
34
|
+
/** Runtime instructions forwarded without domain validation here. */
|
|
35
|
+
instructions: string;
|
|
36
|
+
/** Optional domain execution context. */
|
|
37
|
+
context?: Record<string, unknown>;
|
|
38
|
+
/** Optional workflow/tool context; broker-owned routing fields are replaced. */
|
|
39
|
+
executionContext?: ServerAgentExecutionContext;
|
|
40
|
+
/** Optional runtime timeout in milliseconds, forwarded for executor validation. */
|
|
41
|
+
timeoutMs?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Verified routing request, task, and queue deduplication/retry metadata.
|
|
45
|
+
* @see DurableAIExecutionBroker.plan.
|
|
46
|
+
*/
|
|
47
|
+
interface AIJobSubmission {
|
|
48
|
+
/** Core execution requirements and verified context used for route allocation. */
|
|
49
|
+
routing: AIExecutionRequest;
|
|
50
|
+
/** Verified task before worker/routing binding. */
|
|
51
|
+
task: AIJobTaskInput;
|
|
52
|
+
/** Queue job kind and idempotency partition. */
|
|
53
|
+
kind: AgentJobKind;
|
|
54
|
+
/** Optional associated workflow instance. */
|
|
55
|
+
workflowInstanceId?: string;
|
|
56
|
+
/** Optional queue correlation ID; defaults to routing.context.operation. */
|
|
57
|
+
correlationId?: string;
|
|
58
|
+
/** Optional durable deduplication key; absent uses task execution key then task.id. */
|
|
59
|
+
idempotencyKey?: string;
|
|
60
|
+
/** Optional job attempt ceiling; defaults to 5 through createAgentJob. */
|
|
61
|
+
maxAttempts?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Selected runtime decision and unpersisted or saved queue job.
|
|
65
|
+
* @see DurableAIExecutionBroker.enqueue.
|
|
66
|
+
*/
|
|
67
|
+
interface AIJobPlan {
|
|
68
|
+
/** Current selector decision, even when enqueue returns an existing deduplicated job. */
|
|
69
|
+
decision: AIExecutionDecision;
|
|
70
|
+
/** Created or deduplicated queue record with persisted runtime routing. */
|
|
71
|
+
job: AgentJobRecord<ServerAgentTaskRequest>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Micro2 controller for dynamic model/runtime allocation.
|
|
75
|
+
*
|
|
76
|
+
* It selects only host-advertised routes and persists the selected route in
|
|
77
|
+
* the durable job. It never reads a subscription credential or starts a local
|
|
78
|
+
* process. A local-pull route is later claimed by LocalRunnerPullCoordinator.
|
|
79
|
+
* @remarks Route selection and planning are process-local. The host verifies identity and supplies current candidate availability/policy; authorization, runtime execution, and safe retries remain separate responsibilities.
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* import { DurableAIExecutionBroker } from "@alneas/eaos-server/agentic/ai-broker";
|
|
83
|
+
* export function broker(options: ConstructorParameters<typeof DurableAIExecutionBroker>[0]) {
|
|
84
|
+
* return new DurableAIExecutionBroker(options);
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
declare class DurableAIExecutionBroker {
|
|
89
|
+
private readonly routesById;
|
|
90
|
+
private readonly selector;
|
|
91
|
+
private readonly now;
|
|
92
|
+
/**
|
|
93
|
+
* Validates and clones server routes and configures the core allocation selector.
|
|
94
|
+
* @param options - Nonempty routes list; optional policyVersion labels selector decisions and now supplies job timestamps, defaulting to fresh Date.
|
|
95
|
+
* @throws Invalid/missing routes, incompatible local dispatch bindings, core selector validation, or clone failures.
|
|
96
|
+
*/
|
|
97
|
+
constructor(options: {
|
|
98
|
+
/**
|
|
99
|
+
* Nonempty host-approved execution routes, validated/cloned before configuring the selector; route IDs and runtime dispatch bindings must be compatible.
|
|
100
|
+
*/
|
|
101
|
+
routes: readonly ServerAIExecutionRoute[];
|
|
102
|
+
/**
|
|
103
|
+
* Optional decision policy label forwarded to the Core selector; omission selects ai-execution-policy-v1.
|
|
104
|
+
*/
|
|
105
|
+
policyVersion?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Optional clock used when constructing agent job records; omission creates a new current Date per call.
|
|
108
|
+
* @returns A valid Date used for planned job timestamps; clock failures propagate from planning.
|
|
109
|
+
* @see {@link DurableAIExecutionBroker.plan}
|
|
110
|
+
*/
|
|
111
|
+
now?: () => Date;
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Lists registered server route bindings without exposing mutable stored objects.
|
|
115
|
+
* @returns Cloned route records in registration map order.
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* import { DurableAIExecutionBroker } from "@alneas/eaos-server/agentic/ai-broker";
|
|
119
|
+
* export function routes(broker: DurableAIExecutionBroker) { return broker.listRoutes(); }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
listRoutes(): readonly ServerAIExecutionRoute[];
|
|
123
|
+
/**
|
|
124
|
+
* Selects an eligible host-advertised runtime using the core routing policy.
|
|
125
|
+
* @param request - Verified AI execution requirements and context.
|
|
126
|
+
* @returns The core selector decision; no job is persisted or runtime started.
|
|
127
|
+
* @throws Propagates core routing validation/no-eligible-route errors.
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { DurableAIExecutionBroker } from "@alneas/eaos-server/agentic/ai-broker";
|
|
131
|
+
* import type { AIExecutionRequest } from "@alneas/eaos-core";
|
|
132
|
+
* export function decide(broker: DurableAIExecutionBroker, request: AIExecutionRequest) { return broker.decide(request); }
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
decide(request: AIExecutionRequest): AIExecutionDecision;
|
|
136
|
+
/**
|
|
137
|
+
* Selects a route and creates a queue record with host-controlled worker/dispatch/runner bindings.
|
|
138
|
+
* @param input - Routing and task must have matching tenantId/userId; queue metadata follows AIJobSubmission.
|
|
139
|
+
* @returns Decision and newly created job; caller-supplied broker route/dispatch/runner execution fields are stripped before selected bindings are written.
|
|
140
|
+
* @throws Principal mismatch, unavailable route, invalid core routing, clone/hash/clock, or job creation failures.
|
|
141
|
+
* @remarks No persistence or deduplication occurs until enqueue; repeated plan calls generate different job IDs.
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* import { DurableAIExecutionBroker } from "@alneas/eaos-server/agentic/ai-broker";
|
|
145
|
+
* import type { AIJobSubmission } from "@alneas/eaos-server/agentic/ai-broker";
|
|
146
|
+
* export function plan(broker: DurableAIExecutionBroker, input: AIJobSubmission) { return broker.plan(input); }
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
plan(input: AIJobSubmission): AIJobPlan;
|
|
150
|
+
/**
|
|
151
|
+
* Plans routing and atomically inserts or deduplicates the queue job in a caller-owned session.
|
|
152
|
+
* @param tx - Authorized atomic transaction/session; caller owns commit/rollback.
|
|
153
|
+
* @param input - Verified routing/task and queue metadata.
|
|
154
|
+
* @returns Decision plus the newly saved or existing idempotent job.
|
|
155
|
+
* @throws Planning errors, conflicting deduplication input, corrupt index, or session failures.
|
|
156
|
+
* @remarks Selection still runs before deduplication; the returned existing job is authoritative for its persisted routing. No runtime execution occurs.
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* import { DurableAIExecutionBroker } from "@alneas/eaos-server/agentic/ai-broker";
|
|
160
|
+
* import type { AIJobSubmission } from "@alneas/eaos-server/agentic/ai-broker";
|
|
161
|
+
* import type { AtomicSession } from "@alneas/eaos-server/plugin-data/atomic";
|
|
162
|
+
* export async function enqueue(broker: DurableAIExecutionBroker, tx: AtomicSession, input: AIJobSubmission) { return broker.enqueue(tx, input); }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
enqueue(tx: AtomicSession, input: AIJobSubmission): Promise<AIJobPlan>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { DurableAIExecutionBroker };
|
|
169
|
+
export type { AIJobPlan, AIJobSubmission, AIJobTaskInput, ServerAIExecutionRoute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { BaseCheckpointSaver, CheckpointTuple, Checkpoint, CheckpointMetadata } from '@langchain/langgraph';
|
|
2
|
+
import { AtomicRepository, PluginPrincipal } from '../plugin-data/index.js';
|
|
3
|
+
import '@alneas/eaos-core';
|
|
4
|
+
import 'hono/types';
|
|
5
|
+
import '@alneas/eaos-core/plugin-sdk';
|
|
6
|
+
import 'hono';
|
|
7
|
+
import '@alneas/eaos-server/lifecycle-engine';
|
|
8
|
+
|
|
9
|
+
type Config = Parameters<BaseCheckpointSaver['getTuple']>[0];
|
|
10
|
+
type ListOptions = Parameters<BaseCheckpointSaver['list']>[1];
|
|
11
|
+
type Writes = Parameters<BaseCheckpointSaver['putWrites']>[1];
|
|
12
|
+
/**
|
|
13
|
+
* Stores LangGraph checkpoints and pending writes in an existing scoped atomic repository.
|
|
14
|
+
* @remarks Admission and workflow writer serialization remain host-owned. Each saver instance serializes repository work through an internal Promise chain and calls verifyCurrent before the transaction and before/after its work. This does not serialize other saver instances or whole graph invocations. The repository owns durability/CAS; this saver installs no timers and does not close host storage. Checkpoint erasure requires a separate host retention executor.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
18
|
+
* export function saver(options: ConstructorParameters<typeof AtomicCheckpointSaver>[0]) {
|
|
19
|
+
* return new AtomicCheckpointSaver(options);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare class AtomicCheckpointSaver extends BaseCheckpointSaver {
|
|
24
|
+
private readonly options;
|
|
25
|
+
private readonly principal;
|
|
26
|
+
private pending;
|
|
27
|
+
/**
|
|
28
|
+
* Captures a verified plugin principal and required current-admission callback.
|
|
29
|
+
* @param options - Scoped repository; principal is validated/cloned; verifyCurrent must reject on revoked admission; prefix defaults to graph-checkpoint and must contain 1–64 lowercase letters/digits/underscore/hyphen.
|
|
30
|
+
* @throws Invalid principal, absent repository/verifier, invalid prefix, or clone failure.
|
|
31
|
+
*/
|
|
32
|
+
constructor(options: {
|
|
33
|
+
/**
|
|
34
|
+
* Connected host atomic repository used for scoped checkpoint and pending-write transactions; this saver does not close it.
|
|
35
|
+
*/
|
|
36
|
+
repository: AtomicRepository;
|
|
37
|
+
/**
|
|
38
|
+
* Verified plugin principal validated and cloned at construction; fixes the tenant/plugin/user scope used for repository transactions.
|
|
39
|
+
*/
|
|
40
|
+
principal: PluginPrincipal;
|
|
41
|
+
/**
|
|
42
|
+
* Recheck current host admission before repository work and at transaction boundaries.
|
|
43
|
+
* @returns No value; resolve only while the captured principal remains admitted and reject when admission is revoked.
|
|
44
|
+
* @remarks Required callback; called before the repository transaction and before/after its work, and before each history yield. The host owns the live policy lookup.
|
|
45
|
+
* @see {@link AtomicCheckpointSaver}
|
|
46
|
+
*/
|
|
47
|
+
verifyCurrent: () => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional repository key prefix; defaults to graph-checkpoint and must contain 1–64 lowercase letters, digits, underscores or hyphens.
|
|
50
|
+
*/
|
|
51
|
+
prefix?: string;
|
|
52
|
+
});
|
|
53
|
+
private scope;
|
|
54
|
+
private config;
|
|
55
|
+
private encode;
|
|
56
|
+
private decode;
|
|
57
|
+
private run;
|
|
58
|
+
private tuple;
|
|
59
|
+
/**
|
|
60
|
+
* Reads one scoped checkpoint and its separately stored pending writes.
|
|
61
|
+
* @param config - LangGraph config with required thread_id, optional checkpoint_ns (default empty), and optional checkpoint_id (default latest lexicographic ID). Identifiers are bounded to 512 characters without control characters.
|
|
62
|
+
* @returns Decoded checkpoint tuple or undefined if no selected checkpoint exists.
|
|
63
|
+
* @throws Rejects invalid identifiers, tenant/thread/namespace or format mismatch, and admission/repository/serialization failures.
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
67
|
+
* export async function read(saver: AtomicCheckpointSaver, config: Parameters<AtomicCheckpointSaver["getTuple"]>[0]) { return saver.getTuple(config); }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
getTuple(config: Config): Promise<CheckpointTuple | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Lists scoped checkpoint history in descending lexicographic checkpoint-ID order.
|
|
73
|
+
* @param config - Required thread scope, optional namespace, and optional exact checkpoint ID filter.
|
|
74
|
+
* @param options - limit defaults to 100 and must be a safe integer 1–2000; before must use the same thread/namespace and excludes its ID and newer IDs; filter compares metadata fields by atomic hash.
|
|
75
|
+
* @returns Async sequence of decoded tuples, possibly empty, with admission rechecked before each yield.
|
|
76
|
+
* @throws Iteration rejects invalid scope/limits, more than 2000 scanned checkpoint rows, identity/format mismatch, or admission/repository/serialization errors.
|
|
77
|
+
* @remarks History is collected in a bounded repository transaction before yielding; changing authorization can still stop later yields.
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
81
|
+
* export async function history(saver: AtomicCheckpointSaver, config: Parameters<AtomicCheckpointSaver["list"]>[0]) {
|
|
82
|
+
* const tuples = [];
|
|
83
|
+
* for await (const tuple of saver.list(config, { limit: 10 })) tuples.push(tuple);
|
|
84
|
+
* return tuples;
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
list(config: Config, options?: ListOptions): AsyncGenerator<CheckpointTuple>;
|
|
89
|
+
/**
|
|
90
|
+
* Writes an immutable version-4 checkpoint and advances the scoped latest pointer when its ID sorts later.
|
|
91
|
+
* @param config - Thread/namespace scope; optional checkpoint_id becomes the new checkpoint's parent ID.
|
|
92
|
+
* @param checkpoint - Current LangGraph version-4 checkpoint with valid nonempty bounded ID.
|
|
93
|
+
* @param metadata - Serializer-supported checkpoint metadata.
|
|
94
|
+
* @returns A config selecting the stored checkpoint ID.
|
|
95
|
+
* @throws Rejects unsupported format, ID reuse with different content, admission/CAS/repository errors, or serialization failures.
|
|
96
|
+
* @remarks Repeating identical content is accepted; latest ordering is lexicographic, so host checkpoint IDs must reflect desired chronology.
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
100
|
+
* export async function write(saver: AtomicCheckpointSaver, ...args: Parameters<AtomicCheckpointSaver["put"]>) { return saver.put(...args); }
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
put(config: Config, checkpoint: Checkpoint, metadata: CheckpointMetadata): Promise<Config>;
|
|
104
|
+
/**
|
|
105
|
+
* Merges pending channel writes by task/index for one scoped checkpoint.
|
|
106
|
+
* @param config - Thread/namespace with required checkpoint_id.
|
|
107
|
+
* @param writes - At most 256 channel/value pairs; channels are valid bounded identifiers. Ordinary task/index duplicates retain their first value; reserved negative-index channels replace prior values.
|
|
108
|
+
* @param taskId - Nonempty bounded task identifier associating writes.
|
|
109
|
+
* @returns No value; resolves after the merged writes are durably stored.
|
|
110
|
+
* @throws Rejects missing checkpoint ID, invalid task/channel, identity mismatch, more than 2000 stored pending writes, or admission/repository/serialization errors.
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
114
|
+
* export async function writePending(saver: AtomicCheckpointSaver, ...args: Parameters<AtomicCheckpointSaver["putWrites"]>) { await saver.putWrites(...args); }
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
putWrites(config: Config, writes: Writes, taskId: string): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Rejects thread deletion because this repository contract provides no approved erasure operation.
|
|
120
|
+
* @param _threadId - Requested thread ID; not read or deleted.
|
|
121
|
+
* @returns No value; this operation always rejects before performing storage work.
|
|
122
|
+
* @throws Always rejects with an error directing the caller to the host retention executor.
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* import { AtomicCheckpointSaver } from "@alneas/eaos-server/agentic/atomic-checkpointer";
|
|
126
|
+
* export async function erase(saver: AtomicCheckpointSaver, threadId: string) {
|
|
127
|
+
* try { await saver.deleteThread(threadId); } catch (error) {
|
|
128
|
+
* // Host retention tooling must perform reviewed erasure.
|
|
129
|
+
* throw error;
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
deleteThread(_threadId: string): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { AtomicCheckpointSaver };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat';
|
|
2
|
+
import { ChatClientOptions } from '../execution/index.js';
|
|
3
|
+
import { McpGatekeeper, AgentRuntimeResourcePolicy } from '@alneas/eaos-core';
|
|
4
|
+
import { ServerAgentWorkerType, ServerAgentExecutor, ServerAgentTaskRequest, ServerAgentTaskResult } from './types.js';
|
|
5
|
+
import '@alneas/appkit-core/ai/action';
|
|
6
|
+
import 'hono/types';
|
|
7
|
+
import 'hono';
|
|
8
|
+
import '@alneas/appkit-core/ai';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Host composition of the shared chat path for built-in model tasks.
|
|
12
|
+
* @remarks Defaults retain the worker gatekeeper, 60-second task timeout and worker output bound. Tools are undisclosed; action orchestration belongs to createToolAgent. No model transport or credential is selected from model output.
|
|
13
|
+
* @see ServerWorkerOptions for complete worker configuration.
|
|
14
|
+
*/
|
|
15
|
+
interface ServerWorkerChatOptions extends Omit<ChatClientOptions, 'adapter' | 'authorize' | 'tools'> {
|
|
16
|
+
/** Optional host adapter; omission uses Appkit's OpenAI-compatible LiteLLM transport. */
|
|
17
|
+
adapter?: AIChatAdapter;
|
|
18
|
+
/** Optional live Host authorization, combined with the worker gatekeeper before and after asynchronous work. */
|
|
19
|
+
authorize?: ChatClientOptions['authorize'];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Trusted gatekeeper, runtime endpoints/adapters, and execution limits for {@link ServerAutonomousWorker}.
|
|
23
|
+
*/
|
|
24
|
+
interface ServerWorkerOptions {
|
|
25
|
+
/** Host security/approval policies; defaults to a new McpGatekeeper. */
|
|
26
|
+
gatekeeper?: McpGatekeeper;
|
|
27
|
+
/** Trusted executable path; defaults to GOOSE_BIN_PATH or goose. */
|
|
28
|
+
gooseBinaryPath?: string;
|
|
29
|
+
/** Trusted executable path; defaults to HERMES_AGENT_BIN_PATH or hermes. */
|
|
30
|
+
hermesAgentBinaryPath?: string;
|
|
31
|
+
/** Host LiteLLM base URL; defaults to LITELLM_ENDPOINT or http://localhost:4000/v1. */
|
|
32
|
+
litellmEndpoint?: string;
|
|
33
|
+
/** Host model identifier; defaults to LITELLM_MODEL and is required for built-in LiteLLM execution. */
|
|
34
|
+
litellmModel?: string;
|
|
35
|
+
/** Host-owned provider headers; captured at construction and never read from task/model input. */
|
|
36
|
+
litellmHeaders?: Readonly<Record<string, string>>;
|
|
37
|
+
/** Optional shared chat model routing, live authorization, limits, guards, usage, budget and observability. */
|
|
38
|
+
chat?: ServerWorkerChatOptions;
|
|
39
|
+
/** Combined command output/string result ceiling, safe integer 1–10000000; defaults to 1000000. */
|
|
40
|
+
maxOutputChars?: number;
|
|
41
|
+
/** Framework default is safe for the ARM agent host. Host adapters may tighten it. */
|
|
42
|
+
runtimePolicy?: AgentRuntimeResourcePolicy;
|
|
43
|
+
/** Built-in Goose/Hermes execution is permitted only on the AI placement. */
|
|
44
|
+
runtimeRole?: ServerRuntimeRole;
|
|
45
|
+
/** Host fetch implementation for built-in LiteLLM; defaults to global fetch. */
|
|
46
|
+
fetch?: typeof fetch;
|
|
47
|
+
/** Host/plugin adapters for coding agents and other external runtimes. */
|
|
48
|
+
executors?: Partial<Record<ServerAgentWorkerType, ServerAgentExecutor>>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Host placement role controlling whether built-in Goose/Hermes processes may run locally.
|
|
52
|
+
* @see ServerAutonomousWorker.
|
|
53
|
+
*/
|
|
54
|
+
type ServerRuntimeRole = 'edge' | 'application-worker' | 'ai';
|
|
55
|
+
/**
|
|
56
|
+
* Admits and executes host agent tasks through a gatekeeper and bounded runtime adapters.
|
|
57
|
+
* @remarks This class runs only when runTask is called; it installs no scheduler. The host authenticates tenant/user claims before admission. Framework-managed tasks share a per-instance concurrency counter; injected executors own scheduling and are exempt from it. Built-in Goose/Hermes require the ai role and Node process/systemd support. Queue persistence, approvals, retries, and side-effect idempotency belong to the host.
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* import { ServerAutonomousWorker, type ServerWorkerOptions } from "@alneas/eaos-server/agentic/autonomous-worker";
|
|
61
|
+
* export function worker(options: ServerWorkerOptions) { return new ServerAutonomousWorker(options); }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare class ServerAutonomousWorker {
|
|
65
|
+
private gatekeeper;
|
|
66
|
+
private goosePath;
|
|
67
|
+
private hermesAgentPath;
|
|
68
|
+
private litellmUrl;
|
|
69
|
+
private litellmModel?;
|
|
70
|
+
private litellmHeaders;
|
|
71
|
+
private chatOptions;
|
|
72
|
+
private maxOutputChars;
|
|
73
|
+
private runtimePolicy;
|
|
74
|
+
private runtimeRole;
|
|
75
|
+
private activeTasks;
|
|
76
|
+
private fetchImpl;
|
|
77
|
+
private executors;
|
|
78
|
+
/**
|
|
79
|
+
* Captures runtime settings and validates resource policy, role, and output ceiling.
|
|
80
|
+
* @param options - Trusted host configuration; omitted gatekeeper uses a new McpGatekeeper and runtime role uses EAOS_RUNTIME_ROLE, then ai on arm64 or application-worker otherwise.
|
|
81
|
+
* @throws Invalid resource policy, role, or output limit.
|
|
82
|
+
*/
|
|
83
|
+
constructor(options?: ServerWorkerOptions);
|
|
84
|
+
/**
|
|
85
|
+
* Checks task limits and gatekeeper policy before dispatching one runtime attempt.
|
|
86
|
+
* @param request - Verified task identity and instructions; required strings must be nonblank, title at most 500 characters, instructions at most 1000000, and timeout a safe integer 1–3600000 milliseconds when provided.
|
|
87
|
+
* @param execution - Optional cancellation signal for built-in shared chat tasks; does not change injected executor or process contracts.
|
|
88
|
+
* @returns COMPLETED text output, PENDING_APPROVAL ticket data without execution, or FAILED data with error and optional classification/retry advice. Duration is measured in wall-clock milliseconds.
|
|
89
|
+
* @throws Can reject a throwing gatekeeper or malformed gatekeeper interaction before dispatch; runtime execution errors are normally returned as FAILED data.
|
|
90
|
+
* @remarks Gatekeeper receives fixed agent/server_bot roles rather than request user roles. Approval tickets are generated but not persisted here. The configured framework policy overrides request.runtimePolicy before execution. Injected executors and built-in chat outputs are bounded by maxOutputChars. LiteLLM uses Appkit SSE transport through createChatClient; JSON-only endpoints require a Host adapter or executor. Existing FAILED/PENDING_APPROVAL/COMPLETED envelopes and injected-executor priority remain unchanged.
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* import { ServerAutonomousWorker, type ServerWorkerOptions } from "@alneas/eaos-server/agentic/autonomous-worker";
|
|
94
|
+
* import type { ServerAgentTaskRequest } from "@alneas/eaos-server/agentic/types";
|
|
95
|
+
* export async function execute(options: ServerWorkerOptions, request: ServerAgentTaskRequest) {
|
|
96
|
+
* return new ServerAutonomousWorker(options).runTask(request);
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
runTask(request: ServerAgentTaskRequest, execution?: {
|
|
101
|
+
/** Cooperatively cancel built-in shared chat. Injected executors and Goose/Hermes retain their own cancellation contracts. */
|
|
102
|
+
signal?: AbortSignal;
|
|
103
|
+
}): Promise<ServerAgentTaskResult>;
|
|
104
|
+
private execute;
|
|
105
|
+
/**
|
|
106
|
+
* Execute Goose in headless batch mode
|
|
107
|
+
*/
|
|
108
|
+
private executeHeadlessGoose;
|
|
109
|
+
/**
|
|
110
|
+
* Execute NousResearch Hermes Agent in headless mode (-z / non-interactive)
|
|
111
|
+
* Hermes Agent provides persistent cross-session memory and self-improving skill extraction.
|
|
112
|
+
*/
|
|
113
|
+
private executeHeadlessHermesAgent;
|
|
114
|
+
/**
|
|
115
|
+
* Execute a host-selected model through LiteLLM.
|
|
116
|
+
*/
|
|
117
|
+
private executeLiteLlm;
|
|
118
|
+
private boundOutput;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export { ServerAutonomousWorker };
|
|
122
|
+
export type { ServerRuntimeRole, ServerWorkerChatOptions, ServerWorkerOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|