@lumenflow/cli 2.3.2 → 2.5.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 (135) hide show
  1. package/dist/__tests__/init-config-lanes.test.js +131 -0
  2. package/dist/__tests__/init-docs-structure.test.js +119 -0
  3. package/dist/__tests__/init-lane-inference.test.js +125 -0
  4. package/dist/__tests__/init-onboarding-docs.test.js +132 -0
  5. package/dist/__tests__/init-quick-ref.test.js +145 -0
  6. package/dist/__tests__/init-scripts.test.js +96 -0
  7. package/dist/__tests__/init-template-portability.test.js +97 -0
  8. package/dist/__tests__/init.test.js +199 -3
  9. package/dist/__tests__/initiative-add-wu.test.js +420 -0
  10. package/dist/__tests__/initiative-plan-replacement.test.js +162 -0
  11. package/dist/__tests__/initiative-remove-wu.test.js +458 -0
  12. package/dist/__tests__/onboarding-smoke-test.test.js +211 -0
  13. package/dist/__tests__/path-centralization-cli.test.js +234 -0
  14. package/dist/__tests__/plan-create.test.js +126 -0
  15. package/dist/__tests__/plan-edit.test.js +157 -0
  16. package/dist/__tests__/plan-link.test.js +239 -0
  17. package/dist/__tests__/plan-promote.test.js +181 -0
  18. package/dist/__tests__/wu-create-strict.test.js +118 -0
  19. package/dist/__tests__/wu-edit-strict.test.js +109 -0
  20. package/dist/__tests__/wu-validate-strict.test.js +113 -0
  21. package/dist/flow-bottlenecks.js +4 -2
  22. package/dist/flow-report.js +3 -2
  23. package/dist/gates.js +202 -2
  24. package/dist/init.js +720 -40
  25. package/dist/initiative-add-wu.js +112 -16
  26. package/dist/initiative-plan.js +3 -2
  27. package/dist/initiative-remove-wu.js +248 -0
  28. package/dist/mem-context.js +0 -0
  29. package/dist/metrics-snapshot.js +3 -2
  30. package/dist/onboarding-smoke-test.js +400 -0
  31. package/dist/plan-create.js +199 -0
  32. package/dist/plan-edit.js +235 -0
  33. package/dist/plan-link.js +233 -0
  34. package/dist/plan-promote.js +231 -0
  35. package/dist/rotate-progress.js +8 -5
  36. package/dist/spawn-list.js +4 -3
  37. package/dist/state-bootstrap.js +6 -4
  38. package/dist/state-doctor-fix.js +5 -4
  39. package/dist/state-doctor.js +32 -2
  40. package/dist/trace-gen.js +6 -3
  41. package/dist/wu-block.js +16 -5
  42. package/dist/wu-claim.js +15 -9
  43. package/dist/wu-create.js +50 -2
  44. package/dist/wu-deps.js +3 -1
  45. package/dist/wu-done.js +14 -5
  46. package/dist/wu-edit.js +35 -0
  47. package/dist/wu-infer-lane.js +3 -1
  48. package/dist/wu-spawn.js +8 -0
  49. package/dist/wu-unblock.js +34 -2
  50. package/dist/wu-validate.js +25 -17
  51. package/package.json +12 -6
  52. package/templates/core/AGENTS.md.template +2 -2
  53. package/dist/__tests__/init-plan.test.js +0 -340
  54. package/dist/agent-issues-query.d.ts +0 -16
  55. package/dist/agent-log-issue.d.ts +0 -10
  56. package/dist/agent-session-end.d.ts +0 -10
  57. package/dist/agent-session.d.ts +0 -10
  58. package/dist/backlog-prune.d.ts +0 -84
  59. package/dist/cli-entry-point.d.ts +0 -8
  60. package/dist/deps-add.d.ts +0 -91
  61. package/dist/deps-remove.d.ts +0 -17
  62. package/dist/docs-sync.d.ts +0 -50
  63. package/dist/file-delete.d.ts +0 -84
  64. package/dist/file-edit.d.ts +0 -82
  65. package/dist/file-read.d.ts +0 -92
  66. package/dist/file-write.d.ts +0 -90
  67. package/dist/flow-bottlenecks.d.ts +0 -16
  68. package/dist/flow-report.d.ts +0 -16
  69. package/dist/gates.d.ts +0 -94
  70. package/dist/git-branch.d.ts +0 -65
  71. package/dist/git-diff.d.ts +0 -58
  72. package/dist/git-log.d.ts +0 -69
  73. package/dist/git-status.d.ts +0 -58
  74. package/dist/guard-locked.d.ts +0 -62
  75. package/dist/guard-main-branch.d.ts +0 -50
  76. package/dist/guard-worktree-commit.d.ts +0 -59
  77. package/dist/index.d.ts +0 -10
  78. package/dist/init-plan.d.ts +0 -80
  79. package/dist/init-plan.js +0 -337
  80. package/dist/init.d.ts +0 -46
  81. package/dist/initiative-add-wu.d.ts +0 -22
  82. package/dist/initiative-bulk-assign-wus.d.ts +0 -16
  83. package/dist/initiative-create.d.ts +0 -28
  84. package/dist/initiative-edit.d.ts +0 -34
  85. package/dist/initiative-list.d.ts +0 -12
  86. package/dist/initiative-status.d.ts +0 -11
  87. package/dist/lumenflow-upgrade.d.ts +0 -103
  88. package/dist/mem-checkpoint.d.ts +0 -16
  89. package/dist/mem-cleanup.d.ts +0 -29
  90. package/dist/mem-create.d.ts +0 -17
  91. package/dist/mem-export.d.ts +0 -10
  92. package/dist/mem-inbox.d.ts +0 -35
  93. package/dist/mem-init.d.ts +0 -15
  94. package/dist/mem-ready.d.ts +0 -16
  95. package/dist/mem-signal.d.ts +0 -16
  96. package/dist/mem-start.d.ts +0 -16
  97. package/dist/mem-summarize.d.ts +0 -22
  98. package/dist/mem-triage.d.ts +0 -22
  99. package/dist/metrics-cli.d.ts +0 -90
  100. package/dist/metrics-snapshot.d.ts +0 -18
  101. package/dist/orchestrate-init-status.d.ts +0 -11
  102. package/dist/orchestrate-initiative.d.ts +0 -12
  103. package/dist/orchestrate-monitor.d.ts +0 -11
  104. package/dist/release.d.ts +0 -117
  105. package/dist/rotate-progress.d.ts +0 -48
  106. package/dist/session-coordinator.d.ts +0 -74
  107. package/dist/spawn-list.d.ts +0 -16
  108. package/dist/state-bootstrap.d.ts +0 -92
  109. package/dist/sync-templates.d.ts +0 -52
  110. package/dist/trace-gen.d.ts +0 -84
  111. package/dist/validate-agent-skills.d.ts +0 -50
  112. package/dist/validate-agent-sync.d.ts +0 -36
  113. package/dist/validate-backlog-sync.d.ts +0 -37
  114. package/dist/validate-skills-spec.d.ts +0 -40
  115. package/dist/validate.d.ts +0 -60
  116. package/dist/wu-block.d.ts +0 -16
  117. package/dist/wu-claim.d.ts +0 -74
  118. package/dist/wu-cleanup.d.ts +0 -35
  119. package/dist/wu-create.d.ts +0 -69
  120. package/dist/wu-delete.d.ts +0 -21
  121. package/dist/wu-deps.d.ts +0 -13
  122. package/dist/wu-done.d.ts +0 -225
  123. package/dist/wu-edit.d.ts +0 -63
  124. package/dist/wu-infer-lane.d.ts +0 -17
  125. package/dist/wu-preflight.d.ts +0 -47
  126. package/dist/wu-prune.d.ts +0 -16
  127. package/dist/wu-recover.d.ts +0 -37
  128. package/dist/wu-release.d.ts +0 -19
  129. package/dist/wu-repair.d.ts +0 -60
  130. package/dist/wu-spawn-completion.d.ts +0 -10
  131. package/dist/wu-spawn.d.ts +0 -192
  132. package/dist/wu-status.d.ts +0 -25
  133. package/dist/wu-unblock.d.ts +0 -16
  134. package/dist/wu-unlock-lane.d.ts +0 -19
  135. package/dist/wu-validate.d.ts +0 -16
package/dist/gates.d.ts DELETED
@@ -1,94 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Quality Gates Runner
4
- *
5
- * Runs quality gates with support for docs-only mode and incremental linting.
6
- *
7
- * WU-1304: Optimise ESLint gates performance
8
- * - Uses incremental linting (only files changed since branching from main)
9
- * - Full lint coverage maintained via CI workflow
10
- *
11
- * WU-1433: Coverage gate with mode flag
12
- * - Checks coverage thresholds for hex core files (≥90% for application layer)
13
- * - Mode: block (default) fails the gate, warn logs warnings only
14
- * WU-2334: Changed default from warn to block for TDD enforcement
15
- *
16
- * WU-1610: Supabase docs linter
17
- * - Verifies every table in migrations is documented in schema.md
18
- * - Fails if any table is missing documentation
19
- *
20
- * For type:documentation WUs:
21
- * - ✅ Run: format:check, spec:linter, prompts:lint, backlog-sync
22
- * - ❌ Skip: lint, typecheck, supabase-docs:linter, tests, coverage (no code changed)
23
- *
24
- * WU-1920: Incremental test execution
25
- * - Uses Vitest's --changed flag to run only tests for changed files
26
- * - Full test suite maintained via CI workflow and --full-tests flag
27
- *
28
- * WU-2062: Tiered test execution for faster wu:done
29
- * - Safety-critical tests (PHI, escalation, red-flag) ALWAYS run
30
- * - Docs-only WUs: lint/typecheck only (auto-detected or --docs-only flag)
31
- * - High-risk WUs (auth, PHI, RLS, migrations): run integration tests
32
- * - Standard WUs: changed tests + safety-critical tests
33
- *
34
- * Usage:
35
- * node tools/gates.mjs # Tiered gates (default)
36
- * node tools/gates.mjs --docs-only # Docs-only gates
37
- * node tools/gates.mjs --full-lint # Full lint (bypass incremental)
38
- * node tools/gates.mjs --full-tests # Full tests (bypass incremental)
39
- * node tools/gates.mjs --coverage-mode=block # Coverage gate in block mode
40
- */
41
- /**
42
- * WU-1087: Gates-specific option definitions for createWUParser.
43
- * Exported for testing and consistency with other CLI commands.
44
- */
45
- export declare const GATES_OPTIONS: {
46
- docsOnly: {
47
- name: string;
48
- flags: string;
49
- description: string;
50
- };
51
- fullLint: {
52
- name: string;
53
- flags: string;
54
- description: string;
55
- };
56
- fullTests: {
57
- name: string;
58
- flags: string;
59
- description: string;
60
- };
61
- fullCoverage: {
62
- name: string;
63
- flags: string;
64
- description: string;
65
- };
66
- coverageMode: {
67
- name: string;
68
- flags: string;
69
- description: string;
70
- default: string;
71
- };
72
- verbose: {
73
- name: string;
74
- flags: string;
75
- description: string;
76
- };
77
- };
78
- /**
79
- * WU-1087: Parse gates options using createWUParser for consistency.
80
- * Handles pnpm's `--` separator and provides automatic --help support.
81
- *
82
- * @returns Parsed options object
83
- */
84
- export declare function parseGatesOptions(): {
85
- docsOnly?: boolean;
86
- fullLint?: boolean;
87
- fullTests?: boolean;
88
- fullCoverage?: boolean;
89
- coverageMode: string;
90
- verbose?: boolean;
91
- };
92
- export declare function parsePrettierListOutput(output: string): string[];
93
- export declare function buildPrettierWriteCommand(files: string[]): string;
94
- export declare function formatFormatCheckGuidance(files: string[]): string[];
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Git Branch CLI Tool
4
- *
5
- * Provides WU-aware git branch with:
6
- * - Branch listing (local, remote, all)
7
- * - Current branch detection
8
- * - Contains filtering
9
- *
10
- * Usage:
11
- * node git-branch.js [--list] [-a] [-r] [--show-current]
12
- *
13
- * WU-1109: INIT-003 Phase 4b - Migrate git operations
14
- */
15
- /**
16
- * Arguments for git branch operation
17
- */
18
- export interface GitBranchArgs {
19
- /** Base directory for git operations */
20
- baseDir?: string;
21
- /** List branches */
22
- list?: boolean;
23
- /** Show all branches (local and remote) */
24
- all?: boolean;
25
- /** Show only remote branches */
26
- remotes?: boolean;
27
- /** Show current branch only */
28
- showCurrent?: boolean;
29
- /** Filter branches containing commit */
30
- contains?: string;
31
- /** Show help */
32
- help?: boolean;
33
- }
34
- /**
35
- * Branch information
36
- */
37
- export interface BranchInfo {
38
- /** Branch name */
39
- name: string;
40
- /** Whether this is the current branch */
41
- isCurrent: boolean;
42
- /** Whether this is a remote branch */
43
- isRemote: boolean;
44
- }
45
- /**
46
- * Result of git branch operation
47
- */
48
- export interface GitBranchResult {
49
- /** Whether operation succeeded */
50
- success: boolean;
51
- /** Error message (if failed) */
52
- error?: string;
53
- /** Current branch name */
54
- current?: string;
55
- /** List of branches */
56
- branches?: BranchInfo[];
57
- }
58
- /**
59
- * Parse command line arguments for git-branch
60
- */
61
- export declare function parseGitBranchArgs(argv: string[]): GitBranchArgs;
62
- /**
63
- * Get git branch information
64
- */
65
- export declare function getGitBranch(args: GitBranchArgs): Promise<GitBranchResult>;
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Git Diff CLI Tool
4
- *
5
- * Provides WU-aware git diff with:
6
- * - Staged/cached diff support
7
- * - Name-only and stat output modes
8
- * - File filtering
9
- *
10
- * Usage:
11
- * node git-diff.js [ref] [--staged] [--name-only] [--stat]
12
- *
13
- * WU-1109: INIT-003 Phase 4b - Migrate git operations
14
- */
15
- /**
16
- * Arguments for git diff operation
17
- */
18
- export interface GitDiffArgs {
19
- /** Base directory for git operations */
20
- baseDir?: string;
21
- /** Reference to diff against */
22
- ref?: string;
23
- /** Show staged changes */
24
- staged?: boolean;
25
- /** Show only file names */
26
- nameOnly?: boolean;
27
- /** Show diffstat */
28
- stat?: boolean;
29
- /** Path to filter diff */
30
- path?: string;
31
- /** Show help */
32
- help?: boolean;
33
- }
34
- /**
35
- * Result of git diff operation
36
- */
37
- export interface GitDiffResult {
38
- /** Whether operation succeeded */
39
- success: boolean;
40
- /** Error message (if failed) */
41
- error?: string;
42
- /** Whether there are any differences */
43
- hasDiff?: boolean;
44
- /** Diff output */
45
- diff?: string;
46
- /** List of files (for name-only mode) */
47
- files?: string[];
48
- /** Diffstat output (for stat mode) */
49
- stat?: string;
50
- }
51
- /**
52
- * Parse command line arguments for git-diff
53
- */
54
- export declare function parseGitDiffArgs(argv: string[]): GitDiffArgs;
55
- /**
56
- * Get git diff with audit logging
57
- */
58
- export declare function getGitDiff(args: GitDiffArgs): Promise<GitDiffResult>;
package/dist/git-log.d.ts DELETED
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Git Log CLI Tool
4
- *
5
- * Provides WU-aware git log with:
6
- * - Oneline and custom format output
7
- * - Max count limiting
8
- * - Date and author filtering
9
- *
10
- * Usage:
11
- * node git-log.js [ref] [--oneline] [-n <count>] [--format <format>]
12
- *
13
- * WU-1109: INIT-003 Phase 4b - Migrate git operations
14
- */
15
- /**
16
- * Arguments for git log operation
17
- */
18
- export interface GitLogArgs {
19
- /** Base directory for git operations */
20
- baseDir?: string;
21
- /** Reference or range (e.g., main..feature) */
22
- ref?: string;
23
- /** Use oneline format */
24
- oneline?: boolean;
25
- /** Maximum number of commits */
26
- maxCount?: number;
27
- /** Custom format string */
28
- format?: string;
29
- /** Show commits since date */
30
- since?: string;
31
- /** Filter by author */
32
- author?: string;
33
- /** Show help */
34
- help?: boolean;
35
- }
36
- /**
37
- * Commit information
38
- */
39
- export interface CommitInfo {
40
- /** Commit hash */
41
- hash: string;
42
- /** Commit message */
43
- message: string;
44
- /** Author name */
45
- author?: string;
46
- /** Author date */
47
- date?: string;
48
- }
49
- /**
50
- * Result of git log operation
51
- */
52
- export interface GitLogResult {
53
- /** Whether operation succeeded */
54
- success: boolean;
55
- /** Error message (if failed) */
56
- error?: string;
57
- /** Parsed commits */
58
- commits: CommitInfo[];
59
- /** Raw output (for oneline/custom format) */
60
- output?: string;
61
- }
62
- /**
63
- * Parse command line arguments for git-log
64
- */
65
- export declare function parseGitLogArgs(argv: string[]): GitLogArgs;
66
- /**
67
- * Get git log with audit logging
68
- */
69
- export declare function getGitLog(args: GitLogArgs): Promise<GitLogResult>;
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Git Status CLI Tool
4
- *
5
- * Provides WU-aware git status with:
6
- * - Porcelain and short output formats
7
- * - Parsed file status (staged, modified, untracked)
8
- * - Clean/dirty state detection
9
- *
10
- * Usage:
11
- * node git-status.js [path] [--porcelain] [--short]
12
- *
13
- * WU-1109: INIT-003 Phase 4b - Migrate git operations
14
- */
15
- /**
16
- * Arguments for git status operation
17
- */
18
- export interface GitStatusArgs {
19
- /** Base directory for git operations */
20
- baseDir?: string;
21
- /** Path to filter status */
22
- path?: string;
23
- /** Use porcelain output format */
24
- porcelain?: boolean;
25
- /** Use short output format */
26
- short?: boolean;
27
- /** Show help */
28
- help?: boolean;
29
- }
30
- /**
31
- * Result of git status operation
32
- */
33
- export interface GitStatusResult {
34
- /** Whether operation succeeded */
35
- success: boolean;
36
- /** Error message (if failed) */
37
- error?: string;
38
- /** Whether working tree is clean */
39
- isClean?: boolean;
40
- /** List of staged files */
41
- staged?: string[];
42
- /** List of modified files (unstaged) */
43
- modified?: string[];
44
- /** List of untracked files */
45
- untracked?: string[];
46
- /** List of deleted files */
47
- deleted?: string[];
48
- /** Raw output (for porcelain mode) */
49
- output?: string;
50
- }
51
- /**
52
- * Parse command line arguments for git-status
53
- */
54
- export declare function parseGitStatusArgs(argv: string[]): GitStatusArgs;
55
- /**
56
- * Get git status with audit logging
57
- */
58
- export declare function getGitStatus(args: GitStatusArgs): Promise<GitStatusResult>;
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @file guard-locked.ts
4
- * @description Guard that prevents changes to locked WUs (WU-1111)
5
- *
6
- * Validates that a WU is not locked before allowing modifications.
7
- * Used by git hooks and wu: commands to enforce workflow discipline.
8
- *
9
- * Usage:
10
- * guard-locked WU-123 # Check if WU-123 is locked
11
- * guard-locked --wu WU-123 # Same with explicit flag
12
- *
13
- * Exit codes:
14
- * 0 - WU is not locked (safe to proceed)
15
- * 1 - WU is locked (block operation)
16
- *
17
- * @see {@link docs/04-operations/_frameworks/lumenflow/lumenflow-complete.md} - WU lifecycle
18
- */
19
- /**
20
- * Check if a WU is locked
21
- *
22
- * @param wuPath - Path to WU YAML file
23
- * @returns true if WU has locked: true, false otherwise
24
- * @throws Error if WU file does not exist or cannot be parsed
25
- *
26
- * @example
27
- * if (isWULocked('/path/to/WU-123.yaml')) {
28
- * console.log('WU is locked, cannot modify');
29
- * }
30
- */
31
- export declare function isWULocked(wuPath: string): boolean;
32
- /**
33
- * Assert that a WU is not locked
34
- *
35
- * @param wuPath - Path to WU YAML file
36
- * @throws Error if WU is locked, with actionable fix instructions
37
- *
38
- * @example
39
- * try {
40
- * assertWUNotLocked('/path/to/WU-123.yaml');
41
- * // Safe to modify
42
- * } catch (error) {
43
- * console.error(error.message);
44
- * process.exit(1);
45
- * }
46
- */
47
- export declare function assertWUNotLocked(wuPath: string): void;
48
- /**
49
- * Check if a WU ID is locked by looking up the YAML file
50
- *
51
- * @param wuId - WU ID (e.g., "WU-123")
52
- * @returns true if WU has locked: true, false otherwise
53
- * @throws Error if WU file does not exist
54
- */
55
- export declare function isWUIdLocked(wuId: string): boolean;
56
- /**
57
- * Assert that a WU ID is not locked
58
- *
59
- * @param wuId - WU ID (e.g., "WU-123")
60
- * @throws Error if WU is locked
61
- */
62
- export declare function assertWUIdNotLocked(wuId: string): void;
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Guard Main Branch CLI Tool
4
- *
5
- * Provides branch protection checks for WU workflow:
6
- * - Blocks operations on main/master branches
7
- * - Blocks operations on lane branches (require worktree)
8
- * - Optionally allows agent branches
9
- *
10
- * Usage:
11
- * node guard-main-branch.js [--allow-agent-branch] [--strict]
12
- *
13
- * WU-1109: INIT-003 Phase 4b - Migrate git operations
14
- */
15
- /**
16
- * Arguments for guard-main-branch operation
17
- */
18
- export interface GuardMainBranchArgs {
19
- /** Base directory for git operations */
20
- baseDir?: string;
21
- /** Allow agent branches (e.g., claude/session-123) */
22
- allowAgentBranch?: boolean;
23
- /** Strict mode - fail on any protected branch */
24
- strict?: boolean;
25
- /** Show help */
26
- help?: boolean;
27
- }
28
- /**
29
- * Result of guard-main-branch operation
30
- */
31
- export interface GuardMainBranchResult {
32
- /** Whether operation succeeded */
33
- success: boolean;
34
- /** Error message (if failed) */
35
- error?: string;
36
- /** Whether current branch is protected */
37
- isProtected: boolean;
38
- /** Current branch name */
39
- currentBranch?: string;
40
- /** Reason for protection */
41
- reason?: string;
42
- }
43
- /**
44
- * Parse command line arguments for guard-main-branch
45
- */
46
- export declare function parseGuardMainBranchArgs(argv: string[]): GuardMainBranchArgs;
47
- /**
48
- * Guard against operations on protected branches
49
- */
50
- export declare function guardMainBranch(args: GuardMainBranchArgs): Promise<GuardMainBranchResult>;
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @file guard-worktree-commit.ts
4
- * @description Guard that prevents WU commits from main checkout (WU-1111)
5
- *
6
- * Validates that WU-related commits are only made from worktrees, not main.
7
- * Used by git commit-msg hooks to enforce worktree discipline.
8
- *
9
- * Usage:
10
- * guard-worktree-commit "commit message"
11
- * guard-worktree-commit --message "commit message"
12
- *
13
- * Exit codes:
14
- * 0 - Commit allowed
15
- * 1 - Commit blocked (WU commit from main)
16
- *
17
- * @see {@link docs/04-operations/_frameworks/lumenflow/lumenflow-complete.md} - Worktree discipline
18
- */
19
- /**
20
- * Result of commit block check
21
- */
22
- export interface CommitBlockResult {
23
- /** Whether the commit should be blocked */
24
- blocked: boolean;
25
- /** Reason for blocking (if blocked) */
26
- reason?: string;
27
- }
28
- /**
29
- * Check if a commit should be blocked
30
- *
31
- * @param options - Check options
32
- * @param options.commitMessage - The commit message
33
- * @param options.isMainCheckout - Whether in main checkout
34
- * @param options.isInWorktree - Whether in a worktree
35
- * @returns Whether commit should be blocked and why
36
- *
37
- * @example
38
- * const result = shouldBlockCommit({
39
- * commitMessage: 'wu(WU-123): add feature',
40
- * isMainCheckout: true,
41
- * isInWorktree: false,
42
- * });
43
- * if (result.blocked) {
44
- * console.error(result.reason);
45
- * process.exit(1);
46
- * }
47
- */
48
- export declare function shouldBlockCommit(options: {
49
- commitMessage: string;
50
- isMainCheckout: boolean;
51
- isInWorktree: boolean;
52
- }): CommitBlockResult;
53
- /**
54
- * Check if a commit message is WU-related
55
- *
56
- * @param message - Commit message to check
57
- * @returns true if message indicates WU work
58
- */
59
- export declare function isWUCommitMessage(message: string): boolean;
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * @lumenflow/cli - Command-line interface for LumenFlow workflow framework
3
- *
4
- * This package provides CLI commands for the LumenFlow workflow framework.
5
- * Most functionality is exposed via bin commands, but the cli-entry-point
6
- * helper is exported for use in custom CLI wrappers.
7
- *
8
- * @see https://lumenflow.dev/reference/cli
9
- */
10
- export { runCLI } from './cli-entry-point.js';
@@ -1,80 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Init Plan Command (WU-1105)
4
- *
5
- * Links plan files to initiatives by setting the `related_plan` field
6
- * in the initiative YAML.
7
- *
8
- * Usage:
9
- * pnpm init:plan --initiative INIT-001 --plan docs/04-operations/plans/my-plan.md
10
- * pnpm init:plan --initiative INIT-001 --create # Create new plan template
11
- *
12
- * Features:
13
- * - Validates initiative exists before modifying
14
- * - Formats plan path as lumenflow:// URI
15
- * - Idempotent: no error if same plan already linked
16
- * - Warns if replacing existing plan link
17
- * - Can create plan templates with --create
18
- *
19
- * Context: WU-1105 (INIT-003 Phase 3a: Migrate init:plan command)
20
- */
21
- import { readInitiative } from '@lumenflow/initiatives/dist/initiative-yaml.js';
22
- /** Log prefix for console output */
23
- export declare const LOG_PREFIX: string;
24
- /**
25
- * Validate Initiative ID format
26
- * @param id - Initiative ID to validate
27
- * @throws Error if format is invalid
28
- */
29
- export declare function validateInitIdFormat(id: string): void;
30
- /**
31
- * Validate plan file path
32
- * @param planPath - Path to plan file
33
- * @throws Error if path is invalid or file doesn't exist
34
- */
35
- export declare function validatePlanPath(planPath: string): void;
36
- /**
37
- * Format plan path as lumenflow:// URI
38
- *
39
- * Extracts the filename (and any subdirectory within plans/) and creates
40
- * a standardized URI for the plan reference.
41
- *
42
- * @param planPath - Path to plan file (can be relative or absolute)
43
- * @returns lumenflow://plans/<filename> URI
44
- */
45
- export declare function formatPlanUri(planPath: string): string;
46
- /**
47
- * Check if initiative exists and return the document
48
- * @param initId - Initiative ID to check
49
- * @returns Initiative document
50
- * @throws Error if initiative not found
51
- */
52
- export declare function checkInitiativeExists(initId: string): ReturnType<typeof readInitiative>;
53
- /**
54
- * Update initiative with plan reference in micro-worktree
55
- *
56
- * Uses raw YAML parsing to preserve unknown fields like related_plan
57
- * that are not in the strict initiative schema.
58
- *
59
- * @param worktreePath - Path to micro-worktree
60
- * @param initId - Initiative ID
61
- * @param planUri - Plan URI to set
62
- * @returns True if changes were made, false if already linked
63
- */
64
- export declare function updateInitiativeWithPlan(worktreePath: string, initId: string, planUri: string): boolean;
65
- /**
66
- * Create a plan template file
67
- *
68
- * @param worktreePath - Path to repo root or worktree
69
- * @param initId - Initiative ID
70
- * @param title - Initiative title
71
- * @returns Path to created file
72
- * @throws Error if file already exists
73
- */
74
- export declare function createPlanTemplate(worktreePath: string, initId: string, title: string): string;
75
- /**
76
- * Generate commit message for plan link operation
77
- */
78
- export declare function getCommitMessage(initId: string, planUri: string): string;
79
- declare function main(): Promise<void>;
80
- export { main };