@opensip-cli/fitness 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__/baseline-plane.test.d.ts +12 -0
- package/dist/__tests__/baseline-plane.test.d.ts.map +1 -0
- package/dist/__tests__/baseline-plane.test.js +63 -0
- package/dist/__tests__/baseline-plane.test.js.map +1 -0
- package/dist/__tests__/check-utils.test.d.ts +10 -0
- package/dist/__tests__/check-utils.test.d.ts.map +1 -0
- package/dist/__tests__/check-utils.test.js +193 -0
- package/dist/__tests__/check-utils.test.js.map +1 -0
- package/dist/__tests__/fingerprint-parity.test.d.ts +14 -0
- package/dist/__tests__/fingerprint-parity.test.d.ts.map +1 -0
- package/dist/__tests__/fingerprint-parity.test.js +59 -0
- package/dist/__tests__/fingerprint-parity.test.js.map +1 -0
- package/dist/__tests__/fit-execute-opts.test.d.ts +15 -0
- package/dist/__tests__/fit-execute-opts.test.d.ts.map +1 -0
- package/dist/__tests__/fit-execute-opts.test.js +124 -0
- package/dist/__tests__/fit-execute-opts.test.js.map +1 -0
- package/dist/__tests__/public-api.test.d.ts +19 -0
- package/dist/__tests__/public-api.test.d.ts.map +1 -0
- package/dist/__tests__/public-api.test.js +85 -0
- package/dist/__tests__/public-api.test.js.map +1 -0
- package/dist/__tests__/tool.test.d.ts +10 -0
- package/dist/__tests__/tool.test.d.ts.map +1 -0
- package/dist/__tests__/tool.test.js +57 -0
- package/dist/__tests__/tool.test.js.map +1 -0
- package/dist/baseline-strategy.d.ts +21 -0
- package/dist/baseline-strategy.d.ts.map +1 -0
- package/dist/baseline-strategy.js +21 -0
- package/dist/baseline-strategy.js.map +1 -0
- package/dist/check-utils/display.d.ts +52 -0
- package/dist/check-utils/display.d.ts.map +1 -0
- package/dist/check-utils/display.js +66 -0
- package/dist/check-utils/display.js.map +1 -0
- package/dist/check-utils/index.d.ts +17 -0
- package/dist/check-utils/index.d.ts.map +1 -0
- package/dist/check-utils/index.js +13 -0
- package/dist/check-utils/index.js.map +1 -0
- package/dist/check-utils/path-matching.d.ts +40 -0
- package/dist/check-utils/path-matching.d.ts.map +1 -0
- package/dist/check-utils/path-matching.js +38 -0
- package/dist/check-utils/path-matching.js.map +1 -0
- package/dist/check-utils/source-analysis.d.ts +36 -0
- package/dist/check-utils/source-analysis.d.ts.map +1 -0
- package/dist/check-utils/source-analysis.js +44 -0
- package/dist/check-utils/source-analysis.js.map +1 -0
- package/dist/check-utils/test-helpers.d.ts +57 -0
- package/dist/check-utils/test-helpers.d.ts.map +1 -0
- package/dist/check-utils/test-helpers.js +71 -0
- package/dist/check-utils/test-helpers.js.map +1 -0
- package/dist/cli/__tests__/fit-gate-mode.test.d.ts +14 -0
- package/dist/cli/__tests__/fit-gate-mode.test.d.ts.map +1 -0
- package/dist/cli/__tests__/fit-gate-mode.test.js +110 -0
- package/dist/cli/__tests__/fit-gate-mode.test.js.map +1 -0
- package/dist/cli/__tests__/fit-modes-live.test.d.ts +13 -0
- package/dist/cli/__tests__/fit-modes-live.test.d.ts.map +1 -0
- package/dist/cli/__tests__/fit-modes-live.test.js +182 -0
- package/dist/cli/__tests__/fit-modes-live.test.js.map +1 -0
- package/dist/cli/__tests__/report-data.test.d.ts +12 -0
- package/dist/cli/__tests__/report-data.test.d.ts.map +1 -0
- package/dist/cli/__tests__/report-data.test.js +113 -0
- package/dist/cli/__tests__/report-data.test.js.map +1 -0
- package/dist/cli/fit/__tests__/display-fold.test.d.ts +8 -0
- package/dist/cli/fit/__tests__/display-fold.test.d.ts.map +1 -0
- package/dist/cli/fit/__tests__/display-fold.test.js +87 -0
- package/dist/cli/fit/__tests__/display-fold.test.js.map +1 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts +16 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.d.ts.map +1 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.js +62 -0
- package/dist/cli/fit/__tests__/gate-resolved-config.test.js.map +1 -0
- package/dist/cli/fit/check-loader.d.ts +37 -0
- package/dist/cli/fit/check-loader.d.ts.map +1 -0
- package/dist/cli/fit/check-loader.js +154 -0
- package/dist/cli/fit/check-loader.js.map +1 -0
- package/dist/cli/fit/config-loader.d.ts +55 -0
- package/dist/cli/fit/config-loader.d.ts.map +1 -0
- package/dist/cli/fit/config-loader.js +107 -0
- package/dist/cli/fit/config-loader.js.map +1 -0
- package/dist/cli/fit/display-registry.d.ts +19 -0
- package/dist/cli/fit/display-registry.d.ts.map +1 -0
- package/dist/cli/fit/display-registry.js +33 -0
- package/dist/cli/fit/display-registry.js.map +1 -0
- package/dist/cli/fit/envelope-view.d.ts +49 -0
- package/dist/cli/fit/envelope-view.d.ts.map +1 -0
- package/dist/cli/fit/envelope-view.js +85 -0
- package/dist/cli/fit/envelope-view.js.map +1 -0
- package/dist/cli/fit/fit-aux-command-specs.d.ts +35 -0
- package/dist/cli/fit/fit-aux-command-specs.d.ts.map +1 -0
- package/dist/cli/fit/fit-aux-command-specs.js +110 -0
- package/dist/cli/fit/fit-aux-command-specs.js.map +1 -0
- package/dist/cli/fit/fit-command-spec.d.ts +24 -0
- package/dist/cli/fit/fit-command-spec.d.ts.map +1 -0
- package/dist/cli/fit/fit-command-spec.js +131 -0
- package/dist/cli/fit/fit-command-spec.js.map +1 -0
- package/dist/cli/fit/gate-compare-render.d.ts +13 -0
- package/dist/cli/fit/gate-compare-render.d.ts.map +1 -0
- package/dist/cli/fit/gate-compare-render.js +87 -0
- package/dist/cli/fit/gate-compare-render.js.map +1 -0
- package/dist/cli/fit/recipe-selector.d.ts +53 -0
- package/dist/cli/fit/recipe-selector.d.ts.map +1 -0
- package/dist/cli/fit/recipe-selector.js +106 -0
- package/dist/cli/fit/recipe-selector.js.map +1 -0
- package/dist/cli/fit/recipe-selector.test.d.ts +2 -0
- package/dist/cli/fit/recipe-selector.test.d.ts.map +1 -0
- package/dist/cli/fit/recipe-selector.test.js +69 -0
- package/dist/cli/fit/recipe-selector.test.js.map +1 -0
- package/dist/cli/fit/resolved-fitness-config.d.ts +48 -0
- package/dist/cli/fit/resolved-fitness-config.d.ts.map +1 -0
- package/dist/cli/fit/resolved-fitness-config.js +46 -0
- package/dist/cli/fit/resolved-fitness-config.js.map +1 -0
- package/dist/cli/fit/result-builders.d.ts +91 -0
- package/dist/cli/fit/result-builders.d.ts.map +1 -0
- package/dist/cli/fit/result-builders.js +206 -0
- package/dist/cli/fit/result-builders.js.map +1 -0
- package/dist/cli/fit-list.d.ts +7 -0
- package/dist/cli/fit-list.d.ts.map +1 -0
- package/dist/cli/fit-list.js +24 -0
- package/dist/cli/fit-list.js.map +1 -0
- package/dist/cli/fit-modes.d.ts +42 -0
- package/dist/cli/fit-modes.d.ts.map +1 -0
- package/dist/cli/fit-modes.js +322 -0
- package/dist/cli/fit-modes.js.map +1 -0
- package/dist/cli/fit-recipes.d.ts +7 -0
- package/dist/cli/fit-recipes.d.ts.map +1 -0
- package/dist/cli/fit-recipes.js +34 -0
- package/dist/cli/fit-recipes.js.map +1 -0
- package/dist/cli/fit-runner-views.d.ts +33 -0
- package/dist/cli/fit-runner-views.d.ts.map +1 -0
- package/dist/cli/fit-runner-views.js +92 -0
- package/dist/cli/fit-runner-views.js.map +1 -0
- package/dist/cli/fit-runner.d.ts +44 -0
- package/dist/cli/fit-runner.d.ts.map +1 -0
- package/dist/cli/fit-runner.js +250 -0
- package/dist/cli/fit-runner.js.map +1 -0
- package/dist/cli/fit-worker.d.ts +26 -0
- package/dist/cli/fit-worker.d.ts.map +1 -0
- package/dist/cli/fit-worker.js +67 -0
- package/dist/cli/fit-worker.js.map +1 -0
- package/dist/cli/fit.d.ts +74 -0
- package/dist/cli/fit.d.ts.map +1 -0
- package/dist/cli/fit.js +149 -0
- package/dist/cli/fit.js.map +1 -0
- package/dist/cli/report-data.d.ts +44 -0
- package/dist/cli/report-data.d.ts.map +1 -0
- package/dist/cli/report-data.js +89 -0
- package/dist/cli/report-data.js.map +1 -0
- package/dist/config/__tests__/fitness-config-schema.test.d.ts +6 -0
- package/dist/config/__tests__/fitness-config-schema.test.d.ts.map +1 -0
- package/dist/config/__tests__/fitness-config-schema.test.js +37 -0
- package/dist/config/__tests__/fitness-config-schema.test.js.map +1 -0
- package/dist/config/fitness-config-schema.d.ts +48 -0
- package/dist/config/fitness-config-schema.d.ts.map +1 -0
- package/dist/config/fitness-config-schema.js +62 -0
- package/dist/config/fitness-config-schema.js.map +1 -0
- package/dist/framework/__tests__/abortable-exec.test.d.ts +9 -0
- package/dist/framework/__tests__/abortable-exec.test.d.ts.map +1 -0
- package/dist/framework/__tests__/abortable-exec.test.js +102 -0
- package/dist/framework/__tests__/abortable-exec.test.js.map +1 -0
- package/dist/framework/__tests__/check-config.test.d.ts +2 -0
- package/dist/framework/__tests__/check-config.test.d.ts.map +1 -0
- package/dist/framework/__tests__/check-config.test.js +56 -0
- package/dist/framework/__tests__/check-config.test.js.map +1 -0
- package/dist/framework/__tests__/check-types.test.d.ts +2 -0
- package/dist/framework/__tests__/check-types.test.d.ts.map +1 -0
- package/dist/framework/__tests__/check-types.test.js +76 -0
- package/dist/framework/__tests__/check-types.test.js.map +1 -0
- package/dist/framework/__tests__/command-executor.test.d.ts +2 -0
- package/dist/framework/__tests__/command-executor.test.d.ts.map +1 -0
- package/dist/framework/__tests__/command-executor.test.js +110 -0
- package/dist/framework/__tests__/command-executor.test.js.map +1 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.d.ts +2 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.d.ts.map +1 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.js +122 -0
- package/dist/framework/__tests__/content-filter-dispatch.test.js.map +1 -0
- package/dist/framework/__tests__/define-check.test.d.ts +2 -0
- package/dist/framework/__tests__/define-check.test.d.ts.map +1 -0
- package/dist/framework/__tests__/define-check.test.js +402 -0
- package/dist/framework/__tests__/define-check.test.js.map +1 -0
- package/dist/framework/__tests__/define-regex-list-check.test.d.ts +15 -0
- package/dist/framework/__tests__/define-regex-list-check.test.d.ts.map +1 -0
- package/dist/framework/__tests__/define-regex-list-check.test.js +299 -0
- package/dist/framework/__tests__/define-regex-list-check.test.js.map +1 -0
- package/dist/framework/__tests__/directive-inventory.test.d.ts +2 -0
- package/dist/framework/__tests__/directive-inventory.test.d.ts.map +1 -0
- package/dist/framework/__tests__/directive-inventory.test.js +111 -0
- package/dist/framework/__tests__/directive-inventory.test.js.map +1 -0
- package/dist/framework/__tests__/directive-parsing.test.d.ts +13 -0
- package/dist/framework/__tests__/directive-parsing.test.d.ts.map +1 -0
- package/dist/framework/__tests__/directive-parsing.test.js +86 -0
- package/dist/framework/__tests__/directive-parsing.test.js.map +1 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts +2 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.d.ts.map +1 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.js +56 -0
- package/dist/framework/__tests__/execution-context.globalexcludes-parity.test.js.map +1 -0
- package/dist/framework/__tests__/execution-context.test.d.ts +2 -0
- package/dist/framework/__tests__/execution-context.test.d.ts.map +1 -0
- package/dist/framework/__tests__/execution-context.test.js +140 -0
- package/dist/framework/__tests__/execution-context.test.js.map +1 -0
- package/dist/framework/__tests__/file-accessor.test.d.ts +2 -0
- package/dist/framework/__tests__/file-accessor.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-accessor.test.js +106 -0
- package/dist/framework/__tests__/file-accessor.test.js.map +1 -0
- package/dist/framework/__tests__/file-cache.test.d.ts +2 -0
- package/dist/framework/__tests__/file-cache.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-cache.test.js +122 -0
- package/dist/framework/__tests__/file-cache.test.js.map +1 -0
- package/dist/framework/__tests__/file-type-filter.test.d.ts +9 -0
- package/dist/framework/__tests__/file-type-filter.test.d.ts.map +1 -0
- package/dist/framework/__tests__/file-type-filter.test.js +39 -0
- package/dist/framework/__tests__/file-type-filter.test.js.map +1 -0
- package/dist/framework/__tests__/ignore-processing.test.d.ts +11 -0
- package/dist/framework/__tests__/ignore-processing.test.d.ts.map +1 -0
- package/dist/framework/__tests__/ignore-processing.test.js +175 -0
- package/dist/framework/__tests__/ignore-processing.test.js.map +1 -0
- package/dist/framework/__tests__/import-graph.test.d.ts +15 -0
- package/dist/framework/__tests__/import-graph.test.d.ts.map +1 -0
- package/dist/framework/__tests__/import-graph.test.js +164 -0
- package/dist/framework/__tests__/import-graph.test.js.map +1 -0
- package/dist/framework/__tests__/memory-profiler.test.d.ts +9 -0
- package/dist/framework/__tests__/memory-profiler.test.d.ts.map +1 -0
- package/dist/framework/__tests__/memory-profiler.test.js +108 -0
- package/dist/framework/__tests__/memory-profiler.test.js.map +1 -0
- package/dist/framework/__tests__/parse-cache.test.d.ts +9 -0
- package/dist/framework/__tests__/parse-cache.test.d.ts.map +1 -0
- package/dist/framework/__tests__/parse-cache.test.js +51 -0
- package/dist/framework/__tests__/parse-cache.test.js.map +1 -0
- package/dist/framework/__tests__/path-matcher.test.d.ts +2 -0
- package/dist/framework/__tests__/path-matcher.test.d.ts.map +1 -0
- package/dist/framework/__tests__/path-matcher.test.js +113 -0
- package/dist/framework/__tests__/path-matcher.test.js.map +1 -0
- package/dist/framework/__tests__/register-helpers.test.d.ts +2 -0
- package/dist/framework/__tests__/register-helpers.test.d.ts.map +1 -0
- package/dist/framework/__tests__/register-helpers.test.js +51 -0
- package/dist/framework/__tests__/register-helpers.test.js.map +1 -0
- package/dist/framework/__tests__/registry.test.d.ts +2 -0
- package/dist/framework/__tests__/registry.test.d.ts.map +1 -0
- package/dist/framework/__tests__/registry.test.js +211 -0
- package/dist/framework/__tests__/registry.test.js.map +1 -0
- package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
- package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
- package/dist/framework/__tests__/result-builder.test.js +153 -0
- package/dist/framework/__tests__/result-builder.test.js.map +1 -0
- package/dist/framework/__tests__/scope-registry.test.d.ts +8 -0
- package/dist/framework/__tests__/scope-registry.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-registry.test.js +156 -0
- package/dist/framework/__tests__/scope-registry.test.js.map +1 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.d.ts +2 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.js +105 -0
- package/dist/framework/__tests__/scope-resolver.golden.test.js.map +1 -0
- package/dist/framework/__tests__/scope-resolver.test.d.ts +2 -0
- package/dist/framework/__tests__/scope-resolver.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scope-resolver.test.js +150 -0
- package/dist/framework/__tests__/scope-resolver.test.js.map +1 -0
- package/dist/framework/__tests__/severity-mapping.test.d.ts +2 -0
- package/dist/framework/__tests__/severity-mapping.test.d.ts.map +1 -0
- package/dist/framework/__tests__/severity-mapping.test.js +74 -0
- package/dist/framework/__tests__/severity-mapping.test.js.map +1 -0
- package/dist/framework/__tests__/strip-literals.test.d.ts +2 -0
- package/dist/framework/__tests__/strip-literals.test.d.ts.map +1 -0
- package/dist/framework/__tests__/strip-literals.test.js +87 -0
- package/dist/framework/__tests__/strip-literals.test.js.map +1 -0
- package/dist/framework/abortable-exec.d.ts +34 -0
- package/dist/framework/abortable-exec.d.ts.map +1 -0
- package/dist/framework/abortable-exec.js +143 -0
- package/dist/framework/abortable-exec.js.map +1 -0
- package/dist/framework/check-config.d.ts +175 -0
- package/dist/framework/check-config.d.ts.map +1 -0
- package/dist/framework/check-config.js +115 -0
- package/dist/framework/check-config.js.map +1 -0
- package/dist/framework/check-types.d.ts +82 -0
- package/dist/framework/check-types.d.ts.map +1 -0
- package/dist/framework/check-types.js +63 -0
- package/dist/framework/check-types.js.map +1 -0
- package/dist/framework/command-executor.d.ts +25 -0
- package/dist/framework/command-executor.d.ts.map +1 -0
- package/dist/framework/command-executor.js +63 -0
- package/dist/framework/command-executor.js.map +1 -0
- package/dist/framework/comment-openers.d.ts +11 -0
- package/dist/framework/comment-openers.d.ts.map +1 -0
- package/dist/framework/comment-openers.js +11 -0
- package/dist/framework/comment-openers.js.map +1 -0
- package/dist/framework/constants.d.ts +9 -0
- package/dist/framework/constants.d.ts.map +1 -0
- package/dist/framework/constants.js +16 -0
- package/dist/framework/constants.js.map +1 -0
- package/dist/framework/define-check.d.ts +38 -0
- package/dist/framework/define-check.d.ts.map +1 -0
- package/dist/framework/define-check.js +296 -0
- package/dist/framework/define-check.js.map +1 -0
- package/dist/framework/define-regex-list-check.d.ts +160 -0
- package/dist/framework/define-regex-list-check.d.ts.map +1 -0
- package/dist/framework/define-regex-list-check.js +177 -0
- package/dist/framework/define-regex-list-check.js.map +1 -0
- package/dist/framework/directive-inventory.d.ts +37 -0
- package/dist/framework/directive-inventory.d.ts.map +1 -0
- package/dist/framework/directive-inventory.js +82 -0
- package/dist/framework/directive-inventory.js.map +1 -0
- package/dist/framework/directive-parsing.d.ts +23 -0
- package/dist/framework/directive-parsing.d.ts.map +1 -0
- package/dist/framework/directive-parsing.js +39 -0
- package/dist/framework/directive-parsing.js.map +1 -0
- package/dist/framework/execution-context.d.ts +98 -0
- package/dist/framework/execution-context.d.ts.map +1 -0
- package/dist/framework/execution-context.js +145 -0
- package/dist/framework/execution-context.js.map +1 -0
- package/dist/framework/file-accessor.d.ts +20 -0
- package/dist/framework/file-accessor.d.ts.map +1 -0
- package/dist/framework/file-accessor.js +122 -0
- package/dist/framework/file-accessor.js.map +1 -0
- package/dist/framework/file-cache.d.ts +70 -0
- package/dist/framework/file-cache.d.ts.map +1 -0
- package/dist/framework/file-cache.js +199 -0
- package/dist/framework/file-cache.js.map +1 -0
- package/dist/framework/file-type-filter.d.ts +11 -0
- package/dist/framework/file-type-filter.d.ts.map +1 -0
- package/dist/framework/file-type-filter.js +21 -0
- package/dist/framework/file-type-filter.js.map +1 -0
- package/dist/framework/ignore-processing.d.ts +36 -0
- package/dist/framework/ignore-processing.d.ts.map +1 -0
- package/dist/framework/ignore-processing.js +172 -0
- package/dist/framework/ignore-processing.js.map +1 -0
- package/dist/framework/import-graph.d.ts +51 -0
- package/dist/framework/import-graph.d.ts.map +1 -0
- package/dist/framework/import-graph.js +217 -0
- package/dist/framework/import-graph.js.map +1 -0
- package/dist/framework/memory-profiler.d.ts +53 -0
- package/dist/framework/memory-profiler.d.ts.map +1 -0
- package/dist/framework/memory-profiler.js +92 -0
- package/dist/framework/memory-profiler.js.map +1 -0
- package/dist/framework/parse-cache.d.ts +24 -0
- package/dist/framework/parse-cache.d.ts.map +1 -0
- package/dist/framework/parse-cache.js +41 -0
- package/dist/framework/parse-cache.js.map +1 -0
- package/dist/framework/path-matcher.d.ts +86 -0
- package/dist/framework/path-matcher.d.ts.map +1 -0
- package/dist/framework/path-matcher.js +138 -0
- package/dist/framework/path-matcher.js.map +1 -0
- package/dist/framework/register-helpers.d.ts +11 -0
- package/dist/framework/register-helpers.d.ts.map +1 -0
- package/dist/framework/register-helpers.js +19 -0
- package/dist/framework/register-helpers.js.map +1 -0
- package/dist/framework/registry.d.ts +51 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +131 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/result-builder.d.ts +74 -0
- package/dist/framework/result-builder.d.ts.map +1 -0
- package/dist/framework/result-builder.js +154 -0
- package/dist/framework/result-builder.js.map +1 -0
- package/dist/framework/scope-registry.d.ts +38 -0
- package/dist/framework/scope-registry.d.ts.map +1 -0
- package/dist/framework/scope-registry.js +77 -0
- package/dist/framework/scope-registry.js.map +1 -0
- package/dist/framework/scope-resolver.d.ts +23 -0
- package/dist/framework/scope-resolver.d.ts.map +1 -0
- package/dist/framework/scope-resolver.js +102 -0
- package/dist/framework/scope-resolver.js.map +1 -0
- package/dist/framework/severity-mapping.d.ts +17 -0
- package/dist/framework/severity-mapping.d.ts.map +1 -0
- package/dist/framework/severity-mapping.js +71 -0
- package/dist/framework/severity-mapping.js.map +1 -0
- package/dist/framework/strip-literals.d.ts +73 -0
- package/dist/framework/strip-literals.d.ts.map +1 -0
- package/dist/framework/strip-literals.js +213 -0
- package/dist/framework/strip-literals.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +17 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +17 -0
- package/dist/internal.js.map +1 -0
- package/dist/persistence/session-payload.d.ts +68 -0
- package/dist/persistence/session-payload.d.ts.map +1 -0
- package/dist/persistence/session-payload.js +78 -0
- package/dist/persistence/session-payload.js.map +1 -0
- package/dist/persistence/session-payload.test.d.ts +11 -0
- package/dist/persistence/session-payload.test.d.ts.map +1 -0
- package/dist/persistence/session-payload.test.js +80 -0
- package/dist/persistence/session-payload.test.js.map +1 -0
- package/dist/persistence/session-replay.d.ts +14 -0
- package/dist/persistence/session-replay.d.ts.map +1 -0
- package/dist/persistence/session-replay.js +85 -0
- package/dist/persistence/session-replay.js.map +1 -0
- package/dist/persistence/session-replay.test.d.ts +10 -0
- package/dist/persistence/session-replay.test.d.ts.map +1 -0
- package/dist/persistence/session-replay.test.js +171 -0
- package/dist/persistence/session-replay.test.js.map +1 -0
- package/dist/plugins/__tests__/check-package-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/check-package-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/check-package-discovery.test.js +48 -0
- package/dist/plugins/__tests__/check-package-discovery.test.js.map +1 -0
- package/dist/plugins/__tests__/lang-domain.test.d.ts +2 -0
- package/dist/plugins/__tests__/lang-domain.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/lang-domain.test.js +192 -0
- package/dist/plugins/__tests__/lang-domain.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 +271 -0
- package/dist/plugins/__tests__/loader.test.js.map +1 -0
- package/dist/plugins/check-package-discovery.d.ts +19 -0
- package/dist/plugins/check-package-discovery.d.ts.map +1 -0
- package/dist/plugins/check-package-discovery.js +34 -0
- package/dist/plugins/check-package-discovery.js.map +1 -0
- package/dist/plugins/loader.d.ts +32 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +198 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/types.d.ts +29 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +9 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts +2 -0
- package/dist/recipes/__tests__/built-in-recipes.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js +93 -0
- package/dist/recipes/__tests__/built-in-recipes.test.js.map +1 -0
- package/dist/recipes/__tests__/check-config.test.d.ts +12 -0
- package/dist/recipes/__tests__/check-config.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/check-config.test.js +90 -0
- package/dist/recipes/__tests__/check-config.test.js.map +1 -0
- package/dist/recipes/__tests__/check-resolution.test.d.ts +2 -0
- package/dist/recipes/__tests__/check-resolution.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/check-resolution.test.js +160 -0
- package/dist/recipes/__tests__/check-resolution.test.js.map +1 -0
- package/dist/recipes/__tests__/execution-branches.test.d.ts +10 -0
- package/dist/recipes/__tests__/execution-branches.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/execution-branches.test.js +612 -0
- package/dist/recipes/__tests__/execution-branches.test.js.map +1 -0
- package/dist/recipes/__tests__/execution-paths.test.d.ts +10 -0
- package/dist/recipes/__tests__/execution-paths.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/execution-paths.test.js +280 -0
- package/dist/recipes/__tests__/execution-paths.test.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 +89 -0
- package/dist/recipes/__tests__/registry.test.js.map +1 -0
- package/dist/recipes/__tests__/retry.test.d.ts +2 -0
- package/dist/recipes/__tests__/retry.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/retry.test.js +75 -0
- package/dist/recipes/__tests__/retry.test.js.map +1 -0
- package/dist/recipes/__tests__/run-one-check.test.d.ts +14 -0
- package/dist/recipes/__tests__/run-one-check.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/run-one-check.test.js +182 -0
- package/dist/recipes/__tests__/run-one-check.test.js.map +1 -0
- package/dist/recipes/__tests__/service.test.d.ts +11 -0
- package/dist/recipes/__tests__/service.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/service.test.js +572 -0
- package/dist/recipes/__tests__/service.test.js.map +1 -0
- package/dist/recipes/built-in-recipes.d.ts +14 -0
- package/dist/recipes/built-in-recipes.d.ts.map +1 -0
- package/dist/recipes/built-in-recipes.js +241 -0
- package/dist/recipes/built-in-recipes.js.map +1 -0
- package/dist/recipes/check-config.d.ts +56 -0
- package/dist/recipes/check-config.d.ts.map +1 -0
- package/dist/recipes/check-config.js +61 -0
- package/dist/recipes/check-config.js.map +1 -0
- package/dist/recipes/check-resolution.d.ts +36 -0
- package/dist/recipes/check-resolution.d.ts.map +1 -0
- package/dist/recipes/check-resolution.js +81 -0
- package/dist/recipes/check-resolution.js.map +1 -0
- package/dist/recipes/check-result-processor.d.ts +51 -0
- package/dist/recipes/check-result-processor.d.ts.map +1 -0
- package/dist/recipes/check-result-processor.js +197 -0
- package/dist/recipes/check-result-processor.js.map +1 -0
- package/dist/recipes/parallel-execution.d.ts +38 -0
- package/dist/recipes/parallel-execution.d.ts.map +1 -0
- package/dist/recipes/parallel-execution.js +61 -0
- package/dist/recipes/parallel-execution.js.map +1 -0
- package/dist/recipes/registry.d.ts +47 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +70 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/retry.d.ts +29 -0
- package/dist/recipes/retry.d.ts.map +1 -0
- package/dist/recipes/retry.js +23 -0
- package/dist/recipes/retry.js.map +1 -0
- package/dist/recipes/run-one-check.d.ts +59 -0
- package/dist/recipes/run-one-check.d.ts.map +1 -0
- package/dist/recipes/run-one-check.js +174 -0
- package/dist/recipes/run-one-check.js.map +1 -0
- package/dist/recipes/sequential-execution.d.ts +12 -0
- package/dist/recipes/sequential-execution.d.ts.map +1 -0
- package/dist/recipes/sequential-execution.js +48 -0
- package/dist/recipes/sequential-execution.js.map +1 -0
- package/dist/recipes/service-types.d.ts +87 -0
- package/dist/recipes/service-types.d.ts.map +1 -0
- package/dist/recipes/service-types.js +8 -0
- package/dist/recipes/service-types.js.map +1 -0
- package/dist/recipes/service.d.ts +73 -0
- package/dist/recipes/service.d.ts.map +1 -0
- package/dist/recipes/service.js +438 -0
- package/dist/recipes/service.js.map +1 -0
- package/dist/recipes/types.d.ts +155 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +56 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/scaffold/config-block.d.ts +17 -0
- package/dist/scaffold/config-block.d.ts.map +1 -0
- package/dist/scaffold/config-block.js +30 -0
- package/dist/scaffold/config-block.js.map +1 -0
- package/dist/scaffold/examples.d.ts +30 -0
- package/dist/scaffold/examples.d.ts.map +1 -0
- package/dist/scaffold/examples.js +129 -0
- package/dist/scaffold/examples.js.map +1 -0
- package/dist/scope-augmentation.d.ts +77 -0
- package/dist/scope-augmentation.d.ts.map +1 -0
- package/dist/scope-augmentation.js +31 -0
- package/dist/scope-augmentation.js.map +1 -0
- package/dist/signalers/__tests__/loader.test.d.ts +2 -0
- package/dist/signalers/__tests__/loader.test.d.ts.map +1 -0
- package/dist/signalers/__tests__/loader.test.js +141 -0
- package/dist/signalers/__tests__/loader.test.js.map +1 -0
- package/dist/signalers/__tests__/violation-to-signal.test.d.ts +2 -0
- package/dist/signalers/__tests__/violation-to-signal.test.d.ts.map +1 -0
- package/dist/signalers/__tests__/violation-to-signal.test.js +59 -0
- package/dist/signalers/__tests__/violation-to-signal.test.js.map +1 -0
- package/dist/signalers/index.d.ts +8 -0
- package/dist/signalers/index.d.ts.map +1 -0
- package/dist/signalers/index.js +9 -0
- package/dist/signalers/index.js.map +1 -0
- package/dist/signalers/loader.d.ts +30 -0
- package/dist/signalers/loader.d.ts.map +1 -0
- package/dist/signalers/loader.js +120 -0
- package/dist/signalers/loader.js.map +1 -0
- package/dist/signalers/schema.d.ts +60 -0
- package/dist/signalers/schema.d.ts.map +1 -0
- package/dist/signalers/schema.js +74 -0
- package/dist/signalers/schema.js.map +1 -0
- package/dist/signalers/types.d.ts +13 -0
- package/dist/signalers/types.d.ts.map +1 -0
- package/dist/signalers/types.js +5 -0
- package/dist/signalers/types.js.map +1 -0
- package/dist/signalers/violation-to-signal.d.ts +38 -0
- package/dist/signalers/violation-to-signal.d.ts.map +1 -0
- package/dist/signalers/violation-to-signal.js +43 -0
- package/dist/signalers/violation-to-signal.js.map +1 -0
- package/dist/targets/__tests__/loader.test.d.ts +2 -0
- package/dist/targets/__tests__/loader.test.d.ts.map +1 -0
- package/dist/targets/__tests__/loader.test.js +190 -0
- package/dist/targets/__tests__/loader.test.js.map +1 -0
- package/dist/targets/__tests__/target-registry.test.d.ts +2 -0
- package/dist/targets/__tests__/target-registry.test.d.ts.map +1 -0
- package/dist/targets/__tests__/target-registry.test.js +182 -0
- package/dist/targets/__tests__/target-registry.test.js.map +1 -0
- package/dist/targets/index.d.ts +18 -0
- package/dist/targets/index.d.ts.map +1 -0
- package/dist/targets/index.js +21 -0
- package/dist/targets/index.js.map +1 -0
- package/dist/targets/loader.d.ts +27 -0
- package/dist/targets/loader.d.ts.map +1 -0
- package/dist/targets/loader.js +178 -0
- package/dist/targets/loader.js.map +1 -0
- package/dist/targets/target-registry.d.ts +41 -0
- package/dist/targets/target-registry.d.ts.map +1 -0
- package/dist/targets/target-registry.js +71 -0
- package/dist/targets/target-registry.js.map +1 -0
- package/dist/targets/types.d.ts +14 -0
- package/dist/targets/types.d.ts.map +1 -0
- package/dist/targets/types.js +14 -0
- package/dist/targets/types.js.map +1 -0
- package/dist/tool.d.ts +61 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +260 -0
- package/dist/tool.js.map +1 -0
- package/dist/types/findings.d.ts +113 -0
- package/dist/types/findings.d.ts.map +1 -0
- package/dist/types/findings.js +89 -0
- package/dist/types/findings.js.map +1 -0
- package/dist/types/severity.d.ts +15 -0
- package/dist/types/severity.d.ts.map +1 -0
- package/dist/types/severity.js +33 -0
- package/dist/types/severity.js.map +1 -0
- package/package.json +137 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fit-recipes command — list all available fitness recipes
|
|
3
|
+
*/
|
|
4
|
+
import { currentRecipeRegistry } from '../framework/scope-registry.js';
|
|
5
|
+
import { ensureChecksLoaded } from './fit.js';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// listRecipes
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/** Returns metadata for every registered recipe (built-in plus user-defined). */
|
|
10
|
+
export async function listRecipes(projectDir) {
|
|
11
|
+
// Load plugins so user-defined recipes (e.g. ~/.opensip-cli/fit/*.mjs) appear.
|
|
12
|
+
await ensureChecksLoaded(projectDir);
|
|
13
|
+
const recipes = currentRecipeRegistry()
|
|
14
|
+
.getAllRecipes()
|
|
15
|
+
.map((recipe) => {
|
|
16
|
+
const selector = recipe.checks;
|
|
17
|
+
let checkCount;
|
|
18
|
+
if (selector.type === 'all') {
|
|
19
|
+
checkCount = 'all checks';
|
|
20
|
+
}
|
|
21
|
+
else if (selector.type === 'explicit') {
|
|
22
|
+
checkCount = `${selector.checkIds.length} checks`;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
checkCount = 'pattern-based';
|
|
26
|
+
}
|
|
27
|
+
return { name: recipe.name, description: recipe.description, checkCount };
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
type: 'list-recipes',
|
|
31
|
+
recipes,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=fit-recipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-recipes.js","sourceRoot":"","sources":["../../src/cli/fit-recipes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,UAAmB;IACnD,+EAA+E;IAC/E,MAAM,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAErC,MAAM,OAAO,GAAG,qBAAqB,EAAE;SACpC,aAAa,EAAE;SACf,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/B,IAAI,UAAkB,CAAC;QACvB,IAAI,QAAQ,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YAC5B,UAAU,GAAG,YAAY,CAAC;QAC5B,CAAC;aAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACxC,UAAU,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,SAAS,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,UAAU,GAAG,eAAe,CAAC;QAC/B,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEL,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tool-specific Ink render pieces for the live fit view.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `fit-runner.tsx` so the state-machine entry there stays
|
|
5
|
+
* compact. Each component here consumes the run's {@link SignalEnvelope}-
|
|
6
|
+
* derived view-models (`FitTableRow` / `FitFindingsGroup`, built by
|
|
7
|
+
* `fit/envelope-view.ts`) and pulls colours from the shared cli-ui theme. The
|
|
8
|
+
* Banner, RunHeader, Spinner, and ErrorMessage primitives remain owned by
|
|
9
|
+
* `@opensip-cli/cli-ui` — only the fitness-specific renderers live here.
|
|
10
|
+
*
|
|
11
|
+
* ADR-0011 Phase 6: fitness no longer imports `@opensip-cli/output`; the
|
|
12
|
+
* live table/findings derive straight from the envelope (the static/non-TTY
|
|
13
|
+
* path uses the shared `formatSignalTableRows` at the composition root).
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { type FitTableRow } from './fit/envelope-view.js';
|
|
17
|
+
export declare function ResultsTable({ rows, }: {
|
|
18
|
+
readonly rows: readonly FitTableRow[];
|
|
19
|
+
}): React.ReactElement | null;
|
|
20
|
+
/**
|
|
21
|
+
* WarningsBlock — renders non-fatal user-facing warnings collected during
|
|
22
|
+
* the run (plugin load failures, unknown languages in config, missing
|
|
23
|
+
* check packages, etc.).
|
|
24
|
+
*
|
|
25
|
+
* These come through `FitDoneResult.warnings` rather than direct stderr
|
|
26
|
+
* writes — emitting them during an active Ink render desyncs the renderer's
|
|
27
|
+
* frame tracking. Rendering them here through Ink keeps the live view's
|
|
28
|
+
* frame contract intact.
|
|
29
|
+
*/
|
|
30
|
+
export declare function WarningsBlock({ warnings, }: {
|
|
31
|
+
readonly warnings: readonly string[];
|
|
32
|
+
}): React.ReactElement;
|
|
33
|
+
//# sourceMappingURL=fit-runner-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-runner-views.d.ts","sourceRoot":"","sources":["../../src/cli/fit-runner-views.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA2B5E,wBAAgB,YAAY,CAAC,EAC3B,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;CACvC,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CA0D5B;AAOD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,GAAG,KAAK,CAAC,YAAY,CAYrB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Tool-specific Ink render pieces for the live fit view.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `fit-runner.tsx` so the state-machine entry there stays
|
|
6
|
+
* compact. Each component here consumes the run's {@link SignalEnvelope}-
|
|
7
|
+
* derived view-models (`FitTableRow` / `FitFindingsGroup`, built by
|
|
8
|
+
* `fit/envelope-view.ts`) and pulls colours from the shared cli-ui theme. The
|
|
9
|
+
* Banner, RunHeader, Spinner, and ErrorMessage primitives remain owned by
|
|
10
|
+
* `@opensip-cli/cli-ui` — only the fitness-specific renderers live here.
|
|
11
|
+
*
|
|
12
|
+
* ADR-0011 Phase 6: fitness no longer imports `@opensip-cli/output`; the
|
|
13
|
+
* live table/findings derive straight from the envelope (the static/non-TTY
|
|
14
|
+
* path uses the shared `formatSignalTableRows` at the composition root).
|
|
15
|
+
*/
|
|
16
|
+
import { useTheme, sortFitRowPriority, parseValidatedCount } from '@opensip-cli/cli-ui';
|
|
17
|
+
import { Box, Text } from 'ink';
|
|
18
|
+
import { fitValidatedCell } from './fit/envelope-view.js';
|
|
19
|
+
function statusColor(theme, status) {
|
|
20
|
+
if (status === 'FAIL')
|
|
21
|
+
return theme.statusFail;
|
|
22
|
+
if (status === 'ERROR')
|
|
23
|
+
return theme.statusTimeout;
|
|
24
|
+
return theme.statusPass;
|
|
25
|
+
}
|
|
26
|
+
function ignoredColor(theme, ignored, validated) {
|
|
27
|
+
const total = parseValidatedCount(validated);
|
|
28
|
+
if (total === 0 || ignored === 0)
|
|
29
|
+
return theme.muted;
|
|
30
|
+
const pct = (ignored / total) * 100;
|
|
31
|
+
if (pct > 10)
|
|
32
|
+
return theme.error;
|
|
33
|
+
if (pct > 5)
|
|
34
|
+
return theme.warning;
|
|
35
|
+
return theme.muted;
|
|
36
|
+
}
|
|
37
|
+
function durationColor(theme, ms) {
|
|
38
|
+
if (ms >= 60_000)
|
|
39
|
+
return theme.error;
|
|
40
|
+
if (ms >= 30_000)
|
|
41
|
+
return theme.warning;
|
|
42
|
+
return theme.success;
|
|
43
|
+
}
|
|
44
|
+
export function ResultsTable({ rows, }) {
|
|
45
|
+
const theme = useTheme();
|
|
46
|
+
if (rows.length === 0)
|
|
47
|
+
return null;
|
|
48
|
+
const sorted = [...rows].sort((a, b) => sortFitRowPriority(a) - sortFitRowPriority(b));
|
|
49
|
+
const maxCheckWidth = Math.max(40, ...sorted.map((r) => r.check.length));
|
|
50
|
+
const widths = { status: 7, errors: 6, warnings: 8, validated: 12, ignored: 7, duration: 10 };
|
|
51
|
+
const headerCells = [
|
|
52
|
+
'Check'.padEnd(maxCheckWidth),
|
|
53
|
+
'Status'.padEnd(widths.status),
|
|
54
|
+
'Errors'.padEnd(widths.errors),
|
|
55
|
+
'Warnings'.padEnd(widths.warnings),
|
|
56
|
+
'Validated'.padEnd(widths.validated),
|
|
57
|
+
'Ignores'.padEnd(widths.ignored),
|
|
58
|
+
'Duration'.padEnd(widths.duration),
|
|
59
|
+
];
|
|
60
|
+
const separatorCells = [
|
|
61
|
+
'-'.repeat(maxCheckWidth),
|
|
62
|
+
'-'.repeat(widths.status),
|
|
63
|
+
'-'.repeat(widths.errors),
|
|
64
|
+
'-'.repeat(widths.warnings),
|
|
65
|
+
'-'.repeat(widths.validated),
|
|
66
|
+
'-'.repeat(widths.ignored),
|
|
67
|
+
'-'.repeat(widths.duration),
|
|
68
|
+
];
|
|
69
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: headerCells.join(' | ') }), _jsx(Text, { children: separatorCells.join('-|-') }), sorted.map((row, i) => {
|
|
70
|
+
const validatedCell = fitValidatedCell(row);
|
|
71
|
+
return (_jsxs(Text, { children: [row.check.padEnd(maxCheckWidth), ' | ', _jsx(Text, { color: statusColor(theme, row.status), children: row.status.padEnd(widths.status) }), ' | ', _jsx(Text, { color: row.errors > 0 ? theme.error : theme.success, children: String(row.errors).padEnd(widths.errors) }), ' | ', _jsx(Text, { color: row.warnings > 0 ? theme.warning : theme.muted, children: String(row.warnings).padEnd(widths.warnings) }), ' | ', validatedCell.padEnd(widths.validated), ' | ', _jsx(Text, { color: ignoredColor(theme, row.ignored, validatedCell), children: String(row.ignored).padEnd(widths.ignored) }), ' | ', _jsx(Text, { color: durationColor(theme, row.durationMs), children: row.duration.padEnd(widths.duration) })] }, i));
|
|
72
|
+
})] }));
|
|
73
|
+
}
|
|
74
|
+
// SummaryLine previously lived here — now provided by
|
|
75
|
+
// `@opensip-cli/cli-ui`'s shared `RunSummary` component so fit, graph,
|
|
76
|
+
// and future tools render the same single-line summary at the bottom
|
|
77
|
+
// of every run. fit-runner.tsx imports `RunSummary` directly.
|
|
78
|
+
/**
|
|
79
|
+
* WarningsBlock — renders non-fatal user-facing warnings collected during
|
|
80
|
+
* the run (plugin load failures, unknown languages in config, missing
|
|
81
|
+
* check packages, etc.).
|
|
82
|
+
*
|
|
83
|
+
* These come through `FitDoneResult.warnings` rather than direct stderr
|
|
84
|
+
* writes — emitting them during an active Ink render desyncs the renderer's
|
|
85
|
+
* frame tracking. Rendering them here through Ink keeps the live view's
|
|
86
|
+
* frame contract intact.
|
|
87
|
+
*/
|
|
88
|
+
export function WarningsBlock({ warnings, }) {
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
return (_jsx(Box, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, children: warnings.map((msg, i) => (_jsxs(Text, { color: theme.warning, children: ['! ', msg] }, i))) }));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=fit-runner-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-runner-views.js","sourceRoot":"","sources":["../../src/cli/fit-runner-views.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAoB,MAAM,wBAAwB,CAAC;AAE5E,SAAS,WAAW,CAAC,KAAkC,EAAE,MAA6B;IACpF,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC;IAC/C,IAAI,MAAM,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,aAAa,CAAC;IACnD,OAAO,KAAK,CAAC,UAAU,CAAC;AAC1B,CAAC;AAED,SAAS,YAAY,CACnB,KAAkC,EAClC,OAAe,EACf,SAAiB;IAEjB,MAAM,KAAK,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,KAAK,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC;IACrD,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;IACpC,IAAI,GAAG,GAAG,EAAE;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC;IACjC,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAClC,OAAO,KAAK,CAAC,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CAAC,OAAO,aAC/B,IAAI,EACJ,GAAG,KAFK,CAAC,CAGL,CACR,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fit-runner — owns the live-view state machine for `opensip fit`.
|
|
3
|
+
*
|
|
4
|
+
* Layer 5 Phase 3 lifted the fit live view out of `opensip-cli`.
|
|
5
|
+
* The state machine (loading → running → done | error), `executeFit`
|
|
6
|
+
* orchestration, `reportToCloud` post-call, and the Ink/React render
|
|
7
|
+
* tree all live here, in the package that owns the fitness command
|
|
8
|
+
* surface. Adding a fourth tool with a live view requires zero CLI
|
|
9
|
+
* edits — each tool ships its own renderer and registers it via
|
|
10
|
+
* `cli.registerLiveView(key, renderer)`.
|
|
11
|
+
*
|
|
12
|
+
* Shared presentational primitives (Banner, RunHeader, Spinner, theme
|
|
13
|
+
* tokens) come from `@opensip-cli/cli-ui`. Tool-specific render
|
|
14
|
+
* pieces (results table, findings block, cloud-report status) live in
|
|
15
|
+
* `cli/fit-runner-views.tsx`; they're imported here so this module
|
|
16
|
+
* stays focused on the state machine and entry point.
|
|
17
|
+
*
|
|
18
|
+
* Single exit-code write path: error-result conditions route through the
|
|
19
|
+
* supplied `setExitCode` callback (`ToolCliContext.setExitCode`) so the CLI keeps
|
|
20
|
+
* its single `process.exitCode` mutator. The findings exit is host-owned
|
|
21
|
+
* (ADR-0035: derived from the envelope verdict in `deliverSignals`). The
|
|
22
|
+
* historical `process.exitCode = N` writes that lived in FitView are
|
|
23
|
+
* gone.
|
|
24
|
+
*/
|
|
25
|
+
import { type FitOptions } from '@opensip-cli/contracts';
|
|
26
|
+
import { type LiveViewContext, type ToolRunCompletion } from '@opensip-cli/core';
|
|
27
|
+
import type { DataStore } from '@opensip-cli/datastore';
|
|
28
|
+
export interface RenderFitLiveOptions {
|
|
29
|
+
readonly setExitCode?: (code: number) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Render the live `fit` view. Resolves once the underlying Ink app exits with a
|
|
33
|
+
* {@link ToolRunCompletion} carrying the run's `envelope` (for root-owned
|
|
34
|
+
* egress) and `session` contribution (which the HOST persists after this
|
|
35
|
+
* resolves — host-owned-run-timing Phase 2; the component no longer writes the
|
|
36
|
+
* session itself).
|
|
37
|
+
*
|
|
38
|
+
* The fitness tool wires this in via `setUpFitLiveView` / `registerLiveView`.
|
|
39
|
+
* `setExitCode` is the single mutator path on `process.exitCode`; the runner
|
|
40
|
+
* calls it for error-result outcomes (the findings exit is host-owned via the
|
|
41
|
+
* delivered envelope verdict, ADR-0035).
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderFitLive(args: FitOptions, contextOrDatastore?: DataStore | LiveViewContext, options?: RenderFitLiveOptions): Promise<ToolRunCompletion>;
|
|
44
|
+
//# sourceMappingURL=fit-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-runner.d.ts","sourceRoot":"","sources":["../../src/cli/fit-runner.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA0BH,OAAO,EACL,KAAK,UAAU,EAIhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEvB,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAsUxD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,UAAU,EAChB,kBAAkB,CAAC,EAAE,SAAS,GAAG,eAAe,EAChD,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAgC5B"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* fit-runner — owns the live-view state machine for `opensip fit`.
|
|
4
|
+
*
|
|
5
|
+
* Layer 5 Phase 3 lifted the fit live view out of `opensip-cli`.
|
|
6
|
+
* The state machine (loading → running → done | error), `executeFit`
|
|
7
|
+
* orchestration, `reportToCloud` post-call, and the Ink/React render
|
|
8
|
+
* tree all live here, in the package that owns the fitness command
|
|
9
|
+
* surface. Adding a fourth tool with a live view requires zero CLI
|
|
10
|
+
* edits — each tool ships its own renderer and registers it via
|
|
11
|
+
* `cli.registerLiveView(key, renderer)`.
|
|
12
|
+
*
|
|
13
|
+
* Shared presentational primitives (Banner, RunHeader, Spinner, theme
|
|
14
|
+
* tokens) come from `@opensip-cli/cli-ui`. Tool-specific render
|
|
15
|
+
* pieces (results table, findings block, cloud-report status) live in
|
|
16
|
+
* `cli/fit-runner-views.tsx`; they're imported here so this module
|
|
17
|
+
* stays focused on the state machine and entry point.
|
|
18
|
+
*
|
|
19
|
+
* Single exit-code write path: error-result conditions route through the
|
|
20
|
+
* supplied `setExitCode` callback (`ToolCliContext.setExitCode`) so the CLI keeps
|
|
21
|
+
* its single `process.exitCode` mutator. The findings exit is host-owned
|
|
22
|
+
* (ADR-0035: derived from the envelope verdict in `deliverSignals`). The
|
|
23
|
+
* historical `process.exitCode = N` writes that lived in FitView are
|
|
24
|
+
* gone.
|
|
25
|
+
*/
|
|
26
|
+
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
27
|
+
import { tmpdir } from 'node:os';
|
|
28
|
+
import { join } from 'node:path';
|
|
29
|
+
import { Banner, ClockProvider, ErrorMessage, LiveProgress, normalizeBannerSize, ProjectHeader, renderToInk, RunFooterHints, RunHeader, RunSummary, RunTimingProvider, ThemeProvider, UpdateHint, VERBOSE_DETAIL_HINT, viewFindingsGroups, } from '@opensip-cli/cli-ui';
|
|
30
|
+
import { runOffThreadOrInProcess, currentScope, } from '@opensip-cli/core';
|
|
31
|
+
import { Box, Static, Text, useApp, render } from 'ink';
|
|
32
|
+
import React, { useEffect, useState } from 'react';
|
|
33
|
+
import { envelopeToFitRows } from './fit/envelope-view.js';
|
|
34
|
+
import { buildFitnessSessionPayload } from './fit/result-builders.js';
|
|
35
|
+
import { ResultsTable, WarningsBlock } from './fit-runner-views.js';
|
|
36
|
+
import { ensureChecksLoaded, executeFit, getEnabledCheckCount } from './fit.js';
|
|
37
|
+
// Theme constants used by tool-specific sub-components below. The shared
|
|
38
|
+
// presentational primitives (Banner, RunHeader, Spinner, ErrorMessage)
|
|
39
|
+
// pull their colors from cli-ui's ThemeProvider; the tool-specific
|
|
40
|
+
// renderers also use useTheme() to stay consistent.
|
|
41
|
+
const FIT_TOOL_TITLE = 'Fitness Checks';
|
|
42
|
+
const FIT_TOOL_DESCRIPTION = 'Scanning your codebase for quality, security, and architecture issues.';
|
|
43
|
+
// Pool-shape surfaces for the shared <LiveProgress> renderer. fit's checks are a
|
|
44
|
+
// dynamic pool (many, counted), not a fixed pipeline — so it renders as one
|
|
45
|
+
// spinner + completed/total counter. The synthetic stage id is 'checks'.
|
|
46
|
+
const FIT_LOADING_SURFACE = { shape: 'pool', label: 'Loading checks...' };
|
|
47
|
+
const FIT_RUNNING_SURFACE = { shape: 'pool', label: 'Running checks...' };
|
|
48
|
+
const NO_PROGRESS = () => {
|
|
49
|
+
// The loading phase has no live event stream yet — LiveProgress renders a bare
|
|
50
|
+
// animated spinner from a no-op subscription.
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Run fit, translating the engine's monotonic (completed, total) callback into
|
|
54
|
+
* pool-shape ProgressEvents on the `'checks'` stage. Hoisted to module scope so
|
|
55
|
+
* the emit translation isn't a 5th-level nested function inside the runner's
|
|
56
|
+
* effect.
|
|
57
|
+
*/
|
|
58
|
+
function executeFitWithProgress(args, emit) {
|
|
59
|
+
emit({ type: 'stage-start', stage: 'checks', label: 'Running checks...' });
|
|
60
|
+
return executeFit(args, {
|
|
61
|
+
onProgress: (completed, total) => emit({ type: 'stage-progress', stage: 'checks', completed, total }),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function FitRunner({ args, setExitCode, onEnvelope, onSession, liveContext, }) {
|
|
65
|
+
const { exit } = useApp();
|
|
66
|
+
const [state, setState] = useState({ phase: 'loading' });
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
let cancelled = false;
|
|
69
|
+
void (async () => {
|
|
70
|
+
// Phase 1: Load checks to get count for header
|
|
71
|
+
await ensureChecksLoaded(args.cwd);
|
|
72
|
+
const checkCount = getEnabledCheckCount();
|
|
73
|
+
if (cancelled)
|
|
74
|
+
return;
|
|
75
|
+
// Execute OFF the main process (ADR-0028): fork the CLI to `fit-run-worker`,
|
|
76
|
+
// which re-bootstraps the full scope and streams progress + the final result
|
|
77
|
+
// over IPC, so this process stays free to animate the spinner + 80ms clock.
|
|
78
|
+
// `runOffThreadOrInProcess` falls back to the in-process closure when forking
|
|
79
|
+
// is disabled/unavailable (OPENSIP_CLI_NO_WORKER) — identical result either
|
|
80
|
+
// way. The worker reads its run spec (the serializable FitOptions) from a
|
|
81
|
+
// temp file we clean up after the run settles.
|
|
82
|
+
const specDir = mkdtempSync(join(tmpdir(), 'fit-worker-'));
|
|
83
|
+
const specPath = join(specDir, 'spec.json');
|
|
84
|
+
writeFileSync(specPath, JSON.stringify(args), 'utf8');
|
|
85
|
+
const run = runOffThreadOrInProcess({
|
|
86
|
+
descriptor: { command: process.argv[1] ?? '', argv: ['fit-run-worker', specPath] },
|
|
87
|
+
inProcess: (emit) => executeFitWithProgress(args, emit),
|
|
88
|
+
});
|
|
89
|
+
setState({ phase: 'running', checkCount, subscribe: run.onProgress });
|
|
90
|
+
let fitResult;
|
|
91
|
+
try {
|
|
92
|
+
fitResult = await run.result;
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
rmSync(specDir, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
if (cancelled)
|
|
98
|
+
return;
|
|
99
|
+
if (fitResult.result.type === 'error') {
|
|
100
|
+
setState({ phase: 'error', result: fitResult.result });
|
|
101
|
+
setExitCode?.(fitResult.result.exitCode);
|
|
102
|
+
setTimeout(() => exit(), 100);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const { result } = fitResult;
|
|
106
|
+
// ADR-0035: the host owns the findings exit. The live renderer returns the
|
|
107
|
+
// envelope to `setUpFitLiveView`, which calls `deliverSignals`; the root
|
|
108
|
+
// sets the exit from `envelope.verdict.passed` there. No setExitCode here.
|
|
109
|
+
// Host-owned persistence (host-owned-run-timing Phase 2): the component no
|
|
110
|
+
// longer writes the session. It surfaces the contribution; the host
|
|
111
|
+
// completes the lifecycle and persists after `renderLive` resolves.
|
|
112
|
+
if (result.envelope) {
|
|
113
|
+
onSession?.({
|
|
114
|
+
tool: 'fit',
|
|
115
|
+
cwd: args.cwd,
|
|
116
|
+
recipe: result.envelope.recipe,
|
|
117
|
+
score: result.envelope.verdict.score,
|
|
118
|
+
passed: result.envelope.verdict.passed,
|
|
119
|
+
payload: buildFitnessSessionPayload(result.envelope),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// Effectful egress (cloud + `--report-to`) lives at the composition root
|
|
123
|
+
// now (ADR-0011): `renderFitLive` returns this envelope and the tool's
|
|
124
|
+
// `registerLiveView` callback delivers it once the Ink app exits.
|
|
125
|
+
onEnvelope?.(result.envelope);
|
|
126
|
+
setState({ phase: 'done', result, checkCount });
|
|
127
|
+
setTimeout(() => exit(), 100);
|
|
128
|
+
})();
|
|
129
|
+
return () => {
|
|
130
|
+
cancelled = true;
|
|
131
|
+
};
|
|
132
|
+
}, []);
|
|
133
|
+
const recipe = args.tags && args.tags.length > 0 ? `tags: ${args.tags.join(',')}` : (args.recipe ?? 'default');
|
|
134
|
+
// Banner + RunHeader both live in <Static> so Ink writes them once above the
|
|
135
|
+
// dynamic redraw region and never touches those bytes again. The dynamic
|
|
136
|
+
// region contains ONLY the things that actually change between frames
|
|
137
|
+
// (spinner during loading/running; summary block during done) — small,
|
|
138
|
+
// stable-width content that Ink can redraw without its line-clear heuristic
|
|
139
|
+
// miscounting and producing overdraw.
|
|
140
|
+
//
|
|
141
|
+
// Static is incremental: items added in later renders are appended below
|
|
142
|
+
// existing static content. We start with just the banner (we don't know
|
|
143
|
+
// checkCount yet during loading), and append the header once checkCount is
|
|
144
|
+
// known. RunHeader's metadata only changes once (when loading→running), and
|
|
145
|
+
// after that it's stable for the rest of the run — perfect Static fit.
|
|
146
|
+
const checkCount = state.phase === 'running' || state.phase === 'done' ? state.checkCount : null;
|
|
147
|
+
const staticItems = computeStaticItems(args.quiet === true, checkCount);
|
|
148
|
+
// Presentation settings resolved once in the pre-action hook. The live
|
|
149
|
+
// view runs inside that scope, so it reads the same banner size + version
|
|
150
|
+
// the static path does. `mini` carries the project path in its box, so we
|
|
151
|
+
// drop the separate ProjectHeader line for it (matches App.tsx) and pass
|
|
152
|
+
// the scope's walkedUp so mini keeps the "(found N levels up)" hint.
|
|
153
|
+
const scope = currentScope();
|
|
154
|
+
const ui = scope?.ui;
|
|
155
|
+
const walkedUp = scope?.projectContext?.walkedUp;
|
|
156
|
+
const bannerSize = normalizeBannerSize(ui?.bannerSize);
|
|
157
|
+
const showProjectHeader = bannerSize !== 'mini';
|
|
158
|
+
const renderStaticItem = (item) => {
|
|
159
|
+
if (item === 'banner') {
|
|
160
|
+
return (_jsxs(React.Fragment, { children: [_jsx(Banner, { size: bannerSize, version: ui?.version, projectPath: args.cwd, walkedUp: walkedUp, update: ui?.update }), bannerSize === 'mini' && ui?.update !== undefined && _jsx(UpdateHint, {}), showProjectHeader && _jsx(ProjectHeader, { root: args.cwd, walkedUp: walkedUp })] }, item));
|
|
161
|
+
}
|
|
162
|
+
const metadata = [
|
|
163
|
+
{ label: 'Recipe', value: recipe },
|
|
164
|
+
{ label: 'Checks', value: String(checkCount) },
|
|
165
|
+
];
|
|
166
|
+
return (_jsx(RunHeader, { tool: FIT_TOOL_TITLE, description: FIT_TOOL_DESCRIPTION, metadata: metadata }, item));
|
|
167
|
+
};
|
|
168
|
+
const staticHeader = _jsx(Static, { items: staticItems, children: renderStaticItem });
|
|
169
|
+
switch (state.phase) {
|
|
170
|
+
case 'loading': {
|
|
171
|
+
return (_jsxs(_Fragment, { children: [staticHeader, _jsx(Box, { paddingTop: 1, children: _jsx(LiveProgress, { surface: FIT_LOADING_SURFACE, subscribe: NO_PROGRESS }) })] }));
|
|
172
|
+
}
|
|
173
|
+
case 'running': {
|
|
174
|
+
return (_jsxs(_Fragment, { children: [staticHeader, _jsx(LiveProgress, { surface: FIT_RUNNING_SURFACE, subscribe: state.subscribe })] }));
|
|
175
|
+
}
|
|
176
|
+
case 'done': {
|
|
177
|
+
const { envelope, verboseDetail } = state.result;
|
|
178
|
+
const { summary } = envelope.verdict;
|
|
179
|
+
// Host-owned timing (via provider from liveContext or outer host wrap):
|
|
180
|
+
// omit explicit durationMs so RunSummary reads from RunTimingProvider.
|
|
181
|
+
// The displayed Duration now matches the value stamped into StoredSession
|
|
182
|
+
// by the host RunTimer at record time.
|
|
183
|
+
// ADR-0021: the verbose surface is driven by args.verbose alone. The
|
|
184
|
+
// detail body renders through the shared viewFindingsGroups producer (same
|
|
185
|
+
// path as the static `fit --verbose | cat` render), not the retired local
|
|
186
|
+
// FindingsBlock.
|
|
187
|
+
const findingsDetail = verboseDetail?.kind === 'findings' && verboseDetail.groups.length > 0
|
|
188
|
+
? verboseDetail
|
|
189
|
+
: undefined;
|
|
190
|
+
const summaryEl = (_jsx(RunSummary, { passed: envelope.verdict.passed, errors: summary.errors, warnings: summary.warnings }));
|
|
191
|
+
const timedSummary = liveContext?.runSession ? (_jsx(RunTimingProvider, { timer: liveContext.runSession.timing, children: summaryEl })) : (summaryEl);
|
|
192
|
+
return (_jsxs(_Fragment, { children: [staticHeader, _jsxs(Box, { flexDirection: "column", children: [!args.quiet && args.verbose === true && (_jsx(Box, { paddingTop: 1, flexDirection: "column", children: _jsx(ResultsTable, { rows: envelopeToFitRows(envelope) }) })), timedSummary, !args.quiet && state.result.warnings && state.result.warnings.length > 0 && (_jsx(WarningsBlock, { warnings: state.result.warnings })), !args.quiet && findingsDetail !== undefined && (_jsx(Box, { children: renderToInk(viewFindingsGroups(findingsDetail.groups)) })), !args.quiet && args.verbose !== true && (_jsx(RunFooterHints, { hints: [
|
|
193
|
+
VERBOSE_DETAIL_HINT,
|
|
194
|
+
{
|
|
195
|
+
text: 'opensip report for HTML report',
|
|
196
|
+
bold: ['opensip report'],
|
|
197
|
+
},
|
|
198
|
+
] })), !args.quiet && state.result.configFound === false && (_jsx(Box, { paddingLeft: 2, children: _jsxs(Text, { dimColor: true, children: ["No config file found. Run ", _jsx(Text, { bold: true, children: "opensip init" }), " to customize targets and settings."] }) }))] })] }));
|
|
199
|
+
}
|
|
200
|
+
case 'error': {
|
|
201
|
+
return _jsx(ErrorMessage, { message: state.result.message, suggestion: state.result.suggestion });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Compute the Static items list for the current frame. Items are append-only:
|
|
207
|
+
* `'banner'` is present once the run starts; `'header'` joins once checkCount
|
|
208
|
+
* is known (after loading). In quiet mode, the list stays empty so the Static
|
|
209
|
+
* tree renders nothing.
|
|
210
|
+
*/
|
|
211
|
+
function computeStaticItems(quiet, checkCount) {
|
|
212
|
+
if (quiet)
|
|
213
|
+
return [];
|
|
214
|
+
if (checkCount === null)
|
|
215
|
+
return ['banner'];
|
|
216
|
+
return ['banner', 'header'];
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Render the live `fit` view. Resolves once the underlying Ink app exits with a
|
|
220
|
+
* {@link ToolRunCompletion} carrying the run's `envelope` (for root-owned
|
|
221
|
+
* egress) and `session` contribution (which the HOST persists after this
|
|
222
|
+
* resolves — host-owned-run-timing Phase 2; the component no longer writes the
|
|
223
|
+
* session itself).
|
|
224
|
+
*
|
|
225
|
+
* The fitness tool wires this in via `setUpFitLiveView` / `registerLiveView`.
|
|
226
|
+
* `setExitCode` is the single mutator path on `process.exitCode`; the runner
|
|
227
|
+
* calls it for error-result outcomes (the findings exit is host-owned via the
|
|
228
|
+
* delivered envelope verdict, ADR-0035).
|
|
229
|
+
*/
|
|
230
|
+
export async function renderFitLive(args, contextOrDatastore, options) {
|
|
231
|
+
let envelope;
|
|
232
|
+
let session;
|
|
233
|
+
// A raw DataStore arm is accepted for backward compat but no longer threaded
|
|
234
|
+
// (the host owns persistence). Only a LiveViewContext is forwarded.
|
|
235
|
+
const liveContext = contextOrDatastore && contextOrDatastore.runSession
|
|
236
|
+
? contextOrDatastore
|
|
237
|
+
: undefined;
|
|
238
|
+
const app = render(_jsx(ThemeProvider, { children: _jsx(ClockProvider, { children: _jsx(FitRunner, { args: args, setExitCode: options?.setExitCode, onEnvelope: (e) => {
|
|
239
|
+
envelope = e;
|
|
240
|
+
}, onSession: (c) => {
|
|
241
|
+
session = c;
|
|
242
|
+
}, liveContext: liveContext }) }) }));
|
|
243
|
+
await app.waitUntilExit();
|
|
244
|
+
// Trailing newline so shell prompt starts on a new line.
|
|
245
|
+
process.stdout.write('\n');
|
|
246
|
+
// host-owned-run-timing Phase 3: the host persists the returned session
|
|
247
|
+
// contribution after this live renderer resolves.
|
|
248
|
+
return { envelope, session };
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=fit-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-runner.js","sourceRoot":"","sources":["../../src/cli/fit-runner.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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,EACL,MAAM,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,CAAC,IAAI,CAAC,CAAC;IAC3B,wEAAwE;IACxE,kDAAkD;IAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fit-run-worker <specPath>` — the headless fit run forked by the live view
|
|
3
|
+
* (ADR-0028). The live runner forks `node <cliScript> fit-run-worker <spec>`;
|
|
4
|
+
* because it runs through the full CLI bootstrap, the language + tool registries,
|
|
5
|
+
* project, and config are populated in scope exactly as a normal `fit` run — so
|
|
6
|
+
* results are byte-identical (the reason this is a forked subcommand, not a
|
|
7
|
+
* worker thread).
|
|
8
|
+
*
|
|
9
|
+
* It is headless: instead of rendering, it streams the engine's progress and its
|
|
10
|
+
* final result over the fork IPC channel (`process.send`) as {@link WorkerMessage}s,
|
|
11
|
+
* which the parent's subprocess transport relays to the shared `<LiveProgress>`
|
|
12
|
+
* renderer. Persistence + egress stay on the parent (the engine is
|
|
13
|
+
* persistence-free; Phase 2) — the worker only computes.
|
|
14
|
+
*
|
|
15
|
+
* Internal command — not user-facing; the live runner is its only caller.
|
|
16
|
+
*/
|
|
17
|
+
import { type CommandSpec, type ToolCliContext } from '@opensip-cli/core';
|
|
18
|
+
/**
|
|
19
|
+
* Read the {@link FitOptions} spec, run `executeFit` headless, and stream progress
|
|
20
|
+
* + the final result over IPC. Never throws to the caller — a failure is sent as
|
|
21
|
+
* a `{ kind: 'error' }` message so the parent's `result` promise rejects cleanly.
|
|
22
|
+
*/
|
|
23
|
+
export declare function executeFitWorker(specPath: string): Promise<void>;
|
|
24
|
+
/** `fit-run-worker` — [internal] headless fit run, IPC progress/result. */
|
|
25
|
+
export declare const fitRunWorkerCommandSpec: CommandSpec<unknown, ToolCliContext>;
|
|
26
|
+
//# sourceMappingURL=fit-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fit-worker.d.ts","sourceRoot":"","sources":["../../src/cli/fit-worker.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAgB3B;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBtE;AAED,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,OAAO,EAAE,cAAc,CAgBvE,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @fitness-ignore-file detached-promises -- this worker's `send()` helper is synchronous (it calls process.send, which returns immediately); the name-based heuristic mistakes the floating send(...) IPC posts for promise-returning calls. The one genuine async call (executeFit) is awaited.
|
|
2
|
+
/**
|
|
3
|
+
* `fit-run-worker <specPath>` — the headless fit run forked by the live view
|
|
4
|
+
* (ADR-0028). The live runner forks `node <cliScript> fit-run-worker <spec>`;
|
|
5
|
+
* because it runs through the full CLI bootstrap, the language + tool registries,
|
|
6
|
+
* project, and config are populated in scope exactly as a normal `fit` run — so
|
|
7
|
+
* results are byte-identical (the reason this is a forked subcommand, not a
|
|
8
|
+
* worker thread).
|
|
9
|
+
*
|
|
10
|
+
* It is headless: instead of rendering, it streams the engine's progress and its
|
|
11
|
+
* final result over the fork IPC channel (`process.send`) as {@link WorkerMessage}s,
|
|
12
|
+
* which the parent's subprocess transport relays to the shared `<LiveProgress>`
|
|
13
|
+
* renderer. Persistence + egress stay on the parent (the engine is
|
|
14
|
+
* persistence-free; Phase 2) — the worker only computes.
|
|
15
|
+
*
|
|
16
|
+
* Internal command — not user-facing; the live runner is its only caller.
|
|
17
|
+
*/
|
|
18
|
+
import { readFileSync } from 'node:fs';
|
|
19
|
+
import { defineCommand, } from '@opensip-cli/core';
|
|
20
|
+
import { executeFit } from './fit.js';
|
|
21
|
+
/** Post one IPC message to the parent (no-op when not forked). */
|
|
22
|
+
function send(msg) {
|
|
23
|
+
process.send?.(msg);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Read the {@link FitOptions} spec, run `executeFit` headless, and stream progress
|
|
27
|
+
* + the final result over IPC. Never throws to the caller — a failure is sent as
|
|
28
|
+
* a `{ kind: 'error' }` message so the parent's `result` promise rejects cleanly.
|
|
29
|
+
*/
|
|
30
|
+
export async function executeFitWorker(specPath) {
|
|
31
|
+
try {
|
|
32
|
+
const args = JSON.parse(readFileSync(specPath, 'utf8'));
|
|
33
|
+
send({
|
|
34
|
+
kind: 'progress',
|
|
35
|
+
event: { type: 'stage-start', stage: 'checks', label: 'Running checks...' },
|
|
36
|
+
});
|
|
37
|
+
const fitResult = await executeFit(args, {
|
|
38
|
+
onProgress: (completed, total) => send({
|
|
39
|
+
kind: 'progress',
|
|
40
|
+
event: { type: 'stage-progress', stage: 'checks', completed, total },
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
send({ kind: 'result', value: fitResult });
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
send({
|
|
47
|
+
kind: 'error',
|
|
48
|
+
message: error instanceof Error ? error.message : String(error),
|
|
49
|
+
...(error instanceof Error && error.stack !== undefined ? { stack: error.stack } : {}),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** `fit-run-worker` — [internal] headless fit run, IPC progress/result. */
|
|
54
|
+
export const fitRunWorkerCommandSpec = defineCommand({
|
|
55
|
+
name: 'fit-run-worker',
|
|
56
|
+
description: '[internal] Run fit headless and stream progress + result over IPC (forked by the live view)',
|
|
57
|
+
commonFlags: [],
|
|
58
|
+
args: [{ name: 'specPath', description: 'Path to a JSON FitOptions spec file' }],
|
|
59
|
+
scope: 'project',
|
|
60
|
+
output: 'raw-stream',
|
|
61
|
+
rawStreamReason: 'worker-ipc',
|
|
62
|
+
handler: async (rawOpts) => {
|
|
63
|
+
const specPath = rawOpts._args?.[0] ?? '';
|
|
64
|
+
await executeFitWorker(specPath);
|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