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
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
//#region package.json
|
|
@@ -218,6 +218,16 @@ var exports = {
|
|
|
218
218
|
"import": "./dist/channels/server.js",
|
|
219
219
|
"default": "./dist/channels/server.js"
|
|
220
220
|
},
|
|
221
|
+
"./choices": {
|
|
222
|
+
"types": "./dist/choices.d.ts",
|
|
223
|
+
"import": "./dist/choices.js",
|
|
224
|
+
"default": "./dist/choices.js"
|
|
225
|
+
},
|
|
226
|
+
"./choices/vue": {
|
|
227
|
+
"types": "./dist/choices/vue.d.ts",
|
|
228
|
+
"import": "./dist/choices/vue.js",
|
|
229
|
+
"default": "./dist/choices/vue.js"
|
|
230
|
+
},
|
|
221
231
|
"./cms": {
|
|
222
232
|
"types": "./dist/cms.d.ts",
|
|
223
233
|
"import": "./dist/cms.js",
|
|
@@ -368,16 +378,6 @@ var exports = {
|
|
|
368
378
|
"import": "./dist/database.js",
|
|
369
379
|
"default": "./dist/database.js"
|
|
370
380
|
},
|
|
371
|
-
"./decisions": {
|
|
372
|
-
"types": "./dist/decisions.d.ts",
|
|
373
|
-
"import": "./dist/decisions.js",
|
|
374
|
-
"default": "./dist/decisions.js"
|
|
375
|
-
},
|
|
376
|
-
"./decisions/vue": {
|
|
377
|
-
"types": "./dist/decisions/vue.d.ts",
|
|
378
|
-
"import": "./dist/decisions/vue.js",
|
|
379
|
-
"default": "./dist/decisions/vue.js"
|
|
380
|
-
},
|
|
381
381
|
"./device": {
|
|
382
382
|
"types": "./dist/device.d.ts",
|
|
383
383
|
"import": "./dist/device.js",
|
|
@@ -951,7 +951,6 @@ var dependencies = {
|
|
|
951
951
|
"@vite-hub/source": "workspace:*",
|
|
952
952
|
"birpc": "catalog:runtime",
|
|
953
953
|
"confbox": "^0.2.4",
|
|
954
|
-
"esbuild": "catalog:tooling",
|
|
955
954
|
"h3": "catalog:unjs",
|
|
956
955
|
"nostics": "catalog:runtime",
|
|
957
956
|
"ocache": "catalog:runtime",
|
|
@@ -983,13 +982,13 @@ var peerDependencies = {
|
|
|
983
982
|
"@vite-hub/blob": "workspace:*",
|
|
984
983
|
"@vite-hub/browser": "workspace:*",
|
|
985
984
|
"@vite-hub/channels": "workspace:*",
|
|
985
|
+
"@vite-hub/choices": "workspace:*",
|
|
986
986
|
"@vite-hub/cms": "workspace:*",
|
|
987
987
|
"@vite-hub/codemods": "workspace:*",
|
|
988
988
|
"@vite-hub/comments": "workspace:*",
|
|
989
989
|
"@vite-hub/connections": "workspace:*",
|
|
990
990
|
"@vite-hub/content": "workspace:*",
|
|
991
991
|
"@vite-hub/database": "workspace:*",
|
|
992
|
-
"@vite-hub/decisions": "workspace:*",
|
|
993
992
|
"@vite-hub/device": "workspace:*",
|
|
994
993
|
"@vite-hub/docs": "workspace:*",
|
|
995
994
|
"@vite-hub/email": "workspace:*",
|
|
@@ -1045,13 +1044,17 @@ const removedViteHubOptions = {
|
|
|
1045
1044
|
why: "The `devtools` option was removed with the browser DevTools.",
|
|
1046
1045
|
fix: "Remove `devtools`. Use the ViteHub Console with `console: true`. `vitehub migrate` removes it."
|
|
1047
1046
|
},
|
|
1048
|
-
logs: {
|
|
1049
|
-
why: "`logs` moved
|
|
1050
|
-
fix: "Move it to `
|
|
1047
|
+
"observability.logs": {
|
|
1048
|
+
why: "`observability.logs` moved to the top-level `logs` key.",
|
|
1049
|
+
fix: "Move it to `vitehub({ logs: ... })`. `vitehub migrate` moves it."
|
|
1050
|
+
},
|
|
1051
|
+
"logs.evlog": {
|
|
1052
|
+
why: "`logs.evlog` moved to `observability.evlog`.",
|
|
1053
|
+
fix: "Move Evlog settings to `vitehub({ observability: { evlog: ... } })`. `vitehub migrate` moves them."
|
|
1051
1054
|
},
|
|
1052
|
-
cloudflare: {
|
|
1055
|
+
"cloudflare.secretsFile": {
|
|
1053
1056
|
why: "`cloudflare.secretsFile` was removed. `vitehub deploy` uploads the Worker secrets that the app reads with each new version.",
|
|
1054
|
-
fix: "Remove `cloudflare`. Keep the values in the shell or in `.env.production`, and deploy with `vitehub deploy`."
|
|
1057
|
+
fix: "Remove `cloudflare.secretsFile`. Keep the values in the shell or in `.env.production`, and deploy with `vitehub deploy`."
|
|
1055
1058
|
},
|
|
1056
1059
|
contentImportBase: {
|
|
1057
1060
|
why: "`contentImportBase` was removed. ViteHub always imports Content from `vite-hub/content`.",
|
|
@@ -1061,7 +1064,7 @@ const removedViteHubOptions = {
|
|
|
1061
1064
|
/** Fails with `VITE_HUB_B0024` when `options` set a removed or renamed option, which ViteHub would otherwise ignore. */
|
|
1062
1065
|
function assertNoRemovedViteHubOptions(options, where) {
|
|
1063
1066
|
for (const [key, { why, fix }] of Object.entries(removedViteHubOptions)) {
|
|
1064
|
-
if (Reflect.get(
|
|
1067
|
+
if (key.split(".").reduce((value, part) => value !== null && typeof value === "object" ? Reflect.get(value, part) : void 0, options) === void 0) continue;
|
|
1065
1068
|
throw viteHubErrorDiagnostics.VITE_HUB_B0024({ message: `[vitehub] \`${key}\` in ${where} is no longer a ViteHub option. ${why} ${fix}` });
|
|
1066
1069
|
}
|
|
1067
1070
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { n as isRecord } from "./object-D8pRdprI.js";
|
|
1
2
|
import { dirname, join } from "node:path";
|
|
2
|
-
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
4
|
import "node:fs/promises";
|
|
4
5
|
//#region ../internal/src/cli.ts
|
|
5
6
|
/**
|
|
@@ -32,5 +33,34 @@ function writeViteHubDevServerFile(root, info) {
|
|
|
32
33
|
function removeViteHubDevServerFile(root) {
|
|
33
34
|
rmSync(join(root, viteHubDevServerFile), { force: true });
|
|
34
35
|
}
|
|
36
|
+
/** The dev server that runs in `root`, or undefined when there is no file or it is not valid. */
|
|
37
|
+
function readViteHubDevServerFile(root) {
|
|
38
|
+
try {
|
|
39
|
+
const value = JSON.parse(readFileSync(join(root, viteHubDevServerFile), "utf8"));
|
|
40
|
+
const url = isRecord(value) ? value.url : void 0;
|
|
41
|
+
const served = isRecord(value) ? value.root : void 0;
|
|
42
|
+
return typeof url === "string" && url && typeof served === "string" && served ? {
|
|
43
|
+
root: served,
|
|
44
|
+
url
|
|
45
|
+
} : void 0;
|
|
46
|
+
} catch {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region ../internal/src/vite-stage.ts
|
|
52
|
+
/**
|
|
53
|
+
* Vite's `loadEnv(mode, envDir, "")`: every `.env` value of the mode and the whole shell. With `DEBUG=vite:env`, Vite
|
|
54
|
+
* logs that result to stderr, secrets included. loadEnv is synchronous, so this drops only the writes of this call.
|
|
55
|
+
*/
|
|
56
|
+
function loadAllEnv(loadEnv, mode, envDir) {
|
|
57
|
+
const write = process.stderr.write;
|
|
58
|
+
process.stderr.write = () => true;
|
|
59
|
+
try {
|
|
60
|
+
return loadEnv(mode, envDir, "");
|
|
61
|
+
} finally {
|
|
62
|
+
process.stderr.write = write;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
35
65
|
//#endregion
|
|
36
|
-
export { removeViteHubDevServerFile as n,
|
|
66
|
+
export { writeViteHubDevServerFile as a, removeViteHubDevServerFile as i, createCliDiscoveryNitroCloser as n, readViteHubDevServerFile as r, loadAllEnv as t };
|
|
@@ -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/workspace-history.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-hub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "The cohesive ViteHub framework distribution for Vite applications and agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -257,6 +257,16 @@
|
|
|
257
257
|
"import": "./dist/channels/server.js",
|
|
258
258
|
"default": "./dist/channels/server.js"
|
|
259
259
|
},
|
|
260
|
+
"./choices": {
|
|
261
|
+
"types": "./dist/choices.d.ts",
|
|
262
|
+
"import": "./dist/choices.js",
|
|
263
|
+
"default": "./dist/choices.js"
|
|
264
|
+
},
|
|
265
|
+
"./choices/vue": {
|
|
266
|
+
"types": "./dist/choices/vue.d.ts",
|
|
267
|
+
"import": "./dist/choices/vue.js",
|
|
268
|
+
"default": "./dist/choices/vue.js"
|
|
269
|
+
},
|
|
260
270
|
"./cms": {
|
|
261
271
|
"types": "./dist/cms.d.ts",
|
|
262
272
|
"import": "./dist/cms.js",
|
|
@@ -407,16 +417,6 @@
|
|
|
407
417
|
"import": "./dist/database.js",
|
|
408
418
|
"default": "./dist/database.js"
|
|
409
419
|
},
|
|
410
|
-
"./decisions": {
|
|
411
|
-
"types": "./dist/decisions.d.ts",
|
|
412
|
-
"import": "./dist/decisions.js",
|
|
413
|
-
"default": "./dist/decisions.js"
|
|
414
|
-
},
|
|
415
|
-
"./decisions/vue": {
|
|
416
|
-
"types": "./dist/decisions/vue.d.ts",
|
|
417
|
-
"import": "./dist/decisions/vue.js",
|
|
418
|
-
"default": "./dist/decisions/vue.js"
|
|
419
|
-
},
|
|
420
420
|
"./device": {
|
|
421
421
|
"types": "./dist/device.d.ts",
|
|
422
422
|
"import": "./dist/device.js",
|
|
@@ -985,14 +985,13 @@
|
|
|
985
985
|
"@types/json-schema": "^7.0.15",
|
|
986
986
|
"@types/node": "^24.19.1",
|
|
987
987
|
"@valibot/to-json-schema": "^1.8.0",
|
|
988
|
-
"@vite-hub/bundle": "0.
|
|
989
|
-
"@vite-hub/cli": "0.
|
|
990
|
-
"@vite-hub/env": "0.
|
|
991
|
-
"@vite-hub/runtime": "0.
|
|
992
|
-
"@vite-hub/source": "0.
|
|
988
|
+
"@vite-hub/bundle": "0.4.1",
|
|
989
|
+
"@vite-hub/cli": "0.4.1",
|
|
990
|
+
"@vite-hub/env": "0.4.1",
|
|
991
|
+
"@vite-hub/runtime": "0.4.1",
|
|
992
|
+
"@vite-hub/source": "0.4.1",
|
|
993
993
|
"birpc": "^4.2.0",
|
|
994
994
|
"confbox": "^0.2.4",
|
|
995
|
-
"esbuild": "^0.28.2",
|
|
996
995
|
"h3": "^2.0.8",
|
|
997
996
|
"nostics": "1.4.0",
|
|
998
997
|
"ocache": "^0.3.1",
|
|
@@ -1040,44 +1039,44 @@
|
|
|
1040
1039
|
"@ui-sdk/core": "0.1.0-beta.5",
|
|
1041
1040
|
"@ui-sdk/vue": "0.1.0-beta.5",
|
|
1042
1041
|
"@vercel/sandbox": "^3.9.1 || ^4.0.0",
|
|
1043
|
-
"@vite-hub/agent": "0.
|
|
1044
|
-
"@vite-hub/auth": "0.
|
|
1045
|
-
"@vite-hub/blob": "0.
|
|
1046
|
-
"@vite-hub/browser": "0.
|
|
1047
|
-
"@vite-hub/channels": "0.
|
|
1048
|
-
"@vite-hub/
|
|
1049
|
-
"@vite-hub/
|
|
1050
|
-
"@vite-hub/
|
|
1051
|
-
"@vite-hub/
|
|
1052
|
-
"@vite-hub/
|
|
1053
|
-
"@vite-hub/
|
|
1054
|
-
"@vite-hub/
|
|
1055
|
-
"@vite-hub/device": "0.
|
|
1056
|
-
"@vite-hub/docs": "0.
|
|
1057
|
-
"@vite-hub/email": "0.
|
|
1058
|
-
"@vite-hub/forge": "0.
|
|
1059
|
-
"@vite-hub/forms": "0.
|
|
1060
|
-
"@vite-hub/gateways": "0.
|
|
1061
|
-
"@vite-hub/i18n": "0.
|
|
1042
|
+
"@vite-hub/agent": "0.4.1",
|
|
1043
|
+
"@vite-hub/auth": "0.4.1",
|
|
1044
|
+
"@vite-hub/blob": "0.4.1",
|
|
1045
|
+
"@vite-hub/browser": "0.4.1",
|
|
1046
|
+
"@vite-hub/channels": "0.4.1",
|
|
1047
|
+
"@vite-hub/choices": "0.4.1",
|
|
1048
|
+
"@vite-hub/cms": "0.4.1",
|
|
1049
|
+
"@vite-hub/codemods": "0.4.1",
|
|
1050
|
+
"@vite-hub/comments": "0.4.1",
|
|
1051
|
+
"@vite-hub/connections": "0.4.1",
|
|
1052
|
+
"@vite-hub/content": "0.4.1",
|
|
1053
|
+
"@vite-hub/database": "0.4.1",
|
|
1054
|
+
"@vite-hub/device": "0.4.1",
|
|
1055
|
+
"@vite-hub/docs": "0.4.1",
|
|
1056
|
+
"@vite-hub/email": "0.4.1",
|
|
1057
|
+
"@vite-hub/forge": "0.4.1",
|
|
1058
|
+
"@vite-hub/forms": "0.4.1",
|
|
1059
|
+
"@vite-hub/gateways": "0.4.1",
|
|
1060
|
+
"@vite-hub/i18n": "0.4.1",
|
|
1062
1061
|
"@vite-hub/icons": "0.1.0",
|
|
1063
1062
|
"@vite-hub/internal": "0.0.1",
|
|
1064
|
-
"@vite-hub/kit": "0.
|
|
1065
|
-
"@vite-hub/kv": "0.
|
|
1066
|
-
"@vite-hub/markdown-template": "0.
|
|
1067
|
-
"@vite-hub/mcp": "0.
|
|
1068
|
-
"@vite-hub/presets": "0.
|
|
1069
|
-
"@vite-hub/queue": "0.
|
|
1070
|
-
"@vite-hub/rate-limit": "0.
|
|
1071
|
-
"@vite-hub/realtime": "0.
|
|
1072
|
-
"@vite-hub/sandbox": "0.
|
|
1073
|
-
"@vite-hub/schedule": "0.
|
|
1074
|
-
"@vite-hub/shell": "0.
|
|
1075
|
-
"@vite-hub/sync": "0.
|
|
1076
|
-
"@vite-hub/ui": "0.
|
|
1077
|
-
"@vite-hub/web-container": "0.
|
|
1078
|
-
"@vite-hub/webhooks": "0.
|
|
1079
|
-
"@vite-hub/workflow": "0.
|
|
1080
|
-
"@vite-hub/workspace": "0.
|
|
1063
|
+
"@vite-hub/kit": "0.4.1",
|
|
1064
|
+
"@vite-hub/kv": "0.4.1",
|
|
1065
|
+
"@vite-hub/markdown-template": "0.4.1",
|
|
1066
|
+
"@vite-hub/mcp": "0.4.1",
|
|
1067
|
+
"@vite-hub/presets": "0.4.1",
|
|
1068
|
+
"@vite-hub/queue": "0.4.1",
|
|
1069
|
+
"@vite-hub/rate-limit": "0.4.1",
|
|
1070
|
+
"@vite-hub/realtime": "0.4.1",
|
|
1071
|
+
"@vite-hub/sandbox": "0.4.1",
|
|
1072
|
+
"@vite-hub/schedule": "0.4.1",
|
|
1073
|
+
"@vite-hub/shell": "0.4.1",
|
|
1074
|
+
"@vite-hub/sync": "0.4.1",
|
|
1075
|
+
"@vite-hub/ui": "0.4.1",
|
|
1076
|
+
"@vite-hub/web-container": "0.4.1",
|
|
1077
|
+
"@vite-hub/webhooks": "0.4.1",
|
|
1078
|
+
"@vite-hub/workflow": "0.4.1",
|
|
1079
|
+
"@vite-hub/workspace": "0.4.1",
|
|
1081
1080
|
"@vitejs/plugin-vue": "^6.0.9",
|
|
1082
1081
|
"@vue/test-utils": "2.5.1",
|
|
1083
1082
|
"@vueuse/core": "^14.4.0",
|
|
@@ -1087,6 +1086,7 @@
|
|
|
1087
1086
|
"comark": "^0.9.0",
|
|
1088
1087
|
"drizzle-kit": "1.0.0-rc.5",
|
|
1089
1088
|
"drizzle-orm": "1.0.0-rc.5",
|
|
1089
|
+
"esbuild": "^0.28.2",
|
|
1090
1090
|
"evalite": "1.0.0-beta.16",
|
|
1091
1091
|
"fuse.js": "7.5.0",
|
|
1092
1092
|
"happy-dom": "21.0.3",
|
|
@@ -1103,7 +1103,7 @@
|
|
|
1103
1103
|
"unstorage": "2.0.0-beta.0",
|
|
1104
1104
|
"uqr": "^0.1.3",
|
|
1105
1105
|
"vite": "^8.2.2",
|
|
1106
|
-
"vite-doctor": "
|
|
1106
|
+
"vite-doctor": "https://pkg.pr.new/vite-doctor@084702c3600540b8125fabf9cfc442ad45448557",
|
|
1107
1107
|
"vite-plus": "^0.3.3",
|
|
1108
1108
|
"vitest": "^4.1.11",
|
|
1109
1109
|
"vue": "3.5.44",
|
|
@@ -1129,41 +1129,41 @@
|
|
|
1129
1129
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
1130
1130
|
"@nuxt/ui": "^4.11.0",
|
|
1131
1131
|
"@vercel/functions": "^3.9.11",
|
|
1132
|
-
"@vite-hub/agent": "0.
|
|
1133
|
-
"@vite-hub/auth": "0.
|
|
1134
|
-
"@vite-hub/blob": "0.
|
|
1135
|
-
"@vite-hub/browser": "0.
|
|
1136
|
-
"@vite-hub/channels": "0.
|
|
1137
|
-
"@vite-hub/
|
|
1138
|
-
"@vite-hub/
|
|
1139
|
-
"@vite-hub/
|
|
1140
|
-
"@vite-hub/
|
|
1141
|
-
"@vite-hub/
|
|
1142
|
-
"@vite-hub/
|
|
1143
|
-
"@vite-hub/
|
|
1144
|
-
"@vite-hub/device": "0.
|
|
1145
|
-
"@vite-hub/docs": "0.
|
|
1146
|
-
"@vite-hub/email": "0.
|
|
1147
|
-
"@vite-hub/forge": "0.
|
|
1148
|
-
"@vite-hub/forms": "0.
|
|
1149
|
-
"@vite-hub/gateways": "0.
|
|
1150
|
-
"@vite-hub/i18n": "0.
|
|
1151
|
-
"@vite-hub/kv": "0.
|
|
1152
|
-
"@vite-hub/markdown-template": "0.
|
|
1153
|
-
"@vite-hub/mcp": "0.
|
|
1154
|
-
"@vite-hub/presets": "0.
|
|
1155
|
-
"@vite-hub/queue": "0.
|
|
1156
|
-
"@vite-hub/rate-limit": "0.
|
|
1157
|
-
"@vite-hub/realtime": "0.
|
|
1158
|
-
"@vite-hub/sandbox": "0.
|
|
1159
|
-
"@vite-hub/schedule": "0.
|
|
1160
|
-
"@vite-hub/shell": "0.
|
|
1161
|
-
"@vite-hub/sync": "0.
|
|
1162
|
-
"@vite-hub/ui": "0.
|
|
1163
|
-
"@vite-hub/web-container": "0.
|
|
1164
|
-
"@vite-hub/webhooks": "0.
|
|
1165
|
-
"@vite-hub/workflow": "0.
|
|
1166
|
-
"@vite-hub/workspace": "0.
|
|
1132
|
+
"@vite-hub/agent": "0.4.1",
|
|
1133
|
+
"@vite-hub/auth": "0.4.1",
|
|
1134
|
+
"@vite-hub/blob": "0.4.1",
|
|
1135
|
+
"@vite-hub/browser": "0.4.1",
|
|
1136
|
+
"@vite-hub/channels": "0.4.1",
|
|
1137
|
+
"@vite-hub/choices": "0.4.1",
|
|
1138
|
+
"@vite-hub/cms": "0.4.1",
|
|
1139
|
+
"@vite-hub/codemods": "0.4.1",
|
|
1140
|
+
"@vite-hub/comments": "0.4.1",
|
|
1141
|
+
"@vite-hub/connections": "0.4.1",
|
|
1142
|
+
"@vite-hub/content": "0.4.1",
|
|
1143
|
+
"@vite-hub/database": "0.4.1",
|
|
1144
|
+
"@vite-hub/device": "0.4.1",
|
|
1145
|
+
"@vite-hub/docs": "0.4.1",
|
|
1146
|
+
"@vite-hub/email": "0.4.1",
|
|
1147
|
+
"@vite-hub/forge": "0.4.1",
|
|
1148
|
+
"@vite-hub/forms": "0.4.1",
|
|
1149
|
+
"@vite-hub/gateways": "0.4.1",
|
|
1150
|
+
"@vite-hub/i18n": "0.4.1",
|
|
1151
|
+
"@vite-hub/kv": "0.4.1",
|
|
1152
|
+
"@vite-hub/markdown-template": "0.4.1",
|
|
1153
|
+
"@vite-hub/mcp": "0.4.1",
|
|
1154
|
+
"@vite-hub/presets": "0.4.1",
|
|
1155
|
+
"@vite-hub/queue": "0.4.1",
|
|
1156
|
+
"@vite-hub/rate-limit": "0.4.1",
|
|
1157
|
+
"@vite-hub/realtime": "0.4.1",
|
|
1158
|
+
"@vite-hub/sandbox": "0.4.1",
|
|
1159
|
+
"@vite-hub/schedule": "0.4.1",
|
|
1160
|
+
"@vite-hub/shell": "0.4.1",
|
|
1161
|
+
"@vite-hub/sync": "0.4.1",
|
|
1162
|
+
"@vite-hub/ui": "0.4.1",
|
|
1163
|
+
"@vite-hub/web-container": "0.4.1",
|
|
1164
|
+
"@vite-hub/webhooks": "0.4.1",
|
|
1165
|
+
"@vite-hub/workflow": "0.4.1",
|
|
1166
|
+
"@vite-hub/workspace": "0.4.1",
|
|
1167
1167
|
"@vueuse/core": "^14.4.0",
|
|
1168
1168
|
"ai": "^6.0.0 || ^7.0.0-0",
|
|
1169
1169
|
"better-auth": "^1.7.15",
|
|
@@ -1244,6 +1244,9 @@
|
|
|
1244
1244
|
"@vite-hub/channels": {
|
|
1245
1245
|
"optional": true
|
|
1246
1246
|
},
|
|
1247
|
+
"@vite-hub/choices": {
|
|
1248
|
+
"optional": true
|
|
1249
|
+
},
|
|
1247
1250
|
"@vite-hub/cms": {
|
|
1248
1251
|
"optional": true
|
|
1249
1252
|
},
|
|
@@ -1262,9 +1265,6 @@
|
|
|
1262
1265
|
"@vite-hub/database": {
|
|
1263
1266
|
"optional": true
|
|
1264
1267
|
},
|
|
1265
|
-
"@vite-hub/decisions": {
|
|
1266
|
-
"optional": true
|
|
1267
|
-
},
|
|
1268
1268
|
"@vite-hub/device": {
|
|
1269
1269
|
"optional": true
|
|
1270
1270
|
},
|
|
@@ -1369,7 +1369,7 @@
|
|
|
1369
1369
|
}
|
|
1370
1370
|
},
|
|
1371
1371
|
"engines": {
|
|
1372
|
-
"node": ">=
|
|
1372
|
+
"node": ">=24.15.0"
|
|
1373
1373
|
},
|
|
1374
1374
|
"vitehub": {
|
|
1375
1375
|
"agent": {
|
package/dist/decisions/vue.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@vite-hub/decisions/vue";
|
package/dist/decisions/vue.js
DELETED
package/dist/decisions.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@vite-hub/decisions";
|
package/dist/decisions.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/console/runtime/server/development.d.ts
|
|
2
|
-
/** Development output also records the Setup endpoint route; production output never contains it. */
|
|
3
|
-
declare function installConsoleDevelopment(projectRoot: string, development: boolean, setupRoute?: string): void;
|
|
4
|
-
/** The route of the dev Setup endpoints. Undefined outside a development server. */
|
|
5
|
-
declare function consoleSetupRoute(): string | undefined;
|
|
6
|
-
/** Unconfigured and production output refuse framing, regardless of runtime NODE_ENV. */
|
|
7
|
-
declare function isConsoleDevelopmentBuild(): boolean;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { installConsoleDevelopment as n, isConsoleDevelopmentBuild as r, consoleSetupRoute as t };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
-
//#region src/internal/runtime-feature-guard.ts
|
|
5
|
-
const configExtensions = [
|
|
6
|
-
"js",
|
|
7
|
-
"mjs",
|
|
8
|
-
"cjs",
|
|
9
|
-
"ts",
|
|
10
|
-
"mts",
|
|
11
|
-
"cts"
|
|
12
|
-
];
|
|
13
|
-
/** True for `vitehub({ agent: false })`, `vitehub({ agent: { cli: false } })`, and the same options under `vitehub: {}`. */
|
|
14
|
-
async function hasAgentOptOut(source, file) {
|
|
15
|
-
const { argumentExpression, findProperty, scanModule, staticValue, unwrapExpression, walk } = await import("./scan-module-BTeOuZsp.js");
|
|
16
|
-
const module = scanModule(source, file);
|
|
17
|
-
const pluginNames = /* @__PURE__ */ new Set();
|
|
18
|
-
for (const statement of module.program.body) {
|
|
19
|
-
if (statement.type !== "ImportDeclaration" || statement.importKind === "type" || statement.source.value !== "vite-hub") continue;
|
|
20
|
-
for (const specifier of statement.specifiers) {
|
|
21
|
-
if (specifier.type !== "ImportSpecifier" || specifier.importKind === "type") continue;
|
|
22
|
-
if ((specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value) === "vitehub") pluginNames.add(specifier.local.name);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const options = [];
|
|
26
|
-
walk(module.program, (node) => {
|
|
27
|
-
if (node.type === "ObjectExpression") for (const property of node.properties) {
|
|
28
|
-
if (property.type !== "Property" || property.computed || property.key.type !== "Identifier" || property.key.name !== "vitehub") continue;
|
|
29
|
-
const value = unwrapExpression(property.value);
|
|
30
|
-
if (value.type === "ObjectExpression") options.push(value);
|
|
31
|
-
}
|
|
32
|
-
if (node.type === "CallExpression" && node.callee.type === "Identifier" && pluginNames.has(node.callee.name)) {
|
|
33
|
-
const value = argumentExpression(node.arguments[0]);
|
|
34
|
-
if (value?.type === "ObjectExpression") options.push(value);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return options.some((object) => {
|
|
38
|
-
const agent = findProperty(object, "agent")?.value;
|
|
39
|
-
if (agent === void 0) return false;
|
|
40
|
-
if (staticValue(agent) === false) return true;
|
|
41
|
-
const cli = agent.type === "ObjectExpression" ? findProperty(agent, "cli")?.value : void 0;
|
|
42
|
-
return cli !== void 0 && staticValue(cli) === false;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/** Detects explicit Agent CLI opt-outs without evaluating the project config. */
|
|
46
|
-
async function isAgentCliEnabled(rootDir) {
|
|
47
|
-
const owner = configExtensions.some((extension) => existsSync(join(rootDir, `nuxt.config.${extension}`))) ? "nuxt" : "vite";
|
|
48
|
-
for (const extension of configExtensions) {
|
|
49
|
-
const path = join(rootDir, `${owner}.config.${extension}`);
|
|
50
|
-
if (existsSync(path)) return !await hasAgentOptOut(await readFile(path, "utf8"), path);
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { isAgentCliEnabled };
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { parseSync } from "vite";
|
|
2
|
-
//#region ../internal/src/build/scan-module.ts
|
|
3
|
-
/**
|
|
4
|
-
* Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
|
|
5
|
-
* the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
|
|
6
|
-
* `dynamic`, so callers can report their own diagnostics.
|
|
7
|
-
*/
|
|
8
|
-
/** The value of an expression that the scanner cannot read without running the module. */
|
|
9
|
-
const dynamic = Symbol("dynamic");
|
|
10
|
-
function languageOf(file) {
|
|
11
|
-
if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
|
|
12
|
-
if (/\.(?:c|m)?jsx$/i.test(file)) return "jsx";
|
|
13
|
-
if (/\.(?:c|m)?js$/i.test(file)) return "js";
|
|
14
|
-
return "ts";
|
|
15
|
-
}
|
|
16
|
-
/** Parses a module once. `file` selects the grammar from its extension and defaults to TypeScript. */
|
|
17
|
-
function scanModule(source, file = "module.ts") {
|
|
18
|
-
const result = parseSync(file, source, {
|
|
19
|
-
lang: languageOf(file),
|
|
20
|
-
preserveParens: false,
|
|
21
|
-
sourceType: "module"
|
|
22
|
-
});
|
|
23
|
-
return {
|
|
24
|
-
comments: result.comments,
|
|
25
|
-
errors: result.errors,
|
|
26
|
-
file,
|
|
27
|
-
program: result.program,
|
|
28
|
-
source
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function isNode(value) {
|
|
32
|
-
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
33
|
-
}
|
|
34
|
-
/** Visits `node` and its descendants. Return `false` from `visit` to skip the children of a node. */
|
|
35
|
-
function walk(node, visit, parent) {
|
|
36
|
-
if (visit(node, parent) === false) return;
|
|
37
|
-
const fields = node;
|
|
38
|
-
for (const key in fields) {
|
|
39
|
-
const child = fields[key];
|
|
40
|
-
if (typeof child !== "object" || child === null || key === "parent") continue;
|
|
41
|
-
if (Array.isArray(child)) {
|
|
42
|
-
for (const item of child) if (isNode(item)) walk(item, visit, node);
|
|
43
|
-
} else if (isNode(child)) walk(child, visit, node);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/** Removes parentheses, `as`, `satisfies`, `!`, and `<T>` assertions around an expression. */
|
|
47
|
-
function unwrapExpression(node) {
|
|
48
|
-
while (node.type === "ParenthesizedExpression" || node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "TSNonNullExpression" || node.type === "TSTypeAssertion") node = node.expression;
|
|
49
|
-
return node;
|
|
50
|
-
}
|
|
51
|
-
/** A call argument without assertions, or undefined for a spread or missing argument. */
|
|
52
|
-
function argumentExpression(argument) {
|
|
53
|
-
return argument === void 0 || argument.type === "SpreadElement" ? void 0 : unwrapExpression(argument);
|
|
54
|
-
}
|
|
55
|
-
function staticKey(property) {
|
|
56
|
-
const key = property.key;
|
|
57
|
-
if (key.type === "Identifier" && !property.computed) return key.name;
|
|
58
|
-
if (key.type === "PrivateIdentifier") return;
|
|
59
|
-
const value = staticValue(key);
|
|
60
|
-
return typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : void 0;
|
|
61
|
-
}
|
|
62
|
-
/** The members of an object literal in source order. */
|
|
63
|
-
function objectProperties(object) {
|
|
64
|
-
return object.properties.map((node) => node.type === "SpreadElement" ? {
|
|
65
|
-
computed: false,
|
|
66
|
-
key: void 0,
|
|
67
|
-
node,
|
|
68
|
-
value: void 0
|
|
69
|
-
} : {
|
|
70
|
-
computed: node.computed,
|
|
71
|
-
key: staticKey(node),
|
|
72
|
-
node,
|
|
73
|
-
value: unwrapExpression(node.value)
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/** The last member named `name`, which is the one that the object keeps at runtime. */
|
|
77
|
-
function findProperty(object, name) {
|
|
78
|
-
return objectProperties(object).findLast((property) => property.key === name);
|
|
79
|
-
}
|
|
80
|
-
/** The value of a template literal without substitutions. */
|
|
81
|
-
function staticTemplate(node) {
|
|
82
|
-
if (node.expressions.length) return dynamic;
|
|
83
|
-
return node.quasis[0]?.value.cooked ?? dynamic;
|
|
84
|
-
}
|
|
85
|
-
const escapePattern = /\\(u\{[^}]*\}?|u[\s\S]{0,4}|x[\s\S]{0,2}|0\d|[\s\S])/g;
|
|
86
|
-
/**
|
|
87
|
-
* True when a string literal has an escape that strict mode code rejects. The parser recovers from some bad escapes
|
|
88
|
-
* and accepts legacy octal escapes, so the scanner checks them again.
|
|
89
|
-
*/
|
|
90
|
-
function hasInvalidEscape(raw) {
|
|
91
|
-
for (const [, escape = ""] of raw.matchAll(escapePattern)) if (escape.startsWith("u{")) {
|
|
92
|
-
const code = escape.slice(2, -1);
|
|
93
|
-
if (!escape.endsWith("}") || !/^[\da-fA-F]+$/.test(code) || Number.parseInt(code, 16) > 1114111) return true;
|
|
94
|
-
} else if (escape.startsWith("u")) {
|
|
95
|
-
if (!/^u[\da-fA-F]{4}$/.test(escape)) return true;
|
|
96
|
-
} else if (escape.startsWith("x")) {
|
|
97
|
-
if (!/^x[\da-fA-F]{2}$/.test(escape)) return true;
|
|
98
|
-
} else if (/^(?:[1-9]|0\d)$/.test(escape)) return true;
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Reads a literal value: strings, numbers, booleans, `null`, `undefined`, template literals without substitutions,
|
|
103
|
-
* and arrays and objects of these. Any other expression gives `dynamic`.
|
|
104
|
-
*/
|
|
105
|
-
function staticValue(node) {
|
|
106
|
-
node = unwrapExpression(node);
|
|
107
|
-
switch (node.type) {
|
|
108
|
-
case "Literal":
|
|
109
|
-
if ("regex" in node) return dynamic;
|
|
110
|
-
return typeof node.value === "string" && hasInvalidEscape(node.raw ?? "") ? dynamic : node.value;
|
|
111
|
-
case "TemplateLiteral": return staticTemplate(node);
|
|
112
|
-
case "Identifier": return node.name === "undefined" ? void 0 : dynamic;
|
|
113
|
-
case "UnaryExpression": {
|
|
114
|
-
if (node.operator === "void") return staticValue(node.argument) === dynamic ? dynamic : void 0;
|
|
115
|
-
const value = staticValue(node.argument);
|
|
116
|
-
if (node.operator === "-" && (typeof value === "number" || typeof value === "bigint")) return -value;
|
|
117
|
-
return dynamic;
|
|
118
|
-
}
|
|
119
|
-
case "ArrayExpression": {
|
|
120
|
-
const values = [];
|
|
121
|
-
for (const element of node.elements) {
|
|
122
|
-
if (element === null || element.type === "SpreadElement") return dynamic;
|
|
123
|
-
const value = staticValue(element);
|
|
124
|
-
if (value === dynamic) return dynamic;
|
|
125
|
-
values.push(value);
|
|
126
|
-
}
|
|
127
|
-
return values;
|
|
128
|
-
}
|
|
129
|
-
case "ObjectExpression": {
|
|
130
|
-
const values = {};
|
|
131
|
-
for (const property of objectProperties(node)) {
|
|
132
|
-
if (property.key === void 0 || property.node.type !== "Property" || property.node.kind !== "init" || property.node.method || property.value === void 0) return dynamic;
|
|
133
|
-
const value = staticValue(property.value);
|
|
134
|
-
if (value === dynamic) return dynamic;
|
|
135
|
-
Object.defineProperty(values, property.key, {
|
|
136
|
-
configurable: true,
|
|
137
|
-
enumerable: true,
|
|
138
|
-
value,
|
|
139
|
-
writable: true
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
return values;
|
|
143
|
-
}
|
|
144
|
-
default: return dynamic;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
export { scanModule as a, walk as c, objectProperties as i, dynamic as n, staticValue as o, findProperty as r, unwrapExpression as s, argumentExpression as t };
|