@lumenflow/cli 3.12.4 → 3.12.6

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 (125) hide show
  1. package/dist/chunk-2D2VOCA4.js +37 -0
  2. package/dist/chunk-2D5KFYGX.js +284 -0
  3. package/dist/chunk-2GXVIN57.js +14072 -0
  4. package/dist/chunk-2MQ7HZWZ.js +26 -0
  5. package/dist/chunk-2UFQ3A3C.js +643 -0
  6. package/dist/chunk-3RG5ZIWI.js +10 -0
  7. package/dist/chunk-4N74J3UT.js +15 -0
  8. package/dist/chunk-5GTOXFYR.js +392 -0
  9. package/dist/chunk-5VY6MQMC.js +240 -0
  10. package/dist/chunk-67XVPMRY.js +1297 -0
  11. package/dist/chunk-6HO4GWJE.js +164 -0
  12. package/dist/chunk-6W5XHWYV.js +1890 -0
  13. package/dist/chunk-6X4EMYJQ.js +64 -0
  14. package/dist/chunk-6XYXI2NQ.js +772 -0
  15. package/dist/chunk-7ANSOV6Q.js +285 -0
  16. package/dist/chunk-A624LFLB.js +1380 -0
  17. package/dist/chunk-ADN5NHG4.js +126 -0
  18. package/dist/chunk-B7YJYJKG.js +33 -0
  19. package/dist/chunk-CCLHCPKG.js +210 -0
  20. package/dist/chunk-CK36VROC.js +1584 -0
  21. package/dist/chunk-D3UOFRSB.js +81 -0
  22. package/dist/chunk-DFR4DJBM.js +230 -0
  23. package/dist/chunk-DSYBDHYH.js +79 -0
  24. package/dist/chunk-DWMLTXKQ.js +1176 -0
  25. package/dist/chunk-E3REJTAJ.js +28 -0
  26. package/dist/chunk-EA3IVO64.js +633 -0
  27. package/dist/chunk-EK2AKZKD.js +55 -0
  28. package/dist/chunk-ELD7JTTT.js +343 -0
  29. package/dist/chunk-EX6TT2XI.js +195 -0
  30. package/dist/chunk-EXINSFZE.js +82 -0
  31. package/dist/chunk-EZ6ZBYBM.js +510 -0
  32. package/dist/chunk-FBKAPTJ2.js +16 -0
  33. package/dist/chunk-FVLV5RYH.js +1118 -0
  34. package/dist/chunk-GDNSBQVK.js +2485 -0
  35. package/dist/chunk-GPQHMBNN.js +278 -0
  36. package/dist/chunk-GTFJB67L.js +68 -0
  37. package/dist/chunk-HANJXVKW.js +1127 -0
  38. package/dist/chunk-HEVS5YLD.js +269 -0
  39. package/dist/chunk-HMEVZKPQ.js +9 -0
  40. package/dist/chunk-HRGSYNLM.js +3511 -0
  41. package/dist/chunk-ISZR5N4K.js +60 -0
  42. package/dist/chunk-J6SUPR2C.js +226 -0
  43. package/dist/chunk-JERYVEIZ.js +244 -0
  44. package/dist/chunk-JHHWGL2N.js +87 -0
  45. package/dist/chunk-JONWQUB5.js +775 -0
  46. package/dist/chunk-K2DIWWDM.js +1766 -0
  47. package/dist/chunk-KY4PGL5V.js +969 -0
  48. package/dist/chunk-L737LQ4C.js +1285 -0
  49. package/dist/chunk-LFTWYIB2.js +497 -0
  50. package/dist/chunk-LV47RFNJ.js +41 -0
  51. package/dist/chunk-MKSAITI7.js +15 -0
  52. package/dist/chunk-MZ7RKIX4.js +212 -0
  53. package/dist/chunk-NAP6CFSO.js +84 -0
  54. package/dist/chunk-ND6MY37M.js +16 -0
  55. package/dist/chunk-NMG736UR.js +683 -0
  56. package/dist/chunk-NRAXROED.js +32 -0
  57. package/dist/chunk-NRIZR3A7.js +690 -0
  58. package/dist/chunk-NX43BG3M.js +233 -0
  59. package/dist/chunk-O645XLSI.js +297 -0
  60. package/dist/chunk-OMJD6A3S.js +235 -0
  61. package/dist/chunk-QB6SJD4T.js +430 -0
  62. package/dist/chunk-QFSTL4J3.js +276 -0
  63. package/dist/chunk-QLGDFMFX.js +212 -0
  64. package/dist/chunk-RIAAGL2E.js +13 -0
  65. package/dist/chunk-RWO5XMZ6.js +86 -0
  66. package/dist/chunk-RXRKBBSM.js +149 -0
  67. package/dist/chunk-RZOZMML6.js +363 -0
  68. package/dist/chunk-U7I7FS7T.js +113 -0
  69. package/dist/chunk-UI42RODY.js +717 -0
  70. package/dist/chunk-UTVMVSCO.js +519 -0
  71. package/dist/chunk-V6OJGLBA.js +1746 -0
  72. package/dist/chunk-W2JHVH7D.js +152 -0
  73. package/dist/chunk-WD3Y7VQN.js +280 -0
  74. package/dist/chunk-WOCTQ5MS.js +303 -0
  75. package/dist/chunk-WZR3ZUNN.js +696 -0
  76. package/dist/chunk-XGI665H7.js +150 -0
  77. package/dist/chunk-XKY65P2T.js +304 -0
  78. package/dist/chunk-Y4CQZY65.js +57 -0
  79. package/dist/chunk-YFEXKLVE.js +194 -0
  80. package/dist/chunk-YHO3HS5X.js +287 -0
  81. package/dist/chunk-YLS7AZSX.js +738 -0
  82. package/dist/chunk-ZE473AO6.js +49 -0
  83. package/dist/chunk-ZF747T3O.js +644 -0
  84. package/dist/chunk-ZHCZHZH3.js +43 -0
  85. package/dist/chunk-ZZNZX2XY.js +87 -0
  86. package/dist/constants-7QAP3VQ4.js +23 -0
  87. package/dist/dist-IY3UUMWK.js +33 -0
  88. package/dist/init-templates.js +9 -9
  89. package/dist/invariants-runner-W5RGHCSU.js +27 -0
  90. package/dist/lane-lock-6J36HD5O.js +35 -0
  91. package/dist/mem-checkpoint-core-EANG2GVN.js +14 -0
  92. package/dist/mem-signal-core-2LZ2WYHW.js +19 -0
  93. package/dist/memory-store-OLB5FO7K.js +18 -0
  94. package/dist/service-6BYCOCO5.js +13 -0
  95. package/dist/spawn-policy-resolver-NTSZYQ6R.js +17 -0
  96. package/dist/spawn-task-builder-R4E2BHSW.js +22 -0
  97. package/dist/wu-claim.js +2 -2
  98. package/dist/wu-claim.js.map +1 -1
  99. package/dist/wu-done-already-merged.js +12 -5
  100. package/dist/wu-done-already-merged.js.map +1 -1
  101. package/dist/wu-done-gates.js +25 -4
  102. package/dist/wu-done-gates.js.map +1 -1
  103. package/dist/wu-done-ownership.js +6 -1
  104. package/dist/wu-done-ownership.js.map +1 -1
  105. package/dist/wu-done-pr-WLFFFEPJ.js +25 -0
  106. package/dist/wu-done-validation-3J5E36FE.js +30 -0
  107. package/dist/wu-done.js +6 -6
  108. package/dist/wu-done.js.map +1 -1
  109. package/dist/wu-duplicate-id-detector-5S7JHELK.js +232 -0
  110. package/dist/wu-edit-operations.js +58 -17
  111. package/dist/wu-edit-operations.js.map +1 -1
  112. package/dist/wu-edit-validators.js +104 -28
  113. package/dist/wu-edit-validators.js.map +1 -1
  114. package/dist/wu-edit.js +1 -1
  115. package/dist/wu-edit.js.map +1 -1
  116. package/dist/wu-spawn-prompt-builders.js +8 -7
  117. package/dist/wu-spawn-prompt-builders.js.map +1 -1
  118. package/package.json +8 -8
  119. package/packs/sidekick/.turbo/turbo-build.log +1 -1
  120. package/packs/sidekick/package.json +1 -1
  121. package/packs/software-delivery/.turbo/turbo-build.log +1 -1
  122. package/packs/software-delivery/package.json +1 -1
  123. package/templates/core/LUMENFLOW.md.template +1 -1
  124. package/templates/core/ai/onboarding/quick-ref-commands.md.template +3 -3
  125. package/templates/core/ai/onboarding/starting-prompt.md.template +11 -11
@@ -0,0 +1,212 @@
1
+ import {
2
+ INIT_PATTERNS,
3
+ INIT_STATUSES,
4
+ PHASE_STATUSES,
5
+ PRIORITIES
6
+ } from "./chunk-NAP6CFSO.js";
7
+ import {
8
+ INIT_PATHS
9
+ } from "./chunk-ZHCZHZH3.js";
10
+ import {
11
+ parseYAML,
12
+ readWU,
13
+ stringifyYAML
14
+ } from "./chunk-NRIZR3A7.js";
15
+ import {
16
+ WU_PATHS
17
+ } from "./chunk-6HO4GWJE.js";
18
+ import {
19
+ ErrorCodes,
20
+ createError
21
+ } from "./chunk-RXRKBBSM.js";
22
+
23
+ // ../initiatives/dist/initiative-yaml.js
24
+ import { existsSync, readFileSync, writeFileSync, readdirSync } from "fs";
25
+ import path from "path";
26
+
27
+ // ../initiatives/dist/initiative-schema.js
28
+ import { z } from "zod";
29
+ var DATE_PATTERN = INIT_PATTERNS.DATE;
30
+ var InitiativePhaseSchema = z.object({
31
+ /** Phase number (non-negative integer, determines sequence; 0 valid for foundation phases) */
32
+ id: z.number().int().nonnegative({ message: "Phase id must be a non-negative integer" }),
33
+ /** Phase title */
34
+ title: z.string().min(1, { message: "Phase title is required" }),
35
+ /** Phase status */
36
+ status: z.enum(PHASE_STATUSES, {
37
+ error: `Status must be one of: ${PHASE_STATUSES.join(", ")}`
38
+ })
39
+ });
40
+ var InitiativeSchema = z.object({
41
+ /** Initiative identifier (INIT-NNN or INIT-NAME format) */
42
+ id: z.string().regex(INIT_PATTERNS.INIT_ID, { message: "ID must match pattern INIT-NNN or INIT-NAME" }),
43
+ /** Kebab-case unique identifier for URLs and references */
44
+ slug: z.string().regex(INIT_PATTERNS.SLUG, { message: "Slug must be kebab-case (e.g., shock-protocol)" }),
45
+ /** Initiative title */
46
+ title: z.string().min(1, { message: "Title is required" }),
47
+ /** Detailed description (optional) */
48
+ description: z.string().optional(),
49
+ /** Initiative lifecycle status */
50
+ status: z.enum(INIT_STATUSES, {
51
+ error: `Status must be one of: ${INIT_STATUSES.join(", ")}`
52
+ }),
53
+ /** Priority level (optional) */
54
+ priority: z.enum(PRIORITIES, {
55
+ error: `Priority must be one of: ${PRIORITIES.join(", ")}`
56
+ }).optional(),
57
+ /** Owner (team or individual, optional) */
58
+ owner: z.string().optional(),
59
+ /** Creation date (YYYY-MM-DD) */
60
+ created: z.string().regex(DATE_PATTERN, { message: "Created must be YYYY-MM-DD format" }),
61
+ /** Target completion date (optional, YYYY-MM-DD) */
62
+ target_date: z.string().regex(DATE_PATTERN, { message: "Target date must be YYYY-MM-DD format" }).optional(),
63
+ /** Ordered phases within the initiative (optional) */
64
+ phases: z.array(InitiativePhaseSchema).optional(),
65
+ /** Success metrics for completion (optional) */
66
+ success_metrics: z.array(z.string()).optional(),
67
+ /** Labels for cross-cutting concerns (optional) */
68
+ labels: z.array(z.string()).optional(),
69
+ /** Linked WU IDs (optional, bidirectional link with WU.initiative field) */
70
+ wus: z.array(z.string()).optional()
71
+ });
72
+ function validateInitiative(data) {
73
+ return InitiativeSchema.safeParse(data);
74
+ }
75
+
76
+ // ../initiatives/dist/initiative-yaml.js
77
+ function readInitiative(initPath, expectedId) {
78
+ if (!existsSync(initPath)) {
79
+ throw createError(ErrorCodes.INIT_NOT_FOUND, `Initiative file not found: ${initPath}`, {
80
+ path: initPath,
81
+ expectedId
82
+ });
83
+ }
84
+ const text = readFileSync(initPath, { encoding: "utf-8" });
85
+ let rawDoc;
86
+ try {
87
+ rawDoc = parseYAML(text);
88
+ } catch (e) {
89
+ const errorMessage = e instanceof Error ? e.message : String(e);
90
+ throw createError(ErrorCodes.YAML_PARSE_ERROR, `Failed to parse YAML ${initPath}: ${errorMessage}`, {
91
+ path: initPath,
92
+ originalError: errorMessage
93
+ });
94
+ }
95
+ const docWithId = rawDoc;
96
+ if (!docWithId || docWithId.id !== expectedId) {
97
+ throw createError(ErrorCodes.INIT_NOT_FOUND, `Initiative YAML id mismatch. Expected ${expectedId}, found ${docWithId?.id}`, { path: initPath, expectedId, foundId: docWithId?.id });
98
+ }
99
+ const result = validateInitiative(rawDoc);
100
+ if (!result.success) {
101
+ const issues = result.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ");
102
+ throw createError(ErrorCodes.VALIDATION_ERROR, `Initiative validation failed: ${issues}`, {
103
+ path: initPath,
104
+ issues: result.error.issues
105
+ });
106
+ }
107
+ return result.data;
108
+ }
109
+ function writeInitiative(initPath, doc) {
110
+ const out = stringifyYAML(doc);
111
+ writeFileSync(initPath, out, { encoding: "utf-8" });
112
+ }
113
+ function listInitiatives() {
114
+ const dir = INIT_PATHS.INITIATIVES_DIR();
115
+ if (!existsSync(dir)) {
116
+ return [];
117
+ }
118
+ const files = readdirSync(dir).filter((f) => f.endsWith(".yaml") && INIT_PATTERNS.INIT_ID.test(f.replace(".yaml", "")));
119
+ return files.map((f) => {
120
+ const filePath = path.join(dir, f);
121
+ const id = f.replace(".yaml", "");
122
+ try {
123
+ const doc = readInitiative(filePath, id);
124
+ return { id, doc, path: filePath };
125
+ } catch {
126
+ return null;
127
+ }
128
+ }).filter((entry) => entry !== null);
129
+ }
130
+ function findInitiative(ref) {
131
+ const initiatives = listInitiatives();
132
+ const byId = initiatives.find((i) => i.id === ref);
133
+ if (byId)
134
+ return byId;
135
+ const bySlug = initiatives.find((i) => i.doc.slug === ref);
136
+ return bySlug || null;
137
+ }
138
+ function getInitiativeWUs(initRef) {
139
+ const wuDir = WU_PATHS.WU("").replace(/\/[^/]*$/, "");
140
+ if (!existsSync(wuDir)) {
141
+ return [];
142
+ }
143
+ const files = readdirSync(wuDir).filter((f) => f.endsWith(".yaml") && f.startsWith("WU-"));
144
+ const initiative = findInitiative(initRef);
145
+ const matchRefs = initiative ? [initiative.id, initiative.doc.slug].filter(Boolean) : [initRef];
146
+ return files.map((f) => {
147
+ const filePath = path.join(wuDir, f);
148
+ const id = f.replace(".yaml", "");
149
+ try {
150
+ const doc = readWU(filePath, id);
151
+ if (doc.initiative && matchRefs.includes(doc.initiative)) {
152
+ return { id, doc, path: filePath };
153
+ }
154
+ return null;
155
+ } catch {
156
+ return null;
157
+ }
158
+ }).filter((entry) => entry !== null);
159
+ }
160
+ function getInitiativeProgress(initRef) {
161
+ const wus = getInitiativeWUs(initRef);
162
+ const counts = {
163
+ total: wus.length,
164
+ done: 0,
165
+ inProgress: 0,
166
+ blocked: 0,
167
+ ready: 0,
168
+ percentage: 0
169
+ };
170
+ for (const { doc } of wus) {
171
+ switch (doc.status) {
172
+ case "done":
173
+ counts.done++;
174
+ break;
175
+ case "in_progress":
176
+ counts.inProgress++;
177
+ break;
178
+ case "blocked":
179
+ counts.blocked++;
180
+ break;
181
+ case "ready":
182
+ counts.ready++;
183
+ break;
184
+ default:
185
+ break;
186
+ }
187
+ }
188
+ counts.percentage = counts.total > 0 ? Math.round(counts.done / counts.total * 100) : 0;
189
+ return counts;
190
+ }
191
+ function getInitiativePhases(initRef) {
192
+ const wus = getInitiativeWUs(initRef);
193
+ const phases = /* @__PURE__ */ new Map();
194
+ for (const { id, doc } of wus) {
195
+ const phase = doc.phase ?? null;
196
+ if (!phases.has(phase)) {
197
+ phases.set(phase, []);
198
+ }
199
+ phases.get(phase).push({ id, doc });
200
+ }
201
+ return phases;
202
+ }
203
+
204
+ export {
205
+ readInitiative,
206
+ writeInitiative,
207
+ listInitiatives,
208
+ findInitiative,
209
+ getInitiativeWUs,
210
+ getInitiativeProgress,
211
+ getInitiativePhases
212
+ };
@@ -0,0 +1,84 @@
1
+ // ../initiatives/dist/initiative-constants.js
2
+ var INIT_STATUSES = ["draft", "open", "in_progress", "done", "archived"];
3
+ var PHASE_STATUSES = ["pending", "in_progress", "done", "blocked"];
4
+ var PRIORITIES = ["P0", "P1", "P2", "P3"];
5
+ var INIT_PATTERNS = {
6
+ /** Initiative ID format (INIT-NNN where NNN is digits or INIT-NAME for named initiatives) */
7
+ INIT_ID: /^INIT-[\dA-Z][\dA-Z-]*$/,
8
+ /** Extract INIT ID from string */
9
+ INIT_ID_EXTRACT: /INIT-[\dA-Z][\dA-Z-]*/,
10
+ /** Kebab-case slug format */
11
+ // eslint-disable-next-line security/detect-unsafe-regex -- static slug pattern; no backtracking risk
12
+ SLUG: /^[a-z0-9]+(-[a-z0-9]+)*$/,
13
+ /** Date format (YYYY-MM-DD) */
14
+ DATE: /^\d{4}-\d{2}-\d{2}$/
15
+ };
16
+ var INIT_COMMIT_FORMATS = {
17
+ /**
18
+ * Create initiative commit message
19
+ * @param id - Initiative ID
20
+ * @param title - Initiative title
21
+ * @returns Commit message
22
+ */
23
+ CREATE: (id, title) => {
24
+ const shortTitle = title.length > 50 ? `${title.substring(0, 47)}...` : title;
25
+ return `docs: create ${id.toLowerCase()} for ${shortTitle.toLowerCase()}`;
26
+ },
27
+ /**
28
+ * Update initiative commit message
29
+ * @param id - Initiative ID
30
+ * @returns Commit message
31
+ */
32
+ UPDATE: (id) => `docs: update ${id.toLowerCase()}`,
33
+ /**
34
+ * Link WU to initiative commit message
35
+ * @param wuId - WU ID
36
+ * @param initId - Initiative ID
37
+ * @returns Commit message
38
+ */
39
+ LINK_WU: (wuId, initId) => `docs: link ${wuId.toLowerCase()} to ${initId.toLowerCase()}`,
40
+ /**
41
+ * Unlink WU from initiative commit message (WU-1328)
42
+ * @param wuId - WU ID
43
+ * @param initId - Initiative ID
44
+ * @returns Commit message
45
+ */
46
+ UNLINK_WU: (wuId, initId) => `docs: unlink ${wuId.toLowerCase()} from ${initId.toLowerCase()}`,
47
+ /**
48
+ * Edit initiative commit message (WU-1451)
49
+ * @param id - Initiative ID
50
+ * @returns Commit message
51
+ */
52
+ EDIT: (id) => `docs: edit ${id.toLowerCase()}`
53
+ };
54
+ var INIT_LOG_PREFIX = {
55
+ CREATE: "[initiative:create]",
56
+ LIST: "[initiative:list]",
57
+ STATUS: "[initiative:status]",
58
+ ADD_WU: "[initiative:add-wu]",
59
+ REMOVE_WU: "[initiative:remove-wu]",
60
+ // WU-1328: Remove WU from initiative
61
+ EDIT: "[initiative:edit]"
62
+ // WU-1451: Initiative edit operation
63
+ };
64
+ var INIT_DEFAULTS = {
65
+ STATUS: "draft",
66
+ PRIORITY: "P2"
67
+ };
68
+ var OUTPUT_FORMATS = {
69
+ TABLE: "table",
70
+ JSON: "json",
71
+ ASCII: "ascii",
72
+ MERMAID: "mermaid"
73
+ };
74
+
75
+ export {
76
+ INIT_STATUSES,
77
+ PHASE_STATUSES,
78
+ PRIORITIES,
79
+ INIT_PATTERNS,
80
+ INIT_COMMIT_FORMATS,
81
+ INIT_LOG_PREFIX,
82
+ INIT_DEFAULTS,
83
+ OUTPUT_FORMATS
84
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ LUMENFLOW_MEMORY_PATHS
3
+ } from "./chunk-4N74J3UT.js";
4
+
5
+ // ../memory/dist/fs-utils.js
6
+ import fs from "fs/promises";
7
+ import path from "path";
8
+ async function ensureMemoryDir(baseDir) {
9
+ const memoryDir = path.join(baseDir, LUMENFLOW_MEMORY_PATHS.MEMORY_DIR);
10
+ await fs.mkdir(memoryDir, { recursive: true });
11
+ return memoryDir;
12
+ }
13
+
14
+ export {
15
+ ensureMemoryDir
16
+ };