@abacus-ai/cli 1.106.25007 → 2.0.0-canary.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.
Files changed (200) hide show
  1. package/.oxlintrc.json +8 -0
  2. package/dist/index.mjs +12603 -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 +450 -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 +1006 -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 +312 -0
  62. package/src/components/tool-permissions/diff-preview.tsx +355 -0
  63. package/src/components/tool-permissions/index.ts +5 -0
  64. package/src/components/tool-permissions/permission-options.tsx +375 -0
  65. package/src/components/tool-permissions/permission-preview-header.tsx +57 -0
  66. package/src/components/tool-permissions/tool-permission-ui.tsx +398 -0
  67. package/src/components/tools/agent/ask-user-question.tsx +101 -0
  68. package/src/components/tools/agent/enter-plan-mode.tsx +49 -0
  69. package/src/components/tools/agent/exit-plan-mode.tsx +75 -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 +174 -0
  98. package/src/components/tools/terminal/get-terminal-output.tsx +85 -0
  99. package/src/components/tools/terminal/run-in-terminal.tsx +106 -0
  100. package/src/components/tools/types.ts +16 -0
  101. package/src/components/tools.tsx +66 -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 +25 -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 +84 -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 +401 -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 +1075 -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/suspend.ts +58 -0
  184. package/src/terminal/types.ts +51 -0
  185. package/src/theme/context.tsx +57 -0
  186. package/src/theme/index.ts +4 -0
  187. package/src/theme/themed.tsx +35 -0
  188. package/src/theme/themes.json +546 -0
  189. package/src/theme/types.ts +110 -0
  190. package/src/tools/types.ts +59 -0
  191. package/src/tools/utils/__tests__/zod-coercion.test.ts +33 -0
  192. package/src/tools/utils/tool-ui-components.tsx +631 -0
  193. package/src/tools/utils/zod-coercion.ts +35 -0
  194. package/tsconfig.json +11 -0
  195. package/tsconfig.node.json +29 -0
  196. package/tsconfig.test.json +27 -0
  197. package/tsdown.config.ts +17 -0
  198. package/vitest.config.ts +76 -0
  199. package/README.md +0 -28
  200. package/dist/index.js +0 -26
@@ -0,0 +1,237 @@
1
+ export const STATUS_WORDS = [
2
+ // Classic playful activities
3
+ "baking",
4
+ "beaming",
5
+ "booping",
6
+ "bouncing",
7
+ "brewing",
8
+ "bubbling",
9
+ "chasing",
10
+ "churning",
11
+ "coalescing",
12
+ "conjuring",
13
+ "cooking",
14
+ "crafting",
15
+ "crunching",
16
+ "cuddling",
17
+ "dancing",
18
+ "dazzling",
19
+ "discovering",
20
+ "doodling",
21
+ "dreaming",
22
+ "drifting",
23
+ "enchanting",
24
+ "exploring",
25
+ "finding",
26
+ "floating",
27
+ "fluttering",
28
+ "foraging",
29
+ "forging",
30
+ "frolicking",
31
+ "gathering",
32
+ "giggling",
33
+ "gliding",
34
+ "greeting",
35
+ "growing",
36
+ "hatching",
37
+ "herding",
38
+ "honking",
39
+ "hopping",
40
+ "hugging",
41
+ "humming",
42
+ "imagining",
43
+ "inventing",
44
+ "jingling",
45
+ "juggling",
46
+ "jumping",
47
+ "kindling",
48
+ "knitting",
49
+ "launching",
50
+ "leaping",
51
+ "mapping",
52
+ "marinating",
53
+ "meandering",
54
+ "mixing",
55
+ "moseying",
56
+ "munching",
57
+ "napping",
58
+ "nibbling",
59
+ "noodling",
60
+ "orbiting",
61
+ "painting",
62
+ "percolating",
63
+ "petting",
64
+ "plotting",
65
+ "pondering",
66
+ "popping",
67
+ "prancing",
68
+ "purring",
69
+ "puzzling",
70
+ "questing",
71
+ "riding",
72
+ "roaming",
73
+ "rolling",
74
+ "sauteeing",
75
+ "scribbling",
76
+ "seeking",
77
+ "shimmying",
78
+ "singing",
79
+ "skipping",
80
+ "sleeping",
81
+ "snacking",
82
+ "sniffing",
83
+ "snuggling",
84
+ "soaring",
85
+ "sparking",
86
+ "spinning",
87
+ "splashing",
88
+ "sprouting",
89
+ "squishing",
90
+ "stargazing",
91
+ "stirring",
92
+ "strolling",
93
+ "swimming",
94
+ "swinging",
95
+ "tickling",
96
+ "tinkering",
97
+ "toasting",
98
+ "tumbling",
99
+ "twirling",
100
+ "waddling",
101
+ "wandering",
102
+ "watching",
103
+ "weaving",
104
+ "whistling",
105
+ "wibbling",
106
+ "wiggling",
107
+ "wishing",
108
+ "wobbling",
109
+ "wondering",
110
+ "yawning",
111
+ "zooming",
112
+
113
+ // Extended creative, whimsical, and generic playful verbs
114
+ "adventuring",
115
+ "assembling",
116
+ "ballooning",
117
+ "befriending",
118
+ "blinking",
119
+ "blossoming",
120
+ "browsing",
121
+ "burrowing",
122
+ "capering",
123
+ "cartwheeling",
124
+ "celebrating",
125
+ "charging",
126
+ "cheering",
127
+ "chuckling",
128
+ "clambering",
129
+ "clapping",
130
+ "climbing",
131
+ "confettifying",
132
+ "connecting",
133
+ "contemplating",
134
+ "cuddling",
135
+ "curating",
136
+ "dabbling",
137
+ "daydreaming",
138
+ "delighting",
139
+ "detecting",
140
+ "doodling",
141
+ "doodling",
142
+ "drizzling",
143
+ "echoing",
144
+ "edging",
145
+ "elucidating",
146
+ "fiddling",
147
+ "flapping",
148
+ "flickering",
149
+ "flipping",
150
+ "formulating",
151
+ "gallivanting",
152
+ "gamboling",
153
+ "gesticulating",
154
+ "harmonizing",
155
+ "hiding",
156
+ "hitchhiking",
157
+ "hopping",
158
+ "illuminating",
159
+ "investigating",
160
+ "jamming",
161
+ "kaleidoscoping",
162
+ "leapfrogging",
163
+ "levitating",
164
+ "listening",
165
+ "lounging",
166
+ "marveling",
167
+ "mimicking",
168
+ "murmuring",
169
+ "mystifying",
170
+ "narrating",
171
+ "nestling",
172
+ "nuzzling",
173
+ "orchestrating",
174
+ "peeking",
175
+ "perambulating",
176
+ "perusing",
177
+ "pirouetting",
178
+ "plopping",
179
+ "poking",
180
+ "prepping",
181
+ "processing",
182
+ "purring",
183
+ "questing",
184
+ "quipping",
185
+ "quizzing",
186
+ "rambling",
187
+ "relishing",
188
+ "reveling",
189
+ "romping",
190
+ "scampering",
191
+ "scanning",
192
+ "scheming",
193
+ "scribbling",
194
+ "shuffling",
195
+ "skedaddling",
196
+ "snoozing",
197
+ "snuggling",
198
+ "spinning",
199
+ "squeaking",
200
+ "squirming",
201
+ "stalking",
202
+ "star-jumping",
203
+ "strolling",
204
+ "swirling",
205
+ "tapping",
206
+ "tasting",
207
+ "tiptoeing",
208
+ "toddling",
209
+ "traversing",
210
+ "tripping",
211
+ "tuning",
212
+ "unfolding",
213
+ "unraveling",
214
+ "updating",
215
+ "vibing",
216
+ "wandering",
217
+ "whirling",
218
+ "whizzing",
219
+ "wiggling",
220
+ "winking",
221
+ "wobbling",
222
+ "wondering",
223
+ "yodeling",
224
+ "yondering",
225
+ "zipping",
226
+ "zizzling",
227
+ "zoning",
228
+ ];
229
+
230
+ export function capitalize(word: string): string {
231
+ return word.charAt(0).toUpperCase() + word.slice(1);
232
+ }
233
+
234
+ export function getRandomWord(): string {
235
+ const index = Math.floor(Math.random() * STATUS_WORDS.length);
236
+ return STATUS_WORDS[index];
237
+ }
@@ -0,0 +1,72 @@
1
+ import { renderForTest } from "@codellm/jar";
2
+ import stripAnsi from "strip-ansi";
3
+
4
+ import { ANSI } from "./ansi.js";
5
+
6
+ export type Instance = {
7
+ frames: string[];
8
+ lastFrame: () => string;
9
+ unmount: () => void;
10
+ rerender: (tree: React.ReactElement) => void;
11
+ };
12
+
13
+ export interface VisualizeOptions {
14
+ /**
15
+ * Whether to strip ANSI codes for cleaner output
16
+ * @default false
17
+ */
18
+ stripAnsi?: boolean;
19
+ /**
20
+ * Whether to show frame numbers
21
+ * @default true
22
+ */
23
+ showFrameNumbers?: boolean;
24
+ }
25
+
26
+ // Registry of active instances so cleanup() can unmount them all
27
+ const activeInstances: Instance[] = [];
28
+
29
+ /**
30
+ * Render a React element for unit/component tests using jar's reconciler.
31
+ * Returns an Instance with `frames`, `lastFrame()`, `rerender()`, and `unmount()`.
32
+ * Uses a 120-column terminal width to match the MockShellSizeContext dimensions.
33
+ */
34
+ export function render(tree: React.ReactElement, _strictMode: boolean = true): Instance {
35
+ const instance = renderForTest(tree, { columns: 120, rows: 40 });
36
+ activeInstances.push(instance);
37
+ return instance;
38
+ }
39
+
40
+ export function logInk(instance: Instance, options: VisualizeOptions = {}) {
41
+ const { stripAnsi: shouldStripAnsi = false, showFrameNumbers = true } = options;
42
+ for (const [index, frame] of instance.frames.entries()) {
43
+ if (showFrameNumbers) {
44
+ const frameTitle = `F[${index + 1}/${instance.frames.length}]`;
45
+ console.log(shouldStripAnsi ? frameTitle : `${ANSI.DIM}${frameTitle}${ANSI.RESET_SGR}`);
46
+ }
47
+
48
+ let frameContent = frame;
49
+
50
+ if (shouldStripAnsi) {
51
+ frameContent = stripAnsi(frameContent);
52
+ }
53
+
54
+ const lines = frameContent.split("\n");
55
+
56
+ if (lines.length > 1) {
57
+ lines.forEach((line: string, lineIndex: number) => {
58
+ const lineNum = String(lineIndex + 1).padStart(3, " ");
59
+ console.log(`${lineNum} │ ${line}`);
60
+ });
61
+ } else {
62
+ console.log(frameContent);
63
+ }
64
+ }
65
+ }
66
+
67
+ export function cleanup() {
68
+ // Unmount all active instances (mirrors ink-testing-library cleanup behavior)
69
+ while (activeInstances.length > 0) {
70
+ activeInstances.pop()?.unmount();
71
+ }
72
+ }