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
@@ -308,21 +308,55 @@ extract_prd_tasks() {
308
308
  done <<< "$numbered_tasks"
309
309
  fi
310
310
 
311
- # Look for headings that might be task sections
312
- local headings
313
- headings=$(grep -E '^#{1,3}[[:space:]]+(TODO|Tasks|Requirements|Features|Backlog|Sprint)' "$prd_file" 2>/dev/null)
314
- if [[ -n "$headings" ]]; then
315
- # Extract content after these headings as potential tasks
316
- while IFS= read -r heading; do
317
- local section_name
318
- section_name=$(echo "$heading" | sed -E 's/^#*[[:space:]]*//')
319
- # This is informational - actual task extraction would need more context
320
- done <<< "$headings"
311
+ # Look for headings that might be task sections (with line numbers to handle duplicates)
312
+ local heading_lines
313
+ heading_lines=$(grep -nE '^#{1,3}[[:space:]]+(TODO|Tasks|Requirements|Features|Backlog|Sprint)' "$prd_file" 2>/dev/null)
314
+ if [[ -n "$heading_lines" ]]; then
315
+ # Extract bullet items beneath each matching heading
316
+ while IFS= read -r heading_entry; do
317
+ # Parse line number directly from grep -n output (avoids duplicate heading issue)
318
+ local heading_line
319
+ heading_line=$(echo "$heading_entry" | cut -d: -f1)
320
+ [[ -z "$heading_line" ]] && continue
321
+
322
+ # Find the next heading (any level) after this one
323
+ local next_heading_line
324
+ next_heading_line=$(tail -n +"$((heading_line + 1))" "$prd_file" | grep -n '^#' | head -1 | cut -d: -f1)
325
+
326
+ # Extract the section content
327
+ local section_content
328
+ if [[ -n "$next_heading_line" ]]; then
329
+ local end_line=$((heading_line + next_heading_line - 1))
330
+ section_content=$(sed -n "$((heading_line + 1)),${end_line}p" "$prd_file")
331
+ else
332
+ section_content=$(tail -n +"$((heading_line + 1))" "$prd_file")
333
+ fi
334
+
335
+ # Extract bullet items from section and convert to checkboxes
336
+ while IFS= read -r line; do
337
+ local task_text=""
338
+ # Match "- item" or "* item" (but not checkboxes, already handled above)
339
+ if [[ "$line" =~ ^[[:space:]]*[-*][[:space:]]+(.+)$ ]]; then
340
+ task_text="${BASH_REMATCH[1]}"
341
+ # Skip checkbox lines — they are handled by the earlier extraction
342
+ if [[ "$line" == *"["*"]"* ]]; then
343
+ task_text=""
344
+ fi
345
+ # Match "N. item" numbered patterns
346
+ elif [[ "$line" =~ ^[[:space:]]*[0-9]+\.[[:space:]]+(.+)$ ]]; then
347
+ task_text="${BASH_REMATCH[1]}"
348
+ fi
349
+ if [[ -n "$task_text" ]]; then
350
+ tasks="${tasks}
351
+ - [ ] ${task_text}"
352
+ fi
353
+ done <<< "$section_content"
354
+ done <<< "$heading_lines"
321
355
  fi
322
356
 
323
357
  # Clean up and output
324
358
  if [[ -n "$tasks" ]]; then
325
- echo "$tasks" | grep -v '^$' | head -30 # Limit to 30 tasks
359
+ echo "$tasks" | grep -v '^$' | awk '!seen[$0]++' | head -30 # Deduplicate, limit to 30
326
360
  return 0
327
361
  fi
328
362
 
@@ -475,6 +475,15 @@ show_progress() {
475
475
  local total=$2
476
476
  local message=$3
477
477
 
478
+ # Guard against division by zero
479
+ if [[ $total -le 0 ]]; then
480
+ local bar_width=30
481
+ local bar=""
482
+ for ((i = 0; i < bar_width; i++)); do bar+="░"; done
483
+ echo -en "\r${WIZARD_CYAN}[${bar}]${WIZARD_NC} 0/${total} ${message}"
484
+ return 0
485
+ fi
486
+
478
487
  local bar_width=30
479
488
  local filled=$((current * bar_width / total))
480
489
  local empty=$((bar_width - filled))
@@ -2,6 +2,10 @@
2
2
 
3
3
  # Ralph Import - Convert PRDs to Ralph format using Claude Code
4
4
  # Version: 0.9.8 - Modern CLI support with JSON output parsing
5
+ #
6
+ # DEPRECATED: This script is from standalone Ralph and references `ralph-setup`
7
+ # which does not exist in bmalph. Use `bmalph implement` for PRD-to-Ralph
8
+ # transition instead. This file is bundled for backward compatibility only.
5
9
  set -e
6
10
 
7
11
  # Configuration
@@ -281,8 +285,9 @@ HELPEOF
281
285
  # Check dependencies
282
286
  check_dependencies() {
283
287
  if ! command -v ralph-setup &> /dev/null; then
284
- log "ERROR" "Ralph not installed. Run ./install.sh first"
285
- exit 1
288
+ log "WARN" "ralph-setup not found. If using bmalph, run 'bmalph init' instead."
289
+ log "WARN" "This script is deprecated — use 'bmalph implement' for PRD conversion."
290
+ return 1
286
291
  fi
287
292
 
288
293
  if ! command -v jq &> /dev/null; then
@@ -19,7 +19,7 @@ source "$SCRIPT_DIR/lib/circuit_breaker.sh"
19
19
 
20
20
  # Configuration
21
21
  # Ralph-specific files live in .ralph/ subfolder
22
- RALPH_DIR=".ralph"
22
+ RALPH_DIR="${RALPH_DIR:-.ralph}"
23
23
  PROMPT_FILE="$RALPH_DIR/PROMPT.md"
24
24
  LOG_DIR="$RALPH_DIR/logs"
25
25
  DOCS_DIR="$RALPH_DIR/docs/generated"
@@ -239,7 +239,10 @@ setup_tmux_session() {
239
239
  tmux send-keys -t "$session_name:${base_win}.1" "tail -f '$project_dir/$LIVE_LOG_FILE'" Enter
240
240
 
241
241
  # Right-bottom pane (pane 2): Ralph status monitor
242
- if command -v ralph-monitor &> /dev/null; then
242
+ # Prefer bmalph watch (TypeScript, fully tested) over legacy ralph_monitor.sh
243
+ if command -v bmalph &> /dev/null; then
244
+ tmux send-keys -t "$session_name:${base_win}.2" "bmalph watch" Enter
245
+ elif command -v ralph-monitor &> /dev/null; then
243
246
  tmux send-keys -t "$session_name:${base_win}.2" "ralph-monitor" Enter
244
247
  else
245
248
  tmux send-keys -t "$session_name:${base_win}.2" "'$ralph_home/ralph_monitor.sh'" Enter
@@ -404,18 +407,6 @@ can_make_call() {
404
407
  fi
405
408
  }
406
409
 
407
- # Increment call counter
408
- increment_call_counter() {
409
- local calls_made=0
410
- if [[ -f "$CALL_COUNT_FILE" ]]; then
411
- calls_made=$(cat "$CALL_COUNT_FILE")
412
- fi
413
-
414
- ((calls_made++))
415
- echo "$calls_made" > "$CALL_COUNT_FILE"
416
- echo "$calls_made"
417
- }
418
-
419
410
  # Wait for rate limit reset with countdown
420
411
  wait_for_reset() {
421
412
  local calls_made=$(cat "$CALL_COUNT_FILE" 2>/dev/null || echo "0")
@@ -661,10 +652,9 @@ build_loop_context() {
661
652
  echo "${context:0:500}"
662
653
  }
663
654
 
664
- # Get session file age in hours (cross-platform)
665
- # Returns: age in hours on stdout, or -1 if stat fails
666
- # Note: Returns 0 for files less than 1 hour old
667
- get_session_file_age_hours() {
655
+ # Get session file age in seconds (cross-platform)
656
+ # Returns: age in seconds on stdout, or -1 if stat fails
657
+ get_session_file_age_seconds() {
668
658
  local file=$1
669
659
 
670
660
  if [[ ! -f "$file" ]]; then
@@ -700,9 +690,8 @@ get_session_file_age_hours() {
700
690
  current_time=$(date +%s)
701
691
 
702
692
  local age_seconds=$((current_time - file_mtime))
703
- local age_hours=$((age_seconds / 3600))
704
693
 
705
- echo "$age_hours"
694
+ echo "$age_seconds"
706
695
  }
707
696
 
708
697
  # Initialize or resume Claude session (with expiration check)
@@ -723,20 +712,23 @@ get_session_file_age_hours() {
723
712
  init_claude_session() {
724
713
  if [[ -f "$CLAUDE_SESSION_FILE" ]]; then
725
714
  # Check session age
726
- local age_hours
727
- age_hours=$(get_session_file_age_hours "$CLAUDE_SESSION_FILE")
715
+ local age_seconds
716
+ age_seconds=$(get_session_file_age_seconds "$CLAUDE_SESSION_FILE")
728
717
 
729
718
  # Handle stat failure (-1) - treat as needing new session
730
719
  # Don't expire sessions when we can't determine age
731
- if [[ $age_hours -eq -1 ]]; then
720
+ if [[ $age_seconds -eq -1 ]]; then
732
721
  log_status "WARN" "Could not determine session age, starting new session"
733
722
  rm -f "$CLAUDE_SESSION_FILE"
734
723
  echo ""
735
724
  return 0
736
725
  fi
737
726
 
727
+ local expiry_seconds=$((CLAUDE_SESSION_EXPIRY_HOURS * 3600))
728
+
738
729
  # Check if session has expired
739
- if [[ $age_hours -ge $CLAUDE_SESSION_EXPIRY_HOURS ]]; then
730
+ if [[ $age_seconds -ge $expiry_seconds ]]; then
731
+ local age_hours=$((age_seconds / 3600))
740
732
  log_status "INFO" "Session expired (${age_hours}h old, max ${CLAUDE_SESSION_EXPIRY_HOURS}h), starting new session"
741
733
  rm -f "$CLAUDE_SESSION_FILE"
742
734
  echo ""
@@ -746,6 +738,7 @@ init_claude_session() {
746
738
  # Session is valid, try to read it
747
739
  local session_id=$(cat "$CLAUDE_SESSION_FILE" 2>/dev/null)
748
740
  if [[ -n "$session_id" ]]; then
741
+ local age_hours=$((age_seconds / 3600))
749
742
  log_status "INFO" "Resuming Claude session: ${session_id:0:20}... (${age_hours}h old)"
750
743
  echo "$session_id"
751
744
  return 0
@@ -1661,6 +1654,9 @@ Examples:
1661
1654
  HELPEOF
1662
1655
  }
1663
1656
 
1657
+ # Only parse arguments and run main when executed directly, not when sourced
1658
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
1659
+
1664
1660
  # Parse command line arguments
1665
1661
  while [[ $# -gt 0 ]]; do
1666
1662
  case $1 in
@@ -1768,14 +1764,13 @@ while [[ $# -gt 0 ]]; do
1768
1764
  esac
1769
1765
  done
1770
1766
 
1771
- # Only execute when run directly, not when sourced
1772
- if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
1773
- # If tmux mode requested, set it up
1774
- if [[ "$USE_TMUX" == "true" ]]; then
1775
- check_tmux_available
1776
- setup_tmux_session
1777
- fi
1778
-
1779
- # Start the main loop
1780
- main
1767
+ # If tmux mode requested, set it up
1768
+ if [[ "$USE_TMUX" == "true" ]]; then
1769
+ check_tmux_available
1770
+ setup_tmux_session
1781
1771
  fi
1772
+
1773
+ # Start the main loop
1774
+ main
1775
+
1776
+ fi # end: BASH_SOURCE[0] == $0
@@ -1,6 +1,10 @@
1
1
  #!/bin/bash
2
2
 
3
3
  # Ralph Status Monitor - Live terminal dashboard for the Ralph loop
4
+ #
5
+ # DEPRECATED: Use `bmalph watch` instead, which provides a more capable
6
+ # TypeScript-based live dashboard with full test coverage.
7
+ # This script is kept for backward compatibility in tmux sessions.
4
8
  set -e
5
9
 
6
10
  STATUS_FILE=".ralph/status.json"
@@ -10,7 +10,7 @@
10
10
  # PLATFORM DRIVER
11
11
  # =============================================================================
12
12
 
13
- # Platform driver for Ralph loop (claude-code or codex)
13
+ # Platform driver for Ralph loop (claude-code, codex, or copilot)
14
14
  PLATFORM_DRIVER="${PLATFORM_DRIVER:-claude-code}"
15
15
 
16
16
  # =============================================================================
@@ -0,0 +1,22 @@
1
+ # Ralph Live Dashboard
2
+
3
+ > **Deprecated:** Use `bmalph run` instead, which starts Ralph and shows the live dashboard. The `watch` command will be removed in a future release.
4
+
5
+ Launch the bmalph live dashboard to monitor Ralph loop progress in real-time.
6
+
7
+ ## How to Run
8
+
9
+ Execute the CLI command:
10
+ bmalph watch
11
+
12
+ ## What It Does
13
+
14
+ - Displays a live-updating terminal dashboard for Ralph loop monitoring
15
+ - Shows loop count, circuit breaker state, story progress, and session info
16
+ - Displays recent log entries and response analysis
17
+ - Auto-refreshes every 2 seconds
18
+ - Press `q` or `Ctrl+C` to exit
19
+
20
+ ## When to Use
21
+
22
+ Use this command while the Ralph loop is running to monitor progress without switching windows. It replaces the legacy `ralph_monitor.sh` script with a more capable TypeScript-based dashboard.
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- interface CheckUpdatesOptions {
2
- json?: boolean;
3
- }
4
- export declare function checkUpdatesCommand(options?: CheckUpdatesOptions): Promise<void>;
5
- export {};
@@ -1,51 +0,0 @@
1
- import type { Platform } from "../platform/types.js";
2
- /**
3
- * Result of a single doctor check.
4
- */
5
- export interface CheckResult {
6
- label: string;
7
- passed: boolean;
8
- detail?: string;
9
- hint?: string;
10
- }
11
- /**
12
- * Function signature for doctor checks.
13
- * Takes a project directory and returns a check result.
14
- */
15
- export type CheckFunction = (projectDir: string) => Promise<CheckResult>;
16
- /**
17
- * Definition of a single doctor check in the registry.
18
- */
19
- export interface CheckDefinition {
20
- /** Unique identifier for the check */
21
- id: string;
22
- /** The check function to execute */
23
- run: CheckFunction;
24
- }
25
- interface DoctorOptions {
26
- json?: boolean;
27
- projectDir: string;
28
- }
29
- export declare function doctorCommand(options: DoctorOptions): Promise<void>;
30
- interface DoctorResult {
31
- passed: number;
32
- failed: number;
33
- }
34
- export declare function runDoctor(options: DoctorOptions): Promise<DoctorResult>;
35
- /**
36
- * Build the full check registry for a given platform.
37
- * Core checks + platform doctor checks + trailing checks.
38
- */
39
- export declare function buildCheckRegistry(platform: Platform): CheckDefinition[];
40
- /**
41
- * Static registry for backward compatibility with existing tests.
42
- * Uses claude-code platform checks (slash-command + claude-md).
43
- *
44
- * Note: The check ids here ("slash-command", "claude-md") intentionally differ
45
- * from the live buildCheckRegistry path which uses platform-provided ids
46
- * ("instructions-file"). This is for test backward compatibility only.
47
- *
48
- * @deprecated Use `buildCheckRegistry(platform)` for platform-aware checks.
49
- */
50
- export declare const CHECK_REGISTRY: CheckDefinition[];
51
- export {};
@@ -1,6 +0,0 @@
1
- interface ImplementOptions {
2
- force?: boolean;
3
- projectDir: string;
4
- }
5
- export declare function implementCommand(options: ImplementOptions): Promise<void>;
6
- export {};
@@ -1,9 +0,0 @@
1
- interface InitOptions {
2
- name?: string;
3
- description?: string;
4
- platform?: string;
5
- dryRun?: boolean;
6
- projectDir: string;
7
- }
8
- export declare function initCommand(options: InitOptions): Promise<void>;
9
- export {};
@@ -1,7 +0,0 @@
1
- interface ResetOptions {
2
- dryRun?: boolean;
3
- force?: boolean;
4
- projectDir: string;
5
- }
6
- export declare function resetCommand(options: ResetOptions): Promise<void>;
7
- export {};
@@ -1,7 +0,0 @@
1
- interface StatusOptions {
2
- json?: boolean;
3
- projectDir: string;
4
- }
5
- export declare function statusCommand(options: StatusOptions): Promise<void>;
6
- export declare function runStatus(options: StatusOptions): Promise<void>;
7
- export {};
@@ -1,7 +0,0 @@
1
- interface UpgradeOptions {
2
- dryRun?: boolean;
3
- force?: boolean;
4
- projectDir: string;
5
- }
6
- export declare function upgradeCommand(options: UpgradeOptions): Promise<void>;
7
- export {};
@@ -1,39 +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
- /**
32
- * @deprecated Use `mergeInstructionsFile(projectDir)` instead.
33
- * Kept for backward compatibility during migration.
34
- */
35
- export declare function mergeClaudeMd(projectDir: string): Promise<void>;
36
- export declare function isInitialized(projectDir: string): Promise<boolean>;
37
- export declare function hasExistingBmadDir(projectDir: string): Promise<boolean>;
38
- export declare function previewInstall(projectDir: string, platform?: Platform): Promise<PreviewInstallResult>;
39
- 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,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,3 +0,0 @@
1
- export declare function findArtifactsDir(projectDir: string): Promise<string | null>;
2
- /** @deprecated Use `runPreflight` from `./preflight.js` instead. Kept for backward compatibility. */
3
- export declare function validateArtifacts(files: string[], artifactsDir: string): Promise<string[]>;
@@ -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, validateArtifacts } 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;