@coro-ai/runner 0.1.33 → 0.1.36

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 (1013) hide show
  1. package/dashboard-dist/assets/{index-C7l2FOsX.js → index-DVdRvXW2.js} +1 -1
  2. package/dashboard-dist/index.html +1 -1
  3. package/dist/src/clients/github.d.ts +21 -10
  4. package/dist/src/clients/github.js +48 -40
  5. package/dist/src/clients/github.js.map +1 -1
  6. package/dist/src/clients/tracker/jira.js +6 -0
  7. package/dist/src/clients/tracker/jira.js.map +1 -1
  8. package/dist/src/clients/tracker/linear.js +6 -2
  9. package/dist/src/clients/tracker/linear.js.map +1 -1
  10. package/dist/src/clients/tracker/types.d.ts +11 -0
  11. package/dist/src/cloud/db/postgres-backend.js +21 -13
  12. package/dist/src/cloud/db/postgres-backend.js.map +1 -1
  13. package/dist/src/cloud/db/schema.d.ts +1 -1
  14. package/dist/src/intake/system-prompt.js +3 -0
  15. package/dist/src/intake/system-prompt.js.map +1 -1
  16. package/dist/src/jobs/phase-assignment.d.ts +42 -0
  17. package/dist/src/jobs/phase-assignment.js +46 -43
  18. package/dist/src/jobs/phase-assignment.js.map +1 -1
  19. package/dist/src/jobs/runner.js +63 -34
  20. package/dist/src/jobs/runner.js.map +1 -1
  21. package/dist/src/mcp-handlers.d.ts +1 -0
  22. package/dist/src/mcp-handlers.js +6 -2
  23. package/dist/src/mcp-handlers.js.map +1 -1
  24. package/dist/src/mcp-server.js +6 -1
  25. package/dist/src/mcp-server.js.map +1 -1
  26. package/dist/src/plugins/builtin/github-tracker/intelligence/snippets/github-issues-keys.md +4 -1
  27. package/dist/src/plugins/builtin/jira/index.js +12 -0
  28. package/dist/src/plugins/builtin/jira/index.js.map +1 -1
  29. package/dist/src/plugins/builtin/jira/intelligence/snippets/jira-transitions.md +6 -1
  30. package/dist/src/plugins/builtin/linear/index.js +12 -0
  31. package/dist/src/plugins/builtin/linear/index.js.map +1 -1
  32. package/dist/src/plugins/builtin/linear/intelligence/snippets/linear-keys.md +6 -2
  33. package/dist/src/plugins/refs.d.ts +50 -1
  34. package/dist/src/plugins/refs.js +97 -1
  35. package/dist/src/plugins/refs.js.map +1 -1
  36. package/dist/src/plugins/registry.d.ts +6 -0
  37. package/dist/src/plugins/registry.js +11 -2
  38. package/dist/src/plugins/registry.js.map +1 -1
  39. package/dist/src/plugins/types.d.ts +13 -1
  40. package/dist/src/prompt/builder.d.ts +2 -1
  41. package/dist/src/prompt/builder.js +42 -1
  42. package/dist/src/prompt/builder.js.map +1 -1
  43. package/dist/src/runner/build-settings.js +16 -4
  44. package/dist/src/runner/build-settings.js.map +1 -1
  45. package/dist/src/state/polling-transport.d.ts +41 -12
  46. package/dist/src/state/polling-transport.js +95 -56
  47. package/dist/src/state/polling-transport.js.map +1 -1
  48. package/dist/src/state/sqlite-backend.js +19 -13
  49. package/dist/src/state/sqlite-backend.js.map +1 -1
  50. package/dist/src/tools/run-subagent.js +10 -5
  51. package/dist/src/tools/run-subagent.js.map +1 -1
  52. package/node_modules/@coro-ai/cloud-protocol/package.json +1 -1
  53. package/node_modules/@coro-ai/intelligence-base/layer/agents/coder.md +1 -1
  54. package/node_modules/@coro-ai/intelligence-base/layer/agents/planner.md +1 -1
  55. package/node_modules/@coro-ai/intelligence-base/package.json +1 -1
  56. package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.d.ts +58 -0
  57. package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.d.ts.map +1 -0
  58. package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.js +278 -0
  59. package/node_modules/@coro-ai/llm-anthropic/dist/credential-store.js.map +1 -0
  60. package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts +12 -1
  61. package/node_modules/@coro-ai/llm-anthropic/dist/executor.d.ts.map +1 -1
  62. package/node_modules/@coro-ai/llm-anthropic/dist/executor.js +85 -46
  63. package/node_modules/@coro-ai/llm-anthropic/dist/executor.js.map +1 -1
  64. package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.d.ts.map +1 -1
  65. package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js +4 -0
  66. package/node_modules/@coro-ai/llm-anthropic/dist/http-routes.js.map +1 -1
  67. package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts +2 -1
  68. package/node_modules/@coro-ai/llm-anthropic/dist/index.d.ts.map +1 -1
  69. package/node_modules/@coro-ai/llm-anthropic/dist/index.js +6 -2
  70. package/node_modules/@coro-ai/llm-anthropic/dist/index.js.map +1 -1
  71. package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.d.ts +11 -0
  72. package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.d.ts.map +1 -0
  73. package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.js +112 -0
  74. package/node_modules/@coro-ai/llm-anthropic/dist/sandbox-probe.js.map +1 -0
  75. package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts +0 -26
  76. package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.d.ts.map +1 -1
  77. package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js +40 -106
  78. package/node_modules/@coro-ai/llm-anthropic/dist/test-connection.js.map +1 -1
  79. package/node_modules/@coro-ai/llm-anthropic/package.json +1 -1
  80. package/node_modules/@coro-ai/llm-openai/README.md +3 -3
  81. package/node_modules/@coro-ai/llm-openai/dist/executor.d.ts.map +1 -1
  82. package/node_modules/@coro-ai/llm-openai/dist/executor.js +13 -10
  83. package/node_modules/@coro-ai/llm-openai/dist/executor.js.map +1 -1
  84. package/node_modules/@coro-ai/llm-openai/dist/models.d.ts.map +1 -1
  85. package/node_modules/@coro-ai/llm-openai/dist/models.js +27 -0
  86. package/node_modules/@coro-ai/llm-openai/dist/models.js.map +1 -1
  87. package/node_modules/@coro-ai/llm-openai/package.json +1 -1
  88. package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts +10 -1
  89. package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.d.ts.map +1 -1
  90. package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js +16 -2
  91. package/node_modules/@coro-ai/plugin-sdk/dist/chat-mcp.js.map +1 -1
  92. package/node_modules/@coro-ai/plugin-sdk/dist/helpers.d.ts +27 -1
  93. package/node_modules/@coro-ai/plugin-sdk/dist/helpers.d.ts.map +1 -1
  94. package/node_modules/@coro-ai/plugin-sdk/dist/helpers.js +47 -0
  95. package/node_modules/@coro-ai/plugin-sdk/dist/helpers.js.map +1 -1
  96. package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts +79 -4
  97. package/node_modules/@coro-ai/plugin-sdk/dist/types.d.ts.map +1 -1
  98. package/node_modules/@coro-ai/plugin-sdk/package.json +1 -1
  99. package/node_modules/@hono/node-server/README.md +104 -25
  100. package/node_modules/@hono/node-server/dist/conninfo.cjs +22 -0
  101. package/node_modules/@hono/node-server/dist/{conninfo.d.ts → conninfo.d.cts} +4 -3
  102. package/node_modules/@hono/node-server/dist/conninfo.d.mts +4 -3
  103. package/node_modules/@hono/node-server/dist/conninfo.mjs +19 -16
  104. package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +5 -0
  105. package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +11 -0
  106. package/node_modules/@hono/node-server/dist/early-hints.cjs +35 -0
  107. package/node_modules/@hono/node-server/dist/early-hints.d.cts +16 -0
  108. package/node_modules/@hono/node-server/dist/early-hints.d.mts +16 -0
  109. package/node_modules/@hono/node-server/dist/early-hints.mjs +33 -0
  110. package/node_modules/@hono/node-server/dist/index.cjs +1176 -0
  111. package/node_modules/@hono/node-server/dist/index.d.cts +101 -0
  112. package/node_modules/@hono/node-server/dist/index.d.mts +101 -8
  113. package/node_modules/@hono/node-server/dist/index.mjs +1146 -637
  114. package/node_modules/@hono/node-server/dist/serve-static.cjs +151 -0
  115. package/node_modules/@hono/node-server/dist/serve-static.d.cts +18 -0
  116. package/node_modules/@hono/node-server/dist/serve-static.d.mts +14 -13
  117. package/node_modules/@hono/node-server/dist/serve-static.mjs +143 -145
  118. package/node_modules/@hono/node-server/dist/utils/response.cjs +8 -0
  119. package/node_modules/@hono/node-server/dist/utils/response.d.cts +4 -0
  120. package/node_modules/@hono/node-server/dist/utils/response.d.mts +3 -2
  121. package/node_modules/@hono/node-server/dist/utils/response.mjs +6 -9
  122. package/node_modules/@hono/node-server/dist/utils/stream.cjs +65 -0
  123. package/node_modules/@hono/node-server/dist/utils/stream.d.cts +6 -0
  124. package/node_modules/@hono/node-server/dist/utils/stream.d.mts +6 -0
  125. package/node_modules/@hono/node-server/dist/utils/stream.mjs +64 -0
  126. package/node_modules/@hono/node-server/package.json +78 -54
  127. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map +1 -1
  128. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +1 -12
  129. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map +1 -1
  130. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts +7 -0
  131. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map +1 -1
  132. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +9 -3
  133. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map +1 -1
  134. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map +1 -1
  135. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +5 -3
  136. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map +1 -1
  137. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map +1 -1
  138. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +1 -12
  139. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map +1 -1
  140. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts +5 -0
  141. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts.map +1 -0
  142. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js +17 -0
  143. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js.map +1 -0
  144. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts +9 -1
  145. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map +1 -1
  146. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +10 -4
  147. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map +1 -1
  148. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +21 -0
  149. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
  150. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +239 -41
  151. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
  152. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map +1 -1
  153. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +25 -6
  154. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map +1 -1
  155. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts +32 -0
  156. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts.map +1 -0
  157. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js +64 -0
  158. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js.map +1 -0
  159. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts +5 -0
  160. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map +1 -1
  161. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +10 -1
  162. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map +1 -1
  163. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +1 -1
  164. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +2 -13
  165. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
  166. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +7 -0
  167. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +1 -1
  168. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +9 -3
  169. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map +1 -1
  170. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map +1 -1
  171. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +5 -3
  172. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
  173. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map +1 -1
  174. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +2 -13
  175. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -1
  176. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts +5 -0
  177. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts.map +1 -0
  178. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js +13 -0
  179. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js.map +1 -0
  180. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts +9 -1
  181. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map +1 -1
  182. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +10 -4
  183. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -1
  184. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +21 -0
  185. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
  186. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +239 -41
  187. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
  188. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map +1 -1
  189. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +25 -6
  190. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -1
  191. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts +32 -0
  192. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts.map +1 -0
  193. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js +57 -0
  194. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js.map +1 -0
  195. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts +5 -0
  196. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map +1 -1
  197. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +9 -0
  198. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -1
  199. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  200. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/utf32.js +10 -3
  201. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/package.json +2 -2
  202. package/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  203. package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/README.md +15 -14
  204. package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/index.js +0 -8
  205. package/node_modules/@modelcontextprotocol/sdk/node_modules/media-typer/package.json +16 -12
  206. package/node_modules/@modelcontextprotocol/sdk/package.json +4 -3
  207. package/node_modules/body-parser/HISTORY.md +7 -1
  208. package/node_modules/body-parser/lib/types/json.js +7 -3
  209. package/node_modules/body-parser/lib/types/raw.js +7 -3
  210. package/node_modules/body-parser/lib/types/text.js +7 -3
  211. package/node_modules/body-parser/lib/types/urlencoded.js +7 -3
  212. package/node_modules/body-parser/package.json +1 -1
  213. package/node_modules/express-rate-limit/dist/index.cjs +75 -6
  214. package/node_modules/express-rate-limit/dist/index.d.cts +16 -0
  215. package/node_modules/express-rate-limit/dist/index.d.mts +16 -0
  216. package/node_modules/express-rate-limit/dist/index.d.ts +16 -0
  217. package/node_modules/express-rate-limit/dist/index.mjs +61 -6
  218. package/node_modules/express-rate-limit/node_modules/debug/LICENSE +20 -0
  219. package/node_modules/express-rate-limit/node_modules/debug/README.md +481 -0
  220. package/node_modules/express-rate-limit/node_modules/debug/package.json +64 -0
  221. package/node_modules/express-rate-limit/node_modules/debug/src/browser.js +272 -0
  222. package/node_modules/express-rate-limit/node_modules/debug/src/common.js +292 -0
  223. package/node_modules/express-rate-limit/node_modules/debug/src/index.js +10 -0
  224. package/node_modules/express-rate-limit/node_modules/debug/src/node.js +263 -0
  225. package/node_modules/express-rate-limit/node_modules/ms/index.js +162 -0
  226. package/node_modules/express-rate-limit/node_modules/ms/license.md +21 -0
  227. package/node_modules/express-rate-limit/node_modules/ms/package.json +38 -0
  228. package/node_modules/express-rate-limit/node_modules/ms/readme.md +59 -0
  229. package/node_modules/express-rate-limit/package.json +12 -9
  230. package/node_modules/fast-copy/README.md +46 -46
  231. package/node_modules/fast-copy/dist/cjs/index.cjs +13 -19
  232. package/node_modules/fast-copy/dist/cjs/index.cjs.map +1 -1
  233. package/node_modules/fast-copy/dist/cjs/index.d.cts +40 -6
  234. package/node_modules/fast-copy/dist/es/index.d.mts +40 -6
  235. package/node_modules/fast-copy/dist/es/index.mjs +13 -19
  236. package/node_modules/fast-copy/dist/es/index.mjs.map +1 -1
  237. package/node_modules/fast-copy/dist/umd/index.d.ts +40 -6
  238. package/node_modules/fast-copy/dist/umd/index.js +13 -19
  239. package/node_modules/fast-copy/dist/umd/index.js.map +1 -1
  240. package/node_modules/fast-copy/index.d.ts +22 -22
  241. package/node_modules/fast-copy/package.json +30 -23
  242. package/node_modules/fast-uri/index.js +55 -2
  243. package/node_modules/fast-uri/package.json +1 -1
  244. package/node_modules/fast-uri/test/security.test.js +226 -0
  245. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +2 -5
  246. package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
  247. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +12 -2
  248. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +2 -5
  249. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
  250. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +12 -2
  251. package/node_modules/hono/dist/cjs/client/client.js +10 -1
  252. package/node_modules/hono/dist/cjs/client/utils.js +1 -1
  253. package/node_modules/hono/dist/cjs/context.js +28 -13
  254. package/node_modules/hono/dist/cjs/helper/proxy/index.js +4 -0
  255. package/node_modules/hono/dist/cjs/helper/streaming/sse.js +5 -4
  256. package/node_modules/hono/dist/cjs/hono-base.js +3 -2
  257. package/node_modules/hono/dist/cjs/jsx/base.js +27 -23
  258. package/node_modules/hono/dist/cjs/jsx/hooks/index.js +16 -13
  259. package/node_modules/hono/dist/cjs/middleware/cache/index.js +104 -9
  260. package/node_modules/hono/dist/cjs/middleware/compress/index.js +7 -1
  261. package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -2
  262. package/node_modules/hono/dist/cjs/middleware/etag/index.js +5 -1
  263. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +9 -4
  264. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +9 -4
  265. package/node_modules/hono/dist/cjs/middleware/language/language.js +10 -6
  266. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +90 -0
  267. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +5 -3
  268. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +10 -4
  269. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +1 -1
  270. package/node_modules/hono/dist/cjs/request.js +14 -11
  271. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +55 -56
  272. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +64 -85
  273. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +13 -5
  274. package/node_modules/hono/dist/cjs/router/trie-router/node.js +10 -1
  275. package/node_modules/hono/dist/cjs/router.js +1 -1
  276. package/node_modules/hono/dist/cjs/utils/accept.js +1 -1
  277. package/node_modules/hono/dist/cjs/utils/body.js +18 -4
  278. package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
  279. package/node_modules/hono/dist/cjs/utils/cookie.js +3 -2
  280. package/node_modules/hono/dist/cjs/utils/stream.js +5 -2
  281. package/node_modules/hono/dist/cjs/utils/url.js +8 -8
  282. package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
  283. package/node_modules/hono/dist/client/client.js +10 -1
  284. package/node_modules/hono/dist/client/utils.js +1 -1
  285. package/node_modules/hono/dist/context.js +28 -13
  286. package/node_modules/hono/dist/helper/proxy/index.js +4 -0
  287. package/node_modules/hono/dist/helper/streaming/sse.js +5 -4
  288. package/node_modules/hono/dist/hono-base.js +3 -2
  289. package/node_modules/hono/dist/jsx/base.js +27 -23
  290. package/node_modules/hono/dist/jsx/hooks/index.js +16 -13
  291. package/node_modules/hono/dist/middleware/cache/index.js +104 -9
  292. package/node_modules/hono/dist/middleware/compress/index.js +7 -1
  293. package/node_modules/hono/dist/middleware/cors/index.js +2 -2
  294. package/node_modules/hono/dist/middleware/etag/index.js +5 -1
  295. package/node_modules/hono/dist/middleware/jwk/jwk.js +9 -4
  296. package/node_modules/hono/dist/middleware/jwt/jwt.js +9 -4
  297. package/node_modules/hono/dist/middleware/language/language.js +10 -6
  298. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +68 -0
  299. package/node_modules/hono/dist/middleware/method-override/index.js +5 -3
  300. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +10 -4
  301. package/node_modules/hono/dist/middleware/serve-static/index.js +1 -1
  302. package/node_modules/hono/dist/request.js +15 -12
  303. package/node_modules/hono/dist/router/reg-exp-router/node.js +55 -56
  304. package/node_modules/hono/dist/router/reg-exp-router/router.js +64 -85
  305. package/node_modules/hono/dist/router/reg-exp-router/trie.js +13 -5
  306. package/node_modules/hono/dist/router/trie-router/node.js +10 -1
  307. package/node_modules/hono/dist/router.js +1 -1
  308. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
  309. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +1 -1
  310. package/node_modules/hono/dist/types/client/types.d.ts +1 -1
  311. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +1 -1
  312. package/node_modules/hono/dist/types/hono-base.d.ts +4 -3
  313. package/node_modules/hono/dist/types/jsx/base.d.ts +4 -2
  314. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +5 -5
  315. package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +2 -2
  316. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +5 -5
  317. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +8 -6
  318. package/node_modules/hono/dist/types/jsx/index.d.ts +5 -5
  319. package/node_modules/hono/dist/types/middleware/cache/index.d.ts +6 -4
  320. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +1 -1
  321. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
  322. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +1 -1
  323. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +2 -2
  324. package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +2 -0
  325. package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +2 -0
  326. package/node_modules/hono/dist/types/middleware/language/language.d.ts +18 -0
  327. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +49 -0
  328. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +1 -1
  329. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +2 -1
  330. package/node_modules/hono/dist/types/router.d.ts +1 -1
  331. package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
  332. package/node_modules/hono/dist/types/utils/headers.d.ts +2 -2
  333. package/node_modules/hono/dist/types/utils/types.d.ts +1 -1
  334. package/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  335. package/node_modules/hono/dist/utils/accept.js +1 -1
  336. package/node_modules/hono/dist/utils/body.js +18 -4
  337. package/node_modules/hono/dist/utils/buffer.js +2 -1
  338. package/node_modules/hono/dist/utils/cookie.js +4 -3
  339. package/node_modules/hono/dist/utils/stream.js +5 -2
  340. package/node_modules/hono/dist/utils/url.js +6 -7
  341. package/node_modules/hono/dist/validator/validator.js +3 -3
  342. package/node_modules/hono/package.json +19 -11
  343. package/node_modules/ip-address/README.md +146 -126
  344. package/node_modules/ip-address/dist/common.d.ts +29 -0
  345. package/node_modules/ip-address/dist/common.js +44 -5
  346. package/node_modules/ip-address/dist/common.js.map +1 -1
  347. package/node_modules/ip-address/dist/ipv4.d.ts +8 -1
  348. package/node_modules/ip-address/dist/ipv4.js +24 -20
  349. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  350. package/node_modules/ip-address/dist/ipv6.d.ts +68 -3
  351. package/node_modules/ip-address/dist/ipv6.js +180 -53
  352. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  353. package/node_modules/ip-address/dist/v4/constants.js +5 -1
  354. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  355. package/node_modules/ip-address/dist/v6/constants.js +3 -2
  356. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  357. package/node_modules/ip-address/package.json +6 -4
  358. package/node_modules/jose/README.md +13 -16
  359. package/node_modules/jose/dist/types/index.d.ts +6 -5
  360. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +17 -11
  361. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +7 -19
  362. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +17 -11
  363. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +7 -19
  364. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +18 -13
  365. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +20 -21
  366. package/node_modules/jose/dist/types/jwk/embedded.d.ts +8 -12
  367. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -15
  368. package/node_modules/jose/dist/types/jwks/local.d.ts +12 -21
  369. package/node_modules/jose/dist/types/jwks/remote.d.ts +34 -165
  370. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +2 -13
  371. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +17 -13
  372. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +2 -13
  373. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +17 -13
  374. package/node_modules/jose/dist/types/jws/general/sign.d.ts +16 -17
  375. package/node_modules/jose/dist/types/jws/general/verify.d.ts +18 -15
  376. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +17 -11
  377. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +10 -34
  378. package/node_modules/jose/dist/types/jwt/sign.d.ts +2 -13
  379. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +4 -13
  380. package/node_modules/jose/dist/types/jwt/verify.d.ts +14 -13
  381. package/node_modules/jose/dist/types/key/export.d.ts +0 -14
  382. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +7 -14
  383. package/node_modules/jose/dist/types/key/generate_secret.d.ts +16 -14
  384. package/node_modules/jose/dist/types/key/import.d.ts +18 -28
  385. package/node_modules/jose/dist/types/types.d.ts +239 -222
  386. package/node_modules/jose/dist/types/util/base64url.d.ts +11 -4
  387. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +1 -9
  388. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -8
  389. package/node_modules/jose/dist/types/util/errors.d.ts +128 -121
  390. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +4 -22
  391. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +5 -153
  392. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +16 -111
  393. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +23 -3
  394. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +66 -82
  395. package/node_modules/jose/dist/webapi/jwk/embedded.js +5 -3
  396. package/node_modules/jose/dist/webapi/jwks/local.js +32 -73
  397. package/node_modules/jose/dist/webapi/jwks/remote.js +19 -28
  398. package/node_modules/jose/dist/webapi/jws/compact/sign.js +5 -2
  399. package/node_modules/jose/dist/webapi/jws/compact/verify.js +4 -16
  400. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +7 -65
  401. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +3 -89
  402. package/node_modules/jose/dist/webapi/jws/general/sign.js +19 -15
  403. package/node_modules/jose/dist/webapi/jws/general/verify.js +29 -9
  404. package/node_modules/jose/dist/webapi/jwt/decrypt.js +5 -5
  405. package/node_modules/jose/dist/webapi/jwt/sign.js +2 -3
  406. package/node_modules/jose/dist/webapi/jwt/unsecured.js +4 -3
  407. package/node_modules/jose/dist/webapi/jwt/verify.js +6 -6
  408. package/node_modules/jose/dist/webapi/key/export.js +37 -4
  409. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +33 -82
  410. package/node_modules/jose/dist/webapi/key/generate_secret.js +2 -2
  411. package/node_modules/jose/dist/webapi/key/import.js +8 -8
  412. package/node_modules/jose/dist/webapi/lib/asn1.js +53 -122
  413. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +1 -0
  414. package/node_modules/jose/dist/webapi/lib/content_encryption.js +34 -109
  415. package/node_modules/jose/dist/webapi/lib/crypto_key.js +18 -126
  416. package/node_modules/jose/dist/webapi/lib/helpers.js +23 -0
  417. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -1
  418. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +107 -0
  419. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +186 -0
  420. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +110 -0
  421. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +8 -98
  422. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +73 -0
  423. package/node_modules/jose/dist/webapi/lib/jws_sign.js +74 -0
  424. package/node_modules/jose/dist/webapi/lib/jws_verify.js +107 -0
  425. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +68 -109
  426. package/node_modules/jose/dist/webapi/lib/key.js +132 -0
  427. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +10 -0
  428. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +7 -0
  429. package/node_modules/jose/dist/webapi/lib/key_management.js +162 -92
  430. package/node_modules/jose/dist/webapi/lib/options.js +48 -0
  431. package/node_modules/jose/dist/webapi/lib/signing.js +14 -56
  432. package/node_modules/jose/dist/webapi/lib/type_checks.js +13 -18
  433. package/node_modules/jose/dist/webapi/util/base64url.js +13 -4
  434. package/node_modules/jose/dist/webapi/util/decode_jwt.js +2 -2
  435. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -15
  436. package/node_modules/jose/dist/webapi/util/errors.js +1 -1
  437. package/node_modules/jose/package.json +2 -4
  438. package/node_modules/js-yaml/README.md +5 -3
  439. package/node_modules/js-yaml/dist/js-yaml.js +3012 -2402
  440. package/node_modules/js-yaml/dist/js-yaml.js.map +1 -1
  441. package/node_modules/js-yaml/dist/js-yaml.min.js +2 -33
  442. package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -1
  443. package/node_modules/js-yaml/dist/js-yaml.mjs +3073 -2381
  444. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
  445. package/node_modules/js-yaml/lib/loader.js +7 -11
  446. package/node_modules/js-yaml/lib/type/float.js +1 -1
  447. package/node_modules/js-yaml/lib/type/int.js +4 -4
  448. package/node_modules/js-yaml/lib/type/omap.js +3 -3
  449. package/node_modules/js-yaml/package.json +10 -4
  450. package/node_modules/node-abi/abi_registry.json +8 -1
  451. package/node_modules/node-abi/package.json +1 -1
  452. package/node_modules/openai/CHANGELOG.md +101 -0
  453. package/node_modules/openai/README.md +9 -2
  454. package/node_modules/openai/azure.d.mts.map +1 -1
  455. package/node_modules/openai/azure.d.ts.map +1 -1
  456. package/node_modules/openai/azure.js +5 -1
  457. package/node_modules/openai/azure.js.map +1 -1
  458. package/node_modules/openai/azure.mjs +5 -1
  459. package/node_modules/openai/azure.mjs.map +1 -1
  460. package/node_modules/openai/client.d.mts +1 -0
  461. package/node_modules/openai/client.d.mts.map +1 -1
  462. package/node_modules/openai/client.d.ts +1 -0
  463. package/node_modules/openai/client.d.ts.map +1 -1
  464. package/node_modules/openai/client.js +11 -5
  465. package/node_modules/openai/client.js.map +1 -1
  466. package/node_modules/openai/client.mjs +11 -5
  467. package/node_modules/openai/client.mjs.map +1 -1
  468. package/node_modules/openai/core/streaming.d.mts.map +1 -1
  469. package/node_modules/openai/core/streaming.d.ts.map +1 -1
  470. package/node_modules/openai/core/streaming.js +38 -6
  471. package/node_modules/openai/core/streaming.js.map +1 -1
  472. package/node_modules/openai/core/streaming.mjs +38 -6
  473. package/node_modules/openai/core/streaming.mjs.map +1 -1
  474. package/node_modules/openai/core/uploads.d.mts +1 -1
  475. package/node_modules/openai/core/uploads.d.mts.map +1 -1
  476. package/node_modules/openai/core/uploads.d.ts +1 -1
  477. package/node_modules/openai/core/uploads.d.ts.map +1 -1
  478. package/node_modules/openai/core/uploads.js +3 -1
  479. package/node_modules/openai/core/uploads.js.map +1 -1
  480. package/node_modules/openai/core/uploads.mjs +1 -0
  481. package/node_modules/openai/core/uploads.mjs.map +1 -1
  482. package/node_modules/openai/helpers/audio.d.mts.map +1 -1
  483. package/node_modules/openai/helpers/audio.d.ts.map +1 -1
  484. package/node_modules/openai/helpers/audio.js +16 -3
  485. package/node_modules/openai/helpers/audio.js.map +1 -1
  486. package/node_modules/openai/helpers/audio.mjs +17 -4
  487. package/node_modules/openai/helpers/audio.mjs.map +1 -1
  488. package/node_modules/openai/helpers/standard-schema.d.mts +104 -0
  489. package/node_modules/openai/helpers/standard-schema.d.mts.map +1 -0
  490. package/node_modules/openai/helpers/standard-schema.d.ts +104 -0
  491. package/node_modules/openai/helpers/standard-schema.d.ts.map +1 -0
  492. package/node_modules/openai/helpers/standard-schema.js +320 -0
  493. package/node_modules/openai/helpers/standard-schema.js.map +1 -0
  494. package/node_modules/openai/helpers/standard-schema.mjs +314 -0
  495. package/node_modules/openai/helpers/standard-schema.mjs.map +1 -0
  496. package/node_modules/openai/helpers/zod.d.mts +45 -9
  497. package/node_modules/openai/helpers/zod.d.mts.map +1 -1
  498. package/node_modules/openai/helpers/zod.d.ts +45 -9
  499. package/node_modules/openai/helpers/zod.d.ts.map +1 -1
  500. package/node_modules/openai/helpers/zod.js +120 -18
  501. package/node_modules/openai/helpers/zod.js.map +1 -1
  502. package/node_modules/openai/helpers/zod.mjs +119 -18
  503. package/node_modules/openai/helpers/zod.mjs.map +1 -1
  504. package/node_modules/openai/index.d.mts +1 -1
  505. package/node_modules/openai/index.d.mts.map +1 -1
  506. package/node_modules/openai/index.d.ts +1 -1
  507. package/node_modules/openai/index.d.ts.map +1 -1
  508. package/node_modules/openai/index.js +2 -1
  509. package/node_modules/openai/index.js.map +1 -1
  510. package/node_modules/openai/index.mjs +1 -1
  511. package/node_modules/openai/index.mjs.map +1 -1
  512. package/node_modules/openai/internal/headers.d.mts.map +1 -1
  513. package/node_modules/openai/internal/headers.d.ts.map +1 -1
  514. package/node_modules/openai/internal/headers.js +7 -3
  515. package/node_modules/openai/internal/headers.js.map +1 -1
  516. package/node_modules/openai/internal/headers.mjs +7 -3
  517. package/node_modules/openai/internal/headers.mjs.map +1 -1
  518. package/node_modules/openai/internal/uploads.d.mts +26 -1
  519. package/node_modules/openai/internal/uploads.d.mts.map +1 -1
  520. package/node_modules/openai/internal/uploads.d.ts +26 -1
  521. package/node_modules/openai/internal/uploads.d.ts.map +1 -1
  522. package/node_modules/openai/internal/uploads.js +169 -1
  523. package/node_modules/openai/internal/uploads.js.map +1 -1
  524. package/node_modules/openai/internal/uploads.mjs +169 -2
  525. package/node_modules/openai/internal/uploads.mjs.map +1 -1
  526. package/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts +3 -3
  527. package/node_modules/openai/lib/AbstractChatCompletionRunner.d.mts.map +1 -1
  528. package/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts +3 -3
  529. package/node_modules/openai/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  530. package/node_modules/openai/lib/AbstractChatCompletionRunner.js +61 -4
  531. package/node_modules/openai/lib/AbstractChatCompletionRunner.js.map +1 -1
  532. package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs +61 -4
  533. package/node_modules/openai/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  534. package/node_modules/openai/lib/AssistantStream.d.mts.map +1 -1
  535. package/node_modules/openai/lib/AssistantStream.d.ts.map +1 -1
  536. package/node_modules/openai/lib/AssistantStream.js +4 -3
  537. package/node_modules/openai/lib/AssistantStream.js.map +1 -1
  538. package/node_modules/openai/lib/AssistantStream.mjs +4 -3
  539. package/node_modules/openai/lib/AssistantStream.mjs.map +1 -1
  540. package/node_modules/openai/lib/ChatCompletionRunner.d.mts +26 -2
  541. package/node_modules/openai/lib/ChatCompletionRunner.d.mts.map +1 -1
  542. package/node_modules/openai/lib/ChatCompletionRunner.d.ts +26 -2
  543. package/node_modules/openai/lib/ChatCompletionRunner.d.ts.map +1 -1
  544. package/node_modules/openai/lib/ChatCompletionRunner.js.map +1 -1
  545. package/node_modules/openai/lib/ChatCompletionRunner.mjs.map +1 -1
  546. package/node_modules/openai/lib/ChatCompletionStream.d.mts +15 -1
  547. package/node_modules/openai/lib/ChatCompletionStream.d.mts.map +1 -1
  548. package/node_modules/openai/lib/ChatCompletionStream.d.ts +15 -1
  549. package/node_modules/openai/lib/ChatCompletionStream.d.ts.map +1 -1
  550. package/node_modules/openai/lib/ChatCompletionStream.js +128 -30
  551. package/node_modules/openai/lib/ChatCompletionStream.js.map +1 -1
  552. package/node_modules/openai/lib/ChatCompletionStream.mjs +127 -30
  553. package/node_modules/openai/lib/ChatCompletionStream.mjs.map +1 -1
  554. package/node_modules/openai/lib/ChatCompletionStreamingRunner.d.mts +25 -2
  555. package/node_modules/openai/lib/ChatCompletionStreamingRunner.d.mts.map +1 -1
  556. package/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts +25 -2
  557. package/node_modules/openai/lib/ChatCompletionStreamingRunner.d.ts.map +1 -1
  558. package/node_modules/openai/lib/ChatCompletionStreamingRunner.js +77 -0
  559. package/node_modules/openai/lib/ChatCompletionStreamingRunner.js.map +1 -1
  560. package/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs +78 -1
  561. package/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs.map +1 -1
  562. package/node_modules/openai/lib/EventStream.d.mts +13 -0
  563. package/node_modules/openai/lib/EventStream.d.mts.map +1 -1
  564. package/node_modules/openai/lib/EventStream.d.ts +13 -0
  565. package/node_modules/openai/lib/EventStream.d.ts.map +1 -1
  566. package/node_modules/openai/lib/EventStream.js +107 -2
  567. package/node_modules/openai/lib/EventStream.js.map +1 -1
  568. package/node_modules/openai/lib/EventStream.mjs +107 -2
  569. package/node_modules/openai/lib/EventStream.mjs.map +1 -1
  570. package/node_modules/openai/lib/ResponsesParser.d.mts.map +1 -1
  571. package/node_modules/openai/lib/ResponsesParser.d.ts.map +1 -1
  572. package/node_modules/openai/lib/ResponsesParser.js +3 -5
  573. package/node_modules/openai/lib/ResponsesParser.js.map +1 -1
  574. package/node_modules/openai/lib/ResponsesParser.mjs +3 -5
  575. package/node_modules/openai/lib/ResponsesParser.mjs.map +1 -1
  576. package/node_modules/openai/lib/RunnableFunction.d.mts +38 -21
  577. package/node_modules/openai/lib/RunnableFunction.d.mts.map +1 -1
  578. package/node_modules/openai/lib/RunnableFunction.d.ts +38 -21
  579. package/node_modules/openai/lib/RunnableFunction.d.ts.map +1 -1
  580. package/node_modules/openai/lib/RunnableFunction.js.map +1 -1
  581. package/node_modules/openai/lib/RunnableFunction.mjs.map +1 -1
  582. package/node_modules/openai/lib/jsonschema.d.mts +3 -0
  583. package/node_modules/openai/lib/jsonschema.d.mts.map +1 -1
  584. package/node_modules/openai/lib/jsonschema.d.ts +3 -0
  585. package/node_modules/openai/lib/jsonschema.d.ts.map +1 -1
  586. package/node_modules/openai/lib/parser.d.mts +2 -2
  587. package/node_modules/openai/lib/parser.d.mts.map +1 -1
  588. package/node_modules/openai/lib/parser.d.ts +2 -2
  589. package/node_modules/openai/lib/parser.d.ts.map +1 -1
  590. package/node_modules/openai/lib/parser.js.map +1 -1
  591. package/node_modules/openai/lib/parser.mjs.map +1 -1
  592. package/node_modules/openai/lib/responses/ResponseAccumulator.d.mts +6 -1
  593. package/node_modules/openai/lib/responses/ResponseAccumulator.d.mts.map +1 -1
  594. package/node_modules/openai/lib/responses/ResponseAccumulator.d.ts +6 -1
  595. package/node_modules/openai/lib/responses/ResponseAccumulator.d.ts.map +1 -1
  596. package/node_modules/openai/lib/responses/ResponseAccumulator.js +1 -0
  597. package/node_modules/openai/lib/responses/ResponseAccumulator.js.map +1 -1
  598. package/node_modules/openai/lib/responses/ResponseAccumulator.mjs +1 -0
  599. package/node_modules/openai/lib/responses/ResponseAccumulator.mjs.map +1 -1
  600. package/node_modules/openai/lib/responses/ResponseInputItems.d.mts.map +1 -1
  601. package/node_modules/openai/lib/responses/ResponseInputItems.d.ts.map +1 -1
  602. package/node_modules/openai/lib/responses/ResponseInputItems.js +2 -0
  603. package/node_modules/openai/lib/responses/ResponseInputItems.js.map +1 -1
  604. package/node_modules/openai/lib/responses/ResponseInputItems.mjs +2 -0
  605. package/node_modules/openai/lib/responses/ResponseInputItems.mjs.map +1 -1
  606. package/node_modules/openai/lib/responses/ResponseStream.d.mts +6 -1
  607. package/node_modules/openai/lib/responses/ResponseStream.d.mts.map +1 -1
  608. package/node_modules/openai/lib/responses/ResponseStream.d.ts +6 -1
  609. package/node_modules/openai/lib/responses/ResponseStream.d.ts.map +1 -1
  610. package/node_modules/openai/lib/responses/ResponseStream.js +21 -0
  611. package/node_modules/openai/lib/responses/ResponseStream.js.map +1 -1
  612. package/node_modules/openai/lib/responses/ResponseStream.mjs +21 -0
  613. package/node_modules/openai/lib/responses/ResponseStream.mjs.map +1 -1
  614. package/node_modules/openai/lib/transform.d.mts +25 -1
  615. package/node_modules/openai/lib/transform.d.mts.map +1 -1
  616. package/node_modules/openai/lib/transform.d.ts +25 -1
  617. package/node_modules/openai/lib/transform.d.ts.map +1 -1
  618. package/node_modules/openai/lib/transform.js +1521 -82
  619. package/node_modules/openai/lib/transform.js.map +1 -1
  620. package/node_modules/openai/lib/transform.mjs +1515 -82
  621. package/node_modules/openai/lib/transform.mjs.map +1 -1
  622. package/node_modules/openai/package.json +1 -1
  623. package/node_modules/openai/resources/admin/organization/audit-logs.d.mts +2 -2
  624. package/node_modules/openai/resources/admin/organization/audit-logs.d.mts.map +1 -1
  625. package/node_modules/openai/resources/admin/organization/audit-logs.d.ts +2 -2
  626. package/node_modules/openai/resources/admin/organization/audit-logs.d.ts.map +1 -1
  627. package/node_modules/openai/resources/admin/organization/index.d.mts +1 -0
  628. package/node_modules/openai/resources/admin/organization/index.d.mts.map +1 -1
  629. package/node_modules/openai/resources/admin/organization/index.d.ts +1 -0
  630. package/node_modules/openai/resources/admin/organization/index.d.ts.map +1 -1
  631. package/node_modules/openai/resources/admin/organization/index.js +3 -1
  632. package/node_modules/openai/resources/admin/organization/index.js.map +1 -1
  633. package/node_modules/openai/resources/admin/organization/index.mjs +1 -0
  634. package/node_modules/openai/resources/admin/organization/index.mjs.map +1 -1
  635. package/node_modules/openai/resources/admin/organization/organization.d.mts +4 -0
  636. package/node_modules/openai/resources/admin/organization/organization.d.mts.map +1 -1
  637. package/node_modules/openai/resources/admin/organization/organization.d.ts +4 -0
  638. package/node_modules/openai/resources/admin/organization/organization.d.ts.map +1 -1
  639. package/node_modules/openai/resources/admin/organization/organization.js +4 -0
  640. package/node_modules/openai/resources/admin/organization/organization.js.map +1 -1
  641. package/node_modules/openai/resources/admin/organization/organization.mjs +4 -0
  642. package/node_modules/openai/resources/admin/organization/organization.mjs.map +1 -1
  643. package/node_modules/openai/resources/admin/organization/projects/api-keys.d.mts +12 -0
  644. package/node_modules/openai/resources/admin/organization/projects/api-keys.d.mts.map +1 -1
  645. package/node_modules/openai/resources/admin/organization/projects/api-keys.d.ts +12 -0
  646. package/node_modules/openai/resources/admin/organization/projects/api-keys.d.ts.map +1 -1
  647. package/node_modules/openai/resources/admin/organization/projects/index.d.mts +2 -1
  648. package/node_modules/openai/resources/admin/organization/projects/index.d.mts.map +1 -1
  649. package/node_modules/openai/resources/admin/organization/projects/index.d.ts +2 -1
  650. package/node_modules/openai/resources/admin/organization/projects/index.d.ts.map +1 -1
  651. package/node_modules/openai/resources/admin/organization/projects/index.js +7 -5
  652. package/node_modules/openai/resources/admin/organization/projects/index.js.map +1 -1
  653. package/node_modules/openai/resources/admin/organization/projects/index.mjs +2 -1
  654. package/node_modules/openai/resources/admin/organization/projects/index.mjs.map +1 -1
  655. package/node_modules/openai/resources/admin/organization/projects/projects.d.mts +6 -2
  656. package/node_modules/openai/resources/admin/organization/projects/projects.d.mts.map +1 -1
  657. package/node_modules/openai/resources/admin/organization/projects/projects.d.ts +6 -2
  658. package/node_modules/openai/resources/admin/organization/projects/projects.d.ts.map +1 -1
  659. package/node_modules/openai/resources/admin/organization/projects/projects.js +6 -2
  660. package/node_modules/openai/resources/admin/organization/projects/projects.js.map +1 -1
  661. package/node_modules/openai/resources/admin/organization/projects/projects.mjs +6 -2
  662. package/node_modules/openai/resources/admin/organization/projects/projects.mjs.map +1 -1
  663. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.d.mts +58 -0
  664. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.d.mts.map +1 -0
  665. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.d.ts +58 -0
  666. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.d.ts.map +1 -0
  667. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.js +26 -0
  668. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.js.map +1 -0
  669. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs +22 -0
  670. package/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs.map +1 -0
  671. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.d.mts +3 -0
  672. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.d.mts.map +1 -0
  673. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.d.ts +3 -0
  674. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.d.ts.map +1 -0
  675. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.js +9 -0
  676. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.js.map +1 -0
  677. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.mjs +4 -0
  678. package/node_modules/openai/resources/admin/organization/projects/service-accounts/index.mjs.map +1 -0
  679. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.d.mts +177 -0
  680. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.d.mts.map +1 -0
  681. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.d.ts +177 -0
  682. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.d.ts.map +1 -0
  683. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.js +109 -0
  684. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.js.map +1 -0
  685. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs +104 -0
  686. package/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs.map +1 -0
  687. package/node_modules/openai/resources/admin/organization/projects/service-accounts.d.mts +1 -167
  688. package/node_modules/openai/resources/admin/organization/projects/service-accounts.d.mts.map +1 -1
  689. package/node_modules/openai/resources/admin/organization/projects/service-accounts.d.ts +1 -167
  690. package/node_modules/openai/resources/admin/organization/projects/service-accounts.d.ts.map +1 -1
  691. package/node_modules/openai/resources/admin/organization/projects/service-accounts.js +2 -97
  692. package/node_modules/openai/resources/admin/organization/projects/service-accounts.js.map +1 -1
  693. package/node_modules/openai/resources/admin/organization/projects/service-accounts.mjs +1 -95
  694. package/node_modules/openai/resources/admin/organization/projects/service-accounts.mjs.map +1 -1
  695. package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.mts +115 -0
  696. package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.mts.map +1 -0
  697. package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.ts +115 -0
  698. package/node_modules/openai/resources/admin/organization/projects/spend-limit.d.ts.map +1 -0
  699. package/node_modules/openai/resources/admin/organization/projects/spend-limit.js +67 -0
  700. package/node_modules/openai/resources/admin/organization/projects/spend-limit.js.map +1 -0
  701. package/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs +63 -0
  702. package/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs.map +1 -0
  703. package/node_modules/openai/resources/admin/organization/spend-limit.d.mts +108 -0
  704. package/node_modules/openai/resources/admin/organization/spend-limit.d.mts.map +1 -0
  705. package/node_modules/openai/resources/admin/organization/spend-limit.d.ts +108 -0
  706. package/node_modules/openai/resources/admin/organization/spend-limit.d.ts.map +1 -0
  707. package/node_modules/openai/resources/admin/organization/spend-limit.js +59 -0
  708. package/node_modules/openai/resources/admin/organization/spend-limit.js.map +1 -0
  709. package/node_modules/openai/resources/admin/organization/spend-limit.mjs +55 -0
  710. package/node_modules/openai/resources/admin/organization/spend-limit.mjs.map +1 -0
  711. package/node_modules/openai/resources/admin/organization/usage.d.mts +517 -88
  712. package/node_modules/openai/resources/admin/organization/usage.d.mts.map +1 -1
  713. package/node_modules/openai/resources/admin/organization/usage.d.ts +517 -88
  714. package/node_modules/openai/resources/admin/organization/usage.d.ts.map +1 -1
  715. package/node_modules/openai/resources/beta/assistants.d.mts +12 -26
  716. package/node_modules/openai/resources/beta/assistants.d.mts.map +1 -1
  717. package/node_modules/openai/resources/beta/assistants.d.ts +12 -26
  718. package/node_modules/openai/resources/beta/assistants.d.ts.map +1 -1
  719. package/node_modules/openai/resources/beta/beta.d.mts +6 -1
  720. package/node_modules/openai/resources/beta/beta.d.mts.map +1 -1
  721. package/node_modules/openai/resources/beta/beta.d.ts +6 -1
  722. package/node_modules/openai/resources/beta/beta.d.ts.map +1 -1
  723. package/node_modules/openai/resources/beta/beta.js +4 -0
  724. package/node_modules/openai/resources/beta/beta.js.map +1 -1
  725. package/node_modules/openai/resources/beta/beta.mjs +4 -0
  726. package/node_modules/openai/resources/beta/beta.mjs.map +1 -1
  727. package/node_modules/openai/resources/beta/index.d.mts +1 -0
  728. package/node_modules/openai/resources/beta/index.d.mts.map +1 -1
  729. package/node_modules/openai/resources/beta/index.d.ts +1 -0
  730. package/node_modules/openai/resources/beta/index.d.ts.map +1 -1
  731. package/node_modules/openai/resources/beta/index.js +5 -3
  732. package/node_modules/openai/resources/beta/index.js.map +1 -1
  733. package/node_modules/openai/resources/beta/index.mjs +1 -0
  734. package/node_modules/openai/resources/beta/index.mjs.map +1 -1
  735. package/node_modules/openai/resources/beta/responses/index.d.mts +6 -0
  736. package/node_modules/openai/resources/beta/responses/index.d.mts.map +1 -0
  737. package/node_modules/openai/resources/beta/responses/index.d.ts +6 -0
  738. package/node_modules/openai/resources/beta/responses/index.d.ts.map +1 -0
  739. package/node_modules/openai/resources/beta/responses/index.js +11 -0
  740. package/node_modules/openai/resources/beta/responses/index.js.map +1 -0
  741. package/node_modules/openai/resources/beta/responses/index.mjs +5 -0
  742. package/node_modules/openai/resources/beta/responses/index.mjs.map +1 -0
  743. package/node_modules/openai/resources/beta/responses/input-items.d.mts +69 -0
  744. package/node_modules/openai/resources/beta/responses/input-items.d.mts.map +1 -0
  745. package/node_modules/openai/resources/beta/responses/input-items.d.ts +69 -0
  746. package/node_modules/openai/resources/beta/responses/input-items.d.ts.map +1 -0
  747. package/node_modules/openai/resources/beta/responses/input-items.js +37 -0
  748. package/node_modules/openai/resources/beta/responses/input-items.js.map +1 -0
  749. package/node_modules/openai/resources/beta/responses/input-items.mjs +33 -0
  750. package/node_modules/openai/resources/beta/responses/input-items.mjs.map +1 -0
  751. package/node_modules/openai/resources/beta/responses/input-tokens.d.mts +195 -0
  752. package/node_modules/openai/resources/beta/responses/input-tokens.d.mts.map +1 -0
  753. package/node_modules/openai/resources/beta/responses/input-tokens.d.ts +195 -0
  754. package/node_modules/openai/resources/beta/responses/input-tokens.d.ts.map +1 -0
  755. package/node_modules/openai/resources/beta/responses/input-tokens.js +34 -0
  756. package/node_modules/openai/resources/beta/responses/input-tokens.js.map +1 -0
  757. package/node_modules/openai/resources/beta/responses/input-tokens.mjs +30 -0
  758. package/node_modules/openai/resources/beta/responses/input-tokens.mjs.map +1 -0
  759. package/node_modules/openai/resources/beta/responses/internal-base.d.mts +71 -0
  760. package/node_modules/openai/resources/beta/responses/internal-base.d.mts.map +1 -0
  761. package/node_modules/openai/resources/beta/responses/internal-base.d.ts +71 -0
  762. package/node_modules/openai/resources/beta/responses/internal-base.d.ts.map +1 -0
  763. package/node_modules/openai/resources/beta/responses/internal-base.js +48 -0
  764. package/node_modules/openai/resources/beta/responses/internal-base.js.map +1 -0
  765. package/node_modules/openai/resources/beta/responses/internal-base.mjs +42 -0
  766. package/node_modules/openai/resources/beta/responses/internal-base.mjs.map +1 -0
  767. package/node_modules/openai/resources/beta/responses/responses.d.mts +9996 -0
  768. package/node_modules/openai/resources/beta/responses/responses.d.mts.map +1 -0
  769. package/node_modules/openai/resources/beta/responses/responses.d.ts +9996 -0
  770. package/node_modules/openai/resources/beta/responses/responses.d.ts.map +1 -0
  771. package/node_modules/openai/resources/beta/responses/responses.js +121 -0
  772. package/node_modules/openai/resources/beta/responses/responses.js.map +1 -0
  773. package/node_modules/openai/resources/beta/responses/responses.mjs +116 -0
  774. package/node_modules/openai/resources/beta/responses/responses.mjs.map +1 -0
  775. package/node_modules/openai/resources/beta/responses/ws-base.d.mts +106 -0
  776. package/node_modules/openai/resources/beta/responses/ws-base.d.mts.map +1 -0
  777. package/node_modules/openai/resources/beta/responses/ws-base.d.ts +106 -0
  778. package/node_modules/openai/resources/beta/responses/ws-base.d.ts.map +1 -0
  779. package/node_modules/openai/resources/beta/responses/ws-base.js +476 -0
  780. package/node_modules/openai/resources/beta/responses/ws-base.js.map +1 -0
  781. package/node_modules/openai/resources/beta/responses/ws-base.mjs +472 -0
  782. package/node_modules/openai/resources/beta/responses/ws-base.mjs.map +1 -0
  783. package/node_modules/openai/resources/beta/responses/ws.d.mts +13 -0
  784. package/node_modules/openai/resources/beta/responses/ws.d.mts.map +1 -0
  785. package/node_modules/openai/resources/beta/responses/ws.d.ts +13 -0
  786. package/node_modules/openai/resources/beta/responses/ws.d.ts.map +1 -0
  787. package/node_modules/openai/resources/beta/responses/ws.js +31 -0
  788. package/node_modules/openai/resources/beta/responses/ws.js.map +1 -0
  789. package/node_modules/openai/resources/beta/responses/ws.mjs +26 -0
  790. package/node_modules/openai/resources/beta/responses/ws.mjs.map +1 -0
  791. package/node_modules/openai/resources/beta/responses.d.mts +2 -0
  792. package/node_modules/openai/resources/beta/responses.d.mts.map +1 -0
  793. package/node_modules/openai/resources/beta/responses.d.ts +2 -0
  794. package/node_modules/openai/resources/beta/responses.d.ts.map +1 -0
  795. package/node_modules/openai/resources/beta/responses.js +6 -0
  796. package/node_modules/openai/resources/beta/responses.js.map +1 -0
  797. package/node_modules/openai/resources/beta/responses.mjs +3 -0
  798. package/node_modules/openai/resources/beta/responses.mjs.map +1 -0
  799. package/node_modules/openai/resources/beta/threads/runs/runs.d.mts +6 -13
  800. package/node_modules/openai/resources/beta/threads/runs/runs.d.mts.map +1 -1
  801. package/node_modules/openai/resources/beta/threads/runs/runs.d.ts +6 -13
  802. package/node_modules/openai/resources/beta/threads/runs/runs.d.ts.map +1 -1
  803. package/node_modules/openai/resources/beta/threads/runs/runs.js.map +1 -1
  804. package/node_modules/openai/resources/beta/threads/runs/runs.mjs.map +1 -1
  805. package/node_modules/openai/resources/chat/completions/completions.d.mts +174 -23
  806. package/node_modules/openai/resources/chat/completions/completions.d.mts.map +1 -1
  807. package/node_modules/openai/resources/chat/completions/completions.d.ts +174 -23
  808. package/node_modules/openai/resources/chat/completions/completions.d.ts.map +1 -1
  809. package/node_modules/openai/resources/chat/completions/completions.js.map +1 -1
  810. package/node_modules/openai/resources/chat/completions/completions.mjs.map +1 -1
  811. package/node_modules/openai/resources/completions.d.mts +4 -0
  812. package/node_modules/openai/resources/completions.d.mts.map +1 -1
  813. package/node_modules/openai/resources/completions.d.ts +4 -0
  814. package/node_modules/openai/resources/completions.d.ts.map +1 -1
  815. package/node_modules/openai/resources/conversations/conversations.d.mts +19 -0
  816. package/node_modules/openai/resources/conversations/conversations.d.mts.map +1 -1
  817. package/node_modules/openai/resources/conversations/conversations.d.ts +19 -0
  818. package/node_modules/openai/resources/conversations/conversations.d.ts.map +1 -1
  819. package/node_modules/openai/resources/conversations/conversations.js.map +1 -1
  820. package/node_modules/openai/resources/conversations/conversations.mjs.map +1 -1
  821. package/node_modules/openai/resources/conversations/items.d.mts +45 -1
  822. package/node_modules/openai/resources/conversations/items.d.mts.map +1 -1
  823. package/node_modules/openai/resources/conversations/items.d.ts +45 -1
  824. package/node_modules/openai/resources/conversations/items.d.ts.map +1 -1
  825. package/node_modules/openai/resources/evals/runs/runs.d.mts +66 -143
  826. package/node_modules/openai/resources/evals/runs/runs.d.mts.map +1 -1
  827. package/node_modules/openai/resources/evals/runs/runs.d.ts +66 -143
  828. package/node_modules/openai/resources/evals/runs/runs.d.ts.map +1 -1
  829. package/node_modules/openai/resources/evals/runs/runs.js.map +1 -1
  830. package/node_modules/openai/resources/evals/runs/runs.mjs.map +1 -1
  831. package/node_modules/openai/resources/graders/grader-models.d.mts +6 -13
  832. package/node_modules/openai/resources/graders/grader-models.d.mts.map +1 -1
  833. package/node_modules/openai/resources/graders/grader-models.d.ts +6 -13
  834. package/node_modules/openai/resources/graders/grader-models.d.ts.map +1 -1
  835. package/node_modules/openai/resources/realtime/calls.d.mts +1 -1
  836. package/node_modules/openai/resources/realtime/calls.d.mts.map +1 -1
  837. package/node_modules/openai/resources/realtime/calls.d.ts +1 -1
  838. package/node_modules/openai/resources/realtime/calls.d.ts.map +1 -1
  839. package/node_modules/openai/resources/realtime/client-secrets.d.mts +5 -1
  840. package/node_modules/openai/resources/realtime/client-secrets.d.mts.map +1 -1
  841. package/node_modules/openai/resources/realtime/client-secrets.d.ts +5 -1
  842. package/node_modules/openai/resources/realtime/client-secrets.d.ts.map +1 -1
  843. package/node_modules/openai/resources/realtime/realtime.d.mts +9 -1
  844. package/node_modules/openai/resources/realtime/realtime.d.mts.map +1 -1
  845. package/node_modules/openai/resources/realtime/realtime.d.ts +9 -1
  846. package/node_modules/openai/resources/realtime/realtime.d.ts.map +1 -1
  847. package/node_modules/openai/resources/realtime/realtime.js.map +1 -1
  848. package/node_modules/openai/resources/realtime/realtime.mjs.map +1 -1
  849. package/node_modules/openai/resources/responses/input-tokens.d.mts +9 -2
  850. package/node_modules/openai/resources/responses/input-tokens.d.mts.map +1 -1
  851. package/node_modules/openai/resources/responses/input-tokens.d.ts +9 -2
  852. package/node_modules/openai/resources/responses/input-tokens.d.ts.map +1 -1
  853. package/node_modules/openai/resources/responses/responses.d.mts +827 -33
  854. package/node_modules/openai/resources/responses/responses.d.mts.map +1 -1
  855. package/node_modules/openai/resources/responses/responses.d.ts +827 -33
  856. package/node_modules/openai/resources/responses/responses.d.ts.map +1 -1
  857. package/node_modules/openai/resources/responses/responses.js +1 -1
  858. package/node_modules/openai/resources/responses/responses.js.map +1 -1
  859. package/node_modules/openai/resources/responses/responses.mjs +1 -1
  860. package/node_modules/openai/resources/responses/responses.mjs.map +1 -1
  861. package/node_modules/openai/resources/shared.d.mts +24 -29
  862. package/node_modules/openai/resources/shared.d.mts.map +1 -1
  863. package/node_modules/openai/resources/shared.d.ts +24 -29
  864. package/node_modules/openai/resources/shared.d.ts.map +1 -1
  865. package/node_modules/openai/src/azure.ts +5 -1
  866. package/node_modules/openai/src/client.ts +13 -5
  867. package/node_modules/openai/src/core/streaming.ts +36 -8
  868. package/node_modules/openai/src/core/uploads.ts +6 -1
  869. package/node_modules/openai/src/helpers/audio.ts +18 -4
  870. package/node_modules/openai/src/helpers/standard-schema.ts +570 -0
  871. package/node_modules/openai/src/helpers/zod.ts +218 -50
  872. package/node_modules/openai/src/index.ts +1 -1
  873. package/node_modules/openai/src/internal/headers.ts +7 -3
  874. package/node_modules/openai/src/internal/uploads.ts +214 -4
  875. package/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts +75 -10
  876. package/node_modules/openai/src/lib/AssistantStream.ts +4 -3
  877. package/node_modules/openai/src/lib/ChatCompletionRunner.ts +46 -6
  878. package/node_modules/openai/src/lib/ChatCompletionStream.ts +171 -25
  879. package/node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts +144 -7
  880. package/node_modules/openai/src/lib/EventStream.ts +114 -4
  881. package/node_modules/openai/src/lib/ResponsesParser.ts +7 -5
  882. package/node_modules/openai/src/lib/RunnableFunction.ts +60 -31
  883. package/node_modules/openai/src/lib/jsonschema.ts +3 -0
  884. package/node_modules/openai/src/lib/parser.ts +4 -0
  885. package/node_modules/openai/src/lib/responses/ResponseAccumulator.ts +10 -1
  886. package/node_modules/openai/src/lib/responses/ResponseInputItems.ts +2 -0
  887. package/node_modules/openai/src/lib/responses/ResponseStream.ts +29 -1
  888. package/node_modules/openai/src/lib/transform.ts +1930 -103
  889. package/node_modules/openai/src/resources/admin/organization/audit-logs.ts +169 -1
  890. package/node_modules/openai/src/resources/admin/organization/index.ts +6 -0
  891. package/node_modules/openai/src/resources/admin/organization/organization.ts +16 -0
  892. package/node_modules/openai/src/resources/admin/organization/projects/api-keys.ts +15 -1
  893. package/node_modules/openai/src/resources/admin/organization/projects/index.ts +7 -1
  894. package/node_modules/openai/src/resources/admin/organization/projects/projects.ts +29 -13
  895. package/node_modules/openai/src/resources/admin/organization/projects/service-accounts/api-keys.ts +80 -0
  896. package/node_modules/openai/src/resources/admin/organization/projects/service-accounts/index.ts +15 -0
  897. package/node_modules/openai/src/resources/admin/organization/projects/service-accounts/service-accounts.ts +284 -0
  898. package/node_modules/openai/src/resources/admin/organization/projects/service-accounts.ts +1 -264
  899. package/node_modules/openai/src/resources/admin/organization/projects/spend-limit.ts +156 -0
  900. package/node_modules/openai/src/resources/admin/organization/spend-limit.ts +144 -0
  901. package/node_modules/openai/src/resources/admin/organization/usage.ts +616 -88
  902. package/node_modules/openai/src/resources/beta/assistants.ts +12 -26
  903. package/node_modules/openai/src/resources/beta/beta.ts +330 -2
  904. package/node_modules/openai/src/resources/beta/index.ts +163 -0
  905. package/node_modules/openai/src/resources/beta/responses/index.ts +169 -0
  906. package/node_modules/openai/src/resources/beta/responses/input-items.ts +105 -0
  907. package/node_modules/openai/src/resources/beta/responses/input-tokens.ts +249 -0
  908. package/node_modules/openai/src/resources/beta/responses/internal-base.ts +117 -0
  909. package/node_modules/openai/src/resources/beta/responses/responses.ts +12644 -0
  910. package/node_modules/openai/src/resources/beta/responses/ws-base.ts +615 -0
  911. package/node_modules/openai/src/resources/beta/responses/ws.ts +38 -0
  912. package/node_modules/openai/src/resources/beta/responses.ts +3 -0
  913. package/node_modules/openai/src/resources/beta/threads/runs/runs.ts +6 -13
  914. package/node_modules/openai/src/resources/chat/completions/completions.ts +241 -26
  915. package/node_modules/openai/src/resources/completions.ts +5 -0
  916. package/node_modules/openai/src/resources/conversations/conversations.ts +21 -0
  917. package/node_modules/openai/src/resources/conversations/items.ts +56 -0
  918. package/node_modules/openai/src/resources/evals/runs/runs.ts +66 -143
  919. package/node_modules/openai/src/resources/graders/grader-models.ts +6 -13
  920. package/node_modules/openai/src/resources/realtime/calls.ts +2 -0
  921. package/node_modules/openai/src/resources/realtime/client-secrets.ts +7 -0
  922. package/node_modules/openai/src/resources/realtime/realtime.ts +12 -0
  923. package/node_modules/openai/src/resources/responses/input-tokens.ts +10 -1
  924. package/node_modules/openai/src/resources/responses/responses.ts +962 -24
  925. package/node_modules/openai/src/resources/shared.ts +27 -28
  926. package/node_modules/openai/src/version.ts +1 -1
  927. package/node_modules/openai/version.d.mts +1 -1
  928. package/node_modules/openai/version.d.ts +1 -1
  929. package/node_modules/openai/version.js +1 -1
  930. package/node_modules/openai/version.mjs +1 -1
  931. package/node_modules/process-warning/LICENSE +1 -1
  932. package/node_modules/process-warning/README.md +41 -2
  933. package/node_modules/process-warning/index.js +85 -17
  934. package/node_modules/process-warning/package.json +6 -7
  935. package/node_modules/process-warning/test/emit-once-only.test.js +3 -3
  936. package/node_modules/process-warning/test/emit-reset.test.js +4 -4
  937. package/node_modules/process-warning/test/emit-unlimited.test.js +2 -2
  938. package/node_modules/process-warning/test/spy-warning.test.js +143 -0
  939. package/node_modules/process-warning/types/index.d.ts +15 -1
  940. package/node_modules/process-warning/types/index.tst.ts +48 -0
  941. package/node_modules/tar-fs/index.js +39 -10
  942. package/node_modules/tar-fs/package.json +6 -1
  943. package/node_modules/tar-fs/test/index.js +111 -0
  944. package/node_modules/ws/lib/receiver.js +15 -32
  945. package/node_modules/ws/lib/websocket-server.js +4 -4
  946. package/node_modules/ws/lib/websocket.js +4 -4
  947. package/node_modules/ws/package.json +5 -1
  948. package/package.json +6 -6
  949. package/node_modules/@hono/node-server/dist/conninfo.js +0 -42
  950. package/node_modules/@hono/node-server/dist/globals.d.mts +0 -2
  951. package/node_modules/@hono/node-server/dist/globals.d.ts +0 -2
  952. package/node_modules/@hono/node-server/dist/globals.js +0 -29
  953. package/node_modules/@hono/node-server/dist/globals.mjs +0 -5
  954. package/node_modules/@hono/node-server/dist/index.d.ts +0 -8
  955. package/node_modules/@hono/node-server/dist/index.js +0 -702
  956. package/node_modules/@hono/node-server/dist/listener.d.mts +0 -13
  957. package/node_modules/@hono/node-server/dist/listener.d.ts +0 -13
  958. package/node_modules/@hono/node-server/dist/listener.js +0 -670
  959. package/node_modules/@hono/node-server/dist/listener.mjs +0 -635
  960. package/node_modules/@hono/node-server/dist/request.d.mts +0 -25
  961. package/node_modules/@hono/node-server/dist/request.d.ts +0 -25
  962. package/node_modules/@hono/node-server/dist/request.js +0 -238
  963. package/node_modules/@hono/node-server/dist/request.mjs +0 -206
  964. package/node_modules/@hono/node-server/dist/response.d.mts +0 -26
  965. package/node_modules/@hono/node-server/dist/response.d.ts +0 -26
  966. package/node_modules/@hono/node-server/dist/response.js +0 -112
  967. package/node_modules/@hono/node-server/dist/response.mjs +0 -85
  968. package/node_modules/@hono/node-server/dist/serve-static.d.ts +0 -17
  969. package/node_modules/@hono/node-server/dist/serve-static.js +0 -177
  970. package/node_modules/@hono/node-server/dist/server.d.mts +0 -10
  971. package/node_modules/@hono/node-server/dist/server.d.ts +0 -10
  972. package/node_modules/@hono/node-server/dist/server.js +0 -696
  973. package/node_modules/@hono/node-server/dist/server.mjs +0 -660
  974. package/node_modules/@hono/node-server/dist/types.d.mts +0 -44
  975. package/node_modules/@hono/node-server/dist/types.d.ts +0 -44
  976. package/node_modules/@hono/node-server/dist/types.js +0 -18
  977. package/node_modules/@hono/node-server/dist/types.mjs +0 -0
  978. package/node_modules/@hono/node-server/dist/utils/response/constants.d.mts +0 -3
  979. package/node_modules/@hono/node-server/dist/utils/response/constants.d.ts +0 -3
  980. package/node_modules/@hono/node-server/dist/utils/response/constants.js +0 -30
  981. package/node_modules/@hono/node-server/dist/utils/response/constants.mjs +0 -5
  982. package/node_modules/@hono/node-server/dist/utils/response.d.ts +0 -3
  983. package/node_modules/@hono/node-server/dist/utils/response.js +0 -37
  984. package/node_modules/@hono/node-server/dist/utils.d.mts +0 -9
  985. package/node_modules/@hono/node-server/dist/utils.d.ts +0 -9
  986. package/node_modules/@hono/node-server/dist/utils.js +0 -99
  987. package/node_modules/@hono/node-server/dist/utils.mjs +0 -71
  988. package/node_modules/@hono/node-server/dist/vercel.d.mts +0 -7
  989. package/node_modules/@hono/node-server/dist/vercel.d.ts +0 -7
  990. package/node_modules/@hono/node-server/dist/vercel.js +0 -677
  991. package/node_modules/@hono/node-server/dist/vercel.mjs +0 -640
  992. package/node_modules/fast-copy/CHANGELOG.md +0 -176
  993. package/node_modules/fast-copy/dist/cjs/copier.d.cts +0 -75
  994. package/node_modules/fast-copy/dist/cjs/options.d.cts +0 -69
  995. package/node_modules/fast-copy/dist/cjs/utils.d.cts +0 -13
  996. package/node_modules/fast-copy/dist/es/copier.d.mts +0 -75
  997. package/node_modules/fast-copy/dist/es/options.d.mts +0 -69
  998. package/node_modules/fast-copy/dist/es/utils.d.mts +0 -13
  999. package/node_modules/fast-copy/dist/umd/copier.d.ts +0 -72
  1000. package/node_modules/fast-copy/dist/umd/options.d.ts +0 -65
  1001. package/node_modules/fast-copy/dist/umd/utils.d.ts +0 -13
  1002. package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
  1003. package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -15
  1004. package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
  1005. package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
  1006. package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
  1007. package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
  1008. package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -166
  1009. package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -42
  1010. package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
  1011. package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
  1012. package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
  1013. package/node_modules/process-warning/types/index.test-d.ts +0 -36
@@ -1,23 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isInSubnet = isInSubnet;
4
+ exports.isHostInSubnet = isHostInSubnet;
4
5
  exports.isCorrect = isCorrect;
5
6
  exports.prefixLengthFromMask = prefixLengthFromMask;
7
+ exports.assertByteArray = assertByteArray;
6
8
  exports.numberToPaddedHex = numberToPaddedHex;
7
9
  exports.stringToPaddedHex = stringToPaddedHex;
8
10
  exports.testBit = testBit;
9
11
  const address_error_1 = require("./address-error");
12
+ /**
13
+ * Returns whether this address's *network* is contained within `address`,
14
+ * i.e. whether every address this one can represent also falls inside
15
+ * `address`. A network wider than `address` is not contained in it, so
16
+ * `10.0.0.0/8` is not in `10.0.0.0/16`.
17
+ *
18
+ * To ask whether the address itself falls inside a range, ignoring any CIDR
19
+ * suffix it was written with, use {@link isHostInSubnet} instead. That is the
20
+ * question the special-use classifiers ask.
21
+ */
10
22
  function isInSubnet(address) {
11
23
  if (this.subnetMask < address.subnetMask) {
12
24
  return false;
13
25
  }
14
- if (this.mask(address.subnetMask) === address.mask()) {
15
- return true;
16
- }
17
- return false;
26
+ return isHostInSubnet.call(this, address);
27
+ }
28
+ /**
29
+ * Returns whether this address's host bits fall inside `address`, ignoring
30
+ * this address's own subnet mask.
31
+ *
32
+ * This is the primitive the special-use classifiers (`isLoopback`,
33
+ * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a
34
+ * question about the address, so the answer must not change with the CIDR
35
+ * suffix the caller happened to write. Use this rather than
36
+ * {@link isInSubnet} when classifying a single address — notably when the
37
+ * address came from untrusted input and the result backs a trust-boundary
38
+ * decision such as an SSRF allow/deny filter.
39
+ */
40
+ function isHostInSubnet(address) {
41
+ return this.mask(address.subnetMask) === address.mask();
18
42
  }
19
43
  function isCorrect(defaultBits) {
20
- return function () {
44
+ return function isCorrectForm() {
21
45
  if (this.addressMinusSuffix !== this.correctForm()) {
22
46
  return false;
23
47
  }
@@ -46,6 +70,21 @@ function prefixLengthFromMask(value, totalBits) {
46
70
  }
47
71
  return firstZero;
48
72
  }
73
+ /**
74
+ * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,
75
+ * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes
76
+ * are accepted and folded to unsigned, and `0` where they are not.
77
+ */
78
+ function assertByteArray(bytes, byteCount, family, minimum) {
79
+ if (bytes.length !== byteCount) {
80
+ throw new address_error_1.AddressError(`${family} addresses require exactly ${byteCount} bytes`);
81
+ }
82
+ for (let i = 0; i < bytes.length; i++) {
83
+ if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {
84
+ throw new address_error_1.AddressError(`All bytes must be integers between ${minimum} and 255`);
85
+ }
86
+ }
87
+ }
49
88
  function numberToPaddedHex(number) {
50
89
  return number.toString(16).padStart(2, '0');
51
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAQA,gCAUC;AAED,8BAYC;AAOD,oDAkBC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AA9ED,mDAA+C;AAM/C,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO;QACL,IAAI,IAAI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ACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n if (this.mask(address.subnetMask) === address.mask()) {\n return true;\n }\n\n return false;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function (this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAkBA,gCAMC;AAcD,wCAEC;AAED,8BAYC;AAOD,oDAkBC;AAOD,0CAeC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AA1HD,mDAA+C;AAM/C;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAA4B,OAA4B;IACpF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;AAC1D,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO,SAAS,aAAa;QAC3B,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,MAAM,MAAM,GA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C,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,WAAmB,EAAE,QAAgB;IAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { Address4 } from './ipv4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\n/**\n * Returns whether this address's *network* is contained within `address`,\n * i.e. whether every address this one can represent also falls inside\n * `address`. A network wider than `address` is not contained in it, so\n * `10.0.0.0/8` is not in `10.0.0.0/16`.\n *\n * To ask whether the address itself falls inside a range, ignoring any CIDR\n * suffix it was written with, use {@link isHostInSubnet} instead. That is the\n * question the special-use classifiers ask.\n */\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n return isHostInSubnet.call(this, address);\n}\n\n/**\n * Returns whether this address's host bits fall inside `address`, ignoring\n * this address's own subnet mask.\n *\n * This is the primitive the special-use classifiers (`isLoopback`,\n * `isPrivate`, `isLinkLocal`, `getType`, …) are built on: they answer a\n * question about the address, so the answer must not change with the CIDR\n * suffix the caller happened to write. Use this rather than\n * {@link isInSubnet} when classifying a single address — notably when the\n * address came from untrusted input and the result backs a trust-boundary\n * decision such as an SSRF allow/deny filter.\n */\nexport function isHostInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n return this.mask(address.subnetMask) === address.mask();\n}\n\nexport function isCorrect(defaultBits: number) {\n return function isCorrectForm(this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\n/**\n * Throws `AddressError` unless `bytes` holds exactly `byteCount` integers,\n * each from `minimum` to 255. Pass a `minimum` of `-128` where signed bytes\n * are accepted and folded to unsigned, and `0` where they are not.\n */\nexport function assertByteArray(\n bytes: number[],\n byteCount: number,\n family: 'IPv4' | 'IPv6',\n minimum: number,\n): void {\n if (bytes.length !== byteCount) {\n throw new AddressError(`${family} addresses require exactly ${byteCount} bytes`);\n }\n\n for (let i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < minimum || bytes[i] > 255) {\n throw new AddressError(`All bytes must be integers between ${minimum} and 255`);\n }\n }\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
@@ -5,7 +5,7 @@ import * as common from './common';
5
5
  */
6
6
  export declare class Address4 {
7
7
  address: string;
8
- addressMinusSuffix?: string;
8
+ addressMinusSuffix: string;
9
9
  groups: number;
10
10
  parsedAddress: string[];
11
11
  parsedSubnet: string;
@@ -219,6 +219,13 @@ export declare class Address4 {
219
219
  * @returns {boolean}
220
220
  */
221
221
  isInSubnet: typeof common.isInSubnet;
222
+ /**
223
+ * Returns true if this address's host bits fall inside the given subnet,
224
+ * ignoring this address's own subnet mask. See
225
+ * {@link common.isHostInSubnet}.
226
+ * @returns {boolean}
227
+ */
228
+ isHostInSubnet: typeof common.isHostInSubnet;
222
229
  /**
223
230
  * Returns true if the given address is a multicast address
224
231
  * @returns {boolean}
@@ -35,6 +35,7 @@ const isCorrect4 = common.isCorrect(constants.BITS);
35
35
  */
36
36
  class Address4 {
37
37
  constructor(address) {
38
+ this.addressMinusSuffix = '';
38
39
  this.groups = constants.GROUPS;
39
40
  this.parsedAddress = [];
40
41
  this.parsedSubnet = '';
@@ -51,6 +52,13 @@ class Address4 {
51
52
  * @returns {boolean}
52
53
  */
53
54
  this.isInSubnet = common.isInSubnet;
55
+ /**
56
+ * Returns true if this address's host bits fall inside the given subnet,
57
+ * ignoring this address's own subnet mask. See
58
+ * {@link common.isHostInSubnet}.
59
+ * @returns {boolean}
60
+ */
61
+ this.isHostInSubnet = common.isHostInSubnet;
54
62
  this.address = address;
55
63
  const subnet = constants.RE_SUBNET_STRING.exec(address);
56
64
  if (subnet) {
@@ -78,7 +86,7 @@ class Address4 {
78
86
  new Address4(address);
79
87
  return true;
80
88
  }
81
- catch (e) {
89
+ catch {
82
90
  return false;
83
91
  }
84
92
  }
@@ -90,6 +98,11 @@ class Address4 {
90
98
  */
91
99
  parse(address) {
92
100
  const groups = address.split('.');
101
+ // Checked before the general match so the error names the actual problem.
102
+ // Address6 rejects the same notation on its v4-in-v6 path.
103
+ if (groups.some((group) => /^0\d/.test(group))) {
104
+ throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.");
105
+ }
93
106
  if (!address.match(constants.RE_ADDRESS)) {
94
107
  throw new address_error_1.AddressError('Invalid IPv4 address.');
95
108
  }
@@ -128,7 +141,6 @@ class Address4 {
128
141
  static fromAddressAndWildcardMask(address, wildcardMask) {
129
142
  const wildcard = new Address4(wildcardMask).bigInt();
130
143
  const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);
131
- // eslint-disable-next-line no-bitwise
132
144
  const mask = wildcard ^ allOnes;
133
145
  const bits = common.prefixLengthFromMask(mask, constants.BITS);
134
146
  return new Address4(`${address}/${bits}`);
@@ -328,7 +340,7 @@ class Address4 {
328
340
  * @returns {Address4}
329
341
  */
330
342
  static fromBigInt(bigInt) {
331
- if (bigInt < 0n || bigInt > 0xffffffffn) {
343
+ if (bigInt < BigInt(0) || bigInt > BigInt(0xffffffff)) {
332
344
  throw new address_error_1.AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');
333
345
  }
334
346
  return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));
@@ -341,15 +353,7 @@ class Address4 {
341
353
  * @returns {Address4}
342
354
  */
343
355
  static fromByteArray(bytes) {
344
- if (bytes.length !== 4) {
345
- throw new address_error_1.AddressError('IPv4 addresses require exactly 4 bytes');
346
- }
347
- // Validate that all bytes are within valid range (0-255)
348
- for (let i = 0; i < bytes.length; i++) {
349
- if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {
350
- throw new address_error_1.AddressError('All bytes must be integers between 0 and 255');
351
- }
352
- }
356
+ common.assertByteArray(bytes, 4, 'IPv4', 0);
353
357
  return this.fromUnsignedByteArray(bytes);
354
358
  }
355
359
  /**
@@ -403,49 +407,49 @@ class Address4 {
403
407
  * @returns {boolean}
404
408
  */
405
409
  isMulticast() {
406
- return this.isInSubnet(MULTICAST_V4);
410
+ return this.isHostInSubnet(MULTICAST_V4);
407
411
  }
408
412
  /**
409
413
  * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).
410
414
  * @returns {boolean}
411
415
  */
412
416
  isPrivate() {
413
- return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet));
417
+ return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));
414
418
  }
415
419
  /**
416
420
  * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).
417
421
  * @returns {boolean}
418
422
  */
419
423
  isLoopback() {
420
- return this.isInSubnet(LOOPBACK_V4);
424
+ return this.isHostInSubnet(LOOPBACK_V4);
421
425
  }
422
426
  /**
423
427
  * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).
424
428
  * @returns {boolean}
425
429
  */
426
430
  isLinkLocal() {
427
- return this.isInSubnet(LINK_LOCAL_V4);
431
+ return this.isHostInSubnet(LINK_LOCAL_V4);
428
432
  }
429
433
  /**
430
434
  * Returns true if the address is the unspecified address `0.0.0.0`.
431
435
  * @returns {boolean}
432
436
  */
433
437
  isUnspecified() {
434
- return this.isInSubnet(UNSPECIFIED_V4);
438
+ return this.isHostInSubnet(UNSPECIFIED_V4);
435
439
  }
436
440
  /**
437
441
  * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).
438
442
  * @returns {boolean}
439
443
  */
440
444
  isBroadcast() {
441
- return this.isInSubnet(BROADCAST_V4);
445
+ return this.isHostInSubnet(BROADCAST_V4);
442
446
  }
443
447
  /**
444
448
  * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).
445
449
  * @returns {boolean}
446
450
  */
447
451
  isCGNAT() {
448
- return this.isInSubnet(CGNAT_V4);
452
+ return this.isHostInSubnet(CGNAT_V4);
449
453
  }
450
454
  /**
451
455
  * Returns a zero-padded base-2 string representation of the address
@@ -463,7 +467,7 @@ class Address4 {
463
467
  */
464
468
  groupForV6() {
465
469
  const segments = this.parsedAddress;
466
- return this.address.replace(constants.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments
470
+ return this.correctForm().replace(constants.RE_ADDRESS, `<span class="hover-group group-v4 group-6">${segments
467
471
  .slice(0, 2)
468
472
  .join('.')}</span>.<span class="hover-group group-v4 group-7">${segments
469
473
  .slice(2, 4)
@@ -1 +1 @@
1
- {"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAY,OAAe;QAR3B,WAAM,GAAW,SAAS,CAAC,MAAM,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAC7B,iBAAY,GAAW,EAAE,CAAC;QAC1B,WAAM,GAAW,KAAK,CAAC;QACvB,eAAU,GAAW,EAAE,CAAC;QACxB,OAAE,GAAY,IAAI,CAAC;QAoEnB;;;WAGG;QACH,cAAS,GAAG,UAAU,CAAC;QAiWvB;;;WAGG;QACH,eAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAza7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/C,IAAI,CAAC,UAAU,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'./common';\nimport * as constants from './v4/constants';\nimport { AddressError } from './address-error';\n\nconst isCorrect4 = common.isCorrect(constants.BITS);\n\n/**\n * Represents an IPv4 address\n * @param {string} address - An IPv4 address string\n */\nexport class Address4 {\n address: string;\n addressMinusSuffix?: string;\n groups: number = constants.GROUPS;\n parsedAddress: string[] = [];\n parsedSubnet: string = '';\n subnet: string = '/32';\n subnetMask: number = 32;\n v4: boolean = true;\n private _binaryZeroPad?: string;\n\n constructor(address: string) {\n this.address = address;\n\n const subnet = constants.RE_SUBNET_STRING.exec(address);\n\n if (subnet) {\n this.parsedSubnet = subnet[0].replace('/', '');\n this.subnetMask = parseInt(this.parsedSubnet, 10);\n this.subnet = `/${this.subnetMask}`;\n\n if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n address = address.replace(constants.RE_SUBNET_STRING, '');\n }\n\n this.addressMinusSuffix = address;\n\n this.parsedAddress = this.parse(address);\n }\n\n /**\n * Returns true if the given string is a valid IPv4 address (with optional\n * CIDR subnet), false otherwise. Host bits in the subnet portion are\n * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address\n * validation compare `correctForm()` to `startAddress().correctForm()`,\n * or use `networkForm()`.\n */\n static isValid(address: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new Address4(address);\n\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Parses an IPv4 address string into its four octet groups and stores the\n * result on `this.parsedAddress`. Called automatically by the constructor;\n * you typically don't need to call it directly. Throws `AddressError` if\n * the input is not a valid IPv4 address.\n */\n parse(address: string) {\n const groups = address.split('.');\n\n if (!address.match(constants.RE_ADDRESS)) {\n throw new AddressError('Invalid IPv4 address.');\n }\n\n return groups;\n }\n\n /**\n * Returns the address in correct form: octets joined with `.` and any\n * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the\n * canonical dotted-decimal representation.\n */\n correctForm(): string {\n return this.parsedAddress.map((part) => parseInt(part, 10)).join('.');\n }\n\n /**\n * Returns true if the address is correct, false otherwise\n * @returns {Boolean}\n */\n isCorrect = isCorrect4;\n\n /**\n * Construct an `Address4` from an address and a dotted-decimal subnet\n * mask given as separate strings (e.g. as returned by Node's\n * `os.networkInterfaces()`). Throws `AddressError` if the mask is\n * non-contiguous (e.g. `255.0.255.0`).\n * @example\n * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');\n * address.subnetMask; // 24\n */\n static fromAddressAndMask(address: string, mask: string): Address4 {\n const bits = common.prefixLengthFromMask(new Address4(mask).bigInt(), constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from an address and a Cisco-style wildcard mask\n * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard\n * mask is the bitwise inverse of the subnet mask. Throws `AddressError`\n * if the mask is non-contiguous (e.g. `0.255.0.255`).\n * @example\n * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');\n * address.subnetMask; // 24\n */\n static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4 {\n const wildcard = new Address4(wildcardMask).bigInt();\n const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);\n // eslint-disable-next-line no-bitwise\n const mask = wildcard ^ allOnes;\n const bits = common.prefixLengthFromMask(mask, constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from a wildcard pattern with trailing `*`\n * octets. The number of trailing wildcards determines the prefix\n * length: each `*` represents 8 bits.\n *\n * Only trailing whole-octet wildcards are supported. Partial-octet\n * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.\n * `192.*.0.1`) throw `AddressError`.\n * @example\n * Address4.fromWildcard('192.168.0.*').subnet; // '/24'\n * Address4.fromWildcard('192.168.*.*').subnet; // '/16'\n * Address4.fromWildcard('*.*.*.*').subnet; // '/0'\n */\n static fromWildcard(input: string): Address4 {\n const groups = input.split('.');\n\n if (groups.length !== constants.GROUPS) {\n throw new AddressError('Wildcard pattern must have 4 octets');\n }\n\n let firstWildcard = -1;\n\n for (let i = 0; i < groups.length; i++) {\n if (groups[i] === '*') {\n if (firstWildcard === -1) {\n firstWildcard = i;\n }\n } else if (firstWildcard !== -1) {\n throw new AddressError(\n 'Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)',\n );\n }\n }\n\n const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;\n const replaced = groups.map((g) => (g === '*' ? '0' : g));\n const subnetBits = constants.BITS - trailing * 8;\n\n return new Address4(`${replaced.join('.')}/${subnetBits}`);\n }\n\n /**\n * Converts a hex string to an IPv4 address object. Accepts 8 hex digits\n * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).\n * Throws `AddressError` for any other length or for non-hex characters.\n * @param {string} hex - a hex string to convert\n * @returns {Address4}\n */\n static fromHex(hex: string): Address4 {\n const stripped = hex.replace(/:/g, '');\n\n if (!/^[0-9a-fA-F]{8}$/.test(stripped)) {\n throw new AddressError('IPv4 hex must be exactly 8 hex digits');\n }\n\n const groups = [];\n\n for (let i = 0; i < 8; i += 2) {\n groups.push(parseInt(stripped.slice(i, i + 2), 16));\n }\n\n return new Address4(groups.join('.'));\n }\n\n /**\n * Converts an integer into a IPv4 address object. The integer must be a\n * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise\n * `AddressError` is thrown.\n * @param {integer} integer - a number to convert\n * @returns {Address4}\n */\n static fromInteger(integer: number): Address4 {\n if (!Number.isInteger(integer) || integer < 0 || integer > 0xffffffff) {\n throw new AddressError('IPv4 integer must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(integer.toString(16).padStart(8, '0'));\n }\n\n /**\n * Return an address from in-addr.arpa form\n * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address\n * @returns {Adress4}\n * @example\n * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.)\n * address.correctForm(); // '192.0.2.42'\n */\n static fromArpa(arpaFormAddress: string): Address4 {\n // remove ending \".in-addr.arpa.\" or just \".\"\n const leader = arpaFormAddress.replace(/(\\.in-addr\\.arpa)?\\.$/, '');\n\n const address = leader.split('.').reverse().join('.');\n\n return new Address4(address);\n }\n\n /**\n * Converts an IPv4 address object to a hex string\n * @returns {String}\n */\n toHex(): string {\n return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':');\n }\n\n /**\n * Converts an IPv4 address object to an array of bytes.\n *\n * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.\n * @returns {Array}\n */\n toArray(): number[] {\n return this.parsedAddress.map((part) => parseInt(part, 10));\n }\n\n /**\n * Converts an IPv4 address object to an IPv6 address group\n * @returns {String}\n */\n toGroup6(): string {\n const output = [];\n let i;\n\n for (i = 0; i < constants.GROUPS; i += 2) {\n output.push(\n `${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(\n this.parsedAddress[i + 1],\n )}`,\n );\n }\n\n return output.join(':');\n }\n\n /**\n * Returns the address as a `bigint`\n * @returns {bigint}\n */\n bigInt(): bigint {\n return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`);\n }\n\n /**\n * Helper function getting start address.\n * @returns {bigint}\n */\n _startAddress(): bigint {\n return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The first address in the range given by this address' subnet.\n * Often referred to as the Network Address.\n * @returns {Address4}\n */\n startAddress(): Address4 {\n return Address4.fromBigInt(this._startAddress());\n }\n\n /**\n * The first host address in the range given by this address's subnet ie\n * the first address after the Network Address\n * @returns {Address4}\n */\n startAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._startAddress() + adjust);\n }\n\n /**\n * Helper function getting end address.\n * @returns {bigint}\n */\n _endAddress(): bigint {\n return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The last address in the range given by this address' subnet\n * Often referred to as the Broadcast\n * @returns {Address4}\n */\n endAddress(): Address4 {\n return Address4.fromBigInt(this._endAddress());\n }\n\n /**\n * The last host address in the range given by this address's subnet ie\n * the last address prior to the Broadcast Address\n * @returns {Address4}\n */\n endAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._endAddress() - adjust);\n }\n\n /**\n * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for\n * a `/20`. Returns an `Address4`; call `.correctForm()` for the string.\n * @returns {Address4}\n */\n subnetMaskAddress(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'1'.repeat(this.subnetMask)}${'0'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is\n * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;\n * call `.correctForm()` for the string.\n * @returns {Address4}\n */\n wildcardMask(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'0'.repeat(this.subnetMask)}${'1'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The network address in CIDR string form, e.g. `192.168.1.0/24` for\n * `192.168.1.5/24`. For an address with no explicit subnet the prefix is\n * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.\n * @returns {string}\n */\n networkForm(): string {\n return `${this.startAddress().correctForm()}/${this.subnetMask}`;\n }\n\n /**\n * Converts a BigInt to a v4 address object. The value must be in the\n * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.\n * @param {bigint} bigInt - a BigInt to convert\n * @returns {Address4}\n */\n static fromBigInt(bigInt: bigint): Address4 {\n if (bigInt < 0n || bigInt > 0xffffffffn) {\n throw new AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));\n }\n\n /**\n * Convert a byte array to an Address4 object.\n *\n * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 bytes (0-255)\n * @returns {Address4}\n */\n static fromByteArray(bytes: Array<number>): Address4 {\n if (bytes.length !== 4) {\n throw new AddressError('IPv4 addresses require exactly 4 bytes');\n }\n\n // Validate that all bytes are within valid range (0-255)\n for (let i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {\n throw new AddressError('All bytes must be integers between 0 and 255');\n }\n }\n\n return this.fromUnsignedByteArray(bytes);\n }\n\n /**\n * Convert an unsigned byte array to an Address4 object\n * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)\n * @returns {Address4}\n */\n static fromUnsignedByteArray(bytes: Array<number>): Address4 {\n if (bytes.length !== 4) {\n throw new AddressError('IPv4 addresses require exactly 4 bytes');\n }\n\n const address = bytes.join('.');\n return new Address4(address);\n }\n\n /**\n * Returns the first n bits of the address, defaulting to the\n * subnet mask\n * @returns {String}\n */\n mask(mask?: number): string {\n if (mask === undefined) {\n mask = this.subnetMask;\n }\n\n return this.getBitsBase2(0, mask);\n }\n\n /**\n * Returns the bits in the given range as a base-2 string\n * @returns {string}\n */\n getBitsBase2(start: number, end: number): string {\n return this.binaryZeroPad().slice(start, end);\n }\n\n /**\n * Return the reversed ip6.arpa form of the address\n * @param {Object} options\n * @param {boolean} options.omitSuffix - omit the \"in-addr.arpa\" suffix\n * @returns {String}\n */\n reverseForm(options?: common.ReverseFormOptions): string {\n if (!options) {\n options = {};\n }\n\n const reversed = this.correctForm().split('.').reverse().join('.');\n\n if (options.omitSuffix) {\n return reversed;\n }\n\n return `${reversed}.in-addr.arpa.`;\n }\n\n /**\n * Returns true if the given address is in the subnet of the current address\n * @returns {boolean}\n */\n isInSubnet = common.isInSubnet;\n\n /**\n * Returns true if the given address is a multicast address\n * @returns {boolean}\n */\n isMulticast(): boolean {\n return this.isInSubnet(MULTICAST_V4);\n }\n\n /**\n * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).\n * @returns {boolean}\n */\n isPrivate(): boolean {\n return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).\n * @returns {boolean}\n */\n isLoopback(): boolean {\n return this.isInSubnet(LOOPBACK_V4);\n }\n\n /**\n * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).\n * @returns {boolean}\n */\n isLinkLocal(): boolean {\n return this.isInSubnet(LINK_LOCAL_V4);\n }\n\n /**\n * Returns true if the address is the unspecified address `0.0.0.0`.\n * @returns {boolean}\n */\n isUnspecified(): boolean {\n return this.isInSubnet(UNSPECIFIED_V4);\n }\n\n /**\n * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).\n * @returns {boolean}\n */\n isBroadcast(): boolean {\n return this.isInSubnet(BROADCAST_V4);\n }\n\n /**\n * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).\n * @returns {boolean}\n */\n isCGNAT(): boolean {\n return this.isInSubnet(CGNAT_V4);\n }\n\n /**\n * Returns a zero-padded base-2 string representation of the address\n * @returns {string}\n */\n binaryZeroPad(): string {\n if (this._binaryZeroPad === undefined) {\n this._binaryZeroPad = this.bigInt().toString(2).padStart(constants.BITS, '0');\n }\n return this._binaryZeroPad;\n }\n\n /**\n * Groups an IPv4 address for inclusion at the end of an IPv6 address\n * @returns {String}\n */\n groupForV6(): string {\n const segments = this.parsedAddress;\n\n return this.address.replace(\n constants.RE_ADDRESS,\n `<span class=\"hover-group group-v4 group-6\">${segments\n .slice(0, 2)\n .join('.')}</span>.<span class=\"hover-group group-v4 group-7\">${segments\n .slice(2, 4)\n .join('.')}</span>`,\n );\n }\n}\n\nconst MULTICAST_V4 = new Address4('224.0.0.0/4');\nconst PRIVATE_V4 = [\n new Address4('10.0.0.0/8'),\n new Address4('172.16.0.0/12'),\n new Address4('192.168.0.0/16'),\n];\nconst LOOPBACK_V4 = new Address4('127.0.0.0/8');\nconst LINK_LOCAL_V4 = new Address4('169.254.0.0/16');\nconst UNSPECIFIED_V4 = new Address4('0.0.0.0/32');\nconst BROADCAST_V4 = new Address4('255.255.255.255/32');\nconst CGNAT_V4 = new Address4('100.64.0.0/10');\n"]}
1
+ {"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAY,OAAe;QAT3B,uBAAkB,GAAW,EAAE,CAAC;QAChC,WAAM,GAAW,SAAS,CAAC,MAAM,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAC7B,iBAAY,GAAW,EAAE,CAAC;QAC1B,WAAM,GAAW,KAAK,CAAC;QACvB,eAAU,GAAW,EAAE,CAAC;QACxB,OAAE,GAAY,IAAI,CAAC;QA0EnB;;;WAGG;QACH,cAAS,GAAG,UAAU,CAAC;QAuVvB;;;WAGG;QACH,eAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAE/B;;;;;WAKG;QACH,mBAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QA7arC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/C,I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AC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;QAEpC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAC/B,SAAS,CAAC,UAAU,EACpB,8CAA8C,QAAQ;aACnD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,IAAI,CAAC,GAAG,CAAC,sDAAsD,QAAQ;aACvE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,IAAI,CAAC,GAAG,CAAC,SAAS,CACtB,CAAC;IACJ,CAAC;CACF;AA9gBD,4BA8gBC;AAED,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AACjD,MAAM,UAAU,GAAG;IACjB,IAAI,QAAQ,CAAC,YAAY,CAAC;IAC1B,IAAI,QAAQ,CAAC,eAAe,CAAC;IAC7B,IAAI,QAAQ,CAAC,gBAAgB,CAAC;CAC/B,CAAC;AACF,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACrD,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC;AAClD,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n\nimport * as common from './common';\nimport * as constants from './v4/constants';\nimport { AddressError } from './address-error';\n\nconst isCorrect4 = common.isCorrect(constants.BITS);\n\n/**\n * Represents an IPv4 address\n * @param {string} address - An IPv4 address string\n */\nexport class Address4 {\n address: string;\n addressMinusSuffix: string = '';\n groups: number = constants.GROUPS;\n parsedAddress: string[] = [];\n parsedSubnet: string = '';\n subnet: string = '/32';\n subnetMask: number = 32;\n v4: boolean = true;\n private _binaryZeroPad?: string;\n\n constructor(address: string) {\n this.address = address;\n\n const subnet = constants.RE_SUBNET_STRING.exec(address);\n\n if (subnet) {\n this.parsedSubnet = subnet[0].replace('/', '');\n this.subnetMask = parseInt(this.parsedSubnet, 10);\n this.subnet = `/${this.subnetMask}`;\n\n if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n address = address.replace(constants.RE_SUBNET_STRING, '');\n }\n\n this.addressMinusSuffix = address;\n\n this.parsedAddress = this.parse(address);\n }\n\n /**\n * Returns true if the given string is a valid IPv4 address (with optional\n * CIDR subnet), false otherwise. Host bits in the subnet portion are\n * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address\n * validation compare `correctForm()` to `startAddress().correctForm()`,\n * or use `networkForm()`.\n */\n static isValid(address: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new Address4(address);\n\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Parses an IPv4 address string into its four octet groups and stores the\n * result on `this.parsedAddress`. Called automatically by the constructor;\n * you typically don't need to call it directly. Throws `AddressError` if\n * the input is not a valid IPv4 address.\n */\n parse(address: string) {\n const groups = address.split('.');\n\n // Checked before the general match so the error names the actual problem.\n // Address6 rejects the same notation on its v4-in-v6 path.\n if (groups.some((group) => /^0\\d/.test(group))) {\n throw new AddressError(\"IPv4 addresses can't have leading zeroes.\");\n }\n\n if (!address.match(constants.RE_ADDRESS)) {\n throw new AddressError('Invalid IPv4 address.');\n }\n\n return groups;\n }\n\n /**\n * Returns the address in correct form: octets joined with `.` and any\n * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the\n * canonical dotted-decimal representation.\n */\n correctForm(): string {\n return this.parsedAddress.map((part) => parseInt(part, 10)).join('.');\n }\n\n /**\n * Returns true if the address is correct, false otherwise\n * @returns {Boolean}\n */\n isCorrect = isCorrect4;\n\n /**\n * Construct an `Address4` from an address and a dotted-decimal subnet\n * mask given as separate strings (e.g. as returned by Node's\n * `os.networkInterfaces()`). Throws `AddressError` if the mask is\n * non-contiguous (e.g. `255.0.255.0`).\n * @example\n * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');\n * address.subnetMask; // 24\n */\n static fromAddressAndMask(address: string, mask: string): Address4 {\n const bits = common.prefixLengthFromMask(new Address4(mask).bigInt(), constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from an address and a Cisco-style wildcard mask\n * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard\n * mask is the bitwise inverse of the subnet mask. Throws `AddressError`\n * if the mask is non-contiguous (e.g. `0.255.0.255`).\n * @example\n * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');\n * address.subnetMask; // 24\n */\n static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4 {\n const wildcard = new Address4(wildcardMask).bigInt();\n const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);\n const mask = wildcard ^ allOnes;\n const bits = common.prefixLengthFromMask(mask, constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from a wildcard pattern with trailing `*`\n * octets. The number of trailing wildcards determines the prefix\n * length: each `*` represents 8 bits.\n *\n * Only trailing whole-octet wildcards are supported. Partial-octet\n * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.\n * `192.*.0.1`) throw `AddressError`.\n * @example\n * Address4.fromWildcard('192.168.0.*').subnet; // '/24'\n * Address4.fromWildcard('192.168.*.*').subnet; // '/16'\n * Address4.fromWildcard('*.*.*.*').subnet; // '/0'\n */\n static fromWildcard(input: string): Address4 {\n const groups = input.split('.');\n\n if (groups.length !== constants.GROUPS) {\n throw new AddressError('Wildcard pattern must have 4 octets');\n }\n\n let firstWildcard = -1;\n\n for (let i = 0; i < groups.length; i++) {\n if (groups[i] === '*') {\n if (firstWildcard === -1) {\n firstWildcard = i;\n }\n } else if (firstWildcard !== -1) {\n throw new AddressError(\n 'Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)',\n );\n }\n }\n\n const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;\n const replaced = groups.map((g) => (g === '*' ? '0' : g));\n const subnetBits = constants.BITS - trailing * 8;\n\n return new Address4(`${replaced.join('.')}/${subnetBits}`);\n }\n\n /**\n * Converts a hex string to an IPv4 address object. Accepts 8 hex digits\n * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).\n * Throws `AddressError` for any other length or for non-hex characters.\n * @param {string} hex - a hex string to convert\n * @returns {Address4}\n */\n static fromHex(hex: string): Address4 {\n const stripped = hex.replace(/:/g, '');\n\n if (!/^[0-9a-fA-F]{8}$/.test(stripped)) {\n throw new AddressError('IPv4 hex must be exactly 8 hex digits');\n }\n\n const groups = [];\n\n for (let i = 0; i < 8; i += 2) {\n groups.push(parseInt(stripped.slice(i, i + 2), 16));\n }\n\n return new Address4(groups.join('.'));\n }\n\n /**\n * Converts an integer into a IPv4 address object. The integer must be a\n * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise\n * `AddressError` is thrown.\n * @param {integer} integer - a number to convert\n * @returns {Address4}\n */\n static fromInteger(integer: number): Address4 {\n if (!Number.isInteger(integer) || integer < 0 || integer > 0xffffffff) {\n throw new AddressError('IPv4 integer must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(integer.toString(16).padStart(8, '0'));\n }\n\n /**\n * Return an address from in-addr.arpa form\n * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address\n * @returns {Adress4}\n * @example\n * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.)\n * address.correctForm(); // '192.0.2.42'\n */\n static fromArpa(arpaFormAddress: string): Address4 {\n // remove ending \".in-addr.arpa.\" or just \".\"\n const leader = arpaFormAddress.replace(/(\\.in-addr\\.arpa)?\\.$/, '');\n\n const address = leader.split('.').reverse().join('.');\n\n return new Address4(address);\n }\n\n /**\n * Converts an IPv4 address object to a hex string\n * @returns {String}\n */\n toHex(): string {\n return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':');\n }\n\n /**\n * Converts an IPv4 address object to an array of bytes.\n *\n * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.\n * @returns {Array}\n */\n toArray(): number[] {\n return this.parsedAddress.map((part) => parseInt(part, 10));\n }\n\n /**\n * Converts an IPv4 address object to an IPv6 address group\n * @returns {String}\n */\n toGroup6(): string {\n const output = [];\n let i;\n\n for (i = 0; i < constants.GROUPS; i += 2) {\n output.push(\n `${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(\n this.parsedAddress[i + 1],\n )}`,\n );\n }\n\n return output.join(':');\n }\n\n /**\n * Returns the address as a `bigint`\n * @returns {bigint}\n */\n bigInt(): bigint {\n return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`);\n }\n\n /**\n * Helper function getting start address.\n * @returns {bigint}\n */\n _startAddress(): bigint {\n return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The first address in the range given by this address' subnet.\n * Often referred to as the Network Address.\n * @returns {Address4}\n */\n startAddress(): Address4 {\n return Address4.fromBigInt(this._startAddress());\n }\n\n /**\n * The first host address in the range given by this address's subnet ie\n * the first address after the Network Address\n * @returns {Address4}\n */\n startAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._startAddress() + adjust);\n }\n\n /**\n * Helper function getting end address.\n * @returns {bigint}\n */\n _endAddress(): bigint {\n return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The last address in the range given by this address' subnet\n * Often referred to as the Broadcast\n * @returns {Address4}\n */\n endAddress(): Address4 {\n return Address4.fromBigInt(this._endAddress());\n }\n\n /**\n * The last host address in the range given by this address's subnet ie\n * the last address prior to the Broadcast Address\n * @returns {Address4}\n */\n endAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._endAddress() - adjust);\n }\n\n /**\n * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for\n * a `/20`. Returns an `Address4`; call `.correctForm()` for the string.\n * @returns {Address4}\n */\n subnetMaskAddress(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'1'.repeat(this.subnetMask)}${'0'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is\n * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;\n * call `.correctForm()` for the string.\n * @returns {Address4}\n */\n wildcardMask(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'0'.repeat(this.subnetMask)}${'1'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The network address in CIDR string form, e.g. `192.168.1.0/24` for\n * `192.168.1.5/24`. For an address with no explicit subnet the prefix is\n * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.\n * @returns {string}\n */\n networkForm(): string {\n return `${this.startAddress().correctForm()}/${this.subnetMask}`;\n }\n\n /**\n * Converts a BigInt to a v4 address object. The value must be in the\n * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.\n * @param {bigint} bigInt - a BigInt to convert\n * @returns {Address4}\n */\n static fromBigInt(bigInt: bigint): Address4 {\n if (bigInt < BigInt(0) || bigInt > BigInt(0xffffffff)) {\n throw new AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));\n }\n\n /**\n * Convert a byte array to an Address4 object.\n *\n * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 bytes (0-255)\n * @returns {Address4}\n */\n static fromByteArray(bytes: Array<number>): Address4 {\n common.assertByteArray(bytes, 4, 'IPv4', 0);\n\n return this.fromUnsignedByteArray(bytes);\n }\n\n /**\n * Convert an unsigned byte array to an Address4 object\n * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)\n * @returns {Address4}\n */\n static fromUnsignedByteArray(bytes: Array<number>): Address4 {\n if (bytes.length !== 4) {\n throw new AddressError('IPv4 addresses require exactly 4 bytes');\n }\n\n const address = bytes.join('.');\n return new Address4(address);\n }\n\n /**\n * Returns the first n bits of the address, defaulting to the\n * subnet mask\n * @returns {String}\n */\n mask(mask?: number): string {\n if (mask === undefined) {\n mask = this.subnetMask;\n }\n\n return this.getBitsBase2(0, mask);\n }\n\n /**\n * Returns the bits in the given range as a base-2 string\n * @returns {string}\n */\n getBitsBase2(start: number, end: number): string {\n return this.binaryZeroPad().slice(start, end);\n }\n\n /**\n * Return the reversed ip6.arpa form of the address\n * @param {Object} options\n * @param {boolean} options.omitSuffix - omit the \"in-addr.arpa\" suffix\n * @returns {String}\n */\n reverseForm(options?: common.ReverseFormOptions): string {\n if (!options) {\n options = {};\n }\n\n const reversed = this.correctForm().split('.').reverse().join('.');\n\n if (options.omitSuffix) {\n return reversed;\n }\n\n return `${reversed}.in-addr.arpa.`;\n }\n\n /**\n * Returns true if the given address is in the subnet of the current address\n * @returns {boolean}\n */\n isInSubnet = common.isInSubnet;\n\n /**\n * Returns true if this address's host bits fall inside the given subnet,\n * ignoring this address's own subnet mask. See\n * {@link common.isHostInSubnet}.\n * @returns {boolean}\n */\n isHostInSubnet = common.isHostInSubnet;\n\n /**\n * Returns true if the given address is a multicast address\n * @returns {boolean}\n */\n isMulticast(): boolean {\n return this.isHostInSubnet(MULTICAST_V4);\n }\n\n /**\n * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).\n * @returns {boolean}\n */\n isPrivate(): boolean {\n return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).\n * @returns {boolean}\n */\n isLoopback(): boolean {\n return this.isHostInSubnet(LOOPBACK_V4);\n }\n\n /**\n * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).\n * @returns {boolean}\n */\n isLinkLocal(): boolean {\n return this.isHostInSubnet(LINK_LOCAL_V4);\n }\n\n /**\n * Returns true if the address is the unspecified address `0.0.0.0`.\n * @returns {boolean}\n */\n isUnspecified(): boolean {\n return this.isHostInSubnet(UNSPECIFIED_V4);\n }\n\n /**\n * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).\n * @returns {boolean}\n */\n isBroadcast(): boolean {\n return this.isHostInSubnet(BROADCAST_V4);\n }\n\n /**\n * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).\n * @returns {boolean}\n */\n isCGNAT(): boolean {\n return this.isHostInSubnet(CGNAT_V4);\n }\n\n /**\n * Returns a zero-padded base-2 string representation of the address\n * @returns {string}\n */\n binaryZeroPad(): string {\n if (this._binaryZeroPad === undefined) {\n this._binaryZeroPad = this.bigInt().toString(2).padStart(constants.BITS, '0');\n }\n return this._binaryZeroPad;\n }\n\n /**\n * Groups an IPv4 address for inclusion at the end of an IPv6 address\n * @returns {String}\n */\n groupForV6(): string {\n const segments = this.parsedAddress;\n\n return this.correctForm().replace(\n constants.RE_ADDRESS,\n `<span class=\"hover-group group-v4 group-6\">${segments\n .slice(0, 2)\n .join('.')}</span>.<span class=\"hover-group group-v4 group-7\">${segments\n .slice(2, 4)\n .join('.')}</span>`,\n );\n }\n}\n\nconst MULTICAST_V4 = new Address4('224.0.0.0/4');\nconst PRIVATE_V4 = [\n new Address4('10.0.0.0/8'),\n new Address4('172.16.0.0/12'),\n new Address4('192.168.0.0/16'),\n];\nconst LOOPBACK_V4 = new Address4('127.0.0.0/8');\nconst LINK_LOCAL_V4 = new Address4('169.254.0.0/16');\nconst UNSPECIFIED_V4 = new Address4('0.0.0.0/32');\nconst BROADCAST_V4 = new Address4('255.255.255.255/32');\nconst CGNAT_V4 = new Address4('100.64.0.0/10');\n"]}
@@ -297,7 +297,11 @@ export declare class Address6 {
297
297
  */
298
298
  bigInt(): bigint;
299
299
  /**
300
- * Return the last two groups of this address as an IPv4 address string
300
+ * Return the last two groups of this address as an IPv4 address string.
301
+ * If this address carries a CIDR prefix that covers the trailing 32 bits
302
+ * (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the
303
+ * corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to
304
+ * `/32`.
301
305
  * @returns {Address4}
302
306
  * @example
303
307
  * var address = new Address6('2001:4860:4001::1825:bf11');
@@ -364,22 +368,36 @@ export declare class Address6 {
364
368
  /**
365
369
  * Convert a byte array to an Address6 object.
366
370
  *
371
+ * Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an
372
+ * `Int8Array` or a Java `byte[]` holds them), folding signed values to their
373
+ * unsigned equivalent. Throws `AddressError` unless given exactly 16
374
+ * integers from -128 to 255.
375
+ *
367
376
  * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`.
368
377
  * @returns {Address6}
369
378
  */
370
- static fromByteArray(bytes: Array<any>): Address6;
379
+ static fromByteArray(bytes: Array<number>): Address6;
371
380
  /**
372
381
  * Convert an unsigned byte array to an Address6 object.
373
382
  *
383
+ * Throws `AddressError` unless given exactly 16 integers from 0 to 255.
384
+ *
374
385
  * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`.
375
386
  * @returns {Address6}
376
387
  */
377
- static fromUnsignedByteArray(bytes: Array<any>): Address6;
388
+ static fromUnsignedByteArray(bytes: Array<number>): Address6;
378
389
  /**
379
390
  * Returns true if the given address is in the subnet of the current address
380
391
  * @returns {boolean}
381
392
  */
382
393
  isInSubnet: typeof common.isInSubnet;
394
+ /**
395
+ * Returns true if this address's host bits fall inside the given subnet,
396
+ * ignoring this address's own subnet mask. See
397
+ * {@link common.isHostInSubnet}.
398
+ * @returns {boolean}
399
+ */
400
+ isHostInSubnet: typeof common.isHostInSubnet;
383
401
  /**
384
402
  * Returns true if the address is correct, false otherwise
385
403
  * @returns {boolean}
@@ -417,6 +435,24 @@ export declare class Address6 {
417
435
  * @returns {boolean}
418
436
  */
419
437
  isMapped4(): boolean;
438
+ /**
439
+ * If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped
440
+ * (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`,
441
+ * [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that
442
+ * embedded address as an {@link Address4}; otherwise return null.
443
+ *
444
+ * The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`,
445
+ * `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and
446
+ * delegate to the embedded {@link Address4} when present, so a literal such as
447
+ * `::ffff:127.0.0.1` is classified by what it actually reaches (loopback)
448
+ * rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped).
449
+ * This matters wherever the checks back a trust-boundary decision (e.g. an
450
+ * SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`,
451
+ * `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as
452
+ * non-internal.
453
+ * @returns {Address4 | null}
454
+ */
455
+ embeddedIPv4(): Address4 | null;
420
456
  /**
421
457
  * Returns true if the address is a Teredo address, false otherwise
422
458
  * @returns {boolean}
@@ -437,6 +473,35 @@ export declare class Address6 {
437
473
  * @returns {boolean}
438
474
  */
439
475
  isULA(): boolean;
476
+ /**
477
+ * Returns true if the address is private, i.e. a Unique Local Address in
478
+ * `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)) or an
479
+ * IPv4-mapped / NAT64 address whose embedded IPv4 address is in one of the
480
+ * [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges
481
+ * (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to
482
+ * {@link Address4.isPrivate}; use it instead of {@link isULA} when you need to
483
+ * catch mapped RFC 1918 addresses as well as native ULAs.
484
+ * @returns {boolean}
485
+ */
486
+ isPrivate(): boolean;
487
+ /**
488
+ * Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
489
+ * IPv4 address is in the carrier-grade NAT range `100.64.0.0/10`
490
+ * ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false
491
+ * otherwise. There is no native IPv6 CGNAT range, so this only ever returns
492
+ * true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`).
493
+ * @returns {boolean}
494
+ */
495
+ isCGNAT(): boolean;
496
+ /**
497
+ * Returns true if the address is an IPv4-mapped / NAT64 address whose embedded
498
+ * IPv4 address is the limited broadcast address `255.255.255.255`
499
+ * ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise.
500
+ * There is no IPv6 broadcast, so this only ever returns true for an embedded
501
+ * IPv4 address (e.g. `::ffff:255.255.255.255`).
502
+ * @returns {boolean}
503
+ */
504
+ isBroadcast(): boolean;
440
505
  /**
441
506
  * Returns true if the address is the unspecified address `::`.
442
507
  * @returns {boolean}