@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,232 @@
|
|
|
1
|
+
/** Declared feature context for a scan; external evidence never becomes a feature metric. */
|
|
2
|
+
import { analyzeProductAlignment } from "@untangle-code/core";
|
|
3
|
+
import type { ProductAlignmentReportV1 } from "@untangle-code/domain";
|
|
4
|
+
|
|
5
|
+
import type { Io } from "../../cli/io.js";
|
|
6
|
+
import { line } from "../../cli/io.js";
|
|
7
|
+
import { formatProductReport } from "../product.js";
|
|
8
|
+
|
|
9
|
+
import type { ExtensionRanV1 } from "./invoke.js";
|
|
10
|
+
|
|
11
|
+
export type ScanProductAnalyzer = typeof analyzeProductAlignment;
|
|
12
|
+
export type ScanFeatureOptions = Parameters<ScanProductAnalyzer>[0] & { featureId: string };
|
|
13
|
+
|
|
14
|
+
export interface ScanFeatureContext {
|
|
15
|
+
requestedFeatureId: string;
|
|
16
|
+
nextSteps: string[];
|
|
17
|
+
/** Full-file own metrics, declared ownership, acceptance and test evidence. */
|
|
18
|
+
report: ProductAlignmentReportV1;
|
|
19
|
+
sourceBinding: {
|
|
20
|
+
status: "unchanged" | "changed" | "unverified";
|
|
21
|
+
beforeDigest: string;
|
|
22
|
+
afterDigest?: string;
|
|
23
|
+
beforeManifestHash?: string;
|
|
24
|
+
afterManifestHash?: string;
|
|
25
|
+
afterStatus?: ProductAlignmentReportV1["status"];
|
|
26
|
+
afterIssues?: string[];
|
|
27
|
+
beforeInventory: ProductAlignmentReportV1["inventory"];
|
|
28
|
+
afterInventory?: ProductAlignmentReportV1["inventory"];
|
|
29
|
+
detail: string;
|
|
30
|
+
nextStep: string;
|
|
31
|
+
};
|
|
32
|
+
externalEvidence: {
|
|
33
|
+
extensionId: string;
|
|
34
|
+
runId: string;
|
|
35
|
+
status:
|
|
36
|
+
"available" | "not_measured" | "source_changed" | "source_unverified" | "no_feature_boundary";
|
|
37
|
+
/** Request time is not proof of the analyzer's underlying source snapshot. */
|
|
38
|
+
analyzerSourceIdentity: "not_independently_proven";
|
|
39
|
+
bindings: {
|
|
40
|
+
kind: "measurement" | "finding";
|
|
41
|
+
index: number;
|
|
42
|
+
relation: "declared_feature_file" | "other_file" | "repository_context" | "unscoped";
|
|
43
|
+
filePath?: string;
|
|
44
|
+
sharedWithFeatures?: string[];
|
|
45
|
+
}[];
|
|
46
|
+
nextStep: string;
|
|
47
|
+
}[];
|
|
48
|
+
limitations: string[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Re-analyze after the external calls, preserving both source identities and missing evidence. */
|
|
52
|
+
export async function finishScanFeature(
|
|
53
|
+
options: ScanFeatureOptions,
|
|
54
|
+
before: ProductAlignmentReportV1,
|
|
55
|
+
outcomes: readonly ExtensionRanV1[],
|
|
56
|
+
analyze: ScanProductAnalyzer = analyzeProductAlignment,
|
|
57
|
+
): Promise<ScanFeatureContext> {
|
|
58
|
+
let after: ProductAlignmentReportV1 | undefined;
|
|
59
|
+
let failure: string | undefined;
|
|
60
|
+
try {
|
|
61
|
+
after = await analyze(options);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
options.signal?.throwIfAborted();
|
|
64
|
+
failure = error instanceof Error ? error.message : String(error);
|
|
65
|
+
}
|
|
66
|
+
options.signal?.throwIfAborted();
|
|
67
|
+
const changed =
|
|
68
|
+
after !== undefined &&
|
|
69
|
+
(before.sourceTreeDigest !== after.sourceTreeDigest ||
|
|
70
|
+
before.manifest.contentHash !== after.manifest.contentHash);
|
|
71
|
+
const verified = after !== undefined && !unstableInventory(before) && !unstableInventory(after);
|
|
72
|
+
const status = changed ? "changed" : verified ? "unchanged" : "unverified";
|
|
73
|
+
const feature = before.features.find((entry) => entry.id === options.featureId);
|
|
74
|
+
const selected = new Set(
|
|
75
|
+
[...(feature?.code.files ?? []), ...(feature?.tests.files ?? [])].map((file) => file.path),
|
|
76
|
+
);
|
|
77
|
+
const shared = new Map(before.coverage.sharedFiles.map((file) => [file.path, file.featureIds]));
|
|
78
|
+
const sharedContext = (filePath: string | undefined): { sharedWithFeatures?: string[] } => {
|
|
79
|
+
const featureIds = filePath === undefined ? undefined : shared.get(filePath);
|
|
80
|
+
return featureIds === undefined ? {} : { sharedWithFeatures: featureIds };
|
|
81
|
+
};
|
|
82
|
+
const nextStep =
|
|
83
|
+
"Repeat scan on a stable working tree; inspect product evidence and analyzer source provenance separately.";
|
|
84
|
+
return {
|
|
85
|
+
requestedFeatureId: options.featureId,
|
|
86
|
+
nextSteps: [
|
|
87
|
+
...(feature === undefined
|
|
88
|
+
? [
|
|
89
|
+
"Review the manifest path and declared feature ID with untangle product; a missing boundary has no feature metrics.",
|
|
90
|
+
]
|
|
91
|
+
: []),
|
|
92
|
+
...(feature?.code.complete === false
|
|
93
|
+
? [
|
|
94
|
+
"Resolve missing, unsupported or partial declared files before treating feature complexity as complete.",
|
|
95
|
+
]
|
|
96
|
+
: []),
|
|
97
|
+
...(outcomes.length === 0
|
|
98
|
+
? [
|
|
99
|
+
"External feature evidence is not measured. Inspect untangle extensions list/status; add and enable an analyzer explicitly if needed.",
|
|
100
|
+
]
|
|
101
|
+
: []),
|
|
102
|
+
...(status === "unchanged" ? [] : [nextStep]),
|
|
103
|
+
],
|
|
104
|
+
report: before,
|
|
105
|
+
sourceBinding: {
|
|
106
|
+
status,
|
|
107
|
+
beforeDigest: before.sourceTreeDigest,
|
|
108
|
+
beforeInventory: before.inventory,
|
|
109
|
+
...(after === undefined
|
|
110
|
+
? {}
|
|
111
|
+
: {
|
|
112
|
+
afterDigest: after.sourceTreeDigest,
|
|
113
|
+
afterStatus: after.status,
|
|
114
|
+
afterIssues: after.issues,
|
|
115
|
+
afterInventory: after.inventory,
|
|
116
|
+
}),
|
|
117
|
+
...(before.manifest.contentHash === undefined
|
|
118
|
+
? {}
|
|
119
|
+
: { beforeManifestHash: before.manifest.contentHash }),
|
|
120
|
+
...(after?.manifest.contentHash === undefined
|
|
121
|
+
? {}
|
|
122
|
+
: { afterManifestHash: after.manifest.contentHash }),
|
|
123
|
+
detail:
|
|
124
|
+
failure === undefined
|
|
125
|
+
? "Compared accepted local inventories and feature-manifest hashes before own analysis and after external calls. This is not an atomic snapshot or proof of a remote analysis revision."
|
|
126
|
+
: `The final local source check failed: ${failure}`,
|
|
127
|
+
nextStep,
|
|
128
|
+
},
|
|
129
|
+
externalEvidence: outcomes.map(({ extensionId, result }) => {
|
|
130
|
+
const bindings: ScanFeatureContext["externalEvidence"][number]["bindings"] = [
|
|
131
|
+
...result.measurements.map((measurement, index) => ({
|
|
132
|
+
kind: "measurement" as const,
|
|
133
|
+
index,
|
|
134
|
+
relation:
|
|
135
|
+
measurement.signal?.scope === "repository"
|
|
136
|
+
? ("repository_context" as const)
|
|
137
|
+
: measurement.signal === undefined || measurement.filePath === undefined
|
|
138
|
+
? ("unscoped" as const)
|
|
139
|
+
: selected.has(measurement.filePath)
|
|
140
|
+
? ("declared_feature_file" as const)
|
|
141
|
+
: ("other_file" as const),
|
|
142
|
+
...(measurement.filePath === undefined ? {} : { filePath: measurement.filePath }),
|
|
143
|
+
...sharedContext(measurement.filePath),
|
|
144
|
+
})),
|
|
145
|
+
...result.findings.map((finding, index) => ({
|
|
146
|
+
kind: "finding" as const,
|
|
147
|
+
index,
|
|
148
|
+
relation: selected.has(finding.filePath)
|
|
149
|
+
? ("declared_feature_file" as const)
|
|
150
|
+
: ("other_file" as const),
|
|
151
|
+
filePath: finding.filePath,
|
|
152
|
+
...sharedContext(finding.filePath),
|
|
153
|
+
})),
|
|
154
|
+
];
|
|
155
|
+
return {
|
|
156
|
+
extensionId,
|
|
157
|
+
runId: result.run.runId,
|
|
158
|
+
status:
|
|
159
|
+
feature === undefined
|
|
160
|
+
? "no_feature_boundary"
|
|
161
|
+
: status === "changed"
|
|
162
|
+
? "source_changed"
|
|
163
|
+
: status === "unverified"
|
|
164
|
+
? "source_unverified"
|
|
165
|
+
: result.run.exitStatus !== "completed" || bindings.length === 0
|
|
166
|
+
? "not_measured"
|
|
167
|
+
: "available",
|
|
168
|
+
analyzerSourceIdentity: "not_independently_proven",
|
|
169
|
+
bindings,
|
|
170
|
+
nextStep:
|
|
171
|
+
bindings.length === 0
|
|
172
|
+
? "Inspect run errors, skips, output mapping and configured analyzer target; empty output is not a passed feature check."
|
|
173
|
+
: "Use file bindings as declared context only; verify the analyzer project/revision, corpus and metric definition before drawing conclusions.",
|
|
174
|
+
};
|
|
175
|
+
}),
|
|
176
|
+
limitations: [
|
|
177
|
+
"No external measurement is added, compared or attributed as a feature total. Repository measurements remain repository context.",
|
|
178
|
+
"A file binding follows the declared feature map and can belong to several features; it does not prove feature ownership or semantic conformance.",
|
|
179
|
+
"The local digest covers the accepted product inventory, not excluded files or an external server's source revision. Equal request-time inventories do not prove fresh remote measures.",
|
|
180
|
+
"No enabled analyzer or no evidence means not measured, never zero complexity or a passed quality gate.",
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function unstableInventory(report: ProductAlignmentReportV1): boolean {
|
|
186
|
+
return (
|
|
187
|
+
report.inventory.truncated ||
|
|
188
|
+
report.issues.some(
|
|
189
|
+
(issue) => issue.startsWith("Accepted source") || issue.startsWith("Accepted inventory"),
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function renderScanFeature(io: Io, context: ScanFeatureContext): void {
|
|
195
|
+
line(io, "\n# Declared feature — own analysis, responsibility and evidence");
|
|
196
|
+
line(io, formatProductReport(context.report));
|
|
197
|
+
if (context.report.features.length === 0) {
|
|
198
|
+
line(
|
|
199
|
+
io,
|
|
200
|
+
`Feature ${context.requestedFeatureId} was not resolved. Review untangle.features.json and run untangle product.`,
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
line(io, `Local source binding: ${context.sourceBinding.status}`);
|
|
204
|
+
line(io, ` ${context.sourceBinding.detail}`);
|
|
205
|
+
if (context.sourceBinding.status !== "unchanged")
|
|
206
|
+
line(io, ` Action: ${context.sourceBinding.nextStep}`);
|
|
207
|
+
if (context.externalEvidence.length === 0)
|
|
208
|
+
line(
|
|
209
|
+
io,
|
|
210
|
+
"External feature evidence: not measured; inspect untangle extensions list/status and explicitly configure the desired analyzer.",
|
|
211
|
+
);
|
|
212
|
+
for (const evidence of context.externalEvidence) {
|
|
213
|
+
line(
|
|
214
|
+
io,
|
|
215
|
+
` ${evidence.extensionId}: ${evidence.status}; analyzer source identity: ${evidence.analyzerSourceIdentity}`,
|
|
216
|
+
);
|
|
217
|
+
for (const binding of evidence.bindings)
|
|
218
|
+
line(
|
|
219
|
+
io,
|
|
220
|
+
` ${binding.kind}[${binding.index}]: ${binding.relation}${binding.filePath === undefined ? "" : ` — ${binding.filePath}`}`,
|
|
221
|
+
);
|
|
222
|
+
for (const binding of evidence.bindings)
|
|
223
|
+
if (binding.sharedWithFeatures !== undefined)
|
|
224
|
+
line(
|
|
225
|
+
io,
|
|
226
|
+
` Shared file: ${binding.filePath}; features ${binding.sharedWithFeatures.join(", ")}`,
|
|
227
|
+
);
|
|
228
|
+
line(io, ` Action: ${evidence.nextStep}`);
|
|
229
|
+
}
|
|
230
|
+
for (const limitation of context.limitations) line(io, `Limit: ${limitation}`);
|
|
231
|
+
for (const nextStep of context.nextSteps) line(io, `Action: ${nextStep}`);
|
|
232
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
/** Shared extension execution for `extensions run` and `scan`.
|
|
2
|
+
* Expected refusals and failures are data; cancellation still aborts the caller.
|
|
3
|
+
* The caller owns rendering and persistence of the returned run record.
|
|
4
|
+
*/
|
|
5
|
+
import { buildRefId, buildRepoId, buildWorkspaceId, sha256Hex } from "@untangle-code/domain";
|
|
6
|
+
import {
|
|
7
|
+
buildHttpAuthHeaders,
|
|
8
|
+
createFetchHttpRunner,
|
|
9
|
+
createNodeProcessRunner,
|
|
10
|
+
detectExtension,
|
|
11
|
+
runExtension,
|
|
12
|
+
redactSecrets,
|
|
13
|
+
type ExtensionHealthV1,
|
|
14
|
+
type ExtensionRunResultV1,
|
|
15
|
+
type FileResolutionV1,
|
|
16
|
+
type LicenseGateDecisionV1,
|
|
17
|
+
type LoadedExtensionV1,
|
|
18
|
+
type ProcessLimitsV1,
|
|
19
|
+
} from "@untangle-code/extension-runtime";
|
|
20
|
+
|
|
21
|
+
import { createContainerCli } from "./container.js";
|
|
22
|
+
import type { ExtensionContextV1 } from "./context.js";
|
|
23
|
+
import { gateFor } from "./context.js";
|
|
24
|
+
import type { ExtensionEnvironmentV1 } from "./environment.js";
|
|
25
|
+
import { provisionContainer, type ProvisionResultV1 } from "./provision.js";
|
|
26
|
+
import { resolveSecretEnvironment } from "./secret-store.js";
|
|
27
|
+
import { missingAnalyzerSecrets, setupCredentials } from "./setup.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Warum eine Extension NICHT gelaufen ist — geschlossene Menge (E4).
|
|
31
|
+
*
|
|
32
|
+
* Bewusst NICHT die `SkipReason` des Domains: die beschreibt uebersprungene
|
|
33
|
+
* GEGENSTAENDE einer Pipeline und hat fuer offenes Gate, fehlendes Secret,
|
|
34
|
+
* verweigerte Zustimmung und nicht-aktiviert kein Glied. Diese Menge beschreibt
|
|
35
|
+
* einen nicht stattgefundenen AUFRUF, und sie bleibt lokal, bis ein zweiter
|
|
36
|
+
* Konsument sie braucht.
|
|
37
|
+
*/
|
|
38
|
+
export const EXTENSION_NOT_RUN_REASONS = [
|
|
39
|
+
"not_enabled",
|
|
40
|
+
"license_gate_open",
|
|
41
|
+
"consent_withheld",
|
|
42
|
+
"secret_missing",
|
|
43
|
+
"setup_failed",
|
|
44
|
+
"provision_failed",
|
|
45
|
+
"invocation_failed",
|
|
46
|
+
] as const;
|
|
47
|
+
|
|
48
|
+
export type ExtensionNotRunReason = (typeof EXTENSION_NOT_RUN_REASONS)[number];
|
|
49
|
+
|
|
50
|
+
export interface ExtensionNotRunV1 {
|
|
51
|
+
status: "not_run";
|
|
52
|
+
extensionId: string;
|
|
53
|
+
reason: ExtensionNotRunReason;
|
|
54
|
+
/** Menschenlesbare Begruendung; nie leer (E4). */
|
|
55
|
+
detail: string;
|
|
56
|
+
/** Der Befehl, der den Zustand aufloesen wuerde, sofern es einen gibt. */
|
|
57
|
+
nextStep?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ExtensionRanV1 {
|
|
61
|
+
status: "ran";
|
|
62
|
+
extensionId: string;
|
|
63
|
+
health: ExtensionHealthV1;
|
|
64
|
+
result: ExtensionRunResultV1;
|
|
65
|
+
provision?: ProvisionResultV1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type InvokeExtensionOutcome = ExtensionRanV1 | ExtensionNotRunV1;
|
|
69
|
+
|
|
70
|
+
export interface InvokeExtensionInput {
|
|
71
|
+
environment: ExtensionEnvironmentV1;
|
|
72
|
+
context: ExtensionContextV1;
|
|
73
|
+
extension: LoadedExtensionV1;
|
|
74
|
+
workspacePath: string;
|
|
75
|
+
target: string;
|
|
76
|
+
ruleset?: string;
|
|
77
|
+
httpUrl?: string;
|
|
78
|
+
limits: ProcessLimitsV1;
|
|
79
|
+
/**
|
|
80
|
+
* Ob eine Container-Bereitstellung erfolgen darf (X1). Ohne sie wird nichts
|
|
81
|
+
* gestartet und nichts gezogen; der Fall erscheint als `consent_withheld`.
|
|
82
|
+
*/
|
|
83
|
+
provisionConsent: boolean;
|
|
84
|
+
/** Nur fuer den Fall `not_enabled` — der Aufrufer entscheidet, ob er ihn prueft. */
|
|
85
|
+
requireEnabled?: boolean;
|
|
86
|
+
fetchImpl?: typeof fetch;
|
|
87
|
+
onProvisionStep?: (step: string) => void;
|
|
88
|
+
/** Called after the gate, before provisioning, to disclose resource costs. */
|
|
89
|
+
onProvisionPlanned?: (detail: string) => void;
|
|
90
|
+
signal?: AbortSignal;
|
|
91
|
+
/** Wie ein vom Werkzeug genannter Pfad auf das Repository abgebildet wird. */
|
|
92
|
+
resolveFile: (path: string) => FileResolutionV1;
|
|
93
|
+
/** Wie eine Werkzeugposition in einen Bytebereich uebersetzt wird. */
|
|
94
|
+
resolvePosition: Parameters<typeof runExtension>[1]["resolvePosition"];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export async function invokeExtension(
|
|
98
|
+
input: InvokeExtensionInput,
|
|
99
|
+
): Promise<InvokeExtensionOutcome> {
|
|
100
|
+
input.signal?.throwIfAborted();
|
|
101
|
+
const secrets = input.extension.manifest.secrets
|
|
102
|
+
.map((secret) => input.environment.env[secret.envVar])
|
|
103
|
+
.filter((value): value is string => value !== undefined && value !== "");
|
|
104
|
+
try {
|
|
105
|
+
const outcome = await executeExtension(input, secrets);
|
|
106
|
+
input.signal?.throwIfAborted();
|
|
107
|
+
return outcome;
|
|
108
|
+
} catch (error) {
|
|
109
|
+
input.signal?.throwIfAborted();
|
|
110
|
+
return {
|
|
111
|
+
status: "not_run",
|
|
112
|
+
extensionId: input.extension.manifest.id,
|
|
113
|
+
reason: "invocation_failed",
|
|
114
|
+
detail: redactSecrets(error instanceof Error ? error.message : String(error), secrets),
|
|
115
|
+
nextStep: `untangle extensions status ${input.extension.manifest.id}`,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function executeExtension(
|
|
121
|
+
input: InvokeExtensionInput,
|
|
122
|
+
sensitiveValues: string[],
|
|
123
|
+
): Promise<InvokeExtensionOutcome> {
|
|
124
|
+
const { environment, context, extension } = input;
|
|
125
|
+
const manifest = extension.manifest;
|
|
126
|
+
const extensionId = manifest.id;
|
|
127
|
+
const ruleset = input.ruleset ?? manifest.defaultRuleset;
|
|
128
|
+
|
|
129
|
+
if (input.requireEnabled === true && !context.state.enabled.includes(extensionId)) {
|
|
130
|
+
return {
|
|
131
|
+
status: "not_run",
|
|
132
|
+
extensionId,
|
|
133
|
+
reason: "not_enabled",
|
|
134
|
+
detail: `"${extensionId}" is installed but not enabled; enabling starts nothing (X1)`,
|
|
135
|
+
nextStep: `untangle extensions enable ${extensionId}`,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Das Lizenz-Gate steht vor allem anderen (X5): ohne Bestaetigung wird nicht
|
|
140
|
+
// einmal die Version abgefragt.
|
|
141
|
+
const gate: LicenseGateDecisionV1 = gateFor(context, extension, ruleset);
|
|
142
|
+
if (!gate.allowed) {
|
|
143
|
+
const reasons = [gate.tool, ...gate.rulesets]
|
|
144
|
+
.filter((outcome) => outcome.status !== "acknowledged" && outcome.status !== "not_required")
|
|
145
|
+
.map((outcome) => outcome.reason)
|
|
146
|
+
.join("; ");
|
|
147
|
+
return {
|
|
148
|
+
status: "not_run",
|
|
149
|
+
extensionId,
|
|
150
|
+
reason: "license_gate_open",
|
|
151
|
+
detail: `nothing was started and nothing was pulled: ${reasons}`,
|
|
152
|
+
...(gate.acknowledgeCommands.length === 0
|
|
153
|
+
? {}
|
|
154
|
+
: { nextStep: gate.acknowledgeCommands.join(" && ") }),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const clock = environment.clock;
|
|
159
|
+
const runtimeDeps = {
|
|
160
|
+
clock,
|
|
161
|
+
random: environment.random,
|
|
162
|
+
processRunner: createNodeProcessRunner(clock),
|
|
163
|
+
httpRunner: createFetchHttpRunner(
|
|
164
|
+
(input.fetchImpl ?? fetch) as Parameters<typeof createFetchHttpRunner>[0],
|
|
165
|
+
clock,
|
|
166
|
+
),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
let provision: ProvisionResultV1 | undefined;
|
|
170
|
+
if (manifest.container !== undefined) {
|
|
171
|
+
if (!input.provisionConsent) {
|
|
172
|
+
const resources = manifest.resources;
|
|
173
|
+
return {
|
|
174
|
+
status: "not_run",
|
|
175
|
+
extensionId,
|
|
176
|
+
reason: "consent_withheld",
|
|
177
|
+
detail:
|
|
178
|
+
`a container would have to be provisioned first: at least ` +
|
|
179
|
+
`${String(resources.minMemoryMb)} MB memory (recommended ` +
|
|
180
|
+
`${String(resources.recommendedMemoryMb)} MB), ${String(resources.recommendedCpus)} CPUs, ` +
|
|
181
|
+
`image ${manifest.container.image}@${manifest.container.digest}`,
|
|
182
|
+
nextStep: `untangle extensions run ${extensionId} --yes`,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const resources = manifest.resources;
|
|
186
|
+
input.onProvisionPlanned?.(
|
|
187
|
+
`${extensionId}: memory at least ${String(resources.minMemoryMb)} MB, ` +
|
|
188
|
+
`recommended ${String(resources.recommendedMemoryMb)} MB; ` +
|
|
189
|
+
`cpus recommended ${String(resources.recommendedCpus)}; ` +
|
|
190
|
+
`image ${manifest.container.image}@${manifest.container.digest}`,
|
|
191
|
+
);
|
|
192
|
+
provision = await provisionContainer(
|
|
193
|
+
{
|
|
194
|
+
fs: environment.fs,
|
|
195
|
+
container: createContainerCli({
|
|
196
|
+
processRunner: runtimeDeps.processRunner,
|
|
197
|
+
limits: { ...input.limits, timeoutMs: 300_000 },
|
|
198
|
+
...(environment.env["UNTANGLE_CONTAINER_CLI"] === undefined
|
|
199
|
+
? {}
|
|
200
|
+
: { command: environment.env["UNTANGLE_CONTAINER_CLI"] }),
|
|
201
|
+
}),
|
|
202
|
+
httpRunner: runtimeDeps.httpRunner,
|
|
203
|
+
limits: input.limits,
|
|
204
|
+
wait: waitForRetry,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
manifest,
|
|
208
|
+
userDataDirectory: environment.userDataDir,
|
|
209
|
+
workspacePath: input.workspacePath,
|
|
210
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
211
|
+
},
|
|
212
|
+
);
|
|
213
|
+
for (const step of provision.steps) {
|
|
214
|
+
input.onProvisionStep?.(step);
|
|
215
|
+
}
|
|
216
|
+
if (!provision.healthy) {
|
|
217
|
+
return {
|
|
218
|
+
status: "not_run",
|
|
219
|
+
extensionId,
|
|
220
|
+
reason: "provision_failed",
|
|
221
|
+
detail: provision.detail,
|
|
222
|
+
nextStep: `untangle extensions logs ${extensionId}`,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const httpUrl = input.httpUrl ?? manifest.http?.defaultUrl;
|
|
228
|
+
let effectiveEnv = await resolveSecretEnvironment(environment, manifest, httpUrl);
|
|
229
|
+
if (manifest.setup && missingAnalyzerSecrets(manifest, effectiveEnv).length > 0) {
|
|
230
|
+
try {
|
|
231
|
+
effectiveEnv = await setupCredentials({
|
|
232
|
+
environment,
|
|
233
|
+
manifest,
|
|
234
|
+
...(provision === undefined ? {} : { provision }),
|
|
235
|
+
consent: input.provisionConsent,
|
|
236
|
+
...(httpUrl === undefined ? {} : { url: httpUrl }),
|
|
237
|
+
processRunner: runtimeDeps.processRunner,
|
|
238
|
+
limits: input.limits,
|
|
239
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
240
|
+
});
|
|
241
|
+
input.onProvisionStep?.(
|
|
242
|
+
"required credentials were initialized and stored in the private user profile",
|
|
243
|
+
);
|
|
244
|
+
} catch (error) {
|
|
245
|
+
input.signal?.throwIfAborted();
|
|
246
|
+
return {
|
|
247
|
+
status: "not_run",
|
|
248
|
+
extensionId,
|
|
249
|
+
reason: "setup_failed",
|
|
250
|
+
detail: error instanceof Error ? error.message : "Credential setup failed.",
|
|
251
|
+
nextStep: `untangle extensions configure ${extensionId}`,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
for (const secret of manifest.secrets) {
|
|
256
|
+
const value = effectiveEnv[secret.envVar];
|
|
257
|
+
if (value) sensitiveValues.push(value);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Secrets kommen aus Umgebung/privatem Store, nie aus dem Manifest (§8.5). Die
|
|
261
|
+
// Reihenfolge nach der Bereitstellung ist Absicht: ein Token kann der Dienst
|
|
262
|
+
// erst ausstellen, wenn er laeuft.
|
|
263
|
+
const secretEnv: Record<string, string> = {};
|
|
264
|
+
const secretValues: string[] = [];
|
|
265
|
+
const missingSecrets: string[] = [];
|
|
266
|
+
for (const secret of manifest.secrets) {
|
|
267
|
+
if (secret.setupOnly) continue;
|
|
268
|
+
const value = effectiveEnv[secret.envVar];
|
|
269
|
+
if (value === undefined || value === "") {
|
|
270
|
+
if (secret.required) {
|
|
271
|
+
missingSecrets.push(`${secret.name} (${secret.envVar}): ${secret.purpose}`);
|
|
272
|
+
}
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
secretEnv[secret.envVar] = value;
|
|
276
|
+
secretValues.push(value);
|
|
277
|
+
}
|
|
278
|
+
if (missingSecrets.length > 0) {
|
|
279
|
+
return {
|
|
280
|
+
status: "not_run",
|
|
281
|
+
extensionId,
|
|
282
|
+
reason: "secret_missing",
|
|
283
|
+
detail:
|
|
284
|
+
`required secrets are not set in the environment or private config: ${missingSecrets.join("; ")}` +
|
|
285
|
+
(provision?.healthy === true
|
|
286
|
+
? "; the service itself is up, so a token can be created there now"
|
|
287
|
+
: ""),
|
|
288
|
+
nextStep: `untangle extensions configure ${extensionId}`,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const toolEnv: Record<string, string> = {
|
|
293
|
+
PATH: environment.env["PATH"] ?? "",
|
|
294
|
+
...(environment.env["HOME"] === undefined ? {} : { HOME: environment.env["HOME"] }),
|
|
295
|
+
...(environment.env["LANG"] === undefined ? {} : { LANG: environment.env["LANG"] }),
|
|
296
|
+
...secretEnv,
|
|
297
|
+
};
|
|
298
|
+
const httpHeaders = buildHttpAuthHeaders(manifest, effectiveEnv);
|
|
299
|
+
|
|
300
|
+
const health = await detectExtension(runtimeDeps, {
|
|
301
|
+
extension,
|
|
302
|
+
licenseGate: gate.tool.status,
|
|
303
|
+
env: toolEnv,
|
|
304
|
+
secretValues,
|
|
305
|
+
limits: input.limits,
|
|
306
|
+
...(httpUrl === undefined ? {} : { httpUrl }),
|
|
307
|
+
...(Object.keys(httpHeaders).length === 0 ? {} : { httpHeaders }),
|
|
308
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// X6: der Pin gilt fuer den Container, den Untangle gestartet hat — auch
|
|
312
|
+
// wenn analysiert wird, indem man ihn fragt.
|
|
313
|
+
if (provision !== undefined && manifest.container !== undefined) {
|
|
314
|
+
const digest = provision.state.imageDigest;
|
|
315
|
+
if (digest !== undefined) {
|
|
316
|
+
health.imageDigest = digest;
|
|
317
|
+
health.digestMatchesManifest = digest === manifest.container.digest;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const repoId = buildRepoId({ canonicalPath: input.workspacePath });
|
|
322
|
+
const workspaceId = buildWorkspaceId({ configHash: sha256Hex(input.workspacePath) });
|
|
323
|
+
const refId = buildRefId(repoId, "working-tree");
|
|
324
|
+
|
|
325
|
+
const result = await runExtension(runtimeDeps, {
|
|
326
|
+
extension,
|
|
327
|
+
health,
|
|
328
|
+
gate,
|
|
329
|
+
workspaceId,
|
|
330
|
+
repoId,
|
|
331
|
+
refId,
|
|
332
|
+
workspacePath: input.workspacePath,
|
|
333
|
+
target: input.target,
|
|
334
|
+
env: toolEnv,
|
|
335
|
+
secretValues,
|
|
336
|
+
limits: input.limits,
|
|
337
|
+
...(ruleset === undefined ? {} : { ruleset }),
|
|
338
|
+
...(httpUrl === undefined ? {} : { httpUrl }),
|
|
339
|
+
...(Object.keys(httpHeaders).length === 0 ? {} : { httpHeaders }),
|
|
340
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
341
|
+
resolveFile: input.resolveFile,
|
|
342
|
+
resolvePosition: input.resolvePosition,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
status: "ran",
|
|
347
|
+
extensionId,
|
|
348
|
+
health,
|
|
349
|
+
result,
|
|
350
|
+
...(provision === undefined ? {} : { provision }),
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Abortable wait without leaving listeners behind after each health probe. */
|
|
355
|
+
function waitForRetry(ms: number, signal?: AbortSignal): Promise<void> {
|
|
356
|
+
signal?.throwIfAborted();
|
|
357
|
+
return new Promise((resolve, reject) => {
|
|
358
|
+
const onAbort = (): void => {
|
|
359
|
+
clearTimeout(timer);
|
|
360
|
+
reject(signal?.reason);
|
|
361
|
+
};
|
|
362
|
+
const timer = setTimeout(() => {
|
|
363
|
+
signal?.removeEventListener("abort", onAbort);
|
|
364
|
+
resolve();
|
|
365
|
+
}, ms);
|
|
366
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
367
|
+
});
|
|
368
|
+
}
|