bmalph 2.5.0 → 2.7.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 (176) hide show
  1. package/README.md +50 -36
  2. package/bmad/lite/create-prd.md +145 -0
  3. package/dist/cli.js +13 -4
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/check-updates.js +3 -18
  6. package/dist/commands/check-updates.js.map +1 -0
  7. package/dist/commands/doctor-checks.js +103 -0
  8. package/dist/commands/doctor-checks.js.map +1 -0
  9. package/dist/commands/doctor-health-checks.js +101 -0
  10. package/dist/commands/doctor-health-checks.js.map +1 -0
  11. package/dist/commands/doctor-runtime-checks.js +143 -0
  12. package/dist/commands/doctor-runtime-checks.js.map +1 -0
  13. package/dist/commands/doctor.js +6 -372
  14. package/dist/commands/doctor.js.map +1 -0
  15. package/dist/commands/implement.js +14 -17
  16. package/dist/commands/implement.js.map +1 -0
  17. package/dist/commands/init.js +26 -47
  18. package/dist/commands/init.js.map +1 -0
  19. package/dist/commands/reset.js +7 -10
  20. package/dist/commands/reset.js.map +1 -0
  21. package/dist/commands/run.js +46 -0
  22. package/dist/commands/run.js.map +1 -0
  23. package/dist/commands/status.js +8 -46
  24. package/dist/commands/status.js.map +1 -0
  25. package/dist/commands/upgrade.js +8 -11
  26. package/dist/commands/upgrade.js.map +1 -0
  27. package/dist/commands/watch.js +5 -5
  28. package/dist/commands/watch.js.map +1 -0
  29. package/dist/installer.js +332 -78
  30. package/dist/installer.js.map +1 -0
  31. package/dist/platform/aider.js +8 -64
  32. package/dist/platform/aider.js.map +1 -0
  33. package/dist/platform/claude-code.js +6 -40
  34. package/dist/platform/claude-code.js.map +1 -0
  35. package/dist/platform/codex.js +8 -60
  36. package/dist/platform/codex.js.map +1 -0
  37. package/dist/platform/copilot.js +11 -66
  38. package/dist/platform/copilot.js.map +1 -0
  39. package/dist/platform/cursor.js +10 -65
  40. package/dist/platform/cursor.js.map +1 -0
  41. package/dist/platform/detect.js +2 -1
  42. package/dist/platform/detect.js.map +1 -0
  43. package/dist/platform/doctor-checks.js +70 -0
  44. package/dist/platform/doctor-checks.js.map +1 -0
  45. package/dist/platform/instructions-snippet.js +74 -0
  46. package/dist/platform/instructions-snippet.js.map +1 -0
  47. package/dist/platform/registry.js +7 -0
  48. package/dist/platform/registry.js.map +1 -0
  49. package/dist/platform/resolve.js +1 -0
  50. package/dist/platform/resolve.js.map +1 -0
  51. package/dist/platform/types.js +10 -1
  52. package/dist/platform/types.js.map +1 -0
  53. package/dist/platform/windsurf.js +8 -64
  54. package/dist/platform/windsurf.js.map +1 -0
  55. package/dist/reset.js +24 -27
  56. package/dist/reset.js.map +1 -0
  57. package/dist/run/ralph-process.js +95 -0
  58. package/dist/run/ralph-process.js.map +1 -0
  59. package/dist/run/run-dashboard.js +104 -0
  60. package/dist/run/run-dashboard.js.map +1 -0
  61. package/dist/run/types.js +2 -0
  62. package/dist/run/types.js.map +1 -0
  63. package/dist/transition/artifact-scan.js +6 -15
  64. package/dist/transition/artifact-scan.js.map +1 -0
  65. package/dist/transition/artifacts.js +2 -1
  66. package/dist/transition/artifacts.js.map +1 -0
  67. package/dist/transition/context.js +1 -0
  68. package/dist/transition/context.js.map +1 -0
  69. package/dist/transition/fix-plan.js +1 -0
  70. package/dist/transition/fix-plan.js.map +1 -0
  71. package/dist/transition/index.js +1 -0
  72. package/dist/transition/index.js.map +1 -0
  73. package/dist/transition/orchestration.js +19 -28
  74. package/dist/transition/orchestration.js.map +1 -0
  75. package/dist/transition/preflight.js +1 -0
  76. package/dist/transition/preflight.js.map +1 -0
  77. package/dist/transition/specs-changelog.js +3 -2
  78. package/dist/transition/specs-changelog.js.map +1 -0
  79. package/dist/transition/specs-index.js +7 -6
  80. package/dist/transition/specs-index.js.map +1 -0
  81. package/dist/transition/story-parsing.js +1 -0
  82. package/dist/transition/story-parsing.js.map +1 -0
  83. package/dist/transition/tech-stack.js +2 -1
  84. package/dist/transition/tech-stack.js.map +1 -0
  85. package/dist/transition/types.js +1 -0
  86. package/dist/transition/types.js.map +1 -0
  87. package/dist/utils/artifact-definitions.js +19 -0
  88. package/dist/utils/artifact-definitions.js.map +1 -0
  89. package/dist/utils/config.js +3 -2
  90. package/dist/utils/config.js.map +1 -0
  91. package/dist/utils/constants.js +12 -49
  92. package/dist/utils/constants.js.map +1 -0
  93. package/dist/utils/dryrun.js +1 -20
  94. package/dist/utils/dryrun.js.map +1 -0
  95. package/dist/utils/errors.js +1 -19
  96. package/dist/utils/errors.js.map +1 -0
  97. package/dist/utils/file-system.js +34 -3
  98. package/dist/utils/file-system.js.map +1 -0
  99. package/dist/utils/format-status.js +31 -0
  100. package/dist/utils/format-status.js.map +1 -0
  101. package/dist/utils/github.js +21 -8
  102. package/dist/utils/github.js.map +1 -0
  103. package/dist/utils/json.js +5 -1
  104. package/dist/utils/json.js.map +1 -0
  105. package/dist/utils/logger.js +1 -14
  106. package/dist/utils/logger.js.map +1 -0
  107. package/dist/utils/state.js +3 -2
  108. package/dist/utils/state.js.map +1 -0
  109. package/dist/utils/validate.js +18 -13
  110. package/dist/utils/validate.js.map +1 -0
  111. package/dist/watch/dashboard.js +23 -11
  112. package/dist/watch/dashboard.js.map +1 -0
  113. package/dist/watch/file-watcher.js +5 -2
  114. package/dist/watch/file-watcher.js.map +1 -0
  115. package/dist/watch/renderer.js +2 -15
  116. package/dist/watch/renderer.js.map +1 -0
  117. package/dist/watch/state-reader.js +19 -9
  118. package/dist/watch/state-reader.js.map +1 -0
  119. package/dist/watch/types.js +1 -0
  120. package/dist/watch/types.js.map +1 -0
  121. package/package.json +4 -6
  122. package/ralph/drivers/copilot.sh +89 -0
  123. package/ralph/drivers/cursor.sh +90 -0
  124. package/ralph/ralph_loop.sh +20 -13
  125. package/ralph/templates/ralphrc.template +1 -1
  126. package/slash-commands/bmalph-watch.md +2 -0
  127. package/dist/cli.d.ts +0 -1
  128. package/dist/commands/check-updates.d.ts +0 -5
  129. package/dist/commands/doctor.d.ts +0 -40
  130. package/dist/commands/implement.d.ts +0 -6
  131. package/dist/commands/init.d.ts +0 -9
  132. package/dist/commands/reset.d.ts +0 -7
  133. package/dist/commands/status.d.ts +0 -7
  134. package/dist/commands/upgrade.d.ts +0 -7
  135. package/dist/commands/watch.d.ts +0 -6
  136. package/dist/installer.d.ts +0 -33
  137. package/dist/platform/aider.d.ts +0 -2
  138. package/dist/platform/claude-code.d.ts +0 -2
  139. package/dist/platform/codex.d.ts +0 -2
  140. package/dist/platform/copilot.d.ts +0 -2
  141. package/dist/platform/cursor.d.ts +0 -2
  142. package/dist/platform/detect.d.ts +0 -7
  143. package/dist/platform/index.d.ts +0 -4
  144. package/dist/platform/index.js +0 -3
  145. package/dist/platform/registry.d.ts +0 -4
  146. package/dist/platform/resolve.d.ts +0 -8
  147. package/dist/platform/types.d.ts +0 -41
  148. package/dist/platform/windsurf.d.ts +0 -2
  149. package/dist/reset.d.ts +0 -18
  150. package/dist/transition/artifact-scan.d.ts +0 -27
  151. package/dist/transition/artifacts.d.ts +0 -1
  152. package/dist/transition/context.d.ts +0 -19
  153. package/dist/transition/fix-plan.d.ts +0 -21
  154. package/dist/transition/index.d.ts +0 -9
  155. package/dist/transition/orchestration.d.ts +0 -2
  156. package/dist/transition/preflight.d.ts +0 -6
  157. package/dist/transition/specs-changelog.d.ts +0 -3
  158. package/dist/transition/specs-index.d.ts +0 -22
  159. package/dist/transition/story-parsing.d.ts +0 -7
  160. package/dist/transition/tech-stack.d.ts +0 -3
  161. package/dist/transition/types.d.ts +0 -82
  162. package/dist/utils/config.d.ts +0 -13
  163. package/dist/utils/constants.d.ts +0 -70
  164. package/dist/utils/dryrun.d.ts +0 -7
  165. package/dist/utils/errors.d.ts +0 -63
  166. package/dist/utils/file-system.d.ts +0 -24
  167. package/dist/utils/github.d.ts +0 -83
  168. package/dist/utils/json.d.ts +0 -7
  169. package/dist/utils/logger.d.ts +0 -9
  170. package/dist/utils/state.d.ts +0 -24
  171. package/dist/utils/validate.d.ts +0 -44
  172. package/dist/watch/dashboard.d.ts +0 -4
  173. package/dist/watch/file-watcher.d.ts +0 -9
  174. package/dist/watch/renderer.d.ts +0 -16
  175. package/dist/watch/state-reader.d.ts +0 -9
  176. package/dist/watch/types.d.ts +0 -55
@@ -1,6 +0,0 @@
1
- interface WatchCommandOptions {
2
- interval?: string;
3
- projectDir: string;
4
- }
5
- export declare function watchCommand(options: WatchCommandOptions): Promise<void>;
6
- export {};
@@ -1,33 +0,0 @@
1
- import type { Platform } from "./platform/types.js";
2
- export declare function getPackageVersion(): string;
3
- export interface BundledVersions {
4
- bmadCommit: string;
5
- }
6
- export declare function getBundledVersions(): BundledVersions;
7
- export declare function getBundledBmadDir(): string;
8
- export declare function getBundledRalphDir(): string;
9
- export declare function getSlashCommandsDir(): string;
10
- export interface UpgradeResult {
11
- updatedPaths: string[];
12
- }
13
- export interface PreviewInstallResult {
14
- wouldCreate: string[];
15
- wouldModify: string[];
16
- wouldSkip: string[];
17
- }
18
- export interface PreviewUpgradeResult {
19
- wouldUpdate: string[];
20
- wouldCreate: string[];
21
- wouldPreserve: string[];
22
- }
23
- export declare function copyBundledAssets(projectDir: string, platform?: Platform): Promise<UpgradeResult>;
24
- export declare function installProject(projectDir: string, platform?: Platform): Promise<void>;
25
- export declare function generateManifests(projectDir: string): Promise<void>;
26
- /**
27
- * Merge the BMAD instructions snippet into the platform's instructions file.
28
- * Creates the file if it doesn't exist, replaces an existing BMAD section on upgrade.
29
- */
30
- export declare function mergeInstructionsFile(projectDir: string, platform?: Platform): Promise<void>;
31
- export declare function isInitialized(projectDir: string): Promise<boolean>;
32
- export declare function previewInstall(projectDir: string, platform?: Platform): Promise<PreviewInstallResult>;
33
- export declare function previewUpgrade(projectDir: string, platform?: Platform): Promise<PreviewUpgradeResult>;
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const aiderPlatform: Platform;
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const claudeCodePlatform: Platform;
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const codexPlatform: Platform;
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const copilotPlatform: Platform;
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const cursorPlatform: Platform;
@@ -1,7 +0,0 @@
1
- import type { PlatformId } from "./types.js";
2
- interface DetectionResult {
3
- detected: PlatformId | null;
4
- candidates: PlatformId[];
5
- }
6
- export declare function detectPlatform(projectDir: string): Promise<DetectionResult>;
7
- export {};
@@ -1,4 +0,0 @@
1
- export type { Platform, PlatformId, PlatformTier, CommandDelivery, PlatformDoctorCheck, } from "./types.js";
2
- export { getPlatform, getAllPlatforms, isPlatformId } from "./registry.js";
3
- export { resolveProjectPlatform } from "./resolve.js";
4
- export { detectPlatform } from "./detect.js";
@@ -1,3 +0,0 @@
1
- export { getPlatform, getAllPlatforms, isPlatformId } from "./registry.js";
2
- export { resolveProjectPlatform } from "./resolve.js";
3
- export { detectPlatform } from "./detect.js";
@@ -1,4 +0,0 @@
1
- import type { Platform, PlatformId } from "./types.js";
2
- export declare function getPlatform(id: PlatformId): Platform;
3
- export declare function getAllPlatforms(): Platform[];
4
- export declare function isPlatformId(value: string): value is PlatformId;
@@ -1,8 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- /**
3
- * Resolve the platform for a project from its config, defaulting to claude-code.
4
- *
5
- * Used by doctor and upgrade commands to determine which platform checks and
6
- * assets to use. Falls back to claude-code when config is missing or unreadable.
7
- */
8
- export declare function resolveProjectPlatform(projectDir: string): Promise<Platform>;
@@ -1,41 +0,0 @@
1
- /**
2
- * Platform abstraction layer for bmalph.
3
- *
4
- * Controls how `bmalph init/upgrade/doctor` install instruction files,
5
- * deliver slash commands, and run health checks per platform.
6
- */
7
- /** Supported platform identifiers. */
8
- export type PlatformId = "claude-code" | "codex" | "cursor" | "windsurf" | "copilot" | "aider";
9
- /** Full platforms support Phases 1-4 (planning + Ralph implementation). */
10
- /** Instructions-only platforms support Phases 1-3 (planning only). */
11
- export type PlatformTier = "full" | "instructions-only";
12
- /** How slash commands are delivered to the platform. */
13
- export type CommandDelivery = {
14
- kind: "directory";
15
- dir: string;
16
- } | {
17
- kind: "inline";
18
- } | {
19
- kind: "none";
20
- };
21
- /** Result of a single platform-specific doctor check. */
22
- export interface PlatformDoctorCheck {
23
- id: string;
24
- label: string;
25
- check: (projectDir: string) => Promise<{
26
- passed: boolean;
27
- detail?: string;
28
- hint?: string;
29
- }>;
30
- }
31
- /** Platform definition controlling install, upgrade, and doctor behavior. */
32
- export interface Platform {
33
- readonly id: PlatformId;
34
- readonly displayName: string;
35
- readonly tier: PlatformTier;
36
- readonly instructionsFile: string;
37
- readonly commandDelivery: CommandDelivery;
38
- readonly instructionsSectionMarker: string;
39
- readonly generateInstructionsSnippet: () => string;
40
- readonly getDoctorChecks: () => PlatformDoctorCheck[];
41
- }
@@ -1,2 +0,0 @@
1
- import type { Platform } from "./types.js";
2
- export declare const windsurfPlatform: Platform;
package/dist/reset.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { Platform } from "./platform/types.js";
2
- import type { DryRunAction } from "./utils/dryrun.js";
3
- export interface ResetPlan {
4
- directories: string[];
5
- commandFiles: string[];
6
- instructionsCleanup: {
7
- path: string;
8
- sectionsToRemove: string[];
9
- } | null;
10
- gitignoreLines: string[];
11
- warnings: Array<{
12
- path: string;
13
- message: string;
14
- }>;
15
- }
16
- export declare function buildResetPlan(projectDir: string, platform: Platform): Promise<ResetPlan>;
17
- export declare function executeResetPlan(projectDir: string, plan: ResetPlan): Promise<void>;
18
- export declare function planToDryRunActions(plan: ResetPlan): DryRunAction[];
@@ -1,27 +0,0 @@
1
- export interface ArtifactClassification {
2
- phase: number;
3
- name: string;
4
- required: boolean;
5
- }
6
- export interface ScannedArtifact extends ArtifactClassification {
7
- filename: string;
8
- }
9
- export interface PhaseArtifacts {
10
- 1: ScannedArtifact[];
11
- 2: ScannedArtifact[];
12
- 3: ScannedArtifact[];
13
- }
14
- export interface ProjectArtifactScan {
15
- directory: string;
16
- found: string[];
17
- detectedPhase: number;
18
- missing: string[];
19
- phases: PhaseArtifacts;
20
- nextAction: string;
21
- }
22
- export declare function classifyArtifact(filename: string): ArtifactClassification | null;
23
- export declare function scanArtifacts(files: string[]): PhaseArtifacts;
24
- export declare function detectPhase(phases: PhaseArtifacts): number;
25
- export declare function getMissing(phases: PhaseArtifacts): string[];
26
- export declare function suggestNext(phases: PhaseArtifacts, detectedPhase: number): string;
27
- export declare function scanProjectArtifacts(projectDir: string): Promise<ProjectArtifactScan | null>;
@@ -1 +0,0 @@
1
- export declare function findArtifactsDir(projectDir: string): Promise<string | null>;
@@ -1,19 +0,0 @@
1
- import type { ProjectContext, TruncationInfo } from "./types.js";
2
- export interface ExtractProjectContextResult {
3
- context: ProjectContext;
4
- truncated: TruncationInfo[];
5
- }
6
- export interface ExtractSectionResult {
7
- content: string;
8
- wasTruncated: boolean;
9
- originalLength: number;
10
- }
11
- export declare function extractSection(content: string, headingPattern: RegExp, maxLength?: number): string;
12
- export declare function extractSectionWithInfo(content: string, headingPattern: RegExp, maxLength?: number): ExtractSectionResult;
13
- export declare function extractProjectContext(artifacts: Map<string, string>): ExtractProjectContextResult;
14
- /**
15
- * Converts truncation info into human-readable warnings.
16
- */
17
- export declare function detectTruncation(truncated: TruncationInfo[]): string[];
18
- export declare function generateProjectContextMd(context: ProjectContext, projectName: string): string;
19
- export declare function generatePrompt(projectName: string, context?: ProjectContext): string;
@@ -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,2 +0,0 @@
1
- import type { TransitionResult, TransitionOptions } from "./types.js";
2
- export declare function runTransition(projectDir: string, options?: TransitionOptions): Promise<TransitionResult>;
@@ -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,3 +0,0 @@
1
- import type { SpecsChange } from "./types.js";
2
- export declare function generateSpecsChangelog(oldSpecsDir: string, newSourceDir: string): Promise<SpecsChange[]>;
3
- export declare function formatChangelog(changes: SpecsChange[], timestamp: string): string;
@@ -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,3 +0,0 @@
1
- import type { TechStack } from "./types.js";
2
- export declare function detectTechStack(content: string): TechStack | null;
3
- export declare function customizeAgentMd(template: string, stack: TechStack): string;
@@ -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
- }
@@ -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;
@@ -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;
@@ -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[]>;
@@ -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 {};
@@ -1,7 +0,0 @@
1
- /**
2
- * Reads and parses a JSON file with proper error discrimination:
3
- * - File not found → returns null
4
- * - Parse error → throws
5
- * - Permission error → throws
6
- */
7
- export declare function readJsonFile<T>(path: string): Promise<T | null>;