@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,503 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die Darstellung des Dateigraphen — reine Funktionen, kein I/O.
|
|
3
|
+
*
|
|
4
|
+
* Sie stehen getrennt vom Befehl, weil genau hier die Aussagen entstehen, die
|
|
5
|
+
* ein Nutzer glaubt: „das sind alle Abhaengigkeiten", „hier ist Schluss",
|
|
6
|
+
* „dieser Import zeigt ins Leere". Als reine Funktionen sind sie gegen ein
|
|
7
|
+
* Abbild pruefbar, ohne Speicher und ohne Netz.
|
|
8
|
+
*
|
|
9
|
+
* VIER REGELN, DIE JEDE ZEILE HIER EINHAELT:
|
|
10
|
+
*
|
|
11
|
+
* 1. EIN ABGESCHNITTENER BAUM SAGT ES — an der Stelle, an der abgeschnitten
|
|
12
|
+
* wurde, UND im Fuss mit dem benannten Grund aus
|
|
13
|
+
* `TRAVERSAL_TRUNCATION_REASONS`.
|
|
14
|
+
* 2. EIN ZYKLUS WIRD GEMELDET, nicht aufgebrochen: der wiedergetroffene Knoten
|
|
15
|
+
* steht da, mit Markierung, und der geschlossene Weg steht im Fuss.
|
|
16
|
+
* 3. EIN UNAUFGELOESTER IMPORT WIRD MIT SEINEM ROHSTRING GEZEIGT, dazu der
|
|
17
|
+
* benannte Grund. Er verschwindet nie (E4).
|
|
18
|
+
* 4. GRENZEN SIND SICHTBAR: Paket-, Repository- und Containergrenze stehen an
|
|
19
|
+
* der Kante, die sie ueberquert.
|
|
20
|
+
*/
|
|
21
|
+
import type {
|
|
22
|
+
FileEdgeV1,
|
|
23
|
+
FileNodeV1,
|
|
24
|
+
SkipLedgerV1,
|
|
25
|
+
TraversalDirection,
|
|
26
|
+
} from "@untangle-code/domain";
|
|
27
|
+
import { compareCodepoints } from "@untangle-code/domain";
|
|
28
|
+
import type {
|
|
29
|
+
FileTraversalResultV1,
|
|
30
|
+
RestoredFileGraph,
|
|
31
|
+
SnapshotReadIssue,
|
|
32
|
+
WorkspaceTopologyV1,
|
|
33
|
+
} from "@untangle-code/file-graph";
|
|
34
|
+
|
|
35
|
+
/** Die Richtung, wie der Nutzer sie nennt. */
|
|
36
|
+
export type GraphDirectionChoice = "dependencies" | "dependents" | "both";
|
|
37
|
+
|
|
38
|
+
export interface FileViewInputV1 {
|
|
39
|
+
graph: RestoredFileGraph;
|
|
40
|
+
node: FileNodeV1;
|
|
41
|
+
direction: GraphDirectionChoice;
|
|
42
|
+
dependencies?: FileTraversalResultV1;
|
|
43
|
+
dependents?: FileTraversalResultV1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const DIRECTION_TITLE: Record<TraversalDirection, string> = {
|
|
47
|
+
forward: "DEPENDENCIES (transitive)",
|
|
48
|
+
reverse: "DEPENDENTS (transitive)",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** Warum abgeschnitten wurde, in Worten — die Codes bleiben trotzdem sichtbar. */
|
|
52
|
+
const TRUNCATION_TEXT: Record<string, string> = {
|
|
53
|
+
max_depth: "depth limit reached",
|
|
54
|
+
max_nodes: "node budget exhausted",
|
|
55
|
+
max_edges: "edge budget exhausted",
|
|
56
|
+
max_wall_time: "time budget exhausted",
|
|
57
|
+
cancelled: "cancelled",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/* ------------------------------------------------------------------ */
|
|
61
|
+
/* Bausteine */
|
|
62
|
+
/* ------------------------------------------------------------------ */
|
|
63
|
+
|
|
64
|
+
/** Kurzbeschreibung eines Knotens: Pfad, Paket, Dienst, offene Importe. */
|
|
65
|
+
export function describeNode(node: FileNodeV1): string {
|
|
66
|
+
const parts: string[] = [node.filePath];
|
|
67
|
+
if (node.packageName !== undefined) parts.push(`[${node.packageName}]`);
|
|
68
|
+
if (node.containerService !== undefined) parts.push(`{Service: ${node.containerService}}`);
|
|
69
|
+
if (node.unresolvedImportCount > 0) {
|
|
70
|
+
parts.push(`(${String(node.unresolvedImportCount)} unresolved)`);
|
|
71
|
+
}
|
|
72
|
+
return parts.join(" ");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Welche Grenzen eine Kante ueberquert, als Kurzform. */
|
|
76
|
+
export function describeBoundary(edge: FileEdgeV1): string {
|
|
77
|
+
const crossed: string[] = [];
|
|
78
|
+
if (edge.boundary.crossRepo) crossed.push("Repository");
|
|
79
|
+
if (edge.boundary.crossPackage) {
|
|
80
|
+
crossed.push(
|
|
81
|
+
`package ${edge.boundary.fromPackageName ?? "?"} -> ${edge.boundary.toPackageName ?? "?"}`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (edge.boundary.crossContainer) {
|
|
85
|
+
crossed.push(
|
|
86
|
+
`Container ${edge.boundary.fromContainerService ?? "?"} -> ${edge.boundary.toContainerService ?? "?"}`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return crossed.length === 0 ? "" : `>> Boundary: ${crossed.join(", ")}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Die Kante zwischen zwei benachbarten Dateien, in Traversierungsrichtung. */
|
|
93
|
+
function edgeBetween(
|
|
94
|
+
graph: RestoredFileGraph,
|
|
95
|
+
from: string,
|
|
96
|
+
to: string,
|
|
97
|
+
direction: TraversalDirection,
|
|
98
|
+
): FileEdgeV1 | null {
|
|
99
|
+
const source = direction === "forward" ? from : to;
|
|
100
|
+
const target = direction === "forward" ? to : from;
|
|
101
|
+
for (const edge of graph.edgesFrom(source)) {
|
|
102
|
+
if (edge.resolution.status === "resolved" && edge.resolution.targetFileId === target) {
|
|
103
|
+
return edge;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function annotateEdge(edge: FileEdgeV1 | null): string {
|
|
110
|
+
if (edge === null) return "";
|
|
111
|
+
const parts: string[] = [];
|
|
112
|
+
if (edge.resolution.status === "resolved") parts.push(edge.resolution.mechanism);
|
|
113
|
+
parts.push(`"${edge.rawSpecifier}"`);
|
|
114
|
+
const boundary = describeBoundary(edge);
|
|
115
|
+
if (boundary !== "") parts.push(boundary);
|
|
116
|
+
return ` <- ${parts.join(" ")}`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ------------------------------------------------------------------ */
|
|
120
|
+
/* Baumdarstellung */
|
|
121
|
+
/* ------------------------------------------------------------------ */
|
|
122
|
+
|
|
123
|
+
interface TreeContext {
|
|
124
|
+
graph: RestoredFileGraph;
|
|
125
|
+
direction: TraversalDirection;
|
|
126
|
+
maxDepth: number;
|
|
127
|
+
/** Genau die Knoten, die die Traversierung wirklich besucht hat. */
|
|
128
|
+
visited: Set<string>;
|
|
129
|
+
shown: Set<string>;
|
|
130
|
+
lines: string[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Zeichnet den Baum unter `fileId`.
|
|
135
|
+
*
|
|
136
|
+
* Der Baum zeigt NUR, was die Traversierung auch besucht hat — jedes Kind
|
|
137
|
+
* ausserhalb dieser Menge wird trotzdem GENANNT, mit dem Vermerk, dass ein
|
|
138
|
+
* Budget es zurueckliess. Ein Baum, der solche Kinder weglaesst, waere die
|
|
139
|
+
* bequemste Form des stillen Ueberspringens.
|
|
140
|
+
*/
|
|
141
|
+
function renderBranch(
|
|
142
|
+
context: TreeContext,
|
|
143
|
+
fileId: string,
|
|
144
|
+
depth: number,
|
|
145
|
+
onPath: readonly string[],
|
|
146
|
+
prefix: string,
|
|
147
|
+
): void {
|
|
148
|
+
const children = [...context.graph.neighborsOf(fileId, context.direction)];
|
|
149
|
+
for (let i = 0; i < children.length; i++) {
|
|
150
|
+
const child = children[i] as string;
|
|
151
|
+
const last = i === children.length - 1;
|
|
152
|
+
const branch = last ? "`-- " : "|-- ";
|
|
153
|
+
const childPrefix = prefix + (last ? " " : "| ");
|
|
154
|
+
const node = context.graph.node(child);
|
|
155
|
+
const label = node === null ? `${child} (node missing from snapshot)` : describeNode(node);
|
|
156
|
+
const edge = edgeBetween(context.graph, fileId, child, context.direction);
|
|
157
|
+
const head = `${prefix}${branch}${label}${annotateEdge(edge)}`;
|
|
158
|
+
|
|
159
|
+
if (onPath.includes(child)) {
|
|
160
|
+
context.lines.push(`${head} ## CYCLE: closes the path; not followed again`);
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (!context.visited.has(child)) {
|
|
164
|
+
context.lines.push(`${head} ## not visited: traversal budget exhausted`);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (context.shown.has(child)) {
|
|
168
|
+
const own = context.graph.neighborsOf(child, context.direction).length;
|
|
169
|
+
context.lines.push(
|
|
170
|
+
own === 0 ? head : `${head} ## already shown above (${String(own)} neighbors there)`,
|
|
171
|
+
);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
context.shown.add(child);
|
|
175
|
+
|
|
176
|
+
const grandchildren = context.graph.neighborsOf(child, context.direction).length;
|
|
177
|
+
if (depth + 1 >= context.maxDepth && grandchildren > 0) {
|
|
178
|
+
context.lines.push(
|
|
179
|
+
`${head} ## truncated: max_depth (${String(grandchildren)} additional neighbors not visited)`,
|
|
180
|
+
);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
context.lines.push(head);
|
|
184
|
+
renderBranch(context, child, depth + 1, [...onPath, child], childPrefix);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Ein Baum je Richtung, samt Fussnote zu Abschneidung und Zyklen. */
|
|
189
|
+
export function renderTree(
|
|
190
|
+
graph: RestoredFileGraph,
|
|
191
|
+
node: FileNodeV1,
|
|
192
|
+
direction: TraversalDirection,
|
|
193
|
+
result: FileTraversalResultV1,
|
|
194
|
+
): string[] {
|
|
195
|
+
const lines: string[] = [];
|
|
196
|
+
lines.push(DIRECTION_TITLE[direction]);
|
|
197
|
+
lines.push(` ${describeNode(node)}`);
|
|
198
|
+
const context: TreeContext = {
|
|
199
|
+
graph,
|
|
200
|
+
direction,
|
|
201
|
+
maxDepth: result.limits.maxDepth,
|
|
202
|
+
visited: new Set([node.fileId, ...result.visitedFileIds]),
|
|
203
|
+
shown: new Set([node.fileId]),
|
|
204
|
+
lines: [],
|
|
205
|
+
};
|
|
206
|
+
renderBranch(context, node.fileId, 0, [node.fileId], " ");
|
|
207
|
+
if (context.lines.length === 0) {
|
|
208
|
+
lines.push(
|
|
209
|
+
direction === "forward" ? " (no resolved dependencies)" : " (no dependents for this file)",
|
|
210
|
+
);
|
|
211
|
+
} else {
|
|
212
|
+
lines.push(...context.lines);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
lines.push(
|
|
216
|
+
` Reached: ${String(result.visitedFileIds.length)} files, depth ${String(result.depthReached)} of ${String(result.limits.maxDepth)}.`,
|
|
217
|
+
);
|
|
218
|
+
if (result.truncated) {
|
|
219
|
+
const reason = result.truncationReason ?? "unknown";
|
|
220
|
+
lines.push(
|
|
221
|
+
` TRUNCATED: ${TRUNCATION_TEXT[reason] ?? reason} (${reason}). The result is incomplete.`,
|
|
222
|
+
);
|
|
223
|
+
lines.push(
|
|
224
|
+
` Budgets: maxDepth=${String(result.limits.maxDepth)} maxNodes=${String(result.limits.maxNodes)} maxEdges=${String(result.limits.maxEdges)} maxWallTimeMs=${String(result.limits.maxWallTimeMs)}`,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
if (result.cycles.length > 0) {
|
|
228
|
+
lines.push(` CYCLES (${String(result.cycles.length)}; reported rather than broken):`);
|
|
229
|
+
for (const cycle of result.cycles) {
|
|
230
|
+
const path = cycle.map((id) => graph.node(id)?.filePath ?? id);
|
|
231
|
+
lines.push(` ${[...path, path[0] ?? ""].join(" -> ")}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return lines;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* ------------------------------------------------------------------ */
|
|
238
|
+
/* Unaufgeloeste und externe Importe */
|
|
239
|
+
/* ------------------------------------------------------------------ */
|
|
240
|
+
|
|
241
|
+
/** Die unaufgeloesten Kanten einer Datei — Rohstring, Grund, geprueftes. */
|
|
242
|
+
export function renderUnresolvedOf(graph: RestoredFileGraph, node: FileNodeV1): string[] {
|
|
243
|
+
const unresolved = graph
|
|
244
|
+
.edgesFrom(node.fileId)
|
|
245
|
+
.filter((edge) => edge.resolution.status === "unresolved");
|
|
246
|
+
if (unresolved.length === 0) return [];
|
|
247
|
+
const lines: string[] = [`UNRESOLVED IMPORTS FOR THIS FILE (${String(unresolved.length)})`];
|
|
248
|
+
for (const edge of unresolved) {
|
|
249
|
+
if (edge.resolution.status !== "unresolved") continue;
|
|
250
|
+
lines.push(` "${edge.rawSpecifier}" ${edge.resolution.reason}`);
|
|
251
|
+
lines.push(` ${edge.resolution.detail}`);
|
|
252
|
+
const rejected = edge.resolution.rejectedCandidates ?? [];
|
|
253
|
+
if (rejected.length > 0) {
|
|
254
|
+
lines.push(` checked and rejected: ${rejected.join(", ")}`);
|
|
255
|
+
}
|
|
256
|
+
for (const site of edge.sites) {
|
|
257
|
+
lines.push(` Location: line ${String(site.range.startLine)}`);
|
|
258
|
+
}
|
|
259
|
+
if (edge.sites.length === 0 && edge.sitesMissingReason !== undefined) {
|
|
260
|
+
lines.push(` no source location: ${edge.sitesMissingReason}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return lines;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** Die externen (workspace-fremden) Abhaengigkeiten einer Datei. */
|
|
267
|
+
export function renderExternalOf(graph: RestoredFileGraph, node: FileNodeV1): string[] {
|
|
268
|
+
const external = graph
|
|
269
|
+
.edgesFrom(node.fileId)
|
|
270
|
+
.filter((edge) => edge.resolution.status === "external");
|
|
271
|
+
if (external.length === 0) return [];
|
|
272
|
+
const lines: string[] = [`OUTSIDE THE WORKSPACE (${String(external.length)})`];
|
|
273
|
+
for (const edge of external) {
|
|
274
|
+
if (edge.resolution.status !== "external") continue;
|
|
275
|
+
const version =
|
|
276
|
+
edge.resolution.declaredVersion === undefined ? "" : ` @ ${edge.resolution.declaredVersion}`;
|
|
277
|
+
lines.push(
|
|
278
|
+
` "${edge.rawSpecifier}" -> ${edge.resolution.packageName}${version} [${edge.resolution.mechanism}]`,
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
return lines;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* ------------------------------------------------------------------ */
|
|
285
|
+
/* Die Dateisicht */
|
|
286
|
+
/* ------------------------------------------------------------------ */
|
|
287
|
+
|
|
288
|
+
export function renderFileView(input: FileViewInputV1): string[] {
|
|
289
|
+
const lines: string[] = [];
|
|
290
|
+
lines.push(`File ${input.node.filePath}`);
|
|
291
|
+
lines.push(
|
|
292
|
+
` Repository ${input.node.repoId} Language ${input.node.language}` +
|
|
293
|
+
(input.node.packageName === undefined ? "" : ` package ${input.node.packageName}`) +
|
|
294
|
+
(input.node.containerService === undefined
|
|
295
|
+
? ""
|
|
296
|
+
: ` Container-Dienst ${input.node.containerService}`),
|
|
297
|
+
);
|
|
298
|
+
lines.push(
|
|
299
|
+
` Raw imports ${String(input.node.imports.length)}, including workspace-resolved ${String(input.node.dependencies.length)}, unresolved ${String(input.node.unresolvedImportCount)}`,
|
|
300
|
+
);
|
|
301
|
+
lines.push("");
|
|
302
|
+
|
|
303
|
+
if (input.dependencies !== undefined) {
|
|
304
|
+
lines.push(...renderTree(input.graph, input.node, "forward", input.dependencies));
|
|
305
|
+
lines.push("");
|
|
306
|
+
}
|
|
307
|
+
if (input.dependents !== undefined) {
|
|
308
|
+
lines.push(...renderTree(input.graph, input.node, "reverse", input.dependents));
|
|
309
|
+
lines.push("");
|
|
310
|
+
}
|
|
311
|
+
const unresolved = renderUnresolvedOf(input.graph, input.node);
|
|
312
|
+
if (unresolved.length > 0) lines.push(...unresolved, "");
|
|
313
|
+
const external = renderExternalOf(input.graph, input.node);
|
|
314
|
+
if (external.length > 0) lines.push(...external, "");
|
|
315
|
+
return lines;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* ------------------------------------------------------------------ */
|
|
319
|
+
/* Die Uebersicht */
|
|
320
|
+
/* ------------------------------------------------------------------ */
|
|
321
|
+
|
|
322
|
+
export interface OverviewInputV1 {
|
|
323
|
+
graph: RestoredFileGraph;
|
|
324
|
+
generationId: string;
|
|
325
|
+
issues: readonly SnapshotReadIssue[];
|
|
326
|
+
/** Wie viele unaufgeloeste Importe einzeln genannt werden. */
|
|
327
|
+
unresolvedLimit: number;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** Die Monorepo-Ebene: Pakete, Paketkanten, Container-Dienste, Dienstkanten. */
|
|
331
|
+
export function renderTopology(topology: WorkspaceTopologyV1): string[] {
|
|
332
|
+
const lines: string[] = ["MONOREPO-EBENE"];
|
|
333
|
+
if (topology.workspaceGlobs.length > 0) {
|
|
334
|
+
lines.push(
|
|
335
|
+
` Workspace-Globs: ${[...topology.workspaceGlobs].sort(compareCodepoints).join(", ")}`,
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
const packageNames = topology.packages.map((entry) => entry.name).sort(compareCodepoints);
|
|
339
|
+
lines.push(
|
|
340
|
+
` Pakete (${String(topology.packages.length)}): ${packageNames.join(", ") || "none"}`,
|
|
341
|
+
);
|
|
342
|
+
const packageEdges = [...topology.packageEdges].sort(
|
|
343
|
+
(left, right) =>
|
|
344
|
+
compareCodepoints(left.fromPackage, right.fromPackage) ||
|
|
345
|
+
compareCodepoints(left.toPackage, right.toPackage),
|
|
346
|
+
);
|
|
347
|
+
for (const edge of packageEdges) {
|
|
348
|
+
lines.push(
|
|
349
|
+
` ${edge.fromPackage} -> ${edge.toPackage} [${edge.dependencyField} ${edge.rawRange}]`,
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
const serviceNames = topology.services.map((entry) => entry.name).sort(compareCodepoints);
|
|
353
|
+
lines.push(
|
|
354
|
+
` Container-Dienste (${String(topology.services.length)}): ${serviceNames.join(", ") || "none"}`,
|
|
355
|
+
);
|
|
356
|
+
const serviceEdges = [...topology.serviceEdges].sort(
|
|
357
|
+
(left, right) =>
|
|
358
|
+
compareCodepoints(left.fromService, right.fromService) ||
|
|
359
|
+
compareCodepoints(left.toService, right.toService) ||
|
|
360
|
+
compareCodepoints(left.kind, right.kind),
|
|
361
|
+
);
|
|
362
|
+
for (const edge of serviceEdges) {
|
|
363
|
+
const via = edge.network === undefined ? "" : ` (${edge.network})`;
|
|
364
|
+
lines.push(` ${edge.fromService} -> ${edge.toService} [${edge.kind}${via}]`);
|
|
365
|
+
}
|
|
366
|
+
if (topology.services.length > 0) {
|
|
367
|
+
for (const service of [...topology.services].sort((left, right) =>
|
|
368
|
+
compareCodepoints(left.name, right.name),
|
|
369
|
+
)) {
|
|
370
|
+
lines.push(
|
|
371
|
+
` Dienst ${service.name}: ${service.composeFile}` +
|
|
372
|
+
(service.buildContext === undefined ? "" : ` Context ${service.buildContext}`) +
|
|
373
|
+
(service.image === undefined ? "" : ` Abbild ${service.image}`),
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return lines;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Uebersprungenes aus dem Ledger — mit Grund, nie als blosse Zahl. */
|
|
381
|
+
export function renderLedger(ledger: SkipLedgerV1, limit: number): string[] {
|
|
382
|
+
if (ledger.entries.length === 0) return [];
|
|
383
|
+
const lines: string[] = [`SKIPPED DURING GRAPH BUILD (${String(ledger.entries.length)})`];
|
|
384
|
+
const reasons = Object.entries(ledger.countsByReason).sort(([left], [right]) =>
|
|
385
|
+
compareCodepoints(left, right),
|
|
386
|
+
);
|
|
387
|
+
lines.push(
|
|
388
|
+
` by reason: ${reasons.map(([reason, count]) => `${reason} ${String(count ?? 0)}`).join(", ")}`,
|
|
389
|
+
);
|
|
390
|
+
for (const entry of ledger.entries.slice(0, limit)) {
|
|
391
|
+
lines.push(` ${entry.path ?? entry.subjectId ?? "(no path)"} ${entry.reason}`);
|
|
392
|
+
lines.push(` ${entry.detail}`);
|
|
393
|
+
}
|
|
394
|
+
if (ledger.entries.length > limit) {
|
|
395
|
+
lines.push(` … ${String(ledger.entries.length - limit)} more (increase --limit).`);
|
|
396
|
+
}
|
|
397
|
+
return lines;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function renderOverview(input: OverviewInputV1): string[] {
|
|
401
|
+
const graph = input.graph;
|
|
402
|
+
const metrics = graph.metrics();
|
|
403
|
+
const lines: string[] = [];
|
|
404
|
+
lines.push(`File graph Generation ${input.generationId}`);
|
|
405
|
+
lines.push(
|
|
406
|
+
` ${String(metrics.nodeCount)} nodes, ${String(metrics.edgeCount)} edges, ` +
|
|
407
|
+
`${String(metrics.orphanFileIds.length)} orphan files`,
|
|
408
|
+
);
|
|
409
|
+
const resolution = metrics.importResolution;
|
|
410
|
+
lines.push(
|
|
411
|
+
` Importaufloesung ${(resolution.rate * 100).toFixed(1)} % ` +
|
|
412
|
+
`(aufgeloest ${String(resolution.resolvedCount)}, extern ${String(resolution.externalCount)}, ` +
|
|
413
|
+
`unresolved ${String(resolution.unresolvedCount)})`,
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
const boundaries = countBoundaries(graph);
|
|
417
|
+
lines.push(
|
|
418
|
+
` Cross-boundary edges: package ${String(boundaries.crossPackage)}, ` +
|
|
419
|
+
`Repository ${String(boundaries.crossRepo)}, container ${String(boundaries.crossContainer)}`,
|
|
420
|
+
);
|
|
421
|
+
lines.push("");
|
|
422
|
+
|
|
423
|
+
lines.push(...renderTopology(graph.topology));
|
|
424
|
+
lines.push("");
|
|
425
|
+
|
|
426
|
+
lines.push(`CYCLES (${String(metrics.cycles.length)})`);
|
|
427
|
+
if (metrics.cycles.length === 0) {
|
|
428
|
+
lines.push(" none found");
|
|
429
|
+
} else {
|
|
430
|
+
for (const cycle of metrics.cycles.slice(0, input.unresolvedLimit)) {
|
|
431
|
+
const path = cycle.map((id) => graph.node(id)?.filePath ?? id);
|
|
432
|
+
lines.push(` ${[...path, path[0] ?? ""].join(" -> ")}`);
|
|
433
|
+
}
|
|
434
|
+
if (metrics.cycles.length > input.unresolvedLimit) {
|
|
435
|
+
lines.push(` … ${String(metrics.cycles.length - input.unresolvedLimit)} weitere.`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
lines.push("");
|
|
439
|
+
|
|
440
|
+
if (metrics.topCentralFiles.length > 0) {
|
|
441
|
+
lines.push(`CENTRAL FILES (${metrics.centralityFormula})`);
|
|
442
|
+
for (const entry of metrics.topCentralFiles.slice(0, 10)) {
|
|
443
|
+
lines.push(
|
|
444
|
+
` ${entry.centrality.toFixed(4)} ${entry.filePath} ` +
|
|
445
|
+
`(incoming ${String(entry.inDegree)}, outgoing ${String(entry.outDegree)})`,
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
lines.push("");
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const unresolved = graph.edges().filter((edge) => edge.resolution.status === "unresolved");
|
|
452
|
+
lines.push(`UNRESOLVED IMPORTS (${String(unresolved.length)})`);
|
|
453
|
+
if (unresolved.length === 0) {
|
|
454
|
+
lines.push(" none");
|
|
455
|
+
} else {
|
|
456
|
+
for (const edge of unresolved.slice(0, input.unresolvedLimit)) {
|
|
457
|
+
if (edge.resolution.status !== "unresolved") continue;
|
|
458
|
+
lines.push(` ${edge.fromPath} "${edge.rawSpecifier}" ${edge.resolution.reason}`);
|
|
459
|
+
lines.push(` ${edge.resolution.detail}`);
|
|
460
|
+
}
|
|
461
|
+
if (unresolved.length > input.unresolvedLimit) {
|
|
462
|
+
lines.push(
|
|
463
|
+
` … ${String(unresolved.length - input.unresolvedLimit)} more (increase --limit).`,
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
lines.push("");
|
|
468
|
+
|
|
469
|
+
const ledger = renderLedger(graph.skipLedger(), input.unresolvedLimit);
|
|
470
|
+
if (ledger.length > 0) lines.push(...ledger, "");
|
|
471
|
+
|
|
472
|
+
return lines;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** Zaehlt die Kanten, die eine Grenze ueberqueren. */
|
|
476
|
+
export function countBoundaries(graph: RestoredFileGraph): {
|
|
477
|
+
crossPackage: number;
|
|
478
|
+
crossRepo: number;
|
|
479
|
+
crossContainer: number;
|
|
480
|
+
} {
|
|
481
|
+
let crossPackage = 0;
|
|
482
|
+
let crossRepo = 0;
|
|
483
|
+
let crossContainer = 0;
|
|
484
|
+
for (const edge of graph.edges()) {
|
|
485
|
+
if (edge.boundary.crossPackage) crossPackage += 1;
|
|
486
|
+
if (edge.boundary.crossRepo) crossRepo += 1;
|
|
487
|
+
if (edge.boundary.crossContainer) crossContainer += 1;
|
|
488
|
+
}
|
|
489
|
+
return { crossPackage, crossRepo, crossContainer };
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/** Die Befunde des Zurueckladens — sie gehen auf stderr, nie in die Nutzdaten. */
|
|
493
|
+
export function renderIssues(issues: readonly SnapshotReadIssue[]): string[] {
|
|
494
|
+
if (issues.length === 0) return [];
|
|
495
|
+
const lines: string[] = [
|
|
496
|
+
`Warning: the file-graph snapshot is incomplete (${String(issues.length)} findings).`,
|
|
497
|
+
];
|
|
498
|
+
for (const issue of issues) {
|
|
499
|
+
lines.push(` ${issue.kind}: ${issue.message}`);
|
|
500
|
+
}
|
|
501
|
+
lines.push("The following information may therefore be incomplete.");
|
|
502
|
+
return lines;
|
|
503
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Von dem, was ein Nutzer tippt, zu dem Knoten, den er meint.
|
|
3
|
+
*
|
|
4
|
+
* Ein Nutzer tippt `src/orders.ts`, `./services/api/src/orders.ts`,
|
|
5
|
+
* `/abs/pfad/services/api/src/orders.ts` oder `orders.ts` — der Graph kennt
|
|
6
|
+
* nur repo-relative, `/`-normalisierte Pfade. Diese Datei uebersetzt das, und
|
|
7
|
+
* zwar unter einer Bedingung: SIE WAEHLT NIE. Passen mehrere Dateien, kommt
|
|
8
|
+
* die Liste zurueck und der Befehl fragt nach; passt keine, ist das ein
|
|
9
|
+
* benannter Fehlschlag und keine leere Antwort (E4).
|
|
10
|
+
*/
|
|
11
|
+
import type { FileNodeV1 } from "@untangle-code/domain";
|
|
12
|
+
import { compareCodepoints } from "@untangle-code/domain";
|
|
13
|
+
|
|
14
|
+
export type FileSelectionV1 =
|
|
15
|
+
| { status: "found"; node: FileNodeV1; matchedBy: "path" | "suffix" | "file_id" }
|
|
16
|
+
| { status: "ambiguous"; candidates: FileNodeV1[] }
|
|
17
|
+
| { status: "absent"; near: FileNodeV1[] };
|
|
18
|
+
|
|
19
|
+
/** `"/"`-Normalisierung und Abwurf fuehrender `./`; identisch zur Graphform. */
|
|
20
|
+
export function normalizeQuery(raw: string): string {
|
|
21
|
+
let value = raw.replaceAll("\\", "/");
|
|
22
|
+
while (value.startsWith("./")) value = value.slice(2);
|
|
23
|
+
while (value.startsWith("/")) value = value.slice(1);
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function byPath(left: FileNodeV1, right: FileNodeV1): number {
|
|
28
|
+
return (
|
|
29
|
+
compareCodepoints(left.filePath, right.filePath) || compareCodepoints(left.fileId, right.fileId)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Sucht den Knoten zu `query`.
|
|
35
|
+
*
|
|
36
|
+
* Reihenfolge der Proben, von der staerksten Aussage zur schwaechsten:
|
|
37
|
+
* exakte `file_id`, exakter Pfad, Pfadendung. Erst wenn eine Stufe MEHRERE
|
|
38
|
+
* Treffer hat, wird gefragt — eine schwaechere Stufe wird gar nicht mehr
|
|
39
|
+
* betrachtet, sonst verdraengte ein zufaelliges Suffix einen exakten Treffer.
|
|
40
|
+
*/
|
|
41
|
+
export function selectFileNode(nodes: readonly FileNodeV1[], query: string): FileSelectionV1 {
|
|
42
|
+
const wanted = normalizeQuery(query);
|
|
43
|
+
|
|
44
|
+
const byId = nodes.filter((node) => node.fileId === query);
|
|
45
|
+
if (byId.length === 1)
|
|
46
|
+
return { status: "found", node: byId[0] as FileNodeV1, matchedBy: "file_id" };
|
|
47
|
+
|
|
48
|
+
const exact = nodes.filter((node) => node.filePath === wanted);
|
|
49
|
+
if (exact.length === 1)
|
|
50
|
+
return { status: "found", node: exact[0] as FileNodeV1, matchedBy: "path" };
|
|
51
|
+
if (exact.length > 1) return { status: "ambiguous", candidates: [...exact].sort(byPath) };
|
|
52
|
+
|
|
53
|
+
const suffix = nodes.filter((node) => node.filePath.endsWith(`/${wanted}`));
|
|
54
|
+
if (suffix.length === 1)
|
|
55
|
+
return { status: "found", node: suffix[0] as FileNodeV1, matchedBy: "suffix" };
|
|
56
|
+
if (suffix.length > 1) return { status: "ambiguous", candidates: [...suffix].sort(byPath) };
|
|
57
|
+
|
|
58
|
+
// „Aehnlich" wird ueber den Dateinamen OHNE Endung gesucht: wer sich in der
|
|
59
|
+
// Endung vertippt (`orders.tsx` statt `orders.ts`), bekommt sonst eine
|
|
60
|
+
// leere Antwort auf eine Frage, deren Antwort direkt danebenliegt.
|
|
61
|
+
const stem = stemOfBasename(wanted).toLowerCase();
|
|
62
|
+
const near =
|
|
63
|
+
stem === ""
|
|
64
|
+
? []
|
|
65
|
+
: nodes
|
|
66
|
+
.filter((node) => node.filePath.toLowerCase().includes(stem))
|
|
67
|
+
.sort(byPath)
|
|
68
|
+
.slice(0, 10);
|
|
69
|
+
return { status: "absent", near };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function stemOfBasename(path: string): string {
|
|
73
|
+
const slash = path.lastIndexOf("/");
|
|
74
|
+
const base = slash === -1 ? path : path.slice(slash + 1);
|
|
75
|
+
const dot = base.lastIndexOf(".");
|
|
76
|
+
return dot <= 0 ? base : base.slice(0, dot);
|
|
77
|
+
}
|