@herbcaudill/ralph 1.0.1 → 1.1.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.
- package/README.md +93 -0
- package/dist/index.js +2480 -6
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/templates/core-prompt.md +3 -19
- package/templates/skills/manage-tasks/SKILL.md +0 -3
- package/templates/workflow.md +5 -19
- 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,349 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "ink-testing-library";
|
|
3
|
-
import { describe, it, expect, vi } from "vitest";
|
|
4
|
-
import { EventDisplay } from "./EventDisplay.js";
|
|
5
|
-
/**
|
|
6
|
-
* Test suite for EventDisplay component
|
|
7
|
-
*/
|
|
8
|
-
describe("EventDisplay", () => {
|
|
9
|
-
/**
|
|
10
|
-
* Verify that stream_event types are filtered out and only assistant messages are displayed
|
|
11
|
-
*/
|
|
12
|
-
it("filters out stream_event types and only shows assistant messages", async () => {
|
|
13
|
-
const events = [
|
|
14
|
-
{
|
|
15
|
-
type: "stream_event",
|
|
16
|
-
event: {
|
|
17
|
-
type: "content_block_delta",
|
|
18
|
-
delta: { type: "text_delta", text: "Streaming..." },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
type: "assistant",
|
|
23
|
-
message: {
|
|
24
|
-
id: "msg_123",
|
|
25
|
-
content: [{ type: "text", text: "Complete message" }],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
30
|
-
await vi.waitFor(() => {
|
|
31
|
-
const output = lastFrame() ?? "";
|
|
32
|
-
expect(output).toContain("Complete message");
|
|
33
|
-
// Should not show streaming events
|
|
34
|
-
expect(output).not.toContain("Streaming...");
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Verify that events with the same message ID are deduplicated, keeping only the latest version
|
|
39
|
-
*/
|
|
40
|
-
it("deduplicates events with the same message ID", async () => {
|
|
41
|
-
const events = [
|
|
42
|
-
{
|
|
43
|
-
type: "assistant",
|
|
44
|
-
message: {
|
|
45
|
-
id: "msg_123",
|
|
46
|
-
content: [{ type: "text", text: "First version" }],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
type: "assistant",
|
|
51
|
-
message: {
|
|
52
|
-
id: "msg_123",
|
|
53
|
-
content: [
|
|
54
|
-
{ type: "text", text: "First version" },
|
|
55
|
-
{ type: "text", text: "Updated version" },
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
61
|
-
// Wait for useEffect to complete
|
|
62
|
-
await vi.waitFor(() => {
|
|
63
|
-
const output = lastFrame() ?? "";
|
|
64
|
-
expect(output).toContain("Updated version");
|
|
65
|
-
});
|
|
66
|
-
const output = lastFrame() ?? "";
|
|
67
|
-
// Should not duplicate the first text
|
|
68
|
-
expect(output.match(/First version/g)?.length).toBe(1);
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* Verify that multiple different messages are all displayed correctly
|
|
72
|
-
*/
|
|
73
|
-
it("handles multiple different messages", async () => {
|
|
74
|
-
const events = [
|
|
75
|
-
{
|
|
76
|
-
type: "assistant",
|
|
77
|
-
message: {
|
|
78
|
-
id: "msg_123",
|
|
79
|
-
content: [{ type: "text", text: "Message 1" }],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
type: "assistant",
|
|
84
|
-
message: {
|
|
85
|
-
id: "msg_456",
|
|
86
|
-
content: [{ type: "text", text: "Message 2" }],
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
91
|
-
await vi.waitFor(() => {
|
|
92
|
-
const output = lastFrame() ?? "";
|
|
93
|
-
expect(output).toContain("Message 1");
|
|
94
|
-
expect(output).toContain("Message 2");
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
/**
|
|
98
|
-
* Verify that tool use events are displayed correctly with tool names and file paths
|
|
99
|
-
*/
|
|
100
|
-
it("handles tool use events", async () => {
|
|
101
|
-
const events = [
|
|
102
|
-
{
|
|
103
|
-
type: "assistant",
|
|
104
|
-
message: {
|
|
105
|
-
id: "msg_123",
|
|
106
|
-
content: [
|
|
107
|
-
{
|
|
108
|
-
type: "tool_use",
|
|
109
|
-
name: "Read",
|
|
110
|
-
input: { file_path: "/absolute/path/file.ts" },
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
];
|
|
116
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
117
|
-
await vi.waitFor(() => {
|
|
118
|
-
const output = lastFrame() ?? "";
|
|
119
|
-
expect(output).toContain("Read");
|
|
120
|
-
expect(output).toContain("file.ts");
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
/**
|
|
124
|
-
* Verify that the display updates correctly when new events are added to the event list
|
|
125
|
-
*/
|
|
126
|
-
it("updates display when new events arrive", async () => {
|
|
127
|
-
const events1 = [
|
|
128
|
-
{
|
|
129
|
-
type: "assistant",
|
|
130
|
-
message: {
|
|
131
|
-
id: "msg_123",
|
|
132
|
-
content: [{ type: "text", text: "Initial" }],
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
];
|
|
136
|
-
const { lastFrame, rerender } = render(React.createElement(EventDisplay, { events: events1, iteration: 1, completedIterations: [] }));
|
|
137
|
-
await vi.waitFor(() => {
|
|
138
|
-
expect(lastFrame()).toContain("Initial");
|
|
139
|
-
});
|
|
140
|
-
const events2 = [
|
|
141
|
-
...events1,
|
|
142
|
-
{
|
|
143
|
-
type: "assistant",
|
|
144
|
-
message: {
|
|
145
|
-
id: "msg_456",
|
|
146
|
-
content: [{ type: "text", text: "New message" }],
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
rerender(React.createElement(EventDisplay, { events: events2, iteration: 1, completedIterations: [] }));
|
|
151
|
-
await vi.waitFor(() => {
|
|
152
|
-
const output = lastFrame() ?? "";
|
|
153
|
-
expect(output).toContain("Initial");
|
|
154
|
-
expect(output).toContain("New message");
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
/**
|
|
158
|
-
* Verify that partial message updates during streaming don't create duplicate React keys
|
|
159
|
-
*/
|
|
160
|
-
it("handles partial message updates without duplicating keys", async () => {
|
|
161
|
-
// Simulate streaming where the same message gets updated multiple times
|
|
162
|
-
const events = [
|
|
163
|
-
{
|
|
164
|
-
type: "assistant",
|
|
165
|
-
message: {
|
|
166
|
-
id: "msg_123",
|
|
167
|
-
content: [{ type: "text", text: "Thinking..." }],
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
type: "assistant",
|
|
172
|
-
message: {
|
|
173
|
-
id: "msg_123",
|
|
174
|
-
content: [
|
|
175
|
-
{ type: "text", text: "Thinking..." },
|
|
176
|
-
{
|
|
177
|
-
type: "tool_use",
|
|
178
|
-
id: "toolu_read1",
|
|
179
|
-
name: "Read",
|
|
180
|
-
input: { file_path: "/path/file.ts" },
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
type: "assistant",
|
|
187
|
-
message: {
|
|
188
|
-
id: "msg_123",
|
|
189
|
-
content: [
|
|
190
|
-
{ type: "text", text: "Thinking..." },
|
|
191
|
-
{
|
|
192
|
-
type: "tool_use",
|
|
193
|
-
id: "toolu_read1",
|
|
194
|
-
name: "Read",
|
|
195
|
-
input: { file_path: "/path/file.ts" },
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
type: "tool_use",
|
|
199
|
-
id: "toolu_edit1",
|
|
200
|
-
name: "Edit",
|
|
201
|
-
input: { file_path: "/path/file.ts" },
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
];
|
|
207
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
208
|
-
await vi.waitFor(() => {
|
|
209
|
-
const output = lastFrame() ?? "";
|
|
210
|
-
// Should only see one instance of each tool
|
|
211
|
-
expect(output.match(/Read/g)?.length).toBe(1);
|
|
212
|
-
expect(output.match(/Edit/g)?.length).toBe(1);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
/**
|
|
216
|
-
* Verify that consecutive text blocks are merged to prevent unwanted gaps in the output
|
|
217
|
-
*/
|
|
218
|
-
it("merges consecutive text blocks to prevent unwanted gaps", async () => {
|
|
219
|
-
// When Claude outputs text in multiple blocks (e.g., before and after inline code),
|
|
220
|
-
// we should merge them into one StreamingText component to avoid gaps
|
|
221
|
-
const events = [
|
|
222
|
-
{
|
|
223
|
-
type: "assistant",
|
|
224
|
-
message: {
|
|
225
|
-
id: "msg_123",
|
|
226
|
-
content: [
|
|
227
|
-
{ type: "text", text: "Use the " },
|
|
228
|
-
{ type: "text", text: "`console.log()`" },
|
|
229
|
-
{ type: "text", text: " function to debug." },
|
|
230
|
-
],
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
];
|
|
234
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [] }));
|
|
235
|
-
await vi.waitFor(() => {
|
|
236
|
-
const output = lastFrame() ?? "";
|
|
237
|
-
expect(output).toContain("Use the");
|
|
238
|
-
expect(output).toContain("console.log()");
|
|
239
|
-
expect(output).toContain("function to debug");
|
|
240
|
-
});
|
|
241
|
-
// The text content should be on one line (after the header)
|
|
242
|
-
const output = lastFrame() ?? "";
|
|
243
|
-
// Filter out header lines (containing box border characters or "Round")
|
|
244
|
-
const contentLines = output
|
|
245
|
-
.split("\n")
|
|
246
|
-
.filter(l => l.trim())
|
|
247
|
-
.filter(l => !l.includes("─") && !l.includes("│") && !l.includes("╭") && !l.includes("╰"));
|
|
248
|
-
expect(contentLines.length).toBe(1);
|
|
249
|
-
});
|
|
250
|
-
/**
|
|
251
|
-
* Verify that completed iteration rounds are displayed before the current round
|
|
252
|
-
*/
|
|
253
|
-
it("displays completed rounds before current round", async () => {
|
|
254
|
-
const completedIterations = [
|
|
255
|
-
{
|
|
256
|
-
iteration: 1,
|
|
257
|
-
events: [
|
|
258
|
-
{
|
|
259
|
-
type: "assistant",
|
|
260
|
-
message: {
|
|
261
|
-
id: "msg_iter1",
|
|
262
|
-
content: [{ type: "text", text: "First round work" }],
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
iteration: 2,
|
|
269
|
-
events: [
|
|
270
|
-
{
|
|
271
|
-
type: "assistant",
|
|
272
|
-
message: {
|
|
273
|
-
id: "msg_iter2",
|
|
274
|
-
content: [{ type: "text", text: "Second round work" }],
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
];
|
|
280
|
-
const currentEvents = [
|
|
281
|
-
{
|
|
282
|
-
type: "assistant",
|
|
283
|
-
message: {
|
|
284
|
-
id: "msg_iter3",
|
|
285
|
-
content: [{ type: "text", text: "Third round work" }],
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
];
|
|
289
|
-
const { lastFrame } = render(React.createElement(EventDisplay, { events: currentEvents, iteration: 3, completedIterations: completedIterations }));
|
|
290
|
-
await vi.waitFor(() => {
|
|
291
|
-
const output = lastFrame() ?? "";
|
|
292
|
-
// Should show all 3 rounds
|
|
293
|
-
expect(output).toContain("Round 1");
|
|
294
|
-
expect(output).toContain("First round work");
|
|
295
|
-
expect(output).toContain("Round 2");
|
|
296
|
-
expect(output).toContain("Second round work");
|
|
297
|
-
expect(output).toContain("Round 3");
|
|
298
|
-
expect(output).toContain("Third round work");
|
|
299
|
-
});
|
|
300
|
-
// Verify order: round 1 before 2, round 2 before 3
|
|
301
|
-
const output = lastFrame() ?? "";
|
|
302
|
-
const iter1Pos = output.indexOf("Round 1");
|
|
303
|
-
const iter2Pos = output.indexOf("Round 2");
|
|
304
|
-
const iter3Pos = output.indexOf("Round 3");
|
|
305
|
-
expect(iter1Pos).toBeLessThan(iter2Pos);
|
|
306
|
-
expect(iter2Pos).toBeLessThan(iter3Pos);
|
|
307
|
-
});
|
|
308
|
-
/**
|
|
309
|
-
* Verify that round headers are shown correctly when transitioning from one round to the next
|
|
310
|
-
*/
|
|
311
|
-
it("shows new round header when transitioning between rounds", async () => {
|
|
312
|
-
// Start with round 1
|
|
313
|
-
const iter1Events = [
|
|
314
|
-
{
|
|
315
|
-
type: "assistant",
|
|
316
|
-
message: {
|
|
317
|
-
id: "msg_iter1",
|
|
318
|
-
content: [{ type: "text", text: "First round" }],
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
];
|
|
322
|
-
const { lastFrame, rerender } = render(React.createElement(EventDisplay, { events: iter1Events, iteration: 1, completedIterations: [] }));
|
|
323
|
-
await vi.waitFor(() => {
|
|
324
|
-
const output = lastFrame() ?? "";
|
|
325
|
-
expect(output).toContain("Round 1");
|
|
326
|
-
expect(output).toContain("First round");
|
|
327
|
-
});
|
|
328
|
-
// Transition to round 2 (round 1 moves to completedIterations)
|
|
329
|
-
const iter2Events = [
|
|
330
|
-
{
|
|
331
|
-
type: "assistant",
|
|
332
|
-
message: {
|
|
333
|
-
id: "msg_iter2",
|
|
334
|
-
content: [{ type: "text", text: "Second round" }],
|
|
335
|
-
},
|
|
336
|
-
},
|
|
337
|
-
];
|
|
338
|
-
rerender(React.createElement(EventDisplay, { events: iter2Events, iteration: 2, completedIterations: [{ iteration: 1, events: iter1Events }] }));
|
|
339
|
-
await vi.waitFor(() => {
|
|
340
|
-
const output = lastFrame() ?? "";
|
|
341
|
-
// Should show both rounds
|
|
342
|
-
expect(output).toContain("Round 1");
|
|
343
|
-
expect(output).toContain("First round");
|
|
344
|
-
expect(output).toContain("Round 2");
|
|
345
|
-
expect(output).toContain("Second round");
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
//# sourceMappingURL=EventDisplay.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventDisplay.test.js","sourceRoot":"","sources":["../../src/components/EventDisplay.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;GAEG;AACH,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B;;OAEG;IACH,EAAE,CAAC,kEAAkE,EAAE,KAAK,IAAI,EAAE;QAChF,MAAM,MAAM,GAAG;YACb;gBACE,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE;oBACL,IAAI,EAAE,qBAAqB;oBAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE;iBACpD;aACF;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACP,EAAE,EAAE,SAAS;oBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;iBACtD;aACF;SACF,CAAA;QAED,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,oBAAC,YAAY,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,mBAAmB,EAAE,EAAE,GAAI,CACxE,CAAA;QAED,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YACpB,MAAM,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,CAAA;YAChC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAA;YAC5C,mC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AI,EAAE,cAAc,EAAE,CAAC;iBAClD;aACF;SACF,CAAA;QAED,QAAQ,CACN,oBAAC,YAAY,IACX,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,CAAC,EACZ,mBAAmB,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,GAC5D,CACH,CAAA;QAED,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YACpB,MAAM,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,CAAA;YAChC,0BAA0B;YAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YACnC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YACvC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;YACnC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
/** Full-screen layout component with header, content area, and optional footer */
|
|
3
|
-
export declare const FullScreenLayout: ({ title, children, footer, version }: Props) => React.JSX.Element;
|
|
4
|
-
type Props = {
|
|
5
|
-
/** Title text displayed in the header */
|
|
6
|
-
title: string;
|
|
7
|
-
/** Content to render in the main area */
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/** Optional footer content */
|
|
10
|
-
footer?: ReactNode;
|
|
11
|
-
/** Optional version string displayed in the footer */
|
|
12
|
-
version?: string;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=FullScreenLayout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FullScreenLayout.d.ts","sourceRoot":"","sources":["../../src/components/FullScreenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOxC,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,GAAI,sCAAsC,KAAK,sBA4D3E,CAAA;AAED,KAAK,KAAK,GAAG;IACX,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,yCAAyC;IACzC,QAAQ,EAAE,SAAS,CAAA;IACnB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import BigText from "ink-big-text";
|
|
4
|
-
import Gradient from "ink-gradient";
|
|
5
|
-
import { useTerminalSize } from "../lib/useTerminalSize.js";
|
|
6
|
-
import { useContentHeight, HEADER_HEIGHT, FOOTER_HEIGHT } from "./useContentHeight.js";
|
|
7
|
-
/** Full-screen layout component with header, content area, and optional footer */
|
|
8
|
-
export const FullScreenLayout = ({ title, children, footer, version }) => {
|
|
9
|
-
const { columns, rows } = useTerminalSize();
|
|
10
|
-
const contentHeight = useContentHeight(!!footer);
|
|
11
|
-
return (React.createElement(Box, { flexDirection: "column", width: columns, height: rows, borderStyle: "round", borderColor: "gray" },
|
|
12
|
-
React.createElement(Box, { flexDirection: "column", alignItems: "center", justifyContent: "center", height: HEADER_HEIGHT, borderStyle: "single", borderTop: false, borderLeft: false, borderRight: false, borderColor: "gray" },
|
|
13
|
-
React.createElement(Gradient, { colors: ["#30A6E4", "#EBC635"] },
|
|
14
|
-
React.createElement(BigText, { text: title, font: "tiny" }))),
|
|
15
|
-
React.createElement(Box, { flexDirection: "column", flexGrow: 1, paddingX: 1, height: contentHeight, overflowY: "hidden" }, children),
|
|
16
|
-
footer && (React.createElement(Box, { paddingX: 1, height: FOOTER_HEIGHT, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", alignItems: "center", justifyContent: "space-between" },
|
|
17
|
-
React.createElement(Box, null, footer),
|
|
18
|
-
version && React.createElement(Text, { dimColor: true }, version)))));
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=FullScreenLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FullScreenLayout.js","sourceRoot":"","sources":["../../src/components/FullScreenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,QAAQ,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEtF,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAS,EAAE,EAAE;IAC9E,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,eAAe,EAAE,CAAA;IAC3C,MAAM,aAAa,GAAG,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAEhD,OAAO,CACL,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,IAAI,EACZ,WAAW,EAAC,OAAO,EACnB,WAAW,EAAC,MAAM;QAGlB,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,QAAQ,EACvB,MAAM,EAAE,aAAa,EACrB,WAAW,EAAC,QAAQ,EACpB,SAAS,EAAE,KAAK,EAChB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAC,MAAM;YAElB,oBAAC,QAAQ,IAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;gBACtC,oBAAC,OAAO,IAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,GAAG,CAC3B,CACP;QAGN,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,aAAa,EACrB,SAAS,EAAC,QAAQ,IAEjB,QAAQ,CACL;QAGL,MAAM,IAAI,CACT,oBAAC,GAAG,IACF,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,aAAa,EACrB,WAAW,EAAC,QAAQ,EACpB,SAAS,QACT,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAC,MAAM,EAClB,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,eAAe;YAE9B,oBAAC,GAAG,QAAE,MAAM,CAAO;YAClB,OAAO,IAAI,oBAAC,IAAI,IAAC,QAAQ,UAAE,OAAO,CAAQ,CACvC,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/** Display the Ralph header with version information and branding. */
|
|
3
|
-
export declare const Header: ({ claudeVersion, ralphVersion, width, }: Props) => React.JSX.Element;
|
|
4
|
-
type Props = {
|
|
5
|
-
claudeVersion: string;
|
|
6
|
-
ralphVersion: string;
|
|
7
|
-
width?: number;
|
|
8
|
-
};
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,uEAAuE;AACvE,eAAO,MAAM,MAAM,GAAI,yCAOpB,KAAK,sBAkBP,CAAA;AAED,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import BigText from "ink-big-text";
|
|
4
|
-
import Gradient from "ink-gradient";
|
|
5
|
-
/** Display the Ralph header with version information and branding. */
|
|
6
|
-
export const Header = ({
|
|
7
|
-
/** The Claude CLI version */
|
|
8
|
-
claudeVersion,
|
|
9
|
-
/** The Ralph version */
|
|
10
|
-
ralphVersion,
|
|
11
|
-
/** Optional box width */
|
|
12
|
-
width, }) => {
|
|
13
|
-
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, borderStyle: "single", alignItems: "center", width: width, paddingX: 2 },
|
|
14
|
-
React.createElement(Gradient, { colors: ["#30A6E4", "#EBC635"] },
|
|
15
|
-
React.createElement(BigText, { text: "Ralph", font: "tiny" })),
|
|
16
|
-
React.createElement(Text, { dimColor: true },
|
|
17
|
-
"@herbcaudill/ralph v",
|
|
18
|
-
ralphVersion,
|
|
19
|
-
" \u2022 Claude Code v",
|
|
20
|
-
claudeVersion)));
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,QAAQ,MAAM,cAAc,CAAA;AAEnC,uEAAuE;AACvE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC;AACrB,6BAA6B;AAC7B,aAAa;AACb,wBAAwB;AACxB,YAAY;AACZ,yBAAyB;AACzB,KAAK,GACC,EAAE,EAAE;IACV,OAAO,CACL,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,YAAY,EAAE,CAAC,EACf,WAAW,EAAC,QAAQ,EACpB,UAAU,EAAC,QAAQ,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC;QAEX,oBAAC,QAAQ,IAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YACtC,oBAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,GAAG,CAC3B;QACX,oBAAC,IAAI,IAAC,QAAQ;;YACS,YAAY;;YAAkB,aAAa,CAC3D,CACH,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.test.d.ts","sourceRoot":"","sources":["../../src/components/Header.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { describe, it, expect } from "vitest";
|
|
3
|
-
import { render } from "ink-testing-library";
|
|
4
|
-
import { Header } from "./Header.js";
|
|
5
|
-
describe("Header", () => {
|
|
6
|
-
it("renders the title", () => {
|
|
7
|
-
const { lastFrame } = render(React.createElement(Header, { claudeVersion: "1.0.0", ralphVersion: "0.2.0" }));
|
|
8
|
-
const output = lastFrame();
|
|
9
|
-
// BigText renders ASCII art with ANSI codes
|
|
10
|
-
// Check for box-drawing characters or unicode that appear in the art
|
|
11
|
-
expect(output?.length).toBeGreaterThan(0);
|
|
12
|
-
expect(output).toContain("Claude Code");
|
|
13
|
-
});
|
|
14
|
-
it("displays both version numbers on the same line", () => {
|
|
15
|
-
const { lastFrame } = render(React.createElement(Header, { claudeVersion: "2.5.3", ralphVersion: "0.2.0" }));
|
|
16
|
-
const output = lastFrame();
|
|
17
|
-
expect(output).toContain("@herbcaudill/ralph v0.2.0");
|
|
18
|
-
expect(output).toContain("Claude Code v2.5.3");
|
|
19
|
-
expect(output).toContain("•");
|
|
20
|
-
});
|
|
21
|
-
it("displays versions with correct formatting", () => {
|
|
22
|
-
const { lastFrame } = render(React.createElement(Header, { claudeVersion: "1.0.0", ralphVersion: "0.1.0" }));
|
|
23
|
-
const output = lastFrame();
|
|
24
|
-
expect(output).toContain("@herbcaudill/ralph v0.1.0 • Claude Code v1.0.0");
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=Header.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Header.test.js","sourceRoot":"","sources":["../../src/components/Header.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,aAAa,EAAC,OAAO,EAAC,YAAY,EAAC,OAAO,GAAG,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,4CAA4C;QAC5C,qEAAqE;QACrE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,aAAa,EAAC,OAAO,EAAC,YAAY,EAAC,OAAO,GAAG,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAA;QACrD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAA;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,oBAAC,MAAM,IAAC,aAAa,EAAC,OAAO,EAAC,YAAY,EAAC,OAAO,GAAG,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gDAAgD,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Initializes Ralph by copying workflow templates and agent configurations to the project.
|
|
4
|
-
* Creates .ralph/workflow.md, .claude/skills/, and .claude/agents/ directories with default files.
|
|
5
|
-
* Also adds .ralph/events-*.jsonl to .gitignore.
|
|
6
|
-
*/
|
|
7
|
-
export declare function InitRalph(): React.JSX.Element;
|
|
8
|
-
//# sourceMappingURL=InitRalph.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InitRalph.d.ts","sourceRoot":"","sources":["../../src/components/InitRalph.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAMlD;;;;GAIG;AACH,wBAAgB,SAAS,sBAmJxB"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { Text, Box } from "ink";
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
-
import { existsSync, readFileSync, appendFileSync, writeFileSync } from "fs";
|
|
4
|
-
import { join, dirname } from "path";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
import { copyTemplates } from "../lib/copyTemplates.js";
|
|
7
|
-
/**
|
|
8
|
-
* Initializes Ralph by copying workflow templates and agent configurations to the project.
|
|
9
|
-
* Creates .ralph/workflow.md, .claude/skills/, and .claude/agents/ directories with default files.
|
|
10
|
-
* Also adds .ralph/events-*.jsonl to .gitignore.
|
|
11
|
-
*/
|
|
12
|
-
export function InitRalph() {
|
|
13
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const [status, setStatus] = useState("checking");
|
|
15
|
-
const [createdFiles, setCreatedFiles] = useState([]);
|
|
16
|
-
const [skippedFiles, setSkippedFiles] = useState([]);
|
|
17
|
-
const [errors, setErrors] = useState([]);
|
|
18
|
-
// Check if .ralph already exists and run initialization
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
const ralphDir = join(process.cwd(), ".ralph");
|
|
21
|
-
const claudeDir = join(process.cwd(), ".claude");
|
|
22
|
-
// Check if already initialized
|
|
23
|
-
if (existsSync(join(ralphDir, "workflow.md"))) {
|
|
24
|
-
setStatus("exists");
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
// Run initialization
|
|
28
|
-
const initialize = async () => {
|
|
29
|
-
const templatesDir = join(__dirname, "..", "..", "templates");
|
|
30
|
-
setStatus("creating");
|
|
31
|
-
try {
|
|
32
|
-
const allCreated = [];
|
|
33
|
-
const allSkipped = [];
|
|
34
|
-
const allErrors = [];
|
|
35
|
-
// Copy workflow to .ralph/
|
|
36
|
-
const ralphResult = copyTemplates(templatesDir, ralphDir, [
|
|
37
|
-
{ src: "workflow.md", dest: "workflow.md" },
|
|
38
|
-
]);
|
|
39
|
-
allCreated.push(...ralphResult.created.map(f => `.ralph/${f}`));
|
|
40
|
-
allSkipped.push(...ralphResult.skipped.map(f => `.ralph/${f}`));
|
|
41
|
-
allErrors.push(...ralphResult.errors);
|
|
42
|
-
// Copy skills to .claude/skills/
|
|
43
|
-
const skillsResult = copyTemplates(templatesDir, claudeDir, [
|
|
44
|
-
{ src: "skills/manage-tasks/SKILL.md", dest: "skills/manage-tasks/SKILL.md" },
|
|
45
|
-
]);
|
|
46
|
-
allCreated.push(...skillsResult.created.map(f => `.claude/${f}`));
|
|
47
|
-
allSkipped.push(...skillsResult.skipped.map(f => `.claude/${f}`));
|
|
48
|
-
allErrors.push(...skillsResult.errors);
|
|
49
|
-
// Copy agents to .claude/agents/
|
|
50
|
-
const agentsResult = copyTemplates(templatesDir, claudeDir, [
|
|
51
|
-
{ src: "agents/make-tests.md", dest: "agents/make-tests.md" },
|
|
52
|
-
{ src: "agents/write-docs.md", dest: "agents/write-docs.md" },
|
|
53
|
-
{ src: "agents/run-tests.md", dest: "agents/run-tests.md" },
|
|
54
|
-
]);
|
|
55
|
-
allCreated.push(...agentsResult.created.map(f => `.claude/${f}`));
|
|
56
|
-
allSkipped.push(...agentsResult.skipped.map(f => `.claude/${f}`));
|
|
57
|
-
allErrors.push(...agentsResult.errors);
|
|
58
|
-
// Add events log pattern to .gitignore
|
|
59
|
-
const gitignorePath = join(process.cwd(), ".gitignore");
|
|
60
|
-
const eventsLogEntry = ".ralph/events-*.jsonl";
|
|
61
|
-
if (existsSync(gitignorePath)) {
|
|
62
|
-
const content = readFileSync(gitignorePath, "utf-8");
|
|
63
|
-
if (!content.includes(eventsLogEntry)) {
|
|
64
|
-
const newline = content.endsWith("\n") ? "" : "\n";
|
|
65
|
-
appendFileSync(gitignorePath, `${newline}${eventsLogEntry}\n`);
|
|
66
|
-
allCreated.push("(added .ralph/events-*.jsonl to .gitignore)");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
writeFileSync(gitignorePath, `${eventsLogEntry}\n`);
|
|
71
|
-
allCreated.push("(created .gitignore with .ralph/events-*.jsonl)");
|
|
72
|
-
}
|
|
73
|
-
setCreatedFiles(allCreated);
|
|
74
|
-
setSkippedFiles(allSkipped);
|
|
75
|
-
setErrors(allErrors);
|
|
76
|
-
setStatus("done");
|
|
77
|
-
// Exit after a brief delay so user can see success message
|
|
78
|
-
setTimeout(() => process.exit(0), 100);
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
setErrors([`Failed to initialize: ${error}`]);
|
|
82
|
-
setStatus("done");
|
|
83
|
-
setTimeout(() => process.exit(1), 100);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
initialize();
|
|
87
|
-
}, []);
|
|
88
|
-
if (status === "checking") {
|
|
89
|
-
return React.createElement(Text, null, "Checking directories...");
|
|
90
|
-
}
|
|
91
|
-
if (status === "exists") {
|
|
92
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
93
|
-
React.createElement(Text, { color: "yellow" }, "Ralph is already initialized"),
|
|
94
|
-
React.createElement(Text, { dimColor: true }, "To reinitialize, remove the workflow first: rm .ralph/workflow.md")));
|
|
95
|
-
}
|
|
96
|
-
if (status === "creating") {
|
|
97
|
-
return React.createElement(Text, { color: "cyan" }, "Initializing ralph...");
|
|
98
|
-
}
|
|
99
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
100
|
-
createdFiles.map(file => (React.createElement(Text, { key: file },
|
|
101
|
-
React.createElement(Text, { color: "green" }, "\u2713"),
|
|
102
|
-
" Created ",
|
|
103
|
-
React.createElement(Text, { dimColor: true }, file)))),
|
|
104
|
-
skippedFiles.map(file => (React.createElement(Text, { key: file },
|
|
105
|
-
React.createElement(Text, { color: "yellow" }, "\u25CB"),
|
|
106
|
-
" Skipped ",
|
|
107
|
-
React.createElement(Text, { dimColor: true }, file),
|
|
108
|
-
React.createElement(Text, { dimColor: true }, " (already exists)")))),
|
|
109
|
-
errors.map((error, i) => (React.createElement(Text, { key: i },
|
|
110
|
-
React.createElement(Text, { color: "red" }, "\u2717"),
|
|
111
|
-
" ",
|
|
112
|
-
error))),
|
|
113
|
-
errors.length === 0 && (React.createElement(React.Fragment, null,
|
|
114
|
-
React.createElement(Text, { color: "green" },
|
|
115
|
-
"\n",
|
|
116
|
-
"Ralph initialized successfully!"),
|
|
117
|
-
React.createElement(Text, { bold: true },
|
|
118
|
-
"\n",
|
|
119
|
-
"Next steps:"),
|
|
120
|
-
React.createElement(Text, null,
|
|
121
|
-
React.createElement(Text, { color: "cyan" }, " 1. Edit .ralph/workflow.md"),
|
|
122
|
-
React.createElement(Text, { dimColor: true }, " - Customize build commands for your project")),
|
|
123
|
-
React.createElement(Text, null,
|
|
124
|
-
React.createElement(Text, { color: "cyan" }, " 2. Initialize beads"),
|
|
125
|
-
React.createElement(Text, { dimColor: true }, " - Run `bd init` to set up the issue tracker")),
|
|
126
|
-
React.createElement(Text, null,
|
|
127
|
-
React.createElement(Text, { color: "cyan" }, " 3. Create issues"),
|
|
128
|
-
React.createElement(Text, { dimColor: true }, " - Run `bd create --title=\"...\" --type=task` to add work")),
|
|
129
|
-
React.createElement(Text, null,
|
|
130
|
-
React.createElement(Text, { bold: true },
|
|
131
|
-
"\n",
|
|
132
|
-
"Then run: "),
|
|
133
|
-
React.createElement(Text, { color: "cyan" }, "ralph"),
|
|
134
|
-
"\n")))));
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=InitRalph.js.map
|