@lumenflow/cli 2.1.1 → 2.2.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/dist/__tests__/guard-main-branch.test.js +79 -0
- package/dist/agent-issues-query.d.ts +16 -0
- package/dist/agent-log-issue.d.ts +10 -0
- package/dist/agent-session-end.d.ts +10 -0
- package/dist/agent-session.d.ts +10 -0
- package/dist/backlog-prune.d.ts +84 -0
- package/dist/cli-entry-point.d.ts +8 -0
- package/dist/deps-add.d.ts +91 -0
- package/dist/deps-remove.d.ts +17 -0
- package/dist/docs-sync.d.ts +50 -0
- package/dist/file-delete.d.ts +84 -0
- package/dist/file-edit.d.ts +82 -0
- package/dist/file-read.d.ts +92 -0
- package/dist/file-write.d.ts +90 -0
- package/dist/flow-bottlenecks.d.ts +16 -0
- package/dist/flow-report.d.ts +16 -0
- package/dist/gates.d.ts +94 -0
- package/dist/git-branch.d.ts +65 -0
- package/dist/git-diff.d.ts +58 -0
- package/dist/git-log.d.ts +69 -0
- package/dist/git-status.d.ts +58 -0
- package/dist/guard-locked.d.ts +62 -0
- package/dist/guard-main-branch.d.ts +50 -0
- package/dist/guard-main-branch.js +11 -0
- package/dist/guard-worktree-commit.d.ts +59 -0
- package/dist/index.d.ts +10 -0
- package/dist/init-plan.d.ts +80 -0
- package/dist/init.d.ts +46 -0
- package/dist/initiative-add-wu.d.ts +22 -0
- package/dist/initiative-bulk-assign-wus.d.ts +16 -0
- package/dist/initiative-create.d.ts +28 -0
- package/dist/initiative-edit.d.ts +34 -0
- package/dist/initiative-list.d.ts +12 -0
- package/dist/initiative-status.d.ts +11 -0
- package/dist/lumenflow-upgrade.d.ts +103 -0
- package/dist/mem-checkpoint.d.ts +16 -0
- package/dist/mem-cleanup.d.ts +29 -0
- package/dist/mem-create.d.ts +17 -0
- package/dist/mem-export.d.ts +10 -0
- package/dist/mem-export.js +138 -0
- package/dist/mem-inbox.d.ts +35 -0
- package/dist/mem-init.d.ts +15 -0
- package/dist/mem-ready.d.ts +16 -0
- package/dist/mem-signal.d.ts +16 -0
- package/dist/mem-start.d.ts +16 -0
- package/dist/mem-summarize.d.ts +22 -0
- package/dist/mem-triage.d.ts +22 -0
- package/dist/metrics-cli.d.ts +90 -0
- package/dist/metrics-snapshot.d.ts +18 -0
- package/dist/orchestrate-init-status.d.ts +11 -0
- package/dist/orchestrate-initiative.d.ts +12 -0
- package/dist/orchestrate-monitor.d.ts +11 -0
- package/dist/release.d.ts +117 -0
- package/dist/rotate-progress.d.ts +48 -0
- package/dist/session-coordinator.d.ts +74 -0
- package/dist/spawn-list.d.ts +16 -0
- package/dist/state-bootstrap.d.ts +92 -0
- package/dist/sync-templates.d.ts +52 -0
- package/dist/trace-gen.d.ts +84 -0
- package/dist/validate-agent-skills.d.ts +50 -0
- package/dist/validate-agent-sync.d.ts +36 -0
- package/dist/validate-backlog-sync.d.ts +37 -0
- package/dist/validate-skills-spec.d.ts +40 -0
- package/dist/validate.d.ts +60 -0
- package/dist/wu-block.d.ts +16 -0
- package/dist/wu-claim.d.ts +74 -0
- package/dist/wu-cleanup.d.ts +35 -0
- package/dist/wu-cleanup.js +11 -2
- package/dist/wu-create.d.ts +69 -0
- package/dist/wu-delete.d.ts +21 -0
- package/dist/wu-deps.d.ts +13 -0
- package/dist/wu-done.d.ts +225 -0
- package/dist/wu-done.js +9 -3
- package/dist/wu-edit.d.ts +63 -0
- package/dist/wu-edit.js +76 -9
- package/dist/wu-infer-lane.d.ts +17 -0
- package/dist/wu-preflight.d.ts +47 -0
- package/dist/wu-prune.d.ts +16 -0
- package/dist/wu-recover.d.ts +37 -0
- package/dist/wu-release.d.ts +19 -0
- package/dist/wu-repair.d.ts +60 -0
- package/dist/wu-spawn-completion.d.ts +10 -0
- package/dist/wu-spawn.d.ts +192 -0
- package/dist/wu-spawn.js +176 -12
- package/dist/wu-status.d.ts +25 -0
- package/dist/wu-unblock.d.ts +16 -0
- package/dist/wu-unlock-lane.d.ts +19 -0
- package/dist/wu-validate.d.ts +16 -0
- package/package.json +7 -6
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Memory Summarize CLI (WU-1471)
|
|
4
|
+
*
|
|
5
|
+
* Rollup older memory nodes into summary nodes for compaction.
|
|
6
|
+
* Implements forgetting as first-class feature.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Aggregate checkpoint/note/discovery nodes into summaries
|
|
10
|
+
* - Mark originals for cleanup after summary creation
|
|
11
|
+
* - Respect lifecycle TTL (ephemeral, session, wu, project)
|
|
12
|
+
* - Support dry-run mode for preview
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* pnpm mem:summarize --wu WU-1234 # Create summary from WU nodes
|
|
16
|
+
* pnpm mem:summarize --wu WU-1234 --dry-run # Preview without changes
|
|
17
|
+
* pnpm mem:summarize --wu WU-1234 --json # Output as JSON
|
|
18
|
+
*
|
|
19
|
+
* @see {@link tools/lib/mem-summarize-core.mjs} - Core logic
|
|
20
|
+
* @see {@link tools/__tests__/mem-summarize.test.mjs} - Tests
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Memory Triage CLI (WU-1470)
|
|
4
|
+
*
|
|
5
|
+
* Review discovery nodes and promote to WUs or archive.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - List open discovery nodes
|
|
9
|
+
* - Promote discovery to WU (integrates with wu:create)
|
|
10
|
+
* - Archive discovery without promotion
|
|
11
|
+
* - Interactive mode for human review
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* pnpm mem:triage # List open discoveries
|
|
15
|
+
* pnpm mem:triage --wu WU-1234 # List discoveries for specific WU
|
|
16
|
+
* pnpm mem:triage --promote mem-aaa1 --lane "Operations: Tooling"
|
|
17
|
+
* pnpm mem:triage --archive mem-aaa1 --reason "Duplicate"
|
|
18
|
+
*
|
|
19
|
+
* @see {@link tools/lib/mem-triage-core.mjs} - Core logic
|
|
20
|
+
* @see {@link tools/__tests__/mem-triage.test.mjs} - Tests
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Unified Metrics CLI with subcommands (WU-1110)
|
|
4
|
+
*
|
|
5
|
+
* Provides lanes, dora, and flow metrics subcommands in a single CLI.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* pnpm metrics # All metrics, JSON output
|
|
9
|
+
* pnpm metrics lanes # Lane health only
|
|
10
|
+
* pnpm metrics dora # DORA metrics only
|
|
11
|
+
* pnpm metrics flow # Flow state only
|
|
12
|
+
* pnpm metrics --format table # Table output
|
|
13
|
+
* pnpm metrics --days 30 # 30 day window
|
|
14
|
+
* pnpm metrics --output metrics.json # Custom output file
|
|
15
|
+
* pnpm metrics --dry-run # Preview without writing
|
|
16
|
+
*
|
|
17
|
+
* @module metrics-cli
|
|
18
|
+
*/
|
|
19
|
+
import { type WUMetrics, type GitCommit, type SkipGatesEntry, type DORAMetrics, type FlowState, type LaneHealth } from '@lumenflow/metrics';
|
|
20
|
+
/** Valid subcommands */
|
|
21
|
+
export type MetricsSubcommand = 'lanes' | 'dora' | 'flow' | 'all';
|
|
22
|
+
/** Output format types */
|
|
23
|
+
export type MetricsFormat = 'json' | 'table';
|
|
24
|
+
/** Parsed command result */
|
|
25
|
+
export interface MetricsCommandResult {
|
|
26
|
+
subcommand: MetricsSubcommand;
|
|
27
|
+
days: number;
|
|
28
|
+
format: MetricsFormat;
|
|
29
|
+
output: string;
|
|
30
|
+
dryRun: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Lane health result from WUs */
|
|
33
|
+
export interface LaneHealthResult {
|
|
34
|
+
lanes: LaneHealth[];
|
|
35
|
+
totalActive: number;
|
|
36
|
+
totalBlocked: number;
|
|
37
|
+
totalCompleted: number;
|
|
38
|
+
}
|
|
39
|
+
/** DORA calculation input */
|
|
40
|
+
export interface DoraCalculationInput {
|
|
41
|
+
commits: GitCommit[];
|
|
42
|
+
wuMetrics: WUMetrics[];
|
|
43
|
+
skipGatesEntries: SkipGatesEntry[];
|
|
44
|
+
weekStart: Date;
|
|
45
|
+
weekEnd: Date;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse command line arguments
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseCommand(argv: string[]): MetricsCommandResult;
|
|
51
|
+
/**
|
|
52
|
+
* Calculate lane health from WU metrics
|
|
53
|
+
*/
|
|
54
|
+
export declare function calculateLaneHealthFromWUs(wuMetrics: WUMetrics[]): LaneHealthResult;
|
|
55
|
+
/**
|
|
56
|
+
* Calculate DORA metrics from data
|
|
57
|
+
*/
|
|
58
|
+
export declare function calculateDoraFromData(input: DoraCalculationInput): DORAMetrics;
|
|
59
|
+
/**
|
|
60
|
+
* Calculate flow state from WU metrics
|
|
61
|
+
*/
|
|
62
|
+
export declare function calculateFlowFromWUs(wuMetrics: WUMetrics[]): FlowState;
|
|
63
|
+
/**
|
|
64
|
+
* Format lanes output
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatLanesOutput(lanes: LaneHealthResult, format: MetricsFormat): string;
|
|
67
|
+
/**
|
|
68
|
+
* Format DORA output
|
|
69
|
+
*/
|
|
70
|
+
export declare function formatDoraOutput(dora: DORAMetrics, format: MetricsFormat): string;
|
|
71
|
+
/**
|
|
72
|
+
* Format flow output
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatFlowOutput(flow: FlowState, format: MetricsFormat): string;
|
|
75
|
+
/**
|
|
76
|
+
* Run lanes subcommand
|
|
77
|
+
*/
|
|
78
|
+
export declare function runLanesSubcommand(opts: MetricsCommandResult): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Run dora subcommand
|
|
81
|
+
*/
|
|
82
|
+
export declare function runDoraSubcommand(opts: MetricsCommandResult): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Run flow subcommand
|
|
85
|
+
*/
|
|
86
|
+
export declare function runFlowSubcommand(opts: MetricsCommandResult): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Run all metrics (default)
|
|
89
|
+
*/
|
|
90
|
+
export declare function runAllSubcommand(opts: MetricsCommandResult): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Metrics Snapshot Capture CLI (WU-1018)
|
|
4
|
+
*
|
|
5
|
+
* Captures DORA metrics, lane health, and flow state snapshots.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* pnpm metrics:snapshot # All metrics, JSON output
|
|
9
|
+
* pnpm metrics:snapshot --type dora # DORA metrics only
|
|
10
|
+
* pnpm metrics:snapshot --type lanes # Lane health only
|
|
11
|
+
* pnpm metrics:snapshot --type flow # Flow state only
|
|
12
|
+
* pnpm metrics:snapshot --dry-run # Preview without writing
|
|
13
|
+
* pnpm metrics:snapshot --output metrics.json
|
|
14
|
+
*
|
|
15
|
+
* @module metrics-snapshot
|
|
16
|
+
* @see {@link @lumenflow/metrics/flow/capture-metrics-snapshot}
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Orchestrate Initiative CLI
|
|
4
|
+
*
|
|
5
|
+
* Orchestrate initiative execution with parallel agent spawning.
|
|
6
|
+
* Builds execution plan based on WU dependencies and manages wave-based execution.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm orchestrate:initiative --initiative INIT-001
|
|
10
|
+
* pnpm orchestrate:initiative --initiative INIT-001 --dry-run
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Orchestrate Monitor CLI
|
|
4
|
+
*
|
|
5
|
+
* Monitors spawned agent progress using mem:inbox signals.
|
|
6
|
+
* Designed to prevent context exhaustion by using compact signal output.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm orchestrate:monitor --since 30m
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Release Command
|
|
4
|
+
*
|
|
5
|
+
* Orchestrates npm release for all @lumenflow/* packages using micro-worktree isolation.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Validates semver version format
|
|
9
|
+
* - Bumps all @lumenflow/* package versions atomically
|
|
10
|
+
* - Uses micro-worktree isolation for version commit (no main branch pollution)
|
|
11
|
+
* - Builds all packages via turbo
|
|
12
|
+
* - Publishes to npm with proper auth (requires NPM_TOKEN)
|
|
13
|
+
* - Creates git tag vX.Y.Z
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* pnpm release --release-version 1.3.0
|
|
17
|
+
* pnpm release --release-version 1.3.0 --dry-run # Preview without making changes
|
|
18
|
+
* pnpm release --release-version 1.3.0 --skip-publish # Bump and tag only (no npm publish)
|
|
19
|
+
*
|
|
20
|
+
* WU-1085: The --release-version flag was renamed from --version to avoid conflict
|
|
21
|
+
* with the standard CLI --version flag that shows the CLI version.
|
|
22
|
+
*
|
|
23
|
+
* WU-1074: Add release command for npm publishing
|
|
24
|
+
*/
|
|
25
|
+
import { getGitForCwd } from '@lumenflow/core/dist/git-adapter.js';
|
|
26
|
+
/**
|
|
27
|
+
* Release command options
|
|
28
|
+
* WU-1085: Renamed version to releaseVersion to avoid CLI --version conflict
|
|
29
|
+
*/
|
|
30
|
+
export interface ReleaseOptions {
|
|
31
|
+
releaseVersion: string;
|
|
32
|
+
dryRun?: boolean;
|
|
33
|
+
skipPublish?: boolean;
|
|
34
|
+
skipBuild?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Validate that a string is a valid semver version
|
|
38
|
+
*
|
|
39
|
+
* @param version - Version string to validate
|
|
40
|
+
* @returns true if valid semver, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateSemver(version: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Find all public @lumenflow/* package.json paths
|
|
45
|
+
*
|
|
46
|
+
* @param baseDir - Base directory to search from (defaults to cwd)
|
|
47
|
+
* @returns Array of absolute paths to package.json files
|
|
48
|
+
*/
|
|
49
|
+
export declare function findPackageJsonPaths(baseDir?: string): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Update version in specified package.json files
|
|
52
|
+
*
|
|
53
|
+
* @param paths - Array of package.json paths
|
|
54
|
+
* @param version - New version string
|
|
55
|
+
*/
|
|
56
|
+
export declare function updatePackageVersions(paths: string[], version: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Build commit message for version bump
|
|
59
|
+
*
|
|
60
|
+
* @param version - New version string
|
|
61
|
+
* @returns Commit message
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildCommitMessage(version: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Build git tag name from version
|
|
66
|
+
*
|
|
67
|
+
* @param version - Version string
|
|
68
|
+
* @returns Git tag name with 'v' prefix
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildTagName(version: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Check if npm authentication is available
|
|
73
|
+
*
|
|
74
|
+
* Checks for auth in this order:
|
|
75
|
+
* 1. NPM_TOKEN environment variable
|
|
76
|
+
* 2. NODE_AUTH_TOKEN environment variable
|
|
77
|
+
* 3. Auth token in specified .npmrc file (or ~/.npmrc by default)
|
|
78
|
+
*
|
|
79
|
+
* @param npmrcPath - Optional path to .npmrc file (defaults to ~/.npmrc)
|
|
80
|
+
* @returns true if any auth method is found
|
|
81
|
+
*/
|
|
82
|
+
export declare function hasNpmAuth(npmrcPath?: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Check if the project is in changeset pre-release mode
|
|
85
|
+
*
|
|
86
|
+
* Changeset pre mode is indicated by the presence of .changeset/pre.json
|
|
87
|
+
*
|
|
88
|
+
* @param baseDir - Base directory to check (defaults to cwd)
|
|
89
|
+
* @returns true if in pre-release mode
|
|
90
|
+
*/
|
|
91
|
+
export declare function isInChangesetPreMode(baseDir?: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Exit changeset pre-release mode by removing .changeset/pre.json
|
|
94
|
+
*
|
|
95
|
+
* This is safe to call even if not in pre mode (no-op if file doesn't exist)
|
|
96
|
+
*
|
|
97
|
+
* @param baseDir - Base directory to operate in (defaults to cwd)
|
|
98
|
+
*/
|
|
99
|
+
export declare function exitChangesetPreMode(baseDir?: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Push a git tag to origin, bypassing pre-push hooks via LUMENFLOW_FORCE
|
|
102
|
+
*
|
|
103
|
+
* This is necessary because the release script runs in a micro-worktree context
|
|
104
|
+
* and pre-push hooks may block tag pushes. The force is logged and requires
|
|
105
|
+
* a reason for audit purposes.
|
|
106
|
+
*
|
|
107
|
+
* @param git - SimpleGit instance
|
|
108
|
+
* @param tagName - Name of the tag to push
|
|
109
|
+
* @param reason - Reason for bypassing hooks (for audit log)
|
|
110
|
+
*/
|
|
111
|
+
export declare function pushTagWithForce(git: ReturnType<typeof getGitForCwd>, tagName: string, reason?: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Main release function
|
|
114
|
+
* WU-1085: Renamed --version to --release-version to avoid conflict with CLI --version flag
|
|
115
|
+
*/
|
|
116
|
+
declare function main(): Promise<void>;
|
|
117
|
+
export { main };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Rotate Progress CLI Command
|
|
4
|
+
*
|
|
5
|
+
* Moves completed WUs from status.md In Progress section to Completed section.
|
|
6
|
+
* Keeps the status file tidy by archiving done work.
|
|
7
|
+
*
|
|
8
|
+
* WU-1112: INIT-003 Phase 6 - Migrate remaining Tier 1 tools
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* pnpm rotate:progress
|
|
12
|
+
* pnpm rotate:progress --dry-run
|
|
13
|
+
* pnpm rotate:progress --limit 10
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Arguments for rotate-progress command
|
|
17
|
+
*/
|
|
18
|
+
export interface RotateArgs {
|
|
19
|
+
/** Dry run - show changes without writing */
|
|
20
|
+
dryRun?: boolean;
|
|
21
|
+
/** Maximum number of WUs to rotate */
|
|
22
|
+
limit?: number;
|
|
23
|
+
/** Show help */
|
|
24
|
+
help?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse command line arguments for rotate-progress
|
|
28
|
+
*
|
|
29
|
+
* @param argv - Process argv array
|
|
30
|
+
* @returns Parsed arguments
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseRotateArgs(argv: string[]): RotateArgs;
|
|
33
|
+
/**
|
|
34
|
+
* Find WUs in the In Progress section that have status=done in YAML
|
|
35
|
+
*
|
|
36
|
+
* @param statusContent - Content of status.md file
|
|
37
|
+
* @param wuStatuses - Map of WU IDs to their statuses from YAML
|
|
38
|
+
* @returns Array of WU IDs that should be moved to Completed
|
|
39
|
+
*/
|
|
40
|
+
export declare function findCompletedWUs(statusContent: string, wuStatuses: Map<string, string>): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Build the rotated status.md content
|
|
43
|
+
*
|
|
44
|
+
* @param statusContent - Original status.md content
|
|
45
|
+
* @param completedWUs - WU IDs to move to Completed
|
|
46
|
+
* @returns Updated status.md content
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildRotatedContent(statusContent: string, completedWUs: string[]): string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Session Coordinator CLI Command
|
|
4
|
+
*
|
|
5
|
+
* Manages agent sessions - starting, stopping, status, and handoffs.
|
|
6
|
+
* Sessions track which agent is working on which WU and facilitate
|
|
7
|
+
* coordination between multiple agents.
|
|
8
|
+
*
|
|
9
|
+
* WU-1112: INIT-003 Phase 6 - Migrate remaining Tier 1 tools
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* pnpm session:start --wu WU-1112 --agent claude-code
|
|
13
|
+
* pnpm session:stop --reason "Completed work"
|
|
14
|
+
* pnpm session:status
|
|
15
|
+
* pnpm session:handoff --wu WU-1112 --agent cursor
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Session subcommands
|
|
19
|
+
*/
|
|
20
|
+
export declare enum SessionCommand {
|
|
21
|
+
START = "start",
|
|
22
|
+
STOP = "stop",
|
|
23
|
+
STATUS = "status",
|
|
24
|
+
HANDOFF = "handoff"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Arguments for session-coordinator command
|
|
28
|
+
*/
|
|
29
|
+
export interface SessionArgs {
|
|
30
|
+
/** Subcommand to run */
|
|
31
|
+
command?: SessionCommand | string;
|
|
32
|
+
/** WU ID for the session */
|
|
33
|
+
wuId?: string;
|
|
34
|
+
/** Agent type (e.g., claude-code, cursor, aider) */
|
|
35
|
+
agent?: string;
|
|
36
|
+
/** Reason for stopping session */
|
|
37
|
+
reason?: string;
|
|
38
|
+
/** Show help */
|
|
39
|
+
help?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Validation result for session command
|
|
43
|
+
*/
|
|
44
|
+
export interface SessionValidationResult {
|
|
45
|
+
valid: boolean;
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Session state stored in current.json
|
|
50
|
+
*/
|
|
51
|
+
export interface SessionState {
|
|
52
|
+
/** WU being worked on */
|
|
53
|
+
wuId: string;
|
|
54
|
+
/** Agent working on the WU */
|
|
55
|
+
agent: string;
|
|
56
|
+
/** Session start timestamp */
|
|
57
|
+
startedAt: string;
|
|
58
|
+
/** Last activity timestamp */
|
|
59
|
+
lastActivity: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parse command line arguments for session-coordinator
|
|
63
|
+
*
|
|
64
|
+
* @param argv - Process argv array
|
|
65
|
+
* @returns Parsed arguments
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseSessionArgs(argv: string[]): SessionArgs;
|
|
68
|
+
/**
|
|
69
|
+
* Validate session command arguments
|
|
70
|
+
*
|
|
71
|
+
* @param args - Parsed session arguments
|
|
72
|
+
* @returns Validation result
|
|
73
|
+
*/
|
|
74
|
+
export declare function validateSessionCommand(args: SessionArgs): SessionValidationResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Spawn List Command (WU-1950)
|
|
4
|
+
*
|
|
5
|
+
* Displays spawn trees for WUs or initiatives.
|
|
6
|
+
* Shows parent-child relationships with status indicators.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm spawn:list --wu WU-XXX # Spawns for a specific WU
|
|
10
|
+
* pnpm spawn:list --initiative INIT-XXX # All spawns in an initiative
|
|
11
|
+
* pnpm spawn:list --json # JSON output
|
|
12
|
+
*
|
|
13
|
+
* @see {@link tools/lib/spawn-tree.mjs} - Tree builder
|
|
14
|
+
* @see {@link tools/__tests__/spawn-list.test.mjs} - Tests
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* State Bootstrap Command
|
|
4
|
+
*
|
|
5
|
+
* One-time migration utility from WU YAMLs to event-sourced state store.
|
|
6
|
+
* Reads all WU YAML files and generates corresponding events in the state store.
|
|
7
|
+
*
|
|
8
|
+
* WU-1107: INIT-003 Phase 3c - Migrate state-bootstrap.mjs from PatientPath
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* pnpm state:bootstrap # Dry-run mode (shows what would be done)
|
|
12
|
+
* pnpm state:bootstrap --execute # Apply changes
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Default configuration for state bootstrap
|
|
16
|
+
*/
|
|
17
|
+
export declare const STATE_BOOTSTRAP_DEFAULTS: {
|
|
18
|
+
/** Default WU directory path */
|
|
19
|
+
wuDir: string;
|
|
20
|
+
/** Default state directory path */
|
|
21
|
+
stateDir: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Arguments for state-bootstrap command
|
|
25
|
+
*/
|
|
26
|
+
export interface StateBootstrapArgs {
|
|
27
|
+
dryRun: boolean;
|
|
28
|
+
wuDir: string;
|
|
29
|
+
stateDir: string;
|
|
30
|
+
force: boolean;
|
|
31
|
+
help?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Minimal WU information needed for bootstrap event generation
|
|
35
|
+
*/
|
|
36
|
+
export interface WuBootstrapInfo {
|
|
37
|
+
id: string;
|
|
38
|
+
status: string;
|
|
39
|
+
lane: string;
|
|
40
|
+
title: string;
|
|
41
|
+
created?: string;
|
|
42
|
+
claimed_at?: string;
|
|
43
|
+
completed_at?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Bootstrap event to be written to state store
|
|
47
|
+
*/
|
|
48
|
+
export interface BootstrapEvent {
|
|
49
|
+
type: 'claim' | 'complete' | 'block' | 'unblock' | 'release';
|
|
50
|
+
wuId: string;
|
|
51
|
+
timestamp: string;
|
|
52
|
+
lane?: string;
|
|
53
|
+
title?: string;
|
|
54
|
+
reason?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Result of bootstrap operation
|
|
58
|
+
*/
|
|
59
|
+
export interface BootstrapResult {
|
|
60
|
+
success: boolean;
|
|
61
|
+
eventsGenerated: number;
|
|
62
|
+
eventsWritten: number;
|
|
63
|
+
skipped: number;
|
|
64
|
+
warnings: string[];
|
|
65
|
+
error?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Parse command line arguments for state-bootstrap
|
|
69
|
+
*/
|
|
70
|
+
export declare function parseStateBootstrapArgs(argv: string[]): StateBootstrapArgs;
|
|
71
|
+
/**
|
|
72
|
+
* Infer events from a WU based on its current status
|
|
73
|
+
*
|
|
74
|
+
* Event generation rules:
|
|
75
|
+
* - ready: No events (WU not yet claimed)
|
|
76
|
+
* - in_progress: Generate claim event
|
|
77
|
+
* - blocked: Generate claim + block events
|
|
78
|
+
* - done/completed: Generate claim + complete events
|
|
79
|
+
*/
|
|
80
|
+
export declare function inferEventsFromWu(wu: WuBootstrapInfo): BootstrapEvent[];
|
|
81
|
+
/**
|
|
82
|
+
* Generate all bootstrap events from a list of WUs, ordered chronologically
|
|
83
|
+
*/
|
|
84
|
+
export declare function generateBootstrapEvents(wus: WuBootstrapInfo[]): BootstrapEvent[];
|
|
85
|
+
/**
|
|
86
|
+
* Run the state bootstrap migration
|
|
87
|
+
*/
|
|
88
|
+
export declare function runStateBootstrap(args: StateBootstrapArgs): Promise<BootstrapResult>;
|
|
89
|
+
/**
|
|
90
|
+
* Print help text
|
|
91
|
+
*/
|
|
92
|
+
export declare function printHelp(): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file sync-templates.ts
|
|
3
|
+
* Sync internal docs to CLI templates for release-cycle maintenance (WU-1123)
|
|
4
|
+
*
|
|
5
|
+
* This script syncs source docs from the hellmai/os repo to the templates
|
|
6
|
+
* directory, applying template variable substitutions:
|
|
7
|
+
* - Onboarding docs -> templates/core/ai/onboarding/
|
|
8
|
+
* - Claude skills -> templates/vendors/claude/.claude/skills/
|
|
9
|
+
* - Core docs (LUMENFLOW.md, constraints.md) -> templates/core/
|
|
10
|
+
*/
|
|
11
|
+
export interface SyncResult {
|
|
12
|
+
synced: string[];
|
|
13
|
+
errors: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface SyncSummary {
|
|
16
|
+
onboarding: SyncResult;
|
|
17
|
+
skills: SyncResult;
|
|
18
|
+
core: SyncResult;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parse sync-templates command options
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseSyncTemplatesOptions(): {
|
|
24
|
+
dryRun: boolean;
|
|
25
|
+
verbose: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Convert source content to template format by replacing:
|
|
29
|
+
* - YYYY-MM-DD dates with {{DATE}}
|
|
30
|
+
* - Absolute project paths with {{PROJECT_ROOT}}
|
|
31
|
+
*/
|
|
32
|
+
export declare function convertToTemplate(content: string, projectRoot: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Sync onboarding docs to templates/core/ai/onboarding/
|
|
35
|
+
*/
|
|
36
|
+
export declare function syncOnboardingDocs(projectRoot: string, dryRun?: boolean): Promise<SyncResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Sync Claude skills to templates/vendors/claude/.claude/skills/
|
|
39
|
+
*/
|
|
40
|
+
export declare function syncSkillsToTemplates(projectRoot: string, dryRun?: boolean): Promise<SyncResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Sync core docs (LUMENFLOW.md, constraints.md) to templates/core/
|
|
43
|
+
*/
|
|
44
|
+
export declare function syncCoreDocs(projectRoot: string, dryRun?: boolean): Promise<SyncResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Sync all templates
|
|
47
|
+
*/
|
|
48
|
+
export declare function syncTemplates(projectRoot: string, dryRun?: boolean): Promise<SyncSummary>;
|
|
49
|
+
/**
|
|
50
|
+
* CLI entry point
|
|
51
|
+
*/
|
|
52
|
+
export declare function main(): Promise<void>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Trace Generator CLI Command
|
|
4
|
+
*
|
|
5
|
+
* Creates traceability reports linking WUs to code changes.
|
|
6
|
+
* Useful for audit trails, compliance documentation, and understanding
|
|
7
|
+
* what code was changed as part of each WU.
|
|
8
|
+
*
|
|
9
|
+
* WU-1112: INIT-003 Phase 6 - Migrate remaining Tier 1 tools
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* pnpm trace:gen --wu WU-1112
|
|
13
|
+
* pnpm trace:gen --since 2024-01-01 --format json
|
|
14
|
+
* pnpm trace:gen --format markdown --output trace.md
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Output formats for trace report
|
|
18
|
+
*/
|
|
19
|
+
export declare enum TraceFormat {
|
|
20
|
+
JSON = "json",
|
|
21
|
+
MARKDOWN = "markdown",
|
|
22
|
+
CSV = "csv"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Arguments for trace-gen command
|
|
26
|
+
*/
|
|
27
|
+
export interface TraceArgs {
|
|
28
|
+
/** Specific WU ID to trace */
|
|
29
|
+
wuId?: string;
|
|
30
|
+
/** Output format */
|
|
31
|
+
format?: TraceFormat | string;
|
|
32
|
+
/** Output file path */
|
|
33
|
+
output?: string;
|
|
34
|
+
/** Since date (ISO format) */
|
|
35
|
+
since?: string;
|
|
36
|
+
/** Show help */
|
|
37
|
+
help?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Commit information
|
|
41
|
+
*/
|
|
42
|
+
export interface CommitInfo {
|
|
43
|
+
sha: string;
|
|
44
|
+
message: string;
|
|
45
|
+
date: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Input data for building trace entry
|
|
49
|
+
*/
|
|
50
|
+
export interface TraceInput {
|
|
51
|
+
wuId: string;
|
|
52
|
+
title: string;
|
|
53
|
+
status: string;
|
|
54
|
+
commits: CommitInfo[];
|
|
55
|
+
files: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Trace entry for a WU
|
|
59
|
+
*/
|
|
60
|
+
export interface TraceEntry {
|
|
61
|
+
wuId: string;
|
|
62
|
+
title: string;
|
|
63
|
+
status: string;
|
|
64
|
+
commitCount: number;
|
|
65
|
+
fileCount: number;
|
|
66
|
+
firstCommit?: string;
|
|
67
|
+
lastCommit?: string;
|
|
68
|
+
commits?: CommitInfo[];
|
|
69
|
+
files?: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse command line arguments for trace-gen
|
|
73
|
+
*
|
|
74
|
+
* @param argv - Process argv array
|
|
75
|
+
* @returns Parsed arguments
|
|
76
|
+
*/
|
|
77
|
+
export declare function parseTraceArgs(argv: string[]): TraceArgs;
|
|
78
|
+
/**
|
|
79
|
+
* Build a trace entry from WU and commit data
|
|
80
|
+
*
|
|
81
|
+
* @param input - Input data containing WU info, commits, and files
|
|
82
|
+
* @returns Trace entry with summary statistics
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildTraceEntry(input: TraceInput): TraceEntry;
|