@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,87 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { Worker } from 'node:worker_threads';
|
|
3
|
+
export interface WorkerPoolOptions {
|
|
4
|
+
maxWorkers?: number;
|
|
5
|
+
minWorkers?: number;
|
|
6
|
+
taskTimeout?: number;
|
|
7
|
+
idleTimeout?: number;
|
|
8
|
+
enableProfiling?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkerTask<T = unknown, R = unknown> {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
data: T;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
resolve: (result: R) => void;
|
|
16
|
+
reject: (error: Error) => void;
|
|
17
|
+
startTime: number;
|
|
18
|
+
timeout?: number;
|
|
19
|
+
timeoutId?: ReturnType<typeof setTimeout>;
|
|
20
|
+
cleanup?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkerInfo {
|
|
23
|
+
id: string;
|
|
24
|
+
worker: Worker;
|
|
25
|
+
busy: boolean;
|
|
26
|
+
currentTask?: string;
|
|
27
|
+
tasksCompleted: number;
|
|
28
|
+
totalTime: number;
|
|
29
|
+
lastUsed: number;
|
|
30
|
+
errors: number;
|
|
31
|
+
}
|
|
32
|
+
export interface WorkerPoolStats {
|
|
33
|
+
totalWorkers: number;
|
|
34
|
+
busyWorkers: number;
|
|
35
|
+
idleWorkers: number;
|
|
36
|
+
queuedTasks: number;
|
|
37
|
+
completedTasks: number;
|
|
38
|
+
failedTasks: number;
|
|
39
|
+
averageTaskTime: number;
|
|
40
|
+
totalTaskTime: number;
|
|
41
|
+
workerUtilization: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class WorkerPool extends EventEmitter {
|
|
44
|
+
private workers;
|
|
45
|
+
private taskQueue;
|
|
46
|
+
private activeTasks;
|
|
47
|
+
private completedTasks;
|
|
48
|
+
private failedTasks;
|
|
49
|
+
private totalTaskTime;
|
|
50
|
+
private workerScript;
|
|
51
|
+
private options;
|
|
52
|
+
private cleanupInterval;
|
|
53
|
+
private isDestroyed;
|
|
54
|
+
private workerBitmap;
|
|
55
|
+
private workerIdToIndex;
|
|
56
|
+
private indexToWorkerId;
|
|
57
|
+
constructor(workerScript: string, options?: WorkerPoolOptions);
|
|
58
|
+
execute<T, R>(taskType: string, taskData: T, options?: {
|
|
59
|
+
timeout?: number;
|
|
60
|
+
signal?: AbortSignal;
|
|
61
|
+
}): Promise<R>;
|
|
62
|
+
getStats(): WorkerPoolStats;
|
|
63
|
+
destroy(): Promise<void>;
|
|
64
|
+
private initializeMinWorkers;
|
|
65
|
+
private createWorker;
|
|
66
|
+
private processQueue;
|
|
67
|
+
private assignTaskToWorker;
|
|
68
|
+
private handleWorkerMessage;
|
|
69
|
+
private handleWorkerError;
|
|
70
|
+
private handleWorkerExit;
|
|
71
|
+
private handleTaskTimeout;
|
|
72
|
+
private cancelTask;
|
|
73
|
+
private cleanupTask;
|
|
74
|
+
private startCleanupInterval;
|
|
75
|
+
private cleanupIdleWorkers;
|
|
76
|
+
private generateTaskId;
|
|
77
|
+
private generateWorkerId;
|
|
78
|
+
private setWorkerIdle;
|
|
79
|
+
private setWorkerBusy;
|
|
80
|
+
private findIdleWorker;
|
|
81
|
+
private addWorkerToBitmap;
|
|
82
|
+
private removeWorkerFromBitmap;
|
|
83
|
+
}
|
|
84
|
+
export declare function createWorkerScript(handlers: Record<string, (data: any) => Promise<any> | any>): string;
|
|
85
|
+
export declare function getGlobalWorkerPool(workerScript?: string, options?: WorkerPoolOptions): WorkerPool;
|
|
86
|
+
export declare function destroyGlobalWorkerPool(): Promise<void> | void;
|
|
87
|
+
//# sourceMappingURL=worker-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-pool.d.ts","sourceRoot":"","sources":["../../../../../core-utils/src/server/worker-pool.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAS3D,MAAM,WAAW,iBAAiB;IAEhC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAKD,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IAElD,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,CAAC,CAAC;IAER,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAE7B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAE/B,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAE1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAKD,MAAM,WAAW,UAAU;IAEzB,EAAE,EAAE,MAAM,CAAC;IAEX,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,OAAO,CAAC;IAEd,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc,EAAE,MAAM,CAAC;IAEvB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,eAAe;IAE9B,YAAY,EAAE,MAAM,CAAC;IAErB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,cAAc,EAAE,MAAM,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,MAAM,CAAC;IAEtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAqBD,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,eAAe,CAA+B;IACtD,OAAO,CAAC,WAAW,CAAS;IAG5B,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,eAAe,CAA6B;gBASxC,YAAY,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;IA4C3D,OAAO,CAAC,CAAC,EAAE,CAAC,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,EACX,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAO,GACvD,OAAO,CAAC,CAAC,CAAC;IAsDb,QAAQ,IAAI,eAAe;IAwBrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC9B,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,YAAY;IAwCpB,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,kBAAkB;IAgC1B,OAAO,CAAC,mBAAmB;IA0D3B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,kBAAkB;IA2B1B,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,sBAAsB;CAQ/B;AAMD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAC1D,MAAM,CA6MR;AAOD,wBAAgB,mBAAmB,CACjC,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,UAAU,CAQZ;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAM9D"}
|
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { Worker, isMainThread } from 'node:worker_threads';
|
|
3
|
+
import { logError } from '@repo/shared/logs';
|
|
4
|
+
import { safeThrowIfAborted } from './abort-support';
|
|
5
|
+
export class WorkerPool extends EventEmitter {
|
|
6
|
+
workers = new Map();
|
|
7
|
+
taskQueue = [];
|
|
8
|
+
activeTasks = new Map();
|
|
9
|
+
completedTasks = 0;
|
|
10
|
+
failedTasks = 0;
|
|
11
|
+
totalTaskTime = 0;
|
|
12
|
+
workerScript;
|
|
13
|
+
options;
|
|
14
|
+
cleanupInterval = null;
|
|
15
|
+
isDestroyed = false;
|
|
16
|
+
workerBitmap = 0;
|
|
17
|
+
workerIdToIndex = new Map();
|
|
18
|
+
indexToWorkerId = new Map();
|
|
19
|
+
constructor(workerScript, options = {}) {
|
|
20
|
+
super();
|
|
21
|
+
this.workerScript = workerScript;
|
|
22
|
+
const os = require('node:os');
|
|
23
|
+
this.options = {
|
|
24
|
+
maxWorkers: options.maxWorkers || Math.max(2, Math.min(8, os.cpus().length)),
|
|
25
|
+
minWorkers: options.minWorkers ?? 1,
|
|
26
|
+
taskTimeout: options.taskTimeout ?? 30000,
|
|
27
|
+
idleTimeout: options.idleTimeout ?? 60000,
|
|
28
|
+
enableProfiling: options.enableProfiling ?? false,
|
|
29
|
+
};
|
|
30
|
+
this.initializeMinWorkers();
|
|
31
|
+
this.startCleanupInterval();
|
|
32
|
+
}
|
|
33
|
+
async execute(taskType, taskData, options = {}) {
|
|
34
|
+
if (this.isDestroyed) {
|
|
35
|
+
throw new Error('WorkerPool has been destroyed');
|
|
36
|
+
}
|
|
37
|
+
const { timeout = this.options.taskTimeout, signal } = options;
|
|
38
|
+
safeThrowIfAborted(signal);
|
|
39
|
+
const taskId = this.generateTaskId();
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const task = {
|
|
42
|
+
id: taskId,
|
|
43
|
+
type: taskType,
|
|
44
|
+
data: taskData,
|
|
45
|
+
signal,
|
|
46
|
+
resolve: result => resolve(result),
|
|
47
|
+
reject,
|
|
48
|
+
startTime: Date.now(),
|
|
49
|
+
timeout,
|
|
50
|
+
};
|
|
51
|
+
if (signal) {
|
|
52
|
+
const onAbort = () => {
|
|
53
|
+
this.cancelTask(taskId);
|
|
54
|
+
reject(new Error('Task aborted'));
|
|
55
|
+
};
|
|
56
|
+
if (signal.aborted) {
|
|
57
|
+
onAbort();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
61
|
+
task.cleanup = () => {
|
|
62
|
+
signal.removeEventListener('abort', onAbort);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
this.taskQueue.push(task);
|
|
66
|
+
this.processQueue();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
getStats() {
|
|
70
|
+
const busyWorkers = Array.from(this.workers.values()).filter(w => w.busy).length;
|
|
71
|
+
const totalWorkers = this.workers.size;
|
|
72
|
+
return {
|
|
73
|
+
totalWorkers,
|
|
74
|
+
busyWorkers,
|
|
75
|
+
idleWorkers: totalWorkers - busyWorkers,
|
|
76
|
+
queuedTasks: this.taskQueue.length,
|
|
77
|
+
completedTasks: this.completedTasks,
|
|
78
|
+
failedTasks: this.failedTasks,
|
|
79
|
+
averageTaskTime: this.completedTasks > 0 ? this.totalTaskTime / this.completedTasks : 0,
|
|
80
|
+
totalTaskTime: this.totalTaskTime,
|
|
81
|
+
workerUtilization: totalWorkers > 0 ? (busyWorkers / totalWorkers) * 100 : 0,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
async destroy() {
|
|
85
|
+
if (this.isDestroyed)
|
|
86
|
+
return;
|
|
87
|
+
this.isDestroyed = true;
|
|
88
|
+
if (this.cleanupInterval) {
|
|
89
|
+
clearInterval(this.cleanupInterval);
|
|
90
|
+
this.cleanupInterval = null;
|
|
91
|
+
}
|
|
92
|
+
for (const task of this.taskQueue) {
|
|
93
|
+
task.reject(new Error('WorkerPool destroyed'));
|
|
94
|
+
this.cleanupTask(task);
|
|
95
|
+
}
|
|
96
|
+
this.taskQueue.length = 0;
|
|
97
|
+
for (const task of this.activeTasks.values()) {
|
|
98
|
+
task.reject(new Error('WorkerPool destroyed'));
|
|
99
|
+
this.cleanupTask(task);
|
|
100
|
+
}
|
|
101
|
+
this.activeTasks.clear();
|
|
102
|
+
const terminationPromises = Array.from(this.workers.values()).map(async (workerInfo) => {
|
|
103
|
+
try {
|
|
104
|
+
await workerInfo.worker.terminate();
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
logError(`Error terminating worker ${workerInfo.id}`, { error, workerId: workerInfo.id });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
await Promise.all(terminationPromises);
|
|
111
|
+
this.workers.clear();
|
|
112
|
+
this.emit('destroyed');
|
|
113
|
+
}
|
|
114
|
+
initializeMinWorkers() {
|
|
115
|
+
for (let i = 0; i < this.options.minWorkers; i++) {
|
|
116
|
+
this.createWorker();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
createWorker() {
|
|
120
|
+
const workerId = this.generateWorkerId();
|
|
121
|
+
const worker = new Worker(this.workerScript, {
|
|
122
|
+
workerData: {
|
|
123
|
+
workerId,
|
|
124
|
+
enableProfiling: this.options.enableProfiling,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
const workerInfo = {
|
|
128
|
+
id: workerId,
|
|
129
|
+
worker,
|
|
130
|
+
busy: false,
|
|
131
|
+
tasksCompleted: 0,
|
|
132
|
+
totalTime: 0,
|
|
133
|
+
lastUsed: Date.now(),
|
|
134
|
+
errors: 0,
|
|
135
|
+
};
|
|
136
|
+
worker.on('message', message => {
|
|
137
|
+
this.handleWorkerMessage(workerInfo, message);
|
|
138
|
+
});
|
|
139
|
+
worker.on('error', err => {
|
|
140
|
+
this.handleWorkerError(workerInfo, err instanceof Error ? err : new Error(String(err)));
|
|
141
|
+
});
|
|
142
|
+
worker.on('exit', code => {
|
|
143
|
+
this.handleWorkerExit(workerInfo, code);
|
|
144
|
+
});
|
|
145
|
+
this.workers.set(workerId, workerInfo);
|
|
146
|
+
this.addWorkerToBitmap(workerId);
|
|
147
|
+
this.emit('workerCreated', workerInfo);
|
|
148
|
+
return workerInfo;
|
|
149
|
+
}
|
|
150
|
+
processQueue() {
|
|
151
|
+
if (this.taskQueue.length === 0 || this.isDestroyed)
|
|
152
|
+
return;
|
|
153
|
+
let availableWorker = this.findIdleWorker();
|
|
154
|
+
if (!availableWorker && this.workers.size < this.options.maxWorkers) {
|
|
155
|
+
availableWorker = this.createWorker();
|
|
156
|
+
}
|
|
157
|
+
if (availableWorker) {
|
|
158
|
+
const task = this.taskQueue.shift();
|
|
159
|
+
if (task) {
|
|
160
|
+
this.assignTaskToWorker(availableWorker, task);
|
|
161
|
+
if (this.taskQueue.length > 0) {
|
|
162
|
+
setImmediate(() => this.processQueue());
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
assignTaskToWorker(workerInfo, task) {
|
|
168
|
+
if (task.signal?.aborted) {
|
|
169
|
+
task.reject(new Error('Task aborted'));
|
|
170
|
+
this.cleanupTask(task);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
workerInfo.busy = true;
|
|
174
|
+
workerInfo.currentTask = task.id;
|
|
175
|
+
workerInfo.lastUsed = Date.now();
|
|
176
|
+
this.setWorkerBusy(workerInfo.id);
|
|
177
|
+
this.activeTasks.set(task.id, task);
|
|
178
|
+
const timeout = setTimeout(() => {
|
|
179
|
+
this.handleTaskTimeout(task);
|
|
180
|
+
}, task.timeout || this.options.taskTimeout);
|
|
181
|
+
task.timeoutId = timeout;
|
|
182
|
+
workerInfo.worker.postMessage({
|
|
183
|
+
taskId: task.id,
|
|
184
|
+
type: task.type,
|
|
185
|
+
data: task.data,
|
|
186
|
+
});
|
|
187
|
+
this.emit('taskStarted', { taskId: task.id, workerId: workerInfo.id });
|
|
188
|
+
}
|
|
189
|
+
handleWorkerMessage(workerInfo, message) {
|
|
190
|
+
if (typeof message !== 'object' || message === null)
|
|
191
|
+
return;
|
|
192
|
+
const msg = message;
|
|
193
|
+
const { taskId, success, result, error, duration } = msg;
|
|
194
|
+
if (!taskId)
|
|
195
|
+
return;
|
|
196
|
+
const task = this.activeTasks.get(taskId);
|
|
197
|
+
if (!task)
|
|
198
|
+
return;
|
|
199
|
+
if (task.timeoutId) {
|
|
200
|
+
clearTimeout(task.timeoutId);
|
|
201
|
+
}
|
|
202
|
+
workerInfo.busy = false;
|
|
203
|
+
workerInfo.currentTask = undefined;
|
|
204
|
+
workerInfo.tasksCompleted++;
|
|
205
|
+
workerInfo.totalTime += duration ?? 0;
|
|
206
|
+
this.setWorkerIdle(workerInfo.id);
|
|
207
|
+
this.totalTaskTime += duration ?? 0;
|
|
208
|
+
this.activeTasks.delete(taskId);
|
|
209
|
+
if (success) {
|
|
210
|
+
this.completedTasks++;
|
|
211
|
+
task.resolve(result);
|
|
212
|
+
this.emit('taskCompleted', { taskId, workerId: workerInfo.id, duration });
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.failedTasks++;
|
|
216
|
+
workerInfo.errors++;
|
|
217
|
+
const errorMessage = typeof error === 'string'
|
|
218
|
+
? error
|
|
219
|
+
: error instanceof Error
|
|
220
|
+
? error.message
|
|
221
|
+
: 'Worker task failed';
|
|
222
|
+
task.reject(new Error(errorMessage));
|
|
223
|
+
this.emit('taskFailed', { taskId, workerId: workerInfo.id, error });
|
|
224
|
+
}
|
|
225
|
+
this.cleanupTask(task);
|
|
226
|
+
setImmediate(() => this.processQueue());
|
|
227
|
+
}
|
|
228
|
+
handleWorkerError(workerInfo, error) {
|
|
229
|
+
workerInfo.errors++;
|
|
230
|
+
this.emit('workerError', { workerId: workerInfo.id, error });
|
|
231
|
+
if (workerInfo.currentTask) {
|
|
232
|
+
const task = this.activeTasks.get(workerInfo.currentTask);
|
|
233
|
+
if (task) {
|
|
234
|
+
this.failedTasks++;
|
|
235
|
+
task.reject(error);
|
|
236
|
+
this.activeTasks.delete(workerInfo.currentTask);
|
|
237
|
+
this.cleanupTask(task);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
this.workers.delete(workerInfo.id);
|
|
241
|
+
this.removeWorkerFromBitmap(workerInfo.id);
|
|
242
|
+
if (!this.isDestroyed && this.workers.size < this.options.minWorkers) {
|
|
243
|
+
setImmediate(() => this.createWorker());
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
handleWorkerExit(workerInfo, code) {
|
|
247
|
+
this.emit('workerExit', { workerId: workerInfo.id, exitCode: code });
|
|
248
|
+
if (workerInfo.currentTask) {
|
|
249
|
+
const task = this.activeTasks.get(workerInfo.currentTask);
|
|
250
|
+
if (task) {
|
|
251
|
+
this.failedTasks++;
|
|
252
|
+
task.reject(new Error(`Worker exited with code ${code}`));
|
|
253
|
+
this.activeTasks.delete(workerInfo.currentTask);
|
|
254
|
+
this.cleanupTask(task);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
this.workers.delete(workerInfo.id);
|
|
258
|
+
this.removeWorkerFromBitmap(workerInfo.id);
|
|
259
|
+
if (!this.isDestroyed && this.workers.size < this.options.minWorkers) {
|
|
260
|
+
setImmediate(() => this.createWorker());
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
handleTaskTimeout(task) {
|
|
264
|
+
if (!this.activeTasks.has(task.id))
|
|
265
|
+
return;
|
|
266
|
+
this.activeTasks.delete(task.id);
|
|
267
|
+
this.failedTasks++;
|
|
268
|
+
task.reject(new Error(`Task timeout after ${task.timeout}ms`));
|
|
269
|
+
this.cleanupTask(task);
|
|
270
|
+
const workerInfo = Array.from(this.workers.values()).find(w => w.currentTask === task.id);
|
|
271
|
+
if (workerInfo) {
|
|
272
|
+
workerInfo.busy = false;
|
|
273
|
+
workerInfo.currentTask = undefined;
|
|
274
|
+
workerInfo.errors++;
|
|
275
|
+
this.setWorkerIdle(workerInfo.id);
|
|
276
|
+
}
|
|
277
|
+
this.emit('taskTimeout', { taskId: task.id });
|
|
278
|
+
}
|
|
279
|
+
cancelTask(taskId) {
|
|
280
|
+
const queueIndex = this.taskQueue.findIndex(t => t.id === taskId);
|
|
281
|
+
if (queueIndex >= 0) {
|
|
282
|
+
const [task] = this.taskQueue.splice(queueIndex, 1);
|
|
283
|
+
if (task) {
|
|
284
|
+
this.cleanupTask(task);
|
|
285
|
+
}
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const task = this.activeTasks.get(taskId);
|
|
289
|
+
if (task) {
|
|
290
|
+
if (task.timeoutId) {
|
|
291
|
+
clearTimeout(task.timeoutId);
|
|
292
|
+
}
|
|
293
|
+
this.activeTasks.delete(taskId);
|
|
294
|
+
this.cleanupTask(task);
|
|
295
|
+
const workerInfo = Array.from(this.workers.values()).find(w => w.currentTask === taskId);
|
|
296
|
+
if (workerInfo) {
|
|
297
|
+
workerInfo.busy = false;
|
|
298
|
+
workerInfo.currentTask = undefined;
|
|
299
|
+
this.setWorkerIdle(workerInfo.id);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
cleanupTask(task) {
|
|
304
|
+
if (task.cleanup) {
|
|
305
|
+
task.cleanup();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
startCleanupInterval() {
|
|
309
|
+
this.cleanupInterval = setInterval(() => {
|
|
310
|
+
this.cleanupIdleWorkers();
|
|
311
|
+
}, this.options.idleTimeout / 2);
|
|
312
|
+
this.cleanupInterval.unref();
|
|
313
|
+
}
|
|
314
|
+
cleanupIdleWorkers() {
|
|
315
|
+
if (this.isDestroyed || this.workers.size <= this.options.minWorkers)
|
|
316
|
+
return;
|
|
317
|
+
const now = Date.now();
|
|
318
|
+
const workersToRemove = [];
|
|
319
|
+
for (const workerInfo of this.workers.values()) {
|
|
320
|
+
if (!workerInfo.busy &&
|
|
321
|
+
now - workerInfo.lastUsed > this.options.idleTimeout &&
|
|
322
|
+
this.workers.size > this.options.minWorkers) {
|
|
323
|
+
workersToRemove.push(workerInfo);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
for (const workerInfo of workersToRemove) {
|
|
327
|
+
if (this.workers.size <= this.options.minWorkers)
|
|
328
|
+
break;
|
|
329
|
+
this.workers.delete(workerInfo.id);
|
|
330
|
+
this.removeWorkerFromBitmap(workerInfo.id);
|
|
331
|
+
void workerInfo.worker.terminate();
|
|
332
|
+
this.emit('workerTerminated', { workerId: workerInfo.id, reason: 'idle' });
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
generateTaskId() {
|
|
336
|
+
return `task_${Date.now()}_${crypto.randomUUID().substring(0, 8)}`;
|
|
337
|
+
}
|
|
338
|
+
generateWorkerId() {
|
|
339
|
+
return `worker_${Date.now()}_${crypto.randomUUID().substring(0, 8)}`;
|
|
340
|
+
}
|
|
341
|
+
setWorkerIdle(workerId) {
|
|
342
|
+
const index = this.workerIdToIndex.get(workerId);
|
|
343
|
+
if (index !== undefined) {
|
|
344
|
+
this.workerBitmap |= 1 << index;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
setWorkerBusy(workerId) {
|
|
348
|
+
const index = this.workerIdToIndex.get(workerId);
|
|
349
|
+
if (index !== undefined) {
|
|
350
|
+
this.workerBitmap &= ~(1 << index);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
findIdleWorker() {
|
|
354
|
+
if (this.workerBitmap === 0)
|
|
355
|
+
return undefined;
|
|
356
|
+
const idleIndex = Math.log2(this.workerBitmap & -this.workerBitmap);
|
|
357
|
+
const workerId = this.indexToWorkerId.get(idleIndex);
|
|
358
|
+
return workerId ? this.workers.get(workerId) : undefined;
|
|
359
|
+
}
|
|
360
|
+
addWorkerToBitmap(workerId) {
|
|
361
|
+
let index = 0;
|
|
362
|
+
while (index < 32 && this.indexToWorkerId.has(index)) {
|
|
363
|
+
index++;
|
|
364
|
+
}
|
|
365
|
+
if (index >= 32) {
|
|
366
|
+
throw new Error('Maximum workers exceeded for bitmap optimization');
|
|
367
|
+
}
|
|
368
|
+
this.workerIdToIndex.set(workerId, index);
|
|
369
|
+
this.indexToWorkerId.set(index, workerId);
|
|
370
|
+
this.setWorkerIdle(workerId);
|
|
371
|
+
return index;
|
|
372
|
+
}
|
|
373
|
+
removeWorkerFromBitmap(workerId) {
|
|
374
|
+
const index = this.workerIdToIndex.get(workerId);
|
|
375
|
+
if (index !== undefined) {
|
|
376
|
+
this.workerBitmap &= ~(1 << index);
|
|
377
|
+
this.workerIdToIndex.delete(workerId);
|
|
378
|
+
this.indexToWorkerId.delete(index);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
export function createWorkerScript(handlers) {
|
|
383
|
+
class WorkerSecurityValidator {
|
|
384
|
+
static DANGEROUS_PATTERNS = [
|
|
385
|
+
/\beval\s*\(/,
|
|
386
|
+
/\bFunction\s*\(/,
|
|
387
|
+
/\bnew\s+Function\s*\(/,
|
|
388
|
+
/\bprocess\s*[\.\[]/,
|
|
389
|
+
/\bglobal\s*[\.\[]/,
|
|
390
|
+
/\bglobalThis\s*[\.\[]/,
|
|
391
|
+
/\b__dirname\b/,
|
|
392
|
+
/\b__filename\b/,
|
|
393
|
+
/\brequire\s*\(/,
|
|
394
|
+
/\bimport\s*\(/,
|
|
395
|
+
/child_process/,
|
|
396
|
+
/\bfs\b/,
|
|
397
|
+
/\bnet\b/,
|
|
398
|
+
/\bhttp\b/,
|
|
399
|
+
/\bconstructor\s*[\.\[]/,
|
|
400
|
+
/\b__proto__\s*[\.\[]/,
|
|
401
|
+
/\bprototype\s*[\.\[]/,
|
|
402
|
+
];
|
|
403
|
+
static validateHandlers(handlers) {
|
|
404
|
+
if (Object.keys(handlers).length > 50) {
|
|
405
|
+
throw new Error('Too many handlers - security limit exceeded');
|
|
406
|
+
}
|
|
407
|
+
return Object.entries(handlers).reduce((acc, [key, handler]) => {
|
|
408
|
+
this.validateHandler(key, handler);
|
|
409
|
+
acc[key] = handler.toString();
|
|
410
|
+
return acc;
|
|
411
|
+
}, {});
|
|
412
|
+
}
|
|
413
|
+
static validateHandler(key, handler) {
|
|
414
|
+
if (typeof handler !== 'function') {
|
|
415
|
+
throw new Error(`Handler for '${key}' must be a function`);
|
|
416
|
+
}
|
|
417
|
+
const source = handler.toString();
|
|
418
|
+
if (source.length > 10000) {
|
|
419
|
+
throw new Error(`Handler '${key}' is too large (${source.length} chars)`);
|
|
420
|
+
}
|
|
421
|
+
for (const pattern of this.DANGEROUS_PATTERNS) {
|
|
422
|
+
if (pattern.test(source)) {
|
|
423
|
+
throw new Error(`Handler '${key}' contains dangerous pattern: ${pattern.toString()}`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
const validatedHandlers = WorkerSecurityValidator.validateHandlers(handlers);
|
|
429
|
+
return `
|
|
430
|
+
const { parentPort, workerData } = require('worker_threads');
|
|
431
|
+
const { workerId, enableProfiling } = workerData;
|
|
432
|
+
const vm = require('vm');
|
|
433
|
+
|
|
434
|
+
// Security: Enhanced VM context with comprehensive restrictions
|
|
435
|
+
class SecureVMContext {
|
|
436
|
+
static createRestrictedContext() {
|
|
437
|
+
const safeBuiltins = Object.create(null);
|
|
438
|
+
|
|
439
|
+
// Only expose truly safe operations
|
|
440
|
+
safeBuiltins.Array = Array;
|
|
441
|
+
safeBuiltins.Object = {
|
|
442
|
+
keys: Object.keys,
|
|
443
|
+
values: Object.values,
|
|
444
|
+
entries: Object.entries,
|
|
445
|
+
assign: Object.assign,
|
|
446
|
+
};
|
|
447
|
+
safeBuiltins.String = String;
|
|
448
|
+
safeBuiltins.Number = Number;
|
|
449
|
+
safeBuiltins.Boolean = Boolean;
|
|
450
|
+
safeBuiltins.JSON = { parse: JSON.parse, stringify: JSON.stringify };
|
|
451
|
+
safeBuiltins.Date = Date;
|
|
452
|
+
safeBuiltins.Math = Math;
|
|
453
|
+
safeBuiltins.Promise = Promise;
|
|
454
|
+
|
|
455
|
+
// Restricted console for debugging
|
|
456
|
+
safeBuiltins.console = {
|
|
457
|
+
log: (...args) => console.log('[WORKER]', ...args),
|
|
458
|
+
warn: (...args) => console.warn('[WORKER]', ...args),
|
|
459
|
+
error: (...args) => console.error('[WORKER]', ...args)
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
// Security: Explicitly poison dangerous globals
|
|
463
|
+
const poisonedGlobals = {
|
|
464
|
+
eval: () => { throw new Error('eval not allowed'); },
|
|
465
|
+
Function: () => { throw new Error('Function constructor not allowed'); },
|
|
466
|
+
require: () => { throw new Error('require not allowed'); },
|
|
467
|
+
process: () => { throw new Error('process access not allowed'); },
|
|
468
|
+
global: () => { throw new Error('global access not allowed'); },
|
|
469
|
+
Buffer: undefined,
|
|
470
|
+
setTimeout: () => { throw new Error('setTimeout not allowed'); },
|
|
471
|
+
constructor: undefined,
|
|
472
|
+
__proto__: undefined,
|
|
473
|
+
prototype: undefined,
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
return Object.assign(Object.create(null), safeBuiltins, poisonedGlobals);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const safeContext = SecureVMContext.createRestrictedContext();
|
|
481
|
+
|
|
482
|
+
const handlerEntries = ${JSON.stringify(Object.entries(validatedHandlers))};
|
|
483
|
+
|
|
484
|
+
const handlers = handlerEntries.reduce((acc, [key, functionSource]) => {
|
|
485
|
+
try {
|
|
486
|
+
// Security: Enhanced VM compilation with strict mode
|
|
487
|
+
const wrappedSource = \`
|
|
488
|
+
'use strict';
|
|
489
|
+
(function() {
|
|
490
|
+
if (typeof this !== 'undefined' && this !== null) {
|
|
491
|
+
throw new Error('Unexpected this context');
|
|
492
|
+
}
|
|
493
|
+
return (\${functionSource});
|
|
494
|
+
})()
|
|
495
|
+
\`;
|
|
496
|
+
|
|
497
|
+
acc[key] = vm.runInNewContext(wrappedSource, safeContext, {
|
|
498
|
+
timeout: 3000, // Reduced timeout for security
|
|
499
|
+
displayErrors: false, // Don't leak error details
|
|
500
|
+
contextName: \`worker-handler-\${key}\`,
|
|
501
|
+
contextCodeGeneration: {
|
|
502
|
+
strings: false, // Disable string-to-code generation
|
|
503
|
+
wasm: false, // Disable WASM generation
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
// Security: Comprehensive validation
|
|
508
|
+
if (typeof acc[key] !== 'function') {
|
|
509
|
+
throw new Error(\`Handler '\${key}' compilation failed\`);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Security: Wrap function with runtime protections
|
|
513
|
+
const originalFn = acc[key];
|
|
514
|
+
acc[key] = function secureWrapper(data) {
|
|
515
|
+
if (data && typeof data === 'object') {
|
|
516
|
+
if ('constructor' in data ?? '__proto__' in data) {
|
|
517
|
+
throw new Error('Dangerous properties in input data');
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return originalFn.call(null, data);
|
|
521
|
+
};
|
|
522
|
+
} catch (error) {
|
|
523
|
+
throw new Error(\`Failed to compile handler '\${key}': \${error.message}\`);
|
|
524
|
+
}
|
|
525
|
+
return acc;
|
|
526
|
+
}, {});
|
|
527
|
+
|
|
528
|
+
parentPort.on('message', msg => {
|
|
529
|
+
void (async () => {
|
|
530
|
+
const { taskId, type, data } = msg;
|
|
531
|
+
const startTime = enableProfiling ? performance.now() : 0;
|
|
532
|
+
|
|
533
|
+
try {
|
|
534
|
+
const handler = handlers[type];
|
|
535
|
+
if (!handler) {
|
|
536
|
+
throw new Error(\`Unknown task type: \${type}\`);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const result = await handler(data);
|
|
540
|
+
const duration = enableProfiling ? performance.now() - startTime : 0;
|
|
541
|
+
|
|
542
|
+
parentPort.postMessage({
|
|
543
|
+
taskId,
|
|
544
|
+
success: true,
|
|
545
|
+
result,
|
|
546
|
+
duration,
|
|
547
|
+
});
|
|
548
|
+
} catch (error) {
|
|
549
|
+
const duration = enableProfiling ? performance.now() - startTime : 0;
|
|
550
|
+
|
|
551
|
+
parentPort.postMessage({
|
|
552
|
+
taskId,
|
|
553
|
+
success: false,
|
|
554
|
+
error: error.message,
|
|
555
|
+
duration,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
})();
|
|
559
|
+
});
|
|
560
|
+
`;
|
|
561
|
+
}
|
|
562
|
+
let globalWorkerPool = null;
|
|
563
|
+
export function getGlobalWorkerPool(workerScript, options) {
|
|
564
|
+
if (!globalWorkerPool) {
|
|
565
|
+
if (!workerScript) {
|
|
566
|
+
throw new Error('Worker script required for first initialization');
|
|
567
|
+
}
|
|
568
|
+
globalWorkerPool = new WorkerPool(workerScript, options);
|
|
569
|
+
}
|
|
570
|
+
return globalWorkerPool;
|
|
571
|
+
}
|
|
572
|
+
export function destroyGlobalWorkerPool() {
|
|
573
|
+
if (globalWorkerPool) {
|
|
574
|
+
const pool = globalWorkerPool;
|
|
575
|
+
globalWorkerPool = null;
|
|
576
|
+
return pool.destroy();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (isMainThread) {
|
|
580
|
+
process.on('beforeExit', () => {
|
|
581
|
+
if (globalWorkerPool) {
|
|
582
|
+
void destroyGlobalWorkerPool();
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
//# sourceMappingURL=worker-pool.js.map
|