@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 @@
|
|
|
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AE,CAAC;QAC7B,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Language-aware parse cache — scope-owned helpers.
|
|
3
|
+
*
|
|
4
|
+
* The `LanguageParseCache` class definition lives in `parse-cache-class.ts`
|
|
5
|
+
* so `RunScope` (which holds a `LanguageParseCache` field) and this module
|
|
6
|
+
* (which reads `currentScope()`) don't form an import cycle.
|
|
7
|
+
*
|
|
8
|
+
* The `initParseCache` / `clearParseCache` / `getParseTree` helpers operate on
|
|
9
|
+
* the CURRENT RunScope's `parseCache` (`currentScope().parseCache`), NOT a
|
|
10
|
+
* module-level singleton. This is the scope-isolation fix (audit F2): two
|
|
11
|
+
* concurrent fit runs (different scopes) carry independent parse caches, and no
|
|
12
|
+
* process-global cache leaks state between runs or survives a run's teardown.
|
|
13
|
+
* Outside a `RunScope`, `initParseCache`/`clearParseCache` are no-ops and
|
|
14
|
+
* `getParseTree` falls back to a direct, uncached parse (single-check mode).
|
|
15
|
+
*
|
|
16
|
+
* The `LanguageParseCache` class is still exported for `RunScope` (which
|
|
17
|
+
* constructs the per-run instance) and for tests/tools that want an isolated
|
|
18
|
+
* cache.
|
|
19
|
+
*/
|
|
20
|
+
import type { LanguageAdapter } from './adapter.js';
|
|
21
|
+
export { LanguageParseCache } from './parse-cache-class.js';
|
|
22
|
+
/**
|
|
23
|
+
* Called by FitnessRecipeService before check execution. Clears any stale
|
|
24
|
+
* entries on the current scope's parse cache and arms its auto-clear timer.
|
|
25
|
+
* No-op outside a RunScope.
|
|
26
|
+
*/
|
|
27
|
+
export declare function initParseCache(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Called by FitnessRecipeService after check execution completes. Clears the
|
|
30
|
+
* current scope's parse cache and stops its auto-clear timer. No-op outside a
|
|
31
|
+
* RunScope — the scope itself disposes its cache on teardown.
|
|
32
|
+
*/
|
|
33
|
+
export declare function clearParseCache(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get or parse the file under the given adapter, using the CURRENT scope's
|
|
36
|
+
* parse cache. Falls back to a direct (uncached) parse when there is no active
|
|
37
|
+
* scope (single-check mode).
|
|
38
|
+
*
|
|
39
|
+
* Generic over TTree so call sites that already know the language (e.g.
|
|
40
|
+
* lang-typescript callers passing the TS adapter) get back ts.SourceFile
|
|
41
|
+
* rather than unknown.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getParseTree<TTree>(adapter: LanguageAdapter<TTree>, filePath: string, content: string): TTree | null;
|
|
44
|
+
/**
|
|
45
|
+
* Convenience: resolve the adapter for the file via the current scope's
|
|
46
|
+
* language registry, then parse. Returns null when no adapter is
|
|
47
|
+
* registered for the extension. Throws when called outside runWithScope —
|
|
48
|
+
* engine work must run inside a RunScope so adapters resolve via
|
|
49
|
+
* cli.scope.languages.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} When called outside a `runWithScope(...)` block (no current scope).
|
|
52
|
+
*/
|
|
53
|
+
export declare function getParseTreeForFile(filePath: string, content: string): unknown;
|
|
54
|
+
//# sourceMappingURL=parse-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-cache.d.ts","sourceRoot":"","sources":["../../src/languages/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAM5D;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAChC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,KAAK,GAAG,IAAI,CAMd;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAkB9E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Language-aware parse cache — scope-owned helpers.
|
|
3
|
+
*
|
|
4
|
+
* The `LanguageParseCache` class definition lives in `parse-cache-class.ts`
|
|
5
|
+
* so `RunScope` (which holds a `LanguageParseCache` field) and this module
|
|
6
|
+
* (which reads `currentScope()`) don't form an import cycle.
|
|
7
|
+
*
|
|
8
|
+
* The `initParseCache` / `clearParseCache` / `getParseTree` helpers operate on
|
|
9
|
+
* the CURRENT RunScope's `parseCache` (`currentScope().parseCache`), NOT a
|
|
10
|
+
* module-level singleton. This is the scope-isolation fix (audit F2): two
|
|
11
|
+
* concurrent fit runs (different scopes) carry independent parse caches, and no
|
|
12
|
+
* process-global cache leaks state between runs or survives a run's teardown.
|
|
13
|
+
* Outside a `RunScope`, `initParseCache`/`clearParseCache` are no-ops and
|
|
14
|
+
* `getParseTree` falls back to a direct, uncached parse (single-check mode).
|
|
15
|
+
*
|
|
16
|
+
* The `LanguageParseCache` class is still exported for `RunScope` (which
|
|
17
|
+
* constructs the per-run instance) and for tests/tools that want an isolated
|
|
18
|
+
* cache.
|
|
19
|
+
*/
|
|
20
|
+
import { logger } from '../lib/logger.js';
|
|
21
|
+
import { currentScope } from '../lib/run-scope.js';
|
|
22
|
+
export { LanguageParseCache } from './parse-cache-class.js';
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// SCOPE-OWNED PARSE-CACHE HELPERS
|
|
25
|
+
// =============================================================================
|
|
26
|
+
/**
|
|
27
|
+
* Called by FitnessRecipeService before check execution. Clears any stale
|
|
28
|
+
* entries on the current scope's parse cache and arms its auto-clear timer.
|
|
29
|
+
* No-op outside a RunScope.
|
|
30
|
+
*/
|
|
31
|
+
export function initParseCache() {
|
|
32
|
+
const cache = currentScope()?.parseCache;
|
|
33
|
+
if (!cache)
|
|
34
|
+
return;
|
|
35
|
+
cache.clear();
|
|
36
|
+
cache.startAutoClear();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Called by FitnessRecipeService after check execution completes. Clears the
|
|
40
|
+
* current scope's parse cache and stops its auto-clear timer. No-op outside a
|
|
41
|
+
* RunScope — the scope itself disposes its cache on teardown.
|
|
42
|
+
*/
|
|
43
|
+
export function clearParseCache() {
|
|
44
|
+
currentScope()?.parseCache.dispose();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get or parse the file under the given adapter, using the CURRENT scope's
|
|
48
|
+
* parse cache. Falls back to a direct (uncached) parse when there is no active
|
|
49
|
+
* scope (single-check mode).
|
|
50
|
+
*
|
|
51
|
+
* Generic over TTree so call sites that already know the language (e.g.
|
|
52
|
+
* lang-typescript callers passing the TS adapter) get back ts.SourceFile
|
|
53
|
+
* rather than unknown.
|
|
54
|
+
*/
|
|
55
|
+
export function getParseTree(adapter, filePath, content) {
|
|
56
|
+
const cache = currentScope()?.parseCache;
|
|
57
|
+
if (cache) {
|
|
58
|
+
return cache.getOrParse(adapter, filePath, content);
|
|
59
|
+
}
|
|
60
|
+
return adapter.parse(content, filePath);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Convenience: resolve the adapter for the file via the current scope's
|
|
64
|
+
* language registry, then parse. Returns null when no adapter is
|
|
65
|
+
* registered for the extension. Throws when called outside runWithScope —
|
|
66
|
+
* engine work must run inside a RunScope so adapters resolve via
|
|
67
|
+
* cli.scope.languages.
|
|
68
|
+
*
|
|
69
|
+
* @throws {Error} When called outside a `runWithScope(...)` block (no current scope).
|
|
70
|
+
*/
|
|
71
|
+
export function getParseTreeForFile(filePath, content) {
|
|
72
|
+
const scope = currentScope();
|
|
73
|
+
if (!scope) {
|
|
74
|
+
throw new Error('getParseTreeForFile() called outside runWithScope. ' +
|
|
75
|
+
'Engine work must run inside a RunScope so language adapters resolve via cli.scope.languages.');
|
|
76
|
+
}
|
|
77
|
+
const adapter = scope.languages.forFile(filePath);
|
|
78
|
+
if (!adapter) {
|
|
79
|
+
logger.debug({
|
|
80
|
+
evt: 'lang.parse.no-adapter',
|
|
81
|
+
module: 'core:languages',
|
|
82
|
+
filePath,
|
|
83
|
+
});
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return getParseTree(adapter, filePath, content);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=parse-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-cache.js","sourceRoot":"","sources":["../../src/languages/parse-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,gFAAgF;AAChF,kCAAkC;AAClC,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,YAAY,EAAE,EAAE,UAAU,CAAC;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,KAAK,CAAC,cAAc,EAAE,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,YAAY,EAAE,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC1B,OAA+B,EAC/B,QAAgB,EAChB,OAAe;IAEf,MAAM,KAAK,GAAG,YAAY,EAAE,EAAE,UAAU,CAAC;IACzC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,OAAe;IACnE,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,qDAAqD;YACnD,8FAA8F,CACjG,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC;YACX,GAAG,EAAE,uBAAuB;YAC5B,MAAM,EAAE,gBAAgB;YACxB,QAAQ;SACT,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LanguageAdapter } from './adapter.js';
|
|
2
|
+
/** Per-run registry of language adapters, indexed by id and file extension. */
|
|
3
|
+
export declare class LanguageRegistry {
|
|
4
|
+
private readonly inner;
|
|
5
|
+
private readonly byExtension;
|
|
6
|
+
/**
|
|
7
|
+
* Alias → canonical id index. Populated alongside the inner registry
|
|
8
|
+
* during `register`. Lets `canonicalize` map an alias like `'c'` or
|
|
9
|
+
* `'rs'` back to the registered adapter id (`'cpp'`, `'rust'`).
|
|
10
|
+
*/
|
|
11
|
+
private readonly aliasIndex;
|
|
12
|
+
register(adapter: LanguageAdapter): void;
|
|
13
|
+
private indexExtensions;
|
|
14
|
+
private indexAliases;
|
|
15
|
+
get(id: string): LanguageAdapter | undefined;
|
|
16
|
+
forFile(filePath: string): LanguageAdapter | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a language id or alias to its canonical adapter id.
|
|
19
|
+
*
|
|
20
|
+
* - For a registered canonical id (e.g. `'cpp'`), returns the same id.
|
|
21
|
+
* - For a registered alias (e.g. `'c'`, `'rs'`, `'golang'`, `'py'`),
|
|
22
|
+
* returns the canonical id (`'cpp'`, `'rust'`, `'go'`, `'python'`).
|
|
23
|
+
* - Returns `undefined` for unknown languages.
|
|
24
|
+
*
|
|
25
|
+
* Use this anywhere two pieces of code compare language strings —
|
|
26
|
+
* scope-matching, target-language sets — so a config written with
|
|
27
|
+
* `languages: ['c']` matches a check scoped to `cpp`.
|
|
28
|
+
*/
|
|
29
|
+
canonicalize(idOrAlias: string): string | undefined;
|
|
30
|
+
list(): readonly LanguageAdapter[];
|
|
31
|
+
has(id: string): boolean;
|
|
32
|
+
get size(): number;
|
|
33
|
+
clear(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/languages/registry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoBpD,+EAA+E;AAC/E,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAInB;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IAExD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAUxC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,YAAY;IAkCpB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI5C,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAMtD;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMnD,IAAI,IAAI,SAAS,eAAe,EAAE;IAIlC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// @fitness-ignore-file batch-operation-limits -- iterates bounded collections (registered language adapters and the small file-extension lookup map)
|
|
2
|
+
import { extname } from 'node:path';
|
|
3
|
+
import { logger } from '../lib/logger.js';
|
|
4
|
+
import { Registry } from '../lib/registry.js';
|
|
5
|
+
/** Per-run registry of language adapters, indexed by id and file extension. */
|
|
6
|
+
export class LanguageRegistry {
|
|
7
|
+
inner = new Registry({
|
|
8
|
+
module: 'core:languages',
|
|
9
|
+
duplicatePolicy: 'warn-first-wins',
|
|
10
|
+
evtPrefix: 'lang.registry',
|
|
11
|
+
});
|
|
12
|
+
byExtension = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Alias → canonical id index. Populated alongside the inner registry
|
|
15
|
+
* during `register`. Lets `canonicalize` map an alias like `'c'` or
|
|
16
|
+
* `'rs'` back to the registered adapter id (`'cpp'`, `'rust'`).
|
|
17
|
+
*/
|
|
18
|
+
aliasIndex = new Map();
|
|
19
|
+
register(adapter) {
|
|
20
|
+
const isDuplicate = this.inner.getById(adapter.id) !== undefined;
|
|
21
|
+
// Inner registry emits the structured warn event on duplicate;
|
|
22
|
+
// it returns silently after the warn (warn-first-wins policy).
|
|
23
|
+
this.inner.register({ id: adapter.id, name: adapter.id, adapter });
|
|
24
|
+
if (isDuplicate)
|
|
25
|
+
return;
|
|
26
|
+
this.indexExtensions(adapter);
|
|
27
|
+
this.indexAliases(adapter);
|
|
28
|
+
}
|
|
29
|
+
indexExtensions(adapter) {
|
|
30
|
+
for (const ext of adapter.fileExtensions) {
|
|
31
|
+
const normalized = ext.toLowerCase();
|
|
32
|
+
const existing = this.byExtension.get(normalized);
|
|
33
|
+
if (existing && existing.id !== adapter.id) {
|
|
34
|
+
logger.warn({
|
|
35
|
+
evt: 'lang.registry.extension.collision',
|
|
36
|
+
module: 'core:languages',
|
|
37
|
+
extension: normalized,
|
|
38
|
+
incumbent: existing.id,
|
|
39
|
+
challenger: adapter.id,
|
|
40
|
+
msg: `Extension ${normalized} already claimed by ${existing.id} — keeping incumbent`,
|
|
41
|
+
});
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
this.byExtension.set(normalized, adapter);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
indexAliases(adapter) {
|
|
48
|
+
if (!adapter.aliases)
|
|
49
|
+
return;
|
|
50
|
+
for (const alias of adapter.aliases) {
|
|
51
|
+
const normalized = alias.toLowerCase();
|
|
52
|
+
// An alias that collides with another adapter's canonical id is
|
|
53
|
+
// ignored — the canonical id always wins. Same for an alias
|
|
54
|
+
// already claimed by a previously-registered adapter.
|
|
55
|
+
if (this.inner.getById(normalized) && normalized !== adapter.id) {
|
|
56
|
+
logger.warn({
|
|
57
|
+
evt: 'lang.registry.alias.collision',
|
|
58
|
+
module: 'core:languages',
|
|
59
|
+
alias: normalized,
|
|
60
|
+
incumbent: normalized,
|
|
61
|
+
challenger: adapter.id,
|
|
62
|
+
msg: `Alias ${normalized} already used as a canonical id — ignoring on ${adapter.id}`,
|
|
63
|
+
});
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const existing = this.aliasIndex.get(normalized);
|
|
67
|
+
if (existing && existing !== adapter.id) {
|
|
68
|
+
logger.warn({
|
|
69
|
+
evt: 'lang.registry.alias.collision',
|
|
70
|
+
module: 'core:languages',
|
|
71
|
+
alias: normalized,
|
|
72
|
+
incumbent: existing,
|
|
73
|
+
challenger: adapter.id,
|
|
74
|
+
msg: `Alias ${normalized} already claimed by ${existing} — keeping incumbent`,
|
|
75
|
+
});
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
this.aliasIndex.set(normalized, adapter.id);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
get(id) {
|
|
82
|
+
return this.inner.getById(id)?.adapter;
|
|
83
|
+
}
|
|
84
|
+
forFile(filePath) {
|
|
85
|
+
const ext = extname(filePath).toLowerCase();
|
|
86
|
+
if (!ext)
|
|
87
|
+
return undefined;
|
|
88
|
+
return this.byExtension.get(ext);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Resolve a language id or alias to its canonical adapter id.
|
|
92
|
+
*
|
|
93
|
+
* - For a registered canonical id (e.g. `'cpp'`), returns the same id.
|
|
94
|
+
* - For a registered alias (e.g. `'c'`, `'rs'`, `'golang'`, `'py'`),
|
|
95
|
+
* returns the canonical id (`'cpp'`, `'rust'`, `'go'`, `'python'`).
|
|
96
|
+
* - Returns `undefined` for unknown languages.
|
|
97
|
+
*
|
|
98
|
+
* Use this anywhere two pieces of code compare language strings —
|
|
99
|
+
* scope-matching, target-language sets — so a config written with
|
|
100
|
+
* `languages: ['c']` matches a check scoped to `cpp`.
|
|
101
|
+
*/
|
|
102
|
+
canonicalize(idOrAlias) {
|
|
103
|
+
const normalized = idOrAlias.toLowerCase();
|
|
104
|
+
if (this.inner.getById(normalized))
|
|
105
|
+
return normalized;
|
|
106
|
+
return this.aliasIndex.get(normalized);
|
|
107
|
+
}
|
|
108
|
+
list() {
|
|
109
|
+
return this.inner.getAll().map((r) => r.adapter);
|
|
110
|
+
}
|
|
111
|
+
has(id) {
|
|
112
|
+
return this.inner.getById(id) !== undefined;
|
|
113
|
+
}
|
|
114
|
+
get size() {
|
|
115
|
+
return this.inner.size;
|
|
116
|
+
}
|
|
117
|
+
clear() {
|
|
118
|
+
this.inner.clear();
|
|
119
|
+
this.byExtension.clear();
|
|
120
|
+
this.aliasIndex.clear();
|
|
121
|
+
}
|
|
122
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,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;IAC9C,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,170 @@
|
|
|
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
|
+
/** Half-open region `[start, end)` for region-overlay strippers. */
|
|
17
|
+
export interface Region {
|
|
18
|
+
readonly start: number;
|
|
19
|
+
readonly end: number;
|
|
20
|
+
}
|
|
21
|
+
/** Result of `scanRegularString`. */
|
|
22
|
+
export interface RegStrResult {
|
|
23
|
+
/** Index of the closing `"` (or EOF / newline position for unterminated). */
|
|
24
|
+
readonly contentEnd: number;
|
|
25
|
+
/** Index after the closing quote — where the outer scanner resumes. */
|
|
26
|
+
readonly next: number;
|
|
27
|
+
}
|
|
28
|
+
/** Options for `scanRegularString`. */
|
|
29
|
+
export interface ScanRegularStringOptions {
|
|
30
|
+
/**
|
|
31
|
+
* When `true`, `\n` is treated as part of the body — the scanner
|
|
32
|
+
* traverses newlines and only stops at the closing quote or EOF.
|
|
33
|
+
* Used by Rust regular strings (which can span multiple lines).
|
|
34
|
+
* Defaults to `false` (matches Java/Go/C++ semantics).
|
|
35
|
+
*/
|
|
36
|
+
readonly allowMultiline?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Scan a regular double-quoted string starting at `openQuotePos`
|
|
40
|
+
* (which must reference the opening `"`). Returns the position of the
|
|
41
|
+
* closing quote and the resume index. Honors backslash escapes (`\"`,
|
|
42
|
+
* `\\`, `\n`, etc. by simply advancing 2). By default, stops at
|
|
43
|
+
* unescaped newlines (Java/Go/C++ semantics); pass
|
|
44
|
+
* `{ allowMultiline: true }` for Rust-style strings that may span
|
|
45
|
+
* lines.
|
|
46
|
+
*
|
|
47
|
+
* If the string is unterminated (no closing quote before newline or
|
|
48
|
+
* EOF), returns the unterminated position rather than throwing —
|
|
49
|
+
* callers decide how to handle that case.
|
|
50
|
+
*/
|
|
51
|
+
export declare function scanRegularString(src: string, openQuotePos: number, options?: ScanRegularStringOptions): RegStrResult;
|
|
52
|
+
/** Result of `scanLineComment` and `scanBlockCommentNonNesting`. */
|
|
53
|
+
export interface ScanCommentResult {
|
|
54
|
+
/**
|
|
55
|
+
* Index just past the end of the comment region (i.e. the position
|
|
56
|
+
* where the outer scanner resumes). For line comments without line
|
|
57
|
+
* continuation this is the position of the terminating newline (or
|
|
58
|
+
* EOF); for block comments this is the position immediately after
|
|
59
|
+
* the closing delimiter.
|
|
60
|
+
*/
|
|
61
|
+
readonly end: number;
|
|
62
|
+
}
|
|
63
|
+
/** Options for `scanLineComment`. */
|
|
64
|
+
export interface ScanLineCommentOptions {
|
|
65
|
+
/**
|
|
66
|
+
* When `true`, a `\<newline>` (backslash immediately before a
|
|
67
|
+
* newline) is a phase-2 line splice — the comment continues onto
|
|
68
|
+
* the next physical line. Used by C/C++. Defaults to `false`
|
|
69
|
+
* (matches Java/Go semantics).
|
|
70
|
+
*/
|
|
71
|
+
readonly allowLineContinuation?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Scan a `//` line comment starting at `start` (which must reference
|
|
75
|
+
* the first `/` of the opener). Returns the index of the next `\n`
|
|
76
|
+
* (or EOF) — i.e. where the outer scanner resumes. The returned index
|
|
77
|
+
* does not include the `\n` itself.
|
|
78
|
+
*
|
|
79
|
+
* Pass `{ allowLineContinuation: true }` for C/C++-style line splices:
|
|
80
|
+
* a `\<newline>` continues the comment onto the next physical line
|
|
81
|
+
* (per C/C++ phase-2 translation). Defaults to `false`; Java and Go
|
|
82
|
+
* comments have no such behavior.
|
|
83
|
+
*
|
|
84
|
+
* Used by lang-cpp (with `allowLineContinuation: true`), lang-java,
|
|
85
|
+
* lang-go, lang-rust.
|
|
86
|
+
*/
|
|
87
|
+
export declare function scanLineComment(src: string, start: number, options?: ScanLineCommentOptions): ScanCommentResult;
|
|
88
|
+
/**
|
|
89
|
+
* Scan a non-nesting block comment starting at `start` (which must
|
|
90
|
+
* reference the opening slash). Returns the index just past the
|
|
91
|
+
* closing delimiter — i.e. where the outer scanner resumes. If the
|
|
92
|
+
* comment is unterminated, returns the EOF position.
|
|
93
|
+
*
|
|
94
|
+
* Used by lang-cpp, lang-java, lang-go.
|
|
95
|
+
*/
|
|
96
|
+
export declare function scanBlockCommentNonNesting(src: string, start: number): ScanCommentResult;
|
|
97
|
+
/** Result of `scanBlockCommentNesting`. */
|
|
98
|
+
export interface ScanNestingBlockCommentResult {
|
|
99
|
+
/** Index just past the closing delimiter (or EOF if unterminated). */
|
|
100
|
+
readonly end: number;
|
|
101
|
+
/**
|
|
102
|
+
* Final depth at scan completion. `0` indicates a balanced (well-
|
|
103
|
+
* terminated) comment. A positive value indicates an unterminated
|
|
104
|
+
* comment — `depth` openers were unmatched at EOF.
|
|
105
|
+
*/
|
|
106
|
+
readonly depth: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Scan a Rust-style nested block comment starting at `start` (which
|
|
110
|
+
* must reference the opening slash). Each nested opener increments
|
|
111
|
+
* the depth counter; each closer decrements it. The scan returns when
|
|
112
|
+
* the depth hits zero (balanced) or when EOF is reached (unterminated
|
|
113
|
+
* — `depth > 0`).
|
|
114
|
+
*
|
|
115
|
+
* Used by lang-rust.
|
|
116
|
+
*/
|
|
117
|
+
export declare function scanBlockCommentNesting(src: string, start: number): ScanNestingBlockCommentResult;
|
|
118
|
+
/** Result of `scanCharLiteral`. */
|
|
119
|
+
export interface ScanCharLiteralResult {
|
|
120
|
+
/**
|
|
121
|
+
* Index just past the char literal — i.e. where the outer scanner
|
|
122
|
+
* resumes. If the close-quote is found within the bound, this is
|
|
123
|
+
* one past the closing apostrophe. If the literal is unterminated
|
|
124
|
+
* (overflow or newline), this is one past the opening apostrophe
|
|
125
|
+
* (the apostrophe is treated as code rather than committing the run
|
|
126
|
+
* as a literal — see lang-java F2 / lang-cpp F5b).
|
|
127
|
+
*/
|
|
128
|
+
readonly end: number;
|
|
129
|
+
}
|
|
130
|
+
/** Options for `scanCharLiteral`. */
|
|
131
|
+
export interface ScanCharLiteralOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Maximum number of source positions to scan from the opening
|
|
134
|
+
* quote, inclusive of the close. Defaults to `8` — matches the
|
|
135
|
+
* lang-java / lang-rust heuristic. lang-cpp overrides this to `12`
|
|
136
|
+
* to accommodate unicode escapes such as `'\u{1F600}'` (10 chars
|
|
137
|
+
* including quotes); other C-family adopters should override
|
|
138
|
+
* similarly when their language permits longer escape sequences.
|
|
139
|
+
* The scan-cap is permissive: on overflow it recovers by treating
|
|
140
|
+
* the apostrophe as code.
|
|
141
|
+
*/
|
|
142
|
+
readonly maxScan?: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Scan a char literal starting at `start` (which must reference the
|
|
146
|
+
* opening apostrophe). Returns the index just past the literal — or,
|
|
147
|
+
* if the literal does not close within the scan bound, the index
|
|
148
|
+
* immediately after the opening apostrophe (the apostrophe is treated
|
|
149
|
+
* as code rather than committing the consumed run).
|
|
150
|
+
*
|
|
151
|
+
* Branch ordering is load-bearing: the escape-sequence advance MUST
|
|
152
|
+
* run before the close-quote check so escaped-apostrophe char
|
|
153
|
+
* literals do not terminate at the second apostrophe. See lang-java
|
|
154
|
+
* F6.
|
|
155
|
+
*
|
|
156
|
+
* Used by lang-cpp, lang-java (with prefix-stripping at the call
|
|
157
|
+
* site), lang-rust (with the lifetime-vs-literal heuristic at the
|
|
158
|
+
* call site).
|
|
159
|
+
*/
|
|
160
|
+
export declare function scanCharLiteral(src: string, start: number, options?: ScanCharLiteralOptions): ScanCharLiteralResult;
|
|
161
|
+
/**
|
|
162
|
+
* Replace each region with spaces, preserving newlines and overall
|
|
163
|
+
* length. Indexes into `src` and out remain identical, so any
|
|
164
|
+
* line/column derived from the original string is still valid.
|
|
165
|
+
*
|
|
166
|
+
* The `Region[]` is treated as readonly; callers may pass either
|
|
167
|
+
* regions from a comment scan or regions from a string scan (or both).
|
|
168
|
+
*/
|
|
169
|
+
export declare function applyRegions(src: string, regions: readonly Region[]): string;
|
|
170
|
+
//# sourceMappingURL=strip-scanners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-scanners.d.ts","sourceRoot":"","sources":["../../src/languages/strip-scanners.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oEAAoE;AACpE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CA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