@abacus-ai/cli 2.0.0-canary.0 → 2.0.0-canary.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.
Files changed (198) hide show
  1. package/dist/index.mjs +807 -561
  2. package/package.json +4 -1
  3. package/.oxlintrc.json +0 -8
  4. package/resources/abacus.ico +0 -0
  5. package/resources/entitlements.plist +0 -9
  6. package/src/__e2e__/README.md +0 -196
  7. package/src/__e2e__/agent-interactions.e2e.test.tsx +0 -61
  8. package/src/__e2e__/cli-commands.e2e.test.tsx +0 -77
  9. package/src/__e2e__/conversation-throttle.e2e.test.ts +0 -453
  10. package/src/__e2e__/conversation.e2e.test.tsx +0 -56
  11. package/src/__e2e__/diff-preview.e2e.test.tsx +0 -3399
  12. package/src/__e2e__/file-creation.e2e.test.tsx +0 -149
  13. package/src/__e2e__/helpers/test-helpers.ts +0 -450
  14. package/src/__e2e__/keyboard-navigation.e2e.test.tsx +0 -34
  15. package/src/__e2e__/llm-models.e2e.test.ts +0 -402
  16. package/src/__e2e__/mcp/mcp-callback-flow.e2e.test.tsx +0 -71
  17. package/src/__e2e__/mcp/mcp-full-app-ui.e2e.test.tsx +0 -167
  18. package/src/__e2e__/mcp/mcp-ui-rendering.e2e.test.tsx +0 -185
  19. package/src/__e2e__/repl.e2e.test.tsx +0 -78
  20. package/src/__e2e__/shell-compatibility.e2e.test.tsx +0 -76
  21. package/src/__e2e__/theme-mcp.e2e.test.tsx +0 -98
  22. package/src/__e2e__/tool-permissions.e2e.test.tsx +0 -66
  23. package/src/args.ts +0 -22
  24. package/src/components/__tests__/react-compiler.test.tsx +0 -78
  25. package/src/components/__tests__/status-indicator.test.tsx +0 -403
  26. package/src/components/composer/__tests__/bash-runner.test.tsx +0 -263
  27. package/src/components/composer/agent-mode-indicator.tsx +0 -63
  28. package/src/components/composer/bash-runner.tsx +0 -54
  29. package/src/components/composer/commands/default-commands.tsx +0 -615
  30. package/src/components/composer/commands/handler.tsx +0 -59
  31. package/src/components/composer/commands/picker.tsx +0 -273
  32. package/src/components/composer/commands/registry.ts +0 -233
  33. package/src/components/composer/commands/types.ts +0 -33
  34. package/src/components/composer/context.tsx +0 -88
  35. package/src/components/composer/file-mention-picker.tsx +0 -83
  36. package/src/components/composer/help.tsx +0 -44
  37. package/src/components/composer/index.tsx +0 -1006
  38. package/src/components/composer/mentions.ts +0 -57
  39. package/src/components/composer/message-queue.tsx +0 -70
  40. package/src/components/composer/mode-panel.tsx +0 -35
  41. package/src/components/composer/modes/__tests__/bash-handler.test.tsx +0 -755
  42. package/src/components/composer/modes/__tests__/bash-renderer.test.tsx +0 -1108
  43. package/src/components/composer/modes/bash-handler.tsx +0 -132
  44. package/src/components/composer/modes/bash-renderer.tsx +0 -175
  45. package/src/components/composer/modes/default-handlers.tsx +0 -33
  46. package/src/components/composer/modes/index.ts +0 -41
  47. package/src/components/composer/modes/types.ts +0 -21
  48. package/src/components/composer/persistent-shell.ts +0 -283
  49. package/src/components/composer/process.ts +0 -65
  50. package/src/components/composer/types.ts +0 -9
  51. package/src/components/composer/use-mention-search.ts +0 -68
  52. package/src/components/error-boundry.tsx +0 -60
  53. package/src/components/exit-message.tsx +0 -29
  54. package/src/components/expanded-view.tsx +0 -74
  55. package/src/components/file-completion.tsx +0 -127
  56. package/src/components/header.tsx +0 -47
  57. package/src/components/logo.tsx +0 -37
  58. package/src/components/segments.tsx +0 -356
  59. package/src/components/status-indicator.tsx +0 -306
  60. package/src/components/tool-group-summary.tsx +0 -263
  61. package/src/components/tool-permissions/ask-user-question-permission-ui.tsx +0 -312
  62. package/src/components/tool-permissions/diff-preview.tsx +0 -355
  63. package/src/components/tool-permissions/index.ts +0 -5
  64. package/src/components/tool-permissions/permission-options.tsx +0 -375
  65. package/src/components/tool-permissions/permission-preview-header.tsx +0 -57
  66. package/src/components/tool-permissions/tool-permission-ui.tsx +0 -398
  67. package/src/components/tools/agent/ask-user-question.tsx +0 -101
  68. package/src/components/tools/agent/enter-plan-mode.tsx +0 -49
  69. package/src/components/tools/agent/exit-plan-mode.tsx +0 -75
  70. package/src/components/tools/agent/handoff-to-main.tsx +0 -27
  71. package/src/components/tools/agent/subagent.tsx +0 -37
  72. package/src/components/tools/agent/todo-write.tsx +0 -104
  73. package/src/components/tools/browser/close-tab.tsx +0 -58
  74. package/src/components/tools/browser/computer.tsx +0 -70
  75. package/src/components/tools/browser/get-interactive-elements.tsx +0 -54
  76. package/src/components/tools/browser/get-tab-content.tsx +0 -51
  77. package/src/components/tools/browser/navigate-to.tsx +0 -59
  78. package/src/components/tools/browser/new-tab.tsx +0 -60
  79. package/src/components/tools/browser/perform-action.tsx +0 -63
  80. package/src/components/tools/browser/refresh-tab.tsx +0 -43
  81. package/src/components/tools/browser/switch-tab.tsx +0 -58
  82. package/src/components/tools/filesystem/delete-file.tsx +0 -104
  83. package/src/components/tools/filesystem/edit.tsx +0 -220
  84. package/src/components/tools/filesystem/list-dir.tsx +0 -78
  85. package/src/components/tools/filesystem/read-file.tsx +0 -180
  86. package/src/components/tools/filesystem/upload-image.tsx +0 -76
  87. package/src/components/tools/ide/ide-diagnostics.tsx +0 -62
  88. package/src/components/tools/index.ts +0 -91
  89. package/src/components/tools/mcp/mcp-tool.tsx +0 -158
  90. package/src/components/tools/search/fetch-url.tsx +0 -73
  91. package/src/components/tools/search/file-search.tsx +0 -78
  92. package/src/components/tools/search/grep.tsx +0 -90
  93. package/src/components/tools/search/semantic-search.tsx +0 -66
  94. package/src/components/tools/search/web-search.tsx +0 -71
  95. package/src/components/tools/shared/index.tsx +0 -48
  96. package/src/components/tools/shared/zod-coercion.ts +0 -35
  97. package/src/components/tools/terminal/bash-tool-output.tsx +0 -174
  98. package/src/components/tools/terminal/get-terminal-output.tsx +0 -85
  99. package/src/components/tools/terminal/run-in-terminal.tsx +0 -106
  100. package/src/components/tools/types.ts +0 -16
  101. package/src/components/tools.tsx +0 -66
  102. package/src/components/ui/__tests__/divider.test.tsx +0 -61
  103. package/src/components/ui/__tests__/gradient.test.tsx +0 -125
  104. package/src/components/ui/__tests__/input.test.tsx +0 -166
  105. package/src/components/ui/__tests__/select.test.tsx +0 -273
  106. package/src/components/ui/__tests__/shimmer.test.tsx +0 -99
  107. package/src/components/ui/blinking-indicator.tsx +0 -25
  108. package/src/components/ui/divider.tsx +0 -162
  109. package/src/components/ui/gradient.tsx +0 -56
  110. package/src/components/ui/input.tsx +0 -228
  111. package/src/components/ui/select.tsx +0 -151
  112. package/src/components/ui/shimmer.tsx +0 -84
  113. package/src/context/agent-mode.tsx +0 -95
  114. package/src/context/extension-file.tsx +0 -136
  115. package/src/context/network-activity.tsx +0 -45
  116. package/src/context/notification.tsx +0 -62
  117. package/src/context/shell-size.tsx +0 -49
  118. package/src/context/shell-title.tsx +0 -38
  119. package/src/entrypoints/print-mode.ts +0 -312
  120. package/src/entrypoints/repl.tsx +0 -401
  121. package/src/hooks/use-agent.ts +0 -15
  122. package/src/hooks/use-api-client.ts +0 -1
  123. package/src/hooks/use-available-height.ts +0 -8
  124. package/src/hooks/use-cleanup.ts +0 -29
  125. package/src/hooks/use-interrupt-manager.ts +0 -242
  126. package/src/hooks/use-models.ts +0 -22
  127. package/src/index.ts +0 -217
  128. package/src/lib/__tests__/ansi.test.ts +0 -255
  129. package/src/lib/__tests__/cli.test.ts +0 -122
  130. package/src/lib/__tests__/commands.test.ts +0 -325
  131. package/src/lib/__tests__/constants.test.ts +0 -15
  132. package/src/lib/__tests__/focusables.test.ts +0 -25
  133. package/src/lib/__tests__/fs.test.ts +0 -231
  134. package/src/lib/__tests__/markdown.test.tsx +0 -348
  135. package/src/lib/__tests__/mcpCommandHandler.test.ts +0 -173
  136. package/src/lib/__tests__/mcpManagement.test.ts +0 -38
  137. package/src/lib/__tests__/path-paste.test.ts +0 -144
  138. package/src/lib/__tests__/path.test.ts +0 -300
  139. package/src/lib/__tests__/queries.test.ts +0 -39
  140. package/src/lib/__tests__/standaloneMcpService.test.ts +0 -71
  141. package/src/lib/__tests__/text-buffer.test.ts +0 -328
  142. package/src/lib/__tests__/text-utils.test.ts +0 -32
  143. package/src/lib/__tests__/timing.test.ts +0 -78
  144. package/src/lib/__tests__/utils.test.ts +0 -238
  145. package/src/lib/__tests__/vim-buffer-actions.test.ts +0 -154
  146. package/src/lib/ansi.ts +0 -150
  147. package/src/lib/cli-push-server.ts +0 -112
  148. package/src/lib/cli.ts +0 -44
  149. package/src/lib/clipboard.ts +0 -226
  150. package/src/lib/command-utils.ts +0 -93
  151. package/src/lib/commands.ts +0 -270
  152. package/src/lib/constants.ts +0 -3
  153. package/src/lib/extension-connection.ts +0 -181
  154. package/src/lib/focusables.ts +0 -7
  155. package/src/lib/fs.ts +0 -533
  156. package/src/lib/markdown/code-block.tsx +0 -63
  157. package/src/lib/markdown/index.ts +0 -4
  158. package/src/lib/markdown/link.tsx +0 -19
  159. package/src/lib/markdown/markdown.tsx +0 -372
  160. package/src/lib/markdown/types.ts +0 -15
  161. package/src/lib/mcpCommandHandler.ts +0 -121
  162. package/src/lib/mcpManagement.ts +0 -44
  163. package/src/lib/path-paste.ts +0 -185
  164. package/src/lib/path.ts +0 -179
  165. package/src/lib/queries.ts +0 -15
  166. package/src/lib/standaloneMcpService.ts +0 -688
  167. package/src/lib/status-utils.ts +0 -237
  168. package/src/lib/test-utils.tsx +0 -72
  169. package/src/lib/text-buffer.ts +0 -2415
  170. package/src/lib/text-utils.ts +0 -272
  171. package/src/lib/timing.ts +0 -63
  172. package/src/lib/types.ts +0 -295
  173. package/src/lib/utils.ts +0 -182
  174. package/src/lib/vim-buffer-actions.ts +0 -732
  175. package/src/providers/agent.tsx +0 -1075
  176. package/src/providers/api-client.tsx +0 -43
  177. package/src/services/logger.ts +0 -85
  178. package/src/terminal/detection.ts +0 -187
  179. package/src/terminal/exit.ts +0 -279
  180. package/src/terminal/notification.ts +0 -83
  181. package/src/terminal/progress.ts +0 -201
  182. package/src/terminal/setup.ts +0 -797
  183. package/src/terminal/suspend.ts +0 -58
  184. package/src/terminal/types.ts +0 -51
  185. package/src/theme/context.tsx +0 -57
  186. package/src/theme/index.ts +0 -4
  187. package/src/theme/themed.tsx +0 -35
  188. package/src/theme/themes.json +0 -546
  189. package/src/theme/types.ts +0 -110
  190. package/src/tools/types.ts +0 -59
  191. package/src/tools/utils/__tests__/zod-coercion.test.ts +0 -33
  192. package/src/tools/utils/tool-ui-components.tsx +0 -631
  193. package/src/tools/utils/zod-coercion.ts +0 -35
  194. package/tsconfig.json +0 -11
  195. package/tsconfig.node.json +0 -29
  196. package/tsconfig.test.json +0 -27
  197. package/tsdown.config.ts +0 -17
  198. package/vitest.config.ts +0 -76
@@ -1,185 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
-
3
- /**
4
- * UI Rendering Tests - These test that the StatusIndicator component
5
- * correctly renders for different AgentStatus values.
6
- *
7
- * For full app e2e tests with MCP, see agent-interactions.e2e.test.tsx
8
- */
9
- describe.concurrent("MCP UI Rendering Tests", () => {
10
- it("StatusIndicator renders correctly for each status (component test)", async () => {
11
- const { render, cleanup } = await import("../../lib/test-utils.tsx");
12
- const { StatusIndicator } = await import("../../components/status-indicator.tsx");
13
- const { NetworkActivityProvider } = await import("../../context/network-activity.tsx");
14
- const { AgentStatus } = await import("../../providers/agent.tsx");
15
- const React = await import("react");
16
- const stripAnsi = (await import("strip-ansi")).default;
17
-
18
- try {
19
- // Test each status and verify rendering
20
- const testCases = [
21
- { status: AgentStatus.Idle, shouldShow: false },
22
- { status: AgentStatus.Submitted, shouldShow: true },
23
- { status: AgentStatus.Streaming, shouldShow: true },
24
- { status: AgentStatus.ExecutingTool, shouldShow: true },
25
- { status: AgentStatus.WaitingForToolPermission, shouldShow: false },
26
- { status: AgentStatus.LoadingConversation, shouldShow: true },
27
- ];
28
-
29
- console.log("[UI Test] Testing StatusIndicator for each AgentStatus:");
30
-
31
- for (const { status, shouldShow } of testCases) {
32
- const instance = render(
33
- React.createElement(
34
- NetworkActivityProvider,
35
- null,
36
- React.createElement(StatusIndicator, { status }),
37
- ),
38
- );
39
- const frame = instance.lastFrame() ?? "";
40
- const plainFrame = stripAnsi(frame);
41
- const isVisible = plainFrame.includes("...");
42
-
43
- console.log(
44
- ` - ${status}: ${isVisible ? "VISIBLE" : "hidden"} (expected: ${shouldShow ? "VISIBLE" : "hidden"})`,
45
- );
46
-
47
- if (shouldShow) {
48
- expect(plainFrame).toContain("...");
49
- } else {
50
- expect(plainFrame.trim()).toBe("");
51
- }
52
-
53
- cleanup();
54
- }
55
-
56
- console.log("[UI Test] All status renderings verified ✓");
57
- } finally {
58
- cleanup();
59
- }
60
- });
61
-
62
- it("StatusIndicator transitions correctly (simulating MCP tool execution)", async () => {
63
- const { render, cleanup } = await import("../../lib/test-utils.tsx");
64
- const { StatusIndicator } = await import("../../components/status-indicator.tsx");
65
- const { NetworkActivityProvider } = await import("../../context/network-activity.tsx");
66
- const { AgentStatus } = await import("../../providers/agent.tsx");
67
- const React = await import("react");
68
- const stripAnsi = (await import("strip-ansi")).default;
69
-
70
- try {
71
- // Simulate the status flow during MCP tool execution
72
- const statusFlow = [
73
- { status: AgentStatus.Idle, name: "Idle", shouldBeVisible: false },
74
- { status: AgentStatus.Submitted, name: "Submitted", shouldBeVisible: true },
75
- { status: AgentStatus.Streaming, name: "Streaming", shouldBeVisible: true },
76
- { status: AgentStatus.ExecutingTool, name: "ExecutingTool", shouldBeVisible: true },
77
- { status: AgentStatus.Streaming, name: "Streaming (after tool)", shouldBeVisible: true },
78
- { status: AgentStatus.Idle, name: "Idle (final)", shouldBeVisible: false },
79
- ];
80
-
81
- console.log("[UI Test] Simulating MCP tool execution status flow:");
82
- const instance = render(
83
- React.createElement(
84
- NetworkActivityProvider,
85
- null,
86
- React.createElement(StatusIndicator, { status: AgentStatus.Idle }),
87
- ),
88
- );
89
-
90
- const results: { name: string; visible: boolean; expected: boolean }[] = [];
91
-
92
- for (const { status, name, shouldBeVisible } of statusFlow) {
93
- instance.rerender(
94
- React.createElement(
95
- NetworkActivityProvider,
96
- null,
97
- React.createElement(StatusIndicator, { status }),
98
- ),
99
- );
100
- const frame = instance.lastFrame() ?? "";
101
- const plainFrame = stripAnsi(frame);
102
- const isVisible = plainFrame.includes("...");
103
-
104
- results.push({
105
- name,
106
- visible: isVisible,
107
- expected: shouldBeVisible,
108
- });
109
-
110
- const icon = isVisible === shouldBeVisible ? "✓" : "✗";
111
- console.log(
112
- ` ${icon} ${name}: ${isVisible ? "visible" : "hidden"} (expected: ${shouldBeVisible ? "visible" : "hidden"})`,
113
- );
114
- }
115
-
116
- // Verify key states
117
- const executingToolResult = results.find((r) => r.name === "ExecutingTool");
118
- expect(executingToolResult?.visible).toBe(true);
119
-
120
- const idleResults = results.filter((r) => r.name.startsWith("Idle"));
121
- for (const idle of idleResults) {
122
- expect(idle.visible).toBe(false);
123
- }
124
-
125
- // Verify all results match expectations
126
- for (const result of results) {
127
- expect(result.visible).toBe(result.expected);
128
- }
129
-
130
- console.log("[UI Test] MCP tool execution flow verified ✓");
131
- console.log("[UI Test] Key insight: ExecutingTool status is VISIBLE to user");
132
- } finally {
133
- cleanup();
134
- }
135
- });
136
-
137
- it("StatusIndicator responds instantly to status changes (no delay)", async () => {
138
- const { render, cleanup } = await import("../../lib/test-utils.tsx");
139
- const { StatusIndicator } = await import("../../components/status-indicator.tsx");
140
- const { AgentStatus } = await import("../../providers/agent.tsx");
141
- const React = await import("react");
142
- const stripAnsi = (await import("strip-ansi")).default;
143
-
144
- try {
145
- const instance = render(React.createElement(StatusIndicator, { status: AgentStatus.Idle }));
146
-
147
- // Rapidly change status 10 times and measure total time
148
- const statuses = [
149
- AgentStatus.Submitted,
150
- AgentStatus.Streaming,
151
- AgentStatus.ExecutingTool,
152
- AgentStatus.Streaming,
153
- AgentStatus.ExecutingTool,
154
- AgentStatus.Streaming,
155
- AgentStatus.ExecutingTool,
156
- AgentStatus.Streaming,
157
- AgentStatus.Idle,
158
- AgentStatus.Submitted,
159
- ];
160
-
161
- const startTime = Date.now();
162
- const frameResults: boolean[] = [];
163
-
164
- for (const status of statuses) {
165
- instance.rerender(React.createElement(StatusIndicator, { status }));
166
- const frame = instance.lastFrame() ?? "";
167
- frameResults.push(stripAnsi(frame).includes("..."));
168
- }
169
-
170
- const totalTime = Date.now() - startTime;
171
-
172
- console.log(`[UI Test] 10 rapid status changes completed in ${totalTime}ms`);
173
- console.log(`[UI Test] Frames captured: ${frameResults.length}`);
174
- console.log(`[UI Test] Visible frames: ${frameResults.filter((f) => f).length}`);
175
-
176
- // All 10 changes should complete in under 100ms (instant rendering)
177
- expect(totalTime).toBeLessThan(100);
178
- expect(frameResults.length).toBe(10);
179
-
180
- console.log("[UI Test] Instant rendering verified - no delay between status changes ✓");
181
- } finally {
182
- cleanup();
183
- }
184
- });
185
- });
@@ -1,78 +0,0 @@
1
- import React from "react";
2
- import { describe, it, expect } from "vitest";
3
-
4
- import { App } from "../entrypoints/repl.js";
5
- import { Timing } from "../lib/timing.js";
6
- import {
7
- renderWithProviders,
8
- simulateText,
9
- waitForFrame,
10
- simulateCtrlC,
11
- } from "./helpers/test-helpers.js";
12
-
13
- describe.concurrent("REPL E2E Tests", () => {
14
- it("should render REPL component", async () => {
15
- const timing = new Timing();
16
-
17
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
18
-
19
- await waitForFrame(
20
- lastFrame,
21
- (frame) => {
22
- return frame.length > 0;
23
- },
24
- 3000,
25
- );
26
-
27
- const frame = lastFrame();
28
- expect(frame).toBeDefined();
29
-
30
- unmount();
31
- });
32
-
33
- it("should handle user input and show composer", async () => {
34
- const timing = new Timing();
35
-
36
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
37
-
38
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
39
-
40
- simulateText(stdin, "Hello");
41
-
42
- const frame = lastFrame();
43
- expect(frame).toBeDefined();
44
-
45
- unmount();
46
- });
47
-
48
- it("should handle Ctrl+C gracefully", async () => {
49
- const timing = new Timing();
50
-
51
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
52
-
53
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
54
-
55
- simulateCtrlC(stdin);
56
-
57
- const frame = lastFrame();
58
- expect(frame).toBeDefined();
59
-
60
- unmount();
61
- });
62
-
63
- it("should handle double Ctrl+C for exit", async () => {
64
- const timing = new Timing();
65
-
66
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
67
-
68
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
69
-
70
- simulateCtrlC(stdin);
71
- simulateCtrlC(stdin);
72
-
73
- const frame = lastFrame();
74
- expect(frame).toBeDefined();
75
-
76
- unmount();
77
- });
78
- });
@@ -1,76 +0,0 @@
1
- import React from "react";
2
- import { describe, it, expect } from "vitest";
3
-
4
- import { App } from "../entrypoints/repl.js";
5
- import { Timing } from "../lib/timing.js";
6
- import { renderWithProviders, waitForFrame } from "./helpers/test-helpers.js";
7
-
8
- describe.sequential("CLI Shell Compatibility E2E Tests", () => {
9
- it("should start in bash shell environment", async () => {
10
- const originalShell = process.env.SHELL;
11
- process.env.SHELL = "/bin/bash";
12
-
13
- const timing = new Timing();
14
-
15
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
16
-
17
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
18
-
19
- const frame = lastFrame();
20
- expect(frame.length).toBeGreaterThan(0);
21
-
22
- unmount();
23
- process.env.SHELL = originalShell;
24
- });
25
-
26
- it("should start in zsh shell environment", async () => {
27
- const originalShell = process.env.SHELL;
28
- process.env.SHELL = "/bin/zsh";
29
-
30
- const timing = new Timing();
31
-
32
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
33
-
34
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
35
-
36
- const frame = lastFrame();
37
- expect(frame.length).toBeGreaterThan(0);
38
-
39
- unmount();
40
- process.env.SHELL = originalShell;
41
- });
42
-
43
- it("should start in fish shell environment", async () => {
44
- const originalShell = process.env.SHELL;
45
- process.env.SHELL = "/usr/local/bin/fish";
46
-
47
- const timing = new Timing();
48
-
49
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
50
-
51
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
52
-
53
- const frame = lastFrame();
54
- expect(frame.length).toBeGreaterThan(0);
55
-
56
- unmount();
57
- process.env.SHELL = originalShell;
58
- });
59
-
60
- it("should start without shell environment variable", async () => {
61
- const originalShell = process.env.SHELL;
62
- delete process.env.SHELL;
63
-
64
- const timing = new Timing();
65
-
66
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
67
-
68
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
69
-
70
- const frame = lastFrame();
71
- expect(frame.length).toBeGreaterThan(0);
72
-
73
- unmount();
74
- process.env.SHELL = originalShell;
75
- });
76
- });
@@ -1,98 +0,0 @@
1
- import React from "react";
2
- import { describe, it, expect } from "vitest";
3
-
4
- import { App } from "../entrypoints/repl.js";
5
- import { Timing } from "../lib/timing.js";
6
- import {
7
- renderWithProviders,
8
- simulateText,
9
- simulateEnter,
10
- simulateDownArrow,
11
- waitForFrame,
12
- } from "./helpers/test-helpers.js";
13
-
14
- describe.concurrent("Theme and MCP Menu E2E Tests", () => {
15
- it("/theme - should display all theme options", async () => {
16
- const timing = new Timing();
17
-
18
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
19
-
20
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 8000);
21
-
22
- simulateText(stdin, "/theme");
23
-
24
- const frame = lastFrame();
25
- expect(frame.length).toBeGreaterThan(0);
26
-
27
- unmount();
28
- }, 20000);
29
-
30
- it("/mcp - should display all MCP menu options", async () => {
31
- const timing = new Timing();
32
-
33
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
34
-
35
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
36
-
37
- simulateText(stdin, "/mcp");
38
-
39
- const frame = lastFrame();
40
- expect(frame.length).toBeGreaterThan(0);
41
-
42
- unmount();
43
- });
44
-
45
- it("/theme - should handle theme selection", async () => {
46
- const timing = new Timing();
47
-
48
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
49
-
50
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
51
-
52
- simulateText(stdin, "/theme dark");
53
- simulateEnter(stdin);
54
-
55
- const frame = lastFrame();
56
- expect(frame.length).toBeGreaterThan(0);
57
-
58
- unmount();
59
- });
60
-
61
- it("/mcp - should handle MCP server configuration", async () => {
62
- const timing = new Timing();
63
-
64
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
65
-
66
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
67
-
68
- simulateText(stdin, "/mcp list");
69
- simulateEnter(stdin);
70
-
71
- const frame = lastFrame();
72
- expect(frame.length).toBeGreaterThan(0);
73
-
74
- unmount();
75
- });
76
-
77
- it("/theme - should select Dracula theme and verify it is applied", async () => {
78
- const timing = new Timing();
79
-
80
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
81
-
82
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 8000);
83
-
84
- simulateText(stdin, "/theme");
85
-
86
- const frameBeforeSelect = lastFrame();
87
- expect(frameBeforeSelect.length).toBeGreaterThan(0);
88
-
89
- simulateDownArrow(stdin);
90
-
91
- simulateEnter(stdin);
92
-
93
- const frameAfter = lastFrame();
94
- expect(frameAfter.length).toBeGreaterThan(0);
95
-
96
- unmount();
97
- }, 25000);
98
- });
@@ -1,66 +0,0 @@
1
- import React from "react";
2
- import { describe, it, expect } from "vitest";
3
-
4
- import { App } from "../entrypoints/repl.js";
5
- import { Timing } from "../lib/timing.js";
6
- import { renderWithProviders, simulateKeypress, waitForFrame } from "./helpers/test-helpers.js";
7
-
8
- describe.concurrent("Tool Permissions E2E Tests", () => {
9
- it("should render component with tool permission capability", async () => {
10
- const timing = new Timing();
11
-
12
- const { lastFrame, unmount } = renderWithProviders(React.createElement(App, { timing }));
13
-
14
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
15
-
16
- const frame = lastFrame();
17
- expect(frame).toBeDefined();
18
-
19
- unmount();
20
- });
21
-
22
- it("should handle keyboard navigation in tool permissions", async () => {
23
- const timing = new Timing();
24
-
25
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
26
-
27
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
28
-
29
- simulateKeypress(stdin, "y");
30
-
31
- const frame = lastFrame();
32
- expect(frame).toBeDefined();
33
-
34
- unmount();
35
- });
36
-
37
- it("should handle permission rejection", async () => {
38
- const timing = new Timing();
39
-
40
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
41
-
42
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
43
-
44
- simulateKeypress(stdin, "n");
45
-
46
- const frame = lastFrame();
47
- expect(frame).toBeDefined();
48
-
49
- unmount();
50
- });
51
-
52
- it("should handle always allow option", async () => {
53
- const timing = new Timing();
54
-
55
- const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
56
-
57
- await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
58
-
59
- simulateKeypress(stdin, "a");
60
-
61
- const frame = lastFrame();
62
- expect(frame).toBeDefined();
63
-
64
- unmount();
65
- });
66
- });
package/src/args.ts DELETED
@@ -1,22 +0,0 @@
1
- export interface AgentArgs {
2
- help?: boolean;
3
- version?: boolean;
4
- model?: string;
5
- print?: boolean;
6
- /** Resume a specific conversation by ID. */
7
- resume?: string;
8
- /** Continue the most recently updated conversation. */
9
- continue?: boolean;
10
- "output-format"?: string;
11
- "input-format"?: string;
12
- "allow-editing"?: string;
13
- "auto-accept-edits"?: boolean;
14
- "dangerously-skip-permissions"?: boolean;
15
- "plan-mode"?: boolean;
16
- prompt?: string | null;
17
- /**
18
- * Resolved startup conversation ID — set by index.ts after processing
19
- * --resume / --continue. Consumers read this; they don't produce it.
20
- */
21
- conversationId?: string;
22
- }
@@ -1,78 +0,0 @@
1
- import { Text } from "@codellm/jar";
2
- // TODO: Replace with jar-testing-library when available
3
- // import { render } from 'ink-testing-library';
4
- import { readFile } from "node:fs/promises";
5
- import { dirname, join } from "node:path";
6
- import { fileURLToPath } from "node:url";
7
- import { describe, expect, it } from "vitest";
8
- const __dirname = dirname(fileURLToPath(import.meta.url));
9
-
10
- // Used in commented-out test below — will be re-enabled with jar-testing-library
11
- function ExpensiveComponent({ value }: { value: number }) {
12
- const expensiveResult = value * value * value;
13
- return (
14
- <Text>
15
- Value: {value}, Result: {expensiveResult}
16
- </Text>
17
- );
18
- }
19
- void ExpensiveComponent;
20
-
21
- describe.concurrent("React Compiler Verification", () => {
22
- // TODO: Replace with jar-testing-library when available
23
- // it('should verify compiled code uses memoization (behavioral test)', () => {
24
- // // This test verifies that the component works correctly with memoization.
25
- // // React-compiler automatically memoizes computations based on dependencies.
26
- // // With the same props, the compiler ensures the computation result is reused.
27
- // const { lastFrame, rerender } = render(<ExpensiveComponent value={2} />);
28
- // let output = lastFrame() || '';
29
- //
30
- // expect(output).toContain('Value:2');
31
- // expect(output).toContain('Result: 8'); // 2^3
32
- //
33
- // // Re-render with same value - react-compiler should reuse the memoized result
34
- // rerender(<ExpensiveComponent value={2} />);
35
- // output = lastFrame() || '';
36
- // expect(output).toContain('Value:2');
37
- // expect(output).toContain('Result: 8');
38
- //
39
- // // Change value - computation should produce new result
40
- // rerender(<ExpensiveComponent value={3} />);
41
- // output = lastFrame() || '';
42
- // expect(output).toContain('Value:3');
43
- // expect(output).toContain('Result: 27'); // 3^3
44
- // });
45
-
46
- it("should verify build output contains react-compiler runtime", async () => {
47
- // This test checks the actual built output to verify compilation happened
48
- const buildOutputPath = join(__dirname, "../../../dist/index.mjs");
49
-
50
- let buildOutput = "";
51
- try {
52
- buildOutput = await readFile(buildOutputPath, "utf-8");
53
-
54
- // Check for useMemoCache - this is injected by react-compiler
55
- const hasUseMemoCache = buildOutput.includes("useMemoCache");
56
-
57
- // Check for react-compiler-runtime import/usage
58
- const hasRuntime =
59
- buildOutput.includes("react-compiler-runtime") ||
60
- buildOutput.includes("react/compiler-runtime");
61
-
62
- // At least one of these should be present if compilation happened
63
- expect(hasUseMemoCache || hasRuntime).toBe(true);
64
-
65
- if (hasUseMemoCache) {
66
- const count = (buildOutput.match(/useMemoCache/g) || []).length;
67
- expect(count).toBeGreaterThan(0);
68
- }
69
- } catch {
70
- // If build output doesn't exist, skip this test but warn
71
- console.warn(
72
- 'Build output not found. Run "npm run build.tsdown" first to verify compilation.',
73
- );
74
- // Don't fail the test, just skip the verification
75
- expect(true).toBe(true);
76
- }
77
- });
78
- });