@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,102 @@
|
|
|
1
|
+
import { materializeProviderMount, redactError } from "../mount/materializer.mjs";
|
|
2
|
+
import { aupResourceProjector } from "../projectors/aup-projector.mjs";
|
|
3
|
+
import { SYSTEM_MOUNTS } from "./lists.mjs";
|
|
4
|
+
import { validateDescriptor } from "./validate.mjs";
|
|
5
|
+
import { time } from "@aigne/afs-timing";
|
|
6
|
+
|
|
7
|
+
//#region src/system-mounts/install.ts
|
|
8
|
+
function hasMount(afs, path) {
|
|
9
|
+
const getMounts = afs.getMounts;
|
|
10
|
+
if (typeof getMounts !== "function") return false;
|
|
11
|
+
return getMounts.call(afs).some((m) => m.path === path);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Per-descriptor Server-Timing key so cold-start cost is attributable to a
|
|
15
|
+
* single system device (`mnt.dev.chain`, `mnt.dev.ai`, …) instead of hiding
|
|
16
|
+
* inside the aggregate `op.prov`. Slashes → dots to keep the metric name a
|
|
17
|
+
* valid Server-Timing token. Diagnostic only — `time()` is a no-op when no
|
|
18
|
+
* TimingCollector is active on the ALS.
|
|
19
|
+
*/
|
|
20
|
+
const mntKey = (path) => `mnt${path.replace(/\//g, ".")}`;
|
|
21
|
+
/**
|
|
22
|
+
* Install the system mounts described by `descriptors` (defaults to the
|
|
23
|
+
* shared {@link SYSTEM_MOUNTS}) onto `afs`.
|
|
24
|
+
*
|
|
25
|
+
* Per descriptor, in `order`:
|
|
26
|
+
* 1. {@link validateDescriptor} — invalid → skip + warning (path/`..`/proto
|
|
27
|
+
* pollution caught here, reusing the Phase 0 guard).
|
|
28
|
+
* 2. `conditional(ctx) === false` → skip.
|
|
29
|
+
* 3. `install` present → call it (composite hatch owns its own mounts +
|
|
30
|
+
* idempotency + degradation). A throw propagates — chain config errors
|
|
31
|
+
* stay fatal, matching the legacy daemon. Other hatches catch internally.
|
|
32
|
+
* 4. else `registry[providerKey]` absent → skip (this is how CF gets a
|
|
33
|
+
* subset without a control-flow fork).
|
|
34
|
+
* 5. else already mounted → skip (idempotent).
|
|
35
|
+
* 6. else `materializeProviderMount` with the AUP projector. A materialize
|
|
36
|
+
* failure degrades to a warning (matches legacy ash/agent/index, which
|
|
37
|
+
* were individually non-fatal).
|
|
38
|
+
*/
|
|
39
|
+
async function installSystemMounts(afs, registry, ctx, descriptors = SYSTEM_MOUNTS) {
|
|
40
|
+
const mounted = [];
|
|
41
|
+
const skipped = [];
|
|
42
|
+
const warnings = [];
|
|
43
|
+
const ordered = [...descriptors].sort((a, b) => a.order - b.order);
|
|
44
|
+
for (const descriptor of ordered) {
|
|
45
|
+
const validation = validateDescriptor(descriptor);
|
|
46
|
+
if (!validation.ok) {
|
|
47
|
+
const label = descriptor?.path ?? "<unknown>";
|
|
48
|
+
warnings.push(`${label}: invalid descriptor — ${validation.errors.join("; ")}`);
|
|
49
|
+
skipped.push(String(label));
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (descriptor.install) {
|
|
53
|
+
const outcome = await time(mntKey(descriptor.path), () => descriptor.install(afs, ctx, registry));
|
|
54
|
+
mounted.push(...outcome.mounted);
|
|
55
|
+
warnings.push(...outcome.warnings);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const factory = registry[descriptor.providerKey];
|
|
59
|
+
if (!factory) {
|
|
60
|
+
skipped.push(descriptor.path);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (descriptor.conditional && !descriptor.conditional(ctx)) {
|
|
64
|
+
skipped.push(descriptor.path);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (hasMount(afs, descriptor.path)) {
|
|
68
|
+
skipped.push(descriptor.path);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const options = typeof descriptor.options === "function" ? descriptor.options(ctx) : descriptor.options;
|
|
72
|
+
try {
|
|
73
|
+
await time(mntKey(descriptor.path), () => materializeProviderMount({
|
|
74
|
+
afs,
|
|
75
|
+
mountPath: descriptor.path,
|
|
76
|
+
definition: {
|
|
77
|
+
uri: `${descriptor.providerKey}://system${descriptor.path}`,
|
|
78
|
+
type: descriptor.providerKey,
|
|
79
|
+
...options !== void 0 ? { options } : {}
|
|
80
|
+
},
|
|
81
|
+
factory,
|
|
82
|
+
projectors: [aupResourceProjector],
|
|
83
|
+
scope: "host",
|
|
84
|
+
...descriptor.mountOptions ? { mountOptions: descriptor.mountOptions } : {},
|
|
85
|
+
projectionFailure: descriptor.projectionFailure ?? "warn"
|
|
86
|
+
}));
|
|
87
|
+
mounted.push(descriptor.path);
|
|
88
|
+
} catch (err) {
|
|
89
|
+
warnings.push(`${descriptor.path}: mount failed — ${redactError(err)}`);
|
|
90
|
+
skipped.push(descriptor.path);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
mounted,
|
|
95
|
+
skipped,
|
|
96
|
+
warnings
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { installSystemMounts };
|
|
102
|
+
//# sourceMappingURL=install.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.mjs","names":[],"sources":["../../src/system-mounts/install.ts"],"sourcesContent":["/**\n * `installSystemMounts` — the single shared driver every runtime calls to\n * install its host system mounts (axis A). Replaces the per-runtime\n * hand-written orchestration (Node's 7 `setupSystem*` functions, CF's inline\n * `if` blocks) with one ordered pass over {@link SYSTEM_MOUNTS}.\n *\n * Divergence between runtimes is expressed purely as data: a runtime passes\n * a `registry` (providerKey → factory) containing only the keys it can\n * build/run. A descriptor whose `providerKey` is absent (or whose `install`\n * hatch needs an absent key) is skipped — no control-flow fork.\n *\n * See `planning/system-mount-runtime-parity/design.md` §4 / §4.1.\n */\n\nimport type { AFS, AFSRoot } from \"@aigne/afs\";\nimport { time } from \"@aigne/afs-timing\";\nimport { materializeProviderMount, type ProviderFactory, redactError } from \"../mount/index.js\";\nimport { aupResourceProjector } from \"../projectors/index.js\";\nimport { SYSTEM_MOUNTS } from \"./lists.js\";\nimport type { SystemMountContext, SystemMountDescriptor } from \"./types.js\";\nimport { validateDescriptor } from \"./validate.js\";\n\n/** Aggregate result of an {@link installSystemMounts} run. */\nexport interface InstallSystemMountsResult {\n /** Every path actually mounted (across default + install-hatch entries). */\n mounted: string[];\n /** Descriptor paths that were intentionally skipped (missing key, conditional, invalid). */\n skipped: string[];\n /** Non-fatal failures, prefixed with the offending path. */\n warnings: string[];\n}\n\nfunction hasMount(afs: AFSRoot, path: string): boolean {\n const getMounts = (afs as unknown as AFS).getMounts;\n if (typeof getMounts !== \"function\") return false;\n return getMounts.call(afs).some((m: { path: string }) => m.path === path);\n}\n\n/**\n * Per-descriptor Server-Timing key so cold-start cost is attributable to a\n * single system device (`mnt.dev.chain`, `mnt.dev.ai`, …) instead of hiding\n * inside the aggregate `op.prov`. Slashes → dots to keep the metric name a\n * valid Server-Timing token. Diagnostic only — `time()` is a no-op when no\n * TimingCollector is active on the ALS.\n */\nconst mntKey = (path: string): string => `mnt${path.replace(/\\//g, \".\")}`;\n\n/**\n * Install the system mounts described by `descriptors` (defaults to the\n * shared {@link SYSTEM_MOUNTS}) onto `afs`.\n *\n * Per descriptor, in `order`:\n * 1. {@link validateDescriptor} — invalid → skip + warning (path/`..`/proto\n * pollution caught here, reusing the Phase 0 guard).\n * 2. `conditional(ctx) === false` → skip.\n * 3. `install` present → call it (composite hatch owns its own mounts +\n * idempotency + degradation). A throw propagates — chain config errors\n * stay fatal, matching the legacy daemon. Other hatches catch internally.\n * 4. else `registry[providerKey]` absent → skip (this is how CF gets a\n * subset without a control-flow fork).\n * 5. else already mounted → skip (idempotent).\n * 6. else `materializeProviderMount` with the AUP projector. A materialize\n * failure degrades to a warning (matches legacy ash/agent/index, which\n * were individually non-fatal).\n */\nexport async function installSystemMounts(\n afs: AFSRoot,\n registry: Record<string, ProviderFactory>,\n ctx: SystemMountContext,\n descriptors: readonly SystemMountDescriptor[] = SYSTEM_MOUNTS,\n): Promise<InstallSystemMountsResult> {\n const mounted: string[] = [];\n const skipped: string[] = [];\n const warnings: string[] = [];\n\n // Copy before sort — never mutate the frozen shared list.\n const ordered = [...descriptors].sort((a, b) => a.order - b.order);\n\n for (const descriptor of ordered) {\n const validation = validateDescriptor(descriptor);\n if (!validation.ok) {\n const label = (descriptor as Partial<SystemMountDescriptor>)?.path ?? \"<unknown>\";\n warnings.push(`${label}: invalid descriptor — ${validation.errors.join(\"; \")}`);\n skipped.push(String(label));\n continue;\n }\n\n // Decision order mirrors design.md §4: install hatch → registry-miss →\n // conditional → materialize. `install` takes precedence (composite hatch\n // owns its own construction + idempotency + degradation); a throw is fatal\n // by design (chain config validation), so we do NOT swallow it.\n if (descriptor.install) {\n const outcome = await time(mntKey(descriptor.path), () =>\n descriptor.install!(afs, ctx, registry),\n );\n mounted.push(...outcome.mounted);\n warnings.push(...outcome.warnings);\n continue;\n }\n\n const factory = registry[descriptor.providerKey as string];\n if (!factory) {\n // Subset semantics: the runtime can't build this provider. Not an error.\n skipped.push(descriptor.path);\n continue;\n }\n\n if (descriptor.conditional && !descriptor.conditional(ctx)) {\n skipped.push(descriptor.path);\n continue;\n }\n\n if (hasMount(afs, descriptor.path)) {\n skipped.push(descriptor.path);\n continue;\n }\n\n const options =\n typeof descriptor.options === \"function\" ? descriptor.options(ctx) : descriptor.options;\n\n try {\n await time(mntKey(descriptor.path), () =>\n materializeProviderMount({\n afs: afs as unknown as AFS,\n mountPath: descriptor.path,\n definition: {\n // URI is informational (error messages); the factory constructs\n // the provider from `options`.\n uri: `${descriptor.providerKey}://system${descriptor.path}`,\n type: descriptor.providerKey as string,\n ...(options !== undefined ? { options } : {}),\n },\n factory,\n projectors: [aupResourceProjector],\n scope: \"host\",\n ...(descriptor.mountOptions ? { mountOptions: descriptor.mountOptions } : {}),\n projectionFailure: descriptor.projectionFailure ?? \"warn\",\n }),\n );\n mounted.push(descriptor.path);\n } catch (err) {\n warnings.push(`${descriptor.path}: mount failed — ${redactError(err)}`);\n skipped.push(descriptor.path);\n }\n }\n\n return { mounted, skipped, warnings };\n}\n"],"mappings":";;;;;;;AAgCA,SAAS,SAAS,KAAc,MAAuB;CACrD,MAAM,YAAa,IAAuB;AAC1C,KAAI,OAAO,cAAc,WAAY,QAAO;AAC5C,QAAO,UAAU,KAAK,IAAI,CAAC,MAAM,MAAwB,EAAE,SAAS,KAAK;;;;;;;;;AAU3E,MAAM,UAAU,SAAyB,MAAM,KAAK,QAAQ,OAAO,IAAI;;;;;;;;;;;;;;;;;;;AAoBvE,eAAsB,oBACpB,KACA,UACA,KACA,cAAgD,eACZ;CACpC,MAAM,UAAoB,EAAE;CAC5B,MAAM,UAAoB,EAAE;CAC5B,MAAM,WAAqB,EAAE;CAG7B,MAAM,UAAU,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAElE,MAAK,MAAM,cAAc,SAAS;EAChC,MAAM,aAAa,mBAAmB,WAAW;AACjD,MAAI,CAAC,WAAW,IAAI;GAClB,MAAM,QAAS,YAA+C,QAAQ;AACtE,YAAS,KAAK,GAAG,MAAM,yBAAyB,WAAW,OAAO,KAAK,KAAK,GAAG;AAC/E,WAAQ,KAAK,OAAO,MAAM,CAAC;AAC3B;;AAOF,MAAI,WAAW,SAAS;GACtB,MAAM,UAAU,MAAM,KAAK,OAAO,WAAW,KAAK,QAChD,WAAW,QAAS,KAAK,KAAK,SAAS,CACxC;AACD,WAAQ,KAAK,GAAG,QAAQ,QAAQ;AAChC,YAAS,KAAK,GAAG,QAAQ,SAAS;AAClC;;EAGF,MAAM,UAAU,SAAS,WAAW;AACpC,MAAI,CAAC,SAAS;AAEZ,WAAQ,KAAK,WAAW,KAAK;AAC7B;;AAGF,MAAI,WAAW,eAAe,CAAC,WAAW,YAAY,IAAI,EAAE;AAC1D,WAAQ,KAAK,WAAW,KAAK;AAC7B;;AAGF,MAAI,SAAS,KAAK,WAAW,KAAK,EAAE;AAClC,WAAQ,KAAK,WAAW,KAAK;AAC7B;;EAGF,MAAM,UACJ,OAAO,WAAW,YAAY,aAAa,WAAW,QAAQ,IAAI,GAAG,WAAW;AAElF,MAAI;AACF,SAAM,KAAK,OAAO,WAAW,KAAK,QAChC,yBAAyB;IAClB;IACL,WAAW,WAAW;IACtB,YAAY;KAGV,KAAK,GAAG,WAAW,YAAY,WAAW,WAAW;KACrD,MAAM,WAAW;KACjB,GAAI,YAAY,SAAY,EAAE,SAAS,GAAG,EAAE;KAC7C;IACD;IACA,YAAY,CAAC,qBAAqB;IAClC,OAAO;IACP,GAAI,WAAW,eAAe,EAAE,cAAc,WAAW,cAAc,GAAG,EAAE;IAC5E,mBAAmB,WAAW,qBAAqB;IACpD,CAAC,CACH;AACD,WAAQ,KAAK,WAAW,KAAK;WACtB,KAAK;AACZ,YAAS,KAAK,GAAG,WAAW,KAAK,mBAAmB,YAAY,IAAI,GAAG;AACvE,WAAQ,KAAK,WAAW,KAAK;;;AAIjC,QAAO;EAAE;EAAS;EAAS;EAAU"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
const require_chain = require('../devices/chain.cjs');
|
|
2
|
+
const require_materializer = require('../mount/materializer.cjs');
|
|
3
|
+
const require_aup_projector = require('../projectors/aup-projector.cjs');
|
|
4
|
+
let ufo = require("ufo");
|
|
5
|
+
let _aigne_afs = require("@aigne/afs");
|
|
6
|
+
let _aigne_afs_timing = require("@aigne/afs-timing");
|
|
7
|
+
|
|
8
|
+
//#region src/system-mounts/installers.ts
|
|
9
|
+
/**
|
|
10
|
+
* Runtime-neutral `install` escape-hatch implementations for the composite
|
|
11
|
+
* entries in {@link SYSTEM_MOUNTS} (design.md §4.1). These orchestrate
|
|
12
|
+
* multi-step mounts that a single `path`+`providerKey` can't express:
|
|
13
|
+
*
|
|
14
|
+
* - {@link aiInstall} — `/dev/ai` device + legacy/compat projections
|
|
15
|
+
* - {@link chainInstall} — `/dev/chain/<network>` per builtin/config network + AUP
|
|
16
|
+
* - {@link deviceInstall} — `/dev/ui`, `/dev/web` projections (conditional on source)
|
|
17
|
+
* - {@link observabilityInstall} — `/dev/observability` (+ optional host-inbox)
|
|
18
|
+
* - {@link messagingInstall} — `/proc/messaging/agents` + `/proc/messaging/tools`
|
|
19
|
+
*
|
|
20
|
+
* Crucial invariant: NONE of these import a runtime-specific module. All
|
|
21
|
+
* provider *construction* is delegated to the `registry` factories the
|
|
22
|
+
* runtime supplies (Node builds disk-backed providers + loads AUP from the
|
|
23
|
+
* package dir; CF builds bundled providers + loads AUP over HTTP). Projection
|
|
24
|
+
* uses `ProjectionProvider` from `@aigne/afs` (runtime-neutral) and AUP
|
|
25
|
+
* companion resources flow through the factory's `resources` field + the
|
|
26
|
+
* materializer's `aupResourceProjector`. So these hatches bundle cleanly into
|
|
27
|
+
* the Cloudflare Worker even when CF's registry omits the keys (the hatch
|
|
28
|
+
* skips that sub-mount).
|
|
29
|
+
*/
|
|
30
|
+
const PROJECTION_OVERLAY = { allowOverlay: true };
|
|
31
|
+
function getMounts(afs) {
|
|
32
|
+
const fn = afs.getMounts;
|
|
33
|
+
return typeof fn === "function" ? fn.call(afs) : [];
|
|
34
|
+
}
|
|
35
|
+
function hasMount(afs, path) {
|
|
36
|
+
return getMounts(afs).some((m) => m.path === path);
|
|
37
|
+
}
|
|
38
|
+
/** Mount a `ProjectionProvider` alias `target → source`, idempotent + tolerant. */
|
|
39
|
+
async function mountProjection(afs, target, source, name, out) {
|
|
40
|
+
if (hasMount(afs, target)) return;
|
|
41
|
+
try {
|
|
42
|
+
await afs.mount(new _aigne_afs.ProjectionProvider({
|
|
43
|
+
name,
|
|
44
|
+
globalAFS: afs,
|
|
45
|
+
sourcePath: source
|
|
46
|
+
}), target, PROJECTION_OVERLAY);
|
|
47
|
+
out.mounted.push(target);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
out.warnings.push(`${target}: projection failed — ${require_materializer.redactError(err)}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const AI_DEVICE = "/dev/ai";
|
|
53
|
+
const AI_HUBS_AIGNEHUB = "/dev/ai/hubs/aignehub";
|
|
54
|
+
const AI_LOCAL_EMBEDDING = "/dev/ai/local/embedding";
|
|
55
|
+
const LEGACY_AIGNEHUB = "/modules/aignehub";
|
|
56
|
+
const LEGACY_EMBEDDING = "/modules/embedding";
|
|
57
|
+
const COMPAT_HUB = "/dev/ai/hub";
|
|
58
|
+
const COMPAT_DEFAULTS = "/dev/ai/defaults";
|
|
59
|
+
const COMPAT_EMBEDDING = "/dev/ai/embedding";
|
|
60
|
+
async function aiInstall(afs, _ctx, registry) {
|
|
61
|
+
const out = {
|
|
62
|
+
mounted: [],
|
|
63
|
+
warnings: []
|
|
64
|
+
};
|
|
65
|
+
if (!hasMount(afs, AI_HUBS_AIGNEHUB)) {
|
|
66
|
+
const legacy = hasMount(afs, LEGACY_AIGNEHUB) ? LEGACY_AIGNEHUB : hasMount(afs, COMPAT_HUB) ? COMPAT_HUB : null;
|
|
67
|
+
if (legacy) await mountProjection(afs, AI_HUBS_AIGNEHUB, legacy, "dev-ai-hubs-aignehub", out);
|
|
68
|
+
}
|
|
69
|
+
if (!hasMount(afs, AI_LOCAL_EMBEDDING) && hasMount(afs, LEGACY_EMBEDDING)) await mountProjection(afs, AI_LOCAL_EMBEDDING, LEGACY_EMBEDDING, "dev-ai-local-embedding", out);
|
|
70
|
+
if (hasMount(afs, AI_HUBS_AIGNEHUB)) {
|
|
71
|
+
await mountProjection(afs, COMPAT_HUB, AI_HUBS_AIGNEHUB, "dev-ai-hub-compat", out);
|
|
72
|
+
await mountProjection(afs, COMPAT_DEFAULTS, (0, ufo.joinURL)(AI_HUBS_AIGNEHUB, "defaults"), "dev-ai-defaults-compat", out);
|
|
73
|
+
}
|
|
74
|
+
if (hasMount(afs, AI_LOCAL_EMBEDDING)) await mountProjection(afs, COMPAT_EMBEDDING, AI_LOCAL_EMBEDDING, "dev-ai-embedding-compat", out);
|
|
75
|
+
if (!hasMount(afs, AI_DEVICE)) {
|
|
76
|
+
const factory = registry["ai-device"];
|
|
77
|
+
if (factory) try {
|
|
78
|
+
const options = { globalAFS: afs };
|
|
79
|
+
if (hasMount(afs, "/user")) options.userSpaceRoot = "/user";
|
|
80
|
+
const { provider } = await factory.create({
|
|
81
|
+
uri: `ai-device://system${AI_DEVICE}`,
|
|
82
|
+
type: "ai-device",
|
|
83
|
+
options
|
|
84
|
+
});
|
|
85
|
+
await afs.mount(provider, AI_DEVICE, PROJECTION_OVERLAY);
|
|
86
|
+
out.mounted.push(AI_DEVICE);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
out.warnings.push(`${AI_DEVICE}: mount failed — ${require_materializer.redactError(err)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
async function chainInstall(afs, ctx, registry) {
|
|
94
|
+
const out = {
|
|
95
|
+
mounted: [],
|
|
96
|
+
warnings: []
|
|
97
|
+
};
|
|
98
|
+
const configs = ctx.chainConfigs;
|
|
99
|
+
const cfgs = [...configs && configs.length > 0 ? configs : require_chain.BUILTIN_CHAIN_NETWORKS];
|
|
100
|
+
require_chain.validateChainNetworks(cfgs);
|
|
101
|
+
const factory = registry["ocap"];
|
|
102
|
+
if (!factory) return out;
|
|
103
|
+
for (const cfg of cfgs) {
|
|
104
|
+
const path = require_chain.chainNetworkToMountEntry(cfg).path;
|
|
105
|
+
if (hasMount(afs, path)) continue;
|
|
106
|
+
try {
|
|
107
|
+
await (0, _aigne_afs_timing.time)(`mnt.dev.chain.${cfg.network}`, () => require_materializer.materializeProviderMount({
|
|
108
|
+
afs,
|
|
109
|
+
mountPath: path,
|
|
110
|
+
definition: {
|
|
111
|
+
uri: `ocap://system${path}`,
|
|
112
|
+
type: "ocap",
|
|
113
|
+
options: {
|
|
114
|
+
endpoint: cfg.endpoint,
|
|
115
|
+
description: `Chain network ${cfg.network} via ${safeEndpointLabel(cfg.endpoint)}`
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
factory,
|
|
119
|
+
projectors: [require_aup_projector.aupResourceProjector],
|
|
120
|
+
scope: "host",
|
|
121
|
+
mountOptions: PROJECTION_OVERLAY,
|
|
122
|
+
projectionFailure: "warn"
|
|
123
|
+
}));
|
|
124
|
+
out.mounted.push(path);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
out.warnings.push(`${path}: mount failed — ${require_materializer.redactError(err)}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
function safeEndpointLabel(endpoint) {
|
|
132
|
+
try {
|
|
133
|
+
const url = new URL(endpoint);
|
|
134
|
+
return `${url.protocol}//${url.host}`;
|
|
135
|
+
} catch {
|
|
136
|
+
return "<endpoint>";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function deviceInstall(afs) {
|
|
140
|
+
const out = {
|
|
141
|
+
mounted: [],
|
|
142
|
+
warnings: []
|
|
143
|
+
};
|
|
144
|
+
for (const [target, source, name] of [[
|
|
145
|
+
"/dev/ui",
|
|
146
|
+
"/ui",
|
|
147
|
+
"dev-ui"
|
|
148
|
+
], [
|
|
149
|
+
"/dev/web",
|
|
150
|
+
"/web",
|
|
151
|
+
"dev-web"
|
|
152
|
+
]]) {
|
|
153
|
+
if (hasMount(afs, target)) continue;
|
|
154
|
+
if (!hasMount(afs, source)) continue;
|
|
155
|
+
await mountProjection(afs, target, source, name, out);
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
const OBS_PATH = "/dev/observability";
|
|
160
|
+
const OBS_HOST_INBOX = "/dev/observability/.host-inbox";
|
|
161
|
+
async function observabilityInstall(afs, _ctx, registry) {
|
|
162
|
+
const out = {
|
|
163
|
+
mounted: [],
|
|
164
|
+
warnings: []
|
|
165
|
+
};
|
|
166
|
+
if (hasMount(afs, OBS_PATH)) {
|
|
167
|
+
out.warnings.push(`${OBS_PATH}: already mounted — skipped`);
|
|
168
|
+
return out;
|
|
169
|
+
}
|
|
170
|
+
let hostInboxMounted = false;
|
|
171
|
+
const hostInboxFactory = registry["observability-host-inbox"];
|
|
172
|
+
if (hostInboxFactory) try {
|
|
173
|
+
const { provider } = await hostInboxFactory.create({
|
|
174
|
+
uri: `fs://system${OBS_HOST_INBOX}`,
|
|
175
|
+
type: "fs"
|
|
176
|
+
});
|
|
177
|
+
await afs.mount(provider, OBS_HOST_INBOX, { hidden: true });
|
|
178
|
+
hostInboxMounted = true;
|
|
179
|
+
out.mounted.push(OBS_HOST_INBOX);
|
|
180
|
+
} catch (err) {
|
|
181
|
+
out.warnings.push(`${OBS_HOST_INBOX}: mount failed — ${require_materializer.redactError(err)}`);
|
|
182
|
+
}
|
|
183
|
+
const factory = registry["observability"];
|
|
184
|
+
if (!factory) return out;
|
|
185
|
+
try {
|
|
186
|
+
await require_materializer.materializeProviderMount({
|
|
187
|
+
afs,
|
|
188
|
+
mountPath: OBS_PATH,
|
|
189
|
+
definition: {
|
|
190
|
+
uri: `observability://system${OBS_PATH}`,
|
|
191
|
+
type: "observability",
|
|
192
|
+
options: {
|
|
193
|
+
upstream: afs,
|
|
194
|
+
description: "AI agent observability — jsonl event log viewer",
|
|
195
|
+
...hostInboxMounted ? { hostInboxPath: OBS_HOST_INBOX } : {}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
factory,
|
|
199
|
+
projectors: [require_aup_projector.aupResourceProjector],
|
|
200
|
+
scope: "host",
|
|
201
|
+
mountOptions: PROJECTION_OVERLAY,
|
|
202
|
+
projectionFailure: "warn"
|
|
203
|
+
});
|
|
204
|
+
out.mounted.push(OBS_PATH);
|
|
205
|
+
} catch (err) {
|
|
206
|
+
out.warnings.push(`${OBS_PATH}: mount failed — ${require_materializer.redactError(err)}`);
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
const MSG_AGENTS = "/proc/messaging/agents";
|
|
211
|
+
const MSG_TOOLS = "/proc/messaging/tools";
|
|
212
|
+
async function messagingInstall(afs, _ctx, registry) {
|
|
213
|
+
const out = {
|
|
214
|
+
mounted: [],
|
|
215
|
+
warnings: []
|
|
216
|
+
};
|
|
217
|
+
const agentsFactory = registry["messaging-agents"];
|
|
218
|
+
if (agentsFactory && !hasMount(afs, MSG_AGENTS)) try {
|
|
219
|
+
const { provider } = await agentsFactory.create({
|
|
220
|
+
uri: `fs://system${MSG_AGENTS}`,
|
|
221
|
+
type: "fs"
|
|
222
|
+
});
|
|
223
|
+
await afs.mount(provider, MSG_AGENTS, PROJECTION_OVERLAY);
|
|
224
|
+
out.mounted.push(MSG_AGENTS);
|
|
225
|
+
} catch (err) {
|
|
226
|
+
out.warnings.push(`${MSG_AGENTS}: mount failed — ${require_materializer.redactError(err)}`);
|
|
227
|
+
}
|
|
228
|
+
const toolsFactory = registry["messaging-tools"];
|
|
229
|
+
if (toolsFactory && !hasMount(afs, MSG_TOOLS)) try {
|
|
230
|
+
const { provider } = await toolsFactory.create({
|
|
231
|
+
uri: `messaging-tools://system${MSG_TOOLS}`,
|
|
232
|
+
type: "messaging-tools"
|
|
233
|
+
});
|
|
234
|
+
await afs.mount(provider, MSG_TOOLS, PROJECTION_OVERLAY);
|
|
235
|
+
out.mounted.push(MSG_TOOLS);
|
|
236
|
+
} catch (err) {
|
|
237
|
+
out.warnings.push(`${MSG_TOOLS}: mount failed — ${require_materializer.redactError(err)}`);
|
|
238
|
+
}
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//#endregion
|
|
243
|
+
exports.aiInstall = aiInstall;
|
|
244
|
+
exports.chainInstall = chainInstall;
|
|
245
|
+
exports.deviceInstall = deviceInstall;
|
|
246
|
+
exports.messagingInstall = messagingInstall;
|
|
247
|
+
exports.observabilityInstall = observabilityInstall;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProviderFactory } from "../mount/types.cjs";
|
|
2
|
+
import { InstallOutcome, SystemMountContext } from "./types.cjs";
|
|
3
|
+
import { AFSRoot } from "@aigne/afs";
|
|
4
|
+
|
|
5
|
+
//#region src/system-mounts/installers.d.ts
|
|
6
|
+
declare function aiInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
7
|
+
declare function chainInstall(afs: AFSRoot, ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
8
|
+
declare function deviceInstall(afs: AFSRoot): Promise<InstallOutcome>;
|
|
9
|
+
declare function observabilityInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
10
|
+
declare function messagingInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { aiInstall, chainInstall, deviceInstall, messagingInstall, observabilityInstall };
|
|
13
|
+
//# sourceMappingURL=installers.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installers.d.cts","names":[],"sources":["../../src/system-mounts/installers.ts"],"mappings":";;;;;iBAgFsB,SAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAuEW,YAAA,CACpB,GAAA,EAAK,OAAA,EACL,GAAA,EAAK,kBAAA,EACL,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAiEW,aAAA,CAAc,GAAA,EAAK,OAAA,GAAU,OAAA,CAAQ,cAAA;AAAA,iBAuBrC,oBAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAmEW,gBAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProviderFactory } from "../mount/types.mjs";
|
|
2
|
+
import "../mount/index.mjs";
|
|
3
|
+
import { InstallOutcome, SystemMountContext } from "./types.mjs";
|
|
4
|
+
import { AFSRoot } from "@aigne/afs";
|
|
5
|
+
|
|
6
|
+
//#region src/system-mounts/installers.d.ts
|
|
7
|
+
declare function aiInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
8
|
+
declare function chainInstall(afs: AFSRoot, ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
9
|
+
declare function deviceInstall(afs: AFSRoot): Promise<InstallOutcome>;
|
|
10
|
+
declare function observabilityInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
11
|
+
declare function messagingInstall(afs: AFSRoot, _ctx: SystemMountContext, registry: Record<string, ProviderFactory>): Promise<InstallOutcome>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { aiInstall, chainInstall, deviceInstall, messagingInstall, observabilityInstall };
|
|
14
|
+
//# sourceMappingURL=installers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installers.d.mts","names":[],"sources":["../../src/system-mounts/installers.ts"],"mappings":";;;;;;iBAgFsB,SAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAuEW,YAAA,CACpB,GAAA,EAAK,OAAA,EACL,GAAA,EAAK,kBAAA,EACL,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAiEW,aAAA,CAAc,GAAA,EAAK,OAAA,GAAU,OAAA,CAAQ,cAAA;AAAA,iBAuBrC,oBAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA;AAAA,iBAmEW,gBAAA,CACpB,GAAA,EAAK,OAAA,EACL,IAAA,EAAM,kBAAA,EACN,QAAA,EAAU,MAAA,SAAe,eAAA,IACxB,OAAA,CAAQ,cAAA"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { BUILTIN_CHAIN_NETWORKS, chainNetworkToMountEntry, validateChainNetworks } from "../devices/chain.mjs";
|
|
2
|
+
import { materializeProviderMount, redactError } from "../mount/materializer.mjs";
|
|
3
|
+
import { aupResourceProjector } from "../projectors/aup-projector.mjs";
|
|
4
|
+
import { joinURL } from "ufo";
|
|
5
|
+
import { ProjectionProvider } from "@aigne/afs";
|
|
6
|
+
import { time } from "@aigne/afs-timing";
|
|
7
|
+
|
|
8
|
+
//#region src/system-mounts/installers.ts
|
|
9
|
+
/**
|
|
10
|
+
* Runtime-neutral `install` escape-hatch implementations for the composite
|
|
11
|
+
* entries in {@link SYSTEM_MOUNTS} (design.md §4.1). These orchestrate
|
|
12
|
+
* multi-step mounts that a single `path`+`providerKey` can't express:
|
|
13
|
+
*
|
|
14
|
+
* - {@link aiInstall} — `/dev/ai` device + legacy/compat projections
|
|
15
|
+
* - {@link chainInstall} — `/dev/chain/<network>` per builtin/config network + AUP
|
|
16
|
+
* - {@link deviceInstall} — `/dev/ui`, `/dev/web` projections (conditional on source)
|
|
17
|
+
* - {@link observabilityInstall} — `/dev/observability` (+ optional host-inbox)
|
|
18
|
+
* - {@link messagingInstall} — `/proc/messaging/agents` + `/proc/messaging/tools`
|
|
19
|
+
*
|
|
20
|
+
* Crucial invariant: NONE of these import a runtime-specific module. All
|
|
21
|
+
* provider *construction* is delegated to the `registry` factories the
|
|
22
|
+
* runtime supplies (Node builds disk-backed providers + loads AUP from the
|
|
23
|
+
* package dir; CF builds bundled providers + loads AUP over HTTP). Projection
|
|
24
|
+
* uses `ProjectionProvider` from `@aigne/afs` (runtime-neutral) and AUP
|
|
25
|
+
* companion resources flow through the factory's `resources` field + the
|
|
26
|
+
* materializer's `aupResourceProjector`. So these hatches bundle cleanly into
|
|
27
|
+
* the Cloudflare Worker even when CF's registry omits the keys (the hatch
|
|
28
|
+
* skips that sub-mount).
|
|
29
|
+
*/
|
|
30
|
+
const PROJECTION_OVERLAY = { allowOverlay: true };
|
|
31
|
+
function getMounts(afs) {
|
|
32
|
+
const fn = afs.getMounts;
|
|
33
|
+
return typeof fn === "function" ? fn.call(afs) : [];
|
|
34
|
+
}
|
|
35
|
+
function hasMount(afs, path) {
|
|
36
|
+
return getMounts(afs).some((m) => m.path === path);
|
|
37
|
+
}
|
|
38
|
+
/** Mount a `ProjectionProvider` alias `target → source`, idempotent + tolerant. */
|
|
39
|
+
async function mountProjection(afs, target, source, name, out) {
|
|
40
|
+
if (hasMount(afs, target)) return;
|
|
41
|
+
try {
|
|
42
|
+
await afs.mount(new ProjectionProvider({
|
|
43
|
+
name,
|
|
44
|
+
globalAFS: afs,
|
|
45
|
+
sourcePath: source
|
|
46
|
+
}), target, PROJECTION_OVERLAY);
|
|
47
|
+
out.mounted.push(target);
|
|
48
|
+
} catch (err) {
|
|
49
|
+
out.warnings.push(`${target}: projection failed — ${redactError(err)}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const AI_DEVICE = "/dev/ai";
|
|
53
|
+
const AI_HUBS_AIGNEHUB = "/dev/ai/hubs/aignehub";
|
|
54
|
+
const AI_LOCAL_EMBEDDING = "/dev/ai/local/embedding";
|
|
55
|
+
const LEGACY_AIGNEHUB = "/modules/aignehub";
|
|
56
|
+
const LEGACY_EMBEDDING = "/modules/embedding";
|
|
57
|
+
const COMPAT_HUB = "/dev/ai/hub";
|
|
58
|
+
const COMPAT_DEFAULTS = "/dev/ai/defaults";
|
|
59
|
+
const COMPAT_EMBEDDING = "/dev/ai/embedding";
|
|
60
|
+
async function aiInstall(afs, _ctx, registry) {
|
|
61
|
+
const out = {
|
|
62
|
+
mounted: [],
|
|
63
|
+
warnings: []
|
|
64
|
+
};
|
|
65
|
+
if (!hasMount(afs, AI_HUBS_AIGNEHUB)) {
|
|
66
|
+
const legacy = hasMount(afs, LEGACY_AIGNEHUB) ? LEGACY_AIGNEHUB : hasMount(afs, COMPAT_HUB) ? COMPAT_HUB : null;
|
|
67
|
+
if (legacy) await mountProjection(afs, AI_HUBS_AIGNEHUB, legacy, "dev-ai-hubs-aignehub", out);
|
|
68
|
+
}
|
|
69
|
+
if (!hasMount(afs, AI_LOCAL_EMBEDDING) && hasMount(afs, LEGACY_EMBEDDING)) await mountProjection(afs, AI_LOCAL_EMBEDDING, LEGACY_EMBEDDING, "dev-ai-local-embedding", out);
|
|
70
|
+
if (hasMount(afs, AI_HUBS_AIGNEHUB)) {
|
|
71
|
+
await mountProjection(afs, COMPAT_HUB, AI_HUBS_AIGNEHUB, "dev-ai-hub-compat", out);
|
|
72
|
+
await mountProjection(afs, COMPAT_DEFAULTS, joinURL(AI_HUBS_AIGNEHUB, "defaults"), "dev-ai-defaults-compat", out);
|
|
73
|
+
}
|
|
74
|
+
if (hasMount(afs, AI_LOCAL_EMBEDDING)) await mountProjection(afs, COMPAT_EMBEDDING, AI_LOCAL_EMBEDDING, "dev-ai-embedding-compat", out);
|
|
75
|
+
if (!hasMount(afs, AI_DEVICE)) {
|
|
76
|
+
const factory = registry["ai-device"];
|
|
77
|
+
if (factory) try {
|
|
78
|
+
const options = { globalAFS: afs };
|
|
79
|
+
if (hasMount(afs, "/user")) options.userSpaceRoot = "/user";
|
|
80
|
+
const { provider } = await factory.create({
|
|
81
|
+
uri: `ai-device://system${AI_DEVICE}`,
|
|
82
|
+
type: "ai-device",
|
|
83
|
+
options
|
|
84
|
+
});
|
|
85
|
+
await afs.mount(provider, AI_DEVICE, PROJECTION_OVERLAY);
|
|
86
|
+
out.mounted.push(AI_DEVICE);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
out.warnings.push(`${AI_DEVICE}: mount failed — ${redactError(err)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
async function chainInstall(afs, ctx, registry) {
|
|
94
|
+
const out = {
|
|
95
|
+
mounted: [],
|
|
96
|
+
warnings: []
|
|
97
|
+
};
|
|
98
|
+
const configs = ctx.chainConfigs;
|
|
99
|
+
const cfgs = [...configs && configs.length > 0 ? configs : BUILTIN_CHAIN_NETWORKS];
|
|
100
|
+
validateChainNetworks(cfgs);
|
|
101
|
+
const factory = registry["ocap"];
|
|
102
|
+
if (!factory) return out;
|
|
103
|
+
for (const cfg of cfgs) {
|
|
104
|
+
const path = chainNetworkToMountEntry(cfg).path;
|
|
105
|
+
if (hasMount(afs, path)) continue;
|
|
106
|
+
try {
|
|
107
|
+
await time(`mnt.dev.chain.${cfg.network}`, () => materializeProviderMount({
|
|
108
|
+
afs,
|
|
109
|
+
mountPath: path,
|
|
110
|
+
definition: {
|
|
111
|
+
uri: `ocap://system${path}`,
|
|
112
|
+
type: "ocap",
|
|
113
|
+
options: {
|
|
114
|
+
endpoint: cfg.endpoint,
|
|
115
|
+
description: `Chain network ${cfg.network} via ${safeEndpointLabel(cfg.endpoint)}`
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
factory,
|
|
119
|
+
projectors: [aupResourceProjector],
|
|
120
|
+
scope: "host",
|
|
121
|
+
mountOptions: PROJECTION_OVERLAY,
|
|
122
|
+
projectionFailure: "warn"
|
|
123
|
+
}));
|
|
124
|
+
out.mounted.push(path);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
out.warnings.push(`${path}: mount failed — ${redactError(err)}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
function safeEndpointLabel(endpoint) {
|
|
132
|
+
try {
|
|
133
|
+
const url = new URL(endpoint);
|
|
134
|
+
return `${url.protocol}//${url.host}`;
|
|
135
|
+
} catch {
|
|
136
|
+
return "<endpoint>";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function deviceInstall(afs) {
|
|
140
|
+
const out = {
|
|
141
|
+
mounted: [],
|
|
142
|
+
warnings: []
|
|
143
|
+
};
|
|
144
|
+
for (const [target, source, name] of [[
|
|
145
|
+
"/dev/ui",
|
|
146
|
+
"/ui",
|
|
147
|
+
"dev-ui"
|
|
148
|
+
], [
|
|
149
|
+
"/dev/web",
|
|
150
|
+
"/web",
|
|
151
|
+
"dev-web"
|
|
152
|
+
]]) {
|
|
153
|
+
if (hasMount(afs, target)) continue;
|
|
154
|
+
if (!hasMount(afs, source)) continue;
|
|
155
|
+
await mountProjection(afs, target, source, name, out);
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
const OBS_PATH = "/dev/observability";
|
|
160
|
+
const OBS_HOST_INBOX = "/dev/observability/.host-inbox";
|
|
161
|
+
async function observabilityInstall(afs, _ctx, registry) {
|
|
162
|
+
const out = {
|
|
163
|
+
mounted: [],
|
|
164
|
+
warnings: []
|
|
165
|
+
};
|
|
166
|
+
if (hasMount(afs, OBS_PATH)) {
|
|
167
|
+
out.warnings.push(`${OBS_PATH}: already mounted — skipped`);
|
|
168
|
+
return out;
|
|
169
|
+
}
|
|
170
|
+
let hostInboxMounted = false;
|
|
171
|
+
const hostInboxFactory = registry["observability-host-inbox"];
|
|
172
|
+
if (hostInboxFactory) try {
|
|
173
|
+
const { provider } = await hostInboxFactory.create({
|
|
174
|
+
uri: `fs://system${OBS_HOST_INBOX}`,
|
|
175
|
+
type: "fs"
|
|
176
|
+
});
|
|
177
|
+
await afs.mount(provider, OBS_HOST_INBOX, { hidden: true });
|
|
178
|
+
hostInboxMounted = true;
|
|
179
|
+
out.mounted.push(OBS_HOST_INBOX);
|
|
180
|
+
} catch (err) {
|
|
181
|
+
out.warnings.push(`${OBS_HOST_INBOX}: mount failed — ${redactError(err)}`);
|
|
182
|
+
}
|
|
183
|
+
const factory = registry["observability"];
|
|
184
|
+
if (!factory) return out;
|
|
185
|
+
try {
|
|
186
|
+
await materializeProviderMount({
|
|
187
|
+
afs,
|
|
188
|
+
mountPath: OBS_PATH,
|
|
189
|
+
definition: {
|
|
190
|
+
uri: `observability://system${OBS_PATH}`,
|
|
191
|
+
type: "observability",
|
|
192
|
+
options: {
|
|
193
|
+
upstream: afs,
|
|
194
|
+
description: "AI agent observability — jsonl event log viewer",
|
|
195
|
+
...hostInboxMounted ? { hostInboxPath: OBS_HOST_INBOX } : {}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
factory,
|
|
199
|
+
projectors: [aupResourceProjector],
|
|
200
|
+
scope: "host",
|
|
201
|
+
mountOptions: PROJECTION_OVERLAY,
|
|
202
|
+
projectionFailure: "warn"
|
|
203
|
+
});
|
|
204
|
+
out.mounted.push(OBS_PATH);
|
|
205
|
+
} catch (err) {
|
|
206
|
+
out.warnings.push(`${OBS_PATH}: mount failed — ${redactError(err)}`);
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
const MSG_AGENTS = "/proc/messaging/agents";
|
|
211
|
+
const MSG_TOOLS = "/proc/messaging/tools";
|
|
212
|
+
async function messagingInstall(afs, _ctx, registry) {
|
|
213
|
+
const out = {
|
|
214
|
+
mounted: [],
|
|
215
|
+
warnings: []
|
|
216
|
+
};
|
|
217
|
+
const agentsFactory = registry["messaging-agents"];
|
|
218
|
+
if (agentsFactory && !hasMount(afs, MSG_AGENTS)) try {
|
|
219
|
+
const { provider } = await agentsFactory.create({
|
|
220
|
+
uri: `fs://system${MSG_AGENTS}`,
|
|
221
|
+
type: "fs"
|
|
222
|
+
});
|
|
223
|
+
await afs.mount(provider, MSG_AGENTS, PROJECTION_OVERLAY);
|
|
224
|
+
out.mounted.push(MSG_AGENTS);
|
|
225
|
+
} catch (err) {
|
|
226
|
+
out.warnings.push(`${MSG_AGENTS}: mount failed — ${redactError(err)}`);
|
|
227
|
+
}
|
|
228
|
+
const toolsFactory = registry["messaging-tools"];
|
|
229
|
+
if (toolsFactory && !hasMount(afs, MSG_TOOLS)) try {
|
|
230
|
+
const { provider } = await toolsFactory.create({
|
|
231
|
+
uri: `messaging-tools://system${MSG_TOOLS}`,
|
|
232
|
+
type: "messaging-tools"
|
|
233
|
+
});
|
|
234
|
+
await afs.mount(provider, MSG_TOOLS, PROJECTION_OVERLAY);
|
|
235
|
+
out.mounted.push(MSG_TOOLS);
|
|
236
|
+
} catch (err) {
|
|
237
|
+
out.warnings.push(`${MSG_TOOLS}: mount failed — ${redactError(err)}`);
|
|
238
|
+
}
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//#endregion
|
|
243
|
+
export { aiInstall, chainInstall, deviceInstall, messagingInstall, observabilityInstall };
|
|
244
|
+
//# sourceMappingURL=installers.mjs.map
|