karajan-code 3.2.0 → 3.4.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 +1 -1
- package/node_modules/@karajan/core/README.md +42 -0
- package/node_modules/@karajan/core/package.json +38 -0
- package/node_modules/@karajan/core/src/atomic-write.js +43 -0
- package/node_modules/@karajan/core/src/cost/index.js +102 -0
- package/node_modules/@karajan/core/src/hu-snapshot.js +105 -0
- package/node_modules/@karajan/core/src/index.js +18 -0
- package/node_modules/@karajan/core/src/paths.js +123 -0
- package/node_modules/@karajan/core/src/plan-hu-ops.js +338 -0
- package/node_modules/@karajan/core/src/plan-id.js +45 -0
- package/node_modules/@karajan/core/src/plan-validation.js +82 -0
- package/node_modules/@karajan/core/src/port-check.js +45 -0
- package/node_modules/@karajan/core/src/pricing/index.js +64 -0
- package/node_modules/@karajan/core/src/pricing/model-pricing.json +28 -0
- package/node_modules/@karajan/core/src/process.js +188 -0
- package/node_modules/@karajan/core/src/run-registry.js +115 -0
- package/node_modules/@karajan/core/src/shared-paths.js +41 -0
- package/node_modules/@karajan/core/src/standby-scheduler.js +92 -0
- package/node_modules/@karajan/core/src/standby-store.js +168 -0
- package/node_modules/@karajan/core/src/vec-store.js +253 -0
- package/node_modules/@karajan/core/tests/atomic-write.test.js +30 -0
- package/node_modules/@karajan/core/tests/cost/index.test.js +89 -0
- package/node_modules/@karajan/core/tests/hu-snapshot.test.js +39 -0
- package/node_modules/@karajan/core/tests/paths.test.js +51 -0
- package/node_modules/@karajan/core/tests/plan-hu-ops.test.js +68 -0
- package/node_modules/@karajan/core/tests/plan-id.test.js +21 -0
- package/node_modules/@karajan/core/tests/plan-validation.test.js +39 -0
- package/node_modules/@karajan/core/tests/port-check.test.js +47 -0
- package/node_modules/@karajan/core/tests/pricing/index.test.js +95 -0
- package/node_modules/@karajan/core/tests/process.test.js +22 -0
- package/node_modules/@karajan/core/tests/run-registry.test.js +71 -0
- package/node_modules/@karajan/core/tests/shared-paths.test.js +30 -0
- package/node_modules/@karajan/core/tests/standby.test.js +66 -0
- package/node_modules/@karajan/core/tests/vec-store.test.js +98 -0
- package/node_modules/@karajan/core/vitest.config.js +12 -0
- package/node_modules/@sec-ant/readable-stream/LICENSE +21 -0
- package/node_modules/@sec-ant/readable-stream/README.md +230 -0
- package/node_modules/@sec-ant/readable-stream/dist/core/asyncIterablePrototype.d.ts +1 -0
- package/node_modules/@sec-ant/readable-stream/dist/core/asyncIterator.d.ts +27 -0
- package/node_modules/@sec-ant/readable-stream/dist/core/fromAnyIterable.d.ts +6 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.d.ts +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/asyncIterator.js +5 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.d.ts +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/fromAnyIterable.js +5 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/index.d.ts +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/index/index.js +8 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.d.ts +1 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/asyncIterator.js +3 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.d.ts +1 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/fromAnyIterable.js +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/index.d.ts +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/polyfill/index.js +4 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.d.ts +1 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js +89 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.d.ts +1 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js +34 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.d.ts +2 -0
- package/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js +6 -0
- package/node_modules/@sec-ant/readable-stream/dist/types/async-iterator.d.ts +11 -0
- package/node_modules/@sec-ant/readable-stream/package.json +96 -0
- package/node_modules/@sindresorhus/merge-streams/index.d.ts +44 -0
- package/node_modules/@sindresorhus/merge-streams/index.js +265 -0
- package/node_modules/@sindresorhus/merge-streams/license +9 -0
- package/node_modules/@sindresorhus/merge-streams/package.json +49 -0
- package/node_modules/@sindresorhus/merge-streams/readme.md +53 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/better-sqlite3/LICENSE +21 -0
- package/node_modules/better-sqlite3/README.md +99 -0
- package/node_modules/better-sqlite3/binding.gyp +38 -0
- package/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/node_modules/better-sqlite3/deps/common.gypi +68 -0
- package/node_modules/better-sqlite3/deps/copy.js +31 -0
- package/node_modules/better-sqlite3/deps/defines.gypi +42 -0
- package/node_modules/better-sqlite3/deps/download.sh +123 -0
- package/node_modules/better-sqlite3/deps/patches/1208.patch +15 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +268879 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +14335 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +739 -0
- package/node_modules/better-sqlite3/deps/sqlite3.gyp +80 -0
- package/node_modules/better-sqlite3/deps/test_extension.c +21 -0
- package/node_modules/better-sqlite3/lib/database.js +90 -0
- package/node_modules/better-sqlite3/lib/index.js +3 -0
- package/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/node_modules/better-sqlite3/lib/util.js +12 -0
- package/node_modules/better-sqlite3/package.json +59 -0
- package/node_modules/better-sqlite3/src/addon.cpp +47 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.cpp +74 -0
- package/node_modules/better-sqlite3/src/objects/backup.cpp +120 -0
- package/node_modules/better-sqlite3/src/objects/backup.hpp +36 -0
- package/node_modules/better-sqlite3/src/objects/database.cpp +417 -0
- package/node_modules/better-sqlite3/src/objects/database.hpp +103 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.cpp +113 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.hpp +50 -0
- package/node_modules/better-sqlite3/src/objects/statement.cpp +383 -0
- package/node_modules/better-sqlite3/src/objects/statement.hpp +58 -0
- package/node_modules/better-sqlite3/src/util/bind-map.cpp +73 -0
- package/node_modules/better-sqlite3/src/util/binder.cpp +193 -0
- package/node_modules/better-sqlite3/src/util/constants.cpp +172 -0
- package/node_modules/better-sqlite3/src/util/custom-aggregate.cpp +121 -0
- package/node_modules/better-sqlite3/src/util/custom-function.cpp +59 -0
- package/node_modules/better-sqlite3/src/util/custom-table.cpp +409 -0
- package/node_modules/better-sqlite3/src/util/data-converter.cpp +17 -0
- package/node_modules/better-sqlite3/src/util/data.cpp +194 -0
- package/node_modules/better-sqlite3/src/util/helpers.cpp +109 -0
- package/node_modules/better-sqlite3/src/util/macros.cpp +83 -0
- package/node_modules/better-sqlite3/src/util/query-macros.cpp +71 -0
- package/node_modules/better-sqlite3/src/util/row-builder.cpp +49 -0
- package/node_modules/bindings/LICENSE.md +22 -0
- package/node_modules/bindings/README.md +98 -0
- package/node_modules/bindings/bindings.js +221 -0
- package/node_modules/bindings/package.json +28 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chownr/LICENSE +15 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/chownr.js +167 -0
- package/node_modules/chownr/package.json +29 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/deep-extend/CHANGELOG.md +46 -0
- package/node_modules/deep-extend/LICENSE +20 -0
- package/node_modules/deep-extend/README.md +91 -0
- package/node_modules/deep-extend/index.js +1 -0
- package/node_modules/deep-extend/lib/deep-extend.js +150 -0
- package/node_modules/deep-extend/package.json +62 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +163 -0
- package/node_modules/detect-libc/index.d.ts +14 -0
- package/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/node_modules/detect-libc/lib/elf.js +39 -0
- package/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/node_modules/detect-libc/lib/process.js +24 -0
- package/node_modules/detect-libc/package.json +44 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +96 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/execa/index.d.ts +27 -0
- package/node_modules/execa/index.js +28 -0
- package/node_modules/execa/lib/arguments/command.js +20 -0
- package/node_modules/execa/lib/arguments/cwd.js +39 -0
- package/node_modules/execa/lib/arguments/encoding-option.js +50 -0
- package/node_modules/execa/lib/arguments/escape.js +88 -0
- package/node_modules/execa/lib/arguments/fd-options.js +108 -0
- package/node_modules/execa/lib/arguments/file-url.js +25 -0
- package/node_modules/execa/lib/arguments/options.js +96 -0
- package/node_modules/execa/lib/arguments/shell.js +11 -0
- package/node_modules/execa/lib/arguments/specific.js +111 -0
- package/node_modules/execa/lib/convert/add.js +15 -0
- package/node_modules/execa/lib/convert/concurrent.js +33 -0
- package/node_modules/execa/lib/convert/duplex.js +69 -0
- package/node_modules/execa/lib/convert/iterable.js +34 -0
- package/node_modules/execa/lib/convert/readable.js +113 -0
- package/node_modules/execa/lib/convert/shared.js +46 -0
- package/node_modules/execa/lib/convert/writable.js +90 -0
- package/node_modules/execa/lib/io/contents.js +116 -0
- package/node_modules/execa/lib/io/input-sync.js +44 -0
- package/node_modules/execa/lib/io/iterate.js +110 -0
- package/node_modules/execa/lib/io/max-buffer.js +89 -0
- package/node_modules/execa/lib/io/output-async.js +80 -0
- package/node_modules/execa/lib/io/output-sync.js +135 -0
- package/node_modules/execa/lib/io/pipeline.js +48 -0
- package/node_modules/execa/lib/io/strip-newline.js +12 -0
- package/node_modules/execa/lib/ipc/array.js +4 -0
- package/node_modules/execa/lib/ipc/buffer-messages.js +47 -0
- package/node_modules/execa/lib/ipc/forward.js +56 -0
- package/node_modules/execa/lib/ipc/get-each.js +89 -0
- package/node_modules/execa/lib/ipc/get-one.js +69 -0
- package/node_modules/execa/lib/ipc/graceful.js +72 -0
- package/node_modules/execa/lib/ipc/incoming.js +79 -0
- package/node_modules/execa/lib/ipc/ipc-input.js +44 -0
- package/node_modules/execa/lib/ipc/methods.js +49 -0
- package/node_modules/execa/lib/ipc/outgoing.js +47 -0
- package/node_modules/execa/lib/ipc/reference.js +44 -0
- package/node_modules/execa/lib/ipc/send.js +91 -0
- package/node_modules/execa/lib/ipc/strict.js +113 -0
- package/node_modules/execa/lib/ipc/validation.js +111 -0
- package/node_modules/execa/lib/methods/bind.js +23 -0
- package/node_modules/execa/lib/methods/command.js +43 -0
- package/node_modules/execa/lib/methods/create.js +65 -0
- package/node_modules/execa/lib/methods/main-async.js +194 -0
- package/node_modules/execa/lib/methods/main-sync.js +163 -0
- package/node_modules/execa/lib/methods/node.js +51 -0
- package/node_modules/execa/lib/methods/parameters.js +31 -0
- package/node_modules/execa/lib/methods/promise.js +15 -0
- package/node_modules/execa/lib/methods/script.js +22 -0
- package/node_modules/execa/lib/methods/template.js +153 -0
- package/node_modules/execa/lib/pipe/abort.js +20 -0
- package/node_modules/execa/lib/pipe/pipe-arguments.js +91 -0
- package/node_modules/execa/lib/pipe/sequence.js +24 -0
- package/node_modules/execa/lib/pipe/setup.js +72 -0
- package/node_modules/execa/lib/pipe/streaming.js +51 -0
- package/node_modules/execa/lib/pipe/throw.js +58 -0
- package/node_modules/execa/lib/resolve/all-async.js +46 -0
- package/node_modules/execa/lib/resolve/all-sync.js +33 -0
- package/node_modules/execa/lib/resolve/exit-async.js +54 -0
- package/node_modules/execa/lib/resolve/exit-sync.js +25 -0
- package/node_modules/execa/lib/resolve/stdio.js +47 -0
- package/node_modules/execa/lib/resolve/wait-stream.js +96 -0
- package/node_modules/execa/lib/resolve/wait-subprocess.js +146 -0
- package/node_modules/execa/lib/return/duration.js +8 -0
- package/node_modules/execa/lib/return/early-error.js +60 -0
- package/node_modules/execa/lib/return/final-error.js +40 -0
- package/node_modules/execa/lib/return/message.js +157 -0
- package/node_modules/execa/lib/return/reject.js +13 -0
- package/node_modules/execa/lib/return/result.js +186 -0
- package/node_modules/execa/lib/stdio/direction.js +76 -0
- package/node_modules/execa/lib/stdio/duplicate.js +116 -0
- package/node_modules/execa/lib/stdio/handle-async.js +52 -0
- package/node_modules/execa/lib/stdio/handle-sync.js +57 -0
- package/node_modules/execa/lib/stdio/handle.js +214 -0
- package/node_modules/execa/lib/stdio/input-option.js +50 -0
- package/node_modules/execa/lib/stdio/native.js +106 -0
- package/node_modules/execa/lib/stdio/stdio-option.js +60 -0
- package/node_modules/execa/lib/stdio/type.js +173 -0
- package/node_modules/execa/lib/terminate/cancel.js +20 -0
- package/node_modules/execa/lib/terminate/cleanup.js +16 -0
- package/node_modules/execa/lib/terminate/graceful.js +71 -0
- package/node_modules/execa/lib/terminate/kill.js +93 -0
- package/node_modules/execa/lib/terminate/signal.js +70 -0
- package/node_modules/execa/lib/terminate/timeout.js +21 -0
- package/node_modules/execa/lib/transform/encoding-transform.js +51 -0
- package/node_modules/execa/lib/transform/generator.js +107 -0
- package/node_modules/execa/lib/transform/normalize.js +111 -0
- package/node_modules/execa/lib/transform/object-mode.js +41 -0
- package/node_modules/execa/lib/transform/run-async.js +60 -0
- package/node_modules/execa/lib/transform/run-sync.js +50 -0
- package/node_modules/execa/lib/transform/split.js +110 -0
- package/node_modules/execa/lib/transform/validate.js +43 -0
- package/node_modules/execa/lib/utils/abort-signal.js +8 -0
- package/node_modules/execa/lib/utils/deferred.js +7 -0
- package/node_modules/execa/lib/utils/max-listeners.js +14 -0
- package/node_modules/execa/lib/utils/standard-stream.js +6 -0
- package/node_modules/execa/lib/utils/uint-array.js +69 -0
- package/node_modules/execa/lib/verbose/complete.js +24 -0
- package/node_modules/execa/lib/verbose/custom.js +26 -0
- package/node_modules/execa/lib/verbose/default.js +54 -0
- package/node_modules/execa/lib/verbose/error.js +13 -0
- package/node_modules/execa/lib/verbose/info.js +39 -0
- package/node_modules/execa/lib/verbose/ipc.js +15 -0
- package/node_modules/execa/lib/verbose/log.js +54 -0
- package/node_modules/execa/lib/verbose/output.js +60 -0
- package/node_modules/execa/lib/verbose/start.js +15 -0
- package/node_modules/execa/lib/verbose/values.js +33 -0
- package/node_modules/execa/license +9 -0
- package/node_modules/execa/package.json +105 -0
- package/node_modules/execa/readme.md +461 -0
- package/node_modules/execa/types/arguments/encoding-option.d.ts +19 -0
- package/node_modules/execa/types/arguments/fd-options.d.ts +8 -0
- package/node_modules/execa/types/arguments/options.d.ts +400 -0
- package/node_modules/execa/types/arguments/specific.d.ts +52 -0
- package/node_modules/execa/types/convert.d.ts +58 -0
- package/node_modules/execa/types/ipc.d.ts +156 -0
- package/node_modules/execa/types/methods/command.d.ts +114 -0
- package/node_modules/execa/types/methods/main-async.d.ts +379 -0
- package/node_modules/execa/types/methods/main-sync.d.ts +59 -0
- package/node_modules/execa/types/methods/node.d.ts +62 -0
- package/node_modules/execa/types/methods/script.d.ts +115 -0
- package/node_modules/execa/types/methods/template.d.ts +18 -0
- package/node_modules/execa/types/pipe.d.ts +58 -0
- package/node_modules/execa/types/return/final-error.d.ts +51 -0
- package/node_modules/execa/types/return/ignore.d.ts +26 -0
- package/node_modules/execa/types/return/result-all.d.ts +30 -0
- package/node_modules/execa/types/return/result-ipc.d.ts +27 -0
- package/node_modules/execa/types/return/result-stdio.d.ts +17 -0
- package/node_modules/execa/types/return/result-stdout.d.ts +50 -0
- package/node_modules/execa/types/return/result.d.ts +203 -0
- package/node_modules/execa/types/stdio/array.d.ts +16 -0
- package/node_modules/execa/types/stdio/direction.d.ts +12 -0
- package/node_modules/execa/types/stdio/option.d.ts +40 -0
- package/node_modules/execa/types/stdio/type.d.ts +170 -0
- package/node_modules/execa/types/subprocess/all.d.ts +17 -0
- package/node_modules/execa/types/subprocess/stdio.d.ts +18 -0
- package/node_modules/execa/types/subprocess/stdout.d.ts +22 -0
- package/node_modules/execa/types/subprocess/subprocess.d.ts +117 -0
- package/node_modules/execa/types/transform/normalize.d.ts +57 -0
- package/node_modules/execa/types/transform/object-mode.d.ts +21 -0
- package/node_modules/execa/types/utils.d.ts +13 -0
- package/node_modules/execa/types/verbose.d.ts +98 -0
- package/node_modules/expand-template/.travis.yml +6 -0
- package/node_modules/expand-template/LICENSE +21 -0
- package/node_modules/expand-template/README.md +43 -0
- package/node_modules/expand-template/index.js +26 -0
- package/node_modules/expand-template/package.json +29 -0
- package/node_modules/expand-template/test.js +67 -0
- package/node_modules/figures/index.d.ts +279 -0
- package/node_modules/figures/index.js +292 -0
- package/node_modules/figures/license +9 -0
- package/node_modules/figures/package.json +49 -0
- package/node_modules/figures/readme.md +337 -0
- package/node_modules/file-uri-to-path/.npmignore +1 -0
- package/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/node_modules/file-uri-to-path/History.md +21 -0
- package/node_modules/file-uri-to-path/LICENSE +20 -0
- package/node_modules/file-uri-to-path/README.md +74 -0
- package/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/node_modules/file-uri-to-path/index.js +66 -0
- package/node_modules/file-uri-to-path/package.json +32 -0
- package/node_modules/file-uri-to-path/test/test.js +24 -0
- package/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/node_modules/fs-constants/LICENSE +21 -0
- package/node_modules/fs-constants/README.md +26 -0
- package/node_modules/fs-constants/browser.js +1 -0
- package/node_modules/fs-constants/index.js +1 -0
- package/node_modules/fs-constants/package.json +19 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +60 -0
- package/node_modules/get-stream/readme.md +303 -0
- package/node_modules/get-stream/source/array-buffer.js +84 -0
- package/node_modules/get-stream/source/array.js +32 -0
- package/node_modules/get-stream/source/buffer.js +19 -0
- package/node_modules/get-stream/source/contents.js +121 -0
- package/node_modules/get-stream/source/exports.js +5 -0
- package/node_modules/get-stream/source/index.d.ts +121 -0
- package/node_modules/get-stream/source/index.js +13 -0
- package/node_modules/get-stream/source/stream.js +65 -0
- package/node_modules/get-stream/source/string.js +41 -0
- package/node_modules/get-stream/source/utils.js +11 -0
- package/node_modules/github-from-package/.travis.yml +4 -0
- package/node_modules/github-from-package/LICENSE +18 -0
- package/node_modules/github-from-package/example/package.json +8 -0
- package/node_modules/github-from-package/example/url.js +3 -0
- package/node_modules/github-from-package/index.js +17 -0
- package/node_modules/github-from-package/package.json +30 -0
- package/node_modules/github-from-package/readme.markdown +53 -0
- package/node_modules/github-from-package/test/a.json +8 -0
- package/node_modules/github-from-package/test/b.json +5 -0
- package/node_modules/github-from-package/test/c.json +5 -0
- package/node_modules/github-from-package/test/d.json +7 -0
- package/node_modules/github-from-package/test/e.json +5 -0
- package/node_modules/github-from-package/test/url.js +19 -0
- package/node_modules/human-signals/LICENSE +201 -0
- package/node_modules/human-signals/README.md +171 -0
- package/node_modules/human-signals/build/src/core.js +273 -0
- package/node_modules/human-signals/build/src/main.d.ts +206 -0
- package/node_modules/human-signals/build/src/main.js +70 -0
- package/node_modules/human-signals/build/src/realtime.js +16 -0
- package/node_modules/human-signals/build/src/signals.js +34 -0
- package/node_modules/human-signals/package.json +66 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ini/LICENSE +15 -0
- package/node_modules/ini/README.md +102 -0
- package/node_modules/ini/ini.js +206 -0
- package/node_modules/ini/package.json +33 -0
- package/node_modules/is-plain-obj/index.d.ts +35 -0
- package/node_modules/is-plain-obj/index.js +8 -0
- package/node_modules/is-plain-obj/license +9 -0
- package/node_modules/is-plain-obj/package.json +41 -0
- package/node_modules/is-plain-obj/readme.md +58 -0
- package/node_modules/is-stream/index.d.ts +90 -0
- package/node_modules/is-stream/index.js +37 -0
- package/node_modules/is-stream/license +9 -0
- package/node_modules/is-stream/package.json +48 -0
- package/node_modules/is-stream/readme.md +57 -0
- package/node_modules/is-unicode-supported/index.d.ts +12 -0
- package/node_modules/is-unicode-supported/index.js +21 -0
- package/node_modules/is-unicode-supported/license +9 -0
- package/node_modules/is-unicode-supported/package.json +47 -0
- package/node_modules/is-unicode-supported/readme.md +35 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/mimic-response/index.js +77 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +42 -0
- package/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/mkdirp-classic/LICENSE +21 -0
- package/node_modules/mkdirp-classic/README.md +18 -0
- package/node_modules/mkdirp-classic/index.js +98 -0
- package/node_modules/mkdirp-classic/package.json +18 -0
- package/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +31 -0
- package/node_modules/napi-build-utils/LICENSE +21 -0
- package/node_modules/napi-build-utils/README.md +52 -0
- package/node_modules/napi-build-utils/index.js +214 -0
- package/node_modules/napi-build-utils/index.md +0 -0
- package/node_modules/napi-build-utils/package.json +42 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +446 -0
- package/node_modules/node-abi/index.js +179 -0
- package/node_modules/node-abi/package.json +45 -0
- package/node_modules/npm-run-path/index.d.ts +90 -0
- package/node_modules/npm-run-path/index.js +55 -0
- package/node_modules/npm-run-path/license +9 -0
- package/node_modules/npm-run-path/node_modules/path-key/index.d.ts +31 -0
- package/node_modules/npm-run-path/node_modules/path-key/index.js +12 -0
- package/node_modules/npm-run-path/node_modules/path-key/license +9 -0
- package/node_modules/npm-run-path/node_modules/path-key/package.json +41 -0
- package/node_modules/npm-run-path/node_modules/path-key/readme.md +57 -0
- package/node_modules/npm-run-path/package.json +52 -0
- package/node_modules/npm-run-path/readme.md +104 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/parse-ms/index.d.ts +30 -0
- package/node_modules/parse-ms/index.js +45 -0
- package/node_modules/parse-ms/license +9 -0
- package/node_modules/parse-ms/package.json +47 -0
- package/node_modules/parse-ms/readme.md +46 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/prebuild-install/CHANGELOG.md +131 -0
- package/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
- package/node_modules/prebuild-install/LICENSE +21 -0
- package/node_modules/prebuild-install/README.md +163 -0
- package/node_modules/prebuild-install/asset.js +44 -0
- package/node_modules/prebuild-install/bin.js +78 -0
- package/node_modules/prebuild-install/download.js +142 -0
- package/node_modules/prebuild-install/error.js +14 -0
- package/node_modules/prebuild-install/help.txt +16 -0
- package/node_modules/prebuild-install/index.js +1 -0
- package/node_modules/prebuild-install/log.js +33 -0
- package/node_modules/prebuild-install/package.json +67 -0
- package/node_modules/prebuild-install/proxy.js +35 -0
- package/node_modules/prebuild-install/rc.js +64 -0
- package/node_modules/prebuild-install/util.js +143 -0
- package/node_modules/pretty-ms/index.d.ts +157 -0
- package/node_modules/pretty-ms/index.js +149 -0
- package/node_modules/pretty-ms/license +9 -0
- package/node_modules/pretty-ms/package.json +55 -0
- package/node_modules/pretty-ms/readme.md +179 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/empty.js +1 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +30 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/rc/LICENSE.APACHE2 +15 -0
- package/node_modules/rc/LICENSE.BSD +26 -0
- package/node_modules/rc/LICENSE.MIT +24 -0
- package/node_modules/rc/README.md +227 -0
- package/node_modules/rc/browser.js +7 -0
- package/node_modules/rc/cli.js +4 -0
- package/node_modules/rc/index.js +53 -0
- package/node_modules/rc/lib/utils.js +104 -0
- package/node_modules/rc/package.json +29 -0
- package/node_modules/rc/test/ini.js +16 -0
- package/node_modules/rc/test/nested-env-vars.js +50 -0
- package/node_modules/rc/test/test.js +59 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +665 -0
- package/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +557 -0
- package/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +91 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +74 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/node_modules/signal-exit/package.json +106 -0
- package/node_modules/simple-concat/.travis.yml +3 -0
- package/node_modules/simple-concat/LICENSE +20 -0
- package/node_modules/simple-concat/README.md +44 -0
- package/node_modules/simple-concat/index.js +15 -0
- package/node_modules/simple-concat/package.json +47 -0
- package/node_modules/simple-concat/test/basic.js +41 -0
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/LICENSE +20 -0
- package/node_modules/simple-get/README.md +333 -0
- package/node_modules/simple-get/index.js +108 -0
- package/node_modules/simple-get/package.json +67 -0
- package/node_modules/sqlite-vec/README.md +1 -0
- package/node_modules/sqlite-vec/index.cjs +46 -0
- package/node_modules/sqlite-vec/index.d.ts +17 -0
- package/node_modules/sqlite-vec/index.mjs +47 -0
- package/node_modules/sqlite-vec/package.json +1 -0
- package/node_modules/sqlite-vec-linux-x64/README.md +1 -0
- package/node_modules/sqlite-vec-linux-x64/package.json +1 -0
- package/node_modules/sqlite-vec-linux-x64/vec0.so +0 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/strip-final-newline/index.d.ts +18 -0
- package/node_modules/strip-final-newline/index.js +26 -0
- package/node_modules/strip-final-newline/license +9 -0
- package/node_modules/strip-final-newline/package.json +49 -0
- package/node_modules/strip-final-newline/readme.md +34 -0
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +42 -0
- package/node_modules/strip-json-comments/readme.md +64 -0
- package/node_modules/tar-fs/.travis.yml +6 -0
- package/node_modules/tar-fs/LICENSE +21 -0
- package/node_modules/tar-fs/README.md +165 -0
- package/node_modules/tar-fs/index.js +363 -0
- package/node_modules/tar-fs/package.json +41 -0
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +346 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +168 -0
- package/node_modules/tar-stream/extract.js +257 -0
- package/node_modules/tar-stream/headers.js +295 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +255 -0
- package/node_modules/tar-stream/package.json +58 -0
- package/node_modules/tar-stream/sandbox.js +11 -0
- package/node_modules/tunnel-agent/LICENSE +55 -0
- package/node_modules/tunnel-agent/README.md +4 -0
- package/node_modules/tunnel-agent/index.js +244 -0
- package/node_modules/tunnel-agent/package.json +22 -0
- package/node_modules/unicorn-magic/default.d.ts +13 -0
- package/node_modules/unicorn-magic/default.js +14 -0
- package/node_modules/unicorn-magic/license +9 -0
- package/node_modules/unicorn-magic/node.d.ts +125 -0
- package/node_modules/unicorn-magic/node.js +49 -0
- package/node_modules/unicorn-magic/package.json +62 -0
- package/node_modules/unicorn-magic/readme.md +25 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/which/CHANGELOG.md +166 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/yoctocolors/base.d.ts +47 -0
- package/node_modules/yoctocolors/base.js +94 -0
- package/node_modules/yoctocolors/index.d.ts +2 -0
- package/node_modules/yoctocolors/index.js +2 -0
- package/node_modules/yoctocolors/license +9 -0
- package/node_modules/yoctocolors/package.json +69 -0
- package/node_modules/yoctocolors/readme.md +138 -0
- package/package.json +5 -1
- package/packages/hu-board/public/utils/board-view.js +11 -0
- package/packages/hu-board/public/utils/formatters.js +28 -1
- package/packages/hu-board/src/db.js +62 -3
- package/packages/hu-board/src/format.js +46 -1
- package/src/agents/aider-agent.js +42 -1
- package/src/agents/claude-agent.js +31 -5
- package/src/agents/codex-agent.js +44 -7
- package/src/agents/gemini-agent.js +37 -1
- package/src/agents/opencode-agent.js +34 -1
- package/src/orchestrator/drivers/pre-loop-phases/inject-loaded-plan.js +12 -1
- package/src/orchestrator/flow-runner.js +10 -2
- package/src/orchestrator/hu-sub-pipeline.js +30 -0
- package/src/prompts/architect.js +32 -37
- package/src/prompts/coder.js +71 -96
- package/src/prompts/hu-reviewer.js +23 -29
- package/src/prompts/prompt-layout.js +80 -0
- package/src/prompts/reviewer.js +34 -39
- package/src/roles/agent-role.js +9 -1
- package/src/roles/coder-role.js +6 -3
- package/src/roles/reviewer-role.js +20 -23
- package/src/session/journal/summary-writer.js +55 -1
- package/src/utils/budget.js +38 -9
- package/src/utils/telemetry.js +43 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {parseFd} from './specific.js';
|
|
2
|
+
|
|
3
|
+
// Retrieve stream targeted by the `to` option
|
|
4
|
+
export const getToStream = (destination, to = 'stdin') => {
|
|
5
|
+
const isWritable = true;
|
|
6
|
+
const {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(destination);
|
|
7
|
+
const fdNumber = getFdNumber(fileDescriptors, to, isWritable);
|
|
8
|
+
const destinationStream = destination.stdio[fdNumber];
|
|
9
|
+
|
|
10
|
+
if (destinationStream === null) {
|
|
11
|
+
throw new TypeError(getInvalidStdioOptionMessage(fdNumber, to, options, isWritable));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return destinationStream;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Retrieve stream targeted by the `from` option
|
|
18
|
+
export const getFromStream = (source, from = 'stdout') => {
|
|
19
|
+
const isWritable = false;
|
|
20
|
+
const {options, fileDescriptors} = SUBPROCESS_OPTIONS.get(source);
|
|
21
|
+
const fdNumber = getFdNumber(fileDescriptors, from, isWritable);
|
|
22
|
+
const sourceStream = fdNumber === 'all' ? source.all : source.stdio[fdNumber];
|
|
23
|
+
|
|
24
|
+
if (sourceStream === null || sourceStream === undefined) {
|
|
25
|
+
throw new TypeError(getInvalidStdioOptionMessage(fdNumber, from, options, isWritable));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return sourceStream;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Keeps track of the options passed to each Execa call
|
|
32
|
+
export const SUBPROCESS_OPTIONS = new WeakMap();
|
|
33
|
+
|
|
34
|
+
const getFdNumber = (fileDescriptors, fdName, isWritable) => {
|
|
35
|
+
const fdNumber = parseFdNumber(fdName, isWritable);
|
|
36
|
+
validateFdNumber(fdNumber, fdName, isWritable, fileDescriptors);
|
|
37
|
+
return fdNumber;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const parseFdNumber = (fdName, isWritable) => {
|
|
41
|
+
const fdNumber = parseFd(fdName);
|
|
42
|
+
if (fdNumber !== undefined) {
|
|
43
|
+
return fdNumber;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const {validOptions, defaultValue} = isWritable
|
|
47
|
+
? {validOptions: '"stdin"', defaultValue: 'stdin'}
|
|
48
|
+
: {validOptions: '"stdout", "stderr", "all"', defaultValue: 'stdout'};
|
|
49
|
+
throw new TypeError(`"${getOptionName(isWritable)}" must not be "${fdName}".
|
|
50
|
+
It must be ${validOptions} or "fd3", "fd4" (and so on).
|
|
51
|
+
It is optional and defaults to "${defaultValue}".`);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const validateFdNumber = (fdNumber, fdName, isWritable, fileDescriptors) => {
|
|
55
|
+
const fileDescriptor = fileDescriptors[getUsedDescriptor(fdNumber)];
|
|
56
|
+
if (fileDescriptor === undefined) {
|
|
57
|
+
throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. That file descriptor does not exist.
|
|
58
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (fileDescriptor.direction === 'input' && !isWritable) {
|
|
62
|
+
throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a readable stream, not writable.`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (fileDescriptor.direction !== 'input' && isWritable) {
|
|
66
|
+
throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a writable stream, not readable.`);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => {
|
|
71
|
+
if (fdNumber === 'all' && !options.all) {
|
|
72
|
+
return 'The "all" option must be true to use "from: \'all\'".';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const {optionName, optionValue} = getInvalidStdioOption(fdNumber, options);
|
|
76
|
+
return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}".
|
|
77
|
+
Please set this option with "pipe" instead.`;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const getInvalidStdioOption = (fdNumber, {stdin, stdout, stderr, stdio}) => {
|
|
81
|
+
const usedDescriptor = getUsedDescriptor(fdNumber);
|
|
82
|
+
|
|
83
|
+
if (usedDescriptor === 0 && stdin !== undefined) {
|
|
84
|
+
return {optionName: 'stdin', optionValue: stdin};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (usedDescriptor === 1 && stdout !== undefined) {
|
|
88
|
+
return {optionName: 'stdout', optionValue: stdout};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (usedDescriptor === 2 && stderr !== undefined) {
|
|
92
|
+
return {optionName: 'stderr', optionValue: stderr};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return {optionName: `stdio[${usedDescriptor}]`, optionValue: stdio[usedDescriptor]};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const getUsedDescriptor = fdNumber => fdNumber === 'all' ? 1 : fdNumber;
|
|
99
|
+
|
|
100
|
+
const getOptionName = isWritable => isWritable ? 'to' : 'from';
|
|
101
|
+
|
|
102
|
+
export const serializeOptionValue = value => {
|
|
103
|
+
if (typeof value === 'string') {
|
|
104
|
+
return `'${value}'`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return typeof value === 'number' ? `${value}` : 'Stream';
|
|
108
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {fileURLToPath} from 'node:url';
|
|
2
|
+
|
|
3
|
+
// Allow some arguments/options to be either a file path string or a file URL
|
|
4
|
+
export const safeNormalizeFileUrl = (file, name) => {
|
|
5
|
+
const fileString = normalizeFileUrl(normalizeDenoExecPath(file));
|
|
6
|
+
|
|
7
|
+
if (typeof fileString !== 'string') {
|
|
8
|
+
throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return fileString;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// In Deno node:process execPath is a special object, not just a string:
|
|
15
|
+
// https://github.com/denoland/deno/blob/f460188e583f00144000aa0d8ade08218d47c3c1/ext/node/polyfills/process.ts#L344
|
|
16
|
+
const normalizeDenoExecPath = file => isDenoExecPath(file)
|
|
17
|
+
? file.toString()
|
|
18
|
+
: file;
|
|
19
|
+
|
|
20
|
+
export const isDenoExecPath = file => typeof file !== 'string'
|
|
21
|
+
&& file
|
|
22
|
+
&& Object.getPrototypeOf(file) === String.prototype;
|
|
23
|
+
|
|
24
|
+
// Same but also allows other values, e.g. `boolean` for the `shell` option
|
|
25
|
+
export const normalizeFileUrl = file => file instanceof URL ? fileURLToPath(file) : file;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import crossSpawn from 'cross-spawn';
|
|
4
|
+
import {npmRunPathEnv} from 'npm-run-path';
|
|
5
|
+
import {normalizeForceKillAfterDelay} from '../terminate/kill.js';
|
|
6
|
+
import {normalizeKillSignal} from '../terminate/signal.js';
|
|
7
|
+
import {validateCancelSignal} from '../terminate/cancel.js';
|
|
8
|
+
import {validateGracefulCancel} from '../terminate/graceful.js';
|
|
9
|
+
import {validateTimeout} from '../terminate/timeout.js';
|
|
10
|
+
import {handleNodeOption} from '../methods/node.js';
|
|
11
|
+
import {validateIpcInputOption} from '../ipc/ipc-input.js';
|
|
12
|
+
import {validateEncoding, BINARY_ENCODINGS} from './encoding-option.js';
|
|
13
|
+
import {normalizeCwd} from './cwd.js';
|
|
14
|
+
import {normalizeFileUrl} from './file-url.js';
|
|
15
|
+
import {normalizeFdSpecificOptions} from './specific.js';
|
|
16
|
+
|
|
17
|
+
// Normalize the options object, and sometimes also the file paths and arguments.
|
|
18
|
+
// Applies default values, validate allowed options, normalize them.
|
|
19
|
+
export const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
20
|
+
rawOptions.cwd = normalizeCwd(rawOptions.cwd);
|
|
21
|
+
const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions);
|
|
22
|
+
|
|
23
|
+
const {command: file, args: commandArguments, options: initialOptions} = crossSpawn._parse(processedFile, processedArguments, processedOptions);
|
|
24
|
+
|
|
25
|
+
const fdOptions = normalizeFdSpecificOptions(initialOptions);
|
|
26
|
+
const options = addDefaultOptions(fdOptions);
|
|
27
|
+
validateTimeout(options);
|
|
28
|
+
validateEncoding(options);
|
|
29
|
+
validateIpcInputOption(options);
|
|
30
|
+
validateCancelSignal(options);
|
|
31
|
+
validateGracefulCancel(options);
|
|
32
|
+
options.shell = normalizeFileUrl(options.shell);
|
|
33
|
+
options.env = getEnv(options);
|
|
34
|
+
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
35
|
+
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
36
|
+
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
37
|
+
|
|
38
|
+
if (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {
|
|
39
|
+
// #116
|
|
40
|
+
commandArguments.unshift('/q');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {file, commandArguments, options};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const addDefaultOptions = ({
|
|
47
|
+
extendEnv = true,
|
|
48
|
+
preferLocal = false,
|
|
49
|
+
cwd,
|
|
50
|
+
localDir: localDirectory = cwd,
|
|
51
|
+
encoding = 'utf8',
|
|
52
|
+
reject = true,
|
|
53
|
+
cleanup = true,
|
|
54
|
+
all = false,
|
|
55
|
+
windowsHide = true,
|
|
56
|
+
killSignal = 'SIGTERM',
|
|
57
|
+
forceKillAfterDelay = true,
|
|
58
|
+
gracefulCancel = false,
|
|
59
|
+
ipcInput,
|
|
60
|
+
ipc = ipcInput !== undefined || gracefulCancel,
|
|
61
|
+
serialization = 'advanced',
|
|
62
|
+
...options
|
|
63
|
+
}) => ({
|
|
64
|
+
...options,
|
|
65
|
+
extendEnv,
|
|
66
|
+
preferLocal,
|
|
67
|
+
cwd,
|
|
68
|
+
localDirectory,
|
|
69
|
+
encoding,
|
|
70
|
+
reject,
|
|
71
|
+
cleanup,
|
|
72
|
+
all,
|
|
73
|
+
windowsHide,
|
|
74
|
+
killSignal,
|
|
75
|
+
forceKillAfterDelay,
|
|
76
|
+
gracefulCancel,
|
|
77
|
+
ipcInput,
|
|
78
|
+
ipc,
|
|
79
|
+
serialization,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const getEnv = ({env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath}) => {
|
|
83
|
+
const env = extendEnv ? {...process.env, ...envOption} : envOption;
|
|
84
|
+
|
|
85
|
+
if (preferLocal || node) {
|
|
86
|
+
return npmRunPathEnv({
|
|
87
|
+
env,
|
|
88
|
+
cwd: localDirectory,
|
|
89
|
+
execPath: nodePath,
|
|
90
|
+
preferLocal,
|
|
91
|
+
addExecPath: node,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return env;
|
|
96
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// When the `shell` option is set, any command argument is concatenated as a single string by Node.js:
|
|
2
|
+
// https://github.com/nodejs/node/blob/e38ce27f3ca0a65f68a31cedd984cddb927d4002/lib/child_process.js#L614-L624
|
|
3
|
+
// However, since Node 24, it also prints a deprecation warning.
|
|
4
|
+
// To avoid this warning, we perform that same operation before calling `node:child_process`.
|
|
5
|
+
// Shells only understand strings, which is why Node.js performs that concatenation.
|
|
6
|
+
// However, we rely on users splitting command arguments as an array.
|
|
7
|
+
// For example, this allows us to easily detect which arguments are passed.
|
|
8
|
+
// So we do want users to pass array of arguments even with `shell: true`, but we also want to avoid any warning.
|
|
9
|
+
export const concatenateShell = (file, commandArguments, options) => options.shell && commandArguments.length > 0
|
|
10
|
+
? [[file, ...commandArguments].join(' '), [], options]
|
|
11
|
+
: [file, commandArguments, options];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {debuglog} from 'node:util';
|
|
2
|
+
import isPlainObject from 'is-plain-obj';
|
|
3
|
+
import {STANDARD_STREAMS_ALIASES} from '../utils/standard-stream.js';
|
|
4
|
+
|
|
5
|
+
// Some options can have different values for `stdout`/`stderr`/`fd3`.
|
|
6
|
+
// This normalizes those to array of values.
|
|
7
|
+
// For example, `{verbose: {stdout: 'none', stderr: 'full'}}` becomes `{verbose: ['none', 'none', 'full']}`
|
|
8
|
+
export const normalizeFdSpecificOptions = options => {
|
|
9
|
+
const optionsCopy = {...options};
|
|
10
|
+
|
|
11
|
+
for (const optionName of FD_SPECIFIC_OPTIONS) {
|
|
12
|
+
optionsCopy[optionName] = normalizeFdSpecificOption(options, optionName);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return optionsCopy;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const normalizeFdSpecificOption = (options, optionName) => {
|
|
19
|
+
const optionBaseArray = Array.from({length: getStdioLength(options) + 1});
|
|
20
|
+
const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName);
|
|
21
|
+
return addDefaultValue(optionArray, optionName);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getStdioLength = ({stdio}) => Array.isArray(stdio)
|
|
25
|
+
? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length)
|
|
26
|
+
: STANDARD_STREAMS_ALIASES.length;
|
|
27
|
+
|
|
28
|
+
const normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue)
|
|
29
|
+
? normalizeOptionObject(optionValue, optionArray, optionName)
|
|
30
|
+
: optionArray.fill(optionValue);
|
|
31
|
+
|
|
32
|
+
const normalizeOptionObject = (optionValue, optionArray, optionName) => {
|
|
33
|
+
for (const fdName of Object.keys(optionValue).sort(compareFdName)) {
|
|
34
|
+
for (const fdNumber of parseFdName(fdName, optionName, optionArray)) {
|
|
35
|
+
optionArray[fdNumber] = optionValue[fdName];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return optionArray;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Ensure priority order when setting both `stdout`/`stderr`, `fd1`/`fd2`, and `all`
|
|
43
|
+
const compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1;
|
|
44
|
+
|
|
45
|
+
const getFdNameOrder = fdName => {
|
|
46
|
+
if (fdName === 'stdout' || fdName === 'stderr') {
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return fdName === 'all' ? 2 : 1;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const parseFdName = (fdName, optionName, optionArray) => {
|
|
54
|
+
if (fdName === 'ipc') {
|
|
55
|
+
return [optionArray.length - 1];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const fdNumber = parseFd(fdName);
|
|
59
|
+
if (fdNumber === undefined || fdNumber === 0) {
|
|
60
|
+
throw new TypeError(`"${optionName}.${fdName}" is invalid.
|
|
61
|
+
It must be "${optionName}.stdout", "${optionName}.stderr", "${optionName}.all", "${optionName}.ipc", or "${optionName}.fd3", "${optionName}.fd4" (and so on).`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (fdNumber >= optionArray.length) {
|
|
65
|
+
throw new TypeError(`"${optionName}.${fdName}" is invalid: that file descriptor does not exist.
|
|
66
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return fdNumber === 'all' ? [1, 2] : [fdNumber];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Use the same syntax for fd-specific options and the `from`/`to` options
|
|
73
|
+
export const parseFd = fdName => {
|
|
74
|
+
if (fdName === 'all') {
|
|
75
|
+
return fdName;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (STANDARD_STREAMS_ALIASES.includes(fdName)) {
|
|
79
|
+
return STANDARD_STREAMS_ALIASES.indexOf(fdName);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const regexpResult = FD_REGEXP.exec(fdName);
|
|
83
|
+
if (regexpResult !== null) {
|
|
84
|
+
return Number(regexpResult[1]);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const FD_REGEXP = /^fd(\d+)$/;
|
|
89
|
+
|
|
90
|
+
const addDefaultValue = (optionArray, optionName) => optionArray.map(optionValue => optionValue === undefined
|
|
91
|
+
? DEFAULT_OPTIONS[optionName]
|
|
92
|
+
: optionValue);
|
|
93
|
+
|
|
94
|
+
// Default value for the `verbose` option
|
|
95
|
+
const verboseDefault = debuglog('execa').enabled ? 'full' : 'none';
|
|
96
|
+
|
|
97
|
+
const DEFAULT_OPTIONS = {
|
|
98
|
+
lines: false,
|
|
99
|
+
buffer: true,
|
|
100
|
+
maxBuffer: 1000 * 1000 * 100,
|
|
101
|
+
verbose: verboseDefault,
|
|
102
|
+
stripFinalNewline: true,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// List of options which can have different values for `stdout`/`stderr`
|
|
106
|
+
export const FD_SPECIFIC_OPTIONS = ['lines', 'buffer', 'maxBuffer', 'verbose', 'stripFinalNewline'];
|
|
107
|
+
|
|
108
|
+
// Retrieve fd-specific option
|
|
109
|
+
export const getFdSpecificValue = (optionArray, fdNumber) => fdNumber === 'ipc'
|
|
110
|
+
? optionArray.at(-1)
|
|
111
|
+
: optionArray[fdNumber];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {initializeConcurrentStreams} from './concurrent.js';
|
|
2
|
+
import {createReadable} from './readable.js';
|
|
3
|
+
import {createWritable} from './writable.js';
|
|
4
|
+
import {createDuplex} from './duplex.js';
|
|
5
|
+
import {createIterable} from './iterable.js';
|
|
6
|
+
|
|
7
|
+
// Add methods to convert the subprocess to a stream or iterable
|
|
8
|
+
export const addConvertedStreams = (subprocess, {encoding}) => {
|
|
9
|
+
const concurrentStreams = initializeConcurrentStreams();
|
|
10
|
+
subprocess.readable = createReadable.bind(undefined, {subprocess, concurrentStreams, encoding});
|
|
11
|
+
subprocess.writable = createWritable.bind(undefined, {subprocess, concurrentStreams});
|
|
12
|
+
subprocess.duplex = createDuplex.bind(undefined, {subprocess, concurrentStreams, encoding});
|
|
13
|
+
subprocess.iterable = createIterable.bind(undefined, subprocess, encoding);
|
|
14
|
+
subprocess[Symbol.asyncIterator] = createIterable.bind(undefined, subprocess, encoding, {});
|
|
15
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {createDeferred} from '../utils/deferred.js';
|
|
2
|
+
|
|
3
|
+
// When using multiple `.readable()`/`.writable()`/`.duplex()`, `final` and `destroy` should wait for other streams
|
|
4
|
+
export const initializeConcurrentStreams = () => ({
|
|
5
|
+
readableDestroy: new WeakMap(),
|
|
6
|
+
writableFinal: new WeakMap(),
|
|
7
|
+
writableDestroy: new WeakMap(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// Each file descriptor + `waitName` has its own array of promises.
|
|
11
|
+
// Each promise is a single `.readable()`/`.writable()`/`.duplex()` call.
|
|
12
|
+
export const addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
13
|
+
const weakMap = concurrentStreams[waitName];
|
|
14
|
+
if (!weakMap.has(stream)) {
|
|
15
|
+
weakMap.set(stream, []);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const promises = weakMap.get(stream);
|
|
19
|
+
const promise = createDeferred();
|
|
20
|
+
promises.push(promise);
|
|
21
|
+
const resolve = promise.resolve.bind(promise);
|
|
22
|
+
return {resolve, promises};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Wait for other streams, but stop waiting when subprocess ends
|
|
26
|
+
export const waitForConcurrentStreams = async ({resolve, promises}, subprocess) => {
|
|
27
|
+
resolve();
|
|
28
|
+
const [isSubprocessExit] = await Promise.race([
|
|
29
|
+
Promise.allSettled([true, subprocess]),
|
|
30
|
+
Promise.all([false, ...promises]),
|
|
31
|
+
]);
|
|
32
|
+
return !isSubprocessExit;
|
|
33
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {Duplex} from 'node:stream';
|
|
2
|
+
import {callbackify} from 'node:util';
|
|
3
|
+
import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';
|
|
4
|
+
import {
|
|
5
|
+
getSubprocessStdout,
|
|
6
|
+
getReadableOptions,
|
|
7
|
+
getReadableMethods,
|
|
8
|
+
onStdoutFinished,
|
|
9
|
+
onReadableDestroy,
|
|
10
|
+
} from './readable.js';
|
|
11
|
+
import {
|
|
12
|
+
getSubprocessStdin,
|
|
13
|
+
getWritableMethods,
|
|
14
|
+
onStdinFinished,
|
|
15
|
+
onWritableDestroy,
|
|
16
|
+
} from './writable.js';
|
|
17
|
+
|
|
18
|
+
// Create a `Duplex` stream combining both `subprocess.readable()` and `subprocess.writable()`
|
|
19
|
+
export const createDuplex = ({subprocess, concurrentStreams, encoding}, {from, to, binary: binaryOption = true, preserveNewlines = true} = {}) => {
|
|
20
|
+
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
21
|
+
const {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);
|
|
22
|
+
const {subprocessStdin, waitWritableFinal, waitWritableDestroy} = getSubprocessStdin(subprocess, to, concurrentStreams);
|
|
23
|
+
const {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);
|
|
24
|
+
const {read, onStdoutDataDone} = getReadableMethods({
|
|
25
|
+
subprocessStdout,
|
|
26
|
+
subprocess,
|
|
27
|
+
binary,
|
|
28
|
+
encoding,
|
|
29
|
+
preserveNewlines,
|
|
30
|
+
});
|
|
31
|
+
const duplex = new Duplex({
|
|
32
|
+
read,
|
|
33
|
+
...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal),
|
|
34
|
+
destroy: callbackify(onDuplexDestroy.bind(undefined, {
|
|
35
|
+
subprocessStdout,
|
|
36
|
+
subprocessStdin,
|
|
37
|
+
subprocess,
|
|
38
|
+
waitReadableDestroy,
|
|
39
|
+
waitWritableFinal,
|
|
40
|
+
waitWritableDestroy,
|
|
41
|
+
})),
|
|
42
|
+
readableHighWaterMark,
|
|
43
|
+
writableHighWaterMark: subprocessStdin.writableHighWaterMark,
|
|
44
|
+
readableObjectMode,
|
|
45
|
+
writableObjectMode: subprocessStdin.writableObjectMode,
|
|
46
|
+
encoding: readableEncoding,
|
|
47
|
+
});
|
|
48
|
+
onStdoutFinished({
|
|
49
|
+
subprocessStdout,
|
|
50
|
+
onStdoutDataDone,
|
|
51
|
+
readable: duplex,
|
|
52
|
+
subprocess,
|
|
53
|
+
subprocessStdin,
|
|
54
|
+
});
|
|
55
|
+
onStdinFinished(subprocessStdin, duplex, subprocessStdout);
|
|
56
|
+
return duplex;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const onDuplexDestroy = async ({subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy}, error) => {
|
|
60
|
+
await Promise.all([
|
|
61
|
+
onReadableDestroy({subprocessStdout, subprocess, waitReadableDestroy}, error),
|
|
62
|
+
onWritableDestroy({
|
|
63
|
+
subprocessStdin,
|
|
64
|
+
subprocess,
|
|
65
|
+
waitWritableFinal,
|
|
66
|
+
waitWritableDestroy,
|
|
67
|
+
}, error),
|
|
68
|
+
]);
|
|
69
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';
|
|
2
|
+
import {getFromStream} from '../arguments/fd-options.js';
|
|
3
|
+
import {iterateOnSubprocessStream} from '../io/iterate.js';
|
|
4
|
+
|
|
5
|
+
// Convert the subprocess to an async iterable
|
|
6
|
+
export const createIterable = (subprocess, encoding, {
|
|
7
|
+
from,
|
|
8
|
+
binary: binaryOption = false,
|
|
9
|
+
preserveNewlines = false,
|
|
10
|
+
} = {}) => {
|
|
11
|
+
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
12
|
+
const subprocessStdout = getFromStream(subprocess, from);
|
|
13
|
+
const onStdoutData = iterateOnSubprocessStream({
|
|
14
|
+
subprocessStdout,
|
|
15
|
+
subprocess,
|
|
16
|
+
binary,
|
|
17
|
+
shouldEncode: true,
|
|
18
|
+
encoding,
|
|
19
|
+
preserveNewlines,
|
|
20
|
+
});
|
|
21
|
+
return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const iterateOnStdoutData = async function * (onStdoutData, subprocessStdout, subprocess) {
|
|
25
|
+
try {
|
|
26
|
+
yield * onStdoutData;
|
|
27
|
+
} finally {
|
|
28
|
+
if (subprocessStdout.readable) {
|
|
29
|
+
subprocessStdout.destroy();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
await subprocess;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {Readable} from 'node:stream';
|
|
2
|
+
import {callbackify} from 'node:util';
|
|
3
|
+
import {BINARY_ENCODINGS} from '../arguments/encoding-option.js';
|
|
4
|
+
import {getFromStream} from '../arguments/fd-options.js';
|
|
5
|
+
import {iterateOnSubprocessStream, DEFAULT_OBJECT_HIGH_WATER_MARK} from '../io/iterate.js';
|
|
6
|
+
import {createDeferred} from '../utils/deferred.js';
|
|
7
|
+
import {addConcurrentStream, waitForConcurrentStreams} from './concurrent.js';
|
|
8
|
+
import {
|
|
9
|
+
safeWaitForSubprocessStdin,
|
|
10
|
+
waitForSubprocessStdout,
|
|
11
|
+
waitForSubprocess,
|
|
12
|
+
destroyOtherStream,
|
|
13
|
+
} from './shared.js';
|
|
14
|
+
|
|
15
|
+
// Create a `Readable` stream that forwards from `stdout` and awaits the subprocess
|
|
16
|
+
export const createReadable = ({subprocess, concurrentStreams, encoding}, {from, binary: binaryOption = true, preserveNewlines = true} = {}) => {
|
|
17
|
+
const binary = binaryOption || BINARY_ENCODINGS.has(encoding);
|
|
18
|
+
const {subprocessStdout, waitReadableDestroy} = getSubprocessStdout(subprocess, from, concurrentStreams);
|
|
19
|
+
const {readableEncoding, readableObjectMode, readableHighWaterMark} = getReadableOptions(subprocessStdout, binary);
|
|
20
|
+
const {read, onStdoutDataDone} = getReadableMethods({
|
|
21
|
+
subprocessStdout,
|
|
22
|
+
subprocess,
|
|
23
|
+
binary,
|
|
24
|
+
encoding,
|
|
25
|
+
preserveNewlines,
|
|
26
|
+
});
|
|
27
|
+
const readable = new Readable({
|
|
28
|
+
read,
|
|
29
|
+
destroy: callbackify(onReadableDestroy.bind(undefined, {subprocessStdout, subprocess, waitReadableDestroy})),
|
|
30
|
+
highWaterMark: readableHighWaterMark,
|
|
31
|
+
objectMode: readableObjectMode,
|
|
32
|
+
encoding: readableEncoding,
|
|
33
|
+
});
|
|
34
|
+
onStdoutFinished({
|
|
35
|
+
subprocessStdout,
|
|
36
|
+
onStdoutDataDone,
|
|
37
|
+
readable,
|
|
38
|
+
subprocess,
|
|
39
|
+
});
|
|
40
|
+
return readable;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Retrieve `stdout` (or other stream depending on `from`)
|
|
44
|
+
export const getSubprocessStdout = (subprocess, from, concurrentStreams) => {
|
|
45
|
+
const subprocessStdout = getFromStream(subprocess, from);
|
|
46
|
+
const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, 'readableDestroy');
|
|
47
|
+
return {subprocessStdout, waitReadableDestroy};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const getReadableOptions = ({readableEncoding, readableObjectMode, readableHighWaterMark}, binary) => binary
|
|
51
|
+
? {readableEncoding, readableObjectMode, readableHighWaterMark}
|
|
52
|
+
: {readableEncoding, readableObjectMode: true, readableHighWaterMark: DEFAULT_OBJECT_HIGH_WATER_MARK};
|
|
53
|
+
|
|
54
|
+
export const getReadableMethods = ({subprocessStdout, subprocess, binary, encoding, preserveNewlines}) => {
|
|
55
|
+
const onStdoutDataDone = createDeferred();
|
|
56
|
+
const onStdoutData = iterateOnSubprocessStream({
|
|
57
|
+
subprocessStdout,
|
|
58
|
+
subprocess,
|
|
59
|
+
binary,
|
|
60
|
+
shouldEncode: !binary,
|
|
61
|
+
encoding,
|
|
62
|
+
preserveNewlines,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
read() {
|
|
67
|
+
onRead(this, onStdoutData, onStdoutDataDone);
|
|
68
|
+
},
|
|
69
|
+
onStdoutDataDone,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Forwards data from `stdout` to `readable`
|
|
74
|
+
const onRead = async (readable, onStdoutData, onStdoutDataDone) => {
|
|
75
|
+
try {
|
|
76
|
+
const {value, done} = await onStdoutData.next();
|
|
77
|
+
if (done) {
|
|
78
|
+
onStdoutDataDone.resolve();
|
|
79
|
+
} else {
|
|
80
|
+
readable.push(value);
|
|
81
|
+
}
|
|
82
|
+
} catch {}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// When `subprocess.stdout` ends/aborts/errors, do the same on `readable`.
|
|
86
|
+
// Await the subprocess, for the same reason as above.
|
|
87
|
+
export const onStdoutFinished = async ({subprocessStdout, onStdoutDataDone, readable, subprocess, subprocessStdin}) => {
|
|
88
|
+
try {
|
|
89
|
+
await waitForSubprocessStdout(subprocessStdout);
|
|
90
|
+
await subprocess;
|
|
91
|
+
await safeWaitForSubprocessStdin(subprocessStdin);
|
|
92
|
+
await onStdoutDataDone;
|
|
93
|
+
|
|
94
|
+
if (readable.readable) {
|
|
95
|
+
readable.push(null);
|
|
96
|
+
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
await safeWaitForSubprocessStdin(subprocessStdin);
|
|
99
|
+
destroyOtherReadable(readable, error);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// When `readable` aborts/errors, do the same on `subprocess.stdout`
|
|
104
|
+
export const onReadableDestroy = async ({subprocessStdout, subprocess, waitReadableDestroy}, error) => {
|
|
105
|
+
if (await waitForConcurrentStreams(waitReadableDestroy, subprocess)) {
|
|
106
|
+
destroyOtherReadable(subprocessStdout, error);
|
|
107
|
+
await waitForSubprocess(subprocess, error);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const destroyOtherReadable = (stream, error) => {
|
|
112
|
+
destroyOtherStream(stream, stream.readable, error);
|
|
113
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {finished} from 'node:stream/promises';
|
|
2
|
+
import {isStreamAbort} from '../resolve/wait-stream.js';
|
|
3
|
+
|
|
4
|
+
export const safeWaitForSubprocessStdin = async subprocessStdin => {
|
|
5
|
+
if (subprocessStdin === undefined) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
await waitForSubprocessStdin(subprocessStdin);
|
|
11
|
+
} catch {}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const safeWaitForSubprocessStdout = async subprocessStdout => {
|
|
15
|
+
if (subprocessStdout === undefined) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await waitForSubprocessStdout(subprocessStdout);
|
|
21
|
+
} catch {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const waitForSubprocessStdin = async subprocessStdin => {
|
|
25
|
+
await finished(subprocessStdin, {cleanup: true, readable: false, writable: true});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const waitForSubprocessStdout = async subprocessStdout => {
|
|
29
|
+
await finished(subprocessStdout, {cleanup: true, readable: true, writable: false});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// When `readable` or `writable` aborts/errors, awaits the subprocess, for the reason mentioned above
|
|
33
|
+
export const waitForSubprocess = async (subprocess, error) => {
|
|
34
|
+
await subprocess;
|
|
35
|
+
if (error) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const destroyOtherStream = (stream, isOpen, error) => {
|
|
41
|
+
if (error && !isStreamAbort(error)) {
|
|
42
|
+
stream.destroy(error);
|
|
43
|
+
} else if (isOpen) {
|
|
44
|
+
stream.destroy();
|
|
45
|
+
}
|
|
46
|
+
};
|