deeper-cli 1.0.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.
- package/README.md +254 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +12067 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +415 -0
- package/dist/index.js +1599 -0
- package/dist/index.js.map +1 -0
- package/docs/superpowers/plans/2026-05-14-deepercode-implementation.md +24 -0
- package/docs/superpowers/plans/2026-05-14-deepercode-plan.md +1248 -0
- package/docs/superpowers/specs/2026-05-14-deepercode-design.md +560 -0
- package/package.json +60 -0
- package/src/cli/bootstrap.ts +69 -0
- package/src/cli/chat-repl.ts +932 -0
- package/src/cli/commands/chat.ts +39 -0
- package/src/cli/commands/chat.tsx +39 -0
- package/src/cli/commands/config.ts +133 -0
- package/src/cli/commands/mcp.ts +172 -0
- package/src/cli/commands/run.ts +147 -0
- package/src/cli/commands/skill.ts +152 -0
- package/src/cli/index.ts +184 -0
- package/src/core/bugscan.ts +145 -0
- package/src/core/config.ts +285 -0
- package/src/core/constants.ts +49 -0
- package/src/core/eventbus.ts +202 -0
- package/src/core/logger.ts +109 -0
- package/src/core/storage.ts +96 -0
- package/src/index.ts +26 -0
- package/src/mcp/ConfigLoader.ts +74 -0
- package/src/mcp/MCPClient.ts +326 -0
- package/src/mcp/ResourceAdapter.ts +58 -0
- package/src/mcp/SSETransport.ts +133 -0
- package/src/mcp/StdioTransport.ts +116 -0
- package/src/mcp/ToolAdapter.ts +71 -0
- package/src/mcp/types.ts +58 -0
- package/src/memory/xmemory.ts +275 -0
- package/src/model/DeepSeekClient.ts +292 -0
- package/src/model/MessageBuilder.ts +155 -0
- package/src/model/RetryManager.ts +82 -0
- package/src/model/StreamHandler.ts +158 -0
- package/src/model/types.ts +86 -0
- package/src/skills/SkillCreator.ts +153 -0
- package/src/skills/SkillEngine.ts +158 -0
- package/src/skills/SkillExecutor.ts +107 -0
- package/src/skills/SkillLoader.ts +182 -0
- package/src/skills/SkillRegistry.ts +73 -0
- package/src/skills/SkillTrigger.ts +82 -0
- package/src/skills/types.ts +28 -0
- package/src/tools/ToolExecutor.ts +103 -0
- package/src/tools/ToolRegistry.ts +71 -0
- package/src/tools/ToolValidator.ts +103 -0
- package/src/tools/builtin/ai/context_summarize.ts +76 -0
- package/src/tools/builtin/ai/memory_store.ts +86 -0
- package/src/tools/builtin/ai/prompt_template.ts +71 -0
- package/src/tools/builtin/ai/skill_create.ts +53 -0
- package/src/tools/builtin/ai/subagent.ts +39 -0
- package/src/tools/builtin/ai/todo_manager.ts +157 -0
- package/src/tools/builtin/ai/token_count.ts +196 -0
- package/src/tools/builtin/ai/tool_create.ts +52 -0
- package/src/tools/builtin/code/analyze_deps.ts +72 -0
- package/src/tools/builtin/code/bug_scan.ts +80 -0
- package/src/tools/builtin/code/code_metrics.ts +111 -0
- package/src/tools/builtin/code/extract_function.ts +86 -0
- package/src/tools/builtin/code/format_code.ts +57 -0
- package/src/tools/builtin/code/generate_code.ts +75 -0
- package/src/tools/builtin/code/import_organizer.ts +82 -0
- package/src/tools/builtin/code/lint_code.ts +48 -0
- package/src/tools/builtin/code/parse_ast.ts +86 -0
- package/src/tools/builtin/code/refactor_code.ts +63 -0
- package/src/tools/builtin/code/type_check.ts +48 -0
- package/src/tools/builtin/data/chart_generate.ts +62 -0
- package/src/tools/builtin/data/csv_parse.ts +56 -0
- package/src/tools/builtin/data/data_diff.ts +79 -0
- package/src/tools/builtin/data/data_transform.ts +74 -0
- package/src/tools/builtin/data/data_validate.ts +75 -0
- package/src/tools/builtin/data/json_parse.ts +71 -0
- package/src/tools/builtin/data/template_render.ts +58 -0
- package/src/tools/builtin/data/toml_parse.ts +42 -0
- package/src/tools/builtin/data/xml_parse.ts +79 -0
- package/src/tools/builtin/data/yaml_parse.ts +42 -0
- package/src/tools/builtin/database/db_backup.ts +53 -0
- package/src/tools/builtin/database/db_restore.ts +51 -0
- package/src/tools/builtin/database/db_schema.ts +66 -0
- package/src/tools/builtin/database/nosql_query.ts +50 -0
- package/src/tools/builtin/database/orm_generate.ts +66 -0
- package/src/tools/builtin/database/redis_command.ts +46 -0
- package/src/tools/builtin/database/sql_migrate.ts +55 -0
- package/src/tools/builtin/database/sql_query.ts +60 -0
- package/src/tools/builtin/filesystem/batch_read.ts +56 -0
- package/src/tools/builtin/filesystem/batch_write.ts +67 -0
- package/src/tools/builtin/filesystem/copy_file.ts +36 -0
- package/src/tools/builtin/filesystem/create_dir.ts +30 -0
- package/src/tools/builtin/filesystem/delete_file.ts +30 -0
- package/src/tools/builtin/filesystem/diff_files.ts +47 -0
- package/src/tools/builtin/filesystem/edit_file.ts +47 -0
- package/src/tools/builtin/filesystem/file_info.ts +52 -0
- package/src/tools/builtin/filesystem/glob_find.ts +44 -0
- package/src/tools/builtin/filesystem/list_dir.ts +51 -0
- package/src/tools/builtin/filesystem/merge_files.ts +44 -0
- package/src/tools/builtin/filesystem/move_file.ts +37 -0
- package/src/tools/builtin/filesystem/read_file.ts +55 -0
- package/src/tools/builtin/filesystem/watch_file.ts +33 -0
- package/src/tools/builtin/filesystem/write_file.ts +45 -0
- package/src/tools/builtin/index.ts +244 -0
- package/src/tools/builtin/network/api_call.ts +79 -0
- package/src/tools/builtin/network/browser_action.ts +54 -0
- package/src/tools/builtin/network/check_url.ts +59 -0
- package/src/tools/builtin/network/download_file.ts +64 -0
- package/src/tools/builtin/network/graphql_query.ts +46 -0
- package/src/tools/builtin/network/http_request.ts +61 -0
- package/src/tools/builtin/network/parse_html.ts +101 -0
- package/src/tools/builtin/network/proxy_request.ts +53 -0
- package/src/tools/builtin/network/screenshot_page.ts +58 -0
- package/src/tools/builtin/network/web_fetch.ts +70 -0
- package/src/tools/builtin/network/web_search.ts +128 -0
- package/src/tools/builtin/network/websocket_connect.ts +70 -0
- package/src/tools/builtin/project/build_project.ts +68 -0
- package/src/tools/builtin/project/config_manage.ts +99 -0
- package/src/tools/builtin/project/coverage_report.ts +59 -0
- package/src/tools/builtin/project/docker_manage.ts +90 -0
- package/src/tools/builtin/project/env_manage.ts +88 -0
- package/src/tools/builtin/project/npm_manage.ts +71 -0
- package/src/tools/builtin/project/project_init.ts +59 -0
- package/src/tools/builtin/project/run_test.ts +74 -0
- package/src/tools/builtin/search/codebase_search.ts +76 -0
- package/src/tools/builtin/search/find_definition.ts +84 -0
- package/src/tools/builtin/search/find_references.ts +75 -0
- package/src/tools/builtin/search/fuzzy_find.ts +75 -0
- package/src/tools/builtin/search/grep_search.ts +90 -0
- package/src/tools/builtin/search/regex_find.ts +91 -0
- package/src/tools/builtin/search/search_docs.ts +51 -0
- package/src/tools/builtin/search/search_package.ts +50 -0
- package/src/tools/builtin/search/symbol_search.ts +82 -0
- package/src/tools/builtin/search/text_search.ts +63 -0
- package/src/tools/builtin/security/decrypt_file.ts +54 -0
- package/src/tools/builtin/security/encrypt_file.ts +52 -0
- package/src/tools/builtin/security/hash_generate.ts +48 -0
- package/src/tools/builtin/security/jwt_decode.ts +53 -0
- package/src/tools/builtin/security/secret_scan.ts +82 -0
- package/src/tools/builtin/security/vulnerability_check.ts +71 -0
- package/src/tools/builtin/shell/background_terminal.ts +38 -0
- package/src/tools/builtin/shell/check_status.ts +48 -0
- package/src/tools/builtin/shell/interactive_terminal.ts +31 -0
- package/src/tools/builtin/shell/kill_terminal.ts +29 -0
- package/src/tools/builtin/shell/list_terminals.ts +61 -0
- package/src/tools/builtin/shell/pipe_commands.ts +55 -0
- package/src/tools/builtin/shell/process-pool.ts +150 -0
- package/src/tools/builtin/shell/run_async.ts +73 -0
- package/src/tools/builtin/shell/run_command.ts +60 -0
- package/src/tools/builtin/shell/send_ctrl_keys.ts +43 -0
- package/src/tools/builtin/shell/send_keys.ts +36 -0
- package/src/tools/builtin/shell/send_text.ts +35 -0
- package/src/tools/builtin/shell/shell_script.ts +65 -0
- package/src/tools/builtin/shell/stop_command.ts +40 -0
- package/src/tools/builtin/shell/terminal_resize.ts +31 -0
- package/src/tools/builtin/shell/terminal_screenshot.ts +28 -0
- package/src/tools/builtin/system/log_viewer.ts +89 -0
- package/src/tools/builtin/system/notify_user.ts +55 -0
- package/src/tools/builtin/system/process_list.ts +66 -0
- package/src/tools/builtin/system/resource_monitor.ts +66 -0
- package/src/tools/builtin/system/system_info.ts +41 -0
- package/src/tools/tool-types.ts +97 -0
- package/src/ui/AgentTree.tsx +98 -0
- package/src/ui/App.tsx +46 -0
- package/src/ui/ChatView.tsx +278 -0
- package/src/ui/ConfirmDialog.tsx +68 -0
- package/src/ui/DiffView.tsx +64 -0
- package/src/ui/FilePreview.tsx +59 -0
- package/src/ui/InputBox.tsx +267 -0
- package/src/ui/MessageBubble.tsx +30 -0
- package/src/ui/Spinner.tsx +35 -0
- package/src/ui/StatusBar.tsx +41 -0
- package/src/ui/ToolCallCard.tsx +73 -0
- package/src/ui/ansi.ts +50 -0
- package/src/ui/markdown.ts +238 -0
- package/src/ui/themes/dark.ts +4 -0
- package/src/ui/themes/default.ts +25 -0
- package/src/ui/themes/light.ts +14 -0
- package/tests/unit/BuiltinTools.test.ts +129 -0
- package/tests/unit/BuiltinToolsIntegration.test.ts +111 -0
- package/tests/unit/FilesystemTools.test.ts +211 -0
- package/tests/unit/SkillLoader.test.ts +141 -0
- package/tests/unit/SkillRegistry.test.ts +113 -0
- package/tests/unit/ToolExecutor.test.ts +160 -0
- package/tests/unit/ToolRegistry.test.ts +103 -0
- package/tests/unit/ToolValidator.test.ts +137 -0
- package/tsconfig.json +28 -0
- package/tsup.config.ts +17 -0
- package/vitest.config.ts +20 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
|
|
4
|
+
interface Theme {
|
|
5
|
+
primary: string;
|
|
6
|
+
secondary: string;
|
|
7
|
+
success: string;
|
|
8
|
+
warning: string;
|
|
9
|
+
error: string;
|
|
10
|
+
text: string;
|
|
11
|
+
dimText: string;
|
|
12
|
+
border: string;
|
|
13
|
+
background: string;
|
|
14
|
+
cardBackground: string;
|
|
15
|
+
}
|
|
16
|
+
declare const defaultTheme: Theme;
|
|
17
|
+
|
|
18
|
+
declare const darkTheme: Theme;
|
|
19
|
+
|
|
20
|
+
declare const lightTheme: Theme;
|
|
21
|
+
|
|
22
|
+
interface SpinnerProps {
|
|
23
|
+
label?: string;
|
|
24
|
+
type?: 'dots' | 'line' | 'braille';
|
|
25
|
+
}
|
|
26
|
+
declare function Spinner({ label, type }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
interface Props {
|
|
29
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
30
|
+
content: string | null;
|
|
31
|
+
thinking?: string;
|
|
32
|
+
timestamp?: number;
|
|
33
|
+
}
|
|
34
|
+
declare function MessageBubble({ role, content }: Props): react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
interface ToolCallCardProps {
|
|
37
|
+
toolName: string;
|
|
38
|
+
args: Record<string, unknown>;
|
|
39
|
+
result?: string;
|
|
40
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
41
|
+
}
|
|
42
|
+
declare function ToolCallCard({ toolName, args, result, status }: ToolCallCardProps): react_jsx_runtime.JSX.Element;
|
|
43
|
+
|
|
44
|
+
interface DiffViewProps {
|
|
45
|
+
filePath: string;
|
|
46
|
+
oldContent: string;
|
|
47
|
+
newContent: string;
|
|
48
|
+
}
|
|
49
|
+
declare function DiffView({ filePath, oldContent, newContent }: DiffViewProps): react_jsx_runtime.JSX.Element;
|
|
50
|
+
|
|
51
|
+
interface FilePreviewProps {
|
|
52
|
+
filePath: string;
|
|
53
|
+
content?: string;
|
|
54
|
+
language?: string;
|
|
55
|
+
lineCount?: number;
|
|
56
|
+
size?: number;
|
|
57
|
+
}
|
|
58
|
+
declare function FilePreview({ filePath, content, language, lineCount, size }: FilePreviewProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
interface AgentNode {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
status: 'idle' | 'running' | 'completed' | 'failed';
|
|
64
|
+
children?: AgentNode[];
|
|
65
|
+
}
|
|
66
|
+
interface AgentTreeProps {
|
|
67
|
+
agents: AgentNode[];
|
|
68
|
+
}
|
|
69
|
+
declare function AgentTree({ agents }: AgentTreeProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
interface ConfirmDialogProps {
|
|
72
|
+
message: string;
|
|
73
|
+
detail?: string;
|
|
74
|
+
onConfirm: () => void;
|
|
75
|
+
onReject: () => void;
|
|
76
|
+
}
|
|
77
|
+
declare function ConfirmDialog({ message, detail, onConfirm, onReject }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
declare function StatusBar(): react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface InputBoxProps {
|
|
82
|
+
onSubmit: (content: string) => void;
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
}
|
|
85
|
+
declare function InputBox({ onSubmit, placeholder }: InputBoxProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface JSONSchema {
|
|
88
|
+
type: string;
|
|
89
|
+
properties?: Record<string, JSONSchema>;
|
|
90
|
+
required?: string[];
|
|
91
|
+
description?: string;
|
|
92
|
+
enum?: string[];
|
|
93
|
+
items?: JSONSchema;
|
|
94
|
+
additionalProperties?: boolean;
|
|
95
|
+
}
|
|
96
|
+
interface ToolParameter {
|
|
97
|
+
name: string;
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
required: boolean;
|
|
101
|
+
default?: unknown;
|
|
102
|
+
enum?: string[];
|
|
103
|
+
}
|
|
104
|
+
interface ToolDefinition {
|
|
105
|
+
name: string;
|
|
106
|
+
description: string;
|
|
107
|
+
category: string;
|
|
108
|
+
parameters: JSONSchema;
|
|
109
|
+
dangerous?: boolean;
|
|
110
|
+
requiresApproval?: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface ToolResult {
|
|
113
|
+
success: boolean;
|
|
114
|
+
output: string;
|
|
115
|
+
error?: string;
|
|
116
|
+
metadata?: Record<string, unknown>;
|
|
117
|
+
}
|
|
118
|
+
interface ToolExecutor {
|
|
119
|
+
execute(params: Record<string, unknown>, signal?: AbortSignal): Promise<ToolResult>;
|
|
120
|
+
}
|
|
121
|
+
type Tool = ToolDefinition & ToolExecutor;
|
|
122
|
+
interface ToolCall {
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
arguments: Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
interface ToolCallResult {
|
|
128
|
+
callId: string;
|
|
129
|
+
result: ToolResult;
|
|
130
|
+
timestamp: number;
|
|
131
|
+
}
|
|
132
|
+
type ToolSafetyLevel = 'safe' | 'confirm' | 'dangerous';
|
|
133
|
+
declare const TOOL_SAFETY_MAP: Record<string, ToolSafetyLevel>;
|
|
134
|
+
|
|
135
|
+
interface ChatMessage {
|
|
136
|
+
id?: string;
|
|
137
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
138
|
+
content: string | null;
|
|
139
|
+
tool_calls?: ToolCall[];
|
|
140
|
+
toolCalls?: ToolCallRecord[];
|
|
141
|
+
tool_call_id?: string;
|
|
142
|
+
name?: string;
|
|
143
|
+
thinking?: string;
|
|
144
|
+
timestamp?: number;
|
|
145
|
+
}
|
|
146
|
+
interface StreamChunk {
|
|
147
|
+
type: 'text' | 'thinking' | 'tool_call' | 'done' | 'error';
|
|
148
|
+
content?: string;
|
|
149
|
+
tool_call?: ToolCall;
|
|
150
|
+
error?: string;
|
|
151
|
+
}
|
|
152
|
+
interface ToolCallRecord {
|
|
153
|
+
id: string;
|
|
154
|
+
name: string;
|
|
155
|
+
arguments: Record<string, unknown>;
|
|
156
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
157
|
+
result?: string;
|
|
158
|
+
}
|
|
159
|
+
interface AgentInfo {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
status: 'idle' | 'running' | 'completed' | 'failed';
|
|
163
|
+
task: string;
|
|
164
|
+
children?: AgentInfo[];
|
|
165
|
+
}
|
|
166
|
+
interface SlashCommand {
|
|
167
|
+
command: string;
|
|
168
|
+
description: string;
|
|
169
|
+
}
|
|
170
|
+
declare const SLASH_COMMANDS: SlashCommand[];
|
|
171
|
+
type DeepSeekMessage = ChatMessage;
|
|
172
|
+
type DeepSeekToolCall = ToolCall;
|
|
173
|
+
type DeepSeekToolDefinition = ToolDefinition;
|
|
174
|
+
type DeepSeekRequest = {
|
|
175
|
+
model: string;
|
|
176
|
+
messages: ChatMessage[];
|
|
177
|
+
temperature?: number;
|
|
178
|
+
max_tokens?: number;
|
|
179
|
+
stream?: boolean;
|
|
180
|
+
tools?: DeepSeekToolDefinition[];
|
|
181
|
+
};
|
|
182
|
+
type DeepSeekResponse = {
|
|
183
|
+
id: string;
|
|
184
|
+
choices: Array<{
|
|
185
|
+
message: ChatMessage;
|
|
186
|
+
finish_reason: string;
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
type DeepSeekStreamChunk = StreamChunk;
|
|
190
|
+
|
|
191
|
+
interface ChatViewProps {
|
|
192
|
+
initialMessages?: ChatMessage[];
|
|
193
|
+
apiKey?: string;
|
|
194
|
+
model?: string;
|
|
195
|
+
}
|
|
196
|
+
declare function ChatView({ initialMessages, apiKey, model }: ChatViewProps): react_jsx_runtime.JSX.Element;
|
|
197
|
+
|
|
198
|
+
interface AppProps {
|
|
199
|
+
apiKey?: string;
|
|
200
|
+
model?: string;
|
|
201
|
+
verbose?: boolean;
|
|
202
|
+
autoRun?: string;
|
|
203
|
+
}
|
|
204
|
+
declare function App({ apiKey, model, autoRun }: AppProps): react_jsx_runtime.JSX.Element;
|
|
205
|
+
|
|
206
|
+
interface ContextUpdatedPayload {
|
|
207
|
+
modelName: string;
|
|
208
|
+
tokenCount: number;
|
|
209
|
+
memoryUsage: number;
|
|
210
|
+
uptime: number;
|
|
211
|
+
}
|
|
212
|
+
interface MessagePayload {
|
|
213
|
+
id: string;
|
|
214
|
+
role: 'user' | 'assistant' | 'system';
|
|
215
|
+
content: string;
|
|
216
|
+
thinking?: string;
|
|
217
|
+
timestamp: number;
|
|
218
|
+
}
|
|
219
|
+
interface ToolCallPayload {
|
|
220
|
+
id: string;
|
|
221
|
+
toolName: string;
|
|
222
|
+
args: Record<string, unknown>;
|
|
223
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
224
|
+
result?: string;
|
|
225
|
+
}
|
|
226
|
+
interface DiffPayload {
|
|
227
|
+
filePath: string;
|
|
228
|
+
oldContent: string;
|
|
229
|
+
newContent: string;
|
|
230
|
+
}
|
|
231
|
+
interface AgentPayload {
|
|
232
|
+
id: string;
|
|
233
|
+
name: string;
|
|
234
|
+
status: 'idle' | 'running' | 'completed' | 'failed';
|
|
235
|
+
parentId?: string;
|
|
236
|
+
task: string;
|
|
237
|
+
children?: AgentPayload[];
|
|
238
|
+
}
|
|
239
|
+
declare const EventBusEvents: {
|
|
240
|
+
readonly CONTEXT_UPDATED: "context:updated";
|
|
241
|
+
readonly MESSAGE_SEND: "message:send";
|
|
242
|
+
readonly MESSAGE_RECEIVED: "message:received";
|
|
243
|
+
readonly MESSAGE_STREAMING: "message:streaming";
|
|
244
|
+
readonly TOOL_CALL_START: "tool:call:start";
|
|
245
|
+
readonly TOOL_CALL_END: "tool:call:end";
|
|
246
|
+
readonly FILE_DIFF: "file:diff";
|
|
247
|
+
readonly AGENT_TREE_UPDATED: "agent:tree:updated";
|
|
248
|
+
readonly APP_QUIT: "app:quit";
|
|
249
|
+
readonly APP_CLEAR: "app:clear";
|
|
250
|
+
readonly STATUS_UPDATE: "status:update";
|
|
251
|
+
readonly CONFIG_CHANGED: "config:changed";
|
|
252
|
+
readonly AGENT_STATUS_CHANGE: "agent:status:change";
|
|
253
|
+
readonly AGENT_CREATED: "agent:created";
|
|
254
|
+
readonly AGENT_THINKING: "agent:thinking";
|
|
255
|
+
readonly AGENT_EXECUTING: "agent:executing";
|
|
256
|
+
readonly AGENT_WAITING: "agent:waiting";
|
|
257
|
+
readonly AGENT_COMPLETED: "agent:completed";
|
|
258
|
+
readonly AGENT_FAILED: "agent:failed";
|
|
259
|
+
readonly AGENT_CANCELLED: "agent:cancelled";
|
|
260
|
+
readonly AGENT_LOOP_ITERATION: "agent:loop:iteration";
|
|
261
|
+
readonly AGENT_LOOP_DETECTED: "agent:loop:detected";
|
|
262
|
+
readonly AGENT_LOOP_LIMIT: "agent:loop:limit";
|
|
263
|
+
readonly TOOL_CALL_ERROR: "tool:call:error";
|
|
264
|
+
readonly ORCHESTRATOR_DECOMPOSE: "orchestrator:decompose";
|
|
265
|
+
readonly ORCHESTRATOR_DISPATCH: "orchestrator:dispatch";
|
|
266
|
+
readonly ORCHESTRATOR_AGGREGATE: "orchestrator:aggregate";
|
|
267
|
+
readonly SUBAGENT_START: "subagent:start";
|
|
268
|
+
readonly SUBAGENT_TIMEOUT: "subagent:timeout";
|
|
269
|
+
readonly SUBAGENT_COMPLETE: "subagent:complete";
|
|
270
|
+
readonly SUBAGENT_ERROR: "subagent:error";
|
|
271
|
+
readonly POOL_ACQUIRE: "pool:acquire";
|
|
272
|
+
readonly POOL_RELEASE: "pool:release";
|
|
273
|
+
readonly POOL_QUEUE: "pool:queue";
|
|
274
|
+
readonly CONTEXT_SUMMARIZED: "context:summarized";
|
|
275
|
+
readonly CONTEXT_TOKEN_WARNING: "context:token:warning";
|
|
276
|
+
readonly MCP_CONNECTED: "mcp:connected";
|
|
277
|
+
readonly MCP_ERROR: "mcp:error";
|
|
278
|
+
readonly MCP_DISCONNECTED: "mcp:disconnected";
|
|
279
|
+
readonly MCP_TOOLS_DISCOVERED: "mcp:tools:discovered";
|
|
280
|
+
readonly SKILL_LOADED: "skill:loaded";
|
|
281
|
+
readonly SKILL_EXECUTED: "skill:executed";
|
|
282
|
+
readonly SKILL_CREATED: "skill:created";
|
|
283
|
+
readonly SKILL_TRIGGERED: "skill:triggered";
|
|
284
|
+
};
|
|
285
|
+
declare class EventBus extends EventEmitter {
|
|
286
|
+
private static instance;
|
|
287
|
+
static getInstance(): EventBus;
|
|
288
|
+
onContextUpdated(handler: (payload: ContextUpdatedPayload) => void): void;
|
|
289
|
+
emitContextUpdated(payload: ContextUpdatedPayload): void;
|
|
290
|
+
onMessageSend(handler: (payload: {
|
|
291
|
+
content: string;
|
|
292
|
+
}) => void): void;
|
|
293
|
+
emitMessageSend(payload: {
|
|
294
|
+
content: string;
|
|
295
|
+
}): void;
|
|
296
|
+
onMessageReceived(handler: (payload: MessagePayload) => void): void;
|
|
297
|
+
emitMessageReceived(payload: MessagePayload): void;
|
|
298
|
+
onMessageStreaming(handler: (payload: {
|
|
299
|
+
id: string;
|
|
300
|
+
content: string;
|
|
301
|
+
thinking?: string;
|
|
302
|
+
}) => void): void;
|
|
303
|
+
emitMessageStreaming(payload: {
|
|
304
|
+
id: string;
|
|
305
|
+
content: string;
|
|
306
|
+
thinking?: string;
|
|
307
|
+
}): void;
|
|
308
|
+
onToolCallStart(handler: (payload: ToolCallPayload) => void): void;
|
|
309
|
+
emitToolCallStart(payload: ToolCallPayload): void;
|
|
310
|
+
onToolCallEnd(handler: (payload: ToolCallPayload) => void): void;
|
|
311
|
+
emitToolCallEnd(payload: ToolCallPayload): void;
|
|
312
|
+
onFileDiff(handler: (payload: DiffPayload) => void): void;
|
|
313
|
+
emitFileDiff(payload: DiffPayload): void;
|
|
314
|
+
onAgentTreeUpdated(handler: (payload: {
|
|
315
|
+
agents: AgentPayload[];
|
|
316
|
+
}) => void): void;
|
|
317
|
+
emitAgentTreeUpdated(payload: {
|
|
318
|
+
agents: AgentPayload[];
|
|
319
|
+
}): void;
|
|
320
|
+
onAppQuit(handler: () => void): void;
|
|
321
|
+
emitAppQuit(): void;
|
|
322
|
+
onAppClear(handler: () => void): void;
|
|
323
|
+
emitAppClear(): void;
|
|
324
|
+
onStatusUpdate(handler: (payload: Partial<ContextUpdatedPayload>) => void): void;
|
|
325
|
+
emitStatusUpdate(payload: Partial<ContextUpdatedPayload>): void;
|
|
326
|
+
onConfigChanged(handler: (payload: Record<string, unknown>) => void): void;
|
|
327
|
+
emitConfigChanged(payload: Record<string, unknown>): void;
|
|
328
|
+
reset(): void;
|
|
329
|
+
}
|
|
330
|
+
declare const eventbus: EventBus;
|
|
331
|
+
|
|
332
|
+
interface MCPConfigEntry {
|
|
333
|
+
name: string;
|
|
334
|
+
command?: string;
|
|
335
|
+
args?: string[];
|
|
336
|
+
url?: string;
|
|
337
|
+
enabled: boolean;
|
|
338
|
+
autoConnect: boolean;
|
|
339
|
+
}
|
|
340
|
+
interface SkillConfigEntry {
|
|
341
|
+
name: string;
|
|
342
|
+
path: string;
|
|
343
|
+
enabled: boolean;
|
|
344
|
+
autoLoad: boolean;
|
|
345
|
+
}
|
|
346
|
+
interface DeeperConfig {
|
|
347
|
+
model: string;
|
|
348
|
+
apiKey: string;
|
|
349
|
+
baseUrl: string;
|
|
350
|
+
temperature: number;
|
|
351
|
+
maxTokens: number;
|
|
352
|
+
thinkEnabled: boolean;
|
|
353
|
+
thinkBudget: number;
|
|
354
|
+
thinkBudgetTokens: number;
|
|
355
|
+
logLevel: string;
|
|
356
|
+
maxRetries: number;
|
|
357
|
+
timeoutMs: number;
|
|
358
|
+
maxSubAgents: number;
|
|
359
|
+
maxRecursionDepth: number;
|
|
360
|
+
theme: 'dark' | 'light';
|
|
361
|
+
locale: string;
|
|
362
|
+
mcpServers: MCPConfigEntry[];
|
|
363
|
+
skills: SkillConfigEntry[];
|
|
364
|
+
[key: string]: unknown;
|
|
365
|
+
}
|
|
366
|
+
declare function loadConfig(): DeeperConfig;
|
|
367
|
+
declare function saveConfig(config?: DeeperConfig): void;
|
|
368
|
+
declare function getConfig(): DeeperConfig;
|
|
369
|
+
declare function updateConfig(partial: Partial<DeeperConfig>): DeeperConfig;
|
|
370
|
+
declare function resetConfig(): DeeperConfig;
|
|
371
|
+
declare function getConfigValue<K extends keyof DeeperConfig>(key: K): DeeperConfig[K];
|
|
372
|
+
declare function setConfigValue<K extends keyof DeeperConfig>(key: K, value: DeeperConfig[K]): void;
|
|
373
|
+
declare function getApiKey(): string;
|
|
374
|
+
declare function getModel(): string;
|
|
375
|
+
declare function getBaseUrl(): string;
|
|
376
|
+
|
|
377
|
+
declare const DEEPER_VERSION = "1.0.0";
|
|
378
|
+
declare const DEEPER_NAME = "DeeperCode";
|
|
379
|
+
declare const DEEPER_HOME: string;
|
|
380
|
+
declare const DEEPER_CONFIG_FILE: string;
|
|
381
|
+
declare const DEEPSEEK_BASE_URL = "https://api.deepseek.com";
|
|
382
|
+
declare const DEEPSEEK_DEFAULT_MODEL = "deepseek-v4-pro";
|
|
383
|
+
declare const AGENT_MAX_SUB_AGENTS = 5;
|
|
384
|
+
declare const CONTEXT_MAX_TOKENS = 1048576;
|
|
385
|
+
declare const MCP_CONNECTION_TIMEOUT_MS = 10000;
|
|
386
|
+
declare const TOOL_CATEGORIES: readonly ["filesystem", "search", "shell", "network", "code", "database", "data", "security", "project", "ai", "system"];
|
|
387
|
+
type ToolCategory = typeof TOOL_CATEGORIES[number];
|
|
388
|
+
|
|
389
|
+
interface BootstrapResult {
|
|
390
|
+
success: boolean;
|
|
391
|
+
errors: string[];
|
|
392
|
+
warnings: string[];
|
|
393
|
+
config: ReturnType<typeof loadConfig>;
|
|
394
|
+
}
|
|
395
|
+
declare function bootstrap(): Promise<BootstrapResult>;
|
|
396
|
+
declare function checkNodeVersion(): boolean;
|
|
397
|
+
declare function getVersionInfo(): string;
|
|
398
|
+
|
|
399
|
+
interface ChatOptions {
|
|
400
|
+
model?: string;
|
|
401
|
+
apiKey?: string;
|
|
402
|
+
verbose?: boolean;
|
|
403
|
+
autoRun?: string;
|
|
404
|
+
}
|
|
405
|
+
declare function chat(opts?: ChatOptions): Promise<void>;
|
|
406
|
+
|
|
407
|
+
interface RunOptions {
|
|
408
|
+
task?: string;
|
|
409
|
+
model?: string;
|
|
410
|
+
apiKey?: string;
|
|
411
|
+
files?: string[];
|
|
412
|
+
}
|
|
413
|
+
declare function run(task: string, opts?: RunOptions): Promise<void>;
|
|
414
|
+
|
|
415
|
+
export { AGENT_MAX_SUB_AGENTS, type AgentInfo, type AgentPayload, AgentTree, App, type BootstrapResult, CONTEXT_MAX_TOKENS, type ChatMessage, ChatView, ConfirmDialog, type ContextUpdatedPayload, DEEPER_CONFIG_FILE, DEEPER_HOME, DEEPER_NAME, DEEPER_VERSION, DEEPSEEK_BASE_URL, DEEPSEEK_DEFAULT_MODEL, type DeepSeekMessage, type DeepSeekRequest, type DeepSeekResponse, type DeepSeekStreamChunk, type DeepSeekToolCall, type DeepSeekToolDefinition, type DeeperConfig, type DiffPayload, DiffView, EventBusEvents, FilePreview, InputBox, type JSONSchema, type MCPConfigEntry, MCP_CONNECTION_TIMEOUT_MS, MessageBubble, type MessagePayload, SLASH_COMMANDS, type SkillConfigEntry, type SlashCommand, Spinner, StatusBar, TOOL_CATEGORIES, TOOL_SAFETY_MAP, type Theme, type Tool, type ToolCall, ToolCallCard, type ToolCallPayload, type ToolCallRecord, type ToolCallResult, type ToolCategory, type ToolDefinition, type ToolExecutor, type ToolParameter, type ToolResult, type ToolSafetyLevel, bootstrap, chat, checkNodeVersion, darkTheme, defaultTheme, eventbus, getApiKey, getBaseUrl, getConfig, getConfigValue, getModel, getVersionInfo, lightTheme, loadConfig, resetConfig, run, saveConfig, setConfigValue, updateConfig };
|