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.
- package/README.md +9 -8
- package/dist/{access-BBHk9b5P.js → access-CUFHPi8T.js} +9 -133
- package/dist/{access-policy-CUbJLvlR.d.ts → access-DkBck8Vu.d.ts} +16 -16
- package/dist/{account-CoAO1F8G.d.ts → account-DNr8fHcQ.d.ts} +1 -1
- package/dist/{console/runtime/server → agent/console}/agents.get.d.ts +1 -1
- package/dist/{console/runtime/server → agent/console}/agents.get.js +3 -3
- package/dist/{console/runtime/server → agent/console}/channel-replay.d.ts +2 -2
- package/dist/{console/runtime/server → agent/console}/channel-replay.js +6 -6
- package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.js +4 -4
- package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.d.ts +3 -3
- package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.js +6 -6
- package/dist/{console/runtime/server → agent/console}/invocation.get.d.ts +4 -4
- package/dist/{console/runtime/server → agent/console}/invocation.get.js +8 -8
- package/dist/{console/runtime/server → agent/console}/invocations.get.js +5 -5
- package/dist/{console/runtime/server/usage.get.d.ts → agent/console/invocations.usage.d.ts} +2 -4
- package/dist/agent/console/invocations.usage.js +51 -0
- package/dist/agent/console/operations.d.ts +6 -0
- package/dist/agent/console/operations.js +247 -0
- package/dist/{console/runtime/server → agent/console}/status.get.d.ts +2 -2
- package/dist/{console/runtime/server → agent/console}/status.get.js +6 -6
- package/dist/{server-DsOEa4_A.js → agent-console-CHsLxKk_.js} +3 -2
- package/dist/agent-console-FmaYpVv-.d.ts +14 -0
- package/dist/{agent-invocations.post-BAC1aHnG.js → agent-invocations.post-CF5anHY6.js} +8 -8
- package/dist/{agents-BClUWOj7.js → agents-DBm_PJie.js} +1 -1
- package/dist/{agents-Cz_uhhov.js → agents-DXLHsE7x.js} +2 -2
- package/dist/auth/console/auth.d.ts +25 -0
- package/dist/{console/runtime/server → auth/console}/auth.js +11 -12
- package/dist/auth/console/operations.d.ts +3 -0
- package/dist/auth/console/operations.js +135 -0
- package/dist/{auth-operations-arLIY2_2.js → auth-operations-BKqoX8Ua.js} +3 -3
- package/dist/{auth-types-B4mq4YhK.d.ts → auth-types-Cotn7406.d.ts} +4 -17
- package/dist/bin.js +3 -3
- package/dist/blob/console/operations.d.ts +3 -0
- package/dist/blob/console/operations.js +44 -0
- package/dist/{blob-eH6j0AQj.js → blob-iw8pWQ6o.js} +2 -2
- package/dist/{blob-_TtxDb-t.d.ts → blob-uNin0_TV.d.ts} +1 -1
- package/dist/cache/operations.js +1 -1
- package/dist/console/auth-types.d.ts +2 -2
- package/dist/console/auth.d.ts +2 -2
- package/dist/console/runtime/auth-operations.d.ts +3 -3
- package/dist/console/runtime/auth-operations.js +1 -1
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +2 -2
- package/dist/console/runtime/client/auth-management.ts +6 -6
- package/dist/console/runtime/client/blob-media.js +2 -2
- package/dist/console/runtime/client/comment-thread.js +1 -1
- package/dist/console/runtime/client/content-heads.js +1 -1
- package/dist/console/runtime/client/documents.d.ts +1 -1
- package/dist/console/runtime/client/documents.js +1 -1
- package/dist/console/runtime/client/invocation.js +1 -1
- package/dist/console/runtime/client/live.d.ts +1 -1
- package/dist/console/runtime/client/mcp-client.d.ts +4 -4
- package/dist/console/runtime/client/mcp-client.js +4 -6
- package/dist/console/runtime/client/media-library.js +1 -1
- package/dist/console/runtime/client/media-uploads.js +1 -1
- package/dist/console/runtime/client/operation-view.js +1 -1
- package/dist/console/runtime/client/presence.d.ts +1 -1
- package/dist/console/runtime/client/problem.d.ts +1 -1
- package/dist/console/runtime/client/problem.js +2 -2
- package/dist/console/runtime/client/project-link.d.ts +1 -1
- package/dist/console/runtime/client/project-link.js +1 -1
- package/dist/console/runtime/client/project-session.d.ts +2 -2
- package/dist/console/runtime/client/project-session.js +1 -1
- package/dist/console/runtime/client/publish.d.ts +1 -1
- package/dist/console/runtime/client/rate-limit.js +1 -1
- package/dist/console/runtime/client/read-only.d.ts +1 -1
- package/dist/console/runtime/client/read-only.js +1 -1
- package/dist/console/runtime/client/request.d.ts +2 -2
- package/dist/console/runtime/client/request.js +1 -1
- package/dist/console/runtime/client/schedule-run.js +1 -1
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -1
- package/dist/console/runtime/client/site-access.d.ts +48 -9
- package/dist/console/runtime/client/site-access.js +18 -11
- package/dist/console/runtime/client/site-link.d.ts +2 -0
- package/dist/console/runtime/client/site-link.js +1 -0
- package/dist/console/runtime/client/workflow.js +1 -1
- package/dist/console/runtime/components/console-auth-detail.vue +1 -1
- package/dist/console/runtime/components/console-auth-event-list.vue +1 -0
- package/dist/console/runtime/components/console-document-editor.vue +3 -4
- package/dist/console/runtime/components/console-usage.vue +2 -2
- package/dist/console/runtime/diagnostics.ts +14 -56
- package/dist/console/runtime/mcp-client.d.ts +2 -2
- package/dist/console/runtime/mcp-client.js +1 -1
- package/dist/console/runtime/operation-loader.d.ts +1 -0
- package/dist/console/runtime/operation-loader.js +10 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -2
- package/dist/console/runtime/sections.d.ts +2 -2
- package/dist/console/runtime/sections.js +1 -1
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/agent-console.d.ts +2 -0
- package/dist/console/runtime/server/agent-console.js +1 -0
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -1
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +2 -2
- package/dist/console/runtime/server/definitions.get.js +2 -2
- package/dist/console/runtime/server/definitions.js +1 -1
- package/dist/console/runtime/server/documents.d.ts +2 -2
- package/dist/console/runtime/server/documents.js +2 -2
- package/dist/console/runtime/server/entry-site-access.d.ts +3 -0
- package/dist/console/runtime/server/entry-site-access.js +4 -0
- package/dist/console/runtime/server/entry.d.ts +3 -0
- package/dist/console/runtime/server/entry.js +4 -0
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -1
- package/dist/console/runtime/server/pill.d.ts +45 -0
- package/dist/console/runtime/server/pill.js +62 -0
- package/dist/console/runtime/server/rpc.d.ts +5 -8
- package/dist/console/runtime/server/rpc.js +13 -20
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -1
- package/dist/console/runtime/server/sections.d.ts +4 -4
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +4 -4
- package/dist/console/runtime/server/sections.js +3 -3
- package/dist/console/runtime/server/setup.d.ts +4 -4
- package/dist/console/runtime/server/setup.js +3 -3
- package/dist/console/runtime/server/site-access-operation.d.ts +7 -0
- package/dist/console/runtime/server/site-access-operation.js +36 -0
- package/dist/console/runtime/server/site-actions.d.ts +73 -0
- package/dist/console/runtime/server/site-actions.js +105 -0
- package/dist/console/runtime/server/site-entry.d.ts +16 -7
- package/dist/console/runtime/server/site-entry.js +59 -42
- package/dist/console/runtime/server/site-visitor.d.ts +17 -0
- package/dist/console/runtime/server/site-visitor.js +1 -0
- package/dist/console/runtime/server/site.d.ts +27 -0
- package/dist/console/runtime/server/site.js +1 -0
- package/dist/console/server.d.ts +7 -19
- package/dist/console/server.js +6 -6
- package/dist/console-signature--55DIKf2.js +237 -0
- package/dist/content/console/operations.d.ts +3 -0
- package/dist/content/console/operations.js +62 -0
- package/dist/{console/runtime/server → database/console}/database.get.d.ts +1 -1
- package/dist/{console/runtime/server → database/console}/database.get.js +4 -4
- package/dist/database/console/operations.d.ts +3 -0
- package/dist/database/console/operations.js +49 -0
- package/dist/{database-CPjZ3L0g.d.ts → database-yFezh5U1.d.ts} +1 -1
- package/dist/{definitions-M7i2p8SR.js → definitions-DGo2rNQ9.js} +1 -1
- package/dist/{dev-peer-DBq-isgi.js → dev-peer-CRYp01PE.js} +1 -219
- package/dist/dev-peer-CX5C9243.js +1 -0
- package/dist/{diagnostics-B2cqlCSz.js → diagnostics-DLHqjKGe.js} +2 -8
- package/dist/diagnostics-DgGKvWzF.d.ts +7 -0
- package/dist/doctor.js +2 -2
- package/dist/{documents-LtkKCxtu.d.ts → documents-A-7Ho0g0.d.ts} +11 -11
- package/dist/{documents-Ck_iub9w.js → documents-BduuZjm3.js} +3 -2
- package/dist/{documents-DxK0tdjA.d.ts → documents-CApMRd4o.d.ts} +2 -3
- package/dist/{documents-BOYwZ5g4.js → documents-D6ueeoUR.js} +12 -15
- package/dist/durability/operations.js +1 -1
- package/dist/{console/runtime/server → env/console}/env.get.d.ts +2 -2
- package/dist/{console/runtime/server → env/console}/env.get.js +7 -7
- package/dist/env/console/operations.d.ts +3 -0
- package/dist/env/console/operations.js +12 -0
- package/dist/env/vite.d.ts +1 -0
- package/dist/env/vite.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{internal-CKocv79I.d.ts → internal-BRNf11h3.d.ts} +14 -4
- package/dist/{invocation-page-undo-BEi-rO0Q.js → invocation-page-undo-DHbXczWY.js} +6 -4
- package/dist/invocations-B60XWNES.js +45 -0
- package/dist/{console/runtime/server → logs/console}/logs.get.d.ts +3 -3
- package/dist/{console/runtime/server → logs/console}/logs.get.js +7 -7
- package/dist/logs/console/operations.d.ts +3 -0
- package/dist/logs/console/operations.js +23 -0
- package/dist/loopback-Bl9Cvj1k.js +139 -0
- package/dist/mcp/eval.d.ts +1 -0
- package/dist/mcp/eval.js +2 -0
- package/dist/{mcp-client-Q2XbUXuP.d.ts → mcp-client-uXVvS7RL.d.ts} +4 -6
- package/dist/{media-CAKz9yrp.js → media-CNwnh6CG.js} +5 -5
- package/dist/{media-library-BDX89xXA.js → media-library-DTC8TLsZ.js} +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +108 -68
- package/dist/{operation-contributions-D10pjkJF.js → operation-contributions-BU10k2QS.js} +7 -6
- package/dist/{operation-contributions-BCcQVlGb.d.ts → operation-contributions-xwjDzj28.d.ts} +5 -4
- package/dist/{operation-definition-DTpNvLd8.js → operation-definition-D04Rdjbe.js} +2 -1
- package/dist/operation-modules-BUXlwjvd.js +1 -0
- package/dist/operation-modules-DHWkPcfS.js +139 -0
- package/dist/operations-D-7ljPqw.js +1 -0
- package/dist/{operations-CD_mu_Ww.js → operations-DksTrRMb.js} +1 -1
- package/dist/operations-byxiZ2R2.js +113 -0
- package/dist/{optional-owners-DAfShdgV.js → optional-owners-Cypch7V3.js} +0 -1
- package/dist/page-tools-BeZrtn4S.js +46 -0
- package/dist/page-tools-Chk8Gm9x.d.ts +23 -0
- package/dist/page-tools-shared-BLPidmCi.js +39 -0
- package/dist/{plugins-BpiTVULl.d.ts → plugins-BmkOoyIh.d.ts} +22 -9
- package/dist/{plugins-H6-MQrsn.js → plugins-DfXcUnzN.js} +248 -310
- package/dist/{project-DKBIHOf4.d.ts → project-B2qWt8on.d.ts} +2 -7
- package/dist/{project-BxyyclTE.js → project-_juMSuAS.js} +5 -7
- package/dist/{project-link-CeS0T8Pr.js → project-link-CJbCkOlC.js} +3 -3
- package/dist/{project-link-isfdRO3Q.d.ts → project-link-Ck3vuq9w.d.ts} +1 -1
- package/dist/{project-session--GN7MduT.js → project-session-8pN7pRo8.js} +4 -4
- package/dist/{request-CQ8TkHLh.js → request-D769eiBL.js} +2 -2
- package/dist/{request-BC_krbEr.d.ts → request-DYmjLTqP.d.ts} +1 -1
- package/dist/{request-CJCPyu2B.d.ts → request-DkoE0b2h.d.ts} +10 -2
- package/dist/{request-Cl68STwT.js → request-XFVx7CGC.js} +24 -2
- package/dist/routes-D02vxUSg.js +26 -0
- package/dist/{runtime-CyPZMiyK.js → runtime-DA7HJe10.js} +1 -1
- package/dist/{runtime-Cf8R1Ztr.d.ts → runtime-DGvimtvc.d.ts} +1 -1
- package/dist/{runtime-feature-guard-DpUn4Oxc.js → runtime-feature-guard-BKAMRZzM.js} +1 -1
- package/dist/search-jgMrZJXR.js +84 -0
- package/dist/{sections-BiCOk9qP.js → sections-AUGy9EkY.js} +1 -6
- package/dist/{sections-BTfWK14a.d.ts → sections-BMkFB3S-.d.ts} +1 -1
- package/dist/{sections-0qrBvGbf.d.ts → sections-DCoCa4nF.d.ts} +1 -4
- package/dist/{sections-DAtgYMVz.d.ts → sections-DjeAUX7o.d.ts} +4 -4
- package/dist/{sections-HLxb9MrG.js → sections-ZFAlI4JW.js} +2 -2
- package/dist/{sections.get-CGmtYmfu.d.ts → sections.get-BY5dClJY.d.ts} +1 -1
- package/dist/{setup-Ca7jtBLS.d.ts → setup-BBnZPziq.d.ts} +4 -7
- package/dist/{setup-DQz_i-ee.js → setup-yc3_WKNG.js} +1 -13
- package/dist/site-CZCIWsUQ.js +169 -0
- package/dist/site-link-Bvo2SxPo.js +58 -0
- package/dist/site-link-Dtw8MNVB.d.ts +18 -0
- package/dist/site-pages-B6J8U2Nq.js +66 -0
- package/dist/site-token-Wa7fhjwg.js +215 -0
- package/dist/site-visitor-BkhE2TA0.js +89 -0
- package/dist/skills/operations.js +2 -2
- package/dist/{skills.get-DAooGWy5.js → skills.get-CW8vc_Hf.js} +3 -3
- package/dist/task/operations.js +1 -1
- package/dist/usage-DBi7aOhx.js +33 -0
- package/dist/{version-CAhBr673.js → version-DUCd7Orc.js} +11 -5
- package/dist/workspace/console/operations.d.ts +3 -0
- package/dist/workspace/console/operations.js +22 -0
- package/dist/{console/runtime/server → workspace/console}/workspace-files.get.d.ts +3 -3
- package/dist/{console/runtime/server → workspace/console}/workspace-files.get.js +4 -4
- package/package.json +91 -82
- package/dist/auth-CeKxL2xp.d.ts +0 -116
- package/dist/cloudflare-env-lookup-DcN7pGlv.js +0 -15
- package/dist/console/runtime/client/ticket.d.ts +0 -2
- package/dist/console/runtime/client/ticket.js +0 -1
- package/dist/console/runtime/page/loader.js +0 -135
- package/dist/console/runtime/server/auth.d.ts +0 -2
- package/dist/console/runtime/server/mcp-client-operations.d.ts +0 -3
- package/dist/console/runtime/server/mcp-client-operations.js +0 -137
- package/dist/console/runtime/server/page-auth.d.ts +0 -16
- package/dist/console/runtime/server/page-auth.js +0 -43
- package/dist/console/runtime/server/page-tool.d.ts +0 -2
- package/dist/console/runtime/server/page-tool.js +0 -110
- package/dist/console/runtime/server/page-tools-route.d.ts +0 -2
- package/dist/console/runtime/server/page-tools-route.js +0 -4
- package/dist/console/runtime/server/search.get.d.ts +0 -2
- package/dist/console/runtime/server/search.get.js +0 -95
- package/dist/console/runtime/server/site-session.d.ts +0 -79
- package/dist/console/runtime/server/site-session.js +0 -1
- package/dist/console/runtime/server/tickets.d.ts +0 -2
- package/dist/console/runtime/server/tickets.js +0 -1
- package/dist/console/runtime/server/usage.get.js +0 -91
- package/dist/console/runtime/site-access.d.ts +0 -2
- package/dist/console/runtime/site-access.js +0 -1
- package/dist/diagnostics-BXxPggRw.d.ts +0 -9
- package/dist/invocations-8NThe8Bx.js +0 -85
- package/dist/mcp-client-Bkh-khvr.js +0 -9
- package/dist/mcp-client-DiObFpDS.js +0 -1037
- package/dist/operations-D7ENc68Y.js +0 -1
- package/dist/operations-vRLiH7dh.js +0 -852
- package/dist/page-tool-BUnUbuSy.d.ts +0 -67
- package/dist/page-tools-BQzwuAHD.js +0 -460
- package/dist/page-tools-UwsfvH-B.d.ts +0 -21
- package/dist/page-tools-shared-hJcG_xk8.js +0 -125
- package/dist/secret-D2KL_o2h.js +0 -43
- package/dist/site-access-1JIQjY11.js +0 -292
- package/dist/site-access-CUXIbbbR.d.ts +0 -53
- package/dist/site-access-CmaZ-oaL.js +0 -17
- package/dist/site-access-Cvmjb6aw.js +0 -1
- package/dist/site-session-D36fr7Wf.js +0 -297
- package/dist/skills/vitehub/SKILL.md +0 -142
- package/dist/skills/vitehub/agents/openai.yaml +0 -4
- package/dist/skills/vitehub/references/agent-definitions.md +0 -36
- package/dist/skills/vitehub/references/bundle.md +0 -57
- package/dist/skills/vitehub/references/capabilities-authority.md +0 -30
- package/dist/skills/vitehub/references/channels-triggers.md +0 -27
- package/dist/skills/vitehub/references/framework-composition.md +0 -29
- package/dist/skills/vitehub/references/preview-contract.md +0 -44
- package/dist/skills/vitehub/references/primitives/auth.md +0 -14
- package/dist/skills/vitehub/references/primitives/blob.md +0 -13
- package/dist/skills/vitehub/references/primitives/browser.md +0 -17
- package/dist/skills/vitehub/references/primitives/cache.md +0 -13
- package/dist/skills/vitehub/references/primitives/channels.md +0 -11
- package/dist/skills/vitehub/references/primitives/connections.md +0 -14
- package/dist/skills/vitehub/references/primitives/content.md +0 -13
- package/dist/skills/vitehub/references/primitives/database.md +0 -15
- package/dist/skills/vitehub/references/primitives/email.md +0 -11
- package/dist/skills/vitehub/references/primitives/env.md +0 -13
- package/dist/skills/vitehub/references/primitives/kv.md +0 -13
- package/dist/skills/vitehub/references/primitives/markdown-template.md +0 -13
- package/dist/skills/vitehub/references/primitives/queue.md +0 -14
- package/dist/skills/vitehub/references/primitives/rate-limit.md +0 -11
- package/dist/skills/vitehub/references/primitives/realtime.md +0 -19
- package/dist/skills/vitehub/references/primitives/sandbox-task.md +0 -11
- package/dist/skills/vitehub/references/primitives/sandbox.md +0 -13
- package/dist/skills/vitehub/references/primitives/schedule.md +0 -11
- package/dist/skills/vitehub/references/primitives/shell.md +0 -11
- package/dist/skills/vitehub/references/primitives/source.md +0 -11
- package/dist/skills/vitehub/references/primitives/workflow.md +0 -11
- package/dist/skills/vitehub/references/primitives/workspace.md +0 -11
- package/dist/skills/vitehub/references/project-patterns.md +0 -19
- package/dist/skills/vitehub/references/project-shapes.md +0 -81
- package/dist/skills/vitehub/references/proof-recovery.md +0 -31
- package/dist/skills/vitehub/references/sandboxes-hosts.md +0 -26
- package/dist/skills/vitehub/references/schedules-workflows-invocations.md +0 -28
- package/dist/skills/vitehub/references/server-primitives.md +0 -39
- package/dist/skills/vitehub/references/workspaces-sources-access.md +0 -26
- package/dist/ticket-BFWwevWN.d.ts +0 -12
- package/dist/ticket-BwsnryuU.js +0 -30
- package/dist/tickets-Cj9_y3gw.js +0 -356
- package/dist/usage-BduF04ks.d.ts +0 -20
- package/dist/usage-ZV3TBMzE.js +0 -570
- package/dist/usage-index-CR_xTrXO.js +0 -334
- /package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.d.ts +0 -0
- /package/dist/{console/runtime/server → agent/console}/invocations.get.d.ts +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/index.json +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/SKILL.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/agents/openai.yaml +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/agent-definitions.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/bundle.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/capabilities-authority.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/channels-triggers.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/framework-composition.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/preview-contract.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/auth.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/blob.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/browser.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/cache.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/channels.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/connections.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/content.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/database.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/email.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/env.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/kv.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/markdown-template.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/queue.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/rate-limit.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/realtime.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox-task.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/schedule.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/shell.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/source.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workflow.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workspace.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-patterns.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-shapes.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/proof-recovery.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/sandboxes-hosts.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/schedules-workflows-invocations.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/server-primitives.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/workspaces-sources-access.md +0 -0
|
@@ -1,852 +0,0 @@
|
|
|
1
|
-
import { _ as table, c as operationCall, d as operationSection, o as operationAccessAllows } from "./operations-CD_mu_Ww.js";
|
|
2
|
-
import { t as defineOperation } from "./operation-definition-DTpNvLd8.js";
|
|
3
|
-
import { n as bindConsoleAccess, s as consoleOperationAccess } from "./access-BBHk9b5P.js";
|
|
4
|
-
import { r as loadConsoleMedia } from "./blob-eH6j0AQj.js";
|
|
5
|
-
import { a as maximumConsoleMediaRequestBytes, i as maximumConsoleDocumentRequestBytes, n as consoleDocumentActionNames, r as consoleMediaUploadRequestBytes, s as maximumConsoleRpcRequestBytes, t as consoleAttachmentRequestBytes } from "./limits-BLo31qDR.js";
|
|
6
|
-
import { i as consoleRequestError } from "./request-CQ8TkHLh.js";
|
|
7
|
-
import { n as loadConsoleRuntime } from "./runtime-CyPZMiyK.js";
|
|
8
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
|
|
9
|
-
import { n as authConsoleImpersonationOperations, r as authConsoleReadOperations, t as authConsoleActionOperations } from "./auth-operations-arLIY2_2.js";
|
|
10
|
-
import * as v from "valibot";
|
|
11
|
-
// src/console/runtime/server/operations.ts
|
|
12
|
-
function disabledConsoleFeature(feature) {
|
|
13
|
-
return Promise.reject(consoleRequestError(404, `The Console ${feature} section is disabled.`));
|
|
14
|
-
}
|
|
15
|
-
/** Document actions that only read. A read-only section grant keeps them. */
|
|
16
|
-
const consoleDocumentReadActions = /* @__PURE__ */ new Set([
|
|
17
|
-
"get",
|
|
18
|
-
"list",
|
|
19
|
-
"overview",
|
|
20
|
-
"raw",
|
|
21
|
-
"references",
|
|
22
|
-
"resolve",
|
|
23
|
-
"revisions",
|
|
24
|
-
"search",
|
|
25
|
-
"sessions"
|
|
26
|
-
]);
|
|
27
|
-
/** Media actions that only read. */
|
|
28
|
-
const consoleMediaReadActions = /* @__PURE__ */ new Set([
|
|
29
|
-
"get",
|
|
30
|
-
"info",
|
|
31
|
-
"list",
|
|
32
|
-
"usage"
|
|
33
|
-
]);
|
|
34
|
-
function legacyEvent(route, method, request, context) {
|
|
35
|
-
const id = request.id ? `/${encodeURIComponent(request.id)}` : "";
|
|
36
|
-
const url = new URL(`/_vitehub/api/${route}${id}`, "http://vitehub.local");
|
|
37
|
-
for (const [key, value] of Object.entries(request.query ?? {})) {
|
|
38
|
-
if (value === void 0) continue;
|
|
39
|
-
if (Array.isArray(value)) value.forEach((entry) => url.searchParams.append(key, entry));
|
|
40
|
-
else url.searchParams.set(key, String(value));
|
|
41
|
-
}
|
|
42
|
-
const params = {};
|
|
43
|
-
if (request.agent) params.agent = request.agent;
|
|
44
|
-
if (request.id) params.id = request.id;
|
|
45
|
-
const body = method === "POST" && request.body !== void 0 ? JSON.stringify(request.body) : void 0;
|
|
46
|
-
const event = {
|
|
47
|
-
context: Object.keys(params).length ? { params } : void 0,
|
|
48
|
-
"~standard": {
|
|
49
|
-
vendor: "vitehub-console",
|
|
50
|
-
req: new Request(url, {
|
|
51
|
-
body,
|
|
52
|
-
headers: context.request?.headers,
|
|
53
|
-
method,
|
|
54
|
-
signal: context.request?.signal
|
|
55
|
-
}),
|
|
56
|
-
res: context.response ?? {},
|
|
57
|
-
runtime: context.env ? { cloudflare: { env: context.env } } : {},
|
|
58
|
-
...context.waitUntil ? { waitUntil: context.waitUntil } : {}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return bindConsoleAccess(context.access, event);
|
|
62
|
-
}
|
|
63
|
-
const text = v.string();
|
|
64
|
-
const optionalText = v.optional(v.string());
|
|
65
|
-
const optionalCount = v.optional(v.pipe(v.number(), v.integer()));
|
|
66
|
-
const record = v.record(v.string(), v.unknown());
|
|
67
|
-
function selectionError() {
|
|
68
|
-
return consoleRequestError(400, "A valid definition section is required.");
|
|
69
|
-
}
|
|
70
|
-
function actionResult(result) {
|
|
71
|
-
if (result instanceof Response) throw consoleRequestError(result.status, "This Console access does not include this section.");
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
/** Large calls put the operation name first in the envelope, so the RPC can classify them within 64 KiB. */
|
|
75
|
-
const consoleOperationRequestBytes = {
|
|
76
|
-
"agents.invoke": consoleAttachmentRequestBytes + maximumConsoleRpcRequestBytes,
|
|
77
|
-
"documents.action": maximumConsoleDocumentRequestBytes + maximumConsoleRpcRequestBytes,
|
|
78
|
-
"media.action": maximumConsoleMediaRequestBytes + maximumConsoleRpcRequestBytes,
|
|
79
|
-
"media.upload": consoleMediaUploadRequestBytes
|
|
80
|
-
};
|
|
81
|
-
function defineConsoleOperation(definition) {
|
|
82
|
-
return defineOperation({
|
|
83
|
-
...definition,
|
|
84
|
-
user: false,
|
|
85
|
-
async run(input, context) {
|
|
86
|
-
const access = await consoleOperationAccess(context);
|
|
87
|
-
if (!operationAccessAllows(access, operationSection(definition, input), operationCall(definition, input))) throw consoleRequestError(403, "This Console access does not include this operation.");
|
|
88
|
-
await loadConsoleRuntime();
|
|
89
|
-
return definition.run(input, {
|
|
90
|
-
...context,
|
|
91
|
-
access
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
const agentsList = defineConsoleOperation({
|
|
97
|
-
cli: {
|
|
98
|
-
command: "list",
|
|
99
|
-
namespace: "agent"
|
|
100
|
-
},
|
|
101
|
-
description: "List the Agents of the app.",
|
|
102
|
-
input: v.strictObject({}),
|
|
103
|
-
kind: "read",
|
|
104
|
-
name: "agents.list",
|
|
105
|
-
run: async () => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/agents.get.js"))).listConsoleAgents(),
|
|
106
|
-
section: "agents"
|
|
107
|
-
});
|
|
108
|
-
const agentsInvoke = defineConsoleOperation({
|
|
109
|
-
cli: {
|
|
110
|
-
command: "invoke",
|
|
111
|
-
namespace: "agent",
|
|
112
|
-
positional: ["agent"]
|
|
113
|
-
},
|
|
114
|
-
description: "Start an Agent Invocation with a prompt.",
|
|
115
|
-
input: v.strictObject({
|
|
116
|
-
agent: v.pipe(text, v.minLength(1)),
|
|
117
|
-
agentRoute: v.optional(v.literal("encoded")),
|
|
118
|
-
attachments: v.optional(v.array(v.object({
|
|
119
|
-
id: text,
|
|
120
|
-
name: text
|
|
121
|
-
}))),
|
|
122
|
-
files: v.optional(v.array(v.object({
|
|
123
|
-
filename: optionalText,
|
|
124
|
-
url: text
|
|
125
|
-
}))),
|
|
126
|
-
invokerProfileId: optionalText,
|
|
127
|
-
messages: v.optional(v.array(record)),
|
|
128
|
-
prompt: text
|
|
129
|
-
}),
|
|
130
|
-
kind: "write",
|
|
131
|
-
maxRequestBytes: consoleOperationRequestBytes["agents.invoke"],
|
|
132
|
-
name: "agents.invoke",
|
|
133
|
-
run: async ({ agent, agentRoute, ...body }, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./agent-invocations.post-BAC1aHnG.js"))).default(legacyEvent(`agents/${agent}/invocations`, "POST", {
|
|
134
|
-
agent,
|
|
135
|
-
body,
|
|
136
|
-
query: { agentRoute }
|
|
137
|
-
}, context)),
|
|
138
|
-
section: "agents"
|
|
139
|
-
});
|
|
140
|
-
const channelsReplay = defineConsoleOperation({
|
|
141
|
-
cli: {
|
|
142
|
-
command: "replay",
|
|
143
|
-
namespace: "channels"
|
|
144
|
-
},
|
|
145
|
-
description: "Replay one page of a Channel's history through its trigger, or describe its history query with describe: true.",
|
|
146
|
-
input: v.strictObject({
|
|
147
|
-
agent: v.pipe(text, v.minLength(1)),
|
|
148
|
-
channel: v.pipe(text, v.minLength(1)),
|
|
149
|
-
cursor: optionalText,
|
|
150
|
-
describe: v.optional(v.boolean()),
|
|
151
|
-
dryRun: v.optional(v.boolean()),
|
|
152
|
-
force: v.optional(v.boolean()),
|
|
153
|
-
label: v.optional(v.pipe(text, v.check((label) => label.trim() !== "", "Use a label with text."), v.maxLength(512))),
|
|
154
|
-
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),
|
|
155
|
-
query: v.optional(v.record(v.string(), v.union([text, v.array(text)])))
|
|
156
|
-
}),
|
|
157
|
-
kind: "write",
|
|
158
|
-
mcp: false,
|
|
159
|
-
name: "channels.replay",
|
|
160
|
-
readOnlyWhen: (input) => input.describe === true,
|
|
161
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/channel-replay.js"))).replayConsoleChannel(input, context),
|
|
162
|
-
section: "agents"
|
|
163
|
-
});
|
|
164
|
-
const authId = v.pipe(text, v.minLength(1), v.maxLength(512));
|
|
165
|
-
const authQuery = {
|
|
166
|
-
filter: v.optional(v.picklist([
|
|
167
|
-
"all",
|
|
168
|
-
"admins",
|
|
169
|
-
"banned",
|
|
170
|
-
"agents"
|
|
171
|
-
])),
|
|
172
|
-
limit: v.optional(v.number()),
|
|
173
|
-
offset: v.optional(v.number()),
|
|
174
|
-
search: v.optional(v.pipe(text, v.maxLength(200))),
|
|
175
|
-
userId: v.optional(authId)
|
|
176
|
-
};
|
|
177
|
-
const authValue = v.union([
|
|
178
|
-
text,
|
|
179
|
-
v.number(),
|
|
180
|
-
v.boolean(),
|
|
181
|
-
v.null(),
|
|
182
|
-
v.array(text),
|
|
183
|
-
v.array(v.number())
|
|
184
|
-
]);
|
|
185
|
-
/** One read of the Auth section. The Auth Console of `@vite-hub/auth` loads on the first call. */
|
|
186
|
-
function authRead(name, description, input, read) {
|
|
187
|
-
return defineConsoleOperation({
|
|
188
|
-
description,
|
|
189
|
-
input,
|
|
190
|
-
kind: "read",
|
|
191
|
-
mcp: false,
|
|
192
|
-
name: authConsoleReadOperations[name],
|
|
193
|
-
run: async (value, context) => (await (import.meta.viteHubConsoleAuth === false ? disabledConsoleFeature("Auth") : import("./console/runtime/server/auth.js"))).runAuthConsoleRead(context, (api, request) => read(api, request, value)),
|
|
194
|
-
section: "auth"
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
/** One action of the Auth section. Impersonation has its own operations, which return a one-time link. */
|
|
198
|
-
function authAction(action, description, kind, input, mutation, positional) {
|
|
199
|
-
return defineConsoleOperation({
|
|
200
|
-
cli: { positional: [positional] },
|
|
201
|
-
description,
|
|
202
|
-
input,
|
|
203
|
-
kind,
|
|
204
|
-
mcp: false,
|
|
205
|
-
name: authConsoleActionOperations[action],
|
|
206
|
-
run: async (value, context) => (await (import.meta.viteHubConsoleAuth === false ? disabledConsoleFeature("Auth") : import("./console/runtime/server/auth.js"))).runAuthConsoleAction(context, mutation(value)),
|
|
207
|
-
section: "auth"
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
const authOperations = [
|
|
211
|
-
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)),
|
|
212
|
-
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()),
|
|
213
|
-
authRead("activity", "List recent Auth events, newest first, one page at a time.", v.strictObject({
|
|
214
|
-
cursor: v.optional(v.pipe(text, v.maxLength(2048))),
|
|
215
|
-
group: v.optional(v.picklist([
|
|
216
|
-
"sign-in",
|
|
217
|
-
"admin",
|
|
218
|
-
"agents",
|
|
219
|
-
"organizations"
|
|
220
|
-
])),
|
|
221
|
-
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(200))),
|
|
222
|
-
userId: v.optional(authId)
|
|
223
|
-
}), (api, _request, input) => api.activity(input)),
|
|
224
|
-
authRead("users", "List the users of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.users(input)),
|
|
225
|
-
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)),
|
|
226
|
-
authRead("sessions", "List the active sessions of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.sessions(input)),
|
|
227
|
-
authRead("organizations", "List the organizations of the app, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.organizations(input)),
|
|
228
|
-
authRead("organization", "Read one organization with its members and invitations, one page at a time.", v.strictObject({
|
|
229
|
-
...authQuery,
|
|
230
|
-
id: authId
|
|
231
|
-
}), (api, _request, { id, ...query }) => api.organization(id, query)),
|
|
232
|
-
authRead("agents", "List the Agent clients that users granted access, one page at a time.", v.strictObject(authQuery), (api, _request, input) => api.agents(input)),
|
|
233
|
-
authAction("ban", "Ban a user, with an optional reason and expiry in seconds.", "write", v.strictObject({
|
|
234
|
-
expiresIn: v.optional(v.number()),
|
|
235
|
-
reason: v.optional(v.pipe(text, v.maxLength(1e3))),
|
|
236
|
-
userId: authId
|
|
237
|
-
}), (input) => ({
|
|
238
|
-
action: "ban",
|
|
239
|
-
...input
|
|
240
|
-
}), "userId"),
|
|
241
|
-
authAction("unban", "Lift the ban of a user.", "write", v.strictObject({ userId: authId }), (input) => ({
|
|
242
|
-
action: "unban",
|
|
243
|
-
...input
|
|
244
|
-
}), "userId"),
|
|
245
|
-
authAction("remove", "Delete a user and its sessions and accounts.", "destructive", v.strictObject({ userId: authId }), (input) => ({
|
|
246
|
-
action: "remove",
|
|
247
|
-
...input
|
|
248
|
-
}), "userId"),
|
|
249
|
-
authAction("revokeSessions", "Sign a user out of every session.", "destructive", v.strictObject({ userId: authId }), (input) => ({
|
|
250
|
-
action: "revokeSessions",
|
|
251
|
-
...input
|
|
252
|
-
}), "userId"),
|
|
253
|
-
authAction("setRole", "Set the role of a user.", "write", v.strictObject({
|
|
254
|
-
role: authId,
|
|
255
|
-
userId: authId
|
|
256
|
-
}), (input) => ({
|
|
257
|
-
action: "setRole",
|
|
258
|
-
...input
|
|
259
|
-
}), "userId"),
|
|
260
|
-
authAction("editField", "Change one field of a user.", "write", v.strictObject({
|
|
261
|
-
field: authId,
|
|
262
|
-
userId: authId,
|
|
263
|
-
value: authValue
|
|
264
|
-
}), (input) => ({
|
|
265
|
-
action: "editField",
|
|
266
|
-
...input
|
|
267
|
-
}), "userId"),
|
|
268
|
-
authAction("revokeSession", "End one session.", "destructive", v.strictObject({ id: authId }), (input) => ({
|
|
269
|
-
action: "revokeSession",
|
|
270
|
-
...input
|
|
271
|
-
}), "id"),
|
|
272
|
-
authAction("revokeConsent", "Revoke the access that a user granted an Agent client.", "destructive", v.strictObject({ id: authId }), (input) => ({
|
|
273
|
-
action: "revokeConsent",
|
|
274
|
-
...input
|
|
275
|
-
}), "id"),
|
|
276
|
-
defineConsoleOperation({
|
|
277
|
-
description: "Return a one-time link that opens the app in the browser as a user. The browser must be signed in to the app with the email of the person who asks.",
|
|
278
|
-
input: v.strictObject({ userId: authId }),
|
|
279
|
-
kind: "write",
|
|
280
|
-
mcp: false,
|
|
281
|
-
name: authConsoleImpersonationOperations.start,
|
|
282
|
-
run: async ({ userId }, context) => (await (import.meta.viteHubConsoleAuth === false ? disabledConsoleFeature("Auth") : import("./console/runtime/server/auth.js"))).issueImpersonationTicket(context, userId),
|
|
283
|
-
section: "auth"
|
|
284
|
-
}),
|
|
285
|
-
defineConsoleOperation({
|
|
286
|
-
description: "Return a one-time link that ends the impersonation of the browser that opens it and restores the administrator's session.",
|
|
287
|
-
input: v.strictObject({}),
|
|
288
|
-
kind: "write",
|
|
289
|
-
mcp: false,
|
|
290
|
-
name: authConsoleImpersonationOperations.stop,
|
|
291
|
-
run: async (_input, context) => (await (import.meta.viteHubConsoleAuth === false ? disabledConsoleFeature("Auth") : import("./console/runtime/server/auth.js"))).issueImpersonationTicket(context),
|
|
292
|
-
section: "auth"
|
|
293
|
-
})
|
|
294
|
-
];
|
|
295
|
-
const databasesBrowse = defineConsoleOperation({
|
|
296
|
-
cli: {
|
|
297
|
-
namespace: "database",
|
|
298
|
-
command: "rows",
|
|
299
|
-
positional: ["table"]
|
|
300
|
-
},
|
|
301
|
-
description: "Read the rows of a database table, one page at a time. Without a table it reads the tables only.",
|
|
302
|
-
input: v.strictObject({
|
|
303
|
-
database: optionalText,
|
|
304
|
-
direction: v.optional(v.picklist(["asc", "desc"])),
|
|
305
|
-
limit: optionalCount,
|
|
306
|
-
offset: optionalCount,
|
|
307
|
-
search: optionalText,
|
|
308
|
-
sort: optionalText,
|
|
309
|
-
table: optionalText
|
|
310
|
-
}),
|
|
311
|
-
kind: "read",
|
|
312
|
-
name: "databases.browse",
|
|
313
|
-
run: async (input, context) => {
|
|
314
|
-
const result = await (await (import.meta.viteHubConsoleDatabase === false ? disabledConsoleFeature("Database") : import("./console/runtime/server/database.get.js"))).browseConsoleDatabase(input);
|
|
315
|
-
if (input.table && context.surface !== "console" && result.table !== input.table) throw consoleRequestError(404, `The database has no table "${input.table}".`);
|
|
316
|
-
return result;
|
|
317
|
-
},
|
|
318
|
-
section: "databases"
|
|
319
|
-
});
|
|
320
|
-
const databasesTables = defineConsoleOperation({
|
|
321
|
-
cli: {
|
|
322
|
-
namespace: "database",
|
|
323
|
-
command: "tables"
|
|
324
|
-
},
|
|
325
|
-
description: "List the tables of a database with their columns and relationships.",
|
|
326
|
-
input: v.strictObject({ database: optionalText }),
|
|
327
|
-
kind: "read",
|
|
328
|
-
name: "databases.tables",
|
|
329
|
-
run: async (input) => {
|
|
330
|
-
const { database, databases, relationships, tables } = await (await (import.meta.viteHubConsoleDatabase === false ? disabledConsoleFeature("Database") : import("./console/runtime/server/database.get.js"))).browseConsoleDatabase(input);
|
|
331
|
-
return {
|
|
332
|
-
database,
|
|
333
|
-
databases,
|
|
334
|
-
relationships,
|
|
335
|
-
tables
|
|
336
|
-
};
|
|
337
|
-
},
|
|
338
|
-
section: "databases"
|
|
339
|
-
});
|
|
340
|
-
const definitionsList = defineConsoleOperation({
|
|
341
|
-
cli: false,
|
|
342
|
-
description: "Read the definitions of one Console section.",
|
|
343
|
-
input: v.strictObject({ section: text }),
|
|
344
|
-
kind: "read",
|
|
345
|
-
name: "definitions.list",
|
|
346
|
-
run: async ({ section }, context) => {
|
|
347
|
-
if (!section) throw selectionError();
|
|
348
|
-
return (await import("./console/runtime/server/definitions.get.js")).listConsoleDefinitions({ section }, context.access);
|
|
349
|
-
},
|
|
350
|
-
section: (input) => input.section
|
|
351
|
-
});
|
|
352
|
-
const documentsAction = defineConsoleOperation({
|
|
353
|
-
mcp: false,
|
|
354
|
-
description: "Run one document editor action of a Console section.",
|
|
355
|
-
input: v.strictObject({
|
|
356
|
-
action: v.picklist(consoleDocumentActionNames),
|
|
357
|
-
body: v.optional(v.unknown()),
|
|
358
|
-
section: text
|
|
359
|
-
}),
|
|
360
|
-
kind: "write",
|
|
361
|
-
maxRequestBytes: consoleOperationRequestBytes["documents.action"],
|
|
362
|
-
readOnlyWhen: ({ action, body }) => action === "session" ? typeof body === "object" && body !== null && "action" in body && (body.action === "report" || body.action === "release") : consoleDocumentReadActions.has(action),
|
|
363
|
-
name: "documents.action",
|
|
364
|
-
run: async ({ action, body, section }, context) => {
|
|
365
|
-
const documents = await (import.meta.viteHubConsoleDocuments === false ? disabledConsoleFeature("document editor") : import("./console/runtime/server/documents.js"));
|
|
366
|
-
if (body === void 0) {
|
|
367
|
-
const actions = await documents.loadConsoleDocumentActions(section);
|
|
368
|
-
const user = await documents.consoleDocumentActionContext(context.access);
|
|
369
|
-
return await documents.runConsoleDocumentAction(() => actions[action](body, user)) ?? null;
|
|
370
|
-
}
|
|
371
|
-
return actionResult(await documents.default(legacyEvent("documents", "POST", {
|
|
372
|
-
body,
|
|
373
|
-
query: {
|
|
374
|
-
action,
|
|
375
|
-
section
|
|
376
|
-
}
|
|
377
|
-
}, context))).value;
|
|
378
|
-
},
|
|
379
|
-
section: (input) => input.section
|
|
380
|
-
});
|
|
381
|
-
const documentsPreview = defineConsoleOperation({
|
|
382
|
-
mcp: false,
|
|
383
|
-
description: "Return a one-time link that opens the page of a document with its draft, on the app origin.",
|
|
384
|
-
input: v.strictObject({
|
|
385
|
-
collection: v.pipe(text, v.minLength(1)),
|
|
386
|
-
id: v.pipe(text, v.minLength(1)),
|
|
387
|
-
section: text
|
|
388
|
-
}),
|
|
389
|
-
kind: "read",
|
|
390
|
-
name: "documents.preview",
|
|
391
|
-
run: async ({ collection, id, section }, context) => (await (import.meta.viteHubConsoleDocuments === false ? disabledConsoleFeature("document editor") : import("./console/runtime/server/documents.js"))).issueConsoleDocumentPreview(context, {
|
|
392
|
-
collection,
|
|
393
|
-
id,
|
|
394
|
-
section
|
|
395
|
-
}),
|
|
396
|
-
section: (input) => input.section
|
|
397
|
-
});
|
|
398
|
-
const envGet = defineConsoleOperation({
|
|
399
|
-
description: "Read the Server Env declarations. `env.inspect` reads the status of their values.",
|
|
400
|
-
input: v.strictObject({}),
|
|
401
|
-
kind: "read",
|
|
402
|
-
name: "env.get",
|
|
403
|
-
run: async (_input, context) => (await import("./console/runtime/server/env.get.js")).default(legacyEvent("env", "GET", {}, context)),
|
|
404
|
-
section: "env"
|
|
405
|
-
});
|
|
406
|
-
const invocationsList = defineConsoleOperation({
|
|
407
|
-
cli: false,
|
|
408
|
-
description: "List Agent Invocations, newest first.",
|
|
409
|
-
input: v.strictObject({
|
|
410
|
-
agent: optionalText,
|
|
411
|
-
capability: optionalText,
|
|
412
|
-
cursor: optionalText,
|
|
413
|
-
id: v.optional(v.array(text)),
|
|
414
|
-
limit: optionalCount,
|
|
415
|
-
triggeredBy: optionalText
|
|
416
|
-
}),
|
|
417
|
-
kind: "read",
|
|
418
|
-
name: "invocations.list",
|
|
419
|
-
run: async (input) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocations.get.js"))).listConsoleInvocations(input),
|
|
420
|
-
section: "agents"
|
|
421
|
-
});
|
|
422
|
-
const invocationsGet = defineConsoleOperation({
|
|
423
|
-
cli: false,
|
|
424
|
-
description: "Read one Agent Invocation with its observations.",
|
|
425
|
-
input: v.strictObject({
|
|
426
|
-
id: v.pipe(text, v.minLength(1)),
|
|
427
|
-
observationCount: optionalCount,
|
|
428
|
-
observationCursor: optionalText
|
|
429
|
-
}),
|
|
430
|
-
kind: "read",
|
|
431
|
-
name: "invocations.get",
|
|
432
|
-
run: async ({ id, ...query }, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocation.get.js"))).default(legacyEvent("invocations", "GET", {
|
|
433
|
-
id,
|
|
434
|
-
query
|
|
435
|
-
}, context)),
|
|
436
|
-
section: "agents"
|
|
437
|
-
});
|
|
438
|
-
const invocationsCancel = defineConsoleOperation({
|
|
439
|
-
cli: false,
|
|
440
|
-
description: "Ask a running Agent Invocation to stop.",
|
|
441
|
-
input: v.strictObject({ id: v.pipe(text, v.minLength(1)) }),
|
|
442
|
-
kind: "write",
|
|
443
|
-
name: "invocations.cancel",
|
|
444
|
-
run: async ({ id }, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocation.get.js"))).default(legacyEvent("invocations", "POST", {
|
|
445
|
-
body: { action: "cancel" },
|
|
446
|
-
id
|
|
447
|
-
}, context)),
|
|
448
|
-
section: "agents"
|
|
449
|
-
});
|
|
450
|
-
const invocationsUndo = defineConsoleOperation({
|
|
451
|
-
cli: false,
|
|
452
|
-
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.",
|
|
453
|
-
input: v.strictObject({
|
|
454
|
-
change: v.pipe(text, v.minLength(1)),
|
|
455
|
-
id: v.pipe(text, v.minLength(1))
|
|
456
|
-
}),
|
|
457
|
-
kind: "write",
|
|
458
|
-
name: "invocations.undo",
|
|
459
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./invocation-page-undo-BEi-rO0Q.js"))).undoConsolePageChange(input, context),
|
|
460
|
-
section: "agents"
|
|
461
|
-
});
|
|
462
|
-
const invocationsDelete = defineConsoleOperation({
|
|
463
|
-
cli: false,
|
|
464
|
-
description: "Delete one finished Agent Invocation.",
|
|
465
|
-
input: v.strictObject({ id: v.pipe(text, v.minLength(1)) }),
|
|
466
|
-
kind: "destructive",
|
|
467
|
-
name: "invocations.delete",
|
|
468
|
-
run: async ({ id }, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocation.get.js"))).default(legacyEvent("invocations", "POST", {
|
|
469
|
-
body: { action: "delete" },
|
|
470
|
-
id
|
|
471
|
-
}, context)),
|
|
472
|
-
section: "agents"
|
|
473
|
-
});
|
|
474
|
-
const invocationsCapabilities = defineConsoleOperation({
|
|
475
|
-
cli: false,
|
|
476
|
-
description: "List the capabilities of an Agent Invocation setup.",
|
|
477
|
-
input: v.strictObject({ agent: optionalText }),
|
|
478
|
-
kind: "read",
|
|
479
|
-
name: "invocations.capabilities",
|
|
480
|
-
run: async (input) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocation-capabilities.get.js"))).listConsoleInvocationCapabilities(input),
|
|
481
|
-
section: "agents"
|
|
482
|
-
});
|
|
483
|
-
const invocationsWorkspace = defineConsoleOperation({
|
|
484
|
-
cli: false,
|
|
485
|
-
description: "Read the Workspace files and history of one Agent Invocation.",
|
|
486
|
-
input: v.strictObject({
|
|
487
|
-
cursor: optionalText,
|
|
488
|
-
history: v.optional(v.boolean()),
|
|
489
|
-
id: v.pipe(text, v.minLength(1)),
|
|
490
|
-
path: optionalText,
|
|
491
|
-
ref: optionalText,
|
|
492
|
-
revision: optionalText
|
|
493
|
-
}),
|
|
494
|
-
kind: "read",
|
|
495
|
-
name: "invocations.workspace",
|
|
496
|
-
run: async ({ id, history, ...query }, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/invocation-workspace.get.js"))).default(legacyEvent("invocation-workspace", "GET", {
|
|
497
|
-
id,
|
|
498
|
-
query: {
|
|
499
|
-
...query,
|
|
500
|
-
history: history ? "1" : void 0
|
|
501
|
-
}
|
|
502
|
-
}, context)),
|
|
503
|
-
section: "agents"
|
|
504
|
-
});
|
|
505
|
-
const workspacesFiles = defineConsoleOperation({
|
|
506
|
-
cli: {
|
|
507
|
-
namespace: "workspaces",
|
|
508
|
-
positional: ["name"]
|
|
509
|
-
},
|
|
510
|
-
description: "Read the files, refs, and revisions of one Workspace, and its changes since main.",
|
|
511
|
-
input: v.strictObject({
|
|
512
|
-
cursor: optionalText,
|
|
513
|
-
name: v.pipe(text, v.minLength(1)),
|
|
514
|
-
path: optionalText,
|
|
515
|
-
ref: optionalText,
|
|
516
|
-
revision: optionalText
|
|
517
|
-
}),
|
|
518
|
-
kind: "read",
|
|
519
|
-
name: "workspaces.files",
|
|
520
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleWorkspaces === false ? disabledConsoleFeature("Workspaces") : import("./console/runtime/server/workspace-files.get.js"))).default(legacyEvent("workspace-files", "GET", { query: input }, context)),
|
|
521
|
-
section: "workspaces"
|
|
522
|
-
});
|
|
523
|
-
const logsList = defineConsoleOperation({
|
|
524
|
-
description: "Read structured events from the connected log source.",
|
|
525
|
-
input: v.strictObject({
|
|
526
|
-
text: optionalText,
|
|
527
|
-
level: v.optional(v.picklist([
|
|
528
|
-
"debug",
|
|
529
|
-
"info",
|
|
530
|
-
"warn",
|
|
531
|
-
"error"
|
|
532
|
-
])),
|
|
533
|
-
service: optionalText,
|
|
534
|
-
cursor: optionalText,
|
|
535
|
-
limit: optionalCount
|
|
536
|
-
}),
|
|
537
|
-
kind: "read",
|
|
538
|
-
name: "logs.list",
|
|
539
|
-
run: async (input, context) => (await import("./console/runtime/server/logs.get.js")).readConsoleLogs(legacyEvent("logs", "GET", { query: input }, context)),
|
|
540
|
-
section: "logs"
|
|
541
|
-
});
|
|
542
|
-
const mediaAction = defineConsoleOperation({
|
|
543
|
-
mcp: false,
|
|
544
|
-
description: "Run one media library action of a Console section.",
|
|
545
|
-
input: v.strictObject({
|
|
546
|
-
action: text,
|
|
547
|
-
body: v.optional(v.unknown()),
|
|
548
|
-
section: text
|
|
549
|
-
}),
|
|
550
|
-
kind: "write",
|
|
551
|
-
maxRequestBytes: consoleOperationRequestBytes["media.action"],
|
|
552
|
-
readOnlyWhen: ({ action }) => consoleMediaReadActions.has(action),
|
|
553
|
-
name: "media.action",
|
|
554
|
-
run: async ({ action, body, section }, context) => (await (import.meta.viteHubConsoleDocuments === false ? disabledConsoleFeature("document editor") : loadConsoleMedia())).runConsoleMediaAction(section, action, body, context.access),
|
|
555
|
-
section: (input) => input.section
|
|
556
|
-
});
|
|
557
|
-
const mediaUpload = defineConsoleOperation({
|
|
558
|
-
mcp: false,
|
|
559
|
-
description: "Upload one file, given as base64, to the media library of a Console section.",
|
|
560
|
-
input: v.strictObject({
|
|
561
|
-
contentType: optionalText,
|
|
562
|
-
crop: optionalText,
|
|
563
|
-
data: text,
|
|
564
|
-
filename: v.pipe(text, v.minLength(1), v.maxLength(255)),
|
|
565
|
-
folder: optionalText,
|
|
566
|
-
pathname: optionalText,
|
|
567
|
-
section: text
|
|
568
|
-
}),
|
|
569
|
-
kind: "write",
|
|
570
|
-
maxRequestBytes: consoleOperationRequestBytes["media.upload"],
|
|
571
|
-
name: "media.upload",
|
|
572
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleDocuments === false ? disabledConsoleFeature("document editor") : loadConsoleMedia())).uploadConsoleMedia(input, context.access),
|
|
573
|
-
section: (input) => input.section
|
|
574
|
-
});
|
|
575
|
-
const projectGet = defineConsoleOperation({
|
|
576
|
-
cli: {
|
|
577
|
-
command: "get",
|
|
578
|
-
namespace: "project"
|
|
579
|
-
},
|
|
580
|
-
description: "Read the project: its name, the vite-hub version, the time and Git commit of its production build, its open Comments threads, and the sections and operations that this access may use.",
|
|
581
|
-
input: v.strictObject({}),
|
|
582
|
-
kind: "read",
|
|
583
|
-
name: "project.get",
|
|
584
|
-
run: async (_input, context) => (await import("./project-BxyyclTE.js")).readConsoleProject(context, { navigation: context.surface === "console" }),
|
|
585
|
-
section: false
|
|
586
|
-
});
|
|
587
|
-
const searchQuery = defineConsoleOperation({
|
|
588
|
-
cli: {
|
|
589
|
-
namespace: "search",
|
|
590
|
-
command: "query",
|
|
591
|
-
positional: ["search"]
|
|
592
|
-
},
|
|
593
|
-
description: "Search the Agent Invocations of the Console.",
|
|
594
|
-
input: v.strictObject({
|
|
595
|
-
cursor: optionalText,
|
|
596
|
-
limit: optionalCount,
|
|
597
|
-
search: optionalText
|
|
598
|
-
}),
|
|
599
|
-
kind: "read",
|
|
600
|
-
name: "search.query",
|
|
601
|
-
run: async (input) => {
|
|
602
|
-
const url = new URL("http://vitehub.local/_vitehub/api/search");
|
|
603
|
-
for (const [key, value] of Object.entries(input)) if (value !== void 0) url.searchParams.set(key, String(value));
|
|
604
|
-
const response = await (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/search.get.js"))).consoleSearchCollectionHandler.fetch(new Request(url));
|
|
605
|
-
if (!response.ok) throw await searchError(response);
|
|
606
|
-
return await response.json();
|
|
607
|
-
},
|
|
608
|
-
section: "agents"
|
|
609
|
-
});
|
|
610
|
-
const sectionsList = defineConsoleOperation({
|
|
611
|
-
description: "List the Console sections that this access may open.",
|
|
612
|
-
input: v.strictObject({}),
|
|
613
|
-
kind: "read",
|
|
614
|
-
name: "sections.list",
|
|
615
|
-
run: async (_input, context) => (await import("./console/runtime/server/sections.get.js")).listConsoleSections(context.access),
|
|
616
|
-
section: false
|
|
617
|
-
});
|
|
618
|
-
const skillsInspect = defineConsoleOperation({
|
|
619
|
-
description: "Inspect the bundled Skill files of an Agent, or read one exact bundled text file.",
|
|
620
|
-
input: v.strictObject({
|
|
621
|
-
agent: optionalText,
|
|
622
|
-
path: optionalText
|
|
623
|
-
}),
|
|
624
|
-
kind: "read",
|
|
625
|
-
name: "skills.inspect",
|
|
626
|
-
run: async (input) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./skills.get-DAooGWy5.js"))).inspectConsoleSkills(input),
|
|
627
|
-
section: "skills"
|
|
628
|
-
});
|
|
629
|
-
const statusGet = defineConsoleOperation({
|
|
630
|
-
cli: false,
|
|
631
|
-
description: "Read the status of an Agent: its setup and what it can do.",
|
|
632
|
-
input: v.strictObject({ agent: optionalText }),
|
|
633
|
-
kind: "read",
|
|
634
|
-
name: "status.get",
|
|
635
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/status.get.js"))).readConsoleStatus(legacyEvent("status", "GET", { query: input }, context)),
|
|
636
|
-
section: "agents"
|
|
637
|
-
});
|
|
638
|
-
const sitePagePath = v.optional(v.pipe(text, v.maxLength(2048)));
|
|
639
|
-
const siteId = v.pipe(text, v.minLength(1), v.maxLength(64));
|
|
640
|
-
const siteAccess = () => import("./site-access-Cvmjb6aw.js");
|
|
641
|
-
function formatSiteSessions({ sessions }) {
|
|
642
|
-
if (!sessions.length) return "No browser is signed in through Site access.\n";
|
|
643
|
-
return `${table([[
|
|
644
|
-
"ID",
|
|
645
|
-
"KIND",
|
|
646
|
-
"PERSON",
|
|
647
|
-
"DEVICE",
|
|
648
|
-
"LAST SEEN",
|
|
649
|
-
"EXPIRES"
|
|
650
|
-
], ...sessions.map((session) => [
|
|
651
|
-
session.id,
|
|
652
|
-
session.kind,
|
|
653
|
-
session.person.email ? `${session.person.name} <${session.person.email}>` : session.person.name,
|
|
654
|
-
session.device,
|
|
655
|
-
session.lastSeenAt,
|
|
656
|
-
session.expiresAt
|
|
657
|
-
])])}\n`;
|
|
658
|
-
}
|
|
659
|
-
function formatSiteInvites({ invites }) {
|
|
660
|
-
if (!invites.length) return "No open invites.\n";
|
|
661
|
-
return `${table([[
|
|
662
|
-
"ID",
|
|
663
|
-
"NAME",
|
|
664
|
-
"ROLES",
|
|
665
|
-
"PATH",
|
|
666
|
-
"EXPIRES",
|
|
667
|
-
"BY"
|
|
668
|
-
], ...invites.map((invite) => [
|
|
669
|
-
invite.id,
|
|
670
|
-
invite.name,
|
|
671
|
-
invite.grants.join(","),
|
|
672
|
-
invite.path,
|
|
673
|
-
invite.expiresAt,
|
|
674
|
-
invite.createdBy.name
|
|
675
|
-
])])}\n`;
|
|
676
|
-
}
|
|
677
|
-
function formatSiteGrants({ grants }) {
|
|
678
|
-
return `${table([[
|
|
679
|
-
"ROLE",
|
|
680
|
-
"LABEL",
|
|
681
|
-
"GUESTS"
|
|
682
|
-
], ...grants.map((grant) => [
|
|
683
|
-
grant.id,
|
|
684
|
-
grant.label,
|
|
685
|
-
grant.membersOnly ? "no, members only" : "yes"
|
|
686
|
-
])])}\n`;
|
|
687
|
-
}
|
|
688
|
-
/** Site access: the Console signs browsers in to the app for the page tools. See `site-access.ts`. */
|
|
689
|
-
const siteOperations = [
|
|
690
|
-
defineConsoleOperation({
|
|
691
|
-
cli: {
|
|
692
|
-
command: "open",
|
|
693
|
-
format: (ticket) => `${ticket.url}\nThe link works once, until ${ticket.expiresAt}.\n`,
|
|
694
|
-
positional: ["path"]
|
|
695
|
-
},
|
|
696
|
-
description: "Return a one-time link that signs the browser that opens it in to the app as you, with the console role, then opens the page. With qr: true, it works for 10 minutes, for a phone. With the state of GET /_vitehub, it works only in the browser that opened that route.",
|
|
697
|
-
input: v.strictObject({
|
|
698
|
-
path: sitePagePath,
|
|
699
|
-
qr: v.optional(v.boolean()),
|
|
700
|
-
state: v.optional(v.pipe(text, v.regex(/^[\w-]{43}$/)))
|
|
701
|
-
}),
|
|
702
|
-
kind: "write",
|
|
703
|
-
mcp: false,
|
|
704
|
-
name: "site.link",
|
|
705
|
-
run: async (input, context) => (await siteAccess()).linkSite(context, input),
|
|
706
|
-
section: "site"
|
|
707
|
-
}),
|
|
708
|
-
defineConsoleOperation({
|
|
709
|
-
cli: { format: formatSiteSessions },
|
|
710
|
-
description: "List the app sessions of Console members and invited guests: one per browser.",
|
|
711
|
-
input: v.strictObject({}),
|
|
712
|
-
kind: "read",
|
|
713
|
-
name: "site.sessions",
|
|
714
|
-
run: async (_input, context) => (await siteAccess()).listSessions(context),
|
|
715
|
-
section: "site"
|
|
716
|
-
}),
|
|
717
|
-
defineConsoleOperation({
|
|
718
|
-
cli: {
|
|
719
|
-
command: "revoke",
|
|
720
|
-
format: ({ removedUser }) => removedUser ? "Signed the browser out and deleted the guest.\n" : "Signed the browser out.\n",
|
|
721
|
-
positional: ["id"]
|
|
722
|
-
},
|
|
723
|
-
description: "Sign one browser out. Revoking a guest's browser deletes the guest.",
|
|
724
|
-
input: v.strictObject({ id: siteId }),
|
|
725
|
-
kind: "destructive",
|
|
726
|
-
name: "site.revoke-session",
|
|
727
|
-
run: async ({ id }, context) => (await siteAccess()).revokeSession(context, id),
|
|
728
|
-
section: "site"
|
|
729
|
-
}),
|
|
730
|
-
defineConsoleOperation({
|
|
731
|
-
cli: {
|
|
732
|
-
format: ({ url, invite }) => `${url}\nThe link works once, in one browser, until ${invite.expiresAt}. Revoke it with \`vitehub site revoke-invite ${invite.id}\`.\n`,
|
|
733
|
-
positional: ["name"]
|
|
734
|
-
},
|
|
735
|
-
description: "Invite a guest: a one-time link that signs one browser in as a new app user with a name and roles, such as comments-write. Guests never get the Console.",
|
|
736
|
-
input: v.strictObject({
|
|
737
|
-
expiresInDays: v.optional(v.picklist([
|
|
738
|
-
1,
|
|
739
|
-
7,
|
|
740
|
-
30
|
|
741
|
-
])),
|
|
742
|
-
grants: v.pipe(v.array(v.pipe(text, v.maxLength(128))), v.maxLength(32)),
|
|
743
|
-
name: v.pipe(text, v.maxLength(64)),
|
|
744
|
-
path: sitePagePath
|
|
745
|
-
}),
|
|
746
|
-
kind: "write",
|
|
747
|
-
mcp: false,
|
|
748
|
-
name: "site.invite",
|
|
749
|
-
run: async (input, context) => (await siteAccess()).inviteGuest(context, input),
|
|
750
|
-
section: "site"
|
|
751
|
-
}),
|
|
752
|
-
defineConsoleOperation({
|
|
753
|
-
cli: { format: formatSiteInvites },
|
|
754
|
-
description: "List the guest invites that nobody opened yet.",
|
|
755
|
-
input: v.strictObject({}),
|
|
756
|
-
kind: "read",
|
|
757
|
-
name: "site.invites",
|
|
758
|
-
run: async (_input, context) => (await siteAccess()).listInvites(context),
|
|
759
|
-
section: "site"
|
|
760
|
-
}),
|
|
761
|
-
defineConsoleOperation({
|
|
762
|
-
cli: {
|
|
763
|
-
format: () => "Revoked the invite.\n",
|
|
764
|
-
positional: ["id"]
|
|
765
|
-
},
|
|
766
|
-
description: "Revoke a guest invite that nobody opened yet.",
|
|
767
|
-
input: v.strictObject({ id: siteId }),
|
|
768
|
-
kind: "destructive",
|
|
769
|
-
name: "site.revoke-invite",
|
|
770
|
-
run: async ({ id }, context) => (await siteAccess()).revokeInvite(context, id),
|
|
771
|
-
section: "site"
|
|
772
|
-
}),
|
|
773
|
-
defineConsoleOperation({
|
|
774
|
-
cli: { format: formatSiteGrants },
|
|
775
|
-
description: "List the roles that Site access gives. Console is for members only.",
|
|
776
|
-
input: v.strictObject({}),
|
|
777
|
-
kind: "read",
|
|
778
|
-
name: "site.grants",
|
|
779
|
-
run: async () => (await siteAccess()).listGrants(),
|
|
780
|
-
section: "site"
|
|
781
|
-
})
|
|
782
|
-
];
|
|
783
|
-
const usageGet = defineConsoleOperation({
|
|
784
|
-
cli: {
|
|
785
|
-
command: "usage",
|
|
786
|
-
namespace: "agent"
|
|
787
|
-
},
|
|
788
|
-
description: "Read token use and cost evidence of Agent Invocations.",
|
|
789
|
-
input: v.strictObject({
|
|
790
|
-
agent: optionalText,
|
|
791
|
-
cursor: optionalText,
|
|
792
|
-
search: optionalText,
|
|
793
|
-
status: optionalText,
|
|
794
|
-
window: optionalText
|
|
795
|
-
}),
|
|
796
|
-
kind: "read",
|
|
797
|
-
name: "usage.get",
|
|
798
|
-
run: async (input, context) => (await (import.meta.viteHubConsoleAgents === false ? disabledConsoleFeature("Agents") : import("./console/runtime/server/usage.get.js"))).readConsoleUsage(legacyEvent("usage", "GET", { query: input }, context)),
|
|
799
|
-
section: "usage"
|
|
800
|
-
});
|
|
801
|
-
async function searchError(response) {
|
|
802
|
-
const body = await response.text();
|
|
803
|
-
let message = body;
|
|
804
|
-
try {
|
|
805
|
-
const parsed = v.safeParse(v.object({
|
|
806
|
-
message: v.optional(v.unknown()),
|
|
807
|
-
statusMessage: v.optional(v.unknown())
|
|
808
|
-
}), JSON.parse(body));
|
|
809
|
-
if (parsed.success) {
|
|
810
|
-
const statusMessage = v.safeParse(v.string(), parsed.output.statusMessage);
|
|
811
|
-
const responseMessage = v.safeParse(v.string(), parsed.output.message);
|
|
812
|
-
if (statusMessage.success) message = statusMessage.output;
|
|
813
|
-
else if (responseMessage.success) message = responseMessage.output;
|
|
814
|
-
}
|
|
815
|
-
} catch {}
|
|
816
|
-
return Object.assign(viteHubErrorDiagnostics.VITE_HUB_R0052({ message }), {
|
|
817
|
-
statusCode: response.status,
|
|
818
|
-
statusMessage: message
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
/** The operations that `vite-hub` owns for the Console sections. Packages contribute their own through plugin metadata. */
|
|
822
|
-
const consoleOperations = [
|
|
823
|
-
agentsInvoke,
|
|
824
|
-
agentsList,
|
|
825
|
-
...authOperations,
|
|
826
|
-
channelsReplay,
|
|
827
|
-
databasesBrowse,
|
|
828
|
-
databasesTables,
|
|
829
|
-
definitionsList,
|
|
830
|
-
documentsAction,
|
|
831
|
-
documentsPreview,
|
|
832
|
-
envGet,
|
|
833
|
-
invocationsCancel,
|
|
834
|
-
invocationsUndo,
|
|
835
|
-
invocationsCapabilities,
|
|
836
|
-
invocationsDelete,
|
|
837
|
-
invocationsGet,
|
|
838
|
-
invocationsList,
|
|
839
|
-
invocationsWorkspace,
|
|
840
|
-
workspacesFiles,
|
|
841
|
-
logsList,
|
|
842
|
-
mediaAction,
|
|
843
|
-
mediaUpload,
|
|
844
|
-
projectGet,
|
|
845
|
-
searchQuery,
|
|
846
|
-
sectionsList,
|
|
847
|
-
...siteOperations,
|
|
848
|
-
skillsInspect,
|
|
849
|
-
statusGet,
|
|
850
|
-
usageGet
|
|
851
|
-
];
|
|
852
|
-
export { consoleOperations as n, defineConsoleOperation as r, consoleOperationRequestBytes as t };
|