@untangle-code/cli 0.0.0-stage → 0.1.1
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 +451 -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,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die Systemadapter der Ports, die praktisch jeder Befehl braucht.
|
|
3
|
+
*
|
|
4
|
+
* ZUR DETERMINISMUS-REGEL: `Date.now()` und `crypto.randomUUID()` stehen hier
|
|
5
|
+
* — und NUR hier — hinter den Ports `Clock` und `Random`. Sie fliessen nie
|
|
6
|
+
* ungefragt in Ergebnisdaten: die Uhr wird vom Abrufkern ausschliesslich fuer
|
|
7
|
+
* den Recency-Boost und von Adaptern fuer Protokollstempel verwendet, der
|
|
8
|
+
* Zufall nur fuer Korrelations-IDs. Wer deterministische Ergebnisse braucht,
|
|
9
|
+
* injiziert stattdessen die Fakes des testkits — genau deshalb sind es Ports.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { getRandomValues, randomUUID } from "node:crypto";
|
|
13
|
+
|
|
14
|
+
import type { Clock, LogEvent, LoggerPort, Random } from "@untangle-code/domain";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Die Systemuhr.
|
|
18
|
+
*
|
|
19
|
+
* `Date.now()` steht hier — und die Determinismusregel des Repos verbietet es
|
|
20
|
+
* ueberall sonst. Das ist kein Widerspruch, sondern der Zweck: eine Regel, die
|
|
21
|
+
* die Wanduhr aus der Analyse-Logik heraushaelt, braucht GENAU EINE Stelle, an
|
|
22
|
+
* der die Wanduhr trotzdem gelesen wird. Diese ist es. Deshalb steht die
|
|
23
|
+
* Ausnahme in `eslint.config.js` auf diese Datei beschraenkt und nicht als
|
|
24
|
+
* `eslint-disable`-Kommentar im Code, wo sie sich unbemerkt ausbreiten wuerde.
|
|
25
|
+
*/
|
|
26
|
+
export const systemClock: Clock = {
|
|
27
|
+
nowEpochMs: () => Date.now(),
|
|
28
|
+
nowIso: () => new Date().toISOString(),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Die Systemzufallsquelle.
|
|
33
|
+
*
|
|
34
|
+
* Bewusst `node:crypto` und NICHT `Math.random()`: der Port liefert unter
|
|
35
|
+
* anderem `uuid()` fuer Korrelations- und Schreib-IDs, und dafuer ist ein
|
|
36
|
+
* vorhersagbarer Generator die falsche Wahl. Dass die Determinismusregel
|
|
37
|
+
* `Math.random()` ohnehin verbietet, faellt damit zusammen — der bessere Code
|
|
38
|
+
* ist hier auch der regelkonforme.
|
|
39
|
+
*/
|
|
40
|
+
export const systemRandom: Random = {
|
|
41
|
+
nextFloat: () => {
|
|
42
|
+
// 53 Bit aus 8 Zufallsbytes: dieselbe Aufloesung, die ein Double traegt.
|
|
43
|
+
const bytes = getRandomValues(new Uint8Array(8));
|
|
44
|
+
let value = 0;
|
|
45
|
+
for (const byte of bytes) value = value * 256 + byte;
|
|
46
|
+
return value / 2 ** 64;
|
|
47
|
+
},
|
|
48
|
+
nextInt: (maxExclusive: number) => {
|
|
49
|
+
if (maxExclusive <= 0) return 0;
|
|
50
|
+
// Verwerfen statt Modulo: Modulo verzerrt, wenn 2^32 kein Vielfaches von
|
|
51
|
+
// `maxExclusive` ist. Die Schleife endet mit Wahrscheinlichkeit 1.
|
|
52
|
+
const limit = Math.floor(0x1_0000_0000 / maxExclusive) * maxExclusive;
|
|
53
|
+
for (;;) {
|
|
54
|
+
const [draw] = getRandomValues(new Uint32Array(1));
|
|
55
|
+
if (draw !== undefined && draw < limit) return draw % maxExclusive;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
bytes: (length: number) => getRandomValues(new Uint8Array(length)),
|
|
59
|
+
uuid: () => randomUUID(),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Ein Logger, der NUR nach stderr schreibt und standardmaessig schweigt.
|
|
64
|
+
*
|
|
65
|
+
* Grund: Protokollzeilen auf stdout wuerden die Nutzdaten der `--format=json`-
|
|
66
|
+
* Ausgabe zerstoeren. Und ein Werkzeug, das ungefragt protokolliert, ist im
|
|
67
|
+
* Terminal unbrauchbar — deshalb ist `error` die Vorgabestufe und `--verbose`
|
|
68
|
+
* hebt sie an.
|
|
69
|
+
*/
|
|
70
|
+
const LEVEL_ORDER: Record<string, number> = {
|
|
71
|
+
error: 0,
|
|
72
|
+
warn: 1,
|
|
73
|
+
info: 2,
|
|
74
|
+
debug: 3,
|
|
75
|
+
trace: 4,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export function createStderrLogger(
|
|
79
|
+
level: "error" | "warn" | "info" | "debug" | "trace",
|
|
80
|
+
bindings: Readonly<Record<string, unknown>> = {},
|
|
81
|
+
): LoggerPort {
|
|
82
|
+
const threshold = LEVEL_ORDER[level] ?? 0;
|
|
83
|
+
const logger: LoggerPort = {
|
|
84
|
+
log(event: LogEvent): void {
|
|
85
|
+
const eventLevel = LEVEL_ORDER[event.level] ?? 0;
|
|
86
|
+
if (eventLevel > threshold) return;
|
|
87
|
+
process.stderr.write(`${JSON.stringify({ ...bindings, ...event })}\n`);
|
|
88
|
+
},
|
|
89
|
+
child(childBindings) {
|
|
90
|
+
return createStderrLogger(level, { ...bindings, ...childBindings });
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
return logger;
|
|
94
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WP-222 — DIE EINE STELLE, DIE ENTSCHEIDET, WELCHER VEKTORSPEICHER BENUTZT
|
|
3
|
+
* WERDEN DARF.
|
|
4
|
+
*
|
|
5
|
+
* Vorher stand diese Regel zweimal im Werkzeug, und die zwei Fassungen
|
|
6
|
+
* widersprachen sich in einer Sicherheitsfrage:
|
|
7
|
+
*
|
|
8
|
+
* `untangle init` kannte spec.md §3.2 und prueft den ueblichen
|
|
9
|
+
* Standardport eines fremden Vektorspeichers
|
|
10
|
+
* ABSICHTLICH NICHT. Es schrieb den Grund sogar in die
|
|
11
|
+
* erzeugte Konfiguration.
|
|
12
|
+
* `untangle doctor` kannte die Regel nicht. Es liess `qdrant.mode =
|
|
13
|
+
* "managed"` vom Speicheradapter aufloesen, der ohne
|
|
14
|
+
* `url` auf denselben Standardport zurueckfiel, fand
|
|
15
|
+
* dort eine FREMDE Instanz mit fremden Daten, meldete
|
|
16
|
+
* "[OK ] Qdrant — Erreichbar" und empfahl, dorthin zu
|
|
17
|
+
* indizieren.
|
|
18
|
+
*
|
|
19
|
+
* Zwei Befehle desselben Werkzeugs, zwei Antworten, und die gefaehrlichere
|
|
20
|
+
* gewann: der Nutzer folgt dem Diagnosewerkzeug, nicht dem Kommentar in
|
|
21
|
+
* einer Datei. Die Ursache war nicht, dass eine der beiden Fassungen falsch
|
|
22
|
+
* war — die Ursache war, dass es ZWEI gab.
|
|
23
|
+
*
|
|
24
|
+
* Also: hier steht sie einmal. `init` bezieht von hier, welche Adressen es
|
|
25
|
+
* ueberhaupt anfassen darf; `doctor` und jeder andere Befehl bekommen ihren
|
|
26
|
+
* Speicher ueber `cli/workspace.ts`, das vor dem Verdrahten hier fragt. Wer
|
|
27
|
+
* eine dritte Fassung schreibt, muss diese Datei umgehen — und das faellt
|
|
28
|
+
* auf.
|
|
29
|
+
*
|
|
30
|
+
* DIE REGEL, in einem Satz: Untangle benutzt seinen EIGENEN verwalteten
|
|
31
|
+
* Speicher, es sei denn, der Nutzer hat eine Adresse ausdruecklich benannt.
|
|
32
|
+
* Ein Zurueckfallen auf eine fremde Vorgabeadresse gibt es nicht.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import type { QdrantConfig } from "@untangle-code/config";
|
|
36
|
+
|
|
37
|
+
import { OperationalError } from "./exit.js";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Der verwaltete Qdrant-REST-Port (spec.md §3.1). Dieser Dienst gehoert
|
|
41
|
+
* Untangle: eigener Container, eigenes Volume. Auf ihn darf geschrieben
|
|
42
|
+
* werden.
|
|
43
|
+
*/
|
|
44
|
+
export const MANAGED_QDRANT_URL = "http://127.0.0.1:16333";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Adressen, die Untangle von sich aus NIEMALS annimmt.
|
|
48
|
+
*
|
|
49
|
+
* `6333` ist der Vorgabeport von Qdrant selbst und damit genau der Port, auf
|
|
50
|
+
* dem auf einem Entwicklungsrechner die Instanz von JEMAND ANDEREM liegt —
|
|
51
|
+
* mit den Daten von jemand anderem. spec.md §3.2 verbietet, in fremde
|
|
52
|
+
* Infrastruktur einzugreifen. Eine Konfiguration, die diesen Port
|
|
53
|
+
* stillschweigend uebernaehme, wuerde beim naechsten Befehl hineinschreiben.
|
|
54
|
+
*/
|
|
55
|
+
export const FOREIGN_DEFAULT_QDRANT_URLS: readonly {
|
|
56
|
+
readonly url: string;
|
|
57
|
+
readonly reason: string;
|
|
58
|
+
}[] = [
|
|
59
|
+
{
|
|
60
|
+
url: "http://127.0.0.1:6333",
|
|
61
|
+
reason:
|
|
62
|
+
"Default port of a foreign instance; spec.md §3.2 prohibits modifying foreign " +
|
|
63
|
+
"services. Select it explicitly with UNTANGLE_QDRANT_URL; otherwise `untangle` starts " +
|
|
64
|
+
"an owned instance on 16333 with its own volume.",
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
/** Woher die Adresse kommt — das ist der ganze Unterschied. */
|
|
69
|
+
export type VectorStoreOrigin =
|
|
70
|
+
| "embedded"
|
|
71
|
+
/** Aus `qdrant.url` einer Konfigurationsdatei. Der Nutzer hat sie hingeschrieben. */
|
|
72
|
+
| "configured"
|
|
73
|
+
/** Aus `UNTANGLE_QDRANT_URL`. Der Nutzer hat sie benannt. */
|
|
74
|
+
| "environment"
|
|
75
|
+
/** Untangles eigener verwalteter Speicher (spec.md §3.1). */
|
|
76
|
+
| "managed";
|
|
77
|
+
|
|
78
|
+
export interface VectorStoreDecision {
|
|
79
|
+
/** Die Adresse, die benutzt werden darf — oder die abgelehnte. */
|
|
80
|
+
readonly url: string;
|
|
81
|
+
readonly origin: VectorStoreOrigin;
|
|
82
|
+
readonly allowed: boolean;
|
|
83
|
+
/** Bei `allowed === false`: warum nicht. Sonst: wie die Adresse zustande kam. */
|
|
84
|
+
readonly reason: string;
|
|
85
|
+
/** Bei `allowed === false` Pflicht: GENAU EIN naechster Schritt. */
|
|
86
|
+
readonly nextStep?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function normalize(url: string): string {
|
|
90
|
+
return url.trim().replace(/\/+$/u, "");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Steht diese Adresse auf der Liste der fremden Vorgabeadressen? */
|
|
94
|
+
export function foreignDefaultFor(url: string): { url: string; reason: string } | undefined {
|
|
95
|
+
const wanted = normalize(url);
|
|
96
|
+
return FOREIGN_DEFAULT_QDRANT_URLS.find((entry) => normalize(entry.url) === wanted);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Die Entscheidung.
|
|
101
|
+
*
|
|
102
|
+
* Warum das Feld `qdrant.url` als „ausdrueckliche Nennung" zaehlt: es hat
|
|
103
|
+
* KEINE Produktvorgabe (`DEFAULT_QDRANT_CONFIG` setzt nur `mode`). Steht dort
|
|
104
|
+
* etwas, dann hat es eine Nutzerebene hingeschrieben — eine Datei, die
|
|
105
|
+
* Umgebung oder ein Argument. Genau das ist die Zustimmung, die spec.md §3.2
|
|
106
|
+
* verlangt, bevor Untangle eine fremde Instanz anfasst.
|
|
107
|
+
*/
|
|
108
|
+
export function decideVectorStore(input: {
|
|
109
|
+
qdrant: QdrantConfig;
|
|
110
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
111
|
+
}): VectorStoreDecision {
|
|
112
|
+
const fromConfig = input.qdrant.url;
|
|
113
|
+
if (fromConfig !== undefined && fromConfig.length > 0) {
|
|
114
|
+
const foreign = foreignDefaultFor(fromConfig);
|
|
115
|
+
return {
|
|
116
|
+
url: fromConfig,
|
|
117
|
+
origin: "configured",
|
|
118
|
+
allowed: true,
|
|
119
|
+
reason:
|
|
120
|
+
foreign === undefined
|
|
121
|
+
? "explicitly configured as `qdrant.url`"
|
|
122
|
+
: "explicitly configured as `qdrant.url`; selecting this foreign " +
|
|
123
|
+
"selecting the default address is therefore an explicit user decision (spec.md §3.2)",
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const fromEnv = input.env["UNTANGLE_QDRANT_URL"];
|
|
128
|
+
if (fromEnv !== undefined && fromEnv.length > 0) {
|
|
129
|
+
return {
|
|
130
|
+
url: fromEnv,
|
|
131
|
+
origin: "environment",
|
|
132
|
+
allowed: true,
|
|
133
|
+
reason: "explicitly selected through UNTANGLE_QDRANT_URL",
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (input.qdrant.mode === "external") {
|
|
138
|
+
// Kein Zurueckfallen. „external" ohne Adresse ist ein Konfigurationsfehler
|
|
139
|
+
// und wird als solcher gemeldet, nicht durch Raten geheilt.
|
|
140
|
+
return {
|
|
141
|
+
url: "",
|
|
142
|
+
origin: "configured",
|
|
143
|
+
allowed: false,
|
|
144
|
+
reason: 'qdrant.mode is "external", but no `qdrant.url` is set.',
|
|
145
|
+
nextStep:
|
|
146
|
+
"Set your own instance's address as `qdrant.url`, or set " + 'qdrant.mode to "managed".',
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
url: MANAGED_QDRANT_URL,
|
|
152
|
+
origin: "managed",
|
|
153
|
+
allowed: true,
|
|
154
|
+
reason: "Untangle's owned managed store (spec.md §3.1, port 16333)",
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Der Riegel.
|
|
160
|
+
*
|
|
161
|
+
* Er sitzt hinter der Entscheidung, weil eine Adresse auch auf anderem Wege
|
|
162
|
+
* dort landen kann — ein kuenftiger Adapter mit eigener Vorgabe, eine
|
|
163
|
+
* Migration, ein Tippfehler in einer Vorgabekonstanten. Wird eine fremde
|
|
164
|
+
* Vorgabeadresse benutzt, OHNE dass sie jemand benannt hat, bricht der
|
|
165
|
+
* Befehl ab statt hineinzuschreiben.
|
|
166
|
+
*/
|
|
167
|
+
export function assertVectorStoreAllowed(decision: VectorStoreDecision, resolvedUrl: string): void {
|
|
168
|
+
if (!decision.allowed) {
|
|
169
|
+
throw new OperationalError(decision.reason, decision.nextStep ?? "See `untangle init`.");
|
|
170
|
+
}
|
|
171
|
+
if (decision.origin !== "managed") {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const foreign = foreignDefaultFor(resolvedUrl);
|
|
175
|
+
if (foreign === undefined) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
throw new OperationalError(
|
|
179
|
+
`${resolvedUrl} is the default port of a foreign Qdrant instance and was not explicitly ` +
|
|
180
|
+
`selected; Untangle will not take it over automatically. ${foreign.reason}`,
|
|
181
|
+
`Set UNTANGLE_QDRANT_URL=${resolvedUrl} if this instance is yours; ` +
|
|
182
|
+
`otherwise start an owned instance on ${MANAGED_QDRANT_URL}.`,
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Welche Adressen `init` ueberhaupt anfassen darf — dieselbe Regel, von der
|
|
188
|
+
* anderen Seite gelesen.
|
|
189
|
+
*
|
|
190
|
+
* `probe` sind die Adressen, an die eine (ausschliesslich lesende) Anfrage
|
|
191
|
+
* gehen darf. `skipped` sind die bewusst ausgelassenen, JEWEILS MIT GRUND:
|
|
192
|
+
* eine ausgelassene Pruefung ohne Begruendung waere ein stilles
|
|
193
|
+
* Ueberspringen (E4), und genau dieses Schweigen hat `doctor` gefehlt.
|
|
194
|
+
*/
|
|
195
|
+
export function qdrantProbePlan(env: Readonly<Record<string, string | undefined>>): {
|
|
196
|
+
probe: string[];
|
|
197
|
+
skipped: { url: string; reason: string }[];
|
|
198
|
+
} {
|
|
199
|
+
const configured = env["UNTANGLE_QDRANT_URL"];
|
|
200
|
+
const probe =
|
|
201
|
+
configured === undefined || configured.length === 0
|
|
202
|
+
? [MANAGED_QDRANT_URL]
|
|
203
|
+
: normalize(configured) === normalize(MANAGED_QDRANT_URL)
|
|
204
|
+
? [MANAGED_QDRANT_URL]
|
|
205
|
+
: [configured, MANAGED_QDRANT_URL];
|
|
206
|
+
|
|
207
|
+
const probing = new Set(probe.map(normalize));
|
|
208
|
+
const skipped = FOREIGN_DEFAULT_QDRANT_URLS.filter(
|
|
209
|
+
(entry) => !probing.has(normalize(entry.url)),
|
|
210
|
+
).map((entry) => ({ ...entry }));
|
|
211
|
+
|
|
212
|
+
return { probe, skipped };
|
|
213
|
+
}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die Verdrahtung, die fast jeder Befehl braucht: von der Konfiguration im
|
|
3
|
+
* Projekt zu den fertigen Adaptern.
|
|
4
|
+
*
|
|
5
|
+
* Diese Datei ist bewusst die EINZIGE Stelle, an der die Oberflaeche
|
|
6
|
+
* Adapterklassen anfasst. Jeder Befehl bekommt danach nur noch Ports zu
|
|
7
|
+
* sehen. Das ist keine Kosmetik: es ist der Grund, warum sich `query` gegen
|
|
8
|
+
* den In-Memory-Speicher des testkits genauso testen laesst wie gegen ein
|
|
9
|
+
* echtes Qdrant.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { realpathSync } from "node:fs";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { pathToFileURL } from "node:url";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
assertConfigValid,
|
|
18
|
+
deriveEmbeddingProfile,
|
|
19
|
+
loadConfig,
|
|
20
|
+
type ConfigIssue,
|
|
21
|
+
type EffectiveUntangleConfigV1,
|
|
22
|
+
type LoadConfigResult,
|
|
23
|
+
} from "@untangle-code/config";
|
|
24
|
+
import {
|
|
25
|
+
buildEmbeddingProfileId,
|
|
26
|
+
compareCodepoints,
|
|
27
|
+
embeddingProfileShortId,
|
|
28
|
+
type EmbeddingProfile,
|
|
29
|
+
type EmbeddingProvider,
|
|
30
|
+
type VectorStore,
|
|
31
|
+
type MetadataStore,
|
|
32
|
+
type GraphStore,
|
|
33
|
+
} from "@untangle-code/domain";
|
|
34
|
+
import { OllamaEmbeddingProvider } from "@untangle-code/embeddings-ollama";
|
|
35
|
+
import {
|
|
36
|
+
createHybridSearchEngine,
|
|
37
|
+
type HybridSearchEngine,
|
|
38
|
+
type ProfileTargetV1,
|
|
39
|
+
type SearchGraphEnrichmentPort,
|
|
40
|
+
} from "@untangle-code/search";
|
|
41
|
+
import { createLanceDbStorage } from "@untangle-code/storage-lancedb";
|
|
42
|
+
import {
|
|
43
|
+
FetchQdrantTransport,
|
|
44
|
+
codeCollectionName,
|
|
45
|
+
createQdrantStorage,
|
|
46
|
+
resolveQdrantStorageConfig,
|
|
47
|
+
textToBm25SparseVector,
|
|
48
|
+
QDRANT_STORAGE_DEFAULTS,
|
|
49
|
+
type QdrantStorageConfig,
|
|
50
|
+
} from "@untangle-code/storage-qdrant";
|
|
51
|
+
|
|
52
|
+
import { OperationalError } from "./exit.js";
|
|
53
|
+
import type { IndexStateScope, IndexStateV1 } from "./index-state.js";
|
|
54
|
+
import { systemClock, systemRandom } from "./system.js";
|
|
55
|
+
import { assertVectorStoreAllowed, decideVectorStore } from "./vector-store-policy.js";
|
|
56
|
+
|
|
57
|
+
/** Die aufgeloeste Sicht des Projekts, wie sie jeder Befehl sieht. */
|
|
58
|
+
export interface WorkspaceView {
|
|
59
|
+
readonly root: string;
|
|
60
|
+
readonly config: EffectiveUntangleConfigV1;
|
|
61
|
+
readonly load: LoadConfigResult;
|
|
62
|
+
readonly workspaceId: string;
|
|
63
|
+
readonly profile: EmbeddingProfile;
|
|
64
|
+
readonly profileId: string;
|
|
65
|
+
readonly profileShortId: string;
|
|
66
|
+
/** Repository-IDs aus der Konfiguration, codepoint-sortiert. */
|
|
67
|
+
readonly repoIds: readonly string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Laedt die Konfiguration und leitet Identitaeten ab.
|
|
72
|
+
*
|
|
73
|
+
* `strict` entscheidet ueber spec.md §4.8: mit `strict` bricht ein
|
|
74
|
+
* Konfigurationsfehler ab (was jeder Befehl tut, der wirklich etwas tut),
|
|
75
|
+
* ohne `strict` kommen die Befunde als Daten zurueck (was `doctor` braucht,
|
|
76
|
+
* denn `doctor` soll den Fehler ja BERICHTEN statt an ihm zu sterben).
|
|
77
|
+
*/
|
|
78
|
+
export function loadWorkspace(options: {
|
|
79
|
+
cwd: string;
|
|
80
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
81
|
+
workspaceIdOverride?: string | undefined;
|
|
82
|
+
strict: boolean;
|
|
83
|
+
}): WorkspaceView {
|
|
84
|
+
const load = loadConfig({
|
|
85
|
+
cwd: options.cwd,
|
|
86
|
+
env: options.env as NodeJS.ProcessEnv,
|
|
87
|
+
});
|
|
88
|
+
if (options.strict) assertConfigValid(load.errors);
|
|
89
|
+
|
|
90
|
+
const profile = deriveEmbeddingProfile(load.effectiveConfig);
|
|
91
|
+
const profileId = buildEmbeddingProfileId(profile);
|
|
92
|
+
const repoIds = (load.effectiveConfig.repositories ?? [])
|
|
93
|
+
.map((repo) => repo.id)
|
|
94
|
+
.sort(compareCodepoints);
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
root: load.sources.projectRoot ?? load.sources.configBaseDir,
|
|
98
|
+
config: load.effectiveConfig,
|
|
99
|
+
load,
|
|
100
|
+
workspaceId: options.workspaceIdOverride ?? load.workspaceId,
|
|
101
|
+
profile,
|
|
102
|
+
profileId,
|
|
103
|
+
profileShortId: embeddingProfileShortId(profileId),
|
|
104
|
+
repoIds,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Konfigurationsbefunde als Textzeilen — Warnungen wie Fehler, nie stumm. */
|
|
109
|
+
export function describeConfigIssues(issues: readonly ConfigIssue[]): string[] {
|
|
110
|
+
return issues
|
|
111
|
+
.map((issue) => `${issue.path || "(root)"}: ${issue.message} [${issue.code}]`)
|
|
112
|
+
.sort(compareCodepoints);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface StorageWiring {
|
|
116
|
+
readonly qdrantConfig?: QdrantStorageConfig;
|
|
117
|
+
readonly backend: "lancedb" | "qdrant";
|
|
118
|
+
readonly storeUrl: string;
|
|
119
|
+
readonly storagePath?: string;
|
|
120
|
+
readonly collectionPrefix: string;
|
|
121
|
+
readonly storage: {
|
|
122
|
+
vectorStore: VectorStore;
|
|
123
|
+
metadataStore: MetadataStore;
|
|
124
|
+
graphStore: GraphStore;
|
|
125
|
+
close?: () => Promise<void>;
|
|
126
|
+
};
|
|
127
|
+
readonly vectorStore: VectorStore;
|
|
128
|
+
readonly codeCollection: string;
|
|
129
|
+
/** Woher die benutzte Adresse kommt — `doctor` zeigt das dem Nutzer. */
|
|
130
|
+
readonly decision: ReturnType<typeof decideVectorStore>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Build the selected storage adapter from the resolved configuration.
|
|
135
|
+
* Local LanceDB is lazy; the service ownership policy below applies to Qdrant.
|
|
136
|
+
*
|
|
137
|
+
* WP-222: das ist der Engpass, durch den JEDER Befehl geht, der einen
|
|
138
|
+
* Vektorspeicher anfasst — und deshalb die Stelle, an der die Regel aus
|
|
139
|
+
* `vector-store-policy.ts` durchgesetzt wird. Sie wird VOR dem Aufloesen
|
|
140
|
+
* gefragt und danach noch einmal gegen das Ergebnis geprueft: die
|
|
141
|
+
* Entscheidung bestimmt die Adresse, statt eine Adapter-Vorgabe hinterher zu
|
|
142
|
+
* segnen. Vorher fiel `mode: "managed"` ohne `url` im Adapter auf den
|
|
143
|
+
* Standardport einer fremden Instanz zurueck, und `doctor` meldete diese
|
|
144
|
+
* Instanz als in Ordnung.
|
|
145
|
+
*/
|
|
146
|
+
export function wireStorage(
|
|
147
|
+
view: WorkspaceView,
|
|
148
|
+
env: Readonly<Record<string, string | undefined>>,
|
|
149
|
+
): StorageWiring {
|
|
150
|
+
if (view.config.storage.backend === "lancedb") return wireLanceDbStorage(view);
|
|
151
|
+
if (view.config.storage.backend !== "qdrant") {
|
|
152
|
+
throw new OperationalError(
|
|
153
|
+
"Invalid storage backend.",
|
|
154
|
+
"Set storage.backend to lancedb or qdrant.",
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
const decision = decideVectorStore({ qdrant: view.config.qdrant, env });
|
|
158
|
+
if (!decision.allowed) {
|
|
159
|
+
throw new OperationalError(decision.reason, decision.nextStep ?? "See `untangle init --help`.");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
let qdrantConfig: QdrantStorageConfig;
|
|
163
|
+
try {
|
|
164
|
+
qdrantConfig = resolveQdrantStorageConfig({ ...view.config.qdrant, url: decision.url }, env);
|
|
165
|
+
} catch (error) {
|
|
166
|
+
throw new OperationalError(
|
|
167
|
+
`Cannot resolve Qdrant configuration: ${errorMessage(error)}`,
|
|
168
|
+
'Check your configuration\'s `qdrant` section; mode "external" requires `url`.',
|
|
169
|
+
{ cause: error },
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
assertVectorStoreAllowed(decision, qdrantConfig.url);
|
|
173
|
+
|
|
174
|
+
const transport = new FetchQdrantTransport({
|
|
175
|
+
url: qdrantConfig.url,
|
|
176
|
+
...(qdrantConfig.apiKey === undefined ? {} : { apiKey: qdrantConfig.apiKey }),
|
|
177
|
+
requestTimeoutMs: qdrantConfig.requestTimeoutMs,
|
|
178
|
+
});
|
|
179
|
+
const storage = createQdrantStorage({ config: qdrantConfig, clock: systemClock, transport });
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
backend: "qdrant",
|
|
183
|
+
storeUrl: qdrantConfig.url,
|
|
184
|
+
collectionPrefix: qdrantConfig.collectionPrefix,
|
|
185
|
+
qdrantConfig,
|
|
186
|
+
storage,
|
|
187
|
+
vectorStore: storage.vectorStore,
|
|
188
|
+
codeCollection: codeCollectionName(qdrantConfig.collectionPrefix, view.profileShortId),
|
|
189
|
+
decision,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Local storage is lazy: wiring and missing-index reads create no directories. */
|
|
194
|
+
function wireLanceDbStorage(view: WorkspaceView): StorageWiring {
|
|
195
|
+
const storagePath = canonicalLocalPath(
|
|
196
|
+
path.resolve(view.root, view.config.storage.path ?? ".untangle/index/lancedb"),
|
|
197
|
+
);
|
|
198
|
+
const storeUrl = pathToFileURL(storagePath).href;
|
|
199
|
+
const config = QDRANT_STORAGE_DEFAULTS;
|
|
200
|
+
const storage = createLanceDbStorage({
|
|
201
|
+
path: storagePath,
|
|
202
|
+
clock: systemClock,
|
|
203
|
+
collectionPrefix: config.collectionPrefix,
|
|
204
|
+
upsertMaxPoints: config.upsertMaxPoints,
|
|
205
|
+
upsertBudgetBytes: config.upsertBudgetBytes,
|
|
206
|
+
graphPartBudgetBytes: config.graphPartBudgetBytes,
|
|
207
|
+
});
|
|
208
|
+
return {
|
|
209
|
+
backend: "lancedb",
|
|
210
|
+
storeUrl,
|
|
211
|
+
storagePath,
|
|
212
|
+
collectionPrefix: config.collectionPrefix,
|
|
213
|
+
storage,
|
|
214
|
+
vectorStore: storage.vectorStore,
|
|
215
|
+
codeCollection: codeCollectionName(config.collectionPrefix, view.profileShortId),
|
|
216
|
+
decision: {
|
|
217
|
+
url: storeUrl,
|
|
218
|
+
origin: "embedded",
|
|
219
|
+
allowed: true,
|
|
220
|
+
reason: "project-local LanceDB; no database server required",
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function canonicalLocalPath(selected: string): string {
|
|
226
|
+
try {
|
|
227
|
+
return realpathSync(selected);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
230
|
+
const parent = path.dirname(selected);
|
|
231
|
+
if (parent === selected) throw error;
|
|
232
|
+
return path.join(canonicalLocalPath(parent), path.basename(selected));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Old Qdrant records retain their endpoint identity; embedded stores never adopt them. */
|
|
237
|
+
export function matchesStoredBackend(
|
|
238
|
+
state: IndexStateV1,
|
|
239
|
+
wiring: Pick<StorageWiring, "backend" | "storeUrl">,
|
|
240
|
+
): boolean {
|
|
241
|
+
return (
|
|
242
|
+
(state.storageBackend ?? "qdrant") === wiring.backend &&
|
|
243
|
+
(state.storeUrl ?? state.qdrantUrl) === wiring.storeUrl
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function storageIndexScope(
|
|
248
|
+
wiring: Pick<StorageWiring, "backend" | "storeUrl">,
|
|
249
|
+
): Pick<IndexStateScope, "storageBackend" | "storeUrl"> {
|
|
250
|
+
return { storageBackend: wiring.backend, storeUrl: wiring.storeUrl };
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Baut den Ollama-Embedder aus der aufgeloesten Konfiguration. */
|
|
254
|
+
export function wireEmbedder(view: WorkspaceView): EmbeddingProvider {
|
|
255
|
+
const embeddings = view.config.embeddings;
|
|
256
|
+
return new OllamaEmbeddingProvider(
|
|
257
|
+
{
|
|
258
|
+
profile: view.profile,
|
|
259
|
+
mode: embeddings.mode,
|
|
260
|
+
url: embeddings.url,
|
|
261
|
+
apiKeyEnv: embeddings.apiKeyEnv,
|
|
262
|
+
contextLength: embeddings.contextLength,
|
|
263
|
+
batchSize: embeddings.batchSize,
|
|
264
|
+
maxConnections: embeddings.maxConnections,
|
|
265
|
+
requestTimeoutMs: embeddings.requestTimeoutMs,
|
|
266
|
+
},
|
|
267
|
+
{ clock: systemClock, random: systemRandom },
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Baut den Abrufkern.
|
|
273
|
+
*
|
|
274
|
+
* Ein Ziel je Embedding-Profil (spec.md §13.4). Diese Fassung kennt genau ein
|
|
275
|
+
* Profil — das der Konfiguration. Mehrere Profile in einem Workspace sind im
|
|
276
|
+
* Abrufkern vorgesehen, hier aber noch nicht konfigurierbar; das steht so in
|
|
277
|
+
* der README unter „Bekannte Grenzen".
|
|
278
|
+
*/
|
|
279
|
+
export function wireSearchEngine(input: {
|
|
280
|
+
view: WorkspaceView;
|
|
281
|
+
vectorStore: VectorStore;
|
|
282
|
+
collection: string;
|
|
283
|
+
embedder: EmbeddingProvider;
|
|
284
|
+
indexContexts?: readonly {
|
|
285
|
+
repoId: string;
|
|
286
|
+
refId: string;
|
|
287
|
+
generationId: string;
|
|
288
|
+
corpusRevisionFingerprint?: string;
|
|
289
|
+
outcome: "running" | "completed" | "cancelled" | "failed";
|
|
290
|
+
}[];
|
|
291
|
+
graphEnrichment?: SearchGraphEnrichmentPort;
|
|
292
|
+
}): HybridSearchEngine {
|
|
293
|
+
const target: ProfileTargetV1 = {
|
|
294
|
+
embeddingProfileId: input.view.profileId,
|
|
295
|
+
collection: input.collection,
|
|
296
|
+
repoIds: [...input.view.repoIds],
|
|
297
|
+
embedder: input.embedder,
|
|
298
|
+
...(input.indexContexts === undefined ? {} : { indexContexts: input.indexContexts }),
|
|
299
|
+
};
|
|
300
|
+
return createHybridSearchEngine({
|
|
301
|
+
vectorStore: input.vectorStore,
|
|
302
|
+
targets: [target],
|
|
303
|
+
defaults: {
|
|
304
|
+
workspaceId: input.view.workspaceId,
|
|
305
|
+
limit: input.view.config.search.defaultLimit,
|
|
306
|
+
candidateLimit: input.view.config.search.defaultCandidateLimit,
|
|
307
|
+
},
|
|
308
|
+
searchConfig: input.view.config.search,
|
|
309
|
+
clock: systemClock,
|
|
310
|
+
sparseVectorizer: textToBm25SparseVector,
|
|
311
|
+
...(input.graphEnrichment === undefined ? {} : { graphEnrichment: input.graphEnrichment }),
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** Die Botschaft eines unbekannten Wurfs, ohne je `[object Object]` zu zeigen. */
|
|
316
|
+
export function errorMessage(error: unknown): string {
|
|
317
|
+
if (error instanceof Error) return error.message;
|
|
318
|
+
if (typeof error === "string") return error;
|
|
319
|
+
try {
|
|
320
|
+
return JSON.stringify(error);
|
|
321
|
+
} catch {
|
|
322
|
+
return String(error);
|
|
323
|
+
}
|
|
324
|
+
}
|