@dokebi/cli 0.4.1 → 0.4.26

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 (188) hide show
  1. package/AI.md +262 -57
  2. package/README.md +35 -10
  3. package/catalog.json +2519 -257
  4. package/describe.schema.json +748 -0
  5. package/dist/api-app.d.ts +2 -0
  6. package/dist/api-app.js +35 -0
  7. package/dist/app-urls.js +3 -2
  8. package/dist/bin.js +527 -35
  9. package/dist/capability-guide.d.ts +30 -0
  10. package/dist/capability-guide.js +122 -0
  11. package/dist/catalog.d.ts +16 -2
  12. package/dist/catalog.js +19 -7
  13. package/dist/check/asset-rules.d.ts +6 -0
  14. package/dist/check/asset-rules.js +163 -0
  15. package/dist/check/browser-sources.d.ts +20 -0
  16. package/dist/check/browser-sources.js +89 -0
  17. package/dist/check/console-rules.d.ts +6 -0
  18. package/dist/check/console-rules.js +40 -0
  19. package/dist/check/error-rules.d.ts +21 -0
  20. package/dist/check/error-rules.js +212 -0
  21. package/dist/check/form-rules.d.ts +12 -0
  22. package/dist/check/form-rules.js +69 -6
  23. package/dist/check/formatter-rules.d.ts +2 -0
  24. package/dist/check/formatter-rules.js +71 -0
  25. package/dist/check/i18n-rules.d.ts +27 -0
  26. package/dist/check/i18n-rules.js +353 -0
  27. package/dist/check/index.d.ts +15 -1
  28. package/dist/check/index.js +89 -11
  29. package/dist/check/mail-rules.d.ts +4 -0
  30. package/dist/check/mail-rules.js +72 -0
  31. package/dist/check/module-rules.d.ts +13 -0
  32. package/dist/check/module-rules.js +104 -0
  33. package/dist/check/packages.d.ts +8 -0
  34. package/dist/check/packages.js +16 -0
  35. package/dist/check/pool-rules.d.ts +8 -0
  36. package/dist/check/pool-rules.js +164 -0
  37. package/dist/check/problems.d.ts +6 -1
  38. package/dist/check/problems.js +100 -2
  39. package/dist/check/project-rules.d.ts +23 -3
  40. package/dist/check/project-rules.js +265 -23
  41. package/dist/check/seal-rules.d.ts +6 -0
  42. package/dist/check/seal-rules.js +68 -0
  43. package/dist/check/security-rules.d.ts +10 -0
  44. package/dist/check/security-rules.js +450 -0
  45. package/dist/check/shared-state-rules.d.ts +2 -0
  46. package/dist/check/shared-state-rules.js +114 -0
  47. package/dist/check/source-rules.d.ts +26 -3
  48. package/dist/check/source-rules.js +249 -28
  49. package/dist/check/structure-rules.d.ts +23 -0
  50. package/dist/check/structure-rules.js +502 -0
  51. package/dist/check/timer-rules.d.ts +7 -0
  52. package/dist/check/timer-rules.js +543 -0
  53. package/dist/check/typescript.d.ts +35 -5
  54. package/dist/check/typescript.js +163 -17
  55. package/dist/check/vite-rules.d.ts +2 -0
  56. package/dist/check/vite-rules.js +136 -0
  57. package/dist/check/wait-rules.d.ts +16 -0
  58. package/dist/check/wait-rules.js +337 -0
  59. package/dist/commands.d.ts +7 -0
  60. package/dist/commands.js +307 -31
  61. package/dist/config-diff.d.ts +42 -0
  62. package/dist/config-diff.js +289 -0
  63. package/dist/config-edit.d.ts +35 -2
  64. package/dist/config-edit.js +145 -13
  65. package/dist/config-init.d.ts +15 -0
  66. package/dist/config-init.js +61 -0
  67. package/dist/config-paths.d.ts +22 -0
  68. package/dist/config-paths.js +82 -0
  69. package/dist/config-show.d.ts +82 -0
  70. package/dist/config-show.js +563 -0
  71. package/dist/config-values.d.ts +8 -0
  72. package/dist/config-values.js +68 -0
  73. package/dist/configuration-scaffold.d.ts +42 -0
  74. package/dist/configuration-scaffold.js +258 -4
  75. package/dist/configuration.d.ts +63 -3
  76. package/dist/configuration.js +178 -4
  77. package/dist/deployment.d.ts +2 -0
  78. package/dist/deployment.js +111 -0
  79. package/dist/describe-db.d.ts +22 -0
  80. package/dist/describe-db.js +176 -0
  81. package/dist/describe.d.ts +92 -0
  82. package/dist/describe.js +417 -0
  83. package/dist/dev-compose.d.ts +20 -0
  84. package/dist/dev-compose.js +154 -0
  85. package/dist/dev-guard.js +44 -0
  86. package/dist/dev-host.d.ts +13 -0
  87. package/dist/dev-host.js +55 -0
  88. package/dist/dev-infra.d.ts +72 -4
  89. package/dist/dev-infra.js +237 -17
  90. package/dist/dev-watch.d.ts +34 -0
  91. package/dist/dev-watch.js +192 -0
  92. package/dist/diagnostics.d.ts +10 -7
  93. package/dist/diagnostics.js +22 -4
  94. package/dist/drift.d.ts +50 -0
  95. package/dist/drift.js +218 -0
  96. package/dist/env-file.d.ts +25 -1
  97. package/dist/env-file.js +64 -6
  98. package/dist/errors.d.ts +7 -1
  99. package/dist/example-config.d.ts +2 -0
  100. package/dist/example-config.js +3 -0
  101. package/dist/first-admin.d.ts +43 -0
  102. package/dist/first-admin.js +175 -0
  103. package/dist/formatter-ignore.d.ts +37 -0
  104. package/dist/formatter-ignore.js +344 -0
  105. package/dist/generator.d.ts +45 -3
  106. package/dist/generator.js +205 -15
  107. package/dist/guide.d.ts +1 -1
  108. package/dist/guide.js +42 -21
  109. package/dist/install-module.d.ts +29 -3
  110. package/dist/install-module.js +142 -13
  111. package/dist/install-plan.js +5 -3
  112. package/dist/layout.d.ts +12 -1
  113. package/dist/layout.js +19 -6
  114. package/dist/log-writer-control.d.ts +2 -0
  115. package/dist/log-writer-control.js +106 -27
  116. package/dist/log-writer.js +43 -10
  117. package/dist/logging-config.d.ts +8 -3
  118. package/dist/logging-config.js +19 -5
  119. package/dist/manifest.d.ts +29 -1
  120. package/dist/manifest.js +84 -6
  121. package/dist/merge-install-defaults.d.ts +0 -1
  122. package/dist/merge-install-defaults.js +13 -47
  123. package/dist/npm-client.d.ts +59 -4
  124. package/dist/npm-client.js +220 -16
  125. package/dist/npm-paths.js +18 -4
  126. package/dist/openapi.d.ts +27 -0
  127. package/dist/openapi.js +649 -0
  128. package/dist/option-fixes.d.ts +39 -0
  129. package/dist/option-fixes.js +130 -0
  130. package/dist/output.d.ts +1 -1
  131. package/dist/output.js +5 -5
  132. package/dist/plugin-lifecycle.d.ts +34 -2
  133. package/dist/plugin-lifecycle.js +206 -20
  134. package/dist/plugin-options.d.ts +19 -4
  135. package/dist/plugin-options.js +138 -6
  136. package/dist/plugins-command.js +44 -7
  137. package/dist/process-group.d.ts +39 -0
  138. package/dist/process-group.js +132 -0
  139. package/dist/project-guide.d.ts +19 -1
  140. package/dist/project-guide.js +119 -20
  141. package/dist/project-inspector.d.ts +15 -0
  142. package/dist/project-inspector.js +481 -33
  143. package/dist/project-state.d.ts +5 -0
  144. package/dist/project-state.js +8 -0
  145. package/dist/project.d.ts +203 -19
  146. package/dist/project.js +3016 -336
  147. package/dist/recipe-facts.d.ts +127 -0
  148. package/dist/recipe-facts.js +563 -0
  149. package/dist/recipe-login.d.ts +63 -0
  150. package/dist/recipe-login.js +464 -0
  151. package/dist/recipe-mail.d.ts +21 -0
  152. package/dist/recipe-mail.js +214 -0
  153. package/dist/recipe-members.d.ts +35 -0
  154. package/dist/recipe-members.js +178 -0
  155. package/dist/recipe-record.d.ts +82 -7
  156. package/dist/recipe-record.js +226 -22
  157. package/dist/recipe-reset.d.ts +2 -0
  158. package/dist/recipe-reset.js +117 -0
  159. package/dist/recipe-site.d.ts +48 -0
  160. package/dist/recipe-site.js +396 -0
  161. package/dist/recipe-step.d.ts +42 -0
  162. package/dist/recipe-step.js +89 -0
  163. package/dist/recipe.d.ts +56 -20
  164. package/dist/recipe.js +703 -131
  165. package/dist/registry.d.ts +98 -2
  166. package/dist/registry.js +171 -5
  167. package/dist/reloadable.d.ts +35 -0
  168. package/dist/reloadable.js +257 -0
  169. package/dist/server.d.ts +50 -4
  170. package/dist/server.js +790 -103
  171. package/dist/settings.d.ts +48 -0
  172. package/dist/settings.js +168 -0
  173. package/dist/site-auth.d.ts +39 -0
  174. package/dist/site-auth.js +195 -0
  175. package/dist/template-fixes.d.ts +26 -0
  176. package/dist/template-fixes.js +285 -0
  177. package/dist/test-reporter.d.ts +49 -0
  178. package/dist/test-reporter.js +190 -0
  179. package/dist/transaction.d.ts +67 -0
  180. package/dist/transaction.js +428 -46
  181. package/dist/verify-tests.d.ts +98 -0
  182. package/dist/verify-tests.js +449 -0
  183. package/dist/verify.d.ts +113 -4
  184. package/dist/verify.js +326 -28
  185. package/dist/view-choice.d.ts +58 -0
  186. package/dist/view-choice.js +131 -0
  187. package/dist/vite-watch.js +4 -2
  188. package/package.json +8 -6
package/dist/server.d.ts CHANGED
@@ -75,6 +75,13 @@ export interface ProcessInfo {
75
75
  * be alive, so callers never treat that as a stale pid file.
76
76
  */
77
77
  export type ProcessReader = (pid: number) => Promise<ProcessInfo | undefined>;
78
+ /**
79
+ * Whether a /proc read failed because the process is gone: ENOENT (no /proc/<pid>), or ESRCH,
80
+ * which Linux returns when the process exits while one of its files is open. Anything else
81
+ * (permissions, a changed /proc) is a failure. ESRCH was found by the v0.4.1 tag pipeline: an
82
+ * app that stopped during `stop`'s check ended as PROCESS_INFO_FAILED.
83
+ */
84
+ export declare function procGone(error: unknown): boolean;
78
85
  export declare function status(root: string,
79
86
  /** Tests replace how a process is read; the CLI uses ps (/proc on Linux). */
80
87
  read?: ProcessReader,
@@ -96,6 +103,14 @@ export declare function proveInstance(root: string, record: Pick<PidRecord, 'tok
96
103
  tried: string[];
97
104
  reason?: string;
98
105
  }>;
106
+ export declare function checkProject(root: string): Promise<string>;
107
+ /**
108
+ * R1 T4 review: why a start failed, from the app log of this start only (after its last start
109
+ * mark): the first record with an error, as `<code>: <first line>` and, when the error has
110
+ * causes, `… <its last Caused by line>`. A START_FAILED said only "exited with code 1", and its
111
+ * tail began with an earlier start's lines. Undefined when no record says.
112
+ */
113
+ export declare function startFailureCause(lines: readonly string[]): string | undefined;
99
114
  export interface LogOptions {
100
115
  /** Rotate app.log when it would pass this size (default 50 MB). */
101
116
  readonly logMaxBytes?: number;
@@ -178,12 +193,43 @@ export declare function stopStarted(root: string, started: Pick<StartResult, 'pi
178
193
  export declare function logs(root: string, lines?: number, follow?: boolean, write?: (text: string) => void, signal?: AbortSignal): Promise<void>;
179
194
  /** Runs the app in the foreground and forwards SIGINT/SIGTERM; resolves with its exit code. */
180
195
  export declare function foreground(root: string): Promise<number>;
196
+ /** The installed version of a package, looked up like Node does (node_modules up the tree). */
197
+ export declare function installedVersion(root: string, name: string): [number, number, number] | undefined;
181
198
  /**
182
199
  * Development loop: runs the app, restarts it (SIGTERM, drain, start) 300 ms after a change in
183
- * src/, dokebi.yaml or .env. With a Vite config, Inertia views come from the Vite dev server
184
- * (HMR, D-0045) when template-inertia supports it, otherwise from watch builds that restart the
185
- * app. With template-inertia 0.4.0 that Vite is one host process beside the app, shared by every
186
- * cluster worker and kept across app restarts (D-0045 addendum 3); older ones start it inside the app.
200
+ * src/, dokebi.yaml or .env (a path whose state differs from the recorded one, see dev-watch.ts).
201
+ * D-0154: a change of dokebi.yaml alone is first offered to the running app: when every changed
202
+ * option is reloadable it applies them and keeps running; an invalid file keeps the app as it is;
203
+ * anything else (an option that needs a restart, an app without reloads) restarts it.
204
+ * With a Vite config, Inertia views come from the Vite dev server (HMR, D-0045) when
205
+ * template-inertia supports it, otherwise from watch builds that restart the app. With
206
+ * template-inertia 0.4.0 that Vite is one host process beside the app, shared by every cluster
207
+ * worker and kept across app restarts (D-0045 addendum 3); older ones start it inside the app.
187
208
  * The first Ctrl+C drains everything; a second one kills.
188
209
  */
189
210
  export declare function dev(root: string, say: (line: string) => void): Promise<number>;
211
+ /** What `dokebi reload` found and did (D-0154). */
212
+ export interface ReloadResult {
213
+ readonly running: boolean;
214
+ readonly pid?: number;
215
+ /** `applied`, `unchanged`, or `unknown` (no outcome line within the timeout). */
216
+ readonly outcome?: 'applied' | 'unchanged' | 'unknown';
217
+ readonly code?: string;
218
+ /** The configuration revision after the reload, when the app said it. */
219
+ readonly revision?: number;
220
+ /** Changed option paths the app named (never values). */
221
+ readonly paths?: string[];
222
+ readonly ms?: number;
223
+ readonly proof?: Proof;
224
+ /** Who sent SIGHUP: this command, or the app's log writer (a sandbox per command). */
225
+ readonly via?: 'signal' | 'log-writer';
226
+ readonly warnings?: string[];
227
+ }
228
+ /**
229
+ * `dokebi reload` (D-0154): asks the background app to read dokebi.yaml again (SIGHUP to the pid
230
+ * `start` recorded, proven like `stop`; through its log writer when this shell may not signal
231
+ * it), then reads its outcome from .dokebi/run/app.log. Options marked reloadable apply without
232
+ * a restart; an option that needs one (`RELOAD_RESTART_REQUIRED`), an invalid file
233
+ * (`RELOAD_INVALID`) or a plugin that could not prepare (`RELOAD_FAILED`) change nothing.
234
+ */
235
+ export declare function reload(root: string, timeoutMs?: number, read?: ProcessReader, kill?: ProcessSignaller): Promise<ReloadResult>;