@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 Shared npm-scope validation + resolution for scoped plugin
|
|
3
|
+
* auto-discovery (scenario packs, future package families).
|
|
4
|
+
*
|
|
5
|
+
* Discovery code maps a scope string to `node_modules/<scope>/` and
|
|
6
|
+
* scans for packages. Untrusted scope strings reach `path.join`, so we
|
|
7
|
+
* enforce strict npm-scope syntax before they're used as path
|
|
8
|
+
* segments. A stray `..` or `/` would otherwise scan the wrong
|
|
9
|
+
* directory.
|
|
10
|
+
*
|
|
11
|
+
* Hoisted into core so every scoped discovery surface enforces the
|
|
12
|
+
* same invariant. The `@opensip-cli/scenarios-*` discovery in sim
|
|
13
|
+
* flows through this helper.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* npm scope syntax: `@` followed by a kebab-case identifier. We anchor
|
|
17
|
+
* strictly because scope strings end up in `path.join('node_modules', scope)`
|
|
18
|
+
* — a stray `..` or `/` would scan the wrong directory.
|
|
19
|
+
*/
|
|
20
|
+
export declare const VALID_NPM_SCOPE_REGEX: RegExp;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the effective list of npm scopes to scan: the platform
|
|
23
|
+
* default is always included; customer additions are appended after
|
|
24
|
+
* deduplication and format validation. Invalid scope strings are
|
|
25
|
+
* dropped with a structured warning rather than throwing — consistent
|
|
26
|
+
* with how discovery handles unresolved explicit packages elsewhere.
|
|
27
|
+
*
|
|
28
|
+
* @param defaultScope The platform default (e.g. `@opensip-cli`)
|
|
29
|
+
* @param extraScopes Customer-configured additions
|
|
30
|
+
* @param evt Log event name to use when warning about invalid
|
|
31
|
+
* entries — lets each caller emit a domain-specific
|
|
32
|
+
* event name (`plugin.scenario_package.invalid_scope`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveScopes(defaultScope: string, extraScopes: readonly string[], evt: string): readonly string[];
|
|
35
|
+
//# sourceMappingURL=scope-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-validation.d.ts","sourceRoot":"","sources":["../../src/plugins/scope-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAA4B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,SAAS,MAAM,EAAE,CAkBnB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Shared npm-scope validation + resolution for scoped plugin
|
|
3
|
+
* auto-discovery (scenario packs, future package families).
|
|
4
|
+
*
|
|
5
|
+
* Discovery code maps a scope string to `node_modules/<scope>/` and
|
|
6
|
+
* scans for packages. Untrusted scope strings reach `path.join`, so we
|
|
7
|
+
* enforce strict npm-scope syntax before they're used as path
|
|
8
|
+
* segments. A stray `..` or `/` would otherwise scan the wrong
|
|
9
|
+
* directory.
|
|
10
|
+
*
|
|
11
|
+
* Hoisted into core so every scoped discovery surface enforces the
|
|
12
|
+
* same invariant. The `@opensip-cli/scenarios-*` discovery in sim
|
|
13
|
+
* flows through this helper.
|
|
14
|
+
*/
|
|
15
|
+
import { logger } from '../lib/logger.js';
|
|
16
|
+
/**
|
|
17
|
+
* npm scope syntax: `@` followed by a kebab-case identifier. We anchor
|
|
18
|
+
* strictly because scope strings end up in `path.join('node_modules', scope)`
|
|
19
|
+
* — a stray `..` or `/` would scan the wrong directory.
|
|
20
|
+
*/
|
|
21
|
+
export const VALID_NPM_SCOPE_REGEX = /^@[a-z0-9][a-z0-9._-]*$/;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the effective list of npm scopes to scan: the platform
|
|
24
|
+
* default is always included; customer additions are appended after
|
|
25
|
+
* deduplication and format validation. Invalid scope strings are
|
|
26
|
+
* dropped with a structured warning rather than throwing — consistent
|
|
27
|
+
* with how discovery handles unresolved explicit packages elsewhere.
|
|
28
|
+
*
|
|
29
|
+
* @param defaultScope The platform default (e.g. `@opensip-cli`)
|
|
30
|
+
* @param extraScopes Customer-configured additions
|
|
31
|
+
* @param evt Log event name to use when warning about invalid
|
|
32
|
+
* entries — lets each caller emit a domain-specific
|
|
33
|
+
* event name (`plugin.scenario_package.invalid_scope`).
|
|
34
|
+
*/
|
|
35
|
+
export function resolveScopes(defaultScope, extraScopes, evt) {
|
|
36
|
+
const out = [defaultScope];
|
|
37
|
+
const seen = new Set(out);
|
|
38
|
+
for (const scope of extraScopes) {
|
|
39
|
+
if (!VALID_NPM_SCOPE_REGEX.test(scope)) {
|
|
40
|
+
logger.warn({
|
|
41
|
+
evt,
|
|
42
|
+
module: 'core:plugins',
|
|
43
|
+
scope,
|
|
44
|
+
msg: `plugins.packageScopes entry "${scope}" is not a valid npm scope (expected "@kebab-case") — skipping`,
|
|
45
|
+
});
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (seen.has(scope))
|
|
49
|
+
continue;
|
|
50
|
+
seen.add(scope);
|
|
51
|
+
out.push(scope);
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=scope-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-validation.js","sourceRoot":"","sources":["../../src/plugins/scope-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,WAA8B,EAC9B,GAAW;IAEX,MAAM,GAAG,GAAa,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,GAAG,CAAC,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG;gBACH,MAAM,EAAE,cAAc;gBACtB,KAAK;gBACL,GAAG,EAAE,gCAAgC,KAAK,gEAAgE;aAC3G,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,SAAS;QAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Single-`@opensip-cli/core` guard for discovered packages.
|
|
3
|
+
*
|
|
4
|
+
* A capability pack (check pack, scenario pack, graph adapter) that resolves a
|
|
5
|
+
* DIFFERENT physical `@opensip-cli/core` than the running engine registers its
|
|
6
|
+
* contributions against a core whose `currentScope()` is always `undefined` here
|
|
7
|
+
* (a different `AsyncLocalStorage`). That silently degrades the run — the failure
|
|
8
|
+
* mode seen when a globally-installed CLI discovers packs in a project that
|
|
9
|
+
* vendors its own `@opensip-cli/*`. Such packs are refused at discovery time.
|
|
10
|
+
*
|
|
11
|
+
* Packs that don't depend on core at all resolve nothing and pass. The guard is
|
|
12
|
+
* tool-agnostic: the generic discovery substrate applies it to EVERY domain's
|
|
13
|
+
* packs, so the policy lives here once instead of in each tool's loader.
|
|
14
|
+
*/
|
|
15
|
+
/** The canonical `@opensip-cli/core` path this runtime resolves (for diagnostics). */
|
|
16
|
+
export declare function selfCore(): string | undefined;
|
|
17
|
+
/** The pack's resolved `@opensip-cli/core` if it differs from {@link selfCore}; else undefined. */
|
|
18
|
+
export declare function foreignCorePath(packageDir: string): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Keep only the packages that resolve THIS runtime's `@opensip-cli/core`
|
|
21
|
+
* (or none at all). `onForeign` is invoked for each dropped pack with the foreign
|
|
22
|
+
* core path it resolved, for a caller-shaped diagnostic.
|
|
23
|
+
*/
|
|
24
|
+
export declare function filterSameCorePackages<T extends {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly packageDir: string;
|
|
27
|
+
}>(packages: readonly T[], onForeign?: (pkg: T, foreignCore: string) => void): T[];
|
|
28
|
+
//# sourceMappingURL=single-core-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-core-guard.d.ts","sourceRoot":"","sources":["../../src/plugins/single-core-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAqBH,sFAAsF;AACtF,wBAAgB,QAAQ,IAAI,MAAM,GAAG,SAAS,CAE7C;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYtE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAChE,QAAQ,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,EAAE,CAQhF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Single-`@opensip-cli/core` guard for discovered packages.
|
|
3
|
+
*
|
|
4
|
+
* A capability pack (check pack, scenario pack, graph adapter) that resolves a
|
|
5
|
+
* DIFFERENT physical `@opensip-cli/core` than the running engine registers its
|
|
6
|
+
* contributions against a core whose `currentScope()` is always `undefined` here
|
|
7
|
+
* (a different `AsyncLocalStorage`). That silently degrades the run — the failure
|
|
8
|
+
* mode seen when a globally-installed CLI discovers packs in a project that
|
|
9
|
+
* vendors its own `@opensip-cli/*`. Such packs are refused at discovery time.
|
|
10
|
+
*
|
|
11
|
+
* Packs that don't depend on core at all resolve nothing and pass. The guard is
|
|
12
|
+
* tool-agnostic: the generic discovery substrate applies it to EVERY domain's
|
|
13
|
+
* packs, so the policy lives here once instead of in each tool's loader.
|
|
14
|
+
*/
|
|
15
|
+
import { createRequire } from 'node:module';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
/**
|
|
19
|
+
* The `@opensip-cli/core` THIS module resolves — the canonical core whose
|
|
20
|
+
* `runWithScope` populates `currentScope()`. Captured once. `undefined` disables
|
|
21
|
+
* the guard (fail-open; defensive only — core always resolves from itself).
|
|
22
|
+
*/
|
|
23
|
+
const selfCorePath = (() => {
|
|
24
|
+
try {
|
|
25
|
+
return createRequire(import.meta.url).resolve('@opensip-cli/core');
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
/* v8 ignore next 2 -- core resolves from itself; defensive only */
|
|
29
|
+
// @fitness-ignore-next-line error-handling-quality -- an unresolvable self-core disables the guard (fail-open), not an error.
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
/** The canonical `@opensip-cli/core` path this runtime resolves (for diagnostics). */
|
|
34
|
+
export function selfCore() {
|
|
35
|
+
return selfCorePath;
|
|
36
|
+
}
|
|
37
|
+
/** The pack's resolved `@opensip-cli/core` if it differs from {@link selfCore}; else undefined. */
|
|
38
|
+
export function foreignCorePath(packageDir) {
|
|
39
|
+
if (selfCorePath === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
try {
|
|
42
|
+
// The anchor file need not exist — createRequire only uses its directory as
|
|
43
|
+
// the resolution base, walking up node_modules from the pack.
|
|
44
|
+
const anchor = pathToFileURL(join(packageDir, 'noop.js')).href;
|
|
45
|
+
const packCore = createRequire(anchor).resolve('@opensip-cli/core');
|
|
46
|
+
return packCore === selfCorePath ? undefined : packCore;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// @fitness-ignore-next-line error-handling-quality -- resolution probe: a pack with no core dep throws here, and "no foreign core → allow" is the contract.
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Keep only the packages that resolve THIS runtime's `@opensip-cli/core`
|
|
55
|
+
* (or none at all). `onForeign` is invoked for each dropped pack with the foreign
|
|
56
|
+
* core path it resolved, for a caller-shaped diagnostic.
|
|
57
|
+
*/
|
|
58
|
+
export function filterSameCorePackages(packages, onForeign) {
|
|
59
|
+
if (selfCorePath === undefined)
|
|
60
|
+
return [...packages];
|
|
61
|
+
return packages.filter((pkg) => {
|
|
62
|
+
const foreign = foreignCorePath(pkg.packageDir);
|
|
63
|
+
if (foreign === undefined)
|
|
64
|
+
return true;
|
|
65
|
+
onForeign?.(pkg, foreign);
|
|
66
|
+
return false;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=single-core-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-core-guard.js","sourceRoot":"","sources":["../../src/plugins/single-core-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,YAAY,GAAuB,CAAC,GAAG,EAAE;IAC7C,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;QACnE,8HAA8H;QAC9H,OAAO;IACT,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL,sFAAsF;AACtF,MAAM,UAAU,QAAQ;IACtB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACjD,IAAI,CAAC;QACH,4EAA4E;QAC5E,8DAA8D;QAC9D,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACpE,OAAO,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,4JAA4J;QAC5J,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAEpC,QAAsB,EAAE,SAAiD;IACzE,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACrD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvC,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Thin domain-typed wrapper around the generic marker
|
|
3
|
+
* walker for `kind: "tool"`.
|
|
4
|
+
*
|
|
5
|
+
* A Tool plugin is any npm package (scoped or unscoped, first- or third-
|
|
6
|
+
* party) whose `package.json` declares:
|
|
7
|
+
*
|
|
8
|
+
* { "opensipTools": { "kind": "tool" } }
|
|
9
|
+
*
|
|
10
|
+
* The walker itself lives in `marker-discovery.ts` — this file preserves
|
|
11
|
+
* the public surface (`discoverToolPackages`, `DiscoveredToolPackage`)
|
|
12
|
+
* existing CLI consumers depend on, and delegates the actual node_modules
|
|
13
|
+
* traversal to the shared primitive.
|
|
14
|
+
*
|
|
15
|
+
* Direct dependencies of opensip-cli are always loaded by the
|
|
16
|
+
* CLI's own import statements; this discovery exists so a user can
|
|
17
|
+
* install a third-party tool via `npm install` and have it picked up
|
|
18
|
+
* with no further wiring.
|
|
19
|
+
*/
|
|
20
|
+
export interface ToolPackageDiscoveryOptions {
|
|
21
|
+
/** Absolute path to the project root. */
|
|
22
|
+
readonly projectDir: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DiscoveredToolPackage {
|
|
25
|
+
/** npm package name, e.g. '@opensip-cli/fitness' or '@my-co/audit'. */
|
|
26
|
+
readonly name: string;
|
|
27
|
+
/** Absolute path to the package's directory inside node_modules. */
|
|
28
|
+
readonly packageDir: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Walk up from `projectDir` looking for `node_modules/` directories
|
|
32
|
+
* containing packages with `opensipTools.kind === 'tool'`. Returns the
|
|
33
|
+
* deduplicated list (first-occurrence-wins by package name).
|
|
34
|
+
*/
|
|
35
|
+
export declare function discoverToolPackages(options: ToolPackageDiscoveryOptions): DiscoveredToolPackage[];
|
|
36
|
+
/**
|
|
37
|
+
* One discovery source for {@link discoverToolPackagesFromAnchors}.
|
|
38
|
+
*
|
|
39
|
+
* - `walkUp`: walk ancestor `node_modules` from `dir` (project trees, the
|
|
40
|
+
* CLI install dir — covers a plain `npm install @tool` and global CLI
|
|
41
|
+
* siblings).
|
|
42
|
+
* - `scanDir`: scan exactly `<dir>/node_modules`, no walk (the fixed
|
|
43
|
+
* plugin host dirs — `~/.opensip-cli/plugins/tool`,
|
|
44
|
+
* `<project>/.runtime/plugins/tool`).
|
|
45
|
+
*/
|
|
46
|
+
export interface ToolDiscoverySource {
|
|
47
|
+
readonly dir: string;
|
|
48
|
+
readonly mode: 'walkUp' | 'scanDir';
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Discover tool packages across an ORDERED list of sources, deduplicated
|
|
52
|
+
* by package name with first-occurrence-wins. Order encodes precedence:
|
|
53
|
+
* an earlier source's package shadows a later same-named one (e.g. a
|
|
54
|
+
* project-local pin shadows a user-global install). Mirrors the
|
|
55
|
+
* ToolRegistry's own first-writer-wins on duplicate ids.
|
|
56
|
+
*
|
|
57
|
+
* **Provenance contract.** Every anchor yields `source: 'installed'`
|
|
58
|
+
* provenance regardless of which anchor it came from — the anchor distinction
|
|
59
|
+
* encodes PRECEDENCE/SHADOWING, NOT source. So the caller
|
|
60
|
+
* (`admitInstalledTool` in `register-tools.ts`) assigns `source: 'installed'`
|
|
61
|
+
* UNIFORMLY; a per-anchor source tag here would add no information and is
|
|
62
|
+
* deliberately NOT threaded. *Authored* provenance (`project-local` /
|
|
63
|
+
* `user-global`) comes from the separate `discoverAuthoredToolSidecars` walk,
|
|
64
|
+
* keyed by its calling root — not from this npm-anchor walk.
|
|
65
|
+
*
|
|
66
|
+
* Scope flag: if a future release adds a third installed sub-source that needs
|
|
67
|
+
* distinct provenance, revisit whether the anchors walk should carry a source
|
|
68
|
+
* enum. Out of scope today.
|
|
69
|
+
*/
|
|
70
|
+
export declare function discoverToolPackagesFromAnchors(sources: readonly ToolDiscoverySource[]): DiscoveredToolPackage[];
|
|
71
|
+
/**
|
|
72
|
+
* Read `name` and the resolved main entry of a discovered tool package.
|
|
73
|
+
* Mirrors readCheckPackageMetadata in shape but is exposed at the kernel
|
|
74
|
+
* level so any consumer (CLI, tests, future tooling) can resolve a tool
|
|
75
|
+
* package without depending on fitness.
|
|
76
|
+
*/
|
|
77
|
+
export interface ToolPackageMetadata {
|
|
78
|
+
readonly name: string;
|
|
79
|
+
readonly mainEntry: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resolve a tool directory's runtime entry.
|
|
83
|
+
*
|
|
84
|
+
* An INSTALLED npm tool resolves via `package.json` (`exports['.']` → `main` →
|
|
85
|
+
* `./index.js`). An AUTHORED tool has no `package.json` — it declares identity
|
|
86
|
+
* via an `opensip-tool.manifest.json` sidecar, so when the package.json resolver
|
|
87
|
+
* finds nothing, fall back to the sidecar: its `main` field (or `./index.js`
|
|
88
|
+
* default), with the directory name as the package name. This keeps the two
|
|
89
|
+
* discovery surfaces symmetric — one entry resolver serves both the npm and
|
|
90
|
+
* authored legs.
|
|
91
|
+
*/
|
|
92
|
+
export declare function readToolPackageMetadata(packageDir: string): ToolPackageMetadata | undefined;
|
|
93
|
+
//# sourceMappingURL=tool-package-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-package-discovery.d.ts","sourceRoot":"","sources":["../../src/plugins/tool-package-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,qBAAqB,EAAE,CAKzB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,qBAAqB,EAAE,CAezB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAI3F"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Thin domain-typed wrapper around the generic marker
|
|
3
|
+
* walker for `kind: "tool"`.
|
|
4
|
+
*
|
|
5
|
+
* A Tool plugin is any npm package (scoped or unscoped, first- or third-
|
|
6
|
+
* party) whose `package.json` declares:
|
|
7
|
+
*
|
|
8
|
+
* { "opensipTools": { "kind": "tool" } }
|
|
9
|
+
*
|
|
10
|
+
* The walker itself lives in `marker-discovery.ts` — this file preserves
|
|
11
|
+
* the public surface (`discoverToolPackages`, `DiscoveredToolPackage`)
|
|
12
|
+
* existing CLI consumers depend on, and delegates the actual node_modules
|
|
13
|
+
* traversal to the shared primitive.
|
|
14
|
+
*
|
|
15
|
+
* Direct dependencies of opensip-cli are always loaded by the
|
|
16
|
+
* CLI's own import statements; this discovery exists so a user can
|
|
17
|
+
* install a third-party tool via `npm install` and have it picked up
|
|
18
|
+
* with no further wiring.
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
21
|
+
import { basename, join } from 'node:path';
|
|
22
|
+
import { isRecord } from './json-guards.js';
|
|
23
|
+
import { PROJECT_LOCAL_MANIFEST_FILE } from './manifest-loader.js';
|
|
24
|
+
import { discoverPackagesByMarker, discoverPackagesInNodeModules } from './marker-discovery.js';
|
|
25
|
+
import { resolvePackageEntryPoint } from './package-entry.js';
|
|
26
|
+
/**
|
|
27
|
+
* Walk up from `projectDir` looking for `node_modules/` directories
|
|
28
|
+
* containing packages with `opensipTools.kind === 'tool'`. Returns the
|
|
29
|
+
* deduplicated list (first-occurrence-wins by package name).
|
|
30
|
+
*/
|
|
31
|
+
export function discoverToolPackages(options) {
|
|
32
|
+
return discoverPackagesByMarker({ projectDir: options.projectDir, kind: 'tool' }).map((pkg) => ({
|
|
33
|
+
name: pkg.name,
|
|
34
|
+
packageDir: pkg.packageDir,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Discover tool packages across an ORDERED list of sources, deduplicated
|
|
39
|
+
* by package name with first-occurrence-wins. Order encodes precedence:
|
|
40
|
+
* an earlier source's package shadows a later same-named one (e.g. a
|
|
41
|
+
* project-local pin shadows a user-global install). Mirrors the
|
|
42
|
+
* ToolRegistry's own first-writer-wins on duplicate ids.
|
|
43
|
+
*
|
|
44
|
+
* **Provenance contract.** Every anchor yields `source: 'installed'`
|
|
45
|
+
* provenance regardless of which anchor it came from — the anchor distinction
|
|
46
|
+
* encodes PRECEDENCE/SHADOWING, NOT source. So the caller
|
|
47
|
+
* (`admitInstalledTool` in `register-tools.ts`) assigns `source: 'installed'`
|
|
48
|
+
* UNIFORMLY; a per-anchor source tag here would add no information and is
|
|
49
|
+
* deliberately NOT threaded. *Authored* provenance (`project-local` /
|
|
50
|
+
* `user-global`) comes from the separate `discoverAuthoredToolSidecars` walk,
|
|
51
|
+
* keyed by its calling root — not from this npm-anchor walk.
|
|
52
|
+
*
|
|
53
|
+
* Scope flag: if a future release adds a third installed sub-source that needs
|
|
54
|
+
* distinct provenance, revisit whether the anchors walk should carry a source
|
|
55
|
+
* enum. Out of scope today.
|
|
56
|
+
*/
|
|
57
|
+
export function discoverToolPackagesFromAnchors(sources) {
|
|
58
|
+
const seen = new Set();
|
|
59
|
+
const out = [];
|
|
60
|
+
for (const src of sources) {
|
|
61
|
+
const found = src.mode === 'walkUp'
|
|
62
|
+
? discoverPackagesByMarker({ projectDir: src.dir, kind: 'tool' })
|
|
63
|
+
: discoverPackagesInNodeModules(join(src.dir, 'node_modules'), 'tool');
|
|
64
|
+
for (const pkg of found) {
|
|
65
|
+
if (seen.has(pkg.name))
|
|
66
|
+
continue;
|
|
67
|
+
seen.add(pkg.name);
|
|
68
|
+
out.push({ name: pkg.name, packageDir: pkg.packageDir });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve a tool directory's runtime entry.
|
|
75
|
+
*
|
|
76
|
+
* An INSTALLED npm tool resolves via `package.json` (`exports['.']` → `main` →
|
|
77
|
+
* `./index.js`). An AUTHORED tool has no `package.json` — it declares identity
|
|
78
|
+
* via an `opensip-tool.manifest.json` sidecar, so when the package.json resolver
|
|
79
|
+
* finds nothing, fall back to the sidecar: its `main` field (or `./index.js`
|
|
80
|
+
* default), with the directory name as the package name. This keeps the two
|
|
81
|
+
* discovery surfaces symmetric — one entry resolver serves both the npm and
|
|
82
|
+
* authored legs.
|
|
83
|
+
*/
|
|
84
|
+
export function readToolPackageMetadata(packageDir) {
|
|
85
|
+
const resolved = resolvePackageEntryPoint(packageDir);
|
|
86
|
+
if (resolved)
|
|
87
|
+
return { name: resolved.name, mainEntry: resolved.entry };
|
|
88
|
+
return readAuthoredSidecarEntry(packageDir);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Resolve an authored tool's entry from its `opensip-tool.manifest.json`
|
|
92
|
+
* sidecar. Reads the sidecar's `main` (default `./index.js`) and `name`/`id`
|
|
93
|
+
* for the package name. Returns `undefined` when the sidecar is absent or
|
|
94
|
+
* unreadable (the caller treats that as "no resolvable entry").
|
|
95
|
+
*/
|
|
96
|
+
function readAuthoredSidecarEntry(dir) {
|
|
97
|
+
const sidecarPath = join(dir, PROJECT_LOCAL_MANIFEST_FILE);
|
|
98
|
+
if (!existsSync(sidecarPath))
|
|
99
|
+
return undefined;
|
|
100
|
+
let parsed;
|
|
101
|
+
try {
|
|
102
|
+
parsed = JSON.parse(readFileSync(sidecarPath, 'utf8'));
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// @fitness-ignore-next-line error-handling-quality -- malformed sidecar surfaces via undefined return; caller treats as "no resolvable entry" (mirrors resolvePackageEntryPoint's package.json contract).
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
if (!isRecord(parsed))
|
|
109
|
+
return undefined;
|
|
110
|
+
const rawMain = typeof parsed.main === 'string' && parsed.main.length > 0 ? parsed.main : './index.js';
|
|
111
|
+
// Name from the sidecar's name/id, falling back to the directory name (always
|
|
112
|
+
// present for a real authored-tool dir).
|
|
113
|
+
const name = (typeof parsed.name === 'string' && parsed.name) ||
|
|
114
|
+
(typeof parsed.id === 'string' && parsed.id) ||
|
|
115
|
+
basename(dir);
|
|
116
|
+
return { name, mainEntry: join(dir, rawMain) };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=tool-package-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-package-discovery.js","sourceRoot":"","sources":["../../src/plugins/tool-package-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAc9D;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAoC;IAEpC,OAAO,wBAAwB,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC9F,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,CAAC,CAAC,CAAC;AACN,CAAC;AAiBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,OAAuC;IAEvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,KAAK,GACT,GAAG,CAAC,IAAI,KAAK,QAAQ;YACnB,CAAC,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YACjE,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3E,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAS;YACjC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACnB,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAaD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACtD,IAAI,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxE,OAAO,wBAAwB,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,GAAW;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,0MAA0M;QAC1M,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,OAAO,GACX,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;IACzF,8EAA8E;IAC9E,yCAAyC;IACzC,MAAM,IAAI,GACR,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC;QAChD,CAAC,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5C,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Plugin contract types for opensip-cli
|
|
3
|
+
*
|
|
4
|
+
* Plugins can be npm packages or loose JS/MJS files.
|
|
5
|
+
*
|
|
6
|
+
* Tool-specific plugin export shapes (e.g. fitness's `FitPluginExports`,
|
|
7
|
+
* which references Check / FitnessRecipe types) live with the tool that
|
|
8
|
+
* owns them. This file holds the kernel-level types that any tool
|
|
9
|
+
* loader can use without dragging in tool-specific symbols.
|
|
10
|
+
*/
|
|
11
|
+
import type { LanguageAdapter } from '../languages/adapter.js';
|
|
12
|
+
/** What a language plugin package/file exports */
|
|
13
|
+
export interface LangPluginExports {
|
|
14
|
+
readonly adapters?: readonly LanguageAdapter[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Union of all plugin export shapes — kept open so tool-specific exports
|
|
18
|
+
* (e.g. fitness's FitPluginExports) can be assigned through structural
|
|
19
|
+
* compatibility. Each tool owns its own export-shape interface.
|
|
20
|
+
*/
|
|
21
|
+
export type PluginExports = LangPluginExports | Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Where a tool's project-local plugins live. Supplied by the tool (via
|
|
24
|
+
* its `Tool.pluginLayout` descriptor) and threaded into `discoverPlugins`
|
|
25
|
+
* / `loadAllPlugins`. The kernel never enumerates tool domains itself —
|
|
26
|
+
* this descriptor is the seam that keeps core tool-agnostic
|
|
27
|
+
* (ADR-0009 corollary 1 / M2).
|
|
28
|
+
*/
|
|
29
|
+
export interface PluginLayout {
|
|
30
|
+
/**
|
|
31
|
+
* Path/domain segment. User loose-file plugins live under
|
|
32
|
+
* `<project>/opensip-cli/<domain>/<kind>/` and npm plugins under
|
|
33
|
+
* `<project>/opensip-cli/.runtime/plugins/<domain>/`. Also the key
|
|
34
|
+
* read from `opensip-cli.config.yml#plugins.<domain>`.
|
|
35
|
+
*/
|
|
36
|
+
readonly domain: string;
|
|
37
|
+
/**
|
|
38
|
+
* User-source subdirectories walked for loose `.mjs`/`.js` plugins —
|
|
39
|
+
* e.g. `['checks', 'recipes']` for fitness, `['scenarios', 'recipes']`
|
|
40
|
+
* for simulation. Empty means no loose-file layout (npm plugins only).
|
|
41
|
+
*/
|
|
42
|
+
readonly userSubdirs: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/** Discovered plugin before loading */
|
|
45
|
+
export interface DiscoveredPlugin {
|
|
46
|
+
readonly type: 'package' | 'file';
|
|
47
|
+
/** Absolute path to the entry point */
|
|
48
|
+
readonly entryPoint: string;
|
|
49
|
+
/** Namespace derived from package name or filename */
|
|
50
|
+
readonly namespace: string;
|
|
51
|
+
/** Package name (for npm packages) or filename (for loose files) */
|
|
52
|
+
readonly source: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Result of loading a single plugin. `registered` is a generic count
|
|
56
|
+
* map keyed by whatever artifact kinds the tool's `registerExports`
|
|
57
|
+
* callback reports (e.g. `{ checks: 3, recipes: 1 }`, `{ scenarios: 2 }`,
|
|
58
|
+
* `{ adapters: 1 }`). The kernel carries no tool-specific counter names
|
|
59
|
+
* (ADR-0009 M2) — it only sums the map.
|
|
60
|
+
*/
|
|
61
|
+
export interface LoadedPlugin {
|
|
62
|
+
readonly namespace: string;
|
|
63
|
+
readonly source: string;
|
|
64
|
+
readonly type: 'package' | 'file';
|
|
65
|
+
/** Per-kind registration counts reported by the domain callback. */
|
|
66
|
+
readonly registered: Readonly<Record<string, number>>;
|
|
67
|
+
readonly error?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Result of loading all plugins for a layout. `totals` is the
|
|
71
|
+
* per-kind sum across every loaded plugin's `registered` map.
|
|
72
|
+
*/
|
|
73
|
+
export interface PluginLoadResult {
|
|
74
|
+
readonly plugins: readonly LoadedPlugin[];
|
|
75
|
+
readonly totals: Readonly<Record<string, number>>;
|
|
76
|
+
readonly errors: readonly string[];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMxE;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Plugin contract types for opensip-cli
|
|
3
|
+
*
|
|
4
|
+
* Plugins can be npm packages or loose JS/MJS files.
|
|
5
|
+
*
|
|
6
|
+
* Tool-specific plugin export shapes (e.g. fitness's `FitPluginExports`,
|
|
7
|
+
* which references Check / FitnessRecipe types) live with the tool that
|
|
8
|
+
* owns them. This file holds the kernel-level types that any tool
|
|
9
|
+
* loader can use without dragging in tool-specific symbols.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
// Note: there is deliberately NO `PluginDomain` type. A plugin domain is a
|
|
13
|
+
// plain `string` segment (see `PluginLayout.domain`); the kernel does not
|
|
14
|
+
// enumerate — nor even name — the first-party domains (ADR-0009 corollary 1).
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;AAwFH,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../src/recipes/__tests__/registry.test.ts"],"names":[],"mappings":""}
|