@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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Load-time manifest⇔Tool drift guard (launch, Phase 1).
|
|
3
|
+
*
|
|
4
|
+
* The static `ToolPluginManifest` (declared in `package.json#opensipTools`)
|
|
5
|
+
* and the runtime `Tool` are two declarations of the same tool. Per ADR-0048
|
|
6
|
+
* the runtime uses `metadata.id` for the stable UUID and `metadata.name` for
|
|
7
|
+
* the human key (matching the manifest's `id` for the human key). Manifests
|
|
8
|
+
* may also declare `stableId` (additive) for the UUID.
|
|
9
|
+
*
|
|
10
|
+
* This guard asserts:
|
|
11
|
+
* - manifest's human `id` === runtime `metadata.name`
|
|
12
|
+
* - if manifest declares `stableId`, it === runtime `metadata.id`
|
|
13
|
+
* - the **set** of command names is identical (order-insensitive).
|
|
14
|
+
*
|
|
15
|
+
* Descriptions/aliases are NOT compared. The guard runs after dynamic import
|
|
16
|
+
* for bundled, installed, and authored tools.
|
|
17
|
+
*/
|
|
18
|
+
import type { ToolPluginManifest } from './manifest.js';
|
|
19
|
+
import type { Tool } from './types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Assert that a static `ToolPluginManifest` matches the runtime `Tool` it
|
|
22
|
+
* declares — same `id`, same set of command names. Throws `ValidationError`
|
|
23
|
+
* on any mismatch; returns `void` when they agree.
|
|
24
|
+
*
|
|
25
|
+
* This is the drift guard between the two identity declarations: the
|
|
26
|
+
* `package.json#opensipTools` manifest (read before importing the module)
|
|
27
|
+
* and the imported `Tool` (`metadata.id` + `commands[]`). Catches a manifest
|
|
28
|
+
* that fell out of sync with the tool's runtime command surface.
|
|
29
|
+
*
|
|
30
|
+
* @param manifest The static manifest read from `package.json#opensipTools`.
|
|
31
|
+
* @param tool The runtime tool the manifest is supposed to describe.
|
|
32
|
+
* @throws {ValidationError} when `id` differs, or the command-name sets differ.
|
|
33
|
+
*/
|
|
34
|
+
export declare function assertManifestMatchesTool(manifest: ToolPluginManifest, tool: Tool): void;
|
|
35
|
+
//# sourceMappingURL=manifest-assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-assert.d.ts","sourceRoot":"","sources":["../../src/tools/manifest-assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CA6CxF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Load-time manifest⇔Tool drift guard (launch, Phase 1).
|
|
3
|
+
*
|
|
4
|
+
* The static `ToolPluginManifest` (declared in `package.json#opensipTools`)
|
|
5
|
+
* and the runtime `Tool` are two declarations of the same tool. Per ADR-0048
|
|
6
|
+
* the runtime uses `metadata.id` for the stable UUID and `metadata.name` for
|
|
7
|
+
* the human key (matching the manifest's `id` for the human key). Manifests
|
|
8
|
+
* may also declare `stableId` (additive) for the UUID.
|
|
9
|
+
*
|
|
10
|
+
* This guard asserts:
|
|
11
|
+
* - manifest's human `id` === runtime `metadata.name`
|
|
12
|
+
* - if manifest declares `stableId`, it === runtime `metadata.id`
|
|
13
|
+
* - the **set** of command names is identical (order-insensitive).
|
|
14
|
+
*
|
|
15
|
+
* Descriptions/aliases are NOT compared. The guard runs after dynamic import
|
|
16
|
+
* for bundled, installed, and authored tools.
|
|
17
|
+
*/
|
|
18
|
+
import { ValidationError } from '../lib/errors.js';
|
|
19
|
+
/**
|
|
20
|
+
* Assert that a static `ToolPluginManifest` matches the runtime `Tool` it
|
|
21
|
+
* declares — same `id`, same set of command names. Throws `ValidationError`
|
|
22
|
+
* on any mismatch; returns `void` when they agree.
|
|
23
|
+
*
|
|
24
|
+
* This is the drift guard between the two identity declarations: the
|
|
25
|
+
* `package.json#opensipTools` manifest (read before importing the module)
|
|
26
|
+
* and the imported `Tool` (`metadata.id` + `commands[]`). Catches a manifest
|
|
27
|
+
* that fell out of sync with the tool's runtime command surface.
|
|
28
|
+
*
|
|
29
|
+
* @param manifest The static manifest read from `package.json#opensipTools`.
|
|
30
|
+
* @param tool The runtime tool the manifest is supposed to describe.
|
|
31
|
+
* @throws {ValidationError} when `id` differs, or the command-name sets differ.
|
|
32
|
+
*/
|
|
33
|
+
export function assertManifestMatchesTool(manifest, tool) {
|
|
34
|
+
// Human key resolution:
|
|
35
|
+
// - For tools using the post-ADR-0048 shape (stable UUID in .id, human key in .name): use .name
|
|
36
|
+
// - For legacy-shaped fixtures/tests (human key still in .id, or .name is display-only): fall back to .id
|
|
37
|
+
// This keeps authored/installed test fixtures working without mass updates while enforcing the split for real tools.
|
|
38
|
+
const isModernShape = typeof tool.metadata.id === 'string' && /^[0-9a-fA-F]{8}-/.test(tool.metadata.id);
|
|
39
|
+
const runtimeHuman = isModernShape && tool.metadata.name ? tool.metadata.name : tool.metadata.id;
|
|
40
|
+
if (manifest.id !== runtimeHuman) {
|
|
41
|
+
throw new ValidationError(`tool manifest id '${manifest.id}' does not match runtime tool name '${runtimeHuman}'`);
|
|
42
|
+
}
|
|
43
|
+
// If the manifest declares a stableId (additive per ADR-0048), it must match
|
|
44
|
+
// the runtime's stable UUID in `metadata.id`.
|
|
45
|
+
if (manifest.stableId !== undefined && manifest.stableId !== tool.metadata.id) {
|
|
46
|
+
throw new ValidationError(`tool manifest stableId '${manifest.stableId}' does not match runtime tool id '${tool.metadata.id}'`);
|
|
47
|
+
}
|
|
48
|
+
const manifestNames = new Set(manifest.commands.map((c) => c.name));
|
|
49
|
+
const toolNames = new Set(tool.commands.map((c) => c.name));
|
|
50
|
+
const missingFromManifest = [...toolNames]
|
|
51
|
+
.filter((n) => !manifestNames.has(n))
|
|
52
|
+
.sort((a, b) => a.localeCompare(b));
|
|
53
|
+
const extraInManifest = [...manifestNames]
|
|
54
|
+
.filter((n) => !toolNames.has(n))
|
|
55
|
+
.sort((a, b) => a.localeCompare(b));
|
|
56
|
+
if (missingFromManifest.length > 0 || extraInManifest.length > 0) {
|
|
57
|
+
const parts = [];
|
|
58
|
+
if (missingFromManifest.length > 0) {
|
|
59
|
+
parts.push(`missing from manifest: [${missingFromManifest.join(', ')}]`);
|
|
60
|
+
}
|
|
61
|
+
if (extraInManifest.length > 0) {
|
|
62
|
+
parts.push(`declared in manifest but not in tool: [${extraInManifest.join(', ')}]`);
|
|
63
|
+
}
|
|
64
|
+
throw new ValidationError(`tool manifest commands for '${manifest.id}' do not match runtime tool commands (${parts.join('; ')})`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=manifest-assert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-assert.js","sourceRoot":"","sources":["../../src/tools/manifest-assert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKnD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAA4B,EAAE,IAAU;IAChF,wBAAwB;IACxB,gGAAgG;IAChG,0GAA0G;IAC1G,qHAAqH;IACrH,MAAM,aAAa,GACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpF,MAAM,YAAY,GAAG,aAAa,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAEjG,IAAI,QAAQ,CAAC,EAAE,KAAK,YAAY,EAAE,CAAC;QACjC,MAAM,IAAI,eAAe,CACvB,qBAAqB,QAAQ,CAAC,EAAE,uCAAuC,YAAY,GAAG,CACvF,CAAC;IACJ,CAAC;IAED,6EAA6E;IAC7E,8CAA8C;IAC9C,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC9E,MAAM,IAAI,eAAe,CACvB,2BAA2B,QAAQ,CAAC,QAAQ,qCAAqC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CACrG,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAE5D,MAAM,mBAAmB,GAAG,CAAC,GAAG,SAAS,CAAC;SACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,eAAe,GAAG,CAAC,GAAG,aAAa,CAAC;SACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtC,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjE,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,2BAA2B,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,0CAA0C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,IAAI,eAAe,CACvB,+BAA+B,QAAQ,CAAC,EAAE,yCAAyC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACvG,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Static tool-plugin manifest + the plugin-API epoch +
|
|
3
|
+
* provenance types (launch, raw-vs-admitted compatibility contract).
|
|
4
|
+
*
|
|
5
|
+
* The **manifest** is the static front matter the host reads *before*
|
|
6
|
+
* importing a tool's runtime `Tool` module (north-star §5.1). It is
|
|
7
|
+
* declared in `package.json#opensipTools` for bundled + installed tools
|
|
8
|
+
* (one read for both) and as a JSON sidecar for project-local tools.
|
|
9
|
+
*
|
|
10
|
+
* `PLUGIN_API_VERSION` is a coarse integer **epoch** for the plugin
|
|
11
|
+
* *input* contract. A tool declares the epoch it was compiled against
|
|
12
|
+
* via `RawToolPluginManifest.apiVersion`; the host's single
|
|
13
|
+
* `checkCompatibility()` gate (see `compatibility.ts`) admits or rejects
|
|
14
|
+
* on that integer alone — no semver range maths. Once admitted, the manifest is
|
|
15
|
+
* represented as `ToolPluginManifest`, whose `apiVersion` is required.
|
|
16
|
+
*
|
|
17
|
+
* The host consumes identity + command metadata and, as of ADR-0029, the
|
|
18
|
+
* concrete `capabilities` descriptor that declares owned capability domains.
|
|
19
|
+
* Remaining fields (`config`/`dashboard`/…) stay typed-but-not-consumed
|
|
20
|
+
* placeholders so a manifest authored today stays forward-shaped.
|
|
21
|
+
*
|
|
22
|
+
* These types live in **core** (next to the `Tool` contract). `contracts`
|
|
23
|
+
* re-exports them for the public surface; core cannot import contracts.
|
|
24
|
+
*/
|
|
25
|
+
import type { ToolCapabilityDeclaration } from './capability.js';
|
|
26
|
+
/**
|
|
27
|
+
* The plugin-API epoch the running engine implements.
|
|
28
|
+
*
|
|
29
|
+
* A coarse integer, bumped only on a breaking change to the plugin
|
|
30
|
+
* *input* contract. A tool manifest's `apiVersion` is compared against
|
|
31
|
+
* this single value by `checkCompatibility()`. A missing `apiVersion`
|
|
32
|
+
* is incompatible as of launch; raw manifests stay representable so the
|
|
33
|
+
* admission gate can diagnose unversioned inputs before rejecting them.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PLUGIN_API_VERSION = 1;
|
|
36
|
+
/**
|
|
37
|
+
* Where a tool plugin came from. Drives the trust policy and the
|
|
38
|
+
* provenance record surfaced in structured logs + `plugin list`.
|
|
39
|
+
*
|
|
40
|
+
* - `bundled` — a first-party tool shipped with the CLI
|
|
41
|
+
* (trusted-by-shipping).
|
|
42
|
+
* - `installed` — an npm package discovered via tool-package-discovery
|
|
43
|
+
* (incl. `plugin add` / `plugin add --project`). Trusted
|
|
44
|
+
* as an installed dependency.
|
|
45
|
+
* - `user-global` — an authored sidecar under
|
|
46
|
+
* `~/.opensip-cli/tools/<name>/`
|
|
47
|
+
* (`opensip-tool.manifest.json`). The user placed it in
|
|
48
|
+
* their own home dir (the `npm i -g` analogue for
|
|
49
|
+
* authored code) → **trusted-by-default**.
|
|
50
|
+
* - `project-local` — an authored sidecar under
|
|
51
|
+
* `<project>/opensip-cli/tools/<name>/`
|
|
52
|
+
* (`opensip-tool.manifest.json`). It rides in with
|
|
53
|
+
* `git clone` → **deny-by-default**; admitted only when
|
|
54
|
+
* its id (or `*`) is allowlisted via
|
|
55
|
+
* `OPENSIP_CLI_ALLOW_PROJECT_TOOLS`.
|
|
56
|
+
*/
|
|
57
|
+
export type ToolSource = 'bundled' | 'installed' | 'user-global' | 'project-local';
|
|
58
|
+
/**
|
|
59
|
+
* Identity of a command a tool contributes, as declared in the static
|
|
60
|
+
* manifest. Mirrors the runtime `ToolCommandDescriptor` (`types.ts`) so
|
|
61
|
+
* the bundled path can assert manifest⇔`Tool.commands` equality (Phase 1).
|
|
62
|
+
*/
|
|
63
|
+
export interface ToolCommandManifest {
|
|
64
|
+
/** CLI subcommand name — 'fit', 'sim', 'fit-list', etc. */
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly description: string;
|
|
67
|
+
readonly aliases?: readonly string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The static front matter a tool plugin declares (in
|
|
71
|
+
* `package.json#opensipTools` or a JSON sidecar) so the host can inspect
|
|
72
|
+
* its identity + contract epoch **without importing the runtime module**.
|
|
73
|
+
*
|
|
74
|
+
* The host consumes the identity subset
|
|
75
|
+
* (`kind`/`id`/`name`/`version`/`apiVersion`/`commands`) plus the concrete
|
|
76
|
+
* `capabilities` descriptor. The remaining fields are typed-but-not-consumed
|
|
77
|
+
* placeholders for later releases so a manifest authored today is
|
|
78
|
+
* forward-shaped; they are deliberately `unknown`-shaped until a release gives
|
|
79
|
+
* them concrete semantics.
|
|
80
|
+
*
|
|
81
|
+
* Launch (§5.3) gives `capabilities` its concrete shape — an
|
|
82
|
+
* array of {@link ToolCapabilityDeclaration} (the capability domains the
|
|
83
|
+
* tool OWNS). It stays OPTIONAL and additive: a manifest with no
|
|
84
|
+
* `capabilities` declares no domains, and `MARKER_KINDS` remains the
|
|
85
|
+
* bootstrap-default domain vocabulary. The other slots stay `unknown`.
|
|
86
|
+
*/
|
|
87
|
+
interface ToolPluginManifestBase {
|
|
88
|
+
/** Discriminator — always `'tool'` (matches `opensipTools.kind`). */
|
|
89
|
+
readonly kind: 'tool';
|
|
90
|
+
/**
|
|
91
|
+
* Human/programmatic key (the value used for current storage, short ids,
|
|
92
|
+
* config, etc.). For published tools this is the "declared" identifier.
|
|
93
|
+
* This remains the manifest-side key for backward compat (ADR-0048).
|
|
94
|
+
* The tool's stable machine identity (UUID) is declared here as `stableId`
|
|
95
|
+
* (additive) when the tool author pins one; at runtime it appears as
|
|
96
|
+
* `ToolMetadata.id` (with the human key in `ToolMetadata.name`).
|
|
97
|
+
*/
|
|
98
|
+
readonly id: string;
|
|
99
|
+
/**
|
|
100
|
+
* Stable machine identity (real UUID) for this tool, matching the semantics
|
|
101
|
+
* and field name of Checks' `id`. Declared additively by tools that opt into
|
|
102
|
+
* durable identity (first-party tools declare it; community tools should too).
|
|
103
|
+
* When present, the drift guard and provenance capture it.
|
|
104
|
+
*/
|
|
105
|
+
readonly stableId?: string;
|
|
106
|
+
/** Human-facing display name. */
|
|
107
|
+
readonly name: string;
|
|
108
|
+
/** Display semver of the tool itself (NOT the contract epoch). */
|
|
109
|
+
readonly version: string;
|
|
110
|
+
/** Command identities the tool contributes — `--help` / conflict detection. */
|
|
111
|
+
readonly commands: readonly ToolCommandManifest[];
|
|
112
|
+
/**
|
|
113
|
+
* §5.3 → Launch: the capability domains this tool OWNS. Each entry is a
|
|
114
|
+
* {@link ToolCapabilityDeclaration} (id + contribution epoch + schema +
|
|
115
|
+
* kind); the host stamps `ownerToolId = this.stableId ?? this.id` (ADR-0048:
|
|
116
|
+
* the owner key must equal the owning tool's `metadata.id` — the stable UUID
|
|
117
|
+
* for modern tools) and registers each into the per-run capability registry,
|
|
118
|
+
* EXTENDING the `MARKER_KINDS` bootstrap vocabulary without a host-enum edit.
|
|
119
|
+
* Optional + additive.
|
|
120
|
+
*/
|
|
121
|
+
readonly capabilities?: readonly ToolCapabilityDeclaration[];
|
|
122
|
+
/** §5.7 → 2.9.0: tool-owned config schema descriptor. */
|
|
123
|
+
readonly config?: unknown;
|
|
124
|
+
/** Later: dashboard-contribution descriptor. */
|
|
125
|
+
readonly dashboard?: unknown;
|
|
126
|
+
/** Later: sessions-contribution descriptor. */
|
|
127
|
+
readonly sessions?: unknown;
|
|
128
|
+
/** Later: declared plugin domains the tool hosts. */
|
|
129
|
+
readonly pluginDomains?: readonly unknown[];
|
|
130
|
+
/** Later: declared host/peer requirements. */
|
|
131
|
+
readonly requires?: readonly unknown[];
|
|
132
|
+
/** Reserved: compatibility metadata (minApiVersion, languages, etc.). */
|
|
133
|
+
readonly compatibility?: unknown;
|
|
134
|
+
/** Reserved: distribution posture for community/catalog. */
|
|
135
|
+
readonly distribution?: 'private' | 'public-free' | 'public-paid' | unknown;
|
|
136
|
+
/** General bag for future extension metadata (publisher, pricing, etc.). */
|
|
137
|
+
readonly extensionMetadata?: unknown;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Structurally valid manifest front matter before compatibility admission.
|
|
141
|
+
* `apiVersion` is optional here only so the loader can represent and diagnose
|
|
142
|
+
* manifest-incompatible unversioned tools without pretending they are admitted.
|
|
143
|
+
*/
|
|
144
|
+
export interface RawToolPluginManifest extends ToolPluginManifestBase {
|
|
145
|
+
/** The plugin-API epoch this tool was compiled against, if declared. */
|
|
146
|
+
readonly apiVersion?: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A manifest that passed the compatibility gate and can seed runtime surfaces
|
|
150
|
+
* such as command mounting, provenance, and capability registration.
|
|
151
|
+
*/
|
|
152
|
+
export interface ToolPluginManifest extends ToolPluginManifestBase {
|
|
153
|
+
/** The plugin-API epoch this admitted tool was compiled against. */
|
|
154
|
+
readonly apiVersion: number;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The provenance record the host attaches when it admits a tool —
|
|
158
|
+
* source + identity + a hash of the manifest it read. Surfaced via
|
|
159
|
+
* structured logs on load and via `plugin list` (Phase 4).
|
|
160
|
+
*/
|
|
161
|
+
export interface ToolProvenance {
|
|
162
|
+
/** Where the tool came from. */
|
|
163
|
+
readonly source: ToolSource;
|
|
164
|
+
/** The tool's human/programmatic key (from the manifest). */
|
|
165
|
+
readonly id: string;
|
|
166
|
+
/** The tool's stable identity (real UUID) when declared (additive per ADR-0048). */
|
|
167
|
+
readonly stableId?: string;
|
|
168
|
+
/** The tool's display version (from the manifest). */
|
|
169
|
+
readonly version: string;
|
|
170
|
+
/** npm package name, when the tool is an installed/bundled package. */
|
|
171
|
+
readonly packageName?: string;
|
|
172
|
+
/** Filesystem path the manifest was resolved from, when applicable. */
|
|
173
|
+
readonly resolvedPath?: string;
|
|
174
|
+
/** Stable hash of the manifest bytes the host read — tamper/identity check. */
|
|
175
|
+
readonly manifestHash: string;
|
|
176
|
+
}
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AAEnF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,UAAU,sBAAsB;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAMlD;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAC7D,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5C,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAWvC,yEAAyE;IACzE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC;IAC5E,4EAA4E;IAC5E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;IACnE,wEAAwE;IACxE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB;IAChE,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Static tool-plugin manifest + the plugin-API epoch +
|
|
3
|
+
* provenance types (launch, raw-vs-admitted compatibility contract).
|
|
4
|
+
*
|
|
5
|
+
* The **manifest** is the static front matter the host reads *before*
|
|
6
|
+
* importing a tool's runtime `Tool` module (north-star §5.1). It is
|
|
7
|
+
* declared in `package.json#opensipTools` for bundled + installed tools
|
|
8
|
+
* (one read for both) and as a JSON sidecar for project-local tools.
|
|
9
|
+
*
|
|
10
|
+
* `PLUGIN_API_VERSION` is a coarse integer **epoch** for the plugin
|
|
11
|
+
* *input* contract. A tool declares the epoch it was compiled against
|
|
12
|
+
* via `RawToolPluginManifest.apiVersion`; the host's single
|
|
13
|
+
* `checkCompatibility()` gate (see `compatibility.ts`) admits or rejects
|
|
14
|
+
* on that integer alone — no semver range maths. Once admitted, the manifest is
|
|
15
|
+
* represented as `ToolPluginManifest`, whose `apiVersion` is required.
|
|
16
|
+
*
|
|
17
|
+
* The host consumes identity + command metadata and, as of ADR-0029, the
|
|
18
|
+
* concrete `capabilities` descriptor that declares owned capability domains.
|
|
19
|
+
* Remaining fields (`config`/`dashboard`/…) stay typed-but-not-consumed
|
|
20
|
+
* placeholders so a manifest authored today stays forward-shaped.
|
|
21
|
+
*
|
|
22
|
+
* These types live in **core** (next to the `Tool` contract). `contracts`
|
|
23
|
+
* re-exports them for the public surface; core cannot import contracts.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The plugin-API epoch the running engine implements.
|
|
27
|
+
*
|
|
28
|
+
* A coarse integer, bumped only on a breaking change to the plugin
|
|
29
|
+
* *input* contract. A tool manifest's `apiVersion` is compared against
|
|
30
|
+
* this single value by `checkCompatibility()`. A missing `apiVersion`
|
|
31
|
+
* is incompatible as of launch; raw manifests stay representable so the
|
|
32
|
+
* admission gate can diagnose unversioned inputs before rejecting them.
|
|
33
|
+
*/
|
|
34
|
+
export const PLUGIN_API_VERSION = 1;
|
|
35
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registry — in-memory list of registered Tool implementations.
|
|
3
|
+
*
|
|
4
|
+
* The CLI populates the registry at startup (first-party tools as
|
|
5
|
+
* direct imports, third-party tools via tool-package-discovery), then
|
|
6
|
+
* iterates `list()` to build its command tree.
|
|
7
|
+
*
|
|
8
|
+
* **Duplicate-id policy: first writer wins.** Re-registering the same
|
|
9
|
+
* id keeps the existing entry and emits a structured warning. This
|
|
10
|
+
* matches `LanguageRegistry`'s policy and prevents third-party plugins
|
|
11
|
+
* from accidentally clobbering first-party registrations.
|
|
12
|
+
*
|
|
13
|
+
* Implemented on top of the kernel's `Registry<T>` base. Tools don't
|
|
14
|
+
* naturally satisfy `Registerable` (no `name` field on metadata), so
|
|
15
|
+
* the registry wraps each Tool in a `{ id, name: id, tool }` envelope
|
|
16
|
+
* before storing it. `list()` / `get()` unwrap.
|
|
17
|
+
*/
|
|
18
|
+
import type { Tool } from './types.js';
|
|
19
|
+
/** Per-run registry of {@link Tool} plugins, indexed by the human name (metadata.name). */
|
|
20
|
+
export declare class ToolRegistry {
|
|
21
|
+
private readonly inner;
|
|
22
|
+
/**
|
|
23
|
+
* Register a tool. **First writer wins** — re-registering the same
|
|
24
|
+
* (human) id is a no-op and emits a `tool.registry.duplicate` warning.
|
|
25
|
+
*
|
|
26
|
+
* The registry is keyed by the human `metadata.name` (the former `id` value)
|
|
27
|
+
* for continuity with callers that do registry.get('fitness') etc. The stable
|
|
28
|
+
* UUID lives in metadata.id and is not used as the registry key.
|
|
29
|
+
*/
|
|
30
|
+
register(tool: Tool, opts?: {
|
|
31
|
+
sourcePackage?: string;
|
|
32
|
+
}): void;
|
|
33
|
+
list(): readonly Tool[];
|
|
34
|
+
get(id: string): Tool | undefined;
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQvC,2FAA2F;AAC3F,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IAEH;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,GAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI;IAKjE,IAAI,IAAI,SAAS,IAAI,EAAE;IAIvB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIjC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// @fitness-ignore-file batch-operation-limits -- getAll() over the registered tool set (a handful of first-party + plugin tools per CLI invocation)
|
|
2
|
+
/**
|
|
3
|
+
* Tool registry — in-memory list of registered Tool implementations.
|
|
4
|
+
*
|
|
5
|
+
* The CLI populates the registry at startup (first-party tools as
|
|
6
|
+
* direct imports, third-party tools via tool-package-discovery), then
|
|
7
|
+
* iterates `list()` to build its command tree.
|
|
8
|
+
*
|
|
9
|
+
* **Duplicate-id policy: first writer wins.** Re-registering the same
|
|
10
|
+
* id keeps the existing entry and emits a structured warning. This
|
|
11
|
+
* matches `LanguageRegistry`'s policy and prevents third-party plugins
|
|
12
|
+
* from accidentally clobbering first-party registrations.
|
|
13
|
+
*
|
|
14
|
+
* Implemented on top of the kernel's `Registry<T>` base. Tools don't
|
|
15
|
+
* naturally satisfy `Registerable` (no `name` field on metadata), so
|
|
16
|
+
* the registry wraps each Tool in a `{ id, name: id, tool }` envelope
|
|
17
|
+
* before storing it. `list()` / `get()` unwrap.
|
|
18
|
+
*/
|
|
19
|
+
import { Registry } from '../lib/registry.js';
|
|
20
|
+
/** Per-run registry of {@link Tool} plugins, indexed by the human name (metadata.name). */
|
|
21
|
+
export class ToolRegistry {
|
|
22
|
+
inner = new Registry({
|
|
23
|
+
module: 'core:tools',
|
|
24
|
+
duplicatePolicy: 'warn-first-wins',
|
|
25
|
+
evtPrefix: 'tool.registry',
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Register a tool. **First writer wins** — re-registering the same
|
|
29
|
+
* (human) id is a no-op and emits a `tool.registry.duplicate` warning.
|
|
30
|
+
*
|
|
31
|
+
* The registry is keyed by the human `metadata.name` (the former `id` value)
|
|
32
|
+
* for continuity with callers that do registry.get('fitness') etc. The stable
|
|
33
|
+
* UUID lives in metadata.id and is not used as the registry key.
|
|
34
|
+
*/
|
|
35
|
+
register(tool, opts = {}) {
|
|
36
|
+
const key = tool.metadata.name ?? tool.metadata.id;
|
|
37
|
+
this.inner.register({ id: key, name: key, tool }, { sourcePackage: opts.sourcePackage });
|
|
38
|
+
}
|
|
39
|
+
list() {
|
|
40
|
+
return this.inner.getAll().map((r) => r.tool);
|
|
41
|
+
}
|
|
42
|
+
get(id) {
|
|
43
|
+
return this.inner.getById(id)?.tool;
|
|
44
|
+
}
|
|
45
|
+
clear() {
|
|
46
|
+
this.inner.clear();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,oJAAoJ;AACpJ;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AAUjE,2FAA2F;AAC3F,MAAM,OAAO,YAAY;IACN,KAAK,GAAG,IAAI,QAAQ,CAAmB;QACtD,MAAM,EAAE,YAAY;QACpB,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAC;IAEH;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAU,EAAE,OAAmC,EAAE;QACxD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;IACtC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
|