@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0-beta](https://github.com/ArcBlock/arc/compare/aos-v0.1.0...aos-v0.2.0-beta) (2026-07-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add paginated aside search ([1c04302](https://github.com/ArcBlock/arc/commit/1c043024c780cb0903dcd1eb1d298010c16027a0))
|
|
9
|
+
* **aos:** add afs-rpc phase-timing probe (begin/resolved/done) ([62ed505](https://github.com/ArcBlock/arc/commit/62ed505f72db88aad91b161e36ab33448a63cdb5))
|
|
10
|
+
* **aos:** forward /user search to /user/index semantic query ([#937](https://github.com/ArcBlock/arc/issues/937) P5) ([218b9d6](https://github.com/ArcBlock/arc/commit/218b9d679a45ef8c82731f35714ff75282a894e3))
|
|
11
|
+
* **aos:** implement ReplicationResolver P1+P2 — role gate, copy fan-out, readRole gate, createSessionView wiring ([#1023](https://github.com/ArcBlock/arc/issues/1023)) ([003cb16](https://github.com/ArcBlock/arc/commit/003cb1659859a1d4e429bc9d18e63d2317f18d8c))
|
|
12
|
+
* **aos:** replication resolver P1 — write fan-out + delete gate ([#609](https://github.com/ArcBlock/arc/issues/609)) ([3fef797](https://github.com/ArcBlock/arc/commit/3fef797d074602e595a0c1a303287d1aa438360b))
|
|
13
|
+
* **aup:** client-driven semantic search toggle on list search ([d3e0761](https://github.com/ArcBlock/arc/commit/d3e07617c10c1e4065657fdb3912920656c98ccd))
|
|
14
|
+
* **cloudflare:** payment dispatch → AFSScheduler + delete SchedulerDispatcher (P3+P4, [#734](https://github.com/ArcBlock/arc/issues/734)) ([#780](https://github.com/ArcBlock/arc/issues/780)) ([9bb15e7](https://github.com/ArcBlock/arc/commit/9bb15e77ae189209762dfefaf082f9fed62edca5))
|
|
15
|
+
* **core,aos:** add AFSPaymentRequiredError and x402 HTTP 402 mapping ([#904](https://github.com/ArcBlock/arc/issues/904)) ([9ae1ee3](https://github.com/ArcBlock/arc/commit/9ae1ee3db6507b548a807eff5ca34474bf998a35))
|
|
16
|
+
* **did-space:** resolve custom domains for published blocklets ([#764](https://github.com/ArcBlock/arc/issues/764)) ([#846](https://github.com/ArcBlock/arc/issues/846)) ([7d0ef44](https://github.com/ArcBlock/arc/commit/7d0ef44b33505c32d292a936f5b5421a074e4a95))
|
|
17
|
+
* **index:** env-controlled default search mode via AFS_INDEX_SEARCH_MODE ([22fce45](https://github.com/ArcBlock/arc/commit/22fce459bbd2f6c59275d4d20618fbc173e87e8a))
|
|
18
|
+
* **index:** facet hard-filter into afs.search ([d0e845a](https://github.com/ArcBlock/arc/commit/d0e845a96045a53607fba17fcbdd0d7a9e984f5b))
|
|
19
|
+
* **index:** local ONNX embedding for Node /user semantic recall ([cf47d8f](https://github.com/ArcBlock/arc/commit/cf47d8fe6020de9e1a582da713ec6bf0413bbd1a))
|
|
20
|
+
* **index:** per-result debug info — explain why a query result matched ([#1072](https://github.com/ArcBlock/arc/issues/1072)) ([9ff1c80](https://github.com/ArcBlock/arc/commit/9ff1c80eb2025efe2bd4cb2fd263a911f78ec071))
|
|
21
|
+
* **index:** semantic recall — follower embeds + query mode:semantic (Epic [#932](https://github.com/ArcBlock/arc/issues/932) B2-1/B2-2) ([dc4a669](https://github.com/ArcBlock/arc/commit/dc4a66914977f37f2b220dc79f1bb99c8173e7fa))
|
|
22
|
+
* **presence:** provider skeleton, ttl semantics, role claiming, mcp write channel (phases 0-1) ([#1376](https://github.com/ArcBlock/arc/issues/1376)) ([1ecdb28](https://github.com/ArcBlock/arc/commit/1ecdb288be36ba3213ac00e382a9656bc1271d3a))
|
|
23
|
+
* **presence:** well-known publication face, durable backend, heartbeat afs mode (phase 2) ([#1379](https://github.com/ArcBlock/arc/issues/1379)) ([e970b33](https://github.com/ArcBlock/arc/commit/e970b33be7eeceddfc2e65c0777dc32ba240b21a))
|
|
24
|
+
* **runtimes:** parse PAYMENT-SIGNATURE header and inject into AFSContext ([#914](https://github.com/ArcBlock/arc/issues/914)) ([cdd7c1f](https://github.com/ArcBlock/arc/commit/cdd7c1f27f6703c7557fdf3b81ef70cbb977ed9d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **aos,ui:** mount agent-run exec adapter at /dev/ai/agent + guard stale markdown re-paint ([#1390](https://github.com/ArcBlock/arc/issues/1390)) ([#1395](https://github.com/ArcBlock/arc/issues/1395)) ([7469810](https://github.com/ArcBlock/arc/commit/7469810af9e2ca56f2d5e6114bf4052f75f2897f))
|
|
30
|
+
* **aos:** disable native search fallback for indexed users ([0c9f3fa](https://github.com/ArcBlock/arc/commit/0c9f3fa18a4e1b26e4404ea85a06dc8a05917022))
|
|
31
|
+
* **aos:** force safe disposition for scriptable content-types in afs-raw ([#818](https://github.com/ArcBlock/arc/issues/818)) ([#881](https://github.com/ArcBlock/arc/issues/881)) ([665e5dc](https://github.com/ArcBlock/arc/commit/665e5dcc7816e7589670e8e723eb01020fe158de))
|
|
32
|
+
* **aos:** improve MCP server instructions and afs_list/afs_exec tool descriptions ([#985](https://github.com/ArcBlock/arc/issues/985)) ([f7c08e4](https://github.com/ArcBlock/arc/commit/f7c08e42daa598fffa388df0c7306b27d9df56da))
|
|
33
|
+
* **aos:** prefer host alias for rpc blocklet resolution ([b6b3782](https://github.com/ArcBlock/arc/commit/b6b378228b39e24456ba4776555695145c61b7c2))
|
|
34
|
+
* **aos:** rearm idle timer on outbound server push (rearmOnOutbound option) ([#642](https://github.com/ArcBlock/arc/issues/642)) ([f724a52](https://github.com/ArcBlock/arc/commit/f724a529decde4dc494995d5fd06de55b8d6574e))
|
|
35
|
+
* **cloudflare:** resolve did-space web-device blocklets in route/site rendering ([#778](https://github.com/ArcBlock/arc/issues/778)) ([bab5051](https://github.com/ArcBlock/arc/commit/bab50517a7b473942ba3157e3525bf41c0d18f96))
|
|
36
|
+
* **mcp:** reply 202 to JSON-RPC notifications instead of hanging ([e3703c7](https://github.com/ArcBlock/arc/commit/e3703c72392c4b155fcd669078ed60a97c76ce48))
|
|
37
|
+
* **search:** avoid fallback on empty index results ([a9c44f1](https://github.com/ArcBlock/arc/commit/a9c44f12261b6c0c3cba76c9fff816d38a47b5e1))
|
|
38
|
+
* **transport:** keepalive pings must not rearm the idle-close timer ([#1276](https://github.com/ArcBlock/arc/issues/1276)) ([c531750](https://github.com/ArcBlock/arc/commit/c5317503af802f71d4c012018cda1fd40e8b6089))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Performance Improvements
|
|
42
|
+
|
|
43
|
+
* **cf:** cut `.web-cache` serve D1 subrequests (warm 13→3, cold 33→17) ([#808](https://github.com/ArcBlock/arc/issues/808)) ([82e1ed8](https://github.com/ArcBlock/arc/commit/82e1ed813f83df197beb3776ca2996a2fb16db36))
|
|
44
|
+
* **cold-start:** attribute [#808](https://github.com/ArcBlock/arc/issues/808) cold path + trim two cold-only ops ([80f3a72](https://github.com/ArcBlock/arc/commit/80f3a72bec114a956a37df0887248ec5ddf2cff5))
|
|
45
|
+
* **index:** push search subtree into the index query via opts.pathPrefix ([a85b49e](https://github.com/ArcBlock/arc/commit/a85b49e5010b1d7d9d1f0f395abb78be0dbc85d2))
|
|
46
|
+
* **render:** batch page reads into one readMany, skip enrichment probes ([#808](https://github.com/ArcBlock/arc/issues/808)) ([06894b8](https://github.com/ArcBlock/arc/commit/06894b875c6fcd5219a74448897edebd38db715e))
|
|
47
|
+
* **search:** batchRead-pushdown hydration + honor page pageSize as search limit ([46e8dd2](https://github.com/ArcBlock/arc/commit/46e8dd2c1a3b7b2bb5f2320f7c1d312c786ffe2e))
|
|
48
|
+
* **serve:** batch resolve lookups + skip stat read-fallback ([#808](https://github.com/ArcBlock/arc/issues/808)) ([52905ce](https://github.com/ArcBlock/arc/commit/52905ce6d3b76ac66754327aecd9e1797074d7f0))
|
|
49
|
+
* **session:** default /user search to combined (anchor+FTS), not semantic ([1f79dd4](https://github.com/ArcBlock/arc/commit/1f79dd4ec44517d71e561251dc3937c0e35df800))
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 ArcBlock, Inc. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are proprietary
|
|
6
|
+
and confidential. Unauthorized copying, modification, distribution, or use of
|
|
7
|
+
this Software, via any medium, is strictly prohibited.
|
|
8
|
+
|
|
9
|
+
The Software is provided for internal use only within ArcBlock, Inc. and its
|
|
10
|
+
authorized affiliates.
|
|
11
|
+
|
|
12
|
+
## No License Granted
|
|
13
|
+
|
|
14
|
+
No license, express or implied, is granted to any party for any purpose.
|
|
15
|
+
All rights are reserved by ArcBlock, Inc.
|
|
16
|
+
|
|
17
|
+
## Public Artifact Distribution
|
|
18
|
+
|
|
19
|
+
Portions of this Software may be released publicly under separate open-source
|
|
20
|
+
licenses (such as MIT License) through designated public repositories. Such
|
|
21
|
+
public releases are governed by their respective licenses and do not affect
|
|
22
|
+
the proprietary nature of this repository.
|
|
23
|
+
|
|
24
|
+
## Contact
|
|
25
|
+
|
|
26
|
+
For licensing inquiries, contact: legal@arcblock.io
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const require_dsl_shared = require('./dsl-shared.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/agent-dsl.ts
|
|
4
|
+
var AgentDslCompileError = class extends Error {
|
|
5
|
+
constructor(message, line, column = 1) {
|
|
6
|
+
super(`${line}:${column} ${message}`);
|
|
7
|
+
this.line = line;
|
|
8
|
+
this.column = column;
|
|
9
|
+
this.name = "AgentDslCompileError";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
function compileAgentDsl(source) {
|
|
13
|
+
const manifest = { tools: [] };
|
|
14
|
+
const agent = require_dsl_shared.parseDeclaration(source, {
|
|
15
|
+
kind: "agent",
|
|
16
|
+
allowQuotedId: true,
|
|
17
|
+
expected: "Expected agent \"<name>\" {",
|
|
18
|
+
fieldKeywords: [
|
|
19
|
+
"type",
|
|
20
|
+
"description",
|
|
21
|
+
"instructions",
|
|
22
|
+
"model",
|
|
23
|
+
"tool",
|
|
24
|
+
"budget"
|
|
25
|
+
],
|
|
26
|
+
error: parseError
|
|
27
|
+
});
|
|
28
|
+
manifest.name = agent.id;
|
|
29
|
+
for (const field of agent.fields) {
|
|
30
|
+
if (field.name.value === "type") {
|
|
31
|
+
manifest.type = parseBareField(field, "type");
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (field.name.value === "description") {
|
|
35
|
+
manifest.description = parseStringField(field, "Expected description \"<text>\"");
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (field.name.value === "instructions") {
|
|
39
|
+
manifest.instructions = parseStringField(field, "Expected instructions \"<path>\"");
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (field.name.value === "model") {
|
|
43
|
+
manifest.model = parseStringField(field, "Expected model \"<path>\"");
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (field.name.value === "tool") {
|
|
47
|
+
manifest.tools.push(parseTool(field));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (field.name.value === "budget") manifest.budget = parseBudget(field);
|
|
51
|
+
}
|
|
52
|
+
if (!manifest.type) throw new AgentDslCompileError("Agent type is required", 1);
|
|
53
|
+
if (!manifest.model) throw new AgentDslCompileError("Agent model is required", 1);
|
|
54
|
+
return { manifest: {
|
|
55
|
+
type: manifest.type,
|
|
56
|
+
name: manifest.name,
|
|
57
|
+
...manifest.description ? { description: manifest.description } : {},
|
|
58
|
+
...manifest.instructions ? { instructions: manifest.instructions } : {},
|
|
59
|
+
model: manifest.model,
|
|
60
|
+
...manifest.tools.length > 0 ? { tools: manifest.tools } : {},
|
|
61
|
+
...manifest.budget ? { budget: manifest.budget } : {}
|
|
62
|
+
} };
|
|
63
|
+
}
|
|
64
|
+
function formatAgentDsl(source) {
|
|
65
|
+
const { manifest } = compileAgentDsl(source);
|
|
66
|
+
const lines = [`agent ${JSON.stringify(manifest.name)} {`, ` type ${manifest.type}`];
|
|
67
|
+
if (manifest.description) lines.push(` description ${JSON.stringify(manifest.description)}`);
|
|
68
|
+
if (manifest.instructions) lines.push(` instructions ${JSON.stringify(manifest.instructions)}`);
|
|
69
|
+
if (manifest.model) lines.push(` model ${JSON.stringify(manifest.model)}`);
|
|
70
|
+
for (const tool of manifest.tools ?? []) {
|
|
71
|
+
const maxDepth = tool.maxDepth === void 0 ? "" : ` maxDepth ${tool.maxDepth}`;
|
|
72
|
+
lines.push(` tool ${JSON.stringify(tool.path)} ops ${tool.ops.join(",")}${maxDepth}`);
|
|
73
|
+
}
|
|
74
|
+
if (manifest.budget) {
|
|
75
|
+
const maxRounds = manifest.budget.max_rounds ?? 0;
|
|
76
|
+
const totalTokens = manifest.budget.total_tokens ?? 0;
|
|
77
|
+
lines.push(` budget maxRounds ${maxRounds} totalTokens ${totalTokens}`);
|
|
78
|
+
}
|
|
79
|
+
lines.push("}");
|
|
80
|
+
return `${lines.join("\n")}\n`;
|
|
81
|
+
}
|
|
82
|
+
function parseError(message, line, column = 1) {
|
|
83
|
+
return new AgentDslCompileError(message, line, column);
|
|
84
|
+
}
|
|
85
|
+
function parseBareField(field, keyword) {
|
|
86
|
+
const value = field.values[0];
|
|
87
|
+
if (field.values.length !== 1 || value?.type !== "word" || !/^[A-Za-z0-9_-]+$/.test(value.value)) throw new AgentDslCompileError(`Expected ${keyword} <identifier>`, value?.line ?? field.name.line, value?.column ?? field.name.column);
|
|
88
|
+
return value.value;
|
|
89
|
+
}
|
|
90
|
+
function parseStringField(field, message) {
|
|
91
|
+
const value = field.values[0];
|
|
92
|
+
if (field.values.length !== 1 || value?.type !== "string") throw new AgentDslCompileError(message, value?.line ?? field.name.line, value?.column ?? field.name.column);
|
|
93
|
+
return require_dsl_shared.parseDslStringToken(value, parseError);
|
|
94
|
+
}
|
|
95
|
+
function parseTool(field) {
|
|
96
|
+
const [path, opsKeyword, opsValue, maxDepthKeyword, maxDepthValue, ...extra] = field.values;
|
|
97
|
+
if (path?.type !== "string" || opsKeyword?.type !== "word" || opsKeyword.value !== "ops" || opsValue?.type !== "word" || extra.length > 0 || maxDepthKeyword && (maxDepthKeyword.type !== "word" || maxDepthKeyword.value !== "maxDepth" || maxDepthValue?.type !== "word" || !/^\d+$/.test(maxDepthValue.value))) throw new AgentDslCompileError("Expected tool \"<path>\" ops read,list,stat [maxDepth <number>]", field.name.line, field.name.column);
|
|
98
|
+
return {
|
|
99
|
+
path: require_dsl_shared.parseDslStringToken(path, parseError),
|
|
100
|
+
ops: opsValue.value.split(",").filter(Boolean),
|
|
101
|
+
...maxDepthValue ? { maxDepth: Number(maxDepthValue.value) } : {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function parseBudget(field) {
|
|
105
|
+
const [maxRoundsKeyword, maxRoundsValue, totalTokensKeyword, totalTokensValue, ...extra] = field.values;
|
|
106
|
+
if (maxRoundsKeyword?.type !== "word" || maxRoundsKeyword.value !== "maxRounds" || maxRoundsValue?.type !== "word" || !/^\d+$/.test(maxRoundsValue.value) || totalTokensKeyword?.type !== "word" || totalTokensKeyword.value !== "totalTokens" || totalTokensValue?.type !== "word" || !/^\d+$/.test(totalTokensValue.value) || extra.length > 0) throw new AgentDslCompileError("Expected budget maxRounds <number> totalTokens <number>", field.name.line, field.name.column);
|
|
107
|
+
return {
|
|
108
|
+
max_rounds: Number(maxRoundsValue.value),
|
|
109
|
+
total_tokens: Number(totalTokensValue.value)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
exports.AgentDslCompileError = AgentDslCompileError;
|
|
115
|
+
exports.compileAgentDsl = compileAgentDsl;
|
|
116
|
+
exports.formatAgentDsl = formatAgentDsl;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/agent-dsl.d.ts
|
|
2
|
+
interface AgentDslCompileResult {
|
|
3
|
+
manifest: AgentManifest;
|
|
4
|
+
}
|
|
5
|
+
interface AgentManifest {
|
|
6
|
+
type: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
instructions?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
tools?: AgentTool[];
|
|
12
|
+
budget?: {
|
|
13
|
+
max_rounds?: number;
|
|
14
|
+
total_tokens?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface AgentTool {
|
|
18
|
+
path: string;
|
|
19
|
+
ops: string[];
|
|
20
|
+
maxDepth?: number;
|
|
21
|
+
}
|
|
22
|
+
declare class AgentDslCompileError extends Error {
|
|
23
|
+
readonly line: number;
|
|
24
|
+
readonly column: number;
|
|
25
|
+
constructor(message: string, line: number, column?: number);
|
|
26
|
+
}
|
|
27
|
+
declare function compileAgentDsl(source: string): AgentDslCompileResult;
|
|
28
|
+
declare function formatAgentDsl(source: string): string;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { AgentDslCompileError, AgentDslCompileResult, AgentManifest, AgentTool, compileAgentDsl, formatAgentDsl };
|
|
31
|
+
//# sourceMappingURL=agent-dsl.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-dsl.d.cts","names":[],"sources":["../src/agent-dsl.ts"],"mappings":";UAEiB,qBAAA;EACf,QAAA,EAAU,aAAA;AAAA;AAAA,UAGK,aAAA;EACf,IAAA;EACA,IAAA;EACA,WAAA;EACA,YAAA;EACA,KAAA;EACA,KAAA,GAAQ,SAAA;EACR,MAAA;IACE,UAAA;IACA,YAAA;EAAA;AAAA;AAAA,UAIa,SAAA;EACf,IAAA;EACA,GAAA;EACA,QAAA;AAAA;AAAA,cAGW,oBAAA,SAA6B,KAAA;EAAA,SAG7B,IAAA;EAAA,SACA,MAAA;cAFT,OAAA,UACS,IAAA,UACA,MAAA;AAAA;AAAA,iBAOG,eAAA,CAAgB,MAAA,WAAiB,qBAAA;AAAA,iBAsDjC,cAAA,CAAe,MAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/agent-dsl.d.ts
|
|
2
|
+
interface AgentDslCompileResult {
|
|
3
|
+
manifest: AgentManifest;
|
|
4
|
+
}
|
|
5
|
+
interface AgentManifest {
|
|
6
|
+
type: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
instructions?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
tools?: AgentTool[];
|
|
12
|
+
budget?: {
|
|
13
|
+
max_rounds?: number;
|
|
14
|
+
total_tokens?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface AgentTool {
|
|
18
|
+
path: string;
|
|
19
|
+
ops: string[];
|
|
20
|
+
maxDepth?: number;
|
|
21
|
+
}
|
|
22
|
+
declare class AgentDslCompileError extends Error {
|
|
23
|
+
readonly line: number;
|
|
24
|
+
readonly column: number;
|
|
25
|
+
constructor(message: string, line: number, column?: number);
|
|
26
|
+
}
|
|
27
|
+
declare function compileAgentDsl(source: string): AgentDslCompileResult;
|
|
28
|
+
declare function formatAgentDsl(source: string): string;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { AgentDslCompileError, AgentDslCompileResult, AgentManifest, AgentTool, compileAgentDsl, formatAgentDsl };
|
|
31
|
+
//# sourceMappingURL=agent-dsl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-dsl.d.mts","names":[],"sources":["../src/agent-dsl.ts"],"mappings":";UAEiB,qBAAA;EACf,QAAA,EAAU,aAAA;AAAA;AAAA,UAGK,aAAA;EACf,IAAA;EACA,IAAA;EACA,WAAA;EACA,YAAA;EACA,KAAA;EACA,KAAA,GAAQ,SAAA;EACR,MAAA;IACE,UAAA;IACA,YAAA;EAAA;AAAA;AAAA,UAIa,SAAA;EACf,IAAA;EACA,GAAA;EACA,QAAA;AAAA;AAAA,cAGW,oBAAA,SAA6B,KAAA;EAAA,SAG7B,IAAA;EAAA,SACA,MAAA;cAFT,OAAA,UACS,IAAA,UACA,MAAA;AAAA;AAAA,iBAOG,eAAA,CAAgB,MAAA,WAAiB,qBAAA;AAAA,iBAsDjC,cAAA,CAAe,MAAA"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { parseDeclaration, parseDslStringToken } from "./dsl-shared.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/agent-dsl.ts
|
|
4
|
+
var AgentDslCompileError = class extends Error {
|
|
5
|
+
constructor(message, line, column = 1) {
|
|
6
|
+
super(`${line}:${column} ${message}`);
|
|
7
|
+
this.line = line;
|
|
8
|
+
this.column = column;
|
|
9
|
+
this.name = "AgentDslCompileError";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
function compileAgentDsl(source) {
|
|
13
|
+
const manifest = { tools: [] };
|
|
14
|
+
const agent = parseDeclaration(source, {
|
|
15
|
+
kind: "agent",
|
|
16
|
+
allowQuotedId: true,
|
|
17
|
+
expected: "Expected agent \"<name>\" {",
|
|
18
|
+
fieldKeywords: [
|
|
19
|
+
"type",
|
|
20
|
+
"description",
|
|
21
|
+
"instructions",
|
|
22
|
+
"model",
|
|
23
|
+
"tool",
|
|
24
|
+
"budget"
|
|
25
|
+
],
|
|
26
|
+
error: parseError
|
|
27
|
+
});
|
|
28
|
+
manifest.name = agent.id;
|
|
29
|
+
for (const field of agent.fields) {
|
|
30
|
+
if (field.name.value === "type") {
|
|
31
|
+
manifest.type = parseBareField(field, "type");
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (field.name.value === "description") {
|
|
35
|
+
manifest.description = parseStringField(field, "Expected description \"<text>\"");
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (field.name.value === "instructions") {
|
|
39
|
+
manifest.instructions = parseStringField(field, "Expected instructions \"<path>\"");
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (field.name.value === "model") {
|
|
43
|
+
manifest.model = parseStringField(field, "Expected model \"<path>\"");
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (field.name.value === "tool") {
|
|
47
|
+
manifest.tools.push(parseTool(field));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (field.name.value === "budget") manifest.budget = parseBudget(field);
|
|
51
|
+
}
|
|
52
|
+
if (!manifest.type) throw new AgentDslCompileError("Agent type is required", 1);
|
|
53
|
+
if (!manifest.model) throw new AgentDslCompileError("Agent model is required", 1);
|
|
54
|
+
return { manifest: {
|
|
55
|
+
type: manifest.type,
|
|
56
|
+
name: manifest.name,
|
|
57
|
+
...manifest.description ? { description: manifest.description } : {},
|
|
58
|
+
...manifest.instructions ? { instructions: manifest.instructions } : {},
|
|
59
|
+
model: manifest.model,
|
|
60
|
+
...manifest.tools.length > 0 ? { tools: manifest.tools } : {},
|
|
61
|
+
...manifest.budget ? { budget: manifest.budget } : {}
|
|
62
|
+
} };
|
|
63
|
+
}
|
|
64
|
+
function formatAgentDsl(source) {
|
|
65
|
+
const { manifest } = compileAgentDsl(source);
|
|
66
|
+
const lines = [`agent ${JSON.stringify(manifest.name)} {`, ` type ${manifest.type}`];
|
|
67
|
+
if (manifest.description) lines.push(` description ${JSON.stringify(manifest.description)}`);
|
|
68
|
+
if (manifest.instructions) lines.push(` instructions ${JSON.stringify(manifest.instructions)}`);
|
|
69
|
+
if (manifest.model) lines.push(` model ${JSON.stringify(manifest.model)}`);
|
|
70
|
+
for (const tool of manifest.tools ?? []) {
|
|
71
|
+
const maxDepth = tool.maxDepth === void 0 ? "" : ` maxDepth ${tool.maxDepth}`;
|
|
72
|
+
lines.push(` tool ${JSON.stringify(tool.path)} ops ${tool.ops.join(",")}${maxDepth}`);
|
|
73
|
+
}
|
|
74
|
+
if (manifest.budget) {
|
|
75
|
+
const maxRounds = manifest.budget.max_rounds ?? 0;
|
|
76
|
+
const totalTokens = manifest.budget.total_tokens ?? 0;
|
|
77
|
+
lines.push(` budget maxRounds ${maxRounds} totalTokens ${totalTokens}`);
|
|
78
|
+
}
|
|
79
|
+
lines.push("}");
|
|
80
|
+
return `${lines.join("\n")}\n`;
|
|
81
|
+
}
|
|
82
|
+
function parseError(message, line, column = 1) {
|
|
83
|
+
return new AgentDslCompileError(message, line, column);
|
|
84
|
+
}
|
|
85
|
+
function parseBareField(field, keyword) {
|
|
86
|
+
const value = field.values[0];
|
|
87
|
+
if (field.values.length !== 1 || value?.type !== "word" || !/^[A-Za-z0-9_-]+$/.test(value.value)) throw new AgentDslCompileError(`Expected ${keyword} <identifier>`, value?.line ?? field.name.line, value?.column ?? field.name.column);
|
|
88
|
+
return value.value;
|
|
89
|
+
}
|
|
90
|
+
function parseStringField(field, message) {
|
|
91
|
+
const value = field.values[0];
|
|
92
|
+
if (field.values.length !== 1 || value?.type !== "string") throw new AgentDslCompileError(message, value?.line ?? field.name.line, value?.column ?? field.name.column);
|
|
93
|
+
return parseDslStringToken(value, parseError);
|
|
94
|
+
}
|
|
95
|
+
function parseTool(field) {
|
|
96
|
+
const [path, opsKeyword, opsValue, maxDepthKeyword, maxDepthValue, ...extra] = field.values;
|
|
97
|
+
if (path?.type !== "string" || opsKeyword?.type !== "word" || opsKeyword.value !== "ops" || opsValue?.type !== "word" || extra.length > 0 || maxDepthKeyword && (maxDepthKeyword.type !== "word" || maxDepthKeyword.value !== "maxDepth" || maxDepthValue?.type !== "word" || !/^\d+$/.test(maxDepthValue.value))) throw new AgentDslCompileError("Expected tool \"<path>\" ops read,list,stat [maxDepth <number>]", field.name.line, field.name.column);
|
|
98
|
+
return {
|
|
99
|
+
path: parseDslStringToken(path, parseError),
|
|
100
|
+
ops: opsValue.value.split(",").filter(Boolean),
|
|
101
|
+
...maxDepthValue ? { maxDepth: Number(maxDepthValue.value) } : {}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function parseBudget(field) {
|
|
105
|
+
const [maxRoundsKeyword, maxRoundsValue, totalTokensKeyword, totalTokensValue, ...extra] = field.values;
|
|
106
|
+
if (maxRoundsKeyword?.type !== "word" || maxRoundsKeyword.value !== "maxRounds" || maxRoundsValue?.type !== "word" || !/^\d+$/.test(maxRoundsValue.value) || totalTokensKeyword?.type !== "word" || totalTokensKeyword.value !== "totalTokens" || totalTokensValue?.type !== "word" || !/^\d+$/.test(totalTokensValue.value) || extra.length > 0) throw new AgentDslCompileError("Expected budget maxRounds <number> totalTokens <number>", field.name.line, field.name.column);
|
|
107
|
+
return {
|
|
108
|
+
max_rounds: Number(maxRoundsValue.value),
|
|
109
|
+
total_tokens: Number(totalTokensValue.value)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { AgentDslCompileError, compileAgentDsl, formatAgentDsl };
|
|
115
|
+
//# sourceMappingURL=agent-dsl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-dsl.mjs","names":[],"sources":["../src/agent-dsl.ts"],"sourcesContent":["import { type DslField, parseDeclaration, parseDslStringToken } from \"./dsl-shared.js\";\n\nexport interface AgentDslCompileResult {\n manifest: AgentManifest;\n}\n\nexport interface AgentManifest {\n type: string;\n name: string;\n description?: string;\n instructions?: string;\n model?: string;\n tools?: AgentTool[];\n budget?: {\n max_rounds?: number;\n total_tokens?: number;\n };\n}\n\nexport interface AgentTool {\n path: string;\n ops: string[];\n maxDepth?: number;\n}\n\nexport class AgentDslCompileError extends Error {\n constructor(\n message: string,\n readonly line: number,\n readonly column = 1,\n ) {\n super(`${line}:${column} ${message}`);\n this.name = \"AgentDslCompileError\";\n }\n}\n\nexport function compileAgentDsl(source: string): AgentDslCompileResult {\n const manifest: Partial<AgentManifest> & { tools: AgentTool[] } = { tools: [] };\n\n const agent = parseDeclaration(source, {\n kind: \"agent\",\n allowQuotedId: true,\n expected: 'Expected agent \"<name>\" {',\n fieldKeywords: [\"type\", \"description\", \"instructions\", \"model\", \"tool\", \"budget\"],\n error: parseError,\n });\n\n manifest.name = agent.id;\n for (const field of agent.fields) {\n if (field.name.value === \"type\") {\n manifest.type = parseBareField(field, \"type\");\n continue;\n }\n if (field.name.value === \"description\") {\n manifest.description = parseStringField(field, 'Expected description \"<text>\"');\n continue;\n }\n if (field.name.value === \"instructions\") {\n manifest.instructions = parseStringField(field, 'Expected instructions \"<path>\"');\n continue;\n }\n if (field.name.value === \"model\") {\n manifest.model = parseStringField(field, 'Expected model \"<path>\"');\n continue;\n }\n if (field.name.value === \"tool\") {\n manifest.tools.push(parseTool(field));\n continue;\n }\n if (field.name.value === \"budget\") {\n manifest.budget = parseBudget(field);\n }\n }\n\n if (!manifest.type) throw new AgentDslCompileError(\"Agent type is required\", 1);\n if (!manifest.model) throw new AgentDslCompileError(\"Agent model is required\", 1);\n\n return {\n manifest: {\n type: manifest.type,\n name: manifest.name,\n ...(manifest.description ? { description: manifest.description } : {}),\n ...(manifest.instructions ? { instructions: manifest.instructions } : {}),\n model: manifest.model,\n ...(manifest.tools.length > 0 ? { tools: manifest.tools } : {}),\n ...(manifest.budget ? { budget: manifest.budget } : {}),\n },\n };\n}\n\nexport function formatAgentDsl(source: string): string {\n const { manifest } = compileAgentDsl(source);\n const lines = [`agent ${JSON.stringify(manifest.name)} {`, ` type ${manifest.type}`];\n if (manifest.description) lines.push(` description ${JSON.stringify(manifest.description)}`);\n if (manifest.instructions) lines.push(` instructions ${JSON.stringify(manifest.instructions)}`);\n if (manifest.model) lines.push(` model ${JSON.stringify(manifest.model)}`);\n for (const tool of manifest.tools ?? []) {\n const maxDepth = tool.maxDepth === undefined ? \"\" : ` maxDepth ${tool.maxDepth}`;\n lines.push(` tool ${JSON.stringify(tool.path)} ops ${tool.ops.join(\",\")}${maxDepth}`);\n }\n if (manifest.budget) {\n const maxRounds = manifest.budget.max_rounds ?? 0;\n const totalTokens = manifest.budget.total_tokens ?? 0;\n lines.push(` budget maxRounds ${maxRounds} totalTokens ${totalTokens}`);\n }\n lines.push(\"}\");\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nfunction parseError(message: string, line: number, column = 1): AgentDslCompileError {\n return new AgentDslCompileError(message, line, column);\n}\n\nfunction parseBareField(field: DslField, keyword: string): string {\n const value = field.values[0];\n if (\n field.values.length !== 1 ||\n value?.type !== \"word\" ||\n !/^[A-Za-z0-9_-]+$/.test(value.value)\n ) {\n throw new AgentDslCompileError(\n `Expected ${keyword} <identifier>`,\n value?.line ?? field.name.line,\n value?.column ?? field.name.column,\n );\n }\n return value.value;\n}\n\nfunction parseStringField(field: DslField, message: string): string {\n const value = field.values[0];\n if (field.values.length !== 1 || value?.type !== \"string\") {\n throw new AgentDslCompileError(\n message,\n value?.line ?? field.name.line,\n value?.column ?? field.name.column,\n );\n }\n return parseDslStringToken(value, parseError);\n}\n\nfunction parseTool(field: DslField): AgentTool {\n const [path, opsKeyword, opsValue, maxDepthKeyword, maxDepthValue, ...extra] = field.values;\n if (\n path?.type !== \"string\" ||\n opsKeyword?.type !== \"word\" ||\n opsKeyword.value !== \"ops\" ||\n opsValue?.type !== \"word\" ||\n extra.length > 0 ||\n (maxDepthKeyword &&\n (maxDepthKeyword.type !== \"word\" ||\n maxDepthKeyword.value !== \"maxDepth\" ||\n maxDepthValue?.type !== \"word\" ||\n !/^\\d+$/.test(maxDepthValue.value)))\n ) {\n throw new AgentDslCompileError(\n 'Expected tool \"<path>\" ops read,list,stat [maxDepth <number>]',\n field.name.line,\n field.name.column,\n );\n }\n\n return {\n path: parseDslStringToken(path, parseError),\n ops: opsValue.value.split(\",\").filter(Boolean),\n ...(maxDepthValue ? { maxDepth: Number(maxDepthValue.value) } : {}),\n };\n}\n\nfunction parseBudget(field: DslField): NonNullable<AgentManifest[\"budget\"]> {\n const [maxRoundsKeyword, maxRoundsValue, totalTokensKeyword, totalTokensValue, ...extra] =\n field.values;\n if (\n maxRoundsKeyword?.type !== \"word\" ||\n maxRoundsKeyword.value !== \"maxRounds\" ||\n maxRoundsValue?.type !== \"word\" ||\n !/^\\d+$/.test(maxRoundsValue.value) ||\n totalTokensKeyword?.type !== \"word\" ||\n totalTokensKeyword.value !== \"totalTokens\" ||\n totalTokensValue?.type !== \"word\" ||\n !/^\\d+$/.test(totalTokensValue.value) ||\n extra.length > 0\n ) {\n throw new AgentDslCompileError(\n \"Expected budget maxRounds <number> totalTokens <number>\",\n field.name.line,\n field.name.column,\n );\n }\n return {\n max_rounds: Number(maxRoundsValue.value),\n total_tokens: Number(totalTokensValue.value),\n };\n}\n"],"mappings":";;;AAyBA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YACE,SACA,AAAS,MACT,AAAS,SAAS,GAClB;AACA,QAAM,GAAG,KAAK,GAAG,OAAO,GAAG,UAAU;EAH5B;EACA;AAGT,OAAK,OAAO;;;AAIhB,SAAgB,gBAAgB,QAAuC;CACrE,MAAM,WAA4D,EAAE,OAAO,EAAE,EAAE;CAE/E,MAAM,QAAQ,iBAAiB,QAAQ;EACrC,MAAM;EACN,eAAe;EACf,UAAU;EACV,eAAe;GAAC;GAAQ;GAAe;GAAgB;GAAS;GAAQ;GAAS;EACjF,OAAO;EACR,CAAC;AAEF,UAAS,OAAO,MAAM;AACtB,MAAK,MAAM,SAAS,MAAM,QAAQ;AAChC,MAAI,MAAM,KAAK,UAAU,QAAQ;AAC/B,YAAS,OAAO,eAAe,OAAO,OAAO;AAC7C;;AAEF,MAAI,MAAM,KAAK,UAAU,eAAe;AACtC,YAAS,cAAc,iBAAiB,OAAO,kCAAgC;AAC/E;;AAEF,MAAI,MAAM,KAAK,UAAU,gBAAgB;AACvC,YAAS,eAAe,iBAAiB,OAAO,mCAAiC;AACjF;;AAEF,MAAI,MAAM,KAAK,UAAU,SAAS;AAChC,YAAS,QAAQ,iBAAiB,OAAO,4BAA0B;AACnE;;AAEF,MAAI,MAAM,KAAK,UAAU,QAAQ;AAC/B,YAAS,MAAM,KAAK,UAAU,MAAM,CAAC;AACrC;;AAEF,MAAI,MAAM,KAAK,UAAU,SACvB,UAAS,SAAS,YAAY,MAAM;;AAIxC,KAAI,CAAC,SAAS,KAAM,OAAM,IAAI,qBAAqB,0BAA0B,EAAE;AAC/E,KAAI,CAAC,SAAS,MAAO,OAAM,IAAI,qBAAqB,2BAA2B,EAAE;AAEjF,QAAO,EACL,UAAU;EACR,MAAM,SAAS;EACf,MAAM,SAAS;EACf,GAAI,SAAS,cAAc,EAAE,aAAa,SAAS,aAAa,GAAG,EAAE;EACrE,GAAI,SAAS,eAAe,EAAE,cAAc,SAAS,cAAc,GAAG,EAAE;EACxE,OAAO,SAAS;EAChB,GAAI,SAAS,MAAM,SAAS,IAAI,EAAE,OAAO,SAAS,OAAO,GAAG,EAAE;EAC9D,GAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,QAAQ,GAAG,EAAE;EACvD,EACF;;AAGH,SAAgB,eAAe,QAAwB;CACrD,MAAM,EAAE,aAAa,gBAAgB,OAAO;CAC5C,MAAM,QAAQ,CAAC,SAAS,KAAK,UAAU,SAAS,KAAK,CAAC,KAAK,UAAU,SAAS,OAAO;AACrF,KAAI,SAAS,YAAa,OAAM,KAAK,iBAAiB,KAAK,UAAU,SAAS,YAAY,GAAG;AAC7F,KAAI,SAAS,aAAc,OAAM,KAAK,kBAAkB,KAAK,UAAU,SAAS,aAAa,GAAG;AAChG,KAAI,SAAS,MAAO,OAAM,KAAK,WAAW,KAAK,UAAU,SAAS,MAAM,GAAG;AAC3E,MAAK,MAAM,QAAQ,SAAS,SAAS,EAAE,EAAE;EACvC,MAAM,WAAW,KAAK,aAAa,SAAY,KAAK,aAAa,KAAK;AACtE,QAAM,KAAK,UAAU,KAAK,UAAU,KAAK,KAAK,CAAC,OAAO,KAAK,IAAI,KAAK,IAAI,GAAG,WAAW;;AAExF,KAAI,SAAS,QAAQ;EACnB,MAAM,YAAY,SAAS,OAAO,cAAc;EAChD,MAAM,cAAc,SAAS,OAAO,gBAAgB;AACpD,QAAM,KAAK,sBAAsB,UAAU,eAAe,cAAc;;AAE1E,OAAM,KAAK,IAAI;AACf,QAAO,GAAG,MAAM,KAAK,KAAK,CAAC;;AAG7B,SAAS,WAAW,SAAiB,MAAc,SAAS,GAAyB;AACnF,QAAO,IAAI,qBAAqB,SAAS,MAAM,OAAO;;AAGxD,SAAS,eAAe,OAAiB,SAAyB;CAChE,MAAM,QAAQ,MAAM,OAAO;AAC3B,KACE,MAAM,OAAO,WAAW,KACxB,OAAO,SAAS,UAChB,CAAC,mBAAmB,KAAK,MAAM,MAAM,CAErC,OAAM,IAAI,qBACR,YAAY,QAAQ,gBACpB,OAAO,QAAQ,MAAM,KAAK,MAC1B,OAAO,UAAU,MAAM,KAAK,OAC7B;AAEH,QAAO,MAAM;;AAGf,SAAS,iBAAiB,OAAiB,SAAyB;CAClE,MAAM,QAAQ,MAAM,OAAO;AAC3B,KAAI,MAAM,OAAO,WAAW,KAAK,OAAO,SAAS,SAC/C,OAAM,IAAI,qBACR,SACA,OAAO,QAAQ,MAAM,KAAK,MAC1B,OAAO,UAAU,MAAM,KAAK,OAC7B;AAEH,QAAO,oBAAoB,OAAO,WAAW;;AAG/C,SAAS,UAAU,OAA4B;CAC7C,MAAM,CAAC,MAAM,YAAY,UAAU,iBAAiB,eAAe,GAAG,SAAS,MAAM;AACrF,KACE,MAAM,SAAS,YACf,YAAY,SAAS,UACrB,WAAW,UAAU,SACrB,UAAU,SAAS,UACnB,MAAM,SAAS,KACd,oBACE,gBAAgB,SAAS,UACxB,gBAAgB,UAAU,cAC1B,eAAe,SAAS,UACxB,CAAC,QAAQ,KAAK,cAAc,MAAM,EAEtC,OAAM,IAAI,qBACR,mEACA,MAAM,KAAK,MACX,MAAM,KAAK,OACZ;AAGH,QAAO;EACL,MAAM,oBAAoB,MAAM,WAAW;EAC3C,KAAK,SAAS,MAAM,MAAM,IAAI,CAAC,OAAO,QAAQ;EAC9C,GAAI,gBAAgB,EAAE,UAAU,OAAO,cAAc,MAAM,EAAE,GAAG,EAAE;EACnE;;AAGH,SAAS,YAAY,OAAuD;CAC1E,MAAM,CAAC,kBAAkB,gBAAgB,oBAAoB,kBAAkB,GAAG,SAChF,MAAM;AACR,KACE,kBAAkB,SAAS,UAC3B,iBAAiB,UAAU,eAC3B,gBAAgB,SAAS,UACzB,CAAC,QAAQ,KAAK,eAAe,MAAM,IACnC,oBAAoB,SAAS,UAC7B,mBAAmB,UAAU,iBAC7B,kBAAkB,SAAS,UAC3B,CAAC,QAAQ,KAAK,iBAAiB,MAAM,IACrC,MAAM,SAAS,EAEf,OAAM,IAAI,qBACR,2DACA,MAAM,KAAK,MACX,MAAM,KAAK,OACZ;AAEH,QAAO;EACL,YAAY,OAAO,eAAe,MAAM;EACxC,cAAc,OAAO,iBAAiB,MAAM;EAC7C"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/arc-compat.ts
|
|
3
|
+
const SEMVER_RE = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
4
|
+
function normalizeArcVersionRequirement(value) {
|
|
5
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
6
|
+
const raw = value;
|
|
7
|
+
const requirement = {};
|
|
8
|
+
if (typeof raw.minVersion === "string" && raw.minVersion.trim()) requirement.minVersion = raw.minVersion.trim();
|
|
9
|
+
if (typeof raw.requiredVersion === "string" && raw.requiredVersion.trim()) requirement.requiredVersion = raw.requiredVersion.trim();
|
|
10
|
+
if (typeof raw.version === "string" && raw.version.trim() && !requirement.requiredVersion) requirement.requiredVersion = raw.version.trim();
|
|
11
|
+
return requirement.minVersion || requirement.requiredVersion ? requirement : void 0;
|
|
12
|
+
}
|
|
13
|
+
function checkArcVersionCompatibility(runtimeVersion, requirement) {
|
|
14
|
+
if (!requirement?.minVersion && !requirement?.requiredVersion) return {
|
|
15
|
+
ok: true,
|
|
16
|
+
runtimeVersion
|
|
17
|
+
};
|
|
18
|
+
if (requirement.minVersion) {
|
|
19
|
+
const cmp = compareSemver(runtimeVersion, requirement.minVersion);
|
|
20
|
+
if (cmp === void 0) return {
|
|
21
|
+
ok: false,
|
|
22
|
+
runtimeVersion,
|
|
23
|
+
requirement,
|
|
24
|
+
message: `Arc runtime version ${JSON.stringify(runtimeVersion)} cannot be compared with minVersion ${JSON.stringify(requirement.minVersion)}`
|
|
25
|
+
};
|
|
26
|
+
if (cmp < 0) return {
|
|
27
|
+
ok: false,
|
|
28
|
+
runtimeVersion,
|
|
29
|
+
requirement,
|
|
30
|
+
message: `Arc runtime ${runtimeVersion} is older than required minimum ${requirement.minVersion}`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (requirement.requiredVersion) {
|
|
34
|
+
const ok = satisfiesVersionRange(runtimeVersion, requirement.requiredVersion);
|
|
35
|
+
if (ok === void 0) return {
|
|
36
|
+
ok: false,
|
|
37
|
+
runtimeVersion,
|
|
38
|
+
requirement,
|
|
39
|
+
message: `Arc requiredVersion ${JSON.stringify(requirement.requiredVersion)} is not supported`
|
|
40
|
+
};
|
|
41
|
+
if (!ok) return {
|
|
42
|
+
ok: false,
|
|
43
|
+
runtimeVersion,
|
|
44
|
+
requirement,
|
|
45
|
+
message: `Arc runtime ${runtimeVersion} does not satisfy ${requirement.requiredVersion}`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
ok: true,
|
|
50
|
+
runtimeVersion,
|
|
51
|
+
requirement
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function compareSemver(a, b) {
|
|
55
|
+
const left = parseSemver(a);
|
|
56
|
+
const right = parseSemver(b);
|
|
57
|
+
if (!left || !right) return void 0;
|
|
58
|
+
for (const key of [
|
|
59
|
+
"major",
|
|
60
|
+
"minor",
|
|
61
|
+
"patch"
|
|
62
|
+
]) {
|
|
63
|
+
if (left[key] > right[key]) return 1;
|
|
64
|
+
if (left[key] < right[key]) return -1;
|
|
65
|
+
}
|
|
66
|
+
return comparePrerelease(left.prerelease, right.prerelease);
|
|
67
|
+
}
|
|
68
|
+
function satisfiesVersionRange(version, range) {
|
|
69
|
+
if (range.includes("||")) return void 0;
|
|
70
|
+
const parts = range.split(/\s+/).map((part) => part.trim()).filter(Boolean);
|
|
71
|
+
if (parts.length === 0) return void 0;
|
|
72
|
+
for (const part of parts) {
|
|
73
|
+
const match = /^(>=|<=|>|<|=)?\s*(.+)$/.exec(part);
|
|
74
|
+
if (!match) return void 0;
|
|
75
|
+
const op = match[1] || "=";
|
|
76
|
+
const expected = match[2];
|
|
77
|
+
const cmp = compareSemver(version, expected);
|
|
78
|
+
if (cmp === void 0) return void 0;
|
|
79
|
+
if (op === ">" && !(cmp > 0)) return false;
|
|
80
|
+
if (op === ">=" && !(cmp >= 0)) return false;
|
|
81
|
+
if (op === "<" && !(cmp < 0)) return false;
|
|
82
|
+
if (op === "<=" && !(cmp <= 0)) return false;
|
|
83
|
+
if (op === "=" && cmp !== 0) return false;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
function parseSemver(value) {
|
|
88
|
+
const match = SEMVER_RE.exec(value.trim());
|
|
89
|
+
if (!match) return void 0;
|
|
90
|
+
return {
|
|
91
|
+
major: Number(match[1]),
|
|
92
|
+
minor: Number(match[2]),
|
|
93
|
+
patch: Number(match[3]),
|
|
94
|
+
prerelease: match[4] ? match[4].split(".") : []
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function comparePrerelease(a, b) {
|
|
98
|
+
if (a.length === 0 && b.length === 0) return 0;
|
|
99
|
+
if (a.length === 0) return 1;
|
|
100
|
+
if (b.length === 0) return -1;
|
|
101
|
+
const len = Math.max(a.length, b.length);
|
|
102
|
+
for (let i = 0; i < len; i += 1) {
|
|
103
|
+
const left = a[i];
|
|
104
|
+
const right = b[i];
|
|
105
|
+
if (left === void 0) return -1;
|
|
106
|
+
if (right === void 0) return 1;
|
|
107
|
+
const leftNum = /^\d+$/.test(left) ? Number(left) : void 0;
|
|
108
|
+
const rightNum = /^\d+$/.test(right) ? Number(right) : void 0;
|
|
109
|
+
if (leftNum !== void 0 && rightNum !== void 0) {
|
|
110
|
+
if (leftNum > rightNum) return 1;
|
|
111
|
+
if (leftNum < rightNum) return -1;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (leftNum !== void 0) return -1;
|
|
115
|
+
if (rightNum !== void 0) return 1;
|
|
116
|
+
if (left > right) return 1;
|
|
117
|
+
if (left < right) return -1;
|
|
118
|
+
}
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.checkArcVersionCompatibility = checkArcVersionCompatibility;
|
|
124
|
+
exports.compareSemver = compareSemver;
|
|
125
|
+
exports.normalizeArcVersionRequirement = normalizeArcVersionRequirement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/arc-compat.d.ts
|
|
2
|
+
interface ArcVersionRequirement {
|
|
3
|
+
minVersion?: string;
|
|
4
|
+
requiredVersion?: string;
|
|
5
|
+
}
|
|
6
|
+
interface ArcCompatibilityResult {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
runtimeVersion: string;
|
|
9
|
+
requirement?: ArcVersionRequirement;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function normalizeArcVersionRequirement(value: unknown): ArcVersionRequirement | undefined;
|
|
13
|
+
declare function checkArcVersionCompatibility(runtimeVersion: string, requirement: ArcVersionRequirement | undefined): ArcCompatibilityResult;
|
|
14
|
+
declare function compareSemver(a: string, b: string): number | undefined;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ArcCompatibilityResult, ArcVersionRequirement, checkArcVersionCompatibility, compareSemver, normalizeArcVersionRequirement };
|
|
17
|
+
//# sourceMappingURL=arc-compat.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arc-compat.d.cts","names":[],"sources":["../src/arc-compat.ts"],"mappings":";UAAiB,qBAAA;EACf,UAAA;EACA,eAAA;AAAA;AAAA,UAGe,sBAAA;EACf,EAAA;EACA,cAAA;EACA,WAAA,GAAc,qBAAA;EACd,OAAA;AAAA;AAAA,iBAac,8BAAA,CAA+B,KAAA,YAAiB,qBAAA;AAAA,iBAgBhD,4BAAA,CACd,cAAA,UACA,WAAA,EAAa,qBAAA,eACZ,sBAAA;AAAA,iBAgDa,aAAA,CAAc,CAAA,UAAW,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/arc-compat.d.ts
|
|
2
|
+
interface ArcVersionRequirement {
|
|
3
|
+
minVersion?: string;
|
|
4
|
+
requiredVersion?: string;
|
|
5
|
+
}
|
|
6
|
+
interface ArcCompatibilityResult {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
runtimeVersion: string;
|
|
9
|
+
requirement?: ArcVersionRequirement;
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function normalizeArcVersionRequirement(value: unknown): ArcVersionRequirement | undefined;
|
|
13
|
+
declare function checkArcVersionCompatibility(runtimeVersion: string, requirement: ArcVersionRequirement | undefined): ArcCompatibilityResult;
|
|
14
|
+
declare function compareSemver(a: string, b: string): number | undefined;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ArcCompatibilityResult, ArcVersionRequirement, checkArcVersionCompatibility, compareSemver, normalizeArcVersionRequirement };
|
|
17
|
+
//# sourceMappingURL=arc-compat.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arc-compat.d.mts","names":[],"sources":["../src/arc-compat.ts"],"mappings":";UAAiB,qBAAA;EACf,UAAA;EACA,eAAA;AAAA;AAAA,UAGe,sBAAA;EACf,EAAA;EACA,cAAA;EACA,WAAA,GAAc,qBAAA;EACd,OAAA;AAAA;AAAA,iBAac,8BAAA,CAA+B,KAAA,YAAiB,qBAAA;AAAA,iBAgBhD,4BAAA,CACd,cAAA,UACA,WAAA,EAAa,qBAAA,eACZ,sBAAA;AAAA,iBAgDa,aAAA,CAAc,CAAA,UAAW,CAAA"}
|