skillfit 0.9.0 → 0.10.0
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/README.md +41 -15
- package/README.zh-CN.md +41 -15
- package/benches/README.md +23 -0
- package/benches/contrib/README.md +1 -0
- package/benches/contrib/oss-skill-independent/README.md +60 -0
- package/benches/contrib/oss-skill-independent/bench.json +79 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/Readme.md +1015 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/esm.mjs +15 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/index.js +27 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/argument.js +147 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/command.js +1944 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/error.js +45 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/help.js +396 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/option.js +208 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/lib/suggestSimilar.js +100 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/package.json +63 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.d.ts +774 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/typings/index.test-d.ts +416 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-async-listener-order/upstream-package.json +69 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/Readme.md +1149 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/esm.mjs +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/index.js +24 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/argument.js +149 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/command.js +2662 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/error.js +39 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/help.js +713 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/option.js +367 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/lib/suggestSimilar.js +101 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/package.json +71 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/esm.d.mts +3 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.d.ts +1045 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/typings/index.test-d.ts +737 -0
- package/benches/contrib/oss-skill-independent/fixtures/commander-output-isolation/upstream-package.json +82 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.d.ts +40 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/index.js +68 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/package.json +54 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/readme.md +99 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/upstream-package.json +54 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/index.js +67 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-async-context/vendor/yocto-queue/package.json +46 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/index.js +132 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/package.json +57 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/readme.md +181 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/upstream-package.json +58 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/index.js +116 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/package.json +60 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/readme.md +170 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/throttle-sync-throw/upstream-package.json +60 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.d.ts +149 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/index.js +93 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/package.json +52 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/readme.md +192 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-custom-timers/upstream-package.json +52 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/index.js +114 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/readme.md +158 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-infinity-abort/upstream-package.json +48 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/index.js +122 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/license +9 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/package.json +50 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/readme.md +190 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/fixtures/timeout-rejection-listener/upstream-package.json +50 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/Readme.md +1015 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/esm.mjs +15 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/index.js +27 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/argument.js +147 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/command.js +1948 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/error.js +45 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/help.js +396 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/option.js +208 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/lib/suggestSimilar.js +100 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/package.json +63 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.d.ts +774 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/typings/index.test-d.ts +416 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-async-listener-order/upstream-package.json +69 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/LICENSE +22 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/Readme.md +1149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/esm.mjs +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/index.js +24 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/argument.js +149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/command.js +2666 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/error.js +39 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/help.js +713 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/option.js +367 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/lib/suggestSimilar.js +101 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package-support.json +16 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/package.json +71 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/esm.d.mts +3 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.d.ts +1045 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/typings/index.test-d.ts +737 -0
- package/benches/contrib/oss-skill-independent/ground-truth/commander-output-isolation/upstream-package.json +82 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/async-hooks-stub.js +15 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.d.ts +40 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/index.js +71 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/package.json +61 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/readme.md +99 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/regression.test.mjs +6 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/upstream-package.json +54 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/index.js +67 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/vendor/yocto-queue/package.json +46 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/index.js +148 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/package.json +57 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/readme.md +181 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/upstream-package.json +58 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/index.js +84 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/limit-map-iteration-rejection/vendor/yocto-queue/package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-async-listener-order.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-commander-output-isolation.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-async-context.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-limit-map-iteration-rejection.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-throttle-sync-throw.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-custom-timers.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-infinity-abort.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/oracle-timeout-rejection-listener.mjs +1 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.d.ts +136 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/index.js +121 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/package.json +60 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/readme.md +170 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/regression.test.mjs +6 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/throttle-sync-throw/upstream-package.json +60 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.d.ts +149 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/index.js +95 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/package.json +52 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/readme.md +192 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-custom-timers/upstream-package.json +52 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/index.js +114 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/readme.md +158 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-infinity-abort/upstream-package.json +48 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.d.ts +151 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/index.js +122 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/license +9 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/package.json +50 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/readme.md +190 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/regression.test.mjs +5 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/test.mjs +4 -0
- package/benches/contrib/oss-skill-independent/ground-truth/timeout-rejection-listener/upstream-package.json +50 -0
- package/benches/contrib/oss-skill-independent/prompts/commander-async-listener-order.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/commander-output-isolation.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/limit-async-context.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/limit-map-iteration-rejection.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/throttle-sync-throw.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-custom-timers.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-infinity-abort.md +3 -0
- package/benches/contrib/oss-skill-independent/prompts/timeout-rejection-listener.md +3 -0
- package/benches/contrib/oss-skill-independent/provenance.json +1903 -0
- package/benches/contrib/oss-skill-independent/task-specs.json +63 -0
- package/benches/contrib/oss-skill-independent/test-clock.mjs +65 -0
- package/benches/contrib/oss-skill-independent/verifiers/cases.mjs +197 -0
- package/benches/contrib/oss-skill-independent/verifiers/commander-async-listener-order.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/commander-output-isolation.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/grade.mjs +48 -0
- package/benches/contrib/oss-skill-independent/verifiers/limit-async-context.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/limit-map-iteration-rejection.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/probe.mjs +16 -0
- package/benches/contrib/oss-skill-independent/verifiers/regression-evidence.mjs +105 -0
- package/benches/contrib/oss-skill-independent/verifiers/test-reporter.mjs +29 -0
- package/benches/contrib/oss-skill-independent/verifiers/throttle-sync-throw.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-custom-timers.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-infinity-abort.mjs +1 -0
- package/benches/contrib/oss-skill-independent/verifiers/timeout-rejection-listener.mjs +1 -0
- package/dist/cli.js +166 -53
- package/dist/commands/bench-check-json.test.js +221 -0
- package/dist/commands/bench-check-report.js +48 -0
- package/dist/commands/bench-command-template.js +129 -0
- package/dist/commands/bench-manage.js +91 -0
- package/dist/commands/bench-manage.test.js +87 -0
- package/dist/commands/bench.js +68 -38
- package/dist/commands/bench.test.js +101 -0
- package/dist/commands/eval-component.js +17 -0
- package/dist/commands/eval-export.js +152 -0
- package/dist/commands/eval-export.test.js +122 -0
- package/dist/commands/eval.js +14 -3
- package/dist/commands/eval.test.js +58 -1
- package/dist/harness/bench.js +21 -2
- package/dist/harness/eval-audit.js +42 -4
- package/dist/harness/eval-budget.js +51 -0
- package/dist/harness/eval-budget.test.js +210 -0
- package/dist/harness/eval-component.test.js +36 -0
- package/dist/harness/eval-contract.js +5 -1
- package/dist/harness/replay-package.js +85 -0
- package/dist/harness/runner.js +22 -1
- package/docs/bench-authoring.md +40 -0
- package/docs/bench-check-json.md +115 -0
- package/docs/case-management.md +65 -0
- package/docs/eval-component.md +60 -49
- package/docs/examples/check-receiver-mechanism-proposal.mjs +124 -0
- package/docs/examples/prepare-native-diff-probe.mjs +75 -0
- package/docs/examples/reproduce-independent-comparison-budget.mjs +73 -0
- package/docs/first-real-eval.md +6 -0
- package/docs/growth-roadmap-2026-10.md +57 -93
- package/docs/metrics.md +21 -0
- package/docs/plans/2026-10-14-evidence-and-release-sequence.md +30 -13
- package/docs/plans/2026-10-15-independent-comparison-budget.json +1769 -0
- package/docs/plans/2026-10-15-independent-comparison-inputs.json +373 -0
- package/docs/plans/2026-10-15-independent-comparison-proposal.md +177 -0
- package/docs/plans/2026-10-15-native-diff-mechanism.md +105 -0
- package/docs/plans/2026-10-15-receiver-mechanism-proposal.json +342 -0
- package/docs/plans/2026-10-15-receiver-mechanism-proposal.md +146 -0
- package/docs/plans/2026-10-15-receiver-mechanism-verification.json +105 -0
- package/docs/plans/2026-10-16-case-workflow-and-release.md +30 -0
- package/docs/releases/0.10.0.md +45 -0
- package/docs/releases/0.9.0-verification.json +38 -0
- package/docs/releases/0.9.0.md +20 -3
- package/docs/releases/0.9.1-first-publication.json +249 -0
- package/docs/releases/0.9.1-verification.json +122 -0
- package/docs/releases/0.9.1.md +65 -0
- package/docs/releases/trusted-publishing.md +114 -0
- package/docs/replay-packages.md +88 -0
- package/docs/schemas/bench-check.schema.json +109 -0
- package/docs/schemas/eval-request.schema.json +12 -0
- package/docs/sharing-results.md +6 -0
- package/docs/skill-evaluation-evidence.md +52 -0
- package/evidence/2026-10-15-diagnosing-receiver-correction.md +140 -0
- package/evidence/2026-10-15-independent-comparison-regression-stop.md +162 -0
- package/evidence/2026-10-15-independent-offline-readiness.md +144 -0
- package/evidence/2026-10-15-native-diff-mechanism.md +196 -0
- package/evidence/2026-10-15-receiver-mechanism-stop.md +154 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/README.md +35 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/expected.json +577 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/receiver-contract.test.mjs +138 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/replay.mjs +127 -0
- package/evidence/artifacts/2026-10-15-diagnosing-receiver-correction/verification.json +105 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/README.md +32 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/checks.json +32 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-independent-comparison-regression-stop/verification.json +25 -0
- package/evidence/artifacts/2026-10-15-independent-offline-readiness/README.md +17 -0
- package/evidence/artifacts/2026-10-15-independent-offline-readiness/verification.json +1548 -0
- package/evidence/artifacts/2026-10-15-native-diff-mechanism/README.md +48 -0
- package/evidence/artifacts/2026-10-15-native-diff-mechanism/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/README.md +38 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/checks.json +118 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/package.tar.gz +0 -0
- package/evidence/artifacts/2026-10-15-receiver-mechanism-stop/verification.json +36 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/LICENSE +21 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/SKILL.md +51 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/agents/openai.yaml +3 -0
- package/evidence/inputs/diagnosing-bugs-compact-v4.1-receiver/scripts/hitl-loop.template.sh +44 -0
- package/package.json +3 -3
- package/skills/skillfit/SKILL.md +17 -5
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commander",
|
|
3
|
+
"version": "13.1.0",
|
|
4
|
+
"description": "the complete solution for node.js command-line programs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"commander",
|
|
7
|
+
"command",
|
|
8
|
+
"option",
|
|
9
|
+
"parser",
|
|
10
|
+
"cli",
|
|
11
|
+
"argument",
|
|
12
|
+
"args",
|
|
13
|
+
"argv"
|
|
14
|
+
],
|
|
15
|
+
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/tj/commander.js.git"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"check": "npm run check:type && npm run check:lint && npm run check:format",
|
|
23
|
+
"check:format": "prettier --check .",
|
|
24
|
+
"check:lint": "eslint .",
|
|
25
|
+
"check:type": "npm run check:type:js && npm run check:type:ts",
|
|
26
|
+
"check:type:ts": "tsd && tsc -p tsconfig.ts.json",
|
|
27
|
+
"check:type:js": "tsc -p tsconfig.js.json",
|
|
28
|
+
"fix": "npm run fix:lint && npm run fix:format",
|
|
29
|
+
"fix:format": "prettier --write .",
|
|
30
|
+
"fix:lint": "eslint --fix .",
|
|
31
|
+
"test": "jest && npm run check:type:ts",
|
|
32
|
+
"test-all": "jest && npm run test-esm && npm run check",
|
|
33
|
+
"test-esm": "node ./tests/esm-imports-test.mjs"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"index.js",
|
|
37
|
+
"lib/*.js",
|
|
38
|
+
"esm.mjs",
|
|
39
|
+
"typings/index.d.ts",
|
|
40
|
+
"typings/esm.d.mts",
|
|
41
|
+
"package-support.json"
|
|
42
|
+
],
|
|
43
|
+
"type": "commonjs",
|
|
44
|
+
"main": "./index.js",
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./typings/index.d.ts",
|
|
49
|
+
"default": "./index.js"
|
|
50
|
+
},
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./typings/esm.d.mts",
|
|
53
|
+
"default": "./esm.mjs"
|
|
54
|
+
},
|
|
55
|
+
"default": "./index.js"
|
|
56
|
+
},
|
|
57
|
+
"./esm.mjs": {
|
|
58
|
+
"types": "./typings/esm.d.mts",
|
|
59
|
+
"import": "./esm.mjs"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@eslint/js": "^9.4.0",
|
|
64
|
+
"@types/jest": "^29.2.4",
|
|
65
|
+
"@types/node": "^22.7.4",
|
|
66
|
+
"eslint": "^9.17.0",
|
|
67
|
+
"eslint-config-prettier": "^10.0.1",
|
|
68
|
+
"eslint-plugin-jest": "^28.3.0",
|
|
69
|
+
"globals": "^16.0.0",
|
|
70
|
+
"jest": "^29.3.1",
|
|
71
|
+
"prettier": "^3.2.5",
|
|
72
|
+
"ts-jest": "^29.0.3",
|
|
73
|
+
"tsd": "^0.31.0",
|
|
74
|
+
"typescript": "^5.0.4",
|
|
75
|
+
"typescript-eslint": "^8.12.2"
|
|
76
|
+
},
|
|
77
|
+
"types": "typings/index.d.ts",
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=18"
|
|
80
|
+
},
|
|
81
|
+
"support": true
|
|
82
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/member-ordering */
|
|
2
|
+
|
|
3
|
+
export interface LimitFunction {
|
|
4
|
+
/**
|
|
5
|
+
The number of promises that are currently running.
|
|
6
|
+
*/
|
|
7
|
+
readonly activeCount: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
|
11
|
+
*/
|
|
12
|
+
readonly pendingCount: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
Discard pending promises that are waiting to run.
|
|
16
|
+
|
|
17
|
+
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
|
18
|
+
|
|
19
|
+
Note: This does not cancel promises that are already running.
|
|
20
|
+
*/
|
|
21
|
+
clearQueue: () => void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
@param fn - Promise-returning/async function.
|
|
25
|
+
@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
|
|
26
|
+
@returns The promise returned by calling `fn(...arguments)`.
|
|
27
|
+
*/
|
|
28
|
+
<Arguments extends unknown[], ReturnType>(
|
|
29
|
+
fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
|
|
30
|
+
...arguments: Arguments
|
|
31
|
+
): Promise<ReturnType>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
Run multiple promise-returning & async functions with limited concurrency.
|
|
36
|
+
|
|
37
|
+
@param concurrency - Concurrency limit. Minimum: `1`.
|
|
38
|
+
@returns A `limit` function.
|
|
39
|
+
*/
|
|
40
|
+
export default function pLimit(concurrency: number): LimitFunction;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Queue from './vendor/yocto-queue/index.js';
|
|
2
|
+
import {AsyncResource} from '#async_hooks';
|
|
3
|
+
|
|
4
|
+
export default function pLimit(concurrency) {
|
|
5
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
6
|
+
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const queue = new Queue();
|
|
10
|
+
let activeCount = 0;
|
|
11
|
+
|
|
12
|
+
const next = () => {
|
|
13
|
+
activeCount--;
|
|
14
|
+
|
|
15
|
+
if (queue.size > 0) {
|
|
16
|
+
queue.dequeue()();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const run = async (fn, resolve, args) => {
|
|
21
|
+
activeCount++;
|
|
22
|
+
|
|
23
|
+
const result = (async () => fn(...args))();
|
|
24
|
+
|
|
25
|
+
resolve(result);
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
await result;
|
|
29
|
+
} catch {}
|
|
30
|
+
|
|
31
|
+
next();
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const enqueue = (fn, resolve, args) => {
|
|
35
|
+
queue.enqueue(
|
|
36
|
+
AsyncResource.bind(run.bind(undefined, fn, resolve, args)),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
(async () => {
|
|
40
|
+
// This function needs to wait until the next microtask before comparing
|
|
41
|
+
// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
|
|
42
|
+
// when the run function is dequeued and called. The comparison in the if-statement
|
|
43
|
+
// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
|
|
44
|
+
await Promise.resolve();
|
|
45
|
+
|
|
46
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
47
|
+
queue.dequeue()();
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const generator = (fn, ...args) => new Promise(resolve => {
|
|
53
|
+
enqueue(fn, resolve, args);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
Object.defineProperties(generator, {
|
|
57
|
+
activeCount: {
|
|
58
|
+
get: () => activeCount,
|
|
59
|
+
},
|
|
60
|
+
pendingCount: {
|
|
61
|
+
get: () => queue.size,
|
|
62
|
+
},
|
|
63
|
+
clearQueue: {
|
|
64
|
+
value: () => {
|
|
65
|
+
queue.clear();
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return generator;
|
|
71
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "p-limit",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/p-limit",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.js",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#async_hooks": {
|
|
17
|
+
"node": "async_hooks",
|
|
18
|
+
"default": "./async-hooks-stub.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "node --test test.mjs"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"index.js",
|
|
29
|
+
"index.d.ts",
|
|
30
|
+
"async-hooks-stub.js"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"promise",
|
|
34
|
+
"limit",
|
|
35
|
+
"limited",
|
|
36
|
+
"concurrency",
|
|
37
|
+
"throttle",
|
|
38
|
+
"throat",
|
|
39
|
+
"rate",
|
|
40
|
+
"batch",
|
|
41
|
+
"ratelimit",
|
|
42
|
+
"task",
|
|
43
|
+
"queue",
|
|
44
|
+
"async",
|
|
45
|
+
"await",
|
|
46
|
+
"promises",
|
|
47
|
+
"bluebird"
|
|
48
|
+
],
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"yocto-queue": "^1.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"ava": "^3.15.0",
|
|
54
|
+
"delay": "^5.0.0",
|
|
55
|
+
"in-range": "^3.0.0",
|
|
56
|
+
"random-int": "^3.0.0",
|
|
57
|
+
"time-span": "^5.0.0",
|
|
58
|
+
"tsd": "^0.17.0",
|
|
59
|
+
"xo": "^0.44.0"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# p-limit
|
|
2
|
+
|
|
3
|
+
> Run multiple promise-returning & async functions with limited concurrency
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ npm install p-limit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import pLimit from 'p-limit';
|
|
15
|
+
|
|
16
|
+
const limit = pLimit(1);
|
|
17
|
+
|
|
18
|
+
const input = [
|
|
19
|
+
limit(() => fetchSomething('foo')),
|
|
20
|
+
limit(() => fetchSomething('bar')),
|
|
21
|
+
limit(() => doSomething())
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
// Only one promise is run at once
|
|
25
|
+
const result = await Promise.all(input);
|
|
26
|
+
console.log(result);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
### pLimit(concurrency)
|
|
32
|
+
|
|
33
|
+
Returns a `limit` function.
|
|
34
|
+
|
|
35
|
+
#### concurrency
|
|
36
|
+
|
|
37
|
+
Type: `number`\
|
|
38
|
+
Minimum: `1`\
|
|
39
|
+
Default: `Infinity`
|
|
40
|
+
|
|
41
|
+
Concurrency limit.
|
|
42
|
+
|
|
43
|
+
### limit(fn, ...args)
|
|
44
|
+
|
|
45
|
+
Returns the promise returned by calling `fn(...args)`.
|
|
46
|
+
|
|
47
|
+
#### fn
|
|
48
|
+
|
|
49
|
+
Type: `Function`
|
|
50
|
+
|
|
51
|
+
Promise-returning/async function.
|
|
52
|
+
|
|
53
|
+
#### args
|
|
54
|
+
|
|
55
|
+
Any arguments to pass through to `fn`.
|
|
56
|
+
|
|
57
|
+
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.
|
|
58
|
+
|
|
59
|
+
### limit.activeCount
|
|
60
|
+
|
|
61
|
+
The number of promises that are currently running.
|
|
62
|
+
|
|
63
|
+
### limit.pendingCount
|
|
64
|
+
|
|
65
|
+
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
|
|
66
|
+
|
|
67
|
+
### limit.clearQueue()
|
|
68
|
+
|
|
69
|
+
Discard pending promises that are waiting to run.
|
|
70
|
+
|
|
71
|
+
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
|
|
72
|
+
|
|
73
|
+
Note: This does not cancel promises that are already running.
|
|
74
|
+
|
|
75
|
+
## FAQ
|
|
76
|
+
|
|
77
|
+
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
|
|
78
|
+
|
|
79
|
+
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
|
|
80
|
+
|
|
81
|
+
## Related
|
|
82
|
+
|
|
83
|
+
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
|
|
84
|
+
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
|
|
85
|
+
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
|
|
86
|
+
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
|
|
87
|
+
- [More…](https://github.com/sindresorhus/promise-fun)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
<div align="center">
|
|
92
|
+
<b>
|
|
93
|
+
<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
94
|
+
</b>
|
|
95
|
+
<br>
|
|
96
|
+
<sub>
|
|
97
|
+
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
98
|
+
</sub>
|
|
99
|
+
</div>
|
package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/regression.test.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import test from 'node:test';
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import {AsyncLocalStorage} from 'node:async_hooks';
|
|
5
|
+
import pLimit from './index.js';
|
|
6
|
+
test('queued calls retain distinct async stores', async () => { const limit = pLimit(2), store = new AsyncLocalStorage(); await Promise.all(Array.from({length: 24}, (_, id) => store.run(id, () => limit(async () => { await Promise.resolve(); assert.equal(store.getStore(), id); })))); });
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
|
|
3
|
+
export async function flush() {
|
|
4
|
+
for (let i = 0; i < 24; i++) await Promise.resolve();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function observe(promise) {
|
|
8
|
+
const state = {status: 'pending'};
|
|
9
|
+
Promise.resolve(promise).then(
|
|
10
|
+
value => Object.assign(state, {status: 'fulfilled', value}),
|
|
11
|
+
reason => Object.assign(state, {status: 'rejected', reason}),
|
|
12
|
+
);
|
|
13
|
+
return state;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function gate() {
|
|
17
|
+
let release;
|
|
18
|
+
const promise = new Promise(resolve => { release = resolve; });
|
|
19
|
+
return {promise, release};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Only test processes replace their clock; fixtures and the eval runner stay unchanged.
|
|
23
|
+
export async function withClock(run) {
|
|
24
|
+
const original = {setTimeout: globalThis.setTimeout, clearTimeout: globalThis.clearTimeout, now: Date.now};
|
|
25
|
+
let now = 1000, serial = 0;
|
|
26
|
+
const timers = new Map(), errors = [];
|
|
27
|
+
globalThis.setTimeout = (fn, delay = 0, ...args) => {
|
|
28
|
+
const id = ++serial;
|
|
29
|
+
timers.set(id, {at: now + Math.max(0, Number(delay)), fn, args});
|
|
30
|
+
return id;
|
|
31
|
+
};
|
|
32
|
+
globalThis.clearTimeout = id => timers.delete(id);
|
|
33
|
+
Date.now = () => now;
|
|
34
|
+
const clock = {
|
|
35
|
+
get now() { return now; },
|
|
36
|
+
get pending() { return timers.size; },
|
|
37
|
+
async advance(amount) {
|
|
38
|
+
const end = now + amount;
|
|
39
|
+
for (let steps = 0; ; steps++) {
|
|
40
|
+
assert.ok(steps < 1000, 'timer queue must make bounded progress');
|
|
41
|
+
const next = [...timers.entries()].filter(([, t]) => t.at <= end)
|
|
42
|
+
.sort((a, b) => a[1].at - b[1].at || a[0] - b[0])[0];
|
|
43
|
+
if (!next) break;
|
|
44
|
+
const [id, timer] = next;
|
|
45
|
+
timers.delete(id); now = timer.at;
|
|
46
|
+
try {
|
|
47
|
+
const result = timer.fn(...timer.args);
|
|
48
|
+
if (result?.then) Promise.resolve(result).catch(error => errors.push(error));
|
|
49
|
+
} catch (error) { errors.push(error); }
|
|
50
|
+
await flush();
|
|
51
|
+
}
|
|
52
|
+
now = end;
|
|
53
|
+
await flush();
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
await run(clock);
|
|
58
|
+
await flush();
|
|
59
|
+
assert.deepEqual(errors, [], 'scheduled callbacks must not throw outside their public promises');
|
|
60
|
+
} finally {
|
|
61
|
+
globalThis.setTimeout = original.setTimeout;
|
|
62
|
+
globalThis.clearTimeout = original.clearTimeout;
|
|
63
|
+
Date.now = original.now;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import * as api from './index.js';
|
|
4
|
+
test('ordinary public API remains usable', async () => {const limit = api.default(2); assert.deepEqual(await Promise.all([limit(() => 2), limit(async () => 4)]), [2, 4]);});
|
package/benches/contrib/oss-skill-independent/ground-truth/limit-async-context/upstream-package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "p-limit",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Run multiple promise-returning & async functions with limited concurrency",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/p-limit",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.js",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "xo && ava && tsd"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"index.js",
|
|
23
|
+
"index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"promise",
|
|
27
|
+
"limit",
|
|
28
|
+
"limited",
|
|
29
|
+
"concurrency",
|
|
30
|
+
"throttle",
|
|
31
|
+
"throat",
|
|
32
|
+
"rate",
|
|
33
|
+
"batch",
|
|
34
|
+
"ratelimit",
|
|
35
|
+
"task",
|
|
36
|
+
"queue",
|
|
37
|
+
"async",
|
|
38
|
+
"await",
|
|
39
|
+
"promises",
|
|
40
|
+
"bluebird"
|
|
41
|
+
],
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"yocto-queue": "^1.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"ava": "^3.15.0",
|
|
47
|
+
"delay": "^5.0.0",
|
|
48
|
+
"in-range": "^3.0.0",
|
|
49
|
+
"random-int": "^3.0.0",
|
|
50
|
+
"time-span": "^5.0.0",
|
|
51
|
+
"tsd": "^0.17.0",
|
|
52
|
+
"xo": "^0.44.0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
How it works:
|
|
3
|
+
`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
class Node {
|
|
7
|
+
value;
|
|
8
|
+
next;
|
|
9
|
+
|
|
10
|
+
constructor(value) {
|
|
11
|
+
this.value = value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default class Queue {
|
|
16
|
+
#head;
|
|
17
|
+
#tail;
|
|
18
|
+
#size;
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
this.clear();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
enqueue(value) {
|
|
25
|
+
const node = new Node(value);
|
|
26
|
+
|
|
27
|
+
if (this.#head) {
|
|
28
|
+
this.#tail.next = node;
|
|
29
|
+
this.#tail = node;
|
|
30
|
+
} else {
|
|
31
|
+
this.#head = node;
|
|
32
|
+
this.#tail = node;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
this.#size++;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
dequeue() {
|
|
39
|
+
const current = this.#head;
|
|
40
|
+
if (!current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.#head = this.#head.next;
|
|
45
|
+
this.#size--;
|
|
46
|
+
return current.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
clear() {
|
|
50
|
+
this.#head = undefined;
|
|
51
|
+
this.#tail = undefined;
|
|
52
|
+
this.#size = 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get size() {
|
|
56
|
+
return this.#size;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
* [Symbol.iterator]() {
|
|
60
|
+
let current = this.#head;
|
|
61
|
+
|
|
62
|
+
while (current) {
|
|
63
|
+
yield current.value;
|
|
64
|
+
current = current.next;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yocto-queue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Tiny queue data structure",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/yocto-queue",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.js",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=12.20"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"//test": "xo && ava && tsd",
|
|
20
|
+
"test": "ava && tsd"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"index.js",
|
|
24
|
+
"index.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"queue",
|
|
28
|
+
"data",
|
|
29
|
+
"structure",
|
|
30
|
+
"algorithm",
|
|
31
|
+
"queues",
|
|
32
|
+
"queuing",
|
|
33
|
+
"list",
|
|
34
|
+
"array",
|
|
35
|
+
"linkedlist",
|
|
36
|
+
"fifo",
|
|
37
|
+
"enqueue",
|
|
38
|
+
"dequeue",
|
|
39
|
+
"data-structure"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"ava": "^3.15.0",
|
|
43
|
+
"tsd": "^0.17.0",
|
|
44
|
+
"xo": "^0.44.0"
|
|
45
|
+
}
|
|
46
|
+
}
|