@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,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die Ausgabe von `untangle index`.
|
|
3
|
+
*
|
|
4
|
+
* ZWEI REGELN, die den Text tragen:
|
|
5
|
+
* 1. Fortschritt geht nach STDERR, der Bericht nach STDOUT. Nur so bleibt
|
|
6
|
+
* `untangle index --format=json | jq` benutzbar, waehrend man beim Laufen
|
|
7
|
+
* trotzdem etwas sieht.
|
|
8
|
+
* 2. Die Zahl „uebersprungen" steht IMMER da — auch wenn sie 0 ist. Eine Zahl,
|
|
9
|
+
* die nur bei Problemen erscheint, liest sich beim Fehlen wie „alles gut",
|
|
10
|
+
* und genau das ist der Unterschied zwischen „nichts uebersprungen" und
|
|
11
|
+
* „nicht nachgesehen".
|
|
12
|
+
*/
|
|
13
|
+
import type { IndexPlanV1, IndexReportV1 } from "@untangle-code/core";
|
|
14
|
+
import { compareCodepoints, type JobEvent } from "@untangle-code/domain";
|
|
15
|
+
|
|
16
|
+
import { line, note, type Io } from "../../cli/io.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Der laufende Stand eines Indexlaufs — AUSSCHLIESSLICH fuer die Anzeige.
|
|
20
|
+
*
|
|
21
|
+
* Er zaehlt mit, was die Ereignisse melden, damit eine Fortschrittszeile
|
|
22
|
+
* „12 von 47 Dateien" sagen kann statt nur „Stapel 3". Diese Zahlen sind
|
|
23
|
+
* keine Ergebnisdaten: der Bericht am Ende zaehlt selbst (siehe
|
|
24
|
+
* `IndexCountsV1`), und beide muessen sich decken.
|
|
25
|
+
*/
|
|
26
|
+
export interface IndexProgressV1 {
|
|
27
|
+
plannedFiles: number;
|
|
28
|
+
embeddedFiles: number;
|
|
29
|
+
storedPoints: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createIndexProgress(): IndexProgressV1 {
|
|
33
|
+
return { plannedFiles: 0, embeddedFiles: 0, storedPoints: 0 };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Die Kopfzeilen VOR dem ersten Ereignis.
|
|
38
|
+
*
|
|
39
|
+
* WP-227: Der Laeufer meldet eine Stufe erst, wenn sie FERTIG ist. Haengt die
|
|
40
|
+
* erste Stufe — und genau das tut sie, wenn der Einbettungsdienst nicht
|
|
41
|
+
* antwortet —, dann gibt es ohne diese Zeilen ueberhaupt keine Ausgabe. Der
|
|
42
|
+
* Nutzer sieht dann nicht einmal, WORAUF gewartet wird. Deshalb steht hier,
|
|
43
|
+
* was gleich passiert, bevor irgendetwas passiert.
|
|
44
|
+
*/
|
|
45
|
+
export function renderRunHeader(
|
|
46
|
+
io: Io,
|
|
47
|
+
input: {
|
|
48
|
+
rootPath: string;
|
|
49
|
+
repoId: string;
|
|
50
|
+
refName: string;
|
|
51
|
+
collection: string;
|
|
52
|
+
embedder: string;
|
|
53
|
+
timeoutMs: number;
|
|
54
|
+
},
|
|
55
|
+
): void {
|
|
56
|
+
note(io, `[ 0%] Target: ${input.rootPath}`);
|
|
57
|
+
note(
|
|
58
|
+
io,
|
|
59
|
+
` Repository ${input.repoId}, Ref ${input.refName}, collection ${input.collection}.`,
|
|
60
|
+
);
|
|
61
|
+
note(
|
|
62
|
+
io,
|
|
63
|
+
` Embedder ${input.embedder}, deadline ${String(input.timeoutMs)} ms per call ` +
|
|
64
|
+
"(--timeout). Five stages: check services, discover files, process, " +
|
|
65
|
+
"build graphs, commit.",
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Eine Fortschrittszeile je Ereignis — kurz, und nie auf stdout. */
|
|
70
|
+
export function renderEvent(
|
|
71
|
+
io: Io,
|
|
72
|
+
event: JobEvent,
|
|
73
|
+
verbose: boolean,
|
|
74
|
+
progress: IndexProgressV1 = createIndexProgress(),
|
|
75
|
+
): void {
|
|
76
|
+
switch (event.kind) {
|
|
77
|
+
case "job_queued":
|
|
78
|
+
note(io, `[ 1%] Job ${event.jobId} queued. Stage 1/5: embedding service and collection.`);
|
|
79
|
+
return;
|
|
80
|
+
case "infrastructure_ready":
|
|
81
|
+
note(
|
|
82
|
+
io,
|
|
83
|
+
`[ 10%] Ready: ${Object.entries(event.endpoints)
|
|
84
|
+
.sort(([a], [b]) => compareCodepoints(a, b))
|
|
85
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
86
|
+
.join(" ")}`,
|
|
87
|
+
);
|
|
88
|
+
note(io, "[ 15%] Stage 2/5: discovering files …");
|
|
89
|
+
return;
|
|
90
|
+
case "files_discovered":
|
|
91
|
+
progress.plannedFiles = event.changedFiles;
|
|
92
|
+
note(
|
|
93
|
+
io,
|
|
94
|
+
`[ 20%] Found: ${String(event.totalFiles)} files, including ` +
|
|
95
|
+
`${String(event.changedFiles)} planned, ${String(event.unchangedFiles)} unchanged, ` +
|
|
96
|
+
`${String(event.ignoredFiles)} ignoriert.`,
|
|
97
|
+
);
|
|
98
|
+
note(
|
|
99
|
+
io,
|
|
100
|
+
event.changedFiles === 0
|
|
101
|
+
? "[ 25%] Stage 3/5: nothing to process; every discovered file is unchanged."
|
|
102
|
+
: `[ 25%] Stage 3/5: ${String(event.changedFiles)} files to parse, embed and store …`,
|
|
103
|
+
);
|
|
104
|
+
return;
|
|
105
|
+
case "file_analyzed":
|
|
106
|
+
if (verbose) {
|
|
107
|
+
note(
|
|
108
|
+
io,
|
|
109
|
+
` analysiert ${event.filePath} (${String(event.chunkCount)} Chunks, ` +
|
|
110
|
+
`${String(event.symbolCount)} symbols, parse=${event.parseQuality})`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
case "embedding_batch_completed":
|
|
115
|
+
progress.embeddedFiles += event.batchSize;
|
|
116
|
+
note(
|
|
117
|
+
io,
|
|
118
|
+
`[${percentOfPipeline(progress)}] Batch ${String(event.batchIndex)}: ` +
|
|
119
|
+
`${String(event.batchSize)} files embedded ` +
|
|
120
|
+
`(${String(progress.embeddedFiles)} of ${String(progress.plannedFiles)}), ` +
|
|
121
|
+
`${String(event.cacheHits)} from cache, ` +
|
|
122
|
+
`${String(event.truncatedCount)} gekuerzt.`,
|
|
123
|
+
);
|
|
124
|
+
return;
|
|
125
|
+
case "points_stored":
|
|
126
|
+
progress.storedPoints += event.pointCount;
|
|
127
|
+
note(
|
|
128
|
+
io,
|
|
129
|
+
`[${percentOfPipeline(progress)}] Stored: ${String(event.pointCount)} points in ` +
|
|
130
|
+
`${event.collection} (${String(event.serializedBytes)} Bytes, ` +
|
|
131
|
+
`${String(progress.storedPoints)} total).`,
|
|
132
|
+
);
|
|
133
|
+
return;
|
|
134
|
+
case "checkpoint_saved":
|
|
135
|
+
if (verbose) {
|
|
136
|
+
note(io, ` Checkpoint at ${event.stage}: ${String(event.completedFileCount)} files.`);
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
case "graph_updated":
|
|
140
|
+
note(
|
|
141
|
+
io,
|
|
142
|
+
`[ 85%] Stage 4/5 — graph ${event.graph}: ${String(event.nodeCount)} nodes, ` +
|
|
143
|
+
`${String(event.edgeCount)} edges.`,
|
|
144
|
+
);
|
|
145
|
+
return;
|
|
146
|
+
case "job_completed":
|
|
147
|
+
note(io, `[100%] Finished in ${String(event.durationMs)} ms.`);
|
|
148
|
+
return;
|
|
149
|
+
case "job_failed":
|
|
150
|
+
note(io, `[ !! ] Failed: ${event.errorCode} — ${event.message}`);
|
|
151
|
+
return;
|
|
152
|
+
case "job_cancelled":
|
|
153
|
+
note(io, `[ -- ] Cancelled. Checkpoint saved: ${event.checkpointSaved ? "ja" : "no"}.`);
|
|
154
|
+
return;
|
|
155
|
+
default:
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Der Anteil der Verarbeitungsstufe am Ganzen: sie liegt zwischen 25 % und
|
|
162
|
+
* 80 %. Ohne bekannte Dateizahl bleibt es bei 50 % — eine erfundene
|
|
163
|
+
* Genauigkeit waere schlimmer als gar keine.
|
|
164
|
+
*/
|
|
165
|
+
function percentOfPipeline(progress: IndexProgressV1): string {
|
|
166
|
+
if (progress.plannedFiles <= 0) return " 50%";
|
|
167
|
+
const done = Math.min(progress.embeddedFiles, progress.plannedFiles);
|
|
168
|
+
const percent = 25 + Math.floor((55 * done) / progress.plannedFiles);
|
|
169
|
+
return `${String(percent).padStart(3, " ")}%`;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Der Bericht als Text. */
|
|
173
|
+
export function renderReport(io: Io, report: IndexReportV1): void {
|
|
174
|
+
const c = report.counts;
|
|
175
|
+
line(io, `Outcome: ${report.outcome}`);
|
|
176
|
+
line(io, `Repository: ${report.repoId}`);
|
|
177
|
+
line(io, `Ref: ${report.refId}`);
|
|
178
|
+
line(io, `Generation: ${report.generationId ?? "(none)"}`);
|
|
179
|
+
line(io, `Collection: ${report.collection}`);
|
|
180
|
+
line(io, `Profile: ${report.embeddingProfileId}`);
|
|
181
|
+
line(io, "");
|
|
182
|
+
line(io, `Files discovered: ${String(c.filesSeen)}`);
|
|
183
|
+
line(io, ` planned: ${String(c.filesPlanned)}`);
|
|
184
|
+
line(io, ` unchanged: ${String(c.filesUnchanged)} (not recomputed)`);
|
|
185
|
+
line(io, ` ignoriert: ${String(c.filesIgnored)}`);
|
|
186
|
+
line(io, `Files analyzed: ${String(c.filesAnalyzed)}`);
|
|
187
|
+
line(io, `Files removed: ${String(c.filesRemoved)}`);
|
|
188
|
+
line(io, `Chunks: ${String(c.chunks)}`);
|
|
189
|
+
line(io, `Symbols: ${String(c.symbols)}`);
|
|
190
|
+
line(io, `Points stored: ${String(c.points)}`);
|
|
191
|
+
line(
|
|
192
|
+
io,
|
|
193
|
+
`Embeddings: ${String(c.embeddingsComputed)} computed, ` +
|
|
194
|
+
`${String(c.embeddingCacheHits)} from cache, ` +
|
|
195
|
+
`${String(c.truncated)} gekuerzt`,
|
|
196
|
+
);
|
|
197
|
+
line(io, analysisCacheLine(c));
|
|
198
|
+
line(
|
|
199
|
+
io,
|
|
200
|
+
`File graph: ${String(c.fileGraphNodes)} nodes, ${String(c.fileGraphEdges)} edges`,
|
|
201
|
+
);
|
|
202
|
+
line(
|
|
203
|
+
io,
|
|
204
|
+
`Symbol graph: ${String(c.symbolGraphNodes)} nodes, ${String(c.symbolGraphEdges)} edges`,
|
|
205
|
+
);
|
|
206
|
+
line(io, "");
|
|
207
|
+
renderSkips(
|
|
208
|
+
io,
|
|
209
|
+
report.skipped.length,
|
|
210
|
+
report.skippedByReason,
|
|
211
|
+
report.skippedByStage,
|
|
212
|
+
report.skippedTruncated,
|
|
213
|
+
);
|
|
214
|
+
if (report.failure !== undefined) {
|
|
215
|
+
line(io, "");
|
|
216
|
+
line(io, `FAILURE ${report.failure.code}: ${report.failure.message}`);
|
|
217
|
+
line(io, `Retryable: ${report.failure.retryable ? "ja" : "no"}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Der Trockenlauf als Text. */
|
|
222
|
+
export function renderPlan(io: Io, plan: IndexPlanV1, showFiles: number): void {
|
|
223
|
+
line(io, `Files discovered: ${String(plan.filesSeen)}`);
|
|
224
|
+
line(io, ` would plan: ${String(plan.planned.length)}`);
|
|
225
|
+
line(io, ` unchanged: ${String(plan.filesUnchanged)}`);
|
|
226
|
+
line(io, ` ignoriert: ${String(plan.filesIgnored)}`);
|
|
227
|
+
line(io, ` entfernt: ${String(plan.removedFileIds.length)}`);
|
|
228
|
+
if (plan.previousUnavailable !== undefined) {
|
|
229
|
+
line(io, "");
|
|
230
|
+
line(
|
|
231
|
+
io,
|
|
232
|
+
`Note: the previous generation could not be read (${plan.previousUnavailable}). ` +
|
|
233
|
+
"All files are therefore considered planned; this number is an upper bound, " +
|
|
234
|
+
"not a comparison.",
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
line(io, "");
|
|
238
|
+
renderSkips(
|
|
239
|
+
io,
|
|
240
|
+
plan.skipped.length,
|
|
241
|
+
plan.skippedByReason,
|
|
242
|
+
plan.skippedByStage,
|
|
243
|
+
plan.skippedTruncated,
|
|
244
|
+
);
|
|
245
|
+
if (showFiles > 0 && plan.planned.length > 0) {
|
|
246
|
+
line(io, "");
|
|
247
|
+
line(io, `Planned work (first ${String(Math.min(showFiles, plan.planned.length))}):`);
|
|
248
|
+
for (const file of plan.planned.slice(0, showFiles)) {
|
|
249
|
+
line(io, ` ${file.filePath}`);
|
|
250
|
+
}
|
|
251
|
+
if (plan.planned.length > showFiles) {
|
|
252
|
+
line(io, ` … and ${String(plan.planned.length - showFiles)} weitere.`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Stufen, die von DATEIEN handeln. Alles andere handelt von Kanten und
|
|
259
|
+
* Kandidaten — zwei Dinge, die in einer gemeinsamen Zahl nur verwirren:
|
|
260
|
+
* „9207 uebersprungen" liest sich wie ein kaputter Index, ist aber die
|
|
261
|
+
* normale Meldung des Symbolgraphen ueber Aufrufe nach ausserhalb.
|
|
262
|
+
*/
|
|
263
|
+
const FILE_STAGES = new Set(["scan", "parse", "chunk", "embed", "store"]);
|
|
264
|
+
|
|
265
|
+
function renderSkips(
|
|
266
|
+
io: Io,
|
|
267
|
+
listed: number,
|
|
268
|
+
byReason: Readonly<Record<string, number | undefined>>,
|
|
269
|
+
byStage: Readonly<Record<string, number | undefined>>,
|
|
270
|
+
truncated: number,
|
|
271
|
+
): void {
|
|
272
|
+
const total = Object.values(byReason).reduce<number>((sum, value) => sum + (value ?? 0), 0);
|
|
273
|
+
const fileTotal = Object.entries(byStage)
|
|
274
|
+
.filter(([stage]) => FILE_STAGES.has(stage))
|
|
275
|
+
.reduce<number>((sum, [, value]) => sum + (value ?? 0), 0);
|
|
276
|
+
|
|
277
|
+
line(io, `Skipped: ${String(total)} (each entry includes a reason)`);
|
|
278
|
+
line(io, ` files: ${String(fileTotal)}`);
|
|
279
|
+
line(io, ` graph/search: ${String(total - fileTotal)}`);
|
|
280
|
+
line(io, "");
|
|
281
|
+
line(io, " by stage:");
|
|
282
|
+
for (const stage of Object.keys(byStage).sort(compareCodepoints)) {
|
|
283
|
+
line(io, ` ${stage.padEnd(26)} ${String(byStage[stage] ?? 0)}`);
|
|
284
|
+
}
|
|
285
|
+
line(io, " by reason:");
|
|
286
|
+
for (const reason of Object.keys(byReason).sort(compareCodepoints)) {
|
|
287
|
+
line(io, ` ${reason.padEnd(26)} ${String(byReason[reason] ?? 0)}`);
|
|
288
|
+
}
|
|
289
|
+
if (truncated > 0) {
|
|
290
|
+
line(
|
|
291
|
+
io,
|
|
292
|
+
` (${String(truncated)} entries are counted but omitted from the list ` +
|
|
293
|
+
`listed individually; ${String(listed)} appear in --format=json)`,
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Die Trefferquote der drei inhaltsadressierten Analyse-Caches (WP-100).
|
|
300
|
+
*
|
|
301
|
+
* Sie steht IM BERICHT und nicht nur im Protokoll, weil ein Cache, ueber den
|
|
302
|
+
* niemand etwas erfaehrt, nicht ueberpruefbar ist: erst die Quote zeigt, ob
|
|
303
|
+
* der zweite Lauf wirklich gespart hat oder ob nur die Uhr guenstig stand.
|
|
304
|
+
*/
|
|
305
|
+
function analysisCacheLine(c: {
|
|
306
|
+
parseCacheHits: number;
|
|
307
|
+
parseCacheMisses: number;
|
|
308
|
+
chunkCacheHits: number;
|
|
309
|
+
chunkCacheMisses: number;
|
|
310
|
+
metricsCacheHits: number;
|
|
311
|
+
metricsCacheMisses: number;
|
|
312
|
+
}): string {
|
|
313
|
+
const hits = c.parseCacheHits + c.chunkCacheHits + c.metricsCacheHits;
|
|
314
|
+
const lookups = hits + c.parseCacheMisses + c.chunkCacheMisses + c.metricsCacheMisses;
|
|
315
|
+
if (lookups === 0) {
|
|
316
|
+
return "Analysis cache: off (no cache connected)";
|
|
317
|
+
}
|
|
318
|
+
const rate = ((hits / lookups) * 100).toFixed(1);
|
|
319
|
+
return (
|
|
320
|
+
`Analysis cache: ${String(hits)}/${String(lookups)} hits (${rate} %) — ` +
|
|
321
|
+
`Parse ${String(c.parseCacheHits)}/${String(c.parseCacheHits + c.parseCacheMisses)}, ` +
|
|
322
|
+
`Chunk ${String(c.chunkCacheHits)}/${String(c.chunkCacheHits + c.chunkCacheMisses)}, ` +
|
|
323
|
+
`metric ${String(c.metricsCacheHits)}/${String(c.metricsCacheHits + c.metricsCacheMisses)}`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Welches Repository und welcher Ref indiziert werden.
|
|
3
|
+
*
|
|
4
|
+
* ZWEI FAELLE, UND BEIDE MUESSEN EHRLICH SEIN:
|
|
5
|
+
*
|
|
6
|
+
* 1. Die Konfiguration nennt Repositories (spec.md §4.3). Dann wird genau
|
|
7
|
+
* eines davon gewaehlt — das mit `--repo` benannte, oder das einzige. Bei
|
|
8
|
+
* mehreren ohne Angabe wird NICHT geraten, sondern gefragt: ein falsch
|
|
9
|
+
* geratenes Repository indiziert stumm das falsche Projekt.
|
|
10
|
+
* 2. Die Konfiguration nennt keine (der haeufigste Fall beim ersten Aufruf).
|
|
11
|
+
* Dann ist das Zielverzeichnis selbst das Repository. Das steht in der
|
|
12
|
+
* Ausgabe, damit niemand glaubt, es sei konfiguriert worden.
|
|
13
|
+
*
|
|
14
|
+
* DER REFNAME wird aus `.git/HEAD` gelesen, wenn es ihn gibt. Steht dort ein
|
|
15
|
+
* losgeloester Commit oder gibt es kein Git, heisst der Ref
|
|
16
|
+
* `"working-tree"` — ein Name, der sagt, was er ist, statt „main" zu
|
|
17
|
+
* behaupten und damit zwei verschiedene Staende unter derselben Identitaet
|
|
18
|
+
* abzulegen.
|
|
19
|
+
*/
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
|
|
23
|
+
import type { EffectiveUntangleConfigV1 } from "@untangle-code/config";
|
|
24
|
+
import { buildRefId, buildRepoId, compareCodepoints } from "@untangle-code/domain";
|
|
25
|
+
|
|
26
|
+
import { UsageError } from "../../cli/exit.js";
|
|
27
|
+
|
|
28
|
+
/** Der Ref, der gemeint ist, wenn kein Git-Zweig lesbar ist. */
|
|
29
|
+
export const WORKING_TREE_REF = "working-tree";
|
|
30
|
+
|
|
31
|
+
export interface ResolvedTarget {
|
|
32
|
+
repoId: string;
|
|
33
|
+
refId: string;
|
|
34
|
+
refName: string;
|
|
35
|
+
repoLabel: string;
|
|
36
|
+
rootPath: string;
|
|
37
|
+
/** True, wenn das Repository nicht aus der Konfiguration stammt. */
|
|
38
|
+
synthesized: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* `include`/`exclude` des gewaehlten Repositories (spec.md §4.3).
|
|
41
|
+
*
|
|
42
|
+
* SIE MUESSEN WEITERGEREICHT WERDEN. Werden sie es nicht, indiziert der Lauf
|
|
43
|
+
* stumm mehr, als die Konfiguration erlaubt — inklusive des eigenen
|
|
44
|
+
* Zustandsverzeichnisses `.untangle`, dessen Zwischenspeicherdateien sich
|
|
45
|
+
* bei jedem Lauf aendern und den naechsten Lauf jedes Mal Arbeit vortaeuschen
|
|
46
|
+
* lassen. Genau das ist beim ersten Bau dieses Befehls passiert.
|
|
47
|
+
*/
|
|
48
|
+
include: readonly string[] | undefined;
|
|
49
|
+
exclude: readonly string[] | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function resolveTarget(input: {
|
|
53
|
+
config: EffectiveUntangleConfigV1;
|
|
54
|
+
cwd: string;
|
|
55
|
+
rootFlag: string | undefined;
|
|
56
|
+
repoFlag: string | undefined;
|
|
57
|
+
refFlag: string | undefined;
|
|
58
|
+
configBaseDir: string;
|
|
59
|
+
}): ResolvedTarget {
|
|
60
|
+
const repositories = input.config.repositories ?? [];
|
|
61
|
+
|
|
62
|
+
if (repositories.length === 0) {
|
|
63
|
+
const rootPath = path.resolve(input.cwd, input.rootFlag ?? ".");
|
|
64
|
+
const refName = input.refFlag ?? detectRefName(rootPath);
|
|
65
|
+
const repoId = buildRepoId({ canonicalPath: rootPath });
|
|
66
|
+
return {
|
|
67
|
+
repoId,
|
|
68
|
+
refId: buildRefId(repoId, refName),
|
|
69
|
+
refName,
|
|
70
|
+
repoLabel: path.basename(rootPath),
|
|
71
|
+
rootPath,
|
|
72
|
+
synthesized: true,
|
|
73
|
+
include: undefined,
|
|
74
|
+
// Ohne Konfiguration gilt wenigstens die eine Regel, die immer stimmt:
|
|
75
|
+
// das eigene Zustandsverzeichnis ist kein Quelltext.
|
|
76
|
+
exclude: [".untangle"],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const chosen =
|
|
81
|
+
input.repoFlag === undefined
|
|
82
|
+
? repositories.length === 1
|
|
83
|
+
? repositories[0]
|
|
84
|
+
: undefined
|
|
85
|
+
: repositories.find((repo) => repo.id === input.repoFlag);
|
|
86
|
+
|
|
87
|
+
if (chosen === undefined) {
|
|
88
|
+
const names = repositories.map((repo) => repo.id).sort(compareCodepoints);
|
|
89
|
+
throw new UsageError(
|
|
90
|
+
input.repoFlag === undefined
|
|
91
|
+
? `The configuration contains ${String(repositories.length)} repositories; which should be indexed?`
|
|
92
|
+
: `The configuration has no repository "${input.repoFlag}".`,
|
|
93
|
+
`Select one with --repo=<id>. Known IDs: ${names.join(", ")}.`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const rootPath = path.resolve(input.configBaseDir, chosen.path);
|
|
98
|
+
const refName = input.refFlag ?? chosen.ref ?? detectRefName(rootPath);
|
|
99
|
+
const repoId = buildRepoId({
|
|
100
|
+
...(chosen.id === "" ? {} : { explicitId: chosen.id }),
|
|
101
|
+
canonicalPath: rootPath,
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
repoId,
|
|
105
|
+
refId: buildRefId(repoId, refName),
|
|
106
|
+
refName,
|
|
107
|
+
repoLabel: chosen.label ?? chosen.id,
|
|
108
|
+
rootPath,
|
|
109
|
+
synthesized: false,
|
|
110
|
+
include: chosen.include,
|
|
111
|
+
exclude:
|
|
112
|
+
chosen.exclude === undefined
|
|
113
|
+
? [".untangle"]
|
|
114
|
+
: chosen.exclude.includes(".untangle")
|
|
115
|
+
? chosen.exclude
|
|
116
|
+
: [...chosen.exclude, ".untangle"],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Zweigname aus `.git/HEAD`, sonst {@link WORKING_TREE_REF}. */
|
|
121
|
+
export function detectRefName(rootPath: string): string {
|
|
122
|
+
try {
|
|
123
|
+
let gitDir = path.join(rootPath, ".git");
|
|
124
|
+
try {
|
|
125
|
+
const pointer = /^gitdir:\s*(.+)$/u.exec(readFileSync(gitDir, "utf8").trim());
|
|
126
|
+
if (pointer?.[1] !== undefined) gitDir = path.resolve(rootPath, pointer[1]);
|
|
127
|
+
} catch {
|
|
128
|
+
/* A normal checkout has a .git directory. */
|
|
129
|
+
}
|
|
130
|
+
const head = readFileSync(path.join(gitDir, "HEAD"), "utf8").trim();
|
|
131
|
+
const match = /^ref:\s*refs\/heads\/(.+)$/u.exec(head);
|
|
132
|
+
return match?.[1] ?? WORKING_TREE_REF;
|
|
133
|
+
} catch {
|
|
134
|
+
return WORKING_TREE_REF;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { setTimeout as wait } from "node:timers/promises";
|
|
2
|
+
|
|
3
|
+
import type { IndexFreshnessV1 } from "@untangle-code/domain";
|
|
4
|
+
|
|
5
|
+
import type { CommandContext } from "../cli/command.js";
|
|
6
|
+
import { EXIT, EnvironmentError, UsageError } from "../cli/exit.js";
|
|
7
|
+
import { inspectIndexFreshness } from "../cli/index-freshness.js";
|
|
8
|
+
import { refreshWorkspaceIndex } from "../cli/index-refresh.js";
|
|
9
|
+
import { resolveIndexState } from "../cli/index-state.js";
|
|
10
|
+
import { systemClock } from "../cli/system.js";
|
|
11
|
+
import { loadWorkspace, storageIndexScope, wireStorage } from "../cli/workspace.js";
|
|
12
|
+
|
|
13
|
+
import { detectRefName, resolveTarget } from "./index/target.js";
|
|
14
|
+
import { createStreamSink } from "./watch/runtime.js";
|
|
15
|
+
|
|
16
|
+
export interface IndexWatchOptions {
|
|
17
|
+
root: string;
|
|
18
|
+
repo?: string;
|
|
19
|
+
ref?: string;
|
|
20
|
+
embedder: "auto" | "offline";
|
|
21
|
+
intervalMs: number;
|
|
22
|
+
format: "text" | "json";
|
|
23
|
+
outPath: string | null;
|
|
24
|
+
once: boolean;
|
|
25
|
+
maxRefreshes: number | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IndexWatchObservation {
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
repoId: string;
|
|
31
|
+
refId: string;
|
|
32
|
+
freshness: IndexFreshnessV1;
|
|
33
|
+
/** Bound to exactly the repository/ref that was inspected. */
|
|
34
|
+
refresh(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IndexWatchDependencies {
|
|
38
|
+
inspect(ctx: CommandContext, options: IndexWatchOptions): Promise<IndexWatchObservation>;
|
|
39
|
+
wait(intervalMs: number, signal: AbortSignal): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const DEFAULT_DEPENDENCIES: IndexWatchDependencies = {
|
|
43
|
+
inspect: inspectIndexWatch,
|
|
44
|
+
wait: async (intervalMs, signal) => {
|
|
45
|
+
await wait(intervalMs, undefined, { signal });
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** One serialized loop: re-read configuration and hash sources, then refresh if necessary. */
|
|
50
|
+
export async function runIndexWatch(
|
|
51
|
+
ctx: CommandContext,
|
|
52
|
+
options: IndexWatchOptions,
|
|
53
|
+
deps: IndexWatchDependencies = DEFAULT_DEPENDENCIES,
|
|
54
|
+
): Promise<number> {
|
|
55
|
+
const sink = createStreamSink({ stdout: (chunk) => ctx.io.out(chunk), outPath: options.outPath });
|
|
56
|
+
let refreshes = 0;
|
|
57
|
+
const emit = (
|
|
58
|
+
event: "checked" | "refresh_started" | "refreshed" | "failed" | "stopped",
|
|
59
|
+
observation?: IndexWatchObservation,
|
|
60
|
+
message?: string,
|
|
61
|
+
): void => {
|
|
62
|
+
const record = {
|
|
63
|
+
schemaVersion: 1,
|
|
64
|
+
kind: "index_watch",
|
|
65
|
+
event,
|
|
66
|
+
checkedAt: observation?.freshness.checkedAt ?? systemClock.nowIso(),
|
|
67
|
+
refreshes,
|
|
68
|
+
...(observation === undefined
|
|
69
|
+
? {}
|
|
70
|
+
: {
|
|
71
|
+
workspaceId: observation.workspaceId,
|
|
72
|
+
repoId: observation.repoId,
|
|
73
|
+
refId: observation.refId,
|
|
74
|
+
indexFreshness: observation.freshness,
|
|
75
|
+
}),
|
|
76
|
+
...(message === undefined ? {} : { message }),
|
|
77
|
+
};
|
|
78
|
+
sink.write(
|
|
79
|
+
options.format === "json"
|
|
80
|
+
? JSON.stringify(record)
|
|
81
|
+
: `Search index: ${event}${observation === undefined ? "" : ` ${observation.repoId}/${observation.refId}: ${observation.freshness.status}`}${message === undefined ? "" : ` — ${message}`}`,
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
let observation: IndexWatchObservation | undefined;
|
|
85
|
+
try {
|
|
86
|
+
while (true) {
|
|
87
|
+
ctx.signal.throwIfAborted();
|
|
88
|
+
observation = await deps.inspect(ctx, options);
|
|
89
|
+
ctx.signal.throwIfAborted();
|
|
90
|
+
emit("checked", observation);
|
|
91
|
+
if (observation.freshness.status !== "fresh") {
|
|
92
|
+
emit("refresh_started", observation);
|
|
93
|
+
await observation.refresh();
|
|
94
|
+
ctx.signal.throwIfAborted();
|
|
95
|
+
refreshes++;
|
|
96
|
+
observation = await deps.inspect(ctx, options);
|
|
97
|
+
ctx.signal.throwIfAborted();
|
|
98
|
+
emit("refreshed", observation);
|
|
99
|
+
if (
|
|
100
|
+
observation.freshness.status === "unknown" ||
|
|
101
|
+
observation.freshness.status === "incompatible"
|
|
102
|
+
) {
|
|
103
|
+
throw new EnvironmentError(
|
|
104
|
+
"Could not confirm a compatible search index after the update.",
|
|
105
|
+
"Check `untangle doctor` and the index report on stderr.",
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (options.once || (options.maxRefreshes !== null && refreshes >= options.maxRefreshes)) {
|
|
110
|
+
if (observation.freshness.status !== "fresh") {
|
|
111
|
+
throw new EnvironmentError(
|
|
112
|
+
"Sources changed again during indexing; the search index is still stale.",
|
|
113
|
+
"Keep watch --index running without --baseline-only/--exit-after, or repeat the update.",
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
emit("stopped", observation, "The requested number of checks/updates has been reached.");
|
|
117
|
+
return EXIT.ok;
|
|
118
|
+
}
|
|
119
|
+
await deps.wait(options.intervalMs, ctx.signal);
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (ctx.signal.aborted || (error instanceof Error && error.name === "AbortError")) {
|
|
123
|
+
emit("stopped", observation, "Cancelled; any running indexing job was stopped cleanly.");
|
|
124
|
+
return EXIT.cancelled;
|
|
125
|
+
}
|
|
126
|
+
emit("failed", observation, error instanceof Error ? error.message : String(error));
|
|
127
|
+
throw error;
|
|
128
|
+
} finally {
|
|
129
|
+
await sink.close();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Uses the same registry, scanner freshness check and refresh composition as query --refresh. */
|
|
134
|
+
export async function inspectIndexWatch(
|
|
135
|
+
ctx: CommandContext,
|
|
136
|
+
options: IndexWatchOptions,
|
|
137
|
+
): Promise<IndexWatchObservation> {
|
|
138
|
+
const view = loadWorkspace({ cwd: options.root, env: ctx.env, strict: true });
|
|
139
|
+
if (options.repo !== undefined && (view.config.repositories ?? []).length === 0) {
|
|
140
|
+
throw new UsageError(
|
|
141
|
+
"--repo requires a configured repository.",
|
|
142
|
+
"Select the project tree with --root.",
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
const target = resolveTarget({
|
|
146
|
+
config: view.config,
|
|
147
|
+
cwd: options.root,
|
|
148
|
+
rootFlag: options.root,
|
|
149
|
+
repoFlag: options.repo,
|
|
150
|
+
refFlag: options.ref,
|
|
151
|
+
configBaseDir: view.load.sources.configBaseDir,
|
|
152
|
+
});
|
|
153
|
+
if (detectRefName(target.rootPath) !== target.refName) {
|
|
154
|
+
throw new UsageError(
|
|
155
|
+
`Ref ${target.refName} is not checked out in ${target.rootPath}.`,
|
|
156
|
+
"Switch to the matching worktree before watching the search index.",
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
const resolution = await resolveIndexState([target.rootPath], view.workspaceId, {
|
|
160
|
+
repoIds: [target.repoId],
|
|
161
|
+
refs: [target.refId],
|
|
162
|
+
...storageIndexScope(wireStorage(view, ctx.env)),
|
|
163
|
+
});
|
|
164
|
+
ctx.signal.throwIfAborted();
|
|
165
|
+
if (resolution.kind === "invalid") {
|
|
166
|
+
throw new EnvironmentError(
|
|
167
|
+
`The local index state is invalid: ${resolution.diagnostics.map((entry) => `${entry.path}: ${entry.message}`).join("; ")}`,
|
|
168
|
+
"Rerun the affected indexing job before starting watch --index.",
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (resolution.kind === "ambiguous" && options.embedder === "auto") {
|
|
172
|
+
throw new UsageError(
|
|
173
|
+
"Current index profiles conflict.",
|
|
174
|
+
"Select --embedder=offline or repair the index registry.",
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
const current =
|
|
178
|
+
resolution.kind === "resolved"
|
|
179
|
+
? resolution.current
|
|
180
|
+
: resolution.kind === "ambiguous"
|
|
181
|
+
? resolution.found
|
|
182
|
+
: [];
|
|
183
|
+
const states =
|
|
184
|
+
options.embedder === "offline"
|
|
185
|
+
? current.filter((entry) => entry.state.embedder === "offline")
|
|
186
|
+
: current;
|
|
187
|
+
const embedder =
|
|
188
|
+
options.embedder === "offline" ||
|
|
189
|
+
(resolution.kind === "resolved" && resolution.embedder === "offline")
|
|
190
|
+
? "offline"
|
|
191
|
+
: "auto";
|
|
192
|
+
const freshness = await inspectIndexFreshness(view, states, { signal: ctx.signal });
|
|
193
|
+
return {
|
|
194
|
+
workspaceId: view.workspaceId,
|
|
195
|
+
repoId: target.repoId,
|
|
196
|
+
refId: target.refId,
|
|
197
|
+
freshness,
|
|
198
|
+
refresh: () =>
|
|
199
|
+
refreshWorkspaceIndex(ctx, {
|
|
200
|
+
view,
|
|
201
|
+
...(target.synthesized ? {} : { repoIds: [target.repoId] }),
|
|
202
|
+
refIds: [target.refName],
|
|
203
|
+
embedder,
|
|
204
|
+
}),
|
|
205
|
+
};
|
|
206
|
+
}
|