vite-hub 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +9 -8
  2. package/dist/{access-BBHk9b5P.js → access-CUFHPi8T.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-CF5anHY6.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-iw8pWQ6o.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 +13 -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-DxK0tdjA.d.ts → documents-CApMRd4o.d.ts} +2 -3
  148. package/dist/{documents-BOYwZ5g4.js → documents-D6ueeoUR.js} +12 -15
  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-CNwnh6CG.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-BU10k2QS.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-BUXlwjvd.js +1 -0
  177. package/dist/operation-modules-DHWkPcfS.js +139 -0
  178. package/dist/operations-D-7ljPqw.js +1 -0
  179. package/dist/{operations-CD_mu_Ww.js → operations-DksTrRMb.js} +1 -1
  180. package/dist/operations-byxiZ2R2.js +113 -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-BpiTVULl.d.ts → plugins-BmkOoyIh.d.ts} +22 -9
  186. package/dist/{plugins-H6-MQrsn.js → plugins-DfXcUnzN.js} +248 -310
  187. package/dist/{project-DKBIHOf4.d.ts → project-B2qWt8on.d.ts} +2 -7
  188. package/dist/{project-BxyyclTE.js → project-_juMSuAS.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
@@ -0,0 +1,247 @@
1
+ import { n as consoleState } from "../../internal-0C_CC601.js";
2
+ import { a as legacyEvent, c as record, i as defineConsoleOperation, l as text, n as consoleOperationRequestBytes, o as optionalCount, s as optionalText } from "../../operations-byxiZ2R2.js";
3
+ import * as v from "valibot";
4
+ // src/agent/console/operations.ts
5
+ const agentsInvoke = defineConsoleOperation({
6
+ cli: {
7
+ command: "invoke",
8
+ namespace: "agent",
9
+ positional: ["agent"]
10
+ },
11
+ description: "Start an Agent Invocation with a prompt.",
12
+ input: v.strictObject({
13
+ agent: v.pipe(text, v.minLength(1)),
14
+ agentRoute: v.optional(v.literal("encoded")),
15
+ attachments: v.optional(v.array(v.object({
16
+ id: text,
17
+ name: text
18
+ }))),
19
+ files: v.optional(v.array(v.object({
20
+ filename: optionalText,
21
+ url: text
22
+ }))),
23
+ invokerProfileId: optionalText,
24
+ messages: v.optional(v.array(record)),
25
+ prompt: text
26
+ }),
27
+ kind: "write",
28
+ maxRequestBytes: consoleOperationRequestBytes["agents.invoke"],
29
+ name: "agents.invoke",
30
+ run: async ({ agent, agentRoute, ...body }, context) => (await import("../../agent-invocations.post-CF5anHY6.js")).default(legacyEvent(`agents/${agent}/invocations`, "POST", {
31
+ agent,
32
+ body,
33
+ query: { agentRoute }
34
+ }, context)),
35
+ section: "agents"
36
+ });
37
+ const agentsList = defineConsoleOperation({
38
+ cli: {
39
+ command: "list",
40
+ namespace: "agent"
41
+ },
42
+ description: "List the Agents of the app.",
43
+ input: v.strictObject({}),
44
+ kind: "read",
45
+ name: "agents.list",
46
+ run: async () => (await import("./agents.get.js")).listConsoleAgents(),
47
+ section: "agents"
48
+ });
49
+ const channelsReplay = defineConsoleOperation({
50
+ cli: {
51
+ command: "replay",
52
+ namespace: "channels"
53
+ },
54
+ description: "Replay one page of a Channel's history through its trigger, or describe its history query with describe: true.",
55
+ input: v.strictObject({
56
+ agent: v.pipe(text, v.minLength(1)),
57
+ channel: v.pipe(text, v.minLength(1)),
58
+ cursor: optionalText,
59
+ describe: v.optional(v.boolean()),
60
+ dryRun: v.optional(v.boolean()),
61
+ force: v.optional(v.boolean()),
62
+ label: v.optional(v.pipe(text, v.check((label) => label.trim() !== "", "Use a label with text."), v.maxLength(512))),
63
+ limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),
64
+ query: v.optional(v.record(v.string(), v.union([text, v.array(text)])))
65
+ }),
66
+ kind: "write",
67
+ mcp: false,
68
+ name: "channels.replay",
69
+ readOnlyWhen: (input) => input.describe === true,
70
+ run: async (input, context) => (await import("./channel-replay.js")).replayConsoleChannel(input, context),
71
+ section: "agents"
72
+ });
73
+ const invocationsCancel = defineConsoleOperation({
74
+ cli: false,
75
+ description: "Ask a running Agent Invocation to stop.",
76
+ input: v.strictObject({ id: v.pipe(text, v.minLength(1)) }),
77
+ kind: "write",
78
+ name: "invocations.cancel",
79
+ run: async ({ id }, context) => (await import("./invocation.get.js")).default(legacyEvent("invocations", "POST", {
80
+ body: { action: "cancel" },
81
+ id
82
+ }, context)),
83
+ section: "agents"
84
+ });
85
+ const invocationsUndo = defineConsoleOperation({
86
+ cli: false,
87
+ description: "Ask the person's open page to put back one change an Agent made there. The page restores it only while the field still shows the Agent's value.",
88
+ input: v.strictObject({
89
+ change: v.pipe(text, v.minLength(1)),
90
+ id: v.pipe(text, v.minLength(1))
91
+ }),
92
+ kind: "write",
93
+ name: "invocations.undo",
94
+ run: async (input, context) => (await import("../../invocation-page-undo-DHbXczWY.js")).undoConsolePageChange(input, context),
95
+ section: "agents"
96
+ });
97
+ const invocationsCapabilities = defineConsoleOperation({
98
+ cli: false,
99
+ description: "List the capabilities of an Agent Invocation setup.",
100
+ input: v.strictObject({ agent: optionalText }),
101
+ kind: "read",
102
+ name: "invocations.capabilities",
103
+ run: async (input) => (await import("./invocation-capabilities.get.js")).listConsoleInvocationCapabilities(input),
104
+ section: "agents"
105
+ });
106
+ const invocationsDelete = defineConsoleOperation({
107
+ cli: false,
108
+ description: "Delete one finished Agent Invocation.",
109
+ input: v.strictObject({ id: v.pipe(text, v.minLength(1)) }),
110
+ kind: "destructive",
111
+ name: "invocations.delete",
112
+ run: async ({ id }, context) => (await import("./invocation.get.js")).default(legacyEvent("invocations", "POST", {
113
+ body: { action: "delete" },
114
+ id
115
+ }, context)),
116
+ section: "agents"
117
+ });
118
+ const invocationsGet = defineConsoleOperation({
119
+ cli: false,
120
+ description: "Read one Agent Invocation with its observations.",
121
+ input: v.strictObject({
122
+ id: v.pipe(text, v.minLength(1)),
123
+ observationCount: optionalCount,
124
+ observationCursor: optionalText
125
+ }),
126
+ kind: "read",
127
+ name: "invocations.get",
128
+ run: async ({ id, ...query }, context) => (await import("./invocation.get.js")).default(legacyEvent("invocations", "GET", {
129
+ id,
130
+ query
131
+ }, context)),
132
+ section: "agents"
133
+ });
134
+ const invocationsList = defineConsoleOperation({
135
+ cli: false,
136
+ description: "List Agent Invocations, newest first.",
137
+ input: v.strictObject({
138
+ agent: optionalText,
139
+ capability: optionalText,
140
+ cursor: optionalText,
141
+ id: v.optional(v.array(text)),
142
+ limit: optionalCount,
143
+ triggeredBy: optionalText
144
+ }),
145
+ kind: "read",
146
+ name: "invocations.list",
147
+ run: async (input) => (await import("./invocations.get.js")).listConsoleInvocations(input),
148
+ section: "agents"
149
+ });
150
+ const invocationsWorkspace = defineConsoleOperation({
151
+ cli: false,
152
+ description: "Read the Workspace files and history of one Agent Invocation.",
153
+ input: v.strictObject({
154
+ cursor: optionalText,
155
+ history: v.optional(v.boolean()),
156
+ id: v.pipe(text, v.minLength(1)),
157
+ path: optionalText,
158
+ ref: optionalText,
159
+ revision: optionalText
160
+ }),
161
+ kind: "read",
162
+ name: "invocations.workspace",
163
+ run: async ({ id, history, ...query }, context) => (await import("./invocation-workspace.get.js")).default(legacyEvent("invocation-workspace", "GET", {
164
+ id,
165
+ query: {
166
+ ...query,
167
+ history: history ? "1" : void 0
168
+ }
169
+ }, context)),
170
+ section: "agents"
171
+ });
172
+ const searchQuery = defineConsoleOperation({
173
+ cli: {
174
+ namespace: "search",
175
+ command: "query",
176
+ positional: ["search"]
177
+ },
178
+ description: "Search the Agent Invocations of the Console.",
179
+ input: v.strictObject({
180
+ cursor: optionalText,
181
+ limit: optionalCount,
182
+ search: optionalText
183
+ }),
184
+ kind: "read",
185
+ name: "search.query",
186
+ run: async (input) => (await import("../../search-jgMrZJXR.js")).searchConsoleInvocations(input),
187
+ section: "agents"
188
+ });
189
+ const skillsInspect = defineConsoleOperation({
190
+ description: "Inspect the bundled Skill files of an Agent, or read one exact bundled text file.",
191
+ input: v.strictObject({
192
+ agent: optionalText,
193
+ path: optionalText
194
+ }),
195
+ kind: "read",
196
+ name: "skills.inspect",
197
+ run: async (input) => (await import("../../skills.get-CW8vc_Hf.js")).inspectConsoleSkills(input),
198
+ section: "skills"
199
+ });
200
+ const statusGet = defineConsoleOperation({
201
+ cli: false,
202
+ description: "Read the status of an Agent: its setup and what it can do.",
203
+ input: v.strictObject({ agent: optionalText }),
204
+ kind: "read",
205
+ name: "status.get",
206
+ run: async (input, context) => (await import("./status.get.js")).readConsoleStatus(legacyEvent("status", "GET", { query: input }, context)),
207
+ section: "agents"
208
+ });
209
+ /** The Console operations of the Agents, Skills, Usage, and Channels sections. The Console registers them only when the app has Agents. */
210
+ const agentConsoleOperations = [
211
+ agentsInvoke,
212
+ agentsList,
213
+ channelsReplay,
214
+ invocationsCancel,
215
+ invocationsCapabilities,
216
+ invocationsDelete,
217
+ invocationsGet,
218
+ invocationsList,
219
+ invocationsUndo,
220
+ defineConsoleOperation({
221
+ cli: {
222
+ command: "usage",
223
+ namespace: "agent"
224
+ },
225
+ description: "Read token use and cost evidence of Agent Invocations. The app adds up its journal at request time.",
226
+ input: v.strictObject({
227
+ agent: optionalText,
228
+ cursor: optionalText,
229
+ search: optionalText,
230
+ status: optionalText,
231
+ window: optionalText
232
+ }),
233
+ kind: "read",
234
+ name: "invocations.usage",
235
+ run: async (input, context) => (await import("./invocations.usage.js")).readConsoleUsage(legacyEvent("usage", "GET", { query: input }, context)),
236
+ section: "usage"
237
+ }),
238
+ invocationsWorkspace,
239
+ searchQuery,
240
+ skillsInspect,
241
+ statusGet
242
+ ];
243
+ /** Lets the Console ask an open page to undo a change. The generated Console app module installs it only when the app has Realtime. */
244
+ function installConsoleAgentRealtime(load) {
245
+ consoleState().agentRealtime = load;
246
+ }
247
+ export { agentConsoleOperations, installConsoleAgentRealtime };
@@ -1,5 +1,5 @@
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
  import { AgentProviderStatus } from "@vite-hub/agent";
4
4
  import { ObservabilityStatus } from "@vite-hub/agent/observability";
5
5
  /** `observability` is `null` when `vitehub({ observability })` is not set. */
@@ -1,11 +1,11 @@
1
- import { t as viteHubErrorDiagnostics } from "../../../error-diagnostics-CBtvqI30.js";
2
- import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "../../../agents-Cz_uhhov.js";
3
- import { h as withConsoleAccess } from "../../../access-BBHk9b5P.js";
4
- import { o as consoleRequestURL, s as consoleRoute, t as assertConsoleRequest } from "../../../request-CQ8TkHLh.js";
5
- import { t as consoleHttpError } from "../../../http-error-BorAxJYM.js";
1
+ import { t as viteHubErrorDiagnostics } from "../../error-diagnostics-CBtvqI30.js";
2
+ import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "../../agents-DXLHsE7x.js";
3
+ import { h as withConsoleAccess } from "../../access-CUFHPi8T.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
6
  import { createAgentStatusReader } from "@vite-hub/agent/server";
7
7
  import { observabilityStatus } from "@vite-hub/agent/server/internal";
8
- // src/console/runtime/server/status.get.ts
8
+ // src/agent/console/status.get.ts
9
9
  const readStatus = createAgentStatusReader();
10
10
  /** `observability` is `null` when `vitehub({ observability })` is not set. */
11
11
  async function statusHandler(event) {
@@ -1,8 +1,9 @@
1
- import { o as encodeAgentRouteParam } from "./console-route-DbdnLkkF.js";
2
1
  import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
2
+ import { o as encodeAgentRouteParam } from "./console-route-DbdnLkkF.js";
3
3
  import { resolvePublicUrl } from "@vite-hub/runtime";
4
4
  import { consoleInvocationUrl } from "@vite-hub/runtime/internal/console";
5
- // src/console/server.ts
5
+ // src/console/runtime/server/agent-console.ts
6
+ /** Resolves the Console Runtime Capability of an Agent: the Console URL of an Agent Invocation. */
6
7
  const agentConsole = { resolve(context) {
7
8
  return { invocationUrl(invocation) {
8
9
  if (typeof invocation.agentName !== "string" || typeof invocation.id !== "string") throw viteHubErrorDiagnostics.VITE_HUB_R0074({ message: "[vitehub] Console invocation URLs require an invocation with agentName and id." });
@@ -0,0 +1,14 @@
1
+ import { RuntimeHostContext } from "@vite-hub/runtime";
2
+ interface ConsoleInvocationLink {
3
+ agentName: string;
4
+ id: string;
5
+ }
6
+ /** The Console Runtime Capability. Read the Agent Invocation journal with `getAgentInvocations()` from `vite-hub/agent`. */
7
+ interface ConsoleRuntime {
8
+ invocationUrl: (invocation: ConsoleInvocationLink | Record<string, unknown>) => string;
9
+ }
10
+ /** Resolves the Console Runtime Capability of an Agent: the Console URL of an Agent Invocation. */
11
+ declare const agentConsole: {
12
+ resolve(context: RuntimeHostContext<unknown>): ConsoleRuntime;
13
+ };
14
+ export { ConsoleRuntime as n, agentConsole as r, ConsoleInvocationLink as t };
@@ -1,20 +1,20 @@
1
- import { t as getConsoleBlob } from "./blob-eH6j0AQj.js";
1
+ import { t as getConsoleBlob } from "./blob-iw8pWQ6o.js";
2
2
  import { t as consoleHttpError } from "./http-error-BorAxJYM.js";
3
3
  import { n as vitehubOwnedPrefix } from "./owned-paths-MjjDftBn.js";
4
4
  import { t as invariant } from "./invariant-Dj2R1eMr.js";
5
5
  import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
6
6
  import { a as decodeAgentRouteParam, o as encodeAgentRouteParam } from "./console-route-DbdnLkkF.js";
7
+ import { t as agentConsole } from "./agent-console-CHsLxKk_.js";
8
+ import { o as getConsoleAgentCapabilities, r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "./agents-DXLHsE7x.js";
9
+ import { d as consoleRequest, h as withConsoleAccess, i as consoleAccessInvoker } from "./access-CUFHPi8T.js";
7
10
  import { t as consoleAttachmentRequestBytes } from "./limits-BLo31qDR.js";
8
- import { t as agentConsole } from "./server-DsOEa4_A.js";
9
- import { o as getConsoleAgentCapabilities, r as consoleAgentInvokerProfiles, s as getConsoleAgentDefinition } from "./agents-Cz_uhhov.js";
10
- import { d as consoleRequest, h as withConsoleAccess, i as consoleAccessInvoker } from "./access-BBHk9b5P.js";
11
- import { a as consoleRequestJSON, l as setConsoleResponseStatus, o as consoleRequestURL, t as assertConsoleRequest } from "./request-CQ8TkHLh.js";
11
+ import { a as consoleRequestURL, c as setConsoleResponseStatus, i as consoleRequestJSON, t as assertConsoleRequest } from "./request-D769eiBL.js";
12
12
  import { agentInvocationId, createMessage, deserializeMessages, isAttachmentPart, startAgentInvocation } from "@vite-hub/agent";
13
13
  import * as v from "valibot";
14
14
  import { getStandardContext } from "@vite-hub/runtime/internal/h3";
15
15
  import { createExecutionContext } from "@vite-hub/runtime";
16
16
  import { createRuntimeWaitUntilController } from "@vite-hub/runtime/internal/context";
17
- // src/console/runtime/server/attachment-cleanup.ts
17
+ // src/agent/console/attachment-cleanup.ts
18
18
  const consolePrefix = `${vitehubOwnedPrefix}console/`;
19
19
  const consoleAttachmentPrefix = `${consolePrefix}attachments/`;
20
20
  const consoleAttachmentCleanupPrefix = `${consolePrefix}cleanup/`;
@@ -157,7 +157,7 @@ async function isConsoleAttachmentPendingCleanup(storage, id) {
157
157
  }
158
158
  return false;
159
159
  }
160
- // src/console/runtime/server/attachments.ts
160
+ // src/agent/console/attachments.ts
161
161
  const uploadSchema = v.object({ files: v.pipe(v.array(v.object({
162
162
  url: v.string(),
163
163
  filename: v.optional(v.string(), "image")
@@ -278,7 +278,7 @@ async function inputMessage(prompt, attachments, fresh = /* @__PURE__ */ new Set
278
278
  }] : [], ...parts]
279
279
  });
280
280
  }
281
- // src/console/runtime/server/agent-invocations.post.ts
281
+ // src/agent/console/agent-invocations.post.ts
282
282
  const allowedInputKeys = /* @__PURE__ */ new Set([
283
283
  "prompt",
284
284
  "invokerProfileId",
@@ -1 +1 @@
1
- export { s as getConsoleAgentDefinition, c as getConsoleAgents } from "./agents-Cz_uhhov.js";
1
+ export { s as getConsoleAgentDefinition, c as getConsoleAgents } from "./agents-DXLHsE7x.js";
@@ -1,8 +1,8 @@
1
1
  import { a as resolveConsoleSuppliedInvocations, i as resolveConsoleInvocations, r as markConsoleSuppliedInvocations } from "./internal-0C_CC601.js";
2
- import { r as installConsoleInvocations } from "./invocations-8NThe8Bx.js";
2
+ import { n as installConsoleInvocations } from "./invocations-B60XWNES.js";
3
3
  import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
4
- import * as v from "valibot";
5
4
  import { agentInvocationsDisabledKey, agentInvocationsFallbackKey, installAgentInvocationsOverride, resolveDefaultAgentInvocations } from "@vite-hub/agent/invocations/app";
5
+ import * as v from "valibot";
6
6
  import { markDiscoveredAgentName } from "@vite-hub/agent/server/internal";
7
7
  // src/console/runtime/server/agents.ts
8
8
  const consoleAgentsKey = Symbol.for("vitehub.console.agents");
@@ -0,0 +1,25 @@
1
+ import { r as OperationContext } from "../../operations-DgFhA1WE.js";
2
+ import { t as ConsoleAccess } from "../../access-DkBck8Vu.js";
3
+ import { Result, ResultError } from "@vite-hub/runtime";
4
+ import { AuthConsole, AuthConsoleErrorCode, AuthConsoleMutation } from "@vite-hub/auth/console-runtime";
5
+ /** An Auth Console failure as the error of an operation: its code, why, fix, and the HTTP status of the code. */
6
+ export declare function authConsoleFailure(error: ResultError<AuthConsoleErrorCode>): Error;
7
+ export type AuthOperationContext = Omit<OperationContext, "access"> & {
8
+ access: ConsoleAccess;
9
+ };
10
+ /** Runs one read of the Auth section, such as `auth.users`, and returns its data. */
11
+ export declare function runAuthConsoleRead<T>(context: AuthOperationContext, read: (api: AuthConsole, request: Request) => Promise<Result<T, AuthConsoleErrorCode>>): Promise<T>;
12
+ /**
13
+ * Runs one action of the Auth section, such as `auth.ban`, and returns its record: the action, the actor, and the
14
+ * target. Better Auth runs it as an app user: the signed Console person's app account, or the browser's app session of
15
+ * an open development Console. A CLI call names no person, so it cannot run one.
16
+ */
17
+ export declare function runAuthConsoleAction(context: AuthOperationContext, mutation: AuthConsoleMutation): Promise<unknown>;
18
+ /**
19
+ * `auth.impersonate` and `auth.stop-impersonating`: check the call and answer the app path to open, `/`. The Console
20
+ * calls them as the member before it signs an `impersonate` Site access token, and the app's `/_vitehub/site` starts or
21
+ * stops the impersonation with the browser's app session, which must belong to the email of the token.
22
+ */
23
+ export declare function checkImpersonation(context: AuthOperationContext, userId?: string): Promise<{
24
+ path: string;
25
+ }>;
@@ -1,8 +1,8 @@
1
- import { l as consolePerson, o as consoleImpersonation } from "../../../access-BBHk9b5P.js";
2
- import { i as consoleRequestError } from "../../../request-CQ8TkHLh.js";
3
- import { r as getConsoleSections } from "../../../sections-BNTdIEJw.js";
1
+ import { l as consolePerson, o as consoleImpersonation } from "../../access-CUFHPi8T.js";
2
+ import { r as consoleRequestError } from "../../request-D769eiBL.js";
3
+ import { r as getConsoleSections } from "../../sections-BNTdIEJw.js";
4
4
  import { getAuthConsoleForRequest } from "@vite-hub/auth/server";
5
- // src/console/runtime/server/auth.ts
5
+ // src/auth/console/auth.ts
6
6
  const statuses = {
7
7
  AUTH_CONSOLE_INVALID_REQUEST: 400,
8
8
  AUTH_CONSOLE_FORBIDDEN: 403,
@@ -59,14 +59,13 @@ async function runAuthConsoleAction(context, mutation) {
59
59
  return await response.json();
60
60
  }
61
61
  /**
62
- * `auth.impersonate` and `auth.stop-impersonating`: check the call, then return a one-time link that the browser opens
63
- * on the app origin. Its redemption starts or stops the impersonation with the browser's app session, which must belong
64
- * to the person who asked. See `tickets.ts`.
62
+ * `auth.impersonate` and `auth.stop-impersonating`: check the call and answer the app path to open, `/`. The Console
63
+ * calls them as the member before it signs an `impersonate` Site access token, and the app's `/_vitehub/site` starts or
64
+ * stops the impersonation with the browser's app session, which must belong to the email of the token.
65
65
  */
66
- async function issueImpersonationTicket(context, userId) {
66
+ async function checkImpersonation(context, userId) {
67
67
  if (!consoleImpersonation()) throw consoleRequestError(404, "Impersonation is off. Set console.impersonation to true to enable it.");
68
- const { issueConsoleTicket } = await import("./tickets.js");
69
- if (userId === void 0) return await issueConsoleTicket(context, "auth.stop-impersonating", {});
68
+ if (userId === void 0) return { path: "/" };
70
69
  const { api, request } = await operationAuthConsole(context);
71
70
  const [describeError, description] = await api.describe(request);
72
71
  if (describeError) throw authConsoleFailure(describeError);
@@ -75,6 +74,6 @@ async function issueImpersonationTicket(context, userId) {
75
74
  const [userError, detail] = await api.user(userId, request);
76
75
  if (userError) throw authConsoleFailure(userError);
77
76
  if (detail.impersonation && !detail.impersonation.enabled) throw consoleRequestError(403, detail.impersonation.reason ?? "Better Auth does not impersonate this user.", "CONSOLE_ACCESS_DENIED");
78
- return await issueConsoleTicket(context, "auth.impersonate", { userId });
77
+ return { path: "/" };
79
78
  }
80
- export { authConsoleFailure, issueImpersonationTicket, runAuthConsoleAction, runAuthConsoleRead };
79
+ export { authConsoleFailure, checkImpersonation, runAuthConsoleAction, runAuthConsoleRead };
@@ -0,0 +1,3 @@
1
+ import { n as AnyOperation } from "../../operations-DgFhA1WE.js";
2
+ /** The Console operations of the Auth section. The Console registers them only when the app has Auth. */
3
+ export declare const authConsoleOperations: readonly AnyOperation[];
@@ -0,0 +1,135 @@
1
+ import { n as authConsoleImpersonationOperations, r as authConsoleReadOperations, t as authConsoleActionOperations } from "../../auth-operations-BKqoX8Ua.js";
2
+ import { i as defineConsoleOperation, l as text } from "../../operations-byxiZ2R2.js";
3
+ import * as v from "valibot";
4
+ // src/auth/console/operations.ts
5
+ const authId = v.pipe(text, v.minLength(1), v.maxLength(512));
6
+ const authQuery = {
7
+ filter: v.optional(v.picklist([
8
+ "all",
9
+ "admins",
10
+ "banned",
11
+ "agents"
12
+ ])),
13
+ limit: v.optional(v.number()),
14
+ offset: v.optional(v.number()),
15
+ search: v.optional(v.pipe(text, v.maxLength(200))),
16
+ userId: v.optional(authId)
17
+ };
18
+ const authValue = v.union([
19
+ text,
20
+ v.number(),
21
+ v.boolean(),
22
+ v.null(),
23
+ v.array(text),
24
+ v.array(v.number())
25
+ ]);
26
+ function authRead(name, description, input, read) {
27
+ return defineConsoleOperation({
28
+ description,
29
+ input,
30
+ kind: "read",
31
+ mcp: false,
32
+ name: authConsoleReadOperations[name],
33
+ run: async (value, context) => (await import("./auth.js")).runAuthConsoleRead(context, (api, request) => read(api, request, value)),
34
+ section: "auth"
35
+ });
36
+ }
37
+ function authAction(action, description, kind, input, mutation, positional) {
38
+ return defineConsoleOperation({
39
+ cli: { positional: [positional] },
40
+ description,
41
+ input,
42
+ kind,
43
+ mcp: false,
44
+ name: authConsoleActionOperations[action],
45
+ run: async (value, context) => (await import("./auth.js")).runAuthConsoleAction(context, mutation(value)),
46
+ section: "auth"
47
+ });
48
+ }
49
+ /** The Console operations of the Auth section. The Console registers them only when the app has Auth. */
50
+ const authConsoleOperations = [
51
+ authRead("describe", "Describe the Auth of the app: its pages, user fields, and the actions that this access may run.", v.strictObject({}), (api, request) => api.describe(request)),
52
+ authRead("overview", "Count the users, new users, active sessions, and approved Agents of the app, with its recent Auth events.", v.strictObject({}), (api) => api.overview()),
53
+ authRead("activity", "List recent Auth events, newest first, one page at a time.", v.strictObject({
54
+ cursor: v.optional(v.pipe(text, v.maxLength(2048))),
55
+ group: v.optional(v.picklist([
56
+ "sign-in",
57
+ "admin",
58
+ "agents",
59
+ "organizations"
60
+ ])),
61
+ limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(200))),
62
+ userId: v.optional(authId)
63
+ }), (api, _request, input) => api.activity(input)),
64
+ authRead("users", "List the users of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.users(input)),
65
+ authRead("user", "Read one user with its sessions, accounts, Agent clients, and organizations.", v.strictObject({ id: authId }), (api, request, input) => api.user(input.id, request)),
66
+ authRead("sessions", "List the active sessions of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.sessions(input)),
67
+ authRead("organizations", "List the organizations of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.organizations(input)),
68
+ authRead("organization", "Read one organization with its members and invitations, one page at a time.", v.strictObject({
69
+ ...authQuery,
70
+ id: authId
71
+ }), (api, _request, { id, ...query }) => api.organization(id, query)),
72
+ authRead("agents", "List the Agent clients that users granted access, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.agents(input)),
73
+ authAction("ban", "Ban a user, with an optional reason and expiry in seconds.", "write", v.strictObject({
74
+ expiresIn: v.optional(v.number()),
75
+ reason: v.optional(v.pipe(text, v.maxLength(1e3))),
76
+ userId: authId
77
+ }), (input) => ({
78
+ action: "ban",
79
+ ...input
80
+ }), "userId"),
81
+ authAction("unban", "Lift the ban of a user.", "write", v.strictObject({ userId: authId }), (input) => ({
82
+ action: "unban",
83
+ ...input
84
+ }), "userId"),
85
+ authAction("remove", "Delete a user and its sessions and accounts.", "destructive", v.strictObject({ userId: authId }), (input) => ({
86
+ action: "remove",
87
+ ...input
88
+ }), "userId"),
89
+ authAction("revokeSessions", "Sign a user out of every session.", "destructive", v.strictObject({ userId: authId }), (input) => ({
90
+ action: "revokeSessions",
91
+ ...input
92
+ }), "userId"),
93
+ authAction("setRole", "Set the role of a user.", "write", v.strictObject({
94
+ role: authId,
95
+ userId: authId
96
+ }), (input) => ({
97
+ action: "setRole",
98
+ ...input
99
+ }), "userId"),
100
+ authAction("editField", "Change one field of a user.", "write", v.strictObject({
101
+ field: authId,
102
+ userId: authId,
103
+ value: authValue
104
+ }), (input) => ({
105
+ action: "editField",
106
+ ...input
107
+ }), "userId"),
108
+ authAction("revokeSession", "End one session.", "destructive", v.strictObject({ id: authId }), (input) => ({
109
+ action: "revokeSession",
110
+ ...input
111
+ }), "id"),
112
+ authAction("revokeConsent", "Revoke the access that a user granted an Agent client.", "destructive", v.strictObject({ id: authId }), (input) => ({
113
+ action: "revokeConsent",
114
+ ...input
115
+ }), "id"),
116
+ defineConsoleOperation({
117
+ description: "Check that the caller may open the app in the browser as a user, and return the app path to open. The Console then signs an impersonate Site access token. The browser must be signed in to the app with the email of the person who asks.",
118
+ input: v.strictObject({ userId: authId }),
119
+ kind: "write",
120
+ mcp: false,
121
+ name: authConsoleImpersonationOperations.start,
122
+ run: async ({ userId }, context) => (await import("./auth.js")).checkImpersonation(context, userId),
123
+ section: "auth"
124
+ }),
125
+ defineConsoleOperation({
126
+ description: "Check that impersonation is on, and return the app path to open. The Console then signs a Site access token that ends the impersonation of the browser that opens it and restores the administrator's session.",
127
+ input: v.strictObject({}),
128
+ kind: "write",
129
+ mcp: false,
130
+ name: authConsoleImpersonationOperations.stop,
131
+ run: async (_input, context) => (await import("./auth.js")).checkImpersonation(context),
132
+ section: "auth"
133
+ })
134
+ ];
135
+ export { authConsoleOperations };
@@ -1,8 +1,8 @@
1
1
  // src/console/runtime/auth-operations.ts
2
2
  /**
3
3
  * The Auth management operations of the Console. Each read and each action of the Auth section is one operation on the
4
- * Console RPC. Impersonation sets the app session cookie, so its operations return a one-time link that the browser
5
- * opens on the app origin.
4
+ * Console RPC. Impersonation sets the app session cookie, so its operations only check the call. The Console then signs
5
+ * an `impersonate` Site access token that the browser opens on the app origin.
6
6
  */
7
7
  const authConsoleReadOperations = {
8
8
  activity: "auth.activity",
@@ -25,7 +25,7 @@ const authConsoleActionOperations = {
25
25
  setRole: "auth.set-role",
26
26
  unban: "auth.unban"
27
27
  };
28
- /** The operations that return a one-time link to start or stop impersonation in the browser. */
28
+ /** The operations that check a start or a stop of impersonation before the Console signs its token. */
29
29
  const authConsoleImpersonationOperations = {
30
30
  start: "auth.impersonate",
31
31
  stop: "auth.stop-impersonating"
@@ -31,7 +31,7 @@ interface ConsoleSignedConsoleAuthorizeContext {
31
31
  /** The `<NAME>` of the `VITEHUB_CONSOLE_KEY_<NAME>` variable whose key verified the signature. */
32
32
  key: string;
33
33
  /** `"mcp"` when the ViteHub MCP of the Console calls for `user`, such as from Claude Code. Not set for the Console page. */
34
- surface?: "mcp";
34
+ surface?: "mcp" | "cli";
35
35
  via: "console";
36
36
  }
37
37
  /** The request that `console.authorize` checks when the CLI signed it. The CLI has no user. */
@@ -51,24 +51,11 @@ interface ConsoleAgentAuthorizeContext {
51
51
  user?: ConsoleUser;
52
52
  via: "agent";
53
53
  }
54
- /**
55
- * The check of the **Console** link in the page tools pill. It is not a Console call: the request is the page tools
56
- * session request of a page of the app, and `user` is the ViteHub Auth user signed in to the app, when there is one.
57
- * `true` or `{ sections }` with at least one section shows the link. The link gives no access: the Console checks the
58
- * person and the team when it opens.
59
- */
60
- interface ConsolePageAuthorizeContext {
61
- request: Request;
62
- /** The ViteHub Auth user of the page. Not set when the app has no Auth or nobody signed in. */
63
- user?: ConsoleUser;
64
- via: "page";
65
- }
66
54
  /**
67
55
  * The request that `console.authorize` checks. `via` is `"console"` or `"cli"`: who signed the request. `via` is
68
- * `"agent"` when an Agent calls Console operations as tools, `"page"` when the page tools pill asks whether to show the
69
- * Console link, and not set for an open Console in development.
56
+ * `"agent"` when an Agent calls Console operations as tools, and not set for an open Console in development.
70
57
  */
71
- type ConsoleAuthorizeContext = ConsoleOpenAuthorizeContext | ConsoleSignedConsoleAuthorizeContext | ConsoleSignedCliAuthorizeContext | ConsoleAgentAuthorizeContext | ConsolePageAuthorizeContext;
58
+ type ConsoleAuthorizeContext = ConsoleOpenAuthorizeContext | ConsoleSignedConsoleAuthorizeContext | ConsoleSignedCliAuthorizeContext | ConsoleAgentAuthorizeContext;
72
59
  /**
73
60
  * What `console.authorize` returns for one request.
74
61
  * - `true` allows every Console section.
@@ -84,4 +71,4 @@ type ConsoleAuthorizeResult = boolean | Response | {
84
71
  };
85
72
  /** Decides whether one Console request may continue, and which Console sections it may use. */
86
73
  type ConsoleAuthorize = (context: ConsoleAuthorizeContext) => ConsoleAuthorizeResult | Promise<ConsoleAuthorizeResult>;
87
- export { ConsoleOpenAuthorizeContext as a, ConsoleSignedConsoleAuthorizeContext as c, ConsoleAuthorizeResult as i, ConsoleUser as l, ConsoleAuthorize as n, ConsolePageAuthorizeContext as o, ConsoleAuthorizeContext as r, ConsoleSignedCliAuthorizeContext as s, ConsoleAgentAuthorizeContext as t };
74
+ export { ConsoleOpenAuthorizeContext as a, ConsoleUser as c, ConsoleAuthorizeResult as i, ConsoleAuthorize as n, ConsoleSignedCliAuthorizeContext as o, ConsoleAuthorizeContext as r, ConsoleSignedConsoleAuthorizeContext as s, ConsoleAgentAuthorizeContext as t };