@geekmidas/cli 10.0.0-alpha.103 → 10.0.0-alpha.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/{EndpointGenerator-By5_tYE9.cjs → EndpointGenerator-BwbYTMtB.cjs} +2 -2
  2. package/dist/{EndpointGenerator-By5_tYE9.cjs.map → EndpointGenerator-BwbYTMtB.cjs.map} +1 -1
  3. package/dist/{EndpointGenerator-Br97xgs_.mjs → EndpointGenerator-CvLX8bpx.mjs} +2 -2
  4. package/dist/{EndpointGenerator-Br97xgs_.mjs.map → EndpointGenerator-CvLX8bpx.mjs.map} +1 -1
  5. package/dist/{GoDaddyProvider-JITjarl9.cjs → GoDaddyProvider-Cr9Uvqyz.cjs} +2 -2
  6. package/dist/{GoDaddyProvider-JITjarl9.cjs.map → GoDaddyProvider-Cr9Uvqyz.cjs.map} +1 -1
  7. package/dist/{GoDaddyProvider-8gNDqaml.mjs → GoDaddyProvider-DjtX8TUM.mjs} +2 -2
  8. package/dist/{GoDaddyProvider-8gNDqaml.mjs.map → GoDaddyProvider-DjtX8TUM.mjs.map} +1 -1
  9. package/dist/{LegacyStateStore-D-mcT2Z7.cjs → LegacyStateStore-CnxFZGeQ.cjs} +3 -3
  10. package/dist/{LegacyStateStore-D-mcT2Z7.cjs.map → LegacyStateStore-CnxFZGeQ.cjs.map} +1 -1
  11. package/dist/{LegacyStateStore-C0WnyYy_.mjs → LegacyStateStore-D-0XrizH.mjs} +3 -3
  12. package/dist/{LegacyStateStore-C0WnyYy_.mjs.map → LegacyStateStore-D-0XrizH.mjs.map} +1 -1
  13. package/dist/{LocalStateStore-CUFfdu-v.cjs → LocalStateStore-DGR_KzjD.cjs} +2 -2
  14. package/dist/{LocalStateStore-CUFfdu-v.cjs.map → LocalStateStore-DGR_KzjD.cjs.map} +1 -1
  15. package/dist/{LocalStateStore-C_8QWB2r.mjs → LocalStateStore-dVcU5RNe.mjs} +2 -2
  16. package/dist/{LocalStateStore-C_8QWB2r.mjs.map → LocalStateStore-dVcU5RNe.mjs.map} +1 -1
  17. package/dist/{OpenApiTsGenerator-BgSX_Z-e.cjs → OpenApiTsGenerator-BD6ZOQ51.cjs} +2 -2
  18. package/dist/{OpenApiTsGenerator-BgSX_Z-e.cjs.map → OpenApiTsGenerator-BD6ZOQ51.cjs.map} +1 -1
  19. package/dist/{OpenApiTsGenerator-C8aTX--y.mjs → OpenApiTsGenerator-DXXFXSbO.mjs} +2 -2
  20. package/dist/{OpenApiTsGenerator-C8aTX--y.mjs.map → OpenApiTsGenerator-DXXFXSbO.mjs.map} +1 -1
  21. package/dist/{S3StateStore-DIJ6CCv_.cjs → S3StateStore-D8z0z8P2.cjs} +2 -2
  22. package/dist/{S3StateStore-DIJ6CCv_.cjs.map → S3StateStore-D8z0z8P2.cjs.map} +1 -1
  23. package/dist/{S3StateStore-B0Vy19db.mjs → S3StateStore-DIyP76Kb.mjs} +2 -2
  24. package/dist/{S3StateStore-B0Vy19db.mjs.map → S3StateStore-DIyP76Kb.mjs.map} +1 -1
  25. package/dist/{SSMStateStore-DgBlEqYO.mjs → SSMStateStore-B7J_fv0d.mjs} +2 -2
  26. package/dist/{SSMStateStore-DgBlEqYO.mjs.map → SSMStateStore-B7J_fv0d.mjs.map} +1 -1
  27. package/dist/{SSMStateStore-D577um0e.cjs → SSMStateStore-CIOsbEcQ.cjs} +2 -2
  28. package/dist/{SSMStateStore-D577um0e.cjs.map → SSMStateStore-CIOsbEcQ.cjs.map} +1 -1
  29. package/dist/{SubscriberGenerator-DmPM_3c5.cjs → SubscriberGenerator-CeH7wbYt.cjs} +3 -3
  30. package/dist/{SubscriberGenerator-DmPM_3c5.cjs.map → SubscriberGenerator-CeH7wbYt.cjs.map} +1 -1
  31. package/dist/{SubscriberGenerator-YK-7ewmi.mjs → SubscriberGenerator-DHnIYwUU.mjs} +3 -3
  32. package/dist/{SubscriberGenerator-YK-7ewmi.mjs.map → SubscriberGenerator-DHnIYwUU.mjs.map} +1 -1
  33. package/dist/{add-BJJKhUnO.mjs → add-CC69Yf5t.mjs} +8 -9
  34. package/dist/add-CC69Yf5t.mjs.map +1 -0
  35. package/dist/{add-D97HfZ7z.cjs → add-DWj9Kccz.cjs} +8 -9
  36. package/dist/add-DWj9Kccz.cjs.map +1 -0
  37. package/dist/{bundler-CzbrMpDf.mjs → bundler-BpYpp1Hf.mjs} +5 -5
  38. package/dist/{bundler-CzbrMpDf.mjs.map → bundler-BpYpp1Hf.mjs.map} +1 -1
  39. package/dist/{bundler-CtEQAnym.cjs → bundler-TZ72P7LF.cjs} +5 -5
  40. package/dist/{bundler-CtEQAnym.cjs.map → bundler-TZ72P7LF.cjs.map} +1 -1
  41. package/dist/{cli-D_zrFs9-.mjs → cli-BZ_9cc0O.mjs} +3 -3
  42. package/dist/{cli-D_zrFs9-.mjs.map → cli-BZ_9cc0O.mjs.map} +1 -1
  43. package/dist/{cli-CIv8PA-v.cjs → cli-iqNUZ9Va.cjs} +3 -3
  44. package/dist/{cli-CIv8PA-v.cjs.map → cli-iqNUZ9Va.cjs.map} +1 -1
  45. package/dist/{compose-BviikvXq.cjs → compose-5b4lzIyr.cjs} +14 -11
  46. package/dist/compose-5b4lzIyr.cjs.map +1 -0
  47. package/dist/{compose-DtPhKs0u.mjs → compose-BXUDOrte.mjs} +14 -11
  48. package/dist/{compose-DtPhKs0u.mjs.map → compose-BXUDOrte.mjs.map} +1 -1
  49. package/dist/config.cjs +1 -1
  50. package/dist/config.mjs +1 -1
  51. package/dist/{credentialSchemas-DvitraL-.mjs → credentialSchemas-Cf5Pf8VE.mjs} +2 -2
  52. package/dist/{credentialSchemas-DvitraL-.mjs.map → credentialSchemas-Cf5Pf8VE.mjs.map} +1 -1
  53. package/dist/{credentialSchemas-DDda4Mmm.cjs → credentialSchemas-D_VUCDUh.cjs} +2 -2
  54. package/dist/{credentialSchemas-DDda4Mmm.cjs.map → credentialSchemas-D_VUCDUh.cjs.map} +1 -1
  55. package/dist/deploy/public.cjs +7 -7
  56. package/dist/deploy/public.mjs +7 -7
  57. package/dist/{deploy-DyPt41Oq.mjs → deploy-BXx5PHR8.mjs} +8 -8
  58. package/dist/{deploy-DyPt41Oq.mjs.map → deploy-BXx5PHR8.mjs.map} +1 -1
  59. package/dist/{deploy-cv0i1yFo.cjs → deploy-rdTC6BqI.cjs} +8 -8
  60. package/dist/{deploy-cv0i1yFo.cjs.map → deploy-rdTC6BqI.cjs.map} +1 -1
  61. package/dist/{discover-BfhVW_kT.cjs → discover-Bsr7HjqJ.cjs} +18 -2
  62. package/dist/{discover-BfhVW_kT.cjs.map → discover-Bsr7HjqJ.cjs.map} +1 -1
  63. package/dist/{discover-kziEht4W.mjs → discover-Ca8U75dl.mjs} +13 -3
  64. package/dist/{discover-kziEht4W.mjs.map → discover-Ca8U75dl.mjs.map} +1 -1
  65. package/dist/{dns-B-wqZiyQ.mjs → dns-CRungu5C.mjs} +2 -2
  66. package/dist/{dns-B-wqZiyQ.mjs.map → dns-CRungu5C.mjs.map} +1 -1
  67. package/dist/{dns-_rxfINeq.cjs → dns-FMg7REGo.cjs} +2 -2
  68. package/dist/{dns-_rxfINeq.cjs.map → dns-FMg7REGo.cjs.map} +1 -1
  69. package/dist/{dokploy-BJQ9HjVv.mjs → dokploy-CuluaeVl.mjs} +2 -2
  70. package/dist/{dokploy-BJQ9HjVv.mjs.map → dokploy-CuluaeVl.mjs.map} +1 -1
  71. package/dist/{dokploy-DSvw-l5b.cjs → dokploy-U_yXwsT7.cjs} +2 -2
  72. package/dist/{dokploy-DSvw-l5b.cjs.map → dokploy-U_yXwsT7.cjs.map} +1 -1
  73. package/dist/{drivers-OXhPkaNB.mjs → drivers-D11JHxrD.mjs} +2 -2
  74. package/dist/{drivers-OXhPkaNB.mjs.map → drivers-D11JHxrD.mjs.map} +1 -1
  75. package/dist/{drivers-DEDL8vPE.cjs → drivers-GKaA6ITM.cjs} +2 -2
  76. package/dist/{drivers-DEDL8vPE.cjs.map → drivers-GKaA6ITM.cjs.map} +1 -1
  77. package/dist/{encryption-UgYs2YYM.cjs → encryption-D-louLFQ.cjs} +2 -2
  78. package/dist/{encryption-UgYs2YYM.cjs.map → encryption-D-louLFQ.cjs.map} +1 -1
  79. package/dist/{encryption-BUAZ3OEJ.mjs → encryption-XqokmrEn.mjs} +2 -2
  80. package/dist/{encryption-BUAZ3OEJ.mjs.map → encryption-XqokmrEn.mjs.map} +1 -1
  81. package/dist/{engine-Blx6G12-.cjs → engine-BdpcrYWi.cjs} +6 -5
  82. package/dist/engine-BdpcrYWi.cjs.map +1 -0
  83. package/dist/{engine-VnbN4VnX.mjs → engine-DqNljyye.mjs} +6 -5
  84. package/dist/engine-DqNljyye.mjs.map +1 -0
  85. package/dist/{github-C-L3qfYZ.cjs → github-CA33zfqv.cjs} +5 -5
  86. package/dist/{github-C-L3qfYZ.cjs.map → github-CA33zfqv.cjs.map} +1 -1
  87. package/dist/{github-D2uJ32Af.mjs → github-b_kS4jvw.mjs} +5 -5
  88. package/dist/{github-D2uJ32Af.mjs.map → github-b_kS4jvw.mjs.map} +1 -1
  89. package/dist/index.cjs +180 -101
  90. package/dist/index.cjs.map +1 -1
  91. package/dist/index.mjs +181 -102
  92. package/dist/index.mjs.map +1 -1
  93. package/dist/{migrate-DdociPvx.cjs → migrate-BVMk0jtV.cjs} +3 -3
  94. package/dist/{migrate-DdociPvx.cjs.map → migrate-BVMk0jtV.cjs.map} +1 -1
  95. package/dist/{migrate-BFH52jlU.mjs → migrate-DBp_H1fe.mjs} +3 -3
  96. package/dist/{migrate-BFH52jlU.mjs.map → migrate-DBp_H1fe.mjs.map} +1 -1
  97. package/dist/{migrate-Dqjr7rfs.mjs → migrate-DStsGGqC.mjs} +2 -2
  98. package/dist/{migrate-Dqjr7rfs.mjs.map → migrate-DStsGGqC.mjs.map} +1 -1
  99. package/dist/{migrate-DxAFe2EV.cjs → migrate-Ln16jIxy.cjs} +2 -2
  100. package/dist/{migrate-DxAFe2EV.cjs.map → migrate-Ln16jIxy.cjs.map} +1 -1
  101. package/dist/openapi.cjs +2 -2
  102. package/dist/openapi.mjs +2 -2
  103. package/dist/{ready-D38XpZ0L.cjs → ready-BMFjxBYA.cjs} +8 -7
  104. package/dist/ready-BMFjxBYA.cjs.map +1 -0
  105. package/dist/{ready-CuSU8Ap0.mjs → ready-CIt5SOtg.mjs} +8 -7
  106. package/dist/ready-CIt5SOtg.mjs.map +1 -0
  107. package/dist/reconcile/public.cjs +1 -1
  108. package/dist/reconcile/public.mjs +1 -1
  109. package/dist/{resolve-aqhkZfDI.cjs → resolve-CJ91HNQB.cjs} +3 -3
  110. package/dist/{resolve-aqhkZfDI.cjs.map → resolve-CJ91HNQB.cjs.map} +1 -1
  111. package/dist/{resolve-BGgwxfCz.mjs → resolve-DCdFajey.mjs} +3 -3
  112. package/dist/{resolve-BGgwxfCz.mjs.map → resolve-DCdFajey.mjs.map} +1 -1
  113. package/dist/{rollback-DUbUQeoz.mjs → rollback-CNS-52X9.mjs} +4 -4
  114. package/dist/{rollback-DUbUQeoz.mjs.map → rollback-CNS-52X9.mjs.map} +1 -1
  115. package/dist/{rollback-qk3-knJ7.cjs → rollback-UFitatDM.cjs} +4 -4
  116. package/dist/{rollback-qk3-knJ7.cjs.map → rollback-UFitatDM.cjs.map} +1 -1
  117. package/dist/sandbox/credentials-worker.cjs +2 -2
  118. package/dist/sandbox/credentials-worker.mjs +2 -2
  119. package/dist/sandbox/discover-worker.cjs +1 -1
  120. package/dist/sandbox/discover-worker.mjs +1 -1
  121. package/dist/sandbox/migrate-worker.cjs +1 -1
  122. package/dist/sandbox/migrate-worker.mjs +1 -1
  123. package/dist/{seeds-Cx8NmuQj.mjs → seeds-BfzwCdYv.mjs} +62 -53
  124. package/dist/seeds-BfzwCdYv.mjs.map +1 -0
  125. package/dist/{seeds-a1H3kuqu.cjs → seeds-DkcKQ_F8.cjs} +66 -51
  126. package/dist/seeds-DkcKQ_F8.cjs.map +1 -0
  127. package/dist/{sniffer-Bt2H-BZ_.mjs → sniffer-B1neuJz2.mjs} +7 -7
  128. package/dist/{sniffer-Bt2H-BZ_.mjs.map → sniffer-B1neuJz2.mjs.map} +1 -1
  129. package/dist/{sniffer-DxYAi7bz.cjs → sniffer-DgfzmvB7.cjs} +7 -7
  130. package/dist/{sniffer-DxYAi7bz.cjs.map → sniffer-DgfzmvB7.cjs.map} +1 -1
  131. package/dist/target/public.cjs +1 -1
  132. package/dist/target/public.mjs +1 -1
  133. package/dist/{terminal-Bs_lNQhL.mjs → terminal-CvRLxz6g.mjs} +2 -2
  134. package/dist/{terminal-Bs_lNQhL.mjs.map → terminal-CvRLxz6g.mjs.map} +1 -1
  135. package/dist/{terminal-CsQz4oT0.cjs → terminal-D_NRPW4W.cjs} +2 -2
  136. package/dist/{terminal-CsQz4oT0.cjs.map → terminal-D_NRPW4W.cjs.map} +1 -1
  137. package/dist/vitest.cjs +1 -1
  138. package/dist/vitest.mjs +1 -1
  139. package/package.json +15 -15
  140. package/dist/add-BJJKhUnO.mjs.map +0 -1
  141. package/dist/add-D97HfZ7z.cjs.map +0 -1
  142. package/dist/compose-BviikvXq.cjs.map +0 -1
  143. package/dist/engine-Blx6G12-.cjs.map +0 -1
  144. package/dist/engine-VnbN4VnX.mjs.map +0 -1
  145. package/dist/ready-CuSU8Ap0.mjs.map +0 -1
  146. package/dist/ready-D38XpZ0L.cjs.map +0 -1
  147. package/dist/seeds-Cx8NmuQj.mjs.map +0 -1
  148. package/dist/seeds-a1H3kuqu.cjs.map +0 -1
@@ -3,12 +3,12 @@ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
3
3
  import { i as run$1, s as gkmHome } from "./run-BJLIerMM.mjs";
4
4
  import { B as LOGS_PORT, H as provisioningOf, R as stageSampleRate, U as stageProvider, _ as PUBLIC_ENV_PREFIXES, a as allConstructGlobs, ct as UnknownSecretsStoreProvider, ft as SERVER_IPV4_KEY, ht as isReservedStageKey, j as TEST_STAGE, pt as SERVER_IPV6_KEY, ut as s3SecretsLocation, v as getPublicEnvPrefix, z as telemetryEnv } from "./workspace-D1QbNd55.mjs";
5
5
  import { t as appKey } from "./derive-B4vDpzgP.mjs";
6
- import { a as DEFAULT_CACHE, c as holdsEveryCache, i as readFakes, o as DEFAULT_EVENTS$1, r as readCredentialFakes, s as DEFAULT_STORAGE, t as SubscriberGenerator } from "./SubscriberGenerator-YK-7ewmi.mjs";
6
+ import { a as DEFAULT_CACHE, c as holdsEveryCache, i as readFakes, o as DEFAULT_EVENTS$1, r as readCredentialFakes, s as DEFAULT_STORAGE, t as SubscriberGenerator } from "./SubscriberGenerator-DHnIYwUU.mjs";
7
7
  import { n as deployIdentity } from "./identity-CBXr4wNi.mjs";
8
- import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-Br97xgs_.mjs";
9
- import { d as output, r as discover, u as ConstructGenerator } from "./discover-kziEht4W.mjs";
8
+ import { a as startTelemetryCode, n as runtimeFor, s as writeTelemetryModule, u as telemetryArgs } from "./EndpointGenerator-CvLX8bpx.mjs";
9
+ import { d as ConstructGenerator, f as output, i as discover } from "./discover-Ca8U75dl.mjs";
10
10
  import { ConfigNotFound, NotInAnApp, loadWorkspaceAppInfo, loadWorkspaceConfig } from "./config.mjs";
11
- import { c as runtimeOf } from "./resolve-BGgwxfCz.mjs";
11
+ import { c as runtimeOf } from "./resolve-DCdFajey.mjs";
12
12
  import { basename, dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
13
13
  import { constants, existsSync, readFileSync } from "node:fs";
14
14
  import { appendFile, chmod, copyFile, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
@@ -16,7 +16,7 @@ import { homedir, hostname, networkInterfaces, userInfo } from "node:os";
16
16
  import { execFile, spawn } from "node:child_process";
17
17
  import { createServer } from "node:net";
18
18
  import { createCipheriv, createDecipheriv, createHash, randomBytes, randomInt } from "node:crypto";
19
- import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, TELEMETRY_KEYS, cacheTable, cookieDomain, dependenciesOf, dependentsOf, externalApiUrl, kebabCase, mobileOrigins, provideKey, providedKeyFor, provisionOrder, publicEnvFor, schemeBase } from "@geekmidas/manifest";
19
+ import { CLIENT_IP_HEADER, DEFAULT_POSTGRES_VERSION, TELEMETRY_KEYS, cacheTable, cookieDomain, dependenciesOf, dependentsOf, drawSecret, externalApiUrl, kebabCase, mobileOrigins, provideKey, providedKeyFor, provisionOrder, publicEnvFor, schemeBase } from "@geekmidas/manifest";
20
20
  import { formatKeyring, generateKeyring } from "@geekmidas/constructs/encryption";
21
21
  import { ownerRole, readerRole, roleStatements } from "@geekmidas/db/pg/roles";
22
22
  import * as snsUrl from "@geekmidas/events/sns/url";
@@ -724,10 +724,8 @@ function emulatorQueueUrl(name, port) {
724
724
  * Which processes use a `Telemetry` node — read off the manifest's edges.
725
725
  *
726
726
  * A process uses telemetry when its own declaration names the node: a
727
- * surface's `telemetry`, a worker's. The server the build generates for a
728
- * surface whose endpoints a glob finds also runs the workers' crons and
729
- * consumers under `gkm dev`, and is handed their edges' keys by `appEnvKeys`,
730
- * so a worker's edge counts for it too — the same rule, read the same way.
727
+ * surface's `telemetry`, a worker's. A surface's process runs its own
728
+ * endpoints, so a worker's edge never counts for it.
731
729
  *
732
730
  * A site's edge is recorded and never followed here: a site is handed none of
733
731
  * the node's keys (see `PUBLIC.telemetry`).
@@ -753,14 +751,7 @@ function telemetryOf(manifest, id) {
753
751
  if (!declaration) return void 0;
754
752
  if (declaration.kind === "worker") return nodeOf(manifest, declaration.telemetry);
755
753
  if (declaration.kind !== "rest-api") return void 0;
756
- const own = nodeOf(manifest, declaration.telemetry);
757
- if (own) return own;
758
- if (declaration.endpoints.length > 0) return void 0;
759
- for (const other of Object.values(manifest)) {
760
- if (other.kind !== "worker") continue;
761
- const node = nodeOf(manifest, other.telemetry);
762
- if (node) return node;
763
- }
754
+ return nodeOf(manifest, declaration.telemetry);
764
755
  }
765
756
  /**
766
757
  * The `Telemetry` node the app `appName` emits through — its surface's, or
@@ -1040,6 +1031,10 @@ function planFor(manifest, stage, order, options = {}) {
1040
1031
  } } : {},
1041
1032
  ...declaration.kind === "external-api" && !fake ? { url: declaration.url } : {},
1042
1033
  ...declaration.kind === "credential" && options.credentialFakes?.[id] !== void 0 ? { fakeCredentials: options.credentialFakes[id] } : {},
1034
+ ...declaration.kind === "secret" && (declaration.length !== void 0 || declaration.symbols !== void 0) ? { format: {
1035
+ ...declaration.length !== void 0 ? { length: declaration.length } : {},
1036
+ ...declaration.symbols !== void 0 ? { symbols: declaration.symbols } : {}
1037
+ } } : {},
1043
1038
  ..."of" in declaration && !detached ? { of: declaration.of } : {},
1044
1039
  ..."schema" in declaration && declaration.schema ? { schema: declaration.schema } : {},
1045
1040
  ..."version" in declaration && declaration.version ? { version: declaration.version } : {},
@@ -1559,10 +1554,36 @@ function localKeyring(project, plan, resource) {
1559
1554
  * A hash of what identifies it, so it is stable, distinct per project, stage
1560
1555
  * and construct, and never written to disk as a literal. Deployed this is the
1561
1556
  * one kind whose value does *not* come from here — a secret manager generates
1562
- * it once and the target reads it back.
1557
+ * it once and the target reads it back. Drawn in the format the deploy draws
1558
+ * it in, so a value that passes a third party's rules here passes them there.
1563
1559
  */
1564
1560
  function localSecret(project, plan, resource) {
1565
- return createHash("sha256").update(`${project}:${plan.stage}:${resource.id}`).digest("base64url").slice(0, 43);
1561
+ return drawSecret(hashStream(`${project}:${plan.stage}:${resource.id}`), resource.format);
1562
+ }
1563
+ /**
1564
+ * Integers in `[0, n)` drawn from a hash of `seed`, the same every time —
1565
+ * what a local secret is drawn with instead of `crypto`, so `gkm dev` and
1566
+ * `gkm test` need nothing stored. Rejection-sampled, so no character is
1567
+ * likelier than another.
1568
+ */
1569
+ function hashStream(seed) {
1570
+ let block = 0;
1571
+ let bytes = Buffer.alloc(0);
1572
+ let offset = 0;
1573
+ const next = () => {
1574
+ if (offset === bytes.length) {
1575
+ bytes = createHash("sha256").update(`${seed}:${block++}`).digest();
1576
+ offset = 0;
1577
+ }
1578
+ return bytes[offset++];
1579
+ };
1580
+ return (n) => {
1581
+ const limit = 256 - 256 % n;
1582
+ for (;;) {
1583
+ const byte = next();
1584
+ if (byte < limit) return byte % n;
1585
+ }
1586
+ };
1566
1587
  }
1567
1588
  //#endregion
1568
1589
  //#region src/compose/redis.ts
@@ -1720,8 +1741,8 @@ function redisService(redis) {
1720
1741
  * master and roles, a bucket's root user. Derived from repo facts alone
1721
1742
  * (project, stage, construct id), those passwords were computable by anyone
1722
1743
  * who could read the repo.
1723
- * - **Each `secret` construct's value** — an auth server's signing secret —
1724
- * random, rather than derived.
1744
+ * - **Each `secret` construct's value** — an auth server's signing secret, a
1745
+ * `RandomPassword` — random, rather than derived, in its declared format.
1725
1746
  * - **Each `encryption` construct's keyring** — one random key and an index
1726
1747
  * key. Later keys are added by `gkm encryption:rotate`, never by a deploy.
1727
1748
  *
@@ -1742,7 +1763,7 @@ function withGeneratedSecrets(secrets, manifest) {
1742
1763
  if (declaration?.kind !== "secret" && declaration?.kind !== "encryption") continue;
1743
1764
  const key = declaration.provides?.[0];
1744
1765
  if (!key || custom[key]) continue;
1745
- custom[key] = declaration.kind === "encryption" ? generateKeyring() : random();
1766
+ custom[key] = declaration.kind === "encryption" ? generateKeyring() : drawSecret(randomInt, declaration);
1746
1767
  generated.push(key);
1747
1768
  }
1748
1769
  const seed = secrets.seed ?? generateSeed();
@@ -2613,6 +2634,7 @@ function workerUnits(workspace, manifest, background) {
2613
2634
  }
2614
2635
  return units.sort((a, b) => a.name.localeCompare(b.name));
2615
2636
  }
2637
+ /** Whether `file` is inside `dir`. */
2616
2638
  function isUnder(file, dir) {
2617
2639
  const rel = relative(dir, file);
2618
2640
  return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel) ? !rel.startsWith(`..${sep}`) : false;
@@ -5545,7 +5567,7 @@ async function reconcileWorkspace(workspace, options) {
5545
5567
  metroPorts: metroPorts(workspace, manifest),
5546
5568
  fakes,
5547
5569
  credentialFakes,
5548
- apps: (containers) => appServices(workspace, manifest, containers, credentials, runnables, fakes),
5570
+ apps: (containers) => appServices(workspace, manifest, containers, credentials, runnables, fakes, credentialFakes),
5549
5571
  ...options.start === void 0 ? {} : { start: options.start },
5550
5572
  ...options.progress ? { progress: options.progress } : {}
5551
5573
  });
@@ -5642,11 +5664,12 @@ function dockerfileOf(appName, path) {
5642
5664
  * surface resolved to its `*.localhost` host on the edge's port, which the
5643
5665
  * rewrite to the compose network then turned into an address nothing answers.
5644
5666
  */
5645
- function localPlan(workspace, manifest, fakes = {}) {
5667
+ function localPlan(workspace, manifest, fakes = {}, credentialFakes = {}) {
5646
5668
  return planFor(manifest, workspace.stages.local, provisionOrder(manifest), {
5647
5669
  localStage: workspace.stages.local,
5648
5670
  ...backendsOf(workspace),
5649
5671
  fakes,
5672
+ credentialFakes,
5650
5673
  edge: false
5651
5674
  });
5652
5675
  }
@@ -5709,8 +5732,12 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5709
5732
  *
5710
5733
  * One hop: a surface an app calls is reached over HTTP, so its URL is the
5711
5734
  * app's business and its database is not. A site also gets the public
5712
- * variant of each key its bundle inlines (`NEXT_PUBLIC_API_URL`), and a surface
5713
- * the edges of the workers whose crons and subscribers its server runs.
5735
+ * variant of each key its bundle inlines (`NEXT_PUBLIC_API_URL`).
5736
+ *
5737
+ * A surface's process runs its own endpoints and nothing else. A Worker's
5738
+ * crons, queue consumers and subscribers run in the worker's own process
5739
+ * (`workerEnvKeys`), so no surface is handed a worker's edges — however its
5740
+ * endpoints were found.
5714
5741
  *
5715
5742
  * `undefined` for an app no declaration describes, which gets nothing but its
5716
5743
  * port.
@@ -5724,20 +5751,7 @@ function appEnvKeys(manifest, appName, runnables = {}) {
5724
5751
  ...declaration.requires ?? [],
5725
5752
  ...declaration.kind === "rest-api" ? declaration.endpoints.flatMap((endpoint) => endpoint.requires ?? []) : []
5726
5753
  ]);
5727
- const edges = [...dependenciesOf(declaration).map((edge) => edge.target), ...runnables[id] ?? []];
5728
- if (declaration.kind === "rest-api" && declaration.endpoints.length === 0) {
5729
- const runsWorkers = Object.values(manifest).some((other) => other.kind === "worker");
5730
- for (const [otherId, other] of Object.entries(manifest)) {
5731
- if (other.kind !== "worker") continue;
5732
- edges.push(...dependenciesOf(other).map((edge) => edge.target), ...runnables[otherId] ?? []);
5733
- keys.add("EVENT_PUBLISHER_CONNECTION_STRING");
5734
- }
5735
- if (runsWorkers) for (const other of Object.values(manifest)) {
5736
- if (other.kind !== "queue" && other.kind !== "topic") continue;
5737
- for (const key of other.provides ?? []) keys.add(key);
5738
- }
5739
- }
5740
- addEdgeKeys(manifest, edges, keys);
5754
+ addEdgeKeys(manifest, [...dependenciesOf(declaration).map((edge) => edge.target), ...runnables[id] ?? []], keys);
5741
5755
  if (declaration.kind === "site" || declaration.kind === "mobile-app") {
5742
5756
  for (const key of TELEMETRY_KEYS) keys.delete(key);
5743
5757
  for (const key of Object.keys(publicEnvFor(declaration, manifest))) keys.add(key);
@@ -5746,10 +5760,9 @@ function appEnvKeys(manifest, appName, runnables = {}) {
5746
5760
  }
5747
5761
  /**
5748
5762
  * The keys a Worker's own process reads: what the worker and everything built
5749
- * from it declared an edge to, the broker its crons schedule through, and the
5750
- * address of every queue and topic — which of them its consumers and
5751
- * subscribers are bound to is only known once a build has found them, so a
5752
- * process that runs them is handed each carrier's.
5763
+ * from it declared an edge to — the queues its consumers drain and the topics
5764
+ * its subscribers are bound to among them (see `DiscoverOptions.runnables`) —
5765
+ * and the broker its crons schedule through.
5753
5766
  *
5754
5767
  * `undefined` when no worker has that id.
5755
5768
  */
@@ -5761,10 +5774,6 @@ function workerEnvKeys(manifest, workerId, runnables = {}) {
5761
5774
  ...declaration.requires ?? [],
5762
5775
  "EVENT_PUBLISHER_CONNECTION_STRING"
5763
5776
  ]);
5764
- for (const other of Object.values(manifest)) {
5765
- if (other.kind !== "queue" && other.kind !== "topic") continue;
5766
- for (const key of other.provides ?? []) keys.add(key);
5767
- }
5768
5777
  addEdgeKeys(manifest, [...dependenciesOf(declaration).map((edge) => edge.target), ...runnables[workerId] ?? []], keys);
5769
5778
  return keys;
5770
5779
  }
@@ -5788,8 +5797,8 @@ function addEdgeKeys(manifest, edges, keys) {
5788
5797
  }
5789
5798
  }
5790
5799
  /** One compose service per app the workspace runs, behind the apps profile. */
5791
- function appServices(workspace, manifest, containers, credentials, runnables = {}, fakes = {}) {
5792
- const plan = localPlan(workspace, manifest, fakes);
5800
+ function appServices(workspace, manifest, containers, credentials, runnables = {}, fakes = {}, credentialFakes = {}) {
5801
+ const plan = localPlan(workspace, manifest, fakes, credentialFakes);
5793
5802
  const derivation = {
5794
5803
  project: workspace.name,
5795
5804
  credentials,
@@ -7301,7 +7310,7 @@ async function createDnsProvider(options) {
7301
7310
  });
7302
7311
  }
7303
7312
  if (provider === "godaddy") {
7304
- const { GoDaddyProvider } = await import("./GoDaddyProvider-8gNDqaml.mjs");
7313
+ const { GoDaddyProvider } = await import("./GoDaddyProvider-DjtX8TUM.mjs");
7305
7314
  return new GoDaddyProvider(options.godaddy ?? {});
7306
7315
  }
7307
7316
  if (provider === "cloudflare") throw new DnsProviderNotImplemented("cloudflare");
@@ -8150,6 +8159,6 @@ function reportPlannedSeeds(planned, log) {
8150
8159
  for (const { folder, seeds } of planned) log(`🌱 ${folder}: would run ${seeds.length} (${seeds.join(", ")})`);
8151
8160
  }
8152
8161
  //#endregion
8153
- export { devServicesUsed as $, applyBuckets as $t, assertStageProvidersEnabled as A, scopeTelemetryEnv as An, isPortAvailable as At, workerDockerfileOf as B, portsOf as Bn, maskPassword as Bt, setApplicationId as C, envFor as Cn, cacheBackendFor as Ct, DnsRecordsUnreadable as D, resourceName as Dn, createCredentialsPreload as Dt, setPostgresBackupId as E, planFor as En, storageBackendFor as Et, DockerPushFailed as F, hostFor as Fn, isRemoteStore as Ft, CronGenerator as G, logsAccess as Gn, imageLayout as Gt, workerBundleName as H, primaryPortKey as Hn, toEmbeddableSecrets as Ht, appDockerfile as I, DEFAULT_IMAGES as In, secretsStoreFor as It, DEV_SERVICES as J, withLogsPassword as Jn, detectPackageManager as Jt, validateImageRef as K, logsService as Kn, TURBO_VERSION as Kt, dockerCommand as L, describeServices as Ln, storeFromConfig as Lt, stageProviderNotes as M, telemetryOf as Mn, loadPortState as Mt, PROVIDER_KINDS as N, usesTelemetry as Nn, loadSecretsForApp as Nt, createDnsProvider as O, appTelemetry as On, createEntryWrapper as Ot, DockerBuildFailed as P, EMULATOR_ACCESS_KEY_ID as Pn, prepareEntryCredentials as Pt, assertDevServicesFlag as Q, workerUnits as Qt, ensureDockerignore as R, fakeKey as Rn, store_exports as Rt, recordRollback as S, withRedisPassword as Sn, composeFor as St, setGeneratedSecret as T, TELEMETRY_CONTAINER as Tn, providerOf as Tt, workerEntryDir as U, LOCAL_LOGS_EMAIL as Un, withCustomSecret as Ut, WorkerGenerator as V, postgresImage as Vn, storage_exports as Vt, QueueGenerator as W, LOGS_SERVICE as Wn, composeBuildPaths as Wt, ExternalServicesNotConfigured as X, isMainFrontendApp as Xn, imageBuildCredentials as Xt, DevServicesNeedServerTarget as Y, NoDomainForStage as Yn, findBuildRoot as Yt, STORAGE_KEY_PAIR as Z, resolveHost as Zn, isImageBuild as Zt, createComposeState as _, REDIS_SERVICE as _n, LEGACY_LOCAL_LOGIN as _t, dnsResources as a, quoteIdentifier as an, appEnvKeys as at, getGeneratedSecret as b, runsRedis as bn, pgClient as bt, describeActor as c, postgresRoleSlug as cn, workerEnvKeys as ct, extractSubdomain as d, FileSecretsStore as dn, constructGlobs as dt, applyPolicies as en, externalServices as et, findRootDomain as f, getKeyPath as fn, derivedContainers as ft, asDokployState as g, withGeneratedSecrets as gn, forgetState as gt, verifyDnsRecords as h, readKey as hn, LOCAL_CA_PATH as ht, dnsRecordResource as i, postgresStatements as in, suppliedOnly as it, provisionCommand as j, surfaceClientTraced as jn, loadEnvFiles as jt, StageProviderDisabled as k, isTelemetryKey as kn, findAvailablePort as kt, isCi as l, postgresSuperuser as ln, FAKE_ENV as lt, orchestrateDns as m, projectKey as mn, workspace_exports as mt, reportDatabaseRuns as n, bucketPolicies as nn, requiredStageKeys as nt, recordDnsChanges as o, LOCAL_RABBITMQ_USER as on, dockerfileOf as ot, normalizeDnsConfig as p, keystoreProject as pn, reconcileWorkspace as pt, AllowDevServicesTakesNoValue as q, stackLogs as qn, WORKER_PORT as qt, reportPlannedSeeds as r, postgresDatabaseNames as rn, stageServiceDeclarations as rt, currentActor as s, loadLocalCredentials as sn, networkEnv as st, DeploySeedsFailed as t, applyPostgres as tn, reportDevServices as tt, DeployJournal as u, readLocalCredentials as un, backendsOf as ut, createEmptyState as v, STACK_CACHE as vn, ensurePostgresLogin as vt, setBackupState as w, localRolePassword as wn, eventsBackendFor as wt, recordRelease as x, stackRedis as xn, CLUSTER_DATABASE as xt, getBackupState as y, redisService as yn, bucketClient as yt, workerDockerfile as z, portKeys as zn, initStageSecrets as zt };
8162
+ export { devServicesUsed as $, workerUnits as $t, assertStageProvidersEnabled as A, isTelemetryKey as An, isPortAvailable as At, workerDockerfileOf as B, portKeys as Bn, maskPassword as Bt, setApplicationId as C, withRedisPassword as Cn, cacheBackendFor as Ct, DnsRecordsUnreadable as D, planFor as Dn, createCredentialsPreload as Dt, setPostgresBackupId as E, TELEMETRY_CONTAINER as En, storageBackendFor as Et, DockerPushFailed as F, EMULATOR_ACCESS_KEY_ID as Fn, isRemoteStore as Ft, CronGenerator as G, LOGS_SERVICE as Gn, imageLayout as Gt, workerBundleName as H, postgresImage as Hn, toEmbeddableSecrets as Ht, appDockerfile as I, hostFor as In, secretsStoreFor as It, DEV_SERVICES as J, stackLogs as Jn, detectPackageManager as Jt, validateImageRef as K, logsAccess as Kn, TURBO_VERSION as Kt, dockerCommand as L, DEFAULT_IMAGES as Ln, storeFromConfig as Lt, stageProviderNotes as M, surfaceClientTraced as Mn, loadPortState as Mt, PROVIDER_KINDS as N, telemetryOf as Nn, loadSecretsForApp as Nt, createDnsProvider as O, resourceName as On, createEntryWrapper as Ot, DockerBuildFailed as P, usesTelemetry as Pn, prepareEntryCredentials as Pt, assertDevServicesFlag as Q, resolveHost as Qn, isUnder as Qt, ensureDockerignore as R, describeServices as Rn, store_exports as Rt, recordRollback as S, stackRedis as Sn, composeFor as St, setGeneratedSecret as T, localRolePassword as Tn, providerOf as Tt, workerEntryDir as U, primaryPortKey as Un, withCustomSecret as Ut, WorkerGenerator as V, portsOf as Vn, storage_exports as Vt, QueueGenerator as W, LOCAL_LOGS_EMAIL as Wn, composeBuildPaths as Wt, ExternalServicesNotConfigured as X, NoDomainForStage as Xn, imageBuildCredentials as Xt, DevServicesNeedServerTarget as Y, withLogsPassword as Yn, findBuildRoot as Yt, STORAGE_KEY_PAIR as Z, isMainFrontendApp as Zn, isImageBuild as Zt, createComposeState as _, withGeneratedSecrets as _n, LEGACY_LOCAL_LOGIN as _t, dnsResources as a, postgresStatements as an, appEnvKeys as at, getGeneratedSecret as b, redisService as bn, pgClient as bt, describeActor as c, loadLocalCredentials as cn, workerEnvKeys as ct, extractSubdomain as d, readLocalCredentials as dn, constructGlobs as dt, applyBuckets as en, externalServices as et, findRootDomain as f, FileSecretsStore as fn, derivedContainers as ft, asDokployState as g, readKey as gn, forgetState as gt, verifyDnsRecords as h, projectKey as hn, LOCAL_CA_PATH as ht, dnsRecordResource as i, postgresDatabaseNames as in, suppliedOnly as it, provisionCommand as j, scopeTelemetryEnv as jn, loadEnvFiles as jt, StageProviderDisabled as k, appTelemetry as kn, findAvailablePort as kt, isCi as l, postgresRoleSlug as ln, FAKE_ENV as lt, orchestrateDns as m, keystoreProject as mn, workspace_exports as mt, reportDatabaseRuns as n, applyPostgres as nn, requiredStageKeys as nt, recordDnsChanges as o, quoteIdentifier as on, dockerfileOf as ot, normalizeDnsConfig as p, getKeyPath as pn, reconcileWorkspace as pt, AllowDevServicesTakesNoValue as q, logsService as qn, WORKER_PORT as qt, reportPlannedSeeds as r, bucketPolicies as rn, stageServiceDeclarations as rt, currentActor as s, LOCAL_RABBITMQ_USER as sn, networkEnv as st, DeploySeedsFailed as t, applyPolicies as tn, reportDevServices as tt, DeployJournal as u, postgresSuperuser as un, backendsOf as ut, createEmptyState as v, REDIS_SERVICE as vn, ensurePostgresLogin as vt, setBackupState as w, envFor as wn, eventsBackendFor as wt, recordRelease as x, runsRedis as xn, CLUSTER_DATABASE as xt, getBackupState as y, STACK_CACHE as yn, bucketClient as yt, workerDockerfile as z, fakeKey as zn, initStageSecrets as zt };
8154
8163
 
8155
- //# sourceMappingURL=seeds-Cx8NmuQj.mjs.map
8164
+ //# sourceMappingURL=seeds-BfzwCdYv.mjs.map