vite-hub 0.3.1 → 0.4.1

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 (254) hide show
  1. package/README.md +34 -36
  2. package/dist/_internal/runtime/browser-errors.d.ts +1 -1
  3. package/dist/_internal/runtime/browser-errors.js +1 -1
  4. package/dist/{access-F0YP5D5E.js → access-BDST818p.js} +6 -6
  5. package/dist/{access-policy-BsB3QVe5.d.ts → access-policy-CGXhO3Ee.d.ts} +3 -3
  6. package/dist/{access-policy-B_DCpZUt.js → access-policy-DjBKLo3c.js} +2 -2
  7. package/dist/{account-Bsu-LBOF.d.ts → account-BnOAU055.d.ts} +1 -1
  8. package/dist/{agent-invocations.post-DIm8tJV2.js → agent-invocations.post-CcPvfA0n.js} +7 -7
  9. package/dist/{agents-DnHexzTJ.js → agents-BDeazoAW.js} +2 -2
  10. package/dist/{agents-y5hBFHUQ.js → agents-BoWau_ei.js} +1 -1
  11. package/dist/{auth-BFVHYizM.d.ts → auth-BZOy7obk.d.ts} +2 -2
  12. package/dist/{auth-types-DWpTBZvp.d.ts → auth-types-CyqhWvYF.d.ts} +1 -1
  13. package/dist/bin.js +15 -7
  14. package/dist/{blob-CiUmptIp.d.ts → blob-CFLwMsjH.d.ts} +1 -1
  15. package/dist/{blob-BRV6_wZa.js → blob-CpvlM8jp.js} +3 -3
  16. package/dist/cache/operations.d.ts +1 -1
  17. package/dist/cache/operations.js +2 -2
  18. package/dist/cache.js +1 -1
  19. package/dist/choices/vue.d.ts +1 -0
  20. package/dist/choices/vue.js +2 -0
  21. package/dist/choices.d.ts +1 -0
  22. package/dist/choices.js +2 -0
  23. package/dist/cli-config-UAGTmuFa.js +2 -0
  24. package/dist/{cli-config-Bpjjfz5j.js → cli-config-wxKjF2Y0.js} +1 -16
  25. package/dist/console/auth-types.d.ts +1 -1
  26. package/dist/console/auth.d.ts +1 -1
  27. package/dist/console/auth.js +1 -1
  28. package/dist/console/runtime/client/account.d.ts +1 -1
  29. package/dist/console/runtime/client/account.js +2 -2
  30. package/dist/console/runtime/client/blob-media.d.ts +1 -1
  31. package/dist/console/runtime/client/blob-media.js +3 -3
  32. package/dist/console/runtime/client/comment-thread.js +1 -1
  33. package/dist/console/runtime/client/content-heads.d.ts +45 -0
  34. package/dist/console/runtime/client/content-heads.js +58 -0
  35. package/dist/console/runtime/client/documents.d.ts +2 -2
  36. package/dist/console/runtime/client/documents.js +1 -1
  37. package/dist/console/runtime/client/editor.d.ts +1 -1
  38. package/dist/console/runtime/client/invocation.js +3 -3
  39. package/dist/console/runtime/client/live.d.ts +1 -1
  40. package/dist/console/runtime/client/mcp-client.js +1 -1
  41. package/dist/console/runtime/client/media-library.d.ts +1 -1
  42. package/dist/console/runtime/client/media-library.js +1 -1
  43. package/dist/console/runtime/client/media-uploads.d.ts +1 -1
  44. package/dist/console/runtime/client/media-uploads.js +1 -1
  45. package/dist/console/runtime/client/operation-view.d.ts +1 -1
  46. package/dist/console/runtime/client/operation-view.js +2 -2
  47. package/dist/console/runtime/client/presence.d.ts +1 -1
  48. package/dist/console/runtime/client/problem.js +2 -2
  49. package/dist/console/runtime/client/project-link.d.ts +1 -1
  50. package/dist/console/runtime/client/project-link.js +1 -1
  51. package/dist/console/runtime/client/project-session.d.ts +2 -2
  52. package/dist/console/runtime/client/project-session.js +4 -4
  53. package/dist/console/runtime/client/project.d.ts +1 -1
  54. package/dist/console/runtime/client/project.js +1 -1
  55. package/dist/console/runtime/client/publish.d.ts +1 -1
  56. package/dist/console/runtime/client/rate-limit.js +2 -2
  57. package/dist/console/runtime/client/read-only.d.ts +1 -1
  58. package/dist/console/runtime/client/read-only.js +1 -1
  59. package/dist/console/runtime/client/request.js +1 -1
  60. package/dist/console/runtime/client/schedule-run.js +2 -2
  61. package/dist/console/runtime/client/sections.d.ts +1 -1
  62. package/dist/console/runtime/client/sections.js +1 -1
  63. package/dist/console/runtime/client/sidebar.ts +1 -1
  64. package/dist/console/runtime/client/site-access.js +2 -2
  65. package/dist/console/runtime/client/ticket.js +1 -1
  66. package/dist/console/runtime/client/workflow.js +2 -2
  67. package/dist/console/runtime/components/console-content-heads.vue +72 -0
  68. package/dist/console/runtime/components/console-document-dashboard.vue +43 -35
  69. package/dist/console/runtime/components/console-documents.vue +1 -0
  70. package/dist/console/runtime/components/console-markdown-editor.vue +4 -1
  71. package/dist/console/runtime/components/invocation/agent-invocation.ts +18 -5
  72. package/dist/console/runtime/components/invocation/internal/input-attachments.ts +69 -0
  73. package/dist/console/runtime/components/invocation/internal/invocation-activity.ts +67 -12
  74. package/dist/console/runtime/components/invocation/internal/invocation-conversation.ts +12 -4
  75. package/dist/console/runtime/components/invocation/invocation.css +16 -0
  76. package/dist/console/runtime/console-route.js +1 -1
  77. package/dist/console/runtime/definitions.d.ts +1 -1
  78. package/dist/console/runtime/definitions.js +1 -1
  79. package/dist/console/runtime/diagnostics.ts +30 -30
  80. package/dist/console/runtime/page-tool/page-tool.js +1 -1
  81. package/dist/console/runtime/public/skills/vitehub/SKILL.md +3 -3
  82. package/dist/console/runtime/public/skills/vitehub/references/framework-composition.md +1 -1
  83. package/dist/console/runtime/public/skills/vitehub/references/preview-contract.md +9 -1
  84. package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +1 -1
  85. package/dist/console/runtime/public/skills/vitehub/references/primitives/database.md +1 -1
  86. package/dist/console/runtime/public/skills/vitehub/references/primitives/markdown-template.md +3 -3
  87. package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +2 -2
  88. package/dist/console/runtime/public/skills/vitehub/references/sandboxes-hosts.md +4 -4
  89. package/dist/console/runtime/sections.d.ts +1 -1
  90. package/dist/console/runtime/sections.js +1 -1
  91. package/dist/console/runtime/server/access-policy.d.ts +1 -1
  92. package/dist/console/runtime/server/access-policy.js +1 -1
  93. package/dist/console/runtime/server/agents.get.js +2 -2
  94. package/dist/console/runtime/server/auth.d.ts +1 -1
  95. package/dist/console/runtime/server/auth.js +2 -2
  96. package/dist/console/runtime/server/blob.d.ts +1 -1
  97. package/dist/console/runtime/server/blob.js +1 -1
  98. package/dist/console/runtime/server/channel-replay.d.ts +2 -2
  99. package/dist/console/runtime/server/channel-replay.js +4 -4
  100. package/dist/console/runtime/server/database.d.ts +1 -1
  101. package/dist/console/runtime/server/database.get.d.ts +1 -1
  102. package/dist/console/runtime/server/database.get.js +2 -2
  103. package/dist/console/runtime/server/database.js +1 -1
  104. package/dist/console/runtime/server/definitions.d.ts +1 -1
  105. package/dist/console/runtime/server/definitions.get.d.ts +3 -3
  106. package/dist/console/runtime/server/definitions.get.js +3 -3
  107. package/dist/console/runtime/server/definitions.js +1 -1
  108. package/dist/console/runtime/server/development.d.ts +2 -2
  109. package/dist/console/runtime/server/development.js +2 -2
  110. package/dist/console/runtime/server/documents.d.ts +1 -1
  111. package/dist/console/runtime/server/documents.js +1 -1
  112. package/dist/console/runtime/server/env.get.d.ts +1 -1
  113. package/dist/console/runtime/server/env.get.js +3 -3
  114. package/dist/console/runtime/server/invocation-capabilities.get.js +2 -2
  115. package/dist/console/runtime/server/invocation-workspace.get.d.ts +1 -1
  116. package/dist/console/runtime/server/invocation-workspace.get.js +5 -5
  117. package/dist/console/runtime/server/invocation.get.d.ts +1 -1
  118. package/dist/console/runtime/server/invocation.get.js +6 -6
  119. package/dist/console/runtime/server/invocations.get.js +3 -3
  120. package/dist/console/runtime/server/logs.get.d.ts +2 -2
  121. package/dist/console/runtime/server/logs.get.js +5 -5
  122. package/dist/console/runtime/server/mcp-client-operations.d.ts +1 -1
  123. package/dist/console/runtime/server/mcp-client-operations.js +3 -3
  124. package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
  125. package/dist/console/runtime/server/operation-contributions.js +1 -1
  126. package/dist/console/runtime/server/page-auth.d.ts +1 -1
  127. package/dist/console/runtime/server/page-tool.d.ts +1 -1
  128. package/dist/console/runtime/server/page-tool.js +2 -2
  129. package/dist/console/runtime/server/rpc.d.ts +2 -2
  130. package/dist/console/runtime/server/rpc.js +7 -7
  131. package/dist/console/runtime/server/search.get.js +1 -1
  132. package/dist/console/runtime/server/sections.d.ts +4 -4
  133. package/dist/console/runtime/server/sections.get.d.ts +1 -1
  134. package/dist/console/runtime/server/sections.get.js +5 -5
  135. package/dist/console/runtime/server/sections.js +3 -3
  136. package/dist/console/runtime/server/setup.d.ts +3 -3
  137. package/dist/console/runtime/server/setup.js +2 -2
  138. package/dist/console/runtime/server/site-entry.d.ts +1 -1
  139. package/dist/console/runtime/server/site-entry.js +9 -6
  140. package/dist/console/runtime/server/site-session.d.ts +5 -1
  141. package/dist/console/runtime/server/site-session.js +1 -1
  142. package/dist/console/runtime/server/status.get.d.ts +2 -2
  143. package/dist/console/runtime/server/status.get.js +5 -5
  144. package/dist/console/runtime/server/tickets.d.ts +1 -1
  145. package/dist/console/runtime/server/tickets.js +1 -1
  146. package/dist/console/runtime/server/usage.get.d.ts +2 -2
  147. package/dist/console/runtime/server/usage.get.js +7 -7
  148. package/dist/console/runtime/server/workspace-files.get.d.ts +1 -1
  149. package/dist/console/runtime/server/workspace-files.get.js +3 -3
  150. package/dist/console/server.d.ts +5 -5
  151. package/dist/console/server.js +6 -6
  152. package/dist/console/ui.js +121 -20
  153. package/dist/{console-route-COvNB_Xj.js → console-route-CBuqZ4wO.js} +1 -1
  154. package/dist/{database-J7M0B3ED.js → database-BdOBjPkS.js} +1 -1
  155. package/dist/{database-BVyhAxq-.d.ts → database-DyPVMjp_.d.ts} +1 -1
  156. package/dist/{definitions-BDRkT5-f.js → definitions-BW6SvmMM.js} +1 -0
  157. package/dist/{definitions-bepsXY5G.js → definitions-CNq_Shkh.js} +3 -3
  158. package/dist/{definitions-CxDT8D8Y.d.ts → definitions-DB4LbZ7T.d.ts} +2 -0
  159. package/dist/{definitions-CGTWTj67.d.ts → definitions-Dbgxfz3I.d.ts} +1 -1
  160. package/dist/development-W5EwONyL.d.ts +12 -0
  161. package/dist/{development-BzeSHZGH.js → development-zLxOp-AO.js} +12 -2
  162. package/dist/{diagnostics-D0DefmQj.js → diagnostics-9U_fYxMy.js} +30 -30
  163. package/dist/doctor.js +88 -107
  164. package/dist/{documents-C97WMaJZ.d.ts → documents-BASIRZ91.d.ts} +1 -1
  165. package/dist/{documents-RVHsQKFw.d.ts → documents-CboVhYFz.d.ts} +3 -3
  166. package/dist/{documents-DwPfR-fz.js → documents-CjJTCrY8.js} +3 -3
  167. package/dist/{documents-8US1nUgK.js → documents-qrHHqlNU.js} +1 -1
  168. package/dist/durability/operations.d.ts +1 -1
  169. package/dist/durability/operations.js +2 -2
  170. package/dist/{entries-D48wVEaS.js → entries-Bj-jPs_J.js} +1 -1
  171. package/dist/{error-diagnostics-C2rjmOlX.js → error-diagnostics-Bm3JKYjz.js} +19 -11
  172. package/dist/error-diagnostics.ts +19 -11
  173. package/dist/index.d.ts +15 -2
  174. package/dist/index.js +8 -4
  175. package/dist/internal/disabled-redis-driver.js +1 -1
  176. package/dist/internal/disabled-upstash-driver.js +1 -1
  177. package/dist/internal/test-loader.js +1 -1
  178. package/dist/internal/test-server.js +1 -1
  179. package/dist/{internal-BP_O70ic.d.ts → internal-CO4OqqaS.d.ts} +3 -3
  180. package/dist/{invocation-page-undo-BkUau8X7.js → invocation-page-undo-DIZ-s3xT.js} +2 -2
  181. package/dist/{invocations-CsucCJuq.js → invocations-CK_-G540.js} +3 -3
  182. package/dist/logs/memory.js +1 -1
  183. package/dist/logs/source.js +1 -1
  184. package/dist/logs.js +2 -2
  185. package/dist/{mcp-client-D0mUt18v.js → mcp-client-By4zk0vU.js} +6 -6
  186. package/dist/{media-wZMY6f2M.js → media-BHpQ-4jw.js} +4 -4
  187. package/dist/{media-library-CEo-Ye2B.d.ts → media-library-D9ThbXqs.d.ts} +1 -1
  188. package/dist/{media-library-BChf8XOd.js → media-library-NaOMBKWS.js} +2 -2
  189. package/dist/{memory-DhirB6SA.js → memory-DTmq-Z6x.js} +2 -2
  190. package/dist/{nuxt-server-imports-Lnaf5Fe-.js → nuxt-server-imports-DH60Z7LA.js} +3 -2
  191. package/dist/nuxt.d.ts +1 -1
  192. package/dist/nuxt.js +94 -67
  193. package/dist/{operation-contributions-DflAv5AC.js → operation-contributions-BdS0z3tx.js} +2 -2
  194. package/dist/{operation-contributions-fZyVo662.d.ts → operation-contributions-DpkO_iSU.d.ts} +1 -1
  195. package/dist/{operation-definition-Bn8V2hab.js → operation-definition-a5keEpCd.js} +6 -1
  196. package/dist/{operations-DX9EkHwb.d.ts → operations-B0689BG1.d.ts} +5 -0
  197. package/dist/operations-CAQmIxGK.js +2 -0
  198. package/dist/{operations-B6N-ja8x.js → operations-CWP9dF3i.js} +11 -11
  199. package/dist/{operations-Dj_cp-UK.js → operations-EOdyctDc.js} +1 -1
  200. package/dist/{optional-owners-Crm6kVS5.js → optional-owners-BNA2OX6z.js} +37 -23
  201. package/dist/{page-tool-BCRyx3pM.d.ts → page-tool-CRCK1RHV.d.ts} +1 -1
  202. package/dist/{plugins-DQ8pF-38.js → plugins-B-DpgDPB.js} +1459 -714
  203. package/dist/{plugins-5uDXr9Km.d.ts → plugins-BqAtIEX2.d.ts} +75 -56
  204. package/dist/{project-C2dnB9Kf.js → project-C4N_Zcjl.js} +3 -3
  205. package/dist/{project-5EN7JaXI.d.ts → project-CufkVP1u.d.ts} +2 -2
  206. package/dist/{project-DOeM0zg3.js → project-DlWTGB7h.js} +1 -1
  207. package/dist/{project-link-D_XQvBOC.d.ts → project-link-BuOzBH9f.d.ts} +1 -1
  208. package/dist/{project-link-Qi7nltHM.js → project-link-D-6UefhA.js} +2 -2
  209. package/dist/{request-yCybBeqT.js → request-DE8w_cSM.js} +8 -3
  210. package/dist/{request-BUYAlAJl.js → request-DbFfYmCu.js} +2 -2
  211. package/dist/{runtime-DM8Z6KLT.js → runtime-DQuHg7OO.js} +1 -1
  212. package/dist/{runtime-DG34DLXc.js → runtime-OsEDfbM9.js} +1 -1
  213. package/dist/runtime-feature-guard-B64MMW9I.js +140 -0
  214. package/dist/scan-module-D_3X08mj.js +2 -0
  215. package/dist/scan-module-Df58L_6T.js +311 -0
  216. package/dist/{secret-AZLhaNyr.js → secret-Dy5uqvq9.js} +1 -1
  217. package/dist/{sections-BriKrBgN.d.ts → sections-BogiCmtz.d.ts} +2 -2
  218. package/dist/{sections-ACHVTCWn.d.ts → sections-CyrXbbkG.d.ts} +4 -4
  219. package/dist/{sections-4xyBoiar.d.ts → sections-Do7X4Nwt.d.ts} +1 -2
  220. package/dist/{sections-D6AM5Gy5.js → sections-DumoLKQN.js} +2 -3
  221. package/dist/{sections-CUJyQA9d.js → sections-et20h8w3.js} +3 -3
  222. package/dist/{sections.get-1lHjyKCI.d.ts → sections.get-COiLcQ0P.d.ts} +2 -2
  223. package/dist/seo/runtime.js +1 -1
  224. package/dist/{server-DbjFYSeU.js → server-BRJE4t-W.js} +2 -2
  225. package/dist/{setup-DLZFzuLv.d.ts → setup-ZbA1by7W.d.ts} +4 -3
  226. package/dist/{site-access-Bhsty_v4.js → site-access-BbJUe5QI.js} +1 -1
  227. package/dist/{site-access-CyRtc0gZ.js → site-access-BmE8HGxs.js} +4 -4
  228. package/dist/{site-session-Jf21TVw8.js → site-session-odJq1dYa.js} +5 -5
  229. package/dist/skills/operations.d.ts +1 -1
  230. package/dist/skills/operations.js +2 -2
  231. package/dist/skills.d.ts +1 -1
  232. package/dist/{skills.get-CHQMzSD_.js → skills.get-Bl8cBe8u.js} +2 -2
  233. package/dist/{source-w9BHUwyO.js → source-D4wWtoHh.js} +1 -1
  234. package/dist/task/operations.d.ts +1 -1
  235. package/dist/task/operations.js +2 -2
  236. package/dist/test/register.js +1 -1
  237. package/dist/{ticket-RKQF6Wy9.js → ticket-Cudn1dq3.js} +1 -1
  238. package/dist/{tickets-CfJhT7d0.js → tickets-C_0Fhc00.js} +6 -6
  239. package/dist/{usage-Bc0YY_ka.js → usage-B4taNt4a.js} +1 -1
  240. package/dist/{usage-index-CMMT4cXQ.js → usage-index-BsGAFzyq.js} +1 -1
  241. package/dist/{version-DDRL_OYz.js → version-DNmSsk5r.js} +22 -19
  242. package/dist/{cli-DjoDGgT4.js → vite-stage-mmtwQIMA.js} +32 -2
  243. package/dist/{workspace-history-l47NPVSy.js → workspace-history-CraoERnc.js} +1 -1
  244. package/package.json +93 -93
  245. package/dist/cli-config--rAg6V-a.js +0 -2
  246. package/dist/decisions/vue.d.ts +0 -1
  247. package/dist/decisions/vue.js +0 -2
  248. package/dist/decisions.d.ts +0 -1
  249. package/dist/decisions.js +0 -2
  250. package/dist/development-DgaQ05jw.d.ts +0 -9
  251. package/dist/operations-H9q0QB2C.js +0 -2
  252. package/dist/runtime-feature-guard-rpZz1eMF.js +0 -55
  253. package/dist/scan-module-BTeOuZsp.js +0 -2
  254. package/dist/scan-module-DlHQ8a0X.js +0 -148
@@ -216,7 +216,7 @@ type HubCommentsOptions = CommentsVitePluginOptions & {
216
216
  //#endregion
217
217
  //#region src/health-vite.d.ts
218
218
  interface HealthOptions {
219
- /** The route that answers the health check. Default: `/api/_vitehub/health`. */
219
+ /** The route that answers the health check. Default: `/_vitehub/health`. */
220
220
  route?: string;
221
221
  }
222
222
  //#endregion
@@ -323,29 +323,6 @@ interface RedirectsOptions {
323
323
  previewHosts?: string[];
324
324
  }
325
325
  //#endregion
326
- //#region ../auth/dist/types-CNaeH2Fd.d.ts
327
- /** Where the Nuxt page guard sends visitors. */
328
- interface AuthRedirects {
329
- /** The login page for `auth: 'user'` pages. The guard adds `?redirect=<the page>`. Default `/login`. */
330
- login?: string;
331
- /** Where signed-in users go from `auth: 'guest'` pages. Default `/`. */
332
- guest?: string;
333
- }
334
- //#endregion
335
- //#region src/types.d.ts
336
- declare global {
337
- namespace ViteHub {
338
- interface AuthRuntimeEnv extends Record<string, unknown> {}
339
- /** Generated declarations set `definition` to the type of the app's Auth Definition. */
340
- interface AuthRegistry {}
341
- }
342
- }
343
- interface AuthObjectOptions {
344
- /** Where the Nuxt page guard of `definePageMeta({ auth })` sends visitors. Vite apps without Nuxt ignore it. */
345
- redirects?: AuthRedirects;
346
- }
347
- type AuthOptions = false | AuthObjectOptions;
348
- //#endregion
349
326
  //#region src/console/vite.d.ts
350
327
  /**
351
328
  * The Console options. `console: true` is the same as `console: {}`.
@@ -460,7 +437,7 @@ interface ObservabilityEvlogOptions {
460
437
  };
461
438
  }
462
439
  /** Where the Console and `vitehub logs` read logs. */
463
- type ObservabilityLogsOptions = {
440
+ type LogsOptions = {
464
441
  source: string;
465
442
  } | {
466
443
  maxEntries?: number;
@@ -492,18 +469,13 @@ interface ObservabilityOptions {
492
469
  /** Queue bound for best-effort events and for the log buffer. Defaults to 1,000. */
493
470
  maxPending?: number;
494
471
  /**
495
- * Read logs in the Console and with `vitehub logs`. `true` keeps a bounded Evlog buffer in `vite dev`. A production
496
- * build needs `{ source }`, which reads an existing backend and starts no logger unless `service` is set.
497
- */
498
- logs?: boolean | ObservabilityLogsOptions;
499
- /**
500
- * Send uncaught browser errors to `POST /api/_vitehub/browser-errors`. The server logs each one as an error on the
472
+ * Send uncaught browser errors to `POST /_vitehub/browser-errors`. The server logs each one as an error on the
501
473
  * request's Evlog event. Same origin only, 16 KiB at most, and 20 reports a minute for each address.
502
474
  */
503
475
  browserErrors?: boolean;
504
476
  }
505
477
  //#endregion
506
- //#region ../workspace/dist/types-BbtwmBZ5.d.ts
478
+ //#region ../workspace/dist/types-1Z-tKK3g.d.ts
507
479
  //#region src/core/types.d.ts
508
480
  type WorkspaceContent = string | Uint8Array;
509
481
  type WorkspaceContentStream = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
@@ -615,6 +587,8 @@ interface WorkspaceHistoryCommitBase extends WorkspaceHistoryRefOptions {
615
587
  ifHead: string | null;
616
588
  /** Expected heads of other refs that must remain unchanged for the commit. */
617
589
  ifHeads?: Record<string, string | null>;
590
+ /** Observe a rejection of this commit's own `ifHead` condition. The commit still throws the error. */
591
+ onHeadConflict?: (error: unknown) => void;
618
592
  /**
619
593
  * With `ifHead: null`, start the new ref from this revision instead of from the ref that `history.forksFrom(ref)`
620
594
  * names. Only Stores with `forksFrom` accept it. The caller has read the files of that revision.
@@ -659,6 +633,19 @@ interface WorkspaceRevisionView {
659
633
  * them from one archive of the commit. Stores without it read each file on its own.
660
634
  */
661
635
  preload?(paths: readonly string[]): Promise<void>;
636
+ /**
637
+ * The last revision that changed each path on the first-parent history, including deletions. A null value means
638
+ * the path has no change. A missing key means the Store could not prove the answer. To resolve missing keys,
639
+ * or when a Store does not implement this method, compare each revision's files with those of its first parent.
640
+ */
641
+ lastChanged?(paths: readonly string[]): Promise<ReadonlyMap<string, WorkspaceLastChange | null>>;
642
+ }
643
+ /** The revision that last changed a path, as `WorkspaceRevisionView.lastChanged()` answers. */
644
+ interface WorkspaceLastChange {
645
+ /** The revision id: the commit sha for the GitHub Store. */
646
+ id: string;
647
+ /** When the revision was made, as an ISO date: the commit's author date for the GitHub Store. */
648
+ createdAt: string;
662
649
  }
663
650
  /** An open pull request on a forge, for a Store whose refs are branches. */
664
651
  interface WorkspacePullRequest {
@@ -860,8 +847,8 @@ interface GitHubWorkspaceStoreOptions {
860
847
  */
861
848
  database?: unknown;
862
849
  refs?: GitHubWorkspaceRefs;
850
+ /** The repository, as `owner/name`. Defaults to `VITEHUB_WORKSPACE_GITHUB_REPOSITORY`. */
863
851
  repo?: GitHubWorkspaceOption;
864
- repository?: GitHubWorkspaceOption;
865
852
  /** The folder of the Workspace in the repository. An empty string is the repository root. Defaults to `.vitehub/workspaces/<workspace>`. */
866
853
  root?: GitHubWorkspaceOption;
867
854
  token?: GitHubWorkspaceOption;
@@ -915,7 +902,7 @@ type VercelSandboxNetworkPolicy = "allow-all" | "deny-all" | {
915
902
  };
916
903
  };
917
904
  //#endregion
918
- //#region ../agent/dist/types-EtgX4dic.d.ts
905
+ //#region ../agent/dist/types-CMop_fX7.d.ts
919
906
  //#endregion
920
907
  //#region src/agent-invocation.d.ts
921
908
  type AgentInvocationStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
@@ -1254,7 +1241,7 @@ interface AgentPreparationOptions {
1254
1241
  workspace: string;
1255
1242
  requireNonEmpty?: boolean;
1256
1243
  retryDelayMs?: number;
1257
- /** Readiness probe path. Defaults to /api/_vitehub/ready. */
1244
+ /** Readiness probe path. Defaults to /_vitehub/ready. */
1258
1245
  route?: string;
1259
1246
  }
1260
1247
  interface AgentShutdownOptions {
@@ -1314,7 +1301,7 @@ interface BlobImagesOptions {
1314
1301
  transformer?: BlobImageTransformerName;
1315
1302
  }
1316
1303
  //#endregion
1317
- //#region ../blob/dist/types-CNahKNos.d.ts
1304
+ //#region ../blob/dist/types-FTerpSjG.d.ts
1318
1305
  /**
1319
1306
  * Cloudflare R2 jurisdiction that keeps bucket data in one region.
1320
1307
  * @see https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions
@@ -1346,7 +1333,7 @@ interface FsBlobStoreConfig {
1346
1333
  remote?: boolean;
1347
1334
  /**
1348
1335
  * Origin of the links that `sign()` returns, such as `https://app.example`. Add the base URL of the app when it has
1349
- * one, such as `https://app.example/app`. Without it, the links start with `/_vitehub/blob/signed/`.
1336
+ * one, such as `https://app.example/app`. Without it, the links start with `/_vitehub/blob-signed/`.
1350
1337
  */
1351
1338
  urlBaseUrl?: string;
1352
1339
  }
@@ -1562,7 +1549,7 @@ interface EmailOptions {
1562
1549
  remote?: boolean;
1563
1550
  }
1564
1551
  //#endregion
1565
- //#region ../kv/dist/types-DEiKew_3.d.ts
1552
+ //#region ../kv/dist/types-Dv-OSXZC.d.ts
1566
1553
  interface CloudflareKVStoreConfig {
1567
1554
  driver: "cloudflare";
1568
1555
  binding?: string;
@@ -1583,7 +1570,7 @@ interface UpstashKVStoreConfig {
1583
1570
  token?: string;
1584
1571
  url?: string;
1585
1572
  /**
1586
- * Prefix of every key in Upstash. Default `vitehub:kv:<store>`, as for a Redis store, so `kv.clear()` and `kv.keys()`
1573
+ * Prefix of every key in Upstash. Default `vitehub:kv:<store>`, as for a Redis store, so `kv.clear()` and `kv.list()`
1587
1574
  * stay inside the store. An empty value uses the default.
1588
1575
  */
1589
1576
  base?: string;
@@ -1644,7 +1631,7 @@ interface KVStoresConfig {
1644
1631
  }
1645
1632
  type KVOptions = KVStoreConfig | InferredKVStoreConfig | KVStoresConfig | false;
1646
1633
  //#endregion
1647
- //#region ../mcp/dist/index-C1-UBQYi.d.ts
1634
+ //#region ../mcp/dist/index-DBxZC3vY.d.ts
1648
1635
  /** An icon that clients show for the server. `src` is an `https:` or `data:` URI. */
1649
1636
  interface McpIcon {
1650
1637
  src: string;
@@ -1680,12 +1667,12 @@ interface McpOptions {
1680
1667
  /**
1681
1668
  * Require an OAuth access token from `mcpOAuth()` of `vite-hub/auth/mcp`. Defaults to `true`, and then the app needs
1682
1669
  * `auth`. Set `false` to let anyone call every tool, or to check callers in each handler. Set `"optional"` to serve
1683
- * one route to everyone: anyone may list the tools and call those with `public: true`, and a call to another tool
1670
+ * one route to everyone: anyone may list the tools and call those with `access: "public"`, and a call to another tool
1684
1671
  * without a token returns a tool error with an `mcp/www_authenticate` challenge, so ChatGPT asks the person to sign in.
1685
1672
  */
1686
1673
  auth?: boolean | "optional";
1687
1674
  /**
1688
- * A second route, such as `/mcp`, that serves only the tools with `public: true`, with no sign-in. MCP clients do not
1675
+ * A second route, such as `/mcp`, that serves only the tools with `access: "public"`, with no sign-in. MCP clients do not
1689
1676
  * sign in on a route that answers without a token, so the tools that need a person stay on `route`. Needs `auth: true`.
1690
1677
  */
1691
1678
  publicRoute?: string;
@@ -1695,7 +1682,7 @@ interface McpOptions {
1695
1682
  serverInfo?: McpServerInfoOptions;
1696
1683
  }
1697
1684
  //#endregion
1698
- //#region ../rate-limit/dist/types-CMyR1JeW.d.ts
1685
+ //#region ../rate-limit/dist/types-OzukEqHf.d.ts
1699
1686
  /**
1700
1687
  * `kv` counts in the default KV store, shared by every server process when KV uses `redis`, `database`, or `upstash`.
1701
1688
  * With another KV driver, it counts in process memory and prints a warning at boot.
@@ -1709,7 +1696,7 @@ interface RateLimitOptions {
1709
1696
  scanDirs?: string[];
1710
1697
  }
1711
1698
  //#endregion
1712
- //#region ../realtime/dist/types-1DVVG5ro.d.ts
1699
+ //#region ../realtime/dist/types-Cvm0G3VJ.d.ts
1713
1700
  interface RealtimeOptions {
1714
1701
  /**
1715
1702
  * The driver that runs the rooms. `auto` (default) picks Durable Objects on Cloudflare and memory on the dev server. A
@@ -1727,7 +1714,7 @@ interface RealtimeOptions {
1727
1714
  projectRoot?: string;
1728
1715
  }
1729
1716
  //#endregion
1730
- //#region ../sandbox/dist/module-types-DCeJbS9Z.d.ts
1717
+ //#region ../sandbox/dist/module-types-BoOZiNN4.d.ts
1731
1718
  //#endregion
1732
1719
  //#region src/task/size.d.ts
1733
1720
  /** The size of the machine that runs every Sandbox Task. Both values are minimums. */
@@ -1742,7 +1729,14 @@ interface CloudflareSandboxTaskOptions {
1742
1729
  keepAlive?: boolean;
1743
1730
  normalizeId?: boolean;
1744
1731
  }
1745
- interface VercelSandboxTaskDriverOptions extends SandboxTaskSizeOptions {
1732
+ interface SandboxTaskDevOptions {
1733
+ /**
1734
+ * `vite dev` runs Sandbox Tasks as processes on this machine, with no isolation and no provider account.
1735
+ * Set `true` to use the host's Sandbox in `vite dev` too.
1736
+ */
1737
+ remote?: boolean;
1738
+ }
1739
+ interface VercelSandboxTaskDriverOptions extends SandboxTaskSizeOptions, SandboxTaskDevOptions {
1746
1740
  driver: 'vercel';
1747
1741
  runtime?: string;
1748
1742
  ports?: number[];
@@ -1753,7 +1747,7 @@ interface VercelSandboxTaskDriverOptions extends SandboxTaskSizeOptions {
1753
1747
  teamId?: string;
1754
1748
  projectId?: string;
1755
1749
  }
1756
- interface CloudflareSandboxTaskDefinitionDriverOptions extends SandboxTaskSizeOptions {
1750
+ interface CloudflareSandboxTaskDefinitionDriverOptions extends SandboxTaskSizeOptions, SandboxTaskDevOptions {
1757
1751
  driver: 'cloudflare';
1758
1752
  /** Maximum number of Containers that run at once. Defaults to 12. */
1759
1753
  maxInstances?: number;
@@ -1772,7 +1766,7 @@ type SandboxTaskDefinitionDriverOptions = VercelSandboxTaskDriverOptions | Cloud
1772
1766
  type AgentSandboxTaskConfig = SandboxTaskDefinitionDriverOptions | ({
1773
1767
  driver?: undefined;
1774
1768
  name?: string;
1775
- } & SandboxTaskSizeOptions);
1769
+ } & SandboxTaskSizeOptions & SandboxTaskDevOptions);
1776
1770
  //#endregion
1777
1771
  //#region ../sandbox/dist/task/vite.d.ts
1778
1772
  //#endregion
@@ -1800,7 +1794,7 @@ interface ScheduleOptions {
1800
1794
  runtime?: ScheduleProcessRuntimeOptions;
1801
1795
  }
1802
1796
  //#endregion
1803
- //#region ../workflow/dist/types-CnKVDnEp.d.ts
1797
+ //#region ../workflow/dist/types-Dsmwsdlv.d.ts
1804
1798
  interface WorkflowSharedOptions {
1805
1799
  binding?: string;
1806
1800
  name?: string;
@@ -1886,7 +1880,7 @@ interface I18nOptions {
1886
1880
  workspace?: string;
1887
1881
  }
1888
1882
  //#endregion
1889
- //#region ../queue/dist/types-BD-8U9zS.d.ts
1883
+ //#region ../queue/dist/types-CiuSIPR0.d.ts
1890
1884
  interface QueueSharedOptions {
1891
1885
  cache?: boolean;
1892
1886
  }
@@ -1926,6 +1920,15 @@ interface AgentOptions extends AgentOptions$1 {
1926
1920
  */
1927
1921
  invocations?: AgentInvocationsDefault;
1928
1922
  }
1923
+ /** Cloudflare options of `vitehub()`. */
1924
+ interface CloudflareOptions {
1925
+ /**
1926
+ * Writes the non-secret Server Env values set at build time to the Worker's `vars` in the generated `wrangler.json`.
1927
+ * ViteHub reads them from the process environment and the `.env` files Vite loads for the build mode. It never
1928
+ * writes a secret, a default, or a var that the Wrangler config already sets.
1929
+ */
1930
+ vars?: boolean;
1931
+ }
1929
1932
  /** `connections` options of `vitehub()`. */
1930
1933
  type ConnectionsOptions = Omit<ConnectionsVitePluginOptions, "database" | "databaseName" | "importBase"> & {
1931
1934
  /** The Database that stores grants, approvals, and activity, such as `"users"`. Defaults to `default`. */
@@ -2001,7 +2004,8 @@ interface ViteHubOptions {
2001
2004
  */
2002
2005
  security?: SecurityOptions;
2003
2006
  agent?: boolean | AgentOptions;
2004
- auth?: boolean | AuthOptions;
2007
+ /** `false` turns Auth off. `server/auth.ts` turns it on, and `defineAuth()` in that file holds every Auth option. */
2008
+ auth?: boolean;
2005
2009
  blob?: boolean | BlobOptions;
2006
2010
  browser?: boolean | BrowserOptions;
2007
2011
  /**
@@ -2048,7 +2052,7 @@ interface ViteHubOptions {
2048
2052
  */
2049
2053
  env?: false | EnvOptions;
2050
2054
  /**
2051
- * A health route for load balancers and container health checks, at `/api/_vitehub/health` unless `route` moves it.
2055
+ * A health route for load balancers and container health checks, at `/_vitehub/health` unless `route` moves it.
2052
2056
  * It answers `{ ok, version, commit, vitehub }` and checks each Database, KV store, and Blob store of the app in `checks`. It
2053
2057
  * answers 503 when one fails, and never shows error text.
2054
2058
  */
@@ -2060,6 +2064,11 @@ interface ViteHubOptions {
2060
2064
  */
2061
2065
  deploy?: DeployOptions;
2062
2066
  kv?: boolean | KVOptions;
2067
+ /**
2068
+ * Read logs in the Console and with `vitehub logs`. `true` keeps a bounded Evlog buffer in `vite dev`. A production
2069
+ * build needs `{ source }`, a server module that reads an existing backend. `{ source }` starts no logger.
2070
+ */
2071
+ logs?: boolean | LogsOptions;
2063
2072
  /**
2064
2073
  * The app MCP server at `/mcp`, with one tool per file in `server/mcp/tools/`. MCP clients sign in with `mcpOAuth()`
2065
2074
  * from `vite-hub/auth/mcp`, so it needs `auth`, unless `mcp: { auth: false }` lets anyone call every tool. Needs
@@ -2067,8 +2076,7 @@ interface ViteHubOptions {
2067
2076
  */
2068
2077
  mcp?: boolean | McpOptions;
2069
2078
  /**
2070
- * Request logs through Evlog, the logs that the Console and `vitehub logs` read with `logs`, and, with `service`, Agent
2071
- * telemetry and papercut reports through `useObservability()`.
2079
+ * Request logs through Evlog, and, with `service`, Agent telemetry and papercut reports through `useObservability()`.
2072
2080
  */
2073
2081
  observability?: boolean | ObservabilityOptions;
2074
2082
  /**
@@ -2099,11 +2107,22 @@ interface ViteHubOptions {
2099
2107
  * no unit. Other hosts ignore it.
2100
2108
  */
2101
2109
  systemd?: boolean | SystemdOptions;
2110
+ /** Cloudflare Worker build options. */
2111
+ cloudflare?: CloudflareOptions;
2112
+ /**
2113
+ * A Dockerfile for the server, written to `.output/Dockerfile` by production builds on the `node` host. On by default.
2114
+ * Build the image with `docker build -t <name> .output`. It runs `node .output/server/index.mjs` as the `node` user in
2115
+ * `/app`, mounts volumes for `/app/.vitehub` and a separate `dataDir`, stops on SIGTERM, and checks the `health`
2116
+ * route over HTTP when it is on. With native packages, build the app in the same Linux Node image that will run it.
2117
+ * `false` writes no Dockerfile. Other hosts ignore it.
2118
+ */
2119
+ docker?: boolean;
2102
2120
  /**
2103
2121
  * Sandbox Tasks in `server/sandbox-tasks/` and `*.sandbox-task.ts` files. Each run starts an isolated Cloudflare or
2104
2122
  * Vercel Sandbox. `true` uses the Sandbox of the host. An object sets the driver options, such as
2105
2123
  * `{ driver: "cloudflare", keepAlive: true, migrationTag: "v2" }` or `{ driver: "vercel", networkPolicy: "deny-all" }`.
2106
- * `driver: "vercel"` also works on hosts without a Sandbox, such as `node`, with Vercel credentials.
2124
+ * `driver: "vercel"` also works on hosts without a Sandbox, such as `node`, with Vercel credentials. `vite dev` runs
2125
+ * each task as a local process with no isolation; `remote: true` uses the provider's Sandbox in dev too.
2107
2126
  */
2108
2127
  sandboxTask?: boolean | ViteHubSandboxTaskOptions;
2109
2128
  schedule?: boolean | ScheduleOptions;
@@ -2121,4 +2140,4 @@ type ViteHubQueueOptions = QueueOptions;
2121
2140
  /** Sandbox Task options accepted by the framework distribution: the options of `hubSandboxTask()`. */
2122
2141
  type ViteHubSandboxTaskOptions = Exclude<SandboxTaskOptions, false>;
2123
2142
  //#endregion
2124
- export { SameOriginWritesOptions as A, detectHost as B, ObservabilityEvlogOptions as C, ConsoleOptions as D, SystemdOptions as E, HealthOptions as F, DatabaseNuxtIntegrationOptions as I, DatabaseOptions as L, SecurityOptions as M, SeoOptions as N, AuthOptions as O, DeployOptions as P, CacheOptions as R, WorkspaceOptions as S, ObservabilityOptions as T, ChannelsOptions as _, ViteHubNodeOptions as a, AgentInvocationsDefault as b, QueueOptions as c, ScheduleOptions as d, SandboxTaskOptions as f, EmailOptions as g, KVOptions as h, ViteHubDeviceOptions as i, SecurityHeaders as j, RedirectsOptions as k, I18nOptions as l, RateLimitOptions as m, ConnectionsOptions as n, ViteHubOptions as o, RealtimeOptions as p, EnvOptions$1 as r, ViteHubQueueOptions as s, AgentOptions as t, WorkflowOptions as u, BrowserOptions as v, ObservabilityLogsOptions as w, AgentInvocationsDefaultJournal as x, BlobOptions as y, ViteHubHost as z };
2143
+ export { SameOriginWritesOptions as A, detectHost as B, WorkspaceOptions as C, SystemdOptions as D, ObservabilityOptions as E, HealthOptions as F, DatabaseNuxtIntegrationOptions as I, DatabaseOptions as L, SecurityOptions as M, SeoOptions as N, ConsoleOptions as O, DeployOptions as P, CacheOptions as R, AgentInvocationsDefaultJournal as S, ObservabilityEvlogOptions as T, EmailOptions as _, ViteHubDeviceOptions as a, BlobOptions as b, ViteHubQueueOptions as c, WorkflowOptions as d, ScheduleOptions as f, KVOptions as g, RateLimitOptions as h, EnvOptions$1 as i, SecurityHeaders as j, RedirectsOptions as k, QueueOptions as l, RealtimeOptions as m, CloudflareOptions as n, ViteHubNodeOptions as o, SandboxTaskOptions as p, ConnectionsOptions as r, ViteHubOptions as s, AgentOptions as t, I18nOptions as u, ChannelsOptions as v, LogsOptions as w, AgentInvocationsDefault as x, BrowserOptions as y, ViteHubHost as z };
@@ -1,8 +1,8 @@
1
1
  import { n as consoleState } from "./internal-BreyUsQ6.js";
2
- import { c as consoleOperationGranted, t as allowedConsoleSections } from "./access-F0YP5D5E.js";
3
- import { n as consoleOperations } from "./operations-B6N-ja8x.js";
2
+ import { c as consoleOperationGranted, t as allowedConsoleSections } from "./access-BDST818p.js";
3
+ import { n as consoleOperations } from "./operations-CWP9dF3i.js";
4
4
  import { n as getConsoleProjectName, r as getConsoleSections, t as getConsoleBuild } from "./sections-C83x0slv.js";
5
- import { t as consoleOperationRegistry } from "./operation-contributions-DflAv5AC.js";
5
+ import { t as consoleOperationRegistry } from "./operation-contributions-BdS0z3tx.js";
6
6
  //#region src/console/runtime/server/project.ts
7
7
  /**
8
8
  * Describe the project for one Console access. `console.authorize` limits the sections and the operations. With
@@ -1,5 +1,5 @@
1
- import "./access-policy-BsB3QVe5.js";
2
- import "./sections.get-1lHjyKCI.js";
1
+ import "./access-policy-CGXhO3Ee.js";
2
+ import "./sections.get-COiLcQ0P.js";
3
3
  //#region src/console/runtime/server/project.d.ts
4
4
  declare global {
5
5
  interface ImportMeta {
@@ -23,7 +23,7 @@ function projectAppUrl(path) {
23
23
  }
24
24
  /**
25
25
  * A URL that the app returned, such as the served URL of a Blob file, on the project origin. A path such as
26
- * `/api/_vitehub/blob/a.png` gets the project origin. An absolute URL stays as it is.
26
+ * `/_vitehub/blob/a.png` gets the project origin. An absolute URL stays as it is.
27
27
  */
28
28
  function resolveProjectUrl(url) {
29
29
  const origin = (active.app ?? active).origin;
@@ -1,5 +1,5 @@
1
1
  import { i as ConsoleProjectTarget } from "./projects-Ddvl9EJp.js";
2
- import { t as ConsoleNavigation } from "./sections-BriKrBgN.js";
2
+ import { t as ConsoleNavigation } from "./sections-BogiCmtz.js";
3
3
  //#region src/console/runtime/client/project-link.d.ts
4
4
  /** The `project.get` protocol that this Console reads. */
5
5
  declare const consoleProjectProtocol = 1;
@@ -1,7 +1,7 @@
1
1
  import { n as callOperationRpc, r as operationRpcPath } from "./operation-rpc-DI9txNxK.js";
2
2
  import { t as consoleRpcHeader } from "./rpc-DIUA61pv.js";
3
- import { r as consoleErrorFields } from "./request-yCybBeqT.js";
4
- import { s as parseConsoleNavigation } from "./sections-CUJyQA9d.js";
3
+ import { r as consoleErrorFields } from "./request-DE8w_cSM.js";
4
+ import { s as parseConsoleNavigation } from "./sections-et20h8w3.js";
5
5
  //#region src/console/runtime/client/project-link.ts
6
6
  /** The `project.get` protocol that this Console reads. */
7
7
  const consoleProjectProtocol = 1;
@@ -1,8 +1,8 @@
1
- import { t as viteHubErrorDiagnostics } from "./error-diagnostics-C2rjmOlX.js";
1
+ import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
2
2
  import { n as callOperationRpc, r as operationRpcPath } from "./operation-rpc-DI9txNxK.js";
3
3
  import { t as consoleRpcHeader } from "./rpc-DIUA61pv.js";
4
- import { i as projectFetch } from "./project-DOeM0zg3.js";
5
- import { a as isConsoleDiagnosticCode, i as consoleStatusDiagnosticCode, n as consoleDiagnosticAction, t as consoleDiagnostic } from "./diagnostics-D0DefmQj.js";
4
+ import { i as projectFetch } from "./project-DlWTGB7h.js";
5
+ import { a as isConsoleDiagnosticCode, i as consoleStatusDiagnosticCode, n as consoleDiagnosticAction, t as consoleDiagnostic } from "./diagnostics-9U_fYxMy.js";
6
6
  import { Diagnostic } from "nostics";
7
7
  //#region src/console/runtime/client/request.ts
8
8
  const consoleApiMarker = "/_vitehub/api/";
@@ -115,6 +115,11 @@ const consoleRoutes = {
115
115
  "thread"
116
116
  ]
117
117
  },
118
+ "channels/deliveries": {
119
+ numbers: ["limit"],
120
+ operation: "channels.deliveries",
121
+ strings: ["agent", "channel"]
122
+ },
118
123
  "channels/export": {
119
124
  booleans: { media: "true" },
120
125
  operation: "conversations.export",
@@ -1,5 +1,5 @@
1
- import { i as consoleStatusDiagnosticCode, r as consoleDiagnosticBody, t as consoleDiagnostic } from "./diagnostics-D0DefmQj.js";
2
- import { r as isConsoleDevelopmentBuild } from "./development-BzeSHZGH.js";
1
+ import { i as consoleStatusDiagnosticCode, r as consoleDiagnosticBody, t as consoleDiagnostic } from "./diagnostics-9U_fYxMy.js";
2
+ import { i as isConsoleDevelopmentBuild } from "./development-zLxOp-AO.js";
3
3
  import { t as consoleHttpError } from "./http-error-Bs6e8_-8.js";
4
4
  import { getStandardContext, installRequestStandardContext } from "@vite-hub/runtime/internal/h3";
5
5
  import { isRuntimeResponse } from "@vite-hub/runtime/internal/runtime-type";
@@ -1,4 +1,4 @@
1
- import { n as getCacheEntry, r as listCacheEntries, t as deleteCacheEntries } from "./entries-D48wVEaS.js";
1
+ import { n as getCacheEntry, r as listCacheEntries, t as deleteCacheEntries } from "./entries-Bj-jPs_J.js";
2
2
  import { useStorage } from "nitro/storage";
3
3
  //#region src/cache/runtime.ts
4
4
  /** Nitro's `cache` mount, where `defineCachedFunction()` and `defineCachedHandler()` keep their entries. */
@@ -1,5 +1,5 @@
1
1
  import { r as isRecordOrFunction } from "./object-D8pRdprI.js";
2
- import { t as viteHubErrorDiagnostics } from "./error-diagnostics-C2rjmOlX.js";
2
+ import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
3
3
  import { t as redactInspectionText } from "./inspect-CDw7e0vK.js";
4
4
  import { n as taskRegistryKey } from "./registry-CDKLACCZ.js";
5
5
  import { runTask } from "nitro/task";
@@ -0,0 +1,140 @@
1
+ import { join } from "node:path";
2
+ import { existsSync } from "node:fs";
3
+ import { readFile } from "node:fs/promises";
4
+ //#region src/internal/runtime-feature-guard.ts
5
+ const configExtensions = [
6
+ "js",
7
+ "mjs",
8
+ "cjs",
9
+ "ts",
10
+ "mts",
11
+ "cts"
12
+ ];
13
+ /** The config scanner parses with `vite`. A production install can leave out that optional peer. */
14
+ async function loadConfigScanner(load = () => import("./scan-module-D_3X08mj.js")) {
15
+ try {
16
+ return await load();
17
+ } catch (error) {
18
+ if (error instanceof Error && Reflect.get(error, "code") === "ERR_MODULE_NOT_FOUND" && /'vite'/.test(error.message)) return;
19
+ throw error;
20
+ }
21
+ }
22
+ /**
23
+ * The literal `vitehub()` options and `vitehub: {}` keys of a config file, read without evaluating it. Undefined without
24
+ * a config file, or without `vite` to parse it.
25
+ */
26
+ async function viteHubOptionObjects(rootDir, loadScanner = loadConfigScanner) {
27
+ const owner = configExtensions.some((extension) => existsSync(join(rootDir, `nuxt.config.${extension}`))) ? "nuxt" : "vite";
28
+ const file = configExtensions.map((extension) => join(rootDir, `${owner}.config.${extension}`)).find((path) => existsSync(path));
29
+ if (!file) return;
30
+ const source = await readFile(file, "utf8");
31
+ const scan = await loadScanner();
32
+ if (!scan) return;
33
+ const { argumentExpression, defaultExportExpression, findProperty, objectProperties, scanModule, staticString, unwrapExpression, walk } = scan;
34
+ const module = scanModule(source, file);
35
+ const pluginNames = /* @__PURE__ */ new Set();
36
+ const defineConfigNames = new Set(owner === "nuxt" ? ["defineNuxtConfig"] : []);
37
+ for (const statement of module.program.body) {
38
+ if (statement.type !== "ImportDeclaration" || statement.importKind === "type") continue;
39
+ for (const specifier of statement.specifiers) {
40
+ if (specifier.type !== "ImportSpecifier" || specifier.importKind === "type") continue;
41
+ const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value;
42
+ if (statement.source.value === "vite-hub" && imported === "vitehub") pluginNames.add(specifier.local.name);
43
+ if (owner === "vite" && statement.source.value === "vite" && imported === "defineConfig") defineConfigNames.add(specifier.local.name);
44
+ }
45
+ }
46
+ const options = [];
47
+ const calls = [];
48
+ walk(module.program, (node) => {
49
+ if (node.type === "ObjectExpression") for (const property of node.properties) {
50
+ if (property.type !== "Property" || property.computed || property.key.type !== "Identifier" || property.key.name !== "vitehub") continue;
51
+ const value = unwrapExpression(property.value);
52
+ if (value.type === "ObjectExpression") options.push(value);
53
+ }
54
+ if (node.type === "CallExpression" && node.callee.type === "Identifier" && pluginNames.has(node.callee.name)) {
55
+ const value = argumentExpression(node.arguments[0]);
56
+ calls.push(node);
57
+ if (value?.type === "ObjectExpression") options.push(value);
58
+ }
59
+ });
60
+ if (module.errors.length > 0) return {
61
+ active: void 0,
62
+ options,
63
+ scan
64
+ };
65
+ const literal = (node) => node?.type === "ObjectExpression" && node.properties.every((property) => property.type === "Property" && !property.computed) ? node : void 0;
66
+ const exported = defaultExportExpression(module);
67
+ const config = literal(exported?.type === "CallExpression" && exported.callee.type === "Identifier" && defineConfigNames.has(exported.callee.name) ? argumentExpression(exported.arguments[0]) : exported);
68
+ let active;
69
+ if (config && owner === "vite") {
70
+ const plugins = findProperty(config, "plugins")?.value;
71
+ const call = calls.length === 1 ? calls[0] : void 0;
72
+ if (call && plugins?.type === "ArrayExpression" && plugins.elements.some((plugin) => plugin !== null && argumentExpression(plugin) === call)) active = literal(argumentExpression(call.arguments[0]));
73
+ }
74
+ if (config && owner === "nuxt" && calls.length === 0 && !objectProperties(config).some((property) => property.key === "extends" || property.key?.startsWith("$"))) {
75
+ const modules = findProperty(config, "modules")?.value;
76
+ if (!modules || modules.type === "ArrayExpression" && modules.elements.every((entry) => {
77
+ const value = entry === null ? void 0 : argumentExpression(entry);
78
+ if (value?.type !== "ArrayExpression") return staticString(value) !== void 0;
79
+ const name = value.elements[0];
80
+ const moduleName = name ? staticString(argumentExpression(name)) : void 0;
81
+ return moduleName !== void 0 && moduleName !== "vite-hub/nuxt";
82
+ })) active = literal(findProperty(config, "vitehub")?.value);
83
+ }
84
+ return {
85
+ active,
86
+ options,
87
+ scan
88
+ };
89
+ }
90
+ /**
91
+ * Detects explicit Agent CLI opt-outs without evaluating the project config. Without `vite`, it cannot parse the config,
92
+ * so the command stays enabled: `vitehub agent invocations` reads a journal and needs no project.
93
+ */
94
+ async function isAgentCliEnabled(rootDir, loadScanner = loadConfigScanner) {
95
+ const config = await viteHubOptionObjects(rootDir, loadScanner);
96
+ if (!config) return true;
97
+ const { findProperty, staticValue } = config.scan;
98
+ return !config.options.some((object) => {
99
+ const agent = findProperty(object, "agent")?.value;
100
+ if (agent === void 0) return false;
101
+ if (staticValue(agent) === false) return true;
102
+ const cli = agent.type === "ObjectExpression" ? findProperty(agent, "cli")?.value : void 0;
103
+ return cli !== void 0 && staticValue(cli) === false;
104
+ });
105
+ }
106
+ /**
107
+ * The `file:` Agent State URL that the default Invocation journal goes next to, as `agentJournalStateUrl()` selects it
108
+ * from the evaluated options. Reads only literal values: a computed value, a spread, or a `dataDir` gives undefined, and
109
+ * the CLI keeps its default journal.
110
+ */
111
+ async function readAgentJournalStateUrl(rootDir, env) {
112
+ const config = await viteHubOptionObjects(rootDir);
113
+ const options = config?.active;
114
+ if (!config || !options) return;
115
+ const { findProperty, objectProperties, staticString, staticValue } = config.scan;
116
+ const literalObject = (node) => node?.type === "ObjectExpression" && objectProperties(node).every((property) => property.key !== void 0) ? node : void 0;
117
+ if (findProperty(options, "dataDir")) return;
118
+ if (staticString(findProperty(options, "host")?.value) !== "node") return;
119
+ if (env.VITEHUB_HOST && env.VITEHUB_HOST !== "node") return;
120
+ const agent = literalObject(findProperty(options, "agent")?.value);
121
+ if (!agent) return;
122
+ const invocations = findProperty(agent, "invocations")?.value;
123
+ if (invocations !== void 0 && staticValue(invocations) !== void 0) {
124
+ const setting = literalObject(invocations);
125
+ if (!setting || findProperty(setting, "store") || findProperty(setting, "databaseUrl")) return;
126
+ }
127
+ const providers = literalObject(findProperty(agent, "providers")?.value);
128
+ const state = providers && literalObject(findProperty(providers, "state")?.value);
129
+ if (!state) return;
130
+ const driver = findProperty(state, "driver")?.value;
131
+ if (driver !== void 0 && ![
132
+ "auto",
133
+ "libsql",
134
+ "sqlite"
135
+ ].includes(staticString(driver) ?? "")) return;
136
+ const url = staticString(findProperty(state, "url")?.value)?.trim();
137
+ return url && /^file:/i.test(url) ? url : void 0;
138
+ }
139
+ //#endregion
140
+ export { isAgentCliEnabled, readAgentJournalStateUrl };
@@ -0,0 +1,2 @@
1
+ import { a as findCalls, c as maskLiterals, d as objectProperties, f as scanModule, g as unwrapExpression, h as templateExpressionSources, i as exportNames, l as moduleTokens, m as staticValue, n as defaultExportExpression, o as findDefaultExportCall, p as staticString, r as dynamic, s as findProperty, t as argumentExpression, u as nodeText, v as walk } from "./scan-module-Df58L_6T.js";
2
+ export { argumentExpression, defaultExportExpression, dynamic, exportNames, findCalls, findDefaultExportCall, findProperty, maskLiterals, moduleTokens, nodeText, objectProperties, scanModule, staticString, staticValue, templateExpressionSources, unwrapExpression, walk };