bmalph 2.4.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.
Files changed (166) hide show
  1. package/README.md +93 -47
  2. package/dist/cli.js +17 -2
  3. package/dist/cli.js.map +1 -0
  4. package/dist/commands/check-updates.js +2 -17
  5. package/dist/commands/check-updates.js.map +1 -0
  6. package/dist/commands/doctor.js +6 -57
  7. package/dist/commands/doctor.js.map +1 -0
  8. package/dist/commands/implement.js +6 -4
  9. package/dist/commands/implement.js.map +1 -0
  10. package/dist/commands/init.js +28 -47
  11. package/dist/commands/init.js.map +1 -0
  12. package/dist/commands/reset.js +7 -10
  13. package/dist/commands/reset.js.map +1 -0
  14. package/dist/commands/run.js +46 -0
  15. package/dist/commands/run.js.map +1 -0
  16. package/dist/commands/status.js +18 -3
  17. package/dist/commands/status.js.map +1 -0
  18. package/dist/commands/upgrade.js +7 -10
  19. package/dist/commands/upgrade.js.map +1 -0
  20. package/dist/commands/watch.js +19 -0
  21. package/dist/commands/watch.js.map +1 -0
  22. package/dist/installer.js +11 -38
  23. package/dist/installer.js.map +1 -0
  24. package/dist/platform/aider.js +7 -63
  25. package/dist/platform/aider.js.map +1 -0
  26. package/dist/platform/claude-code.js +5 -39
  27. package/dist/platform/claude-code.js.map +1 -0
  28. package/dist/platform/codex.js +7 -59
  29. package/dist/platform/codex.js.map +1 -0
  30. package/dist/platform/copilot.js +10 -65
  31. package/dist/platform/copilot.js.map +1 -0
  32. package/dist/platform/cursor.js +7 -63
  33. package/dist/platform/cursor.js.map +1 -0
  34. package/dist/platform/detect.js +2 -1
  35. package/dist/platform/detect.js.map +1 -0
  36. package/dist/platform/doctor-checks.js +61 -0
  37. package/dist/platform/doctor-checks.js.map +1 -0
  38. package/dist/platform/index.js +1 -0
  39. package/dist/platform/index.js.map +1 -0
  40. package/dist/platform/instructions-snippet.js +75 -0
  41. package/dist/platform/instructions-snippet.js.map +1 -0
  42. package/dist/platform/registry.js +7 -0
  43. package/dist/platform/registry.js.map +1 -0
  44. package/dist/platform/resolve.js +1 -0
  45. package/dist/platform/resolve.js.map +1 -0
  46. package/dist/platform/types.js +1 -0
  47. package/dist/platform/types.js.map +1 -0
  48. package/dist/platform/windsurf.js +7 -63
  49. package/dist/platform/windsurf.js.map +1 -0
  50. package/dist/reset.js +6 -20
  51. package/dist/reset.js.map +1 -0
  52. package/dist/run/ralph-process.js +89 -0
  53. package/dist/run/ralph-process.js.map +1 -0
  54. package/dist/run/run-dashboard.js +104 -0
  55. package/dist/run/run-dashboard.js.map +1 -0
  56. package/dist/run/types.js +2 -0
  57. package/dist/run/types.js.map +1 -0
  58. package/dist/transition/artifact-scan.js +3 -2
  59. package/dist/transition/artifact-scan.js.map +1 -0
  60. package/dist/transition/artifacts.js +2 -28
  61. package/dist/transition/artifacts.js.map +1 -0
  62. package/dist/transition/context.js +1 -0
  63. package/dist/transition/context.js.map +1 -0
  64. package/dist/transition/fix-plan.js +1 -0
  65. package/dist/transition/fix-plan.js.map +1 -0
  66. package/dist/transition/index.js +2 -1
  67. package/dist/transition/index.js.map +1 -0
  68. package/dist/transition/orchestration.js +3 -2
  69. package/dist/transition/orchestration.js.map +1 -0
  70. package/dist/transition/preflight.js +1 -0
  71. package/dist/transition/preflight.js.map +1 -0
  72. package/dist/transition/specs-changelog.js +3 -2
  73. package/dist/transition/specs-changelog.js.map +1 -0
  74. package/dist/transition/specs-index.js +3 -2
  75. package/dist/transition/specs-index.js.map +1 -0
  76. package/dist/transition/story-parsing.js +1 -0
  77. package/dist/transition/story-parsing.js.map +1 -0
  78. package/dist/transition/tech-stack.js +1 -0
  79. package/dist/transition/tech-stack.js.map +1 -0
  80. package/dist/transition/types.js +1 -0
  81. package/dist/transition/types.js.map +1 -0
  82. package/dist/utils/config.js +3 -2
  83. package/dist/utils/config.js.map +1 -0
  84. package/dist/utils/constants.js +8 -49
  85. package/dist/utils/constants.js.map +1 -0
  86. package/dist/utils/dryrun.js +1 -20
  87. package/dist/utils/dryrun.js.map +1 -0
  88. package/dist/utils/errors.js +1 -19
  89. package/dist/utils/errors.js.map +1 -0
  90. package/dist/utils/file-system.js +34 -3
  91. package/dist/utils/file-system.js.map +1 -0
  92. package/dist/utils/github.js +21 -8
  93. package/dist/utils/github.js.map +1 -0
  94. package/dist/utils/json.js +2 -1
  95. package/dist/utils/json.js.map +1 -0
  96. package/dist/utils/logger.js +1 -14
  97. package/dist/utils/logger.js.map +1 -0
  98. package/dist/utils/state.js +3 -2
  99. package/dist/utils/state.js.map +1 -0
  100. package/dist/utils/validate.js +10 -1
  101. package/dist/utils/validate.js.map +1 -0
  102. package/dist/watch/dashboard.js +61 -0
  103. package/dist/watch/dashboard.js.map +1 -0
  104. package/dist/watch/file-watcher.js +30 -0
  105. package/dist/watch/file-watcher.js.map +1 -0
  106. package/dist/watch/renderer.js +242 -0
  107. package/dist/watch/renderer.js.map +1 -0
  108. package/dist/watch/state-reader.js +200 -0
  109. package/dist/watch/state-reader.js.map +1 -0
  110. package/dist/watch/types.js +2 -0
  111. package/dist/watch/types.js.map +1 -0
  112. package/package.json +11 -8
  113. package/ralph/drivers/copilot.sh +89 -0
  114. package/ralph/lib/circuit_breaker.sh +86 -59
  115. package/ralph/lib/enable_core.sh +3 -6
  116. package/ralph/lib/response_analyzer.sh +5 -29
  117. package/ralph/lib/task_sources.sh +45 -11
  118. package/ralph/lib/wizard_utils.sh +9 -0
  119. package/ralph/ralph_import.sh +7 -2
  120. package/ralph/ralph_loop.sh +29 -34
  121. package/ralph/ralph_monitor.sh +4 -0
  122. package/ralph/templates/ralphrc.template +1 -1
  123. package/slash-commands/bmalph-watch.md +22 -0
  124. package/dist/cli.d.ts +0 -1
  125. package/dist/commands/check-updates.d.ts +0 -5
  126. package/dist/commands/doctor.d.ts +0 -51
  127. package/dist/commands/implement.d.ts +0 -6
  128. package/dist/commands/init.d.ts +0 -9
  129. package/dist/commands/reset.d.ts +0 -7
  130. package/dist/commands/status.d.ts +0 -7
  131. package/dist/commands/upgrade.d.ts +0 -7
  132. package/dist/installer.d.ts +0 -39
  133. package/dist/platform/aider.d.ts +0 -2
  134. package/dist/platform/claude-code.d.ts +0 -2
  135. package/dist/platform/codex.d.ts +0 -2
  136. package/dist/platform/copilot.d.ts +0 -2
  137. package/dist/platform/cursor.d.ts +0 -2
  138. package/dist/platform/detect.d.ts +0 -7
  139. package/dist/platform/index.d.ts +0 -4
  140. package/dist/platform/registry.d.ts +0 -4
  141. package/dist/platform/resolve.d.ts +0 -8
  142. package/dist/platform/types.d.ts +0 -41
  143. package/dist/platform/windsurf.d.ts +0 -2
  144. package/dist/reset.d.ts +0 -18
  145. package/dist/transition/artifact-scan.d.ts +0 -27
  146. package/dist/transition/artifacts.d.ts +0 -3
  147. package/dist/transition/context.d.ts +0 -19
  148. package/dist/transition/fix-plan.d.ts +0 -21
  149. package/dist/transition/index.d.ts +0 -9
  150. package/dist/transition/orchestration.d.ts +0 -2
  151. package/dist/transition/preflight.d.ts +0 -6
  152. package/dist/transition/specs-changelog.d.ts +0 -3
  153. package/dist/transition/specs-index.d.ts +0 -22
  154. package/dist/transition/story-parsing.d.ts +0 -7
  155. package/dist/transition/tech-stack.d.ts +0 -3
  156. package/dist/transition/types.d.ts +0 -82
  157. package/dist/utils/config.d.ts +0 -13
  158. package/dist/utils/constants.d.ts +0 -70
  159. package/dist/utils/dryrun.d.ts +0 -7
  160. package/dist/utils/errors.d.ts +0 -63
  161. package/dist/utils/file-system.d.ts +0 -24
  162. package/dist/utils/github.d.ts +0 -83
  163. package/dist/utils/json.d.ts +0 -7
  164. package/dist/utils/logger.d.ts +0 -9
  165. package/dist/utils/state.d.ts +0 -26
  166. package/dist/utils/validate.d.ts +0 -44
@@ -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>;
@@ -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;
@@ -1,26 +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
- /** @deprecated Use RalphLoopStatus from validate.ts instead */
25
- export type RalphStatus = RalphLoopStatus;
26
- export declare function readRalphStatus(projectDir: string): Promise<RalphLoopStatus>;
@@ -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;