@untangle-code/cli 0.0.0-stage → 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 +661 -0
- package/NOTICE +90 -0
- package/README.md +424 -2
- package/THIRD_PARTY_LICENSES.md +152 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +167 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/command.d.ts +69 -0
- package/dist/cli/command.d.ts.map +1 -0
- package/dist/cli/command.js +82 -0
- package/dist/cli/command.js.map +1 -0
- package/dist/cli/deadline.d.ts +33 -0
- package/dist/cli/deadline.d.ts.map +1 -0
- package/dist/cli/deadline.js +49 -0
- package/dist/cli/deadline.js.map +1 -0
- package/dist/cli/embedder-deadline.d.ts +72 -0
- package/dist/cli/embedder-deadline.d.ts.map +1 -0
- package/dist/cli/embedder-deadline.js +117 -0
- package/dist/cli/embedder-deadline.js.map +1 -0
- package/dist/cli/exit.d.ts +71 -0
- package/dist/cli/exit.d.ts.map +1 -0
- package/dist/cli/exit.js +81 -0
- package/dist/cli/exit.js.map +1 -0
- package/dist/cli/graphs.d.ts +65 -0
- package/dist/cli/graphs.d.ts.map +1 -0
- package/dist/cli/graphs.js +108 -0
- package/dist/cli/graphs.js.map +1 -0
- package/dist/cli/index-freshness.d.ts +13 -0
- package/dist/cli/index-freshness.d.ts.map +1 -0
- package/dist/cli/index-freshness.js +226 -0
- package/dist/cli/index-freshness.js.map +1 -0
- package/dist/cli/index-refresh.d.ts +10 -0
- package/dist/cli/index-refresh.d.ts.map +1 -0
- package/dist/cli/index-refresh.js +76 -0
- package/dist/cli/index-refresh.js.map +1 -0
- package/dist/cli/index-state.d.ts +184 -0
- package/dist/cli/index-state.d.ts.map +1 -0
- package/dist/cli/index-state.js +852 -0
- package/dist/cli/index-state.js.map +1 -0
- package/dist/cli/io.d.ts +29 -0
- package/dist/cli/io.d.ts.map +1 -0
- package/dist/cli/io.js +42 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/language-support.d.ts +77 -0
- package/dist/cli/language-support.d.ts.map +1 -0
- package/dist/cli/language-support.js +152 -0
- package/dist/cli/language-support.js.map +1 -0
- package/dist/cli/renewing-lease.d.ts +26 -0
- package/dist/cli/renewing-lease.d.ts.map +1 -0
- package/dist/cli/renewing-lease.js +102 -0
- package/dist/cli/renewing-lease.js.map +1 -0
- package/dist/cli/search-graph-enrichment.d.ts +16 -0
- package/dist/cli/search-graph-enrichment.d.ts.map +1 -0
- package/dist/cli/search-graph-enrichment.js +428 -0
- package/dist/cli/search-graph-enrichment.js.map +1 -0
- package/dist/cli/system.d.ts +34 -0
- package/dist/cli/system.d.ts.map +1 -0
- package/dist/cli/system.js +89 -0
- package/dist/cli/system.js.map +1 -0
- package/dist/cli/vector-store-policy.d.ts +116 -0
- package/dist/cli/vector-store-policy.d.ts.map +1 -0
- package/dist/cli/vector-store-policy.js +160 -0
- package/dist/cli/vector-store-policy.js.map +1 -0
- package/dist/cli/version.d.ts +3 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +3 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli/workspace.d.ts +105 -0
- package/dist/cli/workspace.d.ts.map +1 -0
- package/dist/cli/workspace.js +215 -0
- package/dist/cli/workspace.js.map +1 -0
- package/dist/commands/complexity.d.ts +72 -0
- package/dist/commands/complexity.d.ts.map +1 -0
- package/dist/commands/complexity.js +580 -0
- package/dist/commands/complexity.js.map +1 -0
- package/dist/commands/doctor.d.ts +66 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +764 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/doctor.languages.d.ts +37 -0
- package/dist/commands/doctor.languages.d.ts.map +1 -0
- package/dist/commands/doctor.languages.js +143 -0
- package/dist/commands/doctor.languages.js.map +1 -0
- package/dist/commands/doctor.storage.d.ts +17 -0
- package/dist/commands/doctor.storage.d.ts.map +1 -0
- package/dist/commands/doctor.storage.js +91 -0
- package/dist/commands/doctor.storage.js.map +1 -0
- package/dist/commands/extensions/add.d.ts +10 -0
- package/dist/commands/extensions/add.d.ts.map +1 -0
- package/dist/commands/extensions/add.js +213 -0
- package/dist/commands/extensions/add.js.map +1 -0
- package/dist/commands/extensions/configure.d.ts +5 -0
- package/dist/commands/extensions/configure.d.ts.map +1 -0
- package/dist/commands/extensions/configure.js +58 -0
- package/dist/commands/extensions/configure.js.map +1 -0
- package/dist/commands/extensions/container.d.ts +15 -0
- package/dist/commands/extensions/container.d.ts.map +1 -0
- package/dist/commands/extensions/container.js +135 -0
- package/dist/commands/extensions/container.js.map +1 -0
- package/dist/commands/extensions/context.d.ts +37 -0
- package/dist/commands/extensions/context.d.ts.map +1 -0
- package/dist/commands/extensions/context.js +72 -0
- package/dist/commands/extensions/context.js.map +1 -0
- package/dist/commands/extensions/enable.d.ts +6 -0
- package/dist/commands/extensions/enable.d.ts.map +1 -0
- package/dist/commands/extensions/enable.js +180 -0
- package/dist/commands/extensions/enable.js.map +1 -0
- package/dist/commands/extensions/environment.d.ts +74 -0
- package/dist/commands/extensions/environment.d.ts.map +1 -0
- package/dist/commands/extensions/environment.js +168 -0
- package/dist/commands/extensions/environment.js.map +1 -0
- package/dist/commands/extensions/feature-scan.d.ts +48 -0
- package/dist/commands/extensions/feature-scan.d.ts.map +1 -0
- package/dist/commands/extensions/feature-scan.js +156 -0
- package/dist/commands/extensions/feature-scan.js.map +1 -0
- package/dist/commands/extensions/invoke.d.ts +60 -0
- package/dist/commands/extensions/invoke.d.ts.map +1 -0
- package/dist/commands/extensions/invoke.js +275 -0
- package/dist/commands/extensions/invoke.js.map +1 -0
- package/dist/commands/extensions/list.d.ts +5 -0
- package/dist/commands/extensions/list.d.ts.map +1 -0
- package/dist/commands/extensions/list.js +125 -0
- package/dist/commands/extensions/list.js.map +1 -0
- package/dist/commands/extensions/logs.d.ts +5 -0
- package/dist/commands/extensions/logs.d.ts.map +1 -0
- package/dist/commands/extensions/logs.js +74 -0
- package/dist/commands/extensions/logs.js.map +1 -0
- package/dist/commands/extensions/provision.d.ts +36 -0
- package/dist/commands/extensions/provision.d.ts.map +1 -0
- package/dist/commands/extensions/provision.js +137 -0
- package/dist/commands/extensions/provision.js.map +1 -0
- package/dist/commands/extensions/remove.d.ts +5 -0
- package/dist/commands/extensions/remove.d.ts.map +1 -0
- package/dist/commands/extensions/remove.js +77 -0
- package/dist/commands/extensions/remove.js.map +1 -0
- package/dist/commands/extensions/render.d.ts +16 -0
- package/dist/commands/extensions/render.d.ts.map +1 -0
- package/dist/commands/extensions/render.js +25 -0
- package/dist/commands/extensions/render.js.map +1 -0
- package/dist/commands/extensions/run.d.ts +30 -0
- package/dist/commands/extensions/run.d.ts.map +1 -0
- package/dist/commands/extensions/run.js +292 -0
- package/dist/commands/extensions/run.js.map +1 -0
- package/dist/commands/extensions/secret-store.d.ts +15 -0
- package/dist/commands/extensions/secret-store.d.ts.map +1 -0
- package/dist/commands/extensions/secret-store.js +164 -0
- package/dist/commands/extensions/secret-store.js.map +1 -0
- package/dist/commands/extensions/setup.d.ts +17 -0
- package/dist/commands/extensions/setup.d.ts.map +1 -0
- package/dist/commands/extensions/setup.js +94 -0
- package/dist/commands/extensions/setup.js.map +1 -0
- package/dist/commands/extensions/source.d.ts +47 -0
- package/dist/commands/extensions/source.d.ts.map +1 -0
- package/dist/commands/extensions/source.js +142 -0
- package/dist/commands/extensions/source.js.map +1 -0
- package/dist/commands/extensions/state.d.ts +62 -0
- package/dist/commands/extensions/state.d.ts.map +1 -0
- package/dist/commands/extensions/state.js +177 -0
- package/dist/commands/extensions/state.js.map +1 -0
- package/dist/commands/extensions/status.d.ts +9 -0
- package/dist/commands/extensions/status.d.ts.map +1 -0
- package/dist/commands/extensions/status.js +239 -0
- package/dist/commands/extensions/status.js.map +1 -0
- package/dist/commands/extensions.d.ts +3 -0
- package/dist/commands/extensions.d.ts.map +1 -0
- package/dist/commands/extensions.js +223 -0
- package/dist/commands/extensions.js.map +1 -0
- package/dist/commands/flow/index.d.ts +3 -0
- package/dist/commands/flow/index.d.ts.map +1 -0
- package/dist/commands/flow/index.js +295 -0
- package/dist/commands/flow/index.js.map +1 -0
- package/dist/commands/flow/limits.d.ts +12 -0
- package/dist/commands/flow/limits.d.ts.map +1 -0
- package/dist/commands/flow/limits.js +13 -0
- package/dist/commands/flow/limits.js.map +1 -0
- package/dist/commands/flow/output.d.ts +8 -0
- package/dist/commands/flow/output.d.ts.map +1 -0
- package/dist/commands/flow/output.js +11 -0
- package/dist/commands/flow/output.js.map +1 -0
- package/dist/commands/flow/render.d.ts +51 -0
- package/dist/commands/flow/render.d.ts.map +1 -0
- package/dist/commands/flow/render.js +220 -0
- package/dist/commands/flow/render.js.map +1 -0
- package/dist/commands/flow/select.d.ts +31 -0
- package/dist/commands/flow/select.d.ts.map +1 -0
- package/dist/commands/flow/select.js +62 -0
- package/dist/commands/flow/select.js.map +1 -0
- package/dist/commands/graph/boundaries-input.d.ts +26 -0
- package/dist/commands/graph/boundaries-input.d.ts.map +1 -0
- package/dist/commands/graph/boundaries-input.js +54 -0
- package/dist/commands/graph/boundaries-input.js.map +1 -0
- package/dist/commands/graph/boundaries.d.ts +4 -0
- package/dist/commands/graph/boundaries.d.ts.map +1 -0
- package/dist/commands/graph/boundaries.js +141 -0
- package/dist/commands/graph/boundaries.js.map +1 -0
- package/dist/commands/graph/bounds.d.ts +16 -0
- package/dist/commands/graph/bounds.d.ts.map +1 -0
- package/dist/commands/graph/bounds.js +22 -0
- package/dist/commands/graph/bounds.js.map +1 -0
- package/dist/commands/graph/category-clusters.d.ts +20 -0
- package/dist/commands/graph/category-clusters.d.ts.map +1 -0
- package/dist/commands/graph/category-clusters.js +158 -0
- package/dist/commands/graph/category-clusters.js.map +1 -0
- package/dist/commands/graph/feature-3d.d.ts +22 -0
- package/dist/commands/graph/feature-3d.d.ts.map +1 -0
- package/dist/commands/graph/feature-3d.js +114 -0
- package/dist/commands/graph/feature-3d.js.map +1 -0
- package/dist/commands/graph/feature-clusters.d.ts +17 -0
- package/dist/commands/graph/feature-clusters.d.ts.map +1 -0
- package/dist/commands/graph/feature-clusters.js +94 -0
- package/dist/commands/graph/feature-clusters.js.map +1 -0
- package/dist/commands/graph/feature-html.d.ts +26 -0
- package/dist/commands/graph/feature-html.d.ts.map +1 -0
- package/dist/commands/graph/feature-html.js +314 -0
- package/dist/commands/graph/feature-html.js.map +1 -0
- package/dist/commands/graph/feature-map.d.ts +31 -0
- package/dist/commands/graph/feature-map.d.ts.map +1 -0
- package/dist/commands/graph/feature-map.js +217 -0
- package/dist/commands/graph/feature-map.js.map +1 -0
- package/dist/commands/graph/feature-model.d.ts +55 -0
- package/dist/commands/graph/feature-model.d.ts.map +1 -0
- package/dist/commands/graph/feature-model.js +167 -0
- package/dist/commands/graph/feature-model.js.map +1 -0
- package/dist/commands/graph/feature-untangle-motion.d.ts +33 -0
- package/dist/commands/graph/feature-untangle-motion.d.ts.map +1 -0
- package/dist/commands/graph/feature-untangle-motion.js +155 -0
- package/dist/commands/graph/feature-untangle-motion.js.map +1 -0
- package/dist/commands/graph/index.d.ts +3 -0
- package/dist/commands/graph/index.d.ts.map +1 -0
- package/dist/commands/graph/index.js +414 -0
- package/dist/commands/graph/index.js.map +1 -0
- package/dist/commands/graph/render.d.ts +63 -0
- package/dist/commands/graph/render.d.ts.map +1 -0
- package/dist/commands/graph/render.js +352 -0
- package/dist/commands/graph/render.js.map +1 -0
- package/dist/commands/graph/select.d.ts +34 -0
- package/dist/commands/graph/select.d.ts.map +1 -0
- package/dist/commands/graph/select.js +55 -0
- package/dist/commands/graph/select.js.map +1 -0
- package/dist/commands/index/index.d.ts +6 -0
- package/dist/commands/index/index.d.ts.map +1 -0
- package/dist/commands/index/index.js +461 -0
- package/dist/commands/index/index.js.map +1 -0
- package/dist/commands/index/render.d.ts +53 -0
- package/dist/commands/index/render.d.ts.map +1 -0
- package/dist/commands/index/render.js +205 -0
- package/dist/commands/index/render.js.map +1 -0
- package/dist/commands/index/target.d.ts +34 -0
- package/dist/commands/index/target.d.ts.map +1 -0
- package/dist/commands/index/target.js +97 -0
- package/dist/commands/index/target.js.map +1 -0
- package/dist/commands/index-watch.d.ts +30 -0
- package/dist/commands/index-watch.d.ts.map +1 -0
- package/dist/commands/index-watch.js +138 -0
- package/dist/commands/index-watch.js.map +1 -0
- package/dist/commands/init/command.d.ts +25 -0
- package/dist/commands/init/command.d.ts.map +1 -0
- package/dist/commands/init/command.js +198 -0
- package/dist/commands/init/command.js.map +1 -0
- package/dist/commands/init/config-draft.d.ts +48 -0
- package/dist/commands/init/config-draft.d.ts.map +1 -0
- package/dist/commands/init/config-draft.js +201 -0
- package/dist/commands/init/config-draft.js.map +1 -0
- package/dist/commands/init/diff.d.ts +33 -0
- package/dist/commands/init/diff.d.ts.map +1 -0
- package/dist/commands/init/diff.js +109 -0
- package/dist/commands/init/diff.js.map +1 -0
- package/dist/commands/init/http-probe.d.ts +26 -0
- package/dist/commands/init/http-probe.d.ts.map +1 -0
- package/dist/commands/init/http-probe.js +144 -0
- package/dist/commands/init/http-probe.js.map +1 -0
- package/dist/commands/init/ignore-rules.d.ts +70 -0
- package/dist/commands/init/ignore-rules.d.ts.map +1 -0
- package/dist/commands/init/ignore-rules.js +146 -0
- package/dist/commands/init/ignore-rules.js.map +1 -0
- package/dist/commands/init/index.d.ts +33 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/init/index.js +32 -0
- package/dist/commands/init/index.js.map +1 -0
- package/dist/commands/init/integrations-apply.d.ts +50 -0
- package/dist/commands/init/integrations-apply.d.ts.map +1 -0
- package/dist/commands/init/integrations-apply.js +452 -0
- package/dist/commands/init/integrations-apply.js.map +1 -0
- package/dist/commands/init/integrations-plan.d.ts +68 -0
- package/dist/commands/init/integrations-plan.d.ts.map +1 -0
- package/dist/commands/init/integrations-plan.js +515 -0
- package/dist/commands/init/integrations-plan.js.map +1 -0
- package/dist/commands/init/integrations.d.ts +5 -0
- package/dist/commands/init/integrations.d.ts.map +1 -0
- package/dist/commands/init/integrations.js +4 -0
- package/dist/commands/init/integrations.js.map +1 -0
- package/dist/commands/init/languages.d.ts +55 -0
- package/dist/commands/init/languages.d.ts.map +1 -0
- package/dist/commands/init/languages.js +245 -0
- package/dist/commands/init/languages.js.map +1 -0
- package/dist/commands/init/product-context.d.ts +63 -0
- package/dist/commands/init/product-context.d.ts.map +1 -0
- package/dist/commands/init/product-context.js +390 -0
- package/dist/commands/init/product-context.js.map +1 -0
- package/dist/commands/init/render.d.ts +38 -0
- package/dist/commands/init/render.d.ts.map +1 -0
- package/dist/commands/init/render.js +501 -0
- package/dist/commands/init/render.js.map +1 -0
- package/dist/commands/init/report.d.ts +24 -0
- package/dist/commands/init/report.d.ts.map +1 -0
- package/dist/commands/init/report.js +163 -0
- package/dist/commands/init/report.js.map +1 -0
- package/dist/commands/init/run.d.ts +71 -0
- package/dist/commands/init/run.d.ts.map +1 -0
- package/dist/commands/init/run.js +253 -0
- package/dist/commands/init/run.js.map +1 -0
- package/dist/commands/init/services.d.ts +82 -0
- package/dist/commands/init/services.d.ts.map +1 -0
- package/dist/commands/init/services.js +209 -0
- package/dist/commands/init/services.js.map +1 -0
- package/dist/commands/init/storage.d.ts +8 -0
- package/dist/commands/init/storage.d.ts.map +1 -0
- package/dist/commands/init/storage.js +102 -0
- package/dist/commands/init/storage.js.map +1 -0
- package/dist/commands/init/toml.d.ts +65 -0
- package/dist/commands/init/toml.d.ts.map +1 -0
- package/dist/commands/init/toml.js +159 -0
- package/dist/commands/init/toml.js.map +1 -0
- package/dist/commands/init/topology.d.ts +54 -0
- package/dist/commands/init/topology.d.ts.map +1 -0
- package/dist/commands/init/topology.js +146 -0
- package/dist/commands/init/topology.js.map +1 -0
- package/dist/commands/init/types.d.ts +334 -0
- package/dist/commands/init/types.d.ts.map +1 -0
- package/dist/commands/init/types.js +31 -0
- package/dist/commands/init/types.js.map +1 -0
- package/dist/commands/init/wizard-terminal.d.ts +36 -0
- package/dist/commands/init/wizard-terminal.d.ts.map +1 -0
- package/dist/commands/init/wizard-terminal.js +163 -0
- package/dist/commands/init/wizard-terminal.js.map +1 -0
- package/dist/commands/init/wizard.d.ts +25 -0
- package/dist/commands/init/wizard.d.ts.map +1 -0
- package/dist/commands/init/wizard.js +358 -0
- package/dist/commands/init/wizard.js.map +1 -0
- package/dist/commands/mcp.d.ts +4 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +111 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/product-test-runner.d.ts +4 -0
- package/dist/commands/product-test-runner.d.ts.map +1 -0
- package/dist/commands/product-test-runner.js +85 -0
- package/dist/commands/product-test-runner.js.map +1 -0
- package/dist/commands/product.d.ts +16 -0
- package/dist/commands/product.d.ts.map +1 -0
- package/dist/commands/product.js +262 -0
- package/dist/commands/product.js.map +1 -0
- package/dist/commands/query.d.ts +114 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +783 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/scan.d.ts +10 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +302 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/sdd.d.ts +24 -0
- package/dist/commands/sdd.d.ts.map +1 -0
- package/dist/commands/sdd.js +195 -0
- package/dist/commands/sdd.js.map +1 -0
- package/dist/commands/unavailable.d.ts +40 -0
- package/dist/commands/unavailable.d.ts.map +1 -0
- package/dist/commands/unavailable.js +73 -0
- package/dist/commands/unavailable.js.map +1 -0
- package/dist/commands/watch/analyze.d.ts +69 -0
- package/dist/commands/watch/analyze.d.ts.map +1 -0
- package/dist/commands/watch/analyze.js +402 -0
- package/dist/commands/watch/analyze.js.map +1 -0
- package/dist/commands/watch/cli.d.ts +8 -0
- package/dist/commands/watch/cli.d.ts.map +1 -0
- package/dist/commands/watch/cli.js +97 -0
- package/dist/commands/watch/cli.js.map +1 -0
- package/dist/commands/watch/delta.d.ts +46 -0
- package/dist/commands/watch/delta.d.ts.map +1 -0
- package/dist/commands/watch/delta.js +170 -0
- package/dist/commands/watch/delta.js.map +1 -0
- package/dist/commands/watch/events.d.ts +214 -0
- package/dist/commands/watch/events.d.ts.map +1 -0
- package/dist/commands/watch/events.js +13 -0
- package/dist/commands/watch/events.js.map +1 -0
- package/dist/commands/watch/index.d.ts +19 -0
- package/dist/commands/watch/index.d.ts.map +1 -0
- package/dist/commands/watch/index.js +15 -0
- package/dist/commands/watch/index.js.map +1 -0
- package/dist/commands/watch/options.d.ts +43 -0
- package/dist/commands/watch/options.d.ts.map +1 -0
- package/dist/commands/watch/options.js +193 -0
- package/dist/commands/watch/options.js.map +1 -0
- package/dist/commands/watch/render.d.ts +26 -0
- package/dist/commands/watch/render.d.ts.map +1 -0
- package/dist/commands/watch/render.js +175 -0
- package/dist/commands/watch/render.js.map +1 -0
- package/dist/commands/watch/run.d.ts +14 -0
- package/dist/commands/watch/run.d.ts.map +1 -0
- package/dist/commands/watch/run.js +460 -0
- package/dist/commands/watch/run.js.map +1 -0
- package/dist/commands/watch/runtime.d.ts +67 -0
- package/dist/commands/watch/runtime.d.ts.map +1 -0
- package/dist/commands/watch/runtime.js +149 -0
- package/dist/commands/watch/runtime.js.map +1 -0
- package/dist/commands/watch-command.d.ts +3 -0
- package/dist/commands/watch-command.d.ts.map +1 -0
- package/dist/commands/watch-command.js +273 -0
- package/dist/commands/watch-command.js.map +1 -0
- package/dist/entry-point.d.ts +11 -0
- package/dist/entry-point.d.ts.map +1 -0
- package/dist/entry-point.js +65 -0
- package/dist/entry-point.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +245 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/boundaries-schema.d.ts +262 -0
- package/dist/mcp/boundaries-schema.d.ts.map +1 -0
- package/dist/mcp/boundaries-schema.js +183 -0
- package/dist/mcp/boundaries-schema.js.map +1 -0
- package/dist/mcp/default-runtime.d.ts +16 -0
- package/dist/mcp/default-runtime.d.ts.map +1 -0
- package/dist/mcp/default-runtime.js +718 -0
- package/dist/mcp/default-runtime.js.map +1 -0
- package/dist/mcp/envelope.d.ts +13 -0
- package/dist/mcp/envelope.d.ts.map +1 -0
- package/dist/mcp/envelope.js +29 -0
- package/dist/mcp/envelope.js.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/output-schemas.d.ts +5928 -0
- package/dist/mcp/output-schemas.d.ts.map +1 -0
- package/dist/mcp/output-schemas.js +2814 -0
- package/dist/mcp/output-schemas.js.map +1 -0
- package/dist/mcp/path-sandbox.d.ts +35 -0
- package/dist/mcp/path-sandbox.d.ts.map +1 -0
- package/dist/mcp/path-sandbox.js +128 -0
- package/dist/mcp/path-sandbox.js.map +1 -0
- package/dist/mcp/server.d.ts +155 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +257 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/stdio.d.ts +20 -0
- package/dist/mcp/stdio.d.ts.map +1 -0
- package/dist/mcp/stdio.js +71 -0
- package/dist/mcp/stdio.js.map +1 -0
- package/dist/mcp/tools.d.ts +355 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +319 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +15 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +45 -0
- package/dist/mcp/types.js.map +1 -0
- package/package.json +99 -3
- package/src/cli/args.ts +231 -0
- package/src/cli/command.ts +146 -0
- package/src/cli/deadline.ts +56 -0
- package/src/cli/embedder-deadline.ts +187 -0
- package/src/cli/exit.ts +94 -0
- package/src/cli/graphs.ts +191 -0
- package/src/cli/index-freshness.ts +303 -0
- package/src/cli/index-refresh.ts +125 -0
- package/src/cli/index-state.ts +1217 -0
- package/src/cli/io.ts +56 -0
- package/src/cli/language-support.ts +203 -0
- package/src/cli/renewing-lease.ts +121 -0
- package/src/cli/search-graph-enrichment.ts +639 -0
- package/src/cli/system.ts +94 -0
- package/src/cli/vector-store-policy.ts +213 -0
- package/src/cli/version.ts +2 -0
- package/src/cli/workspace.ts +324 -0
- package/src/commands/complexity.ts +776 -0
- package/src/commands/doctor.languages.ts +187 -0
- package/src/commands/doctor.storage.ts +124 -0
- package/src/commands/doctor.ts +946 -0
- package/src/commands/extensions/add.ts +312 -0
- package/src/commands/extensions/configure.ts +82 -0
- package/src/commands/extensions/container.ts +209 -0
- package/src/commands/extensions/context.ts +109 -0
- package/src/commands/extensions/enable.ts +237 -0
- package/src/commands/extensions/environment.ts +218 -0
- package/src/commands/extensions/feature-scan.ts +232 -0
- package/src/commands/extensions/invoke.ts +368 -0
- package/src/commands/extensions/list.ts +158 -0
- package/src/commands/extensions/logs.ts +104 -0
- package/src/commands/extensions/provision.ts +206 -0
- package/src/commands/extensions/remove.ts +110 -0
- package/src/commands/extensions/render.ts +32 -0
- package/src/commands/extensions/run.ts +386 -0
- package/src/commands/extensions/secret-store.ts +223 -0
- package/src/commands/extensions/setup.ts +140 -0
- package/src/commands/extensions/source.ts +189 -0
- package/src/commands/extensions/state.ts +252 -0
- package/src/commands/extensions/status.ts +320 -0
- package/src/commands/extensions.ts +280 -0
- package/src/commands/flow/index.ts +402 -0
- package/src/commands/flow/limits.ts +14 -0
- package/src/commands/flow/output.ts +16 -0
- package/src/commands/flow/render.ts +318 -0
- package/src/commands/flow/select.ts +101 -0
- package/src/commands/graph/boundaries-input.ts +63 -0
- package/src/commands/graph/boundaries.ts +182 -0
- package/src/commands/graph/bounds.ts +25 -0
- package/src/commands/graph/category-clusters.ts +194 -0
- package/src/commands/graph/feature-3d.ts +141 -0
- package/src/commands/graph/feature-clusters.ts +125 -0
- package/src/commands/graph/feature-html.ts +336 -0
- package/src/commands/graph/feature-map.ts +270 -0
- package/src/commands/graph/feature-model.ts +234 -0
- package/src/commands/graph/feature-untangle-motion.ts +192 -0
- package/src/commands/graph/index.ts +562 -0
- package/src/commands/graph/render.ts +503 -0
- package/src/commands/graph/select.ts +77 -0
- package/src/commands/index/index.ts +595 -0
- package/src/commands/index/render.ts +325 -0
- package/src/commands/index/target.ts +136 -0
- package/src/commands/index-watch.ts +206 -0
- package/src/commands/init/command.ts +238 -0
- package/src/commands/init/config-draft.ts +235 -0
- package/src/commands/init/diff.ts +117 -0
- package/src/commands/init/http-probe.ts +150 -0
- package/src/commands/init/ignore-rules.ts +170 -0
- package/src/commands/init/index.ts +63 -0
- package/src/commands/init/integrations-apply.ts +618 -0
- package/src/commands/init/integrations-plan.ts +634 -0
- package/src/commands/init/integrations.ts +8 -0
- package/src/commands/init/languages.ts +320 -0
- package/src/commands/init/product-context.ts +576 -0
- package/src/commands/init/render.ts +598 -0
- package/src/commands/init/report.ts +204 -0
- package/src/commands/init/run.ts +349 -0
- package/src/commands/init/services.ts +271 -0
- package/src/commands/init/storage.ts +136 -0
- package/src/commands/init/toml.ts +174 -0
- package/src/commands/init/topology.ts +192 -0
- package/src/commands/init/types.ts +366 -0
- package/src/commands/init/wizard-terminal.ts +206 -0
- package/src/commands/init/wizard.ts +450 -0
- package/src/commands/mcp.ts +123 -0
- package/src/commands/product-test-runner.ts +80 -0
- package/src/commands/product.ts +331 -0
- package/src/commands/query.ts +1032 -0
- package/src/commands/scan.ts +360 -0
- package/src/commands/sdd.ts +243 -0
- package/src/commands/unavailable.ts +92 -0
- package/src/commands/watch/README.md +160 -0
- package/src/commands/watch/analyze.ts +600 -0
- package/src/commands/watch/cli.ts +108 -0
- package/src/commands/watch/delta.ts +186 -0
- package/src/commands/watch/events.ts +235 -0
- package/src/commands/watch/index.ts +53 -0
- package/src/commands/watch/options.ts +234 -0
- package/src/commands/watch/render.ts +240 -0
- package/src/commands/watch/run.ts +553 -0
- package/src/commands/watch/runtime.ts +167 -0
- package/src/commands/watch-command.ts +294 -0
- package/src/entry-point.ts +67 -0
- package/src/index.ts +291 -0
- package/src/mcp/boundaries-schema.ts +193 -0
- package/src/mcp/default-runtime.ts +1034 -0
- package/src/mcp/envelope.ts +57 -0
- package/src/mcp/index.ts +28 -0
- package/src/mcp/output-schemas.ts +3071 -0
- package/src/mcp/path-sandbox.ts +156 -0
- package/src/mcp/server.ts +358 -0
- package/src/mcp/stdio.ts +92 -0
- package/src/mcp/tools.ts +563 -0
- package/src/mcp/types.ts +66 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCorpusRevisionFingerprint,
|
|
3
|
+
buildFileId,
|
|
4
|
+
buildRefId,
|
|
5
|
+
canonicalJson,
|
|
6
|
+
CHUNKER_VERSION,
|
|
7
|
+
LEXICAL_TOKENIZER_VERSION,
|
|
8
|
+
normalizeRelativePath,
|
|
9
|
+
knownParserLanguages,
|
|
10
|
+
parserVersionForLanguage,
|
|
11
|
+
sha256Hex,
|
|
12
|
+
type IndexFreshnessV1,
|
|
13
|
+
type PortCallOptions,
|
|
14
|
+
} from "@untangle-code/domain";
|
|
15
|
+
import { discoverFiles } from "@untangle-code/scanner";
|
|
16
|
+
import { NodeFileSystem } from "@untangle-code/scanner/node-fs";
|
|
17
|
+
|
|
18
|
+
import { detectRefName, resolveTarget, type ResolvedTarget } from "../commands/index/target.js";
|
|
19
|
+
|
|
20
|
+
import type { FoundIndexState, IndexStateV1 } from "./index-state.js";
|
|
21
|
+
import type { WorkspaceView } from "./workspace.js";
|
|
22
|
+
|
|
23
|
+
type RepositoryFreshness = IndexFreshnessV1["repositories"][number];
|
|
24
|
+
type FreshnessOptions = PortCallOptions & {
|
|
25
|
+
expectedRepoIds?: readonly string[];
|
|
26
|
+
expectedRefs?: readonly string[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** Bind source selection and chunk semantics; operational concurrency does not change the corpus. */
|
|
30
|
+
export function indexConfigFingerprint(view: WorkspaceView, target: ResolvedTarget): string {
|
|
31
|
+
return sha256Hex(
|
|
32
|
+
canonicalJson({
|
|
33
|
+
chunkerVersion: CHUNKER_VERSION,
|
|
34
|
+
parserVersions: knownParserLanguages().map((language) => [
|
|
35
|
+
language,
|
|
36
|
+
parserVersionForLanguage(language),
|
|
37
|
+
]),
|
|
38
|
+
maxFileSizeMb: view.config.index.maxFileSizeMb,
|
|
39
|
+
maxChunkTokens: view.config.index.maxChunkTokens,
|
|
40
|
+
include: target.include ?? [],
|
|
41
|
+
exclude: target.exclude ?? [],
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function inspectIndexFreshness(
|
|
47
|
+
view: WorkspaceView,
|
|
48
|
+
states: readonly FoundIndexState[],
|
|
49
|
+
options: FreshnessOptions = {},
|
|
50
|
+
): Promise<IndexFreshnessV1> {
|
|
51
|
+
const repositories: RepositoryFreshness[] = [];
|
|
52
|
+
for (const found of states) {
|
|
53
|
+
options.signal?.throwIfAborted();
|
|
54
|
+
repositories.push(await inspectRepositoryFreshness(view, found, options));
|
|
55
|
+
}
|
|
56
|
+
appendMissingSnapshots(view, states, repositories, options);
|
|
57
|
+
return {
|
|
58
|
+
status: aggregateFreshnessStatus(repositories),
|
|
59
|
+
checkedAt: new Date().toISOString(),
|
|
60
|
+
repositories,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function inspectRepositoryFreshness(
|
|
65
|
+
view: WorkspaceView,
|
|
66
|
+
found: FoundIndexState,
|
|
67
|
+
options: PortCallOptions,
|
|
68
|
+
): Promise<RepositoryFreshness> {
|
|
69
|
+
const entry = snapshotFreshness(found.state);
|
|
70
|
+
if (!hasCompleteSnapshotMetadata(found.state, entry)) return entry;
|
|
71
|
+
const target = resolveFreshnessTarget(view, found, entry, options);
|
|
72
|
+
if (target !== null) await scanContentManifest(view, found.state, target, entry, options);
|
|
73
|
+
return entry;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Keep persisted evidence visible even when it cannot establish freshness. */
|
|
77
|
+
function snapshotFreshness(state: IndexStateV1): RepositoryFreshness {
|
|
78
|
+
return {
|
|
79
|
+
repoId: state.repoId,
|
|
80
|
+
refId: state.refId,
|
|
81
|
+
status: "unknown",
|
|
82
|
+
reason: "snapshot_metadata_missing",
|
|
83
|
+
filesChecked: 0,
|
|
84
|
+
...(state.indexedAt === undefined ? {} : { indexedAt: state.indexedAt }),
|
|
85
|
+
...(state.corpusRevisionFingerprint === undefined
|
|
86
|
+
? {}
|
|
87
|
+
: { indexedCorpusFingerprint: state.corpusRevisionFingerprint }),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function hasCompleteSnapshotMetadata(state: IndexStateV1, entry: RepositoryFreshness): boolean {
|
|
92
|
+
if (state.lexicalTokenizerVersion !== LEXICAL_TOKENIZER_VERSION) {
|
|
93
|
+
entry.status = "incompatible";
|
|
94
|
+
entry.reason = "lexical_tokenizer_changed";
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (state.outcome !== "completed") {
|
|
98
|
+
entry.status = "stale";
|
|
99
|
+
entry.reason = "index_incomplete";
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return (
|
|
103
|
+
state.corpusRevisionFingerprint !== undefined &&
|
|
104
|
+
state.indexConfigFingerprint !== undefined &&
|
|
105
|
+
state.indexedAt !== undefined
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Historical refs and changed source-selection rules need different diagnoses. */
|
|
110
|
+
function resolveFreshnessTarget(
|
|
111
|
+
view: WorkspaceView,
|
|
112
|
+
found: FoundIndexState,
|
|
113
|
+
entry: RepositoryFreshness,
|
|
114
|
+
options: PortCallOptions,
|
|
115
|
+
): ResolvedTarget | null {
|
|
116
|
+
const state = found.state;
|
|
117
|
+
let target: ResolvedTarget;
|
|
118
|
+
try {
|
|
119
|
+
target = resolveTarget({
|
|
120
|
+
config: view.config,
|
|
121
|
+
cwd: found.repoRoot,
|
|
122
|
+
rootFlag: found.repoRoot,
|
|
123
|
+
repoFlag: (view.config.repositories ?? []).length === 0 ? undefined : state.repoId,
|
|
124
|
+
refFlag: state.refName,
|
|
125
|
+
configBaseDir: view.load.sources.configBaseDir,
|
|
126
|
+
});
|
|
127
|
+
} catch {
|
|
128
|
+
options.signal?.throwIfAborted();
|
|
129
|
+
entry.reason = "repository_unavailable";
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
if (target.rootPath !== found.repoRoot || detectRefName(target.rootPath) !== state.refName) {
|
|
133
|
+
entry.reason = "ref_not_checked_out";
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
if (indexConfigFingerprint(view, target) !== state.indexConfigFingerprint) {
|
|
137
|
+
entry.status = "stale";
|
|
138
|
+
entry.reason = "index_configuration_changed";
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return target;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Compare the same full file/content manifest recorded by completed index discovery. */
|
|
145
|
+
async function scanContentManifest(
|
|
146
|
+
view: WorkspaceView,
|
|
147
|
+
state: IndexStateV1,
|
|
148
|
+
target: ResolvedTarget,
|
|
149
|
+
entry: RepositoryFreshness,
|
|
150
|
+
options: PortCallOptions,
|
|
151
|
+
): Promise<void> {
|
|
152
|
+
const hashes: Record<string, string> = {};
|
|
153
|
+
let unreadable = false;
|
|
154
|
+
try {
|
|
155
|
+
for await (const file of discoverFiles({
|
|
156
|
+
fs: new NodeFileSystem(),
|
|
157
|
+
roots: [target.rootPath],
|
|
158
|
+
repoRoot: target.rootPath,
|
|
159
|
+
maxFileSizeBytes: view.config.index.maxFileSizeMb * 1024 * 1024,
|
|
160
|
+
concurrency: view.config.index.scanConcurrency,
|
|
161
|
+
ignore: {
|
|
162
|
+
...(target.include === undefined ? {} : { configInclude: target.include }),
|
|
163
|
+
...(target.exclude === undefined ? {} : { configExclude: target.exclude }),
|
|
164
|
+
},
|
|
165
|
+
onSkip: (skip) => {
|
|
166
|
+
if (skip.reason === "unreadable") unreadable = true;
|
|
167
|
+
},
|
|
168
|
+
...(options.signal === undefined ? {} : { signal: options.signal }),
|
|
169
|
+
})) {
|
|
170
|
+
options.signal?.throwIfAborted();
|
|
171
|
+
const fileId = buildFileId({
|
|
172
|
+
workspaceId: state.workspaceId,
|
|
173
|
+
repoId: state.repoId,
|
|
174
|
+
refId: state.refId,
|
|
175
|
+
relativePath: normalizeRelativePath(file.relativePath),
|
|
176
|
+
});
|
|
177
|
+
hashes[fileId] = file.contentHash;
|
|
178
|
+
entry.filesChecked++;
|
|
179
|
+
}
|
|
180
|
+
if (unreadable) {
|
|
181
|
+
entry.reason = "source_scan_incomplete";
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
entry.currentCorpusFingerprint = buildCorpusRevisionFingerprint(hashes);
|
|
185
|
+
entry.status =
|
|
186
|
+
entry.currentCorpusFingerprint === state.corpusRevisionFingerprint ? "fresh" : "stale";
|
|
187
|
+
entry.reason = entry.status === "fresh" ? "content_hashes_match" : "sources_changed";
|
|
188
|
+
} catch {
|
|
189
|
+
options.signal?.throwIfAborted();
|
|
190
|
+
entry.reason = "source_scan_incomplete";
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Missing selected records must not disappear from the aggregate. */
|
|
195
|
+
function appendMissingSnapshots(
|
|
196
|
+
view: WorkspaceView,
|
|
197
|
+
states: readonly FoundIndexState[],
|
|
198
|
+
repositories: RepositoryFreshness[],
|
|
199
|
+
options: FreshnessOptions,
|
|
200
|
+
): void {
|
|
201
|
+
if (options.expectedRepoIds === undefined) return;
|
|
202
|
+
const expectedRepos = expectedRepositoryIds(view, options.expectedRepoIds);
|
|
203
|
+
if (options.expectedRefs?.length) {
|
|
204
|
+
appendMissingRefSnapshots(
|
|
205
|
+
view,
|
|
206
|
+
states,
|
|
207
|
+
repositories,
|
|
208
|
+
expectedRepos,
|
|
209
|
+
options.expectedRefs,
|
|
210
|
+
options,
|
|
211
|
+
);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for (const repoId of expectedRepos) {
|
|
215
|
+
if (!states.some(({ state }) => state.repoId === repoId)) {
|
|
216
|
+
repositories.push(missingSnapshot(view, repoId, undefined, options));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function expectedRepositoryIds(view: WorkspaceView, repoIds: readonly string[]): readonly string[] {
|
|
222
|
+
if (repoIds.length > 0) return repoIds;
|
|
223
|
+
return [
|
|
224
|
+
resolveTarget({
|
|
225
|
+
config: view.config,
|
|
226
|
+
cwd: view.root,
|
|
227
|
+
rootFlag: view.root,
|
|
228
|
+
repoFlag: undefined,
|
|
229
|
+
refFlag: undefined,
|
|
230
|
+
configBaseDir: view.load.sources.configBaseDir,
|
|
231
|
+
}).repoId,
|
|
232
|
+
];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Named refs cover every selected repository; canonical refs retain their repo qualification. */
|
|
236
|
+
function appendMissingRefSnapshots(
|
|
237
|
+
view: WorkspaceView,
|
|
238
|
+
states: readonly FoundIndexState[],
|
|
239
|
+
repositories: RepositoryFreshness[],
|
|
240
|
+
expectedRepos: readonly string[],
|
|
241
|
+
expectedRefs: readonly string[],
|
|
242
|
+
options: PortCallOptions,
|
|
243
|
+
): void {
|
|
244
|
+
for (const ref of expectedRefs) {
|
|
245
|
+
const matchingRepos = ref.includes(":")
|
|
246
|
+
? expectedRepos.filter((repoId) => ref.startsWith(`${repoId}:`))
|
|
247
|
+
: expectedRepos;
|
|
248
|
+
if (matchingRepos.length === 0) {
|
|
249
|
+
repositories.push(missingSnapshot(view, expectedRepos[0] ?? "unknown", ref, options));
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
for (const repoId of matchingRepos) {
|
|
253
|
+
if (
|
|
254
|
+
!states.some(
|
|
255
|
+
({ state }) => state.repoId === repoId && (state.refId === ref || state.refName === ref),
|
|
256
|
+
)
|
|
257
|
+
) {
|
|
258
|
+
repositories.push(missingSnapshot(view, repoId, ref, options));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function missingSnapshot(
|
|
265
|
+
view: WorkspaceView,
|
|
266
|
+
repoId: string,
|
|
267
|
+
ref: string | undefined,
|
|
268
|
+
options: PortCallOptions,
|
|
269
|
+
): RepositoryFreshness {
|
|
270
|
+
let refId = ref?.includes(":") ? ref : buildRefId(repoId, ref ?? "unknown");
|
|
271
|
+
if (ref === undefined) {
|
|
272
|
+
try {
|
|
273
|
+
refId = resolveTarget({
|
|
274
|
+
config: view.config,
|
|
275
|
+
cwd: view.root,
|
|
276
|
+
rootFlag: view.root,
|
|
277
|
+
repoFlag: (view.config.repositories ?? []).length === 0 ? undefined : repoId,
|
|
278
|
+
refFlag: undefined,
|
|
279
|
+
configBaseDir: view.load.sources.configBaseDir,
|
|
280
|
+
}).refId;
|
|
281
|
+
} catch {
|
|
282
|
+
options.signal?.throwIfAborted();
|
|
283
|
+
/* Missing configuration remains unverified. */
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
repoId,
|
|
288
|
+
refId,
|
|
289
|
+
status: "unknown",
|
|
290
|
+
reason: "index_snapshot_missing",
|
|
291
|
+
filesChecked: 0,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function aggregateFreshnessStatus(
|
|
296
|
+
repositories: readonly RepositoryFreshness[],
|
|
297
|
+
): IndexFreshnessV1["status"] {
|
|
298
|
+
if (repositories.length === 0) return "unknown";
|
|
299
|
+
for (const status of ["incompatible", "stale", "unknown"] as const) {
|
|
300
|
+
if (repositories.some((entry) => entry.status === status)) return status;
|
|
301
|
+
}
|
|
302
|
+
return "fresh";
|
|
303
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { buildRefId } from "@untangle-code/domain";
|
|
2
|
+
|
|
3
|
+
import { indexCommand } from "../commands/index/index.js";
|
|
4
|
+
import { detectRefName, resolveTarget, type ResolvedTarget } from "../commands/index/target.js";
|
|
5
|
+
|
|
6
|
+
import type { CommandContext } from "./command.js";
|
|
7
|
+
import { EXIT, EnvironmentError, UsageError } from "./exit.js";
|
|
8
|
+
import type { WorkspaceView } from "./workspace.js";
|
|
9
|
+
|
|
10
|
+
/** Rebuild only selected, physically checked-out refs; route progress away from query JSON. */
|
|
11
|
+
export async function refreshWorkspaceIndex(
|
|
12
|
+
ctx: CommandContext,
|
|
13
|
+
options: {
|
|
14
|
+
view: WorkspaceView;
|
|
15
|
+
repoIds?: readonly string[];
|
|
16
|
+
refIds?: readonly string[];
|
|
17
|
+
embedder: "auto" | "offline";
|
|
18
|
+
},
|
|
19
|
+
): Promise<void> {
|
|
20
|
+
const { view } = options;
|
|
21
|
+
const configured = view.config.repositories ?? [];
|
|
22
|
+
const targets = preflightRefreshTargets(view, options.repoIds, options.refIds);
|
|
23
|
+
for (const target of targets) {
|
|
24
|
+
ctx.signal.throwIfAborted();
|
|
25
|
+
const exit = await indexCommand.run(
|
|
26
|
+
{ ...ctx, io: { out: (chunk) => ctx.io.err(chunk), err: (chunk) => ctx.io.err(chunk) } },
|
|
27
|
+
{
|
|
28
|
+
positionals: [],
|
|
29
|
+
flags: {
|
|
30
|
+
root: configured.length === 0 ? target.rootPath : view.root,
|
|
31
|
+
...(configured.length === 0 ? {} : { repo: target.repoId }),
|
|
32
|
+
ref: target.refName,
|
|
33
|
+
embedder: options.embedder,
|
|
34
|
+
format: "json",
|
|
35
|
+
resume: false,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
ctx.signal.throwIfAborted();
|
|
40
|
+
if (exit !== EXIT.ok)
|
|
41
|
+
throw new EnvironmentError(
|
|
42
|
+
"The search index could not be fully refreshed.",
|
|
43
|
+
"Check the index report on stderr and run `untangle doctor`.",
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Resolve and validate the complete requested scope before the first mutation. */
|
|
49
|
+
function preflightRefreshTargets(
|
|
50
|
+
view: WorkspaceView,
|
|
51
|
+
selectedRepoIds: readonly string[] | undefined,
|
|
52
|
+
selectedRefIds: readonly string[] | undefined,
|
|
53
|
+
): ResolvedTarget[] {
|
|
54
|
+
const configured = view.config.repositories ?? [];
|
|
55
|
+
const repoIds = selectedRepoIds?.length
|
|
56
|
+
? [...new Set(selectedRepoIds)]
|
|
57
|
+
: configured.map((repo) => repo.id);
|
|
58
|
+
const requestedRefs = new Set(selectedRefIds ?? []);
|
|
59
|
+
const availableTargets = (repoIds.length ? repoIds : [undefined]).map((repoId) =>
|
|
60
|
+
resolveRefreshTarget(view, repoId, requestedRefs.size > 0),
|
|
61
|
+
);
|
|
62
|
+
const unavailableRefs = [...requestedRefs].flatMap((ref) =>
|
|
63
|
+
ref.includes(":")
|
|
64
|
+
? availableTargets.some((target) => target.refId === ref)
|
|
65
|
+
? []
|
|
66
|
+
: [ref]
|
|
67
|
+
: availableTargets
|
|
68
|
+
.filter((target) => target.refName !== ref)
|
|
69
|
+
.map((target) => buildRefId(target.repoId, ref)),
|
|
70
|
+
);
|
|
71
|
+
if (unavailableRefs.length > 0)
|
|
72
|
+
throw new UsageError(
|
|
73
|
+
`Selected refs are not checked out here: ${unavailableRefs.join(", ")}.`,
|
|
74
|
+
"Switch to matching worktrees or select only refs checked out here.",
|
|
75
|
+
);
|
|
76
|
+
const targets = availableTargets.filter(
|
|
77
|
+
(target) =>
|
|
78
|
+
requestedRefs.size === 0 ||
|
|
79
|
+
requestedRefs.has(target.refId) ||
|
|
80
|
+
requestedRefs.has(target.refName),
|
|
81
|
+
);
|
|
82
|
+
if (targets.length === 0)
|
|
83
|
+
throw new UsageError(
|
|
84
|
+
"None of the selected refs is checked out here.",
|
|
85
|
+
"Switch to the matching worktree and run `untangle index` there.",
|
|
86
|
+
);
|
|
87
|
+
for (const target of targets) {
|
|
88
|
+
if (detectRefName(target.rootPath) !== target.refName)
|
|
89
|
+
throw new UsageError(
|
|
90
|
+
`Ref ${target.refName} is not checked out in ${target.rootPath}.`,
|
|
91
|
+
"Switch to the matching worktree before refreshing its index.",
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
return targets;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Explicit ref selection follows the physical checkout rather than a configured default. */
|
|
98
|
+
function resolveRefreshTarget(
|
|
99
|
+
view: WorkspaceView,
|
|
100
|
+
repoId: string | undefined,
|
|
101
|
+
hasExplicitRefs: boolean,
|
|
102
|
+
): ResolvedTarget {
|
|
103
|
+
const input = {
|
|
104
|
+
config: view.config,
|
|
105
|
+
cwd: view.root,
|
|
106
|
+
rootFlag: view.root,
|
|
107
|
+
repoFlag: repoId,
|
|
108
|
+
refFlag: undefined,
|
|
109
|
+
configBaseDir: view.load.sources.configBaseDir,
|
|
110
|
+
};
|
|
111
|
+
const configuredTarget = resolveTarget(input);
|
|
112
|
+
if (
|
|
113
|
+
(view.config.repositories ?? []).length === 0 &&
|
|
114
|
+
repoId !== undefined &&
|
|
115
|
+
repoId !== configuredTarget.repoId
|
|
116
|
+
) {
|
|
117
|
+
throw new UsageError(
|
|
118
|
+
`Repository ${repoId} is absent from this project.`,
|
|
119
|
+
"Select the index by its actual repository ID or omit --repo.",
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return hasExplicitRefs
|
|
123
|
+
? resolveTarget({ ...input, refFlag: detectRefName(configuredTarget.rootPath) })
|
|
124
|
+
: configuredTarget;
|
|
125
|
+
}
|