vite-hub 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -14
- package/dist/_internal/runtime/browser-errors.d.ts +12 -4
- package/dist/_internal/runtime/browser-errors.js +69 -27
- 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 +11 -2
- package/dist/_internal/runtime/request-policy.js +25 -6
- package/dist/_internal/runtime/security.d.ts +1 -2
- package/dist/_internal/runtime/security.js +16 -3
- package/dist/{access-BDST818p.js → access-BBHk9b5P.js} +30 -20
- package/dist/{access-policy-DjBKLo3c.js → access-policy-BM48XstY.js} +5 -6
- package/dist/{access-policy-CGXhO3Ee.d.ts → access-policy-CUbJLvlR.d.ts} +4 -8
- package/dist/{account-BnOAU055.d.ts → account-CoAO1F8G.d.ts} +9 -7
- package/dist/agent/invocations/postgres.d.ts +1 -0
- package/dist/agent/invocations/postgres.js +2 -0
- package/dist/{agent-invocations.post-CcPvfA0n.js → agent-invocations.post-BAC1aHnG.js} +16 -18
- package/dist/agents-BClUWOj7.js +1 -0
- package/dist/{agents-BDeazoAW.js → agents-Cz_uhhov.js} +4 -5
- package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
- package/dist/auth/server.js +1 -2
- package/dist/{auth-BZOy7obk.d.ts → auth-CeKxL2xp.d.ts} +4 -8
- package/dist/{auth-operations-GcQk0O0X.js → auth-operations-arLIY2_2.js} +1 -2
- package/dist/{auth-types-CyqhWvYF.d.ts → auth-types-B4mq4YhK.d.ts} +1 -4
- package/dist/bin.js +34 -23
- package/dist/blob/nuxt-image.js +1 -2
- package/dist/{blob-CFLwMsjH.d.ts → blob-_TtxDb-t.d.ts} +1 -3
- package/dist/{blob-CpvlM8jp.js → blob-eH6j0AQj.js} +5 -6
- package/dist/browser-error-limits-B0yS95zt.js +24 -0
- 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/choices/testing.d.ts +1 -0
- package/dist/choices/testing.js +2 -0
- package/dist/{cli-config-wxKjF2Y0.js → cli-config-BX8H4ZCo.js} +12 -5
- package/dist/cli-config-DgpmE_7z.js +1 -0
- package/dist/cloudflare-app-types.d.ts +18 -0
- package/dist/{cloudflare-env-lookup-DKXdr4P_.js → cloudflare-env-lookup-DcN7pGlv.js} +1 -2
- package/dist/cms.js +1 -2
- package/dist/console/auth-types.d.ts +1 -1
- package/dist/console/auth.d.ts +1 -3
- package/dist/console/auth.js +2 -3
- package/dist/console/runtime/auth-operations.d.ts +1 -3
- 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 +36 -48
- package/dist/console/runtime/client/add-primitive.ts +2 -2
- package/dist/console/runtime/client/appearance.d.ts +1 -2
- package/dist/console/runtime/client/appearance.js +1 -2
- 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 +11 -5
- 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 +6 -4
- package/dist/console/runtime/client/mcp-client.js +12 -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 +2 -2
- 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 -70
- 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 +41 -10
- package/dist/console/runtime/client/site-access.js +157 -28
- package/dist/console/runtime/client/stored.d.ts +1 -3
- package/dist/console/runtime/client/stored.js +1 -2
- package/dist/console/runtime/client/ticket.d.ts +1 -1
- package/dist/console/runtime/client/ticket.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-api-keys.vue +4 -4
- package/dist/console/runtime/components/console-account-home.vue +230 -51
- 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 +13 -19
- 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-app.vue +1 -10
- package/dist/console/runtime/components/console-auth-activity.vue +2 -2
- package/dist/console/runtime/components/console-auth-chart.vue +1 -1
- package/dist/console/runtime/components/console-auth-overview.vue +1 -1
- package/dist/console/runtime/components/console-auth.vue +4 -4
- package/dist/console/runtime/components/console-comment-thread.vue +1 -1
- package/dist/console/runtime/components/console-definitions.vue +4 -4
- package/dist/console/runtime/components/console-document-dashboard.vue +2 -2
- package/dist/console/runtime/components/console-document-list.vue +2 -2
- package/dist/console/runtime/components/console-document-settings.vue +1 -1
- package/dist/console/runtime/components/console-env.vue +3 -3
- package/dist/console/runtime/components/console-home.vue +220 -311
- package/dist/console/runtime/components/console-hosted-comments-embed.vue +106 -0
- package/dist/console/runtime/components/console-loading.vue +1 -1
- package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
- package/dist/console/runtime/components/console-mcp-connection.vue +3 -3
- package/dist/console/runtime/components/console-mcp-items.vue +4 -17
- package/dist/console/runtime/components/console-media-browser.vue +20 -30
- package/dist/console/runtime/components/console-media-crops.vue +3 -2
- package/dist/console/runtime/components/console-media-uploads.vue +11 -7
- package/dist/console/runtime/components/console-page-toolbar.vue +5 -10
- package/dist/console/runtime/components/console-schema-list.vue +85 -31
- package/dist/console/runtime/components/console-search-palette.vue +14 -5
- package/dist/console/runtime/components/console-section.vue +2 -1
- package/dist/console/runtime/components/console-session-inspector.vue +5 -0
- package/dist/console/runtime/components/console-session.css +8 -2
- package/dist/console/runtime/components/console-settings-value.vue +4 -5
- package/dist/console/runtime/components/console-sidebar.vue +9 -8
- package/dist/console/runtime/components/console-site.vue +36 -15
- package/dist/console/runtime/components/console-stat-grid.vue +3 -2
- package/dist/console/runtime/components/console-toaster.vue +3 -2
- package/dist/console/runtime/components/console-usage-chart.vue +1 -1
- package/dist/console/runtime/components/console-usage.vue +36 -18
- package/dist/console/runtime/components/invocation/internal/brand-icons.ts +10 -0
- package/dist/console/runtime/components/invocation/internal/invocation-brand.ts +6 -2
- package/dist/console/runtime/components/invocation/invocation.css +4 -27
- 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 +8 -1
- package/dist/console/runtime/mcp-client.d.ts +1 -1
- package/dist/console/runtime/mcp-client.js +1 -2
- package/dist/console/runtime/page/loader.js +45 -52
- package/dist/console/runtime/page-tool/account.js +26 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -3
- package/dist/console/runtime/public/skills/index.json +1 -1
- package/dist/console/runtime/public/skills/vitehub/SKILL.md +50 -7
- package/dist/console/runtime/public/skills/vitehub/agents/openai.yaml +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/email.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +1 -1
- package/dist/console/runtime/rpc.d.ts +1 -1
- package/dist/console/runtime/rpc.js +1 -2
- package/dist/console/runtime/sections.d.ts +1 -1
- 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/agents.get.d.ts +2 -3
- package/dist/console/runtime/server/agents.get.js +3 -4
- package/dist/console/runtime/server/auth.d.ts +1 -1
- package/dist/console/runtime/server/auth.js +4 -5
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -2
- package/dist/console/runtime/server/channel-replay.d.ts +3 -5
- package/dist/console/runtime/server/channel-replay.js +7 -7
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.get.d.ts +2 -3
- package/dist/console/runtime/server/database.get.js +4 -5
- 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 +1 -1
- package/dist/console/runtime/server/documents.js +2 -2
- package/dist/console/runtime/server/env.d.ts +1 -3
- package/dist/console/runtime/server/env.get.d.ts +2 -4
- package/dist/console/runtime/server/env.get.js +7 -8
- package/dist/console/runtime/server/env.js +1 -2
- package/dist/console/runtime/server/invocation-capabilities.get.d.ts +1 -3
- package/dist/console/runtime/server/invocation-capabilities.get.js +4 -5
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation-workspace.get.js +6 -7
- package/dist/console/runtime/server/invocation.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation.get.js +8 -9
- package/dist/console/runtime/server/invocations.get.d.ts +1 -2
- package/dist/console/runtime/server/invocations.get.js +5 -6
- package/dist/console/runtime/server/logs.get.d.ts +3 -5
- package/dist/console/runtime/server/logs.get.js +7 -8
- package/dist/console/runtime/server/mcp-client-operations.d.ts +2 -4
- package/dist/console/runtime/server/mcp-client-operations.js +5 -7
- 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/page-auth.d.ts +2 -4
- package/dist/console/runtime/server/page-auth.js +1 -2
- package/dist/console/runtime/server/page-tool.d.ts +1 -1
- package/dist/console/runtime/server/page-tool.js +12 -7
- package/dist/console/runtime/server/page-tools-route.d.ts +2 -0
- package/dist/console/runtime/server/page-tools-route.js +4 -0
- package/dist/console/runtime/server/rpc.d.ts +3 -5
- package/dist/console/runtime/server/rpc.js +12 -13
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -2
- package/dist/console/runtime/server/search.get.d.ts +1 -3
- package/dist/console/runtime/server/search.get.js +3 -5
- 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-entry.d.ts +1 -3
- package/dist/console/runtime/server/site-entry.js +15 -10
- package/dist/console/runtime/server/site-session.d.ts +12 -22
- package/dist/console/runtime/server/site-session.js +1 -2
- package/dist/console/runtime/server/status.get.d.ts +2 -4
- package/dist/console/runtime/server/status.get.js +6 -7
- package/dist/console/runtime/server/tickets.d.ts +1 -1
- package/dist/console/runtime/server/tickets.js +1 -2
- package/dist/console/runtime/server/usage.get.d.ts +2 -4
- package/dist/console/runtime/server/usage.get.js +8 -9
- package/dist/console/runtime/server/workspace-files.get.d.ts +3 -5
- package/dist/console/runtime/server/workspace-files.get.js +4 -5
- package/dist/console/runtime/site-access.d.ts +1 -1
- package/dist/console/runtime/site-access.js +1 -2
- package/dist/console/runtime/skills.d.ts +1 -3
- package/dist/console/runtime/skills.js +1 -2
- package/dist/console/server.d.ts +7 -11
- package/dist/console/server.js +8 -8
- package/dist/console/ui.d.ts +0 -10
- package/dist/console/ui.js +32 -28
- package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
- package/dist/{console-route-CBuqZ4wO.js → console-route-DbdnLkkF.js} +3 -4
- package/dist/console.d.ts +1 -3
- package/dist/console.js +1 -2
- package/dist/{database-DyPVMjp_.d.ts → database-CPjZ3L0g.d.ts} +1 -3
- package/dist/{database-BdOBjPkS.js → database-CrgBUdIx.js} +3 -4
- package/dist/definition-catalog-1xPPtzOx.js +137 -0
- 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-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
- package/dist/{definitions-CNq_Shkh.js → definitions-M7i2p8SR.js} +5 -6
- package/dist/deployment-CURATxjG.js +229 -0
- package/dist/deployment-l7RuKdEp.js +1 -0
- package/dist/{dev-peer-am78OsHH.js → dev-peer-DBq-isgi.js} +7 -6
- package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
- package/dist/{development-W5EwONyL.d.ts → development-I40mfD7B.d.ts} +1 -3
- package/dist/{diagnostics-9U_fYxMy.js → diagnostics-B2cqlCSz.js} +3 -3
- package/dist/{diagnostics-CjGiniKb.d.ts → diagnostics-BXxPggRw.d.ts} +1 -3
- package/dist/docs/nuxt.js +1 -2
- package/dist/doctor.d.ts +0 -6
- package/dist/doctor.js +15078 -2377
- package/dist/{documents-CjJTCrY8.js → documents-BOYwZ5g4.js} +7 -8
- package/dist/{documents-qrHHqlNU.js → documents-Ck_iub9w.js} +4 -5
- package/dist/{documents-BASIRZ91.d.ts → documents-DxK0tdjA.d.ts} +3 -5
- package/dist/{documents-CboVhYFz.d.ts → documents-LtkKCxtu.d.ts} +4 -8
- package/dist/durability/operations.d.ts +2 -4
- package/dist/durability/operations.js +3 -4
- package/dist/email/vue.d.ts +1 -0
- package/dist/email/vue.js +2 -0
- package/dist/{entries-Bj-jPs_J.js → entries-UFs9n1MB.js} +2 -3
- package/dist/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
- package/dist/{error-diagnostics-Bm3JKYjz.js → error-diagnostics-CBtvqI30.js} +33 -22
- package/dist/{operation-definition-a5keEpCd.js → error-diagnostics-kKXseq8d.js} +11 -169
- package/dist/error-diagnostics.ts +33 -23
- package/dist/{optional-owners-BNA2OX6z.js → features-BXRKlmtN.js} +57 -345
- package/dist/features-CD5i5I8V.js +1 -0
- package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
- package/dist/gateways/testing.d.ts +1 -0
- package/dist/gateways/testing.js +2 -0
- package/dist/github-login-W-vaahWP.js +6 -0
- 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 +2 -8
- package/dist/index.js +5 -6
- package/dist/inspect-CWwAuL-B.js +47 -0
- 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-CO4OqqaS.d.ts → internal-CKocv79I.d.ts} +3 -7
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{invocation-page-undo-DIZ-s3xT.js → invocation-page-undo-BEi-rO0Q.js} +5 -6
- package/dist/{invocations-CK_-G540.js → invocations-8NThe8Bx.js} +5 -6
- package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
- package/dist/logs/client.d.ts +19 -0
- package/dist/logs/client.js +11 -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/{mcp-client-CTbTbn7d.js → mcp-client-Bkh-khvr.js} +1 -2
- package/dist/{mcp-client-By4zk0vU.js → mcp-client-DiObFpDS.js} +35 -22
- package/dist/{mcp-client-C_sEmyQw.d.ts → mcp-client-Q2XbUXuP.d.ts} +1 -4
- package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
- package/dist/{media-BHpQ-4jw.js → media-CAKz9yrp.js} +8 -9
- package/dist/{media-library-NaOMBKWS.js → media-library-BDX89xXA.js} +5 -6
- package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
- package/dist/{memory-DTmq-Z6x.js → memory-D3EJS_Bp.js} +21 -10
- package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
- package/dist/nuxt-server-auto-imports-4aT5BD4u.js +74 -0
- package/dist/{nuxt-server-imports-DH60Z7LA.js → nuxt-server-imports-BdJqiVhT.js} +10 -18
- package/dist/nuxt.d.ts +1 -3
- package/dist/nuxt.js +339 -189
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-contributions-DpkO_iSU.d.ts → operation-contributions-BCcQVlGb.d.ts} +1 -3
- package/dist/{operation-contributions-BdS0z3tx.js → operation-contributions-D10pjkJF.js} +4 -5
- package/dist/operation-definition-DTpNvLd8.js +164 -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-EOdyctDc.js → operations-CD_mu_Ww.js} +86 -9
- package/dist/operations-D7ENc68Y.js +1 -0
- package/dist/{operations-B0689BG1.d.ts → operations-DgFhA1WE.d.ts} +8 -6
- package/dist/{operations-CWP9dF3i.js → operations-vRLiH7dh.js} +35 -46
- package/dist/optional-owners-DAfShdgV.js +353 -0
- package/dist/out-Cw5Tvr92.js +20989 -0
- package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
- package/dist/page/pill.iife.js +25 -27
- package/dist/{page-tool-CRCK1RHV.d.ts → page-tool-BUnUbuSy.d.ts} +6 -7
- package/dist/{page-tools-BkSSBFoi.js → page-tools-BQzwuAHD.js} +28 -12
- package/dist/{page-tools-sw4I-Nqx.d.ts → page-tools-UwsfvH-B.d.ts} +2 -4
- package/dist/{page-tools-shared-D3fFoEV2.js → page-tools-shared-hJcG_xk8.js} +8 -5
- package/dist/{inspect-CDw7e0vK.js → pathe.M-eThtNZ-D4EC7Wue.js} +2 -31
- package/dist/{plugins-BqAtIEX2.d.ts → plugins-BpiTVULl.d.ts} +252 -262
- package/dist/{plugins-B-DpgDPB.js → plugins-H6-MQrsn.js} +3483 -797
- package/dist/presets/workspace.js +1 -2
- package/dist/project-BxyyclTE.js +58 -0
- package/dist/{project-CufkVP1u.d.ts → project-DKBIHOf4.d.ts} +16 -4
- package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
- package/dist/{project-link-D-6UefhA.js → project-link-CeS0T8Pr.js} +57 -9
- package/dist/{project-link-BuOzBH9f.d.ts → project-link-isfdRO3Q.d.ts} +42 -6
- package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
- package/dist/project-session--GN7MduT.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-D7h3SQ92.d.ts → request-BC_krbEr.d.ts} +2 -4
- package/dist/request-CJCPyu2B.d.ts +70 -0
- package/dist/{request-DbFfYmCu.js → request-CQ8TkHLh.js} +4 -5
- package/dist/{request-DE8w_cSM.js → request-Cl68STwT.js} +7 -8
- package/dist/request-origin-pzWr9UUu.js +37 -0
- package/dist/rolldown-runtime-DegdyBIC.js +25 -0
- package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
- 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-DQuHg7OO.js → runtime-CRJsqVTa.js} +2 -3
- package/dist/{runtime-B_btezs1.d.ts → runtime-Cf8R1Ztr.d.ts} +0 -2
- package/dist/{runtime-DxfJOfCd.js → runtime-CyPZMiyK.js} +2 -3
- package/dist/{runtime-OsEDfbM9.js → runtime-F0CTqBFx.js} +5 -6
- package/dist/{runtime-feature-guard-B64MMW9I.js → runtime-feature-guard-DpUn4Oxc.js} +91 -10
- 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/{secret-Dy5uqvq9.js → secret-D2KL_o2h.js} +2 -3
- package/dist/{sections-Do7X4Nwt.d.ts → sections-0qrBvGbf.d.ts} +0 -4
- package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
- package/dist/{sections-BogiCmtz.d.ts → sections-BTfWK14a.d.ts} +4 -6
- package/dist/{sections-DumoLKQN.js → sections-BiCOk9qP.js} +1 -2
- package/dist/sections-DAtgYMVz.d.ts +8 -0
- package/dist/{sections-et20h8w3.js → sections-HLxb9MrG.js} +14 -7
- package/dist/{sections.get-COiLcQ0P.d.ts → sections.get-CGmtYmfu.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/{server-BRJE4t-W.js → server-DsOEa4_A.js} +5 -5
- package/dist/{setup-ZbA1by7W.d.ts → setup-Ca7jtBLS.d.ts} +8 -7
- package/dist/{setup-C-5nB7aY.js → setup-DQz_i-ee.js} +16 -5
- package/dist/{site-access-BmE8HGxs.js → site-access-1JIQjY11.js} +16 -16
- package/dist/{site-access-DxfdOel1.d.ts → site-access-CUXIbbbR.d.ts} +0 -2
- package/dist/{site-access-BycrwM2v.js → site-access-CmaZ-oaL.js} +1 -2
- package/dist/site-access-Cvmjb6aw.js +1 -0
- package/dist/{site-session-odJq1dYa.js → site-session-D36fr7Wf.js} +65 -40
- package/dist/skills/operations.d.ts +1 -5
- package/dist/skills/operations.js +4 -5
- package/dist/skills/vitehub/SKILL.md +142 -0
- package/dist/skills/vitehub/agents/openai.yaml +4 -0
- package/dist/skills/vitehub/references/agent-definitions.md +36 -0
- package/dist/skills/vitehub/references/bundle.md +57 -0
- package/dist/skills/vitehub/references/capabilities-authority.md +30 -0
- package/dist/skills/vitehub/references/channels-triggers.md +27 -0
- package/dist/skills/vitehub/references/framework-composition.md +29 -0
- package/dist/skills/vitehub/references/preview-contract.md +44 -0
- package/dist/skills/vitehub/references/primitives/auth.md +14 -0
- package/dist/skills/vitehub/references/primitives/blob.md +13 -0
- package/dist/skills/vitehub/references/primitives/browser.md +17 -0
- package/dist/skills/vitehub/references/primitives/cache.md +13 -0
- package/dist/skills/vitehub/references/primitives/channels.md +11 -0
- package/dist/skills/vitehub/references/primitives/connections.md +14 -0
- package/dist/skills/vitehub/references/primitives/content.md +13 -0
- package/dist/skills/vitehub/references/primitives/database.md +15 -0
- package/dist/skills/vitehub/references/primitives/email.md +11 -0
- package/dist/skills/vitehub/references/primitives/env.md +13 -0
- package/dist/skills/vitehub/references/primitives/kv.md +13 -0
- package/dist/skills/vitehub/references/primitives/markdown-template.md +13 -0
- package/dist/skills/vitehub/references/primitives/queue.md +14 -0
- package/dist/skills/vitehub/references/primitives/rate-limit.md +11 -0
- package/dist/skills/vitehub/references/primitives/realtime.md +19 -0
- package/dist/skills/vitehub/references/primitives/sandbox-task.md +11 -0
- package/dist/skills/vitehub/references/primitives/sandbox.md +13 -0
- package/dist/skills/vitehub/references/primitives/schedule.md +11 -0
- package/dist/skills/vitehub/references/primitives/shell.md +11 -0
- package/dist/skills/vitehub/references/primitives/source.md +11 -0
- package/dist/skills/vitehub/references/primitives/workflow.md +11 -0
- package/dist/skills/vitehub/references/primitives/workspace.md +11 -0
- package/dist/skills/vitehub/references/project-patterns.md +19 -0
- package/dist/skills/vitehub/references/project-shapes.md +81 -0
- package/dist/skills/vitehub/references/proof-recovery.md +31 -0
- package/dist/skills/vitehub/references/sandboxes-hosts.md +26 -0
- package/dist/skills/vitehub/references/schedules-workflows-invocations.md +28 -0
- package/dist/skills/vitehub/references/server-primitives.md +39 -0
- package/dist/skills/vitehub/references/workspaces-sources-access.md +26 -0
- package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
- package/dist/skills.d.ts +1 -2
- package/dist/{skills.get-Bl8cBe8u.js → skills.get-DAooGWy5.js} +3 -4
- package/dist/skills.js +1 -2
- package/dist/{source-D4wWtoHh.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/{ticket-Pr_8ZtXW.d.ts → ticket-BFWwevWN.d.ts} +0 -2
- package/dist/{ticket-Cudn1dq3.js → ticket-BwsnryuU.js} +2 -3
- package/dist/{tickets-C_0Fhc00.js → tickets-Cj9_y3gw.js} +14 -16
- package/dist/ui/motion/core.d.ts +1 -0
- package/dist/ui/motion/core.js +2 -0
- package/dist/ui/motion.d.ts +1 -0
- package/dist/ui/motion.js +2 -0
- package/dist/ui/vite.js +1 -2
- package/dist/{usage-CoQXs5nW.d.ts → usage-BduF04ks.d.ts} +0 -2
- package/dist/{usage-B4taNt4a.js → usage-ZV3TBMzE.js} +6 -5
- package/dist/{usage-index-BsGAFzyq.js → usage-index-CR_xTrXO.js} +3 -4
- package/dist/{version-DNmSsk5r.js → version-CAhBr673.js} +59 -21
- package/dist/{vite-stage-mmtwQIMA.js → vite-stage-Dmo4RgnK.js} +32 -8
- package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
- package/dist/workspace/blob-database/postgres.d.ts +1 -0
- package/dist/workspace/blob-database/postgres.js +2 -0
- package/dist/{workspace-history-CraoERnc.js → workspace-history-B52xib2J.js} +3 -4
- package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
- package/package.json +190 -149
- package/dist/agents-BoWau_ei.js +0 -2
- package/dist/cli-config-UAGTmuFa.js +0 -2
- package/dist/console/runtime/server/page-session.d.ts +0 -2
- package/dist/console/runtime/server/page-session.js +0 -5
- package/dist/console-lazy-views-DXnIkdyd.js +0 -2
- package/dist/operations-CAQmIxGK.js +0 -2
- package/dist/project-C4N_Zcjl.js +0 -30
- package/dist/request-origin-Bq7mDQG9.js +0 -23
- package/dist/scan-module-D_3X08mj.js +0 -2
- package/dist/sections-CyrXbbkG.d.ts +0 -10
- package/dist/site-access-BbJUe5QI.js +0 -2
- /package/dist/{agent/channels.d.ts → channels/adapters.d.ts} +0 -0
- /package/dist/{agent/channels.js → channels/adapters.js} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as ConsoleContributedSection } from "./definitions-
|
|
2
|
-
import { a as ConsoleSectionId, r as ConsoleSectionDetails } from "./sections-
|
|
3
|
-
import { a as RouteLocationRaw, o as RouteRecordRaw, r as RouteLocationNormalized, s as Router } from "./vue-router-
|
|
4
|
-
//#region src/console/runtime/client/sections.d.ts
|
|
1
|
+
import { t as ConsoleContributedSection } from "./definitions-ChvMnA1L.js";
|
|
2
|
+
import { a as ConsoleSectionId, r as ConsoleSectionDetails } from "./sections-0qrBvGbf.js";
|
|
3
|
+
import { a as RouteLocationRaw, o as RouteRecordRaw, r as RouteLocationNormalized, s as Router } from "./vue-router-plZJLlpm.js";
|
|
5
4
|
interface ConsoleNavigation {
|
|
6
5
|
/** Descriptors of the installed sections that owner packages contribute, keyed by section id. */
|
|
7
6
|
contributions: Readonly<Record<ConsoleSectionId, ConsoleContributedSection>>;
|
|
@@ -28,7 +27,7 @@ declare function loadConsoleNavigation(base: string): Promise<ConsoleNavigation
|
|
|
28
27
|
* `sections.list` call. A newer answer, such as the answer of this visit after a stored one, replaces it, and the
|
|
29
28
|
* subscribers get it when it changed.
|
|
30
29
|
*/
|
|
31
|
-
declare function seedConsoleNavigation(base: string,
|
|
30
|
+
declare function seedConsoleNavigation(base: string, answer: ConsoleNavigation): void;
|
|
32
31
|
/**
|
|
33
32
|
* Drop the navigation of `base` that a `project.get` answer gave, such as a stored one, when a newer answer has none.
|
|
34
33
|
* The sections come from `sections.list` again, and the subscribers get them.
|
|
@@ -53,5 +52,4 @@ declare const consolePendingSectionRoute: RouteRecordRaw & {
|
|
|
53
52
|
* sends the navigation to the real route, or to the Overview when the path is still unknown.
|
|
54
53
|
*/
|
|
55
54
|
declare function resolveConsoleSectionDeepLink(router: Router, to: RouteLocationNormalized, addSectionRoutes: () => Promise<void>): Promise<RouteLocationRaw | undefined>;
|
|
56
|
-
//#endregion
|
|
57
55
|
export { createConsoleSectionLoader as a, parseConsoleNavigation as c, resolveConsoleSectionDetails as d, seedConsoleNavigation as f, consoleSectionsPath as i, reloadConsoleNavigation as l, consoleNavigationError as n, isConsoleSectionRevoked as o, subscribeConsoleNavigation as p, consolePendingSectionRoute as r, loadConsoleNavigation as s, ConsoleNavigation as t, resolveConsoleSectionDeepLink as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/console/runtime/sections.ts
|
|
2
2
|
/** Sections that the Console UI in `vite-hub` renders with its own components. Owner packages contribute the others. */
|
|
3
3
|
const consoleBuiltinSectionIds = [
|
|
4
4
|
"env",
|
|
@@ -364,5 +364,4 @@ function rememberConsoleSection(section, storage) {
|
|
|
364
364
|
(storage ?? globalThis.localStorage)?.setItem(lastConsoleSectionStorageKey, section);
|
|
365
365
|
} catch {}
|
|
366
366
|
}
|
|
367
|
-
//#endregion
|
|
368
367
|
export { readLastConsoleSection as C, resolveConsoleSectionIds as D, resolveConsoleSectionGroup as E, prioritizeConsoleSectionIds as S, resolveConsoleSectionDocs as T, groupConsoleSections as _, consoleOverviewShortcut as a, isConsoleMcpClientEnabled as b, consoleSectionGroupIds as c, consoleSectionPageSegment as d, consoleSectionRouteName as f, describeConsoleSectionRoutes as g, consoleToolSectionIds as h, consoleGuide as i, consoleSectionGroupLabels as l, consoleSectionShortcutKeys as m, consoleDocsBase as n, consolePrimitives as o, consoleSectionShortcut as p, consoleGoToKey as r, consoleSectionDetails as s, consoleBuiltinSectionIds as t, consoleSectionPageRouteName as u, insertConsoleSection as v, rememberConsoleSection as w, isConsoleSectionId as x, isConsoleBuiltinSectionId as y };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as ConsoleProjectBuild } from "./project-DKBIHOf4.js";
|
|
2
|
+
import { a as ConsoleSectionId } from "./sections-0qrBvGbf.js";
|
|
3
|
+
import "./access-policy-CUbJLvlR.js";
|
|
4
|
+
import "./setup-Ca7jtBLS.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, x as isConsoleSectionId, y as isConsoleBuiltinSectionId } from "./sections-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { t as parseConsoleContributedSection } from "./definitions-BFYqXchw.js";
|
|
2
|
+
import { f as consoleSectionRouteName, s as consoleSectionDetails, v as insertConsoleSection, x as isConsoleSectionId, y as isConsoleBuiltinSectionId } from "./sections-BiCOk9qP.js";
|
|
3
|
+
import { t as consoleProject } from "./project-DRC67Uiu.js";
|
|
4
|
+
import { u as requestConsole } from "./request-Cl68STwT.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 {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/console/runtime/server/sections.get.d.ts
|
|
1
|
+
import { o as ConsoleAccess } from "./access-policy-CUbJLvlR.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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { o as encodeAgentRouteParam } from "./console-route-DbdnLkkF.js";
|
|
2
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
|
|
3
|
+
import { resolvePublicUrl } from "@vite-hub/runtime";
|
|
4
|
+
import { consoleInvocationUrl } from "@vite-hub/runtime/internal/console";
|
|
5
|
+
// src/console/server.ts
|
|
5
6
|
const agentConsole = { resolve(context) {
|
|
6
7
|
return { invocationUrl(invocation) {
|
|
7
8
|
if (typeof invocation.agentName !== "string" || typeof invocation.id !== "string") throw viteHubErrorDiagnostics.VITE_HUB_R0074({ message: "[vitehub] Console invocation URLs require an invocation with agentName and id." });
|
|
@@ -14,5 +15,4 @@ const agentConsole = { resolve(context) {
|
|
|
14
15
|
return consoleInvocationUrl(origin, invocation.agentName, invocation.id);
|
|
15
16
|
} };
|
|
16
17
|
} };
|
|
17
|
-
//#endregion
|
|
18
18
|
export { agentConsole as t };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./development-
|
|
5
|
-
|
|
1
|
+
import { t as ConsoleProjectBuild } from "./project-DKBIHOf4.js";
|
|
2
|
+
import { a as ConsoleSectionId } from "./sections-0qrBvGbf.js";
|
|
3
|
+
import "./access-policy-CUbJLvlR.js";
|
|
4
|
+
import "./development-I40mfD7B.js";
|
|
5
|
+
declare function installConsoleSiteDatabase(load: () => Promise<Record<string, {
|
|
6
|
+
db: object;
|
|
7
|
+
}>>, preferredName?: string): void;
|
|
6
8
|
declare function installConsoleSections(projectRoot: string, sections: readonly ConsoleSectionId[], navigationSections?: readonly ConsoleSectionId[]): readonly ConsoleSectionId[];
|
|
7
9
|
/** Generated production output installs what its build recorded, so `project.get` names the build that serves it. */
|
|
8
10
|
declare function installConsoleBuild(build: ConsoleProjectBuild): ConsoleProjectBuild;
|
|
9
11
|
/** Generated output installs the `vite-hub` version that the app built with, for `project.get`. */
|
|
10
12
|
declare function installConsoleVersion(version: string): string;
|
|
11
13
|
declare function installConsoleProjectName(projectRoot: string, projectName: string): string;
|
|
12
|
-
|
|
13
|
-
export { installConsoleVersion as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
14
|
+
export { installConsoleVersion as a, installConsoleSiteDatabase as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
|
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
|
+
}
|
|
4
16
|
function installConsoleSections(projectRoot, sections, navigationSections) {
|
|
5
17
|
const state = consoleState();
|
|
6
18
|
state.navigationSections = navigationSections ? [...new Set(navigationSections)] : void 0;
|
|
@@ -18,5 +30,4 @@ function installConsoleProjectName(projectRoot, projectName) {
|
|
|
18
30
|
installConsoleProjectRoot(projectRoot);
|
|
19
31
|
return consoleState().projectName = projectName;
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
export { installConsoleVersion as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
33
|
+
export { installConsoleVersion as a, installConsoleSiteDatabase as i, installConsoleProjectName as n, installConsoleSections as r, installConsoleBuild as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import { a as
|
|
6
|
-
import { a as
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { a as viteHubPageGrants } from "./page-tools-BQzwuAHD.js";
|
|
2
|
+
import { d as viteHubPageToolsResetCookie, p as viteHubSessionMarkerCookie, u as viteHubPageToolsQuery } from "./page-tools-shared-hJcG_xk8.js";
|
|
3
|
+
import { f as readConsoleAccessGrants, m as readConsoleOperationUser } from "./access-BBHk9b5P.js";
|
|
4
|
+
import { i as consoleRequestError } from "./request-CQ8TkHLh.js";
|
|
5
|
+
import { a as listConsoleSiteSessions, c as requireConsoleSiteKey, l as revokeConsoleSiteSession, o as openConsoleSiteSession, r as consoleSiteKV } from "./site-session-D36fr7Wf.js";
|
|
6
|
+
import { a as base64url, f as seeOther, i as authFailure, m as ticketProblem, n as appOrigin, o as consoleInvitePrefix, r as authConsole, s as consoleRecordStore, t as appBase, u as issueConsoleTicket } from "./tickets-Cj9_y3gw.js";
|
|
7
|
+
import "./site-access-CmaZ-oaL.js";
|
|
8
|
+
// src/console/runtime/server/site-access.ts
|
|
9
9
|
/**
|
|
10
10
|
* Site access: the Console signs browsers in to the app, so the page tools work there without a password.
|
|
11
11
|
*
|
|
@@ -41,9 +41,13 @@ function contextRequest(context) {
|
|
|
41
41
|
async function auth(request, event) {
|
|
42
42
|
return await authConsole(request, isRequestEvent(event) ? event : void 0);
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Site access refuses a link that cannot sign a browser in. With Auth, it needs the database and the `user.role` field
|
|
46
|
+
* that the redemption uses. Without Auth, it needs the secret of its cookie and a shared store.
|
|
47
|
+
*/
|
|
45
48
|
async function assertSiteAccess(request, event) {
|
|
46
|
-
|
|
49
|
+
const api = await auth(request, event);
|
|
50
|
+
if (api) return await unwrap(api.checkHost());
|
|
47
51
|
await requireConsoleSiteKey();
|
|
48
52
|
await consoleSiteKV();
|
|
49
53
|
}
|
|
@@ -240,8 +244,7 @@ async function listSessions(context) {
|
|
|
240
244
|
const api = await auth(contextRequest(context), context.event);
|
|
241
245
|
const known = /* @__PURE__ */ new Set([consoleGrant.id, ...viteHubPageGrants().map((grant) => grant.id)]);
|
|
242
246
|
if (!api) return { sessions: await listConsoleSiteSessions(known) };
|
|
243
|
-
return { sessions: (await unwrap(api.hostSessions([consoleGrant.id, guestRole]))).map(({ id, user, roles, device, createdAt, updatedAt, expiresAt }) => {
|
|
244
|
-
const guest = roles.includes(guestRole);
|
|
247
|
+
return { sessions: (await unwrap(api.hostSessions([consoleGrant.id, guestRole]))).map(({ id, user, roles, guest, device, createdAt, updatedAt, expiresAt }) => {
|
|
245
248
|
return {
|
|
246
249
|
id,
|
|
247
250
|
kind: guest ? "guest" : "member",
|
|
@@ -273,9 +276,7 @@ async function revokeSession(context, id) {
|
|
|
273
276
|
removedUser: revoked.guest
|
|
274
277
|
};
|
|
275
278
|
}
|
|
276
|
-
const {
|
|
277
|
-
const removedUser = roles.includes(guestRole);
|
|
278
|
-
if (removedUser) await unwrap(api.removeHostUser(userId));
|
|
279
|
+
const { removedUser } = await unwrap(api.revokeHostSession(id));
|
|
279
280
|
return {
|
|
280
281
|
revoked: true,
|
|
281
282
|
removedUser
|
|
@@ -288,5 +289,4 @@ function listGrants() {
|
|
|
288
289
|
membersOnly: true
|
|
289
290
|
}, ...viteHubPageGrants()] };
|
|
290
291
|
}
|
|
291
|
-
//#endregion
|
|
292
292
|
export { listSessions as a, revokeSession as c, listInvites as i, withPageTools as l, linkSite as n, openSiteSession as o, listGrants as r, revokeInvite as s, inviteGuest as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/console/runtime/site-access.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Site access: the browsers that the Console signed in to the app, so the page tools work there, and the guest invites
|
|
4
3
|
* that sign them in. The server answers these operations in `server/site-access.ts`; the Console section reads them.
|
|
@@ -51,5 +50,4 @@ interface SiteGrant {
|
|
|
51
50
|
description?: string;
|
|
52
51
|
membersOnly?: true;
|
|
53
52
|
}
|
|
54
|
-
//#endregion
|
|
55
53
|
export { siteStateCookie as a, siteAccessOperations as i, SiteInvite as n, SiteSession as r, SiteGrant as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/console/runtime/site-access.ts
|
|
2
2
|
/**
|
|
3
3
|
* Site access: the browsers that the Console signed in to the app, so the page tools work there, and the guest invites
|
|
4
4
|
* that sign them in. The server answers these operations in `server/site-access.ts`; the Console section reads them.
|
|
@@ -14,5 +14,4 @@ const siteAccessOperations = {
|
|
|
14
14
|
};
|
|
15
15
|
/** The cookie of `GET /_vitehub` that binds a Site access link to the browser that opened that route. */
|
|
16
16
|
const siteStateCookie = "__Host-vitehub-site-state";
|
|
17
|
-
//#endregion
|
|
18
17
|
export { siteStateCookie as n, siteAccessOperations as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as inviteGuest, n as linkSite, r as listGrants, i as listInvites, a as listSessions, o as openSiteSession, s as revokeInvite, c as revokeSession, l as withPageTools } from "./site-access-1JIQjY11.js";
|
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as getActiveCloudflareEnv, t as activeEnvStorageKey } from "./cloudflare-env-lookup-DcN7pGlv.js";
|
|
2
|
+
import { r as readViteHubSecret, t as deriveViteHubSecret } from "./secret-D2KL_o2h.js";
|
|
3
|
+
import { n as consoleState } from "./internal-0C_CC601.js";
|
|
4
|
+
import { c as isConsoleDevelopmentRuntime, i as consoleRequestError } from "./request-CQ8TkHLh.js";
|
|
5
|
+
import { r as getConsoleSections } from "./sections-BNTdIEJw.js";
|
|
5
6
|
import { importSealKey, sealWithKey, unsealWithKey } from "@vite-hub/env/seal";
|
|
6
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
|
-
|
|
8
|
+
// ../internal/src/runtime/cloudflare-env.ts
|
|
8
9
|
const runtimeGlobal = globalThis;
|
|
9
10
|
runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
|
|
10
11
|
function getActiveCloudflareBinding(name) {
|
|
11
12
|
const env = getActiveCloudflareEnv();
|
|
12
13
|
return env && Object.hasOwn(env, name) ? env[name] : void 0;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
//#region ../internal/src/runtime/user-agent.ts
|
|
15
|
+
// ../internal/src/runtime/user-agent.ts
|
|
16
16
|
/** A short device label of a browser, such as `Chrome · macOS`, for lists of sessions. It never shows the user agent itself. */
|
|
17
17
|
function userAgentDevice(userAgent) {
|
|
18
18
|
return `${/Edg\//.test(userAgent) ? "Edge" : /Firefox\//.test(userAgent) ? "Firefox" : /Chrome\//.test(userAgent) ? "Chrome" : /Safari\//.test(userAgent) ? "Safari" : "Unknown browser"} · ${/iPhone|iPad/.test(userAgent) ? "iOS" : /Android/.test(userAgent) ? "Android" : /Windows/.test(userAgent) ? "Windows" : /Macintosh/.test(userAgent) ? "macOS" : /Linux/.test(userAgent) ? "Linux" : "Unknown device"}`;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
//#region src/console/runtime/server/site-session.ts
|
|
22
|
-
/**
|
|
23
|
-
* Site access for an app without ViteHub Auth. Redeeming a `page.member` or `page.guest` ticket sets the `vitehub_site`
|
|
24
|
-
* cookie: the person and their roles, sealed with AES-GCM under a key that `VITEHUB_SECRET` gives for this purpose
|
|
25
|
-
* alone, as Comments seals its GitHub sign-in. The cookie is HttpOnly and lasts 7 days, as a Better Auth session does.
|
|
26
|
-
*
|
|
27
|
-
* The cookie trusts the ticket: a signed Console call made it, so the person and the roles are as trusted as the
|
|
28
|
-
* Console key. The browser cannot read or change the cookie. Each cookie also names a session in the app's KV store,
|
|
29
|
-
* and a cookie whose session is gone is ignored, so `site.revoke-session` signs the browser out.
|
|
30
|
-
*
|
|
31
|
-
* Tickets and sessions need a KV store that every instance of the app shares, and tickets need `getAndDelete()`, so a
|
|
32
|
-
* link works once also when two instances redeem it at the same time. A development server keeps both in memory.
|
|
33
|
-
*/
|
|
20
|
+
// src/console/runtime/server/site-session.ts
|
|
34
21
|
/** The cookie of a browser that Site access signed in, in an app without Auth. */
|
|
35
22
|
const consoleSiteCookie = "vitehub_site";
|
|
36
23
|
/** Seconds that the browser stays signed in, as Better Auth's default session. */
|
|
@@ -42,13 +29,20 @@ function unwrap([error, value]) {
|
|
|
42
29
|
if (error) throw error;
|
|
43
30
|
return value;
|
|
44
31
|
}
|
|
45
|
-
/** The keys of a KV store below a prefix. Some drivers list keys with `/` where the key had `:`. */
|
|
46
32
|
async function consoleSiteKeys(kv, prefix) {
|
|
47
33
|
return (unwrap(await kv.list({ prefix }))?.keys ?? []).map((key) => key.replaceAll("/", ":")).filter((key) => key.startsWith(prefix));
|
|
48
34
|
}
|
|
35
|
+
async function consoleSiteEntries(kv, prefix) {
|
|
36
|
+
const keys = await consoleSiteKeys(kv, prefix);
|
|
37
|
+
if (!keys.length) return [];
|
|
38
|
+
const values = kv.getMany ? unwrap(await kv.getMany(keys, { type: "text" })) ?? [] : await Promise.all(keys.map(async (key) => unwrap(await kv.get(key, { type: "text" }))));
|
|
39
|
+
return keys.map((key, index) => ({
|
|
40
|
+
key,
|
|
41
|
+
value: values[index]
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
49
44
|
const memoryKey = Symbol.for("vitehub.console.tickets");
|
|
50
45
|
const memoryScope = globalThis;
|
|
51
|
-
/** Keys in the memory of this process. Only a development server uses it: another instance would not see them. */
|
|
52
46
|
function memorySiteKV() {
|
|
53
47
|
const entries = memoryScope[memoryKey] ??= /* @__PURE__ */ new Map();
|
|
54
48
|
const live = (key) => {
|
|
@@ -82,7 +76,6 @@ function memorySiteKV() {
|
|
|
82
76
|
}
|
|
83
77
|
};
|
|
84
78
|
}
|
|
85
|
-
/** Drivers whose `getAndDelete()` is atomic, so a one-time link works once across instances. */
|
|
86
79
|
const atomicDrivers = [
|
|
87
80
|
"database",
|
|
88
81
|
"redis",
|
|
@@ -96,10 +89,42 @@ function setConsoleSiteKV(kv) {
|
|
|
96
89
|
function storeMissing(why) {
|
|
97
90
|
return consoleRequestError(500, `One-time links need a store that every instance of the app shares. ${why}`, "CONSOLE_TICKET_STORE_MISSING");
|
|
98
91
|
}
|
|
92
|
+
const consoleSiteTable = "vitehub_console_site";
|
|
93
|
+
const databaseSiteKVs = /* @__PURE__ */ new WeakMap();
|
|
94
|
+
async function databaseSiteKV() {
|
|
95
|
+
const entry = await consoleState().siteDatabase?.();
|
|
96
|
+
if (!entry) return void 0;
|
|
97
|
+
const { name, db } = entry;
|
|
98
|
+
const root = siteRootSecret();
|
|
99
|
+
if (!root) throw siteSecretMissing();
|
|
100
|
+
const cached = databaseSiteKVs.get(db);
|
|
101
|
+
if (cached?.root === root) return cached.store;
|
|
102
|
+
const namespace = await deriveViteHubSecret(root, "vitehub:site:storage");
|
|
103
|
+
const { default: createDatabaseKVDriver, kvSqlClientFromDatabase } = await import("@vite-hub/kv/runtime/database");
|
|
104
|
+
const driver = createDatabaseKVDriver({
|
|
105
|
+
driver: "database",
|
|
106
|
+
database: name,
|
|
107
|
+
namespace
|
|
108
|
+
}, async () => kvSqlClientFromDatabase(db, name), consoleSiteTable);
|
|
109
|
+
const text = (value) => value === null || value === void 0 ? null : String(value);
|
|
110
|
+
const store = {
|
|
111
|
+
set: async (key, value, { ttl }) => [void 0, await driver.setItem?.(key, value, { ttl })],
|
|
112
|
+
get: async (key) => [void 0, text(await driver.getItem(key))],
|
|
113
|
+
getMany: async (keys) => [void 0, (await driver.getItems(keys.map((key) => ({ key })), {})).map((item) => text(item.value))],
|
|
114
|
+
getAndDelete: async (key) => [void 0, text(await driver.getAndDeleteItem?.(key))],
|
|
115
|
+
list: async ({ prefix }) => [void 0, { keys: await driver.getKeys(prefix, {}) }],
|
|
116
|
+
delete: async (key) => [void 0, await driver.removeItem?.(key, {})]
|
|
117
|
+
};
|
|
118
|
+
databaseSiteKVs.set(db, {
|
|
119
|
+
root,
|
|
120
|
+
store
|
|
121
|
+
});
|
|
122
|
+
return store;
|
|
123
|
+
}
|
|
99
124
|
/**
|
|
100
125
|
* The KV store of tickets without Auth, and of site sessions: the app's default KV store when its driver takes a key
|
|
101
|
-
* out atomically. A development server keeps them in memory.
|
|
102
|
-
* `CONSOLE_TICKET_STORE_MISSING`.
|
|
126
|
+
* out atomically, else the `database` KV driver over the app's Database. A development server keeps them in memory.
|
|
127
|
+
* Otherwise it fails closed with `CONSOLE_TICKET_STORE_MISSING`.
|
|
103
128
|
*/
|
|
104
129
|
async function consoleSiteKV() {
|
|
105
130
|
if (installedKV) return installedKV;
|
|
@@ -107,23 +132,26 @@ async function consoleSiteKV() {
|
|
|
107
132
|
if (!getConsoleSections().includes("kv")) throw storeMissing("The app has no Auth Database and no KV store.");
|
|
108
133
|
const { getKVStoreDriver, kv } = await import("@vite-hub/kv");
|
|
109
134
|
const driver = await getKVStoreDriver();
|
|
110
|
-
if (
|
|
111
|
-
|
|
135
|
+
if (atomicDrivers.includes(driver)) return kv;
|
|
136
|
+
const database = await databaseSiteKV();
|
|
137
|
+
if (database) return database;
|
|
138
|
+
throw storeMissing(`The default KV store uses the ${driver} driver, which cannot take a link out once when two instances ask at the same time, and the app has no Database to keep links in.`);
|
|
112
139
|
}
|
|
113
140
|
function serverEnv(name) {
|
|
114
141
|
const value = getActiveCloudflareBinding(name) ?? globalThis.process?.env?.[name];
|
|
115
142
|
return typeof value === "string" && value ? value : void 0;
|
|
116
143
|
}
|
|
144
|
+
function siteRootSecret() {
|
|
145
|
+
return readViteHubSecret({ VITEHUB_SECRET: serverEnv("VITEHUB_SECRET") });
|
|
146
|
+
}
|
|
147
|
+
function siteSecretMissing() {
|
|
148
|
+
return consoleRequestError(500, "Site access without Auth needs VITEHUB_SECRET, and the app has none.", "CONSOLE_SITE_SECRET_MISSING");
|
|
149
|
+
}
|
|
117
150
|
const keyCache = {};
|
|
118
151
|
const developmentSlot = Symbol.for("vitehub.console.site-key");
|
|
119
152
|
const developmentScope = globalThis;
|
|
120
|
-
/**
|
|
121
|
-
* The key of the cookie: derived from `VITEHUB_SECRET` for Site access alone, so the app's other cookies and this one
|
|
122
|
-
* never open each other. A development server without the secret uses a random key of this process. In production,
|
|
123
|
-
* the key is undefined without the secret, and a short secret throws, as for Comments.
|
|
124
|
-
*/
|
|
125
153
|
async function siteKey() {
|
|
126
|
-
const root =
|
|
154
|
+
const root = siteRootSecret();
|
|
127
155
|
if (!root) {
|
|
128
156
|
if (!isConsoleDevelopmentRuntime()) return void 0;
|
|
129
157
|
return await (developmentScope[developmentSlot] ??= importSealKey(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32))));
|
|
@@ -137,7 +165,7 @@ async function siteKey() {
|
|
|
137
165
|
/** The key of the cookie, or `CONSOLE_SITE_SECRET_MISSING` before a ticket is made or redeemed. */
|
|
138
166
|
async function requireConsoleSiteKey() {
|
|
139
167
|
const key = await siteKey();
|
|
140
|
-
if (!key) throw
|
|
168
|
+
if (!key) throw siteSecretMissing();
|
|
141
169
|
return key;
|
|
142
170
|
}
|
|
143
171
|
function strings(value) {
|
|
@@ -246,9 +274,7 @@ async function readConsoleSiteVisitor(request) {
|
|
|
246
274
|
}
|
|
247
275
|
/** The browsers that Site access signed in without Auth, most recently signed in first. */
|
|
248
276
|
async function listConsoleSiteSessions(known) {
|
|
249
|
-
|
|
250
|
-
const keys = await consoleSiteKeys(kv, sessionPrefix);
|
|
251
|
-
return (await Promise.all(keys.map(async (key) => readRecord(unwrap(await kv.get(key, { type: "text" })))))).filter((record) => record !== void 0 && record.expiresAt > Date.now()).sort((a, b) => b.createdAt - a.createdAt).map((record) => ({
|
|
277
|
+
return (await consoleSiteEntries(await consoleSiteKV(), sessionPrefix)).map(({ value }) => readRecord(value)).filter((record) => record !== void 0 && record.expiresAt > Date.now()).sort((a, b) => b.createdAt - a.createdAt).map((record) => ({
|
|
252
278
|
id: record.id,
|
|
253
279
|
kind: record.kind,
|
|
254
280
|
person: { ...record.person },
|
|
@@ -268,5 +294,4 @@ async function revokeConsoleSiteSession(id) {
|
|
|
268
294
|
unwrap(await kv.delete(key));
|
|
269
295
|
return { guest: record.kind === "guest" };
|
|
270
296
|
}
|
|
271
|
-
|
|
272
|
-
export { listConsoleSiteSessions as a, requireConsoleSiteKey as c, consoleSiteLifetime as i, revokeConsoleSiteSession as l, consoleSiteKV as n, openConsoleSiteSession as o, consoleSiteKeys as r, readConsoleSiteVisitor as s, consoleSiteCookie as t, setConsoleSiteKV as u };
|
|
297
|
+
export { listConsoleSiteSessions as a, requireConsoleSiteKey as c, consoleSiteLifetime as i, revokeConsoleSiteSession as l, consoleSiteEntries as n, openConsoleSiteSession as o, consoleSiteKV as r, readConsoleSiteVisitor as s, consoleSiteCookie as t, setConsoleSiteKV as u };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as AnyOperation } from "../operations-
|
|
2
|
-
//#region src/skills/runtime.d.ts
|
|
1
|
+
import { n as AnyOperation } from "../operations-DgFhA1WE.js";
|
|
3
2
|
/** One skill that the app serves, as the Console and `vitehub served-skills` show it. */
|
|
4
3
|
interface ServedSkillSummary {
|
|
5
4
|
/** The skill name. The Console lists rows by `id`. */
|
|
@@ -9,9 +8,6 @@ interface ServedSkillSummary {
|
|
|
9
8
|
enabled: boolean;
|
|
10
9
|
files: number;
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/skills/operations.d.ts
|
|
14
11
|
/** The `served-skills.*` operations: list and set. The Console, `vitehub served-skills`, and agents run them. */
|
|
15
12
|
export declare const servedSkillsOperations: readonly AnyOperation[];
|
|
16
|
-
//#endregion
|
|
17
13
|
export type { ServedSkillSummary };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as defineOperation } from "../operation-definition-
|
|
2
|
-
import {
|
|
1
|
+
import { t as defineOperation } from "../operation-definition-DTpNvLd8.js";
|
|
2
|
+
import { _ as table } from "../operations-CD_mu_Ww.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
|
-
|
|
5
|
-
const runtime = () => import("../runtime-
|
|
4
|
+
// src/skills/operations.ts
|
|
5
|
+
const runtime = () => import("../runtime-CAbuQGMP.js");
|
|
6
6
|
function defineServedSkillsOperation(definition) {
|
|
7
7
|
return defineOperation({
|
|
8
8
|
...definition,
|
|
@@ -47,5 +47,4 @@ const servedSkillsOperations = [defineServedSkillsOperation({
|
|
|
47
47
|
name: "served-skills.set",
|
|
48
48
|
run: async ({ name, enabled }) => (await runtime()).setServedSkill(name, enabled)
|
|
49
49
|
})];
|
|
50
|
-
//#endregion
|
|
51
50
|
export { servedSkillsOperations };
|