@dataparade/cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +592 -0
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.js +7 -0
- package/dist/bin/load-env.d.ts +2 -0
- package/dist/bin/load-env.js +4 -0
- package/dist/src/ai-enrichment/agent-orchestrator.d.ts +28 -0
- package/dist/src/ai-enrichment/agent-orchestrator.js +476 -0
- package/dist/src/ai-enrichment/agents/index.d.ts +4 -0
- package/dist/src/ai-enrichment/agents/index.js +50 -0
- package/dist/src/ai-enrichment/candidate-selector.d.ts +10 -0
- package/dist/src/ai-enrichment/candidate-selector.js +158 -0
- package/dist/src/ai-enrichment/fallbacks.d.ts +6 -0
- package/dist/src/ai-enrichment/fallbacks.js +762 -0
- package/dist/src/ai-enrichment/index.d.ts +15 -0
- package/dist/src/ai-enrichment/index.js +31 -0
- package/dist/src/ai-enrichment/merge-rules.d.ts +12 -0
- package/dist/src/ai-enrichment/merge-rules.js +321 -0
- package/dist/src/ai-enrichment/non-pii-signal-rules.d.ts +10 -0
- package/dist/src/ai-enrichment/non-pii-signal-rules.js +72 -0
- package/dist/src/ai-enrichment/openai-proposals-response.schema.d.ts +94 -0
- package/dist/src/ai-enrichment/openai-proposals-response.schema.js +82 -0
- package/dist/src/ai-enrichment/pii-signal-rules.d.ts +8 -0
- package/dist/src/ai-enrichment/pii-signal-rules.js +68 -0
- package/dist/src/ai-enrichment/pipeline.d.ts +2 -0
- package/dist/src/ai-enrichment/pipeline.js +48 -0
- package/dist/src/ai-enrichment/planner.d.ts +2 -0
- package/dist/src/ai-enrichment/planner.js +60 -0
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.d.ts +12 -0
- package/dist/src/ai-enrichment/prompts/provider-enrichment-prompts.js +45 -0
- package/dist/src/ai-enrichment/provider-prompt.d.ts +32 -0
- package/dist/src/ai-enrichment/provider-prompt.js +222 -0
- package/dist/src/ai-enrichment/provider-topology-rules.d.ts +52 -0
- package/dist/src/ai-enrichment/provider-topology-rules.js +190 -0
- package/dist/src/ai-enrichment/provider-topology-shared.d.ts +48 -0
- package/dist/src/ai-enrichment/provider-topology-shared.js +329 -0
- package/dist/src/ai-enrichment/providers/endpoint-resolution.d.ts +13 -0
- package/dist/src/ai-enrichment/providers/endpoint-resolution.js +41 -0
- package/dist/src/ai-enrichment/providers/families/chat-completions-family.d.ts +13 -0
- package/dist/src/ai-enrichment/providers/families/chat-completions-family.js +181 -0
- package/dist/src/ai-enrichment/providers/families/generate-content-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/generate-content-family.js +93 -0
- package/dist/src/ai-enrichment/providers/families/messages-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/messages-family.js +86 -0
- package/dist/src/ai-enrichment/providers/families/ollama-generate-family.d.ts +10 -0
- package/dist/src/ai-enrichment/providers/families/ollama-generate-family.js +69 -0
- package/dist/src/ai-enrichment/providers/fetch-with-timeout.d.ts +2 -0
- package/dist/src/ai-enrichment/providers/fetch-with-timeout.js +22 -0
- package/dist/src/ai-enrichment/providers/index.d.ts +16 -0
- package/dist/src/ai-enrichment/providers/index.js +40 -0
- package/dist/src/ai-enrichment/providers/mock.d.ts +5 -0
- package/dist/src/ai-enrichment/providers/mock.js +12 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.d.ts +20 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.js +116 -0
- package/dist/src/ai-enrichment/providers/presets.d.ts +14 -0
- package/dist/src/ai-enrichment/providers/presets.js +50 -0
- package/dist/src/ai-enrichment/providers/provider-contract.d.ts +20 -0
- package/dist/src/ai-enrichment/providers/provider-contract.js +703 -0
- package/dist/src/ai-enrichment/providers/provider-json-parse.d.ts +23 -0
- package/dist/src/ai-enrichment/providers/provider-json-parse.js +96 -0
- package/dist/src/ai-enrichment/providers/provider-output-token-budget.d.ts +5 -0
- package/dist/src/ai-enrichment/providers/provider-output-token-budget.js +11 -0
- package/dist/src/ai-enrichment/providers/provider-pricing.d.ts +7 -0
- package/dist/src/ai-enrichment/providers/provider-pricing.js +32 -0
- package/dist/src/ai-enrichment/providers/provider-runtime.d.ts +9 -0
- package/dist/src/ai-enrichment/providers/provider-runtime.js +54 -0
- package/dist/src/ai-enrichment/providers/resolve-provider.d.ts +27 -0
- package/dist/src/ai-enrichment/providers/resolve-provider.js +41 -0
- package/dist/src/ai-enrichment/providers/types.d.ts +24 -0
- package/dist/src/ai-enrichment/providers/types.js +2 -0
- package/dist/src/ai-enrichment/scan-paths.d.ts +9 -0
- package/dist/src/ai-enrichment/scan-paths.js +28 -0
- package/dist/src/ai-enrichment/sensitive-paths.d.ts +5 -0
- package/dist/src/ai-enrichment/sensitive-paths.js +10 -0
- package/dist/src/ai-enrichment/third-party-data-flow.d.ts +27 -0
- package/dist/src/ai-enrichment/third-party-data-flow.js +518 -0
- package/dist/src/ai-enrichment/third-party-evidence.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-evidence.js +426 -0
- package/dist/src/ai-enrichment/third-party-property-matrix.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-property-matrix.js +52 -0
- package/dist/src/ai-enrichment/third-party-subtype.d.ts +14 -0
- package/dist/src/ai-enrichment/third-party-subtype.js +166 -0
- package/dist/src/ai-enrichment/tools/index.d.ts +39 -0
- package/dist/src/ai-enrichment/tools/index.js +121 -0
- package/dist/src/ai-enrichment/types.d.ts +170 -0
- package/dist/src/ai-enrichment/types.js +12 -0
- package/dist/src/analyzers/python/dependency-manifests.d.ts +8 -0
- package/dist/src/analyzers/python/dependency-manifests.js +131 -0
- package/dist/src/analyzers/python/detector.d.ts +3 -0
- package/dist/src/analyzers/python/detector.js +22 -0
- package/dist/src/analyzers/python/index.d.ts +2 -0
- package/dist/src/analyzers/python/index.js +11 -0
- package/dist/src/analyzers/python/manifest-parsers.d.ts +3 -0
- package/dist/src/analyzers/python/manifest-parsers.js +134 -0
- package/dist/src/analyzers/python/parser.d.ts +26 -0
- package/dist/src/analyzers/python/parser.js +187 -0
- package/dist/src/analyzers/python/patterns.d.ts +7 -0
- package/dist/src/analyzers/python/patterns.js +106 -0
- package/dist/src/analyzers/python/python-detection-config.d.ts +75 -0
- package/dist/src/analyzers/python/python-detection-config.js +148 -0
- package/dist/src/analyzers/registry.d.ts +13 -0
- package/dist/src/analyzers/registry.js +60 -0
- package/dist/src/analyzers/shared/manifest-budgets.d.ts +19 -0
- package/dist/src/analyzers/shared/manifest-budgets.js +21 -0
- package/dist/src/analyzers/shared/manifest-fs.d.ts +13 -0
- package/dist/src/analyzers/shared/manifest-fs.js +138 -0
- package/dist/src/analyzers/shared/property-inference.d.ts +8 -0
- package/dist/src/analyzers/shared/property-inference.js +165 -0
- package/dist/src/analyzers/terraform/detector.d.ts +10 -0
- package/dist/src/analyzers/terraform/detector.js +198 -0
- package/dist/src/analyzers/terraform/index.d.ts +2 -0
- package/dist/src/analyzers/terraform/index.js +13 -0
- package/dist/src/analyzers/terraform/parser.d.ts +29 -0
- package/dist/src/analyzers/terraform/parser.js +202 -0
- package/dist/src/analyzers/terraform/terraform-detection-config.d.ts +48 -0
- package/dist/src/analyzers/terraform/terraform-detection-config.js +218 -0
- package/dist/src/analyzers/terraform/terraform-exec.d.ts +11 -0
- package/dist/src/analyzers/terraform/terraform-exec.js +35 -0
- package/dist/src/analyzers/terraform/terraform-module-manifest.d.ts +19 -0
- package/dist/src/analyzers/terraform/terraform-module-manifest.js +75 -0
- package/dist/src/analyzers/terraform/terraform-show-json.d.ts +15 -0
- package/dist/src/analyzers/terraform/terraform-show-json.js +188 -0
- package/dist/src/analyzers/terraform/terraform-utility-resource.d.ts +12 -0
- package/dist/src/analyzers/terraform/terraform-utility-resource.js +30 -0
- package/dist/src/analyzers/types.d.ts +5 -0
- package/dist/src/analyzers/types.js +2 -0
- package/dist/src/analyzers/typescript/actor-detection.d.ts +4 -0
- package/dist/src/analyzers/typescript/actor-detection.js +15 -0
- package/dist/src/analyzers/typescript/dependency-manifests.d.ts +9 -0
- package/dist/src/analyzers/typescript/dependency-manifests.js +131 -0
- package/dist/src/analyzers/typescript/detector.d.ts +3 -0
- package/dist/src/analyzers/typescript/detector.js +23 -0
- package/dist/src/analyzers/typescript/index.d.ts +2 -0
- package/dist/src/analyzers/typescript/index.js +11 -0
- package/dist/src/analyzers/typescript/manifest-parsers.d.ts +1 -0
- package/dist/src/analyzers/typescript/manifest-parsers.js +30 -0
- package/dist/src/analyzers/typescript/parser.d.ts +44 -0
- package/dist/src/analyzers/typescript/parser.js +287 -0
- package/dist/src/analyzers/typescript/third-party-detection.d.ts +4 -0
- package/dist/src/analyzers/typescript/third-party-detection.js +16 -0
- package/dist/src/analyzers/typescript/typescript-detection-config.d.ts +68 -0
- package/dist/src/analyzers/typescript/typescript-detection-config.js +171 -0
- package/dist/src/analyzers/typescript/typescript-detection.d.ts +10 -0
- package/dist/src/analyzers/typescript/typescript-detection.js +57 -0
- package/dist/src/classifier/application-injection.d.ts +12 -0
- package/dist/src/classifier/application-injection.js +335 -0
- package/dist/src/classifier/classify.d.ts +3 -0
- package/dist/src/classifier/classify.js +15 -0
- package/dist/src/classifier/component-factory.d.ts +3 -0
- package/dist/src/classifier/component-factory.js +488 -0
- package/dist/src/classifier/config.d.ts +38 -0
- package/dist/src/classifier/config.js +260 -0
- package/dist/src/classifier/enhance-defaults.d.ts +28 -0
- package/dist/src/classifier/enhance-defaults.js +369 -0
- package/dist/src/classifier/enhance.d.ts +13 -0
- package/dist/src/classifier/enhance.js +295 -0
- package/dist/src/classifier/external-url-third-party.d.ts +26 -0
- package/dist/src/classifier/external-url-third-party.js +195 -0
- package/dist/src/classifier/grouping.d.ts +1 -0
- package/dist/src/classifier/grouping.js +2 -0
- package/dist/src/classifier/main-application-selection.d.ts +41 -0
- package/dist/src/classifier/main-application-selection.js +222 -0
- package/dist/src/classifier/naming.d.ts +4 -0
- package/dist/src/classifier/naming.js +78 -0
- package/dist/src/classifier/postprocessing.d.ts +12 -0
- package/dist/src/classifier/postprocessing.js +510 -0
- package/dist/src/classifier/sectioning.d.ts +5 -0
- package/dist/src/classifier/sectioning.js +60 -0
- package/dist/src/classifier/terraform-provider-hub.d.ts +6 -0
- package/dist/src/classifier/terraform-provider-hub.js +38 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +498 -0
- package/dist/src/config/actor-detection-config.d.ts +21 -0
- package/dist/src/config/actor-detection-config.js +97 -0
- package/dist/src/config/env.d.ts +2 -0
- package/dist/src/config/env.js +75 -0
- package/dist/src/config/file.d.ts +6 -0
- package/dist/src/config/file.js +74 -0
- package/dist/src/config/inference-scope.d.ts +2 -0
- package/dist/src/config/inference-scope.js +15 -0
- package/dist/src/config/load-cli-env.d.ts +1 -0
- package/dist/src/config/load-cli-env.js +54 -0
- package/dist/src/config/normalize-ai-provider.d.ts +5 -0
- package/dist/src/config/normalize-ai-provider.js +18 -0
- package/dist/src/config/property-detection-config.d.ts +27 -0
- package/dist/src/config/property-detection-config.js +355 -0
- package/dist/src/config/redact.d.ts +3 -0
- package/dist/src/config/redact.js +14 -0
- package/dist/src/config/resolve.d.ts +15 -0
- package/dist/src/config/resolve.js +361 -0
- package/dist/src/config/scan-env.d.ts +7 -0
- package/dist/src/config/scan-env.js +38 -0
- package/dist/src/config/third-party-detection-config.d.ts +25 -0
- package/dist/src/config/third-party-detection-config.js +97 -0
- package/dist/src/config/types.d.ts +106 -0
- package/dist/src/config/types.js +2 -0
- package/dist/src/config/validate-scan-ai.d.ts +3 -0
- package/dist/src/config/validate-scan-ai.js +33 -0
- package/dist/src/core/pipeline/ai-orchestrator-options.d.ts +6 -0
- package/dist/src/core/pipeline/ai-orchestrator-options.js +46 -0
- package/dist/src/core/pipeline/classifier-phase.d.ts +7 -0
- package/dist/src/core/pipeline/classifier-phase.js +78 -0
- package/dist/src/core/pipeline/dataflow-phase.d.ts +7 -0
- package/dist/src/core/pipeline/dataflow-phase.js +10 -0
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.d.ts +7 -0
- package/dist/src/core/pipeline/diagram-layout/app-section-layout.js +74 -0
- package/dist/src/core/pipeline/diagram-layout/constants.d.ts +11 -0
- package/dist/src/core/pipeline/diagram-layout/constants.js +14 -0
- package/dist/src/core/pipeline/diagram-layout/edge-handles.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/edge-handles.js +26 -0
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/managed-provider-layout.js +40 -0
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.d.ts +6 -0
- package/dist/src/core/pipeline/diagram-layout/minimal-terraform-layout.js +53 -0
- package/dist/src/core/pipeline/diagram-layout/section-helpers.d.ts +30 -0
- package/dist/src/core/pipeline/diagram-layout/section-helpers.js +62 -0
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.d.ts +3 -0
- package/dist/src/core/pipeline/diagram-layout/terraform-lane-layout.js +109 -0
- package/dist/src/core/pipeline/diagram-layout/types.d.ts +2 -0
- package/dist/src/core/pipeline/diagram-layout/types.js +2 -0
- package/dist/src/core/pipeline/graph-mapping.d.ts +6 -0
- package/dist/src/core/pipeline/graph-mapping.js +308 -0
- package/dist/src/core/pipeline/mixed-app-terraform-scan.d.ts +13 -0
- package/dist/src/core/pipeline/mixed-app-terraform-scan.js +81 -0
- package/dist/src/core/pipeline/orchestrator-result.d.ts +6 -0
- package/dist/src/core/pipeline/orchestrator-result.js +2 -0
- package/dist/src/core/pipeline/orchestrator.d.ts +26 -0
- package/dist/src/core/pipeline/orchestrator.js +79 -0
- package/dist/src/core/pipeline/resolve-path-under-scan-root.d.ts +7 -0
- package/dist/src/core/pipeline/resolve-path-under-scan-root.js +55 -0
- package/dist/src/core/pipeline/scan-pipeline.d.ts +6 -0
- package/dist/src/core/pipeline/scan-pipeline.js +364 -0
- package/dist/src/core/pipeline/sorting.d.ts +3 -0
- package/dist/src/core/pipeline/sorting.js +48 -0
- package/dist/src/core/pipeline/stable-component-ids.d.ts +15 -0
- package/dist/src/core/pipeline/stable-component-ids.js +68 -0
- package/dist/src/core/pipeline/structural-scan.d.ts +19 -0
- package/dist/src/core/pipeline/structural-scan.js +304 -0
- package/dist/src/core/pipeline/terraform-flow-utils.d.ts +6 -0
- package/dist/src/core/pipeline/terraform-flow-utils.js +32 -0
- package/dist/src/core/pipeline/terraform-minimal-services.d.ts +31 -0
- package/dist/src/core/pipeline/terraform-minimal-services.js +225 -0
- package/dist/src/core/schema/dataflow-wrapper.schema.d.ts +83 -0
- package/dist/src/core/schema/dataflow-wrapper.schema.js +40 -0
- package/dist/src/core/schema/diagram-graph.schema.d.ts +93 -0
- package/dist/src/core/schema/diagram-graph.schema.js +55 -0
- package/dist/src/core/schema/index.d.ts +4 -0
- package/dist/src/core/schema/index.js +20 -0
- package/dist/src/core/schema/scan-config.schema.d.ts +66 -0
- package/dist/src/core/schema/scan-config.schema.js +67 -0
- package/dist/src/core/schema/scan-result.schema.d.ts +450 -0
- package/dist/src/core/schema/scan-result.schema.js +236 -0
- package/dist/src/core/sectioning/discover-service-sections.d.ts +80 -0
- package/dist/src/core/sectioning/discover-service-sections.js +468 -0
- package/dist/src/core/sectioning/section-runtime.d.ts +21 -0
- package/dist/src/core/sectioning/section-runtime.js +148 -0
- package/dist/src/core/terraform/component-predicates.d.ts +13 -0
- package/dist/src/core/terraform/component-predicates.js +71 -0
- package/dist/src/core/types/component.d.ts +18 -0
- package/dist/src/core/types/component.js +2 -0
- package/dist/src/core/types/config.d.ts +57 -0
- package/dist/src/core/types/config.js +2 -0
- package/dist/src/core/types/data-flow.d.ts +24 -0
- package/dist/src/core/types/data-flow.js +2 -0
- package/dist/src/core/types/detection.d.ts +12 -0
- package/dist/src/core/types/detection.js +19 -0
- package/dist/src/core/types/file.d.ts +14 -0
- package/dist/src/core/types/file.js +2 -0
- package/dist/src/core/types/index.d.ts +7 -0
- package/dist/src/core/types/index.js +23 -0
- package/dist/src/core/types/progress.d.ts +9 -0
- package/dist/src/core/types/progress.js +2 -0
- package/dist/src/core/types/result.d.ts +140 -0
- package/dist/src/core/types/result.js +2 -0
- package/dist/src/data-flow/application-hub.d.ts +7 -0
- package/dist/src/data-flow/application-hub.js +88 -0
- package/dist/src/data-flow/dedupe.d.ts +7 -0
- package/dist/src/data-flow/dedupe.js +92 -0
- package/dist/src/data-flow/detect.d.ts +16 -0
- package/dist/src/data-flow/detect.js +203 -0
- package/dist/src/data-flow/detector.d.ts +15 -0
- package/dist/src/data-flow/detector.js +18 -0
- package/dist/src/data-flow/drop-cross-section-flows.d.ts +8 -0
- package/dist/src/data-flow/drop-cross-section-flows.js +32 -0
- package/dist/src/data-flow/ensure-actor-flow.d.ts +16 -0
- package/dist/src/data-flow/ensure-actor-flow.js +101 -0
- package/dist/src/data-flow/ensure-manifest-declared-flows.d.ts +14 -0
- package/dist/src/data-flow/ensure-manifest-declared-flows.js +76 -0
- package/dist/src/data-flow/ensure-section-api-flows.d.ts +6 -0
- package/dist/src/data-flow/ensure-section-api-flows.js +57 -0
- package/dist/src/data-flow/flow-builder.d.ts +5 -0
- package/dist/src/data-flow/flow-builder.js +80 -0
- package/dist/src/data-flow/import-graph.d.ts +10 -0
- package/dist/src/data-flow/import-graph.js +147 -0
- package/dist/src/data-flow/index.d.ts +8 -0
- package/dist/src/data-flow/index.js +20 -0
- package/dist/src/data-flow/internal-fetch.d.ts +8 -0
- package/dist/src/data-flow/internal-fetch.js +209 -0
- package/dist/src/data-flow/postprocess.d.ts +9 -0
- package/dist/src/data-flow/postprocess.js +63 -0
- package/dist/src/data-flow/rewire.d.ts +10 -0
- package/dist/src/data-flow/rewire.js +93 -0
- package/dist/src/data-flow/source-attribution.d.ts +8 -0
- package/dist/src/data-flow/source-attribution.js +131 -0
- package/dist/src/data-flow/source-resolution.d.ts +13 -0
- package/dist/src/data-flow/source-resolution.js +61 -0
- package/dist/src/data-flow/target-matching.d.ts +21 -0
- package/dist/src/data-flow/target-matching.js +253 -0
- package/dist/src/data-flow/terraform-flows.d.ts +32 -0
- package/dist/src/data-flow/terraform-flows.js +170 -0
- package/dist/src/evals/metrics.d.ts +18 -0
- package/dist/src/evals/metrics.js +58 -0
- package/dist/src/evals/run-model-matrix.d.ts +1 -0
- package/dist/src/evals/run-model-matrix.js +68 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +20 -0
- package/dist/src/ingest/file-system.d.ts +17 -0
- package/dist/src/ingest/file-system.js +239 -0
- package/dist/src/ingest/gitignore.d.ts +12 -0
- package/dist/src/ingest/gitignore.js +127 -0
- package/dist/src/ingest/sensitive-paths.d.ts +2 -0
- package/dist/src/ingest/sensitive-paths.js +8 -0
- package/dist/src/observability/scan-sentry.d.ts +20 -0
- package/dist/src/observability/scan-sentry.js +133 -0
- package/dist/src/output/json.d.ts +51 -0
- package/dist/src/output/json.js +59 -0
- package/dist/src/patterns/config.d.ts +22 -0
- package/dist/src/patterns/config.js +119 -0
- package/dist/src/patterns/detectors/helpers.d.ts +19 -0
- package/dist/src/patterns/detectors/helpers.js +68 -0
- package/dist/src/patterns/detectors/python.d.ts +8 -0
- package/dist/src/patterns/detectors/python.js +412 -0
- package/dist/src/patterns/detectors/typescript.d.ts +8 -0
- package/dist/src/patterns/detectors/typescript.js +328 -0
- package/dist/src/patterns/engine.d.ts +40 -0
- package/dist/src/patterns/engine.js +111 -0
- package/dist/src/patterns/flow-source-patterns.d.ts +6 -0
- package/dist/src/patterns/flow-source-patterns.js +39 -0
- package/dist/src/patterns/frontend-frameworks.d.ts +4 -0
- package/dist/src/patterns/frontend-frameworks.js +25 -0
- package/dist/src/patterns/scan-exclusions.d.ts +14 -0
- package/dist/src/patterns/scan-exclusions.js +76 -0
- package/dist/src/platform-api/dataparade-api-base-url.d.ts +8 -0
- package/dist/src/platform-api/dataparade-api-base-url.js +17 -0
- package/dist/src/platform-api/estimate-scan-footprint.d.ts +8 -0
- package/dist/src/platform-api/estimate-scan-footprint.js +120 -0
- package/dist/src/platform-api/scan-quota-client.d.ts +28 -0
- package/dist/src/platform-api/scan-quota-client.js +79 -0
- package/dist/src/tracing/langsmith-tracing.d.ts +37 -0
- package/dist/src/tracing/langsmith-tracing.js +171 -0
- package/dist/tests/cli/cli.spec.d.ts +1 -0
- package/dist/tests/cli/cli.spec.js +87 -0
- package/dist/tests/fixtures/e2e-ts-sample/db-client-import.d.ts +2 -0
- package/dist/tests/fixtures/e2e-ts-sample/db-client-import.js +8 -0
- package/dist/tests/fixtures/e2e-ts-sample/db.d.ts +3 -0
- package/dist/tests/fixtures/e2e-ts-sample/db.js +7 -0
- package/dist/tests/fixtures/e2e-ts-sample/external-api.d.ts +1 -0
- package/dist/tests/fixtures/e2e-ts-sample/external-api.js +18 -0
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.d.ts +3 -0
- package/dist/tests/fixtures/e2e-ts-sample/pg-client.js +7 -0
- package/dist/tests/fixtures/e2e-ts-sample/server.d.ts +14 -0
- package/dist/tests/fixtures/e2e-ts-sample/server.js +4 -0
- package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.d.ts +1 -0
- package/dist/tests/fixtures/e2e-ts-sentry-route-env/server.js +24 -0
- package/dist/tests/fixtures/ingest-basic/src/index.d.ts +1 -0
- package/dist/tests/fixtures/ingest-basic/src/index.js +6 -0
- package/dist/tests/fixtures/mixed-language-basic/api.d.ts +2 -0
- package/dist/tests/fixtures/mixed-language-basic/api.js +12 -0
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-app-plus-terraform/packages/app/app/route.js +6 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/backend/app/route.js +6 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.d.ts +1 -0
- package/dist/tests/fixtures/monorepo-front-back-sections/frontend/app/route.js +7 -0
- package/dist/tests/fixtures/typescript-basic/app/route.d.ts +1 -0
- package/dist/tests/fixtures/typescript-basic/app/route.js +7 -0
- package/dist/tests/fixtures/typescript-basic/db-client-import.d.ts +2 -0
- package/dist/tests/fixtures/typescript-basic/db-client-import.js +8 -0
- package/dist/tests/fixtures/typescript-basic/db.d.ts +3 -0
- package/dist/tests/fixtures/typescript-basic/db.js +7 -0
- package/dist/tests/fixtures/typescript-basic/external-api.d.ts +1 -0
- package/dist/tests/fixtures/typescript-basic/external-api.js +18 -0
- package/dist/tests/fixtures/typescript-basic/pg-client.d.ts +3 -0
- package/dist/tests/fixtures/typescript-basic/pg-client.js +7 -0
- package/dist/tests/fixtures/typescript-basic/server.d.ts +14 -0
- package/dist/tests/fixtures/typescript-basic/server.js +4 -0
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.d.ts +0 -0
- package/dist/tests/fixtures/typescript-dependency-manifests-basic/src/index.js +2 -0
- package/dist/tests/helpers/scan-result-builders.d.ts +2 -0
- package/dist/tests/helpers/scan-result-builders.js +15 -0
- package/dist/tests/schema/dataflow-wrapper.schema.spec.d.ts +1 -0
- package/dist/tests/schema/dataflow-wrapper.schema.spec.js +89 -0
- package/dist/tests/schema/diagram-graph.schema.spec.d.ts +1 -0
- package/dist/tests/schema/diagram-graph.schema.spec.js +48 -0
- package/dist/tests/schema/scan-config.schema.spec.d.ts +1 -0
- package/dist/tests/schema/scan-config.schema.spec.js +135 -0
- package/dist/tests/schema/scan-result.schema.spec.d.ts +1 -0
- package/dist/tests/schema/scan-result.schema.spec.js +177 -0
- package/dist/tests/unit/ai-enrichment/agent-orchestrator.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/agent-orchestrator.spec.js +483 -0
- package/dist/tests/unit/ai-enrichment/candidate-selector.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/candidate-selector.spec.js +106 -0
- package/dist/tests/unit/ai-enrichment/create-ai-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/create-ai-provider.spec.js +32 -0
- package/dist/tests/unit/ai-enrichment/endpoint-resolution.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/endpoint-resolution.spec.js +47 -0
- package/dist/tests/unit/ai-enrichment/fallbacks.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/fallbacks.spec.js +1304 -0
- package/dist/tests/unit/ai-enrichment/families/chat-completions-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/chat-completions-family.spec.js +219 -0
- package/dist/tests/unit/ai-enrichment/families/generate-content-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/generate-content-family.spec.js +119 -0
- package/dist/tests/unit/ai-enrichment/families/messages-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/messages-family.spec.js +129 -0
- package/dist/tests/unit/ai-enrichment/families/ollama-generate-family.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/families/ollama-generate-family.spec.js +69 -0
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/merge-rules.spec.js +422 -0
- package/dist/tests/unit/ai-enrichment/openai-proposals-response.schema.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/openai-proposals-response.schema.spec.js +30 -0
- package/dist/tests/unit/ai-enrichment/pipeline.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/pipeline.spec.js +120 -0
- package/dist/tests/unit/ai-enrichment/planner.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/planner.spec.js +106 -0
- package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.js +51 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-contract.spec.js +244 -0
- package/dist/tests/unit/ai-enrichment/provider-json-parse.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-json-parse.spec.js +24 -0
- package/dist/tests/unit/ai-enrichment/provider-output-token-budget.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-output-token-budget.spec.js +15 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt-env.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt-env.spec.js +54 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-prompt.spec.js +206 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-aws.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-aws.spec.js +43 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-kubernetes.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/provider-topology-terraform-kubernetes.spec.js +40 -0
- package/dist/tests/unit/ai-enrichment/providers/fetch-with-timeout.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/providers/fetch-with-timeout.spec.js +22 -0
- package/dist/tests/unit/ai-enrichment/resolve-provider.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/resolve-provider.spec.js +67 -0
- package/dist/tests/unit/ai-enrichment/scan-paths-exact.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/scan-paths-exact.spec.js +35 -0
- package/dist/tests/unit/ai-enrichment/scan-paths.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/scan-paths.spec.js +21 -0
- package/dist/tests/unit/ai-enrichment/sensitive-paths.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/sensitive-paths.spec.js +20 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-data-flow.spec.js +963 -0
- package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-evidence.spec.js +117 -0
- package/dist/tests/unit/ai-enrichment/third-party-subtype.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/third-party-subtype.spec.js +45 -0
- package/dist/tests/unit/ai-enrichment/tools-validation.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/tools-validation.spec.js +66 -0
- package/dist/tests/unit/analyzers/python/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/python/parser.spec.js +104 -0
- package/dist/tests/unit/analyzers/python/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/python/patterns.spec.js +289 -0
- package/dist/tests/unit/analyzers/registry.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/registry.spec.js +234 -0
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/classifier-subtype-parity.spec.js +87 -0
- package/dist/tests/unit/analyzers/terraform/detector.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/detector.spec.js +110 -0
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/generated-provider-hints.spec.js +53 -0
- package/dist/tests/unit/analyzers/terraform/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/parser.spec.js +56 -0
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/terraform-module-manifest.spec.js +63 -0
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform/terraform-utility-resource.spec.js +19 -0
- package/dist/tests/unit/analyzers/terraform-exec.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform-exec.spec.js +27 -0
- package/dist/tests/unit/analyzers/terraform-show-json.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/terraform-show-json.spec.js +77 -0
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/dependency-manifests.spec.js +61 -0
- package/dist/tests/unit/analyzers/typescript/detector.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/detector.spec.js +225 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-auth0.spec.js +49 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/external-apis-sentry.spec.js +27 -0
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/fixture-integration.spec.js +64 -0
- package/dist/tests/unit/analyzers/typescript/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/parser.spec.js +99 -0
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/pattern-config.spec.js +24 -0
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/typescript/property-detection.spec.js +138 -0
- package/dist/tests/unit/classifier/classify.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/classify.spec.js +1453 -0
- package/dist/tests/unit/classifier/enhance.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/enhance.spec.js +400 -0
- package/dist/tests/unit/classifier/external-url-third-party.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/external-url-third-party.spec.js +83 -0
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/frontend-framework-grouping.spec.js +44 -0
- package/dist/tests/unit/classifier/terraform-grouping.spec.d.ts +1 -0
- package/dist/tests/unit/classifier/terraform-grouping.spec.js +96 -0
- package/dist/tests/unit/cli/config-command.spec.d.ts +1 -0
- package/dist/tests/unit/cli/config-command.spec.js +51 -0
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.d.ts +0 -0
- package/dist/tests/unit/cli/scan-command-ai-flags.spec.js +149 -0
- package/dist/tests/unit/cli/scan-command-diagram-graph.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-diagram-graph.spec.js +26 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-app-plus-terraform.spec.js +107 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-front-back-sections.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-monorepo-front-back-sections.spec.js +74 -0
- package/dist/tests/unit/cli/scan-command-e2e-python-basic.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-python-basic.spec.js +43 -0
- package/dist/tests/unit/cli/scan-command-e2e-terraform-basic.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-terraform-basic.spec.js +62 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sample.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sample.spec.js +41 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-e2e-ts-sentry-route-env.spec.js +85 -0
- package/dist/tests/unit/cli/scan-command-exit-code.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-command-exit-code.spec.js +131 -0
- package/dist/tests/unit/cli/scan-quota-flow.spec.d.ts +1 -0
- package/dist/tests/unit/cli/scan-quota-flow.spec.js +76 -0
- package/dist/tests/unit/config/property-detection-config.spec.d.ts +1 -0
- package/dist/tests/unit/config/property-detection-config.spec.js +38 -0
- package/dist/tests/unit/config/redact.spec.d.ts +1 -0
- package/dist/tests/unit/config/redact.spec.js +19 -0
- package/dist/tests/unit/config/resolve-config.spec.d.ts +1 -0
- package/dist/tests/unit/config/resolve-config.spec.js +172 -0
- package/dist/tests/unit/config/scan-env-debug.spec.d.ts +1 -0
- package/dist/tests/unit/config/scan-env-debug.spec.js +17 -0
- package/dist/tests/unit/config/validate-scan-ai.spec.d.ts +1 -0
- package/dist/tests/unit/config/validate-scan-ai.spec.js +53 -0
- package/dist/tests/unit/core/classifier-phase-regressions.spec.d.ts +1 -0
- package/dist/tests/unit/core/classifier-phase-regressions.spec.js +68 -0
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.d.ts +1 -0
- package/dist/tests/unit/core/dependency-manifest-performance-budgets.spec.js +66 -0
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.d.ts +1 -0
- package/dist/tests/unit/core/dependency-manifest-toggles-confidence.spec.js +132 -0
- package/dist/tests/unit/core/discover-service-sections.spec.d.ts +1 -0
- package/dist/tests/unit/core/discover-service-sections.spec.js +204 -0
- package/dist/tests/unit/core/graph-mapping.spec.d.ts +1 -0
- package/dist/tests/unit/core/graph-mapping.spec.js +779 -0
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.d.ts +1 -0
- package/dist/tests/unit/core/invariant-tests-dedupe-determinism.spec.js +64 -0
- package/dist/tests/unit/core/manifest-package-hub.spec.d.ts +1 -0
- package/dist/tests/unit/core/manifest-package-hub.spec.js +53 -0
- package/dist/tests/unit/core/monorepo-package-sections.spec.d.ts +1 -0
- package/dist/tests/unit/core/monorepo-package-sections.spec.js +121 -0
- package/dist/tests/unit/core/no-source-code-leakage.spec.d.ts +1 -0
- package/dist/tests/unit/core/no-source-code-leakage.spec.js +48 -0
- package/dist/tests/unit/core/orchestrator.spec.d.ts +1 -0
- package/dist/tests/unit/core/orchestrator.spec.js +252 -0
- package/dist/tests/unit/core/output-json.spec.d.ts +1 -0
- package/dist/tests/unit/core/output-json.spec.js +65 -0
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.d.ts +1 -0
- package/dist/tests/unit/core/parsing-error-handling-nonfatal.spec.js +42 -0
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.d.ts +1 -0
- package/dist/tests/unit/core/resolve-path-under-scan-root.spec.js +54 -0
- package/dist/tests/unit/core/scan-result-language-stats.spec.d.ts +1 -0
- package/dist/tests/unit/core/scan-result-language-stats.spec.js +15 -0
- package/dist/tests/unit/core/section-discovery-excludes.spec.d.ts +1 -0
- package/dist/tests/unit/core/section-discovery-excludes.spec.js +49 -0
- package/dist/tests/unit/core/section-runtime.spec.d.ts +1 -0
- package/dist/tests/unit/core/section-runtime.spec.js +166 -0
- package/dist/tests/unit/core/stable-component-ids.spec.d.ts +1 -0
- package/dist/tests/unit/core/stable-component-ids.spec.js +112 -0
- package/dist/tests/unit/core/structural-scan.spec.d.ts +1 -0
- package/dist/tests/unit/core/structural-scan.spec.js +83 -0
- package/dist/tests/unit/core/terraform-json-overlay.spec.d.ts +1 -0
- package/dist/tests/unit/core/terraform-json-overlay.spec.js +36 -0
- package/dist/tests/unit/core/terraform-minimal-services.spec.d.ts +1 -0
- package/dist/tests/unit/core/terraform-minimal-services.spec.js +378 -0
- package/dist/tests/unit/data-flow/application-hub.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/application-hub.spec.js +48 -0
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/cross-section-terraform-bridge.spec.js +95 -0
- package/dist/tests/unit/data-flow/dedupe.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/dedupe.spec.js +134 -0
- package/dist/tests/unit/data-flow/detector.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/detector.spec.js +1254 -0
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/drop-cross-section-flows.spec.js +132 -0
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-actor-flow.spec.js +233 -0
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-manifest-declared-flows.spec.js +125 -0
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/ensure-section-api-flows.spec.js +40 -0
- package/dist/tests/unit/data-flow/postprocess.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/postprocess.spec.js +78 -0
- package/dist/tests/unit/data-flow/rewire.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/rewire.spec.js +194 -0
- package/dist/tests/unit/data-flow/terraform-flows.spec.d.ts +1 -0
- package/dist/tests/unit/data-flow/terraform-flows.spec.js +199 -0
- package/dist/tests/unit/evals/metrics.spec.d.ts +1 -0
- package/dist/tests/unit/evals/metrics.spec.js +54 -0
- package/dist/tests/unit/ingest/env-exclusion.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/env-exclusion.spec.js +43 -0
- package/dist/tests/unit/ingest/file-system.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/file-system.spec.js +180 -0
- package/dist/tests/unit/ingest/gitignore.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/gitignore.spec.js +30 -0
- package/dist/tests/unit/observability/scan-sentry.spec.d.ts +1 -0
- package/dist/tests/unit/observability/scan-sentry.spec.js +60 -0
- package/dist/tests/unit/patterns/scan-exclusions.spec.d.ts +1 -0
- package/dist/tests/unit/patterns/scan-exclusions.spec.js +58 -0
- package/dist/tests/unit/pipeline/ai-orchestrator-options.spec.d.ts +1 -0
- package/dist/tests/unit/pipeline/ai-orchestrator-options.spec.js +19 -0
- package/dist/tests/unit/platform-api/dataparade-api-base-url.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/dataparade-api-base-url.spec.js +19 -0
- package/dist/tests/unit/platform-api/estimate-scan-footprint.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/estimate-scan-footprint.spec.js +50 -0
- package/dist/tests/unit/tracing/langsmith-tracing.spec.d.ts +1 -0
- package/dist/tests/unit/tracing/langsmith-tracing.spec.js +118 -0
- package/package.json +84 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAiInferenceCredentials = validateAiInferenceCredentials;
|
|
4
|
+
exports.resolveAiMode = resolveAiMode;
|
|
5
|
+
function validateAiInferenceCredentials(config) {
|
|
6
|
+
const errors = [];
|
|
7
|
+
if (!config.enableAiInference)
|
|
8
|
+
return errors;
|
|
9
|
+
const hasByok = Boolean(config.aiProvider?.trim()) &&
|
|
10
|
+
Boolean(config.aiModel?.trim()) &&
|
|
11
|
+
Boolean(config.aiApiKey?.trim());
|
|
12
|
+
const hasWorkspace = Boolean(config.workspaceApiKey?.trim());
|
|
13
|
+
if (hasByok && hasWorkspace) {
|
|
14
|
+
errors.push("ai-inference: set either SCAN_BYOK_* (your LLM provider) or DATAPARADE_WORKSPACE_API_KEY (platform AI), not both");
|
|
15
|
+
return errors;
|
|
16
|
+
}
|
|
17
|
+
if (!hasByok && !hasWorkspace) {
|
|
18
|
+
errors.push("ai-inference: LLM inference requires SCAN_BYOK_PROVIDER, SCAN_BYOK_MODEL, and SCAN_BYOK_API_KEY, or DATAPARADE_WORKSPACE_API_KEY for platform AI");
|
|
19
|
+
}
|
|
20
|
+
if (hasWorkspace && !config.cliQuotaJobId) {
|
|
21
|
+
errors.push("ai-inference: platform AI requires a quota preflight job id (pass DATAPARADE_WORKSPACE_API_KEY and ensure preflight succeeded)");
|
|
22
|
+
}
|
|
23
|
+
return errors;
|
|
24
|
+
}
|
|
25
|
+
function resolveAiMode(config) {
|
|
26
|
+
if (!config.enableAiInference)
|
|
27
|
+
return "none";
|
|
28
|
+
if (config.aiApiKey?.trim())
|
|
29
|
+
return "byok";
|
|
30
|
+
if (config.workspaceApiKey?.trim())
|
|
31
|
+
return "platform";
|
|
32
|
+
return "none";
|
|
33
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ScanConfiguration } from "../types";
|
|
2
|
+
import type { AgentOrchestratorOptions } from "../../ai-enrichment/agent-orchestrator";
|
|
3
|
+
export declare function buildAgentOrchestratorOptions(config: ScanConfiguration, opts: {
|
|
4
|
+
llmEnabled: boolean;
|
|
5
|
+
skipStructuralHeuristics: boolean;
|
|
6
|
+
}): AgentOrchestratorOptions;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAgentOrchestratorOptions = buildAgentOrchestratorOptions;
|
|
4
|
+
const validate_scan_ai_1 = require("../../config/validate-scan-ai");
|
|
5
|
+
const dataparade_api_base_url_1 = require("../../platform-api/dataparade-api-base-url");
|
|
6
|
+
function buildAgentOrchestratorOptions(config, opts) {
|
|
7
|
+
const aiMode = (0, validate_scan_ai_1.resolveAiMode)(config);
|
|
8
|
+
const platformProvider = process.env.SCAN_WORKER_LLM_PROVIDER?.trim() ||
|
|
9
|
+
"openai";
|
|
10
|
+
const platformModel = process.env.SCAN_WORKER_LLM_MODEL?.trim() ||
|
|
11
|
+
config.aiModel?.trim() ||
|
|
12
|
+
"gpt-4o-mini";
|
|
13
|
+
const base = {
|
|
14
|
+
provider: aiMode === "platform"
|
|
15
|
+
? platformProvider
|
|
16
|
+
: (config.aiProvider ?? "openai"),
|
|
17
|
+
model: aiMode === "platform"
|
|
18
|
+
? platformModel
|
|
19
|
+
: (config.aiModel ?? "gpt-4o-mini"),
|
|
20
|
+
endpoint: config.aiEndpoint,
|
|
21
|
+
apiKey: config.aiApiKey,
|
|
22
|
+
maxTokens: config.aiMaxTokens,
|
|
23
|
+
temperature: config.aiTemperature,
|
|
24
|
+
providerConcurrency: config.aiProviderConcurrency,
|
|
25
|
+
toolLoopMaxRounds: config.aiToolLoopMaxRounds,
|
|
26
|
+
toolLoopMaxFiles: config.aiToolLoopMaxFiles,
|
|
27
|
+
toolLoopMaxSearches: config.aiToolLoopMaxSearches,
|
|
28
|
+
llmEnabled: opts.llmEnabled,
|
|
29
|
+
skipStructuralHeuristics: opts.skipStructuralHeuristics,
|
|
30
|
+
};
|
|
31
|
+
if (aiMode === "platform" &&
|
|
32
|
+
config.workspaceApiKey?.trim() &&
|
|
33
|
+
config.cliQuotaJobId?.trim()) {
|
|
34
|
+
base.platformProxy = {
|
|
35
|
+
apiBaseUrl: config.platformApiBaseUrl ?? (0, dataparade_api_base_url_1.getDataparadeApiBaseUrl)(),
|
|
36
|
+
workspaceApiKey: config.workspaceApiKey.trim(),
|
|
37
|
+
jobId: config.cliQuotaJobId.trim(),
|
|
38
|
+
};
|
|
39
|
+
base.apiKey = undefined;
|
|
40
|
+
// HTTP API → Lambda integration timeout is 30s. Parallel infer calls each spin up
|
|
41
|
+
// a VPC cold start (~8–10s) plus helper latency and can exceed that limit even when
|
|
42
|
+
// the helper succeeds (client sees 503 "Service Unavailable").
|
|
43
|
+
base.providerConcurrency = 1;
|
|
44
|
+
}
|
|
45
|
+
return base;
|
|
46
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DetectedComponent, RawFinding } from "../types";
|
|
2
|
+
import type { ServiceSection } from "../sectioning/discover-service-sections";
|
|
3
|
+
export interface ClassifierPhaseOptions {
|
|
4
|
+
projectName: string;
|
|
5
|
+
minimumConfidence: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function runClassifierPhase(findings: RawFinding[], sections: ServiceSection[], options: ClassifierPhaseOptions): DetectedComponent[];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runClassifierPhase = runClassifierPhase;
|
|
4
|
+
const classify_1 = require("../../classifier/classify");
|
|
5
|
+
const enhance_1 = require("../../classifier/enhance");
|
|
6
|
+
const frontend_frameworks_1 = require("../../patterns/frontend-frameworks");
|
|
7
|
+
function frameworkValues(value) {
|
|
8
|
+
if (typeof value === "string" && value.trim())
|
|
9
|
+
return [value.trim()];
|
|
10
|
+
if (Array.isArray(value)) {
|
|
11
|
+
return value.filter((v) => typeof v === "string" && v.trim().length > 0);
|
|
12
|
+
}
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
function mergeUniqueStringValues(current, incoming) {
|
|
16
|
+
const existing = frameworkValues(current);
|
|
17
|
+
const merged = Array.from(new Set([...existing, ...incoming]));
|
|
18
|
+
if (merged.length === 0)
|
|
19
|
+
return current;
|
|
20
|
+
return merged;
|
|
21
|
+
}
|
|
22
|
+
function collapseManifestFrontendFrameworkAssets(components) {
|
|
23
|
+
if (components.length === 0)
|
|
24
|
+
return components;
|
|
25
|
+
const mainBySection = new Map();
|
|
26
|
+
for (const component of components) {
|
|
27
|
+
if (component.type !== "asset")
|
|
28
|
+
continue;
|
|
29
|
+
if (component.properties?.isMainApplication === true ||
|
|
30
|
+
component.properties?.isMainApplication === "true") {
|
|
31
|
+
const sectionId = typeof component.properties?.section_id === "string"
|
|
32
|
+
? component.properties.section_id
|
|
33
|
+
: "";
|
|
34
|
+
if (sectionId)
|
|
35
|
+
mainBySection.set(sectionId, component);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const removeIds = new Set();
|
|
39
|
+
const updatesById = new Map();
|
|
40
|
+
for (const component of components) {
|
|
41
|
+
if (component.type !== "asset" || component.subType !== "api")
|
|
42
|
+
continue;
|
|
43
|
+
if (component.properties?.sourceContext !== "dependency_manifest")
|
|
44
|
+
continue;
|
|
45
|
+
const sectionId = typeof component.properties?.section_id === "string"
|
|
46
|
+
? component.properties.section_id
|
|
47
|
+
: "";
|
|
48
|
+
if (!sectionId)
|
|
49
|
+
continue;
|
|
50
|
+
const main = mainBySection.get(sectionId);
|
|
51
|
+
if (!main || main.id === component.id)
|
|
52
|
+
continue;
|
|
53
|
+
const frameworks = frameworkValues(component.properties?.framework).filter((fw) => frontend_frameworks_1.FRONTEND_FRAMEWORK_HINTS_SET.has(fw.toLowerCase()));
|
|
54
|
+
if (frameworks.length === 0)
|
|
55
|
+
continue;
|
|
56
|
+
const currentMain = updatesById.get(main.id) ?? main;
|
|
57
|
+
const nextProps = { ...currentMain.properties };
|
|
58
|
+
nextProps.framework = mergeUniqueStringValues(nextProps.framework, frameworks);
|
|
59
|
+
nextProps.technology_stack = mergeUniqueStringValues(nextProps.technology_stack, frameworks);
|
|
60
|
+
updatesById.set(main.id, { ...currentMain, properties: nextProps });
|
|
61
|
+
removeIds.add(component.id);
|
|
62
|
+
}
|
|
63
|
+
return components
|
|
64
|
+
.filter((component) => !removeIds.has(component.id))
|
|
65
|
+
.map((component) => updatesById.get(component.id) ?? component);
|
|
66
|
+
}
|
|
67
|
+
function runClassifierPhase(findings, sections, options) {
|
|
68
|
+
const classified = (0, classify_1.classifyRawFindings)(findings);
|
|
69
|
+
const dedupedComponents = (0, classify_1.dedupeComponents)(classified);
|
|
70
|
+
const compactedAuthComponents = (0, classify_1.compactAuthServiceComponents)(dedupedComponents);
|
|
71
|
+
const mergedDbComponents = (0, classify_1.mergeDatabaseAssetsByType)(compactedAuthComponents);
|
|
72
|
+
const withPerSectionApplication = (0, classify_1.injectApplicationAssetsPerSectionIfMissing)(mergedDbComponents, sections, { projectName: options.projectName });
|
|
73
|
+
const withApplication = (0, classify_1.injectApplicationAssetIfMissing)(withPerSectionApplication, { projectName: options.projectName });
|
|
74
|
+
const enhanced = (0, enhance_1.enhanceComponents)(withApplication);
|
|
75
|
+
const mergedFrameworkHelpers = collapseManifestFrontendFrameworkAssets(enhanced);
|
|
76
|
+
const withSectionApiNodes = (0, classify_1.synthesizeSectionApiNodes)(mergedFrameworkHelpers);
|
|
77
|
+
return (0, classify_1.injectActorIfMissing)(withSectionApiNodes).filter((component) => component.confidence >= options.minimumConfidence);
|
|
78
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DetectedComponent, DetectedDataFlow, FileInfo, RawFinding } from "../types";
|
|
2
|
+
import type { ServiceSection } from "../sectioning/discover-service-sections";
|
|
3
|
+
export interface DataFlowPhaseOptions {
|
|
4
|
+
enableDataFlowDetection: boolean;
|
|
5
|
+
minimumConfidence: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function runDataFlowPhase(files: FileInfo[], components: DetectedComponent[], findings: RawFinding[], sections: ServiceSection[], options: DataFlowPhaseOptions): DetectedDataFlow[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runDataFlowPhase = runDataFlowPhase;
|
|
4
|
+
const data_flow_1 = require("../../data-flow");
|
|
5
|
+
function runDataFlowPhase(files, components, findings, sections, options) {
|
|
6
|
+
if (!options.enableDataFlowDetection)
|
|
7
|
+
return [];
|
|
8
|
+
const flows = (0, data_flow_1.detectDataFlows)(files, components, findings, sections);
|
|
9
|
+
return flows.filter((flow) => flow.confidence >= options.minimumConfidence);
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DiagramNodeSchema } from "../../schema";
|
|
2
|
+
import type { ComponentByIdMap } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Monorepo app sections: actor → main app → section API → integrations;
|
|
5
|
+
* managed sub-services are positioned beside their provider hub afterward.
|
|
6
|
+
*/
|
|
7
|
+
export declare function applyAppSectionStackLayout(nodes: DiagramNodeSchema[], componentsById: ComponentByIdMap, sectionIds: string[]): void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyAppSectionStackLayout = applyAppSectionStackLayout;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
const section_helpers_1 = require("./section-helpers");
|
|
6
|
+
/**
|
|
7
|
+
* Monorepo app sections: actor → main app → section API → integrations;
|
|
8
|
+
* managed sub-services are positioned beside their provider hub afterward.
|
|
9
|
+
*/
|
|
10
|
+
function applyAppSectionStackLayout(nodes, componentsById, sectionIds) {
|
|
11
|
+
const allComponents = [...componentsById.values()];
|
|
12
|
+
for (const sectionId of sectionIds) {
|
|
13
|
+
const sectionIndex = sectionIds.indexOf(sectionId);
|
|
14
|
+
const baseX = Math.max(0, sectionIndex) * constants_1.SECTION_BLOCK_WIDTH;
|
|
15
|
+
const sectionComponents = allComponents.filter((c) => (0, section_helpers_1.getSectionIdFromComponent)(c) === sectionId);
|
|
16
|
+
if ((0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(sectionComponents))
|
|
17
|
+
continue;
|
|
18
|
+
const sectionNodes = (0, section_helpers_1.filterSectionNodes)(nodes, componentsById, sectionId);
|
|
19
|
+
if (sectionNodes.length === 0)
|
|
20
|
+
continue;
|
|
21
|
+
const actors = [];
|
|
22
|
+
const mains = [];
|
|
23
|
+
const sectionApis = [];
|
|
24
|
+
const integrations = [];
|
|
25
|
+
const otherAssets = [];
|
|
26
|
+
for (const node of sectionNodes) {
|
|
27
|
+
const c = componentsById.get(node.id);
|
|
28
|
+
if (!c)
|
|
29
|
+
continue;
|
|
30
|
+
if (c.type === "actor")
|
|
31
|
+
actors.push(node);
|
|
32
|
+
else if (c.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(c)) {
|
|
33
|
+
mains.push(node);
|
|
34
|
+
}
|
|
35
|
+
else if ((0, section_helpers_1.isSectionApiNodeComponent)(c)) {
|
|
36
|
+
sectionApis.push(node);
|
|
37
|
+
}
|
|
38
|
+
else if ((0, section_helpers_1.isManagedSubserviceComponent)(c))
|
|
39
|
+
continue;
|
|
40
|
+
else if (c.type === "third_party")
|
|
41
|
+
integrations.push(node);
|
|
42
|
+
else
|
|
43
|
+
otherAssets.push(node);
|
|
44
|
+
}
|
|
45
|
+
actors.sort(section_helpers_1.sortNodesByLabel);
|
|
46
|
+
mains.sort(section_helpers_1.sortNodesByLabel);
|
|
47
|
+
sectionApis.sort(section_helpers_1.sortNodesByLabel);
|
|
48
|
+
integrations.sort(section_helpers_1.sortNodesByLabel);
|
|
49
|
+
otherAssets.sort(section_helpers_1.sortNodesByLabel);
|
|
50
|
+
const integrationColumnX = baseX + 3 * constants_1.TERRAFORM_LANE_X_STEP;
|
|
51
|
+
actors.forEach((node, i) => {
|
|
52
|
+
node.position = { x: baseX, y: i * constants_1.NODE_VERTICAL_SPACING };
|
|
53
|
+
});
|
|
54
|
+
mains.forEach((node, i) => {
|
|
55
|
+
node.position = {
|
|
56
|
+
x: baseX + constants_1.TERRAFORM_LANE_X_STEP,
|
|
57
|
+
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
sectionApis.forEach((node, i) => {
|
|
61
|
+
node.position = {
|
|
62
|
+
x: baseX + 2 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
63
|
+
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
const integrationStack = [...integrations, ...otherAssets];
|
|
67
|
+
integrationStack.forEach((node, i) => {
|
|
68
|
+
node.position = {
|
|
69
|
+
x: integrationColumnX,
|
|
70
|
+
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const NODE_HORIZONTAL_SPACING = 350;
|
|
2
|
+
export declare const NODE_VERTICAL_SPACING = 200;
|
|
3
|
+
export declare const NODES_PER_ROW = 4;
|
|
4
|
+
export declare const MANAGED_NODE_X_OFFSET = 320;
|
|
5
|
+
export declare const MANAGED_NODE_Y_BASE_OFFSET = 40;
|
|
6
|
+
/** Match {@link NODE_VERTICAL_SPACING} so managed service cards do not overlap. */
|
|
7
|
+
export declare const MANAGED_NODE_Y_STEP = 200;
|
|
8
|
+
/** Horizontal step between Terraform layout lanes (single-section TF scans). */
|
|
9
|
+
export declare const TERRAFORM_LANE_X_STEP = 400;
|
|
10
|
+
/** Horizontal space per section (TF lanes + optional managed column beside provider). */
|
|
11
|
+
export declare const SECTION_BLOCK_WIDTH: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SECTION_BLOCK_WIDTH = exports.TERRAFORM_LANE_X_STEP = exports.MANAGED_NODE_Y_STEP = exports.MANAGED_NODE_Y_BASE_OFFSET = exports.MANAGED_NODE_X_OFFSET = exports.NODES_PER_ROW = exports.NODE_VERTICAL_SPACING = exports.NODE_HORIZONTAL_SPACING = void 0;
|
|
4
|
+
exports.NODE_HORIZONTAL_SPACING = 350;
|
|
5
|
+
exports.NODE_VERTICAL_SPACING = 200;
|
|
6
|
+
exports.NODES_PER_ROW = 4;
|
|
7
|
+
exports.MANAGED_NODE_X_OFFSET = 320;
|
|
8
|
+
exports.MANAGED_NODE_Y_BASE_OFFSET = 40;
|
|
9
|
+
/** Match {@link NODE_VERTICAL_SPACING} so managed service cards do not overlap. */
|
|
10
|
+
exports.MANAGED_NODE_Y_STEP = exports.NODE_VERTICAL_SPACING;
|
|
11
|
+
/** Horizontal step between Terraform layout lanes (single-section TF scans). */
|
|
12
|
+
exports.TERRAFORM_LANE_X_STEP = 400;
|
|
13
|
+
/** Horizontal space per section (TF lanes + optional managed column beside provider). */
|
|
14
|
+
exports.SECTION_BLOCK_WIDTH = Math.max(exports.NODES_PER_ROW * exports.NODE_HORIZONTAL_SPACING, 5 * exports.TERRAFORM_LANE_X_STEP + exports.MANAGED_NODE_X_OFFSET + 120);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DetectedComponent } from "../../types";
|
|
2
|
+
import type { DiagramEdgeSchema } from "../../schema";
|
|
3
|
+
export declare function applyDirectionalEdgeHandles(edge: DiagramEdgeSchema, sourceComponent: DetectedComponent | undefined, targetComponent: DetectedComponent | undefined): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyDirectionalEdgeHandles = applyDirectionalEdgeHandles;
|
|
4
|
+
const main_application_selection_1 = require("../../../classifier/main-application-selection");
|
|
5
|
+
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
6
|
+
const section_helpers_1 = require("./section-helpers");
|
|
7
|
+
function applyDirectionalEdgeHandles(edge, sourceComponent, targetComponent) {
|
|
8
|
+
const isProviderToManagedServiceEdge = sourceComponent?.type === "third_party" &&
|
|
9
|
+
typeof targetComponent?.properties?.managed_by_provider === "string" &&
|
|
10
|
+
targetComponent.properties.managed_by_provider === sourceComponent?.id;
|
|
11
|
+
const isProviderToModuleShellEdge = sourceComponent !== undefined &&
|
|
12
|
+
targetComponent !== undefined &&
|
|
13
|
+
(0, component_predicates_1.isTerraformProviderComponent)(sourceComponent) &&
|
|
14
|
+
(0, main_application_selection_1.isTerraformModuleCallShellAsset)(targetComponent);
|
|
15
|
+
const isHubToIntegrationEdge = sourceComponent !== undefined &&
|
|
16
|
+
targetComponent?.type === "third_party" &&
|
|
17
|
+
((sourceComponent.type === "asset" &&
|
|
18
|
+
(0, section_helpers_1.isMainApplicationComponent)(sourceComponent)) ||
|
|
19
|
+
(0, section_helpers_1.isSectionApiNodeComponent)(sourceComponent));
|
|
20
|
+
if (isProviderToManagedServiceEdge ||
|
|
21
|
+
isProviderToModuleShellEdge ||
|
|
22
|
+
isHubToIntegrationEdge) {
|
|
23
|
+
edge.sourceHandle = "right-source";
|
|
24
|
+
edge.targetHandle = "left-target";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.repositionManagedProviderNodes = repositionManagedProviderNodes;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
function repositionManagedProviderNodes(nodes, componentsById) {
|
|
6
|
+
const nodeById = new Map(nodes.map((node) => [node.id, node]));
|
|
7
|
+
const managedByProvider = new Map();
|
|
8
|
+
for (const component of componentsById.values()) {
|
|
9
|
+
const providerId = component.properties?.managed_by_provider;
|
|
10
|
+
if (typeof providerId !== "string" || !providerId.trim())
|
|
11
|
+
continue;
|
|
12
|
+
const list = managedByProvider.get(providerId) ?? [];
|
|
13
|
+
list.push(component);
|
|
14
|
+
managedByProvider.set(providerId, list);
|
|
15
|
+
}
|
|
16
|
+
for (const [providerId, managedComponents] of managedByProvider.entries()) {
|
|
17
|
+
const providerNode = nodeById.get(providerId);
|
|
18
|
+
if (!providerNode)
|
|
19
|
+
continue;
|
|
20
|
+
const sortedManaged = [...managedComponents].sort((a, b) => {
|
|
21
|
+
const aKey = String(a.properties?.managed_service_key ?? a.name ?? "");
|
|
22
|
+
const bKey = String(b.properties?.managed_service_key ?? b.name ?? "");
|
|
23
|
+
const keyCmp = aKey.localeCompare(bKey);
|
|
24
|
+
if (keyCmp !== 0)
|
|
25
|
+
return keyCmp;
|
|
26
|
+
return a.id.localeCompare(b.id);
|
|
27
|
+
});
|
|
28
|
+
sortedManaged.forEach((managedComponent, index) => {
|
|
29
|
+
const managedNode = nodeById.get(managedComponent.id);
|
|
30
|
+
if (!managedNode)
|
|
31
|
+
return;
|
|
32
|
+
managedNode.position = {
|
|
33
|
+
x: providerNode.position.x + constants_1.MANAGED_NODE_X_OFFSET,
|
|
34
|
+
y: providerNode.position.y +
|
|
35
|
+
constants_1.MANAGED_NODE_Y_BASE_OFFSET +
|
|
36
|
+
index * constants_1.MANAGED_NODE_Y_STEP,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DiagramNodeSchema } from "../../schema";
|
|
2
|
+
import type { ComponentByIdMap } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal Terraform view: User (0) → main app + ECS shells (1) → provider (2).
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyTerraformMinimalServiceDiagramLayout(nodes: DiagramNodeSchema[], componentsById: ComponentByIdMap): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTerraformMinimalServiceDiagramLayout = applyTerraformMinimalServiceDiagramLayout;
|
|
4
|
+
const terraform_minimal_services_1 = require("../terraform-minimal-services");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
const section_helpers_1 = require("./section-helpers");
|
|
7
|
+
/**
|
|
8
|
+
* Minimal Terraform view: User (0) → main app + ECS shells (1) → provider (2).
|
|
9
|
+
*/
|
|
10
|
+
function applyTerraformMinimalServiceDiagramLayout(nodes, componentsById) {
|
|
11
|
+
const actorNodes = [];
|
|
12
|
+
const mainNodes = [];
|
|
13
|
+
const ecsNodes = [];
|
|
14
|
+
const providerNodes = [];
|
|
15
|
+
for (const node of nodes) {
|
|
16
|
+
const c = componentsById.get(node.id);
|
|
17
|
+
const bucket = (0, terraform_minimal_services_1.terraformMinimalLayoutBucket)(c);
|
|
18
|
+
if (bucket === "actor")
|
|
19
|
+
actorNodes.push(node);
|
|
20
|
+
else if (bucket === "main")
|
|
21
|
+
mainNodes.push(node);
|
|
22
|
+
else if (bucket === "ecs")
|
|
23
|
+
ecsNodes.push(node);
|
|
24
|
+
else if (bucket === "provider")
|
|
25
|
+
providerNodes.push(node);
|
|
26
|
+
}
|
|
27
|
+
actorNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
28
|
+
mainNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
29
|
+
ecsNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
30
|
+
providerNodes.sort(section_helpers_1.sortNodesByLabel);
|
|
31
|
+
actorNodes.forEach((node, i) => {
|
|
32
|
+
node.position = { x: 0 * constants_1.TERRAFORM_LANE_X_STEP, y: i * constants_1.NODE_VERTICAL_SPACING };
|
|
33
|
+
});
|
|
34
|
+
mainNodes.forEach((node, i) => {
|
|
35
|
+
node.position = {
|
|
36
|
+
x: 1 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
37
|
+
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
const mainCount = mainNodes.length;
|
|
41
|
+
ecsNodes.forEach((node, i) => {
|
|
42
|
+
node.position = {
|
|
43
|
+
x: 1 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
44
|
+
y: (mainCount + i) * constants_1.NODE_VERTICAL_SPACING,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
providerNodes.forEach((node, i) => {
|
|
48
|
+
node.position = {
|
|
49
|
+
x: 2 * constants_1.TERRAFORM_LANE_X_STEP,
|
|
50
|
+
y: i * constants_1.NODE_VERTICAL_SPACING,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DetectedComponent } from "../../types";
|
|
2
|
+
import type { ComponentByIdMap } from "./types";
|
|
3
|
+
export declare function getSectionIdFromComponent(component: DetectedComponent): string;
|
|
4
|
+
export declare function getSectionLabelFromComponent(component: DetectedComponent): string;
|
|
5
|
+
export declare function componentSortKey(component: DetectedComponent): string;
|
|
6
|
+
/** Lane layout applies only to sections with Terraform resources (not every User actor). */
|
|
7
|
+
export declare function sectionQualifiesForTerraformLaneLayout(sectionComponents: DetectedComponent[]): boolean;
|
|
8
|
+
export declare function isMainApplicationComponent(component: DetectedComponent): boolean;
|
|
9
|
+
export declare function isSectionApiNodeComponent(component: DetectedComponent): boolean;
|
|
10
|
+
export declare function isManagedSubserviceComponent(component: DetectedComponent): boolean;
|
|
11
|
+
export declare function sortNodesByLabel(a: {
|
|
12
|
+
id: string;
|
|
13
|
+
data?: {
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
}, b: {
|
|
17
|
+
id: string;
|
|
18
|
+
data?: {
|
|
19
|
+
label?: string;
|
|
20
|
+
};
|
|
21
|
+
}): number;
|
|
22
|
+
export declare function filterSectionNodes(nodes: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
}>, componentsById: ComponentByIdMap, sectionId: string): Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
position?: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSectionIdFromComponent = getSectionIdFromComponent;
|
|
4
|
+
exports.getSectionLabelFromComponent = getSectionLabelFromComponent;
|
|
5
|
+
exports.componentSortKey = componentSortKey;
|
|
6
|
+
exports.sectionQualifiesForTerraformLaneLayout = sectionQualifiesForTerraformLaneLayout;
|
|
7
|
+
exports.isMainApplicationComponent = isMainApplicationComponent;
|
|
8
|
+
exports.isSectionApiNodeComponent = isSectionApiNodeComponent;
|
|
9
|
+
exports.isManagedSubserviceComponent = isManagedSubserviceComponent;
|
|
10
|
+
exports.sortNodesByLabel = sortNodesByLabel;
|
|
11
|
+
exports.filterSectionNodes = filterSectionNodes;
|
|
12
|
+
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
13
|
+
function getSectionIdFromComponent(component) {
|
|
14
|
+
const sid = component.properties?.section_id;
|
|
15
|
+
return typeof sid === "string" && sid.trim() ? sid.trim() : "<unsectioned>";
|
|
16
|
+
}
|
|
17
|
+
function getSectionLabelFromComponent(component) {
|
|
18
|
+
const label = component.properties?.section_label;
|
|
19
|
+
if (typeof label === "string" && label.trim())
|
|
20
|
+
return label.trim();
|
|
21
|
+
return getSectionIdFromComponent(component);
|
|
22
|
+
}
|
|
23
|
+
function componentSortKey(component) {
|
|
24
|
+
const managedBy = String(component.properties?.managed_by_provider ?? "");
|
|
25
|
+
const managedKey = String(component.properties?.managed_service_key ?? "");
|
|
26
|
+
if (managedBy) {
|
|
27
|
+
return `2|${managedBy}|${managedKey}|${component.name}`;
|
|
28
|
+
}
|
|
29
|
+
if (component.type === "third_party") {
|
|
30
|
+
return `1|${component.id}|${component.name}`;
|
|
31
|
+
}
|
|
32
|
+
return `0|${component.id}|${component.name}`;
|
|
33
|
+
}
|
|
34
|
+
/** Lane layout applies only to sections with Terraform resources (not every User actor). */
|
|
35
|
+
function sectionQualifiesForTerraformLaneLayout(sectionComponents) {
|
|
36
|
+
return (0, component_predicates_1.scanHasTerraformAddress)(sectionComponents);
|
|
37
|
+
}
|
|
38
|
+
function isMainApplicationComponent(component) {
|
|
39
|
+
const v = component.properties?.isMainApplication;
|
|
40
|
+
return v === true || v === "true";
|
|
41
|
+
}
|
|
42
|
+
function isSectionApiNodeComponent(component) {
|
|
43
|
+
return (component.type === "asset" &&
|
|
44
|
+
component.subType === "api" &&
|
|
45
|
+
(component.properties?.isSectionApiNode === true ||
|
|
46
|
+
component.properties?.isSectionApiNode === "true"));
|
|
47
|
+
}
|
|
48
|
+
function isManagedSubserviceComponent(component) {
|
|
49
|
+
const providerId = component.properties?.managed_by_provider;
|
|
50
|
+
return typeof providerId === "string" && providerId.trim().length > 0;
|
|
51
|
+
}
|
|
52
|
+
function sortNodesByLabel(a, b) {
|
|
53
|
+
const la = String(a.data?.label ?? a.id);
|
|
54
|
+
const lb = String(b.data?.label ?? b.id);
|
|
55
|
+
return la.localeCompare(lb);
|
|
56
|
+
}
|
|
57
|
+
function filterSectionNodes(nodes, componentsById, sectionId) {
|
|
58
|
+
return nodes.filter((n) => {
|
|
59
|
+
const c = componentsById.get(n.id);
|
|
60
|
+
return c && getSectionIdFromComponent(c) === sectionId;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyTerraformLaneLayout = applyTerraformLaneLayout;
|
|
4
|
+
const main_application_selection_1 = require("../../../classifier/main-application-selection");
|
|
5
|
+
const component_predicates_1 = require("../../terraform/component-predicates");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const section_helpers_1 = require("./section-helpers");
|
|
8
|
+
/**
|
|
9
|
+
* Mixed-app Terraform root: only `provider.*` + `module.*` shells (no actor/main).
|
|
10
|
+
*/
|
|
11
|
+
function sectionUsesProviderHubBeforeModuleShells(sectionComponents) {
|
|
12
|
+
let hasProvider = false;
|
|
13
|
+
let hasModuleShell = false;
|
|
14
|
+
for (const c of sectionComponents) {
|
|
15
|
+
if (c.type === "actor")
|
|
16
|
+
return false;
|
|
17
|
+
if (c.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(c))
|
|
18
|
+
return false;
|
|
19
|
+
if ((0, component_predicates_1.isTerraformProviderComponent)(c))
|
|
20
|
+
hasProvider = true;
|
|
21
|
+
else if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(c))
|
|
22
|
+
hasModuleShell = true;
|
|
23
|
+
}
|
|
24
|
+
return hasProvider && hasModuleShell;
|
|
25
|
+
}
|
|
26
|
+
function terraformLaneTier(component, opts) {
|
|
27
|
+
if (component.type === "actor")
|
|
28
|
+
return 0;
|
|
29
|
+
if (component.type === "asset" && (0, section_helpers_1.isMainApplicationComponent)(component)) {
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
if (opts?.providerBeforeModuleShells) {
|
|
33
|
+
if ((0, component_predicates_1.isTerraformProviderComponent)(component))
|
|
34
|
+
return 2;
|
|
35
|
+
if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(component))
|
|
36
|
+
return 3;
|
|
37
|
+
if (component.type === "asset")
|
|
38
|
+
return 4;
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
if ((0, main_application_selection_1.isTerraformModuleCallShellAsset)(component))
|
|
42
|
+
return 2;
|
|
43
|
+
if (component.type === "third_party")
|
|
44
|
+
return 3;
|
|
45
|
+
if (component.type === "asset")
|
|
46
|
+
return 4;
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
function applyTerraformLaneLayout(nodes, componentsById, sectionIds) {
|
|
50
|
+
const allComponents = [...componentsById.values()];
|
|
51
|
+
const targetSectionIds = sectionIds.length <= 1
|
|
52
|
+
? sectionIds
|
|
53
|
+
: sectionIds.filter((sid) => {
|
|
54
|
+
const inSection = allComponents.filter((c) => (0, section_helpers_1.getSectionIdFromComponent)(c) === sid);
|
|
55
|
+
return (0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(inSection);
|
|
56
|
+
});
|
|
57
|
+
if (targetSectionIds.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
for (const sectionId of targetSectionIds) {
|
|
60
|
+
const sectionIndex = sectionIds.indexOf(sectionId);
|
|
61
|
+
const baseX = Math.max(0, sectionIndex) * constants_1.SECTION_BLOCK_WIDTH;
|
|
62
|
+
const sectionNodes = nodes.filter((n) => {
|
|
63
|
+
const c = componentsById.get(n.id);
|
|
64
|
+
return c && (0, section_helpers_1.getSectionIdFromComponent)(c) === sectionId;
|
|
65
|
+
});
|
|
66
|
+
if (sectionNodes.length === 0)
|
|
67
|
+
continue;
|
|
68
|
+
const sectionComponents = sectionNodes
|
|
69
|
+
.map((n) => componentsById.get(n.id))
|
|
70
|
+
.filter((c) => Boolean(c));
|
|
71
|
+
if (!(0, section_helpers_1.sectionQualifiesForTerraformLaneLayout)(sectionComponents))
|
|
72
|
+
continue;
|
|
73
|
+
const providerBeforeModuleShells = sectionUsesProviderHubBeforeModuleShells(sectionComponents);
|
|
74
|
+
const byTier = new Map();
|
|
75
|
+
for (const node of sectionNodes) {
|
|
76
|
+
const c = componentsById.get(node.id);
|
|
77
|
+
if (!c)
|
|
78
|
+
continue;
|
|
79
|
+
const tier = terraformLaneTier(c, { providerBeforeModuleShells });
|
|
80
|
+
if (tier === undefined)
|
|
81
|
+
continue;
|
|
82
|
+
const list = byTier.get(tier) ?? [];
|
|
83
|
+
list.push(node);
|
|
84
|
+
byTier.set(tier, list);
|
|
85
|
+
}
|
|
86
|
+
const tierOrder = [0, 1, 2, 3, 4];
|
|
87
|
+
for (const tier of tierOrder) {
|
|
88
|
+
const list = byTier.get(tier);
|
|
89
|
+
if (!list)
|
|
90
|
+
continue;
|
|
91
|
+
list.sort((a, b) => {
|
|
92
|
+
const ca = componentsById.get(a.id);
|
|
93
|
+
const cb = componentsById.get(b.id);
|
|
94
|
+
const na = ca?.name ?? a.id;
|
|
95
|
+
const nb = cb?.name ?? b.id;
|
|
96
|
+
const cmp = na.localeCompare(nb);
|
|
97
|
+
if (cmp !== 0)
|
|
98
|
+
return cmp;
|
|
99
|
+
return a.id.localeCompare(b.id);
|
|
100
|
+
});
|
|
101
|
+
list.forEach((node, idx) => {
|
|
102
|
+
node.position = {
|
|
103
|
+
x: baseX + tier * constants_1.TERRAFORM_LANE_X_STEP,
|
|
104
|
+
y: idx * constants_1.NODE_VERTICAL_SPACING,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|