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.
- package/README.md +19 -106
- package/dist/{account-cmd-vJhh5lrb.mjs → account-cmd-CDry3B5V.mjs} +5 -5
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DC2yPvzY.mjs} +1 -1
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-C9khgLiS.mjs} +1 -1
- package/dist/{auth-DX3JURcX.mjs → auth-B60QDbjg.mjs} +1 -1
- package/dist/{auth-CQkSDS50.mjs → auth-D52yG7hl.mjs} +3 -3
- package/dist/{auth-link-D75t9wO2.mjs → auth-link-DjeOptYi.mjs} +5 -6
- package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BRxIuqDi.mjs} +7 -7
- package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-Ce3C8huo.mjs} +6 -7
- package/dist/{cache-ZtQmyxVV.mjs → cache-CS8Yxr5a.mjs} +6 -7
- package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-mZsD88Xa.mjs} +4 -6
- package/dist/{cf-access-BGe5sWXF.mjs → cf-access-YTlqvAsk.mjs} +1 -1
- package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
- package/dist/cli/cli.mjs +45 -45
- package/dist/cli/cloudflare-operation-process.mjs +3 -3
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-BxVixJBI.mjs +2 -0
- package/dist/{client-DKAsFA4X.mjs → client-mC-dFGDD.mjs} +103 -25
- package/dist/{cloudflare-cmd-CmY8dGkd.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
- package/dist/{cloudflare-connect-IiR3ZieC.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
- package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-DYa3coIk.mjs} +2 -2
- package/dist/{cloudflare-operations-BCdXSsmo.mjs → cloudflare-operations-DoQrVHAt.mjs} +1 -1
- package/dist/{connect-B-usTnlF.mjs → connect-H6EvP62X.mjs} +12 -9
- package/dist/{create-project-CYOOAYcn.mjs → create-project-B2kk9Q0o.mjs} +6 -6
- package/dist/{create-project-FWbf5Olo.mjs → create-project-Dbb4uiN-.mjs} +1 -1
- package/dist/{db-Ck2eZ2iB.mjs → db-DpCKZto0.mjs} +35 -38
- package/dist/{delete-sK56qtzZ.mjs → delete-CxlSvsvW.mjs} +6 -7
- package/dist/{deploy-gCVaiJbS.mjs → deploy-CeEbnv4b.mjs} +9249 -8925
- package/dist/deploy-qmiLE1G1.mjs +2 -0
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-DFfQE8jg.mjs → domain-B_9VgOm6.mjs} +8 -8
- package/dist/{email-CdnhUHvJ.mjs → email-BokHgjKj.mjs} +7 -7
- package/dist/{env-DmGdHi5i.mjs → env-BdTc-K2L.mjs} +7 -8
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-Nm3hkZbT.mjs} +8 -1
- package/dist/{gen-CshAkukR.mjs → gen-BhDlTpwW.mjs} +2 -4
- package/dist/gen-qCBwH3fZ.mjs +2 -0
- package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-hhkTzlGS.mjs} +7 -16
- package/dist/{handler-CZ4nAylQ.d.mts → handler-BeK3weD4.d.mts} +1 -1
- package/dist/{help-Dotbf6iz.mjs → help-Bv44e2tm.mjs} +13 -9
- package/dist/help-Dw5f9Xrg.mjs +2 -0
- package/dist/index.d.mts +19 -15
- package/dist/index.mjs +2225 -2142
- package/dist/{info-B97bTX9N.mjs → info-DhtTKh65.mjs} +2 -4
- package/dist/{init-BTQEZZGJ.mjs → init-BMf4T03q.mjs} +17 -18
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-B46sYH0K.mjs → link-BqYsSS_I.mjs} +6 -7
- package/dist/{list-BnPrIsU_.mjs → list-_kBToO-l.mjs} +10 -10
- package/dist/{live-Chw1eIMv.d.mts → live-iAuEH1hd.d.mts} +1 -1
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-fGxYrVD6.mjs} +2 -2
- package/dist/login-D7meQg_3.mjs +2 -0
- package/dist/{login-BuiMyUrx.mjs → login-DFuo-RWO.mjs} +9 -7
- package/dist/{logs-CZG9d-ic.mjs → logs-DYgnh6dH.mjs} +7 -8
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{node-BkyRWRx8.mjs → node-C6Q6e1Es.mjs} +1 -1
- package/dist/{operator-args-B3BTmSoi.mjs → operator-args-DdY54Bgb.mjs} +1 -1
- package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-2dsGlTT5.mjs} +4 -8
- package/dist/{operator-client-CpHjTd0t.mjs → operator-client-BFqpp6z0.mjs} +3 -3
- package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-CUGHXrQf.mjs} +27 -9
- package/dist/operator-cmd-DRPvhpjM.mjs +2 -0
- package/dist/{output-CbM85T4k.mjs → output-BvdaehtE.mjs} +28 -4
- package/dist/pages/client.d.mts +4 -1
- package/dist/pages/client.mjs +120 -29
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-CJGEeTEI.mjs} +2 -2
- package/dist/plan-COtUvdMA.mjs +2 -0
- package/dist/{platform-args-3k8X9-H_.mjs → platform-args-DSV2p4nY.mjs} +4 -2
- package/dist/platform-args-Dcy_5b_Y.mjs +2 -0
- package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-Bosx7U1h.mjs} +20 -19
- package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DcbL_LW_.mjs} +8 -8
- package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-WfTZ8K6o.mjs} +7 -7
- package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-DbKtQb_4.mjs} +73 -38
- package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-dyFUof0t.mjs} +1 -1
- package/dist/platform-discovery-BC0HCKYt.mjs +41 -0
- package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-Bsq43AJp.mjs} +5 -4
- package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle--5gWmDoI.mjs} +1 -1
- package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Cfi0o6xM.mjs} +4605 -3527
- package/dist/platform-management-Bbwf6-Dq.mjs +2 -0
- package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BrF9STZp.mjs} +211 -31
- package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-DU-8nC2Y.mjs} +3 -3
- package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-DQAqAQYu.mjs} +3 -3
- package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-P387v42A.mjs} +18 -11
- package/dist/prepare-BBknoZI1.mjs +2 -0
- package/dist/{prepare-CBLT3CHH.mjs → prepare-BMrRWLwP.mjs} +3 -4
- package/dist/{prepare-DnaKBi--.mjs → prepare-WoUubFKL.mjs} +1 -1
- package/dist/{project-DsblYifa.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-DKG5Ra8p.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-BbH2LptN.mjs} +21 -22
- package/dist/{project-team-BmHcaALJ.mjs → project-team-Yiww3-go.mjs} +8 -9
- package/dist/{project-token-GionZlBI.mjs → project-token-BrtT2NkY.mjs} +6 -9
- package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-nYJ2V2nc.mjs} +5 -6
- package/dist/{prompts-BNUoTiaf.mjs → prompts-6OSVA7DJ.mjs} +58 -15
- package/dist/{prompts-2TGE6oXx.mjs → prompts-ZAuJlyCj.mjs} +1 -1
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BX8t2jiw.d.mts} +1 -1
- package/dist/{provision-CVku1JFU.mjs → provision-DMTPG8Rh.mjs} +1 -1
- package/dist/{provision-CaoxO_U7.mjs → provision-VeqAC77A.mjs} +18 -8
- package/dist/{requests-BOjIVAeF.mjs → requests-TIz_jtSu.mjs} +5 -6
- package/dist/{rollback-CwR3pLj3.mjs → rollback-dBqICPzj.mjs} +9 -10
- package/dist/{runner-Ol0TNjk6.mjs → runner--2KF6Kua.mjs} +1 -1
- package/dist/{runner-CXA9Fh8h.mjs → runner-voIltZrY.mjs} +1 -1
- package/dist/runtime/ai.d.mts +10 -11
- package/dist/runtime/ai.mjs +13 -18
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email.mjs +35 -17
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +33 -7
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/routing.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +12 -22
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C8dA7iM4.mjs} +10 -6
- package/dist/{secret-ByWJWBUG.mjs → secret-AKnNXNP5.mjs} +15 -16
- package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-B6WS9Aoz.mjs} +2 -2
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/validate-pna7R3Pv.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-ymhap6M_.mjs} +1 -1
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/dist/{ws-CL1w7GXU.d.mts → ws-C79j4aED.d.mts} +1 -1
- package/package.json +21 -21
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +5 -2
- package/skills/void/docs/guide/ai.md +78 -137
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- package/skills/void/docs/guide/database.md +15 -0
- package/skills/void/docs/guide/deployment.md +58 -124
- package/skills/void/docs/guide/env-vars.md +1 -5
- package/skills/void/docs/guide/index.md +19 -18
- package/skills/void/docs/guide/kv.md +0 -2
- package/skills/void/docs/guide/live.md +2 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
- package/skills/void/docs/guide/pages-routing/overview.md +2 -2
- package/skills/void/docs/guide/platform/administration/email.md +0 -2
- package/skills/void/docs/guide/platform/administration/operations.md +11 -22
- package/skills/void/docs/guide/platform/administration/plans.md +1 -5
- package/skills/void/docs/guide/platform/administration/zero-trust.md +1 -4
- package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +2 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +5 -1
- package/skills/void/docs/guide/platform/installation/maintenance.md +33 -11
- package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/platform/installation/uninstall.md +44 -11
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/sandboxes.md +75 -66
- package/skills/void/docs/guide/self-hosted-platform.md +20 -0
- package/skills/void/docs/guide/websockets.md +0 -2
- package/skills/void/docs/integrations/frameworks/overview.md +2 -2
- package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
- package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
- package/skills/void/docs/reference/api/resources.md +38 -14
- package/skills/void/docs/reference/api.md +35 -34
- package/skills/void/docs/reference/cli/auth.md +3 -1
- package/skills/void/docs/reference/cli/deploy.md +1 -1
- package/skills/void/docs/reference/cli/platform-config.md +2 -2
- package/skills/void/docs/reference/cli/platform-installation.md +14 -12
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform.md +9 -2
- package/skills/void/docs/reference/cli.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +12 -8
- package/dist/cf-build-output-_0HNWysu.mjs +0 -2
- package/dist/client-B9UBI03V.mjs +0 -2
- package/dist/deploy-irP5q0-x.mjs +0 -2
- package/dist/gen-DvQTWzDU.mjs +0 -2
- package/dist/help-mabuIV98.mjs +0 -2
- package/dist/login-DIy9Sb-U.mjs +0 -2
- package/dist/migrate-BCiJ8w0f.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-DdnM6WIf.mjs +0 -2
- package/dist/platform-management-DG47jys8.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
- package/skills/void/docs/guide/env-migration.md +0 -109
- package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
- package/dist/{env-validation-C_8tPdhs.mjs → env-validation-vBSQ8gw5.mjs} +1 -1
package/dist/runtime/ai.mjs
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
496
|
-
|
|
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
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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 };
|
package/dist/runtime/client.mjs
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
/**
|
package/dist/runtime/email.mjs
CHANGED
|
@@ -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-
|
|
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
|
-
].
|
|
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
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
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
|
|
420
|
-
if (
|
|
421
|
-
const list = readDeliveryList(
|
|
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
|
-
|
|
429
|
-
|
|
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 =
|
|
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-
|
|
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
|
/// <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-
|
|
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
|
|
2
|
-
export {
|
|
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 };
|
package/dist/runtime/limits.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { UsageLimit, asUsageLimit, limitFromResponse,
|
|
1
|
+
import { i as readUsageLimit, n as asUsageLimit, r as limitFromResponse, t as UsageLimit } from "../limits-D0vD1M9A.mjs";
|
|
2
|
+
export { UsageLimit, asUsageLimit, limitFromResponse, readUsageLimit };
|
package/dist/runtime/live.d.mts
CHANGED
|
@@ -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-
|
|
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
|
-
|
|
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
|
|
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]))
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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-
|
|
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
|
package/dist/runtime/routing.mjs
CHANGED
|
@@ -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-
|
|
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 };
|
package/dist/runtime/sandbox.mjs
CHANGED
|
@@ -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
|
|
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 ??=
|
|
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 ??=
|
|
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
|
|
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:
|
|
154
|
-
run: (argv, options) =>
|
|
155
|
-
return (await execute(argv, options)).output()
|
|
156
|
-
|
|
157
|
-
|
|
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-
|
|
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-
|
|
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;
|
package/dist/runtime/ws.d.mts
CHANGED
|
@@ -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-
|
|
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 {
|
|
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:
|
|
19
|
-
output():
|
|
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) =>
|
|
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):
|
|
26
|
-
run(argv: Array<string>, options?: SandboxExecOptions):
|
|
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):
|
|
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
|
|
318
|
-
if (
|
|
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
|
|
331
|
-
if (
|
|
332
|
-
const value =
|
|
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-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
3
|
-
import { _ as validateSecretValues } from "./env-validation-
|
|
4
|
-
import { A as confirm,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
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
|