vite-hub 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/_internal/runtime/browser-errors.d.ts +0 -2
- package/dist/_internal/runtime/browser-errors.js +3 -4
- package/dist/_internal/runtime/redirects.d.ts +1 -2
- package/dist/_internal/runtime/redirects.js +2 -3
- package/dist/_internal/runtime/request-policy.d.ts +1 -2
- package/dist/_internal/runtime/request-policy.js +2 -3
- package/dist/_internal/runtime/security.d.ts +1 -2
- package/dist/_internal/runtime/security.js +1 -2
- package/dist/{access-BC9HtX_M.js → access-CUFHPi8T.js} +13 -140
- package/dist/{access-policy-DhsEACna.d.ts → access-DkBck8Vu.d.ts} +17 -21
- package/dist/{access-policy-CVZg9LPR.js → access-policy-BM48XstY.js} +5 -6
- package/dist/{account-Cjj-tYzo.d.ts → account-DNr8fHcQ.d.ts} +5 -7
- package/dist/{console/runtime/server → agent/console}/agents.get.d.ts +2 -3
- package/dist/{console/runtime/server → agent/console}/agents.get.js +3 -4
- package/dist/{console/runtime/server → agent/console}/channel-replay.d.ts +3 -5
- package/dist/{console/runtime/server → agent/console}/channel-replay.js +6 -7
- package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.d.ts +1 -3
- package/dist/{console/runtime/server → agent/console}/invocation-capabilities.get.js +4 -5
- package/dist/agent/console/invocation-workspace.get.d.ts +6 -0
- package/dist/{console/runtime/server → agent/console}/invocation-workspace.get.js +6 -7
- package/dist/{console/runtime/server → agent/console}/invocation.get.d.ts +4 -6
- package/dist/{console/runtime/server → agent/console}/invocation.get.js +8 -9
- package/dist/{console/runtime/server → agent/console}/invocations.get.d.ts +1 -2
- package/dist/{console/runtime/server → agent/console}/invocations.get.js +5 -6
- package/dist/agent/console/invocations.usage.d.ts +6 -0
- package/dist/agent/console/invocations.usage.js +51 -0
- package/dist/agent/console/operations.d.ts +6 -0
- package/dist/agent/console/operations.js +247 -0
- package/dist/{console/runtime/server → agent/console}/status.get.d.ts +2 -4
- package/dist/{console/runtime/server → agent/console}/status.get.js +6 -7
- package/dist/{server-W0c79AYZ.js → agent-console-CHsLxKk_.js} +4 -4
- package/dist/agent-console-FmaYpVv-.d.ts +14 -0
- package/dist/{agent-invocations.post-C3Onl2yH.js → agent-invocations.post-CF5anHY6.js} +14 -17
- package/dist/agents-DBm_PJie.js +1 -0
- package/dist/{agents-B76RICcy.js → agents-DXLHsE7x.js} +5 -6
- package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
- package/dist/auth/console/auth.d.ts +25 -0
- package/dist/{console/runtime/server → auth/console}/auth.js +11 -13
- package/dist/auth/console/operations.d.ts +3 -0
- package/dist/auth/console/operations.js +135 -0
- package/dist/auth/server.js +1 -2
- package/dist/{auth-operations-GcQk0O0X.js → auth-operations-BKqoX8Ua.js} +4 -5
- package/dist/{auth-types-D3ugQ8xM.d.ts → auth-types-Cotn7406.d.ts} +4 -21
- package/dist/bin.js +8 -11
- package/dist/blob/console/operations.d.ts +3 -0
- package/dist/blob/console/operations.js +44 -0
- package/dist/blob/nuxt-image.js +1 -2
- package/dist/{blob-BcgsZtqM.js → blob-iw8pWQ6o.js} +5 -6
- package/dist/{blob-iVewd7KQ.d.ts → blob-uNin0_TV.d.ts} +1 -3
- package/dist/{browser-error-limits-CToqAD-O.js → browser-error-limits-B0yS95zt.js} +2 -4
- package/dist/cache/operations.d.ts +2 -4
- package/dist/cache/operations.js +3 -4
- package/dist/cache.d.ts +1 -3
- package/dist/cache.js +2 -3
- package/dist/{cli-config-FPHk1nbC.js → cli-config-BX8H4ZCo.js} +2 -3
- package/dist/cli-config-DgpmE_7z.js +1 -0
- package/dist/cms.js +1 -2
- package/dist/console/auth-types.d.ts +2 -2
- package/dist/console/auth.d.ts +2 -4
- package/dist/console/auth.js +2 -3
- package/dist/console/runtime/auth-operations.d.ts +4 -6
- package/dist/console/runtime/auth-operations.js +1 -2
- package/dist/console/runtime/client/account-views.d.ts +1 -3
- package/dist/console/runtime/client/account-views.js +1 -2
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +29 -45
- package/dist/console/runtime/client/appearance.d.ts +1 -2
- package/dist/console/runtime/client/appearance.js +1 -2
- package/dist/console/runtime/client/auth-management.ts +6 -6
- package/dist/console/runtime/client/blob-media.d.ts +2 -4
- package/dist/console/runtime/client/blob-media.js +5 -6
- package/dist/console/runtime/client/comment-thread.d.ts +1 -3
- package/dist/console/runtime/client/comment-thread.js +3 -4
- package/dist/console/runtime/client/content-heads.d.ts +1 -2
- package/dist/console/runtime/client/content-heads.js +2 -3
- package/dist/console/runtime/client/documents.d.ts +2 -2
- package/dist/console/runtime/client/documents.js +1 -2
- package/dist/console/runtime/client/editor.d.ts +3 -5
- package/dist/console/runtime/client/editor.js +1 -2
- package/dist/console/runtime/client/env-groups.d.ts +1 -3
- package/dist/console/runtime/client/env-groups.js +1 -2
- package/dist/console/runtime/client/env-status.d.ts +1 -3
- package/dist/console/runtime/client/env-status.js +1 -2
- package/dist/console/runtime/client/format.d.ts +1 -3
- package/dist/console/runtime/client/format.js +1 -2
- package/dist/console/runtime/client/invocation-deletion.d.ts +1 -2
- package/dist/console/runtime/client/invocation-deletion.js +1 -2
- package/dist/console/runtime/client/invocation.d.ts +1 -2
- package/dist/console/runtime/client/invocation.js +4 -5
- package/dist/console/runtime/client/live.d.ts +2 -4
- package/dist/console/runtime/client/live.js +1 -2
- package/dist/console/runtime/client/mcp-client.d.ts +7 -5
- package/dist/console/runtime/client/mcp-client.js +10 -5
- package/dist/console/runtime/client/media-library.d.ts +1 -1
- package/dist/console/runtime/client/media-library.js +1 -2
- package/dist/console/runtime/client/media-uploads.d.ts +2 -4
- package/dist/console/runtime/client/media-uploads.js +2 -3
- package/dist/console/runtime/client/media.d.ts +1 -1
- package/dist/console/runtime/client/media.js +1 -2
- package/dist/console/runtime/client/operation-view.d.ts +2 -4
- package/dist/console/runtime/client/operation-view.js +4 -5
- package/dist/console/runtime/client/presence.d.ts +2 -4
- package/dist/console/runtime/client/presence.js +1 -2
- package/dist/console/runtime/client/preview.d.ts +1 -3
- package/dist/console/runtime/client/preview.js +1 -2
- package/dist/console/runtime/client/problem.d.ts +2 -4
- package/dist/console/runtime/client/problem.js +3 -4
- package/dist/console/runtime/client/project-link.d.ts +1 -1
- package/dist/console/runtime/client/project-link.js +1 -2
- package/dist/console/runtime/client/project-session.d.ts +19 -10
- package/dist/console/runtime/client/project-session.js +1 -723
- package/dist/console/runtime/client/project.d.ts +1 -3
- package/dist/console/runtime/client/project.js +1 -2
- package/dist/console/runtime/client/projects.d.ts +1 -1
- package/dist/console/runtime/client/projects.js +1 -2
- package/dist/console/runtime/client/publish.d.ts +2 -4
- package/dist/console/runtime/client/publish.js +1 -2
- package/dist/console/runtime/client/rate-limit.d.ts +1 -3
- package/dist/console/runtime/client/rate-limit.js +3 -4
- package/dist/console/runtime/client/read-only.d.ts +2 -4
- package/dist/console/runtime/client/read-only.js +2 -3
- package/dist/console/runtime/client/request.d.ts +2 -2
- package/dist/console/runtime/client/request.js +1 -2
- package/dist/console/runtime/client/route-query.d.ts +4 -5
- package/dist/console/runtime/client/route-query.js +1 -2
- package/dist/console/runtime/client/schedule-run.d.ts +1 -3
- package/dist/console/runtime/client/schedule-run.js +3 -4
- package/dist/console/runtime/client/schema-form.d.ts +1 -1
- package/dist/console/runtime/client/schema-form.js +1 -2
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -2
- package/dist/console/runtime/client/site-access.d.ts +83 -16
- package/dist/console/runtime/client/site-access.js +159 -32
- package/dist/console/runtime/client/site-link.d.ts +2 -0
- package/dist/console/runtime/client/site-link.js +1 -0
- package/dist/console/runtime/client/stored.d.ts +1 -3
- package/dist/console/runtime/client/stored.js +1 -2
- package/dist/console/runtime/client/toast.d.ts +1 -3
- package/dist/console/runtime/client/toast.js +1 -2
- package/dist/console/runtime/client/workflow.d.ts +1 -3
- package/dist/console/runtime/client/workflow.js +3 -4
- package/dist/console/runtime/components/console-account-home.vue +9 -7
- package/dist/console/runtime/components/console-account-link.vue +8 -5
- package/dist/console/runtime/components/console-account-setup.vue +10 -7
- package/dist/console/runtime/components/console-account-shell.vue +7 -2
- package/dist/console/runtime/components/console-account-unlink.vue +2 -3
- package/dist/console/runtime/components/console-app-settings.vue +8 -2
- package/dist/console/runtime/components/console-auth-detail.vue +1 -1
- package/dist/console/runtime/components/console-auth-event-list.vue +1 -0
- package/dist/console/runtime/components/console-document-editor.vue +3 -4
- package/dist/console/runtime/components/console-hosted-comments-embed.vue +106 -0
- package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
- package/dist/console/runtime/components/console-mcp-items.vue +3 -16
- package/dist/console/runtime/components/console-site.vue +10 -8
- package/dist/console/runtime/components/console-usage.vue +2 -2
- package/dist/console/runtime/console-route.d.ts +1 -3
- package/dist/console/runtime/console-route.js +1 -2
- package/dist/console/runtime/definitions.d.ts +1 -1
- package/dist/console/runtime/definitions.js +1 -2
- package/dist/console/runtime/diagnostics.ts +14 -49
- package/dist/console/runtime/mcp-client.d.ts +2 -2
- package/dist/console/runtime/mcp-client.js +1 -2
- package/dist/console/runtime/operation-loader.d.ts +1 -0
- package/dist/console/runtime/operation-loader.js +10 -0
- package/dist/console/runtime/page-tool/account.js +26 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -2
- package/dist/console/runtime/rpc.d.ts +1 -1
- package/dist/console/runtime/rpc.js +1 -2
- package/dist/console/runtime/sections.d.ts +2 -2
- package/dist/console/runtime/sections.js +1 -2
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/access-policy.js +1 -2
- package/dist/console/runtime/server/agent-console.d.ts +2 -0
- package/dist/console/runtime/server/agent-console.js +1 -0
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -2
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.js +1 -2
- package/dist/console/runtime/server/definitions.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +4 -6
- package/dist/console/runtime/server/definitions.get.js +5 -6
- package/dist/console/runtime/server/definitions.js +1 -2
- package/dist/console/runtime/server/development.d.ts +1 -1
- package/dist/console/runtime/server/development.js +1 -2
- package/dist/console/runtime/server/documents.d.ts +2 -2
- package/dist/console/runtime/server/documents.js +3 -3
- package/dist/console/runtime/server/entry-site-access.d.ts +3 -0
- package/dist/console/runtime/server/entry-site-access.js +4 -0
- package/dist/console/runtime/server/entry.d.ts +3 -0
- package/dist/console/runtime/server/entry.js +4 -0
- package/dist/console/runtime/server/env.d.ts +1 -3
- package/dist/console/runtime/server/env.js +1 -2
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -2
- package/dist/console/runtime/server/pill.d.ts +45 -0
- package/dist/console/runtime/server/pill.js +62 -0
- package/dist/console/runtime/server/rpc.d.ts +5 -10
- package/dist/console/runtime/server/rpc.js +19 -27
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -2
- package/dist/console/runtime/server/sections.d.ts +5 -5
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +8 -9
- package/dist/console/runtime/server/sections.js +6 -6
- package/dist/console/runtime/server/setup.d.ts +5 -5
- package/dist/console/runtime/server/setup.js +5 -5
- package/dist/console/runtime/server/site-access-operation.d.ts +7 -0
- package/dist/console/runtime/server/site-access-operation.js +36 -0
- package/dist/console/runtime/server/site-actions.d.ts +73 -0
- package/dist/console/runtime/server/site-actions.js +105 -0
- package/dist/console/runtime/server/site-entry.d.ts +16 -9
- package/dist/console/runtime/server/site-entry.js +62 -46
- package/dist/console/runtime/server/site-visitor.d.ts +17 -0
- package/dist/console/runtime/server/site-visitor.js +1 -0
- package/dist/console/runtime/server/site.d.ts +27 -0
- package/dist/console/runtime/server/site.js +1 -0
- package/dist/console/runtime/skills.d.ts +1 -3
- package/dist/console/runtime/skills.js +1 -2
- package/dist/console/server.d.ts +9 -25
- package/dist/console/server.js +8 -8
- package/dist/console/ui.d.ts +0 -10
- package/dist/console/ui.js +14 -27
- package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
- package/dist/{console-route-CM2G5hiC.js → console-route-DbdnLkkF.js} +2 -3
- package/dist/console-signature--55DIKf2.js +237 -0
- package/dist/console.d.ts +1 -3
- package/dist/console.js +1 -2
- package/dist/content/console/operations.d.ts +3 -0
- package/dist/content/console/operations.js +62 -0
- package/dist/{console/runtime/server → database/console}/database.get.d.ts +2 -3
- package/dist/{console/runtime/server → database/console}/database.get.js +4 -5
- package/dist/database/console/operations.d.ts +3 -0
- package/dist/database/console/operations.js +49 -0
- package/dist/{database-UMJgnU2z.js → database-CrgBUdIx.js} +3 -4
- package/dist/{database-DC67Ipm-.d.ts → database-yFezh5U1.d.ts} +1 -3
- package/dist/{definition-catalog-BUcclwSH.js → definition-catalog-1xPPtzOx.js} +3 -4
- package/dist/definition-catalog-M5ua7JRS.js +1 -0
- package/dist/{definitions-BW6SvmMM.js → definitions-BFYqXchw.js} +1 -2
- package/dist/{definitions-DB4LbZ7T.d.ts → definitions-ChvMnA1L.d.ts} +0 -2
- package/dist/{definitions-DTytrw42.js → definitions-DGo2rNQ9.js} +5 -6
- package/dist/{definitions-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
- package/dist/{deployment-BUshgN5Q.js → deployment-CURATxjG.js} +2 -3
- package/dist/deployment-l7RuKdEp.js +1 -0
- package/dist/{dev-peer-CHjyHYG6.js → dev-peer-CRYp01PE.js} +2 -222
- package/dist/dev-peer-CX5C9243.js +1 -0
- package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
- package/dist/{development-RnopiRwK.d.ts → development-I40mfD7B.d.ts} +1 -3
- package/dist/{diagnostics-DtR0TAmq.js → diagnostics-DLHqjKGe.js} +3 -9
- package/dist/diagnostics-DgGKvWzF.d.ts +7 -0
- package/dist/docs/nuxt.js +1 -2
- package/dist/doctor.d.ts +0 -6
- package/dist/doctor.js +11492 -12152
- package/dist/{documents-BDR0AkYR.d.ts → documents-A-7Ho0g0.d.ts} +12 -16
- package/dist/{documents-B4R4JSfH.js → documents-BduuZjm3.js} +6 -6
- package/dist/{documents-BASIRZ91.d.ts → documents-CApMRd4o.d.ts} +4 -7
- package/dist/{documents-BewAPY61.js → documents-D6ueeoUR.js} +17 -21
- package/dist/durability/operations.d.ts +2 -4
- package/dist/durability/operations.js +3 -4
- package/dist/{entries-DbyNPLC9.js → entries-UFs9n1MB.js} +2 -3
- package/dist/{console/runtime/server → env/console}/env.get.d.ts +2 -4
- package/dist/env/console/env.get.js +15 -0
- package/dist/env/console/operations.d.ts +3 -0
- package/dist/env/console/operations.js +12 -0
- package/dist/env/vite.d.ts +1 -0
- package/dist/env/vite.js +2 -0
- package/dist/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
- package/dist/{error-diagnostics-B1yAIaSn.js → error-diagnostics-CBtvqI30.js} +2 -7
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/error-diagnostics.ts +1 -7
- package/dist/{features-CC5OcZqJ.js → features-BXRKlmtN.js} +5 -6
- package/dist/features-CD5i5I8V.js +1 -0
- package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
- package/dist/{github-login-Bi3bfjRX.js → github-login-W-vaahWP.js} +1 -2
- package/dist/{host-CkL0jjBq.js → host-DeNPYIeV.js} +1 -2
- package/dist/{http-error-Bs6e8_-8.js → http-error-BorAxJYM.js} +1 -2
- package/dist/index.d.ts +1 -7
- package/dist/index.js +5 -7
- package/dist/{inspect-DbZuP_7b.js → inspect-CWwAuL-B.js} +2 -3
- package/dist/internal/agent-invocations-libsql.js +1 -2
- package/dist/internal/disabled-redis-driver.d.ts +1 -3
- package/dist/internal/disabled-redis-driver.js +2 -3
- package/dist/internal/disabled-upstash-driver.d.ts +1 -3
- package/dist/internal/disabled-upstash-driver.js +2 -3
- package/dist/internal/test-loader.d.ts +1 -3
- package/dist/internal/test-loader.js +2 -3
- package/dist/internal/test-server.js +2 -3
- package/dist/{internal-BreyUsQ6.js → internal-0C_CC601.js} +1 -2
- package/dist/{internal-Cc9N0shU.d.ts → internal-BRNf11h3.d.ts} +14 -8
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{invocation-page-undo-DqYcPlkQ.js → invocation-page-undo-DHbXczWY.js} +8 -7
- package/dist/invocations-B60XWNES.js +45 -0
- package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
- package/dist/logs/client.d.ts +1 -3
- package/dist/logs/client.js +1 -2
- package/dist/{console/runtime/server → logs/console}/logs.get.d.ts +3 -5
- package/dist/{console/runtime/server → logs/console}/logs.get.js +7 -8
- package/dist/logs/console/operations.d.ts +3 -0
- package/dist/logs/console/operations.js +23 -0
- package/dist/logs/host.d.ts +2 -4
- package/dist/logs/host.js +1 -2
- package/dist/logs/memory.d.ts +1 -1
- package/dist/logs/memory.js +1 -2
- package/dist/logs/source.d.ts +1 -1
- package/dist/logs/source.js +1 -2
- package/dist/logs.d.ts +2 -2
- package/dist/logs.js +2 -2
- package/dist/loopback-Bl9Cvj1k.js +139 -0
- package/dist/mcp/eval.d.ts +1 -0
- package/dist/mcp/eval.js +2 -0
- package/dist/{mcp-client-C_sEmyQw.d.ts → mcp-client-uXVvS7RL.d.ts} +5 -10
- package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
- package/dist/{media-D3OfyKni.js → media-CNwnh6CG.js} +8 -9
- package/dist/{media-library-o8RRsnn_.js → media-library-DTC8TLsZ.js} +5 -6
- package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
- package/dist/{memory-C54SDH_l.js → memory-D3EJS_Bp.js} +3 -4
- package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
- package/dist/{nuxt-server-auto-imports-cfTZYvgy.js → nuxt-server-auto-imports-4aT5BD4u.js} +1 -2
- package/dist/{nuxt-server-imports-75bWMeXc.js → nuxt-server-imports-BdJqiVhT.js} +1 -2
- package/dist/nuxt.d.ts +1 -3
- package/dist/nuxt.js +276 -182
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-contributions-C3lwePQu.js → operation-contributions-BU10k2QS.js} +9 -9
- package/dist/{operation-contributions-CrdmqtJW.d.ts → operation-contributions-xwjDzj28.d.ts} +6 -7
- package/dist/{operation-definition-DxjKcCGm.js → operation-definition-D04Rdjbe.js} +7 -9
- package/dist/operation-modules-BUXlwjvd.js +1 -0
- package/dist/operation-modules-DHWkPcfS.js +139 -0
- package/dist/{operation-registry-BogGwk_I.js → operation-registry-DfQbL7vE.js} +1 -2
- package/dist/{operation-rpc-DI9txNxK.js → operation-rpc-BMdfapja.js} +3 -4
- package/dist/operations-D-7ljPqw.js +1 -0
- package/dist/{operations-TTjL_7Zc.d.ts → operations-DgFhA1WE.d.ts} +0 -4
- package/dist/{operations-CFYGXqLm.js → operations-DksTrRMb.js} +4 -5
- package/dist/operations-byxiZ2R2.js +113 -0
- package/dist/{optional-owners-O6sj4uoj.js → optional-owners-Cypch7V3.js} +4 -6
- package/dist/{out-fRNaVslw.js → out-Cw5Tvr92.js} +2933 -2301
- package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
- package/dist/page/pill.iife.js +2 -2
- package/dist/page-tools-BeZrtn4S.js +46 -0
- package/dist/page-tools-Chk8Gm9x.d.ts +23 -0
- package/dist/page-tools-shared-BLPidmCi.js +39 -0
- package/dist/{pathe.M-eThtNZ-J4gfe1m9.js → pathe.M-eThtNZ-D4EC7Wue.js} +1 -2
- package/dist/{plugins-DoXnU6-s.d.ts → plugins-BmkOoyIh.d.ts} +25 -110
- package/dist/{plugins-BTZQaFtZ.js → plugins-DfXcUnzN.js} +1779 -1384
- package/dist/presets/workspace.js +1 -2
- package/dist/{project-Dgyq1F1V.d.ts → project-B2qWt8on.d.ts} +3 -12
- package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
- package/dist/{project-DXZRZEPX.js → project-_juMSuAS.js} +8 -11
- package/dist/{project-link-DT99MoyU.js → project-link-CJbCkOlC.js} +7 -8
- package/dist/{project-link-bNS-KROO.d.ts → project-link-Ck3vuq9w.d.ts} +2 -4
- package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
- package/dist/project-session-8pN7pRo8.js +764 -0
- package/dist/{projects-CAcXztf4.js → projects-BRp0iseV.js} +1 -2
- package/dist/{projects-Ddvl9EJp.d.ts → projects-mgPxrKZr.d.ts} +0 -2
- package/dist/{registry-zw6aE2N9.js → registry-B8JE5NY-.js} +1 -2
- package/dist/{registry-CDKLACCZ.js → registry-CnPC-gNu.js} +1 -2
- package/dist/{request-CMA2UKKq.js → request-D769eiBL.js} +5 -6
- package/dist/{request-D7h3SQ92.d.ts → request-DYmjLTqP.d.ts} +2 -4
- package/dist/{request-SBLxvpyr.d.ts → request-DkoE0b2h.d.ts} +11 -4
- package/dist/{request-Cs0FqxEL.js → request-XFVx7CGC.js} +30 -9
- package/dist/{request-origin-COUkgHd6.js → request-origin-pzWr9UUu.js} +1 -2
- package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-DegdyBIC.js} +2 -3
- package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
- package/dist/routes-D02vxUSg.js +26 -0
- package/dist/{rpc-DIUA61pv.js → rpc-D3tsx5lZ.js} +1 -2
- package/dist/{rpc-7nlHSv3y.d.ts → rpc-oijgKQtD.d.ts} +0 -2
- package/dist/{runtime-YLWfdrtO.js → runtime-CAbuQGMP.js} +3 -4
- package/dist/{runtime-B-46Bawt.js → runtime-CRJsqVTa.js} +2 -3
- package/dist/{runtime-DxfJOfCd.js → runtime-DA7HJe10.js} +3 -4
- package/dist/runtime-DGvimtvc.d.ts +5 -0
- package/dist/{runtime-CX_l_78I.js → runtime-F0CTqBFx.js} +5 -6
- package/dist/{runtime-feature-guard-CuyPVGj9.js → runtime-feature-guard-BKAMRZzM.js} +6 -7
- package/dist/scan-module-B1A24jqP.js +1 -0
- package/dist/{scan-module-Df58L_6T.js → scan-module-BfZvDBxb.js} +2 -4
- package/dist/{schema-form-C-fy3xaU.d.ts → schema-form-Bl79Bdm-.d.ts} +0 -2
- package/dist/search-jgMrZJXR.js +84 -0
- package/dist/{sections-DumoLKQN.js → sections-AUGy9EkY.js} +2 -8
- package/dist/{sections-BogiCmtz.d.ts → sections-BMkFB3S-.d.ts} +4 -6
- package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
- package/dist/{sections-Do7X4Nwt.d.ts → sections-DCoCa4nF.d.ts} +1 -8
- package/dist/sections-DjeAUX7o.d.ts +8 -0
- package/dist/{sections-BKUReack.js → sections-ZFAlI4JW.js} +14 -7
- package/dist/{sections.get-H46e2urg.d.ts → sections.get-BY5dClJY.d.ts} +2 -4
- package/dist/seo/runtime.d.ts +2 -5
- package/dist/seo/runtime.js +3 -5
- package/dist/{seo-CtLywyRx.d.ts → seo-CgW5uI9L.d.ts} +0 -2
- package/dist/seo.d.ts +1 -1
- package/dist/seo.js +1 -2
- package/dist/{setup-BC0P3eZy.d.ts → setup-BBnZPziq.d.ts} +5 -10
- package/dist/{setup-DNGzawFn.js → setup-yc3_WKNG.js} +4 -17
- package/dist/site-CZCIWsUQ.js +169 -0
- package/dist/site-link-Bvo2SxPo.js +58 -0
- package/dist/site-link-Dtw8MNVB.d.ts +18 -0
- package/dist/site-pages-B6J8U2Nq.js +66 -0
- package/dist/site-token-Wa7fhjwg.js +215 -0
- package/dist/site-visitor-BkhE2TA0.js +89 -0
- package/dist/skills/operations.d.ts +1 -5
- package/dist/skills/operations.js +4 -5
- package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
- package/dist/skills.d.ts +1 -2
- package/dist/{skills.get-CRd06TTb.js → skills.get-CW8vc_Hf.js} +3 -4
- package/dist/skills.js +1 -2
- package/dist/{source-Cw3iYvJF.js → source-DYFndd0W.js} +2 -3
- package/dist/{source-S-LChQvw.d.ts → source-DemBtwla.d.ts} +0 -2
- package/dist/{stored-Dhv2qsQv.js → stored-J3TetMKf.js} +1 -2
- package/dist/task/operations.d.ts +1 -5
- package/dist/task/operations.js +3 -4
- package/dist/test/register.js +2 -3
- package/dist/test.d.ts +0 -4
- package/dist/test.js +1 -2
- package/dist/ui/vite.js +1 -2
- package/dist/usage-DBi7aOhx.js +33 -0
- package/dist/{version-dkga9imp.js → version-DUCd7Orc.js} +24 -21
- package/dist/{vite-stage-D7fe614I.js → vite-stage-Dmo4RgnK.js} +3 -5
- package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
- package/dist/workspace/console/operations.d.ts +3 -0
- package/dist/workspace/console/operations.js +22 -0
- package/dist/{console/runtime/server → workspace/console}/workspace-files.get.d.ts +3 -5
- package/dist/{console/runtime/server → workspace/console}/workspace-files.get.js +4 -5
- package/dist/{workspace-history-B95Q-kGI.js → workspace-history-B52xib2J.js} +3 -4
- package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
- package/package.json +158 -149
- package/dist/agents-BhFggA26.js +0 -2
- package/dist/auth-GFIN6xSJ.d.ts +0 -120
- package/dist/cli-config-g_mbWdjT.js +0 -2
- package/dist/cloudflare-env-lookup-DKXdr4P_.js +0 -16
- package/dist/console/runtime/client/ticket.d.ts +0 -2
- package/dist/console/runtime/client/ticket.js +0 -2
- package/dist/console/runtime/page/loader.js +0 -134
- package/dist/console/runtime/server/auth.d.ts +0 -2
- package/dist/console/runtime/server/env.get.js +0 -16
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +0 -8
- package/dist/console/runtime/server/mcp-client-operations.d.ts +0 -5
- package/dist/console/runtime/server/mcp-client-operations.js +0 -139
- package/dist/console/runtime/server/page-auth.d.ts +0 -18
- package/dist/console/runtime/server/page-auth.js +0 -44
- package/dist/console/runtime/server/page-tool.d.ts +0 -2
- package/dist/console/runtime/server/page-tool.js +0 -110
- package/dist/console/runtime/server/page-tools-route.d.ts +0 -2
- package/dist/console/runtime/server/page-tools-route.js +0 -5
- package/dist/console/runtime/server/search.get.d.ts +0 -4
- package/dist/console/runtime/server/search.get.js +0 -97
- package/dist/console/runtime/server/site-session.d.ts +0 -80
- package/dist/console/runtime/server/site-session.js +0 -2
- package/dist/console/runtime/server/tickets.d.ts +0 -2
- package/dist/console/runtime/server/tickets.js +0 -2
- package/dist/console/runtime/server/usage.get.d.ts +0 -10
- package/dist/console/runtime/server/usage.get.js +0 -92
- package/dist/console/runtime/site-access.d.ts +0 -2
- package/dist/console/runtime/site-access.js +0 -2
- package/dist/console-lazy-views-DXnIkdyd.js +0 -2
- package/dist/definition-catalog-og_1razf.js +0 -2
- package/dist/deployment-C2B0hBBj.js +0 -2
- package/dist/diagnostics-CjGiniKb.d.ts +0 -11
- package/dist/features-ujWsvlEH.js +0 -2
- package/dist/invocations-6jxqLkGY.js +0 -86
- package/dist/mcp-client-C91h8Taa.js +0 -1024
- package/dist/mcp-client-CTbTbn7d.js +0 -10
- package/dist/operations-5Lwd1xEI.js +0 -2
- package/dist/operations-ChEXk2ij.js +0 -853
- package/dist/page-tool-PmxH65gt.d.ts +0 -69
- package/dist/page-tools-ClgqElu-.js +0 -462
- package/dist/page-tools-DcCCtDKi.d.ts +0 -23
- package/dist/page-tools-shared-aNC9YtoI.js +0 -125
- package/dist/runtime-B_btezs1.d.ts +0 -7
- package/dist/scan-module-D_3X08mj.js +0 -2
- package/dist/secret-DELGKpCJ.js +0 -44
- package/dist/sections-CFiMNsqu.d.ts +0 -10
- package/dist/site-access-BycrwM2v.js +0 -18
- package/dist/site-access-CAiWyKOD.js +0 -2
- package/dist/site-access-DxfdOel1.d.ts +0 -55
- package/dist/site-access-L1qbvKt6.js +0 -293
- package/dist/site-session-CRwgKtTF.js +0 -300
- package/dist/skills/vitehub/SKILL.md +0 -142
- package/dist/skills/vitehub/agents/openai.yaml +0 -4
- package/dist/skills/vitehub/references/agent-definitions.md +0 -36
- package/dist/skills/vitehub/references/bundle.md +0 -57
- package/dist/skills/vitehub/references/capabilities-authority.md +0 -30
- package/dist/skills/vitehub/references/channels-triggers.md +0 -27
- package/dist/skills/vitehub/references/framework-composition.md +0 -29
- package/dist/skills/vitehub/references/preview-contract.md +0 -44
- package/dist/skills/vitehub/references/primitives/auth.md +0 -14
- package/dist/skills/vitehub/references/primitives/blob.md +0 -13
- package/dist/skills/vitehub/references/primitives/browser.md +0 -17
- package/dist/skills/vitehub/references/primitives/cache.md +0 -13
- package/dist/skills/vitehub/references/primitives/channels.md +0 -11
- package/dist/skills/vitehub/references/primitives/connections.md +0 -14
- package/dist/skills/vitehub/references/primitives/content.md +0 -13
- package/dist/skills/vitehub/references/primitives/database.md +0 -15
- package/dist/skills/vitehub/references/primitives/email.md +0 -11
- package/dist/skills/vitehub/references/primitives/env.md +0 -13
- package/dist/skills/vitehub/references/primitives/kv.md +0 -13
- package/dist/skills/vitehub/references/primitives/markdown-template.md +0 -13
- package/dist/skills/vitehub/references/primitives/queue.md +0 -14
- package/dist/skills/vitehub/references/primitives/rate-limit.md +0 -11
- package/dist/skills/vitehub/references/primitives/realtime.md +0 -19
- package/dist/skills/vitehub/references/primitives/sandbox-task.md +0 -11
- package/dist/skills/vitehub/references/primitives/sandbox.md +0 -13
- package/dist/skills/vitehub/references/primitives/schedule.md +0 -11
- package/dist/skills/vitehub/references/primitives/shell.md +0 -11
- package/dist/skills/vitehub/references/primitives/source.md +0 -11
- package/dist/skills/vitehub/references/primitives/workflow.md +0 -11
- package/dist/skills/vitehub/references/primitives/workspace.md +0 -11
- package/dist/skills/vitehub/references/project-patterns.md +0 -19
- package/dist/skills/vitehub/references/project-shapes.md +0 -81
- package/dist/skills/vitehub/references/proof-recovery.md +0 -31
- package/dist/skills/vitehub/references/sandboxes-hosts.md +0 -26
- package/dist/skills/vitehub/references/schedules-workflows-invocations.md +0 -28
- package/dist/skills/vitehub/references/server-primitives.md +0 -39
- package/dist/skills/vitehub/references/workspaces-sources-access.md +0 -26
- package/dist/ticket-DtBAstEU.js +0 -31
- package/dist/ticket-Pr_8ZtXW.d.ts +0 -14
- package/dist/tickets-DahBmKDT.js +0 -357
- package/dist/usage-CoQXs5nW.d.ts +0 -22
- package/dist/usage-index-VJAZ7a0p.js +0 -335
- package/dist/usage-jKtAgJZ0.js +0 -571
- /package/dist/{console/runtime/public/skills → console-skills}/index.json +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/SKILL.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/agents/openai.yaml +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/agent-definitions.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/bundle.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/capabilities-authority.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/channels-triggers.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/framework-composition.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/preview-contract.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/auth.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/blob.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/browser.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/cache.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/channels.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/connections.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/content.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/database.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/email.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/env.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/kv.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/markdown-template.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/queue.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/rate-limit.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/realtime.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox-task.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/sandbox.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/schedule.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/shell.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/source.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workflow.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/primitives/workspace.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-patterns.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/project-shapes.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/proof-recovery.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/sandboxes-hosts.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/schedules-workflows-invocations.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/server-primitives.md +0 -0
- /package/dist/{console/runtime/public/skills → console-skills}/vitehub/references/workspaces-sources-access.md +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { a as encodeConsoleBase64url, c as verifyConsoleBytes, i as decodeConsoleBase64url, o as isConsoleKeyName } from "./console-signature--55DIKf2.js";
|
|
2
|
+
import { n as isRecord } from "./object-DRSmpe04.js";
|
|
3
|
+
// ../internal/src/site-token.ts
|
|
4
|
+
/**
|
|
5
|
+
* The app route that starts a visit with `?return=<path>` and ends it with `?token=<token>`. Site access tokens let the
|
|
6
|
+
* Console sign a person in to a linked app without a user in the app's database:
|
|
7
|
+
*
|
|
8
|
+
* 1. The app's `GET /_vitehub/site?return=/docs` sets a state cookie to a new {@link createSiteState} value and
|
|
9
|
+
* redirects to the Console's `/visit` with {@link siteVisitUrl}: the app URL, the
|
|
10
|
+
* {@link siteStateHash} of the state, the return path, and the `project` query of the request when it has one. An
|
|
11
|
+
* invite or a one-time code of the Console sends the browser to `GET /_vitehub/site` with `project`, so the visit
|
|
12
|
+
* uses the pass of that project.
|
|
13
|
+
* 2. The Console checks the grant of the person: a member of the team that linked the app, or a guest that opened an
|
|
14
|
+
* invite in this browser. It asks the app with the signed {@link siteAccessOperation} call, as the member or as the
|
|
15
|
+
* guest's inviter, so `console.authorize` decides, as for every Console call. With a grant, it redirects to {@link siteTokenUrl},
|
|
16
|
+
* `<app>/_vitehub/site?token=vst1.…`, with a token from {@link signSiteToken}: the key of the link signs it, it lasts
|
|
17
|
+
* 60 seconds, and it holds the hash of the state.
|
|
18
|
+
* 3. The app checks the token with {@link verifySiteToken}, the public keys that it already reads with
|
|
19
|
+
* `readConsolePublicKeys()`, its URL, and its state cookie. Then it sets its own session cookie and goes to
|
|
20
|
+
* the `destination` of the match. Before the cookie ends, the app sends the browser through the Console again: while
|
|
21
|
+
* the grant exists, the Console signs a new token, and after a revoke it signs none.
|
|
22
|
+
*
|
|
23
|
+
* The state binds a token to the browser that started the visit, so a token that leaks, or a link that someone else
|
|
24
|
+
* made, does not sign in another browser. The module uses only Web Crypto, so it runs in Node, Workers, and browsers.
|
|
25
|
+
*
|
|
26
|
+
* Impersonation and Content preview use the same route and the same token, with the `kind` `impersonate` or `preview`
|
|
27
|
+
* and a {@link SiteTokenTarget}. A member starts them in the Console, which keeps what to open in a cookie of the Console
|
|
28
|
+
* for 60 seconds and opens `GET /_vitehub/site?return=/&intent=<id>`. At `/visit`, the Console reads the intent of the
|
|
29
|
+
* same browser, asks the app with the signed operation of the kind, as the member, and signs the token only when the
|
|
30
|
+
* app allows it. The app keeps no state for these tokens: a token works for 60 seconds, in the browser of the state.
|
|
31
|
+
*/
|
|
32
|
+
const siteRoute = "/_vitehub/site";
|
|
33
|
+
const siteTokenLifetimeSeconds = 60;
|
|
34
|
+
const tokenVersion = "vst1";
|
|
35
|
+
const encoder = new TextEncoder();
|
|
36
|
+
const decoder = new TextDecoder();
|
|
37
|
+
const maximumTokenLength = 8192;
|
|
38
|
+
/**
|
|
39
|
+
* The app operation that tells the Console what Site access a Console member has in the app. The Console signs the call
|
|
40
|
+
* as the member before each Site access action, so `console.authorize` and its `"site:read"` and `grants` limits decide.
|
|
41
|
+
* The app lists it in `project.get`. The answer is a {@link SiteAccessPolicy}.
|
|
42
|
+
*/
|
|
43
|
+
const siteAccessOperation = "site.access";
|
|
44
|
+
const kinds = [
|
|
45
|
+
"site",
|
|
46
|
+
"impersonate",
|
|
47
|
+
"preview"
|
|
48
|
+
];
|
|
49
|
+
const maximumTargetFields = 8;
|
|
50
|
+
/** Read an untrusted target, such as the target of a Console intent, or `undefined` when it is not a {@link SiteTokenTarget}. */
|
|
51
|
+
function readSiteTokenTarget(value) {
|
|
52
|
+
if (!isRecord(value)) return void 0;
|
|
53
|
+
const entries = Object.entries(value);
|
|
54
|
+
if (entries.length > maximumTargetFields) return void 0;
|
|
55
|
+
const target = {};
|
|
56
|
+
for (const [name, field] of entries) {
|
|
57
|
+
if (!/^[A-Za-z]\w{0,31}$/.test(name) || typeof field !== "string" || !field || field.length > 512) return void 0;
|
|
58
|
+
target[name] = field;
|
|
59
|
+
}
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
62
|
+
/** A new random state for the app's state cookie, 32 bytes as base64url. */
|
|
63
|
+
function createSiteState() {
|
|
64
|
+
return encodeConsoleBase64url(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)));
|
|
65
|
+
}
|
|
66
|
+
/** The SHA-256 of a state, base64url: 43 characters. Only the hash leaves the app. */
|
|
67
|
+
async function siteStateHash(state) {
|
|
68
|
+
return encodeConsoleBase64url(new Uint8Array(await crypto.subtle.digest("SHA-256", encoder.encode(state))));
|
|
69
|
+
}
|
|
70
|
+
/** Whether a value has the form of a {@link createSiteIntent} id. */
|
|
71
|
+
function isSiteIntent(value) {
|
|
72
|
+
return /^[\w-]{43}$/.test(value);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Whether a value is a path of the app, such as `/docs?tab=1`: it starts with one `/`, and has no `\` and no control
|
|
76
|
+
* character, which URL parsers remove.
|
|
77
|
+
*/
|
|
78
|
+
function isSitePath(value) {
|
|
79
|
+
return value.startsWith("/") && !value.startsWith("//") && !value.includes("\\") && !/\p{Cc}/u.test(value) && value.length <= 2048;
|
|
80
|
+
}
|
|
81
|
+
function appUrl(url) {
|
|
82
|
+
return `${url.origin}${url.pathname.replace(/\/+$/, "")}`;
|
|
83
|
+
}
|
|
84
|
+
function siteAppUrl(value) {
|
|
85
|
+
return URL.canParse(value) ? appUrl(new URL(value)) : void 0;
|
|
86
|
+
}
|
|
87
|
+
function siteDestination(app, path) {
|
|
88
|
+
if (!isSitePath(path)) return void 0;
|
|
89
|
+
const base = new URL(app);
|
|
90
|
+
const mount = base.pathname.replace(/\/+$/, "");
|
|
91
|
+
const url = new URL(`${mount}${path}`, base.origin);
|
|
92
|
+
return url.origin === base.origin && (url.pathname === mount || url.pathname.startsWith(`${mount}/`)) ? url.href : void 0;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The Console URL that starts a visit, from the app's `GET /_vitehub/site`, with the `project` and `intent` queries of
|
|
96
|
+
* that request. An `intent` names the impersonation or preview that the member started in the Console.
|
|
97
|
+
*/
|
|
98
|
+
function siteVisitUrl(input) {
|
|
99
|
+
const query = new URLSearchParams({
|
|
100
|
+
app: input.app,
|
|
101
|
+
state: input.state,
|
|
102
|
+
return: input.path,
|
|
103
|
+
...input.project ? { project: input.project } : {}
|
|
104
|
+
});
|
|
105
|
+
if (input.intent) query.set("intent", input.intent);
|
|
106
|
+
return `${input.console.replace(/\/+$/, "")}/visit?${query}`;
|
|
107
|
+
}
|
|
108
|
+
function siteHandoffBytes(app, issuer, project, path, key, expires) {
|
|
109
|
+
return encoder.encode(JSON.stringify([
|
|
110
|
+
"vitehub-site-handoff-v1",
|
|
111
|
+
app,
|
|
112
|
+
issuer,
|
|
113
|
+
project,
|
|
114
|
+
path,
|
|
115
|
+
key,
|
|
116
|
+
expires
|
|
117
|
+
]));
|
|
118
|
+
}
|
|
119
|
+
function isSiteIssuer(issuer) {
|
|
120
|
+
const url = URL.parse(issuer);
|
|
121
|
+
return url !== null && url.origin === issuer && (url.protocol === "https:" || url.protocol === "http:" && [
|
|
122
|
+
"localhost",
|
|
123
|
+
"127.0.0.1",
|
|
124
|
+
"[::1]"
|
|
125
|
+
].includes(url.hostname));
|
|
126
|
+
}
|
|
127
|
+
async function verifySiteHandoff(input) {
|
|
128
|
+
const { app, issuer, project, path, handoff, keys } = input;
|
|
129
|
+
if (!isSiteIssuer(issuer)) return false;
|
|
130
|
+
const match = /^([A-Z0-9_]{1,64})\.(\d{1,12})\.([\w-]{86})$/.exec(handoff);
|
|
131
|
+
if (!match || match[0] !== handoff) return false;
|
|
132
|
+
const [, key, expires, signature] = match;
|
|
133
|
+
if (!key || !expires || !signature) return false;
|
|
134
|
+
const remaining = Number(expires) - Math.floor(Date.now() / 1e3);
|
|
135
|
+
const publicKey = keys.get(key);
|
|
136
|
+
return publicKey !== void 0 && remaining > 0 && remaining <= siteTokenLifetimeSeconds && await verifyConsoleBytes(publicKey, signature, siteHandoffBytes(app, issuer, project, path, key, expires));
|
|
137
|
+
}
|
|
138
|
+
function failure(code, message) {
|
|
139
|
+
return {
|
|
140
|
+
code,
|
|
141
|
+
message,
|
|
142
|
+
ok: false
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function readClaims(value) {
|
|
146
|
+
if (!isRecord(value)) return void 0;
|
|
147
|
+
const { aud, commentsAgent, email, exp, iat, image, kind, name, path, roles, state, sub, target } = value;
|
|
148
|
+
const text = (field, maximum = 512) => typeof field === "string" && field.length > 0 && field.length <= maximum;
|
|
149
|
+
const optional = (field) => field === void 0 || text(field, 2048);
|
|
150
|
+
const time = (field) => typeof field === "number" && Number.isSafeInteger(field);
|
|
151
|
+
if (!text(aud, maximumTokenLength) || !text(sub) || !text(name) || !text(path, 2048) || !text(state) || !text(kind) || !time(iat) || !time(exp)) return void 0;
|
|
152
|
+
if (!optional(email) || !optional(image) || !Array.isArray(roles) || !roles.every((role) => text(role, 64))) return void 0;
|
|
153
|
+
const targetClaim = target === void 0 ? void 0 : readSiteTokenTarget(target);
|
|
154
|
+
if (target !== void 0 && !targetClaim) return void 0;
|
|
155
|
+
return {
|
|
156
|
+
aud,
|
|
157
|
+
sub,
|
|
158
|
+
name,
|
|
159
|
+
...typeof email === "string" ? { email } : {},
|
|
160
|
+
...typeof image === "string" ? { image } : {},
|
|
161
|
+
roles: roles.filter((role) => typeof role === "string"),
|
|
162
|
+
...isRecord(commentsAgent) && text(commentsAgent.projectId) && text(commentsAgent.teamId) && typeof commentsAgent.resolve === "boolean" ? { commentsAgent: {
|
|
163
|
+
projectId: commentsAgent.projectId,
|
|
164
|
+
teamId: commentsAgent.teamId,
|
|
165
|
+
resolve: commentsAgent.resolve
|
|
166
|
+
} } : {},
|
|
167
|
+
kind,
|
|
168
|
+
...targetClaim ? { target: targetClaim } : {},
|
|
169
|
+
path,
|
|
170
|
+
state,
|
|
171
|
+
iat,
|
|
172
|
+
exp
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function parseJson(bytes) {
|
|
176
|
+
try {
|
|
177
|
+
return JSON.parse(decoder.decode(bytes));
|
|
178
|
+
} catch {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Check a token in the app. `keys` are the public keys of `readConsolePublicKeys()`, `origin` is the URL that the app
|
|
184
|
+
* serves, with its base path, such as `https://app.example.com/portal`, and `state` is the value of its
|
|
185
|
+
* state cookie. `kinds` are the kinds that the route accepts, `["site"]` by default. `lifetime` is the number of
|
|
186
|
+
* seconds after `iat` that the token works, for an app that keeps the token in its session cookie. Without it, the
|
|
187
|
+
* token works until its `exp`, 60 seconds. The token is refused when it is malformed, signed with an unknown key or
|
|
188
|
+
* another key, made for another origin, expired, made for another browser, of another kind, or when its path resolves
|
|
189
|
+
* outside the app URL.
|
|
190
|
+
*/
|
|
191
|
+
async function verifySiteToken(input) {
|
|
192
|
+
const parts = input.token.length <= maximumTokenLength ? input.token.split(".") : [];
|
|
193
|
+
const [version, name, payload, signature] = parts;
|
|
194
|
+
const bytes = parts.length === 4 && version === tokenVersion && payload ? decodeConsoleBase64url(payload) : void 0;
|
|
195
|
+
const claims = bytes ? readClaims(parseJson(bytes)) : void 0;
|
|
196
|
+
if (!name || !isConsoleKeyName(name) || !signature || !claims || !kinds.includes(claims.kind)) return failure("SITE_TOKEN_MALFORMED", "The Site access token is malformed. Open the site from the Console again.");
|
|
197
|
+
const publicKey = input.keys.get(name);
|
|
198
|
+
if (!publicKey) return failure("SITE_TOKEN_KEY_UNKNOWN", `The Site access token was signed with the key \`${name}\`, and this app has no \`VITEHUB_CONSOLE_KEY_${name}\`.`);
|
|
199
|
+
if (!await verifyConsoleBytes(publicKey, signature, encoder.encode(`${version}.${name}.${payload}`))) return failure("SITE_TOKEN_SIGNATURE", `The Site access token does not match the key \`VITEHUB_CONSOLE_KEY_${name}\`.`);
|
|
200
|
+
const app = siteAppUrl(input.origin);
|
|
201
|
+
if (siteAppUrl(claims.aud) !== app) return failure("SITE_TOKEN_AUDIENCE", `The Site access token was made for ${claims.aud}, and this app is ${app}.`);
|
|
202
|
+
const now = Math.floor((input.now ?? Date.now()) / 1e3);
|
|
203
|
+
if (now >= (input.lifetime === void 0 ? claims.exp : claims.iat + input.lifetime) || claims.iat > now + siteTokenLifetimeSeconds) return failure("SITE_TOKEN_EXPIRED", "The Site access token expired. Open the site from the Console again.");
|
|
204
|
+
if (!input.state || claims.state !== await siteStateHash(input.state)) return failure("SITE_TOKEN_STATE", "The Site access token was made for another browser. Open the site again in this browser.");
|
|
205
|
+
if (!(input.kinds ?? ["site"]).includes(claims.kind)) return failure("SITE_TOKEN_KIND", `This route does not accept a \`${claims.kind}\` token.`);
|
|
206
|
+
const destination = siteDestination(input.origin, claims.path);
|
|
207
|
+
if (!destination) return failure("SITE_TOKEN_PATH", "The path of the Site access token is not a page of this app.");
|
|
208
|
+
return {
|
|
209
|
+
claims,
|
|
210
|
+
destination,
|
|
211
|
+
key: name,
|
|
212
|
+
ok: true
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
export { siteRoute as a, verifySiteHandoff as c, siteAccessOperation as i, verifySiteToken as l, isSiteIntent as n, siteStateHash as o, isSitePath as r, siteVisitUrl as s, createSiteState as t };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { s as readConsolePublicKeys } from "./console-signature--55DIKf2.js";
|
|
2
|
+
import { l as verifySiteToken, o as siteStateHash } from "./site-token-Wa7fhjwg.js";
|
|
3
|
+
import { i as isConsoleDevelopmentBuild } from "./development-DD567hhJ.js";
|
|
4
|
+
import { getStandardContext } from "@vite-hub/runtime/internal/h3";
|
|
5
|
+
import { resolvePublicUrl } from "@vite-hub/runtime";
|
|
6
|
+
// src/console/runtime/server/site-visitor.ts
|
|
7
|
+
const siteCookie = "__Host-vitehub-site";
|
|
8
|
+
const siteStateCookie = "__Host-vitehub-site-state";
|
|
9
|
+
/** Seconds that a browser stays signed in after the Console signed its token. */
|
|
10
|
+
const siteSessionLifetime = 43200;
|
|
11
|
+
/** The length of the state part of the site cookie. */
|
|
12
|
+
const siteStateLength = 43;
|
|
13
|
+
async function siteCookieNames(base) {
|
|
14
|
+
const path = base.replace(/\/+$/, "");
|
|
15
|
+
const suffix = path ? `-${await siteStateHash(path)}` : "";
|
|
16
|
+
return {
|
|
17
|
+
session: `${siteCookie}${suffix}`,
|
|
18
|
+
state: `${siteStateCookie}${suffix}`
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** The value of the cookie `name` of a request. */
|
|
22
|
+
function cookieValue(request, name) {
|
|
23
|
+
for (const part of (request.headers.get("cookie") ?? "").split(";")) {
|
|
24
|
+
const at = part.indexOf("=");
|
|
25
|
+
if (at > 0 && part.slice(0, at).trim() === name) return part.slice(at + 1).trim();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function siteApp(request, base, development) {
|
|
29
|
+
const origin = development ? request.url : resolvePublicUrl({ request });
|
|
30
|
+
return origin ? `${new URL(origin).origin}${base.replace(/\/+$/, "")}` : void 0;
|
|
31
|
+
}
|
|
32
|
+
const visitors = /* @__PURE__ */ new WeakMap();
|
|
33
|
+
async function readVisitor(request, base, development) {
|
|
34
|
+
if (!request.headers.has("cookie")) return void 0;
|
|
35
|
+
const value = cookieValue(request, (await siteCookieNames(base)).session);
|
|
36
|
+
if (!value || value[43] !== ".") return void 0;
|
|
37
|
+
const keys = readConsolePublicKeys({
|
|
38
|
+
...globalThis.process?.env,
|
|
39
|
+
...getStandardContext(request).runtime?.cloudflare?.env
|
|
40
|
+
});
|
|
41
|
+
if (!(keys instanceof Map)) return void 0;
|
|
42
|
+
let app;
|
|
43
|
+
try {
|
|
44
|
+
app = siteApp(request, base, development);
|
|
45
|
+
} catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!app) return void 0;
|
|
49
|
+
const result = await verifySiteToken({
|
|
50
|
+
token: value.slice(44),
|
|
51
|
+
keys,
|
|
52
|
+
origin: app,
|
|
53
|
+
state: value.slice(0, 43),
|
|
54
|
+
lifetime: siteSessionLifetime
|
|
55
|
+
});
|
|
56
|
+
if (!result.ok) return void 0;
|
|
57
|
+
const { aud, sub, name, email, image, roles, commentsAgent } = result.claims;
|
|
58
|
+
const kind = roles.includes("console") ? "member" : "guest";
|
|
59
|
+
return {
|
|
60
|
+
id: sub,
|
|
61
|
+
name,
|
|
62
|
+
...email ? { email } : {},
|
|
63
|
+
...image ? { image } : {},
|
|
64
|
+
roles,
|
|
65
|
+
kind,
|
|
66
|
+
...kind === "member" && commentsAgent ? { commentsAgent: {
|
|
67
|
+
project: {
|
|
68
|
+
id: commentsAgent.projectId,
|
|
69
|
+
teamId: commentsAgent.teamId,
|
|
70
|
+
url: aud
|
|
71
|
+
},
|
|
72
|
+
resolve: commentsAgent.resolve
|
|
73
|
+
} } : {}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The person of the site cookie of a request, or `undefined` without a cookie, or with one that the public keys of the
|
|
78
|
+
* app do not verify, that was made for another app, or that is older than 12 hours. `base` is the app base, such as
|
|
79
|
+
* `/portal/`. A development server checks the token against the request origin. Each Request is checked once.
|
|
80
|
+
*/
|
|
81
|
+
function readConsoleSiteVisitor(request, base = "", development = isConsoleDevelopmentBuild()) {
|
|
82
|
+
let visitor = visitors.get(request);
|
|
83
|
+
if (!visitor) {
|
|
84
|
+
visitor = readVisitor(request, base, development);
|
|
85
|
+
visitors.set(request, visitor);
|
|
86
|
+
}
|
|
87
|
+
return visitor;
|
|
88
|
+
}
|
|
89
|
+
export { siteStateLength as a, siteSessionLifetime as i, readConsoleSiteVisitor as n, siteCookieNames as r, cookieValue as t };
|
|
@@ -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 { _ as table } from "../operations-
|
|
1
|
+
import { t as defineOperation } from "../operation-definition-D04Rdjbe.js";
|
|
2
|
+
import { _ as table } from "../operations-DksTrRMb.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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineErrors } from "@vite-hub/runtime";
|
|
2
2
|
import { parseYAML } from "confbox/yaml";
|
|
3
|
-
|
|
3
|
+
// src/skills.ts
|
|
4
4
|
/**
|
|
5
5
|
* Agent Skills that an app gives to coding agents. One list feeds every surface:
|
|
6
6
|
*
|
|
@@ -496,5 +496,4 @@ function skillSettings(skills, options) {
|
|
|
496
496
|
skills
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
//#endregion
|
|
500
499
|
export { skillArchive as a, skillsMcp as c, serveSkills as i, defineSkills as n, skillDigest as o, isSkillSettings as r, skillSettings as s, defineSkill as t };
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Result } from "@vite-hub/runtime";
|
|
2
|
-
//#region src/skills.d.ts
|
|
3
2
|
/** The codes of `vite-hub/skills`. Each has a row in the Errors table of https://vitehub.dev/docs/console/skills. */
|
|
4
3
|
export type SkillErrorCode = "SKILL_DUPLICATE_NAME" | "SKILL_FILE_MISSING" | "SKILL_INVALID_FRONTMATTER" | "SKILL_INVALID_PATH" | "SKILL_NOT_FOUND" | "SKILL_SETTINGS_UNAVAILABLE";
|
|
5
4
|
/** One file of a skill. */
|
|
@@ -194,4 +193,4 @@ export declare function isSkillSettings(value: unknown): value is SkillSettings;
|
|
|
194
193
|
* Console section **Served skills** and `vitehub served-skills` show and change the switches.
|
|
195
194
|
*/
|
|
196
195
|
export declare function skillSettings<TSkill extends Skill>(skills: SkillList<TSkill>, options: SkillSettingsOptions): SkillSettings<TSkill>;
|
|
197
|
-
|
|
196
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "./agents-DXLHsE7x.js";
|
|
2
|
+
import { r as consoleRequestError } from "./request-D769eiBL.js";
|
|
3
3
|
import { inspectAgentSkillFiles } from "@vite-hub/agent/server/internal";
|
|
4
|
-
|
|
4
|
+
// src/agent/console/skills.get.ts
|
|
5
5
|
const maxFileBytes = 524288;
|
|
6
6
|
function skillFiles(agent) {
|
|
7
7
|
const definition = getConsoleAgentDefinition(agent, "inspect");
|
|
@@ -44,5 +44,4 @@ async function inspectConsoleSkills(input) {
|
|
|
44
44
|
}))
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
export { inspectConsoleSkills };
|
package/dist/skills.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { defineSkill, defineSkills, isSkillSettings, serveSkills, skillArchive, skillDigest, skillSettings, skillsMcp };
|
|
1
|
+
export { t as defineSkill, n as defineSkills, r as isSkillSettings, i as serveSkills, a as skillArchive, o as skillDigest, s as skillSettings, c as skillsMcp } from "./skills-C1MaGEbO.js";
|
|
@@ -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 * as v from "valibot";
|
|
3
|
-
|
|
3
|
+
// src/logs/source.ts
|
|
4
4
|
const logLevelSchema = v.picklist([
|
|
5
5
|
"debug",
|
|
6
6
|
"info",
|
|
@@ -56,5 +56,4 @@ function isLogCursorExpiredError(error) {
|
|
|
56
56
|
function parseLogQuery(input) {
|
|
57
57
|
return v.parse(logQuerySchema, input);
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { logPageSchema as a, parseLogQuery as c, logLevelSchema as i, logCursorExpiredError as n, logQuerySchema as o, logEntrySchema as r, logSourceInfoSchema as s, isLogCursorExpiredError as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Diagnostic } from "nostics";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
//#region src/logs/source.d.ts
|
|
4
3
|
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
5
4
|
interface LogEntry {
|
|
6
5
|
id: string;
|
|
@@ -55,5 +54,4 @@ declare function logCursorExpiredError(): Diagnostic;
|
|
|
55
54
|
declare function isLogCursorExpiredError(error: unknown): boolean;
|
|
56
55
|
/** Validate once at the transport boundary. Adapters must reject filters they cannot apply. */
|
|
57
56
|
declare function parseLogQuery(input: unknown): v.InferOutput<typeof logQuerySchema>;
|
|
58
|
-
//#endregion
|
|
59
57
|
export { LogSource as a, logCursorExpiredError as c, logPageSchema as d, logQuerySchema as f, LogQuery as i, logEntrySchema as l, parseLogQuery as m, LogLevel as n, LogSourceInfo as o, logSourceInfoSchema as p, LogPage as r, isLogCursorExpiredError as s, LogEntry as t, logLevelSchema as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { effectScope, watch } from "vue";
|
|
2
2
|
import { useStoredData } from "@vite-hub/device/vue";
|
|
3
|
-
|
|
3
|
+
// src/console/runtime/client/stored.ts
|
|
4
4
|
/**
|
|
5
5
|
* The version of the answers that the Console keeps on the device. Change it when the shape of a stored answer changes,
|
|
6
6
|
* so the next visit does not show an answer of the old shape.
|
|
@@ -36,5 +36,4 @@ function readStored(key, loader, options = {}) {
|
|
|
36
36
|
stop: () => scope.stop()
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { readStored as a, consoleProjectKey as i, consoleAppCheckKey as n, consoleDeviceVersion as r, consoleAccountKey as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as AnyOperation } from "../operations-
|
|
2
|
-
//#region src/task/runtime.d.ts
|
|
1
|
+
import { n as AnyOperation } from "../operations-DgFhA1WE.js";
|
|
3
2
|
/** One task that the Nitro runtime registers. */
|
|
4
3
|
interface TaskSummary {
|
|
5
4
|
description?: string;
|
|
@@ -14,9 +13,6 @@ interface TaskRunResult {
|
|
|
14
13
|
/** The `result` field that the task returns. */
|
|
15
14
|
result?: unknown;
|
|
16
15
|
}
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/task/operations.d.ts
|
|
19
16
|
/** The `task.*` operations: list and run. The Console, `vitehub task`, and agents run them. */
|
|
20
17
|
export declare const taskOperations: readonly AnyOperation[];
|
|
21
|
-
//#endregion
|
|
22
18
|
export type { TaskListResult, TaskRunResult };
|
package/dist/task/operations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as defineOperation } from "../operation-definition-
|
|
1
|
+
import { t as defineOperation } from "../operation-definition-D04Rdjbe.js";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
|
|
4
|
-
const runtime = () => import("../runtime-
|
|
3
|
+
// src/task/operations.ts
|
|
4
|
+
const runtime = () => import("../runtime-F0CTqBFx.js");
|
|
5
5
|
function defineTaskOperation(definition) {
|
|
6
6
|
return defineOperation({
|
|
7
7
|
...definition,
|
|
@@ -32,5 +32,4 @@ const taskOperations = [defineTaskOperation({
|
|
|
32
32
|
name: "task.run",
|
|
33
33
|
run: async ({ name, payload }) => (await runtime()).runNamedTask(name, payload)
|
|
34
34
|
})];
|
|
35
|
-
//#endregion
|
|
36
35
|
export { taskOperations };
|
package/dist/test/register.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-CBtvqI30.js";
|
|
2
2
|
import { register } from "node:module";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { setTimeout } from "node:timers/promises";
|
|
8
8
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
9
|
-
|
|
9
|
+
// src/test/register.ts
|
|
10
10
|
/**
|
|
11
11
|
* `node --import vite-hub/test/register --test` gives app tests the modules that `vitehub()` generates, as Vitest does.
|
|
12
12
|
* One Vite server of the app answers the module hooks. `node --test` runs each test file in its own process, and only
|
|
@@ -64,5 +64,4 @@ if (isMainThread) {
|
|
|
64
64
|
await import("vitehub-test:setup");
|
|
65
65
|
started?.worker.unref();
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export {};
|
package/dist/test.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SerializedResponse } from "@vite-hub/runtime";
|
|
2
|
-
//#region src/internal/test-types.d.ts
|
|
3
2
|
interface DeliverChannelOptions {
|
|
4
3
|
/** The Agent name in the webhook URL and in each run. Defaults to `agent`. */
|
|
5
4
|
agentName?: string;
|
|
@@ -109,8 +108,6 @@ interface TestSignIn {
|
|
|
109
108
|
[field: string]: unknown;
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/test.d.ts
|
|
114
111
|
export interface ViteHubTestOptions {
|
|
115
112
|
/** The app folder that has `server/`. Database reads its migrations from there. Defaults to the current folder. */
|
|
116
113
|
root?: string;
|
|
@@ -171,5 +168,4 @@ export interface ViteHubTest {
|
|
|
171
168
|
* `reset()` empties, so a test runs the app's own server code with no mocks and no provider account.
|
|
172
169
|
*/
|
|
173
170
|
export declare function setupViteHubTest(options?: ViteHubTestOptions): ViteHubTest;
|
|
174
|
-
//#endregion
|
|
175
171
|
export type { DeliverChannelOptions, SignInTestUser, TestSignIn };
|
package/dist/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { enableViteHubTestMode } from "@vite-hub/runtime/internal/test-mode-setup";
|
|
2
|
-
|
|
2
|
+
// src/test.ts
|
|
3
3
|
/**
|
|
4
4
|
* Turns on test mode for this test file. KV, Blob, Database, Queue, Workflow, Email, Rate Limit, and Auth then use local backends that
|
|
5
5
|
* `reset()` empties, so a test runs the app's own server code with no mocks and no provider account.
|
|
@@ -45,5 +45,4 @@ function setupViteHubTest(options = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { setupViteHubTest };
|
package/dist/ui/vite.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-CBtvqI30.js";
|
|
2
|
+
import { t as consoleHttpError } from "./http-error-BorAxJYM.js";
|
|
3
|
+
import { agentUsagePeriod, agentUsageRow, invocationUsage, matchesAgentUsageQuery, parseAgentUsageStatus as parseConsoleUsageStatus, parseAgentUsageWindow as parseConsoleUsageWindow, summarizeAgentUsage } from "@vite-hub/agent/usage";
|
|
4
|
+
// src/agent/console/usage.ts
|
|
5
|
+
/** Keep every page inside the first request's date window and filter scope. */
|
|
6
|
+
function usageQueryWindow(options) {
|
|
7
|
+
const period = agentUsagePeriod(options);
|
|
8
|
+
if (!("problem" in period)) return period;
|
|
9
|
+
if (period.problem === "cursor") throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0115({ message: "Invalid usage cursor" }));
|
|
10
|
+
const message = period.problem === "window" ? "Invalid usage window" : "Invalid usage timestamp";
|
|
11
|
+
throw consoleHttpError(400, viteHubErrorDiagnostics.VITE_HUB_R0072({ message }));
|
|
12
|
+
}
|
|
13
|
+
async function createUsageSummary(invocations, options = {}) {
|
|
14
|
+
const period = usageQueryWindow(options);
|
|
15
|
+
const rows = [];
|
|
16
|
+
let cursor;
|
|
17
|
+
do {
|
|
18
|
+
const page = await invocations.list({
|
|
19
|
+
...options.agentName ? { agentName: options.agentName } : {},
|
|
20
|
+
...cursor === void 0 ? {} : { cursor },
|
|
21
|
+
limit: 100
|
|
22
|
+
});
|
|
23
|
+
const selected = page.invocations.filter((summary) => matchesAgentUsageQuery(agentUsageRow(summary), options, period));
|
|
24
|
+
const records = await Promise.all(selected.map((summary) => invocations.get(summary.id)));
|
|
25
|
+
for (const [index, record] of records.entries()) {
|
|
26
|
+
const summary = selected[index];
|
|
27
|
+
if (summary) rows.push(agentUsageRow(record ?? summary));
|
|
28
|
+
}
|
|
29
|
+
cursor = page.cursor;
|
|
30
|
+
} while (cursor !== void 0);
|
|
31
|
+
return summarizeAgentUsage(rows, options, period);
|
|
32
|
+
}
|
|
33
|
+
export { usageQueryWindow as a, parseConsoleUsageWindow as i, invocationUsage as n, parseConsoleUsageStatus as r, createUsageSummary as t };
|