@abacus-ai/cli 2.0.0-canary.1 → 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.
- package/dist/index.mjs +448 -422
- package/package.json +4 -1
- package/.oxlintrc.json +0 -8
- package/resources/abacus.ico +0 -0
- package/resources/entitlements.plist +0 -9
- package/src/__e2e__/README.md +0 -196
- package/src/__e2e__/agent-interactions.e2e.test.tsx +0 -61
- package/src/__e2e__/cli-commands.e2e.test.tsx +0 -77
- package/src/__e2e__/conversation-throttle.e2e.test.ts +0 -453
- package/src/__e2e__/conversation.e2e.test.tsx +0 -56
- package/src/__e2e__/diff-preview.e2e.test.tsx +0 -3399
- package/src/__e2e__/file-creation.e2e.test.tsx +0 -149
- package/src/__e2e__/helpers/test-helpers.ts +0 -449
- package/src/__e2e__/keyboard-navigation.e2e.test.tsx +0 -34
- package/src/__e2e__/llm-models.e2e.test.ts +0 -402
- package/src/__e2e__/mcp/mcp-callback-flow.e2e.test.tsx +0 -71
- package/src/__e2e__/mcp/mcp-full-app-ui.e2e.test.tsx +0 -167
- package/src/__e2e__/mcp/mcp-ui-rendering.e2e.test.tsx +0 -185
- package/src/__e2e__/repl.e2e.test.tsx +0 -78
- package/src/__e2e__/shell-compatibility.e2e.test.tsx +0 -76
- package/src/__e2e__/theme-mcp.e2e.test.tsx +0 -98
- package/src/__e2e__/tool-permissions.e2e.test.tsx +0 -66
- package/src/args.ts +0 -22
- package/src/components/__tests__/react-compiler.test.tsx +0 -78
- package/src/components/__tests__/status-indicator.test.tsx +0 -403
- package/src/components/composer/__tests__/bash-runner.test.tsx +0 -263
- package/src/components/composer/agent-mode-indicator.tsx +0 -63
- package/src/components/composer/bash-runner.tsx +0 -54
- package/src/components/composer/commands/default-commands.tsx +0 -615
- package/src/components/composer/commands/handler.tsx +0 -59
- package/src/components/composer/commands/picker.tsx +0 -273
- package/src/components/composer/commands/registry.ts +0 -233
- package/src/components/composer/commands/types.ts +0 -33
- package/src/components/composer/context.tsx +0 -88
- package/src/components/composer/file-mention-picker.tsx +0 -83
- package/src/components/composer/help.tsx +0 -44
- package/src/components/composer/index.tsx +0 -1007
- package/src/components/composer/mentions.ts +0 -57
- package/src/components/composer/message-queue.tsx +0 -70
- package/src/components/composer/mode-panel.tsx +0 -35
- package/src/components/composer/modes/__tests__/bash-handler.test.tsx +0 -755
- package/src/components/composer/modes/__tests__/bash-renderer.test.tsx +0 -1108
- package/src/components/composer/modes/bash-handler.tsx +0 -132
- package/src/components/composer/modes/bash-renderer.tsx +0 -175
- package/src/components/composer/modes/default-handlers.tsx +0 -33
- package/src/components/composer/modes/index.ts +0 -41
- package/src/components/composer/modes/types.ts +0 -21
- package/src/components/composer/persistent-shell.ts +0 -283
- package/src/components/composer/process.ts +0 -65
- package/src/components/composer/types.ts +0 -9
- package/src/components/composer/use-mention-search.ts +0 -68
- package/src/components/error-boundry.tsx +0 -60
- package/src/components/exit-message.tsx +0 -29
- package/src/components/expanded-view.tsx +0 -74
- package/src/components/file-completion.tsx +0 -127
- package/src/components/header.tsx +0 -47
- package/src/components/logo.tsx +0 -37
- package/src/components/segments.tsx +0 -356
- package/src/components/status-indicator.tsx +0 -306
- package/src/components/tool-group-summary.tsx +0 -263
- package/src/components/tool-permissions/ask-user-question-permission-ui.tsx +0 -319
- package/src/components/tool-permissions/diff-preview.tsx +0 -359
- package/src/components/tool-permissions/index.ts +0 -5
- package/src/components/tool-permissions/permission-options.tsx +0 -401
- package/src/components/tool-permissions/permission-preview-header.tsx +0 -57
- package/src/components/tool-permissions/tool-permission-ui.tsx +0 -420
- package/src/components/tools/agent/ask-user-question.tsx +0 -107
- package/src/components/tools/agent/enter-plan-mode.tsx +0 -55
- package/src/components/tools/agent/exit-plan-mode.tsx +0 -83
- package/src/components/tools/agent/handoff-to-main.tsx +0 -27
- package/src/components/tools/agent/subagent.tsx +0 -37
- package/src/components/tools/agent/todo-write.tsx +0 -104
- package/src/components/tools/browser/close-tab.tsx +0 -58
- package/src/components/tools/browser/computer.tsx +0 -70
- package/src/components/tools/browser/get-interactive-elements.tsx +0 -54
- package/src/components/tools/browser/get-tab-content.tsx +0 -51
- package/src/components/tools/browser/navigate-to.tsx +0 -59
- package/src/components/tools/browser/new-tab.tsx +0 -60
- package/src/components/tools/browser/perform-action.tsx +0 -63
- package/src/components/tools/browser/refresh-tab.tsx +0 -43
- package/src/components/tools/browser/switch-tab.tsx +0 -58
- package/src/components/tools/filesystem/delete-file.tsx +0 -104
- package/src/components/tools/filesystem/edit.tsx +0 -220
- package/src/components/tools/filesystem/list-dir.tsx +0 -78
- package/src/components/tools/filesystem/read-file.tsx +0 -180
- package/src/components/tools/filesystem/upload-image.tsx +0 -76
- package/src/components/tools/ide/ide-diagnostics.tsx +0 -62
- package/src/components/tools/index.ts +0 -91
- package/src/components/tools/mcp/mcp-tool.tsx +0 -158
- package/src/components/tools/search/fetch-url.tsx +0 -73
- package/src/components/tools/search/file-search.tsx +0 -78
- package/src/components/tools/search/grep.tsx +0 -90
- package/src/components/tools/search/semantic-search.tsx +0 -66
- package/src/components/tools/search/web-search.tsx +0 -71
- package/src/components/tools/shared/index.tsx +0 -48
- package/src/components/tools/shared/zod-coercion.ts +0 -35
- package/src/components/tools/terminal/bash-tool-output.tsx +0 -188
- package/src/components/tools/terminal/get-terminal-output.tsx +0 -91
- package/src/components/tools/terminal/run-in-terminal.tsx +0 -131
- package/src/components/tools/types.ts +0 -16
- package/src/components/tools.tsx +0 -68
- package/src/components/ui/__tests__/divider.test.tsx +0 -61
- package/src/components/ui/__tests__/gradient.test.tsx +0 -125
- package/src/components/ui/__tests__/input.test.tsx +0 -166
- package/src/components/ui/__tests__/select.test.tsx +0 -273
- package/src/components/ui/__tests__/shimmer.test.tsx +0 -99
- package/src/components/ui/blinking-indicator.tsx +0 -27
- package/src/components/ui/divider.tsx +0 -162
- package/src/components/ui/gradient.tsx +0 -56
- package/src/components/ui/input.tsx +0 -228
- package/src/components/ui/select.tsx +0 -151
- package/src/components/ui/shimmer.tsx +0 -76
- package/src/context/agent-mode.tsx +0 -95
- package/src/context/extension-file.tsx +0 -136
- package/src/context/network-activity.tsx +0 -45
- package/src/context/notification.tsx +0 -62
- package/src/context/shell-size.tsx +0 -49
- package/src/context/shell-title.tsx +0 -38
- package/src/entrypoints/print-mode.ts +0 -312
- package/src/entrypoints/repl.tsx +0 -389
- package/src/hooks/use-agent.ts +0 -15
- package/src/hooks/use-api-client.ts +0 -1
- package/src/hooks/use-available-height.ts +0 -8
- package/src/hooks/use-cleanup.ts +0 -29
- package/src/hooks/use-interrupt-manager.ts +0 -242
- package/src/hooks/use-models.ts +0 -22
- package/src/index.ts +0 -217
- package/src/lib/__tests__/ansi.test.ts +0 -255
- package/src/lib/__tests__/cli.test.ts +0 -122
- package/src/lib/__tests__/commands.test.ts +0 -325
- package/src/lib/__tests__/constants.test.ts +0 -15
- package/src/lib/__tests__/focusables.test.ts +0 -25
- package/src/lib/__tests__/fs.test.ts +0 -231
- package/src/lib/__tests__/markdown.test.tsx +0 -348
- package/src/lib/__tests__/mcpCommandHandler.test.ts +0 -173
- package/src/lib/__tests__/mcpManagement.test.ts +0 -38
- package/src/lib/__tests__/path-paste.test.ts +0 -144
- package/src/lib/__tests__/path.test.ts +0 -300
- package/src/lib/__tests__/queries.test.ts +0 -39
- package/src/lib/__tests__/standaloneMcpService.test.ts +0 -71
- package/src/lib/__tests__/text-buffer.test.ts +0 -328
- package/src/lib/__tests__/text-utils.test.ts +0 -32
- package/src/lib/__tests__/timing.test.ts +0 -78
- package/src/lib/__tests__/utils.test.ts +0 -238
- package/src/lib/__tests__/vim-buffer-actions.test.ts +0 -154
- package/src/lib/ansi.ts +0 -150
- package/src/lib/cli-push-server.ts +0 -112
- package/src/lib/cli.ts +0 -44
- package/src/lib/clipboard.ts +0 -226
- package/src/lib/command-utils.ts +0 -93
- package/src/lib/commands.ts +0 -270
- package/src/lib/constants.ts +0 -3
- package/src/lib/extension-connection.ts +0 -181
- package/src/lib/focusables.ts +0 -7
- package/src/lib/fs.ts +0 -533
- package/src/lib/markdown/code-block.tsx +0 -63
- package/src/lib/markdown/index.ts +0 -4
- package/src/lib/markdown/link.tsx +0 -19
- package/src/lib/markdown/markdown.tsx +0 -372
- package/src/lib/markdown/types.ts +0 -15
- package/src/lib/mcpCommandHandler.ts +0 -121
- package/src/lib/mcpManagement.ts +0 -44
- package/src/lib/path-paste.ts +0 -185
- package/src/lib/path.ts +0 -179
- package/src/lib/queries.ts +0 -15
- package/src/lib/standaloneMcpService.ts +0 -688
- package/src/lib/status-utils.ts +0 -237
- package/src/lib/test-utils.tsx +0 -72
- package/src/lib/text-buffer.ts +0 -2415
- package/src/lib/text-utils.ts +0 -272
- package/src/lib/timing.ts +0 -63
- package/src/lib/types.ts +0 -295
- package/src/lib/utils.ts +0 -182
- package/src/lib/vim-buffer-actions.ts +0 -732
- package/src/providers/agent.tsx +0 -1063
- package/src/providers/api-client.tsx +0 -43
- package/src/services/logger.ts +0 -85
- package/src/terminal/detection.ts +0 -187
- package/src/terminal/exit.ts +0 -279
- package/src/terminal/notification.ts +0 -83
- package/src/terminal/progress.ts +0 -201
- package/src/terminal/setup.ts +0 -797
- package/src/terminal/types.ts +0 -51
- package/src/theme/context.tsx +0 -57
- package/src/theme/index.ts +0 -4
- package/src/theme/themed.tsx +0 -35
- package/src/theme/themes.json +0 -546
- package/src/theme/types.ts +0 -110
- package/src/tools/types.ts +0 -59
- package/src/tools/utils/__tests__/zod-coercion.test.ts +0 -33
- package/src/tools/utils/tool-ui-components.tsx +0 -649
- package/src/tools/utils/zod-coercion.ts +0 -35
- package/tsconfig.json +0 -16
- package/tsconfig.node.json +0 -29
- package/tsconfig.test.json +0 -27
- package/tsdown.config.ts +0 -17
- package/vitest.config.ts +0 -76
package/src/lib/utils.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
|
|
3
|
-
export function clamp(value: number, min: number, max: number): number {
|
|
4
|
-
return Math.max(min, Math.min(value, max));
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function deepClone<T>(obj: T): T {
|
|
8
|
-
if (!obj || typeof obj !== "object") {
|
|
9
|
-
return obj;
|
|
10
|
-
}
|
|
11
|
-
if (obj instanceof RegExp) {
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
const result: any = Array.isArray(obj) ? [] : {};
|
|
15
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
16
|
-
result[key] = value && typeof value === "object" ? deepClone(value) : value;
|
|
17
|
-
});
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function createDeferredPromise<T = void>() {
|
|
22
|
-
let resolve: (value: T) => void;
|
|
23
|
-
let reject: (reason?: any) => void;
|
|
24
|
-
|
|
25
|
-
const promise = new Promise<T>((res, rej) => {
|
|
26
|
-
resolve = res;
|
|
27
|
-
reject = rej;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
promise,
|
|
32
|
-
resolve: resolve!,
|
|
33
|
-
reject: reject!,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type SegmentContent = string | { segment: string };
|
|
38
|
-
|
|
39
|
-
export function getSegmentContent(segment: SegmentContent | undefined): string | null {
|
|
40
|
-
if (typeof segment === "string") {
|
|
41
|
-
return segment;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (typeof segment === "object" && segment && "segment" in segment) {
|
|
45
|
-
return segment.segment;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function isWindows(): boolean {
|
|
52
|
-
return process.platform === "win32";
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get git information for the current workspace
|
|
57
|
-
* Returns current branch name and main branch name
|
|
58
|
-
*/
|
|
59
|
-
export interface GitInfo {
|
|
60
|
-
branch?: string;
|
|
61
|
-
main?: string;
|
|
62
|
-
status?: string;
|
|
63
|
-
commits?: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function getGitInfo(cwd: string): GitInfo {
|
|
67
|
-
const gitInfo: GitInfo = {};
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
// Get current branch
|
|
71
|
-
const branch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
72
|
-
cwd,
|
|
73
|
-
encoding: "utf8",
|
|
74
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
75
|
-
timeout: 5000,
|
|
76
|
-
}).trim();
|
|
77
|
-
gitInfo.branch = branch;
|
|
78
|
-
} catch {
|
|
79
|
-
// Not a git repo or git not available
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
// Get main branch name - try common names
|
|
84
|
-
// First check if there's a default branch configured
|
|
85
|
-
let mainBranch: string | undefined;
|
|
86
|
-
|
|
87
|
-
// Try to get the default branch from remote
|
|
88
|
-
try {
|
|
89
|
-
const remoteBranch = execSync("git symbolic-ref refs/remotes/origin/HEAD", {
|
|
90
|
-
cwd,
|
|
91
|
-
encoding: "utf8",
|
|
92
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
93
|
-
timeout: 5000,
|
|
94
|
-
}).trim();
|
|
95
|
-
// Extract branch name from refs/remotes/origin/HEAD -> refs/remotes/origin/main
|
|
96
|
-
mainBranch = remoteBranch.split("/").pop();
|
|
97
|
-
} catch {
|
|
98
|
-
// If that fails, check which of the common branch names exists
|
|
99
|
-
const commonNames = ["main", "master", "develop"];
|
|
100
|
-
for (const name of commonNames) {
|
|
101
|
-
try {
|
|
102
|
-
execSync(`git rev-parse --verify ${name}`, {
|
|
103
|
-
cwd,
|
|
104
|
-
encoding: "utf8",
|
|
105
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
106
|
-
timeout: 5000,
|
|
107
|
-
});
|
|
108
|
-
mainBranch = name;
|
|
109
|
-
break;
|
|
110
|
-
} catch {
|
|
111
|
-
// Branch doesn't exist, try next
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
gitInfo.main = mainBranch;
|
|
117
|
-
} catch {
|
|
118
|
-
// Ignore errors
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return gitInfo;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function getGitStatus(cwd: string): string | undefined {
|
|
125
|
-
try {
|
|
126
|
-
const status = execSync("git status --short", {
|
|
127
|
-
cwd,
|
|
128
|
-
encoding: "utf8",
|
|
129
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
130
|
-
timeout: 5000,
|
|
131
|
-
}).trim();
|
|
132
|
-
|
|
133
|
-
if (!status) {
|
|
134
|
-
return undefined;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const lines = status.split("\n");
|
|
138
|
-
const maxLines = 20;
|
|
139
|
-
const maxChars = 500;
|
|
140
|
-
|
|
141
|
-
let truncated = lines.slice(0, maxLines).join("\n");
|
|
142
|
-
if (lines.length > maxLines) {
|
|
143
|
-
truncated += `\n... (${lines.length - maxLines} more files)`;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (truncated.length > maxChars) {
|
|
147
|
-
truncated = truncated.substring(0, maxChars) + "...";
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return truncated;
|
|
151
|
-
} catch {
|
|
152
|
-
return undefined;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export function getGitCommits(cwd: string): string | undefined {
|
|
157
|
-
try {
|
|
158
|
-
const commits = execSync("git log -5 --oneline --no-decorate", {
|
|
159
|
-
cwd,
|
|
160
|
-
encoding: "utf8",
|
|
161
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
162
|
-
timeout: 5000,
|
|
163
|
-
}).trim();
|
|
164
|
-
|
|
165
|
-
if (!commits) {
|
|
166
|
-
return undefined;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const maxChars = 500;
|
|
170
|
-
if (commits.length > maxChars) {
|
|
171
|
-
return commits.substring(0, maxChars) + "...";
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return commits;
|
|
175
|
-
} catch {
|
|
176
|
-
return undefined;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export async function sleep(ms: number): Promise<void> {
|
|
181
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
182
|
-
}
|