@astrale-os/sdk 0.4.19 → 0.5.0-beta.2
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/README.md +5 -3
- package/dist/auth/exchange.d.ts +11 -0
- package/dist/auth/exchange.d.ts.map +1 -0
- package/dist/auth/exchange.js +8 -0
- package/dist/auth/exchange.js.map +1 -0
- package/dist/auth/index.d.ts +4 -15
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/capability/client.d.ts +25 -0
- package/dist/capability/client.d.ts.map +1 -0
- package/dist/capability/client.js +147 -0
- package/dist/capability/client.js.map +1 -0
- package/dist/capability/contract.d.ts +70 -0
- package/dist/capability/contract.d.ts.map +1 -0
- package/dist/capability/contract.js +3 -0
- package/dist/capability/contract.js.map +1 -0
- package/dist/capability/define.d.ts +14 -0
- package/dist/capability/define.d.ts.map +1 -0
- package/dist/capability/define.js +145 -0
- package/dist/capability/define.js.map +1 -0
- package/dist/capability/index.d.ts +3 -0
- package/dist/capability/index.d.ts.map +1 -0
- package/dist/capability/index.js +2 -0
- package/dist/capability/index.js.map +1 -0
- package/dist/cli/arguments.d.ts +21 -0
- package/dist/cli/arguments.d.ts.map +1 -0
- package/dist/cli/arguments.js +220 -0
- package/dist/cli/arguments.js.map +1 -0
- package/dist/cli/dotenv.d.ts +1 -4
- package/dist/cli/dotenv.d.ts.map +1 -1
- package/dist/cli/dotenv.js +6 -15
- package/dist/cli/dotenv.js.map +1 -1
- package/dist/cli/index.d.ts +4 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/run.d.ts +4 -79
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +47 -326
- package/dist/cli/run.js.map +1 -1
- package/dist/deployment/artifact/bindings.d.ts +7 -0
- package/dist/deployment/artifact/bindings.d.ts.map +1 -0
- package/dist/deployment/artifact/bindings.js +44 -0
- package/dist/deployment/artifact/bindings.js.map +1 -0
- package/dist/deployment/artifact/deployment.d.ts +35 -0
- package/dist/deployment/artifact/deployment.d.ts.map +1 -0
- package/dist/deployment/artifact/deployment.js +91 -0
- package/dist/deployment/artifact/deployment.js.map +1 -0
- package/dist/deployment/artifact/index.d.ts +5 -0
- package/dist/deployment/artifact/index.d.ts.map +1 -0
- package/dist/deployment/artifact/index.js +4 -0
- package/dist/deployment/artifact/index.js.map +1 -0
- package/dist/deployment/check/check.d.ts +8 -0
- package/dist/deployment/check/check.d.ts.map +1 -0
- package/dist/deployment/check/check.js +94 -0
- package/dist/deployment/check/check.js.map +1 -0
- package/dist/deployment/check/contract.d.ts +29 -0
- package/dist/deployment/check/contract.d.ts.map +1 -0
- package/dist/deployment/check/contract.js +2 -0
- package/dist/deployment/check/contract.js.map +1 -0
- package/dist/deployment/check/index.d.ts +3 -0
- package/dist/deployment/check/index.d.ts.map +1 -0
- package/dist/deployment/check/index.js +2 -0
- package/dist/deployment/check/index.js.map +1 -0
- package/dist/deployment/index.d.ts +7 -0
- package/dist/deployment/index.d.ts.map +1 -0
- package/dist/deployment/index.js +4 -0
- package/dist/deployment/index.js.map +1 -0
- package/dist/deployment/provider/adapter.d.ts +56 -0
- package/dist/deployment/provider/adapter.d.ts.map +1 -0
- package/dist/deployment/provider/adapter.js +84 -0
- package/dist/deployment/provider/adapter.js.map +1 -0
- package/dist/deployment/provider/config.d.ts +10 -0
- package/dist/deployment/provider/config.d.ts.map +1 -0
- package/dist/deployment/provider/config.js +8 -0
- package/dist/deployment/provider/config.js.map +1 -0
- package/dist/deployment/provider/index.d.ts +5 -0
- package/dist/deployment/provider/index.d.ts.map +1 -0
- package/dist/deployment/provider/index.js +3 -0
- package/dist/deployment/provider/index.js.map +1 -0
- package/dist/domain/app.d.ts +34 -0
- package/dist/domain/app.d.ts.map +1 -0
- package/dist/domain/app.js +2 -0
- package/dist/domain/app.js.map +1 -0
- package/dist/domain/context.d.ts +68 -0
- package/dist/domain/context.d.ts.map +1 -0
- package/dist/domain/context.js +2 -0
- package/dist/domain/context.js.map +1 -0
- package/dist/domain/define.d.ts +99 -65
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +78 -60
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/handlers.d.ts +53 -0
- package/dist/domain/handlers.d.ts.map +1 -0
- package/dist/domain/handlers.js +88 -0
- package/dist/domain/handlers.js.map +1 -0
- package/dist/domain/implement.d.ts +5 -0
- package/dist/domain/implement.d.ts.map +1 -0
- package/dist/domain/implement.js +23 -0
- package/dist/domain/implement.js.map +1 -0
- package/dist/domain/index.d.ts +13 -4
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +7 -3
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/requirements.d.ts +26 -0
- package/dist/domain/requirements.d.ts.map +1 -0
- package/dist/domain/requirements.js +98 -0
- package/dist/domain/requirements.js.map +1 -0
- package/dist/graph/class/index.d.ts +3 -0
- package/dist/graph/class/index.d.ts.map +1 -0
- package/dist/graph/class/index.js +3 -0
- package/dist/graph/class/index.js.map +1 -0
- package/dist/graph/edge/index.d.ts +3 -0
- package/dist/graph/edge/index.d.ts.map +1 -0
- package/dist/graph/edge/index.js +3 -0
- package/dist/graph/edge/index.js.map +1 -0
- package/dist/graph/index.d.ts +10 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +9 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model/index.d.ts +3 -0
- package/dist/graph/model/index.d.ts.map +1 -0
- package/dist/graph/model/index.js +3 -0
- package/dist/graph/model/index.js.map +1 -0
- package/dist/graph/node/index.d.ts +3 -0
- package/dist/graph/node/index.d.ts.map +1 -0
- package/dist/graph/node/index.js +3 -0
- package/dist/graph/node/index.js.map +1 -0
- package/dist/graph/path/index.d.ts +3 -0
- package/dist/graph/path/index.d.ts.map +1 -0
- package/dist/graph/path/index.js +3 -0
- package/dist/graph/path/index.js.map +1 -0
- package/dist/graph/properties/index.d.ts +3 -0
- package/dist/graph/properties/index.d.ts.map +1 -0
- package/dist/graph/properties/index.js +3 -0
- package/dist/graph/properties/index.js.map +1 -0
- package/dist/index.d.ts +20 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -47
- package/dist/index.js.map +1 -1
- package/dist/invocation/handler.d.ts +51 -0
- package/dist/invocation/handler.d.ts.map +1 -0
- package/dist/invocation/handler.js +289 -0
- package/dist/invocation/handler.js.map +1 -0
- package/dist/invocation/index.d.ts +3 -0
- package/dist/invocation/index.d.ts.map +1 -0
- package/dist/invocation/index.js +2 -0
- package/dist/invocation/index.js.map +1 -0
- package/dist/invocation/receiver.d.ts +5 -0
- package/dist/invocation/receiver.d.ts.map +1 -0
- package/dist/invocation/receiver.js +70 -0
- package/dist/invocation/receiver.js.map +1 -0
- package/dist/invocation/result.d.ts +5 -0
- package/dist/invocation/result.d.ts.map +1 -0
- package/dist/invocation/result.js +146 -0
- package/dist/invocation/result.js.map +1 -0
- package/dist/invocation/selection.d.ts +21 -0
- package/dist/invocation/selection.d.ts.map +1 -0
- package/dist/invocation/selection.js +107 -0
- package/dist/invocation/selection.js.map +1 -0
- package/dist/linter/adapters/typescript/discover.d.ts +4 -0
- package/dist/linter/adapters/typescript/discover.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/discover.js +412 -0
- package/dist/linter/adapters/typescript/discover.js.map +1 -0
- package/dist/linter/adapters/typescript/evidence-admission.d.ts +5 -0
- package/dist/linter/adapters/typescript/evidence-admission.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/evidence-admission.js +22 -0
- package/dist/linter/adapters/typescript/evidence-admission.js.map +1 -0
- package/dist/linter/adapters/typescript/imports.d.ts +7 -0
- package/dist/linter/adapters/typescript/imports.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/imports.js +171 -0
- package/dist/linter/adapters/typescript/imports.js.map +1 -0
- package/dist/linter/adapters/typescript/index.d.ts +48 -0
- package/dist/linter/adapters/typescript/index.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/index.js +8 -0
- package/dist/linter/adapters/typescript/index.js.map +1 -0
- package/dist/linter/adapters/typescript/query-observation.d.ts +4 -0
- package/dist/linter/adapters/typescript/query-observation.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/query-observation.js +172 -0
- package/dist/linter/adapters/typescript/query-observation.js.map +1 -0
- package/dist/linter/adapters/typescript/suppression-directives.d.ts +5 -0
- package/dist/linter/adapters/typescript/suppression-directives.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/suppression-directives.js +85 -0
- package/dist/linter/adapters/typescript/suppression-directives.js.map +1 -0
- package/dist/linter/adapters/typescript/syntax.d.ts +39 -0
- package/dist/linter/adapters/typescript/syntax.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/syntax.js +183 -0
- package/dist/linter/adapters/typescript/syntax.js.map +1 -0
- package/dist/linter/adapters/typescript/type-universe.d.ts +2 -0
- package/dist/linter/adapters/typescript/type-universe.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/type-universe.js +265 -0
- package/dist/linter/adapters/typescript/type-universe.js.map +1 -0
- package/dist/linter/catalog/compile.d.ts +3 -0
- package/dist/linter/catalog/compile.d.ts.map +1 -0
- package/dist/linter/catalog/compile.js +111 -0
- package/dist/linter/catalog/compile.js.map +1 -0
- package/dist/linter/catalog/index.d.ts +19 -0
- package/dist/linter/catalog/index.d.ts.map +1 -0
- package/dist/linter/catalog/index.js +3 -0
- package/dist/linter/catalog/index.js.map +1 -0
- package/dist/linter/catalog/revision.d.ts +7 -0
- package/dist/linter/catalog/revision.d.ts.map +1 -0
- package/dist/linter/catalog/revision.js +13 -0
- package/dist/linter/catalog/revision.js.map +1 -0
- package/dist/linter/diagnostics/error.d.ts +10 -0
- package/dist/linter/diagnostics/error.d.ts.map +1 -0
- package/dist/linter/diagnostics/error.js +10 -0
- package/dist/linter/diagnostics/error.js.map +1 -0
- package/dist/linter/diagnostics/index.d.ts +29 -0
- package/dist/linter/diagnostics/index.d.ts.map +1 -0
- package/dist/linter/diagnostics/index.js +3 -0
- package/dist/linter/diagnostics/index.js.map +1 -0
- package/dist/linter/diagnostics/sort.d.ts +3 -0
- package/dist/linter/diagnostics/sort.d.ts.map +1 -0
- package/dist/linter/diagnostics/sort.js +27 -0
- package/dist/linter/diagnostics/sort.js.map +1 -0
- package/dist/linter/evaluation/binding/bind.d.ts +5 -0
- package/dist/linter/evaluation/binding/bind.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/bind.js +356 -0
- package/dist/linter/evaluation/binding/bind.js.map +1 -0
- package/dist/linter/evaluation/binding/diagnostic.d.ts +5 -0
- package/dist/linter/evaluation/binding/diagnostic.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/diagnostic.js +17 -0
- package/dist/linter/evaluation/binding/diagnostic.js.map +1 -0
- package/dist/linter/evaluation/binding/index.d.ts +2 -0
- package/dist/linter/evaluation/binding/index.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/index.js +2 -0
- package/dist/linter/evaluation/binding/index.js.map +1 -0
- package/dist/linter/evaluation/contract/availability.d.ts +28 -0
- package/dist/linter/evaluation/contract/availability.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/availability.js +2 -0
- package/dist/linter/evaluation/contract/availability.js.map +1 -0
- package/dist/linter/evaluation/contract/decision.d.ts +26 -0
- package/dist/linter/evaluation/contract/decision.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/decision.js +2 -0
- package/dist/linter/evaluation/contract/decision.js.map +1 -0
- package/dist/linter/evaluation/contract/evidence.d.ts +12 -0
- package/dist/linter/evaluation/contract/evidence.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/evidence.js +2 -0
- package/dist/linter/evaluation/contract/evidence.js.map +1 -0
- package/dist/linter/evaluation/contract/implementation.d.ts +22 -0
- package/dist/linter/evaluation/contract/implementation.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/implementation.js +2 -0
- package/dist/linter/evaluation/contract/implementation.js.map +1 -0
- package/dist/linter/evaluation/contract/index.d.ts +5 -0
- package/dist/linter/evaluation/contract/index.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/index.js +2 -0
- package/dist/linter/evaluation/contract/index.js.map +1 -0
- package/dist/linter/evaluation/index.d.ts +3 -0
- package/dist/linter/evaluation/index.d.ts.map +1 -0
- package/dist/linter/evaluation/index.js +2 -0
- package/dist/linter/evaluation/index.js.map +1 -0
- package/dist/linter/implementations/source/capabilities.d.ts +3 -0
- package/dist/linter/implementations/source/capabilities.d.ts.map +1 -0
- package/dist/linter/implementations/source/capabilities.js +41 -0
- package/dist/linter/implementations/source/capabilities.js.map +1 -0
- package/dist/linter/implementations/source/contract.d.ts +17 -0
- package/dist/linter/implementations/source/contract.d.ts.map +1 -0
- package/dist/linter/implementations/source/contract.js +53 -0
- package/dist/linter/implementations/source/contract.js.map +1 -0
- package/dist/linter/implementations/source/functions.d.ts +3 -0
- package/dist/linter/implementations/source/functions.d.ts.map +1 -0
- package/dist/linter/implementations/source/functions.js +102 -0
- package/dist/linter/implementations/source/functions.js.map +1 -0
- package/dist/linter/implementations/source/global.d.ts +3 -0
- package/dist/linter/implementations/source/global.d.ts.map +1 -0
- package/dist/linter/implementations/source/global.js +812 -0
- package/dist/linter/implementations/source/global.js.map +1 -0
- package/dist/linter/implementations/source/index.d.ts +4 -0
- package/dist/linter/implementations/source/index.d.ts.map +1 -0
- package/dist/linter/implementations/source/index.js +4 -0
- package/dist/linter/implementations/source/index.js.map +1 -0
- package/dist/linter/implementations/source/integrations.d.ts +3 -0
- package/dist/linter/implementations/source/integrations.d.ts.map +1 -0
- package/dist/linter/implementations/source/integrations.js +186 -0
- package/dist/linter/implementations/source/integrations.js.map +1 -0
- package/dist/linter/implementations/source/migrations.d.ts +3 -0
- package/dist/linter/implementations/source/migrations.d.ts.map +1 -0
- package/dist/linter/implementations/source/migrations.js +115 -0
- package/dist/linter/implementations/source/migrations.js.map +1 -0
- package/dist/linter/implementations/source/mutations.d.ts +3 -0
- package/dist/linter/implementations/source/mutations.d.ts.map +1 -0
- package/dist/linter/implementations/source/mutations.js +185 -0
- package/dist/linter/implementations/source/mutations.js.map +1 -0
- package/dist/linter/implementations/source/queries.d.ts +3 -0
- package/dist/linter/implementations/source/queries.d.ts.map +1 -0
- package/dist/linter/implementations/source/queries.js +1000 -0
- package/dist/linter/implementations/source/queries.js.map +1 -0
- package/dist/linter/implementations/source/rules.d.ts +3 -0
- package/dist/linter/implementations/source/rules.d.ts.map +1 -0
- package/dist/linter/implementations/source/rules.js +141 -0
- package/dist/linter/implementations/source/rules.js.map +1 -0
- package/dist/linter/implementations/source/schema.d.ts +3 -0
- package/dist/linter/implementations/source/schema.d.ts.map +1 -0
- package/dist/linter/implementations/source/schema.js +105 -0
- package/dist/linter/implementations/source/schema.js.map +1 -0
- package/dist/linter/implementations/source/shared.d.ts +42 -0
- package/dist/linter/implementations/source/shared.d.ts.map +1 -0
- package/dist/linter/implementations/source/shared.js +239 -0
- package/dist/linter/implementations/source/shared.js.map +1 -0
- package/dist/linter/implementations/source/states.d.ts +3 -0
- package/dist/linter/implementations/source/states.d.ts.map +1 -0
- package/dist/linter/implementations/source/states.js +2 -0
- package/dist/linter/implementations/source/states.js.map +1 -0
- package/dist/linter/implementations/source/tests.d.ts +3 -0
- package/dist/linter/implementations/source/tests.d.ts.map +1 -0
- package/dist/linter/implementations/source/tests.js +28 -0
- package/dist/linter/implementations/source/tests.js.map +1 -0
- package/dist/linter/implementations/source/ui.d.ts +3 -0
- package/dist/linter/implementations/source/ui.d.ts.map +1 -0
- package/dist/linter/implementations/source/ui.js +21 -0
- package/dist/linter/implementations/source/ui.js.map +1 -0
- package/dist/linter/implementations/source/utils.d.ts +3 -0
- package/dist/linter/implementations/source/utils.d.ts.map +1 -0
- package/dist/linter/implementations/source/utils.js +29 -0
- package/dist/linter/implementations/source/utils.js.map +1 -0
- package/dist/linter/implementations/source/verifiers.d.ts +3 -0
- package/dist/linter/implementations/source/verifiers.d.ts.map +1 -0
- package/dist/linter/implementations/source/verifiers.js +33 -0
- package/dist/linter/implementations/source/verifiers.js.map +1 -0
- package/dist/linter/implementations/source/views.d.ts +3 -0
- package/dist/linter/implementations/source/views.d.ts.map +1 -0
- package/dist/linter/implementations/source/views.js +36 -0
- package/dist/linter/implementations/source/views.js.map +1 -0
- package/dist/linter/implementations/source/workflows.d.ts +3 -0
- package/dist/linter/implementations/source/workflows.d.ts.map +1 -0
- package/dist/linter/implementations/source/workflows.js +308 -0
- package/dist/linter/implementations/source/workflows.js.map +1 -0
- package/dist/linter/index.d.ts +7 -8
- package/dist/linter/index.d.ts.map +1 -1
- package/dist/linter/index.js +2 -4
- package/dist/linter/index.js.map +1 -1
- package/dist/linter/lint.d.ts +22 -8
- package/dist/linter/lint.d.ts.map +1 -1
- package/dist/linter/lint.js +58 -15
- package/dist/linter/lint.js.map +1 -1
- package/dist/linter/oxlint/index.d.ts +4 -0
- package/dist/linter/oxlint/index.d.ts.map +1 -0
- package/dist/linter/oxlint/index.js +2 -0
- package/dist/linter/oxlint/index.js.map +1 -0
- package/dist/linter/oxlint/process.d.ts +6 -6
- package/dist/linter/oxlint/process.d.ts.map +1 -1
- package/dist/linter/oxlint/process.js +1 -1
- package/dist/linter/oxlint/process.js.map +1 -1
- package/dist/linter/oxlint/run.d.ts +5 -5
- package/dist/linter/oxlint/run.d.ts.map +1 -1
- package/dist/linter/oxlint/run.js +140 -20
- package/dist/linter/oxlint/run.js.map +1 -1
- package/dist/linter/oxlint-config/ignore-patterns.d.ts +6 -0
- package/dist/linter/oxlint-config/ignore-patterns.d.ts.map +1 -0
- package/dist/linter/oxlint-config/ignore-patterns.js +10 -0
- package/dist/linter/oxlint-config/ignore-patterns.js.map +1 -0
- package/dist/linter/oxlint-config/index.d.ts +5 -0
- package/dist/linter/oxlint-config/index.d.ts.map +1 -0
- package/dist/linter/oxlint-config/index.js +18 -0
- package/dist/linter/oxlint-config/index.js.map +1 -0
- package/dist/linter/packs/domain.d.ts +3 -0
- package/dist/linter/packs/domain.d.ts.map +1 -0
- package/dist/linter/packs/domain.js +8 -0
- package/dist/linter/packs/domain.js.map +1 -0
- package/dist/linter/packs/index.d.ts +9 -0
- package/dist/linter/packs/index.d.ts.map +1 -0
- package/dist/linter/packs/index.js +2 -0
- package/dist/linter/packs/index.js.map +1 -0
- package/dist/linter/policy/compile.d.ts +3 -0
- package/dist/linter/policy/compile.d.ts.map +1 -0
- package/dist/linter/policy/compile.js +256 -0
- package/dist/linter/policy/compile.js.map +1 -0
- package/dist/linter/policy/generated.d.ts +5 -0
- package/dist/linter/policy/generated.d.ts.map +1 -0
- package/dist/linter/policy/generated.js +764 -0
- package/dist/linter/policy/generated.js.map +1 -0
- package/dist/linter/policy/index.d.ts +43 -0
- package/dist/linter/policy/index.d.ts.map +1 -0
- package/dist/linter/policy/index.js +3 -0
- package/dist/linter/policy/index.js.map +1 -0
- package/dist/linter/qualification/index.d.ts +11 -0
- package/dist/linter/qualification/index.d.ts.map +1 -0
- package/dist/linter/qualification/index.js +3 -0
- package/dist/linter/qualification/index.js.map +1 -0
- package/dist/linter/qualification/query-fixtures.d.ts +3 -0
- package/dist/linter/qualification/query-fixtures.d.ts.map +1 -0
- package/dist/linter/qualification/query-fixtures.js +69 -0
- package/dist/linter/qualification/query-fixtures.js.map +1 -0
- package/dist/linter/qualification/runner.d.ts +4 -0
- package/dist/linter/qualification/runner.d.ts.map +1 -0
- package/dist/linter/qualification/runner.js +7 -0
- package/dist/linter/qualification/runner.js.map +1 -0
- package/dist/linter/report/format.d.ts +4 -0
- package/dist/linter/report/format.d.ts.map +1 -0
- package/dist/linter/report/format.js +33 -0
- package/dist/linter/report/format.js.map +1 -0
- package/dist/linter/report/index.d.ts +3 -0
- package/dist/linter/report/index.d.ts.map +1 -0
- package/dist/linter/report/index.js +2 -0
- package/dist/linter/report/index.js.map +1 -0
- package/dist/linter/requirements/index.d.ts +3 -0
- package/dist/linter/requirements/index.d.ts.map +1 -0
- package/dist/linter/requirements/index.js +2 -0
- package/dist/linter/requirements/index.js.map +1 -0
- package/dist/linter/requirements/model.d.ts +9 -0
- package/dist/linter/requirements/model.d.ts.map +1 -0
- package/dist/linter/requirements/model.js +2 -0
- package/dist/linter/requirements/model.js.map +1 -0
- package/dist/linter/requirements/registry.d.ts +4 -0
- package/dist/linter/requirements/registry.d.ts.map +1 -0
- package/dist/linter/requirements/registry.js +188 -0
- package/dist/linter/requirements/registry.js.map +1 -0
- package/dist/linter/semantics/query/decision.d.ts +5 -0
- package/dist/linter/semantics/query/decision.d.ts.map +1 -0
- package/dist/linter/semantics/query/decision.js +74 -0
- package/dist/linter/semantics/query/decision.js.map +1 -0
- package/dist/linter/semantics/query/index.d.ts +4 -0
- package/dist/linter/semantics/query/index.d.ts.map +1 -0
- package/dist/linter/semantics/query/index.js +3 -0
- package/dist/linter/semantics/query/index.js.map +1 -0
- package/dist/linter/semantics/query/observation.d.ts +36 -0
- package/dist/linter/semantics/query/observation.d.ts.map +1 -0
- package/dist/linter/semantics/query/observation.js +13 -0
- package/dist/linter/semantics/query/observation.js.map +1 -0
- package/dist/linter/suppression/apply.d.ts +4 -0
- package/dist/linter/suppression/apply.d.ts.map +1 -0
- package/dist/linter/suppression/apply.js +48 -0
- package/dist/linter/suppression/apply.js.map +1 -0
- package/dist/linter/suppression/directive.d.ts +11 -0
- package/dist/linter/suppression/directive.d.ts.map +1 -0
- package/dist/linter/suppression/directive.js +2 -0
- package/dist/linter/suppression/directive.js.map +1 -0
- package/dist/linter/suppression/index.d.ts +14 -0
- package/dist/linter/suppression/index.d.ts.map +1 -0
- package/dist/linter/suppression/index.js +2 -0
- package/dist/linter/suppression/index.js.map +1 -0
- package/dist/mutation/contract.d.ts +134 -0
- package/dist/mutation/contract.d.ts.map +1 -0
- package/dist/mutation/contract.js +2 -0
- package/dist/mutation/contract.js.map +1 -0
- package/dist/mutation/define.d.ts +9 -0
- package/dist/mutation/define.d.ts.map +1 -0
- package/dist/mutation/define.js +24 -0
- package/dist/mutation/define.js.map +1 -0
- package/dist/mutation/errors.d.ts +3 -0
- package/dist/mutation/errors.d.ts.map +1 -0
- package/dist/mutation/errors.js +30 -0
- package/dist/mutation/errors.js.map +1 -0
- package/dist/mutation/execute.d.ts +11 -0
- package/dist/mutation/execute.d.ts.map +1 -0
- package/dist/mutation/execute.js +24 -0
- package/dist/mutation/execute.js.map +1 -0
- package/dist/mutation/index.d.ts +8 -0
- package/dist/mutation/index.d.ts.map +1 -0
- package/dist/mutation/index.js +5 -0
- package/dist/mutation/index.js.map +1 -0
- package/dist/mutation/rich.d.ts +4 -0
- package/dist/mutation/rich.d.ts.map +1 -0
- package/dist/mutation/rich.js +147 -0
- package/dist/mutation/rich.js.map +1 -0
- package/dist/query/composite/contract.d.ts +37 -0
- package/dist/query/composite/contract.d.ts.map +1 -0
- package/dist/query/composite/contract.js +2 -0
- package/dist/query/composite/contract.js.map +1 -0
- package/dist/query/composite/errors.d.ts +8 -0
- package/dist/query/composite/errors.d.ts.map +1 -0
- package/dist/query/composite/errors.js +9 -0
- package/dist/query/composite/errors.js.map +1 -0
- package/dist/query/composite/index.d.ts +6 -0
- package/dist/query/composite/index.d.ts.map +1 -0
- package/dist/query/composite/index.js +3 -0
- package/dist/query/composite/index.js.map +1 -0
- package/dist/query/composite/plan.d.ts +38 -0
- package/dist/query/composite/plan.d.ts.map +1 -0
- package/dist/query/composite/plan.js +225 -0
- package/dist/query/composite/plan.js.map +1 -0
- package/dist/query/contract.d.ts +58 -0
- package/dist/query/contract.d.ts.map +1 -0
- package/dist/query/contract.js +2 -0
- package/dist/query/contract.js.map +1 -0
- package/dist/query/define.d.ts +3 -0
- package/dist/query/define.d.ts.map +1 -0
- package/dist/query/define.js +90 -0
- package/dist/query/define.js.map +1 -0
- package/dist/query/definition.d.ts +29 -0
- package/dist/query/definition.d.ts.map +1 -0
- package/dist/query/definition.js +2 -0
- package/dist/query/definition.js.map +1 -0
- package/dist/query/errors.d.ts +9 -0
- package/dist/query/errors.d.ts.map +1 -0
- package/dist/query/errors.js +15 -0
- package/dist/query/errors.js.map +1 -0
- package/dist/query/execute.d.ts +20 -0
- package/dist/query/execute.d.ts.map +1 -0
- package/dist/query/execute.js +97 -0
- package/dist/query/execute.js.map +1 -0
- package/dist/query/index.d.ts +15 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +8 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/node.d.ts +109 -0
- package/dist/query/node.d.ts.map +1 -0
- package/dist/query/node.js +164 -0
- package/dist/query/node.js.map +1 -0
- package/dist/query/result/contract.d.ts +23 -0
- package/dist/query/result/contract.d.ts.map +1 -0
- package/dist/query/result/contract.js +2 -0
- package/dist/query/result/contract.js.map +1 -0
- package/dist/query/result/index.d.ts +3 -0
- package/dist/query/result/index.d.ts.map +1 -0
- package/dist/query/result/index.js +2 -0
- package/dist/query/result/index.js.map +1 -0
- package/dist/query/result/projection.d.ts +3 -0
- package/dist/query/result/projection.d.ts.map +1 -0
- package/dist/query/result/projection.js +100 -0
- package/dist/query/result/projection.js.map +1 -0
- package/dist/query/selection.d.ts +4 -0
- package/dist/query/selection.d.ts.map +1 -0
- package/dist/query/selection.js +25 -0
- package/dist/query/selection.js.map +1 -0
- package/dist/react/compile.d.ts +9 -0
- package/dist/react/compile.d.ts.map +1 -0
- package/dist/react/compile.js +64 -0
- package/dist/react/compile.js.map +1 -0
- package/dist/react/define.d.ts +8 -0
- package/dist/react/define.d.ts.map +1 -0
- package/dist/react/define.js +89 -0
- package/dist/react/define.js.map +1 -0
- package/dist/react/definition.d.ts +69 -0
- package/dist/react/definition.d.ts.map +1 -0
- package/dist/react/definition.js +2 -0
- package/dist/react/definition.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -0
- package/dist/result/index.d.ts +3 -0
- package/dist/result/index.d.ts.map +1 -0
- package/dist/result/index.js +2 -0
- package/dist/result/index.js.map +1 -0
- package/dist/result/result.d.ts +10 -0
- package/dist/result/result.d.ts.map +1 -0
- package/dist/result/result.js +7 -0
- package/dist/result/result.js.map +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/kernel/index.d.ts +3 -0
- package/dist/schema/kernel/index.d.ts.map +1 -0
- package/dist/schema/kernel/index.js +3 -0
- package/dist/schema/kernel/index.js.map +1 -0
- package/dist/schema/v1/index.d.ts +3 -0
- package/dist/schema/v1/index.d.ts.map +1 -0
- package/dist/schema/v1/index.js +3 -0
- package/dist/schema/v1/index.js.map +1 -0
- package/dist/server/application.d.ts +36 -0
- package/dist/server/application.d.ts.map +1 -0
- package/dist/server/application.js +126 -0
- package/dist/server/application.js.map +1 -0
- package/dist/server/index.d.ts +4 -13
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/node/index.d.ts +3 -0
- package/dist/server/node/index.d.ts.map +1 -0
- package/dist/server/node/index.js +2 -0
- package/dist/server/node/index.js.map +1 -0
- package/dist/server/node/server.d.ts +14 -0
- package/dist/server/node/server.d.ts.map +1 -0
- package/dist/server/node/server.js +71 -0
- package/dist/server/node/server.js.map +1 -0
- package/dist/server/remote.d.ts +56 -0
- package/dist/server/remote.d.ts.map +1 -0
- package/dist/server/remote.js +798 -0
- package/dist/server/remote.js.map +1 -0
- package/dist/server/source.d.ts +13 -0
- package/dist/server/source.d.ts.map +1 -0
- package/dist/server/source.js +38 -0
- package/dist/server/source.js.map +1 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +2 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/machine.d.ts +28 -0
- package/dist/state/machine.d.ts.map +1 -0
- package/dist/state/machine.js +32 -0
- package/dist/state/machine.js.map +1 -0
- package/dist/state/relation.d.ts +28 -0
- package/dist/state/relation.d.ts.map +1 -0
- package/dist/state/relation.js +48 -0
- package/dist/state/relation.js.map +1 -0
- package/dist/value/index.d.ts +3 -0
- package/dist/value/index.d.ts.map +1 -0
- package/dist/value/index.js +3 -0
- package/dist/value/index.js.map +1 -0
- package/dist/view/admission.d.ts +6 -0
- package/dist/view/admission.d.ts.map +1 -0
- package/dist/view/admission.js +43 -0
- package/dist/view/admission.js.map +1 -0
- package/dist/view/compile.d.ts +15 -0
- package/dist/view/compile.d.ts.map +1 -0
- package/dist/view/compile.js +189 -0
- package/dist/view/compile.js.map +1 -0
- package/dist/view/define.d.ts +20 -0
- package/dist/view/define.d.ts.map +1 -0
- package/dist/view/define.js +236 -0
- package/dist/view/define.js.map +1 -0
- package/dist/view/definition.d.ts +96 -0
- package/dist/view/definition.d.ts.map +1 -0
- package/dist/view/definition.js +2 -0
- package/dist/view/definition.js.map +1 -0
- package/dist/view/index.d.ts +4 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +3 -0
- package/dist/view/index.js.map +1 -0
- package/dist/workflow/binding.d.ts +43 -0
- package/dist/workflow/binding.d.ts.map +1 -0
- package/dist/workflow/binding.js +32 -0
- package/dist/workflow/binding.js.map +1 -0
- package/dist/workflow/contract.d.ts +57 -0
- package/dist/workflow/contract.d.ts.map +1 -0
- package/dist/workflow/contract.js +2 -0
- package/dist/workflow/contract.js.map +1 -0
- package/dist/workflow/define.d.ts +4 -0
- package/dist/workflow/define.d.ts.map +1 -0
- package/dist/workflow/define.js +57 -0
- package/dist/workflow/define.js.map +1 -0
- package/dist/workflow/index.d.ts +7 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +4 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/runner.d.ts +4 -0
- package/dist/workflow/runner.d.ts.map +1 -0
- package/dist/workflow/runner.js +24 -0
- package/dist/workflow/runner.js.map +1 -0
- package/dist/workflow/step/index.d.ts +3 -0
- package/dist/workflow/step/index.d.ts.map +1 -0
- package/dist/workflow/step/index.js +2 -0
- package/dist/workflow/step/index.js.map +1 -0
- package/dist/workflow/step/inline.d.ts +6 -0
- package/dist/workflow/step/inline.d.ts.map +1 -0
- package/dist/workflow/step/inline.js +44 -0
- package/dist/workflow/step/inline.js.map +1 -0
- package/dist/workflow/step/step.d.ts +5 -0
- package/dist/workflow/step/step.d.ts.map +1 -0
- package/dist/workflow/step/step.js +2 -0
- package/dist/workflow/step/step.js.map +1 -0
- package/package.json +117 -24
- package/dist/auth/authenticate.d.ts +0 -24
- package/dist/auth/authenticate.d.ts.map +0 -1
- package/dist/auth/authenticate.js +0 -29
- package/dist/auth/authenticate.js.map +0 -1
- package/dist/auth/check.d.ts +0 -38
- package/dist/auth/check.d.ts.map +0 -1
- package/dist/auth/check.js +0 -50
- package/dist/auth/check.js.map +0 -1
- package/dist/auth/compose.d.ts +0 -41
- package/dist/auth/compose.d.ts.map +0 -1
- package/dist/auth/compose.js +0 -45
- package/dist/auth/compose.js.map +0 -1
- package/dist/auth/errors.d.ts +0 -16
- package/dist/auth/errors.d.ts.map +0 -1
- package/dist/auth/errors.js +0 -26
- package/dist/auth/errors.js.map +0 -1
- package/dist/auth/function-context.d.ts +0 -28
- package/dist/auth/function-context.d.ts.map +0 -1
- package/dist/auth/function-context.js +0 -47
- package/dist/auth/function-context.js.map +0 -1
- package/dist/auth/identity.d.ts +0 -18
- package/dist/auth/identity.d.ts.map +0 -1
- package/dist/auth/identity.js +0 -2
- package/dist/auth/identity.js.map +0 -1
- package/dist/auth/issuer-mint.d.ts +0 -53
- package/dist/auth/issuer-mint.d.ts.map +0 -1
- package/dist/auth/issuer-mint.js +0 -35
- package/dist/auth/issuer-mint.js.map +0 -1
- package/dist/auth/kernel-client.d.ts +0 -37
- package/dist/auth/kernel-client.d.ts.map +0 -1
- package/dist/auth/kernel-client.js +0 -111
- package/dist/auth/kernel-client.js.map +0 -1
- package/dist/auth/resolve.d.ts +0 -19
- package/dist/auth/resolve.d.ts.map +0 -1
- package/dist/auth/resolve.js +0 -43
- package/dist/auth/resolve.js.map +0 -1
- package/dist/auth/sign.d.ts +0 -15
- package/dist/auth/sign.d.ts.map +0 -1
- package/dist/auth/sign.js +0 -24
- package/dist/auth/sign.js.map +0 -1
- package/dist/auth/verify.d.ts +0 -28
- package/dist/auth/verify.d.ts.map +0 -1
- package/dist/auth/verify.js +0 -151
- package/dist/auth/verify.js.map +0 -1
- package/dist/cli/spec.d.ts +0 -19
- package/dist/cli/spec.d.ts.map +0 -1
- package/dist/cli/spec.js +0 -33
- package/dist/cli/spec.js.map +0 -1
- package/dist/config/adapter.d.ts +0 -148
- package/dist/config/adapter.d.ts.map +0 -1
- package/dist/config/adapter.js +0 -40
- package/dist/config/adapter.js.map +0 -1
- package/dist/config/define-domain.d.ts +0 -177
- package/dist/config/define-domain.d.ts.map +0 -1
- package/dist/config/define-domain.js +0 -145
- package/dist/config/define-domain.js.map +0 -1
- package/dist/config/deploy.d.ts +0 -28
- package/dist/config/deploy.d.ts.map +0 -1
- package/dist/config/deploy.js +0 -24
- package/dist/config/deploy.js.map +0 -1
- package/dist/config/index.d.ts +0 -21
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -18
- package/dist/config/index.js.map +0 -1
- package/dist/define/index.d.ts +0 -5
- package/dist/define/index.d.ts.map +0 -1
- package/dist/define/index.js +0 -3
- package/dist/define/index.js.map +0 -1
- package/dist/define/remote-function.d.ts +0 -120
- package/dist/define/remote-function.d.ts.map +0 -1
- package/dist/define/remote-function.js +0 -26
- package/dist/define/remote-function.js.map +0 -1
- package/dist/define/view.d.ts +0 -104
- package/dist/define/view.d.ts.map +0 -1
- package/dist/define/view.js +0 -30
- package/dist/define/view.js.map +0 -1
- package/dist/deploy/check.d.ts +0 -30
- package/dist/deploy/check.d.ts.map +0 -1
- package/dist/deploy/check.js +0 -82
- package/dist/deploy/check.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -3
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/index.js +0 -3
- package/dist/deploy/index.js.map +0 -1
- package/dist/deploy/meta.d.ts +0 -29
- package/dist/deploy/meta.d.ts.map +0 -1
- package/dist/deploy/meta.js +0 -45
- package/dist/deploy/meta.js.map +0 -1
- package/dist/dispatch/authorize.d.ts +0 -14
- package/dist/dispatch/authorize.d.ts.map +0 -1
- package/dist/dispatch/authorize.js +0 -24
- package/dist/dispatch/authorize.js.map +0 -1
- package/dist/dispatch/dispatcher.d.ts +0 -59
- package/dist/dispatch/dispatcher.d.ts.map +0 -1
- package/dist/dispatch/dispatcher.js +0 -237
- package/dist/dispatch/dispatcher.js.map +0 -1
- package/dist/dispatch/errors.d.ts +0 -47
- package/dist/dispatch/errors.d.ts.map +0 -1
- package/dist/dispatch/errors.js +0 -76
- package/dist/dispatch/errors.js.map +0 -1
- package/dist/dispatch/execute.d.ts +0 -44
- package/dist/dispatch/execute.d.ts.map +0 -1
- package/dist/dispatch/execute.js +0 -29
- package/dist/dispatch/execute.js.map +0 -1
- package/dist/dispatch/identity.d.ts +0 -75
- package/dist/dispatch/identity.d.ts.map +0 -1
- package/dist/dispatch/identity.js +0 -101
- package/dist/dispatch/identity.js.map +0 -1
- package/dist/dispatch/index.d.ts +0 -7
- package/dist/dispatch/index.d.ts.map +0 -1
- package/dist/dispatch/index.js +0 -7
- package/dist/dispatch/index.js.map +0 -1
- package/dist/dispatch/resolve.d.ts +0 -27
- package/dist/dispatch/resolve.d.ts.map +0 -1
- package/dist/dispatch/resolve.js +0 -65
- package/dist/dispatch/resolve.js.map +0 -1
- package/dist/dispatch/self.d.ts +0 -51
- package/dist/dispatch/self.d.ts.map +0 -1
- package/dist/dispatch/self.js +0 -116
- package/dist/dispatch/self.js.map +0 -1
- package/dist/dispatch/validate.d.ts +0 -35
- package/dist/dispatch/validate.d.ts.map +0 -1
- package/dist/dispatch/validate.js +0 -27
- package/dist/dispatch/validate.js.map +0 -1
- package/dist/domain/binding.d.ts +0 -18
- package/dist/domain/binding.d.ts.map +0 -1
- package/dist/domain/binding.js +0 -29
- package/dist/domain/binding.js.map +0 -1
- package/dist/domain/build-spec.d.ts +0 -37
- package/dist/domain/build-spec.d.ts.map +0 -1
- package/dist/domain/build-spec.js +0 -114
- package/dist/domain/build-spec.js.map +0 -1
- package/dist/domain/contract.d.ts +0 -17
- package/dist/domain/contract.d.ts.map +0 -1
- package/dist/domain/contract.js +0 -26
- package/dist/domain/contract.js.map +0 -1
- package/dist/domain/extend-functions.d.ts +0 -48
- package/dist/domain/extend-functions.d.ts.map +0 -1
- package/dist/domain/extend-functions.js +0 -85
- package/dist/domain/extend-functions.js.map +0 -1
- package/dist/domain/extend-views.d.ts +0 -45
- package/dist/domain/extend-views.d.ts.map +0 -1
- package/dist/domain/extend-views.js +0 -116
- package/dist/domain/extend-views.js.map +0 -1
- package/dist/linter/analyze.d.ts +0 -6
- package/dist/linter/analyze.d.ts.map +0 -1
- package/dist/linter/analyze.js +0 -12
- package/dist/linter/analyze.js.map +0 -1
- package/dist/linter/diagnostic.d.ts +0 -38
- package/dist/linter/diagnostic.d.ts.map +0 -1
- package/dist/linter/diagnostic.js +0 -37
- package/dist/linter/diagnostic.js.map +0 -1
- package/dist/linter/oxlint/config.d.ts +0 -15
- package/dist/linter/oxlint/config.d.ts.map +0 -1
- package/dist/linter/oxlint/config.js +0 -23
- package/dist/linter/oxlint/config.js.map +0 -1
- package/dist/linter/oxlint/ignore-patterns.d.ts +0 -9
- package/dist/linter/oxlint/ignore-patterns.d.ts.map +0 -1
- package/dist/linter/oxlint/ignore-patterns.js +0 -18
- package/dist/linter/oxlint/ignore-patterns.js.map +0 -1
- package/dist/linter/oxlint/plugin.d.ts +0 -13
- package/dist/linter/oxlint/plugin.d.ts.map +0 -1
- package/dist/linter/oxlint/plugin.js +0 -14
- package/dist/linter/oxlint/plugin.js.map +0 -1
- package/dist/linter/preflight.d.ts +0 -2
- package/dist/linter/preflight.d.ts.map +0 -1
- package/dist/linter/preflight.js +0 -162
- package/dist/linter/preflight.js.map +0 -1
- package/dist/linter/project.d.ts +0 -18
- package/dist/linter/project.d.ts.map +0 -1
- package/dist/linter/project.js +0 -150
- package/dist/linter/project.js.map +0 -1
- package/dist/linter/report.d.ts +0 -4
- package/dist/linter/report.d.ts.map +0 -1
- package/dist/linter/report.js +0 -22
- package/dist/linter/report.js.map +0 -1
- package/dist/linter/rules/catalog.d.ts +0 -56
- package/dist/linter/rules/catalog.d.ts.map +0 -1
- package/dist/linter/rules/catalog.js +0 -53
- package/dist/linter/rules/catalog.js.map +0 -1
- package/dist/linter/rules/core-has-no-async.d.ts +0 -3
- package/dist/linter/rules/core-has-no-async.d.ts.map +0 -1
- package/dist/linter/rules/core-has-no-async.js +0 -43
- package/dist/linter/rules/core-has-no-async.js.map +0 -1
- package/dist/linter/rules/core-is-pure.d.ts +0 -3
- package/dist/linter/rules/core-is-pure.d.ts.map +0 -1
- package/dist/linter/rules/core-is-pure.js +0 -74
- package/dist/linter/rules/core-is-pure.js.map +0 -1
- package/dist/linter/rules/no-nested-steps.d.ts +0 -3
- package/dist/linter/rules/no-nested-steps.d.ts.map +0 -1
- package/dist/linter/rules/no-nested-steps.js +0 -32
- package/dist/linter/rules/no-nested-steps.js.map +0 -1
- package/dist/linter/rules/no-read-inside-mutate.d.ts +0 -3
- package/dist/linter/rules/no-read-inside-mutate.d.ts.map +0 -1
- package/dist/linter/rules/no-read-inside-mutate.js +0 -64
- package/dist/linter/rules/no-read-inside-mutate.js.map +0 -1
- package/dist/linter/rules/one-remote-definition-per-file.d.ts +0 -3
- package/dist/linter/rules/one-remote-definition-per-file.d.ts.map +0 -1
- package/dist/linter/rules/one-remote-definition-per-file.js +0 -23
- package/dist/linter/rules/one-remote-definition-per-file.js.map +0 -1
- package/dist/linter/rules/oxlint-ast.d.ts +0 -30
- package/dist/linter/rules/oxlint-ast.d.ts.map +0 -1
- package/dist/linter/rules/oxlint-ast.js +0 -104
- package/dist/linter/rules/oxlint-ast.js.map +0 -1
- package/dist/linter/rules/oxlint-rule.d.ts +0 -45
- package/dist/linter/rules/oxlint-rule.d.ts.map +0 -1
- package/dist/linter/rules/oxlint-rule.js +0 -2
- package/dist/linter/rules/oxlint-rule.js.map +0 -1
- package/dist/linter/rules/project-rule.d.ts +0 -10
- package/dist/linter/rules/project-rule.d.ts.map +0 -1
- package/dist/linter/rules/project-rule.js +0 -24
- package/dist/linter/rules/project-rule.js.map +0 -1
- package/dist/linter/rules/thin-schema-composition-root.d.ts +0 -3
- package/dist/linter/rules/thin-schema-composition-root.d.ts.map +0 -1
- package/dist/linter/rules/thin-schema-composition-root.js +0 -23
- package/dist/linter/rules/thin-schema-composition-root.js.map +0 -1
- package/dist/linter/source.d.ts +0 -24
- package/dist/linter/source.d.ts.map +0 -1
- package/dist/linter/source.js +0 -279
- package/dist/linter/source.js.map +0 -1
- package/dist/linter/suppression.d.ts +0 -3
- package/dist/linter/suppression.d.ts.map +0 -1
- package/dist/linter/suppression.js +0 -11
- package/dist/linter/suppression.js.map +0 -1
- package/dist/method/class.d.ts +0 -71
- package/dist/method/class.d.ts.map +0 -1
- package/dist/method/class.js +0 -26
- package/dist/method/class.js.map +0 -1
- package/dist/method/context.d.ts +0 -99
- package/dist/method/context.d.ts.map +0 -1
- package/dist/method/context.js +0 -11
- package/dist/method/context.js.map +0 -1
- package/dist/method/index.d.ts +0 -6
- package/dist/method/index.d.ts.map +0 -1
- package/dist/method/index.js +0 -3
- package/dist/method/index.js.map +0 -1
- package/dist/method/single.d.ts +0 -81
- package/dist/method/single.d.ts.map +0 -1
- package/dist/method/single.js +0 -8
- package/dist/method/single.js.map +0 -1
- package/dist/server/auxiliary-routes.d.ts +0 -48
- package/dist/server/auxiliary-routes.d.ts.map +0 -1
- package/dist/server/auxiliary-routes.js +0 -322
- package/dist/server/auxiliary-routes.js.map +0 -1
- package/dist/server/config.d.ts +0 -83
- package/dist/server/config.d.ts.map +0 -1
- package/dist/server/config.js +0 -8
- package/dist/server/config.js.map +0 -1
- package/dist/server/create.d.ts +0 -8
- package/dist/server/create.d.ts.map +0 -1
- package/dist/server/create.js +0 -171
- package/dist/server/create.js.map +0 -1
- package/dist/server/domain-entry.d.ts +0 -77
- package/dist/server/domain-entry.d.ts.map +0 -1
- package/dist/server/domain-entry.js +0 -60
- package/dist/server/domain-entry.js.map +0 -1
- package/dist/server/handle.d.ts +0 -35
- package/dist/server/handle.d.ts.map +0 -1
- package/dist/server/handle.js +0 -9
- package/dist/server/handle.js.map +0 -1
- package/dist/server/jwks.d.ts +0 -11
- package/dist/server/jwks.d.ts.map +0 -1
- package/dist/server/jwks.js +0 -15
- package/dist/server/jwks.js.map +0 -1
- package/dist/server/require-env.d.ts +0 -15
- package/dist/server/require-env.d.ts.map +0 -1
- package/dist/server/require-env.js +0 -21
- package/dist/server/require-env.js.map +0 -1
- package/dist/server/service-entry.d.ts +0 -32
- package/dist/server/service-entry.d.ts.map +0 -1
- package/dist/server/service-entry.js +0 -150
- package/dist/server/service-entry.js.map +0 -1
- package/dist/server/serving-url.d.ts +0 -14
- package/dist/server/serving-url.d.ts.map +0 -1
- package/dist/server/serving-url.js +0 -28
- package/dist/server/serving-url.js.map +0 -1
- package/dist/server/start.d.ts +0 -11
- package/dist/server/start.d.ts.map +0 -1
- package/dist/server/start.js +0 -34
- package/dist/server/start.js.map +0 -1
- package/dist/server/worker-entry.d.ts +0 -157
- package/dist/server/worker-entry.d.ts.map +0 -1
- package/dist/server/worker-entry.js +0 -201
- package/dist/server/worker-entry.js.map +0 -1
- package/dist/service/functions.d.ts +0 -148
- package/dist/service/functions.d.ts.map +0 -1
- package/dist/service/functions.js +0 -115
- package/dist/service/functions.js.map +0 -1
- package/dist/service/index.d.ts +0 -3
- package/dist/service/index.d.ts.map +0 -1
- package/dist/service/index.js +0 -2
- package/dist/service/index.js.map +0 -1
- package/dist/step/index.d.ts +0 -5
- package/dist/step/index.d.ts.map +0 -1
- package/dist/step/index.js +0 -3
- package/dist/step/index.js.map +0 -1
- package/dist/step/inline.d.ts +0 -8
- package/dist/step/inline.d.ts.map +0 -1
- package/dist/step/inline.js +0 -22
- package/dist/step/inline.js.map +0 -1
- package/dist/step/step.d.ts +0 -28
- package/dist/step/step.d.ts.map +0 -1
- package/dist/step/step.js +0 -53
- package/dist/step/step.js.map +0 -1
- package/src/auth/authenticate.ts +0 -51
- package/src/auth/check.ts +0 -69
- package/src/auth/compose.ts +0 -56
- package/src/auth/errors.ts +0 -32
- package/src/auth/function-context.ts +0 -108
- package/src/auth/identity.ts +0 -17
- package/src/auth/index.ts +0 -19
- package/src/auth/issuer-mint.ts +0 -76
- package/src/auth/kernel-client.ts +0 -153
- package/src/auth/resolve.ts +0 -63
- package/src/auth/sign.ts +0 -36
- package/src/auth/verify.ts +0 -199
- package/src/cli/bin.ts +0 -15
- package/src/cli/dotenv.ts +0 -65
- package/src/cli/index.ts +0 -15
- package/src/cli/log.ts +0 -18
- package/src/cli/publish.ts +0 -341
- package/src/cli/run.ts +0 -769
- package/src/cli/spec.ts +0 -44
- package/src/config/adapter.ts +0 -177
- package/src/config/define-domain.ts +0 -354
- package/src/config/deploy.ts +0 -35
- package/src/config/index.ts +0 -31
- package/src/define/index.ts +0 -10
- package/src/define/remote-function.ts +0 -184
- package/src/define/view.ts +0 -112
- package/src/deploy/check.ts +0 -124
- package/src/deploy/index.ts +0 -2
- package/src/deploy/meta.ts +0 -50
- package/src/dispatch/authorize.ts +0 -29
- package/src/dispatch/dispatcher.ts +0 -321
- package/src/dispatch/errors.ts +0 -94
- package/src/dispatch/execute.ts +0 -67
- package/src/dispatch/identity.ts +0 -143
- package/src/dispatch/index.ts +0 -16
- package/src/dispatch/resolve.ts +0 -78
- package/src/dispatch/self.ts +0 -198
- package/src/dispatch/validate.ts +0 -41
- package/src/domain/binding.ts +0 -37
- package/src/domain/build-spec.ts +0 -156
- package/src/domain/contract.ts +0 -41
- package/src/domain/define.ts +0 -162
- package/src/domain/extend-functions.ts +0 -110
- package/src/domain/extend-views.ts +0 -151
- package/src/domain/index.ts +0 -4
- package/src/index.ts +0 -165
- package/src/linter/analyze.ts +0 -17
- package/src/linter/diagnostic.ts +0 -85
- package/src/linter/docs/DIAGNOSTICS.md +0 -47
- package/src/linter/docs/JUDGMENT.md +0 -81
- package/src/linter/docs/PRINCIPLES.md +0 -97
- package/src/linter/docs/README.md +0 -38
- package/src/linter/docs/RULE-AUTHORING.md +0 -144
- package/src/linter/docs/RULES.md +0 -153
- package/src/linter/index.ts +0 -15
- package/src/linter/lint.ts +0 -34
- package/src/linter/oxlint/astrale-ox.d.ts +0 -5
- package/src/linter/oxlint/config.ts +0 -24
- package/src/linter/oxlint/ignore-patterns.ts +0 -17
- package/src/linter/oxlint/plugin.js +0 -16
- package/src/linter/oxlint/process.ts +0 -219
- package/src/linter/oxlint/run.ts +0 -175
- package/src/linter/preflight.ts +0 -182
- package/src/linter/project.ts +0 -190
- package/src/linter/report.ts +0 -25
- package/src/linter/rules/catalog.ts +0 -67
- package/src/linter/rules/core-has-no-async.js +0 -43
- package/src/linter/rules/core-is-pure.ts +0 -103
- package/src/linter/rules/no-nested-steps.js +0 -37
- package/src/linter/rules/no-read-inside-mutate.js +0 -72
- package/src/linter/rules/one-remote-definition-per-file.ts +0 -29
- package/src/linter/rules/oxlint-ast.js +0 -110
- package/src/linter/rules/oxlint-rule.ts +0 -35
- package/src/linter/rules/project-rule.ts +0 -37
- package/src/linter/rules/thin-schema-composition-root.ts +0 -26
- package/src/linter/source.ts +0 -323
- package/src/linter/suppression.ts +0 -11
- package/src/method/class.ts +0 -163
- package/src/method/context.ts +0 -135
- package/src/method/index.ts +0 -19
- package/src/method/single.ts +0 -166
- package/src/server/auxiliary-routes.ts +0 -456
- package/src/server/config.ts +0 -85
- package/src/server/create.ts +0 -210
- package/src/server/domain-entry.ts +0 -125
- package/src/server/handle.ts +0 -37
- package/src/server/index.ts +0 -19
- package/src/server/jwks.ts +0 -18
- package/src/server/require-env.ts +0 -19
- package/src/server/service-entry.ts +0 -209
- package/src/server/serving-url.ts +0 -28
- package/src/server/start.ts +0 -42
- package/src/server/worker-entry.ts +0 -286
- package/src/service/functions.ts +0 -164
- package/src/service/index.ts +0 -18
- package/src/step/index.ts +0 -4
- package/src/step/inline.ts +0 -38
- package/src/step/step.ts +0 -95
package/src/cli/run.ts
DELETED
|
@@ -1,769 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `astrale-domain` CLI — dev | build | deploy | publish | lint.
|
|
3
|
-
*
|
|
4
|
-
* Thin by design: it reads `astrale.config.ts`, resolves `envs[<env>] → params`
|
|
5
|
-
* via the adapter, loads the env's secrets file, then drives `adapter.watch`
|
|
6
|
-
* (dev) or `adapter.deploy` (build+ship). It prints the resulting URL and the
|
|
7
|
-
* exact `astrale domain install <url> --direct` line. It boots no kernel and knows
|
|
8
|
-
* nothing provider-specific — that all lives in the adapter.
|
|
9
|
-
*
|
|
10
|
-
* The diagnostic spec (`.astrale/spec.json`) is written AFTER watch/deploy
|
|
11
|
-
* returns, at the live URL: the install graph (and therefore `schemaHash`)
|
|
12
|
-
* embeds `binding.remoteUrl`s derived from the serving URL, so a spec built at
|
|
13
|
-
* a guessed URL would carry a hash that never matches the worker's `/meta`.
|
|
14
|
-
* Only `astrale-domain build` (no URL exists yet) uses an explicit placeholder
|
|
15
|
-
* and says so.
|
|
16
|
-
*
|
|
17
|
-
* astrale-domain dev # = deploy dev --watch
|
|
18
|
-
* astrale-domain prod # = deploy prod
|
|
19
|
-
* astrale-domain deploy <env> # any env key
|
|
20
|
-
* astrale-domain build # rebuild spec only (placeholder URL)
|
|
21
|
-
* astrale-domain lint # generic + Astrale static diagnostics
|
|
22
|
-
* astrale-domain publish [env] # RELEASE: publish ./schema to npm (if any) + register the deployed URL
|
|
23
|
-
*
|
|
24
|
-
* A release has two halves that must stay in sync: the CONTRACT (`./schema` on
|
|
25
|
-
* npm) and the DEPLOYMENT (worker URL in the catalog). `publish` does both,
|
|
26
|
-
* npm-FIRST — `npm publish` is irreversible, so the catalog is registered only on
|
|
27
|
-
* schema-publish success, never pointing at an unpublished contract. The schema
|
|
28
|
-
* publish is idempotent (skips an unbumped version). Scope it with `--schema`
|
|
29
|
-
* (contract only — config-free) or `--skip-schema` (catalog only). All publish
|
|
30
|
-
* logic lives in `./publish.ts`; this file only parses args and dispatches.
|
|
31
|
-
*
|
|
32
|
-
* `publish` registers a domain's ALREADY-deployed URL in the admin catalog by
|
|
33
|
-
* SHELLING OUT to the operator CLI (`astrale domain publish --origin --name
|
|
34
|
-
* --public-url`); it does NOT deploy — run `prod` / `deploy <env>` first, or use
|
|
35
|
-
* `deploy --publish` to deploy AND register in one step. Standalone publish
|
|
36
|
-
* defaults the registered address to `https://<origin>` (what every fleet domain
|
|
37
|
-
* serves at); pass `--public-url` for workers.dev / split-host deploys. Auth
|
|
38
|
-
* lives entirely in the operator CLI — this build tool never touches
|
|
39
|
-
* credentials. Requires `astrale` on PATH (the same CLI the deploy footer
|
|
40
|
-
* already points you at for `domain install`).
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
import { existsSync, watch as watchFs } from 'node:fs'
|
|
44
|
-
import { mkdir, writeFile } from 'node:fs/promises'
|
|
45
|
-
import { createRequire } from 'node:module'
|
|
46
|
-
import { basename, dirname, isAbsolute, join } from 'node:path'
|
|
47
|
-
import { pathToFileURL } from 'node:url'
|
|
48
|
-
|
|
49
|
-
import type { DeployResult, DomainAdapter, DomainInfo, WatchHandle } from '../config/adapter.js'
|
|
50
|
-
import type { DeployConfig } from '../config/deploy.js'
|
|
51
|
-
|
|
52
|
-
import { LinterToolError } from '../linter/diagnostic.js'
|
|
53
|
-
import { lintDomain } from '../linter/lint.js'
|
|
54
|
-
import { formatLintResult, type LintReportFormat } from '../linter/report.js'
|
|
55
|
-
import { loadDeclaredSecrets } from './dotenv.js'
|
|
56
|
-
import { BOLD, DIM, error, GREEN, info, RESET, warn } from './log.js'
|
|
57
|
-
import { publishSchema, runRelease, runReleaseAfterDeploy } from './publish.js'
|
|
58
|
-
import { buildProjectSpec } from './spec.js'
|
|
59
|
-
|
|
60
|
-
const CONFIG_NAMES = ['astrale.config.ts', 'astrale.config.js', 'astrale.config.mjs']
|
|
61
|
-
|
|
62
|
-
type ParsedArgs = {
|
|
63
|
-
command: 'dev' | 'build' | 'deploy' | 'publish' | 'lint'
|
|
64
|
-
env: string
|
|
65
|
-
watch: boolean
|
|
66
|
-
/** `--fix` (lint) — apply safe Oxlint fixes before reporting remaining diagnostics. */
|
|
67
|
-
fix?: boolean
|
|
68
|
-
/** `--format <stylish|json>` (lint) — unified human or machine output. */
|
|
69
|
-
format?: LintReportFormat
|
|
70
|
-
/** `--dry-run` (publish) — pack + `npm publish --dry-run` and skip the catalog register. */
|
|
71
|
-
dryRun?: boolean
|
|
72
|
-
/** `--schema` (publish) — publish ONLY the `./schema` package; no catalog, no config. */
|
|
73
|
-
schemaOnly?: boolean
|
|
74
|
-
/** `--otp <code>` (publish / deploy --publish) — 2FA OTP forwarded to `npm publish`. */
|
|
75
|
-
otp?: string
|
|
76
|
-
/** `--skip-schema` (publish / deploy --publish) — register the catalog only; don't publish `./schema`. */
|
|
77
|
-
skipSchema?: boolean
|
|
78
|
-
/** `--port <n>` (dev only) — overrides the env's local dev port. */
|
|
79
|
-
port?: number
|
|
80
|
-
/** `--host <url>` (dev only) — public URL of a tunnel/proxy front: binds 0.0.0.0 + pins WORKER_URL. */
|
|
81
|
-
host?: string
|
|
82
|
-
/** `--publish` tail-flag on deploy/prod: ALSO register the freshly-deployed URL (deploy + register). */
|
|
83
|
-
publish?: boolean
|
|
84
|
-
/** `--name <slug>` — registry name to publish under (default: the origin's first label, e.g. `ai-gateway`). */
|
|
85
|
-
name?: string
|
|
86
|
-
/** `--install-by-default` — mark the published domain for install on every new instance. */
|
|
87
|
-
installByDefault?: boolean
|
|
88
|
-
/** `--public-url <url>` — (publish only) the address the catalog points at (default: `https://<origin>`). */
|
|
89
|
-
publicUrl?: string
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export async function run(argv: readonly string[]): Promise<number> {
|
|
93
|
-
// `--help` anywhere prints usage — previously `prod --help` IGNORED the
|
|
94
|
-
// flag and started a real deploy (observed in an external test run).
|
|
95
|
-
if (argv.includes('--help') || argv.includes('-h')) {
|
|
96
|
-
printUsage()
|
|
97
|
-
return 0
|
|
98
|
-
}
|
|
99
|
-
let parsed: ParsedArgs
|
|
100
|
-
try {
|
|
101
|
-
parsed = parseArgs(argv)
|
|
102
|
-
} catch (err) {
|
|
103
|
-
printUsage((err as Error).message)
|
|
104
|
-
return 2
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (parsed.command === 'lint') {
|
|
108
|
-
const controller = new AbortController()
|
|
109
|
-
let receivedSignal: NodeJS.Signals | undefined
|
|
110
|
-
const cancel = (signal: NodeJS.Signals) => {
|
|
111
|
-
receivedSignal ??= signal
|
|
112
|
-
controller.abort(new Error(`Received ${signal}.`))
|
|
113
|
-
}
|
|
114
|
-
const onSigint = () => cancel('SIGINT')
|
|
115
|
-
const onSigterm = () => cancel('SIGTERM')
|
|
116
|
-
process.once('SIGINT', onSigint)
|
|
117
|
-
process.once('SIGTERM', onSigterm)
|
|
118
|
-
try {
|
|
119
|
-
const result = await lintDomain({
|
|
120
|
-
root: process.cwd(),
|
|
121
|
-
fix: parsed.fix ?? false,
|
|
122
|
-
signal: controller.signal,
|
|
123
|
-
})
|
|
124
|
-
process.stdout.write(formatLintResult(result, parsed.format))
|
|
125
|
-
return result.exitCode
|
|
126
|
-
} catch (err) {
|
|
127
|
-
if (err instanceof LinterToolError) {
|
|
128
|
-
if (err.code === 'OXLINT_CANCELLED' && receivedSignal) {
|
|
129
|
-
return receivedSignal === 'SIGINT' ? 130 : 143
|
|
130
|
-
}
|
|
131
|
-
error(err.message)
|
|
132
|
-
return err.exitCode
|
|
133
|
-
}
|
|
134
|
-
throw err
|
|
135
|
-
} finally {
|
|
136
|
-
process.off('SIGINT', onSigint)
|
|
137
|
-
process.off('SIGTERM', onSigterm)
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// `publish --schema` (schema only) operates on the schema PACKAGE, not
|
|
142
|
-
// astrale.config.ts — handle it before config discovery so it works in a folder
|
|
143
|
-
// that is purely a schema package and needs no adapter/Bun runtime.
|
|
144
|
-
if (parsed.command === 'publish' && parsed.schemaOnly) {
|
|
145
|
-
return await publishSchema({
|
|
146
|
-
projectDir: process.cwd(),
|
|
147
|
-
dryRun: parsed.dryRun ?? false,
|
|
148
|
-
...(parsed.otp !== undefined ? { otp: parsed.otp } : {}),
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// The CLI imports the project's TypeScript modules (astrale.config.ts, the ★
|
|
153
|
-
// files) directly — that requires a TS-native runtime. Fail with the remedy
|
|
154
|
-
// instead of a cryptic ERR_UNKNOWN_FILE_EXTENSION deep in `import()`.
|
|
155
|
-
if (!process.versions.bun) {
|
|
156
|
-
error(
|
|
157
|
-
'astrale-domain requires Bun (it imports your astrale.config.ts directly). ' +
|
|
158
|
-
'Install it from https://bun.sh, then re-run.',
|
|
159
|
-
)
|
|
160
|
-
return 1
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const projectDir = process.cwd()
|
|
164
|
-
const configPath = findConfig(projectDir)
|
|
165
|
-
if (!configPath) {
|
|
166
|
-
error(`No astrale.config.ts found in ${projectDir}. Run this from a domain project root.`)
|
|
167
|
-
return 1
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
let def: DeployConfig
|
|
171
|
-
try {
|
|
172
|
-
def = await loadConfig(configPath)
|
|
173
|
-
} catch (err) {
|
|
174
|
-
// Adapter-swap papercut: editing the `adapter:` call without the import
|
|
175
|
-
// (or vice versa) surfaces as a bare ReferenceError. Name the real fix.
|
|
176
|
-
const m = err instanceof Error ? /^(\w+) is not defined/.exec(err.message) : null
|
|
177
|
-
if (m) {
|
|
178
|
-
error(
|
|
179
|
-
`astrale.config.ts references \`${m[1]}\` but never imports it.\n` +
|
|
180
|
-
` If you swapped adapters (cloudflare ⇄ astrale), update BOTH lines:\n` +
|
|
181
|
-
` import { ${m[1]} } from '@astrale-os/adapter-cloudflare'\n` +
|
|
182
|
-
` adapter: ${m[1]}({ ... })`,
|
|
183
|
-
)
|
|
184
|
-
return 1
|
|
185
|
-
}
|
|
186
|
-
throw err
|
|
187
|
-
}
|
|
188
|
-
const specPath = join(projectDir, '.astrale', 'spec.json')
|
|
189
|
-
|
|
190
|
-
if (parsed.command === 'build') {
|
|
191
|
-
// Spec-only: no adapter params, no secrets, no deploy → no real URL.
|
|
192
|
-
// Build at an explicit placeholder and say so: the schemaHash of this
|
|
193
|
-
// spec will NOT match a live worker's /meta (the install graph embeds
|
|
194
|
-
// URL-derived bindings).
|
|
195
|
-
const placeholderUrl = `https://${def.origin}`
|
|
196
|
-
try {
|
|
197
|
-
await writeSpec({ projectDir, specPath, def, url: placeholderUrl })
|
|
198
|
-
} catch (err) {
|
|
199
|
-
error(`Spec build failed: ${(err as Error).message}`)
|
|
200
|
-
return 1
|
|
201
|
-
}
|
|
202
|
-
info(`Built spec → ${rel(projectDir, specPath)} (origin: ${def.origin})`)
|
|
203
|
-
info(
|
|
204
|
-
`note: built at placeholder ${placeholderUrl} — its schemaHash differs from a deployed worker.`,
|
|
205
|
-
)
|
|
206
|
-
return 0
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (parsed.command === 'publish') {
|
|
210
|
-
// `--schema` (schema only) was handled before config discovery; this is the
|
|
211
|
-
// full release (schema + catalog) or `--skip-schema` (catalog only).
|
|
212
|
-
return await runRelease({
|
|
213
|
-
projectDir,
|
|
214
|
-
origin: def.origin,
|
|
215
|
-
skipSchema: parsed.skipSchema ?? false,
|
|
216
|
-
dryRun: parsed.dryRun ?? false,
|
|
217
|
-
...(parsed.name !== undefined ? { name: parsed.name } : {}),
|
|
218
|
-
...(parsed.publicUrl !== undefined ? { publicUrl: parsed.publicUrl } : {}),
|
|
219
|
-
...(parsed.otp !== undefined ? { otp: parsed.otp } : {}),
|
|
220
|
-
...(parsed.installByDefault ? { installByDefault: true } : {}),
|
|
221
|
-
})
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const adapter = def.adapter as DomainAdapter<unknown>
|
|
225
|
-
// CLI param overrides — applied over the env's params here AND re-applied by
|
|
226
|
-
// the config hot-regen path, which re-resolves `adapter.params` from the
|
|
227
|
-
// fresh config (without them, the first config edit would silently drop the
|
|
228
|
-
// flags — e.g. lose the `--host`-pinned WORKER_URL and drift the iss).
|
|
229
|
-
const paramOverrides: Record<string, unknown> = {}
|
|
230
|
-
// CLI port override beats the env's configured port (both adapters read
|
|
231
|
-
// `params.port` in watch).
|
|
232
|
-
if (parsed.command === 'dev' && parsed.port !== undefined) paramOverrides.port = parsed.port
|
|
233
|
-
// `--host <public-url>`: off-localhost dev (sandbox preview, tunnel). The
|
|
234
|
-
// adapter binds 0.0.0.0 and pins WORKER_URL so the worker's per-request-Host
|
|
235
|
-
// identity doesn't drift to the proxy's internal hostname.
|
|
236
|
-
if (parsed.command === 'dev' && parsed.host !== undefined) paramOverrides.host = parsed.host
|
|
237
|
-
const params = { ...(adapter.params(parsed.env) as Record<string, unknown>), ...paramOverrides }
|
|
238
|
-
|
|
239
|
-
const domain = toDomainInfo(def)
|
|
240
|
-
|
|
241
|
-
const secrets = loadSecrets(adapter, params, projectDir)
|
|
242
|
-
|
|
243
|
-
if (parsed.command === 'dev' || (parsed.command === 'deploy' && parsed.watch)) {
|
|
244
|
-
return runWatch({
|
|
245
|
-
adapter,
|
|
246
|
-
params,
|
|
247
|
-
paramOverrides,
|
|
248
|
-
projectDir,
|
|
249
|
-
specPath,
|
|
250
|
-
secrets,
|
|
251
|
-
domain,
|
|
252
|
-
env: parsed.env,
|
|
253
|
-
def,
|
|
254
|
-
configPath,
|
|
255
|
-
})
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// deploy (no watch)
|
|
259
|
-
const result = await adapter.deploy(params, {
|
|
260
|
-
projectDir,
|
|
261
|
-
specPath,
|
|
262
|
-
secrets,
|
|
263
|
-
domain,
|
|
264
|
-
env: parsed.env,
|
|
265
|
-
schemaHashForUrl: async (url) => {
|
|
266
|
-
const { schemaHash } = await buildProjectSpec(def, url)
|
|
267
|
-
return schemaHash
|
|
268
|
-
},
|
|
269
|
-
})
|
|
270
|
-
await writeSpecBestEffort({ projectDir, specPath, def, url: result.url })
|
|
271
|
-
printDeployed(result, def)
|
|
272
|
-
|
|
273
|
-
if (parsed.publish) {
|
|
274
|
-
// `--publish` = release after deploy: ship the schema (if any) THEN register
|
|
275
|
-
// the just-deployed URL — same npm-first ordering as `publish`.
|
|
276
|
-
return await runReleaseAfterDeploy({
|
|
277
|
-
projectDir,
|
|
278
|
-
origin: def.origin,
|
|
279
|
-
deployedUrl: result.url,
|
|
280
|
-
skipSchema: parsed.skipSchema ?? false,
|
|
281
|
-
...(parsed.name !== undefined ? { name: parsed.name } : {}),
|
|
282
|
-
...(parsed.otp !== undefined ? { otp: parsed.otp } : {}),
|
|
283
|
-
...(parsed.installByDefault ? { installByDefault: true } : {}),
|
|
284
|
-
})
|
|
285
|
-
}
|
|
286
|
-
return 0
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
async function runWatch(args: {
|
|
290
|
-
adapter: DomainAdapter<unknown>
|
|
291
|
-
params: unknown
|
|
292
|
-
paramOverrides: Record<string, unknown>
|
|
293
|
-
projectDir: string
|
|
294
|
-
specPath: string
|
|
295
|
-
secrets: Record<string, string>
|
|
296
|
-
domain: DomainInfo
|
|
297
|
-
env: string
|
|
298
|
-
def: DeployConfig
|
|
299
|
-
configPath: string
|
|
300
|
-
}): Promise<number> {
|
|
301
|
-
const { adapter, params, projectDir, specPath, secrets, domain, env, def } = args
|
|
302
|
-
let reloads = 0
|
|
303
|
-
const onReload = () => {
|
|
304
|
-
reloads += 1
|
|
305
|
-
info(`↻ reloaded (#${reloads}) — same URL, no reinstall needed for handler edits`)
|
|
306
|
-
}
|
|
307
|
-
const handle: WatchHandle = await adapter.watch(params, {
|
|
308
|
-
projectDir,
|
|
309
|
-
specPath,
|
|
310
|
-
secrets,
|
|
311
|
-
domain,
|
|
312
|
-
env,
|
|
313
|
-
onReload,
|
|
314
|
-
})
|
|
315
|
-
await writeSpecBestEffort({ projectDir, specPath, def, url: handle.url })
|
|
316
|
-
printDevReady(handle.url, domain)
|
|
317
|
-
|
|
318
|
-
const stopConfigWatch = watchConfigForRegen({
|
|
319
|
-
configPath: args.configPath,
|
|
320
|
-
initial: def,
|
|
321
|
-
env,
|
|
322
|
-
paramOverrides: args.paramOverrides,
|
|
323
|
-
projectDir,
|
|
324
|
-
specPath,
|
|
325
|
-
url: handle.url,
|
|
326
|
-
onReload,
|
|
327
|
-
})
|
|
328
|
-
|
|
329
|
-
await new Promise<void>((resolveStop) => {
|
|
330
|
-
const stop = () => {
|
|
331
|
-
stopConfigWatch()
|
|
332
|
-
void handle.stop().finally(resolveStop)
|
|
333
|
-
}
|
|
334
|
-
process.on('SIGINT', stop)
|
|
335
|
-
process.on('SIGTERM', stop)
|
|
336
|
-
})
|
|
337
|
-
return 0
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Watch `astrale.config.ts` while `dev` runs: on change, re-import the config
|
|
342
|
-
* (cache-busted), re-resolve env params + secrets, and re-run the adapter's
|
|
343
|
-
* codegen via `adapter.regenerate` — the running dev server (e.g. `wrangler
|
|
344
|
-
* dev`, which watches its generated config + entry) reloads them itself, so a
|
|
345
|
-
* config edit lands without restarting the CLI.
|
|
346
|
-
*
|
|
347
|
-
* Watches the config's DIRECTORY, not the file: editors save via atomic
|
|
348
|
-
* rename, which silently kills an inode-bound watch.
|
|
349
|
-
*
|
|
350
|
-
* Deliberate limits, surfaced to the user instead of half-applied:
|
|
351
|
-
* • origin / adapter changes re-key the worker's identity → restart;
|
|
352
|
-
* • a mid-edit broken config (syntax error, bad env) warns and keeps the
|
|
353
|
-
* previous generation running;
|
|
354
|
-
* • modules the config IMPORTS (e.g. the schema) stay module-cached — only
|
|
355
|
-
* the config file itself is re-evaluated, which covers everything
|
|
356
|
-
* `defineDomain` owns (vars, requires, postInstall, wrangler overlay…).
|
|
357
|
-
*/
|
|
358
|
-
export function watchConfigForRegen(args: {
|
|
359
|
-
configPath: string
|
|
360
|
-
initial: DeployConfig
|
|
361
|
-
env: string
|
|
362
|
-
/** CLI flag overrides (dev --port / --host) — re-applied on every regen. */
|
|
363
|
-
paramOverrides: Record<string, unknown>
|
|
364
|
-
projectDir: string
|
|
365
|
-
specPath: string
|
|
366
|
-
url: string
|
|
367
|
-
onReload: () => void
|
|
368
|
-
}): () => void {
|
|
369
|
-
let running = false
|
|
370
|
-
let pending = false
|
|
371
|
-
let stopped = false
|
|
372
|
-
let timer: ReturnType<typeof setTimeout> | undefined
|
|
373
|
-
|
|
374
|
-
async function regen(): Promise<void> {
|
|
375
|
-
if (stopped) return
|
|
376
|
-
if (running) {
|
|
377
|
-
pending = true
|
|
378
|
-
return
|
|
379
|
-
}
|
|
380
|
-
running = true
|
|
381
|
-
try {
|
|
382
|
-
const def = await loadConfig(args.configPath, { fresh: true })
|
|
383
|
-
if (def.origin !== args.initial.origin || def.adapter.name !== args.initial.adapter.name) {
|
|
384
|
-
warn(
|
|
385
|
-
`astrale.config.ts: \`origin\` or adapter changed — that re-keys the worker's ` +
|
|
386
|
-
`identity; restart \`astrale-domain dev\` to apply.`,
|
|
387
|
-
)
|
|
388
|
-
return
|
|
389
|
-
}
|
|
390
|
-
const adapter = def.adapter as DomainAdapter<unknown>
|
|
391
|
-
if (!adapter.regenerate) {
|
|
392
|
-
warn(
|
|
393
|
-
`astrale.config.ts changed, but the "${adapter.name}" adapter has no \`regenerate\` — ` +
|
|
394
|
-
`restart \`astrale-domain dev\` to apply.`,
|
|
395
|
-
)
|
|
396
|
-
return
|
|
397
|
-
}
|
|
398
|
-
const params = {
|
|
399
|
-
...(adapter.params(args.env) as Record<string, unknown>),
|
|
400
|
-
...args.paramOverrides,
|
|
401
|
-
}
|
|
402
|
-
const domain = toDomainInfo(def)
|
|
403
|
-
await adapter.regenerate(params, {
|
|
404
|
-
projectDir: args.projectDir,
|
|
405
|
-
specPath: args.specPath,
|
|
406
|
-
secrets: loadSecrets(adapter, params, args.projectDir),
|
|
407
|
-
domain,
|
|
408
|
-
env: args.env,
|
|
409
|
-
onReload: args.onReload,
|
|
410
|
-
})
|
|
411
|
-
await writeSpecBestEffort({
|
|
412
|
-
projectDir: args.projectDir,
|
|
413
|
-
specPath: args.specPath,
|
|
414
|
-
def,
|
|
415
|
-
url: args.url,
|
|
416
|
-
})
|
|
417
|
-
info(
|
|
418
|
-
`↻ astrale.config.ts changed — codegen regenerated, the dev server reloads it ` +
|
|
419
|
-
`(a port / workerName / remote change still needs a restart)`,
|
|
420
|
-
)
|
|
421
|
-
} catch (err) {
|
|
422
|
-
warn(
|
|
423
|
-
`astrale.config.ts changed but reloading it failed (previous config stays live): ` +
|
|
424
|
-
`${(err as Error).message}`,
|
|
425
|
-
)
|
|
426
|
-
} finally {
|
|
427
|
-
running = false
|
|
428
|
-
if (pending && !stopped) {
|
|
429
|
-
pending = false
|
|
430
|
-
void regen()
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
const configFile = basename(args.configPath)
|
|
436
|
-
const watcher = watchFs(dirname(args.configPath), (_event, file) => {
|
|
437
|
-
if (file && file !== configFile) return
|
|
438
|
-
clearTimeout(timer)
|
|
439
|
-
// Debounce: editors fire several fs events per save (write + rename).
|
|
440
|
-
timer = setTimeout(() => void regen(), 200)
|
|
441
|
-
})
|
|
442
|
-
|
|
443
|
-
return () => {
|
|
444
|
-
stopped = true
|
|
445
|
-
clearTimeout(timer)
|
|
446
|
-
watcher.close()
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// ── spec ─────────────────────────────────────────────────────────────────
|
|
451
|
-
|
|
452
|
-
async function writeSpec(args: {
|
|
453
|
-
projectDir: string
|
|
454
|
-
specPath: string
|
|
455
|
-
def: DeployConfig
|
|
456
|
-
url: string
|
|
457
|
-
}): Promise<void> {
|
|
458
|
-
const { wire, schemaHash } = await buildProjectSpec(args.def, args.url)
|
|
459
|
-
await mkdir(dirname(args.specPath), { recursive: true })
|
|
460
|
-
await writeFile(args.specPath, JSON.stringify({ ...wire, schemaHash }, null, 2))
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Diagnostic-spec write for dev/deploy: best-effort — the worker builds the
|
|
465
|
-
* live install bundle itself, so a malformed project still runs/deploys; we
|
|
466
|
-
* warn and continue.
|
|
467
|
-
*/
|
|
468
|
-
async function writeSpecBestEffort(args: {
|
|
469
|
-
projectDir: string
|
|
470
|
-
specPath: string
|
|
471
|
-
def: DeployConfig
|
|
472
|
-
url: string
|
|
473
|
-
}): Promise<void> {
|
|
474
|
-
try {
|
|
475
|
-
await writeSpec(args)
|
|
476
|
-
} catch (err) {
|
|
477
|
-
const msg = (err as Error).message
|
|
478
|
-
warn(`(non-fatal) skipped the local diagnostic spec — the worker builds the real one: ${msg}`)
|
|
479
|
-
if (msg.includes('MISSING_DEF')) {
|
|
480
|
-
warn(
|
|
481
|
-
` MISSING_DEF here usually means TWO copies of @astrale-os/kernel-core are loaded ` +
|
|
482
|
-
`(linked dev deps). Try \`pnpm dedupe\`; the deploy itself is unaffected.`,
|
|
483
|
-
)
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
// ── helpers ────────────────────────────────────────────────────────────────
|
|
489
|
-
|
|
490
|
-
function loadSecrets(
|
|
491
|
-
adapter: DomainAdapter<unknown>,
|
|
492
|
-
params: unknown,
|
|
493
|
-
projectDir: string,
|
|
494
|
-
): Record<string, string> {
|
|
495
|
-
const file = adapter.secretsFile?.(params)
|
|
496
|
-
if (!file) return {}
|
|
497
|
-
const abs = isAbsolute(file) ? file : join(projectDir, file)
|
|
498
|
-
return loadDeclaredSecrets(abs, file)
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
function findConfig(dir: string): string | undefined {
|
|
502
|
-
for (const name of CONFIG_NAMES) {
|
|
503
|
-
const candidate = join(dir, name)
|
|
504
|
-
if (existsSync(candidate)) return candidate
|
|
505
|
-
}
|
|
506
|
-
return undefined
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
function toDomainInfo(def: DeployConfig): DomainInfo {
|
|
510
|
-
return {
|
|
511
|
-
origin: def.origin,
|
|
512
|
-
requires: def.requires,
|
|
513
|
-
...(def.postInstall ? { postInstall: def.postInstall } : {}),
|
|
514
|
-
// Presence comes from the definition the author wired — never a folder probe.
|
|
515
|
-
hasViews: def.views !== undefined,
|
|
516
|
-
hasFunctions: def.functions !== undefined,
|
|
517
|
-
mountedViews: collectMountedViews(def.views),
|
|
518
|
-
hasDeps: def.deps !== undefined,
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
function collectMountedViews(views: DeployConfig['views']): DomainInfo['mountedViews'] {
|
|
523
|
-
if (!views) return []
|
|
524
|
-
const mounted: DomainInfo['mountedViews'] = []
|
|
525
|
-
for (const [slug, def] of Object.entries(views)) {
|
|
526
|
-
const mount = (def as { mount?: unknown }).mount
|
|
527
|
-
if (typeof mount !== 'string' || mount.length === 0) continue
|
|
528
|
-
mounted.push({ slug, mount: normalizeMount(mount) })
|
|
529
|
-
}
|
|
530
|
-
return mounted
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
function normalizeMount(mount: string): string {
|
|
534
|
-
return `/${mount.replace(/^\/+/, '')}`
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
async function loadConfig(path: string, opts?: { fresh: boolean }): Promise<DeployConfig> {
|
|
538
|
-
// Re-importing an EDITED file: Bun's ESM registry is keyed by path and never
|
|
539
|
-
// re-reads the source — a `?reload=N` query re-EVALUATES but serves the
|
|
540
|
-
// CACHED (stale) source. Bun unifies that registry with `require.cache`, so
|
|
541
|
-
// deleting the entry forces a fresh read on the next import (the CLI is
|
|
542
|
-
// Bun-gated, see `run()`). Modules the config itself imports stay cached —
|
|
543
|
-
// the documented hot-regen limit.
|
|
544
|
-
if (opts?.fresh) delete createRequire(import.meta.url).cache[path]
|
|
545
|
-
const mod = (await import(pathToFileURL(path).href)) as { default?: unknown }
|
|
546
|
-
const def = mod.default
|
|
547
|
-
if (!def || typeof def !== 'object' || !('adapter' in def) || !('origin' in def)) {
|
|
548
|
-
throw new Error(
|
|
549
|
-
`${path} must \`export default deploy(domain, adapter)\` from '@astrale-os/sdk' ` +
|
|
550
|
-
`(where \`domain\` is a \`defineDomain({ ... })\` from your domain.ts).`,
|
|
551
|
-
)
|
|
552
|
-
}
|
|
553
|
-
return def as DeployConfig
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/** Require a plausible public URL for `--host`; default the scheme to https. */
|
|
557
|
-
function normalizeHost(raw: string | undefined): string {
|
|
558
|
-
if (!raw || raw.startsWith('-')) throw new Error(`--host needs a public URL, got "${raw ?? ''}"`)
|
|
559
|
-
const url = /^https?:\/\//.test(raw) ? raw : `https://${raw}`
|
|
560
|
-
try {
|
|
561
|
-
return new URL(url).origin
|
|
562
|
-
} catch {
|
|
563
|
-
throw new Error(`--host needs a valid URL, got "${raw}"`)
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
export function parseArgs(argv: readonly string[]): ParsedArgs {
|
|
568
|
-
const [cmd, ...rest] = argv
|
|
569
|
-
const watch = rest.includes('--watch')
|
|
570
|
-
const fix = rest.includes('--fix')
|
|
571
|
-
// Tail-flag (deploy/prod/publish): register the deployed URL in the admin
|
|
572
|
-
// catalog after a successful deploy. The `publish` command implies it.
|
|
573
|
-
const publish = rest.includes('--publish')
|
|
574
|
-
const installByDefault = rest.includes('--install-by-default')
|
|
575
|
-
// `--dry-run` (publish): pack + `npm publish --dry-run` and skip the catalog
|
|
576
|
-
// register. A boolean flag, filtered out of `positionals` below.
|
|
577
|
-
const dryRun = rest.includes('--dry-run')
|
|
578
|
-
// Publish modes: `--schema` = schema only · `--skip-schema` = catalog only.
|
|
579
|
-
const schemaOnly = rest.includes('--schema')
|
|
580
|
-
const skipSchema = rest.includes('--skip-schema')
|
|
581
|
-
// `--port <n>` / `--port=<n>`: consume the flag AND its value so neither
|
|
582
|
-
// leaks into the positionals (a bare `8788` would be read as the env name).
|
|
583
|
-
let port: number | undefined
|
|
584
|
-
let host: string | undefined
|
|
585
|
-
let name: string | undefined
|
|
586
|
-
let publicUrl: string | undefined
|
|
587
|
-
let otp: string | undefined
|
|
588
|
-
let format: LintReportFormat | undefined
|
|
589
|
-
const cleaned: string[] = []
|
|
590
|
-
for (let i = 0; i < rest.length; i++) {
|
|
591
|
-
const a = rest[i]!
|
|
592
|
-
if (a === '--port') {
|
|
593
|
-
const v = rest[++i]
|
|
594
|
-
port = Number(v)
|
|
595
|
-
if (!Number.isInteger(port) || port <= 0)
|
|
596
|
-
throw new Error(`--port needs a port number, got "${v}"`)
|
|
597
|
-
} else if (a.startsWith('--port=')) {
|
|
598
|
-
port = Number(a.slice('--port='.length))
|
|
599
|
-
if (!Number.isInteger(port) || port <= 0)
|
|
600
|
-
throw new Error(`--port needs a port number, got "${a}"`)
|
|
601
|
-
} else if (a === '--host') {
|
|
602
|
-
host = normalizeHost(rest[++i])
|
|
603
|
-
} else if (a.startsWith('--host=')) {
|
|
604
|
-
host = normalizeHost(a.slice('--host='.length))
|
|
605
|
-
} else if (a === '--name') {
|
|
606
|
-
name = rest[++i]
|
|
607
|
-
if (!name) throw new Error('--name needs a value (the registry slug to publish under)')
|
|
608
|
-
} else if (a.startsWith('--name=')) {
|
|
609
|
-
name = a.slice('--name='.length)
|
|
610
|
-
} else if (a === '--public-url') {
|
|
611
|
-
publicUrl = rest[++i]
|
|
612
|
-
if (!publicUrl)
|
|
613
|
-
throw new Error('--public-url needs a value (the address the catalog points at)')
|
|
614
|
-
} else if (a.startsWith('--public-url=')) {
|
|
615
|
-
publicUrl = a.slice('--public-url='.length)
|
|
616
|
-
} else if (a === '--otp') {
|
|
617
|
-
otp = rest[++i]
|
|
618
|
-
if (!otp) throw new Error('--otp needs a value (your 2FA one-time password)')
|
|
619
|
-
} else if (a.startsWith('--otp=')) {
|
|
620
|
-
otp = a.slice('--otp='.length)
|
|
621
|
-
} else if (a === '--format') {
|
|
622
|
-
const value = rest[++i]
|
|
623
|
-
if (value !== 'stylish' && value !== 'json') {
|
|
624
|
-
throw new Error(`--format must be "stylish" or "json", got "${value ?? ''}"`)
|
|
625
|
-
}
|
|
626
|
-
format = value
|
|
627
|
-
} else if (a.startsWith('--format=')) {
|
|
628
|
-
const value = a.slice('--format='.length)
|
|
629
|
-
if (value !== 'stylish' && value !== 'json') {
|
|
630
|
-
throw new Error(`--format must be "stylish" or "json", got "${value}"`)
|
|
631
|
-
}
|
|
632
|
-
format = value
|
|
633
|
-
} else {
|
|
634
|
-
cleaned.push(a)
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
const positionals = cleaned.filter((a) => !a.startsWith('-'))
|
|
638
|
-
|
|
639
|
-
// `--dry-run` belongs ONLY to `publish` — never let it silently no-op a deploy.
|
|
640
|
-
if (dryRun && cmd !== 'publish') throw new Error('`--dry-run` is only valid for `publish`.')
|
|
641
|
-
// `--otp` feeds the schema publish (publish, or deploy/prod `--publish`).
|
|
642
|
-
if (otp !== undefined && !['publish', 'deploy', 'prod'].includes(cmd ?? ''))
|
|
643
|
-
throw new Error('`--otp` is only valid for the publish / deploy commands.')
|
|
644
|
-
// `--schema` (schema only) / `--skip-schema` (catalog only): publish-only, opposite.
|
|
645
|
-
if (schemaOnly && cmd !== 'publish') throw new Error('`--schema` is only valid for `publish`.')
|
|
646
|
-
if (schemaOnly && skipSchema)
|
|
647
|
-
throw new Error(
|
|
648
|
-
'`--schema` (schema only) and `--skip-schema` (catalog only) are mutually exclusive.',
|
|
649
|
-
)
|
|
650
|
-
if (fix && cmd !== 'lint') throw new Error('`--fix` is only valid for `lint`.')
|
|
651
|
-
if (format !== undefined && cmd !== 'lint') {
|
|
652
|
-
throw new Error('`--format` is only valid for `lint`.')
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
// Publish-related fields shared by deploy/prod/publish (publish itself is
|
|
656
|
-
// gated per-command: opt-in via `--publish`, always-on for `publish`). `otp` /
|
|
657
|
-
// `skipSchema` ride along because the schema-publish step runs on the
|
|
658
|
-
// `publish` command AND the `deploy --publish` tail.
|
|
659
|
-
const pub = {
|
|
660
|
-
...(name !== undefined ? { name } : {}),
|
|
661
|
-
...(installByDefault ? { installByDefault } : {}),
|
|
662
|
-
...(otp !== undefined ? { otp } : {}),
|
|
663
|
-
...(skipSchema ? { skipSchema } : {}),
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
switch (cmd) {
|
|
667
|
-
case 'dev':
|
|
668
|
-
return {
|
|
669
|
-
command: 'dev',
|
|
670
|
-
env: positionals[0] ?? 'dev',
|
|
671
|
-
watch: true,
|
|
672
|
-
...(port !== undefined ? { port } : {}),
|
|
673
|
-
...(host !== undefined ? { host } : {}),
|
|
674
|
-
}
|
|
675
|
-
case 'prod':
|
|
676
|
-
return { command: 'deploy', env: 'prod', watch, ...(publish ? { publish } : {}), ...pub }
|
|
677
|
-
case 'deploy': {
|
|
678
|
-
const env = positionals[0]
|
|
679
|
-
if (!env) throw new Error('`deploy` requires an env key, e.g. `deploy prod`.')
|
|
680
|
-
return { command: 'deploy', env, watch, ...(publish ? { publish } : {}), ...pub }
|
|
681
|
-
}
|
|
682
|
-
case 'publish':
|
|
683
|
-
// Release: publish ./schema + register the deployed URL (no deploy).
|
|
684
|
-
// `--schema` = schema only · `--skip-schema` = catalog only · `--dry-run`
|
|
685
|
-
// packs the schema and skips the catalog register.
|
|
686
|
-
return {
|
|
687
|
-
command: 'publish',
|
|
688
|
-
env: positionals[0] ?? 'prod',
|
|
689
|
-
watch: false,
|
|
690
|
-
...pub,
|
|
691
|
-
...(publicUrl !== undefined ? { publicUrl } : {}),
|
|
692
|
-
...(dryRun ? { dryRun } : {}),
|
|
693
|
-
...(schemaOnly ? { schemaOnly } : {}),
|
|
694
|
-
}
|
|
695
|
-
case 'build':
|
|
696
|
-
// Spec-only — no env resolution happens on this path.
|
|
697
|
-
return { command: 'build', env: 'dev', watch: false }
|
|
698
|
-
case 'lint':
|
|
699
|
-
return {
|
|
700
|
-
command: 'lint',
|
|
701
|
-
env: 'dev',
|
|
702
|
-
watch: false,
|
|
703
|
-
...(fix ? { fix: true } : {}),
|
|
704
|
-
...(format ? { format } : {}),
|
|
705
|
-
}
|
|
706
|
-
default:
|
|
707
|
-
throw new Error(cmd ? `Unknown command "${cmd}".` : 'Missing command.')
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
function rel(from: string, to: string): string {
|
|
712
|
-
return to.startsWith(from) ? `.${to.slice(from.length)}` : to
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
// ── output ───────────────────────────────────────────────────────────────
|
|
716
|
-
|
|
717
|
-
function printDevReady(url: string, domain: DomainInfo): void {
|
|
718
|
-
process.stdout.write(
|
|
719
|
-
`\n${GREEN}✓${RESET} ${BOLD}${domain.origin}${RESET} running (dev, hot-reload)\n` +
|
|
720
|
-
` ${BOLD}URL${RESET} ${GREEN}${url}${RESET}\n` +
|
|
721
|
-
` ${DIM}install on an instance:${RESET}\n` +
|
|
722
|
-
` ${BOLD}astrale domain install ${url} --direct${RESET}\n` +
|
|
723
|
-
` ${DIM}edit a handler → reloads at the same URL. edit the schema → reinstall.${RESET}\n\n`,
|
|
724
|
-
)
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
function printDeployed(result: DeployResult, def: DeployConfig): void {
|
|
728
|
-
// Adapters that already completed the install (managed deploys) supply
|
|
729
|
-
// their own next-steps; the default hint would tell the user to redo it.
|
|
730
|
-
const footer =
|
|
731
|
-
result.nextSteps !== undefined
|
|
732
|
-
? result.nextSteps === ''
|
|
733
|
-
? ''
|
|
734
|
-
: `${result.nextSteps}\n`
|
|
735
|
-
: ` ${DIM}install on an instance:${RESET}\n` +
|
|
736
|
-
` ${BOLD}astrale domain install ${result.url} --direct${RESET}\n`
|
|
737
|
-
process.stdout.write(
|
|
738
|
-
`\n${GREEN}✓${RESET} ${BOLD}${def.origin}${RESET} deployed\n` +
|
|
739
|
-
` ${BOLD}URL${RESET} ${GREEN}${result.url}${RESET}\n` +
|
|
740
|
-
footer +
|
|
741
|
-
`\n`,
|
|
742
|
-
)
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
function printUsage(msg?: string): void {
|
|
746
|
-
if (msg) error(msg)
|
|
747
|
-
process.stderr.write(
|
|
748
|
-
`\nUsage:\n` +
|
|
749
|
-
` astrale-domain dev # deploy dev --watch (hot-reload, prints URL)\n` +
|
|
750
|
-
` astrale-domain prod # deploy prod\n` +
|
|
751
|
-
` astrale-domain deploy <env> # deploy any env key (--watch optional)\n` +
|
|
752
|
-
` astrale-domain publish [env] # RELEASE: publish ./schema to npm (if any) + register the deployed URL\n` +
|
|
753
|
-
` astrale-domain build # rebuild the diagnostic spec only\n` +
|
|
754
|
-
` astrale-domain lint # generic Oxlint + Astrale domain rules\n` +
|
|
755
|
-
`\nFlags:\n` +
|
|
756
|
-
` --publish # on deploy/prod: ALSO release (publish ./schema + register the deployed URL)\n` +
|
|
757
|
-
` --schema # (publish) publish ONLY the ./schema package — no catalog, no config\n` +
|
|
758
|
-
` --skip-schema # (publish / deploy --publish) register the catalog only; don't publish ./schema\n` +
|
|
759
|
-
` --name <slug> # registry name to publish under (default: the origin's first label)\n` +
|
|
760
|
-
` --public-url <url> # (publish) address the catalog points at (default: https://<origin>)\n` +
|
|
761
|
-
` --install-by-default # mark the published domain for install on every new instance\n` +
|
|
762
|
-
` --dry-run # (publish) pack + npm publish --dry-run; never ships, skips catalog\n` +
|
|
763
|
-
` --otp <code> # (publish / deploy --publish) 2FA code for npm publish\n` +
|
|
764
|
-
` --fix # (lint) apply safe fixes\n` +
|
|
765
|
-
` --format <stylish|json> # (lint) select human or machine output\n` +
|
|
766
|
-
`\n catalog register shells out to \`astrale domain publish\` (needs \`astrale\` on PATH).\n` +
|
|
767
|
-
` schema publish uses \`pnpm pack\` then \`npm publish\` (needs \`pnpm\` + \`npm\`; npm handles 2FA).\n\n`,
|
|
768
|
-
)
|
|
769
|
-
}
|