void 1.8.0 → 1.9.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/dist/{account-cmd-CZKntRH2.mjs → account-cmd-BEMOdwtl.mjs} +3 -3
- package/dist/{application-analysis-CyTagJQM.mjs → application-analysis-3VVsflWZ.mjs} +5 -5
- package/dist/{application-routing-BLrMVpqi.mjs → application-routing-CJRlXCc2.mjs} +1 -1
- package/dist/{auth-Bk9VGtQW.d.mts → auth-CV9kXHKe.d.mts} +3 -1
- package/dist/{auth-DyWp-fSo.mjs → auth-aMuFOZeI.mjs} +8 -2
- package/dist/{auth-link-BOaQWMKw.mjs → auth-link-B1IynRW5.mjs} +3 -3
- package/dist/{auth-router-D0-VcmDs.mjs → auth-router-DVaWJdRB.mjs} +2 -2
- package/dist/{better-auth-shared-CdVyCUou.mjs → better-auth-shared-C7LHvF4L.mjs} +1 -1
- package/dist/{better-auth-shared-CQFdtguU.d.mts → better-auth-shared-ajs3LNrY.d.mts} +1 -1
- package/dist/{build-cmd-JTsXXf2F.mjs → build-cmd-Dq8tdqQG.mjs} +1 -1
- package/dist/{cache-D0m3Z_Xf.mjs → cache-DGMnskX7.mjs} +1 -1
- package/dist/{cancel-deploy-Ce6Os4fa.mjs → cancel-deploy-96S5hD1E.mjs} +1 -1
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/{cli-main-rkrJy2Ge.mjs → cli-main-CQRLxZAu.mjs} +28 -28
- package/dist/client-66c0RLDM.mjs +1 -0
- package/dist/{client-SZPyj4X_.mjs → client-D6w5x7hM.mjs} +7 -7
- package/dist/{cloudflare-auth-7jTqy9Bx.mjs → cloudflare-auth-pNvmT6kL.mjs} +1 -1
- package/dist/{cloudflare-cmd-ChPLQcTP.mjs → cloudflare-cmd-BuuHUM4z.mjs} +3 -3
- package/dist/{cloudflare-config-DtOGAbeB.mjs → cloudflare-config-PxbinLLE.mjs} +2 -2
- package/dist/{cloudflare-connect-Co93VYTo.mjs → cloudflare-connect-D1QOosLd.mjs} +2 -2
- package/dist/{cloudflare-operations-CXaDKYj2.mjs → cloudflare-operations-G5AObYzF.mjs} +5 -5
- package/dist/{cloudflare-operations-DATekLwI.mjs → cloudflare-operations-I4t3mt4R.mjs} +1 -1
- package/dist/{cloudflare-process-DmTxZR-N.mjs → cloudflare-process-wcnaQ5JG.mjs} +2 -2
- package/dist/{config-wo2EaH0X.mjs → config-C1DPf8EK.mjs} +1 -1
- package/dist/{config-CTlUaXWZ.d.mts → config-CCWVY7DY.d.mts} +1 -1
- package/dist/{config-5oSQhZNj.mjs → config-CzFdJYNA.mjs} +1 -1
- package/dist/{config-DcqUBGCb.mjs → config-DlWQ_hIJ.mjs} +3 -3
- package/dist/{config-eeDzKBS9.mjs → config-Do7gJI3T.mjs} +2 -2
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-DlvXt1JR.mjs → connect-4uImOwut.mjs} +4 -4
- package/dist/{create-project-CC_7hmYJ.mjs → create-project-BaUzZnLZ.mjs} +1 -1
- package/dist/{create-project-DzY05xqC.mjs → create-project-CQMyzTvK.mjs} +1 -1
- package/dist/{db-FhyYGcJJ.mjs → db-DEpDeDsi.mjs} +19 -19
- package/dist/{db-types-sVwEpyPR.mjs → db-types-BpPYAx0B.mjs} +1 -1
- package/dist/{delete-CModjyOC.mjs → delete-BVD2kI82.mjs} +1 -1
- package/dist/deploy-Dr_Qamzw.mjs +2 -0
- package/dist/{deploy-Cz9TEzZy.mjs → deploy-Dyeo5soA.mjs} +24 -75
- package/dist/{deploy-managed-static-DlxxXkAM.mjs → deploy-managed-static-Kn73R83A.mjs} +20 -20
- package/dist/{deploy-transport-DUvm6-CR.mjs → deploy-transport-BpKBs_KR.mjs} +2 -2
- package/dist/deploy.mjs +6 -6
- package/dist/discover-Diq0l6TZ.mjs +1 -0
- package/dist/{discover-CVFCWU7W.mjs → discover-Vd18lHsj.mjs} +1 -1
- package/dist/{dispatch-CCiaAnSK.mjs → dispatch-BBfb519j.mjs} +5 -5
- package/dist/{domain-DvdZPA50.mjs → domain-BTIdyUVk.mjs} +2 -2
- package/dist/{email-ASpNrfLd.mjs → email-DvrS-I0U.mjs} +7 -7
- package/dist/{email-cloudflare-kqoN9jst.mjs → email-cloudflare-DAGpgzY1.mjs} +3 -3
- package/dist/{entry-BweGTCgj.mjs → entry-DMgR7XOf.mjs} +1 -1
- package/dist/{env-Bpkg3G5i.mjs → env-D7vORwpn.mjs} +4 -4
- package/dist/{env-types-Dz9qkiOn.mjs → env-types-WEZw5D-r.mjs} +1 -1
- package/dist/{env-validation-CN386Utu.mjs → env-validation-DKDcpxbt.mjs} +1 -1
- package/dist/{env-validation-BpCCQE_6.mjs → env-validation-DeYNRp1d.mjs} +3 -3
- package/dist/{gen-upKJChvd.mjs → gen-DimkGNve.mjs} +4 -4
- package/dist/gen-DmEeVEs4.mjs +1 -0
- package/dist/{github-cmd-BvMOlb8Z.mjs → github-cmd-D-zs6VQr.mjs} +1 -1
- package/dist/{handler-BO7Od-z9.d.mts → handler-6fzr_ikp.d.mts} +3 -3
- package/dist/{head-MeF_5M_3.d.mts → head-CVO92KEx.d.mts} +14 -3
- package/dist/{head-5XPcnG-j.mjs → head-CWJhfUwV.mjs} +62 -3
- package/dist/{headers-COGEDoMN.mjs → headers-Q0kZDpk8.mjs} +1 -1
- package/dist/{help-TPCjTu6e.mjs → help-Cgdcd-SG.mjs} +4 -4
- package/dist/help-Cp3K5m1w.mjs +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +23 -23
- package/dist/{info-EsDyihwf.mjs → info-BbxQ34kk.mjs} +4 -4
- package/dist/{init-a4lVagrb.mjs → init-zyRj3QRw.mjs} +14 -14
- package/dist/{link-CE55DDzS.mjs → link-DAFXuIER.mjs} +2 -2
- package/dist/{list-CxRthQks.mjs → list-BTIcC3W9.mjs} +2 -2
- package/dist/{live-Kc55iuOQ.d.mts → live-DBybyDt0.d.mts} +2 -2
- package/dist/{live-CYJ4KGoR.mjs → live-Dw7NF1t2.mjs} +1 -1
- package/dist/load-user-env-ztmIyiLx.mjs +34 -0
- package/dist/{local-d1-CFcH9Bx3.mjs → local-d1-BnVb7Fem.mjs} +1 -1
- package/dist/login-DBs8JuSl.mjs +1 -0
- package/dist/{login-AfcSGSmE.mjs → login-DOE-MkeK.mjs} +2 -2
- package/dist/{logs-BgRJuvb1.mjs → logs-CUsjihc3.mjs} +2 -2
- package/dist/migrate-BYhoIK9R.mjs +1 -0
- package/dist/{migrate-BNAh6m_C.mjs → migrate-DtoKdGas.mjs} +4 -4
- package/dist/nitro.mjs +3 -3
- package/dist/{node-CXFUw0Uz.mjs → node-D9dPyUr0.mjs} +2 -2
- package/dist/operator-ai-logging-DFTEp81Z.mjs +121 -0
- package/dist/{operator-args-DGTuCdSE.mjs → operator-args-BCCohcz3.mjs} +3 -2
- package/dist/{operator-cmd-C-viB7Si.mjs → operator-cmd-CQOQrUiO.mjs} +26 -6
- package/dist/operator-cmd-xCACDtT1.mjs +1 -0
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +15 -13
- package/dist/pages/head.d.mts +2 -2
- package/dist/pages/head.mjs +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +5 -1
- package/dist/pages/islands-plugin.mjs +6 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/platform-args-DSi4_M8n.mjs +1 -0
- package/dist/{platform-args-CiYeZmc5.mjs → platform-args-DtpHS_75.mjs} +1 -1
- package/dist/{platform-auth-config-Dt2qEc2w.mjs → platform-auth-config-fLwIS5VG.mjs} +3 -3
- package/dist/{platform-auth-protection-B7TaF-PZ.mjs → platform-auth-protection-BTRI_YwD.mjs} +2 -2
- package/dist/{platform-auth-recovery-suXSteJ6.mjs → platform-auth-recovery-DPK2Mvmo.mjs} +2 -2
- package/dist/{platform-cmd-DuAsIxbU.mjs → platform-cmd-BLy5uCa-.mjs} +1 -1
- package/dist/{platform-cmd-9rvYBBtr.mjs → platform-cmd-HS_FSthn.mjs} +5 -5
- package/dist/{platform-domain-DhH_vDr6.mjs → platform-domain-CHpcq_qg.mjs} +2 -2
- package/dist/{platform-lifecycle-3uI-E2bF.mjs → platform-lifecycle-B6LUBwjS.mjs} +1 -1
- package/dist/{platform-lifecycle-CXmXe2xt.mjs → platform-lifecycle-D2RS7DE0.mjs} +236 -26
- package/dist/{platform-management-PdrgDQTe.mjs → platform-management-C-T0ch4y.mjs} +1 -1
- package/dist/{platform-management-BBCHfwji.mjs → platform-management-d3ETv3Dw.mjs} +14 -14
- package/dist/{platform-plans-config-BGwkXYDM.mjs → platform-plans-config-B7yJQKf7.mjs} +114 -30
- package/dist/{platform-recovery-C8NxXGRR.mjs → platform-recovery-DS5CAsly.mjs} +2 -2
- package/dist/{plugin-inference-CErfTgEx.mjs → plugin-inference-DZHmVe1f.mjs} +3 -3
- package/dist/{prepare-BDKWZgfL.mjs → prepare-AVM4Hj3T.mjs} +8 -8
- package/dist/prepare-BSXKz6m8.mjs +1 -0
- package/dist/{prepare-BLrzXjIl.mjs → prepare-DMk8NAO-.mjs} +1 -1
- package/dist/{project-cmd-DzGvxXKH.mjs → project-cmd-TQKAOTMV.mjs} +15 -15
- package/dist/{project-paths-G0yut6Zz.mjs → project-paths-CUhCPMpK.mjs} +33 -2
- package/dist/{project-team-C5XtHbZk.mjs → project-team-B1OKeb-T.mjs} +1 -1
- package/dist/{project-token-B4D5yhHQ.mjs → project-token-RW_wpmN-.mjs} +1 -1
- package/dist/{project-tsconfig-nhnTWO_Y.mjs → project-tsconfig-MyRJgufB.mjs} +1 -1
- package/dist/{project-zero-trust--0LvktDg.mjs → project-zero-trust-TNc66p0_.mjs} +1 -1
- package/dist/{protocol-B1Tvc9-x.mjs → protocol-IPSWHolJ.mjs} +54 -19
- package/dist/{protocol-Cg2I81NA.d.mts → protocol-YS3tbxWE.d.mts} +2 -2
- package/dist/{provision-CAcrauvr.mjs → provision-BLdkpFT4.mjs} +1 -1
- package/dist/{provision-C3yiHdld.mjs → provision-bgQTi5QZ.mjs} +2 -2
- package/dist/redirect-Dqb4fEc5.mjs +80 -0
- package/dist/{requests-CrRiTgQA.mjs → requests-Cj15-yrI.mjs} +1 -1
- package/dist/{rollback-BsmQyj-Q.mjs → rollback-CYnkng7B.mjs} +2 -2
- package/dist/{route-types-CgtlFCDz.mjs → route-types-C6eAOmOj.mjs} +1 -1
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/auth.mjs +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/routing.d.mts +2 -2
- package/dist/runtime/routing.mjs +6 -5
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-BJ3bj6aP.mjs → scan-4YOxDaw2.mjs} +2 -2
- package/dist/{secret-D0g5oBsP.mjs → secret-BSf7dgg_.mjs} +3 -3
- package/dist/{action-key-ByZ6DDld.mjs → url-DaehRGKR.mjs} +43 -1
- package/dist/{version-metadata-eUd6Ar_U.mjs → version-metadata-CeftH0fQ.mjs} +1 -1
- package/dist/{wrangler-k40T7XTQ.mjs → wrangler-B1gkT_wC.mjs} +3 -3
- package/dist/wrangler-fNGvPTlO.mjs +1 -0
- package/dist/{wrapper-CVMZarxf.mjs → wrapper-xJ4LP5A7.mjs} +3 -3
- package/dist/{ws--U7QicYy.d.mts → ws-C2zy0QBf.d.mts} +2 -2
- package/docs/guide/ai.md +1 -1
- package/docs/guide/app-types.md +1 -1
- package/docs/guide/auth.md +22 -27
- package/docs/guide/database/d1.md +4 -2
- package/docs/guide/database.md +29 -27
- package/docs/guide/deployment.md +2 -2
- package/docs/guide/edge/headers.md +3 -3
- package/docs/guide/edge/prerendering.md +5 -5
- package/docs/guide/edge/redirects.md +1 -1
- package/docs/guide/edge/revalidation.md +4 -2
- package/docs/guide/edge/rewrites.md +1 -1
- package/docs/guide/edge/static-assets.md +4 -0
- package/docs/guide/email/sending.md +4 -2
- package/docs/guide/live.md +1 -1
- package/docs/guide/pages-routing/actions-and-forms.md +25 -7
- package/docs/guide/pages-routing/errors.md +17 -9
- package/docs/guide/pages-routing/head.md +44 -1
- package/docs/guide/pages-routing/islands.md +3 -1
- package/docs/guide/pages-routing/layouts.md +2 -2
- package/docs/guide/pages-routing/loaders.md +3 -1
- package/docs/guide/pages-routing/markdown.md +5 -3
- package/docs/guide/pages-routing/overview.md +14 -21
- package/docs/guide/platform/administration/connected-apps.md +10 -3
- package/docs/guide/platform/administration/email.md +1 -1
- package/docs/guide/platform/administration/plans.md +34 -1
- package/docs/guide/platform/administration/projects.md +6 -2
- package/docs/guide/platform/installation/credentials.md +12 -10
- package/docs/guide/platform/installation/maintenance.md +7 -1
- package/docs/guide/platform/installation/setup.md +8 -7
- package/docs/guide/queues.md +1 -1
- package/docs/guide/server-routing.md +2 -2
- package/docs/guide/sse.md +1 -1
- package/docs/guide/ssg.md +17 -6
- package/docs/guide/storage.md +1 -1
- package/docs/guide/testing.md +9 -7
- package/docs/guide/type-safety.md +23 -21
- package/docs/integrations/cloudflare.md +6 -2
- package/docs/integrations/frameworks/nuxt.md +1 -1
- package/docs/integrations/hono.md +21 -0
- package/docs/integrations/nodejs-bun-deno.md +4 -4
- package/docs/reference/api/auth.md +22 -4
- package/docs/reference/api/database.md +2 -2
- package/docs/reference/api/pages.md +17 -13
- package/docs/reference/api/resources.md +1 -1
- package/docs/reference/api/rewrites.md +8 -4
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/deploy.md +4 -2
- package/docs/reference/cli/platform-config.md +3 -3
- package/docs/reference/cli/platform-users.md +58 -11
- package/docs/reference/cli.md +1 -1
- package/docs/reference/config.md +7 -3
- package/package.json +7 -7
- package/skills/void/SKILL.md +1 -1
- package/dist/client-D1Vz1Zep.mjs +0 -1
- package/dist/deploy-DMieisRu.mjs +0 -2
- package/dist/discover-1DJD4YXD.mjs +0 -1
- package/dist/gen-M5fNQKfH.mjs +0 -1
- package/dist/help-CItQVDL4.mjs +0 -1
- package/dist/load-user-env-CSwdofj0.mjs +0 -48
- package/dist/login-ZHsAm-I6.mjs +0 -1
- package/dist/migrate-BflbbZQK.mjs +0 -1
- package/dist/operator-cmd-D6qNuJ_z.mjs +0 -1
- package/dist/platform-args-DJvF1-kl.mjs +0 -1
- package/dist/prepare-a1_5usAn.mjs +0 -1
- package/dist/url-CuoEn0o3.mjs +0 -43
- package/dist/wrangler-R3kMdJfw.mjs +0 -1
|
@@ -2,15 +2,15 @@ import { A as confirm, H as outro, K as select, L as log, U as password, X as te
|
|
|
2
2
|
import { a as join, c as resolve, n as dirname } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { f as import_picocolors, l as formatUrl, m as printSuccess, n as cliCommandName, p as note, r as createSpinner, u as getErrorMessage } from "./output-DNVILSz2.mjs";
|
|
4
4
|
import { t as cfAccessHeaders } from "./cf-access-pejlJmuy.mjs";
|
|
5
|
-
import { o as createDefaultRunWrangler, v as resolvePinnedApiBaseUrl } from "./provision-
|
|
5
|
+
import { o as createDefaultRunWrangler, v as resolvePinnedApiBaseUrl } from "./provision-bgQTi5QZ.mjs";
|
|
6
6
|
import { a as platformManagementSetupPage, c as platformSetupLink, d as planWritesDns, i as platformInstallCommandArguments, l as platformSetupPages, n as formatPlatformSetupPlan, o as platformPromptAnswer, r as openPlatformSetupPage, s as platformSetupFieldHelp, t as formatPlatformInstallCommand, u as planCreatesZone } from "./platform-setup-Casiffqj.mjs";
|
|
7
|
-
import { o as runCloudflareAuthCommand } from "./cloudflare-auth-
|
|
8
|
-
import { l as resolveCloudflareOperationArgv } from "./cloudflare-process-
|
|
7
|
+
import { o as runCloudflareAuthCommand } from "./cloudflare-auth-pNvmT6kL.mjs";
|
|
8
|
+
import { l as resolveCloudflareOperationArgv } from "./cloudflare-process-wcnaQ5JG.mjs";
|
|
9
9
|
import { S as writePendingInstallationSecrets, a as latestPlatformWorkerCutoverGeneration, c as normalizePlatformApiUrl, d as platformRegistryDirectory, f as platformWorkerSecretUpdateIntentState, h as readPendingInstallationSecrets, m as readInstallationRecoverySecrets, n as assertPlatformInstallationSlugAvailable, o as listInstallationManifests, p as promoteInstallationSecrets, t as acquirePlatformLifecycleLock, v as resolveInstallationManifest, x as writeInstallationManifest, y as savePlatformConnection } from "./platform-registry-DZ_2Xuqd.mjs";
|
|
10
10
|
import { t as ensurePlatformAccessToken } from "./cf-access-Dnyw8KFY.mjs";
|
|
11
11
|
import { i as updateProjectWorkerRuntimeLogs, n as assertPlatformRuntimeLogsSupported, r as shouldUpdateProjectWorkerRuntimeLogs } from "./platform-runtime-logs-CdJGnk3f.mjs";
|
|
12
12
|
import { t as writeFileAtomic } from "./atomic-write-DA6eD1Kp.mjs";
|
|
13
|
-
import { t as parsePlatformArgs } from "./platform-args-
|
|
13
|
+
import { t as parsePlatformArgs } from "./platform-args-DtpHS_75.mjs";
|
|
14
14
|
import { copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
import { isRecord } from "@void/deploy-core";
|
|
@@ -21,7 +21,9 @@ import { stripVTControlCharacters } from "node:util";
|
|
|
21
21
|
import { readFile } from "node:fs/promises";
|
|
22
22
|
import { cloudflareCommandDiagnostic, encodeCloudflareVersionMessage, parseCloudflareVersionMessage, readCloudflareTriggerConfig, readCloudflareVersionMigrationTag, stabilizeCloudflareVersionTriggers } from "@void/deploy-cloudflare";
|
|
23
23
|
import { createServer, request } from "node:http";
|
|
24
|
+
import { createDefaultPlanCatalog, parsePlatformPlanCatalog } from "@void/platform/plans";
|
|
24
25
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
26
|
+
import { AI_LOGGING_ORPHAN_GRACE_MS, PLAN_AI_LOGGING_SETTING, aiLoggingClearedKey, aiLoggingClearedMarker, aiLoggingKey, isPublishedAiLoggingMode, parseAiLoggingKeyMetadata, parsePlanAiLoggingSettings, planAiLogging, resolveAiLogging } from "@void/platform/ai-logging";
|
|
25
27
|
import { PLATFORM_ADMIN_ASSETS_DIRECTORY, platformDatabaseSchemaDigest, resolvePlatformRuntime } from "@void/platform/installer";
|
|
26
28
|
import { request as request$1 } from "node:https";
|
|
27
29
|
// src/cli/platform-cloudflare.ts
|
|
@@ -68,6 +70,8 @@ var PlatformRuntimeTokenEmailPermissionError = class extends Error {
|
|
|
68
70
|
this.tokenNotValid = tokenNotValid;
|
|
69
71
|
}
|
|
70
72
|
};
|
|
73
|
+
/** Largest number of pairs or keys one KV bulk request accepts. */
|
|
74
|
+
const KV_BULK_LIMIT = 1e4;
|
|
71
75
|
async function verifyPlatformRuntimeTokenPermissions(client, input) {
|
|
72
76
|
try {
|
|
73
77
|
await client.listHyperdriveConfigs(input.accountId);
|
|
@@ -556,6 +560,47 @@ var PlatformCloudflareClient = class PlatformCloudflareClient {
|
|
|
556
560
|
headers: { "Content-Type": "application/json" }
|
|
557
561
|
});
|
|
558
562
|
}
|
|
563
|
+
/** Every key under `prefix`, with its metadata, across all list pages. */
|
|
564
|
+
async listKvKeys(accountId, namespaceId, prefix) {
|
|
565
|
+
const keys = [];
|
|
566
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
567
|
+
let cursor = "";
|
|
568
|
+
for (;;) {
|
|
569
|
+
const query = new URLSearchParams({
|
|
570
|
+
prefix,
|
|
571
|
+
limit: "1000"
|
|
572
|
+
});
|
|
573
|
+
if (cursor) query.set("cursor", cursor);
|
|
574
|
+
const { result, resultInfo } = await this.#requestEnvelope(`/accounts/${encodeURIComponent(accountId)}/storage/kv/namespaces/${encodeURIComponent(namespaceId)}/keys?${query}`);
|
|
575
|
+
if (!Array.isArray(result)) throw new Error("platform: Cloudflare returned an invalid KV key list.");
|
|
576
|
+
for (const entry of result) {
|
|
577
|
+
const name = requiredString(entry.name, "KV key name");
|
|
578
|
+
keys.push(entry.metadata === void 0 ? { name } : {
|
|
579
|
+
name,
|
|
580
|
+
metadata: entry.metadata
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
const next = resultInfo?.cursor ?? "";
|
|
584
|
+
if (!next) return keys;
|
|
585
|
+
if (seenCursors.has(next)) throw new Error("platform: Cloudflare returned a repeated KV key cursor.");
|
|
586
|
+
seenCursors.add(next);
|
|
587
|
+
cursor = next;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
/** Writes up to KV_BULK_LIMIT pairs per request; fails if any key is not written. */
|
|
591
|
+
async putKvBulk(accountId, namespaceId, entries) {
|
|
592
|
+
for (let offset = 0; offset < entries.length; offset += KV_BULK_LIMIT) assertKvBulkComplete(await this.request(`/accounts/${encodeURIComponent(accountId)}/storage/kv/namespaces/${encodeURIComponent(namespaceId)}/bulk`, {
|
|
593
|
+
method: "PUT",
|
|
594
|
+
body: JSON.stringify(entries.slice(offset, offset + KV_BULK_LIMIT))
|
|
595
|
+
}), "write");
|
|
596
|
+
}
|
|
597
|
+
/** Deletes up to KV_BULK_LIMIT keys per request; a missing key counts as deleted. */
|
|
598
|
+
async deleteKvBulk(accountId, namespaceId, keys) {
|
|
599
|
+
for (let offset = 0; offset < keys.length; offset += KV_BULK_LIMIT) assertKvBulkComplete(await this.request(`/accounts/${encodeURIComponent(accountId)}/storage/kv/namespaces/${encodeURIComponent(namespaceId)}/bulk/delete`, {
|
|
600
|
+
method: "POST",
|
|
601
|
+
body: JSON.stringify(keys.slice(offset, offset + KV_BULK_LIMIT))
|
|
602
|
+
}), "delete");
|
|
603
|
+
}
|
|
559
604
|
async getKvValue(accountId, namespaceId, key) {
|
|
560
605
|
const response = await this.#fetcher(`${this.apiBaseUrl}/accounts/${encodeURIComponent(accountId)}/storage/kv/namespaces/${encodeURIComponent(namespaceId)}/values/${encodeURIComponent(key)}`, {
|
|
561
606
|
headers: { Authorization: `Bearer ${this.#token}` },
|
|
@@ -852,6 +897,14 @@ function withCreatedAt(value) {
|
|
|
852
897
|
const time = Date.parse(zoneless ? `${value.replace(" ", "T")}Z` : value);
|
|
853
898
|
return Number.isNaN(time) ? {} : { createdAt: new Date(time).toISOString() };
|
|
854
899
|
}
|
|
900
|
+
/** A bulk call answers 200 even when some keys failed; treat any failed key as an error. */
|
|
901
|
+
function assertKvBulkComplete(result, operation) {
|
|
902
|
+
const failed = result?.unsuccessful_keys;
|
|
903
|
+
if (failed !== void 0 && failed !== null && (!Array.isArray(failed) || failed.length > 0)) {
|
|
904
|
+
const count = Array.isArray(failed) ? failed.length : "some";
|
|
905
|
+
throw new Error(`platform: Cloudflare did not ${operation} ${count} KV keys in a bulk request.`);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
855
908
|
function requiredString(value, label) {
|
|
856
909
|
if (typeof value !== "string" || value === "") throw new Error(`platform: ${label} is missing from the Cloudflare response.`);
|
|
857
910
|
return value;
|
|
@@ -1876,6 +1929,136 @@ async function readWranglerOAuthCredential(runWrangler) {
|
|
|
1876
1929
|
token: parsed.token.trim()
|
|
1877
1930
|
};
|
|
1878
1931
|
}
|
|
1932
|
+
// src/cli/platform-ai-logging-projection.ts
|
|
1933
|
+
const KEY_PREFIX = aiLoggingKey("");
|
|
1934
|
+
const PLAN_CATALOG_SETTING = "plans:catalog";
|
|
1935
|
+
/** Wait at most this long for a project row lock held by the API. */
|
|
1936
|
+
const LOCK_TIMEOUT = "30s";
|
|
1937
|
+
async function readInputs(client) {
|
|
1938
|
+
const result = await client.query("SELECT \"key\", \"value\" FROM \"platform_settings\" WHERE \"key\" = ANY($1::text[])", [[PLAN_CATALOG_SETTING, PLAN_AI_LOGGING_SETTING]]);
|
|
1939
|
+
const saved = new Map(result.rows.map((row) => [row.key, row.value]));
|
|
1940
|
+
let catalog;
|
|
1941
|
+
let settings;
|
|
1942
|
+
try {
|
|
1943
|
+
const savedCatalog = saved.get(PLAN_CATALOG_SETTING);
|
|
1944
|
+
catalog = savedCatalog === void 0 || savedCatalog === null ? createDefaultPlanCatalog("custom") : parsePlatformPlanCatalog(savedCatalog);
|
|
1945
|
+
settings = parsePlanAiLoggingSettings(saved.get(PLAN_AI_LOGGING_SETTING));
|
|
1946
|
+
} catch (error) {
|
|
1947
|
+
throw new Error(`platform: The saved plan settings are not valid for this platform version, so AI logging settings cannot be published. If a newer platform release saved them, upgrade to that release again. (${error instanceof Error ? error.message : String(error)})`);
|
|
1948
|
+
}
|
|
1949
|
+
return {
|
|
1950
|
+
catalog,
|
|
1951
|
+
settings
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
function effectiveMode(row, inputs) {
|
|
1955
|
+
if (row.mode !== null && !isPublishedAiLoggingMode(row.mode)) throw new Error(`platform: Project ${row.id} has an invalid saved AI logging setting.`);
|
|
1956
|
+
const plan = planAiLogging(inputs.settings, inputs.catalog, row.plan);
|
|
1957
|
+
return resolveAiLogging(row.mode, plan.planMode).mode;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* The database server's clock in ms. Readback and the sweep compare `at` with the
|
|
1961
|
+
* API's clock, so it must not come from the operator's machine.
|
|
1962
|
+
*/
|
|
1963
|
+
async function databaseNow(client) {
|
|
1964
|
+
const result = await client.query("SELECT floor(extract(epoch FROM clock_timestamp()) * 1000)::float8 AS \"now\"");
|
|
1965
|
+
const now = Number(result.rows[0]?.now);
|
|
1966
|
+
if (!Number.isSafeInteger(now)) throw new Error("platform: The database did not return its current time.");
|
|
1967
|
+
return now;
|
|
1968
|
+
}
|
|
1969
|
+
const PROJECT_ROWS = `SELECT p."id", p."status", u."plan", o."mode"
|
|
1970
|
+
FROM "projects" AS p
|
|
1971
|
+
JOIN "users" AS u ON u."id" = p."user_id"
|
|
1972
|
+
LEFT JOIN "project_ai_logging" AS o ON o."project_id" = p."id"`;
|
|
1973
|
+
/**
|
|
1974
|
+
* Publishes every project's effective AI logging mode to ROUTING KV from Postgres,
|
|
1975
|
+
* the same values the API publishes. The installer runs it on every install, upgrade
|
|
1976
|
+
* and repair, once before the Workers upload (a new proxy may go live before the new
|
|
1977
|
+
* API) and once after (the old API may have saved changes meanwhile).
|
|
1978
|
+
*
|
|
1979
|
+
* It holds the project row locks the API publisher takes while it reads the inputs
|
|
1980
|
+
* and writes KV, so it never overwrites a newer value the API published. Running it
|
|
1981
|
+
* again changes nothing.
|
|
1982
|
+
*/
|
|
1983
|
+
async function projectPlatformAiLoggingConnection(client, kv, options = {}) {
|
|
1984
|
+
if ((await client.query(`SELECT to_regclass('public.project_ai_logging') IS NOT NULL AS "present"`)).rows[0]?.present !== true) return { skipped: true };
|
|
1985
|
+
const listed = /* @__PURE__ */ new Map();
|
|
1986
|
+
for (const key of await kv.list(KEY_PREFIX)) if (key.name.startsWith(KEY_PREFIX) && key.name.length > KEY_PREFIX.length) listed.set(key.name.slice(KEY_PREFIX.length), key);
|
|
1987
|
+
await client.query("BEGIN");
|
|
1988
|
+
try {
|
|
1989
|
+
await client.query(`SET LOCAL lock_timeout = '${LOCK_TIMEOUT}'`);
|
|
1990
|
+
const before = await readInputs(client);
|
|
1991
|
+
const rows = (await client.query(PROJECT_ROWS)).rows;
|
|
1992
|
+
const candidates = rows.filter((row) => row.mode !== null || listed.has(row.id) || effectiveMode(row, before) !== "inherit").map((row) => row.id);
|
|
1993
|
+
options.onProgress?.(`Publishing AI logging settings (${candidates.length} projects)`);
|
|
1994
|
+
if (candidates.length > 0) await client.query("SELECT \"id\" FROM \"projects\" WHERE \"id\" = ANY($1::text[]) ORDER BY \"id\" FOR NO KEY UPDATE", [candidates]);
|
|
1995
|
+
const inputs = await readInputs(client);
|
|
1996
|
+
const locked = new Set(candidates);
|
|
1997
|
+
const current = new Map((await client.query(`${PROJECT_ROWS} WHERE p."id" = ANY($1::text[])`, [candidates])).rows.map((row) => [row.id, row]));
|
|
1998
|
+
const at = options.now ? options.now() : await databaseNow(client);
|
|
1999
|
+
const writes = [];
|
|
2000
|
+
const deletes = [];
|
|
2001
|
+
let markers = 0;
|
|
2002
|
+
for (const id of locked) {
|
|
2003
|
+
const row = current.get(id);
|
|
2004
|
+
if (!row) continue;
|
|
2005
|
+
if (row.status !== "active") continue;
|
|
2006
|
+
const mode = effectiveMode(row, inputs);
|
|
2007
|
+
if (mode !== "inherit") writes.push({
|
|
2008
|
+
key: aiLoggingKey(id),
|
|
2009
|
+
value: mode,
|
|
2010
|
+
metadata: {
|
|
2011
|
+
mode,
|
|
2012
|
+
at
|
|
2013
|
+
}
|
|
2014
|
+
});
|
|
2015
|
+
else if (listed.has(id)) {
|
|
2016
|
+
const marker = aiLoggingClearedMarker(at);
|
|
2017
|
+
writes.push({
|
|
2018
|
+
key: aiLoggingClearedKey(id),
|
|
2019
|
+
value: marker.value,
|
|
2020
|
+
metadata: marker.metadata,
|
|
2021
|
+
expiration_ttl: marker.expirationTtl
|
|
2022
|
+
});
|
|
2023
|
+
markers++;
|
|
2024
|
+
deletes.push(aiLoggingKey(id));
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
const existing = new Set(rows.map((row) => row.id));
|
|
2028
|
+
for (const [id, key] of listed) {
|
|
2029
|
+
if (existing.has(id) || current.has(id)) continue;
|
|
2030
|
+
const metadata = parseAiLoggingKeyMetadata(key.metadata);
|
|
2031
|
+
if (!metadata || at - metadata.at >= AI_LOGGING_ORPHAN_GRACE_MS) deletes.push(key.name);
|
|
2032
|
+
}
|
|
2033
|
+
if (writes.length > 0) await kv.put(writes);
|
|
2034
|
+
if (deletes.length > 0) await kv.delete(deletes);
|
|
2035
|
+
await client.query("COMMIT");
|
|
2036
|
+
return {
|
|
2037
|
+
skipped: false,
|
|
2038
|
+
projects: locked.size,
|
|
2039
|
+
written: writes.length - markers,
|
|
2040
|
+
deleted: deletes.length
|
|
2041
|
+
};
|
|
2042
|
+
} catch (error) {
|
|
2043
|
+
await client.query("ROLLBACK").catch(() => void 0);
|
|
2044
|
+
throw error;
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Runs the projection through the installer's database lock, with a KV client bound
|
|
2049
|
+
* to the installation's ROUTING namespace. A lock without it (test doubles) skips it.
|
|
2050
|
+
*/
|
|
2051
|
+
async function publishInstallationAiLogging(input) {
|
|
2052
|
+
const publish = input.databaseLock.publishAiLogging;
|
|
2053
|
+
if (!publish) return null;
|
|
2054
|
+
const { client, accountId, routingKvId } = input;
|
|
2055
|
+
input.onProgress?.("Publishing AI logging settings");
|
|
2056
|
+
return publish({
|
|
2057
|
+
list: (prefix) => client.listKvKeys(accountId, routingKvId, prefix),
|
|
2058
|
+
put: (entries) => client.putKvBulk(accountId, routingKvId, entries),
|
|
2059
|
+
delete: (keys) => client.deleteKvBulk(accountId, routingKvId, keys)
|
|
2060
|
+
}, input.onProgress);
|
|
2061
|
+
}
|
|
1879
2062
|
// src/cli/platform-app-access.ts
|
|
1880
2063
|
async function selectInstallationAppAccess(authentication, recorded, choice) {
|
|
1881
2064
|
const config = authentication.file?.appAccess;
|
|
@@ -5509,7 +5692,7 @@ async function verifyInstalledPlatformAccessProtection(input) {
|
|
|
5509
5692
|
}
|
|
5510
5693
|
const existingWorkers = input.plan.actions.filter((action) => action.kind === "worker" && action.action === "update").map((action) => action.name);
|
|
5511
5694
|
if (existingWorkers.length) {
|
|
5512
|
-
const { verifyProtectionWorkerOrigins } = await import("./platform-auth-protection-
|
|
5695
|
+
const { verifyProtectionWorkerOrigins } = await import("./platform-auth-protection-BTRI_YwD.mjs");
|
|
5513
5696
|
await verifyProtectionWorkerOrigins({
|
|
5514
5697
|
request: input.client.request.bind(input.client),
|
|
5515
5698
|
listWorkerDomains: input.client.listWorkerDomains.bind(input.client),
|
|
@@ -6257,6 +6440,7 @@ async function acquirePlatformDatabaseLifecycleLockConnection(client, installati
|
|
|
6257
6440
|
release.readAdministratorSetup = () => readPlatformAdministratorSetupConnection(client);
|
|
6258
6441
|
release.readProjectZeroTrust = () => readPlatformProjectZeroTrustStateConnection(client);
|
|
6259
6442
|
release.readProjects = () => readPlatformProjectSlugsConnection(client);
|
|
6443
|
+
release.publishAiLogging = (kv, onProgress) => projectPlatformAiLoggingConnection(client, kv, { onProgress });
|
|
6260
6444
|
release.lockProjectZeroTrust = () => lockPlatformProjectZeroTrustConnection(client);
|
|
6261
6445
|
release.fenceProjectZeroTrust = () => fencePlatformProjectZeroTrustConnection(client);
|
|
6262
6446
|
release.liftProjectZeroTrustFence = () => liftPlatformProjectZeroTrustFenceConnection(client);
|
|
@@ -6526,6 +6710,13 @@ async function provisionInstallationServices(input) {
|
|
|
6526
6710
|
state.manifest = await preparePlatformDatabaseSchema(state.manifest, runtime, runtimeDirectory, sourcePlatformVersion, hadPriorWorkers, plan, dependencies, releaseDatabaseLock, now, writeRemoteInstallationCheckpoint, (next) => {
|
|
6527
6711
|
state.manifest = next;
|
|
6528
6712
|
});
|
|
6713
|
+
await publishInstallationAiLogging({
|
|
6714
|
+
client: dependencies.client,
|
|
6715
|
+
accountId: plan.account.id,
|
|
6716
|
+
routingKvId: requireId(Object.fromEntries(state.manifest.resources.map((resource) => [resource.key, resource.id])), "routing-kv"),
|
|
6717
|
+
databaseLock: releaseDatabaseLock,
|
|
6718
|
+
onProgress: dependencies.onProgress
|
|
6719
|
+
});
|
|
6529
6720
|
dependencies.onProgress?.("Checking platform safety");
|
|
6530
6721
|
const targetSandboxDrainProtocol = runtime.safetyProtocols.sandboxDrain;
|
|
6531
6722
|
const prepareSandboxDrain = dependencies.prepareSandboxDrain ?? releaseDatabaseLock.prepareSandboxDrain;
|
|
@@ -6995,6 +7186,13 @@ async function installPlatform(plan, secrets, existing, dependencies) {
|
|
|
6995
7186
|
runParallelPinnedPlatformWrangler,
|
|
6996
7187
|
runPinnedPlatformWrangler
|
|
6997
7188
|
});
|
|
7189
|
+
await publishInstallationAiLogging({
|
|
7190
|
+
client: dependencies.client,
|
|
7191
|
+
accountId: state.plan.account.id,
|
|
7192
|
+
routingKvId: requireId(ids, "routing-kv"),
|
|
7193
|
+
databaseLock: releaseDatabaseLock,
|
|
7194
|
+
onProgress: dependencies.onProgress
|
|
7195
|
+
});
|
|
6998
7196
|
state.manifest = setInstallationEndpoints(state.manifest, {
|
|
6999
7197
|
apiUrl: state.plan.apiUrl,
|
|
7000
7198
|
dashboardUrl: platformDashboardUrl(state.plan.deployment),
|
|
@@ -7698,6 +7896,23 @@ async function uploadPlatformWorkerOutsideChanges(configs, input) {
|
|
|
7698
7896
|
input.progress?.resume();
|
|
7699
7897
|
}
|
|
7700
7898
|
}
|
|
7899
|
+
// src/cli/platform-progress.ts
|
|
7900
|
+
function createPlatformProgress(message) {
|
|
7901
|
+
const progress = createSpinner({ onCancel: () => {
|
|
7902
|
+
if (!process.emit("SIGINT")) process.exit(130);
|
|
7903
|
+
} });
|
|
7904
|
+
if (message !== void 0) progress.start(message);
|
|
7905
|
+
return progress;
|
|
7906
|
+
}
|
|
7907
|
+
/** Clear a preflight phase before a plan, prompt, or error takes over the terminal. */
|
|
7908
|
+
async function withPlatformProgress(message, action) {
|
|
7909
|
+
const progress = createPlatformProgress(message);
|
|
7910
|
+
try {
|
|
7911
|
+
return await action();
|
|
7912
|
+
} finally {
|
|
7913
|
+
progress.clear();
|
|
7914
|
+
}
|
|
7915
|
+
}
|
|
7701
7916
|
// src/cli/platform-saved-plans.ts
|
|
7702
7917
|
function planId(args) {
|
|
7703
7918
|
return createHash("sha256").update(JSON.stringify([args.account, args.name])).digest("hex");
|
|
@@ -7820,15 +8035,16 @@ function resolvePlatformInstallDatabaseUrl(checkpoint, manifest = null) {
|
|
|
7820
8035
|
}
|
|
7821
8036
|
async function runPlatformLifecycleCommand(commandArgs) {
|
|
7822
8037
|
if (commandArgs.subcommand === "domain") {
|
|
7823
|
-
const { runPlatformDomainCommand } = await import("./platform-domain-
|
|
8038
|
+
const { runPlatformDomainCommand } = await import("./platform-domain-CHpcq_qg.mjs");
|
|
7824
8039
|
await runPlatformDomainCommand(commandArgs);
|
|
7825
8040
|
return;
|
|
7826
8041
|
}
|
|
7827
8042
|
if (commandArgs.subcommand === "discover") {
|
|
8043
|
+
log.step("Preparing platform discovery");
|
|
7828
8044
|
const client = new PlatformCloudflareClient((await resolvePlatformCloudflareCredential()).token);
|
|
7829
|
-
const accountId = await selectAccount(await readAccounts(client), commandArgs.account);
|
|
7830
|
-
const { recoverPlatformInstallations } = await import("./platform-recovery-
|
|
7831
|
-
const recovered = await recoverPlatformInstallations(client, accountId, void 0, commandArgs.selector);
|
|
8045
|
+
const accountId = await selectAccount(await withPlatformProgress("Reading Cloudflare accounts", () => readAccounts(client)), commandArgs.account);
|
|
8046
|
+
const { recoverPlatformInstallations } = await import("./platform-recovery-DS5CAsly.mjs");
|
|
8047
|
+
const recovered = await withPlatformProgress("Discovering platform installations", () => recoverPlatformInstallations(client, accountId, void 0, commandArgs.selector));
|
|
7832
8048
|
if (recovered.length === 0) {
|
|
7833
8049
|
log.info(`No recoverable Void platform installations were found in ${accountId}.`);
|
|
7834
8050
|
return;
|
|
@@ -7838,7 +8054,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
7838
8054
|
return;
|
|
7839
8055
|
}
|
|
7840
8056
|
if (commandArgs.subcommand !== "install") {
|
|
7841
|
-
const { runInstalledPlatformCommand } = await import("./platform-management-
|
|
8057
|
+
const { runInstalledPlatformCommand } = await import("./platform-management-C-T0ch4y.mjs");
|
|
7842
8058
|
await runInstalledPlatformCommand(commandArgs);
|
|
7843
8059
|
return;
|
|
7844
8060
|
}
|
|
@@ -7846,6 +8062,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
7846
8062
|
let runtime = loadPlatformRuntime(args.runtime);
|
|
7847
8063
|
assertNoninteractivePlatformMutationAcknowledged(args, process.stdin.isTTY === true);
|
|
7848
8064
|
console.log();
|
|
8065
|
+
log.step("Preparing platform installation");
|
|
7849
8066
|
let existing = args.resume ? resolveInstallationManifest(args.name) : null;
|
|
7850
8067
|
let selectedInstall = false;
|
|
7851
8068
|
let selectedDraft = false;
|
|
@@ -7951,7 +8168,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
7951
8168
|
return existing.deployment.installationSlug;
|
|
7952
8169
|
});
|
|
7953
8170
|
let client = new PlatformCloudflareClient(operatorCredential.token);
|
|
7954
|
-
const accounts = await readAccounts(client);
|
|
8171
|
+
const accounts = await withPlatformProgress("Reading Cloudflare accounts", () => readAccounts(client));
|
|
7955
8172
|
const accountId = existing ? existing.account.id : await selectAccount(accounts, args.account);
|
|
7956
8173
|
if (existing && args.account && await selectAccount(accounts, args.account) !== existing.account.id) throw new Error("platform: The installation belongs to a different Cloudflare account.");
|
|
7957
8174
|
const recorded = existing?.deployment;
|
|
@@ -7988,13 +8205,6 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
7988
8205
|
}
|
|
7989
8206
|
const release = args.plan ? null : acquirePlatformLifecycleLock(accountId, installationSlug);
|
|
7990
8207
|
let progress;
|
|
7991
|
-
const startProgress = (message) => {
|
|
7992
|
-
const active = createSpinner({ onCancel: () => {
|
|
7993
|
-
if (!process.emit("SIGINT")) process.exit(130);
|
|
7994
|
-
} });
|
|
7995
|
-
active.start(message);
|
|
7996
|
-
return active;
|
|
7997
|
-
};
|
|
7998
8208
|
let usingUnboundDatabase = false;
|
|
7999
8209
|
try {
|
|
8000
8210
|
if (!existing && !args.plan) assertPlatformInstallationSlugAvailable(installationSlug);
|
|
@@ -8007,14 +8217,14 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8007
8217
|
let authoritativeProvisionIntents = false;
|
|
8008
8218
|
if (existing && !isPlatformSetupDraft(existing)) {
|
|
8009
8219
|
if (!databaseUrl) throw new Error("platform: DATABASE_URL is required to verify an interrupted installation before resuming it.");
|
|
8010
|
-
progress =
|
|
8220
|
+
progress = createPlatformProgress("Reading the saved installation");
|
|
8011
8221
|
usingUnboundDatabase = !isPlatformInstallDatabaseBound(checkpoint, existing);
|
|
8012
8222
|
const authoritative = await readPlatformDatabaseLifecycleManifest(databaseUrl, existing.id, existing.ownershipNonce);
|
|
8013
8223
|
usingUnboundDatabase = false;
|
|
8014
8224
|
progress?.stop("Read the saved installation.");
|
|
8015
8225
|
progress = void 0;
|
|
8016
8226
|
if (authoritative) {
|
|
8017
|
-
const { selectAuthoritativePlatformManifest } = await import("./platform-management-
|
|
8227
|
+
const { selectAuthoritativePlatformManifest } = await import("./platform-management-C-T0ch4y.mjs");
|
|
8018
8228
|
const selected = selectAuthoritativePlatformManifest(existing, authoritative);
|
|
8019
8229
|
authoritativeProvisionIntents = true;
|
|
8020
8230
|
if (!args.plan && JSON.stringify(selected) !== JSON.stringify(existing)) writeInstallationManifest(selected);
|
|
@@ -8138,7 +8348,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8138
8348
|
enableSandbox: runtime.manifest.safetyProtocols.sandboxDrain >= 3,
|
|
8139
8349
|
deploymentExecution: runtime.manifest.deploymentExecution === 1
|
|
8140
8350
|
};
|
|
8141
|
-
let plan = await createPlatformInstallPlan(client, planInput, existing, planOptions);
|
|
8351
|
+
let plan = await withPlatformProgress("Preparing installation plan", () => createPlatformInstallPlan(client, planInput, existing, planOptions));
|
|
8142
8352
|
assertPlatformRuntimeLogsSupported(plan.deployment, runtime.manifest);
|
|
8143
8353
|
const commandOptions = {
|
|
8144
8354
|
commandName: cliCommandName(),
|
|
@@ -8394,7 +8604,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8394
8604
|
interactive: process.stdin.isTTY === true && process.stdout.isTTY === true && !args.yes,
|
|
8395
8605
|
command: `${cliCommandName()} platform install --resume --name ${existing.id}`
|
|
8396
8606
|
});
|
|
8397
|
-
progress =
|
|
8607
|
+
progress = createPlatformProgress("Installing the platform");
|
|
8398
8608
|
if (credentialSetup) {
|
|
8399
8609
|
saveValues({
|
|
8400
8610
|
jwtSecret: secrets.jwtSecret,
|
|
@@ -8432,7 +8642,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8432
8642
|
ownershipNonce: manifest.ownershipNonce,
|
|
8433
8643
|
yes: args.yes
|
|
8434
8644
|
});
|
|
8435
|
-
progress =
|
|
8645
|
+
progress = createPlatformProgress("Continuing platform installation");
|
|
8436
8646
|
return {
|
|
8437
8647
|
...result,
|
|
8438
8648
|
accessProvisioningJson: values.accessProvisioningJson,
|
|
@@ -8450,7 +8660,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8450
8660
|
checkpoint: values,
|
|
8451
8661
|
save: saveAuthenticationValues
|
|
8452
8662
|
});
|
|
8453
|
-
progress =
|
|
8663
|
+
progress = createPlatformProgress("Continuing platform installation");
|
|
8454
8664
|
return setupJson;
|
|
8455
8665
|
} } : {},
|
|
8456
8666
|
replanWorkers: async (manifest) => (await createPlatformInstallPlan(client, planInput, manifest, {
|
|
@@ -8462,7 +8672,7 @@ async function runPlatformLifecycleCommand(commandArgs) {
|
|
|
8462
8672
|
})).actions.filter((action) => action.kind === "worker"),
|
|
8463
8673
|
revalidateBeforeWorkerDeploy: (manifest, action) => revalidatePlatformInstallAction(client, plan, manifest, action),
|
|
8464
8674
|
verifyExistingOwnership: async (manifest, databaseCheckpointExists) => {
|
|
8465
|
-
const { verifyPlatformInstallationOwnership } = await import("./platform-management-
|
|
8675
|
+
const { verifyPlatformInstallationOwnership } = await import("./platform-management-C-T0ch4y.mjs");
|
|
8466
8676
|
const retainedReplacementKeys = new Set(plan.actions.filter((action) => {
|
|
8467
8677
|
const previous = manifest.resources.find((resource) => resource.key === action.key);
|
|
8468
8678
|
return action.action === "create" && previous && previous.name !== action.name;
|
|
@@ -8629,4 +8839,4 @@ async function promptSecret(message, masked = true, validate, placeholder) {
|
|
|
8629
8839
|
if (isCancel(value) || typeof value === "symbol") throw new Error("platform: Cancelled.");
|
|
8630
8840
|
return value;
|
|
8631
8841
|
}
|
|
8632
|
-
export {
|
|
8842
|
+
export { hyperdriveOriginConfigHash as $, recordPlatformWorkerTraffic as A, revalidatePlatformInstallAction as B, readPlatformDatabase as C, resolveBootstrapGitHubId as D, createPlatformInstallationSecrets as E, legacyResourceConfigHash as F, verifyPlatformCloudflareCredential as G, turnOffInstalledProjectZeroTrust as H, matchesRecordedR2Fingerprint as I, parsePlatformAccessSetupSpec as J, activatePlatformAccessCredentials as K, platformAdoptionIntentHash as L, dnsRecordConfigHash as M, formatPlatformInstallPlan as N, recordResource as O, hasProvisionIntentStep as P, PlatformRuntimeTokenEmailPermissionError as Q, r2BucketConfigHash as R, formatZeroTrustApplications as S, createPlatformHealthProbeToken as T, assertPlatformOperatorCredentialCanApplyPlan as U, platformDatabaseNameFromOwnerUrl as V, resolvePlatformCloudflareCredential as W, PlatformCloudflareApiError as X, preparePlatformAccessSetup as Y, PlatformCloudflareClient as Z, acquirePlatformDatabaseLifecycleLockConnection as _, createPlatformProgress as a, readPlatformProjectZeroTrustState as b, formatPlatformWorkerOutsideChanges as c, authenticationSetupRequestHash as d, hyperdriveOriginFromConnectionString as et, readLoginReplacementFile as f, acquirePlatformDatabaseLifecycleLock as g, installPlatform as h, verifyPlatformAiGatewayPlan as i, createPlatformInstallPlan as j, platformTrafficAttachmentWorker as k, reviewPlatformWorkerOutsideChanges as l, REMOTE_INSTALLATION_MANIFEST_KEY as m, resolvePlatformInstallDatabaseUrl as n, verifyPlatformRuntimeTokenEmailPermissions as nt, withPlatformProgress as o, replacePendingInstallationAuthentication as p, checkpointPlatformAccessResources as q, runPlatformLifecycleCommand as r, verifyPlatformRuntimeTokenPermissions as rt, findPlatformWorkerOutsideChanges as s, assertNoninteractivePlatformMutationAcknowledged as t, hyperdriveOriginMatches as tt, uploadPlatformWorkerOutsideChanges as u, platformDatabaseClientUrl as v, loadPlatformRuntime as w, assertProjectZeroTrustAllowsUninstall as x, readPlatformProjectSlugs as y, resourceMarkerProblem as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as runInstalledPlatformCommand, l as selectAuthoritativePlatformManifest, d as verifyPlatformInstallationOwnership } from "./platform-management-
|
|
1
|
+
export { c as runInstalledPlatformCommand, l as selectAuthoritativePlatformManifest, d as verifyPlatformInstallationOwnership } from "./platform-management-d3ETv3Dw.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as confirm, H as outro, K as select, L as log, tt as isCancel } from "./dist-STQXl8ck.mjs";
|
|
2
2
|
import { t as ensurePlatformAccessToken } from "./cf-access-Dnyw8KFY.mjs";
|
|
3
|
-
import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note
|
|
4
|
-
import { $ as
|
|
3
|
+
import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note } from "./output-DNVILSz2.mjs";
|
|
4
|
+
import { $ as hyperdriveOriginConfigHash, B as revalidatePlatformInstallAction, C as readPlatformDatabase, D as resolveBootstrapGitHubId, E as createPlatformInstallationSecrets, F as legacyResourceConfigHash, G as verifyPlatformCloudflareCredential, H as turnOffInstalledProjectZeroTrust, I as matchesRecordedR2Fingerprint, K as activatePlatformAccessCredentials, L as platformAdoptionIntentHash, M as dnsRecordConfigHash, N as formatPlatformInstallPlan, P as hasProvisionIntentStep, Q as PlatformRuntimeTokenEmailPermissionError, R as r2BucketConfigHash, S as formatZeroTrustApplications, T as createPlatformHealthProbeToken, U as assertPlatformOperatorCredentialCanApplyPlan, V as platformDatabaseNameFromOwnerUrl, W as resolvePlatformCloudflareCredential, X as PlatformCloudflareApiError, Z as PlatformCloudflareClient, a as createPlatformProgress, b as readPlatformProjectZeroTrustState, c as formatPlatformWorkerOutsideChanges, d as authenticationSetupRequestHash, et as hyperdriveOriginFromConnectionString, f as readLoginReplacementFile, g as acquirePlatformDatabaseLifecycleLock, h as installPlatform, j as createPlatformInstallPlan, k as platformTrafficAttachmentWorker, l as reviewPlatformWorkerOutsideChanges, m as REMOTE_INSTALLATION_MANIFEST_KEY, n as resolvePlatformInstallDatabaseUrl, nt as verifyPlatformRuntimeTokenEmailPermissions, o as withPlatformProgress, p as replacePendingInstallationAuthentication, rt as verifyPlatformRuntimeTokenPermissions, s as findPlatformWorkerOutsideChanges, t as assertNoninteractivePlatformMutationAcknowledged, tt as hyperdriveOriginMatches, u as uploadPlatformWorkerOutsideChanges, w as loadPlatformRuntime, x as assertProjectZeroTrustAllowsUninstall, y as readPlatformProjectSlugs, z as resourceMarkerProblem } from "./platform-lifecycle-D2RS7DE0.mjs";
|
|
5
5
|
import { S as writePendingInstallationSecrets, _ as removePlatformConnectionForInstallation, g as removeInstallationRecoverySecrets, h as readPendingInstallationSecrets, m as readInstallationRecoverySecrets, o as listInstallationManifests, t as acquirePlatformLifecycleLock, v as resolveInstallationManifest, x as writeInstallationManifest } from "./platform-registry-DZ_2Xuqd.mjs";
|
|
6
6
|
import { i as updateProjectWorkerRuntimeLogs, n as assertPlatformRuntimeLogsSupported, r as shouldUpdateProjectWorkerRuntimeLogs } from "./platform-runtime-logs-CdJGnk3f.mjs";
|
|
7
7
|
import { PLATFORM_DISABLED_KEY, PLATFORM_DISABLED_VALUE, PLATFORM_R2_OWNERSHIP_MARKER_KEY, parsePlatformInstallationManifest, recordInstallationResource, recordInstallationStep, setInstallationDesiredState, transitionInstallation } from "@void/platform";
|
|
@@ -632,6 +632,7 @@ function platformLifecycleResumeCommand(args, installationId) {
|
|
|
632
632
|
async function runInstalledPlatformCommand(args) {
|
|
633
633
|
if (args.subcommand !== "upgrade" && args.subcommand !== "rollback" && args.subcommand !== "repair" && args.subcommand !== "disable" && args.subcommand !== "enable" && args.subcommand !== "uninstall") throw new Error(`platform: Unsupported lifecycle command ${args.subcommand}.`);
|
|
634
634
|
assertNoninteractivePlatformMutationAcknowledged(args, process.stdin.isTTY === true);
|
|
635
|
+
log.step(`Preparing platform ${args.subcommand}`);
|
|
635
636
|
const timingStart = performance.now();
|
|
636
637
|
let timingPrevious = timingStart;
|
|
637
638
|
const markPhase = (phase) => {
|
|
@@ -643,12 +644,12 @@ async function runInstalledPlatformCommand(args) {
|
|
|
643
644
|
const manifest = await resolveInstalledPlatformManifest(args.selector);
|
|
644
645
|
const operatorCredential = await resolvePlatformCloudflareCredential({ savedManagementToken: readInstallationRecoverySecrets(manifest)?.managementApiToken });
|
|
645
646
|
const operatorClient = new PlatformCloudflareClient(operatorCredential.token);
|
|
646
|
-
await verifyPlatformCloudflareCredential(operatorClient, {
|
|
647
|
+
await withPlatformProgress("Checking Cloudflare access", () => verifyPlatformCloudflareCredential(operatorClient, {
|
|
647
648
|
account: manifest.account,
|
|
648
649
|
source: operatorCredential.source,
|
|
649
650
|
r2Buckets: args.subcommand === "disable" || args.subcommand === "uninstall" ? [] : manifest.resources.filter((resource) => resource.kind === "r2-bucket").map((resource) => resource.name),
|
|
650
651
|
allowMissingR2Buckets: args.subcommand === "repair"
|
|
651
|
-
});
|
|
652
|
+
}));
|
|
652
653
|
markPhase("operator credential");
|
|
653
654
|
const runtime = args.subcommand === "uninstall" || args.subcommand === "disable" ? null : loadPlatformRuntime(args.runtime);
|
|
654
655
|
const rollbackSourceRuntime = args.subcommand === "rollback" ? loadPlatformRuntime(args.fromRuntime) : null;
|
|
@@ -723,7 +724,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
723
724
|
installationSlug: deployment.installationSlug,
|
|
724
725
|
zoneName: deployment.application.zoneName
|
|
725
726
|
};
|
|
726
|
-
const plan = await createPlatformInstallPlan(client, planInput, manifest, {
|
|
727
|
+
const plan = await withPlatformProgress(`Preparing ${args.subcommand} plan`, () => createPlatformInstallPlan(client, planInput, manifest, {
|
|
727
728
|
authoritativeProvisionIntents: databaseCheckpointExists,
|
|
728
729
|
repairMissing: args.subcommand === "repair",
|
|
729
730
|
allowUnverifiedAiGateway: args.plan,
|
|
@@ -731,7 +732,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
731
732
|
enableSandbox: runtime.manifest.safetyProtocols.sandboxDrain >= 3,
|
|
732
733
|
deploymentExecution: runtime.manifest.deploymentExecution === 1,
|
|
733
734
|
allowRuntimeLogsChange: args.subcommand === "upgrade"
|
|
734
|
-
});
|
|
735
|
+
}));
|
|
735
736
|
assertPlatformRuntimeLogsSupported(plan.deployment, runtime.manifest);
|
|
736
737
|
markPhase("plan");
|
|
737
738
|
note(formatPlatformInstallPlan(plan, manifest.deployment), args.subcommand === "upgrade" ? "Upgrade plan" : args.subcommand === "rollback" ? "Rollback plan" : args.subcommand === "enable" ? "Enable plan" : "Repair plan");
|
|
@@ -832,9 +833,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
832
833
|
}, manifest.id)
|
|
833
834
|
});
|
|
834
835
|
markPhase("outside changes");
|
|
835
|
-
progress =
|
|
836
|
-
if (!process.emit("SIGINT")) process.exit(130);
|
|
837
|
-
} });
|
|
836
|
+
progress = createPlatformProgress();
|
|
838
837
|
progress.start(args.subcommand === "upgrade" ? "Upgrading the platform" : args.subcommand === "rollback" ? "Rolling back the platform" : args.subcommand === "enable" ? "Enabling the platform" : "Repairing the platform");
|
|
839
838
|
if (installation !== manifest) writeInstallationManifest(installation);
|
|
840
839
|
const keepAcceptedLogin = async (error) => {
|
|
@@ -854,6 +853,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
854
853
|
liftProjectZeroTrustFence: databaseLock?.liftProjectZeroTrustFence,
|
|
855
854
|
prepareDatabase: databaseLock?.prepareDatabase,
|
|
856
855
|
prepareSandboxDrain: databaseLock?.prepareSandboxDrain,
|
|
856
|
+
publishAiLogging: databaseLock?.publishAiLogging,
|
|
857
857
|
readAuthenticationState: databaseLock?.readAuthenticationState,
|
|
858
858
|
requiredSafetyProtocols: databaseLock?.requiredSafetyProtocols,
|
|
859
859
|
verifyDatabase: databaseLock?.verifyDatabase
|
|
@@ -946,7 +946,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
946
946
|
const recovery = readInstallationRecoverySecrets(current);
|
|
947
947
|
const databaseUrl = resolvePlatformInstallDatabaseUrl(recovery, current);
|
|
948
948
|
if (!databaseUrl) throw new Error("platform: DATABASE_URL is required to safely serialize lifecycle changes across hosts.");
|
|
949
|
-
const releaseDatabase = await acquirePlatformDatabaseLifecycleLock(databaseUrl, current.id, current.ownershipNonce);
|
|
949
|
+
const releaseDatabase = await withPlatformProgress("Reading platform state", () => acquirePlatformDatabaseLifecycleLock(databaseUrl, current.id, current.ownershipNonce));
|
|
950
950
|
markPhase("database lock");
|
|
951
951
|
try {
|
|
952
952
|
const authoritative = releaseDatabase.authoritativeManifest;
|
|
@@ -1020,7 +1020,7 @@ async function resolveInstalledPlatformManifest(selector, dependencies = {}) {
|
|
|
1020
1020
|
return resolveInstallationManifest(String(picked));
|
|
1021
1021
|
}
|
|
1022
1022
|
async function disablePlatform(client, initialManifest, planOnly, dependencies = {}) {
|
|
1023
|
-
const manifest = await recoverDurablyMarkedProvisionIntents(client, initialManifest);
|
|
1023
|
+
const manifest = await withPlatformProgress("Reading platform resources", () => recoverDurablyMarkedProvisionIntents(client, initialManifest));
|
|
1024
1024
|
const saveCheckpoint = (state) => writeLifecycleCheckpoint(client, state, dependencies.checkpoint);
|
|
1025
1025
|
const saveRemoteManifest = (state) => writeRemoteManifest(client, state, dependencies.checkpoint);
|
|
1026
1026
|
note("Block all platform traffic and the platform API. Routes, custom domains, Workers, and data stay installed.", "Disable plan");
|
|
@@ -1060,7 +1060,7 @@ async function disablePlatform(client, initialManifest, planOnly, dependencies =
|
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
async function uninstallPlatform(client, initialManifest, args, dependencies = {}) {
|
|
1063
|
-
const manifest = await recoverDurablyMarkedProvisionIntents(client, initialManifest);
|
|
1063
|
+
const manifest = await withPlatformProgress("Reading platform resources", () => recoverDurablyMarkedProvisionIntents(client, initialManifest));
|
|
1064
1064
|
const saveCheckpoint = (state) => writeLifecycleCheckpoint(client, state, dependencies.checkpoint);
|
|
1065
1065
|
const saveRemoteManifest = (state) => writeRemoteManifest(client, state, dependencies.checkpoint);
|
|
1066
1066
|
const retainData = !args.purgeData;
|
|
@@ -1070,8 +1070,8 @@ async function uninstallPlatform(client, initialManifest, args, dependencies = {
|
|
|
1070
1070
|
const hasRoutingCheckpoint = routingKv?.state === "ready" || reopenedRouting;
|
|
1071
1071
|
const interactive = dependencies.interactive ?? process.stdin.isTTY;
|
|
1072
1072
|
const confirmAction = dependencies.confirm ?? promptForConfirmation;
|
|
1073
|
-
const zeroTrust = await assertProjectZeroTrustAllowsUninstall(dependencies.readProjectZeroTrust, { canTurnOff: !!dependencies.turnOffProjectZeroTrust });
|
|
1074
|
-
if (purgeResources) await assertNoPlatformProjects(dependencies.readProjects);
|
|
1073
|
+
const zeroTrust = await withPlatformProgress("Checking project access", () => assertProjectZeroTrustAllowsUninstall(dependencies.readProjectZeroTrust, { canTurnOff: !!dependencies.turnOffProjectZeroTrust }));
|
|
1074
|
+
if (purgeResources) await withPlatformProgress("Checking platform projects", () => assertNoPlatformProjects(dependencies.readProjects));
|
|
1075
1075
|
if (args.plan || interactive && !args.yes) note([...zeroTrust ? zeroTrust.turnOff.length ? ["Turn off project Zero Trust; no platform user exists yet. Delete its Access applications:", formatZeroTrustApplications(zeroTrust.turnOff)] : ["Turn off project Zero Trust; no platform user exists yet."] : [], purgeResources ? purgeResourcesPlanText(manifest) : [
|
|
1076
1076
|
"Disable platform traffic.",
|
|
1077
1077
|
retainData ? "Keep Workers and data." : "Delete eligible data; keep Workers, R2, and AI Gateway.",
|