@auto-ai/agent 2.1.104 → 2.1.106

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 (756) hide show
  1. package/dist/agent-office.html +336 -3
  2. package/dist/ws-test.html +314 -1
  3. package/lib/launcher-env.js +4 -0
  4. package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/.mcp.json +7 -5
  5. package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/server/boot.mjs +0 -11
  6. package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/server/index.mjs +4 -2
  7. package/package.json +6 -6
  8. package/tools-runtime/git-tool/index.cjs +1229 -485
  9. package/tools-runtime/schedule-tool/index.cjs +1229 -485
  10. package/mcps-runtime/claude-tuitui/package-lock.json +0 -1167
  11. package/skills-runtime/geelib/build.mjs +0 -15
  12. package/skills-runtime/geelib/cli/args.ts +0 -67
  13. package/skills-runtime/geelib/cli/auth.ts +0 -159
  14. package/skills-runtime/geelib/cli/client.ts +0 -56
  15. package/skills-runtime/geelib/cli/commands/comment.ts +0 -25
  16. package/skills-runtime/geelib/cli/commands/matter.ts +0 -167
  17. package/skills-runtime/geelib/cli/commands/poll.ts +0 -322
  18. package/skills-runtime/geelib/cli/commands/project.ts +0 -98
  19. package/skills-runtime/geelib/cli/commands/user.ts +0 -5
  20. package/skills-runtime/geelib/cli/index.ts +0 -171
  21. package/skills-runtime/geelib/node_modules/.package-lock.json +0 -67
  22. package/skills-runtime/geelib/node_modules/@esbuild/linux-x64/README.md +0 -3
  23. package/skills-runtime/geelib/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  24. package/skills-runtime/geelib/node_modules/@esbuild/linux-x64/package.json +0 -20
  25. package/skills-runtime/geelib/node_modules/esbuild/LICENSE.md +0 -21
  26. package/skills-runtime/geelib/node_modules/esbuild/README.md +0 -3
  27. package/skills-runtime/geelib/node_modules/esbuild/bin/esbuild +0 -0
  28. package/skills-runtime/geelib/node_modules/esbuild/install.js +0 -289
  29. package/skills-runtime/geelib/node_modules/esbuild/lib/main.d.ts +0 -716
  30. package/skills-runtime/geelib/node_modules/esbuild/lib/main.js +0 -2242
  31. package/skills-runtime/geelib/node_modules/esbuild/package.json +0 -49
  32. package/skills-runtime/geelib/package-lock.json +0 -499
  33. package/skills-runtime/geelib/package.json +0 -12
  34. package/tools-runtime/code-tool/bun.lock +0 -15
  35. package/tools-runtime/code-tool/node_modules/zod/LICENSE +0 -21
  36. package/tools-runtime/code-tool/node_modules/zod/README.md +0 -191
  37. package/tools-runtime/code-tool/node_modules/zod/index.cjs +0 -33
  38. package/tools-runtime/code-tool/node_modules/zod/index.d.cts +0 -4
  39. package/tools-runtime/code-tool/node_modules/zod/index.d.ts +0 -4
  40. package/tools-runtime/code-tool/node_modules/zod/index.js +0 -4
  41. package/tools-runtime/code-tool/node_modules/zod/locales/index.cjs +0 -17
  42. package/tools-runtime/code-tool/node_modules/zod/locales/index.d.cts +0 -1
  43. package/tools-runtime/code-tool/node_modules/zod/locales/index.d.ts +0 -1
  44. package/tools-runtime/code-tool/node_modules/zod/locales/index.js +0 -1
  45. package/tools-runtime/code-tool/node_modules/zod/locales/package.json +0 -7
  46. package/tools-runtime/code-tool/node_modules/zod/mini/index.cjs +0 -32
  47. package/tools-runtime/code-tool/node_modules/zod/mini/index.d.cts +0 -3
  48. package/tools-runtime/code-tool/node_modules/zod/mini/index.d.ts +0 -3
  49. package/tools-runtime/code-tool/node_modules/zod/mini/index.js +0 -3
  50. package/tools-runtime/code-tool/node_modules/zod/mini/package.json +0 -7
  51. package/tools-runtime/code-tool/node_modules/zod/package.json +0 -135
  52. package/tools-runtime/code-tool/node_modules/zod/src/index.ts +0 -4
  53. package/tools-runtime/code-tool/node_modules/zod/src/locales/index.ts +0 -1
  54. package/tools-runtime/code-tool/node_modules/zod/src/mini/index.ts +0 -3
  55. package/tools-runtime/code-tool/node_modules/zod/src/v3/ZodError.ts +0 -330
  56. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  57. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  58. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  59. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  60. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  61. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  62. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  63. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  64. package/tools-runtime/code-tool/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  65. package/tools-runtime/code-tool/node_modules/zod/src/v3/errors.ts +0 -13
  66. package/tools-runtime/code-tool/node_modules/zod/src/v3/external.ts +0 -6
  67. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  68. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  69. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  70. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  71. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  72. package/tools-runtime/code-tool/node_modules/zod/src/v3/helpers/util.ts +0 -224
  73. package/tools-runtime/code-tool/node_modules/zod/src/v3/index.ts +0 -4
  74. package/tools-runtime/code-tool/node_modules/zod/src/v3/locales/en.ts +0 -124
  75. package/tools-runtime/code-tool/node_modules/zod/src/v3/standard-schema.ts +0 -113
  76. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  77. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  78. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  79. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  80. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  81. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  82. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  83. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  84. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  85. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  86. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  87. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  88. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  89. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  90. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  91. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  92. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  93. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  94. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  95. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  96. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  97. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  98. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  99. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  100. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  101. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  102. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  103. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  104. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  105. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  106. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  107. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  108. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  109. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  110. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  111. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  112. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  113. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  114. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  115. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  116. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  117. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  118. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  119. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  120. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  121. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  122. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  123. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  124. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  125. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  126. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  127. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  128. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  129. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  130. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  131. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  132. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  133. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  134. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  135. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  136. package/tools-runtime/code-tool/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  137. package/tools-runtime/code-tool/node_modules/zod/src/v3/types.ts +0 -5138
  138. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/checks.ts +0 -32
  139. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  140. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/compat.ts +0 -70
  141. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/errors.ts +0 -82
  142. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/external.ts +0 -52
  143. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  144. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/index.ts +0 -5
  145. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/iso.ts +0 -90
  146. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/parse.ts +0 -82
  147. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  148. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  149. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  150. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  151. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  152. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  153. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  154. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  155. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  156. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  157. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  158. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  159. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  160. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  161. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  162. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  163. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  164. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  165. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  166. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  167. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  168. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  169. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  170. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  171. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  172. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  173. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  174. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  175. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  176. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  177. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  178. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  179. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  180. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  181. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  182. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  183. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  184. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  185. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  186. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  187. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  188. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  189. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  190. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  191. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  192. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  193. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  194. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  195. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  196. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  197. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  198. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  199. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  200. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  201. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  202. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  203. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  204. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  205. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  206. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  207. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  208. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  209. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  210. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  211. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  212. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  213. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  214. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  215. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  216. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  217. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  218. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  219. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  220. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  221. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  222. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  223. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  224. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  225. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  226. package/tools-runtime/code-tool/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  227. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/api.ts +0 -1823
  228. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/checks.ts +0 -1293
  229. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/config.ts +0 -15
  230. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/core.ts +0 -153
  231. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/doc.ts +0 -44
  232. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/errors.ts +0 -455
  233. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/index.ts +0 -16
  234. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  235. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  236. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  237. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/parse.ts +0 -195
  238. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/regexes.ts +0 -190
  239. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/registries.ts +0 -105
  240. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  241. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  242. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  243. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  244. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  245. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  246. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  247. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  248. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  249. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  250. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  251. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  252. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  253. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  254. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  255. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  256. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  257. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  258. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/util.ts +0 -983
  259. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/versions.ts +0 -5
  260. package/tools-runtime/code-tool/node_modules/zod/src/v4/core/zsf.ts +0 -323
  261. package/tools-runtime/code-tool/node_modules/zod/src/v4/index.ts +0 -4
  262. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ar.ts +0 -115
  263. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/az.ts +0 -111
  264. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/be.ts +0 -176
  265. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/bg.ts +0 -128
  266. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ca.ts +0 -116
  267. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/cs.ts +0 -118
  268. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/da.ts +0 -123
  269. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/de.ts +0 -116
  270. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/el.ts +0 -121
  271. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/en.ts +0 -123
  272. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/eo.ts +0 -118
  273. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/es.ts +0 -141
  274. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/fa.ts +0 -126
  275. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/fi.ts +0 -121
  276. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  277. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/fr.ts +0 -132
  278. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/he.ts +0 -246
  279. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/hr.ts +0 -131
  280. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/hu.ts +0 -117
  281. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/hy.ts +0 -164
  282. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/id.ts +0 -115
  283. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/index.ts +0 -52
  284. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/is.ts +0 -119
  285. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/it.ts +0 -116
  286. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ja.ts +0 -114
  287. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ka.ts +0 -123
  288. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/kh.ts +0 -7
  289. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/km.ts +0 -119
  290. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ko.ts +0 -121
  291. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/lt.ts +0 -239
  292. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/mk.ts +0 -118
  293. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ms.ts +0 -115
  294. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/nl.ts +0 -121
  295. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/no.ts +0 -116
  296. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ota.ts +0 -117
  297. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/pl.ts +0 -118
  298. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ps.ts +0 -126
  299. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/pt.ts +0 -116
  300. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ro.ts +0 -129
  301. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ru.ts +0 -176
  302. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/sl.ts +0 -118
  303. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/sv.ts +0 -119
  304. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ta.ts +0 -118
  305. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/th.ts +0 -119
  306. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/tr.ts +0 -111
  307. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ua.ts +0 -7
  308. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/uk.ts +0 -117
  309. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/ur.ts +0 -119
  310. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/uz.ts +0 -117
  311. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/vi.ts +0 -117
  312. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/yo.ts +0 -124
  313. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  314. package/tools-runtime/code-tool/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  315. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/checks.ts +0 -32
  316. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  317. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/external.ts +0 -41
  318. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/index.ts +0 -3
  319. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/iso.ts +0 -66
  320. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/parse.ts +0 -14
  321. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  322. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  323. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  324. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  325. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  326. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  327. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  328. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  329. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  330. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  331. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  332. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  333. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  334. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  335. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  336. package/tools-runtime/code-tool/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  337. package/tools-runtime/code-tool/node_modules/zod/src/v4-mini/index.ts +0 -3
  338. package/tools-runtime/code-tool/node_modules/zod/v3/ZodError.cjs +0 -138
  339. package/tools-runtime/code-tool/node_modules/zod/v3/ZodError.d.cts +0 -164
  340. package/tools-runtime/code-tool/node_modules/zod/v3/ZodError.d.ts +0 -164
  341. package/tools-runtime/code-tool/node_modules/zod/v3/ZodError.js +0 -133
  342. package/tools-runtime/code-tool/node_modules/zod/v3/errors.cjs +0 -17
  343. package/tools-runtime/code-tool/node_modules/zod/v3/errors.d.cts +0 -5
  344. package/tools-runtime/code-tool/node_modules/zod/v3/errors.d.ts +0 -5
  345. package/tools-runtime/code-tool/node_modules/zod/v3/errors.js +0 -9
  346. package/tools-runtime/code-tool/node_modules/zod/v3/external.cjs +0 -22
  347. package/tools-runtime/code-tool/node_modules/zod/v3/external.d.cts +0 -6
  348. package/tools-runtime/code-tool/node_modules/zod/v3/external.d.ts +0 -6
  349. package/tools-runtime/code-tool/node_modules/zod/v3/external.js +0 -6
  350. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  351. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  352. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  353. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  354. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  355. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  356. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  357. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  358. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  359. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  360. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  361. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  362. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  363. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  364. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  365. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  366. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  367. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  368. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  369. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  370. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/util.cjs +0 -137
  371. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/util.d.cts +0 -85
  372. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/util.d.ts +0 -85
  373. package/tools-runtime/code-tool/node_modules/zod/v3/helpers/util.js +0 -133
  374. package/tools-runtime/code-tool/node_modules/zod/v3/index.cjs +0 -33
  375. package/tools-runtime/code-tool/node_modules/zod/v3/index.d.cts +0 -4
  376. package/tools-runtime/code-tool/node_modules/zod/v3/index.d.ts +0 -4
  377. package/tools-runtime/code-tool/node_modules/zod/v3/index.js +0 -4
  378. package/tools-runtime/code-tool/node_modules/zod/v3/locales/en.cjs +0 -112
  379. package/tools-runtime/code-tool/node_modules/zod/v3/locales/en.d.cts +0 -3
  380. package/tools-runtime/code-tool/node_modules/zod/v3/locales/en.d.ts +0 -3
  381. package/tools-runtime/code-tool/node_modules/zod/v3/locales/en.js +0 -109
  382. package/tools-runtime/code-tool/node_modules/zod/v3/package.json +0 -7
  383. package/tools-runtime/code-tool/node_modules/zod/v3/standard-schema.cjs +0 -2
  384. package/tools-runtime/code-tool/node_modules/zod/v3/standard-schema.d.cts +0 -102
  385. package/tools-runtime/code-tool/node_modules/zod/v3/standard-schema.d.ts +0 -102
  386. package/tools-runtime/code-tool/node_modules/zod/v3/standard-schema.js +0 -1
  387. package/tools-runtime/code-tool/node_modules/zod/v3/types.cjs +0 -3777
  388. package/tools-runtime/code-tool/node_modules/zod/v3/types.d.cts +0 -1034
  389. package/tools-runtime/code-tool/node_modules/zod/v3/types.d.ts +0 -1034
  390. package/tools-runtime/code-tool/node_modules/zod/v3/types.js +0 -3695
  391. package/tools-runtime/code-tool/node_modules/zod/v4/classic/checks.cjs +0 -33
  392. package/tools-runtime/code-tool/node_modules/zod/v4/classic/checks.d.cts +0 -1
  393. package/tools-runtime/code-tool/node_modules/zod/v4/classic/checks.d.ts +0 -1
  394. package/tools-runtime/code-tool/node_modules/zod/v4/classic/checks.js +0 -1
  395. package/tools-runtime/code-tool/node_modules/zod/v4/classic/coerce.cjs +0 -47
  396. package/tools-runtime/code-tool/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  397. package/tools-runtime/code-tool/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  398. package/tools-runtime/code-tool/node_modules/zod/v4/classic/coerce.js +0 -17
  399. package/tools-runtime/code-tool/node_modules/zod/v4/classic/compat.cjs +0 -61
  400. package/tools-runtime/code-tool/node_modules/zod/v4/classic/compat.d.cts +0 -50
  401. package/tools-runtime/code-tool/node_modules/zod/v4/classic/compat.d.ts +0 -50
  402. package/tools-runtime/code-tool/node_modules/zod/v4/classic/compat.js +0 -31
  403. package/tools-runtime/code-tool/node_modules/zod/v4/classic/errors.cjs +0 -74
  404. package/tools-runtime/code-tool/node_modules/zod/v4/classic/errors.d.cts +0 -30
  405. package/tools-runtime/code-tool/node_modules/zod/v4/classic/errors.d.ts +0 -30
  406. package/tools-runtime/code-tool/node_modules/zod/v4/classic/errors.js +0 -48
  407. package/tools-runtime/code-tool/node_modules/zod/v4/classic/external.cjs +0 -73
  408. package/tools-runtime/code-tool/node_modules/zod/v4/classic/external.d.cts +0 -16
  409. package/tools-runtime/code-tool/node_modules/zod/v4/classic/external.d.ts +0 -16
  410. package/tools-runtime/code-tool/node_modules/zod/v4/classic/external.js +0 -20
  411. package/tools-runtime/code-tool/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  412. package/tools-runtime/code-tool/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  413. package/tools-runtime/code-tool/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  414. package/tools-runtime/code-tool/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  415. package/tools-runtime/code-tool/node_modules/zod/v4/classic/index.cjs +0 -33
  416. package/tools-runtime/code-tool/node_modules/zod/v4/classic/index.d.cts +0 -4
  417. package/tools-runtime/code-tool/node_modules/zod/v4/classic/index.d.ts +0 -4
  418. package/tools-runtime/code-tool/node_modules/zod/v4/classic/index.js +0 -4
  419. package/tools-runtime/code-tool/node_modules/zod/v4/classic/iso.cjs +0 -60
  420. package/tools-runtime/code-tool/node_modules/zod/v4/classic/iso.d.cts +0 -22
  421. package/tools-runtime/code-tool/node_modules/zod/v4/classic/iso.d.ts +0 -22
  422. package/tools-runtime/code-tool/node_modules/zod/v4/classic/iso.js +0 -30
  423. package/tools-runtime/code-tool/node_modules/zod/v4/classic/package.json +0 -7
  424. package/tools-runtime/code-tool/node_modules/zod/v4/classic/parse.cjs +0 -41
  425. package/tools-runtime/code-tool/node_modules/zod/v4/classic/parse.d.cts +0 -31
  426. package/tools-runtime/code-tool/node_modules/zod/v4/classic/parse.d.ts +0 -31
  427. package/tools-runtime/code-tool/node_modules/zod/v4/classic/parse.js +0 -15
  428. package/tools-runtime/code-tool/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  429. package/tools-runtime/code-tool/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  430. package/tools-runtime/code-tool/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  431. package/tools-runtime/code-tool/node_modules/zod/v4/classic/schemas.js +0 -1395
  432. package/tools-runtime/code-tool/node_modules/zod/v4/core/api.cjs +0 -1227
  433. package/tools-runtime/code-tool/node_modules/zod/v4/core/api.d.cts +0 -325
  434. package/tools-runtime/code-tool/node_modules/zod/v4/core/api.d.ts +0 -325
  435. package/tools-runtime/code-tool/node_modules/zod/v4/core/api.js +0 -1087
  436. package/tools-runtime/code-tool/node_modules/zod/v4/core/checks.cjs +0 -601
  437. package/tools-runtime/code-tool/node_modules/zod/v4/core/checks.d.cts +0 -278
  438. package/tools-runtime/code-tool/node_modules/zod/v4/core/checks.d.ts +0 -278
  439. package/tools-runtime/code-tool/node_modules/zod/v4/core/checks.js +0 -575
  440. package/tools-runtime/code-tool/node_modules/zod/v4/core/core.cjs +0 -85
  441. package/tools-runtime/code-tool/node_modules/zod/v4/core/core.d.cts +0 -70
  442. package/tools-runtime/code-tool/node_modules/zod/v4/core/core.d.ts +0 -70
  443. package/tools-runtime/code-tool/node_modules/zod/v4/core/core.js +0 -78
  444. package/tools-runtime/code-tool/node_modules/zod/v4/core/doc.cjs +0 -39
  445. package/tools-runtime/code-tool/node_modules/zod/v4/core/doc.d.cts +0 -14
  446. package/tools-runtime/code-tool/node_modules/zod/v4/core/doc.d.ts +0 -14
  447. package/tools-runtime/code-tool/node_modules/zod/v4/core/doc.js +0 -35
  448. package/tools-runtime/code-tool/node_modules/zod/v4/core/errors.cjs +0 -216
  449. package/tools-runtime/code-tool/node_modules/zod/v4/core/errors.d.cts +0 -221
  450. package/tools-runtime/code-tool/node_modules/zod/v4/core/errors.d.ts +0 -221
  451. package/tools-runtime/code-tool/node_modules/zod/v4/core/errors.js +0 -185
  452. package/tools-runtime/code-tool/node_modules/zod/v4/core/index.cjs +0 -47
  453. package/tools-runtime/code-tool/node_modules/zod/v4/core/index.d.cts +0 -16
  454. package/tools-runtime/code-tool/node_modules/zod/v4/core/index.d.ts +0 -16
  455. package/tools-runtime/code-tool/node_modules/zod/v4/core/index.js +0 -16
  456. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  457. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  458. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  459. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  460. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  461. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  462. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  463. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  464. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema.cjs +0 -2
  465. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  466. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  467. package/tools-runtime/code-tool/node_modules/zod/v4/core/json-schema.js +0 -1
  468. package/tools-runtime/code-tool/node_modules/zod/v4/core/package.json +0 -7
  469. package/tools-runtime/code-tool/node_modules/zod/v4/core/parse.cjs +0 -131
  470. package/tools-runtime/code-tool/node_modules/zod/v4/core/parse.d.cts +0 -49
  471. package/tools-runtime/code-tool/node_modules/zod/v4/core/parse.d.ts +0 -49
  472. package/tools-runtime/code-tool/node_modules/zod/v4/core/parse.js +0 -93
  473. package/tools-runtime/code-tool/node_modules/zod/v4/core/regexes.cjs +0 -172
  474. package/tools-runtime/code-tool/node_modules/zod/v4/core/regexes.d.cts +0 -85
  475. package/tools-runtime/code-tool/node_modules/zod/v4/core/regexes.d.ts +0 -85
  476. package/tools-runtime/code-tool/node_modules/zod/v4/core/regexes.js +0 -139
  477. package/tools-runtime/code-tool/node_modules/zod/v4/core/registries.cjs +0 -56
  478. package/tools-runtime/code-tool/node_modules/zod/v4/core/registries.d.cts +0 -35
  479. package/tools-runtime/code-tool/node_modules/zod/v4/core/registries.d.ts +0 -35
  480. package/tools-runtime/code-tool/node_modules/zod/v4/core/registries.js +0 -51
  481. package/tools-runtime/code-tool/node_modules/zod/v4/core/schemas.cjs +0 -2270
  482. package/tools-runtime/code-tool/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  483. package/tools-runtime/code-tool/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  484. package/tools-runtime/code-tool/node_modules/zod/v4/core/schemas.js +0 -2239
  485. package/tools-runtime/code-tool/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  486. package/tools-runtime/code-tool/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  487. package/tools-runtime/code-tool/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  488. package/tools-runtime/code-tool/node_modules/zod/v4/core/standard-schema.js +0 -1
  489. package/tools-runtime/code-tool/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  490. package/tools-runtime/code-tool/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  491. package/tools-runtime/code-tool/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  492. package/tools-runtime/code-tool/node_modules/zod/v4/core/to-json-schema.js +0 -448
  493. package/tools-runtime/code-tool/node_modules/zod/v4/core/util.cjs +0 -734
  494. package/tools-runtime/code-tool/node_modules/zod/v4/core/util.d.cts +0 -200
  495. package/tools-runtime/code-tool/node_modules/zod/v4/core/util.d.ts +0 -200
  496. package/tools-runtime/code-tool/node_modules/zod/v4/core/util.js +0 -674
  497. package/tools-runtime/code-tool/node_modules/zod/v4/core/versions.cjs +0 -8
  498. package/tools-runtime/code-tool/node_modules/zod/v4/core/versions.d.cts +0 -5
  499. package/tools-runtime/code-tool/node_modules/zod/v4/core/versions.d.ts +0 -5
  500. package/tools-runtime/code-tool/node_modules/zod/v4/core/versions.js +0 -5
  501. package/tools-runtime/code-tool/node_modules/zod/v4/index.cjs +0 -22
  502. package/tools-runtime/code-tool/node_modules/zod/v4/index.d.cts +0 -3
  503. package/tools-runtime/code-tool/node_modules/zod/v4/index.d.ts +0 -3
  504. package/tools-runtime/code-tool/node_modules/zod/v4/index.js +0 -3
  505. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ar.cjs +0 -133
  506. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ar.d.cts +0 -5
  507. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ar.d.ts +0 -4
  508. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ar.js +0 -106
  509. package/tools-runtime/code-tool/node_modules/zod/v4/locales/az.cjs +0 -132
  510. package/tools-runtime/code-tool/node_modules/zod/v4/locales/az.d.cts +0 -5
  511. package/tools-runtime/code-tool/node_modules/zod/v4/locales/az.d.ts +0 -4
  512. package/tools-runtime/code-tool/node_modules/zod/v4/locales/az.js +0 -105
  513. package/tools-runtime/code-tool/node_modules/zod/v4/locales/be.cjs +0 -183
  514. package/tools-runtime/code-tool/node_modules/zod/v4/locales/be.d.cts +0 -5
  515. package/tools-runtime/code-tool/node_modules/zod/v4/locales/be.d.ts +0 -4
  516. package/tools-runtime/code-tool/node_modules/zod/v4/locales/be.js +0 -156
  517. package/tools-runtime/code-tool/node_modules/zod/v4/locales/bg.cjs +0 -147
  518. package/tools-runtime/code-tool/node_modules/zod/v4/locales/bg.d.cts +0 -5
  519. package/tools-runtime/code-tool/node_modules/zod/v4/locales/bg.d.ts +0 -4
  520. package/tools-runtime/code-tool/node_modules/zod/v4/locales/bg.js +0 -120
  521. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ca.cjs +0 -134
  522. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ca.d.cts +0 -5
  523. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ca.d.ts +0 -4
  524. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ca.js +0 -107
  525. package/tools-runtime/code-tool/node_modules/zod/v4/locales/cs.cjs +0 -138
  526. package/tools-runtime/code-tool/node_modules/zod/v4/locales/cs.d.cts +0 -5
  527. package/tools-runtime/code-tool/node_modules/zod/v4/locales/cs.d.ts +0 -4
  528. package/tools-runtime/code-tool/node_modules/zod/v4/locales/cs.js +0 -111
  529. package/tools-runtime/code-tool/node_modules/zod/v4/locales/da.cjs +0 -142
  530. package/tools-runtime/code-tool/node_modules/zod/v4/locales/da.d.cts +0 -5
  531. package/tools-runtime/code-tool/node_modules/zod/v4/locales/da.d.ts +0 -4
  532. package/tools-runtime/code-tool/node_modules/zod/v4/locales/da.js +0 -115
  533. package/tools-runtime/code-tool/node_modules/zod/v4/locales/de.cjs +0 -135
  534. package/tools-runtime/code-tool/node_modules/zod/v4/locales/de.d.cts +0 -5
  535. package/tools-runtime/code-tool/node_modules/zod/v4/locales/de.d.ts +0 -4
  536. package/tools-runtime/code-tool/node_modules/zod/v4/locales/de.js +0 -108
  537. package/tools-runtime/code-tool/node_modules/zod/v4/locales/el.cjs +0 -136
  538. package/tools-runtime/code-tool/node_modules/zod/v4/locales/el.d.cts +0 -5
  539. package/tools-runtime/code-tool/node_modules/zod/v4/locales/el.d.ts +0 -4
  540. package/tools-runtime/code-tool/node_modules/zod/v4/locales/el.js +0 -109
  541. package/tools-runtime/code-tool/node_modules/zod/v4/locales/en.cjs +0 -140
  542. package/tools-runtime/code-tool/node_modules/zod/v4/locales/en.d.cts +0 -5
  543. package/tools-runtime/code-tool/node_modules/zod/v4/locales/en.d.ts +0 -4
  544. package/tools-runtime/code-tool/node_modules/zod/v4/locales/en.js +0 -113
  545. package/tools-runtime/code-tool/node_modules/zod/v4/locales/eo.cjs +0 -136
  546. package/tools-runtime/code-tool/node_modules/zod/v4/locales/eo.d.cts +0 -5
  547. package/tools-runtime/code-tool/node_modules/zod/v4/locales/eo.d.ts +0 -4
  548. package/tools-runtime/code-tool/node_modules/zod/v4/locales/eo.js +0 -109
  549. package/tools-runtime/code-tool/node_modules/zod/v4/locales/es.cjs +0 -159
  550. package/tools-runtime/code-tool/node_modules/zod/v4/locales/es.d.cts +0 -5
  551. package/tools-runtime/code-tool/node_modules/zod/v4/locales/es.d.ts +0 -4
  552. package/tools-runtime/code-tool/node_modules/zod/v4/locales/es.js +0 -132
  553. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fa.cjs +0 -141
  554. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fa.d.cts +0 -5
  555. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fa.d.ts +0 -4
  556. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fa.js +0 -114
  557. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fi.cjs +0 -139
  558. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fi.d.cts +0 -5
  559. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fi.d.ts +0 -4
  560. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fi.js +0 -112
  561. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  562. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  563. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  564. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr-CA.js +0 -107
  565. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr.cjs +0 -152
  566. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr.d.cts +0 -5
  567. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr.d.ts +0 -4
  568. package/tools-runtime/code-tool/node_modules/zod/v4/locales/fr.js +0 -125
  569. package/tools-runtime/code-tool/node_modules/zod/v4/locales/he.cjs +0 -241
  570. package/tools-runtime/code-tool/node_modules/zod/v4/locales/he.d.cts +0 -5
  571. package/tools-runtime/code-tool/node_modules/zod/v4/locales/he.d.ts +0 -4
  572. package/tools-runtime/code-tool/node_modules/zod/v4/locales/he.js +0 -214
  573. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hr.cjs +0 -149
  574. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hr.d.cts +0 -5
  575. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hr.d.ts +0 -4
  576. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hr.js +0 -122
  577. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hu.cjs +0 -135
  578. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hu.d.cts +0 -5
  579. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hu.d.ts +0 -4
  580. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hu.js +0 -108
  581. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hy.cjs +0 -174
  582. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hy.d.cts +0 -5
  583. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hy.d.ts +0 -4
  584. package/tools-runtime/code-tool/node_modules/zod/v4/locales/hy.js +0 -147
  585. package/tools-runtime/code-tool/node_modules/zod/v4/locales/id.cjs +0 -133
  586. package/tools-runtime/code-tool/node_modules/zod/v4/locales/id.d.cts +0 -5
  587. package/tools-runtime/code-tool/node_modules/zod/v4/locales/id.d.ts +0 -4
  588. package/tools-runtime/code-tool/node_modules/zod/v4/locales/id.js +0 -106
  589. package/tools-runtime/code-tool/node_modules/zod/v4/locales/index.cjs +0 -111
  590. package/tools-runtime/code-tool/node_modules/zod/v4/locales/index.d.cts +0 -52
  591. package/tools-runtime/code-tool/node_modules/zod/v4/locales/index.d.ts +0 -52
  592. package/tools-runtime/code-tool/node_modules/zod/v4/locales/index.js +0 -52
  593. package/tools-runtime/code-tool/node_modules/zod/v4/locales/is.cjs +0 -136
  594. package/tools-runtime/code-tool/node_modules/zod/v4/locales/is.d.cts +0 -5
  595. package/tools-runtime/code-tool/node_modules/zod/v4/locales/is.d.ts +0 -4
  596. package/tools-runtime/code-tool/node_modules/zod/v4/locales/is.js +0 -109
  597. package/tools-runtime/code-tool/node_modules/zod/v4/locales/it.cjs +0 -135
  598. package/tools-runtime/code-tool/node_modules/zod/v4/locales/it.d.cts +0 -5
  599. package/tools-runtime/code-tool/node_modules/zod/v4/locales/it.d.ts +0 -4
  600. package/tools-runtime/code-tool/node_modules/zod/v4/locales/it.js +0 -108
  601. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ja.cjs +0 -134
  602. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ja.d.cts +0 -5
  603. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ja.d.ts +0 -4
  604. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ja.js +0 -107
  605. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ka.cjs +0 -139
  606. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ka.d.cts +0 -5
  607. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ka.d.ts +0 -4
  608. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ka.js +0 -112
  609. package/tools-runtime/code-tool/node_modules/zod/v4/locales/kh.cjs +0 -12
  610. package/tools-runtime/code-tool/node_modules/zod/v4/locales/kh.d.cts +0 -5
  611. package/tools-runtime/code-tool/node_modules/zod/v4/locales/kh.d.ts +0 -5
  612. package/tools-runtime/code-tool/node_modules/zod/v4/locales/kh.js +0 -5
  613. package/tools-runtime/code-tool/node_modules/zod/v4/locales/km.cjs +0 -137
  614. package/tools-runtime/code-tool/node_modules/zod/v4/locales/km.d.cts +0 -5
  615. package/tools-runtime/code-tool/node_modules/zod/v4/locales/km.d.ts +0 -4
  616. package/tools-runtime/code-tool/node_modules/zod/v4/locales/km.js +0 -110
  617. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ko.cjs +0 -138
  618. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ko.d.cts +0 -5
  619. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ko.d.ts +0 -4
  620. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ko.js +0 -111
  621. package/tools-runtime/code-tool/node_modules/zod/v4/locales/lt.cjs +0 -230
  622. package/tools-runtime/code-tool/node_modules/zod/v4/locales/lt.d.cts +0 -5
  623. package/tools-runtime/code-tool/node_modules/zod/v4/locales/lt.d.ts +0 -4
  624. package/tools-runtime/code-tool/node_modules/zod/v4/locales/lt.js +0 -203
  625. package/tools-runtime/code-tool/node_modules/zod/v4/locales/mk.cjs +0 -136
  626. package/tools-runtime/code-tool/node_modules/zod/v4/locales/mk.d.cts +0 -5
  627. package/tools-runtime/code-tool/node_modules/zod/v4/locales/mk.d.ts +0 -4
  628. package/tools-runtime/code-tool/node_modules/zod/v4/locales/mk.js +0 -109
  629. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ms.cjs +0 -134
  630. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ms.d.cts +0 -5
  631. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ms.d.ts +0 -4
  632. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ms.js +0 -107
  633. package/tools-runtime/code-tool/node_modules/zod/v4/locales/nl.cjs +0 -137
  634. package/tools-runtime/code-tool/node_modules/zod/v4/locales/nl.d.cts +0 -5
  635. package/tools-runtime/code-tool/node_modules/zod/v4/locales/nl.d.ts +0 -4
  636. package/tools-runtime/code-tool/node_modules/zod/v4/locales/nl.js +0 -110
  637. package/tools-runtime/code-tool/node_modules/zod/v4/locales/no.cjs +0 -135
  638. package/tools-runtime/code-tool/node_modules/zod/v4/locales/no.d.cts +0 -5
  639. package/tools-runtime/code-tool/node_modules/zod/v4/locales/no.d.ts +0 -4
  640. package/tools-runtime/code-tool/node_modules/zod/v4/locales/no.js +0 -108
  641. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ota.cjs +0 -136
  642. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ota.d.cts +0 -5
  643. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ota.d.ts +0 -4
  644. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ota.js +0 -109
  645. package/tools-runtime/code-tool/node_modules/zod/v4/locales/package.json +0 -7
  646. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pl.cjs +0 -136
  647. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pl.d.cts +0 -5
  648. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pl.d.ts +0 -4
  649. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pl.js +0 -109
  650. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ps.cjs +0 -141
  651. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ps.d.cts +0 -5
  652. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ps.d.ts +0 -4
  653. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ps.js +0 -114
  654. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pt.cjs +0 -135
  655. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pt.d.cts +0 -5
  656. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pt.d.ts +0 -4
  657. package/tools-runtime/code-tool/node_modules/zod/v4/locales/pt.js +0 -108
  658. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ro.cjs +0 -146
  659. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ro.d.cts +0 -5
  660. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ro.d.ts +0 -4
  661. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ro.js +0 -119
  662. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ru.cjs +0 -183
  663. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ru.d.cts +0 -5
  664. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ru.d.ts +0 -4
  665. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ru.js +0 -156
  666. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sl.cjs +0 -136
  667. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sl.d.cts +0 -5
  668. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sl.d.ts +0 -4
  669. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sl.js +0 -109
  670. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sv.cjs +0 -137
  671. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sv.d.cts +0 -5
  672. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sv.d.ts +0 -4
  673. package/tools-runtime/code-tool/node_modules/zod/v4/locales/sv.js +0 -110
  674. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ta.cjs +0 -137
  675. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ta.d.cts +0 -5
  676. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ta.d.ts +0 -4
  677. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ta.js +0 -110
  678. package/tools-runtime/code-tool/node_modules/zod/v4/locales/th.cjs +0 -137
  679. package/tools-runtime/code-tool/node_modules/zod/v4/locales/th.d.cts +0 -5
  680. package/tools-runtime/code-tool/node_modules/zod/v4/locales/th.d.ts +0 -4
  681. package/tools-runtime/code-tool/node_modules/zod/v4/locales/th.js +0 -110
  682. package/tools-runtime/code-tool/node_modules/zod/v4/locales/tr.cjs +0 -132
  683. package/tools-runtime/code-tool/node_modules/zod/v4/locales/tr.d.cts +0 -5
  684. package/tools-runtime/code-tool/node_modules/zod/v4/locales/tr.d.ts +0 -4
  685. package/tools-runtime/code-tool/node_modules/zod/v4/locales/tr.js +0 -105
  686. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ua.cjs +0 -12
  687. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ua.d.cts +0 -5
  688. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ua.d.ts +0 -5
  689. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ua.js +0 -5
  690. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uk.cjs +0 -135
  691. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uk.d.cts +0 -5
  692. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uk.d.ts +0 -4
  693. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uk.js +0 -108
  694. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ur.cjs +0 -137
  695. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ur.d.cts +0 -5
  696. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ur.d.ts +0 -4
  697. package/tools-runtime/code-tool/node_modules/zod/v4/locales/ur.js +0 -110
  698. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uz.cjs +0 -137
  699. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uz.d.cts +0 -5
  700. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uz.d.ts +0 -4
  701. package/tools-runtime/code-tool/node_modules/zod/v4/locales/uz.js +0 -110
  702. package/tools-runtime/code-tool/node_modules/zod/v4/locales/vi.cjs +0 -135
  703. package/tools-runtime/code-tool/node_modules/zod/v4/locales/vi.d.cts +0 -5
  704. package/tools-runtime/code-tool/node_modules/zod/v4/locales/vi.d.ts +0 -4
  705. package/tools-runtime/code-tool/node_modules/zod/v4/locales/vi.js +0 -108
  706. package/tools-runtime/code-tool/node_modules/zod/v4/locales/yo.cjs +0 -134
  707. package/tools-runtime/code-tool/node_modules/zod/v4/locales/yo.d.cts +0 -5
  708. package/tools-runtime/code-tool/node_modules/zod/v4/locales/yo.d.ts +0 -4
  709. package/tools-runtime/code-tool/node_modules/zod/v4/locales/yo.js +0 -107
  710. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  711. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  712. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  713. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-CN.js +0 -109
  714. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  715. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  716. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  717. package/tools-runtime/code-tool/node_modules/zod/v4/locales/zh-TW.js +0 -107
  718. package/tools-runtime/code-tool/node_modules/zod/v4/mini/checks.cjs +0 -34
  719. package/tools-runtime/code-tool/node_modules/zod/v4/mini/checks.d.cts +0 -1
  720. package/tools-runtime/code-tool/node_modules/zod/v4/mini/checks.d.ts +0 -1
  721. package/tools-runtime/code-tool/node_modules/zod/v4/mini/checks.js +0 -1
  722. package/tools-runtime/code-tool/node_modules/zod/v4/mini/coerce.cjs +0 -52
  723. package/tools-runtime/code-tool/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  724. package/tools-runtime/code-tool/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  725. package/tools-runtime/code-tool/node_modules/zod/v4/mini/coerce.js +0 -22
  726. package/tools-runtime/code-tool/node_modules/zod/v4/mini/external.cjs +0 -63
  727. package/tools-runtime/code-tool/node_modules/zod/v4/mini/external.d.cts +0 -13
  728. package/tools-runtime/code-tool/node_modules/zod/v4/mini/external.d.ts +0 -13
  729. package/tools-runtime/code-tool/node_modules/zod/v4/mini/external.js +0 -14
  730. package/tools-runtime/code-tool/node_modules/zod/v4/mini/index.cjs +0 -32
  731. package/tools-runtime/code-tool/node_modules/zod/v4/mini/index.d.cts +0 -3
  732. package/tools-runtime/code-tool/node_modules/zod/v4/mini/index.d.ts +0 -3
  733. package/tools-runtime/code-tool/node_modules/zod/v4/mini/index.js +0 -3
  734. package/tools-runtime/code-tool/node_modules/zod/v4/mini/iso.cjs +0 -64
  735. package/tools-runtime/code-tool/node_modules/zod/v4/mini/iso.d.cts +0 -22
  736. package/tools-runtime/code-tool/node_modules/zod/v4/mini/iso.d.ts +0 -22
  737. package/tools-runtime/code-tool/node_modules/zod/v4/mini/iso.js +0 -34
  738. package/tools-runtime/code-tool/node_modules/zod/v4/mini/package.json +0 -7
  739. package/tools-runtime/code-tool/node_modules/zod/v4/mini/parse.cjs +0 -16
  740. package/tools-runtime/code-tool/node_modules/zod/v4/mini/parse.d.cts +0 -1
  741. package/tools-runtime/code-tool/node_modules/zod/v4/mini/parse.d.ts +0 -1
  742. package/tools-runtime/code-tool/node_modules/zod/v4/mini/parse.js +0 -1
  743. package/tools-runtime/code-tool/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  744. package/tools-runtime/code-tool/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  745. package/tools-runtime/code-tool/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  746. package/tools-runtime/code-tool/node_modules/zod/v4/mini/schemas.js +0 -961
  747. package/tools-runtime/code-tool/node_modules/zod/v4/package.json +0 -7
  748. package/tools-runtime/code-tool/node_modules/zod/v4-mini/index.cjs +0 -32
  749. package/tools-runtime/code-tool/node_modules/zod/v4-mini/index.d.cts +0 -3
  750. package/tools-runtime/code-tool/node_modules/zod/v4-mini/index.d.ts +0 -3
  751. package/tools-runtime/code-tool/node_modules/zod/v4-mini/index.js +0 -3
  752. package/tools-runtime/code-tool/node_modules/zod/v4-mini/package.json +0 -7
  753. package/tools-runtime/git-tool/bun.lock +0 -15
  754. /package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/cli.mjs +0 -0
  755. /package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/server/state.mjs +0 -0
  756. /package/mcps-runtime/{claude-tuitui → claude-tuitui-channel}/server/tuitui-api.mjs +0 -0
@@ -1,2242 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // lib/npm/node.ts
31
- var node_exports = {};
32
- __export(node_exports, {
33
- analyzeMetafile: () => analyzeMetafile,
34
- analyzeMetafileSync: () => analyzeMetafileSync,
35
- build: () => build,
36
- buildSync: () => buildSync,
37
- context: () => context,
38
- default: () => node_default,
39
- formatMessages: () => formatMessages,
40
- formatMessagesSync: () => formatMessagesSync,
41
- initialize: () => initialize,
42
- stop: () => stop,
43
- transform: () => transform,
44
- transformSync: () => transformSync,
45
- version: () => version
46
- });
47
- module.exports = __toCommonJS(node_exports);
48
-
49
- // lib/shared/stdio_protocol.ts
50
- function encodePacket(packet) {
51
- let visit = (value) => {
52
- if (value === null) {
53
- bb.write8(0);
54
- } else if (typeof value === "boolean") {
55
- bb.write8(1);
56
- bb.write8(+value);
57
- } else if (typeof value === "number") {
58
- bb.write8(2);
59
- bb.write32(value | 0);
60
- } else if (typeof value === "string") {
61
- bb.write8(3);
62
- bb.write(encodeUTF8(value));
63
- } else if (value instanceof Uint8Array) {
64
- bb.write8(4);
65
- bb.write(value);
66
- } else if (value instanceof Array) {
67
- bb.write8(5);
68
- bb.write32(value.length);
69
- for (let item of value) {
70
- visit(item);
71
- }
72
- } else {
73
- let keys = Object.keys(value);
74
- bb.write8(6);
75
- bb.write32(keys.length);
76
- for (let key of keys) {
77
- bb.write(encodeUTF8(key));
78
- visit(value[key]);
79
- }
80
- }
81
- };
82
- let bb = new ByteBuffer();
83
- bb.write32(0);
84
- bb.write32(packet.id << 1 | +!packet.isRequest);
85
- visit(packet.value);
86
- writeUInt32LE(bb.buf, bb.len - 4, 0);
87
- return bb.buf.subarray(0, bb.len);
88
- }
89
- function decodePacket(bytes) {
90
- let visit = () => {
91
- switch (bb.read8()) {
92
- case 0:
93
- return null;
94
- case 1:
95
- return !!bb.read8();
96
- case 2:
97
- return bb.read32();
98
- case 3:
99
- return decodeUTF8(bb.read());
100
- case 4:
101
- return bb.read();
102
- case 5: {
103
- let count = bb.read32();
104
- let value2 = [];
105
- for (let i = 0; i < count; i++) {
106
- value2.push(visit());
107
- }
108
- return value2;
109
- }
110
- case 6: {
111
- let count = bb.read32();
112
- let value2 = {};
113
- for (let i = 0; i < count; i++) {
114
- value2[decodeUTF8(bb.read())] = visit();
115
- }
116
- return value2;
117
- }
118
- default:
119
- throw new Error("Invalid packet");
120
- }
121
- };
122
- let bb = new ByteBuffer(bytes);
123
- let id = bb.read32();
124
- let isRequest = (id & 1) === 0;
125
- id >>>= 1;
126
- let value = visit();
127
- if (bb.ptr !== bytes.length) {
128
- throw new Error("Invalid packet");
129
- }
130
- return { id, isRequest, value };
131
- }
132
- var ByteBuffer = class {
133
- constructor(buf = new Uint8Array(1024)) {
134
- this.buf = buf;
135
- this.len = 0;
136
- this.ptr = 0;
137
- }
138
- _write(delta) {
139
- if (this.len + delta > this.buf.length) {
140
- let clone = new Uint8Array((this.len + delta) * 2);
141
- clone.set(this.buf);
142
- this.buf = clone;
143
- }
144
- this.len += delta;
145
- return this.len - delta;
146
- }
147
- write8(value) {
148
- let offset = this._write(1);
149
- this.buf[offset] = value;
150
- }
151
- write32(value) {
152
- let offset = this._write(4);
153
- writeUInt32LE(this.buf, value, offset);
154
- }
155
- write(bytes) {
156
- let offset = this._write(4 + bytes.length);
157
- writeUInt32LE(this.buf, bytes.length, offset);
158
- this.buf.set(bytes, offset + 4);
159
- }
160
- _read(delta) {
161
- if (this.ptr + delta > this.buf.length) {
162
- throw new Error("Invalid packet");
163
- }
164
- this.ptr += delta;
165
- return this.ptr - delta;
166
- }
167
- read8() {
168
- return this.buf[this._read(1)];
169
- }
170
- read32() {
171
- return readUInt32LE(this.buf, this._read(4));
172
- }
173
- read() {
174
- let length = this.read32();
175
- let bytes = new Uint8Array(length);
176
- let ptr = this._read(bytes.length);
177
- bytes.set(this.buf.subarray(ptr, ptr + length));
178
- return bytes;
179
- }
180
- };
181
- var encodeUTF8;
182
- var decodeUTF8;
183
- var encodeInvariant;
184
- if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") {
185
- let encoder = new TextEncoder();
186
- let decoder = new TextDecoder();
187
- encodeUTF8 = (text) => encoder.encode(text);
188
- decodeUTF8 = (bytes) => decoder.decode(bytes);
189
- encodeInvariant = 'new TextEncoder().encode("")';
190
- } else if (typeof Buffer !== "undefined") {
191
- encodeUTF8 = (text) => Buffer.from(text);
192
- decodeUTF8 = (bytes) => {
193
- let { buffer, byteOffset, byteLength } = bytes;
194
- return Buffer.from(buffer, byteOffset, byteLength).toString();
195
- };
196
- encodeInvariant = 'Buffer.from("")';
197
- } else {
198
- throw new Error("No UTF-8 codec found");
199
- }
200
- if (!(encodeUTF8("") instanceof Uint8Array))
201
- throw new Error(`Invariant violation: "${encodeInvariant} instanceof Uint8Array" is incorrectly false
202
-
203
- This indicates that your JavaScript environment is broken. You cannot use
204
- esbuild in this environment because esbuild relies on this invariant. This
205
- is not a problem with esbuild. You need to fix your environment instead.
206
- `);
207
- function readUInt32LE(buffer, offset) {
208
- return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24;
209
- }
210
- function writeUInt32LE(buffer, value, offset) {
211
- buffer[offset++] = value;
212
- buffer[offset++] = value >> 8;
213
- buffer[offset++] = value >> 16;
214
- buffer[offset++] = value >> 24;
215
- }
216
-
217
- // lib/shared/common.ts
218
- var quote = JSON.stringify;
219
- var buildLogLevelDefault = "warning";
220
- var transformLogLevelDefault = "silent";
221
- function validateAndJoinStringArray(values, what) {
222
- const toJoin = [];
223
- for (const value of values) {
224
- validateStringValue(value, what);
225
- if (value.indexOf(",") >= 0) throw new Error(`Invalid ${what}: ${value}`);
226
- toJoin.push(value);
227
- }
228
- return toJoin.join(",");
229
- }
230
- var canBeAnything = () => null;
231
- var mustBeBoolean = (value) => typeof value === "boolean" ? null : "a boolean";
232
- var mustBeString = (value) => typeof value === "string" ? null : "a string";
233
- var mustBeRegExp = (value) => value instanceof RegExp ? null : "a RegExp object";
234
- var mustBeInteger = (value) => typeof value === "number" && value === (value | 0) ? null : "an integer";
235
- var mustBeValidPortNumber = (value) => typeof value === "number" && value === (value | 0) && value >= 0 && value <= 65535 ? null : "a valid port number";
236
- var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
237
- var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
238
- var mustBeArrayOfStrings = (value) => Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "an array of strings";
239
- var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
240
- var mustBeEntryPoints = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
241
- var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
242
- var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
243
- var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
244
- var mustBeStringOrObject = (value) => typeof value === "string" || typeof value === "object" && value !== null && !Array.isArray(value) ? null : "a string or an object";
245
- var mustBeStringOrArrayOfStrings = (value) => typeof value === "string" || Array.isArray(value) && value.every((x) => typeof x === "string") ? null : "a string or an array of strings";
246
- var mustBeStringOrUint8Array = (value) => typeof value === "string" || value instanceof Uint8Array ? null : "a string or a Uint8Array";
247
- var mustBeStringOrURL = (value) => typeof value === "string" || value instanceof URL ? null : "a string or a URL";
248
- function getFlag(object, keys, key, mustBeFn) {
249
- let value = object[key];
250
- keys[key + ""] = true;
251
- if (value === void 0) return void 0;
252
- let mustBe = mustBeFn(value);
253
- if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`);
254
- return value;
255
- }
256
- function checkForInvalidFlags(object, keys, where) {
257
- for (let key in object) {
258
- if (!(key in keys)) {
259
- throw new Error(`Invalid option ${where}: ${quote(key)}`);
260
- }
261
- }
262
- }
263
- function validateInitializeOptions(options) {
264
- let keys = /* @__PURE__ */ Object.create(null);
265
- let wasmURL = getFlag(options, keys, "wasmURL", mustBeStringOrURL);
266
- let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule);
267
- let worker = getFlag(options, keys, "worker", mustBeBoolean);
268
- checkForInvalidFlags(options, keys, "in initialize() call");
269
- return {
270
- wasmURL,
271
- wasmModule,
272
- worker
273
- };
274
- }
275
- function validateMangleCache(mangleCache) {
276
- let validated;
277
- if (mangleCache !== void 0) {
278
- validated = /* @__PURE__ */ Object.create(null);
279
- for (let key in mangleCache) {
280
- let value = mangleCache[key];
281
- if (typeof value === "string" || value === false) {
282
- validated[key] = value;
283
- } else {
284
- throw new Error(`Expected ${quote(key)} in mangle cache to map to either a string or false`);
285
- }
286
- }
287
- }
288
- return validated;
289
- }
290
- function pushLogFlags(flags, options, keys, isTTY2, logLevelDefault) {
291
- let color = getFlag(options, keys, "color", mustBeBoolean);
292
- let logLevel = getFlag(options, keys, "logLevel", mustBeString);
293
- let logLimit = getFlag(options, keys, "logLimit", mustBeInteger);
294
- if (color !== void 0) flags.push(`--color=${color}`);
295
- else if (isTTY2) flags.push(`--color=true`);
296
- flags.push(`--log-level=${logLevel || logLevelDefault}`);
297
- flags.push(`--log-limit=${logLimit || 0}`);
298
- }
299
- function validateStringValue(value, what, key) {
300
- if (typeof value !== "string") {
301
- throw new Error(`Expected value for ${what}${key !== void 0 ? " " + quote(key) : ""} to be a string, got ${typeof value} instead`);
302
- }
303
- return value;
304
- }
305
- function pushCommonFlags(flags, options, keys) {
306
- let legalComments = getFlag(options, keys, "legalComments", mustBeString);
307
- let sourceRoot = getFlag(options, keys, "sourceRoot", mustBeString);
308
- let sourcesContent = getFlag(options, keys, "sourcesContent", mustBeBoolean);
309
- let target = getFlag(options, keys, "target", mustBeStringOrArrayOfStrings);
310
- let format = getFlag(options, keys, "format", mustBeString);
311
- let globalName = getFlag(options, keys, "globalName", mustBeString);
312
- let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
313
- let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp);
314
- let mangleQuoted = getFlag(options, keys, "mangleQuoted", mustBeBoolean);
315
- let minify = getFlag(options, keys, "minify", mustBeBoolean);
316
- let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
317
- let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
318
- let minifyIdentifiers = getFlag(options, keys, "minifyIdentifiers", mustBeBoolean);
319
- let lineLimit = getFlag(options, keys, "lineLimit", mustBeInteger);
320
- let drop = getFlag(options, keys, "drop", mustBeArrayOfStrings);
321
- let dropLabels = getFlag(options, keys, "dropLabels", mustBeArrayOfStrings);
322
- let charset = getFlag(options, keys, "charset", mustBeString);
323
- let treeShaking = getFlag(options, keys, "treeShaking", mustBeBoolean);
324
- let ignoreAnnotations = getFlag(options, keys, "ignoreAnnotations", mustBeBoolean);
325
- let jsx = getFlag(options, keys, "jsx", mustBeString);
326
- let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
327
- let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
328
- let jsxImportSource = getFlag(options, keys, "jsxImportSource", mustBeString);
329
- let jsxDev = getFlag(options, keys, "jsxDev", mustBeBoolean);
330
- let jsxSideEffects = getFlag(options, keys, "jsxSideEffects", mustBeBoolean);
331
- let define = getFlag(options, keys, "define", mustBeObject);
332
- let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
333
- let supported = getFlag(options, keys, "supported", mustBeObject);
334
- let pure = getFlag(options, keys, "pure", mustBeArrayOfStrings);
335
- let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
336
- let platform = getFlag(options, keys, "platform", mustBeString);
337
- let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
338
- let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings);
339
- if (legalComments) flags.push(`--legal-comments=${legalComments}`);
340
- if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
341
- if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
342
- if (target) flags.push(`--target=${validateAndJoinStringArray(Array.isArray(target) ? target : [target], "target")}`);
343
- if (format) flags.push(`--format=${format}`);
344
- if (globalName) flags.push(`--global-name=${globalName}`);
345
- if (platform) flags.push(`--platform=${platform}`);
346
- if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
347
- if (minify) flags.push("--minify");
348
- if (minifySyntax) flags.push("--minify-syntax");
349
- if (minifyWhitespace) flags.push("--minify-whitespace");
350
- if (minifyIdentifiers) flags.push("--minify-identifiers");
351
- if (lineLimit) flags.push(`--line-limit=${lineLimit}`);
352
- if (charset) flags.push(`--charset=${charset}`);
353
- if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
354
- if (ignoreAnnotations) flags.push(`--ignore-annotations`);
355
- if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
356
- if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`);
357
- if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`);
358
- if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
359
- if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
360
- if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
361
- if (jsx) flags.push(`--jsx=${jsx}`);
362
- if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
363
- if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`);
364
- if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`);
365
- if (jsxDev) flags.push(`--jsx-dev`);
366
- if (jsxSideEffects) flags.push(`--jsx-side-effects`);
367
- if (define) {
368
- for (let key in define) {
369
- if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`);
370
- flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`);
371
- }
372
- }
373
- if (logOverride) {
374
- for (let key in logOverride) {
375
- if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`);
376
- flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`);
377
- }
378
- }
379
- if (supported) {
380
- for (let key in supported) {
381
- if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`);
382
- const value = supported[key];
383
- if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`);
384
- flags.push(`--supported:${key}=${value}`);
385
- }
386
- }
387
- if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`);
388
- if (keepNames) flags.push(`--keep-names`);
389
- }
390
- function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) {
391
- var _a2;
392
- let flags = [];
393
- let entries = [];
394
- let keys = /* @__PURE__ */ Object.create(null);
395
- let stdinContents = null;
396
- let stdinResolveDir = null;
397
- pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
398
- pushCommonFlags(flags, options, keys);
399
- let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
400
- let bundle = getFlag(options, keys, "bundle", mustBeBoolean);
401
- let splitting = getFlag(options, keys, "splitting", mustBeBoolean);
402
- let preserveSymlinks = getFlag(options, keys, "preserveSymlinks", mustBeBoolean);
403
- let metafile = getFlag(options, keys, "metafile", mustBeBoolean);
404
- let outfile = getFlag(options, keys, "outfile", mustBeString);
405
- let outdir = getFlag(options, keys, "outdir", mustBeString);
406
- let outbase = getFlag(options, keys, "outbase", mustBeString);
407
- let tsconfig = getFlag(options, keys, "tsconfig", mustBeString);
408
- let resolveExtensions = getFlag(options, keys, "resolveExtensions", mustBeArrayOfStrings);
409
- let nodePathsInput = getFlag(options, keys, "nodePaths", mustBeArrayOfStrings);
410
- let mainFields = getFlag(options, keys, "mainFields", mustBeArrayOfStrings);
411
- let conditions = getFlag(options, keys, "conditions", mustBeArrayOfStrings);
412
- let external = getFlag(options, keys, "external", mustBeArrayOfStrings);
413
- let packages = getFlag(options, keys, "packages", mustBeString);
414
- let alias = getFlag(options, keys, "alias", mustBeObject);
415
- let loader = getFlag(options, keys, "loader", mustBeObject);
416
- let outExtension = getFlag(options, keys, "outExtension", mustBeObject);
417
- let publicPath = getFlag(options, keys, "publicPath", mustBeString);
418
- let entryNames = getFlag(options, keys, "entryNames", mustBeString);
419
- let chunkNames = getFlag(options, keys, "chunkNames", mustBeString);
420
- let assetNames = getFlag(options, keys, "assetNames", mustBeString);
421
- let inject = getFlag(options, keys, "inject", mustBeArrayOfStrings);
422
- let banner = getFlag(options, keys, "banner", mustBeObject);
423
- let footer = getFlag(options, keys, "footer", mustBeObject);
424
- let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
425
- let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString);
426
- let stdin = getFlag(options, keys, "stdin", mustBeObject);
427
- let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
428
- let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean);
429
- let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
430
- keys.plugins = true;
431
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
432
- if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`);
433
- if (bundle) flags.push("--bundle");
434
- if (allowOverwrite) flags.push("--allow-overwrite");
435
- if (splitting) flags.push("--splitting");
436
- if (preserveSymlinks) flags.push("--preserve-symlinks");
437
- if (metafile) flags.push(`--metafile`);
438
- if (outfile) flags.push(`--outfile=${outfile}`);
439
- if (outdir) flags.push(`--outdir=${outdir}`);
440
- if (outbase) flags.push(`--outbase=${outbase}`);
441
- if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
442
- if (packages) flags.push(`--packages=${packages}`);
443
- if (resolveExtensions) flags.push(`--resolve-extensions=${validateAndJoinStringArray(resolveExtensions, "resolve extension")}`);
444
- if (publicPath) flags.push(`--public-path=${publicPath}`);
445
- if (entryNames) flags.push(`--entry-names=${entryNames}`);
446
- if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
447
- if (assetNames) flags.push(`--asset-names=${assetNames}`);
448
- if (mainFields) flags.push(`--main-fields=${validateAndJoinStringArray(mainFields, "main field")}`);
449
- if (conditions) flags.push(`--conditions=${validateAndJoinStringArray(conditions, "condition")}`);
450
- if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
451
- if (alias) {
452
- for (let old in alias) {
453
- if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`);
454
- flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`);
455
- }
456
- }
457
- if (banner) {
458
- for (let type in banner) {
459
- if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`);
460
- flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`);
461
- }
462
- }
463
- if (footer) {
464
- for (let type in footer) {
465
- if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`);
466
- flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`);
467
- }
468
- }
469
- if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`);
470
- if (loader) {
471
- for (let ext in loader) {
472
- if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`);
473
- flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`);
474
- }
475
- }
476
- if (outExtension) {
477
- for (let ext in outExtension) {
478
- if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`);
479
- flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`);
480
- }
481
- }
482
- if (entryPoints) {
483
- if (Array.isArray(entryPoints)) {
484
- for (let i = 0, n = entryPoints.length; i < n; i++) {
485
- let entryPoint = entryPoints[i];
486
- if (typeof entryPoint === "object" && entryPoint !== null) {
487
- let entryPointKeys = /* @__PURE__ */ Object.create(null);
488
- let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString);
489
- let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
490
- checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i);
491
- if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i);
492
- if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i);
493
- entries.push([output, input]);
494
- } else {
495
- entries.push(["", validateStringValue(entryPoint, "entry point at index " + i)]);
496
- }
497
- }
498
- } else {
499
- for (let key in entryPoints) {
500
- entries.push([key, validateStringValue(entryPoints[key], "entry point", key)]);
501
- }
502
- }
503
- }
504
- if (stdin) {
505
- let stdinKeys = /* @__PURE__ */ Object.create(null);
506
- let contents = getFlag(stdin, stdinKeys, "contents", mustBeStringOrUint8Array);
507
- let resolveDir = getFlag(stdin, stdinKeys, "resolveDir", mustBeString);
508
- let sourcefile = getFlag(stdin, stdinKeys, "sourcefile", mustBeString);
509
- let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
510
- checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object');
511
- if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
512
- if (loader2) flags.push(`--loader=${loader2}`);
513
- if (resolveDir) stdinResolveDir = resolveDir;
514
- if (typeof contents === "string") stdinContents = encodeUTF8(contents);
515
- else if (contents instanceof Uint8Array) stdinContents = contents;
516
- }
517
- let nodePaths = [];
518
- if (nodePathsInput) {
519
- for (let value of nodePathsInput) {
520
- value += "";
521
- nodePaths.push(value);
522
- }
523
- }
524
- return {
525
- entries,
526
- flags,
527
- write,
528
- stdinContents,
529
- stdinResolveDir,
530
- absWorkingDir,
531
- nodePaths,
532
- mangleCache: validateMangleCache(mangleCache)
533
- };
534
- }
535
- function flagsForTransformOptions(callName, options, isTTY2, logLevelDefault) {
536
- let flags = [];
537
- let keys = /* @__PURE__ */ Object.create(null);
538
- pushLogFlags(flags, options, keys, isTTY2, logLevelDefault);
539
- pushCommonFlags(flags, options, keys);
540
- let sourcemap = getFlag(options, keys, "sourcemap", mustBeStringOrBoolean);
541
- let sourcefile = getFlag(options, keys, "sourcefile", mustBeString);
542
- let loader = getFlag(options, keys, "loader", mustBeString);
543
- let banner = getFlag(options, keys, "banner", mustBeString);
544
- let footer = getFlag(options, keys, "footer", mustBeString);
545
- let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
546
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
547
- if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`);
548
- if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
549
- if (loader) flags.push(`--loader=${loader}`);
550
- if (banner) flags.push(`--banner=${banner}`);
551
- if (footer) flags.push(`--footer=${footer}`);
552
- return {
553
- flags,
554
- mangleCache: validateMangleCache(mangleCache)
555
- };
556
- }
557
- function createChannel(streamIn) {
558
- const requestCallbacksByKey = {};
559
- const closeData = { didClose: false, reason: "" };
560
- let responseCallbacks = {};
561
- let nextRequestID = 0;
562
- let nextBuildKey = 0;
563
- let stdout = new Uint8Array(16 * 1024);
564
- let stdoutUsed = 0;
565
- let readFromStdout = (chunk) => {
566
- let limit = stdoutUsed + chunk.length;
567
- if (limit > stdout.length) {
568
- let swap = new Uint8Array(limit * 2);
569
- swap.set(stdout);
570
- stdout = swap;
571
- }
572
- stdout.set(chunk, stdoutUsed);
573
- stdoutUsed += chunk.length;
574
- let offset = 0;
575
- while (offset + 4 <= stdoutUsed) {
576
- let length = readUInt32LE(stdout, offset);
577
- if (offset + 4 + length > stdoutUsed) {
578
- break;
579
- }
580
- offset += 4;
581
- handleIncomingPacket(stdout.subarray(offset, offset + length));
582
- offset += length;
583
- }
584
- if (offset > 0) {
585
- stdout.copyWithin(0, offset, stdoutUsed);
586
- stdoutUsed -= offset;
587
- }
588
- };
589
- let afterClose = (error) => {
590
- closeData.didClose = true;
591
- if (error) closeData.reason = ": " + (error.message || error);
592
- const text = "The service was stopped" + closeData.reason;
593
- for (let id in responseCallbacks) {
594
- responseCallbacks[id](text, null);
595
- }
596
- responseCallbacks = {};
597
- };
598
- let sendRequest = (refs, value, callback) => {
599
- if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null);
600
- let id = nextRequestID++;
601
- responseCallbacks[id] = (error, response) => {
602
- try {
603
- callback(error, response);
604
- } finally {
605
- if (refs) refs.unref();
606
- }
607
- };
608
- if (refs) refs.ref();
609
- streamIn.writeToStdin(encodePacket({ id, isRequest: true, value }));
610
- };
611
- let sendResponse = (id, value) => {
612
- if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason);
613
- streamIn.writeToStdin(encodePacket({ id, isRequest: false, value }));
614
- };
615
- let handleRequest = async (id, request) => {
616
- try {
617
- if (request.command === "ping") {
618
- sendResponse(id, {});
619
- return;
620
- }
621
- if (typeof request.key === "number") {
622
- const requestCallbacks = requestCallbacksByKey[request.key];
623
- if (!requestCallbacks) {
624
- return;
625
- }
626
- const callback = requestCallbacks[request.command];
627
- if (callback) {
628
- await callback(id, request);
629
- return;
630
- }
631
- }
632
- throw new Error(`Invalid command: ` + request.command);
633
- } catch (e) {
634
- const errors = [extractErrorMessageV8(e, streamIn, null, void 0, "")];
635
- try {
636
- sendResponse(id, { errors });
637
- } catch {
638
- }
639
- }
640
- };
641
- let isFirstPacket = true;
642
- let handleIncomingPacket = (bytes) => {
643
- if (isFirstPacket) {
644
- isFirstPacket = false;
645
- let binaryVersion = String.fromCharCode(...bytes);
646
- if (binaryVersion !== "0.25.12") {
647
- throw new Error(`Cannot start service: Host version "${"0.25.12"}" does not match binary version ${quote(binaryVersion)}`);
648
- }
649
- return;
650
- }
651
- let packet = decodePacket(bytes);
652
- if (packet.isRequest) {
653
- handleRequest(packet.id, packet.value);
654
- } else {
655
- let callback = responseCallbacks[packet.id];
656
- delete responseCallbacks[packet.id];
657
- if (packet.value.error) callback(packet.value.error, {});
658
- else callback(null, packet.value);
659
- }
660
- };
661
- let buildOrContext = ({ callName, refs, options, isTTY: isTTY2, defaultWD: defaultWD2, callback }) => {
662
- let refCount = 0;
663
- const buildKey = nextBuildKey++;
664
- const requestCallbacks = {};
665
- const buildRefs = {
666
- ref() {
667
- if (++refCount === 1) {
668
- if (refs) refs.ref();
669
- }
670
- },
671
- unref() {
672
- if (--refCount === 0) {
673
- delete requestCallbacksByKey[buildKey];
674
- if (refs) refs.unref();
675
- }
676
- }
677
- };
678
- requestCallbacksByKey[buildKey] = requestCallbacks;
679
- buildRefs.ref();
680
- buildOrContextImpl(
681
- callName,
682
- buildKey,
683
- sendRequest,
684
- sendResponse,
685
- buildRefs,
686
- streamIn,
687
- requestCallbacks,
688
- options,
689
- isTTY2,
690
- defaultWD2,
691
- (err, res) => {
692
- try {
693
- callback(err, res);
694
- } finally {
695
- buildRefs.unref();
696
- }
697
- }
698
- );
699
- };
700
- let transform2 = ({ callName, refs, input, options, isTTY: isTTY2, fs: fs3, callback }) => {
701
- const details = createObjectStash();
702
- let start = (inputPath) => {
703
- try {
704
- if (typeof input !== "string" && !(input instanceof Uint8Array))
705
- throw new Error('The input to "transform" must be a string or a Uint8Array');
706
- let {
707
- flags,
708
- mangleCache
709
- } = flagsForTransformOptions(callName, options, isTTY2, transformLogLevelDefault);
710
- let request = {
711
- command: "transform",
712
- flags,
713
- inputFS: inputPath !== null,
714
- input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
715
- };
716
- if (mangleCache) request.mangleCache = mangleCache;
717
- sendRequest(refs, request, (error, response) => {
718
- if (error) return callback(new Error(error), null);
719
- let errors = replaceDetailsInMessages(response.errors, details);
720
- let warnings = replaceDetailsInMessages(response.warnings, details);
721
- let outstanding = 1;
722
- let next = () => {
723
- if (--outstanding === 0) {
724
- let result = {
725
- warnings,
726
- code: response.code,
727
- map: response.map,
728
- mangleCache: void 0,
729
- legalComments: void 0
730
- };
731
- if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments;
732
- if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache;
733
- callback(null, result);
734
- }
735
- };
736
- if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null);
737
- if (response.codeFS) {
738
- outstanding++;
739
- fs3.readFile(response.code, (err, contents) => {
740
- if (err !== null) {
741
- callback(err, null);
742
- } else {
743
- response.code = contents;
744
- next();
745
- }
746
- });
747
- }
748
- if (response.mapFS) {
749
- outstanding++;
750
- fs3.readFile(response.map, (err, contents) => {
751
- if (err !== null) {
752
- callback(err, null);
753
- } else {
754
- response.map = contents;
755
- next();
756
- }
757
- });
758
- }
759
- next();
760
- });
761
- } catch (e) {
762
- let flags = [];
763
- try {
764
- pushLogFlags(flags, options, {}, isTTY2, transformLogLevelDefault);
765
- } catch {
766
- }
767
- const error = extractErrorMessageV8(e, streamIn, details, void 0, "");
768
- sendRequest(refs, { command: "error", flags, error }, () => {
769
- error.detail = details.load(error.detail);
770
- callback(failureErrorWithLog("Transform failed", [error], []), null);
771
- });
772
- }
773
- };
774
- if ((typeof input === "string" || input instanceof Uint8Array) && input.length > 1024 * 1024) {
775
- let next = start;
776
- start = () => fs3.writeFile(input, next);
777
- }
778
- start(null);
779
- };
780
- let formatMessages2 = ({ callName, refs, messages, options, callback }) => {
781
- if (!options) throw new Error(`Missing second argument in ${callName}() call`);
782
- let keys = {};
783
- let kind = getFlag(options, keys, "kind", mustBeString);
784
- let color = getFlag(options, keys, "color", mustBeBoolean);
785
- let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger);
786
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
787
- if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`);
788
- if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
789
- let request = {
790
- command: "format-msgs",
791
- messages: sanitizeMessages(messages, "messages", null, "", terminalWidth),
792
- isWarning: kind === "warning"
793
- };
794
- if (color !== void 0) request.color = color;
795
- if (terminalWidth !== void 0) request.terminalWidth = terminalWidth;
796
- sendRequest(refs, request, (error, response) => {
797
- if (error) return callback(new Error(error), null);
798
- callback(null, response.messages);
799
- });
800
- };
801
- let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => {
802
- if (options === void 0) options = {};
803
- let keys = {};
804
- let color = getFlag(options, keys, "color", mustBeBoolean);
805
- let verbose = getFlag(options, keys, "verbose", mustBeBoolean);
806
- checkForInvalidFlags(options, keys, `in ${callName}() call`);
807
- let request = {
808
- command: "analyze-metafile",
809
- metafile
810
- };
811
- if (color !== void 0) request.color = color;
812
- if (verbose !== void 0) request.verbose = verbose;
813
- sendRequest(refs, request, (error, response) => {
814
- if (error) return callback(new Error(error), null);
815
- callback(null, response.result);
816
- });
817
- };
818
- return {
819
- readFromStdout,
820
- afterClose,
821
- service: {
822
- buildOrContext,
823
- transform: transform2,
824
- formatMessages: formatMessages2,
825
- analyzeMetafile: analyzeMetafile2
826
- }
827
- };
828
- }
829
- function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, options, isTTY2, defaultWD2, callback) {
830
- const details = createObjectStash();
831
- const isContext = callName === "context";
832
- const handleError = (e, pluginName) => {
833
- const flags = [];
834
- try {
835
- pushLogFlags(flags, options, {}, isTTY2, buildLogLevelDefault);
836
- } catch {
837
- }
838
- const message = extractErrorMessageV8(e, streamIn, details, void 0, pluginName);
839
- sendRequest(refs, { command: "error", flags, error: message }, () => {
840
- message.detail = details.load(message.detail);
841
- callback(failureErrorWithLog(isContext ? "Context failed" : "Build failed", [message], []), null);
842
- });
843
- };
844
- let plugins;
845
- if (typeof options === "object") {
846
- const value = options.plugins;
847
- if (value !== void 0) {
848
- if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), "");
849
- plugins = value;
850
- }
851
- }
852
- if (plugins && plugins.length > 0) {
853
- if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
854
- handlePlugins(
855
- buildKey,
856
- sendRequest,
857
- sendResponse,
858
- refs,
859
- streamIn,
860
- requestCallbacks,
861
- options,
862
- plugins,
863
- details
864
- ).then(
865
- (result) => {
866
- if (!result.ok) return handleError(result.error, result.pluginName);
867
- try {
868
- buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks);
869
- } catch (e) {
870
- handleError(e, "");
871
- }
872
- },
873
- (e) => handleError(e, "")
874
- );
875
- return;
876
- }
877
- try {
878
- buildOrContextContinue(null, (result, done) => done([], []), () => {
879
- });
880
- } catch (e) {
881
- handleError(e, "");
882
- }
883
- function buildOrContextContinue(requestPlugins, runOnEndCallbacks, scheduleOnDisposeCallbacks) {
884
- const writeDefault = streamIn.hasFS;
885
- const {
886
- entries,
887
- flags,
888
- write,
889
- stdinContents,
890
- stdinResolveDir,
891
- absWorkingDir,
892
- nodePaths,
893
- mangleCache
894
- } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault);
895
- if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`);
896
- const request = {
897
- command: "build",
898
- key: buildKey,
899
- entries,
900
- flags,
901
- write,
902
- stdinContents,
903
- stdinResolveDir,
904
- absWorkingDir: absWorkingDir || defaultWD2,
905
- nodePaths,
906
- context: isContext
907
- };
908
- if (requestPlugins) request.plugins = requestPlugins;
909
- if (mangleCache) request.mangleCache = mangleCache;
910
- const buildResponseToResult = (response, callback2) => {
911
- const result = {
912
- errors: replaceDetailsInMessages(response.errors, details),
913
- warnings: replaceDetailsInMessages(response.warnings, details),
914
- outputFiles: void 0,
915
- metafile: void 0,
916
- mangleCache: void 0
917
- };
918
- const originalErrors = result.errors.slice();
919
- const originalWarnings = result.warnings.slice();
920
- if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles);
921
- if (response.metafile) result.metafile = JSON.parse(response.metafile);
922
- if (response.mangleCache) result.mangleCache = response.mangleCache;
923
- if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, ""));
924
- runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => {
925
- if (originalErrors.length > 0 || onEndErrors.length > 0) {
926
- const error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings));
927
- return callback2(error, null, onEndErrors, onEndWarnings);
928
- }
929
- callback2(null, result, onEndErrors, onEndWarnings);
930
- });
931
- };
932
- let latestResultPromise;
933
- let provideLatestResult;
934
- if (isContext)
935
- requestCallbacks["on-end"] = (id, request2) => new Promise((resolve) => {
936
- buildResponseToResult(request2, (err, result, onEndErrors, onEndWarnings) => {
937
- const response = {
938
- errors: onEndErrors,
939
- warnings: onEndWarnings
940
- };
941
- if (provideLatestResult) provideLatestResult(err, result);
942
- latestResultPromise = void 0;
943
- provideLatestResult = void 0;
944
- sendResponse(id, response);
945
- resolve();
946
- });
947
- });
948
- sendRequest(refs, request, (error, response) => {
949
- if (error) return callback(new Error(error), null);
950
- if (!isContext) {
951
- return buildResponseToResult(response, (err, res) => {
952
- scheduleOnDisposeCallbacks();
953
- return callback(err, res);
954
- });
955
- }
956
- if (response.errors.length > 0) {
957
- return callback(failureErrorWithLog("Context failed", response.errors, response.warnings), null);
958
- }
959
- let didDispose = false;
960
- const result = {
961
- rebuild: () => {
962
- if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => {
963
- let settlePromise;
964
- provideLatestResult = (err, result2) => {
965
- if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2);
966
- };
967
- const triggerAnotherBuild = () => {
968
- const request2 = {
969
- command: "rebuild",
970
- key: buildKey
971
- };
972
- sendRequest(refs, request2, (error2, response2) => {
973
- if (error2) {
974
- reject(new Error(error2));
975
- } else if (settlePromise) {
976
- settlePromise();
977
- } else {
978
- triggerAnotherBuild();
979
- }
980
- });
981
- };
982
- triggerAnotherBuild();
983
- });
984
- return latestResultPromise;
985
- },
986
- watch: (options2 = {}) => new Promise((resolve, reject) => {
987
- if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
988
- const keys = {};
989
- const delay = getFlag(options2, keys, "delay", mustBeInteger);
990
- checkForInvalidFlags(options2, keys, `in watch() call`);
991
- const request2 = {
992
- command: "watch",
993
- key: buildKey
994
- };
995
- if (delay) request2.delay = delay;
996
- sendRequest(refs, request2, (error2) => {
997
- if (error2) reject(new Error(error2));
998
- else resolve(void 0);
999
- });
1000
- }),
1001
- serve: (options2 = {}) => new Promise((resolve, reject) => {
1002
- if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
1003
- const keys = {};
1004
- const port = getFlag(options2, keys, "port", mustBeValidPortNumber);
1005
- const host = getFlag(options2, keys, "host", mustBeString);
1006
- const servedir = getFlag(options2, keys, "servedir", mustBeString);
1007
- const keyfile = getFlag(options2, keys, "keyfile", mustBeString);
1008
- const certfile = getFlag(options2, keys, "certfile", mustBeString);
1009
- const fallback = getFlag(options2, keys, "fallback", mustBeString);
1010
- const cors = getFlag(options2, keys, "cors", mustBeObject);
1011
- const onRequest = getFlag(options2, keys, "onRequest", mustBeFunction);
1012
- checkForInvalidFlags(options2, keys, `in serve() call`);
1013
- const request2 = {
1014
- command: "serve",
1015
- key: buildKey,
1016
- onRequest: !!onRequest
1017
- };
1018
- if (port !== void 0) request2.port = port;
1019
- if (host !== void 0) request2.host = host;
1020
- if (servedir !== void 0) request2.servedir = servedir;
1021
- if (keyfile !== void 0) request2.keyfile = keyfile;
1022
- if (certfile !== void 0) request2.certfile = certfile;
1023
- if (fallback !== void 0) request2.fallback = fallback;
1024
- if (cors) {
1025
- const corsKeys = {};
1026
- const origin = getFlag(cors, corsKeys, "origin", mustBeStringOrArrayOfStrings);
1027
- checkForInvalidFlags(cors, corsKeys, `on "cors" object`);
1028
- if (Array.isArray(origin)) request2.corsOrigin = origin;
1029
- else if (origin !== void 0) request2.corsOrigin = [origin];
1030
- }
1031
- sendRequest(refs, request2, (error2, response2) => {
1032
- if (error2) return reject(new Error(error2));
1033
- if (onRequest) {
1034
- requestCallbacks["serve-request"] = (id, request3) => {
1035
- onRequest(request3.args);
1036
- sendResponse(id, {});
1037
- };
1038
- }
1039
- resolve(response2);
1040
- });
1041
- }),
1042
- cancel: () => new Promise((resolve) => {
1043
- if (didDispose) return resolve();
1044
- const request2 = {
1045
- command: "cancel",
1046
- key: buildKey
1047
- };
1048
- sendRequest(refs, request2, () => {
1049
- resolve();
1050
- });
1051
- }),
1052
- dispose: () => new Promise((resolve) => {
1053
- if (didDispose) return resolve();
1054
- didDispose = true;
1055
- const request2 = {
1056
- command: "dispose",
1057
- key: buildKey
1058
- };
1059
- sendRequest(refs, request2, () => {
1060
- resolve();
1061
- scheduleOnDisposeCallbacks();
1062
- refs.unref();
1063
- });
1064
- })
1065
- };
1066
- refs.ref();
1067
- callback(null, result);
1068
- });
1069
- }
1070
- }
1071
- var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn, requestCallbacks, initialOptions, plugins, details) => {
1072
- let onStartCallbacks = [];
1073
- let onEndCallbacks = [];
1074
- let onResolveCallbacks = {};
1075
- let onLoadCallbacks = {};
1076
- let onDisposeCallbacks = [];
1077
- let nextCallbackID = 0;
1078
- let i = 0;
1079
- let requestPlugins = [];
1080
- let isSetupDone = false;
1081
- plugins = [...plugins];
1082
- for (let item of plugins) {
1083
- let keys = {};
1084
- if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`);
1085
- const name = getFlag(item, keys, "name", mustBeString);
1086
- if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`);
1087
- try {
1088
- let setup = getFlag(item, keys, "setup", mustBeFunction);
1089
- if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
1090
- checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
1091
- let plugin = {
1092
- name,
1093
- onStart: false,
1094
- onEnd: false,
1095
- onResolve: [],
1096
- onLoad: []
1097
- };
1098
- i++;
1099
- let resolve = (path3, options = {}) => {
1100
- if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
1101
- if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
1102
- let keys2 = /* @__PURE__ */ Object.create(null);
1103
- let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
1104
- let importer = getFlag(options, keys2, "importer", mustBeString);
1105
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
1106
- let resolveDir = getFlag(options, keys2, "resolveDir", mustBeString);
1107
- let kind = getFlag(options, keys2, "kind", mustBeString);
1108
- let pluginData = getFlag(options, keys2, "pluginData", canBeAnything);
1109
- let importAttributes = getFlag(options, keys2, "with", mustBeObject);
1110
- checkForInvalidFlags(options, keys2, "in resolve() call");
1111
- return new Promise((resolve2, reject) => {
1112
- const request = {
1113
- command: "resolve",
1114
- path: path3,
1115
- key: buildKey,
1116
- pluginName: name
1117
- };
1118
- if (pluginName != null) request.pluginName = pluginName;
1119
- if (importer != null) request.importer = importer;
1120
- if (namespace != null) request.namespace = namespace;
1121
- if (resolveDir != null) request.resolveDir = resolveDir;
1122
- if (kind != null) request.kind = kind;
1123
- else throw new Error(`Must specify "kind" when calling "resolve"`);
1124
- if (pluginData != null) request.pluginData = details.store(pluginData);
1125
- if (importAttributes != null) request.with = sanitizeStringMap(importAttributes, "with");
1126
- sendRequest(refs, request, (error, response) => {
1127
- if (error !== null) reject(new Error(error));
1128
- else resolve2({
1129
- errors: replaceDetailsInMessages(response.errors, details),
1130
- warnings: replaceDetailsInMessages(response.warnings, details),
1131
- path: response.path,
1132
- external: response.external,
1133
- sideEffects: response.sideEffects,
1134
- namespace: response.namespace,
1135
- suffix: response.suffix,
1136
- pluginData: details.load(response.pluginData)
1137
- });
1138
- });
1139
- });
1140
- };
1141
- let promise = setup({
1142
- initialOptions,
1143
- resolve,
1144
- onStart(callback) {
1145
- let registeredText = `This error came from the "onStart" callback registered here:`;
1146
- let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
1147
- onStartCallbacks.push({ name, callback, note: registeredNote });
1148
- plugin.onStart = true;
1149
- },
1150
- onEnd(callback) {
1151
- let registeredText = `This error came from the "onEnd" callback registered here:`;
1152
- let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
1153
- onEndCallbacks.push({ name, callback, note: registeredNote });
1154
- plugin.onEnd = true;
1155
- },
1156
- onResolve(options, callback) {
1157
- let registeredText = `This error came from the "onResolve" callback registered here:`;
1158
- let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onResolve");
1159
- let keys2 = {};
1160
- let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1161
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
1162
- checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`);
1163
- if (filter == null) throw new Error(`onResolve() call is missing a filter`);
1164
- let id = nextCallbackID++;
1165
- onResolveCallbacks[id] = { name, callback, note: registeredNote };
1166
- plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1167
- },
1168
- onLoad(options, callback) {
1169
- let registeredText = `This error came from the "onLoad" callback registered here:`;
1170
- let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onLoad");
1171
- let keys2 = {};
1172
- let filter = getFlag(options, keys2, "filter", mustBeRegExp);
1173
- let namespace = getFlag(options, keys2, "namespace", mustBeString);
1174
- checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`);
1175
- if (filter == null) throw new Error(`onLoad() call is missing a filter`);
1176
- let id = nextCallbackID++;
1177
- onLoadCallbacks[id] = { name, callback, note: registeredNote };
1178
- plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1179
- },
1180
- onDispose(callback) {
1181
- onDisposeCallbacks.push(callback);
1182
- },
1183
- esbuild: streamIn.esbuild
1184
- });
1185
- if (promise) await promise;
1186
- requestPlugins.push(plugin);
1187
- } catch (e) {
1188
- return { ok: false, error: e, pluginName: name };
1189
- }
1190
- }
1191
- requestCallbacks["on-start"] = async (id, request) => {
1192
- details.clear();
1193
- let response = { errors: [], warnings: [] };
1194
- await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
1195
- try {
1196
- let result = await callback();
1197
- if (result != null) {
1198
- if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`);
1199
- let keys = {};
1200
- let errors = getFlag(result, keys, "errors", mustBeArray);
1201
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1202
- checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`);
1203
- if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0));
1204
- if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
1205
- }
1206
- } catch (e) {
1207
- response.errors.push(extractErrorMessageV8(e, streamIn, details, note && note(), name));
1208
- }
1209
- }));
1210
- sendResponse(id, response);
1211
- };
1212
- requestCallbacks["on-resolve"] = async (id, request) => {
1213
- let response = {}, name = "", callback, note;
1214
- for (let id2 of request.ids) {
1215
- try {
1216
- ({ name, callback, note } = onResolveCallbacks[id2]);
1217
- let result = await callback({
1218
- path: request.path,
1219
- importer: request.importer,
1220
- namespace: request.namespace,
1221
- resolveDir: request.resolveDir,
1222
- kind: request.kind,
1223
- pluginData: details.load(request.pluginData),
1224
- with: request.with
1225
- });
1226
- if (result != null) {
1227
- if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`);
1228
- let keys = {};
1229
- let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1230
- let path3 = getFlag(result, keys, "path", mustBeString);
1231
- let namespace = getFlag(result, keys, "namespace", mustBeString);
1232
- let suffix = getFlag(result, keys, "suffix", mustBeString);
1233
- let external = getFlag(result, keys, "external", mustBeBoolean);
1234
- let sideEffects = getFlag(result, keys, "sideEffects", mustBeBoolean);
1235
- let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1236
- let errors = getFlag(result, keys, "errors", mustBeArray);
1237
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1238
- let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1239
- let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1240
- checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`);
1241
- response.id = id2;
1242
- if (pluginName != null) response.pluginName = pluginName;
1243
- if (path3 != null) response.path = path3;
1244
- if (namespace != null) response.namespace = namespace;
1245
- if (suffix != null) response.suffix = suffix;
1246
- if (external != null) response.external = external;
1247
- if (sideEffects != null) response.sideEffects = sideEffects;
1248
- if (pluginData != null) response.pluginData = details.store(pluginData);
1249
- if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1250
- if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1251
- if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1252
- if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1253
- break;
1254
- }
1255
- } catch (e) {
1256
- response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
1257
- break;
1258
- }
1259
- }
1260
- sendResponse(id, response);
1261
- };
1262
- requestCallbacks["on-load"] = async (id, request) => {
1263
- let response = {}, name = "", callback, note;
1264
- for (let id2 of request.ids) {
1265
- try {
1266
- ({ name, callback, note } = onLoadCallbacks[id2]);
1267
- let result = await callback({
1268
- path: request.path,
1269
- namespace: request.namespace,
1270
- suffix: request.suffix,
1271
- pluginData: details.load(request.pluginData),
1272
- with: request.with
1273
- });
1274
- if (result != null) {
1275
- if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`);
1276
- let keys = {};
1277
- let pluginName = getFlag(result, keys, "pluginName", mustBeString);
1278
- let contents = getFlag(result, keys, "contents", mustBeStringOrUint8Array);
1279
- let resolveDir = getFlag(result, keys, "resolveDir", mustBeString);
1280
- let pluginData = getFlag(result, keys, "pluginData", canBeAnything);
1281
- let loader = getFlag(result, keys, "loader", mustBeString);
1282
- let errors = getFlag(result, keys, "errors", mustBeArray);
1283
- let warnings = getFlag(result, keys, "warnings", mustBeArray);
1284
- let watchFiles = getFlag(result, keys, "watchFiles", mustBeArrayOfStrings);
1285
- let watchDirs = getFlag(result, keys, "watchDirs", mustBeArrayOfStrings);
1286
- checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`);
1287
- response.id = id2;
1288
- if (pluginName != null) response.pluginName = pluginName;
1289
- if (contents instanceof Uint8Array) response.contents = contents;
1290
- else if (contents != null) response.contents = encodeUTF8(contents);
1291
- if (resolveDir != null) response.resolveDir = resolveDir;
1292
- if (pluginData != null) response.pluginData = details.store(pluginData);
1293
- if (loader != null) response.loader = loader;
1294
- if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
1295
- if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1296
- if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
1297
- if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
1298
- break;
1299
- }
1300
- } catch (e) {
1301
- response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note && note(), name)] };
1302
- break;
1303
- }
1304
- }
1305
- sendResponse(id, response);
1306
- };
1307
- let runOnEndCallbacks = (result, done) => done([], []);
1308
- if (onEndCallbacks.length > 0) {
1309
- runOnEndCallbacks = (result, done) => {
1310
- (async () => {
1311
- const onEndErrors = [];
1312
- const onEndWarnings = [];
1313
- for (const { name, callback, note } of onEndCallbacks) {
1314
- let newErrors;
1315
- let newWarnings;
1316
- try {
1317
- const value = await callback(result);
1318
- if (value != null) {
1319
- if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`);
1320
- let keys = {};
1321
- let errors = getFlag(value, keys, "errors", mustBeArray);
1322
- let warnings = getFlag(value, keys, "warnings", mustBeArray);
1323
- checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`);
1324
- if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0);
1325
- if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
1326
- }
1327
- } catch (e) {
1328
- newErrors = [extractErrorMessageV8(e, streamIn, details, note && note(), name)];
1329
- }
1330
- if (newErrors) {
1331
- onEndErrors.push(...newErrors);
1332
- try {
1333
- result.errors.push(...newErrors);
1334
- } catch {
1335
- }
1336
- }
1337
- if (newWarnings) {
1338
- onEndWarnings.push(...newWarnings);
1339
- try {
1340
- result.warnings.push(...newWarnings);
1341
- } catch {
1342
- }
1343
- }
1344
- }
1345
- done(onEndErrors, onEndWarnings);
1346
- })();
1347
- };
1348
- }
1349
- let scheduleOnDisposeCallbacks = () => {
1350
- for (const cb of onDisposeCallbacks) {
1351
- setTimeout(() => cb(), 0);
1352
- }
1353
- };
1354
- isSetupDone = true;
1355
- return {
1356
- ok: true,
1357
- requestPlugins,
1358
- runOnEndCallbacks,
1359
- scheduleOnDisposeCallbacks
1360
- };
1361
- };
1362
- function createObjectStash() {
1363
- const map = /* @__PURE__ */ new Map();
1364
- let nextID = 0;
1365
- return {
1366
- clear() {
1367
- map.clear();
1368
- },
1369
- load(id) {
1370
- return map.get(id);
1371
- },
1372
- store(value) {
1373
- if (value === void 0) return -1;
1374
- const id = nextID++;
1375
- map.set(id, value);
1376
- return id;
1377
- }
1378
- };
1379
- }
1380
- function extractCallerV8(e, streamIn, ident) {
1381
- let note;
1382
- let tried = false;
1383
- return () => {
1384
- if (tried) return note;
1385
- tried = true;
1386
- try {
1387
- let lines = (e.stack + "").split("\n");
1388
- lines.splice(1, 1);
1389
- let location = parseStackLinesV8(streamIn, lines, ident);
1390
- if (location) {
1391
- note = { text: e.message, location };
1392
- return note;
1393
- }
1394
- } catch {
1395
- }
1396
- };
1397
- }
1398
- function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
1399
- let text = "Internal error";
1400
- let location = null;
1401
- try {
1402
- text = (e && e.message || e) + "";
1403
- } catch {
1404
- }
1405
- try {
1406
- location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
1407
- } catch {
1408
- }
1409
- return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
1410
- }
1411
- function parseStackLinesV8(streamIn, lines, ident) {
1412
- let at = " at ";
1413
- if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) {
1414
- for (let i = 1; i < lines.length; i++) {
1415
- let line = lines[i];
1416
- if (!line.startsWith(at)) continue;
1417
- line = line.slice(at.length);
1418
- while (true) {
1419
- let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line);
1420
- if (match) {
1421
- line = match[1];
1422
- continue;
1423
- }
1424
- match = /^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(line);
1425
- if (match) {
1426
- line = match[1];
1427
- continue;
1428
- }
1429
- match = /^(\S+):(\d+):(\d+)$/.exec(line);
1430
- if (match) {
1431
- let contents;
1432
- try {
1433
- contents = streamIn.readFileSync(match[1], "utf8");
1434
- } catch {
1435
- break;
1436
- }
1437
- let lineText = contents.split(/\r\n|\r|\n|\u2028|\u2029/)[+match[2] - 1] || "";
1438
- let column = +match[3] - 1;
1439
- let length = lineText.slice(column, column + ident.length) === ident ? ident.length : 0;
1440
- return {
1441
- file: match[1],
1442
- namespace: "file",
1443
- line: +match[2],
1444
- column: encodeUTF8(lineText.slice(0, column)).length,
1445
- length: encodeUTF8(lineText.slice(column, column + length)).length,
1446
- lineText: lineText + "\n" + lines.slice(1).join("\n"),
1447
- suggestion: ""
1448
- };
1449
- }
1450
- break;
1451
- }
1452
- }
1453
- }
1454
- return null;
1455
- }
1456
- function failureErrorWithLog(text, errors, warnings) {
1457
- let limit = 5;
1458
- text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
1459
- if (i === limit) return "\n...";
1460
- if (!e.location) return `
1461
- error: ${e.text}`;
1462
- let { file, line, column } = e.location;
1463
- let pluginText = e.pluginName ? `[plugin: ${e.pluginName}] ` : "";
1464
- return `
1465
- ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
1466
- }).join("");
1467
- let error = new Error(text);
1468
- for (const [key, value] of [["errors", errors], ["warnings", warnings]]) {
1469
- Object.defineProperty(error, key, {
1470
- configurable: true,
1471
- enumerable: true,
1472
- get: () => value,
1473
- set: (value2) => Object.defineProperty(error, key, {
1474
- configurable: true,
1475
- enumerable: true,
1476
- value: value2
1477
- })
1478
- });
1479
- }
1480
- return error;
1481
- }
1482
- function replaceDetailsInMessages(messages, stash) {
1483
- for (const message of messages) {
1484
- message.detail = stash.load(message.detail);
1485
- }
1486
- return messages;
1487
- }
1488
- function sanitizeLocation(location, where, terminalWidth) {
1489
- if (location == null) return null;
1490
- let keys = {};
1491
- let file = getFlag(location, keys, "file", mustBeString);
1492
- let namespace = getFlag(location, keys, "namespace", mustBeString);
1493
- let line = getFlag(location, keys, "line", mustBeInteger);
1494
- let column = getFlag(location, keys, "column", mustBeInteger);
1495
- let length = getFlag(location, keys, "length", mustBeInteger);
1496
- let lineText = getFlag(location, keys, "lineText", mustBeString);
1497
- let suggestion = getFlag(location, keys, "suggestion", mustBeString);
1498
- checkForInvalidFlags(location, keys, where);
1499
- if (lineText) {
1500
- const relevantASCII = lineText.slice(
1501
- 0,
1502
- (column && column > 0 ? column : 0) + (length && length > 0 ? length : 0) + (terminalWidth && terminalWidth > 0 ? terminalWidth : 80)
1503
- );
1504
- if (!/[\x7F-\uFFFF]/.test(relevantASCII) && !/\n/.test(lineText)) {
1505
- lineText = relevantASCII;
1506
- }
1507
- }
1508
- return {
1509
- file: file || "",
1510
- namespace: namespace || "",
1511
- line: line || 0,
1512
- column: column || 0,
1513
- length: length || 0,
1514
- lineText: lineText || "",
1515
- suggestion: suggestion || ""
1516
- };
1517
- }
1518
- function sanitizeMessages(messages, property, stash, fallbackPluginName, terminalWidth) {
1519
- let messagesClone = [];
1520
- let index = 0;
1521
- for (const message of messages) {
1522
- let keys = {};
1523
- let id = getFlag(message, keys, "id", mustBeString);
1524
- let pluginName = getFlag(message, keys, "pluginName", mustBeString);
1525
- let text = getFlag(message, keys, "text", mustBeString);
1526
- let location = getFlag(message, keys, "location", mustBeObjectOrNull);
1527
- let notes = getFlag(message, keys, "notes", mustBeArray);
1528
- let detail = getFlag(message, keys, "detail", canBeAnything);
1529
- let where = `in element ${index} of "${property}"`;
1530
- checkForInvalidFlags(message, keys, where);
1531
- let notesClone = [];
1532
- if (notes) {
1533
- for (const note of notes) {
1534
- let noteKeys = {};
1535
- let noteText = getFlag(note, noteKeys, "text", mustBeString);
1536
- let noteLocation = getFlag(note, noteKeys, "location", mustBeObjectOrNull);
1537
- checkForInvalidFlags(note, noteKeys, where);
1538
- notesClone.push({
1539
- text: noteText || "",
1540
- location: sanitizeLocation(noteLocation, where, terminalWidth)
1541
- });
1542
- }
1543
- }
1544
- messagesClone.push({
1545
- id: id || "",
1546
- pluginName: pluginName || fallbackPluginName,
1547
- text: text || "",
1548
- location: sanitizeLocation(location, where, terminalWidth),
1549
- notes: notesClone,
1550
- detail: stash ? stash.store(detail) : -1
1551
- });
1552
- index++;
1553
- }
1554
- return messagesClone;
1555
- }
1556
- function sanitizeStringArray(values, property) {
1557
- const result = [];
1558
- for (const value of values) {
1559
- if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`);
1560
- result.push(value);
1561
- }
1562
- return result;
1563
- }
1564
- function sanitizeStringMap(map, property) {
1565
- const result = /* @__PURE__ */ Object.create(null);
1566
- for (const key in map) {
1567
- const value = map[key];
1568
- if (typeof value !== "string") throw new Error(`key ${quote(key)} in object ${quote(property)} must be a string`);
1569
- result[key] = value;
1570
- }
1571
- return result;
1572
- }
1573
- function convertOutputFiles({ path: path3, contents, hash }) {
1574
- let text = null;
1575
- return {
1576
- path: path3,
1577
- contents,
1578
- hash,
1579
- get text() {
1580
- const binary = this.contents;
1581
- if (text === null || binary !== contents) {
1582
- contents = binary;
1583
- text = decodeUTF8(binary);
1584
- }
1585
- return text;
1586
- }
1587
- };
1588
- }
1589
- function jsRegExpToGoRegExp(regexp) {
1590
- let result = regexp.source;
1591
- if (regexp.flags) result = `(?${regexp.flags})${result}`;
1592
- return result;
1593
- }
1594
-
1595
- // lib/npm/node-platform.ts
1596
- var fs = require("fs");
1597
- var os = require("os");
1598
- var path = require("path");
1599
- var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
1600
- var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
1601
- var packageDarwin_arm64 = "@esbuild/darwin-arm64";
1602
- var packageDarwin_x64 = "@esbuild/darwin-x64";
1603
- var knownWindowsPackages = {
1604
- "win32 arm64 LE": "@esbuild/win32-arm64",
1605
- "win32 ia32 LE": "@esbuild/win32-ia32",
1606
- "win32 x64 LE": "@esbuild/win32-x64"
1607
- };
1608
- var knownUnixlikePackages = {
1609
- "aix ppc64 BE": "@esbuild/aix-ppc64",
1610
- "android arm64 LE": "@esbuild/android-arm64",
1611
- "darwin arm64 LE": "@esbuild/darwin-arm64",
1612
- "darwin x64 LE": "@esbuild/darwin-x64",
1613
- "freebsd arm64 LE": "@esbuild/freebsd-arm64",
1614
- "freebsd x64 LE": "@esbuild/freebsd-x64",
1615
- "linux arm LE": "@esbuild/linux-arm",
1616
- "linux arm64 LE": "@esbuild/linux-arm64",
1617
- "linux ia32 LE": "@esbuild/linux-ia32",
1618
- "linux mips64el LE": "@esbuild/linux-mips64el",
1619
- "linux ppc64 LE": "@esbuild/linux-ppc64",
1620
- "linux riscv64 LE": "@esbuild/linux-riscv64",
1621
- "linux s390x BE": "@esbuild/linux-s390x",
1622
- "linux x64 LE": "@esbuild/linux-x64",
1623
- "linux loong64 LE": "@esbuild/linux-loong64",
1624
- "netbsd arm64 LE": "@esbuild/netbsd-arm64",
1625
- "netbsd x64 LE": "@esbuild/netbsd-x64",
1626
- "openbsd arm64 LE": "@esbuild/openbsd-arm64",
1627
- "openbsd x64 LE": "@esbuild/openbsd-x64",
1628
- "sunos x64 LE": "@esbuild/sunos-x64"
1629
- };
1630
- var knownWebAssemblyFallbackPackages = {
1631
- "android arm LE": "@esbuild/android-arm",
1632
- "android x64 LE": "@esbuild/android-x64",
1633
- "openharmony arm64 LE": "@esbuild/openharmony-arm64"
1634
- };
1635
- function pkgAndSubpathForCurrentPlatform() {
1636
- let pkg;
1637
- let subpath;
1638
- let isWASM = false;
1639
- let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`;
1640
- if (platformKey in knownWindowsPackages) {
1641
- pkg = knownWindowsPackages[platformKey];
1642
- subpath = "esbuild.exe";
1643
- } else if (platformKey in knownUnixlikePackages) {
1644
- pkg = knownUnixlikePackages[platformKey];
1645
- subpath = "bin/esbuild";
1646
- } else if (platformKey in knownWebAssemblyFallbackPackages) {
1647
- pkg = knownWebAssemblyFallbackPackages[platformKey];
1648
- subpath = "bin/esbuild";
1649
- isWASM = true;
1650
- } else {
1651
- throw new Error(`Unsupported platform: ${platformKey}`);
1652
- }
1653
- return { pkg, subpath, isWASM };
1654
- }
1655
- function pkgForSomeOtherPlatform() {
1656
- const libMainJS = require.resolve("esbuild");
1657
- const nodeModulesDirectory = path.dirname(path.dirname(path.dirname(libMainJS)));
1658
- if (path.basename(nodeModulesDirectory) === "node_modules") {
1659
- for (const unixKey in knownUnixlikePackages) {
1660
- try {
1661
- const pkg = knownUnixlikePackages[unixKey];
1662
- if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1663
- } catch {
1664
- }
1665
- }
1666
- for (const windowsKey in knownWindowsPackages) {
1667
- try {
1668
- const pkg = knownWindowsPackages[windowsKey];
1669
- if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
1670
- } catch {
1671
- }
1672
- }
1673
- }
1674
- return null;
1675
- }
1676
- function downloadedBinPath(pkg, subpath) {
1677
- const esbuildLibDir = path.dirname(require.resolve("esbuild"));
1678
- return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
1679
- }
1680
- function generateBinPath() {
1681
- if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
1682
- if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
1683
- console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
1684
- } else {
1685
- return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
1686
- }
1687
- }
1688
- const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform();
1689
- let binPath;
1690
- try {
1691
- binPath = require.resolve(`${pkg}/${subpath}`);
1692
- } catch (e) {
1693
- binPath = downloadedBinPath(pkg, subpath);
1694
- if (!fs.existsSync(binPath)) {
1695
- try {
1696
- require.resolve(pkg);
1697
- } catch {
1698
- const otherPkg = pkgForSomeOtherPlatform();
1699
- if (otherPkg) {
1700
- let suggestions = `
1701
- Specifically the "${otherPkg}" package is present but this platform
1702
- needs the "${pkg}" package instead. People often get into this
1703
- situation by installing esbuild on Windows or macOS and copying "node_modules"
1704
- into a Docker image that runs Linux, or by copying "node_modules" between
1705
- Windows and WSL environments.
1706
-
1707
- If you are installing with npm, you can try not copying the "node_modules"
1708
- directory when you copy the files over, and running "npm ci" or "npm install"
1709
- on the destination platform after the copy. Or you could consider using yarn
1710
- instead of npm which has built-in support for installing a package on multiple
1711
- platforms simultaneously.
1712
-
1713
- If you are installing with yarn, you can try listing both this platform and the
1714
- other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
1715
- feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
1716
- Keep in mind that this means multiple copies of esbuild will be present.
1717
- `;
1718
- if (pkg === packageDarwin_x64 && otherPkg === packageDarwin_arm64 || pkg === packageDarwin_arm64 && otherPkg === packageDarwin_x64) {
1719
- suggestions = `
1720
- Specifically the "${otherPkg}" package is present but this platform
1721
- needs the "${pkg}" package instead. People often get into this
1722
- situation by installing esbuild with npm running inside of Rosetta 2 and then
1723
- trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
1724
- 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
1725
-
1726
- If you are installing with npm, you can try ensuring that both npm and node are
1727
- not running under Rosetta 2 and then reinstalling esbuild. This likely involves
1728
- changing how you installed npm and/or node. For example, installing node with
1729
- the universal installer here should work: https://nodejs.org/en/download/. Or
1730
- you could consider using yarn instead of npm which has built-in support for
1731
- installing a package on multiple platforms simultaneously.
1732
-
1733
- If you are installing with yarn, you can try listing both "arm64" and "x64"
1734
- in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
1735
- https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
1736
- Keep in mind that this means multiple copies of esbuild will be present.
1737
- `;
1738
- }
1739
- throw new Error(`
1740
- You installed esbuild for another platform than the one you're currently using.
1741
- This won't work because esbuild is written with native code and needs to
1742
- install a platform-specific binary executable.
1743
- ${suggestions}
1744
- Another alternative is to use the "esbuild-wasm" package instead, which works
1745
- the same way on all platforms. But it comes with a heavy performance cost and
1746
- can sometimes be 10x slower than the "esbuild" package, so you may also not
1747
- want to do that.
1748
- `);
1749
- }
1750
- throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
1751
-
1752
- If you are installing esbuild with npm, make sure that you don't specify the
1753
- "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
1754
- of "package.json" is used by esbuild to install the correct binary executable
1755
- for your current platform.`);
1756
- }
1757
- throw e;
1758
- }
1759
- }
1760
- if (/\.zip\//.test(binPath)) {
1761
- let pnpapi;
1762
- try {
1763
- pnpapi = require("pnpapi");
1764
- } catch (e) {
1765
- }
1766
- if (pnpapi) {
1767
- const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
1768
- const binTargetPath = path.join(
1769
- root,
1770
- "node_modules",
1771
- ".cache",
1772
- "esbuild",
1773
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.12"}-${path.basename(subpath)}`
1774
- );
1775
- if (!fs.existsSync(binTargetPath)) {
1776
- fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
1777
- fs.copyFileSync(binPath, binTargetPath);
1778
- fs.chmodSync(binTargetPath, 493);
1779
- }
1780
- return { binPath: binTargetPath, isWASM };
1781
- }
1782
- }
1783
- return { binPath, isWASM };
1784
- }
1785
-
1786
- // lib/npm/node.ts
1787
- var child_process = require("child_process");
1788
- var crypto = require("crypto");
1789
- var path2 = require("path");
1790
- var fs2 = require("fs");
1791
- var os2 = require("os");
1792
- var tty = require("tty");
1793
- var worker_threads;
1794
- if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1795
- try {
1796
- worker_threads = require("worker_threads");
1797
- } catch {
1798
- }
1799
- let [major, minor] = process.versions.node.split(".");
1800
- if (
1801
- // <v12.17.0 does not work
1802
- +major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13
1803
- ) {
1804
- worker_threads = void 0;
1805
- }
1806
- }
1807
- var _a;
1808
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.12";
1809
- var esbuildCommandAndArgs = () => {
1810
- if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1811
- throw new Error(
1812
- `The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
1813
-
1814
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`
1815
- );
1816
- }
1817
- if (false) {
1818
- return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
1819
- } else {
1820
- const { binPath, isWASM } = generateBinPath();
1821
- if (isWASM) {
1822
- return ["node", [binPath]];
1823
- } else {
1824
- return [binPath, []];
1825
- }
1826
- }
1827
- };
1828
- var isTTY = () => tty.isatty(2);
1829
- var fsSync = {
1830
- readFile(tempFile, callback) {
1831
- try {
1832
- let contents = fs2.readFileSync(tempFile, "utf8");
1833
- try {
1834
- fs2.unlinkSync(tempFile);
1835
- } catch {
1836
- }
1837
- callback(null, contents);
1838
- } catch (err) {
1839
- callback(err, null);
1840
- }
1841
- },
1842
- writeFile(contents, callback) {
1843
- try {
1844
- let tempFile = randomFileName();
1845
- fs2.writeFileSync(tempFile, contents);
1846
- callback(tempFile);
1847
- } catch {
1848
- callback(null);
1849
- }
1850
- }
1851
- };
1852
- var fsAsync = {
1853
- readFile(tempFile, callback) {
1854
- try {
1855
- fs2.readFile(tempFile, "utf8", (err, contents) => {
1856
- try {
1857
- fs2.unlink(tempFile, () => callback(err, contents));
1858
- } catch {
1859
- callback(err, contents);
1860
- }
1861
- });
1862
- } catch (err) {
1863
- callback(err, null);
1864
- }
1865
- },
1866
- writeFile(contents, callback) {
1867
- try {
1868
- let tempFile = randomFileName();
1869
- fs2.writeFile(tempFile, contents, (err) => err !== null ? callback(null) : callback(tempFile));
1870
- } catch {
1871
- callback(null);
1872
- }
1873
- }
1874
- };
1875
- var version = "0.25.12";
1876
- var build = (options) => ensureServiceIsRunning().build(options);
1877
- var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
1878
- var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
1879
- var formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options);
1880
- var analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options);
1881
- var buildSync = (options) => {
1882
- if (worker_threads && !isInternalWorkerThread) {
1883
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1884
- return workerThreadService.buildSync(options);
1885
- }
1886
- let result;
1887
- runServiceSync((service) => service.buildOrContext({
1888
- callName: "buildSync",
1889
- refs: null,
1890
- options,
1891
- isTTY: isTTY(),
1892
- defaultWD,
1893
- callback: (err, res) => {
1894
- if (err) throw err;
1895
- result = res;
1896
- }
1897
- }));
1898
- return result;
1899
- };
1900
- var transformSync = (input, options) => {
1901
- if (worker_threads && !isInternalWorkerThread) {
1902
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1903
- return workerThreadService.transformSync(input, options);
1904
- }
1905
- let result;
1906
- runServiceSync((service) => service.transform({
1907
- callName: "transformSync",
1908
- refs: null,
1909
- input,
1910
- options: options || {},
1911
- isTTY: isTTY(),
1912
- fs: fsSync,
1913
- callback: (err, res) => {
1914
- if (err) throw err;
1915
- result = res;
1916
- }
1917
- }));
1918
- return result;
1919
- };
1920
- var formatMessagesSync = (messages, options) => {
1921
- if (worker_threads && !isInternalWorkerThread) {
1922
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1923
- return workerThreadService.formatMessagesSync(messages, options);
1924
- }
1925
- let result;
1926
- runServiceSync((service) => service.formatMessages({
1927
- callName: "formatMessagesSync",
1928
- refs: null,
1929
- messages,
1930
- options,
1931
- callback: (err, res) => {
1932
- if (err) throw err;
1933
- result = res;
1934
- }
1935
- }));
1936
- return result;
1937
- };
1938
- var analyzeMetafileSync = (metafile, options) => {
1939
- if (worker_threads && !isInternalWorkerThread) {
1940
- if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
1941
- return workerThreadService.analyzeMetafileSync(metafile, options);
1942
- }
1943
- let result;
1944
- runServiceSync((service) => service.analyzeMetafile({
1945
- callName: "analyzeMetafileSync",
1946
- refs: null,
1947
- metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
1948
- options,
1949
- callback: (err, res) => {
1950
- if (err) throw err;
1951
- result = res;
1952
- }
1953
- }));
1954
- return result;
1955
- };
1956
- var stop = () => {
1957
- if (stopService) stopService();
1958
- if (workerThreadService) workerThreadService.stop();
1959
- return Promise.resolve();
1960
- };
1961
- var initializeWasCalled = false;
1962
- var initialize = (options) => {
1963
- options = validateInitializeOptions(options || {});
1964
- if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`);
1965
- if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`);
1966
- if (options.worker) throw new Error(`The "worker" option only works in the browser`);
1967
- if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once');
1968
- ensureServiceIsRunning();
1969
- initializeWasCalled = true;
1970
- return Promise.resolve();
1971
- };
1972
- var defaultWD = process.cwd();
1973
- var longLivedService;
1974
- var stopService;
1975
- var ensureServiceIsRunning = () => {
1976
- if (longLivedService) return longLivedService;
1977
- let [command, args] = esbuildCommandAndArgs();
1978
- let child = child_process.spawn(command, args.concat(`--service=${"0.25.12"}`, "--ping"), {
1979
- windowsHide: true,
1980
- stdio: ["pipe", "pipe", "inherit"],
1981
- cwd: defaultWD
1982
- });
1983
- let { readFromStdout, afterClose, service } = createChannel({
1984
- writeToStdin(bytes) {
1985
- child.stdin.write(bytes, (err) => {
1986
- if (err) afterClose(err);
1987
- });
1988
- },
1989
- readFileSync: fs2.readFileSync,
1990
- isSync: false,
1991
- hasFS: true,
1992
- esbuild: node_exports
1993
- });
1994
- child.stdin.on("error", afterClose);
1995
- child.on("error", afterClose);
1996
- const stdin = child.stdin;
1997
- const stdout = child.stdout;
1998
- stdout.on("data", readFromStdout);
1999
- stdout.on("end", afterClose);
2000
- stopService = () => {
2001
- stdin.destroy();
2002
- stdout.destroy();
2003
- child.kill();
2004
- initializeWasCalled = false;
2005
- longLivedService = void 0;
2006
- stopService = void 0;
2007
- };
2008
- let refCount = 0;
2009
- child.unref();
2010
- if (stdin.unref) {
2011
- stdin.unref();
2012
- }
2013
- if (stdout.unref) {
2014
- stdout.unref();
2015
- }
2016
- const refs = {
2017
- ref() {
2018
- if (++refCount === 1) child.ref();
2019
- },
2020
- unref() {
2021
- if (--refCount === 0) child.unref();
2022
- }
2023
- };
2024
- longLivedService = {
2025
- build: (options) => new Promise((resolve, reject) => {
2026
- service.buildOrContext({
2027
- callName: "build",
2028
- refs,
2029
- options,
2030
- isTTY: isTTY(),
2031
- defaultWD,
2032
- callback: (err, res) => err ? reject(err) : resolve(res)
2033
- });
2034
- }),
2035
- context: (options) => new Promise((resolve, reject) => service.buildOrContext({
2036
- callName: "context",
2037
- refs,
2038
- options,
2039
- isTTY: isTTY(),
2040
- defaultWD,
2041
- callback: (err, res) => err ? reject(err) : resolve(res)
2042
- })),
2043
- transform: (input, options) => new Promise((resolve, reject) => service.transform({
2044
- callName: "transform",
2045
- refs,
2046
- input,
2047
- options: options || {},
2048
- isTTY: isTTY(),
2049
- fs: fsAsync,
2050
- callback: (err, res) => err ? reject(err) : resolve(res)
2051
- })),
2052
- formatMessages: (messages, options) => new Promise((resolve, reject) => service.formatMessages({
2053
- callName: "formatMessages",
2054
- refs,
2055
- messages,
2056
- options,
2057
- callback: (err, res) => err ? reject(err) : resolve(res)
2058
- })),
2059
- analyzeMetafile: (metafile, options) => new Promise((resolve, reject) => service.analyzeMetafile({
2060
- callName: "analyzeMetafile",
2061
- refs,
2062
- metafile: typeof metafile === "string" ? metafile : JSON.stringify(metafile),
2063
- options,
2064
- callback: (err, res) => err ? reject(err) : resolve(res)
2065
- }))
2066
- };
2067
- return longLivedService;
2068
- };
2069
- var runServiceSync = (callback) => {
2070
- let [command, args] = esbuildCommandAndArgs();
2071
- let stdin = new Uint8Array();
2072
- let { readFromStdout, afterClose, service } = createChannel({
2073
- writeToStdin(bytes) {
2074
- if (stdin.length !== 0) throw new Error("Must run at most one command");
2075
- stdin = bytes;
2076
- },
2077
- isSync: true,
2078
- hasFS: true,
2079
- esbuild: node_exports
2080
- });
2081
- callback(service);
2082
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.12"}`), {
2083
- cwd: defaultWD,
2084
- windowsHide: true,
2085
- input: stdin,
2086
- // We don't know how large the output could be. If it's too large, the
2087
- // command will fail with ENOBUFS. Reserve 16mb for now since that feels
2088
- // like it should be enough. Also allow overriding this with an environment
2089
- // variable.
2090
- maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024
2091
- });
2092
- readFromStdout(stdout);
2093
- afterClose(null);
2094
- };
2095
- var randomFileName = () => {
2096
- return path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`);
2097
- };
2098
- var workerThreadService = null;
2099
- var startWorkerThreadService = (worker_threads2) => {
2100
- let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2101
- let worker = new worker_threads2.Worker(__filename, {
2102
- workerData: { workerPort, defaultWD, esbuildVersion: "0.25.12" },
2103
- transferList: [workerPort],
2104
- // From node's documentation: https://nodejs.org/api/worker_threads.html
2105
- //
2106
- // Take care when launching worker threads from preload scripts (scripts loaded
2107
- // and run using the `-r` command line flag). Unless the `execArgv` option is
2108
- // explicitly set, new Worker threads automatically inherit the command line flags
2109
- // from the running process and will preload the same preload scripts as the main
2110
- // thread. If the preload script unconditionally launches a worker thread, every
2111
- // thread spawned will spawn another until the application crashes.
2112
- //
2113
- execArgv: []
2114
- });
2115
- let nextID = 0;
2116
- let fakeBuildError = (text) => {
2117
- let error = new Error(`Build failed with 1 error:
2118
- error: ${text}`);
2119
- let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
2120
- error.errors = errors;
2121
- error.warnings = [];
2122
- return error;
2123
- };
2124
- let validateBuildSyncOptions = (options) => {
2125
- if (!options) return;
2126
- let plugins = options.plugins;
2127
- if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`);
2128
- };
2129
- let applyProperties = (object, properties) => {
2130
- for (let key in properties) {
2131
- object[key] = properties[key];
2132
- }
2133
- };
2134
- let runCallSync = (command, args) => {
2135
- let id = nextID++;
2136
- let sharedBuffer = new SharedArrayBuffer(8);
2137
- let sharedBufferView = new Int32Array(sharedBuffer);
2138
- let msg = { sharedBuffer, id, command, args };
2139
- worker.postMessage(msg);
2140
- let status = Atomics.wait(sharedBufferView, 0, 0);
2141
- if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
2142
- let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
2143
- if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
2144
- if (reject) {
2145
- applyProperties(reject, properties);
2146
- throw reject;
2147
- }
2148
- return resolve;
2149
- };
2150
- worker.unref();
2151
- return {
2152
- buildSync(options) {
2153
- validateBuildSyncOptions(options);
2154
- return runCallSync("build", [options]);
2155
- },
2156
- transformSync(input, options) {
2157
- return runCallSync("transform", [input, options]);
2158
- },
2159
- formatMessagesSync(messages, options) {
2160
- return runCallSync("formatMessages", [messages, options]);
2161
- },
2162
- analyzeMetafileSync(metafile, options) {
2163
- return runCallSync("analyzeMetafile", [metafile, options]);
2164
- },
2165
- stop() {
2166
- worker.terminate();
2167
- workerThreadService = null;
2168
- }
2169
- };
2170
- };
2171
- var startSyncServiceWorker = () => {
2172
- let workerPort = worker_threads.workerData.workerPort;
2173
- let parentPort = worker_threads.parentPort;
2174
- let extractProperties = (object) => {
2175
- let properties = {};
2176
- if (object && typeof object === "object") {
2177
- for (let key in object) {
2178
- properties[key] = object[key];
2179
- }
2180
- }
2181
- return properties;
2182
- };
2183
- try {
2184
- let service = ensureServiceIsRunning();
2185
- defaultWD = worker_threads.workerData.defaultWD;
2186
- parentPort.on("message", (msg) => {
2187
- (async () => {
2188
- let { sharedBuffer, id, command, args } = msg;
2189
- let sharedBufferView = new Int32Array(sharedBuffer);
2190
- try {
2191
- switch (command) {
2192
- case "build":
2193
- workerPort.postMessage({ id, resolve: await service.build(args[0]) });
2194
- break;
2195
- case "transform":
2196
- workerPort.postMessage({ id, resolve: await service.transform(args[0], args[1]) });
2197
- break;
2198
- case "formatMessages":
2199
- workerPort.postMessage({ id, resolve: await service.formatMessages(args[0], args[1]) });
2200
- break;
2201
- case "analyzeMetafile":
2202
- workerPort.postMessage({ id, resolve: await service.analyzeMetafile(args[0], args[1]) });
2203
- break;
2204
- default:
2205
- throw new Error(`Invalid command: ${command}`);
2206
- }
2207
- } catch (reject) {
2208
- workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2209
- }
2210
- Atomics.add(sharedBufferView, 0, 1);
2211
- Atomics.notify(sharedBufferView, 0, Infinity);
2212
- })();
2213
- });
2214
- } catch (reject) {
2215
- parentPort.on("message", (msg) => {
2216
- let { sharedBuffer, id } = msg;
2217
- let sharedBufferView = new Int32Array(sharedBuffer);
2218
- workerPort.postMessage({ id, reject, properties: extractProperties(reject) });
2219
- Atomics.add(sharedBufferView, 0, 1);
2220
- Atomics.notify(sharedBufferView, 0, Infinity);
2221
- });
2222
- }
2223
- };
2224
- if (isInternalWorkerThread) {
2225
- startSyncServiceWorker();
2226
- }
2227
- var node_default = node_exports;
2228
- // Annotate the CommonJS export names for ESM import in node:
2229
- 0 && (module.exports = {
2230
- analyzeMetafile,
2231
- analyzeMetafileSync,
2232
- build,
2233
- buildSync,
2234
- context,
2235
- formatMessages,
2236
- formatMessagesSync,
2237
- initialize,
2238
- stop,
2239
- transform,
2240
- transformSync,
2241
- version
2242
- });