void 0.22.0 → 0.23.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 +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-C84Ee8cO.mjs} +4 -4
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-CioEg6uY.mjs} +4 -4
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-BsR981d4.mjs} +4 -4
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-LzvNJORH.mjs} +17 -5
- package/dist/{cache-D0sWhgKI.mjs → cache-C4MvnrMH.mjs} +2 -2
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-abUxpP2n.mjs} +2 -2
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +80 -455
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +442 -421
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-RV8NVeB8.mjs} +140 -21
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +5 -5
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-B8uPZ4nx.mjs} +3 -3
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-fxHb-byx.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-Bd4kJd9U.mjs} +5 -5
- package/dist/{create-project-DdoqwFLF.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-l9J7pbtm.mjs → create-project-bMf6ffLZ.mjs} +2 -2
- package/dist/{db-gp2sCXyN.mjs → db-8uG64XLl.mjs} +21 -21
- package/dist/{delete-TTedbH6B.mjs → delete-NvbiyeJf.mjs} +2 -2
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-DzAIwqNU.mjs} +908 -582
- package/dist/{deploy-B19L2Bra.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-y5Tvydvo.mjs} +3 -3
- package/dist/{email-Bo6G9LOZ.mjs → email-B3umsW75.mjs} +13 -28
- package/dist/{env-BYOrWQnv.mjs → env-BS6qYHDb.mjs} +4 -4
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-B580--vC.mjs} +2 -2
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-v45BdfKX.mjs} +2 -2
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-GKtwl07I.mjs → help-daGKjXGk.mjs} +229 -747
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +288 -1502
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-Bvy7zrBo.mjs} +46 -15
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-CDqqCjFl.mjs} +3 -3
- package/dist/{list-D44jmIAM.mjs → list-CZj0dzKY.mjs} +3 -3
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-CAsAsQ-_.mjs → login-UZKFM_u7.mjs} +3 -3
- package/dist/{logs-BjKvFnVM.mjs → logs-CUZ6t9t3.mjs} +3 -3
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-DHul7PRV.mjs} +2 -1
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DBA6dl0m.mjs} +68 -22
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- 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/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-B56E9YP1.mjs} +3 -3
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BDWO_aER.mjs} +2 -2
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-1gg4CSRe.mjs} +3 -3
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMcQStSc.mjs} +24 -3
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-BNkcz0OB.mjs} +2 -2
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-9OyBALhH.mjs} +327 -215
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CjwLVQwN.mjs} +6 -3
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-B5Mkic5u.mjs} +1 -1
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-CNzrqvBv.mjs} +16 -16
- package/dist/{project-team-BvgM0WoX.mjs → project-team-DQOWPfQT.mjs} +2 -2
- package/dist/{project-token-l5DqK6Az.mjs → project-token-CTDYU0Cc.mjs} +2 -2
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-BNAkW-_0.mjs} +2 -2
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CJFgTZY8.mjs} +89 -198
- package/dist/{requests-DN-BbNiM.mjs → requests-MhxYnau8.mjs} +2 -2
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CJ6iSDoU.mjs} +3 -3
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-Dli5fP0B.mjs} +4 -4
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +15 -8
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +23 -152
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +30 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +20 -15
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { a as join, n as dirname, o as normalize, t as basename, u as resolve$2 } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as persistCloudflareConfig } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
3
|
+
import { A as writeProvisionedWranglerConfig, s as assertNoDuplicateMembers, v as readProvisionedBindingEntry } from "./wrangler-7K-bW_DL.mjs";
|
|
3
4
|
import { i as voidWarn, r as voidLog } from "./log-ChfPKsVd.mjs";
|
|
4
5
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
5
|
-
import {
|
|
6
|
+
import { c as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-B-wekeR6.mjs";
|
|
6
7
|
import { createRequire } from "node:module";
|
|
7
8
|
import { closeSync, existsSync, fsyncSync, lstatSync, openSync, readFileSync, readlinkSync, realpathSync, renameSync, unlinkSync, writeSync } from "node:fs";
|
|
8
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -598,11 +599,10 @@ function armRetentionWatchdog(lock, info) {
|
|
|
598
599
|
};
|
|
599
600
|
}
|
|
600
601
|
/**
|
|
601
|
-
* Default
|
|
602
|
-
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
* error/collision detection). Never called in unit tests — those inject a stub.
|
|
602
|
+
* Default provider runner: launches the isolated typed operation entry through
|
|
603
|
+
* {@link resolveCloudflareOperationArgv} with `shell: false`. Public request fields
|
|
604
|
+
* travel as literal JSON argv; secrets travel through stdin. Captured stdout carries
|
|
605
|
+
* the structured result envelope, while stderr carries provider diagnostics.
|
|
606
606
|
*
|
|
607
607
|
* ASYNC (returns a Promise). `spawn` + `await` (vs. the old blocking
|
|
608
608
|
* `spawnSync`) keeps the Node event loop free while wrangler runs, so
|
|
@@ -612,7 +612,7 @@ function armRetentionWatchdog(lock, info) {
|
|
|
612
612
|
* {@link COMMAND_TIMEOUT_MS} SIGKILL guards against a hung child.
|
|
613
613
|
*/
|
|
614
614
|
function createDefaultRunWrangler(root, options) {
|
|
615
|
-
const launcher = options?.launcher ??
|
|
615
|
+
const launcher = options?.launcher ?? resolveCloudflareOperationArgv(root);
|
|
616
616
|
const timeoutMs = options?.timeoutMs ?? COMMAND_TIMEOUT_MS;
|
|
617
617
|
const confirmGraceMs = options?.confirmKillGraceMs ?? CONFIRM_KILL_GRACE_MS;
|
|
618
618
|
const killProcessGroup = options?.killProcessGroup ?? ((target, signal) => process.kill(target, signal));
|
|
@@ -620,7 +620,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
620
620
|
const isWindows = process.platform === "win32";
|
|
621
621
|
const teardownDeadlineMs = options?.signalTeardownDeadlineMs ?? confirmGraceMs + SIGNAL_TEARDOWN_DEADLINE_MARGIN_MS;
|
|
622
622
|
return (args, opts) => new Promise((resolvePromise, rejectPromise) => {
|
|
623
|
-
const parallelWorkerUpload = options?.parallelWorkerUpload === true && args
|
|
623
|
+
const parallelWorkerUpload = options?.parallelWorkerUpload === true && args.type === "versions.upload";
|
|
624
624
|
if (activeTeardown !== void 0) {
|
|
625
625
|
rejectPromise(/* @__PURE__ */ new Error(`provision: refusing to spawn wrangler — a fatal ${activeTeardown.signal} is being handled and this process is terminating; no new wrangler work may start.`));
|
|
626
626
|
return;
|
|
@@ -629,7 +629,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
629
629
|
rejectPromise(/* @__PURE__ */ new Error("provision: refusing to spawn wrangler — another wrangler child is already active in this process (only two immutable Worker uploads may overlap; all other Cloudflare commands and provisions remain sequential)."));
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
|
-
const child = spawn(command, [...prefix, ...args], {
|
|
632
|
+
const child = spawn(command, [...prefix, ...encodeCloudflareOperation(args)], {
|
|
633
633
|
cwd: opts.cwd ?? root,
|
|
634
634
|
shell: false,
|
|
635
635
|
env: {
|
|
@@ -640,7 +640,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
640
640
|
...opts.suppressLogs ? { WRANGLER_WRITE_LOGS: "false" } : {}
|
|
641
641
|
},
|
|
642
642
|
stdio: [
|
|
643
|
-
"ignore",
|
|
643
|
+
opts.input === void 0 ? "ignore" : "pipe",
|
|
644
644
|
"pipe",
|
|
645
645
|
"pipe"
|
|
646
646
|
],
|
|
@@ -721,7 +721,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
721
721
|
settled = true;
|
|
722
722
|
clearTimeout(commandTimer);
|
|
723
723
|
deregisterSelf();
|
|
724
|
-
resolvePromise(result);
|
|
724
|
+
resolvePromise(decodeCloudflareOperationResult(result));
|
|
725
725
|
};
|
|
726
726
|
const quarantine = (detail) => {
|
|
727
727
|
if (settled) return;
|
|
@@ -794,7 +794,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
794
794
|
signal: "SIGKILL"
|
|
795
795
|
}), `the timeout SIGKILL (${timeoutStderr()})`);
|
|
796
796
|
}, timeoutMs);
|
|
797
|
-
|
|
797
|
+
const handleProcessError = (error) => {
|
|
798
798
|
if (!spawned && typeof child.pid !== "number") {
|
|
799
799
|
finish(normalizeRunWranglerResult({
|
|
800
800
|
stdout,
|
|
@@ -820,7 +820,9 @@ function createDefaultRunWrangler(root, options) {
|
|
|
820
820
|
status: null,
|
|
821
821
|
signal: "SIGKILL"
|
|
822
822
|
}), `a post-spawn child error (${error.message}; the group was SIGKILLed)`);
|
|
823
|
-
}
|
|
823
|
+
};
|
|
824
|
+
child.on("error", handleProcessError);
|
|
825
|
+
child.stdin?.on("error", handleProcessError);
|
|
824
826
|
child.on("close", (code, signal) => {
|
|
825
827
|
closed = true;
|
|
826
828
|
if (timedOut || postSpawnError !== void 0) {
|
|
@@ -849,6 +851,7 @@ function createDefaultRunWrangler(root, options) {
|
|
|
849
851
|
});
|
|
850
852
|
registerRunner(registrant, parallelWorkerUpload);
|
|
851
853
|
options?.onSpawnedChild?.(child);
|
|
854
|
+
if (opts.input !== void 0) child.stdin?.end(opts.input);
|
|
852
855
|
});
|
|
853
856
|
}
|
|
854
857
|
/**
|
|
@@ -895,7 +898,7 @@ function isCleanSuccess(result) {
|
|
|
895
898
|
* classified for a resource-specific not-found signal.
|
|
896
899
|
*/
|
|
897
900
|
function isCleanFailure(result) {
|
|
898
|
-
return !isHardFailure(result) &&
|
|
901
|
+
return !isHardFailure(result) && Number.isSafeInteger(result.status) && result.status > 0;
|
|
899
902
|
}
|
|
900
903
|
/**
|
|
901
904
|
* The OVERALL deadline for the Hyperdrive existence lister (across ALL its paginated
|
|
@@ -1421,29 +1424,12 @@ async function acquireProvisionLock(configPath, lockOptions) {
|
|
|
1421
1424
|
* like "absent", minting a duplicate). Used everywhere an empty list must mean
|
|
1422
1425
|
* "authoritatively absent" and garbage must NOT be coerced to "absent".
|
|
1423
1426
|
*/
|
|
1424
|
-
function parseJsonArrayStrict(
|
|
1425
|
-
const value = parseJsonLoose(stdout);
|
|
1427
|
+
function parseJsonArrayStrict(value) {
|
|
1426
1428
|
return Array.isArray(value) ? value : void 0;
|
|
1427
1429
|
}
|
|
1428
|
-
|
|
1429
|
-
function parseJsonObject(stdout) {
|
|
1430
|
-
const value = parseJsonLoose(stdout);
|
|
1430
|
+
function parseJsonObject(value) {
|
|
1431
1431
|
return isRecord(value) ? value : void 0;
|
|
1432
1432
|
}
|
|
1433
|
-
/**
|
|
1434
|
-
* wrangler may print human banners before the JSON payload; slice from the
|
|
1435
|
-
* first `{`/`[` so a leading banner does not break `JSON.parse`.
|
|
1436
|
-
*/
|
|
1437
|
-
function parseJsonLoose(stdout) {
|
|
1438
|
-
const trimmed = stdout.trim();
|
|
1439
|
-
const start = trimmed.search(/[[{]/);
|
|
1440
|
-
if (start === -1) return;
|
|
1441
|
-
try {
|
|
1442
|
-
return JSON.parse(trimmed.slice(start));
|
|
1443
|
-
} catch {
|
|
1444
|
-
return;
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
1433
|
function isRecord(value) {
|
|
1448
1434
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1449
1435
|
}
|
|
@@ -1476,17 +1462,13 @@ function readRootConfig(configPath) {
|
|
|
1476
1462
|
if (!isRecord(parsed)) throw new Error(`provision: "${configPath}" must be a JSON object.`);
|
|
1477
1463
|
return parsed;
|
|
1478
1464
|
}
|
|
1479
|
-
/** Escape a string for literal embedding in a `RegExp`. */
|
|
1480
|
-
function escapeRegExp(value) {
|
|
1481
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1482
|
-
}
|
|
1483
1465
|
/**
|
|
1484
1466
|
* FAIL-CLOSED gate over a discovery/list/info result. Throws (no create) unless
|
|
1485
1467
|
* the child exited cleanly — a NUMERIC `status === 0`. Because
|
|
1486
1468
|
* {@link normalizeRunWranglerResult} already folds a signal-killed child or a
|
|
1487
1469
|
* spawn error into a non-zero status, a single numeric check here rejects ALL of
|
|
1488
1470
|
* nonzero-exit / SIGTERM / spawn-error / non-numeric status. MUST be called
|
|
1489
|
-
* BEFORE
|
|
1471
|
+
* BEFORE reading provider data, so failed discovery never implies absence.
|
|
1490
1472
|
*/
|
|
1491
1473
|
function assertDiscoverySucceeded(result, label) {
|
|
1492
1474
|
if (!isCleanSuccess(result)) throw new Error(`provision: "${label}" failed (exit ${String(result.status)}): ${result.stderr || result.stdout || "no output"}. Cannot verify existing resources; refusing to create a possible duplicate.`);
|
|
@@ -1582,8 +1564,7 @@ function extractKvMatches(list, title) {
|
|
|
1582
1564
|
}
|
|
1583
1565
|
/** True when a `d1 create` failure means the name is already taken (code 7502). */
|
|
1584
1566
|
function isAlreadyExistsError(result) {
|
|
1585
|
-
|
|
1586
|
-
return text.includes("7502") || /already exists/i.test(text);
|
|
1567
|
+
return result.errorCode === 7502;
|
|
1587
1568
|
}
|
|
1588
1569
|
/**
|
|
1589
1570
|
* EXACT, name-aware not-found classifier shared by R2 + queues. Given a
|
|
@@ -1594,43 +1575,16 @@ function isAlreadyExistsError(result) {
|
|
|
1594
1575
|
* GENERIC "not found" (e.g. `Account not found`) is NEVER treated as absence,
|
|
1595
1576
|
* which would mint a duplicate resource.
|
|
1596
1577
|
*/
|
|
1597
|
-
function isConfirmedAbsent(result, kind,
|
|
1598
|
-
|
|
1599
|
-
const text = `${result.stdout}\n${result.stderr}`;
|
|
1600
|
-
switch (kind) {
|
|
1601
|
-
case "r2": return /\[code:\s*10006\]/.test(text);
|
|
1602
|
-
case "queue": return new RegExp(`Queue\\s+"${escapeRegExp(name)}"\\s+does not exist`, "i").test(text);
|
|
1603
|
-
}
|
|
1578
|
+
function isConfirmedAbsent(result, kind, _name) {
|
|
1579
|
+
return isCleanFailure(result) && (kind === "r2" ? result.errorCode === 10006 : result.failure === "not-found");
|
|
1604
1580
|
}
|
|
1605
|
-
/**
|
|
1606
|
-
* A `wrangler queues info <name>` result POSITIVELY confirms THIS queue does NOT
|
|
1607
|
-
* exist in the account. Narrow, queue-only view of {@link isConfirmedAbsent}, shared
|
|
1608
|
-
* with the deploy orchestrator's pre-build queue probe (`cli/deploy.ts`) so both call
|
|
1609
|
-
* sites classify the SAME wrangler output the SAME way. Only the exact, name-aware
|
|
1610
|
-
* `Queue "<name>" does not exist` on a clean non-zero exit returns `true`; every other
|
|
1611
|
-
* outcome (success, signal/spawn failure, auth or network error, generic "not found")
|
|
1612
|
-
* returns `false` and is left for the caller to treat as inconclusive.
|
|
1613
|
-
*/
|
|
1581
|
+
/** Only a completed, typed not-found response confirms queue absence. */
|
|
1614
1582
|
function isQueueConfirmedAbsent(result, name) {
|
|
1615
1583
|
return isConfirmedAbsent(result, "queue", name);
|
|
1616
1584
|
}
|
|
1617
|
-
/**
|
|
1618
|
-
* A `wrangler queues info <name>` result POSITIVELY confirms THIS queue
|
|
1619
|
-
* exists. Queues write NO config, so a create cannot be verified by re-reading the
|
|
1620
|
-
* config (the D1/KV/R2/Hyperdrive backstop). And wrangler's `bin.wrangler` wrapper
|
|
1621
|
-
* maps a signal-killed inner CLI to `process.exit(0)` (`bin/wrangler.js`:
|
|
1622
|
-
* `code === null → exit(0)`), so a KILLED probe/create can surface a clean exit 0
|
|
1623
|
-
* with empty/partial output. A bare clean 0 is therefore NOT proof the queue exists.
|
|
1624
|
-
* We require BOTH a clean success (numeric exit 0, no signal/spawn error — the
|
|
1625
|
-
* provenance rule) AND the output to name THIS exact queue: wrangler 4.131's
|
|
1626
|
-
* `queues info` prints `Queue Name: <queue_name>` for the queue it fetched by name
|
|
1627
|
-
* (account-unique), so an exact `Queue Name: <name>` line is the positive signal.
|
|
1628
|
-
* Used for BOTH the reuse probe and the post-create verify probe.
|
|
1629
|
-
*/
|
|
1585
|
+
/** Reuse and post-create verification require clean success and the exact returned name. */
|
|
1630
1586
|
function queueInfoConfirmsExists(result, name) {
|
|
1631
|
-
|
|
1632
|
-
const text = `${result.stdout}\n${result.stderr}`;
|
|
1633
|
-
return new RegExp(`^Queue Name:\\s+${escapeRegExp(name)}\\s*$`, "m").test(text);
|
|
1587
|
+
return isCleanSuccess(result) && isRecord(result.data) && result.data.name === name;
|
|
1634
1588
|
}
|
|
1635
1589
|
/**
|
|
1636
1590
|
* Throw when the writer could not attach `migrations_dir` because no matching
|
|
@@ -1733,29 +1687,6 @@ function assertValidResourceName(kind, name) {
|
|
|
1733
1687
|
if (!grammar.re.test(name)) throw new Error(`provision: refusing to pass an invalid ${grammar.label} name ${JSON.stringify(name)} to wrangler. A ${grammar.label} name must ${grammar.rule}. Rename the resource and retry.`);
|
|
1734
1688
|
}
|
|
1735
1689
|
/**
|
|
1736
|
-
* The trailing flags EVERY provisioner wrangler invocation MUST carry, built
|
|
1737
|
-
* ONCE so no call site can forget them:
|
|
1738
|
-
* - `-c <configPath>` pins the ONE resolved config (no split-brain reads/writes);
|
|
1739
|
-
* - `--env=` (an explicit EMPTY environment) FORCES wrangler onto the top-level
|
|
1740
|
-
* config environment. wrangler 4.131 selects its config env as
|
|
1741
|
-
* `args.env ?? getCloudflareEnv()`; passing an explicit empty `args.env`
|
|
1742
|
-
* short-circuits the `??` so a project `.env`/`.env.local` that sets
|
|
1743
|
-
* `CLOUDFLARE_ENV` (reloaded into `process.env` on every wrangler command)
|
|
1744
|
-
* can NEVER reselect a named `env.*` block — whose `account_id`/bindings could
|
|
1745
|
-
* differ from the single account this provision resolved, patched, and pinned.
|
|
1746
|
-
* `--env=` is wrangler's own documented sentinel for "use the top-level
|
|
1747
|
-
* environment" (it prints exactly this guidance when multiple env blocks exist).
|
|
1748
|
-
* Discovery/create AND `--update-config` therefore all operate on the SAME
|
|
1749
|
-
* top-level config/account.
|
|
1750
|
-
*/
|
|
1751
|
-
function wranglerConfigArgs(configPath) {
|
|
1752
|
-
return [
|
|
1753
|
-
"-c",
|
|
1754
|
-
configPath,
|
|
1755
|
-
"--env="
|
|
1756
|
-
];
|
|
1757
|
-
}
|
|
1758
|
-
/**
|
|
1759
1690
|
* Build a redactor that strips connection-string secrets from every string the
|
|
1760
1691
|
* provisioner PROPAGATES (buffered wrangler stdout/stderr, error strings, logged
|
|
1761
1692
|
* warnings). Two layers:
|
|
@@ -2156,14 +2087,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
|
|
|
2156
2087
|
id: entry.database_id
|
|
2157
2088
|
});
|
|
2158
2089
|
} else {
|
|
2159
|
-
const listResult = await runWrangler(
|
|
2160
|
-
"d1",
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
...wranglerConfigArgs(configPath)
|
|
2164
|
-
], { captureJson: true });
|
|
2090
|
+
const listResult = await runWrangler({
|
|
2091
|
+
type: "d1.list",
|
|
2092
|
+
configPath
|
|
2093
|
+
}, {});
|
|
2165
2094
|
assertDiscoverySucceeded(listResult, "wrangler d1 list");
|
|
2166
|
-
const rawList = parseJsonArrayStrict(listResult.
|
|
2095
|
+
const rawList = parseJsonArrayStrict(listResult.data);
|
|
2167
2096
|
if (!rawList) throw new Error(`provision: "wrangler d1 list --json" did not return a JSON array; cannot verify whether D1 database ${JSON.stringify(name)} exists. Refusing to create a possible duplicate.`);
|
|
2168
2097
|
const claimants = validateResourceList(rawList, {
|
|
2169
2098
|
resource: "D1 database",
|
|
@@ -2197,15 +2126,12 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
|
|
|
2197
2126
|
id: existing.id
|
|
2198
2127
|
});
|
|
2199
2128
|
} else {
|
|
2200
|
-
const created = await runWrangler(
|
|
2201
|
-
"d1",
|
|
2202
|
-
"create",
|
|
2129
|
+
const created = await runWrangler({
|
|
2130
|
+
type: "d1.create",
|
|
2203
2131
|
name,
|
|
2204
|
-
"--binding",
|
|
2205
2132
|
binding,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
]);
|
|
2133
|
+
configPath
|
|
2134
|
+
});
|
|
2209
2135
|
if (isCleanSuccess(created)) {
|
|
2210
2136
|
assertCreateWroteRealId(configPath, {
|
|
2211
2137
|
field: "d1_databases",
|
|
@@ -2227,15 +2153,13 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
|
|
|
2227
2153
|
action: "created"
|
|
2228
2154
|
});
|
|
2229
2155
|
} else if (isCleanFailure(created) && isAlreadyExistsError(created)) {
|
|
2230
|
-
const infoResult = await runWrangler(
|
|
2231
|
-
"d1",
|
|
2232
|
-
"info",
|
|
2156
|
+
const infoResult = await runWrangler({
|
|
2157
|
+
type: "d1.info",
|
|
2233
2158
|
name,
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
], { captureJson: true });
|
|
2159
|
+
configPath
|
|
2160
|
+
}, {});
|
|
2237
2161
|
assertDiscoverySucceeded(infoResult, `wrangler d1 info ${name}`);
|
|
2238
|
-
const info = normalizeD1(parseJsonObject(infoResult.
|
|
2162
|
+
const info = normalizeD1(parseJsonObject(infoResult.data), name);
|
|
2239
2163
|
if (info.kind !== "match") throw new Error(`provision: "wrangler d1 create ${name}" reported the database already exists, but "wrangler d1 info ${name} --json" did not return a database with a matching name and an unambiguous id. Refusing to adopt an unverified database.`);
|
|
2240
2164
|
log.info(`adopted existing D1 database ${name} (${info.id})`);
|
|
2241
2165
|
assertD1MigrationsDirApplied(write({
|
|
@@ -2270,21 +2194,11 @@ async function reconcileD1(desired, configPath, runWrangler, write, persistCreat
|
|
|
2270
2194
|
else {
|
|
2271
2195
|
let token = opts?.apiToken ?? process.env.CLOUDFLARE_API_TOKEN;
|
|
2272
2196
|
if (!token) {
|
|
2273
|
-
const auth = await runWrangler(
|
|
2274
|
-
"auth",
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
], {
|
|
2279
|
-
captureJson: true,
|
|
2280
|
-
suppressLogs: true
|
|
2281
|
-
});
|
|
2282
|
-
const start = auth.stdout.indexOf("{");
|
|
2283
|
-
const end = auth.stdout.lastIndexOf("}");
|
|
2284
|
-
let parsed;
|
|
2285
|
-
if (isCleanSuccess(auth) && start >= 0 && end > start) try {
|
|
2286
|
-
parsed = JSON.parse(auth.stdout.slice(start, end + 1));
|
|
2287
|
-
} catch {}
|
|
2197
|
+
const auth = await runWrangler({
|
|
2198
|
+
type: "auth.token",
|
|
2199
|
+
configPath
|
|
2200
|
+
}, { suppressLogs: true });
|
|
2201
|
+
const parsed = isCleanSuccess(auth) && isRecord(auth.data) ? auth.data : void 0;
|
|
2288
2202
|
if ((parsed?.type === "oauth" || parsed?.type === "api_token") && typeof parsed.token === "string") token = parsed.token;
|
|
2289
2203
|
}
|
|
2290
2204
|
if (!token) throw new Error("provision: D1 read replication requires a Cloudflare API bearer with D1 Edit permission. Log in with `wrangler login` or set CLOUDFLARE_API_TOKEN, then retry.");
|
|
@@ -2305,14 +2219,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
|
|
|
2305
2219
|
});
|
|
2306
2220
|
continue;
|
|
2307
2221
|
}
|
|
2308
|
-
const listResult = await runWrangler(
|
|
2309
|
-
"kv",
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
...wranglerConfigArgs(configPath)
|
|
2313
|
-
], { captureJson: true });
|
|
2222
|
+
const listResult = await runWrangler({
|
|
2223
|
+
type: "kv.namespace.list",
|
|
2224
|
+
configPath
|
|
2225
|
+
}, {});
|
|
2314
2226
|
assertDiscoverySucceeded(listResult, "wrangler kv namespace list");
|
|
2315
|
-
const rawList = parseJsonArrayStrict(listResult.
|
|
2227
|
+
const rawList = parseJsonArrayStrict(listResult.data);
|
|
2316
2228
|
if (!rawList) throw new Error(`provision: "wrangler kv namespace list" did not return a JSON array; cannot verify whether KV namespace ${JSON.stringify(title)} exists. Refusing to create a possible duplicate.`);
|
|
2317
2229
|
const matches = extractKvMatches(validateResourceList(rawList, {
|
|
2318
2230
|
resource: "KV namespace",
|
|
@@ -2338,16 +2250,12 @@ async function reconcileKv(desired, configPath, runWrangler, write, persistCreat
|
|
|
2338
2250
|
id: chosen.id
|
|
2339
2251
|
});
|
|
2340
2252
|
} else {
|
|
2341
|
-
const created = await runWrangler(
|
|
2342
|
-
"kv",
|
|
2343
|
-
|
|
2344
|
-
"create",
|
|
2345
|
-
title,
|
|
2346
|
-
"--binding",
|
|
2253
|
+
const created = await runWrangler({
|
|
2254
|
+
type: "kv.namespace.create",
|
|
2255
|
+
name: title,
|
|
2347
2256
|
binding,
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
]);
|
|
2257
|
+
configPath
|
|
2258
|
+
});
|
|
2351
2259
|
if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler kv namespace create ${title}" failed: ${created.stderr || created.stdout}`);
|
|
2352
2260
|
assertCreateWroteRealId(configPath, {
|
|
2353
2261
|
field: "kv_namespaces",
|
|
@@ -2380,16 +2288,13 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
|
|
|
2380
2288
|
action: "reused"
|
|
2381
2289
|
});
|
|
2382
2290
|
} else {
|
|
2383
|
-
const info = await runWrangler(
|
|
2384
|
-
"r2",
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
"--json",
|
|
2389
|
-
...wranglerConfigArgs(configPath)
|
|
2390
|
-
], { captureJson: true });
|
|
2291
|
+
const info = await runWrangler({
|
|
2292
|
+
type: "r2.bucket.info",
|
|
2293
|
+
name: bucketName,
|
|
2294
|
+
configPath
|
|
2295
|
+
}, {});
|
|
2391
2296
|
if (isCleanSuccess(info)) {
|
|
2392
|
-
const payload = parseJsonObject(info.
|
|
2297
|
+
const payload = parseJsonObject(info.data);
|
|
2393
2298
|
if (!payload || payload.name !== bucketName) throw new Error(`provision: "wrangler r2 bucket info ${bucketName} --json" exited 0 but did not identify the requested bucket (expected name ${JSON.stringify(bucketName)}). Refusing to adopt an unverified bucket. Output: ${info.stdout || info.stderr}`);
|
|
2394
2299
|
log.info(`adopted existing R2 bucket ${bucketName}`);
|
|
2395
2300
|
write({ r2: {
|
|
@@ -2403,16 +2308,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
|
|
|
2403
2308
|
action: "adopted"
|
|
2404
2309
|
});
|
|
2405
2310
|
} else if (isConfirmedAbsent(info, "r2", bucketName)) {
|
|
2406
|
-
const created = await runWrangler(
|
|
2407
|
-
"r2",
|
|
2408
|
-
|
|
2409
|
-
"create",
|
|
2410
|
-
bucketName,
|
|
2411
|
-
"--binding",
|
|
2311
|
+
const created = await runWrangler({
|
|
2312
|
+
type: "r2.bucket.create",
|
|
2313
|
+
name: bucketName,
|
|
2412
2314
|
binding,
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
]);
|
|
2315
|
+
configPath
|
|
2316
|
+
});
|
|
2416
2317
|
if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler r2 bucket create ${bucketName}" failed: ${created.stderr || created.stdout}`);
|
|
2417
2318
|
assertCreateWroteRealId(configPath, {
|
|
2418
2319
|
field: "r2_buckets",
|
|
@@ -2423,15 +2324,12 @@ async function reconcileR2(desired, configPath, runWrangler, write, persistCreat
|
|
|
2423
2324
|
command: "wrangler r2 bucket create"
|
|
2424
2325
|
}, binding, bucketName);
|
|
2425
2326
|
if (bucketName === R2_BUCKET_NAME_PLACEHOLDER) {
|
|
2426
|
-
const verify = await runWrangler(
|
|
2427
|
-
"r2",
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
...wranglerConfigArgs(configPath)
|
|
2433
|
-
], { captureJson: true });
|
|
2434
|
-
const payload = isCleanSuccess(verify) ? parseJsonObject(verify.stdout) : void 0;
|
|
2327
|
+
const verify = await runWrangler({
|
|
2328
|
+
type: "r2.bucket.info",
|
|
2329
|
+
name: bucketName,
|
|
2330
|
+
configPath
|
|
2331
|
+
}, {});
|
|
2332
|
+
const payload = isCleanSuccess(verify) ? parseJsonObject(verify.data) : void 0;
|
|
2435
2333
|
if (!payload || payload.name !== bucketName) throw new Error(`provision: "wrangler r2 bucket create ${bucketName}" reported success but a follow-up "wrangler r2 bucket info ${bucketName}" did not confirm the bucket exists. The create may have been interrupted — wrangler's launcher can mask a signal-killed child as exit 0, and the config entry is indistinguishable from the local-dev placeholder for this name. Refusing to record an unprovisioned bucket; inspect the account and retry.`);
|
|
2436
2334
|
}
|
|
2437
2335
|
persistCreatedConfig();
|
|
@@ -2500,16 +2398,12 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
|
|
|
2500
2398
|
});
|
|
2501
2399
|
} else if (existenceUnknown) throw new Error(`provision: cannot verify whether Hyperdrive config ${JSON.stringify(name)} already exists (no existence check available — provide an accountId + API token, or inject a listHyperdriveConfigs seam). "wrangler hyperdrive create" silently duplicates a same-named config, so provisioning refuses to create it blindly.`);
|
|
2502
2400
|
else {
|
|
2503
|
-
const created = await runWrangler(
|
|
2504
|
-
"hyperdrive",
|
|
2505
|
-
"create",
|
|
2401
|
+
const created = await runWrangler({
|
|
2402
|
+
type: "hyperdrive.create",
|
|
2506
2403
|
name,
|
|
2507
|
-
`--connection-string=${connectionString}`,
|
|
2508
|
-
"--binding",
|
|
2509
2404
|
binding,
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
]);
|
|
2405
|
+
configPath
|
|
2406
|
+
}, { input: connectionString });
|
|
2513
2407
|
if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler hyperdrive create ${name}" failed: ${created.stderr || created.stdout}`);
|
|
2514
2408
|
assertCreateWroteRealId(configPath, {
|
|
2515
2409
|
field: "hyperdrive",
|
|
@@ -2531,12 +2425,11 @@ async function reconcileHyperdrive(desired, configPath, runWrangler, write, pers
|
|
|
2531
2425
|
}
|
|
2532
2426
|
async function reconcileQueues(desired, configPath, runWrangler, resources) {
|
|
2533
2427
|
for (const name of desired.queues) {
|
|
2534
|
-
const info = await runWrangler(
|
|
2535
|
-
"queues",
|
|
2536
|
-
"info",
|
|
2428
|
+
const info = await runWrangler({
|
|
2429
|
+
type: "queues.info",
|
|
2537
2430
|
name,
|
|
2538
|
-
|
|
2539
|
-
|
|
2431
|
+
configPath
|
|
2432
|
+
});
|
|
2540
2433
|
if (queueInfoConfirmsExists(info, name)) {
|
|
2541
2434
|
resources.push({
|
|
2542
2435
|
kind: "queue",
|
|
@@ -2546,19 +2439,17 @@ async function reconcileQueues(desired, configPath, runWrangler, resources) {
|
|
|
2546
2439
|
continue;
|
|
2547
2440
|
}
|
|
2548
2441
|
if (!isConfirmedAbsent(info, "queue", name)) throw new Error(`provision: "wrangler queues info ${name}" failed or did not confirm the queue exists: ${info.stderr || info.stdout || "no output"}`);
|
|
2549
|
-
const created = await runWrangler(
|
|
2550
|
-
"queues",
|
|
2551
|
-
"create",
|
|
2442
|
+
const created = await runWrangler({
|
|
2443
|
+
type: "queues.create",
|
|
2552
2444
|
name,
|
|
2553
|
-
|
|
2554
|
-
|
|
2445
|
+
configPath
|
|
2446
|
+
});
|
|
2555
2447
|
if (!isCleanSuccess(created)) throw new Error(`provision: "wrangler queues create ${name}" failed: ${created.stderr || created.stdout}`);
|
|
2556
|
-
if (!queueInfoConfirmsExists(await runWrangler(
|
|
2557
|
-
"queues",
|
|
2558
|
-
"info",
|
|
2448
|
+
if (!queueInfoConfirmsExists(await runWrangler({
|
|
2449
|
+
type: "queues.info",
|
|
2559
2450
|
name,
|
|
2560
|
-
|
|
2561
|
-
|
|
2451
|
+
configPath
|
|
2452
|
+
}), name)) throw new Error(`provision: "wrangler queues create ${name}" reported success but "wrangler queues info ${name}" did not confirm the queue exists afterward. The create may have been interrupted — wrangler's launcher can mask a signal-killed child as exit 0. Refusing to record an unprovisioned queue; inspect the account and retry.`);
|
|
2562
2453
|
resources.push({
|
|
2563
2454
|
kind: "queue",
|
|
2564
2455
|
name,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { c as getToken } from "./auth-CSkdO2Bb.mjs";
|
|
2
2
|
import { o as readProjectConfig } from "./project-C0Fqu05O.mjs";
|
|
3
3
|
import { O as intro, P as outro, j as log } from "./dist-CTBk70IR.mjs";
|
|
4
|
-
import { n as PlatformClient } from "./client-
|
|
4
|
+
import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
|
|
5
5
|
import { a as dim, c as import_picocolors, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
6
6
|
//#region src/cli/requests.ts
|
|
7
7
|
async function runRequestsCommand(root, range, status) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/shared/resource-name.ts
|
|
2
|
+
function resourceNameWords(value) {
|
|
3
|
+
return value.split(/[^a-zA-Z0-9]+/).filter(Boolean);
|
|
4
|
+
}
|
|
5
|
+
function isResourceName(value) {
|
|
6
|
+
if (typeof value !== "string") return false;
|
|
7
|
+
const words = resourceNameWords(value);
|
|
8
|
+
return words.length > 0 && /^[a-zA-Z]/.test(words[0]);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { resourceNameWords as n, isResourceName as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { c as getToken } from "./auth-CSkdO2Bb.mjs";
|
|
2
2
|
import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
|
|
3
3
|
import { E as confirm, I as select, O as intro, P as outro, T as cancel, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
4
|
-
import { n as PlatformClient } from "./client-
|
|
4
|
+
import { n as PlatformClient } from "./client-RV8NVeB8.mjs";
|
|
5
5
|
import { a as dim, c as import_picocolors, i as createSpinner, o as ensureUtc, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
6
6
|
//#region src/cli/rollback.ts
|
|
7
7
|
async function runRollbackCommand(root, deployId) {
|
|
@@ -83,7 +83,7 @@ async function runRollbackCommand(root, deployId) {
|
|
|
83
83
|
outro(dim("Traffic is now serving the rolled-back deployment."));
|
|
84
84
|
}
|
|
85
85
|
async function runCloudflareRollback(root, deployId) {
|
|
86
|
-
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
86
|
+
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-AiWashgg.mjs");
|
|
87
87
|
const context = resolveCloudflareOperationContext(root);
|
|
88
88
|
const status = await readCloudflareWorkerStatus(context);
|
|
89
89
|
const deployedVersionIds = new Set(status.deployedVersionIds);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/runtime/route-url.ts
|
|
2
|
+
/** Expand complete route tokens without changing query strings or fragments. */
|
|
3
|
+
function interpolateRouteParams(path, params) {
|
|
4
|
+
if (!params) return path;
|
|
5
|
+
const suffixIndex = path.search(/[?#]/);
|
|
6
|
+
const pathname = suffixIndex === -1 ? path : path.slice(0, suffixIndex);
|
|
7
|
+
const suffix = suffixIndex === -1 ? "" : path.slice(suffixIndex);
|
|
8
|
+
return pathname.replace(/(^|\/):([^/{}]+)(\{\.\+\})?(?=\/|$)/g, (token, prefix, name, catchAll) => {
|
|
9
|
+
if (!Object.hasOwn(params, name)) return token;
|
|
10
|
+
const value = params[name];
|
|
11
|
+
return prefix + (catchAll ? value.split("/").map(encodeURIComponent).join("/") : encodeURIComponent(value));
|
|
12
|
+
}) + suffix;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { interpolateRouteParams as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as openSqliteDatabase, n as getAppliedMigrations, o as runMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-
|
|
1
|
+
import { i as openSqliteDatabase, n as getAppliedMigrations, o as runMigrations, r as getMiniflareDatabasePath, t as getApplicationTables } from "./runner-Ol0TNjk6.mjs";
|
|
2
2
|
export { getApplicationTables, getAppliedMigrations, getMiniflareDatabasePath, openSqliteDatabase, runMigrations };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-DXfiT1jV.mjs";
|
|
3
2
|
import { t as collectMigrations } from "./collect-DiTn9yr6.mjs";
|
|
4
|
-
import {
|
|
3
|
+
import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-DXfiT1jV.mjs";
|
|
4
|
+
import { r as classifyMigration } from "./plan-NPpwZ_kc.mjs";
|
|
5
5
|
import { existsSync, mkdirSync } from "node:fs";
|
|
6
6
|
import { createHash, createHmac } from "node:crypto";
|
|
7
7
|
//#region src/migrations/runner.ts
|
package/dist/runtime/ai.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as LimitOperation } from "../limits-Bq5LG8Id.mjs";
|
|
1
2
|
//#region src/runtime/ai-types.d.ts
|
|
2
3
|
type AiProviderName = "openai" | "anthropic" | "google-ai-studio" | "groq" | "mistral" | "grok" | "deepseek" | "openrouter" | "perplexity" | "cohere" | "cerebras" | "huggingface" | "replicate" | "baseten" | "cartesia" | "deepgram" | "elevenlabs" | "fal" | "ideogram" | "parallel";
|
|
3
4
|
type AiProvider = AiProviderName | (string & {});
|
|
@@ -24,23 +25,26 @@ type AiProviderFetchInit = {
|
|
|
24
25
|
* `stream()` calls `ai.run()` with `stream: true` and wraps the result
|
|
25
26
|
* in a `Response` with SSE headers — ready to return from a route handler.
|
|
26
27
|
*/
|
|
27
|
-
export type VoidAi =
|
|
28
|
+
export type VoidAi = {
|
|
29
|
+
models(...args: Parameters<Ai["models"]>): LimitOperation<Awaited<ReturnType<Ai["models"]>>>;
|
|
30
|
+
toMarkdown(files: Array<Parameters<Ai["toMarkdown"]>[0]>, options?: Parameters<Ai["toMarkdown"]>[1]): LimitOperation<Array<Awaited<ReturnType<Ai["toMarkdown"]>>>>;
|
|
31
|
+
toMarkdown(...args: Parameters<Ai["toMarkdown"]>): LimitOperation<Awaited<ReturnType<Ai["toMarkdown"]>>>;
|
|
28
32
|
/** Workers AI inference (existing) */
|
|
29
|
-
run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions):
|
|
33
|
+
run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): LimitOperation<AiModels[Name]["postProcessedOutputs"]>;
|
|
30
34
|
/** Cloudflare AI Gateway model inference. Accepts Cloudflare model IDs unchanged. */
|
|
31
|
-
run(model: string, inputs: unknown, options?: AiOptions):
|
|
35
|
+
run(model: string, inputs: unknown, options?: AiOptions): LimitOperation<unknown>;
|
|
32
36
|
/** Image generation. Returns the proxy response so callers can return or parse it. */
|
|
33
|
-
image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions):
|
|
37
|
+
image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): LimitOperation<Response>;
|
|
34
38
|
/** Cloudflare AI Gateway model inference returned as a Response. */
|
|
35
|
-
image(model: string, inputs: unknown, options?: AiOptions):
|
|
39
|
+
image(model: string, inputs: unknown, options?: AiOptions): LimitOperation<Response>;
|
|
36
40
|
/** Provider-native AI Gateway requests using a project secret for the provider API key. */
|
|
37
41
|
provider(provider: AiProvider, options?: AiProviderOptions): {
|
|
38
|
-
fetch(path: string, init?: AiProviderFetchInit):
|
|
42
|
+
fetch(path: string, init?: AiProviderFetchInit): LimitOperation<Response>;
|
|
39
43
|
};
|
|
40
44
|
/** Stream Workers AI response as SSE */
|
|
41
|
-
stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions):
|
|
45
|
+
stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): LimitOperation<Response>;
|
|
42
46
|
/** Stream any Cloudflare AI Gateway model response as SSE */
|
|
43
|
-
stream(model: string, inputs: Record<string, unknown>, options?: AiOptions):
|
|
47
|
+
stream(model: string, inputs: Record<string, unknown>, options?: AiOptions): LimitOperation<Response>;
|
|
44
48
|
};
|
|
45
49
|
export declare const ai: VoidAi;
|
|
46
50
|
//#endregion
|