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,12 +1,9 @@
|
|
|
1
|
-
//#region ../internal/src/features.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The feature keys of `vitehub({...})`. `vitehub add <feature>` and `vitehub status` read this list before the owner
|
|
4
3
|
* package of a feature is installed, so the catalog is plain data with no owner imports.
|
|
5
4
|
*/
|
|
6
5
|
declare const featureIds: readonly ["agent", "auth", "blob", "browser", "cache", "channels", "comments", "connections", "console", "database", "email", "env", "i18n", "kv", "mcp", "observability", "queue", "rateLimit", "realtime", "sandboxTask", "schedule", "workflow", "workspace"];
|
|
7
6
|
type FeatureId = (typeof featureIds)[number];
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/console/runtime/sections.d.ts
|
|
10
7
|
/** Sections that the Console UI in `vite-hub` renders with its own components. Owner packages contribute the others. */
|
|
11
8
|
declare const consoleBuiltinSectionIds: readonly ["env", "agents", "skills", "usage", "channels", "mcp-client", "logs", "blob", "databases", "kv", "cache", "site", "setup"];
|
|
12
9
|
/**
|
|
@@ -89,8 +86,6 @@ interface ConsoleSectionStorage {
|
|
|
89
86
|
/** Returns true for a lowercase route segment. Built-in and contributed section ids use this form. */
|
|
90
87
|
declare function isConsoleSectionId(value: unknown): value is ConsoleSectionId;
|
|
91
88
|
declare function isConsoleBuiltinSectionId(value: unknown): value is ConsoleBuiltinSectionId;
|
|
92
|
-
/** The MCP client section is on when the Console options set `mcpClient: true`. */
|
|
93
|
-
declare function isConsoleMcpClientEnabled(console: unknown): boolean;
|
|
94
89
|
/** Route name of a contributed section. The Console serves it at `/_vitehub/<id>`. */
|
|
95
90
|
declare function consoleSectionRouteName(section: ConsoleSectionId): string;
|
|
96
91
|
/**
|
|
@@ -134,7 +129,6 @@ declare function describeConsoleSectionRoutes(section: {
|
|
|
134
129
|
declare function resolveConsoleSectionIds(options: {
|
|
135
130
|
auth?: unknown;
|
|
136
131
|
env?: unknown;
|
|
137
|
-
console?: unknown;
|
|
138
132
|
agent?: unknown;
|
|
139
133
|
blob?: unknown;
|
|
140
134
|
cache?: unknown;
|
|
@@ -154,5 +148,4 @@ declare function resolveConsoleSectionIds(options: {
|
|
|
154
148
|
declare function prioritizeConsoleSectionIds(sections: readonly ConsoleSectionId[], preferred: ConsoleSectionId | undefined): ConsoleSectionId[];
|
|
155
149
|
declare function readLastConsoleSection(storage?: ConsoleSectionStorage): ConsoleSectionId | undefined;
|
|
156
150
|
declare function rememberConsoleSection(section: ConsoleSectionId, storage?: ConsoleSectionStorage): void;
|
|
157
|
-
|
|
158
|
-
export { rememberConsoleSection as A, groupConsoleSections as C, isConsoleSectionId as D, isConsoleMcpClientEnabled as E, resolveConsoleSectionGroup as M, resolveConsoleSectionIds as N, prioritizeConsoleSectionIds as O, describeConsoleSectionRoutes as S, isConsoleBuiltinSectionId as T, consoleSectionPageSegment as _, ConsoleSectionId as a, consoleSectionShortcutKeys as b, consoleDocsBase as c, consoleOverviewShortcut as d, consolePrimitives as f, consoleSectionPageRouteName as g, consoleSectionGroupLabels as h, ConsoleSectionGroupId as i, resolveConsoleSectionDocs as j, readLastConsoleSection as k, consoleGoToKey as l, consoleSectionGroupIds as m, ConsolePrimitive as n, ConsoleSectionRoute as o, consoleSectionDetails as p, ConsoleSectionDetails as r, consoleBuiltinSectionIds as s, ConsoleBuiltinSectionId as t, consoleGuide as u, consoleSectionRouteName as v, insertConsoleSection as w, consoleToolSectionIds as x, consoleSectionShortcut as y };
|
|
151
|
+
export { resolveConsoleSectionDocs as A, groupConsoleSections as C, prioritizeConsoleSectionIds as D, isConsoleSectionId as E, resolveConsoleSectionIds as M, readLastConsoleSection as O, describeConsoleSectionRoutes as S, isConsoleBuiltinSectionId as T, consoleSectionPageSegment as _, ConsoleSectionId as a, consoleSectionShortcutKeys as b, consoleDocsBase as c, consoleOverviewShortcut as d, consolePrimitives as f, consoleSectionPageRouteName as g, consoleSectionGroupLabels as h, ConsoleSectionGroupId as i, resolveConsoleSectionGroup as j, rememberConsoleSection as k, consoleGoToKey as l, consoleSectionGroupIds as m, ConsolePrimitive as n, ConsoleSectionRoute as o, consoleSectionDetails as p, ConsoleSectionDetails as r, consoleBuiltinSectionIds as s, ConsoleBuiltinSectionId as t, consoleGuide as u, consoleSectionRouteName as v, insertConsoleSection as w, consoleToolSectionIds as x, consoleSectionShortcut as y };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as ConsoleProjectBuild } from "./project-B2qWt8on.js";
|
|
2
|
+
import { a as ConsoleSectionId } from "./sections-DCoCa4nF.js";
|
|
3
|
+
import "./access-DkBck8Vu.js";
|
|
4
|
+
import "./setup-BBnZPziq.js";
|
|
5
|
+
declare function getConsoleSections(): readonly ConsoleSectionId[];
|
|
6
|
+
declare function getConsoleProjectName(): string | undefined;
|
|
7
|
+
declare function getConsoleBuild(): ConsoleProjectBuild | undefined;
|
|
8
|
+
export { getConsoleProjectName as n, getConsoleSections as r, getConsoleBuild as t };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as parseConsoleContributedSection } from "./definitions-
|
|
2
|
-
import { f as consoleSectionRouteName, s as consoleSectionDetails,
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { t as parseConsoleContributedSection } from "./definitions-BFYqXchw.js";
|
|
2
|
+
import { b as isConsoleSectionId, f as consoleSectionRouteName, s as consoleSectionDetails, v as insertConsoleSection, y as isConsoleBuiltinSectionId } from "./sections-AUGy9EkY.js";
|
|
3
|
+
import { t as consoleProject } from "./project-DRC67Uiu.js";
|
|
4
|
+
import { u as requestConsole } from "./request-XFVx7CGC.js";
|
|
5
|
+
// src/console/runtime/client/sections.ts
|
|
5
6
|
/** The Console path of `sections.list`. Views pass it as `sectionsBase`, and the navigation cache keys on it. */
|
|
6
7
|
const consoleSectionsPath = "/_vitehub/api/sections";
|
|
7
8
|
const navigationRequests = /* @__PURE__ */ new Map();
|
|
@@ -38,12 +39,18 @@ function resolveConsoleSectionDetails(navigation, section) {
|
|
|
38
39
|
routeName: consoleSectionRouteName(section)
|
|
39
40
|
} : void 0;
|
|
40
41
|
}
|
|
42
|
+
function withConsoleServerSections(navigation) {
|
|
43
|
+
return consoleProject().remote ? {
|
|
44
|
+
...navigation,
|
|
45
|
+
sections: insertConsoleSection(navigation.sections, "mcp-client")
|
|
46
|
+
} : navigation;
|
|
47
|
+
}
|
|
41
48
|
async function loadConsoleNavigation(base) {
|
|
42
49
|
let request = navigationRequests.get(base);
|
|
43
50
|
if (!request) {
|
|
44
51
|
request = requestConsole(base).then((value) => {
|
|
45
52
|
navigationErrors.delete(base);
|
|
46
|
-
const navigation = parseConsoleNavigation(value);
|
|
53
|
+
const navigation = withConsoleServerSections(parseConsoleNavigation(value));
|
|
47
54
|
navigationValues.set(base, navigation);
|
|
48
55
|
for (const subscriber of navigationSubscribers.get(base) || []) subscriber(navigation);
|
|
49
56
|
return navigation;
|
|
@@ -60,7 +67,8 @@ async function loadConsoleNavigation(base) {
|
|
|
60
67
|
* `sections.list` call. A newer answer, such as the answer of this visit after a stored one, replaces it, and the
|
|
61
68
|
* subscribers get it when it changed.
|
|
62
69
|
*/
|
|
63
|
-
function seedConsoleNavigation(base,
|
|
70
|
+
function seedConsoleNavigation(base, answer) {
|
|
71
|
+
const navigation = withConsoleServerSections(answer);
|
|
64
72
|
const known = navigationValues.get(base);
|
|
65
73
|
navigationErrors.delete(base);
|
|
66
74
|
navigationRequests.set(base, Promise.resolve(navigation));
|
|
@@ -118,5 +126,4 @@ async function resolveConsoleSectionDeepLink(router, to, addSectionRoutes) {
|
|
|
118
126
|
await addSectionRoutes();
|
|
119
127
|
return router.resolve(to.fullPath).name === consolePendingSectionRoute.name ? { name: "vitehub-console" } : to.fullPath;
|
|
120
128
|
}
|
|
121
|
-
//#endregion
|
|
122
129
|
export { isConsoleSectionRevoked as a, reloadConsoleNavigation as c, seedConsoleNavigation as d, subscribeConsoleNavigation as f, createConsoleSectionLoader as i, resolveConsoleSectionDeepLink as l, consolePendingSectionRoute as n, loadConsoleNavigation as o, consoleSectionsPath as r, parseConsoleNavigation as s, consoleNavigationError as t, resolveConsoleSectionDetails as u };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
//#region src/console/runtime/server/sections.get.d.ts
|
|
1
|
+
import { t as ConsoleAccess } from "./access-DkBck8Vu.js";
|
|
2
|
+
import { t as ConsoleContributedSection } from "./definitions-ChvMnA1L.js";
|
|
4
3
|
interface ConsoleSectionsResponse {
|
|
5
4
|
contributions?: readonly ConsoleContributedSection[];
|
|
6
5
|
/** The registered operations that run app code (`console.invoke`) and that this request may run. The pages hide the others. */
|
|
@@ -16,5 +15,4 @@ interface ConsoleSectionsResponse {
|
|
|
16
15
|
}
|
|
17
16
|
/** The sections that this access may use. The client hides the others. Each operation still checks its own section. */
|
|
18
17
|
declare function listConsoleSections(access: ConsoleAccess): Promise<ConsoleSectionsResponse>;
|
|
19
|
-
//#endregion
|
|
20
18
|
export { listConsoleSections as n, ConsoleSectionsResponse as t };
|
package/dist/seo/runtime.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as SitemapEntries } from "../seo-
|
|
2
|
-
//#region ../internal/src/sitemap.d.ts
|
|
1
|
+
import { t as SitemapEntries } from "../seo-CgW5uI9L.js";
|
|
3
2
|
/** One URL of a sitemap. */
|
|
4
3
|
interface SitemapUrl {
|
|
5
4
|
/** The absolute URL of the page. */
|
|
@@ -7,8 +6,6 @@ interface SitemapUrl {
|
|
|
7
6
|
/** When the page last changed, as an ISO timestamp. */
|
|
8
7
|
lastmod?: string;
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/seo/runtime.d.ts
|
|
12
9
|
/** The part of a Content runtime, the default export of `server/content.ts`, that the sitemap and robots.txt read. */
|
|
13
10
|
export interface SeoContent {
|
|
14
11
|
readonly seo?: {
|
|
@@ -61,4 +58,4 @@ export declare function defineRobotsRoute(options: {
|
|
|
61
58
|
disallow: readonly string[];
|
|
62
59
|
content?: () => Promise<SeoContent>;
|
|
63
60
|
}): Fetchable;
|
|
64
|
-
|
|
61
|
+
export {};
|
package/dist/seo/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-CBtvqI30.js";
|
|
2
2
|
import { getStandardContext } from "@vite-hub/runtime";
|
|
3
|
-
|
|
3
|
+
// ../internal/src/sitemap.ts
|
|
4
4
|
/** One sitemap file holds at most this many URLs. */
|
|
5
5
|
const sitemapUrlLimit = 5e4;
|
|
6
6
|
function escapeXml(value) {
|
|
@@ -39,8 +39,7 @@ function renderRobots(options) {
|
|
|
39
39
|
if (options.sitemap) lines.push("", `Sitemap: ${options.sitemap}`);
|
|
40
40
|
return `${lines.join("\n")}\n`;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
//#region src/seo/runtime.ts
|
|
42
|
+
// src/seo/runtime.ts
|
|
44
43
|
function siteOf(options, request) {
|
|
45
44
|
return `${options.site ?? new URL(request.url).origin}${options.base.replace(/\/+$/, "")}`;
|
|
46
45
|
}
|
|
@@ -119,5 +118,4 @@ function defineRobotsRoute(options) {
|
|
|
119
118
|
}), { headers: { "content-type": "text/plain; charset=utf-8" } });
|
|
120
119
|
} };
|
|
121
120
|
}
|
|
122
|
-
//#endregion
|
|
123
121
|
export { defineRobotsRoute, defineSitemapRoute };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/seo.d.ts
|
|
2
1
|
/** One page that `server/sitemap.ts` adds to `/sitemap.xml`. */
|
|
3
2
|
interface SitemapEntry {
|
|
4
3
|
/** The page path, such as `/blog/hello`, or an absolute `http(s)` URL. A path starts after the app base. */
|
|
@@ -20,5 +19,4 @@ type SitemapEntries = readonly SitemapEntry[] | (() => readonly SitemapEntry[] |
|
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
21
|
declare function defineSitemap(entries: SitemapEntries): SitemapEntries;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { SitemapEntry as n, defineSitemap as r, SitemapEntries as t };
|
package/dist/seo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SitemapEntry, r as defineSitemap, t as SitemapEntries } from "./seo-
|
|
1
|
+
import { n as SitemapEntry, r as defineSitemap, t as SitemapEntries } from "./seo-CgW5uI9L.js";
|
|
2
2
|
export { SitemapEntries, SitemapEntry, defineSitemap };
|
package/dist/seo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/seo.ts
|
|
2
2
|
/**
|
|
3
3
|
* The default export of `server/sitemap.ts`: pages that ViteHub cannot find by itself, such as one page for each
|
|
4
4
|
* product in the Database. `vitehub({ seo: { sitemap: true } })` adds them to `/sitemap.xml`.
|
|
@@ -13,5 +13,4 @@
|
|
|
13
13
|
function defineSitemap(entries) {
|
|
14
14
|
return entries;
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { defineSitemap };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { t as ConsoleProjectBuild } from "./project-
|
|
2
|
-
import { a as ConsoleSectionId } from "./sections-
|
|
3
|
-
import "./access-
|
|
4
|
-
import "./development-
|
|
5
|
-
//#region src/console/runtime/server/setup.d.ts
|
|
6
|
-
declare function installConsoleSiteDatabase(load: () => Promise<Record<string, {
|
|
7
|
-
db: object;
|
|
8
|
-
}>>, preferredName?: string): void;
|
|
1
|
+
import { t as ConsoleProjectBuild } from "./project-B2qWt8on.js";
|
|
2
|
+
import { a as ConsoleSectionId } from "./sections-DCoCa4nF.js";
|
|
3
|
+
import "./access-DkBck8Vu.js";
|
|
4
|
+
import "./development-I40mfD7B.js";
|
|
9
5
|
declare function installConsoleSections(projectRoot: string, sections: readonly ConsoleSectionId[], navigationSections?: readonly ConsoleSectionId[]): readonly ConsoleSectionId[];
|
|
10
6
|
/** Generated production output installs what its build recorded, so `project.get` names the build that serves it. */
|
|
11
7
|
declare function installConsoleBuild(build: ConsoleProjectBuild): ConsoleProjectBuild;
|
|
12
8
|
/** Generated output installs the `vite-hub` version that the app built with, for `project.get`. */
|
|
13
9
|
declare function installConsoleVersion(version: string): string;
|
|
14
10
|
declare function installConsoleProjectName(projectRoot: string, projectName: string): string;
|
|
15
|
-
|
|
16
|
-
export { installConsoleVersion as a, installConsoleSiteDatabase as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
11
|
+
export { installConsoleVersion as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function installConsoleSiteDatabase(load, preferredName) {
|
|
5
|
-
consoleState().siteDatabase = async () => {
|
|
6
|
-
const databases = await load();
|
|
7
|
-
const name = preferredName ?? Object.keys(databases)[0];
|
|
8
|
-
if (name === void 0) return void 0;
|
|
9
|
-
const entry = databases[name];
|
|
10
|
-
return entry && {
|
|
11
|
-
name,
|
|
12
|
-
db: entry.db
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
}
|
|
1
|
+
import { t as installConsoleProjectRoot } from "./project-root-mAVQGZTX.js";
|
|
2
|
+
import { n as consoleState } from "./internal-0C_CC601.js";
|
|
3
|
+
// src/console/runtime/server/setup.ts
|
|
16
4
|
function installConsoleSections(projectRoot, sections, navigationSections) {
|
|
17
5
|
const state = consoleState();
|
|
18
6
|
state.navigationSections = navigationSections ? [...new Set(navigationSections)] : void 0;
|
|
@@ -30,5 +18,4 @@ function installConsoleProjectName(projectRoot, projectName) {
|
|
|
30
18
|
installConsoleProjectRoot(projectRoot);
|
|
31
19
|
return consoleState().projectName = projectName;
|
|
32
20
|
}
|
|
33
|
-
|
|
34
|
-
export { installConsoleVersion as a, installConsoleSiteDatabase as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
21
|
+
export { installConsoleVersion as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { s as readConsolePublicKeys } from "./console-signature--55DIKf2.js";
|
|
2
|
+
import { n as matchesPublicOrigin } from "./request-origin-pzWr9UUu.js";
|
|
3
|
+
import { i as viteHubSessionMarkerCookie, n as viteHubPageToolsQuery, r as viteHubPageToolsResetCookie } from "./page-tools-shared-BLPidmCi.js";
|
|
4
|
+
import { a as siteRoute, c as verifySiteHandoff, l as verifySiteToken, n as isSiteIntent, o as siteStateHash, r as isSitePath, s as siteVisitUrl, t as createSiteState } from "./site-token-Wa7fhjwg.js";
|
|
5
|
+
import { a as installedConsoleAccessPolicy } from "./access-policy-BM48XstY.js";
|
|
6
|
+
import { i as consoleRequestEnv, t as isConsoleLoopbackRequest } from "./loopback-Bl9Cvj1k.js";
|
|
7
|
+
import { o as consoleRoute, r as consoleRequestError, s as isConsoleDevelopmentRuntime } from "./request-D769eiBL.js";
|
|
8
|
+
import { i as siteSessionLifetime, r as siteCookieNames, t as cookieValue } from "./site-visitor-BkhE2TA0.js";
|
|
9
|
+
import { o as siteProblemPage, r as seeOther, t as appOrigin } from "./site-pages-B6J8U2Nq.js";
|
|
10
|
+
import { getStandardContext } from "@vite-hub/runtime/internal/h3";
|
|
11
|
+
import { configuredConsoleOrigin } from "@vite-hub/runtime/internal/console";
|
|
12
|
+
import "#vitehub/console/app";
|
|
13
|
+
import { configuredPublicOrigins } from "@vite-hub/runtime/internal/public-url";
|
|
14
|
+
// src/console/runtime/server/site.ts
|
|
15
|
+
const siteStateLifetime = 600;
|
|
16
|
+
const actionStateLifetime = 120;
|
|
17
|
+
const statePattern = /^[\w-]{43}$/;
|
|
18
|
+
const maximumCookieBytes = 4096;
|
|
19
|
+
function stateCookieName(siteStateCookie, intent) {
|
|
20
|
+
return intent === null ? siteStateCookie : `${siteStateCookie}-${intent}`;
|
|
21
|
+
}
|
|
22
|
+
function cookie(name, value, maxAge) {
|
|
23
|
+
return `${name}=${value}; Path=/; Max-Age=${maxAge}; HttpOnly; Secure; SameSite=Lax`;
|
|
24
|
+
}
|
|
25
|
+
/** A page with `?vitehub`, which opens the page tools pill. */
|
|
26
|
+
function withPageTools(page) {
|
|
27
|
+
const hash = page.indexOf("#");
|
|
28
|
+
const path = hash === -1 ? page : page.slice(0, hash);
|
|
29
|
+
const query = path.indexOf("?");
|
|
30
|
+
if (query !== -1 && new URLSearchParams(path.slice(query)).has("vitehub")) return page;
|
|
31
|
+
return `${path}${query === -1 ? "?" : "&"}${viteHubPageToolsQuery}${hash === -1 ? "" : page.slice(hash)}`;
|
|
32
|
+
}
|
|
33
|
+
function siteApp(request, base) {
|
|
34
|
+
return `${isConsoleDevelopmentRuntime() ? new URL(request.url).origin : appOrigin(request)}${base.replace(/\/+$/, "")}`;
|
|
35
|
+
}
|
|
36
|
+
async function signIn(event, request, app, token, intent, siteAccess, names) {
|
|
37
|
+
const keys = readConsolePublicKeys(consoleRequestEnv(request));
|
|
38
|
+
if (!(keys instanceof Map)) {
|
|
39
|
+
globalThis.console.error(`[vitehub] ${keys.message}`);
|
|
40
|
+
return siteProblemPage(500, keys.code === "CONSOLE_KEY_MALFORMED" ? "CONSOLE_KEY_MALFORMED" : "CONSOLE_KEY_NOT_CONFIGURED", keys.message);
|
|
41
|
+
}
|
|
42
|
+
const stateCookie = stateCookieName(names.state, intent);
|
|
43
|
+
const state = cookieValue(request, stateCookie) ?? "";
|
|
44
|
+
const result = await verifySiteToken({
|
|
45
|
+
token,
|
|
46
|
+
keys,
|
|
47
|
+
origin: app,
|
|
48
|
+
state,
|
|
49
|
+
kinds: intent !== null ? ["impersonate", "preview"] : siteAccess ? ["site"] : []
|
|
50
|
+
});
|
|
51
|
+
if (!result.ok) return siteProblemPage(401, "CONSOLE_SITE_TOKEN_REFUSED", `${result.message} (${result.code})`);
|
|
52
|
+
if (result.claims.kind !== "site") {
|
|
53
|
+
const headers = new Headers({ "set-cookie": cookie(stateCookie, "", 0) });
|
|
54
|
+
return (await import("./console/runtime/server/site-actions.js")).openSiteAction({
|
|
55
|
+
match: result,
|
|
56
|
+
request,
|
|
57
|
+
event,
|
|
58
|
+
app,
|
|
59
|
+
headers
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const session = `${names.session}=${state}.${token}`;
|
|
63
|
+
if (new TextEncoder().encode(session).length > maximumCookieBytes) return siteProblemPage(400, "CONSOLE_SITE_TOKEN_REFUSED", "The Site access token is too long for a cookie. Open the site with a shorter path or name.");
|
|
64
|
+
const maxAge = Math.max(1, result.claims.iat + siteSessionLifetime - Math.floor(Date.now() / 1e3));
|
|
65
|
+
const headers = new Headers();
|
|
66
|
+
headers.append("set-cookie", `${session}; Path=/; Max-Age=${maxAge}; HttpOnly; Secure; SameSite=Lax`);
|
|
67
|
+
headers.append("set-cookie", `${viteHubSessionMarkerCookie}=1; Path=/; Max-Age=${maxAge}; SameSite=Lax`);
|
|
68
|
+
headers.append("set-cookie", viteHubPageToolsResetCookie);
|
|
69
|
+
return seeOther(withPageTools(result.destination), headers);
|
|
70
|
+
}
|
|
71
|
+
async function visit(request, app, url, intent, siteAccess, names) {
|
|
72
|
+
const page = url.searchParams.get("return") ?? "/";
|
|
73
|
+
if (intent === null && !siteAccess) throw consoleRequestError(404, "Site access needs the Comments pill. Add server/comments.ts, or set comments in vitehub() without overlay: false.");
|
|
74
|
+
if (!isSitePath(page)) throw consoleRequestError(400, "Use a path of the app as `return`, such as /docs.");
|
|
75
|
+
const project = url.searchParams.get("project") ?? void 0;
|
|
76
|
+
const issuer = url.searchParams.get("issuer");
|
|
77
|
+
const handoff = url.searchParams.get("handoff");
|
|
78
|
+
if (issuer !== null || handoff !== null) {
|
|
79
|
+
const keys = readConsolePublicKeys(consoleRequestEnv(request));
|
|
80
|
+
if (intent !== null || !issuer || !handoff || !project || !(keys instanceof Map) || !await verifySiteHandoff({
|
|
81
|
+
app,
|
|
82
|
+
issuer,
|
|
83
|
+
project,
|
|
84
|
+
path: page,
|
|
85
|
+
handoff,
|
|
86
|
+
keys
|
|
87
|
+
})) throw consoleRequestError(400, "This Site access handoff is invalid or expired. Ask the issuing Console for a new link.");
|
|
88
|
+
}
|
|
89
|
+
const stateCookie = stateCookieName(names.state, intent);
|
|
90
|
+
const current = cookieValue(request, stateCookie);
|
|
91
|
+
const state = current && statePattern.test(current) ? current : createSiteState();
|
|
92
|
+
const location = siteVisitUrl({
|
|
93
|
+
console: issuer ?? configuredConsoleOrigin(),
|
|
94
|
+
app,
|
|
95
|
+
state: await siteStateHash(state),
|
|
96
|
+
path: page,
|
|
97
|
+
...project ? { project } : {},
|
|
98
|
+
...intent ? { intent } : {}
|
|
99
|
+
});
|
|
100
|
+
return seeOther(location, new Headers({ "set-cookie": cookie(stateCookie, state, intent === null ? siteStateLifetime : actionStateLifetime) }));
|
|
101
|
+
}
|
|
102
|
+
function isSameOriginRequest(request) {
|
|
103
|
+
const site = request.headers.get("sec-fetch-site");
|
|
104
|
+
const origin = request.headers.get("origin");
|
|
105
|
+
if (origin !== null && origin !== siteApp(request, "")) return false;
|
|
106
|
+
return site === null ? origin !== null : site === "same-origin";
|
|
107
|
+
}
|
|
108
|
+
function signOut(names) {
|
|
109
|
+
const headers = new Headers({ "cache-control": "no-store" });
|
|
110
|
+
headers.append("set-cookie", cookie(names.session, "", 0));
|
|
111
|
+
headers.append("set-cookie", cookie(names.state, "", 0));
|
|
112
|
+
headers.append("set-cookie", viteHubPageToolsResetCookie);
|
|
113
|
+
return new Response(null, {
|
|
114
|
+
headers,
|
|
115
|
+
status: 204
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function siteRouteOf(siteAccess) {
|
|
119
|
+
return consoleRoute(async (event) => {
|
|
120
|
+
const { req: request, runtime } = getStandardContext(event);
|
|
121
|
+
const policy = installedConsoleAccessPolicy();
|
|
122
|
+
if (!policy) throw consoleRequestError(500, "Console access is not configured. The generated Console output did not install an access policy.", "CONSOLE_ACCESS_NOT_CONFIGURED");
|
|
123
|
+
if (!await isConsoleLoopbackRequest(request, {
|
|
124
|
+
access: policy.mode,
|
|
125
|
+
remoteAddress: runtime?.clientAddress
|
|
126
|
+
})) throw consoleRequestError(403, "This development server answers the Console only on this computer.", "CONSOLE_LOOPBACK_ONLY");
|
|
127
|
+
if (!isConsoleDevelopmentRuntime() && !matchesPublicOrigin(request, configuredPublicOrigins())) throw consoleRequestError(404, `ViteHub serves ${siteRoute} only on the public URL of the app.`);
|
|
128
|
+
const url = new URL(request.url);
|
|
129
|
+
const pathname = url.pathname.replace(/\/+$/, "");
|
|
130
|
+
if (!pathname.endsWith("/_vitehub/site")) throw consoleRequestError(404, "Nothing serves this path.");
|
|
131
|
+
const base = pathname.slice(0, -siteRoute.length);
|
|
132
|
+
const names = await siteCookieNames(base);
|
|
133
|
+
if (request.method === "POST") {
|
|
134
|
+
if (!siteAccess) throw consoleRequestError(404, "Nothing serves this path.");
|
|
135
|
+
if (!isSameOriginRequest(request)) throw consoleRequestError(403, "Sign out from a page of this app.", "CONSOLE_ACCESS_DENIED");
|
|
136
|
+
return signOut(names);
|
|
137
|
+
}
|
|
138
|
+
if (request.method !== "GET" && request.method !== "HEAD") throw consoleRequestError(405, `Open ${siteRoute} in the browser.`);
|
|
139
|
+
const app = siteApp(request, base);
|
|
140
|
+
const token = url.searchParams.get("token");
|
|
141
|
+
const intent = url.searchParams.get("intent");
|
|
142
|
+
if (intent !== null && !isSiteIntent(intent)) throw consoleRequestError(400, "Start the impersonation or the preview again from the Console.");
|
|
143
|
+
if (intent !== null && request.method !== "GET") throw consoleRequestError(405, `Open ${siteRoute} in the browser.`);
|
|
144
|
+
return token === null ? await visit(request, app, url, intent, siteAccess, names) : await signIn(event, request, app, token, intent, siteAccess, names);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* `<base>/_vitehub/site` in an app with Comments: Site access in the app. The ViteHub Console decides who may open the
|
|
149
|
+
* site, and the app keeps no user, session, or link for it:
|
|
150
|
+
*
|
|
151
|
+
* - `GET ?return=/docs` sets the state cookie and sends the browser to the Console's `/visit`. The `project` and
|
|
152
|
+
* `intent` queries of the request go with it.
|
|
153
|
+
* - The Console checks the person and sends the browser back to `GET ?token=vst1.…` with a token that the key of the
|
|
154
|
+
* link signed for this app and this state. The route checks the token with the `VITEHUB_CONSOLE_KEY_<NAME>` public
|
|
155
|
+
* keys. A `site` token stays in the site cookie for 12 hours, and the page opens with the page tools. An
|
|
156
|
+
* `impersonate` or `preview` token runs its action once, in this request. See `site-actions.ts`.
|
|
157
|
+
* - `POST` signs the browser out of Site access. It needs `Sec-Fetch-Site: same-origin`, or, without that header, an
|
|
158
|
+
* `Origin` that is the app origin.
|
|
159
|
+
*
|
|
160
|
+
* After 12 hours, `/_vitehub` sends the browser through the Console again, which signs a new token while the person
|
|
161
|
+
* still has access.
|
|
162
|
+
*/
|
|
163
|
+
const siteAccessRoute = siteRouteOf(true);
|
|
164
|
+
/**
|
|
165
|
+
* `<base>/_vitehub/site` in an app without Comments. It takes only the `impersonate` and `preview` tokens that the
|
|
166
|
+
* Console starts with an `intent`. A visit without an `intent` gets 404: the app has no Site access.
|
|
167
|
+
*/
|
|
168
|
+
const siteActionRoute = siteRouteOf(false);
|
|
169
|
+
export { siteActionRoute as n, withPageTools as r, siteAccessRoute as t };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { n as isRecord } from "./object-DRSmpe04.js";
|
|
2
|
+
import { M as useConsoleProjects } from "./project-session-8pN7pRo8.js";
|
|
3
|
+
import { o as consoleResponseError, t as ConsoleRequestError } from "./request-XFVx7CGC.js";
|
|
4
|
+
// src/console/runtime/client/site-link.ts
|
|
5
|
+
function isTab(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && "close" in value && "location" in value;
|
|
7
|
+
}
|
|
8
|
+
function openTab() {
|
|
9
|
+
const open = Reflect.get(globalThis, "open");
|
|
10
|
+
const tab = open instanceof Function ? Reflect.apply(open, globalThis, ["about:blank", "_blank"]) : void 0;
|
|
11
|
+
return isTab(tab) ? tab : void 0;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Ask for a link and open it in a new tab. The tab opens before the call, while the click still allows it, and closes
|
|
15
|
+
* again when the call fails. The app page cannot reach the Console through `opener`. When the browser blocks the tab,
|
|
16
|
+
* this tab goes to the link.
|
|
17
|
+
*/
|
|
18
|
+
async function openConsoleLink(request) {
|
|
19
|
+
const tab = openTab();
|
|
20
|
+
if (tab) tab.opener = null;
|
|
21
|
+
try {
|
|
22
|
+
const url = Reflect.get(Object(await request()), "url");
|
|
23
|
+
if (String(url) !== url) throw new ConsoleRequestError(502, "The Console did not return a link.");
|
|
24
|
+
if (tab) tab.location.replace(url);
|
|
25
|
+
else Reflect.apply(Reflect.get(Object(Reflect.get(globalThis, "location")), "assign"), Reflect.get(globalThis, "location"), [url]);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
tab?.close();
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Open the app in a new tab as a user, end that impersonation, or open the page of a document with its draft. The
|
|
33
|
+
* Console asks the app first, as you, and keeps what to open for 60 seconds in this browser. The tab goes through the
|
|
34
|
+
* app's `/_vitehub/site`, and the Console signs a token for it.
|
|
35
|
+
*/
|
|
36
|
+
async function openSiteAction(kind, target) {
|
|
37
|
+
await openConsoleLink(async () => {
|
|
38
|
+
const project = useConsoleProjects().current.value;
|
|
39
|
+
if (!project) throw new ConsoleRequestError(409, "Open a project first.");
|
|
40
|
+
const response = await fetch(`/api/projects/${encodeURIComponent(project.id)}/site/open`, {
|
|
41
|
+
body: JSON.stringify({
|
|
42
|
+
kind,
|
|
43
|
+
target
|
|
44
|
+
}),
|
|
45
|
+
credentials: "same-origin",
|
|
46
|
+
headers: {
|
|
47
|
+
accept: "application/json",
|
|
48
|
+
"content-type": "application/json"
|
|
49
|
+
},
|
|
50
|
+
method: "POST"
|
|
51
|
+
});
|
|
52
|
+
if (!response.ok) throw await consoleResponseError(response);
|
|
53
|
+
const body = await response.json().catch(() => void 0);
|
|
54
|
+
if (!isRecord(body)) throw new ConsoleRequestError(502, "The Console answered with no JSON object.");
|
|
55
|
+
return body;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export { openSiteAction as n, openConsoleLink as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** A link that the Console answers, such as a one-time code or a guest invite, and when it stops working. */
|
|
2
|
+
interface ConsoleLink {
|
|
3
|
+
url: string;
|
|
4
|
+
expiresAt: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Ask for a link and open it in a new tab. The tab opens before the call, while the click still allows it, and closes
|
|
8
|
+
* again when the call fails. The app page cannot reach the Console through `opener`. When the browser blocks the tab,
|
|
9
|
+
* this tab goes to the link.
|
|
10
|
+
*/
|
|
11
|
+
declare function openConsoleLink(request: () => Promise<unknown>): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Open the app in a new tab as a user, end that impersonation, or open the page of a document with its draft. The
|
|
14
|
+
* Console asks the app first, as you, and keeps what to open for 60 seconds in this browser. The tab goes through the
|
|
15
|
+
* app's `/_vitehub/site`, and the Console signs a token for it.
|
|
16
|
+
*/
|
|
17
|
+
declare function openSiteAction(kind: "impersonate" | "preview", target: Record<string, string>): Promise<void>;
|
|
18
|
+
export { openConsoleLink as n, openSiteAction as r, ConsoleLink as t };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { r as consoleDiagnosticBody } from "./diagnostics-DLHqjKGe.js";
|
|
2
|
+
import { n as consoleErrorResult, r as consoleRequestError } from "./request-D769eiBL.js";
|
|
3
|
+
import { resolvePublicUrl } from "@vite-hub/runtime";
|
|
4
|
+
// src/console/runtime/server/site-pages.ts
|
|
5
|
+
/** The headers of a page that `/_vitehub/site` answers. */
|
|
6
|
+
const sitePageHeaders = {
|
|
7
|
+
"cache-control": "no-store",
|
|
8
|
+
"content-type": "text/html; charset=utf-8",
|
|
9
|
+
"referrer-policy": "no-referrer",
|
|
10
|
+
"x-content-type-options": "nosniff",
|
|
11
|
+
"x-frame-options": "DENY",
|
|
12
|
+
"x-robots-tag": "noindex, nofollow"
|
|
13
|
+
};
|
|
14
|
+
/** A value escaped for HTML text and attributes. */
|
|
15
|
+
function html(value) {
|
|
16
|
+
return value.replace(/[&<>"']/g, (character) => `&#${character.charCodeAt(0)};`);
|
|
17
|
+
}
|
|
18
|
+
/** The origin of the app for a request: `vitehub({ publicUrl })` when set, else the URL of the request. */
|
|
19
|
+
function appOrigin(request) {
|
|
20
|
+
const origin = resolvePublicUrl({ request });
|
|
21
|
+
if (!origin) throw consoleRequestError(403, "The request host is not an origin of vitehub({ publicUrl }).", "CONSOLE_ORIGIN_REJECTED");
|
|
22
|
+
return new URL(origin).origin;
|
|
23
|
+
}
|
|
24
|
+
/** A `303` to `location` that keeps the `set-cookie` headers of `headers`. */
|
|
25
|
+
function seeOther(location, headers = new Headers()) {
|
|
26
|
+
const out = new Headers({
|
|
27
|
+
"cache-control": "no-store",
|
|
28
|
+
"referrer-policy": "no-referrer",
|
|
29
|
+
location
|
|
30
|
+
});
|
|
31
|
+
for (const cookie of headers.getSetCookie()) out.append("set-cookie", cookie);
|
|
32
|
+
return new Response(null, {
|
|
33
|
+
headers: out,
|
|
34
|
+
status: 303
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function problemPage(problem, headers = new Headers()) {
|
|
38
|
+
const page = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${html(problem.message)}</title></head><body><main><h1>${html(problem.message)}</h1>${problem.fix ? `<p>${html(problem.fix)}</p>` : ""}<p><code>${html(problem.code)}</code></p></main></body></html>`;
|
|
39
|
+
const out = new Headers({
|
|
40
|
+
...sitePageHeaders,
|
|
41
|
+
"content-security-policy": "default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'"
|
|
42
|
+
});
|
|
43
|
+
for (const cookie of headers.getSetCookie()) out.append("set-cookie", cookie);
|
|
44
|
+
return new Response(page, {
|
|
45
|
+
headers: out,
|
|
46
|
+
status: problem.status
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/** The page of a refused visit: the diagnostic code, the why, and the fix. `fix` replaces the general fix of the code. */
|
|
50
|
+
function siteProblemPage(status, code, message, fix, headers) {
|
|
51
|
+
return problemPage({
|
|
52
|
+
...consoleDiagnosticBody(code, message),
|
|
53
|
+
...fix ? { fix } : {},
|
|
54
|
+
status
|
|
55
|
+
}, headers);
|
|
56
|
+
}
|
|
57
|
+
/** A failure as a page. A failure without an HTTP status is a bug: it is logged, and the page shows no detail. */
|
|
58
|
+
function siteFailurePage(error, headers) {
|
|
59
|
+
const result = consoleErrorResult(error);
|
|
60
|
+
if (result.status >= 500) globalThis.console.error("[vitehub] Site access failed.", error);
|
|
61
|
+
return problemPage(result.status >= 500 ? {
|
|
62
|
+
...consoleDiagnosticBody("CONSOLE_REQUEST_FAILED"),
|
|
63
|
+
status: result.status
|
|
64
|
+
} : result, headers);
|
|
65
|
+
}
|
|
66
|
+
export { sitePageHeaders as a, siteFailurePage as i, html as n, siteProblemPage as o, seeOther as r, appOrigin as t };
|