@abacus-ai/cli 1.106.25008 → 2.0.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/.oxlintrc.json +8 -0
  2. package/dist/index.mjs +12823 -0
  3. package/package.json +7 -39
  4. package/resources/abacus.ico +0 -0
  5. package/resources/entitlements.plist +9 -0
  6. package/src/__e2e__/README.md +196 -0
  7. package/src/__e2e__/agent-interactions.e2e.test.tsx +61 -0
  8. package/src/__e2e__/cli-commands.e2e.test.tsx +77 -0
  9. package/src/__e2e__/conversation-throttle.e2e.test.ts +453 -0
  10. package/src/__e2e__/conversation.e2e.test.tsx +56 -0
  11. package/src/__e2e__/diff-preview.e2e.test.tsx +3399 -0
  12. package/src/__e2e__/file-creation.e2e.test.tsx +149 -0
  13. package/src/__e2e__/helpers/test-helpers.ts +449 -0
  14. package/src/__e2e__/keyboard-navigation.e2e.test.tsx +34 -0
  15. package/src/__e2e__/llm-models.e2e.test.ts +402 -0
  16. package/src/__e2e__/mcp/mcp-callback-flow.e2e.test.tsx +71 -0
  17. package/src/__e2e__/mcp/mcp-full-app-ui.e2e.test.tsx +167 -0
  18. package/src/__e2e__/mcp/mcp-ui-rendering.e2e.test.tsx +185 -0
  19. package/src/__e2e__/repl.e2e.test.tsx +78 -0
  20. package/src/__e2e__/shell-compatibility.e2e.test.tsx +76 -0
  21. package/src/__e2e__/theme-mcp.e2e.test.tsx +98 -0
  22. package/src/__e2e__/tool-permissions.e2e.test.tsx +66 -0
  23. package/src/args.ts +22 -0
  24. package/src/components/__tests__/react-compiler.test.tsx +78 -0
  25. package/src/components/__tests__/status-indicator.test.tsx +403 -0
  26. package/src/components/composer/__tests__/bash-runner.test.tsx +263 -0
  27. package/src/components/composer/agent-mode-indicator.tsx +63 -0
  28. package/src/components/composer/bash-runner.tsx +54 -0
  29. package/src/components/composer/commands/default-commands.tsx +615 -0
  30. package/src/components/composer/commands/handler.tsx +59 -0
  31. package/src/components/composer/commands/picker.tsx +273 -0
  32. package/src/components/composer/commands/registry.ts +233 -0
  33. package/src/components/composer/commands/types.ts +33 -0
  34. package/src/components/composer/context.tsx +88 -0
  35. package/src/components/composer/file-mention-picker.tsx +83 -0
  36. package/src/components/composer/help.tsx +44 -0
  37. package/src/components/composer/index.tsx +1007 -0
  38. package/src/components/composer/mentions.ts +57 -0
  39. package/src/components/composer/message-queue.tsx +70 -0
  40. package/src/components/composer/mode-panel.tsx +35 -0
  41. package/src/components/composer/modes/__tests__/bash-handler.test.tsx +755 -0
  42. package/src/components/composer/modes/__tests__/bash-renderer.test.tsx +1108 -0
  43. package/src/components/composer/modes/bash-handler.tsx +132 -0
  44. package/src/components/composer/modes/bash-renderer.tsx +175 -0
  45. package/src/components/composer/modes/default-handlers.tsx +33 -0
  46. package/src/components/composer/modes/index.ts +41 -0
  47. package/src/components/composer/modes/types.ts +21 -0
  48. package/src/components/composer/persistent-shell.ts +283 -0
  49. package/src/components/composer/process.ts +65 -0
  50. package/src/components/composer/types.ts +9 -0
  51. package/src/components/composer/use-mention-search.ts +68 -0
  52. package/src/components/error-boundry.tsx +60 -0
  53. package/src/components/exit-message.tsx +29 -0
  54. package/src/components/expanded-view.tsx +74 -0
  55. package/src/components/file-completion.tsx +127 -0
  56. package/src/components/header.tsx +47 -0
  57. package/src/components/logo.tsx +37 -0
  58. package/src/components/segments.tsx +356 -0
  59. package/src/components/status-indicator.tsx +306 -0
  60. package/src/components/tool-group-summary.tsx +263 -0
  61. package/src/components/tool-permissions/ask-user-question-permission-ui.tsx +319 -0
  62. package/src/components/tool-permissions/diff-preview.tsx +359 -0
  63. package/src/components/tool-permissions/index.ts +5 -0
  64. package/src/components/tool-permissions/permission-options.tsx +401 -0
  65. package/src/components/tool-permissions/permission-preview-header.tsx +57 -0
  66. package/src/components/tool-permissions/tool-permission-ui.tsx +420 -0
  67. package/src/components/tools/agent/ask-user-question.tsx +107 -0
  68. package/src/components/tools/agent/enter-plan-mode.tsx +55 -0
  69. package/src/components/tools/agent/exit-plan-mode.tsx +83 -0
  70. package/src/components/tools/agent/handoff-to-main.tsx +27 -0
  71. package/src/components/tools/agent/subagent.tsx +37 -0
  72. package/src/components/tools/agent/todo-write.tsx +104 -0
  73. package/src/components/tools/browser/close-tab.tsx +58 -0
  74. package/src/components/tools/browser/computer.tsx +70 -0
  75. package/src/components/tools/browser/get-interactive-elements.tsx +54 -0
  76. package/src/components/tools/browser/get-tab-content.tsx +51 -0
  77. package/src/components/tools/browser/navigate-to.tsx +59 -0
  78. package/src/components/tools/browser/new-tab.tsx +60 -0
  79. package/src/components/tools/browser/perform-action.tsx +63 -0
  80. package/src/components/tools/browser/refresh-tab.tsx +43 -0
  81. package/src/components/tools/browser/switch-tab.tsx +58 -0
  82. package/src/components/tools/filesystem/delete-file.tsx +104 -0
  83. package/src/components/tools/filesystem/edit.tsx +220 -0
  84. package/src/components/tools/filesystem/list-dir.tsx +78 -0
  85. package/src/components/tools/filesystem/read-file.tsx +180 -0
  86. package/src/components/tools/filesystem/upload-image.tsx +76 -0
  87. package/src/components/tools/ide/ide-diagnostics.tsx +62 -0
  88. package/src/components/tools/index.ts +91 -0
  89. package/src/components/tools/mcp/mcp-tool.tsx +158 -0
  90. package/src/components/tools/search/fetch-url.tsx +73 -0
  91. package/src/components/tools/search/file-search.tsx +78 -0
  92. package/src/components/tools/search/grep.tsx +90 -0
  93. package/src/components/tools/search/semantic-search.tsx +66 -0
  94. package/src/components/tools/search/web-search.tsx +71 -0
  95. package/src/components/tools/shared/index.tsx +48 -0
  96. package/src/components/tools/shared/zod-coercion.ts +35 -0
  97. package/src/components/tools/terminal/bash-tool-output.tsx +188 -0
  98. package/src/components/tools/terminal/get-terminal-output.tsx +91 -0
  99. package/src/components/tools/terminal/run-in-terminal.tsx +131 -0
  100. package/src/components/tools/types.ts +16 -0
  101. package/src/components/tools.tsx +68 -0
  102. package/src/components/ui/__tests__/divider.test.tsx +61 -0
  103. package/src/components/ui/__tests__/gradient.test.tsx +125 -0
  104. package/src/components/ui/__tests__/input.test.tsx +166 -0
  105. package/src/components/ui/__tests__/select.test.tsx +273 -0
  106. package/src/components/ui/__tests__/shimmer.test.tsx +99 -0
  107. package/src/components/ui/blinking-indicator.tsx +27 -0
  108. package/src/components/ui/divider.tsx +162 -0
  109. package/src/components/ui/gradient.tsx +56 -0
  110. package/src/components/ui/input.tsx +228 -0
  111. package/src/components/ui/select.tsx +151 -0
  112. package/src/components/ui/shimmer.tsx +76 -0
  113. package/src/context/agent-mode.tsx +95 -0
  114. package/src/context/extension-file.tsx +136 -0
  115. package/src/context/network-activity.tsx +45 -0
  116. package/src/context/notification.tsx +62 -0
  117. package/src/context/shell-size.tsx +49 -0
  118. package/src/context/shell-title.tsx +38 -0
  119. package/src/entrypoints/print-mode.ts +312 -0
  120. package/src/entrypoints/repl.tsx +389 -0
  121. package/src/hooks/use-agent.ts +15 -0
  122. package/src/hooks/use-api-client.ts +1 -0
  123. package/src/hooks/use-available-height.ts +8 -0
  124. package/src/hooks/use-cleanup.ts +29 -0
  125. package/src/hooks/use-interrupt-manager.ts +242 -0
  126. package/src/hooks/use-models.ts +22 -0
  127. package/src/index.ts +217 -0
  128. package/src/lib/__tests__/ansi.test.ts +255 -0
  129. package/src/lib/__tests__/cli.test.ts +122 -0
  130. package/src/lib/__tests__/commands.test.ts +325 -0
  131. package/src/lib/__tests__/constants.test.ts +15 -0
  132. package/src/lib/__tests__/focusables.test.ts +25 -0
  133. package/src/lib/__tests__/fs.test.ts +231 -0
  134. package/src/lib/__tests__/markdown.test.tsx +348 -0
  135. package/src/lib/__tests__/mcpCommandHandler.test.ts +173 -0
  136. package/src/lib/__tests__/mcpManagement.test.ts +38 -0
  137. package/src/lib/__tests__/path-paste.test.ts +144 -0
  138. package/src/lib/__tests__/path.test.ts +300 -0
  139. package/src/lib/__tests__/queries.test.ts +39 -0
  140. package/src/lib/__tests__/standaloneMcpService.test.ts +71 -0
  141. package/src/lib/__tests__/text-buffer.test.ts +328 -0
  142. package/src/lib/__tests__/text-utils.test.ts +32 -0
  143. package/src/lib/__tests__/timing.test.ts +78 -0
  144. package/src/lib/__tests__/utils.test.ts +238 -0
  145. package/src/lib/__tests__/vim-buffer-actions.test.ts +154 -0
  146. package/src/lib/ansi.ts +150 -0
  147. package/src/lib/cli-push-server.ts +112 -0
  148. package/src/lib/cli.ts +44 -0
  149. package/src/lib/clipboard.ts +226 -0
  150. package/src/lib/command-utils.ts +93 -0
  151. package/src/lib/commands.ts +270 -0
  152. package/src/lib/constants.ts +3 -0
  153. package/src/lib/extension-connection.ts +181 -0
  154. package/src/lib/focusables.ts +7 -0
  155. package/src/lib/fs.ts +533 -0
  156. package/src/lib/markdown/code-block.tsx +63 -0
  157. package/src/lib/markdown/index.ts +4 -0
  158. package/src/lib/markdown/link.tsx +19 -0
  159. package/src/lib/markdown/markdown.tsx +372 -0
  160. package/src/lib/markdown/types.ts +15 -0
  161. package/src/lib/mcpCommandHandler.ts +121 -0
  162. package/src/lib/mcpManagement.ts +44 -0
  163. package/src/lib/path-paste.ts +185 -0
  164. package/src/lib/path.ts +179 -0
  165. package/src/lib/queries.ts +15 -0
  166. package/src/lib/standaloneMcpService.ts +688 -0
  167. package/src/lib/status-utils.ts +237 -0
  168. package/src/lib/test-utils.tsx +72 -0
  169. package/src/lib/text-buffer.ts +2415 -0
  170. package/src/lib/text-utils.ts +272 -0
  171. package/src/lib/timing.ts +63 -0
  172. package/src/lib/types.ts +295 -0
  173. package/src/lib/utils.ts +182 -0
  174. package/src/lib/vim-buffer-actions.ts +732 -0
  175. package/src/providers/agent.tsx +1063 -0
  176. package/src/providers/api-client.tsx +43 -0
  177. package/src/services/logger.ts +85 -0
  178. package/src/terminal/detection.ts +187 -0
  179. package/src/terminal/exit.ts +279 -0
  180. package/src/terminal/notification.ts +83 -0
  181. package/src/terminal/progress.ts +201 -0
  182. package/src/terminal/setup.ts +797 -0
  183. package/src/terminal/types.ts +51 -0
  184. package/src/theme/context.tsx +57 -0
  185. package/src/theme/index.ts +4 -0
  186. package/src/theme/themed.tsx +35 -0
  187. package/src/theme/themes.json +546 -0
  188. package/src/theme/types.ts +110 -0
  189. package/src/tools/types.ts +59 -0
  190. package/src/tools/utils/__tests__/zod-coercion.test.ts +33 -0
  191. package/src/tools/utils/tool-ui-components.tsx +649 -0
  192. package/src/tools/utils/zod-coercion.ts +35 -0
  193. package/tsconfig.json +16 -0
  194. package/tsconfig.node.json +29 -0
  195. package/tsconfig.test.json +27 -0
  196. package/tsdown.config.ts +17 -0
  197. package/vitest.config.ts +76 -0
  198. package/README.md +0 -28
  199. package/dist/index.js +0 -26
package/package.json CHANGED
@@ -1,47 +1,15 @@
1
1
  {
2
2
  "name": "@abacus-ai/cli",
3
- "appName": "AbacusAI",
4
- "binName": "abacusai",
5
- "version": "1.106.25008",
6
- "nodeVersion": "22.19.0",
7
- "distro": "fb9b4b01c06699c1a80f26ca9de940a9aebb29e0",
8
- "author": {
9
- "name": "Abacus AI"
10
- },
11
- "license": "Proprietary",
12
- "main": "./dist/index.js",
13
- "module": "./dist/index.js",
14
- "source": "./src/index.ts",
3
+ "version": "2.0.0-canary.1",
15
4
  "type": "module",
16
- "homepage": "https://desktop.abacus.ai/",
17
- "files": [
18
- "dist"
19
- ],
20
- "bugs": {
21
- "url": "mailto:support@abacus.ai"
22
- },
23
5
  "bin": {
24
- "abacusai": "./dist/index.js"
25
- },
26
- "scripts": {
27
- "build": "tsc && bun build ./src/index.ts --minify --target=node --outdir=dist"
6
+ "abacusai": "dist/index.mjs"
28
7
  },
29
- "devDependencies": {
30
- "@inquirer/prompts": "^7.9.0",
31
- "@tsconfig/strictest": "^2.0.7",
32
- "@types/color-name": "^2.0.0",
33
- "@types/glob": "^9.0.0",
34
- "@types/minimatch": "^6.0.0",
35
- "@types/node": "^24.9.2",
36
- "@types/semver": "^7.7.1",
37
- "extract-zip": "^2.0.1",
38
- "node-downloader-helper": "^2.1.9",
39
- "semver": "^7.7.3",
40
- "simple-update-notifier": "^2.0.0",
41
- "tar": "^7.5.2",
42
- "typescript": "^6.0.0-dev.20251031"
8
+ "engines": {
9
+ "node": ">=18"
43
10
  },
44
- "overrides": {
45
- "yauzl": "3.2.0"
11
+ "dependencies": {
12
+ "koffi": "^2.15.1",
13
+ "@vscode/ripgrep": "^1.17.0"
46
14
  }
47
15
  }
Binary file
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <!-- Required for Bun's JIT compilation in standalone executables -->
6
+ <key>com.apple.security.cs.allow-jit</key>
7
+ <true/>
8
+ </dict>
9
+ </plist>
@@ -0,0 +1,196 @@
1
+ # E2E Tests for TUI
2
+
3
+ This directory contains end-to-end tests for the TUI (Terminal User Interface) using `ink-testing-library`.
4
+
5
+ ## Test Structure
6
+
7
+ ```
8
+ src/__e2e__/
9
+ ├── helpers/
10
+ │ └── test-helpers.ts # Shared test utilities and helpers
11
+ ├── repl.e2e.test.tsx # E2E tests for REPL functionality
12
+ ├── conversation.e2e.test.tsx # E2E tests for conversation flows
13
+ ├── tool-permissions.e2e.test.tsx # E2E tests for tool permissions
14
+ ├── cli-commands.e2e.test.tsx # E2E tests for CLI commands (/help, /status, etc.)
15
+ ├── agent-interactions.e2e.test.tsx # E2E tests for agent interactions (send, stop, model)
16
+ ├── keyboard-navigation.e2e.test.tsx # E2E tests for keyboard navigation (ESC, arrows)
17
+ ├── theme-mcp.e2e.test.tsx # E2E tests for theme and MCP menus
18
+ └── shell-compatibility.e2e.test.tsx # E2E tests for shell compatibility (bash, zsh, fish)
19
+ ```
20
+
21
+ ## Running Tests
22
+
23
+ The tests need you to set the `ABACUS_API_KEY` and/or `ABACUS_THROTTLED_API_KEY` environment variables. You can get these from the [Abacus AI CLI dashboard](https://abacus.ai/app/abacusai-cli).
24
+
25
+ ### Run all tests (unit + e2e)
26
+
27
+ ```bash
28
+ npm run test
29
+ ```
30
+
31
+ ### Run only e2e tests
32
+
33
+ ```bash
34
+ npm run test:e2e
35
+ ```
36
+
37
+ ### Run only unit tests
38
+
39
+ ```bash
40
+ npm run test:unit
41
+ ```
42
+
43
+ ### Watch mode for e2e tests
44
+
45
+ ```bash
46
+ npm run test:e2e:watch
47
+ ```
48
+
49
+ ### Run with UI
50
+
51
+ ```bash
52
+ npm run test:ui
53
+ ```
54
+
55
+ ### Run with coverage
56
+
57
+ ```bash
58
+ npm run test:coverage
59
+ ```
60
+
61
+ ## Writing E2E Tests
62
+
63
+ E2E tests use `ink-testing-library` to render the full TUI application and simulate user interactions.
64
+
65
+ ### Example Test
66
+
67
+ ```typescript
68
+ import { renderE2E, simulateText, simulateEnter, waitForFrame } from "./helpers/test-helpers.js";
69
+ import React from "react";
70
+ import { sleep } from "../lib/utils.js";
71
+
72
+ it("should handle user input", async () => {
73
+ const { App } = await import("../entrypoints/repl.js");
74
+ const config = {
75
+ cwd: process.cwd(),
76
+ isIndependentMode: false,
77
+ };
78
+
79
+ const { lastFrame, stdin, unmount } = renderE2E(React.createElement(App, { config } as any));
80
+
81
+ // Wait for the app to render
82
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 3000);
83
+
84
+ // Simulate user typing
85
+ simulateText(stdin, "Hello");
86
+ simulateEnter(stdin);
87
+
88
+ // Wait for response
89
+ await sleep(500);
90
+
91
+ // Assert
92
+ const frame = lastFrame();
93
+ expect(frame).toContain("Hello");
94
+
95
+ unmount();
96
+ });
97
+ ```
98
+
99
+ ## Helper Functions
100
+
101
+ ### `renderE2E(component)`
102
+
103
+ Renders a component for e2e testing, returns test context with `lastFrame()`, `stdin`, `frames`, and `unmount()`.
104
+
105
+ ### `simulateText(stdin, text)`
106
+
107
+ Simulates typing text character by character.
108
+
109
+ ### `simulateEnter(stdin)`
110
+
111
+ Simulates pressing Enter key.
112
+
113
+ ### `simulateCtrlC(stdin)`
114
+
115
+ Simulates pressing Ctrl+C.
116
+
117
+ ### `simulateEscape(stdin)`
118
+
119
+ Simulates pressing ESC key.
120
+
121
+ ### `simulateUpArrow(stdin)`
122
+
123
+ Simulates pressing Up Arrow key (for history navigation).
124
+
125
+ ### `simulateDownArrow(stdin)`
126
+
127
+ Simulates pressing Down Arrow key.
128
+
129
+ ### `simulateRightArrow(stdin)`
130
+
131
+ Simulates pressing Right Arrow key.
132
+
133
+ ### `simulateLeftArrow(stdin)`
134
+
135
+ Simulates pressing Left Arrow key.
136
+
137
+ ### `waitForFrame(lastFrame, predicate, timeout)`
138
+
139
+ Waits for a frame that matches the predicate function.
140
+
141
+ ### `mockApiClient()`
142
+
143
+ Creates a mock API client for testing.
144
+
145
+ ### `mockConfigService()`
146
+
147
+ Creates a mock config service for testing.
148
+
149
+ ## Best Practices
150
+
151
+ 1. **Use `// @vitest-environment node`** at the top of e2e test files to run in Node environment
152
+ 2. **Always unmount** after each test to clean up resources
153
+ 3. **Use `waitForFrame`** instead of arbitrary timeouts when possible
154
+ 4. **Mock external dependencies** like API clients to make tests deterministic
155
+ 5. **Test user flows**, not implementation details
156
+ 6. **Keep tests focused** - one flow per test
157
+ 7. **Use descriptive test names** that explain the user scenario
158
+
159
+ ## Differences from Component Tests
160
+
161
+ | Aspect | Component Tests | E2E Tests |
162
+ | --------------- | --------------------- | ------------------------- |
163
+ | **Scope** | Individual components | Full application flow |
164
+ | **Environment** | jsdom | Node (with Ink rendering) |
165
+ | **Mocking** | Heavy mocking | Minimal mocking |
166
+ | **Speed** | Fast | Slower |
167
+ | **Focus** | Component behavior | User experience |
168
+ | **Location** | `src/lib/__tests__/` | `src/__e2e__/` |
169
+
170
+ ## Debugging
171
+
172
+ To debug e2e tests, you can:
173
+
174
+ 1. Print the current frame:
175
+
176
+ ```typescript
177
+ console.log(lastFrame());
178
+ ```
179
+
180
+ 2. Print all frames:
181
+
182
+ ```typescript
183
+ console.log(frames);
184
+ ```
185
+
186
+ 3. Add longer timeouts for debugging:
187
+
188
+ ```typescript
189
+ await waitForFrame(lastFrame, predicate, 30000); // 30 seconds
190
+ ```
191
+
192
+ 4. Use Vitest UI mode for visual debugging:
193
+
194
+ ```bash
195
+ npm run test:ui
196
+ ```
@@ -0,0 +1,61 @@
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
+ waitForFrame,
11
+ } from "./helpers/test-helpers.js";
12
+
13
+ describe.concurrent("Agent Interaction E2E Tests", () => {
14
+ it("send message and stop agent", async () => {
15
+ const timing = new Timing();
16
+
17
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
18
+
19
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 8000);
20
+ simulateText(stdin, "Build me a tic tac toe game");
21
+ simulateEnter(stdin);
22
+
23
+ simulateText(stdin, "/stop");
24
+ simulateEnter(stdin);
25
+
26
+ const frame = lastFrame();
27
+ expect(frame.length).toBeGreaterThan(0);
28
+
29
+ unmount();
30
+ });
31
+
32
+ it("change model", async () => {
33
+ const timing = new Timing();
34
+
35
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
36
+
37
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
38
+ simulateText(stdin, "/model gpt-4");
39
+ simulateEnter(stdin);
40
+
41
+ const frame = lastFrame();
42
+ expect(frame.length).toBeGreaterThan(0);
43
+
44
+ unmount();
45
+ });
46
+
47
+ it("terminal setup command", async () => {
48
+ const timing = new Timing();
49
+
50
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
51
+
52
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
53
+ simulateText(stdin, "/terminal-setup");
54
+ simulateEnter(stdin);
55
+
56
+ const frame = lastFrame();
57
+ expect(frame.length).toBeGreaterThan(0);
58
+
59
+ unmount();
60
+ });
61
+ });
@@ -0,0 +1,77 @@
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
+ waitForFrame,
11
+ } from "./helpers/test-helpers.js";
12
+
13
+ describe.concurrent("CLI Commands E2E Tests", () => {
14
+ it("/help - should display help information", async () => {
15
+ const timing = new Timing();
16
+
17
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
18
+
19
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
20
+
21
+ simulateText(stdin, "/help");
22
+ simulateEnter(stdin);
23
+
24
+ const frame = lastFrame();
25
+ expect(frame.length).toBeGreaterThan(0);
26
+
27
+ unmount();
28
+ });
29
+
30
+ it("/version - should display CLI version", 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, "/version");
38
+ simulateEnter(stdin);
39
+
40
+ const frame = lastFrame();
41
+ expect(frame.length).toBeGreaterThan(0);
42
+
43
+ unmount();
44
+ });
45
+
46
+ it("/status - should display user status information", async () => {
47
+ const timing = new Timing();
48
+
49
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
50
+
51
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
52
+
53
+ simulateText(stdin, "/status");
54
+ simulateEnter(stdin);
55
+
56
+ const frame = lastFrame();
57
+ expect(frame.length).toBeGreaterThan(0);
58
+
59
+ unmount();
60
+ });
61
+
62
+ it("/usage - should display usage information", async () => {
63
+ const timing = new Timing();
64
+
65
+ const { lastFrame, stdin, unmount } = renderWithProviders(React.createElement(App, { timing }));
66
+
67
+ await waitForFrame(lastFrame, (frame) => frame.length > 0, 5000);
68
+
69
+ simulateText(stdin, "/usage");
70
+ simulateEnter(stdin);
71
+
72
+ const frame = lastFrame();
73
+ expect(frame.length).toBeGreaterThan(0);
74
+
75
+ unmount();
76
+ });
77
+ });