@tianshu-ai/tianshu 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (917) hide show
  1. package/LICENSE +200 -0
  2. package/README.md +284 -0
  3. package/README.zh-CN.md +136 -0
  4. package/bin/tianshu.mjs +32 -0
  5. package/package.json +60 -0
  6. package/packages/plugin-sdk/dist/agent-loop.d.ts +96 -0
  7. package/packages/plugin-sdk/dist/agent-loop.d.ts.map +1 -0
  8. package/packages/plugin-sdk/dist/agent-loop.js +11 -0
  9. package/packages/plugin-sdk/dist/agent-loop.js.map +1 -0
  10. package/packages/plugin-sdk/dist/capabilities.d.ts +48 -0
  11. package/packages/plugin-sdk/dist/capabilities.d.ts.map +1 -0
  12. package/packages/plugin-sdk/dist/capabilities.js +61 -0
  13. package/packages/plugin-sdk/dist/capabilities.js.map +1 -0
  14. package/packages/plugin-sdk/dist/catalog.d.ts +60 -0
  15. package/packages/plugin-sdk/dist/catalog.d.ts.map +1 -0
  16. package/packages/plugin-sdk/dist/catalog.js +11 -0
  17. package/packages/plugin-sdk/dist/catalog.js.map +1 -0
  18. package/packages/plugin-sdk/dist/client.d.ts +171 -0
  19. package/packages/plugin-sdk/dist/client.d.ts.map +1 -0
  20. package/packages/plugin-sdk/dist/client.js +96 -0
  21. package/packages/plugin-sdk/dist/client.js.map +1 -0
  22. package/packages/plugin-sdk/dist/index.d.ts +9 -0
  23. package/packages/plugin-sdk/dist/index.d.ts.map +1 -0
  24. package/packages/plugin-sdk/dist/index.js +19 -0
  25. package/packages/plugin-sdk/dist/index.js.map +1 -0
  26. package/packages/plugin-sdk/dist/lsp.d.ts +32 -0
  27. package/packages/plugin-sdk/dist/lsp.d.ts.map +1 -0
  28. package/packages/plugin-sdk/dist/lsp.js +19 -0
  29. package/packages/plugin-sdk/dist/lsp.js.map +1 -0
  30. package/packages/plugin-sdk/dist/manifest.d.ts +423 -0
  31. package/packages/plugin-sdk/dist/manifest.d.ts.map +1 -0
  32. package/packages/plugin-sdk/dist/manifest.js +7 -0
  33. package/packages/plugin-sdk/dist/manifest.js.map +1 -0
  34. package/packages/plugin-sdk/dist/mcp-client.d.ts +74 -0
  35. package/packages/plugin-sdk/dist/mcp-client.d.ts.map +1 -0
  36. package/packages/plugin-sdk/dist/mcp-client.js +226 -0
  37. package/packages/plugin-sdk/dist/mcp-client.js.map +1 -0
  38. package/packages/plugin-sdk/dist/mcp-fetch.d.ts +10 -0
  39. package/packages/plugin-sdk/dist/mcp-fetch.d.ts.map +1 -0
  40. package/packages/plugin-sdk/dist/mcp-fetch.js +130 -0
  41. package/packages/plugin-sdk/dist/mcp-fetch.js.map +1 -0
  42. package/packages/plugin-sdk/dist/mcp-toolset.d.ts +128 -0
  43. package/packages/plugin-sdk/dist/mcp-toolset.d.ts.map +1 -0
  44. package/packages/plugin-sdk/dist/mcp-toolset.js +246 -0
  45. package/packages/plugin-sdk/dist/mcp-toolset.js.map +1 -0
  46. package/packages/plugin-sdk/dist/server.d.ts +486 -0
  47. package/packages/plugin-sdk/dist/server.d.ts.map +1 -0
  48. package/packages/plugin-sdk/dist/server.js +10 -0
  49. package/packages/plugin-sdk/dist/server.js.map +1 -0
  50. package/packages/plugin-sdk/dist/session-inbox.d.ts +56 -0
  51. package/packages/plugin-sdk/dist/session-inbox.d.ts.map +1 -0
  52. package/packages/plugin-sdk/dist/session-inbox.js +12 -0
  53. package/packages/plugin-sdk/dist/session-inbox.js.map +1 -0
  54. package/packages/plugin-sdk/package.json +36 -0
  55. package/packages/server/builtinConfig/plugins/README.md +1 -0
  56. package/packages/server/builtinConfig/plugins/files/manifest.json +100 -0
  57. package/packages/server/builtinConfig/plugins/files/skills/files-workspace-layout.md +29 -0
  58. package/packages/server/builtinConfig/plugins/microsandbox/manifest.json +177 -0
  59. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
  60. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
  61. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-config.md +38 -0
  62. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
  63. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
  64. package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-main-orchestration.md +75 -0
  65. package/packages/server/builtinConfig/plugins/microsandbox/templates/README.md +26 -0
  66. package/packages/server/builtinConfig/plugins/microsandbox/templates/browser.yaml +105 -0
  67. package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner-with-browser.yaml +80 -0
  68. package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner.yaml +80 -0
  69. package/packages/server/builtinConfig/plugins/web-search/manifest.json +65 -0
  70. package/packages/server/builtinConfig/plugins/web-search/skills/web-search-howto.md +69 -0
  71. package/packages/server/builtinConfig/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
  72. package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
  73. package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
  74. package/packages/server/builtinConfig/plugins/workboard/manifest.json +180 -0
  75. package/packages/server/builtinConfig/plugins/workboard/skills/large-input-large-output.md +185 -0
  76. package/packages/server/builtinConfig/plugins/workboard/skills/workboard-howto.md +166 -0
  77. package/packages/server/builtinConfig/plugins/workboard/skills/worker-creator.md +267 -0
  78. package/packages/server/builtinConfig/plugins/workboard/skills/worker-fleet.md +431 -0
  79. package/packages/server/dist/catalog.d.ts +52 -0
  80. package/packages/server/dist/catalog.d.ts.map +1 -0
  81. package/packages/server/dist/catalog.js +189 -0
  82. package/packages/server/dist/catalog.js.map +1 -0
  83. package/packages/server/dist/chat/active-harnesses.d.ts +34 -0
  84. package/packages/server/dist/chat/active-harnesses.d.ts.map +1 -0
  85. package/packages/server/dist/chat/active-harnesses.js +118 -0
  86. package/packages/server/dist/chat/active-harnesses.js.map +1 -0
  87. package/packages/server/dist/chat/agent-loop.d.ts +64 -0
  88. package/packages/server/dist/chat/agent-loop.d.ts.map +1 -0
  89. package/packages/server/dist/chat/agent-loop.js +597 -0
  90. package/packages/server/dist/chat/agent-loop.js.map +1 -0
  91. package/packages/server/dist/chat/agent-tool-adapter.d.ts +33 -0
  92. package/packages/server/dist/chat/agent-tool-adapter.d.ts.map +1 -0
  93. package/packages/server/dist/chat/agent-tool-adapter.js +260 -0
  94. package/packages/server/dist/chat/agent-tool-adapter.js.map +1 -0
  95. package/packages/server/dist/chat/compact.d.ts +52 -0
  96. package/packages/server/dist/chat/compact.d.ts.map +1 -0
  97. package/packages/server/dist/chat/compact.js +248 -0
  98. package/packages/server/dist/chat/compact.js.map +1 -0
  99. package/packages/server/dist/chat/dump-system-prompt.d.ts +17 -0
  100. package/packages/server/dist/chat/dump-system-prompt.d.ts.map +1 -0
  101. package/packages/server/dist/chat/dump-system-prompt.js +58 -0
  102. package/packages/server/dist/chat/dump-system-prompt.js.map +1 -0
  103. package/packages/server/dist/chat/handler.d.ts +186 -0
  104. package/packages/server/dist/chat/handler.d.ts.map +1 -0
  105. package/packages/server/dist/chat/handler.js +1248 -0
  106. package/packages/server/dist/chat/handler.js.map +1 -0
  107. package/packages/server/dist/chat/image-fit.d.ts +34 -0
  108. package/packages/server/dist/chat/image-fit.d.ts.map +1 -0
  109. package/packages/server/dist/chat/image-fit.js +157 -0
  110. package/packages/server/dist/chat/image-fit.js.map +1 -0
  111. package/packages/server/dist/chat/messages.d.ts +118 -0
  112. package/packages/server/dist/chat/messages.d.ts.map +1 -0
  113. package/packages/server/dist/chat/messages.js +341 -0
  114. package/packages/server/dist/chat/messages.js.map +1 -0
  115. package/packages/server/dist/chat/session-inbox.d.ts +114 -0
  116. package/packages/server/dist/chat/session-inbox.d.ts.map +1 -0
  117. package/packages/server/dist/chat/session-inbox.js +418 -0
  118. package/packages/server/dist/chat/session-inbox.js.map +1 -0
  119. package/packages/server/dist/chat/sqlite-session-repo.d.ts +26 -0
  120. package/packages/server/dist/chat/sqlite-session-repo.d.ts.map +1 -0
  121. package/packages/server/dist/chat/sqlite-session-repo.js +132 -0
  122. package/packages/server/dist/chat/sqlite-session-repo.js.map +1 -0
  123. package/packages/server/dist/chat/sqlite-session-storage.d.ts +83 -0
  124. package/packages/server/dist/chat/sqlite-session-storage.d.ts.map +1 -0
  125. package/packages/server/dist/chat/sqlite-session-storage.js +418 -0
  126. package/packages/server/dist/chat/sqlite-session-storage.js.map +1 -0
  127. package/packages/server/dist/chat/stub-execution-env.d.ts +3 -0
  128. package/packages/server/dist/chat/stub-execution-env.d.ts.map +1 -0
  129. package/packages/server/dist/chat/stub-execution-env.js +87 -0
  130. package/packages/server/dist/chat/stub-execution-env.js.map +1 -0
  131. package/packages/server/dist/chat/token-estimate.d.ts +11 -0
  132. package/packages/server/dist/chat/token-estimate.d.ts.map +1 -0
  133. package/packages/server/dist/chat/token-estimate.js +67 -0
  134. package/packages/server/dist/chat/token-estimate.js.map +1 -0
  135. package/packages/server/dist/chat/ws-protocol.d.ts +244 -0
  136. package/packages/server/dist/chat/ws-protocol.d.ts.map +1 -0
  137. package/packages/server/dist/chat/ws-protocol.js +193 -0
  138. package/packages/server/dist/chat/ws-protocol.js.map +1 -0
  139. package/packages/server/dist/cli.d.ts +9 -0
  140. package/packages/server/dist/cli.d.ts.map +1 -0
  141. package/packages/server/dist/cli.js +329 -0
  142. package/packages/server/dist/cli.js.map +1 -0
  143. package/packages/server/dist/core/agent-seeds.d.ts +25 -0
  144. package/packages/server/dist/core/agent-seeds.d.ts.map +1 -0
  145. package/packages/server/dist/core/agent-seeds.js +69 -0
  146. package/packages/server/dist/core/agent-seeds.js.map +1 -0
  147. package/packages/server/dist/core/config.d.ts +172 -0
  148. package/packages/server/dist/core/config.d.ts.map +1 -0
  149. package/packages/server/dist/core/config.js +155 -0
  150. package/packages/server/dist/core/config.js.map +1 -0
  151. package/packages/server/dist/core/db-pool.d.ts +32 -0
  152. package/packages/server/dist/core/db-pool.d.ts.map +1 -0
  153. package/packages/server/dist/core/db-pool.js +108 -0
  154. package/packages/server/dist/core/db-pool.js.map +1 -0
  155. package/packages/server/dist/core/dev-mode.d.ts +13 -0
  156. package/packages/server/dist/core/dev-mode.d.ts.map +1 -0
  157. package/packages/server/dist/core/dev-mode.js +51 -0
  158. package/packages/server/dist/core/dev-mode.js.map +1 -0
  159. package/packages/server/dist/core/global-ops.d.ts +54 -0
  160. package/packages/server/dist/core/global-ops.d.ts.map +1 -0
  161. package/packages/server/dist/core/global-ops.js +143 -0
  162. package/packages/server/dist/core/global-ops.js.map +1 -0
  163. package/packages/server/dist/core/identity-resolvers.d.ts +102 -0
  164. package/packages/server/dist/core/identity-resolvers.d.ts.map +1 -0
  165. package/packages/server/dist/core/identity-resolvers.js +176 -0
  166. package/packages/server/dist/core/identity-resolvers.js.map +1 -0
  167. package/packages/server/dist/core/index.d.ts +13 -0
  168. package/packages/server/dist/core/index.d.ts.map +1 -0
  169. package/packages/server/dist/core/index.js +18 -0
  170. package/packages/server/dist/core/index.js.map +1 -0
  171. package/packages/server/dist/core/llm.d.ts +45 -0
  172. package/packages/server/dist/core/llm.d.ts.map +1 -0
  173. package/packages/server/dist/core/llm.js +140 -0
  174. package/packages/server/dist/core/llm.js.map +1 -0
  175. package/packages/server/dist/core/mcp-manager.d.ts +47 -0
  176. package/packages/server/dist/core/mcp-manager.d.ts.map +1 -0
  177. package/packages/server/dist/core/mcp-manager.js +129 -0
  178. package/packages/server/dist/core/mcp-manager.js.map +1 -0
  179. package/packages/server/dist/core/middleware.d.ts +31 -0
  180. package/packages/server/dist/core/middleware.d.ts.map +1 -0
  181. package/packages/server/dist/core/middleware.js +102 -0
  182. package/packages/server/dist/core/middleware.js.map +1 -0
  183. package/packages/server/dist/core/migrations/001-initial.d.ts +4 -0
  184. package/packages/server/dist/core/migrations/001-initial.d.ts.map +1 -0
  185. package/packages/server/dist/core/migrations/001-initial.js +66 -0
  186. package/packages/server/dist/core/migrations/001-initial.js.map +1 -0
  187. package/packages/server/dist/core/migrations/002-task-dependencies.d.ts +4 -0
  188. package/packages/server/dist/core/migrations/002-task-dependencies.d.ts.map +1 -0
  189. package/packages/server/dist/core/migrations/002-task-dependencies.js +20 -0
  190. package/packages/server/dist/core/migrations/002-task-dependencies.js.map +1 -0
  191. package/packages/server/dist/core/migrations/003-session-tree.d.ts +4 -0
  192. package/packages/server/dist/core/migrations/003-session-tree.d.ts.map +1 -0
  193. package/packages/server/dist/core/migrations/003-session-tree.js +96 -0
  194. package/packages/server/dist/core/migrations/003-session-tree.js.map +1 -0
  195. package/packages/server/dist/core/migrations/003-worker-agents.d.ts +4 -0
  196. package/packages/server/dist/core/migrations/003-worker-agents.d.ts.map +1 -0
  197. package/packages/server/dist/core/migrations/003-worker-agents.js +65 -0
  198. package/packages/server/dist/core/migrations/003-worker-agents.js.map +1 -0
  199. package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts +4 -0
  200. package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts.map +1 -0
  201. package/packages/server/dist/core/migrations/004-rebuild-message-chain.js +52 -0
  202. package/packages/server/dist/core/migrations/004-rebuild-message-chain.js.map +1 -0
  203. package/packages/server/dist/core/migrations/005-task-status-rename.d.ts +4 -0
  204. package/packages/server/dist/core/migrations/005-task-status-rename.d.ts.map +1 -0
  205. package/packages/server/dist/core/migrations/005-task-status-rename.js +64 -0
  206. package/packages/server/dist/core/migrations/005-task-status-rename.js.map +1 -0
  207. package/packages/server/dist/core/migrations/006-task-labels.d.ts +4 -0
  208. package/packages/server/dist/core/migrations/006-task-labels.d.ts.map +1 -0
  209. package/packages/server/dist/core/migrations/006-task-labels.js +43 -0
  210. package/packages/server/dist/core/migrations/006-task-labels.js.map +1 -0
  211. package/packages/server/dist/core/migrations/007-session-inbox.d.ts +4 -0
  212. package/packages/server/dist/core/migrations/007-session-inbox.d.ts.map +1 -0
  213. package/packages/server/dist/core/migrations/007-session-inbox.js +67 -0
  214. package/packages/server/dist/core/migrations/007-session-inbox.js.map +1 -0
  215. package/packages/server/dist/core/migrations/008-task-intervention.d.ts +4 -0
  216. package/packages/server/dist/core/migrations/008-task-intervention.d.ts.map +1 -0
  217. package/packages/server/dist/core/migrations/008-task-intervention.js +60 -0
  218. package/packages/server/dist/core/migrations/008-task-intervention.js.map +1 -0
  219. package/packages/server/dist/core/migrations/index.d.ts +12 -0
  220. package/packages/server/dist/core/migrations/index.d.ts.map +1 -0
  221. package/packages/server/dist/core/migrations/index.js +58 -0
  222. package/packages/server/dist/core/migrations/index.js.map +1 -0
  223. package/packages/server/dist/core/paths.d.ts +53 -0
  224. package/packages/server/dist/core/paths.d.ts.map +1 -0
  225. package/packages/server/dist/core/paths.js +125 -0
  226. package/packages/server/dist/core/paths.js.map +1 -0
  227. package/packages/server/dist/core/plugins/builtin-loader.d.ts +56 -0
  228. package/packages/server/dist/core/plugins/builtin-loader.d.ts.map +1 -0
  229. package/packages/server/dist/core/plugins/builtin-loader.js +153 -0
  230. package/packages/server/dist/core/plugins/builtin-loader.js.map +1 -0
  231. package/packages/server/dist/core/plugins/discovery.d.ts +28 -0
  232. package/packages/server/dist/core/plugins/discovery.d.ts.map +1 -0
  233. package/packages/server/dist/core/plugins/discovery.js +97 -0
  234. package/packages/server/dist/core/plugins/discovery.js.map +1 -0
  235. package/packages/server/dist/core/plugins/index.d.ts +6 -0
  236. package/packages/server/dist/core/plugins/index.d.ts.map +1 -0
  237. package/packages/server/dist/core/plugins/index.js +6 -0
  238. package/packages/server/dist/core/plugins/index.js.map +1 -0
  239. package/packages/server/dist/core/plugins/manifest.d.ts +9 -0
  240. package/packages/server/dist/core/plugins/manifest.d.ts.map +1 -0
  241. package/packages/server/dist/core/plugins/manifest.js +584 -0
  242. package/packages/server/dist/core/plugins/manifest.js.map +1 -0
  243. package/packages/server/dist/core/plugins/registry.d.ts +269 -0
  244. package/packages/server/dist/core/plugins/registry.d.ts.map +1 -0
  245. package/packages/server/dist/core/plugins/registry.js +1003 -0
  246. package/packages/server/dist/core/plugins/registry.js.map +1 -0
  247. package/packages/server/dist/core/plugins/secrets.d.ts +46 -0
  248. package/packages/server/dist/core/plugins/secrets.d.ts.map +1 -0
  249. package/packages/server/dist/core/plugins/secrets.js +174 -0
  250. package/packages/server/dist/core/plugins/secrets.js.map +1 -0
  251. package/packages/server/dist/core/plugins/skills.d.ts +131 -0
  252. package/packages/server/dist/core/plugins/skills.d.ts.map +1 -0
  253. package/packages/server/dist/core/plugins/skills.js +389 -0
  254. package/packages/server/dist/core/plugins/skills.js.map +1 -0
  255. package/packages/server/dist/core/templates.d.ts +28 -0
  256. package/packages/server/dist/core/templates.d.ts.map +1 -0
  257. package/packages/server/dist/core/templates.js +103 -0
  258. package/packages/server/dist/core/templates.js.map +1 -0
  259. package/packages/server/dist/core/tenant-context.d.ts +18 -0
  260. package/packages/server/dist/core/tenant-context.d.ts.map +1 -0
  261. package/packages/server/dist/core/tenant-context.js +42 -0
  262. package/packages/server/dist/core/tenant-context.js.map +1 -0
  263. package/packages/server/dist/core/tenant-id.d.ts +8 -0
  264. package/packages/server/dist/core/tenant-id.d.ts.map +1 -0
  265. package/packages/server/dist/core/tenant-id.js +53 -0
  266. package/packages/server/dist/core/tenant-id.js.map +1 -0
  267. package/packages/server/dist/core/tenant-skills.d.ts +29 -0
  268. package/packages/server/dist/core/tenant-skills.d.ts.map +1 -0
  269. package/packages/server/dist/core/tenant-skills.js +77 -0
  270. package/packages/server/dist/core/tenant-skills.js.map +1 -0
  271. package/packages/server/dist/core/worker-agents-fs.d.ts +44 -0
  272. package/packages/server/dist/core/worker-agents-fs.d.ts.map +1 -0
  273. package/packages/server/dist/core/worker-agents-fs.js +86 -0
  274. package/packages/server/dist/core/worker-agents-fs.js.map +1 -0
  275. package/packages/server/dist/core/worker-agents.d.ts +77 -0
  276. package/packages/server/dist/core/worker-agents.d.ts.map +1 -0
  277. package/packages/server/dist/core/worker-agents.js +191 -0
  278. package/packages/server/dist/core/worker-agents.js.map +1 -0
  279. package/packages/server/dist/index.d.ts +2 -0
  280. package/packages/server/dist/index.d.ts.map +1 -0
  281. package/packages/server/dist/index.js +623 -0
  282. package/packages/server/dist/index.js.map +1 -0
  283. package/packages/server/dist/lsp/client.d.ts +53 -0
  284. package/packages/server/dist/lsp/client.d.ts.map +1 -0
  285. package/packages/server/dist/lsp/client.js +258 -0
  286. package/packages/server/dist/lsp/client.js.map +1 -0
  287. package/packages/server/dist/lsp/format.d.ts +13 -0
  288. package/packages/server/dist/lsp/format.d.ts.map +1 -0
  289. package/packages/server/dist/lsp/format.js +55 -0
  290. package/packages/server/dist/lsp/format.js.map +1 -0
  291. package/packages/server/dist/lsp/index.d.ts +20 -0
  292. package/packages/server/dist/lsp/index.d.ts.map +1 -0
  293. package/packages/server/dist/lsp/index.js +32 -0
  294. package/packages/server/dist/lsp/index.js.map +1 -0
  295. package/packages/server/dist/lsp/language-registry.d.ts +29 -0
  296. package/packages/server/dist/lsp/language-registry.d.ts.map +1 -0
  297. package/packages/server/dist/lsp/language-registry.js +62 -0
  298. package/packages/server/dist/lsp/language-registry.js.map +1 -0
  299. package/packages/server/dist/lsp/manager.d.ts +77 -0
  300. package/packages/server/dist/lsp/manager.d.ts.map +1 -0
  301. package/packages/server/dist/lsp/manager.js +300 -0
  302. package/packages/server/dist/lsp/manager.js.map +1 -0
  303. package/packages/server/dist/plugins-routes.d.ts +96 -0
  304. package/packages/server/dist/plugins-routes.d.ts.map +1 -0
  305. package/packages/server/dist/plugins-routes.js +627 -0
  306. package/packages/server/dist/plugins-routes.js.map +1 -0
  307. package/packages/server/dist/setup/checks/config.d.ts +9 -0
  308. package/packages/server/dist/setup/checks/config.d.ts.map +1 -0
  309. package/packages/server/dist/setup/checks/config.js +66 -0
  310. package/packages/server/dist/setup/checks/config.js.map +1 -0
  311. package/packages/server/dist/setup/checks/db.d.ts +6 -0
  312. package/packages/server/dist/setup/checks/db.d.ts.map +1 -0
  313. package/packages/server/dist/setup/checks/db.js +79 -0
  314. package/packages/server/dist/setup/checks/db.js.map +1 -0
  315. package/packages/server/dist/setup/checks/known-models.d.ts +18 -0
  316. package/packages/server/dist/setup/checks/known-models.d.ts.map +1 -0
  317. package/packages/server/dist/setup/checks/known-models.js +119 -0
  318. package/packages/server/dist/setup/checks/known-models.js.map +1 -0
  319. package/packages/server/dist/setup/checks/network.d.ts +11 -0
  320. package/packages/server/dist/setup/checks/network.d.ts.map +1 -0
  321. package/packages/server/dist/setup/checks/network.js +176 -0
  322. package/packages/server/dist/setup/checks/network.js.map +1 -0
  323. package/packages/server/dist/setup/checks/plugins.d.ts +9 -0
  324. package/packages/server/dist/setup/checks/plugins.d.ts.map +1 -0
  325. package/packages/server/dist/setup/checks/plugins.js +194 -0
  326. package/packages/server/dist/setup/checks/plugins.js.map +1 -0
  327. package/packages/server/dist/setup/checks/providers.d.ts +12 -0
  328. package/packages/server/dist/setup/checks/providers.d.ts.map +1 -0
  329. package/packages/server/dist/setup/checks/providers.js +368 -0
  330. package/packages/server/dist/setup/checks/providers.js.map +1 -0
  331. package/packages/server/dist/setup/checks/runtime.d.ts +3 -0
  332. package/packages/server/dist/setup/checks/runtime.d.ts.map +1 -0
  333. package/packages/server/dist/setup/checks/runtime.js +44 -0
  334. package/packages/server/dist/setup/checks/runtime.js.map +1 -0
  335. package/packages/server/dist/setup/checks/sandbox.d.ts +9 -0
  336. package/packages/server/dist/setup/checks/sandbox.d.ts.map +1 -0
  337. package/packages/server/dist/setup/checks/sandbox.js +110 -0
  338. package/packages/server/dist/setup/checks/sandbox.js.map +1 -0
  339. package/packages/server/dist/setup/checks/tenants.d.ts +9 -0
  340. package/packages/server/dist/setup/checks/tenants.d.ts.map +1 -0
  341. package/packages/server/dist/setup/checks/tenants.js +509 -0
  342. package/packages/server/dist/setup/checks/tenants.js.map +1 -0
  343. package/packages/server/dist/setup/cli-agent.d.ts +39 -0
  344. package/packages/server/dist/setup/cli-agent.d.ts.map +1 -0
  345. package/packages/server/dist/setup/cli-agent.js +1353 -0
  346. package/packages/server/dist/setup/cli-agent.js.map +1 -0
  347. package/packages/server/dist/setup/doctor.d.ts +32 -0
  348. package/packages/server/dist/setup/doctor.d.ts.map +1 -0
  349. package/packages/server/dist/setup/doctor.js +80 -0
  350. package/packages/server/dist/setup/doctor.js.map +1 -0
  351. package/packages/server/dist/setup/launchd.d.ts +107 -0
  352. package/packages/server/dist/setup/launchd.d.ts.map +1 -0
  353. package/packages/server/dist/setup/launchd.js +309 -0
  354. package/packages/server/dist/setup/launchd.js.map +1 -0
  355. package/packages/server/dist/setup/load-env.d.ts +21 -0
  356. package/packages/server/dist/setup/load-env.d.ts.map +1 -0
  357. package/packages/server/dist/setup/load-env.js +88 -0
  358. package/packages/server/dist/setup/load-env.js.map +1 -0
  359. package/packages/server/dist/setup/probe-default-model.d.ts +28 -0
  360. package/packages/server/dist/setup/probe-default-model.d.ts.map +1 -0
  361. package/packages/server/dist/setup/probe-default-model.js +133 -0
  362. package/packages/server/dist/setup/probe-default-model.js.map +1 -0
  363. package/packages/server/dist/setup/render.d.ts +28 -0
  364. package/packages/server/dist/setup/render.d.ts.map +1 -0
  365. package/packages/server/dist/setup/render.js +60 -0
  366. package/packages/server/dist/setup/render.js.map +1 -0
  367. package/packages/server/dist/setup/repo-root.d.ts +3 -0
  368. package/packages/server/dist/setup/repo-root.d.ts.map +1 -0
  369. package/packages/server/dist/setup/repo-root.js +43 -0
  370. package/packages/server/dist/setup/repo-root.js.map +1 -0
  371. package/packages/server/dist/setup/service.d.ts +60 -0
  372. package/packages/server/dist/setup/service.d.ts.map +1 -0
  373. package/packages/server/dist/setup/service.js +345 -0
  374. package/packages/server/dist/setup/service.js.map +1 -0
  375. package/packages/server/dist/setup/start-server.d.ts +23 -0
  376. package/packages/server/dist/setup/start-server.d.ts.map +1 -0
  377. package/packages/server/dist/setup/start-server.js +465 -0
  378. package/packages/server/dist/setup/start-server.js.map +1 -0
  379. package/packages/server/dist/setup/wizard.d.ts +59 -0
  380. package/packages/server/dist/setup/wizard.d.ts.map +1 -0
  381. package/packages/server/dist/setup/wizard.js +556 -0
  382. package/packages/server/dist/setup/wizard.js.map +1 -0
  383. package/packages/server/dist/tools/edit-file.d.ts +13 -0
  384. package/packages/server/dist/tools/edit-file.d.ts.map +1 -0
  385. package/packages/server/dist/tools/edit-file.js +90 -0
  386. package/packages/server/dist/tools/edit-file.js.map +1 -0
  387. package/packages/server/dist/tools/glob.d.ts +12 -0
  388. package/packages/server/dist/tools/glob.d.ts.map +1 -0
  389. package/packages/server/dist/tools/glob.js +82 -0
  390. package/packages/server/dist/tools/glob.js.map +1 -0
  391. package/packages/server/dist/tools/index.d.ts +82 -0
  392. package/packages/server/dist/tools/index.d.ts.map +1 -0
  393. package/packages/server/dist/tools/index.js +72 -0
  394. package/packages/server/dist/tools/index.js.map +1 -0
  395. package/packages/server/dist/tools/list-dir.d.ts +24 -0
  396. package/packages/server/dist/tools/list-dir.d.ts.map +1 -0
  397. package/packages/server/dist/tools/list-dir.js +99 -0
  398. package/packages/server/dist/tools/list-dir.js.map +1 -0
  399. package/packages/server/dist/tools/path-helper.d.ts +15 -0
  400. package/packages/server/dist/tools/path-helper.d.ts.map +1 -0
  401. package/packages/server/dist/tools/path-helper.js +72 -0
  402. package/packages/server/dist/tools/path-helper.js.map +1 -0
  403. package/packages/server/dist/tools/read-file.d.ts +17 -0
  404. package/packages/server/dist/tools/read-file.d.ts.map +1 -0
  405. package/packages/server/dist/tools/read-file.js +94 -0
  406. package/packages/server/dist/tools/read-file.js.map +1 -0
  407. package/packages/server/dist/tools/sandbox.d.ts +57 -0
  408. package/packages/server/dist/tools/sandbox.d.ts.map +1 -0
  409. package/packages/server/dist/tools/sandbox.js +291 -0
  410. package/packages/server/dist/tools/sandbox.js.map +1 -0
  411. package/packages/server/dist/tools/write-file.d.ts +12 -0
  412. package/packages/server/dist/tools/write-file.d.ts.map +1 -0
  413. package/packages/server/dist/tools/write-file.js +67 -0
  414. package/packages/server/dist/tools/write-file.js.map +1 -0
  415. package/packages/server/dist/worker-agents-routes.d.ts +11 -0
  416. package/packages/server/dist/worker-agents-routes.d.ts.map +1 -0
  417. package/packages/server/dist/worker-agents-routes.js +253 -0
  418. package/packages/server/dist/worker-agents-routes.js.map +1 -0
  419. package/packages/server/package.json +41 -0
  420. package/packages/web/dist/assets/index-DH-gJ09_.js +60 -0
  421. package/packages/web/dist/assets/index-xU4lYYqY.css +2 -0
  422. package/packages/web/dist/index.html +14 -0
  423. package/packages/web/package.json +36 -0
  424. package/plugins/README.md +64 -0
  425. package/plugins/files/dist/client.d.ts +5 -0
  426. package/plugins/files/dist/client.d.ts.map +1 -0
  427. package/plugins/files/dist/client.js +354 -0
  428. package/plugins/files/dist/client.js.map +1 -0
  429. package/plugins/files/dist/server.d.ts +32 -0
  430. package/plugins/files/dist/server.d.ts.map +1 -0
  431. package/plugins/files/dist/server.js +514 -0
  432. package/plugins/files/dist/server.js.map +1 -0
  433. package/plugins/files/dist/tools/edit-file.d.ts +29 -0
  434. package/plugins/files/dist/tools/edit-file.d.ts.map +1 -0
  435. package/plugins/files/dist/tools/edit-file.js +230 -0
  436. package/plugins/files/dist/tools/edit-file.js.map +1 -0
  437. package/plugins/files/dist/tools/edit-file.prompt.md +36 -0
  438. package/plugins/files/dist/tools/glob.d.ts +12 -0
  439. package/plugins/files/dist/tools/glob.d.ts.map +1 -0
  440. package/plugins/files/dist/tools/glob.js +84 -0
  441. package/plugins/files/dist/tools/glob.js.map +1 -0
  442. package/plugins/files/dist/tools/index.d.ts +13 -0
  443. package/plugins/files/dist/tools/index.d.ts.map +1 -0
  444. package/plugins/files/dist/tools/index.js +158 -0
  445. package/plugins/files/dist/tools/index.js.map +1 -0
  446. package/plugins/files/dist/tools/list-dir.d.ts +24 -0
  447. package/plugins/files/dist/tools/list-dir.d.ts.map +1 -0
  448. package/plugins/files/dist/tools/list-dir.js +104 -0
  449. package/plugins/files/dist/tools/list-dir.js.map +1 -0
  450. package/plugins/files/dist/tools/load-prompt.d.ts +5 -0
  451. package/plugins/files/dist/tools/load-prompt.d.ts.map +1 -0
  452. package/plugins/files/dist/tools/load-prompt.js +39 -0
  453. package/plugins/files/dist/tools/load-prompt.js.map +1 -0
  454. package/plugins/files/dist/tools/path-helper.d.ts +32 -0
  455. package/plugins/files/dist/tools/path-helper.d.ts.map +1 -0
  456. package/plugins/files/dist/tools/path-helper.js +113 -0
  457. package/plugins/files/dist/tools/path-helper.js.map +1 -0
  458. package/plugins/files/dist/tools/read-file.d.ts +17 -0
  459. package/plugins/files/dist/tools/read-file.d.ts.map +1 -0
  460. package/plugins/files/dist/tools/read-file.js +109 -0
  461. package/plugins/files/dist/tools/read-file.js.map +1 -0
  462. package/plugins/files/dist/tools/read-tracker.d.ts +28 -0
  463. package/plugins/files/dist/tools/read-tracker.d.ts.map +1 -0
  464. package/plugins/files/dist/tools/read-tracker.js +135 -0
  465. package/plugins/files/dist/tools/read-tracker.js.map +1 -0
  466. package/plugins/files/dist/tools/replacers.d.ts +27 -0
  467. package/plugins/files/dist/tools/replacers.d.ts.map +1 -0
  468. package/plugins/files/dist/tools/replacers.js +221 -0
  469. package/plugins/files/dist/tools/replacers.js.map +1 -0
  470. package/plugins/files/dist/tools/tenant-config-delete.d.ts +12 -0
  471. package/plugins/files/dist/tools/tenant-config-delete.d.ts.map +1 -0
  472. package/plugins/files/dist/tools/tenant-config-delete.js +70 -0
  473. package/plugins/files/dist/tools/tenant-config-delete.js.map +1 -0
  474. package/plugins/files/dist/tools/tenant-config-edit.d.ts +25 -0
  475. package/plugins/files/dist/tools/tenant-config-edit.d.ts.map +1 -0
  476. package/plugins/files/dist/tools/tenant-config-edit.js +142 -0
  477. package/plugins/files/dist/tools/tenant-config-edit.js.map +1 -0
  478. package/plugins/files/dist/tools/tenant-config-glob.d.ts +12 -0
  479. package/plugins/files/dist/tools/tenant-config-glob.d.ts.map +1 -0
  480. package/plugins/files/dist/tools/tenant-config-glob.js +64 -0
  481. package/plugins/files/dist/tools/tenant-config-glob.js.map +1 -0
  482. package/plugins/files/dist/tools/tenant-config-helper.d.ts +64 -0
  483. package/plugins/files/dist/tools/tenant-config-helper.d.ts.map +1 -0
  484. package/plugins/files/dist/tools/tenant-config-helper.js +162 -0
  485. package/plugins/files/dist/tools/tenant-config-helper.js.map +1 -0
  486. package/plugins/files/dist/tools/tenant-config-list.d.ts +20 -0
  487. package/plugins/files/dist/tools/tenant-config-list.d.ts.map +1 -0
  488. package/plugins/files/dist/tools/tenant-config-list.js +95 -0
  489. package/plugins/files/dist/tools/tenant-config-list.js.map +1 -0
  490. package/plugins/files/dist/tools/tenant-config-read.d.ts +17 -0
  491. package/plugins/files/dist/tools/tenant-config-read.d.ts.map +1 -0
  492. package/plugins/files/dist/tools/tenant-config-read.js +87 -0
  493. package/plugins/files/dist/tools/tenant-config-read.js.map +1 -0
  494. package/plugins/files/dist/tools/tenant-config-write.d.ts +14 -0
  495. package/plugins/files/dist/tools/tenant-config-write.d.ts.map +1 -0
  496. package/plugins/files/dist/tools/tenant-config-write.js +78 -0
  497. package/plugins/files/dist/tools/tenant-config-write.js.map +1 -0
  498. package/plugins/files/dist/tools/text-shape.d.ts +20 -0
  499. package/plugins/files/dist/tools/text-shape.d.ts.map +1 -0
  500. package/plugins/files/dist/tools/text-shape.js +57 -0
  501. package/plugins/files/dist/tools/text-shape.js.map +1 -0
  502. package/plugins/files/dist/tools/write-file.d.ts +12 -0
  503. package/plugins/files/dist/tools/write-file.d.ts.map +1 -0
  504. package/plugins/files/dist/tools/write-file.js +89 -0
  505. package/plugins/files/dist/tools/write-file.js.map +1 -0
  506. package/plugins/files/dist/tools/write-file.prompt.md +14 -0
  507. package/plugins/files/manifest.json +100 -0
  508. package/plugins/files/package.json +39 -0
  509. package/plugins/files/skills/files-workspace-layout.md +29 -0
  510. package/plugins/microsandbox/dist/admin/browser-routes.d.ts +41 -0
  511. package/plugins/microsandbox/dist/admin/browser-routes.d.ts.map +1 -0
  512. package/plugins/microsandbox/dist/admin/browser-routes.js +208 -0
  513. package/plugins/microsandbox/dist/admin/browser-routes.js.map +1 -0
  514. package/plugins/microsandbox/dist/admin/preview-exec.d.ts +38 -0
  515. package/plugins/microsandbox/dist/admin/preview-exec.d.ts.map +1 -0
  516. package/plugins/microsandbox/dist/admin/preview-exec.js +185 -0
  517. package/plugins/microsandbox/dist/admin/preview-exec.js.map +1 -0
  518. package/plugins/microsandbox/dist/admin/routes.d.ts +35 -0
  519. package/plugins/microsandbox/dist/admin/routes.d.ts.map +1 -0
  520. package/plugins/microsandbox/dist/admin/routes.js +728 -0
  521. package/plugins/microsandbox/dist/admin/routes.js.map +1 -0
  522. package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts +11 -0
  523. package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts.map +1 -0
  524. package/plugins/microsandbox/dist/admin/sandboxfile-io.js +72 -0
  525. package/plugins/microsandbox/dist/admin/sandboxfile-io.js.map +1 -0
  526. package/plugins/microsandbox/dist/admin/templates.d.ts +16 -0
  527. package/plugins/microsandbox/dist/admin/templates.d.ts.map +1 -0
  528. package/plugins/microsandbox/dist/admin/templates.js +66 -0
  529. package/plugins/microsandbox/dist/admin/templates.js.map +1 -0
  530. package/plugins/microsandbox/dist/admin.d.ts +5 -0
  531. package/plugins/microsandbox/dist/admin.d.ts.map +1 -0
  532. package/plugins/microsandbox/dist/admin.js +256 -0
  533. package/plugins/microsandbox/dist/admin.js.map +1 -0
  534. package/plugins/microsandbox/dist/build/builder.d.ts +69 -0
  535. package/plugins/microsandbox/dist/build/builder.d.ts.map +1 -0
  536. package/plugins/microsandbox/dist/build/builder.js +257 -0
  537. package/plugins/microsandbox/dist/build/builder.js.map +1 -0
  538. package/plugins/microsandbox/dist/build/metadata.d.ts +27 -0
  539. package/plugins/microsandbox/dist/build/metadata.d.ts.map +1 -0
  540. package/plugins/microsandbox/dist/build/metadata.js +55 -0
  541. package/plugins/microsandbox/dist/build/metadata.js.map +1 -0
  542. package/plugins/microsandbox/dist/build/pointer.d.ts +51 -0
  543. package/plugins/microsandbox/dist/build/pointer.d.ts.map +1 -0
  544. package/plugins/microsandbox/dist/build/pointer.js +130 -0
  545. package/plugins/microsandbox/dist/build/pointer.js.map +1 -0
  546. package/plugins/microsandbox/dist/build/sandboxfile.d.ts +15 -0
  547. package/plugins/microsandbox/dist/build/sandboxfile.d.ts.map +1 -0
  548. package/plugins/microsandbox/dist/build/sandboxfile.js +176 -0
  549. package/plugins/microsandbox/dist/build/sandboxfile.js.map +1 -0
  550. package/plugins/microsandbox/dist/client.d.ts +5 -0
  551. package/plugins/microsandbox/dist/client.d.ts.map +1 -0
  552. package/plugins/microsandbox/dist/client.js +941 -0
  553. package/plugins/microsandbox/dist/client.js.map +1 -0
  554. package/plugins/microsandbox/dist/runner/browser.d.ts +50 -0
  555. package/plugins/microsandbox/dist/runner/browser.d.ts.map +1 -0
  556. package/plugins/microsandbox/dist/runner/browser.js +142 -0
  557. package/plugins/microsandbox/dist/runner/browser.js.map +1 -0
  558. package/plugins/microsandbox/dist/runner/free-port.d.ts +6 -0
  559. package/plugins/microsandbox/dist/runner/free-port.d.ts.map +1 -0
  560. package/plugins/microsandbox/dist/runner/free-port.js +53 -0
  561. package/plugins/microsandbox/dist/runner/free-port.js.map +1 -0
  562. package/plugins/microsandbox/dist/runner/index.d.ts +28 -0
  563. package/plugins/microsandbox/dist/runner/index.d.ts.map +1 -0
  564. package/plugins/microsandbox/dist/runner/index.js +72 -0
  565. package/plugins/microsandbox/dist/runner/index.js.map +1 -0
  566. package/plugins/microsandbox/dist/runner/microsandbox.d.ts +64 -0
  567. package/plugins/microsandbox/dist/runner/microsandbox.d.ts.map +1 -0
  568. package/plugins/microsandbox/dist/runner/microsandbox.js +668 -0
  569. package/plugins/microsandbox/dist/runner/microsandbox.js.map +1 -0
  570. package/plugins/microsandbox/dist/runner/nullable.d.ts +36 -0
  571. package/plugins/microsandbox/dist/runner/nullable.d.ts.map +1 -0
  572. package/plugins/microsandbox/dist/runner/nullable.js +82 -0
  573. package/plugins/microsandbox/dist/runner/nullable.js.map +1 -0
  574. package/plugins/microsandbox/dist/runner/pool.d.ts +97 -0
  575. package/plugins/microsandbox/dist/runner/pool.d.ts.map +1 -0
  576. package/plugins/microsandbox/dist/runner/pool.js +494 -0
  577. package/plugins/microsandbox/dist/runner/pool.js.map +1 -0
  578. package/plugins/microsandbox/dist/runner/types.d.ts +33 -0
  579. package/plugins/microsandbox/dist/runner/types.d.ts.map +1 -0
  580. package/plugins/microsandbox/dist/runner/types.js +79 -0
  581. package/plugins/microsandbox/dist/runner/types.js.map +1 -0
  582. package/plugins/microsandbox/dist/server.d.ts +7 -0
  583. package/plugins/microsandbox/dist/server.d.ts.map +1 -0
  584. package/plugins/microsandbox/dist/server.js +276 -0
  585. package/plugins/microsandbox/dist/server.js.map +1 -0
  586. package/plugins/microsandbox/dist/tools/browser.d.ts +25 -0
  587. package/plugins/microsandbox/dist/tools/browser.d.ts.map +1 -0
  588. package/plugins/microsandbox/dist/tools/browser.js +78 -0
  589. package/plugins/microsandbox/dist/tools/browser.js.map +1 -0
  590. package/plugins/microsandbox/dist/tools/build.d.ts +5 -0
  591. package/plugins/microsandbox/dist/tools/build.d.ts.map +1 -0
  592. package/plugins/microsandbox/dist/tools/build.js +243 -0
  593. package/plugins/microsandbox/dist/tools/build.js.map +1 -0
  594. package/plugins/microsandbox/dist/tools/index.d.ts +9 -0
  595. package/plugins/microsandbox/dist/tools/index.d.ts.map +1 -0
  596. package/plugins/microsandbox/dist/tools/index.js +430 -0
  597. package/plugins/microsandbox/dist/tools/index.js.map +1 -0
  598. package/plugins/microsandbox/dist/tools/mcp-client.d.ts +63 -0
  599. package/plugins/microsandbox/dist/tools/mcp-client.d.ts.map +1 -0
  600. package/plugins/microsandbox/dist/tools/mcp-client.js +226 -0
  601. package/plugins/microsandbox/dist/tools/mcp-client.js.map +1 -0
  602. package/plugins/microsandbox/manifest.json +177 -0
  603. package/plugins/microsandbox/package.json +38 -0
  604. package/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
  605. package/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
  606. package/plugins/microsandbox/skills/microsandbox-config.md +38 -0
  607. package/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
  608. package/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
  609. package/plugins/microsandbox/templates/README.md +26 -0
  610. package/plugins/web-search/dist/server.d.ts +4 -0
  611. package/plugins/web-search/dist/server.d.ts.map +1 -0
  612. package/plugins/web-search/dist/server.js +73 -0
  613. package/plugins/web-search/dist/server.js.map +1 -0
  614. package/plugins/web-search/dist/tools/health.d.ts +31 -0
  615. package/plugins/web-search/dist/tools/health.d.ts.map +1 -0
  616. package/plugins/web-search/dist/tools/health.js +59 -0
  617. package/plugins/web-search/dist/tools/health.js.map +1 -0
  618. package/plugins/web-search/dist/tools/index.d.ts +3 -0
  619. package/plugins/web-search/dist/tools/index.d.ts.map +1 -0
  620. package/plugins/web-search/dist/tools/index.js +2 -0
  621. package/plugins/web-search/dist/tools/index.js.map +1 -0
  622. package/plugins/web-search/dist/tools/providers.d.ts +43 -0
  623. package/plugins/web-search/dist/tools/providers.d.ts.map +1 -0
  624. package/plugins/web-search/dist/tools/providers.js +140 -0
  625. package/plugins/web-search/dist/tools/providers.js.map +1 -0
  626. package/plugins/web-search/dist/tools/web-search.d.ts +15 -0
  627. package/plugins/web-search/dist/tools/web-search.d.ts.map +1 -0
  628. package/plugins/web-search/dist/tools/web-search.js +244 -0
  629. package/plugins/web-search/dist/tools/web-search.js.map +1 -0
  630. package/plugins/web-search/manifest.json +65 -0
  631. package/plugins/web-search/node_modules/@esbuild/darwin-arm64/README.md +3 -0
  632. package/plugins/web-search/node_modules/@esbuild/darwin-arm64/package.json +20 -0
  633. package/plugins/web-search/node_modules/@vitest/expect/LICENSE +21 -0
  634. package/plugins/web-search/node_modules/@vitest/expect/README.md +21 -0
  635. package/plugins/web-search/node_modules/@vitest/expect/dist/index.d.ts +808 -0
  636. package/plugins/web-search/node_modules/@vitest/expect/dist/index.js +1799 -0
  637. package/plugins/web-search/node_modules/@vitest/expect/package.json +46 -0
  638. package/plugins/web-search/node_modules/@vitest/mocker/LICENSE +21 -0
  639. package/plugins/web-search/node_modules/@vitest/mocker/README.md +5 -0
  640. package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.d.ts +2 -0
  641. package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.js +9 -0
  642. package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.d.ts +53 -0
  643. package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.js +91 -0
  644. package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-interceptor-native.js +15 -0
  645. package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-mocker.js +1602 -0
  646. package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-pathe.M-eThtNZ.js +174 -0
  647. package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-registry.js +182 -0
  648. package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-utils.js +16 -0
  649. package/plugins/web-search/node_modules/@vitest/mocker/dist/index.d.ts +21 -0
  650. package/plugins/web-search/node_modules/@vitest/mocker/dist/index.js +174 -0
  651. package/plugins/web-search/node_modules/@vitest/mocker/dist/mocker.d-Ce9_ySj5.d.ts +83 -0
  652. package/plugins/web-search/node_modules/@vitest/mocker/dist/node.d.ts +821 -0
  653. package/plugins/web-search/node_modules/@vitest/mocker/dist/node.js +1306 -0
  654. package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.d.ts +3 -0
  655. package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.js +75 -0
  656. package/plugins/web-search/node_modules/@vitest/mocker/dist/register.d.ts +9 -0
  657. package/plugins/web-search/node_modules/@vitest/mocker/dist/register.js +41 -0
  658. package/plugins/web-search/node_modules/@vitest/mocker/dist/registry.d-D765pazg.d.ts +87 -0
  659. package/plugins/web-search/node_modules/@vitest/mocker/dist/types.d-D_aRZRdy.d.ts +8 -0
  660. package/plugins/web-search/node_modules/@vitest/mocker/package.json +82 -0
  661. package/plugins/web-search/node_modules/@vitest/pretty-format/LICENSE +21 -0
  662. package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.d.ts +119 -0
  663. package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.js +1387 -0
  664. package/plugins/web-search/node_modules/@vitest/pretty-format/package.json +44 -0
  665. package/plugins/web-search/node_modules/@vitest/runner/LICENSE +21 -0
  666. package/plugins/web-search/node_modules/@vitest/runner/README.md +5 -0
  667. package/plugins/web-search/node_modules/@vitest/runner/dist/chunk-hooks.js +2254 -0
  668. package/plugins/web-search/node_modules/@vitest/runner/dist/index.d.ts +261 -0
  669. package/plugins/web-search/node_modules/@vitest/runner/dist/index.js +6 -0
  670. package/plugins/web-search/node_modules/@vitest/runner/dist/tasks.d-CkscK4of.d.ts +558 -0
  671. package/plugins/web-search/node_modules/@vitest/runner/dist/types.d.ts +163 -0
  672. package/plugins/web-search/node_modules/@vitest/runner/dist/types.js +1 -0
  673. package/plugins/web-search/node_modules/@vitest/runner/dist/utils.d.ts +47 -0
  674. package/plugins/web-search/node_modules/@vitest/runner/dist/utils.js +6 -0
  675. package/plugins/web-search/node_modules/@vitest/runner/package.json +49 -0
  676. package/plugins/web-search/node_modules/@vitest/snapshot/LICENSE +21 -0
  677. package/plugins/web-search/node_modules/@vitest/snapshot/README.md +84 -0
  678. package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts +22 -0
  679. package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d.ts +16 -0
  680. package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.js +40 -0
  681. package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.d.ts +137 -0
  682. package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.js +2305 -0
  683. package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.d.ts +18 -0
  684. package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.js +73 -0
  685. package/plugins/web-search/node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
  686. package/plugins/web-search/node_modules/@vitest/snapshot/package.json +54 -0
  687. package/plugins/web-search/node_modules/@vitest/spy/LICENSE +21 -0
  688. package/plugins/web-search/node_modules/@vitest/spy/README.md +3 -0
  689. package/plugins/web-search/node_modules/@vitest/spy/dist/index.d.ts +356 -0
  690. package/plugins/web-search/node_modules/@vitest/spy/dist/index.js +191 -0
  691. package/plugins/web-search/node_modules/@vitest/spy/package.json +38 -0
  692. package/plugins/web-search/node_modules/@vitest/utils/LICENSE +21 -0
  693. package/plugins/web-search/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +158 -0
  694. package/plugins/web-search/node_modules/@vitest/utils/dist/diff.d.ts +104 -0
  695. package/plugins/web-search/node_modules/@vitest/utils/dist/diff.js +2185 -0
  696. package/plugins/web-search/node_modules/@vitest/utils/dist/error.d.ts +9 -0
  697. package/plugins/web-search/node_modules/@vitest/utils/dist/error.js +162 -0
  698. package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.d.ts +56 -0
  699. package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.js +251 -0
  700. package/plugins/web-search/node_modules/@vitest/utils/dist/index.d.ts +57 -0
  701. package/plugins/web-search/node_modules/@vitest/utils/dist/index.js +633 -0
  702. package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.d.ts +139 -0
  703. package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.js +996 -0
  704. package/plugins/web-search/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts +53 -0
  705. package/plugins/web-search/node_modules/@vitest/utils/dist/types.d.ts +53 -0
  706. package/plugins/web-search/node_modules/@vitest/utils/dist/types.js +1 -0
  707. package/plugins/web-search/node_modules/@vitest/utils/package.json +77 -0
  708. package/plugins/web-search/node_modules/chai/LICENSE +21 -0
  709. package/plugins/web-search/node_modules/chai/README.md +162 -0
  710. package/plugins/web-search/node_modules/chai/package.json +74 -0
  711. package/plugins/web-search/node_modules/esbuild/README.md +3 -0
  712. package/plugins/web-search/node_modules/esbuild/package.json +49 -0
  713. package/plugins/web-search/node_modules/std-env/README.md +118 -0
  714. package/plugins/web-search/node_modules/std-env/dist/index.cjs +1 -0
  715. package/plugins/web-search/node_modules/std-env/dist/index.d.cts +92 -0
  716. package/plugins/web-search/node_modules/std-env/dist/index.d.mts +92 -0
  717. package/plugins/web-search/node_modules/std-env/dist/index.d.ts +92 -0
  718. package/plugins/web-search/node_modules/std-env/dist/index.mjs +1 -0
  719. package/plugins/web-search/node_modules/std-env/package.json +46 -0
  720. package/plugins/web-search/node_modules/tinyexec/LICENSE +21 -0
  721. package/plugins/web-search/node_modules/tinyexec/README.md +256 -0
  722. package/plugins/web-search/node_modules/tinyexec/dist/main.cjs +575 -0
  723. package/plugins/web-search/node_modules/tinyexec/dist/main.d.cts +70 -0
  724. package/plugins/web-search/node_modules/tinyexec/dist/main.d.ts +70 -0
  725. package/plugins/web-search/node_modules/tinyexec/dist/main.js +578 -0
  726. package/plugins/web-search/node_modules/tinyexec/package.json +66 -0
  727. package/plugins/web-search/node_modules/tinyrainbow/README.md +28 -0
  728. package/plugins/web-search/node_modules/tinyrainbow/dist/browser.d.ts +8 -0
  729. package/plugins/web-search/node_modules/tinyrainbow/dist/browser.js +20 -0
  730. package/plugins/web-search/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +90 -0
  731. package/plugins/web-search/node_modules/tinyrainbow/dist/index-8b61d5bc.d.ts +59 -0
  732. package/plugins/web-search/node_modules/tinyrainbow/dist/node.d.ts +8 -0
  733. package/plugins/web-search/node_modules/tinyrainbow/dist/node.js +22 -0
  734. package/plugins/web-search/node_modules/tinyrainbow/package.json +37 -0
  735. package/plugins/web-search/node_modules/typescript/README.md +50 -0
  736. package/plugins/web-search/node_modules/typescript/package.json +120 -0
  737. package/plugins/web-search/node_modules/vite/README.md +20 -0
  738. package/plugins/web-search/node_modules/vite/dist/client/client.mjs +1106 -0
  739. package/plugins/web-search/node_modules/vite/dist/client/env.mjs +19 -0
  740. package/plugins/web-search/node_modules/vite/dist/node/chunks/build.js +4 -0
  741. package/plugins/web-search/node_modules/vite/dist/node/chunks/build2.js +5538 -0
  742. package/plugins/web-search/node_modules/vite/dist/node/chunks/chunk.js +48 -0
  743. package/plugins/web-search/node_modules/vite/dist/node/chunks/config.js +36065 -0
  744. package/plugins/web-search/node_modules/vite/dist/node/chunks/config2.js +4 -0
  745. package/plugins/web-search/node_modules/vite/dist/node/chunks/dist.js +6758 -0
  746. package/plugins/web-search/node_modules/vite/dist/node/chunks/lib.js +377 -0
  747. package/plugins/web-search/node_modules/vite/dist/node/chunks/logger.js +329 -0
  748. package/plugins/web-search/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
  749. package/plugins/web-search/node_modules/vite/dist/node/chunks/optimizer.js +4 -0
  750. package/plugins/web-search/node_modules/vite/dist/node/chunks/postcss-import.js +479 -0
  751. package/plugins/web-search/node_modules/vite/dist/node/chunks/preview.js +4 -0
  752. package/plugins/web-search/node_modules/vite/dist/node/chunks/server.js +4 -0
  753. package/plugins/web-search/node_modules/vite/dist/node/cli.js +698 -0
  754. package/plugins/web-search/node_modules/vite/dist/node/index.d.ts +3717 -0
  755. package/plugins/web-search/node_modules/vite/dist/node/index.js +30 -0
  756. package/plugins/web-search/node_modules/vite/dist/node/module-runner.d.ts +311 -0
  757. package/plugins/web-search/node_modules/vite/dist/node/module-runner.js +1160 -0
  758. package/plugins/web-search/node_modules/vite/package.json +199 -0
  759. package/plugins/web-search/node_modules/vite/types/package.json +4 -0
  760. package/plugins/web-search/node_modules/vitest/README.md +7 -0
  761. package/plugins/web-search/node_modules/vitest/dist/browser.d.ts +34 -0
  762. package/plugins/web-search/node_modules/vitest/dist/browser.js +8 -0
  763. package/plugins/web-search/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +7 -0
  764. package/plugins/web-search/node_modules/vitest/dist/chunks/base.DfmxU-tU.js +38 -0
  765. package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +37 -0
  766. package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.d.BwvBVTda.d.ts +24 -0
  767. package/plugins/web-search/node_modules/vitest/dist/chunks/cac.0BJqEUeA.js +1469 -0
  768. package/plugins/web-search/node_modules/vitest/dist/chunks/cli-api.DWGBtMmz.js +10660 -0
  769. package/plugins/web-search/node_modules/vitest/dist/chunks/config.d.BKdhh7Zx.d.ts +224 -0
  770. package/plugins/web-search/node_modules/vitest/dist/chunks/console.CtFJOzRO.js +153 -0
  771. package/plugins/web-search/node_modules/vitest/dist/chunks/constants.DnKduX2e.js +44 -0
  772. package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DVF1vEu8.js +25 -0
  773. package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DfSpMS-b.js +4350 -0
  774. package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
  775. package/plugins/web-search/node_modules/vitest/dist/chunks/creator.GK6I-cL4.js +640 -0
  776. package/plugins/web-search/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +73 -0
  777. package/plugins/web-search/node_modules/vitest/dist/chunks/defaults.B7q_naMc.js +115 -0
  778. package/plugins/web-search/node_modules/vitest/dist/chunks/env.D4Lgay0q.js +8 -0
  779. package/plugins/web-search/node_modules/vitest/dist/chunks/environment.d.cL3nLXbE.d.ts +119 -0
  780. package/plugins/web-search/node_modules/vitest/dist/chunks/execute.B7h3T_Hc.js +708 -0
  781. package/plugins/web-search/node_modules/vitest/dist/chunks/git.BVQ8w_Sw.js +72 -0
  782. package/plugins/web-search/node_modules/vitest/dist/chunks/global.d.MAmajcmJ.d.ts +136 -0
  783. package/plugins/web-search/node_modules/vitest/dist/chunks/globals.DEHgCU4V.js +26 -0
  784. package/plugins/web-search/node_modules/vitest/dist/chunks/index.B521nVV-.js +157 -0
  785. package/plugins/web-search/node_modules/vitest/dist/chunks/index.BCWujgDG.js +231 -0
  786. package/plugins/web-search/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +37 -0
  787. package/plugins/web-search/node_modules/vitest/dist/chunks/index.CmSc2RE5.js +587 -0
  788. package/plugins/web-search/node_modules/vitest/dist/chunks/index.CwejwG0H.js +105 -0
  789. package/plugins/web-search/node_modules/vitest/dist/chunks/index.D3XRDfWc.js +213 -0
  790. package/plugins/web-search/node_modules/vitest/dist/chunks/index.VByaPkjc.js +2183 -0
  791. package/plugins/web-search/node_modules/vitest/dist/chunks/index.X0nbfr6-.js +6584 -0
  792. package/plugins/web-search/node_modules/vitest/dist/chunks/inspector.C914Efll.js +57 -0
  793. package/plugins/web-search/node_modules/vitest/dist/chunks/mocker.d.BE_2ls6u.d.ts +17 -0
  794. package/plugins/web-search/node_modules/vitest/dist/chunks/node.fjCdwEIl.js +15 -0
  795. package/plugins/web-search/node_modules/vitest/dist/chunks/reporters.d.BuRON0I0.d.ts +3168 -0
  796. package/plugins/web-search/node_modules/vitest/dist/chunks/rpc.-pEldfrD.js +83 -0
  797. package/plugins/web-search/node_modules/vitest/dist/chunks/runBaseTests.9Ij9_de-.js +129 -0
  798. package/plugins/web-search/node_modules/vitest/dist/chunks/setup-common.Dd054P77.js +60 -0
  799. package/plugins/web-search/node_modules/vitest/dist/chunks/suite.d.FvehnV49.d.ts +10 -0
  800. package/plugins/web-search/node_modules/vitest/dist/chunks/typechecker.DRKU1-1g.js +874 -0
  801. package/plugins/web-search/node_modules/vitest/dist/chunks/utils.CAioKnHs.js +61 -0
  802. package/plugins/web-search/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +65 -0
  803. package/plugins/web-search/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +4015 -0
  804. package/plugins/web-search/node_modules/vitest/dist/chunks/vite.d.BnOPPc46.d.ts +25 -0
  805. package/plugins/web-search/node_modules/vitest/dist/chunks/vm.BThCzidc.js +756 -0
  806. package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.CUgIPz9V.d.ts +176 -0
  807. package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.uzWsCv9X.d.ts +8 -0
  808. package/plugins/web-search/node_modules/vitest/dist/cli.js +27 -0
  809. package/plugins/web-search/node_modules/vitest/dist/config.cjs +148 -0
  810. package/plugins/web-search/node_modules/vitest/dist/config.d.ts +100 -0
  811. package/plugins/web-search/node_modules/vitest/dist/config.js +21 -0
  812. package/plugins/web-search/node_modules/vitest/dist/coverage.d.ts +108 -0
  813. package/plugins/web-search/node_modules/vitest/dist/coverage.js +34 -0
  814. package/plugins/web-search/node_modules/vitest/dist/environments.d.ts +26 -0
  815. package/plugins/web-search/node_modules/vitest/dist/environments.js +2 -0
  816. package/plugins/web-search/node_modules/vitest/dist/execute.d.ts +150 -0
  817. package/plugins/web-search/node_modules/vitest/dist/execute.js +13 -0
  818. package/plugins/web-search/node_modules/vitest/dist/index.d.ts +651 -0
  819. package/plugins/web-search/node_modules/vitest/dist/index.js +18 -0
  820. package/plugins/web-search/node_modules/vitest/dist/mocker.d.ts +1 -0
  821. package/plugins/web-search/node_modules/vitest/dist/mocker.js +1 -0
  822. package/plugins/web-search/node_modules/vitest/dist/node.d.ts +158 -0
  823. package/plugins/web-search/node_modules/vitest/dist/node.js +105 -0
  824. package/plugins/web-search/node_modules/vitest/dist/path.js +7 -0
  825. package/plugins/web-search/node_modules/vitest/dist/reporters.d.ts +25 -0
  826. package/plugins/web-search/node_modules/vitest/dist/reporters.js +23 -0
  827. package/plugins/web-search/node_modules/vitest/dist/runners.d.ts +46 -0
  828. package/plugins/web-search/node_modules/vitest/dist/runners.js +235 -0
  829. package/plugins/web-search/node_modules/vitest/dist/snapshot.d.ts +9 -0
  830. package/plugins/web-search/node_modules/vitest/dist/snapshot.js +4 -0
  831. package/plugins/web-search/node_modules/vitest/dist/spy.js +1 -0
  832. package/plugins/web-search/node_modules/vitest/dist/suite.d.ts +5 -0
  833. package/plugins/web-search/node_modules/vitest/dist/suite.js +5 -0
  834. package/plugins/web-search/node_modules/vitest/dist/worker.js +124 -0
  835. package/plugins/web-search/node_modules/vitest/dist/workers/forks.js +43 -0
  836. package/plugins/web-search/node_modules/vitest/dist/workers/runVmTests.js +90 -0
  837. package/plugins/web-search/node_modules/vitest/dist/workers/threads.js +31 -0
  838. package/plugins/web-search/node_modules/vitest/dist/workers/vmForks.js +47 -0
  839. package/plugins/web-search/node_modules/vitest/dist/workers/vmThreads.js +37 -0
  840. package/plugins/web-search/node_modules/vitest/dist/workers.d.ts +40 -0
  841. package/plugins/web-search/node_modules/vitest/dist/workers.js +30 -0
  842. package/plugins/web-search/node_modules/vitest/package.json +207 -0
  843. package/plugins/web-search/package.json +30 -0
  844. package/plugins/web-search/skills/web-search-howto.md +69 -0
  845. package/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
  846. package/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
  847. package/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
  848. package/plugins/workboard/dist/client.d.ts +5 -0
  849. package/plugins/workboard/dist/client.d.ts.map +1 -0
  850. package/plugins/workboard/dist/client.js +895 -0
  851. package/plugins/workboard/dist/client.js.map +1 -0
  852. package/plugins/workboard/dist/db/agents.d.ts +100 -0
  853. package/plugins/workboard/dist/db/agents.d.ts.map +1 -0
  854. package/plugins/workboard/dist/db/agents.js +280 -0
  855. package/plugins/workboard/dist/db/agents.js.map +1 -0
  856. package/plugins/workboard/dist/db/schema.d.ts +3 -0
  857. package/plugins/workboard/dist/db/schema.d.ts.map +1 -0
  858. package/plugins/workboard/dist/db/schema.js +31 -0
  859. package/plugins/workboard/dist/db/schema.js.map +1 -0
  860. package/plugins/workboard/dist/db/session-history.d.ts +28 -0
  861. package/plugins/workboard/dist/db/session-history.d.ts.map +1 -0
  862. package/plugins/workboard/dist/db/session-history.js +224 -0
  863. package/plugins/workboard/dist/db/session-history.js.map +1 -0
  864. package/plugins/workboard/dist/db/tasks.d.ts +260 -0
  865. package/plugins/workboard/dist/db/tasks.d.ts.map +1 -0
  866. package/plugins/workboard/dist/db/tasks.js +451 -0
  867. package/plugins/workboard/dist/db/tasks.js.map +1 -0
  868. package/plugins/workboard/dist/db/worker-agents.d.ts +16 -0
  869. package/plugins/workboard/dist/db/worker-agents.d.ts.map +1 -0
  870. package/plugins/workboard/dist/db/worker-agents.js +62 -0
  871. package/plugins/workboard/dist/db/worker-agents.js.map +1 -0
  872. package/plugins/workboard/dist/effective-skills.d.ts +13 -0
  873. package/plugins/workboard/dist/effective-skills.d.ts.map +1 -0
  874. package/plugins/workboard/dist/effective-skills.js +126 -0
  875. package/plugins/workboard/dist/effective-skills.js.map +1 -0
  876. package/plugins/workboard/dist/fs-worker-agents.d.ts +35 -0
  877. package/plugins/workboard/dist/fs-worker-agents.d.ts.map +1 -0
  878. package/plugins/workboard/dist/fs-worker-agents.js +199 -0
  879. package/plugins/workboard/dist/fs-worker-agents.js.map +1 -0
  880. package/plugins/workboard/dist/migrate-worker-agents.d.ts +11 -0
  881. package/plugins/workboard/dist/migrate-worker-agents.d.ts.map +1 -0
  882. package/plugins/workboard/dist/migrate-worker-agents.js +89 -0
  883. package/plugins/workboard/dist/migrate-worker-agents.js.map +1 -0
  884. package/plugins/workboard/dist/routes/handlers.d.ts +106 -0
  885. package/plugins/workboard/dist/routes/handlers.d.ts.map +1 -0
  886. package/plugins/workboard/dist/routes/handlers.js +668 -0
  887. package/plugins/workboard/dist/routes/handlers.js.map +1 -0
  888. package/plugins/workboard/dist/server.d.ts +6 -0
  889. package/plugins/workboard/dist/server.d.ts.map +1 -0
  890. package/plugins/workboard/dist/server.js +368 -0
  891. package/plugins/workboard/dist/server.js.map +1 -0
  892. package/plugins/workboard/dist/tools/index.d.ts +70 -0
  893. package/plugins/workboard/dist/tools/index.d.ts.map +1 -0
  894. package/plugins/workboard/dist/tools/index.js +963 -0
  895. package/plugins/workboard/dist/tools/index.js.map +1 -0
  896. package/plugins/workboard/dist/types.d.ts +27 -0
  897. package/plugins/workboard/dist/types.d.ts.map +1 -0
  898. package/plugins/workboard/dist/types.js +16 -0
  899. package/plugins/workboard/dist/types.js.map +1 -0
  900. package/plugins/workboard/dist/worker/pool.d.ts +220 -0
  901. package/plugins/workboard/dist/worker/pool.d.ts.map +1 -0
  902. package/plugins/workboard/dist/worker/pool.js +866 -0
  903. package/plugins/workboard/dist/worker/pool.js.map +1 -0
  904. package/plugins/workboard/dist/worker/tool-policy.d.ts +27 -0
  905. package/plugins/workboard/dist/worker/tool-policy.d.ts.map +1 -0
  906. package/plugins/workboard/dist/worker/tool-policy.js +76 -0
  907. package/plugins/workboard/dist/worker/tool-policy.js.map +1 -0
  908. package/plugins/workboard/dist/worker-agents-page.d.ts +4 -0
  909. package/plugins/workboard/dist/worker-agents-page.d.ts.map +1 -0
  910. package/plugins/workboard/dist/worker-agents-page.js +193 -0
  911. package/plugins/workboard/dist/worker-agents-page.js.map +1 -0
  912. package/plugins/workboard/manifest.json +180 -0
  913. package/plugins/workboard/package.json +37 -0
  914. package/plugins/workboard/skills/large-input-large-output.md +185 -0
  915. package/plugins/workboard/skills/workboard-howto.md +166 -0
  916. package/plugins/workboard/skills/worker-creator.md +267 -0
  917. package/plugins/workboard/skills/worker-fleet.md +431 -0
@@ -0,0 +1,3717 @@
1
+ /// <reference types="node" />
2
+ import { t as ModuleRunnerTransport } from "./chunks/moduleRunnerTransport.js";
3
+ import { ConnectedPayload, CustomPayload, CustomPayload as hmrPayload_CustomPayload, ErrorPayload, FullReloadPayload, HMRPayload, HotPayload, HotPayload as hmrPayload_HotPayload, PrunePayload, Update, UpdatePayload } from "#types/hmrPayload";
4
+ import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmrPayload_InferCustomEventPayload, InvalidatePayload } from "#types/customEvent";
5
+ import * as Rollup from "rollup";
6
+ import { CustomPluginOptions, ExistingRawSourceMap, InputOption, InputOptions, LoadResult, MinimalPluginContext, ModuleFormat, ModuleInfo, ObjectHook, OutputBundle, OutputChunk, PartialResolvedId, PluginContext, PluginContextMeta, PluginHooks, ResolveIdResult, RollupError, RollupLog, RollupOptions, RollupOutput, RollupWatcher, SourceDescription, SourceMap, SourceMapInput, TransformPluginContext, WatcherOptions } from "rollup";
7
+ import { parseAst, parseAstAsync } from "rollup/parseAst";
8
+ import * as http from "node:http";
9
+ import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
10
+ import { Http2SecureServer } from "node:http2";
11
+ import * as fs from "node:fs";
12
+ import { EventEmitter } from "node:events";
13
+ import { Server as HttpsServer, ServerOptions as HttpsServerOptions } from "node:https";
14
+ import * as net from "node:net";
15
+ import { Duplex, DuplexOptions, Stream } from "node:stream";
16
+ import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as moduleRunner_FetchResult, ModuleEvaluator, ModuleRunner, ModuleRunnerHmr, ModuleRunnerOptions } from "vite/module-runner";
17
+ import { BuildOptions as esbuild_BuildOptions, TransformOptions as EsbuildTransformOptions, TransformOptions as esbuild_TransformOptions, TransformResult as esbuild_TransformResult, version as esbuildVersion } from "esbuild";
18
+ import { SecureContextOptions } from "node:tls";
19
+ import { URL as url_URL } from "node:url";
20
+ import { ZlibOptions } from "node:zlib";
21
+ import { Terser, TerserMinifyOptions } from "#types/internal/terserOptions";
22
+ import * as PostCSS from "postcss";
23
+ import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "#types/internal/cssPreprocessorOptions";
24
+ import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "#types/internal/lightningcssOptions";
25
+ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap } from "#types/importGlob";
26
+ import { ChunkMetadata, CustomPluginOptionsVite } from "#types/metadata";
27
+
28
+ //#region rolldown:runtime
29
+
30
+ //#endregion
31
+ //#region src/types/alias.d.ts
32
+ interface Alias {
33
+ find: string | RegExp;
34
+ replacement: string;
35
+ /**
36
+ * Instructs the plugin to use an alternative resolving algorithm,
37
+ * rather than the Rollup's resolver.
38
+ * @default null
39
+ */
40
+ customResolver?: ResolverFunction | ResolverObject | null;
41
+ }
42
+ type MapToFunction<T$1> = T$1 extends Function ? T$1 : never;
43
+ type ResolverFunction = MapToFunction<PluginHooks['resolveId']>;
44
+ interface ResolverObject {
45
+ buildStart?: PluginHooks['buildStart'];
46
+ resolveId: ResolverFunction;
47
+ }
48
+ /**
49
+ * Specifies an `Object`, or an `Array` of `Object`,
50
+ * which defines aliases used to replace values in `import` or `require` statements.
51
+ * With either format, the order of the entries is important,
52
+ * in that the first defined rules are applied first.
53
+ *
54
+ * This is passed to \@rollup/plugin-alias as the "entries" field
55
+ * https://github.com/rollup/plugins/tree/master/packages/alias#entries
56
+ */
57
+ type AliasOptions = readonly Alias[] | {
58
+ [find: string]: string;
59
+ };
60
+ //#endregion
61
+ //#region src/types/anymatch.d.ts
62
+ type AnymatchFn = (testString: string) => boolean;
63
+ type AnymatchPattern = string | RegExp | AnymatchFn;
64
+ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[];
65
+ //#endregion
66
+ //#region src/types/chokidar.d.ts
67
+ declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
68
+ options: WatchOptions;
69
+
70
+ /**
71
+ * Constructs a new FSWatcher instance with optional WatchOptions parameter.
72
+ */
73
+ constructor(options?: WatchOptions);
74
+
75
+ /**
76
+ * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
77
+ * Calling watcher.ref() multiple times will have no effect.
78
+ */
79
+ ref(): this;
80
+
81
+ /**
82
+ * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
83
+ * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
84
+ * Calling watcher.unref() multiple times will have no effect.
85
+ */
86
+ unref(): this;
87
+
88
+ /**
89
+ * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
90
+ * string.
91
+ */
92
+ add(paths: string | ReadonlyArray<string>): this;
93
+
94
+ /**
95
+ * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
96
+ * string.
97
+ */
98
+ unwatch(paths: string | ReadonlyArray<string>): this;
99
+
100
+ /**
101
+ * Returns an object representing all the paths on the file system being watched by this
102
+ * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
103
+ * the `cwd` option was used), and the values are arrays of the names of the items contained in
104
+ * each directory.
105
+ */
106
+ getWatched(): {
107
+ [directory: string]: string[];
108
+ };
109
+
110
+ /**
111
+ * Removes all listeners from watched files.
112
+ */
113
+ close(): Promise<void>;
114
+ on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
115
+ on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
116
+
117
+ /**
118
+ * Error occurred
119
+ */
120
+ on(event: 'error', listener: (error: Error) => void): this;
121
+
122
+ /**
123
+ * Exposes the native Node `fs.FSWatcher events`
124
+ */
125
+ on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
126
+
127
+ /**
128
+ * Fires when the initial scan is complete
129
+ */
130
+ on(event: 'ready', listener: () => void): this;
131
+ on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
132
+ on(event: string, listener: (...args: any[]) => void): this;
133
+ }
134
+ interface WatchOptions {
135
+ /**
136
+ * Indicates whether the process should continue to run as long as files are being watched. If
137
+ * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
138
+ * even if the process continues to run.
139
+ */
140
+ persistent?: boolean;
141
+
142
+ /**
143
+ * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
144
+ * be ignored. The whole relative or absolute path is tested, not just filename. If a function
145
+ * with two arguments is provided, it gets called twice per path - once with a single argument
146
+ * (the path), second time with two arguments (the path and the
147
+ * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
148
+ */
149
+ ignored?: AnymatchMatcher;
150
+
151
+ /**
152
+ * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
153
+ * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
154
+ */
155
+ ignoreInitial?: boolean;
156
+
157
+ /**
158
+ * When `false`, only the symlinks themselves will be watched for changes instead of following
159
+ * the link references and bubbling events through the link's path.
160
+ */
161
+ followSymlinks?: boolean;
162
+
163
+ /**
164
+ * The base directory from which watch `paths` are to be derived. Paths emitted with events will
165
+ * be relative to this.
166
+ */
167
+ cwd?: string;
168
+
169
+ /**
170
+ * If set to true then the strings passed to .watch() and .add() are treated as literal path
171
+ * names, even if they look like globs.
172
+ *
173
+ * @default false
174
+ */
175
+ disableGlobbing?: boolean;
176
+
177
+ /**
178
+ * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
179
+ * utilization, consider setting this to `false`. It is typically necessary to **set this to
180
+ * `true` to successfully watch files over a network**, and it may be necessary to successfully
181
+ * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
182
+ * the `useFsEvents` default.
183
+ */
184
+ usePolling?: boolean;
185
+
186
+ /**
187
+ * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
188
+ * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
189
+ * OS X, `usePolling: true` becomes the default.
190
+ */
191
+ useFsEvents?: boolean;
192
+
193
+ /**
194
+ * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
195
+ * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
196
+ * provided even in cases where it wasn't already available from the underlying watch events.
197
+ */
198
+ alwaysStat?: boolean;
199
+
200
+ /**
201
+ * If set, limits how many levels of subdirectories will be traversed.
202
+ */
203
+ depth?: number;
204
+
205
+ /**
206
+ * Interval of file system polling.
207
+ */
208
+ interval?: number;
209
+
210
+ /**
211
+ * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
212
+ * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
213
+ */
214
+ binaryInterval?: number;
215
+
216
+ /**
217
+ * Indicates whether to watch files that don't have read permissions if possible. If watching
218
+ * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
219
+ * silently.
220
+ */
221
+ ignorePermissionErrors?: boolean;
222
+
223
+ /**
224
+ * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
225
+ * that occur when using editors that use "atomic writes" instead of writing directly to the
226
+ * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
227
+ * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
228
+ * you can override it by setting `atomic` to a custom value, in milliseconds.
229
+ */
230
+ atomic?: boolean | number;
231
+
232
+ /**
233
+ * can be set to an object in order to adjust timing params:
234
+ */
235
+ awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
236
+ }
237
+ interface AwaitWriteFinishOptions {
238
+ /**
239
+ * Amount of time in milliseconds for a file size to remain constant before emitting its event.
240
+ */
241
+ stabilityThreshold?: number;
242
+
243
+ /**
244
+ * File size polling interval.
245
+ */
246
+ pollInterval?: number;
247
+ }
248
+ //#endregion
249
+ //#region src/types/connect.d.ts
250
+ declare namespace Connect {
251
+ export type ServerHandle = HandleFunction | http.Server;
252
+ export class IncomingMessage extends http.IncomingMessage {
253
+ originalUrl?: http.IncomingMessage['url'] | undefined;
254
+ }
255
+ export type NextFunction = (err?: any) => void;
256
+ export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
257
+ export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
258
+ export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
259
+ export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
260
+ export interface ServerStackItem {
261
+ route: string;
262
+ handle: ServerHandle;
263
+ }
264
+ export interface Server extends NodeJS.EventEmitter {
265
+ (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
266
+ route: string;
267
+ stack: ServerStackItem[];
268
+
269
+ /**
270
+ * Utilize the given middleware `handle` to the given `route`,
271
+ * defaulting to _/_. This "route" is the mount-point for the
272
+ * middleware, when given a value other than _/_ the middleware
273
+ * is only effective when that segment is present in the request's
274
+ * pathname.
275
+ *
276
+ * For example if we were to mount a function at _/admin_, it would
277
+ * be invoked on _/admin_, and _/admin/settings_, however it would
278
+ * not be invoked for _/_, or _/posts_.
279
+ */
280
+ use(fn: NextHandleFunction): Server;
281
+ use(fn: HandleFunction): Server;
282
+ use(route: string, fn: NextHandleFunction): Server;
283
+ use(route: string, fn: HandleFunction): Server;
284
+
285
+ /**
286
+ * Handle server requests, punting them down
287
+ * the middleware stack.
288
+ */
289
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
290
+
291
+ /**
292
+ * Listen for connections.
293
+ *
294
+ * This method takes the same arguments
295
+ * as node's `http.Server#listen()`.
296
+ *
297
+ * HTTP and HTTPS:
298
+ *
299
+ * If you run your application both as HTTP
300
+ * and HTTPS you may wrap them individually,
301
+ * since your Connect "server" is really just
302
+ * a JavaScript `Function`.
303
+ *
304
+ * var connect = require('connect')
305
+ * , http = require('http')
306
+ * , https = require('https');
307
+ *
308
+ * var app = connect();
309
+ *
310
+ * http.createServer(app).listen(80);
311
+ * https.createServer(options, app).listen(443);
312
+ */
313
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
314
+ listen(port: number, hostname?: string, callback?: Function): http.Server;
315
+ listen(path: string, callback?: Function): http.Server;
316
+ listen(handle: any, listeningListener?: Function): http.Server;
317
+ }
318
+ }
319
+ //#endregion
320
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.22.0_patch_hash=d89dff5a0afc2cb277080ad056a3baf7feeeeac19144878abc17f4c91ad89095_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/index.d.ts
321
+ interface ProxyTargetDetailed {
322
+ host: string;
323
+ port: number;
324
+ protocol?: string;
325
+ hostname?: string;
326
+ socketPath?: string;
327
+ key?: string;
328
+ passphrase?: string;
329
+ pfx?: Buffer | string;
330
+ cert?: string;
331
+ ca?: string;
332
+ ciphers?: string;
333
+ secureProtocol?: string;
334
+ }
335
+ type ProxyType = "ws" | "web";
336
+ type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
337
+ type ProxyTargetUrl = URL | string | {
338
+ port: number;
339
+ host: string;
340
+ protocol?: string;
341
+ };
342
+ type NormalizeProxyTarget<T$1 extends ProxyTargetUrl> = Exclude<T$1, string> | URL;
343
+ interface ServerOptions$3 {
344
+ /** URL string to be parsed with the url module. */
345
+ target?: ProxyTarget;
346
+ /** URL string to be parsed with the url module or a URL object. */
347
+ forward?: ProxyTargetUrl;
348
+ /** Object to be passed to http(s).request. */
349
+ agent?: any;
350
+ /** Object to be passed to https.createServer(). */
351
+ ssl?: any;
352
+ /** If you want to proxy websockets. */
353
+ ws?: boolean;
354
+ /** Adds x- forward headers. */
355
+ xfwd?: boolean;
356
+ /** Verify SSL certificate. */
357
+ secure?: boolean;
358
+ /** Explicitly specify if we are proxying to another proxy. */
359
+ toProxy?: boolean;
360
+ /** Specify whether you want to prepend the target's path to the proxy path. */
361
+ prependPath?: boolean;
362
+ /** Specify whether you want to ignore the proxy path of the incoming request. */
363
+ ignorePath?: boolean;
364
+ /** Local interface string to bind for outgoing connections. */
365
+ localAddress?: string;
366
+ /** Changes the origin of the host header to the target URL. */
367
+ changeOrigin?: boolean;
368
+ /** specify whether you want to keep letter case of response header key */
369
+ preserveHeaderKeyCase?: boolean;
370
+ /** Basic authentication i.e. 'user:password' to compute an Authorization header. */
371
+ auth?: string;
372
+ /** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
373
+ hostRewrite?: string;
374
+ /** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
375
+ autoRewrite?: boolean;
376
+ /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
377
+ protocolRewrite?: string;
378
+ /** rewrites domain of set-cookie headers. */
379
+ cookieDomainRewrite?: false | string | {
380
+ [oldDomain: string]: string;
381
+ };
382
+ /** rewrites path of set-cookie headers. Default: false */
383
+ cookiePathRewrite?: false | string | {
384
+ [oldPath: string]: string;
385
+ };
386
+ /** object with extra headers to be added to target requests. */
387
+ headers?: {
388
+ [header: string]: string | string[] | undefined;
389
+ };
390
+ /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
391
+ proxyTimeout?: number;
392
+ /** Timeout (in milliseconds) for incoming requests */
393
+ timeout?: number;
394
+ /** Specify whether you want to follow redirects. Default: false */
395
+ followRedirects?: boolean;
396
+ /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
397
+ selfHandleResponse?: boolean;
398
+ /** Buffer */
399
+ buffer?: Stream;
400
+ /** Explicitly set the method type of the ProxyReq */
401
+ method?: string;
402
+ /**
403
+ * Optionally override the trusted CA certificates.
404
+ * This is passed to https.request.
405
+ */
406
+ ca?: string;
407
+ }
408
+ interface NormalizedServerOptions extends ServerOptions$3 {
409
+ target?: NormalizeProxyTarget<ProxyTarget>;
410
+ forward?: NormalizeProxyTarget<ProxyTargetUrl>;
411
+ }
412
+ type ErrorCallback<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = (err: TError, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse> | net.Socket, target?: ProxyTargetUrl) => void;
413
+ type ProxyServerEventMap<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
414
+ error: Parameters<ErrorCallback<TIncomingMessage, TServerResponse, TError>>;
415
+ start: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
416
+ open: [socket: net.Socket];
417
+ proxyReq: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: ServerOptions$3, socket: net.Socket];
418
+ proxyRes: [proxyRes: InstanceType<TIncomingMessage>, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>];
419
+ proxyReqWs: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, socket: net.Socket, options: ServerOptions$3, head: any];
420
+ econnreset: [err: Error, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
421
+ end: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, proxyRes: InstanceType<TIncomingMessage>];
422
+ close: [proxyRes: InstanceType<TIncomingMessage>, proxySocket: net.Socket, proxyHead: any];
423
+ };
424
+ type ProxyMethodArgs<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
425
+ ws: [req: InstanceType<TIncomingMessage>, socket: any, head: any, ...args: [options?: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
426
+ web: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, ...args: [options: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
427
+ };
428
+ type PassFunctions<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
429
+ ws: (req: InstanceType<TIncomingMessage>, socket: net.Socket, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
430
+ web: (req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
431
+ };
432
+ declare class ProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> extends EventEmitter<ProxyServerEventMap<TIncomingMessage, TServerResponse, TError>> {
433
+ /**
434
+ * Used for proxying WS(S) requests
435
+ * @param req - Client request.
436
+ * @param socket - Client socket.
437
+ * @param head - Client head.
438
+ * @param options - Additional options.
439
+ */
440
+ readonly ws: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["ws"]) => void;
441
+ /**
442
+ * Used for proxying regular HTTP(S) requests
443
+ * @param req - Client request.
444
+ * @param res - Client response.
445
+ * @param options - Additional options.
446
+ */
447
+ readonly web: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["web"]) => void;
448
+ private options;
449
+ private webPasses;
450
+ private wsPasses;
451
+ private _server?;
452
+ /**
453
+ * Creates the proxy server with specified options.
454
+ * @param options - Config object passed to the proxy
455
+ */
456
+ constructor(options?: ServerOptions$3);
457
+ /**
458
+ * Creates the proxy server with specified options.
459
+ * @param options Config object passed to the proxy
460
+ * @returns Proxy object with handlers for `ws` and `web` requests
461
+ */
462
+ static createProxyServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
463
+ /**
464
+ * Creates the proxy server with specified options.
465
+ * @param options Config object passed to the proxy
466
+ * @returns Proxy object with handlers for `ws` and `web` requests
467
+ */
468
+ static createServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
469
+ /**
470
+ * Creates the proxy server with specified options.
471
+ * @param options Config object passed to the proxy
472
+ * @returns Proxy object with handlers for `ws` and `web` requests
473
+ */
474
+ static createProxy<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
475
+ createRightProxy: <PT extends ProxyType>(type: PT) => Function;
476
+ onError: (err: TError) => void;
477
+ /**
478
+ * A function that wraps the object in a webserver, for your convenience
479
+ * @param port - Port to listen on
480
+ * @param hostname - The hostname to listen on
481
+ */
482
+ listen: (port: number, hostname?: string) => this;
483
+ address: () => string | net.AddressInfo | null | undefined;
484
+ /**
485
+ * A function that closes the inner webserver and stops listening on given port
486
+ */
487
+ close: (cb?: Function) => void;
488
+ before: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
489
+ after: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
490
+ }
491
+ //#endregion
492
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.22.0_patch_hash=d89dff5a0afc2cb277080ad056a3baf7feeeeac19144878abc17f4c91ad89095_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.d.ts
493
+ declare function numOpenSockets(): number;
494
+ declare namespace index_d_exports {
495
+ export { ErrorCallback, ProxyServer, ProxyTarget, ProxyTargetUrl, ServerOptions$3 as ServerOptions, createProxyServer as createProxy, createProxyServer, createProxyServer as createServer, ProxyServer as default, numOpenSockets };
496
+ }
497
+ /**
498
+ * Creates the proxy server.
499
+ *
500
+ * Examples:
501
+ *
502
+ * httpProxy.createProxyServer({ .. }, 8000)
503
+ * // => '{ web: [Function], ws: [Function] ... }'
504
+ *
505
+ * @param {Object} Options Config object passed to the proxy
506
+ *
507
+ * @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests
508
+ *
509
+ * @api public
510
+ */
511
+ declare function createProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
512
+ //#endregion
513
+ //#region src/node/server/middlewares/proxy.d.ts
514
+ interface ProxyOptions extends ServerOptions$3 {
515
+ /**
516
+ * rewrite path
517
+ */
518
+ rewrite?: (path: string) => string;
519
+ /**
520
+ * configure the proxy server (e.g. listen to events)
521
+ */
522
+ configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
523
+ /**
524
+ * webpack-dev-server style bypass function
525
+ */
526
+ bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
527
+ /**
528
+ * rewrite the Origin header of a WebSocket request to match the target
529
+ *
530
+ * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
531
+ */
532
+ rewriteWsOrigin?: boolean | undefined;
533
+ }
534
+ //#endregion
535
+ //#region src/node/logger.d.ts
536
+ type LogType = "error" | "warn" | "info";
537
+ type LogLevel = LogType | "silent";
538
+ interface Logger {
539
+ info(msg: string, options?: LogOptions): void;
540
+ warn(msg: string, options?: LogOptions): void;
541
+ warnOnce(msg: string, options?: LogOptions): void;
542
+ error(msg: string, options?: LogErrorOptions): void;
543
+ clearScreen(type: LogType): void;
544
+ hasErrorLogged(error: Error | RollupError): boolean;
545
+ hasWarned: boolean;
546
+ }
547
+ interface LogOptions {
548
+ clear?: boolean;
549
+ timestamp?: boolean;
550
+ environment?: string;
551
+ }
552
+ interface LogErrorOptions extends LogOptions {
553
+ error?: Error | RollupError | null;
554
+ }
555
+ interface LoggerOptions {
556
+ prefix?: string;
557
+ allowClearScreen?: boolean;
558
+ customLogger?: Logger;
559
+ console?: Console;
560
+ }
561
+ declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
562
+ //#endregion
563
+ //#region src/node/http.d.ts
564
+ interface CommonServerOptions {
565
+ /**
566
+ * Specify server port. Note if the port is already being used, Vite will
567
+ * automatically try the next available port so this may not be the actual
568
+ * port the server ends up listening on.
569
+ */
570
+ port?: number;
571
+ /**
572
+ * If enabled, vite will exit if specified port is already in use
573
+ */
574
+ strictPort?: boolean;
575
+ /**
576
+ * Specify which IP addresses the server should listen on.
577
+ * Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
578
+ */
579
+ host?: string | boolean;
580
+ /**
581
+ * The hostnames that Vite is allowed to respond to.
582
+ * `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
583
+ * When using HTTPS, this check is skipped.
584
+ *
585
+ * If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
586
+ * For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
587
+ *
588
+ * If set to `true`, the server is allowed to respond to requests for any hosts.
589
+ * This is not recommended as it will be vulnerable to DNS rebinding attacks.
590
+ */
591
+ allowedHosts?: string[] | true;
592
+ /**
593
+ * Enable TLS + HTTP/2.
594
+ * Note: this downgrades to TLS only when the proxy option is also used.
595
+ */
596
+ https?: HttpsServerOptions;
597
+ /**
598
+ * Open browser window on startup
599
+ */
600
+ open?: boolean | string;
601
+ /**
602
+ * Configure custom proxy rules for the dev server. Expects an object
603
+ * of `{ key: options }` pairs.
604
+ * Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
605
+ * Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
606
+ *
607
+ * Example `vite.config.js`:
608
+ * ``` js
609
+ * module.exports = {
610
+ * proxy: {
611
+ * // string shorthand: /foo -> http://localhost:4567/foo
612
+ * '/foo': 'http://localhost:4567',
613
+ * // with options
614
+ * '/api': {
615
+ * target: 'http://jsonplaceholder.typicode.com',
616
+ * changeOrigin: true,
617
+ * rewrite: path => path.replace(/^\/api/, '')
618
+ * }
619
+ * }
620
+ * }
621
+ * ```
622
+ */
623
+ proxy?: Record<string, string | ProxyOptions>;
624
+ /**
625
+ * Configure CORS for the dev server.
626
+ * Uses https://github.com/expressjs/cors.
627
+ *
628
+ * When enabling this option, **we recommend setting a specific value
629
+ * rather than `true`** to avoid exposing the source code to untrusted origins.
630
+ *
631
+ * Set to `true` to allow all methods from any origin, or configure separately
632
+ * using an object.
633
+ *
634
+ * @default false
635
+ */
636
+ cors?: CorsOptions | boolean;
637
+ /**
638
+ * Specify server response headers.
639
+ */
640
+ headers?: OutgoingHttpHeaders;
641
+ }
642
+ /**
643
+ * https://github.com/expressjs/cors#configuration-options
644
+ */
645
+ interface CorsOptions {
646
+ /**
647
+ * Configures the Access-Control-Allow-Origin CORS header.
648
+ *
649
+ * **We recommend setting a specific value rather than
650
+ * `true`** to avoid exposing the source code to untrusted origins.
651
+ */
652
+ origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
653
+ methods?: string | string[];
654
+ allowedHeaders?: string | string[];
655
+ exposedHeaders?: string | string[];
656
+ credentials?: boolean;
657
+ maxAge?: number;
658
+ preflightContinue?: boolean;
659
+ optionsSuccessStatus?: number;
660
+ }
661
+ type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
662
+ //#endregion
663
+ //#region src/node/typeUtils.d.ts
664
+ type RequiredExceptFor<T$1, K$1 extends keyof T$1> = Pick<T$1, K$1> & Required<Omit<T$1, K$1>>;
665
+ //#endregion
666
+ //#region src/node/preview.d.ts
667
+ interface PreviewOptions extends CommonServerOptions {}
668
+ interface ResolvedPreviewOptions extends RequiredExceptFor<PreviewOptions, "host" | "https" | "proxy"> {}
669
+ interface PreviewServer {
670
+ /**
671
+ * The resolved vite config object
672
+ */
673
+ config: ResolvedConfig;
674
+ /**
675
+ * Stop the server.
676
+ */
677
+ close(): Promise<void>;
678
+ /**
679
+ * A connect app instance.
680
+ * - Can be used to attach custom middlewares to the preview server.
681
+ * - Can also be used as the handler function of a custom http server
682
+ * or as a middleware in any connect-style Node.js frameworks
683
+ *
684
+ * https://github.com/senchalabs/connect#use-middleware
685
+ */
686
+ middlewares: Connect.Server;
687
+ /**
688
+ * native Node http server instance
689
+ */
690
+ httpServer: HttpServer;
691
+ /**
692
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
693
+ * if the server is not listening on any port.
694
+ */
695
+ resolvedUrls: ResolvedServerUrls | null;
696
+ /**
697
+ * Print server urls
698
+ */
699
+ printUrls(): void;
700
+ /**
701
+ * Bind CLI shortcuts
702
+ */
703
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void;
704
+ }
705
+ type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
706
+ /**
707
+ * Starts the Vite server in preview mode, to simulate a production deployment
708
+ */
709
+ declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
710
+ //#endregion
711
+ //#region src/node/shortcuts.d.ts
712
+ type BindCLIShortcutsOptions<Server$3 = ViteDevServer | PreviewServer> = {
713
+ /**
714
+ * Print a one-line shortcuts "help" hint to the terminal
715
+ */
716
+ print?: boolean;
717
+ /**
718
+ * Custom shortcuts to run when a key is pressed. These shortcuts take priority
719
+ * over the default shortcuts if they have the same keys (except the `h` key).
720
+ * To disable a default shortcut, define the same key but with `action: undefined`.
721
+ */
722
+ customShortcuts?: CLIShortcut<Server$3>[];
723
+ };
724
+ type CLIShortcut<Server$3 = ViteDevServer | PreviewServer> = {
725
+ key: string;
726
+ description: string;
727
+ action?(server: Server$3): void | Promise<void>;
728
+ };
729
+ //#endregion
730
+ //#region src/node/baseEnvironment.d.ts
731
+ declare class PartialEnvironment {
732
+ name: string;
733
+ getTopLevelConfig(): ResolvedConfig;
734
+ config: ResolvedConfig & ResolvedEnvironmentOptions;
735
+ logger: Logger;
736
+ constructor(name: string, topLevelConfig: ResolvedConfig, options?: ResolvedEnvironmentOptions);
737
+ }
738
+ declare class BaseEnvironment extends PartialEnvironment {
739
+ get plugins(): readonly Plugin[];
740
+ constructor(name: string, config: ResolvedConfig, options?: ResolvedEnvironmentOptions);
741
+ }
742
+ /**
743
+ * This class discourages users from inversely checking the `mode`
744
+ * to determine the type of environment, e.g.
745
+ *
746
+ * ```js
747
+ * const isDev = environment.mode !== 'build' // bad
748
+ * const isDev = environment.mode === 'dev' // good
749
+ * ```
750
+ *
751
+ * You should also not check against `"unknown"` specifically. It's
752
+ * a placeholder for more possible environment types.
753
+ */
754
+ declare class UnknownEnvironment extends BaseEnvironment {
755
+ mode: "unknown";
756
+ }
757
+ //#endregion
758
+ //#region src/node/optimizer/scan.d.ts
759
+ declare class ScanEnvironment extends BaseEnvironment {
760
+ mode: "scan";
761
+ get pluginContainer(): EnvironmentPluginContainer;
762
+ init(): Promise<void>;
763
+ }
764
+ //#endregion
765
+ //#region src/node/optimizer/index.d.ts
766
+ type ExportsData = {
767
+ hasModuleSyntax: boolean;
768
+ exports: readonly string[];
769
+ jsxLoader?: boolean;
770
+ };
771
+ interface DepsOptimizer {
772
+ init: () => Promise<void>;
773
+ metadata: DepOptimizationMetadata;
774
+ scanProcessing?: Promise<void>;
775
+ registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
776
+ run: () => void;
777
+ isOptimizedDepFile: (id: string) => boolean;
778
+ isOptimizedDepUrl: (url: string) => boolean;
779
+ getOptimizedDepId: (depInfo: OptimizedDepInfo) => string;
780
+ close: () => Promise<void>;
781
+ options: DepOptimizationOptions;
782
+ }
783
+ interface DepOptimizationConfig {
784
+ /**
785
+ * Force optimize listed dependencies (must be resolvable import paths,
786
+ * cannot be globs).
787
+ */
788
+ include?: string[];
789
+ /**
790
+ * Do not optimize these dependencies (must be resolvable import paths,
791
+ * cannot be globs).
792
+ */
793
+ exclude?: string[];
794
+ /**
795
+ * Forces ESM interop when importing these dependencies. Some legacy
796
+ * packages advertise themselves as ESM but use `require` internally
797
+ * @experimental
798
+ */
799
+ needsInterop?: string[];
800
+ /**
801
+ * Options to pass to esbuild during the dep scanning and optimization
802
+ *
803
+ * Certain options are omitted since changing them would not be compatible
804
+ * with Vite's dep optimization.
805
+ *
806
+ * - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
807
+ * - `plugins` are merged with Vite's dep plugin
808
+ *
809
+ * https://esbuild.github.io/api
810
+ */
811
+ esbuildOptions?: Omit<esbuild_BuildOptions, "bundle" | "entryPoints" | "external" | "write" | "watch" | "outdir" | "outfile" | "outbase" | "outExtension" | "metafile">;
812
+ /**
813
+ * List of file extensions that can be optimized. A corresponding esbuild
814
+ * plugin must exist to handle the specific extension.
815
+ *
816
+ * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
817
+ * allows specifying additional extensions.
818
+ *
819
+ * @experimental
820
+ */
821
+ extensions?: string[];
822
+ /**
823
+ * Deps optimization during build was removed in Vite 5.1. This option is
824
+ * now redundant and will be removed in a future version. Switch to using
825
+ * `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
826
+ * true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
827
+ * @default 'build'
828
+ * @deprecated
829
+ * @experimental
830
+ */
831
+ disabled?: boolean | "build" | "dev";
832
+ /**
833
+ * Automatic dependency discovery. When `noDiscovery` is true, only dependencies
834
+ * listed in `include` will be optimized. The scanner isn't run for cold start
835
+ * in this case. CJS-only dependencies must be present in `include` during dev.
836
+ * @default false
837
+ */
838
+ noDiscovery?: boolean;
839
+ /**
840
+ * When enabled, it will hold the first optimized deps results until all static
841
+ * imports are crawled on cold start. This avoids the need for full-page reloads
842
+ * when new dependencies are discovered and they trigger the generation of new
843
+ * common chunks. If all dependencies are found by the scanner plus the explicitly
844
+ * defined ones in `include`, it is better to disable this option to let the
845
+ * browser process more requests in parallel.
846
+ * @default true
847
+ * @experimental
848
+ */
849
+ holdUntilCrawlEnd?: boolean;
850
+ /**
851
+ * When enabled, Vite will not throw an error when an outdated optimized
852
+ * dependency is requested. Enabling this option may cause a single module
853
+ * to have a multiple reference.
854
+ * @default false
855
+ * @experimental
856
+ */
857
+ ignoreOutdatedRequests?: boolean;
858
+ }
859
+ type DepOptimizationOptions = DepOptimizationConfig & {
860
+ /**
861
+ * By default, Vite will crawl your `index.html` to detect dependencies that
862
+ * need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
863
+ * will crawl those entry points instead.
864
+ *
865
+ * If neither of these fit your needs, you can specify custom entries using
866
+ * this option - the value should be a tinyglobby pattern or array of patterns
867
+ * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
868
+ * vite project root. This will overwrite default entries inference.
869
+ */
870
+ entries?: string | string[];
871
+ /**
872
+ * Force dep pre-optimization regardless of whether deps have changed.
873
+ * @experimental
874
+ */
875
+ force?: boolean;
876
+ };
877
+ interface OptimizedDepInfo {
878
+ id: string;
879
+ file: string;
880
+ src?: string;
881
+ needsInterop?: boolean;
882
+ browserHash?: string;
883
+ fileHash?: string;
884
+ /**
885
+ * During optimization, ids can still be resolved to their final location
886
+ * but the bundles may not yet be saved to disk
887
+ */
888
+ processing?: Promise<void>;
889
+ /**
890
+ * ExportData cache, discovered deps will parse the src entry to get exports
891
+ * data used both to define if interop is needed and when pre-bundling
892
+ */
893
+ exportsData?: Promise<ExportsData>;
894
+ }
895
+ interface DepOptimizationMetadata {
896
+ /**
897
+ * The main hash is determined by user config and dependency lockfiles.
898
+ * This is checked on server startup to avoid unnecessary re-bundles.
899
+ */
900
+ hash: string;
901
+ /**
902
+ * This hash is determined by dependency lockfiles.
903
+ * This is checked on server startup to avoid unnecessary re-bundles.
904
+ */
905
+ lockfileHash: string;
906
+ /**
907
+ * This hash is determined by user config.
908
+ * This is checked on server startup to avoid unnecessary re-bundles.
909
+ */
910
+ configHash: string;
911
+ /**
912
+ * The browser hash is determined by the main hash plus additional dependencies
913
+ * discovered at runtime. This is used to invalidate browser requests to
914
+ * optimized deps.
915
+ */
916
+ browserHash: string;
917
+ /**
918
+ * Metadata for each already optimized dependency
919
+ */
920
+ optimized: Record<string, OptimizedDepInfo>;
921
+ /**
922
+ * Metadata for non-entry optimized chunks and dynamic imports
923
+ */
924
+ chunks: Record<string, OptimizedDepInfo>;
925
+ /**
926
+ * Metadata for each newly discovered dependency after processing
927
+ */
928
+ discovered: Record<string, OptimizedDepInfo>;
929
+ /**
930
+ * OptimizedDepInfo list
931
+ */
932
+ depInfoList: OptimizedDepInfo[];
933
+ }
934
+ /**
935
+ * Scan and optimize dependencies within a project.
936
+ * Used by Vite CLI when running `vite optimize`.
937
+ *
938
+ * @deprecated the optimization process runs automatically and does not need to be called
939
+ */
940
+ declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
941
+ //#endregion
942
+ //#region src/node/server/transformRequest.d.ts
943
+ interface TransformResult {
944
+ code: string;
945
+ map: SourceMap | {
946
+ mappings: "";
947
+ } | null;
948
+ ssr?: boolean;
949
+ etag?: string;
950
+ deps?: string[];
951
+ dynamicDeps?: string[];
952
+ }
953
+ interface TransformOptions {
954
+ /**
955
+ * @deprecated inferred from environment
956
+ */
957
+ ssr?: boolean;
958
+ }
959
+ //#endregion
960
+ //#region src/node/server/moduleGraph.d.ts
961
+ declare class EnvironmentModuleNode {
962
+ environment: string;
963
+ /**
964
+ * Public served url path, starts with /
965
+ */
966
+ url: string;
967
+ /**
968
+ * Resolved file system path + query
969
+ */
970
+ id: string | null;
971
+ file: string | null;
972
+ type: "js" | "css" | "asset";
973
+ info?: ModuleInfo;
974
+ meta?: Record<string, any>;
975
+ importers: Set<EnvironmentModuleNode>;
976
+ importedModules: Set<EnvironmentModuleNode>;
977
+ acceptedHmrDeps: Set<EnvironmentModuleNode>;
978
+ acceptedHmrExports: Set<string> | null;
979
+ importedBindings: Map<string, Set<string>> | null;
980
+ isSelfAccepting?: boolean;
981
+ transformResult: TransformResult | null;
982
+ ssrModule: Record<string, any> | null;
983
+ ssrError: Error | null;
984
+ lastHMRTimestamp: number;
985
+ lastInvalidationTimestamp: number;
986
+ /**
987
+ * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
988
+ */
989
+ constructor(url: string, environment: string, setIsSelfAccepting?: boolean);
990
+ }
991
+ type ResolvedUrl = [url: string, resolvedId: string, meta: object | null | undefined];
992
+ declare class EnvironmentModuleGraph {
993
+ environment: string;
994
+ urlToModuleMap: Map<string, EnvironmentModuleNode>;
995
+ idToModuleMap: Map<string, EnvironmentModuleNode>;
996
+ etagToModuleMap: Map<string, EnvironmentModuleNode>;
997
+ fileToModulesMap: Map<string, Set<EnvironmentModuleNode>>;
998
+ constructor(environment: string, resolveId: (url: string) => Promise<PartialResolvedId | null>);
999
+ getModuleByUrl(rawUrl: string): Promise<EnvironmentModuleNode | undefined>;
1000
+ getModuleById(id: string): EnvironmentModuleNode | undefined;
1001
+ getModulesByFile(file: string): Set<EnvironmentModuleNode> | undefined;
1002
+ onFileChange(file: string): void;
1003
+ onFileDelete(file: string): void;
1004
+ invalidateModule(mod: EnvironmentModuleNode, seen?: Set<EnvironmentModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1005
+ invalidateAll(): void;
1006
+ /**
1007
+ * Update the module graph based on a module's updated imports information
1008
+ * If there are dependencies that no longer have any importers, they are
1009
+ * returned as a Set.
1010
+ *
1011
+ * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
1012
+ * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
1013
+ */
1014
+ updateModuleInfo(mod: EnvironmentModuleNode, importedModules: Set<string | EnvironmentModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | EnvironmentModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, staticImportedUrls?: Set<string>): Promise<Set<EnvironmentModuleNode> | undefined>;
1015
+ ensureEntryFromUrl(rawUrl: string, setIsSelfAccepting?: boolean): Promise<EnvironmentModuleNode>;
1016
+ createFileOnlyEntry(file: string): EnvironmentModuleNode;
1017
+ resolveUrl(url: string): Promise<ResolvedUrl>;
1018
+ updateModuleTransformResult(mod: EnvironmentModuleNode, result: TransformResult | null): void;
1019
+ getModuleByEtag(etag: string): EnvironmentModuleNode | undefined;
1020
+ }
1021
+ //#endregion
1022
+ //#region src/node/server/mixedModuleGraph.d.ts
1023
+ declare class ModuleNode {
1024
+ _moduleGraph: ModuleGraph;
1025
+ _clientModule: EnvironmentModuleNode | undefined;
1026
+ _ssrModule: EnvironmentModuleNode | undefined;
1027
+ constructor(moduleGraph: ModuleGraph, clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode);
1028
+ _get<T$1 extends keyof EnvironmentModuleNode>(prop: T$1): EnvironmentModuleNode[T$1];
1029
+ _set<T$1 extends keyof EnvironmentModuleNode>(prop: T$1, value: EnvironmentModuleNode[T$1]): void;
1030
+ _wrapModuleSet(prop: ModuleSetNames, module: EnvironmentModuleNode | undefined): Set<ModuleNode>;
1031
+ _getModuleSetUnion(prop: "importedModules" | "importers"): Set<ModuleNode>;
1032
+ _getModuleInfoUnion(prop: "info"): ModuleInfo | undefined;
1033
+ _getModuleObjectUnion(prop: "meta"): Record<string, any> | undefined;
1034
+ get url(): string;
1035
+ set url(value: string);
1036
+ get id(): string | null;
1037
+ set id(value: string | null);
1038
+ get file(): string | null;
1039
+ set file(value: string | null);
1040
+ get type(): "js" | "css" | "asset";
1041
+ get info(): ModuleInfo | undefined;
1042
+ get meta(): Record<string, any> | undefined;
1043
+ get importers(): Set<ModuleNode>;
1044
+ get clientImportedModules(): Set<ModuleNode>;
1045
+ get ssrImportedModules(): Set<ModuleNode>;
1046
+ get importedModules(): Set<ModuleNode>;
1047
+ get acceptedHmrDeps(): Set<ModuleNode>;
1048
+ get acceptedHmrExports(): Set<string> | null;
1049
+ get importedBindings(): Map<string, Set<string>> | null;
1050
+ get isSelfAccepting(): boolean | undefined;
1051
+ get transformResult(): TransformResult | null;
1052
+ set transformResult(value: TransformResult | null);
1053
+ get ssrTransformResult(): TransformResult | null;
1054
+ set ssrTransformResult(value: TransformResult | null);
1055
+ get ssrModule(): Record<string, any> | null;
1056
+ get ssrError(): Error | null;
1057
+ get lastHMRTimestamp(): number;
1058
+ set lastHMRTimestamp(value: number);
1059
+ get lastInvalidationTimestamp(): number;
1060
+ get invalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1061
+ get ssrInvalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1062
+ }
1063
+ declare class ModuleGraph {
1064
+ urlToModuleMap: Map<string, ModuleNode>;
1065
+ idToModuleMap: Map<string, ModuleNode>;
1066
+ etagToModuleMap: Map<string, ModuleNode>;
1067
+ fileToModulesMap: Map<string, Set<ModuleNode>>;
1068
+ private moduleNodeCache;
1069
+ constructor(moduleGraphs: {
1070
+ client: () => EnvironmentModuleGraph;
1071
+ ssr: () => EnvironmentModuleGraph;
1072
+ });
1073
+ getModuleById(id: string): ModuleNode | undefined;
1074
+ getModuleByUrl(url: string, _ssr?: boolean): Promise<ModuleNode | undefined>;
1075
+ getModulesByFile(file: string): Set<ModuleNode> | undefined;
1076
+ onFileChange(file: string): void;
1077
+ onFileDelete(file: string): void;
1078
+ invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1079
+ invalidateAll(): void;
1080
+ ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
1081
+ createFileOnlyEntry(file: string): ModuleNode;
1082
+ resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
1083
+ updateModuleTransformResult(mod: ModuleNode, result: TransformResult | null, ssr?: boolean): void;
1084
+ getModuleByEtag(etag: string): ModuleNode | undefined;
1085
+ getBackwardCompatibleBrowserModuleNode(clientModule: EnvironmentModuleNode): ModuleNode;
1086
+ getBackwardCompatibleServerModuleNode(ssrModule: EnvironmentModuleNode): ModuleNode;
1087
+ getBackwardCompatibleModuleNode(mod: EnvironmentModuleNode): ModuleNode;
1088
+ getBackwardCompatibleModuleNodeDual(clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode): ModuleNode;
1089
+ }
1090
+ type ModuleSetNames = "acceptedHmrDeps" | "importedModules";
1091
+ //#endregion
1092
+ //#region src/node/server/hmr.d.ts
1093
+ interface HmrOptions {
1094
+ protocol?: string;
1095
+ host?: string;
1096
+ port?: number;
1097
+ clientPort?: number;
1098
+ path?: string;
1099
+ timeout?: number;
1100
+ overlay?: boolean;
1101
+ server?: HttpServer;
1102
+ }
1103
+ interface HotUpdateOptions {
1104
+ type: "create" | "update" | "delete";
1105
+ file: string;
1106
+ timestamp: number;
1107
+ modules: Array<EnvironmentModuleNode>;
1108
+ read: () => string | Promise<string>;
1109
+ server: ViteDevServer;
1110
+ }
1111
+ interface HmrContext {
1112
+ file: string;
1113
+ timestamp: number;
1114
+ modules: Array<ModuleNode>;
1115
+ read: () => string | Promise<string>;
1116
+ server: ViteDevServer;
1117
+ }
1118
+ interface HotChannelClient {
1119
+ send(payload: hmrPayload_HotPayload): void;
1120
+ }
1121
+ type HotChannelListener<T$1 extends string = string> = (data: InferCustomEventPayload<T$1>, client: HotChannelClient) => void;
1122
+ interface HotChannel<Api = any> {
1123
+ /**
1124
+ * When true, the fs access check is skipped in fetchModule.
1125
+ * Set this for transports that is not exposed over the network.
1126
+ */
1127
+ skipFsCheck?: boolean;
1128
+ /**
1129
+ * Broadcast events to all clients
1130
+ */
1131
+ send?(payload: hmrPayload_HotPayload): void;
1132
+ /**
1133
+ * Handle custom event emitted by `import.meta.hot.send`
1134
+ */
1135
+ on?<T$1 extends string>(event: T$1, listener: HotChannelListener<T$1>): void;
1136
+ on?(event: "connection", listener: () => void): void;
1137
+ /**
1138
+ * Unregister event listener
1139
+ */
1140
+ off?(event: string, listener: Function): void;
1141
+ /**
1142
+ * Start listening for messages
1143
+ */
1144
+ listen?(): void;
1145
+ /**
1146
+ * Disconnect all clients, called when server is closed or restarted.
1147
+ */
1148
+ close?(): Promise<unknown> | void;
1149
+ api?: Api;
1150
+ }
1151
+ interface NormalizedHotChannelClient {
1152
+ /**
1153
+ * Send event to the client
1154
+ */
1155
+ send(payload: hmrPayload_HotPayload): void;
1156
+ /**
1157
+ * Send custom event
1158
+ */
1159
+ send(event: string, payload?: hmrPayload_CustomPayload["data"]): void;
1160
+ }
1161
+ interface NormalizedHotChannel<Api = any> {
1162
+ /**
1163
+ * Broadcast events to all clients
1164
+ */
1165
+ send(payload: hmrPayload_HotPayload): void;
1166
+ /**
1167
+ * Send custom event
1168
+ */
1169
+ send<T$1 extends string>(event: T$1, payload?: InferCustomEventPayload<T$1>): void;
1170
+ /**
1171
+ * Handle custom event emitted by `import.meta.hot.send`
1172
+ */
1173
+ on<T$1 extends string>(event: T$1, listener: (data: InferCustomEventPayload<T$1>, client: NormalizedHotChannelClient) => void): void;
1174
+ /**
1175
+ * @deprecated use `vite:client:connect` event instead
1176
+ */
1177
+ on(event: "connection", listener: () => void): void;
1178
+ /**
1179
+ * Unregister event listener
1180
+ */
1181
+ off(event: string, listener: Function): void;
1182
+ handleInvoke(payload: hmrPayload_HotPayload): Promise<{
1183
+ result: any;
1184
+ } | {
1185
+ error: any;
1186
+ }>;
1187
+ /**
1188
+ * Start listening for messages
1189
+ */
1190
+ listen(): void;
1191
+ /**
1192
+ * Disconnect all clients, called when server is closed or restarted.
1193
+ */
1194
+ close(): Promise<unknown> | void;
1195
+ api?: Api;
1196
+ }
1197
+ type ServerHotChannelApi = {
1198
+ innerEmitter: EventEmitter;
1199
+ outsideEmitter: EventEmitter;
1200
+ };
1201
+ type ServerHotChannel = HotChannel<ServerHotChannelApi>;
1202
+ type NormalizedServerHotChannel = NormalizedHotChannel<ServerHotChannelApi>;
1203
+ declare function createServerHotChannel(): ServerHotChannel;
1204
+ //#endregion
1205
+ //#region src/types/ws.d.ts
1206
+ // WebSocket socket.
1207
+ declare class WebSocket extends EventEmitter {
1208
+ /** The connection is not yet open. */
1209
+ static readonly CONNECTING: 0;
1210
+ /** The connection is open and ready to communicate. */
1211
+ static readonly OPEN: 1;
1212
+ /** The connection is in the process of closing. */
1213
+ static readonly CLOSING: 2;
1214
+ /** The connection is closed. */
1215
+ static readonly CLOSED: 3;
1216
+ binaryType: 'nodebuffer' | 'arraybuffer' | 'fragments';
1217
+ readonly bufferedAmount: number;
1218
+ readonly extensions: string;
1219
+ /** Indicates whether the websocket is paused */
1220
+ readonly isPaused: boolean;
1221
+ readonly protocol: string;
1222
+ /** The current state of the connection */
1223
+ readonly readyState: typeof WebSocket.CONNECTING | typeof WebSocket.OPEN | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED;
1224
+ readonly url: string;
1225
+
1226
+ /** The connection is not yet open. */
1227
+ readonly CONNECTING: 0;
1228
+ /** The connection is open and ready to communicate. */
1229
+ readonly OPEN: 1;
1230
+ /** The connection is in the process of closing. */
1231
+ readonly CLOSING: 2;
1232
+ /** The connection is closed. */
1233
+ readonly CLOSED: 3;
1234
+ onopen: ((event: WebSocket.Event) => void) | null;
1235
+ onerror: ((event: WebSocket.ErrorEvent) => void) | null;
1236
+ onclose: ((event: WebSocket.CloseEvent) => void) | null;
1237
+ onmessage: ((event: WebSocket.MessageEvent) => void) | null;
1238
+ constructor(address: null);
1239
+ constructor(address: string | url_URL, options?: WebSocket.ClientOptions | ClientRequestArgs);
1240
+ constructor(address: string | url_URL, protocols?: string | string[], options?: WebSocket.ClientOptions | ClientRequestArgs);
1241
+ close(code?: number, data?: string | Buffer): void;
1242
+ ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1243
+ pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1244
+ send(data: any, cb?: (err?: Error) => void): void;
1245
+ send(data: any, options: {
1246
+ mask?: boolean | undefined;
1247
+ binary?: boolean | undefined;
1248
+ compress?: boolean | undefined;
1249
+ fin?: boolean | undefined;
1250
+ }, cb?: (err?: Error) => void): void;
1251
+ terminate(): void;
1252
+
1253
+ /**
1254
+ * Pause the websocket causing it to stop emitting events. Some events can still be
1255
+ * emitted after this is called, until all buffered data is consumed. This method
1256
+ * is a noop if the ready state is `CONNECTING` or `CLOSED`.
1257
+ */
1258
+ pause(): void;
1259
+ /**
1260
+ * Make a paused socket resume emitting events. This method is a noop if the ready
1261
+ * state is `CONNECTING` or `CLOSED`.
1262
+ */
1263
+ resume(): void;
1264
+
1265
+ // HTML5 WebSocket events
1266
+ addEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void, options?: WebSocket.EventListenerOptions): void;
1267
+ addEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void, options?: WebSocket.EventListenerOptions): void;
1268
+ addEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void, options?: WebSocket.EventListenerOptions): void;
1269
+ addEventListener(method: 'open', cb: (event: WebSocket.Event) => void, options?: WebSocket.EventListenerOptions): void;
1270
+ removeEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void): void;
1271
+ removeEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void): void;
1272
+ removeEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void): void;
1273
+ removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void;
1274
+
1275
+ // Events
1276
+ on(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1277
+ on(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1278
+ on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1279
+ on(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1280
+ on(event: 'open', listener: (this: WebSocket) => void): this;
1281
+ on(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1282
+ on(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1283
+ on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1284
+ once(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1285
+ once(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1286
+ once(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1287
+ once(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1288
+ once(event: 'open', listener: (this: WebSocket) => void): this;
1289
+ once(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1290
+ once(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1291
+ once(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1292
+ off(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1293
+ off(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1294
+ off(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1295
+ off(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1296
+ off(event: 'open', listener: (this: WebSocket) => void): this;
1297
+ off(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1298
+ off(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1299
+ off(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1300
+ addListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1301
+ addListener(event: 'error', listener: (err: Error) => void): this;
1302
+ addListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1303
+ addListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1304
+ addListener(event: 'open', listener: () => void): this;
1305
+ addListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1306
+ addListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1307
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1308
+ removeListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1309
+ removeListener(event: 'error', listener: (err: Error) => void): this;
1310
+ removeListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1311
+ removeListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1312
+ removeListener(event: 'open', listener: () => void): this;
1313
+ removeListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1314
+ removeListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1315
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1316
+ }
1317
+ declare const WebSocketAlias: typeof WebSocket;
1318
+ interface WebSocketAlias extends WebSocket {}
1319
+ declare namespace WebSocket {
1320
+ /**
1321
+ * Data represents the raw message payload received over the WebSocket.
1322
+ */
1323
+ type RawData = Buffer | ArrayBuffer | Buffer[];
1324
+
1325
+ /**
1326
+ * Data represents the message payload received over the WebSocket.
1327
+ */
1328
+ type Data = string | Buffer | ArrayBuffer | Buffer[];
1329
+
1330
+ /**
1331
+ * CertMeta represents the accepted types for certificate & key data.
1332
+ */
1333
+ type CertMeta = string | string[] | Buffer | Buffer[];
1334
+
1335
+ /**
1336
+ * VerifyClientCallbackSync is a synchronous callback used to inspect the
1337
+ * incoming message. The return value (boolean) of the function determines
1338
+ * whether or not to accept the handshake.
1339
+ */
1340
+ type VerifyClientCallbackSync = (info: {
1341
+ origin: string;
1342
+ secure: boolean;
1343
+ req: http.IncomingMessage;
1344
+ }) => boolean;
1345
+
1346
+ /**
1347
+ * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
1348
+ * incoming message. The return value (boolean) of the function determines
1349
+ * whether or not to accept the handshake.
1350
+ */
1351
+ type VerifyClientCallbackAsync = (info: {
1352
+ origin: string;
1353
+ secure: boolean;
1354
+ req: http.IncomingMessage;
1355
+ }, callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void) => void;
1356
+ interface ClientOptions extends SecureContextOptions {
1357
+ protocol?: string | undefined;
1358
+ followRedirects?: boolean | undefined;
1359
+ generateMask?(mask: Buffer): void;
1360
+ handshakeTimeout?: number | undefined;
1361
+ maxRedirects?: number | undefined;
1362
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1363
+ localAddress?: string | undefined;
1364
+ protocolVersion?: number | undefined;
1365
+ headers?: {
1366
+ [key: string]: string;
1367
+ } | undefined;
1368
+ origin?: string | undefined;
1369
+ agent?: Agent | undefined;
1370
+ host?: string | undefined;
1371
+ family?: number | undefined;
1372
+ checkServerIdentity?(servername: string, cert: CertMeta): boolean;
1373
+ rejectUnauthorized?: boolean | undefined;
1374
+ maxPayload?: number | undefined;
1375
+ skipUTF8Validation?: boolean | undefined;
1376
+ }
1377
+ interface PerMessageDeflateOptions {
1378
+ serverNoContextTakeover?: boolean | undefined;
1379
+ clientNoContextTakeover?: boolean | undefined;
1380
+ serverMaxWindowBits?: number | undefined;
1381
+ clientMaxWindowBits?: number | undefined;
1382
+ zlibDeflateOptions?: {
1383
+ flush?: number | undefined;
1384
+ finishFlush?: number | undefined;
1385
+ chunkSize?: number | undefined;
1386
+ windowBits?: number | undefined;
1387
+ level?: number | undefined;
1388
+ memLevel?: number | undefined;
1389
+ strategy?: number | undefined;
1390
+ dictionary?: Buffer | Buffer[] | DataView | undefined;
1391
+ info?: boolean | undefined;
1392
+ } | undefined;
1393
+ zlibInflateOptions?: ZlibOptions | undefined;
1394
+ threshold?: number | undefined;
1395
+ concurrencyLimit?: number | undefined;
1396
+ }
1397
+ interface Event {
1398
+ type: string;
1399
+ target: WebSocket;
1400
+ }
1401
+ interface ErrorEvent {
1402
+ error: any;
1403
+ message: string;
1404
+ type: string;
1405
+ target: WebSocket;
1406
+ }
1407
+ interface CloseEvent {
1408
+ wasClean: boolean;
1409
+ code: number;
1410
+ reason: string;
1411
+ type: string;
1412
+ target: WebSocket;
1413
+ }
1414
+ interface MessageEvent {
1415
+ data: Data;
1416
+ type: string;
1417
+ target: WebSocket;
1418
+ }
1419
+ interface EventListenerOptions {
1420
+ once?: boolean | undefined;
1421
+ }
1422
+ interface ServerOptions {
1423
+ host?: string | undefined;
1424
+ port?: number | undefined;
1425
+ backlog?: number | undefined;
1426
+ server?: http.Server | HttpsServer | undefined;
1427
+ verifyClient?: VerifyClientCallbackAsync | VerifyClientCallbackSync | undefined;
1428
+ handleProtocols?: (protocols: Set<string>, request: http.IncomingMessage) => string | false;
1429
+ path?: string | undefined;
1430
+ noServer?: boolean | undefined;
1431
+ clientTracking?: boolean | undefined;
1432
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1433
+ maxPayload?: number | undefined;
1434
+ skipUTF8Validation?: boolean | undefined;
1435
+ WebSocket?: typeof WebSocket.WebSocket | undefined;
1436
+ }
1437
+ interface AddressInfo {
1438
+ address: string;
1439
+ family: string;
1440
+ port: number;
1441
+ }
1442
+
1443
+ // WebSocket Server
1444
+ class Server<T$1 extends WebSocket = WebSocket> extends EventEmitter {
1445
+ options: ServerOptions;
1446
+ path: string;
1447
+ clients: Set<T$1>;
1448
+ constructor(options?: ServerOptions, callback?: () => void);
1449
+ address(): AddressInfo | string;
1450
+ close(cb?: (err?: Error) => void): void;
1451
+ handleUpgrade(request: http.IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T$1, request: http.IncomingMessage) => void): void;
1452
+ shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>;
1453
+
1454
+ // Events
1455
+ on(event: 'connection', cb: (this: Server<T$1>, socket: T$1, request: http.IncomingMessage) => void): this;
1456
+ on(event: 'error', cb: (this: Server<T$1>, error: Error) => void): this;
1457
+ on(event: 'headers', cb: (this: Server<T$1>, headers: string[], request: http.IncomingMessage) => void): this;
1458
+ on(event: 'close' | 'listening', cb: (this: Server<T$1>) => void): this;
1459
+ on(event: string | symbol, listener: (this: Server<T$1>, ...args: any[]) => void): this;
1460
+ once(event: 'connection', cb: (this: Server<T$1>, socket: T$1, request: http.IncomingMessage) => void): this;
1461
+ once(event: 'error', cb: (this: Server<T$1>, error: Error) => void): this;
1462
+ once(event: 'headers', cb: (this: Server<T$1>, headers: string[], request: http.IncomingMessage) => void): this;
1463
+ once(event: 'close' | 'listening', cb: (this: Server<T$1>) => void): this;
1464
+ once(event: string | symbol, listener: (this: Server<T$1>, ...args: any[]) => void): this;
1465
+ off(event: 'connection', cb: (this: Server<T$1>, socket: T$1, request: http.IncomingMessage) => void): this;
1466
+ off(event: 'error', cb: (this: Server<T$1>, error: Error) => void): this;
1467
+ off(event: 'headers', cb: (this: Server<T$1>, headers: string[], request: http.IncomingMessage) => void): this;
1468
+ off(event: 'close' | 'listening', cb: (this: Server<T$1>) => void): this;
1469
+ off(event: string | symbol, listener: (this: Server<T$1>, ...args: any[]) => void): this;
1470
+ addListener(event: 'connection', cb: (client: T$1, request: http.IncomingMessage) => void): this;
1471
+ addListener(event: 'error', cb: (err: Error) => void): this;
1472
+ addListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1473
+ addListener(event: 'close' | 'listening', cb: () => void): this;
1474
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1475
+ removeListener(event: 'connection', cb: (client: T$1) => void): this;
1476
+ removeListener(event: 'error', cb: (err: Error) => void): this;
1477
+ removeListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1478
+ removeListener(event: 'close' | 'listening', cb: () => void): this;
1479
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1480
+ }
1481
+ const WebSocketServer: typeof Server;
1482
+ interface WebSocketServer extends Server {}
1483
+ const WebSocket: typeof WebSocketAlias;
1484
+ interface WebSocket extends WebSocketAlias {}
1485
+
1486
+ // WebSocket stream
1487
+ function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
1488
+ }
1489
+
1490
+ // export = WebSocket
1491
+ //#endregion
1492
+ //#region src/node/server/ws.d.ts
1493
+ type WebSocketCustomListener<T$1> = (data: T$1, client: WebSocketClient) => void;
1494
+ declare const isWebSocketServer: unique symbol;
1495
+ interface WebSocketServer extends NormalizedHotChannel {
1496
+ /**
1497
+ * Handle custom event emitted by `import.meta.hot.send`
1498
+ */
1499
+ on: WebSocket.Server["on"] & {
1500
+ <T$1 extends string>(event: T$1, listener: WebSocketCustomListener<hmrPayload_InferCustomEventPayload<T$1>>): void;
1501
+ };
1502
+ /**
1503
+ * Unregister event listener.
1504
+ */
1505
+ off: WebSocket.Server["off"] & {
1506
+ (event: string, listener: Function): void;
1507
+ };
1508
+ /**
1509
+ * Listen on port and host
1510
+ */
1511
+ listen(): void;
1512
+ /**
1513
+ * Disconnect all clients and terminate the server.
1514
+ */
1515
+ close(): Promise<void>;
1516
+ [isWebSocketServer]: true;
1517
+ /**
1518
+ * Get all connected clients.
1519
+ */
1520
+ clients: Set<WebSocketClient>;
1521
+ }
1522
+ interface WebSocketClient extends NormalizedHotChannelClient {
1523
+ /**
1524
+ * The raw WebSocket instance
1525
+ * @advanced
1526
+ */
1527
+ socket: WebSocket;
1528
+ }
1529
+ //#endregion
1530
+ //#region src/node/server/environment.d.ts
1531
+ interface DevEnvironmentContext {
1532
+ hot: boolean;
1533
+ transport?: HotChannel | WebSocketServer;
1534
+ options?: EnvironmentOptions;
1535
+ remoteRunner?: {
1536
+ inlineSourceMap?: boolean;
1537
+ };
1538
+ depsOptimizer?: DepsOptimizer;
1539
+ }
1540
+ declare class DevEnvironment extends BaseEnvironment {
1541
+ mode: "dev";
1542
+ moduleGraph: EnvironmentModuleGraph;
1543
+ depsOptimizer?: DepsOptimizer;
1544
+ get pluginContainer(): EnvironmentPluginContainer<DevEnvironment>;
1545
+ /**
1546
+ * Hot channel for this environment. If not provided or disabled,
1547
+ * it will be a noop channel that does nothing.
1548
+ *
1549
+ * @example
1550
+ * environment.hot.send({ type: 'full-reload' })
1551
+ */
1552
+ hot: NormalizedHotChannel;
1553
+ constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
1554
+ init(options?: {
1555
+ watcher?: FSWatcher;
1556
+ /**
1557
+ * the previous instance used for the environment with the same name
1558
+ *
1559
+ * when using, the consumer should check if it's an instance generated from the same class or factory function
1560
+ */
1561
+ previousInstance?: DevEnvironment;
1562
+ }): Promise<void>;
1563
+ /**
1564
+ * When the dev server is restarted, the methods are called in the following order:
1565
+ * - new instance `init`
1566
+ * - previous instance `close`
1567
+ * - new instance `listen`
1568
+ */
1569
+ listen(server: ViteDevServer): Promise<void>;
1570
+ fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
1571
+ reloadModule(module: EnvironmentModuleNode): Promise<void>;
1572
+ transformRequest(url: string): Promise<TransformResult | null>;
1573
+ warmupRequest(url: string): Promise<void>;
1574
+ close(): Promise<void>;
1575
+ /**
1576
+ * Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
1577
+ * are processed after the first transformRequest call. If called from a load or transform
1578
+ * plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
1579
+ * Calling this function after the first static imports section of the module graph has been
1580
+ * processed will resolve immediately.
1581
+ * @experimental
1582
+ */
1583
+ waitForRequestsIdle(ignoredId?: string): Promise<void>;
1584
+ }
1585
+ //#endregion
1586
+ //#region src/types/commonjs.d.ts
1587
+
1588
+ interface RollupCommonJSOptions {
1589
+ /**
1590
+ * A minimatch pattern, or array of patterns, which specifies the files in
1591
+ * the build the plugin should operate on. By default, all files with
1592
+ * extension `".cjs"` or those in `extensions` are included, but you can
1593
+ * narrow this list by only including specific files. These files will be
1594
+ * analyzed and transpiled if either the analysis does not find ES module
1595
+ * specific statements or `transformMixedEsModules` is `true`.
1596
+ * @default undefined
1597
+ */
1598
+ include?: string | RegExp | readonly (string | RegExp)[];
1599
+ /**
1600
+ * A minimatch pattern, or array of patterns, which specifies the files in
1601
+ * the build the plugin should _ignore_. By default, all files with
1602
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
1603
+ * can exclude additional files. See also the `include` option.
1604
+ * @default undefined
1605
+ */
1606
+ exclude?: string | RegExp | readonly (string | RegExp)[];
1607
+ /**
1608
+ * For extensionless imports, search for extensions other than .js in the
1609
+ * order specified. Note that you need to make sure that non-JavaScript files
1610
+ * are transpiled by another plugin first.
1611
+ * @default [ '.js' ]
1612
+ */
1613
+ extensions?: ReadonlyArray<string>;
1614
+ /**
1615
+ * If true then uses of `global` won't be dealt with by this plugin
1616
+ * @default false
1617
+ */
1618
+ ignoreGlobal?: boolean;
1619
+ /**
1620
+ * If false, skips source map generation for CommonJS modules. This will
1621
+ * improve performance.
1622
+ * @default true
1623
+ */
1624
+ sourceMap?: boolean;
1625
+ /**
1626
+ * Some `require` calls cannot be resolved statically to be translated to
1627
+ * imports.
1628
+ * When this option is set to `false`, the generated code will either
1629
+ * directly throw an error when such a call is encountered or, when
1630
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
1631
+ * configured dynamic require target.
1632
+ * Setting this option to `true` will instead leave the `require` call in the
1633
+ * code or use it as a fallback for `dynamicRequireTargets`.
1634
+ * @default false
1635
+ */
1636
+ ignoreDynamicRequires?: boolean;
1637
+ /**
1638
+ * Instructs the plugin whether to enable mixed module transformations. This
1639
+ * is useful in scenarios with modules that contain a mix of ES `import`
1640
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
1641
+ * calls should be transformed to imports in mixed modules, or `false` if the
1642
+ * `require` expressions should survive the transformation. The latter can be
1643
+ * important if the code contains environment detection, or you are coding
1644
+ * for an environment with special treatment for `require` calls such as
1645
+ * ElectronJS. See also the `ignore` option.
1646
+ * @default false
1647
+ */
1648
+ transformMixedEsModules?: boolean;
1649
+ /**
1650
+ * By default, this plugin will try to hoist `require` statements as imports
1651
+ * to the top of each file. While this works well for many code bases and
1652
+ * allows for very efficient ESM output, it does not perfectly capture
1653
+ * CommonJS semantics as the order of side effects like log statements may
1654
+ * change. But it is especially problematic when there are circular `require`
1655
+ * calls between CommonJS modules as those often rely on the lazy execution of
1656
+ * nested `require` calls.
1657
+ *
1658
+ * Setting this option to `true` will wrap all CommonJS files in functions
1659
+ * which are executed when they are required for the first time, preserving
1660
+ * NodeJS semantics. Note that this can have an impact on the size and
1661
+ * performance of the generated code.
1662
+ *
1663
+ * The default value of `"auto"` will only wrap CommonJS files when they are
1664
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
1665
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
1666
+ * recommended setting for most code bases.
1667
+ *
1668
+ * `false` will entirely prevent wrapping and hoist all files. This may still
1669
+ * work depending on the nature of cyclic dependencies but will often cause
1670
+ * problems.
1671
+ *
1672
+ * You can also provide a minimatch pattern, or array of patterns, to only
1673
+ * specify a subset of files which should be wrapped in functions for proper
1674
+ * `require` semantics.
1675
+ *
1676
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
1677
+ * containing a list of ids that have been wrapped which can be used as
1678
+ * minimatch pattern for fine-tuning.
1679
+ * @default "auto"
1680
+ */
1681
+ strictRequires?: boolean | string | RegExp | readonly (string | RegExp)[];
1682
+ /**
1683
+ * Sometimes you have to leave require statements unconverted. Pass an array
1684
+ * containing the IDs or a `id => boolean` function.
1685
+ * @default []
1686
+ */
1687
+ ignore?: ReadonlyArray<string> | ((id: string) => boolean);
1688
+ /**
1689
+ * In most cases, where `require` calls are inside a `try-catch` clause,
1690
+ * they should be left unconverted as it requires an optional dependency
1691
+ * that may or may not be installed beside the rolled up package.
1692
+ * Due to the conversion of `require` to a static `import` - the call is
1693
+ * hoisted to the top of the file, outside the `try-catch` clause.
1694
+ *
1695
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
1696
+ * - `false`: All `require` calls inside a `try` will be converted as if the
1697
+ * `try-catch` clause is not there.
1698
+ * - `remove`: Remove all `require` calls from inside any `try` block.
1699
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
1700
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
1701
+ * individual IDs.
1702
+ *
1703
+ * @default true
1704
+ */
1705
+ ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
1706
+ /**
1707
+ * Controls how to render imports from external dependencies. By default,
1708
+ * this plugin assumes that all external dependencies are CommonJS. This
1709
+ * means they are rendered as default imports to be compatible with e.g.
1710
+ * NodeJS where ES modules can only import a default export from a CommonJS
1711
+ * dependency.
1712
+ *
1713
+ * If you set `esmExternals` to `true`, this plugin assumes that all
1714
+ * external dependencies are ES modules and respect the
1715
+ * `requireReturnsDefault` option. If that option is not set, they will be
1716
+ * rendered as namespace imports.
1717
+ *
1718
+ * You can also supply an array of ids to be treated as ES modules, or a
1719
+ * function that will be passed each external id to determine whether it is
1720
+ * an ES module.
1721
+ * @default false
1722
+ */
1723
+ esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
1724
+ /**
1725
+ * Controls what is returned when requiring an ES module from a CommonJS file.
1726
+ * When using the `esmExternals` option, this will also apply to external
1727
+ * modules. By default, this plugin will render those imports as namespace
1728
+ * imports i.e.
1729
+ *
1730
+ * ```js
1731
+ * // input
1732
+ * const foo = require('foo');
1733
+ *
1734
+ * // output
1735
+ * import * as foo from 'foo';
1736
+ * ```
1737
+ *
1738
+ * However, there are some situations where this may not be desired.
1739
+ * For these situations, you can change Rollup's behaviour either globally or
1740
+ * per module. To change it globally, set the `requireReturnsDefault` option
1741
+ * to one of the following values:
1742
+ *
1743
+ * - `false`: This is the default, requiring an ES module returns its
1744
+ * namespace. This is the only option that will also add a marker
1745
+ * `__esModule: true` to the namespace to support interop patterns in
1746
+ * CommonJS modules that are transpiled ES modules.
1747
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
1748
+ * namespace, but the plugin does not add the `__esModule` marker and thus
1749
+ * creates more efficient code. For external dependencies when using
1750
+ * `esmExternals: true`, no additional interop code is generated.
1751
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
1752
+ * Rollup: If a module has a default export and no named exports, requiring
1753
+ * that module returns the default export. In all other cases, the namespace
1754
+ * is returned. For external dependencies when using `esmExternals: true`, a
1755
+ * corresponding interop helper is added.
1756
+ * - `"preferred"`: If a module has a default export, requiring that module
1757
+ * always returns the default export, no matter whether additional named
1758
+ * exports exist. This is similar to how previous versions of this plugin
1759
+ * worked. Again for external dependencies when using `esmExternals: true`,
1760
+ * an interop helper is added.
1761
+ * - `true`: This will always try to return the default export on require
1762
+ * without checking if it actually exists. This can throw at build time if
1763
+ * there is no default export. This is how external dependencies are handled
1764
+ * when `esmExternals` is not used. The advantage over the other options is
1765
+ * that, like `false`, this does not add an interop helper for external
1766
+ * dependencies, keeping the code lean.
1767
+ *
1768
+ * To change this for individual modules, you can supply a function for
1769
+ * `requireReturnsDefault` instead. This function will then be called once for
1770
+ * each required ES module or external dependency with the corresponding id
1771
+ * and allows you to return different values for different modules.
1772
+ * @default false
1773
+ */
1774
+ requireReturnsDefault?: boolean | 'auto' | 'preferred' | 'namespace' | ((id: string) => boolean | 'auto' | 'preferred' | 'namespace');
1775
+
1776
+ /**
1777
+ * @default "auto"
1778
+ */
1779
+ defaultIsModuleExports?: boolean | 'auto' | ((id: string) => boolean | 'auto');
1780
+ /**
1781
+ * Some modules contain dynamic `require` calls, or require modules that
1782
+ * contain circular dependencies, which are not handled well by static
1783
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
1784
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
1785
+ * dependencies. It also enables `strictRequires` for those modules.
1786
+ *
1787
+ * Note: In extreme cases, this feature may result in some paths being
1788
+ * rendered as absolute in the final bundle. The plugin tries to avoid
1789
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
1790
+ * with paths that are far away from your project's folder, that may require
1791
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
1792
+ */
1793
+ dynamicRequireTargets?: string | ReadonlyArray<string>;
1794
+ /**
1795
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
1796
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
1797
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
1798
+ * home directory name. By default, it uses the current working directory.
1799
+ */
1800
+ dynamicRequireRoot?: string;
1801
+ }
1802
+ //#endregion
1803
+ //#region src/types/dynamicImportVars.d.ts
1804
+ interface RollupDynamicImportVarsOptions {
1805
+ /**
1806
+ * Files to include in this plugin (default all).
1807
+ * @default []
1808
+ */
1809
+ include?: string | RegExp | (string | RegExp)[];
1810
+ /**
1811
+ * Files to exclude in this plugin (default none).
1812
+ * @default []
1813
+ */
1814
+ exclude?: string | RegExp | (string | RegExp)[];
1815
+ /**
1816
+ * By default, the plugin quits the build process when it encounters an error. If you set this option to true, it will throw a warning instead and leave the code untouched.
1817
+ * @default false
1818
+ */
1819
+ warnOnError?: boolean;
1820
+ }
1821
+ //#endregion
1822
+ //#region src/node/plugins/terser.d.ts
1823
+ interface TerserOptions extends TerserMinifyOptions {
1824
+ /**
1825
+ * Vite-specific option to specify the max number of workers to spawn
1826
+ * when minifying files with terser.
1827
+ *
1828
+ * @default number of CPUs minus 1
1829
+ */
1830
+ maxWorkers?: number;
1831
+ }
1832
+ //#endregion
1833
+ //#region src/node/plugins/resolve.d.ts
1834
+ interface EnvironmentResolveOptions {
1835
+ /**
1836
+ * @default ['browser', 'module', 'jsnext:main', 'jsnext']
1837
+ */
1838
+ mainFields?: string[];
1839
+ conditions?: string[];
1840
+ externalConditions?: string[];
1841
+ /**
1842
+ * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
1843
+ */
1844
+ extensions?: string[];
1845
+ dedupe?: string[];
1846
+ /**
1847
+ * Prevent listed dependencies from being externalized and will get bundled in build.
1848
+ * Only works in server environments for now. Previously this was `ssr.noExternal`.
1849
+ * @experimental
1850
+ */
1851
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
1852
+ /**
1853
+ * Externalize the given dependencies and their transitive dependencies.
1854
+ * Only works in server environments for now. Previously this was `ssr.external`.
1855
+ * @experimental
1856
+ */
1857
+ external?: string[] | true;
1858
+ /**
1859
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
1860
+ */
1861
+ builtins?: (string | RegExp)[];
1862
+ }
1863
+ interface ResolveOptions extends EnvironmentResolveOptions {
1864
+ /**
1865
+ * @default false
1866
+ */
1867
+ preserveSymlinks?: boolean;
1868
+ }
1869
+ interface ResolvePluginOptions {
1870
+ root: string;
1871
+ isBuild: boolean;
1872
+ isProduction: boolean;
1873
+ packageCache?: PackageCache;
1874
+ /**
1875
+ * src code mode also attempts the following:
1876
+ * - resolving /xxx as URLs
1877
+ * - resolving bare imports from optimized deps
1878
+ */
1879
+ asSrc?: boolean;
1880
+ tryIndex?: boolean;
1881
+ tryPrefix?: string;
1882
+ preferRelative?: boolean;
1883
+ isRequire?: boolean;
1884
+ scan?: boolean;
1885
+ }
1886
+ interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
1887
+ //#endregion
1888
+ //#region src/node/packages.d.ts
1889
+ /** Cache for package.json resolution and package.json contents */
1890
+ type PackageCache = Map<string, PackageData>;
1891
+ interface PackageData {
1892
+ dir: string;
1893
+ hasSideEffects: (id: string) => boolean | "no-treeshake" | null;
1894
+ setResolvedCache: (key: string, entry: string, options: InternalResolveOptions) => void;
1895
+ getResolvedCache: (key: string, options: InternalResolveOptions) => string | undefined;
1896
+ data: {
1897
+ [field: string]: any;
1898
+ name: string;
1899
+ type: string;
1900
+ version: string;
1901
+ main: string;
1902
+ module: string;
1903
+ browser: string | Record<string, string | false>;
1904
+ exports: string | Record<string, any> | string[];
1905
+ imports: Record<string, any>;
1906
+ dependencies: Record<string, string>;
1907
+ };
1908
+ }
1909
+ //#endregion
1910
+ //#region src/node/plugins/license.d.ts
1911
+ interface LicenseOptions {
1912
+ /**
1913
+ * The output file name of the license file relative to the output directory.
1914
+ * Specify a path that ends with `.json` to output the raw JSON metadata.
1915
+ *
1916
+ * @default '.vite/license.md'
1917
+ */
1918
+ fileName: string;
1919
+ }
1920
+ //#endregion
1921
+ //#region src/node/build.d.ts
1922
+ interface BuildEnvironmentOptions {
1923
+ /**
1924
+ * Compatibility transform target. The transform is performed with esbuild
1925
+ * and the lowest supported target is es2015. Note this only handles
1926
+ * syntax transformation and does not cover polyfills
1927
+ *
1928
+ * Default: 'baseline-widely-available' - transpile targeting browsers that
1929
+ * are included in the Baseline Widely Available on 2025-05-01.
1930
+ * (Chrome 107+, Edge 107+, Firefox 104+, Safari 16+).
1931
+ *
1932
+ * Another special value is 'esnext' - which only performs minimal transpiling
1933
+ * (for minification compat).
1934
+ *
1935
+ * For custom targets, see https://esbuild.github.io/api/#target and
1936
+ * https://esbuild.github.io/content-types/#javascript for more details.
1937
+ * @default 'baseline-widely-available'
1938
+ */
1939
+ target?: "baseline-widely-available" | esbuild_TransformOptions["target"] | false;
1940
+ /**
1941
+ * whether to inject module preload polyfill.
1942
+ * Note: does not apply to library mode.
1943
+ * @default true
1944
+ * @deprecated use `modulePreload.polyfill` instead
1945
+ */
1946
+ polyfillModulePreload?: boolean;
1947
+ /**
1948
+ * Configure module preload
1949
+ * Note: does not apply to library mode.
1950
+ * @default true
1951
+ */
1952
+ modulePreload?: boolean | ModulePreloadOptions;
1953
+ /**
1954
+ * Directory relative from `root` where build output will be placed. If the
1955
+ * directory exists, it will be removed before the build.
1956
+ * @default 'dist'
1957
+ */
1958
+ outDir?: string;
1959
+ /**
1960
+ * Directory relative from `outDir` where the built js/css/image assets will
1961
+ * be placed.
1962
+ * @default 'assets'
1963
+ */
1964
+ assetsDir?: string;
1965
+ /**
1966
+ * Static asset files smaller than this number (in bytes) will be inlined as
1967
+ * base64 strings. If a callback is passed, a boolean can be returned to opt-in
1968
+ * or opt-out of inlining. If nothing is returned the default logic applies.
1969
+ *
1970
+ * Default limit is `4096` (4 KiB). Set to `0` to disable.
1971
+ * @default 4096
1972
+ */
1973
+ assetsInlineLimit?: number | ((filePath: string, content: Buffer) => boolean | undefined);
1974
+ /**
1975
+ * Whether to code-split CSS. When enabled, CSS in async chunks will be
1976
+ * inlined as strings in the chunk and inserted via dynamically created
1977
+ * style tags when the chunk is loaded.
1978
+ * @default true
1979
+ */
1980
+ cssCodeSplit?: boolean;
1981
+ /**
1982
+ * An optional separate target for CSS minification.
1983
+ * As esbuild only supports configuring targets to mainstream
1984
+ * browsers, users may need this option when they are targeting
1985
+ * a niche browser that comes with most modern JavaScript features
1986
+ * but has poor CSS support, e.g. Android WeChat WebView, which
1987
+ * doesn't support the #RGBA syntax.
1988
+ * @default target
1989
+ */
1990
+ cssTarget?: esbuild_TransformOptions["target"] | false;
1991
+ /**
1992
+ * Override CSS minification specifically instead of defaulting to `build.minify`,
1993
+ * so you can configure minification for JS and CSS separately.
1994
+ * @default 'esbuild'
1995
+ */
1996
+ cssMinify?: boolean | "esbuild" | "lightningcss";
1997
+ /**
1998
+ * If `true`, a separate sourcemap file will be created. If 'inline', the
1999
+ * sourcemap will be appended to the resulting output file as data URI.
2000
+ * 'hidden' works like `true` except that the corresponding sourcemap
2001
+ * comments in the bundled files are suppressed.
2002
+ * @default false
2003
+ */
2004
+ sourcemap?: boolean | "inline" | "hidden";
2005
+ /**
2006
+ * Set to `false` to disable minification, or specify the minifier to use.
2007
+ * Available options are 'terser' or 'esbuild'.
2008
+ * @default 'esbuild'
2009
+ */
2010
+ minify?: boolean | "terser" | "esbuild";
2011
+ /**
2012
+ * Options for terser
2013
+ * https://terser.org/docs/api-reference#minify-options
2014
+ *
2015
+ * In addition, you can also pass a `maxWorkers: number` option to specify the
2016
+ * max number of workers to spawn. Defaults to the number of CPUs minus 1.
2017
+ */
2018
+ terserOptions?: TerserOptions;
2019
+ /**
2020
+ * Will be merged with internal rollup options.
2021
+ * https://rollupjs.org/configuration-options/
2022
+ */
2023
+ rollupOptions?: RollupOptions;
2024
+ /**
2025
+ * Options to pass on to `@rollup/plugin-commonjs`
2026
+ */
2027
+ commonjsOptions?: RollupCommonJSOptions;
2028
+ /**
2029
+ * Options to pass on to `@rollup/plugin-dynamic-import-vars`
2030
+ */
2031
+ dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
2032
+ /**
2033
+ * Whether to write bundle to disk
2034
+ * @default true
2035
+ */
2036
+ write?: boolean;
2037
+ /**
2038
+ * Empty outDir on write.
2039
+ * @default true when outDir is a sub directory of project root
2040
+ */
2041
+ emptyOutDir?: boolean | null;
2042
+ /**
2043
+ * Copy the public directory to outDir on write.
2044
+ * @default true
2045
+ */
2046
+ copyPublicDir?: boolean;
2047
+ /**
2048
+ * Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
2049
+ * licenses. Pass an object to customize the output file name.
2050
+ * @default false
2051
+ */
2052
+ license?: boolean | LicenseOptions;
2053
+ /**
2054
+ * Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
2055
+ * to their hashed versions. Useful when you want to generate your own HTML
2056
+ * instead of using the one generated by Vite.
2057
+ *
2058
+ * Example:
2059
+ *
2060
+ * ```json
2061
+ * {
2062
+ * "main.js": {
2063
+ * "file": "main.68fe3fad.js",
2064
+ * "css": "main.e6b63442.css",
2065
+ * "imports": [...],
2066
+ * "dynamicImports": [...]
2067
+ * }
2068
+ * }
2069
+ * ```
2070
+ * @default false
2071
+ */
2072
+ manifest?: boolean | string;
2073
+ /**
2074
+ * Build in library mode. The value should be the global name of the lib in
2075
+ * UMD mode. This will produce esm + cjs + umd bundle formats with default
2076
+ * configurations that are suitable for distributing libraries.
2077
+ * @default false
2078
+ */
2079
+ lib?: LibraryOptions | false;
2080
+ /**
2081
+ * Produce SSR oriented build. Note this requires specifying SSR entry via
2082
+ * `rollupOptions.input`.
2083
+ * @default false
2084
+ */
2085
+ ssr?: boolean | string;
2086
+ /**
2087
+ * Generate SSR manifest for determining style links and asset preload
2088
+ * directives in production.
2089
+ * @default false
2090
+ */
2091
+ ssrManifest?: boolean | string;
2092
+ /**
2093
+ * Emit assets during SSR.
2094
+ * @default false
2095
+ */
2096
+ ssrEmitAssets?: boolean;
2097
+ /**
2098
+ * Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
2099
+ * By default, it is true for the client and false for other environments.
2100
+ */
2101
+ emitAssets?: boolean;
2102
+ /**
2103
+ * Set to false to disable reporting compressed chunk sizes.
2104
+ * Can slightly improve build speed.
2105
+ * @default true
2106
+ */
2107
+ reportCompressedSize?: boolean;
2108
+ /**
2109
+ * Adjust chunk size warning limit (in kB).
2110
+ * @default 500
2111
+ */
2112
+ chunkSizeWarningLimit?: number;
2113
+ /**
2114
+ * Rollup watch options
2115
+ * https://rollupjs.org/configuration-options/#watch
2116
+ * @default null
2117
+ */
2118
+ watch?: WatcherOptions | null;
2119
+ /**
2120
+ * create the Build Environment instance
2121
+ */
2122
+ createEnvironment?: (name: string, config: ResolvedConfig) => Promise<BuildEnvironment> | BuildEnvironment;
2123
+ }
2124
+ type BuildOptions = BuildEnvironmentOptions;
2125
+ interface LibraryOptions {
2126
+ /**
2127
+ * Path of library entry
2128
+ */
2129
+ entry: InputOption;
2130
+ /**
2131
+ * The name of the exposed global variable. Required when the `formats` option includes
2132
+ * `umd` or `iife`
2133
+ */
2134
+ name?: string;
2135
+ /**
2136
+ * Output bundle formats
2137
+ * @default ['es', 'umd']
2138
+ */
2139
+ formats?: LibraryFormats[];
2140
+ /**
2141
+ * The name of the package file output. The default file name is the name option
2142
+ * of the project package.json. It can also be defined as a function taking the
2143
+ * format as an argument.
2144
+ */
2145
+ fileName?: string | ((format: ModuleFormat, entryName: string) => string);
2146
+ /**
2147
+ * The name of the CSS file output if the library imports CSS. Defaults to the
2148
+ * same value as `build.lib.fileName` if it's set a string, otherwise it falls
2149
+ * back to the name option of the project package.json.
2150
+ */
2151
+ cssFileName?: string;
2152
+ }
2153
+ type LibraryFormats = "es" | "cjs" | "umd" | "iife" | "system";
2154
+ interface ModulePreloadOptions {
2155
+ /**
2156
+ * Whether to inject a module preload polyfill.
2157
+ * Note: does not apply to library mode.
2158
+ * @default true
2159
+ */
2160
+ polyfill?: boolean;
2161
+ /**
2162
+ * Resolve the list of dependencies to preload for a given dynamic import
2163
+ * @experimental
2164
+ */
2165
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
2166
+ }
2167
+ interface ResolvedModulePreloadOptions {
2168
+ polyfill: boolean;
2169
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
2170
+ }
2171
+ type ResolveModulePreloadDependenciesFn = (filename: string, deps: string[], context: {
2172
+ hostId: string;
2173
+ hostType: "html" | "js";
2174
+ }) => string[];
2175
+ interface ResolvedBuildEnvironmentOptions extends Required<Omit<BuildEnvironmentOptions, "polyfillModulePreload">> {
2176
+ modulePreload: false | ResolvedModulePreloadOptions;
2177
+ }
2178
+ interface ResolvedBuildOptions extends Required<Omit<BuildOptions, "polyfillModulePreload">> {
2179
+ modulePreload: false | ResolvedModulePreloadOptions;
2180
+ }
2181
+ /**
2182
+ * Bundles a single environment for production.
2183
+ * Returns a Promise containing the build result.
2184
+ */
2185
+ declare function build(inlineConfig?: InlineConfig): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
2186
+ type RenderBuiltAssetUrl = (filename: string, type: {
2187
+ type: "asset" | "public";
2188
+ hostId: string;
2189
+ hostType: "js" | "css" | "html";
2190
+ ssr: boolean;
2191
+ }) => string | {
2192
+ relative?: boolean;
2193
+ runtime?: string;
2194
+ } | undefined;
2195
+ declare class BuildEnvironment extends BaseEnvironment {
2196
+ mode: "build";
2197
+ isBuilt: boolean;
2198
+ constructor(name: string, config: ResolvedConfig, setup?: {
2199
+ options?: EnvironmentOptions;
2200
+ });
2201
+ init(): Promise<void>;
2202
+ }
2203
+ interface ViteBuilder {
2204
+ environments: Record<string, BuildEnvironment>;
2205
+ config: ResolvedConfig;
2206
+ buildApp(): Promise<void>;
2207
+ build(environment: BuildEnvironment): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
2208
+ }
2209
+ interface BuilderOptions {
2210
+ /**
2211
+ * Whether to share the config instance among environments to align with the behavior of dev server.
2212
+ *
2213
+ * @default false
2214
+ * @experimental
2215
+ */
2216
+ sharedConfigBuild?: boolean;
2217
+ /**
2218
+ * Whether to share the plugin instances among environments to align with the behavior of dev server.
2219
+ *
2220
+ * @default false
2221
+ * @experimental
2222
+ */
2223
+ sharedPlugins?: boolean;
2224
+ buildApp?: (builder: ViteBuilder) => Promise<void>;
2225
+ }
2226
+ type ResolvedBuilderOptions = Required<BuilderOptions>;
2227
+ /**
2228
+ * Creates a ViteBuilder to orchestrate building multiple environments.
2229
+ * @experimental
2230
+ */
2231
+ declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
2232
+ type BuildAppHook = (this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>;
2233
+ //#endregion
2234
+ //#region src/node/environment.d.ts
2235
+ type Environment = DevEnvironment | BuildEnvironment | ScanEnvironment | UnknownEnvironment;
2236
+ /**
2237
+ * Creates a function that hides the complexities of a WeakMap with an initial value
2238
+ * to implement object metadata. Used by plugins to implement cross hooks per
2239
+ * environment metadata
2240
+ *
2241
+ * @experimental
2242
+ */
2243
+ declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
2244
+ //#endregion
2245
+ //#region src/node/server/pluginContainer.d.ts
2246
+ type SkipInformation = {
2247
+ id: string;
2248
+ importer: string | undefined;
2249
+ plugin: Plugin;
2250
+ called?: boolean;
2251
+ };
2252
+ declare class EnvironmentPluginContainer<Env extends Environment = Environment> {
2253
+ private _pluginContextMap;
2254
+ private _resolvedRollupOptions?;
2255
+ private _processesing;
2256
+ private _seenResolves;
2257
+ private _moduleNodeToLoadAddedImports;
2258
+ getSortedPluginHooks: PluginHookUtils["getSortedPluginHooks"];
2259
+ getSortedPlugins: PluginHookUtils["getSortedPlugins"];
2260
+ moduleGraph: EnvironmentModuleGraph | undefined;
2261
+ watchFiles: Set<string>;
2262
+ minimalContext: MinimalPluginContext$1<Env>;
2263
+ private _started;
2264
+ private _buildStartPromise;
2265
+ private _closed;
2266
+ private _updateModuleLoadAddedImports;
2267
+ private _getAddedImports;
2268
+ getModuleInfo(id: string): ModuleInfo | null;
2269
+ private handleHookPromise;
2270
+ get options(): InputOptions;
2271
+ resolveRollupOptions(): Promise<InputOptions>;
2272
+ private _getPluginContext;
2273
+ private hookParallel;
2274
+ buildStart(_options?: InputOptions): Promise<void>;
2275
+ resolveId(rawId: string, importer?: string | undefined, options?: {
2276
+ attributes?: Record<string, string>;
2277
+ custom?: CustomPluginOptions;
2278
+ /** @deprecated use `skipCalls` instead */
2279
+ skip?: Set<Plugin>;
2280
+ skipCalls?: readonly SkipInformation[];
2281
+
2282
+ isEntry?: boolean;
2283
+ }): Promise<PartialResolvedId | null>;
2284
+ load(id: string): Promise<LoadResult | null>;
2285
+ transform(code: string, id: string, options?: {
2286
+ inMap?: SourceDescription["map"];
2287
+ }): Promise<{
2288
+ code: string;
2289
+ map: SourceMap | {
2290
+ mappings: "";
2291
+ } | null;
2292
+ }>;
2293
+ watchChange(id: string, change: {
2294
+ event: "create" | "update" | "delete";
2295
+ }): Promise<void>;
2296
+ close(): Promise<void>;
2297
+ }
2298
+ declare class BasicMinimalPluginContext<Meta = PluginContextMeta> {
2299
+ meta: Meta;
2300
+ private _logger;
2301
+ constructor(meta: Meta, _logger: Logger);
2302
+ debug(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2303
+ info(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2304
+ warn(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2305
+ error(e: string | RollupError): never;
2306
+ private _normalizeRawLog;
2307
+ }
2308
+ declare class MinimalPluginContext$1<T$1 extends Environment = Environment> extends BasicMinimalPluginContext implements MinimalPluginContext {
2309
+ environment: T$1;
2310
+ constructor(meta: PluginContextMeta, environment: T$1);
2311
+ }
2312
+ declare class PluginContainer {
2313
+ private environments;
2314
+ constructor(environments: Record<string, Environment>);
2315
+ private _getEnvironment;
2316
+ private _getPluginContainer;
2317
+ getModuleInfo(id: string): ModuleInfo | null;
2318
+ get options(): InputOptions;
2319
+ buildStart(_options?: InputOptions): Promise<void>;
2320
+ watchChange(id: string, change: {
2321
+ event: "create" | "update" | "delete";
2322
+ }): Promise<void>;
2323
+ resolveId(rawId: string, importer?: string, options?: {
2324
+ attributes?: Record<string, string>;
2325
+ custom?: CustomPluginOptions;
2326
+ /** @deprecated use `skipCalls` instead */
2327
+ skip?: Set<Plugin>;
2328
+ skipCalls?: readonly SkipInformation[];
2329
+ ssr?: boolean;
2330
+
2331
+ isEntry?: boolean;
2332
+ }): Promise<PartialResolvedId | null>;
2333
+ load(id: string, options?: {
2334
+ ssr?: boolean;
2335
+ }): Promise<LoadResult | null>;
2336
+ transform(code: string, id: string, options?: {
2337
+ ssr?: boolean;
2338
+ environment?: Environment;
2339
+ inMap?: SourceDescription["map"];
2340
+ }): Promise<{
2341
+ code: string;
2342
+ map: SourceMap | {
2343
+ mappings: "";
2344
+ } | null;
2345
+ }>;
2346
+ close(): Promise<void>;
2347
+ }
2348
+ /**
2349
+ * server.pluginContainer compatibility
2350
+ *
2351
+ * The default environment is in buildStart, buildEnd, watchChange, and closeBundle hooks,
2352
+ * which are called once for all environments, or when no environment is passed in other hooks.
2353
+ * The ssrEnvironment is needed for backward compatibility when the ssr flag is passed without
2354
+ * an environment. The defaultEnvironment in the main pluginContainer in the server should be
2355
+ * the client environment for backward compatibility.
2356
+ **/
2357
+ //#endregion
2358
+ //#region src/node/server/index.d.ts
2359
+ interface ServerOptions$1 extends CommonServerOptions {
2360
+ /**
2361
+ * Configure HMR-specific options (port, host, path & protocol)
2362
+ */
2363
+ hmr?: HmrOptions | boolean;
2364
+ /**
2365
+ * Do not start the websocket connection.
2366
+ * @experimental
2367
+ */
2368
+ ws?: false;
2369
+ /**
2370
+ * Warm-up files to transform and cache the results in advance. This improves the
2371
+ * initial page load during server starts and prevents transform waterfalls.
2372
+ */
2373
+ warmup?: {
2374
+ /**
2375
+ * The files to be transformed and used on the client-side. Supports glob patterns.
2376
+ */
2377
+ clientFiles?: string[];
2378
+ /**
2379
+ * The files to be transformed and used in SSR. Supports glob patterns.
2380
+ */
2381
+ ssrFiles?: string[];
2382
+ };
2383
+ /**
2384
+ * chokidar watch options or null to disable FS watching
2385
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2386
+ */
2387
+ watch?: WatchOptions | null;
2388
+ /**
2389
+ * Create Vite dev server to be used as a middleware in an existing server
2390
+ * @default false
2391
+ */
2392
+ middlewareMode?: boolean | {
2393
+ /**
2394
+ * Parent server instance to attach to
2395
+ *
2396
+ * This is needed to proxy WebSocket connections to the parent server.
2397
+ */
2398
+ server: HttpServer;
2399
+ };
2400
+ /**
2401
+ * Options for files served via '/\@fs/'.
2402
+ */
2403
+ fs?: FileSystemServeOptions;
2404
+ /**
2405
+ * Origin for the generated asset URLs.
2406
+ *
2407
+ * @example `http://127.0.0.1:8080`
2408
+ */
2409
+ origin?: string;
2410
+ /**
2411
+ * Pre-transform known direct imports
2412
+ * @default true
2413
+ */
2414
+ preTransformRequests?: boolean;
2415
+ /**
2416
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
2417
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
2418
+ *
2419
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
2420
+ * disable this behavior, or, for full control, a function that takes the source path and
2421
+ * sourcemap path and returns whether to ignore the source path.
2422
+ */
2423
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
2424
+ /**
2425
+ * Backward compatibility. The buildStart and buildEnd hooks were called only once for
2426
+ * the client environment. This option enables per-environment buildStart and buildEnd hooks.
2427
+ * @default false
2428
+ * @experimental
2429
+ */
2430
+ perEnvironmentStartEndDuringDev?: boolean;
2431
+ /**
2432
+ * Backward compatibility. The watchChange hook was called only once for the client environment.
2433
+ * This option enables per-environment watchChange hooks.
2434
+ * @default false
2435
+ * @experimental
2436
+ */
2437
+ perEnvironmentWatchChangeDuringDev?: boolean;
2438
+ /**
2439
+ * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2440
+ * @experimental
2441
+ */
2442
+ hotUpdateEnvironments?: (server: ViteDevServer, hmr: (environment: DevEnvironment) => Promise<void>) => Promise<void>;
2443
+ }
2444
+ interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1, "host" | "https" | "proxy" | "hmr" | "ws" | "watch" | "origin" | "hotUpdateEnvironments">, "fs" | "middlewareMode" | "sourcemapIgnoreList"> {
2445
+ fs: Required<FileSystemServeOptions>;
2446
+ middlewareMode: NonNullable<ServerOptions$1["middlewareMode"]>;
2447
+ sourcemapIgnoreList: Exclude<ServerOptions$1["sourcemapIgnoreList"], false | undefined>;
2448
+ }
2449
+ interface FileSystemServeOptions {
2450
+ /**
2451
+ * Strictly restrict file accessing outside of allowing paths.
2452
+ *
2453
+ * Set to `false` to disable the warning
2454
+ *
2455
+ * @default true
2456
+ */
2457
+ strict?: boolean;
2458
+ /**
2459
+ * Restrict accessing files outside the allowed directories.
2460
+ *
2461
+ * Accepts absolute path or a path relative to project root.
2462
+ * Will try to search up for workspace root by default.
2463
+ */
2464
+ allow?: string[];
2465
+ /**
2466
+ * Restrict accessing files that matches the patterns.
2467
+ *
2468
+ * This will have higher priority than `allow`.
2469
+ * picomatch patterns are supported.
2470
+ *
2471
+ * @default ['.env', '.env.*', '*.{crt,pem}', '**\/.git/**']
2472
+ */
2473
+ deny?: string[];
2474
+ }
2475
+ type ServerHook = (this: MinimalPluginContextWithoutEnvironment, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
2476
+ type HttpServer = http.Server | Http2SecureServer;
2477
+ interface ViteDevServer {
2478
+ /**
2479
+ * The resolved vite config object
2480
+ */
2481
+ config: ResolvedConfig;
2482
+ /**
2483
+ * A connect app instance.
2484
+ * - Can be used to attach custom middlewares to the dev server.
2485
+ * - Can also be used as the handler function of a custom http server
2486
+ * or as a middleware in any connect-style Node.js frameworks
2487
+ *
2488
+ * https://github.com/senchalabs/connect#use-middleware
2489
+ */
2490
+ middlewares: Connect.Server;
2491
+ /**
2492
+ * native Node http server instance
2493
+ * will be null in middleware mode
2494
+ */
2495
+ httpServer: HttpServer | null;
2496
+ /**
2497
+ * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2498
+ * it will not watch any files and calling `add` or `unwatch` will have no effect.
2499
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2500
+ */
2501
+ watcher: FSWatcher;
2502
+ /**
2503
+ * WebSocket server with `send(payload)` method
2504
+ */
2505
+ ws: WebSocketServer;
2506
+ /**
2507
+ * An alias to `server.environments.client.hot`.
2508
+ * If you want to interact with all environments, loop over `server.environments`.
2509
+ */
2510
+ hot: NormalizedHotChannel;
2511
+ /**
2512
+ * Rollup plugin container that can run plugin hooks on a given file
2513
+ */
2514
+ pluginContainer: PluginContainer;
2515
+ /**
2516
+ * Module execution environments attached to the Vite server.
2517
+ */
2518
+ environments: Record<"client" | "ssr" | (string & {}), DevEnvironment>;
2519
+ /**
2520
+ * Module graph that tracks the import relationships, url to file mapping
2521
+ * and hmr state.
2522
+ */
2523
+ moduleGraph: ModuleGraph;
2524
+ /**
2525
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2526
+ * in middleware mode or if the server is not listening on any port.
2527
+ */
2528
+ resolvedUrls: ResolvedServerUrls | null;
2529
+ /**
2530
+ * Programmatically resolve, load and transform a URL and get the result
2531
+ * without going through the http request pipeline.
2532
+ */
2533
+ transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
2534
+ /**
2535
+ * Same as `transformRequest` but only warm up the URLs so the next request
2536
+ * will already be cached. The function will never throw as it handles and
2537
+ * reports errors internally.
2538
+ */
2539
+ warmupRequest(url: string, options?: TransformOptions): Promise<void>;
2540
+ /**
2541
+ * Apply vite built-in HTML transforms and any plugin HTML transforms.
2542
+ */
2543
+ transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
2544
+ /**
2545
+ * Transform module code into SSR format.
2546
+ */
2547
+ ssrTransform(code: string, inMap: SourceMap | {
2548
+ mappings: "";
2549
+ } | null, url: string, originalCode?: string): Promise<TransformResult | null>;
2550
+ /**
2551
+ * Load a given URL as an instantiated module for SSR.
2552
+ */
2553
+ ssrLoadModule(url: string, opts?: {
2554
+ fixStacktrace?: boolean;
2555
+ }): Promise<Record<string, any>>;
2556
+ /**
2557
+ * Returns a fixed version of the given stack
2558
+ */
2559
+ ssrRewriteStacktrace(stack: string): string;
2560
+ /**
2561
+ * Mutates the given SSR error by rewriting the stacktrace
2562
+ */
2563
+ ssrFixStacktrace(e: Error): void;
2564
+ /**
2565
+ * Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
2566
+ * API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
2567
+ */
2568
+ reloadModule(module: ModuleNode): Promise<void>;
2569
+ /**
2570
+ * Start the server.
2571
+ */
2572
+ listen(port?: number, isRestart?: boolean): Promise<ViteDevServer>;
2573
+ /**
2574
+ * Stop the server.
2575
+ */
2576
+ close(): Promise<void>;
2577
+ /**
2578
+ * Print server urls
2579
+ */
2580
+ printUrls(): void;
2581
+ /**
2582
+ * Bind CLI shortcuts
2583
+ */
2584
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void;
2585
+ /**
2586
+ * Restart the server.
2587
+ *
2588
+ * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2589
+ */
2590
+ restart(forceOptimize?: boolean): Promise<void>;
2591
+ /**
2592
+ * Open browser
2593
+ */
2594
+ openBrowser(): void;
2595
+ /**
2596
+ * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
2597
+ * are processed. If called from a load or transform plugin hook, the id needs to be
2598
+ * passed as a parameter to avoid deadlocks. Calling this function after the first
2599
+ * static imports section of the module graph has been processed will resolve immediately.
2600
+ */
2601
+ waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
2602
+ }
2603
+ interface ResolvedServerUrls {
2604
+ local: string[];
2605
+ network: string[];
2606
+ }
2607
+ declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
2608
+ //#endregion
2609
+ //#region src/node/plugins/html.d.ts
2610
+ interface HtmlTagDescriptor {
2611
+ tag: string;
2612
+ /**
2613
+ * attribute values will be escaped automatically if needed
2614
+ */
2615
+ attrs?: Record<string, string | boolean | undefined>;
2616
+ children?: string | HtmlTagDescriptor[];
2617
+ /**
2618
+ * default: 'head-prepend'
2619
+ */
2620
+ injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
2621
+ }
2622
+ type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
2623
+ html: string;
2624
+ tags: HtmlTagDescriptor[];
2625
+ };
2626
+ interface IndexHtmlTransformContext {
2627
+ /**
2628
+ * public path when served
2629
+ */
2630
+ path: string;
2631
+ /**
2632
+ * filename on disk
2633
+ */
2634
+ filename: string;
2635
+ server?: ViteDevServer;
2636
+ bundle?: OutputBundle;
2637
+ chunk?: OutputChunk;
2638
+ originalUrl?: string;
2639
+ }
2640
+ type IndexHtmlTransformHook = (this: MinimalPluginContextWithoutEnvironment, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
2641
+ type IndexHtmlTransform = IndexHtmlTransformHook | {
2642
+ order?: "pre" | "post" | null;
2643
+ handler: IndexHtmlTransformHook;
2644
+ };
2645
+ //#endregion
2646
+ //#region src/node/plugins/pluginFilter.d.ts
2647
+ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
2648
+ include?: Value | Array<Value>;
2649
+ exclude?: Value | Array<Value>;
2650
+ };
2651
+ //#endregion
2652
+ //#region src/node/plugin.d.ts
2653
+ /**
2654
+ * Vite plugins extends the Rollup plugin interface with a few extra
2655
+ * vite-specific options. A valid vite plugin is also a valid Rollup plugin.
2656
+ * On the contrary, a Rollup plugin may or may NOT be a valid vite universal
2657
+ * plugin, since some Rollup features do not make sense in an unbundled
2658
+ * dev server context. That said, as long as a rollup plugin doesn't have strong
2659
+ * coupling between its bundle phase and output phase hooks then it should
2660
+ * just work (that means, most of them).
2661
+ *
2662
+ * By default, the plugins are run during both serve and build. When a plugin
2663
+ * is applied during serve, it will only run **non output plugin hooks** (see
2664
+ * rollup type definition of {@link rollup#PluginHooks}). You can think of the
2665
+ * dev server as only running `const bundle = rollup.rollup()` but never calling
2666
+ * `bundle.generate()`.
2667
+ *
2668
+ * A plugin that expects to have different behavior depending on serve/build can
2669
+ * export a factory function that receives the command being run via options.
2670
+ *
2671
+ * If a plugin should be applied only for server or build, a function format
2672
+ * config file can be used to conditional determine the plugins to use.
2673
+ *
2674
+ * The current environment can be accessed from the context for the all non-global
2675
+ * hooks (it is not available in config, configResolved, configureServer, etc).
2676
+ * It can be a dev, build, or scan environment.
2677
+ * Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
2678
+ */
2679
+ interface PluginContextExtension {
2680
+ /**
2681
+ * Vite-specific environment instance
2682
+ */
2683
+ environment: Environment;
2684
+ }
2685
+ interface PluginContextMetaExtension {
2686
+ viteVersion: string;
2687
+ }
2688
+ interface ConfigPluginContext extends Omit<MinimalPluginContext, "meta" | "environment"> {
2689
+ meta: Omit<PluginContextMeta, "watchMode">;
2690
+ }
2691
+ interface MinimalPluginContextWithoutEnvironment extends Omit<MinimalPluginContext, "environment"> {}
2692
+ declare module "rollup" {
2693
+ interface MinimalPluginContext extends PluginContextExtension {}
2694
+ interface PluginContextMeta extends PluginContextMetaExtension {}
2695
+ }
2696
+ /**
2697
+ * There are two types of plugins in Vite. App plugins and environment plugins.
2698
+ * Environment Plugins are defined by a constructor function that will be called
2699
+ * once per each environment allowing users to have completely different plugins
2700
+ * for each of them. The constructor gets the resolved environment after the server
2701
+ * and builder has already been created simplifying config access and cache
2702
+ * management for for environment specific plugins.
2703
+ * Environment Plugins are closer to regular rollup plugins. They can't define
2704
+ * app level hooks (like config, configResolved, configureServer, etc).
2705
+ */
2706
+ interface Plugin<A = any> extends Rollup.Plugin<A> {
2707
+ /**
2708
+ * Perform custom handling of HMR updates.
2709
+ * The handler receives an options containing changed filename, timestamp, a
2710
+ * list of modules affected by the file change, and the dev server instance.
2711
+ *
2712
+ * - The hook can return a filtered list of modules to narrow down the update.
2713
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2714
+ * the descriptors.
2715
+ *
2716
+ * - The hook can also return an empty array and then perform custom updates
2717
+ * by sending a custom hmr payload via environment.hot.send().
2718
+ *
2719
+ * - If the hook doesn't return a value, the hmr update will be performed as
2720
+ * normal.
2721
+ */
2722
+ hotUpdate?: ObjectHook<(this: MinimalPluginContext & {
2723
+ environment: DevEnvironment;
2724
+ }, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
2725
+ /**
2726
+ * extend hooks with ssr flag
2727
+ */
2728
+ resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
2729
+ attributes: Record<string, string>;
2730
+ custom?: CustomPluginOptions;
2731
+ ssr?: boolean | undefined;
2732
+
2733
+ isEntry: boolean;
2734
+ }) => Promise<ResolveIdResult> | ResolveIdResult, {
2735
+ filter?: {
2736
+ id?: StringFilter<RegExp>;
2737
+ };
2738
+ }>;
2739
+ load?: ObjectHook<(this: PluginContext, id: string, options?: {
2740
+ ssr?: boolean | undefined;
2741
+ }) => Promise<LoadResult> | LoadResult, {
2742
+ filter?: {
2743
+ id?: StringFilter;
2744
+ };
2745
+ }>;
2746
+ transform?: ObjectHook<(this: TransformPluginContext, code: string, id: string, options?: {
2747
+ ssr?: boolean | undefined;
2748
+ }) => Promise<Rollup.TransformResult> | Rollup.TransformResult, {
2749
+ filter?: {
2750
+ id?: StringFilter;
2751
+ code?: StringFilter;
2752
+ };
2753
+ }>;
2754
+ /**
2755
+ * Opt-in this plugin into the shared plugins pipeline.
2756
+ * For backward-compatibility, plugins are re-recreated for each environment
2757
+ * during `vite build --app`
2758
+ * We have an opt-in per plugin, and a general `builder.sharedPlugins`
2759
+ * In a future major, we'll flip the default to be shared by default
2760
+ * @experimental
2761
+ */
2762
+ sharedDuringBuild?: boolean;
2763
+ /**
2764
+ * Opt-in this plugin into per-environment buildStart and buildEnd during dev.
2765
+ * For backward-compatibility, the buildStart hook is called only once during
2766
+ * dev, for the client environment. Plugins can opt-in to be called
2767
+ * per-environment, aligning with the build hook behavior.
2768
+ * @experimental
2769
+ */
2770
+ perEnvironmentStartEndDuringDev?: boolean;
2771
+ /**
2772
+ * Opt-in this plugin into per-environment watchChange during dev.
2773
+ * For backward-compatibility, the watchChange hook is called only once during
2774
+ * dev, for the client environment. Plugins can opt-in to be called
2775
+ * per-environment, aligning with the watchChange hook behavior.
2776
+ * @experimental
2777
+ */
2778
+ perEnvironmentWatchChangeDuringDev?: boolean;
2779
+ /**
2780
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
2781
+ * is still subject to the `order` property in the hook object.
2782
+ *
2783
+ * Plugin invocation order:
2784
+ * - alias resolution
2785
+ * - `enforce: 'pre'` plugins
2786
+ * - vite core plugins
2787
+ * - normal plugins
2788
+ * - vite build plugins
2789
+ * - `enforce: 'post'` plugins
2790
+ * - vite build post plugins
2791
+ */
2792
+ enforce?: "pre" | "post";
2793
+ /**
2794
+ * Apply the plugin only for serve or build, or on certain conditions.
2795
+ */
2796
+ apply?: "serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean);
2797
+ /**
2798
+ * Define environments where this plugin should be active
2799
+ * By default, the plugin is active in all environments
2800
+ * @experimental
2801
+ */
2802
+ applyToEnvironment?: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption;
2803
+ /**
2804
+ * Modify vite config before it's resolved. The hook can either mutate the
2805
+ * passed-in config directly, or return a partial config object that will be
2806
+ * deeply merged into existing config.
2807
+ *
2808
+ * Note: User plugins are resolved before running this hook so injecting other
2809
+ * plugins inside the `config` hook will have no effect.
2810
+ */
2811
+ config?: ObjectHook<(this: ConfigPluginContext, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, "plugins"> | null | void | Promise<Omit<UserConfig, "plugins"> | null | void>>;
2812
+ /**
2813
+ * Modify environment configs before it's resolved. The hook can either mutate the
2814
+ * passed-in environment config directly, or return a partial config object that will be
2815
+ * deeply merged into existing config.
2816
+ * This hook is called for each environment with a partially resolved environment config
2817
+ * that already accounts for the default environment config values set at the root level.
2818
+ * If plugins need to modify the config of a given environment, they should do it in this
2819
+ * hook instead of the config hook. Leaving the config hook only for modifying the root
2820
+ * default environment config.
2821
+ */
2822
+ configEnvironment?: ObjectHook<(this: ConfigPluginContext, name: string, config: EnvironmentOptions, env: ConfigEnv & {
2823
+ /**
2824
+ * Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
2825
+ * Only intended to be used for backward compatibility.
2826
+ */
2827
+ isSsrTargetWebworker?: boolean;
2828
+ }) => EnvironmentOptions | null | void | Promise<EnvironmentOptions | null | void>>;
2829
+ /**
2830
+ * Use this hook to read and store the final resolved vite config.
2831
+ */
2832
+ configResolved?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, config: ResolvedConfig) => void | Promise<void>>;
2833
+ /**
2834
+ * Configure the vite server. The hook receives the {@link ViteDevServer}
2835
+ * instance. This can also be used to store a reference to the server
2836
+ * for use in other hooks.
2837
+ *
2838
+ * The hooks will be called before internal middlewares are applied. A hook
2839
+ * can return a post hook that will be called after internal middlewares
2840
+ * are applied. Hook can be async functions and will be called in series.
2841
+ */
2842
+ configureServer?: ObjectHook<ServerHook>;
2843
+ /**
2844
+ * Configure the preview server. The hook receives the {@link PreviewServer}
2845
+ * instance. This can also be used to store a reference to the server
2846
+ * for use in other hooks.
2847
+ *
2848
+ * The hooks are called before other middlewares are applied. A hook can
2849
+ * return a post hook that will be called after other middlewares are
2850
+ * applied. Hooks can be async functions and will be called in series.
2851
+ */
2852
+ configurePreviewServer?: ObjectHook<PreviewServerHook>;
2853
+ /**
2854
+ * Transform index.html.
2855
+ * The hook receives the following arguments:
2856
+ *
2857
+ * - html: string
2858
+ * - ctx: IndexHtmlTransformContext, which contains:
2859
+ * - path: public path when served
2860
+ * - filename: filename on disk
2861
+ * - server?: ViteDevServer (only present during serve)
2862
+ * - bundle?: rollup.OutputBundle (only present during build)
2863
+ * - chunk?: rollup.OutputChunk
2864
+ * - originalUrl?: string
2865
+ *
2866
+ * It can either return a transformed string, or a list of html tag
2867
+ * descriptors that will be injected into the `<head>` or `<body>`.
2868
+ *
2869
+ * By default the transform is applied **after** vite's internal html
2870
+ * transform. If you need to apply the transform before vite, use an object:
2871
+ * `{ order: 'pre', handler: hook }`
2872
+ */
2873
+ transformIndexHtml?: IndexHtmlTransform;
2874
+ /**
2875
+ * Build Environments
2876
+ *
2877
+ * @experimental
2878
+ */
2879
+ buildApp?: ObjectHook<BuildAppHook>;
2880
+ /**
2881
+ * Perform custom handling of HMR updates.
2882
+ * The handler receives a context containing changed filename, timestamp, a
2883
+ * list of modules affected by the file change, and the dev server instance.
2884
+ *
2885
+ * - The hook can return a filtered list of modules to narrow down the update.
2886
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2887
+ * the descriptors.
2888
+ *
2889
+ * - The hook can also return an empty array and then perform custom updates
2890
+ * by sending a custom hmr payload via server.ws.send().
2891
+ *
2892
+ * - If the hook doesn't return a value, the hmr update will be performed as
2893
+ * normal.
2894
+ */
2895
+ handleHotUpdate?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>>;
2896
+ }
2897
+ type HookHandler<T$1> = T$1 extends ObjectHook<infer H> ? H : T$1;
2898
+ type PluginWithRequiredHook<K$1 extends keyof Plugin> = Plugin & { [P in K$1]: NonNullable<Plugin[P]> };
2899
+ type Thenable<T$1> = T$1 | Promise<T$1>;
2900
+ type FalsyPlugin = false | null | undefined;
2901
+ type PluginOption = Thenable<Plugin | FalsyPlugin | PluginOption[]>;
2902
+ /**
2903
+ * @experimental
2904
+ */
2905
+ declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin;
2906
+ //#endregion
2907
+ //#region src/node/plugins/css.d.ts
2908
+ interface CSSOptions {
2909
+ /**
2910
+ * Using lightningcss is an experimental option to handle CSS modules,
2911
+ * assets and imports via Lightning CSS. It requires to install it as a
2912
+ * peer dependency.
2913
+ *
2914
+ * @default 'postcss'
2915
+ * @experimental
2916
+ */
2917
+ transformer?: "postcss" | "lightningcss";
2918
+ /**
2919
+ * https://github.com/css-modules/postcss-modules
2920
+ */
2921
+ modules?: CSSModulesOptions | false;
2922
+ /**
2923
+ * Options for preprocessors.
2924
+ *
2925
+ * In addition to options specific to each processors, Vite supports `additionalData` option.
2926
+ * The `additionalData` option can be used to inject extra code for each style content.
2927
+ */
2928
+ preprocessorOptions?: {
2929
+ scss?: SassPreprocessorOptions;
2930
+ sass?: SassPreprocessorOptions;
2931
+ less?: LessPreprocessorOptions;
2932
+ styl?: StylusPreprocessorOptions;
2933
+ stylus?: StylusPreprocessorOptions;
2934
+ };
2935
+ /**
2936
+ * If this option is set, preprocessors will run in workers when possible.
2937
+ * `true` means the number of CPUs minus 1.
2938
+ *
2939
+ * @default true
2940
+ */
2941
+ preprocessorMaxWorkers?: number | true;
2942
+ postcss?: string | (PostCSS.ProcessOptions & {
2943
+ plugins?: PostCSS.AcceptedPlugin[];
2944
+ });
2945
+ /**
2946
+ * Enables css sourcemaps during dev
2947
+ * @default false
2948
+ * @experimental
2949
+ */
2950
+ devSourcemap?: boolean;
2951
+ /**
2952
+ * @experimental
2953
+ */
2954
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
2955
+ }
2956
+ interface CSSModulesOptions {
2957
+ getJSON?: (cssFileName: string, json: Record<string, string>, outputFileName: string) => void;
2958
+ scopeBehaviour?: "global" | "local";
2959
+ globalModulePaths?: RegExp[];
2960
+ exportGlobals?: boolean;
2961
+ generateScopedName?: string | ((name: string, filename: string, css: string) => string);
2962
+ hashPrefix?: string;
2963
+ /**
2964
+ * default: undefined
2965
+ */
2966
+ localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly" | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
2967
+ }
2968
+ type ResolvedCSSOptions = Omit<CSSOptions, "lightningcss"> & Required<Pick<CSSOptions, "transformer" | "devSourcemap">> & {
2969
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
2970
+ };
2971
+ interface PreprocessCSSResult {
2972
+ code: string;
2973
+ map?: SourceMapInput;
2974
+ modules?: Record<string, string>;
2975
+ deps?: Set<string>;
2976
+ }
2977
+ /**
2978
+ * @experimental
2979
+ */
2980
+ declare function preprocessCSS(code: string, filename: string, config: ResolvedConfig): Promise<PreprocessCSSResult>;
2981
+ declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
2982
+ type PreprocessorAdditionalDataResult = string | {
2983
+ content: string;
2984
+ map?: ExistingRawSourceMap;
2985
+ };
2986
+ type PreprocessorAdditionalData = string | ((source: string, filename: string) => PreprocessorAdditionalDataResult | Promise<PreprocessorAdditionalDataResult>);
2987
+ type SassPreprocessorOptions = {
2988
+ additionalData?: PreprocessorAdditionalData;
2989
+ } & SassModernPreprocessBaseOptions;
2990
+ type LessPreprocessorOptions = {
2991
+ additionalData?: PreprocessorAdditionalData;
2992
+ } & LessPreprocessorBaseOptions;
2993
+ type StylusPreprocessorOptions = {
2994
+ additionalData?: PreprocessorAdditionalData;
2995
+ } & StylusPreprocessorBaseOptions;
2996
+ //#endregion
2997
+ //#region src/node/plugins/esbuild.d.ts
2998
+ interface ESBuildOptions extends esbuild_TransformOptions {
2999
+ include?: string | RegExp | ReadonlyArray<string | RegExp>;
3000
+ exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3001
+ jsxInject?: string;
3002
+ /**
3003
+ * This option is not respected. Use `build.minify` instead.
3004
+ */
3005
+ minify?: never;
3006
+ }
3007
+ type ESBuildTransformResult = Omit<esbuild_TransformResult, "map"> & {
3008
+ map: SourceMap;
3009
+ };
3010
+ declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<ESBuildTransformResult>;
3011
+ //#endregion
3012
+ //#region src/node/plugins/json.d.ts
3013
+ interface JsonOptions {
3014
+ /**
3015
+ * Generate a named export for every property of the JSON object
3016
+ * @default true
3017
+ */
3018
+ namedExports?: boolean;
3019
+ /**
3020
+ * Generate performant output as JSON.parse("stringified").
3021
+ *
3022
+ * When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
3023
+ * @default 'auto'
3024
+ */
3025
+ stringify?: boolean | "auto";
3026
+ }
3027
+ //#endregion
3028
+ //#region src/node/ssr/index.d.ts
3029
+ type SSRTarget = "node" | "webworker";
3030
+ type SsrDepOptimizationConfig = DepOptimizationConfig;
3031
+ interface SSROptions {
3032
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
3033
+ external?: string[] | true;
3034
+ /**
3035
+ * Define the target for the ssr build. The browser field in package.json
3036
+ * is ignored for node but used if webworker is the target
3037
+ * This option will be removed in a future major version
3038
+ * @default 'node'
3039
+ */
3040
+ target?: SSRTarget;
3041
+ /**
3042
+ * Control over which dependencies are optimized during SSR and esbuild options
3043
+ * During build:
3044
+ * no external CJS dependencies are optimized by default
3045
+ * During dev:
3046
+ * explicit no external CJS dependencies are optimized by default
3047
+ * @experimental
3048
+ */
3049
+ optimizeDeps?: SsrDepOptimizationConfig;
3050
+ resolve?: {
3051
+ /**
3052
+ * Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
3053
+ *
3054
+ * Use this to override the default ssr conditions for the ssr build.
3055
+ *
3056
+ * @default rootConfig.resolve.conditions
3057
+ */
3058
+ conditions?: string[];
3059
+ /**
3060
+ * Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
3061
+ *
3062
+ * @default ['node', 'module-sync']
3063
+ */
3064
+ externalConditions?: string[];
3065
+ mainFields?: string[];
3066
+ };
3067
+ }
3068
+ interface ResolvedSSROptions extends SSROptions {
3069
+ target: SSRTarget;
3070
+ optimizeDeps: SsrDepOptimizationConfig;
3071
+ }
3072
+ //#endregion
3073
+ //#region src/node/config.d.ts
3074
+ interface ConfigEnv {
3075
+ /**
3076
+ * 'serve': during dev (`vite` command)
3077
+ * 'build': when building for production (`vite build` command)
3078
+ */
3079
+ command: "build" | "serve";
3080
+ mode: string;
3081
+ isSsrBuild?: boolean;
3082
+ isPreview?: boolean;
3083
+ }
3084
+ /**
3085
+ * spa: include SPA fallback middleware and configure sirv with `single: true` in preview
3086
+ *
3087
+ * mpa: only include non-SPA HTML middlewares
3088
+ *
3089
+ * custom: don't include HTML middlewares
3090
+ */
3091
+ type AppType = "spa" | "mpa" | "custom";
3092
+ type UserConfigFnObject = (env: ConfigEnv) => UserConfig;
3093
+ type UserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
3094
+ type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
3095
+ type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
3096
+ /**
3097
+ * Type helper to make it easier to use vite.config.ts
3098
+ * accepts a direct {@link UserConfig} object, or a function that returns it.
3099
+ * The function receives a {@link ConfigEnv} object.
3100
+ */
3101
+ declare function defineConfig(config: UserConfig): UserConfig;
3102
+ declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
3103
+ declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
3104
+ declare function defineConfig(config: UserConfigFnPromise): UserConfigFnPromise;
3105
+ declare function defineConfig(config: UserConfigFn): UserConfigFn;
3106
+ declare function defineConfig(config: UserConfigExport): UserConfigExport;
3107
+ interface CreateDevEnvironmentContext {
3108
+ ws: WebSocketServer;
3109
+ }
3110
+ interface DevEnvironmentOptions {
3111
+ /**
3112
+ * Files to be pre-transformed. Supports glob patterns.
3113
+ */
3114
+ warmup?: string[];
3115
+ /**
3116
+ * Pre-transform known direct imports
3117
+ * defaults to true for the client environment, false for the rest
3118
+ */
3119
+ preTransformRequests?: boolean;
3120
+ /**
3121
+ * Enables sourcemaps during dev
3122
+ * @default { js: true }
3123
+ * @experimental
3124
+ */
3125
+ sourcemap?: boolean | {
3126
+ js?: boolean;
3127
+ css?: boolean;
3128
+ };
3129
+ /**
3130
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
3131
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
3132
+ *
3133
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
3134
+ * disable this behavior, or, for full control, a function that takes the source path and
3135
+ * sourcemap path and returns whether to ignore the source path.
3136
+ */
3137
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
3138
+ /**
3139
+ * create the Dev Environment instance
3140
+ */
3141
+ createEnvironment?: (name: string, config: ResolvedConfig, context: CreateDevEnvironmentContext) => Promise<DevEnvironment> | DevEnvironment;
3142
+ /**
3143
+ * For environments that support a full-reload, like the client, we can short-circuit when
3144
+ * restarting the server throwing early to stop processing current files. We avoided this for
3145
+ * SSR requests. Maybe this is no longer needed.
3146
+ * @experimental
3147
+ */
3148
+ recoverable?: boolean;
3149
+ /**
3150
+ * For environments associated with a module runner.
3151
+ * By default, it is false for the client environment and true for non-client environments.
3152
+ * This option can also be used instead of the removed config.experimental.skipSsrTransform.
3153
+ */
3154
+ moduleRunnerTransform?: boolean;
3155
+ }
3156
+ type ResolvedDevEnvironmentOptions = Omit<Required<DevEnvironmentOptions>, "sourcemapIgnoreList"> & {
3157
+ sourcemapIgnoreList: Exclude<DevEnvironmentOptions["sourcemapIgnoreList"], false | undefined>;
3158
+ };
3159
+ type AllResolveOptions = ResolveOptions & {
3160
+ alias?: AliasOptions;
3161
+ };
3162
+ interface SharedEnvironmentOptions {
3163
+ /**
3164
+ * Define global variable replacements.
3165
+ * Entries will be defined on `window` during dev and replaced during build.
3166
+ */
3167
+ define?: Record<string, any>;
3168
+ /**
3169
+ * Configure resolver
3170
+ */
3171
+ resolve?: EnvironmentResolveOptions;
3172
+ /**
3173
+ * Define if this environment is used for Server-Side Rendering
3174
+ * @default 'server' if it isn't the client environment
3175
+ */
3176
+ consumer?: "client" | "server";
3177
+ /**
3178
+ * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
3179
+ * Otherwise, it is statically replaced as an empty object.
3180
+ */
3181
+ keepProcessEnv?: boolean;
3182
+ /**
3183
+ * Optimize deps config
3184
+ */
3185
+ optimizeDeps?: DepOptimizationOptions;
3186
+ }
3187
+ interface EnvironmentOptions extends SharedEnvironmentOptions {
3188
+ /**
3189
+ * Dev specific options
3190
+ */
3191
+ dev?: DevEnvironmentOptions;
3192
+ /**
3193
+ * Build specific options
3194
+ */
3195
+ build?: BuildEnvironmentOptions;
3196
+ }
3197
+ type ResolvedResolveOptions = Required<ResolveOptions>;
3198
+ type ResolvedEnvironmentOptions = {
3199
+ define?: Record<string, any>;
3200
+ resolve: ResolvedResolveOptions;
3201
+ consumer: "client" | "server";
3202
+ keepProcessEnv?: boolean;
3203
+ optimizeDeps: DepOptimizationOptions;
3204
+ dev: ResolvedDevEnvironmentOptions;
3205
+ build: ResolvedBuildEnvironmentOptions;
3206
+ plugins: readonly Plugin[];
3207
+ };
3208
+ type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve" | "keepProcessEnv"> & {
3209
+ resolve?: AllResolveOptions;
3210
+ };
3211
+ interface UserConfig extends DefaultEnvironmentOptions {
3212
+ /**
3213
+ * Project root directory. Can be an absolute path, or a path relative from
3214
+ * the location of the config file itself.
3215
+ * @default process.cwd()
3216
+ */
3217
+ root?: string;
3218
+ /**
3219
+ * Base public path when served in development or production.
3220
+ * @default '/'
3221
+ */
3222
+ base?: string;
3223
+ /**
3224
+ * Directory to serve as plain static assets. Files in this directory are
3225
+ * served and copied to build dist dir as-is without transform. The value
3226
+ * can be either an absolute file system path or a path relative to project root.
3227
+ *
3228
+ * Set to `false` or an empty string to disable copied static assets to build dist dir.
3229
+ * @default 'public'
3230
+ */
3231
+ publicDir?: string | false;
3232
+ /**
3233
+ * Directory to save cache files. Files in this directory are pre-bundled
3234
+ * deps or some other cache files that generated by vite, which can improve
3235
+ * the performance. You can use `--force` flag or manually delete the directory
3236
+ * to regenerate the cache files. The value can be either an absolute file
3237
+ * system path or a path relative to project root.
3238
+ * Default to `.vite` when no `package.json` is detected.
3239
+ * @default 'node_modules/.vite'
3240
+ */
3241
+ cacheDir?: string;
3242
+ /**
3243
+ * Explicitly set a mode to run in. This will override the default mode for
3244
+ * each command, and can be overridden by the command line --mode option.
3245
+ */
3246
+ mode?: string;
3247
+ /**
3248
+ * Array of vite plugins to use.
3249
+ */
3250
+ plugins?: PluginOption[];
3251
+ /**
3252
+ * HTML related options
3253
+ */
3254
+ html?: HTMLOptions;
3255
+ /**
3256
+ * CSS related options (preprocessors and CSS modules)
3257
+ */
3258
+ css?: CSSOptions;
3259
+ /**
3260
+ * JSON loading options
3261
+ */
3262
+ json?: JsonOptions;
3263
+ /**
3264
+ * Transform options to pass to esbuild.
3265
+ * Or set to `false` to disable esbuild.
3266
+ */
3267
+ esbuild?: ESBuildOptions | false;
3268
+ /**
3269
+ * Specify additional picomatch patterns to be treated as static assets.
3270
+ */
3271
+ assetsInclude?: string | RegExp | (string | RegExp)[];
3272
+ /**
3273
+ * Builder specific options
3274
+ * @experimental
3275
+ */
3276
+ builder?: BuilderOptions;
3277
+ /**
3278
+ * Server specific options, e.g. host, port, https...
3279
+ */
3280
+ server?: ServerOptions$1;
3281
+ /**
3282
+ * Preview specific options, e.g. host, port, https...
3283
+ */
3284
+ preview?: PreviewOptions;
3285
+ /**
3286
+ * Experimental features
3287
+ *
3288
+ * Features under this field could change in the future and might NOT follow semver.
3289
+ * Please be careful and always pin Vite's version when using them.
3290
+ * @experimental
3291
+ */
3292
+ experimental?: ExperimentalOptions;
3293
+ /**
3294
+ * Options to opt-in to future behavior
3295
+ */
3296
+ future?: FutureOptions | "warn";
3297
+ /**
3298
+ * Legacy options
3299
+ *
3300
+ * Features under this field only follow semver for patches, they could be removed in a
3301
+ * future minor version. Please always pin Vite's version to a minor when using them.
3302
+ */
3303
+ legacy?: LegacyOptions;
3304
+ /**
3305
+ * Log level.
3306
+ * @default 'info'
3307
+ */
3308
+ logLevel?: LogLevel;
3309
+ /**
3310
+ * Custom logger.
3311
+ */
3312
+ customLogger?: Logger;
3313
+ /**
3314
+ * @default true
3315
+ */
3316
+ clearScreen?: boolean;
3317
+ /**
3318
+ * Environment files directory. Can be an absolute path, or a path relative from
3319
+ * root.
3320
+ * @default root
3321
+ */
3322
+ envDir?: string | false;
3323
+ /**
3324
+ * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3325
+ * @default 'VITE_'
3326
+ */
3327
+ envPrefix?: string | string[];
3328
+ /**
3329
+ * Worker bundle options
3330
+ */
3331
+ worker?: {
3332
+ /**
3333
+ * Output format for worker bundle
3334
+ * @default 'iife'
3335
+ */
3336
+ format?: "es" | "iife";
3337
+ /**
3338
+ * Vite plugins that apply to worker bundle. The plugins returned by this function
3339
+ * should be new instances every time it is called, because they are used for each
3340
+ * rollup worker bundling process.
3341
+ */
3342
+ plugins?: () => PluginOption[];
3343
+ /**
3344
+ * Rollup options to build worker bundle
3345
+ */
3346
+ rollupOptions?: Omit<RollupOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3347
+ };
3348
+ /**
3349
+ * Dep optimization options
3350
+ */
3351
+ optimizeDeps?: DepOptimizationOptions;
3352
+ /**
3353
+ * SSR specific options
3354
+ * We could make SSROptions be a EnvironmentOptions if we can abstract
3355
+ * external/noExternal for environments in general.
3356
+ */
3357
+ ssr?: SSROptions;
3358
+ /**
3359
+ * Environment overrides
3360
+ */
3361
+ environments?: Record<string, EnvironmentOptions>;
3362
+ /**
3363
+ * Whether your application is a Single Page Application (SPA),
3364
+ * a Multi-Page Application (MPA), or Custom Application (SSR
3365
+ * and frameworks with custom HTML handling)
3366
+ * @default 'spa'
3367
+ */
3368
+ appType?: AppType;
3369
+ }
3370
+ interface HTMLOptions {
3371
+ /**
3372
+ * A nonce value placeholder that will be used when generating script/style tags.
3373
+ *
3374
+ * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3375
+ */
3376
+ cspNonce?: string;
3377
+ }
3378
+ interface FutureOptions {
3379
+ removePluginHookHandleHotUpdate?: "warn";
3380
+ removePluginHookSsrArgument?: "warn";
3381
+ removeServerModuleGraph?: "warn";
3382
+ removeServerReloadModule?: "warn";
3383
+ removeServerPluginContainer?: "warn";
3384
+ removeServerHot?: "warn";
3385
+ removeServerTransformRequest?: "warn";
3386
+ removeServerWarmupRequest?: "warn";
3387
+ removeSsrLoadModule?: "warn";
3388
+ }
3389
+ interface ExperimentalOptions {
3390
+ /**
3391
+ * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
3392
+ *
3393
+ * @experimental
3394
+ * @default false
3395
+ */
3396
+ importGlobRestoreExtension?: boolean;
3397
+ /**
3398
+ * Allow finegrain control over assets and public files paths
3399
+ *
3400
+ * @experimental
3401
+ */
3402
+ renderBuiltUrl?: RenderBuiltAssetUrl;
3403
+ /**
3404
+ * Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
3405
+ *
3406
+ * @experimental
3407
+ * @default false
3408
+ */
3409
+ hmrPartialAccept?: boolean;
3410
+ }
3411
+ interface LegacyOptions {
3412
+ /**
3413
+ * In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
3414
+ * that could be exploited by a malicious web page.
3415
+ *
3416
+ * In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
3417
+ * But this may break some plugins and frameworks that connects to the WebSocket server
3418
+ * on their own. Enabling this option will make Vite skip the token check.
3419
+ *
3420
+ * **We do not recommend enabling this option unless you are sure that you are fine with
3421
+ * that security weakness.**
3422
+ */
3423
+ skipWebSocketTokenCheck?: boolean;
3424
+ }
3425
+ interface ResolvedWorkerOptions {
3426
+ format: "es" | "iife";
3427
+ plugins: (bundleChain: string[]) => Promise<ResolvedConfig>;
3428
+ rollupOptions: RollupOptions;
3429
+ }
3430
+ interface InlineConfig extends UserConfig {
3431
+ configFile?: string | false;
3432
+ /** @experimental */
3433
+ configLoader?: "bundle" | "runner" | "native";
3434
+ /** @deprecated */
3435
+ envFile?: false;
3436
+ forceOptimizeDeps?: boolean;
3437
+ }
3438
+ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "json" | "assetsInclude" | "optimizeDeps" | "worker" | "build" | "dev" | "environments" | "experimental" | "future" | "server" | "preview"> & {
3439
+ configFile: string | undefined;
3440
+ configFileDependencies: string[];
3441
+ inlineConfig: InlineConfig;
3442
+ root: string;
3443
+ base: string;
3444
+ publicDir: string;
3445
+ cacheDir: string;
3446
+ command: "build" | "serve";
3447
+ mode: string;
3448
+ isWorker: boolean;
3449
+ isProduction: boolean;
3450
+ envDir: string | false;
3451
+ env: Record<string, any>;
3452
+ resolve: Required<ResolveOptions> & {
3453
+ alias: Alias[];
3454
+ };
3455
+ plugins: readonly Plugin[];
3456
+ css: ResolvedCSSOptions;
3457
+ json: Required<JsonOptions>;
3458
+ esbuild: ESBuildOptions | false;
3459
+ server: ResolvedServerOptions;
3460
+ dev: ResolvedDevEnvironmentOptions;
3461
+ /** @experimental */
3462
+ builder: ResolvedBuilderOptions | undefined;
3463
+ build: ResolvedBuildOptions;
3464
+ preview: ResolvedPreviewOptions;
3465
+ ssr: ResolvedSSROptions;
3466
+ assetsInclude: (file: string) => boolean;
3467
+ logger: Logger;
3468
+ /**
3469
+ * Create an internal resolver to be used in special scenarios, e.g.
3470
+ * optimizer & handling css `@imports`.
3471
+ *
3472
+ * This API is deprecated. It only works for the client and ssr
3473
+ * environments. The `aliasOnly` option is also not being used anymore.
3474
+ * Plugins should move to `createIdResolver(environment.config)` instead.
3475
+ *
3476
+ * @deprecated Use `createIdResolver` from `vite` instead.
3477
+ */
3478
+ createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
3479
+ optimizeDeps: DepOptimizationOptions;
3480
+ worker: ResolvedWorkerOptions;
3481
+ appType: AppType;
3482
+ experimental: RequiredExceptFor<ExperimentalOptions, "renderBuiltUrl">;
3483
+ future: FutureOptions | undefined;
3484
+ environments: Record<string, ResolvedEnvironmentOptions>;
3485
+ /**
3486
+ * The token to connect to the WebSocket server from browsers.
3487
+ *
3488
+ * We recommend using `import.meta.hot` rather than connecting
3489
+ * to the WebSocket server directly.
3490
+ * If you have a usecase that requires connecting to the WebSocket
3491
+ * server, please create an issue so that we can discuss.
3492
+ *
3493
+ * @deprecated
3494
+ */
3495
+ webSocketToken: string;
3496
+ } & PluginHookUtils> {}
3497
+ interface PluginHookUtils {
3498
+ getSortedPlugins: <K$1 extends keyof Plugin>(hookName: K$1) => PluginWithRequiredHook<K$1>[];
3499
+ getSortedPluginHooks: <K$1 extends keyof Plugin>(hookName: K$1) => NonNullable<HookHandler<Plugin[K$1]>>[];
3500
+ }
3501
+ type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
3502
+ declare function resolveConfig(inlineConfig: InlineConfig, command: "build" | "serve", defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean, patchConfig?: ((config: ResolvedConfig) => void) | undefined, patchPlugins?: ((resolvedPlugins: Plugin[]) => void) | undefined): Promise<ResolvedConfig>;
3503
+ declare function sortUserPlugins(plugins: (Plugin | Plugin[])[] | undefined): [Plugin[], Plugin[], Plugin[]];
3504
+ declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, configRoot?: string, logLevel?: LogLevel, customLogger?: Logger, configLoader?: "bundle" | "runner" | "native"): Promise<{
3505
+ path: string;
3506
+ config: UserConfig;
3507
+ dependencies: string[];
3508
+ } | null>;
3509
+ //#endregion
3510
+ //#region src/node/idResolver.d.ts
3511
+ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
3512
+ /**
3513
+ * Create an internal resolver to be used in special scenarios, e.g.
3514
+ * optimizer and handling css @imports
3515
+ */
3516
+ declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
3517
+ //#endregion
3518
+ //#region src/node/server/middlewares/error.d.ts
3519
+ declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
3520
+ //#endregion
3521
+ //#region src/node/ssr/runtime/serverModuleRunner.d.ts
3522
+ /**
3523
+ * @experimental
3524
+ */
3525
+ interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, "root" | "fetchModule" | "hmr" | "transport"> {
3526
+ /**
3527
+ * Disable HMR or configure HMR logger.
3528
+ */
3529
+ hmr?: false | {
3530
+ logger?: ModuleRunnerHmr["logger"];
3531
+ };
3532
+ /**
3533
+ * Provide a custom module evaluator. This controls how the code is executed.
3534
+ */
3535
+ evaluator?: ModuleEvaluator;
3536
+ }
3537
+ declare const createServerModuleRunnerTransport: (options: {
3538
+ channel: NormalizedServerHotChannel;
3539
+ }) => ModuleRunnerTransport;
3540
+ /**
3541
+ * Create an instance of the Vite SSR runtime that support HMR.
3542
+ * @experimental
3543
+ */
3544
+ declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
3545
+ //#endregion
3546
+ //#region src/node/server/environments/runnableEnvironment.d.ts
3547
+ declare function createRunnableDevEnvironment(name: string, config: ResolvedConfig, context?: RunnableDevEnvironmentContext): RunnableDevEnvironment;
3548
+ interface RunnableDevEnvironmentContext extends Omit<DevEnvironmentContext, "hot"> {
3549
+ runner?: (environment: RunnableDevEnvironment, options?: ServerModuleRunnerOptions) => ModuleRunner;
3550
+ runnerOptions?: ServerModuleRunnerOptions;
3551
+ hot?: boolean;
3552
+ }
3553
+ declare function isRunnableDevEnvironment(environment: Environment): environment is RunnableDevEnvironment;
3554
+ declare class RunnableDevEnvironment extends DevEnvironment {
3555
+ private _runner;
3556
+ private _runnerFactory;
3557
+ private _runnerOptions;
3558
+ constructor(name: string, config: ResolvedConfig, context: RunnableDevEnvironmentContext);
3559
+ get runner(): ModuleRunner;
3560
+ close(): Promise<void>;
3561
+ }
3562
+ //#endregion
3563
+ //#region src/node/server/environments/fetchableEnvironments.d.ts
3564
+ interface FetchableDevEnvironmentContext extends DevEnvironmentContext {
3565
+ handleRequest(request: Request): Promise<Response> | Response;
3566
+ }
3567
+ declare function createFetchableDevEnvironment(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext): FetchableDevEnvironment;
3568
+ declare function isFetchableDevEnvironment(environment: Environment): environment is FetchableDevEnvironment;
3569
+ declare class FetchableDevEnvironment extends DevEnvironment {
3570
+ private _handleRequest;
3571
+ constructor(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext);
3572
+ dispatchFetch(request: Request): Promise<Response>;
3573
+ }
3574
+ //#endregion
3575
+ //#region src/node/ssr/runnerImport.d.ts
3576
+ interface RunnerImportResult<T$1> {
3577
+ module: T$1;
3578
+ dependencies: string[];
3579
+ }
3580
+ /**
3581
+ * Import any file using the default Vite environment.
3582
+ * @experimental
3583
+ */
3584
+ declare function runnerImport<T$1>(moduleId: string, inlineConfig?: InlineConfig): Promise<RunnerImportResult<T$1>>;
3585
+ //#endregion
3586
+ //#region src/node/ssr/fetchModule.d.ts
3587
+ interface FetchModuleOptions {
3588
+ cached?: boolean;
3589
+ inlineSourceMap?: boolean;
3590
+ startOffset?: number;
3591
+ }
3592
+ /**
3593
+ * Fetch module information for Vite runner.
3594
+ * @experimental
3595
+ */
3596
+ declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
3597
+ //#endregion
3598
+ //#region src/node/ssr/ssrTransform.d.ts
3599
+ interface ModuleRunnerTransformOptions {
3600
+ json?: {
3601
+ stringify?: boolean;
3602
+ };
3603
+ }
3604
+ declare function ssrTransform(code: string, inMap: SourceMap | {
3605
+ mappings: "";
3606
+ } | null, url: string, originalCode: string, options?: ModuleRunnerTransformOptions): Promise<TransformResult | null>;
3607
+ //#endregion
3608
+ //#region src/node/constants.d.ts
3609
+ declare const VERSION: string;
3610
+ declare const DEFAULT_CLIENT_MAIN_FIELDS: readonly string[];
3611
+ declare const DEFAULT_SERVER_MAIN_FIELDS: readonly string[];
3612
+ declare const DEFAULT_CLIENT_CONDITIONS: readonly string[];
3613
+ declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
3614
+ declare const DEFAULT_EXTERNAL_CONDITIONS: readonly string[];
3615
+ declare const defaultAllowedOrigins: RegExp;
3616
+ //#endregion
3617
+ //#region src/node/utils.d.ts
3618
+ /**
3619
+ * Inlined to keep `@rollup/pluginutils` in devDependencies
3620
+ */
3621
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
3622
+ declare const createFilter: (include?: FilterPattern, exclude?: FilterPattern, options?: {
3623
+ resolve?: string | false | null;
3624
+ }) => (id: string | unknown) => boolean;
3625
+ declare const rollupVersion: string;
3626
+ declare function normalizePath(id: string): string;
3627
+ declare const isCSSRequest: (request: string) => boolean;
3628
+ declare function mergeConfig<D extends Record<string, any>, O extends Record<string, any>>(defaults: D extends Function ? never : D, overrides: O extends Function ? never : O, isRoot?: boolean): Record<string, any>;
3629
+ declare function mergeAlias(a?: AliasOptions, b?: AliasOptions): AliasOptions | undefined;
3630
+ //#endregion
3631
+ //#region src/node/server/send.d.ts
3632
+ interface SendOptions {
3633
+ etag?: string;
3634
+ cacheControl?: string;
3635
+ headers?: OutgoingHttpHeaders;
3636
+ map?: SourceMap | {
3637
+ mappings: "";
3638
+ } | null;
3639
+ }
3640
+ declare function send(req: http.IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, options: SendOptions): void;
3641
+ //#endregion
3642
+ //#region src/node/server/searchRoot.d.ts
3643
+ /**
3644
+ * Search up for the nearest workspace root
3645
+ */
3646
+ declare function searchForWorkspaceRoot(current: string, root?: string): string;
3647
+ //#endregion
3648
+ //#region src/node/server/middlewares/static.d.ts
3649
+ /**
3650
+ * Check if the url is allowed to be served, via the `server.fs` config.
3651
+ * @deprecated Use the `isFileLoadingAllowed` function instead.
3652
+ */
3653
+ declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
3654
+ declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
3655
+ /**
3656
+ * Warning: parameters are not validated, only works with normalized absolute paths
3657
+ */
3658
+ declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
3659
+ //#endregion
3660
+ //#region src/node/env.d.ts
3661
+ declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
3662
+ declare function resolveEnvPrefix({
3663
+ envPrefix
3664
+ }: UserConfig): string[];
3665
+ //#endregion
3666
+ //#region src/node/plugins/manifest.d.ts
3667
+ type Manifest = Record<string, ManifestChunk>;
3668
+ interface ManifestChunk {
3669
+ /**
3670
+ * The input file name of this chunk / asset if known
3671
+ */
3672
+ src?: string;
3673
+ /**
3674
+ * The output file name of this chunk / asset
3675
+ */
3676
+ file: string;
3677
+ /**
3678
+ * The list of CSS files imported by this chunk
3679
+ *
3680
+ * This field is only present in JS chunks.
3681
+ */
3682
+ css?: string[];
3683
+ /**
3684
+ * The list of asset files imported by this chunk, excluding CSS files
3685
+ *
3686
+ * This field is only present in JS chunks.
3687
+ */
3688
+ assets?: string[];
3689
+ /**
3690
+ * Whether this chunk or asset is an entry point
3691
+ */
3692
+ isEntry?: boolean;
3693
+ /**
3694
+ * The name of this chunk / asset if known
3695
+ */
3696
+ name?: string;
3697
+ /**
3698
+ * Whether this chunk is a dynamic entry point
3699
+ *
3700
+ * This field is only present in JS chunks.
3701
+ */
3702
+ isDynamicEntry?: boolean;
3703
+ /**
3704
+ * The list of statically imported chunks by this chunk
3705
+ *
3706
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3707
+ */
3708
+ imports?: string[];
3709
+ /**
3710
+ * The list of dynamically imported chunks by this chunk
3711
+ *
3712
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3713
+ */
3714
+ dynamicImports?: string[];
3715
+ }
3716
+ //#endregion
3717
+ export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parseAst, parseAstAsync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, VERSION as version };