vite-hub 0.5.1 → 0.6.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 (346) hide show
  1. package/README.md +9 -8
  2. package/dist/{access-BBHk9b5P.js → access-DiI9bMuK.js} +9 -133
  3. package/dist/{access-policy-CUbJLvlR.d.ts → access-DkBck8Vu.d.ts} +16 -16
  4. package/dist/{account-CoAO1F8G.d.ts → account-DNr8fHcQ.d.ts} +1 -1
  5. package/dist/{console/runtime/server → agent/console}/agents.get.d.ts +1 -1
  6. package/dist/{console/runtime/server → agent/console}/agents.get.js +3 -3
  7. package/dist/{console/runtime/server → agent/console}/channel-replay.d.ts +2 -2
  8. package/dist/{console/runtime/server → agent/console}/channel-replay.js +6 -6
  9. package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.js +4 -4
  10. package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.d.ts +3 -3
  11. package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.js +6 -6
  12. package/dist/{console/runtime/server → agent/console}/invocation.get.d.ts +4 -4
  13. package/dist/{console/runtime/server → agent/console}/invocation.get.js +8 -8
  14. package/dist/{console/runtime/server → agent/console}/invocations.get.js +5 -5
  15. package/dist/{console/runtime/server/usage.get.d.ts → agent/console/invocations.usage.d.ts} +2 -4
  16. package/dist/agent/console/invocations.usage.js +51 -0
  17. package/dist/agent/console/operations.d.ts +6 -0
  18. package/dist/agent/console/operations.js +247 -0
  19. package/dist/{console/runtime/server → agent/console}/status.get.d.ts +2 -2
  20. package/dist/{console/runtime/server → agent/console}/status.get.js +6 -6
  21. package/dist/{server-DsOEa4_A.js → agent-console-CHsLxKk_.js} +3 -2
  22. package/dist/agent-console-FmaYpVv-.d.ts +14 -0
  23. package/dist/{agent-invocations.post-BAC1aHnG.js → agent-invocations.post-FMmoXMpi.js} +8 -8
  24. package/dist/{agents-BClUWOj7.js → agents-DBm_PJie.js} +1 -1
  25. package/dist/{agents-Cz_uhhov.js → agents-DXLHsE7x.js} +2 -2
  26. package/dist/auth/console/auth.d.ts +25 -0
  27. package/dist/{console/runtime/server → auth/console}/auth.js +11 -12
  28. package/dist/auth/console/operations.d.ts +3 -0
  29. package/dist/auth/console/operations.js +135 -0
  30. package/dist/{auth-operations-arLIY2_2.js → auth-operations-BKqoX8Ua.js} +3 -3
  31. package/dist/{auth-types-B4mq4YhK.d.ts → auth-types-Cotn7406.d.ts} +4 -17
  32. package/dist/bin.js +3 -3
  33. package/dist/blob/console/operations.d.ts +3 -0
  34. package/dist/blob/console/operations.js +44 -0
  35. package/dist/{blob-eH6j0AQj.js → blob-0V-aZPZi.js} +2 -2
  36. package/dist/{blob-_TtxDb-t.d.ts → blob-uNin0_TV.d.ts} +1 -1
  37. package/dist/cache/operations.js +1 -1
  38. package/dist/console/auth-types.d.ts +2 -2
  39. package/dist/console/auth.d.ts +2 -2
  40. package/dist/console/runtime/auth-operations.d.ts +3 -3
  41. package/dist/console/runtime/auth-operations.js +1 -1
  42. package/dist/console/runtime/client/account.d.ts +1 -1
  43. package/dist/console/runtime/client/account.js +2 -2
  44. package/dist/console/runtime/client/auth-management.ts +6 -6
  45. package/dist/console/runtime/client/blob-media.js +2 -2
  46. package/dist/console/runtime/client/comment-thread.js +1 -1
  47. package/dist/console/runtime/client/content-heads.js +1 -1
  48. package/dist/console/runtime/client/documents.d.ts +1 -1
  49. package/dist/console/runtime/client/documents.js +1 -1
  50. package/dist/console/runtime/client/invocation.js +1 -1
  51. package/dist/console/runtime/client/live.d.ts +1 -1
  52. package/dist/console/runtime/client/mcp-client.d.ts +4 -4
  53. package/dist/console/runtime/client/mcp-client.js +4 -6
  54. package/dist/console/runtime/client/media-library.js +1 -1
  55. package/dist/console/runtime/client/media-uploads.js +1 -1
  56. package/dist/console/runtime/client/operation-view.js +1 -1
  57. package/dist/console/runtime/client/presence.d.ts +1 -1
  58. package/dist/console/runtime/client/problem.d.ts +1 -1
  59. package/dist/console/runtime/client/problem.js +2 -2
  60. package/dist/console/runtime/client/project-link.d.ts +1 -1
  61. package/dist/console/runtime/client/project-link.js +1 -1
  62. package/dist/console/runtime/client/project-session.d.ts +2 -2
  63. package/dist/console/runtime/client/project-session.js +1 -1
  64. package/dist/console/runtime/client/publish.d.ts +1 -1
  65. package/dist/console/runtime/client/rate-limit.js +1 -1
  66. package/dist/console/runtime/client/read-only.d.ts +1 -1
  67. package/dist/console/runtime/client/read-only.js +1 -1
  68. package/dist/console/runtime/client/request.d.ts +2 -2
  69. package/dist/console/runtime/client/request.js +1 -1
  70. package/dist/console/runtime/client/schedule-run.js +1 -1
  71. package/dist/console/runtime/client/sections.d.ts +1 -1
  72. package/dist/console/runtime/client/sections.js +1 -1
  73. package/dist/console/runtime/client/site-access.d.ts +48 -9
  74. package/dist/console/runtime/client/site-access.js +18 -11
  75. package/dist/console/runtime/client/site-link.d.ts +2 -0
  76. package/dist/console/runtime/client/site-link.js +1 -0
  77. package/dist/console/runtime/client/workflow.js +1 -1
  78. package/dist/console/runtime/components/console-auth-detail.vue +1 -1
  79. package/dist/console/runtime/components/console-auth-event-list.vue +1 -0
  80. package/dist/console/runtime/components/console-document-editor.vue +3 -4
  81. package/dist/console/runtime/components/console-usage.vue +2 -2
  82. package/dist/console/runtime/diagnostics.ts +14 -56
  83. package/dist/console/runtime/mcp-client.d.ts +2 -2
  84. package/dist/console/runtime/mcp-client.js +1 -1
  85. package/dist/console/runtime/operation-loader.d.ts +1 -0
  86. package/dist/console/runtime/operation-loader.js +10 -0
  87. package/dist/console/runtime/page-tool/page-tool.js +2 -2
  88. package/dist/console/runtime/sections.d.ts +2 -2
  89. package/dist/console/runtime/sections.js +1 -1
  90. package/dist/console/runtime/server/access-policy.d.ts +1 -1
  91. package/dist/console/runtime/server/agent-console.d.ts +2 -0
  92. package/dist/console/runtime/server/agent-console.js +1 -0
  93. package/dist/console/runtime/server/blob.d.ts +1 -1
  94. package/dist/console/runtime/server/blob.js +1 -1
  95. package/dist/console/runtime/server/database.d.ts +1 -1
  96. package/dist/console/runtime/server/definitions.get.d.ts +2 -2
  97. package/dist/console/runtime/server/definitions.get.js +2 -2
  98. package/dist/console/runtime/server/definitions.js +1 -1
  99. package/dist/console/runtime/server/documents.d.ts +2 -2
  100. package/dist/console/runtime/server/documents.js +2 -2
  101. package/dist/console/runtime/server/entry-site-access.d.ts +3 -0
  102. package/dist/console/runtime/server/entry-site-access.js +4 -0
  103. package/dist/console/runtime/server/entry.d.ts +3 -0
  104. package/dist/console/runtime/server/entry.js +4 -0
  105. package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
  106. package/dist/console/runtime/server/operation-contributions.js +1 -1
  107. package/dist/console/runtime/server/pill.d.ts +45 -0
  108. package/dist/console/runtime/server/pill.js +62 -0
  109. package/dist/console/runtime/server/rpc.d.ts +5 -8
  110. package/dist/console/runtime/server/rpc.js +14 -20
  111. package/dist/console/runtime/server/runtime.d.ts +1 -1
  112. package/dist/console/runtime/server/runtime.js +1 -1
  113. package/dist/console/runtime/server/sections.d.ts +4 -4
  114. package/dist/console/runtime/server/sections.get.d.ts +1 -1
  115. package/dist/console/runtime/server/sections.get.js +4 -4
  116. package/dist/console/runtime/server/sections.js +3 -3
  117. package/dist/console/runtime/server/setup.d.ts +4 -4
  118. package/dist/console/runtime/server/setup.js +3 -3
  119. package/dist/console/runtime/server/site-access-operation.d.ts +7 -0
  120. package/dist/console/runtime/server/site-access-operation.js +36 -0
  121. package/dist/console/runtime/server/site-actions.d.ts +73 -0
  122. package/dist/console/runtime/server/site-actions.js +105 -0
  123. package/dist/console/runtime/server/site-entry.d.ts +16 -7
  124. package/dist/console/runtime/server/site-entry.js +59 -42
  125. package/dist/console/runtime/server/site-visitor.d.ts +17 -0
  126. package/dist/console/runtime/server/site-visitor.js +1 -0
  127. package/dist/console/runtime/server/site.d.ts +27 -0
  128. package/dist/console/runtime/server/site.js +1 -0
  129. package/dist/console/server.d.ts +7 -19
  130. package/dist/console/server.js +6 -6
  131. package/dist/console-signature--55DIKf2.js +237 -0
  132. package/dist/content/console/operations.d.ts +3 -0
  133. package/dist/content/console/operations.js +62 -0
  134. package/dist/{console/runtime/server → database/console}/database.get.d.ts +1 -1
  135. package/dist/{console/runtime/server → database/console}/database.get.js +4 -4
  136. package/dist/database/console/operations.d.ts +3 -0
  137. package/dist/database/console/operations.js +49 -0
  138. package/dist/{database-CPjZ3L0g.d.ts → database-yFezh5U1.d.ts} +1 -1
  139. package/dist/{definitions-M7i2p8SR.js → definitions-DGo2rNQ9.js} +1 -1
  140. package/dist/{dev-peer-DBq-isgi.js → dev-peer-CRYp01PE.js} +1 -219
  141. package/dist/dev-peer-CX5C9243.js +1 -0
  142. package/dist/{diagnostics-B2cqlCSz.js → diagnostics-DLHqjKGe.js} +2 -8
  143. package/dist/diagnostics-DgGKvWzF.d.ts +7 -0
  144. package/dist/doctor.js +2 -2
  145. package/dist/{documents-LtkKCxtu.d.ts → documents-A-7Ho0g0.d.ts} +11 -11
  146. package/dist/{documents-Ck_iub9w.js → documents-BduuZjm3.js} +3 -2
  147. package/dist/{documents-BOYwZ5g4.js → documents-C6x95F1A.js} +12 -15
  148. package/dist/{documents-DxK0tdjA.d.ts → documents-CApMRd4o.d.ts} +2 -3
  149. package/dist/durability/operations.js +1 -1
  150. package/dist/{console/runtime/server → env/console}/env.get.d.ts +2 -2
  151. package/dist/{console/runtime/server → env/console}/env.get.js +7 -7
  152. package/dist/env/console/operations.d.ts +3 -0
  153. package/dist/env/console/operations.js +12 -0
  154. package/dist/env/vite.d.ts +1 -0
  155. package/dist/env/vite.js +2 -0
  156. package/dist/index.d.ts +1 -1
  157. package/dist/index.js +2 -2
  158. package/dist/{internal-CKocv79I.d.ts → internal-BRNf11h3.d.ts} +14 -4
  159. package/dist/{invocation-page-undo-BEi-rO0Q.js → invocation-page-undo-DHbXczWY.js} +6 -4
  160. package/dist/invocations-B60XWNES.js +45 -0
  161. package/dist/{console/runtime/server → logs/console}/logs.get.d.ts +3 -3
  162. package/dist/{console/runtime/server → logs/console}/logs.get.js +7 -7
  163. package/dist/logs/console/operations.d.ts +3 -0
  164. package/dist/logs/console/operations.js +23 -0
  165. package/dist/loopback-Bl9Cvj1k.js +139 -0
  166. package/dist/mcp/eval.d.ts +1 -0
  167. package/dist/mcp/eval.js +2 -0
  168. package/dist/{mcp-client-Q2XbUXuP.d.ts → mcp-client-uXVvS7RL.d.ts} +4 -6
  169. package/dist/{media-CAKz9yrp.js → media-Dc6atYyw.js} +5 -5
  170. package/dist/{media-library-BDX89xXA.js → media-library-DTC8TLsZ.js} +1 -1
  171. package/dist/nuxt.d.ts +1 -1
  172. package/dist/nuxt.js +108 -68
  173. package/dist/{operation-contributions-D10pjkJF.js → operation-contributions-D-5OYBME.js} +7 -6
  174. package/dist/{operation-contributions-BCcQVlGb.d.ts → operation-contributions-xwjDzj28.d.ts} +5 -4
  175. package/dist/{operation-definition-DTpNvLd8.js → operation-definition-D04Rdjbe.js} +2 -1
  176. package/dist/operation-modules-C6zDmJz6.js +1 -0
  177. package/dist/operation-modules-Cb69yoMi.js +139 -0
  178. package/dist/{operations-CD_mu_Ww.js → operations-BsEUHt-z.js} +5 -2
  179. package/dist/operations-CWnZTxfB.js +113 -0
  180. package/dist/operations-DWaXf63n.js +1 -0
  181. package/dist/{optional-owners-DAfShdgV.js → optional-owners-Cypch7V3.js} +0 -1
  182. package/dist/page-tools-BeZrtn4S.js +46 -0
  183. package/dist/page-tools-Chk8Gm9x.d.ts +23 -0
  184. package/dist/page-tools-shared-BLPidmCi.js +39 -0
  185. package/dist/{plugins-H6-MQrsn.js → plugins-BTYvMKCm.js} +250 -312
  186. package/dist/{plugins-BpiTVULl.d.ts → plugins-BmkOoyIh.d.ts} +22 -9
  187. package/dist/{project-DKBIHOf4.d.ts → project-B2qWt8on.d.ts} +2 -7
  188. package/dist/{project-BxyyclTE.js → project-CJq2DOF0.js} +5 -7
  189. package/dist/{project-link-CeS0T8Pr.js → project-link-CJbCkOlC.js} +3 -3
  190. package/dist/{project-link-isfdRO3Q.d.ts → project-link-Ck3vuq9w.d.ts} +1 -1
  191. package/dist/{project-session--GN7MduT.js → project-session-8pN7pRo8.js} +4 -4
  192. package/dist/{request-CQ8TkHLh.js → request-D769eiBL.js} +2 -2
  193. package/dist/{request-BC_krbEr.d.ts → request-DYmjLTqP.d.ts} +1 -1
  194. package/dist/{request-CJCPyu2B.d.ts → request-DkoE0b2h.d.ts} +10 -2
  195. package/dist/{request-Cl68STwT.js → request-XFVx7CGC.js} +24 -2
  196. package/dist/routes-D02vxUSg.js +26 -0
  197. package/dist/{runtime-CyPZMiyK.js → runtime-DA7HJe10.js} +1 -1
  198. package/dist/{runtime-Cf8R1Ztr.d.ts → runtime-DGvimtvc.d.ts} +1 -1
  199. package/dist/{runtime-feature-guard-DpUn4Oxc.js → runtime-feature-guard-BKAMRZzM.js} +1 -1
  200. package/dist/search-jgMrZJXR.js +84 -0
  201. package/dist/{sections-BiCOk9qP.js → sections-AUGy9EkY.js} +1 -6
  202. package/dist/{sections-BTfWK14a.d.ts → sections-BMkFB3S-.d.ts} +1 -1
  203. package/dist/{sections-0qrBvGbf.d.ts → sections-DCoCa4nF.d.ts} +1 -4
  204. package/dist/{sections-DAtgYMVz.d.ts → sections-DjeAUX7o.d.ts} +4 -4
  205. package/dist/{sections-HLxb9MrG.js → sections-ZFAlI4JW.js} +2 -2
  206. package/dist/{sections.get-CGmtYmfu.d.ts → sections.get-BY5dClJY.d.ts} +1 -1
  207. package/dist/{setup-Ca7jtBLS.d.ts → setup-BBnZPziq.d.ts} +4 -7
  208. package/dist/{setup-DQz_i-ee.js → setup-yc3_WKNG.js} +1 -13
  209. package/dist/site-CZCIWsUQ.js +169 -0
  210. package/dist/site-link-Bvo2SxPo.js +58 -0
  211. package/dist/site-link-Dtw8MNVB.d.ts +18 -0
  212. package/dist/site-pages-B6J8U2Nq.js +66 -0
  213. package/dist/site-token-Wa7fhjwg.js +215 -0
  214. package/dist/site-visitor-BkhE2TA0.js +89 -0
  215. package/dist/skills/operations.js +2 -2
  216. package/dist/{skills.get-DAooGWy5.js → skills.get-CW8vc_Hf.js} +3 -3
  217. package/dist/task/operations.js +1 -1
  218. package/dist/usage-DBi7aOhx.js +33 -0
  219. package/dist/{version-CAhBr673.js → version-DUCd7Orc.js} +11 -5
  220. package/dist/workspace/console/operations.d.ts +3 -0
  221. package/dist/workspace/console/operations.js +22 -0
  222. package/dist/{console/runtime/server → workspace/console}/workspace-files.get.d.ts +3 -3
  223. package/dist/{console/runtime/server → workspace/console}/workspace-files.get.js +4 -4
  224. package/package.json +91 -82
  225. package/dist/auth-CeKxL2xp.d.ts +0 -116
  226. package/dist/cloudflare-env-lookup-DcN7pGlv.js +0 -15
  227. package/dist/console/runtime/client/ticket.d.ts +0 -2
  228. package/dist/console/runtime/client/ticket.js +0 -1
  229. package/dist/console/runtime/page/loader.js +0 -135
  230. package/dist/console/runtime/server/auth.d.ts +0 -2
  231. package/dist/console/runtime/server/mcp-client-operations.d.ts +0 -3
  232. package/dist/console/runtime/server/mcp-client-operations.js +0 -137
  233. package/dist/console/runtime/server/page-auth.d.ts +0 -16
  234. package/dist/console/runtime/server/page-auth.js +0 -43
  235. package/dist/console/runtime/server/page-tool.d.ts +0 -2
  236. package/dist/console/runtime/server/page-tool.js +0 -110
  237. package/dist/console/runtime/server/page-tools-route.d.ts +0 -2
  238. package/dist/console/runtime/server/page-tools-route.js +0 -4
  239. package/dist/console/runtime/server/search.get.d.ts +0 -2
  240. package/dist/console/runtime/server/search.get.js +0 -95
  241. package/dist/console/runtime/server/site-session.d.ts +0 -79
  242. package/dist/console/runtime/server/site-session.js +0 -1
  243. package/dist/console/runtime/server/tickets.d.ts +0 -2
  244. package/dist/console/runtime/server/tickets.js +0 -1
  245. package/dist/console/runtime/server/usage.get.js +0 -91
  246. package/dist/console/runtime/site-access.d.ts +0 -2
  247. package/dist/console/runtime/site-access.js +0 -1
  248. package/dist/diagnostics-BXxPggRw.d.ts +0 -9
  249. package/dist/invocations-8NThe8Bx.js +0 -85
  250. package/dist/mcp-client-Bkh-khvr.js +0 -9
  251. package/dist/mcp-client-DiObFpDS.js +0 -1037
  252. package/dist/operations-D7ENc68Y.js +0 -1
  253. package/dist/operations-vRLiH7dh.js +0 -852
  254. package/dist/page-tool-BUnUbuSy.d.ts +0 -67
  255. package/dist/page-tools-BQzwuAHD.js +0 -460
  256. package/dist/page-tools-UwsfvH-B.d.ts +0 -21
  257. package/dist/page-tools-shared-hJcG_xk8.js +0 -125
  258. package/dist/secret-D2KL_o2h.js +0 -43
  259. package/dist/site-access-1JIQjY11.js +0 -292
  260. package/dist/site-access-CUXIbbbR.d.ts +0 -53
  261. package/dist/site-access-CmaZ-oaL.js +0 -17
  262. package/dist/site-access-Cvmjb6aw.js +0 -1
  263. package/dist/site-session-D36fr7Wf.js +0 -297
  264. package/dist/skills/vitehub/SKILL.md +0 -142
  265. package/dist/skills/vitehub/agents/openai.yaml +0 -4
  266. package/dist/skills/vitehub/references/agent-definitions.md +0 -36
  267. package/dist/skills/vitehub/references/bundle.md +0 -57
  268. package/dist/skills/vitehub/references/capabilities-authority.md +0 -30
  269. package/dist/skills/vitehub/references/channels-triggers.md +0 -27
  270. package/dist/skills/vitehub/references/framework-composition.md +0 -29
  271. package/dist/skills/vitehub/references/preview-contract.md +0 -44
  272. package/dist/skills/vitehub/references/primitives/auth.md +0 -14
  273. package/dist/skills/vitehub/references/primitives/blob.md +0 -13
  274. package/dist/skills/vitehub/references/primitives/browser.md +0 -17
  275. package/dist/skills/vitehub/references/primitives/cache.md +0 -13
  276. package/dist/skills/vitehub/references/primitives/channels.md +0 -11
  277. package/dist/skills/vitehub/references/primitives/connections.md +0 -14
  278. package/dist/skills/vitehub/references/primitives/content.md +0 -13
  279. package/dist/skills/vitehub/references/primitives/database.md +0 -15
  280. package/dist/skills/vitehub/references/primitives/email.md +0 -11
  281. package/dist/skills/vitehub/references/primitives/env.md +0 -13
  282. package/dist/skills/vitehub/references/primitives/kv.md +0 -13
  283. package/dist/skills/vitehub/references/primitives/markdown-template.md +0 -13
  284. package/dist/skills/vitehub/references/primitives/queue.md +0 -14
  285. package/dist/skills/vitehub/references/primitives/rate-limit.md +0 -11
  286. package/dist/skills/vitehub/references/primitives/realtime.md +0 -19
  287. package/dist/skills/vitehub/references/primitives/sandbox-task.md +0 -11
  288. package/dist/skills/vitehub/references/primitives/sandbox.md +0 -13
  289. package/dist/skills/vitehub/references/primitives/schedule.md +0 -11
  290. package/dist/skills/vitehub/references/primitives/shell.md +0 -11
  291. package/dist/skills/vitehub/references/primitives/source.md +0 -11
  292. package/dist/skills/vitehub/references/primitives/workflow.md +0 -11
  293. package/dist/skills/vitehub/references/primitives/workspace.md +0 -11
  294. package/dist/skills/vitehub/references/project-patterns.md +0 -19
  295. package/dist/skills/vitehub/references/project-shapes.md +0 -81
  296. package/dist/skills/vitehub/references/proof-recovery.md +0 -31
  297. package/dist/skills/vitehub/references/sandboxes-hosts.md +0 -26
  298. package/dist/skills/vitehub/references/schedules-workflows-invocations.md +0 -28
  299. package/dist/skills/vitehub/references/server-primitives.md +0 -39
  300. package/dist/skills/vitehub/references/workspaces-sources-access.md +0 -26
  301. package/dist/ticket-BFWwevWN.d.ts +0 -12
  302. package/dist/ticket-BwsnryuU.js +0 -30
  303. package/dist/tickets-Cj9_y3gw.js +0 -356
  304. package/dist/usage-BduF04ks.d.ts +0 -20
  305. package/dist/usage-ZV3TBMzE.js +0 -570
  306. package/dist/usage-index-CR_xTrXO.js +0 -334
  307. /package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.d.ts +0 -0
  308. /package/dist/{console/runtime/server → agent/console}/invocations.get.d.ts +0 -0
  309. /package/dist/{console/runtime/public/skills → console-skills}/index.json +0 -0
  310. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/SKILL.md +0 -0
  311. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/agents/openai.yaml +0 -0
  312. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/agent-definitions.md +0 -0
  313. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/bundle.md +0 -0
  314. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/capabilities-authority.md +0 -0
  315. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/channels-triggers.md +0 -0
  316. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/framework-composition.md +0 -0
  317. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/preview-contract.md +0 -0
  318. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/auth.md +0 -0
  319. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/blob.md +0 -0
  320. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/browser.md +0 -0
  321. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/cache.md +0 -0
  322. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/channels.md +0 -0
  323. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/connections.md +0 -0
  324. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/content.md +0 -0
  325. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/database.md +0 -0
  326. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/email.md +0 -0
  327. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/env.md +0 -0
  328. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/kv.md +0 -0
  329. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/markdown-template.md +0 -0
  330. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/queue.md +0 -0
  331. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/rate-limit.md +0 -0
  332. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/realtime.md +0 -0
  333. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox-task.md +0 -0
  334. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox.md +0 -0
  335. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/schedule.md +0 -0
  336. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/shell.md +0 -0
  337. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/source.md +0 -0
  338. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workflow.md +0 -0
  339. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workspace.md +0 -0
  340. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-patterns.md +0 -0
  341. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-shapes.md +0 -0
  342. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/proof-recovery.md +0 -0
  343. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/sandboxes-hosts.md +0 -0
  344. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/schedules-workflows-invocations.md +0 -0
  345. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/server-primitives.md +0 -0
  346. /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/workspaces-sources-access.md +0 -0
package/README.md CHANGED
@@ -13,15 +13,15 @@ Use it for a Vite or Nuxt application that needs Server Primitives, Agents, or b
13
13
 
14
14
  ## Agent skill
15
15
 
16
- The package ships the `vitehub` agent skill at `node_modules/vite-hub/dist/skills/vitehub/`, written for the installed version. It lists the built-ins that apps often write by hand, such as migrations, SQLite backups, proxy sign-in, and deploys.
16
+ The package ships the `vitehub` agent skill at `node_modules/vite-hub/dist/console-skills/vitehub/`, written for the installed version. It lists the built-ins that apps often write by hand, such as migrations, SQLite backups, proxy sign-in, and deploys.
17
17
 
18
18
  Coding agents don't load skills from `node_modules`. Install it into the project once, and again after `vitehub update`:
19
19
 
20
20
  ```sh
21
- npx skills add ./node_modules/vite-hub/dist/skills/vitehub --agent claude-code codex
21
+ npx skills add ./node_modules/vite-hub/dist/console-skills/vitehub --agent claude-code codex
22
22
  ```
23
23
 
24
- The CLI copies it to `.agents/skills/vitehub/`, where Codex loads it, and links it from `.claude/skills/vitehub/` for Claude Code. For a single task without installing it, tell the agent to read `node_modules/vite-hub/dist/skills/vitehub/SKILL.md` first.
24
+ The CLI copies it to `.agents/skills/vitehub/`, where Codex loads it, and links it from `.claude/skills/vitehub/` for Claude Code. For a single task without installing it, tell the agent to read `node_modules/vite-hub/dist/console-skills/vitehub/SKILL.md` first.
25
25
 
26
26
  ## Install
27
27
 
@@ -58,7 +58,6 @@ pnpm add vite-hub
58
58
  | `server/comments.ts` | `@vite-hub/comments` |
59
59
  | `.template.md` imports | `@vite-hub/markdown-template` |
60
60
  | Console with Agents | `@libsql/client drizzle-orm@1.0.0-rc.5` |
61
- | Console MCP client (`console.mcpClient`) | `@modelcontextprotocol/sdk` |
62
61
  | `vite-hub/choices` | `@vite-hub/choices` |
63
62
  | `vite-hub/device` | `@vite-hub/device` |
64
63
  | `vite-hub/forge` | `@vite-hub/forge` |
@@ -330,19 +329,21 @@ The Console **Skills** page shows the bundled files of each discovered Agent Def
330
329
 
331
330
  The Console **Usage** page provides session history with date, Agent, status, and search filters. Open a row to inspect that session in the existing Agents view. History keeps completed, failed, and cancelled Agent Invocations visible even when token or cost evidence is unavailable. Totals use the same filters as the history table. See [Session history and usage](https://vitehub.dev/docs/console/agents#skills-and-usage) for the identity, coverage, and pagination contract.
332
331
 
333
- Apps do not serve a Console page, a Console MCP, or a Console sign-in. They serve one Console route, `POST /_vitehub/rpc`, which the ViteHub Console at console.vitehub.dev and the CLI call with signed requests. `console: true` takes only requests signed with an Ed25519 key whose public key is in a `VITEHUB_CONSOLE_KEY_<NAME>` runtime env var. A dev server without such a var also answers this machine without a signature, so the local `vitehub` CLI works. `console: { auth: false }` takes calls without a signature from this machine, for development; a production build with it fails with `VITE_HUB_B0022`, even with `authorize` set. `console.auth: "token"`, `console.auth: "app"`, `console.auth: { ... }` (Console Auth), `console.origins`, `console.mcp`, `console.signInPage`, and `console.embed` are removed, and fail the build with `VITE_HUB_B0020` and the fix. See [Move from auth: "app" or Console Auth](https://vitehub.dev/docs/console/migrate#move-from-auth-app-or-console-auth).
332
+ Apps do not serve the Console UI or its MCP server. The lazy `/_vitehub` routes open the Comments pill when it is enabled, or redirect to the configured Console otherwise. Apps with the pill also serve Site access at `/_vitehub/site`. At startup, the app registers a loader for Agent operations without loading the Console runtime. The runtime loads on the first Console request or when another feature first needs it.
333
+
334
+ The hosted Console and the CLI send signed requests to `POST /_vitehub/rpc`. `console: true` takes only requests signed with an Ed25519 key whose public key is in a `VITEHUB_CONSOLE_KEY_<NAME>` runtime env var. A dev server without such a var also answers this machine without a signature, so the local `vitehub` CLI works. `console: { auth: false }` takes calls without a signature from this machine, for development; a production build with it fails with `VITE_HUB_B0022`, even with `authorize` set. `console.auth: "token"`, `console.auth: "app"`, `console.auth: { ... }` (Console Auth), `console.origins`, `console.mcp`, `console.signInPage`, and `console.embed` are removed, and fail the build with `VITE_HUB_B0020` and the fix. See [Move from auth: "app" or Console Auth](https://vitehub.dev/docs/console/migrate#move-from-auth-app-or-console-auth).
334
335
 
335
336
  Without a `console` option, `vite dev` serves the operation RPC, so `vitehub <command>` works. `console: false` turns the Console endpoint off completely: no `/_vitehub` route in development or production.
336
337
 
337
338
  Add `authorize: "./server/console-authorize.ts"` to decide who may use the Console. The file default-exports `defineConsoleAuthorize()` from `vite-hub/console/auth`. It receives the `Request` and the signer and its `key` name: `via: "console"` with the `user` and `team` that the Console signed, or `via: "cli"` with no `user`. When the ViteHub MCP of the Console calls for the user, `surface` is `"mcp"`: the RPC then refuses operations with `mcp: false`, runs the others with the `mcp` surface, and refuses a destructive call that the person did not confirm. A caller with `readOnly: true` runs only operations that read. The app ignores caller fields that it does not know, so a newer Console can still call it. An Agent that calls Console operations as tools receives `via: "agent"`, never a signed `via`. With `auth: false`, it receives only the `Request`. It returns `true`, `false`, a `Response`, or `{ sections: ["content"] }` to allow only some Console sections. Every Console operation declares its section, and the server returns `403` outside the allowed sections. The navigation hides the other sections.
338
339
 
339
- Set `console.mcpClient: true` to add the MCP client section. It runs on the server. It connects to the app's own `/mcp` and to other MCP servers with OAuth or a bearer token, as the Console caller, and it can hold several accounts of one server at once. Tokens and MCP sessions stay on the server and never reach the browser: in memory, or sealed in the app's KV store with `VITEHUB_CONSOLE_MCP_KEY`. See [Connect to MCP servers](https://vitehub.dev/docs/console/mcp-client).
340
+ Set `console.url` to the origin of a self-hosted Console, such as `https://console.example.com`. `/_vitehub`, `hostedConsoleUrl()`, the Site access sign-in, and the Console segment of the Comments pill then go there. It defaults to `https://console.vitehub.dev`. The build refuses a value that is not an `https://` origin without a path, or `http://localhost`. The MCP client section runs on the Console server, so the app needs nothing for it. See [Connect to MCP servers](https://vitehub.dev/docs/console/mcp-client).
340
341
 
341
342
  `invoke` defaults to `true` on the development server and `false` in a production build. Invocation also enables the Schedules page **Run now** button and the `schedule.run` operation (`vitehub schedule run <name>`) for Static Schedule Definitions that set `manual: true`; see [Run Schedules on demand](https://vitehub.dev/docs/cli/primitives#run-a-schedule-on-demand).
342
343
 
343
- `impersonation: true` adds the `auth.impersonate` and `auth.stop-impersonating` operations. Each returns a one-time link, `GET /_vitehub/rpc?ticket=<ticket>`, that the browser opens on the app. The browser's app session must belong to the email of the signed Console person and have Better Auth's `impersonate` permission. It is off by default. It needs app Auth with Better Auth's admin plugin and `events.store`. The session lasts one hour by default and cannot create credentials.
344
+ `impersonation: true` adds the `auth.impersonate` and `auth.stop-impersonating` operations. The Console calls one as the person, then opens the app's `/_vitehub/site` with an `impersonate` token that it signs for 60 seconds. The browser's app session must belong to the email of the signed Console person and have Better Auth's `impersonate` permission. It is off by default. It needs app Auth with Better Auth's admin plugin and `events.store`. The session lasts one hour by default and cannot create credentials.
344
345
 
345
- One-time links also open Content previews (`documents.preview`). A link works once, for 60 seconds, on the app origin and mount that made it, for the person who asked. The app keeps the SHA-256 of each link in Better Auth's verification table, so every instance sees it. A development server without an Auth database keeps them in memory. A production app without one refuses links with `CONSOLE_TICKET_STORE_MISSING`. See [One-time links](https://vitehub.dev/docs/console/site-access#one-time-links).
346
+ Content previews (`documents.preview`) use the same route with a `preview` token. A token works for 60 seconds, for the app URL and the kind that it names, in the browser that started the visit. The app keeps no state and needs no store for it. See [Impersonation and Content preview](https://vitehub.dev/docs/console/site-access#impersonation-and-content-preview).
346
347
 
347
348
  Auth changes from the Console, such as `auth.ban`, run as the app user with the email of the signed Console person, with a live app session of that user. CLI calls name no person, so they cannot run Auth changes.
348
349
 
@@ -1,140 +1,15 @@
1
- import { l as operationListed, o as operationAccessAllows } from "./operations-CD_mu_Ww.js";
1
+ import { s as operationAccessAllows, u as operationListed } from "./operations-BsEUHt-z.js";
2
2
  import { a as installedConsoleAccessPolicy, n as consoleAuthorizedSections, t as consoleAuthorizedGrants } from "./access-policy-BM48XstY.js";
3
- import { r as consoleDiagnosticBody, t as consoleDiagnostic } from "./diagnostics-B2cqlCSz.js";
3
+ import { r as consoleDiagnosticBody } from "./diagnostics-DLHqjKGe.js";
4
4
  import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
5
- import { c as readConsolePublicKeys, i as isViteHubLoopbackPeer, l as verifyConsoleSignature } from "./dev-peer-DBq-isgi.js";
6
- import { r as operationRpcPath } from "./operation-rpc-BMdfapja.js";
5
+ import "./console-signature--55DIKf2.js";
6
+ import { n as checkConsoleSignature, r as consoleKeysMissing, t as isConsoleLoopbackRequest } from "./loopback-Bl9Cvj1k.js";
7
7
  import { i as isConsoleDevelopmentBuild } from "./development-DD567hhJ.js";
8
- import { c as isConsoleDevelopmentRuntime, i as consoleRequestError } from "./request-CQ8TkHLh.js";
9
- import { n as loadConsoleRuntime } from "./runtime-CyPZMiyK.js";
10
- import { formatDiagnostic } from "nostics";
8
+ import { r as consoleRequestError, s as isConsoleDevelopmentRuntime } from "./request-D769eiBL.js";
9
+ import { n as loadConsoleRuntime } from "./runtime-DA7HJe10.js";
11
10
  import { getStandardContext } from "@vite-hub/runtime/internal/h3";
12
11
  import { defineGrant } from "@vite-hub/runtime/internal/grant";
13
12
  import { isRuntimeResponse } from "@vite-hub/runtime/internal/runtime-type";
14
- import { resolvePublicUrl } from "@vite-hub/runtime";
15
- // src/console/runtime/server/console-signature.ts
16
- /** The `401` or `500` of a refused signature, with the Console diagnostic fields. */
17
- function consoleSignatureRejection(status, code, message) {
18
- return Response.json({
19
- ...consoleDiagnosticBody(code, message),
20
- ok: false,
21
- status
22
- }, {
23
- headers: {
24
- "cache-control": "no-store",
25
- ...status === 401 ? { "www-authenticate": "VitehubSignature realm=\"vitehub-console\"" } : {},
26
- "x-content-type-options": "nosniff",
27
- "x-robots-tag": "noindex, nofollow"
28
- },
29
- status
30
- });
31
- }
32
- /**
33
- * Print a setup failure of the app, such as a malformed `VITEHUB_CONSOLE_KEY_<NAME>`, in the server log, as an
34
- * unhandled error prints. Only the caller gets the coded `500`, so without this line the host log shows nothing.
35
- */
36
- function logSetupFailure(code, message) {
37
- globalThis.console.error(formatDiagnostic(consoleDiagnostic(code, message)));
38
- }
39
- /** The host environment of this request: the Cloudflare `env`, then `process.env` for the names it does not set. */
40
- function requestEnv(event) {
41
- return {
42
- ...globalThis.process?.env,
43
- ...getStandardContext(event).runtime?.cloudflare?.env
44
- };
45
- }
46
- /**
47
- * Whether the host env of this request has no `VITEHUB_CONSOLE_KEY_<NAME>` variable, so no signature can pass. A
48
- * malformed key counts as a key: the check then answers `CONSOLE_KEY_MALFORMED`.
49
- */
50
- function consoleKeysMissing(event) {
51
- const keys = readConsolePublicKeys(requestEnv(event));
52
- return !(keys instanceof Map) && keys.code === "CONSOLE_KEY_NOT_CONFIGURED";
53
- }
54
- /** Whether a path is the Console RPC route, below any application mount. */
55
- function isConsoleRpcPath(pathname) {
56
- const route = pathname.indexOf(operationRpcPath);
57
- return route !== -1 && pathname.slice(route) === "/_vitehub/rpc";
58
- }
59
- /**
60
- * Check the signature of a request to an app with `console: true`, before its body is read. The public keys come from
61
- * the `VITEHUB_CONSOLE_KEY_<NAME>` variables of the host env on each request, so a deploy or a Worker secret change
62
- * takes effect without a build.
63
- *
64
- * The signed origin must be the origin of this app: `vitehub({ publicUrl })` when it is set, else the URL of the request
65
- * as the host routed it. Node adapters build that URL from the caller's Host header, so they require a configured
66
- * public URL. Forwarding headers never supply the deployment identity.
67
- *
68
- * A match carries the signed body digest. The RPC route compares it with the bytes that it reads before it runs a call.
69
- * Signed requests reach only `POST /_vitehub/rpc`.
70
- */
71
- async function checkConsoleSignature(request, event) {
72
- const keys = readConsolePublicKeys(requestEnv(event));
73
- if (!(keys instanceof Map)) {
74
- logSetupFailure(keys.code, keys.message);
75
- return {
76
- ok: false,
77
- response: consoleSignatureRejection(keys.status, keys.code, keys.message)
78
- };
79
- }
80
- const url = new URL(request.url);
81
- if (request.method !== "POST" || !isConsoleRpcPath(url.pathname)) return {
82
- ok: false,
83
- response: consoleSignatureRejection(401, "CONSOLE_SIGNATURE_INVALID", `Signed requests reach only POST ${operationRpcPath}.`)
84
- };
85
- const nodeRequest = "runtime" in request && typeof request.runtime === "object" && request.runtime !== null && "node" in request.runtime;
86
- const origin = resolvePublicUrl({
87
- configuredOnly: nodeRequest,
88
- request
89
- });
90
- if (!origin) {
91
- if (!request.headers.has("x-vitehub-signature")) return {
92
- ok: false,
93
- response: consoleSignatureRejection(401, "CONSOLE_SIGNATURE_MISSING", "This request is not signed.")
94
- };
95
- const message = "Signed requests on Node require vitehub({ publicUrl }) to identify this deployment. The request Host cannot supply its identity.";
96
- logSetupFailure("CONSOLE_SIGNATURE_ORIGIN", message);
97
- return {
98
- ok: false,
99
- response: consoleSignatureRejection(500, "CONSOLE_SIGNATURE_ORIGIN", message)
100
- };
101
- }
102
- const verified = await verifyConsoleSignature({
103
- headers: request.headers,
104
- keys,
105
- method: request.method,
106
- origin,
107
- url
108
- });
109
- if (!verified.ok) return {
110
- ok: false,
111
- response: consoleSignatureRejection(verified.status, verified.code, verified.message)
112
- };
113
- return verified;
114
- }
115
- // src/console/runtime/server/loopback.ts
116
- const loopbackHosts = /* @__PURE__ */ new Set([
117
- "localhost",
118
- "127.0.0.1",
119
- "[::1]",
120
- "::1"
121
- ]);
122
- function isLoopbackHost(host) {
123
- if (!host) return false;
124
- const name = (host.startsWith("[") ? host.slice(0, host.indexOf("]") + 1) : host.replace(/:\d+$/, "")).toLowerCase();
125
- return loopbackHosts.has(name) || name.endsWith(".localhost");
126
- }
127
- /**
128
- * Whether a development Console without sign-in may serve this request. `vite dev` with no sign-in (the `local` or
129
- * `open` access) trusts anyone who can reach it, so it serves only this machine: a tunnel or a LAN address with a
130
- * forwarded Host would give the whole app to a stranger. Production builds and other access modes always pass.
131
- */
132
- async function isConsoleLoopbackRequest(request, context) {
133
- if (context.access !== "local" && context.access !== "open" || !isConsoleDevelopmentBuild()) return true;
134
- const hostHeader = request.headers.get("host") ?? new URL(request.url).host;
135
- const forwarded = request.headers.get("x-forwarded-host");
136
- return isLoopbackHost(hostHeader) && (!forwarded || isLoopbackHost(forwarded)) && await isViteHubLoopbackPeer(request, context.remoteAddress);
137
- }
138
13
  // src/console/runtime/server/access.ts
139
14
  const consoleAccessGrant = defineGrant("vitehub.console.access", (mode) => mode);
140
15
  const checkedRequests = /* @__PURE__ */ new WeakMap();
@@ -337,7 +212,8 @@ function consoleRealtimeAccess(section) {
337
212
  if (!(event instanceof Object)) return Promise.resolve(void 0);
338
213
  let pending = checked.get(event);
339
214
  if (!pending) {
340
- pending = checkConsoleAccess(event).then((result) => isRuntimeResponse(result) || !consoleAccessAllows(result, section) ? void 0 : result);
215
+ const consoleEvent = event;
216
+ pending = import("#vitehub/console/app").then(() => checkConsoleAccess(consoleEvent)).then((result) => isRuntimeResponse(result) || !consoleAccessAllows(result, section) ? void 0 : result);
341
217
  checked.set(event, pending);
342
218
  }
343
219
  return pending;
@@ -446,4 +322,4 @@ function bindConsoleAccess(access, event) {
446
322
  checkedRequests.set(request, access);
447
323
  return event;
448
324
  }
449
- export { isConsoleRpcPath as _, consoleAccessWrites as a, consoleOperationGranted as c, consoleRequest as d, readConsoleAccessGrants as f, isConsoleLoopbackRequest as g, withConsoleAccess as h, consoleAccessInvoker as i, consolePerson as l, readConsoleOperationUser as m, bindConsoleAccess as n, consoleImpersonation as o, readConsoleAccessUser as p, consoleAccessAllows as r, consoleOperationAccess as s, allowedConsoleSections as t, consoleRealtimeAccess as u };
325
+ export { consoleAccessWrites as a, consoleOperationGranted as c, consoleRequest as d, readConsoleAccessGrants as f, withConsoleAccess as h, consoleAccessInvoker as i, consolePerson as l, readConsoleOperationUser as m, bindConsoleAccess as n, consoleImpersonation as o, readConsoleAccessUser as p, consoleAccessAllows as r, consoleOperationAccess as s, allowedConsoleSections as t, consoleRealtimeAccess as u };
@@ -1,8 +1,19 @@
1
- import { a as ConsoleSectionId } from "./sections-0qrBvGbf.js";
2
- import "./request-BC_krbEr.js";
1
+ import "./request-DYmjLTqP.js";
3
2
  import "./operations-DgFhA1WE.js";
4
- import { l as ConsoleUser, n as ConsoleAuthorize } from "./auth-types-B4mq4YhK.js";
3
+ import { c as ConsoleUser, n as ConsoleAuthorize } from "./auth-types-Cotn7406.js";
4
+ import { a as ConsoleSectionId } from "./sections-DCoCa4nF.js";
5
5
  import "@vite-hub/agent";
6
+ declare const consoleOpenAccessWarning = "[vitehub] console: { auth: false } takes Console calls without a signature. Anyone who can reach /_vitehub/rpc can use the Console. Remove console.auth so the app takes only signed calls.";
7
+ /** Install the Console access policy. Generated Console output calls this before it serves a request. */
8
+ declare function installConsoleAccess(policy: ConsoleAccessPolicy): void;
9
+ declare function installedConsoleAccessPolicy(): ConsoleAccessPolicy | undefined;
10
+ /** The `sections` of a `console.authorize` result, or `undefined` when the result names no valid list. */
11
+ declare function consoleAuthorizedSections(result: unknown): readonly ConsoleSectionId[] | undefined;
12
+ /**
13
+ * The `grants` of a `console.authorize` result: the page tool roles that Site access gives. `undefined` without the
14
+ * field, and `false` when the field is not a list of role ids.
15
+ */
16
+ declare function consoleAuthorizedGrants(result: unknown): readonly string[] | undefined | false;
6
17
  /**
7
18
  * How the Console checks each request. Generated host output installs one policy for each server process.
8
19
  * - `token`: a request signed with a key whose public key is in a `VITEHUB_CONSOLE_KEY_<NAME>` variable. See
@@ -46,7 +57,7 @@ interface ConsoleAccess {
46
57
  * `"mcp"` when the ViteHub MCP of the Console signed the request for the user. The RPC then refuses operations with
47
58
  * `mcp: false`, runs the others with the `mcp` surface, and refuses a destructive call that is not `confirmed`.
48
59
  */
49
- readonly surface?: "mcp";
60
+ readonly surface?: "mcp" | "cli";
50
61
  /** The person agreed to this destructive MCP call. The signature covers it. */
51
62
  readonly confirmed?: boolean;
52
63
  /** The signed caller limits this request to operations that only read. The RPC refuses a write or destructive call. */
@@ -91,15 +102,4 @@ interface ConsoleRealtimeAccess {
91
102
  * Console, and checks the same section access.
92
103
  */
93
104
  declare function consoleRealtimeAccess(section: ConsoleSectionId): ConsoleRealtimeAccess;
94
- declare const consoleOpenAccessWarning = "[vitehub] console: { auth: false } takes Console calls without a signature. Anyone who can reach /_vitehub/rpc can use the Console. Remove console.auth so the app takes only signed calls.";
95
- /** Install the Console access policy. Generated Console output calls this before it serves a request. */
96
- declare function installConsoleAccess(policy: ConsoleAccessPolicy): void;
97
- declare function installedConsoleAccessPolicy(): ConsoleAccessPolicy | undefined;
98
- /** The `sections` of a `console.authorize` result, or `undefined` when the result names no valid list. */
99
- declare function consoleAuthorizedSections(result: unknown): readonly ConsoleSectionId[] | undefined;
100
- /**
101
- * The `grants` of a `console.authorize` result: the page tool roles that Site access gives. `undefined` without the
102
- * field, and `false` when the field is not a list of role ids.
103
- */
104
- declare function consoleAuthorizedGrants(result: unknown): readonly string[] | undefined | false;
105
- export { installedConsoleAccessPolicy as a, ConsoleRealtimeAccess as c, installConsoleAccess as i, ConsoleRealtimeUser as l, consoleAuthorizedSections as n, ConsoleAccess as o, consoleOpenAccessWarning as r, ConsoleAccessRoute as s, consoleAuthorizedGrants as t, consoleRealtimeAccess as u };
105
+ export { consoleRealtimeAccess as a, consoleOpenAccessWarning as c, ConsoleRealtimeUser as i, installConsoleAccess as l, ConsoleAccessRoute as n, consoleAuthorizedGrants as o, ConsoleRealtimeAccess as r, consoleAuthorizedSections as s, ConsoleAccess as t, installedConsoleAccessPolicy as u };
@@ -1,4 +1,4 @@
1
- import { t as ConsoleProjectBuild } from "./project-link-isfdRO3Q.js";
1
+ import { t as ConsoleProjectBuild } from "./project-link-Ck3vuq9w.js";
2
2
  /** A project of the active team, as `GET /api/projects` returns it. The page never sees the private key. */
3
3
  interface ConsoleAccountProject {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { t as consoleAgentInvokerProfiles } from "../../../agents-Gyw4VKPt.js";
1
+ import { t as consoleAgentInvokerProfiles } from "../../agents-Gyw4VKPt.js";
2
2
  interface ConsoleAgentsResult {
3
3
  /** Agents registered in this application. */
4
4
  agents: readonly string[];
@@ -1,6 +1,6 @@
1
- import { c as getConsoleAgents, r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "../../../agents-Cz_uhhov.js";
2
- import { t as getConsoleInvocations } from "../../../invocations-8NThe8Bx.js";
3
- // src/console/runtime/server/agents.get.ts
1
+ import { c as getConsoleAgents, r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
2
+ import { t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
3
+ // src/agent/console/agents.get.ts
4
4
  /** The Agents of the `agents.list` operation. */
5
5
  async function listConsoleAgents() {
6
6
  const registeredNames = [...new Set(getConsoleAgents())].sort();
@@ -1,5 +1,5 @@
1
- import { o as ConsoleAccess } from "../../../access-policy-CUbJLvlR.js";
2
- import { r as OperationContext } from "../../../operations-DgFhA1WE.js";
1
+ import { t as ConsoleAccess } from "../../access-DkBck8Vu.js";
2
+ import { r as OperationContext } from "../../operations-DgFhA1WE.js";
3
3
  /** The input of `channels.replay`: the Agent, then the replay fields of `handleChannelReplayRequest()`. */
4
4
  export interface ConsoleChannelReplayInput {
5
5
  agent: string;
@@ -1,11 +1,11 @@
1
- import { t as agentConsole } from "../../../server-DsOEa4_A.js";
2
- import { o as getConsoleAgentCapabilities, s as getConsoleAgentDefinition } from "../../../agents-Cz_uhhov.js";
3
- import { i as consoleAccessInvoker, p as readConsoleAccessUser } from "../../../access-BBHk9b5P.js";
4
- import { i as consoleRequestError } from "../../../request-CQ8TkHLh.js";
5
- import { createExecutionContext } from "@vite-hub/runtime";
1
+ import { t as agentConsole } from "../../agent-console-CHsLxKk_.js";
2
+ import { o as getConsoleAgentCapabilities, s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
3
+ import { i as consoleAccessInvoker, p as readConsoleAccessUser } from "../../access-DiI9bMuK.js";
4
+ import { r as consoleRequestError } from "../../request-D769eiBL.js";
6
5
  import { handleChannelReplayRequest } from "@vite-hub/agent/server/internal";
6
+ import { createExecutionContext } from "@vite-hub/runtime";
7
7
  import { createRuntimeWaitUntilController } from "@vite-hub/runtime/internal/context";
8
- // src/console/runtime/server/channel-replay.ts
8
+ // src/agent/console/channel-replay.ts
9
9
  /** Items per call. The CLI continues with the returned cursor. */
10
10
  const maximumReplayItemsPerRequest = 100;
11
11
  function memo() {
@@ -1,7 +1,7 @@
1
- import { t as getConsoleInvocations } from "../../../invocations-8NThe8Bx.js";
2
- import { t as consoleHttpError } from "../../../http-error-BorAxJYM.js";
3
- import { t as viteHubErrorDiagnostics } from "../../../error-diagnostics-CBtvqI30.js";
4
- // src/console/runtime/server/invocation-capabilities.get.ts
1
+ import { t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
2
+ import { t as consoleHttpError } from "../../http-error-BorAxJYM.js";
3
+ import { t as viteHubErrorDiagnostics } from "../../error-diagnostics-CBtvqI30.js";
4
+ // src/agent/console/invocation-capabilities.get.ts
5
5
  /** The capabilities and the triggering people of the recorded invocations, for the `invocations.capabilities` operation. */
6
6
  async function listConsoleInvocationCapabilities(input) {
7
7
  const agentName = input.agent?.trim() || void 0;
@@ -1,6 +1,6 @@
1
- import { s as ConsoleAccessRoute } from "../../../access-policy-CUbJLvlR.js";
2
- import { n as WorkspaceFileResponse, t as WorkspaceDescriptor } from "../../../workspace-history-WuxgLsi4.js";
3
- import { t as ConsoleRequestEvent } from "../../../request-BC_krbEr.js";
1
+ import { n as ConsoleAccessRoute } from "../../access-DkBck8Vu.js";
2
+ import { n as WorkspaceFileResponse, t as WorkspaceDescriptor } from "../../workspace-history-WuxgLsi4.js";
3
+ import { t as ConsoleRequestEvent } from "../../request-DYmjLTqP.js";
4
4
  declare function consoleInvocationWorkspaceHandler(event: ConsoleRequestEvent): Promise<WorkspaceDescriptor | WorkspaceFileResponse>;
5
5
  declare const guardedHandler: ConsoleAccessRoute<typeof consoleInvocationWorkspaceHandler>;
6
6
  export { guardedHandler as default };
@@ -1,12 +1,12 @@
1
- import { s as getConsoleAgentDefinition } from "../../../agents-Cz_uhhov.js";
2
- import { t as getConsoleInvocations } from "../../../invocations-8NThe8Bx.js";
3
- import { h as withConsoleAccess } from "../../../access-BBHk9b5P.js";
4
- import { o as consoleRequestURL, t as assertConsoleRequest } from "../../../request-CQ8TkHLh.js";
5
- import { a as readWorkspaceRevision, i as readMountedWorkspace, n as historyMetadata, o as stringValue, r as historyReader, t as failure } from "../../../workspace-history-B52xib2J.js";
1
+ import { s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
2
+ import { t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
3
+ import { h as withConsoleAccess } from "../../access-DiI9bMuK.js";
4
+ import { a as consoleRequestURL, t as assertConsoleRequest } from "../../request-D769eiBL.js";
5
+ import { a as readWorkspaceRevision, i as readMountedWorkspace, n as historyMetadata, o as stringValue, r as historyReader, t as failure } from "../../workspace-history-B52xib2J.js";
6
6
  import { agentHostWorkspaceRoute, getAgentHostWorkspaceInspector } from "@vite-hub/agent/server";
7
7
  import * as v from "valibot";
8
8
  import { useWorkspaceFiles } from "@vite-hub/workspace/files";
9
- // src/console/runtime/server/invocation-workspace.get.ts
9
+ // src/agent/console/invocation-workspace.get.ts
10
10
  const configurationSchema = v.object({ workspace: v.object({
11
11
  name: v.string(),
12
12
  ref: v.optional(v.string()),
@@ -1,8 +1,8 @@
1
- import { s as ConsoleAccessRoute } from "../../../access-policy-CUbJLvlR.js";
2
- import { t as invocationUsage } from "../../../usage-BduF04ks.js";
3
- import { t as ConsoleRequestEvent } from "../../../request-BC_krbEr.js";
4
- import { AgentInvocationCancelResult, AgentInvocationDeleteOutcome, AgentInvocationRerunUnavailableReason, AgentInvocationSummary } from "@vite-hub/agent";
1
+ import { n as ConsoleAccessRoute } from "../../access-DkBck8Vu.js";
2
+ import { t as ConsoleRequestEvent } from "../../request-DYmjLTqP.js";
3
+ import { AgentInvocationCancelResult, AgentInvocationDeleteOutcome, AgentInvocationRerunUnavailableReason, AgentInvocationSummary, AgentInvocations } from "@vite-hub/agent";
5
4
  import { TraceEventLogEntry } from "@vite-hub/runtime";
5
+ import { invocationUsage } from "@vite-hub/agent/usage";
6
6
  type ConsoleInvocationRerun = {
7
7
  available: true;
8
8
  invokerProfileId?: string;
@@ -1,15 +1,15 @@
1
- import { r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "../../../agents-Cz_uhhov.js";
2
- import { t as getConsoleInvocations } from "../../../invocations-8NThe8Bx.js";
3
- import { h as withConsoleAccess } from "../../../access-BBHk9b5P.js";
4
- import { a as consoleRequestJSON, i as consoleRequestError, o as consoleRequestURL, t as assertConsoleRequest } from "../../../request-CQ8TkHLh.js";
5
- import { t as consoleHttpError } from "../../../http-error-BorAxJYM.js";
6
- import { c as invocationUsage } from "../../../usage-ZV3TBMzE.js";
7
- import { t as viteHubErrorDiagnostics } from "../../../error-diagnostics-CBtvqI30.js";
1
+ import { r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
2
+ import { t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
3
+ import { h as withConsoleAccess } from "../../access-DiI9bMuK.js";
4
+ import { a as consoleRequestURL, i as consoleRequestJSON, r as consoleRequestError, t as assertConsoleRequest } from "../../request-D769eiBL.js";
5
+ import { t as consoleHttpError } from "../../http-error-BorAxJYM.js";
6
+ import { n as invocationUsage } from "../../usage-DBi7aOhx.js";
7
+ import { t as viteHubErrorDiagnostics } from "../../error-diagnostics-CBtvqI30.js";
8
8
  import { agentInvocationRerunInput } from "@vite-hub/agent";
9
9
  import * as v from "valibot";
10
10
  import { getStandardContext } from "@vite-hub/runtime/internal/h3";
11
11
  import { createHash } from "node:crypto";
12
- // src/console/runtime/server/invocation.get.ts
12
+ // src/agent/console/invocation.get.ts
13
13
  function formatObservationCursor(count, digest) {
14
14
  return `${count.toString(36)}-${digest}`;
15
15
  }
@@ -1,8 +1,8 @@
1
- import { t as getConsoleInvocations } from "../../../invocations-8NThe8Bx.js";
2
- import { t as consoleHttpError } from "../../../http-error-BorAxJYM.js";
3
- import { c as invocationUsage } from "../../../usage-ZV3TBMzE.js";
4
- import { t as viteHubErrorDiagnostics } from "../../../error-diagnostics-CBtvqI30.js";
5
- // src/console/runtime/server/invocations.get.ts
1
+ import { t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
2
+ import { t as consoleHttpError } from "../../http-error-BorAxJYM.js";
3
+ import { n as invocationUsage } from "../../usage-DBi7aOhx.js";
4
+ import { t as viteHubErrorDiagnostics } from "../../error-diagnostics-CBtvqI30.js";
5
+ // src/agent/console/invocations.get.ts
6
6
  const defaultListLimit = 50;
7
7
  const maximumListLimit = 100;
8
8
  function invalidCursor() {
@@ -1,8 +1,6 @@
1
- import { s as ConsoleAccessRoute } from "../../../access-policy-CUbJLvlR.js";
2
- import { n as ConsoleRoute, t as ConsoleRequestEvent } from "../../../request-BC_krbEr.js";
1
+ import { n as ConsoleAccessRoute } from "../../access-DkBck8Vu.js";
2
+ import { n as ConsoleRoute, t as ConsoleRequestEvent } from "../../request-DYmjLTqP.js";
3
3
  declare const usageHandler: (event: ConsoleRequestEvent) => Promise<Record<string, unknown>>;
4
- /** The usage summary, for the `usage.get` operation. */
5
4
  export declare const readConsoleUsage: ConsoleAccessRoute<typeof usageHandler>;
6
- /** `GET <base>/_vitehub/console/usage` */
7
5
  declare const consoleUsageRoute: ConsoleRoute;
8
6
  export { consoleUsageRoute as default };
@@ -0,0 +1,51 @@
1
+ import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
2
+ import { r as readConsoleJournalUsage, t as getConsoleInvocations } from "../../invocations-B60XWNES.js";
3
+ import { h as withConsoleAccess } from "../../access-DiI9bMuK.js";
4
+ import { a as consoleRequestURL, o as consoleRoute, t as assertConsoleRequest } from "../../request-D769eiBL.js";
5
+ import { t as consoleHttpError } from "../../http-error-BorAxJYM.js";
6
+ import { a as usageQueryWindow, i as parseConsoleUsageWindow, r as parseConsoleUsageStatus, t as createUsageSummary } from "../../usage-DBi7aOhx.js";
7
+ import { t as viteHubErrorDiagnostics } from "../../error-diagnostics-CBtvqI30.js";
8
+ // src/agent/console/invocations.usage.ts
9
+ function pricedUsageAgents(names) {
10
+ return names.filter((name) => {
11
+ const capabilities = getConsoleAgentDefinition(name, "inspect")?.capabilities;
12
+ return Array.isArray(capabilities) && capabilities.some((capability) => capability?.id === "usage" && capability.metadata?.pricing === true);
13
+ });
14
+ }
15
+ function usageQuery(event) {
16
+ assertConsoleRequest(event);
17
+ const query = consoleRequestURL(event).searchParams;
18
+ const agentName = query.get("agent")?.trim() || void 0;
19
+ if (agentName && agentName.length > 512) throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0070({ message: "Invalid Agent name" }));
20
+ const windowValue = query.get("window");
21
+ const window = windowValue === null ? "30d" : parseConsoleUsageWindow(windowValue);
22
+ if (!window) throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0071({ message: "Invalid usage window" }));
23
+ const statusValue = query.get("status");
24
+ const status = statusValue === null ? void 0 : parseConsoleUsageStatus(statusValue);
25
+ if (statusValue !== null && !status) throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0072({ message: "Invalid usage status" }));
26
+ const search = query.get("search")?.trim() || void 0;
27
+ if (search && search.length > 512) throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0072({ message: "Invalid usage search" }));
28
+ const cursor = query.get("cursor") ?? void 0;
29
+ return {
30
+ costConfigured: pricedUsageAgents(agentName ? [agentName] : getConsoleAgents()).length > 0,
31
+ options: {
32
+ agentName,
33
+ cursor,
34
+ window,
35
+ status,
36
+ search
37
+ }
38
+ };
39
+ }
40
+ const usageHandler = async (event) => {
41
+ const { costConfigured, options } = usageQuery(event);
42
+ const invocations = getConsoleInvocations();
43
+ const result = await readConsoleJournalUsage(invocations, options, usageQueryWindow(options)) ?? await createUsageSummary(invocations, options);
44
+ return {
45
+ ...result,
46
+ costSupported: costConfigured || result.costSupported
47
+ };
48
+ };
49
+ const readConsoleUsage = withConsoleAccess(usageHandler, { section: "usage" });
50
+ const consoleUsageRoute = consoleRoute(readConsoleUsage);
51
+ export { consoleUsageRoute as default, readConsoleUsage };
@@ -0,0 +1,6 @@
1
+ import { n as AnyOperation } from "../../operations-DgFhA1WE.js";
2
+ import { t as ConsoleAgentRealtimeLoader } from "../../internal-BRNf11h3.js";
3
+ /** The Console operations of the Agents, Skills, Usage, and Channels sections. The Console registers them only when the app has Agents. */
4
+ export declare const agentConsoleOperations: readonly AnyOperation[];
5
+ /** Lets the Console ask an open page to undo a change. The generated Console app module installs it only when the app has Realtime. */
6
+ export declare function installConsoleAgentRealtime(load: ConsoleAgentRealtimeLoader): void;