@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,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.clearPiiSignalRulesCacheForTest = clearPiiSignalRulesCacheForTest;
|
|
7
|
+
exports.loadPiiSignalRules = loadPiiSignalRules;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
11
|
+
const zod_1 = require("zod");
|
|
12
|
+
const piiSignalRuleSchema = zod_1.z.object({
|
|
13
|
+
id: zod_1.z.string().min(1),
|
|
14
|
+
category: zod_1.z.enum(["identifiers", "profile_data", "credentials"]),
|
|
15
|
+
labels: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
16
|
+
patterns: zod_1.z.array(zod_1.z.string().min(1)).default([]),
|
|
17
|
+
});
|
|
18
|
+
const piiSignalCatalogSchema = zod_1.z.object({
|
|
19
|
+
pii_signal_rules: zod_1.z.array(piiSignalRuleSchema).default([]),
|
|
20
|
+
});
|
|
21
|
+
let cachedRules;
|
|
22
|
+
function clearPiiSignalRulesCacheForTest() {
|
|
23
|
+
cachedRules = undefined;
|
|
24
|
+
}
|
|
25
|
+
function getPiiSignalRulesPath() {
|
|
26
|
+
const parts = __dirname.split(path_1.default.sep);
|
|
27
|
+
const distIndex = parts.lastIndexOf("dist");
|
|
28
|
+
const cliRoot = distIndex !== -1
|
|
29
|
+
? parts.slice(0, distIndex).join(path_1.default.sep)
|
|
30
|
+
: path_1.default.resolve(__dirname, "..", "..");
|
|
31
|
+
return path_1.default.join(cliRoot, "patterns", "pii-signals.rules.yaml");
|
|
32
|
+
}
|
|
33
|
+
function loadPiiSignalRules() {
|
|
34
|
+
if (cachedRules)
|
|
35
|
+
return cachedRules;
|
|
36
|
+
const configPath = getPiiSignalRulesPath();
|
|
37
|
+
let raw;
|
|
38
|
+
try {
|
|
39
|
+
raw = fs_1.default.readFileSync(configPath, "utf8");
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
43
|
+
throw new Error(`PII signal rules are required but could not be read from '${configPath}': ${message}`);
|
|
44
|
+
}
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = yaml_1.default.parse(raw);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
51
|
+
throw new Error(`PII signal rules at '${configPath}' could not be parsed as YAML: ${message}`);
|
|
52
|
+
}
|
|
53
|
+
let normalized;
|
|
54
|
+
try {
|
|
55
|
+
normalized = piiSignalCatalogSchema.parse(parsed);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
59
|
+
throw new Error(`PII signal rules at '${configPath}' failed schema validation: ${message}`);
|
|
60
|
+
}
|
|
61
|
+
cachedRules = normalized.pii_signal_rules.map((rule) => ({
|
|
62
|
+
id: rule.id.trim().toLowerCase(),
|
|
63
|
+
category: rule.category,
|
|
64
|
+
labels: rule.labels.map((label) => label.trim()).filter(Boolean),
|
|
65
|
+
patterns: rule.patterns.map((pattern) => new RegExp(pattern, "i")),
|
|
66
|
+
}));
|
|
67
|
+
return cachedRules;
|
|
68
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runInferencePipeline = runInferencePipeline;
|
|
4
|
+
const candidate_selector_1 = require("./candidate-selector");
|
|
5
|
+
const merge_rules_1 = require("./merge-rules");
|
|
6
|
+
const planner_1 = require("./planner");
|
|
7
|
+
const DEFAULT_PLANNER_OPTIONS = {
|
|
8
|
+
totalBudgetTokens: 12_000,
|
|
9
|
+
maxModelCalls: 12,
|
|
10
|
+
maxCandidatesPerAgent: 25,
|
|
11
|
+
};
|
|
12
|
+
async function runInferencePipeline(input, options = {}) {
|
|
13
|
+
const components = input.components;
|
|
14
|
+
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
15
|
+
components,
|
|
16
|
+
dataFlows: input.dataFlows,
|
|
17
|
+
sections: input.sections,
|
|
18
|
+
inferenceScope: input.inferenceScope ?? "default",
|
|
19
|
+
});
|
|
20
|
+
const plannerOptions = {
|
|
21
|
+
...DEFAULT_PLANNER_OPTIONS,
|
|
22
|
+
...(input.plannerOptions ?? {}),
|
|
23
|
+
};
|
|
24
|
+
const plan = (0, planner_1.planInferenceQueues)(candidates, plannerOptions);
|
|
25
|
+
const proposalContext = {
|
|
26
|
+
candidates,
|
|
27
|
+
plan,
|
|
28
|
+
components: input.components,
|
|
29
|
+
dataFlows: input.dataFlows,
|
|
30
|
+
sections: input.sections,
|
|
31
|
+
files: input.files,
|
|
32
|
+
findings: input.findings,
|
|
33
|
+
};
|
|
34
|
+
const generation = options.generateProposals
|
|
35
|
+
? await options.generateProposals(proposalContext)
|
|
36
|
+
: { proposals: [] };
|
|
37
|
+
const proposals = generation.proposals;
|
|
38
|
+
const mergeResult = (0, merge_rules_1.mergeAiProposals)(components, input.dataFlows, proposals, {}, {
|
|
39
|
+
enforceIntraSectionFlowChangesOnly: true,
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
candidates,
|
|
43
|
+
plan,
|
|
44
|
+
proposals,
|
|
45
|
+
usageSummary: generation.usageSummary,
|
|
46
|
+
mergeResult,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planInferenceQueues = planInferenceQueues;
|
|
4
|
+
const AGENT_BY_CANDIDATE_TYPE = {
|
|
5
|
+
third_party: "tpAgent",
|
|
6
|
+
node_property: "propertyAgent",
|
|
7
|
+
flow_direction: "directionAgent",
|
|
8
|
+
missing_interaction: "interactionAgent",
|
|
9
|
+
};
|
|
10
|
+
function divideEvenly(total, buckets) {
|
|
11
|
+
if (buckets <= 0)
|
|
12
|
+
return [];
|
|
13
|
+
const base = Math.floor(total / buckets);
|
|
14
|
+
const rem = total % buckets;
|
|
15
|
+
return Array.from({ length: buckets }, (_, i) => base + (i < rem ? 1 : 0));
|
|
16
|
+
}
|
|
17
|
+
function planInferenceQueues(candidates, options) {
|
|
18
|
+
const grouped = new Map();
|
|
19
|
+
const droppedCandidates = [];
|
|
20
|
+
// `0` or omitted → no per-agent cap (queue every candidate). Otherwise cap
|
|
21
|
+
// queue length; pipeline defaults pass `25` from `ScanConfiguration`.
|
|
22
|
+
const rawCap = options.maxCandidatesPerAgent;
|
|
23
|
+
const maxCandidatesPerAgent = rawCap === 0 || rawCap === undefined
|
|
24
|
+
? Number.MAX_SAFE_INTEGER
|
|
25
|
+
: Math.max(1, rawCap);
|
|
26
|
+
for (const candidate of candidates) {
|
|
27
|
+
const agent = AGENT_BY_CANDIDATE_TYPE[candidate.candidateType];
|
|
28
|
+
const queue = grouped.get(agent) ?? [];
|
|
29
|
+
if (queue.length >= maxCandidatesPerAgent) {
|
|
30
|
+
droppedCandidates.push({
|
|
31
|
+
candidateId: candidate.id,
|
|
32
|
+
reason: "agent_queue_capacity_exceeded",
|
|
33
|
+
});
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
queue.push(candidate);
|
|
37
|
+
grouped.set(agent, queue);
|
|
38
|
+
}
|
|
39
|
+
const queues = Array.from(grouped.entries())
|
|
40
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
41
|
+
.map(([agent, queue]) => ({
|
|
42
|
+
agent,
|
|
43
|
+
queue: queue.sort((x, y) => {
|
|
44
|
+
if (x.priority !== y.priority)
|
|
45
|
+
return y.priority - x.priority;
|
|
46
|
+
return x.id.localeCompare(y.id);
|
|
47
|
+
}),
|
|
48
|
+
budgetTokens: 0,
|
|
49
|
+
maxModelCalls: 0,
|
|
50
|
+
}));
|
|
51
|
+
const totalBudgetTokens = options.totalBudgetTokens;
|
|
52
|
+
const totalMaxModelCalls = options.maxModelCalls;
|
|
53
|
+
const tokenSlices = divideEvenly(totalBudgetTokens, queues.length);
|
|
54
|
+
const callSlices = divideEvenly(totalMaxModelCalls, queues.length);
|
|
55
|
+
for (let i = 0; i < queues.length; i += 1) {
|
|
56
|
+
queues[i].budgetTokens = tokenSlices[i] ?? 0;
|
|
57
|
+
queues[i].maxModelCalls = callSlices[i] ?? 0;
|
|
58
|
+
}
|
|
59
|
+
return { queues, droppedCandidates };
|
|
60
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System prompts for scan enrichment. Kept separate from provider HTTP implementations
|
|
3
|
+
* so each provider can compose instructions without duplicating the full contract text.
|
|
4
|
+
*/
|
|
5
|
+
/** Shared system instructions for OpenAI, Anthropic, Gemini, and local/Ollama providers. */
|
|
6
|
+
export declare const AI_PROVIDER_SYSTEM_PROMPT = "You are enriching a DataParade data-flow scan. Respond with a JSON object matching the response schema: top-level key \"proposals\" (array). No markdown fences.\n\nPrimary goal: **only** populate node properties when each value is **directly supported** by code or config text in `relevantFileContents` (when present) or by explicit paths in `detectedFrom` / `sourceLocations` for that component. If support is weak, indirect, or guessed, **omit** the property. It is always valid to return **zero** proposals or a patch with **few** `setProperties` keys.\n\nUse **ComponentPatch only** in the proposals array (schema may list a flow variant for compatibility; omit it).\n\nComponentPatch (property filling):\n- kind: \"component_patch\"\n- targetComponentId: string (**must exactly equal one of the componentContext object keys / canonical component IDs**)\n- candidateType: match the user payload agent/candidates (usually \"third_party\" or \"node_property\")\n- setSubType: string \u2014 **required** when componentContext.subType is empty/null; use one taxonomy token: b2b_customer, saas_service, payment_processor, cloud_provider, api_provider, ai_provider, data_provider, government_regulator, partner, ad_network, professional_services, data_processor, other (snake_case). Omit setSubType only when componentContext already has subType.\n- setDescription?: string when helpful\n- setProperties: object with snake_case keys; **only** keys you can tie to cited evidence (see propertyEvidence)\n- propertyEvidence: **required**. Object whose keys are exactly the keys you put in setProperties; each value is a **non-empty** array of evidence rows: { \"filePath\", \"startLine\", \"endLine\", \"reason\" }. Every property must cite where in the repo that value comes from; different properties may cite different files or line ranges.\n- confidence: { \"score\": number 0.72\u20130.95 when patch is well supported, \"band\": \"high\" | \"medium\" | \"low\" }\n- evidence: optional legacy field; prefer propertyEvidence only.\n\nPrefer **one ComponentPatch per target component** when you have support \u2014 not a large speculative bag of guesses.\n\n**Do not emit FlowPatch proposals.** Connectivity comes from deterministic scan rules.\n\nRules:\n- Do not contradict propertiesSet unless fixing a clear error with cited proof.\n- `targetComponentId` must be a canonical component ID from componentContext keys only. Never emit file paths or folder names as targetComponentId.\n- **Anti-fabrication:** same as above \u2014 if the fact is not in the cited lines / excerpt text, omit the property.\n- Do not emit placeholder `setProperties` values (null, \"none\", empty arrays, empty strings), and do not set `inference_status`.\n\nsetProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. [\"api\"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)\u2014snake_case. Other multi-value fields must be string arrays, not comma-joined strings.";
|
|
7
|
+
/**
|
|
8
|
+
* Anthropic has no server-side JSON schema for this path; truncated output yields invalid JSON.
|
|
9
|
+
* Reinforce brevity so the model completes a single well-formed object.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ANTHROPIC_ENRICHMENT_SYSTEM_PROMPT_SUPPLEMENT = "Output discipline: Your entire reply must be one parseable JSON object (no markdown). Keep each propertyEvidence \"reason\" to one short clause. If many properties apply, return fewer patches or fewer keys per patch so the JSON always completes \u2014 never stop mid-string or mid-object.";
|
|
12
|
+
export declare function buildAnthropicEnrichmentSystemPrompt(): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* System prompts for scan enrichment. Kept separate from provider HTTP implementations
|
|
4
|
+
* so each provider can compose instructions without duplicating the full contract text.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ANTHROPIC_ENRICHMENT_SYSTEM_PROMPT_SUPPLEMENT = exports.AI_PROVIDER_SYSTEM_PROMPT = void 0;
|
|
8
|
+
exports.buildAnthropicEnrichmentSystemPrompt = buildAnthropicEnrichmentSystemPrompt;
|
|
9
|
+
/** Shared system instructions for OpenAI, Anthropic, Gemini, and local/Ollama providers. */
|
|
10
|
+
exports.AI_PROVIDER_SYSTEM_PROMPT = `You are enriching a DataParade data-flow scan. Respond with a JSON object matching the response schema: top-level key "proposals" (array). No markdown fences.
|
|
11
|
+
|
|
12
|
+
Primary goal: **only** populate node properties when each value is **directly supported** by code or config text in \`relevantFileContents\` (when present) or by explicit paths in \`detectedFrom\` / \`sourceLocations\` for that component. If support is weak, indirect, or guessed, **omit** the property. It is always valid to return **zero** proposals or a patch with **few** \`setProperties\` keys.
|
|
13
|
+
|
|
14
|
+
Use **ComponentPatch only** in the proposals array (schema may list a flow variant for compatibility; omit it).
|
|
15
|
+
|
|
16
|
+
ComponentPatch (property filling):
|
|
17
|
+
- kind: "component_patch"
|
|
18
|
+
- targetComponentId: string (**must exactly equal one of the componentContext object keys / canonical component IDs**)
|
|
19
|
+
- candidateType: match the user payload agent/candidates (usually "third_party" or "node_property")
|
|
20
|
+
- setSubType: string — **required** when componentContext.subType is empty/null; use one taxonomy token: b2b_customer, saas_service, payment_processor, cloud_provider, api_provider, ai_provider, data_provider, government_regulator, partner, ad_network, professional_services, data_processor, other (snake_case). Omit setSubType only when componentContext already has subType.
|
|
21
|
+
- setDescription?: string when helpful
|
|
22
|
+
- setProperties: object with snake_case keys; **only** keys you can tie to cited evidence (see propertyEvidence)
|
|
23
|
+
- propertyEvidence: **required**. Object whose keys are exactly the keys you put in setProperties; each value is a **non-empty** array of evidence rows: { "filePath", "startLine", "endLine", "reason" }. Every property must cite where in the repo that value comes from; different properties may cite different files or line ranges.
|
|
24
|
+
- confidence: { "score": number 0.72–0.95 when patch is well supported, "band": "high" | "medium" | "low" }
|
|
25
|
+
- evidence: optional legacy field; prefer propertyEvidence only.
|
|
26
|
+
|
|
27
|
+
Prefer **one ComponentPatch per target component** when you have support — not a large speculative bag of guesses.
|
|
28
|
+
|
|
29
|
+
**Do not emit FlowPatch proposals.** Connectivity comes from deterministic scan rules.
|
|
30
|
+
|
|
31
|
+
Rules:
|
|
32
|
+
- Do not contradict propertiesSet unless fixing a clear error with cited proof.
|
|
33
|
+
- \`targetComponentId\` must be a canonical component ID from componentContext keys only. Never emit file paths or folder names as targetComponentId.
|
|
34
|
+
- **Anti-fabrication:** same as above — if the fact is not in the cited lines / excerpt text, omit the property.
|
|
35
|
+
- Do not emit placeholder \`setProperties\` values (null, "none", empty arrays, empty strings), and do not set \`inference_status\`.
|
|
36
|
+
|
|
37
|
+
setProperties value shapes: use snake_case keys from sparsePropertyKeys. integration_method must be a string array (e.g. ["api"]), never a single string. authentication_method must be one string token (e.g. api_key, oauth_2_0), never an array. processing_purpose must be a string array of taxonomy tokens (authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other, etc.)—snake_case. Other multi-value fields must be string arrays, not comma-joined strings.`;
|
|
38
|
+
/**
|
|
39
|
+
* Anthropic has no server-side JSON schema for this path; truncated output yields invalid JSON.
|
|
40
|
+
* Reinforce brevity so the model completes a single well-formed object.
|
|
41
|
+
*/
|
|
42
|
+
exports.ANTHROPIC_ENRICHMENT_SYSTEM_PROMPT_SUPPLEMENT = `Output discipline: Your entire reply must be one parseable JSON object (no markdown). Keep each propertyEvidence "reason" to one short clause. If many properties apply, return fewer patches or fewer keys per patch so the JSON always completes — never stop mid-string or mid-object.`;
|
|
43
|
+
function buildAnthropicEnrichmentSystemPrompt() {
|
|
44
|
+
return `${exports.AI_PROVIDER_SYSTEM_PROMPT}\n\n${exports.ANTHROPIC_ENRICHMENT_SYSTEM_PROMPT_SUPPLEMENT}`;
|
|
45
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ServiceSection } from "../core/sectioning/discover-service-sections";
|
|
2
|
+
import type { DetectedComponent } from "../core/types/component";
|
|
3
|
+
import type { DetectedDataFlow } from "../core/types/data-flow";
|
|
4
|
+
import type { FileInfo } from "../core/types/file";
|
|
5
|
+
import type { AiAgentName, AiInferenceCandidate } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Collect repo-relative paths tied to queued candidates (components and flow endpoints).
|
|
8
|
+
*/
|
|
9
|
+
export declare function collectReferencedPathsForQueue(queue: AiInferenceCandidate[], components: DetectedComponent[], dataFlows: DetectedDataFlow[]): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Map path → file text for paths referenced by the queue, bounded for LLM prompts.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildFileExcerptsForQueue(files: FileInfo[], queue: AiInferenceCandidate[], components: DetectedComponent[], dataFlows: DetectedDataFlow[]): Record<string, string>;
|
|
14
|
+
export declare function buildFileExcerptsForPaths(files: FileInfo[], preferredPaths: string[]): Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Compact component view for LLM prompts: real paths from structural scan,
|
|
17
|
+
* plus which property keys are still empty so the model can target patches.
|
|
18
|
+
*/
|
|
19
|
+
export declare function slimComponentForLlm(component: DetectedComponent): Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* JSON user message for {@link AiProvider.infer}: candidates plus enough graph
|
|
22
|
+
* context to produce evidence-backed `proposals`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildProviderPromptPayload(input: {
|
|
25
|
+
agent: AiAgentName;
|
|
26
|
+
queue: AiInferenceCandidate[];
|
|
27
|
+
components: DetectedComponent[];
|
|
28
|
+
dataFlows: DetectedDataFlow[];
|
|
29
|
+
sections?: ServiceSection[];
|
|
30
|
+
files?: FileInfo[];
|
|
31
|
+
preferredPaths?: string[];
|
|
32
|
+
}): Record<string, unknown>;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectReferencedPathsForQueue = collectReferencedPathsForQueue;
|
|
4
|
+
exports.buildFileExcerptsForQueue = buildFileExcerptsForQueue;
|
|
5
|
+
exports.buildFileExcerptsForPaths = buildFileExcerptsForPaths;
|
|
6
|
+
exports.slimComponentForLlm = slimComponentForLlm;
|
|
7
|
+
exports.buildProviderPromptPayload = buildProviderPromptPayload;
|
|
8
|
+
const sensitive_paths_1 = require("./sensitive-paths");
|
|
9
|
+
const scan_paths_1 = require("./scan-paths");
|
|
10
|
+
const MAX_DETECTED_FROM = 14;
|
|
11
|
+
const MAX_SOURCE_LOCS = 12;
|
|
12
|
+
/** Cap how many files we embed per provider call (token budget). */
|
|
13
|
+
const MAX_FILES_IN_PROMPT = 28;
|
|
14
|
+
const MAX_CHARS_PER_FILE = 14_000;
|
|
15
|
+
const MAX_TOTAL_EXCERPT_CHARS = 100_000;
|
|
16
|
+
const NON_ENRICHMENT_PROPERTY_KEYS = new Set(["inference_status"]);
|
|
17
|
+
function truncateChars(text, max) {
|
|
18
|
+
if (text.length <= max)
|
|
19
|
+
return text;
|
|
20
|
+
return `${text.slice(0, max)}\n\n...[truncated]`;
|
|
21
|
+
}
|
|
22
|
+
function pathsFromComponent(comp) {
|
|
23
|
+
if (!comp)
|
|
24
|
+
return [];
|
|
25
|
+
const out = [];
|
|
26
|
+
for (const ref of comp.detectedFrom ?? []) {
|
|
27
|
+
const p = ref.sourceLocation?.filePath;
|
|
28
|
+
if (p)
|
|
29
|
+
out.push((0, scan_paths_1.normScanPath)(p));
|
|
30
|
+
}
|
|
31
|
+
for (const loc of comp.sourceLocations ?? []) {
|
|
32
|
+
if (loc.filePath)
|
|
33
|
+
out.push((0, scan_paths_1.normScanPath)(loc.filePath));
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Collect repo-relative paths tied to queued candidates (components and flow endpoints).
|
|
39
|
+
*/
|
|
40
|
+
function collectReferencedPathsForQueue(queue, components, dataFlows) {
|
|
41
|
+
const byId = new Map(components.map((c) => [c.id, c]));
|
|
42
|
+
const ordered = new Set();
|
|
43
|
+
for (const cand of queue) {
|
|
44
|
+
if (cand.componentId) {
|
|
45
|
+
for (const p of pathsFromComponent(byId.get(cand.componentId)))
|
|
46
|
+
ordered.add(p);
|
|
47
|
+
}
|
|
48
|
+
if (cand.flowId) {
|
|
49
|
+
const flow = dataFlows.find((f) => f.id === cand.flowId);
|
|
50
|
+
if (flow) {
|
|
51
|
+
for (const p of pathsFromComponent(byId.get(flow.sourceComponentId)))
|
|
52
|
+
ordered.add(p);
|
|
53
|
+
for (const p of pathsFromComponent(byId.get(flow.targetComponentId)))
|
|
54
|
+
ordered.add(p);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return [...ordered].sort((a, b) => a.localeCompare(b));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Map path → file text for paths referenced by the queue, bounded for LLM prompts.
|
|
62
|
+
*/
|
|
63
|
+
function buildFileExcerptsForQueue(files, queue, components, dataFlows) {
|
|
64
|
+
const paths = collectReferencedPathsForQueue(queue, components, dataFlows);
|
|
65
|
+
const out = {};
|
|
66
|
+
let total = 0;
|
|
67
|
+
for (const p of paths) {
|
|
68
|
+
if (Object.keys(out).length >= MAX_FILES_IN_PROMPT)
|
|
69
|
+
break;
|
|
70
|
+
const fi = (0, scan_paths_1.resolveScannedFileExact)(files, p);
|
|
71
|
+
if (!fi || (0, sensitive_paths_1.isSensitiveFileForAiPrompt)(fi))
|
|
72
|
+
continue;
|
|
73
|
+
const key = (0, scan_paths_1.normScanPath)(fi.path);
|
|
74
|
+
if (out[key])
|
|
75
|
+
continue;
|
|
76
|
+
const excerpt = truncateChars(fi.content, MAX_CHARS_PER_FILE);
|
|
77
|
+
if (total + excerpt.length > MAX_TOTAL_EXCERPT_CHARS)
|
|
78
|
+
break;
|
|
79
|
+
out[key] = excerpt;
|
|
80
|
+
total += excerpt.length;
|
|
81
|
+
}
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
function buildFileExcerptsForPaths(files, preferredPaths) {
|
|
85
|
+
const out = {};
|
|
86
|
+
let total = 0;
|
|
87
|
+
const ordered = [...new Set(preferredPaths.map((p) => (0, scan_paths_1.normScanPath)(p)))].sort((a, b) => a.localeCompare(b));
|
|
88
|
+
for (const p of ordered) {
|
|
89
|
+
if (Object.keys(out).length >= MAX_FILES_IN_PROMPT)
|
|
90
|
+
break;
|
|
91
|
+
const fi = (0, scan_paths_1.resolveScannedFileExact)(files, p);
|
|
92
|
+
if (!fi || (0, sensitive_paths_1.isSensitiveFileForAiPrompt)(fi))
|
|
93
|
+
continue;
|
|
94
|
+
const key = (0, scan_paths_1.normScanPath)(fi.path);
|
|
95
|
+
if (out[key])
|
|
96
|
+
continue;
|
|
97
|
+
const excerpt = truncateChars(fi.content, MAX_CHARS_PER_FILE);
|
|
98
|
+
if (total + excerpt.length > MAX_TOTAL_EXCERPT_CHARS)
|
|
99
|
+
break;
|
|
100
|
+
out[key] = excerpt;
|
|
101
|
+
total += excerpt.length;
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
function isSparseValue(value) {
|
|
106
|
+
if (value === null || value === undefined)
|
|
107
|
+
return true;
|
|
108
|
+
if (typeof value === "string")
|
|
109
|
+
return value.trim() === "";
|
|
110
|
+
if (Array.isArray(value))
|
|
111
|
+
return value.length === 0;
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Compact component view for LLM prompts: real paths from structural scan,
|
|
116
|
+
* plus which property keys are still empty so the model can target patches.
|
|
117
|
+
*/
|
|
118
|
+
function slimComponentForLlm(component) {
|
|
119
|
+
const props = component.properties ?? {};
|
|
120
|
+
const sparseKeys = [];
|
|
121
|
+
const propertiesSet = {};
|
|
122
|
+
for (const [key, value] of Object.entries(props)) {
|
|
123
|
+
if (NON_ENRICHMENT_PROPERTY_KEYS.has(key))
|
|
124
|
+
continue;
|
|
125
|
+
if (isSparseValue(value)) {
|
|
126
|
+
sparseKeys.push(key);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
propertiesSet[key] = value;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
sparseKeys.sort((a, b) => a.localeCompare(b));
|
|
133
|
+
return {
|
|
134
|
+
id: component.id,
|
|
135
|
+
name: component.name,
|
|
136
|
+
type: component.type,
|
|
137
|
+
subType: component.subType,
|
|
138
|
+
description: component.description,
|
|
139
|
+
confidence: component.confidence,
|
|
140
|
+
propertiesSet,
|
|
141
|
+
/** Every property key that is still null/empty/[] — LLM should try to fill these. */
|
|
142
|
+
sparsePropertyKeys: sparseKeys,
|
|
143
|
+
detectedFrom: (component.detectedFrom ?? []).slice(0, MAX_DETECTED_FROM).map((ref) => ({
|
|
144
|
+
pattern: ref.pattern,
|
|
145
|
+
filePath: ref.sourceLocation?.filePath,
|
|
146
|
+
startLine: ref.sourceLocation?.startLine,
|
|
147
|
+
endLine: ref.sourceLocation?.endLine,
|
|
148
|
+
})),
|
|
149
|
+
sourceLocations: (component.sourceLocations ?? []).slice(0, MAX_SOURCE_LOCS).map((loc) => ({
|
|
150
|
+
filePath: loc.filePath,
|
|
151
|
+
startLine: loc.startLine,
|
|
152
|
+
endLine: loc.endLine,
|
|
153
|
+
})),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* JSON user message for {@link AiProvider.infer}: candidates plus enough graph
|
|
158
|
+
* context to produce evidence-backed `proposals`.
|
|
159
|
+
*/
|
|
160
|
+
function buildProviderPromptPayload(input) {
|
|
161
|
+
const excerpts = input.files && input.files.length > 0
|
|
162
|
+
? input.preferredPaths && input.preferredPaths.length > 0
|
|
163
|
+
? buildFileExcerptsForPaths(input.files, input.preferredPaths)
|
|
164
|
+
: buildFileExcerptsForQueue(input.files, input.queue, input.components, input.dataFlows)
|
|
165
|
+
: {};
|
|
166
|
+
const byId = new Map(input.components.map((c) => [c.id, c]));
|
|
167
|
+
const componentContext = {};
|
|
168
|
+
for (const cand of input.queue) {
|
|
169
|
+
if (!cand.componentId)
|
|
170
|
+
continue;
|
|
171
|
+
const comp = byId.get(cand.componentId);
|
|
172
|
+
if (comp && !componentContext[cand.componentId]) {
|
|
173
|
+
componentContext[cand.componentId] = slimComponentForLlm(comp);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const flowContext = {};
|
|
177
|
+
for (const cand of input.queue) {
|
|
178
|
+
if (!cand.flowId)
|
|
179
|
+
continue;
|
|
180
|
+
const flow = input.dataFlows.find((f) => f.id === cand.flowId);
|
|
181
|
+
if (!flow || flowContext[cand.flowId])
|
|
182
|
+
continue;
|
|
183
|
+
const src = byId.get(flow.sourceComponentId);
|
|
184
|
+
const tgt = byId.get(flow.targetComponentId);
|
|
185
|
+
flowContext[cand.flowId] = {
|
|
186
|
+
id: flow.id,
|
|
187
|
+
type: flow.type,
|
|
188
|
+
confidence: flow.confidence,
|
|
189
|
+
sourceComponentId: flow.sourceComponentId,
|
|
190
|
+
targetComponentId: flow.targetComponentId,
|
|
191
|
+
sourceName: src?.name,
|
|
192
|
+
targetName: tgt?.name,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
const sectionSummary = input.sections?.map((s) => ({
|
|
196
|
+
id: s.id,
|
|
197
|
+
label: s.label,
|
|
198
|
+
role: s.role,
|
|
199
|
+
})) ?? [];
|
|
200
|
+
const hasExcerpts = Object.keys(excerpts).length > 0;
|
|
201
|
+
const canonicalComponentIds = Object.keys(componentContext).sort((a, b) => a.localeCompare(b));
|
|
202
|
+
const propertyShapeHints = " **Property shapes (match DataParade scan/schema):** Use snake_case keys from sparsePropertyKeys. " +
|
|
203
|
+
"`integration_method` must always be an array of lowercase tokens (e.g. [\"api\"], [\"sdk\",\"api\"]); never a single string. " +
|
|
204
|
+
"`authentication_method` must be a single string token (e.g. \"api_key\", \"oauth_2_0\", \"openid_connect\", \"jwt\", \"saml\", \"mtls\", \"certificate\", \"basic_auth\", \"none\")—not an array—so it matches product dropdowns. " +
|
|
205
|
+
"`processing_purpose` must be a string array of **taxonomy** tokens the app lists (e.g. authentication, security, analytics, service_provision, payment_processing, marketing, compliance, other)—snake_case only, not sentences. " +
|
|
206
|
+
"Other multi-value fields such as `data_categories_received`, `supported_export_formats`, `cloud_services_used`, `regions_availability_zones` must be string arrays, not one comma-joined string. " +
|
|
207
|
+
"Booleans must be true/false (not strings). Prefer enum-like values in lowercase snake_case (e.g. integration_status: \"active\"). " +
|
|
208
|
+
"For any field that corresponds to an app dropdown or multi-select, use the product's option tokens (snake_case / exact strings) — e.g. legal_basis: \"contractual_necessity\" not \"contract\"; pci_scope: \"saq_d\" not \"full\"; data_transfer_mechanism: \"standard_contractual_clauses\" not raw \"HTTPS\"; risk_rating and encrypt_at_rest must match allowed values.";
|
|
209
|
+
const groundedInstructions = "You may output multiple component_patch proposals when they are independently grounded in code/config text. Prefer at most one component_patch per target component, and only for properties you can **ground in code/config text**. Use propertiesSet as truth for fields already set. For every key in setProperties, **propertyEvidence[key]** must be a non-empty array citing filePath + startLine/endLine + reason where that key's value appears in relevantFileContents (when provided) or in the file paths listed on that component in detectedFrom/sourceLocations. If you cannot tie a property to cited text or a cited path, **omit that key**. Indirect guesses are not allowed. It is valid to return **no proposals** or a patch with only one or two setProperties. Never invent URLs, vendor names, analytics products, retention numbers, or compliance labels without a literal basis in the excerpts or cited lines. `targetComponentId` must be exactly one of canonicalComponentIds (componentContext keys). ";
|
|
210
|
+
return {
|
|
211
|
+
instructions: hasExcerpts
|
|
212
|
+
? `${groundedInstructions} relevantFileContents may be truncated; line ranges must fall within the excerpt for that file. confidence.score should reflect how well the patch is supported (>= 0.72 when merge thresholds apply).`.concat(propertyShapeHints)
|
|
213
|
+
: `${groundedInstructions} sourceLocations paths and line ranges you rely on; if you cannot cite support, omit the property. confidence.score should reflect how well the patch is supported (>= 0.72 when merge thresholds apply).`.concat(propertyShapeHints),
|
|
214
|
+
agent: input.agent,
|
|
215
|
+
candidates: input.queue,
|
|
216
|
+
componentContext,
|
|
217
|
+
canonicalComponentIds,
|
|
218
|
+
...(Object.keys(flowContext).length > 0 ? { flowContext } : {}),
|
|
219
|
+
...(sectionSummary.length > 0 ? { sectionSummary } : {}),
|
|
220
|
+
...(hasExcerpts ? { relevantFileContents: excerpts } : {}),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface ManagedResourceRule {
|
|
2
|
+
kind: "database" | "cache";
|
|
3
|
+
viaClients: string[];
|
|
4
|
+
directClients: string[];
|
|
5
|
+
matchHints: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ProviderTopologyRule {
|
|
8
|
+
providerId: string;
|
|
9
|
+
providerDisplayName: string;
|
|
10
|
+
canonicalServiceName: string;
|
|
11
|
+
providerMatchKeys: string[];
|
|
12
|
+
allowManagedDatabaseSharedFileInference: boolean;
|
|
13
|
+
confidence: {
|
|
14
|
+
managedNodeMinConfidence: number;
|
|
15
|
+
providerToManagedNodeFlowConfidence: number;
|
|
16
|
+
providerToManagedResourceFlowConfidence: number;
|
|
17
|
+
sourceToProviderFlowConfidenceFloor: number;
|
|
18
|
+
rewiredFlowConfidenceFloor: number;
|
|
19
|
+
collapseManagedPostgresFlowConfidence: number;
|
|
20
|
+
};
|
|
21
|
+
managedResources: ManagedResourceRule[];
|
|
22
|
+
managedServiceNodes: Array<{
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
componentType: "asset" | "third_party";
|
|
26
|
+
componentSubType: string;
|
|
27
|
+
flowType: "api_call" | "database_query" | "message_queue" | "file_transfer" | "webhook" | "rpc";
|
|
28
|
+
usageSignals: string[];
|
|
29
|
+
alwaysInclude: boolean;
|
|
30
|
+
evidencePatterns: string[];
|
|
31
|
+
terraformResourceTypes: string[];
|
|
32
|
+
terraformResourceTypePrefixes: string[];
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export interface FallbackPolicy {
|
|
36
|
+
nonConcreteSectionIds: string[];
|
|
37
|
+
actorTargetReverseConfidenceFloor: number;
|
|
38
|
+
preferredApiSourceConfidenceFloor: number;
|
|
39
|
+
crossSectionActorAssetFlowConfidence: number;
|
|
40
|
+
rewriteThroughProviderFlowTypes: Array<"api_call" | "database_query" | "message_queue" | "file_transfer" | "webhook" | "rpc">;
|
|
41
|
+
postgresLikeSignals: string[];
|
|
42
|
+
genericPgNodeNames: string[];
|
|
43
|
+
genericPgClientSignals: string[];
|
|
44
|
+
implicitManagedPostgresNodeKeys: string[];
|
|
45
|
+
managedResourceMatchHintsByKind: {
|
|
46
|
+
database: string[];
|
|
47
|
+
cache: string[];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export declare function clearProviderTopologyRulesCacheForTest(): void;
|
|
51
|
+
export declare function loadProviderTopologyRules(): ProviderTopologyRule[];
|
|
52
|
+
export declare function loadProviderTopologyFallbackPolicy(): FallbackPolicy;
|