zedbee 0.1.0-beta.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/DISCLOSURE +19 -0
- package/LICENSE +121 -0
- package/README.md +91 -0
- package/SECURITY.md +47 -0
- package/THIRD_PARTY_NOTICES.md +18244 -0
- package/dist/attribution/compare.d.ts +16 -0
- package/dist/attribution/compare.d.ts.map +1 -0
- package/dist/attribution/compare.js +159 -0
- package/dist/attribution/compare.js.map +1 -0
- package/dist/attribution/entities.d.ts +11 -0
- package/dist/attribution/entities.d.ts.map +1 -0
- package/dist/attribution/entities.js +349 -0
- package/dist/attribution/entities.js.map +1 -0
- package/dist/attribution/fingerprint.d.ts +18 -0
- package/dist/attribution/fingerprint.d.ts.map +1 -0
- package/dist/attribution/fingerprint.js +340 -0
- package/dist/attribution/fingerprint.js.map +1 -0
- package/dist/attribution/metrics.d.ts +8 -0
- package/dist/attribution/metrics.d.ts.map +1 -0
- package/dist/attribution/metrics.js +196 -0
- package/dist/attribution/metrics.js.map +1 -0
- package/dist/attribution/range.d.ts +4 -0
- package/dist/attribution/range.d.ts.map +1 -0
- package/dist/attribution/range.js +32 -0
- package/dist/attribution/range.js.map +1 -0
- package/dist/cache/captured-dependencies.d.ts +50 -0
- package/dist/cache/captured-dependencies.d.ts.map +1 -0
- package/dist/cache/captured-dependencies.js +479 -0
- package/dist/cache/captured-dependencies.js.map +1 -0
- package/dist/cache/dependency-inputs.d.ts +38 -0
- package/dist/cache/dependency-inputs.d.ts.map +1 -0
- package/dist/cache/dependency-inputs.js +151 -0
- package/dist/cache/dependency-inputs.js.map +1 -0
- package/dist/cache/key.d.ts +42 -0
- package/dist/cache/key.d.ts.map +1 -0
- package/dist/cache/key.js +197 -0
- package/dist/cache/key.js.map +1 -0
- package/dist/cache/store.d.ts +35 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +177 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/checks/adapter.d.ts +96 -0
- package/dist/checks/adapter.d.ts.map +1 -0
- package/dist/checks/adapter.js +2 -0
- package/dist/checks/adapter.js.map +1 -0
- package/dist/checks/analysis-reuse.d.ts +14 -0
- package/dist/checks/analysis-reuse.d.ts.map +1 -0
- package/dist/checks/analysis-reuse.js +123 -0
- package/dist/checks/analysis-reuse.js.map +1 -0
- package/dist/checks/applicability.d.ts +7 -0
- package/dist/checks/applicability.d.ts.map +1 -0
- package/dist/checks/applicability.js +121 -0
- package/dist/checks/applicability.js.map +1 -0
- package/dist/checks/complexity/adapter.d.ts +7 -0
- package/dist/checks/complexity/adapter.d.ts.map +1 -0
- package/dist/checks/complexity/adapter.js +206 -0
- package/dist/checks/complexity/adapter.js.map +1 -0
- package/dist/checks/complexity/metric-message.d.ts +7 -0
- package/dist/checks/complexity/metric-message.d.ts.map +1 -0
- package/dist/checks/complexity/metric-message.js +16 -0
- package/dist/checks/complexity/metric-message.js.map +1 -0
- package/dist/checks/complexity/readability-rule.d.ts +5 -0
- package/dist/checks/complexity/readability-rule.d.ts.map +1 -0
- package/dist/checks/complexity/readability-rule.js +110 -0
- package/dist/checks/complexity/readability-rule.js.map +1 -0
- package/dist/checks/configuration-presentation.d.ts +8 -0
- package/dist/checks/configuration-presentation.d.ts.map +1 -0
- package/dist/checks/configuration-presentation.js +94 -0
- package/dist/checks/configuration-presentation.js.map +1 -0
- package/dist/checks/dead-code/adapter.d.ts +3 -0
- package/dist/checks/dead-code/adapter.d.ts.map +1 -0
- package/dist/checks/dead-code/adapter.js +218 -0
- package/dist/checks/dead-code/adapter.js.map +1 -0
- package/dist/checks/dead-code/captured-filesystem.d.ts +12 -0
- package/dist/checks/dead-code/captured-filesystem.d.ts.map +1 -0
- package/dist/checks/dead-code/captured-filesystem.js +138 -0
- package/dist/checks/dead-code/captured-filesystem.js.map +1 -0
- package/dist/checks/dead-code/executor.d.ts +21 -0
- package/dist/checks/dead-code/executor.d.ts.map +1 -0
- package/dist/checks/dead-code/executor.js +78 -0
- package/dist/checks/dead-code/executor.js.map +1 -0
- package/dist/checks/dead-code/import-boundary.d.ts +14 -0
- package/dist/checks/dead-code/import-boundary.d.ts.map +1 -0
- package/dist/checks/dead-code/import-boundary.js +256 -0
- package/dist/checks/dead-code/import-boundary.js.map +1 -0
- package/dist/checks/dead-code/knip-worker.d.ts +2 -0
- package/dist/checks/dead-code/knip-worker.d.ts.map +1 -0
- package/dist/checks/dead-code/knip-worker.js +169 -0
- package/dist/checks/dead-code/knip-worker.js.map +1 -0
- package/dist/checks/dead-code/managed-config.d.ts +13 -0
- package/dist/checks/dead-code/managed-config.d.ts.map +1 -0
- package/dist/checks/dead-code/managed-config.js +128 -0
- package/dist/checks/dead-code/managed-config.js.map +1 -0
- package/dist/checks/dead-code/parse-report.d.ts +3 -0
- package/dist/checks/dead-code/parse-report.d.ts.map +1 -0
- package/dist/checks/dead-code/parse-report.js +107 -0
- package/dist/checks/dead-code/parse-report.js.map +1 -0
- package/dist/checks/dead-code/resolver.LICENSE +22 -0
- package/dist/checks/dead-code/resolver.provenance.json +10 -0
- package/dist/checks/dead-code/resolver.wasm +0 -0
- package/dist/checks/dead-code/wasi.d.ts +9 -0
- package/dist/checks/dead-code/wasi.d.ts.map +1 -0
- package/dist/checks/dead-code/wasi.js +101 -0
- package/dist/checks/dead-code/wasi.js.map +1 -0
- package/dist/checks/dependency-architecture/adapter.d.ts +3 -0
- package/dist/checks/dependency-architecture/adapter.d.ts.map +1 -0
- package/dist/checks/dependency-architecture/adapter.js +305 -0
- package/dist/checks/dependency-architecture/adapter.js.map +1 -0
- package/dist/checks/dependency-architecture/normalize-graph.d.ts +11 -0
- package/dist/checks/dependency-architecture/normalize-graph.d.ts.map +1 -0
- package/dist/checks/dependency-architecture/normalize-graph.js +225 -0
- package/dist/checks/dependency-architecture/normalize-graph.js.map +1 -0
- package/dist/checks/dependency-architecture/rules.d.ts +11 -0
- package/dist/checks/dependency-architecture/rules.d.ts.map +1 -0
- package/dist/checks/dependency-architecture/rules.js +47 -0
- package/dist/checks/dependency-architecture/rules.js.map +1 -0
- package/dist/checks/description.d.ts +41 -0
- package/dist/checks/description.d.ts.map +1 -0
- package/dist/checks/description.js +2 -0
- package/dist/checks/description.js.map +1 -0
- package/dist/checks/descriptors.d.ts +7 -0
- package/dist/checks/descriptors.d.ts.map +1 -0
- package/dist/checks/descriptors.js +50 -0
- package/dist/checks/descriptors.js.map +1 -0
- package/dist/checks/diagnostics.d.ts +25 -0
- package/dist/checks/diagnostics.d.ts.map +1 -0
- package/dist/checks/diagnostics.js +106 -0
- package/dist/checks/diagnostics.js.map +1 -0
- package/dist/checks/dispatcher.d.ts +18 -0
- package/dist/checks/dispatcher.d.ts.map +1 -0
- package/dist/checks/dispatcher.js +789 -0
- package/dist/checks/dispatcher.js.map +1 -0
- package/dist/checks/duplication/adapter.d.ts +9 -0
- package/dist/checks/duplication/adapter.d.ts.map +1 -0
- package/dist/checks/duplication/adapter.js +155 -0
- package/dist/checks/duplication/adapter.js.map +1 -0
- package/dist/checks/duplication/normalize-clone.d.ts +12 -0
- package/dist/checks/duplication/normalize-clone.d.ts.map +1 -0
- package/dist/checks/duplication/normalize-clone.js +190 -0
- package/dist/checks/duplication/normalize-clone.js.map +1 -0
- package/dist/checks/duplication/settings.d.ts +16 -0
- package/dist/checks/duplication/settings.d.ts.map +1 -0
- package/dist/checks/duplication/settings.js +32 -0
- package/dist/checks/duplication/settings.js.map +1 -0
- package/dist/checks/duplication/types.d.ts +53 -0
- package/dist/checks/duplication/types.d.ts.map +1 -0
- package/dist/checks/duplication/types.js +2 -0
- package/dist/checks/duplication/types.js.map +1 -0
- package/dist/checks/engine-identity.d.ts +5 -0
- package/dist/checks/engine-identity.d.ts.map +1 -0
- package/dist/checks/engine-identity.js +130 -0
- package/dist/checks/engine-identity.js.map +1 -0
- package/dist/checks/eslint/comment-directive.d.ts +3 -0
- package/dist/checks/eslint/comment-directive.d.ts.map +1 -0
- package/dist/checks/eslint/comment-directive.js +39 -0
- package/dist/checks/eslint/comment-directive.js.map +1 -0
- package/dist/checks/eslint/convert-message.d.ts +4 -0
- package/dist/checks/eslint/convert-message.d.ts.map +1 -0
- package/dist/checks/eslint/convert-message.js +67 -0
- package/dist/checks/eslint/convert-message.js.map +1 -0
- package/dist/checks/eslint/freeze-rule-settings.d.ts +4 -0
- package/dist/checks/eslint/freeze-rule-settings.d.ts.map +1 -0
- package/dist/checks/eslint/freeze-rule-settings.js +19 -0
- package/dist/checks/eslint/freeze-rule-settings.js.map +1 -0
- package/dist/checks/eslint/lint-adapter.d.ts +8 -0
- package/dist/checks/eslint/lint-adapter.d.ts.map +1 -0
- package/dist/checks/eslint/lint-adapter.js +227 -0
- package/dist/checks/eslint/lint-adapter.js.map +1 -0
- package/dist/checks/eslint/load-engine.d.ts +7 -0
- package/dist/checks/eslint/load-engine.d.ts.map +1 -0
- package/dist/checks/eslint/load-engine.js +126 -0
- package/dist/checks/eslint/load-engine.js.map +1 -0
- package/dist/checks/eslint/managed-config.d.ts +27 -0
- package/dist/checks/eslint/managed-config.d.ts.map +1 -0
- package/dist/checks/eslint/managed-config.js +223 -0
- package/dist/checks/eslint/managed-config.js.map +1 -0
- package/dist/checks/eslint/parse-store.d.ts +13 -0
- package/dist/checks/eslint/parse-store.d.ts.map +1 -0
- package/dist/checks/eslint/parse-store.js +138 -0
- package/dist/checks/eslint/parse-store.js.map +1 -0
- package/dist/checks/eslint/rule-settings.d.ts +15 -0
- package/dist/checks/eslint/rule-settings.d.ts.map +1 -0
- package/dist/checks/eslint/rule-settings.js +317 -0
- package/dist/checks/eslint/rule-settings.js.map +1 -0
- package/dist/checks/events.d.ts +27 -0
- package/dist/checks/events.d.ts.map +1 -0
- package/dist/checks/events.js +2 -0
- package/dist/checks/events.js.map +1 -0
- package/dist/checks/incomplete-error.d.ts +26 -0
- package/dist/checks/incomplete-error.d.ts.map +1 -0
- package/dist/checks/incomplete-error.js +53 -0
- package/dist/checks/incomplete-error.js.map +1 -0
- package/dist/checks/incomplete-result.d.ts +17 -0
- package/dist/checks/incomplete-result.d.ts.map +1 -0
- package/dist/checks/incomplete-result.js +27 -0
- package/dist/checks/incomplete-result.js.map +1 -0
- package/dist/checks/input-contract.d.ts +10 -0
- package/dist/checks/input-contract.d.ts.map +1 -0
- package/dist/checks/input-contract.js +85 -0
- package/dist/checks/input-contract.js.map +1 -0
- package/dist/checks/metadata.d.ts +71 -0
- package/dist/checks/metadata.d.ts.map +1 -0
- package/dist/checks/metadata.js +34 -0
- package/dist/checks/metadata.js.map +1 -0
- package/dist/checks/observation-result.d.ts +4 -0
- package/dist/checks/observation-result.d.ts.map +1 -0
- package/dist/checks/observation-result.js +242 -0
- package/dist/checks/observation-result.js.map +1 -0
- package/dist/checks/policy-scheduling.d.ts +9 -0
- package/dist/checks/policy-scheduling.d.ts.map +1 -0
- package/dist/checks/policy-scheduling.js +116 -0
- package/dist/checks/policy-scheduling.js.map +1 -0
- package/dist/checks/prettier/adapter.d.ts +3 -0
- package/dist/checks/prettier/adapter.d.ts.map +1 -0
- package/dist/checks/prettier/adapter.js +174 -0
- package/dist/checks/prettier/adapter.js.map +1 -0
- package/dist/checks/prettier/fingerprint.d.ts +2 -0
- package/dist/checks/prettier/fingerprint.d.ts.map +1 -0
- package/dist/checks/prettier/fingerprint.js +7 -0
- package/dist/checks/prettier/fingerprint.js.map +1 -0
- package/dist/checks/prettier/format-diff.d.ts +9 -0
- package/dist/checks/prettier/format-diff.d.ts.map +1 -0
- package/dist/checks/prettier/format-diff.js +180 -0
- package/dist/checks/prettier/format-diff.js.map +1 -0
- package/dist/checks/prettier/settings.d.ts +43 -0
- package/dist/checks/prettier/settings.d.ts.map +1 -0
- package/dist/checks/prettier/settings.js +76 -0
- package/dist/checks/prettier/settings.js.map +1 -0
- package/dist/checks/prettier/supported-path.d.ts +19 -0
- package/dist/checks/prettier/supported-path.d.ts.map +1 -0
- package/dist/checks/prettier/supported-path.js +21 -0
- package/dist/checks/prettier/supported-path.js.map +1 -0
- package/dist/checks/project/config-boundary.d.ts +16 -0
- package/dist/checks/project/config-boundary.d.ts.map +1 -0
- package/dist/checks/project/config-boundary.js +249 -0
- package/dist/checks/project/config-boundary.js.map +1 -0
- package/dist/checks/react/accessibility-adapter.d.ts +2 -0
- package/dist/checks/react/accessibility-adapter.d.ts.map +1 -0
- package/dist/checks/react/accessibility-adapter.js +3 -0
- package/dist/checks/react/accessibility-adapter.js.map +1 -0
- package/dist/checks/react/adapter.d.ts +11 -0
- package/dist/checks/react/adapter.d.ts.map +1 -0
- package/dist/checks/react/adapter.js +181 -0
- package/dist/checks/react/adapter.js.map +1 -0
- package/dist/checks/react/config.d.ts +4 -0
- package/dist/checks/react/config.d.ts.map +1 -0
- package/dist/checks/react/config.js +31 -0
- package/dist/checks/react/config.js.map +1 -0
- package/dist/checks/react/correctness-adapter.d.ts +2 -0
- package/dist/checks/react/correctness-adapter.d.ts.map +1 -0
- package/dist/checks/react/correctness-adapter.js +3 -0
- package/dist/checks/react/correctness-adapter.js.map +1 -0
- package/dist/checks/react/rule-settings.d.ts +2 -0
- package/dist/checks/react/rule-settings.d.ts.map +1 -0
- package/dist/checks/react/rule-settings.js +2 -0
- package/dist/checks/react/rule-settings.js.map +1 -0
- package/dist/checks/react/version.d.ts +13 -0
- package/dist/checks/react/version.d.ts.map +1 -0
- package/dist/checks/react/version.js +152 -0
- package/dist/checks/react/version.js.map +1 -0
- package/dist/checks/runner/bootstrap.d.ts +2 -0
- package/dist/checks/runner/bootstrap.d.ts.map +1 -0
- package/dist/checks/runner/bootstrap.js +30 -0
- package/dist/checks/runner/bootstrap.js.map +1 -0
- package/dist/checks/runner/context.d.ts +16 -0
- package/dist/checks/runner/context.d.ts.map +1 -0
- package/dist/checks/runner/context.js +38 -0
- package/dist/checks/runner/context.js.map +1 -0
- package/dist/checks/runner/envelope.d.ts +23 -0
- package/dist/checks/runner/envelope.d.ts.map +1 -0
- package/dist/checks/runner/envelope.js +134 -0
- package/dist/checks/runner/envelope.js.map +1 -0
- package/dist/checks/runner/executor.d.ts +29 -0
- package/dist/checks/runner/executor.d.ts.map +1 -0
- package/dist/checks/runner/executor.js +322 -0
- package/dist/checks/runner/executor.js.map +1 -0
- package/dist/checks/runner/exit-status.d.ts +10 -0
- package/dist/checks/runner/exit-status.d.ts.map +1 -0
- package/dist/checks/runner/exit-status.js +14 -0
- package/dist/checks/runner/exit-status.js.map +1 -0
- package/dist/checks/runner/process-group.d.ts +7 -0
- package/dist/checks/runner/process-group.d.ts.map +1 -0
- package/dist/checks/runner/process-group.js +54 -0
- package/dist/checks/runner/process-group.js.map +1 -0
- package/dist/checks/runner/protocol.d.ts +33 -0
- package/dist/checks/runner/protocol.d.ts.map +1 -0
- package/dist/checks/runner/protocol.js +120 -0
- package/dist/checks/runner/protocol.js.map +1 -0
- package/dist/checks/runner/registry.d.ts +5 -0
- package/dist/checks/runner/registry.d.ts.map +1 -0
- package/dist/checks/runner/registry.js +39 -0
- package/dist/checks/runner/registry.js.map +1 -0
- package/dist/checks/runner/run-job.d.ts +8 -0
- package/dist/checks/runner/run-job.d.ts.map +1 -0
- package/dist/checks/runner/run-job.js +16 -0
- package/dist/checks/runner/run-job.js.map +1 -0
- package/dist/checks/runner/send-worker-reply.d.ts +4 -0
- package/dist/checks/runner/send-worker-reply.d.ts.map +1 -0
- package/dist/checks/runner/send-worker-reply.js +11 -0
- package/dist/checks/runner/send-worker-reply.js.map +1 -0
- package/dist/checks/runner/session.d.ts +8 -0
- package/dist/checks/runner/session.d.ts.map +1 -0
- package/dist/checks/runner/session.js +18 -0
- package/dist/checks/runner/session.js.map +1 -0
- package/dist/checks/runner/supervisor.d.ts +2 -0
- package/dist/checks/runner/supervisor.d.ts.map +1 -0
- package/dist/checks/runner/supervisor.js +273 -0
- package/dist/checks/runner/supervisor.js.map +1 -0
- package/dist/checks/runner/windows-job.d.ts +10 -0
- package/dist/checks/runner/windows-job.d.ts.map +1 -0
- package/dist/checks/runner/windows-job.js +104 -0
- package/dist/checks/runner/windows-job.js.map +1 -0
- package/dist/checks/runner/worker-slot.d.ts +75 -0
- package/dist/checks/runner/worker-slot.d.ts.map +1 -0
- package/dist/checks/runner/worker-slot.js +375 -0
- package/dist/checks/runner/worker-slot.js.map +1 -0
- package/dist/checks/runner/worker.d.ts +2 -0
- package/dist/checks/runner/worker.d.ts.map +1 -0
- package/dist/checks/runner/worker.js +212 -0
- package/dist/checks/runner/worker.js.map +1 -0
- package/dist/checks/sanitize-result.d.ts +73 -0
- package/dist/checks/sanitize-result.d.ts.map +1 -0
- package/dist/checks/sanitize-result.js +281 -0
- package/dist/checks/sanitize-result.js.map +1 -0
- package/dist/checks/sanitize-target.d.ts +8 -0
- package/dist/checks/sanitize-target.d.ts.map +1 -0
- package/dist/checks/sanitize-target.js +26 -0
- package/dist/checks/sanitize-target.js.map +1 -0
- package/dist/checks/secrets/adapter.d.ts +9 -0
- package/dist/checks/secrets/adapter.d.ts.map +1 -0
- package/dist/checks/secrets/adapter.js +86 -0
- package/dist/checks/secrets/adapter.js.map +1 -0
- package/dist/checks/secrets/config.d.ts +3 -0
- package/dist/checks/secrets/config.d.ts.map +1 -0
- package/dist/checks/secrets/config.js +13 -0
- package/dist/checks/secrets/config.js.map +1 -0
- package/dist/checks/secrets/content.d.ts +25 -0
- package/dist/checks/secrets/content.d.ts.map +1 -0
- package/dist/checks/secrets/content.js +126 -0
- package/dist/checks/secrets/content.js.map +1 -0
- package/dist/checks/secrets/normalize.d.ts +11 -0
- package/dist/checks/secrets/normalize.d.ts.map +1 -0
- package/dist/checks/secrets/normalize.js +61 -0
- package/dist/checks/secrets/normalize.js.map +1 -0
- package/dist/checks/settle-snapshot-sides.d.ts +2 -0
- package/dist/checks/settle-snapshot-sides.d.ts.map +1 -0
- package/dist/checks/settle-snapshot-sides.js +30 -0
- package/dist/checks/settle-snapshot-sides.js.map +1 -0
- package/dist/checks/structural-security/adapter.d.ts +3 -0
- package/dist/checks/structural-security/adapter.d.ts.map +1 -0
- package/dist/checks/structural-security/adapter.js +112 -0
- package/dist/checks/structural-security/adapter.js.map +1 -0
- package/dist/checks/structural-security/fingerprint.d.ts +3 -0
- package/dist/checks/structural-security/fingerprint.d.ts.map +1 -0
- package/dist/checks/structural-security/fingerprint.js +13 -0
- package/dist/checks/structural-security/fingerprint.js.map +1 -0
- package/dist/checks/structural-security/rules.d.ts +11 -0
- package/dist/checks/structural-security/rules.d.ts.map +1 -0
- package/dist/checks/structural-security/rules.js +377 -0
- package/dist/checks/structural-security/rules.js.map +1 -0
- package/dist/checks/typescript/adapter.d.ts +11 -0
- package/dist/checks/typescript/adapter.d.ts.map +1 -0
- package/dist/checks/typescript/adapter.js +71 -0
- package/dist/checks/typescript/adapter.js.map +1 -0
- package/dist/checks/typescript/compiler-host.d.ts +20 -0
- package/dist/checks/typescript/compiler-host.d.ts.map +1 -0
- package/dist/checks/typescript/compiler-host.js +295 -0
- package/dist/checks/typescript/compiler-host.js.map +1 -0
- package/dist/checks/typescript/config.d.ts +10 -0
- package/dist/checks/typescript/config.d.ts.map +1 -0
- package/dist/checks/typescript/config.js +297 -0
- package/dist/checks/typescript/config.js.map +1 -0
- package/dist/checks/typescript/convert-diagnostic.d.ts +4 -0
- package/dist/checks/typescript/convert-diagnostic.d.ts.map +1 -0
- package/dist/checks/typescript/convert-diagnostic.js +79 -0
- package/dist/checks/typescript/convert-diagnostic.js.map +1 -0
- package/dist/checks/typescript/reuse-inputs.d.ts +7 -0
- package/dist/checks/typescript/reuse-inputs.d.ts.map +1 -0
- package/dist/checks/typescript/reuse-inputs.js +31 -0
- package/dist/checks/typescript/reuse-inputs.js.map +1 -0
- package/dist/checks/vulnerabilities/adapter.d.ts +10 -0
- package/dist/checks/vulnerabilities/adapter.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/adapter.js +97 -0
- package/dist/checks/vulnerabilities/adapter.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/errors.d.ts +8 -0
- package/dist/checks/vulnerabilities/inventory/errors.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/errors.js +18 -0
- package/dist/checks/vulnerabilities/inventory/errors.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/limits.d.ts +9 -0
- package/dist/checks/vulnerabilities/inventory/limits.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/limits.js +9 -0
- package/dist/checks/vulnerabilities/inventory/limits.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/normalize.d.ts +7 -0
- package/dist/checks/vulnerabilities/inventory/normalize.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/normalize.js +89 -0
- package/dist/checks/vulnerabilities/inventory/normalize.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-bun.d.ts +3 -0
- package/dist/checks/vulnerabilities/inventory/parse-bun.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-bun.js +70 -0
- package/dist/checks/vulnerabilities/inventory/parse-bun.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-lockfile.d.ts +4 -0
- package/dist/checks/vulnerabilities/inventory/parse-lockfile.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-lockfile.js +55 -0
- package/dist/checks/vulnerabilities/inventory/parse-lockfile.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-npm.d.ts +3 -0
- package/dist/checks/vulnerabilities/inventory/parse-npm.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-npm.js +216 -0
- package/dist/checks/vulnerabilities/inventory/parse-npm.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-pnpm.d.ts +3 -0
- package/dist/checks/vulnerabilities/inventory/parse-pnpm.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-pnpm.js +133 -0
- package/dist/checks/vulnerabilities/inventory/parse-pnpm.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-yarn.d.ts +3 -0
- package/dist/checks/vulnerabilities/inventory/parse-yarn.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/parse-yarn.js +125 -0
- package/dist/checks/vulnerabilities/inventory/parse-yarn.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/source-position.d.ts +5 -0
- package/dist/checks/vulnerabilities/inventory/source-position.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/source-position.js +22 -0
- package/dist/checks/vulnerabilities/inventory/source-position.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/types.d.ts +11 -0
- package/dist/checks/vulnerabilities/inventory/types.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/types.js +2 -0
- package/dist/checks/vulnerabilities/inventory/types.js.map +1 -0
- package/dist/checks/vulnerabilities/inventory/validate-structure.d.ts +2 -0
- package/dist/checks/vulnerabilities/inventory/validate-structure.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/inventory/validate-structure.js +34 -0
- package/dist/checks/vulnerabilities/inventory/validate-structure.js.map +1 -0
- package/dist/checks/vulnerabilities/normalize.d.ts +5 -0
- package/dist/checks/vulnerabilities/normalize.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/normalize.js +59 -0
- package/dist/checks/vulnerabilities/normalize.js.map +1 -0
- package/dist/checks/vulnerabilities/osv/client.d.ts +15 -0
- package/dist/checks/vulnerabilities/osv/client.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/osv/client.js +229 -0
- package/dist/checks/vulnerabilities/osv/client.js.map +1 -0
- package/dist/checks/vulnerabilities/osv/errors.d.ts +11 -0
- package/dist/checks/vulnerabilities/osv/errors.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/osv/errors.js +19 -0
- package/dist/checks/vulnerabilities/osv/errors.js.map +1 -0
- package/dist/checks/vulnerabilities/osv/read-response.d.ts +3 -0
- package/dist/checks/vulnerabilities/osv/read-response.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/osv/read-response.js +50 -0
- package/dist/checks/vulnerabilities/osv/read-response.js.map +1 -0
- package/dist/checks/vulnerabilities/osv/schemas.d.ts +41 -0
- package/dist/checks/vulnerabilities/osv/schemas.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/osv/schemas.js +50 -0
- package/dist/checks/vulnerabilities/osv/schemas.js.map +1 -0
- package/dist/checks/vulnerabilities/osv/types.d.ts +40 -0
- package/dist/checks/vulnerabilities/osv/types.d.ts.map +1 -0
- package/dist/checks/vulnerabilities/osv/types.js +2 -0
- package/dist/checks/vulnerabilities/osv/types.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +289 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/checks.d.ts +32 -0
- package/dist/commands/checks.d.ts.map +1 -0
- package/dist/commands/checks.js +351 -0
- package/dist/commands/checks.js.map +1 -0
- package/dist/commands/diagnostics.d.ts +25 -0
- package/dist/commands/diagnostics.d.ts.map +1 -0
- package/dist/commands/diagnostics.js +82 -0
- package/dist/commands/diagnostics.js.map +1 -0
- package/dist/commands/doctor.d.ts +26 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +84 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/executor.d.ts +4 -0
- package/dist/commands/executor.d.ts.map +1 -0
- package/dist/commands/executor.js +42 -0
- package/dist/commands/executor.js.map +1 -0
- package/dist/commands/fix.d.ts +51 -0
- package/dist/commands/fix.d.ts.map +1 -0
- package/dist/commands/fix.js +462 -0
- package/dist/commands/fix.js.map +1 -0
- package/dist/commands/init.d.ts +40 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +184 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/scan.d.ts +55 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +270 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/service.d.ts +6 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +20 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/config/file-policy.d.ts +10 -0
- package/dist/config/file-policy.d.ts.map +1 -0
- package/dist/config/file-policy.js +72 -0
- package/dist/config/file-policy.js.map +1 -0
- package/dist/config/json-schema.d.ts +4 -0
- package/dist/config/json-schema.d.ts.map +1 -0
- package/dist/config/json-schema.js +129 -0
- package/dist/config/json-schema.js.map +1 -0
- package/dist/config/load-config.d.ts +17 -0
- package/dist/config/load-config.d.ts.map +1 -0
- package/dist/config/load-config.js +406 -0
- package/dist/config/load-config.js.map +1 -0
- package/dist/config/profiles.d.ts +3 -0
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/config/profiles.js +317 -0
- package/dist/config/profiles.js.map +1 -0
- package/dist/config/schema.d.ts +944 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +364 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/settings-definition.d.ts +25 -0
- package/dist/config/settings-definition.d.ts.map +1 -0
- package/dist/config/settings-definition.js +2 -0
- package/dist/config/settings-definition.js.map +1 -0
- package/dist/config/settings-registry.d.ts +19 -0
- package/dist/config/settings-registry.d.ts.map +1 -0
- package/dist/config/settings-registry.js +161 -0
- package/dist/config/settings-registry.js.map +1 -0
- package/dist/config/target-policy.d.ts +8 -0
- package/dist/config/target-policy.d.ts.map +1 -0
- package/dist/config/target-policy.js +58 -0
- package/dist/config/target-policy.js.map +1 -0
- package/dist/core/compare.d.ts +3 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +5 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/display-text.d.ts +13 -0
- package/dist/core/display-text.d.ts.map +1 -0
- package/dist/core/display-text.js +24 -0
- package/dist/core/display-text.js.map +1 -0
- package/dist/core/package-version.d.ts +2 -0
- package/dist/core/package-version.d.ts.map +1 -0
- package/dist/core/package-version.js +14 -0
- package/dist/core/package-version.js.map +1 -0
- package/dist/core/summarize.d.ts +4 -0
- package/dist/core/summarize.d.ts.map +1 -0
- package/dist/core/summarize.js +28 -0
- package/dist/core/summarize.js.map +1 -0
- package/dist/core/types.d.ts +128 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/doctor/diagnostics.d.ts +27 -0
- package/dist/doctor/diagnostics.d.ts.map +1 -0
- package/dist/doctor/diagnostics.js +379 -0
- package/dist/doctor/diagnostics.js.map +1 -0
- package/dist/fixes/apply-plan.d.ts +14 -0
- package/dist/fixes/apply-plan.d.ts.map +1 -0
- package/dist/fixes/apply-plan.js +245 -0
- package/dist/fixes/apply-plan.js.map +1 -0
- package/dist/fixes/availability.d.ts +3 -0
- package/dist/fixes/availability.d.ts.map +1 -0
- package/dist/fixes/availability.js +4 -0
- package/dist/fixes/availability.js.map +1 -0
- package/dist/fixes/build-plan.d.ts +40 -0
- package/dist/fixes/build-plan.d.ts.map +1 -0
- package/dist/fixes/build-plan.js +589 -0
- package/dist/fixes/build-plan.js.map +1 -0
- package/dist/fixes/eslint-provider.d.ts +16 -0
- package/dist/fixes/eslint-provider.d.ts.map +1 -0
- package/dist/fixes/eslint-provider.js +153 -0
- package/dist/fixes/eslint-provider.js.map +1 -0
- package/dist/fixes/exact-edits.d.ts +5 -0
- package/dist/fixes/exact-edits.d.ts.map +1 -0
- package/dist/fixes/exact-edits.js +69 -0
- package/dist/fixes/exact-edits.js.map +1 -0
- package/dist/fixes/prettier-provider.d.ts +18 -0
- package/dist/fixes/prettier-provider.d.ts.map +1 -0
- package/dist/fixes/prettier-provider.js +74 -0
- package/dist/fixes/prettier-provider.js.map +1 -0
- package/dist/fixes/result-presentation.d.ts +9 -0
- package/dist/fixes/result-presentation.d.ts.map +1 -0
- package/dist/fixes/result-presentation.js +20 -0
- package/dist/fixes/result-presentation.js.map +1 -0
- package/dist/fixes/sanitize.d.ts +11 -0
- package/dist/fixes/sanitize.d.ts.map +1 -0
- package/dist/fixes/sanitize.js +217 -0
- package/dist/fixes/sanitize.js.map +1 -0
- package/dist/fixes/types.d.ts +123 -0
- package/dist/fixes/types.d.ts.map +1 -0
- package/dist/fixes/types.js +8 -0
- package/dist/fixes/types.js.map +1 -0
- package/dist/fixes/write-working-file.d.ts +26 -0
- package/dist/fixes/write-working-file.d.ts.map +1 -0
- package/dist/fixes/write-working-file.js +221 -0
- package/dist/fixes/write-working-file.js.map +1 -0
- package/dist/git/base-comparison.d.ts +13 -0
- package/dist/git/base-comparison.d.ts.map +1 -0
- package/dist/git/base-comparison.js +64 -0
- package/dist/git/base-comparison.js.map +1 -0
- package/dist/git/base-ref.d.ts +4 -0
- package/dist/git/base-ref.d.ts.map +1 -0
- package/dist/git/base-ref.js +21 -0
- package/dist/git/base-ref.js.map +1 -0
- package/dist/git/batch-object-stream.d.ts +8 -0
- package/dist/git/batch-object-stream.d.ts.map +1 -0
- package/dist/git/batch-object-stream.js +111 -0
- package/dist/git/batch-object-stream.js.map +1 -0
- package/dist/git/change-set.d.ts +25 -0
- package/dist/git/change-set.d.ts.map +1 -0
- package/dist/git/change-set.js +346 -0
- package/dist/git/change-set.js.map +1 -0
- package/dist/git/client.d.ts +39 -0
- package/dist/git/client.d.ts.map +1 -0
- package/dist/git/client.js +384 -0
- package/dist/git/client.js.map +1 -0
- package/dist/git/errors.d.ts +7 -0
- package/dist/git/errors.d.ts.map +1 -0
- package/dist/git/errors.js +11 -0
- package/dist/git/errors.js.map +1 -0
- package/dist/git/snapshot-path.d.ts +14 -0
- package/dist/git/snapshot-path.d.ts.map +1 -0
- package/dist/git/snapshot-path.js +59 -0
- package/dist/git/snapshot-path.js.map +1 -0
- package/dist/git/snapshot.d.ts +28 -0
- package/dist/git/snapshot.d.ts.map +1 -0
- package/dist/git/snapshot.js +492 -0
- package/dist/git/snapshot.js.map +1 -0
- package/dist/hooks/detect.d.ts +8 -0
- package/dist/hooks/detect.d.ts.map +1 -0
- package/dist/hooks/detect.js +208 -0
- package/dist/hooks/detect.js.map +1 -0
- package/dist/hooks/husky.d.ts +3 -0
- package/dist/hooks/husky.d.ts.map +1 -0
- package/dist/hooks/husky.js +23 -0
- package/dist/hooks/husky.js.map +1 -0
- package/dist/hooks/lefthook.d.ts +3 -0
- package/dist/hooks/lefthook.d.ts.map +1 -0
- package/dist/hooks/lefthook.js +27 -0
- package/dist/hooks/lefthook.js.map +1 -0
- package/dist/hooks/raw-git.d.ts +2 -0
- package/dist/hooks/raw-git.d.ts.map +1 -0
- package/dist/hooks/raw-git.js +5 -0
- package/dist/hooks/raw-git.js.map +1 -0
- package/dist/hooks/simple-git-hooks.d.ts +3 -0
- package/dist/hooks/simple-git-hooks.d.ts.map +1 -0
- package/dist/hooks/simple-git-hooks.js +33 -0
- package/dist/hooks/simple-git-hooks.js.map +1 -0
- package/dist/hooks/state.d.ts +2 -0
- package/dist/hooks/state.d.ts.map +1 -0
- package/dist/hooks/state.js +10 -0
- package/dist/hooks/state.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/init/recommend.d.ts +7 -0
- package/dist/init/recommend.d.ts.map +1 -0
- package/dist/init/recommend.js +274 -0
- package/dist/init/recommend.js.map +1 -0
- package/dist/init/types.d.ts +60 -0
- package/dist/init/types.d.ts.map +1 -0
- package/dist/init/types.js +2 -0
- package/dist/init/types.js.map +1 -0
- package/dist/init/write-config.d.ts +3 -0
- package/dist/init/write-config.d.ts.map +1 -0
- package/dist/init/write-config.js +195 -0
- package/dist/init/write-config.js.map +1 -0
- package/dist/inspection/inspect-repository.d.ts +7 -0
- package/dist/inspection/inspect-repository.d.ts.map +1 -0
- package/dist/inspection/inspect-repository.js +212 -0
- package/dist/inspection/inspect-repository.js.map +1 -0
- package/dist/inspection/read-json.d.ts +37 -0
- package/dist/inspection/read-json.d.ts.map +1 -0
- package/dist/inspection/read-json.js +345 -0
- package/dist/inspection/read-json.js.map +1 -0
- package/dist/inspection/snapshot-registry.d.ts +24 -0
- package/dist/inspection/snapshot-registry.d.ts.map +1 -0
- package/dist/inspection/snapshot-registry.js +174 -0
- package/dist/inspection/snapshot-registry.js.map +1 -0
- package/dist/inspection/source-capture.d.ts +42 -0
- package/dist/inspection/source-capture.d.ts.map +1 -0
- package/dist/inspection/source-capture.js +336 -0
- package/dist/inspection/source-capture.js.map +1 -0
- package/dist/inspection/types.d.ts +31 -0
- package/dist/inspection/types.d.ts.map +1 -0
- package/dist/inspection/types.js +9 -0
- package/dist/inspection/types.js.map +1 -0
- package/dist/inspection/workspaces.d.ts +22 -0
- package/dist/inspection/workspaces.d.ts.map +1 -0
- package/dist/inspection/workspaces.js +209 -0
- package/dist/inspection/workspaces.js.map +1 -0
- package/dist/policy/evaluate.d.ts +13 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +71 -0
- package/dist/policy/evaluate.js.map +1 -0
- package/dist/renderers/incomplete.d.ts +4 -0
- package/dist/renderers/incomplete.d.ts.map +1 -0
- package/dist/renderers/incomplete.js +72 -0
- package/dist/renderers/incomplete.js.map +1 -0
- package/dist/renderers/json.d.ts +3 -0
- package/dist/renderers/json.d.ts.map +1 -0
- package/dist/renderers/json.js +126 -0
- package/dist/renderers/json.js.map +1 -0
- package/dist/renderers/sarif.d.ts +3 -0
- package/dist/renderers/sarif.d.ts.map +1 -0
- package/dist/renderers/sarif.js +222 -0
- package/dist/renderers/sarif.js.map +1 -0
- package/dist/renderers/terminal-cells.d.ts +6 -0
- package/dist/renderers/terminal-cells.d.ts.map +1 -0
- package/dist/renderers/terminal-cells.js +110 -0
- package/dist/renderers/terminal-cells.js.map +1 -0
- package/dist/renderers/terminal-style.d.ts +4 -0
- package/dist/renderers/terminal-style.d.ts.map +1 -0
- package/dist/renderers/terminal-style.js +21 -0
- package/dist/renderers/terminal-style.js.map +1 -0
- package/dist/renderers/text.d.ts +10 -0
- package/dist/renderers/text.d.ts.map +1 -0
- package/dist/renderers/text.js +379 -0
- package/dist/renderers/text.js.map +1 -0
- package/dist/reporting/agent-guidance.d.ts +11 -0
- package/dist/reporting/agent-guidance.d.ts.map +1 -0
- package/dist/reporting/agent-guidance.js +17 -0
- package/dist/reporting/agent-guidance.js.map +1 -0
- package/dist/reporting/check-label.d.ts +3 -0
- package/dist/reporting/check-label.d.ts.map +1 -0
- package/dist/reporting/check-label.js +38 -0
- package/dist/reporting/check-label.js.map +1 -0
- package/dist/reporting/next-steps.d.ts +13 -0
- package/dist/reporting/next-steps.d.ts.map +1 -0
- package/dist/reporting/next-steps.js +47 -0
- package/dist/reporting/next-steps.js.map +1 -0
- package/dist/reporting/presentation.d.ts +23 -0
- package/dist/reporting/presentation.d.ts.map +1 -0
- package/dist/reporting/presentation.js +120 -0
- package/dist/reporting/presentation.js.map +1 -0
- package/dist/reporting/report-age.d.ts +3 -0
- package/dist/reporting/report-age.d.ts.map +1 -0
- package/dist/reporting/report-age.js +31 -0
- package/dist/reporting/report-age.js.map +1 -0
- package/dist/reporting/report-callouts.d.ts +15 -0
- package/dist/reporting/report-callouts.d.ts.map +1 -0
- package/dist/reporting/report-callouts.js +47 -0
- package/dist/reporting/report-callouts.js.map +1 -0
- package/dist/reporting/report-path.d.ts +3 -0
- package/dist/reporting/report-path.d.ts.map +1 -0
- package/dist/reporting/report-path.js +8 -0
- package/dist/reporting/report-path.js.map +1 -0
- package/dist/reporting/result-sections.d.ts +14 -0
- package/dist/reporting/result-sections.d.ts.map +1 -0
- package/dist/reporting/result-sections.js +27 -0
- package/dist/reporting/result-sections.js.map +1 -0
- package/dist/reporting/source-identity.d.ts +4 -0
- package/dist/reporting/source-identity.d.ts.map +1 -0
- package/dist/reporting/source-identity.js +17 -0
- package/dist/reporting/source-identity.js.map +1 -0
- package/dist/reporting/source-line.d.ts +3 -0
- package/dist/reporting/source-line.d.ts.map +1 -0
- package/dist/reporting/source-line.js +8 -0
- package/dist/reporting/source-line.js.map +1 -0
- package/dist/reporting/temporary-reports.d.ts +31 -0
- package/dist/reporting/temporary-reports.d.ts.map +1 -0
- package/dist/reporting/temporary-reports.js +646 -0
- package/dist/reporting/temporary-reports.js.map +1 -0
- package/dist/runtime/node-support.d.ts +3 -0
- package/dist/runtime/node-support.d.ts.map +1 -0
- package/dist/runtime/node-support.js +6 -0
- package/dist/runtime/node-support.js.map +1 -0
- package/dist/scan/analysis-failure.d.ts +18 -0
- package/dist/scan/analysis-failure.d.ts.map +1 -0
- package/dist/scan/analysis-failure.js +210 -0
- package/dist/scan/analysis-failure.js.map +1 -0
- package/dist/scan/analysis-session.d.ts +90 -0
- package/dist/scan/analysis-session.d.ts.map +1 -0
- package/dist/scan/analysis-session.js +327 -0
- package/dist/scan/analysis-session.js.map +1 -0
- package/dist/scan/incomplete-report.d.ts +25 -0
- package/dist/scan/incomplete-report.d.ts.map +1 -0
- package/dist/scan/incomplete-report.js +78 -0
- package/dist/scan/incomplete-report.js.map +1 -0
- package/dist/scan/report.d.ts +37 -0
- package/dist/scan/report.d.ts.map +1 -0
- package/dist/scan/report.js +2 -0
- package/dist/scan/report.js.map +1 -0
- package/dist/scan/reporting-options.d.ts +7 -0
- package/dist/scan/reporting-options.d.ts.map +1 -0
- package/dist/scan/reporting-options.js +19 -0
- package/dist/scan/reporting-options.js.map +1 -0
- package/dist/scan/resource-policy.d.ts +13 -0
- package/dist/scan/resource-policy.d.ts.map +1 -0
- package/dist/scan/resource-policy.js +67 -0
- package/dist/scan/resource-policy.js.map +1 -0
- package/dist/scan/run-scan.d.ts +32 -0
- package/dist/scan/run-scan.d.ts.map +1 -0
- package/dist/scan/run-scan.js +130 -0
- package/dist/scan/run-scan.js.map +1 -0
- package/dist/scan/source-excerpts.d.ts +7 -0
- package/dist/scan/source-excerpts.d.ts.map +1 -0
- package/dist/scan/source-excerpts.js +225 -0
- package/dist/scan/source-excerpts.js.map +1 -0
- package/dist/scan/source-mode.d.ts +9 -0
- package/dist/scan/source-mode.d.ts.map +1 -0
- package/dist/scan/source-mode.js +20 -0
- package/dist/scan/source-mode.js.map +1 -0
- package/dist/scan/unsupported-inputs.d.ts +14 -0
- package/dist/scan/unsupported-inputs.d.ts.map +1 -0
- package/dist/scan/unsupported-inputs.js +71 -0
- package/dist/scan/unsupported-inputs.js.map +1 -0
- package/dist/service/client.d.ts +37 -0
- package/dist/service/client.d.ts.map +1 -0
- package/dist/service/client.js +656 -0
- package/dist/service/client.js.map +1 -0
- package/dist/service/entry.d.ts +2 -0
- package/dist/service/entry.d.ts.map +1 -0
- package/dist/service/entry.js +104 -0
- package/dist/service/entry.js.map +1 -0
- package/dist/service/identity-content.d.ts +8 -0
- package/dist/service/identity-content.d.ts.map +1 -0
- package/dist/service/identity-content.js +250 -0
- package/dist/service/identity-content.js.map +1 -0
- package/dist/service/identity-parallel.d.ts +3 -0
- package/dist/service/identity-parallel.d.ts.map +1 -0
- package/dist/service/identity-parallel.js +83 -0
- package/dist/service/identity-parallel.js.map +1 -0
- package/dist/service/identity-worker.d.ts +2 -0
- package/dist/service/identity-worker.d.ts.map +1 -0
- package/dist/service/identity-worker.js +32 -0
- package/dist/service/identity-worker.js.map +1 -0
- package/dist/service/identity.d.ts +17 -0
- package/dist/service/identity.d.ts.map +1 -0
- package/dist/service/identity.js +70 -0
- package/dist/service/identity.js.map +1 -0
- package/dist/service/protocol.d.ts +32 -0
- package/dist/service/protocol.d.ts.map +1 -0
- package/dist/service/protocol.js +153 -0
- package/dist/service/protocol.js.map +1 -0
- package/dist/service/server.d.ts +28 -0
- package/dist/service/server.d.ts.map +1 -0
- package/dist/service/server.js +462 -0
- package/dist/service/server.js.map +1 -0
- package/dist/service/state.d.ts +32 -0
- package/dist/service/state.d.ts.map +1 -0
- package/dist/service/state.js +270 -0
- package/dist/service/state.js.map +1 -0
- package/dist/service/transport.d.ts +16 -0
- package/dist/service/transport.d.ts.map +1 -0
- package/dist/service/transport.js +116 -0
- package/dist/service/transport.js.map +1 -0
- package/dist/service/windows-pipe.d.ts +16 -0
- package/dist/service/windows-pipe.d.ts.map +1 -0
- package/dist/service/windows-pipe.js +397 -0
- package/dist/service/windows-pipe.js.map +1 -0
- package/dist/ui/bee-grid.d.ts +19 -0
- package/dist/ui/bee-grid.d.ts.map +1 -0
- package/dist/ui/bee-grid.js +36 -0
- package/dist/ui/bee-grid.js.map +1 -0
- package/dist/ui/branded-command-frame.d.ts +18 -0
- package/dist/ui/branded-command-frame.d.ts.map +1 -0
- package/dist/ui/branded-command-frame.js +46 -0
- package/dist/ui/branded-command-frame.js.map +1 -0
- package/dist/ui/checks-dashboard.d.ts +11 -0
- package/dist/ui/checks-dashboard.d.ts.map +1 -0
- package/dist/ui/checks-dashboard.js +39 -0
- package/dist/ui/checks-dashboard.js.map +1 -0
- package/dist/ui/compact-pixels.d.ts +7 -0
- package/dist/ui/compact-pixels.d.ts.map +1 -0
- package/dist/ui/compact-pixels.js +21 -0
- package/dist/ui/compact-pixels.js.map +1 -0
- package/dist/ui/doctor-dashboard.d.ts +11 -0
- package/dist/ui/doctor-dashboard.d.ts.map +1 -0
- package/dist/ui/doctor-dashboard.js +46 -0
- package/dist/ui/doctor-dashboard.js.map +1 -0
- package/dist/ui/findings-list.d.ts +8 -0
- package/dist/ui/findings-list.d.ts.map +1 -0
- package/dist/ui/findings-list.js +39 -0
- package/dist/ui/findings-list.js.map +1 -0
- package/dist/ui/fix-app.d.ts +34 -0
- package/dist/ui/fix-app.d.ts.map +1 -0
- package/dist/ui/fix-app.js +232 -0
- package/dist/ui/fix-app.js.map +1 -0
- package/dist/ui/fix-result-dashboard.d.ts +12 -0
- package/dist/ui/fix-result-dashboard.d.ts.map +1 -0
- package/dist/ui/fix-result-dashboard.js +47 -0
- package/dist/ui/fix-result-dashboard.js.map +1 -0
- package/dist/ui/incomplete-list.d.ts +7 -0
- package/dist/ui/incomplete-list.d.ts.map +1 -0
- package/dist/ui/incomplete-list.js +25 -0
- package/dist/ui/incomplete-list.js.map +1 -0
- package/dist/ui/init-app.d.ts +24 -0
- package/dist/ui/init-app.d.ts.map +1 -0
- package/dist/ui/init-app.js +294 -0
- package/dist/ui/init-app.js.map +1 -0
- package/dist/ui/live-dashboard.d.ts +28 -0
- package/dist/ui/live-dashboard.d.ts.map +1 -0
- package/dist/ui/live-dashboard.js +268 -0
- package/dist/ui/live-dashboard.js.map +1 -0
- package/dist/ui/outcome-strip.d.ts +7 -0
- package/dist/ui/outcome-strip.d.ts.map +1 -0
- package/dist/ui/outcome-strip.js +67 -0
- package/dist/ui/outcome-strip.js.map +1 -0
- package/dist/ui/pixel-bee.d.ts +11 -0
- package/dist/ui/pixel-bee.d.ts.map +1 -0
- package/dist/ui/pixel-bee.js +67 -0
- package/dist/ui/pixel-bee.js.map +1 -0
- package/dist/ui/pixel-clock.d.ts +10 -0
- package/dist/ui/pixel-clock.d.ts.map +1 -0
- package/dist/ui/pixel-clock.js +65 -0
- package/dist/ui/pixel-clock.js.map +1 -0
- package/dist/ui/pixel-wordmark.d.ts +11 -0
- package/dist/ui/pixel-wordmark.d.ts.map +1 -0
- package/dist/ui/pixel-wordmark.js +47 -0
- package/dist/ui/pixel-wordmark.js.map +1 -0
- package/dist/ui/render-ink.d.ts +12 -0
- package/dist/ui/render-ink.d.ts.map +1 -0
- package/dist/ui/render-ink.js +119 -0
- package/dist/ui/render-ink.js.map +1 -0
- package/dist/ui/render-static.d.ts +8 -0
- package/dist/ui/render-static.d.ts.map +1 -0
- package/dist/ui/render-static.js +40 -0
- package/dist/ui/render-static.js.map +1 -0
- package/dist/ui/scan-app.d.ts +17 -0
- package/dist/ui/scan-app.d.ts.map +1 -0
- package/dist/ui/scan-app.js +65 -0
- package/dist/ui/scan-app.js.map +1 -0
- package/dist/ui/scan-result-dashboard.d.ts +9 -0
- package/dist/ui/scan-result-dashboard.d.ts.map +1 -0
- package/dist/ui/scan-result-dashboard.js +109 -0
- package/dist/ui/scan-result-dashboard.js.map +1 -0
- package/dist/ui/terminal-mouse.d.ts +11 -0
- package/dist/ui/terminal-mouse.d.ts.map +1 -0
- package/dist/ui/terminal-mouse.js +18 -0
- package/dist/ui/terminal-mouse.js.map +1 -0
- package/dist/ui/terminal-viewport-model.d.ts +5 -0
- package/dist/ui/terminal-viewport-model.d.ts.map +1 -0
- package/dist/ui/terminal-viewport-model.js +32 -0
- package/dist/ui/terminal-viewport-model.js.map +1 -0
- package/dist/ui/terminal-viewport.d.ts +18 -0
- package/dist/ui/terminal-viewport.d.ts.map +1 -0
- package/dist/ui/terminal-viewport.js +80 -0
- package/dist/ui/terminal-viewport.js.map +1 -0
- package/dist/ui/theme.d.ts +18 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +18 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/updates/cache.d.ts +12 -0
- package/dist/updates/cache.d.ts.map +1 -0
- package/dist/updates/cache.js +71 -0
- package/dist/updates/cache.js.map +1 -0
- package/dist/updates/metadata.d.ts +15 -0
- package/dist/updates/metadata.d.ts.map +1 -0
- package/dist/updates/metadata.js +78 -0
- package/dist/updates/metadata.js.map +1 -0
- package/dist/updates/notification.d.ts +19 -0
- package/dist/updates/notification.d.ts.map +1 -0
- package/dist/updates/notification.js +95 -0
- package/dist/updates/notification.js.map +1 -0
- package/dist/updates/worker.d.ts +5 -0
- package/dist/updates/worker.d.ts.map +1 -0
- package/dist/updates/worker.js +54 -0
- package/dist/updates/worker.js.map +1 -0
- package/docs/checks.md +185 -0
- package/docs/cli-reference.md +324 -0
- package/docs/commercial-licensing.md +26 -0
- package/docs/dependency-license-obligations.md +16 -0
- package/docs/managed-fixes.md +203 -0
- package/docs/privacy.md +90 -0
- package/docs/react-analysis.md +39 -0
- package/docs/readability-complexity.md +35 -0
- package/docs/reporting.md +105 -0
- package/docs/structural-security-coverage.md +32 -0
- package/docs/support.md +137 -0
- package/licenses/overrides/ast-grep-platform-0.45.1-LICENSE +21 -0
- package/licenses/overrides/emnapi-1.11.2-LICENSE +21 -0
- package/licenses/overrides/esrecurse-4.3.0-LICENSE +22 -0
- package/licenses/overrides/humanfs-types-0.15.0-LICENSE +201 -0
- package/licenses/overrides/imurmurhash-0.1.4-LICENSE +20 -0
- package/licenses/overrides/jscpd-5.0.15-LICENSE +21 -0
- package/licenses/overrides/keyv-4.5.4-LICENSE +22 -0
- package/licenses/overrides/koffi-platform-3.2.1-LICENSE +22 -0
- package/licenses/overrides/language-subtag-registry-0.3.23-LICENSE +125 -0
- package/licenses/overrides/language-tags-1.0.9-LICENSE +21 -0
- package/licenses/overrides/napi-rs-wasm-runtime-1.1.6-LICENSE +43 -0
- package/licenses/overrides/natural-compare-1.4.0-LICENSE +21 -0
- package/licenses/overrides/oxc-parser-platform-0.143.0-LICENSE +22 -0
- package/licenses/overrides/tslib-2.8.1-LICENSE +12 -0
- package/licenses/overrides/wasm-util-0.10.3-LICENSE +21 -0
- package/licenses/overrides/yarnpkg-lockfile-1.1.0-LICENSE +26 -0
- package/licenses/overrides/yoga-layout-3.2.1-LICENSE +21 -0
- package/licenses/production-inventory.json +8533 -0
- package/licenses/reviewed-obligations.json +23 -0
- package/licenses/reviewed-overrides.json +614 -0
- package/package.json +133 -0
- package/schema/zedbee.schema.json +4828 -0
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { connect } from "node:net";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
import { AnalyzerCapacityError, analyzerRequestRetentionBytes, exactFields, jobFailure, } from "../checks/runner/envelope.js";
|
|
6
|
+
import { validateAnalyzerRequest, validateAnalyzerResult, } from "../checks/runner/protocol.js";
|
|
7
|
+
import { AnalyzerJobError } from "../checks/diagnostics.js";
|
|
8
|
+
import { CheckIncompleteError } from "../checks/incomplete-error.js";
|
|
9
|
+
import { ByteBudget, GLOBAL_BYTES, HEX, ServiceUnavailableError, proof, verifyProof, } from "./protocol.js";
|
|
10
|
+
import { ServiceConnection, serviceEndpoint } from "./transport.js";
|
|
11
|
+
import { ServiceState } from "./state.js";
|
|
12
|
+
import { stopProcessGroup } from "../checks/runner/process-group.js";
|
|
13
|
+
import { serviceIdentity, serviceLocation, } from "./identity.js";
|
|
14
|
+
function decodeError(value) {
|
|
15
|
+
if (!exactFields(value, ["code", "scope", "diagnostic", "incomplete"]))
|
|
16
|
+
return new ServiceUnavailableError();
|
|
17
|
+
if (value.code === "ANALYZER_CAPACITY" &&
|
|
18
|
+
["session", "job", "request"].includes(value.scope))
|
|
19
|
+
return new AnalyzerCapacityError(value.scope);
|
|
20
|
+
if (value.code === "analyzer")
|
|
21
|
+
return new AnalyzerJobError(value.diagnostic);
|
|
22
|
+
if (value.code === "incomplete")
|
|
23
|
+
return new CheckIncompleteError(value.incomplete);
|
|
24
|
+
return new ServiceUnavailableError();
|
|
25
|
+
}
|
|
26
|
+
export class ServiceClient {
|
|
27
|
+
peer;
|
|
28
|
+
state;
|
|
29
|
+
next = 0;
|
|
30
|
+
pending = new Map();
|
|
31
|
+
retained = new ByteBudget(GLOBAL_BYTES);
|
|
32
|
+
closed = false;
|
|
33
|
+
cleanup;
|
|
34
|
+
events = new Set();
|
|
35
|
+
leases = new Map();
|
|
36
|
+
trees = new Map();
|
|
37
|
+
constructor(peer, state) {
|
|
38
|
+
this.peer = peer;
|
|
39
|
+
this.state = state;
|
|
40
|
+
peer.socket.once("close", () => {
|
|
41
|
+
this.closed = true;
|
|
42
|
+
for (const [id, pending] of this.pending)
|
|
43
|
+
if (pending.acknowledgement) {
|
|
44
|
+
this.pending.delete(id);
|
|
45
|
+
pending.cleanup();
|
|
46
|
+
pending.reject(new ServiceUnavailableError());
|
|
47
|
+
}
|
|
48
|
+
// Socket loss is not tree/source cleanup. Keep all calls pending until
|
|
49
|
+
// independent OS witnesses prove this client's reads have ended.
|
|
50
|
+
this.cleanup = this.cleanupLost();
|
|
51
|
+
void this.cleanup.then(() => this.rejectPending(), () => this.rejectPending(true));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
rejectPending(cleanupFailed = false) {
|
|
55
|
+
for (const pending of this.pending.values()) {
|
|
56
|
+
pending.cleanup();
|
|
57
|
+
pending.reject(pending.request
|
|
58
|
+
? jobFailure(pending.request, cleanupFailed ? "cleanup" : "abnormal-exit")
|
|
59
|
+
: new ServiceUnavailableError());
|
|
60
|
+
}
|
|
61
|
+
this.pending.clear();
|
|
62
|
+
}
|
|
63
|
+
async releaseLease(id) {
|
|
64
|
+
const lease = this.leases.get(id);
|
|
65
|
+
if (!lease)
|
|
66
|
+
throw new ServiceUnavailableError();
|
|
67
|
+
while (!lease.acquire())
|
|
68
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
69
|
+
await lease.close();
|
|
70
|
+
this.leases.delete(id);
|
|
71
|
+
await this.state.removeLease(id);
|
|
72
|
+
}
|
|
73
|
+
async cleanupLost() {
|
|
74
|
+
await Promise.allSettled([...this.events]);
|
|
75
|
+
await Promise.all([...this.trees.values()].map((tree) => tree.stop()));
|
|
76
|
+
this.trees.clear();
|
|
77
|
+
await Promise.all([...this.leases.keys()].map((id) => this.releaseLease(id)));
|
|
78
|
+
}
|
|
79
|
+
event(value) {
|
|
80
|
+
const operation = this.acceptEvent(value);
|
|
81
|
+
this.events.add(operation);
|
|
82
|
+
void operation
|
|
83
|
+
.catch(() => this.peer.destroy())
|
|
84
|
+
.finally(() => this.events.delete(operation));
|
|
85
|
+
}
|
|
86
|
+
async acceptEvent(value) {
|
|
87
|
+
if (typeof value.eventId !== "string" ||
|
|
88
|
+
!HEX.test(value.eventId) ||
|
|
89
|
+
typeof value.sessionId !== "string" ||
|
|
90
|
+
!HEX.test(value.sessionId))
|
|
91
|
+
throw new ServiceUnavailableError();
|
|
92
|
+
const id = value.sessionId;
|
|
93
|
+
if (value.type === "io-acquire" &&
|
|
94
|
+
exactFields(value, ["type", "eventId", "sessionId"])) {
|
|
95
|
+
if (this.leases.size >= 4 || this.leases.has(id))
|
|
96
|
+
throw new ServiceUnavailableError();
|
|
97
|
+
const lease = await this.state.lease(id, false);
|
|
98
|
+
this.leases.set(id, lease);
|
|
99
|
+
}
|
|
100
|
+
else if (value.type === "io-release" &&
|
|
101
|
+
exactFields(value, ["type", "eventId", "sessionId"])) {
|
|
102
|
+
await this.releaseLease(id);
|
|
103
|
+
}
|
|
104
|
+
else if (value.type === "tree-acquire" &&
|
|
105
|
+
exactFields(value, ["type", "eventId", "sessionId", "witness"])) {
|
|
106
|
+
const witness = value.witness;
|
|
107
|
+
if (!this.leases.has(id) ||
|
|
108
|
+
this.trees.size >= 4 ||
|
|
109
|
+
!exactFields(witness, ["id", "kind", "pgid", "jobName"]) ||
|
|
110
|
+
typeof witness.id !== "string" ||
|
|
111
|
+
!HEX.test(witness.id) ||
|
|
112
|
+
this.trees.has(witness.id))
|
|
113
|
+
throw new ServiceUnavailableError();
|
|
114
|
+
if (witness.kind === "windows" &&
|
|
115
|
+
process.platform === "win32" &&
|
|
116
|
+
exactFields(witness, ["id", "kind", "jobName"]) &&
|
|
117
|
+
witness.jobName === `Local\\zedbee-${witness.id}`) {
|
|
118
|
+
const owned = (await import("./windows-pipe.js")).openWindowsJobWitness(witness.jobName);
|
|
119
|
+
this.trees.set(witness.id, { sessionId: id, ...owned });
|
|
120
|
+
}
|
|
121
|
+
else if (witness.kind === "posix" &&
|
|
122
|
+
process.platform !== "win32" &&
|
|
123
|
+
exactFields(witness, ["id", "kind", "pgid"]) &&
|
|
124
|
+
Number.isSafeInteger(witness.pgid) &&
|
|
125
|
+
witness.pgid > 0) {
|
|
126
|
+
const pgid = witness.pgid;
|
|
127
|
+
this.trees.set(witness.id, {
|
|
128
|
+
sessionId: id,
|
|
129
|
+
stop: () => stopProcessGroup(pgid),
|
|
130
|
+
close() { },
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
else
|
|
134
|
+
throw new ServiceUnavailableError();
|
|
135
|
+
}
|
|
136
|
+
else if (value.type === "tree-release" &&
|
|
137
|
+
exactFields(value, ["type", "eventId", "sessionId", "witnessId"]) &&
|
|
138
|
+
typeof value.witnessId === "string") {
|
|
139
|
+
const owned = this.trees.get(value.witnessId);
|
|
140
|
+
if (!owned || owned.sessionId !== id)
|
|
141
|
+
throw new ServiceUnavailableError();
|
|
142
|
+
owned.close();
|
|
143
|
+
this.trees.delete(value.witnessId);
|
|
144
|
+
}
|
|
145
|
+
else
|
|
146
|
+
throw new ServiceUnavailableError();
|
|
147
|
+
if (!this.peer.socket.destroyed)
|
|
148
|
+
await this.request("ack", { eventId: value.eventId });
|
|
149
|
+
}
|
|
150
|
+
receive(value) {
|
|
151
|
+
if (!exactFields(value, ["id", "ok", "result", "error"]) ||
|
|
152
|
+
typeof value.ok !== "boolean" ||
|
|
153
|
+
!Number.isSafeInteger(value.id))
|
|
154
|
+
throw new ServiceUnavailableError();
|
|
155
|
+
const pending = this.pending.get(value.id);
|
|
156
|
+
if (!pending)
|
|
157
|
+
throw new ServiceUnavailableError();
|
|
158
|
+
if (!exactFields(value, value.ok ? ["id", "ok", "result"] : ["id", "ok", "error"]))
|
|
159
|
+
throw new ServiceUnavailableError();
|
|
160
|
+
const error = value.ok ? undefined : decodeError(value.error);
|
|
161
|
+
this.pending.delete(value.id);
|
|
162
|
+
pending.cleanup();
|
|
163
|
+
if (value.ok)
|
|
164
|
+
pending.resolve(value.result);
|
|
165
|
+
else
|
|
166
|
+
pending.reject(error);
|
|
167
|
+
}
|
|
168
|
+
request(op, fields = {}, signal, request) {
|
|
169
|
+
if ((this.closed || this.peer.socket.destroyed) && op === "ack")
|
|
170
|
+
return Promise.reject(new ServiceUnavailableError());
|
|
171
|
+
if (this.closed || this.peer.socket.destroyed)
|
|
172
|
+
return this.close().then(() => {
|
|
173
|
+
throw request
|
|
174
|
+
? jobFailure(request, "abnormal-exit")
|
|
175
|
+
: new ServiceUnavailableError();
|
|
176
|
+
});
|
|
177
|
+
if (this.pending.size >= 32)
|
|
178
|
+
return Promise.reject(new AnalyzerCapacityError("job"));
|
|
179
|
+
if (signal?.aborted)
|
|
180
|
+
return Promise.reject(request
|
|
181
|
+
? jobFailure(request, "cancellation")
|
|
182
|
+
: new ServiceUnavailableError());
|
|
183
|
+
let releaseRetention;
|
|
184
|
+
try {
|
|
185
|
+
// Cleanup/control exchanges must remain possible while payload admission
|
|
186
|
+
// is full. Pending accepted source/request objects share one byte budget.
|
|
187
|
+
releaseRetention = this.retained.reserve(op === "run" || op === "open"
|
|
188
|
+
? analyzerRequestRetentionBytes(fields)
|
|
189
|
+
: 0);
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
return Promise.reject(error);
|
|
193
|
+
}
|
|
194
|
+
const id = ++this.next;
|
|
195
|
+
return new Promise((resolve, reject) => {
|
|
196
|
+
const abort = () => {
|
|
197
|
+
void this.request("cancel", { jobId: id }).catch(() => this.peer.destroy());
|
|
198
|
+
};
|
|
199
|
+
this.pending.set(id, {
|
|
200
|
+
resolve,
|
|
201
|
+
reject,
|
|
202
|
+
request,
|
|
203
|
+
acknowledgement: op === "ack",
|
|
204
|
+
cleanup: () => {
|
|
205
|
+
releaseRetention();
|
|
206
|
+
signal?.removeEventListener("abort", abort);
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
210
|
+
void this.peer.send({ id, op, ...fields }).catch((error) => {
|
|
211
|
+
// Encoding/admission failed synchronously before socket.write: no
|
|
212
|
+
// accepted job exists and the authenticated connection remains usable.
|
|
213
|
+
if (error instanceof AnalyzerCapacityError) {
|
|
214
|
+
const pending = this.pending.get(id);
|
|
215
|
+
this.pending.delete(id);
|
|
216
|
+
pending?.cleanup();
|
|
217
|
+
pending?.reject(error);
|
|
218
|
+
}
|
|
219
|
+
else
|
|
220
|
+
this.peer.destroy();
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
async close() {
|
|
225
|
+
if (!this.closed)
|
|
226
|
+
await new Promise((resolve) => {
|
|
227
|
+
this.peer.socket.once("close", resolve);
|
|
228
|
+
this.peer.destroy();
|
|
229
|
+
});
|
|
230
|
+
await this.cleanup;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export async function connectService(state, record) {
|
|
234
|
+
const socket = connect(serviceEndpoint(state, record.instance));
|
|
235
|
+
let phase = 0, client;
|
|
236
|
+
const nonce = randomBytes(32).toString("hex");
|
|
237
|
+
return new Promise((resolve, reject) => {
|
|
238
|
+
const timer = setTimeout(() => socket.destroy(), 10000);
|
|
239
|
+
socket.once("close", () => {
|
|
240
|
+
clearTimeout(timer);
|
|
241
|
+
if (!client)
|
|
242
|
+
reject(new ServiceUnavailableError());
|
|
243
|
+
});
|
|
244
|
+
const peer = new ServiceConnection(socket, new ByteBudget(GLOBAL_BYTES), new ByteBudget(GLOBAL_BYTES), (value, release) => {
|
|
245
|
+
try {
|
|
246
|
+
if (client) {
|
|
247
|
+
if (exactFields(value, [
|
|
248
|
+
"type",
|
|
249
|
+
"eventId",
|
|
250
|
+
"sessionId",
|
|
251
|
+
"witness",
|
|
252
|
+
"witnessId",
|
|
253
|
+
]) &&
|
|
254
|
+
typeof value.type === "string")
|
|
255
|
+
client.event(value);
|
|
256
|
+
else
|
|
257
|
+
client.receive(value);
|
|
258
|
+
}
|
|
259
|
+
else if (phase === 0 &&
|
|
260
|
+
exactFields(value, ["type", "nonce", "proof"]) &&
|
|
261
|
+
value.type === "challenge" &&
|
|
262
|
+
typeof value.nonce === "string" &&
|
|
263
|
+
HEX.test(value.nonce) &&
|
|
264
|
+
verifyProof(value.proof, record.secret, "server", record.identity, nonce, value.nonce)) {
|
|
265
|
+
phase = 1;
|
|
266
|
+
void peer
|
|
267
|
+
.send({
|
|
268
|
+
type: "authenticate",
|
|
269
|
+
proof: proof(record.secret, "client", record.identity, nonce, value.nonce),
|
|
270
|
+
})
|
|
271
|
+
.catch(() => socket.destroy());
|
|
272
|
+
}
|
|
273
|
+
else if (phase === 1 &&
|
|
274
|
+
exactFields(value, ["type"]) &&
|
|
275
|
+
value.type === "authenticated") {
|
|
276
|
+
clearTimeout(timer);
|
|
277
|
+
peer.authenticated();
|
|
278
|
+
client = new ServiceClient(peer, state);
|
|
279
|
+
resolve(client);
|
|
280
|
+
}
|
|
281
|
+
else
|
|
282
|
+
throw new ServiceUnavailableError();
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
socket.destroy();
|
|
286
|
+
}
|
|
287
|
+
finally {
|
|
288
|
+
release();
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
socket.once("connect", () => {
|
|
292
|
+
void peer
|
|
293
|
+
.send({ type: "hello", identity: record.identity, nonce })
|
|
294
|
+
.catch(() => socket.destroy());
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
export function executorForConnection(client) {
|
|
299
|
+
const sessions = new Set();
|
|
300
|
+
let closed = false, closing;
|
|
301
|
+
return {
|
|
302
|
+
async openSession(options = {}) {
|
|
303
|
+
if (closed)
|
|
304
|
+
throw new ServiceUnavailableError();
|
|
305
|
+
analyzerRequestRetentionBytes(options);
|
|
306
|
+
if (!exactFields(options, ["sourceSelections"]))
|
|
307
|
+
throw new ServiceUnavailableError();
|
|
308
|
+
const result = await client.request("open", { options });
|
|
309
|
+
if (!exactFields(result, ["sessionId"]) ||
|
|
310
|
+
typeof result.sessionId !== "string" ||
|
|
311
|
+
!HEX.test(result.sessionId))
|
|
312
|
+
throw new ServiceUnavailableError();
|
|
313
|
+
const sessionId = result.sessionId;
|
|
314
|
+
let released = false, release;
|
|
315
|
+
const session = {
|
|
316
|
+
async run(request, options = {}) {
|
|
317
|
+
if (released || closed)
|
|
318
|
+
throw new ServiceUnavailableError();
|
|
319
|
+
const signal = options.signal;
|
|
320
|
+
if (!exactFields(options, ["signal"]))
|
|
321
|
+
throw new ServiceUnavailableError();
|
|
322
|
+
analyzerRequestRetentionBytes(request);
|
|
323
|
+
const captured = structuredClone(request);
|
|
324
|
+
validateAnalyzerRequest(captured);
|
|
325
|
+
return validateAnalyzerResult(captured, await client.request("run", { sessionId, request: captured }, signal, captured));
|
|
326
|
+
},
|
|
327
|
+
close() {
|
|
328
|
+
if (!release) {
|
|
329
|
+
released = true;
|
|
330
|
+
release = client.request("close", { sessionId }).then(() => {
|
|
331
|
+
sessions.delete(session);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
return release;
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
sessions.add(session);
|
|
338
|
+
if (closed) {
|
|
339
|
+
await session.close();
|
|
340
|
+
throw new ServiceUnavailableError();
|
|
341
|
+
}
|
|
342
|
+
return session;
|
|
343
|
+
},
|
|
344
|
+
close() {
|
|
345
|
+
if (!closing) {
|
|
346
|
+
closed = true;
|
|
347
|
+
closing = (async () => {
|
|
348
|
+
try {
|
|
349
|
+
const results = await Promise.allSettled([...sessions].map((session) => session.close()));
|
|
350
|
+
const failure = results.find((result) => result.status === "rejected");
|
|
351
|
+
if (failure?.status === "rejected")
|
|
352
|
+
throw failure.reason;
|
|
353
|
+
}
|
|
354
|
+
finally {
|
|
355
|
+
await client.close();
|
|
356
|
+
}
|
|
357
|
+
})();
|
|
358
|
+
}
|
|
359
|
+
return closing;
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function validateOptions(options) {
|
|
364
|
+
const concurrency = options.concurrency;
|
|
365
|
+
if (!exactFields(options, ["directory", "concurrency"]) ||
|
|
366
|
+
![1, 2, 4].includes(concurrency ?? 2) ||
|
|
367
|
+
(options.directory !== undefined && typeof options.directory !== "string"))
|
|
368
|
+
throw new ServiceUnavailableError();
|
|
369
|
+
}
|
|
370
|
+
function decodeStatus(value) {
|
|
371
|
+
if (!exactFields(value, ["state", "pid", "activeSessions", "concurrency"]) ||
|
|
372
|
+
value.state !== "running" ||
|
|
373
|
+
!Number.isSafeInteger(value.pid) ||
|
|
374
|
+
value.pid <= 0 ||
|
|
375
|
+
!Number.isSafeInteger(value.activeSessions) ||
|
|
376
|
+
value.activeSessions < 0 ||
|
|
377
|
+
value.activeSessions > 32 ||
|
|
378
|
+
![1, 2, 4].includes(value.concurrency))
|
|
379
|
+
throw new ServiceUnavailableError();
|
|
380
|
+
return value;
|
|
381
|
+
}
|
|
382
|
+
async function startCandidate(location, pendingIdentity, concurrency) {
|
|
383
|
+
const execArgv = location.entry.endsWith(".ts")
|
|
384
|
+
? ["--import", import.meta.resolve("tsx")]
|
|
385
|
+
: [];
|
|
386
|
+
const child = spawn(process.execPath, [...execArgv, location.entry], {
|
|
387
|
+
// The service outlives its initiating checkout; cwd is not source authority.
|
|
388
|
+
cwd: dirname(location.entry),
|
|
389
|
+
stdio: ["ignore", "ignore", "ignore", "ipc"],
|
|
390
|
+
detached: true,
|
|
391
|
+
windowsHide: true,
|
|
392
|
+
});
|
|
393
|
+
return new Promise((resolve, reject) => {
|
|
394
|
+
let settling = false, startupSent = false, detaching = false;
|
|
395
|
+
let witnessExit;
|
|
396
|
+
const exited = new Promise((done) => {
|
|
397
|
+
witnessExit = done;
|
|
398
|
+
});
|
|
399
|
+
let timer;
|
|
400
|
+
const disconnect = () => {
|
|
401
|
+
if (child.connected)
|
|
402
|
+
child.disconnect();
|
|
403
|
+
};
|
|
404
|
+
const fail = async () => {
|
|
405
|
+
if (settling)
|
|
406
|
+
return;
|
|
407
|
+
settling = true;
|
|
408
|
+
clearTimeout(timer);
|
|
409
|
+
disconnect();
|
|
410
|
+
// A failed detach send may already have reached the child. SIGTERM keeps
|
|
411
|
+
// its existing graceful cleanup path responsible even if it detached.
|
|
412
|
+
if (detaching)
|
|
413
|
+
child.kill("SIGTERM");
|
|
414
|
+
await exited;
|
|
415
|
+
child.unref();
|
|
416
|
+
reject(new ServiceUnavailableError());
|
|
417
|
+
};
|
|
418
|
+
child.once("error", () => {
|
|
419
|
+
// A spawn error has no process whose exit could witness cleanup.
|
|
420
|
+
if (child.pid === undefined)
|
|
421
|
+
witnessExit();
|
|
422
|
+
void fail();
|
|
423
|
+
});
|
|
424
|
+
child.once("exit", () => {
|
|
425
|
+
witnessExit();
|
|
426
|
+
if (!settling)
|
|
427
|
+
void fail();
|
|
428
|
+
});
|
|
429
|
+
child.on("message", (value) => {
|
|
430
|
+
if (settling)
|
|
431
|
+
return;
|
|
432
|
+
if (!startupSent || detaching || !exactFields(value, ["type"])) {
|
|
433
|
+
void fail();
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (value.type === "ready") {
|
|
437
|
+
detaching = true;
|
|
438
|
+
try {
|
|
439
|
+
child.send({ type: "detach" }, (error) => {
|
|
440
|
+
if (error) {
|
|
441
|
+
void fail();
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if (settling)
|
|
445
|
+
return;
|
|
446
|
+
settling = true;
|
|
447
|
+
clearTimeout(timer);
|
|
448
|
+
child.unref();
|
|
449
|
+
disconnect();
|
|
450
|
+
resolve("ready");
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
void fail();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else if (value.type === "busy") {
|
|
458
|
+
settling = true;
|
|
459
|
+
clearTimeout(timer);
|
|
460
|
+
disconnect();
|
|
461
|
+
void exited.then(() => {
|
|
462
|
+
child.unref();
|
|
463
|
+
resolve("busy");
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
else
|
|
467
|
+
void fail();
|
|
468
|
+
});
|
|
469
|
+
void pendingIdentity
|
|
470
|
+
.then((identity) => {
|
|
471
|
+
if (settling)
|
|
472
|
+
return;
|
|
473
|
+
if (identity.key !== location.key ||
|
|
474
|
+
identity.directory !== location.directory ||
|
|
475
|
+
identity.entry !== location.entry) {
|
|
476
|
+
void fail();
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
// The caller's full identity is owned computation, not startup IPC.
|
|
480
|
+
// Preserve the exchange bound only after that work and validation;
|
|
481
|
+
// failure still awaits the candidate's cleanup and actual exit.
|
|
482
|
+
timer = setTimeout(() => {
|
|
483
|
+
void fail();
|
|
484
|
+
}, 30000);
|
|
485
|
+
startupSent = true;
|
|
486
|
+
child.send({
|
|
487
|
+
directory: identity.directory,
|
|
488
|
+
identity: identity.content,
|
|
489
|
+
concurrency,
|
|
490
|
+
}, (error) => {
|
|
491
|
+
if (error)
|
|
492
|
+
void fail();
|
|
493
|
+
});
|
|
494
|
+
})
|
|
495
|
+
.catch(() => {
|
|
496
|
+
void fail();
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
export async function acquireServiceExecutor(options = {}) {
|
|
501
|
+
validateOptions(options);
|
|
502
|
+
const location = await serviceLocation(options.directory), state = new ServiceState(location.directory);
|
|
503
|
+
await state.prepare();
|
|
504
|
+
const record = await state.read();
|
|
505
|
+
const pendingIdentity = serviceIdentity(options.directory);
|
|
506
|
+
// Discovery absence allows independent source-free hashes to overlap. Existing
|
|
507
|
+
// discovery still requires the caller's complete identity before connecting.
|
|
508
|
+
const candidate = record
|
|
509
|
+
? undefined
|
|
510
|
+
: startCandidate(location, pendingIdentity, options.concurrency ?? 2);
|
|
511
|
+
void candidate?.catch(() => { });
|
|
512
|
+
let identity;
|
|
513
|
+
try {
|
|
514
|
+
identity = await pendingIdentity;
|
|
515
|
+
}
|
|
516
|
+
catch (error) {
|
|
517
|
+
await candidate?.catch(() => { });
|
|
518
|
+
throw error;
|
|
519
|
+
}
|
|
520
|
+
// Busy means ownership is still held, not that a usable service started.
|
|
521
|
+
let attempted = (await candidate) === "ready";
|
|
522
|
+
const connectCurrent = async () => {
|
|
523
|
+
const record = await state.read();
|
|
524
|
+
if (!record)
|
|
525
|
+
return undefined;
|
|
526
|
+
let connected;
|
|
527
|
+
try {
|
|
528
|
+
connected = await connectService(state, record);
|
|
529
|
+
}
|
|
530
|
+
catch {
|
|
531
|
+
return undefined;
|
|
532
|
+
}
|
|
533
|
+
if (record.identity === identity.content)
|
|
534
|
+
return connected;
|
|
535
|
+
// An early candidate may have reported busy while this stale owner was
|
|
536
|
+
// publishing discovery. Retiring it permits one fresh startup attempt.
|
|
537
|
+
attempted = false;
|
|
538
|
+
// Authenticate the exact stale record. Rereading through stopService could
|
|
539
|
+
// target a replacement published by another upgrader in the meantime.
|
|
540
|
+
try {
|
|
541
|
+
let result;
|
|
542
|
+
try {
|
|
543
|
+
result = await connected.request("drain");
|
|
544
|
+
}
|
|
545
|
+
catch {
|
|
546
|
+
// A competing drain may close this connection before its reply. A live
|
|
547
|
+
// service that still answers status instead needs explicit recovery;
|
|
548
|
+
// legacy stop would cancel a session admitted after a status check.
|
|
549
|
+
let running = false;
|
|
550
|
+
try {
|
|
551
|
+
decodeStatus(await connected.request("status"));
|
|
552
|
+
running = true;
|
|
553
|
+
}
|
|
554
|
+
catch { }
|
|
555
|
+
if (running) {
|
|
556
|
+
const error = new ServiceUnavailableError();
|
|
557
|
+
error.message =
|
|
558
|
+
"The previous analyzer service could not drain safely. After active scans finish, run `zedbee service stop` and retry.";
|
|
559
|
+
throw error;
|
|
560
|
+
}
|
|
561
|
+
return undefined;
|
|
562
|
+
}
|
|
563
|
+
if (!exactFields(result, ["state"]) || result.state !== "stopped")
|
|
564
|
+
throw new ServiceUnavailableError();
|
|
565
|
+
return undefined;
|
|
566
|
+
}
|
|
567
|
+
finally {
|
|
568
|
+
// The provisional reply/socket loss is not cleanup proof. This awaits
|
|
569
|
+
// the handed-off lease, released after endpoint and owner-lock cleanup.
|
|
570
|
+
await connected.close();
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
let client = await connectCurrent();
|
|
574
|
+
if (!client) {
|
|
575
|
+
const start = performance.now();
|
|
576
|
+
while (!client && performance.now() - start < 30000) {
|
|
577
|
+
// A competing upgrader can lose its drain socket while the old owner is
|
|
578
|
+
// still cleaning up. Wait for ownership availability or matching discovery
|
|
579
|
+
// before starting; a premature busy candidate cannot replace that owner.
|
|
580
|
+
if (!attempted) {
|
|
581
|
+
const release = await state.lock();
|
|
582
|
+
if (release) {
|
|
583
|
+
await release();
|
|
584
|
+
attempted =
|
|
585
|
+
(await startCandidate(identity, Promise.resolve(identity), options.concurrency ?? 2)) === "ready";
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
client = await connectCurrent();
|
|
589
|
+
if (!client)
|
|
590
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
if (!client)
|
|
594
|
+
throw new ServiceUnavailableError();
|
|
595
|
+
try {
|
|
596
|
+
const status = decodeStatus(await client.request("status"));
|
|
597
|
+
if (status.state !== "running" ||
|
|
598
|
+
(options.concurrency !== undefined &&
|
|
599
|
+
status.concurrency !== options.concurrency))
|
|
600
|
+
throw new ServiceUnavailableError();
|
|
601
|
+
return executorForConnection(client);
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
await client.close();
|
|
605
|
+
throw error;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
async function manage(op, options) {
|
|
609
|
+
let client;
|
|
610
|
+
try {
|
|
611
|
+
validateOptions(options);
|
|
612
|
+
const location = await serviceLocation(options.directory), state = new ServiceState(location.directory);
|
|
613
|
+
const record = await state.read();
|
|
614
|
+
if (!record) {
|
|
615
|
+
if (op === "stop") {
|
|
616
|
+
// Discovery can disappear before shutdown releases startup ownership.
|
|
617
|
+
// Inspect only an existing lock: management must never create state.
|
|
618
|
+
let lease;
|
|
619
|
+
try {
|
|
620
|
+
lease = await state.lease(undefined, false);
|
|
621
|
+
if (!lease.acquire())
|
|
622
|
+
return { state: "unavailable" };
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
if (error.code !== "ENOENT")
|
|
626
|
+
throw error;
|
|
627
|
+
}
|
|
628
|
+
finally {
|
|
629
|
+
await lease?.close();
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return { state: "stopped" };
|
|
633
|
+
}
|
|
634
|
+
client = await connectService(state, record);
|
|
635
|
+
const result = await client.request(op);
|
|
636
|
+
if (op === "stop") {
|
|
637
|
+
if (!exactFields(result, ["state"]) || result.state !== "stopped")
|
|
638
|
+
throw new ServiceUnavailableError();
|
|
639
|
+
return { state: "stopped" };
|
|
640
|
+
}
|
|
641
|
+
return decodeStatus(result);
|
|
642
|
+
}
|
|
643
|
+
catch {
|
|
644
|
+
return { state: "unavailable" };
|
|
645
|
+
}
|
|
646
|
+
finally {
|
|
647
|
+
await client?.close();
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
export function serviceStatus(options = {}) {
|
|
651
|
+
return manage("status", options);
|
|
652
|
+
}
|
|
653
|
+
export function stopService(options = {}) {
|
|
654
|
+
return manage("stop", options);
|
|
655
|
+
}
|
|
656
|
+
//# sourceMappingURL=client.js.map
|