bmalph 2.5.0 → 2.6.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/README.md +45 -33
- package/dist/cli.js +12 -3
- package/dist/cli.js.map +1 -0
- package/dist/commands/check-updates.js +2 -17
- package/dist/commands/check-updates.js.map +1 -0
- package/dist/commands/doctor.js +6 -8
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/implement.js +6 -4
- package/dist/commands/implement.js.map +1 -0
- package/dist/commands/init.js +25 -46
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/reset.js +7 -10
- package/dist/commands/reset.js.map +1 -0
- package/dist/commands/run.js +46 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/status.js +4 -2
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/upgrade.js +7 -10
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/watch.js +5 -5
- package/dist/commands/watch.js.map +1 -0
- package/dist/installer.js +11 -28
- package/dist/installer.js.map +1 -0
- package/dist/platform/aider.js +7 -63
- package/dist/platform/aider.js.map +1 -0
- package/dist/platform/claude-code.js +5 -39
- package/dist/platform/claude-code.js.map +1 -0
- package/dist/platform/codex.js +7 -59
- package/dist/platform/codex.js.map +1 -0
- package/dist/platform/copilot.js +10 -65
- package/dist/platform/copilot.js.map +1 -0
- package/dist/platform/cursor.js +7 -63
- package/dist/platform/cursor.js.map +1 -0
- package/dist/platform/detect.js +2 -1
- package/dist/platform/detect.js.map +1 -0
- package/dist/platform/doctor-checks.js +61 -0
- package/dist/platform/doctor-checks.js.map +1 -0
- package/dist/platform/index.js +1 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/instructions-snippet.js +75 -0
- package/dist/platform/instructions-snippet.js.map +1 -0
- package/dist/platform/registry.js +7 -0
- package/dist/platform/registry.js.map +1 -0
- package/dist/platform/resolve.js +1 -0
- package/dist/platform/resolve.js.map +1 -0
- package/dist/platform/types.js +1 -0
- package/dist/platform/types.js.map +1 -0
- package/dist/platform/windsurf.js +7 -63
- package/dist/platform/windsurf.js.map +1 -0
- package/dist/reset.js +6 -20
- package/dist/reset.js.map +1 -0
- package/dist/run/ralph-process.js +89 -0
- package/dist/run/ralph-process.js.map +1 -0
- package/dist/run/run-dashboard.js +104 -0
- package/dist/run/run-dashboard.js.map +1 -0
- package/dist/run/types.js +2 -0
- package/dist/run/types.js.map +1 -0
- package/dist/transition/artifact-scan.js +3 -2
- package/dist/transition/artifact-scan.js.map +1 -0
- package/dist/transition/artifacts.js +2 -1
- package/dist/transition/artifacts.js.map +1 -0
- package/dist/transition/context.js +1 -0
- package/dist/transition/context.js.map +1 -0
- package/dist/transition/fix-plan.js +1 -0
- package/dist/transition/fix-plan.js.map +1 -0
- package/dist/transition/index.js +1 -0
- package/dist/transition/index.js.map +1 -0
- package/dist/transition/orchestration.js +3 -2
- package/dist/transition/orchestration.js.map +1 -0
- package/dist/transition/preflight.js +1 -0
- package/dist/transition/preflight.js.map +1 -0
- package/dist/transition/specs-changelog.js +3 -2
- package/dist/transition/specs-changelog.js.map +1 -0
- package/dist/transition/specs-index.js +3 -2
- package/dist/transition/specs-index.js.map +1 -0
- package/dist/transition/story-parsing.js +1 -0
- package/dist/transition/story-parsing.js.map +1 -0
- package/dist/transition/tech-stack.js +1 -0
- package/dist/transition/tech-stack.js.map +1 -0
- package/dist/transition/types.js +1 -0
- package/dist/transition/types.js.map +1 -0
- package/dist/utils/config.js +3 -2
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/constants.js +8 -49
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/dryrun.js +1 -20
- package/dist/utils/dryrun.js.map +1 -0
- package/dist/utils/errors.js +1 -19
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/file-system.js +34 -3
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/github.js +21 -8
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/json.js +2 -1
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/logger.js +1 -14
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/state.js +3 -2
- package/dist/utils/state.js.map +1 -0
- package/dist/utils/validate.js +9 -1
- package/dist/utils/validate.js.map +1 -0
- package/dist/watch/dashboard.js +1 -0
- package/dist/watch/dashboard.js.map +1 -0
- package/dist/watch/file-watcher.js +5 -2
- package/dist/watch/file-watcher.js.map +1 -0
- package/dist/watch/renderer.js +1 -0
- package/dist/watch/renderer.js.map +1 -0
- package/dist/watch/state-reader.js +19 -9
- package/dist/watch/state-reader.js.map +1 -0
- package/dist/watch/types.js +1 -0
- package/dist/watch/types.js.map +1 -0
- package/package.json +3 -5
- package/ralph/drivers/copilot.sh +89 -0
- package/ralph/templates/ralphrc.template +1 -1
- package/slash-commands/bmalph-watch.md +2 -0
- package/dist/cli.d.ts +0 -1
- package/dist/commands/check-updates.d.ts +0 -5
- package/dist/commands/doctor.d.ts +0 -40
- package/dist/commands/implement.d.ts +0 -6
- package/dist/commands/init.d.ts +0 -9
- package/dist/commands/reset.d.ts +0 -7
- package/dist/commands/status.d.ts +0 -7
- package/dist/commands/upgrade.d.ts +0 -7
- package/dist/commands/watch.d.ts +0 -6
- package/dist/installer.d.ts +0 -33
- package/dist/platform/aider.d.ts +0 -2
- package/dist/platform/claude-code.d.ts +0 -2
- package/dist/platform/codex.d.ts +0 -2
- package/dist/platform/copilot.d.ts +0 -2
- package/dist/platform/cursor.d.ts +0 -2
- package/dist/platform/detect.d.ts +0 -7
- package/dist/platform/index.d.ts +0 -4
- package/dist/platform/registry.d.ts +0 -4
- package/dist/platform/resolve.d.ts +0 -8
- package/dist/platform/types.d.ts +0 -41
- package/dist/platform/windsurf.d.ts +0 -2
- package/dist/reset.d.ts +0 -18
- package/dist/transition/artifact-scan.d.ts +0 -27
- package/dist/transition/artifacts.d.ts +0 -1
- package/dist/transition/context.d.ts +0 -19
- package/dist/transition/fix-plan.d.ts +0 -21
- package/dist/transition/index.d.ts +0 -9
- package/dist/transition/orchestration.d.ts +0 -2
- package/dist/transition/preflight.d.ts +0 -6
- package/dist/transition/specs-changelog.d.ts +0 -3
- package/dist/transition/specs-index.d.ts +0 -22
- package/dist/transition/story-parsing.d.ts +0 -7
- package/dist/transition/tech-stack.d.ts +0 -3
- package/dist/transition/types.d.ts +0 -82
- package/dist/utils/config.d.ts +0 -13
- package/dist/utils/constants.d.ts +0 -70
- package/dist/utils/dryrun.d.ts +0 -7
- package/dist/utils/errors.d.ts +0 -63
- package/dist/utils/file-system.d.ts +0 -24
- package/dist/utils/github.d.ts +0 -83
- package/dist/utils/json.d.ts +0 -7
- package/dist/utils/logger.d.ts +0 -9
- package/dist/utils/state.d.ts +0 -24
- package/dist/utils/validate.d.ts +0 -44
- package/dist/watch/dashboard.d.ts +0 -4
- package/dist/watch/file-watcher.d.ts +0 -9
- package/dist/watch/renderer.d.ts +0 -16
- package/dist/watch/state-reader.d.ts +0 -9
- package/dist/watch/types.d.ts +0 -55
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Story, FixPlanItemWithTitle } from "./types.js";
|
|
2
|
-
export declare function generateFixPlan(stories: Story[], storiesFileName?: string): string;
|
|
3
|
-
export declare function hasFixPlanProgress(content: string): boolean;
|
|
4
|
-
export declare function parseFixPlan(content: string): FixPlanItemWithTitle[];
|
|
5
|
-
/**
|
|
6
|
-
* Detects completed stories that are no longer in the new BMAD output.
|
|
7
|
-
* Returns warnings for each orphaned completed story.
|
|
8
|
-
*/
|
|
9
|
-
export declare function detectOrphanedCompletedStories(existingItems: FixPlanItemWithTitle[], newStoryIds: Set<string>): string[];
|
|
10
|
-
/**
|
|
11
|
-
* Detects stories that may have been renumbered by comparing titles.
|
|
12
|
-
* Returns warnings when a completed story's title appears under a different ID.
|
|
13
|
-
* Skips stories that were already auto-preserved via title-based merge.
|
|
14
|
-
*/
|
|
15
|
-
export declare function detectRenumberedStories(existingItems: FixPlanItemWithTitle[], newStories: Story[], preservedIds?: Set<string>): string[];
|
|
16
|
-
export declare function normalizeTitle(title: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Builds a map from normalized (lowercased) title to story ID for completed items.
|
|
19
|
-
*/
|
|
20
|
-
export declare function buildCompletedTitleMap(items: FixPlanItemWithTitle[]): Map<string, string>;
|
|
21
|
-
export declare function mergeFixPlanProgress(newFixPlan: string, completedIds: Set<string>, titleMap?: Map<string, string>, completedTitles?: Map<string, string>): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type { ProjectContext, Story, TechStack, FixPlanItem, SpecsChange, TransitionResult, SpecFileType, Priority, SpecFileMetadata, SpecsIndex, } from "./types.js";
|
|
2
|
-
export { parseStories, parseStoriesWithWarnings } from "./story-parsing.js";
|
|
3
|
-
export { generateFixPlan, hasFixPlanProgress, parseFixPlan, mergeFixPlanProgress, } from "./fix-plan.js";
|
|
4
|
-
export { detectTechStack, customizeAgentMd } from "./tech-stack.js";
|
|
5
|
-
export { findArtifactsDir } from "./artifacts.js";
|
|
6
|
-
export { extractSection, extractProjectContext, generateProjectContextMd, generatePrompt, } from "./context.js";
|
|
7
|
-
export { generateSpecsChangelog, formatChangelog } from "./specs-changelog.js";
|
|
8
|
-
export { detectSpecFileType, determinePriority, extractDescription, generateSpecsIndex, formatSpecsIndexMd, } from "./specs-index.js";
|
|
9
|
-
export { runTransition } from "./orchestration.js";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Story, PreflightIssue, PreflightResult } from "./types.js";
|
|
2
|
-
export declare function validatePrd(content: string | null): PreflightIssue[];
|
|
3
|
-
export declare function validateArchitecture(content: string | null): PreflightIssue[];
|
|
4
|
-
export declare function validateStories(stories: Story[], parseWarnings: string[]): PreflightIssue[];
|
|
5
|
-
export declare function validateReadiness(content: string | null): PreflightIssue[];
|
|
6
|
-
export declare function runPreflight(artifactContents: Map<string, string>, files: string[], stories: Story[], parseWarnings: string[]): PreflightResult;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { SpecFileType, Priority, SpecsIndex } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Detects the type of a spec file based on its filename.
|
|
4
|
-
*/
|
|
5
|
-
export declare function detectSpecFileType(filename: string, content: string): SpecFileType;
|
|
6
|
-
/**
|
|
7
|
-
* Determines the reading priority for a spec file based on its type.
|
|
8
|
-
*/
|
|
9
|
-
export declare function determinePriority(type: SpecFileType, _size: number): Priority;
|
|
10
|
-
/**
|
|
11
|
-
* Extracts a one-line description from file content.
|
|
12
|
-
* Prefers the first heading, falls back to first non-empty line.
|
|
13
|
-
*/
|
|
14
|
-
export declare function extractDescription(content: string, maxLength?: number): string;
|
|
15
|
-
/**
|
|
16
|
-
* Generates a specs index from a specs directory.
|
|
17
|
-
*/
|
|
18
|
-
export declare function generateSpecsIndex(specsDir: string): Promise<SpecsIndex>;
|
|
19
|
-
/**
|
|
20
|
-
* Formats a specs index as markdown.
|
|
21
|
-
*/
|
|
22
|
-
export declare function formatSpecsIndexMd(index: SpecsIndex): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Story } from "./types.js";
|
|
2
|
-
export interface ParseStoriesResult {
|
|
3
|
-
stories: Story[];
|
|
4
|
-
warnings: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare function parseStories(content: string): Story[];
|
|
7
|
-
export declare function parseStoriesWithWarnings(content: string): ParseStoriesResult;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
export interface ProjectContext {
|
|
2
|
-
projectGoals: string;
|
|
3
|
-
successMetrics: string;
|
|
4
|
-
architectureConstraints: string;
|
|
5
|
-
technicalRisks: string;
|
|
6
|
-
scopeBoundaries: string;
|
|
7
|
-
targetUsers: string;
|
|
8
|
-
nonFunctionalRequirements: string;
|
|
9
|
-
designGuidelines: string;
|
|
10
|
-
researchInsights: string;
|
|
11
|
-
}
|
|
12
|
-
export interface Story {
|
|
13
|
-
epic: string;
|
|
14
|
-
epicDescription: string;
|
|
15
|
-
id: string;
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
acceptanceCriteria: string[];
|
|
19
|
-
}
|
|
20
|
-
export interface TechStack {
|
|
21
|
-
setup: string;
|
|
22
|
-
test: string;
|
|
23
|
-
build: string;
|
|
24
|
-
dev: string;
|
|
25
|
-
}
|
|
26
|
-
export interface FixPlanItem {
|
|
27
|
-
id: string;
|
|
28
|
-
completed: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface FixPlanItemWithTitle extends FixPlanItem {
|
|
31
|
-
title?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface TruncationInfo {
|
|
34
|
-
field: string;
|
|
35
|
-
originalLength: number;
|
|
36
|
-
truncatedTo: number;
|
|
37
|
-
}
|
|
38
|
-
export interface SpecsChange {
|
|
39
|
-
file: string;
|
|
40
|
-
status: "added" | "modified" | "removed";
|
|
41
|
-
summary?: string;
|
|
42
|
-
}
|
|
43
|
-
export type SpecFileType = "prd" | "architecture" | "stories" | "ux" | "test-design" | "readiness" | "sprint" | "brainstorm" | "research" | "other";
|
|
44
|
-
export type Priority = "critical" | "high" | "medium" | "low";
|
|
45
|
-
export interface SpecFileMetadata {
|
|
46
|
-
path: string;
|
|
47
|
-
size: number;
|
|
48
|
-
type: SpecFileType;
|
|
49
|
-
priority: Priority;
|
|
50
|
-
description: string;
|
|
51
|
-
}
|
|
52
|
-
export interface SpecsIndex {
|
|
53
|
-
generatedAt: string;
|
|
54
|
-
totalFiles: number;
|
|
55
|
-
totalSizeKb: number;
|
|
56
|
-
files: SpecFileMetadata[];
|
|
57
|
-
}
|
|
58
|
-
export type PreflightSeverity = "error" | "warning" | "info";
|
|
59
|
-
export interface PreflightIssue {
|
|
60
|
-
id: string;
|
|
61
|
-
severity: PreflightSeverity;
|
|
62
|
-
message: string;
|
|
63
|
-
suggestion?: string;
|
|
64
|
-
}
|
|
65
|
-
export interface PreflightResult {
|
|
66
|
-
issues: PreflightIssue[];
|
|
67
|
-
pass: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface TransitionOptions {
|
|
70
|
-
force?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export interface GeneratedFile {
|
|
73
|
-
path: string;
|
|
74
|
-
action: "created" | "updated";
|
|
75
|
-
}
|
|
76
|
-
export interface TransitionResult {
|
|
77
|
-
storiesCount: number;
|
|
78
|
-
warnings: string[];
|
|
79
|
-
fixPlanPreserved: boolean;
|
|
80
|
-
preflightIssues?: PreflightIssue[];
|
|
81
|
-
generatedFiles: GeneratedFile[];
|
|
82
|
-
}
|
package/dist/utils/config.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PlatformId } from "../platform/types.js";
|
|
2
|
-
export interface UpstreamVersions {
|
|
3
|
-
bmadCommit: string;
|
|
4
|
-
}
|
|
5
|
-
export interface BmalphConfig {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
createdAt: string;
|
|
9
|
-
platform?: PlatformId;
|
|
10
|
-
upstreamVersions?: UpstreamVersions;
|
|
11
|
-
}
|
|
12
|
-
export declare function readConfig(projectDir: string): Promise<BmalphConfig | null>;
|
|
13
|
-
export declare function writeConfig(projectDir: string, config: BmalphConfig): Promise<void>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized constants for bmalph.
|
|
3
|
-
*
|
|
4
|
-
* Path constants define the standard directory names used throughout
|
|
5
|
-
* the bmalph project for BMAD, Ralph, and Claude Code integration.
|
|
6
|
-
*
|
|
7
|
-
* Numeric thresholds are used for validation, file processing, and health checks.
|
|
8
|
-
*/
|
|
9
|
-
/** Maximum allowed project name length */
|
|
10
|
-
export declare const MAX_PROJECT_NAME_LENGTH = 100;
|
|
11
|
-
/** File size threshold for "large file" warnings (50 KB) */
|
|
12
|
-
export declare const LARGE_FILE_THRESHOLD_BYTES = 50000;
|
|
13
|
-
/** Default max length for extracted content snippets */
|
|
14
|
-
export declare const DEFAULT_SNIPPET_MAX_LENGTH = 60;
|
|
15
|
-
/** Max length for section extraction from documents (increased to preserve full BMAD specs) */
|
|
16
|
-
export declare const SECTION_EXTRACT_MAX_LENGTH = 5000;
|
|
17
|
-
/** Max characters for diff line preview */
|
|
18
|
-
export declare const DIFF_LINE_PREVIEW_LENGTH = 50;
|
|
19
|
-
/** Session age warning threshold (24 hours in milliseconds) */
|
|
20
|
-
export declare const SESSION_AGE_WARNING_MS: number;
|
|
21
|
-
/** API call usage warning threshold (percentage) */
|
|
22
|
-
export declare const API_USAGE_WARNING_PERCENT = 90;
|
|
23
|
-
/** Ralph working directory (contains loop, specs, logs) */
|
|
24
|
-
export declare const RALPH_DIR = ".ralph";
|
|
25
|
-
/** BMAD agents and workflows directory */
|
|
26
|
-
export declare const BMAD_DIR = "_bmad";
|
|
27
|
-
/** bmalph state directory (config, phase tracking) */
|
|
28
|
-
export declare const BMALPH_DIR = "bmalph";
|
|
29
|
-
/** BMAD output directory (planning artifacts) */
|
|
30
|
-
export declare const BMAD_OUTPUT_DIR = "_bmad-output";
|
|
31
|
-
/** Ralph logs directory */
|
|
32
|
-
export declare const RALPH_LOGS_DIR = ".ralph/logs";
|
|
33
|
-
/** Ralph specs directory (copied from _bmad-output) */
|
|
34
|
-
export declare const RALPH_SPECS_DIR = ".ralph/specs";
|
|
35
|
-
/** Claude Code slash commands directory */
|
|
36
|
-
export declare const CLAUDE_COMMANDS_DIR = ".claude/commands";
|
|
37
|
-
/** bmalph state subdirectory (inside BMALPH_DIR) */
|
|
38
|
-
export declare const STATE_DIR = "bmalph/state";
|
|
39
|
-
/** bmalph config file path */
|
|
40
|
-
export declare const CONFIG_FILE = "bmalph/config.json";
|
|
41
|
-
/** Ralph status file path */
|
|
42
|
-
export declare const RALPH_STATUS_FILE = ".ralph/status.json";
|
|
43
|
-
/**
|
|
44
|
-
* Get absolute path to Ralph directory for a project.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getRalphDir(projectDir: string): string;
|
|
47
|
-
/**
|
|
48
|
-
* Get absolute path to BMAD directory for a project.
|
|
49
|
-
*/
|
|
50
|
-
export declare function getBmadDir(projectDir: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* Get absolute path to bmalph state directory for a project.
|
|
53
|
-
*/
|
|
54
|
-
export declare function getBmalphDir(projectDir: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* Get absolute path to BMAD output directory for a project.
|
|
57
|
-
*/
|
|
58
|
-
export declare function getBmadOutputDir(projectDir: string): string;
|
|
59
|
-
/**
|
|
60
|
-
* Get absolute path to Ralph logs directory for a project.
|
|
61
|
-
*/
|
|
62
|
-
export declare function getRalphLogsDir(projectDir: string): string;
|
|
63
|
-
/**
|
|
64
|
-
* Get absolute path to Ralph specs directory for a project.
|
|
65
|
-
*/
|
|
66
|
-
export declare function getRalphSpecsDir(projectDir: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Get absolute path to Claude commands directory for a project.
|
|
69
|
-
*/
|
|
70
|
-
export declare function getClaudeCommandsDir(projectDir: string): string;
|
package/dist/utils/dryrun.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface DryRunAction {
|
|
2
|
-
type: "create" | "modify" | "skip" | "delete" | "warn";
|
|
3
|
-
path: string;
|
|
4
|
-
reason?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function logDryRunAction(action: DryRunAction): void;
|
|
7
|
-
export declare function formatDryRunSummary(actions: DryRunAction[]): string;
|
package/dist/utils/errors.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error formatting utilities for consistent error handling.
|
|
3
|
-
*
|
|
4
|
-
* Provides helper functions to safely extract error messages from
|
|
5
|
-
* unknown error types (catch blocks receive `unknown` in TypeScript).
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Extract error message from an unknown error value.
|
|
9
|
-
*
|
|
10
|
-
* @param error - Any caught error (Error instance, string, or other)
|
|
11
|
-
* @returns The error message as a string
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* try {
|
|
16
|
-
* await riskyOperation();
|
|
17
|
-
* } catch (err) {
|
|
18
|
-
* console.error(formatError(err));
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Check if an error is an ENOENT (file not found) filesystem error.
|
|
24
|
-
*
|
|
25
|
-
* @param err - Any caught error value
|
|
26
|
-
* @returns true if the error is an Error with code "ENOENT"
|
|
27
|
-
*/
|
|
28
|
-
export declare function isEnoent(err: unknown): boolean;
|
|
29
|
-
export declare function formatError(error: unknown): string;
|
|
30
|
-
/**
|
|
31
|
-
* Create a formatted error message with a prefix.
|
|
32
|
-
*
|
|
33
|
-
* @param prefix - Context for the error (e.g., "Failed to read file")
|
|
34
|
-
* @param error - The caught error
|
|
35
|
-
* @returns Formatted message like "Failed to read file: <error message>"
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* try {
|
|
40
|
-
* await readFile(path);
|
|
41
|
-
* } catch (err) {
|
|
42
|
-
* throw new Error(formatErrorMessage("Failed to read config", err));
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function formatErrorMessage(prefix: string, error: unknown): string;
|
|
47
|
-
/**
|
|
48
|
-
* Wrap an async command function with standard error handling.
|
|
49
|
-
*
|
|
50
|
-
* Catches any errors, prints them in red to stderr, and sets process.exitCode to 1.
|
|
51
|
-
* Uses process.exitCode instead of process.exit() to allow graceful cleanup.
|
|
52
|
-
*
|
|
53
|
-
* @param fn - Async function to execute
|
|
54
|
-
* @returns Promise that resolves when the function completes (or error is handled)
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* export async function myCommand(options: MyOptions): Promise<void> {
|
|
59
|
-
* await withErrorHandling(() => runMyCommand(options));
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export declare function withErrorHandling(fn: () => Promise<void>): Promise<void>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks whether a file or directory exists at the given path.
|
|
3
|
-
*/
|
|
4
|
-
export declare function exists(path: string): Promise<boolean>;
|
|
5
|
-
/**
|
|
6
|
-
* Writes content to a file atomically using a temp file + rename.
|
|
7
|
-
* Prevents partial writes from corrupting the target file.
|
|
8
|
-
*/
|
|
9
|
-
export declare function atomicWriteFile(target: string, content: string): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Recursively gets all files from a directory.
|
|
12
|
-
* Returns relative paths using forward slashes (cross-platform).
|
|
13
|
-
*/
|
|
14
|
-
export declare function getFilesRecursive(dir: string, basePath?: string): Promise<string[]>;
|
|
15
|
-
export interface FileWithContent {
|
|
16
|
-
path: string;
|
|
17
|
-
size: number;
|
|
18
|
-
content: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Recursively gets all markdown files from a directory with their content.
|
|
22
|
-
* Returns relative paths using forward slashes (cross-platform).
|
|
23
|
-
*/
|
|
24
|
-
export declare function getMarkdownFilesWithContent(dir: string, basePath?: string): Promise<FileWithContent[]>;
|
package/dist/utils/github.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { BundledVersions } from "../installer.js";
|
|
2
|
-
export interface RepoInfo {
|
|
3
|
-
owner: string;
|
|
4
|
-
repo: string;
|
|
5
|
-
branch: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CommitInfo {
|
|
8
|
-
sha: string;
|
|
9
|
-
shortSha: string;
|
|
10
|
-
message: string;
|
|
11
|
-
date: string;
|
|
12
|
-
}
|
|
13
|
-
export type GitHubErrorType = "network" | "timeout" | "rate-limit" | "not-found" | "api-error";
|
|
14
|
-
export interface GitHubError {
|
|
15
|
-
type: GitHubErrorType;
|
|
16
|
-
message: string;
|
|
17
|
-
repo?: string;
|
|
18
|
-
status?: number;
|
|
19
|
-
}
|
|
20
|
-
export type FetchResult<T> = {
|
|
21
|
-
success: true;
|
|
22
|
-
data: T;
|
|
23
|
-
} | {
|
|
24
|
-
success: false;
|
|
25
|
-
error: GitHubError;
|
|
26
|
-
};
|
|
27
|
-
export interface UpstreamStatus {
|
|
28
|
-
bundledSha: string;
|
|
29
|
-
latestSha: string;
|
|
30
|
-
isUpToDate: boolean;
|
|
31
|
-
compareUrl: string;
|
|
32
|
-
}
|
|
33
|
-
export interface CheckUpstreamResult {
|
|
34
|
-
bmad: UpstreamStatus | null;
|
|
35
|
-
errors: GitHubError[];
|
|
36
|
-
}
|
|
37
|
-
interface FetchOptions {
|
|
38
|
-
timeoutMs?: number;
|
|
39
|
-
}
|
|
40
|
-
interface GitHubClientOptions {
|
|
41
|
-
cacheTtlMs?: number;
|
|
42
|
-
maxCacheSize?: number;
|
|
43
|
-
}
|
|
44
|
-
interface CacheStats {
|
|
45
|
-
size: number;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* GitHub API client with instance-level caching.
|
|
49
|
-
* Each instance maintains its own cache, improving testability.
|
|
50
|
-
*/
|
|
51
|
-
export declare class GitHubClient {
|
|
52
|
-
private cache;
|
|
53
|
-
private cacheTtlMs;
|
|
54
|
-
private maxCacheSize;
|
|
55
|
-
constructor(options?: GitHubClientOptions);
|
|
56
|
-
clearCache(): void;
|
|
57
|
-
getCacheStats(): CacheStats;
|
|
58
|
-
private getCacheKey;
|
|
59
|
-
private getCachedResult;
|
|
60
|
-
private setCachedResult;
|
|
61
|
-
fetchLatestCommit(repo: RepoInfo, options?: FetchOptions): Promise<FetchResult<CommitInfo>>;
|
|
62
|
-
checkUpstream(bundled: BundledVersions): Promise<CheckUpstreamResult>;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Determines why upstream checks were skipped based on error types.
|
|
66
|
-
*/
|
|
67
|
-
export declare function getSkipReason(errors: GitHubError[]): string;
|
|
68
|
-
/**
|
|
69
|
-
* Clear the default client's cache.
|
|
70
|
-
* For testing, prefer creating a new GitHubClient instance instead.
|
|
71
|
-
*/
|
|
72
|
-
export declare function clearCache(): void;
|
|
73
|
-
/**
|
|
74
|
-
* Fetch the latest commit from a GitHub repository.
|
|
75
|
-
* Uses the default shared client instance.
|
|
76
|
-
*/
|
|
77
|
-
export declare function fetchLatestCommit(repo: RepoInfo, options?: FetchOptions): Promise<FetchResult<CommitInfo>>;
|
|
78
|
-
/**
|
|
79
|
-
* Check upstream repositories for updates.
|
|
80
|
-
* Uses the default shared client instance.
|
|
81
|
-
*/
|
|
82
|
-
export declare function checkUpstream(bundled: BundledVersions): Promise<CheckUpstreamResult>;
|
|
83
|
-
export {};
|
package/dist/utils/json.d.ts
DELETED
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function setVerbose(value: boolean): void;
|
|
2
|
-
export declare function isVerbose(): boolean;
|
|
3
|
-
export declare function setQuiet(value: boolean): void;
|
|
4
|
-
export declare function isQuiet(): boolean;
|
|
5
|
-
export declare function debug(message: string): void;
|
|
6
|
-
export declare function info(message: string): void;
|
|
7
|
-
export declare function warn(message: string): void;
|
|
8
|
-
export declare function error(message: string): void;
|
|
9
|
-
export declare function success(message: string): void;
|
package/dist/utils/state.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { RalphLoopStatus } from "./validate.js";
|
|
2
|
-
export interface BmalphState {
|
|
3
|
-
currentPhase: number;
|
|
4
|
-
status: "planning" | "implementing" | "completed";
|
|
5
|
-
startedAt: string;
|
|
6
|
-
lastUpdated: string;
|
|
7
|
-
}
|
|
8
|
-
export interface PhaseCommand {
|
|
9
|
-
code: string;
|
|
10
|
-
name: string;
|
|
11
|
-
agent: string;
|
|
12
|
-
description: string;
|
|
13
|
-
required: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface PhaseInfo {
|
|
16
|
-
name: string;
|
|
17
|
-
agent: string;
|
|
18
|
-
commands: PhaseCommand[];
|
|
19
|
-
}
|
|
20
|
-
export declare function readState(projectDir: string): Promise<BmalphState | null>;
|
|
21
|
-
export declare function writeState(projectDir: string, state: BmalphState): Promise<void>;
|
|
22
|
-
export declare function getPhaseLabel(phase: number): string;
|
|
23
|
-
export declare function getPhaseInfo(phase: number): PhaseInfo;
|
|
24
|
-
export declare function readRalphStatus(projectDir: string): Promise<RalphLoopStatus>;
|
package/dist/utils/validate.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { BmalphConfig } from "./config.js";
|
|
2
|
-
import type { BmalphState } from "./state.js";
|
|
3
|
-
export declare function validateConfig(data: unknown): BmalphConfig;
|
|
4
|
-
export declare function validateState(data: unknown): BmalphState;
|
|
5
|
-
export interface CircuitBreakerState {
|
|
6
|
-
state: "CLOSED" | "HALF_OPEN" | "OPEN";
|
|
7
|
-
consecutive_no_progress: number;
|
|
8
|
-
reason?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function validateCircuitBreakerState(data: unknown): CircuitBreakerState;
|
|
11
|
-
export interface RalphSession {
|
|
12
|
-
session_id: string;
|
|
13
|
-
created_at: string;
|
|
14
|
-
last_used?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function validateRalphSession(data: unknown): RalphSession;
|
|
17
|
-
export interface RalphApiStatus {
|
|
18
|
-
calls_made_this_hour: number;
|
|
19
|
-
max_calls_per_hour: number;
|
|
20
|
-
status?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare function validateRalphApiStatus(data: unknown): RalphApiStatus;
|
|
23
|
-
export interface RalphLoopStatus {
|
|
24
|
-
loopCount: number;
|
|
25
|
-
status: "running" | "blocked" | "completed" | "not_started";
|
|
26
|
-
tasksCompleted: number;
|
|
27
|
-
tasksTotal: number;
|
|
28
|
-
}
|
|
29
|
-
export declare function validateRalphLoopStatus(data: unknown): RalphLoopStatus;
|
|
30
|
-
export declare function normalizeRalphStatus(data: unknown): RalphLoopStatus;
|
|
31
|
-
/**
|
|
32
|
-
* Validates a project name for filesystem safety.
|
|
33
|
-
* Checks for:
|
|
34
|
-
* - Empty names
|
|
35
|
-
* - Max length (100 characters)
|
|
36
|
-
* - Invalid filesystem characters (< > : " / \ | ? *)
|
|
37
|
-
* - Windows reserved names (CON, PRN, AUX, NUL, COM1-9, LPT1-9)
|
|
38
|
-
* - Leading/trailing whitespace or dots
|
|
39
|
-
*
|
|
40
|
-
* @param name - The project name to validate
|
|
41
|
-
* @returns The validated name (unchanged if valid)
|
|
42
|
-
* @throws Error if the name is invalid
|
|
43
|
-
*/
|
|
44
|
-
export declare function validateProjectName(name: string): string;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { WatchOptions } from "./types.js";
|
|
2
|
-
export declare function createRefreshCallback(projectDir: string, write: (s: string) => void): () => Promise<void>;
|
|
3
|
-
export declare function setupTerminal(): () => void;
|
|
4
|
-
export declare function startDashboard(options: WatchOptions): Promise<void>;
|
package/dist/watch/renderer.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DashboardState, LoopInfo, CircuitBreakerInfo, StoryProgress, AnalysisInfo, LogEntry, ExecutionProgress, SessionInfo } from "./types.js";
|
|
2
|
-
export declare function padRight(str: string, len: number): string;
|
|
3
|
-
export declare function progressBar(completed: number, total: number, width: number): string;
|
|
4
|
-
export declare function formatSessionAge(createdAt: string): string;
|
|
5
|
-
export declare function formatStatus(status: string): string;
|
|
6
|
-
export declare function formatCBState(state: string): string;
|
|
7
|
-
export declare function box(title: string, lines: string[], cols: number): string;
|
|
8
|
-
export declare function renderHeader(cols: number): string;
|
|
9
|
-
export declare function renderLoopPanel(loop: LoopInfo | null, execution: ExecutionProgress | null, session: SessionInfo | null, cols: number): string;
|
|
10
|
-
export declare function renderCircuitBreakerPanel(cb: CircuitBreakerInfo | null, cols: number): string;
|
|
11
|
-
export declare function renderStoriesPanel(stories: StoryProgress | null, cols: number): string;
|
|
12
|
-
export declare function renderSideBySide(left: string, right: string, cols: number): string;
|
|
13
|
-
export declare function renderAnalysisPanel(analysis: AnalysisInfo | null, cols: number): string;
|
|
14
|
-
export declare function renderLogsPanel(logs: LogEntry[], cols: number): string;
|
|
15
|
-
export declare function renderFooter(lastUpdated: Date, cols: number): string;
|
|
16
|
-
export declare function renderDashboard(state: DashboardState, cols?: number): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DashboardState, LoopInfo, CircuitBreakerInfo, StoryProgress, AnalysisInfo, ExecutionProgress, SessionInfo, LogEntry } from "./types.js";
|
|
2
|
-
export declare function readDashboardState(projectDir: string): Promise<DashboardState>;
|
|
3
|
-
export declare function readLoopInfo(projectDir: string): Promise<LoopInfo | null>;
|
|
4
|
-
export declare function readCircuitBreakerInfo(projectDir: string): Promise<CircuitBreakerInfo | null>;
|
|
5
|
-
export declare function readStoryProgress(projectDir: string): Promise<StoryProgress | null>;
|
|
6
|
-
export declare function readAnalysisInfo(projectDir: string): Promise<AnalysisInfo | null>;
|
|
7
|
-
export declare function readExecutionProgress(projectDir: string): Promise<ExecutionProgress | null>;
|
|
8
|
-
export declare function readSessionInfo(projectDir: string): Promise<SessionInfo | null>;
|
|
9
|
-
export declare function readRecentLogs(projectDir: string, maxLines?: number): Promise<LogEntry[]>;
|
package/dist/watch/types.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export interface LoopInfo {
|
|
2
|
-
loopCount: number;
|
|
3
|
-
status: string;
|
|
4
|
-
lastAction: string;
|
|
5
|
-
callsMadeThisHour: number;
|
|
6
|
-
maxCallsPerHour: number;
|
|
7
|
-
}
|
|
8
|
-
export interface CircuitBreakerInfo {
|
|
9
|
-
state: "CLOSED" | "HALF_OPEN" | "OPEN";
|
|
10
|
-
consecutiveNoProgress: number;
|
|
11
|
-
totalOpens: number;
|
|
12
|
-
reason?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface StoryProgress {
|
|
15
|
-
completed: number;
|
|
16
|
-
total: number;
|
|
17
|
-
nextStory: string | null;
|
|
18
|
-
}
|
|
19
|
-
export interface AnalysisInfo {
|
|
20
|
-
filesModified: number;
|
|
21
|
-
confidenceScore: number;
|
|
22
|
-
isTestOnly: boolean;
|
|
23
|
-
isStuck: boolean;
|
|
24
|
-
exitSignal: boolean;
|
|
25
|
-
hasPermissionDenials: boolean;
|
|
26
|
-
permissionDenialCount: number;
|
|
27
|
-
}
|
|
28
|
-
export interface ExecutionProgress {
|
|
29
|
-
status: "executing" | "idle";
|
|
30
|
-
elapsedSeconds: number;
|
|
31
|
-
}
|
|
32
|
-
export interface SessionInfo {
|
|
33
|
-
createdAt: string;
|
|
34
|
-
lastUsed?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface LogEntry {
|
|
37
|
-
timestamp: string;
|
|
38
|
-
level: string;
|
|
39
|
-
message: string;
|
|
40
|
-
}
|
|
41
|
-
export interface DashboardState {
|
|
42
|
-
loop: LoopInfo | null;
|
|
43
|
-
circuitBreaker: CircuitBreakerInfo | null;
|
|
44
|
-
stories: StoryProgress | null;
|
|
45
|
-
analysis: AnalysisInfo | null;
|
|
46
|
-
execution: ExecutionProgress | null;
|
|
47
|
-
session: SessionInfo | null;
|
|
48
|
-
recentLogs: LogEntry[];
|
|
49
|
-
ralphCompleted: boolean;
|
|
50
|
-
lastUpdated: Date;
|
|
51
|
-
}
|
|
52
|
-
export interface WatchOptions {
|
|
53
|
-
interval: number;
|
|
54
|
-
projectDir: string;
|
|
55
|
-
}
|