@aigne/aos 0.2.0-beta
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 +49 -0
- package/LICENSE.md +26 -0
- package/dist/agent-dsl.cjs +116 -0
- package/dist/agent-dsl.d.cts +31 -0
- package/dist/agent-dsl.d.cts.map +1 -0
- package/dist/agent-dsl.d.mts +31 -0
- package/dist/agent-dsl.d.mts.map +1 -0
- package/dist/agent-dsl.mjs +115 -0
- package/dist/agent-dsl.mjs.map +1 -0
- package/dist/arc-compat.cjs +125 -0
- package/dist/arc-compat.d.cts +17 -0
- package/dist/arc-compat.d.cts.map +1 -0
- package/dist/arc-compat.d.mts +17 -0
- package/dist/arc-compat.d.mts.map +1 -0
- package/dist/arc-compat.mjs +123 -0
- package/dist/arc-compat.mjs.map +1 -0
- package/dist/auto-surface/compiler.cjs +36 -0
- package/dist/auto-surface/compiler.d.cts +7 -0
- package/dist/auto-surface/compiler.d.cts.map +1 -0
- package/dist/auto-surface/compiler.d.mts +7 -0
- package/dist/auto-surface/compiler.d.mts.map +1 -0
- package/dist/auto-surface/compiler.mjs +37 -0
- package/dist/auto-surface/compiler.mjs.map +1 -0
- package/dist/auto-surface/definition-dsl.cjs +333 -0
- package/dist/auto-surface/definition-dsl.d.cts +41 -0
- package/dist/auto-surface/definition-dsl.d.cts.map +1 -0
- package/dist/auto-surface/definition-dsl.d.mts +41 -0
- package/dist/auto-surface/definition-dsl.d.mts.map +1 -0
- package/dist/auto-surface/definition-dsl.mjs +332 -0
- package/dist/auto-surface/definition-dsl.mjs.map +1 -0
- package/dist/auto-surface/fragments.cjs +177 -0
- package/dist/auto-surface/fragments.d.cts +23 -0
- package/dist/auto-surface/fragments.d.cts.map +1 -0
- package/dist/auto-surface/fragments.d.mts +23 -0
- package/dist/auto-surface/fragments.d.mts.map +1 -0
- package/dist/auto-surface/fragments.mjs +175 -0
- package/dist/auto-surface/fragments.mjs.map +1 -0
- package/dist/auto-surface/index.d.mts +9 -0
- package/dist/auto-surface/layering.cjs +43 -0
- package/dist/auto-surface/layering.d.cts +7 -0
- package/dist/auto-surface/layering.d.cts.map +1 -0
- package/dist/auto-surface/layering.d.mts +7 -0
- package/dist/auto-surface/layering.d.mts.map +1 -0
- package/dist/auto-surface/layering.mjs +43 -0
- package/dist/auto-surface/layering.mjs.map +1 -0
- package/dist/auto-surface/projection.cjs +11 -0
- package/dist/auto-surface/projection.d.cts +11 -0
- package/dist/auto-surface/projection.d.cts.map +1 -0
- package/dist/auto-surface/projection.d.mts +11 -0
- package/dist/auto-surface/projection.d.mts.map +1 -0
- package/dist/auto-surface/projection.mjs +12 -0
- package/dist/auto-surface/projection.mjs.map +1 -0
- package/dist/auto-surface/projectors/settings-shell.cjs +114 -0
- package/dist/auto-surface/projectors/settings-shell.d.cts +10 -0
- package/dist/auto-surface/projectors/settings-shell.d.cts.map +1 -0
- package/dist/auto-surface/projectors/settings-shell.d.mts +10 -0
- package/dist/auto-surface/projectors/settings-shell.d.mts.map +1 -0
- package/dist/auto-surface/projectors/settings-shell.mjs +114 -0
- package/dist/auto-surface/projectors/settings-shell.mjs.map +1 -0
- package/dist/auto-surface/scenario.cjs +38 -0
- package/dist/auto-surface/scenario.d.cts +31 -0
- package/dist/auto-surface/scenario.d.cts.map +1 -0
- package/dist/auto-surface/scenario.d.mts +31 -0
- package/dist/auto-surface/scenario.d.mts.map +1 -0
- package/dist/auto-surface/scenario.mjs +37 -0
- package/dist/auto-surface/scenario.mjs.map +1 -0
- package/dist/auto-surface/types.cjs +9 -0
- package/dist/auto-surface/types.d.cts +153 -0
- package/dist/auto-surface/types.d.cts.map +1 -0
- package/dist/auto-surface/types.d.mts +153 -0
- package/dist/auto-surface/types.d.mts.map +1 -0
- package/dist/auto-surface/types.mjs +9 -0
- package/dist/auto-surface/types.mjs.map +1 -0
- package/dist/auto-surface/value-dsl.cjs +80 -0
- package/dist/auto-surface/value-dsl.d.cts +24 -0
- package/dist/auto-surface/value-dsl.d.cts.map +1 -0
- package/dist/auto-surface/value-dsl.d.mts +24 -0
- package/dist/auto-surface/value-dsl.d.mts.map +1 -0
- package/dist/auto-surface/value-dsl.mjs +79 -0
- package/dist/auto-surface/value-dsl.mjs.map +1 -0
- package/dist/blocklet/activation.cjs +94 -0
- package/dist/blocklet/activation.d.cts +30 -0
- package/dist/blocklet/activation.d.cts.map +1 -0
- package/dist/blocklet/activation.d.mts +30 -0
- package/dist/blocklet/activation.d.mts.map +1 -0
- package/dist/blocklet/activation.mjs +94 -0
- package/dist/blocklet/activation.mjs.map +1 -0
- package/dist/blocklet/did-space-registry.cjs +282 -0
- package/dist/blocklet/did-space-registry.d.cts +82 -0
- package/dist/blocklet/did-space-registry.d.cts.map +1 -0
- package/dist/blocklet/did-space-registry.d.mts +82 -0
- package/dist/blocklet/did-space-registry.d.mts.map +1 -0
- package/dist/blocklet/did-space-registry.mjs +281 -0
- package/dist/blocklet/did-space-registry.mjs.map +1 -0
- package/dist/blocklet/handlers.cjs +66 -0
- package/dist/blocklet/handlers.d.cts +16 -0
- package/dist/blocklet/handlers.d.cts.map +1 -0
- package/dist/blocklet/handlers.d.mts +16 -0
- package/dist/blocklet/handlers.d.mts.map +1 -0
- package/dist/blocklet/handlers.mjs +65 -0
- package/dist/blocklet/handlers.mjs.map +1 -0
- package/dist/blocklet/index.d.mts +7 -0
- package/dist/blocklet/manifest.d.cts +2 -0
- package/dist/blocklet/manifest.d.mts +2 -0
- package/dist/blocklet/manifest.mjs +3 -0
- package/dist/blocklet/registry.cjs +447 -0
- package/dist/blocklet/registry.d.cts +197 -0
- package/dist/blocklet/registry.d.cts.map +1 -0
- package/dist/blocklet/registry.d.mts +197 -0
- package/dist/blocklet/registry.d.mts.map +1 -0
- package/dist/blocklet/registry.mjs +441 -0
- package/dist/blocklet/registry.mjs.map +1 -0
- package/dist/blocklet/static-render.cjs +183 -0
- package/dist/blocklet/static-render.d.cts +55 -0
- package/dist/blocklet/static-render.d.cts.map +1 -0
- package/dist/blocklet/static-render.d.mts +55 -0
- package/dist/blocklet/static-render.d.mts.map +1 -0
- package/dist/blocklet/static-render.mjs +181 -0
- package/dist/blocklet/static-render.mjs.map +1 -0
- package/dist/blocklet/types.d.cts +70 -0
- package/dist/blocklet/types.d.cts.map +1 -0
- package/dist/blocklet/types.d.mts +70 -0
- package/dist/blocklet/types.d.mts.map +1 -0
- package/dist/devices/chain.cjs +127 -0
- package/dist/devices/chain.d.cts +48 -0
- package/dist/devices/chain.d.cts.map +1 -0
- package/dist/devices/chain.d.mts +48 -0
- package/dist/devices/chain.d.mts.map +1 -0
- package/dist/devices/chain.mjs +125 -0
- package/dist/devices/chain.mjs.map +1 -0
- package/dist/dsl-shared.cjs +290 -0
- package/dist/dsl-shared.d.cts +54 -0
- package/dist/dsl-shared.d.cts.map +1 -0
- package/dist/dsl-shared.d.mts +54 -0
- package/dist/dsl-shared.d.mts.map +1 -0
- package/dist/dsl-shared.mjs +287 -0
- package/dist/dsl-shared.mjs.map +1 -0
- package/dist/http/afs-mcp.cjs +85 -0
- package/dist/http/afs-mcp.d.cts +14 -0
- package/dist/http/afs-mcp.d.cts.map +1 -0
- package/dist/http/afs-mcp.d.mts +14 -0
- package/dist/http/afs-mcp.d.mts.map +1 -0
- package/dist/http/afs-mcp.mjs +86 -0
- package/dist/http/afs-mcp.mjs.map +1 -0
- package/dist/http/afs-raw.cjs +264 -0
- package/dist/http/afs-raw.d.cts +31 -0
- package/dist/http/afs-raw.d.cts.map +1 -0
- package/dist/http/afs-raw.d.mts +31 -0
- package/dist/http/afs-raw.d.mts.map +1 -0
- package/dist/http/afs-raw.mjs +264 -0
- package/dist/http/afs-raw.mjs.map +1 -0
- package/dist/http/afs-rest.cjs +30 -0
- package/dist/http/afs-rest.d.cts +21 -0
- package/dist/http/afs-rest.d.cts.map +1 -0
- package/dist/http/afs-rest.d.mts +21 -0
- package/dist/http/afs-rest.d.mts.map +1 -0
- package/dist/http/afs-rest.mjs +31 -0
- package/dist/http/afs-rest.mjs.map +1 -0
- package/dist/http/afs-rpc-wire.cjs +271 -0
- package/dist/http/afs-rpc-wire.d.cts +195 -0
- package/dist/http/afs-rpc-wire.d.cts.map +1 -0
- package/dist/http/afs-rpc-wire.d.mts +195 -0
- package/dist/http/afs-rpc-wire.d.mts.map +1 -0
- package/dist/http/afs-rpc-wire.mjs +262 -0
- package/dist/http/afs-rpc-wire.mjs.map +1 -0
- package/dist/http/afs-rpc.cjs +729 -0
- package/dist/http/afs-rpc.d.cts +103 -0
- package/dist/http/afs-rpc.d.cts.map +1 -0
- package/dist/http/afs-rpc.d.mts +103 -0
- package/dist/http/afs-rpc.d.mts.map +1 -0
- package/dist/http/afs-rpc.mjs +729 -0
- package/dist/http/afs-rpc.mjs.map +1 -0
- package/dist/http/afs-upload.cjs +116 -0
- package/dist/http/afs-upload.d.cts +40 -0
- package/dist/http/afs-upload.d.cts.map +1 -0
- package/dist/http/afs-upload.d.mts +40 -0
- package/dist/http/afs-upload.d.mts.map +1 -0
- package/dist/http/afs-upload.mjs +116 -0
- package/dist/http/afs-upload.mjs.map +1 -0
- package/dist/http/aup-client.cjs +60 -0
- package/dist/http/aup-client.d.cts +22 -0
- package/dist/http/aup-client.d.cts.map +1 -0
- package/dist/http/aup-client.d.mts +22 -0
- package/dist/http/aup-client.d.mts.map +1 -0
- package/dist/http/aup-client.mjs +59 -0
- package/dist/http/aup-client.mjs.map +1 -0
- package/dist/http/aup-event.cjs +100 -0
- package/dist/http/aup-event.d.cts +38 -0
- package/dist/http/aup-event.d.cts.map +1 -0
- package/dist/http/aup-event.d.mts +38 -0
- package/dist/http/aup-event.d.mts.map +1 -0
- package/dist/http/aup-event.mjs +101 -0
- package/dist/http/aup-event.mjs.map +1 -0
- package/dist/http/auth-context.cjs +66 -0
- package/dist/http/auth-context.d.cts +64 -0
- package/dist/http/auth-context.d.cts.map +1 -0
- package/dist/http/auth-context.d.mts +64 -0
- package/dist/http/auth-context.d.mts.map +1 -0
- package/dist/http/auth-context.mjs +66 -0
- package/dist/http/auth-context.mjs.map +1 -0
- package/dist/http/csrf.cjs +50 -0
- package/dist/http/csrf.d.cts +8 -0
- package/dist/http/csrf.d.cts.map +1 -0
- package/dist/http/csrf.d.mts +8 -0
- package/dist/http/csrf.d.mts.map +1 -0
- package/dist/http/csrf.mjs +49 -0
- package/dist/http/csrf.mjs.map +1 -0
- package/dist/http/handlers.cjs +106 -0
- package/dist/http/handlers.d.cts +39 -0
- package/dist/http/handlers.d.cts.map +1 -0
- package/dist/http/handlers.d.mts +39 -0
- package/dist/http/handlers.d.mts.map +1 -0
- package/dist/http/handlers.mjs +104 -0
- package/dist/http/handlers.mjs.map +1 -0
- package/dist/http/index.d.mts +1 -0
- package/dist/http/ingest-facade.cjs +315 -0
- package/dist/http/ingest-facade.mjs +314 -0
- package/dist/http/ingest-facade.mjs.map +1 -0
- package/dist/http/raw-url.cjs +136 -0
- package/dist/http/raw-url.d.cts +54 -0
- package/dist/http/raw-url.d.cts.map +1 -0
- package/dist/http/raw-url.d.mts +54 -0
- package/dist/http/raw-url.d.mts.map +1 -0
- package/dist/http/raw-url.mjs +136 -0
- package/dist/http/raw-url.mjs.map +1 -0
- package/dist/http/request-context.cjs +178 -0
- package/dist/http/request-context.d.cts +76 -0
- package/dist/http/request-context.d.cts.map +1 -0
- package/dist/http/request-context.d.mts +76 -0
- package/dist/http/request-context.d.mts.map +1 -0
- package/dist/http/request-context.mjs +179 -0
- package/dist/http/request-context.mjs.map +1 -0
- package/dist/index.cjs +197 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.mts +68 -0
- package/dist/index.mjs +61 -0
- package/dist/mcp/index.cjs +9 -0
- package/dist/mcp/index.d.cts +5 -0
- package/dist/mcp/index.d.mts +5 -0
- package/dist/mcp/index.mjs +6 -0
- package/dist/mcp/prompts.cjs +17 -0
- package/dist/mcp/prompts.d.cts +8 -0
- package/dist/mcp/prompts.d.cts.map +1 -0
- package/dist/mcp/prompts.d.mts +8 -0
- package/dist/mcp/prompts.d.mts.map +1 -0
- package/dist/mcp/prompts.mjs +17 -0
- package/dist/mcp/prompts.mjs.map +1 -0
- package/dist/mcp/resources.cjs +22 -0
- package/dist/mcp/resources.d.cts +8 -0
- package/dist/mcp/resources.d.cts.map +1 -0
- package/dist/mcp/resources.d.mts +8 -0
- package/dist/mcp/resources.d.mts.map +1 -0
- package/dist/mcp/resources.mjs +22 -0
- package/dist/mcp/resources.mjs.map +1 -0
- package/dist/mcp/server.cjs +51 -0
- package/dist/mcp/server.d.cts +20 -0
- package/dist/mcp/server.d.cts.map +1 -0
- package/dist/mcp/server.d.mts +20 -0
- package/dist/mcp/server.d.mts.map +1 -0
- package/dist/mcp/server.mjs +52 -0
- package/dist/mcp/server.mjs.map +1 -0
- package/dist/mcp/tools.cjs +218 -0
- package/dist/mcp/tools.d.cts +8 -0
- package/dist/mcp/tools.d.cts.map +1 -0
- package/dist/mcp/tools.d.mts +8 -0
- package/dist/mcp/tools.d.mts.map +1 -0
- package/dist/mcp/tools.mjs +219 -0
- package/dist/mcp/tools.mjs.map +1 -0
- package/dist/mcp/utils.cjs +75 -0
- package/dist/mcp/utils.mjs +69 -0
- package/dist/mcp/utils.mjs.map +1 -0
- package/dist/mount/index.cjs +4 -0
- package/dist/mount/index.d.cts +3 -0
- package/dist/mount/index.d.mts +3 -0
- package/dist/mount/index.mjs +3 -0
- package/dist/mount/materializer.cjs +167 -0
- package/dist/mount/materializer.d.cts +97 -0
- package/dist/mount/materializer.d.cts.map +1 -0
- package/dist/mount/materializer.d.mts +97 -0
- package/dist/mount/materializer.d.mts.map +1 -0
- package/dist/mount/materializer.mjs +167 -0
- package/dist/mount/materializer.mjs.map +1 -0
- package/dist/mount/types.d.cts +90 -0
- package/dist/mount/types.d.cts.map +1 -0
- package/dist/mount/types.d.mts +90 -0
- package/dist/mount/types.d.mts.map +1 -0
- package/dist/mount-config.cjs +61 -0
- package/dist/mount-config.d.cts +19 -0
- package/dist/mount-config.d.cts.map +1 -0
- package/dist/mount-config.d.mts +19 -0
- package/dist/mount-config.d.mts.map +1 -0
- package/dist/mount-config.mjs +61 -0
- package/dist/mount-config.mjs.map +1 -0
- package/dist/projectors/aup-projector.cjs +190 -0
- package/dist/projectors/aup-projector.d.cts +59 -0
- package/dist/projectors/aup-projector.d.cts.map +1 -0
- package/dist/projectors/aup-projector.d.mts +59 -0
- package/dist/projectors/aup-projector.d.mts.map +1 -0
- package/dist/projectors/aup-projector.mjs +188 -0
- package/dist/projectors/aup-projector.mjs.map +1 -0
- package/dist/projectors/index.cjs +6 -0
- package/dist/projectors/index.d.cts +2 -0
- package/dist/projectors/index.d.mts +2 -0
- package/dist/projectors/index.mjs +3 -0
- package/dist/scaffold/afs.cjs +195 -0
- package/dist/scaffold/afs.d.cts +16 -0
- package/dist/scaffold/afs.d.cts.map +1 -0
- package/dist/scaffold/afs.d.mts +16 -0
- package/dist/scaffold/afs.d.mts.map +1 -0
- package/dist/scaffold/afs.mjs +195 -0
- package/dist/scaffold/afs.mjs.map +1 -0
- package/dist/scaffold/composition.cjs +92 -0
- package/dist/scaffold/composition.d.cts +10 -0
- package/dist/scaffold/composition.d.cts.map +1 -0
- package/dist/scaffold/composition.d.mts +10 -0
- package/dist/scaffold/composition.d.mts.map +1 -0
- package/dist/scaffold/composition.mjs +92 -0
- package/dist/scaffold/composition.mjs.map +1 -0
- package/dist/scaffold/dsl-error.cjs +21 -0
- package/dist/scaffold/dsl-error.d.cts +11 -0
- package/dist/scaffold/dsl-error.d.cts.map +1 -0
- package/dist/scaffold/dsl-error.d.mts +11 -0
- package/dist/scaffold/dsl-error.d.mts.map +1 -0
- package/dist/scaffold/dsl-error.mjs +20 -0
- package/dist/scaffold/dsl-error.mjs.map +1 -0
- package/dist/scaffold/index.d.mts +12 -0
- package/dist/scaffold/manifest-dsl.cjs +188 -0
- package/dist/scaffold/manifest-dsl.d.cts +8 -0
- package/dist/scaffold/manifest-dsl.d.cts.map +1 -0
- package/dist/scaffold/manifest-dsl.d.mts +8 -0
- package/dist/scaffold/manifest-dsl.d.mts.map +1 -0
- package/dist/scaffold/manifest-dsl.mjs +188 -0
- package/dist/scaffold/manifest-dsl.mjs.map +1 -0
- package/dist/scaffold/module-dsl.cjs +284 -0
- package/dist/scaffold/module-dsl.d.cts +8 -0
- package/dist/scaffold/module-dsl.d.cts.map +1 -0
- package/dist/scaffold/module-dsl.d.mts +8 -0
- package/dist/scaffold/module-dsl.d.mts.map +1 -0
- package/dist/scaffold/module-dsl.mjs +284 -0
- package/dist/scaffold/module-dsl.mjs.map +1 -0
- package/dist/scaffold/resolver.cjs +156 -0
- package/dist/scaffold/resolver.d.cts +7 -0
- package/dist/scaffold/resolver.d.cts.map +1 -0
- package/dist/scaffold/resolver.d.mts +7 -0
- package/dist/scaffold/resolver.d.mts.map +1 -0
- package/dist/scaffold/resolver.mjs +156 -0
- package/dist/scaffold/resolver.mjs.map +1 -0
- package/dist/scaffold/runtime.cjs +24 -0
- package/dist/scaffold/runtime.d.cts +19 -0
- package/dist/scaffold/runtime.d.cts.map +1 -0
- package/dist/scaffold/runtime.d.mts +19 -0
- package/dist/scaffold/runtime.d.mts.map +1 -0
- package/dist/scaffold/runtime.mjs +25 -0
- package/dist/scaffold/runtime.mjs.map +1 -0
- package/dist/scaffold/shell-dsl.cjs +279 -0
- package/dist/scaffold/shell-dsl.d.cts +8 -0
- package/dist/scaffold/shell-dsl.d.cts.map +1 -0
- package/dist/scaffold/shell-dsl.d.mts +8 -0
- package/dist/scaffold/shell-dsl.d.mts.map +1 -0
- package/dist/scaffold/shell-dsl.mjs +279 -0
- package/dist/scaffold/shell-dsl.mjs.map +1 -0
- package/dist/scaffold/surface-dsl.cjs +182 -0
- package/dist/scaffold/surface-dsl.d.cts +8 -0
- package/dist/scaffold/surface-dsl.d.cts.map +1 -0
- package/dist/scaffold/surface-dsl.d.mts +8 -0
- package/dist/scaffold/surface-dsl.d.mts.map +1 -0
- package/dist/scaffold/surface-dsl.mjs +182 -0
- package/dist/scaffold/surface-dsl.mjs.map +1 -0
- package/dist/scaffold/surfaces.cjs +84 -0
- package/dist/scaffold/surfaces.d.cts +23 -0
- package/dist/scaffold/surfaces.d.cts.map +1 -0
- package/dist/scaffold/surfaces.d.mts +24 -0
- package/dist/scaffold/surfaces.d.mts.map +1 -0
- package/dist/scaffold/surfaces.mjs +84 -0
- package/dist/scaffold/surfaces.mjs.map +1 -0
- package/dist/scaffold/types.d.cts +264 -0
- package/dist/scaffold/types.d.cts.map +1 -0
- package/dist/scaffold/types.d.mts +265 -0
- package/dist/scaffold/types.d.mts.map +1 -0
- package/dist/scaffold/workspace-dsl.cjs +339 -0
- package/dist/scaffold/workspace-dsl.d.cts +49 -0
- package/dist/scaffold/workspace-dsl.d.cts.map +1 -0
- package/dist/scaffold/workspace-dsl.d.mts +49 -0
- package/dist/scaffold/workspace-dsl.d.mts.map +1 -0
- package/dist/scaffold/workspace-dsl.mjs +337 -0
- package/dist/scaffold/workspace-dsl.mjs.map +1 -0
- package/dist/scope/index.d.mts +3 -0
- package/dist/scope/read-blocklet-scope.cjs +29 -0
- package/dist/scope/read-blocklet-scope.d.cts +8 -0
- package/dist/scope/read-blocklet-scope.d.cts.map +1 -0
- package/dist/scope/read-blocklet-scope.d.mts +8 -0
- package/dist/scope/read-blocklet-scope.d.mts.map +1 -0
- package/dist/scope/read-blocklet-scope.mjs +30 -0
- package/dist/scope/read-blocklet-scope.mjs.map +1 -0
- package/dist/scope/resolve-scoped-afs.cjs +87 -0
- package/dist/scope/resolve-scoped-afs.d.cts +7 -0
- package/dist/scope/resolve-scoped-afs.d.cts.map +1 -0
- package/dist/scope/resolve-scoped-afs.d.mts +7 -0
- package/dist/scope/resolve-scoped-afs.d.mts.map +1 -0
- package/dist/scope/resolve-scoped-afs.mjs +88 -0
- package/dist/scope/resolve-scoped-afs.mjs.map +1 -0
- package/dist/scope/types.d.cts +25 -0
- package/dist/scope/types.d.cts.map +1 -0
- package/dist/scope/types.d.mts +25 -0
- package/dist/scope/types.d.mts.map +1 -0
- package/dist/session/backends.cjs +90 -0
- package/dist/session/backends.d.cts +35 -0
- package/dist/session/backends.d.cts.map +1 -0
- package/dist/session/backends.d.mts +35 -0
- package/dist/session/backends.d.mts.map +1 -0
- package/dist/session/backends.mjs +89 -0
- package/dist/session/backends.mjs.map +1 -0
- package/dist/session/replication-resolver.cjs +323 -0
- package/dist/session/replication-resolver.d.cts +71 -0
- package/dist/session/replication-resolver.d.cts.map +1 -0
- package/dist/session/replication-resolver.d.mts +71 -0
- package/dist/session/replication-resolver.d.mts.map +1 -0
- package/dist/session/replication-resolver.mjs +323 -0
- package/dist/session/replication-resolver.mjs.map +1 -0
- package/dist/session/role-level.cjs +36 -0
- package/dist/session/role-level.d.cts +24 -0
- package/dist/session/role-level.d.cts.map +1 -0
- package/dist/session/role-level.d.mts +24 -0
- package/dist/session/role-level.d.mts.map +1 -0
- package/dist/session/role-level.mjs +35 -0
- package/dist/session/role-level.mjs.map +1 -0
- package/dist/session/session-dir-providers.cjs +254 -0
- package/dist/session/session-dir-providers.d.cts +32 -0
- package/dist/session/session-dir-providers.d.cts.map +1 -0
- package/dist/session/session-dir-providers.d.mts +32 -0
- package/dist/session/session-dir-providers.d.mts.map +1 -0
- package/dist/session/session-dir-providers.mjs +252 -0
- package/dist/session/session-dir-providers.mjs.map +1 -0
- package/dist/session/session-id.cjs +20 -0
- package/dist/session/session-id.d.cts +15 -0
- package/dist/session/session-id.d.cts.map +1 -0
- package/dist/session/session-id.d.mts +15 -0
- package/dist/session/session-id.d.mts.map +1 -0
- package/dist/session/session-id.mjs +20 -0
- package/dist/session/session-id.mjs.map +1 -0
- package/dist/session/session-user-afs.cjs +899 -0
- package/dist/session/session-user-afs.d.cts +296 -0
- package/dist/session/session-user-afs.d.cts.map +1 -0
- package/dist/session/session-user-afs.d.mts +296 -0
- package/dist/session/session-user-afs.d.mts.map +1 -0
- package/dist/session/session-user-afs.mjs +896 -0
- package/dist/session/session-user-afs.mjs.map +1 -0
- package/dist/session/settings-cascade.cjs +69 -0
- package/dist/session/settings-cascade.d.cts +81 -0
- package/dist/session/settings-cascade.d.cts.map +1 -0
- package/dist/session/settings-cascade.d.mts +81 -0
- package/dist/session/settings-cascade.d.mts.map +1 -0
- package/dist/session/settings-cascade.mjs +69 -0
- package/dist/session/settings-cascade.mjs.map +1 -0
- package/dist/session/settings-resolver.cjs +770 -0
- package/dist/session/settings-resolver.d.cts +177 -0
- package/dist/session/settings-resolver.d.cts.map +1 -0
- package/dist/session/settings-resolver.d.mts +177 -0
- package/dist/session/settings-resolver.d.mts.map +1 -0
- package/dist/session/settings-resolver.mjs +771 -0
- package/dist/session/settings-resolver.mjs.map +1 -0
- package/dist/session/settings-schema-store.cjs +0 -0
- package/dist/session/settings-schema-store.d.cts +72 -0
- package/dist/session/settings-schema-store.d.cts.map +1 -0
- package/dist/session/settings-schema-store.d.mts +72 -0
- package/dist/session/settings-schema-store.d.mts.map +1 -0
- package/dist/session/settings-schema-store.mjs +0 -0
- package/dist/session/settings-schema-store.mjs.map +1 -0
- package/dist/system-mounts/index.cjs +14 -0
- package/dist/system-mounts/index.d.cts +6 -0
- package/dist/system-mounts/index.d.mts +6 -0
- package/dist/system-mounts/index.mjs +6 -0
- package/dist/system-mounts/install.cjs +101 -0
- package/dist/system-mounts/install.d.cts +36 -0
- package/dist/system-mounts/install.d.cts.map +1 -0
- package/dist/system-mounts/install.d.mts +37 -0
- package/dist/system-mounts/install.d.mts.map +1 -0
- package/dist/system-mounts/install.mjs +102 -0
- package/dist/system-mounts/install.mjs.map +1 -0
- package/dist/system-mounts/installers.cjs +247 -0
- package/dist/system-mounts/installers.d.cts +13 -0
- package/dist/system-mounts/installers.d.cts.map +1 -0
- package/dist/system-mounts/installers.d.mts +14 -0
- package/dist/system-mounts/installers.d.mts.map +1 -0
- package/dist/system-mounts/installers.mjs +244 -0
- package/dist/system-mounts/installers.mjs.map +1 -0
- package/dist/system-mounts/lists.cjs +122 -0
- package/dist/system-mounts/lists.d.cts +34 -0
- package/dist/system-mounts/lists.d.cts.map +1 -0
- package/dist/system-mounts/lists.d.mts +34 -0
- package/dist/system-mounts/lists.d.mts.map +1 -0
- package/dist/system-mounts/lists.mjs +122 -0
- package/dist/system-mounts/lists.mjs.map +1 -0
- package/dist/system-mounts/types.d.cts +124 -0
- package/dist/system-mounts/types.d.cts.map +1 -0
- package/dist/system-mounts/types.d.mts +125 -0
- package/dist/system-mounts/types.d.mts.map +1 -0
- package/dist/system-mounts/validate.cjs +56 -0
- package/dist/system-mounts/validate.d.cts +34 -0
- package/dist/system-mounts/validate.d.cts.map +1 -0
- package/dist/system-mounts/validate.d.mts +34 -0
- package/dist/system-mounts/validate.d.mts.map +1 -0
- package/dist/system-mounts/validate.mjs +56 -0
- package/dist/system-mounts/validate.mjs.map +1 -0
- package/dist/terminal-llm.cjs +90 -0
- package/dist/terminal-llm.d.cts +50 -0
- package/dist/terminal-llm.d.cts.map +1 -0
- package/dist/terminal-llm.d.mts +50 -0
- package/dist/terminal-llm.d.mts.map +1 -0
- package/dist/terminal-llm.mjs +90 -0
- package/dist/terminal-llm.mjs.map +1 -0
- package/dist/terminal-repl.cjs +371 -0
- package/dist/terminal-repl.d.cts +69 -0
- package/dist/terminal-repl.d.cts.map +1 -0
- package/dist/terminal-repl.d.mts +69 -0
- package/dist/terminal-repl.d.mts.map +1 -0
- package/dist/terminal-repl.mjs +370 -0
- package/dist/terminal-repl.mjs.map +1 -0
- package/dist/transport/idle-timer.cjs +136 -0
- package/dist/transport/idle-timer.d.cts +92 -0
- package/dist/transport/idle-timer.d.cts.map +1 -0
- package/dist/transport/idle-timer.d.mts +92 -0
- package/dist/transport/idle-timer.d.mts.map +1 -0
- package/dist/transport/idle-timer.mjs +132 -0
- package/dist/transport/idle-timer.mjs.map +1 -0
- package/dist/web-component-dsl.cjs +153 -0
- package/dist/web-component-dsl.d.cts +27 -0
- package/dist/web-component-dsl.d.cts.map +1 -0
- package/dist/web-component-dsl.d.mts +27 -0
- package/dist/web-component-dsl.d.mts.map +1 -0
- package/dist/web-component-dsl.mjs +152 -0
- package/dist/web-component-dsl.mjs.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AFS, AFSModule } from "@aigne/afs";
|
|
2
|
+
|
|
3
|
+
//#region src/mount/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Provider creation intent — runtime-neutral description of "what to mount
|
|
7
|
+
* at this path". Adapter layers (Node `createNodeProviderFactory`,
|
|
8
|
+
* Cloudflare worker factories) translate this into concrete provider
|
|
9
|
+
* instances and companion resources.
|
|
10
|
+
*/
|
|
11
|
+
interface ProviderDefinition {
|
|
12
|
+
/** Provider URI, e.g. `ocap://main.abtnetwork.io/api`, `fs:///path`. */
|
|
13
|
+
uri: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provider scheme name (e.g. `ocap`, `fs`, `json`).
|
|
16
|
+
*
|
|
17
|
+
* Source: usually parsed from `uri` via `new URL(uri).protocol.slice(0, -1)`,
|
|
18
|
+
* or supplied by the caller when scheme is already known (e.g. daemon
|
|
19
|
+
* config has an explicit `scheme` field).
|
|
20
|
+
*
|
|
21
|
+
* Use: a hint for registry / factory selection. The adapter that converts
|
|
22
|
+
* `ProviderDefinition` to a `MountConfig` does NOT write `type` into
|
|
23
|
+
* `MountConfig.path`.
|
|
24
|
+
*
|
|
25
|
+
* Required (not `string | undefined`) to keep call sites unambiguous —
|
|
26
|
+
* callers can pass `new URL(uri).protocol.slice(0, -1)` when they have no
|
|
27
|
+
* better hint.
|
|
28
|
+
*/
|
|
29
|
+
type: string;
|
|
30
|
+
/** Provider-specific options forwarded to the factory. */
|
|
31
|
+
options?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
* A resource bundle that one provider explicitly contributes to another
|
|
36
|
+
* provider's mount. First-stage materializer reserves the type but does not
|
|
37
|
+
* project contributions — see Phase 6 of the materialization plan.
|
|
38
|
+
*/
|
|
39
|
+
interface ResourceContribution {
|
|
40
|
+
kind: "aup";
|
|
41
|
+
target: string;
|
|
42
|
+
resources: AFSModule;
|
|
43
|
+
scope: "blocklet" | "instance";
|
|
44
|
+
policy?: {
|
|
45
|
+
allowDefaultOverride?: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* The full result of materializing a provider mount: its data tree, any
|
|
51
|
+
* companion resources owned by the provider package, and any contributions
|
|
52
|
+
* the provider wants to inject elsewhere.
|
|
53
|
+
*/
|
|
54
|
+
interface MaterializedMount {
|
|
55
|
+
/** The data provider — the thing that gets mounted at the target path. */
|
|
56
|
+
provider: AFSModule;
|
|
57
|
+
/** Read-only companion resources (e.g. AUP recipes) owned by the provider. */
|
|
58
|
+
resources?: AFSModule;
|
|
59
|
+
/** Explicit contributions to other mounts. Reserved for Phase 6. */
|
|
60
|
+
contributions?: ResourceContribution[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
* Extension point for projecting `resources` (and overlays) onto a target
|
|
65
|
+
* mount. Resource projectors run inside the materializer and only use AFS
|
|
66
|
+
* APIs — they never touch Node fs, Cloudflare bindings, or other runtime
|
|
67
|
+
* specifics.
|
|
68
|
+
*/
|
|
69
|
+
interface ResourceProjector {
|
|
70
|
+
/** Projector kind discriminator (e.g. `"aup"`). */
|
|
71
|
+
kind: string;
|
|
72
|
+
project(options: {
|
|
73
|
+
afs: AFS;
|
|
74
|
+
mountPath: string;
|
|
75
|
+
resources: AFSModule;
|
|
76
|
+
scope: "host" | "blocklet" | "instance";
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* Runtime-specific factory that creates a `MaterializedMount` from a
|
|
82
|
+
* `ProviderDefinition`. Node's factory adapts `createRuntimeAwareProviderWithMetadata`;
|
|
83
|
+
* Cloudflare's factory returns bundled assets.
|
|
84
|
+
*/
|
|
85
|
+
interface ProviderFactory {
|
|
86
|
+
create(definition: ProviderDefinition): Promise<MaterializedMount>;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { MaterializedMount, ProviderDefinition, ProviderFactory, ResourceContribution, ResourceProjector };
|
|
90
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/mount/types.ts"],"mappings":";;;;AAoDA;;;;;;UA/BiB,kBAAA;EAkCJ;EAhCX,GAAA;EAkCA;;;;AASF;;;;;;;;;;;EA1BE,IAAA;EAgCA;EA7BA,OAAA,GAAU,MAAA;AAAA;;AAuCZ;;;;;UA9BiB,oBAAA;EACf,IAAA;EACA,MAAA;EACA,SAAA,EAAW,SAAA;EACX,KAAA;EACA,MAAA;IAAW,oBAAA;EAAA;AAAA;;;;;;;UASI,iBAAA;EAiCe;EA/B9B,QAAA,EAAU,SAAA;EAgCS;EA9BnB,SAAA,GAAY,SAAA;EA8B4B;EA5BxC,aAAA,GAAgB,oBAAA;AAAA;;;;;;;;UAUD,iBAAA;;EAEf,IAAA;EACA,OAAA,CAAQ,OAAA;IACN,GAAA,EAAK,GAAA;IACL,SAAA;IACA,SAAA,EAAW,SAAA;IACX,KAAA;EAAA,IACE,OAAA;AAAA;;;;;;;UASW,eAAA;EACf,MAAA,CAAO,UAAA,EAAY,kBAAA,GAAqB,OAAA,CAAQ,iBAAA;AAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AFS, AFSModule } from "@aigne/afs";
|
|
2
|
+
|
|
3
|
+
//#region src/mount/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Provider creation intent — runtime-neutral description of "what to mount
|
|
7
|
+
* at this path". Adapter layers (Node `createNodeProviderFactory`,
|
|
8
|
+
* Cloudflare worker factories) translate this into concrete provider
|
|
9
|
+
* instances and companion resources.
|
|
10
|
+
*/
|
|
11
|
+
interface ProviderDefinition {
|
|
12
|
+
/** Provider URI, e.g. `ocap://main.abtnetwork.io/api`, `fs:///path`. */
|
|
13
|
+
uri: string;
|
|
14
|
+
/**
|
|
15
|
+
* Provider scheme name (e.g. `ocap`, `fs`, `json`).
|
|
16
|
+
*
|
|
17
|
+
* Source: usually parsed from `uri` via `new URL(uri).protocol.slice(0, -1)`,
|
|
18
|
+
* or supplied by the caller when scheme is already known (e.g. daemon
|
|
19
|
+
* config has an explicit `scheme` field).
|
|
20
|
+
*
|
|
21
|
+
* Use: a hint for registry / factory selection. The adapter that converts
|
|
22
|
+
* `ProviderDefinition` to a `MountConfig` does NOT write `type` into
|
|
23
|
+
* `MountConfig.path`.
|
|
24
|
+
*
|
|
25
|
+
* Required (not `string | undefined`) to keep call sites unambiguous —
|
|
26
|
+
* callers can pass `new URL(uri).protocol.slice(0, -1)` when they have no
|
|
27
|
+
* better hint.
|
|
28
|
+
*/
|
|
29
|
+
type: string;
|
|
30
|
+
/** Provider-specific options forwarded to the factory. */
|
|
31
|
+
options?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
* A resource bundle that one provider explicitly contributes to another
|
|
36
|
+
* provider's mount. First-stage materializer reserves the type but does not
|
|
37
|
+
* project contributions — see Phase 6 of the materialization plan.
|
|
38
|
+
*/
|
|
39
|
+
interface ResourceContribution {
|
|
40
|
+
kind: "aup";
|
|
41
|
+
target: string;
|
|
42
|
+
resources: AFSModule;
|
|
43
|
+
scope: "blocklet" | "instance";
|
|
44
|
+
policy?: {
|
|
45
|
+
allowDefaultOverride?: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* The full result of materializing a provider mount: its data tree, any
|
|
51
|
+
* companion resources owned by the provider package, and any contributions
|
|
52
|
+
* the provider wants to inject elsewhere.
|
|
53
|
+
*/
|
|
54
|
+
interface MaterializedMount {
|
|
55
|
+
/** The data provider — the thing that gets mounted at the target path. */
|
|
56
|
+
provider: AFSModule;
|
|
57
|
+
/** Read-only companion resources (e.g. AUP recipes) owned by the provider. */
|
|
58
|
+
resources?: AFSModule;
|
|
59
|
+
/** Explicit contributions to other mounts. Reserved for Phase 6. */
|
|
60
|
+
contributions?: ResourceContribution[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
* Extension point for projecting `resources` (and overlays) onto a target
|
|
65
|
+
* mount. Resource projectors run inside the materializer and only use AFS
|
|
66
|
+
* APIs — they never touch Node fs, Cloudflare bindings, or other runtime
|
|
67
|
+
* specifics.
|
|
68
|
+
*/
|
|
69
|
+
interface ResourceProjector {
|
|
70
|
+
/** Projector kind discriminator (e.g. `"aup"`). */
|
|
71
|
+
kind: string;
|
|
72
|
+
project(options: {
|
|
73
|
+
afs: AFS;
|
|
74
|
+
mountPath: string;
|
|
75
|
+
resources: AFSModule;
|
|
76
|
+
scope: "host" | "blocklet" | "instance";
|
|
77
|
+
}): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
* Runtime-specific factory that creates a `MaterializedMount` from a
|
|
82
|
+
* `ProviderDefinition`. Node's factory adapts `createRuntimeAwareProviderWithMetadata`;
|
|
83
|
+
* Cloudflare's factory returns bundled assets.
|
|
84
|
+
*/
|
|
85
|
+
interface ProviderFactory {
|
|
86
|
+
create(definition: ProviderDefinition): Promise<MaterializedMount>;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { MaterializedMount, ProviderDefinition, ProviderFactory, ResourceContribution, ResourceProjector };
|
|
90
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/mount/types.ts"],"mappings":";;;;AAoDA;;;;;;UA/BiB,kBAAA;EAkCJ;EAhCX,GAAA;EAkCA;;;;AASF;;;;;;;;;;;EA1BE,IAAA;EAgCA;EA7BA,OAAA,GAAU,MAAA;AAAA;;AAuCZ;;;;;UA9BiB,oBAAA;EACf,IAAA;EACA,MAAA;EACA,SAAA,EAAW,SAAA;EACX,KAAA;EACA,MAAA;IAAW,oBAAA;EAAA;AAAA;;;;;;;UASI,iBAAA;EAiCe;EA/B9B,QAAA,EAAU,SAAA;EAgCS;EA9BnB,SAAA,GAAY,SAAA;EA8B4B;EA5BxC,aAAA,GAAgB,oBAAA;AAAA;;;;;;;;UAUD,iBAAA;;EAEf,IAAA;EACA,OAAA,CAAQ,OAAA;IACN,GAAA,EAAK,GAAA;IACL,SAAA;IACA,SAAA,EAAW,SAAA;IACX,KAAA;EAAA,IACE,OAAA;AAAA;;;;;;;UASW,eAAA;EACf,MAAA,CAAO,UAAA,EAAY,kBAAA,GAAqB,OAAA,CAAQ,iBAAA;AAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/mount-config.ts
|
|
3
|
+
function parseMountConfig(input) {
|
|
4
|
+
if (!input || input.trim() === "") return {
|
|
5
|
+
entries: [],
|
|
6
|
+
errors: []
|
|
7
|
+
};
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = JSON.parse(input);
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return {
|
|
13
|
+
entries: [],
|
|
14
|
+
errors: [`Invalid JSON: ${e instanceof Error ? e.message : String(e)}`]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {
|
|
18
|
+
entries: [],
|
|
19
|
+
errors: ["Mount config must be a JSON object with a 'mounts' array"]
|
|
20
|
+
};
|
|
21
|
+
const obj = parsed;
|
|
22
|
+
if (!Array.isArray(obj.mounts)) return {
|
|
23
|
+
entries: [],
|
|
24
|
+
errors: ["Mount config must have a 'mounts' array"]
|
|
25
|
+
};
|
|
26
|
+
const entries = [];
|
|
27
|
+
const errors = [];
|
|
28
|
+
for (let i = 0; i < obj.mounts.length; i++) {
|
|
29
|
+
const entry = obj.mounts[i];
|
|
30
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
31
|
+
errors.push(`mounts[${i}]: must be an object`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const e = entry;
|
|
35
|
+
if (typeof e.path !== "string" || e.path.trim() === "") {
|
|
36
|
+
errors.push(`mounts[${i}]: 'path' must be a non-empty string`);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (typeof e.provider !== "string" || e.provider.trim() === "") {
|
|
40
|
+
errors.push(`mounts[${i}]: 'provider' must be a non-empty string`);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (e.path.includes("..")) {
|
|
44
|
+
errors.push(`mounts[${i}]: path must not contain '..'`);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const normalizedPath = e.path.startsWith("/") ? e.path : `/${e.path}`;
|
|
48
|
+
entries.push({
|
|
49
|
+
path: normalizedPath,
|
|
50
|
+
provider: e.provider.trim(),
|
|
51
|
+
options: typeof e.options === "object" && e.options !== null && !Array.isArray(e.options) ? e.options : {}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
entries,
|
|
56
|
+
errors
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.parseMountConfig = parseMountConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AFSModule } from "@aigne/afs";
|
|
2
|
+
|
|
3
|
+
//#region src/mount-config.d.ts
|
|
4
|
+
interface MountEntry {
|
|
5
|
+
path: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
options?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
interface MountConfig {
|
|
10
|
+
mounts: MountEntry[];
|
|
11
|
+
}
|
|
12
|
+
interface ParseMountConfigResult {
|
|
13
|
+
entries: MountEntry[];
|
|
14
|
+
errors: string[];
|
|
15
|
+
}
|
|
16
|
+
declare function parseMountConfig(input: string | undefined | null): ParseMountConfigResult;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MountConfig, MountEntry, ParseMountConfigResult, parseMountConfig };
|
|
19
|
+
//# sourceMappingURL=mount-config.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-config.d.cts","names":[],"sources":["../src/mount-config.ts"],"mappings":";;;UAEiB,UAAA;EACf,IAAA;EACA,QAAA;EACA,OAAA,GAAU,MAAA;AAAA;AAAA,UAEK,WAAA;EACf,MAAA,EAAQ,UAAA;AAAA;AAAA,UAGO,sBAAA;EACf,OAAA,EAAS,UAAA;EACT,MAAA;AAAA;AAAA,iBAGc,gBAAA,CAAiB,KAAA,8BAAmC,sBAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AFSModule } from "@aigne/afs";
|
|
2
|
+
|
|
3
|
+
//#region src/mount-config.d.ts
|
|
4
|
+
interface MountEntry {
|
|
5
|
+
path: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
options?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
interface MountConfig {
|
|
10
|
+
mounts: MountEntry[];
|
|
11
|
+
}
|
|
12
|
+
interface ParseMountConfigResult {
|
|
13
|
+
entries: MountEntry[];
|
|
14
|
+
errors: string[];
|
|
15
|
+
}
|
|
16
|
+
declare function parseMountConfig(input: string | undefined | null): ParseMountConfigResult;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { MountConfig, MountEntry, ParseMountConfigResult, parseMountConfig };
|
|
19
|
+
//# sourceMappingURL=mount-config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-config.d.mts","names":[],"sources":["../src/mount-config.ts"],"mappings":";;;UAEiB,UAAA;EACf,IAAA;EACA,QAAA;EACA,OAAA,GAAU,MAAA;AAAA;AAAA,UAEK,WAAA;EACf,MAAA,EAAQ,UAAA;AAAA;AAAA,UAGO,sBAAA;EACf,OAAA,EAAS,UAAA;EACT,MAAA;AAAA;AAAA,iBAGc,gBAAA,CAAiB,KAAA,8BAAmC,sBAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/mount-config.ts
|
|
2
|
+
function parseMountConfig(input) {
|
|
3
|
+
if (!input || input.trim() === "") return {
|
|
4
|
+
entries: [],
|
|
5
|
+
errors: []
|
|
6
|
+
};
|
|
7
|
+
let parsed;
|
|
8
|
+
try {
|
|
9
|
+
parsed = JSON.parse(input);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return {
|
|
12
|
+
entries: [],
|
|
13
|
+
errors: [`Invalid JSON: ${e instanceof Error ? e.message : String(e)}`]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {
|
|
17
|
+
entries: [],
|
|
18
|
+
errors: ["Mount config must be a JSON object with a 'mounts' array"]
|
|
19
|
+
};
|
|
20
|
+
const obj = parsed;
|
|
21
|
+
if (!Array.isArray(obj.mounts)) return {
|
|
22
|
+
entries: [],
|
|
23
|
+
errors: ["Mount config must have a 'mounts' array"]
|
|
24
|
+
};
|
|
25
|
+
const entries = [];
|
|
26
|
+
const errors = [];
|
|
27
|
+
for (let i = 0; i < obj.mounts.length; i++) {
|
|
28
|
+
const entry = obj.mounts[i];
|
|
29
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
30
|
+
errors.push(`mounts[${i}]: must be an object`);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const e = entry;
|
|
34
|
+
if (typeof e.path !== "string" || e.path.trim() === "") {
|
|
35
|
+
errors.push(`mounts[${i}]: 'path' must be a non-empty string`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (typeof e.provider !== "string" || e.provider.trim() === "") {
|
|
39
|
+
errors.push(`mounts[${i}]: 'provider' must be a non-empty string`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (e.path.includes("..")) {
|
|
43
|
+
errors.push(`mounts[${i}]: path must not contain '..'`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const normalizedPath = e.path.startsWith("/") ? e.path : `/${e.path}`;
|
|
47
|
+
entries.push({
|
|
48
|
+
path: normalizedPath,
|
|
49
|
+
provider: e.provider.trim(),
|
|
50
|
+
options: typeof e.options === "object" && e.options !== null && !Array.isArray(e.options) ? e.options : {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
entries,
|
|
55
|
+
errors
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { parseMountConfig };
|
|
61
|
+
//# sourceMappingURL=mount-config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-config.mjs","names":[],"sources":["../src/mount-config.ts"],"sourcesContent":["import type { AFSModule } from \"@aigne/afs\";\n\nexport interface MountEntry {\n path: string;\n provider: string;\n options?: Record<string, unknown>;\n}\nexport interface MountConfig {\n mounts: MountEntry[];\n}\nexport type ProviderFactory = (entry: MountEntry) => AFSModule | Promise<AFSModule>;\nexport interface ParseMountConfigResult {\n entries: MountEntry[];\n errors: string[];\n}\n\nexport function parseMountConfig(input: string | undefined | null): ParseMountConfigResult {\n if (!input || input.trim() === \"\") return { entries: [], errors: [] };\n let parsed: unknown;\n try {\n parsed = JSON.parse(input);\n } catch (e) {\n return { entries: [], errors: [`Invalid JSON: ${e instanceof Error ? e.message : String(e)}`] };\n }\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed))\n return { entries: [], errors: [\"Mount config must be a JSON object with a 'mounts' array\"] };\n const obj = parsed as Record<string, unknown>;\n if (!Array.isArray(obj.mounts))\n return { entries: [], errors: [\"Mount config must have a 'mounts' array\"] };\n const entries: MountEntry[] = [];\n const errors: string[] = [];\n for (let i = 0; i < obj.mounts.length; i++) {\n const entry = obj.mounts[i];\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n errors.push(`mounts[${i}]: must be an object`);\n continue;\n }\n const e = entry as Record<string, unknown>;\n if (typeof e.path !== \"string\" || (e.path as string).trim() === \"\") {\n errors.push(`mounts[${i}]: 'path' must be a non-empty string`);\n continue;\n }\n if (typeof e.provider !== \"string\" || (e.provider as string).trim() === \"\") {\n errors.push(`mounts[${i}]: 'provider' must be a non-empty string`);\n continue;\n }\n if ((e.path as string).includes(\"..\")) {\n errors.push(`mounts[${i}]: path must not contain '..'`);\n continue;\n }\n const normalizedPath = (e.path as string).startsWith(\"/\") ? (e.path as string) : `/${e.path}`;\n entries.push({\n path: normalizedPath,\n provider: (e.provider as string).trim(),\n options: (typeof e.options === \"object\" && e.options !== null && !Array.isArray(e.options)\n ? e.options\n : {}) as Record<string, unknown>,\n });\n }\n return { entries, errors };\n}\n"],"mappings":";AAgBA,SAAgB,iBAAiB,OAA0D;AACzF,KAAI,CAAC,SAAS,MAAM,MAAM,KAAK,GAAI,QAAO;EAAE,SAAS,EAAE;EAAE,QAAQ,EAAE;EAAE;CACrE,IAAI;AACJ,KAAI;AACF,WAAS,KAAK,MAAM,MAAM;UACnB,GAAG;AACV,SAAO;GAAE,SAAS,EAAE;GAAE,QAAQ,CAAC,iBAAiB,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE,GAAG;GAAE;;AAEjG,KAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,OAAO,CACxE,QAAO;EAAE,SAAS,EAAE;EAAE,QAAQ,CAAC,2DAA2D;EAAE;CAC9F,MAAM,MAAM;AACZ,KAAI,CAAC,MAAM,QAAQ,IAAI,OAAO,CAC5B,QAAO;EAAE,SAAS,EAAE;EAAE,QAAQ,CAAC,0CAA0C;EAAE;CAC7E,MAAM,UAAwB,EAAE;CAChC,MAAM,SAAmB,EAAE;AAC3B,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,OAAO,QAAQ,KAAK;EAC1C,MAAM,QAAQ,IAAI,OAAO;AACzB,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,MAAM,EAAE;AACvE,UAAO,KAAK,UAAU,EAAE,sBAAsB;AAC9C;;EAEF,MAAM,IAAI;AACV,MAAI,OAAO,EAAE,SAAS,YAAa,EAAE,KAAgB,MAAM,KAAK,IAAI;AAClE,UAAO,KAAK,UAAU,EAAE,sCAAsC;AAC9D;;AAEF,MAAI,OAAO,EAAE,aAAa,YAAa,EAAE,SAAoB,MAAM,KAAK,IAAI;AAC1E,UAAO,KAAK,UAAU,EAAE,0CAA0C;AAClE;;AAEF,MAAK,EAAE,KAAgB,SAAS,KAAK,EAAE;AACrC,UAAO,KAAK,UAAU,EAAE,+BAA+B;AACvD;;EAEF,MAAM,iBAAkB,EAAE,KAAgB,WAAW,IAAI,GAAI,EAAE,OAAkB,IAAI,EAAE;AACvF,UAAQ,KAAK;GACX,MAAM;GACN,UAAW,EAAE,SAAoB,MAAM;GACvC,SAAU,OAAO,EAAE,YAAY,YAAY,EAAE,YAAY,QAAQ,CAAC,MAAM,QAAQ,EAAE,QAAQ,GACtF,EAAE,UACF,EAAE;GACP,CAAC;;AAEJ,QAAO;EAAE;EAAS;EAAQ"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
let ufo = require("ufo");
|
|
2
|
+
let _aigne_afs = require("@aigne/afs");
|
|
3
|
+
|
|
4
|
+
//#region src/projectors/aup-projector.ts
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*
|
|
8
|
+
* AUP `ResourceProjector` — projects an opaque `AFSModule` of `aup/**.json`
|
|
9
|
+
* recipes onto a target mount as hidden `AupRecipeProvider` supplements.
|
|
10
|
+
*
|
|
11
|
+
* Runtime-neutral: the projector only uses AFS APIs and knows nothing about
|
|
12
|
+
* Node fs, Cloudflare bindings, or any other runtime-specific surface. The
|
|
13
|
+
* `resources` module is opaque — Node's adapter wraps a packageDir via
|
|
14
|
+
* `AFSFS`, Cloudflare's adapter wraps a build-time bundled asset map, and
|
|
15
|
+
* tests can wrap any in-memory `AFSModule`.
|
|
16
|
+
*
|
|
17
|
+
* Subpath-only export: `@aigne/aos/projectors`. Not part of the @aigne/aos
|
|
18
|
+
* root contract. Cross-plan contract: chain-as-device-placement Phase 4
|
|
19
|
+
* imports `projectAupResources` directly.
|
|
20
|
+
*/
|
|
21
|
+
const randomUUID = () => globalThis.crypto.randomUUID();
|
|
22
|
+
/**
|
|
23
|
+
* 1 MiB safety cap for a single recipe file. Anything larger almost
|
|
24
|
+
* certainly represents a misconfiguration (e.g. a bundled asset landed in
|
|
25
|
+
* `aup/`) and would balloon every mount's memory footprint.
|
|
26
|
+
*
|
|
27
|
+
* **Failure semantics:** oversized files and malformed JSON are surfaced as
|
|
28
|
+
* `AFSValidationError` (not silent skip). This matches the legacy
|
|
29
|
+
* `autoSupplementAup` contract — fail-fast over partial recipes is the
|
|
30
|
+
* right default because supplements that are missing in production are
|
|
31
|
+
* confusing for users and noisy in logs. The planning doc tasks.md table
|
|
32
|
+
* mentions "skip + log"; the legacy implementation has always thrown, all
|
|
33
|
+
* pre-existing integration tests assert throwing, and this projector
|
|
34
|
+
* preserves that behaviour. If a future phase wants per-file isolation
|
|
35
|
+
* the policy can be lifted to a projector option.
|
|
36
|
+
*/
|
|
37
|
+
const MAX_RECIPE_BYTES = 1024 * 1024;
|
|
38
|
+
/** Bounded recursion depth for listing aup/ — enough for any realistic layout. */
|
|
39
|
+
const MAX_LIST_DEPTH = 100;
|
|
40
|
+
/** Hidden temp mount root for opaque resources modules. Dot-less to remain
|
|
41
|
+
* compatible with any future blocklet rules that reject dot-prefixed segments. */
|
|
42
|
+
const TMP_MOUNT_ROOT = "/materialize-tmp";
|
|
43
|
+
/** Supplement sub-path under each target (e.g. `/fix` → `/fix/.aup/default`). */
|
|
44
|
+
const AUP_SUBPATH = ".aup";
|
|
45
|
+
/** Top-level directory inside the resources module that holds recipe JSON. */
|
|
46
|
+
const AUP_RESOURCE_ROOT = "/aup";
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
* AUP projector singleton — the first-class abstraction.
|
|
50
|
+
*/
|
|
51
|
+
const aupResourceProjector = {
|
|
52
|
+
kind: "aup",
|
|
53
|
+
async project({ afs, mountPath, resources, scope }) {
|
|
54
|
+
await projectAupResources({
|
|
55
|
+
afs,
|
|
56
|
+
mountPath,
|
|
57
|
+
resources,
|
|
58
|
+
scope
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
* Thin wrapper exposing the same behaviour as
|
|
65
|
+
* {@link aupResourceProjector}.project — kept as a stable function reference
|
|
66
|
+
* for the chain-as-device-placement plan, which imports this name directly.
|
|
67
|
+
*/
|
|
68
|
+
async function projectAupResources(opts) {
|
|
69
|
+
opts.scope;
|
|
70
|
+
const tempMountPath = (0, ufo.joinURL)(TMP_MOUNT_ROOT, randomUUID());
|
|
71
|
+
try {
|
|
72
|
+
await opts.afs.mount(opts.resources, tempMountPath, { hidden: true });
|
|
73
|
+
} catch (err) {
|
|
74
|
+
if (isNotFoundError(err)) return;
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
await projectAupFromAfsPath({
|
|
79
|
+
afs: opts.afs,
|
|
80
|
+
scanRoot: (0, ufo.joinURL)(tempMountPath, AUP_RESOURCE_ROOT),
|
|
81
|
+
mountTarget: opts.mountPath
|
|
82
|
+
});
|
|
83
|
+
} finally {
|
|
84
|
+
opts.afs.unmount(tempMountPath);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
* Scan an existing AFS path for `*.json` recipe files and mount each one as
|
|
90
|
+
* a hidden `AupRecipeProvider` supplement under `{mountTarget}`.
|
|
91
|
+
*
|
|
92
|
+
* Used both by `projectAupResources` (after temp-mounting an opaque
|
|
93
|
+
* resources module) and by Node's `autoSupplementAup` virtual-path flow
|
|
94
|
+
* (which already has a live AFS path to scan).
|
|
95
|
+
*
|
|
96
|
+
* Missing `scanRoot` → silent no-op, mirroring the original loader contract.
|
|
97
|
+
*/
|
|
98
|
+
async function projectAupFromAfsPath(opts) {
|
|
99
|
+
let listResult;
|
|
100
|
+
try {
|
|
101
|
+
listResult = await opts.afs.list(opts.scanRoot, { maxDepth: MAX_LIST_DEPTH });
|
|
102
|
+
} catch (err) {
|
|
103
|
+
if (isNotFoundError(err)) return;
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
const jsonFiles = (listResult.data ?? []).filter(isJsonFileEntry).sort((a, b) => (a.path ?? "").localeCompare(b.path ?? ""));
|
|
107
|
+
for (const file of jsonFiles) {
|
|
108
|
+
const relPath = file.path.slice(opts.scanRoot.length);
|
|
109
|
+
const { prefix, viewName } = parseAupFilePath(relPath);
|
|
110
|
+
const declaredSize = file.meta?.size;
|
|
111
|
+
if (typeof declaredSize === "number" && declaredSize > MAX_RECIPE_BYTES) throw new _aigne_afs.AFSValidationError(`AUP recipe file too large (> ${MAX_RECIPE_BYTES} bytes): ${relPath}`);
|
|
112
|
+
const raw = (await opts.afs.read(file.path)).data?.content;
|
|
113
|
+
const text = typeof raw === "string" ? raw : new TextDecoder().decode(raw);
|
|
114
|
+
if (text.length > MAX_RECIPE_BYTES) throw new _aigne_afs.AFSValidationError(`AUP recipe file too large (> ${MAX_RECIPE_BYTES} bytes): ${relPath}`);
|
|
115
|
+
let recipe;
|
|
116
|
+
try {
|
|
117
|
+
recipe = JSON.parse(text);
|
|
118
|
+
} catch (err) {
|
|
119
|
+
throw new _aigne_afs.AFSValidationError(`Failed to parse AUP recipe ${relPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
120
|
+
}
|
|
121
|
+
const supplementPath = (0, ufo.joinURL)(opts.mountTarget, prefix, AUP_SUBPATH, viewName);
|
|
122
|
+
await opts.afs.mount(new _aigne_afs.AupRecipeProvider(recipe), supplementPath, { hidden: true });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
* Translate `aup/` placeholder syntax to AFS mount `:param` syntax within a
|
|
128
|
+
* single path segment. An `_<name>` token becomes `:<name>` ONLY when the `_`
|
|
129
|
+
* sits at the start of the segment or directly after a non-alphanumeric
|
|
130
|
+
* separator (e.g. `-`). An underscore surrounded by alphanumerics (`my_dir`)
|
|
131
|
+
* is left literal, so ordinary directory names with underscores are safe.
|
|
132
|
+
*
|
|
133
|
+
* ```
|
|
134
|
+
* _date → :date (segment-leading)
|
|
135
|
+
* round-_n → round-:n (after a `-` separator — mixed segment)
|
|
136
|
+
* my_dir → my_dir (alphanumeric-bounded `_` — unchanged)
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* Disambiguation convention (design.md §3.2): inside `aup/`, an `_<name>`
|
|
140
|
+
* token in this position is a parameter segment.
|
|
141
|
+
*/
|
|
142
|
+
function translateParamSegment(segment) {
|
|
143
|
+
return segment.replace(/(^|[^a-zA-Z0-9])_([a-zA-Z][a-zA-Z0-9]*)/g, "$1:$2");
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
* Parse a relative path inside an `aup/` directory into the mount-path
|
|
148
|
+
* components the supplement will occupy. Prefix segments are translated from
|
|
149
|
+
* `_param` placeholder syntax to `:param` mount syntax (see
|
|
150
|
+
* {@link translateParamSegment}); the view name is never translated.
|
|
151
|
+
*
|
|
152
|
+
* ```
|
|
153
|
+
* /default.json → { prefix: "", viewName: "default" }
|
|
154
|
+
* /transactions/item.json → { prefix: "/transactions", viewName: "item" }
|
|
155
|
+
* /a/b/c/view.json → { prefix: "/a/b/c", viewName: "view" }
|
|
156
|
+
* /bridges/_addr/blocks/item.json→ { prefix: "/bridges/:addr/blocks", viewName: "item" }
|
|
157
|
+
* /traces/_date/_runId/item.json → { prefix: "/traces/:date/:runId", viewName: "item" }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
function parseAupFilePath(relPath) {
|
|
161
|
+
if (!relPath || relPath.trim() === "") throw new Error("parseAupFilePath: path is empty");
|
|
162
|
+
const normalized = (relPath.startsWith("/") ? relPath : `/${relPath}`).replace(/\/+/g, "/").replace(/\/+$/, "");
|
|
163
|
+
if (!normalized.endsWith(".json")) throw new Error(`parseAupFilePath: file must end with .json, got "${relPath}"`);
|
|
164
|
+
const segments = normalized.split("/").filter(Boolean);
|
|
165
|
+
if (segments.some((s) => s === "..")) throw new Error(`parseAupFilePath: path traversal not allowed: "${relPath}"`);
|
|
166
|
+
const viewName = segments.pop().slice(0, -5);
|
|
167
|
+
if (!viewName) throw new Error(`parseAupFilePath: view name is empty for "${relPath}"`);
|
|
168
|
+
return {
|
|
169
|
+
prefix: segments.length === 0 ? "" : `/${segments.map(translateParamSegment).join("/")}`,
|
|
170
|
+
viewName
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function isJsonFileEntry(entry) {
|
|
174
|
+
if (!entry.path?.endsWith(".json")) return false;
|
|
175
|
+
return entry.meta?.kind !== "fs:directory";
|
|
176
|
+
}
|
|
177
|
+
function isNotFoundError(err) {
|
|
178
|
+
if (err instanceof _aigne_afs.AFSNotFoundError) return true;
|
|
179
|
+
if (err instanceof Error) {
|
|
180
|
+
if (err.code === "ENOENT") return true;
|
|
181
|
+
if (/ENOENT|no such file or directory|not found/i.test(err.message)) return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//#endregion
|
|
187
|
+
exports.aupResourceProjector = aupResourceProjector;
|
|
188
|
+
exports.parseAupFilePath = parseAupFilePath;
|
|
189
|
+
exports.projectAupFromAfsPath = projectAupFromAfsPath;
|
|
190
|
+
exports.projectAupResources = projectAupResources;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ResourceProjector } from "../mount/types.cjs";
|
|
2
|
+
import { AFS, AFSModule } from "@aigne/afs";
|
|
3
|
+
|
|
4
|
+
//#region src/projectors/aup-projector.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* AUP projector singleton — the first-class abstraction.
|
|
8
|
+
*/
|
|
9
|
+
declare const aupResourceProjector: ResourceProjector;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* Thin wrapper exposing the same behaviour as
|
|
13
|
+
* {@link aupResourceProjector}.project — kept as a stable function reference
|
|
14
|
+
* for the chain-as-device-placement plan, which imports this name directly.
|
|
15
|
+
*/
|
|
16
|
+
declare function projectAupResources(opts: {
|
|
17
|
+
afs: AFS;
|
|
18
|
+
mountPath: string;
|
|
19
|
+
resources: AFSModule;
|
|
20
|
+
scope?: "host" | "blocklet" | "instance";
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* Scan an existing AFS path for `*.json` recipe files and mount each one as
|
|
25
|
+
* a hidden `AupRecipeProvider` supplement under `{mountTarget}`.
|
|
26
|
+
*
|
|
27
|
+
* Used both by `projectAupResources` (after temp-mounting an opaque
|
|
28
|
+
* resources module) and by Node's `autoSupplementAup` virtual-path flow
|
|
29
|
+
* (which already has a live AFS path to scan).
|
|
30
|
+
*
|
|
31
|
+
* Missing `scanRoot` → silent no-op, mirroring the original loader contract.
|
|
32
|
+
*/
|
|
33
|
+
declare function projectAupFromAfsPath(opts: {
|
|
34
|
+
afs: AFS;
|
|
35
|
+
scanRoot: string;
|
|
36
|
+
mountTarget: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* Parse a relative path inside an `aup/` directory into the mount-path
|
|
41
|
+
* components the supplement will occupy. Prefix segments are translated from
|
|
42
|
+
* `_param` placeholder syntax to `:param` mount syntax (see
|
|
43
|
+
* {@link translateParamSegment}); the view name is never translated.
|
|
44
|
+
*
|
|
45
|
+
* ```
|
|
46
|
+
* /default.json → { prefix: "", viewName: "default" }
|
|
47
|
+
* /transactions/item.json → { prefix: "/transactions", viewName: "item" }
|
|
48
|
+
* /a/b/c/view.json → { prefix: "/a/b/c", viewName: "view" }
|
|
49
|
+
* /bridges/_addr/blocks/item.json→ { prefix: "/bridges/:addr/blocks", viewName: "item" }
|
|
50
|
+
* /traces/_date/_runId/item.json → { prefix: "/traces/:date/:runId", viewName: "item" }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function parseAupFilePath(relPath: string): {
|
|
54
|
+
prefix: string;
|
|
55
|
+
viewName: string;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { aupResourceProjector, parseAupFilePath, projectAupFromAfsPath, projectAupResources };
|
|
59
|
+
//# sourceMappingURL=aup-projector.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aup-projector.d.cts","names":[],"sources":["../../src/projectors/aup-projector.ts"],"mappings":";;;;;;;;cAqEa,oBAAA,EAAsB,iBAAA;;;;;AA4DnC;;iBA/CsB,mBAAA,CAAoB,IAAA;EACxC,GAAA,EAAK,GAAA;EACL,SAAA;EACA,SAAA,EAAW,SAAA;EACX,KAAA;AAAA,IACE,OAAA;;;;;AA0IJ;;;;;;;iBAhGsB,qBAAA,CAAsB,IAAA;EAC1C,GAAA,EAAK,GAAA;EACL,QAAA;EACA,WAAA;AAAA,IACE,OAAA;;;;;;;;;;;;;;;;iBA4FY,gBAAA,CAAiB,OAAA;EAAoB,MAAA;EAAgB,QAAA;AAAA"}
|