@geekmidas/cli 10.0.0-alpha.2 → 10.0.0-alpha.21

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 (241) hide show
  1. package/README.md +25 -48
  2. package/bin/adjacent-tsconfig.mjs +59 -0
  3. package/bin/gkm.mjs +7 -1
  4. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
  5. package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
  6. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  7. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  8. package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  9. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  10. package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  11. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  12. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  13. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  14. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  15. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  16. package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  17. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  18. package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  19. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  20. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  21. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  22. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  23. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  24. package/dist/{bundler-BY1OmV1e.cjs → bundler-mjqGAvu1.cjs} +10 -28
  25. package/dist/bundler-mjqGAvu1.cjs.map +1 -0
  26. package/dist/{bundler-Be8Zg4Wd.mjs → bundler-mwH7WOb1.mjs} +9 -26
  27. package/dist/bundler-mwH7WOb1.mjs.map +1 -0
  28. package/dist/{config-BholeD-0.cjs → config-DSXI480r.cjs} +80 -148
  29. package/dist/config-DSXI480r.cjs.map +1 -0
  30. package/dist/{config-CzWnfcXM.mjs → config-DdKkoUE1.mjs} +33 -88
  31. package/dist/config-DdKkoUE1.mjs.map +1 -0
  32. package/dist/config.cjs +4 -5
  33. package/dist/config.d.cts +14 -17
  34. package/dist/config.d.cts.map +1 -1
  35. package/dist/config.d.mts +14 -17
  36. package/dist/config.d.mts.map +1 -1
  37. package/dist/config.mjs +3 -5
  38. package/dist/{credentials-DQmbRnr1.cjs → credentials-BfmmB4WD.cjs} +1508 -1243
  39. package/dist/credentials-BfmmB4WD.cjs.map +1 -0
  40. package/dist/{credentials-BZcp3CGx.mjs → credentials-CD8ftUS6.mjs} +1374 -1114
  41. package/dist/credentials-CD8ftUS6.mjs.map +1 -0
  42. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  43. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  44. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  45. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  46. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  47. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  48. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  49. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  50. package/dist/deploy/sniffer-hooks.cjs +13 -7
  51. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  52. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  53. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  54. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  55. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  56. package/dist/deploy/sniffer-hooks.mjs +9 -2
  57. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  58. package/dist/deploy/sniffer-loader.cjs +16 -7
  59. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  60. package/dist/deploy/sniffer-loader.d.cts +1 -1
  61. package/dist/deploy/sniffer-loader.d.mts +1 -1
  62. package/dist/deploy/sniffer-loader.mjs +13 -2
  63. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  64. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  65. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  66. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  67. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  68. package/dist/deploy/sniffer-routes-worker.mjs +2 -2
  69. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  70. package/dist/deploy/sniffer-worker.cjs +15 -6
  71. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  72. package/dist/deploy/sniffer-worker.d.cts +1 -3
  73. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  74. package/dist/deploy/sniffer-worker.d.mts +1 -3
  75. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  76. package/dist/deploy/sniffer-worker.mjs +15 -4
  77. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  78. package/dist/{discover-DTmFeloL.cjs → discover-BERGFg8v.cjs} +81 -64
  79. package/dist/discover-BERGFg8v.cjs.map +1 -0
  80. package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
  81. package/dist/discover-CK-n3w6b.mjs.map +1 -0
  82. package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
  83. package/dist/emit-BdoPFjZf.cjs.map +1 -0
  84. package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
  85. package/dist/emit-Bzq7JsMP.mjs.map +1 -0
  86. package/dist/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
  87. package/dist/generator-LfZU7NlU.mjs.map +1 -0
  88. package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
  89. package/dist/generator-Wdfp0jCS.cjs.map +1 -0
  90. package/dist/github-Bho-C6Zg.cjs +216 -0
  91. package/dist/github-Bho-C6Zg.cjs.map +1 -0
  92. package/dist/github-De-yMwVt.mjs +216 -0
  93. package/dist/github-De-yMwVt.mjs.map +1 -0
  94. package/dist/{index-CHB4tSzX.d.cts → index-B4H4XF7A.d.mts} +4 -13
  95. package/dist/index-B4H4XF7A.d.mts.map +1 -0
  96. package/dist/{index-BThUzEIp.d.mts → index-RCUizGxL.d.cts} +4 -13
  97. package/dist/index-RCUizGxL.d.cts.map +1 -0
  98. package/dist/index.cjs +5108 -3381
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.cts +1 -1
  101. package/dist/index.d.mts +1 -1
  102. package/dist/index.mjs +5025 -3315
  103. package/dist/index.mjs.map +1 -1
  104. package/dist/{openapi-c9bpieI5.cjs → openapi-B8bu_OXN.cjs} +228 -188
  105. package/dist/openapi-B8bu_OXN.cjs.map +1 -0
  106. package/dist/{openapi-CY9xFkTH.mjs → openapi-DfjbhrsM.mjs} +172 -143
  107. package/dist/openapi-DfjbhrsM.mjs.map +1 -0
  108. package/dist/openapi.cjs +5 -6
  109. package/dist/openapi.d.cts +47 -14
  110. package/dist/openapi.d.cts.map +1 -1
  111. package/dist/openapi.d.mts +47 -14
  112. package/dist/openapi.d.mts.map +1 -1
  113. package/dist/openapi.mjs +2 -6
  114. package/dist/reconcile/public.cjs +4 -4
  115. package/dist/reconcile/public.d.cts +8 -26
  116. package/dist/reconcile/public.d.cts.map +1 -1
  117. package/dist/reconcile/public.d.mts +8 -26
  118. package/dist/reconcile/public.d.mts.map +1 -1
  119. package/dist/reconcile/public.mjs +3 -4
  120. package/dist/{fullstack-secrets-D1o9-G5l.mjs → reconcile-gb1lz1Dk.mjs} +43 -17
  121. package/dist/reconcile-gb1lz1Dk.mjs.map +1 -0
  122. package/dist/{fullstack-secrets-C-GGohke.cjs → reconcile-hx_vBvux.cjs} +63 -38
  123. package/dist/reconcile-hx_vBvux.cjs.map +1 -0
  124. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  125. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  126. package/dist/ssm-BKN1Cg4z.mjs +60 -0
  127. package/dist/ssm-BKN1Cg4z.mjs.map +1 -0
  128. package/dist/ssm-FxeSAt35.cjs +60 -0
  129. package/dist/ssm-FxeSAt35.cjs.map +1 -0
  130. package/dist/{storage-BJmzYxt8.cjs → storage-DgypfSD6.cjs} +65 -77
  131. package/dist/storage-DgypfSD6.cjs.map +1 -0
  132. package/dist/{storage-Bi24WfoW.mjs → storage-TP0x118M.mjs} +22 -15
  133. package/dist/storage-TP0x118M.mjs.map +1 -0
  134. package/dist/transfer-CXoyQZbB.cjs +151 -0
  135. package/dist/transfer-CXoyQZbB.cjs.map +1 -0
  136. package/dist/transfer-Gsxfy6m-.mjs +122 -0
  137. package/dist/transfer-Gsxfy6m-.mjs.map +1 -0
  138. package/dist/types-7R81hu0i.d.mts +6302 -0
  139. package/dist/types-7R81hu0i.d.mts.map +1 -0
  140. package/dist/types-N7c2O2m7.d.cts +6303 -0
  141. package/dist/types-N7c2O2m7.d.cts.map +1 -0
  142. package/dist/workspace/index.cjs +3 -3
  143. package/dist/workspace/index.d.cts +3 -3
  144. package/dist/workspace/index.d.mts +3 -3
  145. package/dist/workspace/index.mjs +2 -3
  146. package/dist/workspace-Bu3xNCej.mjs +6563 -0
  147. package/dist/workspace-Bu3xNCej.mjs.map +1 -0
  148. package/dist/workspace-CRD9YinV.cjs +6741 -0
  149. package/dist/workspace-CRD9YinV.cjs.map +1 -0
  150. package/package.json +33 -43
  151. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  152. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  153. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  154. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  155. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  156. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  157. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  158. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  159. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  160. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  161. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  162. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  163. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  164. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  165. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  166. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  167. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  168. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  169. package/dist/chunk-Duj1WY3L.mjs +0 -7
  170. package/dist/config-BholeD-0.cjs.map +0 -1
  171. package/dist/config-CzWnfcXM.mjs.map +0 -1
  172. package/dist/credentials-B5zRHdAl.mjs +0 -141
  173. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  174. package/dist/credentials-BZcp3CGx.mjs.map +0 -1
  175. package/dist/credentials-BapzjyV5.cjs +0 -195
  176. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  177. package/dist/credentials-DQmbRnr1.cjs.map +0 -1
  178. package/dist/discover-CAlFgYec.mjs.map +0 -1
  179. package/dist/discover-DTmFeloL.cjs.map +0 -1
  180. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  181. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  182. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  183. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  184. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  185. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  186. package/dist/emit-CbcRolsa.cjs.map +0 -1
  187. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  188. package/dist/encryption-C6jaU0hE.cjs +0 -54
  189. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  190. package/dist/encryption-CHzzeR8a.cjs +0 -4
  191. package/dist/encryption-CQUncu7v.mjs +0 -3
  192. package/dist/encryption-D-abyhZx.mjs +0 -42
  193. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  194. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  195. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  196. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  197. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  198. package/dist/index-BThUzEIp.d.mts.map +0 -1
  199. package/dist/index-CHB4tSzX.d.cts.map +0 -1
  200. package/dist/openapi-CY9xFkTH.mjs.map +0 -1
  201. package/dist/openapi-c9bpieI5.cjs.map +0 -1
  202. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  203. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  204. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  205. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  206. package/dist/openapi-react-query.cjs +0 -4
  207. package/dist/openapi-react-query.d.cts +0 -11
  208. package/dist/openapi-react-query.d.cts.map +0 -1
  209. package/dist/openapi-react-query.d.mts +0 -11
  210. package/dist/openapi-react-query.d.mts.map +0 -1
  211. package/dist/openapi-react-query.mjs +0 -4
  212. package/dist/reconcile-CFs8C_1a.mjs +0 -37
  213. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  214. package/dist/reconcile-D0pimNiy.cjs +0 -37
  215. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  216. package/dist/setup-Bc73t0ve.mjs +0 -443
  217. package/dist/setup-Bc73t0ve.mjs.map +0 -1
  218. package/dist/setup-C48C9hto.cjs +0 -473
  219. package/dist/setup-C48C9hto.cjs.map +0 -1
  220. package/dist/setup-DCuudnCl.mjs +0 -11
  221. package/dist/setup-fG_ivuxO.cjs +0 -11
  222. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  223. package/dist/storage-BM9hGpgv.cjs +0 -7
  224. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  225. package/dist/storage-CYlGwWTj.mjs +0 -3
  226. package/dist/sync-CmEuNZsB.mjs +0 -76
  227. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  228. package/dist/sync-D306yOWu.cjs +0 -4
  229. package/dist/sync-SizaChmC.cjs +0 -93
  230. package/dist/sync-SizaChmC.cjs.map +0 -1
  231. package/dist/sync-hOqAWHR6.mjs +0 -3
  232. package/dist/types-C-arnQ1r.d.mts +0 -2184
  233. package/dist/types-C-arnQ1r.d.mts.map +0 -1
  234. package/dist/types-abJQuk7m.d.cts +0 -2184
  235. package/dist/types-abJQuk7m.d.cts.map +0 -1
  236. package/dist/workspace-7FqprxuJ.mjs +0 -4323
  237. package/dist/workspace-7FqprxuJ.mjs.map +0 -1
  238. package/dist/workspace-BO_KWohI.cjs +0 -9
  239. package/dist/workspace-DK4WWJIn.mjs +0 -8
  240. package/dist/workspace-XvqO9jIv.cjs +0 -4472
  241. package/dist/workspace-XvqO9jIv.cjs.map +0 -1
@@ -1,2184 +0,0 @@
1
- import { ConstructManifest } from "@geekmidas/manifest";
2
- import { z } from "zod/v4";
3
-
4
- //#region src/deploy/state.d.ts
5
-
6
- /**
7
- * Deploy state management for Dokploy deployments
8
- *
9
- * Stores resource IDs (applications, services) per stage to avoid
10
- * re-creating resources on subsequent deploys.
11
- */
12
- /**
13
- * Per-app database credentials
14
- */
15
- interface AppDbCredentials {
16
- dbUser: string;
17
- dbPassword: string;
18
- }
19
- /**
20
- * DNS verification record for a hostname
21
- */
22
- interface DnsVerificationRecord {
23
- serverIp: string;
24
- verifiedAt: string;
25
- }
26
- /**
27
- * A DNS record that was created during deploy
28
- */
29
- interface CreatedDnsRecord {
30
- /** The domain this record belongs to (e.g., 'example.com') */
31
- domain: string;
32
- /** Record name/subdomain (e.g., 'api' or '@' for root) */
33
- name: string;
34
- /** Record type (A, CNAME, etc.) */
35
- type: string;
36
- /** Record value (IP address, hostname, etc.) */
37
- value: string;
38
- /** TTL in seconds */
39
- ttl: number;
40
- /** When this record was created */
41
- createdAt: string;
42
- }
43
- /**
44
- * Backup destination state
45
- */
46
- interface BackupState {
47
- /** S3 bucket name for backups */
48
- bucketName: string;
49
- /** S3 bucket ARN */
50
- bucketArn: string;
51
- /** IAM user name created for backup access */
52
- iamUserName: string;
53
- /** IAM access key ID */
54
- iamAccessKeyId: string;
55
- /** IAM secret access key */
56
- iamSecretAccessKey: string;
57
- /** Dokploy destination ID */
58
- destinationId: string;
59
- /** Dokploy backup schedule ID for postgres (if configured) */
60
- postgresBackupId?: string;
61
- /** AWS region where bucket was created */
62
- region: string;
63
- /** Timestamp when backup was configured */
64
- createdAt: string;
65
- }
66
- /**
67
- * State for a single stage deployment
68
- */
69
- interface DokployStageState {
70
- provider: 'dokploy';
71
- stage: string;
72
- /** Dokploy project ID - created on first deploy */
73
- projectId: string;
74
- environmentId: string;
75
- applications: Record<string, string>;
76
- services: {
77
- postgresId?: string;
78
- redisId?: string;
79
- };
80
- /** Per-app database credentials for reuse on subsequent deploys */
81
- appCredentials?: Record<string, AppDbCredentials>;
82
- /** Auto-generated secrets per app (e.g., BETTER_AUTH_SECRET) */
83
- generatedSecrets?: Record<string, Record<string, string>>;
84
- /** DNS verification state per hostname */
85
- dnsVerified?: Record<string, DnsVerificationRecord>;
86
- /** DNS records created during deploy (keyed by "name:type", e.g., "api:A") */
87
- dnsRecords?: Record<string, CreatedDnsRecord>;
88
- /** Backup destination state */
89
- backups?: BackupState;
90
- lastDeployedAt: string;
91
- }
92
- /**
93
- * Read the deploy state for a stage
94
- * Returns null if state file doesn't exist
95
- */
96
- //#endregion
97
- //#region src/deploy/StateProvider.d.ts
98
- /**
99
- * Interface for deployment state storage providers.
100
- *
101
- * Implementations must handle:
102
- * - Reading state for a stage (returns null if not found)
103
- * - Writing state for a stage (creates or updates)
104
- */
105
- interface StateProvider {
106
- /**
107
- * Read deployment state for a stage.
108
- *
109
- * @param stage - The deployment stage (e.g., 'development', 'production')
110
- * @returns The state object or null if not found
111
- */
112
- read(stage: string): Promise<DokployStageState | null>;
113
- /**
114
- * Write deployment state for a stage.
115
- *
116
- * @param stage - The deployment stage
117
- * @param state - The state object to persist
118
- */
119
- write(stage: string, state: DokployStageState): Promise<void>;
120
- }
121
- /**
122
- * Valid AWS regions.
123
- */
124
- type AwsRegion = 'us-east-1' | 'us-east-2' | 'us-west-1' | 'us-west-2' | 'af-south-1' | 'ap-east-1' | 'ap-south-1' | 'ap-south-2' | 'ap-southeast-1' | 'ap-southeast-2' | 'ap-southeast-3' | 'ap-southeast-4' | 'ap-northeast-1' | 'ap-northeast-2' | 'ap-northeast-3' | 'ca-central-1' | 'eu-central-1' | 'eu-central-2' | 'eu-west-1' | 'eu-west-2' | 'eu-west-3' | 'eu-south-1' | 'eu-south-2' | 'eu-north-1' | 'me-south-1' | 'me-central-1' | 'sa-east-1';
125
- /**
126
- * Local state provider config.
127
- */
128
- interface LocalStateConfig {
129
- provider: 'local';
130
- }
131
- /**
132
- * SSM state provider config (requires region).
133
- */
134
- interface SSMStateConfig {
135
- provider: 'ssm';
136
- /** AWS region (required for SSM provider) */
137
- region: AwsRegion;
138
- /** AWS profile name (optional - uses default credential chain if not provided) */
139
- profile?: string;
140
- }
141
- /**
142
- * Custom state provider config.
143
- */
144
- interface CustomStateConfig {
145
- /** Custom StateProvider implementation */
146
- provider: StateProvider;
147
- }
148
- /**
149
- * State configuration types.
150
- */
151
- type StateConfig = LocalStateConfig | SSMStateConfig | CustomStateConfig;
152
- /**
153
- * Check if value is a StateProvider implementation.
154
- */
155
- //#endregion
156
- //#region src/workspace/schema.d.ts
157
- /**
158
- * Backend framework schema for non-gkm apps.
159
- */
160
- declare const BackendFrameworkSchema: z.ZodEnum<{
161
- hono: "hono";
162
- "better-auth": "better-auth";
163
- express: "express";
164
- fastify: "fastify";
165
- }>;
166
- /**
167
- * Backend framework types for apps that don't use gkm routes.
168
- * Derived from {@link BackendFrameworkSchema}.
169
- *
170
- * Used with `entry` to specify the framework for proper Docker builds.
171
- *
172
- * @example
173
- * ```ts
174
- * // Better Auth server
175
- * {
176
- * entry: './src/index.ts',
177
- * framework: 'better-auth',
178
- * port: 3001,
179
- * }
180
- *
181
- * // Hono app without gkm routes
182
- * {
183
- * entry: './src/server.ts',
184
- * framework: 'hono',
185
- * port: 3000,
186
- * }
187
- * ```
188
- */
189
- type BackendFramework = z.infer<typeof BackendFrameworkSchema>;
190
- /**
191
- * Frontend framework schema.
192
- */
193
- declare const FrontendFrameworkSchema: z.ZodEnum<{
194
- nextjs: "nextjs";
195
- remix: "remix";
196
- vite: "vite";
197
- "tanstack-start": "tanstack-start";
198
- }>;
199
- /**
200
- * Frontend framework types. Derived from {@link FrontendFrameworkSchema}.
201
- *
202
- * @example
203
- * ```ts
204
- * // Next.js app
205
- * {
206
- * type: 'web',
207
- * framework: 'nextjs',
208
- * port: 3000,
209
- * }
210
- *
211
- * // Vite SPA
212
- * {
213
- * type: 'web',
214
- * framework: 'vite',
215
- * port: 5173,
216
- * }
217
- *
218
- * // TanStack Start (Vite-based, full-stack)
219
- * {
220
- * type: 'web',
221
- * framework: 'tanstack-start',
222
- * port: 3000,
223
- * }
224
- * ```
225
- */
226
- type FrontendFramework = z.infer<typeof FrontendFrameworkSchema>;
227
- /**
228
- * Mobile framework schema.
229
- */
230
- declare const MobileFrameworkSchema: z.ZodEnum<{
231
- expo: "expo";
232
- }>;
233
- /**
234
- * Mobile framework types. Derived from {@link MobileFrameworkSchema}.
235
- *
236
- * Mobile apps deploy via their own toolchain (e.g. EAS Build for Expo)
237
- * rather than Docker/Dokploy. Only build-time public env vars
238
- * (e.g. `EXPO_PUBLIC_*`) reach the device — server secrets are dropped.
239
- *
240
- * @example
241
- * ```ts
242
- * {
243
- * type: 'mobile',
244
- * framework: 'expo',
245
- * path: 'apps/mobile',
246
- * port: 8081,
247
- * dependencies: ['api'],
248
- * }
249
- * ```
250
- */
251
- type MobileFramework = z.infer<typeof MobileFrameworkSchema>;
252
- /**
253
- * Combined framework schema (backend, frontend, or mobile).
254
- */
255
- declare const FrameworkSchema: z.ZodUnion<readonly [z.ZodEnum<{
256
- hono: "hono";
257
- "better-auth": "better-auth";
258
- express: "express";
259
- fastify: "fastify";
260
- }>, z.ZodEnum<{
261
- nextjs: "nextjs";
262
- remix: "remix";
263
- vite: "vite";
264
- "tanstack-start": "tanstack-start";
265
- }>, z.ZodEnum<{
266
- expo: "expo";
267
- }>]>;
268
- /**
269
- * Any framework value across backend, frontend, or mobile.
270
- * Derived from {@link FrameworkSchema}.
271
- */
272
- type Framework = z.infer<typeof FrameworkSchema>;
273
- /**
274
- * Supported deploy targets (Phase 1).
275
- */
276
- declare const SUPPORTED_DEPLOY_TARGETS: readonly ["dokploy"];
277
- /**
278
- * Phase 2 deploy targets (not yet implemented).
279
- */
280
- declare const PHASE_2_DEPLOY_TARGETS: readonly ["vercel", "cloudflare"];
281
- /**
282
- * Check if a deploy target is supported.
283
- */
284
- declare function isDeployTargetSupported(target: string): boolean;
285
- /**
286
- * Check if a deploy target is planned for Phase 2.
287
- */
288
- declare function isPhase2DeployTarget(target: string): boolean;
289
- /**
290
- * Get error message for unsupported deploy targets.
291
- */
292
- declare function getDeployTargetError(target: string, appName?: string): string;
293
- /**
294
- * DNS record types supported across providers.
295
- */
296
-
297
- /**
298
- * Combined DNS config that supports both new multi-domain and legacy single-domain formats.
299
- */
300
- declare const DnsConfigWithLegacySchema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
301
- provider: z.ZodLiteral<"hostinger">;
302
- ttl: z.ZodOptional<z.ZodNumber>;
303
- }, z.core.$strip>, z.ZodObject<{
304
- provider: z.ZodLiteral<"route53">;
305
- region: z.ZodOptional<z.ZodEnum<{
306
- "us-east-1": "us-east-1";
307
- "us-east-2": "us-east-2";
308
- "us-west-1": "us-west-1";
309
- "us-west-2": "us-west-2";
310
- "af-south-1": "af-south-1";
311
- "ap-east-1": "ap-east-1";
312
- "ap-south-1": "ap-south-1";
313
- "ap-south-2": "ap-south-2";
314
- "ap-southeast-1": "ap-southeast-1";
315
- "ap-southeast-2": "ap-southeast-2";
316
- "ap-southeast-3": "ap-southeast-3";
317
- "ap-southeast-4": "ap-southeast-4";
318
- "ap-northeast-1": "ap-northeast-1";
319
- "ap-northeast-2": "ap-northeast-2";
320
- "ap-northeast-3": "ap-northeast-3";
321
- "ca-central-1": "ca-central-1";
322
- "eu-central-1": "eu-central-1";
323
- "eu-central-2": "eu-central-2";
324
- "eu-west-1": "eu-west-1";
325
- "eu-west-2": "eu-west-2";
326
- "eu-west-3": "eu-west-3";
327
- "eu-south-1": "eu-south-1";
328
- "eu-south-2": "eu-south-2";
329
- "eu-north-1": "eu-north-1";
330
- "me-south-1": "me-south-1";
331
- "me-central-1": "me-central-1";
332
- "sa-east-1": "sa-east-1";
333
- }>>;
334
- profile: z.ZodOptional<z.ZodString>;
335
- hostedZoneId: z.ZodOptional<z.ZodString>;
336
- ttl: z.ZodOptional<z.ZodNumber>;
337
- }, z.core.$strip>, z.ZodObject<{
338
- provider: z.ZodLiteral<"cloudflare">;
339
- ttl: z.ZodOptional<z.ZodNumber>;
340
- }, z.core.$strip>, z.ZodObject<{
341
- provider: z.ZodLiteral<"manual">;
342
- }, z.core.$strip>], "provider">, z.ZodObject<{
343
- provider: z.ZodCustom<{
344
- name: string;
345
- getRecords: Function;
346
- upsertRecords: Function;
347
- }, {
348
- name: string;
349
- getRecords: Function;
350
- upsertRecords: Function;
351
- }>;
352
- ttl: z.ZodOptional<z.ZodNumber>;
353
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
354
- provider: z.ZodLiteral<"hostinger">;
355
- ttl: z.ZodOptional<z.ZodNumber>;
356
- domain: z.ZodString;
357
- }, z.core.$strip>, z.ZodObject<{
358
- provider: z.ZodLiteral<"route53">;
359
- region: z.ZodOptional<z.ZodEnum<{
360
- "us-east-1": "us-east-1";
361
- "us-east-2": "us-east-2";
362
- "us-west-1": "us-west-1";
363
- "us-west-2": "us-west-2";
364
- "af-south-1": "af-south-1";
365
- "ap-east-1": "ap-east-1";
366
- "ap-south-1": "ap-south-1";
367
- "ap-south-2": "ap-south-2";
368
- "ap-southeast-1": "ap-southeast-1";
369
- "ap-southeast-2": "ap-southeast-2";
370
- "ap-southeast-3": "ap-southeast-3";
371
- "ap-southeast-4": "ap-southeast-4";
372
- "ap-northeast-1": "ap-northeast-1";
373
- "ap-northeast-2": "ap-northeast-2";
374
- "ap-northeast-3": "ap-northeast-3";
375
- "ca-central-1": "ca-central-1";
376
- "eu-central-1": "eu-central-1";
377
- "eu-central-2": "eu-central-2";
378
- "eu-west-1": "eu-west-1";
379
- "eu-west-2": "eu-west-2";
380
- "eu-west-3": "eu-west-3";
381
- "eu-south-1": "eu-south-1";
382
- "eu-south-2": "eu-south-2";
383
- "eu-north-1": "eu-north-1";
384
- "me-south-1": "me-south-1";
385
- "me-central-1": "me-central-1";
386
- "sa-east-1": "sa-east-1";
387
- }>>;
388
- profile: z.ZodOptional<z.ZodString>;
389
- hostedZoneId: z.ZodOptional<z.ZodString>;
390
- ttl: z.ZodOptional<z.ZodNumber>;
391
- domain: z.ZodString;
392
- }, z.core.$strip>, z.ZodObject<{
393
- provider: z.ZodLiteral<"cloudflare">;
394
- ttl: z.ZodOptional<z.ZodNumber>;
395
- domain: z.ZodString;
396
- }, z.core.$strip>, z.ZodObject<{
397
- provider: z.ZodLiteral<"manual">;
398
- domain: z.ZodString;
399
- }, z.core.$strip>], "provider">, z.ZodObject<{
400
- provider: z.ZodCustom<{
401
- name: string;
402
- getRecords: Function;
403
- upsertRecords: Function;
404
- }, {
405
- name: string;
406
- getRecords: Function;
407
- upsertRecords: Function;
408
- }>;
409
- ttl: z.ZodOptional<z.ZodNumber>;
410
- domain: z.ZodString;
411
- }, z.core.$strip>]>]>;
412
- type DnsConfig = z.infer<typeof DnsConfigWithLegacySchema>;
413
- /**
414
- * Backups configuration schema.
415
- *
416
- * Configures automatic backup destinations for database services.
417
- * On first deploy, creates S3 bucket with unique name and IAM credentials.
418
- */
419
- declare const BackupsConfigSchema: z.ZodObject<{
420
- type: z.ZodLiteral<"s3">;
421
- profile: z.ZodOptional<z.ZodString>;
422
- region: z.ZodEnum<{
423
- "us-east-1": "us-east-1";
424
- "us-east-2": "us-east-2";
425
- "us-west-1": "us-west-1";
426
- "us-west-2": "us-west-2";
427
- "af-south-1": "af-south-1";
428
- "ap-east-1": "ap-east-1";
429
- "ap-south-1": "ap-south-1";
430
- "ap-south-2": "ap-south-2";
431
- "ap-southeast-1": "ap-southeast-1";
432
- "ap-southeast-2": "ap-southeast-2";
433
- "ap-southeast-3": "ap-southeast-3";
434
- "ap-southeast-4": "ap-southeast-4";
435
- "ap-northeast-1": "ap-northeast-1";
436
- "ap-northeast-2": "ap-northeast-2";
437
- "ap-northeast-3": "ap-northeast-3";
438
- "ca-central-1": "ca-central-1";
439
- "eu-central-1": "eu-central-1";
440
- "eu-central-2": "eu-central-2";
441
- "eu-west-1": "eu-west-1";
442
- "eu-west-2": "eu-west-2";
443
- "eu-west-3": "eu-west-3";
444
- "eu-south-1": "eu-south-1";
445
- "eu-south-2": "eu-south-2";
446
- "eu-north-1": "eu-north-1";
447
- "me-south-1": "me-south-1";
448
- "me-central-1": "me-central-1";
449
- "sa-east-1": "sa-east-1";
450
- }>;
451
- schedule: z.ZodOptional<z.ZodString>;
452
- retention: z.ZodOptional<z.ZodNumber>;
453
- }, z.core.$strip>;
454
- type BackupsConfig = z.infer<typeof BackupsConfigSchema>;
455
- /**
456
- * Workspace configuration schema.
457
- */
458
- declare const WorkspaceConfigSchema: z.ZodObject<{
459
- name: z.ZodOptional<z.ZodString>;
460
- constructs: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
461
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
462
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
463
- }, z.core.$strip>]>>;
464
- apps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
465
- type: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
466
- backend: "backend";
467
- web: "web";
468
- mobile: "mobile";
469
- }>>>;
470
- path: z.ZodString;
471
- port: z.ZodNumber;
472
- dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
473
- deploy: z.ZodOptional<z.ZodEnum<{
474
- dokploy: "dokploy";
475
- vercel: "vercel";
476
- cloudflare: "cloudflare";
477
- }>>;
478
- constructs: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
479
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
480
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
481
- }, z.core.$strip>]>>;
482
- routes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
483
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
484
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
485
- }, z.core.$strip>]>>;
486
- functions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
487
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
488
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
489
- }, z.core.$strip>]>>;
490
- crons: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
491
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
492
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
493
- }, z.core.$strip>]>>;
494
- queues: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
495
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
496
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
497
- }, z.core.$strip>]>>;
498
- topics: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
499
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
500
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
501
- }, z.core.$strip>]>>;
502
- subscribers: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
503
- paths: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
504
- partition: z.ZodCustom<(filepath: string) => string, (filepath: string) => string>;
505
- }, z.core.$strip>]>>;
506
- envParser: z.ZodOptional<z.ZodString>;
507
- logger: z.ZodOptional<z.ZodString>;
508
- hooks: z.ZodOptional<z.ZodObject<{
509
- server: z.ZodOptional<z.ZodString>;
510
- }, z.core.$strip>>;
511
- telescope: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodObject<{
512
- enabled: z.ZodOptional<z.ZodBoolean>;
513
- port: z.ZodOptional<z.ZodNumber>;
514
- path: z.ZodOptional<z.ZodString>;
515
- ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
516
- recordBody: z.ZodOptional<z.ZodBoolean>;
517
- maxEntries: z.ZodOptional<z.ZodNumber>;
518
- websocket: z.ZodOptional<z.ZodBoolean>;
519
- }, z.core.$strip>]>>;
520
- studio: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodObject<{
521
- enabled: z.ZodOptional<z.ZodBoolean>;
522
- path: z.ZodOptional<z.ZodString>;
523
- schema: z.ZodOptional<z.ZodString>;
524
- }, z.core.$strip>]>>;
525
- openapi: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
526
- enabled: z.ZodOptional<z.ZodBoolean>;
527
- title: z.ZodOptional<z.ZodString>;
528
- version: z.ZodOptional<z.ZodString>;
529
- description: z.ZodOptional<z.ZodString>;
530
- }, z.core.$strip>]>>;
531
- runtime: z.ZodOptional<z.ZodEnum<{
532
- node: "node";
533
- bun: "bun";
534
- }>>;
535
- env: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
536
- entry: z.ZodOptional<z.ZodString>;
537
- framework: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
538
- hono: "hono";
539
- "better-auth": "better-auth";
540
- express: "express";
541
- fastify: "fastify";
542
- }>, z.ZodEnum<{
543
- nextjs: "nextjs";
544
- remix: "remix";
545
- vite: "vite";
546
- "tanstack-start": "tanstack-start";
547
- }>, z.ZodEnum<{
548
- expo: "expo";
549
- }>]>>;
550
- config: z.ZodOptional<z.ZodObject<{
551
- client: z.ZodOptional<z.ZodString>;
552
- server: z.ZodOptional<z.ZodString>;
553
- }, z.core.$strip>>;
554
- }, z.core.$strip>>>;
555
- shared: z.ZodOptional<z.ZodObject<{
556
- packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
557
- models: z.ZodOptional<z.ZodObject<{
558
- path: z.ZodOptional<z.ZodString>;
559
- schema: z.ZodOptional<z.ZodEnum<{
560
- zod: "zod";
561
- }>>;
562
- }, z.core.$strip>>;
563
- }, z.core.$strip>>;
564
- deploy: z.ZodOptional<z.ZodObject<{
565
- default: z.ZodOptional<z.ZodEnum<{
566
- dokploy: "dokploy";
567
- vercel: "vercel";
568
- cloudflare: "cloudflare";
569
- }>>;
570
- dokploy: z.ZodOptional<z.ZodObject<{
571
- endpoint: z.ZodOptional<z.ZodURL>;
572
- endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodURL>>;
573
- registry: z.ZodOptional<z.ZodString>;
574
- registryId: z.ZodOptional<z.ZodString>;
575
- domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
576
- }, z.core.$strip>>;
577
- dns: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
578
- provider: z.ZodLiteral<"hostinger">;
579
- ttl: z.ZodOptional<z.ZodNumber>;
580
- }, z.core.$strip>, z.ZodObject<{
581
- provider: z.ZodLiteral<"route53">;
582
- region: z.ZodOptional<z.ZodEnum<{
583
- "us-east-1": "us-east-1";
584
- "us-east-2": "us-east-2";
585
- "us-west-1": "us-west-1";
586
- "us-west-2": "us-west-2";
587
- "af-south-1": "af-south-1";
588
- "ap-east-1": "ap-east-1";
589
- "ap-south-1": "ap-south-1";
590
- "ap-south-2": "ap-south-2";
591
- "ap-southeast-1": "ap-southeast-1";
592
- "ap-southeast-2": "ap-southeast-2";
593
- "ap-southeast-3": "ap-southeast-3";
594
- "ap-southeast-4": "ap-southeast-4";
595
- "ap-northeast-1": "ap-northeast-1";
596
- "ap-northeast-2": "ap-northeast-2";
597
- "ap-northeast-3": "ap-northeast-3";
598
- "ca-central-1": "ca-central-1";
599
- "eu-central-1": "eu-central-1";
600
- "eu-central-2": "eu-central-2";
601
- "eu-west-1": "eu-west-1";
602
- "eu-west-2": "eu-west-2";
603
- "eu-west-3": "eu-west-3";
604
- "eu-south-1": "eu-south-1";
605
- "eu-south-2": "eu-south-2";
606
- "eu-north-1": "eu-north-1";
607
- "me-south-1": "me-south-1";
608
- "me-central-1": "me-central-1";
609
- "sa-east-1": "sa-east-1";
610
- }>>;
611
- profile: z.ZodOptional<z.ZodString>;
612
- hostedZoneId: z.ZodOptional<z.ZodString>;
613
- ttl: z.ZodOptional<z.ZodNumber>;
614
- }, z.core.$strip>, z.ZodObject<{
615
- provider: z.ZodLiteral<"cloudflare">;
616
- ttl: z.ZodOptional<z.ZodNumber>;
617
- }, z.core.$strip>, z.ZodObject<{
618
- provider: z.ZodLiteral<"manual">;
619
- }, z.core.$strip>], "provider">, z.ZodObject<{
620
- provider: z.ZodCustom<{
621
- name: string;
622
- getRecords: Function;
623
- upsertRecords: Function;
624
- }, {
625
- name: string;
626
- getRecords: Function;
627
- upsertRecords: Function;
628
- }>;
629
- ttl: z.ZodOptional<z.ZodNumber>;
630
- }, z.core.$strip>]>>, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
631
- provider: z.ZodLiteral<"hostinger">;
632
- ttl: z.ZodOptional<z.ZodNumber>;
633
- domain: z.ZodString;
634
- }, z.core.$strip>, z.ZodObject<{
635
- provider: z.ZodLiteral<"route53">;
636
- region: z.ZodOptional<z.ZodEnum<{
637
- "us-east-1": "us-east-1";
638
- "us-east-2": "us-east-2";
639
- "us-west-1": "us-west-1";
640
- "us-west-2": "us-west-2";
641
- "af-south-1": "af-south-1";
642
- "ap-east-1": "ap-east-1";
643
- "ap-south-1": "ap-south-1";
644
- "ap-south-2": "ap-south-2";
645
- "ap-southeast-1": "ap-southeast-1";
646
- "ap-southeast-2": "ap-southeast-2";
647
- "ap-southeast-3": "ap-southeast-3";
648
- "ap-southeast-4": "ap-southeast-4";
649
- "ap-northeast-1": "ap-northeast-1";
650
- "ap-northeast-2": "ap-northeast-2";
651
- "ap-northeast-3": "ap-northeast-3";
652
- "ca-central-1": "ca-central-1";
653
- "eu-central-1": "eu-central-1";
654
- "eu-central-2": "eu-central-2";
655
- "eu-west-1": "eu-west-1";
656
- "eu-west-2": "eu-west-2";
657
- "eu-west-3": "eu-west-3";
658
- "eu-south-1": "eu-south-1";
659
- "eu-south-2": "eu-south-2";
660
- "eu-north-1": "eu-north-1";
661
- "me-south-1": "me-south-1";
662
- "me-central-1": "me-central-1";
663
- "sa-east-1": "sa-east-1";
664
- }>>;
665
- profile: z.ZodOptional<z.ZodString>;
666
- hostedZoneId: z.ZodOptional<z.ZodString>;
667
- ttl: z.ZodOptional<z.ZodNumber>;
668
- domain: z.ZodString;
669
- }, z.core.$strip>, z.ZodObject<{
670
- provider: z.ZodLiteral<"cloudflare">;
671
- ttl: z.ZodOptional<z.ZodNumber>;
672
- domain: z.ZodString;
673
- }, z.core.$strip>, z.ZodObject<{
674
- provider: z.ZodLiteral<"manual">;
675
- domain: z.ZodString;
676
- }, z.core.$strip>], "provider">, z.ZodObject<{
677
- provider: z.ZodCustom<{
678
- name: string;
679
- getRecords: Function;
680
- upsertRecords: Function;
681
- }, {
682
- name: string;
683
- getRecords: Function;
684
- upsertRecords: Function;
685
- }>;
686
- ttl: z.ZodOptional<z.ZodNumber>;
687
- domain: z.ZodString;
688
- }, z.core.$strip>]>]>>;
689
- backups: z.ZodOptional<z.ZodObject<{
690
- type: z.ZodLiteral<"s3">;
691
- profile: z.ZodOptional<z.ZodString>;
692
- region: z.ZodEnum<{
693
- "us-east-1": "us-east-1";
694
- "us-east-2": "us-east-2";
695
- "us-west-1": "us-west-1";
696
- "us-west-2": "us-west-2";
697
- "af-south-1": "af-south-1";
698
- "ap-east-1": "ap-east-1";
699
- "ap-south-1": "ap-south-1";
700
- "ap-south-2": "ap-south-2";
701
- "ap-southeast-1": "ap-southeast-1";
702
- "ap-southeast-2": "ap-southeast-2";
703
- "ap-southeast-3": "ap-southeast-3";
704
- "ap-southeast-4": "ap-southeast-4";
705
- "ap-northeast-1": "ap-northeast-1";
706
- "ap-northeast-2": "ap-northeast-2";
707
- "ap-northeast-3": "ap-northeast-3";
708
- "ca-central-1": "ca-central-1";
709
- "eu-central-1": "eu-central-1";
710
- "eu-central-2": "eu-central-2";
711
- "eu-west-1": "eu-west-1";
712
- "eu-west-2": "eu-west-2";
713
- "eu-west-3": "eu-west-3";
714
- "eu-south-1": "eu-south-1";
715
- "eu-south-2": "eu-south-2";
716
- "eu-north-1": "eu-north-1";
717
- "me-south-1": "me-south-1";
718
- "me-central-1": "me-central-1";
719
- "sa-east-1": "sa-east-1";
720
- }>;
721
- schedule: z.ZodOptional<z.ZodString>;
722
- retention: z.ZodOptional<z.ZodNumber>;
723
- }, z.core.$strip>>;
724
- }, z.core.$strip>>;
725
- services: z.ZodOptional<z.ZodObject<{
726
- db: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
727
- version: z.ZodOptional<z.ZodString>;
728
- image: z.ZodOptional<z.ZodString>;
729
- }, z.core.$strip>]>>;
730
- cache: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
731
- version: z.ZodOptional<z.ZodString>;
732
- image: z.ZodOptional<z.ZodString>;
733
- }, z.core.$strip>, z.ZodEnum<{
734
- upstash: "upstash";
735
- elasticache: "elasticache";
736
- db: "db";
737
- }>]>>;
738
- mail: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
739
- version: z.ZodOptional<z.ZodString>;
740
- image: z.ZodOptional<z.ZodString>;
741
- smtp: z.ZodOptional<z.ZodObject<{
742
- host: z.ZodString;
743
- port: z.ZodNumber;
744
- user: z.ZodOptional<z.ZodString>;
745
- pass: z.ZodOptional<z.ZodString>;
746
- }, z.core.$strip>>;
747
- }, z.core.$strip>, z.ZodEnum<{
748
- resend: "resend";
749
- ses: "ses";
750
- smtp: "smtp";
751
- }>]>>;
752
- storage: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
753
- version: z.ZodOptional<z.ZodString>;
754
- image: z.ZodOptional<z.ZodString>;
755
- }, z.core.$strip>, z.ZodEnum<{
756
- minio: "minio";
757
- s3: "s3";
758
- r2: "r2";
759
- }>]>>;
760
- events: z.ZodOptional<z.ZodEnum<{
761
- pgboss: "pgboss";
762
- sns: "sns";
763
- rabbitmq: "rabbitmq";
764
- }>>;
765
- trustLocalCa: z.ZodOptional<z.ZodBoolean>;
766
- }, z.core.$strip>>;
767
- secrets: z.ZodOptional<z.ZodObject<{
768
- enabled: z.ZodOptional<z.ZodBoolean>;
769
- algorithm: z.ZodOptional<z.ZodString>;
770
- kdf: z.ZodOptional<z.ZodEnum<{
771
- scrypt: "scrypt";
772
- pbkdf2: "pbkdf2";
773
- }>>;
774
- }, z.core.$strip>>;
775
- state: z.ZodOptional<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
776
- provider: z.ZodLiteral<"local">;
777
- }, z.core.$strip>, z.ZodObject<{
778
- provider: z.ZodLiteral<"ssm">;
779
- region: z.ZodEnum<{
780
- "us-east-1": "us-east-1";
781
- "us-east-2": "us-east-2";
782
- "us-west-1": "us-west-1";
783
- "us-west-2": "us-west-2";
784
- "af-south-1": "af-south-1";
785
- "ap-east-1": "ap-east-1";
786
- "ap-south-1": "ap-south-1";
787
- "ap-south-2": "ap-south-2";
788
- "ap-southeast-1": "ap-southeast-1";
789
- "ap-southeast-2": "ap-southeast-2";
790
- "ap-southeast-3": "ap-southeast-3";
791
- "ap-southeast-4": "ap-southeast-4";
792
- "ap-northeast-1": "ap-northeast-1";
793
- "ap-northeast-2": "ap-northeast-2";
794
- "ap-northeast-3": "ap-northeast-3";
795
- "ca-central-1": "ca-central-1";
796
- "eu-central-1": "eu-central-1";
797
- "eu-central-2": "eu-central-2";
798
- "eu-west-1": "eu-west-1";
799
- "eu-west-2": "eu-west-2";
800
- "eu-west-3": "eu-west-3";
801
- "eu-south-1": "eu-south-1";
802
- "eu-south-2": "eu-south-2";
803
- "eu-north-1": "eu-north-1";
804
- "me-south-1": "me-south-1";
805
- "me-central-1": "me-central-1";
806
- "sa-east-1": "sa-east-1";
807
- }>;
808
- profile: z.ZodOptional<z.ZodString>;
809
- }, z.core.$strip>], "provider">, z.ZodObject<{
810
- provider: z.ZodCustom<{
811
- read: Function;
812
- write: Function;
813
- }, {
814
- read: Function;
815
- write: Function;
816
- }>;
817
- }, z.core.$strip>]>>;
818
- }, z.core.$strip>;
819
- /**
820
- * Validate workspace configuration.
821
- * Throws ZodError with detailed messages on validation failure.
822
- */
823
- declare function validateWorkspaceConfig(config: unknown): z.infer<typeof WorkspaceConfigSchema>;
824
- /**
825
- * Safe validation that returns result instead of throwing.
826
- */
827
- declare function safeValidateWorkspaceConfig(config: unknown): {
828
- success: boolean;
829
- data?: z.infer<typeof WorkspaceConfigSchema>;
830
- error?: z.ZodError;
831
- };
832
- /**
833
- * Format Zod errors into user-friendly messages.
834
- */
835
- declare function formatValidationErrors(error: z.ZodError): string;
836
- //#endregion
837
- //#region src/workspace/types.d.ts
838
- /**
839
- * Deploy target for an app.
840
- *
841
- * Specifies where the app will be deployed.
842
- *
843
- * @example
844
- * ```ts
845
- * // Currently supported
846
- * deploy: 'dokploy'
847
- *
848
- * // Future support (not yet implemented)
849
- * deploy: 'vercel'
850
- * deploy: 'cloudflare'
851
- * ```
852
- */
853
- type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
854
- /**
855
- * Service image configuration for custom Docker images.
856
- *
857
- * @example
858
- * ```ts
859
- * // Use specific version
860
- * db: { version: '18-alpine' }
861
- *
862
- * // Use custom image
863
- * db: { image: 'timescale/timescaledb:latest-pg16' }
864
- * ```
865
- */
866
- interface ServiceImageConfig {
867
- /** Docker image version/tag (e.g., '18-alpine') */
868
- version?: string;
869
- /** Full Docker image reference (overrides version) */
870
- image?: string;
871
- }
872
- /**
873
- * Mail service configuration.
874
- *
875
- * In development, uses Mailpit for email testing.
876
- * In production, uses SMTP configuration.
877
- *
878
- * @example
879
- * ```ts
880
- * services: {
881
- * mail: {
882
- * smtp: {
883
- * host: 'smtp.sendgrid.net',
884
- * port: 587,
885
- * user: 'apikey',
886
- * pass: process.env.SENDGRID_API_KEY,
887
- * }
888
- * }
889
- * }
890
- * ```
891
- */
892
- interface MailServiceConfig extends ServiceImageConfig {
893
- /** SMTP configuration for production */
894
- smtp?: {
895
- host: string;
896
- port: number;
897
- user?: string;
898
- pass?: string;
899
- };
900
- }
901
- /**
902
- * Development services configuration.
903
- *
904
- * Configures shared infrastructure services like databases and caches.
905
- * These are automatically provisioned in Dokploy during deployment.
906
- *
907
- * @example
908
- * ```ts
909
- * // Enable with defaults
910
- * services: {
911
- * db: true, // postgres:18-alpine
912
- * cache: true, // redis:8-alpine
913
- * }
914
- *
915
- * // Custom versions
916
- * services: {
917
- * db: { version: '18-alpine' },
918
- * cache: { version: '7-alpine' },
919
- * }
920
- *
921
- * // Custom images
922
- * services: {
923
- * db: { image: 'timescale/timescaledb:latest-pg16' },
924
- * }
925
- *
926
- * // With mail service
927
- * services: {
928
- * db: true,
929
- * cache: true,
930
- * mail: true, // Mailpit in dev
931
- * }
932
- *
933
- * // With event backend
934
- * services: {
935
- * db: true,
936
- * cache: true,
937
- * events: 'pgboss', // reuses postgres (auto-enables db)
938
- * // events: 'sns', // adds LocalStack container
939
- * // events: 'rabbitmq', // adds RabbitMQ container
940
- * }
941
- * ```
942
- */
943
- interface ServicesConfig {
944
- /**
945
- * Whether to install the local edge's certificate authority automatically.
946
- *
947
- * A declared `file-server` answers on `https://` locally, which needs a
948
- * certificate, which needs an authority this machine trusts. Everything gkm
949
- * starts trusts it already — reconcile injects `NODE_EXTRA_CA_CERTS` — but a
950
- * *browser* asks the operating system, and until the root is in its store a
951
- * local address reads as "not secure".
952
- *
953
- * Installing it needs `sudo`, so it is never silent by default:
954
- *
955
- * - unset — `gkm setup` asks once, on a machine that does not trust it yet,
956
- * and remembers a "no" so it stops asking.
957
- * - `true` — install without asking. For a team that has decided, and for
958
- * any machine where a prompt has nobody to answer it.
959
- * - `false` — never. Correct for CI, and for anyone who only ever reaches
960
- * these addresses from code, which trusts the root without any of this.
961
- */
962
- trustLocalCa?: boolean;
963
- /**
964
- * Where a declared cache lives — `'upstash'`, `'elasticache'` or `'db'`.
965
- *
966
- * A backend name and nothing else. Whether there *is* a cache comes from the
967
- * manifest: declaring one implies its container the way declaring a database
968
- * implies Postgres, so this only ever answers the second question.
969
- *
970
- * Defaults by target — see `DEFAULT_CACHE`.
971
- */
972
- cache?: CacheBackend;
973
- /**
974
- * Who delivers a declared app's mail — `'ses'`, `'resend'` or `'smtp'`.
975
- *
976
- * Locally every one of them is Mailpit, because every one speaks SMTP.
977
- */
978
- mail?: EmailBackend;
979
- /** Where a declared bucket lives — `'minio'`, `'s3'` or `'r2'`. */
980
- storage?: StorageBackend;
981
- /** What carries a declared queue or topic — pgboss, sns or rabbitmq. */
982
- events?: EventsBackend;
983
- /**
984
- * Image pins for the containers the manifest derives.
985
- *
986
- * Separate from the backend names above, because they answer unrelated
987
- * questions: a backend says where a thing lives, a pin says which image runs
988
- * locally. They shared one key until `cache: true` meant "start a Redis" —
989
- * which was the last way a container could exist because config asked for
990
- * it rather than because something declared it.
991
- *
992
- * ```ts
993
- * services: { cache: 'elasticache', images: { redis: 'redis:6-alpine' } }
994
- * ```
995
- *
996
- * Pinning an image for a container nothing declares is a no-op, not an
997
- * error: it says which image *would* run, and nothing runs.
998
- */
999
- images?: Partial<Record<ComposeServiceName, string>>;
1000
- }
1001
- /**
1002
- * Stage-based domain configuration.
1003
- *
1004
- * Maps deployment stages to base domains. The main frontend app
1005
- * gets the base domain, other apps get `{appName}.{baseDomain}`.
1006
- *
1007
- * @example
1008
- * ```ts
1009
- * domains: {
1010
- * development: 'dev.myapp.com',
1011
- * staging: 'staging.myapp.com',
1012
- * production: 'myapp.com',
1013
- * }
1014
- *
1015
- * // Result for production stage:
1016
- * // - web (main frontend): myapp.com
1017
- * // - api: api.myapp.com
1018
- * // - auth: auth.myapp.com
1019
- * ```
1020
- */
1021
- type DokployDomainsConfig = Record<string, string>;
1022
- /**
1023
- * Per-app domain override configuration.
1024
- *
1025
- * Can be a single domain string (used for all stages) or
1026
- * stage-specific domains.
1027
- *
1028
- * @example
1029
- * ```ts
1030
- * // Single domain for all stages
1031
- * domain: 'api.custom.com'
1032
- *
1033
- * // Stage-specific domains
1034
- * domain: {
1035
- * development: 'api.dev.custom.com',
1036
- * staging: 'api.staging.custom.com',
1037
- * production: 'api.custom.com',
1038
- * }
1039
- * ```
1040
- */
1041
- type AppDomainConfig = string | Record<string, string>;
1042
- /**
1043
- * Dokploy workspace deployment configuration.
1044
- *
1045
- * Configures how the workspace is deployed to a Dokploy server.
1046
- * One workspace maps to one Dokploy project with stage-based environments.
1047
- * Project IDs are stored in deploy state (not config) and created on first deploy.
1048
- *
1049
- * @example Single endpoint for all stages:
1050
- * ```ts
1051
- * deploy: {
1052
- * default: 'dokploy',
1053
- * dokploy: {
1054
- * endpoint: 'https://dokploy.myserver.com',
1055
- * registry: 'ghcr.io/myorg',
1056
- * },
1057
- * }
1058
- * ```
1059
- *
1060
- * @example Per-stage endpoints (different Dokploy servers):
1061
- * ```ts
1062
- * deploy: {
1063
- * default: 'dokploy',
1064
- * dokploy: {
1065
- * endpoints: {
1066
- * development: 'https://dev-dokploy.myserver.com',
1067
- * production: 'https://dokploy.myserver.com',
1068
- * },
1069
- * registry: 'ghcr.io/myorg',
1070
- * },
1071
- * }
1072
- * ```
1073
- */
1074
- interface DokployWorkspaceConfig {
1075
- /** Dokploy API endpoint for all stages */
1076
- endpoint?: string;
1077
- /** Per-stage Dokploy API endpoints (overrides endpoint) */
1078
- endpoints?: Record<string, string>;
1079
- /** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
1080
- registry?: string;
1081
- /** Registry ID in Dokploy (auto-configured) */
1082
- registryId?: string;
1083
- /**
1084
- * Stage-based domain configuration.
1085
- * The main frontend app gets the base domain.
1086
- * Other apps get {appName}.{baseDomain} by default.
1087
- */
1088
- domains?: DokployDomainsConfig;
1089
- }
1090
- /**
1091
- * DNS provider types for automatic DNS record creation.
1092
- */
1093
-
1094
- /**
1095
- * Deployment configuration for the workspace.
1096
- *
1097
- * @example
1098
- * ```ts
1099
- * // Minimal - just set default target
1100
- * deploy: {
1101
- * default: 'dokploy',
1102
- * }
1103
- *
1104
- * // Full configuration with DNS and backups
1105
- * deploy: {
1106
- * default: 'dokploy',
1107
- * dokploy: {
1108
- * endpoint: 'https://dokploy.myserver.com',
1109
- * projectId: 'proj_abc123',
1110
- * registry: 'ghcr.io/myorg',
1111
- * domains: {
1112
- * production: 'myapp.com',
1113
- * },
1114
- * },
1115
- * dns: {
1116
- * provider: 'hostinger',
1117
- * domain: 'myapp.com',
1118
- * },
1119
- * backups: {
1120
- * type: 's3',
1121
- * region: 'us-east-1',
1122
- * },
1123
- * }
1124
- * ```
1125
- */
1126
- interface DeployConfig {
1127
- /** Default deploy target for all apps (default: 'dokploy') */
1128
- default?: DeployTarget;
1129
- /** Dokploy-specific configuration */
1130
- dokploy?: DokployWorkspaceConfig;
1131
- /** DNS configuration for automatic record creation */
1132
- dns?: DnsConfig;
1133
- /** Backup destination configuration for database services */
1134
- backups?: BackupsConfig;
1135
- }
1136
- /**
1137
- * Models package configuration for shared schemas.
1138
- *
1139
- * Configures a shared models package containing Zod schemas
1140
- * that can be used across backend and frontend apps.
1141
- *
1142
- * @example
1143
- * ```ts
1144
- * shared: {
1145
- * models: {
1146
- * path: 'packages/models',
1147
- * schema: 'zod',
1148
- * },
1149
- * }
1150
- * ```
1151
- */
1152
- interface ModelsConfig {
1153
- /** Path to models package relative to workspace root (default: 'packages/models') */
1154
- path?: string;
1155
- /**
1156
- * Schema library to use (default: 'zod').
1157
- * Currently only 'zod' is supported.
1158
- * Future: any StandardSchema-compatible library
1159
- */
1160
- schema?: 'zod';
1161
- }
1162
- /**
1163
- * Shared packages configuration.
1164
- *
1165
- * Configures shared packages in the monorepo that are
1166
- * used by multiple apps.
1167
- *
1168
- * @example
1169
- * ```ts
1170
- * shared: {
1171
- * packages: ['packages/*', 'libs/*'],
1172
- * models: {
1173
- * path: 'packages/models',
1174
- * schema: 'zod',
1175
- * },
1176
- * }
1177
- * ```
1178
- */
1179
- interface SharedConfig {
1180
- /** Glob patterns for shared packages (default: ['packages/*']) */
1181
- packages?: string[];
1182
- /** Models package configuration */
1183
- models?: ModelsConfig;
1184
- }
1185
- /**
1186
- * Secrets encryption configuration.
1187
- *
1188
- * Configures how secrets are encrypted for deployment.
1189
- * Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
1190
- * with keys stored separately in `~/.gkm/{project}/{stage}.key`.
1191
- *
1192
- * @example
1193
- * ```ts
1194
- * secrets: {
1195
- * enabled: true,
1196
- * algorithm: 'aes-256-gcm',
1197
- * kdf: 'scrypt',
1198
- * }
1199
- * ```
1200
- */
1201
- interface SecretsConfig {
1202
- /** Enable encrypted secrets (default: true) */
1203
- enabled?: boolean;
1204
- /** Encryption algorithm (default: 'aes-256-gcm') */
1205
- algorithm?: string;
1206
- /** Key derivation function (default: 'scrypt') */
1207
- kdf?: 'scrypt' | 'pbkdf2';
1208
- }
1209
- /**
1210
- * Base app configuration properties (shared between input and normalized).
1211
- *
1212
- * @example
1213
- * ```ts
1214
- * // Backend app with gkm routes
1215
- * api: {
1216
- * type: 'backend',
1217
- * path: 'apps/api',
1218
- * port: 3000,
1219
- * routes: './src/endpoints/**\/*.ts',
1220
- * envParser: './src/config/env',
1221
- * logger: './src/config/logger',
1222
- * }
1223
- *
1224
- * // Backend app with entry point (e.g., Better Auth)
1225
- * auth: {
1226
- * type: 'backend',
1227
- * path: 'apps/auth',
1228
- * port: 3001,
1229
- * entry: './src/index.ts',
1230
- * framework: 'better-auth',
1231
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
1232
- * }
1233
- *
1234
- * // Frontend app
1235
- * web: {
1236
- * type: 'web',
1237
- * path: 'apps/web',
1238
- * port: 3002,
1239
- * framework: 'nextjs',
1240
- * dependencies: ['api', 'auth'],
1241
- * }
1242
- * ```
1243
- */
1244
- interface AppConfigBase {
1245
- /**
1246
- * App type.
1247
- * - 'backend': Server-side app (API, auth service, etc.)
1248
- * - 'web': Client-side web app (Next.js, Vite, TanStack Start, etc.)
1249
- * - 'mobile': Native mobile app (Expo). Built/deployed via its own
1250
- * toolchain (e.g. EAS Build) — Docker/Dokploy steps are skipped.
1251
- * @default 'backend'
1252
- */
1253
- type?: 'backend' | 'web' | 'mobile';
1254
- /**
1255
- * Path to the app relative to workspace root.
1256
- * @example 'apps/api', 'apps/web', 'services/auth'
1257
- */
1258
- path: string;
1259
- /**
1260
- * Development server port.
1261
- * Must be unique across all apps in the workspace.
1262
- * @example 3000, 3001, 3002
1263
- */
1264
- port: number;
1265
- /**
1266
- * Per-app deploy target override.
1267
- * Overrides `deploy.default` for this specific app.
1268
- * @example 'dokploy', 'vercel'
1269
- */
1270
- deploy?: DeployTarget;
1271
- /**
1272
- * Constructs glob pattern — one glob, every kind.
1273
- *
1274
- * A glob per kind cannot find a resource, because a declared `ObjectStorage`
1275
- * has no kind to be listed under. This one is what reconcile reads to derive
1276
- * the containers a stage needs, and it replaces the per-kind globs below.
1277
- *
1278
- * @example './src/**\/*.ts'
1279
- */
1280
- constructs?: Routes;
1281
- /**
1282
- * Routes glob pattern for gkm endpoints.
1283
- * @example './src/endpoints/**\/*.ts'
1284
- */
1285
- routes?: Routes;
1286
- /**
1287
- * Functions glob pattern for Lambda functions.
1288
- * @example './src/functions/**\/*.ts'
1289
- */
1290
- functions?: Routes;
1291
- /**
1292
- * Crons glob pattern for scheduled tasks.
1293
- * @example './src/crons/**\/*.ts'
1294
- */
1295
- crons?: Routes;
1296
- /**
1297
- * Queues glob pattern for point-to-point workers.
1298
- * @example './src/queues/**\/*.ts'
1299
- */
1300
- queues?: Routes;
1301
- /**
1302
- * Topics glob pattern for the topics subscribers bind to.
1303
- * @example './src/topics/**\/*.ts'
1304
- */
1305
- topics?: Routes;
1306
- /**
1307
- * Subscribers glob pattern for event handlers.
1308
- * @example './src/subscribers/**\/*.ts'
1309
- */
1310
- subscribers?: Routes;
1311
- /**
1312
- * Path to environment parser module.
1313
- * @example './src/config/env'
1314
- */
1315
- envParser?: string;
1316
- /**
1317
- * Path to logger module.
1318
- * @example './src/config/logger'
1319
- */
1320
- logger?: string;
1321
- /** Provider configuration (AWS, Docker, etc.) */
1322
- providers?: ProvidersConfig;
1323
- /**
1324
- * Server lifecycle hooks.
1325
- * @example { beforeSetup: './src/hooks/setup.ts' }
1326
- */
1327
- hooks?: HooksConfig;
1328
- /**
1329
- * Telescope debugging dashboard configuration.
1330
- * @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
1331
- */
1332
- telescope?: string | boolean | TelescopeConfig;
1333
- /**
1334
- * Studio admin panel configuration.
1335
- * @example true, './src/config/studio'
1336
- */
1337
- studio?: string | boolean | StudioConfig;
1338
- /**
1339
- * OpenAPI documentation configuration.
1340
- * @example true, { output: './src/openapi.ts' }
1341
- */
1342
- openapi?: boolean | OpenApiConfig;
1343
- /**
1344
- * Runtime environment.
1345
- * @default 'node'
1346
- */
1347
- runtime?: Runtime;
1348
- /**
1349
- * Environment file(s) to load during development.
1350
- * @example '.env', ['.env', '.env.local']
1351
- */
1352
- env?: string | string[];
1353
- /**
1354
- * Entry file path for apps that don't use gkm routes.
1355
- *
1356
- * When specified, the app is run directly with tsx in development
1357
- * and bundled with esbuild for production Docker builds.
1358
- *
1359
- * Use this for:
1360
- * - Better Auth servers
1361
- * - Custom Hono/Express apps
1362
- * - Any backend that doesn't use gkm's endpoint builder
1363
- *
1364
- * @example './src/index.ts', './src/server.ts'
1365
- */
1366
- entry?: string;
1367
- /**
1368
- * Framework for the app.
1369
- *
1370
- * Backend frameworks: 'hono', 'better-auth', 'express', 'fastify'
1371
- * Frontend frameworks: 'nextjs', 'remix', 'vite', 'tanstack-start'
1372
- * Mobile frameworks: 'expo'
1373
- *
1374
- * @example 'nextjs', 'better-auth', 'hono', 'expo'
1375
- */
1376
- framework?: Framework;
1377
- /**
1378
- * Config file paths for frontend environment sniffing.
1379
- *
1380
- * Points to file(s) that call EnvironmentParser.parse() at import time.
1381
- * The sniffer imports these files and captures all env vars accessed.
1382
- *
1383
- * Dependencies are auto-generated as public-prefixed URL vars based on
1384
- * the app's framework (e.g. `NEXT_PUBLIC_{DEP}_URL` for Next.js,
1385
- * `VITE_{DEP}_URL` for Vite/TanStack Start, `EXPO_PUBLIC_{DEP}_URL`
1386
- * for Expo).
1387
- *
1388
- * @example
1389
- * ```ts
1390
- * config: {
1391
- * client: './src/config/client.ts', // public-prefixed vars for browser
1392
- * server: './src/config/server.ts', // server-only vars for SSR
1393
- * }
1394
- * ```
1395
- */
1396
- config?: {
1397
- /** Client-side config (public-prefixed vars, available in browser/device) */
1398
- client?: string;
1399
- /** Server-side config (all env vars, for SSR/API routes) */
1400
- server?: string;
1401
- };
1402
- /**
1403
- * Override domain for this app.
1404
- *
1405
- * By default, apps get `{appName}.{baseDomain}` (or just `{baseDomain}`
1406
- * for the main frontend). Use this to specify a custom domain.
1407
- *
1408
- * @example
1409
- * ```ts
1410
- * // Single domain for all stages
1411
- * domain: 'api.custom.com'
1412
- *
1413
- * // Stage-specific domains
1414
- * domain: {
1415
- * production: 'api.custom.com',
1416
- * staging: 'api.staging.custom.com',
1417
- * }
1418
- * ```
1419
- */
1420
- domain?: AppDomainConfig;
1421
- /**
1422
- * Required environment variables for entry-based apps.
1423
- *
1424
- * Use this instead of envParser for apps that don't use gkm routes.
1425
- * The deploy command uses this list to filter which secrets to embed
1426
- * in the Docker image.
1427
- *
1428
- * @example ['DATABASE_URL', 'BETTER_AUTH_SECRET', 'REDIS_URL']
1429
- */
1430
- requiredEnv?: string[];
1431
- }
1432
- /**
1433
- * App configuration input with type-safe dependencies.
1434
- *
1435
- * @template TAppNames - Union of valid app names in the workspace (auto-inferred)
1436
- *
1437
- * @example
1438
- * ```ts
1439
- * // Dependencies are type-checked against app names
1440
- * apps: {
1441
- * api: { path: 'apps/api', port: 3000 },
1442
- * auth: { path: 'apps/auth', port: 3001 },
1443
- * web: {
1444
- * path: 'apps/web',
1445
- * port: 3002,
1446
- * type: 'web',
1447
- * dependencies: ['api', 'auth'], // ✓ Valid
1448
- * // dependencies: ['invalid'], // ✗ Type error
1449
- * },
1450
- * }
1451
- * ```
1452
- */
1453
- interface AppConfigInput<TAppNames extends string = string> extends AppConfigBase {
1454
- /** Dependencies on other apps in the workspace (type-safe) */
1455
- dependencies?: TAppNames[];
1456
- }
1457
- /**
1458
- * App configuration (legacy, for backwards compatibility).
1459
- * @deprecated Use AppConfigInput for new code
1460
- */
1461
- interface AppConfig extends AppConfigBase {
1462
- /** Dependencies on other apps in the workspace */
1463
- dependencies?: string[];
1464
- }
1465
- /**
1466
- * Base app input type for type inference.
1467
- */
1468
- type AppInput = AppConfigBase & {
1469
- dependencies?: readonly string[];
1470
- };
1471
- /**
1472
- * Apps record type for workspace configuration.
1473
- */
1474
- type AppsRecord = Record<string, AppInput>;
1475
- /**
1476
- * Constrain apps so dependencies only reference valid app names.
1477
- * Dependencies must be an array of valid app names from the workspace.
1478
- */
1479
- type ConstrainedApps<TApps extends AppsRecord> = { [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
1480
- dependencies?: readonly (keyof TApps & string)[];
1481
- } };
1482
- /**
1483
- * Full workspace input type with constrained dependencies.
1484
- *
1485
- * @example
1486
- * ```ts
1487
- * import { defineWorkspace } from '@geekmidas/cli';
1488
- *
1489
- * export default defineWorkspace({
1490
- * name: 'my-app',
1491
- * apps: {
1492
- * api: {
1493
- * path: 'apps/api',
1494
- * port: 3000,
1495
- * routes: './src/endpoints/**\/*.ts',
1496
- * },
1497
- * web: {
1498
- * type: 'web',
1499
- * path: 'apps/web',
1500
- * port: 3001,
1501
- * framework: 'nextjs',
1502
- * dependencies: ['api'],
1503
- * },
1504
- * },
1505
- * services: {
1506
- * db: true,
1507
- * cache: true,
1508
- * },
1509
- * deploy: {
1510
- * default: 'dokploy',
1511
- * },
1512
- * });
1513
- * ```
1514
- */
1515
- type WorkspaceInput<TApps extends AppsRecord> = {
1516
- /**
1517
- * Where the workspace's own constructs live, relative to its root.
1518
- *
1519
- * The product's infrastructure, declared once for every app that consumes
1520
- * it. Additive with an app's own glob rather than replacing it.
1521
- */
1522
- constructs?: Routes;
1523
- /** Workspace name (defaults to root package.json name) */
1524
- name?: string;
1525
- /**
1526
- * Apps that nothing declares.
1527
- *
1528
- * Normally absent: a `site` is an app and so is a `rest-api` that named
1529
- * one, so the list is read off the graph. This is the escape hatch for what
1530
- * no construct describes.
1531
- */
1532
- apps?: ConstrainedApps<TApps>;
1533
- /** Shared packages configuration */
1534
- shared?: SharedConfig;
1535
- /** Deployment configuration */
1536
- deploy?: DeployConfig;
1537
- /** Development services (db, cache, mail, storage, events) */
1538
- services?: ServicesConfig;
1539
- /** Encrypted secrets configuration */
1540
- secrets?: SecretsConfig;
1541
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
1542
- state?: StateConfig;
1543
- };
1544
- /**
1545
- * Extract app names from apps record.
1546
- */
1547
- type InferAppNames<TApps extends AppsRecord> = keyof TApps & string;
1548
- /**
1549
- * Inferred workspace config with proper app name types.
1550
- */
1551
- type InferredWorkspaceConfig<TApps extends AppsRecord> = {
1552
- /**
1553
- * Where the workspace's own constructs live, relative to its root.
1554
- *
1555
- * The product's infrastructure, declared once for every app that consumes
1556
- * it. Additive with an app's own glob rather than replacing it.
1557
- */
1558
- constructs?: Routes;
1559
- name?: string;
1560
- apps?: { [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
1561
- dependencies?: InferAppNames<TApps>[];
1562
- } };
1563
- shared?: SharedConfig;
1564
- deploy?: DeployConfig;
1565
- services?: ServicesConfig;
1566
- secrets?: SecretsConfig;
1567
- state?: StateConfig;
1568
- };
1569
- /** @deprecated Use WorkspaceInput */
1570
-
1571
- /**
1572
- * Workspace configuration for multi-app monorepos.
1573
- *
1574
- * Use `defineWorkspace()` helper for type-safe configuration with
1575
- * auto-completion and dependency validation.
1576
- *
1577
- * @example
1578
- * ```ts
1579
- * // gkm.config.ts
1580
- * import { defineWorkspace } from '@geekmidas/cli';
1581
- *
1582
- * export default defineWorkspace({
1583
- * name: 'my-saas',
1584
- *
1585
- * // App definitions
1586
- * apps: {
1587
- * // Backend API with gkm routes
1588
- * api: {
1589
- * path: 'apps/api',
1590
- * port: 3000,
1591
- * routes: './src/endpoints/**\/*.ts',
1592
- * envParser: './src/config/env',
1593
- * logger: './src/config/logger',
1594
- * telescope: true,
1595
- * },
1596
- *
1597
- * // Better Auth service
1598
- * auth: {
1599
- * path: 'apps/auth',
1600
- * port: 3001,
1601
- * entry: './src/index.ts',
1602
- * framework: 'better-auth',
1603
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
1604
- * },
1605
- *
1606
- * // Next.js frontend
1607
- * web: {
1608
- * type: 'web',
1609
- * path: 'apps/web',
1610
- * port: 3002,
1611
- * framework: 'nextjs',
1612
- * dependencies: ['api', 'auth'],
1613
- * },
1614
- * },
1615
- *
1616
- * // Infrastructure services
1617
- * services: {
1618
- * db: true, // PostgreSQL
1619
- * cache: true, // Redis
1620
- * },
1621
- *
1622
- * // Deployment configuration
1623
- * deploy: {
1624
- * default: 'dokploy',
1625
- * dokploy: {
1626
- * endpoint: 'https://dokploy.myserver.com',
1627
- * projectId: 'proj_abc123',
1628
- * registry: 'ghcr.io/myorg',
1629
- * domains: {
1630
- * production: 'myapp.com',
1631
- * staging: 'staging.myapp.com',
1632
- * },
1633
- * },
1634
- * },
1635
- *
1636
- * // Shared packages
1637
- * shared: {
1638
- * packages: ['packages/*'],
1639
- * models: { path: 'packages/models' },
1640
- * },
1641
- * });
1642
- * ```
1643
- *
1644
- * @deprecated Use WorkspaceInput with defineWorkspace for type inference
1645
- */
1646
- interface WorkspaceConfig {
1647
- /**
1648
- * Where the workspace's own constructs live, relative to its root.
1649
- *
1650
- * The product's infrastructure, declared once for every app that consumes
1651
- * it. Additive with an app's own glob rather than replacing it.
1652
- */
1653
- constructs?: Routes;
1654
- /** Workspace name (defaults to root package.json name) */
1655
- name?: string;
1656
- /** Apps that nothing declares. Normally absent — see `WorkspaceInput`. */
1657
- apps?: Record<string, AppConfig>;
1658
- /** Shared packages configuration */
1659
- shared?: SharedConfig;
1660
- /** Default deployment configuration */
1661
- deploy?: DeployConfig;
1662
- /** Development services (db, cache, mail, storage, events) */
1663
- services?: ServicesConfig;
1664
- /** Encrypted secrets configuration */
1665
- secrets?: SecretsConfig;
1666
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
1667
- state?: StateConfig;
1668
- }
1669
- /**
1670
- * Normalized app configuration with resolved defaults.
1671
- *
1672
- * This is the internal representation after processing user input.
1673
- * All optional fields have been resolved to their defaults.
1674
- */
1675
- interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
1676
- /**
1677
- * Whether the base domain points at this site.
1678
- *
1679
- * Carried from the `site` declaration rather than configured, because which
1680
- * site is primary is structural — its *hostname* is what varies by stage,
1681
- * and that is `domain`.
1682
- */
1683
- root?: boolean;
1684
- /** App type (always defined after normalization) */
1685
- type: 'backend' | 'web' | 'mobile';
1686
- /** Path to the app */
1687
- path: string;
1688
- /** Development server port */
1689
- port: number;
1690
- /** Resolved dependencies array (empty array if none) */
1691
- dependencies: string[];
1692
- /** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
1693
- resolvedDeployTarget: DeployTarget;
1694
- /** Entry file path for non-gkm apps */
1695
- entry?: string;
1696
- /** Framework for the app */
1697
- framework?: Framework;
1698
- /** Override domain for this app */
1699
- domain?: AppDomainConfig;
1700
- /** Required environment variables for entry-based apps */
1701
- requiredEnv?: string[];
1702
- }
1703
- /**
1704
- * Normalized workspace configuration with resolved defaults.
1705
- *
1706
- * This is the internal representation after processing user input.
1707
- * All optional fields have been resolved to their defaults.
1708
- */
1709
- interface NormalizedWorkspace {
1710
- /** Workspace name (resolved from package.json if not specified) */
1711
- name: string;
1712
- /** Absolute path to workspace root */
1713
- root: string;
1714
- /**
1715
- * The workspace's own constructs glob, relative to `root`.
1716
- *
1717
- * Where the product's shared infrastructure is declared. Additive with each
1718
- * app's glob, so an app can still declare something only it uses.
1719
- */
1720
- constructs?: Routes;
1721
- /** Normalized app configurations */
1722
- apps: Record<string, NormalizedAppConfig>;
1723
- /** Services configuration (empty object if not specified) */
1724
- services: ServicesConfig;
1725
- /** Deploy configuration (empty object if not specified) */
1726
- deploy: DeployConfig;
1727
- /** Shared packages configuration (empty object if not specified) */
1728
- shared: SharedConfig;
1729
- /** Secrets configuration (empty object if not specified) */
1730
- secrets: SecretsConfig;
1731
- /** State provider configuration (undefined = local filesystem) */
1732
- state?: StateConfig;
1733
- }
1734
- /**
1735
- * Result of loading and processing a configuration.
1736
- */
1737
- interface LoadedConfig {
1738
- /** Whether this is a single-app or workspace config */
1739
- type: 'single' | 'workspace';
1740
- /** The raw configuration as loaded */
1741
- raw: GkmConfig | WorkspaceConfig;
1742
- /** Normalized workspace (always available) */
1743
- workspace: NormalizedWorkspace;
1744
- /**
1745
- * What the workspace's constructs declared, when it has any.
1746
- *
1747
- * Read once at load, because the apps above are derived from it and a
1748
- * caller that re-discovers would be answering the same question twice with
1749
- * two chances to disagree. Absent when the workspace declares no constructs.
1750
- */
1751
- manifest?: ConstructManifest;
1752
- }
1753
- /**
1754
- * Type guard to check if a config is a WorkspaceConfig.
1755
- *
1756
- * @example
1757
- * ```ts
1758
- * const config = await loadConfig();
1759
- * if (isWorkspaceConfig(config)) {
1760
- * // config.apps is available
1761
- * console.log(Object.keys(config.apps));
1762
- * }
1763
- * ```
1764
- */
1765
- declare function isWorkspaceConfig(config: GkmConfig | WorkspaceConfig): config is WorkspaceConfig;
1766
- //# sourceMappingURL=types.d.ts.map
1767
- //#endregion
1768
- //#region src/types.d.ts
1769
- interface PartitionedRoutes {
1770
- paths: string | string[];
1771
- partition: (filepath: string) => string;
1772
- }
1773
- type Routes = string | string[] | PartitionedRoutes;
1774
- interface ProviderConfig {
1775
- enabled?: boolean;
1776
- outputDir?: string;
1777
- }
1778
- interface AWSApiGatewayConfig extends ProviderConfig {}
1779
- interface AWSLambdaConfig extends ProviderConfig {}
1780
- interface ProductionConfig {
1781
- /** Enable production mode (default: false) */
1782
- enabled?: boolean;
1783
- /** Bundle server into single file (default: true) */
1784
- bundle?: boolean;
1785
- /** Minify bundled output (default: true) */
1786
- minify?: boolean;
1787
- /** Health check endpoint path (default: '/health') */
1788
- healthCheck?: string;
1789
- /** Enable graceful shutdown handling (default: true) */
1790
- gracefulShutdown?: boolean;
1791
- /** Packages to exclude from bundling (default: []) */
1792
- external?: string[];
1793
- /** Include subscribers in production build (default: 'exclude' for serverless) */
1794
- subscribers?: 'include' | 'exclude';
1795
- /** Include OpenAPI spec in production (default: false) */
1796
- openapi?: boolean;
1797
- /**
1798
- * Enable build-time optimized handler generation (default: true)
1799
- * Generates specialized handlers based on endpoint tier:
1800
- * - minimal: Near-raw-Hono performance for simple endpoints
1801
- * - standard: Optimized handlers for auth/services
1802
- * - full: Uses HonoEndpoint.addRoutes for complex endpoints
1803
- */
1804
- optimizedHandlers?: boolean;
1805
- }
1806
- /** Service-specific configuration for docker-compose */
1807
- interface ServiceConfig {
1808
- /**
1809
- * Full Docker image reference (e.g., 'postgis/postgis:16-3.4-alpine').
1810
- * When specified, overrides the default image entirely.
1811
- */
1812
- image?: string;
1813
- /**
1814
- * Docker image version/tag (e.g., '15-alpine' for postgres).
1815
- * Only used when `image` is not specified.
1816
- */
1817
- version?: string;
1818
- }
1819
- /**
1820
- * Supported event backend types.
1821
- *
1822
- * - `pgboss`: Reuses PostgreSQL with a dedicated user/schema. Auto-enables db service.
1823
- * - `sns`: Adds LocalStack container with SNS+SQS services.
1824
- * - `rabbitmq`: Adds RabbitMQ container.
1825
- *
1826
- * All backends generate EVENT_PUBLISHER_CONNECTION_STRING and EVENT_SUBSCRIBER_CONNECTION_STRING.
1827
- */
1828
- type EventsBackend = 'pgboss' | 'sns' | 'rabbitmq';
1829
- /**
1830
- * Where a declared cache actually lives.
1831
- *
1832
- * A deployment choice, not an application one — the same code caches into any
1833
- * of these — so it is config here beside `events` rather than a field on the
1834
- * construct. Each backend is consistent between local and deployed, which is
1835
- * the property worth having: a cache that behaves differently in the two places
1836
- * is worse than a slower one.
1837
- *
1838
- * - `upstash` (default) — HTTP with a token. Reachable from a Lambda with no
1839
- * VPC and no connection pool, which is why it is the default; locally the
1840
- * `serverless-redis-http` proxy in front of Redis speaks the same protocol.
1841
- * - `elasticache` — the Redis wire protocol, inside a VPC. Locally, plain Redis.
1842
- * - `db` — a table in the database the app already declared. No infrastructure
1843
- * at all, and the same relationship pg-boss has to Postgres: it creates its
1844
- * own table on first use and needs a declared database to live in.
1845
- */
1846
- type CacheBackend = 'upstash' | 'elasticache' | 'db';
1847
- /**
1848
- * Where a declared bucket actually lives.
1849
- *
1850
- * The fourth of these selectors and the last to arrive, which is why
1851
- * `UPLOADS_URL` had no answer on a container target: there was nothing to
1852
- * choose with. Like the others it changes no application code — the `s3://`
1853
- * scheme picks the driver, and every one of these speaks it.
1854
- *
1855
- * - `s3` — a real bucket. Nothing is created on the host; the URL is composed
1856
- * against credentials you already hold, the same way `resend` is an API key
1857
- * rather than infrastructure.
1858
- * - `r2` — Cloudflare's, reached through the same S3 API and differing only in
1859
- * its endpoint.
1860
- * - `minio` — a container. Everything the app declares lives on the box, which
1861
- * is what makes a single-host deploy self-contained, and what makes it a
1862
- * single disk with no replication. Locally this is what every backend is.
1863
- */
1864
- type StorageBackend = 'minio' | 's3' | 'r2';
1865
- /**
1866
- * The backend a project gets when it says nothing, by where it deploys.
1867
- *
1868
- * Flat defaults could not be right for both: `upstash` on a single box means a
1869
- * SaaS round-trip for a cache the database could have held, and `minio` on AWS
1870
- * means running a bucket beside S3. So the default is a function of the target,
1871
- * and an app that says nothing gets the obvious answer in both places — which
1872
- * is the whole of what "zero config" can mean once there is more than one
1873
- * target.
1874
- *
1875
- * `server` covers Dokploy and a bare host alike: the question these answer is
1876
- * whether the app is next to a managed cloud or next to its own containers, and
1877
- * on that question the two are the same.
1878
- *
1879
- * A per-construct, per-stage override is the layer above this — see
1880
- * `constructs-outstanding.md` — so two buckets in one app can differ. This is
1881
- * only what happens when nobody has said anything at all.
1882
- */
1883
-
1884
- /**
1885
- * Who delivers a declared app's mail.
1886
- *
1887
- * Unlike a cache, this changes *nothing* about the client. Every backend speaks
1888
- * SMTP, so the declaration's `smtp://` URL is true of all of them and only the
1889
- * provisioner differs — which is the same reason the declaration has no
1890
- * `provider` field and there is no `ses://` scheme.
1891
- *
1892
- * - `ses` (default) — the only backend that can be a *chain* of resources: an
1893
- * identity, a user, an access key, and an SMTP password derived from it,
1894
- * because SES issues IAM credentials rather than SMTP ones. Hand it a URL and
1895
- * it uses that instead, which is what you want when the credentials already
1896
- * exist — provisioning a second set of sending credentials for an identity
1897
- * that already has them is not a thing to do by default.
1898
- * - `resend` — an API key you hold, composed into an SMTP URL. Nothing to
1899
- * provision: a SaaS account is not infrastructure.
1900
- * - `smtp` — a URL supplied whole, for a relay somebody else runs.
1901
- *
1902
- * Locally every one of them is Mailpit, because locally none of it matters.
1903
- */
1904
- type EmailBackend = 'resend' | 'ses' | 'smtp';
1905
- /**
1906
- * Who delivers mail when nobody said.
1907
- *
1908
- * Flat, unlike the others, and deliberately: mail is a SaaS on every target.
1909
- * There is no self-hosted preset to default a container deploy to — Mailpit is
1910
- * a development inbox, not a sender — so `server` has no answer of its own to
1911
- * give and would only be `ses` written twice.
1912
- */
1913
-
1914
- /** Supported docker-compose service names */
1915
- type ComposeServiceName = 'postgres' | 'redis' | 'rabbitmq' | 'minio' | 'mailpit' | 'localstack';
1916
- /** Services configuration - can be boolean (use defaults) or object with version */
1917
- type ComposeServicesConfig = { [K in ComposeServiceName]?: boolean | ServiceConfig };
1918
- interface DockerConfig {
1919
- /** Container registry URL (e.g., 'ghcr.io/myorg') */
1920
- registry?: string;
1921
- /** Docker image name (default: derived from package.json name) */
1922
- imageName?: string;
1923
- /** Base Docker image (default: 'node:22-alpine') */
1924
- baseImage?: string;
1925
- /** Container port (default: 3000) */
1926
- port?: number;
1927
- /** docker-compose services to include */
1928
- compose?: {
1929
- /**
1930
- * Services to include in docker-compose.
1931
- * Can be an object with service configs or an array of service names (legacy).
1932
- *
1933
- * @example Object format (recommended)
1934
- * services: {
1935
- * postgres: { version: '15-alpine' },
1936
- * redis: true, // use default version
1937
- * }
1938
- *
1939
- * @example Array format (legacy, uses default versions)
1940
- * services: ['postgres', 'redis']
1941
- */
1942
- services?: ComposeServicesConfig | ComposeServiceName[];
1943
- };
1944
- }
1945
- interface ServerConfig extends ProviderConfig {
1946
- enableOpenApi?: boolean;
1947
- port?: number;
1948
- /** Production build configuration */
1949
- production?: ProductionConfig;
1950
- }
1951
- type Runtime = 'node' | 'bun';
1952
- interface TelescopeConfig {
1953
- /** Enable/disable telescope (default: true in development) */
1954
- enabled?: boolean;
1955
- /** Port for telescope to use (defaults to server port) */
1956
- port?: number;
1957
- /** Path prefix for telescope UI (default: /__telescope) */
1958
- path?: string;
1959
- /** Ignore patterns for telescope (e.g., ['/health', '/metrics']) */
1960
- ignore?: string[];
1961
- /** Record request/response bodies (default: true) */
1962
- recordBody?: boolean;
1963
- /** Maximum entries to keep in memory (default: 1000) */
1964
- maxEntries?: number;
1965
- /** Enable WebSocket for real-time updates (default: true, requires @hono/node-ws for Node.js) */
1966
- websocket?: boolean;
1967
- }
1968
- interface StudioConfig {
1969
- /** Enable/disable studio (default: true in development) */
1970
- enabled?: boolean;
1971
- /** Path prefix for studio UI (default: /__studio) */
1972
- path?: string;
1973
- /** Schema to introspect (default: 'public') */
1974
- schema?: string;
1975
- }
1976
- interface OpenApiConfig {
1977
- /** Enable OpenAPI generation (default: true) */
1978
- enabled?: boolean;
1979
- /** API title */
1980
- title?: string;
1981
- /** API version */
1982
- version?: string;
1983
- /** API description */
1984
- description?: string;
1985
- }
1986
- interface HooksConfig {
1987
- /**
1988
- * Path to a module exporting server lifecycle hooks.
1989
- * The module should export `beforeSetup` and/or `afterSetup` functions.
1990
- *
1991
- * @example
1992
- * ```typescript
1993
- * // src/config/hooks.ts
1994
- * import type { Hono } from 'hono';
1995
- * import type { Logger } from '@geekmidas/logger';
1996
- * import type { EnvironmentParser } from '@geekmidas/envkit';
1997
- *
1998
- * // Called BEFORE gkm endpoints are registered
1999
- * export function beforeSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {
2000
- * app.use('*', cors());
2001
- * app.get('/custom/health', (c) => c.json({ status: 'ok' }));
2002
- * }
2003
- *
2004
- * // Called AFTER gkm endpoints are registered
2005
- * export function afterSetup(app: Hono, ctx: { envParser: EnvironmentParser; logger: Logger }) {
2006
- * app.notFound((c) => c.json({ error: 'Not found' }, 404));
2007
- * app.onError((err, c) => c.json({ error: err.message }, 500));
2008
- * }
2009
- * ```
2010
- */
2011
- server?: string;
2012
- }
2013
- /** Dokploy deployment configuration */
2014
- interface DokployProviderConfig {
2015
- /** Dokploy API endpoint (e.g., 'https://dokploy.example.com') */
2016
- endpoint: string;
2017
- /** Project ID in Dokploy */
2018
- projectId: string;
2019
- /** Application ID in Dokploy */
2020
- applicationId: string;
2021
- /** Container registry (overrides docker.registry if set) */
2022
- registry?: string;
2023
- /** Registry ID in Dokploy (recommended for private registries) */
2024
- registryId?: string;
2025
- }
2026
- interface ProvidersConfig {
2027
- aws?: {
2028
- apiGateway?: {
2029
- v1?: boolean | AWSApiGatewayConfig;
2030
- v2?: boolean | AWSApiGatewayConfig;
2031
- };
2032
- lambda?: {
2033
- functions?: boolean | AWSLambdaConfig;
2034
- crons?: boolean | AWSLambdaConfig;
2035
- };
2036
- };
2037
- server?: boolean | ServerConfig;
2038
- /** Dokploy deployment configuration */
2039
- dokploy?: boolean | DokployProviderConfig;
2040
- }
2041
- interface GkmConfig {
2042
- /**
2043
- * What this app is called, and therefore how everything it declares is named.
2044
- *
2045
- * The same field `sst.config.ts` carries, doing the same job: every physical
2046
- * name is `{stage}-{name}-{construct}`, so `Database` in the `production`
2047
- * stage of `kitchen-sink` is `production-kitchen-sink-database` on AWS and on
2048
- * Dokploy alike. One statement, in the config, rather than a rule each
2049
- * provider restates.
2050
- *
2051
- * `defineWorkspace` has always had this. A single-app config did not, so its
2052
- * names fell back to whatever the directory happened to be called — the
2053
- * monorepo's package name for the project and the app's for the application,
2054
- * two accidents of layout standing in for a decision.
2055
- *
2056
- * Defaults to the package.json name with any scope stripped, then the
2057
- * directory name.
2058
- */
2059
- name?: string;
2060
- /**
2061
- * Where the things no construct implies live.
2062
- *
2063
- * The same block a workspace config carries, and the same split: `db` and
2064
- * `storage` are derived from the declared `KyselyDatabase` and
2065
- * `ObjectStorage` and are ignored here, while `cache`, `mail`, and `events`
2066
- * name a *backend* — where the cache lives, who delivers the mail, which
2067
- * broker carries events. A single-app project had no way to say any of that
2068
- * before, so its event backend could only be guessed.
2069
- */
2070
- services?: ServicesConfig;
2071
- /**
2072
- * Constructs glob pattern — one glob, every kind.
2073
- *
2074
- * What reconcile reads to derive the containers a stage needs: a database
2075
- * implies Postgres, objects imply MinIO, mail implies Mailpit. A glob per
2076
- * kind cannot find a resource, because a declared `ObjectStorage` has no
2077
- * kind to be listed under.
2078
- *
2079
- * @example './src/**\/*.ts'
2080
- */
2081
- constructs?: Routes;
2082
- routes: Routes;
2083
- functions?: Routes;
2084
- crons?: Routes;
2085
- subscribers?: Routes;
2086
- queues?: Routes;
2087
- topics?: Routes;
2088
- envParser: string;
2089
- logger: string;
2090
- providers?: ProvidersConfig;
2091
- /**
2092
- * Server lifecycle hooks for customizing the Hono app.
2093
- * Allows adding custom routes, middleware, error handlers, etc.
2094
- *
2095
- * @example
2096
- * hooks: {
2097
- * server: './src/config/hooks'
2098
- * }
2099
- */
2100
- hooks?: HooksConfig;
2101
- /**
2102
- * Telescope configuration for debugging/monitoring.
2103
- * Can be:
2104
- * - A string path to a module that exports a Telescope instance (recommended)
2105
- * - A boolean to enable/disable with defaults
2106
- * - A TelescopeConfig object for inline configuration
2107
- */
2108
- telescope?: string | boolean | TelescopeConfig;
2109
- /**
2110
- * Studio configuration for database browsing.
2111
- * Can be:
2112
- * - A string path to a module that exports a Studio instance (recommended)
2113
- * - A boolean to enable/disable with defaults
2114
- * - A StudioConfig object for inline configuration
2115
- *
2116
- * Requires a database connection configured via services.
2117
- */
2118
- studio?: string | boolean | StudioConfig;
2119
- /**
2120
- * OpenAPI generation configuration.
2121
- * Can be:
2122
- * - A boolean to enable/disable with defaults (output: ./src/api/openapi.ts)
2123
- * - An OpenApiConfig object for customization
2124
- *
2125
- * When enabled, OpenAPI spec is generated on startup and regenerated on route changes.
2126
- *
2127
- * @example
2128
- * openapi: true
2129
- *
2130
- * @example
2131
- * openapi: {
2132
- * output: './src/api/openapi.ts',
2133
- * title: 'My API',
2134
- * version: '1.0.0',
2135
- * }
2136
- */
2137
- openapi?: boolean | OpenApiConfig;
2138
- /** Runtime to use for dev server (default: 'node') */
2139
- runtime?: Runtime;
2140
- /**
2141
- * Environment file(s) to load for development.
2142
- * Can be:
2143
- * - A string path to a single env file (e.g., '.env.local')
2144
- * - An array of paths to load in order (later files override earlier)
2145
- * - Defaults to '.env' if not specified
2146
- *
2147
- * @example
2148
- * env: '.env.local'
2149
- *
2150
- * @example
2151
- * env: ['.env', '.env.local']
2152
- */
2153
- env?: string | string[];
2154
- /**
2155
- * Docker deployment configuration.
2156
- * Used by `gkm docker` and `gkm prepack` commands.
2157
- *
2158
- * @example
2159
- * docker: {
2160
- * registry: 'ghcr.io/myorg',
2161
- * imageName: 'my-api',
2162
- * compose: {
2163
- * services: ['postgres', 'redis']
2164
- * }
2165
- * }
2166
- */
2167
- docker?: DockerConfig;
2168
- /**
2169
- * Where this app deploys, and what the target needs to know.
2170
- *
2171
- * Absent until now, which meant a single-app project could not configure a
2172
- * Dokploy deploy at all: the wrap that turns one into a workspace hardcoded
2173
- * `{ default: 'dokploy' }` and dropped everything else, so there was no
2174
- * endpoint, no registry and no domain — and `resolveHost` failed with "no
2175
- * domain configured for stage" on a config that had nowhere to put one.
2176
- *
2177
- * The same shape a workspace config uses, so moving from one to the other is
2178
- * a rename rather than a rewrite.
2179
- */
2180
- deploy?: DeployConfig;
2181
- }
2182
- //#endregion
2183
- export { AppConfig, AppConfigInput, AppInput, AppsRecord, BackendFramework, CacheBackend, ConstrainedApps, DeployConfig, DeployTarget, DokployWorkspaceConfig, EmailBackend, Framework, FrontendFramework, GkmConfig, InferAppNames, InferredWorkspaceConfig, LoadedConfig, MailServiceConfig, MobileFramework, ModelsConfig, NormalizedAppConfig, NormalizedWorkspace, OpenApiConfig, PHASE_2_DEPLOY_TARGETS, Routes, SUPPORTED_DEPLOY_TARGETS, SecretsConfig, ServiceImageConfig, ServicesConfig, SharedConfig, WorkspaceConfig, WorkspaceConfigSchema, WorkspaceInput, formatValidationErrors, getDeployTargetError, isDeployTargetSupported, isPhase2DeployTarget, isWorkspaceConfig, safeValidateWorkspaceConfig, validateWorkspaceConfig };
2184
- //# sourceMappingURL=types-C-arnQ1r.d.mts.map