@code-yeongyu/senpi 2026.6.3 → 2026.6.6-3

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.
Files changed (1075) hide show
  1. package/CHANGELOG.md +52 -4
  2. package/README.md +21 -4
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +1 -1
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/bun/register-bedrock.d.ts.map +1 -1
  7. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  8. package/dist/bun/restore-sandbox-env.js.map +1 -1
  9. package/dist/cli/args.d.ts +1 -0
  10. package/dist/cli/args.d.ts.map +1 -1
  11. package/dist/cli/args.js +14 -2
  12. package/dist/cli/args.js.map +1 -1
  13. package/dist/cli/config-selector.d.ts.map +1 -1
  14. package/dist/cli/config-selector.js.map +1 -1
  15. package/dist/cli/file-processor.d.ts.map +1 -1
  16. package/dist/cli/file-processor.js.map +1 -1
  17. package/dist/cli/initial-message.d.ts +1 -1
  18. package/dist/cli/initial-message.d.ts.map +1 -1
  19. package/dist/cli/initial-message.js.map +1 -1
  20. package/dist/cli/list-models.d.ts.map +1 -1
  21. package/dist/cli/list-models.js.map +1 -1
  22. package/dist/cli/session-picker.d.ts.map +1 -1
  23. package/dist/cli/session-picker.js.map +1 -1
  24. package/dist/cli-main.d.ts +3 -0
  25. package/dist/cli-main.d.ts.map +1 -0
  26. package/dist/cli-main.js +10 -0
  27. package/dist/cli-main.js.map +1 -0
  28. package/dist/cli.d.ts.map +1 -1
  29. package/dist/cli.js +46 -13
  30. package/dist/cli.js.map +1 -1
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js.map +1 -1
  33. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  34. package/dist/core/agent-session-runtime.js +0 -8
  35. package/dist/core/agent-session-runtime.js.map +1 -1
  36. package/dist/core/agent-session-services.d.ts.map +1 -1
  37. package/dist/core/agent-session-services.js.map +1 -1
  38. package/dist/core/agent-session.d.ts +32 -0
  39. package/dist/core/agent-session.d.ts.map +1 -1
  40. package/dist/core/agent-session.js +51 -79
  41. package/dist/core/agent-session.js.map +1 -1
  42. package/dist/core/auth-guidance.d.ts.map +1 -1
  43. package/dist/core/auth-guidance.js.map +1 -1
  44. package/dist/core/auth-storage.d.ts +4 -0
  45. package/dist/core/auth-storage.d.ts.map +1 -1
  46. package/dist/core/auth-storage.js +8 -11
  47. package/dist/core/auth-storage.js.map +1 -1
  48. package/dist/core/bash-executor.d.ts.map +1 -1
  49. package/dist/core/bash-executor.js.map +1 -1
  50. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  51. package/dist/core/compaction/branch-summarization.js.map +1 -1
  52. package/dist/core/compaction/compaction.d.ts.map +1 -1
  53. package/dist/core/compaction/compaction.js.map +1 -1
  54. package/dist/core/compaction/index.d.ts.map +1 -1
  55. package/dist/core/compaction/utils.d.ts.map +1 -1
  56. package/dist/core/compaction/utils.js.map +1 -1
  57. package/dist/core/defaults.d.ts.map +1 -1
  58. package/dist/core/diagnostics.d.ts.map +1 -1
  59. package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
  60. package/dist/core/dynamic-prompt/build.js.map +1 -1
  61. package/dist/core/dynamic-prompt/exploration.d.ts.map +1 -1
  62. package/dist/core/dynamic-prompt/exploration.js.map +1 -1
  63. package/dist/core/dynamic-prompt/identity.d.ts.map +1 -1
  64. package/dist/core/dynamic-prompt/identity.js.map +1 -1
  65. package/dist/core/dynamic-prompt/index.d.ts.map +1 -1
  66. package/dist/core/dynamic-prompt/intent-gate.d.ts.map +1 -1
  67. package/dist/core/dynamic-prompt/intent-gate.js.map +1 -1
  68. package/dist/core/dynamic-prompt/parallel-tools.d.ts.map +1 -1
  69. package/dist/core/dynamic-prompt/parallel-tools.js.map +1 -1
  70. package/dist/core/dynamic-prompt/policies.d.ts.map +1 -1
  71. package/dist/core/dynamic-prompt/policies.js.map +1 -1
  72. package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
  73. package/dist/core/dynamic-prompt/style.js.map +1 -1
  74. package/dist/core/dynamic-prompt/tool-categorization.d.ts.map +1 -1
  75. package/dist/core/dynamic-prompt/tool-categorization.js.map +1 -1
  76. package/dist/core/dynamic-prompt/tool-section.d.ts.map +1 -1
  77. package/dist/core/dynamic-prompt/tool-section.js.map +1 -1
  78. package/dist/core/dynamic-prompt/types.d.ts.map +1 -1
  79. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  80. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  81. package/dist/core/event-bus.d.ts.map +1 -1
  82. package/dist/core/event-bus.js.map +1 -1
  83. package/dist/core/exec.d.ts.map +1 -1
  84. package/dist/core/exec.js.map +1 -1
  85. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  86. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  87. package/dist/core/export-html/index.d.ts.map +1 -1
  88. package/dist/core/export-html/index.js.map +1 -1
  89. package/dist/core/export-html/template.js +19 -6
  90. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  91. package/dist/core/export-html/tool-renderer.js.map +1 -1
  92. package/dist/core/extensions/builtin/anthropic-bash/index.d.ts.map +1 -1
  93. package/dist/core/extensions/builtin/anthropic-bash/index.js.map +1 -1
  94. package/dist/core/extensions/builtin/anthropic-web-search/index.d.ts.map +1 -1
  95. package/dist/core/extensions/builtin/anthropic-web-search/index.js.map +1 -1
  96. package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
  97. package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
  98. package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
  99. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  100. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
  101. package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
  102. package/dist/core/extensions/builtin/compaction/circuit-breaker.d.ts.map +1 -1
  103. package/dist/core/extensions/builtin/compaction/circuit-breaker.js.map +1 -1
  104. package/dist/core/extensions/builtin/compaction/context-reduction.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/compaction/context-reduction.js +1 -1
  106. package/dist/core/extensions/builtin/compaction/context-reduction.js.map +1 -1
  107. package/dist/core/extensions/builtin/compaction/degradation-monitor.d.ts.map +1 -1
  108. package/dist/core/extensions/builtin/compaction/degradation-monitor.js.map +1 -1
  109. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  110. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  111. package/dist/core/extensions/builtin/compaction/openai-remote.d.ts.map +1 -1
  112. package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
  113. package/dist/core/extensions/builtin/compaction/overflow-detection.d.ts.map +1 -1
  114. package/dist/core/extensions/builtin/compaction/overflow-detection.js.map +1 -1
  115. package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
  116. package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
  117. package/dist/core/extensions/builtin/compaction/policy.d.ts.map +1 -1
  118. package/dist/core/extensions/builtin/compaction/policy.js.map +1 -1
  119. package/dist/core/extensions/builtin/compaction/prompts.d.ts.map +1 -1
  120. package/dist/core/extensions/builtin/compaction/prompts.js.map +1 -1
  121. package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts.map +1 -1
  122. package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js.map +1 -1
  123. package/dist/core/extensions/builtin/compaction/restoration-tracker.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/compaction/restoration-tracker.js.map +1 -1
  125. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  126. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  127. package/dist/core/extensions/builtin/compaction/state.d.ts.map +1 -1
  128. package/dist/core/extensions/builtin/compaction/state.js.map +1 -1
  129. package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
  130. package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
  131. package/dist/core/extensions/builtin/compaction/tool-truncation.d.ts.map +1 -1
  132. package/dist/core/extensions/builtin/compaction/tool-truncation.js.map +1 -1
  133. package/dist/core/extensions/builtin/diff.d.ts.map +1 -1
  134. package/dist/core/extensions/builtin/diff.js.map +1 -1
  135. package/dist/core/extensions/builtin/files.d.ts.map +1 -1
  136. package/dist/core/extensions/builtin/files.js.map +1 -1
  137. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  138. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  139. package/dist/core/extensions/builtin/gpt-apply-patch/constants.d.ts.map +1 -1
  140. package/dist/core/extensions/builtin/gpt-apply-patch/constants.js.map +1 -1
  141. package/dist/core/extensions/builtin/gpt-apply-patch/errors.d.ts.map +1 -1
  142. package/dist/core/extensions/builtin/gpt-apply-patch/errors.js +0 -2
  143. package/dist/core/extensions/builtin/gpt-apply-patch/errors.js.map +1 -1
  144. package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
  145. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
  146. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  147. package/dist/core/extensions/builtin/gpt-apply-patch/params.d.ts.map +1 -1
  148. package/dist/core/extensions/builtin/gpt-apply-patch/params.js.map +1 -1
  149. package/dist/core/extensions/builtin/gpt-apply-patch/parser.d.ts.map +1 -1
  150. package/dist/core/extensions/builtin/gpt-apply-patch/parser.js.map +1 -1
  151. package/dist/core/extensions/builtin/gpt-apply-patch/patch-diff.d.ts.map +1 -1
  152. package/dist/core/extensions/builtin/gpt-apply-patch/patch-diff.js.map +1 -1
  153. package/dist/core/extensions/builtin/gpt-apply-patch/patch-replace.d.ts.map +1 -1
  154. package/dist/core/extensions/builtin/gpt-apply-patch/patch-replace.js.map +1 -1
  155. package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.d.ts.map +1 -1
  156. package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.js.map +1 -1
  157. package/dist/core/extensions/builtin/gpt-apply-patch/preview.d.ts.map +1 -1
  158. package/dist/core/extensions/builtin/gpt-apply-patch/preview.js.map +1 -1
  159. package/dist/core/extensions/builtin/gpt-apply-patch/seek-sequence.d.ts.map +1 -1
  160. package/dist/core/extensions/builtin/gpt-apply-patch/seek-sequence.js.map +1 -1
  161. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.d.ts.map +1 -1
  162. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.js +7 -5
  163. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.js.map +1 -1
  164. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-render.d.ts.map +1 -1
  165. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-render.js.map +1 -1
  166. package/dist/core/extensions/builtin/gpt-apply-patch/text.d.ts.map +1 -1
  167. package/dist/core/extensions/builtin/gpt-apply-patch/text.js.map +1 -1
  168. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  169. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  170. package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts.map +1 -1
  171. package/dist/core/extensions/builtin/gpt-apply-patch/workspace.d.ts.map +1 -1
  172. package/dist/core/extensions/builtin/gpt-apply-patch/workspace.js.map +1 -1
  173. package/dist/core/extensions/builtin/history-search/filter.d.ts.map +1 -1
  174. package/dist/core/extensions/builtin/history-search/filter.js.map +1 -1
  175. package/dist/core/extensions/builtin/history-search/index.d.ts.map +1 -1
  176. package/dist/core/extensions/builtin/history-search/index.js.map +1 -1
  177. package/dist/core/extensions/builtin/history-search/indexer.d.ts.map +1 -1
  178. package/dist/core/extensions/builtin/history-search/indexer.js.map +1 -1
  179. package/dist/core/extensions/builtin/history-search/overlay.d.ts.map +1 -1
  180. package/dist/core/extensions/builtin/history-search/overlay.js +3 -6
  181. package/dist/core/extensions/builtin/history-search/overlay.js.map +1 -1
  182. package/dist/core/extensions/builtin/history-search/types.d.ts.map +1 -1
  183. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  184. package/dist/core/extensions/builtin/kimi-web-search/index.d.ts.map +1 -1
  185. package/dist/core/extensions/builtin/kimi-web-search/index.js.map +1 -1
  186. package/dist/core/extensions/builtin/openai-web-search/index.d.ts.map +1 -1
  187. package/dist/core/extensions/builtin/openai-web-search/index.js.map +1 -1
  188. package/dist/core/extensions/builtin/permission-system/arity.d.ts.map +1 -1
  189. package/dist/core/extensions/builtin/permission-system/arity.js.map +1 -1
  190. package/dist/core/extensions/builtin/permission-system/cli.d.ts.map +1 -1
  191. package/dist/core/extensions/builtin/permission-system/cli.js.map +1 -1
  192. package/dist/core/extensions/builtin/permission-system/config.d.ts.map +1 -1
  193. package/dist/core/extensions/builtin/permission-system/config.js.map +1 -1
  194. package/dist/core/extensions/builtin/permission-system/evaluate.d.ts.map +1 -1
  195. package/dist/core/extensions/builtin/permission-system/evaluate.js.map +1 -1
  196. package/dist/core/extensions/builtin/permission-system/events.d.ts.map +1 -1
  197. package/dist/core/extensions/builtin/permission-system/events.js.map +1 -1
  198. package/dist/core/extensions/builtin/permission-system/external-dir.d.ts.map +1 -1
  199. package/dist/core/extensions/builtin/permission-system/external-dir.js.map +1 -1
  200. package/dist/core/extensions/builtin/permission-system/index.d.ts.map +1 -1
  201. package/dist/core/extensions/builtin/permission-system/index.js.map +1 -1
  202. package/dist/core/extensions/builtin/permission-system/non-interactive.d.ts.map +1 -1
  203. package/dist/core/extensions/builtin/permission-system/non-interactive.js.map +1 -1
  204. package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
  205. package/dist/core/extensions/builtin/permission-system/parsers.js +3 -1
  206. package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
  207. package/dist/core/extensions/builtin/permission-system/prompt.d.ts.map +1 -1
  208. package/dist/core/extensions/builtin/permission-system/prompt.js.map +1 -1
  209. package/dist/core/extensions/builtin/permission-system/service.d.ts.map +1 -1
  210. package/dist/core/extensions/builtin/permission-system/service.js +2 -5
  211. package/dist/core/extensions/builtin/permission-system/service.js.map +1 -1
  212. package/dist/core/extensions/builtin/permission-system/settings.d.ts.map +1 -1
  213. package/dist/core/extensions/builtin/permission-system/settings.js.map +1 -1
  214. package/dist/core/extensions/builtin/permission-system/storage.d.ts.map +1 -1
  215. package/dist/core/extensions/builtin/permission-system/storage.js.map +1 -1
  216. package/dist/core/extensions/builtin/permission-system/types.d.ts.map +1 -1
  217. package/dist/core/extensions/builtin/permission-system/types.js +3 -5
  218. package/dist/core/extensions/builtin/permission-system/types.js.map +1 -1
  219. package/dist/core/extensions/builtin/permission-system/wildcard.d.ts.map +1 -1
  220. package/dist/core/extensions/builtin/permission-system/wildcard.js.map +1 -1
  221. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
  222. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
  223. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
  224. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
  225. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
  226. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
  227. package/dist/core/extensions/builtin/prompt-preset/file-operations.d.ts.map +1 -1
  228. package/dist/core/extensions/builtin/prompt-preset/file-operations.js.map +1 -1
  229. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.d.ts.map +1 -1
  230. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js.map +1 -1
  231. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.d.ts.map +1 -1
  232. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js.map +1 -1
  233. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.d.ts.map +1 -1
  234. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js.map +1 -1
  235. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.d.ts.map +1 -1
  236. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
  237. package/dist/core/extensions/builtin/prompt-preset/gpt-5.d.ts.map +1 -1
  238. package/dist/core/extensions/builtin/prompt-preset/gpt-5.js.map +1 -1
  239. package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
  240. package/dist/core/extensions/builtin/prompt-preset/index.js.map +1 -1
  241. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
  242. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
  243. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  244. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  245. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  246. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  247. package/dist/core/extensions/builtin/prompt-url-widget.d.ts.map +1 -1
  248. package/dist/core/extensions/builtin/prompt-url-widget.js.map +1 -1
  249. package/dist/core/extensions/builtin/redraws.d.ts.map +1 -1
  250. package/dist/core/extensions/builtin/redraws.js.map +1 -1
  251. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  252. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  253. package/dist/core/extensions/builtin/session-observer/index.d.ts.map +1 -1
  254. package/dist/core/extensions/builtin/session-observer/index.js.map +1 -1
  255. package/dist/core/extensions/builtin/session-observer/loader.d.ts.map +1 -1
  256. package/dist/core/extensions/builtin/session-observer/loader.js.map +1 -1
  257. package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts.map +1 -1
  258. package/dist/core/extensions/builtin/session-observer/overlay-format.js.map +1 -1
  259. package/dist/core/extensions/builtin/session-observer/overlay.d.ts.map +1 -1
  260. package/dist/core/extensions/builtin/session-observer/overlay.js +13 -18
  261. package/dist/core/extensions/builtin/session-observer/overlay.js.map +1 -1
  262. package/dist/core/extensions/builtin/session-observer/scanner.d.ts.map +1 -1
  263. package/dist/core/extensions/builtin/session-observer/scanner.js.map +1 -1
  264. package/dist/core/extensions/builtin/session-observer/text.d.ts.map +1 -1
  265. package/dist/core/extensions/builtin/session-observer/text.js.map +1 -1
  266. package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts.map +1 -1
  267. package/dist/core/extensions/builtin/session-observer/transcript-entries.js.map +1 -1
  268. package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts.map +1 -1
  269. package/dist/core/extensions/builtin/session-observer/transcript-format.js.map +1 -1
  270. package/dist/core/extensions/builtin/session-observer/transcript.d.ts.map +1 -1
  271. package/dist/core/extensions/builtin/session-observer/transcript.js.map +1 -1
  272. package/dist/core/extensions/builtin/session-observer/types.d.ts.map +1 -1
  273. package/dist/core/extensions/builtin/system-messages.d.ts.map +1 -1
  274. package/dist/core/extensions/builtin/system-messages.js.map +1 -1
  275. package/dist/core/extensions/builtin/todotools/continuation/config.d.ts +1 -1
  276. package/dist/core/extensions/builtin/todotools/continuation/config.d.ts.map +1 -1
  277. package/dist/core/extensions/builtin/todotools/continuation/config.js.map +1 -1
  278. package/dist/core/extensions/builtin/todotools/continuation/index.d.ts.map +1 -1
  279. package/dist/core/extensions/builtin/todotools/continuation/prompt.d.ts.map +1 -1
  280. package/dist/core/extensions/builtin/todotools/continuation/prompt.js.map +1 -1
  281. package/dist/core/extensions/builtin/todotools/continuation/runtime.d.ts.map +1 -1
  282. package/dist/core/extensions/builtin/todotools/continuation/runtime.js.map +1 -1
  283. package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
  284. package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
  285. package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
  286. package/dist/core/extensions/builtin/todotools/settings.d.ts.map +1 -1
  287. package/dist/core/extensions/builtin/todotools/settings.js.map +1 -1
  288. package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
  289. package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
  290. package/dist/core/extensions/builtin/todotools/system-messages.d.ts.map +1 -1
  291. package/dist/core/extensions/builtin/todotools/system-messages.js.map +1 -1
  292. package/dist/core/extensions/builtin/todotools/tools/todoread.d.ts.map +1 -1
  293. package/dist/core/extensions/builtin/todotools/tools/todoread.js.map +1 -1
  294. package/dist/core/extensions/builtin/todotools/tools/todowrite.d.ts.map +1 -1
  295. package/dist/core/extensions/builtin/todotools/tools/todowrite.js.map +1 -1
  296. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  297. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  298. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +1 -1
  299. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +1 -1
  300. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-chat-completions-payload.d.ts.map +1 -1
  301. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-chat-completions-payload.js.map +1 -1
  302. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-responses-payload.d.ts.map +1 -1
  303. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-responses-payload.js.map +1 -1
  304. package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
  305. package/dist/core/extensions/builtin/tps.js.map +1 -1
  306. package/dist/core/extensions/index.d.ts.map +1 -1
  307. package/dist/core/extensions/loader.d.ts.map +1 -1
  308. package/dist/core/extensions/loader.js.map +1 -1
  309. package/dist/core/extensions/runner.d.ts.map +1 -1
  310. package/dist/core/extensions/runner.js +35 -43
  311. package/dist/core/extensions/runner.js.map +1 -1
  312. package/dist/core/extensions/types.d.ts +1 -1
  313. package/dist/core/extensions/types.d.ts.map +1 -1
  314. package/dist/core/extensions/types.js.map +1 -1
  315. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  316. package/dist/core/extensions/wrapper.js.map +1 -1
  317. package/dist/core/footer-data-provider.d.ts.map +1 -1
  318. package/dist/core/footer-data-provider.js +17 -18
  319. package/dist/core/footer-data-provider.js.map +1 -1
  320. package/dist/core/http-dispatcher.d.ts.map +1 -1
  321. package/dist/core/http-dispatcher.js.map +1 -1
  322. package/dist/core/index.d.ts.map +1 -1
  323. package/dist/core/keybindings.d.ts +1 -1
  324. package/dist/core/keybindings.d.ts.map +1 -1
  325. package/dist/core/keybindings.js +0 -1
  326. package/dist/core/keybindings.js.map +1 -1
  327. package/dist/core/messages.d.ts.map +1 -1
  328. package/dist/core/messages.js.map +1 -1
  329. package/dist/core/model-registry.d.ts.map +1 -1
  330. package/dist/core/model-registry.js +8 -10
  331. package/dist/core/model-registry.js.map +1 -1
  332. package/dist/core/model-resolver.d.ts.map +1 -1
  333. package/dist/core/model-resolver.js +2 -0
  334. package/dist/core/model-resolver.js.map +1 -1
  335. package/dist/core/output-guard.d.ts.map +1 -1
  336. package/dist/core/output-guard.js.map +1 -1
  337. package/dist/core/package-manager.d.ts +3 -0
  338. package/dist/core/package-manager.d.ts.map +1 -1
  339. package/dist/core/package-manager.js +47 -19
  340. package/dist/core/package-manager.js.map +1 -1
  341. package/dist/core/prompt-templates.d.ts.map +1 -1
  342. package/dist/core/prompt-templates.js.map +1 -1
  343. package/dist/core/provider-attribution.d.ts.map +1 -1
  344. package/dist/core/provider-attribution.js.map +1 -1
  345. package/dist/core/provider-display-names.d.ts.map +1 -1
  346. package/dist/core/provider-display-names.js +2 -0
  347. package/dist/core/provider-display-names.js.map +1 -1
  348. package/dist/core/resolve-config-value.d.ts.map +1 -1
  349. package/dist/core/resolve-config-value.js.map +1 -1
  350. package/dist/core/resource-loader.d.ts +1 -0
  351. package/dist/core/resource-loader.d.ts.map +1 -1
  352. package/dist/core/resource-loader.js +26 -53
  353. package/dist/core/resource-loader.js.map +1 -1
  354. package/dist/core/sdk.d.ts.map +1 -1
  355. package/dist/core/sdk.js.map +1 -1
  356. package/dist/core/session-cwd.d.ts.map +1 -1
  357. package/dist/core/session-cwd.js +0 -1
  358. package/dist/core/session-cwd.js.map +1 -1
  359. package/dist/core/session-manager.d.ts.map +1 -1
  360. package/dist/core/session-manager.js +7 -11
  361. package/dist/core/session-manager.js.map +1 -1
  362. package/dist/core/session-work-barrier.d.ts.map +1 -1
  363. package/dist/core/session-work-barrier.js +5 -3
  364. package/dist/core/session-work-barrier.js.map +1 -1
  365. package/dist/core/settings-manager.d.ts +10 -2
  366. package/dist/core/settings-manager.d.ts.map +1 -1
  367. package/dist/core/settings-manager.js +77 -46
  368. package/dist/core/settings-manager.js.map +1 -1
  369. package/dist/core/skills.d.ts.map +1 -1
  370. package/dist/core/skills.js.map +1 -1
  371. package/dist/core/slash-commands.d.ts.map +1 -1
  372. package/dist/core/slash-commands.js +1 -0
  373. package/dist/core/slash-commands.js.map +1 -1
  374. package/dist/core/source-info.d.ts.map +1 -1
  375. package/dist/core/source-info.js.map +1 -1
  376. package/dist/core/system-prompt.d.ts.map +1 -1
  377. package/dist/core/system-prompt.js.map +1 -1
  378. package/dist/core/telemetry.d.ts.map +1 -1
  379. package/dist/core/telemetry.js.map +1 -1
  380. package/dist/core/thinking-levels.d.ts.map +1 -1
  381. package/dist/core/thinking-levels.js.map +1 -1
  382. package/dist/core/timings.d.ts.map +1 -1
  383. package/dist/core/timings.js.map +1 -1
  384. package/dist/core/tools/bash.d.ts.map +1 -1
  385. package/dist/core/tools/bash.js +9 -6
  386. package/dist/core/tools/bash.js.map +1 -1
  387. package/dist/core/tools/diff-render.d.ts.map +1 -1
  388. package/dist/core/tools/diff-render.js.map +1 -1
  389. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  390. package/dist/core/tools/edit-diff.js.map +1 -1
  391. package/dist/core/tools/edit.d.ts.map +1 -1
  392. package/dist/core/tools/edit.js.map +1 -1
  393. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  394. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  395. package/dist/core/tools/find.d.ts.map +1 -1
  396. package/dist/core/tools/find.js +1 -1
  397. package/dist/core/tools/find.js.map +1 -1
  398. package/dist/core/tools/grep.d.ts.map +1 -1
  399. package/dist/core/tools/grep.js +1 -1
  400. package/dist/core/tools/grep.js.map +1 -1
  401. package/dist/core/tools/index.d.ts.map +1 -1
  402. package/dist/core/tools/index.js.map +1 -1
  403. package/dist/core/tools/ls.d.ts.map +1 -1
  404. package/dist/core/tools/ls.js +1 -1
  405. package/dist/core/tools/ls.js.map +1 -1
  406. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  407. package/dist/core/tools/output-accumulator.js +12 -18
  408. package/dist/core/tools/output-accumulator.js.map +1 -1
  409. package/dist/core/tools/path-utils.d.ts.map +1 -1
  410. package/dist/core/tools/path-utils.js.map +1 -1
  411. package/dist/core/tools/read.d.ts.map +1 -1
  412. package/dist/core/tools/read.js +1 -1
  413. package/dist/core/tools/read.js.map +1 -1
  414. package/dist/core/tools/render-utils.d.ts.map +1 -1
  415. package/dist/core/tools/render-utils.js.map +1 -1
  416. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  417. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  418. package/dist/core/tools/truncate.d.ts.map +1 -1
  419. package/dist/core/tools/truncate.js.map +1 -1
  420. package/dist/core/tools/write.d.ts.map +1 -1
  421. package/dist/core/tools/write.js +1 -2
  422. package/dist/core/tools/write.js.map +1 -1
  423. package/dist/core/trust-manager.d.ts +9 -0
  424. package/dist/core/trust-manager.d.ts.map +1 -0
  425. package/dist/core/trust-manager.js +133 -0
  426. package/dist/core/trust-manager.js.map +1 -0
  427. package/dist/index.d.ts +2 -1
  428. package/dist/index.d.ts.map +1 -1
  429. package/dist/index.js +1 -0
  430. package/dist/index.js.map +1 -1
  431. package/dist/main.d.ts.map +1 -1
  432. package/dist/main.js +54 -2
  433. package/dist/main.js.map +1 -1
  434. package/dist/migrations.d.ts.map +1 -1
  435. package/dist/migrations.js.map +1 -1
  436. package/dist/modes/index.d.ts.map +1 -1
  437. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  438. package/dist/modes/interactive/components/armin.js +6 -10
  439. package/dist/modes/interactive/components/armin.js.map +1 -1
  440. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  441. package/dist/modes/interactive/components/assistant-message.js +2 -11
  442. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  443. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  444. package/dist/modes/interactive/components/bash-execution.js +6 -11
  445. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  446. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  447. package/dist/modes/interactive/components/bordered-loader.js +0 -3
  448. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  449. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  450. package/dist/modes/interactive/components/branch-summary-message.js +1 -3
  451. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  452. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  453. package/dist/modes/interactive/components/compaction-summary-message.js +1 -3
  454. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  455. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  456. package/dist/modes/interactive/components/config-selector.js +5 -15
  457. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  458. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  459. package/dist/modes/interactive/components/countdown-timer.js +0 -5
  460. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  461. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  462. package/dist/modes/interactive/components/custom-editor.js +1 -8
  463. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  464. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  465. package/dist/modes/interactive/components/custom-message.js +1 -6
  466. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  467. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  468. package/dist/modes/interactive/components/daxnuts.js +6 -8
  469. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  470. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  471. package/dist/modes/interactive/components/diff.js +2 -2
  472. package/dist/modes/interactive/components/diff.js.map +1 -1
  473. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  474. package/dist/modes/interactive/components/dynamic-border.js +0 -1
  475. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  476. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  478. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  479. package/dist/modes/interactive/components/extension-editor.js +1 -6
  480. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  481. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  482. package/dist/modes/interactive/components/extension-input.js +2 -8
  483. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  484. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  485. package/dist/modes/interactive/components/extension-selector.js +1 -9
  486. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  487. package/dist/modes/interactive/components/favorite-models-selector.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/favorite-models-selector.js +9 -15
  489. package/dist/modes/interactive/components/favorite-models-selector.js.map +1 -1
  490. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/footer.js +10 -3
  492. package/dist/modes/interactive/components/footer.js.map +1 -1
  493. package/dist/modes/interactive/components/index.d.ts +1 -0
  494. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  495. package/dist/modes/interactive/components/index.js +1 -0
  496. package/dist/modes/interactive/components/index.js.map +1 -1
  497. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  499. package/dist/modes/interactive/components/login-dialog.d.ts +0 -1
  500. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  501. package/dist/modes/interactive/components/login-dialog.js +6 -21
  502. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  503. package/dist/modes/interactive/components/model-favorites.d.ts.map +1 -1
  504. package/dist/modes/interactive/components/model-favorites.js.map +1 -1
  505. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  506. package/dist/modes/interactive/components/model-selector.js +9 -22
  507. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  508. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  509. package/dist/modes/interactive/components/oauth-selector.js +3 -12
  510. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  511. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  512. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  513. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  514. package/dist/modes/interactive/components/session-selector.js +33 -58
  515. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  516. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  517. package/dist/modes/interactive/components/settings-selector.js +0 -4
  518. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  519. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/show-images-selector.js +0 -1
  521. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  522. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/skill-invocation-message.js +1 -3
  524. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  525. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/theme-selector.js +0 -2
  527. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  528. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  529. package/dist/modes/interactive/components/thinking-selector.js +0 -1
  530. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  531. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  532. package/dist/modes/interactive/components/tool-execution.js +9 -28
  533. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  534. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  535. package/dist/modes/interactive/components/tree-selector.js +18 -32
  536. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  537. package/dist/modes/interactive/components/trust-selector.d.ts +20 -0
  538. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  539. package/dist/modes/interactive/components/trust-selector.js +81 -0
  540. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  541. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  542. package/dist/modes/interactive/components/user-message-selector.js +3 -6
  543. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  544. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/user-message.js +0 -1
  546. package/dist/modes/interactive/components/user-message.js.map +1 -1
  547. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  548. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  549. package/dist/modes/interactive/interactive-mode.d.ts +24 -0
  550. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  551. package/dist/modes/interactive/interactive-mode.js +112 -101
  552. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  553. package/dist/modes/interactive/session-info-format.d.ts.map +1 -1
  554. package/dist/modes/interactive/session-info-format.js.map +1 -1
  555. package/dist/modes/interactive/startup-tools.d.ts.map +1 -1
  556. package/dist/modes/interactive/startup-tools.js.map +1 -1
  557. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  558. package/dist/modes/interactive/theme/theme.js +0 -6
  559. package/dist/modes/interactive/theme/theme.js.map +1 -1
  560. package/dist/modes/interactive/working-status.d.ts.map +1 -1
  561. package/dist/modes/interactive/working-status.js.map +1 -1
  562. package/dist/modes/print-mode.d.ts.map +1 -1
  563. package/dist/modes/print-mode.js.map +1 -1
  564. package/dist/modes/provider-native-rendering.d.ts.map +1 -1
  565. package/dist/modes/provider-native-rendering.js.map +1 -1
  566. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  567. package/dist/modes/rpc/jsonl.js.map +1 -1
  568. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  569. package/dist/modes/rpc/rpc-client.js +7 -8
  570. package/dist/modes/rpc/rpc-client.js.map +1 -1
  571. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  572. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  573. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  574. package/dist/package-manager-cli.d.ts.map +1 -1
  575. package/dist/package-manager-cli.js +56 -9
  576. package/dist/package-manager-cli.js.map +1 -1
  577. package/dist/self-update-bootstrap.d.ts +19 -0
  578. package/dist/self-update-bootstrap.d.ts.map +1 -0
  579. package/dist/self-update-bootstrap.js +160 -0
  580. package/dist/self-update-bootstrap.js.map +1 -0
  581. package/dist/senpi +46 -13
  582. package/dist/utils/ansi.d.ts.map +1 -1
  583. package/dist/utils/ansi.js.map +1 -1
  584. package/dist/utils/changelog.d.ts.map +1 -1
  585. package/dist/utils/changelog.js.map +1 -1
  586. package/dist/utils/child-process.d.ts.map +1 -1
  587. package/dist/utils/child-process.js.map +1 -1
  588. package/dist/utils/clipboard-image.d.ts.map +1 -1
  589. package/dist/utils/clipboard-image.js.map +1 -1
  590. package/dist/utils/clipboard-native.d.ts.map +1 -1
  591. package/dist/utils/clipboard-native.js.map +1 -1
  592. package/dist/utils/clipboard.d.ts.map +1 -1
  593. package/dist/utils/clipboard.js.map +1 -1
  594. package/dist/utils/deprecation.d.ts.map +1 -1
  595. package/dist/utils/deprecation.js.map +1 -1
  596. package/dist/utils/exif-orientation.d.ts.map +1 -1
  597. package/dist/utils/exif-orientation.js.map +1 -1
  598. package/dist/utils/frontmatter.d.ts.map +1 -1
  599. package/dist/utils/frontmatter.js.map +1 -1
  600. package/dist/utils/fs-watch.d.ts.map +1 -1
  601. package/dist/utils/fs-watch.js.map +1 -1
  602. package/dist/utils/git.d.ts.map +1 -1
  603. package/dist/utils/git.js +54 -22
  604. package/dist/utils/git.js.map +1 -1
  605. package/dist/utils/html.d.ts.map +1 -1
  606. package/dist/utils/html.js.map +1 -1
  607. package/dist/utils/image-convert.d.ts.map +1 -1
  608. package/dist/utils/image-convert.js.map +1 -1
  609. package/dist/utils/image-resize-core.d.ts.map +1 -1
  610. package/dist/utils/image-resize-core.js.map +1 -1
  611. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  612. package/dist/utils/image-resize-worker.js.map +1 -1
  613. package/dist/utils/image-resize.d.ts.map +1 -1
  614. package/dist/utils/image-resize.js.map +1 -1
  615. package/dist/utils/json.d.ts.map +1 -1
  616. package/dist/utils/json.js.map +1 -1
  617. package/dist/utils/mime.d.ts.map +1 -1
  618. package/dist/utils/mime.js.map +1 -1
  619. package/dist/utils/open-browser.d.ts +9 -0
  620. package/dist/utils/open-browser.d.ts.map +1 -0
  621. package/dist/utils/open-browser.js +22 -0
  622. package/dist/utils/open-browser.js.map +1 -0
  623. package/dist/utils/paths.d.ts.map +1 -1
  624. package/dist/utils/paths.js.map +1 -1
  625. package/dist/utils/photon.d.ts.map +1 -1
  626. package/dist/utils/photon.js.map +1 -1
  627. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  628. package/dist/utils/pi-user-agent.js.map +1 -1
  629. package/dist/utils/shell.d.ts.map +1 -1
  630. package/dist/utils/shell.js.map +1 -1
  631. package/dist/utils/sleep.d.ts.map +1 -1
  632. package/dist/utils/sleep.js.map +1 -1
  633. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  634. package/dist/utils/syntax-highlight.js.map +1 -1
  635. package/dist/utils/tools-manager.d.ts.map +1 -1
  636. package/dist/utils/tools-manager.js.map +1 -1
  637. package/dist/utils/version-check.d.ts.map +1 -1
  638. package/dist/utils/version-check.js.map +1 -1
  639. package/dist/utils/windows-self-update.d.ts.map +1 -1
  640. package/dist/utils/windows-self-update.js.map +1 -1
  641. package/docs/containerization.md +111 -0
  642. package/docs/docs.json +4 -0
  643. package/docs/extensions.md +3 -1
  644. package/docs/index.md +1 -0
  645. package/docs/packages.md +3 -1
  646. package/docs/prompt-templates.md +1 -1
  647. package/docs/providers.md +3 -0
  648. package/docs/settings.md +10 -0
  649. package/docs/skills.md +3 -3
  650. package/docs/themes.md +1 -1
  651. package/docs/usage.md +15 -3
  652. package/examples/extensions/README.md +1 -0
  653. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  654. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  655. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  656. package/examples/extensions/gondolin/index.ts +531 -0
  657. package/examples/extensions/gondolin/package-lock.json +185 -0
  658. package/examples/extensions/gondolin/package.json +19 -0
  659. package/examples/extensions/minimal-mode.ts +6 -6
  660. package/examples/extensions/sandbox/package-lock.json +2 -2
  661. package/examples/extensions/sandbox/package.json +1 -1
  662. package/examples/extensions/with-deps/package-lock.json +2 -2
  663. package/examples/extensions/with-deps/package.json +1 -1
  664. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  665. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  666. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +7 -0
  667. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  668. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +2 -27
  669. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  670. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  671. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +7 -20
  672. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  673. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  674. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  675. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  676. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  677. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts.map +1 -1
  678. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js.map +1 -1
  679. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  680. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +0 -3
  681. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  682. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  683. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  684. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
  685. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  686. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -1
  687. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -3
  688. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +1 -1
  689. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -1
  690. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -7
  691. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +1 -1
  692. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -1
  693. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +3 -1
  694. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -1
  696. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -5
  697. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +1 -1
  698. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -1
  699. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +1 -1
  700. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  701. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +0 -1
  702. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  703. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts.map +1 -1
  704. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js.map +1 -1
  705. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  706. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  707. package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts.map +1 -1
  708. package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js.map +1 -1
  709. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  710. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +0 -16
  711. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  712. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
  713. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
  714. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
  715. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  716. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  717. package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts.map +1 -1
  718. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  719. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  720. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  721. package/node_modules/@earendil-works/pi-agent-core/package.json +6 -6
  722. package/node_modules/@earendil-works/pi-ai/README.md +5 -1
  723. package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +1 -1
  724. package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts.map +1 -1
  726. package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts.map +1 -1
  727. package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -1
  728. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  729. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +2 -0
  730. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  731. package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts.map +1 -1
  732. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +30 -0
  733. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  734. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
  735. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  736. package/node_modules/@earendil-works/pi-ai/dist/image-models.js.map +1 -1
  737. package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts.map +1 -1
  738. package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js.map +1 -1
  739. package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -1
  740. package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -1
  741. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  742. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  743. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +413 -65
  744. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  745. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +385 -97
  746. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  747. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  748. package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -1
  749. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  750. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  751. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  752. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  753. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  754. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  755. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts.map +1 -1
  756. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js.map +1 -1
  757. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  758. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  759. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -1
  760. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js.map +1 -1
  761. package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  762. package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -1
  763. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
  764. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
  765. package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -1
  766. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
  767. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -1
  768. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -1
  769. package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts.map +1 -1
  770. package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js.map +1 -1
  771. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -1
  772. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +3 -3
  773. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -1
  774. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  775. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +0 -7
  776. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  777. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  778. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +26 -9
  779. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  780. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -1
  781. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js.map +1 -1
  782. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
  783. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
  784. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  785. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
  786. package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  787. package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js.map +1 -1
  788. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  789. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
  790. package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
  791. package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js.map +1 -1
  792. package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts.map +1 -1
  793. package/node_modules/@earendil-works/pi-ai/dist/session-resources.js.map +1 -1
  794. package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -1
  795. package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -1
  796. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -1
  797. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
  798. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -1
  799. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -1
  800. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -1
  801. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +10 -8
  802. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -1
  803. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts.map +1 -1
  804. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js.map +1 -1
  805. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -1
  806. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -1
  807. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -1
  808. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -1
  809. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts.map +1 -1
  810. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js.map +1 -1
  811. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -1
  812. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -1
  813. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -1
  814. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
  815. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -1
  816. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +4 -4
  817. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  818. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.d.ts.map +1 -1
  820. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js.map +1 -1
  821. package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts.map +1 -1
  822. package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js.map +1 -1
  823. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  824. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +3 -7
  825. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  826. package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts.map +1 -1
  827. package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js.map +1 -1
  828. package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js.map +1 -1
  830. package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
  831. package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js.map +1 -1
  832. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -1
  834. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -1
  835. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +1 -1
  836. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
  837. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
  838. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  839. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +13 -1
  840. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  841. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
  842. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -1
  844. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +1 -1
  845. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  846. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +4 -2
  847. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  848. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -1
  849. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +1 -1
  850. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +1 -1
  851. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  852. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  853. package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -1
  854. package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -1
  856. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -1
  857. package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -1
  858. package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts.map +1 -1
  860. package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -1
  861. package/node_modules/@earendil-works/pi-ai/package.json +5 -5
  862. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -1
  863. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  864. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -3
  865. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  866. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  867. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +1 -6
  868. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  869. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -1
  870. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +4 -3
  871. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -1
  872. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  873. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +43 -54
  874. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  875. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  876. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -8
  877. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  878. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  879. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +14 -14
  880. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  881. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  882. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +11 -13
  883. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  884. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  885. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -11
  886. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  887. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  888. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +4 -9
  889. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  890. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  891. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +4 -12
  892. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  893. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -1
  894. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -1
  895. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -1
  896. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  897. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -8
  898. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  899. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -1
  900. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -3
  901. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -1
  902. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -1
  903. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
  904. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
  905. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  906. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  907. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -4
  908. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  909. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  910. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  911. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -1
  912. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +3 -1
  913. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -1
  914. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  915. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  916. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
  917. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
  918. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  919. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +4 -6
  920. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  921. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  922. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  923. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  924. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +24 -29
  925. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  926. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  927. package/node_modules/@earendil-works/pi-tui/dist/tui.js +25 -27
  928. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  929. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -1
  930. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +3 -1
  931. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -1
  932. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  933. package/node_modules/@earendil-works/pi-tui/dist/utils.js +14 -12
  934. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  935. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +1 -1
  936. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +1 -1
  937. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  938. package/node_modules/@types/node/README.md +3 -3
  939. package/node_modules/@types/node/assert/strict.d.ts +3 -55
  940. package/node_modules/@types/node/assert.d.ts +49 -177
  941. package/node_modules/@types/node/async_hooks.d.ts +151 -43
  942. package/node_modules/@types/node/buffer.buffer.d.ts +2 -8
  943. package/node_modules/@types/node/buffer.d.ts +43 -212
  944. package/node_modules/@types/node/child_process.d.ts +23 -133
  945. package/node_modules/@types/node/cluster.d.ts +238 -384
  946. package/node_modules/@types/node/compatibility/iterators.d.ts +1 -0
  947. package/node_modules/@types/node/console.d.ts +45 -404
  948. package/node_modules/@types/node/constants.d.ts +3 -10
  949. package/node_modules/@types/node/crypto.d.ts +640 -1127
  950. package/node_modules/@types/node/dgram.d.ts +14 -77
  951. package/node_modules/@types/node/diagnostics_channel.d.ts +3 -29
  952. package/node_modules/@types/node/dns/promises.d.ts +4 -10
  953. package/node_modules/@types/node/dns.d.ts +130 -177
  954. package/node_modules/@types/node/domain.d.ts +12 -32
  955. package/node_modules/@types/node/events.d.ts +872 -840
  956. package/node_modules/@types/node/fs/promises.d.ts +193 -20
  957. package/node_modules/@types/node/fs.d.ts +754 -435
  958. package/node_modules/@types/node/globals.d.ts +8 -30
  959. package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
  960. package/node_modules/@types/node/http.d.ts +363 -305
  961. package/node_modules/@types/node/http2.d.ts +545 -781
  962. package/node_modules/@types/node/https.d.ts +64 -243
  963. package/node_modules/@types/node/index.d.ts +26 -6
  964. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  965. package/node_modules/@types/node/inspector.d.ts +68 -57
  966. package/node_modules/@types/node/inspector.generated.d.ts +764 -410
  967. package/node_modules/@types/node/module.d.ts +53 -189
  968. package/node_modules/@types/node/net.d.ts +101 -207
  969. package/node_modules/@types/node/os.d.ts +11 -19
  970. package/node_modules/@types/node/package.json +13 -3
  971. package/node_modules/@types/node/path/posix.d.ts +8 -0
  972. package/node_modules/@types/node/path/win32.d.ts +8 -0
  973. package/node_modules/@types/node/path.d.ts +119 -141
  974. package/node_modules/@types/node/perf_hooks.d.ts +317 -673
  975. package/node_modules/@types/node/process.d.ts +277 -157
  976. package/node_modules/@types/node/punycode.d.ts +3 -31
  977. package/node_modules/@types/node/querystring.d.ts +3 -16
  978. package/node_modules/@types/node/quic.d.ts +897 -0
  979. package/node_modules/@types/node/readline/promises.d.ts +3 -6
  980. package/node_modules/@types/node/readline.d.ts +65 -152
  981. package/node_modules/@types/node/repl.d.ts +101 -109
  982. package/node_modules/@types/node/sea.d.ts +9 -115
  983. package/node_modules/@types/node/sqlite.d.ts +415 -68
  984. package/node_modules/@types/node/stream/consumers.d.ts +91 -15
  985. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  986. package/node_modules/@types/node/stream/promises.d.ts +136 -15
  987. package/node_modules/@types/node/stream/web.d.ts +179 -501
  988. package/node_modules/@types/node/stream.d.ts +577 -490
  989. package/node_modules/@types/node/string_decoder.d.ts +3 -43
  990. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  991. package/node_modules/@types/node/test.d.ts +402 -286
  992. package/node_modules/@types/node/timers/promises.d.ts +3 -18
  993. package/node_modules/@types/node/timers.d.ts +3 -141
  994. package/node_modules/@types/node/tls.d.ts +115 -241
  995. package/node_modules/@types/node/trace_events.d.ts +3 -97
  996. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -8
  997. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  998. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
  999. package/node_modules/@types/node/ts5.6/index.d.ts +28 -6
  1000. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  1001. package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  1002. package/node_modules/@types/node/tty.d.ts +57 -40
  1003. package/node_modules/@types/node/url.d.ts +156 -584
  1004. package/node_modules/@types/node/util/types.d.ts +558 -0
  1005. package/node_modules/@types/node/util.d.ts +167 -1096
  1006. package/node_modules/@types/node/v8.d.ts +75 -15
  1007. package/node_modules/@types/node/vm.d.ts +334 -198
  1008. package/node_modules/@types/node/wasi.d.ts +24 -74
  1009. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
  1010. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  1011. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  1012. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  1013. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  1014. package/node_modules/@types/node/web-globals/events.d.ts +9 -0
  1015. package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
  1016. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  1017. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  1018. package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
  1019. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  1020. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  1021. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  1022. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  1023. package/node_modules/@types/node/worker_threads.d.ts +280 -393
  1024. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  1025. package/node_modules/@types/node/zlib.d.ts +7 -165
  1026. package/node_modules/undici-types/agent.d.ts +13 -12
  1027. package/node_modules/undici-types/api.d.ts +26 -26
  1028. package/node_modules/undici-types/balanced-pool.d.ts +13 -12
  1029. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  1030. package/node_modules/undici-types/client-stats.d.ts +15 -0
  1031. package/node_modules/undici-types/client.d.ts +34 -19
  1032. package/node_modules/undici-types/connector.d.ts +4 -2
  1033. package/node_modules/undici-types/cookies.d.ts +2 -0
  1034. package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
  1035. package/node_modules/undici-types/dispatcher.d.ts +127 -104
  1036. package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
  1037. package/node_modules/undici-types/errors.d.ts +82 -54
  1038. package/node_modules/undici-types/eventsource.d.ts +9 -4
  1039. package/node_modules/undici-types/fetch.d.ts +22 -20
  1040. package/node_modules/undici-types/formdata.d.ts +7 -7
  1041. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  1042. package/node_modules/undici-types/global-origin.d.ts +5 -5
  1043. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  1044. package/node_modules/undici-types/handlers.d.ts +8 -8
  1045. package/node_modules/undici-types/header.d.ts +157 -1
  1046. package/node_modules/undici-types/index.d.ts +67 -47
  1047. package/node_modules/undici-types/interceptors.d.ts +71 -8
  1048. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  1049. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  1050. package/node_modules/undici-types/mock-client.d.ts +6 -4
  1051. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  1052. package/node_modules/undici-types/mock-interceptor.d.ts +21 -20
  1053. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  1054. package/node_modules/undici-types/package.json +1 -1
  1055. package/node_modules/undici-types/patch.d.ts +0 -4
  1056. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  1057. package/node_modules/undici-types/pool.d.ts +15 -13
  1058. package/node_modules/undici-types/proxy-agent.d.ts +5 -4
  1059. package/node_modules/undici-types/readable.d.ts +19 -16
  1060. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  1061. package/node_modules/undici-types/retry-handler.d.ts +19 -10
  1062. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  1063. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  1064. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  1065. package/node_modules/undici-types/util.d.ts +3 -3
  1066. package/node_modules/undici-types/utility.d.ts +7 -0
  1067. package/node_modules/undici-types/webidl.d.ts +148 -29
  1068. package/node_modules/undici-types/websocket.d.ts +48 -10
  1069. package/npm-shrinkwrap.json +21 -21
  1070. package/package.json +14 -8
  1071. package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  1072. package/node_modules/@types/node/compatibility/index.d.ts +0 -9
  1073. package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  1074. package/node_modules/undici-types/file.d.ts +0 -39
  1075. package/node_modules/undici-types/filereader.d.ts +0 -54
@@ -1,46 +1,28 @@
1
- /**
2
- * A stream is an abstract interface for working with streaming data in Node.js.
3
- * The `node:stream` module provides an API for implementing the stream interface.
4
- *
5
- * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v22.x/api/http.html#class-httpincomingmessage)
6
- * and [`process.stdout`](https://nodejs.org/docs/latest-v22.x/api/process.html#processstdout) are both stream instances.
7
- *
8
- * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v22.x/api/events.html#class-eventemitter).
9
- *
10
- * To access the `node:stream` module:
11
- *
12
- * ```js
13
- * import stream from 'node:stream';
14
- * ```
15
- *
16
- * The `node:stream` module is useful for creating new types of stream instances.
17
- * It is usually not necessary to use the `node:stream` module to consume streams.
18
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/stream.js)
19
- */
20
- declare module "stream" {
1
+ declare module "node:stream" {
2
+ import { Blob } from "node:buffer";
21
3
  import { Abortable, EventEmitter } from "node:events";
22
- import { Blob as NodeBlob } from "node:buffer";
23
- import * as streamPromises from "node:stream/promises";
24
- import * as streamWeb from "node:stream/web";
25
-
26
- type ComposeFnParam = (source: any) => void;
27
-
4
+ import * as promises from "node:stream/promises";
5
+ import * as web from "node:stream/web";
28
6
  class Stream extends EventEmitter {
7
+ /**
8
+ * @since v0.9.4
9
+ */
29
10
  pipe<T extends NodeJS.WritableStream>(
30
11
  destination: T,
31
- options?: {
32
- end?: boolean | undefined;
33
- },
34
- ): T;
35
- compose<T extends NodeJS.ReadableStream>(
36
- stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>,
37
- options?: { signal: AbortSignal },
12
+ options?: Stream.PipeOptions,
38
13
  ): T;
39
14
  }
40
15
  namespace Stream {
41
- export { Stream, streamPromises as promises };
16
+ export { promises, Stream };
42
17
  }
43
18
  namespace Stream {
19
+ interface PipeOptions {
20
+ /**
21
+ * End the writer when the reader ends.
22
+ * @default true
23
+ */
24
+ end?: boolean | undefined;
25
+ }
44
26
  interface StreamOptions<T extends Stream> extends Abortable {
45
27
  emitClose?: boolean | undefined;
46
28
  highWaterMark?: number | undefined;
@@ -53,19 +35,49 @@ declare module "stream" {
53
35
  encoding?: BufferEncoding | undefined;
54
36
  read?: ((this: T, size: number) => void) | undefined;
55
37
  }
56
- interface ArrayOptions {
38
+ interface ReadableIteratorOptions {
57
39
  /**
58
- * The maximum concurrent invocations of `fn` to call on the stream at once.
40
+ * When set to `false`, calling `return` on the async iterator,
41
+ * or exiting a `for await...of` iteration using a `break`,
42
+ * `return`, or `throw` will not destroy the stream.
43
+ * @default true
44
+ */
45
+ destroyOnReturn?: boolean | undefined;
46
+ }
47
+ interface ReadableOperatorOptions extends Abortable {
48
+ /**
49
+ * The maximum concurrent invocations of `fn` to call
50
+ * on the stream at once.
59
51
  * @default 1
60
52
  */
61
53
  concurrency?: number | undefined;
62
- /** Allows destroying the stream if the signal is aborted. */
63
- signal?: AbortSignal | undefined;
54
+ /**
55
+ * How many items to buffer while waiting for user consumption
56
+ * of the output.
57
+ * @default concurrency * 2 - 1
58
+ */
59
+ highWaterMark?: number | undefined;
60
+ }
61
+ /** @deprecated Use `ReadableOperatorOptions` instead. */
62
+ interface ArrayOptions extends ReadableOperatorOptions {}
63
+ interface ReadableToWebOptions {
64
+ strategy?: web.QueuingStrategy | undefined;
65
+ type?: web.ReadableStreamType | undefined;
66
+ }
67
+ interface ReadableEventMap {
68
+ "close": [];
69
+ "data": [chunk: any];
70
+ "end": [];
71
+ "error": [err: Error];
72
+ "pause": [];
73
+ "readable": [];
74
+ "resume": [];
64
75
  }
65
76
  /**
66
77
  * @since v0.9.4
67
78
  */
68
79
  class Readable extends Stream implements NodeJS.ReadableStream {
80
+ constructor(options?: ReadableOptions);
69
81
  /**
70
82
  * A utility method for creating Readable Streams out of iterators.
71
83
  * @since v12.3.0, v10.17.0
@@ -78,7 +90,7 @@ declare module "stream" {
78
90
  * @since v17.0.0
79
91
  */
80
92
  static fromWeb(
81
- readableStream: streamWeb.ReadableStream,
93
+ readableStream: web.ReadableStream,
82
94
  options?: Pick<ReadableOptions, "encoding" | "highWaterMark" | "objectMode" | "signal">,
83
95
  ): Readable;
84
96
  /**
@@ -86,16 +98,14 @@ declare module "stream" {
86
98
  * @since v17.0.0
87
99
  */
88
100
  static toWeb(
89
- streamReadable: Readable,
90
- options?: {
91
- strategy?: streamWeb.QueuingStrategy | undefined;
92
- },
93
- ): streamWeb.ReadableStream;
101
+ streamReadable: NodeJS.ReadableStream,
102
+ options?: ReadableToWebOptions,
103
+ ): web.ReadableStream;
94
104
  /**
95
105
  * Returns whether the stream has been read from or cancelled.
96
106
  * @since v16.8.0
97
107
  */
98
- static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
108
+ static isDisturbed(stream: NodeJS.ReadableStream | web.ReadableStream): boolean;
99
109
  /**
100
110
  * Returns whether the stream was destroyed or errored before emitting `'end'`.
101
111
  * @since v16.8.0
@@ -118,16 +128,16 @@ declare module "stream" {
118
128
  */
119
129
  readonly readableEncoding: BufferEncoding | null;
120
130
  /**
121
- * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v22.x/api/stream.html#event-end) event is emitted.
131
+ * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v25.x/api/stream.html#event-end) event is emitted.
122
132
  * @since v12.9.0
123
133
  */
124
134
  readonly readableEnded: boolean;
125
135
  /**
126
136
  * This property reflects the current state of a `Readable` stream as described
127
- * in the [Three states](https://nodejs.org/docs/latest-v22.x/api/stream.html#three-states) section.
137
+ * in the [Three states](https://nodejs.org/docs/latest-v25.x/api/stream.html#three-states) section.
128
138
  * @since v9.4.0
129
139
  */
130
- readonly readableFlowing: boolean | null;
140
+ readableFlowing: boolean | null;
131
141
  /**
132
142
  * Returns the value of `highWaterMark` passed when creating this `Readable`.
133
143
  * @since v9.3.0
@@ -160,7 +170,6 @@ declare module "stream" {
160
170
  * @since v18.0.0
161
171
  */
162
172
  readonly errored: Error | null;
163
- constructor(opts?: ReadableOptions);
164
173
  _construct?(callback: (error?: Error | null) => void): void;
165
174
  _read(size: number): void;
166
175
  /**
@@ -444,16 +453,46 @@ declare module "stream" {
444
453
  */
445
454
  wrap(stream: NodeJS.ReadableStream): this;
446
455
  push(chunk: any, encoding?: BufferEncoding): boolean;
456
+ /**
457
+ * ```js
458
+ * import { Readable } from 'node:stream';
459
+ *
460
+ * async function* splitToWords(source) {
461
+ * for await (const chunk of source) {
462
+ * const words = String(chunk).split(' ');
463
+ *
464
+ * for (const word of words) {
465
+ * yield word;
466
+ * }
467
+ * }
468
+ * }
469
+ *
470
+ * const wordsStream = Readable.from(['text passed through', 'composed stream']).compose(splitToWords);
471
+ * const words = await wordsStream.toArray();
472
+ *
473
+ * console.log(words); // prints ['text', 'passed', 'through', 'composed', 'stream']
474
+ * ```
475
+ *
476
+ * `readable.compose(s)` is equivalent to `stream.compose(readable, s)`.
477
+ *
478
+ * This method also allows for an `AbortSignal` to be provided, which will destroy
479
+ * the composed stream when aborted.
480
+ *
481
+ * See [`stream.compose(...streams)`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamcomposestreams) for more information.
482
+ * @since v19.1.0, v18.13.0
483
+ * @returns a stream composed with the stream `stream`.
484
+ */
485
+ compose(
486
+ stream: NodeJS.WritableStream | web.WritableStream | web.TransformStream | ((source: any) => void),
487
+ options?: Abortable,
488
+ ): Duplex;
447
489
  /**
448
490
  * The iterator created by this method gives users the option to cancel the destruction
449
491
  * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
450
492
  * or if the iterator should destroy the stream if the stream emitted an error during iteration.
451
493
  * @since v16.3.0
452
- * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
453
- * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
454
- * **Default: `true`**.
455
494
  */
456
- iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator<any>;
495
+ iterator(options?: ReadableIteratorOptions): NodeJS.AsyncIterator<any>;
457
496
  /**
458
497
  * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
459
498
  * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
@@ -461,7 +500,7 @@ declare module "stream" {
461
500
  * @param fn a function to map over every chunk in the stream. Async or not.
462
501
  * @returns a stream mapped with the function *fn*.
463
502
  */
464
- map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
503
+ map(fn: (data: any, options?: Abortable) => any, options?: ReadableOperatorOptions): Readable;
465
504
  /**
466
505
  * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
467
506
  * and if it returns a truthy value, the chunk will be passed to the result stream.
@@ -471,8 +510,8 @@ declare module "stream" {
471
510
  * @returns a stream filtered with the predicate *fn*.
472
511
  */
473
512
  filter(
474
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
475
- options?: ArrayOptions,
513
+ fn: (data: any, options?: Abortable) => boolean | Promise<boolean>,
514
+ options?: ReadableOperatorOptions,
476
515
  ): Readable;
477
516
  /**
478
517
  * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called.
@@ -490,8 +529,8 @@ declare module "stream" {
490
529
  * @returns a promise for when the stream has finished.
491
530
  */
492
531
  forEach(
493
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
494
- options?: ArrayOptions,
532
+ fn: (data: any, options?: Abortable) => void | Promise<void>,
533
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
495
534
  ): Promise<void>;
496
535
  /**
497
536
  * This method allows easily obtaining the contents of a stream.
@@ -501,7 +540,7 @@ declare module "stream" {
501
540
  * @since v17.5.0
502
541
  * @returns a promise containing an array with the contents of the stream.
503
542
  */
504
- toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
543
+ toArray(options?: Abortable): Promise<any[]>;
505
544
  /**
506
545
  * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream
507
546
  * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk
@@ -512,8 +551,8 @@ declare module "stream" {
512
551
  * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks.
513
552
  */
514
553
  some(
515
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
516
- options?: ArrayOptions,
554
+ fn: (data: any, options?: Abortable) => boolean | Promise<boolean>,
555
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
517
556
  ): Promise<boolean>;
518
557
  /**
519
558
  * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream
@@ -526,12 +565,12 @@ declare module "stream" {
526
565
  * or `undefined` if no element was found.
527
566
  */
528
567
  find<T>(
529
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => data is T,
530
- options?: ArrayOptions,
568
+ fn: (data: any, options?: Abortable) => data is T,
569
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
531
570
  ): Promise<T | undefined>;
532
571
  find(
533
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
534
- options?: ArrayOptions,
572
+ fn: (data: any, options?: Abortable) => boolean | Promise<boolean>,
573
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
535
574
  ): Promise<any>;
536
575
  /**
537
576
  * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream
@@ -543,8 +582,8 @@ declare module "stream" {
543
582
  * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks.
544
583
  */
545
584
  every(
546
- fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
547
- options?: ArrayOptions,
585
+ fn: (data: any, options?: Abortable) => boolean | Promise<boolean>,
586
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
548
587
  ): Promise<boolean>;
549
588
  /**
550
589
  * This method returns a new stream by applying the given callback to each chunk of the stream
@@ -556,28 +595,24 @@ declare module "stream" {
556
595
  * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator.
557
596
  * @returns a stream flat-mapped with the function *fn*.
558
597
  */
559
- flatMap(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
598
+ flatMap(
599
+ fn: (data: any, options?: Abortable) => any,
600
+ options?: Pick<ReadableOperatorOptions, "concurrency" | "signal">,
601
+ ): Readable;
560
602
  /**
561
603
  * This method returns a new stream with the first *limit* chunks dropped from the start.
562
604
  * @since v17.5.0
563
605
  * @param limit the number of chunks to drop from the readable.
564
606
  * @returns a stream with *limit* chunks dropped from the start.
565
607
  */
566
- drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
608
+ drop(limit: number, options?: Abortable): Readable;
567
609
  /**
568
610
  * This method returns a new stream with the first *limit* chunks.
569
611
  * @since v17.5.0
570
612
  * @param limit the number of chunks to take from the readable.
571
613
  * @returns a stream with *limit* chunks taken.
572
614
  */
573
- take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
574
- /**
575
- * This method returns a new stream with chunks of the underlying stream paired with a counter
576
- * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced.
577
- * @since v17.5.0
578
- * @returns a stream of indexed pairs.
579
- */
580
- asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
615
+ take(limit: number, options?: Abortable): Readable;
581
616
  /**
582
617
  * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation
583
618
  * on the previous element. It returns a promise for the final value of the reduction.
@@ -592,15 +627,11 @@ declare module "stream" {
592
627
  * @param initial the initial value to use in the reduction.
593
628
  * @returns a promise for the final value of the reduction.
594
629
  */
595
- reduce<T = any>(
596
- fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
597
- initial?: undefined,
598
- options?: Pick<ArrayOptions, "signal">,
599
- ): Promise<T>;
600
- reduce<T = any>(
601
- fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
630
+ reduce<T>(fn: (previous: any, data: any, options?: Abortable) => T): Promise<T>;
631
+ reduce<T>(
632
+ fn: (previous: T, data: any, options?: Abortable) => T,
602
633
  initial: T,
603
- options?: Pick<ArrayOptions, "signal">,
634
+ options?: Abortable,
604
635
  ): Promise<T>;
605
636
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
606
637
  /**
@@ -616,78 +647,61 @@ declare module "stream" {
616
647
  */
617
648
  destroy(error?: Error): this;
618
649
  /**
619
- * Event emitter
620
- * The defined events on documents including:
621
- * 1. close
622
- * 2. data
623
- * 3. end
624
- * 4. error
625
- * 5. pause
626
- * 6. readable
627
- * 7. resume
628
- */
629
- addListener(event: "close", listener: () => void): this;
630
- addListener(event: "data", listener: (chunk: any) => void): this;
631
- addListener(event: "end", listener: () => void): this;
632
- addListener(event: "error", listener: (err: Error) => void): this;
633
- addListener(event: "pause", listener: () => void): this;
634
- addListener(event: "readable", listener: () => void): this;
635
- addListener(event: "resume", listener: () => void): this;
636
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
637
- emit(event: "close"): boolean;
638
- emit(event: "data", chunk: any): boolean;
639
- emit(event: "end"): boolean;
640
- emit(event: "error", err: Error): boolean;
641
- emit(event: "pause"): boolean;
642
- emit(event: "readable"): boolean;
643
- emit(event: "resume"): boolean;
644
- emit(event: string | symbol, ...args: any[]): boolean;
645
- on(event: "close", listener: () => void): this;
646
- on(event: "data", listener: (chunk: any) => void): this;
647
- on(event: "end", listener: () => void): this;
648
- on(event: "error", listener: (err: Error) => void): this;
649
- on(event: "pause", listener: () => void): this;
650
- on(event: "readable", listener: () => void): this;
651
- on(event: "resume", listener: () => void): this;
652
- on(event: string | symbol, listener: (...args: any[]) => void): this;
653
- once(event: "close", listener: () => void): this;
654
- once(event: "data", listener: (chunk: any) => void): this;
655
- once(event: "end", listener: () => void): this;
656
- once(event: "error", listener: (err: Error) => void): this;
657
- once(event: "pause", listener: () => void): this;
658
- once(event: "readable", listener: () => void): this;
659
- once(event: "resume", listener: () => void): this;
660
- once(event: string | symbol, listener: (...args: any[]) => void): this;
661
- prependListener(event: "close", listener: () => void): this;
662
- prependListener(event: "data", listener: (chunk: any) => void): this;
663
- prependListener(event: "end", listener: () => void): this;
664
- prependListener(event: "error", listener: (err: Error) => void): this;
665
- prependListener(event: "pause", listener: () => void): this;
666
- prependListener(event: "readable", listener: () => void): this;
667
- prependListener(event: "resume", listener: () => void): this;
668
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
669
- prependOnceListener(event: "close", listener: () => void): this;
670
- prependOnceListener(event: "data", listener: (chunk: any) => void): this;
671
- prependOnceListener(event: "end", listener: () => void): this;
672
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
673
- prependOnceListener(event: "pause", listener: () => void): this;
674
- prependOnceListener(event: "readable", listener: () => void): this;
675
- prependOnceListener(event: "resume", listener: () => void): this;
676
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
677
- removeListener(event: "close", listener: () => void): this;
678
- removeListener(event: "data", listener: (chunk: any) => void): this;
679
- removeListener(event: "end", listener: () => void): this;
680
- removeListener(event: "error", listener: (err: Error) => void): this;
681
- removeListener(event: "pause", listener: () => void): this;
682
- removeListener(event: "readable", listener: () => void): this;
683
- removeListener(event: "resume", listener: () => void): this;
684
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
650
+ * @returns `AsyncIterator` to fully consume the stream.
651
+ * @since v10.0.0
652
+ */
685
653
  [Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
686
654
  /**
687
- * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
655
+ * Calls `readable.destroy()` with an `AbortError` and returns
656
+ * a promise that fulfills when the stream is finished.
688
657
  * @since v20.4.0
689
658
  */
690
659
  [Symbol.asyncDispose](): Promise<void>;
660
+ // #region InternalEventEmitter
661
+ addListener<E extends keyof ReadableEventMap>(
662
+ eventName: E,
663
+ listener: (...args: ReadableEventMap[E]) => void,
664
+ ): this;
665
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
666
+ emit<E extends keyof ReadableEventMap>(eventName: E, ...args: ReadableEventMap[E]): boolean;
667
+ emit(eventName: string | symbol, ...args: any[]): boolean;
668
+ listenerCount<E extends keyof ReadableEventMap>(
669
+ eventName: E,
670
+ listener?: (...args: ReadableEventMap[E]) => void,
671
+ ): number;
672
+ listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
673
+ listeners<E extends keyof ReadableEventMap>(eventName: E): ((...args: ReadableEventMap[E]) => void)[];
674
+ listeners(eventName: string | symbol): ((...args: any[]) => void)[];
675
+ off<E extends keyof ReadableEventMap>(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this;
676
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
677
+ on<E extends keyof ReadableEventMap>(eventName: E, listener: (...args: ReadableEventMap[E]) => void): this;
678
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
679
+ once<E extends keyof ReadableEventMap>(
680
+ eventName: E,
681
+ listener: (...args: ReadableEventMap[E]) => void,
682
+ ): this;
683
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
684
+ prependListener<E extends keyof ReadableEventMap>(
685
+ eventName: E,
686
+ listener: (...args: ReadableEventMap[E]) => void,
687
+ ): this;
688
+ prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
689
+ prependOnceListener<E extends keyof ReadableEventMap>(
690
+ eventName: E,
691
+ listener: (...args: ReadableEventMap[E]) => void,
692
+ ): this;
693
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
694
+ rawListeners<E extends keyof ReadableEventMap>(eventName: E): ((...args: ReadableEventMap[E]) => void)[];
695
+ rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
696
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
697
+ removeAllListeners<E extends keyof ReadableEventMap>(eventName?: E): this;
698
+ removeAllListeners(eventName?: string | symbol): this;
699
+ removeListener<E extends keyof ReadableEventMap>(
700
+ eventName: E,
701
+ listener: (...args: ReadableEventMap[E]) => void,
702
+ ): this;
703
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
704
+ // #endregion
691
705
  }
692
706
  interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
693
707
  decodeStrings?: boolean | undefined;
@@ -703,38 +717,47 @@ declare module "stream" {
703
717
  writev?:
704
718
  | ((
705
719
  this: T,
706
- chunks: Array<{
720
+ chunks: {
707
721
  chunk: any;
708
722
  encoding: BufferEncoding;
709
- }>,
723
+ }[],
710
724
  callback: (error?: Error | null) => void,
711
725
  ) => void)
712
726
  | undefined;
713
727
  final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
714
728
  }
729
+ interface WritableEventMap {
730
+ "close": [];
731
+ "drain": [];
732
+ "error": [err: Error];
733
+ "finish": [];
734
+ "pipe": [src: Readable];
735
+ "unpipe": [src: Readable];
736
+ }
715
737
  /**
716
738
  * @since v0.9.4
717
739
  */
718
740
  class Writable extends Stream implements NodeJS.WritableStream {
741
+ constructor(options?: WritableOptions);
719
742
  /**
720
743
  * A utility method for creating a `Writable` from a web `WritableStream`.
721
744
  * @since v17.0.0
722
745
  */
723
746
  static fromWeb(
724
- writableStream: streamWeb.WritableStream,
747
+ writableStream: web.WritableStream,
725
748
  options?: Pick<WritableOptions, "decodeStrings" | "highWaterMark" | "objectMode" | "signal">,
726
749
  ): Writable;
727
750
  /**
728
751
  * A utility method for creating a web `WritableStream` from a `Writable`.
729
752
  * @since v17.0.0
730
753
  */
731
- static toWeb(streamWritable: Writable): streamWeb.WritableStream;
754
+ static toWeb(streamWritable: NodeJS.WritableStream): web.WritableStream;
732
755
  /**
733
756
  * Is `true` if it is safe to call `writable.write()`, which means
734
757
  * the stream has not been destroyed, errored, or ended.
735
758
  * @since v11.4.0
736
759
  */
737
- readonly writable: boolean;
760
+ writable: boolean;
738
761
  /**
739
762
  * Returns whether the stream was destroyed or errored before emitting `'finish'`.
740
763
  * @since v18.0.0, v16.17.0
@@ -794,13 +817,12 @@ declare module "stream" {
794
817
  * @since v15.2.0, v14.17.0
795
818
  */
796
819
  readonly writableNeedDrain: boolean;
797
- constructor(opts?: WritableOptions);
798
820
  _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
799
821
  _writev?(
800
- chunks: Array<{
822
+ chunks: {
801
823
  chunk: any;
802
824
  encoding: BufferEncoding;
803
- }>,
825
+ }[],
804
826
  callback: (error?: Error | null) => void,
805
827
  ): void;
806
828
  _construct?(callback: (error?: Error | null) => void): void;
@@ -985,64 +1007,56 @@ declare module "stream" {
985
1007
  */
986
1008
  destroy(error?: Error): this;
987
1009
  /**
988
- * Event emitter
989
- * The defined events on documents including:
990
- * 1. close
991
- * 2. drain
992
- * 3. error
993
- * 4. finish
994
- * 5. pipe
995
- * 6. unpipe
996
- */
997
- addListener(event: "close", listener: () => void): this;
998
- addListener(event: "drain", listener: () => void): this;
999
- addListener(event: "error", listener: (err: Error) => void): this;
1000
- addListener(event: "finish", listener: () => void): this;
1001
- addListener(event: "pipe", listener: (src: Readable) => void): this;
1002
- addListener(event: "unpipe", listener: (src: Readable) => void): this;
1003
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1004
- emit(event: "close"): boolean;
1005
- emit(event: "drain"): boolean;
1006
- emit(event: "error", err: Error): boolean;
1007
- emit(event: "finish"): boolean;
1008
- emit(event: "pipe", src: Readable): boolean;
1009
- emit(event: "unpipe", src: Readable): boolean;
1010
- emit(event: string | symbol, ...args: any[]): boolean;
1011
- on(event: "close", listener: () => void): this;
1012
- on(event: "drain", listener: () => void): this;
1013
- on(event: "error", listener: (err: Error) => void): this;
1014
- on(event: "finish", listener: () => void): this;
1015
- on(event: "pipe", listener: (src: Readable) => void): this;
1016
- on(event: "unpipe", listener: (src: Readable) => void): this;
1017
- on(event: string | symbol, listener: (...args: any[]) => void): this;
1018
- once(event: "close", listener: () => void): this;
1019
- once(event: "drain", listener: () => void): this;
1020
- once(event: "error", listener: (err: Error) => void): this;
1021
- once(event: "finish", listener: () => void): this;
1022
- once(event: "pipe", listener: (src: Readable) => void): this;
1023
- once(event: "unpipe", listener: (src: Readable) => void): this;
1024
- once(event: string | symbol, listener: (...args: any[]) => void): this;
1025
- prependListener(event: "close", listener: () => void): this;
1026
- prependListener(event: "drain", listener: () => void): this;
1027
- prependListener(event: "error", listener: (err: Error) => void): this;
1028
- prependListener(event: "finish", listener: () => void): this;
1029
- prependListener(event: "pipe", listener: (src: Readable) => void): this;
1030
- prependListener(event: "unpipe", listener: (src: Readable) => void): this;
1031
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1032
- prependOnceListener(event: "close", listener: () => void): this;
1033
- prependOnceListener(event: "drain", listener: () => void): this;
1034
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
1035
- prependOnceListener(event: "finish", listener: () => void): this;
1036
- prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
1037
- prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
1038
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1039
- removeListener(event: "close", listener: () => void): this;
1040
- removeListener(event: "drain", listener: () => void): this;
1041
- removeListener(event: "error", listener: (err: Error) => void): this;
1042
- removeListener(event: "finish", listener: () => void): this;
1043
- removeListener(event: "pipe", listener: (src: Readable) => void): this;
1044
- removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1045
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1010
+ * Calls `writable.destroy()` with an `AbortError` and returns
1011
+ * a promise that fulfills when the stream is finished.
1012
+ * @since v22.4.0, v20.16.0
1013
+ */
1014
+ [Symbol.asyncDispose](): Promise<void>;
1015
+ // #region InternalEventEmitter
1016
+ addListener<E extends keyof WritableEventMap>(
1017
+ eventName: E,
1018
+ listener: (...args: WritableEventMap[E]) => void,
1019
+ ): this;
1020
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1021
+ emit<E extends keyof WritableEventMap>(eventName: E, ...args: WritableEventMap[E]): boolean;
1022
+ emit(eventName: string | symbol, ...args: any[]): boolean;
1023
+ listenerCount<E extends keyof WritableEventMap>(
1024
+ eventName: E,
1025
+ listener?: (...args: WritableEventMap[E]) => void,
1026
+ ): number;
1027
+ listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
1028
+ listeners<E extends keyof WritableEventMap>(eventName: E): ((...args: WritableEventMap[E]) => void)[];
1029
+ listeners(eventName: string | symbol): ((...args: any[]) => void)[];
1030
+ off<E extends keyof WritableEventMap>(eventName: E, listener: (...args: WritableEventMap[E]) => void): this;
1031
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
1032
+ on<E extends keyof WritableEventMap>(eventName: E, listener: (...args: WritableEventMap[E]) => void): this;
1033
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
1034
+ once<E extends keyof WritableEventMap>(
1035
+ eventName: E,
1036
+ listener: (...args: WritableEventMap[E]) => void,
1037
+ ): this;
1038
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
1039
+ prependListener<E extends keyof WritableEventMap>(
1040
+ eventName: E,
1041
+ listener: (...args: WritableEventMap[E]) => void,
1042
+ ): this;
1043
+ prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1044
+ prependOnceListener<E extends keyof WritableEventMap>(
1045
+ eventName: E,
1046
+ listener: (...args: WritableEventMap[E]) => void,
1047
+ ): this;
1048
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1049
+ rawListeners<E extends keyof WritableEventMap>(eventName: E): ((...args: WritableEventMap[E]) => void)[];
1050
+ rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
1051
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
1052
+ removeAllListeners<E extends keyof WritableEventMap>(eventName?: E): this;
1053
+ removeAllListeners(eventName?: string | symbol): this;
1054
+ removeListener<E extends keyof WritableEventMap>(
1055
+ eventName: E,
1056
+ listener: (...args: WritableEventMap[E]) => void,
1057
+ ): this;
1058
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1059
+ // #endregion
1046
1060
  }
1047
1061
  interface DuplexOptions<T extends Duplex = Duplex> extends ReadableOptions<T>, WritableOptions<T> {
1048
1062
  allowHalfOpen?: boolean | undefined;
@@ -1052,6 +1066,10 @@ declare module "stream" {
1052
1066
  writableHighWaterMark?: number | undefined;
1053
1067
  writableCorked?: number | undefined;
1054
1068
  }
1069
+ interface DuplexToWebOptions {
1070
+ readableType?: web.ReadableStreamType | undefined;
1071
+ }
1072
+ interface DuplexEventMap extends ReadableEventMap, WritableEventMap {}
1055
1073
  /**
1056
1074
  * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
1057
1075
  *
@@ -1063,17 +1081,7 @@ declare module "stream" {
1063
1081
  * @since v0.9.4
1064
1082
  */
1065
1083
  class Duplex extends Stream implements NodeJS.ReadWriteStream {
1066
- /**
1067
- * If `false` then the stream will automatically end the writable side when the
1068
- * readable side ends. Set initially by the `allowHalfOpen` constructor option,
1069
- * which defaults to `true`.
1070
- *
1071
- * This can be changed manually to change the half-open behavior of an existing
1072
- * `Duplex` stream instance, but must be changed before the `'end'` event is emitted.
1073
- * @since v0.9.4
1074
- */
1075
- allowHalfOpen: boolean;
1076
- constructor(opts?: DuplexOptions);
1084
+ constructor(options?: DuplexOptions);
1077
1085
  /**
1078
1086
  * A utility method for creating duplex streams.
1079
1087
  *
@@ -1097,137 +1105,87 @@ declare module "stream" {
1097
1105
  */
1098
1106
  static from(
1099
1107
  src:
1100
- | Stream
1101
- | NodeBlob
1102
- | ArrayBuffer
1108
+ | NodeJS.ReadableStream
1109
+ | NodeJS.WritableStream
1110
+ | Blob
1103
1111
  | string
1104
1112
  | Iterable<any>
1105
1113
  | AsyncIterable<any>
1106
- | AsyncGeneratorFunction
1114
+ | ((source: AsyncIterable<any>) => AsyncIterable<any>)
1115
+ | ((source: AsyncIterable<any>) => Promise<void>)
1107
1116
  | Promise<any>
1108
- | Object,
1117
+ | web.ReadableWritablePair
1118
+ | web.ReadableStream
1119
+ | web.WritableStream,
1109
1120
  ): Duplex;
1110
1121
  /**
1111
1122
  * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`.
1112
1123
  * @since v17.0.0
1113
1124
  */
1114
- static toWeb(streamDuplex: Duplex): {
1115
- readable: streamWeb.ReadableStream;
1116
- writable: streamWeb.WritableStream;
1117
- };
1125
+ static toWeb(streamDuplex: NodeJS.ReadWriteStream, options?: DuplexToWebOptions): web.ReadableWritablePair;
1118
1126
  /**
1119
1127
  * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`.
1120
1128
  * @since v17.0.0
1121
1129
  */
1122
1130
  static fromWeb(
1123
- duplexStream: {
1124
- readable: streamWeb.ReadableStream;
1125
- writable: streamWeb.WritableStream;
1126
- },
1131
+ duplexStream: web.ReadableWritablePair,
1127
1132
  options?: Pick<
1128
1133
  DuplexOptions,
1129
1134
  "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal"
1130
1135
  >,
1131
1136
  ): Duplex;
1132
1137
  /**
1133
- * Event emitter
1134
- * The defined events on documents including:
1135
- * 1. close
1136
- * 2. data
1137
- * 3. drain
1138
- * 4. end
1139
- * 5. error
1140
- * 6. finish
1141
- * 7. pause
1142
- * 8. pipe
1143
- * 9. readable
1144
- * 10. resume
1145
- * 11. unpipe
1146
- */
1147
- addListener(event: "close", listener: () => void): this;
1148
- addListener(event: "data", listener: (chunk: any) => void): this;
1149
- addListener(event: "drain", listener: () => void): this;
1150
- addListener(event: "end", listener: () => void): this;
1151
- addListener(event: "error", listener: (err: Error) => void): this;
1152
- addListener(event: "finish", listener: () => void): this;
1153
- addListener(event: "pause", listener: () => void): this;
1154
- addListener(event: "pipe", listener: (src: Readable) => void): this;
1155
- addListener(event: "readable", listener: () => void): this;
1156
- addListener(event: "resume", listener: () => void): this;
1157
- addListener(event: "unpipe", listener: (src: Readable) => void): this;
1158
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1159
- emit(event: "close"): boolean;
1160
- emit(event: "data", chunk: any): boolean;
1161
- emit(event: "drain"): boolean;
1162
- emit(event: "end"): boolean;
1163
- emit(event: "error", err: Error): boolean;
1164
- emit(event: "finish"): boolean;
1165
- emit(event: "pause"): boolean;
1166
- emit(event: "pipe", src: Readable): boolean;
1167
- emit(event: "readable"): boolean;
1168
- emit(event: "resume"): boolean;
1169
- emit(event: "unpipe", src: Readable): boolean;
1170
- emit(event: string | symbol, ...args: any[]): boolean;
1171
- on(event: "close", listener: () => void): this;
1172
- on(event: "data", listener: (chunk: any) => void): this;
1173
- on(event: "drain", listener: () => void): this;
1174
- on(event: "end", listener: () => void): this;
1175
- on(event: "error", listener: (err: Error) => void): this;
1176
- on(event: "finish", listener: () => void): this;
1177
- on(event: "pause", listener: () => void): this;
1178
- on(event: "pipe", listener: (src: Readable) => void): this;
1179
- on(event: "readable", listener: () => void): this;
1180
- on(event: "resume", listener: () => void): this;
1181
- on(event: "unpipe", listener: (src: Readable) => void): this;
1182
- on(event: string | symbol, listener: (...args: any[]) => void): this;
1183
- once(event: "close", listener: () => void): this;
1184
- once(event: "data", listener: (chunk: any) => void): this;
1185
- once(event: "drain", listener: () => void): this;
1186
- once(event: "end", listener: () => void): this;
1187
- once(event: "error", listener: (err: Error) => void): this;
1188
- once(event: "finish", listener: () => void): this;
1189
- once(event: "pause", listener: () => void): this;
1190
- once(event: "pipe", listener: (src: Readable) => void): this;
1191
- once(event: "readable", listener: () => void): this;
1192
- once(event: "resume", listener: () => void): this;
1193
- once(event: "unpipe", listener: (src: Readable) => void): this;
1194
- once(event: string | symbol, listener: (...args: any[]) => void): this;
1195
- prependListener(event: "close", listener: () => void): this;
1196
- prependListener(event: "data", listener: (chunk: any) => void): this;
1197
- prependListener(event: "drain", listener: () => void): this;
1198
- prependListener(event: "end", listener: () => void): this;
1199
- prependListener(event: "error", listener: (err: Error) => void): this;
1200
- prependListener(event: "finish", listener: () => void): this;
1201
- prependListener(event: "pause", listener: () => void): this;
1202
- prependListener(event: "pipe", listener: (src: Readable) => void): this;
1203
- prependListener(event: "readable", listener: () => void): this;
1204
- prependListener(event: "resume", listener: () => void): this;
1205
- prependListener(event: "unpipe", listener: (src: Readable) => void): this;
1206
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1207
- prependOnceListener(event: "close", listener: () => void): this;
1208
- prependOnceListener(event: "data", listener: (chunk: any) => void): this;
1209
- prependOnceListener(event: "drain", listener: () => void): this;
1210
- prependOnceListener(event: "end", listener: () => void): this;
1211
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
1212
- prependOnceListener(event: "finish", listener: () => void): this;
1213
- prependOnceListener(event: "pause", listener: () => void): this;
1214
- prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
1215
- prependOnceListener(event: "readable", listener: () => void): this;
1216
- prependOnceListener(event: "resume", listener: () => void): this;
1217
- prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
1218
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1219
- removeListener(event: "close", listener: () => void): this;
1220
- removeListener(event: "data", listener: (chunk: any) => void): this;
1221
- removeListener(event: "drain", listener: () => void): this;
1222
- removeListener(event: "end", listener: () => void): this;
1223
- removeListener(event: "error", listener: (err: Error) => void): this;
1224
- removeListener(event: "finish", listener: () => void): this;
1225
- removeListener(event: "pause", listener: () => void): this;
1226
- removeListener(event: "pipe", listener: (src: Readable) => void): this;
1227
- removeListener(event: "readable", listener: () => void): this;
1228
- removeListener(event: "resume", listener: () => void): this;
1229
- removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1230
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1138
+ * If `false` then the stream will automatically end the writable side when the
1139
+ * readable side ends. Set initially by the `allowHalfOpen` constructor option,
1140
+ * which defaults to `true`.
1141
+ *
1142
+ * This can be changed manually to change the half-open behavior of an existing
1143
+ * `Duplex` stream instance, but must be changed before the `'end'` event is emitted.
1144
+ * @since v0.9.4
1145
+ */
1146
+ allowHalfOpen: boolean;
1147
+ // #region InternalEventEmitter
1148
+ addListener<E extends keyof DuplexEventMap>(
1149
+ eventName: E,
1150
+ listener: (...args: DuplexEventMap[E]) => void,
1151
+ ): this;
1152
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1153
+ emit<E extends keyof DuplexEventMap>(eventName: E, ...args: DuplexEventMap[E]): boolean;
1154
+ emit(eventName: string | symbol, ...args: any[]): boolean;
1155
+ listenerCount<E extends keyof DuplexEventMap>(
1156
+ eventName: E,
1157
+ listener?: (...args: DuplexEventMap[E]) => void,
1158
+ ): number;
1159
+ listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
1160
+ listeners<E extends keyof DuplexEventMap>(eventName: E): ((...args: DuplexEventMap[E]) => void)[];
1161
+ listeners(eventName: string | symbol): ((...args: any[]) => void)[];
1162
+ off<E extends keyof DuplexEventMap>(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this;
1163
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
1164
+ on<E extends keyof DuplexEventMap>(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this;
1165
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
1166
+ once<E extends keyof DuplexEventMap>(eventName: E, listener: (...args: DuplexEventMap[E]) => void): this;
1167
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
1168
+ prependListener<E extends keyof DuplexEventMap>(
1169
+ eventName: E,
1170
+ listener: (...args: DuplexEventMap[E]) => void,
1171
+ ): this;
1172
+ prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1173
+ prependOnceListener<E extends keyof DuplexEventMap>(
1174
+ eventName: E,
1175
+ listener: (...args: DuplexEventMap[E]) => void,
1176
+ ): this;
1177
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1178
+ rawListeners<E extends keyof DuplexEventMap>(eventName: E): ((...args: DuplexEventMap[E]) => void)[];
1179
+ rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
1180
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
1181
+ removeAllListeners<E extends keyof DuplexEventMap>(eventName?: E): this;
1182
+ removeAllListeners(eventName?: string | symbol): this;
1183
+ removeListener<E extends keyof DuplexEventMap>(
1184
+ eventName: E,
1185
+ listener: (...args: DuplexEventMap[E]) => void,
1186
+ ): this;
1187
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
1188
+ // #endregion
1231
1189
  }
1232
1190
  interface Duplex extends Readable, Writable {}
1233
1191
  /**
@@ -1268,7 +1226,7 @@ declare module "stream" {
1268
1226
  * @since v0.9.4
1269
1227
  */
1270
1228
  class Transform extends Duplex {
1271
- constructor(opts?: TransformOptions);
1229
+ constructor(options?: TransformOptions);
1272
1230
  _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
1273
1231
  _flush(callback: TransformCallback): void;
1274
1232
  }
@@ -1356,7 +1314,9 @@ declare module "stream" {
1356
1314
  * @param signal A signal representing possible cancellation
1357
1315
  * @param stream A stream to attach a signal to.
1358
1316
  */
1359
- function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
1317
+ function addAbortSignal<
1318
+ T extends NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream,
1319
+ >(signal: AbortSignal, stream: T): T;
1360
1320
  /**
1361
1321
  * Returns the default highWaterMark used by streams.
1362
1322
  * Defaults to `65536` (64 KiB), or `16` for `objectMode`.
@@ -1400,7 +1360,7 @@ declare module "stream" {
1400
1360
  * Especially useful in error handling scenarios where a stream is destroyed
1401
1361
  * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`.
1402
1362
  *
1403
- * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streamfinishedstream-options).
1363
+ * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options).
1404
1364
  *
1405
1365
  * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
1406
1366
  * invoked. The reason for this is so that unexpected `'error'` events (due to
@@ -1420,46 +1380,57 @@ declare module "stream" {
1420
1380
  * @returns A cleanup function which removes all registered listeners.
1421
1381
  */
1422
1382
  function finished(
1423
- stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1383
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream,
1424
1384
  options: FinishedOptions,
1425
1385
  callback: (err?: NodeJS.ErrnoException | null) => void,
1426
1386
  ): () => void;
1427
1387
  function finished(
1428
- stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1388
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream,
1429
1389
  callback: (err?: NodeJS.ErrnoException | null) => void,
1430
1390
  ): () => void;
1431
1391
  namespace finished {
1432
- function __promisify__(
1433
- stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
1434
- options?: FinishedOptions,
1435
- ): Promise<void>;
1392
+ import __promisify__ = promises.finished;
1393
+ export { __promisify__ };
1436
1394
  }
1437
- type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
1438
- type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
1439
- type PipelineTransform<S extends PipelineTransformSource<any>, U> =
1395
+ type PipelineSourceFunction<O> = (options?: Abortable) => Iterable<O> | AsyncIterable<O>;
1396
+ type PipelineSource<O> =
1397
+ | NodeJS.ReadableStream
1398
+ | web.ReadableStream<O>
1399
+ | web.TransformStream<any, O>
1400
+ | Iterable<O>
1401
+ | AsyncIterable<O>
1402
+ | PipelineSourceFunction<O>;
1403
+ type PipelineSourceArgument<T> = (T extends (...args: any[]) => infer R ? R : T) extends infer S
1404
+ ? S extends web.TransformStream<any, infer O> ? web.ReadableStream<O> : S
1405
+ : never;
1406
+ type PipelineTransformGenerator<S extends PipelineTransformSource<any>, O> = (
1407
+ source: PipelineSourceArgument<S>,
1408
+ options?: Abortable,
1409
+ ) => AsyncIterable<O>;
1410
+ type PipelineTransformStreams<I, O> =
1440
1411
  | NodeJS.ReadWriteStream
1441
- | ((
1442
- source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST>
1443
- : S,
1444
- ) => AsyncIterable<U>);
1445
- type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
1446
- type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
1447
- type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
1448
- type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends
1449
- PipelineTransformSource<infer ST> ?
1412
+ | web.TransformStream<I, O>;
1413
+ type PipelineTransform<S extends PipelineTransformSource<any>, O> = S extends
1414
+ PipelineSource<infer I> | PipelineTransformStreams<any, infer I> | ((...args: any[]) => infer I)
1415
+ ? PipelineTransformStreams<I, O> | PipelineTransformGenerator<S, O>
1416
+ : never;
1417
+ type PipelineTransformSource<O> = PipelineSource<O> | PipelineTransform<any, O>;
1418
+ type PipelineDestinationFunction<S extends PipelineTransformSource<any>, R> = (
1419
+ source: PipelineSourceArgument<S>,
1420
+ options?: Abortable,
1421
+ ) => R;
1422
+ type PipelineDestination<S extends PipelineTransformSource<any>, R> = S extends
1423
+ PipelineSource<infer I> | PipelineTransform<any, infer I> ?
1450
1424
  | NodeJS.WritableStream
1451
- | PipelineDestinationIterableFunction<ST>
1452
- | PipelineDestinationPromiseFunction<ST, P>
1425
+ | web.WritableStream<I>
1426
+ | web.TransformStream<I, any>
1427
+ | PipelineDestinationFunction<S, R>
1453
1428
  : never;
1454
- type PipelineCallback<S extends PipelineDestination<any, any>> = S extends
1455
- PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void
1456
- : (err: NodeJS.ErrnoException | null) => void;
1457
- type PipelinePromise<S extends PipelineDestination<any, any>> = S extends
1458
- PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
1459
- interface PipelineOptions {
1460
- signal?: AbortSignal | undefined;
1461
- end?: boolean | undefined;
1462
- }
1429
+ type PipelineCallback<S extends PipelineDestination<any, any>> = (
1430
+ err: NodeJS.ErrnoException | null,
1431
+ value: S extends (...args: any[]) => PromiseLike<infer R> ? R : undefined,
1432
+ ) => void;
1433
+ type PipelineResult<S extends PipelineDestination<any, any>> = S extends NodeJS.WritableStream ? S : Duplex;
1463
1434
  /**
1464
1435
  * A module method to pipe between streams and generators forwarding errors and
1465
1436
  * properly cleaning up and provide a callback when the pipeline is complete.
@@ -1488,7 +1459,7 @@ declare module "stream" {
1488
1459
  * );
1489
1460
  * ```
1490
1461
  *
1491
- * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v22.x/api/stream.html#streampipelinesource-transforms-destination-options).
1462
+ * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-options).
1492
1463
  *
1493
1464
  * `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
1494
1465
  *
@@ -1525,163 +1496,279 @@ declare module "stream" {
1525
1496
  * @since v10.0.0
1526
1497
  * @param callback Called when the pipeline is fully done.
1527
1498
  */
1528
- function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1529
- source: A,
1530
- destination: B,
1531
- callback: PipelineCallback<B>,
1532
- ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1499
+ function pipeline<S extends PipelineSource<any>, D extends PipelineDestination<S, any>>(
1500
+ source: S,
1501
+ destination: D,
1502
+ callback: PipelineCallback<D>,
1503
+ ): PipelineResult<D>;
1533
1504
  function pipeline<
1534
- A extends PipelineSource<any>,
1535
- T1 extends PipelineTransform<A, any>,
1536
- B extends PipelineDestination<T1, any>,
1505
+ S extends PipelineSource<any>,
1506
+ T extends PipelineTransform<S, any>,
1507
+ D extends PipelineDestination<T, any>,
1537
1508
  >(
1538
- source: A,
1539
- transform1: T1,
1540
- destination: B,
1541
- callback: PipelineCallback<B>,
1542
- ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1509
+ source: S,
1510
+ transform: T,
1511
+ destination: D,
1512
+ callback: PipelineCallback<D>,
1513
+ ): PipelineResult<D>;
1543
1514
  function pipeline<
1544
- A extends PipelineSource<any>,
1545
- T1 extends PipelineTransform<A, any>,
1515
+ S extends PipelineSource<any>,
1516
+ T1 extends PipelineTransform<S, any>,
1546
1517
  T2 extends PipelineTransform<T1, any>,
1547
- B extends PipelineDestination<T2, any>,
1518
+ D extends PipelineDestination<T2, any>,
1548
1519
  >(
1549
- source: A,
1520
+ source: S,
1550
1521
  transform1: T1,
1551
1522
  transform2: T2,
1552
- destination: B,
1553
- callback: PipelineCallback<B>,
1554
- ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1523
+ destination: D,
1524
+ callback: PipelineCallback<D>,
1525
+ ): PipelineResult<D>;
1555
1526
  function pipeline<
1556
- A extends PipelineSource<any>,
1557
- T1 extends PipelineTransform<A, any>,
1527
+ S extends PipelineSource<any>,
1528
+ T1 extends PipelineTransform<S, any>,
1558
1529
  T2 extends PipelineTransform<T1, any>,
1559
1530
  T3 extends PipelineTransform<T2, any>,
1560
- B extends PipelineDestination<T3, any>,
1531
+ D extends PipelineDestination<T3, any>,
1561
1532
  >(
1562
- source: A,
1533
+ source: S,
1563
1534
  transform1: T1,
1564
1535
  transform2: T2,
1565
1536
  transform3: T3,
1566
- destination: B,
1567
- callback: PipelineCallback<B>,
1568
- ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1537
+ destination: D,
1538
+ callback: PipelineCallback<D>,
1539
+ ): PipelineResult<D>;
1569
1540
  function pipeline<
1570
- A extends PipelineSource<any>,
1571
- T1 extends PipelineTransform<A, any>,
1541
+ S extends PipelineSource<any>,
1542
+ T1 extends PipelineTransform<S, any>,
1572
1543
  T2 extends PipelineTransform<T1, any>,
1573
1544
  T3 extends PipelineTransform<T2, any>,
1574
1545
  T4 extends PipelineTransform<T3, any>,
1575
- B extends PipelineDestination<T4, any>,
1546
+ D extends PipelineDestination<T4, any>,
1576
1547
  >(
1577
- source: A,
1548
+ source: S,
1578
1549
  transform1: T1,
1579
1550
  transform2: T2,
1580
1551
  transform3: T3,
1581
1552
  transform4: T4,
1582
- destination: B,
1583
- callback: PipelineCallback<B>,
1584
- ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1553
+ destination: D,
1554
+ callback: PipelineCallback<D>,
1555
+ ): PipelineResult<D>;
1585
1556
  function pipeline(
1586
- streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
1557
+ streams: ReadonlyArray<PipelineSource<any> | PipelineTransform<any, any> | PipelineDestination<any, any>>,
1587
1558
  callback: (err: NodeJS.ErrnoException | null) => void,
1588
1559
  ): NodeJS.WritableStream;
1589
1560
  function pipeline(
1590
- stream1: NodeJS.ReadableStream,
1591
- stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
1592
- ...streams: Array<
1593
- NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)
1594
- >
1561
+ ...streams: [
1562
+ ...[PipelineSource<any>, ...PipelineTransform<any, any>[], PipelineDestination<any, any>],
1563
+ callback: ((err: NodeJS.ErrnoException | null) => void),
1564
+ ]
1595
1565
  ): NodeJS.WritableStream;
1596
1566
  namespace pipeline {
1597
- function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1598
- source: A,
1599
- destination: B,
1600
- options?: PipelineOptions,
1601
- ): PipelinePromise<B>;
1602
- function __promisify__<
1603
- A extends PipelineSource<any>,
1604
- T1 extends PipelineTransform<A, any>,
1605
- B extends PipelineDestination<T1, any>,
1606
- >(
1607
- source: A,
1608
- transform1: T1,
1609
- destination: B,
1610
- options?: PipelineOptions,
1611
- ): PipelinePromise<B>;
1612
- function __promisify__<
1613
- A extends PipelineSource<any>,
1614
- T1 extends PipelineTransform<A, any>,
1615
- T2 extends PipelineTransform<T1, any>,
1616
- B extends PipelineDestination<T2, any>,
1617
- >(
1618
- source: A,
1619
- transform1: T1,
1620
- transform2: T2,
1621
- destination: B,
1622
- options?: PipelineOptions,
1623
- ): PipelinePromise<B>;
1624
- function __promisify__<
1625
- A extends PipelineSource<any>,
1626
- T1 extends PipelineTransform<A, any>,
1627
- T2 extends PipelineTransform<T1, any>,
1628
- T3 extends PipelineTransform<T2, any>,
1629
- B extends PipelineDestination<T3, any>,
1630
- >(
1631
- source: A,
1632
- transform1: T1,
1633
- transform2: T2,
1634
- transform3: T3,
1635
- destination: B,
1636
- options?: PipelineOptions,
1637
- ): PipelinePromise<B>;
1638
- function __promisify__<
1639
- A extends PipelineSource<any>,
1640
- T1 extends PipelineTransform<A, any>,
1641
- T2 extends PipelineTransform<T1, any>,
1642
- T3 extends PipelineTransform<T2, any>,
1643
- T4 extends PipelineTransform<T3, any>,
1644
- B extends PipelineDestination<T4, any>,
1645
- >(
1646
- source: A,
1647
- transform1: T1,
1648
- transform2: T2,
1649
- transform3: T3,
1650
- transform4: T4,
1651
- destination: B,
1652
- options?: PipelineOptions,
1653
- ): PipelinePromise<B>;
1654
- function __promisify__(
1655
- streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
1656
- options?: PipelineOptions,
1657
- ): Promise<void>;
1658
- function __promisify__(
1659
- stream1: NodeJS.ReadableStream,
1660
- stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
1661
- ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
1662
- ): Promise<void>;
1663
- }
1664
- // TODO: this interface never existed; remove in next major
1665
- interface Pipe {
1666
- close(): void;
1667
- hasRef(): boolean;
1668
- ref(): void;
1669
- unref(): void;
1567
+ import __promisify__ = promises.pipeline;
1568
+ export { __promisify__ };
1670
1569
  }
1570
+ type ComposeSource<O> =
1571
+ | NodeJS.ReadableStream
1572
+ | web.ReadableStream<O>
1573
+ | Iterable<O>
1574
+ | AsyncIterable<O>
1575
+ | (() => AsyncIterable<O>);
1576
+ type ComposeTransformStreams<I, O> = NodeJS.ReadWriteStream | web.TransformStream<I, O>;
1577
+ type ComposeTransformGenerator<I, O> = (source: AsyncIterable<I>) => AsyncIterable<O>;
1578
+ type ComposeTransform<S extends ComposeTransformSource<any>, O> = S extends
1579
+ ComposeSource<infer I> | ComposeTransformStreams<any, infer I> | ComposeTransformGenerator<any, infer I>
1580
+ ? ComposeTransformStreams<I, O> | ComposeTransformGenerator<I, O>
1581
+ : never;
1582
+ type ComposeTransformSource<O> = ComposeSource<O> | ComposeTransform<any, O>;
1583
+ type ComposeDestination<S extends ComposeTransformSource<any>> = S extends ComposeTransformSource<infer I> ?
1584
+ | NodeJS.WritableStream
1585
+ | web.WritableStream<I>
1586
+ | web.TransformStream<I, any>
1587
+ | ((source: AsyncIterable<I>) => void)
1588
+ : never;
1589
+ /**
1590
+ * Combines two or more streams into a `Duplex` stream that writes to the
1591
+ * first stream and reads from the last. Each provided stream is piped into
1592
+ * the next, using `stream.pipeline`. If any of the streams error then all
1593
+ * are destroyed, including the outer `Duplex` stream.
1594
+ *
1595
+ * Because `stream.compose` returns a new stream that in turn can (and
1596
+ * should) be piped into other streams, it enables composition. In contrast,
1597
+ * when passing streams to `stream.pipeline`, typically the first stream is
1598
+ * a readable stream and the last a writable stream, forming a closed
1599
+ * circuit.
1600
+ *
1601
+ * If passed a `Function` it must be a factory method taking a `source`
1602
+ * `Iterable`.
1603
+ *
1604
+ * ```js
1605
+ * import { compose, Transform } from 'node:stream';
1606
+ *
1607
+ * const removeSpaces = new Transform({
1608
+ * transform(chunk, encoding, callback) {
1609
+ * callback(null, String(chunk).replace(' ', ''));
1610
+ * },
1611
+ * });
1612
+ *
1613
+ * async function* toUpper(source) {
1614
+ * for await (const chunk of source) {
1615
+ * yield String(chunk).toUpperCase();
1616
+ * }
1617
+ * }
1618
+ *
1619
+ * let res = '';
1620
+ * for await (const buf of compose(removeSpaces, toUpper).end('hello world')) {
1621
+ * res += buf;
1622
+ * }
1623
+ *
1624
+ * console.log(res); // prints 'HELLOWORLD'
1625
+ * ```
1626
+ *
1627
+ * `stream.compose` can be used to convert async iterables, generators and
1628
+ * functions into streams.
1629
+ *
1630
+ * * `AsyncIterable` converts into a readable `Duplex`. Cannot yield
1631
+ * `null`.
1632
+ * * `AsyncGeneratorFunction` converts into a readable/writable transform `Duplex`.
1633
+ * Must take a source `AsyncIterable` as first parameter. Cannot yield
1634
+ * `null`.
1635
+ * * `AsyncFunction` converts into a writable `Duplex`. Must return
1636
+ * either `null` or `undefined`.
1637
+ *
1638
+ * ```js
1639
+ * import { compose } from 'node:stream';
1640
+ * import { finished } from 'node:stream/promises';
1641
+ *
1642
+ * // Convert AsyncIterable into readable Duplex.
1643
+ * const s1 = compose(async function*() {
1644
+ * yield 'Hello';
1645
+ * yield 'World';
1646
+ * }());
1647
+ *
1648
+ * // Convert AsyncGenerator into transform Duplex.
1649
+ * const s2 = compose(async function*(source) {
1650
+ * for await (const chunk of source) {
1651
+ * yield String(chunk).toUpperCase();
1652
+ * }
1653
+ * });
1654
+ *
1655
+ * let res = '';
1656
+ *
1657
+ * // Convert AsyncFunction into writable Duplex.
1658
+ * const s3 = compose(async function(source) {
1659
+ * for await (const chunk of source) {
1660
+ * res += chunk;
1661
+ * }
1662
+ * });
1663
+ *
1664
+ * await finished(compose(s1, s2, s3));
1665
+ *
1666
+ * console.log(res); // prints 'HELLOWORLD'
1667
+ * ```
1668
+ *
1669
+ * For convenience, the `readable.compose(stream)` method is available on
1670
+ * `Readable` and `Duplex` streams as a wrapper for this function.
1671
+ * @since v16.9.0
1672
+ * @experimental
1673
+ */
1674
+ /* eslint-disable @definitelytyped/no-unnecessary-generics */
1675
+ function compose(stream: ComposeSource<any> | ComposeDestination<any>): Duplex;
1676
+ function compose<
1677
+ S extends ComposeSource<any> | ComposeTransform<any, any>,
1678
+ D extends ComposeTransform<S, any> | ComposeDestination<S>,
1679
+ >(
1680
+ source: S,
1681
+ destination: D,
1682
+ ): Duplex;
1683
+ function compose<
1684
+ S extends ComposeSource<any> | ComposeTransform<any, any>,
1685
+ T extends ComposeTransform<S, any>,
1686
+ D extends ComposeTransform<T, any> | ComposeDestination<T>,
1687
+ >(source: S, transform: T, destination: D): Duplex;
1688
+ function compose<
1689
+ S extends ComposeSource<any> | ComposeTransform<any, any>,
1690
+ T1 extends ComposeTransform<S, any>,
1691
+ T2 extends ComposeTransform<T1, any>,
1692
+ D extends ComposeTransform<T2, any> | ComposeDestination<T2>,
1693
+ >(source: S, transform1: T1, transform2: T2, destination: D): Duplex;
1694
+ function compose<
1695
+ S extends ComposeSource<any> | ComposeTransform<any, any>,
1696
+ T1 extends ComposeTransform<S, any>,
1697
+ T2 extends ComposeTransform<T1, any>,
1698
+ T3 extends ComposeTransform<T2, any>,
1699
+ D extends ComposeTransform<T3, any> | ComposeDestination<T3>,
1700
+ >(source: S, transform1: T1, transform2: T2, transform3: T3, destination: D): Duplex;
1701
+ function compose<
1702
+ S extends ComposeSource<any> | ComposeTransform<any, any>,
1703
+ T1 extends ComposeTransform<S, any>,
1704
+ T2 extends ComposeTransform<T1, any>,
1705
+ T3 extends ComposeTransform<T2, any>,
1706
+ T4 extends ComposeTransform<T3, any>,
1707
+ D extends ComposeTransform<T4, any> | ComposeDestination<T4>,
1708
+ >(source: S, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: D): Duplex;
1709
+ function compose(
1710
+ ...streams: [
1711
+ ComposeSource<any>,
1712
+ ...ComposeTransform<any, any>[],
1713
+ ComposeDestination<any>,
1714
+ ]
1715
+ ): Duplex;
1716
+ /* eslint-enable @definitelytyped/no-unnecessary-generics */
1671
1717
  /**
1672
1718
  * Returns whether the stream has encountered an error.
1673
1719
  * @since v17.3.0, v16.14.0
1674
1720
  */
1675
- function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
1721
+ function isErrored(
1722
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | web.ReadableStream | web.WritableStream,
1723
+ ): boolean;
1676
1724
  /**
1677
1725
  * Returns whether the stream is readable.
1678
1726
  * @since v17.4.0, v16.14.0
1727
+ * @returns Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`.
1728
+ */
1729
+ function isReadable(stream: NodeJS.ReadableStream | web.ReadableStream): boolean | null;
1730
+ /**
1731
+ * Returns whether the stream is writable.
1732
+ * @since v20.0.0
1733
+ * @returns Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`.
1679
1734
  */
1680
- function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
1735
+ function isWritable(stream: NodeJS.WritableStream | web.WritableStream): boolean | null;
1736
+ }
1737
+ global {
1738
+ namespace NodeJS {
1739
+ // These interfaces are vestigial, and correspond roughly to the "streams2" interfaces
1740
+ // from early versions of Node.js, but they are still used widely across the ecosystem.
1741
+ // Accordingly, they are commonly used as "in-types" for @types/node APIs, so that
1742
+ // eg. streams returned from older libraries will still be considered valid input to
1743
+ // functions which accept stream arguments.
1744
+ // It's not possible to change or remove these without astronomical levels of breakage.
1745
+ interface ReadableStream extends EventEmitter {
1746
+ readable: boolean;
1747
+ read(size?: number): string | Buffer;
1748
+ setEncoding(encoding: BufferEncoding): this;
1749
+ pause(): this;
1750
+ resume(): this;
1751
+ isPaused(): boolean;
1752
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
1753
+ unpipe(destination?: WritableStream): this;
1754
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
1755
+ wrap(oldStream: ReadableStream): this;
1756
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
1757
+ }
1758
+ interface WritableStream extends EventEmitter {
1759
+ writable: boolean;
1760
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
1761
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
1762
+ end(cb?: () => void): this;
1763
+ end(data: string | Uint8Array, cb?: () => void): this;
1764
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
1765
+ }
1766
+ interface ReadWriteStream extends ReadableStream, WritableStream {}
1767
+ }
1681
1768
  }
1682
1769
  export = Stream;
1683
1770
  }
1684
- declare module "node:stream" {
1685
- import stream = require("stream");
1771
+ declare module "stream" {
1772
+ import stream = require("node:stream");
1686
1773
  export = stream;
1687
1774
  }