vite-hub 0.3.1 → 0.4.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 +34 -36
- package/dist/_internal/runtime/browser-errors.d.ts +1 -1
- package/dist/_internal/runtime/browser-errors.js +1 -1
- package/dist/{access-F0YP5D5E.js → access-BDST818p.js} +6 -6
- package/dist/{access-policy-BsB3QVe5.d.ts → access-policy-CGXhO3Ee.d.ts} +3 -3
- package/dist/{access-policy-B_DCpZUt.js → access-policy-DjBKLo3c.js} +2 -2
- package/dist/{account-Bsu-LBOF.d.ts → account-BnOAU055.d.ts} +1 -1
- package/dist/{agent-invocations.post-DIm8tJV2.js → agent-invocations.post-CcPvfA0n.js} +7 -7
- package/dist/{agents-DnHexzTJ.js → agents-BDeazoAW.js} +2 -2
- package/dist/{agents-y5hBFHUQ.js → agents-BoWau_ei.js} +1 -1
- package/dist/{auth-BFVHYizM.d.ts → auth-BZOy7obk.d.ts} +2 -2
- package/dist/{auth-types-DWpTBZvp.d.ts → auth-types-CyqhWvYF.d.ts} +1 -1
- package/dist/bin.js +15 -7
- package/dist/{blob-CiUmptIp.d.ts → blob-CFLwMsjH.d.ts} +1 -1
- package/dist/{blob-BRV6_wZa.js → blob-CpvlM8jp.js} +3 -3
- package/dist/cache/operations.d.ts +1 -1
- package/dist/cache/operations.js +2 -2
- package/dist/cache.js +1 -1
- package/dist/choices/vue.d.ts +1 -0
- package/dist/choices/vue.js +2 -0
- package/dist/choices.d.ts +1 -0
- package/dist/choices.js +2 -0
- package/dist/cli-config-UAGTmuFa.js +2 -0
- package/dist/{cli-config-Bpjjfz5j.js → cli-config-wxKjF2Y0.js} +1 -16
- package/dist/console/auth-types.d.ts +1 -1
- package/dist/console/auth.d.ts +1 -1
- package/dist/console/auth.js +1 -1
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +2 -2
- package/dist/console/runtime/client/blob-media.d.ts +1 -1
- package/dist/console/runtime/client/blob-media.js +3 -3
- package/dist/console/runtime/client/comment-thread.js +1 -1
- package/dist/console/runtime/client/content-heads.d.ts +45 -0
- package/dist/console/runtime/client/content-heads.js +58 -0
- package/dist/console/runtime/client/documents.d.ts +2 -2
- package/dist/console/runtime/client/documents.js +1 -1
- package/dist/console/runtime/client/editor.d.ts +1 -1
- package/dist/console/runtime/client/invocation.js +3 -3
- package/dist/console/runtime/client/live.d.ts +1 -1
- package/dist/console/runtime/client/mcp-client.js +1 -1
- package/dist/console/runtime/client/media-library.d.ts +1 -1
- package/dist/console/runtime/client/media-library.js +1 -1
- package/dist/console/runtime/client/media-uploads.d.ts +1 -1
- package/dist/console/runtime/client/media-uploads.js +1 -1
- package/dist/console/runtime/client/operation-view.d.ts +1 -1
- package/dist/console/runtime/client/operation-view.js +2 -2
- package/dist/console/runtime/client/presence.d.ts +1 -1
- package/dist/console/runtime/client/problem.js +2 -2
- package/dist/console/runtime/client/project-link.d.ts +1 -1
- package/dist/console/runtime/client/project-link.js +1 -1
- package/dist/console/runtime/client/project-session.d.ts +2 -2
- package/dist/console/runtime/client/project-session.js +4 -4
- package/dist/console/runtime/client/project.d.ts +1 -1
- package/dist/console/runtime/client/project.js +1 -1
- package/dist/console/runtime/client/publish.d.ts +1 -1
- package/dist/console/runtime/client/rate-limit.js +2 -2
- package/dist/console/runtime/client/read-only.d.ts +1 -1
- package/dist/console/runtime/client/read-only.js +1 -1
- package/dist/console/runtime/client/request.js +1 -1
- package/dist/console/runtime/client/schedule-run.js +2 -2
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -1
- package/dist/console/runtime/client/sidebar.ts +1 -1
- package/dist/console/runtime/client/site-access.js +2 -2
- package/dist/console/runtime/client/ticket.js +1 -1
- package/dist/console/runtime/client/workflow.js +2 -2
- package/dist/console/runtime/components/console-content-heads.vue +72 -0
- package/dist/console/runtime/components/console-document-dashboard.vue +43 -35
- package/dist/console/runtime/components/console-documents.vue +1 -0
- package/dist/console/runtime/components/console-markdown-editor.vue +4 -1
- package/dist/console/runtime/components/invocation/agent-invocation.ts +18 -5
- package/dist/console/runtime/components/invocation/internal/input-attachments.ts +69 -0
- package/dist/console/runtime/components/invocation/internal/invocation-activity.ts +67 -12
- package/dist/console/runtime/components/invocation/internal/invocation-conversation.ts +12 -4
- package/dist/console/runtime/components/invocation/invocation.css +16 -0
- package/dist/console/runtime/console-route.js +1 -1
- package/dist/console/runtime/definitions.d.ts +1 -1
- package/dist/console/runtime/definitions.js +1 -1
- package/dist/console/runtime/diagnostics.ts +30 -30
- package/dist/console/runtime/page-tool/page-tool.js +1 -1
- package/dist/console/runtime/public/skills/vitehub/SKILL.md +3 -3
- package/dist/console/runtime/public/skills/vitehub/references/framework-composition.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/preview-contract.md +9 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/database.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/markdown-template.md +3 -3
- package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +2 -2
- package/dist/console/runtime/public/skills/vitehub/references/sandboxes-hosts.md +4 -4
- package/dist/console/runtime/sections.d.ts +1 -1
- package/dist/console/runtime/sections.js +1 -1
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/access-policy.js +1 -1
- package/dist/console/runtime/server/agents.get.js +2 -2
- package/dist/console/runtime/server/auth.d.ts +1 -1
- package/dist/console/runtime/server/auth.js +2 -2
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -1
- package/dist/console/runtime/server/channel-replay.d.ts +2 -2
- package/dist/console/runtime/server/channel-replay.js +4 -4
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.get.d.ts +1 -1
- package/dist/console/runtime/server/database.get.js +2 -2
- package/dist/console/runtime/server/database.js +1 -1
- package/dist/console/runtime/server/definitions.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +3 -3
- package/dist/console/runtime/server/definitions.get.js +3 -3
- package/dist/console/runtime/server/definitions.js +1 -1
- package/dist/console/runtime/server/development.d.ts +2 -2
- package/dist/console/runtime/server/development.js +2 -2
- package/dist/console/runtime/server/documents.d.ts +1 -1
- package/dist/console/runtime/server/documents.js +1 -1
- package/dist/console/runtime/server/env.get.d.ts +1 -1
- package/dist/console/runtime/server/env.get.js +3 -3
- package/dist/console/runtime/server/invocation-capabilities.get.js +2 -2
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +1 -1
- package/dist/console/runtime/server/invocation-workspace.get.js +5 -5
- package/dist/console/runtime/server/invocation.get.d.ts +1 -1
- package/dist/console/runtime/server/invocation.get.js +6 -6
- package/dist/console/runtime/server/invocations.get.js +3 -3
- package/dist/console/runtime/server/logs.get.d.ts +2 -2
- package/dist/console/runtime/server/logs.get.js +5 -5
- package/dist/console/runtime/server/mcp-client-operations.d.ts +1 -1
- package/dist/console/runtime/server/mcp-client-operations.js +3 -3
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -1
- package/dist/console/runtime/server/page-auth.d.ts +1 -1
- package/dist/console/runtime/server/page-tool.d.ts +1 -1
- package/dist/console/runtime/server/page-tool.js +2 -2
- package/dist/console/runtime/server/rpc.d.ts +2 -2
- package/dist/console/runtime/server/rpc.js +7 -7
- package/dist/console/runtime/server/search.get.js +1 -1
- package/dist/console/runtime/server/sections.d.ts +4 -4
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +5 -5
- package/dist/console/runtime/server/sections.js +3 -3
- package/dist/console/runtime/server/setup.d.ts +3 -3
- package/dist/console/runtime/server/setup.js +2 -2
- package/dist/console/runtime/server/site-entry.d.ts +1 -1
- package/dist/console/runtime/server/site-entry.js +9 -6
- package/dist/console/runtime/server/site-session.d.ts +5 -1
- package/dist/console/runtime/server/site-session.js +1 -1
- package/dist/console/runtime/server/status.get.d.ts +2 -2
- package/dist/console/runtime/server/status.get.js +5 -5
- package/dist/console/runtime/server/tickets.d.ts +1 -1
- package/dist/console/runtime/server/tickets.js +1 -1
- package/dist/console/runtime/server/usage.get.d.ts +2 -2
- package/dist/console/runtime/server/usage.get.js +7 -7
- package/dist/console/runtime/server/workspace-files.get.d.ts +1 -1
- package/dist/console/runtime/server/workspace-files.get.js +3 -3
- package/dist/console/server.d.ts +5 -5
- package/dist/console/server.js +6 -6
- package/dist/console/ui.js +121 -20
- package/dist/{console-route-COvNB_Xj.js → console-route-CBuqZ4wO.js} +1 -1
- package/dist/{database-J7M0B3ED.js → database-BdOBjPkS.js} +1 -1
- package/dist/{database-BVyhAxq-.d.ts → database-DyPVMjp_.d.ts} +1 -1
- package/dist/{definitions-BDRkT5-f.js → definitions-BW6SvmMM.js} +1 -0
- package/dist/{definitions-bepsXY5G.js → definitions-CNq_Shkh.js} +3 -3
- package/dist/{definitions-CxDT8D8Y.d.ts → definitions-DB4LbZ7T.d.ts} +2 -0
- package/dist/{definitions-CGTWTj67.d.ts → definitions-Dbgxfz3I.d.ts} +1 -1
- package/dist/development-W5EwONyL.d.ts +12 -0
- package/dist/{development-BzeSHZGH.js → development-zLxOp-AO.js} +12 -2
- package/dist/{diagnostics-D0DefmQj.js → diagnostics-9U_fYxMy.js} +30 -30
- package/dist/doctor.js +88 -107
- package/dist/{documents-C97WMaJZ.d.ts → documents-BASIRZ91.d.ts} +1 -1
- package/dist/{documents-RVHsQKFw.d.ts → documents-CboVhYFz.d.ts} +3 -3
- package/dist/{documents-DwPfR-fz.js → documents-CjJTCrY8.js} +3 -3
- package/dist/{documents-8US1nUgK.js → documents-qrHHqlNU.js} +1 -1
- package/dist/durability/operations.d.ts +1 -1
- package/dist/durability/operations.js +2 -2
- package/dist/{entries-D48wVEaS.js → entries-Bj-jPs_J.js} +1 -1
- package/dist/{error-diagnostics-C2rjmOlX.js → error-diagnostics-Bm3JKYjz.js} +19 -11
- package/dist/error-diagnostics.ts +19 -11
- package/dist/index.d.ts +15 -2
- package/dist/index.js +8 -4
- package/dist/internal/disabled-redis-driver.js +1 -1
- package/dist/internal/disabled-upstash-driver.js +1 -1
- package/dist/internal/test-loader.js +1 -1
- package/dist/internal/test-server.js +1 -1
- package/dist/{internal-BP_O70ic.d.ts → internal-CO4OqqaS.d.ts} +3 -3
- package/dist/{invocation-page-undo-BkUau8X7.js → invocation-page-undo-DIZ-s3xT.js} +2 -2
- package/dist/{invocations-CsucCJuq.js → invocations-CK_-G540.js} +3 -3
- package/dist/logs/memory.js +1 -1
- package/dist/logs/source.js +1 -1
- package/dist/logs.js +2 -2
- package/dist/{mcp-client-D0mUt18v.js → mcp-client-By4zk0vU.js} +6 -6
- package/dist/{media-wZMY6f2M.js → media-BHpQ-4jw.js} +4 -4
- package/dist/{media-library-CEo-Ye2B.d.ts → media-library-D9ThbXqs.d.ts} +1 -1
- package/dist/{media-library-BChf8XOd.js → media-library-NaOMBKWS.js} +2 -2
- package/dist/{memory-DhirB6SA.js → memory-DTmq-Z6x.js} +2 -2
- package/dist/{nuxt-server-imports-Lnaf5Fe-.js → nuxt-server-imports-DH60Z7LA.js} +3 -2
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +94 -67
- package/dist/{operation-contributions-DflAv5AC.js → operation-contributions-BdS0z3tx.js} +2 -2
- package/dist/{operation-contributions-fZyVo662.d.ts → operation-contributions-DpkO_iSU.d.ts} +1 -1
- package/dist/{operation-definition-Bn8V2hab.js → operation-definition-a5keEpCd.js} +6 -1
- package/dist/{operations-DX9EkHwb.d.ts → operations-B0689BG1.d.ts} +5 -0
- package/dist/operations-CAQmIxGK.js +2 -0
- package/dist/{operations-B6N-ja8x.js → operations-CWP9dF3i.js} +11 -11
- package/dist/{operations-Dj_cp-UK.js → operations-EOdyctDc.js} +1 -1
- package/dist/{optional-owners-Crm6kVS5.js → optional-owners-BNA2OX6z.js} +37 -23
- package/dist/{page-tool-BCRyx3pM.d.ts → page-tool-CRCK1RHV.d.ts} +1 -1
- package/dist/{plugins-DQ8pF-38.js → plugins-B-DpgDPB.js} +1459 -714
- package/dist/{plugins-5uDXr9Km.d.ts → plugins-BqAtIEX2.d.ts} +75 -56
- package/dist/{project-C2dnB9Kf.js → project-C4N_Zcjl.js} +3 -3
- package/dist/{project-5EN7JaXI.d.ts → project-CufkVP1u.d.ts} +2 -2
- package/dist/{project-DOeM0zg3.js → project-DlWTGB7h.js} +1 -1
- package/dist/{project-link-D_XQvBOC.d.ts → project-link-BuOzBH9f.d.ts} +1 -1
- package/dist/{project-link-Qi7nltHM.js → project-link-D-6UefhA.js} +2 -2
- package/dist/{request-yCybBeqT.js → request-DE8w_cSM.js} +8 -3
- package/dist/{request-BUYAlAJl.js → request-DbFfYmCu.js} +2 -2
- package/dist/{runtime-DM8Z6KLT.js → runtime-DQuHg7OO.js} +1 -1
- package/dist/{runtime-DG34DLXc.js → runtime-OsEDfbM9.js} +1 -1
- package/dist/runtime-feature-guard-B64MMW9I.js +140 -0
- package/dist/scan-module-D_3X08mj.js +2 -0
- package/dist/scan-module-Df58L_6T.js +311 -0
- package/dist/{secret-AZLhaNyr.js → secret-Dy5uqvq9.js} +1 -1
- package/dist/{sections-BriKrBgN.d.ts → sections-BogiCmtz.d.ts} +2 -2
- package/dist/{sections-ACHVTCWn.d.ts → sections-CyrXbbkG.d.ts} +4 -4
- package/dist/{sections-4xyBoiar.d.ts → sections-Do7X4Nwt.d.ts} +1 -2
- package/dist/{sections-D6AM5Gy5.js → sections-DumoLKQN.js} +2 -3
- package/dist/{sections-CUJyQA9d.js → sections-et20h8w3.js} +3 -3
- package/dist/{sections.get-1lHjyKCI.d.ts → sections.get-COiLcQ0P.d.ts} +2 -2
- package/dist/seo/runtime.js +1 -1
- package/dist/{server-DbjFYSeU.js → server-BRJE4t-W.js} +2 -2
- package/dist/{setup-DLZFzuLv.d.ts → setup-ZbA1by7W.d.ts} +4 -3
- package/dist/{site-access-Bhsty_v4.js → site-access-BbJUe5QI.js} +1 -1
- package/dist/{site-access-CyRtc0gZ.js → site-access-BmE8HGxs.js} +4 -4
- package/dist/{site-session-Jf21TVw8.js → site-session-odJq1dYa.js} +5 -5
- package/dist/skills/operations.d.ts +1 -1
- package/dist/skills/operations.js +2 -2
- package/dist/skills.d.ts +1 -1
- package/dist/{skills.get-CHQMzSD_.js → skills.get-Bl8cBe8u.js} +2 -2
- package/dist/{source-w9BHUwyO.js → source-D4wWtoHh.js} +1 -1
- package/dist/task/operations.d.ts +1 -1
- package/dist/task/operations.js +2 -2
- package/dist/test/register.js +1 -1
- package/dist/{ticket-RKQF6Wy9.js → ticket-Cudn1dq3.js} +1 -1
- package/dist/{tickets-CfJhT7d0.js → tickets-C_0Fhc00.js} +6 -6
- package/dist/{usage-Bc0YY_ka.js → usage-B4taNt4a.js} +1 -1
- package/dist/{usage-index-CMMT4cXQ.js → usage-index-BsGAFzyq.js} +1 -1
- package/dist/{version-DDRL_OYz.js → version-DNmSsk5r.js} +22 -19
- package/dist/{cli-DjoDGgT4.js → vite-stage-mmtwQIMA.js} +32 -2
- package/dist/{workspace-history-l47NPVSy.js → workspace-history-CraoERnc.js} +1 -1
- package/package.json +93 -93
- package/dist/cli-config--rAg6V-a.js +0 -2
- package/dist/decisions/vue.d.ts +0 -1
- package/dist/decisions/vue.js +0 -2
- package/dist/decisions.d.ts +0 -1
- package/dist/decisions.js +0 -2
- package/dist/development-DgaQ05jw.d.ts +0 -9
- package/dist/operations-H9q0QB2C.js +0 -2
- package/dist/runtime-feature-guard-rpZz1eMF.js +0 -55
- package/dist/scan-module-BTeOuZsp.js +0 -2
- package/dist/scan-module-DlHQ8a0X.js +0 -148
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-Bm3JKYjz.js";
|
|
2
2
|
//#region src/internal/disabled-upstash-driver.ts
|
|
3
3
|
function disabledUpstashDriver() {
|
|
4
4
|
throw viteHubErrorDiagnostics.VITE_HUB_R0001({ message: "[vitehub] The Upstash KV driver is unavailable because this ViteHub build does not configure an Upstash store." });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "../error-diagnostics-Bm3JKYjz.js";
|
|
2
2
|
import { isAbsolute } from "node:path";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -20,7 +20,7 @@ const [root, addressFile, runner] = parentPort ? [workerData.root] : [
|
|
|
20
20
|
];
|
|
21
21
|
async function startVite() {
|
|
22
22
|
process.env.VITEST ??= "true";
|
|
23
|
-
const [{ createServer }, { loadViteHubCliConfig }] = await Promise.all([import("vite"), import("../cli-config
|
|
23
|
+
const [{ createServer }, { loadViteHubCliConfig }] = await Promise.all([import("vite"), import("../cli-config-UAGTmuFa.js")]);
|
|
24
24
|
let created;
|
|
25
25
|
await loadViteHubCliConfig(root, "serve", "test", { async resolveViteConfig(inlineConfig, _command, mode) {
|
|
26
26
|
created = await createServer({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as ConsoleAccess } from "./access-policy-
|
|
2
|
-
import "./documents-
|
|
3
|
-
import "./project-
|
|
1
|
+
import { o as ConsoleAccess } from "./access-policy-CGXhO3Ee.js";
|
|
2
|
+
import "./documents-CboVhYFz.js";
|
|
3
|
+
import "./project-CufkVP1u.js";
|
|
4
4
|
import { AgentInvocations } from "@vite-hub/agent";
|
|
5
5
|
import { BlobStorage, MediaRecord } from "@vite-hub/blob";
|
|
6
6
|
import { RuntimeDatabaseEntry } from "@vite-hub/database";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
|
|
2
2
|
import { t as consoleHttpError } from "./http-error-Bs6e8_-8.js";
|
|
3
|
-
import { t as getConsoleInvocations } from "./invocations-
|
|
3
|
+
import { t as getConsoleInvocations } from "./invocations-CK_-G540.js";
|
|
4
4
|
import { invocationPageChanges } from "@vite-hub/agent";
|
|
5
5
|
//#region src/console/runtime/server/invocation-page-undo.ts
|
|
6
6
|
function actionError(statusCode, message) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
|
|
2
2
|
import { i as resolveConsoleInvocations, n as consoleState } from "./internal-BreyUsQ6.js";
|
|
3
3
|
import { createMemoryAgentInvocationStore, defineAgentInvocations } from "@vite-hub/agent/server";
|
|
4
4
|
import { defaultAgentInvocationsDatabase } from "@vite-hub/agent/internal/default-invocations-core";
|
|
@@ -22,7 +22,7 @@ function createUsageIndex(invocations) {
|
|
|
22
22
|
if (!database) return void 0;
|
|
23
23
|
if (database.driver === "libsql") {
|
|
24
24
|
let index;
|
|
25
|
-
const open = () => index ??= Promise.all([database.open(), import("./usage-index-
|
|
25
|
+
const open = () => index ??= Promise.all([database.open(), import("./usage-index-BsGAFzyq.js")]).then(([client, { createConsoleUsageIndex }]) => createConsoleUsageIndex(client)).catch((error) => {
|
|
26
26
|
index = void 0;
|
|
27
27
|
throw error;
|
|
28
28
|
});
|
|
@@ -38,7 +38,7 @@ function createUsageIndex(invocations) {
|
|
|
38
38
|
const indexes = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
const open = async () => {
|
|
40
40
|
const binding = await database.open();
|
|
41
|
-
const { createConsoleUsageIndex } = await import("./usage-index-
|
|
41
|
+
const { createConsoleUsageIndex } = await import("./usage-index-BsGAFzyq.js");
|
|
42
42
|
let index = indexes.get(binding);
|
|
43
43
|
if (!index) {
|
|
44
44
|
index = createConsoleUsageIndex(d1UsageClient(binding), { requestScoped: true });
|
package/dist/logs/memory.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createLogBuffer } from "../memory-
|
|
1
|
+
import { t as createLogBuffer } from "../memory-DTmq-Z6x.js";
|
|
2
2
|
export { createLogBuffer };
|
package/dist/logs/source.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as logPageSchema, c as parseLogQuery, i as logLevelSchema, n as logCursorExpiredError, o as logQuerySchema, r as logEntrySchema, s as logSourceInfoSchema, t as isLogCursorExpiredError } from "../source-
|
|
1
|
+
import { a as logPageSchema, c as parseLogQuery, i as logLevelSchema, n as logCursorExpiredError, o as logQuerySchema, r as logEntrySchema, s as logSourceInfoSchema, t as isLogCursorExpiredError } from "../source-D4wWtoHh.js";
|
|
2
2
|
export { isLogCursorExpiredError, logCursorExpiredError, logEntrySchema, logLevelSchema, logPageSchema, logQuerySchema, logSourceInfoSchema, parseLogQuery };
|
package/dist/logs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as parseLogQuery, n as logCursorExpiredError } from "./source-
|
|
2
|
-
import { t as createLogBuffer } from "./memory-
|
|
1
|
+
import { c as parseLogQuery, n as logCursorExpiredError } from "./source-D4wWtoHh.js";
|
|
2
|
+
import { t as createLogBuffer } from "./memory-DTmq-Z6x.js";
|
|
3
3
|
export { createLogBuffer, logCursorExpiredError, parseLogQuery };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as isRecord } from "./object-D8pRdprI.js";
|
|
2
|
-
import { t as consoleDiagnostic } from "./diagnostics-
|
|
3
|
-
import { m as readConsoleOperationUser } from "./access-
|
|
4
|
-
import { i as consoleRequestError, r as consolePublicURL } from "./request-
|
|
5
|
-
import { r as consoleMountBase } from "./console-route-
|
|
2
|
+
import { t as consoleDiagnostic } from "./diagnostics-9U_fYxMy.js";
|
|
3
|
+
import { m as readConsoleOperationUser } from "./access-BDST818p.js";
|
|
4
|
+
import { i as consoleRequestError, r as consolePublicURL } from "./request-DbFfYmCu.js";
|
|
5
|
+
import { r as consoleMountBase } from "./console-route-CBuqZ4wO.js";
|
|
6
6
|
import { r as getConsoleSections } from "./sections-C83x0slv.js";
|
|
7
7
|
import { t as consoleMcpCallbackPath } from "./mcp-client-CTbTbn7d.js";
|
|
8
8
|
import { n as getActiveCloudflareEnv } from "./cloudflare-env-lookup-DKXdr4P_.js";
|
|
@@ -151,7 +151,7 @@ function kvConsoleMcpRecords(kv, key) {
|
|
|
151
151
|
},
|
|
152
152
|
connections: async (owner) => {
|
|
153
153
|
const base = `${prefix}:connections:${await hashed(owner)}`;
|
|
154
|
-
const names = (unwrap(await kv.
|
|
154
|
+
const names = (unwrap(await kv.list({ prefix: `${base}:` }))?.keys ?? []).map((name) => name.replaceAll("/", ":")).filter((name) => name.startsWith(`${base}:`));
|
|
155
155
|
return (await Promise.all(names.map((name) => read(name, connectionSchema)))).filter((connection) => connection?.owner === owner);
|
|
156
156
|
},
|
|
157
157
|
remove: async (connection) => {
|
|
@@ -348,7 +348,7 @@ function oauthProvider(connection, onAuthorize) {
|
|
|
348
348
|
};
|
|
349
349
|
const metadata = {
|
|
350
350
|
client_name: "ViteHub Console",
|
|
351
|
-
client_uri: "https://vitehub.dev/docs/
|
|
351
|
+
client_uri: "https://vitehub.dev/docs/console/mcp-client",
|
|
352
352
|
grant_types: ["authorization_code", "refresh_token"],
|
|
353
353
|
redirect_uris: [oauth.redirectUrl],
|
|
354
354
|
response_types: ["code"],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as isRecordOrFunction } from "./object-D8pRdprI.js";
|
|
2
|
-
import { r as consoleAccessAllows } from "./access-
|
|
3
|
-
import { i as consoleRequestError } from "./request-
|
|
4
|
-
import { t as getConsoleBlob } from "./blob-
|
|
2
|
+
import { r as consoleAccessAllows } from "./access-BDST818p.js";
|
|
3
|
+
import { i as consoleRequestError } from "./request-DbFfYmCu.js";
|
|
4
|
+
import { t as getConsoleBlob } from "./blob-CpvlM8jp.js";
|
|
5
5
|
import { a as maximumConsoleMediaRequestBytes, o as maximumConsoleMediaUploadBytes } from "./limits-BUlwWYQE.js";
|
|
6
6
|
import { r as getConsoleSections } from "./sections-C83x0slv.js";
|
|
7
|
-
import { c as runConsoleDocumentAction, n as consoleDocumentActionContext, o as loadConsoleDocumentActions, t as consoleActionError } from "./documents-
|
|
7
|
+
import { c as runConsoleDocumentAction, n as consoleDocumentActionContext, o as loadConsoleDocumentActions, t as consoleActionError } from "./documents-CjJTCrY8.js";
|
|
8
8
|
//#region src/console/runtime/server/media.ts
|
|
9
9
|
/** Largest JSON request of a media action, and largest file of one upload. */
|
|
10
10
|
/**
|
|
@@ -44,7 +44,7 @@ interface ConsoleMediaAccess {
|
|
|
44
44
|
}
|
|
45
45
|
interface ConsoleMediaInfo {
|
|
46
46
|
access: ConsoleMediaAccess;
|
|
47
|
-
/** The URL a pathname is appended to, such as `/
|
|
47
|
+
/** The URL a pathname is appended to, such as `/_vitehub/blob/`, or null when the store is not served. */
|
|
48
48
|
served: string | null;
|
|
49
49
|
store: string;
|
|
50
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as callOperationRpc, r as operationRpcPath } from "./operation-rpc-DI9txNxK.js";
|
|
2
2
|
import { t as consoleRpcHeader } from "./rpc-DIUA61pv.js";
|
|
3
|
-
import { a as projectRequest, s as resolveProjectUrl } from "./project-
|
|
4
|
-
import { t as ConsoleRequestError, u as requestConsole } from "./request-
|
|
3
|
+
import { a as projectRequest, s as resolveProjectUrl } from "./project-DlWTGB7h.js";
|
|
4
|
+
import { t as ConsoleRequestError, u as requestConsole } from "./request-DE8w_cSM.js";
|
|
5
5
|
//#region src/console/runtime/client/media-library.ts
|
|
6
6
|
/** Every media type, for the type filter. */
|
|
7
7
|
const consoleMediaTypes = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
-
import { c as parseLogQuery, n as logCursorExpiredError, r as logEntrySchema } from "./source-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
|
|
2
|
+
import { c as parseLogQuery, n as logCursorExpiredError, r as logEntrySchema } from "./source-D4wWtoHh.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/logs/memory.ts
|
|
5
5
|
function createLogBuffer(options = {}) {
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
const viteHubServerImports = {
|
|
15
15
|
agent: { "vite-hub/agent": ["runAgent", "streamAgent"] },
|
|
16
16
|
auth: { "vite-hub/auth/server": [
|
|
17
|
-
"auth",
|
|
18
17
|
"can",
|
|
19
|
-
"getAuth",
|
|
20
18
|
"requireAbility",
|
|
21
19
|
"requireAuth",
|
|
22
20
|
"requireAuthorization",
|
|
21
|
+
"requireCaller",
|
|
23
22
|
"useAuth",
|
|
24
23
|
"withAnonymousAuthorization",
|
|
25
24
|
"withAuth",
|
|
@@ -56,6 +55,7 @@ const viteHubServerImports = {
|
|
|
56
55
|
rateLimit: { "vite-hub/rate-limit": [
|
|
57
56
|
"checkRateLimit",
|
|
58
57
|
"peekRateLimit",
|
|
58
|
+
"refundRateLimit",
|
|
59
59
|
"requireRateLimit",
|
|
60
60
|
"resetRateLimit"
|
|
61
61
|
] },
|
|
@@ -71,6 +71,7 @@ const viteHubServerImports = {
|
|
|
71
71
|
"startSchedule"
|
|
72
72
|
] },
|
|
73
73
|
seo: { "vite-hub/seo": ["defineSitemap"] },
|
|
74
|
+
source: { "vite-hub/source": ["useSource"] },
|
|
74
75
|
workflow: { "vite-hub/workflow": [
|
|
75
76
|
"cancelWorkflow",
|
|
76
77
|
"deferWorkflow",
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as DatabaseNuxtIntegrationOptions,
|
|
1
|
+
import { I as DatabaseNuxtIntegrationOptions, s as ViteHubOptions } from "./plugins-BqAtIEX2.js";
|
|
2
2
|
//#region src/nuxt.d.ts
|
|
3
3
|
type ViteHubNuxtOptions = Omit<ViteHubOptions, "database"> & {
|
|
4
4
|
database?: boolean | Exclude<DatabaseNuxtIntegrationOptions, false>;
|
package/dist/nuxt.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import { t as invariant } from "./invariant-DolT9EEx.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as importOptionalOwner, l as requireOptionalOwner, o as isPackageInstalled, u as startPackageChecks } from "./optional-owners-BNA2OX6z.js";
|
|
3
3
|
import { n as isRecord } from "./object-D8pRdprI.js";
|
|
4
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-
|
|
5
|
-
import {
|
|
6
|
-
import { D as resolveConsoleSectionIds, v as insertConsoleSection } from "./sections-
|
|
7
|
-
import { $ as
|
|
4
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
|
|
5
|
+
import { a as writeViteHubDevServerFile, i as removeViteHubDevServerFile } from "./vite-stage-mmtwQIMA.js";
|
|
6
|
+
import { D as resolveConsoleSectionIds, v as insertConsoleSection } from "./sections-DumoLKQN.js";
|
|
7
|
+
import { $ as nitroCacheBypass, A as cloudflareWorkersDevShimSource, B as hasRedisStore, C as consoleDocumentEditorSectionIds, Ct as resolveViteHubProjectRoot, D as staleChunkReloadPluginName, E as installStaleChunkReloadNuxt, F as writeAgentInvocationsNitroPlugin, G as writeFileIfChanged, H as redisDriverSpecifier, I as generatedModules, K as markCmsPresetFeaturesResolved, L as disabledKVConfigModule, M as assertAgentInvocationsRetention, N as assertAgentInvocationsUrl, O as forgeBuildCheckPlugin, P as defaultJournalNeedsLibsql, Q as resolveDeploymentPlan, R as disabledRedisDriver, S as consoleContributedSections, St as resolveNuxtServerDirs, T as isConsoleContributedSectionId, U as upstashDriverSpecifier, V as hasUpstashStore, W as resolveDefinitionFeatures, X as normalizeNitroPreset, Y as hostFromNitroPreset, Z as resolveBuildHost, _ as addConsoleRpcHandler, _t as VITEHUB_NITRO_CONFIG_CONTEXT, a as cloudflareExportConditions, at as defaultDatabaseD1Binding, b as resolveConsoleProjectName, bt as VITEHUB_SERVER_DIRS, c as consoleInvocationRootPlugin, ct as withDataDir, d as resolveConsoleAccessBuild, dt as ownerModules, et as describeDeploymentPlanOutput, f as resolveConsoleOptions, ft as isIncludedNitroPlugin, g as addConsoleAppRoutes, gt as VITEHUB_GENERATED_ROOT, h as consoleOperationFeatures, ht as VITEHUB_APP_BASE_URL, i as installBrowserErrorsNuxt, it as agentJournalStateUrl, j as VITEHUB_AGENT_JOURNAL_D1, k as cloudflareEmailDevShimSource, l as consoleOperationContributions, lt as isDefaultAgentJournal, m as consoleDevAccessNotice, n as resolveSandboxTaskDriver, nt as reportViteHubHint, o as assertConsoleAccess, ot as withComments, p as resolveGeneratedConsolePlugin, q as resolveCmsPresetFeatures, r as viteHubPlugins, rt as startViteHubHints, s as assertConsoleProductionAuth, st as withConnectionsDatabase, t as applyCloudflareNodeCompatOptOut, tt as VITEHUB_NUXT_HINTS, u as generatedConsolePluginRegistration, ut as hasSyncDirectory, v as serializeConsoleRefresh, vt as VITEHUB_PREPARE, w as discoverConsoleEntrySections, x as discoverConsoleBuildCatalog, xt as getResolvedFeatureOptions, y as writeConsoleNitroPlugin, yt as VITEHUB_PROJECT_ROOT, z as disabledUpstashDriver } from "./plugins-B-DpgDPB.js";
|
|
8
8
|
import { n as addViteHubDevPeerUpgradeSigner, t as addViteHubDevPeerDevHandler } from "./dev-peer-am78OsHH.js";
|
|
9
9
|
import { n as installConsoleProjectName, r as installConsoleSections } from "./setup-C-5nB7aY.js";
|
|
10
|
-
import { t as resolveViteHubServerImports } from "./nuxt-server-imports-
|
|
11
|
-
import { n as assertNoRemovedViteHubOptions } from "./version-
|
|
10
|
+
import { t as resolveViteHubServerImports } from "./nuxt-server-imports-DH60Z7LA.js";
|
|
11
|
+
import { n as assertNoRemovedViteHubOptions } from "./version-DNmSsk5r.js";
|
|
12
12
|
import { findPackageJSON } from "node:module";
|
|
13
|
-
import { dirname,
|
|
13
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
14
14
|
import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
15
15
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
|
-
import { mkdir,
|
|
16
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
17
17
|
import * as v from "valibot";
|
|
18
18
|
import { mergeGeneratedSourceNitroConfig } from "@vite-hub/source/vite";
|
|
19
19
|
import { mergeConfig } from "vite";
|
|
20
20
|
import { createEnvImportAliases } from "@vite-hub/env/vite";
|
|
21
21
|
import { nuxtPageRoutes } from "@vite-hub/bundle/vite";
|
|
22
|
-
import { parseJSONC } from "confbox/jsonc";
|
|
23
|
-
import { parseTOML } from "confbox/toml";
|
|
24
22
|
import { findNearestFile } from "pkg-types";
|
|
25
23
|
//#region src/internal/nitro-optional-peers.ts
|
|
26
24
|
const manifestSchema = v.object({
|
|
@@ -81,7 +79,7 @@ function nuxtImageProviderDependency(options) {
|
|
|
81
79
|
const blob = options.vitehub?.blob;
|
|
82
80
|
if (!blob || blob === true || !blob.serve || !usesNuxtImage(options.modules)) return void 0;
|
|
83
81
|
const serve = blob.serve;
|
|
84
|
-
const route = `/${(serve.route?.trim() || "/
|
|
82
|
+
const route = `/${(serve.route?.trim() || "/_vitehub/blob").replace(/^\/+|\/+$/g, "")}`;
|
|
85
83
|
const baseURL = `${(serve.publicBaseUrl?.trim() || options.app?.baseURL || "").replace(/\/+$/, "")}${route}`;
|
|
86
84
|
const sizes = blob.images ? blob.images.sizes : void 0;
|
|
87
85
|
return { "@nuxt/image": {
|
|
@@ -109,19 +107,6 @@ function configuredProjectRoot(root, value) {
|
|
|
109
107
|
function configuredProjectRootOption(value) {
|
|
110
108
|
return value && typeof value === "object" && "projectRoot" in value && typeof value.projectRoot === "string" ? value.projectRoot : void 0;
|
|
111
109
|
}
|
|
112
|
-
/** The project's wrangler config, found and parsed the way Nitro's Cloudflare preset does. */
|
|
113
|
-
async function readProjectWranglerConfig(rootDir) {
|
|
114
|
-
const configPath = await findNearestFile([
|
|
115
|
-
"wrangler.json",
|
|
116
|
-
"wrangler.jsonc",
|
|
117
|
-
"wrangler.toml"
|
|
118
|
-
], { startingFrom: rootDir }).catch(() => void 0);
|
|
119
|
-
if (!configPath) return void 0;
|
|
120
|
-
const text = await readFile(configPath, "utf8");
|
|
121
|
-
const extension = extname(configPath);
|
|
122
|
-
const config = extension === ".toml" ? parseTOML(text) : extension === ".jsonc" ? parseJSONC(text) : JSON.parse(text);
|
|
123
|
-
return isRecord(config) ? config : void 0;
|
|
124
|
-
}
|
|
125
110
|
async function writeCloudflareAssetsMiddleware(projectRoot) {
|
|
126
111
|
const file = join(projectRoot, ".vitehub/nitro/cloudflare-assets.mjs");
|
|
127
112
|
await writeFileIfChanged(file, [
|
|
@@ -264,8 +249,11 @@ function normalizeGeneratedNitroPlugins(config, root) {
|
|
|
264
249
|
if (!Array.isArray(config.plugins)) return;
|
|
265
250
|
config.plugins = config.plugins.map((plugin) => typeof plugin === "string" && /^\.vitehub[\\/]/.test(plugin) && !isAbsolute(plugin) ? resolve(root, plugin) : plugin);
|
|
266
251
|
}
|
|
267
|
-
/**
|
|
268
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Put these plugins before Nitro's own resolvers, so they see generated and cache imports first. Each one goes first, so
|
|
254
|
+
* in a build `forgeBuildCheckPlugin()` can wrap Source imports before Nitro resolves them.
|
|
255
|
+
*/
|
|
256
|
+
function installNitroBuildPlugins(config, generatedRoots, dev = false, sections = [], build = false) {
|
|
269
257
|
const rollupConfig = config.rollupConfig ??= {};
|
|
270
258
|
const plugins = rollupConfig.plugins ??= [];
|
|
271
259
|
for (const plugin of [
|
|
@@ -273,7 +261,8 @@ function installNitroBuildPlugins(config, generatedRoots, dev = false, sections
|
|
|
273
261
|
nitroViteHubH3(generatedRoots),
|
|
274
262
|
nitroOptionalPeers(config),
|
|
275
263
|
consoleOperationFeatures(sections),
|
|
276
|
-
...dev ? [nitroCloudflareWorkersDev] : []
|
|
264
|
+
...dev ? [nitroCloudflareWorkersDev] : [],
|
|
265
|
+
...build ? [forgeBuildCheckPlugin()] : []
|
|
277
266
|
]) if (!plugins.some((candidate) => candidate.name === plugin.name)) plugins.unshift(plugin);
|
|
278
267
|
}
|
|
279
268
|
function pluginOptionHasName(option, name) {
|
|
@@ -298,6 +287,7 @@ const nitroConfigResolvedNames = /* @__PURE__ */ new Set([
|
|
|
298
287
|
...nitroRuntimeResolverNames,
|
|
299
288
|
"@vite-hub/content/vite",
|
|
300
289
|
"@vite-hub/sandbox/task/vite",
|
|
290
|
+
"@vite-hub/schedule/vite",
|
|
301
291
|
"@vite-hub/workflow/vite"
|
|
302
292
|
]);
|
|
303
293
|
function pluginResolveIdHandler(plugin) {
|
|
@@ -429,24 +419,46 @@ export default defineNuxtPlugin({
|
|
|
429
419
|
});
|
|
430
420
|
}
|
|
431
421
|
/**
|
|
432
|
-
*
|
|
433
|
-
*
|
|
422
|
+
* Restarts the dev server when a file of `server/sync/` comes or goes. Sync reads the folder when the server starts, for
|
|
423
|
+
* the routes and the types of `useSync()`, so a new definition answers `SYNC_UNKNOWN_NAME` until a restart.
|
|
424
|
+
*/
|
|
425
|
+
function restartOnSyncDefinitions(nuxt, projectRoot) {
|
|
426
|
+
const folders = (resolveNuxtServerDirs(nuxt.options) ?? ["server"]).map((directory) => resolve(projectRoot, directory, "sync"));
|
|
427
|
+
const hookBuilderWatch = nuxt.hook;
|
|
428
|
+
hookBuilderWatch?.("builder:watch", async (event, path) => {
|
|
429
|
+
if (event !== "add" && event !== "unlink" && event !== "addDir" && event !== "unlinkDir") return;
|
|
430
|
+
const file = resolve(projectRoot, path);
|
|
431
|
+
if (event.endsWith("Dir") ? folders.includes(file) : folders.includes(dirname(file)) && /\.m?[jt]s$/.test(file) && !file.endsWith(".d.ts")) await nuxt.callHook?.("restart");
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Adds the client plugin that names the user of ViteHub Auth to Sync, and forgets the synced rows after a sign-out, so
|
|
436
|
+
* the next person on the device does not see them. The queued writes stay for the account that made them, and go out
|
|
437
|
+
* when it signs in again. `signOut()` waits for the plugin. The plugin goes to `.vitehub/sync/`, because Nuxt clears its
|
|
438
|
+
* build directory after modules run.
|
|
434
439
|
*/
|
|
435
440
|
async function addSyncSignOutPlugin(nuxt, projectRoot) {
|
|
436
441
|
const src = join(projectRoot, ".vitehub/sync/nuxt-sign-out.mjs");
|
|
437
|
-
await writeFileIfChanged(src,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
442
|
+
await writeFileIfChanged(src, `import { defineNuxtPlugin, watch } from "#imports"
|
|
443
|
+
import { onSignOut, useUserSession } from "vite-hub/auth/vue"
|
|
444
|
+
import { clearSync, setSyncUser } from "vite-hub/sync/client"
|
|
445
|
+
|
|
446
|
+
export default defineNuxtPlugin({
|
|
447
|
+
name: "vite-hub:sync-sign-out",
|
|
448
|
+
dependsOn: ["vitehub:auth"],
|
|
449
|
+
setup() {
|
|
450
|
+
const session = useUserSession()
|
|
451
|
+
// A session read that failed names nobody, so an offline reload keeps the user.
|
|
452
|
+
watch(() => session.ready.value && !session.error.value ? session.user.value?.id ?? null : undefined, (id) => {
|
|
453
|
+
if (id !== undefined) setSyncUser(id)
|
|
454
|
+
}, { immediate: true, flush: "sync" })
|
|
455
|
+
onSignOut(async () => {
|
|
456
|
+
await clearSync({ keepWrites: true })
|
|
457
|
+
setSyncUser(null)
|
|
458
|
+
})
|
|
459
|
+
},
|
|
460
|
+
})
|
|
461
|
+
`);
|
|
450
462
|
const plugins = nuxt.options.plugins ??= [];
|
|
451
463
|
if (!plugins.some((plugin) => (typeof plugin === "string" ? plugin : plugin.src) === src)) plugins.push({
|
|
452
464
|
src,
|
|
@@ -500,7 +512,7 @@ async function installConsole({ nuxt, projectRoot, name, sections, discovery, wr
|
|
|
500
512
|
Reflect.apply(nuxt.hook, nuxt, ["listen", (server) => {
|
|
501
513
|
addViteHubDevPeerUpgradeSigner(server);
|
|
502
514
|
const notice = consoleDevAccessNotice(access?.mode, server.address?.());
|
|
503
|
-
if (notice) console
|
|
515
|
+
if (notice) console.warn(notice);
|
|
504
516
|
}]);
|
|
505
517
|
}
|
|
506
518
|
const documentEditorSections = (await Promise.all(consoleDocumentEditorSectionIds.map(async (section) => {
|
|
@@ -620,7 +632,7 @@ function addNoExternals(config, entries) {
|
|
|
620
632
|
const current = Array.isArray(config.noExternals) ? config.noExternals : [];
|
|
621
633
|
config.noExternals = [.../* @__PURE__ */ new Set([...current, ...entries])];
|
|
622
634
|
}
|
|
623
|
-
async function applyNitroConfig(plugins, nitroConfig, nuxt, projectRoot) {
|
|
635
|
+
async function applyNitroConfig(plugins, nitroConfig, nuxt, projectRoot, deferHint) {
|
|
624
636
|
const incomingNoExternals = typeof nitroConfig.noExternals === "boolean" ? nitroConfig.noExternals : void 0;
|
|
625
637
|
const environment = {
|
|
626
638
|
command: nuxt.options.dev ? "serve" : "build",
|
|
@@ -642,6 +654,7 @@ async function applyNitroConfig(plugins, nitroConfig, nuxt, projectRoot) {
|
|
|
642
654
|
const restoreReplayOwnership = () => {
|
|
643
655
|
config[VITEHUB_GENERATED_ROOT] = generatedRoot;
|
|
644
656
|
config[VITEHUB_NITRO_CONFIG_CONTEXT] = true;
|
|
657
|
+
config[VITEHUB_NUXT_HINTS] = deferHint;
|
|
645
658
|
config[VITEHUB_PROJECT_ROOT] = projectRoot;
|
|
646
659
|
config[VITEHUB_APP_BASE_URL] = nuxt.options.app?.baseURL || "/";
|
|
647
660
|
if (serverDirs) config[VITEHUB_SERVER_DIRS] = serverDirs;
|
|
@@ -703,7 +716,7 @@ async function applyNitroConfig(plugins, nitroConfig, nuxt, projectRoot) {
|
|
|
703
716
|
}
|
|
704
717
|
}
|
|
705
718
|
await finalizeNitroReplayPlugins(plugins, config);
|
|
706
|
-
if (!nuxt.options.dev && !nuxt.options._prepare) (plugins.find((plugin) => plugin.name === "@vite-hub/rate-limit/vite")?.api)?.validateNitroBuild?.(asReplayResolvedConfig(Object.assign({}, config, { command: environment.command })));
|
|
719
|
+
if (!nuxt.options.dev && !nuxt.options._prepare) await (plugins.find((plugin) => plugin.name === "@vite-hub/rate-limit/vite")?.api)?.validateNitroBuild?.(asReplayResolvedConfig(Object.assign({}, config, { command: environment.command })));
|
|
707
720
|
if (config.nitro) {
|
|
708
721
|
installVitePluginNitroModules(config.nitro, plugins);
|
|
709
722
|
Object.assign(nitroConfig, config.nitro);
|
|
@@ -793,13 +806,16 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
793
806
|
};
|
|
794
807
|
const rootDir = nuxt.options.rootDir || process.cwd();
|
|
795
808
|
const projectRoot = resolveViteHubProjectRoot(rootDir);
|
|
796
|
-
const
|
|
809
|
+
const viteRoot = resolve(rootDir, typeof nuxt.options.vite?.root === "string" ? nuxt.options.vite.root : rootDir);
|
|
810
|
+
const discoveryProject = {
|
|
811
|
+
projectRoot,
|
|
812
|
+
serverDirs: resolveNuxtServerDirs(nuxt.options),
|
|
813
|
+
viteRoot
|
|
814
|
+
};
|
|
815
|
+
const options = markCmsPresetFeaturesResolved(withConnectionsDatabase(withDataDir(resolveCmsPresetFeatures(withComments(resolveDefinitionFeatures({
|
|
797
816
|
...moduleOptions,
|
|
798
817
|
console: moduleOptions.console === false ? false : resolveConsoleOptions(moduleOptions.console)
|
|
799
|
-
}),
|
|
800
|
-
projectRoot,
|
|
801
|
-
serverDirs: resolveNuxtServerDirs(nuxt.options)
|
|
802
|
-
}))));
|
|
818
|
+
}, discoveryProject)), discoveryProject))));
|
|
803
819
|
const consoleOptions = resolveConsoleOptions(options.console);
|
|
804
820
|
const plan = resolveDeploymentPlan(moduleOptions.host);
|
|
805
821
|
const journalDatabaseRoot = options.database && options.database !== true && options.database.projectRoot !== void 0 ? rootDir : projectRoot;
|
|
@@ -872,7 +888,6 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
872
888
|
}
|
|
873
889
|
nuxt.options.vite ??= {};
|
|
874
890
|
nuxt.options.vite.root ??= rootDir;
|
|
875
|
-
const viteRoot = resolve(rootDir, typeof nuxt.options.vite?.root === "string" ? nuxt.options.vite.root : rootDir);
|
|
876
891
|
const configuredDatabaseDiscoveryRoot = configuredProjectRoot(rootDir, options.database);
|
|
877
892
|
const effectiveBlob = consoleOptions ? options.blob : false;
|
|
878
893
|
const explicitBlob = explicitBlobOption(effectiveBlob);
|
|
@@ -886,7 +901,6 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
886
901
|
env: options.env !== false,
|
|
887
902
|
blob: consoleBlobEnabled,
|
|
888
903
|
kv: effectiveKV,
|
|
889
|
-
host: plan.host,
|
|
890
904
|
queue: effectiveQueue,
|
|
891
905
|
sandboxTask: resolveSandboxTaskDriver(options.sandboxTask, plan) !== void 0
|
|
892
906
|
});
|
|
@@ -915,7 +929,8 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
915
929
|
queue: effectiveQueue && plan.services.queue.supported,
|
|
916
930
|
sandboxTask: resolveSandboxTaskDriver(options.sandboxTask, plan) !== void 0,
|
|
917
931
|
seo: Boolean(options.seo?.sitemap),
|
|
918
|
-
|
|
932
|
+
source: true,
|
|
933
|
+
workflow: Boolean(options.workflow)
|
|
919
934
|
});
|
|
920
935
|
let consoleHasPrimaryAuth = false;
|
|
921
936
|
let consoleAccess;
|
|
@@ -923,7 +938,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
923
938
|
const configuredConsole = resolveConsoleOptions(consoleOptions);
|
|
924
939
|
invariant(configuredConsole, "resolveConsoleOptions() returns options for a console option that is set");
|
|
925
940
|
if (!nuxt.options.vitehubCliDiscovery) {
|
|
926
|
-
const appAuth = effectiveAuth ? requireOptionalOwner(ownerModules.authVite, "auth").resolveAuthViteConfig(
|
|
941
|
+
const appAuth = effectiveAuth ? requireOptionalOwner(ownerModules.authVite, "auth").resolveAuthViteConfig(void 0, viteRoot, { serverDirs: resolveNuxtServerDirs(nuxt.options) }) : void 0;
|
|
927
942
|
consoleHasPrimaryAuth = Boolean(appAuth);
|
|
928
943
|
const authIndex = consoleSections.indexOf("auth");
|
|
929
944
|
if (!appAuth && authIndex !== -1) consoleSections.splice(authIndex, 1);
|
|
@@ -1075,12 +1090,27 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1075
1090
|
};
|
|
1076
1091
|
viteConfig[VITEHUB_GENERATED_ROOT] = join(nuxt.options.buildDir, "vitehub");
|
|
1077
1092
|
viteConfig[VITEHUB_NITRO_CONFIG_CONTEXT] = true;
|
|
1093
|
+
viteConfig[VITEHUB_NUXT_HINTS] = true;
|
|
1094
|
+
const hints = {
|
|
1095
|
+
root: projectRoot,
|
|
1096
|
+
[VITEHUB_PROJECT_ROOT]: projectRoot,
|
|
1097
|
+
command: nuxt.options.dev ? "serve" : "build"
|
|
1098
|
+
};
|
|
1099
|
+
let replayHints = [];
|
|
1100
|
+
const startHints = () => {
|
|
1101
|
+
if (!nuxt.options._prepare && !nuxt.options.vitehubCliDiscovery) startViteHubHints(hints, nuxt);
|
|
1102
|
+
};
|
|
1103
|
+
nuxt.hook?.("build:before", startHints);
|
|
1104
|
+
nuxt.hook?.("nitro:build:before", () => {
|
|
1105
|
+
if (nuxt.options._prepare || nuxt.options.vitehubCliDiscovery) return;
|
|
1106
|
+
startHints();
|
|
1107
|
+
for (const hint of replayHints) reportViteHubHint(hints, hint);
|
|
1108
|
+
});
|
|
1078
1109
|
viteConfig[VITEHUB_PROJECT_ROOT] = projectRoot;
|
|
1079
1110
|
viteConfig[VITEHUB_APP_BASE_URL] = nuxt.options.app?.baseURL || "/";
|
|
1080
1111
|
const viteServerDirs = resolveNuxtServerDirs(nuxt.options);
|
|
1081
1112
|
if (viteServerDirs) viteConfig[VITEHUB_SERVER_DIRS] = viteServerDirs;
|
|
1082
|
-
|
|
1083
|
-
nuxt.options.vite.plugins = installedVitePlugins;
|
|
1113
|
+
nuxt.options.vite.plugins = [...plugins.map((plugin) => existingPluginsByName.get(plugin.name) || plugin), ...filterPluginOptions(existing, (plugin) => !plugins.some((candidate) => candidate.name === plugin.name))];
|
|
1084
1114
|
const configuredEnvProjectRootOption = options.env && typeof options.env === "object" ? options.env.projectRoot : void 0;
|
|
1085
1115
|
const configuredEnvProjectRoot = configuredEnvProjectRootOption ? resolve(viteRoot, configuredEnvProjectRootOption) : void 0;
|
|
1086
1116
|
const envProjectRoot = envPlugin?.api?.resolveProjectRoot?.(viteRoot) ?? configuredEnvProjectRoot ?? projectRoot;
|
|
@@ -1106,7 +1136,9 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1106
1136
|
const previousExternalList = nitro3ExternalLists.get(config);
|
|
1107
1137
|
if (previousExternalList && config.noExternals === previousExternalList) config.noExternals = false;
|
|
1108
1138
|
const incomingNoExternals = config.noExternals;
|
|
1109
|
-
const
|
|
1139
|
+
const nextHints = [];
|
|
1140
|
+
const { config: replayConfig, hasReplayedDatabaseDiscoveryRoot, replayedDatabaseDiscoveryRoot } = await applyNitroConfig(replayPlugins, config, nuxt, projectRoot, (hint) => nextHints.push(hint));
|
|
1141
|
+
replayHints = nextHints;
|
|
1110
1142
|
if (options.env !== false) await envPlugin?.api?.prepareTypes?.(envPlugin.api.resolveDeclarations?.(replayConfig), viteRoot);
|
|
1111
1143
|
await typesPlugin?.api?.prepareTypes?.({ projectRoot });
|
|
1112
1144
|
consoleWorkflowConfigResolved = true;
|
|
@@ -1129,7 +1161,6 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1129
1161
|
database: getResolvedFeatureOptions(replayConfig, "database") ?? options.database,
|
|
1130
1162
|
email: options.email,
|
|
1131
1163
|
kv: resolvedKV,
|
|
1132
|
-
host: plan.host,
|
|
1133
1164
|
queue: effectiveQueue === false ? false : effectiveQueue === void 0 ? void 0 : getResolvedFeatureOptions(replayConfig, "queue") ?? effectiveQueue,
|
|
1134
1165
|
sandboxTask: Boolean(getResolvedFeatureOptions(replayConfig, "sandboxTask") ?? options.sandboxTask) && resolveSandboxTaskDriver(options.sandboxTask, plan) !== void 0,
|
|
1135
1166
|
workspace: options.workspace,
|
|
@@ -1181,7 +1212,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1181
1212
|
serverDirs: resolveNuxtServerDirs(nuxt.options)
|
|
1182
1213
|
});
|
|
1183
1214
|
normalizeGeneratedNitroPlugins(config, projectRoot);
|
|
1184
|
-
installNitroBuildPlugins(config, [join(projectRoot, ".vitehub"), join(nuxt.options.buildDir, "vitehub")], nuxt.options.dev === true && plan.host === "cloudflare", consoleSections);
|
|
1215
|
+
installNitroBuildPlugins(config, [join(projectRoot, ".vitehub"), join(nuxt.options.buildDir, "vitehub")], nuxt.options.dev === true && plan.host === "cloudflare", consoleSections, !nuxt.options.dev);
|
|
1185
1216
|
if (nuxt.options.dev && plan.host === "cloudflare") await writeCloudflareDevShims(nuxt.options.buildDir, config.alias ??= {});
|
|
1186
1217
|
if (plan.host === "cloudflare") {
|
|
1187
1218
|
if (!nuxt.options.dev) {
|
|
@@ -1194,12 +1225,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1194
1225
|
}];
|
|
1195
1226
|
}
|
|
1196
1227
|
const cloudflare = config.cloudflare ??= {};
|
|
1197
|
-
|
|
1198
|
-
const wrangler = isRecord(cloudflare.wrangler) ? cloudflare.wrangler : {};
|
|
1199
|
-
const flags = Array.isArray(wrangler.compatibility_flags) ? wrangler.compatibility_flags : [];
|
|
1200
|
-
const project = await readProjectWranglerConfig(typeof config.rootDir === "string" ? config.rootDir : rootDir);
|
|
1201
|
-
if ([...flags, ...Array.isArray(project?.compatibility_flags) ? project.compatibility_flags : []].includes("no_nodejs_compat")) cloudflare.nodeCompat = false;
|
|
1202
|
-
}
|
|
1228
|
+
applyCloudflareNodeCompatOptOut(cloudflare, typeof config.rootDir === "string" ? config.rootDir : rootDir);
|
|
1203
1229
|
}
|
|
1204
1230
|
if (emailPlugin && nuxt.options.dev) installEmailTemplateResolver(config, join(projectRoot, ".vitehub/email/templates"));
|
|
1205
1231
|
const alias = config.alias ??= {};
|
|
@@ -1228,7 +1254,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1228
1254
|
addVueImports(nuxt, "vite-hub/source/client", ["useCollection"]);
|
|
1229
1255
|
if (options.observability && options.observability !== true && options.observability.browserErrors) await installBrowserErrorsNuxt(nuxt, projectRoot);
|
|
1230
1256
|
await installStaleChunkReloadNuxt(nuxt, projectRoot);
|
|
1231
|
-
if (isPackageInstalled("@vite-hub/
|
|
1257
|
+
if (isPackageInstalled("@vite-hub/choices")) addVueImports(nuxt, "vite-hub/choices/vue", ["useChoices"]);
|
|
1232
1258
|
if (isPackageInstalled("@vite-hub/forms")) {
|
|
1233
1259
|
addVueImports(nuxt, "vite-hub/forms/vue", ["useFormAction"]);
|
|
1234
1260
|
if (isPackageInstalled("@formisch/vue")) addVueImports(nuxt, "vite-hub/forms/formisch", ["useFormSubmit"]);
|
|
@@ -1250,6 +1276,7 @@ const viteHubNuxtModule = async function viteHubNuxtModule(inlineOptions, nuxtIn
|
|
|
1250
1276
|
addVueImports(nuxt, "vite-hub/sync/client", ["clearSync"]);
|
|
1251
1277
|
if (effectiveAuth) await addSyncSignOutPlugin(nuxt, projectRoot);
|
|
1252
1278
|
}
|
|
1279
|
+
if (nuxt.options.dev && isPackageInstalled("@vite-hub/sync")) restartOnSyncDefinitions(nuxt, projectRoot);
|
|
1253
1280
|
if (options.i18n) {
|
|
1254
1281
|
await requireOptionalOwner(ownerModules.i18nNuxt, "i18n").installI18nNuxt({ options: { plugins: nuxt.options.plugins ??= [] } }, {
|
|
1255
1282
|
importBase: "vite-hub/i18n",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as installOperationRegistry } from "./operation-registry-BogGwk_I.js";
|
|
2
|
-
import { a as createOperationRegistry, p as operationsOf } from "./operations-
|
|
3
|
-
import { n as consoleOperations } from "./operations-
|
|
2
|
+
import { a as createOperationRegistry, p as operationsOf } from "./operations-EOdyctDc.js";
|
|
3
|
+
import { n as consoleOperations } from "./operations-CWP9dF3i.js";
|
|
4
4
|
//#region src/console/runtime/server/operation-contributions.ts
|
|
5
5
|
const contributionKey = Symbol.for("vitehub.console.operations");
|
|
6
6
|
const scope = globalThis;
|
package/dist/{operation-contributions-fZyVo662.d.ts → operation-contributions-DpkO_iSU.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as OperationRegistry } from "./operations-
|
|
1
|
+
import { t as OperationRegistry } from "./operations-B0689BG1.js";
|
|
2
2
|
//#region src/console/runtime/server/operation-contributions.d.ts
|
|
3
3
|
interface ConsoleOperationContribution {
|
|
4
4
|
/** The export of the contributed module: one operation or a list of them. */
|
|
@@ -172,7 +172,7 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
172
172
|
},
|
|
173
173
|
INTERNAL_R0004: {
|
|
174
174
|
...dynamicError,
|
|
175
|
-
fix: "Set a larger `maxResponseBytes` on the HTTP request, such as the `
|
|
175
|
+
fix: "Set a larger `maxResponseBytes` on the HTTP request, such as the `url()` Source options, or ask the server for a smaller response."
|
|
176
176
|
},
|
|
177
177
|
INTERNAL_R0005: {
|
|
178
178
|
...dynamicError,
|
|
@@ -218,6 +218,10 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
218
218
|
why: ({ variable }) => `[vitehub] ${variable} must be the 43-character private key that \`vitehub secret console-key\` prints, and its name 1 to 64 of A-Z, 0-9, and _.`,
|
|
219
219
|
fix: "Set the variable that the message names to the private key that `vitehub secret console-key` prints, and name it `VITEHUB_CONSOLE_PRIVATE_KEY_<NAME>` with A-Z, 0-9, and _ in `<NAME>`."
|
|
220
220
|
},
|
|
221
|
+
INTERNAL_DEV_SERVER_NOT_FOUND: {
|
|
222
|
+
why: ({ command }) => `[vitehub] No dev server of this project is running, and --url is not set, so \`vitehub ${command}\` has no app to call.`,
|
|
223
|
+
fix: "Start the dev server of this project, such as with `pnpm dev`, or pass --url with the app URL, such as --url http://localhost:3000."
|
|
224
|
+
},
|
|
221
225
|
INTERNAL_FORGE_NOT_INSTALLED: {
|
|
222
226
|
why: ({ feature }) => `${feature} needs @vite-hub/forge, and the app did not install it.`,
|
|
223
227
|
fix: "Install Forge in your app with `pnpm add @vite-hub/forge`, then build again."
|
|
@@ -385,6 +389,7 @@ const reservedOperationNamespaces = [
|
|
|
385
389
|
"drain",
|
|
386
390
|
"login",
|
|
387
391
|
"logout",
|
|
392
|
+
"update",
|
|
388
393
|
"whoami"
|
|
389
394
|
]
|
|
390
395
|
];
|
|
@@ -39,6 +39,11 @@ interface OperationContext {
|
|
|
39
39
|
surface: "console" | "cli" | "mcp" | "agent";
|
|
40
40
|
/** Set by the host from generated build identity, never from request input or runtime NODE_ENV. */
|
|
41
41
|
development?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The project root of a development server, for operations that read build files, such as `bundle.report`. Hosts set
|
|
44
|
+
* it only with `development`, so a deployed server never reads project files through it.
|
|
45
|
+
*/
|
|
46
|
+
projectRoot?: string;
|
|
42
47
|
env?: Record<string, unknown>;
|
|
43
48
|
waitUntil?: (task: Promise<unknown>) => void;
|
|
44
49
|
request?: Request;
|