@opensip-cli/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/config-resolution.test.d.ts +2 -0
- package/dist/__tests__/config-resolution.test.d.ts.map +1 -0
- package/dist/__tests__/config-resolution.test.js +94 -0
- package/dist/__tests__/config-resolution.test.js.map +1 -0
- package/dist/__tests__/public-api.test.d.ts +16 -0
- package/dist/__tests__/public-api.test.d.ts.map +1 -0
- package/dist/__tests__/public-api.test.js +209 -0
- package/dist/__tests__/public-api.test.js.map +1 -0
- package/dist/__tests__/signal-batch.test.d.ts +2 -0
- package/dist/__tests__/signal-batch.test.d.ts.map +1 -0
- package/dist/__tests__/signal-batch.test.js +39 -0
- package/dist/__tests__/signal-batch.test.js.map +1 -0
- package/dist/__tests__/signal-sink.test.d.ts +2 -0
- package/dist/__tests__/signal-sink.test.d.ts.map +1 -0
- package/dist/__tests__/signal-sink.test.js +25 -0
- package/dist/__tests__/signal-sink.test.js.map +1 -0
- package/dist/__tests__/strip-utils.test.d.ts +2 -0
- package/dist/__tests__/strip-utils.test.d.ts.map +1 -0
- package/dist/__tests__/strip-utils.test.js +397 -0
- package/dist/__tests__/strip-utils.test.js.map +1 -0
- package/dist/__tests__/text-tree.test.d.ts +2 -0
- package/dist/__tests__/text-tree.test.d.ts.map +1 -0
- package/dist/__tests__/text-tree.test.js +31 -0
- package/dist/__tests__/text-tree.test.js.map +1 -0
- package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts +2 -0
- package/dist/baseline/__tests__/fingerprint-strategy.test.d.ts.map +1 -0
- package/dist/baseline/__tests__/fingerprint-strategy.test.js +69 -0
- package/dist/baseline/__tests__/fingerprint-strategy.test.js.map +1 -0
- package/dist/baseline/fingerprint-strategy.d.ts +70 -0
- package/dist/baseline/fingerprint-strategy.d.ts.map +1 -0
- package/dist/baseline/fingerprint-strategy.js +90 -0
- package/dist/baseline/fingerprint-strategy.js.map +1 -0
- package/dist/config-resolution.d.ts +27 -0
- package/dist/config-resolution.d.ts.map +1 -0
- package/dist/config-resolution.js +92 -0
- package/dist/config-resolution.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/dist/languages/__tests__/content-filter-dispatch.test.d.ts +2 -0
- package/dist/languages/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
- package/dist/languages/__tests__/content-filter-dispatch.test.js +87 -0
- package/dist/languages/__tests__/content-filter-dispatch.test.js.map +1 -0
- package/dist/languages/__tests__/non-code-formats.test.d.ts +2 -0
- package/dist/languages/__tests__/non-code-formats.test.d.ts.map +1 -0
- package/dist/languages/__tests__/non-code-formats.test.js +31 -0
- package/dist/languages/__tests__/non-code-formats.test.js.map +1 -0
- package/dist/languages/__tests__/parse-cache.test.d.ts +2 -0
- package/dist/languages/__tests__/parse-cache.test.d.ts.map +1 -0
- package/dist/languages/__tests__/parse-cache.test.js +228 -0
- package/dist/languages/__tests__/parse-cache.test.js.map +1 -0
- package/dist/languages/__tests__/registry.test.d.ts +2 -0
- package/dist/languages/__tests__/registry.test.d.ts.map +1 -0
- package/dist/languages/__tests__/registry.test.js +193 -0
- package/dist/languages/__tests__/registry.test.js.map +1 -0
- package/dist/languages/__tests__/workspace-unit-contract.test.d.ts +2 -0
- package/dist/languages/__tests__/workspace-unit-contract.test.d.ts.map +1 -0
- package/dist/languages/__tests__/workspace-unit-contract.test.js +66 -0
- package/dist/languages/__tests__/workspace-unit-contract.test.js.map +1 -0
- package/dist/languages/adapter.d.ts +66 -0
- package/dist/languages/adapter.d.ts.map +1 -0
- package/dist/languages/adapter.js +2 -0
- package/dist/languages/adapter.js.map +1 -0
- package/dist/languages/content-filter-dispatch.d.ts +36 -0
- package/dist/languages/content-filter-dispatch.d.ts.map +1 -0
- package/dist/languages/content-filter-dispatch.js +75 -0
- package/dist/languages/content-filter-dispatch.js.map +1 -0
- package/dist/languages/generic-types.d.ts +22 -0
- package/dist/languages/generic-types.d.ts.map +1 -0
- package/dist/languages/generic-types.js +3 -0
- package/dist/languages/generic-types.js.map +1 -0
- package/dist/languages/index.d.ts +12 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +7 -0
- package/dist/languages/index.js.map +1 -0
- package/dist/languages/non-code-formats.d.ts +37 -0
- package/dist/languages/non-code-formats.d.ts.map +1 -0
- package/dist/languages/non-code-formats.js +45 -0
- package/dist/languages/non-code-formats.js.map +1 -0
- package/dist/languages/parse-cache-class.d.ts +69 -0
- package/dist/languages/parse-cache-class.d.ts.map +1 -0
- package/dist/languages/parse-cache-class.js +135 -0
- package/dist/languages/parse-cache-class.js.map +1 -0
- package/dist/languages/parse-cache.d.ts +54 -0
- package/dist/languages/parse-cache.d.ts.map +1 -0
- package/dist/languages/parse-cache.js +88 -0
- package/dist/languages/parse-cache.js.map +1 -0
- package/dist/languages/registry.d.ts +35 -0
- package/dist/languages/registry.d.ts.map +1 -0
- package/dist/languages/registry.js +123 -0
- package/dist/languages/registry.js.map +1 -0
- package/dist/languages/strip-scanners.d.ts +170 -0
- package/dist/languages/strip-scanners.d.ts.map +1 -0
- package/dist/languages/strip-scanners.js +233 -0
- package/dist/languages/strip-scanners.js.map +1 -0
- package/dist/languages/strip-utils.d.ts +66 -0
- package/dist/languages/strip-utils.d.ts.map +1 -0
- package/dist/languages/strip-utils.js +88 -0
- package/dist/languages/strip-utils.js.map +1 -0
- package/dist/languages/text-tree.d.ts +44 -0
- package/dist/languages/text-tree.d.ts.map +1 -0
- package/dist/languages/text-tree.js +34 -0
- package/dist/languages/text-tree.js.map +1 -0
- package/dist/languages/workspace-unit.d.ts +18 -0
- package/dist/languages/workspace-unit.d.ts.map +1 -0
- package/dist/languages/workspace-unit.js +2 -0
- package/dist/languages/workspace-unit.js.map +1 -0
- package/dist/lib/__tests__/config-version.test.d.ts +12 -0
- package/dist/lib/__tests__/config-version.test.d.ts.map +1 -0
- package/dist/lib/__tests__/config-version.test.js +92 -0
- package/dist/lib/__tests__/config-version.test.js.map +1 -0
- package/dist/lib/__tests__/diagnostics-bus.test.d.ts +7 -0
- package/dist/lib/__tests__/diagnostics-bus.test.d.ts.map +1 -0
- package/dist/lib/__tests__/diagnostics-bus.test.js +44 -0
- package/dist/lib/__tests__/diagnostics-bus.test.js.map +1 -0
- package/dist/lib/__tests__/env-registry.test.d.ts +7 -0
- package/dist/lib/__tests__/env-registry.test.d.ts.map +1 -0
- package/dist/lib/__tests__/env-registry.test.js +82 -0
- package/dist/lib/__tests__/env-registry.test.js.map +1 -0
- package/dist/lib/__tests__/errors.test.d.ts +2 -0
- package/dist/lib/__tests__/errors.test.d.ts.map +1 -0
- package/dist/lib/__tests__/errors.test.js +218 -0
- package/dist/lib/__tests__/errors.test.js.map +1 -0
- package/dist/lib/__tests__/format.test.d.ts +2 -0
- package/dist/lib/__tests__/format.test.d.ts.map +1 -0
- package/dist/lib/__tests__/format.test.js +23 -0
- package/dist/lib/__tests__/format.test.js.map +1 -0
- package/dist/lib/__tests__/ids.test.d.ts +2 -0
- package/dist/lib/__tests__/ids.test.d.ts.map +1 -0
- package/dist/lib/__tests__/ids.test.js +80 -0
- package/dist/lib/__tests__/ids.test.js.map +1 -0
- package/dist/lib/__tests__/logger.test.d.ts +2 -0
- package/dist/lib/__tests__/logger.test.d.ts.map +1 -0
- package/dist/lib/__tests__/logger.test.js +284 -0
- package/dist/lib/__tests__/logger.test.js.map +1 -0
- package/dist/lib/__tests__/package-version.test.d.ts +2 -0
- package/dist/lib/__tests__/package-version.test.d.ts.map +1 -0
- package/dist/lib/__tests__/package-version.test.js +47 -0
- package/dist/lib/__tests__/package-version.test.js.map +1 -0
- package/dist/lib/__tests__/paths.test.d.ts +5 -0
- package/dist/lib/__tests__/paths.test.d.ts.map +1 -0
- package/dist/lib/__tests__/paths.test.js +59 -0
- package/dist/lib/__tests__/paths.test.js.map +1 -0
- package/dist/lib/__tests__/payload-version.test.d.ts +2 -0
- package/dist/lib/__tests__/payload-version.test.d.ts.map +1 -0
- package/dist/lib/__tests__/payload-version.test.js +35 -0
- package/dist/lib/__tests__/payload-version.test.js.map +1 -0
- package/dist/lib/__tests__/phantom-detect.test.d.ts +10 -0
- package/dist/lib/__tests__/phantom-detect.test.d.ts.map +1 -0
- package/dist/lib/__tests__/phantom-detect.test.js +84 -0
- package/dist/lib/__tests__/phantom-detect.test.js.map +1 -0
- package/dist/lib/__tests__/project-context.test.d.ts +10 -0
- package/dist/lib/__tests__/project-context.test.d.ts.map +1 -0
- package/dist/lib/__tests__/project-context.test.js +240 -0
- package/dist/lib/__tests__/project-context.test.js.map +1 -0
- package/dist/lib/__tests__/registry.test.d.ts +2 -0
- package/dist/lib/__tests__/registry.test.d.ts.map +1 -0
- package/dist/lib/__tests__/registry.test.js +333 -0
- package/dist/lib/__tests__/registry.test.js.map +1 -0
- package/dist/lib/__tests__/retry.test.d.ts +2 -0
- package/dist/lib/__tests__/retry.test.d.ts.map +1 -0
- package/dist/lib/__tests__/retry.test.js +71 -0
- package/dist/lib/__tests__/retry.test.js.map +1 -0
- package/dist/lib/__tests__/run-diagnostics.test.d.ts +9 -0
- package/dist/lib/__tests__/run-diagnostics.test.d.ts.map +1 -0
- package/dist/lib/__tests__/run-diagnostics.test.js +61 -0
- package/dist/lib/__tests__/run-diagnostics.test.js.map +1 -0
- package/dist/lib/__tests__/run-scope.test.d.ts +2 -0
- package/dist/lib/__tests__/run-scope.test.d.ts.map +1 -0
- package/dist/lib/__tests__/run-scope.test.js +202 -0
- package/dist/lib/__tests__/run-scope.test.js.map +1 -0
- package/dist/lib/__tests__/run-timer.test.d.ts +2 -0
- package/dist/lib/__tests__/run-timer.test.d.ts.map +1 -0
- package/dist/lib/__tests__/run-timer.test.js +152 -0
- package/dist/lib/__tests__/run-timer.test.js.map +1 -0
- package/dist/lib/__tests__/severity-policy.test.d.ts +6 -0
- package/dist/lib/__tests__/severity-policy.test.d.ts.map +1 -0
- package/dist/lib/__tests__/severity-policy.test.js +47 -0
- package/dist/lib/__tests__/severity-policy.test.js.map +1 -0
- package/dist/lib/__tests__/telemetry.test.d.ts +2 -0
- package/dist/lib/__tests__/telemetry.test.d.ts.map +1 -0
- package/dist/lib/__tests__/telemetry.test.js +212 -0
- package/dist/lib/__tests__/telemetry.test.js.map +1 -0
- package/dist/lib/__tests__/verdict-policy.test.d.ts +7 -0
- package/dist/lib/__tests__/verdict-policy.test.d.ts.map +1 -0
- package/dist/lib/__tests__/verdict-policy.test.js +91 -0
- package/dist/lib/__tests__/verdict-policy.test.js.map +1 -0
- package/dist/lib/__tests__/yaml.test.d.ts +6 -0
- package/dist/lib/__tests__/yaml.test.d.ts.map +1 -0
- package/dist/lib/__tests__/yaml.test.js +79 -0
- package/dist/lib/__tests__/yaml.test.js.map +1 -0
- package/dist/lib/config-version.d.ts +49 -0
- package/dist/lib/config-version.d.ts.map +1 -0
- package/dist/lib/config-version.js +56 -0
- package/dist/lib/config-version.js.map +1 -0
- package/dist/lib/diagnostics-bus.d.ts +48 -0
- package/dist/lib/diagnostics-bus.d.ts.map +1 -0
- package/dist/lib/diagnostics-bus.js +74 -0
- package/dist/lib/diagnostics-bus.js.map +1 -0
- package/dist/lib/env-registry.d.ts +108 -0
- package/dist/lib/env-registry.d.ts.map +1 -0
- package/dist/lib/env-registry.js +92 -0
- package/dist/lib/env-registry.js.map +1 -0
- package/dist/lib/errors.d.ts +132 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +160 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/execution/__tests__/execution.test.d.ts +7 -0
- package/dist/lib/execution/__tests__/execution.test.d.ts.map +1 -0
- package/dist/lib/execution/__tests__/execution.test.js +254 -0
- package/dist/lib/execution/__tests__/execution.test.js.map +1 -0
- package/dist/lib/execution/index.d.ts +15 -0
- package/dist/lib/execution/index.d.ts.map +1 -0
- package/dist/lib/execution/index.js +10 -0
- package/dist/lib/execution/index.js.map +1 -0
- package/dist/lib/execution/options.d.ts +32 -0
- package/dist/lib/execution/options.d.ts.map +1 -0
- package/dist/lib/execution/options.js +15 -0
- package/dist/lib/execution/options.js.map +1 -0
- package/dist/lib/execution/pipeline.d.ts +36 -0
- package/dist/lib/execution/pipeline.d.ts.map +1 -0
- package/dist/lib/execution/pipeline.js +38 -0
- package/dist/lib/execution/pipeline.js.map +1 -0
- package/dist/lib/execution/retry.d.ts +38 -0
- package/dist/lib/execution/retry.d.ts.map +1 -0
- package/dist/lib/execution/retry.js +56 -0
- package/dist/lib/execution/retry.js.map +1 -0
- package/dist/lib/execution/run-with-timeout.d.ts +46 -0
- package/dist/lib/execution/run-with-timeout.d.ts.map +1 -0
- package/dist/lib/execution/run-with-timeout.js +86 -0
- package/dist/lib/execution/run-with-timeout.js.map +1 -0
- package/dist/lib/execution/schedule.d.ts +62 -0
- package/dist/lib/execution/schedule.d.ts.map +1 -0
- package/dist/lib/execution/schedule.js +130 -0
- package/dist/lib/execution/schedule.js.map +1 -0
- package/dist/lib/format.d.ts +17 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +26 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/ids.d.ts +13 -0
- package/dist/lib/ids.d.ts.map +1 -0
- package/dist/lib/ids.js +48 -0
- package/dist/lib/ids.js.map +1 -0
- package/dist/lib/logger.d.ts +166 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +283 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/package-version.d.ts +17 -0
- package/dist/lib/package-version.d.ts.map +1 -0
- package/dist/lib/package-version.js +52 -0
- package/dist/lib/package-version.js.map +1 -0
- package/dist/lib/paths.d.ts +139 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +105 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/lib/payload-version.d.ts +15 -0
- package/dist/lib/payload-version.d.ts.map +1 -0
- package/dist/lib/payload-version.js +24 -0
- package/dist/lib/payload-version.js.map +1 -0
- package/dist/lib/phantom-detect.d.ts +21 -0
- package/dist/lib/phantom-detect.d.ts.map +1 -0
- package/dist/lib/phantom-detect.js +76 -0
- package/dist/lib/phantom-detect.js.map +1 -0
- package/dist/lib/project-context.d.ts +66 -0
- package/dist/lib/project-context.d.ts.map +1 -0
- package/dist/lib/project-context.js +112 -0
- package/dist/lib/project-context.js.map +1 -0
- package/dist/lib/recipe-id.d.ts +13 -0
- package/dist/lib/recipe-id.d.ts.map +1 -0
- package/dist/lib/recipe-id.js +15 -0
- package/dist/lib/recipe-id.js.map +1 -0
- package/dist/lib/registry.d.ts +98 -0
- package/dist/lib/registry.d.ts.map +1 -0
- package/dist/lib/registry.js +152 -0
- package/dist/lib/registry.js.map +1 -0
- package/dist/lib/retry.d.ts +26 -0
- package/dist/lib/retry.d.ts.map +1 -0
- package/dist/lib/retry.js +48 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/run-diagnostics.d.ts +64 -0
- package/dist/lib/run-diagnostics.d.ts.map +1 -0
- package/dist/lib/run-diagnostics.js +25 -0
- package/dist/lib/run-diagnostics.js.map +1 -0
- package/dist/lib/run-scope.d.ts +167 -0
- package/dist/lib/run-scope.d.ts.map +1 -0
- package/dist/lib/run-scope.js +176 -0
- package/dist/lib/run-scope.js.map +1 -0
- package/dist/lib/run-timer.d.ts +82 -0
- package/dist/lib/run-timer.d.ts.map +1 -0
- package/dist/lib/run-timer.js +79 -0
- package/dist/lib/run-timer.js.map +1 -0
- package/dist/lib/scope-types.d.ts +172 -0
- package/dist/lib/scope-types.d.ts.map +1 -0
- package/dist/lib/scope-types.js +27 -0
- package/dist/lib/scope-types.js.map +1 -0
- package/dist/lib/severity-policy.d.ts +38 -0
- package/dist/lib/severity-policy.d.ts.map +1 -0
- package/dist/lib/severity-policy.js +44 -0
- package/dist/lib/severity-policy.js.map +1 -0
- package/dist/lib/telemetry.d.ts +93 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +144 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/lib/ui-context.d.ts +34 -0
- package/dist/lib/ui-context.d.ts.map +1 -0
- package/dist/lib/ui-context.js +16 -0
- package/dist/lib/ui-context.js.map +1 -0
- package/dist/lib/verdict-policy.d.ts +71 -0
- package/dist/lib/verdict-policy.d.ts.map +1 -0
- package/dist/lib/verdict-policy.js +82 -0
- package/dist/lib/verdict-policy.js.map +1 -0
- package/dist/lib/yaml.d.ts +74 -0
- package/dist/lib/yaml.d.ts.map +1 -0
- package/dist/lib/yaml.js +118 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/plugins/__tests__/as-if-external.test.d.ts +18 -0
- package/dist/plugins/__tests__/as-if-external.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/as-if-external.test.js +159 -0
- package/dist/plugins/__tests__/as-if-external.test.js.map +1 -0
- package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts +8 -0
- package/dist/plugins/__tests__/authored-tool-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/authored-tool-discovery.test.js +97 -0
- package/dist/plugins/__tests__/authored-tool-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/capability-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/capability-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/capability-discovery.test.js +349 -0
- package/dist/plugins/__tests__/capability-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/capability-from-manifest.test.d.ts +2 -0
- package/dist/plugins/__tests__/capability-from-manifest.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/capability-from-manifest.test.js +172 -0
- package/dist/plugins/__tests__/capability-from-manifest.test.js.map +1 -0
- package/dist/plugins/__tests__/capability-loader.test.d.ts +2 -0
- package/dist/plugins/__tests__/capability-loader.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/capability-loader.test.js +122 -0
- package/dist/plugins/__tests__/capability-loader.test.js.map +1 -0
- package/dist/plugins/__tests__/capability-registry.test.d.ts +2 -0
- package/dist/plugins/__tests__/capability-registry.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/capability-registry.test.js +185 -0
- package/dist/plugins/__tests__/capability-registry.test.js.map +1 -0
- package/dist/plugins/__tests__/discover.test.d.ts +2 -0
- package/dist/plugins/__tests__/discover.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/discover.test.js +311 -0
- package/dist/plugins/__tests__/discover.test.js.map +1 -0
- package/dist/plugins/__tests__/loader.test.d.ts +2 -0
- package/dist/plugins/__tests__/loader.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/loader.test.js +191 -0
- package/dist/plugins/__tests__/loader.test.js.map +1 -0
- package/dist/plugins/__tests__/manifest-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/manifest-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/manifest-discovery.test.js +132 -0
- package/dist/plugins/__tests__/manifest-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/manifest-loader.test.d.ts +2 -0
- package/dist/plugins/__tests__/manifest-loader.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/manifest-loader.test.js +434 -0
- package/dist/plugins/__tests__/manifest-loader.test.js.map +1 -0
- package/dist/plugins/__tests__/marker-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/marker-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/marker-discovery.test.js +164 -0
- package/dist/plugins/__tests__/marker-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/node-modules-walk.test.d.ts +2 -0
- package/dist/plugins/__tests__/node-modules-walk.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/node-modules-walk.test.js +76 -0
- package/dist/plugins/__tests__/node-modules-walk.test.js.map +1 -0
- package/dist/plugins/__tests__/package-entry.test.d.ts +9 -0
- package/dist/plugins/__tests__/package-entry.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/package-entry.test.js +117 -0
- package/dist/plugins/__tests__/package-entry.test.js.map +1 -0
- package/dist/plugins/__tests__/recipe-loader.test.d.ts +2 -0
- package/dist/plugins/__tests__/recipe-loader.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/recipe-loader.test.js +130 -0
- package/dist/plugins/__tests__/recipe-loader.test.js.map +1 -0
- package/dist/plugins/__tests__/scope-validation.test.d.ts +2 -0
- package/dist/plugins/__tests__/scope-validation.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/scope-validation.test.js +68 -0
- package/dist/plugins/__tests__/scope-validation.test.js.map +1 -0
- package/dist/plugins/__tests__/single-core-guard.test.d.ts +10 -0
- package/dist/plugins/__tests__/single-core-guard.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/single-core-guard.test.js +89 -0
- package/dist/plugins/__tests__/single-core-guard.test.js.map +1 -0
- package/dist/plugins/__tests__/tool-package-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/tool-package-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/tool-package-discovery.test.js +215 -0
- package/dist/plugins/__tests__/tool-package-discovery.test.js.map +1 -0
- package/dist/plugins/authored-tool-discovery.d.ts +45 -0
- package/dist/plugins/authored-tool-discovery.d.ts.map +1 -0
- package/dist/plugins/authored-tool-discovery.js +61 -0
- package/dist/plugins/authored-tool-discovery.js.map +1 -0
- package/dist/plugins/capability-discovery.d.ts +80 -0
- package/dist/plugins/capability-discovery.d.ts.map +1 -0
- package/dist/plugins/capability-discovery.js +278 -0
- package/dist/plugins/capability-discovery.js.map +1 -0
- package/dist/plugins/capability-loader.d.ts +50 -0
- package/dist/plugins/capability-loader.d.ts.map +1 -0
- package/dist/plugins/capability-loader.js +85 -0
- package/dist/plugins/capability-loader.js.map +1 -0
- package/dist/plugins/capability-registry.d.ts +169 -0
- package/dist/plugins/capability-registry.d.ts.map +1 -0
- package/dist/plugins/capability-registry.js +319 -0
- package/dist/plugins/capability-registry.js.map +1 -0
- package/dist/plugins/discover.d.ts +64 -0
- package/dist/plugins/discover.d.ts.map +1 -0
- package/dist/plugins/discover.js +303 -0
- package/dist/plugins/discover.js.map +1 -0
- package/dist/plugins/index.d.ts +37 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +40 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/json-guards.d.ts +11 -0
- package/dist/plugins/json-guards.d.ts.map +1 -0
- package/dist/plugins/json-guards.js +15 -0
- package/dist/plugins/json-guards.js.map +1 -0
- package/dist/plugins/loader.d.ts +67 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +137 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manifest-discovery.d.ts +28 -0
- package/dist/plugins/manifest-discovery.d.ts.map +1 -0
- package/dist/plugins/manifest-discovery.js +103 -0
- package/dist/plugins/manifest-discovery.js.map +1 -0
- package/dist/plugins/manifest-loader.d.ts +120 -0
- package/dist/plugins/manifest-loader.d.ts.map +1 -0
- package/dist/plugins/manifest-loader.js +410 -0
- package/dist/plugins/manifest-loader.js.map +1 -0
- package/dist/plugins/marker-discovery.d.ts +115 -0
- package/dist/plugins/marker-discovery.d.ts.map +1 -0
- package/dist/plugins/marker-discovery.js +172 -0
- package/dist/plugins/marker-discovery.js.map +1 -0
- package/dist/plugins/node-modules-walk.d.ts +61 -0
- package/dist/plugins/node-modules-walk.d.ts.map +1 -0
- package/dist/plugins/node-modules-walk.js +99 -0
- package/dist/plugins/node-modules-walk.js.map +1 -0
- package/dist/plugins/package-entry.d.ts +38 -0
- package/dist/plugins/package-entry.d.ts.map +1 -0
- package/dist/plugins/package-entry.js +86 -0
- package/dist/plugins/package-entry.js.map +1 -0
- package/dist/plugins/recipe-loader.d.ts +63 -0
- package/dist/plugins/recipe-loader.d.ts.map +1 -0
- package/dist/plugins/recipe-loader.js +67 -0
- package/dist/plugins/recipe-loader.js.map +1 -0
- package/dist/plugins/scope-validation.d.ts +35 -0
- package/dist/plugins/scope-validation.d.ts.map +1 -0
- package/dist/plugins/scope-validation.js +55 -0
- package/dist/plugins/scope-validation.js.map +1 -0
- package/dist/plugins/single-core-guard.d.ts +28 -0
- package/dist/plugins/single-core-guard.d.ts.map +1 -0
- package/dist/plugins/single-core-guard.js +69 -0
- package/dist/plugins/single-core-guard.js.map +1 -0
- package/dist/plugins/tool-package-discovery.d.ts +93 -0
- package/dist/plugins/tool-package-discovery.d.ts.map +1 -0
- package/dist/plugins/tool-package-discovery.js +118 -0
- package/dist/plugins/tool-package-discovery.js.map +1 -0
- package/dist/plugins/types.d.ts +78 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +15 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/recipes/__tests__/registry.test.d.ts +2 -0
- package/dist/recipes/__tests__/registry.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/registry.test.js +170 -0
- package/dist/recipes/__tests__/registry.test.js.map +1 -0
- package/dist/recipes/__tests__/selector.test.d.ts +20 -0
- package/dist/recipes/__tests__/selector.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/selector.test.js +173 -0
- package/dist/recipes/__tests__/selector.test.js.map +1 -0
- package/dist/recipes/__tests__/unit-config.test.d.ts +7 -0
- package/dist/recipes/__tests__/unit-config.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/unit-config.test.js +52 -0
- package/dist/recipes/__tests__/unit-config.test.js.map +1 -0
- package/dist/recipes/registry.d.ts +105 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +141 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/selector.d.ts +112 -0
- package/dist/recipes/selector.d.ts.map +1 -0
- package/dist/recipes/selector.js +134 -0
- package/dist/recipes/selector.js.map +1 -0
- package/dist/recipes/unit-config.d.ts +63 -0
- package/dist/recipes/unit-config.d.ts.map +1 -0
- package/dist/recipes/unit-config.js +68 -0
- package/dist/recipes/unit-config.js.map +1 -0
- package/dist/runtime/__tests__/in-process-transport.test.d.ts +6 -0
- package/dist/runtime/__tests__/in-process-transport.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/in-process-transport.test.js +73 -0
- package/dist/runtime/__tests__/in-process-transport.test.js.map +1 -0
- package/dist/runtime/__tests__/subprocess-transport.test.d.ts +11 -0
- package/dist/runtime/__tests__/subprocess-transport.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/subprocess-transport.test.js +118 -0
- package/dist/runtime/__tests__/subprocess-transport.test.js.map +1 -0
- package/dist/runtime/in-process-transport.d.ts +20 -0
- package/dist/runtime/in-process-transport.d.ts.map +1 -0
- package/dist/runtime/in-process-transport.js +49 -0
- package/dist/runtime/in-process-transport.js.map +1 -0
- package/dist/runtime/progress-transport.d.ts +73 -0
- package/dist/runtime/progress-transport.d.ts.map +1 -0
- package/dist/runtime/progress-transport.js +17 -0
- package/dist/runtime/progress-transport.js.map +1 -0
- package/dist/runtime/subprocess-transport.d.ts +43 -0
- package/dist/runtime/subprocess-transport.d.ts.map +1 -0
- package/dist/runtime/subprocess-transport.js +134 -0
- package/dist/runtime/subprocess-transport.js.map +1 -0
- package/dist/signals/comment-openers.d.ts +29 -0
- package/dist/signals/comment-openers.d.ts.map +1 -0
- package/dist/signals/comment-openers.js +41 -0
- package/dist/signals/comment-openers.js.map +1 -0
- package/dist/signals/comment-openers.test.d.ts +7 -0
- package/dist/signals/comment-openers.test.d.ts.map +1 -0
- package/dist/signals/comment-openers.test.js +41 -0
- package/dist/signals/comment-openers.test.js.map +1 -0
- package/dist/signals/create-signal-from-violation.d.ts +29 -0
- package/dist/signals/create-signal-from-violation.d.ts.map +1 -0
- package/dist/signals/create-signal-from-violation.js +29 -0
- package/dist/signals/create-signal-from-violation.js.map +1 -0
- package/dist/signals/signal-sink.d.ts +49 -0
- package/dist/signals/signal-sink.d.ts.map +1 -0
- package/dist/signals/signal-sink.js +6 -0
- package/dist/signals/signal-sink.js.map +1 -0
- package/dist/signals/suppress.d.ts +102 -0
- package/dist/signals/suppress.d.ts.map +1 -0
- package/dist/signals/suppress.js +325 -0
- package/dist/signals/suppress.js.map +1 -0
- package/dist/signals/suppress.test.d.ts +2 -0
- package/dist/signals/suppress.test.d.ts.map +1 -0
- package/dist/signals/suppress.test.js +213 -0
- package/dist/signals/suppress.test.js.map +1 -0
- package/dist/tools/__tests__/command-spec.test.d.ts +2 -0
- package/dist/tools/__tests__/command-spec.test.d.ts.map +1 -0
- package/dist/tools/__tests__/command-spec.test.js +191 -0
- package/dist/tools/__tests__/command-spec.test.js.map +1 -0
- package/dist/tools/__tests__/compatibility.test.d.ts +5 -0
- package/dist/tools/__tests__/compatibility.test.d.ts.map +1 -0
- package/dist/tools/__tests__/compatibility.test.js +41 -0
- package/dist/tools/__tests__/compatibility.test.js.map +1 -0
- package/dist/tools/__tests__/ids.test.d.ts +5 -0
- package/dist/tools/__tests__/ids.test.d.ts.map +1 -0
- package/dist/tools/__tests__/ids.test.js +56 -0
- package/dist/tools/__tests__/ids.test.js.map +1 -0
- package/dist/tools/__tests__/manifest-assert.test.d.ts +5 -0
- package/dist/tools/__tests__/manifest-assert.test.d.ts.map +1 -0
- package/dist/tools/__tests__/manifest-assert.test.js +66 -0
- package/dist/tools/__tests__/manifest-assert.test.js.map +1 -0
- package/dist/tools/__tests__/registry.test.d.ts +2 -0
- package/dist/tools/__tests__/registry.test.d.ts.map +1 -0
- package/dist/tools/__tests__/registry.test.js +93 -0
- package/dist/tools/__tests__/registry.test.js.map +1 -0
- package/dist/tools/__tests__/types.test.d.ts +2 -0
- package/dist/tools/__tests__/types.test.d.ts.map +1 -0
- package/dist/tools/__tests__/types.test.js +51 -0
- package/dist/tools/__tests__/types.test.js.map +1 -0
- package/dist/tools/capability.d.ts +257 -0
- package/dist/tools/capability.d.ts.map +1 -0
- package/dist/tools/capability.js +46 -0
- package/dist/tools/capability.js.map +1 -0
- package/dist/tools/command-spec.d.ts +211 -0
- package/dist/tools/command-spec.d.ts.map +1 -0
- package/dist/tools/command-spec.js +110 -0
- package/dist/tools/command-spec.js.map +1 -0
- package/dist/tools/compatibility.d.ts +45 -0
- package/dist/tools/compatibility.d.ts.map +1 -0
- package/dist/tools/compatibility.js +49 -0
- package/dist/tools/compatibility.js.map +1 -0
- package/dist/tools/ids.d.ts +61 -0
- package/dist/tools/ids.d.ts.map +1 -0
- package/dist/tools/ids.js +61 -0
- package/dist/tools/ids.js.map +1 -0
- package/dist/tools/index.d.ts +22 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +28 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/manifest-assert.d.ts +35 -0
- package/dist/tools/manifest-assert.d.ts.map +1 -0
- package/dist/tools/manifest-assert.js +67 -0
- package/dist/tools/manifest-assert.js.map +1 -0
- package/dist/tools/manifest.d.ts +178 -0
- package/dist/tools/manifest.d.ts.map +1 -0
- package/dist/tools/manifest.js +35 -0
- package/dist/tools/manifest.js.map +1 -0
- package/dist/tools/registry.d.ts +37 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +49 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +1021 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +77 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/__tests__/signal.test.d.ts +2 -0
- package/dist/types/__tests__/signal.test.d.ts.map +1 -0
- package/dist/types/__tests__/signal.test.js +111 -0
- package/dist/types/__tests__/signal.test.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/signal-batch.d.ts +56 -0
- package/dist/types/signal-batch.d.ts.map +1 -0
- package/dist/types/signal-batch.js +54 -0
- package/dist/types/signal-batch.js.map +1 -0
- package/dist/types/signal.d.ts +77 -0
- package/dist/types/signal.d.ts.map +1 -0
- package/dist/types/signal.js +42 -0
- package/dist/types/signal.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the load-time manifest⇔Tool drift guard (release 2.8.0, Phase 1).
|
|
3
|
+
*/
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { ValidationError } from '../../lib/errors.js';
|
|
6
|
+
import { assertManifestMatchesTool } from '../manifest-assert.js';
|
|
7
|
+
/** Minimal Tool stub — only the fields the guard inspects are meaningful. */
|
|
8
|
+
function makeTool(humanName, commandNames, stableId = '00000000-0000-4000-8000-000000000000') {
|
|
9
|
+
return {
|
|
10
|
+
metadata: { id: stableId, name: humanName, version: '0.0.0', description: 'test tool' },
|
|
11
|
+
commands: commandNames.map((name) => ({ name, description: `${name} desc` })),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function makeManifest(humanId, commandNames, stableId) {
|
|
15
|
+
return {
|
|
16
|
+
kind: 'tool',
|
|
17
|
+
id: humanId,
|
|
18
|
+
...(stableId ? { stableId } : {}),
|
|
19
|
+
name: '@scope/test',
|
|
20
|
+
version: '0.0.0',
|
|
21
|
+
apiVersion: 1,
|
|
22
|
+
commands: commandNames.map((name) => ({ name, description: `${name} desc` })),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
describe('assertManifestMatchesTool', () => {
|
|
26
|
+
it('passes when human id/name and command-name set match exactly', () => {
|
|
27
|
+
const tool = makeTool('fitness', ['fit', 'fit-list', 'fit-recipes'], 'afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
28
|
+
const manifest = makeManifest('fitness', ['fit', 'fit-list', 'fit-recipes'], 'afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
29
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).not.toThrow();
|
|
30
|
+
});
|
|
31
|
+
it('passes when command names match but order differs (set equality)', () => {
|
|
32
|
+
const tool = makeTool('graph', ['graph', 'graph-lookup', 'sarif-export']);
|
|
33
|
+
const manifest = makeManifest('graph', ['sarif-export', 'graph', 'graph-lookup']);
|
|
34
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).not.toThrow();
|
|
35
|
+
});
|
|
36
|
+
it('passes when manifest omits stableId (additive, legacy compat)', () => {
|
|
37
|
+
const tool = makeTool('fitness', ['fit'], 'afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
38
|
+
const manifest = makeManifest('fitness', ['fit']); // no stableId
|
|
39
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).not.toThrow();
|
|
40
|
+
});
|
|
41
|
+
it('throws a ValidationError when the human id (manifest) differs from runtime name', () => {
|
|
42
|
+
const tool = makeTool('fitness', ['fit']);
|
|
43
|
+
const manifest = makeManifest('fit', ['fit']);
|
|
44
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(ValidationError);
|
|
45
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(/manifest id 'fit'.*runtime tool name 'fitness'/);
|
|
46
|
+
});
|
|
47
|
+
it('throws when manifest stableId differs from runtime id', () => {
|
|
48
|
+
const tool = makeTool('fitness', ['fit'], 'afd68bd3-ff3c-4935-a5b6-76d8fc7a5224');
|
|
49
|
+
const manifest = makeManifest('fitness', ['fit'], '11111111-1111-4111-8111-111111111111');
|
|
50
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(ValidationError);
|
|
51
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(/manifest stableId '11111111-1111-4111-8111-111111111111'.*runtime tool id 'afd68bd3-ff3c-4935-a5b6-76d8fc7a5224'/);
|
|
52
|
+
});
|
|
53
|
+
it('throws when a command is missing from the manifest', () => {
|
|
54
|
+
const tool = makeTool('graph', ['graph', 'graph-lookup']);
|
|
55
|
+
const manifest = makeManifest('graph', ['graph']);
|
|
56
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(ValidationError);
|
|
57
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(/missing from manifest: \[graph-lookup\]/);
|
|
58
|
+
});
|
|
59
|
+
it('throws when the manifest declares an extra command the tool lacks', () => {
|
|
60
|
+
const tool = makeTool('graph', ['graph']);
|
|
61
|
+
const manifest = makeManifest('graph', ['graph', 'graph-ghost']);
|
|
62
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(ValidationError);
|
|
63
|
+
expect(() => assertManifestMatchesTool(manifest, tool)).toThrow(/declared in manifest but not in tool: \[graph-ghost\]/);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=manifest-assert.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-assert.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/manifest-assert.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAKlE,6EAA6E;AAC7E,SAAS,QAAQ,CACf,SAAiB,EACjB,YAA+B,EAC/B,QAAQ,GAAG,sCAAsC;IAEjD,OAAO;QACL,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE;QACvF,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,OAAe,EACf,YAA+B,EAC/B,QAAiB;IAEjB,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,OAAO;QACX,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,IAAI,EA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EAAE;QAC5D,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACjF,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAC7D,yCAAyC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACjF,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAC7D,uDAAuD,CACxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
+
import { logger } from '../../lib/logger.js';
|
|
3
|
+
import { ToolRegistry } from '../registry.js';
|
|
4
|
+
const stub = (id, version = '0.0.0') => ({
|
|
5
|
+
metadata: {
|
|
6
|
+
id: '00000000-0000-4000-8000-000000000000',
|
|
7
|
+
name: id,
|
|
8
|
+
version,
|
|
9
|
+
description: `${id} stub`,
|
|
10
|
+
},
|
|
11
|
+
commands: [{ name: id, description: `${id} command` }],
|
|
12
|
+
});
|
|
13
|
+
describe('ToolRegistry', () => {
|
|
14
|
+
let reg;
|
|
15
|
+
let warnSpy;
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
reg = new ToolRegistry();
|
|
18
|
+
warnSpy = vi.spyOn(logger, 'warn').mockImplementation(() => undefined);
|
|
19
|
+
});
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
vi.restoreAllMocks();
|
|
22
|
+
});
|
|
23
|
+
it('register + list round-trip', () => {
|
|
24
|
+
const a = stub('a');
|
|
25
|
+
reg.register(a);
|
|
26
|
+
expect(reg.list()).toEqual([a]);
|
|
27
|
+
});
|
|
28
|
+
it('get returns the registered tool by id', () => {
|
|
29
|
+
const a = stub('a');
|
|
30
|
+
reg.register(a);
|
|
31
|
+
expect(reg.get('a')).toBe(a);
|
|
32
|
+
});
|
|
33
|
+
it('get returns undefined for unknown ids', () => {
|
|
34
|
+
expect(reg.get('nope')).toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
it('register preserves the first entry on duplicate id (first writer wins)', () => {
|
|
37
|
+
const first = stub('a', '1.0.0');
|
|
38
|
+
const second = stub('a', '9.9.9');
|
|
39
|
+
reg.register(first);
|
|
40
|
+
reg.register(second);
|
|
41
|
+
expect(reg.list()).toHaveLength(1);
|
|
42
|
+
expect(reg.get('a')).toBe(first);
|
|
43
|
+
});
|
|
44
|
+
it('register emits a structured warning on duplicate id', () => {
|
|
45
|
+
reg.register(stub('a'));
|
|
46
|
+
reg.register(stub('a'));
|
|
47
|
+
expect(warnSpy).toHaveBeenCalledTimes(1);
|
|
48
|
+
expect(warnSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
49
|
+
evt: 'tool.registry.duplicate',
|
|
50
|
+
module: 'core:tools',
|
|
51
|
+
id: 'a',
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
it('list() returns one entry per id even after a rejected duplicate', () => {
|
|
55
|
+
reg.register(stub('a'));
|
|
56
|
+
reg.register(stub('a'));
|
|
57
|
+
reg.register(stub('b'));
|
|
58
|
+
expect(reg.list()).toHaveLength(2);
|
|
59
|
+
});
|
|
60
|
+
it('clear removes every registered tool', () => {
|
|
61
|
+
reg.register(stub('a'));
|
|
62
|
+
reg.register(stub('b'));
|
|
63
|
+
reg.clear();
|
|
64
|
+
expect(reg.list()).toEqual([]);
|
|
65
|
+
});
|
|
66
|
+
it('list returns a fresh array each call (caller cannot mutate internal state)', () => {
|
|
67
|
+
reg.register(stub('a'));
|
|
68
|
+
const snapshot = reg.list();
|
|
69
|
+
// Mutating the returned array must not affect the registry.
|
|
70
|
+
snapshot.pop();
|
|
71
|
+
expect(reg.list()).toHaveLength(1);
|
|
72
|
+
});
|
|
73
|
+
describe('register with sourcePackage (third-party discovery path)', () => {
|
|
74
|
+
it('registers when no incumbent exists', () => {
|
|
75
|
+
const t = stub('a');
|
|
76
|
+
reg.register(t, { sourcePackage: '@vendor/a' });
|
|
77
|
+
expect(reg.get('a')).toBe(t);
|
|
78
|
+
});
|
|
79
|
+
it('rejects when an incumbent exists and surfaces the source package in the warning', () => {
|
|
80
|
+
const incumbent = stub('a');
|
|
81
|
+
reg.register(incumbent);
|
|
82
|
+
reg.register(stub('a'), { sourcePackage: '@vendor/a' });
|
|
83
|
+
expect(reg.get('a')).toBe(incumbent);
|
|
84
|
+
expect(warnSpy).toHaveBeenCalledWith(expect.objectContaining({
|
|
85
|
+
evt: 'tool.registry.duplicate',
|
|
86
|
+
module: 'core:tools',
|
|
87
|
+
id: 'a',
|
|
88
|
+
sourcePackage: '@vendor/a',
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=registry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EH,QAAQ,CAAC,0DAA0D,EAAE,GAAG,EAAE;QACxE,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAAC;YAChD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iFAAiF,EAAE,GAAG,EAAE;YACzF,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5B,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAAC;YACxD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACrC,MAAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAClC,MAAM,CAAC,gBAAgB,CAAC;gBACtB,GAAG,EAAE,yBAAyB;gBAC9B,MAAM,EAAE,YAAY;gBACpB,EAAE,EAAE,GAAG;gBACP,aAAa,EAAE,WAAW;aAC3B,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, it, expect, expectTypeOf } from 'vitest';
|
|
2
|
+
import { ToolError } from '../../lib/errors.js';
|
|
3
|
+
import { UnknownLiveViewError } from '../types.js';
|
|
4
|
+
describe('UnknownLiveViewError', () => {
|
|
5
|
+
it('is constructible with a viewKey and produces an actionable message', () => {
|
|
6
|
+
const err = new UnknownLiveViewError('fit');
|
|
7
|
+
expect(err).toBeInstanceOf(UnknownLiveViewError);
|
|
8
|
+
expect(err).toBeInstanceOf(ToolError);
|
|
9
|
+
expect(err).toBeInstanceOf(Error);
|
|
10
|
+
expect(err.viewKey).toBe('fit');
|
|
11
|
+
expect(err.code).toBe('UNKNOWN_LIVE_VIEW');
|
|
12
|
+
expect(err.name).toBe('UnknownLiveViewError');
|
|
13
|
+
expect(err.message).toContain("'fit'");
|
|
14
|
+
expect(err.message).toContain('registerLiveView');
|
|
15
|
+
});
|
|
16
|
+
it('preserves a custom error code when provided via options', () => {
|
|
17
|
+
const err = new UnknownLiveViewError('graph', { code: 'CUSTOM_CODE' });
|
|
18
|
+
expect(err.code).toBe('CUSTOM_CODE');
|
|
19
|
+
expect(err.viewKey).toBe('graph');
|
|
20
|
+
});
|
|
21
|
+
it('chains a cause through ToolErrorOptions', () => {
|
|
22
|
+
const cause = new Error('root');
|
|
23
|
+
const err = new UnknownLiveViewError('graph', { cause });
|
|
24
|
+
expect(err.cause).toBe(cause);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
const fixtureRenderer = () => Promise.resolve();
|
|
28
|
+
describe('LiveViewRenderer', () => {
|
|
29
|
+
it('is exported as a structural type that accepts an unknown args payload', () => {
|
|
30
|
+
expectTypeOf().toBeFunction();
|
|
31
|
+
expectTypeOf().parameter(0).toBeUnknown();
|
|
32
|
+
// Host-owned-run-timing: live renderers return completion data to the host
|
|
33
|
+
// (or void) instead of persisting sessions themselves.
|
|
34
|
+
expectTypeOf().returns.resolves.toEqualTypeOf();
|
|
35
|
+
});
|
|
36
|
+
it('accepts a function value at runtime', () => {
|
|
37
|
+
expect(typeof fixtureRenderer).toBe('function');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('ToolRunSessions launch surface (host-owned-run-timing Phase 6)', () => {
|
|
41
|
+
it('exposes only the read-only `timing` lifecycle — no generic-session record(...)', () => {
|
|
42
|
+
// Compile-time guard (spec §6.5 / §11 / Phase 6 step 9): the public run seam
|
|
43
|
+
// must NOT carry a generic-session writer. Tools return a
|
|
44
|
+
// ToolSessionContribution (inside a ToolRunCompletion) and the host run plane
|
|
45
|
+
// persists it. If a `record(...)` (or any other member) is re-added to
|
|
46
|
+
// ToolRunSessions, `keyof` drifts from `'timing'` and this fails to compile.
|
|
47
|
+
expectTypeOf().toEqualTypeOf();
|
|
48
|
+
expectTypeOf().toEqualTypeOf();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=types.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAKnD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CA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E,uDAAuD;QACvD,YAAY,EAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,EAA4B,CAAC;IAC9F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gEAAgE,EAAE,GAAG,EAAE;IAC9E,EAAE,CAAC,gFAAgF,EAAE,GAAG,EAAE;QACxF,6EAA6E;QAC7E,0DAA0D;QAC1D,8EAA8E;QAC9E,uEAAuE;QACvE,6EAA6E;QAC7E,YAAY,EAAyB,CAAC,aAAa,EAAY,CAAC;QAChE,YAAY,EAA6B,CAAC,aAAa,EAAY,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Capability domain model (launch, §5.3).
|
|
3
|
+
*
|
|
4
|
+
* A **capability domain** is a named extension point a tool OWNS — "fit
|
|
5
|
+
* has checks", "sim has scenarios", "graph has language adapters". Today
|
|
6
|
+
* the host knows these by a compiled-in enum (`MARKER_KINDS` in
|
|
7
|
+
* `marker-discovery.ts`). The capability model turns that knowledge into
|
|
8
|
+
* DATA: a tool declares the domains it owns in its static manifest
|
|
9
|
+
* (`ToolPluginManifest.capabilities`), and the host registers each one in
|
|
10
|
+
* a per-run capability registry WITHOUT being compiled to understand it.
|
|
11
|
+
*
|
|
12
|
+
* The host's only jobs are (a) record that a declared domain exists and
|
|
13
|
+
* who owns it, and (b) route an incoming contribution to the owning tool's
|
|
14
|
+
* registrar after checking it targets a declared domain and passes that
|
|
15
|
+
* domain's `contributionSchema`. The host never interprets the
|
|
16
|
+
* contribution itself — the owner supplies the registrar.
|
|
17
|
+
*
|
|
18
|
+
* `contributionSchema` is `unknown` at the kernel layer ON PURPOSE: `core`
|
|
19
|
+
* carries no Zod (the composer in `@opensip-cli/config` does). A domain
|
|
20
|
+
* validates a contribution either structurally (the host applies a
|
|
21
|
+
* built-in shallow check) or via an owner-supplied validator function
|
|
22
|
+
* (see {@link CapabilityValidator}) — never by importing a schema library
|
|
23
|
+
* into the kernel.
|
|
24
|
+
*
|
|
25
|
+
* These types live in **core** next to the `Tool` contract + manifest;
|
|
26
|
+
* `contracts` re-exports them for the public surface (core cannot import
|
|
27
|
+
* contracts).
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* How a contribution to a capability domain is delivered. Mirrors the
|
|
31
|
+
* three ways a pack contributes today, so an external tool can declare
|
|
32
|
+
* the same shapes the first-party tools use:
|
|
33
|
+
*
|
|
34
|
+
* - `module-export` — a value exported from a discovered `.mjs`/package
|
|
35
|
+
* module (checks, scenarios, recipes).
|
|
36
|
+
* - `manifest-entry` — a declaration carried inline in a manifest block.
|
|
37
|
+
* - `file` — a file on disk the owner reads (a scenario script,
|
|
38
|
+
* a config sidecar).
|
|
39
|
+
*/
|
|
40
|
+
export type CapabilityContributionKind = 'module-export' | 'manifest-entry' | 'file';
|
|
41
|
+
/**
|
|
42
|
+
* How a domain's contribution PACKAGES are found on disk — the data the generic
|
|
43
|
+
* discovery substrate reads so the host never compiles in "fit has checks" /
|
|
44
|
+
* "graph has adapters" knowledge (§5.3). Two modes, mirroring the two shapes the
|
|
45
|
+
* first-party tools use:
|
|
46
|
+
*
|
|
47
|
+
* - `marker` — packages declaring `package.json#opensipTools.kind === markerKind`
|
|
48
|
+
* (fit's `fit-pack`, graph's `graph-adapter`).
|
|
49
|
+
* - `name-pattern` — packages named `<scope>/<prefix>*` under a set of scopes
|
|
50
|
+
* (sim's `@opensip-cli/scenarios-*`). A legitimate, ADR-documented per-domain
|
|
51
|
+
* difference (§6.7): the descriptor exists precisely to carry it.
|
|
52
|
+
*/
|
|
53
|
+
export type CapabilityDiscoveryMode = {
|
|
54
|
+
readonly mode: 'marker';
|
|
55
|
+
readonly markerKind: string;
|
|
56
|
+
} | {
|
|
57
|
+
readonly mode: 'name-pattern';
|
|
58
|
+
readonly prefix: string;
|
|
59
|
+
readonly defaultScopes: readonly string[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A SECONDARY export the same package walk also routes — to a (usually different)
|
|
63
|
+
* domain. The §5.3 separate-domains fold: a fit-pack/sim-pack package exports both
|
|
64
|
+
* its primary contributions (`checks`/`scenarios`) AND co-located `recipes`; the
|
|
65
|
+
* recipes are routed to a `fit-recipe`/`sim-recipe` domain by the SAME discovery
|
|
66
|
+
* walk, each item still schema-checked against its OWN domain. Tool-agnostic.
|
|
67
|
+
*/
|
|
68
|
+
export interface CapabilityCoContribution {
|
|
69
|
+
/** The module export holding the secondary contributions (e.g. `recipes`). */
|
|
70
|
+
readonly exportName: string;
|
|
71
|
+
/** Whether `exportName` is an array of contributions or a single one. */
|
|
72
|
+
readonly exportShape: 'array' | 'single';
|
|
73
|
+
/** The domain id these secondary contributions route to (e.g. `fit-recipe`). */
|
|
74
|
+
readonly domainId: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The static descriptor for how a capability domain's contributions are
|
|
78
|
+
* discovered and loaded — declared in the owning tool's manifest
|
|
79
|
+
* (`ToolPluginManifest.capabilities[].discovery`) and read by the generic
|
|
80
|
+
* discovery substrate. Tool-agnostic by construction: the host walks/loads from
|
|
81
|
+
* this datum, never from compiled-in per-domain code.
|
|
82
|
+
*/
|
|
83
|
+
export interface CapabilityDiscoveryDescriptor {
|
|
84
|
+
/** The on-disk discovery mode (marker or name-pattern). */
|
|
85
|
+
readonly discovery: CapabilityDiscoveryMode;
|
|
86
|
+
/** The module export the contributions live under (`checks`/`scenarios`/`adapter`). */
|
|
87
|
+
readonly exportName: string;
|
|
88
|
+
/** Whether `exportName` is an array of contributions or a single one. */
|
|
89
|
+
readonly exportShape: 'array' | 'single';
|
|
90
|
+
/**
|
|
91
|
+
* The `opensip-cli.config.yml` `plugins.*` keys this domain's preferences live
|
|
92
|
+
* under (the existing per-domain keys, mapped so the documented config keeps
|
|
93
|
+
* working unchanged). Omitted keys default to "auto-discover on, no explicit list".
|
|
94
|
+
*/
|
|
95
|
+
readonly configKeys: {
|
|
96
|
+
readonly packages?: string;
|
|
97
|
+
readonly autoDiscover?: string;
|
|
98
|
+
readonly scopes?: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Optional package scope that marks a BUILT-IN contribution pack (resolved from
|
|
102
|
+
* the CLI install dir) vs a custom one (resolved from the project) — e.g. fit
|
|
103
|
+
* splits `@opensip-cli/` built-in check packs from project-local ones.
|
|
104
|
+
*/
|
|
105
|
+
readonly builtinScope?: string;
|
|
106
|
+
/**
|
|
107
|
+
* How an explicit package list (`configKeys.packages`) interacts with
|
|
108
|
+
* auto-discovery:
|
|
109
|
+
* - `'replace'` (default) — an explicit list WINS; auto-discovery is skipped
|
|
110
|
+
* (sim/graph: a pinned list is deterministic).
|
|
111
|
+
* - `'augment'` — the explicit list is ADDED to auto-discovery, deduped (fit:
|
|
112
|
+
* `checkPackages` names packs that don't declare the marker yet, on top of
|
|
113
|
+
* marker discovery).
|
|
114
|
+
*/
|
|
115
|
+
readonly explicitListMode?: 'replace' | 'augment';
|
|
116
|
+
/**
|
|
117
|
+
* Secondary exports the same package walk also routes to OTHER domains (§5.3
|
|
118
|
+
* separate-domains fold) — e.g. a fit-pack's co-located `recipes` routed to the
|
|
119
|
+
* `fit-recipe` domain. Each is read from every discovered package alongside the
|
|
120
|
+
* primary export.
|
|
121
|
+
*/
|
|
122
|
+
readonly coContributions?: readonly CapabilityCoContribution[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The static description of a capability domain a tool owns. Declared in
|
|
126
|
+
* the owning tool's manifest (see {@link ToolCapabilityDeclaration}) and
|
|
127
|
+
* registered into the per-run {@link CapabilityRegistry} alongside the
|
|
128
|
+
* owner-supplied registrar.
|
|
129
|
+
*
|
|
130
|
+
* The host stores this verbatim and uses it only to (a) confirm a routed
|
|
131
|
+
* contribution targets a declared domain and (b) validate the contribution
|
|
132
|
+
* against `contributionSchema` before handing it to the registrar. It is
|
|
133
|
+
* deliberately tool-agnostic — the kernel never reads a domain-specific
|
|
134
|
+
* field.
|
|
135
|
+
*/
|
|
136
|
+
export interface CapabilityDomainSpec {
|
|
137
|
+
/** Stable domain id — e.g. 'fit-pack', 'sim-pack', 'graph-adapter', 'audit-rule'. */
|
|
138
|
+
readonly id: string;
|
|
139
|
+
/** The `ToolPluginManifest.id` of the tool that owns this domain. */
|
|
140
|
+
readonly ownerToolId: string;
|
|
141
|
+
/**
|
|
142
|
+
* Coarse integer epoch for THIS domain's contribution contract (distinct
|
|
143
|
+
* from the plugin-API epoch). Bumped when the contribution shape changes
|
|
144
|
+
* incompatibly; lets a domain version its own extension point.
|
|
145
|
+
*/
|
|
146
|
+
readonly apiVersion: number;
|
|
147
|
+
/**
|
|
148
|
+
* The contract a contribution must satisfy. `unknown` at the kernel
|
|
149
|
+
* layer — the host validates it structurally (a shallow required-keys
|
|
150
|
+
* record, see {@link StructuralContributionSchema}) or via an
|
|
151
|
+
* owner-supplied {@link CapabilityValidator}. NEVER a Zod schema in core.
|
|
152
|
+
*/
|
|
153
|
+
readonly contributionSchema: unknown;
|
|
154
|
+
/** How contributions to this domain are delivered. */
|
|
155
|
+
readonly contributionKind: CapabilityContributionKind;
|
|
156
|
+
/**
|
|
157
|
+
* How this domain's contribution packages are discovered + loaded (§5.3). When
|
|
158
|
+
* present, the generic discovery substrate auto-discovers contributions for this
|
|
159
|
+
* domain from it; when absent, the domain receives only explicit/manifest
|
|
160
|
+
* contributions (no auto-discovery).
|
|
161
|
+
*/
|
|
162
|
+
readonly discovery?: CapabilityDiscoveryDescriptor;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A capability-domain declaration as it appears in a tool's static
|
|
166
|
+
* manifest (`ToolPluginManifest.capabilities[]`). Identical in shape to
|
|
167
|
+
* the runtime {@link CapabilityDomainSpec} EXCEPT `ownerToolId` is
|
|
168
|
+
* implied by the manifest's own `id` (the host stamps it on at read time),
|
|
169
|
+
* so a manifest author never repeats the owner id.
|
|
170
|
+
*
|
|
171
|
+
* Optional and additive: a manifest with no `capabilities` simply
|
|
172
|
+
* contributes no domains, and `MARKER_KINDS` remains the bootstrap-default
|
|
173
|
+
* vocabulary (a manifest domain EXTENDS that set, never replaces it).
|
|
174
|
+
*/
|
|
175
|
+
export interface ToolCapabilityDeclaration {
|
|
176
|
+
/** Stable domain id this tool declares ownership of. */
|
|
177
|
+
readonly id: string;
|
|
178
|
+
/** Contribution-contract epoch for this domain. */
|
|
179
|
+
readonly apiVersion: number;
|
|
180
|
+
/** The contribution contract (structural record or validator). `unknown` in core. */
|
|
181
|
+
readonly contributionSchema: unknown;
|
|
182
|
+
/** How contributions to this domain are delivered. */
|
|
183
|
+
readonly contributionKind: CapabilityContributionKind;
|
|
184
|
+
/** How this domain's contribution packages are discovered + loaded (§5.3). */
|
|
185
|
+
readonly discovery?: CapabilityDiscoveryDescriptor;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The owner-supplied callback the host invokes once a contribution has passed
|
|
189
|
+
* the domain's schema check. The host hands the validated contribution
|
|
190
|
+
* straight through — it never inspects the contribution's domain-specific
|
|
191
|
+
* meaning. The registrar performs the actual registration into the owning
|
|
192
|
+
* tool's own registry (a `CheckRegistry`, scenario `Registry`, graph-adapter
|
|
193
|
+
* registry, …).
|
|
194
|
+
*
|
|
195
|
+
* Defined HERE (the leaf domain model) rather than in the host-side
|
|
196
|
+
* `capability-registry.ts` so the `Tool` contract (`tools/types.ts`) can name
|
|
197
|
+
* it without importing the host registry — which would pull in
|
|
198
|
+
* `lib/run-scope.ts` and reintroduce the `run-scope → … → tools/types`
|
|
199
|
+
* import cycle. `capability-registry.ts` re-exports it for back-compat.
|
|
200
|
+
*/
|
|
201
|
+
export type CapabilityRegistrar = (contribution: unknown) => void;
|
|
202
|
+
/**
|
|
203
|
+
* A tool's namespaced configuration contribution, as the kernel sees it
|
|
204
|
+
* (launch, ADR-0023, Phase 4). The concrete schema-bearing type —
|
|
205
|
+
* `ToolConfigDeclaration` — lives in `@opensip-cli/config` (which carries
|
|
206
|
+
* Zod); core must not depend on config or Zod, so this kernel-side carrier
|
|
207
|
+
* keeps `schema` (and `defaults`/`env`) `unknown`. The composition root (the
|
|
208
|
+
* CLI, which DOES import `@opensip-cli/config`) narrows a tool's `config`
|
|
209
|
+
* slot back to the concrete `ToolConfigDeclaration` when it gathers the
|
|
210
|
+
* declarations to compose + validate the whole document.
|
|
211
|
+
*
|
|
212
|
+
* Any `ToolConfigDeclaration` is structurally assignable to this carrier (a
|
|
213
|
+
* `ZodType` is assignable to `unknown`), so a tool sets `config: myDeclaration`
|
|
214
|
+
* directly. Defined here (not in the host registry) so the leaf `Tool`
|
|
215
|
+
* contract can name it without an import cycle.
|
|
216
|
+
*/
|
|
217
|
+
export interface ToolConfigContribution {
|
|
218
|
+
/** Top-level config key owned by this tool (e.g. `graph`, `fitness`). */
|
|
219
|
+
readonly namespace: string;
|
|
220
|
+
/** The tool's namespace schema — a Zod schema at the config layer, `unknown` here. */
|
|
221
|
+
readonly schema: unknown;
|
|
222
|
+
/** Optional defaults for the namespace (lowest-precedence source). */
|
|
223
|
+
readonly defaults?: unknown;
|
|
224
|
+
/** Optional environment-variable bindings for keys in this namespace. */
|
|
225
|
+
readonly env?: unknown;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* An owner-supplied validator: returns `true` when `contribution` satisfies
|
|
229
|
+
* the domain's contract, or a string explaining why it does not. A domain
|
|
230
|
+
* whose `contributionSchema` is a function is validated by CALLING it; this
|
|
231
|
+
* is how a domain expresses a richer-than-structural contract without
|
|
232
|
+
* dragging a schema library into the kernel.
|
|
233
|
+
*/
|
|
234
|
+
export type CapabilityValidator = (contribution: unknown) => true | string;
|
|
235
|
+
/**
|
|
236
|
+
* A structural contribution schema: the kernel's Zod-free default. Each
|
|
237
|
+
* listed key must be PRESENT (and non-`undefined`) on the contribution
|
|
238
|
+
* record; an optional `kind` predicate further narrows the value. The host
|
|
239
|
+
* checks these shallowly — enough to reject an obviously wrong-shaped
|
|
240
|
+
* contribution before it reaches the owner's registrar, without the kernel
|
|
241
|
+
* understanding the domain.
|
|
242
|
+
*/
|
|
243
|
+
export interface StructuralContributionSchema {
|
|
244
|
+
/** Keys that must be present (and not `undefined`) on the contribution. */
|
|
245
|
+
readonly requiredKeys: readonly string[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Type guard: a `contributionSchema` is an owner-supplied validator
|
|
249
|
+
* function (validated by calling it) rather than a structural record.
|
|
250
|
+
*/
|
|
251
|
+
export declare function isCapabilityValidator(schema: unknown): schema is CapabilityValidator;
|
|
252
|
+
/**
|
|
253
|
+
* Type guard: a `contributionSchema` is a {@link StructuralContributionSchema}
|
|
254
|
+
* (a `{ requiredKeys: string[] }` record the host checks shallowly).
|
|
255
|
+
*/
|
|
256
|
+
export declare function isStructuralContributionSchema(schema: unknown): schema is StructuralContributionSchema;
|
|
257
|
+
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/tools/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,0BAA0B,GAAG,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAErF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxD;IACE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,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,IAAI,mBAAmB,CAEpF;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,OAAO,GACd,MAAM,IAAI,4BAA4B,CAOxC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Capability domain model (launch, §5.3).
|
|
3
|
+
*
|
|
4
|
+
* A **capability domain** is a named extension point a tool OWNS — "fit
|
|
5
|
+
* has checks", "sim has scenarios", "graph has language adapters". Today
|
|
6
|
+
* the host knows these by a compiled-in enum (`MARKER_KINDS` in
|
|
7
|
+
* `marker-discovery.ts`). The capability model turns that knowledge into
|
|
8
|
+
* DATA: a tool declares the domains it owns in its static manifest
|
|
9
|
+
* (`ToolPluginManifest.capabilities`), and the host registers each one in
|
|
10
|
+
* a per-run capability registry WITHOUT being compiled to understand it.
|
|
11
|
+
*
|
|
12
|
+
* The host's only jobs are (a) record that a declared domain exists and
|
|
13
|
+
* who owns it, and (b) route an incoming contribution to the owning tool's
|
|
14
|
+
* registrar after checking it targets a declared domain and passes that
|
|
15
|
+
* domain's `contributionSchema`. The host never interprets the
|
|
16
|
+
* contribution itself — the owner supplies the registrar.
|
|
17
|
+
*
|
|
18
|
+
* `contributionSchema` is `unknown` at the kernel layer ON PURPOSE: `core`
|
|
19
|
+
* carries no Zod (the composer in `@opensip-cli/config` does). A domain
|
|
20
|
+
* validates a contribution either structurally (the host applies a
|
|
21
|
+
* built-in shallow check) or via an owner-supplied validator function
|
|
22
|
+
* (see {@link CapabilityValidator}) — never by importing a schema library
|
|
23
|
+
* into the kernel.
|
|
24
|
+
*
|
|
25
|
+
* These types live in **core** next to the `Tool` contract + manifest;
|
|
26
|
+
* `contracts` re-exports them for the public surface (core cannot import
|
|
27
|
+
* contracts).
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Type guard: a `contributionSchema` is an owner-supplied validator
|
|
31
|
+
* function (validated by calling it) rather than a structural record.
|
|
32
|
+
*/
|
|
33
|
+
export function isCapabilityValidator(schema) {
|
|
34
|
+
return typeof schema === 'function';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Type guard: a `contributionSchema` is a {@link StructuralContributionSchema}
|
|
38
|
+
* (a `{ requiredKeys: string[] }` record the host checks shallowly).
|
|
39
|
+
*/
|
|
40
|
+
export function isStructuralContributionSchema(schema) {
|
|
41
|
+
return (typeof schema === 'object' &&
|
|
42
|
+
schema !== null &&
|
|
43
|
+
Array.isArray(schema.requiredKeys) &&
|
|
44
|
+
schema.requiredKeys.every((k) => typeof k === 'string'));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../src/tools/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAqOH;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACnD,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,MAAe;IAEf,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,KAAK,CAAC,OAAO,CAAE,MAAqC,CAAC,YAAY,CAAC;QACjE,MAAsC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CACzF,CAAC;AACJ,CAAC"}
|