@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,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Data Contract baselines"
|
|
3
|
+
description: "Keep portable declarations separate from trusted host execution, current access checks and durable effects."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 20
|
|
6
|
+
archetype: "explanation"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["eaos", "explanation"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Data Contract baselines
|
|
12
|
+
|
|
13
|
+
## Motivation
|
|
14
|
+
|
|
15
|
+
Keep portable declarations separate from trusted host execution, current access checks and durable effects.
|
|
16
|
+
|
|
17
|
+
## Architectural Diagram
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart LR
|
|
21
|
+
Contract[Public contract] --> Host[Verified host scope]
|
|
22
|
+
Host --> Operation[Explicit runtime operation]
|
|
23
|
+
Operation --> Validation[Result and permission verification]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Public import
|
|
27
|
+
|
|
28
|
+
Install the package; the subpath below is an import target, not a separate package. Registry installation requires a published EAOS release; before publication use the owning workspace's checksum-verified build artifact.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun add @alneas/eaos-server
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { createDataContractBaseline } from '@alneas/eaos-server/lifecycle-engine/baseline'
|
|
36
|
+
|
|
37
|
+
export const describeBaseline = createDataContractBaseline
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Server tooling only. Descriptor creation does not verify SQL equivalence or rebase an installed ledger; those are separate reviewed operations.
|
|
41
|
+
|
|
42
|
+
## Trade-offs & Decisions
|
|
43
|
+
|
|
44
|
+
`createDataContractBaseline(source, version, finalSql)` creates an immutable descriptor with source and target contracts, source migration IDs/positions/checksums and an integrity hash. The new contract version must increase, every original SQL dialect must remain represented and all replaced migrations must be database-scoped. The supplied SQL must describe the final schema, rather than a concatenated history. Provider tooling owns SQL equivalence review.
|
|
45
|
+
|
|
46
|
+
`rebaseDataContractBaseline(store, databaseId, descriptor, { expectedRevision, quiesce })` runs under the existing exclusive Lifecycle writer lock. It checks the complete installed source contract and every applied checksum, scope and position. Partial, dirty, modified or stale history is rejected. Installed consumers must accept the target contract version. Active consumers require an all-instance drain callback and are disabled before the ledger changes.
|
|
47
|
+
|
|
48
|
+
No DDL runs during rebase. Old records and the exact source contract remain in `LifecycleState.baselineHistory`. The current migration ledger advances to the baseline; the installed Data Contract advances to the target. New hosts execute the target's final DDL normally. Existing hosts rebased against matching history skip it. A second unrelated apply still uses ordinary plan/review/revision rules. Preserve the baseline descriptor and archived source with the release.
|
|
49
|
+
|
|
50
|
+
The CLI's `db:baseline` automatically compiles SQLite, PostgreSQL and Oracle schema histories in fresh local databases and verifies an independent rebuild. It retains the archived contract, complete replaced-history checksums and compiler evidence. PostgreSQL/Oracle require checksum-pinned local Docker images; no production DSN is accepted. Generation is separate from ledger rebase. Unsupported object classes are rejected rather than silently omitted. See the CLI baseline guide for compiler boundaries.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Lifecycle ownership and host boundaries"
|
|
3
|
+
description: "Installation, upgrades, activation, migration history, placement and completion evidence. This capability belongs to @alneas/eaos-server; it is not a separate npm package."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 20
|
|
6
|
+
archetype: "explanation"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["eaos", "explanation"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Lifecycle ownership and host boundaries
|
|
12
|
+
|
|
13
|
+
## Motivation
|
|
14
|
+
|
|
15
|
+
Installation, upgrades, activation, migration history, placement and completion evidence. This capability belongs to `@alneas/eaos-server`; it is not a separate npm package.
|
|
16
|
+
|
|
17
|
+
## Architectural Diagram
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart LR
|
|
21
|
+
Host[Trusted host] --> Adapter[Scoped Server adapter]
|
|
22
|
+
Adapter --> Store[Host-owned durable provider]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Public import
|
|
26
|
+
|
|
27
|
+
Install the package; the subpath below is an import target, not a separate package. Registry installation requires a published EAOS release; before publication use the owning workspace's checksum-verified build artifact.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add @alneas/eaos-server
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { resolveDataContracts } from '@alneas/eaos-server/lifecycle-engine'
|
|
35
|
+
|
|
36
|
+
export const resolveHostContracts = resolveDataContracts
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Server runtime only. Supply durable lifecycle state, exclusive writer locking and reviewed host executors before applying a plan.
|
|
40
|
+
|
|
41
|
+
## Trade-offs & Decisions
|
|
42
|
+
|
|
43
|
+
Apply only a reviewed current plan under an exclusive writer lock. Active upgrades require all-instance drain. Shared hosts use one transactional control store. Disable/uninstall retain data and history. Dirty DDL requires reconciliation rather than blind retry or automatic lock expiry.
|
|
44
|
+
|
|
45
|
+
See [baseline descriptors](baseline.md) for integrity-pinned, non-DDL ledger rebase with retained source history.
|
|
46
|
+
|
|
47
|
+
The host owns verified identity, tenant boundaries, credentials and real provider adoption. Package builds and tests never apply production changes or activate tenants. Review the [API reference](api.md) before binding the host.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Storage capability"
|
|
3
|
+
description: "Host developers use @alneas/eaos-server/storage for tenant/plugin-scoped storage."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 20
|
|
6
|
+
archetype: "explanation"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["eaos", "explanation"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Storage capability
|
|
12
|
+
|
|
13
|
+
## Elevator Pitch
|
|
14
|
+
|
|
15
|
+
Host developers use `@alneas/eaos-server/storage` for tenant/plugin-scoped storage.
|
|
16
|
+
|
|
17
|
+
## Why & Value
|
|
18
|
+
|
|
19
|
+
This topic belongs to `@alneas/eaos-server` and is not an independently installed package. Shared contracts keep capability ownership clear while host identity, provider configuration and acceptance remain explicit.
|
|
20
|
+
|
|
21
|
+
## Key Highlights
|
|
22
|
+
|
|
23
|
+
- Canonical package subpath
|
|
24
|
+
- Explicit host boundaries
|
|
25
|
+
- Typed declarations and local verification
|
|
26
|
+
|
|
27
|
+
## Quickstart
|
|
28
|
+
|
|
29
|
+
Install the owning package, using a verified tarball before registry publication.
|
|
30
|
+
|
|
31
|
+
### Public import
|
|
32
|
+
|
|
33
|
+
Install the owning package and use the exact import in the example below. The subpath is not a separate npm package. Check the selected entry's runtime and peer requirements in the linked architecture guide.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
bun add @alneas/eaos-server
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import * as capability from '@alneas/eaos-server/storage'
|
|
41
|
+
|
|
42
|
+
console.log(Object.keys(capability))
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Next Steps
|
|
46
|
+
|
|
47
|
+
- [Architecture and host boundaries](docs/guide.md)
|
|
48
|
+
- [API reference](docs/api.md)
|
|
49
|
+
- [Owning package](../index.md)
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@alneas/eaos-server API"
|
|
3
|
+
description: "@alneas/eaos-server API: source-derived declarations, parameter tables, return types and public import examples."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 30
|
|
6
|
+
archetype: "reference"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["api", "generated"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- Generated by scripts/generate-public-api.ts from built source declarations. Edit source JSDoc/types and regenerate; do not edit these cards. -->
|
|
12
|
+
|
|
13
|
+
# @alneas/eaos-server API
|
|
14
|
+
|
|
15
|
+
## Public entrypoints
|
|
16
|
+
|
|
17
|
+
| Import | Contract |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `@alneas/eaos-server/storage` | Typed public export |
|
|
20
|
+
| `@alneas/eaos-server/storage/s3-compatible` | Typed public export |
|
|
21
|
+
|
|
22
|
+
<a id="api-createS3CompatibleStorage"></a>
|
|
23
|
+
|
|
24
|
+
## [FUNCTION] `createS3CompatibleStorage`
|
|
25
|
+
|
|
26
|
+
Creates an unscoped private-upload, signed-URL storage adapter for R2 or S3.
|
|
27
|
+
|
|
28
|
+
Imports: `@alneas/eaos-server/storage`, `@alneas/eaos-server/storage/s3-compatible`.
|
|
29
|
+
|
|
30
|
+
### Signature
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
declare function createS3CompatibleStorage(config: S3CompatibleStorageConfig): Promise<StorageAdapter>;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Parameters
|
|
37
|
+
|
|
38
|
+
| Name | Type | Required | Description |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `config` | `S3CompatibleStorageConfig` | Yes | Provider configuration, credentials, and URL ceiling; see {@link S3CompatibleStorageConfig}. |
|
|
41
|
+
|
|
42
|
+
### Returns
|
|
43
|
+
|
|
44
|
+
`Promise<StorageAdapter>`
|
|
45
|
+
|
|
46
|
+
A frozen app-core adapter whose uploads reject public=true and whose URLs always use signatures within the configured ceiling.
|
|
47
|
+
|
|
48
|
+
### Remarks
|
|
49
|
+
|
|
50
|
+
Server-only: transport/signing stay in app-core and the host supplies secrets. Credentials are resolved once at construction. Signed access also works during a public-bucket migration but cannot close existing public URLs. Keep this unscoped adapter host-owned; give plugins createTenantS3CompatibleStorage. Constructing an adapter does not verify remote credentials or create a bucket.
|
|
51
|
+
|
|
52
|
+
### Errors and rejections
|
|
53
|
+
|
|
54
|
+
Rejects invalid provider, lifetime, bucket, account/region, endpoint, or empty credentials, and propagates credential callback/import/adapter construction errors. Subsequent operations propagate transport errors.
|
|
55
|
+
|
|
56
|
+
### Example
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createS3CompatibleStorage, readS3CompatibleStorageConfig } from "@alneas/eaos-server/storage/s3-compatible";
|
|
60
|
+
// The host provisions a private bucket and supplies the documented storage environment.
|
|
61
|
+
const config = readS3CompatibleStorageConfig();
|
|
62
|
+
if (!config) throw new Error("Storage is not configured");
|
|
63
|
+
const storage = await createS3CompatibleStorage(config);
|
|
64
|
+
// Retain storage in trusted server code; authorize requests before performing operations.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
<a id="api-createTenantS3CompatibleStorage"></a>
|
|
69
|
+
|
|
70
|
+
## [FUNCTION] `createTenantS3CompatibleStorage`
|
|
71
|
+
|
|
72
|
+
Creates provider-backed storage isolated to a verified tenant/plugin scope.
|
|
73
|
+
|
|
74
|
+
Imports: `@alneas/eaos-server/storage`, `@alneas/eaos-server/storage/s3-compatible`.
|
|
75
|
+
|
|
76
|
+
### Signature
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
declare function createTenantS3CompatibleStorage(config: S3CompatibleStorageConfig, options: TenantStorageOptions): Promise<StorageAdapter>;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Parameters
|
|
83
|
+
|
|
84
|
+
| Name | Type | Required | Description |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `config` | `S3CompatibleStorageConfig` | Yes | Host provider configuration and credentials. |
|
|
87
|
+
| `options` | `TenantStorageOptions` | Yes | Trusted scope and live authorization; an omitted scope URL ceiling inherits config.maxUrlLifetimeSeconds, then 300. |
|
|
88
|
+
|
|
89
|
+
### Returns
|
|
90
|
+
|
|
91
|
+
`Promise<StorageAdapter>`
|
|
92
|
+
|
|
93
|
+
A frozen scoped adapter; see {@link createTenantStorage} for relative key and operation policy.
|
|
94
|
+
|
|
95
|
+
### Remarks
|
|
96
|
+
|
|
97
|
+
The provider ceiling also applies, so a larger scope ceiling cannot increase it. The host owns bucket provisioning and verified identity resolution.
|
|
98
|
+
|
|
99
|
+
### Errors and rejections
|
|
100
|
+
|
|
101
|
+
Rejects provider construction failures and invalid scope settings; operations propagate authorization, policy, and transport errors.
|
|
102
|
+
|
|
103
|
+
### Example
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { createTenantS3CompatibleStorage, type S3CompatibleStorageConfig } from "@alneas/eaos-server/storage/s3-compatible";
|
|
107
|
+
import type { TenantStorageOptions } from "@alneas/eaos-server/storage";
|
|
108
|
+
export async function scopedStorage(config: S3CompatibleStorageConfig, trustedOptions: TenantStorageOptions) {
|
|
109
|
+
return createTenantS3CompatibleStorage(config, trustedOptions);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<a id="api-createTenantStorage"></a>
|
|
115
|
+
|
|
116
|
+
## [FUNCTION] `createTenantStorage`
|
|
117
|
+
|
|
118
|
+
Wraps a storage adapter with tenant/plugin key isolation and per-operation authorization.
|
|
119
|
+
|
|
120
|
+
Imports: `@alneas/eaos-server/storage`.
|
|
121
|
+
|
|
122
|
+
### Signature
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
declare function createTenantStorage(adapter: StorageAdapter, options: TenantStorageOptions): StorageAdapter;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Parameters
|
|
129
|
+
|
|
130
|
+
| Name | Type | Required | Description |
|
|
131
|
+
| --- | --- | --- | --- |
|
|
132
|
+
| `adapter` | `StorageAdapter` | Yes | Host-owned transport/signing adapter; optional copy and move are exposed only when supported. |
|
|
133
|
+
| `options` | `TenantStorageOptions` | Yes | Trusted scope, authorization callback, and signed URL ceiling; see {@link TenantStorageOptions}. |
|
|
134
|
+
|
|
135
|
+
### Returns
|
|
136
|
+
|
|
137
|
+
`StorageAdapter`
|
|
138
|
+
|
|
139
|
+
A frozen adapter using relative keys while storing under tenants/{tenantId}/plugins/{pluginId}/; returned object keys and list cursors are scope-relative.
|
|
140
|
+
|
|
141
|
+
### Remarks
|
|
142
|
+
|
|
143
|
+
Keys cannot be absolute or contain traversal, empty segments, backslashes, percent escapes, control characters, query strings, or fragments. List permits an empty prefix and slash delimiter only. URLs default to a 300-second ceiling and remain usable until expiry after authorization changes. This wrapper supplies no persistence, locking, revocation, or transaction mechanism beyond the underlying adapter. The host must retain ownership of the unscoped adapter.
|
|
144
|
+
|
|
145
|
+
### Errors and rejections
|
|
146
|
+
|
|
147
|
+
Throws synchronously for invalid scope IDs or URL lifetime. Operations reject for invalid relative keys, denied access, public uploads, unsigned or overlong URLs, invalid cursors/delimiters, out-of-scope provider results, or propagated adapter/authorization errors.
|
|
148
|
+
|
|
149
|
+
### Example
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { createTenantStorage, type StorageAdapter, type TenantStorageOptions } from "@alneas/eaos-server/storage";
|
|
153
|
+
export function pluginStorage(adapter: StorageAdapter, trustedOptions: TenantStorageOptions) {
|
|
154
|
+
// Resolve scope and authorization from verified host identity, never request body IDs.
|
|
155
|
+
return createTenantStorage(adapter, trustedOptions);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
<a id="api-readS3CompatibleStorageConfig"></a>
|
|
161
|
+
|
|
162
|
+
## [FUNCTION] `readS3CompatibleStorageConfig`
|
|
163
|
+
|
|
164
|
+
Reads trimmed S3 or R2 configuration from a host environment map.
|
|
165
|
+
|
|
166
|
+
Imports: `@alneas/eaos-server/storage`, `@alneas/eaos-server/storage/s3-compatible`.
|
|
167
|
+
|
|
168
|
+
### Signature
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
declare function readS3CompatibleStorageConfig(env?: Record<string, string | undefined>): S3CompatibleStorageConfig | null;
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Parameters
|
|
175
|
+
|
|
176
|
+
| Name | Type | Required | Description |
|
|
177
|
+
| --- | --- | --- | --- |
|
|
178
|
+
| `env` | `Record<string, string \| undefined>` | No | Environment values; defaults to process.env. EAOS_STORAGE_PROVIDER selects s3/r2 case-insensitively. R2 uses R2_ACCOUNT_ID, R2_BUCKET, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, and optional R2_ENDPOINT. S3 uses S3_BUCKET, S3_REGION, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, optional S3_ENDPOINT, and S3_FORCE_PATH_STYLE (true or 1). EAOS_STORAGE_MAX_URL_SECONDS is converted with Number. |
|
|
179
|
+
|
|
180
|
+
### Returns
|
|
181
|
+
|
|
182
|
+
`S3CompatibleStorageConfig \| null`
|
|
183
|
+
|
|
184
|
+
Configuration, or null when the provider is absent/blank. This read does not fully validate values; creation validates provider settings.
|
|
185
|
+
|
|
186
|
+
### Remarks
|
|
187
|
+
|
|
188
|
+
Returned configuration contains secrets and belongs exclusively in trusted server code.
|
|
189
|
+
|
|
190
|
+
### Errors and rejections
|
|
191
|
+
|
|
192
|
+
If a selected provider lacks required nonblank values, or the provider is unsupported.
|
|
193
|
+
|
|
194
|
+
### Example
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { readS3CompatibleStorageConfig } from "@alneas/eaos-server/storage/s3-compatible";
|
|
198
|
+
const config = readS3CompatibleStorageConfig();
|
|
199
|
+
console.log(config ? "Storage configured" : "Storage disabled");
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<a id="api-S3CompatibleStorageConfig"></a>
|
|
204
|
+
|
|
205
|
+
## [TYPE] `S3CompatibleStorageConfig`
|
|
206
|
+
|
|
207
|
+
Selects R2 or S3 transport settings with host-held credentials and a signed URL ceiling.
|
|
208
|
+
|
|
209
|
+
Imports: `@alneas/eaos-server/storage`, `@alneas/eaos-server/storage/s3-compatible`.
|
|
210
|
+
|
|
211
|
+
### Signature
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
type S3CompatibleStorageConfig = Common & (({
|
|
215
|
+
provider: 'r2';
|
|
216
|
+
} & Omit<R2StorageConfig, 'accessKeyId' | 'secretAccessKey' | 'publicUrl' | 'defaultExpiresIn'>) | ({
|
|
217
|
+
provider: 's3';
|
|
218
|
+
} & Omit<S3StorageConfig, 'accessKeyId' | 'secretAccessKey' | 'defaultExpiresIn'>));
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Parameters
|
|
222
|
+
|
|
223
|
+
| Name | Type | Required | Description |
|
|
224
|
+
| --- | --- | --- | --- |
|
|
225
|
+
| — | — | — | No call parameters. |
|
|
226
|
+
|
|
227
|
+
### Returns
|
|
228
|
+
|
|
229
|
+
Type declaration; no runtime value.
|
|
230
|
+
|
|
231
|
+
### Remarks
|
|
232
|
+
|
|
233
|
+
R2 requires a 32-hex-character accountId; S3 requires region. Both require a valid bucket name. Optional endpoints must be HTTPS URLs without credentials, query, or fragment. Provider-specific fields follow app-core storage configuration; public URLs are not configured by this factory.
|
|
234
|
+
|
|
235
|
+
### See also
|
|
236
|
+
|
|
237
|
+
createS3CompatibleStorage for a complete setup example.
|
|
238
|
+
|
|
239
|
+
### Public members
|
|
240
|
+
|
|
241
|
+
#### `provider`
|
|
242
|
+
|
|
243
|
+
Select Cloudflare R2 transport; accountId must be 32 hexadecimal characters and bucket/credentials must be configured.
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
#### `provider`
|
|
247
|
+
|
|
248
|
+
Select S3-compatible transport; a nonempty region and valid bucket/credentials are required, with optional HTTPS endpoint.
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
### Example
|
|
253
|
+
|
|
254
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
255
|
+
|
|
256
|
+
<a id="api-StorageAdapter"></a>
|
|
257
|
+
|
|
258
|
+
## [INTERFACE] `StorageAdapter`
|
|
259
|
+
|
|
260
|
+
Compatibility re-export; its implementation and documentation are owned by the owning package `@alneas/appkit-core`.
|
|
261
|
+
|
|
262
|
+
Imports: `@alneas/eaos-server/storage`.
|
|
263
|
+
|
|
264
|
+
### Signature
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
export interface StorageAdapter {
|
|
268
|
+
upload(key: string, data: Uint8Array | Blob | ReadableStream | string, options?: StorageUploadOptions): Promise<StorageObject>;
|
|
269
|
+
download(key: string): Promise<Uint8Array | null>;
|
|
270
|
+
getUrl(key: string, options?: StorageURLOptions): Promise<string>;
|
|
271
|
+
getUploadUrl?(key: string, options?: Pick<StorageURLOptions, 'expiresIn'>): Promise<string>;
|
|
272
|
+
getDownloadUrl?(key: string, options?: StorageURLOptions): Promise<string>;
|
|
273
|
+
delete(key: string): Promise<boolean>;
|
|
274
|
+
exists(key: string): Promise<boolean>;
|
|
275
|
+
head(key: string): Promise<StorageObject | null>;
|
|
276
|
+
list(options?: StorageListOptions): Promise<StorageListResult>;
|
|
277
|
+
copy?(sourceKey: string, destinationKey: string): Promise<StorageObject>;
|
|
278
|
+
move?(sourceKey: string, destinationKey: string): Promise<StorageObject>;
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Parameters
|
|
283
|
+
|
|
284
|
+
| Name | Type | Required | Description |
|
|
285
|
+
| --- | --- | --- | --- |
|
|
286
|
+
| `upload` | `Promise<StorageObject>` | Yes | See the upstream owning declaration. |
|
|
287
|
+
| `download` | `Promise<Uint8Array \| null>` | Yes | See the upstream owning declaration. |
|
|
288
|
+
| `getUrl` | `Promise<string>` | Yes | See the upstream owning declaration. |
|
|
289
|
+
| `getUploadUrl` | `Promise<string>` | No | See the upstream owning declaration. |
|
|
290
|
+
| `getDownloadUrl` | `Promise<string>` | No | See the upstream owning declaration. |
|
|
291
|
+
| `delete` | `Promise<boolean>` | Yes | See the upstream owning declaration. |
|
|
292
|
+
| `exists` | `Promise<boolean>` | Yes | See the upstream owning declaration. |
|
|
293
|
+
| `head` | `Promise<StorageObject \| null>` | Yes | See the upstream owning declaration. |
|
|
294
|
+
| `list` | `Promise<StorageListResult>` | Yes | See the upstream owning declaration. |
|
|
295
|
+
| `copy` | `Promise<StorageObject>` | No | See the upstream owning declaration. |
|
|
296
|
+
| `move` | `Promise<StorageObject>` | No | See the upstream owning declaration. |
|
|
297
|
+
|
|
298
|
+
### Returns
|
|
299
|
+
|
|
300
|
+
Type declaration; no runtime value.
|
|
301
|
+
|
|
302
|
+
### Example
|
|
303
|
+
|
|
304
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
305
|
+
|
|
306
|
+
<a id="api-StorageCredentials"></a>
|
|
307
|
+
|
|
308
|
+
## [INTERFACE] `StorageCredentials`
|
|
309
|
+
|
|
310
|
+
Server-held signing credentials; never expose these through browser configuration.
|
|
311
|
+
|
|
312
|
+
Imports: `@alneas/eaos-server/storage`, `@alneas/eaos-server/storage/s3-compatible`.
|
|
313
|
+
|
|
314
|
+
### Signature
|
|
315
|
+
|
|
316
|
+
```typescript
|
|
317
|
+
interface StorageCredentials {
|
|
318
|
+
accessKeyId: string;
|
|
319
|
+
secretAccessKey: string;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Parameters
|
|
324
|
+
|
|
325
|
+
| Name | Type | Required | Description |
|
|
326
|
+
| --- | --- | --- | --- |
|
|
327
|
+
| `accessKeyId` | `string` | Yes | Nonempty access key identifier for the selected provider. |
|
|
328
|
+
| `secretAccessKey` | `string` | Yes | Nonempty secret used for request signing. |
|
|
329
|
+
|
|
330
|
+
### Returns
|
|
331
|
+
|
|
332
|
+
Type declaration; no runtime value.
|
|
333
|
+
|
|
334
|
+
### See also
|
|
335
|
+
|
|
336
|
+
createS3CompatibleStorage for host setup.
|
|
337
|
+
|
|
338
|
+
### Public members
|
|
339
|
+
|
|
340
|
+
#### `accessKeyId`
|
|
341
|
+
|
|
342
|
+
Nonempty access key identifier for the selected provider.
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
#### `secretAccessKey`
|
|
346
|
+
|
|
347
|
+
Nonempty secret used for request signing.
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
### Example
|
|
352
|
+
|
|
353
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
354
|
+
|
|
355
|
+
<a id="api-StorageOperation"></a>
|
|
356
|
+
|
|
357
|
+
## [TYPE] `StorageOperation`
|
|
358
|
+
|
|
359
|
+
Operation names passed to the host authorization callback before scoped storage access.
|
|
360
|
+
|
|
361
|
+
Imports: `@alneas/eaos-server/storage`.
|
|
362
|
+
|
|
363
|
+
### Signature
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
type StorageOperation = 'upload' | 'download' | 'delete' | 'exists' | 'head' | 'list' | 'getUrl' | 'copy' | 'move';
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Parameters
|
|
370
|
+
|
|
371
|
+
| Name | Type | Required | Description |
|
|
372
|
+
| --- | --- | --- | --- |
|
|
373
|
+
| — | — | — | No call parameters. |
|
|
374
|
+
|
|
375
|
+
### Returns
|
|
376
|
+
|
|
377
|
+
Type declaration; no runtime value.
|
|
378
|
+
|
|
379
|
+
### See also
|
|
380
|
+
|
|
381
|
+
createTenantStorage for a complete usage example.
|
|
382
|
+
|
|
383
|
+
### Example
|
|
384
|
+
|
|
385
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
386
|
+
|
|
387
|
+
<a id="api-TenantStorageOptions"></a>
|
|
388
|
+
|
|
389
|
+
## [INTERFACE] `TenantStorageOptions`
|
|
390
|
+
|
|
391
|
+
Trusted tenant/plugin scope and per-operation authorization for [createTenantStorage](#api-createTenantStorage).
|
|
392
|
+
|
|
393
|
+
Imports: `@alneas/eaos-server/storage`.
|
|
394
|
+
|
|
395
|
+
### Signature
|
|
396
|
+
|
|
397
|
+
```typescript
|
|
398
|
+
interface TenantStorageOptions {
|
|
399
|
+
tenantId: string;
|
|
400
|
+
pluginId: string;
|
|
401
|
+
authorize: (request: {
|
|
402
|
+
tenantId: string;
|
|
403
|
+
pluginId: string;
|
|
404
|
+
operation: StorageOperation;
|
|
405
|
+
keys: readonly string[];
|
|
406
|
+
}) => boolean | Promise<boolean>;
|
|
407
|
+
maxUrlLifetimeSeconds?: number;
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### Parameters
|
|
412
|
+
|
|
413
|
+
| Name | Type | Required | Description |
|
|
414
|
+
| --- | --- | --- | --- |
|
|
415
|
+
| `tenantId` | `string` | Yes | Trusted tenant ID: 1–128 ASCII letters, digits, underscores, or hyphens, starting alphanumeric. It must come from verified server identity/configuration, never request body keys. |
|
|
416
|
+
| `pluginId` | `string` | Yes | Trusted plugin ID: 1–128 ASCII letters, digits, underscores, or hyphens, starting with a letter or digit. |
|
|
417
|
+
| `authorize` | `(request: { tenantId: string; pluginId: string; operation: StorageOperation; keys: readonly string[]; }) => boolean \| Promise<boolean>` | Yes | Invoked before each operation with trusted scope, operation, and frozen relative keys (list receives its prefix); only exactly true allows access. Errors propagate. |
|
|
418
|
+
| `maxUrlLifetimeSeconds` | `number` | No | Signed URLs remain usable until expiry; default ceiling 300 seconds. |
|
|
419
|
+
|
|
420
|
+
### Returns
|
|
421
|
+
|
|
422
|
+
Type declaration; no runtime value.
|
|
423
|
+
|
|
424
|
+
### Public members
|
|
425
|
+
|
|
426
|
+
#### `tenantId`
|
|
427
|
+
|
|
428
|
+
Trusted tenant ID: 1–128 ASCII letters, digits, underscores, or hyphens, starting alphanumeric. It must come from verified server identity/configuration, never request body keys.
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
#### `pluginId`
|
|
432
|
+
|
|
433
|
+
Trusted plugin ID: 1–128 ASCII letters, digits, underscores, or hyphens, starting with a letter or digit.
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
#### `authorize`
|
|
437
|
+
|
|
438
|
+
Invoked before each operation with trusted scope, operation, and frozen relative keys (list receives its prefix); only exactly true allows access. Errors propagate.
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
#### `authorize.request.tenantId`
|
|
442
|
+
|
|
443
|
+
Trusted tenant scope captured at adapter construction, independent of caller object keys.
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
#### `authorize.request.pluginId`
|
|
447
|
+
|
|
448
|
+
Trusted plugin scope captured at adapter construction.
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
#### `authorize.request.operation`
|
|
452
|
+
|
|
453
|
+
Storage operation about to be delegated to the provider.
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
#### `authorize.request.keys`
|
|
457
|
+
|
|
458
|
+
Frozen relative-key array; copy/move supplies source then destination, and list supplies its requested prefix.
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
#### `maxUrlLifetimeSeconds`
|
|
462
|
+
|
|
463
|
+
Signed URLs remain usable until expiry; default ceiling 300 seconds.
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
### Example
|
|
468
|
+
|
|
469
|
+
See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
|
|
470
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Storage ownership and host boundaries"
|
|
3
|
+
description: "Tenant/plugin-scoped storage and signed-URL authorization. This capability belongs to @alneas/eaos-server; it is not a separate npm package."
|
|
4
|
+
sidebar:
|
|
5
|
+
order: 20
|
|
6
|
+
archetype: "explanation"
|
|
7
|
+
project: "eaos-workspace"
|
|
8
|
+
tags: ["eaos", "explanation"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Storage ownership and host boundaries
|
|
12
|
+
|
|
13
|
+
## Motivation
|
|
14
|
+
|
|
15
|
+
Tenant/plugin-scoped storage and signed-URL authorization. This capability belongs to `@alneas/eaos-server`; it is not a separate npm package.
|
|
16
|
+
|
|
17
|
+
## Architectural Diagram
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart LR
|
|
21
|
+
Host[Trusted host] --> Adapter[Scoped Server adapter]
|
|
22
|
+
Adapter --> Store[Host-owned durable provider]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Public import
|
|
26
|
+
|
|
27
|
+
Install the package; the subpath below is an import target, not a separate package. Registry installation requires a published EAOS release; before publication use the owning workspace's checksum-verified build artifact.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add @alneas/eaos-server
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { createTenantStorage } from '@alneas/eaos-server/storage'
|
|
35
|
+
|
|
36
|
+
export function bindStorage(...args: Parameters<typeof createTenantStorage>) {
|
|
37
|
+
return createTenantStorage(...args)
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Server runtime only. Supply the external storage adapter and verified tenant/plugin scope with live authorization; provider credentials stay on the server.
|
|
42
|
+
|
|
43
|
+
## Trade-offs & Decisions
|
|
44
|
+
|
|
45
|
+
Reuse the app-core storage adapter. Verified scopes, private provider settings and live per-operation permission are mandatory. A signed URL can remain usable until expiry; downloaded bytes cannot be remotely revoked. Validate real bucket protection separately from a configuration flag.
|
|
46
|
+
|
|
47
|
+
The host owns verified identity, tenant boundaries, credentials and real provider adoption. Package builds and tests never apply production changes or activate tenants. Review the [API reference](api.md) before binding the host.
|