@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,342 @@
|
|
|
1
|
+
import { AIChatMessage, AIChatAdapter } from '@alneas/appkit-core/ai/ai-chat';
|
|
2
|
+
import { ActionToolBinding, ActionRegistry, ActionToolCall, ActionToolObject, ActionToolDescriptor } from '@alneas/appkit-core/ai/action';
|
|
3
|
+
import { AIModelRegistry, AIGuard, AIBudgetGate, AIObservabilitySink, AIUsage, AIExecutionContext } from '@alneas/eaos-core';
|
|
4
|
+
import * as hono_types from 'hono/types';
|
|
5
|
+
import { Context, Hono } from 'hono';
|
|
6
|
+
import * as _alneas_appkit_core_ai from '@alneas/appkit-core/ai';
|
|
7
|
+
|
|
8
|
+
/** Host-registered Action binding and explicit automatic-execution policy.
|
|
9
|
+
* @see createToolAgent
|
|
10
|
+
*/
|
|
11
|
+
interface AgentTool {
|
|
12
|
+
/** Existing Appkit Action/command binding; registration and input/output schemas remain Appkit-owned. */
|
|
13
|
+
binding: ActionToolBinding;
|
|
14
|
+
/** Only host-verified read-only actions may run automatically; handoffs remain unexecuted. */
|
|
15
|
+
mode: 'read' | 'handoff';
|
|
16
|
+
}
|
|
17
|
+
/** Current host policies and limits for a single-flight Appkit execution session.
|
|
18
|
+
* @see createToolAgent
|
|
19
|
+
*/
|
|
20
|
+
interface ToolAgentOptions extends Omit<ChatClientOptions, 'tools'> {
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the current host registry and explicit tool execution policy.
|
|
23
|
+
* @param principal - Copied verified tenant/user identity.
|
|
24
|
+
* @returns Existing Action registry and at most 100 read/handoff bindings.
|
|
25
|
+
* @throws Rejects missing host session or registry resolution failures.
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import type { ToolAgentOptions } from '@alneas/eaos-server/execution/tool-agent';
|
|
29
|
+
* export function agentSession(resolve: ToolAgentOptions['session']) { return resolve; }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
session(principal: ExecutionPrincipal): Promise<{
|
|
33
|
+
/** Existing host-owned Appkit Action registry for this authorized session. */
|
|
34
|
+
registry: ActionRegistry;
|
|
35
|
+
/** Explicit read/handoff policy for every disclosed binding. */
|
|
36
|
+
tools: readonly AgentTool[];
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Check current permission to disclose a tool descriptor or result to the model.
|
|
40
|
+
* @param principal - Copied verified actor.
|
|
41
|
+
* @param name - Host-registered tool name.
|
|
42
|
+
* @returns Exactly true permits disclosure; other results deny it.
|
|
43
|
+
* @throws Host policy errors propagate into the execution outcome.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import type { ToolAgentOptions } from '@alneas/eaos-server/execution/tool-agent';
|
|
47
|
+
* export function disclosurePolicy(policy: ToolAgentOptions['disclose']) { return policy; }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
disclose(principal: ExecutionPrincipal, name: string): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Check exact resource/input permission before execution and before result disclosure.
|
|
53
|
+
* @param principal - Copied verified actor; callback mutation cannot change the trusted identity.
|
|
54
|
+
* @param call - Untrusted model request with correlated ID, name and arguments.
|
|
55
|
+
* @returns Exactly true admits the call; it does not approve a handoff for execution.
|
|
56
|
+
* @throws Host policy errors propagate into the execution outcome.
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* import type { ToolAgentOptions } from '@alneas/eaos-server/execution/tool-agent';
|
|
60
|
+
* export function callPolicy(policy: ToolAgentOptions['authorizeCall']) { return policy; }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
authorizeCall(principal: ExecutionPrincipal, call: ActionToolCall): Promise<boolean>;
|
|
64
|
+
/** Maximum model rounds; default 6, allowed integers 1–20. */
|
|
65
|
+
maxRounds?: number;
|
|
66
|
+
/** Maximum automatic Action calls per run; default 10, allowed integers 1–100. */
|
|
67
|
+
maxCalls?: number;
|
|
68
|
+
}
|
|
69
|
+
/** Final in-memory conversational outcome, separate from Appkit execution status.
|
|
70
|
+
* @see createToolAgent
|
|
71
|
+
*/
|
|
72
|
+
interface ToolAgentResult {
|
|
73
|
+
/** Completed chat, unexecuted handoff, bounded stop, or an Action validation/execution failure. */
|
|
74
|
+
status: 'completed' | 'handoff' | 'limited' | 'tool-error';
|
|
75
|
+
/** Detached correlated chat history, including only authorized projected tool results. */
|
|
76
|
+
messages: AIChatMessage[];
|
|
77
|
+
/** Unexecuted requests; the host must validate them through its existing Action/Proposal review path. */
|
|
78
|
+
pending: ActionToolCall[];
|
|
79
|
+
/** Number of attempted automatic Action calls, including a returned Action failure. */
|
|
80
|
+
callsExecuted: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Orchestrate bounded model rounds through existing Appkit Action/Execution and scoped EAOS chat.
|
|
84
|
+
* @param options - Current session/disclosure/call policies, Appkit adapter and chat/round/call limits.
|
|
85
|
+
* @returns Single-flight run, cancel, close and summary subscription methods backed by Appkit ExecutionSession.
|
|
86
|
+
* @throws Invalid policies or round/call limits reject construction. Concurrent/closed runs reject through
|
|
87
|
+
* Appkit; asynchronous authorization/provider failures become failed execution outcomes. Cancellation is
|
|
88
|
+
* cooperative and does not roll back previously completed Action effects.
|
|
89
|
+
* @remarks Only explicitly host-verified read tools execute automatically. A batch containing any handoff
|
|
90
|
+
* returns all its calls without executing them. No durable command engine, approval grant or transaction
|
|
91
|
+
* is created; retained tool-call/result history and descriptors are reauthorized at the exact adapter
|
|
92
|
+
* boundary after chat governance, including caller-supplied history and guard substitutions. Approved writes belong to the host's existing proposal/approval and owning command service.
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* import { createToolAgent, type ToolAgentOptions } from '@alneas/eaos-server/execution/tool-agent';
|
|
96
|
+
* export function connectAgent(options: ToolAgentOptions) { return createToolAgent(options); }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
declare function createToolAgent(options: ToolAgentOptions): {
|
|
100
|
+
/**
|
|
101
|
+
* Request cooperative cancellation of the current Appkit execution.
|
|
102
|
+
* @returns No value; Appkit marks active work cancelling without rolling back completed effects.
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { createToolAgent } from '@alneas/eaos-server/execution/tool-agent';
|
|
106
|
+
* export function cancel(agent: ReturnType<typeof createToolAgent>) { return agent.cancel(); }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
cancel: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Read Appkit's summary-only in-memory execution history.
|
|
112
|
+
* @returns Appkit execution summaries; raw model inputs/results are not stored in these summaries.
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* import { createToolAgent } from '@alneas/eaos-server/execution/tool-agent';
|
|
116
|
+
* export function snapshot(agent: ReturnType<typeof createToolAgent>) { return agent.getSnapshot(); }
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
getSnapshot: () => readonly _alneas_appkit_core_ai.ExecutionRecord[];
|
|
120
|
+
/**
|
|
121
|
+
* Subscribe to Appkit execution summary changes.
|
|
122
|
+
* @param listener - Callback notified when execution state changes; do not expose raw secrets in UI callbacks.
|
|
123
|
+
* @returns Unsubscribe function owned by the subscribing host.
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { createToolAgent } from '@alneas/eaos-server/execution/tool-agent';
|
|
127
|
+
* export function observe(agent: ReturnType<typeof createToolAgent>, listener: () => void) { return agent.subscribe(listener); }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
subscribe: (listener: () => void) => () => void;
|
|
131
|
+
/**
|
|
132
|
+
* Close the Appkit session and request cooperative cancellation.
|
|
133
|
+
* @returns No value; the session no longer admits new runs.
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* import { createToolAgent } from '@alneas/eaos-server/execution/tool-agent';
|
|
137
|
+
* export function close(agent: ReturnType<typeof createToolAgent>) { agent.close(); }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
close: () => void;
|
|
141
|
+
/**
|
|
142
|
+
* Run a single authorized model/Action conversation.
|
|
143
|
+
* @param principal - Verified current tenant/user identity, copied before host callbacks.
|
|
144
|
+
* @param input - Detached initial messages and optional cooperative cancellation signal.
|
|
145
|
+
* @returns Appkit execution outcome containing a ToolAgentResult on success; failed/cancelled outcomes omit it.
|
|
146
|
+
* @throws Appkit rejects concurrent or closed session admission; run failures otherwise become outcomes.
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* import { createToolAgent } from '@alneas/eaos-server/execution/tool-agent';
|
|
150
|
+
* export function run(agent: ReturnType<typeof createToolAgent>, ...args: Parameters<typeof agent.run>) { return agent.run(...args); }
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
run(principal: ExecutionPrincipal, input: {
|
|
154
|
+
messages: readonly AIChatMessage[];
|
|
155
|
+
signal?: AbortSignal;
|
|
156
|
+
}): Promise<_alneas_appkit_core_ai.ExecutionOutcome<ToolAgentResult>>;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Authenticated host identity supplied to {@link createPluginExecutionRouter}.
|
|
161
|
+
*/
|
|
162
|
+
interface ExecutionIdentity {
|
|
163
|
+
/** Nonblank verified tenant ID. */
|
|
164
|
+
tenantId: string;
|
|
165
|
+
/** Nonblank verified user ID. */
|
|
166
|
+
userId: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Routes authenticated, authorized JSON requests to a fixed plugin/action operation map.
|
|
170
|
+
* @param options - resolveIdentity receives Hono context and resolves verified identity/null; authorize receives that identity, pluginId, action, and parsed payload and must check current membership, activation, and resource permissions; operations maps pluginId:action to async handlers receiving identity/payload. maxBodyBytes defaults to 1048576; allowedOrigins permits exact Origin values and defaults to none.
|
|
171
|
+
* @returns A router serving POST /:pluginId/:action with no-store responses. It returns handler output as JSON or explicit 400/401/403/404/413/415 failures; callback/transport/serialization failures become 503.
|
|
172
|
+
* @throws Synchronously for a nonpositive or unsafe-integer body limit.
|
|
173
|
+
* @remarks The operation map is shallow-copied at creation. Plugin IDs must be lowercase kebab-case; actions allow letters/digits/underscore/hyphen. Origin is checked only when present and is not authentication. Body readers are released and oversized streams cancelled. No transaction, idempotency, cancellation, or retry is supplied; operation side effects may precede a 503 response.
|
|
174
|
+
* @example
|
|
175
|
+
* ```typescript
|
|
176
|
+
* import { createPluginExecutionRouter } from "@alneas/eaos-server/execution";
|
|
177
|
+
* export function executionRouter(options: Parameters<typeof createPluginExecutionRouter>[0]) {
|
|
178
|
+
* // Host adapters authenticate, authorize, validate payloads, and persist operation results.
|
|
179
|
+
* return createPluginExecutionRouter(options);
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
declare function createPluginExecutionRouter(options: {
|
|
184
|
+
/**
|
|
185
|
+
* Authenticates the Hono request and resolves nonblank verified tenant/user IDs or null; callback failure becomes a 503 response.
|
|
186
|
+
*/
|
|
187
|
+
resolveIdentity: (context: Context) => Promise<ExecutionIdentity | null>;
|
|
188
|
+
/** Must check current tenant membership, plugin activation and resource permissions. */
|
|
189
|
+
authorize: (identity: ExecutionIdentity, pluginId: string, action: string, payload: unknown) => Promise<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* Fixed pluginId:action handlers shallow-copied at creation; each receives admitted identity and parsed JSON and resolves JSON-serializable output.
|
|
192
|
+
*/
|
|
193
|
+
operations: Record<string, (identity: ExecutionIdentity, payload: unknown) => Promise<unknown>>;
|
|
194
|
+
/**
|
|
195
|
+
* Positive safe-integer request body limit in bytes, enforced while reading; defaults to 1048576.
|
|
196
|
+
*/
|
|
197
|
+
maxBodyBytes?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Optional exact Origin allowlist; any present Origin is denied unless included, while an absent Origin skips this check.
|
|
200
|
+
*/
|
|
201
|
+
allowedOrigins?: string[];
|
|
202
|
+
}): Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
203
|
+
/** Verified generic execution identity; policy checks remain host-owned.
|
|
204
|
+
* @see createChatClient
|
|
205
|
+
*/
|
|
206
|
+
type ExecutionPrincipal = ExecutionIdentity;
|
|
207
|
+
/** Current admission policy used by model and action orchestration.
|
|
208
|
+
* @see createChatClient
|
|
209
|
+
*/
|
|
210
|
+
interface ExecutionPolicy {
|
|
211
|
+
/**
|
|
212
|
+
* Check current membership, activation and operation permission.
|
|
213
|
+
* @param principal - Trusted tenant/user identity copied before calling the host.
|
|
214
|
+
* @param operation - Host operation identity; chat uses model:chat.
|
|
215
|
+
* @returns Exactly true to admit; any other value denies execution.
|
|
216
|
+
* @throws Host policy failures propagate to the caller.
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* import type { ExecutionPolicy } from '@alneas/eaos-server/execution';
|
|
220
|
+
* export function currentPolicy(policy: ExecutionPolicy) { return policy; }
|
|
221
|
+
* ```
|
|
222
|
+
* @see createChatClient
|
|
223
|
+
*/
|
|
224
|
+
authorize(principal: ExecutionPrincipal, operation: string): Promise<boolean>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** Host-injected model guards, usage budgets and telemetry.
|
|
228
|
+
* @see createChatClient
|
|
229
|
+
*/
|
|
230
|
+
interface ChatGovernanceOptions {
|
|
231
|
+
/** Optional pre-input and post-output checks; replacement messages remain host-owned. */
|
|
232
|
+
guard?: AIGuard;
|
|
233
|
+
/** Optional request admission and once-per-started-attempt accounting; accounting failures propagate. */
|
|
234
|
+
budget?: AIBudgetGate;
|
|
235
|
+
/** Awaited started/event/completed telemetry within the deadline; sink errors are ignored. */
|
|
236
|
+
observability?: AIObservabilitySink;
|
|
237
|
+
/** Telemetry operation label; authorization always checks model:chat. */
|
|
238
|
+
operation?: string;
|
|
239
|
+
/** Host-selected registry model ID; without a registry this is metadata, not provider selection. */
|
|
240
|
+
model?: string;
|
|
241
|
+
/** Optional host session identity recorded in governance context. */
|
|
242
|
+
sessionId?: string;
|
|
243
|
+
}
|
|
244
|
+
/** Host-configured adapter, current admission and bounded chat policy.
|
|
245
|
+
* @see createChatClient
|
|
246
|
+
*/
|
|
247
|
+
interface ChatClientOptions extends ExecutionPolicy {
|
|
248
|
+
/** Existing Appkit transport configured with the host endpoint, model and credentials. */
|
|
249
|
+
adapter: AIChatAdapter;
|
|
250
|
+
/** Host-owned provider parameters cloned at creation; model/messages/tools/stream keys are reserved and rejected. */
|
|
251
|
+
parameters?: ActionToolObject;
|
|
252
|
+
/**
|
|
253
|
+
* Resolve descriptors only when the caller explicitly requests tools: catalog.
|
|
254
|
+
* @param principal - Copied verified actor whose current disclosure permission the host must check.
|
|
255
|
+
* @returns At most 100 unique descriptors; omission advertises no tools.
|
|
256
|
+
* @throws Host resolution failures reject completion before the provider starts.
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* import type { ChatClientOptions } from '@alneas/eaos-server/execution/chat';
|
|
260
|
+
* export function disclosedTools(resolve: NonNullable<ChatClientOptions['tools']>) { return resolve; }
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
tools?(principal: ExecutionPrincipal): Promise<readonly ActionToolDescriptor[]>;
|
|
264
|
+
/** Positive integer deadline in milliseconds; default 30000, maximum 3600000. */
|
|
265
|
+
timeoutMs?: number;
|
|
266
|
+
/** Serialized request character ceiling; default 200000, maximum 7000000. */
|
|
267
|
+
maxInputChars?: number;
|
|
268
|
+
/** Serialized event and final assistant-message character ceiling; default 100000, maximum 10000000. */
|
|
269
|
+
maxOutputChars?: number;
|
|
270
|
+
/** Maximum stream event count; default 10000, maximum 100000. */
|
|
271
|
+
maxEvents?: number;
|
|
272
|
+
/** Host-approved route registry; requests cannot select a model or bypass sensitivity limits. */
|
|
273
|
+
modelRegistry?: AIModelRegistry;
|
|
274
|
+
/** Required with modelRegistry: host-approved logical model to configured adapter bindings, snapshotted at creation. */
|
|
275
|
+
modelAdapters?: Readonly<Record<string, AIChatAdapter>>;
|
|
276
|
+
/** Optional host guards, budgets and telemetry; final current authorization follows their completion. */
|
|
277
|
+
governance?: ChatGovernanceOptions;
|
|
278
|
+
}
|
|
279
|
+
/** Completed assistant message and optional host-governance metadata.
|
|
280
|
+
* @see createChatClient
|
|
281
|
+
*/
|
|
282
|
+
interface ChatCompletion {
|
|
283
|
+
/** Detached assistant response; tool-call parts are unexecuted requests. */
|
|
284
|
+
message: AIChatMessage;
|
|
285
|
+
/** Successful provider finish reason; truncated or inconsistent streams reject. */
|
|
286
|
+
finishReason: 'stop' | 'tool-calls';
|
|
287
|
+
/** Unique request trace identity generated before governance callbacks. */
|
|
288
|
+
traceId?: string;
|
|
289
|
+
/** Recognized nonnegative adapter metadata; undefined means unknown, including Appkit OpenAI SSE without usage events. */
|
|
290
|
+
usage?: AIUsage;
|
|
291
|
+
/** Sensitivity label supplied by the input guard. */
|
|
292
|
+
sensitivityLevel?: AIExecutionContext['sensitivityLevel'];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Complete scoped chat through the existing Appkit adapter with live admission and host governance.
|
|
296
|
+
* @param options - Trusted adapter, current authorization, optional routes/governance and bounded limits.
|
|
297
|
+
* @returns A client whose complete method returns detached, finally authorized assistant data.
|
|
298
|
+
* @throws Rejects invalid limits or missing adapter/policy during construction. Completion rejects
|
|
299
|
+
* invalid histories/catalogs, denied or revoked admission, guard/budget/route denial, provider failures,
|
|
300
|
+
* incomplete streams, exceeded limits, cancellation, deadline expiry and host accounting failure. Telemetry errors are ignored.
|
|
301
|
+
* @remarks Every completion authorizes model:chat before disclosure, between events and after awaited
|
|
302
|
+
* output guard, usage recording and completion telemetry. This client never executes model tool calls.
|
|
303
|
+
* The host must configure real endpoint credentials in the Appkit adapter. Abort is cooperative for a
|
|
304
|
+
* custom transport; the request promise remains bounded even if its iterator ignores cancellation.
|
|
305
|
+
* With modelRegistry, provide modelAdapters mapping each approved logical model to its host-configured
|
|
306
|
+
* Appkit adapter; generic adapter IDs alone do not select or prove the provider model. Binding entries
|
|
307
|
+
* and stream methods are snapshotted at creation. Reserved transport parameters are rejected in 0.2.
|
|
308
|
+
* Accounting runs once after each started adapter attempt, including output blocks, revocation and provider
|
|
309
|
+
* failure. Unknown usage is passed as undefined, never zero. Appkit's OpenAI SSE adapter currently emits
|
|
310
|
+
* no usage metadata event even for provider include_usage chunks; hosts must reconcile measured usage
|
|
311
|
+
* through their existing accounting port using trace/session context. Accounting callback errors reject
|
|
312
|
+
* completion in 0.2; a stalled callback remains bounded by the request deadline.
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* import { createChatClient, type ChatClientOptions } from '@alneas/eaos-server/execution/chat';
|
|
316
|
+
* export function connectChat(options: ChatClientOptions) { return createChatClient(options); }
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
declare function createChatClient(options: ChatClientOptions): {
|
|
320
|
+
/**
|
|
321
|
+
* Request one bounded completion for the current actor.
|
|
322
|
+
* @param principal - Verified nonblank tenant/user identity; copied before invoking host callbacks.
|
|
323
|
+
* @param input - One to 1000 messages, optional cancellation, and explicit none/catalog tool disclosure.
|
|
324
|
+
* @returns Assistant data only after final live authorization; tools remain unexecuted requests.
|
|
325
|
+
* @throws Rejects invalid requests, governance/provider failure, revocation, limits or cancellation.
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* import { createChatClient } from '@alneas/eaos-server/execution/chat';
|
|
329
|
+
* export function complete(client: ReturnType<typeof createChatClient>, ...args: Parameters<typeof client.complete>) {
|
|
330
|
+
* return client.complete(...args);
|
|
331
|
+
* }
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
complete(principal: ExecutionPrincipal, input: {
|
|
335
|
+
messages: readonly AIChatMessage[];
|
|
336
|
+
signal?: AbortSignal;
|
|
337
|
+
tools?: "none" | "catalog";
|
|
338
|
+
}): Promise<ChatCompletion>;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export { createChatClient, createPluginExecutionRouter, createToolAgent };
|
|
342
|
+
export type { AgentTool, ChatClientOptions, ChatCompletion, ChatGovernanceOptions, ExecutionIdentity, ExecutionPolicy, ExecutionPrincipal, ToolAgentOptions, ToolAgentResult };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createToolAgent
|
|
3
|
+
} from "../chunk-4BARRLJR.js";
|
|
4
|
+
import {
|
|
5
|
+
createChatClient
|
|
6
|
+
} from "../chunk-YMHVRBUU.js";
|
|
7
|
+
|
|
8
|
+
// src/execution/index.ts
|
|
9
|
+
import { Hono } from "hono";
|
|
10
|
+
function createPluginExecutionRouter(options) {
|
|
11
|
+
const router = new Hono(), operations = { ...options.operations }, maxBytes = options.maxBodyBytes ?? 1048576;
|
|
12
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1) throw new Error("Invalid request limit");
|
|
13
|
+
router.post("/:pluginId/:action", async (c) => {
|
|
14
|
+
c.header("Cache-Control", "no-store");
|
|
15
|
+
try {
|
|
16
|
+
if (c.req.header("Content-Type")?.split(";")[0].trim().toLowerCase() !== "application/json") return c.json({ error: "JSON required" }, 415);
|
|
17
|
+
const origin = c.req.header("Origin");
|
|
18
|
+
if (origin && !options.allowedOrigins?.includes(origin)) return c.json({ error: "Origin denied" }, 403);
|
|
19
|
+
const identity = await options.resolveIdentity(c);
|
|
20
|
+
if (!identity?.tenantId?.trim() || !identity.userId?.trim()) return c.json({ error: "Authentication required" }, 401);
|
|
21
|
+
const { pluginId, action } = c.req.param();
|
|
22
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(pluginId) || !/^[a-zA-Z0-9_-]+$/.test(action) || !Object.hasOwn(operations, `${pluginId}:${action}`)) return c.json({ error: "Unknown operation" }, 404);
|
|
23
|
+
const reader = c.req.raw.body?.getReader();
|
|
24
|
+
const chunks = [];
|
|
25
|
+
let size = 0;
|
|
26
|
+
if (reader) try {
|
|
27
|
+
while (true) {
|
|
28
|
+
const { done, value } = await reader.read();
|
|
29
|
+
if (done) break;
|
|
30
|
+
size += value.length;
|
|
31
|
+
if (size > maxBytes) {
|
|
32
|
+
await reader.cancel();
|
|
33
|
+
return c.json({ error: "Request too large" }, 413);
|
|
34
|
+
}
|
|
35
|
+
;
|
|
36
|
+
chunks.push(value);
|
|
37
|
+
}
|
|
38
|
+
} finally {
|
|
39
|
+
reader.releaseLock();
|
|
40
|
+
}
|
|
41
|
+
const bytes = new Uint8Array(size);
|
|
42
|
+
let offset = 0;
|
|
43
|
+
for (const chunk of chunks) {
|
|
44
|
+
bytes.set(chunk, offset);
|
|
45
|
+
offset += chunk.length;
|
|
46
|
+
}
|
|
47
|
+
let payload;
|
|
48
|
+
try {
|
|
49
|
+
payload = JSON.parse(new TextDecoder().decode(bytes));
|
|
50
|
+
} catch {
|
|
51
|
+
return c.json({ error: "Invalid JSON" }, 400);
|
|
52
|
+
}
|
|
53
|
+
if (!await options.authorize(identity, pluginId, action, payload)) return c.json({ error: "Execution denied" }, 403);
|
|
54
|
+
return c.json(await operations[`${pluginId}:${action}`](identity, payload));
|
|
55
|
+
} catch {
|
|
56
|
+
return c.json({ error: "Execution unavailable" }, 503);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return router;
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
createChatClient,
|
|
63
|
+
createPluginExecutionRouter,
|
|
64
|
+
createToolAgent
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/execution/index.ts"],"sourcesContent":["import { Hono, type Context } from 'hono'\n/**\n * Authenticated host identity supplied to {@link createPluginExecutionRouter}.\n */\nexport interface ExecutionIdentity {\n /** Nonblank verified tenant ID. */\n tenantId: string\n /** Nonblank verified user ID. */\n userId: string\n}\n/**\n * Routes authenticated, authorized JSON requests to a fixed plugin/action operation map.\n * @param options - resolveIdentity receives Hono context and resolves verified identity/null; authorize receives that identity, pluginId, action, and parsed payload and must check current membership, activation, and resource permissions; operations maps pluginId:action to async handlers receiving identity/payload. maxBodyBytes defaults to 1048576; allowedOrigins permits exact Origin values and defaults to none.\n * @returns A router serving POST /:pluginId/:action with no-store responses. It returns handler output as JSON or explicit 400/401/403/404/413/415 failures; callback/transport/serialization failures become 503.\n * @throws Synchronously for a nonpositive or unsafe-integer body limit.\n * @remarks The operation map is shallow-copied at creation. Plugin IDs must be lowercase kebab-case; actions allow letters/digits/underscore/hyphen. Origin is checked only when present and is not authentication. Body readers are released and oversized streams cancelled. No transaction, idempotency, cancellation, or retry is supplied; operation side effects may precede a 503 response.\n * @example\n * ```typescript\n * import { createPluginExecutionRouter } from \"@alneas/eaos-server/execution\";\n * export function executionRouter(options: Parameters<typeof createPluginExecutionRouter>[0]) {\n * // Host adapters authenticate, authorize, validate payloads, and persist operation results.\n * return createPluginExecutionRouter(options);\n * }\n * ```\n */\nexport function createPluginExecutionRouter(options: {\n /**\n * Authenticates the Hono request and resolves nonblank verified tenant/user IDs or null; callback failure becomes a 503 response.\n */\n resolveIdentity: (context: Context) => Promise<ExecutionIdentity | null>\n /** Must check current tenant membership, plugin activation and resource permissions. */\n authorize: (identity: ExecutionIdentity, pluginId: string, action: string, payload: unknown) => Promise<boolean>\n /**\n * Fixed pluginId:action handlers shallow-copied at creation; each receives admitted identity and parsed JSON and resolves JSON-serializable output.\n */\n operations: Record<string, (identity: ExecutionIdentity, payload: unknown) => Promise<unknown>>\n /**\n * Positive safe-integer request body limit in bytes, enforced while reading; defaults to 1048576.\n */\n maxBodyBytes?: number\n /**\n * Optional exact Origin allowlist; any present Origin is denied unless included, while an absent Origin skips this check.\n */\n allowedOrigins?: string[]\n}) {\n const router = new Hono(), operations = { ...options.operations }, maxBytes = options.maxBodyBytes ?? 1_048_576\n if (!Number.isSafeInteger(maxBytes) || maxBytes < 1) throw new Error('Invalid request limit')\n router.post('/:pluginId/:action', async c => {\n c.header('Cache-Control', 'no-store')\n try {\n if (c.req.header('Content-Type')?.split(';')[0].trim().toLowerCase() !== 'application/json') return c.json({ error: 'JSON required' }, 415)\n const origin = c.req.header('Origin')\n if (origin && !options.allowedOrigins?.includes(origin)) return c.json({ error: 'Origin denied' }, 403)\n const identity = await options.resolveIdentity(c)\n if (!identity?.tenantId?.trim() || !identity.userId?.trim()) return c.json({ error: 'Authentication required' }, 401)\n const { pluginId, action } = c.req.param()\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(pluginId) || !/^[a-zA-Z0-9_-]+$/.test(action) || !Object.hasOwn(operations, `${pluginId}:${action}`)) return c.json({ error: 'Unknown operation' }, 404)\n const reader = c.req.raw.body?.getReader(); const chunks: Uint8Array[] = []; let size = 0\n if (reader) try {\n while (true) { const { done, value } = await reader.read(); if (done) break; size += value.length; if (size > maxBytes) { await reader.cancel(); return c.json({ error: 'Request too large' }, 413) }; chunks.push(value) }\n } finally { reader.releaseLock() }\n const bytes = new Uint8Array(size); let offset = 0\n for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.length }\n let payload: unknown\n try { payload = JSON.parse(new TextDecoder().decode(bytes)) } catch { return c.json({ error: 'Invalid JSON' }, 400) }\n if (!await options.authorize(identity, pluginId, action, payload)) return c.json({ error: 'Execution denied' }, 403)\n return c.json(await operations[`${pluginId}:${action}`](identity, payload))\n } catch { return c.json({ error: 'Execution unavailable' }, 503) }\n })\n return router\n}\n\n/** Verified generic execution identity; policy checks remain host-owned.\n * @see createChatClient\n */\nexport type ExecutionPrincipal = ExecutionIdentity\n/** Current admission policy used by model and action orchestration.\n * @see createChatClient\n */\nexport interface ExecutionPolicy {\n /**\n * Check current membership, activation and operation permission.\n * @param principal - Trusted tenant/user identity copied before calling the host.\n * @param operation - Host operation identity; chat uses model:chat.\n * @returns Exactly true to admit; any other value denies execution.\n * @throws Host policy failures propagate to the caller.\n * @example\n * ```typescript\n * import type { ExecutionPolicy } from '@alneas/eaos-server/execution';\n * export function currentPolicy(policy: ExecutionPolicy) { return policy; }\n * ```\n * @see createChatClient\n */\n authorize(principal: ExecutionPrincipal, operation: string): Promise<boolean>\n}\nexport {createChatClient, type ChatGovernanceOptions, type ChatClientOptions, type ChatCompletion} from './chat'\nexport {createToolAgent, type AgentTool, type ToolAgentOptions, type ToolAgentResult} from './tool-agent'\n"],"mappings":";;;;;;;;AAAA,SAAS,YAA0B;AAyB5B,SAAS,4BAA4B,SAmBzC;AACD,QAAM,SAAS,IAAI,KAAK,GAAG,aAAa,EAAE,GAAG,QAAQ,WAAW,GAAG,WAAW,QAAQ,gBAAgB;AACtG,MAAI,CAAC,OAAO,cAAc,QAAQ,KAAK,WAAW,EAAG,OAAM,IAAI,MAAM,uBAAuB;AAC5F,SAAO,KAAK,sBAAsB,OAAM,MAAK;AAC3C,MAAE,OAAO,iBAAiB,UAAU;AACpC,QAAI;AACF,UAAI,EAAE,IAAI,OAAO,cAAc,GAAG,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,MAAM,mBAAoB,QAAO,EAAE,KAAK,EAAE,OAAO,gBAAgB,GAAG,GAAG;AAC1I,YAAM,SAAS,EAAE,IAAI,OAAO,QAAQ;AACpC,UAAI,UAAU,CAAC,QAAQ,gBAAgB,SAAS,MAAM,EAAG,QAAO,EAAE,KAAK,EAAE,OAAO,gBAAgB,GAAG,GAAG;AACtG,YAAM,WAAW,MAAM,QAAQ,gBAAgB,CAAC;AAChD,UAAI,CAAC,UAAU,UAAU,KAAK,KAAK,CAAC,SAAS,QAAQ,KAAK,EAAG,QAAO,EAAE,KAAK,EAAE,OAAO,0BAA0B,GAAG,GAAG;AACpH,YAAM,EAAE,UAAU,OAAO,IAAI,EAAE,IAAI,MAAM;AACzC,UAAI,CAAC,6BAA6B,KAAK,QAAQ,KAAK,CAAC,mBAAmB,KAAK,MAAM,KAAK,CAAC,OAAO,OAAO,YAAY,GAAG,QAAQ,IAAI,MAAM,EAAE,EAAG,QAAO,EAAE,KAAK,EAAE,OAAO,oBAAoB,GAAG,GAAG;AAC9L,YAAM,SAAS,EAAE,IAAI,IAAI,MAAM,UAAU;AAAG,YAAM,SAAuB,CAAC;AAAG,UAAI,OAAO;AACxF,UAAI,OAAQ,KAAI;AACd,eAAO,MAAM;AAAE,gBAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAAG,cAAI,KAAM;AAAO,kBAAQ,MAAM;AAAQ,cAAI,OAAO,UAAU;AAAE,kBAAM,OAAO,OAAO;AAAG,mBAAO,EAAE,KAAK,EAAE,OAAO,oBAAoB,GAAG,GAAG;AAAA,UAAE;AAAC;AAAE,iBAAO,KAAK,KAAK;AAAA,QAAE;AAAA,MAC5N,UAAE;AAAU,eAAO,YAAY;AAAA,MAAE;AACjC,YAAM,QAAQ,IAAI,WAAW,IAAI;AAAG,UAAI,SAAS;AACjD,iBAAW,SAAS,QAAQ;AAAE,cAAM,IAAI,OAAO,MAAM;AAAG,kBAAU,MAAM;AAAA,MAAO;AAC/E,UAAI;AACJ,UAAI;AAAE,kBAAU,KAAK,MAAM,IAAI,YAAY,EAAE,OAAO,KAAK,CAAC;AAAA,MAAE,QAAQ;AAAE,eAAO,EAAE,KAAK,EAAE,OAAO,eAAe,GAAG,GAAG;AAAA,MAAE;AACpH,UAAI,CAAC,MAAM,QAAQ,UAAU,UAAU,UAAU,QAAQ,OAAO,EAAG,QAAO,EAAE,KAAK,EAAE,OAAO,mBAAmB,GAAG,GAAG;AACnH,aAAO,EAAE,KAAK,MAAM,WAAW,GAAG,QAAQ,IAAI,MAAM,EAAE,EAAE,UAAU,OAAO,CAAC;AAAA,IAC5E,QAAQ;AAAE,aAAO,EAAE,KAAK,EAAE,OAAO,wBAAwB,GAAG,GAAG;AAAA,IAAE;AAAA,EACnE,CAAC;AACD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import '@alneas/appkit-core/ai';
|
|
2
|
+
import '@alneas/appkit-core/ai/action';
|
|
3
|
+
import '@alneas/appkit-core/ai/ai-chat';
|
|
4
|
+
export { AgentTool, ToolAgentOptions, ToolAgentResult, createToolAgent } from './index.js';
|
|
5
|
+
import '@alneas/eaos-core';
|
|
6
|
+
import 'hono/types';
|
|
7
|
+
import 'hono';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Hono, Context, MiddlewareHandler } from 'hono';
|
|
2
|
+
import { PluginManifest } from '@alneas/eaos-core';
|
|
3
|
+
import { PlatformContribution } from '@alneas/eaos-server/platform';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Plugin-manifest route factory supplied by trusted deployment composition.
|
|
7
|
+
* @see PlatformExtension.
|
|
8
|
+
*/
|
|
9
|
+
type HostRouteFactory = NonNullable<PluginManifest['createRoutes']>;
|
|
10
|
+
/**
|
|
11
|
+
* Adds host route composition to a trusted platform contribution with explicit tenant scope.
|
|
12
|
+
* @remarks Never populate this object from request input.
|
|
13
|
+
* @see validateExtensions for a complete composition example.
|
|
14
|
+
*/
|
|
15
|
+
interface PlatformExtension extends PlatformContribution {
|
|
16
|
+
/** Plugin-ID factories for every contributed manifest; may not override plugins absent from this contribution. */
|
|
17
|
+
routeFactories?: Record<string, HostRouteFactory>;
|
|
18
|
+
/** Optional host API routes with an absolute, wildcard-free prefix, nonblank moduleId, and Hono router. */
|
|
19
|
+
routes?: Array<{
|
|
20
|
+
/** Absolute wildcard-free mount prefix; overlapping tenant contributions may not claim the same prefix. */
|
|
21
|
+
prefix: string;
|
|
22
|
+
/** Nonblank module identity passed to the host requireModule factory after the extension tenant-scope check. */
|
|
23
|
+
moduleId: string;
|
|
24
|
+
/** Trusted Hono child router wrapped with tenant-scope and live host module middleware during extension composition. */
|
|
25
|
+
router: Hono;
|
|
26
|
+
}>;
|
|
27
|
+
/** Optional request context resolver; contributions using it may not overlap tenant scope. Its result/authorization semantics belong to the host. */
|
|
28
|
+
userContext?: (context: Context) => Promise<unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Checks trusted extension shapes, IDs, route factories, and conflicting tenant/user-context contributions.
|
|
32
|
+
* @param values - Deployment module values to validate; request input must not supply implementations.
|
|
33
|
+
* @returns A new array containing the original validated objects; no deep clone or sandboxing occurs.
|
|
34
|
+
* @throws For invalid version/ID/explicit tenant scopes, duplicate extension/plugin IDs, overlapping userContext tenant scopes, invalid routes, or missing/unauthorized route factories.
|
|
35
|
+
* @remarks Independent plugins can share tenants. This validates composition constraints, not manifest internals or implementation safety.
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { validateExtensions } from "@alneas/eaos-server/extensions";
|
|
39
|
+
* const extensions = validateExtensions([{ apiVersion: 1, id: "example", tenantIds: ["example"] }]);
|
|
40
|
+
* console.log(extensions.length); // 1
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
declare function validateExtensions(values: unknown[]): PlatformExtension[];
|
|
44
|
+
/**
|
|
45
|
+
* Wraps each contributed plugin route factory with an explicit tenant-scope middleware.
|
|
46
|
+
* @param item - Trusted validated extension; tenantIds is consulted at request time.
|
|
47
|
+
* @returns A shallow copy with fresh route factory wrappers; each wrapper invokes the original factory with unchanged arguments.
|
|
48
|
+
* @throws Calling a wrapped factory propagates the original route-factory errors.
|
|
49
|
+
* @remarks Set trusted tenantId context before handling requests. Out-of-scope or missing tenantId returns 403. This wrapper performs no membership or module authorization.
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { scopeExtensionFactories, validateExtensions } from "@alneas/eaos-server/extensions";
|
|
53
|
+
* const [extension] = validateExtensions([{ apiVersion: 1, id: "example", tenantIds: ["example"] }]);
|
|
54
|
+
* const scoped = scopeExtensionFactories(extension);
|
|
55
|
+
* console.log(scoped.id);
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare function scopeExtensionFactories(item: PlatformExtension): PlatformExtension;
|
|
59
|
+
/**
|
|
60
|
+
* Wraps contributed host routers with tenant-scope checks followed by host module authorization.
|
|
61
|
+
* @param extension - Trusted validated contribution; omitted routes produce an empty array.
|
|
62
|
+
* @param requireModule - Called once per route with moduleId during composition; returns middleware enforcing current module permissions.
|
|
63
|
+
* @returns New prefix/router pairs preserving original route order and mounting original routers beneath their guards.
|
|
64
|
+
* @throws Propagates module middleware factory or route composition errors; request execution propagates downstream failures.
|
|
65
|
+
* @remarks Requires a verified tenantId in Hono context. No authentication is installed here.
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* import { scopeExtensionRoutes, validateExtensions } from "@alneas/eaos-server/extensions";
|
|
69
|
+
* import { createModuleGuard } from "@alneas/eaos-server/middleware/module-guard";
|
|
70
|
+
* const [extension] = validateExtensions([{ apiVersion: 1, id: "example", tenantIds: ["example"] }]);
|
|
71
|
+
* console.log(scopeExtensionRoutes(extension, id => createModuleGuard(id, { isDev: false }))); // []
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function scopeExtensionRoutes(extension: PlatformExtension, requireModule: (moduleId: string) => MiddlewareHandler): Array<{
|
|
75
|
+
/**
|
|
76
|
+
* Original host route prefix preserved for subsequent mounting.
|
|
77
|
+
*/
|
|
78
|
+
prefix: string;
|
|
79
|
+
/**
|
|
80
|
+
* Fresh Hono wrapper enforcing tenant scope and host module authorization before forwarding to the original router.
|
|
81
|
+
*/
|
|
82
|
+
router: Hono;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Mounts tenant-dispatched extension routes, allowing a shared prefix across disjoint tenant scopes.
|
|
86
|
+
* @param app - Host Hono app mutated with exact-prefix and descendant dispatch routes.
|
|
87
|
+
* @param extensions - Trusted validated extensions with explicit tenant IDs.
|
|
88
|
+
* @param requireModule - Host factory producing current module authorization middleware for each route moduleId.
|
|
89
|
+
* @returns No value; completes after mounting all route groups.
|
|
90
|
+
* @throws For an overlapping tenant at the same prefix, or propagated route/middleware composition errors.
|
|
91
|
+
* @remarks Install verified identity/tenant middleware before these routes. Dispatch copies parent context variables into the selected child and forwards server environment; missing tenant scope returns 403. There is no automatic route unmount or per-request persistence.
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* import { Hono } from "hono";
|
|
95
|
+
* import { mountExtensionRoutes, type PlatformExtension } from "@alneas/eaos-server/extensions";
|
|
96
|
+
* import { createModuleGuard } from "@alneas/eaos-server/middleware/module-guard";
|
|
97
|
+
* export function mount(app: Hono, extensions: PlatformExtension[]) {
|
|
98
|
+
* mountExtensionRoutes(app, extensions, id => createModuleGuard(id, { isDev: false }));
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
declare function mountExtensionRoutes(app: Hono, extensions: PlatformExtension[], requireModule: (id: string) => MiddlewareHandler): void;
|
|
103
|
+
/** Request-scoped host authorization supplied after verified membership middleware.
|
|
104
|
+
* @see getPlatformPluginAuthorization for binding lookup and a usage example.
|
|
105
|
+
*/
|
|
106
|
+
interface PlatformPluginAuthorization {
|
|
107
|
+
/**
|
|
108
|
+
* Resolves the current verified principal after host authentication/membership checks.
|
|
109
|
+
* @returns Tenant/user identity, verified roles, and current enabled plugin IDs, or null to deny.
|
|
110
|
+
* @throws Host authentication or persistence failures propagate to callers.
|
|
111
|
+
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* import type { PlatformPluginAuthorization } from "@alneas/eaos-server/extensions";
|
|
115
|
+
* export async function readHostPrincipal(authorization: PlatformPluginAuthorization) {
|
|
116
|
+
* const principal = await authorization.resolvePrincipal();
|
|
117
|
+
* return principal; // Null denies access; never replace it with request-supplied claims.
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
resolvePrincipal(): Promise<{
|
|
122
|
+
/** Tenant identity established by trusted host authentication/membership resolution; request-supplied headers/body must not define this claim. */
|
|
123
|
+
tenantId: string;
|
|
124
|
+
/** Authenticated user identity within the resolved tenant scope. */
|
|
125
|
+
userId: string;
|
|
126
|
+
/** Verified host role claims used for downstream authorization; tenant roles must not fabricate platform authority. */
|
|
127
|
+
roles: string[];
|
|
128
|
+
/** Current plugin activation identities visible to this verified principal; the host supplies live lifecycle data. */
|
|
129
|
+
enabledPluginIds: string[];
|
|
130
|
+
} | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Checks live plugin activation for a verified tenant.
|
|
133
|
+
* @param tenantId - Verified tenant ID.
|
|
134
|
+
* @param pluginId - Exact installed plugin ID.
|
|
135
|
+
* @returns True only when the plugin is currently enabled for this tenant.
|
|
136
|
+
* @throws Host lifecycle/persistence failures propagate to callers.
|
|
137
|
+
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* import type { PlatformPluginAuthorization } from "@alneas/eaos-server/extensions";
|
|
141
|
+
* export async function checkCurrentPlugin(
|
|
142
|
+
* authorization: PlatformPluginAuthorization, verifiedTenantId: string, installedPluginId: string,
|
|
143
|
+
* ) {
|
|
144
|
+
* return await authorization.isPluginEnabled(verifiedTenantId, installedPluginId);
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
isPluginEnabled(tenantId: string, pluginId: string): Promise<boolean>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Hono variable/environment key for the host-only {@link PlatformPluginAuthorization} binding.
|
|
152
|
+
* @see getPlatformPluginAuthorization for access behavior.
|
|
153
|
+
*/
|
|
154
|
+
declare const PLATFORM_PLUGIN_AUTHORIZATION = "eaosPlatformPluginAuthorization";
|
|
155
|
+
/**
|
|
156
|
+
* Reads a structurally valid host authorization port from Hono context or server environment.
|
|
157
|
+
* @param context - Hono-like context; get(bindingKey) takes precedence over env[bindingKey] when nonnull. Missing contexts return undefined.
|
|
158
|
+
* @returns The original port when both required members are functions, or undefined otherwise.
|
|
159
|
+
* @throws Propagates errors thrown by the context get accessor.
|
|
160
|
+
* @remarks Hono environment forwarding is internal-only; HTTP headers never supply this binding. Structural validation does not establish trust: only host middleware may install it.
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* import { Hono } from "hono";
|
|
164
|
+
* import { getPlatformPluginAuthorization } from "@alneas/eaos-server/extensions";
|
|
165
|
+
* const app = new Hono();
|
|
166
|
+
* app.get("/authorization-state", c => c.json({ configured: !!getPlatformPluginAuthorization(c) }));
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
declare function getPlatformPluginAuthorization(context: unknown): PlatformPluginAuthorization | undefined;
|
|
170
|
+
|
|
171
|
+
export { PLATFORM_PLUGIN_AUTHORIZATION, getPlatformPluginAuthorization, mountExtensionRoutes, scopeExtensionFactories, scopeExtensionRoutes, validateExtensions };
|
|
172
|
+
export type { HostRouteFactory, PlatformExtension, PlatformPluginAuthorization };
|