wiggum-cli 0.12.1 → 0.13.1

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 (37) hide show
  1. package/dist/index.js +7 -6
  2. package/dist/templates/prompts/PROMPT_review_auto.md.tmpl +19 -23
  3. package/dist/tui/app.d.ts +12 -22
  4. package/dist/tui/app.js +130 -314
  5. package/dist/tui/components/AppShell.d.ts +47 -0
  6. package/dist/tui/components/AppShell.js +19 -0
  7. package/dist/tui/components/FooterStatusBar.js +2 -3
  8. package/dist/tui/components/HeaderContent.d.ts +28 -0
  9. package/dist/tui/components/HeaderContent.js +16 -0
  10. package/dist/tui/components/MessageList.d.ts +9 -7
  11. package/dist/tui/components/MessageList.js +23 -17
  12. package/dist/tui/components/RunCompletionSummary.d.ts +22 -0
  13. package/dist/tui/components/RunCompletionSummary.js +23 -0
  14. package/dist/tui/components/SpecCompletionSummary.d.ts +47 -0
  15. package/dist/tui/components/SpecCompletionSummary.js +124 -0
  16. package/dist/tui/components/TipsBar.d.ts +24 -0
  17. package/dist/tui/components/TipsBar.js +23 -0
  18. package/dist/tui/components/WiggumBanner.js +8 -3
  19. package/dist/tui/hooks/useBackgroundRuns.d.ts +52 -0
  20. package/dist/tui/hooks/useBackgroundRuns.js +121 -0
  21. package/dist/tui/orchestration/interview-orchestrator.js +1 -1
  22. package/dist/tui/screens/InitScreen.d.ts +13 -8
  23. package/dist/tui/screens/InitScreen.js +86 -87
  24. package/dist/tui/screens/InterviewScreen.d.ts +11 -8
  25. package/dist/tui/screens/InterviewScreen.js +145 -99
  26. package/dist/tui/screens/MainShell.d.ts +13 -12
  27. package/dist/tui/screens/MainShell.js +65 -69
  28. package/dist/tui/screens/RunScreen.d.ts +17 -1
  29. package/dist/tui/screens/RunScreen.js +235 -80
  30. package/dist/tui/screens/index.d.ts +0 -2
  31. package/dist/tui/screens/index.js +0 -1
  32. package/dist/tui/utils/loop-status.d.ts +22 -3
  33. package/dist/tui/utils/loop-status.js +65 -15
  34. package/package.json +5 -1
  35. package/src/templates/prompts/PROMPT_review_auto.md.tmpl +19 -23
  36. package/dist/tui/screens/WelcomeScreen.d.ts +0 -44
  37. package/dist/tui/screens/WelcomeScreen.js +0 -54
package/dist/index.js CHANGED
@@ -17,17 +17,18 @@ function getVersion() {
17
17
  const __dirname = dirname(__filename);
18
18
  const packagePath = join(__dirname, '..', 'package.json');
19
19
  const pkg = JSON.parse(readFileSync(packagePath, 'utf-8'));
20
- return pkg.version || '0.8.0';
20
+ return pkg.version || '0.12.1';
21
21
  }
22
- catch {
23
- return '0.8.0';
22
+ catch (err) {
23
+ logger.debug(`Failed to read version from package.json: ${err instanceof Error ? err.message : String(err)}`);
24
+ return '0.12.1'; // Fallback version (keep in sync with app.tsx)
24
25
  }
25
26
  }
26
27
  /**
27
28
  * Start Ink TUI mode
28
29
  * Called when wiggum is invoked with no arguments or with screen-routing args
29
30
  */
30
- async function startInkTui(initialScreen = 'welcome', interviewFeature) {
31
+ async function startInkTui(initialScreen = 'shell', interviewFeature) {
31
32
  const projectRoot = process.cwd();
32
33
  const version = getVersion();
33
34
  /**
@@ -94,9 +95,9 @@ export async function main() {
94
95
  const args = process.argv.slice(2);
95
96
  // Check for updates (non-blocking, fails silently)
96
97
  await notifyIfUpdateAvailable();
97
- // No args = start with welcome screen
98
+ // No args = start with shell
98
99
  if (args.length === 0) {
99
- await startInkTui('welcome');
100
+ await startInkTui('shell');
100
101
  return;
101
102
  }
102
103
  // Route commands to TUI screens
@@ -64,27 +64,21 @@ EOF
64
64
  )"
65
65
  ```
66
66
 
67
- ### Step 4: Request Codex Review
67
+ ### Step 4: Request Claude Code Review
68
68
 
69
- Run automated code review using Codex CLI:
69
+ Run automated code review using Claude Code CLI:
70
70
 
71
71
  ```bash
72
- # Check if Codex CLI is installed
73
- if ! command -v codex &> /dev/null; then
74
- echo "WARNING: Codex CLI not installed. Manual review needed."
75
- cd {{appDir}} && gh pr comment --body "Manual review requested - Codex CLI not available. Install: brew install openai/tap/codex"
72
+ # Check if Claude Code CLI is installed
73
+ if ! command -v claude &> /dev/null; then
74
+ echo "WARNING: Claude Code CLI not installed. Manual review needed."
75
+ cd {{appDir}} && gh pr comment --body "Manual review requested - Claude Code CLI not available. Install: https://docs.anthropic.com/en/docs/claude-code/overview"
76
76
  else
77
- echo "Running Codex code review..."
78
- # Get diff summary for context
79
- DIFF_SUMMARY=$(cd {{appDir}} && git diff main --stat | head -50)
77
+ echo "Running Claude Code review..."
80
78
 
81
- # Use codex exec for non-interactive review
82
- echo "Code Review Request for $FEATURE feature.
79
+ cd {{appDir}} && claude -p "You are reviewing a PR for the $FEATURE feature.
83
80
 
84
- ## Changed Files:
85
- $DIFF_SUMMARY
86
-
87
- ## Review Checklist:
81
+ Review the git diff against main and check:
88
82
  - Code quality and patterns consistency
89
83
  - Test coverage adequacy
90
84
  - Potential bugs or edge cases
@@ -92,19 +86,21 @@ $DIFF_SUMMARY
92
86
  - Performance implications
93
87
  - Error handling completeness
94
88
 
95
- Please review and respond with:
89
+ Run: git diff main
90
+
91
+ Respond with:
96
92
  - APPROVED if everything looks good
97
- - Or list specific issues that need to be fixed" | cd {{appDir}} && codex exec --full-auto -
93
+ - Or list specific issues with file:line references that need to be fixed"
98
94
  fi
99
95
  ```
100
96
 
101
97
  **Handle review feedback:**
102
- - If Codex outputs "APPROVED" -> Proceed to Step 5 (rebase and merge)
103
- - If Codex lists issues:
98
+ - If Claude outputs "APPROVED" -> Proceed to Step 5 (rebase and merge)
99
+ - If Claude lists issues:
104
100
  1. Address each issue with code fixes
105
101
  2. Commit: `git -C {{appDir}} add -A && git -C {{appDir}} commit -m "fix($FEATURE): address review feedback"`
106
102
  3. Push: `git -C {{appDir}} push origin feat/$FEATURE`
107
- 4. Re-run the `codex review` command above
103
+ 4. Re-run the Claude review command above
108
104
  - Max 3 review iterations before requiring manual intervention
109
105
 
110
106
  ### Step 5: Rebase Before Merge (for Parallel Execution)
@@ -126,7 +122,7 @@ cd {{appDir}} && git push --force-with-lease origin feat/$FEATURE
126
122
  ```
127
123
 
128
124
  ### Step 6: Merge PR
129
- When Codex review is approved and branch is rebased:
125
+ When Claude review is approved and branch is rebased:
130
126
  ```bash
131
127
  cd {{appDir}} && gh pr merge --squash --delete-branch
132
128
  ```
@@ -145,7 +141,7 @@ cd {{appDir}} && gh pr merge --squash --delete-branch
145
141
  Note: Spec status updates are handled in the Spec Verification phase before PR creation.
146
142
 
147
143
  ## Rules
148
- - Do NOT merge without Codex approval
144
+ - Do NOT merge without Claude Code approval
149
145
  - Address ALL review comments before merging
150
146
  - Use squash merge to keep history clean
151
147
  - If gh CLI fails, check authentication: `gh auth status`
@@ -155,7 +151,7 @@ Note: Spec status updates are handled in the Spec Verification phase before PR c
155
151
  - **gh: command not found** -> Install GitHub CLI: `brew install gh`
156
152
  - **gh auth error** -> Run: `gh auth login`
157
153
  - **PR already exists** -> Use: `gh pr view` to see status
158
- - **Codex CLI not installed** -> Install with: `brew install openai/tap/codex`, then `codex login`
154
+ - **Claude Code CLI not installed** -> Install: `npm install -g @anthropic-ai/claude-code`
159
155
  - **Rebase conflicts** -> Resolve carefully, re-run all tests after
160
156
 
161
157
  ## Learning Capture
package/dist/tui/app.d.ts CHANGED
@@ -4,8 +4,9 @@
4
4
  * The root component for the Ink-based TUI. Routes to different screens
5
5
  * based on the current screen state. Manages session state and navigation.
6
6
  *
7
- * Uses a "continuous thread" model like Claude Code - all output stays
8
- * visible in the terminal as a growing thread, rather than clearing screens.
7
+ * Uses an AppShell-based layout where each screen wraps itself in
8
+ * <AppShell> with a shared header element. No Static/thread model -
9
+ * screen transitions are clean React mount/unmount cycles.
9
10
  */
10
11
  import React from 'react';
11
12
  import { type Instance } from 'ink';
@@ -15,7 +16,7 @@ import type { SessionState } from '../repl/session-state.js';
15
16
  /**
16
17
  * Available screen types for the App component
17
18
  */
18
- export type AppScreen = 'welcome' | 'shell' | 'interview' | 'init' | 'run';
19
+ export type AppScreen = 'shell' | 'interview' | 'init' | 'run';
19
20
  /**
20
21
  * Props for the interview screen
21
22
  */
@@ -48,7 +49,14 @@ export interface AppProps {
48
49
  /** Called when the user exits/cancels */
49
50
  onExit?: () => void;
50
51
  }
51
- export declare function App({ screen: initialScreen, initialSessionState, version, interviewProps, onComplete, onExit, }: AppProps): React.ReactElement | null;
52
+ /**
53
+ * Main App component for the Ink-based TUI
54
+ *
55
+ * Simple routing + shared state. Each screen wraps itself in AppShell
56
+ * and receives a shared headerElement prop.
57
+ */
58
+ export declare function App({ screen: initialScreen, initialSessionState, version, // Fallback if package.json read fails (keep in sync with index.ts)
59
+ interviewProps, onComplete, onExit, }: AppProps): React.ReactElement | null;
52
60
  /**
53
61
  * Render options for renderApp
54
62
  */
@@ -68,23 +76,5 @@ export interface RenderAppOptions {
68
76
  }
69
77
  /**
70
78
  * Render the App component to the terminal
71
- *
72
- * Helper function that wraps Ink's render() to provide a clean API
73
- * for starting the TUI from command handlers.
74
- *
75
- * @param options - Render options
76
- * @returns Ink Instance that can be used to control/cleanup the render
77
- *
78
- * @example
79
- * ```typescript
80
- * const instance = renderApp({
81
- * screen: 'welcome',
82
- * initialSessionState: state,
83
- * version: '0.8.0',
84
- * onExit: () => instance.unmount(),
85
- * });
86
- *
87
- * await instance.waitUntilExit();
88
- * ```
89
79
  */
90
80
  export declare function renderApp(options: RenderAppOptions): Instance;