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
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vitehub
|
|
3
|
+
description: Build, change, and debug ViteHub apps. Use in an app with ViteHub before you write auth, migration, storage, realtime, skill, logging, rate limit, env, or deploy code, and for server primitives and Runtime Helpers, Agent Definitions, Provider Output, hosts, and deployment.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ViteHub
|
|
7
|
+
|
|
8
|
+
Use one proof loop: orient, look up the built-in, route, inspect the contract, build, and prove. Exact package exports, installed types, and current raw docs outrank remembered or project-example syntax.
|
|
9
|
+
|
|
10
|
+
## 1. Orient
|
|
11
|
+
|
|
12
|
+
- In an existing project, run `pnpm vitehub status --json` first. It parses the config without running it, so it works on a broken config. It names the framework, the host, each feature as `on`, `off`, or `unknown`, the missing packages with their fix, and the host link. In an empty folder, start with `pnpm dlx vite-hub catalog --json`, then create the project with `pnpm dlx vite-hub init`. Where a project exists but `vite-hub` is not installed yet, run `pnpm dlx vite-hub status --json`. No npm package is named `vitehub`, so `npx vitehub` fails. Use the package name `vite-hub`.
|
|
13
|
+
- Run `pnpm vitehub catalog --json` before you choose a feature or a host. Where `vite-hub` is not installed yet, use `pnpm dlx vite-hub catalog --json`. It lists each feature key, its packages, and how each host supports it (`native`, `explicit`, or `unsupported`), from the same catalog that the build checks. See [Read a project without loading it](https://vitehub.dev/raw/docs/cli/project.md#read-a-project-without-loading-it).
|
|
14
|
+
- Then read only what the two commands do not answer: the lockfile, the server entry, nearby project instructions, and config parts that `status` reports as `unknown` or `manual`.
|
|
15
|
+
- Identify installed ViteHub packages and versions, package manager, framework, host target, and requested outcome.
|
|
16
|
+
- Open `https://vitehub.dev/llms.txt`, then select the smallest raw Markdown page covering the primary behavior. Links inside references are selection menus; do not open every linked page.
|
|
17
|
+
|
|
18
|
+
Orientation is complete when the current setup, target outcome, host boundary, and first docs URL are named.
|
|
19
|
+
|
|
20
|
+
## 2. Look up the built-in first
|
|
21
|
+
|
|
22
|
+
ViteHub ships code that apps often write by hand. Before you write or change auth, migration, storage, realtime, skill, logging, rate limit, env, or deploy code, find the problem in this table. Also read the app code that already does the job: a built-in can ship after the app wrote its own version. A row is a candidate, not a drop-in: its limits column says where the built-in behaves differently.
|
|
23
|
+
|
|
24
|
+
| Problem | Built-in | Limits | Docs |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| Migrations: a `drizzle.config.ts`, `drizzle-kit` scripts, or SQL files written by hand | `vitehub database generate`, then `vitehub database migrate`. `vitehub database up` converts an old folder once | Old flat migration folders need `vitehub database up` first | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#apply-migrations) |
|
|
27
|
+
| Apply migrations when the server starts or deploys: a custom migrator, or `wrangler d1 migrations apply` in a script | `database.migrateOnStart` on Node, `database.migrateOnDeploy` on Cloudflare, `ensureMigrations()` in a task or test | `migrateOnStart` runs only in a Node server build, never in development; it migrates SQLite only when set to `true` | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#migrate-when-the-server-starts) |
|
|
28
|
+
| Copy the SQLite file before migrations, such as with `VACUUM INTO` | `database.migrateOnStart: { backup: true }` | Local SQLite files only. Copies only when a migration is pending, and keeps 3 unless you set `keep` | [database/configure](https://vitehub.dev/raw/docs/database/configure.md#back-up-sqlite-before-migrations) |
|
|
29
|
+
| Dump a database to a SQL file | `vitehub database export` | - | [cli/primitives](https://vitehub.dev/raw/docs/cli/primitives.md) |
|
|
30
|
+
| Split a long `inArray()` list or a multi-row insert for the D1 parameter limit | `chunkParameters()` from `vite-hub/database` | - | [database/server-api](https://vitehub.dev/raw/docs/database/server-api.md#stay-under-the-bound-parameter-limit) |
|
|
31
|
+
| Run a webhook or a retried request once per key | `withIdempotency()` from `vite-hub/database` | Not exactly once: a crash after the work, or a run longer than `timeout` (300 s), runs it again. Keep the provider's own idempotency key | [database/server-api](https://vitehub.dev/raw/docs/database/server-api.md#run-work-once-for-a-key) |
|
|
32
|
+
| Let one runner at a time do a job, such as a get-then-set flag on a storage key | `kv.lock(key, { ttl }).run()` from `vite-hub/kv` | Needs the `redis`, `upstash`, or `database` KV driver. On `fs-lite`, `deno-kv`, and Cloudflare KV, `run()` returns `KV_UNSUPPORTED_OPERATION` and skips the job. The lock expires after `ttl` and never renews | [kv/server-api](https://vitehub.dev/raw/docs/kv/server-api.md#locks) |
|
|
33
|
+
| Sign people in from the headers of oauth2-proxy (`x-auth-request-*`), Cloudflare Access, or Tailscale Serve | `forwardAuth()` from `vite-hub/auth/forward` | `verify` must prove the header, since anyone who reaches the app without the proxy can send it | [auth/configure](https://vitehub.dev/raw/docs/auth/configure.md#sign-in-through-a-trusted-proxy) |
|
|
34
|
+
| Turn skills on and off while the app runs, such as with a settings table | `skillSettings()` from `vite-hub/skills` | - | [console/skills](https://vitehub.dev/raw/docs/console/skills.md#turn-skills-on-and-off) |
|
|
35
|
+
| Presence or cursors in a Realtime room that has no shared document | `defineRealtime({ document: false })` | - | [realtime/server-api](https://vitehub.dev/raw/docs/realtime/server-api.md#presence-without-an-editor) |
|
|
36
|
+
| Limit requests per user, IP, or key | `requireRateLimit(event, id, options)` from `vite-hub/rate-limit` | - | [rate-limit/server-api](https://vitehub.dev/raw/docs/rate-limit/server-api.md) |
|
|
37
|
+
| A same-origin check for writes, a request body limit, or security headers | `sameOriginWrites: true` and `security` with `maxBodySize` in `vitehub()` | `sameOriginWrites` checks only writes that carry cookies; a write without cookies passes. `maxBodySize` applies to every route, not one | [frameworks-hosts/production](https://vitehub.dev/raw/docs/frameworks-hosts/production.md#add-security-headers-and-a-body-limit) |
|
|
38
|
+
| Read and check `process.env` values | `vitehub({ env })` and `useServerEnv()` from `vite-hub/env` | - | [env/configure](https://vitehub.dev/raw/docs/env/configure.md) |
|
|
39
|
+
| A logger or a log event per request | `vitehub({ logs })` with Evlog | - | [logs/configure](https://vitehub.dev/raw/docs/logs/configure.md) |
|
|
40
|
+
| Deploy scripts: `wrangler deploy --secrets-file`, or creating host resources by hand | `vitehub deploy`, with `--push-env` for env values | - | [cli/project](https://vitehub.dev/raw/docs/cli/project.md#deploy-from-your-machine) |
|
|
41
|
+
| Move ViteHub packages to a new version | `vitehub update` | - | [cli/project](https://vitehub.dev/raw/docs/cli/project.md#update-vitehub-packages) |
|
|
42
|
+
|
|
43
|
+
When a row matches, read its docs page and compare the built-in with the app's own code before you delete anything:
|
|
44
|
+
|
|
45
|
+
- The installed ViteHub version exports it (step 4 checks the exact contract).
|
|
46
|
+
- It works on the app's host and driver, such as the KV driver for `kv.lock`.
|
|
47
|
+
- It keeps every guarantee the app's code gives: the same requests refused, the same retries, the same data kept.
|
|
48
|
+
|
|
49
|
+
When all three hold, switch to the built-in and delete the app's own version in the same change. When one fails, keep the app's code and say which limit stopped the switch. When no row matches, search `https://vitehub.dev/llms.txt` for the problem before you write the code.
|
|
50
|
+
|
|
51
|
+
This step is complete when each piece of planned code is a built-in that passed the three checks, or you can name the docs page or limit that rules it out.
|
|
52
|
+
|
|
53
|
+
## 3. Route before code
|
|
54
|
+
|
|
55
|
+
Choose one primary lane. Server Primitives serve application behavior through Vite Integrations and Runtime Helpers. Agents serve model-backed, provider-backed, or custom-run behavior through Agent Definitions; they may compose Server Primitives without changing the primary lane.
|
|
56
|
+
|
|
57
|
+
Read only the references whose conditions match, but read them before writing code:
|
|
58
|
+
|
|
59
|
+
| Task condition | Required reference |
|
|
60
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
61
|
+
| New project, uncertain file layout, or cross-feature composition | [Project shapes](references/project-shapes.md) |
|
|
62
|
+
| Released or `pkg.pr.new` installation, upgrade, or package mismatch | [Installed and preview contracts](references/preview-contract.md) |
|
|
63
|
+
| Choosing between Server Primitives | [Server Primitives](references/server-primitives.md) |
|
|
64
|
+
| Auth, sessions, or route protection | [Auth](references/primitives/auth.md) |
|
|
65
|
+
| Blob uploads, direct uploads to storage, copies, or object storage | [Blob](references/primitives/blob.md) |
|
|
66
|
+
| Browser sessions or remote browser actions | [Browser](references/primitives/browser.md) |
|
|
67
|
+
| Outbound application message delivery | [Channels](references/primitives/channels.md) |
|
|
68
|
+
| OAuth or provider account access | [Connections](references/primitives/connections.md) |
|
|
69
|
+
| Comark content, Markdown, or content queries | [Content](references/primitives/content.md) |
|
|
70
|
+
| Relational data, Drizzle, Postgres replicas, seeds, or SQL from the CLI | [Database](references/primitives/database.md) |
|
|
71
|
+
| Email or Markdown email templates | [Email](references/primitives/email.md) |
|
|
72
|
+
| Public, server, secret, or provider-backed values | [Env](references/primitives/env.md) |
|
|
73
|
+
| KV values, flags, cursors, short-lived state, or a lock that runs a job once | [KV](references/primitives/kv.md) |
|
|
74
|
+
| Queue jobs and consumers | [Queue](references/primitives/queue.md) |
|
|
75
|
+
| Atomic request budgets | [Rate Limit](references/primitives/rate-limit.md) |
|
|
76
|
+
| Realtime collaboration | [Realtime](references/primitives/realtime.md) |
|
|
77
|
+
| Isolated provider-backed task runs | [Sandbox Tasks](references/primitives/sandbox-task.md) |
|
|
78
|
+
| Static cron schedules | [Schedule](references/primitives/schedule.md) |
|
|
79
|
+
| Bounded shell commands | [Shell](references/primitives/shell.md) |
|
|
80
|
+
| Read-only external files or resources | [Source](references/primitives/source.md) |
|
|
81
|
+
| Durable long-running orchestration | [Workflow](references/primitives/workflow.md) |
|
|
82
|
+
| Persistent files, Sources, snapshots, or write-back | [Workspace](references/primitives/workspace.md) |
|
|
83
|
+
| Trusted-host or provider execution sessions | [Sandboxes](references/primitives/sandbox.md) |
|
|
84
|
+
| Nitro cache storage, cache tags, or invalidation | [Cache](references/primitives/cache.md) |
|
|
85
|
+
| Markdown rendering with bindings | [Markdown Templates](references/primitives/markdown-template.md) |
|
|
86
|
+
| Modify an existing framework integration; add Nitro or Nuxt; use generated types; configure a provider; or diagnose a framework-specific failure | [Framework composition](references/framework-composition.md) |
|
|
87
|
+
| Agent Definition, Agent Driver, Agent Invocation, instructions, output, hooks, or Evals | [Agent Definitions and Drivers](references/agent-definitions.md) |
|
|
88
|
+
| Workspace, Source, access scope, mounted files, or write-back | [Workspaces, Sources, and access](references/workspaces-sources-access.md) |
|
|
89
|
+
| Agent Channel, Trigger, webhook admission, concurrency, or Agent delivery | [Channels and Triggers](references/channels-triggers.md) |
|
|
90
|
+
| Capability, tool, secret, rate limit, telemetry, or other granted authority | [Capabilities and authority](references/capabilities-authority.md) |
|
|
91
|
+
| Schedule, Workflow, orchestration retry, idempotency, or terminal state | [Schedules, Workflows, and Invocations](references/schedules-workflows-invocations.md) |
|
|
92
|
+
| Sandbox, trusted host, isolation, required command, host link, deploy, Console link, or deployed version | [Sandboxes and hosts](references/sandboxes-hosts.md) |
|
|
93
|
+
| Bundle size, startup cost, host size limits, why a package is in the output, or whether a change made the bundle smaller | [Bundle size and startup cost](references/bundle.md) |
|
|
94
|
+
| A proof has failed, generated state disagrees, or a runtime/host failure needs diagnosis | [Proof and recovery](references/proof-recovery.md) |
|
|
95
|
+
| Looking for a complete public application pattern | [Project patterns](references/project-patterns.md) |
|
|
96
|
+
|
|
97
|
+
Routing is complete when every requested behavior has one primary lane and every matching reference has been read. Start with the smallest matching set, then add a cross-cutting reference when the task spans lanes.
|
|
98
|
+
|
|
99
|
+
## 4. Inspect the installed contract
|
|
100
|
+
|
|
101
|
+
- Read each installed package's `package.json`, exports, relevant types, and generated declarations before writing imports or options.
|
|
102
|
+
- For a fresh application, create it with `vitehub init` (see [Project shapes](references/project-shapes.md)), then use the root integration plus feature subpaths. Opt-in features such as Agent, Auth, Database, Schedule, Workspace, Realtime, Content, and Comments also need their owner package next to `vite-hub`. `vitehub add` installs it, `vitehub status` lists any that is missing, and the build error names it. Use other direct owner packages only for a focused library, an unexported advanced subpath, or an installed older contract.
|
|
103
|
+
- When docs, examples, and installed artifacts disagree, implement the installed artifacts and record the mismatch. Treat project examples as patterns whose imports must be revalidated.
|
|
104
|
+
|
|
105
|
+
Contract inspection is complete when every planned package, import, option, generated path, and runtime entry exists in the installed graph; no syntax is inferred only from memory.
|
|
106
|
+
|
|
107
|
+
## 5. Build the coherent file set
|
|
108
|
+
|
|
109
|
+
Before editing, map every requested behavior to:
|
|
110
|
+
|
|
111
|
+
| Behavior | Package owner | Source file | Runtime path | Authority or persistence | Proof |
|
|
112
|
+
| -------- | ------------- | ----------- | ------------ | ------------------------ | ----- |
|
|
113
|
+
|
|
114
|
+
Then implement the smallest coherent set: manifest and lockfile, framework integration, discovered Definition where needed, application or orchestration entrypoint, and proof surface. Keep application authority in application code; grant an Agent access only through visible Capabilities, Workspace rules, Sources, or Channels.
|
|
115
|
+
|
|
116
|
+
Turn features on with `vitehub add <feature>`, not by editing `vitehub({...})` by hand. It checks the host against the catalog, installs the owner packages, creates requested starter files, and edits the config last. Package installs are not rolled back: a failed install can leave the manifest and lockfile changed without enabling the feature. See [Add a feature](https://vitehub.dev/raw/docs/cli/project.md#add-a-feature).
|
|
117
|
+
|
|
118
|
+
- Run `--dry-run` first and read the diff, then apply with `--yes`. Without a terminal, `add` writes nothing until it gets `--yes`.
|
|
119
|
+
- Pass `--name <name>` for a starter Definition, such as `server/queues/<name>.ts`. It never overwrites a file.
|
|
120
|
+
- Pass provider options as `--option key=value`, such as `--option email.driver=resend`.
|
|
121
|
+
- Follow the exit code. `0`: done or unchanged. `2`: input is needed; run the `rerun` command it prints, or supply the options listed in `missing` with their `choices`. `3`: a conflict; read the diagnostic code. For `SETUP_FILE_EXISTS`, choose another `--name`, or edit the existing file by hand and then rerun `vitehub add <feature> --yes` without `--name`, keeping the required `--option` values, to install packages and enable the feature. For `SETUP_CONFIG_MANUAL`, paste the printed `snippet` into the `vitehub()` options by hand. For an unsupported feature, choose another host or report the boundary, because a hand-written key does not give the host the feature. `4` (`SETUP_STALE_PLAN`): the config changed during installation; discard the plan and rerun against the current config.
|
|
122
|
+
- Turn a feature off with `vitehub remove <feature>`. Run `--dry-run` first and read the plan, then apply with `--yes`. It deletes the config key, deletes starter files that are still unchanged, and uninstalls packages that nothing else uses. Exit `3` means another feature implies it (`SETUP_FEATURE_IMPLIED`, see `impliedBy`) or the app still uses it (`SETUP_FEATURE_IN_USE`): `references` lists each file and line, including starter files you edited. Delete or move those files and run it again. Pass `--force` only when the developer wants the feature off and the files kept. `remove` never deletes host resources, local data, or the host link; `nextSteps` names the host resources to delete by hand. See [Remove a feature](https://vitehub.dev/raw/docs/cli/project.md#remove-a-feature).
|
|
123
|
+
|
|
124
|
+
Building is complete when every requested behavior has an implemented row and no placeholder, unused integration, implicit authority, or unowned persistence remains.
|
|
125
|
+
|
|
126
|
+
## 6. Prove and repair
|
|
127
|
+
|
|
128
|
+
- Run the narrow typecheck or package test nearest the change, then the relevant build.
|
|
129
|
+
- Run Vite Doctor with the ViteHub rules. The `vite-doctor` CLI does not read `vite.config.ts`, so register the extension in a config file. Name the pack in `extends`, or its rules do not run. `auto` keeps the other packs:
|
|
130
|
+
|
|
131
|
+
```ts [doctor.config.ts]
|
|
132
|
+
import { defineDoctorConfig } from 'vite-doctor/config'
|
|
133
|
+
import vitehub from 'vite-hub/doctor'
|
|
134
|
+
|
|
135
|
+
export default defineDoctorConfig({ extensions: [vitehub], extends: ['auto', 'vitehub/recommended'] })
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Run `pnpm vite-doctor . --config doctor.config.ts` and fix each `VHUB` finding. See [Doctor rules](https://vitehub.dev/raw/docs/reference/doctor-rules.md).
|
|
139
|
+
- Prove the actual lane: execute the Runtime Helper, perform an Agent Invocation, exercise the webhook or schedule, or inspect generated Provider Output.
|
|
140
|
+
- On failure, return to installed exports/types, `.vitehub` generated state, the selected raw docs page, and [Proof and recovery](references/proof-recovery.md). Repair the cause and rerun the same proof.
|
|
141
|
+
|
|
142
|
+
The task is complete when every behavior row has an observed result, or a precise source-backed unsupported boundary, and Doctor reports no `VHUB` finding. Report commands and observations, docs URLs, installed ViteHub versions or preview commit, contract mismatches, and host limitations.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Agent Definitions and Drivers
|
|
2
|
+
|
|
3
|
+
Use this for Agent Definitions, model or provider Drivers, deterministic custom Drivers, instructions, structured output, hooks, or Evals.
|
|
4
|
+
|
|
5
|
+
## Select current pages
|
|
6
|
+
|
|
7
|
+
For a first deterministic custom Driver and direct invocation, open only [First Agent](https://vitehub.dev/raw/docs/getting-started/first-agent.md). Use [Agent Definitions](https://vitehub.dev/raw/docs/agents/agent-definitions.md) for advanced composition or discovery, [Agent Drivers](https://vitehub.dev/raw/docs/agents/agent-drivers.md) for model/provider details, and [Agent Invocations](https://vitehub.dev/raw/docs/agents/invocations.md) for advanced runtime context. Open [Instructions](https://vitehub.dev/raw/docs/agents/instructions.md) or [Evals](https://vitehub.dev/raw/docs/agents/evals.md) only when that behavior is requested. Do not read the whole set.
|
|
8
|
+
|
|
9
|
+
## Definition shape
|
|
10
|
+
|
|
11
|
+
Default-export one `defineAgent()` boundary from a documented Agent discovery
|
|
12
|
+
path, commonly `server/agents/<name>.ts` or `server/agents/<name>/agent.ts`.
|
|
13
|
+
Check [File conventions](https://vitehub.dev/raw/docs/reference/file-conventions.md)
|
|
14
|
+
when the project uses another supported suffix or location. Compose only the
|
|
15
|
+
facets the outcome needs:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
driver how the Agent runs
|
|
19
|
+
instructions model-facing behavior
|
|
20
|
+
workspace files and Sources available to the invocation
|
|
21
|
+
capabilities granted tools and authority
|
|
22
|
+
channels external conversation adapters
|
|
23
|
+
hooks/output lifecycle and delivery behavior
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use a deterministic custom `driver.run` for the first offline proof. Add model credentials, provider executable prerequisites, and sandbox requirements only when the requested outcome needs them.
|
|
27
|
+
|
|
28
|
+
Keep repository-wide guidance in repository files, Agent behavior in Driver Instructions, and reusable runtime Skills in the documented Agent skill surface.
|
|
29
|
+
|
|
30
|
+
## Invocation boundary
|
|
31
|
+
|
|
32
|
+
Pass invocation input separately from trusted runtime context. Keep run identity, memoization, wait-until behavior, invoker/admission context, and runtime selection explicit where the chosen invocation helper requires them.
|
|
33
|
+
|
|
34
|
+
## Proof
|
|
35
|
+
|
|
36
|
+
Prove Driver prerequisites, run one real Agent Invocation, inspect granted authority, and assert the expected output. A typecheck without an invocation is incomplete.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Bundle size and startup cost
|
|
2
|
+
|
|
3
|
+
Use this when a task asks how big the app is, why the server starts slowly or hits a host size limit, why a page loads too much JavaScript, or why a package is in the output.
|
|
4
|
+
|
|
5
|
+
## Measure
|
|
6
|
+
|
|
7
|
+
1. Set `bundle: true` in `vitehub()` (`vite.config.ts`) or in `vitehub` (`nuxt.config.ts`). It is off by default.
|
|
8
|
+
2. Run a production build: `vite build` or `nuxt build`. Development builds are not measured.
|
|
9
|
+
3. Run `vitehub bundle`. It reads `.vitehub/bundle/` and needs no dev server.
|
|
10
|
+
|
|
11
|
+
`vitehub bundle` shows the client and the server separately. For each, it shows the JavaScript bytes, the gzip bytes, the startup code, and the largest groups. A group is a ViteHub package (`@vite-hub/agent`, `vite-hub/console`), a framework package, a dependency, an app folder (`server/api`), or generated code (`.vitehub`, `.nuxt`, `#nitro/virtual`). In Nuxt 5, the server part already contains the SSR build. Do not read Vite environments one by one.
|
|
12
|
+
|
|
13
|
+
- **Server startup** is the code that loads before the first request: the entry and every file that it imports statically. It decides cold start time and Worker startup limits.
|
|
14
|
+
- **Client startup** combines the startup code of all page entries, counting shared files once. A single page in a multi-page app can load less.
|
|
15
|
+
|
|
16
|
+
## Explain
|
|
17
|
+
|
|
18
|
+
`vitehub bundle why <package|file|group>` prints the bytes on each side, whether the target loads at startup, and the shortest import chain from the entry. Read the chain from the end: the first step that is app code or a ViteHub feature is usually the one to change. For example, change a static import to `import()` or turn the feature off.
|
|
19
|
+
|
|
20
|
+
## Routes
|
|
21
|
+
|
|
22
|
+
Static aliases load the same files as their canonical route. Lookup follows Nuxt's case and trailing-slash settings. When a custom `app/router.options.ts` file is present (also from a layer or module), route estimates are unavailable because that file can change routes at runtime. Page redirects also make route estimates unavailable because the destination can change before rendering. The CLI explains this and JSON includes `client.routesUnavailable`; bundle totals and module explanations still work.
|
|
23
|
+
|
|
24
|
+
In a Nuxt app, `vitehub bundle` also lists the largest page routes. For each route it gives the JavaScript of a first visit and the part of it that only page files add. `vitehub bundle why /docs/kv` takes a URL path, finds the route that renders it, such as `/docs/:slug()`, and prints:
|
|
25
|
+
|
|
26
|
+
- the files that the browser loads on a first visit: the startup files, and the files of the layout and the pages with every file that they import statically,
|
|
27
|
+
- the CSS of those files,
|
|
28
|
+
- the largest modules in the page files. These are what the route adds. Run `vitehub bundle why <module>` on one to get its import chain.
|
|
29
|
+
|
|
30
|
+
Code that the page loads later with `import()` does not count. The layout comes from a static `layout` in `definePageMeta`, or is `default`, and counts only when the startup or page files load `NuxtLayout`. If Nuxt does not expose that component's file, layouts are omitted. A layout set at runtime, conditional rendering of `NuxtLayout`, route middleware, and prefetching are not counted: Nuxt's `<link rel="prefetch">` files and the pages of visible `<NuxtLink>`s load at low priority after the page. Nuxt can inline some CSS in the HTML, so `cssBytes` is an upper bound for the CSS files the browser fetches. `--json` gives the routes in `client.routes`.
|
|
31
|
+
|
|
32
|
+
Use `--json` on both commands when you compare numbers or write them into a report.
|
|
33
|
+
|
|
34
|
+
## Act on findings
|
|
35
|
+
|
|
36
|
+
`vitehub bundle` ends with its checks. `--json` gives them in `findings`. Each finding has `code`, `severity`, `why`, `fix`, `docs`, `bytes`, and `chain`, the import chain from the server entry. The checks report only what the build proves: a feature declares from its resolved configuration what the server never runs, and a host limit comes from the host's documentation.
|
|
37
|
+
|
|
38
|
+
- `BUNDLE_STARTUP_UNUSED` (warning): a package loads at server startup, and a feature of this build never runs it there. Example: `@libsql/client` on a Cloudflare app where every Database is D1. Read `chain` from the end and update the ViteHub package that imports it. Independent imports from app code or other packages suppress the finding, because the feature cannot prove what those consumers need.
|
|
39
|
+
- `BUNDLE_HOST_SIZE_LIMIT` (error): the server JavaScript is over the host limit, so the deployment fails. Cloudflare accepts a Worker up to 64 MiB before compression. Start with the largest groups.
|
|
40
|
+
|
|
41
|
+
An error makes `vitehub bundle` exit with 1, so CI can run `vite build && vitehub bundle`. A warning keeps exit code 0. After a fix, build again and check that the finding is gone.
|
|
42
|
+
|
|
43
|
+
## Prove a change
|
|
44
|
+
|
|
45
|
+
Save the report before you change the code, then compare after the next build:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
nuxt build # or vite build, with bundle: true
|
|
49
|
+
vitehub bundle --json > .vitehub/bundle-before.json
|
|
50
|
+
# change the code
|
|
51
|
+
nuxt build
|
|
52
|
+
vitehub bundle --against .vitehub/bundle-before.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`--against` prints, for the client and the server, the bytes and gzip bytes before and after, the same for the startup code, and each group that grew, shrank, was added, or was removed, with its total and startup delta. Groups that did not change are not shown. Add `--json` to get the same data. `--against` also reads a copy of `.vitehub/bundle/` or the project root of another checkout that has one.
|
|
56
|
+
|
|
57
|
+
If the output says that both reports are from the same build, you did not build again after the change. Report the side and startup deltas and the groups that changed. When you removed a package, also give the import chain from `vitehub bundle why <package>` on the old build.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Capabilities and authority
|
|
2
|
+
|
|
3
|
+
Use this whenever an Agent receives a tool, secret-backed operation, browser,
|
|
4
|
+
storage, shell, repository, rate-limit, telemetry, or custom action. A
|
|
5
|
+
Capability is the named permission that exposes one operation and its checks to
|
|
6
|
+
an Agent.
|
|
7
|
+
|
|
8
|
+
## Select current pages
|
|
9
|
+
|
|
10
|
+
Open [Official Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/official.md) plus the chosen Capability page. Use [Capabilities overview](https://vitehub.dev/raw/docs/agents/capabilities.md) for lifecycle or authority questions, and [Custom Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/custom.md) only when no official Capability fits.
|
|
11
|
+
|
|
12
|
+
## Authority pass
|
|
13
|
+
|
|
14
|
+
Every Capability changes what an Agent may observe or do. For each one, name:
|
|
15
|
+
|
|
16
|
+
- operations exposed to the model;
|
|
17
|
+
- data and secret sources;
|
|
18
|
+
- Invoker, scope, rate, and policy checks;
|
|
19
|
+
- persistence or external side effects;
|
|
20
|
+
- artifacts or traces available for inspection.
|
|
21
|
+
|
|
22
|
+
Use official factories before writing a custom Capability. Use `defineCapability()` when the application needs a stable domain-specific boundary, not as a wrapper around an already suitable official tool.
|
|
23
|
+
|
|
24
|
+
Keep secrets server-side and unseal them only at the documented execution boundary. A Workspace Source does not grant an operation; a Capability should not silently mount unrelated data.
|
|
25
|
+
|
|
26
|
+
For `rateLimit()`, pass a direct `RateLimiter` with `limiter`. Keep Agent Invoker, Run, or trusted-IP identity in the Capability; keep atomic consumption and provider guarantees in `@vite-hub/rate-limit`. Do not recreate the removed inline `limit`, `window`, `store`, or generic KV model.
|
|
27
|
+
|
|
28
|
+
## Proof
|
|
29
|
+
|
|
30
|
+
Run one allowed operation and one relevant denied or out-of-scope case. Inspect the tool surface, result, trace/artifact, and external effect.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Channels and Triggers
|
|
2
|
+
|
|
3
|
+
Use this for Agent Channels and Triggers: GitHub, Gmail, Teams, Telegram,
|
|
4
|
+
Discord, web chat, custom webhooks, message history, admission, concurrency,
|
|
5
|
+
or Agent delivery effects. Every Channel is one file in `server/channels` with
|
|
6
|
+
`defineChannel()` from [`vite-hub/channels`](primitives/channels.md), for both
|
|
7
|
+
directions; an Agent lists it by name with `defineAgent({ channels: ['name'] })`.
|
|
8
|
+
|
|
9
|
+
## Select one current page
|
|
10
|
+
|
|
11
|
+
Open [Channels](https://vitehub.dev/raw/docs/agents/channels.md) for conversation adapters, [Gmail Channel](https://vitehub.dev/raw/docs/agents/gmail.md) for Gmail push, labels, and replay, [Triggers](https://vitehub.dev/raw/docs/agents/triggers.md) for other inbound events, or [Chat history and sessions](https://vitehub.dev/raw/docs/agents/chat-history-sessions.md) for identity and persistence. Open another page only when the first explicitly crosses that boundary.
|
|
12
|
+
|
|
13
|
+
## Composition
|
|
14
|
+
|
|
15
|
+
A Channel adapts an external conversation surface; a Trigger admits an external event into an Agent Invocation. Keep webhook verification, invoker/admission rules, history/session identity, concurrency, input commands, and delivery behavior explicit.
|
|
16
|
+
|
|
17
|
+
Use official Channel helpers when the installed contract provides them. Create a custom Trigger only when the external event is not a conversation adapter or the official boundary cannot represent the source.
|
|
18
|
+
|
|
19
|
+
Treat webhook secrets and installation tokens as server-only Env. Built-in Agent Channels declare their Env under `env.server.<channel>` when an Agent file calls the factory; check `describeServerEnv()` or the generated types before adding a declaration, and declare a field only to change its host variable name. Keep generated routes inspectable and document the exact local or deployed URL used for proof.
|
|
20
|
+
|
|
21
|
+
For initial setup of a built-in Telegram Channel, discover the installed contract with `pnpm vitehub channels sync --help` after the application stage is deployed. Run `pnpm vitehub channels sync --stage <stage> --url <https-origin> --json` first; it is read-only, loads the stage-specific Vite environment, and verifies the deployed webhook route before inspecting Telegram.
|
|
22
|
+
|
|
23
|
+
Apply a reviewed registration only when the task explicitly authorizes provider mutation, using `--apply --confirm-origin <the-same-https-origin>`. Never infer the stage or origin, pass provider credentials as arguments, or expose Env values in output. A planned deletion also needs explicit intent and `--allow-delete`; switching Telegram to polling or `webhooks: false` can produce that plan. Keep custom adapter registration and product policy application-owned.
|
|
24
|
+
|
|
25
|
+
## Proof
|
|
26
|
+
|
|
27
|
+
Exercise the generated or custom webhook with a verified event, observe the Agent Invocation, and confirm the expected external delivery or persisted message. A route existing in Provider Output is not proof that admission and delivery work.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Framework composition
|
|
2
|
+
|
|
3
|
+
Use this for Vite, Nitro, Nuxt, integration ordering, generated types, or deployment configuration.
|
|
4
|
+
|
|
5
|
+
## Select one current page
|
|
6
|
+
|
|
7
|
+
Start with [Vite Integrations and Provider Output](https://vitehub.dev/raw/docs/development/integrations-and-output.md). Open [Config options](https://vitehub.dev/raw/docs/reference/config-options.md) only for an option mismatch, or the selected page under [Frameworks and hosts](https://vitehub.dev/raw/docs/frameworks-hosts.md) only for a named framework or deployment target.
|
|
8
|
+
|
|
9
|
+
## Current application contract
|
|
10
|
+
|
|
11
|
+
Fresh apps install `vite-hub`, register `vitehub()` from the root, and use feature subpaths for runtime APIs. Turn features on and set provider options with `vitehub add <feature> --option key=value`, because it checks the host and edits object-literal options in a `vitehub({...})` call, a Nuxt `vite-hub/nuxt` module tuple, or the top-level Nuxt `vitehub` key. Edit the config by hand when `add` exits with `3` and prints a `snippet`, or when the options are an expression that `vitehub status` reports as `manual`. Direct `hubX()` integrations belong to an installed owner-package contract or deliberate advanced composition.
|
|
12
|
+
|
|
13
|
+
For Vite plus Nitro, keep ordering explicit:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
client/framework plugins
|
|
17
|
+
vitehub(...)
|
|
18
|
+
nitro(...)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For Nuxt, register `vite-hub/nuxt` and turn features on under the `vitehub` key, for example `vitehub: { database: true, kv: true }`. A Definition file turns its feature on without a key, such as `server/auth.ts` or a file in `server/schedules/`; set the key to `false` to keep it off. It is the only Nuxt module for ViteHub primitives. Owner-package Nuxt entries such as `@vite-hub/auth/nuxt` are internal; do not add them to `modules`. Do not reproduce app-local aliases or output rewrites from project examples without a source-backed need.
|
|
22
|
+
|
|
23
|
+
## Generated state
|
|
24
|
+
|
|
25
|
+
Include `.vitehub/types/**/*.d.ts` when generated names or `#vitehub/*` imports require it. Inspect `.vitehub` during development, but author source Definitions and stable imports rather than generated files.
|
|
26
|
+
|
|
27
|
+
## Proof
|
|
28
|
+
|
|
29
|
+
Run prepare/typecheck, build the selected framework, inspect `.vitehub`, and inspect the target's Provider Output. Ordering is proven by generated bindings and a live Runtime Helper or Agent Invocation, not by config shape alone.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Installed and preview contracts
|
|
2
|
+
|
|
3
|
+
Use this for installation, upgrades, `pkg.pr.new`, missing imports, or dependency graphs that mix package generations.
|
|
4
|
+
|
|
5
|
+
## Released packages
|
|
6
|
+
|
|
7
|
+
For a fresh application, read [Installation](https://vitehub.dev/raw/docs/getting-started/installation.md), install `vite-hub`, inspect `node_modules/vite-hub/package.json`, and use the root `vitehub()` integration plus exported feature subpaths. Open [Import paths](https://vitehub.dev/raw/docs/reference/import-paths.md) only when an export is ambiguous or an existing import must migrate.
|
|
8
|
+
|
|
9
|
+
To move an application that installs `vite-hub` to the latest release, run `pnpm vitehub update`. It changes every ViteHub dependency, override, and catalog entry of the workspace together, and installs.
|
|
10
|
+
|
|
11
|
+
## Preview packages
|
|
12
|
+
|
|
13
|
+
Use an immutable full commit SHA. An application that installs `vite-hub` moves every ViteHub package to one preview with one command. It checks that the build has each package, edits dependencies, overrides, and catalogs, sets `blockExoticSubdeps: false` for pnpm, and installs:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm vitehub update --preview <full-sha>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For an application without `vite-hub`, probe the exact facade tarball before editing:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
curl -I -L --fail "https://pkg.pr.new/vite-hub/vitehub/vite-hub@<full-sha>"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Install the facade as one coherent graph. Current pnpm versions reject preview tarballs whose dependencies are also tarball URLs unless exotic subdependencies are explicitly allowed:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
PNPM_CONFIG_BLOCK_EXOTIC_SUBDEPS=false pnpm add "vite-hub@https://pkg.pr.new/vite-hub/vitehub/vite-hub@<full-sha>"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The owner packages of enabled opt-in features, such as `@vite-hub/agent`, are optional peers of the facade. Install them from the same full SHA. If the application intentionally needs other direct owner packages, generate every selected URL from the same full SHA, probe each URL, and install them together. A split-commit graph is a canary-development exception; record why each split is required and prove it separately.
|
|
32
|
+
|
|
33
|
+
## Contract gate
|
|
34
|
+
|
|
35
|
+
1. Inspect the installed facade and owner-package `package.json` files, exports, and types.
|
|
36
|
+
2. Confirm every planned import exists in the installed graph.
|
|
37
|
+
3. Search the lockfile for `pkg.pr.new/vite-hub/vitehub` and verify resolved package names and commit keys match the intended graph. Preview packages have the version `0.0.0-preview-<short-sha>`, so a `@vite-hub/*` entry with an npm version is a release next to the preview.
|
|
38
|
+
4. Run the application build before assuming a `200` tarball is compatible.
|
|
39
|
+
|
|
40
|
+
The gate passes only when tarballs are available, the installed exports support the plan, the lockfile records the intended graph, and the smallest build succeeds.
|
|
41
|
+
|
|
42
|
+
## Drift rule
|
|
43
|
+
|
|
44
|
+
Never encode “latest” as a branch alias or copy a preview SHA from another project. Determine the requested commit, use its full SHA, and preserve it in the final report.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Auth
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/auth/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/auth.md
|
|
6
|
+
|
|
7
|
+
Use Auth when the application needs sign-in, sessions, route protection, or Better Auth server plugins. Auth owns identity and session state. It does not automatically protect Agent, Console, or primitive routes.
|
|
8
|
+
|
|
9
|
+
Keep route access explicit. Configure the Auth Definition and its `access` policy, then mount the route through the Vite or Nuxt integration. Keep application authorization in the route or Capability that uses the session.
|
|
10
|
+
|
|
11
|
+
Treat local session storage as development state unless the selected provider
|
|
12
|
+
gives it durable storage. A signed-in user is not automatically an Agent Invoker.
|
|
13
|
+
|
|
14
|
+
Prove the flow with a real sign-in or session lookup, then request a protected route and inspect the generated route or provider output for the selected host.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Blob
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/blob/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/blob.md
|
|
6
|
+
|
|
7
|
+
Use Blob for binary objects such as uploads, generated files, images, and exports. Turn Blob on with `vitehub add blob`, and pass `--option blob.driver=<driver>` where the host needs an explicit driver. Use the same Blob handle in application code when moving between local and hosted storage.
|
|
8
|
+
|
|
9
|
+
Keep object keys and authorization in application code. `serve` needs `access: "public"`, which sends every object of the served store to anyone, or `authorize: true`, which requires an authenticated session. `put()` has no per-object `access`. Treat filesystem Blob storage as one-host storage.
|
|
10
|
+
|
|
11
|
+
Accept uploads with `blob.handleUpload(event, { ensure })` and authorize the request in the route first. For files larger than the host's request body limit, such as 4.5 MB on Vercel, pass `direct: true` to `handleUpload()` and to `useUpload()`, so the browser sends the file straight to storage. Direct uploads need `VITEHUB_SECRET`, and on R2, S3, GCS, or Azure a bucket CORS rule that allows `PUT` from the app origin; Netlify Blobs falls back to a form upload. Copy a file with `blob.copy(from, to)`; it returns `BLOB_CONFLICT` when `to` exists, unless you pass `{ overwrite: true }`. To move a file, delete the source after the copy.
|
|
12
|
+
|
|
13
|
+
Prove upload, read, list, and delete with the selected driver. For hosted output, inspect the generated binding and verify access rules with a real request.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Browser
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/browser/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/browser.md
|
|
6
|
+
|
|
7
|
+
Use Browser for provider-backed browser actions that need a remote session. Browser Definitions keep provider setup out of application code and make each run explicit.
|
|
8
|
+
|
|
9
|
+
Check [Hosts](https://vitehub.dev/raw/docs/browser/hosts.md) before choosing a provider.
|
|
10
|
+
|
|
11
|
+
Browser Definitions currently use Cloudflare Browser Run. Keep credentials and session authority in the host configuration. Do not treat a browser screenshot or page as trusted application data without validation.
|
|
12
|
+
|
|
13
|
+
Remote pages are untrusted input and may leave the allowed origin or change
|
|
14
|
+
between runs. Validate URLs, extracted data, and side effects in application
|
|
15
|
+
code.
|
|
16
|
+
|
|
17
|
+
Prove one complete run, including session cleanup and the provider binding in generated output.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Cache
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/reference/config-options.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/reference/config-options.md
|
|
6
|
+
|
|
7
|
+
Use the ViteHub `cache` integration when Nitro cache storage should use a host-appropriate driver. Cache is for replaceable values. It is not the source of truth for durable application data.
|
|
8
|
+
|
|
9
|
+
Read the [configuration reference](https://vitehub.dev/raw/docs/reference/config-options.md#vite-integration-options) and the [host guide](https://vitehub.dev/raw/docs/frameworks-hosts.md). The integration selects Cloudflare KV, Vercel runtime cache, Deno KV, or local filesystem storage from the host and options.
|
|
10
|
+
|
|
11
|
+
Keep cache keys, expiry, and invalidation in application code. To clear related entries together, use `tags` and `invalidateTag()` from `vite-hub/cache`. To return the stored value when a cached third-party call fails, use `staleIfError` on `defineCachedFunction()` from `vite-hub/cache`. See [Cache server results](https://vitehub.dev/raw/docs/guides/cache-server-results.md). Inspect and clear entries with `vitehub cache list`, `get`, and `delete`. A `nitro.kv` (`nitro.storage` in Nuxt) cache mount takes precedence over the ViteHub cache option. Netlify requires an explicit supported arrangement.
|
|
12
|
+
|
|
13
|
+
Prove a miss, a hit, expiry or invalidation, and the selected host output. Never use cache as the only copy of data that must survive eviction.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Channels
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/channels/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/channels.md
|
|
6
|
+
|
|
7
|
+
A Channel is one connection to a platform, defined once in `server/channels/<name>.ts` with `defineChannel({ adapter, on })` from `vite-hub/channels`. Use it for both directions: inbound webhooks go to the `on` targets (a handler, a Queue or Workflow through a handler, or a `defineChannelTrigger()`), or to the Agent that lists the Channel in `defineAgent({ channels: ['name'] })`. Outbound messages go through `useChannel(name).send()` from any server code. `sendChannelTrigger(name, trigger, input)` starts a trigger from code, such as a Schedule, with the same delivery rules as a webhook.
|
|
8
|
+
|
|
9
|
+
Import `defineChannel()` and `defineChannelTrigger()` from `vite-hub/channels`, and every adapter from `vite-hub/channels/adapters`: `stripe()` or `webhook({ signature, secret })` for HTTP senders, and `slack()`, `teams()`, `discord()`, `telegram()`, `github()`, or `gmail()` for chat, forge, and mail. An app with only outbound Channels, such as a custom `{ kind, send }` adapter, needs no `@vite-hub/agent`. Files in `server/channels/` turn Channels on. Install `@vite-hub/channels` and, for inbound Channels, `@vite-hub/agent`. An inbound Channel turns on its webhook route without `agent: true`. Keep secrets in Server Env: a string `secret` is the name of the server variable, such as `webhook({ signature: 'github', secret: 'PREFECT_WEBHOOK_SECRET' })`, and the signature names follow Webhooks. Never parse or verify a webhook by hand. To only check the signature in a plain route, without Agents, use `verifyWebhook(event, { provider: 'stripe', secret: 'STRIPE_WEBHOOK_SECRET' })` from `vite-hub/env`.
|
|
10
|
+
|
|
11
|
+
Prove one signed delivery reaching its target, one duplicate that does not run twice, and one outbound send with its receipt.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Connections
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/connections/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/connections.md
|
|
6
|
+
|
|
7
|
+
Use Connections when a person or application must connect a provider account with OAuth 2 or an API key, then call that provider through an explicit access policy.
|
|
8
|
+
|
|
9
|
+
Connections require a Database and encryption key policy. Keep provider scopes and operation allowlists visible. A connected account is not automatically available to an Agent or route.
|
|
10
|
+
|
|
11
|
+
Keep the connected account, actor, and operation scope in the request policy.
|
|
12
|
+
Never expose provider tokens to application responses or Agent prompts.
|
|
13
|
+
|
|
14
|
+
Prove the connect and callback flow, an authorized operation, and a denied operation. Inspect the stored metadata without exposing tokens.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Content
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/content/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/content.md
|
|
6
|
+
|
|
7
|
+
Use Content to parse, query, search, and serve Markdown or other Source content through Comark. It is for application content, not arbitrary code execution.
|
|
8
|
+
|
|
9
|
+
Use the [Content CLI](https://vitehub.dev/raw/docs/content/cli.md) (`vitehub content list|show|status|diff|edit|publish|schedule --json`) to read, edit, publish, and schedule documents in a running dev server. `edit` honours edit leases unless `--override-lease`.
|
|
10
|
+
|
|
11
|
+
Keep content definitions and Source access explicit. Validate front matter and route parameters before using a result in a response.
|
|
12
|
+
|
|
13
|
+
Prove one local content query, one filtered or paginated query, and one served response. Include missing and malformed content cases.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Database
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/database/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/database.md
|
|
6
|
+
|
|
7
|
+
Use Database for relational data with Drizzle. Define tables in a Database Definition and query through the generated `useDatabase()` handle.
|
|
8
|
+
|
|
9
|
+
Import `useDatabase` from `vite-hub/database` and select the discovered database by name. Do not import generated database definitions or provider bindings into application code. Keep migrations and transaction boundaries with the Database owner.
|
|
10
|
+
|
|
11
|
+
For Postgres, set `dialect: 'postgresql'`. ViteHub connects with postgres.js, or with `pg` when the Definition sets `driver: 'node-postgres'`. Put read replica URLs in `connection.replicas` and read from them with `db.$replica`; writes and reads of your own writes use `db`. On D1, use `readReplication: true` instead.
|
|
12
|
+
|
|
13
|
+
For starting rows, write `server/databases/<name>/seed.ts` and run `vitehub seed database`. Inspect data with `vitehub database sql "<query>"`. `vitehub database drop` and `vitehub database reset` delete every table; they ask first, and need `--yes` without a terminal. Each command touches only the local database unless you pass `--remote`.
|
|
14
|
+
|
|
15
|
+
Prove a migration, a typed read, a write, and a restart or remote-host read. Inspect generated schema and provisioning output before deployment.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Email
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/email/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/email.md
|
|
6
|
+
|
|
7
|
+
Use Email for outbound transactional messages. Email keeps delivery behind a provider-neutral driver and supports Markdown and Vue templates with a text fallback.
|
|
8
|
+
|
|
9
|
+
Keep recipients, sender identity, and delivery authorization in application policy. Use test capture or a local driver before sending to real recipients.
|
|
10
|
+
|
|
11
|
+
Prove rendered HTML and text output, a rejected address, and the provider response. Do not claim delivery from a queued request alone.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Env
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/env/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/env.md
|
|
6
|
+
|
|
7
|
+
Use Env to declare public, build-time, server runtime, and secret values with typed accessors. Keep secret values out of source and client bundles.
|
|
8
|
+
|
|
9
|
+
Import `useServerEnv()` and `usePublicEnv()` from `vite-hub/env` in server code, and `usePublicEnv()` from `#vitehub/env/public` in browser code. Provider-backed Env values are read through the declared provider and do not become public automatically.
|
|
10
|
+
|
|
11
|
+
For a token that the client carries but must not read or change, such as an upload ticket, a signed link, or OAuth state, use `seal()` and `unseal()` from `vite-hub/env`. Do not write your own AES-GCM or HMAC code.
|
|
12
|
+
|
|
13
|
+
Prove missing, valid, and invalid values in the same host mode you will deploy. Inspect declaration metadata, never secret contents.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# KV
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/kv/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/kv.md
|
|
6
|
+
|
|
7
|
+
Use KV for small values addressed by a key, such as flags, cursors, short-lived state, or counters that do not require relational queries.
|
|
8
|
+
|
|
9
|
+
Turn KV on with `vitehub add kv`. Where the host needs an explicit driver, such as Upstash on Netlify, pass it with `--option kv.driver=<driver>`. Keep key names and serialization in application code. KV operations are not a substitute for atomic Rate Limit enforcement or relational transactions.
|
|
10
|
+
|
|
11
|
+
Read or write many keys with `kv.getMany(keys)` and `kv.setMany([{ key, value }])`, not a loop of `get()` or `set()`. `setMany()` is not atomic. To stop two servers from running the same job, use `kv.lock(key, { ttl }).run(fn)` and return when `acquired` is `false`. Only the `redis`, `database`, and `upstash` drivers support `lock()`; the others return `KV_UNSUPPORTED_OPERATION`. For work that must renew its hold, use a Database lease.
|
|
12
|
+
|
|
13
|
+
Prove put, get, list with a prefix, and delete. Restart local storage or query the hosted provider to confirm the durability you need.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Markdown templates
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/markdown-template/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/markdown-template.md
|
|
6
|
+
|
|
7
|
+
Use Markdown Templates when an application needs predictable Markdown composition with data bindings, conditions, or fragments. The renderer does not evaluate JavaScript or read files implicitly.
|
|
8
|
+
|
|
9
|
+
Start with the [Markdown Template tutorial](https://vitehub.dev/raw/docs/markdown-template/get-started.md).
|
|
10
|
+
|
|
11
|
+
Keep input data explicit and validate it before rendering. Use the file integration only with explicit paths or `file:` URLs.
|
|
12
|
+
|
|
13
|
+
Prove interpolation, a false condition, a fragment, and a missing or invalid value. Compare the rendered Markdown with the expected output before sending it to email or an Agent.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Queue
|
|
2
|
+
|
|
3
|
+
<!-- Generated from docs/content/docs/queue/index.md. Edit the agent-only block there. -->
|
|
4
|
+
|
|
5
|
+
Source page: https://vitehub.dev/raw/docs/queue.md
|
|
6
|
+
|
|
7
|
+
Use Queue to send work to a consumer that can run after the request ends. Queue Definitions own consumer code, retries, and concurrency.
|
|
8
|
+
|
|
9
|
+
Treat enqueue as a handoff. Make the job idempotent, keep payloads bounded, and choose retry behavior for the side effect. Queue configuration does not make a job exactly once.
|
|
10
|
+
|
|
11
|
+
Use a Queue for independent background work, a Schedule for when work starts,
|
|
12
|
+
and a Workflow when several durable steps must be inspected together.
|
|
13
|
+
|
|
14
|
+
Prove enqueue, consumer execution, retry, and a poison or invalid payload. Inspect the Nitro output for the target host.
|