@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,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Die Laufzeitkanten des Waechters: Uhr, Zufall, Ignorierregeln, Ausgabe.
|
|
3
|
+
*
|
|
4
|
+
* Alles hier ist bewusst DUENN. Es ist der Kompositionswurzel-Anteil des
|
|
5
|
+
* CLI — die Stelle, an der die reinen Pakete an echte Uhr, echten Zufall und
|
|
6
|
+
* echte Dateien angeschlossen werden. Kein Paket unterhalb davon liest
|
|
7
|
+
* jemals selbst die Uhr oder `node:fs` (siehe die Port-Dokumentation in
|
|
8
|
+
* `packages/domain/src/ports.ts`).
|
|
9
|
+
*/
|
|
10
|
+
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
11
|
+
import { createWriteStream, readFileSync, type WriteStream } from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
|
|
14
|
+
import type { Clock, Random } from "@untangle-code/domain";
|
|
15
|
+
import { createIgnoreEngine } from "@untangle-code/scanner";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Wanduhrzeit fuer Protokollzeitstempel und die Buchfuehrung der Lock-Lease.
|
|
19
|
+
* Ergebnisdaten (Metriken, Deltas) enthalten NIE eine Uhrzeit — dort waere
|
|
20
|
+
* sie ein Determinismusbruch; hier ist sie genau der Zweck.
|
|
21
|
+
*/
|
|
22
|
+
export class SystemClock implements Clock {
|
|
23
|
+
nowEpochMs(): number {
|
|
24
|
+
// Die EINZIGE echte Uhrzeitablesung des Waechters, und zwar mit Absicht
|
|
25
|
+
// an genau dieser Stelle: `SystemClock` IST die Umsetzung des
|
|
26
|
+
// `Clock`-Ports. Jede andere Datei dieses Kommandos liest die Zeit nur
|
|
27
|
+
// ueber den Port (`deps.clock`), damit ein Test sie durch eine feste Uhr
|
|
28
|
+
// ersetzen kann. Dieselbe Ausnahme, dieselbe Begruendung wie in
|
|
29
|
+
// `packages/storage-local/src/real-time.ts` und `@untangle-code/testkit`.
|
|
30
|
+
// eslint-disable-next-line no-restricted-syntax -- siehe Begruendung darueber.
|
|
31
|
+
return Date.now();
|
|
32
|
+
}
|
|
33
|
+
nowIso(): string {
|
|
34
|
+
return new Date(this.nowEpochMs()).toISOString();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Kryptografischer Zufall fuer Lock-Datensatz-Ids. Ebenfalls kein Bestandteil
|
|
40
|
+
* von Ergebnisdaten — `FileLockProvider` braucht eine eindeutige Kennung je
|
|
41
|
+
* Lease, sonst koennte ein zweiter Prozess eine fremde Lease erneuern.
|
|
42
|
+
*/
|
|
43
|
+
export class CryptoRandom implements Random {
|
|
44
|
+
nextFloat(): number {
|
|
45
|
+
const buffer = randomBytes(6).readUIntBE(0, 6);
|
|
46
|
+
return buffer / 2 ** 48;
|
|
47
|
+
}
|
|
48
|
+
nextInt(maxExclusive: number): number {
|
|
49
|
+
if (!Number.isInteger(maxExclusive) || maxExclusive <= 0) {
|
|
50
|
+
throw new RangeError(`nextInt requires a positive integer; received ${maxExclusive}`);
|
|
51
|
+
}
|
|
52
|
+
return Math.floor(this.nextFloat() * maxExclusive);
|
|
53
|
+
}
|
|
54
|
+
bytes(length: number): Uint8Array {
|
|
55
|
+
return new Uint8Array(randomBytes(length));
|
|
56
|
+
}
|
|
57
|
+
uuid(): string {
|
|
58
|
+
return randomUUID();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Ignorierregeln fuer den Watcher.
|
|
64
|
+
*
|
|
65
|
+
* `RepoWatcher`/`reconcileTree` kennen absichtlich keine
|
|
66
|
+
* `.gitignore`-Schichtung (siehe deren Modul-Doku: "a caller wiring a real
|
|
67
|
+
* indexing pipeline is expected to pass an `ignore` backed by scanner's own
|
|
68
|
+
* `IgnoreEngine`") — genau das passiert hier.
|
|
69
|
+
*
|
|
70
|
+
* DER EIGENE ZUSTANDSORDNER IST IMMER AUSGESCHLOSSEN. `.untangle/` steht zwar
|
|
71
|
+
* in der `.gitignore` DIESES Repositories, aber darauf darf sich der Waechter
|
|
72
|
+
* nicht verlassen: wird ein Unterverzeichnis ohne eigene `.gitignore` als
|
|
73
|
+
* `--root` beobachtet, legt der Waechter dort seinen Lock ab, sieht die
|
|
74
|
+
* Lock-Datei als Aenderung, erneuert die Lease, sieht die naechste Aenderung —
|
|
75
|
+
* eine Rueckkopplung auf sich selbst. Der Ausschluss ist deshalb fest
|
|
76
|
+
* verdrahtet und nicht ueber eine Regeldatei erschlagen.
|
|
77
|
+
*
|
|
78
|
+
* BEKANNTE GRENZE, ausdruecklich benannt statt verschwiegen: der Watcher
|
|
79
|
+
* ruft das Praedikat mit einem Pfad auf, OHNE zu sagen, ob es ein
|
|
80
|
+
* Verzeichnis ist (der `stat` folgt erst danach). Das Praedikat fragt die
|
|
81
|
+
* `IgnoreEngine` deshalb in beiden Lesarten und ignoriert, sobald eine der
|
|
82
|
+
* beiden ignoriert. Ausserdem wird nur die `.gitignore` der Baumwurzel als
|
|
83
|
+
* Schicht gelegt, keine verschachtelten — der Scanner leistet das im
|
|
84
|
+
* Indexlauf, der Waechter hier nicht.
|
|
85
|
+
*/
|
|
86
|
+
/** Der Zustandsordner des Waechters, relativ zum beobachteten Baum. */
|
|
87
|
+
export const STATE_DIR_NAME = ".untangle";
|
|
88
|
+
|
|
89
|
+
export function createIgnorePredicate(rootPath: string): (relativePath: string) => boolean {
|
|
90
|
+
const engine = createIgnoreEngine();
|
|
91
|
+
const rootGitignore = readFileIfPresent(path.join(rootPath, ".gitignore"));
|
|
92
|
+
if (rootGitignore !== null) engine.pushGitignoreLayer("", rootGitignore);
|
|
93
|
+
const rootUntangleignore = readFileIfPresent(path.join(rootPath, ".untangleignore"));
|
|
94
|
+
if (rootUntangleignore !== null) engine.pushUntangleIgnoreLayer("", rootUntangleignore);
|
|
95
|
+
|
|
96
|
+
const cache = new Map<string, boolean>();
|
|
97
|
+
return (relativePath: string): boolean => {
|
|
98
|
+
const cached = cache.get(relativePath);
|
|
99
|
+
if (cached !== undefined) return cached;
|
|
100
|
+
const decision =
|
|
101
|
+
relativePath === STATE_DIR_NAME ||
|
|
102
|
+
relativePath.startsWith(`${STATE_DIR_NAME}/`) ||
|
|
103
|
+
engine.decide(relativePath, false).ignored ||
|
|
104
|
+
engine.decide(relativePath, true).ignored;
|
|
105
|
+
cache.set(relativePath, decision);
|
|
106
|
+
return decision;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function readFileIfPresent(absolutePath: string): string | null {
|
|
111
|
+
try {
|
|
112
|
+
return readFileSync(absolutePath, "utf8");
|
|
113
|
+
} catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Wohin der Strom geht: stdout und, wenn gewuenscht, zusaetzlich eine Datei. */
|
|
119
|
+
export interface StreamSink {
|
|
120
|
+
write(line: string): void;
|
|
121
|
+
close(): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface StreamSinkOptions {
|
|
125
|
+
stdout: (chunk: string) => void;
|
|
126
|
+
/** Absoluter Pfad der Mitschrift, oder `null`. */
|
|
127
|
+
outPath: string | null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function createStreamSink(options: StreamSinkOptions): StreamSink {
|
|
131
|
+
let file: WriteStream | null = null;
|
|
132
|
+
if (options.outPath !== null) {
|
|
133
|
+
file = createWriteStream(options.outPath, { flags: "a", encoding: "utf8" });
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
write(line: string): void {
|
|
137
|
+
options.stdout(`${line}\n`);
|
|
138
|
+
file?.write(`${stripAnsi(line)}\n`);
|
|
139
|
+
},
|
|
140
|
+
async close(): Promise<void> {
|
|
141
|
+
const stream = file;
|
|
142
|
+
if (stream === null) return;
|
|
143
|
+
await new Promise<void>((resolve) => {
|
|
144
|
+
stream.end(() => {
|
|
145
|
+
resolve();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Entfernt ANSI-Steuerzeichen fuer die Mitschrift. Eine Logdatei voller
|
|
154
|
+
* Farbcodes ist keine Mitschrift.
|
|
155
|
+
*/
|
|
156
|
+
export function stripAnsi(text: string): string {
|
|
157
|
+
// Es GEHT hier um ein Steuerzeichen: die Regel warnt vor einem versehentlich
|
|
158
|
+
// in ein Muster geratenen Steuerzeichen, und genau dieses soll entfernt
|
|
159
|
+
// werden.
|
|
160
|
+
// eslint-disable-next-line no-control-regex -- siehe Begruendung darueber.
|
|
161
|
+
return text.replace(/\u001B\[[0-9;]*m/g, "");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** SHA-256-Hex, fuer die kurze Kennung des gemessenen Standes. */
|
|
165
|
+
export function shortDigest(input: string): string {
|
|
166
|
+
return createHash("sha256").update(input, "utf8").digest("hex").slice(0, 16);
|
|
167
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `watch` als Unterbefehl des CLI-Rahmens (WP-124) — die Naht zwischen dem
|
|
3
|
+
* Befehlsvertrag aus `src/cli/command.ts` und dem Komplexitaetswaechter aus
|
|
4
|
+
* `src/commands/watch/` (WP-128).
|
|
5
|
+
*
|
|
6
|
+
* WARUM DIESE DATEI HIER LIEGT UND NICHT IN `commands/watch/`: der Waechter
|
|
7
|
+
* ist bewusst frei von Abhaengigkeiten auf den Rahmen — er baut und laeuft
|
|
8
|
+
* fuer sich allein (`tsconfig.watch.json`, `dist/commands/watch/cli.js`).
|
|
9
|
+
* Die Abhaengigkeit zeigt deshalb in genau eine Richtung: dieser Adapter
|
|
10
|
+
* kennt beide Seiten, der Waechter kennt den Rahmen nicht.
|
|
11
|
+
*
|
|
12
|
+
* WAS DIESE DATEI ERSETZT: `commands/unavailable.ts` fuehrte `watch` bisher
|
|
13
|
+
* als noch nicht gebaute Faehigkeit. Das stimmt nicht mehr; einen fertigen
|
|
14
|
+
* Befehl weiter als unverfuegbar auszuweisen waere dieselbe Unwahrheit wie
|
|
15
|
+
* eine vorgetaeuschte Faehigkeit, nur in die andere Richtung.
|
|
16
|
+
*/
|
|
17
|
+
import { hostname } from "node:os";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
|
|
20
|
+
import { enumFlag, integerFlag, stringFlag, type FlagSpecs, type ParsedArgs } from "../cli/args.js";
|
|
21
|
+
import type { Command, CommandContext } from "../cli/command.js";
|
|
22
|
+
import { EXIT, UsageError } from "../cli/exit.js";
|
|
23
|
+
|
|
24
|
+
import { runIndexWatch } from "./index-watch.js";
|
|
25
|
+
import { parseWatchArgs } from "./watch/options.js";
|
|
26
|
+
import { runWatch } from "./watch/run.js";
|
|
27
|
+
import { CryptoRandom, SystemClock } from "./watch/runtime.js";
|
|
28
|
+
|
|
29
|
+
const FLAGS: FlagSpecs = {
|
|
30
|
+
index: {
|
|
31
|
+
kind: "boolean",
|
|
32
|
+
describe: "Keep the search index current: check freshness and update changes serially",
|
|
33
|
+
defaultLabel: "off; otherwise complexity stream",
|
|
34
|
+
},
|
|
35
|
+
repo: {
|
|
36
|
+
kind: "string",
|
|
37
|
+
placeholder: "ID",
|
|
38
|
+
describe: "--index: configured repository; required when several are configured",
|
|
39
|
+
},
|
|
40
|
+
ref: {
|
|
41
|
+
kind: "string",
|
|
42
|
+
placeholder: "NAME",
|
|
43
|
+
describe: "--index: checked-out ref; otherwise the current branch",
|
|
44
|
+
},
|
|
45
|
+
embedder: {
|
|
46
|
+
kind: "string",
|
|
47
|
+
placeholder: "auto|offline",
|
|
48
|
+
describe:
|
|
49
|
+
"--index: current index profile, otherwise service; offline explicitly uses local vectors",
|
|
50
|
+
defaultLabel: "auto",
|
|
51
|
+
},
|
|
52
|
+
root: {
|
|
53
|
+
kind: "string",
|
|
54
|
+
placeholder: "PATH",
|
|
55
|
+
describe: "Tree to watch",
|
|
56
|
+
defaultLabel: "current directory",
|
|
57
|
+
},
|
|
58
|
+
"repo-id": {
|
|
59
|
+
kind: "string",
|
|
60
|
+
placeholder: "ID",
|
|
61
|
+
describe: "Repository identity for the ref lock",
|
|
62
|
+
defaultLabel: "directory name",
|
|
63
|
+
},
|
|
64
|
+
"ref-id": {
|
|
65
|
+
kind: "string",
|
|
66
|
+
placeholder: "ID",
|
|
67
|
+
describe: "Ref identity for the ref lock",
|
|
68
|
+
defaultLabel: "<repo-id>:working-tree",
|
|
69
|
+
},
|
|
70
|
+
format: {
|
|
71
|
+
kind: "string",
|
|
72
|
+
placeholder: "text|json",
|
|
73
|
+
describe: "Stream output format; json writes one JSON line per event",
|
|
74
|
+
defaultLabel: "text",
|
|
75
|
+
},
|
|
76
|
+
out: {
|
|
77
|
+
kind: "string",
|
|
78
|
+
placeholder: "FILE",
|
|
79
|
+
describe: "Also save the stream, always without control characters",
|
|
80
|
+
},
|
|
81
|
+
color: {
|
|
82
|
+
kind: "boolean",
|
|
83
|
+
describe: "Terminal colors (--no-color disables them)",
|
|
84
|
+
defaultLabel: "enabled when stdout is a terminal",
|
|
85
|
+
},
|
|
86
|
+
debounce: {
|
|
87
|
+
kind: "number",
|
|
88
|
+
placeholder: "MS",
|
|
89
|
+
describe: "Debounce quiet period",
|
|
90
|
+
defaultLabel: "200",
|
|
91
|
+
},
|
|
92
|
+
reconcile: {
|
|
93
|
+
kind: "number",
|
|
94
|
+
placeholder: "MS",
|
|
95
|
+
describe: "Reconciliation interval; --index: freshness-check interval",
|
|
96
|
+
defaultLabel: "30000",
|
|
97
|
+
},
|
|
98
|
+
"max-file-bytes": {
|
|
99
|
+
kind: "number",
|
|
100
|
+
placeholder: "N",
|
|
101
|
+
describe: "Maximum file size; larger files enter the ledger with a reason",
|
|
102
|
+
defaultLabel: "5242880",
|
|
103
|
+
},
|
|
104
|
+
scopes: {
|
|
105
|
+
kind: "number",
|
|
106
|
+
placeholder: "N",
|
|
107
|
+
describe: "Maximum contribution locations reported per change",
|
|
108
|
+
defaultLabel: "5",
|
|
109
|
+
},
|
|
110
|
+
"exit-after": {
|
|
111
|
+
kind: "number",
|
|
112
|
+
placeholder: "N",
|
|
113
|
+
describe: "Stop cleanly after N changes; --index: after N updates",
|
|
114
|
+
defaultLabel: "on signal only",
|
|
115
|
+
},
|
|
116
|
+
"baseline-only": {
|
|
117
|
+
kind: "boolean",
|
|
118
|
+
describe: "Baseline only; --index: check freshness once and update if needed",
|
|
119
|
+
defaultLabel: "off",
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Setzt die zerlegten Flags in die kanonische Aufrufform des Waechters
|
|
125
|
+
* zurueck und laesst dessen EIGENEN Parser darueber laufen.
|
|
126
|
+
*
|
|
127
|
+
* Das sieht nach einem Umweg aus und ist genau deshalb richtig: Vorgaben,
|
|
128
|
+
* Wertebereiche und Fehlermeldungen des Waechters stehen damit an EINER
|
|
129
|
+
* Stelle (`watch/options.ts`) und koennen zwischen dem Rahmenaufruf
|
|
130
|
+
* (`untangle watch`) und dem Direktaufruf (`dist/commands/watch/cli.js`)
|
|
131
|
+
* nicht auseinanderlaufen. Eine zweite, hier nachgebaute Vorgabenliste waere
|
|
132
|
+
* die klassische Stelle, an der ein Werkzeug je nach Aufrufweg etwas anderes
|
|
133
|
+
* tut.
|
|
134
|
+
*/
|
|
135
|
+
function toWatchArgv(args: ParsedArgs): string[] {
|
|
136
|
+
const argv: string[] = [];
|
|
137
|
+
const push = (name: string, value: unknown): void => {
|
|
138
|
+
if (value === undefined) return;
|
|
139
|
+
argv.push(`--${name}`, String(value));
|
|
140
|
+
};
|
|
141
|
+
push("root", args.flags["root"]);
|
|
142
|
+
push("repo-id", args.flags["repo-id"]);
|
|
143
|
+
push("ref-id", args.flags["ref-id"]);
|
|
144
|
+
push("format", args.flags["format"]);
|
|
145
|
+
push("out", args.flags["out"]);
|
|
146
|
+
push("debounce", args.flags["debounce"]);
|
|
147
|
+
push("reconcile", args.flags["reconcile"]);
|
|
148
|
+
push("max-file-bytes", args.flags["max-file-bytes"]);
|
|
149
|
+
push("scopes", args.flags["scopes"]);
|
|
150
|
+
push("exit-after", args.flags["exit-after"]);
|
|
151
|
+
if (args.flags["color"] === false) argv.push("--no-color");
|
|
152
|
+
if (args.flags["baseline-only"] === true) argv.push("--baseline-only");
|
|
153
|
+
return argv;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export const watchCommand: Command = {
|
|
157
|
+
spec: {
|
|
158
|
+
name: "watch",
|
|
159
|
+
implementedBy: "commands/watch-command.js",
|
|
160
|
+
summary: "Complexity monitoring: metric deltas for every change",
|
|
161
|
+
usage: "untangle watch [--index] [--root=<PATH>] [--format=json] [--out=<FILE>]",
|
|
162
|
+
details: [
|
|
163
|
+
"--index selects search-index mode: at startup and each --reconcile interval, " +
|
|
164
|
+
"source hashes and the index contract are checked. Stale, incompatible or missing indexes are " +
|
|
165
|
+
"updated serially. --repo is required with multiple repositories; a ref that is not checked out " +
|
|
166
|
+
"is never updated. --format=json emits index status as JSONL; index reports go to stderr.",
|
|
167
|
+
"Watches a tree and reports each metric's delta for every change, " +
|
|
168
|
+
"structural, semantic, cyclomatic, cognitive, including direction: did the " +
|
|
169
|
+
'change reduce or increase complexity? "cognitive 34 -> 21 ' +
|
|
170
|
+
'(-13, reduced)" describes the change rather than only a raw number.',
|
|
171
|
+
"The three scope metrics aggregate by metrics_scope_id without " +
|
|
172
|
+
"double-counting, using execution_unit scope (spec.md §16.10). The " +
|
|
173
|
+
"semantic load sums the file's chunks and therefore uses " +
|
|
174
|
+
"file_chunks scope. Each number identifies its measurement scope.",
|
|
175
|
+
"A file that could not be analyzed appears in the same stream, " +
|
|
176
|
+
"with a reason and details. Silently omitted files could make " +
|
|
177
|
+
"a partial result appear complete; " +
|
|
178
|
+
"silence does not prove that nothing changed.",
|
|
179
|
+
"Reduced means complexity decreased. It does not prove that " +
|
|
180
|
+
"the change improved the code; vision.md §1b requires " +
|
|
181
|
+
"an unchanged symbol interface, unchanged tests and unchanged " +
|
|
182
|
+
"dependency edges, which this command does not measure.",
|
|
183
|
+
"SIGINT/SIGTERM stops cleanly: watcher stopped, stream closed, " +
|
|
184
|
+
"the ref lock released. The final event reports whether the lock was " +
|
|
185
|
+
"actually released, based on an inspection.",
|
|
186
|
+
],
|
|
187
|
+
flags: FLAGS,
|
|
188
|
+
examples: [
|
|
189
|
+
"untangle watch",
|
|
190
|
+
"untangle watch --format=json --out=complexity.jsonl",
|
|
191
|
+
"untangle watch --root=packages/search --scopes=3",
|
|
192
|
+
"untangle watch --baseline-only",
|
|
193
|
+
"untangle watch --index --reconcile=30000",
|
|
194
|
+
"untangle watch --index --repo=backend --embedder=offline --format=json",
|
|
195
|
+
],
|
|
196
|
+
exitCodes: [
|
|
197
|
+
[EXIT.ok, "Stopped cleanly."],
|
|
198
|
+
[EXIT.operational, "Operational error; for example, another run holds the ref lock."],
|
|
199
|
+
[EXIT.usage, "Invalid arguments."],
|
|
200
|
+
[EXIT.environment, "--index: indexing or environment is not ready."],
|
|
201
|
+
[EXIT.cancelled, "--index: cancelled cleanly by a signal."],
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
async run(ctx: CommandContext, args: ParsedArgs): Promise<number> {
|
|
206
|
+
if (args.positionals.length > 0) {
|
|
207
|
+
throw new UsageError(
|
|
208
|
+
`"untangle watch" does not accept positional arguments; received "${args.positionals[0] ?? ""}".`,
|
|
209
|
+
"Specify the watched tree with --root.",
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (args.flags["index"] === true) {
|
|
214
|
+
for (const name of ["repo-id", "ref-id", "debounce", "max-file-bytes", "scopes", "color"]) {
|
|
215
|
+
if (args.flags[name] !== undefined)
|
|
216
|
+
throw new UsageError(
|
|
217
|
+
`--${name} applies to the complexity watcher, not --index.`,
|
|
218
|
+
"Use --repo/--ref to select the index and --reconcile for the check interval.",
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
const intervalMs = integerFlag(args, "reconcile", 30_000);
|
|
222
|
+
const maxRefreshes =
|
|
223
|
+
args.flags["exit-after"] === undefined ? null : integerFlag(args, "exit-after", 1);
|
|
224
|
+
if (intervalMs === 0 || intervalMs > 2_147_483_647 || maxRefreshes === 0) {
|
|
225
|
+
throw new UsageError(
|
|
226
|
+
"--reconcile and --exit-after must be positive integers; --reconcile is limited to 2147483647 ms.",
|
|
227
|
+
"Example: untangle watch --index --reconcile=30000.",
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
const repo = stringFlag(args, "repo");
|
|
231
|
+
const ref = stringFlag(args, "ref");
|
|
232
|
+
const out = stringFlag(args, "out");
|
|
233
|
+
return runIndexWatch(ctx, {
|
|
234
|
+
root: path.resolve(ctx.cwd, stringFlag(args, "root") ?? "."),
|
|
235
|
+
...(repo === undefined ? {} : { repo }),
|
|
236
|
+
...(ref === undefined ? {} : { ref }),
|
|
237
|
+
embedder: enumFlag(args, "embedder", ["auto", "offline"] as const, "auto"),
|
|
238
|
+
intervalMs,
|
|
239
|
+
format: enumFlag(args, "format", ["text", "json"] as const, "text"),
|
|
240
|
+
outPath: out === undefined ? null : path.resolve(ctx.cwd, out),
|
|
241
|
+
once: args.flags["baseline-only"] === true,
|
|
242
|
+
maxRefreshes,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
if (["repo", "ref", "embedder"].some((name) => args.flags[name] !== undefined)) {
|
|
246
|
+
throw new UsageError(
|
|
247
|
+
"--repo, --ref and --embedder require --index.",
|
|
248
|
+
"The complexity watcher uses --repo-id and --ref-id.",
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const parsed = parseWatchArgs(toWatchArgv(args), {
|
|
253
|
+
cwd: ctx.cwd,
|
|
254
|
+
isTty: process.stdout.isTTY === true,
|
|
255
|
+
noColorEnv: ctx.env["NO_COLOR"],
|
|
256
|
+
});
|
|
257
|
+
if (!parsed.ok) {
|
|
258
|
+
throw new UsageError(parsed.message, 'See "untangle watch --help" for supported options.');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const exitCode = await runWatch(parsed.options, {
|
|
262
|
+
clock: new SystemClock(),
|
|
263
|
+
random: new CryptoRandom(),
|
|
264
|
+
stdout: (chunk) => {
|
|
265
|
+
ctx.io.out(chunk);
|
|
266
|
+
},
|
|
267
|
+
stderr: (chunk) => {
|
|
268
|
+
ctx.io.err(chunk);
|
|
269
|
+
},
|
|
270
|
+
host: hostname(),
|
|
271
|
+
/**
|
|
272
|
+
* Der Rahmen faengt SIGINT/SIGTERM bereits ab und bricht `ctx.signal`
|
|
273
|
+
* ab; der Waechter haengt sich deshalb an DIESES Signal statt einen
|
|
274
|
+
* zweiten Griff auf denselben Prozess zu legen. Die zurueckgegebene
|
|
275
|
+
* Abmeldung loest den Zuhoerer, sobald der Abbau laeuft.
|
|
276
|
+
*/
|
|
277
|
+
installSignalHandler: (handler) => {
|
|
278
|
+
if (ctx.signal.aborted) {
|
|
279
|
+
handler("SIGINT");
|
|
280
|
+
return () => undefined;
|
|
281
|
+
}
|
|
282
|
+
const onAbort = (): void => {
|
|
283
|
+
handler("SIGINT");
|
|
284
|
+
};
|
|
285
|
+
ctx.signal.addEventListener("abort", onAbort, { once: true });
|
|
286
|
+
return () => {
|
|
287
|
+
ctx.signal.removeEventListener("abort", onAbort);
|
|
288
|
+
};
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
return exitCode === 0 ? EXIT.ok : EXIT.operational;
|
|
293
|
+
},
|
|
294
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Is this module the program, or did something import it?"
|
|
3
|
+
*
|
|
4
|
+
* The obvious answer — compare `import.meta.url` with
|
|
5
|
+
* `pathToFileURL(process.argv[1])` — is wrong in exactly the situation this
|
|
6
|
+
* package is built for. `npm install --global` does not copy the binary into
|
|
7
|
+
* the global bin directory; on POSIX it creates a SYMLINK there. Node's ESM
|
|
8
|
+
* loader resolves symlinks, so `import.meta.url` is the real path inside the
|
|
9
|
+
* package while `argv[1]` is the symlink in `…/bin`. The two never match, the
|
|
10
|
+
* guard says "imported", and the installed `untangle` prints nothing and exits
|
|
11
|
+
* 0 — a tool that silently does nothing, which is the worst possible outcome
|
|
12
|
+
* of a one-line installation.
|
|
13
|
+
*
|
|
14
|
+
* So both sides are canonicalized before they are compared. A path that
|
|
15
|
+
* cannot be resolved (deleted between spawn and check, `node --eval`, a
|
|
16
|
+
* platform quirk) falls back to the unresolved comparison rather than
|
|
17
|
+
* throwing: failing to start over a `realpath` error would trade one silent
|
|
18
|
+
* failure for a louder one.
|
|
19
|
+
*/
|
|
20
|
+
import { realpathSync } from "node:fs";
|
|
21
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* True when the module identified by `moduleUrl` is the entry point named by
|
|
25
|
+
* `entryPath` (normally `process.argv[1]`).
|
|
26
|
+
*
|
|
27
|
+
* BOTH sides are canonicalized, not just `entryPath`. The module URL is
|
|
28
|
+
* usually already resolved, but "usually" is not a guarantee worth betting the
|
|
29
|
+
* program's existence on — and on macOS the `/var` → `/private/var` alias
|
|
30
|
+
* makes the two differ even without a symlink in the picture.
|
|
31
|
+
*/
|
|
32
|
+
export function isEntryPoint(moduleUrl: string, entryPath: string | undefined): boolean {
|
|
33
|
+
if (entryPath === undefined || entryPath === "") {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (moduleUrl === pathToFileURL(entryPath).href) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
const canonicalModule = canonical(safeFileUrlToPath(moduleUrl));
|
|
40
|
+
const canonicalEntry = canonical(entryPath);
|
|
41
|
+
return (
|
|
42
|
+
canonicalModule !== undefined &&
|
|
43
|
+
canonicalEntry !== undefined &&
|
|
44
|
+
canonicalModule === canonicalEntry
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function safeFileUrlToPath(moduleUrl: string): string | undefined {
|
|
49
|
+
try {
|
|
50
|
+
return fileURLToPath(moduleUrl);
|
|
51
|
+
} catch {
|
|
52
|
+
// Not a file: URL at all (data:, node:, an http import). Then this module
|
|
53
|
+
// is certainly not a file on disk that argv[1] could name.
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function canonical(path: string | undefined): string | undefined {
|
|
59
|
+
if (path === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
return realpathSync(path);
|
|
64
|
+
} catch {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|