void 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +19 -106
  2. package/dist/{account-cmd-vJhh5lrb.mjs → account-cmd-CDry3B5V.mjs} +5 -5
  3. package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DC2yPvzY.mjs} +1 -1
  4. package/dist/{application-routing-B7QEjqSR.mjs → application-routing-C9khgLiS.mjs} +1 -1
  5. package/dist/{auth-DX3JURcX.mjs → auth-B60QDbjg.mjs} +1 -1
  6. package/dist/{auth-CQkSDS50.mjs → auth-D52yG7hl.mjs} +3 -3
  7. package/dist/{auth-link-D75t9wO2.mjs → auth-link-DjeOptYi.mjs} +5 -6
  8. package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BRxIuqDi.mjs} +7 -7
  9. package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-Ce3C8huo.mjs} +6 -7
  10. package/dist/{cache-ZtQmyxVV.mjs → cache-CS8Yxr5a.mjs} +6 -7
  11. package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-mZsD88Xa.mjs} +4 -6
  12. package/dist/{cf-access-BGe5sWXF.mjs → cf-access-YTlqvAsk.mjs} +1 -1
  13. package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
  14. package/dist/cli/cli.mjs +45 -45
  15. package/dist/cli/cloudflare-operation-process.mjs +3 -3
  16. package/dist/cli/env-schema-probe.d.mts +1 -1
  17. package/dist/cli/env-schema-probe.mjs +2 -2
  18. package/dist/client-BxVixJBI.mjs +2 -0
  19. package/dist/{client-DKAsFA4X.mjs → client-mC-dFGDD.mjs} +103 -25
  20. package/dist/{cloudflare-cmd-CmY8dGkd.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
  21. package/dist/{cloudflare-connect-IiR3ZieC.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
  22. package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-DYa3coIk.mjs} +2 -2
  23. package/dist/{cloudflare-operations-BCdXSsmo.mjs → cloudflare-operations-DoQrVHAt.mjs} +1 -1
  24. package/dist/{connect-B-usTnlF.mjs → connect-H6EvP62X.mjs} +12 -9
  25. package/dist/{create-project-CYOOAYcn.mjs → create-project-B2kk9Q0o.mjs} +6 -6
  26. package/dist/{create-project-FWbf5Olo.mjs → create-project-Dbb4uiN-.mjs} +1 -1
  27. package/dist/{db-Ck2eZ2iB.mjs → db-DpCKZto0.mjs} +35 -38
  28. package/dist/{delete-sK56qtzZ.mjs → delete-CxlSvsvW.mjs} +6 -7
  29. package/dist/{deploy-gCVaiJbS.mjs → deploy-CeEbnv4b.mjs} +9249 -8925
  30. package/dist/deploy-qmiLE1G1.mjs +2 -0
  31. package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
  32. package/dist/{domain-DFfQE8jg.mjs → domain-B_9VgOm6.mjs} +8 -8
  33. package/dist/{email-CdnhUHvJ.mjs → email-BokHgjKj.mjs} +7 -7
  34. package/dist/{env-DmGdHi5i.mjs → env-BdTc-K2L.mjs} +7 -8
  35. package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
  36. package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
  37. package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-Nm3hkZbT.mjs} +8 -1
  38. package/dist/{gen-CshAkukR.mjs → gen-BhDlTpwW.mjs} +2 -4
  39. package/dist/gen-qCBwH3fZ.mjs +2 -0
  40. package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-hhkTzlGS.mjs} +7 -16
  41. package/dist/{handler-CZ4nAylQ.d.mts → handler-BeK3weD4.d.mts} +1 -1
  42. package/dist/{help-Dotbf6iz.mjs → help-Bv44e2tm.mjs} +13 -9
  43. package/dist/help-Dw5f9Xrg.mjs +2 -0
  44. package/dist/index.d.mts +19 -15
  45. package/dist/index.mjs +2225 -2142
  46. package/dist/{info-B97bTX9N.mjs → info-DhtTKh65.mjs} +2 -4
  47. package/dist/{init-BTQEZZGJ.mjs → init-BMf4T03q.mjs} +17 -18
  48. package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
  49. package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
  50. package/dist/{link-B46sYH0K.mjs → link-BqYsSS_I.mjs} +6 -7
  51. package/dist/{list-BnPrIsU_.mjs → list-_kBToO-l.mjs} +10 -10
  52. package/dist/{live-Chw1eIMv.d.mts → live-iAuEH1hd.d.mts} +1 -1
  53. package/dist/{local-d1-2CMnpuW_.mjs → local-d1-fGxYrVD6.mjs} +2 -2
  54. package/dist/login-D7meQg_3.mjs +2 -0
  55. package/dist/{login-BuiMyUrx.mjs → login-DFuo-RWO.mjs} +9 -7
  56. package/dist/{logs-CZG9d-ic.mjs → logs-DYgnh6dH.mjs} +7 -8
  57. package/dist/migrate-CEu2X5DB.mjs +2 -0
  58. package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
  59. package/dist/{node-BkyRWRx8.mjs → node-C6Q6e1Es.mjs} +1 -1
  60. package/dist/{operator-args-B3BTmSoi.mjs → operator-args-DdY54Bgb.mjs} +1 -1
  61. package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-2dsGlTT5.mjs} +4 -8
  62. package/dist/{operator-client-CpHjTd0t.mjs → operator-client-BFqpp6z0.mjs} +3 -3
  63. package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-CUGHXrQf.mjs} +27 -9
  64. package/dist/operator-cmd-DRPvhpjM.mjs +2 -0
  65. package/dist/{output-CbM85T4k.mjs → output-BvdaehtE.mjs} +28 -4
  66. package/dist/pages/client.d.mts +4 -1
  67. package/dist/pages/client.mjs +120 -29
  68. package/dist/pages/index.mjs +1 -1
  69. package/dist/pages/islands-plugin.mjs +1 -1
  70. package/dist/pages/protocol.d.mts +2 -2
  71. package/dist/{plan-NPpwZ_kc.mjs → plan-CJGEeTEI.mjs} +2 -2
  72. package/dist/plan-COtUvdMA.mjs +2 -0
  73. package/dist/{platform-args-3k8X9-H_.mjs → platform-args-DSV2p4nY.mjs} +4 -2
  74. package/dist/platform-args-Dcy_5b_Y.mjs +2 -0
  75. package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-Bosx7U1h.mjs} +20 -19
  76. package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DcbL_LW_.mjs} +8 -8
  77. package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-WfTZ8K6o.mjs} +7 -7
  78. package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-DbKtQb_4.mjs} +73 -38
  79. package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-dyFUof0t.mjs} +1 -1
  80. package/dist/platform-discovery-BC0HCKYt.mjs +41 -0
  81. package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-Bsq43AJp.mjs} +5 -4
  82. package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle--5gWmDoI.mjs} +1 -1
  83. package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Cfi0o6xM.mjs} +4605 -3527
  84. package/dist/platform-management-Bbwf6-Dq.mjs +2 -0
  85. package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BrF9STZp.mjs} +211 -31
  86. package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-DU-8nC2Y.mjs} +3 -3
  87. package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-DQAqAQYu.mjs} +3 -3
  88. package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-P387v42A.mjs} +18 -11
  89. package/dist/prepare-BBknoZI1.mjs +2 -0
  90. package/dist/{prepare-CBLT3CHH.mjs → prepare-BMrRWLwP.mjs} +3 -4
  91. package/dist/{prepare-DnaKBi--.mjs → prepare-WoUubFKL.mjs} +1 -1
  92. package/dist/{project-DsblYifa.mjs → project-BiaPQ7ur.mjs} +1 -1
  93. package/dist/{project-DKG5Ra8p.mjs → project-DQstYTxO.mjs} +1 -1
  94. package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-BbH2LptN.mjs} +21 -22
  95. package/dist/{project-team-BmHcaALJ.mjs → project-team-Yiww3-go.mjs} +8 -9
  96. package/dist/{project-token-GionZlBI.mjs → project-token-BrtT2NkY.mjs} +6 -9
  97. package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-nYJ2V2nc.mjs} +5 -6
  98. package/dist/{prompts-BNUoTiaf.mjs → prompts-6OSVA7DJ.mjs} +58 -15
  99. package/dist/{prompts-2TGE6oXx.mjs → prompts-ZAuJlyCj.mjs} +1 -1
  100. package/dist/{protocol-CjF_iI9X.d.mts → protocol-BX8t2jiw.d.mts} +1 -1
  101. package/dist/{provision-CVku1JFU.mjs → provision-DMTPG8Rh.mjs} +1 -1
  102. package/dist/{provision-CaoxO_U7.mjs → provision-VeqAC77A.mjs} +18 -8
  103. package/dist/{requests-BOjIVAeF.mjs → requests-TIz_jtSu.mjs} +5 -6
  104. package/dist/{rollback-CwR3pLj3.mjs → rollback-dBqICPzj.mjs} +9 -10
  105. package/dist/{runner-Ol0TNjk6.mjs → runner--2KF6Kua.mjs} +1 -1
  106. package/dist/{runner-CXA9Fh8h.mjs → runner-voIltZrY.mjs} +1 -1
  107. package/dist/runtime/ai.d.mts +10 -11
  108. package/dist/runtime/ai.mjs +13 -18
  109. package/dist/runtime/client-react.mjs +1 -1
  110. package/dist/runtime/client-solid.mjs +1 -1
  111. package/dist/runtime/client-svelte.mjs +1 -1
  112. package/dist/runtime/client-vue.mjs +1 -1
  113. package/dist/runtime/client.mjs +1 -1
  114. package/dist/runtime/email/testing.mjs +1 -1
  115. package/dist/runtime/email.mjs +35 -17
  116. package/dist/runtime/env-public.d.mts +1 -1
  117. package/dist/runtime/fetch-stream.mjs +1 -1
  118. package/dist/runtime/handler.d.mts +1 -1
  119. package/dist/runtime/limits.d.mts +2 -2
  120. package/dist/runtime/limits.mjs +2 -2
  121. package/dist/runtime/live-client.d.mts +1 -1
  122. package/dist/runtime/live.d.mts +1 -1
  123. package/dist/runtime/migration-handler.mjs +33 -7
  124. package/dist/runtime/routing.d.mts +1 -1
  125. package/dist/runtime/routing.mjs +1 -1
  126. package/dist/runtime/sandbox.d.mts +1 -1
  127. package/dist/runtime/sandbox.mjs +12 -22
  128. package/dist/runtime/validator.d.mts +1 -1
  129. package/dist/runtime/ws-server.d.mts +1 -1
  130. package/dist/runtime/ws.d.mts +1 -1
  131. package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
  132. package/dist/{scan-C7okrLyM.mjs → scan-C8dA7iM4.mjs} +10 -6
  133. package/dist/{secret-ByWJWBUG.mjs → secret-AKnNXNP5.mjs} +15 -16
  134. package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
  135. package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-B6WS9Aoz.mjs} +2 -2
  136. package/dist/sveltekit.d.mts +1 -1
  137. package/dist/sveltekit.mjs +4 -9
  138. package/dist/validate-pna7R3Pv.mjs +2 -0
  139. package/dist/{validate-ctOrgiS3.mjs → validate-ymhap6M_.mjs} +1 -1
  140. package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
  141. package/dist/{ws-CL1w7GXU.d.mts → ws-C79j4aED.d.mts} +1 -1
  142. package/package.json +21 -21
  143. package/sandbox.Dockerfile +1 -1
  144. package/skills/void/SKILL.md +5 -2
  145. package/skills/void/docs/guide/ai.md +78 -137
  146. package/skills/void/docs/guide/app-types.md +1 -1
  147. package/skills/void/docs/guide/auth.md +0 -2
  148. package/skills/void/docs/guide/database/d1.md +7 -7
  149. package/skills/void/docs/guide/database.md +15 -0
  150. package/skills/void/docs/guide/deployment.md +58 -124
  151. package/skills/void/docs/guide/env-vars.md +1 -5
  152. package/skills/void/docs/guide/index.md +19 -18
  153. package/skills/void/docs/guide/kv.md +0 -2
  154. package/skills/void/docs/guide/live.md +2 -0
  155. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
  156. package/skills/void/docs/guide/pages-routing/overview.md +2 -2
  157. package/skills/void/docs/guide/platform/administration/email.md +0 -2
  158. package/skills/void/docs/guide/platform/administration/operations.md +11 -22
  159. package/skills/void/docs/guide/platform/administration/plans.md +1 -5
  160. package/skills/void/docs/guide/platform/administration/zero-trust.md +1 -4
  161. package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
  162. package/skills/void/docs/guide/platform/installation/credentials.md +2 -2
  163. package/skills/void/docs/guide/platform/installation/first-deployment.md +5 -1
  164. package/skills/void/docs/guide/platform/installation/maintenance.md +33 -11
  165. package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
  166. package/skills/void/docs/guide/platform/installation/setup.md +1 -1
  167. package/skills/void/docs/guide/platform/installation/uninstall.md +44 -11
  168. package/skills/void/docs/guide/quickstart.md +37 -80
  169. package/skills/void/docs/guide/sandboxes.md +75 -66
  170. package/skills/void/docs/guide/self-hosted-platform.md +20 -0
  171. package/skills/void/docs/guide/websockets.md +0 -2
  172. package/skills/void/docs/integrations/frameworks/overview.md +2 -2
  173. package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
  174. package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
  175. package/skills/void/docs/reference/api/resources.md +38 -14
  176. package/skills/void/docs/reference/api.md +35 -34
  177. package/skills/void/docs/reference/cli/auth.md +3 -1
  178. package/skills/void/docs/reference/cli/deploy.md +1 -1
  179. package/skills/void/docs/reference/cli/platform-config.md +2 -2
  180. package/skills/void/docs/reference/cli/platform-installation.md +14 -12
  181. package/skills/void/docs/reference/cli/platform-operations.md +4 -8
  182. package/skills/void/docs/reference/cli/platform.md +9 -2
  183. package/skills/void/docs/reference/cli.md +1 -1
  184. package/skills/void/docs/reference/resource-inference.md +12 -8
  185. package/dist/cf-build-output-_0HNWysu.mjs +0 -2
  186. package/dist/client-B9UBI03V.mjs +0 -2
  187. package/dist/deploy-irP5q0-x.mjs +0 -2
  188. package/dist/gen-DvQTWzDU.mjs +0 -2
  189. package/dist/help-mabuIV98.mjs +0 -2
  190. package/dist/login-DIy9Sb-U.mjs +0 -2
  191. package/dist/migrate-BCiJ8w0f.mjs +0 -2
  192. package/dist/plan-D1Q5rf-r.mjs +0 -2
  193. package/dist/platform-args-DdnM6WIf.mjs +0 -2
  194. package/dist/platform-management-DG47jys8.mjs +0 -2
  195. package/dist/prepare-CnjcTV2s.mjs +0 -2
  196. package/dist/validate-Dq_L3s0S.mjs +0 -2
  197. package/skills/void/docs/guide/env-migration.md +0 -109
  198. package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
  199. package/dist/{env-validation-C_8tPdhs.mjs → env-validation-vBSQ8gw5.mjs} +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as cfAccessHeaders } from "../cf-access-TWNzXltp.mjs";
2
2
  import { a as getRawRuntimeEnv } from "../env-raw-Cx8ElDdj.mjs";
3
- import { a as readUsageLimit, i as limitOperation, r as limitFromResponse, t as UsageLimit } from "../limits-Cjuk2VPm.mjs";
3
+ import { r as limitFromResponse, t as UsageLimit } from "../limits-D0vD1M9A.mjs";
4
4
  //#region src/runtime/ai-types.ts
5
5
  /** Maps provider prefix to expected env var name for the API key */
6
6
  const PROVIDER_KEY_MAP = {
@@ -491,19 +491,20 @@ function backend() {
491
491
  return _backend ??= resolveBackend();
492
492
  }
493
493
  /** Normalize provider 429 responses and binding quota failures before they reach callers. */
494
- function aiOperation(execute, rawStream = false) {
495
- return limitOperation(async () => {
496
- const value = await execute();
494
+ async function aiOperation(execute, rawStream = false) {
495
+ let value;
496
+ try {
497
+ value = await execute();
497
498
  if (value instanceof Response) {
498
499
  const limit = await limitFromResponse(value, "ai");
499
500
  if (limit) throw limit;
500
501
  }
501
- return value;
502
- }, classifyAiLimit, (value, limited) => {
503
- if (value instanceof Response && value.body && value.headers.get("content-type")?.includes("text/event-stream")) return new Response(streamResponse(value.body, limited).body, value);
504
- if (rawStream && value instanceof ReadableStream) return streamResponse(value, limited).body;
505
- return value;
506
- });
502
+ } catch (error) {
503
+ throw classifyAiLimit(error) ?? error;
504
+ }
505
+ if (value instanceof Response && value.body && value.headers.get("content-type")?.includes("text/event-stream")) return new Response(streamResponse(value.body).body, value);
506
+ if (rawStream && value instanceof ReadableStream) return streamResponse(value).body;
507
+ return value;
507
508
  }
508
509
  function classifyAiLimit(error) {
509
510
  if (error instanceof UsageLimit) return error;
@@ -515,7 +516,7 @@ function classifyAiLimit(error) {
515
516
  }) : null;
516
517
  }
517
518
  /** Streaming failures after headers are sent end with an explicit terminal SSE event. */
518
- function streamResponse(body, limited) {
519
+ function streamResponse(body) {
519
520
  const reader = body.getReader();
520
521
  return new Response(new ReadableStream({
521
522
  async pull(controller) {
@@ -526,13 +527,7 @@ function streamResponse(body, limited) {
526
527
  } catch (error) {
527
528
  const limit = classifyAiLimit(error);
528
529
  let data = { message: "Generation was interrupted. Please try again." };
529
- if (limit) {
530
- data = await limit.response().json();
531
- try {
532
- const fallback = await limited(limit);
533
- if (fallback instanceof Response) data = readUsageLimit(await fallback.json().catch(() => null)) ?? data;
534
- } catch {}
535
- }
530
+ if (limit) data = await limit.response().json();
536
531
  controller.enqueue(new TextEncoder().encode(`event: ${limit ? "void:limit" : "void:error"}\ndata: ${JSON.stringify(data)}\n\n`));
537
532
  controller.close();
538
533
  }
@@ -1,5 +1,5 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
2
  import { t as fetch } from "../fetch-BIZJh7vR.mjs";
3
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
3
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
4
4
  import { n as createAuthClient, t as auth } from "../auth-client-react-CMLwT2xI.mjs";
5
5
  export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
@@ -1,5 +1,5 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
2
  import { t as fetch } from "../fetch-BIZJh7vR.mjs";
3
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
3
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
4
4
  import { n as createAuthClient, t as auth } from "../auth-client-solid-UoreJWZG.mjs";
5
5
  export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
@@ -1,5 +1,5 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
2
  import { t as fetch } from "../fetch-BIZJh7vR.mjs";
3
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
3
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
4
4
  import { n as createAuthClient, t as auth } from "../auth-client-svelte-Cv_WvrRk.mjs";
5
5
  export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
@@ -1,5 +1,5 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
2
  import { t as fetch } from "../fetch-BIZJh7vR.mjs";
3
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
3
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
4
4
  import { n as createAuthClient, t as auth } from "../auth-client-vue-CFk7Xbv3.mjs";
5
5
  export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
@@ -1,5 +1,5 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
2
  import { t as fetch } from "../fetch-BIZJh7vR.mjs";
3
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
3
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
4
4
  import { n as createAuthClient, t as auth } from "../auth-client-BWBT8HLp.mjs";
5
5
  export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
@@ -1,6 +1,6 @@
1
1
  import { i as normalizeEmail, r as buildMime } from "../../mime-D5Nmdzf7.mjs";
2
2
  import { n as compileEmailPattern, t as compareEmailRoutes } from "../../email--tEtMoj_.mjs";
3
- import { y as registerEmailSink } from "../../dev-inbox-P0u4tM8Y.mjs";
3
+ import { y as registerEmailSink } from "../../dev-inbox-D64ZKUod.mjs";
4
4
  import { i as createMessageProxy, n as MAX_INBOUND_HEADERS, t as MAX_INBOUND_BYTES } from "../../inbound-fRkqcXaC.mjs";
5
5
  //#region src/runtime/email/testing.ts
6
6
  /**
@@ -1,7 +1,8 @@
1
1
  import { i as normalizeEmail, n as MimeError, r as buildMime } from "../mime-D5Nmdzf7.mjs";
2
- import { a as DEV_INBOX_ENV_VAR, b as serializeCapturedMessage, c as DEV_INBOX_TOKEN_ENV_VAR, d as captureMessage, h as hasActiveSink, i as DEV_INBOX_CAPTURE_URL, p as dispatchToSinks } from "../dev-inbox-P0u4tM8Y.mjs";
2
+ import { a as DEV_INBOX_ENV_VAR, b as serializeCapturedMessage, c as DEV_INBOX_TOKEN_ENV_VAR, d as captureMessage, h as hasActiveSink, i as DEV_INBOX_CAPTURE_URL, p as dispatchToSinks } from "../dev-inbox-D64ZKUod.mjs";
3
3
  import { a as getRawRuntimeEnv } from "../env-raw-Cx8ElDdj.mjs";
4
4
  import { a as defineEmail, c as parseEmail, i as createMessageProxy, l as replyEmail, o as enactEmailActions, r as ParseEmailError, s as isForwardableEmailMessage } from "../inbound-fRkqcXaC.mjs";
5
+ import { isRecord } from "@void/deploy-core";
5
6
  //#region src/runtime/email.ts
6
7
  const VALID_SLUG = /^[a-z0-9](?:[a-z0-9-]{0,54}[a-z0-9])?$/;
7
8
  function makeError(code, message, cause) {
@@ -232,7 +233,7 @@ function coerceErrorCode(code) {
232
233
  "IDEMPOTENCY_CONFLICT",
233
234
  "OUTCOME_UNKNOWN",
234
235
  "UPSTREAM_ERROR"
235
- ].includes(code) ? code : "UPSTREAM_ERROR";
236
+ ].find((knownCode) => knownCode === code) ?? "UPSTREAM_ERROR";
236
237
  }
237
238
  /**
238
239
  * The text of a refusal the proxy's middleware sent instead of a send
@@ -247,13 +248,30 @@ function readProxyRefusal(body) {
247
248
  if (typeof error !== "string" || error === "") return null;
248
249
  return typeof message === "string" && message !== "" ? message : error;
249
250
  }
250
- function isValidProxyResponse(b) {
251
- if (typeof b !== "object" || b === null) return false;
252
- const r = b;
253
- if (r.ok === true && Array.isArray(r.ids)) return true;
254
- if (r.ok === false && typeof r.error === "object" && r.error !== null) return true;
255
- if (r.ok === false && Array.isArray(r.deliveries)) return true;
256
- return false;
251
+ function readProxyResponse(value) {
252
+ if (!isRecord(value)) return null;
253
+ const operationId = value.operationId;
254
+ if (value.ok === true && Array.isArray(value.ids)) return {
255
+ ok: true,
256
+ ids: value.ids,
257
+ operationId
258
+ };
259
+ if (value.ok !== false) return null;
260
+ if (Array.isArray(value.deliveries)) return {
261
+ ok: false,
262
+ deliveries: value.deliveries,
263
+ operationId
264
+ };
265
+ const error = value.error;
266
+ if (typeof error === "object" && error !== null) return {
267
+ ok: false,
268
+ error: {
269
+ code: "code" in error ? error.code : void 0,
270
+ message: "message" in error ? error.message : void 0
271
+ },
272
+ operationId
273
+ };
274
+ return null;
257
275
  }
258
276
  /**
259
277
  * Require exactly one valid outcome per requested recipient in either list
@@ -410,31 +428,31 @@ async function readResponseAsResult(res, recipients, fallbackId, beforeDeadline)
410
428
  } catch {
411
429
  return err("OUTCOME_UNKNOWN", `email: could not establish the send outcome (status ${res.status}); check email logs or repeat the same idempotency key`);
412
430
  }
413
- if (!isValidProxyResponse(body)) {
431
+ const response = readProxyResponse(body);
432
+ if (response === null) {
414
433
  const refusal = readProxyRefusal(body);
415
434
  if (!res.ok && refusal !== null) return err("UPSTREAM_ERROR", `email: proxy returned ${res.status}: ${refusal}`, body);
416
435
  return err("OUTCOME_UNKNOWN", `email: proxy returned malformed response (status ${res.status})`, body);
417
436
  }
418
437
  const malformedList = (reason) => err("OUTCOME_UNKNOWN", `email: proxy returned a malformed delivery list (${reason}); do not retry with a new idempotency key`, body);
419
- const operation = typeof body.operationId === "string" && body.operationId.length <= 128 ? { operationId: body.operationId } : {};
420
- if (body.ok === true) {
421
- const list = readDeliveryList(body.ids, recipients, fallbackId);
438
+ const operation = typeof response.operationId === "string" && response.operationId.length <= 128 ? { operationId: response.operationId } : {};
439
+ if (response.ok === true) {
440
+ const list = readDeliveryList(response.ids, recipients, fallbackId);
422
441
  return list.ok ? {
423
442
  ok: true,
424
443
  ids: list.entries,
425
444
  ...operation
426
445
  } : malformedList(list.reason);
427
446
  }
428
- const failure = body;
429
- if (Array.isArray(failure.deliveries)) {
430
- const list = readFailureDeliveries(failure.deliveries, recipients, fallbackId);
447
+ if ("deliveries" in response) {
448
+ const list = readFailureDeliveries(response.deliveries, recipients, fallbackId);
431
449
  return list.ok ? {
432
450
  ok: false,
433
451
  deliveries: list.entries,
434
452
  ...operation
435
453
  } : malformedList(list.reason);
436
454
  }
437
- const e = failure.error;
455
+ const e = response.error;
438
456
  return {
439
457
  ...err(coerceErrorCode(e.code), typeof e.message === "string" ? e.message : "email: upstream send failed"),
440
458
  ...operation
@@ -1,4 +1,4 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
2
  import { a as number, c as url, i as json, n as boolean, o as oneOf, r as email, s as string, t as EnvSchema } from "../env-helpers-CyKtOBpj.mjs";
3
- import { a as _getSchemaDefaults, c as defineEnv, i as _getRegisteredSchema, l as env, n as EnvValidationReport, o as _hasRegisteredSchema, r as ValidatedEnv, s as _validateEnvOnce, t as EnvValidationError, u as validateAllEnv } from "../env-public-BX_r8HR6.mjs";
3
+ import { a as _getSchemaDefaults, c as defineEnv, i as _getRegisteredSchema, l as env, n as EnvValidationReport, o as _hasRegisteredSchema, r as ValidatedEnv, s as _validateEnvOnce, t as EnvValidationError, u as validateAllEnv } from "../env-public-DR7ZM6d-.mjs";
4
4
  export { type EnvSchema, EnvValidationError, EnvValidationReport, ValidatedEnv, _getRegisteredSchema, _getSchemaDefaults, _hasRegisteredSchema, _validateEnvOnce, boolean, defineEnv, email, env, json, number, oneOf, string, url, validateAllEnv };
@@ -1,3 +1,3 @@
1
1
  import { t as FetchError } from "../fetch-error-Dj3crt0e.mjs";
2
- import { t as fetchStream } from "../fetch-stream-IvCYKyQL.mjs";
2
+ import { t as fetchStream } from "../fetch-stream-Nm3hkZbT.mjs";
3
3
  export { FetchError as StreamError, fetchStream };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
- import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-CZ4nAylQ.mjs";
2
+ import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, n as CloudBindings, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, w as ValidationError, y as defineScheduled } from "../handler-BeK3weD4.mjs";
3
3
  export { BasicAuthOptions, CloudBindings, CloudContext, CloudContextVariables, CloudEnv, type Deferred, type HandlerInput, type InferProps, QueueBatch, QueueMessage, QueueRetryOptions, RenderAssetTags, TypedHandler, TypedQueueHandler, ValidationError, type ValidatorSlots, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
@@ -1,2 +1,2 @@
1
- import { a as asUsageLimit, c as readUsageLimit, i as UsageLimitData, n as LimitOperation, o as limitFromResponse, r as UsageLimit, s as limitOperation, t as LimitHandlers } from "../limits-Bq5LG8Id.mjs";
2
- export { LimitHandlers, LimitOperation, UsageLimit, type UsageLimitData, asUsageLimit, limitFromResponse, limitOperation, readUsageLimit };
1
+ import { a as readUsageLimit, i as limitFromResponse, n as UsageLimitData, r as asUsageLimit, t as UsageLimit } from "../limits-CFsDKQvU.mjs";
2
+ export { UsageLimit, type UsageLimitData, asUsageLimit, limitFromResponse, readUsageLimit };
@@ -1,2 +1,2 @@
1
- import { a as readUsageLimit, i as limitOperation, n as asUsageLimit, r as limitFromResponse, t as UsageLimit } from "../limits-Cjuk2VPm.mjs";
2
- export { UsageLimit, asUsageLimit, limitFromResponse, limitOperation, readUsageLimit };
1
+ import { i as readUsageLimit, n as asUsageLimit, r as limitFromResponse, t as UsageLimit } from "../limits-D0vD1M9A.mjs";
2
+ export { UsageLimit, asUsageLimit, limitFromResponse, readUsageLimit };
@@ -1,4 +1,4 @@
1
- import { t as LiveClientEvent } from "../live-Chw1eIMv.mjs";
1
+ import { t as LiveClientEvent } from "../live-iAuEH1hd.mjs";
2
2
  //#region src/runtime/live-client.d.ts
3
3
  export type LiveSubscribeOptions<Data = unknown> = {
4
4
  id: string;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
- import { _ as __getLiveBindingName, a as LiveControlErrorCode, c as LiveControlOptions, d as LiveHookContext, f as LiveLimits, g as LiveSubscribeHookContext, h as LiveStreamOptions, i as LiveControlError, l as LiveControlRequest, m as LiveStream, n as LiveConnectHookContext, o as LiveControlOperation, p as LivePublishOptions, r as LiveConnectOptions, s as LiveControlOperationResult, t as LiveClientEvent, u as LiveControlResponse, v as __setLiveBindingName, y as defineLiveStream } from "../live-Chw1eIMv.mjs";
2
+ import { _ as __getLiveBindingName, a as LiveControlErrorCode, c as LiveControlOptions, d as LiveHookContext, f as LiveLimits, g as LiveSubscribeHookContext, h as LiveStreamOptions, i as LiveControlError, l as LiveControlRequest, m as LiveStream, n as LiveConnectHookContext, o as LiveControlOperation, p as LivePublishOptions, r as LiveConnectOptions, s as LiveControlOperationResult, t as LiveClientEvent, u as LiveControlResponse, v as __setLiveBindingName, y as defineLiveStream } from "../live-iAuEH1hd.mjs";
3
3
  export { LiveClientEvent, LiveConnectHookContext, LiveConnectOptions, LiveControlError, LiveControlErrorCode, LiveControlOperation, LiveControlOperationResult, LiveControlOptions, LiveControlRequest, LiveControlResponse, LiveHookContext, LiveLimits, LivePublishOptions, LiveStream, LiveStreamOptions, LiveSubscribeHookContext, __getLiveBindingName, __setLiveBindingName, defineLiveStream };
@@ -1,4 +1,4 @@
1
- import { canonicalJson } from "@void/deploy-core";
1
+ import { canonicalJson, splitSqlStatements } from "@void/deploy-core";
2
2
  //#region src/runtime/migration-handler.ts
3
3
  const SUPPORTED_CLASSIFIER_VERSION = 1;
4
4
  function createMigrationHandler(env, migrations, _dialect, runAuthMigrations, planBundle) {
@@ -139,12 +139,13 @@ async function runD1AppMigrations(db, migrations, planBundle, attempt) {
139
139
  const migrationResults = [];
140
140
  const confirmedApplied = [];
141
141
  const confirmedSkipped = [];
142
- const warnings = verified.plans.flatMap((plan) => plan.warnings ?? []);
142
+ let warnings = verified.plans.flatMap((plan) => plan.warnings ?? []);
143
143
  let stability = "stable";
144
144
  try {
145
145
  await createTrackingTable(db);
146
146
  await upgradeTrackingTable(db, fenced ? attempt.attemptId : void 0);
147
147
  const applied = await readAppliedSet(db);
148
+ warnings = verified.plans.flatMap((plan, index) => applied.has(migrations[index].name) ? [] : plan.warnings ?? []);
148
149
  for (let index = 0; index < migrations.length; index++) {
149
150
  const migration = migrations[index];
150
151
  const plan = verified.plans[index];
@@ -274,8 +275,26 @@ async function executeMigrationPlan(db, migration, plan, fencedAttemptId) {
274
275
  ]);
275
276
  return;
276
277
  }
278
+ await runUnsplitMigration(db, migration, appliedAt, fencedAttemptId);
279
+ }
280
+ /**
281
+ * D1 `exec()` treats each line as its own statement, so multi-line statements
282
+ * fail there. Run each top-level statement through one batch instead, and keep
283
+ * `exec()` only for SQL the splitter cannot divide safely (trigger bodies).
284
+ */
285
+ async function runUnsplitMigration(db, migration, appliedAt, fencedAttemptId) {
286
+ const record = db.prepare("INSERT OR IGNORE INTO _void_migrations (name, applied_at) VALUES (?, ?)").bind(migration.name, appliedAt);
287
+ const statements = splitSqlStatements(migration.sql);
288
+ if (statements) {
289
+ await db.batch([
290
+ ...ownershipFence(db, fencedAttemptId),
291
+ ...statements.map((statement) => db.prepare(statement)),
292
+ record
293
+ ]);
294
+ return;
295
+ }
277
296
  await db.exec(migration.sql);
278
- await db.prepare("INSERT OR IGNORE INTO _void_migrations (name, applied_at) VALUES (?, ?)").bind(migration.name, appliedAt).run();
297
+ await record.run();
279
298
  }
280
299
  /** Fail the whole D1 batch if recovery has revoked this executor's ownership. */
281
300
  function ownershipFence(db, attemptId) {
@@ -393,10 +412,14 @@ async function runD1LegacyMigrations(db, migrations) {
393
412
  try {
394
413
  const statements = splitMigrationSql(migration.sql);
395
414
  if (statements.length === 1) {
396
- if (isSingleSqlStatement(statements[0])) await db.prepare(statements[0]).run();
397
- else await db.exec(migration.sql);
398
- } else for (const statement of statements) await db.prepare(statement).run();
399
- await db.prepare("INSERT OR IGNORE INTO _void_migrations (name, applied_at) VALUES (?, ?)").bind(migration.name, (/* @__PURE__ */ new Date()).toISOString()).run();
415
+ if (isSingleSqlStatement(statements[0])) {
416
+ await db.prepare(statements[0]).run();
417
+ await recordLegacyMigration(db, migration.name);
418
+ } else await runUnsplitMigration(db, migration, (/* @__PURE__ */ new Date()).toISOString());
419
+ } else {
420
+ for (const statement of statements) await db.prepare(statement).run();
421
+ await recordLegacyMigration(db, migration.name);
422
+ }
400
423
  migrationResults.push({
401
424
  name: migration.name,
402
425
  applied: true,
@@ -421,6 +444,9 @@ async function runD1LegacyMigrations(db, migrations) {
421
444
  migrations: migrationResults
422
445
  };
423
446
  }
447
+ async function recordLegacyMigration(db, name) {
448
+ await db.prepare("INSERT OR IGNORE INTO _void_migrations (name, applied_at) VALUES (?, ?)").bind(name, (/* @__PURE__ */ new Date()).toISOString()).run();
449
+ }
424
450
  function splitMigrationSql(sql) {
425
451
  const lines = sql.split(/\r?\n/);
426
452
  if (!lines.some((line) => isStatementBreakpointLine(line) || hasInlineStatementBreakpoint(line))) return [sql];
@@ -1,5 +1,5 @@
1
1
  import { t as DevCssAsset } from "../types-BAp5AEBU.mjs";
2
- import { a as handlePageMutation, i as handlePageGet } from "../protocol-CjF_iI9X.mjs";
2
+ import { a as handlePageMutation, i as handlePageGet } from "../protocol-BX8t2jiw.mjs";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { Context, ExecutionContext, Hono, MiddlewareHandler } from "hono";
5
5
  //#region src/runtime/routing-errors.d.ts
@@ -1,8 +1,8 @@
1
1
  import { t as convertReturnValue } from "../response-Tn7rU0MV.mjs";
2
2
  import { t as VoidAssetRewriteError } from "../handler-DghKr6dU.mjs";
3
3
  import { n as handlePageGet, r as handlePageMutation } from "../protocol-U7bfjHmA.mjs";
4
- import { compilePattern, mergeQueryIntoLocation, substituteParams } from "@void/edge";
5
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
+ import { compilePattern, mergeQueryIntoLocation, substituteParams } from "@void/edge";
6
6
  //#region src/runtime/routing-errors.ts
7
7
  const __VOID_ERROR_PAGE_FONT_STACK = "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
8
8
  const errorStack = Error;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@cloudflare/workers-types" />
2
2
  import { i as SandboxExecOptions, s as SandboxOptions } from "../sandbox-container-Bo0eiFKz.mjs";
3
- import { a as SandboxFiles, c as SandboxUnavailableError, d as __setSandboxBindingName, f as getSandbox, i as SandboxClient, l as VoidPlatformSandbox, n as DEFAULT_SANDBOX_ID, o as SandboxLimitError, p as sandbox, r as SANDBOX_SERVICE_BINDING, s as SandboxProcess, t as DEFAULT_SANDBOX_BINDING, u as VoidSandboxOptions } from "../sandbox-XZAqzFlG.mjs";
3
+ import { a as SandboxFiles, c as SandboxUnavailableError, d as __setSandboxBindingName, f as getSandbox, i as SandboxClient, l as VoidPlatformSandbox, n as DEFAULT_SANDBOX_ID, o as SandboxLimitError, p as sandbox, r as SANDBOX_SERVICE_BINDING, s as SandboxProcess, t as DEFAULT_SANDBOX_BINDING, u as VoidSandboxOptions } from "../sandbox-C5LFoJMf.mjs";
4
4
  export * from "@cloudflare/sandbox";
5
5
  export { DEFAULT_SANDBOX_BINDING, DEFAULT_SANDBOX_ID, SANDBOX_SERVICE_BINDING, SandboxClient, type SandboxExecOptions, SandboxFiles, SandboxLimitError, type SandboxOptions, SandboxProcess, SandboxUnavailableError, VoidPlatformSandbox, VoidSandboxOptions, __setSandboxBindingName, getSandbox, sandbox };
@@ -1,6 +1,6 @@
1
1
  import { a as getRawRuntimeEnv } from "../env-raw-Cx8ElDdj.mjs";
2
+ import { t as UsageLimit } from "../limits-D0vD1M9A.mjs";
2
3
  import { a as requireRuntimeBinding } from "../env-D5liuQYR.mjs";
3
- import { i as limitOperation, t as UsageLimit } from "../limits-Cjuk2VPm.mjs";
4
4
  import { n as SandboxContainer, r as validateSandboxOptions } from "../sandbox-container-C6ItmVuN.mjs";
5
5
  export * from "@cloudflare/sandbox";
6
6
  //#region src/runtime/sandbox.ts
@@ -95,7 +95,7 @@ function client(capability) {
95
95
  if (typeof method !== "string" || method === "then") return;
96
96
  return (...args) => {
97
97
  const index = method === "writeFile" || method === "rename" ? 3 : 2;
98
- return limitOperation(() => callWithOptions("files", [method, ...args], index));
98
+ return callWithOptions("files", [method, ...args], index);
99
99
  };
100
100
  } });
101
101
  const execute = async (argv, options) => {
@@ -109,26 +109,21 @@ function client(capability) {
109
109
  stdout: wire.stdout,
110
110
  stderr: wire.stderr,
111
111
  get exitCode() {
112
- return exitCode ??= limitOperation(async () => {
112
+ return exitCode ??= (async () => {
113
113
  try {
114
114
  return await wire.capability.invoke("exitCode", []);
115
115
  } catch (error) {
116
116
  rethrowSandboxError(error);
117
117
  }
118
- });
118
+ })();
119
119
  },
120
120
  output() {
121
- return output ??= limitOperation(async () => {
121
+ return output ??= (async () => {
122
122
  try {
123
123
  return await Promise.all([
124
124
  wire.stdout ? new Response(wire.stdout).arrayBuffer() : /* @__PURE__ */ new ArrayBuffer(0),
125
125
  wire.stderr ? new Response(wire.stderr).arrayBuffer() : /* @__PURE__ */ new ArrayBuffer(0),
126
- process.exitCode.match({
127
- ok: (code) => code,
128
- limited: (limit) => {
129
- throw limit;
130
- }
131
- })
126
+ process.exitCode
132
127
  ]).then(([stdout, stderr, exitCode]) => ({
133
128
  stdout,
134
129
  stderr,
@@ -137,7 +132,7 @@ function client(capability) {
137
132
  } catch (error) {
138
133
  rethrowSandboxError(error);
139
134
  }
140
- });
135
+ })();
141
136
  },
142
137
  kill: async (signal) => {
143
138
  await wire.capability.invoke("kill", [signal]);
@@ -150,16 +145,11 @@ function client(capability) {
150
145
  };
151
146
  return {
152
147
  files,
153
- exec: (argv, options) => limitOperation(() => execute(argv, options)),
154
- run: (argv, options) => limitOperation(async () => {
155
- return (await execute(argv, options)).output().match({
156
- ok: (result) => result,
157
- limited: (limit) => {
158
- throw limit;
159
- }
160
- });
161
- }),
162
- fetch: (port, request) => limitOperation(async () => await call("fetch", [port, request])),
148
+ exec: execute,
149
+ run: async (argv, options) => {
150
+ return (await execute(argv, options)).output();
151
+ },
152
+ fetch: async (port, request) => await call("fetch", [port, request]),
163
153
  running: async () => await call("running", []),
164
154
  destroy: async () => {
165
155
  await call("destroy", []);
@@ -1,2 +1,2 @@
1
- import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-CZ4nAylQ.mjs";
1
+ import { D as runValidation, E as ValidatorSlots, T as HandlerInput } from "../handler-BeK3weD4.mjs";
2
2
  export { HandlerInput, ValidatorSlots, runValidation };
@@ -1,6 +1,6 @@
1
1
  import { n as AuthState } from "../auth-DkcFflXV.mjs";
2
2
  import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv } from "../better-auth-shared-BVkjZ3vM.mjs";
3
- import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws-CL1w7GXU.mjs";
3
+ import { f as WebSocketInstanceKey, t as AnyWebSocketDefinition } from "../ws-C79j4aED.mjs";
4
4
  //#region src/runtime/ws-server.d.ts
5
5
  export type WebSocketRouteMeta = {
6
6
  name?: string;
@@ -1,2 +1,2 @@
1
- import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws-CL1w7GXU.mjs";
1
+ import { a as RoomDefinition, c as VoidSocket, d as WebSocketConnection, f as WebSocketInstanceKey, h as defineWebSocket, i as RoomController, l as VoidSocketCloseEvent, m as defineRoom, n as ConnectCommonOptions, o as SocketContext, p as connect, r as RoomContext, s as SocketDefinition, t as AnyWebSocketDefinition, u as WebSocketBaseContext } from "../ws-C79j4aED.mjs";
2
2
  export { AnyWebSocketDefinition, ConnectCommonOptions, RoomContext, RoomController, RoomDefinition, SocketContext, SocketDefinition, VoidSocket, VoidSocketCloseEvent, WebSocketBaseContext, WebSocketConnection, WebSocketInstanceKey, connect, defineRoom, defineWebSocket };
@@ -1,4 +1,4 @@
1
- import { n as LimitOperation, r as UsageLimit } from "./limits-Bq5LG8Id.mjs";
1
+ import { t as UsageLimit } from "./limits-CFsDKQvU.mjs";
2
2
  import { i as SandboxExecOptions, r as SandboxContainer, s as SandboxOptions } from "./sandbox-container-Bo0eiFKz.mjs";
3
3
  import { Files } from "@cloudflare/sandbox";
4
4
  //#region src/runtime/sandbox.d.ts
@@ -15,17 +15,17 @@ type SandboxProcess = {
15
15
  stdin: WritableStream | null;
16
16
  stdout: ReadableStream | null;
17
17
  stderr: ReadableStream | null;
18
- readonly exitCode: LimitOperation<number>;
19
- output(): LimitOperation<ExecOutput>;
18
+ readonly exitCode: Promise<number>;
19
+ output(): Promise<ExecOutput>;
20
20
  kill(signal?: number): Promise<void>;
21
21
  resize(cols: number, rows: number): Promise<void>;
22
22
  };
23
- type SandboxFiles = { [K in keyof Files]: Files[K] extends ((...args: infer A) => Promise<infer R>) ? (...args: A) => LimitOperation<R> : never; };
23
+ type SandboxFiles = { [K in keyof Files]: Files[K] extends ((...args: infer A) => Promise<infer R>) ? (...args: A) => Promise<R> : never; };
24
24
  type SandboxClient = {
25
- exec(argv: Array<string>, options?: SandboxExecOptions): LimitOperation<SandboxProcess>;
26
- run(argv: Array<string>, options?: SandboxExecOptions): LimitOperation<ExecOutput>;
25
+ exec(argv: Array<string>, options?: SandboxExecOptions): Promise<SandboxProcess>;
26
+ run(argv: Array<string>, options?: SandboxExecOptions): Promise<ExecOutput>;
27
27
  files: SandboxFiles;
28
- fetch(port: number, request: Request): LimitOperation<Response>;
28
+ fetch(port: number, request: Request): Promise<Response>;
29
29
  running(): Promise<boolean>;
30
30
  destroy(): Promise<void>;
31
31
  };
@@ -312,11 +312,15 @@ async function scanPages(root, options) {
312
312
  namedLayouts
313
313
  };
314
314
  }
315
+ const LEADING_SCRIPT_RE = /^<script\b[^>]*>[\s\S]*?<\/script>\s*\n?/;
316
+ /** Return the raw YAML frontmatter of markdown source, after any leading <script> block. */
317
+ function markdownFrontmatter(source) {
318
+ return source.replace(LEADING_SCRIPT_RE, "").match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1];
319
+ }
315
320
  /** Extract title and description from YAML frontmatter in markdown source. */
316
321
  function extractFrontmatterMeta(source) {
317
- const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---/);
318
- if (!match) return;
319
- const yaml = match[1];
322
+ const yaml = markdownFrontmatter(source);
323
+ if (yaml === void 0) return;
320
324
  const title = yaml.match(/^title:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, "");
321
325
  const description = yaml.match(/^description:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, "");
322
326
  if (!title && !description) return;
@@ -327,9 +331,9 @@ function extractFrontmatterMeta(source) {
327
331
  }
328
332
  /** Extract layout field from YAML frontmatter in markdown source. */
329
333
  function extractFrontmatterLayout(source) {
330
- const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---/);
331
- if (!match) return;
332
- const value = match[1].match(/^layout:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, "");
334
+ const yaml = markdownFrontmatter(source);
335
+ if (yaml === void 0) return;
336
+ const value = yaml.match(/^layout:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, "");
333
337
  if (!value) return;
334
338
  if (value === "false") return false;
335
339
  return value;
@@ -1,15 +1,14 @@
1
- import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DKG5Ra8p.mjs";
2
- import { c as getToken } from "./auth-CQkSDS50.mjs";
3
- import { _ as validateSecretValues } from "./env-validation-C_8tPdhs.mjs";
4
- import { A as confirm, B as note, H as outro, L as log, N as intro, O as cancel, U as password, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
5
- import { n as PlatformClient } from "./client-DKAsFA4X.mjs";
6
- import { r as cliTitle } from "./output-CbM85T4k.mjs";
1
+ import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DQstYTxO.mjs";
2
+ import { c as getToken } from "./auth-D52yG7hl.mjs";
3
+ import { _ as validateSecretValues } from "./env-validation-vBSQ8gw5.mjs";
4
+ import { A as confirm, H as outro, L as log, O as cancel, U as password, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
5
+ import { r as PlatformClient } from "./client-mC-dFGDD.mjs";
6
+ import { l as note, o as formatCount } from "./output-BvdaehtE.mjs";
7
7
  import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-BG5ORGID.mjs";
8
8
  import { readFileSync } from "node:fs";
9
9
  //#region src/cli/secret.ts
10
10
  async function runSecretCommand(root, args) {
11
11
  console.log();
12
- intro(cliTitle("secret"));
13
12
  const platform = readDeploymentPlatform(root);
14
13
  if (platform === "cloudflare") return runCloudflareSecretCommand(root, args);
15
14
  if (platform === "none") throw new Error("secret: Deployment is disabled. Run `void init` to choose a platform.");
@@ -38,7 +37,7 @@ async function runSecretCommand(root, args) {
38
37
  return;
39
38
  }
40
39
  note(secrets.map((s) => ` ${s.name}`).join("\n"), "Secrets");
41
- outro(`${secrets.length} secret(s)`);
40
+ outro(formatCount(secrets.length, "secret"));
42
41
  return;
43
42
  }
44
43
  if (args.action === "put") {
@@ -59,9 +58,9 @@ async function runSecretCommand(root, args) {
59
58
  return;
60
59
  }
61
60
  await validateSecretValues(root, secrets);
62
- log.info(`Found ${secrets.length} secret(s):`);
61
+ log.info(`Found ${formatCount(secrets.length, "secret")}:`);
63
62
  for (const s of secrets) log.message(` ${s.name}`);
64
- const proceed = await confirm({ message: `This will overwrite ${secrets.length} secret(s) in the remote environment. Continue?` });
63
+ const proceed = await confirm({ message: `This will overwrite ${formatCount(secrets.length, "secret")} in the remote environment. Continue?` });
65
64
  if (isCancel(proceed) || !proceed) {
66
65
  cancel("Secret sync cancelled.");
67
66
  process.exit(0);
@@ -70,7 +69,7 @@ async function runSecretCommand(root, args) {
70
69
  await client.setSecret(projectId, s.name, s.value);
71
70
  log.success(`Set ${s.name}`);
72
71
  }
73
- outro(`Synced ${secrets.length} secret(s).`);
72
+ outro(`Synced ${formatCount(secrets.length, "secret")}.`);
74
73
  return;
75
74
  }
76
75
  await client.deleteSecret(projectId, args.name);
@@ -78,7 +77,7 @@ async function runSecretCommand(root, args) {
78
77
  }
79
78
  async function runCloudflareSecretCommand(root, args) {
80
79
  if (args.projectName) throw new Error("secret: --project selects a Void platform project and is not used for direct Cloudflare apps.");
81
- const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-BCdXSsmo.mjs");
80
+ const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-DoQrVHAt.mjs");
82
81
  const context = resolveCloudflareOperationContext(root);
83
82
  if (args.action === "list") {
84
83
  const secrets = await listCloudflareSecrets(context);
@@ -87,7 +86,7 @@ async function runCloudflareSecretCommand(root, args) {
87
86
  return;
88
87
  }
89
88
  note(secrets.map((name) => ` ${name}`).join("\n"), "Secrets");
90
- outro(`${secrets.length} secret(s)`);
89
+ outro(formatCount(secrets.length, "secret"));
91
90
  return;
92
91
  }
93
92
  if (args.action === "put") {
@@ -108,15 +107,15 @@ async function runCloudflareSecretCommand(root, args) {
108
107
  return;
109
108
  }
110
109
  await validateSecretValues(root, secrets);
111
- log.info(`Found ${secrets.length} secret(s):`);
110
+ log.info(`Found ${formatCount(secrets.length, "secret")}:`);
112
111
  for (const secret of secrets) log.message(` ${secret.name}`);
113
- const proceed = await confirm({ message: `This will overwrite ${secrets.length} secret(s) in the Cloudflare Worker. Continue?` });
112
+ const proceed = await confirm({ message: `This will overwrite ${formatCount(secrets.length, "secret")} in the Cloudflare Worker. Continue?` });
114
113
  if (isCancel(proceed) || !proceed) {
115
114
  cancel("Secret sync cancelled.");
116
115
  process.exit(0);
117
116
  }
118
117
  await syncCloudflareSecrets(context, secrets);
119
- outro(`Synced ${secrets.length} secret(s).`);
118
+ outro(`Synced ${formatCount(secrets.length, "secret")}.`);
120
119
  return;
121
120
  }
122
121
  await deleteCloudflareSecret(context, args.name);
@@ -1,5 +1,5 @@
1
1
  import { a as join, l as relative } from "./dist-BVqXeR_h.mjs";
2
- import { L as log } from "./prompts-BNUoTiaf.mjs";
2
+ import { L as log } from "./prompts-6OSVA7DJ.mjs";
3
3
  import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, readlinkSync, symlinkSync } from "node:fs";
5
5
  //#region src/cli/skills.ts