@od-oneapp/config 2026.2.2001-canary.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/CHANGELOG.md +25 -0
- package/README.md +830 -0
- package/eslint/__tests__/config-structure.test.mjs +61 -0
- package/eslint/base.mjs +350 -0
- package/eslint/expo.mjs +97 -0
- package/eslint/next-test.mjs +43 -0
- package/eslint/next.mjs +74 -0
- package/eslint/node.mjs +106 -0
- package/eslint/react.mjs +313 -0
- package/eslint/rules/__tests__/no-used-underscore-vars.test.mjs +147 -0
- package/eslint/rules/no-used-underscore-vars.mjs +297 -0
- package/eslint/shared/__tests__/common-ignores.test.mjs +19 -0
- package/eslint/shared/common-ignores.mjs +172 -0
- package/eslint/shared/disabled-type-aware-rules.mjs +35 -0
- package/eslint/shared/file-patterns.mjs +124 -0
- package/eslint/shared/node-globals.mjs +50 -0
- package/eslint/storybook.mjs +81 -0
- package/eslint/test.mjs +298 -0
- package/eslint/utils/__tests__/create-validated-config.test.mjs +42 -0
- package/eslint/utils/__tests__/filter-ts-eslint-configs.test.mjs +57 -0
- package/eslint/utils/__tests__/validate-config.test.mjs +104 -0
- package/eslint/utils/create-validated-config.mjs +69 -0
- package/eslint/utils/filter-ts-eslint-configs.mjs +129 -0
- package/eslint/utils/validate-config.mjs +88 -0
- package/package.json +37 -0
- package/prettier/index.mjs +15 -0
- package/stylelint/index.mjs +129 -0
- package/tsdown/README.md +287 -0
- package/tsdown/base.mjs +77 -0
- package/tsdown/browser.mjs +34 -0
- package/tsdown/client.mjs +32 -0
- package/tsdown/dist.mjs +179 -0
- package/tsdown/index.mjs +53 -0
- package/tsdown/node.mjs +39 -0
- package/tsdown/react.mjs +30 -0
- package/typescript/base.json +52 -0
- package/typescript/dist/__tests__/browser-stub.test.d.ts +2 -0
- package/typescript/dist/__tests__/browser-stub.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/browser-stub.test.js +40 -0
- package/typescript/dist/__tests__/browser-stub.test.js.map +1 -0
- package/typescript/dist/__tests__/runtime/lifecycle.test.d.ts +2 -0
- package/typescript/dist/__tests__/runtime/lifecycle.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/runtime/lifecycle.test.js +149 -0
- package/typescript/dist/__tests__/runtime/lifecycle.test.js.map +1 -0
- package/typescript/dist/__tests__/server/abort-support.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/abort-support.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/abort-support.test.js +333 -0
- package/typescript/dist/__tests__/server/abort-support.test.js.map +1 -0
- package/typescript/dist/__tests__/server/batch-processor.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/batch-processor.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/batch-processor.test.js +173 -0
- package/typescript/dist/__tests__/server/batch-processor.test.js.map +1 -0
- package/typescript/dist/__tests__/server/cache.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/cache.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/cache.test.js +343 -0
- package/typescript/dist/__tests__/server/cache.test.js.map +1 -0
- package/typescript/dist/__tests__/server/circular-deps.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/circular-deps.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/circular-deps.test.js +412 -0
- package/typescript/dist/__tests__/server/circular-deps.test.js.map +1 -0
- package/typescript/dist/__tests__/server/claude-code-env.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/claude-code-env.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/claude-code-env.test.js +387 -0
- package/typescript/dist/__tests__/server/claude-code-env.test.js.map +1 -0
- package/typescript/dist/__tests__/server/code-analysis-tool.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/code-analysis-tool.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/code-analysis-tool.test.js +430 -0
- package/typescript/dist/__tests__/server/code-analysis-tool.test.js.map +1 -0
- package/typescript/dist/__tests__/server/code-transformation.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/code-transformation.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/code-transformation.test.js +173 -0
- package/typescript/dist/__tests__/server/code-transformation.test.js.map +1 -0
- package/typescript/dist/__tests__/server/concurrency.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/concurrency.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/concurrency.test.js +31 -0
- package/typescript/dist/__tests__/server/concurrency.test.js.map +1 -0
- package/typescript/dist/__tests__/server/context.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/context.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/context.test.js +483 -0
- package/typescript/dist/__tests__/server/context.test.js.map +1 -0
- package/typescript/dist/__tests__/server/error-handling.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/error-handling.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/error-handling.test.js +68 -0
- package/typescript/dist/__tests__/server/error-handling.test.js.map +1 -0
- package/typescript/dist/__tests__/server/error-utils.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/error-utils.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/error-utils.test.js +268 -0
- package/typescript/dist/__tests__/server/error-utils.test.js.map +1 -0
- package/typescript/dist/__tests__/server/files.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/files.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/files.test.js +160 -0
- package/typescript/dist/__tests__/server/files.test.js.map +1 -0
- package/typescript/dist/__tests__/server/logger.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/logger.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/logger.test.js +412 -0
- package/typescript/dist/__tests__/server/logger.test.js.map +1 -0
- package/typescript/dist/__tests__/server/path-manager.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/path-manager.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/path-manager.test.js +406 -0
- package/typescript/dist/__tests__/server/path-manager.test.js.map +1 -0
- package/typescript/dist/__tests__/server/retry-operations.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/retry-operations.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/retry-operations.test.js +119 -0
- package/typescript/dist/__tests__/server/retry-operations.test.js.map +1 -0
- package/typescript/dist/__tests__/server/retry.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/retry.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/retry.test.js +70 -0
- package/typescript/dist/__tests__/server/retry.test.js.map +1 -0
- package/typescript/dist/__tests__/server/retryable.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/retryable.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/retryable.test.js +23 -0
- package/typescript/dist/__tests__/server/retryable.test.js.map +1 -0
- package/typescript/dist/__tests__/server/scheduler.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/scheduler.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/scheduler.test.js +14 -0
- package/typescript/dist/__tests__/server/scheduler.test.js.map +1 -0
- package/typescript/dist/__tests__/server/security.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/security.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/security.test.js +286 -0
- package/typescript/dist/__tests__/server/security.test.js.map +1 -0
- package/typescript/dist/__tests__/server/session-management.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/session-management.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/session-management.test.js +399 -0
- package/typescript/dist/__tests__/server/session-management.test.js.map +1 -0
- package/typescript/dist/__tests__/server/session-recovery.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/session-recovery.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/session-recovery.test.js +417 -0
- package/typescript/dist/__tests__/server/session-recovery.test.js.map +1 -0
- package/typescript/dist/__tests__/server/session.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/session.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/session.test.js +102 -0
- package/typescript/dist/__tests__/server/session.test.js.map +1 -0
- package/typescript/dist/__tests__/server/simple-tools.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/simple-tools.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/simple-tools.test.js +56 -0
- package/typescript/dist/__tests__/server/simple-tools.test.js.map +1 -0
- package/typescript/dist/__tests__/server/streaming-utilities.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/streaming-utilities.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/streaming-utilities.test.js +338 -0
- package/typescript/dist/__tests__/server/streaming-utilities.test.js.map +1 -0
- package/typescript/dist/__tests__/server/streams.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/streams.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/streams.test.js +282 -0
- package/typescript/dist/__tests__/server/streams.test.js.map +1 -0
- package/typescript/dist/__tests__/server/stringify-advanced.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/stringify-advanced.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/stringify-advanced.test.js +152 -0
- package/typescript/dist/__tests__/server/stringify-advanced.test.js.map +1 -0
- package/typescript/dist/__tests__/server/structured-clone-tool.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/structured-clone-tool.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/structured-clone-tool.test.js +751 -0
- package/typescript/dist/__tests__/server/structured-clone-tool.test.js.map +1 -0
- package/typescript/dist/__tests__/server/structured-clone.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/structured-clone.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/structured-clone.test.js +305 -0
- package/typescript/dist/__tests__/server/structured-clone.test.js.map +1 -0
- package/typescript/dist/__tests__/server/tool-helpers.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/tool-helpers.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/tool-helpers.test.js +51 -0
- package/typescript/dist/__tests__/server/tool-helpers.test.js.map +1 -0
- package/typescript/dist/__tests__/server/validation.test.d.ts +2 -0
- package/typescript/dist/__tests__/server/validation.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/server/validation.test.js +585 -0
- package/typescript/dist/__tests__/server/validation.test.js.map +1 -0
- package/typescript/dist/__tests__/shared/constants.test.d.ts +2 -0
- package/typescript/dist/__tests__/shared/constants.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/shared/constants.test.js +11 -0
- package/typescript/dist/__tests__/shared/constants.test.js.map +1 -0
- package/typescript/dist/__tests__/shared/environment.test.d.ts +2 -0
- package/typescript/dist/__tests__/shared/environment.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/shared/environment.test.js +279 -0
- package/typescript/dist/__tests__/shared/environment.test.js.map +1 -0
- package/typescript/dist/__tests__/shared/stringify.test.d.ts +2 -0
- package/typescript/dist/__tests__/shared/stringify.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/shared/stringify.test.js +171 -0
- package/typescript/dist/__tests__/shared/stringify.test.js.map +1 -0
- package/typescript/dist/__tests__/shared/timeout.test.d.ts +2 -0
- package/typescript/dist/__tests__/shared/timeout.test.d.ts.map +1 -0
- package/typescript/dist/__tests__/shared/timeout.test.js +262 -0
- package/typescript/dist/__tests__/shared/timeout.test.js.map +1 -0
- package/typescript/dist/src/App.d.ts +3 -0
- package/typescript/dist/src/App.d.ts.map +1 -0
- package/typescript/dist/src/App.js +27 -0
- package/typescript/dist/src/App.js.map +1 -0
- package/typescript/dist/src/components/charts/BenchmarkCard.d.ts +12 -0
- package/typescript/dist/src/components/charts/BenchmarkCard.d.ts.map +1 -0
- package/typescript/dist/src/components/charts/BenchmarkCard.js +23 -0
- package/typescript/dist/src/components/charts/BenchmarkCard.js.map +1 -0
- package/typescript/dist/src/components/charts/ComparisonBar.d.ts +11 -0
- package/typescript/dist/src/components/charts/ComparisonBar.d.ts.map +1 -0
- package/typescript/dist/src/components/charts/ComparisonBar.js +34 -0
- package/typescript/dist/src/components/charts/ComparisonBar.js.map +1 -0
- package/typescript/dist/src/components/charts/PercentileGauge.d.ts +10 -0
- package/typescript/dist/src/components/charts/PercentileGauge.d.ts.map +1 -0
- package/typescript/dist/src/components/charts/PercentileGauge.js +68 -0
- package/typescript/dist/src/components/charts/PercentileGauge.js.map +1 -0
- package/typescript/dist/src/components/charts/index.d.ts +4 -0
- package/typescript/dist/src/components/charts/index.d.ts.map +1 -0
- package/typescript/dist/src/components/charts/index.js +4 -0
- package/typescript/dist/src/components/charts/index.js.map +1 -0
- package/typescript/dist/src/components/filters/FilterPanel.d.ts +9 -0
- package/typescript/dist/src/components/filters/FilterPanel.d.ts.map +1 -0
- package/typescript/dist/src/components/filters/FilterPanel.js +42 -0
- package/typescript/dist/src/components/filters/FilterPanel.js.map +1 -0
- package/typescript/dist/src/components/filters/index.d.ts +2 -0
- package/typescript/dist/src/components/filters/index.d.ts.map +1 -0
- package/typescript/dist/src/components/filters/index.js +2 -0
- package/typescript/dist/src/components/filters/index.js.map +1 -0
- package/typescript/dist/src/components/ui/Button.d.ts +8 -0
- package/typescript/dist/src/components/ui/Button.d.ts.map +1 -0
- package/typescript/dist/src/components/ui/Button.js +16 -0
- package/typescript/dist/src/components/ui/Button.js.map +1 -0
- package/typescript/dist/src/components/ui/Card.d.ts +14 -0
- package/typescript/dist/src/components/ui/Card.d.ts.map +1 -0
- package/typescript/dist/src/components/ui/Card.js +27 -0
- package/typescript/dist/src/components/ui/Card.js.map +1 -0
- package/typescript/dist/src/components/ui/Input.d.ts +9 -0
- package/typescript/dist/src/components/ui/Input.d.ts.map +1 -0
- package/typescript/dist/src/components/ui/Input.js +13 -0
- package/typescript/dist/src/components/ui/Input.js.map +1 -0
- package/typescript/dist/src/components/ui/Select.d.ts +14 -0
- package/typescript/dist/src/components/ui/Select.d.ts.map +1 -0
- package/typescript/dist/src/components/ui/Select.js +13 -0
- package/typescript/dist/src/components/ui/Select.js.map +1 -0
- package/typescript/dist/src/components/ui/index.d.ts +5 -0
- package/typescript/dist/src/components/ui/index.d.ts.map +1 -0
- package/typescript/dist/src/components/ui/index.js +5 -0
- package/typescript/dist/src/components/ui/index.js.map +1 -0
- package/typescript/dist/src/index.d.ts +4 -0
- package/typescript/dist/src/index.d.ts.map +1 -0
- package/typescript/dist/src/index.js +4 -0
- package/typescript/dist/src/index.js.map +1 -0
- package/typescript/dist/src/layouts/MainLayout.d.ts +2 -0
- package/typescript/dist/src/layouts/MainLayout.d.ts.map +1 -0
- package/typescript/dist/src/layouts/MainLayout.js +45 -0
- package/typescript/dist/src/layouts/MainLayout.js.map +1 -0
- package/typescript/dist/src/lib/api/benchmarks.d.ts +87 -0
- package/typescript/dist/src/lib/api/benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/api/benchmarks.js +274 -0
- package/typescript/dist/src/lib/api/benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/api/index.d.ts +2 -0
- package/typescript/dist/src/lib/api/index.d.ts.map +1 -0
- package/typescript/dist/src/lib/api/index.js +2 -0
- package/typescript/dist/src/lib/api/index.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/accident-benchmarks.d.ts +33 -0
- package/typescript/dist/src/lib/mock-data/accident-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/accident-benchmarks.js +124 -0
- package/typescript/dist/src/lib/mock-data/accident-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/basic-life-benchmarks.d.ts +47 -0
- package/typescript/dist/src/lib/mock-data/basic-life-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/basic-life-benchmarks.js +83 -0
- package/typescript/dist/src/lib/mock-data/basic-life-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/critical-illness-benchmarks.d.ts +39 -0
- package/typescript/dist/src/lib/mock-data/critical-illness-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/critical-illness-benchmarks.js +130 -0
- package/typescript/dist/src/lib/mock-data/critical-illness-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/dental-benchmarks.d.ts +42 -0
- package/typescript/dist/src/lib/mock-data/dental-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/dental-benchmarks.js +137 -0
- package/typescript/dist/src/lib/mock-data/dental-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/hospital-indemnity-benchmarks.d.ts +37 -0
- package/typescript/dist/src/lib/mock-data/hospital-indemnity-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/hospital-indemnity-benchmarks.js +128 -0
- package/typescript/dist/src/lib/mock-data/hospital-indemnity-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/index.d.ts +3 -0
- package/typescript/dist/src/lib/mock-data/index.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/index.js +3 -0
- package/typescript/dist/src/lib/mock-data/index.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/ltd-benchmarks.d.ts +59 -0
- package/typescript/dist/src/lib/mock-data/ltd-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/ltd-benchmarks.js +127 -0
- package/typescript/dist/src/lib/mock-data/ltd-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/std-benchmarks.d.ts +51 -0
- package/typescript/dist/src/lib/mock-data/std-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/std-benchmarks.js +111 -0
- package/typescript/dist/src/lib/mock-data/std-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/vision-benchmarks.d.ts +32 -0
- package/typescript/dist/src/lib/mock-data/vision-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/vision-benchmarks.js +151 -0
- package/typescript/dist/src/lib/mock-data/vision-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/mock-data/voluntary-life-benchmarks.d.ts +39 -0
- package/typescript/dist/src/lib/mock-data/voluntary-life-benchmarks.d.ts.map +1 -0
- package/typescript/dist/src/lib/mock-data/voluntary-life-benchmarks.js +97 -0
- package/typescript/dist/src/lib/mock-data/voluntary-life-benchmarks.js.map +1 -0
- package/typescript/dist/src/lib/transformers/api-to-internal.d.ts +42 -0
- package/typescript/dist/src/lib/transformers/api-to-internal.d.ts.map +1 -0
- package/typescript/dist/src/lib/transformers/api-to-internal.js +206 -0
- package/typescript/dist/src/lib/transformers/api-to-internal.js.map +1 -0
- package/typescript/dist/src/lib/transformers/index.d.ts +2 -0
- package/typescript/dist/src/lib/transformers/index.d.ts.map +1 -0
- package/typescript/dist/src/lib/transformers/index.js +2 -0
- package/typescript/dist/src/lib/transformers/index.js.map +1 -0
- package/typescript/dist/src/lib/types/accident.d.ts +46 -0
- package/typescript/dist/src/lib/types/accident.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/accident.js +223 -0
- package/typescript/dist/src/lib/types/accident.js.map +1 -0
- package/typescript/dist/src/lib/types/api-schema.d.ts +476 -0
- package/typescript/dist/src/lib/types/api-schema.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/api-schema.js +2 -0
- package/typescript/dist/src/lib/types/api-schema.js.map +1 -0
- package/typescript/dist/src/lib/types/basic-life.d.ts +30 -0
- package/typescript/dist/src/lib/types/basic-life.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/basic-life.js +137 -0
- package/typescript/dist/src/lib/types/basic-life.js.map +1 -0
- package/typescript/dist/src/lib/types/common.d.ts +99 -0
- package/typescript/dist/src/lib/types/common.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/common.js +29 -0
- package/typescript/dist/src/lib/types/common.js.map +1 -0
- package/typescript/dist/src/lib/types/critical-illness.d.ts +52 -0
- package/typescript/dist/src/lib/types/critical-illness.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/critical-illness.js +254 -0
- package/typescript/dist/src/lib/types/critical-illness.js.map +1 -0
- package/typescript/dist/src/lib/types/dental.d.ts +41 -0
- package/typescript/dist/src/lib/types/dental.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/dental.js +188 -0
- package/typescript/dist/src/lib/types/dental.js.map +1 -0
- package/typescript/dist/src/lib/types/hospital-indemnity.d.ts +41 -0
- package/typescript/dist/src/lib/types/hospital-indemnity.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/hospital-indemnity.js +191 -0
- package/typescript/dist/src/lib/types/hospital-indemnity.js.map +1 -0
- package/typescript/dist/src/lib/types/index.d.ts +12 -0
- package/typescript/dist/src/lib/types/index.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/index.js +12 -0
- package/typescript/dist/src/lib/types/index.js.map +1 -0
- package/typescript/dist/src/lib/types/ltd.d.ts +42 -0
- package/typescript/dist/src/lib/types/ltd.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/ltd.js +200 -0
- package/typescript/dist/src/lib/types/ltd.js.map +1 -0
- package/typescript/dist/src/lib/types/std.d.ts +31 -0
- package/typescript/dist/src/lib/types/std.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/std.js +144 -0
- package/typescript/dist/src/lib/types/std.js.map +1 -0
- package/typescript/dist/src/lib/types/vision.d.ts +31 -0
- package/typescript/dist/src/lib/types/vision.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/vision.js +129 -0
- package/typescript/dist/src/lib/types/vision.js.map +1 -0
- package/typescript/dist/src/lib/types/voluntary-life.d.ts +33 -0
- package/typescript/dist/src/lib/types/voluntary-life.d.ts.map +1 -0
- package/typescript/dist/src/lib/types/voluntary-life.js +144 -0
- package/typescript/dist/src/lib/types/voluntary-life.js.map +1 -0
- package/typescript/dist/src/lib/utils/format.d.ts +11 -0
- package/typescript/dist/src/lib/utils/format.d.ts.map +1 -0
- package/typescript/dist/src/lib/utils/format.js +95 -0
- package/typescript/dist/src/lib/utils/format.js.map +1 -0
- package/typescript/dist/src/lib/utils/index.d.ts +2 -0
- package/typescript/dist/src/lib/utils/index.d.ts.map +1 -0
- package/typescript/dist/src/lib/utils/index.js +2 -0
- package/typescript/dist/src/lib/utils/index.js.map +1 -0
- package/typescript/dist/src/main.d.ts +2 -0
- package/typescript/dist/src/main.d.ts.map +1 -0
- package/typescript/dist/src/main.js +20 -0
- package/typescript/dist/src/main.js.map +1 -0
- package/typescript/dist/src/pages/AccidentComparison.d.ts +2 -0
- package/typescript/dist/src/pages/AccidentComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/AccidentComparison.js +56 -0
- package/typescript/dist/src/pages/AccidentComparison.js.map +1 -0
- package/typescript/dist/src/pages/AccidentExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/AccidentExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/AccidentExplorer.js +29 -0
- package/typescript/dist/src/pages/AccidentExplorer.js.map +1 -0
- package/typescript/dist/src/pages/BasicLifeComparison.d.ts +2 -0
- package/typescript/dist/src/pages/BasicLifeComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/BasicLifeComparison.js +59 -0
- package/typescript/dist/src/pages/BasicLifeComparison.js.map +1 -0
- package/typescript/dist/src/pages/BasicLifeExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/BasicLifeExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/BasicLifeExplorer.js +29 -0
- package/typescript/dist/src/pages/BasicLifeExplorer.js.map +1 -0
- package/typescript/dist/src/pages/CriticalIllnessComparison.d.ts +2 -0
- package/typescript/dist/src/pages/CriticalIllnessComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/CriticalIllnessComparison.js +56 -0
- package/typescript/dist/src/pages/CriticalIllnessComparison.js.map +1 -0
- package/typescript/dist/src/pages/CriticalIllnessExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/CriticalIllnessExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/CriticalIllnessExplorer.js +29 -0
- package/typescript/dist/src/pages/CriticalIllnessExplorer.js.map +1 -0
- package/typescript/dist/src/pages/Dashboard.d.ts +2 -0
- package/typescript/dist/src/pages/Dashboard.d.ts.map +1 -0
- package/typescript/dist/src/pages/Dashboard.js +8 -0
- package/typescript/dist/src/pages/Dashboard.js.map +1 -0
- package/typescript/dist/src/pages/DentalComparison.d.ts +2 -0
- package/typescript/dist/src/pages/DentalComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/DentalComparison.js +64 -0
- package/typescript/dist/src/pages/DentalComparison.js.map +1 -0
- package/typescript/dist/src/pages/DentalExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/DentalExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/DentalExplorer.js +29 -0
- package/typescript/dist/src/pages/DentalExplorer.js.map +1 -0
- package/typescript/dist/src/pages/HospitalIndemnityComparison.d.ts +2 -0
- package/typescript/dist/src/pages/HospitalIndemnityComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/HospitalIndemnityComparison.js +53 -0
- package/typescript/dist/src/pages/HospitalIndemnityComparison.js.map +1 -0
- package/typescript/dist/src/pages/HospitalIndemnityExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/HospitalIndemnityExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/HospitalIndemnityExplorer.js +29 -0
- package/typescript/dist/src/pages/HospitalIndemnityExplorer.js.map +1 -0
- package/typescript/dist/src/pages/LTDComparison.d.ts +2 -0
- package/typescript/dist/src/pages/LTDComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/LTDComparison.js +64 -0
- package/typescript/dist/src/pages/LTDComparison.js.map +1 -0
- package/typescript/dist/src/pages/LTDExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/LTDExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/LTDExplorer.js +29 -0
- package/typescript/dist/src/pages/LTDExplorer.js.map +1 -0
- package/typescript/dist/src/pages/STDComparison.d.ts +2 -0
- package/typescript/dist/src/pages/STDComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/STDComparison.js +58 -0
- package/typescript/dist/src/pages/STDComparison.js.map +1 -0
- package/typescript/dist/src/pages/STDExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/STDExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/STDExplorer.js +29 -0
- package/typescript/dist/src/pages/STDExplorer.js.map +1 -0
- package/typescript/dist/src/pages/VisionComparison.d.ts +2 -0
- package/typescript/dist/src/pages/VisionComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/VisionComparison.js +64 -0
- package/typescript/dist/src/pages/VisionComparison.js.map +1 -0
- package/typescript/dist/src/pages/VisionExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/VisionExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/VisionExplorer.js +29 -0
- package/typescript/dist/src/pages/VisionExplorer.js.map +1 -0
- package/typescript/dist/src/pages/VoluntaryLifeComparison.d.ts +2 -0
- package/typescript/dist/src/pages/VoluntaryLifeComparison.d.ts.map +1 -0
- package/typescript/dist/src/pages/VoluntaryLifeComparison.js +51 -0
- package/typescript/dist/src/pages/VoluntaryLifeComparison.js.map +1 -0
- package/typescript/dist/src/pages/VoluntaryLifeExplorer.d.ts +2 -0
- package/typescript/dist/src/pages/VoluntaryLifeExplorer.d.ts.map +1 -0
- package/typescript/dist/src/pages/VoluntaryLifeExplorer.js +29 -0
- package/typescript/dist/src/pages/VoluntaryLifeExplorer.js.map +1 -0
- package/typescript/dist/src/runtime/index.d.ts +2 -0
- package/typescript/dist/src/runtime/index.d.ts.map +1 -0
- package/typescript/dist/src/runtime/index.js +2 -0
- package/typescript/dist/src/runtime/index.js.map +1 -0
- package/typescript/dist/src/runtime/lifecycle.d.ts +16 -0
- package/typescript/dist/src/runtime/lifecycle.d.ts.map +1 -0
- package/typescript/dist/src/runtime/lifecycle.js +50 -0
- package/typescript/dist/src/runtime/lifecycle.js.map +1 -0
- package/typescript/dist/src/server/abort-support.d.ts +20 -0
- package/typescript/dist/src/server/abort-support.d.ts.map +1 -0
- package/typescript/dist/src/server/abort-support.js +101 -0
- package/typescript/dist/src/server/abort-support.js.map +1 -0
- package/typescript/dist/src/server/advanced-memory-monitor.d.ts +189 -0
- package/typescript/dist/src/server/advanced-memory-monitor.d.ts.map +1 -0
- package/typescript/dist/src/server/advanced-memory-monitor.js +718 -0
- package/typescript/dist/src/server/advanced-memory-monitor.js.map +1 -0
- package/typescript/dist/src/server/architecture-detector.d.ts +72 -0
- package/typescript/dist/src/server/architecture-detector.d.ts.map +1 -0
- package/typescript/dist/src/server/architecture-detector.js +282 -0
- package/typescript/dist/src/server/architecture-detector.js.map +1 -0
- package/typescript/dist/src/server/batch-processor-tool.d.ts +69 -0
- package/typescript/dist/src/server/batch-processor-tool.d.ts.map +1 -0
- package/typescript/dist/src/server/batch-processor-tool.js +651 -0
- package/typescript/dist/src/server/batch-processor-tool.js.map +1 -0
- package/typescript/dist/src/server/batch-processor.d.ts +73 -0
- package/typescript/dist/src/server/batch-processor.d.ts.map +1 -0
- package/typescript/dist/src/server/batch-processor.js +264 -0
- package/typescript/dist/src/server/batch-processor.js.map +1 -0
- package/typescript/dist/src/server/browser-stub.d.ts +18 -0
- package/typescript/dist/src/server/browser-stub.d.ts.map +1 -0
- package/typescript/dist/src/server/browser-stub.js +21 -0
- package/typescript/dist/src/server/browser-stub.js.map +1 -0
- package/typescript/dist/src/server/cache.d.ts +92 -0
- package/typescript/dist/src/server/cache.d.ts.map +1 -0
- package/typescript/dist/src/server/cache.js +217 -0
- package/typescript/dist/src/server/cache.js.map +1 -0
- package/typescript/dist/src/server/circular-deps.d.ts +85 -0
- package/typescript/dist/src/server/circular-deps.d.ts.map +1 -0
- package/typescript/dist/src/server/circular-deps.js +331 -0
- package/typescript/dist/src/server/circular-deps.js.map +1 -0
- package/typescript/dist/src/server/claude-code-env.d.ts +50 -0
- package/typescript/dist/src/server/claude-code-env.d.ts.map +1 -0
- package/typescript/dist/src/server/claude-code-env.js +116 -0
- package/typescript/dist/src/server/claude-code-env.js.map +1 -0
- package/typescript/dist/src/server/code-analysis-tool.d.ts +79 -0
- package/typescript/dist/src/server/code-analysis-tool.d.ts.map +1 -0
- package/typescript/dist/src/server/code-analysis-tool.js +94 -0
- package/typescript/dist/src/server/code-analysis-tool.js.map +1 -0
- package/typescript/dist/src/server/code-analysis.d.ts +16 -0
- package/typescript/dist/src/server/code-analysis.d.ts.map +1 -0
- package/typescript/dist/src/server/code-analysis.js +462 -0
- package/typescript/dist/src/server/code-analysis.js.map +1 -0
- package/typescript/dist/src/server/code-transformation.d.ts +141 -0
- package/typescript/dist/src/server/code-transformation.d.ts.map +1 -0
- package/typescript/dist/src/server/code-transformation.js +918 -0
- package/typescript/dist/src/server/code-transformation.js.map +1 -0
- package/typescript/dist/src/server/comprehensive-code-analysis.d.ts +77 -0
- package/typescript/dist/src/server/comprehensive-code-analysis.d.ts.map +1 -0
- package/typescript/dist/src/server/comprehensive-code-analysis.js +613 -0
- package/typescript/dist/src/server/comprehensive-code-analysis.js.map +1 -0
- package/typescript/dist/src/server/concurrency.d.ts +5 -0
- package/typescript/dist/src/server/concurrency.d.ts.map +1 -0
- package/typescript/dist/src/server/concurrency.js +20 -0
- package/typescript/dist/src/server/concurrency.js.map +1 -0
- package/typescript/dist/src/server/context-manager.d.ts +97 -0
- package/typescript/dist/src/server/context-manager.d.ts.map +1 -0
- package/typescript/dist/src/server/context-manager.js +410 -0
- package/typescript/dist/src/server/context-manager.js.map +1 -0
- package/typescript/dist/src/server/context-session-manager.d.ts +47 -0
- package/typescript/dist/src/server/context-session-manager.d.ts.map +1 -0
- package/typescript/dist/src/server/context-session-manager.js +594 -0
- package/typescript/dist/src/server/context-session-manager.js.map +1 -0
- package/typescript/dist/src/server/context.d.ts +66 -0
- package/typescript/dist/src/server/context.d.ts.map +1 -0
- package/typescript/dist/src/server/context.js +275 -0
- package/typescript/dist/src/server/context.js.map +1 -0
- package/typescript/dist/src/server/dependency-analyzer.d.ts +100 -0
- package/typescript/dist/src/server/dependency-analyzer.d.ts.map +1 -0
- package/typescript/dist/src/server/dependency-analyzer.js +1117 -0
- package/typescript/dist/src/server/dependency-analyzer.js.map +1 -0
- package/typescript/dist/src/server/error-handling.d.ts +106 -0
- package/typescript/dist/src/server/error-handling.d.ts.map +1 -0
- package/typescript/dist/src/server/error-handling.js +363 -0
- package/typescript/dist/src/server/error-handling.js.map +1 -0
- package/typescript/dist/src/server/file-discovery.d.ts +60 -0
- package/typescript/dist/src/server/file-discovery.d.ts.map +1 -0
- package/typescript/dist/src/server/file-discovery.js +282 -0
- package/typescript/dist/src/server/file-discovery.js.map +1 -0
- package/typescript/dist/src/server/file-streaming.d.ts +152 -0
- package/typescript/dist/src/server/file-streaming.d.ts.map +1 -0
- package/typescript/dist/src/server/file-streaming.js +627 -0
- package/typescript/dist/src/server/file-streaming.js.map +1 -0
- package/typescript/dist/src/server/files.d.ts +100 -0
- package/typescript/dist/src/server/files.d.ts.map +1 -0
- package/typescript/dist/src/server/files.js +609 -0
- package/typescript/dist/src/server/files.js.map +1 -0
- package/typescript/dist/src/server/index.d.ts +54 -0
- package/typescript/dist/src/server/index.d.ts.map +1 -0
- package/typescript/dist/src/server/index.js +54 -0
- package/typescript/dist/src/server/index.js.map +1 -0
- package/typescript/dist/src/server/logger.d.ts +95 -0
- package/typescript/dist/src/server/logger.d.ts.map +1 -0
- package/typescript/dist/src/server/logger.js +271 -0
- package/typescript/dist/src/server/logger.js.map +1 -0
- package/typescript/dist/src/server/memory-aware-cache.d.ts +169 -0
- package/typescript/dist/src/server/memory-aware-cache.d.ts.map +1 -0
- package/typescript/dist/src/server/memory-aware-cache.js +655 -0
- package/typescript/dist/src/server/memory-aware-cache.js.map +1 -0
- package/typescript/dist/src/server/memory-monitor-tool.d.ts +46 -0
- package/typescript/dist/src/server/memory-monitor-tool.d.ts.map +1 -0
- package/typescript/dist/src/server/memory-monitor-tool.js +381 -0
- package/typescript/dist/src/server/memory-monitor-tool.js.map +1 -0
- package/typescript/dist/src/server/memory-monitor.d.ts +79 -0
- package/typescript/dist/src/server/memory-monitor.d.ts.map +1 -0
- package/typescript/dist/src/server/memory-monitor.js +333 -0
- package/typescript/dist/src/server/memory-monitor.js.map +1 -0
- package/typescript/dist/src/server/optimization-engine.d.ts +68 -0
- package/typescript/dist/src/server/optimization-engine.d.ts.map +1 -0
- package/typescript/dist/src/server/optimization-engine.js +728 -0
- package/typescript/dist/src/server/optimization-engine.js.map +1 -0
- package/typescript/dist/src/server/path-manager.d.ts +46 -0
- package/typescript/dist/src/server/path-manager.d.ts.map +1 -0
- package/typescript/dist/src/server/path-manager.js +155 -0
- package/typescript/dist/src/server/path-manager.js.map +1 -0
- package/typescript/dist/src/server/pattern-analyzer.d.ts +69 -0
- package/typescript/dist/src/server/pattern-analyzer.d.ts.map +1 -0
- package/typescript/dist/src/server/pattern-analyzer.js +497 -0
- package/typescript/dist/src/server/pattern-analyzer.js.map +1 -0
- package/typescript/dist/src/server/performance-observer.d.ts +61 -0
- package/typescript/dist/src/server/performance-observer.d.ts.map +1 -0
- package/typescript/dist/src/server/performance-observer.js +394 -0
- package/typescript/dist/src/server/performance-observer.js.map +1 -0
- package/typescript/dist/src/server/performance.d.ts +121 -0
- package/typescript/dist/src/server/performance.d.ts.map +1 -0
- package/typescript/dist/src/server/performance.js +520 -0
- package/typescript/dist/src/server/performance.js.map +1 -0
- package/typescript/dist/src/server/report-generator.d.ts +131 -0
- package/typescript/dist/src/server/report-generator.d.ts.map +1 -0
- package/typescript/dist/src/server/report-generator.js +1158 -0
- package/typescript/dist/src/server/report-generator.js.map +1 -0
- package/typescript/dist/src/server/resource-lifecycle-manager.d.ts +231 -0
- package/typescript/dist/src/server/resource-lifecycle-manager.d.ts.map +1 -0
- package/typescript/dist/src/server/resource-lifecycle-manager.js +839 -0
- package/typescript/dist/src/server/resource-lifecycle-manager.js.map +1 -0
- package/typescript/dist/src/server/retry-operations.d.ts +59 -0
- package/typescript/dist/src/server/retry-operations.d.ts.map +1 -0
- package/typescript/dist/src/server/retry-operations.js +68 -0
- package/typescript/dist/src/server/retry-operations.js.map +1 -0
- package/typescript/dist/src/server/retry.d.ts +18 -0
- package/typescript/dist/src/server/retry.d.ts.map +1 -0
- package/typescript/dist/src/server/retry.js +44 -0
- package/typescript/dist/src/server/retry.js.map +1 -0
- package/typescript/dist/src/server/retryable.d.ts +2 -0
- package/typescript/dist/src/server/retryable.d.ts.map +1 -0
- package/typescript/dist/src/server/retryable.js +21 -0
- package/typescript/dist/src/server/retryable.js.map +1 -0
- package/typescript/dist/src/server/scheduler.d.ts +4 -0
- package/typescript/dist/src/server/scheduler.d.ts.map +1 -0
- package/typescript/dist/src/server/scheduler.js +21 -0
- package/typescript/dist/src/server/scheduler.js.map +1 -0
- package/typescript/dist/src/server/security-scanner.d.ts +59 -0
- package/typescript/dist/src/server/security-scanner.d.ts.map +1 -0
- package/typescript/dist/src/server/security-scanner.js +915 -0
- package/typescript/dist/src/server/security-scanner.js.map +1 -0
- package/typescript/dist/src/server/security.d.ts +25 -0
- package/typescript/dist/src/server/security.d.ts.map +1 -0
- package/typescript/dist/src/server/security.js +298 -0
- package/typescript/dist/src/server/security.js.map +1 -0
- package/typescript/dist/src/server/session-management.d.ts +103 -0
- package/typescript/dist/src/server/session-management.d.ts.map +1 -0
- package/typescript/dist/src/server/session-management.js +149 -0
- package/typescript/dist/src/server/session-management.js.map +1 -0
- package/typescript/dist/src/server/session-recovery.d.ts +91 -0
- package/typescript/dist/src/server/session-recovery.d.ts.map +1 -0
- package/typescript/dist/src/server/session-recovery.js +384 -0
- package/typescript/dist/src/server/session-recovery.js.map +1 -0
- package/typescript/dist/src/server/session.d.ts +18 -0
- package/typescript/dist/src/server/session.d.ts.map +1 -0
- package/typescript/dist/src/server/session.js +46 -0
- package/typescript/dist/src/server/session.js.map +1 -0
- package/typescript/dist/src/server/simple-tools.d.ts +15 -0
- package/typescript/dist/src/server/simple-tools.d.ts.map +1 -0
- package/typescript/dist/src/server/simple-tools.js +15 -0
- package/typescript/dist/src/server/simple-tools.js.map +1 -0
- package/typescript/dist/src/server/streaming-utilities.d.ts +107 -0
- package/typescript/dist/src/server/streaming-utilities.d.ts.map +1 -0
- package/typescript/dist/src/server/streaming-utilities.js +822 -0
- package/typescript/dist/src/server/streaming-utilities.js.map +1 -0
- package/typescript/dist/src/server/streams.d.ts +48 -0
- package/typescript/dist/src/server/streams.d.ts.map +1 -0
- package/typescript/dist/src/server/streams.js +489 -0
- package/typescript/dist/src/server/streams.js.map +1 -0
- package/typescript/dist/src/server/stringify-advanced.d.ts +31 -0
- package/typescript/dist/src/server/stringify-advanced.d.ts.map +1 -0
- package/typescript/dist/src/server/stringify-advanced.js +183 -0
- package/typescript/dist/src/server/stringify-advanced.js.map +1 -0
- package/typescript/dist/src/server/structured-clone-tool.d.ts +101 -0
- package/typescript/dist/src/server/structured-clone-tool.d.ts.map +1 -0
- package/typescript/dist/src/server/structured-clone-tool.js +450 -0
- package/typescript/dist/src/server/structured-clone-tool.js.map +1 -0
- package/typescript/dist/src/server/structured-clone.d.ts +59 -0
- package/typescript/dist/src/server/structured-clone.d.ts.map +1 -0
- package/typescript/dist/src/server/structured-clone.js +307 -0
- package/typescript/dist/src/server/structured-clone.js.map +1 -0
- package/typescript/dist/src/server/test-runner.d.ts +78 -0
- package/typescript/dist/src/server/test-runner.d.ts.map +1 -0
- package/typescript/dist/src/server/test-runner.js +1024 -0
- package/typescript/dist/src/server/test-runner.js.map +1 -0
- package/typescript/dist/src/server/tool-helpers.d.ts +6 -0
- package/typescript/dist/src/server/tool-helpers.d.ts.map +1 -0
- package/typescript/dist/src/server/tool-helpers.js +27 -0
- package/typescript/dist/src/server/tool-helpers.js.map +1 -0
- package/typescript/dist/src/server/validation.d.ts +79 -0
- package/typescript/dist/src/server/validation.d.ts.map +1 -0
- package/typescript/dist/src/server/validation.js +613 -0
- package/typescript/dist/src/server/validation.js.map +1 -0
- package/typescript/dist/src/server/worker-pool.d.ts +87 -0
- package/typescript/dist/src/server/worker-pool.d.ts.map +1 -0
- package/typescript/dist/src/server/worker-pool.js +586 -0
- package/typescript/dist/src/server/worker-pool.js.map +1 -0
- package/typescript/dist/src/server/worker-threads.d.ts +95 -0
- package/typescript/dist/src/server/worker-threads.d.ts.map +1 -0
- package/typescript/dist/src/server/worker-threads.js +1074 -0
- package/typescript/dist/src/server/worker-threads.js.map +1 -0
- package/typescript/dist/src/server/workflow-orchestrator.d.ts +122 -0
- package/typescript/dist/src/server/workflow-orchestrator.d.ts.map +1 -0
- package/typescript/dist/src/server/workflow-orchestrator.js +2131 -0
- package/typescript/dist/src/server/workflow-orchestrator.js.map +1 -0
- package/typescript/dist/src/server/worktree-manager.d.ts +70 -0
- package/typescript/dist/src/server/worktree-manager.d.ts.map +1 -0
- package/typescript/dist/src/server/worktree-manager.js +741 -0
- package/typescript/dist/src/server/worktree-manager.js.map +1 -0
- package/typescript/dist/src/shared/constants.d.ts +5 -0
- package/typescript/dist/src/shared/constants.d.ts.map +1 -0
- package/typescript/dist/src/shared/constants.js +5 -0
- package/typescript/dist/src/shared/constants.js.map +1 -0
- package/typescript/dist/src/shared/entity-config.d.ts +76 -0
- package/typescript/dist/src/shared/entity-config.d.ts.map +1 -0
- package/typescript/dist/src/shared/entity-config.js +2 -0
- package/typescript/dist/src/shared/entity-config.js.map +1 -0
- package/typescript/dist/src/shared/environment.d.ts +18 -0
- package/typescript/dist/src/shared/environment.d.ts.map +1 -0
- package/typescript/dist/src/shared/environment.js +39 -0
- package/typescript/dist/src/shared/environment.js.map +1 -0
- package/typescript/dist/src/shared/index.d.ts +6 -0
- package/typescript/dist/src/shared/index.d.ts.map +1 -0
- package/typescript/dist/src/shared/index.js +6 -0
- package/typescript/dist/src/shared/index.js.map +1 -0
- package/typescript/dist/src/shared/stringify.d.ts +16 -0
- package/typescript/dist/src/shared/stringify.d.ts.map +1 -0
- package/typescript/dist/src/shared/stringify.js +195 -0
- package/typescript/dist/src/shared/stringify.js.map +1 -0
- package/typescript/dist/src/shared/timeout.d.ts +27 -0
- package/typescript/dist/src/shared/timeout.d.ts.map +1 -0
- package/typescript/dist/src/shared/timeout.js +196 -0
- package/typescript/dist/src/shared/timeout.js.map +1 -0
- package/typescript/dist/src/types/mcp.d.ts +23 -0
- package/typescript/dist/src/types/mcp.d.ts.map +1 -0
- package/typescript/dist/src/types/mcp.js +2 -0
- package/typescript/dist/src/types/mcp.js.map +1 -0
- package/typescript/dist/tsconfig.tsbuildinfo +1 -0
- package/typescript/dist/vite.config.d.ts +3 -0
- package/typescript/dist/vite.config.d.ts.map +1 -0
- package/typescript/dist/vite.config.js +12 -0
- package/typescript/dist/vite.config.js.map +1 -0
- package/typescript/nextjs.json +17 -0
- package/typescript/node.json +10 -0
- package/typescript/react-native.json +8 -0
- package/typescript/react.json +12 -0
|
@@ -0,0 +1,915 @@
|
|
|
1
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
2
|
+
import { join, extname } from 'node:path';
|
|
3
|
+
import { logDebug, logWarn } from '@repo/shared/logs/client/next';
|
|
4
|
+
import { REGEX_TIMEOUT_MS } from '../shared/constants.js';
|
|
5
|
+
import { safeThrowIfAborted } from './abort-support';
|
|
6
|
+
import { ErrorPatterns } from './error-handling';
|
|
7
|
+
import { SafeRegexExecutor } from './security';
|
|
8
|
+
import { ok, runTool } from './tool-helpers';
|
|
9
|
+
import { validateContentSize, validateFilePath, validateSessionId } from './validation';
|
|
10
|
+
export const securityScannerTool = {
|
|
11
|
+
name: 'security_scanner',
|
|
12
|
+
description: 'Comprehensive security scanning replacing 23 security functions',
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
action: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
enum: [
|
|
19
|
+
'detectSecrets',
|
|
20
|
+
'detectInjection',
|
|
21
|
+
'detectXSS',
|
|
22
|
+
'detectPathTraversal',
|
|
23
|
+
'detectCrypto',
|
|
24
|
+
'detectAuth',
|
|
25
|
+
'scanDependencies',
|
|
26
|
+
'scanProjectFiles',
|
|
27
|
+
'scanSecretsOnly',
|
|
28
|
+
'scanDependenciesOnly',
|
|
29
|
+
'getSecurityPatterns',
|
|
30
|
+
'generateRecommendations',
|
|
31
|
+
'getRemediation',
|
|
32
|
+
'fullSecurityScan',
|
|
33
|
+
],
|
|
34
|
+
description: 'Security scanning action to perform',
|
|
35
|
+
},
|
|
36
|
+
content: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'File content to analyze',
|
|
39
|
+
},
|
|
40
|
+
filePath: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'Path to the file being analyzed',
|
|
43
|
+
},
|
|
44
|
+
packagePath: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'Path to the package/project root',
|
|
47
|
+
},
|
|
48
|
+
scanDepth: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
enum: ['standard', 'deep'],
|
|
51
|
+
description: 'Depth of security scanning',
|
|
52
|
+
default: 'standard',
|
|
53
|
+
},
|
|
54
|
+
sessionId: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Session identifier for logging',
|
|
57
|
+
},
|
|
58
|
+
vulnerabilityType: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Specific vulnerability type for remediation',
|
|
61
|
+
},
|
|
62
|
+
signal: {
|
|
63
|
+
description: 'AbortSignal for cancelling the operation',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
required: ['action'],
|
|
67
|
+
},
|
|
68
|
+
async execute(args) {
|
|
69
|
+
return runTool('security_scanner', args.action, async () => {
|
|
70
|
+
const { action, content, filePath, packagePath, scanDepth = 'standard', sessionId, vulnerabilityType, allowedBasePaths = [], signal, } = args;
|
|
71
|
+
safeThrowIfAborted(signal);
|
|
72
|
+
switch (action) {
|
|
73
|
+
case 'detectSecrets': {
|
|
74
|
+
if (!content || !filePath) {
|
|
75
|
+
throw new Error('Content and file path required for secret detection');
|
|
76
|
+
}
|
|
77
|
+
const allowedBases = allowedBasePaths && allowedBasePaths.length > 0
|
|
78
|
+
? allowedBasePaths
|
|
79
|
+
: packagePath
|
|
80
|
+
? [packagePath]
|
|
81
|
+
: [process.cwd()];
|
|
82
|
+
const filePathValidation = validateFilePath(filePath, allowedBases);
|
|
83
|
+
if (!filePathValidation.isValid) {
|
|
84
|
+
throw new Error(`Invalid file path: ${filePathValidation.error}`);
|
|
85
|
+
}
|
|
86
|
+
const contentValidation = validateContentSize(content);
|
|
87
|
+
if (!contentValidation.isValid) {
|
|
88
|
+
throw new Error(`Invalid content: ${contentValidation.error}`);
|
|
89
|
+
}
|
|
90
|
+
if (sessionId) {
|
|
91
|
+
const sessionValidation = validateSessionId(sessionId);
|
|
92
|
+
if (!sessionValidation.isValid) {
|
|
93
|
+
throw new Error(`Invalid session ID: ${sessionValidation.error}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const patterns = getSecretPatterns();
|
|
97
|
+
const secrets = await detectSecrets(contentValidation.sanitized, filePathValidation.sanitized, patterns, signal);
|
|
98
|
+
return ok(secrets);
|
|
99
|
+
}
|
|
100
|
+
case 'detectInjection': {
|
|
101
|
+
if (!content || !filePath) {
|
|
102
|
+
throw new Error('Content and file path required for injection detection');
|
|
103
|
+
}
|
|
104
|
+
const patterns = getInjectionPatterns(scanDepth);
|
|
105
|
+
const vulnerabilities = await detectInjectionVulns(content, filePath, patterns, signal);
|
|
106
|
+
return ok(vulnerabilities);
|
|
107
|
+
}
|
|
108
|
+
case 'detectXSS': {
|
|
109
|
+
if (!content || !filePath) {
|
|
110
|
+
throw new Error('Content and file path required for XSS detection');
|
|
111
|
+
}
|
|
112
|
+
const patterns = getXSSPatterns(scanDepth);
|
|
113
|
+
const vulnerabilities = await detectXSSVulns(content, filePath, patterns, signal);
|
|
114
|
+
return ok(vulnerabilities);
|
|
115
|
+
}
|
|
116
|
+
case 'detectPathTraversal': {
|
|
117
|
+
if (!content || !filePath) {
|
|
118
|
+
throw new Error('Content and file path required for path traversal detection');
|
|
119
|
+
}
|
|
120
|
+
const patterns = getPathTraversalPatterns();
|
|
121
|
+
const vulnerabilities = await detectPathTraversal(content, filePath, patterns, signal);
|
|
122
|
+
return ok(vulnerabilities);
|
|
123
|
+
}
|
|
124
|
+
case 'detectCrypto': {
|
|
125
|
+
if (!content || !filePath) {
|
|
126
|
+
throw new Error('Content and file path required for crypto detection');
|
|
127
|
+
}
|
|
128
|
+
const patterns = getCryptoPatterns();
|
|
129
|
+
const vulnerabilities = await detectCryptoIssues(content, filePath, patterns, signal);
|
|
130
|
+
return ok(vulnerabilities);
|
|
131
|
+
}
|
|
132
|
+
case 'detectAuth': {
|
|
133
|
+
if (!content || !filePath) {
|
|
134
|
+
throw new Error('Content and file path required for auth detection');
|
|
135
|
+
}
|
|
136
|
+
const patterns = getAuthPatterns();
|
|
137
|
+
const vulnerabilities = await detectAuthIssues(content, filePath, patterns, signal);
|
|
138
|
+
return ok(vulnerabilities);
|
|
139
|
+
}
|
|
140
|
+
case 'scanDependencies': {
|
|
141
|
+
if (!packagePath) {
|
|
142
|
+
throw new Error('Package path required for dependency scanning');
|
|
143
|
+
}
|
|
144
|
+
const vulnerabilities = await scanDependencyVulnerabilities(packagePath, sessionId, scanDepth, signal);
|
|
145
|
+
return ok(vulnerabilities);
|
|
146
|
+
}
|
|
147
|
+
case 'getSecurityPatterns': {
|
|
148
|
+
const patterns = getSecurityPatterns(scanDepth);
|
|
149
|
+
return ok(patterns);
|
|
150
|
+
}
|
|
151
|
+
case 'getRemediation': {
|
|
152
|
+
if (!vulnerabilityType) {
|
|
153
|
+
throw new Error('Vulnerability type required for remediation');
|
|
154
|
+
}
|
|
155
|
+
const remediation = getRemediationByType(vulnerabilityType);
|
|
156
|
+
return ok(remediation);
|
|
157
|
+
}
|
|
158
|
+
case 'generateRecommendations': {
|
|
159
|
+
const securityData = args;
|
|
160
|
+
const recommendations = generateSecurityRecommendations(securityData);
|
|
161
|
+
return ok(recommendations);
|
|
162
|
+
}
|
|
163
|
+
case 'fullSecurityScan': {
|
|
164
|
+
if (!packagePath) {
|
|
165
|
+
throw new Error('Package path required for full security scan');
|
|
166
|
+
}
|
|
167
|
+
const fullScan = await performFullSecurityScan(packagePath, sessionId, scanDepth, signal);
|
|
168
|
+
return ok(fullScan);
|
|
169
|
+
}
|
|
170
|
+
case 'scanProjectFiles':
|
|
171
|
+
case 'scanSecretsOnly':
|
|
172
|
+
case 'scanDependenciesOnly': {
|
|
173
|
+
if (!packagePath) {
|
|
174
|
+
throw new Error('Package path required for project scanning');
|
|
175
|
+
}
|
|
176
|
+
const scanResult = await performSpecializedScan(action, packagePath, sessionId, scanDepth, signal);
|
|
177
|
+
return ok(scanResult);
|
|
178
|
+
}
|
|
179
|
+
case 'comprehensiveScan': {
|
|
180
|
+
if (!packagePath) {
|
|
181
|
+
throw new Error('Package path required for comprehensive scan');
|
|
182
|
+
}
|
|
183
|
+
const comprehensiveResult = await performComprehensiveScan(packagePath, sessionId, scanDepth, signal);
|
|
184
|
+
return ok(comprehensiveResult);
|
|
185
|
+
}
|
|
186
|
+
case 'quickScan': {
|
|
187
|
+
if (!packagePath) {
|
|
188
|
+
throw new Error('Package path required for quick scan');
|
|
189
|
+
}
|
|
190
|
+
const quickResult = await performQuickScan(packagePath, sessionId, signal);
|
|
191
|
+
return ok(quickResult);
|
|
192
|
+
}
|
|
193
|
+
case 'vulnScan': {
|
|
194
|
+
if (!packagePath) {
|
|
195
|
+
throw new Error('Package path required for vulnerability scan');
|
|
196
|
+
}
|
|
197
|
+
const vulnResult = await performVulnScan(packagePath, sessionId, scanDepth, signal);
|
|
198
|
+
return ok(vulnResult);
|
|
199
|
+
}
|
|
200
|
+
case 'criticalOnly': {
|
|
201
|
+
if (!packagePath) {
|
|
202
|
+
throw new Error('Package path required for critical-only scan');
|
|
203
|
+
}
|
|
204
|
+
const criticalResult = await performCriticalOnlyScan(packagePath, sessionId, signal);
|
|
205
|
+
return ok(criticalResult);
|
|
206
|
+
}
|
|
207
|
+
default:
|
|
208
|
+
throw ErrorPatterns.unknownAction(action, [
|
|
209
|
+
'detectSecrets',
|
|
210
|
+
'detectInjection',
|
|
211
|
+
'detectXSS',
|
|
212
|
+
'detectPathTraversal',
|
|
213
|
+
'detectCrypto',
|
|
214
|
+
'detectAuth',
|
|
215
|
+
'scanDependencies',
|
|
216
|
+
'getSecurityPatterns',
|
|
217
|
+
'getRemediation',
|
|
218
|
+
'generateRecommendations',
|
|
219
|
+
'fullSecurityScan',
|
|
220
|
+
'scanProjectFiles',
|
|
221
|
+
'scanSecretsOnly',
|
|
222
|
+
'scanDependenciesOnly',
|
|
223
|
+
'comprehensiveScan',
|
|
224
|
+
'quickScan',
|
|
225
|
+
'vulnScan',
|
|
226
|
+
'criticalOnly',
|
|
227
|
+
]);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
function getSecretPatterns() {
|
|
233
|
+
return {
|
|
234
|
+
aws_access_key: {
|
|
235
|
+
pattern: /AKIA[0-9A-Z]{16}/g,
|
|
236
|
+
severity: 'critical',
|
|
237
|
+
description: 'AWS Access Key ID',
|
|
238
|
+
},
|
|
239
|
+
aws_secret_key: {
|
|
240
|
+
pattern: /[A-Z0-9+/]{40}/gi,
|
|
241
|
+
severity: 'critical',
|
|
242
|
+
description: 'AWS Secret Access Key',
|
|
243
|
+
},
|
|
244
|
+
github_token: {
|
|
245
|
+
pattern: /ghp_[A-Za-z0-9]{36}/g,
|
|
246
|
+
severity: 'high',
|
|
247
|
+
description: 'GitHub Personal Access Token',
|
|
248
|
+
},
|
|
249
|
+
google_api_key: {
|
|
250
|
+
pattern: /AIza[0-9A-Za-z-_]{35}/g,
|
|
251
|
+
severity: 'high',
|
|
252
|
+
description: 'Google API Key',
|
|
253
|
+
},
|
|
254
|
+
private_key: {
|
|
255
|
+
pattern: /-----BEGIN [A-Z ]+PRIVATE KEY-----/g,
|
|
256
|
+
severity: 'critical',
|
|
257
|
+
description: 'Private Key',
|
|
258
|
+
},
|
|
259
|
+
jwt_token: {
|
|
260
|
+
pattern: /eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*/g,
|
|
261
|
+
severity: 'medium',
|
|
262
|
+
description: 'JWT Token',
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const MAX_CONTENT_SIZE = 512 * 1024;
|
|
267
|
+
const MAX_PATTERNS_PER_TYPE = 20;
|
|
268
|
+
function execRegexWithTimeout(pattern, text, timeoutMs = REGEX_TIMEOUT_MS) {
|
|
269
|
+
return SafeRegexExecutor.executeRegex(pattern, text, timeoutMs);
|
|
270
|
+
}
|
|
271
|
+
const patternCache = new Map();
|
|
272
|
+
const patternWeakRefs = new Map();
|
|
273
|
+
const patternFinalizationRegistry = new FinalizationRegistry((key) => {
|
|
274
|
+
patternWeakRefs.delete(key);
|
|
275
|
+
patternCache.delete(key);
|
|
276
|
+
logDebug(`Security pattern ${key} was garbage collected`);
|
|
277
|
+
});
|
|
278
|
+
class SecurePatternGenerator {
|
|
279
|
+
static SECURE_SQL_PATTERNS = [
|
|
280
|
+
/SELECT[\s\w,*]{1,50}FROM[\s\w]{1,30}WHERE[\s\w=]{1,50}\$\{[^}]{1,30}\}/gi,
|
|
281
|
+
/INSERT[\s]{1,5}INTO[\s\w]{1,30}VALUES[\s]*\([^)]{1,100}\$\{[^}]{1,30}\}[^)]{1,100}\)/gi,
|
|
282
|
+
/UPDATE[\s\w]{1,30}SET[\s\w=]{1,50}\$\{[^}]{1,30}\}/gi,
|
|
283
|
+
/DELETE[\s]{1,5}FROM[\s\w]{1,30}WHERE[\s\w=]{1,50}\$\{[^}]{1,30}\}/gi,
|
|
284
|
+
/\$\{[^}]{1,30}\}[\s]*(?:UNION|SELECT|INSERT|UPDATE|DELETE|DROP)[\s\w]{1,50}/gi,
|
|
285
|
+
];
|
|
286
|
+
static SECURE_CMD_PATTERNS = [
|
|
287
|
+
/(?:exec|spawn|system)\s*\([^)]{1,100}\$\{[^}]{1,30}\}[^)]{1,100}\)/gi,
|
|
288
|
+
/(?:exec|spawn|system)\s*\([^)]{1,100}\+[^)]{1,100}\)/gi,
|
|
289
|
+
/(?:eval|Function)\s*\([^)]{1,100}\$\{[^}]{1,30}\}[^)]{1,100}\)/gi,
|
|
290
|
+
];
|
|
291
|
+
static getSQLPatterns() {
|
|
292
|
+
return this.SECURE_SQL_PATTERNS;
|
|
293
|
+
}
|
|
294
|
+
static getCMDPatterns() {
|
|
295
|
+
return this.SECURE_CMD_PATTERNS;
|
|
296
|
+
}
|
|
297
|
+
static validatePattern(pattern) {
|
|
298
|
+
const { source } = pattern;
|
|
299
|
+
const dangerousPatterns = [
|
|
300
|
+
/\([^)*]*\*[^)*]*\*[^)]*\)/,
|
|
301
|
+
/\([^)+]*\+[^)+]*\+[^)]*\)/,
|
|
302
|
+
/\([^)?]*\?[^)*]*\*[^)]*\)/,
|
|
303
|
+
/\([^)]*\{\d+,\}[^)*]*\*[^)]*\)/,
|
|
304
|
+
];
|
|
305
|
+
return !dangerousPatterns.some(dp => dp.test(source));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function getInjectionPatterns(depth) {
|
|
309
|
+
const cacheKey = `injection_${depth}`;
|
|
310
|
+
if (patternCache.has(cacheKey)) {
|
|
311
|
+
return patternCache.get(cacheKey);
|
|
312
|
+
}
|
|
313
|
+
const base = {
|
|
314
|
+
sql_injection: {
|
|
315
|
+
patterns: SecurePatternGenerator.getSQLPatterns().slice(0, MAX_PATTERNS_PER_TYPE),
|
|
316
|
+
severity: 'critical',
|
|
317
|
+
},
|
|
318
|
+
command_injection: {
|
|
319
|
+
patterns: SecurePatternGenerator.getCMDPatterns().slice(0, MAX_PATTERNS_PER_TYPE),
|
|
320
|
+
severity: 'critical',
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
if (depth === 'deep') {
|
|
324
|
+
const additionalPatterns = [
|
|
325
|
+
/\$\{[^}]{1,30}eval\([^)]{1,30}\)[^}]{1,30}\}/gi,
|
|
326
|
+
/\$\{[^}]{1,30}Function\([^)]{1,30}\)[^}]{1,30}\}/gi,
|
|
327
|
+
/\$\{[^}]{1,30}constructor[^}]{1,30}\}/gi,
|
|
328
|
+
/__proto__[\s]*=[\s]*\{/gi,
|
|
329
|
+
/prototype[\s]*\[[\w'"]{1,20}\][\s]*=/gi,
|
|
330
|
+
];
|
|
331
|
+
const result = {
|
|
332
|
+
...base,
|
|
333
|
+
template_injection: {
|
|
334
|
+
patterns: additionalPatterns.slice(0, MAX_PATTERNS_PER_TYPE),
|
|
335
|
+
severity: 'high',
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
patternCache.set(cacheKey, result);
|
|
339
|
+
const weakRef = new WeakRef(result);
|
|
340
|
+
patternWeakRefs.set(cacheKey, weakRef);
|
|
341
|
+
patternFinalizationRegistry.register(result, cacheKey);
|
|
342
|
+
return result;
|
|
343
|
+
}
|
|
344
|
+
patternCache.set(cacheKey, base);
|
|
345
|
+
return base;
|
|
346
|
+
}
|
|
347
|
+
function getXSSPatterns(depth) {
|
|
348
|
+
return {
|
|
349
|
+
direct_xss: {
|
|
350
|
+
patterns: [
|
|
351
|
+
/<script[^>]*>[\s\S]{0,1000}<\/script>/gi,
|
|
352
|
+
/javascript:/gi,
|
|
353
|
+
/on\w+\s*=\s*["'][^"']{0,200}["']/gi,
|
|
354
|
+
],
|
|
355
|
+
severity: 'high',
|
|
356
|
+
},
|
|
357
|
+
dom_xss: {
|
|
358
|
+
patterns: [
|
|
359
|
+
/innerHTML\s*=[^$]*\$\{[^}]*\}/gi,
|
|
360
|
+
/outerHTML\s*=[^$]*\$\{[^}]*\}/gi,
|
|
361
|
+
/document\.write\([^$]*\$\{[^}]*\}[^)]*\)/gi,
|
|
362
|
+
],
|
|
363
|
+
severity: 'high',
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function getPathTraversalPatterns() {
|
|
368
|
+
return {
|
|
369
|
+
directory_traversal: {
|
|
370
|
+
patterns: [
|
|
371
|
+
/\.\.\/.*\$\{.*\}/gi,
|
|
372
|
+
/\.\.\\.*\$\{.*\}/gi,
|
|
373
|
+
/path\.join\(.*\$\{[^\n\r}\u2028\u2029]*\}.*\)/gi,
|
|
374
|
+
],
|
|
375
|
+
severity: 'high',
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
function getCryptoPatterns() {
|
|
380
|
+
return {
|
|
381
|
+
weak_crypto: {
|
|
382
|
+
patterns: [/md5/gi, /sha1/gi, /des/gi, /rc4/gi],
|
|
383
|
+
severity: 'medium',
|
|
384
|
+
},
|
|
385
|
+
insecure_random: {
|
|
386
|
+
patterns: [/Math\.random\(\)/gi, /new Date\(\)\.getTime\(\)/gi],
|
|
387
|
+
severity: 'low',
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
function getAuthPatterns() {
|
|
392
|
+
return {
|
|
393
|
+
hardcoded_credentials: {
|
|
394
|
+
patterns: [
|
|
395
|
+
/password\s*[:=]\s*["'][^"']+["']/gi,
|
|
396
|
+
/secret\s*[:=]\s*["'][^"']+["']/gi,
|
|
397
|
+
/token\s*[:=]\s*["'][^"']+["']/gi,
|
|
398
|
+
],
|
|
399
|
+
severity: 'high',
|
|
400
|
+
},
|
|
401
|
+
weak_session: {
|
|
402
|
+
patterns: [/session\s*\{\s*secure:\s*false/gi, /httpOnly:\s*false/gi],
|
|
403
|
+
severity: 'medium',
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function getSecurityPatterns(depth) {
|
|
408
|
+
return {
|
|
409
|
+
secrets: getSecretPatterns(),
|
|
410
|
+
injection: getInjectionPatterns(depth),
|
|
411
|
+
xss: getXSSPatterns(depth),
|
|
412
|
+
pathTraversal: getPathTraversalPatterns(),
|
|
413
|
+
crypto: getCryptoPatterns(),
|
|
414
|
+
auth: getAuthPatterns(),
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
async function detectSecrets(content, filePath, patterns, signal) {
|
|
418
|
+
const secrets = [];
|
|
419
|
+
if (content.length > MAX_CONTENT_SIZE) {
|
|
420
|
+
secrets.push({
|
|
421
|
+
type: 'secret',
|
|
422
|
+
subtype: 'content_too_large',
|
|
423
|
+
severity: 'medium',
|
|
424
|
+
file: filePath,
|
|
425
|
+
issue: `File too large for secret scanning (${content.length} > ${MAX_CONTENT_SIZE} bytes)`,
|
|
426
|
+
remediation: 'Consider scanning file in smaller chunks',
|
|
427
|
+
});
|
|
428
|
+
return secrets;
|
|
429
|
+
}
|
|
430
|
+
for (const [type, config] of Object.entries(patterns)) {
|
|
431
|
+
safeThrowIfAborted(signal);
|
|
432
|
+
try {
|
|
433
|
+
const _operationKey = `secret_${type}_${filePath.split('/').pop()}`;
|
|
434
|
+
const matches = await execRegexWithTimeout(config.pattern, content, REGEX_TIMEOUT_MS);
|
|
435
|
+
if (matches) {
|
|
436
|
+
safeThrowIfAborted(signal);
|
|
437
|
+
secrets.push({
|
|
438
|
+
type: 'secret',
|
|
439
|
+
subtype: type,
|
|
440
|
+
severity: config.severity,
|
|
441
|
+
file: filePath,
|
|
442
|
+
line: getLineNumber(content, matches[0]),
|
|
443
|
+
issue: `${config.description} detected`,
|
|
444
|
+
remediation: getSecretRemediation(type),
|
|
445
|
+
pattern: '[REDACTED]',
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
catch (error) {
|
|
450
|
+
logWarn(`Secret detection regex error for ${type} in ${filePath}`, { error, type, filePath });
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return secrets;
|
|
454
|
+
}
|
|
455
|
+
async function detectInjectionVulns(content, filePath, patterns, signal) {
|
|
456
|
+
const vulnerabilities = [];
|
|
457
|
+
if (content.length > MAX_CONTENT_SIZE) {
|
|
458
|
+
vulnerabilities.push({
|
|
459
|
+
type: 'injection',
|
|
460
|
+
subtype: 'content_too_large',
|
|
461
|
+
severity: 'medium',
|
|
462
|
+
file: filePath,
|
|
463
|
+
issue: `File too large for security scanning (${content.length} > ${MAX_CONTENT_SIZE} bytes)`,
|
|
464
|
+
remediation: 'Consider scanning file in smaller chunks',
|
|
465
|
+
});
|
|
466
|
+
return vulnerabilities;
|
|
467
|
+
}
|
|
468
|
+
const detectionPromises = Object.entries(patterns).flatMap(([type, config]) => config.patterns.map(async (pattern) => {
|
|
469
|
+
safeThrowIfAborted(signal);
|
|
470
|
+
try {
|
|
471
|
+
const _operationKey = `injection_${type}_${pattern.source.substring(0, 10)}`;
|
|
472
|
+
const matches = await execRegexWithTimeout(pattern, content, REGEX_TIMEOUT_MS);
|
|
473
|
+
if (matches) {
|
|
474
|
+
safeThrowIfAborted(signal);
|
|
475
|
+
return [
|
|
476
|
+
{
|
|
477
|
+
type: 'injection',
|
|
478
|
+
subtype: type,
|
|
479
|
+
severity: config.severity,
|
|
480
|
+
file: filePath,
|
|
481
|
+
line: getLineNumber(content, matches[0]),
|
|
482
|
+
issue: `${type.replaceAll('_', ' ')} vulnerability detected`,
|
|
483
|
+
remediation: getInjectionRemediation(type),
|
|
484
|
+
pattern: matches[0].substring(0, 100),
|
|
485
|
+
},
|
|
486
|
+
];
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
logWarn(`Regex execution error for pattern ${pattern} in ${filePath}`, {
|
|
491
|
+
error,
|
|
492
|
+
pattern: pattern.toString(),
|
|
493
|
+
filePath,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
return [];
|
|
497
|
+
}));
|
|
498
|
+
const results = await Promise.allSettled(detectionPromises);
|
|
499
|
+
const successfulResults = [];
|
|
500
|
+
for (const result of results) {
|
|
501
|
+
if (result.status === 'fulfilled' && result.value) {
|
|
502
|
+
successfulResults.push(...result.value);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
vulnerabilities.push(...successfulResults);
|
|
506
|
+
return vulnerabilities;
|
|
507
|
+
}
|
|
508
|
+
async function detectXSSVulns(content, filePath, patterns, signal) {
|
|
509
|
+
return detectVulnerabilitiesByPattern(content, filePath, patterns, 'xss', getXSSRemediation, signal);
|
|
510
|
+
}
|
|
511
|
+
async function detectPathTraversal(content, filePath, patterns, signal) {
|
|
512
|
+
return detectVulnerabilitiesByPattern(content, filePath, patterns, 'pathTraversal', getPathRemediation, signal);
|
|
513
|
+
}
|
|
514
|
+
async function detectCryptoIssues(content, filePath, patterns, signal) {
|
|
515
|
+
return detectVulnerabilitiesByPattern(content, filePath, patterns, 'cryptographic', getCryptoRemediation, signal);
|
|
516
|
+
}
|
|
517
|
+
async function detectAuthIssues(content, filePath, patterns, signal) {
|
|
518
|
+
return detectVulnerabilitiesByPattern(content, filePath, patterns, 'authentication', getAuthRemediation, signal);
|
|
519
|
+
}
|
|
520
|
+
async function detectVulnerabilitiesByPattern(content, filePath, patterns, vulnType, getRemediationFn, signal) {
|
|
521
|
+
const vulnerabilities = [];
|
|
522
|
+
for (const [type, config] of Object.entries(patterns)) {
|
|
523
|
+
safeThrowIfAborted(signal);
|
|
524
|
+
const typePatterns = Array.isArray(config.patterns) ? config.patterns : [config.patterns];
|
|
525
|
+
for (const pattern of typePatterns) {
|
|
526
|
+
safeThrowIfAborted(signal);
|
|
527
|
+
const matches = content.match(pattern);
|
|
528
|
+
if (matches) {
|
|
529
|
+
for (const match of matches) {
|
|
530
|
+
safeThrowIfAborted(signal);
|
|
531
|
+
vulnerabilities.push({
|
|
532
|
+
type: vulnType,
|
|
533
|
+
subtype: type,
|
|
534
|
+
severity: config.severity,
|
|
535
|
+
file: filePath,
|
|
536
|
+
line: getLineNumber(content, match),
|
|
537
|
+
issue: `${type.replace('_', ' ')} vulnerability detected`,
|
|
538
|
+
remediation: getRemediationFn(type),
|
|
539
|
+
pattern: match,
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return vulnerabilities;
|
|
546
|
+
}
|
|
547
|
+
async function scanDependencyVulnerabilities(packagePath, sessionId, depth = 'standard', signal) {
|
|
548
|
+
safeThrowIfAborted(signal);
|
|
549
|
+
return {
|
|
550
|
+
vulnerabilities: [],
|
|
551
|
+
summary: {
|
|
552
|
+
critical: 0,
|
|
553
|
+
high: 0,
|
|
554
|
+
medium: 0,
|
|
555
|
+
low: 0,
|
|
556
|
+
total: 0,
|
|
557
|
+
},
|
|
558
|
+
scanDepth: depth,
|
|
559
|
+
scannedAt: new Date().toISOString(),
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
async function performSpecializedScan(scanType, packagePath, sessionId, depth = 'standard', signal) {
|
|
563
|
+
safeThrowIfAborted(signal);
|
|
564
|
+
switch (scanType) {
|
|
565
|
+
case 'scanProjectFiles':
|
|
566
|
+
return { type: 'project_files', results: [], summary: { total: 0 } };
|
|
567
|
+
case 'scanSecretsOnly':
|
|
568
|
+
return { type: 'secrets_only', secrets: [], summary: { total: 0 } };
|
|
569
|
+
case 'scanDependenciesOnly':
|
|
570
|
+
return await scanDependencyVulnerabilities(packagePath, sessionId, depth, signal);
|
|
571
|
+
default:
|
|
572
|
+
return { type: 'unknown', results: [] };
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
async function performFullSecurityScan(packagePath, sessionId, depth = 'standard', signal) {
|
|
576
|
+
safeThrowIfAborted(signal);
|
|
577
|
+
return {
|
|
578
|
+
secrets: [],
|
|
579
|
+
vulnerabilities: {
|
|
580
|
+
injection: [],
|
|
581
|
+
xss: [],
|
|
582
|
+
pathTraversal: [],
|
|
583
|
+
cryptographic: [],
|
|
584
|
+
authentication: [],
|
|
585
|
+
authorization: [],
|
|
586
|
+
},
|
|
587
|
+
dependencies: [],
|
|
588
|
+
summary: {
|
|
589
|
+
critical: 0,
|
|
590
|
+
high: 0,
|
|
591
|
+
medium: 0,
|
|
592
|
+
low: 0,
|
|
593
|
+
total: 0,
|
|
594
|
+
},
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
async function performComprehensiveScan(packagePath, sessionId, depth = 'standard', signal) {
|
|
598
|
+
safeThrowIfAborted(signal);
|
|
599
|
+
const startTime = Date.now();
|
|
600
|
+
const fullScan = await performFullSecurityScan(packagePath, sessionId, depth, signal);
|
|
601
|
+
const duration = Date.now() - startTime;
|
|
602
|
+
return {
|
|
603
|
+
...fullScan,
|
|
604
|
+
progress: 100,
|
|
605
|
+
duration,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
async function performQuickScan(packagePath, sessionId, signal) {
|
|
609
|
+
safeThrowIfAborted(signal);
|
|
610
|
+
const quickResult = {
|
|
611
|
+
secrets: [],
|
|
612
|
+
vulnerabilities: {
|
|
613
|
+
injection: [],
|
|
614
|
+
xss: [],
|
|
615
|
+
pathTraversal: [],
|
|
616
|
+
cryptographic: [],
|
|
617
|
+
authentication: [],
|
|
618
|
+
authorization: [],
|
|
619
|
+
},
|
|
620
|
+
dependencies: [],
|
|
621
|
+
summary: {
|
|
622
|
+
critical: 0,
|
|
623
|
+
high: 0,
|
|
624
|
+
medium: 0,
|
|
625
|
+
low: 0,
|
|
626
|
+
total: 0,
|
|
627
|
+
},
|
|
628
|
+
};
|
|
629
|
+
return {
|
|
630
|
+
...quickResult,
|
|
631
|
+
scanType: 'quick',
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
async function performVulnScan(packagePath, sessionId, depth = 'standard', signal) {
|
|
635
|
+
safeThrowIfAborted(signal);
|
|
636
|
+
const vulnResult = {
|
|
637
|
+
secrets: [],
|
|
638
|
+
vulnerabilities: {
|
|
639
|
+
injection: [],
|
|
640
|
+
xss: [],
|
|
641
|
+
pathTraversal: [],
|
|
642
|
+
cryptographic: [],
|
|
643
|
+
authentication: [],
|
|
644
|
+
authorization: [],
|
|
645
|
+
},
|
|
646
|
+
dependencies: [],
|
|
647
|
+
summary: {
|
|
648
|
+
critical: 0,
|
|
649
|
+
high: 0,
|
|
650
|
+
medium: 0,
|
|
651
|
+
low: 0,
|
|
652
|
+
total: 0,
|
|
653
|
+
},
|
|
654
|
+
};
|
|
655
|
+
return {
|
|
656
|
+
...vulnResult,
|
|
657
|
+
scanType: 'vulnerability',
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
async function performCriticalOnlyScan(packagePath, sessionId, signal) {
|
|
661
|
+
safeThrowIfAborted(signal);
|
|
662
|
+
const criticalResult = {
|
|
663
|
+
secrets: [],
|
|
664
|
+
vulnerabilities: {
|
|
665
|
+
injection: [],
|
|
666
|
+
xss: [],
|
|
667
|
+
pathTraversal: [],
|
|
668
|
+
cryptographic: [],
|
|
669
|
+
authentication: [],
|
|
670
|
+
authorization: [],
|
|
671
|
+
},
|
|
672
|
+
dependencies: [],
|
|
673
|
+
summary: {
|
|
674
|
+
critical: 0,
|
|
675
|
+
high: 0,
|
|
676
|
+
medium: 0,
|
|
677
|
+
low: 0,
|
|
678
|
+
total: 0,
|
|
679
|
+
},
|
|
680
|
+
};
|
|
681
|
+
return {
|
|
682
|
+
...criticalResult,
|
|
683
|
+
scanType: 'critical-only',
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
function getLineNumber(content, match) {
|
|
687
|
+
const index = content.indexOf(match);
|
|
688
|
+
if (index === -1)
|
|
689
|
+
return 1;
|
|
690
|
+
const lines = content.substring(0, index).split('\n');
|
|
691
|
+
return lines.length;
|
|
692
|
+
}
|
|
693
|
+
function getSecretRemediation(type) {
|
|
694
|
+
const remediations = {
|
|
695
|
+
aws_access_key: 'Remove hardcoded AWS credentials. Use IAM roles or environment variables.',
|
|
696
|
+
github_token: 'Revoke the token immediately. Use environment variables or secure secrets management.',
|
|
697
|
+
private_key: 'Remove private key from code. Store securely and reference via environment.',
|
|
698
|
+
jwt_token: 'Avoid hardcoding JWT tokens. Generate dynamically or use secure storage.',
|
|
699
|
+
};
|
|
700
|
+
return (remediations[type] ??
|
|
701
|
+
'Remove sensitive data from source code. Use environment variables or secure secrets management.');
|
|
702
|
+
}
|
|
703
|
+
function getInjectionRemediation(type) {
|
|
704
|
+
const remediations = {
|
|
705
|
+
sql_injection: 'Use parameterized queries or prepared statements. Validate and sanitize inputs.',
|
|
706
|
+
command_injection: 'Avoid dynamic command execution. Use safe APIs and validate inputs.',
|
|
707
|
+
template_injection: 'Use safe templating engines. Sanitize user inputs and avoid eval().',
|
|
708
|
+
};
|
|
709
|
+
return (remediations[type] ??
|
|
710
|
+
'Validate and sanitize all user inputs. Use parameterized queries and safe APIs.');
|
|
711
|
+
}
|
|
712
|
+
function getXSSRemediation(type) {
|
|
713
|
+
return 'Sanitize user inputs. Use Content Security Policy (CSP). Escape output data.';
|
|
714
|
+
}
|
|
715
|
+
function getPathRemediation(type) {
|
|
716
|
+
return 'Validate file paths. Use path.resolve() and check against allowed directories.';
|
|
717
|
+
}
|
|
718
|
+
function getCryptoRemediation(type) {
|
|
719
|
+
const remediations = {
|
|
720
|
+
weak_crypto: 'Use strong cryptographic algorithms like AES-256, SHA-256, or bcrypt.',
|
|
721
|
+
insecure_random: 'Use cryptographically secure random number generators like crypto.randomBytes().',
|
|
722
|
+
};
|
|
723
|
+
return remediations[type] ?? 'Use modern, secure cryptographic algorithms and practices.';
|
|
724
|
+
}
|
|
725
|
+
function getAuthRemediation(type) {
|
|
726
|
+
const remediations = {
|
|
727
|
+
hardcoded_credentials: 'Remove hardcoded credentials. Use environment variables or secure secrets management.',
|
|
728
|
+
weak_session: 'Enable secure and httpOnly flags for cookies. Use HTTPS in production.',
|
|
729
|
+
};
|
|
730
|
+
return (remediations[type] ??
|
|
731
|
+
'Implement secure authentication practices. Use strong session management.');
|
|
732
|
+
}
|
|
733
|
+
function getRemediationByType(vulnerabilityType) {
|
|
734
|
+
const type = vulnerabilityType.toLowerCase();
|
|
735
|
+
if (type.includes('secret'))
|
|
736
|
+
return getSecretRemediation(vulnerabilityType);
|
|
737
|
+
if (type.includes('injection'))
|
|
738
|
+
return getInjectionRemediation(vulnerabilityType);
|
|
739
|
+
if (type.includes('xss'))
|
|
740
|
+
return getXSSRemediation(vulnerabilityType);
|
|
741
|
+
if (type.includes('path'))
|
|
742
|
+
return getPathRemediation(vulnerabilityType);
|
|
743
|
+
if (type.includes('crypto'))
|
|
744
|
+
return getCryptoRemediation(vulnerabilityType);
|
|
745
|
+
if (type.includes('auth'))
|
|
746
|
+
return getAuthRemediation(vulnerabilityType);
|
|
747
|
+
return 'Implement security best practices. Validate inputs, use secure APIs, and follow OWASP guidelines.';
|
|
748
|
+
}
|
|
749
|
+
function generateSecurityRecommendations(securityData) {
|
|
750
|
+
return {
|
|
751
|
+
immediate: ['Patch critical vulnerabilities', 'Remove exposed secrets'],
|
|
752
|
+
shortTerm: ['Update vulnerable dependencies', 'Implement input validation'],
|
|
753
|
+
longTerm: ['Security code review process', 'Automated security scanning'],
|
|
754
|
+
resources: ['OWASP Top 10', 'Security testing tools', 'Secure coding guidelines'],
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
async function* streamSecurityScan(fileList, scanDepth, options = {}) {
|
|
758
|
+
const { chunkSize: _chunkSize = 5, batchSize = 10, signal } = options;
|
|
759
|
+
const totalFiles = fileList.length;
|
|
760
|
+
let filesProcessed = 0;
|
|
761
|
+
let chunkIndex = 0;
|
|
762
|
+
let totalBytesProcessed = 0;
|
|
763
|
+
for (let i = 0; i < totalFiles; i += batchSize) {
|
|
764
|
+
safeThrowIfAborted(signal);
|
|
765
|
+
const batch = fileList.slice(i, i + batchSize);
|
|
766
|
+
const startTime = performance.now();
|
|
767
|
+
for (const filePath of batch) {
|
|
768
|
+
safeThrowIfAborted(signal);
|
|
769
|
+
try {
|
|
770
|
+
const content = `// Mock content for ${filePath}`;
|
|
771
|
+
const fileSize = Buffer.byteLength(content, 'utf8');
|
|
772
|
+
totalBytesProcessed += fileSize;
|
|
773
|
+
const patterns = getSecurityPatterns(scanDepth);
|
|
774
|
+
const vulnerabilities = [];
|
|
775
|
+
const secrets = await detectSecrets(content, filePath, patterns.secrets, signal);
|
|
776
|
+
vulnerabilities.push(...secrets);
|
|
777
|
+
const injections = await detectInjectionVulns(content, filePath, patterns.injection, signal);
|
|
778
|
+
vulnerabilities.push(...injections);
|
|
779
|
+
const xssVulns = await detectXSSVulns(content, filePath, patterns.xss, signal);
|
|
780
|
+
vulnerabilities.push(...xssVulns);
|
|
781
|
+
filesProcessed++;
|
|
782
|
+
const processingTime = performance.now() - startTime;
|
|
783
|
+
yield {
|
|
784
|
+
file: filePath,
|
|
785
|
+
vulnerabilities,
|
|
786
|
+
progress: Math.round((filesProcessed / totalFiles) * 100),
|
|
787
|
+
filesProcessed,
|
|
788
|
+
totalFiles,
|
|
789
|
+
bytesProcessed: totalBytesProcessed,
|
|
790
|
+
isComplete: filesProcessed === totalFiles,
|
|
791
|
+
metadata: {
|
|
792
|
+
scanDepth,
|
|
793
|
+
chunkIndex: chunkIndex++,
|
|
794
|
+
processingTime,
|
|
795
|
+
},
|
|
796
|
+
};
|
|
797
|
+
if (filesProcessed % 5 === 0) {
|
|
798
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
catch (error) {
|
|
802
|
+
yield {
|
|
803
|
+
file: filePath,
|
|
804
|
+
vulnerabilities: [
|
|
805
|
+
{
|
|
806
|
+
type: 'error',
|
|
807
|
+
subtype: 'processing_error',
|
|
808
|
+
severity: 'high',
|
|
809
|
+
file: filePath,
|
|
810
|
+
issue: `Error processing file: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
811
|
+
remediation: 'Check file accessibility and format',
|
|
812
|
+
},
|
|
813
|
+
],
|
|
814
|
+
progress: Math.round((filesProcessed / totalFiles) * 100),
|
|
815
|
+
filesProcessed,
|
|
816
|
+
totalFiles,
|
|
817
|
+
bytesProcessed: totalBytesProcessed,
|
|
818
|
+
isComplete: false,
|
|
819
|
+
metadata: {
|
|
820
|
+
scanDepth,
|
|
821
|
+
chunkIndex: chunkIndex++,
|
|
822
|
+
processingTime: performance.now() - startTime,
|
|
823
|
+
},
|
|
824
|
+
};
|
|
825
|
+
filesProcessed++;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
async function* _streamProjectSecurityScan(packagePath, scanDepth, options = {}) {
|
|
831
|
+
const discoverProjectFiles = (dirPath) => {
|
|
832
|
+
const files = [];
|
|
833
|
+
try {
|
|
834
|
+
if (!existsSync(dirPath))
|
|
835
|
+
return files;
|
|
836
|
+
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
837
|
+
for (const entry of entries) {
|
|
838
|
+
if (['node_modules', '.git', 'dist', 'build'].includes(entry.name))
|
|
839
|
+
continue;
|
|
840
|
+
const fullPath = join(dirPath, entry.name);
|
|
841
|
+
if (entry.isDirectory()) {
|
|
842
|
+
files.push(...discoverProjectFiles(fullPath));
|
|
843
|
+
}
|
|
844
|
+
else if (entry.isFile()) {
|
|
845
|
+
const ext = extname(entry.name).toLowerCase();
|
|
846
|
+
if (['.ts', '.tsx', '.js', '.jsx', '.json', '.md'].includes(ext)) {
|
|
847
|
+
files.push(fullPath);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
catch (error) {
|
|
853
|
+
logWarn(`Failed to discover files in ${dirPath}`, { error, dirPath });
|
|
854
|
+
}
|
|
855
|
+
return files;
|
|
856
|
+
};
|
|
857
|
+
const projectFiles = discoverProjectFiles(packagePath);
|
|
858
|
+
yield* streamSecurityScan(projectFiles, scanDepth, options);
|
|
859
|
+
}
|
|
860
|
+
async function* _streamVulnerabilityDetection(content, filePath, scanDepth, options = {}) {
|
|
861
|
+
const { chunkSize: _chunkSize = 5, signal } = options;
|
|
862
|
+
safeThrowIfAborted(signal);
|
|
863
|
+
const startTime = performance.now();
|
|
864
|
+
const patterns = getSecurityPatterns(scanDepth);
|
|
865
|
+
const allVulnerabilities = [];
|
|
866
|
+
const vulnerabilityTypes = [
|
|
867
|
+
{ name: 'secrets', detector: detectSecrets, patterns: patterns.secrets },
|
|
868
|
+
{ name: 'injection', detector: detectInjectionVulns, patterns: patterns.injection },
|
|
869
|
+
{ name: 'xss', detector: detectXSSVulns, patterns: patterns.xss },
|
|
870
|
+
{ name: 'pathTraversal', detector: detectPathTraversal, patterns: patterns.pathTraversal },
|
|
871
|
+
{ name: 'crypto', detector: detectCryptoIssues, patterns: patterns.crypto },
|
|
872
|
+
{ name: 'auth', detector: detectAuthIssues, patterns: patterns.auth },
|
|
873
|
+
];
|
|
874
|
+
let chunkIndex = 0;
|
|
875
|
+
const totalTypes = vulnerabilityTypes.length;
|
|
876
|
+
for (let i = 0; i < totalTypes; i++) {
|
|
877
|
+
safeThrowIfAborted(signal);
|
|
878
|
+
const vulnerabilityType = vulnerabilityTypes[i];
|
|
879
|
+
if (!vulnerabilityType)
|
|
880
|
+
continue;
|
|
881
|
+
const { name, detector, patterns: typePatterns } = vulnerabilityType;
|
|
882
|
+
try {
|
|
883
|
+
const vulnerabilities = await detector(content, filePath, typePatterns, signal);
|
|
884
|
+
allVulnerabilities.push(...vulnerabilities);
|
|
885
|
+
const processingTime = performance.now() - startTime;
|
|
886
|
+
const bytesProcessed = Buffer.byteLength(content, 'utf8');
|
|
887
|
+
yield {
|
|
888
|
+
file: filePath,
|
|
889
|
+
vulnerabilities: allVulnerabilities.slice(),
|
|
890
|
+
progress: Math.round(((i + 1) / totalTypes) * 100),
|
|
891
|
+
filesProcessed: 1,
|
|
892
|
+
totalFiles: 1,
|
|
893
|
+
bytesProcessed,
|
|
894
|
+
isComplete: i === totalTypes - 1,
|
|
895
|
+
metadata: {
|
|
896
|
+
scanDepth,
|
|
897
|
+
chunkIndex: chunkIndex++,
|
|
898
|
+
processingTime,
|
|
899
|
+
},
|
|
900
|
+
};
|
|
901
|
+
await new Promise(resolve => setImmediate(resolve));
|
|
902
|
+
}
|
|
903
|
+
catch (error) {
|
|
904
|
+
allVulnerabilities.push({
|
|
905
|
+
type: 'error',
|
|
906
|
+
subtype: `${name}_detection_error`,
|
|
907
|
+
severity: 'medium',
|
|
908
|
+
file: filePath,
|
|
909
|
+
issue: `Error detecting ${name} vulnerabilities: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
910
|
+
remediation: 'Check file content and patterns',
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
//# sourceMappingURL=security-scanner.js.map
|