@lumenflow/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +119 -0
  3. package/dist/active-wu-detector.d.ts +33 -0
  4. package/dist/active-wu-detector.js +106 -0
  5. package/dist/adapters/filesystem-metrics.adapter.d.ts +108 -0
  6. package/dist/adapters/filesystem-metrics.adapter.js +519 -0
  7. package/dist/adapters/terminal-renderer.adapter.d.ts +106 -0
  8. package/dist/adapters/terminal-renderer.adapter.js +337 -0
  9. package/dist/arg-parser.d.ts +63 -0
  10. package/dist/arg-parser.js +560 -0
  11. package/dist/backlog-editor.d.ts +98 -0
  12. package/dist/backlog-editor.js +179 -0
  13. package/dist/backlog-generator.d.ts +111 -0
  14. package/dist/backlog-generator.js +381 -0
  15. package/dist/backlog-parser.d.ts +45 -0
  16. package/dist/backlog-parser.js +102 -0
  17. package/dist/backlog-sync-validator.d.ts +78 -0
  18. package/dist/backlog-sync-validator.js +294 -0
  19. package/dist/branch-drift.d.ts +34 -0
  20. package/dist/branch-drift.js +51 -0
  21. package/dist/cleanup-install-config.d.ts +33 -0
  22. package/dist/cleanup-install-config.js +37 -0
  23. package/dist/cleanup-lock.d.ts +139 -0
  24. package/dist/cleanup-lock.js +313 -0
  25. package/dist/code-path-validator.d.ts +146 -0
  26. package/dist/code-path-validator.js +537 -0
  27. package/dist/code-paths-overlap.d.ts +55 -0
  28. package/dist/code-paths-overlap.js +245 -0
  29. package/dist/commands-logger.d.ts +77 -0
  30. package/dist/commands-logger.js +254 -0
  31. package/dist/commit-message-utils.d.ts +25 -0
  32. package/dist/commit-message-utils.js +41 -0
  33. package/dist/compliance-parser.d.ts +150 -0
  34. package/dist/compliance-parser.js +507 -0
  35. package/dist/constants/backlog-patterns.d.ts +20 -0
  36. package/dist/constants/backlog-patterns.js +23 -0
  37. package/dist/constants/dora-constants.d.ts +49 -0
  38. package/dist/constants/dora-constants.js +53 -0
  39. package/dist/constants/gate-constants.d.ts +15 -0
  40. package/dist/constants/gate-constants.js +15 -0
  41. package/dist/constants/linter-constants.d.ts +16 -0
  42. package/dist/constants/linter-constants.js +16 -0
  43. package/dist/constants/tokenizer-constants.d.ts +15 -0
  44. package/dist/constants/tokenizer-constants.js +15 -0
  45. package/dist/core/scope-checker.d.ts +97 -0
  46. package/dist/core/scope-checker.js +163 -0
  47. package/dist/core/tool-runner.d.ts +161 -0
  48. package/dist/core/tool-runner.js +393 -0
  49. package/dist/core/tool.constants.d.ts +105 -0
  50. package/dist/core/tool.constants.js +101 -0
  51. package/dist/core/tool.schemas.d.ts +226 -0
  52. package/dist/core/tool.schemas.js +226 -0
  53. package/dist/core/worktree-guard.d.ts +130 -0
  54. package/dist/core/worktree-guard.js +242 -0
  55. package/dist/coverage-gate.d.ts +108 -0
  56. package/dist/coverage-gate.js +196 -0
  57. package/dist/date-utils.d.ts +75 -0
  58. package/dist/date-utils.js +140 -0
  59. package/dist/dependency-graph.d.ts +142 -0
  60. package/dist/dependency-graph.js +550 -0
  61. package/dist/dependency-guard.d.ts +54 -0
  62. package/dist/dependency-guard.js +142 -0
  63. package/dist/dependency-validator.d.ts +105 -0
  64. package/dist/dependency-validator.js +154 -0
  65. package/dist/docs-path-validator.d.ts +36 -0
  66. package/dist/docs-path-validator.js +95 -0
  67. package/dist/domain/orchestration.constants.d.ts +99 -0
  68. package/dist/domain/orchestration.constants.js +97 -0
  69. package/dist/domain/orchestration.schemas.d.ts +280 -0
  70. package/dist/domain/orchestration.schemas.js +211 -0
  71. package/dist/domain/orchestration.types.d.ts +133 -0
  72. package/dist/domain/orchestration.types.js +12 -0
  73. package/dist/error-handler.d.ts +116 -0
  74. package/dist/error-handler.js +136 -0
  75. package/dist/file-classifiers.d.ts +62 -0
  76. package/dist/file-classifiers.js +108 -0
  77. package/dist/gates-agent-mode.d.ts +81 -0
  78. package/dist/gates-agent-mode.js +94 -0
  79. package/dist/generate-traceability.d.ts +107 -0
  80. package/dist/generate-traceability.js +411 -0
  81. package/dist/git-adapter.d.ts +395 -0
  82. package/dist/git-adapter.js +649 -0
  83. package/dist/git-staged-validator.d.ts +32 -0
  84. package/dist/git-staged-validator.js +48 -0
  85. package/dist/hardcoded-strings.d.ts +61 -0
  86. package/dist/hardcoded-strings.js +270 -0
  87. package/dist/incremental-lint.d.ts +78 -0
  88. package/dist/incremental-lint.js +129 -0
  89. package/dist/incremental-test.d.ts +39 -0
  90. package/dist/incremental-test.js +61 -0
  91. package/dist/index.d.ts +42 -0
  92. package/dist/index.js +61 -0
  93. package/dist/invariants/check-automated-tests.d.ts +50 -0
  94. package/dist/invariants/check-automated-tests.js +166 -0
  95. package/dist/invariants-runner.d.ts +103 -0
  96. package/dist/invariants-runner.js +527 -0
  97. package/dist/lane-checker.d.ts +50 -0
  98. package/dist/lane-checker.js +319 -0
  99. package/dist/lane-inference.d.ts +39 -0
  100. package/dist/lane-inference.js +195 -0
  101. package/dist/lane-lock.d.ts +211 -0
  102. package/dist/lane-lock.js +474 -0
  103. package/dist/lane-validator.d.ts +48 -0
  104. package/dist/lane-validator.js +114 -0
  105. package/dist/logs-lib.d.ts +104 -0
  106. package/dist/logs-lib.js +207 -0
  107. package/dist/lumenflow-config-schema.d.ts +272 -0
  108. package/dist/lumenflow-config-schema.js +207 -0
  109. package/dist/lumenflow-config.d.ts +95 -0
  110. package/dist/lumenflow-config.js +236 -0
  111. package/dist/manual-test-validator.d.ts +80 -0
  112. package/dist/manual-test-validator.js +200 -0
  113. package/dist/merge-lock.d.ts +115 -0
  114. package/dist/merge-lock.js +251 -0
  115. package/dist/micro-worktree.d.ts +159 -0
  116. package/dist/micro-worktree.js +427 -0
  117. package/dist/migration-deployer.d.ts +69 -0
  118. package/dist/migration-deployer.js +151 -0
  119. package/dist/orchestration-advisory-loader.d.ts +28 -0
  120. package/dist/orchestration-advisory-loader.js +87 -0
  121. package/dist/orchestration-advisory.d.ts +58 -0
  122. package/dist/orchestration-advisory.js +94 -0
  123. package/dist/orchestration-di.d.ts +48 -0
  124. package/dist/orchestration-di.js +57 -0
  125. package/dist/orchestration-rules.d.ts +57 -0
  126. package/dist/orchestration-rules.js +201 -0
  127. package/dist/orphan-detector.d.ts +131 -0
  128. package/dist/orphan-detector.js +226 -0
  129. package/dist/path-classifiers.d.ts +57 -0
  130. package/dist/path-classifiers.js +93 -0
  131. package/dist/piped-command-detector.d.ts +34 -0
  132. package/dist/piped-command-detector.js +64 -0
  133. package/dist/ports/dashboard-renderer.port.d.ts +112 -0
  134. package/dist/ports/dashboard-renderer.port.js +25 -0
  135. package/dist/ports/metrics-collector.port.d.ts +132 -0
  136. package/dist/ports/metrics-collector.port.js +26 -0
  137. package/dist/process-detector.d.ts +84 -0
  138. package/dist/process-detector.js +172 -0
  139. package/dist/prompt-linter.d.ts +72 -0
  140. package/dist/prompt-linter.js +312 -0
  141. package/dist/prompt-monitor.d.ts +15 -0
  142. package/dist/prompt-monitor.js +205 -0
  143. package/dist/rebase-artifact-cleanup.d.ts +145 -0
  144. package/dist/rebase-artifact-cleanup.js +433 -0
  145. package/dist/retry-strategy.d.ts +189 -0
  146. package/dist/retry-strategy.js +283 -0
  147. package/dist/risk-detector.d.ts +108 -0
  148. package/dist/risk-detector.js +252 -0
  149. package/dist/rollback-utils.d.ts +76 -0
  150. package/dist/rollback-utils.js +104 -0
  151. package/dist/section-headings.d.ts +43 -0
  152. package/dist/section-headings.js +49 -0
  153. package/dist/spawn-escalation.d.ts +90 -0
  154. package/dist/spawn-escalation.js +253 -0
  155. package/dist/spawn-monitor.d.ts +229 -0
  156. package/dist/spawn-monitor.js +672 -0
  157. package/dist/spawn-recovery.d.ts +82 -0
  158. package/dist/spawn-recovery.js +298 -0
  159. package/dist/spawn-registry-schema.d.ts +98 -0
  160. package/dist/spawn-registry-schema.js +108 -0
  161. package/dist/spawn-registry-store.d.ts +146 -0
  162. package/dist/spawn-registry-store.js +273 -0
  163. package/dist/spawn-tree.d.ts +121 -0
  164. package/dist/spawn-tree.js +285 -0
  165. package/dist/stamp-status-validator.d.ts +84 -0
  166. package/dist/stamp-status-validator.js +134 -0
  167. package/dist/stamp-utils.d.ts +100 -0
  168. package/dist/stamp-utils.js +229 -0
  169. package/dist/state-machine.d.ts +26 -0
  170. package/dist/state-machine.js +83 -0
  171. package/dist/system-map-validator.d.ts +80 -0
  172. package/dist/system-map-validator.js +272 -0
  173. package/dist/telemetry.d.ts +80 -0
  174. package/dist/telemetry.js +213 -0
  175. package/dist/token-counter.d.ts +51 -0
  176. package/dist/token-counter.js +145 -0
  177. package/dist/usecases/get-dashboard-data.usecase.d.ts +52 -0
  178. package/dist/usecases/get-dashboard-data.usecase.js +61 -0
  179. package/dist/usecases/get-suggestions.usecase.d.ts +100 -0
  180. package/dist/usecases/get-suggestions.usecase.js +153 -0
  181. package/dist/user-normalizer.d.ts +41 -0
  182. package/dist/user-normalizer.js +141 -0
  183. package/dist/validators/phi-constants.d.ts +97 -0
  184. package/dist/validators/phi-constants.js +152 -0
  185. package/dist/validators/phi-scanner.d.ts +58 -0
  186. package/dist/validators/phi-scanner.js +215 -0
  187. package/dist/worktree-ownership.d.ts +50 -0
  188. package/dist/worktree-ownership.js +74 -0
  189. package/dist/worktree-scanner.d.ts +103 -0
  190. package/dist/worktree-scanner.js +168 -0
  191. package/dist/worktree-symlink.d.ts +99 -0
  192. package/dist/worktree-symlink.js +359 -0
  193. package/dist/wu-backlog-updater.d.ts +17 -0
  194. package/dist/wu-backlog-updater.js +37 -0
  195. package/dist/wu-checkpoint.d.ts +124 -0
  196. package/dist/wu-checkpoint.js +233 -0
  197. package/dist/wu-claim-helpers.d.ts +26 -0
  198. package/dist/wu-claim-helpers.js +63 -0
  199. package/dist/wu-claim-resume.d.ts +106 -0
  200. package/dist/wu-claim-resume.js +276 -0
  201. package/dist/wu-consistency-checker.d.ts +95 -0
  202. package/dist/wu-consistency-checker.js +567 -0
  203. package/dist/wu-constants.d.ts +1275 -0
  204. package/dist/wu-constants.js +1382 -0
  205. package/dist/wu-create-validators.d.ts +42 -0
  206. package/dist/wu-create-validators.js +93 -0
  207. package/dist/wu-done-branch-only.d.ts +63 -0
  208. package/dist/wu-done-branch-only.js +191 -0
  209. package/dist/wu-done-messages.d.ts +119 -0
  210. package/dist/wu-done-messages.js +185 -0
  211. package/dist/wu-done-pr.d.ts +72 -0
  212. package/dist/wu-done-pr.js +174 -0
  213. package/dist/wu-done-retry-helpers.d.ts +85 -0
  214. package/dist/wu-done-retry-helpers.js +172 -0
  215. package/dist/wu-done-ui.d.ts +37 -0
  216. package/dist/wu-done-ui.js +69 -0
  217. package/dist/wu-done-validators.d.ts +411 -0
  218. package/dist/wu-done-validators.js +1229 -0
  219. package/dist/wu-done-worktree.d.ts +182 -0
  220. package/dist/wu-done-worktree.js +1097 -0
  221. package/dist/wu-helpers.d.ts +128 -0
  222. package/dist/wu-helpers.js +248 -0
  223. package/dist/wu-lint.d.ts +70 -0
  224. package/dist/wu-lint.js +234 -0
  225. package/dist/wu-paths.d.ts +171 -0
  226. package/dist/wu-paths.js +178 -0
  227. package/dist/wu-preflight-validators.d.ts +86 -0
  228. package/dist/wu-preflight-validators.js +251 -0
  229. package/dist/wu-recovery.d.ts +138 -0
  230. package/dist/wu-recovery.js +341 -0
  231. package/dist/wu-repair-core.d.ts +131 -0
  232. package/dist/wu-repair-core.js +669 -0
  233. package/dist/wu-schema-normalization.d.ts +17 -0
  234. package/dist/wu-schema-normalization.js +82 -0
  235. package/dist/wu-schema.d.ts +793 -0
  236. package/dist/wu-schema.js +881 -0
  237. package/dist/wu-spawn-helpers.d.ts +121 -0
  238. package/dist/wu-spawn-helpers.js +271 -0
  239. package/dist/wu-spawn.d.ts +158 -0
  240. package/dist/wu-spawn.js +1306 -0
  241. package/dist/wu-state-schema.d.ts +213 -0
  242. package/dist/wu-state-schema.js +156 -0
  243. package/dist/wu-state-store.d.ts +264 -0
  244. package/dist/wu-state-store.js +691 -0
  245. package/dist/wu-status-transition.d.ts +63 -0
  246. package/dist/wu-status-transition.js +382 -0
  247. package/dist/wu-status-updater.d.ts +25 -0
  248. package/dist/wu-status-updater.js +116 -0
  249. package/dist/wu-transaction-collectors.d.ts +116 -0
  250. package/dist/wu-transaction-collectors.js +272 -0
  251. package/dist/wu-transaction.d.ts +170 -0
  252. package/dist/wu-transaction.js +273 -0
  253. package/dist/wu-validation-constants.d.ts +60 -0
  254. package/dist/wu-validation-constants.js +66 -0
  255. package/dist/wu-validation.d.ts +118 -0
  256. package/dist/wu-validation.js +243 -0
  257. package/dist/wu-validator.d.ts +62 -0
  258. package/dist/wu-validator.js +325 -0
  259. package/dist/wu-yaml-fixer.d.ts +97 -0
  260. package/dist/wu-yaml-fixer.js +264 -0
  261. package/dist/wu-yaml.d.ts +86 -0
  262. package/dist/wu-yaml.js +222 -0
  263. package/package.json +114 -0
@@ -0,0 +1,272 @@
1
+ /**
2
+ * LumenFlow Configuration Schema
3
+ *
4
+ * Zod schemas for LumenFlow configuration.
5
+ * All paths and settings are configurable via .lumenflow.config.yaml
6
+ *
7
+ * @module lumenflow-config-schema
8
+ */
9
+ import { z } from 'zod';
10
+ /**
11
+ * Directory paths configuration
12
+ */
13
+ export declare const DirectoriesSchema: z.ZodObject<{
14
+ appsWeb: z.ZodDefault<z.ZodString>;
15
+ worktrees: z.ZodDefault<z.ZodString>;
16
+ ai: z.ZodDefault<z.ZodString>;
17
+ claude: z.ZodDefault<z.ZodString>;
18
+ docs: z.ZodDefault<z.ZodString>;
19
+ packages: z.ZodDefault<z.ZodString>;
20
+ tools: z.ZodDefault<z.ZodString>;
21
+ memoryBank: z.ZodDefault<z.ZodString>;
22
+ wuDir: z.ZodDefault<z.ZodString>;
23
+ initiativesDir: z.ZodDefault<z.ZodString>;
24
+ backlogPath: z.ZodDefault<z.ZodString>;
25
+ statusPath: z.ZodDefault<z.ZodString>;
26
+ skillsDir: z.ZodDefault<z.ZodString>;
27
+ agentsDir: z.ZodDefault<z.ZodString>;
28
+ }, z.core.$strip>;
29
+ /**
30
+ * Beacon paths configuration (.beacon directory structure)
31
+ */
32
+ export declare const BeaconPathsSchema: z.ZodObject<{
33
+ base: z.ZodDefault<z.ZodString>;
34
+ stateDir: z.ZodDefault<z.ZodString>;
35
+ stampsDir: z.ZodDefault<z.ZodString>;
36
+ mergeLock: z.ZodDefault<z.ZodString>;
37
+ telemetry: z.ZodDefault<z.ZodString>;
38
+ flowLog: z.ZodDefault<z.ZodString>;
39
+ sessions: z.ZodDefault<z.ZodString>;
40
+ incidents: z.ZodDefault<z.ZodString>;
41
+ commandsLog: z.ZodDefault<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ /**
44
+ * Git configuration
45
+ */
46
+ export declare const GitConfigSchema: z.ZodObject<{
47
+ mainBranch: z.ZodDefault<z.ZodString>;
48
+ defaultRemote: z.ZodDefault<z.ZodString>;
49
+ laneBranchPrefix: z.ZodDefault<z.ZodString>;
50
+ tempBranchPrefix: z.ZodDefault<z.ZodString>;
51
+ realGitPath: z.ZodDefault<z.ZodString>;
52
+ maxBranchDrift: z.ZodDefault<z.ZodNumber>;
53
+ branchDriftWarning: z.ZodDefault<z.ZodNumber>;
54
+ branchDriftInfo: z.ZodDefault<z.ZodNumber>;
55
+ }, z.core.$strip>;
56
+ /**
57
+ * WU (Work Unit) configuration
58
+ */
59
+ export declare const WuConfigSchema: z.ZodObject<{
60
+ idPattern: z.ZodDefault<z.ZodString>;
61
+ minDescriptionLength: z.ZodDefault<z.ZodNumber>;
62
+ maxCommitSubject: z.ZodDefault<z.ZodNumber>;
63
+ defaultPriority: z.ZodDefault<z.ZodString>;
64
+ defaultStatus: z.ZodDefault<z.ZodString>;
65
+ defaultType: z.ZodDefault<z.ZodString>;
66
+ }, z.core.$strip>;
67
+ /**
68
+ * Gates configuration
69
+ */
70
+ export declare const GatesConfigSchema: z.ZodObject<{
71
+ maxEslintWarnings: z.ZodDefault<z.ZodNumber>;
72
+ enableCoverage: z.ZodDefault<z.ZodBoolean>;
73
+ minCoverage: z.ZodDefault<z.ZodNumber>;
74
+ enableSafetyCriticalTests: z.ZodDefault<z.ZodBoolean>;
75
+ enableInvariants: z.ZodDefault<z.ZodBoolean>;
76
+ }, z.core.$strip>;
77
+ /**
78
+ * Memory layer configuration
79
+ */
80
+ export declare const MemoryConfigSchema: z.ZodObject<{
81
+ directory: z.ZodDefault<z.ZodString>;
82
+ sessionTtl: z.ZodDefault<z.ZodNumber>;
83
+ checkpointTtl: z.ZodDefault<z.ZodNumber>;
84
+ enableAutoCleanup: z.ZodDefault<z.ZodBoolean>;
85
+ }, z.core.$strip>;
86
+ /**
87
+ * UI configuration
88
+ */
89
+ export declare const UiConfigSchema: z.ZodObject<{
90
+ errorBoxWidth: z.ZodDefault<z.ZodNumber>;
91
+ statusPreviewLines: z.ZodDefault<z.ZodNumber>;
92
+ readinessBoxWidth: z.ZodDefault<z.ZodNumber>;
93
+ }, z.core.$strip>;
94
+ /**
95
+ * YAML serialization configuration
96
+ */
97
+ export declare const YamlConfigSchema: z.ZodObject<{
98
+ lineWidth: z.ZodDefault<z.ZodNumber>;
99
+ }, z.core.$strip>;
100
+ /**
101
+ * Complete LumenFlow configuration schema
102
+ */
103
+ export declare const LumenFlowConfigSchema: z.ZodObject<{
104
+ version: z.ZodDefault<z.ZodString>;
105
+ directories: z.ZodDefault<z.ZodObject<{
106
+ appsWeb: z.ZodDefault<z.ZodString>;
107
+ worktrees: z.ZodDefault<z.ZodString>;
108
+ ai: z.ZodDefault<z.ZodString>;
109
+ claude: z.ZodDefault<z.ZodString>;
110
+ docs: z.ZodDefault<z.ZodString>;
111
+ packages: z.ZodDefault<z.ZodString>;
112
+ tools: z.ZodDefault<z.ZodString>;
113
+ memoryBank: z.ZodDefault<z.ZodString>;
114
+ wuDir: z.ZodDefault<z.ZodString>;
115
+ initiativesDir: z.ZodDefault<z.ZodString>;
116
+ backlogPath: z.ZodDefault<z.ZodString>;
117
+ statusPath: z.ZodDefault<z.ZodString>;
118
+ skillsDir: z.ZodDefault<z.ZodString>;
119
+ agentsDir: z.ZodDefault<z.ZodString>;
120
+ }, z.core.$strip>>;
121
+ beacon: z.ZodDefault<z.ZodObject<{
122
+ base: z.ZodDefault<z.ZodString>;
123
+ stateDir: z.ZodDefault<z.ZodString>;
124
+ stampsDir: z.ZodDefault<z.ZodString>;
125
+ mergeLock: z.ZodDefault<z.ZodString>;
126
+ telemetry: z.ZodDefault<z.ZodString>;
127
+ flowLog: z.ZodDefault<z.ZodString>;
128
+ sessions: z.ZodDefault<z.ZodString>;
129
+ incidents: z.ZodDefault<z.ZodString>;
130
+ commandsLog: z.ZodDefault<z.ZodString>;
131
+ }, z.core.$strip>>;
132
+ git: z.ZodDefault<z.ZodObject<{
133
+ mainBranch: z.ZodDefault<z.ZodString>;
134
+ defaultRemote: z.ZodDefault<z.ZodString>;
135
+ laneBranchPrefix: z.ZodDefault<z.ZodString>;
136
+ tempBranchPrefix: z.ZodDefault<z.ZodString>;
137
+ realGitPath: z.ZodDefault<z.ZodString>;
138
+ maxBranchDrift: z.ZodDefault<z.ZodNumber>;
139
+ branchDriftWarning: z.ZodDefault<z.ZodNumber>;
140
+ branchDriftInfo: z.ZodDefault<z.ZodNumber>;
141
+ }, z.core.$strip>>;
142
+ wu: z.ZodDefault<z.ZodObject<{
143
+ idPattern: z.ZodDefault<z.ZodString>;
144
+ minDescriptionLength: z.ZodDefault<z.ZodNumber>;
145
+ maxCommitSubject: z.ZodDefault<z.ZodNumber>;
146
+ defaultPriority: z.ZodDefault<z.ZodString>;
147
+ defaultStatus: z.ZodDefault<z.ZodString>;
148
+ defaultType: z.ZodDefault<z.ZodString>;
149
+ }, z.core.$strip>>;
150
+ gates: z.ZodDefault<z.ZodObject<{
151
+ maxEslintWarnings: z.ZodDefault<z.ZodNumber>;
152
+ enableCoverage: z.ZodDefault<z.ZodBoolean>;
153
+ minCoverage: z.ZodDefault<z.ZodNumber>;
154
+ enableSafetyCriticalTests: z.ZodDefault<z.ZodBoolean>;
155
+ enableInvariants: z.ZodDefault<z.ZodBoolean>;
156
+ }, z.core.$strip>>;
157
+ memory: z.ZodDefault<z.ZodObject<{
158
+ directory: z.ZodDefault<z.ZodString>;
159
+ sessionTtl: z.ZodDefault<z.ZodNumber>;
160
+ checkpointTtl: z.ZodDefault<z.ZodNumber>;
161
+ enableAutoCleanup: z.ZodDefault<z.ZodBoolean>;
162
+ }, z.core.$strip>>;
163
+ ui: z.ZodDefault<z.ZodObject<{
164
+ errorBoxWidth: z.ZodDefault<z.ZodNumber>;
165
+ statusPreviewLines: z.ZodDefault<z.ZodNumber>;
166
+ readinessBoxWidth: z.ZodDefault<z.ZodNumber>;
167
+ }, z.core.$strip>>;
168
+ yaml: z.ZodDefault<z.ZodObject<{
169
+ lineWidth: z.ZodDefault<z.ZodNumber>;
170
+ }, z.core.$strip>>;
171
+ }, z.core.$strip>;
172
+ /**
173
+ * TypeScript types inferred from schemas
174
+ */
175
+ export type Directories = z.infer<typeof DirectoriesSchema>;
176
+ export type BeaconPaths = z.infer<typeof BeaconPathsSchema>;
177
+ export type GitConfig = z.infer<typeof GitConfigSchema>;
178
+ export type WuConfig = z.infer<typeof WuConfigSchema>;
179
+ export type GatesConfig = z.infer<typeof GatesConfigSchema>;
180
+ export type MemoryConfig = z.infer<typeof MemoryConfigSchema>;
181
+ export type UiConfig = z.infer<typeof UiConfigSchema>;
182
+ export type YamlConfig = z.infer<typeof YamlConfigSchema>;
183
+ export type LumenFlowConfig = z.infer<typeof LumenFlowConfigSchema>;
184
+ /**
185
+ * Validate configuration data
186
+ *
187
+ * @param data - Configuration data to validate
188
+ * @returns Validation result with parsed config or errors
189
+ */
190
+ export declare function validateConfig(data: unknown): z.ZodSafeParseResult<{
191
+ version: string;
192
+ directories: {
193
+ appsWeb: string;
194
+ worktrees: string;
195
+ ai: string;
196
+ claude: string;
197
+ docs: string;
198
+ packages: string;
199
+ tools: string;
200
+ memoryBank: string;
201
+ wuDir: string;
202
+ initiativesDir: string;
203
+ backlogPath: string;
204
+ statusPath: string;
205
+ skillsDir: string;
206
+ agentsDir: string;
207
+ };
208
+ beacon: {
209
+ base: string;
210
+ stateDir: string;
211
+ stampsDir: string;
212
+ mergeLock: string;
213
+ telemetry: string;
214
+ flowLog: string;
215
+ sessions: string;
216
+ incidents: string;
217
+ commandsLog: string;
218
+ };
219
+ git: {
220
+ mainBranch: string;
221
+ defaultRemote: string;
222
+ laneBranchPrefix: string;
223
+ tempBranchPrefix: string;
224
+ realGitPath: string;
225
+ maxBranchDrift: number;
226
+ branchDriftWarning: number;
227
+ branchDriftInfo: number;
228
+ };
229
+ wu: {
230
+ idPattern: string;
231
+ minDescriptionLength: number;
232
+ maxCommitSubject: number;
233
+ defaultPriority: string;
234
+ defaultStatus: string;
235
+ defaultType: string;
236
+ };
237
+ gates: {
238
+ maxEslintWarnings: number;
239
+ enableCoverage: boolean;
240
+ minCoverage: number;
241
+ enableSafetyCriticalTests: boolean;
242
+ enableInvariants: boolean;
243
+ };
244
+ memory: {
245
+ directory: string;
246
+ sessionTtl: number;
247
+ checkpointTtl: number;
248
+ enableAutoCleanup: boolean;
249
+ };
250
+ ui: {
251
+ errorBoxWidth: number;
252
+ statusPreviewLines: number;
253
+ readinessBoxWidth: number;
254
+ };
255
+ yaml: {
256
+ lineWidth: number;
257
+ };
258
+ }>;
259
+ /**
260
+ * Parse configuration with defaults
261
+ *
262
+ * @param data - Partial configuration data
263
+ * @returns Complete configuration with defaults applied
264
+ * @throws ZodError if validation fails
265
+ */
266
+ export declare function parseConfig(data?: unknown): LumenFlowConfig;
267
+ /**
268
+ * Get default configuration
269
+ *
270
+ * @returns Default LumenFlow configuration
271
+ */
272
+ export declare function getDefaultConfig(): LumenFlowConfig;
@@ -0,0 +1,207 @@
1
+ /**
2
+ * LumenFlow Configuration Schema
3
+ *
4
+ * Zod schemas for LumenFlow configuration.
5
+ * All paths and settings are configurable via .lumenflow.config.yaml
6
+ *
7
+ * @module lumenflow-config-schema
8
+ */
9
+ import { z } from 'zod';
10
+ /**
11
+ * Directory paths configuration
12
+ */
13
+ export const DirectoriesSchema = z.object({
14
+ /** Working directory for web app (default: 'apps/web/') */
15
+ appsWeb: z.string().default('apps/web/'),
16
+ /** Worktrees directory (default: 'worktrees/') */
17
+ worktrees: z.string().default('worktrees/'),
18
+ /** AI assets directory (default: 'ai/') */
19
+ ai: z.string().default('ai/'),
20
+ /** Claude configuration directory (default: '.claude/') */
21
+ claude: z.string().default('.claude/'),
22
+ /** Documentation root (default: 'docs/') */
23
+ docs: z.string().default('docs/'),
24
+ /** Packages directory (default: 'packages/') */
25
+ packages: z.string().default('packages/'),
26
+ /** Tools directory (default: 'tools/') */
27
+ tools: z.string().default('tools/'),
28
+ /** Memory bank directory (default: 'memory-bank/') */
29
+ memoryBank: z.string().default('memory-bank/'),
30
+ /** WU YAML files directory (default: 'docs/04-operations/tasks/wu') */
31
+ wuDir: z.string().default('docs/04-operations/tasks/wu'),
32
+ /** Initiatives directory (default: 'docs/04-operations/tasks/initiatives') */
33
+ initiativesDir: z.string().default('docs/04-operations/tasks/initiatives'),
34
+ /** Backlog file path (default: 'docs/04-operations/tasks/backlog.md') */
35
+ backlogPath: z.string().default('docs/04-operations/tasks/backlog.md'),
36
+ /** Status file path (default: 'docs/04-operations/tasks/status.md') */
37
+ statusPath: z.string().default('docs/04-operations/tasks/status.md'),
38
+ /** Skills directory (default: '.claude/skills') */
39
+ skillsDir: z.string().default('.claude/skills'),
40
+ /** Agents directory (default: '.claude/agents') */
41
+ agentsDir: z.string().default('.claude/agents'),
42
+ });
43
+ /**
44
+ * Beacon paths configuration (.beacon directory structure)
45
+ */
46
+ export const BeaconPathsSchema = z.object({
47
+ /** Base beacon directory (default: '.beacon') */
48
+ base: z.string().default('.beacon'),
49
+ /** State directory (default: '.beacon/state') */
50
+ stateDir: z.string().default('.beacon/state'),
51
+ /** Stamps directory (default: '.beacon/stamps') */
52
+ stampsDir: z.string().default('.beacon/stamps'),
53
+ /** Merge lock file (default: '.beacon/merge.lock') */
54
+ mergeLock: z.string().default('.beacon/merge.lock'),
55
+ /** Telemetry directory (default: '.beacon/telemetry') */
56
+ telemetry: z.string().default('.beacon/telemetry'),
57
+ /** Flow log file (default: '.beacon/flow.log') */
58
+ flowLog: z.string().default('.beacon/flow.log'),
59
+ /** Sessions directory (default: '.beacon/sessions') */
60
+ sessions: z.string().default('.beacon/sessions'),
61
+ /** Incidents directory (default: '.beacon/incidents') */
62
+ incidents: z.string().default('.beacon/incidents'),
63
+ /** Commands log file (default: '.beacon/commands.log') */
64
+ commandsLog: z.string().default('.beacon/commands.log'),
65
+ });
66
+ /**
67
+ * Git configuration
68
+ */
69
+ export const GitConfigSchema = z.object({
70
+ /** Main branch name (default: 'main') */
71
+ mainBranch: z.string().default('main'),
72
+ /** Default remote name (default: 'origin') */
73
+ defaultRemote: z.string().default('origin'),
74
+ /** Lane branch prefix (default: 'lane/') */
75
+ laneBranchPrefix: z.string().default('lane/'),
76
+ /** Temporary branch prefix (default: 'tmp/') */
77
+ tempBranchPrefix: z.string().default('tmp/'),
78
+ /** Real git executable path (default: '/usr/bin/git') */
79
+ realGitPath: z.string().default('/usr/bin/git'),
80
+ /** Maximum commits behind main before requiring rebase */
81
+ maxBranchDrift: z.number().int().positive().default(20),
82
+ /** Warning threshold for branch drift */
83
+ branchDriftWarning: z.number().int().positive().default(15),
84
+ /** Info threshold for branch drift */
85
+ branchDriftInfo: z.number().int().positive().default(10),
86
+ });
87
+ /**
88
+ * WU (Work Unit) configuration
89
+ */
90
+ export const WuConfigSchema = z.object({
91
+ /** WU ID pattern (regex string, default: '^WU-\\d+$') */
92
+ idPattern: z.string().default('^WU-\\d+$'),
93
+ /** Minimum description length (default: 50) */
94
+ minDescriptionLength: z.number().int().nonnegative().default(50),
95
+ /** Maximum commit subject length (default: 100) */
96
+ maxCommitSubject: z.number().int().positive().default(100),
97
+ /** Default priority (default: 'P2') */
98
+ defaultPriority: z.string().default('P2'),
99
+ /** Default status (default: 'ready') */
100
+ defaultStatus: z.string().default('ready'),
101
+ /** Default type (default: 'feature') */
102
+ defaultType: z.string().default('feature'),
103
+ });
104
+ /**
105
+ * Gates configuration
106
+ */
107
+ export const GatesConfigSchema = z.object({
108
+ /** Maximum ESLint warnings allowed (default: 100) */
109
+ maxEslintWarnings: z.number().int().nonnegative().default(100),
110
+ /** Enable coverage gate (default: true) */
111
+ enableCoverage: z.boolean().default(true),
112
+ /** Minimum coverage percentage (default: 90) */
113
+ minCoverage: z.number().min(0).max(100).default(90),
114
+ /** Enable safety-critical tests (default: true) */
115
+ enableSafetyCriticalTests: z.boolean().default(true),
116
+ /** Enable invariants check (default: true) */
117
+ enableInvariants: z.boolean().default(true),
118
+ });
119
+ /**
120
+ * Memory layer configuration
121
+ */
122
+ export const MemoryConfigSchema = z.object({
123
+ /** Memory directory (default: 'memory-bank/') */
124
+ directory: z.string().default('memory-bank/'),
125
+ /** Session TTL in milliseconds (default: 7 days) */
126
+ sessionTtl: z
127
+ .number()
128
+ .int()
129
+ .positive()
130
+ .default(7 * 24 * 60 * 60 * 1000),
131
+ /** Checkpoint TTL in milliseconds (default: 30 days) */
132
+ checkpointTtl: z
133
+ .number()
134
+ .int()
135
+ .positive()
136
+ .default(30 * 24 * 60 * 60 * 1000),
137
+ /** Enable auto-cleanup (default: true) */
138
+ enableAutoCleanup: z.boolean().default(true),
139
+ });
140
+ /**
141
+ * UI configuration
142
+ */
143
+ export const UiConfigSchema = z.object({
144
+ /** Error box width (default: 70) */
145
+ errorBoxWidth: z.number().int().positive().default(70),
146
+ /** Status preview lines (default: 5) */
147
+ statusPreviewLines: z.number().int().positive().default(5),
148
+ /** Readiness box width (default: 50) */
149
+ readinessBoxWidth: z.number().int().positive().default(50),
150
+ });
151
+ /**
152
+ * YAML serialization configuration
153
+ */
154
+ export const YamlConfigSchema = z.object({
155
+ /** Line width for YAML output (default: 100, -1 for no wrap) */
156
+ lineWidth: z.number().int().default(100),
157
+ });
158
+ /**
159
+ * Complete LumenFlow configuration schema
160
+ */
161
+ export const LumenFlowConfigSchema = z.object({
162
+ /** Schema version for future migrations */
163
+ version: z.string().default('1.0.0'),
164
+ /** Directory paths */
165
+ directories: DirectoriesSchema.default(() => DirectoriesSchema.parse({})),
166
+ /** Beacon paths */
167
+ beacon: BeaconPathsSchema.default(() => BeaconPathsSchema.parse({})),
168
+ /** Git configuration */
169
+ git: GitConfigSchema.default(() => GitConfigSchema.parse({})),
170
+ /** WU configuration */
171
+ wu: WuConfigSchema.default(() => WuConfigSchema.parse({})),
172
+ /** Gates configuration */
173
+ gates: GatesConfigSchema.default(() => GatesConfigSchema.parse({})),
174
+ /** Memory layer configuration */
175
+ memory: MemoryConfigSchema.default(() => MemoryConfigSchema.parse({})),
176
+ /** UI configuration */
177
+ ui: UiConfigSchema.default(() => UiConfigSchema.parse({})),
178
+ /** YAML configuration */
179
+ yaml: YamlConfigSchema.default(() => YamlConfigSchema.parse({})),
180
+ });
181
+ /**
182
+ * Validate configuration data
183
+ *
184
+ * @param data - Configuration data to validate
185
+ * @returns Validation result with parsed config or errors
186
+ */
187
+ export function validateConfig(data) {
188
+ return LumenFlowConfigSchema.safeParse(data);
189
+ }
190
+ /**
191
+ * Parse configuration with defaults
192
+ *
193
+ * @param data - Partial configuration data
194
+ * @returns Complete configuration with defaults applied
195
+ * @throws ZodError if validation fails
196
+ */
197
+ export function parseConfig(data = {}) {
198
+ return LumenFlowConfigSchema.parse(data);
199
+ }
200
+ /**
201
+ * Get default configuration
202
+ *
203
+ * @returns Default LumenFlow configuration
204
+ */
205
+ export function getDefaultConfig() {
206
+ return LumenFlowConfigSchema.parse({});
207
+ }
@@ -0,0 +1,95 @@
1
+ /**
2
+ * LumenFlow Configuration Loader
3
+ *
4
+ * Loads and manages LumenFlow configuration from .lumenflow.config.yaml
5
+ * Falls back to sensible defaults if no config file exists.
6
+ *
7
+ * @module lumenflow-config
8
+ */
9
+ import { type LumenFlowConfig } from './lumenflow-config-schema.js';
10
+ /**
11
+ * Find project root by looking for .lumenflow.config.yaml or .git
12
+ *
13
+ * @param startDir - Directory to start searching from
14
+ * @returns Project root path or current working directory
15
+ */
16
+ export declare function findProjectRoot(startDir?: string): string;
17
+ /**
18
+ * Get LumenFlow configuration
19
+ *
20
+ * Loads config from .lumenflow.config.yaml if present, otherwise uses defaults.
21
+ * Configuration is cached for performance.
22
+ *
23
+ * @param options - Options for loading config
24
+ * @param options.projectRoot - Override project root detection
25
+ * @param options.reload - Force reload from disk (bypass cache)
26
+ * @returns LumenFlow configuration
27
+ */
28
+ export declare function getConfig(options?: {
29
+ projectRoot?: string;
30
+ reload?: boolean;
31
+ }): LumenFlowConfig;
32
+ /**
33
+ * Get the project root directory
34
+ *
35
+ * @returns Cached project root or finds it
36
+ */
37
+ export declare function getProjectRoot(): string;
38
+ /**
39
+ * Clear cached configuration
40
+ *
41
+ * Useful for testing or when config file changes
42
+ */
43
+ export declare function clearConfigCache(): void;
44
+ /**
45
+ * Resolve a path relative to project root
46
+ *
47
+ * @param relativePath - Relative path from config
48
+ * @param projectRoot - Optional project root override
49
+ * @returns Absolute path
50
+ */
51
+ export declare function resolvePath(relativePath: string, projectRoot?: string): string;
52
+ /**
53
+ * Get resolved paths for common directories
54
+ *
55
+ * Convenience function that resolves all directory paths to absolute paths
56
+ *
57
+ * @param options - Options
58
+ * @param options.projectRoot - Override project root
59
+ * @returns Object with absolute paths
60
+ */
61
+ export declare function getResolvedPaths(options?: {
62
+ projectRoot?: string;
63
+ }): {
64
+ wuDir: string;
65
+ initiativesDir: string;
66
+ backlogPath: string;
67
+ statusPath: string;
68
+ worktrees: string;
69
+ stampsDir: string;
70
+ stateDir: string;
71
+ skillsDir: string;
72
+ agentsDir: string;
73
+ memoryBank: string;
74
+ };
75
+ /**
76
+ * Validate a config file
77
+ *
78
+ * @param configPath - Path to config file
79
+ * @returns Validation result
80
+ */
81
+ export declare function validateConfigFile(configPath: string): {
82
+ valid: boolean;
83
+ errors: string[];
84
+ config?: LumenFlowConfig;
85
+ };
86
+ /**
87
+ * Create a sample config file
88
+ *
89
+ * @param outputPath - Path to write config file
90
+ * @param options - Options for sample config
91
+ */
92
+ export declare function createSampleConfig(outputPath: string, options?: {
93
+ includeComments?: boolean;
94
+ }): void;
95
+ export type { LumenFlowConfig, Directories, BeaconPaths, GitConfig, WuConfig, GatesConfig, MemoryConfig, UiConfig, YamlConfig, } from './lumenflow-config-schema.js';