@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,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Language-agnostic scanner primitives for source-stripping
|
|
3
|
+
* lexers — the lower half of the strip toolkit.
|
|
4
|
+
*
|
|
5
|
+
* Every `packages/languages/lang-*` strip.ts composes these primitives into a
|
|
6
|
+
* language-specific `scan`, which `makeStripper` (in `strip-utils.ts`) turns
|
|
7
|
+
* into the `{ stripStrings, stripComments }` pair. Each scanner recognizes one
|
|
8
|
+
* lexical shape (regular string, line/block comment, char literal) and emits
|
|
9
|
+
* the half-open `Region`s to replace; `applyRegions` overlays them with spaces
|
|
10
|
+
* while preserving line/column offsets.
|
|
11
|
+
*
|
|
12
|
+
* Split out of `strip-utils.ts` so neither file exceeds the file-length limit;
|
|
13
|
+
* `strip-utils.ts` re-exports everything here, so consumers still import these
|
|
14
|
+
* from `@opensip-cli/core` (or `strip-utils.js`) unchanged.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Scan a regular double-quoted string starting at `openQuotePos`
|
|
18
|
+
* (which must reference the opening `"`). Returns the position of the
|
|
19
|
+
* closing quote and the resume index. Honors backslash escapes (`\"`,
|
|
20
|
+
* `\\`, `\n`, etc. by simply advancing 2). By default, stops at
|
|
21
|
+
* unescaped newlines (Java/Go/C++ semantics); pass
|
|
22
|
+
* `{ allowMultiline: true }` for Rust-style strings that may span
|
|
23
|
+
* lines.
|
|
24
|
+
*
|
|
25
|
+
* If the string is unterminated (no closing quote before newline or
|
|
26
|
+
* EOF), returns the unterminated position rather than throwing —
|
|
27
|
+
* callers decide how to handle that case.
|
|
28
|
+
*/
|
|
29
|
+
export function scanRegularString(src, openQuotePos, options = {}) {
|
|
30
|
+
const allowMultiline = options.allowMultiline ?? false;
|
|
31
|
+
const len = src.length;
|
|
32
|
+
let i = openQuotePos + 1;
|
|
33
|
+
while (i < len) {
|
|
34
|
+
const ch = src[i];
|
|
35
|
+
if (ch === '\\') {
|
|
36
|
+
// Skip escape sequence — at minimum 2 chars (\n, \", etc.)
|
|
37
|
+
i += 2;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (ch === '"') {
|
|
41
|
+
return { contentEnd: i, next: i + 1 };
|
|
42
|
+
}
|
|
43
|
+
if (ch === '\n' && !allowMultiline) {
|
|
44
|
+
// Unterminated regular string — language-specific scanners must
|
|
45
|
+
// decide how to recover; we stop here so we don't consume the
|
|
46
|
+
// rest of the file.
|
|
47
|
+
return { contentEnd: i, next: i };
|
|
48
|
+
}
|
|
49
|
+
i++;
|
|
50
|
+
}
|
|
51
|
+
// Unterminated — return EOF position.
|
|
52
|
+
return { contentEnd: len, next: len };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Scan a `//` line comment starting at `start` (which must reference
|
|
56
|
+
* the first `/` of the opener). Returns the index of the next `\n`
|
|
57
|
+
* (or EOF) — i.e. where the outer scanner resumes. The returned index
|
|
58
|
+
* does not include the `\n` itself.
|
|
59
|
+
*
|
|
60
|
+
* Pass `{ allowLineContinuation: true }` for C/C++-style line splices:
|
|
61
|
+
* a `\<newline>` continues the comment onto the next physical line
|
|
62
|
+
* (per C/C++ phase-2 translation). Defaults to `false`; Java and Go
|
|
63
|
+
* comments have no such behavior.
|
|
64
|
+
*
|
|
65
|
+
* Used by lang-cpp (with `allowLineContinuation: true`), lang-java,
|
|
66
|
+
* lang-go, lang-rust.
|
|
67
|
+
*/
|
|
68
|
+
export function scanLineComment(src, start, options = {}) {
|
|
69
|
+
const allowLineContinuation = options.allowLineContinuation ?? false;
|
|
70
|
+
const len = src.length;
|
|
71
|
+
const bodyStart = start + 2; // skip the opening //
|
|
72
|
+
let i = bodyStart;
|
|
73
|
+
while (i < len) {
|
|
74
|
+
if (src[i] === '\n') {
|
|
75
|
+
if (allowLineContinuation && hasUnescapedTrailingBackslash(src, bodyStart, i)) {
|
|
76
|
+
// Line splice — continue onto the next physical line.
|
|
77
|
+
i++;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
i++;
|
|
83
|
+
}
|
|
84
|
+
return { end: i };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns true when the position immediately before `newlinePos` is an
|
|
88
|
+
* unescaped backslash — i.e. the count of consecutive backslashes ending
|
|
89
|
+
* at `newlinePos - 1` is odd. The C/C++ phase-2 translation rule treats
|
|
90
|
+
* a single trailing backslash as a line splice, but `\\<newline>` is an
|
|
91
|
+
* escaped backslash with no splice. A single-character lookback at
|
|
92
|
+
* `src[i - 1] === '\\'` cannot tell the two apart and would consume the
|
|
93
|
+
* next physical line as part of the comment incorrectly.
|
|
94
|
+
*
|
|
95
|
+
* `bodyStart` bounds the back-walk so we do not count backslashes from
|
|
96
|
+
* before the `//` opener.
|
|
97
|
+
*/
|
|
98
|
+
function hasUnescapedTrailingBackslash(src, bodyStart, newlinePos) {
|
|
99
|
+
let count = 0;
|
|
100
|
+
let k = newlinePos - 1;
|
|
101
|
+
while (k >= bodyStart && src[k] === '\\') {
|
|
102
|
+
count++;
|
|
103
|
+
k--;
|
|
104
|
+
}
|
|
105
|
+
return count % 2 === 1;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Scan a non-nesting block comment starting at `start` (which must
|
|
109
|
+
* reference the opening slash). Returns the index just past the
|
|
110
|
+
* closing delimiter — i.e. where the outer scanner resumes. If the
|
|
111
|
+
* comment is unterminated, returns the EOF position.
|
|
112
|
+
*
|
|
113
|
+
* Used by lang-cpp, lang-java, lang-go.
|
|
114
|
+
*/
|
|
115
|
+
export function scanBlockCommentNonNesting(src, start) {
|
|
116
|
+
const len = src.length;
|
|
117
|
+
let i = start + 2; // skip the opening delimiter
|
|
118
|
+
while (i < len) {
|
|
119
|
+
if (src[i] === '*' && src[i + 1] === '/') {
|
|
120
|
+
i += 2;
|
|
121
|
+
return { end: i };
|
|
122
|
+
}
|
|
123
|
+
i++;
|
|
124
|
+
}
|
|
125
|
+
// Unterminated — record up to EOF.
|
|
126
|
+
return { end: len };
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Scan a Rust-style nested block comment starting at `start` (which
|
|
130
|
+
* must reference the opening slash). Each nested opener increments
|
|
131
|
+
* the depth counter; each closer decrements it. The scan returns when
|
|
132
|
+
* the depth hits zero (balanced) or when EOF is reached (unterminated
|
|
133
|
+
* — `depth > 0`).
|
|
134
|
+
*
|
|
135
|
+
* Used by lang-rust.
|
|
136
|
+
*/
|
|
137
|
+
export function scanBlockCommentNesting(src, start) {
|
|
138
|
+
const len = src.length;
|
|
139
|
+
let i = start + 2; // skip the opening delimiter
|
|
140
|
+
let depth = 1;
|
|
141
|
+
while (i < len && depth > 0) {
|
|
142
|
+
if (src[i] === '/' && src[i + 1] === '*') {
|
|
143
|
+
depth++;
|
|
144
|
+
i += 2;
|
|
145
|
+
}
|
|
146
|
+
else if (src[i] === '*' && src[i + 1] === '/') {
|
|
147
|
+
depth--;
|
|
148
|
+
i += 2;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
i++;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { end: i, depth };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Scan a char literal starting at `start` (which must reference the
|
|
158
|
+
* opening apostrophe). Returns the index just past the literal — or,
|
|
159
|
+
* if the literal does not close within the scan bound, the index
|
|
160
|
+
* immediately after the opening apostrophe (the apostrophe is treated
|
|
161
|
+
* as code rather than committing the consumed run).
|
|
162
|
+
*
|
|
163
|
+
* Branch ordering is load-bearing: the escape-sequence advance MUST
|
|
164
|
+
* run before the close-quote check so escaped-apostrophe char
|
|
165
|
+
* literals do not terminate at the second apostrophe. See lang-java
|
|
166
|
+
* F6.
|
|
167
|
+
*
|
|
168
|
+
* Used by lang-cpp, lang-java (with prefix-stripping at the call
|
|
169
|
+
* site), lang-rust (with the lifetime-vs-literal heuristic at the
|
|
170
|
+
* call site).
|
|
171
|
+
*/
|
|
172
|
+
export function scanCharLiteral(src, start, options = {}) {
|
|
173
|
+
const maxScan = options.maxScan ?? 8;
|
|
174
|
+
const len = src.length;
|
|
175
|
+
const cap = Math.min(start + maxScan, len);
|
|
176
|
+
let j = start + 1;
|
|
177
|
+
let escape = false;
|
|
178
|
+
let closed = false;
|
|
179
|
+
while (j < cap) {
|
|
180
|
+
const ch = src[j];
|
|
181
|
+
// Branch order is load-bearing: escape MUST be checked before the
|
|
182
|
+
// close-quote so escaped-apostrophe is not mis-terminated.
|
|
183
|
+
if (escape) {
|
|
184
|
+
escape = false;
|
|
185
|
+
j++;
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (ch === '\\') {
|
|
189
|
+
escape = true;
|
|
190
|
+
j++;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (ch === "'") {
|
|
194
|
+
j++;
|
|
195
|
+
closed = true;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
if (ch === '\n') {
|
|
199
|
+
// Unterminated — bail at the newline.
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
j++;
|
|
203
|
+
}
|
|
204
|
+
if (closed) {
|
|
205
|
+
return { end: j };
|
|
206
|
+
}
|
|
207
|
+
// Overflow / unterminated — treat the apostrophe as code rather
|
|
208
|
+
// than committing the consumed run. The caller advances past the
|
|
209
|
+
// opening apostrophe alone.
|
|
210
|
+
return { end: start + 1 };
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Replace each region with spaces, preserving newlines and overall
|
|
214
|
+
* length. Indexes into `src` and out remain identical, so any
|
|
215
|
+
* line/column derived from the original string is still valid.
|
|
216
|
+
*
|
|
217
|
+
* The `Region[]` is treated as readonly; callers may pass either
|
|
218
|
+
* regions from a comment scan or regions from a string scan (or both).
|
|
219
|
+
*/
|
|
220
|
+
export function applyRegions(src, regions) {
|
|
221
|
+
if (regions.length === 0)
|
|
222
|
+
return src;
|
|
223
|
+
// eslint-disable-next-line unicorn/prefer-spread -- split('') keeps UTF-16 unit indexing; spread/Array.from use code points and break offsets
|
|
224
|
+
const buf = src.split('');
|
|
225
|
+
for (const r of regions) {
|
|
226
|
+
for (let i = r.start; i < r.end; i++) {
|
|
227
|
+
if (buf[i] !== '\n')
|
|
228
|
+
buf[i] = ' ';
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return buf.join('');
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=strip-scanners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-scanners.js","sourceRoot":"","sources":["../../src/languages/strip-scanners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2BH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAW,EACX,YAAoB,EACpB,UAAoC,EAAE;IAEtC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,IAAI,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC;IACzB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;QACf,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAClB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;YAChB,2DAA2D;YAC3D,CAAC,IAAI,CAAC,CAAC;YACP,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACxC,CAAC;QACD,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACnC,gEAAgE;YAChE,8DAA8D;YAC9D,oBAAoB;YACpB,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACpC,CAAC;QACD,CAAC,EAAE,CAAC;IACN,CAAC;IACD,sCAAsC;IACtC,OAAO,EA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,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACrC,8IAA8I;IAC9I,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC1B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI;gBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Cross-language helpers for source-stripping lexers.
|
|
3
|
+
*
|
|
4
|
+
* Every language adapter under packages/languages/lang-* has a strip.ts
|
|
5
|
+
* that recognizes that language's strings + comments and replaces them
|
|
6
|
+
* with whitespace (preserving line/column offsets so checks can report
|
|
7
|
+
* accurate positions). The *lexer* part is language-specific (different
|
|
8
|
+
* string-prefix rules, different comment syntax, raw/text-block
|
|
9
|
+
* variations) — but several pieces of glue are byte-identical across
|
|
10
|
+
* every pack. Those split across two files:
|
|
11
|
+
*
|
|
12
|
+
* - The low-level scanner primitives (`Region`, `scanRegularString`,
|
|
13
|
+
* `scanLineComment`, `scanBlockCommentNonNesting`,
|
|
14
|
+
* `scanBlockCommentNesting`, `scanCharLiteral`, `applyRegions`) live in
|
|
15
|
+
* `strip-scanners.ts` and are re-exported here for a single import site.
|
|
16
|
+
* - This file owns the assembly seam: `ScanResult` (the
|
|
17
|
+
* scanner→mechanics contract), `Stripper`, and `makeStripper` — the
|
|
18
|
+
* template method that turns a language-specific `scan` into the
|
|
19
|
+
* byte-identical `{ stripStrings, stripComments }` pair — plus the
|
|
20
|
+
* parse-layer utilities `buildLineStarts` and `isIdentChar`.
|
|
21
|
+
*
|
|
22
|
+
* These helpers live in core because:
|
|
23
|
+
* (a) they are language-agnostic by construction — no string-prefix
|
|
24
|
+
* table, no comment syntax, no language-specific assumptions;
|
|
25
|
+
* (b) the layered architecture (CLAUDE.md) forbids peer language
|
|
26
|
+
* adapters from importing each other, but every adapter can
|
|
27
|
+
* depend on core, which is upstream of the entire peer tier;
|
|
28
|
+
* (c) the same helpers are likely to be needed by future language
|
|
29
|
+
* adapters (Ruby, PHP, Swift, etc.) — extracting now removes a
|
|
30
|
+
* pasted-in-every-pack drag on future contribution.
|
|
31
|
+
*/
|
|
32
|
+
import { type Region } from './strip-scanners.js';
|
|
33
|
+
export * from './strip-scanners.js';
|
|
34
|
+
/** Scanner→mechanics contract: a source's string + comment regions (the old per-pack `interface Scan`). */
|
|
35
|
+
export interface ScanResult {
|
|
36
|
+
readonly stringRegions: Region[];
|
|
37
|
+
readonly commentRegions: Region[];
|
|
38
|
+
}
|
|
39
|
+
/** The `{ stripStrings, stripComments }` pair `makeStripper` returns. */
|
|
40
|
+
export interface Stripper {
|
|
41
|
+
readonly stripStrings: (content: string) => string;
|
|
42
|
+
readonly stripComments: (content: string) => string;
|
|
43
|
+
}
|
|
44
|
+
/** Bind a language-specific `scan` to the shared strip mechanics (see file header). */
|
|
45
|
+
export declare function makeStripper(scan: (src: string) => ScanResult): Stripper;
|
|
46
|
+
/**
|
|
47
|
+
* Precompute the starting offset of each line in `src` (0-indexed).
|
|
48
|
+
* The returned array `L` has `L[0] === 0` and `L[i]` is the offset of
|
|
49
|
+
* the character immediately after the `i`th newline. Used by every
|
|
50
|
+
* line/column resolver in the parse layer.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildLineStarts(src: string): readonly number[];
|
|
53
|
+
/**
|
|
54
|
+
* Identifier-character predicate over the C-identifier char class:
|
|
55
|
+
* ASCII letters (`A-Z`, `a-z`), ASCII digits (`0-9`), and `_`. Returns
|
|
56
|
+
* `false` for `undefined`/empty input.
|
|
57
|
+
*
|
|
58
|
+
* Used by the C-family strip lexers' prefix-anchor guards: if the
|
|
59
|
+
* character before a candidate string/char-literal prefix is an
|
|
60
|
+
* identifier character, the candidate is actually the middle/end of an
|
|
61
|
+
* identifier (e.g. `abcL"foo"` — the `L` is not a wide-string prefix
|
|
62
|
+
* here), so the prefix matchers must reject. Shared across lang-cpp and
|
|
63
|
+
* lang-python (which both anchor prefixes on identifier boundaries).
|
|
64
|
+
*/
|
|
65
|
+
export declare function isIdentChar(ch: string | undefined): boolean;
|
|
66
|
+
//# sourceMappingURL=strip-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-utils.d.ts","sourceRoot":"","sources":["../../src/languages/strip-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAIhE,cAAc,qBAAqB,CAAC;AAEpC,2GAA2G;AAC3G,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,yEAAyE;AACzE,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CACrD;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,GAAG,QAAQ,CAWxE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAU9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAS3D"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Cross-language helpers for source-stripping lexers.
|
|
3
|
+
*
|
|
4
|
+
* Every language adapter under packages/languages/lang-* has a strip.ts
|
|
5
|
+
* that recognizes that language's strings + comments and replaces them
|
|
6
|
+
* with whitespace (preserving line/column offsets so checks can report
|
|
7
|
+
* accurate positions). The *lexer* part is language-specific (different
|
|
8
|
+
* string-prefix rules, different comment syntax, raw/text-block
|
|
9
|
+
* variations) — but several pieces of glue are byte-identical across
|
|
10
|
+
* every pack. Those split across two files:
|
|
11
|
+
*
|
|
12
|
+
* - The low-level scanner primitives (`Region`, `scanRegularString`,
|
|
13
|
+
* `scanLineComment`, `scanBlockCommentNonNesting`,
|
|
14
|
+
* `scanBlockCommentNesting`, `scanCharLiteral`, `applyRegions`) live in
|
|
15
|
+
* `strip-scanners.ts` and are re-exported here for a single import site.
|
|
16
|
+
* - This file owns the assembly seam: `ScanResult` (the
|
|
17
|
+
* scanner→mechanics contract), `Stripper`, and `makeStripper` — the
|
|
18
|
+
* template method that turns a language-specific `scan` into the
|
|
19
|
+
* byte-identical `{ stripStrings, stripComments }` pair — plus the
|
|
20
|
+
* parse-layer utilities `buildLineStarts` and `isIdentChar`.
|
|
21
|
+
*
|
|
22
|
+
* These helpers live in core because:
|
|
23
|
+
* (a) they are language-agnostic by construction — no string-prefix
|
|
24
|
+
* table, no comment syntax, no language-specific assumptions;
|
|
25
|
+
* (b) the layered architecture (CLAUDE.md) forbids peer language
|
|
26
|
+
* adapters from importing each other, but every adapter can
|
|
27
|
+
* depend on core, which is upstream of the entire peer tier;
|
|
28
|
+
* (c) the same helpers are likely to be needed by future language
|
|
29
|
+
* adapters (Ruby, PHP, Swift, etc.) — extracting now removes a
|
|
30
|
+
* pasted-in-every-pack drag on future contribution.
|
|
31
|
+
*/
|
|
32
|
+
import { applyRegions } from './strip-scanners.js';
|
|
33
|
+
// Re-export the scanner primitives so consumers keep a single import site
|
|
34
|
+
// (`strip-utils.js` / the core barrel) regardless of which file defines them.
|
|
35
|
+
export * from './strip-scanners.js';
|
|
36
|
+
/** Bind a language-specific `scan` to the shared strip mechanics (see file header). */
|
|
37
|
+
export function makeStripper(scan) {
|
|
38
|
+
return {
|
|
39
|
+
stripStrings(content) {
|
|
40
|
+
const { stringRegions } = scan(content);
|
|
41
|
+
return applyRegions(content, stringRegions);
|
|
42
|
+
},
|
|
43
|
+
stripComments(content) {
|
|
44
|
+
const { stringRegions, commentRegions } = scan(content);
|
|
45
|
+
return applyRegions(content, [...stringRegions, ...commentRegions]);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Precompute the starting offset of each line in `src` (0-indexed).
|
|
51
|
+
* The returned array `L` has `L[0] === 0` and `L[i]` is the offset of
|
|
52
|
+
* the character immediately after the `i`th newline. Used by every
|
|
53
|
+
* line/column resolver in the parse layer.
|
|
54
|
+
*/
|
|
55
|
+
export function buildLineStarts(src) {
|
|
56
|
+
const starts = [0];
|
|
57
|
+
// Index loop: we need the UTF-16 code unit offset (i + 1) for line starts.
|
|
58
|
+
// [...src] / `for-of` would split by code points and break offsets for
|
|
59
|
+
// surrogate pairs (any source containing emoji, astral characters, etc.).
|
|
60
|
+
// eslint-disable-next-line unicorn/no-for-loop -- offset-bearing scan, not pure iteration
|
|
61
|
+
for (let i = 0; i < src.length; i++) {
|
|
62
|
+
if (src[i] === '\n')
|
|
63
|
+
starts.push(i + 1);
|
|
64
|
+
}
|
|
65
|
+
return starts;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Identifier-character predicate over the C-identifier char class:
|
|
69
|
+
* ASCII letters (`A-Z`, `a-z`), ASCII digits (`0-9`), and `_`. Returns
|
|
70
|
+
* `false` for `undefined`/empty input.
|
|
71
|
+
*
|
|
72
|
+
* Used by the C-family strip lexers' prefix-anchor guards: if the
|
|
73
|
+
* character before a candidate string/char-literal prefix is an
|
|
74
|
+
* identifier character, the candidate is actually the middle/end of an
|
|
75
|
+
* identifier (e.g. `abcL"foo"` — the `L` is not a wide-string prefix
|
|
76
|
+
* here), so the prefix matchers must reject. Shared across lang-cpp and
|
|
77
|
+
* lang-python (which both anchor prefixes on identifier boundaries).
|
|
78
|
+
*/
|
|
79
|
+
export function isIdentChar(ch) {
|
|
80
|
+
if (!ch)
|
|
81
|
+
return false;
|
|
82
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
83
|
+
return ((code >= 0x41 && code <= 0x5a) ||
|
|
84
|
+
(code >= 0x61 && code <= 0x7a) ||
|
|
85
|
+
(code >= 0x30 && code <= 0x39) ||
|
|
86
|
+
ch === '_');
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=strip-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-utils.js","sourceRoot":"","sources":["../../src/languages/strip-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAe,MAAM,qBAAqB,CAAC;AAEhE,0EAA0E;AAC1E,8EAA8E;AAC9E,cAAc,qBAAqB,CAAC;AAcpC,uFAAuF;AACvF,MAAM,UAAU,YAAY,CAAC,IAAiC;IAC5D,OAAO;QACL,YAAY,CAAC,OAAe;YAC1B,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC9C,CAAC;QACD,aAAa,CAAC,OAAe;YAC3B,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;YACxD,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,aAAa,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC;QACtE,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,MAAM,GAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,2EAA2E;IAC3E,uEAAuE;IACvE,0EAA0E;IAC1E,0FAA0F;IAC1F,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,EAAsB;IAChD,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IACtB,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,CACL,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;QAC9B,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;QAC9B,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;QAC9B,EAAE,KAAK,GAAG,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Minimal text-tree shape shared by MVP language adapters.
|
|
3
|
+
*
|
|
4
|
+
* Several first-party language adapters (lang-go, lang-java, lang-rust,
|
|
5
|
+
* lang-python) ship without a real AST parser today — tree-sitter
|
|
6
|
+
* integration is deferred. Their `parse()` implementations all return
|
|
7
|
+
* the same triple: source text + file path + a precomputed line-starts
|
|
8
|
+
* index. The triple is the minimum surface text-pattern checks need to
|
|
9
|
+
* report (line, column) coordinates.
|
|
10
|
+
*
|
|
11
|
+
* `MinimalTextTree` is the shared shape; `buildMinimalTextTree(content,
|
|
12
|
+
* filePath)` is the factory each MVP adapter delegates to. Each pack
|
|
13
|
+
* still keeps its own typed `XTree` interface (e.g. `GoTree`, `JavaTree`,
|
|
14
|
+
* `RustTree`) so adapter generic parameters stay distinct — those are
|
|
15
|
+
* thin brand aliases over `MinimalTextTree`.
|
|
16
|
+
*
|
|
17
|
+
* When a pack grows a real tree-sitter parser, it replaces its `parse()`
|
|
18
|
+
* body and the typed `XTree` shape; the brand alias bridges the
|
|
19
|
+
* transition.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Minimum source-tree shape every text-pattern check expects. Adapters
|
|
23
|
+
* branding their own typed alias over this can grow it later.
|
|
24
|
+
*/
|
|
25
|
+
export interface MinimalTextTree {
|
|
26
|
+
/** The original source text the tree was built from. */
|
|
27
|
+
readonly source: string;
|
|
28
|
+
/** The file path that produced the source — used in diagnostics. */
|
|
29
|
+
readonly filePath: string;
|
|
30
|
+
/**
|
|
31
|
+
* Precomputed line-start byte offsets. `lineStarts[0] === 0`, and
|
|
32
|
+
* `lineStarts[i]` is the offset of the character immediately after
|
|
33
|
+
* the `i`th newline. Used to translate byte offsets into (line,
|
|
34
|
+
* column) coordinates in `O(log n)` per lookup.
|
|
35
|
+
*/
|
|
36
|
+
readonly lineStarts: readonly number[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build a `MinimalTextTree` for a source string. Used by MVP language
|
|
40
|
+
* adapters whose `parse()` returns the source text and a line index
|
|
41
|
+
* rather than a full AST.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildMinimalTextTree(content: string, filePath: string): MinimalTextTree;
|
|
44
|
+
//# sourceMappingURL=text-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-tree.d.ts","sourceRoot":"","sources":["../../src/languages/text-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAMvF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Minimal text-tree shape shared by MVP language adapters.
|
|
3
|
+
*
|
|
4
|
+
* Several first-party language adapters (lang-go, lang-java, lang-rust,
|
|
5
|
+
* lang-python) ship without a real AST parser today — tree-sitter
|
|
6
|
+
* integration is deferred. Their `parse()` implementations all return
|
|
7
|
+
* the same triple: source text + file path + a precomputed line-starts
|
|
8
|
+
* index. The triple is the minimum surface text-pattern checks need to
|
|
9
|
+
* report (line, column) coordinates.
|
|
10
|
+
*
|
|
11
|
+
* `MinimalTextTree` is the shared shape; `buildMinimalTextTree(content,
|
|
12
|
+
* filePath)` is the factory each MVP adapter delegates to. Each pack
|
|
13
|
+
* still keeps its own typed `XTree` interface (e.g. `GoTree`, `JavaTree`,
|
|
14
|
+
* `RustTree`) so adapter generic parameters stay distinct — those are
|
|
15
|
+
* thin brand aliases over `MinimalTextTree`.
|
|
16
|
+
*
|
|
17
|
+
* When a pack grows a real tree-sitter parser, it replaces its `parse()`
|
|
18
|
+
* body and the typed `XTree` shape; the brand alias bridges the
|
|
19
|
+
* transition.
|
|
20
|
+
*/
|
|
21
|
+
import { buildLineStarts } from './strip-utils.js';
|
|
22
|
+
/**
|
|
23
|
+
* Build a `MinimalTextTree` for a source string. Used by MVP language
|
|
24
|
+
* adapters whose `parse()` returns the source text and a line index
|
|
25
|
+
* rather than a full AST.
|
|
26
|
+
*/
|
|
27
|
+
export function buildMinimalTextTree(content, filePath) {
|
|
28
|
+
return {
|
|
29
|
+
source: content,
|
|
30
|
+
filePath,
|
|
31
|
+
lineStarts: buildLineStarts(content),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=text-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-tree.js","sourceRoot":"","sources":["../../src/languages/text-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAoBnD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,QAAgB;IACpE,OAAO;QACL,MAAM,EAAE,OAAO;QACf,QAAQ;QACR,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A unit of fan-out for `--workspace` mode. Each language adapter that
|
|
3
|
+
* implements `discoverWorkspaceUnits` returns these — one per package,
|
|
4
|
+
* Cargo workspace member, Python sub-project, etc.
|
|
5
|
+
*
|
|
6
|
+
* Shape is intentionally minimal: identity (`id`), where to anchor the
|
|
7
|
+
* child run (`rootDir`), and the marker file the adapter used to find
|
|
8
|
+
* it (`configPath`) for adapters that have one.
|
|
9
|
+
*/
|
|
10
|
+
export interface WorkspaceUnit {
|
|
11
|
+
/** Stable, human-readable id (e.g. `@opensip-cli/core`, `crate-foo`). */
|
|
12
|
+
readonly id: string;
|
|
13
|
+
/** Absolute path to the unit's root directory. */
|
|
14
|
+
readonly rootDir: string;
|
|
15
|
+
/** Adapter-specific marker file (tsconfig.json, Cargo.toml, etc.), if any. */
|
|
16
|
+
readonly configPath?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=workspace-unit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-unit.d.ts","sourceRoot":"","sources":["../../src/languages/workspace-unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-unit.js","sourceRoot":"","sources":["../../src/languages/workspace-unit.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unit tests for `readConfigSchemaVersion` + `checkSchemaCompat`.
|
|
3
|
+
*
|
|
4
|
+
* Reader must be PERMISSIVE: every "couldn't determine" case (missing
|
|
5
|
+
* file, malformed YAML, missing field, non-integer, < 1) treated as v1.
|
|
6
|
+
*
|
|
7
|
+
* Classifier must produce the THREE distinct outcomes (ok/older/cli-too-old)
|
|
8
|
+
* with the correct direction — `cli-too-old` for config newer than CLI
|
|
9
|
+
* (user upgrades CLI), `older` for config older than CLI (future migrate).
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=config-version.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-version.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/config-version.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Unit tests for `readConfigSchemaVersion` + `checkSchemaCompat`.
|
|
3
|
+
*
|
|
4
|
+
* Reader must be PERMISSIVE: every "couldn't determine" case (missing
|
|
5
|
+
* file, malformed YAML, missing field, non-integer, < 1) treated as v1.
|
|
6
|
+
*
|
|
7
|
+
* Classifier must produce the THREE distinct outcomes (ok/older/cli-too-old)
|
|
8
|
+
* with the correct direction — `cli-too-old` for config newer than CLI
|
|
9
|
+
* (user upgrades CLI), `older` for config older than CLI (future migrate).
|
|
10
|
+
*/
|
|
11
|
+
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
12
|
+
import { tmpdir } from 'node:os';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
15
|
+
import { CLI_SUPPORTED_SCHEMA_VERSION, checkSchemaCompat, readConfigSchemaVersion, } from '../config-version.js';
|
|
16
|
+
let testDir;
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
testDir = mkdtempSync(join(tmpdir(), 'opensip-config-version-'));
|
|
19
|
+
});
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
rmSync(testDir, { recursive: true, force: true });
|
|
22
|
+
});
|
|
23
|
+
describe('readConfigSchemaVersion (permissive)', () => {
|
|
24
|
+
it('returns 1 when the file does not exist', () => {
|
|
25
|
+
expect(readConfigSchemaVersion(join(testDir, 'nope.yml'))).toBe(1);
|
|
26
|
+
});
|
|
27
|
+
it('returns 1 when the YAML is malformed', () => {
|
|
28
|
+
const p = join(testDir, 'bad.yml');
|
|
29
|
+
writeFileSync(p, ':\n:\n!!{not yaml}', 'utf8');
|
|
30
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
31
|
+
});
|
|
32
|
+
it('returns 1 when the YAML root is not an object', () => {
|
|
33
|
+
const p = join(testDir, 'array.yml');
|
|
34
|
+
writeFileSync(p, '- one\n- two\n', 'utf8');
|
|
35
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
36
|
+
});
|
|
37
|
+
it('returns 1 when the field is absent', () => {
|
|
38
|
+
const p = join(testDir, 'no-field.yml');
|
|
39
|
+
writeFileSync(p, 'targets: {}\n', 'utf8');
|
|
40
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
41
|
+
});
|
|
42
|
+
it('returns 1 when the field is a string (non-integer)', () => {
|
|
43
|
+
const p = join(testDir, 'string.yml');
|
|
44
|
+
writeFileSync(p, 'schemaVersion: "1"\n', 'utf8');
|
|
45
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
46
|
+
});
|
|
47
|
+
it('returns 1 when the field is a float (non-integer)', () => {
|
|
48
|
+
const p = join(testDir, 'float.yml');
|
|
49
|
+
writeFileSync(p, 'schemaVersion: 1.5\n', 'utf8');
|
|
50
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
51
|
+
});
|
|
52
|
+
it('returns 1 when the field is < 1', () => {
|
|
53
|
+
const p = join(testDir, 'zero.yml');
|
|
54
|
+
writeFileSync(p, 'schemaVersion: 0\n', 'utf8');
|
|
55
|
+
expect(readConfigSchemaVersion(p)).toBe(1);
|
|
56
|
+
});
|
|
57
|
+
it('returns the field when valid', () => {
|
|
58
|
+
const p1 = join(testDir, 'v1.yml');
|
|
59
|
+
writeFileSync(p1, 'schemaVersion: 1\n', 'utf8');
|
|
60
|
+
expect(readConfigSchemaVersion(p1)).toBe(1);
|
|
61
|
+
const p2 = join(testDir, 'v2.yml');
|
|
62
|
+
writeFileSync(p2, 'schemaVersion: 2\n', 'utf8');
|
|
63
|
+
expect(readConfigSchemaVersion(p2)).toBe(2);
|
|
64
|
+
const p99 = join(testDir, 'v99.yml');
|
|
65
|
+
writeFileSync(p99, 'schemaVersion: 99\n', 'utf8');
|
|
66
|
+
expect(readConfigSchemaVersion(p99)).toBe(99);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('checkSchemaCompat (direction-correct)', () => {
|
|
70
|
+
it('matches → ok', () => {
|
|
71
|
+
const r = checkSchemaCompat(CLI_SUPPORTED_SCHEMA_VERSION);
|
|
72
|
+
expect(r.kind).toBe('ok');
|
|
73
|
+
expect(r.configVersion).toBe(CLI_SUPPORTED_SCHEMA_VERSION);
|
|
74
|
+
});
|
|
75
|
+
it('config newer than CLI → cli-too-old (USER UPGRADES CLI, not migrate)', () => {
|
|
76
|
+
const r = checkSchemaCompat(99);
|
|
77
|
+
expect(r.kind).toBe('cli-too-old');
|
|
78
|
+
if (r.kind === 'cli-too-old') {
|
|
79
|
+
expect(r.configVersion).toBe(99);
|
|
80
|
+
expect(r.cliVersion).toBe(CLI_SUPPORTED_SCHEMA_VERSION);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
it('config older than CLI → older (defensive; future migrate)', () => {
|
|
84
|
+
const r = checkSchemaCompat(0);
|
|
85
|
+
expect(r.kind).toBe('older');
|
|
86
|
+
if (r.kind === 'older') {
|
|
87
|
+
expect(r.configVersion).toBe(0);
|
|
88
|
+
expect(r.cliVersion).toBe(CLI_SUPPORTED_SCHEMA_VERSION);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=config-version.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-version.test.js","sourceRoot":"","sources":["../../../src/lib/__tests__/config-version.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,IAAI,OAAe,CAAC;AAEpB,UAAU,CAAC,GAAG,EAAE;IACd,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,GAAG,EAAE;IACb,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAA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C,CAAC;QAC7B,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACvB,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticsBus — event ordering, timestamp stamping, counters, JSON-safety, and
|
|
3
|
+
* the empty-run snapshot. The OTEL trace bridge is `undefined` here (no SDK
|
|
4
|
+
* registered in the test process), which is the standalone-run contract.
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=diagnostics-bus.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-bus.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/diagnostics-bus.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|