@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,483 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const agent_orchestrator_1 = require("../../../src/ai-enrichment/agent-orchestrator");
|
|
4
|
+
const chat_completions_family_1 = require("../../../src/ai-enrichment/providers/families/chat-completions-family");
|
|
5
|
+
function tpCandidate(id, componentId) {
|
|
6
|
+
return {
|
|
7
|
+
id,
|
|
8
|
+
candidateType: "third_party",
|
|
9
|
+
priority: 90,
|
|
10
|
+
componentId,
|
|
11
|
+
missingFields: [],
|
|
12
|
+
rationale: "r",
|
|
13
|
+
hints: [],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function propertyCandidate(id, componentId) {
|
|
17
|
+
return {
|
|
18
|
+
id,
|
|
19
|
+
candidateType: "node_property",
|
|
20
|
+
priority: 50,
|
|
21
|
+
componentId,
|
|
22
|
+
missingFields: ["encryption_at_rest"],
|
|
23
|
+
rationale: "r",
|
|
24
|
+
hints: [],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
describe("generateAgenticProposals", () => {
|
|
28
|
+
let inferSpy;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
inferSpy = jest
|
|
31
|
+
.spyOn(chat_completions_family_1.ChatCompletionsFamilyProvider.prototype, "infer")
|
|
32
|
+
.mockResolvedValue({ proposals: [] });
|
|
33
|
+
});
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
inferSpy.mockRestore();
|
|
36
|
+
});
|
|
37
|
+
it("invokes the provider once per third-party queue item (tpAgent)", async () => {
|
|
38
|
+
const components = [
|
|
39
|
+
{
|
|
40
|
+
id: "tp_a",
|
|
41
|
+
name: "A",
|
|
42
|
+
type: "third_party",
|
|
43
|
+
confidence: 0.9,
|
|
44
|
+
detectedFrom: [],
|
|
45
|
+
sourceLocations: [],
|
|
46
|
+
properties: { vendor: null },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "tp_b",
|
|
50
|
+
name: "B",
|
|
51
|
+
type: "third_party",
|
|
52
|
+
confidence: 0.9,
|
|
53
|
+
detectedFrom: [],
|
|
54
|
+
sourceLocations: [],
|
|
55
|
+
properties: { vendor: null },
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
const c1 = tpCandidate("c1", "tp_a");
|
|
59
|
+
const c2 = tpCandidate("c2", "tp_b");
|
|
60
|
+
await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
61
|
+
queues: [
|
|
62
|
+
{
|
|
63
|
+
agent: "tpAgent",
|
|
64
|
+
queue: [c1, c2],
|
|
65
|
+
budgetTokens: 200_000,
|
|
66
|
+
maxModelCalls: 10,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
droppedCandidates: [],
|
|
70
|
+
}, [c1, c2], {
|
|
71
|
+
provider: "openai",
|
|
72
|
+
model: "gpt-4o-mini",
|
|
73
|
+
apiKey: "sk-test",
|
|
74
|
+
toolLoopMaxRounds: 1,
|
|
75
|
+
});
|
|
76
|
+
expect(inferSpy).toHaveBeenCalledTimes(2);
|
|
77
|
+
for (const call of inferSpy.mock.calls) {
|
|
78
|
+
const payload = JSON.parse(call[0].prompt);
|
|
79
|
+
expect(payload.candidates).toHaveLength(1);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
it("batches propertyAgent into a single infer call", async () => {
|
|
83
|
+
const components = [
|
|
84
|
+
{
|
|
85
|
+
id: "asset_1",
|
|
86
|
+
name: "DB",
|
|
87
|
+
type: "asset",
|
|
88
|
+
confidence: 0.9,
|
|
89
|
+
detectedFrom: [],
|
|
90
|
+
sourceLocations: [],
|
|
91
|
+
properties: {},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "asset_2",
|
|
95
|
+
name: "Cache",
|
|
96
|
+
type: "asset",
|
|
97
|
+
confidence: 0.9,
|
|
98
|
+
detectedFrom: [],
|
|
99
|
+
sourceLocations: [],
|
|
100
|
+
properties: {},
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
const c1 = propertyCandidate("p1", "asset_1");
|
|
104
|
+
const c2 = propertyCandidate("p2", "asset_2");
|
|
105
|
+
await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
106
|
+
queues: [
|
|
107
|
+
{
|
|
108
|
+
agent: "propertyAgent",
|
|
109
|
+
queue: [c1, c2],
|
|
110
|
+
budgetTokens: 200_000,
|
|
111
|
+
maxModelCalls: 10,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
droppedCandidates: [],
|
|
115
|
+
}, [c1, c2], {
|
|
116
|
+
provider: "openai",
|
|
117
|
+
model: "gpt-4o-mini",
|
|
118
|
+
apiKey: "sk-test",
|
|
119
|
+
toolLoopMaxRounds: 1,
|
|
120
|
+
});
|
|
121
|
+
expect(inferSpy).toHaveBeenCalledTimes(1);
|
|
122
|
+
const payload = JSON.parse(inferSpy.mock.calls[0][0].prompt);
|
|
123
|
+
expect(payload.candidates).toHaveLength(2);
|
|
124
|
+
});
|
|
125
|
+
it("respects maxModelCalls limit for tpAgent provider calls", async () => {
|
|
126
|
+
const components = [
|
|
127
|
+
{
|
|
128
|
+
id: "tp_a",
|
|
129
|
+
name: "A",
|
|
130
|
+
type: "third_party",
|
|
131
|
+
confidence: 0.9,
|
|
132
|
+
detectedFrom: [],
|
|
133
|
+
sourceLocations: [],
|
|
134
|
+
properties: { vendor: null },
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "tp_b",
|
|
138
|
+
name: "B",
|
|
139
|
+
type: "third_party",
|
|
140
|
+
confidence: 0.9,
|
|
141
|
+
detectedFrom: [],
|
|
142
|
+
sourceLocations: [],
|
|
143
|
+
properties: { vendor: null },
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "tp_c",
|
|
147
|
+
name: "C",
|
|
148
|
+
type: "third_party",
|
|
149
|
+
confidence: 0.9,
|
|
150
|
+
detectedFrom: [],
|
|
151
|
+
sourceLocations: [],
|
|
152
|
+
properties: { vendor: null },
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
const c1 = tpCandidate("c1", "tp_a");
|
|
156
|
+
const c2 = tpCandidate("c2", "tp_b");
|
|
157
|
+
const c3 = tpCandidate("c3", "tp_c");
|
|
158
|
+
await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
159
|
+
queues: [
|
|
160
|
+
{
|
|
161
|
+
agent: "tpAgent",
|
|
162
|
+
queue: [c1, c2, c3],
|
|
163
|
+
budgetTokens: 100_000,
|
|
164
|
+
maxModelCalls: 2,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
droppedCandidates: [],
|
|
168
|
+
}, [c1, c2, c3], {
|
|
169
|
+
provider: "openai",
|
|
170
|
+
model: "gpt-4o-mini",
|
|
171
|
+
apiKey: "sk-test",
|
|
172
|
+
toolLoopMaxRounds: 1,
|
|
173
|
+
});
|
|
174
|
+
expect(inferSpy).toHaveBeenCalledTimes(2);
|
|
175
|
+
});
|
|
176
|
+
it("respects budgetTokens and skips provider calls when budget is exhausted", async () => {
|
|
177
|
+
const components = [
|
|
178
|
+
{
|
|
179
|
+
id: "tp_a",
|
|
180
|
+
name: "A",
|
|
181
|
+
type: "third_party",
|
|
182
|
+
confidence: 0.9,
|
|
183
|
+
detectedFrom: [],
|
|
184
|
+
sourceLocations: [],
|
|
185
|
+
properties: { vendor: null },
|
|
186
|
+
},
|
|
187
|
+
];
|
|
188
|
+
const c1 = tpCandidate("c1", "tp_a");
|
|
189
|
+
await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
190
|
+
queues: [
|
|
191
|
+
{
|
|
192
|
+
agent: "tpAgent",
|
|
193
|
+
queue: [c1],
|
|
194
|
+
budgetTokens: 1,
|
|
195
|
+
maxModelCalls: 1,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
droppedCandidates: [],
|
|
199
|
+
}, [c1], {
|
|
200
|
+
provider: "openai",
|
|
201
|
+
model: "gpt-4o-mini",
|
|
202
|
+
apiKey: "sk-test",
|
|
203
|
+
toolLoopMaxRounds: 1,
|
|
204
|
+
});
|
|
205
|
+
expect(inferSpy).toHaveBeenCalledTimes(0);
|
|
206
|
+
});
|
|
207
|
+
it("invokes the provider for interactionAgent when the queue is eligible", async () => {
|
|
208
|
+
const components = [
|
|
209
|
+
{
|
|
210
|
+
id: "asset_1",
|
|
211
|
+
name: "A",
|
|
212
|
+
type: "asset",
|
|
213
|
+
confidence: 0.9,
|
|
214
|
+
detectedFrom: [],
|
|
215
|
+
sourceLocations: [],
|
|
216
|
+
properties: {},
|
|
217
|
+
},
|
|
218
|
+
];
|
|
219
|
+
const interactionCandidate = {
|
|
220
|
+
id: "m1",
|
|
221
|
+
candidateType: "missing_interaction",
|
|
222
|
+
priority: 80,
|
|
223
|
+
missingFields: [],
|
|
224
|
+
rationale: "r",
|
|
225
|
+
hints: ["frontend", "backend"],
|
|
226
|
+
};
|
|
227
|
+
await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
228
|
+
queues: [
|
|
229
|
+
{
|
|
230
|
+
agent: "interactionAgent",
|
|
231
|
+
queue: [interactionCandidate],
|
|
232
|
+
budgetTokens: 200_000,
|
|
233
|
+
maxModelCalls: 10,
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
droppedCandidates: [],
|
|
237
|
+
}, [interactionCandidate], {
|
|
238
|
+
provider: "openai",
|
|
239
|
+
model: "gpt-4o-mini",
|
|
240
|
+
apiKey: "sk-test",
|
|
241
|
+
toolLoopMaxRounds: 1,
|
|
242
|
+
});
|
|
243
|
+
expect(inferSpy).toHaveBeenCalledTimes(1);
|
|
244
|
+
});
|
|
245
|
+
it("aggregates provider token usage across calls", async () => {
|
|
246
|
+
inferSpy.mockResolvedValue({
|
|
247
|
+
proposals: [],
|
|
248
|
+
usage: {
|
|
249
|
+
inputTokens: 100,
|
|
250
|
+
outputTokens: 25,
|
|
251
|
+
totalTokens: 125,
|
|
252
|
+
estimatedCostUsd: 0.001,
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
const components = [
|
|
256
|
+
{
|
|
257
|
+
id: "tp_a",
|
|
258
|
+
name: "A",
|
|
259
|
+
type: "third_party",
|
|
260
|
+
confidence: 0.9,
|
|
261
|
+
detectedFrom: [],
|
|
262
|
+
sourceLocations: [],
|
|
263
|
+
properties: { vendor: null },
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: "tp_b",
|
|
267
|
+
name: "B",
|
|
268
|
+
type: "third_party",
|
|
269
|
+
confidence: 0.9,
|
|
270
|
+
detectedFrom: [],
|
|
271
|
+
sourceLocations: [],
|
|
272
|
+
properties: { vendor: null },
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
const c1 = tpCandidate("c1", "tp_a");
|
|
276
|
+
const c2 = tpCandidate("c2", "tp_b");
|
|
277
|
+
const out = await (0, agent_orchestrator_1.generateAgenticProposals)({ components, dataFlows: [] }, {
|
|
278
|
+
queues: [
|
|
279
|
+
{
|
|
280
|
+
agent: "tpAgent",
|
|
281
|
+
queue: [c1, c2],
|
|
282
|
+
budgetTokens: 200_000,
|
|
283
|
+
maxModelCalls: 10,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
droppedCandidates: [],
|
|
287
|
+
}, [c1, c2], {
|
|
288
|
+
provider: "openai",
|
|
289
|
+
model: "gpt-4o-mini",
|
|
290
|
+
apiKey: "sk-test",
|
|
291
|
+
toolLoopMaxRounds: 1,
|
|
292
|
+
});
|
|
293
|
+
expect(out.usageSummary).toMatchObject({
|
|
294
|
+
providerCalls: 2,
|
|
295
|
+
inputTokens: 200,
|
|
296
|
+
outputTokens: 50,
|
|
297
|
+
totalTokens: 250,
|
|
298
|
+
estimatedCostUsd: 0.002,
|
|
299
|
+
});
|
|
300
|
+
expect(out.usageSummary?.agenticTrace?.length).toBe(2);
|
|
301
|
+
});
|
|
302
|
+
it("adds deterministic third-party heuristic proposals with evidence", async () => {
|
|
303
|
+
inferSpy.mockResolvedValue({ proposals: [] });
|
|
304
|
+
const components = [
|
|
305
|
+
{
|
|
306
|
+
id: "tp_stripe",
|
|
307
|
+
name: "Stripe",
|
|
308
|
+
type: "third_party",
|
|
309
|
+
confidence: 0.9,
|
|
310
|
+
detectedFrom: [
|
|
311
|
+
{
|
|
312
|
+
pattern: "external_api_call",
|
|
313
|
+
sourceLocation: {
|
|
314
|
+
filePath: "backend/payments/index.ts",
|
|
315
|
+
startLine: 1,
|
|
316
|
+
endLine: 1,
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
sourceLocations: [
|
|
321
|
+
{ filePath: "backend/payments/index.ts", startLine: 1, endLine: 1 },
|
|
322
|
+
],
|
|
323
|
+
properties: {
|
|
324
|
+
section_id: "backend/payments",
|
|
325
|
+
vendor: null,
|
|
326
|
+
api_type: null,
|
|
327
|
+
authentication_method: null,
|
|
328
|
+
integration_method: [],
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
];
|
|
332
|
+
const out = await (0, agent_orchestrator_1.generateAgenticProposals)({
|
|
333
|
+
components,
|
|
334
|
+
dataFlows: [],
|
|
335
|
+
files: [
|
|
336
|
+
{
|
|
337
|
+
path: "backend/payments/index.ts",
|
|
338
|
+
name: "index.ts",
|
|
339
|
+
language: "typescript",
|
|
340
|
+
size: 180,
|
|
341
|
+
content: [
|
|
342
|
+
'import Stripe from "stripe";',
|
|
343
|
+
'await fetch("https://api.stripe.com/v1/customers", {',
|
|
344
|
+
" headers: { Authorization: `Bearer ${process.env.STRIPE_API_KEY}` },",
|
|
345
|
+
"});",
|
|
346
|
+
].join("\n"),
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
path: "backend/payments/package.json",
|
|
350
|
+
name: "package.json",
|
|
351
|
+
language: "json",
|
|
352
|
+
size: 60,
|
|
353
|
+
content: JSON.stringify({ dependencies: { stripe: "^17.0.0" } }),
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
}, {
|
|
357
|
+
queues: [
|
|
358
|
+
{
|
|
359
|
+
agent: "tpAgent",
|
|
360
|
+
queue: [tpCandidate("c1", "tp_stripe")],
|
|
361
|
+
budgetTokens: 200_000,
|
|
362
|
+
maxModelCalls: 1,
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
droppedCandidates: [],
|
|
366
|
+
}, [tpCandidate("c1", "tp_stripe")], {
|
|
367
|
+
provider: "openai",
|
|
368
|
+
model: "gpt-4o-mini",
|
|
369
|
+
apiKey: "sk-test",
|
|
370
|
+
toolLoopMaxRounds: 1,
|
|
371
|
+
});
|
|
372
|
+
const heuristic = out.proposals.find((item) => item.id.startsWith("heuristic_"));
|
|
373
|
+
expect(heuristic).toBeDefined();
|
|
374
|
+
expect(heuristic?.proposal.kind).toBe("component_patch");
|
|
375
|
+
if (heuristic?.proposal.kind === "component_patch") {
|
|
376
|
+
expect(Object.keys(heuristic.proposal.setProperties).length).toBeGreaterThan(0);
|
|
377
|
+
expect(heuristic.proposal.evidence.length).toBeGreaterThan(0);
|
|
378
|
+
expect(heuristic.proposal.provider).toBe("mock");
|
|
379
|
+
expect(heuristic.proposal.agent).toBe("tpAgent");
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
it("persists agentic trace for tp tool loop runs", async () => {
|
|
383
|
+
inferSpy.mockResolvedValue({ proposals: [] });
|
|
384
|
+
const components = [
|
|
385
|
+
{
|
|
386
|
+
id: "tp_trace",
|
|
387
|
+
name: "Stripe",
|
|
388
|
+
type: "third_party",
|
|
389
|
+
confidence: 0.9,
|
|
390
|
+
detectedFrom: [],
|
|
391
|
+
sourceLocations: [{ filePath: "src/payments.ts", startLine: 1, endLine: 1 }],
|
|
392
|
+
properties: { vendor: null },
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
const out = await (0, agent_orchestrator_1.generateAgenticProposals)({
|
|
396
|
+
components,
|
|
397
|
+
dataFlows: [],
|
|
398
|
+
files: [
|
|
399
|
+
{
|
|
400
|
+
path: "src/payments.ts",
|
|
401
|
+
name: "payments.ts",
|
|
402
|
+
language: "typescript",
|
|
403
|
+
size: 64,
|
|
404
|
+
content: 'import x from "./client";\nexport const payments = true;',
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
}, {
|
|
408
|
+
queues: [
|
|
409
|
+
{
|
|
410
|
+
agent: "tpAgent",
|
|
411
|
+
queue: [tpCandidate("c_trace", "tp_trace")],
|
|
412
|
+
budgetTokens: 100_000,
|
|
413
|
+
maxModelCalls: 1,
|
|
414
|
+
},
|
|
415
|
+
],
|
|
416
|
+
droppedCandidates: [],
|
|
417
|
+
}, [tpCandidate("c_trace", "tp_trace")], {
|
|
418
|
+
provider: "openai",
|
|
419
|
+
model: "gpt-4o-mini",
|
|
420
|
+
apiKey: "sk-test",
|
|
421
|
+
toolLoopMaxRounds: 1,
|
|
422
|
+
});
|
|
423
|
+
expect(out.usageSummary?.agenticTrace).toBeDefined();
|
|
424
|
+
expect(out.usageSummary?.agenticTrace?.length).toBe(1);
|
|
425
|
+
expect(out.usageSummary?.agenticTrace?.[0]?.toolCalls.length).toBeGreaterThan(0);
|
|
426
|
+
});
|
|
427
|
+
it("deduplicates repeated search hits and prefers unseen files", async () => {
|
|
428
|
+
inferSpy.mockResolvedValue({ proposals: [] });
|
|
429
|
+
const components = [
|
|
430
|
+
{
|
|
431
|
+
id: "tp_search_dedupe",
|
|
432
|
+
name: "Supabase",
|
|
433
|
+
type: "third_party",
|
|
434
|
+
confidence: 0.9,
|
|
435
|
+
detectedFrom: [],
|
|
436
|
+
sourceLocations: [{ filePath: "src/a.ts", startLine: 1, endLine: 1 }],
|
|
437
|
+
properties: { vendor: null, section_id: "src" },
|
|
438
|
+
},
|
|
439
|
+
];
|
|
440
|
+
const out = await (0, agent_orchestrator_1.generateAgenticProposals)({
|
|
441
|
+
components,
|
|
442
|
+
dataFlows: [],
|
|
443
|
+
files: [
|
|
444
|
+
{
|
|
445
|
+
path: "src/a.ts",
|
|
446
|
+
name: "a.ts",
|
|
447
|
+
language: "typescript",
|
|
448
|
+
size: 200,
|
|
449
|
+
content: "const one = 'supabase';\nconst two = 'supabase';\nconst three = 'supabase';\n",
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
path: "src/b.ts",
|
|
453
|
+
name: "b.ts",
|
|
454
|
+
language: "typescript",
|
|
455
|
+
size: 120,
|
|
456
|
+
content: "const other = 'supabase';\n",
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
}, {
|
|
460
|
+
queues: [
|
|
461
|
+
{
|
|
462
|
+
agent: "tpAgent",
|
|
463
|
+
queue: [tpCandidate("c_search_dedupe", "tp_search_dedupe")],
|
|
464
|
+
budgetTokens: 100_000,
|
|
465
|
+
maxModelCalls: 1,
|
|
466
|
+
},
|
|
467
|
+
],
|
|
468
|
+
droppedCandidates: [],
|
|
469
|
+
}, [tpCandidate("c_search_dedupe", "tp_search_dedupe")], {
|
|
470
|
+
provider: "openai",
|
|
471
|
+
model: "gpt-4o-mini",
|
|
472
|
+
apiKey: "sk-test",
|
|
473
|
+
toolLoopMaxRounds: 1,
|
|
474
|
+
});
|
|
475
|
+
const trace = out.usageSummary?.agenticTrace?.[0];
|
|
476
|
+
expect(trace).toBeDefined();
|
|
477
|
+
const searchCall = trace?.toolCalls.find((step) => step.action === "search_text");
|
|
478
|
+
expect(searchCall).toBeDefined();
|
|
479
|
+
const touched = searchCall?.filesTouched ?? [];
|
|
480
|
+
expect(new Set(touched).size).toBe(touched.length);
|
|
481
|
+
expect(touched).toContain("src/b.ts");
|
|
482
|
+
});
|
|
483
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const candidate_selector_1 = require("../../../src/ai-enrichment/candidate-selector");
|
|
4
|
+
describe("ai-enrichment candidate selector", () => {
|
|
5
|
+
it("selects third-party, sparse property, flow direction, and missing interaction candidates", () => {
|
|
6
|
+
const sections = [
|
|
7
|
+
{
|
|
8
|
+
id: "frontend",
|
|
9
|
+
label: "frontend",
|
|
10
|
+
role: "service",
|
|
11
|
+
sectionDir: "frontend",
|
|
12
|
+
manifestPaths: ["frontend/package.json"],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "backend",
|
|
16
|
+
label: "backend",
|
|
17
|
+
role: "service",
|
|
18
|
+
sectionDir: "backend",
|
|
19
|
+
manifestPaths: ["backend/package.json"],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
const components = [
|
|
23
|
+
{
|
|
24
|
+
id: "tp_1",
|
|
25
|
+
name: "Stripe",
|
|
26
|
+
type: "third_party",
|
|
27
|
+
confidence: 0.9,
|
|
28
|
+
detectedFrom: [],
|
|
29
|
+
sourceLocations: [],
|
|
30
|
+
properties: { section_id: "backend", dpa_signed: null },
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "app_1",
|
|
34
|
+
name: "Backend",
|
|
35
|
+
type: "asset",
|
|
36
|
+
confidence: 0.95,
|
|
37
|
+
detectedFrom: [],
|
|
38
|
+
sourceLocations: [],
|
|
39
|
+
properties: { section_id: "backend", encryption_at_rest: null },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "actor_1",
|
|
43
|
+
name: "Customer",
|
|
44
|
+
type: "actor",
|
|
45
|
+
confidence: 0.7,
|
|
46
|
+
detectedFrom: [],
|
|
47
|
+
sourceLocations: [],
|
|
48
|
+
properties: { section_id: "frontend" },
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
const flows = [
|
|
52
|
+
{
|
|
53
|
+
id: "flow_1",
|
|
54
|
+
sourceComponentId: "app_1",
|
|
55
|
+
targetComponentId: "actor_1",
|
|
56
|
+
type: "api_call",
|
|
57
|
+
confidence: 0.6,
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({ components, dataFlows: flows, sections });
|
|
61
|
+
const candidateTypes = candidates.map((candidate) => candidate.candidateType);
|
|
62
|
+
expect(candidateTypes).toContain("third_party");
|
|
63
|
+
expect(candidateTypes).toContain("node_property");
|
|
64
|
+
expect(candidateTypes).toContain("flow_direction");
|
|
65
|
+
expect(candidateTypes).toContain("missing_interaction");
|
|
66
|
+
});
|
|
67
|
+
it("third_party_only returns one third_party candidate per third-party and skips assets", () => {
|
|
68
|
+
const components = [
|
|
69
|
+
{
|
|
70
|
+
id: "tp_a",
|
|
71
|
+
name: "Stripe",
|
|
72
|
+
type: "third_party",
|
|
73
|
+
confidence: 0.9,
|
|
74
|
+
detectedFrom: [],
|
|
75
|
+
sourceLocations: [],
|
|
76
|
+
properties: { section_id: "backend", subType: "payments" },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "tp_b",
|
|
80
|
+
name: "Sentry",
|
|
81
|
+
type: "third_party",
|
|
82
|
+
confidence: 0.85,
|
|
83
|
+
detectedFrom: [],
|
|
84
|
+
sourceLocations: [],
|
|
85
|
+
properties: { section_id: "backend" },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "app_1",
|
|
89
|
+
name: "API",
|
|
90
|
+
type: "asset",
|
|
91
|
+
confidence: 0.95,
|
|
92
|
+
detectedFrom: [],
|
|
93
|
+
sourceLocations: [],
|
|
94
|
+
properties: { section_id: "backend", encryption_at_rest: null },
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
const candidates = (0, candidate_selector_1.selectInferenceCandidates)({
|
|
98
|
+
components,
|
|
99
|
+
dataFlows: [],
|
|
100
|
+
inferenceScope: "third_party_only",
|
|
101
|
+
});
|
|
102
|
+
expect(candidates).toHaveLength(2);
|
|
103
|
+
expect(candidates.every((c) => c.candidateType === "third_party")).toBe(true);
|
|
104
|
+
expect(new Set(candidates.map((c) => c.componentId))).toEqual(new Set(["tp_a", "tp_b"]));
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const providers_1 = require("../../../src/ai-enrichment/providers");
|
|
4
|
+
const chat_completions_family_1 = require("../../../src/ai-enrichment/providers/families/chat-completions-family");
|
|
5
|
+
const messages_family_1 = require("../../../src/ai-enrichment/providers/families/messages-family");
|
|
6
|
+
const generate_content_family_1 = require("../../../src/ai-enrichment/providers/families/generate-content-family");
|
|
7
|
+
const ollama_generate_family_1 = require("../../../src/ai-enrichment/providers/families/ollama-generate-family");
|
|
8
|
+
const mock_1 = require("../../../src/ai-enrichment/providers/mock");
|
|
9
|
+
describe("createAiProvider", () => {
|
|
10
|
+
it("returns chat-completions family for openai preset", () => {
|
|
11
|
+
expect((0, providers_1.createAiProvider)("openai")).toBeInstanceOf(chat_completions_family_1.ChatCompletionsFamilyProvider);
|
|
12
|
+
expect((0, providers_1.createAiProvider)("openai").id).toBe("openai");
|
|
13
|
+
});
|
|
14
|
+
it("returns chat-completions family for openrouter preset", () => {
|
|
15
|
+
const p = (0, providers_1.createAiProvider)("openrouter");
|
|
16
|
+
expect(p).toBeInstanceOf(chat_completions_family_1.ChatCompletionsFamilyProvider);
|
|
17
|
+
expect(p.id).toBe("openrouter");
|
|
18
|
+
});
|
|
19
|
+
it("returns messages family for anthropic preset", () => {
|
|
20
|
+
expect((0, providers_1.createAiProvider)("anthropic")).toBeInstanceOf(messages_family_1.MessagesFamilyProvider);
|
|
21
|
+
});
|
|
22
|
+
it("returns generate-content family for gemini preset", () => {
|
|
23
|
+
expect((0, providers_1.createAiProvider)("gemini")).toBeInstanceOf(generate_content_family_1.GenerateContentFamilyProvider);
|
|
24
|
+
});
|
|
25
|
+
it("returns ollama-generate family for local preset", () => {
|
|
26
|
+
expect((0, providers_1.createAiProvider)("local")).toBeInstanceOf(ollama_generate_family_1.OllamaGenerateFamilyProvider);
|
|
27
|
+
});
|
|
28
|
+
it("returns mock for mock preset and unknown ids", () => {
|
|
29
|
+
expect((0, providers_1.createAiProvider)("mock")).toBeInstanceOf(mock_1.MockAiProvider);
|
|
30
|
+
expect((0, providers_1.createAiProvider)("not-a-vendor")).toBeInstanceOf(mock_1.MockAiProvider);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const endpoint_resolution_1 = require("../../../src/ai-enrichment/providers/endpoint-resolution");
|
|
4
|
+
const presets_1 = require("../../../src/ai-enrichment/providers/presets");
|
|
5
|
+
describe("endpoint-resolution", () => {
|
|
6
|
+
const openaiDefault = presets_1.AI_PROVIDER_PRESETS.openai.defaultEndpoint;
|
|
7
|
+
const geminiDefault = presets_1.AI_PROVIDER_PRESETS.gemini.defaultEndpoint;
|
|
8
|
+
describe("resolveChatCompletionsEndpoint", () => {
|
|
9
|
+
it("uses preset default when endpoint is empty", () => {
|
|
10
|
+
expect((0, endpoint_resolution_1.resolveChatCompletionsEndpoint)(undefined, openaiDefault)).toBe(openaiDefault);
|
|
11
|
+
expect((0, endpoint_resolution_1.resolveChatCompletionsEndpoint)("", openaiDefault)).toBe(openaiDefault);
|
|
12
|
+
});
|
|
13
|
+
it("rewrites bare api.openai.com host to preset default", () => {
|
|
14
|
+
expect((0, endpoint_resolution_1.resolveChatCompletionsEndpoint)("https://api.openai.com", openaiDefault)).toBe(openaiDefault);
|
|
15
|
+
});
|
|
16
|
+
it("keeps explicit chat/completions URLs", () => {
|
|
17
|
+
const custom = "https://proxy.example/v1/chat/completions";
|
|
18
|
+
expect((0, endpoint_resolution_1.resolveChatCompletionsEndpoint)(custom, openaiDefault)).toBe(custom);
|
|
19
|
+
});
|
|
20
|
+
it("keeps non-OpenAI custom gateways unchanged", () => {
|
|
21
|
+
const groq = "https://api.groq.com/openai/v1/chat/completions";
|
|
22
|
+
expect((0, endpoint_resolution_1.resolveChatCompletionsEndpoint)(groq, openaiDefault)).toBe(groq);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
describe("shouldUseChatCompletionsJsonShim", () => {
|
|
26
|
+
it("returns false for chat/completions URLs", () => {
|
|
27
|
+
expect((0, endpoint_resolution_1.shouldUseChatCompletionsJsonShim)(openaiDefault)).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
it("returns true for legacy shim gateways", () => {
|
|
30
|
+
expect((0, endpoint_resolution_1.shouldUseChatCompletionsJsonShim)("https://custom.gateway/infer")).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe("resolveGeminiGenerateContentEndpoint", () => {
|
|
34
|
+
it("builds URL from preset base and model", () => {
|
|
35
|
+
const url = (0, endpoint_resolution_1.resolveGeminiGenerateContentEndpoint)(undefined, "gemini-1.5-flash", geminiDefault);
|
|
36
|
+
expect(url).toBe("https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent");
|
|
37
|
+
});
|
|
38
|
+
it("appends model to base ending in /models", () => {
|
|
39
|
+
const url = (0, endpoint_resolution_1.resolveGeminiGenerateContentEndpoint)(geminiDefault, "gemini-pro", geminiDefault);
|
|
40
|
+
expect(url).toContain("/models/gemini-pro:generateContent");
|
|
41
|
+
});
|
|
42
|
+
it("returns full URL when :generateContent already present", () => {
|
|
43
|
+
const full = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent";
|
|
44
|
+
expect((0, endpoint_resolution_1.resolveGeminiGenerateContentEndpoint)(full, "ignored", geminiDefault)).toBe(full);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|