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
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { parseSync } from "vite";
|
|
2
|
+
//#region ../internal/src/build/ast-walk.ts
|
|
3
|
+
/** The oxc parser grammar for a file, from its extension. Defaults to TypeScript. */
|
|
4
|
+
function moduleLanguage(file) {
|
|
5
|
+
if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
|
|
6
|
+
if (/\.(?:c|m)?jsx$/i.test(file)) return "jsx";
|
|
7
|
+
if (/\.(?:c|m)?js$/i.test(file)) return "js";
|
|
8
|
+
return "ts";
|
|
9
|
+
}
|
|
10
|
+
function isNode(value) {
|
|
11
|
+
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
12
|
+
}
|
|
13
|
+
/** Visits `node` and its descendants. Return `false` from `visit` to skip the children of a node. */
|
|
14
|
+
function walk(node, visit, parent) {
|
|
15
|
+
if (visit(node, parent) === false) return;
|
|
16
|
+
const fields = node;
|
|
17
|
+
for (const key in fields) {
|
|
18
|
+
const child = fields[key];
|
|
19
|
+
if (typeof child !== "object" || child === null || key === "parent") continue;
|
|
20
|
+
if (Array.isArray(child)) {
|
|
21
|
+
for (const item of child) if (isNode(item)) walk(item, visit, node);
|
|
22
|
+
} else if (isNode(child)) walk(child, visit, node);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ../internal/src/build/scan-module.ts
|
|
27
|
+
/**
|
|
28
|
+
* Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
|
|
29
|
+
* the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
|
|
30
|
+
* `dynamic`, so callers can report their own diagnostics.
|
|
31
|
+
*/
|
|
32
|
+
/** The value of an expression that the scanner cannot read without running the module. */
|
|
33
|
+
const dynamic = Symbol("dynamic");
|
|
34
|
+
/** Parses a module once. `file` selects the grammar from its extension and defaults to TypeScript. */
|
|
35
|
+
function scanModule(source, file = "module.ts") {
|
|
36
|
+
const result = parseSync(file, source, {
|
|
37
|
+
lang: moduleLanguage(file),
|
|
38
|
+
preserveParens: false,
|
|
39
|
+
sourceType: "module"
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
comments: result.comments,
|
|
43
|
+
errors: result.errors,
|
|
44
|
+
file,
|
|
45
|
+
program: result.program,
|
|
46
|
+
source
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Lists the names that a module exports. A default export reads as `default`. Type-only exports are left out. */
|
|
50
|
+
function exportNames(source, file = "module.ts") {
|
|
51
|
+
const { module } = parseSync(file, source, {
|
|
52
|
+
lang: moduleLanguage(file),
|
|
53
|
+
sourceType: "module"
|
|
54
|
+
});
|
|
55
|
+
return module.staticExports.flatMap((statement) => statement.entries).flatMap((entry) => {
|
|
56
|
+
if (entry.isType) return [];
|
|
57
|
+
if (entry.exportName.kind === "Default") return ["default"];
|
|
58
|
+
return entry.exportName.name === null ? [] : [entry.exportName.name];
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** The source text of a node. */
|
|
62
|
+
function nodeText(module, node) {
|
|
63
|
+
return module.source.slice(node.start, node.end);
|
|
64
|
+
}
|
|
65
|
+
/** Removes parentheses, `as`, `satisfies`, `!`, and `<T>` assertions around an expression. */
|
|
66
|
+
function unwrapExpression(node) {
|
|
67
|
+
while (node.type === "ParenthesizedExpression" || node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "TSNonNullExpression" || node.type === "TSTypeAssertion") node = node.expression;
|
|
68
|
+
return node;
|
|
69
|
+
}
|
|
70
|
+
/** A call argument without assertions, or undefined for a spread or missing argument. */
|
|
71
|
+
function argumentExpression(argument) {
|
|
72
|
+
return argument === void 0 || argument.type === "SpreadElement" ? void 0 : unwrapExpression(argument);
|
|
73
|
+
}
|
|
74
|
+
/** Calls whose callee is a plain identifier in `names`, such as `defineCollection(...)`, in source order. */
|
|
75
|
+
function findCalls(module, names) {
|
|
76
|
+
const wanted = new Set(names);
|
|
77
|
+
const calls = [];
|
|
78
|
+
walk(module.program, (node) => {
|
|
79
|
+
if (node.type === "CallExpression" && node.callee.type === "Identifier" && wanted.has(node.callee.name)) calls.push(node);
|
|
80
|
+
});
|
|
81
|
+
return calls.sort((left, right) => left.start - right.start);
|
|
82
|
+
}
|
|
83
|
+
/** The expression of `export default <expression>`, without assertions. Declarations return undefined. */
|
|
84
|
+
function defaultExportExpression(module) {
|
|
85
|
+
for (const statement of module.program.body) {
|
|
86
|
+
if (statement.type !== "ExportDefaultDeclaration") continue;
|
|
87
|
+
const declaration = statement.declaration;
|
|
88
|
+
if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration" || declaration.type === "TSInterfaceDeclaration") return;
|
|
89
|
+
return unwrapExpression(declaration);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Finds `export default defineX({ ... })` for one of `names`. With `positionalOptionsIndex`, a call whose first
|
|
94
|
+
* argument is not an object and that has more than one argument reads its options from that argument. Returns
|
|
95
|
+
* undefined when the options are not an object literal.
|
|
96
|
+
*/
|
|
97
|
+
function findDefaultExportCall(module, names, options = {}) {
|
|
98
|
+
const call = defaultExportExpression(module);
|
|
99
|
+
if (call?.type !== "CallExpression" || call.callee.type !== "Identifier" || !names.includes(call.callee.name)) return;
|
|
100
|
+
const name = call.callee.name;
|
|
101
|
+
const first = argumentExpression(call.arguments[0]);
|
|
102
|
+
if (first?.type === "ObjectExpression") return {
|
|
103
|
+
call,
|
|
104
|
+
name,
|
|
105
|
+
options: first
|
|
106
|
+
};
|
|
107
|
+
if (options.positionalOptionsIndex === void 0 || first === void 0 || call.arguments.length < 2) return;
|
|
108
|
+
const positional = call.arguments[options.positionalOptionsIndex];
|
|
109
|
+
if (positional === void 0) return {
|
|
110
|
+
call,
|
|
111
|
+
name
|
|
112
|
+
};
|
|
113
|
+
const object = argumentExpression(positional);
|
|
114
|
+
return object?.type === "ObjectExpression" ? {
|
|
115
|
+
call,
|
|
116
|
+
name,
|
|
117
|
+
options: object
|
|
118
|
+
} : void 0;
|
|
119
|
+
}
|
|
120
|
+
function staticKey(property) {
|
|
121
|
+
const key = property.key;
|
|
122
|
+
if (key.type === "Identifier" && !property.computed) return key.name;
|
|
123
|
+
if (key.type === "PrivateIdentifier") return;
|
|
124
|
+
const value = staticValue(key);
|
|
125
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : void 0;
|
|
126
|
+
}
|
|
127
|
+
/** The members of an object literal in source order. */
|
|
128
|
+
function objectProperties(object) {
|
|
129
|
+
return object.properties.map((node) => node.type === "SpreadElement" ? {
|
|
130
|
+
computed: false,
|
|
131
|
+
key: void 0,
|
|
132
|
+
node,
|
|
133
|
+
value: void 0
|
|
134
|
+
} : {
|
|
135
|
+
computed: node.computed,
|
|
136
|
+
key: staticKey(node),
|
|
137
|
+
node,
|
|
138
|
+
value: unwrapExpression(node.value)
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** The last member named `name`, which is the one that the object keeps at runtime. */
|
|
142
|
+
function findProperty(object, name) {
|
|
143
|
+
return objectProperties(object).findLast((property) => property.key === name);
|
|
144
|
+
}
|
|
145
|
+
/** The value of a template literal without substitutions. */
|
|
146
|
+
function staticTemplate(node) {
|
|
147
|
+
if (node.expressions.length) return dynamic;
|
|
148
|
+
return node.quasis[0]?.value.cooked ?? dynamic;
|
|
149
|
+
}
|
|
150
|
+
const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
|
|
151
|
+
/**
|
|
152
|
+
* True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
|
|
153
|
+
* and accepts legacy octal escapes, so the scanner checks them again.
|
|
154
|
+
*/
|
|
155
|
+
function hasInvalidEscape(raw) {
|
|
156
|
+
for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
|
|
157
|
+
const code = escape.slice(2, -1);
|
|
158
|
+
if (!escape.endsWith("}") || !/^[\da-fA-F]+$/.test(code) || Number.parseInt(code, 16) > 1114111) return true;
|
|
159
|
+
} else if (escape.startsWith("u")) {
|
|
160
|
+
if (!/^u[\da-fA-F]{4}$/.test(escape)) return true;
|
|
161
|
+
} else if (escape.startsWith("x")) {
|
|
162
|
+
if (!/^x[\da-fA-F]{2}$/.test(escape)) return true;
|
|
163
|
+
} else if (/^(?:[1-9]|0\d)$/.test(escape)) return true;
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Reads a literal value: strings, numbers, booleans, `null`, `undefined`, template literals without substitutions,
|
|
168
|
+
* and arrays and objects of these. Any other expression gives `dynamic`.
|
|
169
|
+
*/
|
|
170
|
+
function staticValue(node) {
|
|
171
|
+
node = unwrapExpression(node);
|
|
172
|
+
switch (node.type) {
|
|
173
|
+
case "Literal":
|
|
174
|
+
if ("regex" in node) return dynamic;
|
|
175
|
+
return typeof node.value === "string" && hasInvalidEscape(node.raw ?? "") ? dynamic : node.value;
|
|
176
|
+
case "TemplateLiteral": return staticTemplate(node);
|
|
177
|
+
case "Identifier": return node.name === "undefined" ? void 0 : dynamic;
|
|
178
|
+
case "UnaryExpression": {
|
|
179
|
+
if (node.operator === "void") return staticValue(node.argument) === dynamic ? dynamic : void 0;
|
|
180
|
+
const value = staticValue(node.argument);
|
|
181
|
+
if (node.operator === "-" && (typeof value === "number" || typeof value === "bigint")) return -value;
|
|
182
|
+
return dynamic;
|
|
183
|
+
}
|
|
184
|
+
case "ArrayExpression": {
|
|
185
|
+
const values = [];
|
|
186
|
+
for (const element of node.elements) {
|
|
187
|
+
if (element === null || element.type === "SpreadElement") return dynamic;
|
|
188
|
+
const value = staticValue(element);
|
|
189
|
+
if (value === dynamic) return dynamic;
|
|
190
|
+
values.push(value);
|
|
191
|
+
}
|
|
192
|
+
return values;
|
|
193
|
+
}
|
|
194
|
+
case "ObjectExpression": {
|
|
195
|
+
const values = {};
|
|
196
|
+
for (const property of objectProperties(node)) {
|
|
197
|
+
if (property.key === void 0 || property.node.type !== "Property" || property.node.kind !== "init" || property.node.method || property.value === void 0) return dynamic;
|
|
198
|
+
const value = staticValue(property.value);
|
|
199
|
+
if (value === dynamic) return dynamic;
|
|
200
|
+
Object.defineProperty(values, property.key, {
|
|
201
|
+
configurable: true,
|
|
202
|
+
enumerable: true,
|
|
203
|
+
value,
|
|
204
|
+
writable: true
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return values;
|
|
208
|
+
}
|
|
209
|
+
default: return dynamic;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/** The static string value of an expression, or undefined when it is not a string literal. */
|
|
213
|
+
function staticString(node) {
|
|
214
|
+
if (node === void 0) return;
|
|
215
|
+
const value = staticValue(node);
|
|
216
|
+
return typeof value === "string" ? value : void 0;
|
|
217
|
+
}
|
|
218
|
+
function isLineTerminator(char) {
|
|
219
|
+
return char === "\n" || char === "\r" || char === "\u2028" || char === "\u2029";
|
|
220
|
+
}
|
|
221
|
+
/** Comments, JSX text, and string, template, and regular expression literals, sorted by position. Templates are not split. */
|
|
222
|
+
function literalSpans(module) {
|
|
223
|
+
const spans = module.comments.map((comment) => ({
|
|
224
|
+
end: comment.end,
|
|
225
|
+
inert: true,
|
|
226
|
+
start: comment.start
|
|
227
|
+
}));
|
|
228
|
+
walk(module.program, (node) => {
|
|
229
|
+
if (node.type === "TemplateLiteral" || node.type === "JSXText") {
|
|
230
|
+
spans.push({
|
|
231
|
+
end: node.end,
|
|
232
|
+
inert: node.type === "JSXText",
|
|
233
|
+
start: node.start
|
|
234
|
+
});
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (node.type === "Literal" && (typeof node.value === "string" || "regex" in node)) spans.push({
|
|
238
|
+
end: node.end,
|
|
239
|
+
inert: false,
|
|
240
|
+
start: node.start
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
return spans.sort((left, right) => left.start - right.start);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The module source with comments, strings, templates, regular expressions, and JSX text replaced by spaces. Line
|
|
247
|
+
* terminators and all positions stay the same, so text matches map back to the source.
|
|
248
|
+
*/
|
|
249
|
+
function maskLiterals(module) {
|
|
250
|
+
const output = module.source.split("");
|
|
251
|
+
for (const span of literalSpans(module)) for (let index = span.start; index < span.end; index++) if (!isLineTerminator(output[index] ?? "")) output[index] = " ";
|
|
252
|
+
return output.join("");
|
|
253
|
+
}
|
|
254
|
+
const codeTokenPattern = /(?:0[xX][\da-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|(?:\d[\d_]*(?:\.[\d_]*)?|\.\d[\d_]*)(?:[eE][+-]?[\d_]+)?)n?|(?:[\p{ID_Start}$_]|\\u\{[\da-fA-F]+\}|\\u[\da-fA-F]{4})(?:[\p{ID_Continue}$]|\\u\{[\da-fA-F]+\}|\\u[\da-fA-F]{4})*|\S/gu;
|
|
255
|
+
function decodeIdentifier(token) {
|
|
256
|
+
return token.replace(/\\u(?:\{([\da-fA-F]+)\}|([\da-fA-F]{4}))/g, (_escape, point, unit) => String.fromCodePoint(Number.parseInt(point ?? unit ?? "0", 16)));
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Splits a module into tokens. The parser finds literals and comments, so a `/` is never confused between division
|
|
260
|
+
* and a regular expression. Identifier escapes are decoded.
|
|
261
|
+
*/
|
|
262
|
+
function moduleTokens(module) {
|
|
263
|
+
const { source } = module;
|
|
264
|
+
const tokens = [];
|
|
265
|
+
const starts = [];
|
|
266
|
+
const lineBreaks = /* @__PURE__ */ new Set();
|
|
267
|
+
let previousEnd = 0;
|
|
268
|
+
const push = (token, start) => {
|
|
269
|
+
for (let index = previousEnd; index < start; index++) if (isLineTerminator(source[index] ?? "")) {
|
|
270
|
+
lineBreaks.add(tokens.length);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
tokens.push(token);
|
|
274
|
+
starts.push(start);
|
|
275
|
+
previousEnd = start + token.length;
|
|
276
|
+
};
|
|
277
|
+
const scanCode = (start, end) => {
|
|
278
|
+
const pattern = new RegExp(codeTokenPattern.source, codeTokenPattern.flags);
|
|
279
|
+
const code = source.slice(start, end);
|
|
280
|
+
for (const match of code.matchAll(pattern)) {
|
|
281
|
+
const token = match[0];
|
|
282
|
+
push(/^[\p{ID_Start}$_\\]/u.test(token) ? decodeIdentifier(token) : token, start + match.index);
|
|
283
|
+
previousEnd = start + match.index + token.length;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
let cursor = 0;
|
|
287
|
+
for (const span of literalSpans(module)) {
|
|
288
|
+
if (span.start < cursor) continue;
|
|
289
|
+
scanCode(cursor, span.start);
|
|
290
|
+
if (!span.inert) push(source.slice(span.start, span.end), span.start);
|
|
291
|
+
cursor = span.end;
|
|
292
|
+
}
|
|
293
|
+
scanCode(cursor, source.length);
|
|
294
|
+
return {
|
|
295
|
+
lineBreaks,
|
|
296
|
+
starts,
|
|
297
|
+
tokens
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
/** The source of each `${...}` substitution in a template literal, such as the source of one template token. */
|
|
301
|
+
function templateExpressionSources(template) {
|
|
302
|
+
const module = scanModule(`(${template})`);
|
|
303
|
+
const statement = module.program.body[0];
|
|
304
|
+
if (statement?.type !== "ExpressionStatement") return [];
|
|
305
|
+
const expression = unwrapExpression(statement.expression);
|
|
306
|
+
const literal = expression.type === "TaggedTemplateExpression" ? expression.quasi : expression;
|
|
307
|
+
if (literal.type !== "TemplateLiteral") return [];
|
|
308
|
+
return literal.expressions.map((_node, index) => module.source.slice(literal.quasis[index]?.end ?? 0, literal.quasis[index + 1]?.start ?? 0));
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
export { moduleLanguage as _, findCalls as a, maskLiterals as c, objectProperties as d, scanModule as f, unwrapExpression as g, templateExpressionSources as h, exportNames as i, moduleTokens as l, staticValue as m, defaultExportExpression as n, findDefaultExportCall as o, staticString as p, dynamic as r, findProperty as s, argumentExpression as t, nodeText as u, walk as v };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ConsoleContributedSection } from "./definitions-
|
|
2
|
-
import { a as ConsoleSectionId, r as ConsoleSectionDetails } from "./sections-
|
|
1
|
+
import { t as ConsoleContributedSection } from "./definitions-DB4LbZ7T.js";
|
|
2
|
+
import { a as ConsoleSectionId, r as ConsoleSectionDetails } from "./sections-Do7X4Nwt.js";
|
|
3
3
|
import { a as RouteLocationRaw, o as RouteRecordRaw, r as RouteLocationNormalized, s as Router } from "./vue-router-C68IU1jM.js";
|
|
4
4
|
//#region src/console/runtime/client/sections.d.ts
|
|
5
5
|
interface ConsoleNavigation {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ConsoleSectionId } from "./sections-
|
|
2
|
-
import "./access-policy-
|
|
3
|
-
import { t as ConsoleProjectBuild } from "./project-
|
|
4
|
-
import "./setup-
|
|
1
|
+
import { a as ConsoleSectionId } from "./sections-Do7X4Nwt.js";
|
|
2
|
+
import "./access-policy-CGXhO3Ee.js";
|
|
3
|
+
import { t as ConsoleProjectBuild } from "./project-CufkVP1u.js";
|
|
4
|
+
import "./setup-ZbA1by7W.js";
|
|
5
5
|
//#region src/console/runtime/server/sections.d.ts
|
|
6
6
|
declare function getConsoleSections(): readonly ConsoleSectionId[];
|
|
7
7
|
declare function getConsoleProjectName(): string | undefined;
|
|
@@ -142,9 +142,8 @@ declare function resolveConsoleSectionIds(options: {
|
|
|
142
142
|
connections?: unknown;
|
|
143
143
|
database?: unknown;
|
|
144
144
|
email?: unknown;
|
|
145
|
-
host?: unknown;
|
|
146
145
|
kv?: unknown;
|
|
147
|
-
|
|
146
|
+
logs?: unknown;
|
|
148
147
|
queue?: unknown;
|
|
149
148
|
rateLimit?: unknown;
|
|
150
149
|
sandboxTask?: unknown;
|
|
@@ -322,10 +322,9 @@ function describeConsoleSectionRoutes(section) {
|
|
|
322
322
|
* `workspaces`, `workflows`, `queues`, and `schedules`. `console/contributions.ts` maps each id to its owner.
|
|
323
323
|
*/
|
|
324
324
|
function resolveConsoleSectionIds(options) {
|
|
325
|
-
const workflowEnabled = options.workflow !== false && Boolean(options.workflow || options.agent && options.host !== "netlify");
|
|
326
325
|
return [
|
|
327
326
|
...options.auth ? ["auth"] : [],
|
|
328
|
-
...options.
|
|
327
|
+
...options.logs ? ["logs"] : [],
|
|
329
328
|
...options.env ? ["env"] : [],
|
|
330
329
|
...options.agent ? [
|
|
331
330
|
"agents",
|
|
@@ -344,7 +343,7 @@ function resolveConsoleSectionIds(options) {
|
|
|
344
343
|
...options.rateLimit ? ["rate-limits"] : [],
|
|
345
344
|
...options.sandboxTask ? ["sandbox-tasks"] : [],
|
|
346
345
|
...options.workspace ? ["workspaces"] : [],
|
|
347
|
-
...
|
|
346
|
+
...options.workflow ? ["workflows"] : [],
|
|
348
347
|
...options.queue ? ["queues"] : [],
|
|
349
348
|
...options.schedule ? ["schedules"] : []
|
|
350
349
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as parseConsoleContributedSection } from "./definitions-
|
|
2
|
-
import { f as consoleSectionRouteName, s as consoleSectionDetails, x as isConsoleSectionId, y as isConsoleBuiltinSectionId } from "./sections-
|
|
3
|
-
import { u as requestConsole } from "./request-
|
|
1
|
+
import { t as parseConsoleContributedSection } from "./definitions-BW6SvmMM.js";
|
|
2
|
+
import { f as consoleSectionRouteName, s as consoleSectionDetails, x as isConsoleSectionId, y as isConsoleBuiltinSectionId } from "./sections-DumoLKQN.js";
|
|
3
|
+
import { u as requestConsole } from "./request-DE8w_cSM.js";
|
|
4
4
|
//#region src/console/runtime/client/sections.ts
|
|
5
5
|
/** The Console path of `sections.list`. Views pass it as `sectionsBase`, and the navigation cache keys on it. */
|
|
6
6
|
const consoleSectionsPath = "/_vitehub/api/sections";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ConsoleContributedSection } from "./definitions-
|
|
2
|
-
import { o as ConsoleAccess } from "./access-policy-
|
|
1
|
+
import { t as ConsoleContributedSection } from "./definitions-DB4LbZ7T.js";
|
|
2
|
+
import { o as ConsoleAccess } from "./access-policy-CGXhO3Ee.js";
|
|
3
3
|
//#region src/console/runtime/server/sections.get.d.ts
|
|
4
4
|
interface ConsoleSectionsResponse {
|
|
5
5
|
contributions?: readonly ConsoleContributedSection[];
|
package/dist/seo/runtime.js
CHANGED
|
@@ -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 { getStandardContext } from "@vite-hub/runtime";
|
|
3
3
|
//#region ../internal/src/sitemap.ts
|
|
4
4
|
/** One sitemap file holds at most this many URLs. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
-
import { o as encodeAgentRouteParam } from "./console-route-
|
|
1
|
+
import { t as viteHubErrorDiagnostics } from "./error-diagnostics-Bm3JKYjz.js";
|
|
2
|
+
import { o as encodeAgentRouteParam } from "./console-route-CBuqZ4wO.js";
|
|
3
3
|
import { consoleInvocationUrl, resolvePublicUrl } from "@vite-hub/runtime";
|
|
4
4
|
//#region src/console/server.ts
|
|
5
5
|
const agentConsole = { resolve(context) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as ConsoleSectionId } from "./sections-
|
|
2
|
-
import "./access-policy-
|
|
3
|
-
import { t as ConsoleProjectBuild } from "./project-
|
|
1
|
+
import { a as ConsoleSectionId } from "./sections-Do7X4Nwt.js";
|
|
2
|
+
import "./access-policy-CGXhO3Ee.js";
|
|
3
|
+
import { t as ConsoleProjectBuild } from "./project-CufkVP1u.js";
|
|
4
|
+
import "./development-W5EwONyL.js";
|
|
4
5
|
//#region src/console/runtime/server/setup.d.ts
|
|
5
6
|
declare function installConsoleSections(projectRoot: string, sections: readonly ConsoleSectionId[], navigationSections?: readonly ConsoleSectionId[]): readonly ConsoleSectionId[];
|
|
6
7
|
/** Generated production output installs what its build recorded, so `project.get` names the build that serves it. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listSessions, c as revokeSession, i as listInvites, l as withPageTools, n as linkSite, o as openSiteSession, r as listGrants, s as revokeInvite, t as inviteGuest } from "./site-access-
|
|
1
|
+
import { a as listSessions, c as revokeSession, i as listInvites, l as withPageTools, n as linkSite, o as openSiteSession, r as listGrants, s as revokeInvite, t as inviteGuest } from "./site-access-BmE8HGxs.js";
|
|
2
2
|
export { inviteGuest, linkSite, listGrants, listInvites, listSessions, openSiteSession, revokeInvite, revokeSession, withPageTools };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as readConsoleAccessGrants, m as readConsoleOperationUser } from "./access-
|
|
2
|
-
import { i as consoleRequestError } from "./request-
|
|
1
|
+
import { f as readConsoleAccessGrants, m as readConsoleOperationUser } from "./access-BDST818p.js";
|
|
2
|
+
import { i as consoleRequestError } from "./request-DbFfYmCu.js";
|
|
3
3
|
import { d as viteHubPageToolsResetCookie, p as viteHubSessionMarkerCookie, u as viteHubPageToolsQuery } from "./page-tools-shared-D3fFoEV2.js";
|
|
4
4
|
import "./site-access-BycrwM2v.js";
|
|
5
5
|
import { a as viteHubPageGrants } from "./page-tools-BkSSBFoi.js";
|
|
6
|
-
import { a as listConsoleSiteSessions, c as requireConsoleSiteKey, l as revokeConsoleSiteSession, n as consoleSiteKV, o as openConsoleSiteSession } from "./site-session-
|
|
7
|
-
import { a as base64url, f as seeOther, i as authFailure, m as ticketProblem, n as appOrigin, o as consoleInvitePrefix, r as authConsole, s as consoleRecordStore, t as appBase, u as issueConsoleTicket } from "./tickets-
|
|
6
|
+
import { a as listConsoleSiteSessions, c as requireConsoleSiteKey, l as revokeConsoleSiteSession, n as consoleSiteKV, o as openConsoleSiteSession } from "./site-session-odJq1dYa.js";
|
|
7
|
+
import { a as base64url, f as seeOther, i as authFailure, m as ticketProblem, n as appOrigin, o as consoleInvitePrefix, r as authConsole, s as consoleRecordStore, t as appBase, u as issueConsoleTicket } from "./tickets-C_0Fhc00.js";
|
|
8
8
|
//#region src/console/runtime/server/site-access.ts
|
|
9
9
|
/**
|
|
10
10
|
* Site access: the Console signs browsers in to the app, so the page tools work there without a password.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as isConsoleDevelopmentRuntime, i as consoleRequestError } from "./request-
|
|
1
|
+
import { c as isConsoleDevelopmentRuntime, i as consoleRequestError } from "./request-DbFfYmCu.js";
|
|
2
2
|
import { r as getConsoleSections } from "./sections-C83x0slv.js";
|
|
3
|
-
import { r as readViteHubSecret, t as deriveViteHubSecret } from "./secret-
|
|
3
|
+
import { r as readViteHubSecret, t as deriveViteHubSecret } from "./secret-Dy5uqvq9.js";
|
|
4
4
|
import { n as getActiveCloudflareEnv, t as activeEnvStorageKey } from "./cloudflare-env-lookup-DKXdr4P_.js";
|
|
5
5
|
import { importSealKey, sealWithKey, unsealWithKey } from "@vite-hub/env/seal";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -44,7 +44,7 @@ function unwrap([error, value]) {
|
|
|
44
44
|
}
|
|
45
45
|
/** The keys of a KV store below a prefix. Some drivers list keys with `/` where the key had `:`. */
|
|
46
46
|
async function consoleSiteKeys(kv, prefix) {
|
|
47
|
-
return (unwrap(await kv.
|
|
47
|
+
return (unwrap(await kv.list({ prefix }))?.keys ?? []).map((key) => key.replaceAll("/", ":")).filter((key) => key.startsWith(prefix));
|
|
48
48
|
}
|
|
49
49
|
const memoryKey = Symbol.for("vitehub.console.tickets");
|
|
50
50
|
const memoryScope = globalThis;
|
|
@@ -73,8 +73,8 @@ function memorySiteKV() {
|
|
|
73
73
|
entries.delete(key);
|
|
74
74
|
return [void 0, value];
|
|
75
75
|
},
|
|
76
|
-
async
|
|
77
|
-
return [void 0, [...entries.keys()].filter((key) => key.startsWith(
|
|
76
|
+
async list({ prefix }) {
|
|
77
|
+
return [void 0, { keys: [...entries.keys()].filter((key) => key.startsWith(prefix) && live(key) !== null) }];
|
|
78
78
|
},
|
|
79
79
|
async delete(key) {
|
|
80
80
|
entries.delete(key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AnyOperation } from "../operations-
|
|
1
|
+
import { n as AnyOperation } from "../operations-B0689BG1.js";
|
|
2
2
|
//#region src/skills/runtime.d.ts
|
|
3
3
|
/** One skill that the app serves, as the Console and `vitehub served-skills` show it. */
|
|
4
4
|
interface ServedSkillSummary {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as defineOperation } from "../operation-definition-
|
|
2
|
-
import { g as table } from "../operations-
|
|
1
|
+
import { t as defineOperation } from "../operation-definition-a5keEpCd.js";
|
|
2
|
+
import { g as table } from "../operations-EOdyctDc.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/skills/operations.ts
|
|
5
5
|
const runtime = () => import("../runtime-YLWfdrtO.js");
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Result } from "@vite-hub/runtime";
|
|
2
2
|
//#region src/skills.d.ts
|
|
3
|
-
/** The codes of `vite-hub/skills`. Each has a
|
|
3
|
+
/** The codes of `vite-hub/skills`. Each has a row in the Errors table of https://vitehub.dev/docs/console/skills. */
|
|
4
4
|
export type SkillErrorCode = "SKILL_DUPLICATE_NAME" | "SKILL_FILE_MISSING" | "SKILL_INVALID_FRONTMATTER" | "SKILL_INVALID_PATH" | "SKILL_NOT_FOUND" | "SKILL_SETTINGS_UNAVAILABLE";
|
|
5
5
|
/** One file of a skill. */
|
|
6
6
|
export interface SkillFile {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as consoleRequestError } from "./request-
|
|
2
|
-
import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "./agents-
|
|
1
|
+
import { i as consoleRequestError } from "./request-DbFfYmCu.js";
|
|
2
|
+
import { c as getConsoleAgents, s as getConsoleAgentDefinition } from "./agents-BDeazoAW.js";
|
|
3
3
|
import { inspectAgentSkillFiles } from "@vite-hub/agent/server/internal";
|
|
4
4
|
//#region src/console/runtime/server/skills.get.ts
|
|
5
5
|
const maxFileBytes = 524288;
|
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-a5keEpCd.js";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
//#region src/task/operations.ts
|
|
4
|
-
const runtime = () => import("../runtime-
|
|
4
|
+
const runtime = () => import("../runtime-OsEDfbM9.js");
|
|
5
5
|
function defineTaskOperation(definition) {
|
|
6
6
|
return defineOperation({
|
|
7
7
|
...definition,
|
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-Bm3JKYjz.js";
|
|
2
2
|
import { register } from "node:module";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ConsoleRequestError } from "./request-
|
|
1
|
+
import { t as ConsoleRequestError } from "./request-DE8w_cSM.js";
|
|
2
2
|
//#region src/console/runtime/client/ticket.ts
|
|
3
3
|
function isTab(value) {
|
|
4
4
|
return typeof value === "object" && value !== null && "close" in value && "location" in value;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as operationRpcPath } from "./operation-rpc-DI9txNxK.js";
|
|
2
|
-
import { r as consoleDiagnosticBody } from "./diagnostics-
|
|
3
|
-
import { a as installedConsoleAccessPolicy } from "./access-policy-
|
|
4
|
-
import { g as isConsoleLoopbackRequest, m as readConsoleOperationUser, o as consoleImpersonation, p as readConsoleAccessUser } from "./access-
|
|
5
|
-
import { i as consoleRequestError, n as consoleErrorResult } from "./request-
|
|
2
|
+
import { r as consoleDiagnosticBody } from "./diagnostics-9U_fYxMy.js";
|
|
3
|
+
import { a as installedConsoleAccessPolicy } from "./access-policy-DjBKLo3c.js";
|
|
4
|
+
import { g as isConsoleLoopbackRequest, m as readConsoleOperationUser, o as consoleImpersonation, p as readConsoleAccessUser } from "./access-BDST818p.js";
|
|
5
|
+
import { i as consoleRequestError, n as consoleErrorResult } from "./request-DbFfYmCu.js";
|
|
6
6
|
import { n as loadConsoleRuntime } from "./runtime-DxfJOfCd.js";
|
|
7
7
|
import { r as getConsoleSections } from "./sections-C83x0slv.js";
|
|
8
|
-
import { n as consoleSiteKV, r as consoleSiteKeys } from "./site-session-
|
|
8
|
+
import { n as consoleSiteKV, r as consoleSiteKeys } from "./site-session-odJq1dYa.js";
|
|
9
9
|
import { getStandardContext } from "@vite-hub/runtime/internal/h3";
|
|
10
10
|
import { resolvePublicUrl } from "@vite-hub/runtime";
|
|
11
11
|
//#region src/console/runtime/server/tickets.ts
|
|
@@ -348,7 +348,7 @@ async function redeemConsoleTicket(event) {
|
|
|
348
348
|
if (record.origin !== appOrigin(request) || record.base !== appBase(request)) return ticketProblem(403, "CONSOLE_TICKET_MISMATCH", "This one-time link was made for another app.");
|
|
349
349
|
await loadConsoleRuntime();
|
|
350
350
|
if (record.purpose === "content.preview") return await openPreview(record);
|
|
351
|
-
if (record.purpose === "page.member" || record.purpose === "page.guest") return await (await import("./site-access-
|
|
351
|
+
if (record.purpose === "page.member" || record.purpose === "page.guest") return await (await import("./site-access-BbJUe5QI.js")).openSiteSession(record, request, event);
|
|
352
352
|
return await impersonate(record, request, event, `${record.origin}${record.base}/`);
|
|
353
353
|
} catch (error) {
|
|
354
354
|
return failurePage(error);
|
|
@@ -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 { t as consoleHttpError } from "./http-error-Bs6e8_-8.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/console/runtime/server/usage.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as invariantError } from "./invariant-DolT9EEx.js";
|
|
2
|
-
import { _ as withRecordedCost, a as decimalString, f as publicTotals, g as usageSession, h as usageQueryWindow, i as decimal, l as modelUsage, m as usageCursor, n as compareUsageModels, o as emptyTotals, p as stringValue, s as finishUsage, t as addDecimal } from "./usage-
|
|
2
|
+
import { _ as withRecordedCost, a as decimalString, f as publicTotals, g as usageSession, h as usageQueryWindow, i as decimal, l as modelUsage, m as usageCursor, n as compareUsageModels, o as emptyTotals, p as stringValue, s as finishUsage, t as addDecimal } from "./usage-B4taNt4a.js";
|
|
3
3
|
//#region src/console/runtime/server/usage-index.ts
|
|
4
4
|
const metrics = [
|
|
5
5
|
"inputTokens",
|