@herbcaudill/ralph 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2401 -6
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
- package/templates/core-prompt.md +3 -3
- package/templates/workflow.md +1 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -102
- package/dist/cli.js.map +0 -1
- package/dist/components/App.d.ts +0 -17
- package/dist/components/App.d.ts.map +0 -1
- package/dist/components/App.js +0 -18
- package/dist/components/App.js.map +0 -1
- package/dist/components/EnhancedTextInput.d.ts +0 -22
- package/dist/components/EnhancedTextInput.d.ts.map +0 -1
- package/dist/components/EnhancedTextInput.js +0 -130
- package/dist/components/EnhancedTextInput.js.map +0 -1
- package/dist/components/EnhancedTextInput.test.d.ts +0 -2
- package/dist/components/EnhancedTextInput.test.d.ts.map +0 -1
- package/dist/components/EnhancedTextInput.test.js +0 -99
- package/dist/components/EnhancedTextInput.test.js.map +0 -1
- package/dist/components/EventDisplay.d.ts +0 -14
- package/dist/components/EventDisplay.d.ts.map +0 -1
- package/dist/components/EventDisplay.js +0 -91
- package/dist/components/EventDisplay.js.map +0 -1
- package/dist/components/EventDisplay.replay.test.d.ts +0 -2
- package/dist/components/EventDisplay.replay.test.d.ts.map +0 -1
- package/dist/components/EventDisplay.replay.test.js +0 -379
- package/dist/components/EventDisplay.replay.test.js.map +0 -1
- package/dist/components/EventDisplay.test.d.ts +0 -2
- package/dist/components/EventDisplay.test.d.ts.map +0 -1
- package/dist/components/EventDisplay.test.js +0 -349
- package/dist/components/EventDisplay.test.js.map +0 -1
- package/dist/components/FullScreenLayout.d.ts +0 -15
- package/dist/components/FullScreenLayout.d.ts.map +0 -1
- package/dist/components/FullScreenLayout.js +0 -20
- package/dist/components/FullScreenLayout.js.map +0 -1
- package/dist/components/Header.d.ts +0 -10
- package/dist/components/Header.d.ts.map +0 -1
- package/dist/components/Header.js +0 -22
- package/dist/components/Header.js.map +0 -1
- package/dist/components/Header.test.d.ts +0 -2
- package/dist/components/Header.test.d.ts.map +0 -1
- package/dist/components/Header.test.js +0 -27
- package/dist/components/Header.test.js.map +0 -1
- package/dist/components/InitRalph.d.ts +0 -8
- package/dist/components/InitRalph.d.ts.map +0 -1
- package/dist/components/InitRalph.js +0 -136
- package/dist/components/InitRalph.js.map +0 -1
- package/dist/components/IterationRunner.d.ts +0 -10
- package/dist/components/IterationRunner.d.ts.map +0 -1
- package/dist/components/IterationRunner.js +0 -536
- package/dist/components/IterationRunner.js.map +0 -1
- package/dist/components/IterationRunner.test.d.ts +0 -46
- package/dist/components/IterationRunner.test.d.ts.map +0 -1
- package/dist/components/IterationRunner.test.js +0 -69
- package/dist/components/IterationRunner.test.js.map +0 -1
- package/dist/components/IterationRunner.types.d.ts +0 -30
- package/dist/components/IterationRunner.types.d.ts.map +0 -1
- package/dist/components/IterationRunner.types.js +0 -2
- package/dist/components/IterationRunner.types.js.map +0 -1
- package/dist/components/JsonOutput.d.ts +0 -13
- package/dist/components/JsonOutput.d.ts.map +0 -1
- package/dist/components/JsonOutput.js +0 -269
- package/dist/components/JsonOutput.js.map +0 -1
- package/dist/components/JsonOutput.test.d.ts +0 -2
- package/dist/components/JsonOutput.test.d.ts.map +0 -1
- package/dist/components/JsonOutput.test.js +0 -39
- package/dist/components/JsonOutput.test.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -18
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -30
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/ProgressBar.test.d.ts +0 -2
- package/dist/components/ProgressBar.test.d.ts.map +0 -1
- package/dist/components/ProgressBar.test.js +0 -55
- package/dist/components/ProgressBar.test.js.map +0 -1
- package/dist/components/ReplayLog.d.ts +0 -7
- package/dist/components/ReplayLog.d.ts.map +0 -1
- package/dist/components/ReplayLog.js +0 -57
- package/dist/components/ReplayLog.js.map +0 -1
- package/dist/components/StreamingText.d.ts +0 -11
- package/dist/components/StreamingText.d.ts.map +0 -1
- package/dist/components/StreamingText.js +0 -37
- package/dist/components/StreamingText.js.map +0 -1
- package/dist/components/StreamingText.test.d.ts +0 -2
- package/dist/components/StreamingText.test.d.ts.map +0 -1
- package/dist/components/StreamingText.test.js +0 -125
- package/dist/components/StreamingText.test.js.map +0 -1
- package/dist/components/ToolUse.d.ts +0 -16
- package/dist/components/ToolUse.d.ts.map +0 -1
- package/dist/components/ToolUse.js +0 -11
- package/dist/components/ToolUse.js.map +0 -1
- package/dist/components/ToolUse.test.d.ts +0 -2
- package/dist/components/ToolUse.test.d.ts.map +0 -1
- package/dist/components/ToolUse.test.js +0 -43
- package/dist/components/ToolUse.test.js.map +0 -1
- package/dist/components/blocksToLines.d.ts +0 -6
- package/dist/components/blocksToLines.d.ts.map +0 -1
- package/dist/components/blocksToLines.js +0 -15
- package/dist/components/blocksToLines.js.map +0 -1
- package/dist/components/eventToBlocks.d.ts +0 -22
- package/dist/components/eventToBlocks.d.ts.map +0 -1
- package/dist/components/eventToBlocks.js +0 -166
- package/dist/components/eventToBlocks.js.map +0 -1
- package/dist/components/eventToBlocks.test.d.ts +0 -2
- package/dist/components/eventToBlocks.test.d.ts.map +0 -1
- package/dist/components/eventToBlocks.test.js +0 -466
- package/dist/components/eventToBlocks.test.js.map +0 -1
- package/dist/components/findNextWordBoundary.d.ts +0 -10
- package/dist/components/findNextWordBoundary.d.ts.map +0 -1
- package/dist/components/findNextWordBoundary.js +0 -23
- package/dist/components/findNextWordBoundary.js.map +0 -1
- package/dist/components/findPreviousWordBoundary.d.ts +0 -10
- package/dist/components/findPreviousWordBoundary.d.ts.map +0 -1
- package/dist/components/findPreviousWordBoundary.js +0 -23
- package/dist/components/findPreviousWordBoundary.js.map +0 -1
- package/dist/components/processEvents.d.ts +0 -11
- package/dist/components/processEvents.d.ts.map +0 -1
- package/dist/components/processEvents.js +0 -87
- package/dist/components/processEvents.js.map +0 -1
- package/dist/components/renderStaticItem.d.ts +0 -7
- package/dist/components/renderStaticItem.d.ts.map +0 -1
- package/dist/components/renderStaticItem.js +0 -23
- package/dist/components/renderStaticItem.js.map +0 -1
- package/dist/components/replay.d.ts +0 -5
- package/dist/components/replay.d.ts.map +0 -1
- package/dist/components/replay.js +0 -49
- package/dist/components/replay.js.map +0 -1
- package/dist/components/test-helpers/ControlledInput.d.ts +0 -14
- package/dist/components/test-helpers/ControlledInput.d.ts.map +0 -1
- package/dist/components/test-helpers/ControlledInput.js +0 -15
- package/dist/components/test-helpers/ControlledInput.js.map +0 -1
- package/dist/components/useContentHeight.d.ts +0 -9
- package/dist/components/useContentHeight.d.ts.map +0 -1
- package/dist/components/useContentHeight.js +0 -16
- package/dist/components/useContentHeight.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/MessageQueue.d.ts +0 -33
- package/dist/lib/MessageQueue.d.ts.map +0 -1
- package/dist/lib/MessageQueue.js +0 -96
- package/dist/lib/MessageQueue.js.map +0 -1
- package/dist/lib/MessageQueue.test.d.ts +0 -2
- package/dist/lib/MessageQueue.test.d.ts.map +0 -1
- package/dist/lib/MessageQueue.test.js +0 -224
- package/dist/lib/MessageQueue.test.js.map +0 -1
- package/dist/lib/StdinCommandHandler.d.ts +0 -48
- package/dist/lib/StdinCommandHandler.d.ts.map +0 -1
- package/dist/lib/StdinCommandHandler.js +0 -95
- package/dist/lib/StdinCommandHandler.js.map +0 -1
- package/dist/lib/StdinCommandHandler.test.d.ts +0 -2
- package/dist/lib/StdinCommandHandler.test.d.ts.map +0 -1
- package/dist/lib/StdinCommandHandler.test.js +0 -93
- package/dist/lib/StdinCommandHandler.test.js.map +0 -1
- package/dist/lib/WorktreeManager.d.ts +0 -114
- package/dist/lib/WorktreeManager.d.ts.map +0 -1
- package/dist/lib/WorktreeManager.js +0 -350
- package/dist/lib/WorktreeManager.js.map +0 -1
- package/dist/lib/WorktreeManager.test.d.ts +0 -2
- package/dist/lib/WorktreeManager.test.d.ts.map +0 -1
- package/dist/lib/WorktreeManager.test.js +0 -261
- package/dist/lib/WorktreeManager.test.js.map +0 -1
- package/dist/lib/addTodo.d.ts +0 -11
- package/dist/lib/addTodo.d.ts.map +0 -1
- package/dist/lib/addTodo.js +0 -51
- package/dist/lib/addTodo.js.map +0 -1
- package/dist/lib/beadsClient.d.ts +0 -46
- package/dist/lib/beadsClient.d.ts.map +0 -1
- package/dist/lib/beadsClient.js +0 -172
- package/dist/lib/beadsClient.js.map +0 -1
- package/dist/lib/captureBeadsSnapshot.d.ts +0 -4
- package/dist/lib/captureBeadsSnapshot.d.ts.map +0 -1
- package/dist/lib/captureBeadsSnapshot.js +0 -24
- package/dist/lib/captureBeadsSnapshot.js.map +0 -1
- package/dist/lib/captureStartupSnapshot.d.ts +0 -10
- package/dist/lib/captureStartupSnapshot.d.ts.map +0 -1
- package/dist/lib/captureStartupSnapshot.js +0 -29
- package/dist/lib/captureStartupSnapshot.js.map +0 -1
- package/dist/lib/captureTodoSnapshot.d.ts +0 -4
- package/dist/lib/captureTodoSnapshot.d.ts.map +0 -1
- package/dist/lib/captureTodoSnapshot.js +0 -24
- package/dist/lib/captureTodoSnapshot.js.map +0 -1
- package/dist/lib/copyTemplates.d.ts +0 -22
- package/dist/lib/copyTemplates.d.ts.map +0 -1
- package/dist/lib/copyTemplates.js +0 -32
- package/dist/lib/copyTemplates.js.map +0 -1
- package/dist/lib/createStdinCommandHandler.d.ts +0 -28
- package/dist/lib/createStdinCommandHandler.d.ts.map +0 -1
- package/dist/lib/createStdinCommandHandler.js +0 -67
- package/dist/lib/createStdinCommandHandler.js.map +0 -1
- package/dist/lib/createUserMessage.d.ts +0 -6
- package/dist/lib/createUserMessage.d.ts.map +0 -1
- package/dist/lib/createUserMessage.js +0 -13
- package/dist/lib/createUserMessage.js.map +0 -1
- package/dist/lib/debug.d.ts +0 -19
- package/dist/lib/debug.d.ts.map +0 -1
- package/dist/lib/debug.js +0 -54
- package/dist/lib/debug.js.map +0 -1
- package/dist/lib/findMaxLogNumber.d.ts +0 -6
- package/dist/lib/findMaxLogNumber.d.ts.map +0 -1
- package/dist/lib/findMaxLogNumber.js +0 -26
- package/dist/lib/findMaxLogNumber.js.map +0 -1
- package/dist/lib/findMaxLogNumber.test.d.ts +0 -2
- package/dist/lib/findMaxLogNumber.test.d.ts.map +0 -1
- package/dist/lib/findMaxLogNumber.test.js +0 -39
- package/dist/lib/findMaxLogNumber.test.js.map +0 -1
- package/dist/lib/formatContentBlock.d.ts +0 -6
- package/dist/lib/formatContentBlock.d.ts.map +0 -1
- package/dist/lib/formatContentBlock.js +0 -18
- package/dist/lib/formatContentBlock.js.map +0 -1
- package/dist/lib/formatIterationHeader.d.ts +0 -5
- package/dist/lib/formatIterationHeader.d.ts.map +0 -1
- package/dist/lib/formatIterationHeader.js +0 -8
- package/dist/lib/formatIterationHeader.js.map +0 -1
- package/dist/lib/formatText.d.ts +0 -5
- package/dist/lib/formatText.d.ts.map +0 -1
- package/dist/lib/formatText.js +0 -33
- package/dist/lib/formatText.js.map +0 -1
- package/dist/lib/formatToolUse.d.ts +0 -7
- package/dist/lib/formatToolUse.d.ts.map +0 -1
- package/dist/lib/formatToolUse.js +0 -14
- package/dist/lib/formatToolUse.js.map +0 -1
- package/dist/lib/formatUserMessage.d.ts +0 -5
- package/dist/lib/formatUserMessage.d.ts.map +0 -1
- package/dist/lib/formatUserMessage.js +0 -8
- package/dist/lib/formatUserMessage.js.map +0 -1
- package/dist/lib/getBaseCwd.d.ts +0 -6
- package/dist/lib/getBaseCwd.d.ts.map +0 -1
- package/dist/lib/getBaseCwd.js +0 -6
- package/dist/lib/getBaseCwd.js.map +0 -1
- package/dist/lib/getBeadsProgress.d.ts +0 -8
- package/dist/lib/getBeadsProgress.d.ts.map +0 -1
- package/dist/lib/getBeadsProgress.js +0 -35
- package/dist/lib/getBeadsProgress.js.map +0 -1
- package/dist/lib/getClaudeVersion.d.ts +0 -6
- package/dist/lib/getClaudeVersion.d.ts.map +0 -1
- package/dist/lib/getClaudeVersion.js +0 -21
- package/dist/lib/getClaudeVersion.js.map +0 -1
- package/dist/lib/getClaudeVersion.test.d.ts +0 -2
- package/dist/lib/getClaudeVersion.test.d.ts.map +0 -1
- package/dist/lib/getClaudeVersion.test.js +0 -39
- package/dist/lib/getClaudeVersion.test.js.map +0 -1
- package/dist/lib/getDefaultIterations.d.ts +0 -6
- package/dist/lib/getDefaultIterations.d.ts.map +0 -1
- package/dist/lib/getDefaultIterations.js +0 -14
- package/dist/lib/getDefaultIterations.js.map +0 -1
- package/dist/lib/getDefaultIterations.test.d.ts +0 -2
- package/dist/lib/getDefaultIterations.test.d.ts.map +0 -1
- package/dist/lib/getDefaultIterations.test.js +0 -39
- package/dist/lib/getDefaultIterations.test.js.map +0 -1
- package/dist/lib/getLatestLogFile.d.ts +0 -6
- package/dist/lib/getLatestLogFile.d.ts.map +0 -1
- package/dist/lib/getLatestLogFile.js +0 -15
- package/dist/lib/getLatestLogFile.js.map +0 -1
- package/dist/lib/getNextLogFile.d.ts +0 -7
- package/dist/lib/getNextLogFile.d.ts.map +0 -1
- package/dist/lib/getNextLogFile.js +0 -18
- package/dist/lib/getNextLogFile.js.map +0 -1
- package/dist/lib/getNextLogFile.test.d.ts +0 -2
- package/dist/lib/getNextLogFile.test.d.ts.map +0 -1
- package/dist/lib/getNextLogFile.test.js +0 -66
- package/dist/lib/getNextLogFile.test.js.map +0 -1
- package/dist/lib/getOpenIssueCount.d.ts +0 -6
- package/dist/lib/getOpenIssueCount.d.ts.map +0 -1
- package/dist/lib/getOpenIssueCount.js +0 -19
- package/dist/lib/getOpenIssueCount.js.map +0 -1
- package/dist/lib/getOpenIssueCount.test.d.ts +0 -2
- package/dist/lib/getOpenIssueCount.test.d.ts.map +0 -1
- package/dist/lib/getOpenIssueCount.test.js +0 -31
- package/dist/lib/getOpenIssueCount.test.js.map +0 -1
- package/dist/lib/getProgress.d.ts +0 -14
- package/dist/lib/getProgress.d.ts.map +0 -1
- package/dist/lib/getProgress.js +0 -30
- package/dist/lib/getProgress.js.map +0 -1
- package/dist/lib/getProgress.test.d.ts +0 -2
- package/dist/lib/getProgress.test.d.ts.map +0 -1
- package/dist/lib/getProgress.test.js +0 -218
- package/dist/lib/getProgress.test.js.map +0 -1
- package/dist/lib/getPromptContent.d.ts +0 -8
- package/dist/lib/getPromptContent.d.ts.map +0 -1
- package/dist/lib/getPromptContent.js +0 -31
- package/dist/lib/getPromptContent.js.map +0 -1
- package/dist/lib/getTerminalSize.d.ts +0 -8
- package/dist/lib/getTerminalSize.d.ts.map +0 -1
- package/dist/lib/getTerminalSize.js +0 -10
- package/dist/lib/getTerminalSize.js.map +0 -1
- package/dist/lib/getTodoProgress.d.ts +0 -4
- package/dist/lib/getTodoProgress.d.ts.map +0 -1
- package/dist/lib/getTodoProgress.js +0 -22
- package/dist/lib/getTodoProgress.js.map +0 -1
- package/dist/lib/insertTodo.d.ts +0 -7
- package/dist/lib/insertTodo.d.ts.map +0 -1
- package/dist/lib/insertTodo.js +0 -22
- package/dist/lib/insertTodo.js.map +0 -1
- package/dist/lib/outputEvent.d.ts +0 -5
- package/dist/lib/outputEvent.d.ts.map +0 -1
- package/dist/lib/outputEvent.js +0 -7
- package/dist/lib/outputEvent.js.map +0 -1
- package/dist/lib/parseStdinCommand.d.ts +0 -25
- package/dist/lib/parseStdinCommand.d.ts.map +0 -1
- package/dist/lib/parseStdinCommand.js +0 -43
- package/dist/lib/parseStdinCommand.js.map +0 -1
- package/dist/lib/parseStdinCommand.test.d.ts +0 -2
- package/dist/lib/parseStdinCommand.test.d.ts.map +0 -1
- package/dist/lib/parseStdinCommand.test.js +0 -93
- package/dist/lib/parseStdinCommand.test.js.map +0 -1
- package/dist/lib/parseTaskLifecycle.d.ts +0 -18
- package/dist/lib/parseTaskLifecycle.d.ts.map +0 -1
- package/dist/lib/parseTaskLifecycle.js +0 -30
- package/dist/lib/parseTaskLifecycle.js.map +0 -1
- package/dist/lib/parseTaskLifecycle.test.d.ts +0 -2
- package/dist/lib/parseTaskLifecycle.test.d.ts.map +0 -1
- package/dist/lib/parseTaskLifecycle.test.js +0 -122
- package/dist/lib/parseTaskLifecycle.test.js.map +0 -1
- package/dist/lib/parseWorktreeFromBranch.d.ts +0 -13
- package/dist/lib/parseWorktreeFromBranch.d.ts.map +0 -1
- package/dist/lib/parseWorktreeFromBranch.js +0 -19
- package/dist/lib/parseWorktreeFromBranch.js.map +0 -1
- package/dist/lib/processEvents.d.ts +0 -12
- package/dist/lib/processEvents.d.ts.map +0 -1
- package/dist/lib/processEvents.js +0 -113
- package/dist/lib/processEvents.js.map +0 -1
- package/dist/lib/rel.d.ts +0 -8
- package/dist/lib/rel.d.ts.map +0 -1
- package/dist/lib/rel.js +0 -19
- package/dist/lib/rel.js.map +0 -1
- package/dist/lib/rel.test.d.ts +0 -2
- package/dist/lib/rel.test.d.ts.map +0 -1
- package/dist/lib/rel.test.js +0 -51
- package/dist/lib/rel.test.js.map +0 -1
- package/dist/lib/sdkMessageToEvent.d.ts +0 -6
- package/dist/lib/sdkMessageToEvent.d.ts.map +0 -1
- package/dist/lib/sdkMessageToEvent.js +0 -12
- package/dist/lib/sdkMessageToEvent.js.map +0 -1
- package/dist/lib/shortenTempPaths.d.ts +0 -8
- package/dist/lib/shortenTempPaths.d.ts.map +0 -1
- package/dist/lib/shortenTempPaths.js +0 -12
- package/dist/lib/shortenTempPaths.js.map +0 -1
- package/dist/lib/shortenTempPaths.test.d.ts +0 -2
- package/dist/lib/shortenTempPaths.test.d.ts.map +0 -1
- package/dist/lib/shortenTempPaths.test.js +0 -46
- package/dist/lib/shortenTempPaths.test.js.map +0 -1
- package/dist/lib/types.d.ts +0 -19
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js +0 -2
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/useTerminalSize.d.ts +0 -6
- package/dist/lib/useTerminalSize.d.ts.map +0 -1
- package/dist/lib/useTerminalSize.js +0 -19
- package/dist/lib/useTerminalSize.js.map +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
/**
|
|
3
|
-
* Tests for IterationRunner component.
|
|
4
|
-
*
|
|
5
|
-
* Full integration testing of IterationRunner would require:
|
|
6
|
-
* 1. Mocking child_process.spawn to simulate Claude CLI
|
|
7
|
-
* 2. Mocking file system operations
|
|
8
|
-
* 3. Testing React component rendering with ink-testing-library
|
|
9
|
-
*
|
|
10
|
-
* The getPromptContent function has been moved to its own module (../lib/getPromptContent.ts)
|
|
11
|
-
* and can be tested there. These tests have been removed as they were testing
|
|
12
|
-
* implementation details of the prompt loading logic.
|
|
13
|
-
*/
|
|
14
|
-
describe("IterationRunner", () => {
|
|
15
|
-
/**
|
|
16
|
-
* Placeholder test confirming IterationRunner is a React component.
|
|
17
|
-
* IterationRunner is primarily tested through integration tests and e2e tests
|
|
18
|
-
* that involve spawning the actual Claude CLI. Unit tests for isolated
|
|
19
|
-
* components (EventDisplay, Header, etc) are in their own files.
|
|
20
|
-
*/
|
|
21
|
-
it("is a React component", () => {
|
|
22
|
-
expect(true).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Note: For comprehensive integration tests, you would want to:
|
|
27
|
-
*
|
|
28
|
-
* 1. Test child process spawning:
|
|
29
|
-
* - Mock spawn() to return a fake ChildProcess
|
|
30
|
-
* - Emit data events to simulate Claude output
|
|
31
|
-
* - Test JSON parsing of events
|
|
32
|
-
* - Test COMPLETE promise detection
|
|
33
|
-
* - Test exit code handling
|
|
34
|
-
*
|
|
35
|
-
* 2. Test file operations:
|
|
36
|
-
* - Mock appendFileSync/writeFileSync
|
|
37
|
-
* - Verify events are logged correctly
|
|
38
|
-
* - Test log file creation
|
|
39
|
-
*
|
|
40
|
-
* 3. Test React rendering:
|
|
41
|
-
* - Use ink-testing-library to render component
|
|
42
|
-
* - Test initialization prompts
|
|
43
|
-
* - Test error display
|
|
44
|
-
* - Test iteration counter
|
|
45
|
-
*
|
|
46
|
-
* Example structure for a full integration test:
|
|
47
|
-
*
|
|
48
|
-
* import { render } from 'ink-testing-library'
|
|
49
|
-
* import { EventEmitter } from 'events'
|
|
50
|
-
*
|
|
51
|
-
* vi.mock('child_process', () => ({
|
|
52
|
-
* spawn: vi.fn(() => {
|
|
53
|
-
* const mockProcess = new EventEmitter()
|
|
54
|
-
* mockProcess.stdout = new EventEmitter()
|
|
55
|
-
* mockProcess.kill = vi.fn()
|
|
56
|
-
* return mockProcess
|
|
57
|
-
* })
|
|
58
|
-
* }))
|
|
59
|
-
*
|
|
60
|
-
* it('parses streaming JSON events', () => {
|
|
61
|
-
* const { lastFrame } = render(<IterationRunner totalIterations={1} />)
|
|
62
|
-
* const mockChild = getLastSpawnedProcess()
|
|
63
|
-
*
|
|
64
|
-
* mockChild.stdout.emit('data', Buffer.from('{"type":"assistant"}\n'))
|
|
65
|
-
*
|
|
66
|
-
* expect(lastFrame()).toContain('expected output')
|
|
67
|
-
* })
|
|
68
|
-
*/
|
|
69
|
-
//# sourceMappingURL=IterationRunner.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IterationRunner.test.js","sourceRoot":"","sources":["../../src/components/IterationRunner.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE7C;;;;;;;;;;;GAWG;AACH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B;;;;;OAKG;IACH,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type ContentBlock } from "./eventToBlocks.js";
|
|
2
|
-
/** Iteration events collection for a given iteration number. */
|
|
3
|
-
export type IterationEvents = {
|
|
4
|
-
iteration: number;
|
|
5
|
-
events: Array<Record<string, unknown>>;
|
|
6
|
-
};
|
|
7
|
-
/** Static item representing either header, iteration header, or content block. */
|
|
8
|
-
export type StaticItem = {
|
|
9
|
-
type: "header";
|
|
10
|
-
claudeVersion: string;
|
|
11
|
-
ralphVersion: string;
|
|
12
|
-
key: string;
|
|
13
|
-
} | {
|
|
14
|
-
type: "iteration";
|
|
15
|
-
iteration: number;
|
|
16
|
-
key: string;
|
|
17
|
-
} | {
|
|
18
|
-
type: "block";
|
|
19
|
-
block: ContentBlock;
|
|
20
|
-
key: string;
|
|
21
|
-
};
|
|
22
|
-
/** Props for the IterationRunner component. */
|
|
23
|
-
export type IterationRunnerProps = {
|
|
24
|
-
totalIterations: number;
|
|
25
|
-
claudeVersion: string;
|
|
26
|
-
ralphVersion: string;
|
|
27
|
-
watch?: boolean;
|
|
28
|
-
agent: string;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=IterationRunner.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IterationRunner.types.d.ts","sourceRoot":"","sources":["../../src/components/IterationRunner.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,iEAAiE;AACjE,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACvC,CAAA;AAED,mFAAmF;AACnF,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5E;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD,gDAAgD;AAChD,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IterationRunner.types.js","sourceRoot":"","sources":["../../src/components/IterationRunner.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Component that runs Claude Agent SDK iterations in JSON output mode.
|
|
4
|
-
* Manages message queues, task lifecycle tracking, pause/resume, and
|
|
5
|
-
* streams SDK events to stdout as newline-delimited JSON.
|
|
6
|
-
*/
|
|
7
|
-
export declare const JsonOutput: ({ totalIterations, agent }: Props) => React.JSX.Element;
|
|
8
|
-
type Props = {
|
|
9
|
-
totalIterations: number;
|
|
10
|
-
agent: string;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=JsonOutput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonOutput.d.ts","sourceRoot":"","sources":["../../src/components/JsonOutput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAyB1D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,4BAA4B,KAAK,sBAoR3D,CAAA;AAED,KAAK,KAAK,GAAG;IACX,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
-
import { useApp, Text } from "ink";
|
|
3
|
-
import { writeFileSync, readFileSync, existsSync } from "fs";
|
|
4
|
-
import { join, basename } from "path";
|
|
5
|
-
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
6
|
-
import { MessageQueue, createUserMessage } from "../lib/MessageQueue.js";
|
|
7
|
-
import { getProgress } from "../lib/getProgress.js";
|
|
8
|
-
import { captureStartupSnapshot } from "../lib/captureStartupSnapshot.js";
|
|
9
|
-
import { createDebugLogger } from "../lib/debug.js";
|
|
10
|
-
import { getNextLogFile } from "../lib/getNextLogFile.js";
|
|
11
|
-
import { createStdinCommandHandler } from "../lib/createStdinCommandHandler.js";
|
|
12
|
-
import { parseTaskLifecycleEvent } from "../lib/parseTaskLifecycle.js";
|
|
13
|
-
import { getPromptContent } from "../lib/getPromptContent.js";
|
|
14
|
-
import { outputEvent } from "../lib/outputEvent.js";
|
|
15
|
-
/** Debug logger for iteration lifecycle events */
|
|
16
|
-
const log = createDebugLogger("iteration");
|
|
17
|
-
/** Path to the todo.md file in the .ralph directory */
|
|
18
|
-
const todoFile = join(process.cwd(), ".ralph", "todo.md");
|
|
19
|
-
/** Name of the current repository */
|
|
20
|
-
const repoName = basename(process.cwd());
|
|
21
|
-
/**
|
|
22
|
-
* Component that runs Claude Agent SDK iterations in JSON output mode.
|
|
23
|
-
* Manages message queues, task lifecycle tracking, pause/resume, and
|
|
24
|
-
* streams SDK events to stdout as newline-delimited JSON.
|
|
25
|
-
*/
|
|
26
|
-
export const JsonOutput = ({ totalIterations, agent }) => {
|
|
27
|
-
const { exit } = useApp();
|
|
28
|
-
const [currentIteration, setCurrentIteration] = useState(1);
|
|
29
|
-
const [error, setError] = useState();
|
|
30
|
-
const [isRunning, setIsRunning] = useState(false);
|
|
31
|
-
const [startupSnapshot] = useState(() => captureStartupSnapshot());
|
|
32
|
-
const messageQueueRef = useRef(null);
|
|
33
|
-
// Log file path for this run (set once at startup, persisted across iterations)
|
|
34
|
-
const logFileRef = useRef(null);
|
|
35
|
-
const [stopAfterCurrent, setStopAfterCurrent] = useState(false); // Stop gracefully after current iteration
|
|
36
|
-
const stopAfterCurrentRef = useRef(false); // Ref to access in async callbacks
|
|
37
|
-
const [isPaused, setIsPaused] = useState(false); // Pause after current iteration completes
|
|
38
|
-
const isPausedRef = useRef(false); // Ref to access in async callbacks
|
|
39
|
-
const stdinCleanupRef = useRef(null);
|
|
40
|
-
const currentTaskIdRef = useRef(null);
|
|
41
|
-
const currentTaskTitleRef = useRef(null);
|
|
42
|
-
// Keep stopAfterCurrent ref in sync with state
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
stopAfterCurrentRef.current = stopAfterCurrent;
|
|
45
|
-
}, [stopAfterCurrent]);
|
|
46
|
-
// Keep isPaused ref in sync with state
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
isPausedRef.current = isPaused;
|
|
49
|
-
}, [isPaused]);
|
|
50
|
-
// Set up stdin command handler for receiving commands via piped input
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
const cleanup = createStdinCommandHandler(() => ({
|
|
53
|
-
messageQueue: messageQueueRef.current,
|
|
54
|
-
onStop: () => {
|
|
55
|
-
setStopAfterCurrent(true);
|
|
56
|
-
outputEvent({ type: "ralph_stop_requested" });
|
|
57
|
-
},
|
|
58
|
-
onPause: () => {
|
|
59
|
-
setIsPaused(true);
|
|
60
|
-
outputEvent({ type: "ralph_pause_requested" });
|
|
61
|
-
},
|
|
62
|
-
onResume: () => {
|
|
63
|
-
const wasPaused = isPausedRef.current;
|
|
64
|
-
setIsPaused(false);
|
|
65
|
-
outputEvent({ type: "ralph_resumed" });
|
|
66
|
-
// If we were paused between iterations, trigger the next iteration
|
|
67
|
-
if (wasPaused && !isRunning) {
|
|
68
|
-
setTimeout(() => setCurrentIteration(i => i + 1), 100);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
onMessage: (text) => {
|
|
72
|
-
// Output event showing we received a message command
|
|
73
|
-
outputEvent({
|
|
74
|
-
type: "ralph_message_received",
|
|
75
|
-
text: text.slice(0, 100) + (text.length > 100 ? "..." : ""),
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
}));
|
|
79
|
-
stdinCleanupRef.current = cleanup;
|
|
80
|
-
return () => {
|
|
81
|
-
cleanup();
|
|
82
|
-
stdinCleanupRef.current = null;
|
|
83
|
-
};
|
|
84
|
-
}, []);
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (currentIteration > totalIterations) {
|
|
87
|
-
outputEvent({ type: "ralph_exit", reason: "max_iterations" });
|
|
88
|
-
exit();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
// Check if there are any tasks available before starting a round
|
|
92
|
-
const currentProgress = startupSnapshot ?
|
|
93
|
-
getProgress(startupSnapshot.initialCount, startupSnapshot.timestamp)
|
|
94
|
-
: { type: "none", completed: 0, total: 0 };
|
|
95
|
-
// All tasks are complete when completed equals total
|
|
96
|
-
if (currentProgress.completed >= currentProgress.total && currentProgress.type !== "none") {
|
|
97
|
-
outputEvent({ type: "ralph_exit", reason: "all_tasks_complete" });
|
|
98
|
-
exit();
|
|
99
|
-
process.exit(0);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
// Get or create the log file path for this run
|
|
103
|
-
// Only create a new sequential log file on the first iteration
|
|
104
|
-
if (!logFileRef.current) {
|
|
105
|
-
logFileRef.current = getNextLogFile();
|
|
106
|
-
writeFileSync(logFileRef.current, "");
|
|
107
|
-
}
|
|
108
|
-
// Read prompt (from .ralph/prompt.md or falling back to templates)
|
|
109
|
-
const promptContent = getPromptContent();
|
|
110
|
-
const todoExists = existsSync(todoFile);
|
|
111
|
-
const todoContent = todoExists ? readFileSync(todoFile, "utf-8") : "";
|
|
112
|
-
const fullPrompt = todoContent ? `${promptContent}\n\n## Current Todo List\n\n${todoContent}` : promptContent;
|
|
113
|
-
const abortController = new AbortController();
|
|
114
|
-
setIsRunning(true);
|
|
115
|
-
// Output iteration start event
|
|
116
|
-
outputEvent({
|
|
117
|
-
type: "ralph_iteration_start",
|
|
118
|
-
iteration: currentIteration,
|
|
119
|
-
totalIterations,
|
|
120
|
-
repo: repoName,
|
|
121
|
-
taskId: currentTaskIdRef.current,
|
|
122
|
-
taskTitle: currentTaskTitleRef.current,
|
|
123
|
-
});
|
|
124
|
-
// Create a message queue for this iteration
|
|
125
|
-
const messageQueue = new MessageQueue();
|
|
126
|
-
messageQueueRef.current = messageQueue;
|
|
127
|
-
// Push the initial prompt as the first message
|
|
128
|
-
messageQueue.push(createUserMessage(fullPrompt));
|
|
129
|
-
const runQuery = async () => {
|
|
130
|
-
let finalResult = "";
|
|
131
|
-
log(`Starting iteration ${currentIteration}`);
|
|
132
|
-
try {
|
|
133
|
-
log(`Beginning query() loop`);
|
|
134
|
-
for await (const message of query({
|
|
135
|
-
prompt: messageQueue,
|
|
136
|
-
options: {
|
|
137
|
-
abortController,
|
|
138
|
-
permissionMode: "bypassPermissions",
|
|
139
|
-
allowDangerouslySkipPermissions: true,
|
|
140
|
-
includePartialMessages: false, // Only complete messages for JSON output
|
|
141
|
-
env: {
|
|
142
|
-
...process.env,
|
|
143
|
-
// Disable LSP plugins to avoid crashes when TypeScript LSP server errors
|
|
144
|
-
ENABLE_LSP_TOOL: "0",
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
})) {
|
|
148
|
-
log(`Received message type: ${message.type}`);
|
|
149
|
-
// Output the raw SDK message as JSON
|
|
150
|
-
outputEvent(message);
|
|
151
|
-
// Check for task lifecycle events in assistant messages
|
|
152
|
-
if (message.type === "assistant") {
|
|
153
|
-
const assistantMessage = message.message;
|
|
154
|
-
const content = assistantMessage?.content;
|
|
155
|
-
if (content) {
|
|
156
|
-
for (const block of content) {
|
|
157
|
-
if (block.type === "text" && typeof block.text === "string") {
|
|
158
|
-
const taskInfo = parseTaskLifecycleEvent(block.text);
|
|
159
|
-
if (taskInfo) {
|
|
160
|
-
if (taskInfo.action === "starting") {
|
|
161
|
-
currentTaskIdRef.current = taskInfo.taskId ?? null;
|
|
162
|
-
currentTaskTitleRef.current = taskInfo.taskTitle ?? null;
|
|
163
|
-
log(`Task started: ${taskInfo.taskId}${taskInfo.taskTitle ? ` - ${taskInfo.taskTitle}` : ""}`);
|
|
164
|
-
// Emit ralph_task_started event
|
|
165
|
-
outputEvent({
|
|
166
|
-
type: "ralph_task_started",
|
|
167
|
-
taskId: taskInfo.taskId,
|
|
168
|
-
taskTitle: taskInfo.taskTitle,
|
|
169
|
-
iteration: currentIteration,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
else if (taskInfo.action === "completed") {
|
|
173
|
-
log(`Task completed: ${taskInfo.taskId}${taskInfo.taskTitle ? ` - ${taskInfo.taskTitle}` : ""}`);
|
|
174
|
-
// Emit ralph_task_completed event
|
|
175
|
-
outputEvent({
|
|
176
|
-
type: "ralph_task_completed",
|
|
177
|
-
taskId: taskInfo.taskId,
|
|
178
|
-
taskTitle: taskInfo.taskTitle,
|
|
179
|
-
iteration: currentIteration,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// Capture the final result message
|
|
188
|
-
if (message.type === "result" &&
|
|
189
|
-
"result" in message &&
|
|
190
|
-
typeof message.result === "string") {
|
|
191
|
-
log(`Received result message`);
|
|
192
|
-
finalResult = message.result;
|
|
193
|
-
// Close the message queue immediately when we get the result.
|
|
194
|
-
log(`Closing message queue on result`);
|
|
195
|
-
messageQueue.close();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
log(`query() loop completed normally`);
|
|
199
|
-
setIsRunning(false);
|
|
200
|
-
log(`Ensuring message queue is closed`);
|
|
201
|
-
messageQueue.close();
|
|
202
|
-
messageQueueRef.current = null;
|
|
203
|
-
// Output iteration end event
|
|
204
|
-
outputEvent({
|
|
205
|
-
type: "ralph_iteration_end",
|
|
206
|
-
iteration: currentIteration,
|
|
207
|
-
taskId: currentTaskIdRef.current,
|
|
208
|
-
taskTitle: currentTaskTitleRef.current,
|
|
209
|
-
});
|
|
210
|
-
// Check for stop-after-current request
|
|
211
|
-
if (stopAfterCurrentRef.current) {
|
|
212
|
-
log(`Stop after current requested - exiting gracefully`);
|
|
213
|
-
outputEvent({ type: "ralph_exit", reason: "stop_requested" });
|
|
214
|
-
exit();
|
|
215
|
-
process.exit(0);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
// Check for completion
|
|
219
|
-
if (finalResult.includes("<promise>COMPLETE</promise>")) {
|
|
220
|
-
outputEvent({ type: "ralph_exit", reason: "task_complete" });
|
|
221
|
-
exit();
|
|
222
|
-
process.exit(0);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
// Check for pause request - if paused, we wait for resume via stdin
|
|
226
|
-
if (isPausedRef.current) {
|
|
227
|
-
log(`Paused after iteration ${currentIteration}`);
|
|
228
|
-
outputEvent({ type: "ralph_paused", iteration: currentIteration });
|
|
229
|
-
// Don't move to next iteration - the resume handler will trigger it
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
// Move to next iteration
|
|
233
|
-
setTimeout(() => setCurrentIteration(i => i + 1), 500);
|
|
234
|
-
}
|
|
235
|
-
catch (err) {
|
|
236
|
-
log(`query() loop error: ${err instanceof Error ? err.message : String(err)}`);
|
|
237
|
-
setIsRunning(false);
|
|
238
|
-
log(`Closing message queue after error`);
|
|
239
|
-
messageQueue.close();
|
|
240
|
-
messageQueueRef.current = null;
|
|
241
|
-
if (abortController.signal.aborted) {
|
|
242
|
-
log(`Abort signal detected`);
|
|
243
|
-
return; // Intentionally aborted
|
|
244
|
-
}
|
|
245
|
-
const errorMsg = `Error running Claude: ${err instanceof Error ? err.message : String(err)}`;
|
|
246
|
-
setError(errorMsg);
|
|
247
|
-
outputEvent({ type: "ralph_error", error: errorMsg });
|
|
248
|
-
setTimeout(() => {
|
|
249
|
-
exit();
|
|
250
|
-
process.exit(1);
|
|
251
|
-
}, 100);
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
runQuery();
|
|
255
|
-
return () => {
|
|
256
|
-
log(`Cleanup: aborting and closing queue for iteration ${currentIteration}`);
|
|
257
|
-
abortController.abort();
|
|
258
|
-
messageQueue.close();
|
|
259
|
-
messageQueueRef.current = null;
|
|
260
|
-
};
|
|
261
|
-
}, [currentIteration, totalIterations, exit, startupSnapshot]);
|
|
262
|
-
// In JSON mode, we output to stdout, so no visual rendering needed
|
|
263
|
-
// Just return an empty component (Ink requires something to render)
|
|
264
|
-
if (error) {
|
|
265
|
-
return React.createElement(Text, null, "");
|
|
266
|
-
}
|
|
267
|
-
return React.createElement(Text, null, "");
|
|
268
|
-
};
|
|
269
|
-
//# sourceMappingURL=JsonOutput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonOutput.js","sourceRoot":"","sources":["../../src/components/JsonOutput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO,EAAE,KAAK,EAAmB,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAEzE,OAAO,EAAE,iBAAiB,EAAE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gBAAgB,EAAE,CAAC,CAAA;YAC5E,eAAe,CAAC,KAAK,EAAE,CAAA;YACvB,YAAY,CAAC,KAAK,EAAE,CAAA;YACpB,eAAe,CAAC,OAAO,GAAG,IAAI,CAAA;QAChC,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,gBAAgB,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAA;IAE9D,mEAAmE;IACnE,oEAAoE;IACpE,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,oBAAC,IAAI,QAAE,EAAE,CAAQ,CAAA;IAC1B,CAAC;IAED,OAAO,oBAAC,IAAI,QAAE,EAAE,CAAQ,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonOutput.test.d.ts","sourceRoot":"","sources":["../../src/components/JsonOutput.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { parseTaskLifecycleEvent } from "../lib/parseTaskLifecycle.js";
|
|
3
|
-
describe("JsonOutput task tracking", () => {
|
|
4
|
-
it("detects task start events", () => {
|
|
5
|
-
const text = "<start_task>r-abc1</start_task>";
|
|
6
|
-
const result = parseTaskLifecycleEvent(text);
|
|
7
|
-
expect(result).toEqual({
|
|
8
|
-
action: "starting",
|
|
9
|
-
taskId: "r-abc1",
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
it("detects task completion events", () => {
|
|
13
|
-
const text = "<end_task>r-abc1</end_task>";
|
|
14
|
-
const result = parseTaskLifecycleEvent(text);
|
|
15
|
-
expect(result).toEqual({
|
|
16
|
-
action: "completed",
|
|
17
|
-
taskId: "r-abc1",
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
it("detects task events within surrounding text", () => {
|
|
21
|
-
const text = "Some text before <start_task>r-xyz9</start_task> and after";
|
|
22
|
-
const result = parseTaskLifecycleEvent(text);
|
|
23
|
-
expect(result).toEqual({
|
|
24
|
-
action: "starting",
|
|
25
|
-
taskId: "r-xyz9",
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
it("returns null for non-task-lifecycle text", () => {
|
|
29
|
-
const text = "This is just regular assistant output";
|
|
30
|
-
const result = parseTaskLifecycleEvent(text);
|
|
31
|
-
expect(result).toBeNull();
|
|
32
|
-
});
|
|
33
|
-
it("returns null for old emoji format", () => {
|
|
34
|
-
// Old emoji format is no longer supported
|
|
35
|
-
expect(parseTaskLifecycleEvent("✨ Starting **r-abc1**")).toBeNull();
|
|
36
|
-
expect(parseTaskLifecycleEvent("✅ Completed **r-abc1**")).toBeNull();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=JsonOutput.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonOutput.test.js","sourceRoot":"","sources":["../../src/components/JsonOutput.test.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,IAAI,GAAG,iCAAiC,CAAA;QAC9C,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;QAE5C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,IAAI,GAAG,6BAA6B,CAAA;QAC1C,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;QAE5C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,IAAI,GAAG,4DAA4D,CAAA;QACzE,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;QAE5C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG,uCAAuC,CAAA;QACpD,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAA;QAE5C,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,0CAA0C;QAC1C,MAAM,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;QACnE,MAAM,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A simple progress bar component using Unicode block characters.
|
|
4
|
-
* Shows completion progress: completed / total
|
|
5
|
-
*/
|
|
6
|
-
export declare const ProgressBar: ({ completed, total, width, repoName }: Props) => React.JSX.Element | null;
|
|
7
|
-
type Props = {
|
|
8
|
-
/** Number of items completed (closed issues or checked tasks) */
|
|
9
|
-
completed: number;
|
|
10
|
-
/** Total number of items seen since startup */
|
|
11
|
-
total: number;
|
|
12
|
-
/** Width of the progress bar in characters (default: 12) */
|
|
13
|
-
width?: number;
|
|
14
|
-
/** Repository name to display before the progress bar */
|
|
15
|
-
repoName?: string;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/components/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,uCAA4C,KAAK,6BA6B5E,CAAA;AAED,KAAK,KAAK,GAAG;IACX,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAA;IACjB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Text } from "ink";
|
|
3
|
-
/**
|
|
4
|
-
* A simple progress bar component using Unicode block characters.
|
|
5
|
-
* Shows completion progress: completed / total
|
|
6
|
-
*/
|
|
7
|
-
export const ProgressBar = ({ completed, total, width = 12, repoName }) => {
|
|
8
|
-
if (total === 0) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
// Progress is how much is done: completed / total
|
|
12
|
-
const progress = Math.min(1, Math.max(0, completed / total));
|
|
13
|
-
const filledWidth = Math.round(progress * width);
|
|
14
|
-
const emptyWidth = width - filledWidth;
|
|
15
|
-
const filled = "▰".repeat(filledWidth);
|
|
16
|
-
const empty = "▱".repeat(emptyWidth);
|
|
17
|
-
return (React.createElement(Text, null,
|
|
18
|
-
repoName && (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement(Text, { color: "cyan" }, repoName),
|
|
20
|
-
React.createElement(Text, { dimColor: true }, " \u2502 "))),
|
|
21
|
-
React.createElement(Text, { color: "yellow" }, filled),
|
|
22
|
-
React.createElement(Text, { dimColor: true }, empty),
|
|
23
|
-
React.createElement(Text, { dimColor: true },
|
|
24
|
-
" ",
|
|
25
|
-
completed,
|
|
26
|
-
"/",
|
|
27
|
-
total,
|
|
28
|
-
" ")));
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../src/components/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAS,EAAE,EAAE;IAC/E,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,kDAAkD;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAA;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAA;IAChD,MAAM,UAAU,GAAG,KAAK,GAAG,WAAW,CAAA;IAEtC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;IACtC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAEpC,OAAO,CACL,oBAAC,IAAI;QACF,QAAQ,IAAI,CACX;YACE,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,IAAE,QAAQ,CAAQ;YACpC,oBAAC,IAAI,IAAC,QAAQ,qBAAW,CACxB,CACJ;QACD,oBAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,IAAE,MAAM,CAAQ;QACpC,oBAAC,IAAI,IAAC,QAAQ,UAAE,KAAK,CAAQ;QAC7B,oBAAC,IAAI,IAAC,QAAQ;YACX,GAAG;YACH,SAAS;;YAAG,KAAK;YAAE,GAAG,CAClB,CACF,CACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.test.d.ts","sourceRoot":"","sources":["../../src/components/ProgressBar.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
3
|
-
import { render } from "ink-testing-library";
|
|
4
|
-
import { ProgressBar } from "./ProgressBar.js";
|
|
5
|
-
describe("ProgressBar", () => {
|
|
6
|
-
it("renders nothing when total is 0", () => {
|
|
7
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 0, total: 0 }));
|
|
8
|
-
expect(lastFrame()).toBe("");
|
|
9
|
-
});
|
|
10
|
-
it("shows empty bar when no tasks completed", () => {
|
|
11
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 0, total: 10, width: 10 }));
|
|
12
|
-
const output = lastFrame();
|
|
13
|
-
expect(output).toContain("▱▱▱▱▱▱▱▱▱▱");
|
|
14
|
-
expect(output).toContain("0/10");
|
|
15
|
-
});
|
|
16
|
-
it("shows full bar when all tasks completed", () => {
|
|
17
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 10, total: 10, width: 10 }));
|
|
18
|
-
const output = lastFrame();
|
|
19
|
-
expect(output).toContain("▰▰▰▰▰▰▰▰▰▰");
|
|
20
|
-
expect(output).toContain("10/10");
|
|
21
|
-
});
|
|
22
|
-
it("shows half bar when half completed", () => {
|
|
23
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 5, total: 10, width: 10 }));
|
|
24
|
-
const output = lastFrame();
|
|
25
|
-
expect(output).toContain("▰▰▰▰▰");
|
|
26
|
-
expect(output).toContain("▱▱▱▱▱");
|
|
27
|
-
expect(output).toContain("5/10");
|
|
28
|
-
});
|
|
29
|
-
it("respects custom width", () => {
|
|
30
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 10, total: 10, width: 5 }));
|
|
31
|
-
const output = lastFrame();
|
|
32
|
-
// Should have 5 filled blocks
|
|
33
|
-
expect(output).toMatch(/▰{5}/);
|
|
34
|
-
});
|
|
35
|
-
it("clamps progress to 0-100%", () => {
|
|
36
|
-
// More completed than total (shouldn't happen, but handle gracefully)
|
|
37
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 15, total: 10, width: 10 }));
|
|
38
|
-
const output = lastFrame();
|
|
39
|
-
expect(output).toContain("▰▰▰▰▰▰▰▰▰▰");
|
|
40
|
-
});
|
|
41
|
-
it("displays repo name when provided", () => {
|
|
42
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 5, total: 10, width: 10, repoName: "my-repo" }));
|
|
43
|
-
const output = lastFrame();
|
|
44
|
-
expect(output).toContain("my-repo");
|
|
45
|
-
expect(output).toContain("│");
|
|
46
|
-
expect(output).toContain("5/10");
|
|
47
|
-
});
|
|
48
|
-
it("does not display repo name when not provided", () => {
|
|
49
|
-
const { lastFrame } = render(React.createElement(ProgressBar, { completed: 5, total: 10, width: 10 }));
|
|
50
|
-
const output = lastFrame();
|
|
51
|
-
expect(output).not.toContain("│");
|
|
52
|
-
expect(output).toContain("5/10");
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=ProgressBar.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.test.js","sourceRoot":"","sources":["../../src/components/ProgressBar.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,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