@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,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal report of `untangle init`.
|
|
3
|
+
*
|
|
4
|
+
* Separate from the file it writes, and deliberately shorter: the file is the
|
|
5
|
+
* record, the report is the answer to "what just happened and what do I do
|
|
6
|
+
* now". It ends in exactly one next step — never a list — because a first
|
|
7
|
+
* command that hands back five errands is a first command nobody finishes.
|
|
8
|
+
*
|
|
9
|
+
* Wall-clock time is allowed in a report (it is not result data), and is
|
|
10
|
+
* still not used here: there is nothing about `init` whose duration a user
|
|
11
|
+
* needs to be told.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { formatCount, formatShare, productContextWarnings } from "./render.js";
|
|
15
|
+
import type { InitResultV1, ProjectFindingsV1 } from "./types.js";
|
|
16
|
+
|
|
17
|
+
/** Human report. One line per array element, no trailing newline. */
|
|
18
|
+
export function formatTextReport(result: InitResultV1): string[] {
|
|
19
|
+
const { findings } = result;
|
|
20
|
+
const lines: string[] = [];
|
|
21
|
+
|
|
22
|
+
lines.push(`untangle init — ${findings.root}`);
|
|
23
|
+
lines.push("");
|
|
24
|
+
|
|
25
|
+
const languages = findings.languages;
|
|
26
|
+
if (languages.entries.length === 0) {
|
|
27
|
+
lines.push("Languages no analyzable files found");
|
|
28
|
+
} else {
|
|
29
|
+
const top = languages.entries
|
|
30
|
+
.slice(0, 5)
|
|
31
|
+
.map((entry) => `${entry.languageId} ${formatShare(entry.lineShare)}`)
|
|
32
|
+
.join(", ");
|
|
33
|
+
lines.push(`Languages ${top}`);
|
|
34
|
+
lines.push(
|
|
35
|
+
` ${formatCount(languages.totalFiles)} files, ${formatCount(languages.totalLines)} lines; ${formatShare(languages.parsedLineShare)} with a parser`,
|
|
36
|
+
);
|
|
37
|
+
const withoutParser = languages.entries.filter(
|
|
38
|
+
(entry) => !entry.hasParserAdapter && entry.lineShare >= 0.05,
|
|
39
|
+
);
|
|
40
|
+
if (withoutParser.length > 0) {
|
|
41
|
+
lines.push(
|
|
42
|
+
` no parser (text search only): ${withoutParser.map((entry) => entry.languageId).join(", ")}`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const topology = findings.topology;
|
|
48
|
+
lines.push(
|
|
49
|
+
`Topology ${formatCount(topology.packages.length)} packages, ${formatCount(topology.services.length)} Container-Dienste${topology.isMonorepo ? "; monorepo" : "; single project"}`,
|
|
50
|
+
);
|
|
51
|
+
if (topology.workspaceGlobs.length > 0) {
|
|
52
|
+
lines.push(` Globs: ${topology.workspaceGlobs.join(", ")}`);
|
|
53
|
+
}
|
|
54
|
+
if (topology.packages.length > 0) {
|
|
55
|
+
lines.push(` ${topology.packages.map((pkg) => pkg.name).join(", ")}`);
|
|
56
|
+
}
|
|
57
|
+
if (topology.services.length > 0) {
|
|
58
|
+
lines.push(
|
|
59
|
+
` Services: ${topology.services.map((service) => service.name).join(", ")}`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
for (const uncovered of topology.managers.uncoveredByTopology) {
|
|
63
|
+
lines.push(` GAP: ${uncovered} declares packages that were not found`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const productContext = findings.productContext;
|
|
67
|
+
if (productContext !== undefined) {
|
|
68
|
+
const readable = productContext.sources.filter(
|
|
69
|
+
(source) => source.selected && source.status === "readable",
|
|
70
|
+
).length;
|
|
71
|
+
lines.push(
|
|
72
|
+
`Produktkontext ${formatCount(readable)} selected sources readable; ${productContext.status}; ${formatCount(productContext.reviewDraft.questions.length)} open questions in the review draft`,
|
|
73
|
+
);
|
|
74
|
+
for (const warning of productContextWarnings(findings)) {
|
|
75
|
+
lines.push(`WARNING ${warning}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const ollama = findings.ollama;
|
|
80
|
+
if (findings.featureAlignment !== undefined) {
|
|
81
|
+
const alignment = findings.featureAlignment;
|
|
82
|
+
lines.push(
|
|
83
|
+
`Feature evidence ${alignment.status}; ${formatCount(alignment.features.length)} declared features; semantic conformance ${alignment.semanticConformance}`,
|
|
84
|
+
);
|
|
85
|
+
for (const feature of alignment.features) {
|
|
86
|
+
lines.push(
|
|
87
|
+
` ${feature.id.replace(/[\r\n]/gu, " ")}: ${feature.status}; ownership ${feature.ownership.map((owner) => `${owner.id.replace(/[\r\n]/gu, " ")}:${owner.status}`).join(", ") || "none"}; test evidence ${feature.testEvidence.status}`,
|
|
88
|
+
);
|
|
89
|
+
for (const hint of feature.agentHints) {
|
|
90
|
+
lines.push(`HINT ${hint.code}: ${hint.message.replace(/[\r\n]/gu, " ")}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const limitation of alignment.limitations) {
|
|
94
|
+
lines.push(`LIMIT ${limitation.replace(/[\r\n]/gu, " ")}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
lines.push(
|
|
98
|
+
ollama.outcome === "reachable"
|
|
99
|
+
? `Embeddings ${ollama.url} erreichbar${ollama.chosenModel === undefined ? "; no embedding model" : ` — ${ollama.chosenModel.name} (${ollama.chosenModel.dimensions === undefined ? "?" : formatCount(ollama.chosenModel.dimensions)} dimensions)`}`
|
|
100
|
+
: `Embeddings ${ollama.url} unreachable; this is not an error`,
|
|
101
|
+
);
|
|
102
|
+
// WP-228: Die Zeile darueber sagt nur, dass /api/tags geantwortet hat.
|
|
103
|
+
// Diese hier sagt, ob der Dienst das kann, wofuer er gebraucht wird.
|
|
104
|
+
lines.push(` ${describeEmbedProbe(ollama)}`);
|
|
105
|
+
if (findings.storage?.backend === "lancedb") {
|
|
106
|
+
lines.push(
|
|
107
|
+
`Vector store LanceDB at ${findings.storage.directory}; directory ${findings.storage.directoryStatus}`,
|
|
108
|
+
);
|
|
109
|
+
lines.push(" Local storage only; no database opened, Docker or Qdrant probed.");
|
|
110
|
+
} else {
|
|
111
|
+
const qdrant = findings.qdrant;
|
|
112
|
+
lines.push(
|
|
113
|
+
qdrant.outcome === "reachable"
|
|
114
|
+
? `Vector store ${qdrant.url ?? "?"} reachable`
|
|
115
|
+
: `Vector store unreachable (${qdrant.probedUrls.join(", ")}); this is not an error`,
|
|
116
|
+
);
|
|
117
|
+
for (const skipped of qdrant.skippedUrls) {
|
|
118
|
+
lines.push(` not checked: ${skipped.url}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const ignore = findings.ignore;
|
|
123
|
+
lines.push(
|
|
124
|
+
ignore.gitignorePresent
|
|
125
|
+
? `Ignore rules .gitignore with ${formatCount(ignore.gitignoreRuleCount)} rules + ${formatCount(ignore.defaultExcludes.length)} defaults${ignore.additionalExcludes.length > 0 ? `, ${formatCount(ignore.additionalExcludes.length)} imported (${ignore.additionalExcludes.join(", ")})` : ""}`
|
|
126
|
+
: `Ignore rules no .gitignore; ${formatCount(ignore.defaultExcludes.length)} defaults`,
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
if (findings.skipped.entries.length > 0) {
|
|
130
|
+
lines.push(
|
|
131
|
+
`Skipped ${formatCount(findings.skipped.entries.length)} entries with reasons (--format json shows all)`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
lines.push("");
|
|
136
|
+
lines.push(...formatOutcome(result));
|
|
137
|
+
|
|
138
|
+
for (const warning of result.configWarnings) {
|
|
139
|
+
lines.push(`WARNING ${warning}`);
|
|
140
|
+
}
|
|
141
|
+
for (const error of result.configErrors) {
|
|
142
|
+
lines.push(`ERROR ${error}`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
lines.push("");
|
|
146
|
+
lines.push(result.nextStep);
|
|
147
|
+
return lines;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Der Satz zum Probe-Embedding (WP-228).
|
|
152
|
+
*
|
|
153
|
+
* Er nennt IMMER, was geprueft wurde — auch im Erfolgsfall. Eine Zeile, die
|
|
154
|
+
* nur bei Problemen erscheint, liest sich in ihrer Abwesenheit wie „geprueft
|
|
155
|
+
* und in Ordnung", und genau das war der Befund.
|
|
156
|
+
*/
|
|
157
|
+
export function describeEmbedProbe(ollama: ProjectFindingsV1["ollama"]): string {
|
|
158
|
+
const probe = ollama.embedProbe;
|
|
159
|
+
switch (probe.outcome) {
|
|
160
|
+
case "ok":
|
|
161
|
+
return `/api/embed checked: responds${probe.dimensions === undefined ? "" : ` (${formatCount(probe.dimensions)} dimensions)`}; the service is usable`;
|
|
162
|
+
case "timeout":
|
|
163
|
+
return `/api/embed NO RESPONSE within ${formatCount(probe.timeoutMs)} ms; reachable does not mean usable here; use \`--embedder=offline\``;
|
|
164
|
+
case "failed":
|
|
165
|
+
return `/api/embed failed (${probe.detail ?? "no details"}); use \`--embedder=offline\``;
|
|
166
|
+
default:
|
|
167
|
+
return `/api/embed not checked (${probe.detail ?? "no details"})`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function formatOutcome(result: InitResultV1): string[] {
|
|
172
|
+
switch (result.outcome) {
|
|
173
|
+
case "created":
|
|
174
|
+
return [`Written ${result.configPath}`];
|
|
175
|
+
case "overwritten":
|
|
176
|
+
return [`Overwritten ${result.configPath} (--force)`];
|
|
177
|
+
case "unchanged":
|
|
178
|
+
return [`Unchanged ${result.configPath}; a second identical run changes nothing.`];
|
|
179
|
+
case "would-create":
|
|
180
|
+
return [`--dry-run ${result.configPath} would be created (nothing written).`];
|
|
181
|
+
case "would-be-unchanged":
|
|
182
|
+
return [`--dry-run ${result.configPath} is already current (nothing written).`];
|
|
183
|
+
case "would-overwrite":
|
|
184
|
+
case "differs":
|
|
185
|
+
return [
|
|
186
|
+
result.outcome === "differs"
|
|
187
|
+
? `Difference ${result.configPath} differs. Nothing written; use --force to overwrite.`
|
|
188
|
+
: `--dry-run ${result.configPath} would change (nothing written).`,
|
|
189
|
+
...formatChanges(result),
|
|
190
|
+
];
|
|
191
|
+
default:
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** At most 40 changed lines; more than that is a rewrite, not a diff. */
|
|
197
|
+
function formatChanges(result: InitResultV1): string[] {
|
|
198
|
+
const shown = result.changes.slice(0, 40);
|
|
199
|
+
const lines = shown.map((change) => ` ${change.kind === "added" ? "+" : "-"} ${change.line}`);
|
|
200
|
+
if (result.changes.length > shown.length) {
|
|
201
|
+
lines.push(` … ${formatCount(result.changes.length - shown.length)} additional lines`);
|
|
202
|
+
}
|
|
203
|
+
return lines;
|
|
204
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `untangle init` — the command a user runs first.
|
|
3
|
+
*
|
|
4
|
+
* It reads a project, decides, writes one commented file, and names one next
|
|
5
|
+
* step. It asks nothing. Everything it cannot determine becomes a documented
|
|
6
|
+
* finding, never a prompt and never an abort: an absent embedding provider,
|
|
7
|
+
* an absent vector store, an unreadable manifest are all things a
|
|
8
|
+
* configuration can be written AROUND (WP-125).
|
|
9
|
+
*
|
|
10
|
+
* WRITE SAFETY: the file goes to a temporary sibling and is renamed into
|
|
11
|
+
* place, so an interrupted run can never leave half a configuration behind.
|
|
12
|
+
* An existing file is replaced only with `--force`; the run that declines to
|
|
13
|
+
* replace it says exactly which lines would have differed.
|
|
14
|
+
*
|
|
15
|
+
* This module is free of argv and of output formatting — `command.ts` binds
|
|
16
|
+
* it to the CLI shell. That split is what lets the whole command be tested
|
|
17
|
+
* against an in-memory file system and a probe that answers nothing.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
|
|
22
|
+
import { analyzeProductAlignment } from "@untangle-code/core";
|
|
23
|
+
import type { FileSystemPort, ParserRegistry, SkipLedgerEntryV1 } from "@untangle-code/domain";
|
|
24
|
+
import { summarizeSkipReasons } from "@untangle-code/domain";
|
|
25
|
+
import { createParserRegistry } from "@untangle-code/parser-registry";
|
|
26
|
+
import type { ScannedFileV1 } from "@untangle-code/scanner";
|
|
27
|
+
import { NodeFileSystem } from "@untangle-code/scanner/node-fs";
|
|
28
|
+
|
|
29
|
+
import { OperationalError } from "../../cli/exit.js";
|
|
30
|
+
import { qdrantProbePlan } from "../../cli/vector-store-policy.js";
|
|
31
|
+
|
|
32
|
+
import { buildConfigDraft, deriveProjectId, nextStepFor } from "./config-draft.js";
|
|
33
|
+
import { diffLines, toLines } from "./diff.js";
|
|
34
|
+
import { nodeHttpProbe, offlineProbe } from "./http-probe.js";
|
|
35
|
+
import { detectIgnoreRules } from "./ignore-rules.js";
|
|
36
|
+
import { buildLanguageCensus } from "./languages.js";
|
|
37
|
+
import { assessProductContext } from "./product-context.js";
|
|
38
|
+
import { renderUntangleToml } from "./render.js";
|
|
39
|
+
import { DEFAULT_OLLAMA_URL, probeOllama, probeQdrant } from "./services.js";
|
|
40
|
+
import { inspectInitStorage } from "./storage.js";
|
|
41
|
+
import { detectTopology } from "./topology.js";
|
|
42
|
+
import { DEFAULT_INIT_LIMITS } from "./types.js";
|
|
43
|
+
import type {
|
|
44
|
+
HttpProbePort,
|
|
45
|
+
InitLimitsV1,
|
|
46
|
+
InitOutcome,
|
|
47
|
+
InitResultV1,
|
|
48
|
+
ProjectFindingsV1,
|
|
49
|
+
StorageFindingsV1,
|
|
50
|
+
} from "./types.js";
|
|
51
|
+
|
|
52
|
+
/** The file `init` writes. */
|
|
53
|
+
export const CONFIG_FILE_NAME = "untangle.toml";
|
|
54
|
+
/** Suffix of the temporary sibling used for the atomic write. */
|
|
55
|
+
export const TEMP_SUFFIX = ".untangle-init-tmp";
|
|
56
|
+
|
|
57
|
+
/** Ports and overrides. Every one of them has a real default; tests replace them. */
|
|
58
|
+
export interface InitDepsV1 {
|
|
59
|
+
fs?: FileSystemPort;
|
|
60
|
+
http?: HttpProbePort;
|
|
61
|
+
parserRegistry?: ParserRegistry;
|
|
62
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
63
|
+
limits?: Partial<InitLimitsV1>;
|
|
64
|
+
signal?: AbortSignal;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface InitOptionsV1 {
|
|
68
|
+
/** Absolute directory to initialise. */
|
|
69
|
+
root: string;
|
|
70
|
+
force: boolean;
|
|
71
|
+
dryRun: boolean;
|
|
72
|
+
/** Skip every network probe; the infrastructure counts as absent. */
|
|
73
|
+
offline: boolean;
|
|
74
|
+
/** Explicit selection; otherwise environment and existing configuration apply. */
|
|
75
|
+
storageBackend?: "lancedb" | "qdrant";
|
|
76
|
+
preferredModel?: string;
|
|
77
|
+
/** Product intent sources, relative to the chosen project root. */
|
|
78
|
+
visionPath?: string;
|
|
79
|
+
specPath?: string;
|
|
80
|
+
featureManifestPath?: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The command proper. Returns a result; never writes to a terminal. */
|
|
84
|
+
export async function runInit(
|
|
85
|
+
options: InitOptionsV1,
|
|
86
|
+
deps: InitDepsV1 = {},
|
|
87
|
+
): Promise<InitResultV1> {
|
|
88
|
+
deps.signal?.throwIfAborted();
|
|
89
|
+
const fs = deps.fs ?? new NodeFileSystem();
|
|
90
|
+
const http = deps.http ?? (options.offline ? offlineProbe() : nodeHttpProbe());
|
|
91
|
+
const parserRegistry = deps.parserRegistry ?? createParserRegistry();
|
|
92
|
+
const env = deps.env ?? process.env;
|
|
93
|
+
const limits: InitLimitsV1 = { ...DEFAULT_INIT_LIMITS, ...deps.limits };
|
|
94
|
+
|
|
95
|
+
const root = await canonicalRoot(fs, options.root);
|
|
96
|
+
const storage = await inspectInitStorage(fs, root, options.storageBackend, env, deps.signal);
|
|
97
|
+
const findings = await collectFindings({
|
|
98
|
+
fs,
|
|
99
|
+
http,
|
|
100
|
+
parserRegistry,
|
|
101
|
+
env,
|
|
102
|
+
limits,
|
|
103
|
+
root,
|
|
104
|
+
storage,
|
|
105
|
+
...(options.preferredModel === undefined ? {} : { preferredModel: options.preferredModel }),
|
|
106
|
+
...(options.visionPath === undefined ? {} : { visionPath: options.visionPath }),
|
|
107
|
+
...(options.specPath === undefined ? {} : { specPath: options.specPath }),
|
|
108
|
+
...(options.featureManifestPath === undefined
|
|
109
|
+
? {}
|
|
110
|
+
: { featureManifestPath: options.featureManifestPath }),
|
|
111
|
+
...(deps.signal === undefined ? {} : { signal: deps.signal }),
|
|
112
|
+
});
|
|
113
|
+
deps.signal?.throwIfAborted();
|
|
114
|
+
|
|
115
|
+
const draft = buildConfigDraft(findings);
|
|
116
|
+
const nextStep = nextStepFor(findings);
|
|
117
|
+
const rendered = renderUntangleToml({ findings, draft, limits, nextStep });
|
|
118
|
+
const configPath = path.join(root, CONFIG_FILE_NAME);
|
|
119
|
+
|
|
120
|
+
const base = {
|
|
121
|
+
configPath,
|
|
122
|
+
findings,
|
|
123
|
+
rendered,
|
|
124
|
+
nextStep,
|
|
125
|
+
configWarnings: draft.warnings,
|
|
126
|
+
configErrors: draft.errors,
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
if (draft.errors.length > 0) {
|
|
130
|
+
// A configuration the rest of the product would reject is not written at
|
|
131
|
+
// all. Reporting it and stopping is the only honest outcome.
|
|
132
|
+
return { ...base, outcome: "differs", changes: [], exitCode: 1 };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const existing = await readOptionalText(fs, configPath);
|
|
136
|
+
deps.signal?.throwIfAborted();
|
|
137
|
+
const outcome = decideOutcome(existing, rendered, options);
|
|
138
|
+
const changes =
|
|
139
|
+
existing === null || existing === rendered
|
|
140
|
+
? []
|
|
141
|
+
: diffLines(toLines(existing), toLines(rendered));
|
|
142
|
+
|
|
143
|
+
if (outcome === "created" || outcome === "overwritten") {
|
|
144
|
+
await writeAtomically(fs, configPath, rendered, deps.signal);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return { ...base, outcome, changes, exitCode: outcome === "differs" ? 1 : 0 };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The whole decision table of idempotency, in one place.
|
|
152
|
+
*
|
|
153
|
+
* `--dry-run` never writes and never fails: it reports. Without `--force` an
|
|
154
|
+
* existing, differing file is left alone — the second run "meldet, was sich
|
|
155
|
+
* geaendert hat" instead of quietly rewriting a file the user may well have
|
|
156
|
+
* edited on purpose.
|
|
157
|
+
*/
|
|
158
|
+
export function decideOutcome(
|
|
159
|
+
existing: string | null,
|
|
160
|
+
rendered: string,
|
|
161
|
+
options: Pick<InitOptionsV1, "force" | "dryRun">,
|
|
162
|
+
): InitOutcome {
|
|
163
|
+
if (existing === null) {
|
|
164
|
+
return options.dryRun ? "would-create" : "created";
|
|
165
|
+
}
|
|
166
|
+
if (existing === rendered) {
|
|
167
|
+
return options.dryRun ? "would-be-unchanged" : "unchanged";
|
|
168
|
+
}
|
|
169
|
+
if (options.dryRun) {
|
|
170
|
+
return "would-overwrite";
|
|
171
|
+
}
|
|
172
|
+
return options.force ? "overwritten" : "differs";
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface CollectInput {
|
|
176
|
+
fs: FileSystemPort;
|
|
177
|
+
http: HttpProbePort;
|
|
178
|
+
parserRegistry: ParserRegistry;
|
|
179
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
180
|
+
limits: InitLimitsV1;
|
|
181
|
+
root: string;
|
|
182
|
+
storage: StorageFindingsV1;
|
|
183
|
+
preferredModel?: string;
|
|
184
|
+
visionPath?: string;
|
|
185
|
+
specPath?: string;
|
|
186
|
+
featureManifestPath?: string;
|
|
187
|
+
signal?: AbortSignal;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function collectFindings(input: CollectInput): Promise<ProjectFindingsV1> {
|
|
191
|
+
const { fs, http, parserRegistry, env, limits, root } = input;
|
|
192
|
+
const skipEntries: SkipLedgerEntryV1[] = [];
|
|
193
|
+
const onSkipEntry = (entry: SkipLedgerEntryV1): void => {
|
|
194
|
+
skipEntries.push(entry);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// Ignore rules first: their result narrows the scan that follows.
|
|
198
|
+
const ignore = await detectIgnoreRules({ fs, repoRoot: root });
|
|
199
|
+
const files: ScannedFileV1[] = [];
|
|
200
|
+
|
|
201
|
+
const languages = await buildLanguageCensus({
|
|
202
|
+
fs,
|
|
203
|
+
parserRegistry,
|
|
204
|
+
repoRoot: root,
|
|
205
|
+
limits,
|
|
206
|
+
additionalExcludes: ignore.additionalExcludes,
|
|
207
|
+
selfManagedPaths: [CONFIG_FILE_NAME, `${CONFIG_FILE_NAME}${TEMP_SUFFIX}`],
|
|
208
|
+
onSkipEntry,
|
|
209
|
+
onDiscoveredFile: (file) => files.push(file),
|
|
210
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const topology = await detectTopology({ fs, repoRoot: root, limits, onSkipEntry });
|
|
214
|
+
const productContext = await assessProductContext({
|
|
215
|
+
fs,
|
|
216
|
+
root,
|
|
217
|
+
files,
|
|
218
|
+
inventoryTruncated: languages.truncated,
|
|
219
|
+
...(input.visionPath === undefined ? {} : { visionPath: input.visionPath }),
|
|
220
|
+
...(input.specPath === undefined ? {} : { specPath: input.specPath }),
|
|
221
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
222
|
+
});
|
|
223
|
+
const featureAlignment = await analyzeProductAlignment({
|
|
224
|
+
fs,
|
|
225
|
+
root,
|
|
226
|
+
files,
|
|
227
|
+
inventoryTruncated: languages.truncated,
|
|
228
|
+
inventoryExcluded: languages.excluded.reduce((sum, entry) => sum + entry.count, 0),
|
|
229
|
+
inventoryScope: {
|
|
230
|
+
additionalDefaultExcludes: ignore.additionalExcludes,
|
|
231
|
+
maxFileSizeBytes: limits.maxFileSizeBytes,
|
|
232
|
+
maxFilesScanned: limits.maxFilesScanned,
|
|
233
|
+
concurrency: limits.concurrency,
|
|
234
|
+
},
|
|
235
|
+
parserRegistry,
|
|
236
|
+
...(input.featureManifestPath === undefined ? {} : { manifestPath: input.featureManifestPath }),
|
|
237
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const probeInput = {
|
|
241
|
+
http,
|
|
242
|
+
limits,
|
|
243
|
+
ollamaUrl: env["UNTANGLE_OLLAMA_URL"] ?? env["UNTANGLE_EMBEDDINGS_URL"] ?? DEFAULT_OLLAMA_URL,
|
|
244
|
+
qdrantUrls: qdrantProbeList({
|
|
245
|
+
...env,
|
|
246
|
+
...(input.storage.qdrantUrl === undefined
|
|
247
|
+
? {}
|
|
248
|
+
: { UNTANGLE_QDRANT_URL: input.storage.qdrantUrl }),
|
|
249
|
+
}),
|
|
250
|
+
...(input.preferredModel === undefined ? {} : { preferredModel: input.preferredModel }),
|
|
251
|
+
};
|
|
252
|
+
const ollama = await probeOllama(probeInput);
|
|
253
|
+
const qdrant =
|
|
254
|
+
input.storage.backend === "qdrant"
|
|
255
|
+
? await probeQdrant(probeInput)
|
|
256
|
+
: { outcome: "not-probed" as const, probedUrls: [], skippedUrls: [] };
|
|
257
|
+
|
|
258
|
+
return {
|
|
259
|
+
schemaVersion: 1,
|
|
260
|
+
root,
|
|
261
|
+
projectId: deriveProjectId(path.basename(root)),
|
|
262
|
+
languages,
|
|
263
|
+
topology,
|
|
264
|
+
productContext,
|
|
265
|
+
featureAlignment,
|
|
266
|
+
ignore,
|
|
267
|
+
ollama,
|
|
268
|
+
qdrant,
|
|
269
|
+
storage: input.storage,
|
|
270
|
+
skipped: {
|
|
271
|
+
schemaVersion: 1,
|
|
272
|
+
generationId: "untangle-init",
|
|
273
|
+
entries: skipEntries,
|
|
274
|
+
countsByReason: summarizeSkipReasons(skipEntries),
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Which vector-store URLs get probed.
|
|
281
|
+
*
|
|
282
|
+
* WP-222: this no longer decides anything — it asks
|
|
283
|
+
* `cli/vector-store-policy.ts`, the one place that knows which store Untangle
|
|
284
|
+
* may use, and which `untangle doctor` obeys through `wireStorage`. An
|
|
285
|
+
* explicitly configured `UNTANGLE_QDRANT_URL` comes first ("this one is
|
|
286
|
+
* mine"), the managed default follows, and upstream's default port is
|
|
287
|
+
* skipped WITH ITS REASON rather than silently absent (E4).
|
|
288
|
+
*/
|
|
289
|
+
export function qdrantProbeList(env: Readonly<Record<string, string | undefined>>): string[] {
|
|
290
|
+
return qdrantProbePlan(env).probe;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async function canonicalRoot(fs: FileSystemPort, candidate: string): Promise<string> {
|
|
294
|
+
const stat = await fs.stat(candidate);
|
|
295
|
+
if (stat === null) {
|
|
296
|
+
throw new OperationalError(
|
|
297
|
+
`Directory "${candidate}" does not exist.`,
|
|
298
|
+
"Create it or select an existing directory with --root.",
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
if (stat.kind !== "directory") {
|
|
302
|
+
throw new OperationalError(
|
|
303
|
+
`"${candidate}" is not a directory.`,
|
|
304
|
+
"init requires a project's root directory.",
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
return await fs.realPath(candidate);
|
|
309
|
+
} catch {
|
|
310
|
+
return candidate;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
async function readOptionalText(fs: FileSystemPort, filePath: string): Promise<string | null> {
|
|
315
|
+
const stat = await fs.stat(filePath);
|
|
316
|
+
if (stat === null || stat.kind !== "file") {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
return fs.readTextFile(filePath);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Temp file plus rename. `rename` is atomic within a directory on every
|
|
324
|
+
* platform Untangle supports, so a reader sees either the old file or the new
|
|
325
|
+
* one — never a truncated one.
|
|
326
|
+
*/
|
|
327
|
+
async function writeAtomically(
|
|
328
|
+
fs: FileSystemPort,
|
|
329
|
+
filePath: string,
|
|
330
|
+
text: string,
|
|
331
|
+
signal?: AbortSignal,
|
|
332
|
+
): Promise<void> {
|
|
333
|
+
const temporary = `${filePath}${TEMP_SUFFIX}`;
|
|
334
|
+
signal?.throwIfAborted();
|
|
335
|
+
const callOptions = signal === undefined ? undefined : { signal };
|
|
336
|
+
try {
|
|
337
|
+
await fs.writeFile(temporary, new TextEncoder().encode(text), callOptions);
|
|
338
|
+
signal?.throwIfAborted();
|
|
339
|
+
await fs.rename(temporary, filePath, callOptions);
|
|
340
|
+
} catch (error) {
|
|
341
|
+
await fs.remove(temporary).catch(() => undefined);
|
|
342
|
+
signal?.throwIfAborted();
|
|
343
|
+
throw new OperationalError(
|
|
344
|
+
`Writing "${filePath}" failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
345
|
+
`Check write permissions for "${path.dirname(filePath)}".`,
|
|
346
|
+
{ cause: error },
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
}
|