@lumenflow/cli 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.
- package/LICENSE +190 -0
- package/README.md +116 -0
- package/dist/gates.d.ts +41 -0
- package/dist/gates.d.ts.map +1 -0
- package/dist/gates.js +684 -0
- package/dist/gates.js.map +1 -0
- package/dist/initiative-add-wu.d.ts +22 -0
- package/dist/initiative-add-wu.d.ts.map +1 -0
- package/dist/initiative-add-wu.js +234 -0
- package/dist/initiative-add-wu.js.map +1 -0
- package/dist/initiative-create.d.ts +28 -0
- package/dist/initiative-create.d.ts.map +1 -0
- package/dist/initiative-create.js +172 -0
- package/dist/initiative-create.js.map +1 -0
- package/dist/initiative-edit.d.ts +34 -0
- package/dist/initiative-edit.d.ts.map +1 -0
- package/dist/initiative-edit.js +440 -0
- package/dist/initiative-edit.js.map +1 -0
- package/dist/initiative-list.d.ts +12 -0
- package/dist/initiative-list.d.ts.map +1 -0
- package/dist/initiative-list.js +101 -0
- package/dist/initiative-list.js.map +1 -0
- package/dist/initiative-status.d.ts +11 -0
- package/dist/initiative-status.d.ts.map +1 -0
- package/dist/initiative-status.js +221 -0
- package/dist/initiative-status.js.map +1 -0
- package/dist/mem-checkpoint.d.ts +16 -0
- package/dist/mem-checkpoint.d.ts.map +1 -0
- package/dist/mem-checkpoint.js +237 -0
- package/dist/mem-checkpoint.js.map +1 -0
- package/dist/mem-cleanup.d.ts +29 -0
- package/dist/mem-cleanup.d.ts.map +1 -0
- package/dist/mem-cleanup.js +267 -0
- package/dist/mem-cleanup.js.map +1 -0
- package/dist/mem-create.d.ts +17 -0
- package/dist/mem-create.d.ts.map +1 -0
- package/dist/mem-create.js +265 -0
- package/dist/mem-create.js.map +1 -0
- package/dist/mem-inbox.d.ts +35 -0
- package/dist/mem-inbox.d.ts.map +1 -0
- package/dist/mem-inbox.js +373 -0
- package/dist/mem-inbox.js.map +1 -0
- package/dist/mem-init.d.ts +15 -0
- package/dist/mem-init.d.ts.map +1 -0
- package/dist/mem-init.js +146 -0
- package/dist/mem-init.js.map +1 -0
- package/dist/mem-ready.d.ts +16 -0
- package/dist/mem-ready.d.ts.map +1 -0
- package/dist/mem-ready.js +224 -0
- package/dist/mem-ready.js.map +1 -0
- package/dist/mem-signal.d.ts +16 -0
- package/dist/mem-signal.d.ts.map +1 -0
- package/dist/mem-signal.js +204 -0
- package/dist/mem-signal.js.map +1 -0
- package/dist/mem-start.d.ts +16 -0
- package/dist/mem-start.d.ts.map +1 -0
- package/dist/mem-start.js +158 -0
- package/dist/mem-start.js.map +1 -0
- package/dist/mem-summarize.d.ts +22 -0
- package/dist/mem-summarize.d.ts.map +1 -0
- package/dist/mem-summarize.js +213 -0
- package/dist/mem-summarize.js.map +1 -0
- package/dist/mem-triage.d.ts +22 -0
- package/dist/mem-triage.d.ts.map +1 -0
- package/dist/mem-triage.js +328 -0
- package/dist/mem-triage.js.map +1 -0
- package/dist/spawn-list.d.ts +16 -0
- package/dist/spawn-list.d.ts.map +1 -0
- package/dist/spawn-list.js +140 -0
- package/dist/spawn-list.js.map +1 -0
- package/dist/wu-block.d.ts +16 -0
- package/dist/wu-block.d.ts.map +1 -0
- package/dist/wu-block.js +241 -0
- package/dist/wu-block.js.map +1 -0
- package/dist/wu-claim.d.ts +32 -0
- package/dist/wu-claim.d.ts.map +1 -0
- package/dist/wu-claim.js +1106 -0
- package/dist/wu-claim.js.map +1 -0
- package/dist/wu-cleanup.d.ts +17 -0
- package/dist/wu-cleanup.d.ts.map +1 -0
- package/dist/wu-cleanup.js +194 -0
- package/dist/wu-cleanup.js.map +1 -0
- package/dist/wu-create.d.ts +38 -0
- package/dist/wu-create.d.ts.map +1 -0
- package/dist/wu-create.js +520 -0
- package/dist/wu-create.js.map +1 -0
- package/dist/wu-deps.d.ts +13 -0
- package/dist/wu-deps.d.ts.map +1 -0
- package/dist/wu-deps.js +119 -0
- package/dist/wu-deps.js.map +1 -0
- package/dist/wu-done.d.ts +153 -0
- package/dist/wu-done.d.ts.map +1 -0
- package/dist/wu-done.js +2096 -0
- package/dist/wu-done.js.map +1 -0
- package/dist/wu-edit.d.ts +29 -0
- package/dist/wu-edit.d.ts.map +1 -0
- package/dist/wu-edit.js +852 -0
- package/dist/wu-edit.js.map +1 -0
- package/dist/wu-infer-lane.d.ts +17 -0
- package/dist/wu-infer-lane.d.ts.map +1 -0
- package/dist/wu-infer-lane.js +135 -0
- package/dist/wu-infer-lane.js.map +1 -0
- package/dist/wu-preflight.d.ts +47 -0
- package/dist/wu-preflight.d.ts.map +1 -0
- package/dist/wu-preflight.js +167 -0
- package/dist/wu-preflight.js.map +1 -0
- package/dist/wu-prune.d.ts +16 -0
- package/dist/wu-prune.d.ts.map +1 -0
- package/dist/wu-prune.js +259 -0
- package/dist/wu-prune.js.map +1 -0
- package/dist/wu-repair.d.ts +60 -0
- package/dist/wu-repair.d.ts.map +1 -0
- package/dist/wu-repair.js +226 -0
- package/dist/wu-repair.js.map +1 -0
- package/dist/wu-spawn-completion.d.ts +10 -0
- package/dist/wu-spawn-completion.js +30 -0
- package/dist/wu-spawn.d.ts +168 -0
- package/dist/wu-spawn.d.ts.map +1 -0
- package/dist/wu-spawn.js +1327 -0
- package/dist/wu-spawn.js.map +1 -0
- package/dist/wu-unblock.d.ts +16 -0
- package/dist/wu-unblock.d.ts.map +1 -0
- package/dist/wu-unblock.js +234 -0
- package/dist/wu-unblock.js.map +1 -0
- package/dist/wu-validate.d.ts +16 -0
- package/dist/wu-validate.d.ts.map +1 -0
- package/dist/wu-validate.js +193 -0
- package/dist/wu-validate.js.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* WU Spawn Helper
|
|
4
|
+
*
|
|
5
|
+
* Generates ready-to-use Task tool invocations for sub-agent WU execution.
|
|
6
|
+
* Includes context loading preamble, skills selection guidance, and constraints block.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm wu:spawn --id WU-123
|
|
10
|
+
* pnpm wu:spawn --id WU-123 --codex
|
|
11
|
+
*
|
|
12
|
+
* Output:
|
|
13
|
+
* A complete Task tool invocation block with:
|
|
14
|
+
* - Context loading preamble (CLAUDE-core.md, README, lumenflow, WU YAML)
|
|
15
|
+
* - WU details and acceptance criteria
|
|
16
|
+
* - Skills Selection section (sub-agent reads catalogue and selects at runtime)
|
|
17
|
+
* - Mandatory agent advisory
|
|
18
|
+
* - Constraints block at end (Lost in the Middle research)
|
|
19
|
+
*
|
|
20
|
+
* Skills Selection:
|
|
21
|
+
* This command is AGENT-FACING. Unlike /wu-prompt (human-facing, skills selected
|
|
22
|
+
* at generation time), wu:spawn instructs the sub-agent to read the skill catalogue
|
|
23
|
+
* and select skills at execution time based on WU context.
|
|
24
|
+
*
|
|
25
|
+
* Codex Mode:
|
|
26
|
+
* When --codex is used, outputs a Codex/GPT-friendly Markdown prompt (no antml/XML escaping).
|
|
27
|
+
*
|
|
28
|
+
* @see {@link ai/onboarding/agent-invocation-guide.md} - Context loading templates
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Generate effort scaling rules section (WU-1986)
|
|
32
|
+
*
|
|
33
|
+
* Based on Anthropic multi-agent research: helps agents decide when to
|
|
34
|
+
* spawn sub-agents vs handle inline.
|
|
35
|
+
*
|
|
36
|
+
* @returns {string} Effort scaling section
|
|
37
|
+
*/
|
|
38
|
+
export declare function generateEffortScalingRules(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Generate parallel tool call guidance (WU-1986)
|
|
41
|
+
*
|
|
42
|
+
* Based on Anthropic research: 3+ parallel tool calls significantly improve performance.
|
|
43
|
+
*
|
|
44
|
+
* @returns {string} Parallel tool call guidance
|
|
45
|
+
*/
|
|
46
|
+
export declare function generateParallelToolCallGuidance(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Generate iterative search heuristics (WU-1986)
|
|
49
|
+
*
|
|
50
|
+
* Based on Anthropic research: start broad, narrow focus.
|
|
51
|
+
*
|
|
52
|
+
* @returns {string} Search heuristics section
|
|
53
|
+
*/
|
|
54
|
+
export declare function generateIterativeSearchHeuristics(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Generate token budget awareness section (WU-1986)
|
|
57
|
+
*
|
|
58
|
+
* @param {string} id - WU ID
|
|
59
|
+
* @returns {string} Token budget section
|
|
60
|
+
*/
|
|
61
|
+
export declare function generateTokenBudgetAwareness(id: any): string;
|
|
62
|
+
/**
|
|
63
|
+
* Generate structured completion format (WU-1986)
|
|
64
|
+
*
|
|
65
|
+
* @param {string} id - WU ID
|
|
66
|
+
* @returns {string} Completion format section
|
|
67
|
+
*/
|
|
68
|
+
export declare function generateCompletionFormat(_id: any): string;
|
|
69
|
+
/**
|
|
70
|
+
* Generate agent coordination section (WU-1987)
|
|
71
|
+
*
|
|
72
|
+
* Provides guidance on mem:signal for parallel agent coordination,
|
|
73
|
+
* orchestrate:status for dashboard checks, and abandoned WU handling.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} id - WU ID
|
|
76
|
+
* @returns {string} Agent coordination section
|
|
77
|
+
*/
|
|
78
|
+
export declare function generateAgentCoordinationSection(id: any): string;
|
|
79
|
+
/**
|
|
80
|
+
* Generate quick fix commands section (WU-1987)
|
|
81
|
+
*
|
|
82
|
+
* Provides format/lint/typecheck commands for quick fixes before gates.
|
|
83
|
+
*
|
|
84
|
+
* @returns {string} Quick fix commands section
|
|
85
|
+
*/
|
|
86
|
+
export declare function generateQuickFixCommands(): string;
|
|
87
|
+
/**
|
|
88
|
+
* Generate Lane Selection section (WU-2107)
|
|
89
|
+
*
|
|
90
|
+
* Provides guidance on lane selection when creating new WUs.
|
|
91
|
+
* Points agents to wu:infer-lane for automated lane suggestions.
|
|
92
|
+
*
|
|
93
|
+
* @returns {string} Lane Selection section
|
|
94
|
+
*/
|
|
95
|
+
export declare function generateLaneSelectionSection(): string;
|
|
96
|
+
/**
|
|
97
|
+
* Generate Worktree Path Guidance section (WU-2362)
|
|
98
|
+
*
|
|
99
|
+
* Provides guidance for sub-agents on working within worktrees, including
|
|
100
|
+
* how to determine the worktree root and where to create stamps.
|
|
101
|
+
*
|
|
102
|
+
* Problem: CLAUDE_PROJECT_DIR is hook-only; sub-agents inherit parent cwd (main).
|
|
103
|
+
* Solution: Use git rev-parse --show-toplevel to determine actual worktree root.
|
|
104
|
+
*
|
|
105
|
+
* @param {string|undefined} worktreePath - Worktree path from WU YAML
|
|
106
|
+
* @returns {string} Worktree path guidance section
|
|
107
|
+
*/
|
|
108
|
+
export declare function generateWorktreePathGuidance(worktreePath: any): string;
|
|
109
|
+
/**
|
|
110
|
+
* Generate the Action section based on WU claim status (WU-1745).
|
|
111
|
+
*
|
|
112
|
+
* If WU is already claimed (has claimed_at and worktree_path), tells agent
|
|
113
|
+
* to continue in the existing worktree.
|
|
114
|
+
*
|
|
115
|
+
* If WU is unclaimed (status: ready), tells agent to run wu:claim first.
|
|
116
|
+
*
|
|
117
|
+
* @param {object} doc - WU YAML document
|
|
118
|
+
* @param {string} id - WU ID
|
|
119
|
+
* @returns {string} Action section content
|
|
120
|
+
*/
|
|
121
|
+
export declare function generateActionSection(doc: any, id: any): string;
|
|
122
|
+
/**
|
|
123
|
+
* Generate the Completion Workflow section for sub-agents (WU-2682).
|
|
124
|
+
*
|
|
125
|
+
* Explicitly instructs sub-agents to run wu:done autonomously after gates pass.
|
|
126
|
+
* This prevents agents from asking permission instead of completing.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} id - WU ID
|
|
129
|
+
* @returns {string} Completion Workflow section
|
|
130
|
+
*/
|
|
131
|
+
export declare function generateCompletionWorkflowSection(id: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Generate the complete Task tool invocation
|
|
134
|
+
*
|
|
135
|
+
* @param {object} doc - WU YAML document
|
|
136
|
+
* @param {string} id - WU ID
|
|
137
|
+
* @param {object} [options={}] - Thinking mode options
|
|
138
|
+
* @param {boolean} [options.thinking] - Whether extended thinking is enabled
|
|
139
|
+
* @param {boolean} [options.noThinking] - Whether thinking is explicitly disabled
|
|
140
|
+
* @param {string} [options.budget] - Token budget for thinking
|
|
141
|
+
* @returns {string} Complete Task tool invocation
|
|
142
|
+
*/
|
|
143
|
+
export declare function generateTaskInvocation(doc: any, id: any, options?: {}): string;
|
|
144
|
+
export declare function generateCodexPrompt(doc: any, id: any, options?: {}): string;
|
|
145
|
+
/**
|
|
146
|
+
* WU-1603: Check if a lane is currently occupied by another WU
|
|
147
|
+
*
|
|
148
|
+
* @param {string} lane - Lane name (e.g., "Operations: Tooling")
|
|
149
|
+
* @returns {import('@lumenflow/core/dist/lane-lock.js').LockMetadata|null} Lock metadata if occupied, null otherwise
|
|
150
|
+
*/
|
|
151
|
+
export declare function checkLaneOccupation(lane: any): import("@lumenflow/core/dist/lane-lock.js").LockMetadata;
|
|
152
|
+
/**
|
|
153
|
+
* WU-1603: Generate a warning message when lane is occupied
|
|
154
|
+
*
|
|
155
|
+
* @param {import('@lumenflow/core/dist/lane-lock.js').LockMetadata} lockMetadata - Lock metadata
|
|
156
|
+
* @param {string} targetWuId - WU ID being spawned
|
|
157
|
+
* @param {Object} [options={}] - Options
|
|
158
|
+
* @param {boolean} [options.isStale] - Whether the lock is stale (>24h old)
|
|
159
|
+
* @returns {string} Warning message
|
|
160
|
+
*/
|
|
161
|
+
interface LaneOccupationOptions {
|
|
162
|
+
isStale?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export declare function generateLaneOccupationWarning(lockMetadata: {
|
|
165
|
+
lane: string;
|
|
166
|
+
wuId: string;
|
|
167
|
+
}, targetWuId: string, options?: LaneOccupationOptions): string;
|
|
168
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wu-spawn.d.ts","sourceRoot":"","sources":["../src/wu-spawn.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAsdH;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,WAazC;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,WAe/C;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,WAWhD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,KAAA,UAU9C;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,KAAA,UA0B3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,EAAE,KAAA,UAsClD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,WAYvC;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,WAgB3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,KAAA,UAyCxD;AAyFD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,KAAA,EAAE,EAAE,KAAA,UA4B5C;AAuHD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,KAAA,EAAE,EAAE,KAAA,EAAE,OAAO,KAAK,UAkK3D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,KAAA,EAAE,EAAE,KAAA,EAAE,OAAO,KAAK,UA2ExD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,KAAA,OAMvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,KAAA,EAAE,UAAU,KAAA,EAAE,OAAO,KAAK,UAiBnF"}
|