@code-yeongyu/senpi 2026.6.4 → 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 (1050) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +19 -4
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js.map +1 -1
  5. package/dist/bun/register-bedrock.d.ts.map +1 -1
  6. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  7. package/dist/bun/restore-sandbox-env.js.map +1 -1
  8. package/dist/cli/args.d.ts +1 -0
  9. package/dist/cli/args.d.ts.map +1 -1
  10. package/dist/cli/args.js +12 -2
  11. package/dist/cli/args.js.map +1 -1
  12. package/dist/cli/config-selector.d.ts.map +1 -1
  13. package/dist/cli/config-selector.js.map +1 -1
  14. package/dist/cli/file-processor.d.ts.map +1 -1
  15. package/dist/cli/file-processor.js.map +1 -1
  16. package/dist/cli/initial-message.d.ts +1 -1
  17. package/dist/cli/initial-message.d.ts.map +1 -1
  18. package/dist/cli/initial-message.js.map +1 -1
  19. package/dist/cli/list-models.d.ts.map +1 -1
  20. package/dist/cli/list-models.js.map +1 -1
  21. package/dist/cli/session-picker.d.ts.map +1 -1
  22. package/dist/cli/session-picker.js.map +1 -1
  23. package/dist/cli-main.d.ts.map +1 -1
  24. package/dist/cli-main.js.map +1 -1
  25. package/dist/cli.d.ts.map +1 -1
  26. package/dist/cli.js.map +1 -1
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js.map +1 -1
  29. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  30. package/dist/core/agent-session-runtime.js +0 -8
  31. package/dist/core/agent-session-runtime.js.map +1 -1
  32. package/dist/core/agent-session-services.d.ts.map +1 -1
  33. package/dist/core/agent-session-services.js.map +1 -1
  34. package/dist/core/agent-session.d.ts +32 -0
  35. package/dist/core/agent-session.d.ts.map +1 -1
  36. package/dist/core/agent-session.js +51 -79
  37. package/dist/core/agent-session.js.map +1 -1
  38. package/dist/core/auth-guidance.d.ts.map +1 -1
  39. package/dist/core/auth-guidance.js.map +1 -1
  40. package/dist/core/auth-storage.d.ts +4 -0
  41. package/dist/core/auth-storage.d.ts.map +1 -1
  42. package/dist/core/auth-storage.js +4 -8
  43. package/dist/core/auth-storage.js.map +1 -1
  44. package/dist/core/bash-executor.d.ts.map +1 -1
  45. package/dist/core/bash-executor.js.map +1 -1
  46. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  47. package/dist/core/compaction/branch-summarization.js.map +1 -1
  48. package/dist/core/compaction/compaction.d.ts.map +1 -1
  49. package/dist/core/compaction/compaction.js.map +1 -1
  50. package/dist/core/compaction/index.d.ts.map +1 -1
  51. package/dist/core/compaction/utils.d.ts.map +1 -1
  52. package/dist/core/compaction/utils.js.map +1 -1
  53. package/dist/core/defaults.d.ts.map +1 -1
  54. package/dist/core/diagnostics.d.ts.map +1 -1
  55. package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
  56. package/dist/core/dynamic-prompt/build.js.map +1 -1
  57. package/dist/core/dynamic-prompt/exploration.d.ts.map +1 -1
  58. package/dist/core/dynamic-prompt/exploration.js.map +1 -1
  59. package/dist/core/dynamic-prompt/identity.d.ts.map +1 -1
  60. package/dist/core/dynamic-prompt/identity.js.map +1 -1
  61. package/dist/core/dynamic-prompt/index.d.ts.map +1 -1
  62. package/dist/core/dynamic-prompt/intent-gate.d.ts.map +1 -1
  63. package/dist/core/dynamic-prompt/intent-gate.js.map +1 -1
  64. package/dist/core/dynamic-prompt/parallel-tools.d.ts.map +1 -1
  65. package/dist/core/dynamic-prompt/parallel-tools.js.map +1 -1
  66. package/dist/core/dynamic-prompt/policies.d.ts.map +1 -1
  67. package/dist/core/dynamic-prompt/policies.js.map +1 -1
  68. package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
  69. package/dist/core/dynamic-prompt/style.js.map +1 -1
  70. package/dist/core/dynamic-prompt/tool-categorization.d.ts.map +1 -1
  71. package/dist/core/dynamic-prompt/tool-categorization.js.map +1 -1
  72. package/dist/core/dynamic-prompt/tool-section.d.ts.map +1 -1
  73. package/dist/core/dynamic-prompt/tool-section.js.map +1 -1
  74. package/dist/core/dynamic-prompt/types.d.ts.map +1 -1
  75. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  76. package/dist/core/dynamic-prompt/verification.js.map +1 -1
  77. package/dist/core/event-bus.d.ts.map +1 -1
  78. package/dist/core/event-bus.js.map +1 -1
  79. package/dist/core/exec.d.ts.map +1 -1
  80. package/dist/core/exec.js.map +1 -1
  81. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  82. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  83. package/dist/core/export-html/index.d.ts.map +1 -1
  84. package/dist/core/export-html/index.js.map +1 -1
  85. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  86. package/dist/core/export-html/tool-renderer.js.map +1 -1
  87. package/dist/core/extensions/builtin/anthropic-bash/index.d.ts.map +1 -1
  88. package/dist/core/extensions/builtin/anthropic-bash/index.js.map +1 -1
  89. package/dist/core/extensions/builtin/anthropic-web-search/index.d.ts.map +1 -1
  90. package/dist/core/extensions/builtin/anthropic-web-search/index.js.map +1 -1
  91. package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
  92. package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
  93. package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
  94. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  95. package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
  96. package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
  97. package/dist/core/extensions/builtin/compaction/circuit-breaker.d.ts.map +1 -1
  98. package/dist/core/extensions/builtin/compaction/circuit-breaker.js.map +1 -1
  99. package/dist/core/extensions/builtin/compaction/context-reduction.d.ts.map +1 -1
  100. package/dist/core/extensions/builtin/compaction/context-reduction.js +1 -1
  101. package/dist/core/extensions/builtin/compaction/context-reduction.js.map +1 -1
  102. package/dist/core/extensions/builtin/compaction/degradation-monitor.d.ts.map +1 -1
  103. package/dist/core/extensions/builtin/compaction/degradation-monitor.js.map +1 -1
  104. package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
  105. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  106. package/dist/core/extensions/builtin/compaction/openai-remote.d.ts.map +1 -1
  107. package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
  108. package/dist/core/extensions/builtin/compaction/overflow-detection.d.ts.map +1 -1
  109. package/dist/core/extensions/builtin/compaction/overflow-detection.js.map +1 -1
  110. package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
  111. package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
  112. package/dist/core/extensions/builtin/compaction/policy.d.ts.map +1 -1
  113. package/dist/core/extensions/builtin/compaction/policy.js.map +1 -1
  114. package/dist/core/extensions/builtin/compaction/prompts.d.ts.map +1 -1
  115. package/dist/core/extensions/builtin/compaction/prompts.js.map +1 -1
  116. package/dist/core/extensions/builtin/compaction/repair-tool-pairs.d.ts.map +1 -1
  117. package/dist/core/extensions/builtin/compaction/repair-tool-pairs.js.map +1 -1
  118. package/dist/core/extensions/builtin/compaction/restoration-tracker.d.ts.map +1 -1
  119. package/dist/core/extensions/builtin/compaction/restoration-tracker.js.map +1 -1
  120. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  121. package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
  122. package/dist/core/extensions/builtin/compaction/state.d.ts.map +1 -1
  123. package/dist/core/extensions/builtin/compaction/state.js.map +1 -1
  124. package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
  125. package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
  126. package/dist/core/extensions/builtin/compaction/tool-truncation.d.ts.map +1 -1
  127. package/dist/core/extensions/builtin/compaction/tool-truncation.js.map +1 -1
  128. package/dist/core/extensions/builtin/diff.d.ts.map +1 -1
  129. package/dist/core/extensions/builtin/diff.js.map +1 -1
  130. package/dist/core/extensions/builtin/files.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/files.js.map +1 -1
  132. package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
  133. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  134. package/dist/core/extensions/builtin/gpt-apply-patch/constants.d.ts.map +1 -1
  135. package/dist/core/extensions/builtin/gpt-apply-patch/constants.js.map +1 -1
  136. package/dist/core/extensions/builtin/gpt-apply-patch/errors.d.ts.map +1 -1
  137. package/dist/core/extensions/builtin/gpt-apply-patch/errors.js +0 -2
  138. package/dist/core/extensions/builtin/gpt-apply-patch/errors.js.map +1 -1
  139. package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
  140. package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
  141. package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
  142. package/dist/core/extensions/builtin/gpt-apply-patch/params.d.ts.map +1 -1
  143. package/dist/core/extensions/builtin/gpt-apply-patch/params.js.map +1 -1
  144. package/dist/core/extensions/builtin/gpt-apply-patch/parser.d.ts.map +1 -1
  145. package/dist/core/extensions/builtin/gpt-apply-patch/parser.js.map +1 -1
  146. package/dist/core/extensions/builtin/gpt-apply-patch/patch-diff.d.ts.map +1 -1
  147. package/dist/core/extensions/builtin/gpt-apply-patch/patch-diff.js.map +1 -1
  148. package/dist/core/extensions/builtin/gpt-apply-patch/patch-replace.d.ts.map +1 -1
  149. package/dist/core/extensions/builtin/gpt-apply-patch/patch-replace.js.map +1 -1
  150. package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.d.ts.map +1 -1
  151. package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.js.map +1 -1
  152. package/dist/core/extensions/builtin/gpt-apply-patch/preview.d.ts.map +1 -1
  153. package/dist/core/extensions/builtin/gpt-apply-patch/preview.js.map +1 -1
  154. package/dist/core/extensions/builtin/gpt-apply-patch/seek-sequence.d.ts.map +1 -1
  155. package/dist/core/extensions/builtin/gpt-apply-patch/seek-sequence.js.map +1 -1
  156. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.d.ts.map +1 -1
  157. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.js +7 -5
  158. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.js.map +1 -1
  159. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-render.d.ts.map +1 -1
  160. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-render.js.map +1 -1
  161. package/dist/core/extensions/builtin/gpt-apply-patch/text.d.ts.map +1 -1
  162. package/dist/core/extensions/builtin/gpt-apply-patch/text.js.map +1 -1
  163. package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
  164. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  165. package/dist/core/extensions/builtin/gpt-apply-patch/types.d.ts.map +1 -1
  166. package/dist/core/extensions/builtin/gpt-apply-patch/workspace.d.ts.map +1 -1
  167. package/dist/core/extensions/builtin/gpt-apply-patch/workspace.js.map +1 -1
  168. package/dist/core/extensions/builtin/history-search/filter.d.ts.map +1 -1
  169. package/dist/core/extensions/builtin/history-search/filter.js.map +1 -1
  170. package/dist/core/extensions/builtin/history-search/index.d.ts.map +1 -1
  171. package/dist/core/extensions/builtin/history-search/index.js.map +1 -1
  172. package/dist/core/extensions/builtin/history-search/indexer.d.ts.map +1 -1
  173. package/dist/core/extensions/builtin/history-search/indexer.js.map +1 -1
  174. package/dist/core/extensions/builtin/history-search/overlay.d.ts.map +1 -1
  175. package/dist/core/extensions/builtin/history-search/overlay.js +3 -6
  176. package/dist/core/extensions/builtin/history-search/overlay.js.map +1 -1
  177. package/dist/core/extensions/builtin/history-search/types.d.ts.map +1 -1
  178. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  179. package/dist/core/extensions/builtin/kimi-web-search/index.d.ts.map +1 -1
  180. package/dist/core/extensions/builtin/kimi-web-search/index.js.map +1 -1
  181. package/dist/core/extensions/builtin/openai-web-search/index.d.ts.map +1 -1
  182. package/dist/core/extensions/builtin/openai-web-search/index.js.map +1 -1
  183. package/dist/core/extensions/builtin/permission-system/arity.d.ts.map +1 -1
  184. package/dist/core/extensions/builtin/permission-system/arity.js.map +1 -1
  185. package/dist/core/extensions/builtin/permission-system/cli.d.ts.map +1 -1
  186. package/dist/core/extensions/builtin/permission-system/cli.js.map +1 -1
  187. package/dist/core/extensions/builtin/permission-system/config.d.ts.map +1 -1
  188. package/dist/core/extensions/builtin/permission-system/config.js.map +1 -1
  189. package/dist/core/extensions/builtin/permission-system/evaluate.d.ts.map +1 -1
  190. package/dist/core/extensions/builtin/permission-system/evaluate.js.map +1 -1
  191. package/dist/core/extensions/builtin/permission-system/events.d.ts.map +1 -1
  192. package/dist/core/extensions/builtin/permission-system/events.js.map +1 -1
  193. package/dist/core/extensions/builtin/permission-system/external-dir.d.ts.map +1 -1
  194. package/dist/core/extensions/builtin/permission-system/external-dir.js.map +1 -1
  195. package/dist/core/extensions/builtin/permission-system/index.d.ts.map +1 -1
  196. package/dist/core/extensions/builtin/permission-system/index.js.map +1 -1
  197. package/dist/core/extensions/builtin/permission-system/non-interactive.d.ts.map +1 -1
  198. package/dist/core/extensions/builtin/permission-system/non-interactive.js.map +1 -1
  199. package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
  200. package/dist/core/extensions/builtin/permission-system/parsers.js +3 -1
  201. package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
  202. package/dist/core/extensions/builtin/permission-system/prompt.d.ts.map +1 -1
  203. package/dist/core/extensions/builtin/permission-system/prompt.js.map +1 -1
  204. package/dist/core/extensions/builtin/permission-system/service.d.ts.map +1 -1
  205. package/dist/core/extensions/builtin/permission-system/service.js +2 -5
  206. package/dist/core/extensions/builtin/permission-system/service.js.map +1 -1
  207. package/dist/core/extensions/builtin/permission-system/settings.d.ts.map +1 -1
  208. package/dist/core/extensions/builtin/permission-system/settings.js.map +1 -1
  209. package/dist/core/extensions/builtin/permission-system/storage.d.ts.map +1 -1
  210. package/dist/core/extensions/builtin/permission-system/storage.js.map +1 -1
  211. package/dist/core/extensions/builtin/permission-system/types.d.ts.map +1 -1
  212. package/dist/core/extensions/builtin/permission-system/types.js +3 -5
  213. package/dist/core/extensions/builtin/permission-system/types.js.map +1 -1
  214. package/dist/core/extensions/builtin/permission-system/wildcard.d.ts.map +1 -1
  215. package/dist/core/extensions/builtin/permission-system/wildcard.js.map +1 -1
  216. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
  217. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
  218. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
  219. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
  220. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
  221. package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
  222. package/dist/core/extensions/builtin/prompt-preset/file-operations.d.ts.map +1 -1
  223. package/dist/core/extensions/builtin/prompt-preset/file-operations.js.map +1 -1
  224. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.d.ts.map +1 -1
  225. package/dist/core/extensions/builtin/prompt-preset/gpt-5.2.js.map +1 -1
  226. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.d.ts.map +1 -1
  227. package/dist/core/extensions/builtin/prompt-preset/gpt-5.3-codex.js.map +1 -1
  228. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.d.ts.map +1 -1
  229. package/dist/core/extensions/builtin/prompt-preset/gpt-5.4.js.map +1 -1
  230. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.d.ts.map +1 -1
  231. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js.map +1 -1
  232. package/dist/core/extensions/builtin/prompt-preset/gpt-5.d.ts.map +1 -1
  233. package/dist/core/extensions/builtin/prompt-preset/gpt-5.js.map +1 -1
  234. package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
  235. package/dist/core/extensions/builtin/prompt-preset/index.js.map +1 -1
  236. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
  237. package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
  238. package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
  239. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  240. package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
  241. package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
  242. package/dist/core/extensions/builtin/prompt-url-widget.d.ts.map +1 -1
  243. package/dist/core/extensions/builtin/prompt-url-widget.js.map +1 -1
  244. package/dist/core/extensions/builtin/redraws.d.ts.map +1 -1
  245. package/dist/core/extensions/builtin/redraws.js.map +1 -1
  246. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  247. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  248. package/dist/core/extensions/builtin/session-observer/index.d.ts.map +1 -1
  249. package/dist/core/extensions/builtin/session-observer/index.js.map +1 -1
  250. package/dist/core/extensions/builtin/session-observer/loader.d.ts.map +1 -1
  251. package/dist/core/extensions/builtin/session-observer/loader.js.map +1 -1
  252. package/dist/core/extensions/builtin/session-observer/overlay-format.d.ts.map +1 -1
  253. package/dist/core/extensions/builtin/session-observer/overlay-format.js.map +1 -1
  254. package/dist/core/extensions/builtin/session-observer/overlay.d.ts.map +1 -1
  255. package/dist/core/extensions/builtin/session-observer/overlay.js +13 -18
  256. package/dist/core/extensions/builtin/session-observer/overlay.js.map +1 -1
  257. package/dist/core/extensions/builtin/session-observer/scanner.d.ts.map +1 -1
  258. package/dist/core/extensions/builtin/session-observer/scanner.js.map +1 -1
  259. package/dist/core/extensions/builtin/session-observer/text.d.ts.map +1 -1
  260. package/dist/core/extensions/builtin/session-observer/text.js.map +1 -1
  261. package/dist/core/extensions/builtin/session-observer/transcript-entries.d.ts.map +1 -1
  262. package/dist/core/extensions/builtin/session-observer/transcript-entries.js.map +1 -1
  263. package/dist/core/extensions/builtin/session-observer/transcript-format.d.ts.map +1 -1
  264. package/dist/core/extensions/builtin/session-observer/transcript-format.js.map +1 -1
  265. package/dist/core/extensions/builtin/session-observer/transcript.d.ts.map +1 -1
  266. package/dist/core/extensions/builtin/session-observer/transcript.js.map +1 -1
  267. package/dist/core/extensions/builtin/session-observer/types.d.ts.map +1 -1
  268. package/dist/core/extensions/builtin/system-messages.d.ts.map +1 -1
  269. package/dist/core/extensions/builtin/system-messages.js.map +1 -1
  270. package/dist/core/extensions/builtin/todotools/continuation/config.d.ts +1 -1
  271. package/dist/core/extensions/builtin/todotools/continuation/config.d.ts.map +1 -1
  272. package/dist/core/extensions/builtin/todotools/continuation/config.js.map +1 -1
  273. package/dist/core/extensions/builtin/todotools/continuation/index.d.ts.map +1 -1
  274. package/dist/core/extensions/builtin/todotools/continuation/prompt.d.ts.map +1 -1
  275. package/dist/core/extensions/builtin/todotools/continuation/prompt.js.map +1 -1
  276. package/dist/core/extensions/builtin/todotools/continuation/runtime.d.ts.map +1 -1
  277. package/dist/core/extensions/builtin/todotools/continuation/runtime.js.map +1 -1
  278. package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
  279. package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
  280. package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
  281. package/dist/core/extensions/builtin/todotools/settings.d.ts.map +1 -1
  282. package/dist/core/extensions/builtin/todotools/settings.js.map +1 -1
  283. package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
  284. package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
  285. package/dist/core/extensions/builtin/todotools/system-messages.d.ts.map +1 -1
  286. package/dist/core/extensions/builtin/todotools/system-messages.js.map +1 -1
  287. package/dist/core/extensions/builtin/todotools/tools/todoread.d.ts.map +1 -1
  288. package/dist/core/extensions/builtin/todotools/tools/todoread.js.map +1 -1
  289. package/dist/core/extensions/builtin/todotools/tools/todowrite.d.ts.map +1 -1
  290. package/dist/core/extensions/builtin/todotools/tools/todowrite.js.map +1 -1
  291. package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
  292. package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
  293. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +1 -1
  294. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +1 -1
  295. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-chat-completions-payload.d.ts.map +1 -1
  296. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-chat-completions-payload.js.map +1 -1
  297. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-responses-payload.d.ts.map +1 -1
  298. package/dist/core/extensions/builtin/tool-pair-guard/sanitize-openai-responses-payload.js.map +1 -1
  299. package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
  300. package/dist/core/extensions/builtin/tps.js.map +1 -1
  301. package/dist/core/extensions/index.d.ts.map +1 -1
  302. package/dist/core/extensions/loader.d.ts.map +1 -1
  303. package/dist/core/extensions/loader.js.map +1 -1
  304. package/dist/core/extensions/runner.d.ts.map +1 -1
  305. package/dist/core/extensions/runner.js +35 -43
  306. package/dist/core/extensions/runner.js.map +1 -1
  307. package/dist/core/extensions/types.d.ts +1 -1
  308. package/dist/core/extensions/types.d.ts.map +1 -1
  309. package/dist/core/extensions/types.js.map +1 -1
  310. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  311. package/dist/core/extensions/wrapper.js.map +1 -1
  312. package/dist/core/footer-data-provider.d.ts.map +1 -1
  313. package/dist/core/footer-data-provider.js +17 -18
  314. package/dist/core/footer-data-provider.js.map +1 -1
  315. package/dist/core/http-dispatcher.d.ts.map +1 -1
  316. package/dist/core/http-dispatcher.js.map +1 -1
  317. package/dist/core/index.d.ts.map +1 -1
  318. package/dist/core/keybindings.d.ts +1 -1
  319. package/dist/core/keybindings.d.ts.map +1 -1
  320. package/dist/core/keybindings.js +0 -1
  321. package/dist/core/keybindings.js.map +1 -1
  322. package/dist/core/messages.d.ts.map +1 -1
  323. package/dist/core/messages.js.map +1 -1
  324. package/dist/core/model-registry.d.ts.map +1 -1
  325. package/dist/core/model-registry.js +8 -10
  326. package/dist/core/model-registry.js.map +1 -1
  327. package/dist/core/model-resolver.d.ts.map +1 -1
  328. package/dist/core/model-resolver.js.map +1 -1
  329. package/dist/core/output-guard.d.ts.map +1 -1
  330. package/dist/core/output-guard.js.map +1 -1
  331. package/dist/core/package-manager.d.ts +1 -0
  332. package/dist/core/package-manager.d.ts.map +1 -1
  333. package/dist/core/package-manager.js +25 -13
  334. package/dist/core/package-manager.js.map +1 -1
  335. package/dist/core/prompt-templates.d.ts.map +1 -1
  336. package/dist/core/prompt-templates.js.map +1 -1
  337. package/dist/core/provider-attribution.d.ts.map +1 -1
  338. package/dist/core/provider-attribution.js.map +1 -1
  339. package/dist/core/provider-display-names.d.ts.map +1 -1
  340. package/dist/core/resolve-config-value.d.ts.map +1 -1
  341. package/dist/core/resolve-config-value.js.map +1 -1
  342. package/dist/core/resource-loader.d.ts +1 -0
  343. package/dist/core/resource-loader.d.ts.map +1 -1
  344. package/dist/core/resource-loader.js +26 -53
  345. package/dist/core/resource-loader.js.map +1 -1
  346. package/dist/core/sdk.d.ts.map +1 -1
  347. package/dist/core/sdk.js.map +1 -1
  348. package/dist/core/session-cwd.d.ts.map +1 -1
  349. package/dist/core/session-cwd.js +0 -1
  350. package/dist/core/session-cwd.js.map +1 -1
  351. package/dist/core/session-manager.d.ts.map +1 -1
  352. package/dist/core/session-manager.js +7 -11
  353. package/dist/core/session-manager.js.map +1 -1
  354. package/dist/core/session-work-barrier.d.ts.map +1 -1
  355. package/dist/core/session-work-barrier.js +5 -3
  356. package/dist/core/session-work-barrier.js.map +1 -1
  357. package/dist/core/settings-manager.d.ts +10 -2
  358. package/dist/core/settings-manager.d.ts.map +1 -1
  359. package/dist/core/settings-manager.js +77 -46
  360. package/dist/core/settings-manager.js.map +1 -1
  361. package/dist/core/skills.d.ts.map +1 -1
  362. package/dist/core/skills.js.map +1 -1
  363. package/dist/core/slash-commands.d.ts.map +1 -1
  364. package/dist/core/slash-commands.js +1 -0
  365. package/dist/core/slash-commands.js.map +1 -1
  366. package/dist/core/source-info.d.ts.map +1 -1
  367. package/dist/core/source-info.js.map +1 -1
  368. package/dist/core/system-prompt.d.ts.map +1 -1
  369. package/dist/core/system-prompt.js.map +1 -1
  370. package/dist/core/telemetry.d.ts.map +1 -1
  371. package/dist/core/telemetry.js.map +1 -1
  372. package/dist/core/thinking-levels.d.ts.map +1 -1
  373. package/dist/core/thinking-levels.js.map +1 -1
  374. package/dist/core/timings.d.ts.map +1 -1
  375. package/dist/core/timings.js.map +1 -1
  376. package/dist/core/tools/bash.d.ts.map +1 -1
  377. package/dist/core/tools/bash.js +9 -6
  378. package/dist/core/tools/bash.js.map +1 -1
  379. package/dist/core/tools/diff-render.d.ts.map +1 -1
  380. package/dist/core/tools/diff-render.js.map +1 -1
  381. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  382. package/dist/core/tools/edit-diff.js.map +1 -1
  383. package/dist/core/tools/edit.d.ts.map +1 -1
  384. package/dist/core/tools/edit.js.map +1 -1
  385. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  386. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  387. package/dist/core/tools/find.d.ts.map +1 -1
  388. package/dist/core/tools/find.js +1 -1
  389. package/dist/core/tools/find.js.map +1 -1
  390. package/dist/core/tools/grep.d.ts.map +1 -1
  391. package/dist/core/tools/grep.js +1 -1
  392. package/dist/core/tools/grep.js.map +1 -1
  393. package/dist/core/tools/index.d.ts.map +1 -1
  394. package/dist/core/tools/index.js.map +1 -1
  395. package/dist/core/tools/ls.d.ts.map +1 -1
  396. package/dist/core/tools/ls.js +1 -1
  397. package/dist/core/tools/ls.js.map +1 -1
  398. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  399. package/dist/core/tools/output-accumulator.js +12 -18
  400. package/dist/core/tools/output-accumulator.js.map +1 -1
  401. package/dist/core/tools/path-utils.d.ts.map +1 -1
  402. package/dist/core/tools/path-utils.js.map +1 -1
  403. package/dist/core/tools/read.d.ts.map +1 -1
  404. package/dist/core/tools/read.js +1 -1
  405. package/dist/core/tools/read.js.map +1 -1
  406. package/dist/core/tools/render-utils.d.ts.map +1 -1
  407. package/dist/core/tools/render-utils.js.map +1 -1
  408. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  409. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  410. package/dist/core/tools/truncate.d.ts.map +1 -1
  411. package/dist/core/tools/truncate.js.map +1 -1
  412. package/dist/core/tools/write.d.ts.map +1 -1
  413. package/dist/core/tools/write.js +1 -2
  414. package/dist/core/tools/write.js.map +1 -1
  415. package/dist/core/trust-manager.d.ts +9 -0
  416. package/dist/core/trust-manager.d.ts.map +1 -0
  417. package/dist/core/trust-manager.js +133 -0
  418. package/dist/core/trust-manager.js.map +1 -0
  419. package/dist/index.d.ts +2 -1
  420. package/dist/index.d.ts.map +1 -1
  421. package/dist/index.js +1 -0
  422. package/dist/index.js.map +1 -1
  423. package/dist/main.d.ts.map +1 -1
  424. package/dist/main.js +54 -2
  425. package/dist/main.js.map +1 -1
  426. package/dist/migrations.d.ts.map +1 -1
  427. package/dist/migrations.js.map +1 -1
  428. package/dist/modes/index.d.ts.map +1 -1
  429. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  430. package/dist/modes/interactive/components/armin.js +6 -10
  431. package/dist/modes/interactive/components/armin.js.map +1 -1
  432. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  433. package/dist/modes/interactive/components/assistant-message.js +2 -11
  434. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  435. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  436. package/dist/modes/interactive/components/bash-execution.js +6 -11
  437. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  438. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/bordered-loader.js +0 -3
  440. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  441. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  442. package/dist/modes/interactive/components/branch-summary-message.js +1 -3
  443. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  444. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  445. package/dist/modes/interactive/components/compaction-summary-message.js +1 -3
  446. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  447. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  448. package/dist/modes/interactive/components/config-selector.js +5 -15
  449. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  450. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  451. package/dist/modes/interactive/components/countdown-timer.js +0 -5
  452. package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
  453. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  454. package/dist/modes/interactive/components/custom-editor.js +1 -8
  455. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  456. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  457. package/dist/modes/interactive/components/custom-message.js +1 -6
  458. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  459. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  460. package/dist/modes/interactive/components/daxnuts.js +6 -8
  461. package/dist/modes/interactive/components/daxnuts.js.map +1 -1
  462. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/diff.js +2 -2
  464. package/dist/modes/interactive/components/diff.js.map +1 -1
  465. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  466. package/dist/modes/interactive/components/dynamic-border.js +0 -1
  467. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  468. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  469. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  470. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  471. package/dist/modes/interactive/components/extension-editor.js +1 -6
  472. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  473. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  474. package/dist/modes/interactive/components/extension-input.js +2 -8
  475. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  476. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/extension-selector.js +1 -9
  478. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  479. package/dist/modes/interactive/components/favorite-models-selector.d.ts.map +1 -1
  480. package/dist/modes/interactive/components/favorite-models-selector.js +9 -15
  481. package/dist/modes/interactive/components/favorite-models-selector.js.map +1 -1
  482. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  483. package/dist/modes/interactive/components/footer.js +10 -3
  484. package/dist/modes/interactive/components/footer.js.map +1 -1
  485. package/dist/modes/interactive/components/index.d.ts +1 -0
  486. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  487. package/dist/modes/interactive/components/index.js +1 -0
  488. package/dist/modes/interactive/components/index.js.map +1 -1
  489. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  490. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  491. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  492. package/dist/modes/interactive/components/login-dialog.js +3 -9
  493. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  494. package/dist/modes/interactive/components/model-favorites.d.ts.map +1 -1
  495. package/dist/modes/interactive/components/model-favorites.js.map +1 -1
  496. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  497. package/dist/modes/interactive/components/model-selector.js +9 -22
  498. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  499. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/oauth-selector.js +3 -12
  501. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  502. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  504. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  505. package/dist/modes/interactive/components/session-selector.js +33 -58
  506. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  507. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  508. package/dist/modes/interactive/components/settings-selector.js +0 -4
  509. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  510. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/show-images-selector.js +0 -1
  512. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  513. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  514. package/dist/modes/interactive/components/skill-invocation-message.js +1 -3
  515. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  516. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  517. package/dist/modes/interactive/components/theme-selector.js +0 -2
  518. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  519. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/thinking-selector.js +0 -1
  521. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  522. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/tool-execution.js +9 -28
  524. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  525. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/tree-selector.js +18 -32
  527. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  528. package/dist/modes/interactive/components/trust-selector.d.ts +20 -0
  529. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
  530. package/dist/modes/interactive/components/trust-selector.js +81 -0
  531. package/dist/modes/interactive/components/trust-selector.js.map +1 -0
  532. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  533. package/dist/modes/interactive/components/user-message-selector.js +3 -6
  534. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  535. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  536. package/dist/modes/interactive/components/user-message.js +0 -1
  537. package/dist/modes/interactive/components/user-message.js.map +1 -1
  538. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  539. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  540. package/dist/modes/interactive/interactive-mode.d.ts +24 -0
  541. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  542. package/dist/modes/interactive/interactive-mode.js +112 -101
  543. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  544. package/dist/modes/interactive/session-info-format.d.ts.map +1 -1
  545. package/dist/modes/interactive/session-info-format.js.map +1 -1
  546. package/dist/modes/interactive/startup-tools.d.ts.map +1 -1
  547. package/dist/modes/interactive/startup-tools.js.map +1 -1
  548. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  549. package/dist/modes/interactive/theme/theme.js +0 -6
  550. package/dist/modes/interactive/theme/theme.js.map +1 -1
  551. package/dist/modes/interactive/working-status.d.ts.map +1 -1
  552. package/dist/modes/interactive/working-status.js.map +1 -1
  553. package/dist/modes/print-mode.d.ts.map +1 -1
  554. package/dist/modes/print-mode.js.map +1 -1
  555. package/dist/modes/provider-native-rendering.d.ts.map +1 -1
  556. package/dist/modes/provider-native-rendering.js.map +1 -1
  557. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  558. package/dist/modes/rpc/jsonl.js.map +1 -1
  559. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  560. package/dist/modes/rpc/rpc-client.js +7 -8
  561. package/dist/modes/rpc/rpc-client.js.map +1 -1
  562. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  563. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  564. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  565. package/dist/package-manager-cli.d.ts.map +1 -1
  566. package/dist/package-manager-cli.js +56 -9
  567. package/dist/package-manager-cli.js.map +1 -1
  568. package/dist/self-update-bootstrap.d.ts.map +1 -1
  569. package/dist/self-update-bootstrap.js.map +1 -1
  570. package/dist/utils/ansi.d.ts.map +1 -1
  571. package/dist/utils/ansi.js.map +1 -1
  572. package/dist/utils/changelog.d.ts.map +1 -1
  573. package/dist/utils/changelog.js.map +1 -1
  574. package/dist/utils/child-process.d.ts.map +1 -1
  575. package/dist/utils/child-process.js.map +1 -1
  576. package/dist/utils/clipboard-image.d.ts.map +1 -1
  577. package/dist/utils/clipboard-image.js.map +1 -1
  578. package/dist/utils/clipboard-native.d.ts.map +1 -1
  579. package/dist/utils/clipboard-native.js.map +1 -1
  580. package/dist/utils/clipboard.d.ts.map +1 -1
  581. package/dist/utils/clipboard.js.map +1 -1
  582. package/dist/utils/deprecation.d.ts.map +1 -1
  583. package/dist/utils/deprecation.js.map +1 -1
  584. package/dist/utils/exif-orientation.d.ts.map +1 -1
  585. package/dist/utils/exif-orientation.js.map +1 -1
  586. package/dist/utils/frontmatter.d.ts.map +1 -1
  587. package/dist/utils/frontmatter.js.map +1 -1
  588. package/dist/utils/fs-watch.d.ts.map +1 -1
  589. package/dist/utils/fs-watch.js.map +1 -1
  590. package/dist/utils/git.d.ts.map +1 -1
  591. package/dist/utils/git.js.map +1 -1
  592. package/dist/utils/html.d.ts.map +1 -1
  593. package/dist/utils/html.js.map +1 -1
  594. package/dist/utils/image-convert.d.ts.map +1 -1
  595. package/dist/utils/image-convert.js.map +1 -1
  596. package/dist/utils/image-resize-core.d.ts.map +1 -1
  597. package/dist/utils/image-resize-core.js.map +1 -1
  598. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  599. package/dist/utils/image-resize-worker.js.map +1 -1
  600. package/dist/utils/image-resize.d.ts.map +1 -1
  601. package/dist/utils/image-resize.js.map +1 -1
  602. package/dist/utils/json.d.ts.map +1 -1
  603. package/dist/utils/json.js.map +1 -1
  604. package/dist/utils/mime.d.ts.map +1 -1
  605. package/dist/utils/mime.js.map +1 -1
  606. package/dist/utils/open-browser.d.ts.map +1 -1
  607. package/dist/utils/open-browser.js.map +1 -1
  608. package/dist/utils/paths.d.ts.map +1 -1
  609. package/dist/utils/paths.js.map +1 -1
  610. package/dist/utils/photon.d.ts.map +1 -1
  611. package/dist/utils/photon.js.map +1 -1
  612. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  613. package/dist/utils/pi-user-agent.js.map +1 -1
  614. package/dist/utils/shell.d.ts.map +1 -1
  615. package/dist/utils/shell.js.map +1 -1
  616. package/dist/utils/sleep.d.ts.map +1 -1
  617. package/dist/utils/sleep.js.map +1 -1
  618. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  619. package/dist/utils/syntax-highlight.js.map +1 -1
  620. package/dist/utils/tools-manager.d.ts.map +1 -1
  621. package/dist/utils/tools-manager.js.map +1 -1
  622. package/dist/utils/version-check.d.ts.map +1 -1
  623. package/dist/utils/version-check.js.map +1 -1
  624. package/dist/utils/windows-self-update.d.ts.map +1 -1
  625. package/dist/utils/windows-self-update.js.map +1 -1
  626. package/docs/extensions.md +1 -1
  627. package/docs/packages.md +3 -1
  628. package/docs/prompt-templates.md +1 -1
  629. package/docs/settings.md +10 -0
  630. package/docs/skills.md +3 -3
  631. package/docs/themes.md +1 -1
  632. package/docs/usage.md +15 -3
  633. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  634. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  635. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  636. package/examples/extensions/gondolin/package-lock.json +2 -2
  637. package/examples/extensions/gondolin/package.json +1 -1
  638. package/examples/extensions/minimal-mode.ts +6 -6
  639. package/examples/extensions/sandbox/package-lock.json +2 -2
  640. package/examples/extensions/sandbox/package.json +1 -1
  641. package/examples/extensions/with-deps/package-lock.json +2 -2
  642. package/examples/extensions/with-deps/package.json +1 -1
  643. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  644. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  645. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +7 -0
  646. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  647. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +2 -27
  648. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  649. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  650. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +7 -20
  651. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  652. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  653. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  654. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  655. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  656. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts.map +1 -1
  657. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js.map +1 -1
  658. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  659. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +0 -3
  660. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  661. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  662. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  663. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
  664. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  665. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -1
  666. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -3
  667. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +1 -1
  668. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -1
  669. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -7
  670. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +1 -1
  671. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -1
  672. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +3 -1
  673. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +1 -1
  674. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -1
  675. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -5
  676. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +1 -1
  677. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -1
  678. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +1 -1
  679. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  680. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +0 -1
  681. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  682. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.d.ts.map +1 -1
  683. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/uuid.js.map +1 -1
  684. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
  685. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
  686. package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.d.ts.map +1 -1
  687. package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js.map +1 -1
  688. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  689. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +0 -16
  690. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  691. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
  692. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
  693. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
  694. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  695. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  696. package/node_modules/@earendil-works/pi-agent-core/dist/node.d.ts.map +1 -1
  697. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  698. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  699. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  700. package/node_modules/@earendil-works/pi-agent-core/package.json +6 -6
  701. package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +1 -1
  702. package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +1 -1
  703. package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts.map +1 -1
  704. package/node_modules/@earendil-works/pi-ai/dist/cli.d.ts.map +1 -1
  705. package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -1
  706. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  707. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  708. package/node_modules/@earendil-works/pi-ai/dist/image-models.d.ts.map +1 -1
  709. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +30 -0
  710. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  711. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
  712. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  713. package/node_modules/@earendil-works/pi-ai/dist/image-models.js.map +1 -1
  714. package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts.map +1 -1
  715. package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js.map +1 -1
  716. package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -1
  717. package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -1
  718. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  719. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  720. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +174 -29
  721. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  722. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +178 -54
  723. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  724. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  725. package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -1
  726. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  727. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  728. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  729. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  730. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  731. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  732. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts.map +1 -1
  733. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js.map +1 -1
  734. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  735. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  736. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts.map +1 -1
  737. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js.map +1 -1
  738. package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
  739. package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -1
  740. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
  741. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
  742. package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -1
  743. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
  744. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -1
  745. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -1
  746. package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts.map +1 -1
  747. package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js.map +1 -1
  748. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -1
  749. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +3 -3
  750. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -1
  751. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  752. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +0 -7
  753. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  754. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  755. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
  756. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  757. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -1
  758. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js.map +1 -1
  759. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
  760. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
  761. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  762. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
  763. package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
  764. package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js.map +1 -1
  765. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  766. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
  767. package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts.map +1 -1
  768. package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js.map +1 -1
  769. package/node_modules/@earendil-works/pi-ai/dist/session-resources.d.ts.map +1 -1
  770. package/node_modules/@earendil-works/pi-ai/dist/session-resources.js.map +1 -1
  771. package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -1
  772. package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -1
  773. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.d.ts.map +1 -1
  774. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
  775. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.d.ts.map +1 -1
  776. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/index.js.map +1 -1
  777. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.d.ts.map +1 -1
  778. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js +10 -8
  779. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/gemma4.js.map +1 -1
  780. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.d.ts.map +1 -1
  781. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/hermes.js.map +1 -1
  782. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.d.ts.map +1 -1
  783. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/json-mix.js.map +1 -1
  784. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.d.ts.map +1 -1
  785. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/morph-xml.js.map +1 -1
  786. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.d.ts.map +1 -1
  787. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/xml-tool-tag-scanner.js.map +1 -1
  788. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.d.ts.map +1 -1
  789. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/yaml-xml.js.map +1 -1
  790. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.d.ts.map +1 -1
  791. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
  792. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/types.d.ts.map +1 -1
  793. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +1 -1
  794. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  795. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  796. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.d.ts.map +1 -1
  797. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js.map +1 -1
  798. package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.d.ts.map +1 -1
  799. package/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js.map +1 -1
  800. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  801. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +3 -7
  802. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
  803. package/node_modules/@earendil-works/pi-ai/dist/utils/hash.d.ts.map +1 -1
  804. package/node_modules/@earendil-works/pi-ai/dist/utils/hash.js.map +1 -1
  805. package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts.map +1 -1
  806. package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js.map +1 -1
  807. package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.d.ts.map +1 -1
  808. package/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js.map +1 -1
  809. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -1
  810. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -1
  811. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -1
  812. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +1 -1
  813. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
  814. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
  815. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  816. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  817. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
  818. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -1
  820. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +1 -1
  821. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  822. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  823. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +1 -1
  824. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +1 -1
  825. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +1 -1
  826. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  827. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  828. package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js.map +1 -1
  830. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.d.ts.map +1 -1
  831. package/node_modules/@earendil-works/pi-ai/dist/utils/tool-pair-repair.js.map +1 -1
  832. package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.d.ts.map +1 -1
  833. package/node_modules/@earendil-works/pi-ai/dist/utils/typebox-helpers.js.map +1 -1
  834. package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts.map +1 -1
  835. package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -1
  836. package/node_modules/@earendil-works/pi-ai/package.json +5 -5
  837. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -1
  838. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  839. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +0 -3
  840. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  841. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  842. package/node_modules/@earendil-works/pi-tui/dist/components/box.js +1 -6
  843. package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
  844. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -1
  845. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +4 -3
  846. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -1
  847. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  848. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +43 -54
  849. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  850. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  851. package/node_modules/@earendil-works/pi-tui/dist/components/image.js +0 -8
  852. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  853. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  854. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +14 -14
  855. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  856. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  857. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +11 -13
  858. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  859. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  860. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +0 -11
  861. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  862. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  863. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +4 -9
  864. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  865. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  866. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +4 -12
  867. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  868. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -1
  869. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +0 -1
  870. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -1
  871. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  872. package/node_modules/@earendil-works/pi-tui/dist/components/text.js +0 -8
  873. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  874. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -1
  875. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +0 -3
  876. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -1
  877. package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -1
  878. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -1
  879. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -1
  880. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  881. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  882. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -4
  883. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  884. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  885. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  886. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -1
  887. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +3 -1
  888. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -1
  889. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  890. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  891. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
  892. package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
  893. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  894. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +4 -6
  895. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  896. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  897. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  898. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  899. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +24 -29
  900. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  901. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  902. package/node_modules/@earendil-works/pi-tui/dist/tui.js +25 -27
  903. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  904. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -1
  905. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +3 -1
  906. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -1
  907. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  908. package/node_modules/@earendil-works/pi-tui/dist/utils.js +14 -12
  909. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  910. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +1 -1
  911. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +1 -1
  912. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  913. package/node_modules/@types/node/README.md +3 -3
  914. package/node_modules/@types/node/assert/strict.d.ts +3 -55
  915. package/node_modules/@types/node/assert.d.ts +49 -177
  916. package/node_modules/@types/node/async_hooks.d.ts +151 -43
  917. package/node_modules/@types/node/buffer.buffer.d.ts +2 -8
  918. package/node_modules/@types/node/buffer.d.ts +43 -212
  919. package/node_modules/@types/node/child_process.d.ts +23 -133
  920. package/node_modules/@types/node/cluster.d.ts +238 -384
  921. package/node_modules/@types/node/compatibility/iterators.d.ts +1 -0
  922. package/node_modules/@types/node/console.d.ts +45 -404
  923. package/node_modules/@types/node/constants.d.ts +3 -10
  924. package/node_modules/@types/node/crypto.d.ts +640 -1127
  925. package/node_modules/@types/node/dgram.d.ts +14 -77
  926. package/node_modules/@types/node/diagnostics_channel.d.ts +3 -29
  927. package/node_modules/@types/node/dns/promises.d.ts +4 -10
  928. package/node_modules/@types/node/dns.d.ts +130 -177
  929. package/node_modules/@types/node/domain.d.ts +12 -32
  930. package/node_modules/@types/node/events.d.ts +872 -840
  931. package/node_modules/@types/node/fs/promises.d.ts +193 -20
  932. package/node_modules/@types/node/fs.d.ts +754 -435
  933. package/node_modules/@types/node/globals.d.ts +8 -30
  934. package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
  935. package/node_modules/@types/node/http.d.ts +363 -305
  936. package/node_modules/@types/node/http2.d.ts +545 -781
  937. package/node_modules/@types/node/https.d.ts +64 -243
  938. package/node_modules/@types/node/index.d.ts +26 -6
  939. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  940. package/node_modules/@types/node/inspector.d.ts +68 -57
  941. package/node_modules/@types/node/inspector.generated.d.ts +764 -410
  942. package/node_modules/@types/node/module.d.ts +53 -189
  943. package/node_modules/@types/node/net.d.ts +101 -207
  944. package/node_modules/@types/node/os.d.ts +11 -19
  945. package/node_modules/@types/node/package.json +13 -3
  946. package/node_modules/@types/node/path/posix.d.ts +8 -0
  947. package/node_modules/@types/node/path/win32.d.ts +8 -0
  948. package/node_modules/@types/node/path.d.ts +119 -141
  949. package/node_modules/@types/node/perf_hooks.d.ts +317 -673
  950. package/node_modules/@types/node/process.d.ts +277 -157
  951. package/node_modules/@types/node/punycode.d.ts +3 -31
  952. package/node_modules/@types/node/querystring.d.ts +3 -16
  953. package/node_modules/@types/node/quic.d.ts +897 -0
  954. package/node_modules/@types/node/readline/promises.d.ts +3 -6
  955. package/node_modules/@types/node/readline.d.ts +65 -152
  956. package/node_modules/@types/node/repl.d.ts +101 -109
  957. package/node_modules/@types/node/sea.d.ts +9 -115
  958. package/node_modules/@types/node/sqlite.d.ts +415 -68
  959. package/node_modules/@types/node/stream/consumers.d.ts +91 -15
  960. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  961. package/node_modules/@types/node/stream/promises.d.ts +136 -15
  962. package/node_modules/@types/node/stream/web.d.ts +179 -501
  963. package/node_modules/@types/node/stream.d.ts +577 -490
  964. package/node_modules/@types/node/string_decoder.d.ts +3 -43
  965. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  966. package/node_modules/@types/node/test.d.ts +402 -286
  967. package/node_modules/@types/node/timers/promises.d.ts +3 -18
  968. package/node_modules/@types/node/timers.d.ts +3 -141
  969. package/node_modules/@types/node/tls.d.ts +115 -241
  970. package/node_modules/@types/node/trace_events.d.ts +3 -97
  971. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -8
  972. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  973. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
  974. package/node_modules/@types/node/ts5.6/index.d.ts +28 -6
  975. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  976. package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  977. package/node_modules/@types/node/tty.d.ts +57 -40
  978. package/node_modules/@types/node/url.d.ts +156 -584
  979. package/node_modules/@types/node/util/types.d.ts +558 -0
  980. package/node_modules/@types/node/util.d.ts +167 -1096
  981. package/node_modules/@types/node/v8.d.ts +75 -15
  982. package/node_modules/@types/node/vm.d.ts +334 -198
  983. package/node_modules/@types/node/wasi.d.ts +24 -74
  984. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
  985. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  986. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  987. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  988. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  989. package/node_modules/@types/node/web-globals/events.d.ts +9 -0
  990. package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
  991. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  992. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  993. package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
  994. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  995. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  996. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  997. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  998. package/node_modules/@types/node/worker_threads.d.ts +280 -393
  999. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  1000. package/node_modules/@types/node/zlib.d.ts +7 -165
  1001. package/node_modules/undici-types/agent.d.ts +13 -12
  1002. package/node_modules/undici-types/api.d.ts +26 -26
  1003. package/node_modules/undici-types/balanced-pool.d.ts +13 -12
  1004. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  1005. package/node_modules/undici-types/client-stats.d.ts +15 -0
  1006. package/node_modules/undici-types/client.d.ts +34 -19
  1007. package/node_modules/undici-types/connector.d.ts +4 -2
  1008. package/node_modules/undici-types/cookies.d.ts +2 -0
  1009. package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
  1010. package/node_modules/undici-types/dispatcher.d.ts +127 -104
  1011. package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
  1012. package/node_modules/undici-types/errors.d.ts +82 -54
  1013. package/node_modules/undici-types/eventsource.d.ts +9 -4
  1014. package/node_modules/undici-types/fetch.d.ts +22 -20
  1015. package/node_modules/undici-types/formdata.d.ts +7 -7
  1016. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  1017. package/node_modules/undici-types/global-origin.d.ts +5 -5
  1018. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  1019. package/node_modules/undici-types/handlers.d.ts +8 -8
  1020. package/node_modules/undici-types/header.d.ts +157 -1
  1021. package/node_modules/undici-types/index.d.ts +67 -47
  1022. package/node_modules/undici-types/interceptors.d.ts +71 -8
  1023. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  1024. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  1025. package/node_modules/undici-types/mock-client.d.ts +6 -4
  1026. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  1027. package/node_modules/undici-types/mock-interceptor.d.ts +21 -20
  1028. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  1029. package/node_modules/undici-types/package.json +1 -1
  1030. package/node_modules/undici-types/patch.d.ts +0 -4
  1031. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  1032. package/node_modules/undici-types/pool.d.ts +15 -13
  1033. package/node_modules/undici-types/proxy-agent.d.ts +5 -4
  1034. package/node_modules/undici-types/readable.d.ts +19 -16
  1035. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  1036. package/node_modules/undici-types/retry-handler.d.ts +19 -10
  1037. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  1038. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  1039. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  1040. package/node_modules/undici-types/util.d.ts +3 -3
  1041. package/node_modules/undici-types/utility.d.ts +7 -0
  1042. package/node_modules/undici-types/webidl.d.ts +148 -29
  1043. package/node_modules/undici-types/websocket.d.ts +48 -10
  1044. package/npm-shrinkwrap.json +21 -21
  1045. package/package.json +13 -8
  1046. package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  1047. package/node_modules/@types/node/compatibility/index.d.ts +0 -9
  1048. package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  1049. package/node_modules/undici-types/file.d.ts +0 -39
  1050. package/node_modules/undici-types/filereader.d.ts +0 -54
@@ -1,22 +1,4 @@
1
- /**
2
- * The `node:crypto` module provides cryptographic functionality that includes a
3
- * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
4
- * functions.
5
- *
6
- * ```js
7
- * const { createHmac } = await import('node:crypto');
8
- *
9
- * const secret = 'abcdefg';
10
- * const hash = createHmac('sha256', secret)
11
- * .update('I love cupcakes')
12
- * .digest('hex');
13
- * console.log(hash);
14
- * // Prints:
15
- * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
16
- * ```
17
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/crypto.js)
18
- */
19
- declare module "crypto" {
1
+ declare module "node:crypto" {
20
2
  import { NonSharedBuffer } from "node:buffer";
21
3
  import * as stream from "node:stream";
22
4
  import { PeerCertificate } from "node:tls";
@@ -97,7 +79,7 @@ declare module "crypto" {
97
79
  verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
98
80
  }
99
81
  namespace constants {
100
- // https://nodejs.org/dist/latest-v22.x/docs/api/crypto.html#crypto-constants
82
+ // https://nodejs.org/dist/latest-v25.x/docs/api/crypto.html#crypto-constants
101
83
  const OPENSSL_VERSION_NUMBER: number;
102
84
  /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
103
85
  const SSL_OP_ALL: number;
@@ -471,7 +453,6 @@ declare module "crypto" {
471
453
  * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
472
454
  * ```
473
455
  * @since v0.1.94
474
- * @deprecated Since v20.13.0 Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is deprecated due to being internals, not intended for public use. Please use the {@link createHmac} method to create Hmac instances.
475
456
  */
476
457
  class Hmac extends stream.Transform {
477
458
  private constructor();
@@ -500,32 +481,66 @@ declare module "crypto" {
500
481
  digest(): NonSharedBuffer;
501
482
  digest(encoding: BinaryToTextEncoding): string;
502
483
  }
484
+ type KeyFormat = "pem" | "der" | "jwk";
503
485
  type KeyObjectType = "secret" | "public" | "private";
504
- interface KeyExportOptions<T extends KeyFormat> {
505
- type: "pkcs1" | "spki" | "pkcs8" | "sec1";
506
- format: T;
486
+ type PublicKeyExportType = "pkcs1" | "spki";
487
+ type PrivateKeyExportType = "pkcs1" | "pkcs8" | "sec1";
488
+ type KeyExportOptions =
489
+ | SymmetricKeyExportOptions
490
+ | PublicKeyExportOptions
491
+ | PrivateKeyExportOptions
492
+ | JwkKeyExportOptions;
493
+ interface SymmetricKeyExportOptions {
494
+ format?: "buffer" | undefined;
495
+ }
496
+ interface PublicKeyExportOptions<T extends PublicKeyExportType = PublicKeyExportType> {
497
+ type: T;
498
+ format: Exclude<KeyFormat, "jwk">;
499
+ }
500
+ interface PrivateKeyExportOptions<T extends PrivateKeyExportType = PrivateKeyExportType> {
501
+ type: T;
502
+ format: Exclude<KeyFormat, "jwk">;
507
503
  cipher?: string | undefined;
508
504
  passphrase?: string | Buffer | undefined;
509
505
  }
510
506
  interface JwkKeyExportOptions {
511
507
  format: "jwk";
512
508
  }
513
- interface JsonWebKey {
514
- crv?: string;
515
- d?: string;
516
- dp?: string;
517
- dq?: string;
518
- e?: string;
519
- k?: string;
520
- kty?: string;
521
- n?: string;
522
- p?: string;
523
- q?: string;
524
- qi?: string;
525
- x?: string;
526
- y?: string;
527
- [key: string]: unknown;
528
- }
509
+ interface KeyPairExportOptions<
510
+ TPublic extends PublicKeyExportType = PublicKeyExportType,
511
+ TPrivate extends PrivateKeyExportType = PrivateKeyExportType,
512
+ > {
513
+ publicKeyEncoding?: PublicKeyExportOptions<TPublic> | JwkKeyExportOptions | undefined;
514
+ privateKeyEncoding?: PrivateKeyExportOptions<TPrivate> | JwkKeyExportOptions | undefined;
515
+ }
516
+ type KeyExportResult<T, Default> = T extends { format: infer F extends KeyFormat }
517
+ ? { der: NonSharedBuffer; jwk: webcrypto.JsonWebKey; pem: string }[F]
518
+ : Default;
519
+ interface KeyPairExportResult<T extends KeyPairExportOptions> {
520
+ publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>;
521
+ privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>;
522
+ }
523
+ type KeyPairExportCallback<T extends KeyPairExportOptions> = (
524
+ err: Error | null,
525
+ publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>,
526
+ privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>,
527
+ ) => void;
528
+ type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`;
529
+ type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`;
530
+ type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`;
531
+ type AsymmetricKeyType =
532
+ | "dh"
533
+ | "dsa"
534
+ | "ec"
535
+ | "ed25519"
536
+ | "ed448"
537
+ | MLDSAKeyType
538
+ | MLKEMKeyType
539
+ | "rsa-pss"
540
+ | "rsa"
541
+ | SLHDSAKeyType
542
+ | "x25519"
543
+ | "x448";
529
544
  interface AsymmetricKeyDetails {
530
545
  /**
531
546
  * Key size in bits (RSA, DSA).
@@ -592,24 +607,14 @@ declare module "crypto" {
592
607
  */
593
608
  static from(key: webcrypto.CryptoKey): KeyObject;
594
609
  /**
595
- * For asymmetric keys, this property represents the type of the key. Supported key
596
- * types are:
597
- *
598
- * * `'rsa'` (OID 1.2.840.113549.1.1.1)
599
- * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10)
600
- * * `'dsa'` (OID 1.2.840.10040.4.1)
601
- * * `'ec'` (OID 1.2.840.10045.2.1)
602
- * * `'x25519'` (OID 1.3.101.110)
603
- * * `'x448'` (OID 1.3.101.111)
604
- * * `'ed25519'` (OID 1.3.101.112)
605
- * * `'ed448'` (OID 1.3.101.113)
606
- * * `'dh'` (OID 1.2.840.113549.1.3.1)
610
+ * For asymmetric keys, this property represents the type of the key. See the
611
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types).
607
612
  *
608
613
  * This property is `undefined` for unrecognized `KeyObject` types and symmetric
609
614
  * keys.
610
615
  * @since v11.6.0
611
616
  */
612
- asymmetricKeyType?: KeyType;
617
+ asymmetricKeyType?: AsymmetricKeyType;
613
618
  /**
614
619
  * This property exists only on asymmetric keys. Depending on the type of the key,
615
620
  * this object contains information about the key. None of the information obtained
@@ -647,9 +652,7 @@ declare module "crypto" {
647
652
  * PKCS#1 and SEC1 encryption.
648
653
  * @since v11.6.0
649
654
  */
650
- export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
651
- export(options?: KeyExportOptions<"der">): NonSharedBuffer;
652
- export(options?: JwkKeyExportOptions): JsonWebKey;
655
+ export<T extends KeyExportOptions = {}>(options?: T): KeyExportResult<T, NonSharedBuffer>;
653
656
  /**
654
657
  * Returns `true` or `false` depending on whether the keys have exactly the same
655
658
  * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack).
@@ -761,9 +764,9 @@ declare module "crypto" {
761
764
  key: CipherKey,
762
765
  iv: BinaryLike | null,
763
766
  options?: stream.TransformOptions,
764
- ): Cipher;
767
+ ): Cipheriv;
765
768
  /**
766
- * Instances of the `Cipher` class are used to encrypt data. The class can be
769
+ * Instances of the `Cipheriv` class are used to encrypt data. The class can be
767
770
  * used in one of two ways:
768
771
  *
769
772
  * * As a `stream` that is both readable and writable, where plain unencrypted
@@ -772,10 +775,10 @@ declare module "crypto" {
772
775
  * the encrypted data.
773
776
  *
774
777
  * The {@link createCipheriv} method is
775
- * used to create `Cipher` instances. `Cipher` objects are not to be created
778
+ * used to create `Cipheriv` instances. `Cipheriv` objects are not to be created
776
779
  * directly using the `new` keyword.
777
780
  *
778
- * Example: Using `Cipher` objects as streams:
781
+ * Example: Using `Cipheriv` objects as streams:
779
782
  *
780
783
  * ```js
781
784
  * const {
@@ -810,7 +813,7 @@ declare module "crypto" {
810
813
  * });
811
814
  * ```
812
815
  *
813
- * Example: Using `Cipher` and piped streams:
816
+ * Example: Using `Cipheriv` and piped streams:
814
817
  *
815
818
  * ```js
816
819
  * import {
@@ -881,7 +884,7 @@ declare module "crypto" {
881
884
  * ```
882
885
  * @since v0.1.94
883
886
  */
884
- class Cipher extends stream.Transform {
887
+ class Cipheriv extends stream.Transform {
885
888
  private constructor();
886
889
  /**
887
890
  * Updates the cipher with `data`. If the `inputEncoding` argument is given,
@@ -902,7 +905,7 @@ declare module "crypto" {
902
905
  update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
903
906
  update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
904
907
  /**
905
- * Once the `cipher.final()` method has been called, the `Cipher` object can no
908
+ * Once the `cipher.final()` method has been called, the `Cipheriv` object can no
906
909
  * longer be used to encrypt data. Attempts to call `cipher.final()` more than
907
910
  * once will result in an error being thrown.
908
911
  * @since v0.1.94
@@ -912,7 +915,7 @@ declare module "crypto" {
912
915
  final(): NonSharedBuffer;
913
916
  final(outputEncoding: BufferEncoding): string;
914
917
  /**
915
- * When using block encryption algorithms, the `Cipher` class will automatically
918
+ * When using block encryption algorithms, the `Cipheriv` class will automatically
916
919
  * add padding to the input data to the appropriate block size. To disable the
917
920
  * default padding call `cipher.setAutoPadding(false)`.
918
921
  *
@@ -928,7 +931,7 @@ declare module "crypto" {
928
931
  */
929
932
  setAutoPadding(autoPadding?: boolean): this;
930
933
  }
931
- interface CipherCCM extends Cipher {
934
+ interface CipherCCM extends Cipheriv {
932
935
  setAAD(
933
936
  buffer: NodeJS.ArrayBufferView,
934
937
  options: {
@@ -937,7 +940,7 @@ declare module "crypto" {
937
940
  ): this;
938
941
  getAuthTag(): NonSharedBuffer;
939
942
  }
940
- interface CipherGCM extends Cipher {
943
+ interface CipherGCM extends Cipheriv {
941
944
  setAAD(
942
945
  buffer: NodeJS.ArrayBufferView,
943
946
  options?: {
@@ -946,7 +949,7 @@ declare module "crypto" {
946
949
  ): this;
947
950
  getAuthTag(): NonSharedBuffer;
948
951
  }
949
- interface CipherOCB extends Cipher {
952
+ interface CipherOCB extends Cipheriv {
950
953
  setAAD(
951
954
  buffer: NodeJS.ArrayBufferView,
952
955
  options?: {
@@ -955,7 +958,7 @@ declare module "crypto" {
955
958
  ): this;
956
959
  getAuthTag(): NonSharedBuffer;
957
960
  }
958
- interface CipherChaCha20Poly1305 extends Cipher {
961
+ interface CipherChaCha20Poly1305 extends Cipheriv {
959
962
  setAAD(
960
963
  buffer: NodeJS.ArrayBufferView,
961
964
  options: {
@@ -965,7 +968,7 @@ declare module "crypto" {
965
968
  getAuthTag(): NonSharedBuffer;
966
969
  }
967
970
  /**
968
- * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
971
+ * Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
969
972
  *
970
973
  * The `options` argument controls stream behavior and is optional except when a
971
974
  * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the `authTagLength` option is required and specifies the length of the
@@ -1022,9 +1025,9 @@ declare module "crypto" {
1022
1025
  key: CipherKey,
1023
1026
  iv: BinaryLike | null,
1024
1027
  options?: stream.TransformOptions,
1025
- ): Decipher;
1028
+ ): Decipheriv;
1026
1029
  /**
1027
- * Instances of the `Decipher` class are used to decrypt data. The class can be
1030
+ * Instances of the `Decipheriv` class are used to decrypt data. The class can be
1028
1031
  * used in one of two ways:
1029
1032
  *
1030
1033
  * * As a `stream` that is both readable and writable, where plain encrypted
@@ -1033,10 +1036,10 @@ declare module "crypto" {
1033
1036
  * produce the unencrypted data.
1034
1037
  *
1035
1038
  * The {@link createDecipheriv} method is
1036
- * used to create `Decipher` instances. `Decipher` objects are not to be created
1039
+ * used to create `Decipheriv` instances. `Decipheriv` objects are not to be created
1037
1040
  * directly using the `new` keyword.
1038
1041
  *
1039
- * Example: Using `Decipher` objects as streams:
1042
+ * Example: Using `Decipheriv` objects as streams:
1040
1043
  *
1041
1044
  * ```js
1042
1045
  * import { Buffer } from 'node:buffer';
@@ -1075,7 +1078,7 @@ declare module "crypto" {
1075
1078
  * decipher.end();
1076
1079
  * ```
1077
1080
  *
1078
- * Example: Using `Decipher` and piped streams:
1081
+ * Example: Using `Decipheriv` and piped streams:
1079
1082
  *
1080
1083
  * ```js
1081
1084
  * import {
@@ -1131,7 +1134,7 @@ declare module "crypto" {
1131
1134
  * ```
1132
1135
  * @since v0.1.94
1133
1136
  */
1134
- class Decipher extends stream.Transform {
1137
+ class Decipheriv extends stream.Transform {
1135
1138
  private constructor();
1136
1139
  /**
1137
1140
  * Updates the decipher with `data`. If the `inputEncoding` argument is given,
@@ -1152,7 +1155,7 @@ declare module "crypto" {
1152
1155
  update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
1153
1156
  update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
1154
1157
  /**
1155
- * Once the `decipher.final()` method has been called, the `Decipher` object can
1158
+ * Once the `decipher.final()` method has been called, the `Decipheriv` object can
1156
1159
  * no longer be used to decrypt data. Attempts to call `decipher.final()` more
1157
1160
  * than once will result in an error being thrown.
1158
1161
  * @since v0.1.94
@@ -1175,7 +1178,7 @@ declare module "crypto" {
1175
1178
  */
1176
1179
  setAutoPadding(auto_padding?: boolean): this;
1177
1180
  }
1178
- interface DecipherCCM extends Decipher {
1181
+ interface DecipherCCM extends Decipheriv {
1179
1182
  setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1180
1183
  setAAD(
1181
1184
  buffer: NodeJS.ArrayBufferView,
@@ -1184,7 +1187,7 @@ declare module "crypto" {
1184
1187
  },
1185
1188
  ): this;
1186
1189
  }
1187
- interface DecipherGCM extends Decipher {
1190
+ interface DecipherGCM extends Decipheriv {
1188
1191
  setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1189
1192
  setAAD(
1190
1193
  buffer: NodeJS.ArrayBufferView,
@@ -1193,7 +1196,7 @@ declare module "crypto" {
1193
1196
  },
1194
1197
  ): this;
1195
1198
  }
1196
- interface DecipherOCB extends Decipher {
1199
+ interface DecipherOCB extends Decipheriv {
1197
1200
  setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1198
1201
  setAAD(
1199
1202
  buffer: NodeJS.ArrayBufferView,
@@ -1202,7 +1205,7 @@ declare module "crypto" {
1202
1205
  },
1203
1206
  ): this;
1204
1207
  }
1205
- interface DecipherChaCha20Poly1305 extends Decipher {
1208
+ interface DecipherChaCha20Poly1305 extends Decipheriv {
1206
1209
  setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1207
1210
  setAAD(
1208
1211
  buffer: NodeJS.ArrayBufferView,
@@ -1214,14 +1217,14 @@ declare module "crypto" {
1214
1217
  interface PrivateKeyInput {
1215
1218
  key: string | Buffer;
1216
1219
  format?: KeyFormat | undefined;
1217
- type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
1220
+ type?: PrivateKeyExportType | undefined;
1218
1221
  passphrase?: string | Buffer | undefined;
1219
1222
  encoding?: string | undefined;
1220
1223
  }
1221
1224
  interface PublicKeyInput {
1222
1225
  key: string | Buffer;
1223
1226
  format?: KeyFormat | undefined;
1224
- type?: "pkcs1" | "spki" | undefined;
1227
+ type?: PublicKeyExportType | undefined;
1225
1228
  encoding?: string | undefined;
1226
1229
  }
1227
1230
  /**
@@ -1274,7 +1277,7 @@ declare module "crypto" {
1274
1277
  },
1275
1278
  ): KeyObject;
1276
1279
  interface JsonWebKeyInput {
1277
- key: JsonWebKey;
1280
+ key: webcrypto.JsonWebKey;
1278
1281
  format: "jwk";
1279
1282
  }
1280
1283
  /**
@@ -1321,6 +1324,7 @@ declare module "crypto" {
1321
1324
  * @since v0.1.92
1322
1325
  * @param options `stream.Writable` options
1323
1326
  */
1327
+ // TODO: signing algorithm type
1324
1328
  function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
1325
1329
  type DSAEncoding = "der" | "ieee-p1363";
1326
1330
  interface SigningOptions {
@@ -1330,6 +1334,7 @@ declare module "crypto" {
1330
1334
  padding?: number | undefined;
1331
1335
  saltLength?: number | undefined;
1332
1336
  dsaEncoding?: DSAEncoding | undefined;
1337
+ context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
1333
1338
  }
1334
1339
  interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
1335
1340
  interface SignKeyObjectInput extends SigningOptions {
@@ -2476,66 +2481,27 @@ declare module "crypto" {
2476
2481
  * @since v6.6.0
2477
2482
  */
2478
2483
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
2479
- type KeyType = "rsa" | "rsa-pss" | "dsa" | "ec" | "ed25519" | "ed448" | "x25519" | "x448";
2480
- type KeyFormat = "pem" | "der" | "jwk";
2481
- interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
2482
- format: T;
2483
- cipher?: string | undefined;
2484
- passphrase?: string | undefined;
2485
- }
2486
- interface KeyPairKeyObjectResult {
2487
- publicKey: KeyObject;
2488
- privateKey: KeyObject;
2489
- }
2490
- interface ED25519KeyPairKeyObjectOptions {}
2491
- interface ED448KeyPairKeyObjectOptions {}
2492
- interface X25519KeyPairKeyObjectOptions {}
2493
- interface X448KeyPairKeyObjectOptions {}
2494
- interface ECKeyPairKeyObjectOptions {
2495
- /**
2496
- * Name of the curve to use
2497
- */
2498
- namedCurve: string;
2499
- /**
2500
- * Must be `'named'` or `'explicit'`. Default: `'named'`.
2501
- */
2502
- paramEncoding?: "explicit" | "named" | undefined;
2503
- }
2504
- interface RSAKeyPairKeyObjectOptions {
2505
- /**
2506
- * Key size in bits
2507
- */
2508
- modulusLength: number;
2484
+ interface DHKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2509
2485
  /**
2510
- * Public exponent
2511
- * @default 0x10001
2486
+ * The prime parameter
2512
2487
  */
2513
- publicExponent?: number | undefined;
2514
- }
2515
- interface RSAPSSKeyPairKeyObjectOptions {
2488
+ prime?: Buffer | undefined;
2516
2489
  /**
2517
- * Key size in bits
2490
+ * Prime length in bits
2518
2491
  */
2519
- modulusLength: number;
2492
+ primeLength?: number | undefined;
2520
2493
  /**
2521
- * Public exponent
2522
- * @default 0x10001
2494
+ * Custom generator
2495
+ * @default 2
2523
2496
  */
2524
- publicExponent?: number | undefined;
2497
+ generator?: number | undefined;
2525
2498
  /**
2526
- * Name of the message digest
2499
+ * Diffie-Hellman group name
2500
+ * @see {@link getDiffieHellman}
2527
2501
  */
2528
- hashAlgorithm?: string | undefined;
2529
- /**
2530
- * Name of the message digest used by MGF1
2531
- */
2532
- mgf1HashAlgorithm?: string | undefined;
2533
- /**
2534
- * Minimal salt length in bytes
2535
- */
2536
- saltLength?: string | undefined;
2502
+ groupName?: string | undefined;
2537
2503
  }
2538
- interface DSAKeyPairKeyObjectOptions {
2504
+ interface DSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2539
2505
  /**
2540
2506
  * Key size in bits
2541
2507
  */
@@ -2545,25 +2511,22 @@ declare module "crypto" {
2545
2511
  */
2546
2512
  divisorLength: number;
2547
2513
  }
2548
- interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2514
+ interface ECKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8" | "sec1"> {
2549
2515
  /**
2550
- * Key size in bits
2516
+ * Name of the curve to use
2551
2517
  */
2552
- modulusLength: number;
2518
+ namedCurve: string;
2553
2519
  /**
2554
- * Public exponent
2555
- * @default 0x10001
2520
+ * Must be `'named'` or `'explicit'`
2521
+ * @default 'named'
2556
2522
  */
2557
- publicExponent?: number | undefined;
2558
- publicKeyEncoding: {
2559
- type: "pkcs1" | "spki";
2560
- format: PubF;
2561
- };
2562
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2563
- type: "pkcs1" | "pkcs8";
2564
- };
2523
+ paramEncoding?: "explicit" | "named" | undefined;
2565
2524
  }
2566
- interface RSAPSSKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2525
+ interface ED25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2526
+ interface ED448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2527
+ interface MLDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2528
+ interface MLKEMKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2529
+ interface RSAPSSKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2567
2530
  /**
2568
2531
  * Key size in bits
2569
2532
  */
@@ -2585,83 +2548,24 @@ declare module "crypto" {
2585
2548
  * Minimal salt length in bytes
2586
2549
  */
2587
2550
  saltLength?: string | undefined;
2588
- publicKeyEncoding: {
2589
- type: "spki";
2590
- format: PubF;
2591
- };
2592
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2593
- type: "pkcs8";
2594
- };
2595
2551
  }
2596
- interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2552
+ interface RSAKeyPairOptions extends KeyPairExportOptions<"pkcs1" | "spki", "pkcs1" | "pkcs8"> {
2597
2553
  /**
2598
2554
  * Key size in bits
2599
2555
  */
2600
2556
  modulusLength: number;
2601
2557
  /**
2602
- * Size of q in bits
2558
+ * Public exponent
2559
+ * @default 0x10001
2603
2560
  */
2604
- divisorLength: number;
2605
- publicKeyEncoding: {
2606
- type: "spki";
2607
- format: PubF;
2608
- };
2609
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2610
- type: "pkcs8";
2611
- };
2612
- }
2613
- interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> extends ECKeyPairKeyObjectOptions {
2614
- publicKeyEncoding: {
2615
- type: "pkcs1" | "spki";
2616
- format: PubF;
2617
- };
2618
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2619
- type: "sec1" | "pkcs8";
2620
- };
2621
- }
2622
- interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2623
- publicKeyEncoding: {
2624
- type: "spki";
2625
- format: PubF;
2626
- };
2627
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2628
- type: "pkcs8";
2629
- };
2630
- }
2631
- interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2632
- publicKeyEncoding: {
2633
- type: "spki";
2634
- format: PubF;
2635
- };
2636
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2637
- type: "pkcs8";
2638
- };
2639
- }
2640
- interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2641
- publicKeyEncoding: {
2642
- type: "spki";
2643
- format: PubF;
2644
- };
2645
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2646
- type: "pkcs8";
2647
- };
2648
- }
2649
- interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
2650
- publicKeyEncoding: {
2651
- type: "spki";
2652
- format: PubF;
2653
- };
2654
- privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
2655
- type: "pkcs8";
2656
- };
2657
- }
2658
- interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
2659
- publicKey: T1;
2660
- privateKey: T2;
2561
+ publicExponent?: number | undefined;
2661
2562
  }
2563
+ interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2564
+ interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2565
+ interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2662
2566
  /**
2663
- * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
2664
- * Ed25519, Ed448, X25519, X448, and DH are currently supported.
2567
+ * Generates a new asymmetric key pair of the given `type`. See the
2568
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types).
2665
2569
  *
2666
2570
  * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
2667
2571
  * behaves as if `keyObject.export()` had been called on its result. Otherwise,
@@ -2698,147 +2602,60 @@ declare module "crypto" {
2698
2602
  * When PEM encoding was selected, the respective key will be a string, otherwise
2699
2603
  * it will be a buffer containing the data encoded as DER.
2700
2604
  * @since v10.12.0
2701
- * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2702
- */
2703
- function generateKeyPairSync(
2704
- type: "rsa",
2705
- options: RSAKeyPairOptions<"pem", "pem">,
2706
- ): KeyPairSyncResult<string, string>;
2707
- function generateKeyPairSync(
2708
- type: "rsa",
2709
- options: RSAKeyPairOptions<"pem", "der">,
2710
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2711
- function generateKeyPairSync(
2712
- type: "rsa",
2713
- options: RSAKeyPairOptions<"der", "pem">,
2714
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2715
- function generateKeyPairSync(
2716
- type: "rsa",
2717
- options: RSAKeyPairOptions<"der", "der">,
2718
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2719
- function generateKeyPairSync(type: "rsa", options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2720
- function generateKeyPairSync(
2721
- type: "rsa-pss",
2722
- options: RSAPSSKeyPairOptions<"pem", "pem">,
2723
- ): KeyPairSyncResult<string, string>;
2724
- function generateKeyPairSync(
2725
- type: "rsa-pss",
2726
- options: RSAPSSKeyPairOptions<"pem", "der">,
2727
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2728
- function generateKeyPairSync(
2729
- type: "rsa-pss",
2730
- options: RSAPSSKeyPairOptions<"der", "pem">,
2731
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2732
- function generateKeyPairSync(
2733
- type: "rsa-pss",
2734
- options: RSAPSSKeyPairOptions<"der", "der">,
2735
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2736
- function generateKeyPairSync(type: "rsa-pss", options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2737
- function generateKeyPairSync(
2738
- type: "dsa",
2739
- options: DSAKeyPairOptions<"pem", "pem">,
2740
- ): KeyPairSyncResult<string, string>;
2741
- function generateKeyPairSync(
2742
- type: "dsa",
2743
- options: DSAKeyPairOptions<"pem", "der">,
2744
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2745
- function generateKeyPairSync(
2605
+ * @param type The asymmetric key type to generate. See the
2606
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types).
2607
+ */
2608
+ function generateKeyPairSync<T extends DHKeyPairOptions>(
2609
+ type: "dh",
2610
+ options: T,
2611
+ ): KeyPairExportResult<T>;
2612
+ function generateKeyPairSync<T extends DSAKeyPairOptions>(
2746
2613
  type: "dsa",
2747
- options: DSAKeyPairOptions<"der", "pem">,
2748
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2749
- function generateKeyPairSync(
2750
- type: "dsa",
2751
- options: DSAKeyPairOptions<"der", "der">,
2752
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2753
- function generateKeyPairSync(type: "dsa", options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2754
- function generateKeyPairSync(
2755
- type: "ec",
2756
- options: ECKeyPairOptions<"pem", "pem">,
2757
- ): KeyPairSyncResult<string, string>;
2758
- function generateKeyPairSync(
2614
+ options: T,
2615
+ ): KeyPairExportResult<T>;
2616
+ function generateKeyPairSync<T extends ECKeyPairOptions>(
2759
2617
  type: "ec",
2760
- options: ECKeyPairOptions<"pem", "der">,
2761
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2762
- function generateKeyPairSync(
2763
- type: "ec",
2764
- options: ECKeyPairOptions<"der", "pem">,
2765
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2766
- function generateKeyPairSync(
2767
- type: "ec",
2768
- options: ECKeyPairOptions<"der", "der">,
2769
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2770
- function generateKeyPairSync(type: "ec", options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2771
- function generateKeyPairSync(
2772
- type: "ed25519",
2773
- options: ED25519KeyPairOptions<"pem", "pem">,
2774
- ): KeyPairSyncResult<string, string>;
2775
- function generateKeyPairSync(
2776
- type: "ed25519",
2777
- options: ED25519KeyPairOptions<"pem", "der">,
2778
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2779
- function generateKeyPairSync(
2780
- type: "ed25519",
2781
- options: ED25519KeyPairOptions<"der", "pem">,
2782
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2783
- function generateKeyPairSync(
2618
+ options: T,
2619
+ ): KeyPairExportResult<T>;
2620
+ function generateKeyPairSync<T extends ED25519KeyPairOptions = {}>(
2784
2621
  type: "ed25519",
2785
- options: ED25519KeyPairOptions<"der", "der">,
2786
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2787
- function generateKeyPairSync(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2788
- function generateKeyPairSync(
2622
+ options?: T,
2623
+ ): KeyPairExportResult<T>;
2624
+ function generateKeyPairSync<T extends ED448KeyPairOptions = {}>(
2789
2625
  type: "ed448",
2790
- options: ED448KeyPairOptions<"pem", "pem">,
2791
- ): KeyPairSyncResult<string, string>;
2792
- function generateKeyPairSync(
2793
- type: "ed448",
2794
- options: ED448KeyPairOptions<"pem", "der">,
2795
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2796
- function generateKeyPairSync(
2797
- type: "ed448",
2798
- options: ED448KeyPairOptions<"der", "pem">,
2799
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2800
- function generateKeyPairSync(
2801
- type: "ed448",
2802
- options: ED448KeyPairOptions<"der", "der">,
2803
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2804
- function generateKeyPairSync(type: "ed448", options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2805
- function generateKeyPairSync(
2806
- type: "x25519",
2807
- options: X25519KeyPairOptions<"pem", "pem">,
2808
- ): KeyPairSyncResult<string, string>;
2809
- function generateKeyPairSync(
2810
- type: "x25519",
2811
- options: X25519KeyPairOptions<"pem", "der">,
2812
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2813
- function generateKeyPairSync(
2814
- type: "x25519",
2815
- options: X25519KeyPairOptions<"der", "pem">,
2816
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2817
- function generateKeyPairSync(
2626
+ options?: T,
2627
+ ): KeyPairExportResult<T>;
2628
+ function generateKeyPairSync<T extends MLDSAKeyPairOptions = {}>(
2629
+ type: MLDSAKeyType,
2630
+ options?: T,
2631
+ ): KeyPairExportResult<T>;
2632
+ function generateKeyPairSync<T extends MLKEMKeyPairOptions = {}>(
2633
+ type: MLKEMKeyType,
2634
+ options?: T,
2635
+ ): KeyPairExportResult<T>;
2636
+ function generateKeyPairSync<T extends RSAPSSKeyPairOptions>(
2637
+ type: "rsa-pss",
2638
+ options: T,
2639
+ ): KeyPairExportResult<T>;
2640
+ function generateKeyPairSync<T extends RSAKeyPairOptions>(
2641
+ type: "rsa",
2642
+ options: T,
2643
+ ): KeyPairExportResult<T>;
2644
+ function generateKeyPairSync<T extends SLHDSAKeyPairOptions = {}>(
2645
+ type: SLHDSAKeyType,
2646
+ options?: T,
2647
+ ): KeyPairExportResult<T>;
2648
+ function generateKeyPairSync<T extends X25519KeyPairOptions = {}>(
2818
2649
  type: "x25519",
2819
- options: X25519KeyPairOptions<"der", "der">,
2820
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2821
- function generateKeyPairSync(type: "x25519", options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2822
- function generateKeyPairSync(
2823
- type: "x448",
2824
- options: X448KeyPairOptions<"pem", "pem">,
2825
- ): KeyPairSyncResult<string, string>;
2826
- function generateKeyPairSync(
2827
- type: "x448",
2828
- options: X448KeyPairOptions<"pem", "der">,
2829
- ): KeyPairSyncResult<string, NonSharedBuffer>;
2830
- function generateKeyPairSync(
2831
- type: "x448",
2832
- options: X448KeyPairOptions<"der", "pem">,
2833
- ): KeyPairSyncResult<NonSharedBuffer, string>;
2834
- function generateKeyPairSync(
2650
+ options?: T,
2651
+ ): KeyPairExportResult<T>;
2652
+ function generateKeyPairSync<T extends X448KeyPairOptions = {}>(
2835
2653
  type: "x448",
2836
- options: X448KeyPairOptions<"der", "der">,
2837
- ): KeyPairSyncResult<NonSharedBuffer, NonSharedBuffer>;
2838
- function generateKeyPairSync(type: "x448", options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
2654
+ options?: T,
2655
+ ): KeyPairExportResult<T>;
2839
2656
  /**
2840
- * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC,
2841
- * Ed25519, Ed448, X25519, X448, and DH are currently supported.
2657
+ * Generates a new asymmetric key pair of the given `type`. See the
2658
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types).
2842
2659
  *
2843
2660
  * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
2844
2661
  * behaves as if `keyObject.export()` had been called on its result. Otherwise,
@@ -2873,455 +2690,126 @@ declare module "crypto" {
2873
2690
  * If this method is invoked as its `util.promisify()` ed version, it returns
2874
2691
  * a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
2875
2692
  * @since v10.12.0
2876
- * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`.
2693
+ * @param type The asymmetric key type to generate. See the
2694
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v25.x/api/crypto.html#asymmetric-key-types).
2877
2695
  */
2878
- function generateKeyPair(
2879
- type: "rsa",
2880
- options: RSAKeyPairOptions<"pem", "pem">,
2881
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2882
- ): void;
2883
- function generateKeyPair(
2884
- type: "rsa",
2885
- options: RSAKeyPairOptions<"pem", "der">,
2886
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2887
- ): void;
2888
- function generateKeyPair(
2889
- type: "rsa",
2890
- options: RSAKeyPairOptions<"der", "pem">,
2891
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2892
- ): void;
2893
- function generateKeyPair(
2894
- type: "rsa",
2895
- options: RSAKeyPairOptions<"der", "der">,
2896
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2897
- ): void;
2898
- function generateKeyPair(
2899
- type: "rsa",
2900
- options: RSAKeyPairKeyObjectOptions,
2901
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2902
- ): void;
2903
- function generateKeyPair(
2904
- type: "rsa-pss",
2905
- options: RSAPSSKeyPairOptions<"pem", "pem">,
2906
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2907
- ): void;
2908
- function generateKeyPair(
2909
- type: "rsa-pss",
2910
- options: RSAPSSKeyPairOptions<"pem", "der">,
2911
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2912
- ): void;
2913
- function generateKeyPair(
2914
- type: "rsa-pss",
2915
- options: RSAPSSKeyPairOptions<"der", "pem">,
2916
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2696
+ function generateKeyPair<T extends DHKeyPairOptions>(
2697
+ type: "dh",
2698
+ options: T,
2699
+ callback: KeyPairExportCallback<T>,
2917
2700
  ): void;
2918
- function generateKeyPair(
2919
- type: "rsa-pss",
2920
- options: RSAPSSKeyPairOptions<"der", "der">,
2921
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2922
- ): void;
2923
- function generateKeyPair(
2924
- type: "rsa-pss",
2925
- options: RSAPSSKeyPairKeyObjectOptions,
2926
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2927
- ): void;
2928
- function generateKeyPair(
2929
- type: "dsa",
2930
- options: DSAKeyPairOptions<"pem", "pem">,
2931
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2932
- ): void;
2933
- function generateKeyPair(
2934
- type: "dsa",
2935
- options: DSAKeyPairOptions<"pem", "der">,
2936
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2937
- ): void;
2938
- function generateKeyPair(
2939
- type: "dsa",
2940
- options: DSAKeyPairOptions<"der", "pem">,
2941
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2942
- ): void;
2943
- function generateKeyPair(
2701
+ function generateKeyPair<T extends DSAKeyPairOptions>(
2944
2702
  type: "dsa",
2945
- options: DSAKeyPairOptions<"der", "der">,
2946
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2947
- ): void;
2948
- function generateKeyPair(
2949
- type: "dsa",
2950
- options: DSAKeyPairKeyObjectOptions,
2951
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2952
- ): void;
2953
- function generateKeyPair(
2954
- type: "ec",
2955
- options: ECKeyPairOptions<"pem", "pem">,
2956
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2957
- ): void;
2958
- function generateKeyPair(
2959
- type: "ec",
2960
- options: ECKeyPairOptions<"pem", "der">,
2961
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2962
- ): void;
2963
- function generateKeyPair(
2964
- type: "ec",
2965
- options: ECKeyPairOptions<"der", "pem">,
2966
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2967
- ): void;
2968
- function generateKeyPair(
2969
- type: "ec",
2970
- options: ECKeyPairOptions<"der", "der">,
2971
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2703
+ options: T,
2704
+ callback: KeyPairExportCallback<T>,
2972
2705
  ): void;
2973
- function generateKeyPair(
2706
+ function generateKeyPair<T extends ECKeyPairOptions>(
2974
2707
  type: "ec",
2975
- options: ECKeyPairKeyObjectOptions,
2976
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2708
+ options: T,
2709
+ callback: KeyPairExportCallback<T>,
2977
2710
  ): void;
2978
- function generateKeyPair(
2711
+ function generateKeyPair<T extends ED25519KeyPairOptions = {}>(
2979
2712
  type: "ed25519",
2980
- options: ED25519KeyPairOptions<"pem", "pem">,
2981
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2713
+ options: T | undefined,
2714
+ callback: KeyPairExportCallback<T>,
2982
2715
  ): void;
2983
- function generateKeyPair(
2984
- type: "ed25519",
2985
- options: ED25519KeyPairOptions<"pem", "der">,
2986
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2987
- ): void;
2988
- function generateKeyPair(
2989
- type: "ed25519",
2990
- options: ED25519KeyPairOptions<"der", "pem">,
2991
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2992
- ): void;
2993
- function generateKeyPair(
2994
- type: "ed25519",
2995
- options: ED25519KeyPairOptions<"der", "der">,
2996
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2997
- ): void;
2998
- function generateKeyPair(
2999
- type: "ed25519",
3000
- options: ED25519KeyPairKeyObjectOptions | undefined,
3001
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3002
- ): void;
3003
- function generateKeyPair(
2716
+ function generateKeyPair<T extends ED448KeyPairOptions = {}>(
3004
2717
  type: "ed448",
3005
- options: ED448KeyPairOptions<"pem", "pem">,
3006
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
2718
+ options: T | undefined,
2719
+ callback: KeyPairExportCallback<T>,
3007
2720
  ): void;
3008
- function generateKeyPair(
3009
- type: "ed448",
3010
- options: ED448KeyPairOptions<"pem", "der">,
3011
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2721
+ function generateKeyPair<T extends MLDSAKeyPairOptions = {}>(
2722
+ type: MLDSAKeyType,
2723
+ options: T | undefined,
2724
+ callback: KeyPairExportCallback<T>,
3012
2725
  ): void;
3013
- function generateKeyPair(
3014
- type: "ed448",
3015
- options: ED448KeyPairOptions<"der", "pem">,
3016
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2726
+ function generateKeyPair<T extends MLKEMKeyPairOptions = {}>(
2727
+ type: MLKEMKeyType,
2728
+ options: T | undefined,
2729
+ callback: KeyPairExportCallback<T>,
3017
2730
  ): void;
3018
- function generateKeyPair(
3019
- type: "ed448",
3020
- options: ED448KeyPairOptions<"der", "der">,
3021
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3022
- ): void;
3023
- function generateKeyPair(
3024
- type: "ed448",
3025
- options: ED448KeyPairKeyObjectOptions | undefined,
3026
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
3027
- ): void;
3028
- function generateKeyPair(
3029
- type: "x25519",
3030
- options: X25519KeyPairOptions<"pem", "pem">,
3031
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3032
- ): void;
3033
- function generateKeyPair(
3034
- type: "x25519",
3035
- options: X25519KeyPairOptions<"pem", "der">,
3036
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
2731
+ function generateKeyPair<T extends RSAPSSKeyPairOptions>(
2732
+ type: "rsa-pss",
2733
+ options: T,
2734
+ callback: KeyPairExportCallback<T>,
3037
2735
  ): void;
3038
- function generateKeyPair(
3039
- type: "x25519",
3040
- options: X25519KeyPairOptions<"der", "pem">,
3041
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
2736
+ function generateKeyPair<T extends RSAKeyPairOptions>(
2737
+ type: "rsa",
2738
+ options: T,
2739
+ callback: KeyPairExportCallback<T>,
3042
2740
  ): void;
3043
- function generateKeyPair(
3044
- type: "x25519",
3045
- options: X25519KeyPairOptions<"der", "der">,
3046
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
2741
+ function generateKeyPair<T extends SLHDSAKeyPairOptions = {}>(
2742
+ type: SLHDSAKeyType,
2743
+ options: T | undefined,
2744
+ callback: KeyPairExportCallback<T>,
3047
2745
  ): void;
3048
- function generateKeyPair(
2746
+ function generateKeyPair<T extends X25519KeyPairOptions = {}>(
3049
2747
  type: "x25519",
3050
- options: X25519KeyPairKeyObjectOptions | undefined,
3051
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2748
+ options: T | undefined,
2749
+ callback: KeyPairExportCallback<T>,
3052
2750
  ): void;
3053
- function generateKeyPair(
2751
+ function generateKeyPair<T extends X448KeyPairOptions = {}>(
3054
2752
  type: "x448",
3055
- options: X448KeyPairOptions<"pem", "pem">,
3056
- callback: (err: Error | null, publicKey: string, privateKey: string) => void,
3057
- ): void;
3058
- function generateKeyPair(
3059
- type: "x448",
3060
- options: X448KeyPairOptions<"pem", "der">,
3061
- callback: (err: Error | null, publicKey: string, privateKey: NonSharedBuffer) => void,
3062
- ): void;
3063
- function generateKeyPair(
3064
- type: "x448",
3065
- options: X448KeyPairOptions<"der", "pem">,
3066
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: string) => void,
3067
- ): void;
3068
- function generateKeyPair(
3069
- type: "x448",
3070
- options: X448KeyPairOptions<"der", "der">,
3071
- callback: (err: Error | null, publicKey: NonSharedBuffer, privateKey: NonSharedBuffer) => void,
3072
- ): void;
3073
- function generateKeyPair(
3074
- type: "x448",
3075
- options: X448KeyPairKeyObjectOptions | undefined,
3076
- callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
2753
+ options: T | undefined,
2754
+ callback: KeyPairExportCallback<T>,
3077
2755
  ): void;
3078
2756
  namespace generateKeyPair {
3079
- function __promisify__(
3080
- type: "rsa",
3081
- options: RSAKeyPairOptions<"pem", "pem">,
3082
- ): Promise<{
3083
- publicKey: string;
3084
- privateKey: string;
3085
- }>;
3086
- function __promisify__(
3087
- type: "rsa",
3088
- options: RSAKeyPairOptions<"pem", "der">,
3089
- ): Promise<{
3090
- publicKey: string;
3091
- privateKey: NonSharedBuffer;
3092
- }>;
3093
- function __promisify__(
3094
- type: "rsa",
3095
- options: RSAKeyPairOptions<"der", "pem">,
3096
- ): Promise<{
3097
- publicKey: NonSharedBuffer;
3098
- privateKey: string;
3099
- }>;
3100
- function __promisify__(
3101
- type: "rsa",
3102
- options: RSAKeyPairOptions<"der", "der">,
3103
- ): Promise<{
3104
- publicKey: NonSharedBuffer;
3105
- privateKey: NonSharedBuffer;
3106
- }>;
3107
- function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3108
- function __promisify__(
3109
- type: "rsa-pss",
3110
- options: RSAPSSKeyPairOptions<"pem", "pem">,
3111
- ): Promise<{
3112
- publicKey: string;
3113
- privateKey: string;
3114
- }>;
3115
- function __promisify__(
3116
- type: "rsa-pss",
3117
- options: RSAPSSKeyPairOptions<"pem", "der">,
3118
- ): Promise<{
3119
- publicKey: string;
3120
- privateKey: NonSharedBuffer;
3121
- }>;
3122
- function __promisify__(
3123
- type: "rsa-pss",
3124
- options: RSAPSSKeyPairOptions<"der", "pem">,
3125
- ): Promise<{
3126
- publicKey: NonSharedBuffer;
3127
- privateKey: string;
3128
- }>;
3129
- function __promisify__(
3130
- type: "rsa-pss",
3131
- options: RSAPSSKeyPairOptions<"der", "der">,
3132
- ): Promise<{
3133
- publicKey: NonSharedBuffer;
3134
- privateKey: NonSharedBuffer;
3135
- }>;
3136
- function __promisify__(
3137
- type: "rsa-pss",
3138
- options: RSAPSSKeyPairKeyObjectOptions,
3139
- ): Promise<KeyPairKeyObjectResult>;
3140
- function __promisify__(
3141
- type: "dsa",
3142
- options: DSAKeyPairOptions<"pem", "pem">,
3143
- ): Promise<{
3144
- publicKey: string;
3145
- privateKey: string;
3146
- }>;
3147
- function __promisify__(
3148
- type: "dsa",
3149
- options: DSAKeyPairOptions<"pem", "der">,
3150
- ): Promise<{
3151
- publicKey: string;
3152
- privateKey: NonSharedBuffer;
3153
- }>;
3154
- function __promisify__(
3155
- type: "dsa",
3156
- options: DSAKeyPairOptions<"der", "pem">,
3157
- ): Promise<{
3158
- publicKey: NonSharedBuffer;
3159
- privateKey: string;
3160
- }>;
3161
- function __promisify__(
2757
+ function __promisify__<T extends DHKeyPairOptions>(
2758
+ type: "dh",
2759
+ options: T,
2760
+ ): Promise<KeyPairExportResult<T>>;
2761
+ function __promisify__<T extends DSAKeyPairOptions>(
3162
2762
  type: "dsa",
3163
- options: DSAKeyPairOptions<"der", "der">,
3164
- ): Promise<{
3165
- publicKey: NonSharedBuffer;
3166
- privateKey: NonSharedBuffer;
3167
- }>;
3168
- function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3169
- function __promisify__(
2763
+ options: T,
2764
+ ): Promise<KeyPairExportResult<T>>;
2765
+ function __promisify__<T extends ECKeyPairOptions>(
3170
2766
  type: "ec",
3171
- options: ECKeyPairOptions<"pem", "pem">,
3172
- ): Promise<{
3173
- publicKey: string;
3174
- privateKey: string;
3175
- }>;
3176
- function __promisify__(
3177
- type: "ec",
3178
- options: ECKeyPairOptions<"pem", "der">,
3179
- ): Promise<{
3180
- publicKey: string;
3181
- privateKey: NonSharedBuffer;
3182
- }>;
3183
- function __promisify__(
3184
- type: "ec",
3185
- options: ECKeyPairOptions<"der", "pem">,
3186
- ): Promise<{
3187
- publicKey: NonSharedBuffer;
3188
- privateKey: string;
3189
- }>;
3190
- function __promisify__(
3191
- type: "ec",
3192
- options: ECKeyPairOptions<"der", "der">,
3193
- ): Promise<{
3194
- publicKey: NonSharedBuffer;
3195
- privateKey: NonSharedBuffer;
3196
- }>;
3197
- function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3198
- function __promisify__(
3199
- type: "ed25519",
3200
- options: ED25519KeyPairOptions<"pem", "pem">,
3201
- ): Promise<{
3202
- publicKey: string;
3203
- privateKey: string;
3204
- }>;
3205
- function __promisify__(
3206
- type: "ed25519",
3207
- options: ED25519KeyPairOptions<"pem", "der">,
3208
- ): Promise<{
3209
- publicKey: string;
3210
- privateKey: NonSharedBuffer;
3211
- }>;
3212
- function __promisify__(
3213
- type: "ed25519",
3214
- options: ED25519KeyPairOptions<"der", "pem">,
3215
- ): Promise<{
3216
- publicKey: NonSharedBuffer;
3217
- privateKey: string;
3218
- }>;
3219
- function __promisify__(
2767
+ options: T,
2768
+ ): Promise<KeyPairExportResult<T>>;
2769
+ function __promisify__<T extends ED25519KeyPairOptions = {}>(
3220
2770
  type: "ed25519",
3221
- options: ED25519KeyPairOptions<"der", "der">,
3222
- ): Promise<{
3223
- publicKey: NonSharedBuffer;
3224
- privateKey: NonSharedBuffer;
3225
- }>;
3226
- function __promisify__(
3227
- type: "ed25519",
3228
- options?: ED25519KeyPairKeyObjectOptions,
3229
- ): Promise<KeyPairKeyObjectResult>;
3230
- function __promisify__(
3231
- type: "ed448",
3232
- options: ED448KeyPairOptions<"pem", "pem">,
3233
- ): Promise<{
3234
- publicKey: string;
3235
- privateKey: string;
3236
- }>;
3237
- function __promisify__(
3238
- type: "ed448",
3239
- options: ED448KeyPairOptions<"pem", "der">,
3240
- ): Promise<{
3241
- publicKey: string;
3242
- privateKey: NonSharedBuffer;
3243
- }>;
3244
- function __promisify__(
2771
+ options?: T,
2772
+ ): Promise<KeyPairExportResult<T>>;
2773
+ function __promisify__<T extends ED448KeyPairOptions = {}>(
3245
2774
  type: "ed448",
3246
- options: ED448KeyPairOptions<"der", "pem">,
3247
- ): Promise<{
3248
- publicKey: NonSharedBuffer;
3249
- privateKey: string;
3250
- }>;
3251
- function __promisify__(
3252
- type: "ed448",
3253
- options: ED448KeyPairOptions<"der", "der">,
3254
- ): Promise<{
3255
- publicKey: NonSharedBuffer;
3256
- privateKey: NonSharedBuffer;
3257
- }>;
3258
- function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
3259
- function __promisify__(
3260
- type: "x25519",
3261
- options: X25519KeyPairOptions<"pem", "pem">,
3262
- ): Promise<{
3263
- publicKey: string;
3264
- privateKey: string;
3265
- }>;
3266
- function __promisify__(
3267
- type: "x25519",
3268
- options: X25519KeyPairOptions<"pem", "der">,
3269
- ): Promise<{
3270
- publicKey: string;
3271
- privateKey: NonSharedBuffer;
3272
- }>;
3273
- function __promisify__(
3274
- type: "x25519",
3275
- options: X25519KeyPairOptions<"der", "pem">,
3276
- ): Promise<{
3277
- publicKey: NonSharedBuffer;
3278
- privateKey: string;
3279
- }>;
3280
- function __promisify__(
3281
- type: "x25519",
3282
- options: X25519KeyPairOptions<"der", "der">,
3283
- ): Promise<{
3284
- publicKey: NonSharedBuffer;
3285
- privateKey: NonSharedBuffer;
3286
- }>;
3287
- function __promisify__(
2775
+ options?: T,
2776
+ ): Promise<KeyPairExportResult<T>>;
2777
+ function __promisify__<T extends MLDSAKeyPairOptions = {}>(
2778
+ type: MLDSAKeyType,
2779
+ options?: T,
2780
+ ): Promise<KeyPairExportResult<T>>;
2781
+ function __promisify__<T extends MLKEMKeyPairOptions = {}>(
2782
+ type: MLKEMKeyType,
2783
+ options?: T,
2784
+ ): Promise<KeyPairExportResult<T>>;
2785
+ function __promisify__<T extends RSAPSSKeyPairOptions>(
2786
+ type: "rsa-pss",
2787
+ options: T,
2788
+ ): Promise<KeyPairExportResult<T>>;
2789
+ function __promisify__<T extends RSAKeyPairOptions>(
2790
+ type: "rsa",
2791
+ options: T,
2792
+ ): Promise<KeyPairExportResult<T>>;
2793
+ function __promisify__<T extends SLHDSAKeyPairOptions = {}>(
2794
+ type: SLHDSAKeyType,
2795
+ options?: T,
2796
+ ): Promise<KeyPairExportResult<T>>;
2797
+ function __promisify__<T extends X25519KeyPairOptions = {}>(
3288
2798
  type: "x25519",
3289
- options?: X25519KeyPairKeyObjectOptions,
3290
- ): Promise<KeyPairKeyObjectResult>;
3291
- function __promisify__(
2799
+ options?: T,
2800
+ ): Promise<KeyPairExportResult<T>>;
2801
+ function __promisify__<T extends X448KeyPairOptions = {}>(
3292
2802
  type: "x448",
3293
- options: X448KeyPairOptions<"pem", "pem">,
3294
- ): Promise<{
3295
- publicKey: string;
3296
- privateKey: string;
3297
- }>;
3298
- function __promisify__(
3299
- type: "x448",
3300
- options: X448KeyPairOptions<"pem", "der">,
3301
- ): Promise<{
3302
- publicKey: string;
3303
- privateKey: NonSharedBuffer;
3304
- }>;
3305
- function __promisify__(
3306
- type: "x448",
3307
- options: X448KeyPairOptions<"der", "pem">,
3308
- ): Promise<{
3309
- publicKey: NonSharedBuffer;
3310
- privateKey: string;
3311
- }>;
3312
- function __promisify__(
3313
- type: "x448",
3314
- options: X448KeyPairOptions<"der", "der">,
3315
- ): Promise<{
3316
- publicKey: NonSharedBuffer;
3317
- privateKey: NonSharedBuffer;
3318
- }>;
3319
- function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
2803
+ options?: T,
2804
+ ): Promise<KeyPairExportResult<T>>;
3320
2805
  }
3321
2806
  /**
3322
2807
  * Calculates and returns the signature for `data` using the given private key and
3323
2808
  * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
3324
- * dependent upon the key type (especially Ed25519 and Ed448).
2809
+ * dependent upon the key type.
2810
+ *
2811
+ * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
2812
+ * ML-DSA.
3325
2813
  *
3326
2814
  * If `key` is not a `KeyObject`, this function behaves as if `key` had been
3327
2815
  * passed to {@link createPrivateKey}. If it is an object, the following
@@ -3342,8 +2830,12 @@ declare module "crypto" {
3342
2830
  callback: (error: Error | null, data: NonSharedBuffer) => void,
3343
2831
  ): void;
3344
2832
  /**
3345
- * Verifies the given signature for `data` using the given key and algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
3346
- * key type (especially Ed25519 and Ed448).
2833
+ * Verifies the given signature for `data` using the given key and algorithm. If
2834
+ * `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
2835
+ * key type.
2836
+ *
2837
+ * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
2838
+ * ML-DSA.
3347
2839
  *
3348
2840
  * If `key` is not a `KeyObject`, this function behaves as if `key` had been
3349
2841
  * passed to {@link createPublicKey}. If it is an object, the following
@@ -3371,16 +2863,102 @@ declare module "crypto" {
3371
2863
  callback: (error: Error | null, result: boolean) => void,
3372
2864
  ): void;
3373
2865
  /**
3374
- * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`.
3375
- * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'` (for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES).
2866
+ * Key decapsulation using a KEM algorithm with a private key.
2867
+ *
2868
+ * Supported key types and their KEM algorithms are:
2869
+ *
2870
+ * * `'rsa'` RSA Secret Value Encapsulation
2871
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
2872
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
2873
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
2874
+ * * `'ml-kem-512'` ML-KEM
2875
+ * * `'ml-kem-768'` ML-KEM
2876
+ * * `'ml-kem-1024'` ML-KEM
2877
+ *
2878
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
2879
+ * passed to `crypto.createPrivateKey()`.
2880
+ *
2881
+ * If the `callback` function is provided this function uses libuv's threadpool.
2882
+ * @since v24.7.0
2883
+ */
2884
+ function decapsulate(
2885
+ key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
2886
+ ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
2887
+ ): NonSharedBuffer;
2888
+ function decapsulate(
2889
+ key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
2890
+ ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
2891
+ callback: (err: Error, sharedKey: NonSharedBuffer) => void,
2892
+ ): void;
2893
+ /**
2894
+ * Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
2895
+ * Both keys must have the same `asymmetricKeyType` and must support either the DH or
2896
+ * ECDH operation.
2897
+ *
2898
+ * If the `callback` function is provided this function uses libuv's threadpool.
3376
2899
  * @since v13.9.0, v12.17.0
3377
2900
  */
3378
2901
  function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
2902
+ function diffieHellman(
2903
+ options: { privateKey: KeyObject; publicKey: KeyObject },
2904
+ callback: (err: Error | null, secret: NonSharedBuffer) => void,
2905
+ ): void;
3379
2906
  /**
3380
- * A utility for creating one-shot hash digests of data. It can be faster than the object-based `crypto.createHash()` when hashing a smaller amount of data
3381
- * (<= 5MB) that's readily available. If the data can be big or if it is streamed, it's still recommended to use `crypto.createHash()` instead. The `algorithm`
3382
- * is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. On recent releases
3383
- * of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms.
2907
+ * Key encapsulation using a KEM algorithm with a public key.
2908
+ *
2909
+ * Supported key types and their KEM algorithms are:
2910
+ *
2911
+ * * `'rsa'` RSA Secret Value Encapsulation
2912
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
2913
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
2914
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
2915
+ * * `'ml-kem-512'` ML-KEM
2916
+ * * `'ml-kem-768'` ML-KEM
2917
+ * * `'ml-kem-1024'` ML-KEM
2918
+ *
2919
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
2920
+ * passed to `crypto.createPublicKey()`.
2921
+ *
2922
+ * If the `callback` function is provided this function uses libuv's threadpool.
2923
+ * @since v24.7.0
2924
+ */
2925
+ function encapsulate(
2926
+ key: KeyLike | PublicKeyInput | JsonWebKeyInput,
2927
+ ): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
2928
+ function encapsulate(
2929
+ key: KeyLike | PublicKeyInput | JsonWebKeyInput,
2930
+ callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
2931
+ ): void;
2932
+ interface OneShotDigestOptions {
2933
+ /**
2934
+ * Encoding used to encode the returned digest.
2935
+ * @default 'hex'
2936
+ */
2937
+ outputEncoding?: BinaryToTextEncoding | "buffer" | undefined;
2938
+ /**
2939
+ * For XOF hash functions such as 'shake256', the outputLength option
2940
+ * can be used to specify the desired output length in bytes.
2941
+ */
2942
+ outputLength?: number | undefined;
2943
+ }
2944
+ interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions {
2945
+ outputEncoding?: BinaryToTextEncoding | undefined;
2946
+ }
2947
+ interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions {
2948
+ outputEncoding: "buffer";
2949
+ }
2950
+ /**
2951
+ * A utility for creating one-shot hash digests of data. It can be faster than
2952
+ * the object-based `crypto.createHash()` when hashing a smaller amount of data
2953
+ * (<= 5MB) that's readily available. If the data can be big or if it is streamed,
2954
+ * it's still recommended to use `crypto.createHash()` instead.
2955
+ *
2956
+ * The `algorithm` is dependent on the available algorithms supported by the
2957
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
2958
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
2959
+ * display the available digest algorithms.
2960
+ *
2961
+ * If `options` is a string, then it specifies the `outputEncoding`.
3384
2962
  *
3385
2963
  * Example:
3386
2964
  *
@@ -3400,16 +2978,25 @@ declare module "crypto" {
3400
2978
  * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));
3401
2979
  * ```
3402
2980
  * @since v21.7.0, v20.12.0
3403
- * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user
3404
- * could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead.
3405
- * @param [outputEncoding='hex'] [Encoding](https://nodejs.org/docs/latest-v22.x/api/buffer.html#buffers-and-character-encodings) used to encode the returned digest.
2981
+ * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different
2982
+ * input encoding is desired for a string input, user could encode the string
2983
+ * into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing
2984
+ * the encoded `TypedArray` into this API instead.
3406
2985
  */
3407
- function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
3408
- function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): NonSharedBuffer;
3409
2986
  function hash(
3410
2987
  algorithm: string,
3411
2988
  data: BinaryLike,
3412
- outputEncoding?: BinaryToTextEncoding | "buffer",
2989
+ options?: OneShotDigestOptionsWithStringEncoding | BinaryToTextEncoding,
2990
+ ): string;
2991
+ function hash(
2992
+ algorithm: string,
2993
+ data: BinaryLike,
2994
+ options: OneShotDigestOptionsWithBufferEncoding | "buffer",
2995
+ ): NonSharedBuffer;
2996
+ function hash(
2997
+ algorithm: string,
2998
+ data: BinaryLike,
2999
+ options: OneShotDigestOptions | BinaryToTextEncoding | "buffer",
3413
3000
  ): string | NonSharedBuffer;
3414
3001
  type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
3415
3002
  interface CipherInfoOptions {
@@ -3712,6 +3299,16 @@ declare module "crypto" {
3712
3299
  * @since v15.6.0
3713
3300
  */
3714
3301
  readonly serialNumber: string;
3302
+ /**
3303
+ * The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL.
3304
+ * @since v24.9.0
3305
+ */
3306
+ readonly signatureAlgorithm: string | undefined;
3307
+ /**
3308
+ * The OID of the algorithm used to sign the certificate.
3309
+ * @since v24.9.0
3310
+ */
3311
+ readonly signatureAlgorithmOid: string;
3715
3312
  /**
3716
3313
  * The date/time from which this certificate is considered valid.
3717
3314
  * @since v15.6.0
@@ -3983,7 +3580,136 @@ declare module "crypto" {
3983
3580
  * @since v17.4.0
3984
3581
  * @return Returns `typedArray`.
3985
3582
  */
3986
- function getRandomValues<T extends webcrypto.BufferSource>(typedArray: T): T;
3583
+ function getRandomValues<
3584
+ T extends Exclude<
3585
+ NodeJS.NonSharedTypedArray,
3586
+ NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array
3587
+ >,
3588
+ >(typedArray: T): T;
3589
+ type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
3590
+ interface Argon2Parameters {
3591
+ /**
3592
+ * REQUIRED, this is the password for password hashing applications of Argon2.
3593
+ */
3594
+ message: string | ArrayBuffer | NodeJS.ArrayBufferView;
3595
+ /**
3596
+ * REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.
3597
+ */
3598
+ nonce: string | ArrayBuffer | NodeJS.ArrayBufferView;
3599
+ /**
3600
+ * REQUIRED, degree of parallelism determines how many computational chains (lanes)
3601
+ * can be run. Must be greater than 1 and less than `2**24-1`.
3602
+ */
3603
+ parallelism: number;
3604
+ /**
3605
+ * REQUIRED, the length of the key to generate. Must be greater than 4 and
3606
+ * less than `2**32-1`.
3607
+ */
3608
+ tagLength: number;
3609
+ /**
3610
+ * REQUIRED, memory cost in 1KiB blocks. Must be greater than
3611
+ * `8 * parallelism` and less than `2**32-1`. The actual number of blocks is rounded
3612
+ * down to the nearest multiple of `4 * parallelism`.
3613
+ */
3614
+ memory: number;
3615
+ /**
3616
+ * REQUIRED, number of passes (iterations). Must be greater than 1 and less
3617
+ * than `2**32-1`.
3618
+ */
3619
+ passes: number;
3620
+ /**
3621
+ * OPTIONAL, Random additional input,
3622
+ * similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in
3623
+ * password hashing applications. If used, must have a length not greater than `2**32-1` bytes.
3624
+ */
3625
+ secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
3626
+ /**
3627
+ * OPTIONAL, Additional data to
3628
+ * be added to the hash, functionally equivalent to salt or secret, but meant for
3629
+ * non-random data. If used, must have a length not greater than `2**32-1` bytes.
3630
+ */
3631
+ associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
3632
+ }
3633
+ /**
3634
+ * Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
3635
+ * key derivation function that is designed to be expensive computationally and
3636
+ * memory-wise in order to make brute-force attacks unrewarding.
3637
+ *
3638
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
3639
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
3640
+ *
3641
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
3642
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
3643
+ *
3644
+ * The `callback` function is called with two arguments: `err` and `derivedKey`.
3645
+ * `err` is an exception object when key derivation fails, otherwise `err` is
3646
+ * `null`. `derivedKey` is passed to the callback as a `Buffer`.
3647
+ *
3648
+ * An exception is thrown when any of the input arguments specify invalid values
3649
+ * or types.
3650
+ *
3651
+ * ```js
3652
+ * const { argon2, randomBytes } = await import('node:crypto');
3653
+ *
3654
+ * const parameters = {
3655
+ * message: 'password',
3656
+ * nonce: randomBytes(16),
3657
+ * parallelism: 4,
3658
+ * tagLength: 64,
3659
+ * memory: 65536,
3660
+ * passes: 3,
3661
+ * };
3662
+ *
3663
+ * argon2('argon2id', parameters, (err, derivedKey) => {
3664
+ * if (err) throw err;
3665
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
3666
+ * });
3667
+ * ```
3668
+ * @since v24.7.0
3669
+ * @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
3670
+ * @experimental
3671
+ */
3672
+ function argon2(
3673
+ algorithm: Argon2Algorithm,
3674
+ parameters: Argon2Parameters,
3675
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
3676
+ ): void;
3677
+ /**
3678
+ * Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
3679
+ * key derivation function that is designed to be expensive computationally and
3680
+ * memory-wise in order to make brute-force attacks unrewarding.
3681
+ *
3682
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
3683
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
3684
+ *
3685
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
3686
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v25.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
3687
+ *
3688
+ * An exception is thrown when key derivation fails, otherwise the derived key is
3689
+ * returned as a `Buffer`.
3690
+ *
3691
+ * An exception is thrown when any of the input arguments specify invalid values
3692
+ * or types.
3693
+ *
3694
+ * ```js
3695
+ * const { argon2Sync, randomBytes } = await import('node:crypto');
3696
+ *
3697
+ * const parameters = {
3698
+ * message: 'password',
3699
+ * nonce: randomBytes(16),
3700
+ * parallelism: 4,
3701
+ * tagLength: 64,
3702
+ * memory: 65536,
3703
+ * passes: 3,
3704
+ * };
3705
+ *
3706
+ * const derivedKey = argon2Sync('argon2id', parameters);
3707
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
3708
+ * ```
3709
+ * @since v24.7.0
3710
+ * @experimental
3711
+ */
3712
+ function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
3987
3713
  /**
3988
3714
  * A convenient alias for `crypto.webcrypto.subtle`.
3989
3715
  * @since v17.4.0
@@ -3997,37 +3723,40 @@ declare module "crypto" {
3997
3723
  */
3998
3724
  const webcrypto: webcrypto.Crypto;
3999
3725
  namespace webcrypto {
4000
- type BufferSource = ArrayBufferView | ArrayBuffer;
4001
- type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
3726
+ type AlgorithmIdentifier = Algorithm | string;
3727
+ type BigInteger = NodeJS.NonSharedUint8Array;
3728
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
4002
3729
  type KeyType = "private" | "public" | "secret";
4003
3730
  type KeyUsage =
3731
+ | "decapsulateBits"
3732
+ | "decapsulateKey"
4004
3733
  | "decrypt"
4005
3734
  | "deriveBits"
4006
3735
  | "deriveKey"
3736
+ | "encapsulateBits"
3737
+ | "encapsulateKey"
4007
3738
  | "encrypt"
4008
3739
  | "sign"
4009
3740
  | "unwrapKey"
4010
3741
  | "verify"
4011
3742
  | "wrapKey";
4012
- type AlgorithmIdentifier = Algorithm | string;
4013
3743
  type HashAlgorithmIdentifier = AlgorithmIdentifier;
4014
3744
  type NamedCurve = string;
4015
- type BigInteger = Uint8Array;
3745
+ interface AeadParams extends Algorithm {
3746
+ additionalData?: NodeJS.BufferSource;
3747
+ iv: NodeJS.BufferSource;
3748
+ tagLength: number;
3749
+ }
4016
3750
  interface AesCbcParams extends Algorithm {
4017
- iv: BufferSource;
3751
+ iv: NodeJS.BufferSource;
4018
3752
  }
4019
3753
  interface AesCtrParams extends Algorithm {
4020
- counter: BufferSource;
3754
+ counter: NodeJS.BufferSource;
4021
3755
  length: number;
4022
3756
  }
4023
3757
  interface AesDerivedKeyParams extends Algorithm {
4024
3758
  length: number;
4025
3759
  }
4026
- interface AesGcmParams extends Algorithm {
4027
- additionalData?: BufferSource;
4028
- iv: BufferSource;
4029
- tagLength?: number;
4030
- }
4031
3760
  interface AesKeyAlgorithm extends KeyAlgorithm {
4032
3761
  length: number;
4033
3762
  }
@@ -4037,6 +3766,23 @@ declare module "crypto" {
4037
3766
  interface Algorithm {
4038
3767
  name: string;
4039
3768
  }
3769
+ interface Argon2Params extends Algorithm {
3770
+ associatedData?: NodeJS.BufferSource;
3771
+ memory: number;
3772
+ nonce: NodeJS.BufferSource;
3773
+ parallelism: number;
3774
+ passes: number;
3775
+ secretValue?: NodeJS.BufferSource;
3776
+ version?: number;
3777
+ }
3778
+ interface CShakeParams extends Algorithm {
3779
+ customization?: NodeJS.BufferSource;
3780
+ functionName?: NodeJS.BufferSource;
3781
+ outputLength: number;
3782
+ }
3783
+ interface ContextParams extends Algorithm {
3784
+ context?: NodeJS.BufferSource;
3785
+ }
4040
3786
  interface EcKeyAlgorithm extends KeyAlgorithm {
4041
3787
  namedCurve: NamedCurve;
4042
3788
  }
@@ -4052,13 +3798,10 @@ declare module "crypto" {
4052
3798
  interface EcdsaParams extends Algorithm {
4053
3799
  hash: HashAlgorithmIdentifier;
4054
3800
  }
4055
- interface Ed448Params extends Algorithm {
4056
- context?: BufferSource;
4057
- }
4058
3801
  interface HkdfParams extends Algorithm {
4059
3802
  hash: HashAlgorithmIdentifier;
4060
- info: BufferSource;
4061
- salt: BufferSource;
3803
+ info: NodeJS.BufferSource;
3804
+ salt: NodeJS.BufferSource;
4062
3805
  }
4063
3806
  interface HmacImportParams extends Algorithm {
4064
3807
  hash: HashAlgorithmIdentifier;
@@ -4072,6 +3815,10 @@ declare module "crypto" {
4072
3815
  hash: HashAlgorithmIdentifier;
4073
3816
  length?: number;
4074
3817
  }
3818
+ interface KangarooTwelveParams {
3819
+ customization?: NodeJS.BufferSource;
3820
+ outputLength: number;
3821
+ }
4075
3822
  interface JsonWebKey {
4076
3823
  alg?: string;
4077
3824
  crv?: string;
@@ -4095,10 +3842,23 @@ declare module "crypto" {
4095
3842
  interface KeyAlgorithm {
4096
3843
  name: string;
4097
3844
  }
3845
+ interface KmacImportParams extends Algorithm {
3846
+ length?: number;
3847
+ }
3848
+ interface KmacKeyAlgorithm extends KeyAlgorithm {
3849
+ length: number;
3850
+ }
3851
+ interface KmacKeyGenParams extends Algorithm {
3852
+ length?: number;
3853
+ }
3854
+ interface KmacParams extends Algorithm {
3855
+ customization?: NodeJS.BufferSource;
3856
+ outputLength: number;
3857
+ }
4098
3858
  interface Pbkdf2Params extends Algorithm {
4099
3859
  hash: HashAlgorithmIdentifier;
4100
3860
  iterations: number;
4101
- salt: BufferSource;
3861
+ salt: NodeJS.BufferSource;
4102
3862
  }
4103
3863
  interface RsaHashedImportParams extends Algorithm {
4104
3864
  hash: HashAlgorithmIdentifier;
@@ -4118,7 +3878,7 @@ declare module "crypto" {
4118
3878
  publicExponent: BigInteger;
4119
3879
  }
4120
3880
  interface RsaOaepParams extends Algorithm {
4121
- label?: BufferSource;
3881
+ label?: NodeJS.BufferSource;
4122
3882
  }
4123
3883
  interface RsaOtherPrimesInfo {
4124
3884
  d?: string;
@@ -4128,269 +3888,110 @@ declare module "crypto" {
4128
3888
  interface RsaPssParams extends Algorithm {
4129
3889
  saltLength: number;
4130
3890
  }
4131
- /**
4132
- * Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
4133
- * `Crypto` is a singleton that provides access to the remainder of the crypto API.
4134
- * @since v15.0.0
4135
- */
3891
+ interface TurboShakeParams {
3892
+ domainSeparation?: number;
3893
+ outputLength: number;
3894
+ }
4136
3895
  interface Crypto {
4137
- /**
4138
- * Provides access to the `SubtleCrypto` API.
4139
- * @since v15.0.0
4140
- */
4141
3896
  readonly subtle: SubtleCrypto;
4142
- /**
4143
- * Generates cryptographically strong random values.
4144
- * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned.
4145
- *
4146
- * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted.
4147
- *
4148
- * An error will be thrown if the given `typedArray` is larger than 65,536 bytes.
4149
- * @since v15.0.0
4150
- */
4151
- getRandomValues<T extends Exclude<NodeJS.TypedArray, Float32Array | Float64Array>>(typedArray: T): T;
4152
- /**
4153
- * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID.
4154
- * The UUID is generated using a cryptographic pseudorandom number generator.
4155
- * @since v16.7.0
4156
- */
3897
+ getRandomValues<
3898
+ T extends Exclude<
3899
+ NodeJS.NonSharedTypedArray,
3900
+ NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array
3901
+ >,
3902
+ >(
3903
+ typedArray: T,
3904
+ ): T;
4157
3905
  randomUUID(): UUID;
4158
- CryptoKey: CryptoKeyConstructor;
4159
- }
4160
- // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable.
4161
- interface CryptoKeyConstructor {
4162
- /** Illegal constructor */
4163
- (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user.
4164
- readonly length: 0;
4165
- readonly name: "CryptoKey";
4166
- readonly prototype: CryptoKey;
4167
3906
  }
4168
- /**
4169
- * @since v15.0.0
4170
- */
4171
3907
  interface CryptoKey {
4172
- /**
4173
- * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
4174
- * @since v15.0.0
4175
- */
4176
3908
  readonly algorithm: KeyAlgorithm;
4177
- /**
4178
- * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`.
4179
- * @since v15.0.0
4180
- */
4181
3909
  readonly extractable: boolean;
4182
- /**
4183
- * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key.
4184
- * @since v15.0.0
4185
- */
4186
3910
  readonly type: KeyType;
4187
- /**
4188
- * An array of strings identifying the operations for which the key may be used.
4189
- *
4190
- * The possible usages are:
4191
- * - `'encrypt'` - The key may be used to encrypt data.
4192
- * - `'decrypt'` - The key may be used to decrypt data.
4193
- * - `'sign'` - The key may be used to generate digital signatures.
4194
- * - `'verify'` - The key may be used to verify digital signatures.
4195
- * - `'deriveKey'` - The key may be used to derive a new key.
4196
- * - `'deriveBits'` - The key may be used to derive bits.
4197
- * - `'wrapKey'` - The key may be used to wrap another key.
4198
- * - `'unwrapKey'` - The key may be used to unwrap another key.
4199
- *
4200
- * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`).
4201
- * @since v15.0.0
4202
- */
4203
3911
  readonly usages: KeyUsage[];
4204
3912
  }
4205
- /**
4206
- * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair.
4207
- * @since v15.0.0
4208
- */
4209
3913
  interface CryptoKeyPair {
4210
- /**
4211
- * A {@link CryptoKey} whose type will be `'private'`.
4212
- * @since v15.0.0
4213
- */
4214
3914
  privateKey: CryptoKey;
4215
- /**
4216
- * A {@link CryptoKey} whose type will be `'public'`.
4217
- * @since v15.0.0
4218
- */
4219
3915
  publicKey: CryptoKey;
4220
3916
  }
4221
- /**
4222
- * @since v15.0.0
4223
- */
3917
+ interface EncapsulatedBits {
3918
+ sharedKey: ArrayBuffer;
3919
+ ciphertext: ArrayBuffer;
3920
+ }
3921
+ interface EncapsulatedKey {
3922
+ sharedKey: CryptoKey;
3923
+ ciphertext: ArrayBuffer;
3924
+ }
4224
3925
  interface SubtleCrypto {
4225
- /**
4226
- * Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
4227
- * `subtle.decrypt()` attempts to decipher the provided `data`. If successful,
4228
- * the returned promise will be resolved with an `<ArrayBuffer>` containing the plaintext result.
4229
- *
4230
- * The algorithms currently supported include:
4231
- *
4232
- * - `'RSA-OAEP'`
4233
- * - `'AES-CTR'`
4234
- * - `'AES-CBC'`
4235
- * - `'AES-GCM'`
4236
- * @since v15.0.0
4237
- */
3926
+ decapsulateBits(
3927
+ decapsulationAlgorithm: AlgorithmIdentifier,
3928
+ decapsulationKey: CryptoKey,
3929
+ ciphertext: NodeJS.BufferSource,
3930
+ ): Promise<ArrayBuffer>;
3931
+ decapsulateKey(
3932
+ decapsulationAlgorithm: AlgorithmIdentifier,
3933
+ decapsulationKey: CryptoKey,
3934
+ ciphertext: NodeJS.BufferSource,
3935
+ sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
3936
+ extractable: boolean,
3937
+ usages: KeyUsage[],
3938
+ ): Promise<CryptoKey>;
4238
3939
  decrypt(
4239
- algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
3940
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4240
3941
  key: CryptoKey,
4241
- data: BufferSource,
3942
+ data: NodeJS.BufferSource,
4242
3943
  ): Promise<ArrayBuffer>;
4243
- /**
4244
- * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`,
4245
- * `subtle.deriveBits()` attempts to generate `length` bits.
4246
- * The Node.js implementation requires that when `length` is a number it must be multiple of `8`.
4247
- * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed
4248
- * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms.
4249
- * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the generated data.
4250
- *
4251
- * The algorithms currently supported include:
4252
- *
4253
- * - `'ECDH'`
4254
- * - `'X25519'`
4255
- * - `'X448'`
4256
- * - `'HKDF'`
4257
- * - `'PBKDF2'`
4258
- * @since v15.0.0
4259
- */
4260
3944
  deriveBits(
4261
- algorithm: EcdhKeyDeriveParams,
3945
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
4262
3946
  baseKey: CryptoKey,
4263
3947
  length?: number | null,
4264
3948
  ): Promise<ArrayBuffer>;
4265
- deriveBits(
4266
- algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
4267
- baseKey: CryptoKey,
4268
- length: number,
4269
- ): Promise<ArrayBuffer>;
4270
- /**
4271
- * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`,
4272
- * `subtle.deriveKey()` attempts to generate a new <CryptoKey>` based on the method and parameters in `derivedKeyAlgorithm`.
4273
- *
4274
- * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material,
4275
- * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input.
4276
- *
4277
- * The algorithms currently supported include:
4278
- *
4279
- * - `'ECDH'`
4280
- * - `'X25519'`
4281
- * - `'X448'`
4282
- * - `'HKDF'`
4283
- * - `'PBKDF2'`
4284
- * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4285
- * @since v15.0.0
4286
- */
4287
3949
  deriveKey(
4288
- algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
3950
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
4289
3951
  baseKey: CryptoKey,
4290
- derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
3952
+ derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
4291
3953
  extractable: boolean,
4292
3954
  keyUsages: readonly KeyUsage[],
4293
3955
  ): Promise<CryptoKey>;
4294
- /**
4295
- * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`.
4296
- * If successful, the returned promise is resolved with an `<ArrayBuffer>` containing the computed digest.
4297
- *
4298
- * If `algorithm` is provided as a `<string>`, it must be one of:
4299
- *
4300
- * - `'SHA-1'`
4301
- * - `'SHA-256'`
4302
- * - `'SHA-384'`
4303
- * - `'SHA-512'`
4304
- *
4305
- * If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
4306
- * @since v15.0.0
4307
- */
4308
- digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
4309
- /**
4310
- * Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
4311
- * `subtle.encrypt()` attempts to encipher `data`. If successful,
4312
- * the returned promise is resolved with an `<ArrayBuffer>` containing the encrypted result.
4313
- *
4314
- * The algorithms currently supported include:
4315
- *
4316
- * - `'RSA-OAEP'`
4317
- * - `'AES-CTR'`
4318
- * - `'AES-CBC'`
4319
- * - `'AES-GCM'`
4320
- * @since v15.0.0
4321
- */
3956
+ digest(
3957
+ algorithm: AlgorithmIdentifier | CShakeParams | TurboShakeParams | KangarooTwelveParams,
3958
+ data: NodeJS.BufferSource,
3959
+ ): Promise<ArrayBuffer>;
3960
+ encapsulateBits(
3961
+ encapsulationAlgorithm: AlgorithmIdentifier,
3962
+ encapsulationKey: CryptoKey,
3963
+ ): Promise<EncapsulatedBits>;
3964
+ encapsulateKey(
3965
+ encapsulationAlgorithm: AlgorithmIdentifier,
3966
+ encapsulationKey: CryptoKey,
3967
+ sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
3968
+ extractable: boolean,
3969
+ usages: KeyUsage[],
3970
+ ): Promise<EncapsulatedKey>;
4322
3971
  encrypt(
4323
- algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
3972
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4324
3973
  key: CryptoKey,
4325
- data: BufferSource,
3974
+ data: NodeJS.BufferSource,
4326
3975
  ): Promise<ArrayBuffer>;
4327
- /**
4328
- * Exports the given key into the specified format, if supported.
4329
- *
4330
- * If the `<CryptoKey>` is not extractable, the returned promise will reject.
4331
- *
4332
- * When `format` is either `'pkcs8'` or `'spki'` and the export is successful,
4333
- * the returned promise will be resolved with an `<ArrayBuffer>` containing the exported key data.
4334
- *
4335
- * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a
4336
- * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification.
4337
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
4338
- * @returns `<Promise>` containing `<ArrayBuffer>`.
4339
- * @since v15.0.0
4340
- */
4341
3976
  exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
4342
3977
  exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
4343
- /**
4344
- * Using the method and parameters provided in `algorithm`,
4345
- * `subtle.generateKey()` attempts to generate new keying material.
4346
- * Depending the method used, the method may generate either a single `<CryptoKey>` or a `<CryptoKeyPair>`.
4347
- *
4348
- * The `<CryptoKeyPair>` (public and private key) generating algorithms supported include:
4349
- *
4350
- * - `'RSASSA-PKCS1-v1_5'`
4351
- * - `'RSA-PSS'`
4352
- * - `'RSA-OAEP'`
4353
- * - `'ECDSA'`
4354
- * - `'Ed25519'`
4355
- * - `'Ed448'`
4356
- * - `'ECDH'`
4357
- * - `'X25519'`
4358
- * - `'X448'`
4359
- * The `<CryptoKey>` (secret key) generating algorithms supported include:
4360
- *
4361
- * - `'HMAC'`
4362
- * - `'AES-CTR'`
4363
- * - `'AES-CBC'`
4364
- * - `'AES-GCM'`
4365
- * - `'AES-KW'`
4366
- * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4367
- * @since v15.0.0
4368
- */
3978
+ exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
4369
3979
  generateKey(
4370
3980
  algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
4371
3981
  extractable: boolean,
4372
- keyUsages: readonly KeyUsage[],
3982
+ keyUsages: KeyUsage[],
4373
3983
  ): Promise<CryptoKeyPair>;
4374
3984
  generateKey(
4375
- algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,
3985
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
4376
3986
  extractable: boolean,
4377
- keyUsages: readonly KeyUsage[],
3987
+ keyUsages: KeyUsage[],
4378
3988
  ): Promise<CryptoKey>;
4379
3989
  generateKey(
4380
3990
  algorithm: AlgorithmIdentifier,
4381
3991
  extractable: boolean,
4382
3992
  keyUsages: KeyUsage[],
4383
3993
  ): Promise<CryptoKeyPair | CryptoKey>;
4384
- /**
4385
- * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format`
4386
- * to create a `<CryptoKey>` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments.
4387
- * If the import is successful, the returned promise will be resolved with the created `<CryptoKey>`.
4388
- *
4389
- * If importing a `'PBKDF2'` key, `extractable` must be `false`.
4390
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
4391
- * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4392
- * @since v15.0.0
4393
- */
3994
+ getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
4394
3995
  importKey(
4395
3996
  format: "jwk",
4396
3997
  keyData: JsonWebKey,
@@ -4399,147 +4000,59 @@ declare module "crypto" {
4399
4000
  | RsaHashedImportParams
4400
4001
  | EcKeyImportParams
4401
4002
  | HmacImportParams
4402
- | AesKeyAlgorithm,
4003
+ | AesKeyAlgorithm
4004
+ | KmacImportParams,
4403
4005
  extractable: boolean,
4404
- keyUsages: readonly KeyUsage[],
4006
+ keyUsages: KeyUsage[],
4405
4007
  ): Promise<CryptoKey>;
4406
4008
  importKey(
4407
4009
  format: Exclude<KeyFormat, "jwk">,
4408
- keyData: BufferSource,
4010
+ keyData: NodeJS.BufferSource,
4409
4011
  algorithm:
4410
4012
  | AlgorithmIdentifier
4411
4013
  | RsaHashedImportParams
4412
4014
  | EcKeyImportParams
4413
4015
  | HmacImportParams
4414
- | AesKeyAlgorithm,
4016
+ | AesKeyAlgorithm
4017
+ | KmacImportParams,
4415
4018
  extractable: boolean,
4416
4019
  keyUsages: KeyUsage[],
4417
4020
  ): Promise<CryptoKey>;
4418
- /**
4419
- * Using the method and parameters given by `algorithm` and the keying material provided by `key`,
4420
- * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful,
4421
- * the returned promise is resolved with an `<ArrayBuffer>` containing the generated signature.
4422
- *
4423
- * The algorithms currently supported include:
4424
- *
4425
- * - `'RSASSA-PKCS1-v1_5'`
4426
- * - `'RSA-PSS'`
4427
- * - `'ECDSA'`
4428
- * - `'Ed25519'`
4429
- * - `'Ed448'`
4430
- * - `'HMAC'`
4431
- * @since v15.0.0
4432
- */
4433
4021
  sign(
4434
- algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4022
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
4435
4023
  key: CryptoKey,
4436
- data: BufferSource,
4024
+ data: NodeJS.BufferSource,
4437
4025
  ): Promise<ArrayBuffer>;
4438
- /**
4439
- * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
4440
- * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `<CryptoKey>` instance.
4441
- * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input)
4442
- * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs.
4443
- * If successful, the returned promise is resolved with a `<CryptoKey>` object.
4444
- *
4445
- * The wrapping algorithms currently supported include:
4446
- *
4447
- * - `'RSA-OAEP'`
4448
- * - `'AES-CTR'`
4449
- * - `'AES-CBC'`
4450
- * - `'AES-GCM'`
4451
- * - `'AES-KW'`
4452
- *
4453
- * The unwrapped key algorithms supported include:
4454
- *
4455
- * - `'RSASSA-PKCS1-v1_5'`
4456
- * - `'RSA-PSS'`
4457
- * - `'RSA-OAEP'`
4458
- * - `'ECDSA'`
4459
- * - `'Ed25519'`
4460
- * - `'Ed448'`
4461
- * - `'ECDH'`
4462
- * - `'X25519'`
4463
- * - `'X448'`
4464
- * - `'HMAC'`
4465
- * - `'AES-CTR'`
4466
- * - `'AES-CBC'`
4467
- * - `'AES-GCM'`
4468
- * - `'AES-KW'`
4469
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
4470
- * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}.
4471
- * @since v15.0.0
4472
- */
4473
4026
  unwrapKey(
4474
4027
  format: KeyFormat,
4475
- wrappedKey: BufferSource,
4028
+ wrappedKey: NodeJS.BufferSource,
4476
4029
  unwrappingKey: CryptoKey,
4477
- unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4030
+ unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4478
4031
  unwrappedKeyAlgorithm:
4479
4032
  | AlgorithmIdentifier
4480
4033
  | RsaHashedImportParams
4481
4034
  | EcKeyImportParams
4482
4035
  | HmacImportParams
4483
- | AesKeyAlgorithm,
4036
+ | AesKeyAlgorithm
4037
+ | KmacImportParams,
4484
4038
  extractable: boolean,
4485
4039
  keyUsages: KeyUsage[],
4486
4040
  ): Promise<CryptoKey>;
4487
- /**
4488
- * Using the method and parameters given in `algorithm` and the keying material provided by `key`,
4489
- * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`.
4490
- * The returned promise is resolved with either `true` or `false`.
4491
- *
4492
- * The algorithms currently supported include:
4493
- *
4494
- * - `'RSASSA-PKCS1-v1_5'`
4495
- * - `'RSA-PSS'`
4496
- * - `'ECDSA'`
4497
- * - `'Ed25519'`
4498
- * - `'Ed448'`
4499
- * - `'HMAC'`
4500
- * @since v15.0.0
4501
- */
4502
4041
  verify(
4503
- algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params,
4042
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
4504
4043
  key: CryptoKey,
4505
- signature: BufferSource,
4506
- data: BufferSource,
4044
+ signature: NodeJS.BufferSource,
4045
+ data: NodeJS.BufferSource,
4507
4046
  ): Promise<boolean>;
4508
- /**
4509
- * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material.
4510
- * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`,
4511
- * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`.
4512
- * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments,
4513
- * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs.
4514
- * If successful, the returned promise will be resolved with an `<ArrayBuffer>` containing the encrypted key data.
4515
- *
4516
- * The wrapping algorithms currently supported include:
4517
- *
4518
- * - `'RSA-OAEP'`
4519
- * - `'AES-CTR'`
4520
- * - `'AES-CBC'`
4521
- * - `'AES-GCM'`
4522
- * - `'AES-KW'`
4523
- * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`.
4524
- * @since v15.0.0
4525
- */
4526
4047
  wrapKey(
4527
4048
  format: KeyFormat,
4528
4049
  key: CryptoKey,
4529
4050
  wrappingKey: CryptoKey,
4530
- wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams,
4051
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
4531
4052
  ): Promise<ArrayBuffer>;
4532
4053
  }
4533
4054
  }
4534
-
4535
- global {
4536
- var crypto: typeof globalThis extends {
4537
- crypto: infer T;
4538
- onmessage: any;
4539
- } ? T
4540
- : webcrypto.Crypto;
4541
- }
4542
4055
  }
4543
- declare module "node:crypto" {
4544
- export * from "crypto";
4056
+ declare module "crypto" {
4057
+ export * from "node:crypto";
4545
4058
  }