@korajs/cli 0.0.0-canary-20261008174129

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 (310) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/dist/bin.cjs +9465 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.js +3150 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/chunk-5NI2FEQL.js +92 -0
  8. package/dist/chunk-5NI2FEQL.js.map +1 -0
  9. package/dist/chunk-6C4BHSRA.js +82 -0
  10. package/dist/chunk-6C4BHSRA.js.map +1 -0
  11. package/dist/chunk-7Y4J2GXP.js +796 -0
  12. package/dist/chunk-7Y4J2GXP.js.map +1 -0
  13. package/dist/chunk-BURFQVMV.js +719 -0
  14. package/dist/chunk-BURFQVMV.js.map +1 -0
  15. package/dist/chunk-TVIRMDER.js +2569 -0
  16. package/dist/chunk-TVIRMDER.js.map +1 -0
  17. package/dist/create.cjs +1368 -0
  18. package/dist/create.cjs.map +1 -0
  19. package/dist/create.js +11 -0
  20. package/dist/create.js.map +1 -0
  21. package/dist/index.cjs +3489 -0
  22. package/dist/index.cjs.map +1 -0
  23. package/dist/index.d.cts +772 -0
  24. package/dist/index.d.ts +772 -0
  25. package/dist/index.js +129 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/lab-manager-KUDII6BT.js +280 -0
  28. package/dist/lab-manager-KUDII6BT.js.map +1 -0
  29. package/dist/schema-loader-GGHECMTM.js +9 -0
  30. package/dist/schema-loader-GGHECMTM.js.map +1 -0
  31. package/dist/spectator-manager-FTH2NFSE.js +145 -0
  32. package/dist/spectator-manager-FTH2NFSE.js.map +1 -0
  33. package/dist/studio-server-XLGZNGG5.js +1747 -0
  34. package/dist/studio-server-XLGZNGG5.js.map +1 -0
  35. package/dist/vite.cjs +351 -0
  36. package/dist/vite.cjs.map +1 -0
  37. package/dist/vite.d.cts +161 -0
  38. package/dist/vite.d.ts +161 -0
  39. package/dist/vite.js +321 -0
  40. package/dist/vite.js.map +1 -0
  41. package/package.json +79 -0
  42. package/templates/react-basic/.env.example +3 -0
  43. package/templates/react-basic/AGENTS.md +87 -0
  44. package/templates/react-basic/README.md.hbs +62 -0
  45. package/templates/react-basic/index.html.hbs +12 -0
  46. package/templates/react-basic/kora.config.ts +13 -0
  47. package/templates/react-basic/package.json.hbs +35 -0
  48. package/templates/react-basic/src/App.tsx +132 -0
  49. package/templates/react-basic/src/index.css +287 -0
  50. package/templates/react-basic/src/kora-worker.ts +9 -0
  51. package/templates/react-basic/src/main.tsx +24 -0
  52. package/templates/react-basic/src/modules/todos/todo.mutations.ts +25 -0
  53. package/templates/react-basic/src/modules/todos/todo.queries.ts +5 -0
  54. package/templates/react-basic/src/modules/todos/todo.schema.ts +10 -0
  55. package/templates/react-basic/src/modules/todos/useTodos.ts +31 -0
  56. package/templates/react-basic/src/schema.ts +9 -0
  57. package/templates/react-basic/src/vite-env.d.ts +18 -0
  58. package/templates/react-basic/tsconfig.json.hbs +14 -0
  59. package/templates/react-basic/vite.config.ts +88 -0
  60. package/templates/react-sync/.env.example +25 -0
  61. package/templates/react-sync/AGENTS.md +87 -0
  62. package/templates/react-sync/README.md.hbs +106 -0
  63. package/templates/react-sync/index.html.hbs +12 -0
  64. package/templates/react-sync/kora.config.ts +17 -0
  65. package/templates/react-sync/package.json.hbs +44 -0
  66. package/templates/react-sync/server.ts +141 -0
  67. package/templates/react-sync/src/App.tsx +160 -0
  68. package/templates/react-sync/src/auth.ts +25 -0
  69. package/templates/react-sync/src/index.css +350 -0
  70. package/templates/react-sync/src/kora-worker.ts +9 -0
  71. package/templates/react-sync/src/main.tsx +52 -0
  72. package/templates/react-sync/src/modules/todos/todo.mutations.ts +25 -0
  73. package/templates/react-sync/src/modules/todos/todo.queries.ts +5 -0
  74. package/templates/react-sync/src/modules/todos/todo.schema.ts +10 -0
  75. package/templates/react-sync/src/modules/todos/useTodos.ts +31 -0
  76. package/templates/react-sync/src/schema.ts +9 -0
  77. package/templates/react-sync/src/vite-env.d.ts +19 -0
  78. package/templates/react-sync/tsconfig.json.hbs +14 -0
  79. package/templates/react-sync/vite.config.ts +105 -0
  80. package/templates/react-tailwind/.env.example +3 -0
  81. package/templates/react-tailwind/AGENTS.md +87 -0
  82. package/templates/react-tailwind/README.md.hbs +62 -0
  83. package/templates/react-tailwind/index.html.hbs +12 -0
  84. package/templates/react-tailwind/kora.config.ts +13 -0
  85. package/templates/react-tailwind/package.json.hbs +38 -0
  86. package/templates/react-tailwind/src/App.tsx +201 -0
  87. package/templates/react-tailwind/src/index.css +7 -0
  88. package/templates/react-tailwind/src/kora-worker.ts +9 -0
  89. package/templates/react-tailwind/src/main.tsx +31 -0
  90. package/templates/react-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  91. package/templates/react-tailwind/src/modules/todos/todo.queries.ts +5 -0
  92. package/templates/react-tailwind/src/modules/todos/todo.schema.ts +10 -0
  93. package/templates/react-tailwind/src/modules/todos/useTodos.ts +31 -0
  94. package/templates/react-tailwind/src/schema.ts +9 -0
  95. package/templates/react-tailwind/src/vite-env.d.ts +18 -0
  96. package/templates/react-tailwind/tsconfig.json.hbs +14 -0
  97. package/templates/react-tailwind/vite.config.ts +95 -0
  98. package/templates/react-tailwind-sync/.env.example +25 -0
  99. package/templates/react-tailwind-sync/AGENTS.md +89 -0
  100. package/templates/react-tailwind-sync/README.md.hbs +106 -0
  101. package/templates/react-tailwind-sync/index.html.hbs +12 -0
  102. package/templates/react-tailwind-sync/kora.config.ts +17 -0
  103. package/templates/react-tailwind-sync/package.json.hbs +47 -0
  104. package/templates/react-tailwind-sync/server.ts +141 -0
  105. package/templates/react-tailwind-sync/src/App.tsx +293 -0
  106. package/templates/react-tailwind-sync/src/auth.ts +25 -0
  107. package/templates/react-tailwind-sync/src/index.css +7 -0
  108. package/templates/react-tailwind-sync/src/kora-worker.ts +9 -0
  109. package/templates/react-tailwind-sync/src/kora.ts +32 -0
  110. package/templates/react-tailwind-sync/src/main.tsx +44 -0
  111. package/templates/react-tailwind-sync/src/modules/todos/todo.mutations.ts +21 -0
  112. package/templates/react-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  113. package/templates/react-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  114. package/templates/react-tailwind-sync/src/modules/todos/useTodos.ts +31 -0
  115. package/templates/react-tailwind-sync/src/schema.ts +9 -0
  116. package/templates/react-tailwind-sync/src/vite-env.d.ts +19 -0
  117. package/templates/react-tailwind-sync/tsconfig.json.hbs +14 -0
  118. package/templates/react-tailwind-sync/vite.config.ts +112 -0
  119. package/templates/svelte-basic/.env.example +3 -0
  120. package/templates/svelte-basic/AGENTS.md +76 -0
  121. package/templates/svelte-basic/README.md.hbs +62 -0
  122. package/templates/svelte-basic/index.html.hbs +12 -0
  123. package/templates/svelte-basic/kora.config.ts +12 -0
  124. package/templates/svelte-basic/package.json.hbs +33 -0
  125. package/templates/svelte-basic/src/App.svelte +128 -0
  126. package/templates/svelte-basic/src/Root.svelte +14 -0
  127. package/templates/svelte-basic/src/index.css +287 -0
  128. package/templates/svelte-basic/src/kora-worker.ts +9 -0
  129. package/templates/svelte-basic/src/main.ts +16 -0
  130. package/templates/svelte-basic/src/modules/todos/todo.mutations.ts +25 -0
  131. package/templates/svelte-basic/src/modules/todos/todo.queries.ts +5 -0
  132. package/templates/svelte-basic/src/modules/todos/todo.schema.ts +10 -0
  133. package/templates/svelte-basic/src/modules/todos/useTodos.ts +25 -0
  134. package/templates/svelte-basic/src/schema.ts +9 -0
  135. package/templates/svelte-basic/src/vite-env.d.ts +12 -0
  136. package/templates/svelte-basic/svelte.config.js +5 -0
  137. package/templates/svelte-basic/tsconfig.json.hbs +14 -0
  138. package/templates/svelte-basic/vite.config.ts +57 -0
  139. package/templates/svelte-sync/.env.example +25 -0
  140. package/templates/svelte-sync/AGENTS.md +76 -0
  141. package/templates/svelte-sync/README.md.hbs +106 -0
  142. package/templates/svelte-sync/index.html.hbs +12 -0
  143. package/templates/svelte-sync/kora.config.ts +17 -0
  144. package/templates/svelte-sync/package.json.hbs +43 -0
  145. package/templates/svelte-sync/server.ts +141 -0
  146. package/templates/svelte-sync/src/App.svelte +151 -0
  147. package/templates/svelte-sync/src/Root.svelte +22 -0
  148. package/templates/svelte-sync/src/auth.ts +25 -0
  149. package/templates/svelte-sync/src/index.css +339 -0
  150. package/templates/svelte-sync/src/kora-worker.ts +9 -0
  151. package/templates/svelte-sync/src/main.ts +32 -0
  152. package/templates/svelte-sync/src/modules/todos/todo.mutations.ts +25 -0
  153. package/templates/svelte-sync/src/modules/todos/todo.queries.ts +5 -0
  154. package/templates/svelte-sync/src/modules/todos/todo.schema.ts +10 -0
  155. package/templates/svelte-sync/src/modules/todos/useTodos.ts +25 -0
  156. package/templates/svelte-sync/src/schema.ts +9 -0
  157. package/templates/svelte-sync/src/vite-env.d.ts +22 -0
  158. package/templates/svelte-sync/svelte.config.js +5 -0
  159. package/templates/svelte-sync/tsconfig.json.hbs +14 -0
  160. package/templates/svelte-sync/vite.config.ts +91 -0
  161. package/templates/svelte-tailwind/AGENTS.md +76 -0
  162. package/templates/svelte-tailwind/README.md.hbs +62 -0
  163. package/templates/svelte-tailwind/index.html.hbs +12 -0
  164. package/templates/svelte-tailwind/kora.config.ts +12 -0
  165. package/templates/svelte-tailwind/package.json.hbs +36 -0
  166. package/templates/svelte-tailwind/src/App.svelte +76 -0
  167. package/templates/svelte-tailwind/src/Root.svelte +14 -0
  168. package/templates/svelte-tailwind/src/index.css +7 -0
  169. package/templates/svelte-tailwind/src/kora-worker.ts +9 -0
  170. package/templates/svelte-tailwind/src/main.ts +16 -0
  171. package/templates/svelte-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  172. package/templates/svelte-tailwind/src/modules/todos/todo.queries.ts +5 -0
  173. package/templates/svelte-tailwind/src/modules/todos/todo.schema.ts +10 -0
  174. package/templates/svelte-tailwind/src/modules/todos/useTodos.ts +25 -0
  175. package/templates/svelte-tailwind/src/schema.ts +9 -0
  176. package/templates/svelte-tailwind/src/vite-env.d.ts +12 -0
  177. package/templates/svelte-tailwind/svelte.config.js +5 -0
  178. package/templates/svelte-tailwind/tsconfig.json.hbs +14 -0
  179. package/templates/svelte-tailwind/vite.config.ts +64 -0
  180. package/templates/svelte-tailwind-sync/.env.example +25 -0
  181. package/templates/svelte-tailwind-sync/AGENTS.md +76 -0
  182. package/templates/svelte-tailwind-sync/README.md.hbs +106 -0
  183. package/templates/svelte-tailwind-sync/index.html.hbs +12 -0
  184. package/templates/svelte-tailwind-sync/kora.config.ts +17 -0
  185. package/templates/svelte-tailwind-sync/package.json.hbs +46 -0
  186. package/templates/svelte-tailwind-sync/server.ts +141 -0
  187. package/templates/svelte-tailwind-sync/src/App.svelte +193 -0
  188. package/templates/svelte-tailwind-sync/src/Root.svelte +26 -0
  189. package/templates/svelte-tailwind-sync/src/auth.ts +25 -0
  190. package/templates/svelte-tailwind-sync/src/index.css +7 -0
  191. package/templates/svelte-tailwind-sync/src/kora-worker.ts +9 -0
  192. package/templates/svelte-tailwind-sync/src/main.ts +32 -0
  193. package/templates/svelte-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  194. package/templates/svelte-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  195. package/templates/svelte-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  196. package/templates/svelte-tailwind-sync/src/modules/todos/useTodos.ts +25 -0
  197. package/templates/svelte-tailwind-sync/src/schema.ts +9 -0
  198. package/templates/svelte-tailwind-sync/src/vite-env.d.ts +22 -0
  199. package/templates/svelte-tailwind-sync/svelte.config.js +5 -0
  200. package/templates/svelte-tailwind-sync/tsconfig.json.hbs +14 -0
  201. package/templates/svelte-tailwind-sync/vite.config.ts +98 -0
  202. package/templates/tauri-react/.env.example +27 -0
  203. package/templates/tauri-react/.github/workflows/release-desktop.yml +107 -0
  204. package/templates/tauri-react/AGENTS.md +91 -0
  205. package/templates/tauri-react/README.md.hbs +183 -0
  206. package/templates/tauri-react/dev.ts +37 -0
  207. package/templates/tauri-react/index.html.hbs +16 -0
  208. package/templates/tauri-react/kora.config.ts +17 -0
  209. package/templates/tauri-react/package.json.hbs +46 -0
  210. package/templates/tauri-react/server.ts +148 -0
  211. package/templates/tauri-react/src/App.tsx +803 -0
  212. package/templates/tauri-react/src/AppShell.tsx +158 -0
  213. package/templates/tauri-react/src/SetupScreen.tsx +288 -0
  214. package/templates/tauri-react/src/auth.ts +45 -0
  215. package/templates/tauri-react/src/main.tsx +9 -0
  216. package/templates/tauri-react/src/modules/todos/todo.mutations.ts +25 -0
  217. package/templates/tauri-react/src/modules/todos/todo.queries.ts +5 -0
  218. package/templates/tauri-react/src/modules/todos/todo.schema.ts +10 -0
  219. package/templates/tauri-react/src/modules/todos/useTodos.ts +31 -0
  220. package/templates/tauri-react/src/schema.ts +9 -0
  221. package/templates/tauri-react/src/sync-config.ts +103 -0
  222. package/templates/tauri-react/src/updater.ts +38 -0
  223. package/templates/tauri-react/src/vite-env.d.ts +19 -0
  224. package/templates/tauri-react/src-tauri/Cargo.toml +19 -0
  225. package/templates/tauri-react/src-tauri/build.rs +3 -0
  226. package/templates/tauri-react/src-tauri/capabilities/default.json +12 -0
  227. package/templates/tauri-react/src-tauri/icons/128x128.png +0 -0
  228. package/templates/tauri-react/src-tauri/icons/128x128@2x.png +0 -0
  229. package/templates/tauri-react/src-tauri/icons/32x32.png +0 -0
  230. package/templates/tauri-react/src-tauri/icons/icon.icns +0 -0
  231. package/templates/tauri-react/src-tauri/icons/icon.ico +0 -0
  232. package/templates/tauri-react/src-tauri/src/lib.rs +8 -0
  233. package/templates/tauri-react/src-tauri/src/main.rs +6 -0
  234. package/templates/tauri-react/src-tauri/tauri.conf.json +44 -0
  235. package/templates/tauri-react/tsconfig.json.hbs +14 -0
  236. package/templates/tauri-react/vite.config.ts +15 -0
  237. package/templates/vue-basic/AGENTS.md +84 -0
  238. package/templates/vue-basic/README.md.hbs +62 -0
  239. package/templates/vue-basic/index.html.hbs +12 -0
  240. package/templates/vue-basic/kora.config.ts +12 -0
  241. package/templates/vue-basic/package.json.hbs +32 -0
  242. package/templates/vue-basic/src/App.vue +117 -0
  243. package/templates/vue-basic/src/index.css +287 -0
  244. package/templates/vue-basic/src/kora-worker.ts +9 -0
  245. package/templates/vue-basic/src/main.ts +20 -0
  246. package/templates/vue-basic/src/modules/todos/todo.mutations.ts +25 -0
  247. package/templates/vue-basic/src/modules/todos/todo.queries.ts +5 -0
  248. package/templates/vue-basic/src/modules/todos/todo.schema.ts +10 -0
  249. package/templates/vue-basic/src/modules/todos/useTodos.ts +32 -0
  250. package/templates/vue-basic/src/schema.ts +9 -0
  251. package/templates/vue-basic/src/vite-env.d.ts +17 -0
  252. package/templates/vue-basic/tsconfig.json.hbs +15 -0
  253. package/templates/vue-basic/vite.config.ts +74 -0
  254. package/templates/vue-sync/.env.example +25 -0
  255. package/templates/vue-sync/AGENTS.md +84 -0
  256. package/templates/vue-sync/README.md.hbs +106 -0
  257. package/templates/vue-sync/index.html.hbs +12 -0
  258. package/templates/vue-sync/kora.config.ts +17 -0
  259. package/templates/vue-sync/package.json.hbs +42 -0
  260. package/templates/vue-sync/server.ts +141 -0
  261. package/templates/vue-sync/src/App.vue +135 -0
  262. package/templates/vue-sync/src/auth.ts +25 -0
  263. package/templates/vue-sync/src/index.css +339 -0
  264. package/templates/vue-sync/src/kora-worker.ts +9 -0
  265. package/templates/vue-sync/src/main.ts +47 -0
  266. package/templates/vue-sync/src/modules/todos/todo.mutations.ts +25 -0
  267. package/templates/vue-sync/src/modules/todos/todo.queries.ts +5 -0
  268. package/templates/vue-sync/src/modules/todos/todo.schema.ts +10 -0
  269. package/templates/vue-sync/src/modules/todos/useTodos.ts +32 -0
  270. package/templates/vue-sync/src/schema.ts +9 -0
  271. package/templates/vue-sync/src/vite-env.d.ts +27 -0
  272. package/templates/vue-sync/tsconfig.json.hbs +15 -0
  273. package/templates/vue-sync/vite.config.ts +91 -0
  274. package/templates/vue-tailwind/AGENTS.md +84 -0
  275. package/templates/vue-tailwind/README.md.hbs +62 -0
  276. package/templates/vue-tailwind/index.html.hbs +12 -0
  277. package/templates/vue-tailwind/kora.config.ts +12 -0
  278. package/templates/vue-tailwind/package.json.hbs +35 -0
  279. package/templates/vue-tailwind/src/App.vue +135 -0
  280. package/templates/vue-tailwind/src/index.css +7 -0
  281. package/templates/vue-tailwind/src/kora-worker.ts +9 -0
  282. package/templates/vue-tailwind/src/main.ts +31 -0
  283. package/templates/vue-tailwind/src/modules/todos/todo.mutations.ts +25 -0
  284. package/templates/vue-tailwind/src/modules/todos/todo.queries.ts +5 -0
  285. package/templates/vue-tailwind/src/modules/todos/todo.schema.ts +10 -0
  286. package/templates/vue-tailwind/src/modules/todos/useTodos.ts +32 -0
  287. package/templates/vue-tailwind/src/schema.ts +9 -0
  288. package/templates/vue-tailwind/src/vite-env.d.ts +17 -0
  289. package/templates/vue-tailwind/tsconfig.json.hbs +15 -0
  290. package/templates/vue-tailwind/vite.config.ts +75 -0
  291. package/templates/vue-tailwind-sync/.env.example +25 -0
  292. package/templates/vue-tailwind-sync/AGENTS.md +84 -0
  293. package/templates/vue-tailwind-sync/README.md.hbs +106 -0
  294. package/templates/vue-tailwind-sync/index.html.hbs +12 -0
  295. package/templates/vue-tailwind-sync/kora.config.ts +17 -0
  296. package/templates/vue-tailwind-sync/package.json.hbs +45 -0
  297. package/templates/vue-tailwind-sync/server.ts +141 -0
  298. package/templates/vue-tailwind-sync/src/App.vue +245 -0
  299. package/templates/vue-tailwind-sync/src/auth.ts +25 -0
  300. package/templates/vue-tailwind-sync/src/index.css +7 -0
  301. package/templates/vue-tailwind-sync/src/kora-worker.ts +9 -0
  302. package/templates/vue-tailwind-sync/src/main.ts +56 -0
  303. package/templates/vue-tailwind-sync/src/modules/todos/todo.mutations.ts +25 -0
  304. package/templates/vue-tailwind-sync/src/modules/todos/todo.queries.ts +5 -0
  305. package/templates/vue-tailwind-sync/src/modules/todos/todo.schema.ts +10 -0
  306. package/templates/vue-tailwind-sync/src/modules/todos/useTodos.ts +32 -0
  307. package/templates/vue-tailwind-sync/src/schema.ts +9 -0
  308. package/templates/vue-tailwind-sync/src/vite-env.d.ts +27 -0
  309. package/templates/vue-tailwind-sync/tsconfig.json.hbs +15 -0
  310. package/templates/vue-tailwind-sync/vite.config.ts +92 -0
@@ -0,0 +1,772 @@
1
+ import { KoraError, SchemaDefinition } from '@korajs/core';
2
+ import * as citty from 'citty';
3
+
4
+ /** Supported package managers */
5
+ declare const PACKAGE_MANAGERS: readonly ["pnpm", "npm", "yarn", "bun"];
6
+ type PackageManager = (typeof PACKAGE_MANAGERS)[number];
7
+ /** Available project templates */
8
+ declare const TEMPLATES: readonly ["react-tailwind-sync", "react-tailwind", "react-sync", "react-basic", "vue-sync", "vue-basic", "vue-tailwind-sync", "vue-tailwind", "svelte-sync", "svelte-basic", "svelte-tailwind-sync", "svelte-tailwind", "tauri-react"];
9
+ type TemplateName = (typeof TEMPLATES)[number];
10
+ /** Metadata for a project template */
11
+ interface TemplateInfo {
12
+ name: TemplateName;
13
+ label: string;
14
+ description: string;
15
+ }
16
+ /** Available templates with their descriptions */
17
+ declare const TEMPLATE_INFO: readonly TemplateInfo[];
18
+ /** Variables available for template substitution */
19
+ interface TemplateContext {
20
+ projectName: string;
21
+ packageManager: PackageManager;
22
+ koraVersion: string;
23
+ /** `@korajs/tauri` version for the desktop template (its own version line). */
24
+ tauriVersion?: string;
25
+ dbProvider?: string;
26
+ }
27
+
28
+ /**
29
+ * Base error class for all CLI errors.
30
+ */
31
+ declare class CliError extends KoraError {
32
+ constructor(message: string, context?: Record<string, unknown>);
33
+ }
34
+ /**
35
+ * Thrown when `kora deploy` targets a platform whose adapter is not implemented yet
36
+ * (DX-8). Raised before any artifact or deploy state is written.
37
+ */
38
+ declare class DeployPlatformUnavailableError extends KoraError {
39
+ readonly platform: string;
40
+ readonly available: readonly string[];
41
+ constructor(platform: string, available: readonly string[]);
42
+ }
43
+ /**
44
+ * Thrown when the target project directory already exists.
45
+ */
46
+ declare class ProjectExistsError extends KoraError {
47
+ readonly directory: string;
48
+ constructor(directory: string);
49
+ }
50
+ /**
51
+ * Thrown when a schema file cannot be found in the project.
52
+ */
53
+ declare class SchemaNotFoundError extends KoraError {
54
+ readonly searchedPaths: string[];
55
+ constructor(searchedPaths: string[]);
56
+ }
57
+ /**
58
+ * Thrown when a command is run outside a valid Kora project.
59
+ */
60
+ declare class InvalidProjectError extends KoraError {
61
+ readonly directory: string;
62
+ constructor(directory: string);
63
+ }
64
+ /**
65
+ * Thrown when a required local dev server binary cannot be found.
66
+ */
67
+ declare class DevServerError extends KoraError {
68
+ readonly binary: string;
69
+ readonly searchPath: string;
70
+ constructor(binary: string, searchPath: string);
71
+ }
72
+
73
+ /**
74
+ * Writes an AGENTS.md into an existing project so AI coding agents follow Kora
75
+ * conventions. Refuses to overwrite an existing file unless `--force` is passed.
76
+ */
77
+ declare const agentsCommand: citty.CommandDef<{
78
+ force: {
79
+ type: "boolean";
80
+ description: string;
81
+ default: false;
82
+ };
83
+ framework: {
84
+ type: "string";
85
+ description: string;
86
+ };
87
+ }>;
88
+
89
+ /**
90
+ * Canonical AGENTS.md generator.
91
+ *
92
+ * `kora agents-md` writes this file into an existing project so AI coding agents
93
+ * (and humans) build Kora apps correctly instead of drifting to fetch calls,
94
+ * hand-written types, and loading spinners. New projects scaffolded with
95
+ * `create-kora-app` already ship an AGENTS.md; this command covers the manual
96
+ * setup path and lets existing projects regenerate the guidance on demand.
97
+ */
98
+ /** UI framework whose bindings section the generated AGENTS.md documents. */
99
+ type AgentsFramework = 'react' | 'vue' | 'svelte';
100
+ /** All supported frameworks, for validation and help text. */
101
+ declare const AGENTS_FRAMEWORKS: readonly AgentsFramework[];
102
+ /**
103
+ * Narrows an arbitrary string to a supported {@link AgentsFramework}.
104
+ *
105
+ * @param value - Candidate framework identifier
106
+ * @returns `true` when `value` is one of the supported frameworks
107
+ */
108
+ declare function isAgentsFramework(value: string): value is AgentsFramework;
109
+ /**
110
+ * Detects the UI framework from a project's package manifest by looking for the
111
+ * matching `@korajs/*` binding package in dependencies or devDependencies.
112
+ *
113
+ * @param manifest - Parsed `package.json` contents
114
+ * @returns The detected framework, or `null` when no binding package is present
115
+ */
116
+ declare function detectFrameworkFromManifest(manifest: unknown): AgentsFramework | null;
117
+ /**
118
+ * Renders the full AGENTS.md document for the given framework.
119
+ *
120
+ * The body (golden rules, data API cheat sheet, conflict handling, sync notes,
121
+ * commands) is framework-agnostic; only the bindings section changes. File paths
122
+ * are described as conventions so the guidance is correct for both scaffolded and
123
+ * manually configured projects.
124
+ *
125
+ * @param framework - UI framework whose bindings to document
126
+ * @returns The complete AGENTS.md file contents, terminated with a trailing newline
127
+ */
128
+ declare function generateAgentsMd(framework: AgentsFramework): string;
129
+
130
+ /**
131
+ * Generates TypeScript interfaces from a SchemaDefinition.
132
+ * For each collection, produces three interfaces:
133
+ * - {Name}Record: full record type (all fields + id)
134
+ * - {Name}InsertInput: insert input (omit auto fields, optional for fields with defaults)
135
+ * - {Name}UpdateInput: update input (all non-auto fields optional)
136
+ *
137
+ * @param schema - A validated SchemaDefinition from defineSchema()
138
+ * @returns A complete TypeScript file as a string
139
+ */
140
+ declare function generateTypes(schema: SchemaDefinition): string;
141
+
142
+ /**
143
+ * The `deploy` command for Phase 13.
144
+ *
145
+ * This command orchestrates:
146
+ * - deploy state resolution and persistence
147
+ * - artifact generation
148
+ * - adapter-driven provision/build/deploy flows
149
+ */
150
+ declare const deployCommand: citty.CommandDef<{
151
+ platform: {
152
+ type: "string";
153
+ description: string;
154
+ };
155
+ app: {
156
+ type: "string";
157
+ description: string;
158
+ };
159
+ region: {
160
+ type: "string";
161
+ description: string;
162
+ };
163
+ prod: {
164
+ type: "boolean";
165
+ description: string;
166
+ default: false;
167
+ };
168
+ confirm: {
169
+ type: "boolean";
170
+ description: string;
171
+ default: false;
172
+ };
173
+ reset: {
174
+ type: "boolean";
175
+ description: string;
176
+ default: false;
177
+ };
178
+ }>;
179
+
180
+ declare const DEPLOY_PLATFORMS: readonly ["fly", "railway", "aws-ecs", "aws-lightsail", "render", "docker", "kora-cloud"];
181
+ type DeployPlatform = (typeof DEPLOY_PLATFORMS)[number];
182
+ /**
183
+ * Platforms `kora deploy` can actually deploy to today (DX-8). The others are listed as
184
+ * "coming soon" and refused before anything is written.
185
+ */
186
+ declare const IMPLEMENTED_DEPLOY_PLATFORMS: readonly ["fly", "railway", "aws-ecs", "aws-lightsail"];
187
+ /**
188
+ * Whether `kora deploy` has a working adapter for the platform.
189
+ */
190
+ declare function isImplementedDeployPlatform(platform: DeployPlatform): platform is (typeof IMPLEMENTED_DEPLOY_PLATFORMS)[number];
191
+ interface ProjectConfig {
192
+ projectRoot: string;
193
+ appName: string;
194
+ region: string | null;
195
+ environment: 'preview' | 'production';
196
+ confirm: boolean;
197
+ deployTarget?: 'full-stack' | 'sync-server';
198
+ }
199
+ interface ProvisionResult {
200
+ applicationId: string;
201
+ databaseId: string | null;
202
+ secretsSet: string[];
203
+ }
204
+ interface BuildArtifacts {
205
+ clientDirectory: string | null;
206
+ serverBundlePath: string | null;
207
+ deployDirectory: string;
208
+ }
209
+ interface DeployResult {
210
+ deploymentId: string;
211
+ liveUrl: string;
212
+ syncUrl: string | null;
213
+ }
214
+ interface LogOptions {
215
+ since?: string;
216
+ tail?: number;
217
+ }
218
+ interface LogLine {
219
+ timestamp: string;
220
+ level: 'debug' | 'info' | 'warn' | 'error';
221
+ message: string;
222
+ }
223
+ interface DeploymentStatus {
224
+ state: 'pending' | 'healthy' | 'failed' | 'unknown';
225
+ message: string;
226
+ liveUrl?: string;
227
+ }
228
+ /**
229
+ * Contract implemented by each deployment platform integration.
230
+ */
231
+ interface DeployAdapter {
232
+ name: DeployPlatform;
233
+ detect(): Promise<boolean>;
234
+ install(): Promise<void>;
235
+ authenticate(): Promise<void>;
236
+ provision(config: ProjectConfig): Promise<ProvisionResult>;
237
+ build(config: ProjectConfig): Promise<BuildArtifacts>;
238
+ deploy(artifacts: BuildArtifacts): Promise<DeployResult>;
239
+ rollback(deploymentId: string): Promise<void>;
240
+ logs(options: LogOptions): AsyncIterable<LogLine>;
241
+ status(): Promise<DeploymentStatus>;
242
+ }
243
+ /**
244
+ * Optional adapter extension for commands that require runtime context
245
+ * (project root, app name, region) outside an initial provisioning run.
246
+ */
247
+ interface ContextAwareDeployAdapter extends DeployAdapter {
248
+ setContext(context: {
249
+ projectRoot: string;
250
+ appName: string;
251
+ region: string | null;
252
+ }): void;
253
+ }
254
+ /**
255
+ * Checks whether the provided value is a known deploy platform.
256
+ */
257
+ declare function isDeployPlatform(value: string): value is DeployPlatform;
258
+
259
+ /**
260
+ * Execution abstraction for Fly CLI shell interactions.
261
+ * This keeps FlyAdapter deterministic and fully mockable in tests.
262
+ */
263
+ interface FlyCommandRunner {
264
+ run(command: string, args: string[], cwd: string): Promise<FlyCommandResult>;
265
+ }
266
+ interface FlyCommandResult {
267
+ exitCode: number;
268
+ stdout: string;
269
+ stderr: string;
270
+ }
271
+ interface FlyAdapterOptions {
272
+ runner?: FlyCommandRunner;
273
+ context?: FlyAdapterContext;
274
+ commandCandidates?: readonly string[];
275
+ }
276
+ /**
277
+ * Fly.io deploy adapter implementation for Phase 13.
278
+ */
279
+ declare class FlyAdapter implements ContextAwareDeployAdapter {
280
+ readonly name: "fly";
281
+ private readonly logger;
282
+ private readonly runner;
283
+ private readonly commandCandidates;
284
+ private flyCommand;
285
+ private currentContext;
286
+ private lastDeploymentId;
287
+ constructor(options?: FlyAdapterOptions);
288
+ /**
289
+ * Seeds runtime context for non-provisioning commands.
290
+ */
291
+ setContext(context: FlyAdapterContext): void;
292
+ /**
293
+ * Checks whether a Fly CLI executable can be resolved.
294
+ */
295
+ detect(): Promise<boolean>;
296
+ /**
297
+ * Ensures Fly CLI is available before deployment.
298
+ */
299
+ install(): Promise<void>;
300
+ /**
301
+ * Performs Fly authentication check/login.
302
+ */
303
+ authenticate(): Promise<void>;
304
+ /**
305
+ * Provisions app and optionally region-bound resources in Fly.
306
+ */
307
+ provision(config: ProjectConfig): Promise<ProvisionResult>;
308
+ /**
309
+ * Builds local artifacts consumed by Fly deploy.
310
+ */
311
+ build(config: ProjectConfig): Promise<BuildArtifacts>;
312
+ /**
313
+ * Deploys generated artifacts to Fly and returns live endpoints.
314
+ */
315
+ deploy(artifacts: BuildArtifacts): Promise<DeployResult>;
316
+ /**
317
+ * Rolls back to a deployment version.
318
+ */
319
+ rollback(deploymentId: string): Promise<void>;
320
+ /**
321
+ * Returns deployment logs as an async iterable.
322
+ */
323
+ logs(options: LogOptions): AsyncIterable<LogLine>;
324
+ /**
325
+ * Reads current deployment status from Fly.
326
+ */
327
+ status(): Promise<DeploymentStatus>;
328
+ private runFlyCommand;
329
+ private requireContext;
330
+ private resolveFlyCommand;
331
+ private tryResolveFlyCommand;
332
+ }
333
+ /**
334
+ * Default subprocess-backed runner for Fly commands.
335
+ */
336
+ declare class NodeFlyCommandRunner implements FlyCommandRunner {
337
+ run(command: string, args: string[], cwd: string): Promise<FlyCommandResult>;
338
+ }
339
+ interface FlyAdapterContext {
340
+ projectRoot: string;
341
+ appName: string;
342
+ region: string | null;
343
+ }
344
+
345
+ /**
346
+ * Creates a deploy adapter instance for the selected platform.
347
+ */
348
+ declare function createDeployAdapter(platform: DeployPlatform): DeployAdapter;
349
+
350
+ /**
351
+ * Execution abstraction for Railway CLI shell interactions.
352
+ */
353
+ interface RailwayCommandRunner {
354
+ run(command: string, args: string[], cwd: string): Promise<RailwayCommandResult>;
355
+ }
356
+ interface RailwayCommandResult {
357
+ exitCode: number;
358
+ stdout: string;
359
+ stderr: string;
360
+ }
361
+ interface RailwayAdapterOptions {
362
+ runner?: RailwayCommandRunner;
363
+ context?: RailwayAdapterContext;
364
+ commandCandidates?: readonly string[];
365
+ }
366
+ /**
367
+ * Railway deploy adapter implementation for Phase 13.
368
+ */
369
+ declare class RailwayAdapter implements ContextAwareDeployAdapter {
370
+ readonly name: "railway";
371
+ private readonly logger;
372
+ private readonly runner;
373
+ private readonly commandCandidates;
374
+ private railwayCommand;
375
+ private currentContext;
376
+ private lastDeploymentId;
377
+ constructor(options?: RailwayAdapterOptions);
378
+ setContext(context: RailwayAdapterContext): void;
379
+ detect(): Promise<boolean>;
380
+ install(): Promise<void>;
381
+ authenticate(): Promise<void>;
382
+ provision(config: ProjectConfig): Promise<ProvisionResult>;
383
+ build(config: ProjectConfig): Promise<BuildArtifacts>;
384
+ deploy(artifacts: BuildArtifacts): Promise<DeployResult>;
385
+ rollback(deploymentId: string): Promise<void>;
386
+ logs(options: LogOptions): AsyncIterable<LogLine>;
387
+ status(): Promise<DeploymentStatus>;
388
+ private runRailwayCommand;
389
+ private requireContext;
390
+ private resolveRailwayCommand;
391
+ private tryResolveRailwayCommand;
392
+ }
393
+ /**
394
+ * Default subprocess-backed runner for Railway commands.
395
+ */
396
+ declare class NodeRailwayCommandRunner implements RailwayCommandRunner {
397
+ run(command: string, args: string[], cwd: string): Promise<RailwayCommandResult>;
398
+ }
399
+ interface RailwayAdapterContext {
400
+ projectRoot: string;
401
+ appName: string;
402
+ region: string | null;
403
+ }
404
+
405
+ /**
406
+ * Lightweight scaffold adapter used for platforms not yet implemented.
407
+ * It provides explicit, deterministic errors while preserving the shared
408
+ * adapter contract and command wiring across all platforms.
409
+ */
410
+ declare class StubDeployAdapter implements ContextAwareDeployAdapter {
411
+ readonly name: DeployPlatform;
412
+ private readonly contextLabel;
413
+ constructor(platform: DeployPlatform);
414
+ setContext(_context: {
415
+ projectRoot: string;
416
+ appName: string;
417
+ region: string | null;
418
+ }): void;
419
+ detect(): Promise<boolean>;
420
+ install(): Promise<void>;
421
+ authenticate(): Promise<void>;
422
+ provision(_config: ProjectConfig): Promise<ProvisionResult>;
423
+ build(_config: ProjectConfig): Promise<BuildArtifacts>;
424
+ deploy(_artifacts: BuildArtifacts): Promise<DeployResult>;
425
+ rollback(_deploymentId: string): Promise<void>;
426
+ logs(_options: LogOptions): AsyncIterable<LogLine>;
427
+ status(): Promise<DeploymentStatus>;
428
+ private notImplementedError;
429
+ private notImplementedMessage;
430
+ }
431
+
432
+ /**
433
+ * Durable deployment settings stored for subsequent `kora deploy` runs.
434
+ */
435
+ interface DeployState {
436
+ platform: DeployPlatform;
437
+ appName: string;
438
+ region: string | null;
439
+ projectRoot: string;
440
+ liveUrl: string | null;
441
+ syncUrl: string | null;
442
+ databaseId: string | null;
443
+ lastDeploymentId: string | null;
444
+ createdAt: string;
445
+ updatedAt: string;
446
+ }
447
+ /**
448
+ * Input required to create a new deployment state record.
449
+ */
450
+ interface DeployStateCreateInput {
451
+ platform: DeployPlatform;
452
+ appName: string;
453
+ region: string | null;
454
+ projectRoot: string;
455
+ liveUrl?: string | null;
456
+ syncUrl?: string | null;
457
+ databaseId?: string | null;
458
+ lastDeploymentId?: string | null;
459
+ }
460
+ /**
461
+ * Partial update fields for an existing deployment state record.
462
+ */
463
+ interface DeployStatePatch {
464
+ platform?: DeployPlatform;
465
+ appName?: string;
466
+ region?: string | null;
467
+ projectRoot?: string;
468
+ liveUrl?: string | null;
469
+ syncUrl?: string | null;
470
+ databaseId?: string | null;
471
+ lastDeploymentId?: string | null;
472
+ }
473
+ /**
474
+ * Returns the absolute path to `.kora/deploy`.
475
+ */
476
+ declare function resolveDeployDirectory(projectRoot: string): string;
477
+ /**
478
+ * Returns the absolute path to `.kora/deploy/deploy.json`.
479
+ */
480
+ declare function resolveDeployStatePath(projectRoot: string): string;
481
+ /**
482
+ * Loads deployment state from `.kora/deploy/deploy.json`.
483
+ * Returns null when the file does not exist.
484
+ */
485
+ declare function readDeployState(projectRoot: string): Promise<DeployState | null>;
486
+ /**
487
+ * Writes a brand-new deployment state record, replacing any existing file.
488
+ */
489
+ declare function writeDeployState(projectRoot: string, input: DeployStateCreateInput, now?: Date): Promise<DeployState>;
490
+ /**
491
+ * Applies a partial update to deployment state.
492
+ * Throws when state does not exist.
493
+ */
494
+ declare function updateDeployState(projectRoot: string, patch: DeployStatePatch, now?: Date): Promise<DeployState>;
495
+ /**
496
+ * Removes the entire `.kora/deploy` directory tree.
497
+ */
498
+ declare function resetDeployState(projectRoot: string): Promise<void>;
499
+
500
+ /**
501
+ * Configuration for generating a production Dockerfile.
502
+ */
503
+ interface DockerfileOptions {
504
+ nodeVersion?: string;
505
+ port?: number;
506
+ clientDirectory?: string | null;
507
+ serverBundleFile?: string;
508
+ /** Native modules that must be installed at runtime (externalized from bundle). */
509
+ nativeDependencies?: Record<string, string>;
510
+ }
511
+ /**
512
+ * Generates a multi-stage Dockerfile for Kora deployments.
513
+ *
514
+ * The generated image expects artifacts produced under `.kora/deploy`:
515
+ * - `dist/` for client assets
516
+ * - `server-bundled.js` for server runtime entry
517
+ * - `package.json` (if native dependencies are needed)
518
+ */
519
+ declare function generateDockerfile(options?: DockerfileOptions): string;
520
+ /**
521
+ * Generates a minimal package.json for native dependencies in the deploy container.
522
+ */
523
+ declare function generateDeployPackageJson(nativeDependencies: Record<string, string>): string;
524
+ /**
525
+ * Generates a `.dockerignore` tuned for Kora deploy output.
526
+ */
527
+ declare function generateDockerIgnore(): string;
528
+ /**
529
+ * Writes the generated Dockerfile (and package.json if needed) to `.kora/deploy/`.
530
+ */
531
+ declare function writeDockerfileArtifact(deployDirectory: string, options?: DockerfileOptions): Promise<string>;
532
+ /**
533
+ * Writes the generated `.dockerignore` to `.kora/deploy/.dockerignore`.
534
+ */
535
+ declare function writeDockerIgnoreArtifact(deployDirectory: string): Promise<string>;
536
+
537
+ /**
538
+ * Configuration options used to render `fly.toml`.
539
+ */
540
+ interface FlyTomlOptions {
541
+ appName: string;
542
+ region: string;
543
+ internalPort?: number;
544
+ }
545
+ /**
546
+ * Generates a minimal Fly.io configuration file for Kora sync apps.
547
+ */
548
+ declare function generateFlyToml(options: FlyTomlOptions): string;
549
+ /**
550
+ * Writes `fly.toml` into `.kora/deploy`.
551
+ */
552
+ declare function writeFlyTomlArtifact(deployDirectory: string, options: FlyTomlOptions): Promise<string>;
553
+
554
+ /**
555
+ * Configuration used to render `railway.json`.
556
+ */
557
+ interface RailwayJsonOptions {
558
+ appName: string;
559
+ region?: string;
560
+ environment?: string;
561
+ startCommand?: string;
562
+ healthcheckPath?: string;
563
+ }
564
+ /**
565
+ * Generates Railway deployment configuration in JSON format.
566
+ */
567
+ declare function generateRailwayJson(options: RailwayJsonOptions): string;
568
+ /**
569
+ * Writes `railway.json` into `.kora/deploy`.
570
+ */
571
+ declare function writeRailwayJsonArtifact(deployDirectory: string, options: RailwayJsonOptions): Promise<string>;
572
+
573
+ /**
574
+ * Inputs used to execute a client build through Vite.
575
+ */
576
+ interface ClientBuildOptions {
577
+ projectRoot: string;
578
+ outDir: string;
579
+ mode?: 'development' | 'production';
580
+ }
581
+ /**
582
+ * Result returned after a successful Vite build.
583
+ */
584
+ interface ClientBuildResult {
585
+ outDir: string;
586
+ }
587
+ /**
588
+ * Builds the client bundle with the project's local Vite installation.
589
+ *
590
+ * After Vite completes, patches the output to ensure SQLite WASM assets
591
+ * are present. The template's sqliteWasmHotfix Vite plugin writes to the
592
+ * default `dist/` directory, but `kora deploy` redirects output to
593
+ * `.kora/deploy/dist/`. This post-build step fills in any missing assets.
594
+ */
595
+ declare function buildClient(options: ClientBuildOptions): Promise<ClientBuildResult>;
596
+
597
+ /**
598
+ * Options used to produce a deployable server bundle artifact.
599
+ */
600
+ interface ServerBundleOptions {
601
+ projectRoot: string;
602
+ deployDirectory: string;
603
+ entryFileCandidates?: readonly string[];
604
+ }
605
+ /**
606
+ * Result details for the generated server bundle artifact.
607
+ */
608
+ interface ServerBundleResult {
609
+ entryFilePath: string;
610
+ outputFilePath: string;
611
+ }
612
+ /**
613
+ * Bundles the server entry into a single deployable JavaScript file.
614
+ */
615
+ declare function bundleServer(options: ServerBundleOptions): Promise<ServerBundleResult>;
616
+
617
+ interface ProjectNameValidationResult {
618
+ valid: boolean;
619
+ issues: readonly string[];
620
+ }
621
+ /**
622
+ * Validates a project name for scaffolded package creation.
623
+ *
624
+ * The create command uses this validation before writing files so users get a
625
+ * clear, early error if the name cannot be used as an npm package name.
626
+ */
627
+ declare function validateProjectName(name: string): ProjectNameValidationResult;
628
+
629
+ type PlatformOption = 'web' | 'desktop-tauri';
630
+ type FrameworkOption = 'react' | 'vue' | 'svelte' | 'solid';
631
+ type AuthOption = 'none' | 'email-password' | 'oauth';
632
+ type DatabaseOption = 'none' | 'sqlite' | 'postgres';
633
+ type DatabaseProviderOption = 'none' | 'local' | 'supabase' | 'neon' | 'railway' | 'vercel-postgres' | 'custom';
634
+ interface TemplateSelectionInput {
635
+ platform: PlatformOption;
636
+ framework: FrameworkOption;
637
+ tailwind: boolean;
638
+ sync: boolean;
639
+ db: DatabaseOption;
640
+ }
641
+ /**
642
+ * Converts high-level scaffold selections into a concrete template name.
643
+ */
644
+ declare function determineTemplateFromSelections(input: TemplateSelectionInput): TemplateName;
645
+ declare function isFrameworkValue(value: string): value is FrameworkOption;
646
+ declare function isAuthValue(value: string): value is AuthOption;
647
+ declare function isDatabaseValue(value: string): value is DatabaseOption;
648
+ declare function isDatabaseProviderValue(value: string): value is DatabaseProviderOption;
649
+
650
+ interface CreatePreferences {
651
+ platform: PlatformOption;
652
+ framework: FrameworkOption;
653
+ tailwind: boolean;
654
+ sync: boolean;
655
+ db: DatabaseOption;
656
+ dbProvider: DatabaseProviderOption;
657
+ auth: AuthOption;
658
+ packageManager: PackageManager;
659
+ }
660
+ /**
661
+ * Preference store for scaffold-time defaults in `create-kora-app`.
662
+ */
663
+ declare class PreferenceStore {
664
+ private readonly store;
665
+ constructor();
666
+ getCreatePreferences(): CreatePreferences | null;
667
+ saveCreatePreferences(preferences: CreatePreferences): void;
668
+ clearCreatePreferences(): void;
669
+ }
670
+ /**
671
+ * Gets preferences from storage or returns defaults when not available.
672
+ */
673
+ declare function getCreatePreferencesOrDefault(store: PreferenceStore): CreatePreferences;
674
+ declare function getDefaultCreatePreferences(): CreatePreferences;
675
+
676
+ interface SelectOption<T extends string> {
677
+ label: string;
678
+ value: T;
679
+ hint?: string;
680
+ disabled?: boolean;
681
+ }
682
+ interface PromptClient {
683
+ text(message: string, defaultValue?: string): Promise<string>;
684
+ select<T extends string>(message: string, options: readonly SelectOption<T>[]): Promise<T>;
685
+ confirm(message: string, defaultValue?: boolean): Promise<boolean>;
686
+ intro(message: string): void;
687
+ outro(message: string): void;
688
+ }
689
+ declare class PromptCancelledError extends Error {
690
+ constructor(message?: string);
691
+ }
692
+ /**
693
+ * Prompt client backed by the current readline helpers.
694
+ *
695
+ * Phase 12 will introduce a richer prompt backend. This adapter keeps command
696
+ * logic decoupled from the prompt implementation so we can migrate without
697
+ * reshaping command behavior.
698
+ */
699
+ declare class ReadlinePromptClient implements PromptClient {
700
+ text(message: string, defaultValue?: string): Promise<string>;
701
+ select<T extends string>(message: string, options: readonly SelectOption<T>[]): Promise<T>;
702
+ confirm(message: string, defaultValue?: boolean): Promise<boolean>;
703
+ intro(message: string): void;
704
+ outro(message: string): void;
705
+ }
706
+ /**
707
+ * Returns the default prompt client for interactive CLI flows.
708
+ */
709
+ declare function createPromptClient(): PromptClient;
710
+ /**
711
+ * Prompt client backed by @clack/prompts for richer interactive UX.
712
+ * Falls back to readline in non-interactive contexts.
713
+ */
714
+ declare class ClackPromptClient implements PromptClient {
715
+ text(message: string, defaultValue?: string): Promise<string>;
716
+ select<T extends string>(message: string, options: readonly SelectOption<T>[]): Promise<T>;
717
+ confirm(message: string, defaultValue?: boolean): Promise<boolean>;
718
+ intro(message: string): void;
719
+ outro(message: string): void;
720
+ }
721
+
722
+ interface CreateFlags {
723
+ platform?: string;
724
+ framework?: string;
725
+ auth?: string;
726
+ db?: string;
727
+ dbProvider?: string;
728
+ tailwind?: boolean;
729
+ sync?: boolean;
730
+ useDefaults: boolean;
731
+ }
732
+ interface PreferenceResolutionResult {
733
+ platform: PlatformOption;
734
+ framework: FrameworkOption;
735
+ auth: AuthOption;
736
+ db: DatabaseOption;
737
+ dbProvider: DatabaseProviderOption;
738
+ tailwind: boolean;
739
+ sync: boolean;
740
+ template: ReturnType<typeof determineTemplateFromSelections>;
741
+ usedStoredPreferences: boolean;
742
+ }
743
+ /**
744
+ * Resolves scaffold options with precedence:
745
+ * CLI flags > --yes defaults > stored preferences > interactive prompts.
746
+ */
747
+ declare function resolveCreatePreferencesFlow(params: {
748
+ flags: CreateFlags;
749
+ prompts: PromptClient;
750
+ store: PreferenceStore;
751
+ }): Promise<PreferenceResolutionResult>;
752
+ declare function shouldSavePreferences(flags: CreateFlags): boolean;
753
+ declare function saveResolvedPreferences(store: PreferenceStore, resolution: Omit<PreferenceResolutionResult, 'template' | 'usedStoredPreferences'> & {
754
+ packageManager: CreatePreferences['packageManager'];
755
+ }): void;
756
+
757
+ interface SyncProviderPresetOptions {
758
+ targetDir: string;
759
+ template: TemplateName;
760
+ db: DatabaseOption;
761
+ dbProvider: DatabaseProviderOption;
762
+ }
763
+ /**
764
+ * Applies provider-specific sync scaffolding adjustments after template copy.
765
+ *
766
+ * The sync server template is environment-driven: SQLite is used when
767
+ * DATABASE_URL is absent, and PostgreSQL is used when DATABASE_URL is present.
768
+ * Provider presets only add provider-specific guidance.
769
+ */
770
+ declare function applySyncProviderPreset(options: SyncProviderPresetOptions): Promise<void>;
771
+
772
+ export { AGENTS_FRAMEWORKS, type AgentsFramework, type AuthOption, type BuildArtifacts, ClackPromptClient, CliError, type ClientBuildOptions, type ClientBuildResult, type ContextAwareDeployAdapter, type CreateFlags, type CreatePreferences, DEPLOY_PLATFORMS, type DatabaseOption, type DatabaseProviderOption, type DeployAdapter, type DeployPlatform, DeployPlatformUnavailableError, type DeployResult, type DeployState, type DeployStateCreateInput, type DeployStatePatch, type DeploymentStatus, DevServerError, type DockerfileOptions, FlyAdapter, type FlyAdapterContext, type FlyAdapterOptions, type FlyCommandResult, type FlyCommandRunner, type FlyTomlOptions, type FrameworkOption, IMPLEMENTED_DEPLOY_PLATFORMS, InvalidProjectError, type LogLine, type LogOptions, NodeFlyCommandRunner, NodeRailwayCommandRunner, PACKAGE_MANAGERS, type PackageManager, type PreferenceResolutionResult, PreferenceStore, type ProjectConfig, ProjectExistsError, type ProjectNameValidationResult, PromptCancelledError, type PromptClient, type ProvisionResult, RailwayAdapter, type RailwayAdapterContext, type RailwayAdapterOptions, type RailwayCommandResult, type RailwayCommandRunner, type RailwayJsonOptions, ReadlinePromptClient, SchemaNotFoundError, type SelectOption, type ServerBundleOptions, type ServerBundleResult, StubDeployAdapter, TEMPLATES, TEMPLATE_INFO, type TemplateContext, type TemplateInfo, type TemplateName, type TemplateSelectionInput, agentsCommand, applySyncProviderPreset, buildClient, bundleServer, createDeployAdapter, createPromptClient, deployCommand, detectFrameworkFromManifest, determineTemplateFromSelections, generateAgentsMd, generateDeployPackageJson, generateDockerIgnore, generateDockerfile, generateFlyToml, generateRailwayJson, generateTypes, getCreatePreferencesOrDefault, getDefaultCreatePreferences, isAgentsFramework, isAuthValue, isDatabaseProviderValue, isDatabaseValue, isDeployPlatform, isFrameworkValue, isImplementedDeployPlatform, readDeployState, resetDeployState, resolveCreatePreferencesFlow, resolveDeployDirectory, resolveDeployStatePath, saveResolvedPreferences, shouldSavePreferences, updateDeployState, validateProjectName, writeDeployState, writeDockerIgnoreArtifact, writeDockerfileArtifact, writeFlyTomlArtifact, writeRailwayJsonArtifact };