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

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/README.md +25 -0
  2. package/dist/index.mjs +466 -438
  3. package/package.json +4 -1
  4. package/.oxlintrc.json +0 -8
  5. package/resources/abacus.ico +0 -0
  6. package/resources/entitlements.plist +0 -9
  7. package/src/__e2e__/README.md +0 -196
  8. package/src/__e2e__/agent-interactions.e2e.test.tsx +0 -61
  9. package/src/__e2e__/cli-commands.e2e.test.tsx +0 -77
  10. package/src/__e2e__/conversation-throttle.e2e.test.ts +0 -453
  11. package/src/__e2e__/conversation.e2e.test.tsx +0 -56
  12. package/src/__e2e__/diff-preview.e2e.test.tsx +0 -3399
  13. package/src/__e2e__/file-creation.e2e.test.tsx +0 -149
  14. package/src/__e2e__/helpers/test-helpers.ts +0 -449
  15. package/src/__e2e__/keyboard-navigation.e2e.test.tsx +0 -34
  16. package/src/__e2e__/llm-models.e2e.test.ts +0 -402
  17. package/src/__e2e__/mcp/mcp-callback-flow.e2e.test.tsx +0 -71
  18. package/src/__e2e__/mcp/mcp-full-app-ui.e2e.test.tsx +0 -167
  19. package/src/__e2e__/mcp/mcp-ui-rendering.e2e.test.tsx +0 -185
  20. package/src/__e2e__/repl.e2e.test.tsx +0 -78
  21. package/src/__e2e__/shell-compatibility.e2e.test.tsx +0 -76
  22. package/src/__e2e__/theme-mcp.e2e.test.tsx +0 -98
  23. package/src/__e2e__/tool-permissions.e2e.test.tsx +0 -66
  24. package/src/args.ts +0 -22
  25. package/src/components/__tests__/react-compiler.test.tsx +0 -78
  26. package/src/components/__tests__/status-indicator.test.tsx +0 -403
  27. package/src/components/composer/__tests__/bash-runner.test.tsx +0 -263
  28. package/src/components/composer/agent-mode-indicator.tsx +0 -63
  29. package/src/components/composer/bash-runner.tsx +0 -54
  30. package/src/components/composer/commands/default-commands.tsx +0 -615
  31. package/src/components/composer/commands/handler.tsx +0 -59
  32. package/src/components/composer/commands/picker.tsx +0 -273
  33. package/src/components/composer/commands/registry.ts +0 -233
  34. package/src/components/composer/commands/types.ts +0 -33
  35. package/src/components/composer/context.tsx +0 -88
  36. package/src/components/composer/file-mention-picker.tsx +0 -83
  37. package/src/components/composer/help.tsx +0 -44
  38. package/src/components/composer/index.tsx +0 -1007
  39. package/src/components/composer/mentions.ts +0 -57
  40. package/src/components/composer/message-queue.tsx +0 -70
  41. package/src/components/composer/mode-panel.tsx +0 -35
  42. package/src/components/composer/modes/__tests__/bash-handler.test.tsx +0 -755
  43. package/src/components/composer/modes/__tests__/bash-renderer.test.tsx +0 -1108
  44. package/src/components/composer/modes/bash-handler.tsx +0 -132
  45. package/src/components/composer/modes/bash-renderer.tsx +0 -175
  46. package/src/components/composer/modes/default-handlers.tsx +0 -33
  47. package/src/components/composer/modes/index.ts +0 -41
  48. package/src/components/composer/modes/types.ts +0 -21
  49. package/src/components/composer/persistent-shell.ts +0 -283
  50. package/src/components/composer/process.ts +0 -65
  51. package/src/components/composer/types.ts +0 -9
  52. package/src/components/composer/use-mention-search.ts +0 -68
  53. package/src/components/error-boundry.tsx +0 -60
  54. package/src/components/exit-message.tsx +0 -29
  55. package/src/components/expanded-view.tsx +0 -74
  56. package/src/components/file-completion.tsx +0 -127
  57. package/src/components/header.tsx +0 -47
  58. package/src/components/logo.tsx +0 -37
  59. package/src/components/segments.tsx +0 -356
  60. package/src/components/status-indicator.tsx +0 -306
  61. package/src/components/tool-group-summary.tsx +0 -263
  62. package/src/components/tool-permissions/ask-user-question-permission-ui.tsx +0 -319
  63. package/src/components/tool-permissions/diff-preview.tsx +0 -359
  64. package/src/components/tool-permissions/index.ts +0 -5
  65. package/src/components/tool-permissions/permission-options.tsx +0 -401
  66. package/src/components/tool-permissions/permission-preview-header.tsx +0 -57
  67. package/src/components/tool-permissions/tool-permission-ui.tsx +0 -420
  68. package/src/components/tools/agent/ask-user-question.tsx +0 -107
  69. package/src/components/tools/agent/enter-plan-mode.tsx +0 -55
  70. package/src/components/tools/agent/exit-plan-mode.tsx +0 -83
  71. package/src/components/tools/agent/handoff-to-main.tsx +0 -27
  72. package/src/components/tools/agent/subagent.tsx +0 -37
  73. package/src/components/tools/agent/todo-write.tsx +0 -104
  74. package/src/components/tools/browser/close-tab.tsx +0 -58
  75. package/src/components/tools/browser/computer.tsx +0 -70
  76. package/src/components/tools/browser/get-interactive-elements.tsx +0 -54
  77. package/src/components/tools/browser/get-tab-content.tsx +0 -51
  78. package/src/components/tools/browser/navigate-to.tsx +0 -59
  79. package/src/components/tools/browser/new-tab.tsx +0 -60
  80. package/src/components/tools/browser/perform-action.tsx +0 -63
  81. package/src/components/tools/browser/refresh-tab.tsx +0 -43
  82. package/src/components/tools/browser/switch-tab.tsx +0 -58
  83. package/src/components/tools/filesystem/delete-file.tsx +0 -104
  84. package/src/components/tools/filesystem/edit.tsx +0 -220
  85. package/src/components/tools/filesystem/list-dir.tsx +0 -78
  86. package/src/components/tools/filesystem/read-file.tsx +0 -180
  87. package/src/components/tools/filesystem/upload-image.tsx +0 -76
  88. package/src/components/tools/ide/ide-diagnostics.tsx +0 -62
  89. package/src/components/tools/index.ts +0 -91
  90. package/src/components/tools/mcp/mcp-tool.tsx +0 -158
  91. package/src/components/tools/search/fetch-url.tsx +0 -73
  92. package/src/components/tools/search/file-search.tsx +0 -78
  93. package/src/components/tools/search/grep.tsx +0 -90
  94. package/src/components/tools/search/semantic-search.tsx +0 -66
  95. package/src/components/tools/search/web-search.tsx +0 -71
  96. package/src/components/tools/shared/index.tsx +0 -48
  97. package/src/components/tools/shared/zod-coercion.ts +0 -35
  98. package/src/components/tools/terminal/bash-tool-output.tsx +0 -188
  99. package/src/components/tools/terminal/get-terminal-output.tsx +0 -91
  100. package/src/components/tools/terminal/run-in-terminal.tsx +0 -131
  101. package/src/components/tools/types.ts +0 -16
  102. package/src/components/tools.tsx +0 -68
  103. package/src/components/ui/__tests__/divider.test.tsx +0 -61
  104. package/src/components/ui/__tests__/gradient.test.tsx +0 -125
  105. package/src/components/ui/__tests__/input.test.tsx +0 -166
  106. package/src/components/ui/__tests__/select.test.tsx +0 -273
  107. package/src/components/ui/__tests__/shimmer.test.tsx +0 -99
  108. package/src/components/ui/blinking-indicator.tsx +0 -27
  109. package/src/components/ui/divider.tsx +0 -162
  110. package/src/components/ui/gradient.tsx +0 -56
  111. package/src/components/ui/input.tsx +0 -228
  112. package/src/components/ui/select.tsx +0 -151
  113. package/src/components/ui/shimmer.tsx +0 -76
  114. package/src/context/agent-mode.tsx +0 -95
  115. package/src/context/extension-file.tsx +0 -136
  116. package/src/context/network-activity.tsx +0 -45
  117. package/src/context/notification.tsx +0 -62
  118. package/src/context/shell-size.tsx +0 -49
  119. package/src/context/shell-title.tsx +0 -38
  120. package/src/entrypoints/print-mode.ts +0 -312
  121. package/src/entrypoints/repl.tsx +0 -389
  122. package/src/hooks/use-agent.ts +0 -15
  123. package/src/hooks/use-api-client.ts +0 -1
  124. package/src/hooks/use-available-height.ts +0 -8
  125. package/src/hooks/use-cleanup.ts +0 -29
  126. package/src/hooks/use-interrupt-manager.ts +0 -242
  127. package/src/hooks/use-models.ts +0 -22
  128. package/src/index.ts +0 -217
  129. package/src/lib/__tests__/ansi.test.ts +0 -255
  130. package/src/lib/__tests__/cli.test.ts +0 -122
  131. package/src/lib/__tests__/commands.test.ts +0 -325
  132. package/src/lib/__tests__/constants.test.ts +0 -15
  133. package/src/lib/__tests__/focusables.test.ts +0 -25
  134. package/src/lib/__tests__/fs.test.ts +0 -231
  135. package/src/lib/__tests__/markdown.test.tsx +0 -348
  136. package/src/lib/__tests__/mcpCommandHandler.test.ts +0 -173
  137. package/src/lib/__tests__/mcpManagement.test.ts +0 -38
  138. package/src/lib/__tests__/path-paste.test.ts +0 -144
  139. package/src/lib/__tests__/path.test.ts +0 -300
  140. package/src/lib/__tests__/queries.test.ts +0 -39
  141. package/src/lib/__tests__/standaloneMcpService.test.ts +0 -71
  142. package/src/lib/__tests__/text-buffer.test.ts +0 -328
  143. package/src/lib/__tests__/text-utils.test.ts +0 -32
  144. package/src/lib/__tests__/timing.test.ts +0 -78
  145. package/src/lib/__tests__/utils.test.ts +0 -238
  146. package/src/lib/__tests__/vim-buffer-actions.test.ts +0 -154
  147. package/src/lib/ansi.ts +0 -150
  148. package/src/lib/cli-push-server.ts +0 -112
  149. package/src/lib/cli.ts +0 -44
  150. package/src/lib/clipboard.ts +0 -226
  151. package/src/lib/command-utils.ts +0 -93
  152. package/src/lib/commands.ts +0 -270
  153. package/src/lib/constants.ts +0 -3
  154. package/src/lib/extension-connection.ts +0 -181
  155. package/src/lib/focusables.ts +0 -7
  156. package/src/lib/fs.ts +0 -533
  157. package/src/lib/markdown/code-block.tsx +0 -63
  158. package/src/lib/markdown/index.ts +0 -4
  159. package/src/lib/markdown/link.tsx +0 -19
  160. package/src/lib/markdown/markdown.tsx +0 -372
  161. package/src/lib/markdown/types.ts +0 -15
  162. package/src/lib/mcpCommandHandler.ts +0 -121
  163. package/src/lib/mcpManagement.ts +0 -44
  164. package/src/lib/path-paste.ts +0 -185
  165. package/src/lib/path.ts +0 -179
  166. package/src/lib/queries.ts +0 -15
  167. package/src/lib/standaloneMcpService.ts +0 -688
  168. package/src/lib/status-utils.ts +0 -237
  169. package/src/lib/test-utils.tsx +0 -72
  170. package/src/lib/text-buffer.ts +0 -2415
  171. package/src/lib/text-utils.ts +0 -272
  172. package/src/lib/timing.ts +0 -63
  173. package/src/lib/types.ts +0 -295
  174. package/src/lib/utils.ts +0 -182
  175. package/src/lib/vim-buffer-actions.ts +0 -732
  176. package/src/providers/agent.tsx +0 -1063
  177. package/src/providers/api-client.tsx +0 -43
  178. package/src/services/logger.ts +0 -85
  179. package/src/terminal/detection.ts +0 -187
  180. package/src/terminal/exit.ts +0 -279
  181. package/src/terminal/notification.ts +0 -83
  182. package/src/terminal/progress.ts +0 -201
  183. package/src/terminal/setup.ts +0 -797
  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 -649
  193. package/src/tools/utils/zod-coercion.ts +0 -35
  194. package/tsconfig.json +0 -16
  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,1007 +0,0 @@
1
- import type { IAbacusConvoListResponse } from "@codellm/api";
2
-
3
- import { PromptHistory } from "@codellm/agent";
4
- import { getDeviceId } from "@codellm/auth";
5
- import { View, Text } from "@codellm/jar";
6
- import { product } from "@codellm/product";
7
- import {
8
- type Ref,
9
- memo,
10
- Suspense,
11
- useCallback,
12
- useEffect,
13
- useImperativeHandle,
14
- useMemo,
15
- useRef,
16
- useState,
17
- } from "react";
18
-
19
- import type { InterruptHints } from "../../hooks/use-interrupt-manager.js";
20
-
21
- import { useAgentMode } from "../../context/agent-mode.js";
22
- import { useExtensionFile } from "../../context/extension-file.js";
23
- import { useShellSize } from "../../context/shell-size.js";
24
- import { useAgent } from "../../hooks/use-agent.js";
25
- import { useApiClient } from "../../hooks/use-api-client.js";
26
- import { useAvailableHeight } from "../../hooks/use-available-height.js";
27
- import { useModels } from "../../hooks/use-models.js";
28
- import {
29
- clipboardHasImage,
30
- saveClipboardImage,
31
- readClipboardText,
32
- isMacOSTempScreenshot,
33
- copyTempScreenshotToProject,
34
- } from "../../lib/clipboard.js";
35
- import { MAX_RECENT_CONVERSATIONS } from "../../lib/constants.js";
36
- import {
37
- parsePastedPaths,
38
- prettifyMentionPath,
39
- escapePathForMention,
40
- } from "../../lib/path-paste.js";
41
- import { abbreviateHome } from "../../lib/path.js";
42
- import { isWindows, sleep } from "../../lib/utils.js";
43
- import { AgentStatus } from "../../providers/agent.js";
44
- import { gracefulExit } from "../../terminal/exit.js";
45
- import { useTheme } from "../../theme/index.js";
46
- import { Input, InputKeyDownEvent } from "../ui/input.js";
47
- import { registerDefaultCommands } from "./commands/default-commands.js";
48
- import { commandRegistry } from "./commands/registry.js";
49
- import { ComposerProvider, useComposerContext } from "./context.js";
50
- import { buildMentionGrammar, getMentionAtCursor } from "./mentions.js";
51
- import { MessageQueue } from "./message-queue.js";
52
- import { ModePanel } from "./mode-panel.js";
53
- import { useModeHandlers } from "./modes/index.js";
54
- import { ComposerMode, ModeMeta } from "./types.js";
55
-
56
- const MODE_META: Record<ComposerMode, ModeMeta> = {
57
- [ComposerMode.Prompt]: {
58
- color: undefined,
59
- placeholder: 'Try "Build a ecommerce website..."',
60
- prefix: "❯",
61
- },
62
- [ComposerMode.Help]: {
63
- color: undefined,
64
- placeholder: 'Try "Build a ecommerce website..."',
65
- prefix: "❯",
66
- },
67
- [ComposerMode.Bash]: {
68
- color: "greenBright",
69
- placeholder: isWindows() ? 'Try "dir"' : 'Try "ls -la"',
70
- prefix: "!",
71
- },
72
- [ComposerMode.Command]: {
73
- color: "magentaBright",
74
- placeholder: 'Try "/resume <chat title>"',
75
- prefix: "❯",
76
- },
77
- [ComposerMode.Files]: { color: "cyanBright", placeholder: 'Try "@help.md"', prefix: "@" },
78
- };
79
-
80
- const MODE_TRIGGERS: Record<
81
- string,
82
- { mode: ComposerMode; preventDefault: boolean; atStartOnly: boolean }
83
- > = {
84
- "!": { mode: ComposerMode.Bash, preventDefault: true, atStartOnly: true },
85
- "?": { mode: ComposerMode.Help, preventDefault: true, atStartOnly: true },
86
- "/": { mode: ComposerMode.Command, preventDefault: true, atStartOnly: true },
87
- "@": { mode: ComposerMode.Files, preventDefault: false, atStartOnly: false },
88
- };
89
-
90
- export interface ComposerHandle {
91
- hasText: () => boolean;
92
- hasQueue: () => boolean;
93
- saveAndClear: () => void;
94
- clear: () => void;
95
- clearQueue: () => void;
96
- }
97
-
98
- const ComposerInner = memo(
99
- ({ hints, composerRef }: { hints?: InterruptHints; composerRef?: Ref<ComposerHandle> }) => {
100
- const {
101
- prompt,
102
- setPrompt,
103
- mode,
104
- setMode,
105
- bufferRef,
106
- activity,
107
- setActivity,
108
- queuedMessages,
109
- addToQueue,
110
- clearQueue,
111
- attachments,
112
- addAttachment,
113
- clearAttachments,
114
- } = useComposerContext();
115
-
116
- // Inline paste helpers — delegate to TextBuffer's built-in placeholder system
117
- const expandPlaceholders = useCallback(
118
- (text: string) => bufferRef.current?.getExpandedText(text) ?? text,
119
- [bufferRef],
120
- );
121
- const clearPlaceholders = useCallback(() => {
122
- // no-op: TextBuffer clears its own pastedContent map on setText("")
123
- }, []);
124
-
125
- // Non-bracketed paste debounce accumulator (for terminals without BP support)
126
- const nonBpAccumRef = useRef<{ text: string; timer: ReturnType<typeof setTimeout> | null }>({
127
- text: "",
128
- timer: null,
129
- });
130
-
131
- // ── Prompt history (persisted across sessions) ──
132
- const promptHistoryRef = useRef<PromptHistory | null>(null);
133
- if (!promptHistoryRef.current) {
134
- promptHistoryRef.current = new PromptHistory("cli-repl");
135
- void promptHistoryRef.current.load();
136
- }
137
- const promptHistory = promptHistoryRef.current;
138
- const draftRef = useRef<string>("");
139
- const prevTextLenRef = useRef(0);
140
-
141
- // Expose imperative handle for interrupt manager
142
- useImperativeHandle(composerRef, () => ({
143
- hasText: () => prompt.length > 0,
144
- hasQueue: () => queuedMessages.length > 0,
145
- saveAndClear: () => {
146
- const text = prompt.trim();
147
- if (text) {
148
- promptHistory.append(text);
149
- promptHistory.resetNavigation();
150
- }
151
- bufferRef.current?.setText("");
152
- clearPlaceholders();
153
- clearAttachments();
154
- },
155
- clear: () => {
156
- bufferRef.current?.setText("");
157
- clearPlaceholders();
158
- clearAttachments();
159
- },
160
- clearQueue: () => clearQueue(),
161
- }));
162
- const { currentFile, selectionStartLine, selectionEndLine } = useExtensionFile();
163
- const {
164
- sendMessage,
165
- clearSegments,
166
- clearSegmentsOnly,
167
- clearTempSegments,
168
- stop,
169
- addNotification,
170
- mcp,
171
- addAllowedDirectory,
172
- refreshMcpTools,
173
- loadConversation,
174
- agentStatus,
175
- segmentsLength,
176
- dequeuedOnStop,
177
- clearDequeuedOnStop,
178
- networkOnline,
179
- } = useAgent();
180
- const { apiClient, authManager } = useApiClient();
181
- const { data: models = [], refetch: refetchModels } = useModels(apiClient);
182
- const { width: terminalWidth } = useShellSize();
183
- const { cycleAgentMode, resetToNormal, isWaitingForYoloConfirm } = useAgentMode();
184
- const { setTheme } = useTheme();
185
- const availableHeight = useAvailableHeight();
186
- const clearBuffer = useCallback(() => {
187
- bufferRef.current?.setText("");
188
- }, [bufferRef]);
189
- const { handlers, getActivity, bashNavigateHistory } = useModeHandlers(
190
- () => setMode(ComposerMode.Prompt),
191
- clearBuffer,
192
- );
193
- const currentHandler = handlers.get(mode) || null;
194
- const [conversations, setConversations] = useState<
195
- NonNullable<IAbacusConvoListResponse["result"]>
196
- >([]);
197
- const [selectedModel, setSelectedModel] = useState<string>("");
198
- const [isLoggedIn, setIsLoggedIn] = useState<boolean | null>(null);
199
-
200
- const loadConversations = useCallback(async () => {
201
- try {
202
- const response = await apiClient.getConversationsList(product.agentType, process.cwd());
203
- if (response?.result) {
204
- setConversations(response.result.slice(0, MAX_RECENT_CONVERSATIONS));
205
- }
206
- } catch {
207
- // Silently fail - conversations list is optional
208
- }
209
- }, [apiClient]);
210
-
211
- useEffect(() => {
212
- void loadConversations();
213
- }, [loadConversations]);
214
-
215
- useEffect(() => {
216
- apiClient
217
- .getUserInfo()
218
- .then((res) => setIsLoggedIn(!!res?.result?.email))
219
- .catch(() => {
220
- // Network error or other failure — fall back to local auth check.
221
- // Don't assume "not logged in" just because the server is unreachable.
222
- setIsLoggedIn(authManager.isAuthenticated());
223
- });
224
- }, [apiClient, authManager]);
225
-
226
- useEffect(() => {
227
- if (dequeuedOnStop) {
228
- bufferRef.current?.setText(dequeuedOnStop);
229
- clearDequeuedOnStop();
230
- }
231
- }, [dequeuedOnStop, clearDequeuedOnStop, bufferRef]);
232
-
233
- useEffect(() => {
234
- registerDefaultCommands({
235
- onExit: () => {
236
- gracefulExit(0);
237
- },
238
- onNewChat: () => {
239
- clearSegments();
240
- clearQueue();
241
- bufferRef.current?.setText("");
242
- },
243
- onClearChat: () => {
244
- clearSegmentsOnly();
245
- bufferRef.current?.setText("");
246
- },
247
- onStop: () => {
248
- stop();
249
- },
250
- onModelChange: (llmName: string) => {
251
- const matchedModel = models.find((m) => m.llmName === llmName);
252
- if (matchedModel) {
253
- setSelectedModel(matchedModel.llmName);
254
- bufferRef.current?.setText("");
255
- addNotification(
256
- `Switched to model: ${matchedModel.name || matchedModel.llmName}`,
257
- "info",
258
- );
259
- } else {
260
- addNotification(`Model not found`, "error");
261
- }
262
- },
263
- onResumeChat: async (title: string) => {
264
- const matchedConversation = conversations.find((conv) => {
265
- const convTitle = conv.name || conv.deploymentConversationId || "Untitled";
266
- return convTitle.toLowerCase().includes(title.toLowerCase());
267
- });
268
-
269
- if (matchedConversation?.deploymentConversationId) {
270
- try {
271
- // Clear queue and buffer before loading conversation
272
- // This ensures state is properly reset when resuming multiple times
273
- clearQueue();
274
- bufferRef.current?.setText("");
275
- await loadConversation(matchedConversation.deploymentConversationId);
276
- addNotification(
277
- `Resumed conversation: ${matchedConversation.name || matchedConversation.deploymentConversationId}`,
278
- "info",
279
- );
280
- } catch (error) {
281
- addNotification(
282
- `Failed to load conversation: ${error instanceof Error ? error.message : "Unknown error"}`,
283
- "error",
284
- );
285
- }
286
- } else {
287
- addNotification(`Conversation "${title}" not found`, "error");
288
- }
289
- },
290
- onLogin: async (emailOrApiKey?: string) => {
291
- try {
292
- if (authManager.isEnvAuth()) {
293
- addNotification(
294
- "You are authenticated via an environment variable. Unset it to use /login or /logout.",
295
- "error",
296
- );
297
- return;
298
- }
299
-
300
- if (!emailOrApiKey) {
301
- addNotification("Usage: /login <email> or /login <api_key>", "error");
302
- return;
303
- }
304
-
305
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
306
- const isEmail = emailRegex.test(emailOrApiKey);
307
-
308
- if (isEmail) {
309
- const email = emailOrApiKey;
310
- const deviceId = await getDeviceId();
311
- const response = await apiClient.authenticateDeviceForCodeLlm(email, deviceId);
312
- if (!response?.success || !response?.result) {
313
- addNotification(response?.error ?? "Failed to start device code login", "error");
314
- return;
315
- }
316
-
317
- const { verificationUri, userCode, pollingInterval } = response.result;
318
- addNotification(
319
- `Open the URL and enter the code to authenticate.\n\nURL: ${verificationUri}\nCode: ${userCode}\n\nPolling for completion...`,
320
- "info",
321
- );
322
-
323
- void (async () => {
324
- const intervalMs = (pollingInterval || 5) * 1000;
325
- const deadline = Date.now() + 10 * 60 * 1000;
326
- while (Date.now() < deadline) {
327
- await sleep(intervalMs);
328
- try {
329
- const res = await apiClient.pollDeviceCode(userCode);
330
- if (res?.success && res.result?.deviceCode) {
331
- const token = res.result.deviceCode;
332
- const chatWebUrl = res.result.chatWebUrl;
333
- await authManager.loginWithDeviceCode(token);
334
- if (chatWebUrl) {
335
- const normalized = chatWebUrl.replace(/^https?:\/\//, "");
336
- apiClient.setChatWebDomain(normalized);
337
- }
338
- addNotification("Authentication successful!", "info");
339
- setIsLoggedIn(true);
340
- await loadConversations();
341
- await refetchModels();
342
- return;
343
- }
344
- } catch {
345
- // keep polling
346
- }
347
- }
348
- addNotification("Authentication timed out. Please try again.", "error");
349
- })();
350
- } else {
351
- // API key login
352
- await authManager.loginWithApiKey(emailOrApiKey);
353
- try {
354
- const userInfo = await apiClient.getUserInfo();
355
- if (userInfo?.result?.email) {
356
- addNotification("API key login successful!", "info");
357
- setIsLoggedIn(true);
358
- await loadConversations();
359
- await refetchModels();
360
- } else {
361
- await authManager.logout();
362
- addNotification("Invalid API key — authentication failed", "error");
363
- }
364
- } catch (error) {
365
- await authManager.logout();
366
- addNotification(
367
- `API key authentication failed: ${error instanceof Error ? error.message : "Unknown error"}`,
368
- "error",
369
- );
370
- }
371
- }
372
- bufferRef.current?.setText("");
373
- } catch (error) {
374
- addNotification(
375
- `Login failed: ${error instanceof Error ? error.message : "Unknown error"}`,
376
- "error",
377
- );
378
- }
379
- },
380
- onLogout: async () => {
381
- if (authManager.isEnvAuth()) {
382
- addNotification(
383
- "You are authenticated via an environment variable. Unset it to use /login or /logout.",
384
- "error",
385
- );
386
- return;
387
- }
388
- await authManager.logout();
389
- setIsLoggedIn(false);
390
- },
391
- getUserInfo: async () => {
392
- try {
393
- const response = await apiClient.getUserInfo();
394
- if (response?.success && response.result) {
395
- const { name, email, organization } = response.result;
396
- const team = organization?.name || "No team";
397
- const authKind = authManager.getAuthKind();
398
- const authMethod =
399
- authKind.type === "env_api_key"
400
- ? "API key (env)"
401
- : authKind.type === "env_device_code"
402
- ? "Device code (env)"
403
- : authKind.type === "api_key"
404
- ? "API key"
405
- : authKind.type === "device_code"
406
- ? "Device code"
407
- : authKind.type === "oauth_token"
408
- ? "OAuth token"
409
- : "Unknown";
410
- addNotification(
411
- `User Status:\n\nName: ${name || "N/A"}\nEmail: ${email || "N/A"}\nTeam: ${team}\nAuth Method: ${authMethod}`,
412
- "info",
413
- );
414
- } else {
415
- addNotification("Failed to get user info", "error");
416
- }
417
- } catch {
418
- addNotification("Failed to get user info", "error");
419
- }
420
- },
421
- getModels: async () => {
422
- return models
423
- .filter((m) => m.codeAgentSupported)
424
- .map((m) => ({
425
- label: m.name || m.llmName,
426
- value: m.llmName,
427
- model: m,
428
- }));
429
- },
430
- getChatTitles: async () => {
431
- return conversations.map((conv) => {
432
- const title = conv.name || conv.deploymentConversationId || "Untitled";
433
- return title.length > 50 ? title.substring(0, 47) + "..." : title;
434
- });
435
- },
436
- addNotification,
437
- mcp,
438
- addAllowedDirectory,
439
- refreshMcpTools,
440
- getAgentStatus: () => agentStatus,
441
- setTheme,
442
- checkEnvAuth: () => ({
443
- isEnvAuth: authManager.isEnvAuth(),
444
- shouldHide: authManager.isEnvAuth(),
445
- }),
446
- });
447
- }, [
448
- models,
449
- clearSegments,
450
- clearSegmentsOnly,
451
- clearQueue,
452
- bufferRef,
453
- apiClient,
454
- refetchModels,
455
- stop,
456
- addNotification,
457
- mcp,
458
- addAllowedDirectory,
459
- refreshMcpTools,
460
- loadConversation,
461
- conversations,
462
- loadConversations,
463
- agentStatus,
464
- setTheme,
465
- ]);
466
-
467
- // ── Clipboard attachment helper ─────────────────────────────────────────
468
- const attachImageFromPath = useCallback(
469
- async (imagePath: string) => {
470
- try {
471
- const { default: fsPromises } = await import("node:fs/promises");
472
- const { default: pathMod } = await import("node:path");
473
- const stats = await fsPromises.stat(imagePath);
474
- const buffer = await fsPromises.readFile(imagePath);
475
- const ext = pathMod.extname(imagePath).toLowerCase();
476
- const mimeType = ext === ".jpg" || ext === ".jpeg" ? "image/jpeg" : "image/png";
477
- const docId =
478
- "tui-" + Math.random().toString(36).slice(2, 11) + "-" + Date.now().toString(36);
479
- addAttachment({
480
- doc_id: docId,
481
- filename: imagePath,
482
- filePath: pathMod.resolve(imagePath),
483
- fileName: pathMod.basename(imagePath),
484
- content: buffer.toString("base64"),
485
- mimeType,
486
- mime_type: mimeType,
487
- size: stats.size,
488
- metadata: {
489
- uploadedAt: new Date().toISOString(),
490
- source: "tui-clipboard",
491
- isImage: true,
492
- encoding: "base64",
493
- },
494
- });
495
- } catch {
496
- // silently ignore attachment errors
497
- }
498
- },
499
- [addAttachment],
500
- );
501
-
502
- // ── Native clipboard paste handler (Ctrl+V / Cmd+V) ─────────────────────
503
- // Triggered when the OS clipboard is read directly (not via bracketed paste).
504
- const handleClipboardPaste = useCallback(async () => {
505
- // 1. Check for clipboard image first
506
- if (await clipboardHasImage()) {
507
- const saved = await saveClipboardImage(process.cwd());
508
- if (saved) {
509
- const pretty = prettifyMentionPath(saved);
510
- const escaped = escapePathForMention(pretty);
511
- bufferRef.current?.insert(`@${escaped} `);
512
- await attachImageFromPath(saved);
513
- return;
514
- }
515
- }
516
-
517
- // 2. Read clipboard text
518
- const text = await readClipboardText();
519
- if (!text) return;
520
-
521
- // 3. Check if it looks like file paths
522
- const paths = parsePastedPaths(text.trim());
523
- if (paths) {
524
- bufferRef.current?.insert(paths);
525
- return;
526
- }
527
-
528
- // 4. Fall back to text insert with large-paste detection
529
- bufferRef.current?.insert(text, { isPaste: true });
530
- }, [bufferRef, attachImageFromPath]);
531
-
532
- const handleKeyDown = useCallback(
533
- (event: InputKeyDownEvent) => {
534
- const atStart = event.target.cursor[0] === 0 && event.target.cursor[1] === 0;
535
-
536
- // ── Ctrl+V / Cmd+V: native clipboard paste ───────────────────────────
537
- // Only handle when bracketed paste is NOT also firing (guard: key.paste not set)
538
- if (!event.key.paste) {
539
- const isCmdV = process.platform === "darwin" && event.key.super && event.input === "v";
540
- const isCtrlV =
541
- (process.platform !== "darwin" && event.key.ctrl && event.input === "v") ||
542
- (process.platform === "linux" &&
543
- event.key.ctrl &&
544
- event.key.shift &&
545
- event.input === "V");
546
- if (isCmdV || isCtrlV) {
547
- void handleClipboardPaste();
548
- event.preventDefault();
549
- return;
550
- }
551
- }
552
-
553
- // ── Bracketed paste (key.paste = true) ───────────────────────────────
554
- if (event.key.paste) {
555
- const rawText = event.input;
556
- // Normalize: strip trailing \r\n from drag-and-drop
557
- const text = rawText.replace(/[\r\n]+$/, "");
558
-
559
- // 1. macOS temp screenshot path?
560
- const trimmedSeg = text.trim();
561
- if (isMacOSTempScreenshot(trimmedSeg)) {
562
- const copied = copyTempScreenshotToProject(trimmedSeg);
563
- if (copied) {
564
- const pretty = prettifyMentionPath(copied);
565
- const escaped = escapePathForMention(pretty);
566
- bufferRef.current?.insert(`@${escaped} `);
567
- void attachImageFromPath(copied);
568
- event.preventDefault();
569
- return;
570
- }
571
- }
572
-
573
- // 2. Try file path detection
574
- const paths = parsePastedPaths(text.trim());
575
- if (paths) {
576
- bufferRef.current?.insert(paths);
577
- event.preventDefault();
578
- return;
579
- }
580
-
581
- // 3. Check OS clipboard for image (e.g. GNOME sends 0x16 / SYN)
582
- void (async () => {
583
- if (await clipboardHasImage()) {
584
- const saved = await saveClipboardImage(process.cwd());
585
- if (saved) {
586
- const pretty = prettifyMentionPath(saved);
587
- const escaped = escapePathForMention(pretty);
588
- bufferRef.current?.insert(`@${escaped} `);
589
- await attachImageFromPath(saved);
590
- return;
591
- }
592
- }
593
- // 4. Regular text paste — large-paste detection handled by TextBuffer
594
- bufferRef.current?.insert(text, { isPaste: true });
595
- })();
596
- event.preventDefault();
597
- return;
598
- }
599
-
600
- // ── Non-bracketed paste debounce (terminals without BP support) ───────
601
- // Multi-char input arriving rapidly without key.paste is likely a paste
602
- if (event.input.length > 3 && !event.key.ctrl && !event.key.meta && !event.key.paste) {
603
- nonBpAccumRef.current.text += event.input;
604
- if (nonBpAccumRef.current.timer) clearTimeout(nonBpAccumRef.current.timer);
605
- nonBpAccumRef.current.timer = setTimeout(() => {
606
- const accumulated = nonBpAccumRef.current.text;
607
- nonBpAccumRef.current = { text: "", timer: null };
608
- const paths = parsePastedPaths(accumulated.trim());
609
- if (paths) {
610
- bufferRef.current?.insert(paths);
611
- return;
612
- }
613
- bufferRef.current?.insert(accumulated, { isPaste: true });
614
- }, 50);
615
- event.preventDefault();
616
- return;
617
- }
618
-
619
- // Handle editing queued message with up arrow in Prompt mode
620
- // Only triggers when buffer is empty (cursor already at top edge)
621
- if (
622
- mode === ComposerMode.Prompt &&
623
- event.key.upArrow &&
624
- event.target.visualCursor[0] === 0 &&
625
- queuedMessages.length > 0 &&
626
- prompt.trim() === ""
627
- ) {
628
- const queuedMessage = queuedMessages[0];
629
- bufferRef.current?.setText(queuedMessage);
630
- clearQueue();
631
- event.preventDefault();
632
- return;
633
- }
634
-
635
- if (currentHandler?.shouldPreventDefault) {
636
- if (currentHandler.shouldPreventDefault(event.input || "", event.key)) {
637
- event.preventDefault();
638
- return;
639
- }
640
- }
641
-
642
- // Handle prompt history navigation for Prompt/Help/Files modes.
643
- // Only trigger when the cursor is at the extreme edge of the buffer:
644
- // Up arrow → only when cursor is on the first visual line (top of buffer)
645
- // Down arrow → only when cursor is on the last visual line (bottom of buffer)
646
- const usesPromptHistory =
647
- mode === ComposerMode.Prompt || mode === ComposerMode.Help || mode === ComposerMode.Files;
648
-
649
- if (usesPromptHistory && (event.key.upArrow || event.key.downArrow)) {
650
- const buf = event.target;
651
- const atTopEdge = buf.visualCursor[0] === 0;
652
- const atBottomEdge = buf.visualCursor[0] >= buf.allVisualLines.length - 1;
653
-
654
- if (event.key.upArrow && atTopEdge) {
655
- // Save current text as draft before first navigation
656
- if (promptHistory.getEntries().length > 0) {
657
- const currentText = prompt;
658
- const testEntry = promptHistory.navigateUp();
659
- if (testEntry) {
660
- if (draftRef.current === "" && currentText.trim() !== "") {
661
- draftRef.current = currentText;
662
- }
663
- bufferRef.current?.setText(testEntry.message);
664
- event.preventDefault();
665
- return;
666
- }
667
- }
668
- } else if (event.key.downArrow && atBottomEdge) {
669
- const entry = promptHistory.navigateDown();
670
- if (entry) {
671
- bufferRef.current?.setText(entry.message);
672
- } else {
673
- // Past newest — restore draft
674
- bufferRef.current?.setText(draftRef.current);
675
- draftRef.current = "";
676
- }
677
- event.preventDefault();
678
- return;
679
- }
680
- }
681
-
682
- // Handle history navigation in bash mode — only at buffer edges
683
- if (mode === ComposerMode.Bash && bashNavigateHistory) {
684
- const buf = event.target;
685
- const bashAtTop = event.key.upArrow && buf.visualCursor[0] === 0;
686
- const bashAtBottom =
687
- event.key.downArrow && buf.visualCursor[0] >= buf.allVisualLines.length - 1;
688
- if (bashAtTop || bashAtBottom) {
689
- const historyCommand = bashNavigateHistory(event.key.upArrow ? "up" : "down");
690
- if (historyCommand !== null) {
691
- bufferRef.current?.setText(historyCommand);
692
- event.preventDefault();
693
- return;
694
- }
695
- }
696
- }
697
-
698
- if (atStart && event.key.backspace) {
699
- if (isWaitingForYoloConfirm) {
700
- resetToNormal();
701
- event.preventDefault();
702
- return;
703
- }
704
- if (mode !== ComposerMode.Prompt) {
705
- setMode(ComposerMode.Prompt);
706
- promptHistory.resetNavigation();
707
- draftRef.current = "";
708
- event.preventDefault();
709
- }
710
- return;
711
- }
712
-
713
- if (mode === ComposerMode.Prompt && event.key.shift && event.key.tab) {
714
- cycleAgentMode();
715
- event.preventDefault();
716
- return;
717
- }
718
-
719
- const trigger = MODE_TRIGGERS[event.input];
720
- if (trigger && (!trigger.atStartOnly || atStart)) {
721
- if (mode !== trigger.mode) {
722
- setMode(trigger.mode);
723
- }
724
- if (trigger.preventDefault && trigger.mode !== ComposerMode.Command) {
725
- event.preventDefault();
726
- }
727
- return;
728
- }
729
- },
730
- [
731
- mode,
732
- setMode,
733
- currentHandler,
734
- bashNavigateHistory,
735
- bufferRef,
736
- handleClipboardPaste,
737
- attachImageFromPath,
738
- queuedMessages,
739
- prompt,
740
- clearQueue,
741
- isWaitingForYoloConfirm,
742
- resetToNormal,
743
- cycleAgentMode,
744
- promptHistory,
745
- ],
746
- );
747
-
748
- const handleChange = useCallback(
749
- (text: string, buffer: any) => {
750
- const prevLen = prevTextLenRef.current;
751
- prevTextLenRef.current = text.length;
752
- setPrompt(text);
753
-
754
- // Clear temporary messages (like help) when user starts typing a regular message
755
- const trimmed = text.trim();
756
- const startsWithSlash = trimmed.startsWith("/");
757
- const isAgentBusy =
758
- agentStatus === AgentStatus.Submitted ||
759
- agentStatus === AgentStatus.Streaming ||
760
- agentStatus === AgentStatus.ExecutingTool ||
761
- agentStatus === AgentStatus.WaitingForToolPermission;
762
-
763
- if (text.length > 0 && !startsWithSlash && !isAgentBusy) {
764
- clearTempSegments();
765
- }
766
-
767
- const mention = getMentionAtCursor(text, buffer.cursor);
768
-
769
- // Auto-reset to Prompt mode when user deletes all text in trigger-based modes.
770
- // Only triggers when the buffer previously had content (prevLen > 0), i.e. user
771
- // backspaced to empty. Does NOT trigger when entering a mode on an already-empty
772
- // buffer (e.g. typing "!" switches to Bash with empty buffer — stays in Bash).
773
- if (
774
- trimmed.length === 0 &&
775
- prevLen > 0 &&
776
- (mode === ComposerMode.Command ||
777
- mode === ComposerMode.Bash ||
778
- mode === ComposerMode.Help)
779
- ) {
780
- setMode(ComposerMode.Prompt);
781
- return;
782
- }
783
-
784
- if (mention) {
785
- if (mode !== ComposerMode.Files) setMode(ComposerMode.Files);
786
- return;
787
- }
788
-
789
- if (mode === ComposerMode.Files) {
790
- if (!mention) {
791
- setMode(ComposerMode.Prompt);
792
- }
793
- return;
794
- }
795
-
796
- if (mode === ComposerMode.Help && trimmed.length > 0) {
797
- setMode(ComposerMode.Prompt);
798
- }
799
-
800
- if (startsWithSlash && mode !== ComposerMode.Command) {
801
- setMode(ComposerMode.Command);
802
- } else if (!startsWithSlash && mode === ComposerMode.Command && trimmed.length > 0) {
803
- setMode(ComposerMode.Prompt);
804
- }
805
- },
806
- [mode, setPrompt, setMode, clearTempSegments, agentStatus],
807
- );
808
-
809
- const handleSubmit = useCallback(
810
- async (value: string) => {
811
- const trimmed = value.trim();
812
- if (!trimmed.startsWith("/")) {
813
- const aliasMatch = commandRegistry.match(trimmed, mode);
814
- if (aliasMatch && (await commandRegistry.execute(aliasMatch))) {
815
- bufferRef.current?.setText("");
816
- clearAttachments();
817
- return;
818
- }
819
- }
820
-
821
- if (currentHandler?.onSubmit) {
822
- currentHandler.onSubmit(value);
823
- if (mode === ComposerMode.Bash) {
824
- // Clear the input after submitting bash command
825
- bufferRef.current?.setText("");
826
- setActivity(getActivity());
827
- } else if (mode === ComposerMode.Command) {
828
- setMode(ComposerMode.Prompt);
829
- }
830
- clearAttachments();
831
- return;
832
- }
833
-
834
- switch (mode) {
835
- case ComposerMode.Prompt:
836
- if (isLoggedIn === false) {
837
- addNotification("Not logged in. Use /login email@example.com to login.", "warning");
838
- return;
839
- }
840
-
841
- if (!networkOnline) {
842
- addNotification("You are offline — check your connection and try again.", "error");
843
- return;
844
- }
845
-
846
- const isAgentBusy =
847
- agentStatus === AgentStatus.Submitted ||
848
- agentStatus === AgentStatus.Streaming ||
849
- agentStatus === AgentStatus.ExecutingTool ||
850
- agentStatus === AgentStatus.WaitingForToolPermission;
851
-
852
- if (isAgentBusy) {
853
- const expanded = expandPlaceholders(value.trim());
854
- addToQueue(expanded);
855
- promptHistory.append(expanded);
856
- promptHistory.resetNavigation();
857
- draftRef.current = "";
858
- clearPlaceholders();
859
- bufferRef.current?.setText("");
860
- return;
861
- }
862
-
863
- // Fall back to the first available model when none is explicitly selected,
864
- // so the session never operates with an empty model string.
865
- const modelToUse = selectedModel || models[0]?.llmName || undefined;
866
-
867
- // Expand placeholder text with actual pasted content
868
- const finalMessage = expandPlaceholders(value);
869
-
870
- promptHistory.append(finalMessage);
871
- promptHistory.resetNavigation();
872
- draftRef.current = "";
873
-
874
- void sendMessage({ message: finalMessage, selectedModel: modelToUse });
875
- clearPlaceholders();
876
- clearAttachments();
877
- break;
878
- default:
879
- }
880
- },
881
- [
882
- mode,
883
- currentHandler,
884
- sendMessage,
885
- getActivity,
886
- setActivity,
887
- selectedModel,
888
- setMode,
889
- bufferRef,
890
- agentStatus,
891
- addToQueue,
892
- addNotification,
893
- attachments,
894
- clearAttachments,
895
- isLoggedIn,
896
- expandPlaceholders,
897
- clearPlaceholders,
898
- promptHistory,
899
- ],
900
- );
901
-
902
- const { color: modeColor, placeholder: modePlaceholder, prefix: modePrefix } = MODE_META[mode];
903
-
904
- // Clear placeholder text after first message has been sent
905
- const effectivePlaceholder = segmentsLength > 0 ? "" : modePlaceholder;
906
-
907
- const inputWidth = useMemo(() => {
908
- if (terminalWidth === undefined) return undefined;
909
- return Math.max(1, terminalWidth - 3);
910
- }, [terminalWidth]);
911
-
912
- const grammar = useMemo(() => buildMentionGrammar(), []);
913
- const effectiveActivity = mode === ComposerMode.Bash ? getActivity() : activity;
914
- const isInputDisabled =
915
- effectiveActivity === "pending" || agentStatus === AgentStatus.WaitingForToolPermission;
916
-
917
- const pathText = (
918
- <Text wrap="truncate-middle" color="yellowBright">
919
- {abbreviateHome(process.cwd())}
920
- </Text>
921
- );
922
-
923
- const statusAndPath = (
924
- <View flexDirection="row" gap={1} justifyContent="flex-end">
925
- {isLoggedIn === false && <Text dimColor>Not logged in</Text>}
926
- {pathText}
927
- </View>
928
- );
929
-
930
- return (
931
- <View flexDirection="column">
932
- {queuedMessages.length > 0 ? (
933
- <MessageQueue pathElement={statusAndPath} />
934
- ) : (
935
- <View justifyContent="flex-end">{statusAndPath}</View>
936
- )}
937
- <View
938
- borderStyle="single"
939
- borderLeft={false}
940
- borderRight={false}
941
- borderColor={modeColor}
942
- borderDimColor
943
- flexDirection="row"
944
- gap={1}
945
- >
946
- <Text color={modeColor}>{modePrefix}</Text>
947
- <Input
948
- ref={bufferRef}
949
- onChange={handleChange}
950
- onKeyDown={handleKeyDown}
951
- onSubmit={handleSubmit}
952
- placeholder={effectivePlaceholder}
953
- grammar={grammar}
954
- disabled={isInputDisabled}
955
- width={inputWidth}
956
- />
957
- </View>
958
- <View justifyContent="space-between">
959
- <ModePanel
960
- mode={mode}
961
- prompt={prompt}
962
- handler={currentHandler}
963
- onExitFilesMode={() => setMode(ComposerMode.Prompt)}
964
- hints={hints}
965
- availableHeight={availableHeight}
966
- />
967
- <View flexDirection="row" gap={1}>
968
- {currentFile && selectionStartLine !== undefined && selectionEndLine !== undefined ? (
969
- <Text dimColor>
970
- <Text color="cyan">{selectionEndLine - selectionStartLine + 1} lines selected</Text>{" "}
971
- in <Text color="cyan">{currentFile}</Text>
972
- </Text>
973
- ) : (
974
- currentFile && (
975
- <Text dimColor>
976
- in <Text color="cyan">{currentFile}</Text>
977
- </Text>
978
- )
979
- )}
980
- {hints?.escClear && (
981
- <Text wrap="truncate-middle" dimColor>
982
- Press ESC again to clear input
983
- </Text>
984
- )}
985
- </View>
986
- </View>
987
- </View>
988
- );
989
- },
990
- );
991
- ComposerInner.displayName = "ComposerInner";
992
-
993
- interface ComposerProps {
994
- hints?: InterruptHints;
995
- composerRef?: Ref<ComposerHandle>;
996
- }
997
-
998
- export const Composer = memo(({ hints, composerRef }: ComposerProps) => {
999
- return (
1000
- <ComposerProvider>
1001
- <Suspense fallback={<Text dimColor>Loading models...</Text>}>
1002
- <ComposerInner hints={hints} composerRef={composerRef} />
1003
- </Suspense>
1004
- </ComposerProvider>
1005
- );
1006
- });
1007
- Composer.displayName = "Composer";