vite-hub 0.5.0 → 0.6.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 (553) hide show
  1. package/README.md +9 -8
  2. package/dist/_internal/runtime/browser-errors.d.ts +0 -2
  3. package/dist/_internal/runtime/browser-errors.js +3 -4
  4. package/dist/_internal/runtime/redirects.d.ts +1 -2
  5. package/dist/_internal/runtime/redirects.js +2 -3
  6. package/dist/_internal/runtime/request-policy.d.ts +1 -2
  7. package/dist/_internal/runtime/request-policy.js +2 -3
  8. package/dist/_internal/runtime/security.d.ts +1 -2
  9. package/dist/_internal/runtime/security.js +1 -2
  10. package/dist/{access-BC9HtX_M.js → access-CUFHPi8T.js} +13 -140
  11. package/dist/{access-policy-DhsEACna.d.ts → access-DkBck8Vu.d.ts} +17 -21
  12. package/dist/{access-policy-CVZg9LPR.js → access-policy-BM48XstY.js} +5 -6
  13. package/dist/{account-Cjj-tYzo.d.ts → account-DNr8fHcQ.d.ts} +5 -7
  14. package/dist/{console/runtime/server → agent/console}/agents.get.d.ts +2 -3
  15. package/dist/{console/runtime/server → agent/console}/agents.get.js +3 -4
  16. package/dist/{console/runtime/server → agent/console}/channel-replay.d.ts +3 -5
  17. package/dist/{console/runtime/server → agent/console}/channel-replay.js +6 -7
  18. package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.d.ts +1 -3
  19. package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.js +4 -5
  20. package/dist/agent/console/invocation-workspace.get.d.ts +6 -0
  21. package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.js +6 -7
  22. package/dist/{console/runtime/server → agent/console}/invocation.get.d.ts +4 -6
  23. package/dist/{console/runtime/server → agent/console}/invocation.get.js +8 -9
  24. package/dist/{console/runtime/server → agent/console}/invocations.get.d.ts +1 -2
  25. package/dist/{console/runtime/server → agent/console}/invocations.get.js +5 -6
  26. package/dist/agent/console/invocations.usage.d.ts +6 -0
  27. package/dist/agent/console/invocations.usage.js +51 -0
  28. package/dist/agent/console/operations.d.ts +6 -0
  29. package/dist/agent/console/operations.js +247 -0
  30. package/dist/{console/runtime/server → agent/console}/status.get.d.ts +2 -4
  31. package/dist/{console/runtime/server → agent/console}/status.get.js +6 -7
  32. package/dist/{server-W0c79AYZ.js → agent-console-CHsLxKk_.js} +4 -4
  33. package/dist/agent-console-FmaYpVv-.d.ts +14 -0
  34. package/dist/{agent-invocations.post-C3Onl2yH.js → agent-invocations.post-CF5anHY6.js} +14 -17
  35. package/dist/agents-DBm_PJie.js +1 -0
  36. package/dist/{agents-B76RICcy.js → agents-DXLHsE7x.js} +5 -6
  37. package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
  38. package/dist/auth/console/auth.d.ts +25 -0
  39. package/dist/{console/runtime/server → auth/console}/auth.js +11 -13
  40. package/dist/auth/console/operations.d.ts +3 -0
  41. package/dist/auth/console/operations.js +135 -0
  42. package/dist/auth/server.js +1 -2
  43. package/dist/{auth-operations-GcQk0O0X.js → auth-operations-BKqoX8Ua.js} +4 -5
  44. package/dist/{auth-types-D3ugQ8xM.d.ts → auth-types-Cotn7406.d.ts} +4 -21
  45. package/dist/bin.js +8 -11
  46. package/dist/blob/console/operations.d.ts +3 -0
  47. package/dist/blob/console/operations.js +44 -0
  48. package/dist/blob/nuxt-image.js +1 -2
  49. package/dist/{blob-BcgsZtqM.js → blob-iw8pWQ6o.js} +5 -6
  50. package/dist/{blob-iVewd7KQ.d.ts → blob-uNin0_TV.d.ts} +1 -3
  51. package/dist/{browser-error-limits-CToqAD-O.js → browser-error-limits-B0yS95zt.js} +2 -4
  52. package/dist/cache/operations.d.ts +2 -4
  53. package/dist/cache/operations.js +3 -4
  54. package/dist/cache.d.ts +1 -3
  55. package/dist/cache.js +2 -3
  56. package/dist/{cli-config-FPHk1nbC.js → cli-config-BX8H4ZCo.js} +2 -3
  57. package/dist/cli-config-DgpmE_7z.js +1 -0
  58. package/dist/cms.js +1 -2
  59. package/dist/console/auth-types.d.ts +2 -2
  60. package/dist/console/auth.d.ts +2 -4
  61. package/dist/console/auth.js +2 -3
  62. package/dist/console/runtime/auth-operations.d.ts +4 -6
  63. package/dist/console/runtime/auth-operations.js +1 -2
  64. package/dist/console/runtime/client/account-views.d.ts +1 -3
  65. package/dist/console/runtime/client/account-views.js +1 -2
  66. package/dist/console/runtime/client/account.d.ts +1 -1
  67. package/dist/console/runtime/client/account.js +29 -45
  68. package/dist/console/runtime/client/appearance.d.ts +1 -2
  69. package/dist/console/runtime/client/appearance.js +1 -2
  70. package/dist/console/runtime/client/auth-management.ts +6 -6
  71. package/dist/console/runtime/client/blob-media.d.ts +2 -4
  72. package/dist/console/runtime/client/blob-media.js +5 -6
  73. package/dist/console/runtime/client/comment-thread.d.ts +1 -3
  74. package/dist/console/runtime/client/comment-thread.js +3 -4
  75. package/dist/console/runtime/client/content-heads.d.ts +1 -2
  76. package/dist/console/runtime/client/content-heads.js +2 -3
  77. package/dist/console/runtime/client/documents.d.ts +2 -2
  78. package/dist/console/runtime/client/documents.js +1 -2
  79. package/dist/console/runtime/client/editor.d.ts +3 -5
  80. package/dist/console/runtime/client/editor.js +1 -2
  81. package/dist/console/runtime/client/env-groups.d.ts +1 -3
  82. package/dist/console/runtime/client/env-groups.js +1 -2
  83. package/dist/console/runtime/client/env-status.d.ts +1 -3
  84. package/dist/console/runtime/client/env-status.js +1 -2
  85. package/dist/console/runtime/client/format.d.ts +1 -3
  86. package/dist/console/runtime/client/format.js +1 -2
  87. package/dist/console/runtime/client/invocation-deletion.d.ts +1 -2
  88. package/dist/console/runtime/client/invocation-deletion.js +1 -2
  89. package/dist/console/runtime/client/invocation.d.ts +1 -2
  90. package/dist/console/runtime/client/invocation.js +4 -5
  91. package/dist/console/runtime/client/live.d.ts +2 -4
  92. package/dist/console/runtime/client/live.js +1 -2
  93. package/dist/console/runtime/client/mcp-client.d.ts +7 -5
  94. package/dist/console/runtime/client/mcp-client.js +10 -5
  95. package/dist/console/runtime/client/media-library.d.ts +1 -1
  96. package/dist/console/runtime/client/media-library.js +1 -2
  97. package/dist/console/runtime/client/media-uploads.d.ts +2 -4
  98. package/dist/console/runtime/client/media-uploads.js +2 -3
  99. package/dist/console/runtime/client/media.d.ts +1 -1
  100. package/dist/console/runtime/client/media.js +1 -2
  101. package/dist/console/runtime/client/operation-view.d.ts +2 -4
  102. package/dist/console/runtime/client/operation-view.js +4 -5
  103. package/dist/console/runtime/client/presence.d.ts +2 -4
  104. package/dist/console/runtime/client/presence.js +1 -2
  105. package/dist/console/runtime/client/preview.d.ts +1 -3
  106. package/dist/console/runtime/client/preview.js +1 -2
  107. package/dist/console/runtime/client/problem.d.ts +2 -4
  108. package/dist/console/runtime/client/problem.js +3 -4
  109. package/dist/console/runtime/client/project-link.d.ts +1 -1
  110. package/dist/console/runtime/client/project-link.js +1 -2
  111. package/dist/console/runtime/client/project-session.d.ts +19 -10
  112. package/dist/console/runtime/client/project-session.js +1 -723
  113. package/dist/console/runtime/client/project.d.ts +1 -3
  114. package/dist/console/runtime/client/project.js +1 -2
  115. package/dist/console/runtime/client/projects.d.ts +1 -1
  116. package/dist/console/runtime/client/projects.js +1 -2
  117. package/dist/console/runtime/client/publish.d.ts +2 -4
  118. package/dist/console/runtime/client/publish.js +1 -2
  119. package/dist/console/runtime/client/rate-limit.d.ts +1 -3
  120. package/dist/console/runtime/client/rate-limit.js +3 -4
  121. package/dist/console/runtime/client/read-only.d.ts +2 -4
  122. package/dist/console/runtime/client/read-only.js +2 -3
  123. package/dist/console/runtime/client/request.d.ts +2 -2
  124. package/dist/console/runtime/client/request.js +1 -2
  125. package/dist/console/runtime/client/route-query.d.ts +4 -5
  126. package/dist/console/runtime/client/route-query.js +1 -2
  127. package/dist/console/runtime/client/schedule-run.d.ts +1 -3
  128. package/dist/console/runtime/client/schedule-run.js +3 -4
  129. package/dist/console/runtime/client/schema-form.d.ts +1 -1
  130. package/dist/console/runtime/client/schema-form.js +1 -2
  131. package/dist/console/runtime/client/sections.d.ts +1 -1
  132. package/dist/console/runtime/client/sections.js +1 -2
  133. package/dist/console/runtime/client/site-access.d.ts +83 -16
  134. package/dist/console/runtime/client/site-access.js +159 -32
  135. package/dist/console/runtime/client/site-link.d.ts +2 -0
  136. package/dist/console/runtime/client/site-link.js +1 -0
  137. package/dist/console/runtime/client/stored.d.ts +1 -3
  138. package/dist/console/runtime/client/stored.js +1 -2
  139. package/dist/console/runtime/client/toast.d.ts +1 -3
  140. package/dist/console/runtime/client/toast.js +1 -2
  141. package/dist/console/runtime/client/workflow.d.ts +1 -3
  142. package/dist/console/runtime/client/workflow.js +3 -4
  143. package/dist/console/runtime/components/console-account-home.vue +9 -7
  144. package/dist/console/runtime/components/console-account-link.vue +8 -5
  145. package/dist/console/runtime/components/console-account-setup.vue +10 -7
  146. package/dist/console/runtime/components/console-account-shell.vue +7 -2
  147. package/dist/console/runtime/components/console-account-unlink.vue +2 -3
  148. package/dist/console/runtime/components/console-app-settings.vue +8 -2
  149. package/dist/console/runtime/components/console-auth-detail.vue +1 -1
  150. package/dist/console/runtime/components/console-auth-event-list.vue +1 -0
  151. package/dist/console/runtime/components/console-document-editor.vue +3 -4
  152. package/dist/console/runtime/components/console-hosted-comments-embed.vue +106 -0
  153. package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
  154. package/dist/console/runtime/components/console-mcp-items.vue +3 -16
  155. package/dist/console/runtime/components/console-site.vue +10 -8
  156. package/dist/console/runtime/components/console-usage.vue +2 -2
  157. package/dist/console/runtime/console-route.d.ts +1 -3
  158. package/dist/console/runtime/console-route.js +1 -2
  159. package/dist/console/runtime/definitions.d.ts +1 -1
  160. package/dist/console/runtime/definitions.js +1 -2
  161. package/dist/console/runtime/diagnostics.ts +14 -49
  162. package/dist/console/runtime/mcp-client.d.ts +2 -2
  163. package/dist/console/runtime/mcp-client.js +1 -2
  164. package/dist/console/runtime/operation-loader.d.ts +1 -0
  165. package/dist/console/runtime/operation-loader.js +10 -0
  166. package/dist/console/runtime/page-tool/account.js +26 -0
  167. package/dist/console/runtime/page-tool/page-tool.js +2 -2
  168. package/dist/console/runtime/rpc.d.ts +1 -1
  169. package/dist/console/runtime/rpc.js +1 -2
  170. package/dist/console/runtime/sections.d.ts +2 -2
  171. package/dist/console/runtime/sections.js +1 -2
  172. package/dist/console/runtime/server/access-policy.d.ts +1 -1
  173. package/dist/console/runtime/server/access-policy.js +1 -2
  174. package/dist/console/runtime/server/agent-console.d.ts +2 -0
  175. package/dist/console/runtime/server/agent-console.js +1 -0
  176. package/dist/console/runtime/server/blob.d.ts +1 -1
  177. package/dist/console/runtime/server/blob.js +1 -2
  178. package/dist/console/runtime/server/database.d.ts +1 -1
  179. package/dist/console/runtime/server/database.js +1 -2
  180. package/dist/console/runtime/server/definitions.d.ts +1 -1
  181. package/dist/console/runtime/server/definitions.get.d.ts +4 -6
  182. package/dist/console/runtime/server/definitions.get.js +5 -6
  183. package/dist/console/runtime/server/definitions.js +1 -2
  184. package/dist/console/runtime/server/development.d.ts +1 -1
  185. package/dist/console/runtime/server/development.js +1 -2
  186. package/dist/console/runtime/server/documents.d.ts +2 -2
  187. package/dist/console/runtime/server/documents.js +3 -3
  188. package/dist/console/runtime/server/entry-site-access.d.ts +3 -0
  189. package/dist/console/runtime/server/entry-site-access.js +4 -0
  190. package/dist/console/runtime/server/entry.d.ts +3 -0
  191. package/dist/console/runtime/server/entry.js +4 -0
  192. package/dist/console/runtime/server/env.d.ts +1 -3
  193. package/dist/console/runtime/server/env.js +1 -2
  194. package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
  195. package/dist/console/runtime/server/operation-contributions.js +1 -2
  196. package/dist/console/runtime/server/pill.d.ts +45 -0
  197. package/dist/console/runtime/server/pill.js +62 -0
  198. package/dist/console/runtime/server/rpc.d.ts +5 -10
  199. package/dist/console/runtime/server/rpc.js +19 -27
  200. package/dist/console/runtime/server/runtime.d.ts +1 -1
  201. package/dist/console/runtime/server/runtime.js +1 -2
  202. package/dist/console/runtime/server/sections.d.ts +5 -5
  203. package/dist/console/runtime/server/sections.get.d.ts +1 -1
  204. package/dist/console/runtime/server/sections.get.js +8 -9
  205. package/dist/console/runtime/server/sections.js +6 -6
  206. package/dist/console/runtime/server/setup.d.ts +5 -5
  207. package/dist/console/runtime/server/setup.js +5 -5
  208. package/dist/console/runtime/server/site-access-operation.d.ts +7 -0
  209. package/dist/console/runtime/server/site-access-operation.js +36 -0
  210. package/dist/console/runtime/server/site-actions.d.ts +73 -0
  211. package/dist/console/runtime/server/site-actions.js +105 -0
  212. package/dist/console/runtime/server/site-entry.d.ts +16 -9
  213. package/dist/console/runtime/server/site-entry.js +62 -46
  214. package/dist/console/runtime/server/site-visitor.d.ts +17 -0
  215. package/dist/console/runtime/server/site-visitor.js +1 -0
  216. package/dist/console/runtime/server/site.d.ts +27 -0
  217. package/dist/console/runtime/server/site.js +1 -0
  218. package/dist/console/runtime/skills.d.ts +1 -3
  219. package/dist/console/runtime/skills.js +1 -2
  220. package/dist/console/server.d.ts +9 -25
  221. package/dist/console/server.js +8 -8
  222. package/dist/console/ui.d.ts +0 -10
  223. package/dist/console/ui.js +14 -27
  224. package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
  225. package/dist/{console-route-CM2G5hiC.js → console-route-DbdnLkkF.js} +2 -3
  226. package/dist/console-signature--55DIKf2.js +237 -0
  227. package/dist/console.d.ts +1 -3
  228. package/dist/console.js +1 -2
  229. package/dist/content/console/operations.d.ts +3 -0
  230. package/dist/content/console/operations.js +62 -0
  231. package/dist/{console/runtime/server → database/console}/database.get.d.ts +2 -3
  232. package/dist/{console/runtime/server → database/console}/database.get.js +4 -5
  233. package/dist/database/console/operations.d.ts +3 -0
  234. package/dist/database/console/operations.js +49 -0
  235. package/dist/{database-UMJgnU2z.js → database-CrgBUdIx.js} +3 -4
  236. package/dist/{database-DC67Ipm-.d.ts → database-yFezh5U1.d.ts} +1 -3
  237. package/dist/{definition-catalog-BUcclwSH.js → definition-catalog-1xPPtzOx.js} +3 -4
  238. package/dist/definition-catalog-M5ua7JRS.js +1 -0
  239. package/dist/{definitions-BW6SvmMM.js → definitions-BFYqXchw.js} +1 -2
  240. package/dist/{definitions-DB4LbZ7T.d.ts → definitions-ChvMnA1L.d.ts} +0 -2
  241. package/dist/{definitions-DTytrw42.js → definitions-DGo2rNQ9.js} +5 -6
  242. package/dist/{definitions-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
  243. package/dist/{deployment-BUshgN5Q.js → deployment-CURATxjG.js} +2 -3
  244. package/dist/deployment-l7RuKdEp.js +1 -0
  245. package/dist/{dev-peer-CHjyHYG6.js → dev-peer-CRYp01PE.js} +2 -222
  246. package/dist/dev-peer-CX5C9243.js +1 -0
  247. package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
  248. package/dist/{development-RnopiRwK.d.ts → development-I40mfD7B.d.ts} +1 -3
  249. package/dist/{diagnostics-DtR0TAmq.js → diagnostics-DLHqjKGe.js} +3 -9
  250. package/dist/diagnostics-DgGKvWzF.d.ts +7 -0
  251. package/dist/docs/nuxt.js +1 -2
  252. package/dist/doctor.d.ts +0 -6
  253. package/dist/doctor.js +11492 -12152
  254. package/dist/{documents-BDR0AkYR.d.ts → documents-A-7Ho0g0.d.ts} +12 -16
  255. package/dist/{documents-B4R4JSfH.js → documents-BduuZjm3.js} +6 -6
  256. package/dist/{documents-BASIRZ91.d.ts → documents-CApMRd4o.d.ts} +4 -7
  257. package/dist/{documents-BewAPY61.js → documents-D6ueeoUR.js} +17 -21
  258. package/dist/durability/operations.d.ts +2 -4
  259. package/dist/durability/operations.js +3 -4
  260. package/dist/{entries-DbyNPLC9.js → entries-UFs9n1MB.js} +2 -3
  261. package/dist/{console/runtime/server → env/console}/env.get.d.ts +2 -4
  262. package/dist/env/console/env.get.js +15 -0
  263. package/dist/env/console/operations.d.ts +3 -0
  264. package/dist/env/console/operations.js +12 -0
  265. package/dist/env/vite.d.ts +1 -0
  266. package/dist/env/vite.js +2 -0
  267. package/dist/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
  268. package/dist/{error-diagnostics-B1yAIaSn.js → error-diagnostics-CBtvqI30.js} +2 -7
  269. package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
  270. package/dist/error-diagnostics.ts +1 -7
  271. package/dist/{features-CC5OcZqJ.js → features-BXRKlmtN.js} +5 -6
  272. package/dist/features-CD5i5I8V.js +1 -0
  273. package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
  274. package/dist/{github-login-Bi3bfjRX.js → github-login-W-vaahWP.js} +1 -2
  275. package/dist/{host-CkL0jjBq.js → host-DeNPYIeV.js} +1 -2
  276. package/dist/{http-error-Bs6e8_-8.js → http-error-BorAxJYM.js} +1 -2
  277. package/dist/index.d.ts +1 -7
  278. package/dist/index.js +5 -7
  279. package/dist/{inspect-DbZuP_7b.js → inspect-CWwAuL-B.js} +2 -3
  280. package/dist/internal/agent-invocations-libsql.js +1 -2
  281. package/dist/internal/disabled-redis-driver.d.ts +1 -3
  282. package/dist/internal/disabled-redis-driver.js +2 -3
  283. package/dist/internal/disabled-upstash-driver.d.ts +1 -3
  284. package/dist/internal/disabled-upstash-driver.js +2 -3
  285. package/dist/internal/test-loader.d.ts +1 -3
  286. package/dist/internal/test-loader.js +2 -3
  287. package/dist/internal/test-server.js +2 -3
  288. package/dist/{internal-BreyUsQ6.js → internal-0C_CC601.js} +1 -2
  289. package/dist/{internal-Cc9N0shU.d.ts → internal-BRNf11h3.d.ts} +14 -8
  290. package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
  291. package/dist/{invocation-page-undo-DqYcPlkQ.js → invocation-page-undo-DHbXczWY.js} +8 -7
  292. package/dist/invocations-B60XWNES.js +45 -0
  293. package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
  294. package/dist/logs/client.d.ts +1 -3
  295. package/dist/logs/client.js +1 -2
  296. package/dist/{console/runtime/server → logs/console}/logs.get.d.ts +3 -5
  297. package/dist/{console/runtime/server → logs/console}/logs.get.js +7 -8
  298. package/dist/logs/console/operations.d.ts +3 -0
  299. package/dist/logs/console/operations.js +23 -0
  300. package/dist/logs/host.d.ts +2 -4
  301. package/dist/logs/host.js +1 -2
  302. package/dist/logs/memory.d.ts +1 -1
  303. package/dist/logs/memory.js +1 -2
  304. package/dist/logs/source.d.ts +1 -1
  305. package/dist/logs/source.js +1 -2
  306. package/dist/logs.d.ts +2 -2
  307. package/dist/logs.js +2 -2
  308. package/dist/loopback-Bl9Cvj1k.js +139 -0
  309. package/dist/mcp/eval.d.ts +1 -0
  310. package/dist/mcp/eval.js +2 -0
  311. package/dist/{mcp-client-C_sEmyQw.d.ts → mcp-client-uXVvS7RL.d.ts} +5 -10
  312. package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
  313. package/dist/{media-D3OfyKni.js → media-CNwnh6CG.js} +8 -9
  314. package/dist/{media-library-o8RRsnn_.js → media-library-DTC8TLsZ.js} +5 -6
  315. package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
  316. package/dist/{memory-C54SDH_l.js → memory-D3EJS_Bp.js} +3 -4
  317. package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
  318. package/dist/{nuxt-server-auto-imports-cfTZYvgy.js → nuxt-server-auto-imports-4aT5BD4u.js} +1 -2
  319. package/dist/{nuxt-server-imports-75bWMeXc.js → nuxt-server-imports-BdJqiVhT.js} +1 -2
  320. package/dist/nuxt.d.ts +1 -3
  321. package/dist/nuxt.js +276 -182
  322. package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
  323. package/dist/{operation-contributions-C3lwePQu.js → operation-contributions-BU10k2QS.js} +9 -9
  324. package/dist/{operation-contributions-CrdmqtJW.d.ts → operation-contributions-xwjDzj28.d.ts} +6 -7
  325. package/dist/{operation-definition-DxjKcCGm.js → operation-definition-D04Rdjbe.js} +7 -9
  326. package/dist/operation-modules-BUXlwjvd.js +1 -0
  327. package/dist/operation-modules-DHWkPcfS.js +139 -0
  328. package/dist/{operation-registry-BogGwk_I.js → operation-registry-DfQbL7vE.js} +1 -2
  329. package/dist/{operation-rpc-DI9txNxK.js → operation-rpc-BMdfapja.js} +3 -4
  330. package/dist/operations-D-7ljPqw.js +1 -0
  331. package/dist/{operations-TTjL_7Zc.d.ts → operations-DgFhA1WE.d.ts} +0 -4
  332. package/dist/{operations-CFYGXqLm.js → operations-DksTrRMb.js} +4 -5
  333. package/dist/operations-byxiZ2R2.js +113 -0
  334. package/dist/{optional-owners-O6sj4uoj.js → optional-owners-Cypch7V3.js} +4 -6
  335. package/dist/{out-fRNaVslw.js → out-Cw5Tvr92.js} +2933 -2301
  336. package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
  337. package/dist/page/pill.iife.js +2 -2
  338. package/dist/page-tools-BeZrtn4S.js +46 -0
  339. package/dist/page-tools-Chk8Gm9x.d.ts +23 -0
  340. package/dist/page-tools-shared-BLPidmCi.js +39 -0
  341. package/dist/{pathe.M-eThtNZ-J4gfe1m9.js → pathe.M-eThtNZ-D4EC7Wue.js} +1 -2
  342. package/dist/{plugins-DoXnU6-s.d.ts → plugins-BmkOoyIh.d.ts} +25 -110
  343. package/dist/{plugins-BTZQaFtZ.js → plugins-DfXcUnzN.js} +1779 -1384
  344. package/dist/presets/workspace.js +1 -2
  345. package/dist/{project-Dgyq1F1V.d.ts → project-B2qWt8on.d.ts} +3 -12
  346. package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
  347. package/dist/{project-DXZRZEPX.js → project-_juMSuAS.js} +8 -11
  348. package/dist/{project-link-DT99MoyU.js → project-link-CJbCkOlC.js} +7 -8
  349. package/dist/{project-link-bNS-KROO.d.ts → project-link-Ck3vuq9w.d.ts} +2 -4
  350. package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
  351. package/dist/project-session-8pN7pRo8.js +764 -0
  352. package/dist/{projects-CAcXztf4.js → projects-BRp0iseV.js} +1 -2
  353. package/dist/{projects-Ddvl9EJp.d.ts → projects-mgPxrKZr.d.ts} +0 -2
  354. package/dist/{registry-zw6aE2N9.js → registry-B8JE5NY-.js} +1 -2
  355. package/dist/{registry-CDKLACCZ.js → registry-CnPC-gNu.js} +1 -2
  356. package/dist/{request-CMA2UKKq.js → request-D769eiBL.js} +5 -6
  357. package/dist/{request-D7h3SQ92.d.ts → request-DYmjLTqP.d.ts} +2 -4
  358. package/dist/{request-SBLxvpyr.d.ts → request-DkoE0b2h.d.ts} +11 -4
  359. package/dist/{request-Cs0FqxEL.js → request-XFVx7CGC.js} +30 -9
  360. package/dist/{request-origin-COUkgHd6.js → request-origin-pzWr9UUu.js} +1 -2
  361. package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-DegdyBIC.js} +2 -3
  362. package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
  363. package/dist/routes-D02vxUSg.js +26 -0
  364. package/dist/{rpc-DIUA61pv.js → rpc-D3tsx5lZ.js} +1 -2
  365. package/dist/{rpc-7nlHSv3y.d.ts → rpc-oijgKQtD.d.ts} +0 -2
  366. package/dist/{runtime-YLWfdrtO.js → runtime-CAbuQGMP.js} +3 -4
  367. package/dist/{runtime-B-46Bawt.js → runtime-CRJsqVTa.js} +2 -3
  368. package/dist/{runtime-DxfJOfCd.js → runtime-DA7HJe10.js} +3 -4
  369. package/dist/runtime-DGvimtvc.d.ts +5 -0
  370. package/dist/{runtime-CX_l_78I.js → runtime-F0CTqBFx.js} +5 -6
  371. package/dist/{runtime-feature-guard-CuyPVGj9.js → runtime-feature-guard-BKAMRZzM.js} +6 -7
  372. package/dist/scan-module-B1A24jqP.js +1 -0
  373. package/dist/{scan-module-Df58L_6T.js → scan-module-BfZvDBxb.js} +2 -4
  374. package/dist/{schema-form-C-fy3xaU.d.ts → schema-form-Bl79Bdm-.d.ts} +0 -2
  375. package/dist/search-jgMrZJXR.js +84 -0
  376. package/dist/{sections-DumoLKQN.js → sections-AUGy9EkY.js} +2 -8
  377. package/dist/{sections-BogiCmtz.d.ts → sections-BMkFB3S-.d.ts} +4 -6
  378. package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
  379. package/dist/{sections-Do7X4Nwt.d.ts → sections-DCoCa4nF.d.ts} +1 -8
  380. package/dist/sections-DjeAUX7o.d.ts +8 -0
  381. package/dist/{sections-BKUReack.js → sections-ZFAlI4JW.js} +14 -7
  382. package/dist/{sections.get-H46e2urg.d.ts → sections.get-BY5dClJY.d.ts} +2 -4
  383. package/dist/seo/runtime.d.ts +2 -5
  384. package/dist/seo/runtime.js +3 -5
  385. package/dist/{seo-CtLywyRx.d.ts → seo-CgW5uI9L.d.ts} +0 -2
  386. package/dist/seo.d.ts +1 -1
  387. package/dist/seo.js +1 -2
  388. package/dist/{setup-BC0P3eZy.d.ts → setup-BBnZPziq.d.ts} +5 -10
  389. package/dist/{setup-DNGzawFn.js → setup-yc3_WKNG.js} +4 -17
  390. package/dist/site-CZCIWsUQ.js +169 -0
  391. package/dist/site-link-Bvo2SxPo.js +58 -0
  392. package/dist/site-link-Dtw8MNVB.d.ts +18 -0
  393. package/dist/site-pages-B6J8U2Nq.js +66 -0
  394. package/dist/site-token-Wa7fhjwg.js +215 -0
  395. package/dist/site-visitor-BkhE2TA0.js +89 -0
  396. package/dist/skills/operations.d.ts +1 -5
  397. package/dist/skills/operations.js +4 -5
  398. package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
  399. package/dist/skills.d.ts +1 -2
  400. package/dist/{skills.get-CRd06TTb.js → skills.get-CW8vc_Hf.js} +3 -4
  401. package/dist/skills.js +1 -2
  402. package/dist/{source-Cw3iYvJF.js → source-DYFndd0W.js} +2 -3
  403. package/dist/{source-S-LChQvw.d.ts → source-DemBtwla.d.ts} +0 -2
  404. package/dist/{stored-Dhv2qsQv.js → stored-J3TetMKf.js} +1 -2
  405. package/dist/task/operations.d.ts +1 -5
  406. package/dist/task/operations.js +3 -4
  407. package/dist/test/register.js +2 -3
  408. package/dist/test.d.ts +0 -4
  409. package/dist/test.js +1 -2
  410. package/dist/ui/vite.js +1 -2
  411. package/dist/usage-DBi7aOhx.js +33 -0
  412. package/dist/{version-dkga9imp.js → version-DUCd7Orc.js} +24 -21
  413. package/dist/{vite-stage-D7fe614I.js → vite-stage-Dmo4RgnK.js} +3 -5
  414. package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
  415. package/dist/workspace/console/operations.d.ts +3 -0
  416. package/dist/workspace/console/operations.js +22 -0
  417. package/dist/{console/runtime/server → workspace/console}/workspace-files.get.d.ts +3 -5
  418. package/dist/{console/runtime/server → workspace/console}/workspace-files.get.js +4 -5
  419. package/dist/{workspace-history-B95Q-kGI.js → workspace-history-B52xib2J.js} +3 -4
  420. package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
  421. package/package.json +158 -149
  422. package/dist/agents-BhFggA26.js +0 -2
  423. package/dist/auth-GFIN6xSJ.d.ts +0 -120
  424. package/dist/cli-config-g_mbWdjT.js +0 -2
  425. package/dist/cloudflare-env-lookup-DKXdr4P_.js +0 -16
  426. package/dist/console/runtime/client/ticket.d.ts +0 -2
  427. package/dist/console/runtime/client/ticket.js +0 -2
  428. package/dist/console/runtime/page/loader.js +0 -134
  429. package/dist/console/runtime/server/auth.d.ts +0 -2
  430. package/dist/console/runtime/server/env.get.js +0 -16
  431. package/dist/console/runtime/server/invocation-workspace.get.d.ts +0 -8
  432. package/dist/console/runtime/server/mcp-client-operations.d.ts +0 -5
  433. package/dist/console/runtime/server/mcp-client-operations.js +0 -139
  434. package/dist/console/runtime/server/page-auth.d.ts +0 -18
  435. package/dist/console/runtime/server/page-auth.js +0 -44
  436. package/dist/console/runtime/server/page-tool.d.ts +0 -2
  437. package/dist/console/runtime/server/page-tool.js +0 -110
  438. package/dist/console/runtime/server/page-tools-route.d.ts +0 -2
  439. package/dist/console/runtime/server/page-tools-route.js +0 -5
  440. package/dist/console/runtime/server/search.get.d.ts +0 -4
  441. package/dist/console/runtime/server/search.get.js +0 -97
  442. package/dist/console/runtime/server/site-session.d.ts +0 -80
  443. package/dist/console/runtime/server/site-session.js +0 -2
  444. package/dist/console/runtime/server/tickets.d.ts +0 -2
  445. package/dist/console/runtime/server/tickets.js +0 -2
  446. package/dist/console/runtime/server/usage.get.d.ts +0 -10
  447. package/dist/console/runtime/server/usage.get.js +0 -92
  448. package/dist/console/runtime/site-access.d.ts +0 -2
  449. package/dist/console/runtime/site-access.js +0 -2
  450. package/dist/console-lazy-views-DXnIkdyd.js +0 -2
  451. package/dist/definition-catalog-og_1razf.js +0 -2
  452. package/dist/deployment-C2B0hBBj.js +0 -2
  453. package/dist/diagnostics-CjGiniKb.d.ts +0 -11
  454. package/dist/features-ujWsvlEH.js +0 -2
  455. package/dist/invocations-6jxqLkGY.js +0 -86
  456. package/dist/mcp-client-C91h8Taa.js +0 -1024
  457. package/dist/mcp-client-CTbTbn7d.js +0 -10
  458. package/dist/operations-5Lwd1xEI.js +0 -2
  459. package/dist/operations-ChEXk2ij.js +0 -853
  460. package/dist/page-tool-PmxH65gt.d.ts +0 -69
  461. package/dist/page-tools-ClgqElu-.js +0 -462
  462. package/dist/page-tools-DcCCtDKi.d.ts +0 -23
  463. package/dist/page-tools-shared-aNC9YtoI.js +0 -125
  464. package/dist/runtime-B_btezs1.d.ts +0 -7
  465. package/dist/scan-module-D_3X08mj.js +0 -2
  466. package/dist/secret-DELGKpCJ.js +0 -44
  467. package/dist/sections-CFiMNsqu.d.ts +0 -10
  468. package/dist/site-access-BycrwM2v.js +0 -18
  469. package/dist/site-access-CAiWyKOD.js +0 -2
  470. package/dist/site-access-DxfdOel1.d.ts +0 -55
  471. package/dist/site-access-L1qbvKt6.js +0 -293
  472. package/dist/site-session-CRwgKtTF.js +0 -300
  473. package/dist/skills/vitehub/SKILL.md +0 -142
  474. package/dist/skills/vitehub/agents/openai.yaml +0 -4
  475. package/dist/skills/vitehub/references/agent-definitions.md +0 -36
  476. package/dist/skills/vitehub/references/bundle.md +0 -57
  477. package/dist/skills/vitehub/references/capabilities-authority.md +0 -30
  478. package/dist/skills/vitehub/references/channels-triggers.md +0 -27
  479. package/dist/skills/vitehub/references/framework-composition.md +0 -29
  480. package/dist/skills/vitehub/references/preview-contract.md +0 -44
  481. package/dist/skills/vitehub/references/primitives/auth.md +0 -14
  482. package/dist/skills/vitehub/references/primitives/blob.md +0 -13
  483. package/dist/skills/vitehub/references/primitives/browser.md +0 -17
  484. package/dist/skills/vitehub/references/primitives/cache.md +0 -13
  485. package/dist/skills/vitehub/references/primitives/channels.md +0 -11
  486. package/dist/skills/vitehub/references/primitives/connections.md +0 -14
  487. package/dist/skills/vitehub/references/primitives/content.md +0 -13
  488. package/dist/skills/vitehub/references/primitives/database.md +0 -15
  489. package/dist/skills/vitehub/references/primitives/email.md +0 -11
  490. package/dist/skills/vitehub/references/primitives/env.md +0 -13
  491. package/dist/skills/vitehub/references/primitives/kv.md +0 -13
  492. package/dist/skills/vitehub/references/primitives/markdown-template.md +0 -13
  493. package/dist/skills/vitehub/references/primitives/queue.md +0 -14
  494. package/dist/skills/vitehub/references/primitives/rate-limit.md +0 -11
  495. package/dist/skills/vitehub/references/primitives/realtime.md +0 -19
  496. package/dist/skills/vitehub/references/primitives/sandbox-task.md +0 -11
  497. package/dist/skills/vitehub/references/primitives/sandbox.md +0 -13
  498. package/dist/skills/vitehub/references/primitives/schedule.md +0 -11
  499. package/dist/skills/vitehub/references/primitives/shell.md +0 -11
  500. package/dist/skills/vitehub/references/primitives/source.md +0 -11
  501. package/dist/skills/vitehub/references/primitives/workflow.md +0 -11
  502. package/dist/skills/vitehub/references/primitives/workspace.md +0 -11
  503. package/dist/skills/vitehub/references/project-patterns.md +0 -19
  504. package/dist/skills/vitehub/references/project-shapes.md +0 -81
  505. package/dist/skills/vitehub/references/proof-recovery.md +0 -31
  506. package/dist/skills/vitehub/references/sandboxes-hosts.md +0 -26
  507. package/dist/skills/vitehub/references/schedules-workflows-invocations.md +0 -28
  508. package/dist/skills/vitehub/references/server-primitives.md +0 -39
  509. package/dist/skills/vitehub/references/workspaces-sources-access.md +0 -26
  510. package/dist/ticket-DtBAstEU.js +0 -31
  511. package/dist/ticket-Pr_8ZtXW.d.ts +0 -14
  512. package/dist/tickets-DahBmKDT.js +0 -357
  513. package/dist/usage-CoQXs5nW.d.ts +0 -22
  514. package/dist/usage-index-VJAZ7a0p.js +0 -335
  515. package/dist/usage-jKtAgJZ0.js +0 -571
  516. /package/dist/{console/runtime/public/skills → console-skills}/index.json +0 -0
  517. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/SKILL.md +0 -0
  518. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/agents/openai.yaml +0 -0
  519. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/agent-definitions.md +0 -0
  520. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/bundle.md +0 -0
  521. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/capabilities-authority.md +0 -0
  522. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/channels-triggers.md +0 -0
  523. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/framework-composition.md +0 -0
  524. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/preview-contract.md +0 -0
  525. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/auth.md +0 -0
  526. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/blob.md +0 -0
  527. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/browser.md +0 -0
  528. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/cache.md +0 -0
  529. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/channels.md +0 -0
  530. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/connections.md +0 -0
  531. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/content.md +0 -0
  532. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/database.md +0 -0
  533. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/email.md +0 -0
  534. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/env.md +0 -0
  535. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/kv.md +0 -0
  536. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/markdown-template.md +0 -0
  537. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/queue.md +0 -0
  538. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/rate-limit.md +0 -0
  539. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/realtime.md +0 -0
  540. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox-task.md +0 -0
  541. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox.md +0 -0
  542. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/schedule.md +0 -0
  543. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/shell.md +0 -0
  544. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/source.md +0 -0
  545. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workflow.md +0 -0
  546. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workspace.md +0 -0
  547. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-patterns.md +0 -0
  548. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-shapes.md +0 -0
  549. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/proof-recovery.md +0 -0
  550. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/sandboxes-hosts.md +0 -0
  551. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/schedules-workflows-invocations.md +0 -0
  552. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/server-primitives.md +0 -0
  553. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/workspaces-sources-access.md +0 -0
@@ -1,300 +0,0 @@
1
- import { n as consoleState } from "./internal-BreyUsQ6.js";
2
- import { c as isConsoleDevelopmentRuntime, i as consoleRequestError } from "./request-CMA2UKKq.js";
3
- import { r as getConsoleSections } from "./sections-C83x0slv.js";
4
- import { r as readViteHubSecret, t as deriveViteHubSecret } from "./secret-DELGKpCJ.js";
5
- import { n as getActiveCloudflareEnv, t as activeEnvStorageKey } from "./cloudflare-env-lookup-DKXdr4P_.js";
6
- import { importSealKey, sealWithKey, unsealWithKey } from "@vite-hub/env/seal";
7
- import { AsyncLocalStorage } from "node:async_hooks";
8
- //#region ../internal/src/runtime/cloudflare-env.ts
9
- const runtimeGlobal = globalThis;
10
- runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
11
- function getActiveCloudflareBinding(name) {
12
- const env = getActiveCloudflareEnv();
13
- return env && Object.hasOwn(env, name) ? env[name] : void 0;
14
- }
15
- //#endregion
16
- //#region ../internal/src/runtime/user-agent.ts
17
- /** A short device label of a browser, such as `Chrome · macOS`, for lists of sessions. It never shows the user agent itself. */
18
- function userAgentDevice(userAgent) {
19
- return `${/Edg\//.test(userAgent) ? "Edge" : /Firefox\//.test(userAgent) ? "Firefox" : /Chrome\//.test(userAgent) ? "Chrome" : /Safari\//.test(userAgent) ? "Safari" : "Unknown browser"} · ${/iPhone|iPad/.test(userAgent) ? "iOS" : /Android/.test(userAgent) ? "Android" : /Windows/.test(userAgent) ? "Windows" : /Macintosh/.test(userAgent) ? "macOS" : /Linux/.test(userAgent) ? "Linux" : "Unknown device"}`;
20
- }
21
- //#endregion
22
- //#region src/console/runtime/server/site-session.ts
23
- /** The cookie of a browser that Site access signed in, in an app without Auth. */
24
- const consoleSiteCookie = "vitehub_site";
25
- /** Seconds that the browser stays signed in, as Better Auth's default session. */
26
- const consoleSiteLifetime = 604800;
27
- const sessionPrefix = "vitehub-site-session:";
28
- const keyPurpose = "vitehub:site:session";
29
- const encoder = new TextEncoder();
30
- function unwrap([error, value]) {
31
- if (error) throw error;
32
- return value;
33
- }
34
- async function consoleSiteKeys(kv, prefix) {
35
- return (unwrap(await kv.list({ prefix }))?.keys ?? []).map((key) => key.replaceAll("/", ":")).filter((key) => key.startsWith(prefix));
36
- }
37
- async function consoleSiteEntries(kv, prefix) {
38
- const keys = await consoleSiteKeys(kv, prefix);
39
- if (!keys.length) return [];
40
- const values = kv.getMany ? unwrap(await kv.getMany(keys, { type: "text" })) ?? [] : await Promise.all(keys.map(async (key) => unwrap(await kv.get(key, { type: "text" }))));
41
- return keys.map((key, index) => ({
42
- key,
43
- value: values[index]
44
- }));
45
- }
46
- const memoryKey = Symbol.for("vitehub.console.tickets");
47
- const memoryScope = globalThis;
48
- function memorySiteKV() {
49
- const entries = memoryScope[memoryKey] ??= /* @__PURE__ */ new Map();
50
- const live = (key) => {
51
- const entry = entries.get(key);
52
- if (entry && entry.expiresAt <= Date.now()) entries.delete(key);
53
- return entry && entry.expiresAt > Date.now() ? entry.value : null;
54
- };
55
- return {
56
- async set(key, value, { ttl }) {
57
- for (const [name, entry] of entries) if (entry.expiresAt <= Date.now()) entries.delete(name);
58
- entries.set(key, {
59
- value,
60
- expiresAt: Date.now() + ttl * 1e3
61
- });
62
- return [void 0, void 0];
63
- },
64
- async get(key) {
65
- return [void 0, live(key)];
66
- },
67
- async getAndDelete(key) {
68
- const value = live(key);
69
- entries.delete(key);
70
- return [void 0, value];
71
- },
72
- async list({ prefix }) {
73
- return [void 0, { keys: [...entries.keys()].filter((key) => key.startsWith(prefix) && live(key) !== null) }];
74
- },
75
- async delete(key) {
76
- entries.delete(key);
77
- return [void 0, void 0];
78
- }
79
- };
80
- }
81
- const atomicDrivers = [
82
- "database",
83
- "redis",
84
- "upstash"
85
- ];
86
- let installedKV;
87
- /** Replace the KV store of tickets and site sessions, or restore the default with `undefined`. Tests use it. */
88
- function setConsoleSiteKV(kv) {
89
- installedKV = kv;
90
- }
91
- function storeMissing(why) {
92
- return consoleRequestError(500, `One-time links need a store that every instance of the app shares. ${why}`, "CONSOLE_TICKET_STORE_MISSING");
93
- }
94
- const consoleSiteTable = "vitehub_console_site";
95
- const databaseSiteKVs = /* @__PURE__ */ new WeakMap();
96
- async function databaseSiteKV() {
97
- const entry = await consoleState().siteDatabase?.();
98
- if (!entry) return void 0;
99
- const { name, db } = entry;
100
- const root = siteRootSecret();
101
- if (!root) throw siteSecretMissing();
102
- const cached = databaseSiteKVs.get(db);
103
- if (cached?.root === root) return cached.store;
104
- const namespace = await deriveViteHubSecret(root, "vitehub:site:storage");
105
- const { default: createDatabaseKVDriver, kvSqlClientFromDatabase } = await import("@vite-hub/kv/runtime/database");
106
- const driver = createDatabaseKVDriver({
107
- driver: "database",
108
- database: name,
109
- namespace
110
- }, async () => kvSqlClientFromDatabase(db, name), consoleSiteTable);
111
- const text = (value) => value === null || value === void 0 ? null : String(value);
112
- const store = {
113
- set: async (key, value, { ttl }) => [void 0, await driver.setItem?.(key, value, { ttl })],
114
- get: async (key) => [void 0, text(await driver.getItem(key))],
115
- getMany: async (keys) => [void 0, (await driver.getItems(keys.map((key) => ({ key })), {})).map((item) => text(item.value))],
116
- getAndDelete: async (key) => [void 0, text(await driver.getAndDeleteItem?.(key))],
117
- list: async ({ prefix }) => [void 0, { keys: await driver.getKeys(prefix, {}) }],
118
- delete: async (key) => [void 0, await driver.removeItem?.(key, {})]
119
- };
120
- databaseSiteKVs.set(db, {
121
- root,
122
- store
123
- });
124
- return store;
125
- }
126
- /**
127
- * The KV store of tickets without Auth, and of site sessions: the app's default KV store when its driver takes a key
128
- * out atomically, else the `database` KV driver over the app's Database. A development server keeps them in memory.
129
- * Otherwise it fails closed with `CONSOLE_TICKET_STORE_MISSING`.
130
- */
131
- async function consoleSiteKV() {
132
- if (installedKV) return installedKV;
133
- if (isConsoleDevelopmentRuntime()) return memorySiteKV();
134
- if (!getConsoleSections().includes("kv")) throw storeMissing("The app has no Auth Database and no KV store.");
135
- const { getKVStoreDriver, kv } = await import("@vite-hub/kv");
136
- const driver = await getKVStoreDriver();
137
- if (atomicDrivers.includes(driver)) return kv;
138
- const database = await databaseSiteKV();
139
- if (database) return database;
140
- throw storeMissing(`The default KV store uses the ${driver} driver, which cannot take a link out once when two instances ask at the same time, and the app has no Database to keep links in.`);
141
- }
142
- function serverEnv(name) {
143
- const value = getActiveCloudflareBinding(name) ?? globalThis.process?.env?.[name];
144
- return typeof value === "string" && value ? value : void 0;
145
- }
146
- function siteRootSecret() {
147
- return readViteHubSecret({ VITEHUB_SECRET: serverEnv("VITEHUB_SECRET") });
148
- }
149
- function siteSecretMissing() {
150
- return consoleRequestError(500, "Site access without Auth needs VITEHUB_SECRET, and the app has none.", "CONSOLE_SITE_SECRET_MISSING");
151
- }
152
- const keyCache = {};
153
- const developmentSlot = Symbol.for("vitehub.console.site-key");
154
- const developmentScope = globalThis;
155
- async function siteKey() {
156
- const root = siteRootSecret();
157
- if (!root) {
158
- if (!isConsoleDevelopmentRuntime()) return void 0;
159
- return await (developmentScope[developmentSlot] ??= importSealKey(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32))));
160
- }
161
- if (keyCache.root !== root || !keyCache.key) {
162
- keyCache.root = root;
163
- keyCache.key = deriveViteHubSecret(root, keyPurpose).then((hex) => importSealKey(Uint8Array.from(hex.match(/../g), (byte) => Number.parseInt(byte, 16))));
164
- }
165
- return await keyCache.key;
166
- }
167
- /** The key of the cookie, or `CONSOLE_SITE_SECRET_MISSING` before a ticket is made or redeemed. */
168
- async function requireConsoleSiteKey() {
169
- const key = await siteKey();
170
- if (!key) throw siteSecretMissing();
171
- return key;
172
- }
173
- function strings(value) {
174
- return Array.isArray(value) && value.every((entry) => typeof entry === "string");
175
- }
176
- function readClaims(value) {
177
- if (!(value instanceof Object)) return void 0;
178
- const id = Reflect.get(value, "id");
179
- const person = Reflect.get(value, "person");
180
- const roles = Reflect.get(value, "roles");
181
- const expiresAt = Reflect.get(value, "expiresAt");
182
- if (typeof id !== "string" || !strings(roles) || typeof expiresAt !== "number" || !(person instanceof Object)) return void 0;
183
- const [personId, name, email, image] = [
184
- "id",
185
- "name",
186
- "email",
187
- "image"
188
- ].map((field) => Reflect.get(person, field));
189
- if (typeof personId !== "string" || typeof name !== "string") return void 0;
190
- return {
191
- id,
192
- person: {
193
- id: personId,
194
- name,
195
- ...typeof email === "string" ? { email } : {},
196
- ...typeof image === "string" ? { image } : {}
197
- },
198
- roles,
199
- expiresAt
200
- };
201
- }
202
- function readRecord(value) {
203
- if (!value) return void 0;
204
- try {
205
- const parsed = JSON.parse(value);
206
- const claims = readClaims(parsed);
207
- const kind = Reflect.get(Object(parsed), "kind");
208
- const device = Reflect.get(Object(parsed), "device");
209
- const createdAt = Reflect.get(Object(parsed), "createdAt");
210
- if (!claims || kind !== "member" && kind !== "guest" || typeof device !== "string" || typeof createdAt !== "number") return void 0;
211
- return {
212
- ...claims,
213
- kind,
214
- device,
215
- createdAt
216
- };
217
- } catch {
218
- return;
219
- }
220
- }
221
- /**
222
- * Start a site session for a browser: keep it in the KV store and return its cookie. `secure` adds `Secure`, for an
223
- * app on HTTPS.
224
- */
225
- async function openConsoleSiteSession(input) {
226
- const key = await requireConsoleSiteKey();
227
- const kv = await consoleSiteKV();
228
- const now = Date.now();
229
- const record = {
230
- id: crypto.randomUUID(),
231
- kind: input.kind,
232
- person: input.person,
233
- roles: [...new Set(input.roles)],
234
- device: userAgentDevice(input.userAgent),
235
- createdAt: now,
236
- expiresAt: now + consoleSiteLifetime * 1e3
237
- };
238
- unwrap(await kv.set(`${sessionPrefix}${record.id}`, JSON.stringify(record), { ttl: consoleSiteLifetime }));
239
- const claims = {
240
- id: record.id,
241
- person: record.person,
242
- roles: record.roles,
243
- expiresAt: record.expiresAt
244
- };
245
- const sealed = await sealWithKey(key, encoder.encode(consoleSiteCookie), JSON.stringify(claims));
246
- return `${consoleSiteCookie}=${sealed}; Path=/; Max-Age=${consoleSiteLifetime}; HttpOnly; SameSite=Lax${input.secure ? "; Secure" : ""}`;
247
- }
248
- function cookieValue(header, name) {
249
- for (const part of header.split(";")) {
250
- const at = part.indexOf("=");
251
- if (at > 0 && part.slice(0, at).trim() === name) return part.slice(at + 1).trim();
252
- }
253
- }
254
- /**
255
- * The person of the `vitehub_site` cookie of a request. A cookie that does not open with the key of this app, that
256
- * expired, or whose session was revoked gives no person.
257
- */
258
- async function readConsoleSiteVisitor(request) {
259
- const value = cookieValue(request.headers.get("cookie") ?? "", consoleSiteCookie);
260
- if (!value) return void 0;
261
- const key = await siteKey();
262
- if (!key) return void 0;
263
- let claims;
264
- try {
265
- claims = readClaims(JSON.parse(await unsealWithKey(key, encoder.encode(consoleSiteCookie), value)));
266
- } catch {
267
- return;
268
- }
269
- if (!claims || claims.expiresAt <= Date.now()) return void 0;
270
- const record = readRecord(unwrap(await (await consoleSiteKV()).get(`${sessionPrefix}${claims.id}`, { type: "text" })));
271
- if (!record || record.expiresAt <= Date.now()) return void 0;
272
- return {
273
- ...claims.person,
274
- roles: claims.roles
275
- };
276
- }
277
- /** The browsers that Site access signed in without Auth, most recently signed in first. */
278
- async function listConsoleSiteSessions(known) {
279
- return (await consoleSiteEntries(await consoleSiteKV(), sessionPrefix)).map(({ value }) => readRecord(value)).filter((record) => record !== void 0 && record.expiresAt > Date.now()).sort((a, b) => b.createdAt - a.createdAt).map((record) => ({
280
- id: record.id,
281
- kind: record.kind,
282
- person: { ...record.person },
283
- grants: record.roles.filter((role) => known.has(role)),
284
- device: record.device,
285
- createdAt: new Date(record.createdAt).toISOString(),
286
- lastSeenAt: new Date(record.createdAt).toISOString(),
287
- expiresAt: new Date(record.expiresAt).toISOString()
288
- }));
289
- }
290
- /** Revoke a site session: its cookie stops working. Returns whether the session was a guest's, or undefined without it. */
291
- async function revokeConsoleSiteSession(id) {
292
- const kv = await consoleSiteKV();
293
- const key = `${sessionPrefix}${id}`;
294
- const record = readRecord(unwrap(await kv.get(key, { type: "text" })));
295
- if (!record) return void 0;
296
- unwrap(await kv.delete(key));
297
- return { guest: record.kind === "guest" };
298
- }
299
- //#endregion
300
- export { listConsoleSiteSessions as a, requireConsoleSiteKey as c, consoleSiteLifetime as i, revokeConsoleSiteSession as l, consoleSiteEntries as n, openConsoleSiteSession as o, consoleSiteKV as r, readConsoleSiteVisitor as s, consoleSiteCookie as t, setConsoleSiteKV as u };
@@ -1,142 +0,0 @@
1
- ---
2
- name: vitehub
3
- description: Build, change, and debug ViteHub apps. Use in an app with ViteHub before you write auth, migration, storage, realtime, skill, logging, rate limit, env, or deploy code, and for server primitives and Runtime Helpers, Agent Definitions, Provider Output, hosts, and deployment.
4
- ---
5
-
6
- # ViteHub
7
-
8
- Use one proof loop: orient, look up the built-in, route, inspect the contract, build, and prove. Exact package exports, installed types, and current raw docs outrank remembered or project-example syntax.
9
-
10
- ## 1. Orient
11
-
12
- - In an existing project, run `pnpm vitehub status --json` first. It parses the config without running it, so it works on a broken config. It names the framework, the host, each feature as `on`, `off`, or `unknown`, the missing packages with their fix, and the host link. In an empty folder, start with `pnpm dlx vite-hub catalog --json`, then create the project with `pnpm dlx vite-hub init`. Where a project exists but `vite-hub` is not installed yet, run `pnpm dlx vite-hub status --json`. No npm package is named `vitehub`, so `npx vitehub` fails. Use the package name `vite-hub`.
13
- - Run `pnpm vitehub catalog --json` before you choose a feature or a host. Where `vite-hub` is not installed yet, use `pnpm dlx vite-hub catalog --json`. It lists each feature key, its packages, and how each host supports it (`native`, `explicit`, or `unsupported`), from the same catalog that the build checks. See [Read a project without loading it](https://vitehub.dev/raw/docs/cli/project.md#read-a-project-without-loading-it).
14
- - Then read only what the two commands do not answer: the lockfile, the server entry, nearby project instructions, and config parts that `status` reports as `unknown` or `manual`.
15
- - Identify installed ViteHub packages and versions, package manager, framework, host target, and requested outcome.
16
- - Open `https://vitehub.dev/llms.txt`, then select the smallest raw Markdown page covering the primary behavior. Links inside references are selection menus; do not open every linked page.
17
-
18
- Orientation is complete when the current setup, target outcome, host boundary, and first docs URL are named.
19
-
20
- ## 2. Look up the built-in first
21
-
22
- ViteHub ships code that apps often write by hand. Before you write or change auth, migration, storage, realtime, skill, logging, rate limit, env, or deploy code, find the problem in this table. Also read the app code that already does the job: a built-in can ship after the app wrote its own version. A row is a candidate, not a drop-in: its limits column says where the built-in behaves differently.
23
-
24
- | Problem | Built-in | Limits | Docs |
25
- | --- | --- | --- | --- |
26
- | Migrations: a `drizzle.config.ts`, `drizzle-kit` scripts, or SQL files written by hand | `vitehub database generate`, then `vitehub database migrate`. `vitehub database up` converts an old folder once | Old flat migration folders need `vitehub database up` first | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#apply-migrations) |
27
- | Apply migrations when the server starts or deploys: a custom migrator, or `wrangler d1 migrations apply` in a script | `database.migrateOnStart` on Node, `database.migrateOnDeploy` on Cloudflare, `ensureMigrations()` in a task or test | `migrateOnStart` runs only in a Node server build, never in development; it migrates SQLite only when set to `true` | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#migrate-when-the-server-starts) |
28
- | Copy the SQLite file before migrations, such as with `VACUUM INTO` | `database.migrateOnStart: { backup: true }` | Local SQLite files only. Copies only when a migration is pending, and keeps 3 unless you set `keep` | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#back-up-sqlite-before-migrations) |
29
- | Dump a database to a SQL file | `vitehub database export` | - | [cli/primitives](https://vitehub.dev/raw/docs/cli/primitives.md) |
30
- | Split a long `inArray()` list or a multi-row insert for the D1 parameter limit | `chunkParameters()` from `vite-hub/database` | - | [database/server-api](https://vitehub.dev/raw/docs/database/server-api.md#stay-under-the-bound-parameter-limit) |
31
- | Run a webhook or a retried request once per key | `withIdempotency()` from `vite-hub/database` | Not exactly once: a crash after the work, or a run longer than `timeout` (300 s), runs it again. Keep the provider's own idempotency key | [database/server-api](https://vitehub.dev/raw/docs/database/server-api.md#run-work-once-for-a-key) |
32
- | Let one runner at a time do a job, such as a get-then-set flag on a storage key | `kv.lock(key, { ttl }).run()` from `vite-hub/kv` | Needs the `redis`, `upstash`, or `database` KV driver. On `fs-lite`, `deno-kv`, and Cloudflare KV, `run()` returns `KV_UNSUPPORTED_OPERATION` and skips the job. The lock expires after `ttl` and never renews | [kv/server-api](https://vitehub.dev/raw/docs/kv/server-api.md#locks) |
33
- | Sign people in from the headers of oauth2-proxy (`x-auth-request-*`), Cloudflare Access, or Tailscale Serve | `forwardAuth()` from `vite-hub/auth/forward` | `verify` must prove the header, since anyone who reaches the app without the proxy can send it | [auth/configure](https://vitehub.dev/raw/docs/auth/configure.md#sign-in-through-a-trusted-proxy) |
34
- | Turn skills on and off while the app runs, such as with a settings table | `skillSettings()` from `vite-hub/skills` | - | [console/skills](https://vitehub.dev/raw/docs/console/skills.md#turn-skills-on-and-off) |
35
- | Presence or cursors in a Realtime room that has no shared document | `defineRealtime({ document: false })` | - | [realtime/server-api](https://vitehub.dev/raw/docs/realtime/server-api.md#presence-without-an-editor) |
36
- | Limit requests per user, IP, or key | `requireRateLimit(event, id, options)` from `vite-hub/rate-limit` | - | [rate-limit/server-api](https://vitehub.dev/raw/docs/rate-limit/server-api.md) |
37
- | A same-origin check for writes, a request body limit, or security headers | `sameOriginWrites: true` and `security` with `maxBodySize` in `vitehub()` | `sameOriginWrites` checks only writes that carry cookies; a write without cookies passes. `maxBodySize` applies to every route, not one | [frameworks-hosts/production](https://vitehub.dev/raw/docs/frameworks-hosts/production.md#add-security-headers-and-a-body-limit) |
38
- | Read and check `process.env` values | `vitehub({ env })` and `useServerEnv()` from `vite-hub/env` | - | [env/configure](https://vitehub.dev/raw/docs/env/configure.md) |
39
- | A logger or a log event per request | `vitehub({ logs })` with Evlog | - | [logs/configure](https://vitehub.dev/raw/docs/logs/configure.md) |
40
- | Deploy scripts: `wrangler deploy --secrets-file`, or creating host resources by hand | `vitehub deploy`, with `--push-env` for env values | - | [cli/project](https://vitehub.dev/raw/docs/cli/project.md#deploy-from-your-machine) |
41
- | Move ViteHub packages to a new version | `vitehub update` | - | [cli/project](https://vitehub.dev/raw/docs/cli/project.md#update-vitehub-packages) |
42
-
43
- When a row matches, read its docs page and compare the built-in with the app's own code before you delete anything:
44
-
45
- - The installed ViteHub version exports it (step 4 checks the exact contract).
46
- - It works on the app's host and driver, such as the KV driver for `kv.lock`.
47
- - It keeps every guarantee the app's code gives: the same requests refused, the same retries, the same data kept.
48
-
49
- When all three hold, switch to the built-in and delete the app's own version in the same change. When one fails, keep the app's code and say which limit stopped the switch. When no row matches, search `https://vitehub.dev/llms.txt` for the problem before you write the code.
50
-
51
- This step is complete when each piece of planned code is a built-in that passed the three checks, or you can name the docs page or limit that rules it out.
52
-
53
- ## 3. Route before code
54
-
55
- Choose one primary lane. Server Primitives serve application behavior through Vite Integrations and Runtime Helpers. Agents serve model-backed, provider-backed, or custom-run behavior through Agent Definitions; they may compose Server Primitives without changing the primary lane.
56
-
57
- Read only the references whose conditions match, but read them before writing code:
58
-
59
- | Task condition | Required reference |
60
- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
61
- | New project, uncertain file layout, or cross-feature composition | [Project shapes](references/project-shapes.md) |
62
- | Released or `pkg.pr.new` installation, upgrade, or package mismatch | [Installed and preview contracts](references/preview-contract.md) |
63
- | Choosing between Server Primitives | [Server Primitives](references/server-primitives.md) |
64
- | Auth, sessions, or route protection | [Auth](references/primitives/auth.md) |
65
- | Blob uploads, direct uploads to storage, copies, or object storage | [Blob](references/primitives/blob.md) |
66
- | Browser sessions or remote browser actions | [Browser](references/primitives/browser.md) |
67
- | Outbound application message delivery | [Channels](references/primitives/channels.md) |
68
- | OAuth or provider account access | [Connections](references/primitives/connections.md) |
69
- | Comark content, Markdown, or content queries | [Content](references/primitives/content.md) |
70
- | Relational data, Drizzle, Postgres replicas, seeds, or SQL from the CLI | [Database](references/primitives/database.md) |
71
- | Email or Markdown email templates | [Email](references/primitives/email.md) |
72
- | Public, server, secret, or provider-backed values | [Env](references/primitives/env.md) |
73
- | KV values, flags, cursors, short-lived state, or a lock that runs a job once | [KV](references/primitives/kv.md) |
74
- | Queue jobs and consumers | [Queue](references/primitives/queue.md) |
75
- | Atomic request budgets | [Rate Limit](references/primitives/rate-limit.md) |
76
- | Realtime collaboration | [Realtime](references/primitives/realtime.md) |
77
- | Isolated provider-backed task runs | [Sandbox Tasks](references/primitives/sandbox-task.md) |
78
- | Static cron schedules | [Schedule](references/primitives/schedule.md) |
79
- | Bounded shell commands | [Shell](references/primitives/shell.md) |
80
- | Read-only external files or resources | [Source](references/primitives/source.md) |
81
- | Durable long-running orchestration | [Workflow](references/primitives/workflow.md) |
82
- | Persistent files, Sources, snapshots, or write-back | [Workspace](references/primitives/workspace.md) |
83
- | Trusted-host or provider execution sessions | [Sandboxes](references/primitives/sandbox.md) |
84
- | Nitro cache storage, cache tags, or invalidation | [Cache](references/primitives/cache.md) |
85
- | Markdown rendering with bindings | [Markdown Templates](references/primitives/markdown-template.md) |
86
- | Modify an existing framework integration; add Nitro or Nuxt; use generated types; configure a provider; or diagnose a framework-specific failure | [Framework composition](references/framework-composition.md) |
87
- | Agent Definition, Agent Driver, Agent Invocation, instructions, output, hooks, or Evals | [Agent Definitions and Drivers](references/agent-definitions.md) |
88
- | Workspace, Source, access scope, mounted files, or write-back | [Workspaces, Sources, and access](references/workspaces-sources-access.md) |
89
- | Agent Channel, Trigger, webhook admission, concurrency, or Agent delivery | [Channels and Triggers](references/channels-triggers.md) |
90
- | Capability, tool, secret, rate limit, telemetry, or other granted authority | [Capabilities and authority](references/capabilities-authority.md) |
91
- | Schedule, Workflow, orchestration retry, idempotency, or terminal state | [Schedules, Workflows, and Invocations](references/schedules-workflows-invocations.md) |
92
- | Sandbox, trusted host, isolation, required command, host link, deploy, Console link, or deployed version | [Sandboxes and hosts](references/sandboxes-hosts.md) |
93
- | Bundle size, startup cost, host size limits, why a package is in the output, or whether a change made the bundle smaller | [Bundle size and startup cost](references/bundle.md) |
94
- | A proof has failed, generated state disagrees, or a runtime/host failure needs diagnosis | [Proof and recovery](references/proof-recovery.md) |
95
- | Looking for a complete public application pattern | [Project patterns](references/project-patterns.md) |
96
-
97
- Routing is complete when every requested behavior has one primary lane and every matching reference has been read. Start with the smallest matching set, then add a cross-cutting reference when the task spans lanes.
98
-
99
- ## 4. Inspect the installed contract
100
-
101
- - Read each installed package's `package.json`, exports, relevant types, and generated declarations before writing imports or options.
102
- - For a fresh application, create it with `vitehub init` (see [Project shapes](references/project-shapes.md)), then use the root integration plus feature subpaths. Opt-in features such as Agent, Auth, Database, Schedule, Workspace, Realtime, Content, and Comments also need their owner package next to `vite-hub`. `vitehub add` installs it, `vitehub status` lists any that is missing, and the build error names it. Use other direct owner packages only for a focused library, an unexported advanced subpath, or an installed older contract.
103
- - When docs, examples, and installed artifacts disagree, implement the installed artifacts and record the mismatch. Treat project examples as patterns whose imports must be revalidated.
104
-
105
- Contract inspection is complete when every planned package, import, option, generated path, and runtime entry exists in the installed graph; no syntax is inferred only from memory.
106
-
107
- ## 5. Build the coherent file set
108
-
109
- Before editing, map every requested behavior to:
110
-
111
- | Behavior | Package owner | Source file | Runtime path | Authority or persistence | Proof |
112
- | -------- | ------------- | ----------- | ------------ | ------------------------ | ----- |
113
-
114
- Then implement the smallest coherent set: manifest and lockfile, framework integration, discovered Definition where needed, application or orchestration entrypoint, and proof surface. Keep application authority in application code; grant an Agent access only through visible Capabilities, Workspace rules, Sources, or Channels.
115
-
116
- Turn features on with `vitehub add <feature>`, not by editing `vitehub({...})` by hand. It checks the host against the catalog, installs the owner packages, creates requested starter files, and edits the config last. Package installs are not rolled back: a failed install can leave the manifest and lockfile changed without enabling the feature. See [Add a feature](https://vitehub.dev/raw/docs/cli/project.md#add-a-feature).
117
-
118
- - Run `--dry-run` first and read the diff, then apply with `--yes`. Without a terminal, `add` writes nothing until it gets `--yes`.
119
- - Pass `--name <name>` for a starter Definition, such as `server/queues/<name>.ts`. It never overwrites a file.
120
- - Pass provider options as `--option key=value`, such as `--option email.driver=resend`.
121
- - Follow the exit code. `0`: done or unchanged. `2`: input is needed; run the `rerun` command it prints, or supply the options listed in `missing` with their `choices`. `3`: a conflict; read the diagnostic code. For `SETUP_FILE_EXISTS`, choose another `--name`, or edit the existing file by hand and then rerun `vitehub add <feature> --yes` without `--name`, keeping the required `--option` values, to install packages and enable the feature. For `SETUP_CONFIG_MANUAL`, paste the printed `snippet` into the `vitehub()` options by hand. For an unsupported feature, choose another host or report the boundary, because a hand-written key does not give the host the feature. `4` (`SETUP_STALE_PLAN`): the config changed during installation; discard the plan and rerun against the current config.
122
- - Turn a feature off with `vitehub remove <feature>`. Run `--dry-run` first and read the plan, then apply with `--yes`. It deletes the config key, deletes starter files that are still unchanged, and uninstalls packages that nothing else uses. Exit `3` means another feature implies it (`SETUP_FEATURE_IMPLIED`, see `impliedBy`) or the app still uses it (`SETUP_FEATURE_IN_USE`): `references` lists each file and line, including starter files you edited. Delete or move those files and run it again. Pass `--force` only when the developer wants the feature off and the files kept. `remove` never deletes host resources, local data, or the host link; `nextSteps` names the host resources to delete by hand. See [Remove a feature](https://vitehub.dev/raw/docs/cli/project.md#remove-a-feature).
123
-
124
- Building is complete when every requested behavior has an implemented row and no placeholder, unused integration, implicit authority, or unowned persistence remains.
125
-
126
- ## 6. Prove and repair
127
-
128
- - Run the narrow typecheck or package test nearest the change, then the relevant build.
129
- - Run Vite Doctor with the ViteHub rules. The `vite-doctor` CLI does not read `vite.config.ts`, so register the extension in a config file. Name the pack in `extends`, or its rules do not run. `auto` keeps the other packs:
130
-
131
- ```ts [doctor.config.ts]
132
- import { defineDoctorConfig } from 'vite-doctor/config'
133
- import vitehub from 'vite-hub/doctor'
134
-
135
- export default defineDoctorConfig({ extensions: [vitehub], extends: ['auto', 'vitehub/recommended'] })
136
- ```
137
-
138
- Run `pnpm vite-doctor . --config doctor.config.ts` and fix each `VHUB` finding. See [Doctor rules](https://vitehub.dev/raw/docs/reference/doctor-rules.md).
139
- - Prove the actual lane: execute the Runtime Helper, perform an Agent Invocation, exercise the webhook or schedule, or inspect generated Provider Output.
140
- - On failure, return to installed exports/types, `.vitehub` generated state, the selected raw docs page, and [Proof and recovery](references/proof-recovery.md). Repair the cause and rerun the same proof.
141
-
142
- The task is complete when every behavior row has an observed result, or a precise source-backed unsupported boundary, and Doctor reports no `VHUB` finding. Report commands and observations, docs URLs, installed ViteHub versions or preview commit, contract mismatches, and host limitations.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "ViteHub"
3
- short_description: "Build and change ViteHub apps"
4
- default_prompt: "Use $vitehub to route the smallest relevant reference set, follow live docs and the installed contract, and prove every requested behavior."
@@ -1,36 +0,0 @@
1
- # Agent Definitions and Drivers
2
-
3
- Use this for Agent Definitions, model or provider Drivers, deterministic custom Drivers, instructions, structured output, hooks, or Evals.
4
-
5
- ## Select current pages
6
-
7
- For a first deterministic custom Driver and direct invocation, open only [First Agent](https://vitehub.dev/raw/docs/getting-started/first-agent.md). Use [Agent Definitions](https://vitehub.dev/raw/docs/agents/agent-definitions.md) for advanced composition or discovery, [Agent Drivers](https://vitehub.dev/raw/docs/agents/agent-drivers.md) for model/provider details, and [Agent Invocations](https://vitehub.dev/raw/docs/agents/invocations.md) for advanced runtime context. Open [Instructions](https://vitehub.dev/raw/docs/agents/instructions.md) or [Evals](https://vitehub.dev/raw/docs/agents/evals.md) only when that behavior is requested. Do not read the whole set.
8
-
9
- ## Definition shape
10
-
11
- Default-export one `defineAgent()` boundary from a documented Agent discovery
12
- path, commonly `server/agents/<name>.ts` or `server/agents/<name>/agent.ts`.
13
- Check [File conventions](https://vitehub.dev/raw/docs/reference/file-conventions.md)
14
- when the project uses another supported suffix or location. Compose only the
15
- facets the outcome needs:
16
-
17
- ```text
18
- driver how the Agent runs
19
- instructions model-facing behavior
20
- workspace files and Sources available to the invocation
21
- capabilities granted tools and authority
22
- channels external conversation adapters
23
- hooks/output lifecycle and delivery behavior
24
- ```
25
-
26
- Use a deterministic custom `driver.run` for the first offline proof. Add model credentials, provider executable prerequisites, and sandbox requirements only when the requested outcome needs them.
27
-
28
- Keep repository-wide guidance in repository files, Agent behavior in Driver Instructions, and reusable runtime Skills in the documented Agent skill surface.
29
-
30
- ## Invocation boundary
31
-
32
- Pass invocation input separately from trusted runtime context. Keep run identity, memoization, wait-until behavior, invoker/admission context, and runtime selection explicit where the chosen invocation helper requires them.
33
-
34
- ## Proof
35
-
36
- Prove Driver prerequisites, run one real Agent Invocation, inspect granted authority, and assert the expected output. A typecheck without an invocation is incomplete.
@@ -1,57 +0,0 @@
1
- # Bundle size and startup cost
2
-
3
- Use this when a task asks how big the app is, why the server starts slowly or hits a host size limit, why a page loads too much JavaScript, or why a package is in the output.
4
-
5
- ## Measure
6
-
7
- 1. Set `bundle: true` in `vitehub()` (`vite.config.ts`) or in `vitehub` (`nuxt.config.ts`). It is off by default.
8
- 2. Run a production build: `vite build` or `nuxt build`. Development builds are not measured.
9
- 3. Run `vitehub bundle`. It reads `.vitehub/bundle/` and needs no dev server.
10
-
11
- `vitehub bundle` shows the client and the server separately. For each, it shows the JavaScript bytes, the gzip bytes, the startup code, and the largest groups. A group is a ViteHub package (`@vite-hub/agent`, `vite-hub/console`), a framework package, a dependency, an app folder (`server/api`), or generated code (`.vitehub`, `.nuxt`, `#nitro/virtual`). In Nuxt 5, the server part already contains the SSR build. Do not read Vite environments one by one.
12
-
13
- - **Server startup** is the code that loads before the first request: the entry and every file that it imports statically. It decides cold start time and Worker startup limits.
14
- - **Client startup** combines the startup code of all page entries, counting shared files once. A single page in a multi-page app can load less.
15
-
16
- ## Explain
17
-
18
- `vitehub bundle why <package|file|group>` prints the bytes on each side, whether the target loads at startup, and the shortest import chain from the entry. Read the chain from the end: the first step that is app code or a ViteHub feature is usually the one to change. For example, change a static import to `import()` or turn the feature off.
19
-
20
- ## Routes
21
-
22
- Static aliases load the same files as their canonical route. Lookup follows Nuxt's case and trailing-slash settings. When a custom `app/router.options.ts` file is present (also from a layer or module), route estimates are unavailable because that file can change routes at runtime. Page redirects also make route estimates unavailable because the destination can change before rendering. The CLI explains this and JSON includes `client.routesUnavailable`; bundle totals and module explanations still work.
23
-
24
- In a Nuxt app, `vitehub bundle` also lists the largest page routes. For each route it gives the JavaScript of a first visit and the part of it that only page files add. `vitehub bundle why /docs/kv` takes a URL path, finds the route that renders it, such as `/docs/:slug()`, and prints:
25
-
26
- - the files that the browser loads on a first visit: the startup files, and the files of the layout and the pages with every file that they import statically,
27
- - the CSS of those files,
28
- - the largest modules in the page files. These are what the route adds. Run `vitehub bundle why <module>` on one to get its import chain.
29
-
30
- Code that the page loads later with `import()` does not count. The layout comes from a static `layout` in `definePageMeta`, or is `default`, and counts only when the startup or page files load `NuxtLayout`. If Nuxt does not expose that component's file, layouts are omitted. A layout set at runtime, conditional rendering of `NuxtLayout`, route middleware, and prefetching are not counted: Nuxt's `<link rel="prefetch">` files and the pages of visible `<NuxtLink>`s load at low priority after the page. Nuxt can inline some CSS in the HTML, so `cssBytes` is an upper bound for the CSS files the browser fetches. `--json` gives the routes in `client.routes`.
31
-
32
- Use `--json` on both commands when you compare numbers or write them into a report.
33
-
34
- ## Act on findings
35
-
36
- `vitehub bundle` ends with its checks. `--json` gives them in `findings`. Each finding has `code`, `severity`, `why`, `fix`, `docs`, `bytes`, and `chain`, the import chain from the server entry. The checks report only what the build proves: a feature declares from its resolved configuration what the server never runs, and a host limit comes from the host's documentation.
37
-
38
- - `BUNDLE_STARTUP_UNUSED` (warning): a package loads at server startup, and a feature of this build never runs it there. Example: `@libsql/client` on a Cloudflare app where every Database is D1. Read `chain` from the end and update the ViteHub package that imports it. Independent imports from app code or other packages suppress the finding, because the feature cannot prove what those consumers need.
39
- - `BUNDLE_HOST_SIZE_LIMIT` (error): the server JavaScript is over the host limit, so the deployment fails. Cloudflare accepts a Worker up to 64 MiB before compression. Start with the largest groups.
40
-
41
- An error makes `vitehub bundle` exit with 1, so CI can run `vite build && vitehub bundle`. A warning keeps exit code 0. After a fix, build again and check that the finding is gone.
42
-
43
- ## Prove a change
44
-
45
- Save the report before you change the code, then compare after the next build:
46
-
47
- ```sh
48
- nuxt build # or vite build, with bundle: true
49
- vitehub bundle --json > .vitehub/bundle-before.json
50
- # change the code
51
- nuxt build
52
- vitehub bundle --against .vitehub/bundle-before.json
53
- ```
54
-
55
- `--against` prints, for the client and the server, the bytes and gzip bytes before and after, the same for the startup code, and each group that grew, shrank, was added, or was removed, with its total and startup delta. Groups that did not change are not shown. Add `--json` to get the same data. `--against` also reads a copy of `.vitehub/bundle/` or the project root of another checkout that has one.
56
-
57
- If the output says that both reports are from the same build, you did not build again after the change. Report the side and startup deltas and the groups that changed. When you removed a package, also give the import chain from `vitehub bundle why <package>` on the old build.
@@ -1,30 +0,0 @@
1
- # Capabilities and authority
2
-
3
- Use this whenever an Agent receives a tool, secret-backed operation, browser,
4
- storage, shell, repository, rate-limit, telemetry, or custom action. A
5
- Capability is the named permission that exposes one operation and its checks to
6
- an Agent.
7
-
8
- ## Select current pages
9
-
10
- Open [Official Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/official.md) plus the chosen Capability page. Use [Capabilities overview](https://vitehub.dev/raw/docs/agents/capabilities.md) for lifecycle or authority questions, and [Custom Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/custom.md) only when no official Capability fits.
11
-
12
- ## Authority pass
13
-
14
- Every Capability changes what an Agent may observe or do. For each one, name:
15
-
16
- - operations exposed to the model;
17
- - data and secret sources;
18
- - Invoker, scope, rate, and policy checks;
19
- - persistence or external side effects;
20
- - artifacts or traces available for inspection.
21
-
22
- Use official factories before writing a custom Capability. Use `defineCapability()` when the application needs a stable domain-specific boundary, not as a wrapper around an already suitable official tool.
23
-
24
- Keep secrets server-side and unseal them only at the documented execution boundary. A Workspace Source does not grant an operation; a Capability should not silently mount unrelated data.
25
-
26
- For `rateLimit()`, pass a direct `RateLimiter` with `limiter`. Keep Agent Invoker, Run, or trusted-IP identity in the Capability; keep atomic consumption and provider guarantees in `@vite-hub/rate-limit`. Do not recreate the removed inline `limit`, `window`, `store`, or generic KV model.
27
-
28
- ## Proof
29
-
30
- Run one allowed operation and one relevant denied or out-of-scope case. Inspect the tool surface, result, trace/artifact, and external effect.
@@ -1,27 +0,0 @@
1
- # Channels and Triggers
2
-
3
- Use this for Agent Channels and Triggers: GitHub, Gmail, Teams, Telegram,
4
- Discord, web chat, custom webhooks, message history, admission, concurrency,
5
- or Agent delivery effects. Every Channel is one file in `server/channels` with
6
- `defineChannel()` from [`vite-hub/channels`](primitives/channels.md), for both
7
- directions; an Agent lists it by name with `defineAgent({ channels: ['name'] })`.
8
-
9
- ## Select one current page
10
-
11
- Open [Channels](https://vitehub.dev/raw/docs/agents/channels.md) for conversation adapters, [Gmail Channel](https://vitehub.dev/raw/docs/agents/gmail.md) for Gmail push, labels, and replay, [Triggers](https://vitehub.dev/raw/docs/agents/triggers.md) for other inbound events, or [Chat history and sessions](https://vitehub.dev/raw/docs/agents/chat-history-sessions.md) for identity and persistence. Open another page only when the first explicitly crosses that boundary.
12
-
13
- ## Composition
14
-
15
- A Channel adapts an external conversation surface; a Trigger admits an external event into an Agent Invocation. Keep webhook verification, invoker/admission rules, history/session identity, concurrency, input commands, and delivery behavior explicit.
16
-
17
- Use official Channel helpers when the installed contract provides them. Create a custom Trigger only when the external event is not a conversation adapter or the official boundary cannot represent the source.
18
-
19
- Treat webhook secrets and installation tokens as server-only Env. Built-in Agent Channels declare their Env under `env.server.<channel>` when an Agent file calls the factory; check `describeServerEnv()` or the generated types before adding a declaration, and declare a field only to change its host variable name. Keep generated routes inspectable and document the exact local or deployed URL used for proof.
20
-
21
- For initial setup of a built-in Telegram Channel, discover the installed contract with `pnpm vitehub channels sync --help` after the application stage is deployed. Run `pnpm vitehub channels sync --stage <stage> --url <https-origin> --json` first; it is read-only, loads the stage-specific Vite environment, and verifies the deployed webhook route before inspecting Telegram.
22
-
23
- Apply a reviewed registration only when the task explicitly authorizes provider mutation, using `--apply --confirm-origin <the-same-https-origin>`. Never infer the stage or origin, pass provider credentials as arguments, or expose Env values in output. A planned deletion also needs explicit intent and `--allow-delete`; switching Telegram to polling or `webhooks: false` can produce that plan. Keep custom adapter registration and product policy application-owned.
24
-
25
- ## Proof
26
-
27
- Exercise the generated or custom webhook with a verified event, observe the Agent Invocation, and confirm the expected external delivery or persisted message. A route existing in Provider Output is not proof that admission and delivery work.