vite-hub 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/_internal/runtime/browser-errors.d.ts +0 -2
- package/dist/_internal/runtime/browser-errors.js +3 -4
- package/dist/_internal/runtime/redirects.d.ts +1 -2
- package/dist/_internal/runtime/redirects.js +2 -3
- package/dist/_internal/runtime/request-policy.d.ts +1 -2
- package/dist/_internal/runtime/request-policy.js +2 -3
- package/dist/_internal/runtime/security.d.ts +1 -2
- package/dist/_internal/runtime/security.js +1 -2
- package/dist/{access-BC9HtX_M.js → access-CUFHPi8T.js} +13 -140
- package/dist/{access-policy-DhsEACna.d.ts → access-DkBck8Vu.d.ts} +17 -21
- package/dist/{access-policy-CVZg9LPR.js → access-policy-BM48XstY.js} +5 -6
- package/dist/{account-Cjj-tYzo.d.ts → account-DNr8fHcQ.d.ts} +5 -7
- package/dist/{console/runtime/server → agent/console}/agents.get.d.ts +2 -3
- package/dist/{console/runtime/server → agent/console}/agents.get.js +3 -4
- package/dist/{console/runtime/server → agent/console}/channel-replay.d.ts +3 -5
- package/dist/{console/runtime/server → agent/console}/channel-replay.js +6 -7
- package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.d.ts +1 -3
- package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.js +4 -5
- package/dist/agent/console/invocation-workspace.get.d.ts +6 -0
- package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.js +6 -7
- package/dist/{console/runtime/server → agent/console}/invocation.get.d.ts +4 -6
- package/dist/{console/runtime/server → agent/console}/invocation.get.js +8 -9
- package/dist/{console/runtime/server → agent/console}/invocations.get.d.ts +1 -2
- package/dist/{console/runtime/server → agent/console}/invocations.get.js +5 -6
- package/dist/agent/console/invocations.usage.d.ts +6 -0
- 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 -4
- package/dist/{console/runtime/server → agent/console}/status.get.js +6 -7
- package/dist/{server-W0c79AYZ.js → agent-console-CHsLxKk_.js} +4 -4
- package/dist/agent-console-FmaYpVv-.d.ts +14 -0
- package/dist/{agent-invocations.post-C3Onl2yH.js → agent-invocations.post-CF5anHY6.js} +14 -17
- package/dist/agents-DBm_PJie.js +1 -0
- package/dist/{agents-B76RICcy.js → agents-DXLHsE7x.js} +5 -6
- package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
- package/dist/auth/console/auth.d.ts +25 -0
- package/dist/{console/runtime/server → auth/console}/auth.js +11 -13
- package/dist/auth/console/operations.d.ts +3 -0
- package/dist/auth/console/operations.js +135 -0
- package/dist/auth/server.js +1 -2
- package/dist/{auth-operations-GcQk0O0X.js → auth-operations-BKqoX8Ua.js} +4 -5
- package/dist/{auth-types-D3ugQ8xM.d.ts → auth-types-Cotn7406.d.ts} +4 -21
- package/dist/bin.js +8 -11
- package/dist/blob/console/operations.d.ts +3 -0
- package/dist/blob/console/operations.js +44 -0
- package/dist/blob/nuxt-image.js +1 -2
- package/dist/{blob-BcgsZtqM.js → blob-iw8pWQ6o.js} +5 -6
- package/dist/{blob-iVewd7KQ.d.ts → blob-uNin0_TV.d.ts} +1 -3
- package/dist/{browser-error-limits-CToqAD-O.js → browser-error-limits-B0yS95zt.js} +2 -4
- package/dist/cache/operations.d.ts +2 -4
- package/dist/cache/operations.js +3 -4
- package/dist/cache.d.ts +1 -3
- package/dist/cache.js +2 -3
- package/dist/{cli-config-FPHk1nbC.js → cli-config-BX8H4ZCo.js} +2 -3
- package/dist/cli-config-DgpmE_7z.js +1 -0
- package/dist/cms.js +1 -2
- package/dist/console/auth-types.d.ts +2 -2
- package/dist/console/auth.d.ts +2 -4
- package/dist/console/auth.js +2 -3
- package/dist/console/runtime/auth-operations.d.ts +4 -6
- package/dist/console/runtime/auth-operations.js +1 -2
- package/dist/console/runtime/client/account-views.d.ts +1 -3
- package/dist/console/runtime/client/account-views.js +1 -2
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +29 -45
- package/dist/console/runtime/client/appearance.d.ts +1 -2
- package/dist/console/runtime/client/appearance.js +1 -2
- package/dist/console/runtime/client/auth-management.ts +6 -6
- package/dist/console/runtime/client/blob-media.d.ts +2 -4
- package/dist/console/runtime/client/blob-media.js +5 -6
- package/dist/console/runtime/client/comment-thread.d.ts +1 -3
- package/dist/console/runtime/client/comment-thread.js +3 -4
- package/dist/console/runtime/client/content-heads.d.ts +1 -2
- package/dist/console/runtime/client/content-heads.js +2 -3
- package/dist/console/runtime/client/documents.d.ts +2 -2
- package/dist/console/runtime/client/documents.js +1 -2
- package/dist/console/runtime/client/editor.d.ts +3 -5
- package/dist/console/runtime/client/editor.js +1 -2
- package/dist/console/runtime/client/env-groups.d.ts +1 -3
- package/dist/console/runtime/client/env-groups.js +1 -2
- package/dist/console/runtime/client/env-status.d.ts +1 -3
- package/dist/console/runtime/client/env-status.js +1 -2
- package/dist/console/runtime/client/format.d.ts +1 -3
- package/dist/console/runtime/client/format.js +1 -2
- package/dist/console/runtime/client/invocation-deletion.d.ts +1 -2
- package/dist/console/runtime/client/invocation-deletion.js +1 -2
- package/dist/console/runtime/client/invocation.d.ts +1 -2
- package/dist/console/runtime/client/invocation.js +4 -5
- package/dist/console/runtime/client/live.d.ts +2 -4
- package/dist/console/runtime/client/live.js +1 -2
- package/dist/console/runtime/client/mcp-client.d.ts +7 -5
- package/dist/console/runtime/client/mcp-client.js +10 -5
- package/dist/console/runtime/client/media-library.d.ts +1 -1
- package/dist/console/runtime/client/media-library.js +1 -2
- package/dist/console/runtime/client/media-uploads.d.ts +2 -4
- package/dist/console/runtime/client/media-uploads.js +2 -3
- package/dist/console/runtime/client/media.d.ts +1 -1
- package/dist/console/runtime/client/media.js +1 -2
- package/dist/console/runtime/client/operation-view.d.ts +2 -4
- package/dist/console/runtime/client/operation-view.js +4 -5
- package/dist/console/runtime/client/presence.d.ts +2 -4
- package/dist/console/runtime/client/presence.js +1 -2
- package/dist/console/runtime/client/preview.d.ts +1 -3
- package/dist/console/runtime/client/preview.js +1 -2
- package/dist/console/runtime/client/problem.d.ts +2 -4
- package/dist/console/runtime/client/problem.js +3 -4
- package/dist/console/runtime/client/project-link.d.ts +1 -1
- package/dist/console/runtime/client/project-link.js +1 -2
- package/dist/console/runtime/client/project-session.d.ts +19 -10
- package/dist/console/runtime/client/project-session.js +1 -723
- package/dist/console/runtime/client/project.d.ts +1 -3
- package/dist/console/runtime/client/project.js +1 -2
- package/dist/console/runtime/client/projects.d.ts +1 -1
- package/dist/console/runtime/client/projects.js +1 -2
- package/dist/console/runtime/client/publish.d.ts +2 -4
- package/dist/console/runtime/client/publish.js +1 -2
- package/dist/console/runtime/client/rate-limit.d.ts +1 -3
- package/dist/console/runtime/client/rate-limit.js +3 -4
- package/dist/console/runtime/client/read-only.d.ts +2 -4
- package/dist/console/runtime/client/read-only.js +2 -3
- package/dist/console/runtime/client/request.d.ts +2 -2
- package/dist/console/runtime/client/request.js +1 -2
- package/dist/console/runtime/client/route-query.d.ts +4 -5
- package/dist/console/runtime/client/route-query.js +1 -2
- package/dist/console/runtime/client/schedule-run.d.ts +1 -3
- package/dist/console/runtime/client/schedule-run.js +3 -4
- package/dist/console/runtime/client/schema-form.d.ts +1 -1
- package/dist/console/runtime/client/schema-form.js +1 -2
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -2
- package/dist/console/runtime/client/site-access.d.ts +83 -16
- package/dist/console/runtime/client/site-access.js +159 -32
- 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/stored.d.ts +1 -3
- package/dist/console/runtime/client/stored.js +1 -2
- package/dist/console/runtime/client/toast.d.ts +1 -3
- package/dist/console/runtime/client/toast.js +1 -2
- package/dist/console/runtime/client/workflow.d.ts +1 -3
- package/dist/console/runtime/client/workflow.js +3 -4
- package/dist/console/runtime/components/console-account-home.vue +9 -7
- package/dist/console/runtime/components/console-account-link.vue +8 -5
- package/dist/console/runtime/components/console-account-setup.vue +10 -7
- package/dist/console/runtime/components/console-account-shell.vue +7 -2
- package/dist/console/runtime/components/console-account-unlink.vue +2 -3
- package/dist/console/runtime/components/console-app-settings.vue +8 -2
- 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-hosted-comments-embed.vue +106 -0
- package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
- package/dist/console/runtime/components/console-mcp-items.vue +3 -16
- package/dist/console/runtime/components/console-site.vue +10 -8
- package/dist/console/runtime/components/console-usage.vue +2 -2
- package/dist/console/runtime/console-route.d.ts +1 -3
- package/dist/console/runtime/console-route.js +1 -2
- package/dist/console/runtime/definitions.d.ts +1 -1
- package/dist/console/runtime/definitions.js +1 -2
- package/dist/console/runtime/diagnostics.ts +14 -49
- package/dist/console/runtime/mcp-client.d.ts +2 -2
- package/dist/console/runtime/mcp-client.js +1 -2
- 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/account.js +26 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -2
- package/dist/console/runtime/rpc.d.ts +1 -1
- package/dist/console/runtime/rpc.js +1 -2
- package/dist/console/runtime/sections.d.ts +2 -2
- package/dist/console/runtime/sections.js +1 -2
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/access-policy.js +1 -2
- 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 -2
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.js +1 -2
- package/dist/console/runtime/server/definitions.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +4 -6
- package/dist/console/runtime/server/definitions.get.js +5 -6
- package/dist/console/runtime/server/definitions.js +1 -2
- package/dist/console/runtime/server/development.d.ts +1 -1
- package/dist/console/runtime/server/development.js +1 -2
- package/dist/console/runtime/server/documents.d.ts +2 -2
- package/dist/console/runtime/server/documents.js +3 -3
- 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/env.d.ts +1 -3
- package/dist/console/runtime/server/env.js +1 -2
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -2
- 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 -10
- package/dist/console/runtime/server/rpc.js +19 -27
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -2
- package/dist/console/runtime/server/sections.d.ts +5 -5
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +8 -9
- package/dist/console/runtime/server/sections.js +6 -6
- package/dist/console/runtime/server/setup.d.ts +5 -5
- package/dist/console/runtime/server/setup.js +5 -5
- 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 -9
- package/dist/console/runtime/server/site-entry.js +62 -46
- 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/runtime/skills.d.ts +1 -3
- package/dist/console/runtime/skills.js +1 -2
- package/dist/console/server.d.ts +9 -25
- package/dist/console/server.js +8 -8
- package/dist/console/ui.d.ts +0 -10
- package/dist/console/ui.js +14 -27
- package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
- package/dist/{console-route-CM2G5hiC.js → console-route-DbdnLkkF.js} +2 -3
- package/dist/console-signature--55DIKf2.js +237 -0
- package/dist/console.d.ts +1 -3
- package/dist/console.js +1 -2
- 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 +2 -3
- package/dist/{console/runtime/server → database/console}/database.get.js +4 -5
- package/dist/database/console/operations.d.ts +3 -0
- package/dist/database/console/operations.js +49 -0
- package/dist/{database-UMJgnU2z.js → database-CrgBUdIx.js} +3 -4
- package/dist/{database-DC67Ipm-.d.ts → database-yFezh5U1.d.ts} +1 -3
- package/dist/{definition-catalog-BUcclwSH.js → definition-catalog-1xPPtzOx.js} +3 -4
- package/dist/definition-catalog-M5ua7JRS.js +1 -0
- package/dist/{definitions-BW6SvmMM.js → definitions-BFYqXchw.js} +1 -2
- package/dist/{definitions-DB4LbZ7T.d.ts → definitions-ChvMnA1L.d.ts} +0 -2
- package/dist/{definitions-DTytrw42.js → definitions-DGo2rNQ9.js} +5 -6
- package/dist/{definitions-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
- package/dist/{deployment-BUshgN5Q.js → deployment-CURATxjG.js} +2 -3
- package/dist/deployment-l7RuKdEp.js +1 -0
- package/dist/{dev-peer-CHjyHYG6.js → dev-peer-CRYp01PE.js} +2 -222
- package/dist/dev-peer-CX5C9243.js +1 -0
- package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
- package/dist/{development-RnopiRwK.d.ts → development-I40mfD7B.d.ts} +1 -3
- package/dist/{diagnostics-DtR0TAmq.js → diagnostics-DLHqjKGe.js} +3 -9
- package/dist/diagnostics-DgGKvWzF.d.ts +7 -0
- package/dist/docs/nuxt.js +1 -2
- package/dist/doctor.d.ts +0 -6
- package/dist/doctor.js +11492 -12152
- package/dist/{documents-BDR0AkYR.d.ts → documents-A-7Ho0g0.d.ts} +12 -16
- package/dist/{documents-B4R4JSfH.js → documents-BduuZjm3.js} +6 -6
- package/dist/{documents-BASIRZ91.d.ts → documents-CApMRd4o.d.ts} +4 -7
- package/dist/{documents-BewAPY61.js → documents-D6ueeoUR.js} +17 -21
- package/dist/durability/operations.d.ts +2 -4
- package/dist/durability/operations.js +3 -4
- package/dist/{entries-DbyNPLC9.js → entries-UFs9n1MB.js} +2 -3
- package/dist/{console/runtime/server → env/console}/env.get.d.ts +2 -4
- package/dist/env/console/env.get.js +15 -0
- 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/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
- package/dist/{error-diagnostics-B1yAIaSn.js → error-diagnostics-CBtvqI30.js} +2 -7
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/error-diagnostics.ts +1 -7
- package/dist/{features-CC5OcZqJ.js → features-BXRKlmtN.js} +5 -6
- package/dist/features-CD5i5I8V.js +1 -0
- package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
- package/dist/{github-login-Bi3bfjRX.js → github-login-W-vaahWP.js} +1 -2
- package/dist/{host-CkL0jjBq.js → host-DeNPYIeV.js} +1 -2
- package/dist/{http-error-Bs6e8_-8.js → http-error-BorAxJYM.js} +1 -2
- package/dist/index.d.ts +1 -7
- package/dist/index.js +5 -7
- package/dist/{inspect-DbZuP_7b.js → inspect-CWwAuL-B.js} +2 -3
- package/dist/internal/agent-invocations-libsql.js +1 -2
- package/dist/internal/disabled-redis-driver.d.ts +1 -3
- package/dist/internal/disabled-redis-driver.js +2 -3
- package/dist/internal/disabled-upstash-driver.d.ts +1 -3
- package/dist/internal/disabled-upstash-driver.js +2 -3
- package/dist/internal/test-loader.d.ts +1 -3
- package/dist/internal/test-loader.js +2 -3
- package/dist/internal/test-server.js +2 -3
- package/dist/{internal-BreyUsQ6.js → internal-0C_CC601.js} +1 -2
- package/dist/{internal-Cc9N0shU.d.ts → internal-BRNf11h3.d.ts} +14 -8
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{invocation-page-undo-DqYcPlkQ.js → invocation-page-undo-DHbXczWY.js} +8 -7
- package/dist/invocations-B60XWNES.js +45 -0
- package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
- package/dist/logs/client.d.ts +1 -3
- package/dist/logs/client.js +1 -2
- package/dist/{console/runtime/server → logs/console}/logs.get.d.ts +3 -5
- package/dist/{console/runtime/server → logs/console}/logs.get.js +7 -8
- package/dist/logs/console/operations.d.ts +3 -0
- package/dist/logs/console/operations.js +23 -0
- package/dist/logs/host.d.ts +2 -4
- package/dist/logs/host.js +1 -2
- package/dist/logs/memory.d.ts +1 -1
- package/dist/logs/memory.js +1 -2
- package/dist/logs/source.d.ts +1 -1
- package/dist/logs/source.js +1 -2
- package/dist/logs.d.ts +2 -2
- package/dist/logs.js +2 -2
- 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-C_sEmyQw.d.ts → mcp-client-uXVvS7RL.d.ts} +5 -10
- package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
- package/dist/{media-D3OfyKni.js → media-CNwnh6CG.js} +8 -9
- package/dist/{media-library-o8RRsnn_.js → media-library-DTC8TLsZ.js} +5 -6
- package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
- package/dist/{memory-C54SDH_l.js → memory-D3EJS_Bp.js} +3 -4
- package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
- package/dist/{nuxt-server-auto-imports-cfTZYvgy.js → nuxt-server-auto-imports-4aT5BD4u.js} +1 -2
- package/dist/{nuxt-server-imports-75bWMeXc.js → nuxt-server-imports-BdJqiVhT.js} +1 -2
- package/dist/nuxt.d.ts +1 -3
- package/dist/nuxt.js +276 -182
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-contributions-C3lwePQu.js → operation-contributions-BU10k2QS.js} +9 -9
- package/dist/{operation-contributions-CrdmqtJW.d.ts → operation-contributions-xwjDzj28.d.ts} +6 -7
- package/dist/{operation-definition-DxjKcCGm.js → operation-definition-D04Rdjbe.js} +7 -9
- package/dist/operation-modules-BUXlwjvd.js +1 -0
- package/dist/operation-modules-DHWkPcfS.js +139 -0
- package/dist/{operation-registry-BogGwk_I.js → operation-registry-DfQbL7vE.js} +1 -2
- package/dist/{operation-rpc-DI9txNxK.js → operation-rpc-BMdfapja.js} +3 -4
- package/dist/operations-D-7ljPqw.js +1 -0
- package/dist/{operations-TTjL_7Zc.d.ts → operations-DgFhA1WE.d.ts} +0 -4
- package/dist/{operations-CFYGXqLm.js → operations-DksTrRMb.js} +4 -5
- package/dist/operations-byxiZ2R2.js +113 -0
- package/dist/{optional-owners-O6sj4uoj.js → optional-owners-Cypch7V3.js} +4 -6
- package/dist/{out-fRNaVslw.js → out-Cw5Tvr92.js} +2933 -2301
- package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
- package/dist/page/pill.iife.js +2 -2
- 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/{pathe.M-eThtNZ-J4gfe1m9.js → pathe.M-eThtNZ-D4EC7Wue.js} +1 -2
- package/dist/{plugins-DoXnU6-s.d.ts → plugins-BmkOoyIh.d.ts} +25 -110
- package/dist/{plugins-BTZQaFtZ.js → plugins-DfXcUnzN.js} +1779 -1384
- package/dist/presets/workspace.js +1 -2
- package/dist/{project-Dgyq1F1V.d.ts → project-B2qWt8on.d.ts} +3 -12
- package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
- package/dist/{project-DXZRZEPX.js → project-_juMSuAS.js} +8 -11
- package/dist/{project-link-DT99MoyU.js → project-link-CJbCkOlC.js} +7 -8
- package/dist/{project-link-bNS-KROO.d.ts → project-link-Ck3vuq9w.d.ts} +2 -4
- package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
- package/dist/project-session-8pN7pRo8.js +764 -0
- package/dist/{projects-CAcXztf4.js → projects-BRp0iseV.js} +1 -2
- package/dist/{projects-Ddvl9EJp.d.ts → projects-mgPxrKZr.d.ts} +0 -2
- package/dist/{registry-zw6aE2N9.js → registry-B8JE5NY-.js} +1 -2
- package/dist/{registry-CDKLACCZ.js → registry-CnPC-gNu.js} +1 -2
- package/dist/{request-CMA2UKKq.js → request-D769eiBL.js} +5 -6
- package/dist/{request-D7h3SQ92.d.ts → request-DYmjLTqP.d.ts} +2 -4
- package/dist/{request-SBLxvpyr.d.ts → request-DkoE0b2h.d.ts} +11 -4
- package/dist/{request-Cs0FqxEL.js → request-XFVx7CGC.js} +30 -9
- package/dist/{request-origin-COUkgHd6.js → request-origin-pzWr9UUu.js} +1 -2
- package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-DegdyBIC.js} +2 -3
- package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
- package/dist/routes-D02vxUSg.js +26 -0
- package/dist/{rpc-DIUA61pv.js → rpc-D3tsx5lZ.js} +1 -2
- package/dist/{rpc-7nlHSv3y.d.ts → rpc-oijgKQtD.d.ts} +0 -2
- package/dist/{runtime-YLWfdrtO.js → runtime-CAbuQGMP.js} +3 -4
- package/dist/{runtime-B-46Bawt.js → runtime-CRJsqVTa.js} +2 -3
- package/dist/{runtime-DxfJOfCd.js → runtime-DA7HJe10.js} +3 -4
- package/dist/runtime-DGvimtvc.d.ts +5 -0
- package/dist/{runtime-CX_l_78I.js → runtime-F0CTqBFx.js} +5 -6
- package/dist/{runtime-feature-guard-CuyPVGj9.js → runtime-feature-guard-BKAMRZzM.js} +6 -7
- package/dist/scan-module-B1A24jqP.js +1 -0
- package/dist/{scan-module-Df58L_6T.js → scan-module-BfZvDBxb.js} +2 -4
- package/dist/{schema-form-C-fy3xaU.d.ts → schema-form-Bl79Bdm-.d.ts} +0 -2
- package/dist/search-jgMrZJXR.js +84 -0
- package/dist/{sections-DumoLKQN.js → sections-AUGy9EkY.js} +2 -8
- package/dist/{sections-BogiCmtz.d.ts → sections-BMkFB3S-.d.ts} +4 -6
- package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
- package/dist/{sections-Do7X4Nwt.d.ts → sections-DCoCa4nF.d.ts} +1 -8
- package/dist/sections-DjeAUX7o.d.ts +8 -0
- package/dist/{sections-BKUReack.js → sections-ZFAlI4JW.js} +14 -7
- package/dist/{sections.get-H46e2urg.d.ts → sections.get-BY5dClJY.d.ts} +2 -4
- package/dist/seo/runtime.d.ts +2 -5
- package/dist/seo/runtime.js +3 -5
- package/dist/{seo-CtLywyRx.d.ts → seo-CgW5uI9L.d.ts} +0 -2
- package/dist/seo.d.ts +1 -1
- package/dist/seo.js +1 -2
- package/dist/{setup-BC0P3eZy.d.ts → setup-BBnZPziq.d.ts} +5 -10
- package/dist/{setup-DNGzawFn.js → setup-yc3_WKNG.js} +4 -17
- 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.d.ts +1 -5
- package/dist/skills/operations.js +4 -5
- package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
- package/dist/skills.d.ts +1 -2
- package/dist/{skills.get-CRd06TTb.js → skills.get-CW8vc_Hf.js} +3 -4
- package/dist/skills.js +1 -2
- package/dist/{source-Cw3iYvJF.js → source-DYFndd0W.js} +2 -3
- package/dist/{source-S-LChQvw.d.ts → source-DemBtwla.d.ts} +0 -2
- package/dist/{stored-Dhv2qsQv.js → stored-J3TetMKf.js} +1 -2
- package/dist/task/operations.d.ts +1 -5
- package/dist/task/operations.js +3 -4
- package/dist/test/register.js +2 -3
- package/dist/test.d.ts +0 -4
- package/dist/test.js +1 -2
- package/dist/ui/vite.js +1 -2
- package/dist/usage-DBi7aOhx.js +33 -0
- package/dist/{version-dkga9imp.js → version-DUCd7Orc.js} +24 -21
- package/dist/{vite-stage-D7fe614I.js → vite-stage-Dmo4RgnK.js} +3 -5
- package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
- 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 -5
- package/dist/{console/runtime/server → workspace/console}/workspace-files.get.js +4 -5
- package/dist/{workspace-history-B95Q-kGI.js → workspace-history-B52xib2J.js} +3 -4
- package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
- package/package.json +158 -149
- package/dist/agents-BhFggA26.js +0 -2
- package/dist/auth-GFIN6xSJ.d.ts +0 -120
- package/dist/cli-config-g_mbWdjT.js +0 -2
- package/dist/cloudflare-env-lookup-DKXdr4P_.js +0 -16
- package/dist/console/runtime/client/ticket.d.ts +0 -2
- package/dist/console/runtime/client/ticket.js +0 -2
- package/dist/console/runtime/page/loader.js +0 -134
- package/dist/console/runtime/server/auth.d.ts +0 -2
- package/dist/console/runtime/server/env.get.js +0 -16
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +0 -8
- package/dist/console/runtime/server/mcp-client-operations.d.ts +0 -5
- package/dist/console/runtime/server/mcp-client-operations.js +0 -139
- package/dist/console/runtime/server/page-auth.d.ts +0 -18
- package/dist/console/runtime/server/page-auth.js +0 -44
- 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 -5
- package/dist/console/runtime/server/search.get.d.ts +0 -4
- package/dist/console/runtime/server/search.get.js +0 -97
- package/dist/console/runtime/server/site-session.d.ts +0 -80
- package/dist/console/runtime/server/site-session.js +0 -2
- package/dist/console/runtime/server/tickets.d.ts +0 -2
- package/dist/console/runtime/server/tickets.js +0 -2
- package/dist/console/runtime/server/usage.get.d.ts +0 -10
- package/dist/console/runtime/server/usage.get.js +0 -92
- package/dist/console/runtime/site-access.d.ts +0 -2
- package/dist/console/runtime/site-access.js +0 -2
- package/dist/console-lazy-views-DXnIkdyd.js +0 -2
- package/dist/definition-catalog-og_1razf.js +0 -2
- package/dist/deployment-C2B0hBBj.js +0 -2
- package/dist/diagnostics-CjGiniKb.d.ts +0 -11
- package/dist/features-ujWsvlEH.js +0 -2
- package/dist/invocations-6jxqLkGY.js +0 -86
- package/dist/mcp-client-C91h8Taa.js +0 -1024
- package/dist/mcp-client-CTbTbn7d.js +0 -10
- package/dist/operations-5Lwd1xEI.js +0 -2
- package/dist/operations-ChEXk2ij.js +0 -853
- package/dist/page-tool-PmxH65gt.d.ts +0 -69
- package/dist/page-tools-ClgqElu-.js +0 -462
- package/dist/page-tools-DcCCtDKi.d.ts +0 -23
- package/dist/page-tools-shared-aNC9YtoI.js +0 -125
- package/dist/runtime-B_btezs1.d.ts +0 -7
- package/dist/scan-module-D_3X08mj.js +0 -2
- package/dist/secret-DELGKpCJ.js +0 -44
- package/dist/sections-CFiMNsqu.d.ts +0 -10
- package/dist/site-access-BycrwM2v.js +0 -18
- package/dist/site-access-CAiWyKOD.js +0 -2
- package/dist/site-access-DxfdOel1.d.ts +0 -55
- package/dist/site-access-L1qbvKt6.js +0 -293
- package/dist/site-session-CRwgKtTF.js +0 -300
- 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-DtBAstEU.js +0 -31
- package/dist/ticket-Pr_8ZtXW.d.ts +0 -14
- package/dist/tickets-DahBmKDT.js +0 -357
- package/dist/usage-CoQXs5nW.d.ts +0 -22
- package/dist/usage-index-VJAZ7a0p.js +0 -335
- package/dist/usage-jKtAgJZ0.js +0 -571
- /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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
|
|
1
|
+
import { t as ConsoleAccess } from "../../../access-DkBck8Vu.js";
|
|
2
|
+
import { n as consoleOperationRegistry } from "../../../operation-contributions-xwjDzj28.js";
|
|
3
|
+
import { n as ConsoleRoute } from "../../../request-DYmjLTqP.js";
|
|
4
|
+
import "#vitehub/console/app";
|
|
5
5
|
interface ConsoleRpcContext {
|
|
6
6
|
/** The checked access of the RPC request. Each operation runs with it. */
|
|
7
7
|
access: ConsoleAccess;
|
|
@@ -17,11 +17,6 @@ export declare function consoleRpcOperationSection(name: string, input?: unknown
|
|
|
17
17
|
* the failure, or the success status that the operation set, such as 202.
|
|
18
18
|
*/
|
|
19
19
|
export declare function handleConsoleRpcRequest(request: Request, context: ConsoleRpcContext): Promise<Response>;
|
|
20
|
-
/**
|
|
21
|
-
* `<base>/_vitehub/rpc`: one Console operation for each signed `POST`. Each operation checks its own section. A browser
|
|
22
|
-
* that opens `GET <base>/_vitehub/rpc?ticket=<ticket>` redeems a one-time ticket that an operation made, such as for
|
|
23
|
-
* impersonation. The ticket is the only proof that a `GET` needs. See `tickets.ts`.
|
|
24
|
-
*/
|
|
20
|
+
/** `<base>/_vitehub/rpc`: one Console operation for each signed `POST`. Each operation checks its own section. */
|
|
25
21
|
declare const consoleRpcRoute: ConsoleRoute;
|
|
26
|
-
//#endregion
|
|
27
22
|
export { consoleOperationRegistry, consoleRpcRoute as default };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { t as consoleBodySha256 } from "../../../console-signature--55DIKf2.js";
|
|
2
|
+
import { a as readOperationRpcCall, i as operationRpcRefusal, t as answerOperationRpc } from "../../../operation-rpc-BMdfapja.js";
|
|
3
|
+
import { c as operationCall, d as operationSection, h as projectRootHash, m as parseOperationInput, n as assertOperationConfirmed, o as operationAccessAllows, r as assertOperationProject, s as operationAccessDenial, t as assertOperationConfirmation, u as operationRootHeader } from "../../../operations-DksTrRMb.js";
|
|
4
|
+
import { t as consoleRpcHeader } from "../../../rpc-D3tsx5lZ.js";
|
|
5
|
+
import { h as withConsoleAccess, m as readConsoleOperationUser, r as consoleAccessAllows } from "../../../access-CUFHPi8T.js";
|
|
6
|
+
import { a as isConsoleRpcPath } from "../../../loopback-Bl9Cvj1k.js";
|
|
7
|
+
import { r as isHeldBackConsoleOperation, t as consoleOperationRegistry } from "../../../operation-contributions-BU10k2QS.js";
|
|
8
|
+
import { n as installedConsoleProjectRoot } from "../../../project-root-mAVQGZTX.js";
|
|
9
|
+
import { t as consoleDevelopmentContext } from "../../../development-DD567hhJ.js";
|
|
10
|
+
import { t as consoleDiagnostic } from "../../../diagnostics-DLHqjKGe.js";
|
|
11
|
+
import { t as consoleHttpError } from "../../../http-error-BorAxJYM.js";
|
|
12
|
+
import { n as consoleErrorResult, o as consoleRoute, r as consoleRequestError } from "../../../request-D769eiBL.js";
|
|
12
13
|
import * as v from "valibot";
|
|
13
14
|
import { getStandardContext } from "@vite-hub/runtime/internal/h3";
|
|
14
|
-
|
|
15
|
+
import "#vitehub/console/app";
|
|
16
|
+
// src/console/runtime/server/rpc.ts
|
|
15
17
|
const maximumConsoleRpcRequestBytes = 65536;
|
|
16
18
|
const responseHeaders = {
|
|
17
19
|
"cache-control": "no-store",
|
|
@@ -134,8 +136,7 @@ async function readConsoleCall(request, access) {
|
|
|
134
136
|
}
|
|
135
137
|
async function runConsoleOperation(operation, rawInput, request, context) {
|
|
136
138
|
if (Array.isArray(rawInput)) throw consoleRequestError(400, "Invalid Console input.");
|
|
137
|
-
|
|
138
|
-
if (mcp && operation.mcp === false) throw consoleRequestError(403, `${operation.name} is not open to MCP clients. Use it from the Console.`, "CONSOLE_ACCESS_DENIED");
|
|
139
|
+
if (context.access.surface === "mcp" && operation.mcp === false) throw consoleRequestError(403, `${operation.name} is not open to MCP clients. Use it from the Console.`, "CONSOLE_ACCESS_DENIED");
|
|
139
140
|
const input = await parseOperationInput(operation, rawInput);
|
|
140
141
|
const section = operationSection(operation, input);
|
|
141
142
|
if (section !== false && !consoleAccessAllows(context.access, section)) {
|
|
@@ -146,14 +147,14 @@ async function runConsoleOperation(operation, rawInput, request, context) {
|
|
|
146
147
|
if (section !== false && !operationAccessAllows(context.access, section, classification)) throw consoleRequestError(403, `This Console access to the "${section}" section is read-only, and ${operation.name} is a ${operation.kind} operation.`, "CONSOLE_ACCESS_DENIED");
|
|
147
148
|
if (context.access.readOnly && classification.kind !== "read" && !classification.readOnly) throw consoleRequestError(403, `${operation.name} is a ${classification.kind} operation, and this caller may only read.`, "CONSOLE_ACCESS_DENIED");
|
|
148
149
|
assertOperationConfirmation(request, classification);
|
|
149
|
-
if (
|
|
150
|
+
if (context.access.surface) assertOperationConfirmed(classification, context.access.confirmed === true);
|
|
150
151
|
const user = operation.user === false ? void 0 : await readConsoleOperationUser(context.access);
|
|
151
152
|
const operationContext = {
|
|
152
153
|
access: context.access,
|
|
153
154
|
...consoleDevelopmentContext(),
|
|
154
155
|
request,
|
|
155
156
|
response: context.response,
|
|
156
|
-
surface:
|
|
157
|
+
surface: context.access.surface ?? context.access.via ?? (request.headers.get("x-vitehub-surface") === "cli" ? "cli" : "console"),
|
|
157
158
|
user: user ? user : null,
|
|
158
159
|
...context.env ? { env: context.env } : {},
|
|
159
160
|
...context.event ? { event: context.event } : {},
|
|
@@ -208,15 +209,6 @@ const guardedRpc = withConsoleAccess((event, access) => {
|
|
|
208
209
|
waitUntil
|
|
209
210
|
});
|
|
210
211
|
}, { anySection: true });
|
|
211
|
-
/**
|
|
212
|
-
|
|
213
|
-
* that opens `GET <base>/_vitehub/rpc?ticket=<ticket>` redeems a one-time ticket that an operation made, such as for
|
|
214
|
-
* impersonation. The ticket is the only proof that a `GET` needs. See `tickets.ts`.
|
|
215
|
-
*/
|
|
216
|
-
const consoleRpcRoute = consoleRoute(async (event) => {
|
|
217
|
-
const request = getStandardContext(event).req;
|
|
218
|
-
if (request.method === "GET" && new URL(request.url).searchParams.has("ticket")) return (await import("./tickets.js")).redeemConsoleTicket(event);
|
|
219
|
-
return guardedRpc(event);
|
|
220
|
-
});
|
|
221
|
-
//#endregion
|
|
212
|
+
/** `<base>/_vitehub/rpc`: one Console operation for each signed `POST`. Each operation checks its own section. */
|
|
213
|
+
const consoleRpcRoute = consoleRoute(guardedRpc);
|
|
222
214
|
export { consoleOperationRegistry, consoleRpcOperationSection, consoleRpcRoute as default, handleConsoleRpcRequest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as loadConsoleRuntime, t as installConsoleRuntime } from "../../../runtime-
|
|
1
|
+
import { n as loadConsoleRuntime, t as installConsoleRuntime } from "../../../runtime-DGvimtvc.js";
|
|
2
2
|
export { installConsoleRuntime, loadConsoleRuntime };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { installConsoleRuntime, loadConsoleRuntime };
|
|
1
|
+
export { t as installConsoleRuntime, n as loadConsoleRuntime } from "../../../runtime-DA7HJe10.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as installConsoleDevelopment } from "../../../development-
|
|
3
|
-
import { t as installConsoleRuntime } from "../../../runtime-
|
|
4
|
-
import {
|
|
5
|
-
import { n as getConsoleProjectName, r as getConsoleSections, t as getConsoleBuild } from "../../../sections-
|
|
1
|
+
import { a as consoleRealtimeAccess, i as ConsoleRealtimeUser, l as installConsoleAccess, r as ConsoleRealtimeAccess } from "../../../access-DkBck8Vu.js";
|
|
2
|
+
import { r as installConsoleDevelopment } from "../../../development-I40mfD7B.js";
|
|
3
|
+
import { t as installConsoleRuntime } from "../../../runtime-DGvimtvc.js";
|
|
4
|
+
import { i as installConsoleVersion, n as installConsoleProjectName, r as installConsoleSections, t as installConsoleBuild } from "../../../setup-BBnZPziq.js";
|
|
5
|
+
import { n as getConsoleProjectName, r as getConsoleSections, t as getConsoleBuild } from "../../../sections-DjeAUX7o.js";
|
|
6
6
|
export { type ConsoleRealtimeAccess, type ConsoleRealtimeUser, consoleRealtimeAccess, getConsoleBuild, getConsoleProjectName, getConsoleSections, installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections, installConsoleVersion };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as listConsoleSections, t as ConsoleSectionsResponse } from "../../../sections.get-
|
|
1
|
+
import { n as listConsoleSections, t as ConsoleSectionsResponse } from "../../../sections.get-BY5dClJY.js";
|
|
2
2
|
export { ConsoleSectionsResponse, listConsoleSections };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { a as consoleAccessWrites, t as allowedConsoleSections } from "../../../access-CUFHPi8T.js";
|
|
2
|
+
import { n as getConsoleContributedSections } from "../../../definitions-DGo2rNQ9.js";
|
|
3
|
+
import { n as consoleState } from "../../../internal-0C_CC601.js";
|
|
4
|
+
import { n as consoleSetupRoute } from "../../../development-DD567hhJ.js";
|
|
5
|
+
import { t as consoleOperationRegistry } from "../../../operation-contributions-BU10k2QS.js";
|
|
6
|
+
import { n as getConsoleProjectName, r as getConsoleSections } from "../../../sections-BNTdIEJw.js";
|
|
7
|
+
// src/console/runtime/server/sections.get.ts
|
|
8
8
|
/** Whether an Agent field such as `channels` lists at least one entry, as an array or a record. */
|
|
9
9
|
function hasEntries(value) {
|
|
10
10
|
if (Array.isArray(value)) return value.length > 0;
|
|
@@ -18,7 +18,7 @@ async function emptySections(sections) {
|
|
|
18
18
|
const empty = /* @__PURE__ */ new Set();
|
|
19
19
|
if (sections.includes("env") && !(await import("./env.js")).getConsoleEnv().entries.length) empty.add("env");
|
|
20
20
|
if (import.meta.viteHubConsoleAgents !== false && (sections.includes("skills") || sections.includes("channels"))) {
|
|
21
|
-
const { getConsoleAgentDefinition, getConsoleAgents } = await import("../../../agents-
|
|
21
|
+
const { getConsoleAgentDefinition, getConsoleAgents } = await import("../../../agents-DBm_PJie.js");
|
|
22
22
|
const definitions = getConsoleAgents().map((name) => getConsoleAgentDefinition(name, "inspect"));
|
|
23
23
|
if (sections.includes("channels") && !definitions.some((definition) => hasEntries(definition?.channels))) empty.add("channels");
|
|
24
24
|
if (sections.includes("skills")) {
|
|
@@ -47,5 +47,4 @@ async function listConsoleSections(access) {
|
|
|
47
47
|
if (setup) result.setup = setup;
|
|
48
48
|
return result;
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { listConsoleSections };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as installConsoleDevelopment } from "../../../development-
|
|
2
|
-
import { i as installConsoleAccess } from "../../../access-policy-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as getConsoleProjectName, r as getConsoleSections, t as getConsoleBuild } from "../../../sections-
|
|
1
|
+
import { r as installConsoleDevelopment } from "../../../development-DD567hhJ.js";
|
|
2
|
+
import { i as installConsoleAccess } from "../../../access-policy-BM48XstY.js";
|
|
3
|
+
import { t as installConsoleRuntime } from "../../../runtime-DA7HJe10.js";
|
|
4
|
+
import { u as consoleRealtimeAccess } from "../../../access-CUFHPi8T.js";
|
|
5
|
+
import { i as installConsoleVersion, n as installConsoleProjectName, r as installConsoleSections, t as installConsoleBuild } from "../../../setup-yc3_WKNG.js";
|
|
6
|
+
import { n as getConsoleProjectName, r as getConsoleSections, t as getConsoleBuild } from "../../../sections-BNTdIEJw.js";
|
|
7
7
|
export { consoleRealtimeAccess, getConsoleBuild, getConsoleProjectName, getConsoleSections, installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections, installConsoleVersion };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as installConsoleDevelopment } from "../../../development-
|
|
3
|
-
import { t as installConsoleRuntime } from "../../../runtime-
|
|
4
|
-
import {
|
|
5
|
-
export { installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections,
|
|
1
|
+
import { l as installConsoleAccess } from "../../../access-DkBck8Vu.js";
|
|
2
|
+
import { r as installConsoleDevelopment } from "../../../development-I40mfD7B.js";
|
|
3
|
+
import { t as installConsoleRuntime } from "../../../runtime-DGvimtvc.js";
|
|
4
|
+
import { i as installConsoleVersion, n as installConsoleProjectName, r as installConsoleSections, t as installConsoleBuild } from "../../../setup-BBnZPziq.js";
|
|
5
|
+
export { installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections, installConsoleVersion };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as installConsoleDevelopment } from "../../../development-
|
|
2
|
-
import { i as installConsoleAccess } from "../../../access-policy-
|
|
3
|
-
import { t as installConsoleRuntime } from "../../../runtime-
|
|
4
|
-
import {
|
|
5
|
-
export { installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections,
|
|
1
|
+
import { r as installConsoleDevelopment } from "../../../development-DD567hhJ.js";
|
|
2
|
+
import { i as installConsoleAccess } from "../../../access-policy-BM48XstY.js";
|
|
3
|
+
import { t as installConsoleRuntime } from "../../../runtime-DA7HJe10.js";
|
|
4
|
+
import { i as installConsoleVersion, n as installConsoleProjectName, r as installConsoleSections, t as installConsoleBuild } from "../../../setup-yc3_WKNG.js";
|
|
5
|
+
export { installConsoleAccess, installConsoleBuild, installConsoleDevelopment, installConsoleProjectName, installConsoleRuntime, installConsoleSections, installConsoleVersion };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { n as AnyOperation } from "../../../operations-DgFhA1WE.js";
|
|
2
|
+
/**
|
|
3
|
+
* `site.access`: the Site access of the caller, which the ViteHub Console reads before it signs a Site access token.
|
|
4
|
+
* `write` follows write access to the `site` section, and `roles` are the `grants` of `console.authorize`, or every page
|
|
5
|
+
* tool role of the app. The Console registers it only when the app has the Site access section.
|
|
6
|
+
*/
|
|
7
|
+
export declare const siteAccessOperations: readonly AnyOperation[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { i as viteHubPageGrants } from "../../../page-tools-BeZrtn4S.js";
|
|
2
|
+
import { a as consoleAccessWrites, f as readConsoleAccessGrants } from "../../../access-CUFHPi8T.js";
|
|
3
|
+
import { i as defineConsoleOperation } from "../../../operations-byxiZ2R2.js";
|
|
4
|
+
import { r as consoleRequestError } from "../../../request-D769eiBL.js";
|
|
5
|
+
import * as v from "valibot";
|
|
6
|
+
/**
|
|
7
|
+
* `site.access`: the Site access of the caller, which the ViteHub Console reads before it signs a Site access token.
|
|
8
|
+
* `write` follows write access to the `site` section, and `roles` are the `grants` of `console.authorize`, or every page
|
|
9
|
+
* tool role of the app. The Console registers it only when the app has the Site access section.
|
|
10
|
+
*/
|
|
11
|
+
const siteAccessOperations = [defineConsoleOperation({
|
|
12
|
+
cli: false,
|
|
13
|
+
description: "Read the Site access of the caller: whether they may change it, and the page tool roles that they get and may give guests.",
|
|
14
|
+
input: v.strictObject({}),
|
|
15
|
+
kind: "read",
|
|
16
|
+
name: "site.access",
|
|
17
|
+
run: (_input, context) => {
|
|
18
|
+
const roles = viteHubPageGrants();
|
|
19
|
+
const grants = readConsoleAccessGrants(context.access);
|
|
20
|
+
if (grants) {
|
|
21
|
+
const known = new Set(roles.map((role) => role.id));
|
|
22
|
+
const unknown = grants.filter((grant) => !known.has(grant));
|
|
23
|
+
if (unknown.length) throw consoleRequestError(500, `console.authorize returned grants that no page tool of this app gives: ${unknown.join(", ")}.`);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
write: consoleAccessWrites(context.access, "site"),
|
|
27
|
+
roles: roles.filter((role) => !grants || grants.includes(role.id)).map(({ id, label, description }) => ({
|
|
28
|
+
id,
|
|
29
|
+
label,
|
|
30
|
+
...description ? { description } : {}
|
|
31
|
+
}))
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
section: "site"
|
|
35
|
+
})];
|
|
36
|
+
export { siteAccessOperations };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as ConsoleRequestEvent } from "../../../request-DYmjLTqP.js";
|
|
2
|
+
/**
|
|
3
|
+
* Why the Console signed the token:
|
|
4
|
+
* - `site`: a member or a guest opens the site.
|
|
5
|
+
* - `impersonate`: a member opens the site as another person, to see what that person sees.
|
|
6
|
+
* - `preview`: a member opens a preview of the site.
|
|
7
|
+
*/
|
|
8
|
+
type SiteTokenKind = "site" | "impersonate" | "preview";
|
|
9
|
+
interface SiteCommentsAgent {
|
|
10
|
+
projectId: string;
|
|
11
|
+
teamId: string;
|
|
12
|
+
resolve: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* What an `impersonate` or `preview` token acts on, as short strings, such as `{ action: "start", userId: "u_1" }` or
|
|
16
|
+
* `{ section: "content", collection: "posts", id: "hello" }`. The app reads it only from a verified token.
|
|
17
|
+
*/
|
|
18
|
+
type SiteTokenTarget = Record<string, string>;
|
|
19
|
+
/** The person and the roles that a token signs in. */
|
|
20
|
+
interface SiteTokenClaims {
|
|
21
|
+
/** The URL of the app, its origin and base path without a trailing `/`, such as `https://app.example.com/portal`. */
|
|
22
|
+
aud: string;
|
|
23
|
+
/** The id of the person in the Console: the user id of a member, or the grant id of a guest. */
|
|
24
|
+
sub: string;
|
|
25
|
+
/** The name that the app shows, such as the author of a comment. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** The email of a member. Guests have none. */
|
|
28
|
+
email?: string;
|
|
29
|
+
/** The image of a member. */
|
|
30
|
+
image?: string;
|
|
31
|
+
/** The roles of the person, such as `console` and `comments-write`. */
|
|
32
|
+
roles: string[];
|
|
33
|
+
commentsAgent?: SiteCommentsAgent;
|
|
34
|
+
kind: SiteTokenKind;
|
|
35
|
+
/** What an `impersonate` or `preview` token acts on. A `site` token has none. */
|
|
36
|
+
target?: SiteTokenTarget;
|
|
37
|
+
/** The path of the app to open after the sign-in, such as `/docs`. */
|
|
38
|
+
path: string;
|
|
39
|
+
/** The {@link siteStateHash} of the state cookie of the browser that started the visit. */
|
|
40
|
+
state: string;
|
|
41
|
+
/** Seconds since the epoch. */
|
|
42
|
+
iat: number;
|
|
43
|
+
/** Seconds since the epoch. */
|
|
44
|
+
exp: number;
|
|
45
|
+
}
|
|
46
|
+
interface SiteTokenMatch {
|
|
47
|
+
ok: true;
|
|
48
|
+
claims: SiteTokenClaims;
|
|
49
|
+
/** The `<NAME>` of the `VITEHUB_CONSOLE_KEY_<NAME>` that matched. */
|
|
50
|
+
key: string;
|
|
51
|
+
/** The URL of `claims.path` below the app URL, where the app sends the browser. */
|
|
52
|
+
destination: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Run the action of a checked `impersonate` or `preview` token of `/_vitehub/site`. The Console signs such a token for a
|
|
56
|
+
* member after the app allowed the signed operation of the kind, as that member. The app keeps no state for it: the
|
|
57
|
+
* token works for 60 seconds in the browser that started the visit, and only for its kind and target. `headers` carry
|
|
58
|
+
* the cookies of every answer.
|
|
59
|
+
*
|
|
60
|
+
* - `impersonate`: the browser's app session must belong to the email of the token, and Better Auth must let it
|
|
61
|
+
* impersonate. A stop ends only an impersonation that the person of the token started in this browser.
|
|
62
|
+
* - `preview`: the `preview` action of the document editor section runs as the person of the token, which checks that
|
|
63
|
+
* they may read the document, and a page of the app posts its frame token to the page. The Content preview plugin of
|
|
64
|
+
* the app renders the draft. Its frame form must come from the same origin, so the form leaves from here.
|
|
65
|
+
*/
|
|
66
|
+
export declare function openSiteAction(input: {
|
|
67
|
+
match: SiteTokenMatch;
|
|
68
|
+
request: Request;
|
|
69
|
+
event: ConsoleRequestEvent;
|
|
70
|
+
app: string;
|
|
71
|
+
headers: Headers;
|
|
72
|
+
}): Promise<Response>;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { o as consoleImpersonation } from "../../../access-CUFHPi8T.js";
|
|
2
|
+
import { r as consoleRequestError } from "../../../request-D769eiBL.js";
|
|
3
|
+
import { n as loadConsoleRuntime } from "../../../runtime-DA7HJe10.js";
|
|
4
|
+
import { r as getConsoleSections } from "../../../sections-BNTdIEJw.js";
|
|
5
|
+
import { a as sitePageHeaders, i as siteFailurePage, n as html, o as siteProblemPage, r as seeOther } from "../../../site-pages-B6J8U2Nq.js";
|
|
6
|
+
// src/console/runtime/server/site-actions.ts
|
|
7
|
+
async function authConsole(request, event) {
|
|
8
|
+
if (!getConsoleSections().includes("auth")) return void 0;
|
|
9
|
+
return (import.meta.viteHubConsoleAuth === false ? void 0 : await import("@vite-hub/auth/server"))?.getAuthConsoleForRequest(request, event, { impersonation: true });
|
|
10
|
+
}
|
|
11
|
+
async function authFailure(error) {
|
|
12
|
+
const auth = import.meta.viteHubConsoleAuth === false ? void 0 : await import("../../../auth/console/auth.js");
|
|
13
|
+
return auth ? auth.authConsoleFailure(error) : error;
|
|
14
|
+
}
|
|
15
|
+
function refused(message, headers) {
|
|
16
|
+
return siteProblemPage(401, "CONSOLE_SITE_TOKEN_REFUSED", message, void 0, headers);
|
|
17
|
+
}
|
|
18
|
+
async function impersonate(match, request, event, home, headers) {
|
|
19
|
+
if (!consoleImpersonation()) return siteFailurePage(consoleRequestError(404, "Impersonation is off. Set console.impersonation to true to enable it."), headers);
|
|
20
|
+
const api = await authConsole(request, event);
|
|
21
|
+
if (!api) return siteFailurePage(consoleRequestError(404, "The app has no Auth section."), headers);
|
|
22
|
+
const email = match.claims.email?.toLowerCase();
|
|
23
|
+
if (!email) return siteFailurePage(consoleRequestError(403, "Impersonation checks that the browser is signed in to the app with the email of your Console account, and the token has no email.", "CONSOLE_ACCESS_DENIED"), headers);
|
|
24
|
+
const [sessionError, session] = await api.session(request);
|
|
25
|
+
if (sessionError) throw sessionError;
|
|
26
|
+
if (!session) return siteProblemPage(403, "CONSOLE_SITE_ACCOUNT_MISMATCH", `Sign in to the app as ${email}, an account that may impersonate users, then start again from the Console.`, void 0, headers);
|
|
27
|
+
const { action, userId } = match.claims.target ?? {};
|
|
28
|
+
if (action === "stop") {
|
|
29
|
+
if (!session.impersonatedBy) return siteFailurePage(consoleRequestError(409, "This browser does not impersonate a user."), headers);
|
|
30
|
+
if (session.impersonatedBy.email.toLowerCase() !== email) return siteProblemPage(403, "CONSOLE_SITE_ACCOUNT_MISMATCH", `This browser impersonates for ${session.impersonatedBy.email || "another administrator"}, and the token was made for ${email}.`, void 0, headers);
|
|
31
|
+
const [error, response] = await api.stopImpersonating(request);
|
|
32
|
+
if (error) return siteFailurePage(await authFailure(error), headers);
|
|
33
|
+
return seeOther(home, mergeCookies(response.headers, headers));
|
|
34
|
+
}
|
|
35
|
+
if (action !== "start" || !userId) return refused("The impersonation token names no user.", headers);
|
|
36
|
+
if (session.user.email.toLowerCase() !== email) return siteProblemPage(403, "CONSOLE_SITE_ACCOUNT_MISMATCH", `This browser is signed in to the app as ${session.user.email}, and the token was made for ${email}. Sign in to the app as ${email}, then start again from the Console.`, void 0, headers);
|
|
37
|
+
const [error, response] = await api.execute({
|
|
38
|
+
action: "impersonate",
|
|
39
|
+
userId
|
|
40
|
+
}, request);
|
|
41
|
+
if (error) return siteFailurePage(await authFailure(error), headers);
|
|
42
|
+
return seeOther(home, mergeCookies(response.headers, headers));
|
|
43
|
+
}
|
|
44
|
+
function mergeCookies(first, second) {
|
|
45
|
+
const out = new Headers();
|
|
46
|
+
for (const cookie of [...first.getSetCookie(), ...second.getSetCookie()]) out.append("set-cookie", cookie);
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
async function sha256Base64(value) {
|
|
50
|
+
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(value)));
|
|
51
|
+
return btoa(String.fromCharCode(...digest));
|
|
52
|
+
}
|
|
53
|
+
async function openPreview(match, headers) {
|
|
54
|
+
const { collection, id, section } = match.claims.target ?? {};
|
|
55
|
+
if (!collection || !id || !section) return refused("The preview token names no document.", headers);
|
|
56
|
+
const documents = await (import.meta.viteHubConsoleDocuments === false ? Promise.reject(consoleRequestError(404, "The Console document editor section is disabled.")) : import("./documents.js"));
|
|
57
|
+
const actions = await documents.loadConsoleDocumentActions(section);
|
|
58
|
+
const { claims } = match;
|
|
59
|
+
const user = {
|
|
60
|
+
id: claims.sub,
|
|
61
|
+
name: claims.name,
|
|
62
|
+
...claims.email ? { email: claims.email.toLowerCase() } : {},
|
|
63
|
+
...claims.image ? { image: claims.image } : {}
|
|
64
|
+
};
|
|
65
|
+
const preview = await documents.runConsoleDocumentAction(() => actions.preview({
|
|
66
|
+
collection,
|
|
67
|
+
id
|
|
68
|
+
}, { user }));
|
|
69
|
+
const parameter = Reflect.get(Object(preview), "parameter");
|
|
70
|
+
const token = Reflect.get(Object(preview), "token");
|
|
71
|
+
if (String(parameter) !== parameter || String(token) !== token) throw consoleRequestError(409, "The document editor returned no preview token.");
|
|
72
|
+
const page = new URL(match.destination);
|
|
73
|
+
page.searchParams.set(parameter, "");
|
|
74
|
+
const script = "document.forms[0].submit()";
|
|
75
|
+
const body = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="referrer" content="no-referrer"><title>Opening the preview</title></head><body><form method="post" action="${html(page.href)}"><input type="hidden" name="${html(parameter)}" value="${html(JSON.stringify({ token }))}"><noscript><button>Open the preview</button></noscript></form><script>${script}<\/script></body></html>`;
|
|
76
|
+
const out = new Headers({
|
|
77
|
+
...sitePageHeaders,
|
|
78
|
+
"content-security-policy": `default-src 'none'; script-src 'sha256-${await sha256Base64(script)}'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'`
|
|
79
|
+
});
|
|
80
|
+
for (const cookie of headers.getSetCookie()) out.append("set-cookie", cookie);
|
|
81
|
+
return new Response(body, { headers: out });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Run the action of a checked `impersonate` or `preview` token of `/_vitehub/site`. The Console signs such a token for a
|
|
85
|
+
* member after the app allowed the signed operation of the kind, as that member. The app keeps no state for it: the
|
|
86
|
+
* token works for 60 seconds in the browser that started the visit, and only for its kind and target. `headers` carry
|
|
87
|
+
* the cookies of every answer.
|
|
88
|
+
*
|
|
89
|
+
* - `impersonate`: the browser's app session must belong to the email of the token, and Better Auth must let it
|
|
90
|
+
* impersonate. A stop ends only an impersonation that the person of the token started in this browser.
|
|
91
|
+
* - `preview`: the `preview` action of the document editor section runs as the person of the token, which checks that
|
|
92
|
+
* they may read the document, and a page of the app posts its frame token to the page. The Content preview plugin of
|
|
93
|
+
* the app renders the draft. Its frame form must come from the same origin, so the form leaves from here.
|
|
94
|
+
*/
|
|
95
|
+
async function openSiteAction(input) {
|
|
96
|
+
const { match, headers } = input;
|
|
97
|
+
try {
|
|
98
|
+
await loadConsoleRuntime();
|
|
99
|
+
if (match.claims.kind === "preview") return await openPreview(match, headers);
|
|
100
|
+
return await impersonate(match, input.request, input.event, `${input.app}/`, headers);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
return siteFailurePage(error, headers);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export { openSiteAction };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as ConsoleRoute } from "../../../request-
|
|
2
|
-
|
|
1
|
+
import { n as ConsoleRoute } from "../../../request-DYmjLTqP.js";
|
|
2
|
+
import "#vitehub/console/app";
|
|
3
3
|
/**
|
|
4
4
|
* The first path segments below `/_vitehub` that ViteHub serves itself, such as `/_vitehub/rpc` of the Console and
|
|
5
|
-
* `/_vitehub/blob-signed` of Blob. `/_vitehub/<name>/...` never goes back to a page: the route
|
|
6
|
-
* that no ViteHub route served. Open such a page and follow a link to `/_vitehub` from it.
|
|
5
|
+
* `/_vitehub/blob-signed` of Blob. In an app with the pill, `/_vitehub/<name>/...` never goes back to a page: the route
|
|
6
|
+
* answers 404 for a path that no ViteHub route served. Open such a page and follow a link to `/_vitehub` from it.
|
|
7
7
|
*/
|
|
8
8
|
export declare const siteEntryReservedNames: ReadonlySet<string>;
|
|
9
9
|
/**
|
|
@@ -12,13 +12,20 @@ export declare const siteEntryReservedNames: ReadonlySet<string>;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function siteEntryPage(value: string | null, base: string): string;
|
|
14
14
|
/**
|
|
15
|
-
* Where a `/_vitehub` request goes back to: the app `base` and the `page` below it, or
|
|
16
|
-
* such as `/_vitehub/rpc/x`. `origin` is the app origin, which a `Referer` must have.
|
|
15
|
+
* Where a `/_vitehub` request goes back to in an app with the pill: the app `base` and the `page` below it, or
|
|
16
|
+
* `undefined` for a reserved path, such as `/_vitehub/rpc/x`. `origin` is the app origin, which a `Referer` must have.
|
|
17
17
|
*/
|
|
18
18
|
export declare function siteEntryTarget(request: Request, origin: string): {
|
|
19
19
|
base: string;
|
|
20
20
|
page: string;
|
|
21
21
|
} | undefined;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The Console URL of a `/_vitehub` request in an app without the pill: the project is the app origin with the path
|
|
24
|
+
* before `/_vitehub`, and the Console page is the rest of the path with the query. `undefined` when the Console cannot
|
|
25
|
+
* open the app origin.
|
|
26
|
+
*/
|
|
27
|
+
export declare function siteEntryConsoleUrl(request: Request, origin: string): string | undefined;
|
|
28
|
+
/** `/_vitehub` in an app with Comments: the page of the app with the pill, through Site access when needed. */
|
|
29
|
+
export declare const siteEntryRoute: ConsoleRoute;
|
|
30
|
+
/** `/_vitehub` in an app without Comments: the page of the app in the ViteHub Console. */
|
|
31
|
+
export declare const consoleEntryRoute: ConsoleRoute;
|