tarsk 0.3.0 → 0.3.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.
|
@@ -0,0 +1,3170 @@
|
|
|
1
|
+
import type { AnthropicProvider } from '@ai-sdk/anthropic';
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
import type { LanguageModelMiddleware } from 'ai';
|
|
4
|
+
import type { LanguageModelV3 } from '@ai-sdk/provider';
|
|
5
|
+
import type { OpenAICompatibleProvider } from '@ai-sdk/openai-compatible';
|
|
6
|
+
import type { OpenAIProvider } from '@ai-sdk/openai';
|
|
7
|
+
import * as z from 'zod';
|
|
8
|
+
import { z as _zod } from 'zod';
|
|
9
|
+
|
|
10
|
+
declare interface AddSkillOptions {
|
|
11
|
+
global?: boolean;
|
|
12
|
+
claude?: boolean;
|
|
13
|
+
overwrite?: boolean;
|
|
14
|
+
name?: string;
|
|
15
|
+
targetDir?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare interface AddSkillResult {
|
|
19
|
+
installed: SkillMetadata[];
|
|
20
|
+
skipped: {
|
|
21
|
+
name: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}[];
|
|
24
|
+
errors: SkillError[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare type AgentConfig = {
|
|
28
|
+
model?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare interface AgentDefinition {
|
|
32
|
+
agentType: string;
|
|
33
|
+
whenToUse: string;
|
|
34
|
+
systemPrompt: string;
|
|
35
|
+
model: string;
|
|
36
|
+
source: AgentSource;
|
|
37
|
+
tools?: string[];
|
|
38
|
+
disallowedTools?: string[];
|
|
39
|
+
forkContext?: boolean;
|
|
40
|
+
color?: string;
|
|
41
|
+
path?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Controls whether the agent is available for use.
|
|
44
|
+
* - boolean: Static toggle (default: true)
|
|
45
|
+
* - function: Dynamic check based on context
|
|
46
|
+
*/
|
|
47
|
+
isEnabled?: boolean | ((context: Context) => boolean);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare interface AgentExecutionResult {
|
|
51
|
+
status: 'completed' | 'failed';
|
|
52
|
+
agentId: string;
|
|
53
|
+
content: string;
|
|
54
|
+
totalToolCalls: number;
|
|
55
|
+
totalDuration: number;
|
|
56
|
+
model?: string;
|
|
57
|
+
usage: {
|
|
58
|
+
inputTokens: number;
|
|
59
|
+
outputTokens: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare interface AgentLoadError {
|
|
64
|
+
path: string;
|
|
65
|
+
message: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class AgentManager {
|
|
69
|
+
private agents;
|
|
70
|
+
private context;
|
|
71
|
+
private errors;
|
|
72
|
+
constructor(opts: {
|
|
73
|
+
context: Context;
|
|
74
|
+
});
|
|
75
|
+
private registerBuiltinAgents;
|
|
76
|
+
registerAgent(definition: AgentDefinition): void;
|
|
77
|
+
isAgentEnabled(agent: AgentDefinition): boolean;
|
|
78
|
+
getAgent(agentType: string): AgentDefinition | undefined;
|
|
79
|
+
getAllAgents(): AgentDefinition[];
|
|
80
|
+
getAgentTypes(): string[];
|
|
81
|
+
executeTask(input: TaskToolInput, context: {
|
|
82
|
+
tools: Tool[];
|
|
83
|
+
cwd: string;
|
|
84
|
+
signal?: AbortSignal;
|
|
85
|
+
parentSessionId?: string;
|
|
86
|
+
forkContextMessages?: NormalizedMessage[];
|
|
87
|
+
onMessage?: (message: NormalizedMessage, agentId: string, model: string) => void | Promise<void>;
|
|
88
|
+
onToolApprove?: (opts: {
|
|
89
|
+
toolUse: ToolUse;
|
|
90
|
+
category?: ApprovalCategory;
|
|
91
|
+
}) => Promise<boolean | ToolApprovalResult>;
|
|
92
|
+
}): Promise<AgentExecutionResult>;
|
|
93
|
+
getAgentDescriptions(): string;
|
|
94
|
+
loadAgents(): Promise<void>;
|
|
95
|
+
private loadAgentsFromPlugins;
|
|
96
|
+
getErrors(): AgentLoadError[];
|
|
97
|
+
private loadAgentsFromDirectory;
|
|
98
|
+
private loadAgentFile;
|
|
99
|
+
private convertToolNames;
|
|
100
|
+
private parseAgentFile;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare type AgentResultReturnDisplay = {
|
|
104
|
+
type: 'agent_result';
|
|
105
|
+
agentId: string;
|
|
106
|
+
agentType: string;
|
|
107
|
+
description: string;
|
|
108
|
+
prompt: string;
|
|
109
|
+
content: string;
|
|
110
|
+
stats: {
|
|
111
|
+
toolCalls: number;
|
|
112
|
+
duration: number;
|
|
113
|
+
tokens: {
|
|
114
|
+
input: number;
|
|
115
|
+
output: number;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
status: 'completed' | 'failed';
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
declare enum AgentSource {
|
|
122
|
+
BuiltIn = "built-in",
|
|
123
|
+
Plugin = "plugin",
|
|
124
|
+
User = "user",
|
|
125
|
+
ProjectClaude = "project-claude",
|
|
126
|
+
Project = "project",
|
|
127
|
+
GlobalClaude = "global-claude",
|
|
128
|
+
Global = "global"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare enum ApiFormat {
|
|
132
|
+
Anthropic = "anthropic",
|
|
133
|
+
OpenAI = "openai",
|
|
134
|
+
Responses = "responses",
|
|
135
|
+
Google = "google",
|
|
136
|
+
_OpenRouter = "_openrouter"
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Supported application types for open and detect operations */
|
|
140
|
+
declare type App = 'cursor' | 'vscode' | 'vscode-insiders' | 'zed' | 'windsurf' | 'iterm' | 'warp' | 'terminal' | 'antigravity' | 'finder' | 'sourcetree' | 'fork';
|
|
141
|
+
|
|
142
|
+
declare type ApprovalCategory = 'read' | 'write' | 'command' | 'network' | 'ask';
|
|
143
|
+
|
|
144
|
+
declare type ApprovalContext = {
|
|
145
|
+
toolName: string;
|
|
146
|
+
params: Record<string, any>;
|
|
147
|
+
approvalMode: string;
|
|
148
|
+
context: any;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
declare type ApprovalMode = 'default' | 'autoEdit' | 'yolo';
|
|
152
|
+
|
|
153
|
+
export declare type Argv = {
|
|
154
|
+
_: string[];
|
|
155
|
+
help: boolean;
|
|
156
|
+
mcp: boolean;
|
|
157
|
+
quiet: boolean;
|
|
158
|
+
continue?: boolean;
|
|
159
|
+
version: boolean;
|
|
160
|
+
appendSystemPrompt?: string;
|
|
161
|
+
approvalMode?: string;
|
|
162
|
+
cwd?: string;
|
|
163
|
+
host?: string;
|
|
164
|
+
language?: string;
|
|
165
|
+
model?: string;
|
|
166
|
+
outputFormat?: string;
|
|
167
|
+
outputStyle?: string;
|
|
168
|
+
planModel?: string;
|
|
169
|
+
smallModel?: string;
|
|
170
|
+
visionModel?: string;
|
|
171
|
+
resume?: string;
|
|
172
|
+
systemPrompt?: string;
|
|
173
|
+
tools?: string;
|
|
174
|
+
port?: number;
|
|
175
|
+
plugin: string[];
|
|
176
|
+
mcpConfig: string[];
|
|
177
|
+
extensions: Record<string, any>;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
declare type AssistantContent = string | Array<TextPart | ReasoningPart | ToolUsePart>;
|
|
181
|
+
|
|
182
|
+
declare type AssistantMessage = {
|
|
183
|
+
role: 'assistant';
|
|
184
|
+
content: AssistantContent;
|
|
185
|
+
text: string;
|
|
186
|
+
model: string;
|
|
187
|
+
usage: {
|
|
188
|
+
input_tokens: number;
|
|
189
|
+
output_tokens: number;
|
|
190
|
+
cache_read_input_tokens?: number;
|
|
191
|
+
cache_creation_input_tokens?: number;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
declare interface BackgroundTask {
|
|
196
|
+
id: string;
|
|
197
|
+
command: string;
|
|
198
|
+
pid: number;
|
|
199
|
+
pgid?: number;
|
|
200
|
+
status: 'running' | 'completed' | 'killed' | 'failed';
|
|
201
|
+
createdAt: number;
|
|
202
|
+
output: string;
|
|
203
|
+
exitCode: number | null;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
declare class BackgroundTaskManager {
|
|
207
|
+
private tasks;
|
|
208
|
+
createTask(input: CreateTaskInput): string;
|
|
209
|
+
getTask(id: string): BackgroundTask | null;
|
|
210
|
+
getAllTasks(): BackgroundTask[];
|
|
211
|
+
appendOutput(id: string, output: string): void;
|
|
212
|
+
updateTaskStatus(id: string, status: BackgroundTask['status'], exitCode?: number | null): void;
|
|
213
|
+
deleteTask(id: string): void;
|
|
214
|
+
private isProcessAlive;
|
|
215
|
+
killTask(id: string): Promise<boolean>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
declare type BaseMessage = {
|
|
219
|
+
id: MessageId;
|
|
220
|
+
timestamp: number;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
declare interface BaseSlashCommand {
|
|
224
|
+
name: string;
|
|
225
|
+
description: string;
|
|
226
|
+
isEnabled?: boolean;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare type CommitConfig = {
|
|
230
|
+
language: string;
|
|
231
|
+
systemPrompt?: string;
|
|
232
|
+
model?: string;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
declare type Config = {
|
|
236
|
+
model: string;
|
|
237
|
+
planModel: string;
|
|
238
|
+
smallModel?: string;
|
|
239
|
+
visionModel?: string;
|
|
240
|
+
language: string;
|
|
241
|
+
quiet: boolean;
|
|
242
|
+
approvalMode: ApprovalMode;
|
|
243
|
+
plugins: string[];
|
|
244
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
245
|
+
provider?: Record<string, ProviderConfig>;
|
|
246
|
+
systemPrompt?: string;
|
|
247
|
+
todo?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Controls whether automatic conversation compression is enabled.
|
|
250
|
+
* When set to false, conversation history will accumulate and context limit will be exceeded.
|
|
251
|
+
*
|
|
252
|
+
* @default true
|
|
253
|
+
*/
|
|
254
|
+
autoCompact?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Controls whether automatic tool output truncation is enabled.
|
|
257
|
+
* When enabled, large tool outputs (>2000 lines or >50KB) will be truncated
|
|
258
|
+
* and full content saved to a local file.
|
|
259
|
+
*
|
|
260
|
+
* @default true
|
|
261
|
+
*/
|
|
262
|
+
truncation?: boolean;
|
|
263
|
+
commit?: CommitConfig;
|
|
264
|
+
outputStyle?: string;
|
|
265
|
+
outputFormat?: 'text' | 'stream-json' | 'json';
|
|
266
|
+
autoUpdate?: boolean;
|
|
267
|
+
temperature?: number;
|
|
268
|
+
httpProxy?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Extensions configuration for third-party custom agents.
|
|
271
|
+
* Allows arbitrary nested configuration without validation.
|
|
272
|
+
*/
|
|
273
|
+
extensions?: Record<string, any>;
|
|
274
|
+
/**
|
|
275
|
+
* Tools configuration for enabling/disabling specific tools.
|
|
276
|
+
* Key is the tool name, value is boolean (false to disable).
|
|
277
|
+
*/
|
|
278
|
+
tools?: Record<string, boolean>;
|
|
279
|
+
/**
|
|
280
|
+
* Agent configuration for customizing agent behavior per agent type.
|
|
281
|
+
* Example: { explore: { model: "anthropic/claude-haiku-4" } }
|
|
282
|
+
*/
|
|
283
|
+
agent?: Record<string, AgentConfig>;
|
|
284
|
+
/**
|
|
285
|
+
* Extra SKILL.md file paths for user-defined skills.
|
|
286
|
+
* Accepts absolute paths to SKILL.md files or directories containing SKILL.md.
|
|
287
|
+
* Example: ["/path/to/my-skill/SKILL.md", "/path/to/skill-dir"]
|
|
288
|
+
*/
|
|
289
|
+
skills?: string[];
|
|
290
|
+
/**
|
|
291
|
+
* Notification configuration.
|
|
292
|
+
* - true: play default sound (Funk/warning)
|
|
293
|
+
* - false: disabled
|
|
294
|
+
* - string: custom sound name (e.g., "Glass", "Ping")
|
|
295
|
+
* - object: extended notification config (reserved for future use, e.g., url)
|
|
296
|
+
*/
|
|
297
|
+
notification?: boolean | string;
|
|
298
|
+
/**
|
|
299
|
+
* Default thinking/reasoning effort level for models that support it.
|
|
300
|
+
* - 'low', 'medium', 'high', 'max', 'xhigh': Use specified level if supported
|
|
301
|
+
* - 'maxOrXhigh': Prefer xhigh if available, otherwise max
|
|
302
|
+
*/
|
|
303
|
+
thinkingLevel?: 'low' | 'medium' | 'high' | 'max' | 'xhigh' | 'maxOrXhigh';
|
|
304
|
+
/**
|
|
305
|
+
* Controls whether rewind checkpoints are enabled.
|
|
306
|
+
* When enabled, snapshots are created after each AI response to allow
|
|
307
|
+
* rewinding to previous states with code restoration.
|
|
308
|
+
*
|
|
309
|
+
* @default true
|
|
310
|
+
*/
|
|
311
|
+
checkpoints?: boolean;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
declare type ConfigGetInput = {
|
|
315
|
+
cwd: string;
|
|
316
|
+
isGlobal: boolean;
|
|
317
|
+
key: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
declare type ConfigGetOutput = {
|
|
321
|
+
success: boolean;
|
|
322
|
+
data: {
|
|
323
|
+
value: any;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
declare type ConfigListInput = {
|
|
328
|
+
cwd: string;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
declare type ConfigListOutput = {
|
|
332
|
+
success: boolean;
|
|
333
|
+
data: {
|
|
334
|
+
globalConfigDir: string;
|
|
335
|
+
projectConfigDir: string;
|
|
336
|
+
config: any;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export declare class _ConfigManager {
|
|
341
|
+
globalConfig: Partial<Config>;
|
|
342
|
+
projectConfig: Partial<Config>;
|
|
343
|
+
argvConfig: Partial<Config>;
|
|
344
|
+
globalConfigPath: string;
|
|
345
|
+
projectConfigPath: string;
|
|
346
|
+
constructor(cwd: string, productName: string, argvConfig: Partial<Config>);
|
|
347
|
+
get config(): Config;
|
|
348
|
+
removeConfig(global: boolean, key: string, values?: string[]): void;
|
|
349
|
+
addConfig(global: boolean, key: string, values: string[]): void;
|
|
350
|
+
getConfig(global: boolean, key: string): any;
|
|
351
|
+
setConfig(global: boolean, key: string, value: string): void;
|
|
352
|
+
updateConfig(global: boolean, newConfig: Partial<Config>): void;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
declare type ConfigRemoveInput = {
|
|
356
|
+
cwd: string;
|
|
357
|
+
isGlobal: boolean;
|
|
358
|
+
key: string;
|
|
359
|
+
values?: string[];
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
declare type ConfigSetInput = {
|
|
363
|
+
cwd: string;
|
|
364
|
+
isGlobal: boolean;
|
|
365
|
+
key: string;
|
|
366
|
+
value: any;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export declare class Context {
|
|
370
|
+
#private;
|
|
371
|
+
cwd: string;
|
|
372
|
+
productName: string;
|
|
373
|
+
productASCIIArt?: string;
|
|
374
|
+
version: string;
|
|
375
|
+
config: Config;
|
|
376
|
+
paths: Paths;
|
|
377
|
+
argvConfig: Record<string, any>;
|
|
378
|
+
mcpManager: MCPManager;
|
|
379
|
+
backgroundTaskManager: BackgroundTaskManager;
|
|
380
|
+
fileHistoryManager: FileHistoryManager;
|
|
381
|
+
skillManager?: SkillManager;
|
|
382
|
+
messageBus?: MessageBus;
|
|
383
|
+
agentManager?: AgentManager;
|
|
384
|
+
plugins: (string | Plugin_2)[];
|
|
385
|
+
fetch?: typeof globalThis.fetch;
|
|
386
|
+
globalData: GlobalData;
|
|
387
|
+
constructor(opts: ContextOpts);
|
|
388
|
+
apply(applyOpts: Omit<PluginApplyOpts, 'pluginContext'>): Promise<any>;
|
|
389
|
+
destroy(): Promise<void>;
|
|
390
|
+
static create(opts: ContextCreateOpts): Promise<Context>;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
declare type ContextCreateOpts = {
|
|
394
|
+
cwd: string;
|
|
395
|
+
productName: string;
|
|
396
|
+
productASCIIArt?: string;
|
|
397
|
+
version: string;
|
|
398
|
+
argvConfig: Record<string, any>;
|
|
399
|
+
plugins: (string | Plugin_2)[];
|
|
400
|
+
messageBus?: MessageBus;
|
|
401
|
+
fetch?: typeof globalThis.fetch;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
declare type ContextOpts = {
|
|
405
|
+
cwd: string;
|
|
406
|
+
productName: string;
|
|
407
|
+
productASCIIArt?: string;
|
|
408
|
+
version: string;
|
|
409
|
+
config: Config;
|
|
410
|
+
pluginManager: PluginManager;
|
|
411
|
+
paths: Paths;
|
|
412
|
+
argvConfig: Record<string, any>;
|
|
413
|
+
mcpManager: MCPManager;
|
|
414
|
+
backgroundTaskManager: BackgroundTaskManager;
|
|
415
|
+
fileHistoryManager: FileHistoryManager;
|
|
416
|
+
skillManager?: SkillManager;
|
|
417
|
+
messageBus?: MessageBus;
|
|
418
|
+
agentManager?: AgentManager;
|
|
419
|
+
plugins: (string | Plugin_2)[];
|
|
420
|
+
fetch?: typeof globalThis.fetch;
|
|
421
|
+
globalData: GlobalData;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
declare type CreateModel = (name: string, provider: Provider, options: {
|
|
425
|
+
globalConfigDir: string;
|
|
426
|
+
setGlobalConfig: (key: string, value: string, isGlobal: boolean) => void;
|
|
427
|
+
customFetch?: (url: RequestInfo | URL, options?: RequestInit) => Promise<Response>;
|
|
428
|
+
}) => Promise<LanguageModelV3> | LanguageModelV3;
|
|
429
|
+
|
|
430
|
+
export declare function createSession(options: SDKSessionOptions): Promise<SDKSession>;
|
|
431
|
+
|
|
432
|
+
declare interface CreateTaskInput {
|
|
433
|
+
command: string;
|
|
434
|
+
pid: number;
|
|
435
|
+
pgid?: number;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export declare function createTool<TSchema extends z.ZodTypeAny>(config: {
|
|
439
|
+
name: string;
|
|
440
|
+
displayName?: string;
|
|
441
|
+
description: string;
|
|
442
|
+
parameters: TSchema;
|
|
443
|
+
execute: (params: z.output<TSchema>, toolCallId?: string) => Promise<ToolResult> | ToolResult;
|
|
444
|
+
approval?: ToolApprovalInfo;
|
|
445
|
+
getDescription?: ({ params, cwd, }: {
|
|
446
|
+
params: z.output<TSchema>;
|
|
447
|
+
cwd: string;
|
|
448
|
+
}) => string;
|
|
449
|
+
}): Tool<TSchema>;
|
|
450
|
+
|
|
451
|
+
declare type DiffViewerReturnDisplay = {
|
|
452
|
+
type: 'diff_viewer';
|
|
453
|
+
originalContent: string | {
|
|
454
|
+
inputKey: string;
|
|
455
|
+
};
|
|
456
|
+
newContent: string | {
|
|
457
|
+
inputKey: string;
|
|
458
|
+
};
|
|
459
|
+
filePath: string;
|
|
460
|
+
[key: string]: any;
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
declare type Enforce = 'pre' | 'post';
|
|
464
|
+
|
|
465
|
+
/** Standard error response */
|
|
466
|
+
declare type ErrorResponse = {
|
|
467
|
+
success: false;
|
|
468
|
+
error: string;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
declare type EventHandler = (data: any) => void;
|
|
472
|
+
|
|
473
|
+
declare type EventMessage = BaseMessage & {
|
|
474
|
+
type: 'event';
|
|
475
|
+
event: string;
|
|
476
|
+
data: any;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Backup metadata for a single file
|
|
481
|
+
*/
|
|
482
|
+
declare type FileBackupMeta = {
|
|
483
|
+
/** Backup file name, format: {hash}@v{version}, null means file was deleted */
|
|
484
|
+
backupFileName: string | null;
|
|
485
|
+
/** Version number (incremental) */
|
|
486
|
+
version: number;
|
|
487
|
+
/** Backup time */
|
|
488
|
+
backupTime: Date;
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* File diff content for UI display
|
|
493
|
+
*/
|
|
494
|
+
declare type FileDiff = {
|
|
495
|
+
path: string;
|
|
496
|
+
oldContent: string;
|
|
497
|
+
newContent: string;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
declare class FileHistory {
|
|
501
|
+
private cwd;
|
|
502
|
+
private sessionId;
|
|
503
|
+
private backupDir;
|
|
504
|
+
private snapshots;
|
|
505
|
+
private trackedFiles;
|
|
506
|
+
private pendingBackups;
|
|
507
|
+
constructor(opts: {
|
|
508
|
+
cwd: string;
|
|
509
|
+
sessionId: string;
|
|
510
|
+
backupRoot?: string;
|
|
511
|
+
snapshots?: Snapshot[];
|
|
512
|
+
});
|
|
513
|
+
/**
|
|
514
|
+
* Factory method: Create FileHistory instance from session data
|
|
515
|
+
*/
|
|
516
|
+
static fromSession(opts: {
|
|
517
|
+
cwd: string;
|
|
518
|
+
sessionId: string;
|
|
519
|
+
snapshots: SerializedSnapshot_2[];
|
|
520
|
+
backupRoot?: string;
|
|
521
|
+
}): FileHistory;
|
|
522
|
+
/**
|
|
523
|
+
* Add file to tracking list and create immediate backup.
|
|
524
|
+
* Accepts either absolute path or relative path (relative to cwd).
|
|
525
|
+
*
|
|
526
|
+
* This should be called BEFORE the file is modified, so we backup the OLD content.
|
|
527
|
+
*/
|
|
528
|
+
trackFile(filePath: string): void;
|
|
529
|
+
/**
|
|
530
|
+
* Track a new file (does not exist yet) before it gets created.
|
|
531
|
+
* Records backupFileName as null to indicate the file was newly created.
|
|
532
|
+
*/
|
|
533
|
+
trackNewFile(filePath: string): void;
|
|
534
|
+
/**
|
|
535
|
+
* Check if message has a snapshot
|
|
536
|
+
*/
|
|
537
|
+
hasSnapshot(messageId: string): boolean;
|
|
538
|
+
/**
|
|
539
|
+
* Generate backup file name: SHA256(relativePath).slice(0,16)@v{version}
|
|
540
|
+
*/
|
|
541
|
+
private generateBackupFileName;
|
|
542
|
+
/**
|
|
543
|
+
* Detect if file has changed compared to backup (metadata-first)
|
|
544
|
+
*/
|
|
545
|
+
private hasFileChanged;
|
|
546
|
+
/**
|
|
547
|
+
* Create file backup
|
|
548
|
+
*/
|
|
549
|
+
private createBackup;
|
|
550
|
+
/**
|
|
551
|
+
* Check if there are pending backups waiting to be snapshotted.
|
|
552
|
+
* Use this to determine if a snapshot should be created for this turn.
|
|
553
|
+
*/
|
|
554
|
+
hasPendingBackups(): boolean;
|
|
555
|
+
/**
|
|
556
|
+
* Create snapshot using pending backups created by trackFile.
|
|
557
|
+
* Only files with pending backups (modified this turn) are included.
|
|
558
|
+
* Returns null if no files were modified this turn.
|
|
559
|
+
*/
|
|
560
|
+
createSnapshot(messageId: string): Snapshot | null;
|
|
561
|
+
/**
|
|
562
|
+
* Get all snapshot previews
|
|
563
|
+
*/
|
|
564
|
+
getSnapshotPreviews(): SnapshotPreview_2[];
|
|
565
|
+
/**
|
|
566
|
+
* Calculate file diff using real line-by-line comparison
|
|
567
|
+
*/
|
|
568
|
+
private calculateDiff;
|
|
569
|
+
/**
|
|
570
|
+
* Restore single file
|
|
571
|
+
*/
|
|
572
|
+
private restoreFile;
|
|
573
|
+
/**
|
|
574
|
+
* Rewind to specified message's snapshot.
|
|
575
|
+
* Restores files to the state AT the target snapshot, reverting all changes
|
|
576
|
+
* made by snapshots after the target.
|
|
577
|
+
*/
|
|
578
|
+
rewindToMessage(messageId: string, dryRun?: boolean): RewindResult_2;
|
|
579
|
+
/**
|
|
580
|
+
* Read file content safely, returns empty string if file doesn't exist
|
|
581
|
+
*/
|
|
582
|
+
private readFileContent;
|
|
583
|
+
/**
|
|
584
|
+
* Get file contents for diff display
|
|
585
|
+
*/
|
|
586
|
+
private getFileDiffContents;
|
|
587
|
+
/**
|
|
588
|
+
* Preview rewind (dry run)
|
|
589
|
+
* @param cumulative - If true, calculates changes from this point to current state (for UI display)
|
|
590
|
+
* If false, only shows changes in this specific snapshot
|
|
591
|
+
*/
|
|
592
|
+
previewRewind(messageId: string, cumulative?: boolean): RewindResult_2;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
declare class FileHistoryManager {
|
|
596
|
+
private instances;
|
|
597
|
+
private cwd;
|
|
598
|
+
private backupRoot;
|
|
599
|
+
constructor(opts: FileHistoryManagerOpts);
|
|
600
|
+
/**
|
|
601
|
+
* Gets or creates a FileHistory instance for the given sessionId.
|
|
602
|
+
* If sessionLogPath is provided, attempts to load existing snapshots from session.jsonl.
|
|
603
|
+
*
|
|
604
|
+
* @param sessionId - Session ID (can be main session or agent session like 'agent-xxx')
|
|
605
|
+
* @param sessionLogPath - Optional path to session.jsonl for loading existing snapshots
|
|
606
|
+
* @returns FileHistory instance for the session
|
|
607
|
+
*/
|
|
608
|
+
getOrCreate(sessionId: string, sessionLogPath?: string): FileHistory;
|
|
609
|
+
/**
|
|
610
|
+
* Directly sets a FileHistory instance for a session.
|
|
611
|
+
* Used by snapshot.loadFromSession handler.
|
|
612
|
+
*
|
|
613
|
+
* @param sessionId - Session ID
|
|
614
|
+
* @param fileHistory - FileHistory instance to set
|
|
615
|
+
*/
|
|
616
|
+
set(sessionId: string, fileHistory: FileHistory): void;
|
|
617
|
+
/**
|
|
618
|
+
* Gets a FileHistory instance without creating it.
|
|
619
|
+
* Returns undefined if no instance exists.
|
|
620
|
+
*
|
|
621
|
+
* @param sessionId - Session ID
|
|
622
|
+
* @returns FileHistory instance or undefined
|
|
623
|
+
*/
|
|
624
|
+
get(sessionId: string): FileHistory | undefined;
|
|
625
|
+
/**
|
|
626
|
+
* Clears FileHistory instance(s).
|
|
627
|
+
*
|
|
628
|
+
* @param sessionId - Optional session ID. If provided, clears only that session.
|
|
629
|
+
* If not provided, clears all sessions.
|
|
630
|
+
*/
|
|
631
|
+
clear(sessionId?: string): void;
|
|
632
|
+
/**
|
|
633
|
+
* Destroys all FileHistory instances.
|
|
634
|
+
* Called when the Context is destroyed.
|
|
635
|
+
*/
|
|
636
|
+
destroy(): void;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
declare interface FileHistoryManagerOpts {
|
|
640
|
+
cwd: string;
|
|
641
|
+
backupRoot: string;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
declare type GitCloneInput = {
|
|
645
|
+
url: string;
|
|
646
|
+
destination: string;
|
|
647
|
+
taskId?: string;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
declare type GitCloneOutput = {
|
|
651
|
+
success: boolean;
|
|
652
|
+
data?: {
|
|
653
|
+
clonePath: string;
|
|
654
|
+
repoName: string;
|
|
655
|
+
};
|
|
656
|
+
error?: string;
|
|
657
|
+
errorCode?: string;
|
|
658
|
+
needsCredentials?: boolean;
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
declare type GitCommitInput = {
|
|
662
|
+
cwd: string;
|
|
663
|
+
message: string;
|
|
664
|
+
noVerify?: boolean;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
declare type GitCreateBranchInput = {
|
|
668
|
+
cwd: string;
|
|
669
|
+
name: string;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
declare type GitCreateBranchOutput = {
|
|
673
|
+
success: boolean;
|
|
674
|
+
data?: {
|
|
675
|
+
branchName: string;
|
|
676
|
+
wasRenamed: boolean;
|
|
677
|
+
};
|
|
678
|
+
error?: string;
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
declare type GitCreatePRInput = {
|
|
682
|
+
cwd: string;
|
|
683
|
+
branchName: string;
|
|
684
|
+
body?: string;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
declare type GitCreatePROutput = {
|
|
688
|
+
success: boolean;
|
|
689
|
+
data?: {
|
|
690
|
+
prUrl: string;
|
|
691
|
+
};
|
|
692
|
+
error?: string;
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
declare type GitDetectGitHubInput = {
|
|
696
|
+
cwd: string;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
declare type GitDetectGitHubOutput = {
|
|
700
|
+
success: boolean;
|
|
701
|
+
data?: {
|
|
702
|
+
hasGhCli: boolean;
|
|
703
|
+
isGitHubRemote: boolean;
|
|
704
|
+
};
|
|
705
|
+
error?: string;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
declare type GitPushInput = {
|
|
709
|
+
cwd: string;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
declare type GitStageInput = {
|
|
713
|
+
cwd: string;
|
|
714
|
+
all?: boolean;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
declare type GitStatusInput = {
|
|
718
|
+
cwd: string;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
declare type GitStatusOutput = {
|
|
722
|
+
success: boolean;
|
|
723
|
+
data?: {
|
|
724
|
+
isRepo: boolean;
|
|
725
|
+
hasUncommittedChanges: boolean;
|
|
726
|
+
hasStagedChanges: boolean;
|
|
727
|
+
isGitInstalled: boolean;
|
|
728
|
+
isUserConfigured: {
|
|
729
|
+
name: boolean;
|
|
730
|
+
email: boolean;
|
|
731
|
+
};
|
|
732
|
+
isMerging: boolean;
|
|
733
|
+
unstagedFiles: Array<{
|
|
734
|
+
status: string;
|
|
735
|
+
file: string;
|
|
736
|
+
}>;
|
|
737
|
+
};
|
|
738
|
+
error?: string;
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
declare class GlobalData {
|
|
742
|
+
private globalDataPath;
|
|
743
|
+
constructor({ globalDataPath }: {
|
|
744
|
+
globalDataPath: string;
|
|
745
|
+
});
|
|
746
|
+
private readData;
|
|
747
|
+
private writeData;
|
|
748
|
+
getProjectHistory({ cwd }: {
|
|
749
|
+
cwd: string;
|
|
750
|
+
}): string[];
|
|
751
|
+
addProjectHistory({ cwd, history }: {
|
|
752
|
+
cwd: string;
|
|
753
|
+
history: string;
|
|
754
|
+
}): void;
|
|
755
|
+
getProjectLastAccessed({ cwd }: {
|
|
756
|
+
cwd: string;
|
|
757
|
+
}): number | null;
|
|
758
|
+
updateProjectLastAccessed({ cwd }: {
|
|
759
|
+
cwd: string;
|
|
760
|
+
}): void;
|
|
761
|
+
getRecentModels(): string[];
|
|
762
|
+
addRecentModel(model: string): void;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
declare type GlobalDataRecentModelsAddInput = {
|
|
766
|
+
cwd: string;
|
|
767
|
+
model: string;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
declare type GlobalDataRecentModelsGetInput = {
|
|
771
|
+
cwd: string;
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
declare type GlobalDataRecentModelsGetOutput = {
|
|
775
|
+
success: boolean;
|
|
776
|
+
data: {
|
|
777
|
+
recentModels: string[];
|
|
778
|
+
thinkingLevel: string | undefined;
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Central type registry for all message bus handlers.
|
|
784
|
+
* Maps handler method names to their input and output types.
|
|
785
|
+
*/
|
|
786
|
+
declare type HandlerMap = {
|
|
787
|
+
'globalData.recentModels.get': {
|
|
788
|
+
input: GlobalDataRecentModelsGetInput;
|
|
789
|
+
output: GlobalDataRecentModelsGetOutput;
|
|
790
|
+
};
|
|
791
|
+
'globalData.recentModels.add': {
|
|
792
|
+
input: GlobalDataRecentModelsAddInput;
|
|
793
|
+
output: SuccessResponse;
|
|
794
|
+
};
|
|
795
|
+
'config.get': {
|
|
796
|
+
input: ConfigGetInput;
|
|
797
|
+
output: ConfigGetOutput;
|
|
798
|
+
};
|
|
799
|
+
'config.set': {
|
|
800
|
+
input: ConfigSetInput;
|
|
801
|
+
output: SuccessResponse;
|
|
802
|
+
};
|
|
803
|
+
'config.remove': {
|
|
804
|
+
input: ConfigRemoveInput;
|
|
805
|
+
output: SuccessResponse;
|
|
806
|
+
};
|
|
807
|
+
'config.list': {
|
|
808
|
+
input: ConfigListInput;
|
|
809
|
+
output: ConfigListOutput;
|
|
810
|
+
};
|
|
811
|
+
'git.clone': {
|
|
812
|
+
input: GitCloneInput;
|
|
813
|
+
output: GitCloneOutput;
|
|
814
|
+
};
|
|
815
|
+
'git.clone.cancel': {
|
|
816
|
+
input: {
|
|
817
|
+
taskId: string;
|
|
818
|
+
};
|
|
819
|
+
output: SuccessResponse;
|
|
820
|
+
};
|
|
821
|
+
'git.status': {
|
|
822
|
+
input: GitStatusInput;
|
|
823
|
+
output: GitStatusOutput;
|
|
824
|
+
};
|
|
825
|
+
'git.stage': {
|
|
826
|
+
input: GitStageInput;
|
|
827
|
+
output: SuccessResponse | ErrorResponse;
|
|
828
|
+
};
|
|
829
|
+
'git.commit': {
|
|
830
|
+
input: GitCommitInput;
|
|
831
|
+
output: SuccessResponse | ErrorResponse;
|
|
832
|
+
};
|
|
833
|
+
'git.push': {
|
|
834
|
+
input: GitPushInput;
|
|
835
|
+
output: SuccessResponse | ErrorResponse;
|
|
836
|
+
};
|
|
837
|
+
'git.createBranch': {
|
|
838
|
+
input: GitCreateBranchInput;
|
|
839
|
+
output: GitCreateBranchOutput;
|
|
840
|
+
};
|
|
841
|
+
'git.detectGitHub': {
|
|
842
|
+
input: GitDetectGitHubInput;
|
|
843
|
+
output: GitDetectGitHubOutput;
|
|
844
|
+
};
|
|
845
|
+
'git.createPR': {
|
|
846
|
+
input: GitCreatePRInput;
|
|
847
|
+
output: GitCreatePROutput;
|
|
848
|
+
};
|
|
849
|
+
'mcp.getStatus': {
|
|
850
|
+
input: McpGetStatusInput;
|
|
851
|
+
output: McpGetStatusOutput;
|
|
852
|
+
};
|
|
853
|
+
'mcp.reconnect': {
|
|
854
|
+
input: McpReconnectInput;
|
|
855
|
+
output: McpReconnectOutput;
|
|
856
|
+
};
|
|
857
|
+
'mcp.list': {
|
|
858
|
+
input: McpListInput;
|
|
859
|
+
output: McpListOutput;
|
|
860
|
+
};
|
|
861
|
+
'models.list': {
|
|
862
|
+
input: ModelsListInput;
|
|
863
|
+
output: ModelsListOutput;
|
|
864
|
+
};
|
|
865
|
+
'models.test': {
|
|
866
|
+
input: ModelsTestInput;
|
|
867
|
+
output: ModelsTestOutput;
|
|
868
|
+
};
|
|
869
|
+
'outputStyles.list': {
|
|
870
|
+
input: OutputStylesListInput;
|
|
871
|
+
output: OutputStylesListOutput;
|
|
872
|
+
};
|
|
873
|
+
'project.addHistory': {
|
|
874
|
+
input: ProjectAddHistoryInput;
|
|
875
|
+
output: SuccessResponse;
|
|
876
|
+
};
|
|
877
|
+
'project.clearContext': {
|
|
878
|
+
input: ProjectClearContextInput;
|
|
879
|
+
output: SuccessResponse;
|
|
880
|
+
};
|
|
881
|
+
'project.addMemory': {
|
|
882
|
+
input: ProjectAddMemoryInput;
|
|
883
|
+
output: SuccessResponse;
|
|
884
|
+
};
|
|
885
|
+
'project.analyzeContext': {
|
|
886
|
+
input: ProjectAnalyzeContextInput;
|
|
887
|
+
output: ProjectAnalyzeContextOutput;
|
|
888
|
+
};
|
|
889
|
+
'project.getRepoInfo': {
|
|
890
|
+
input: ProjectGetRepoInfoInput;
|
|
891
|
+
output: ProjectGetRepoInfoOutput;
|
|
892
|
+
};
|
|
893
|
+
'project.workspaces.list': {
|
|
894
|
+
input: ProjectWorkspacesListInput;
|
|
895
|
+
output: ProjectWorkspacesListOutput;
|
|
896
|
+
};
|
|
897
|
+
'project.workspaces.get': {
|
|
898
|
+
input: ProjectWorkspacesGetInput;
|
|
899
|
+
output: ProjectWorkspacesGetOutput;
|
|
900
|
+
};
|
|
901
|
+
'project.workspaces.create': {
|
|
902
|
+
input: ProjectWorkspacesCreateInput;
|
|
903
|
+
output: ProjectWorkspacesCreateOutput;
|
|
904
|
+
};
|
|
905
|
+
'project.workspaces.delete': {
|
|
906
|
+
input: ProjectWorkspacesDeleteInput;
|
|
907
|
+
output: ProjectWorkspacesDeleteOutput;
|
|
908
|
+
};
|
|
909
|
+
'project.workspaces.merge': {
|
|
910
|
+
input: ProjectWorkspacesMergeInput;
|
|
911
|
+
output: ProjectWorkspacesMergeOutput;
|
|
912
|
+
};
|
|
913
|
+
'project.workspaces.createGithubPR': {
|
|
914
|
+
input: ProjectWorkspacesCreateGithubPRInput;
|
|
915
|
+
output: ProjectWorkspacesCreateGithubPROutput;
|
|
916
|
+
};
|
|
917
|
+
'project.generateCommit': {
|
|
918
|
+
input: ProjectGenerateCommitInput;
|
|
919
|
+
output: ProjectGenerateCommitOutput;
|
|
920
|
+
};
|
|
921
|
+
'projects.list': {
|
|
922
|
+
input: ProjectsListInput;
|
|
923
|
+
output: ProjectsListOutput;
|
|
924
|
+
};
|
|
925
|
+
'providers.list': {
|
|
926
|
+
input: ProvidersListInput;
|
|
927
|
+
output: ProvidersListOutput;
|
|
928
|
+
};
|
|
929
|
+
'providers.login.initOAuth': {
|
|
930
|
+
input: ProvidersLoginInitOAuthInput;
|
|
931
|
+
output: ProvidersLoginInitOAuthOutput;
|
|
932
|
+
};
|
|
933
|
+
'providers.login.completeOAuth': {
|
|
934
|
+
input: ProvidersLoginCompleteOAuthInput;
|
|
935
|
+
output: ProvidersLoginCompleteOAuthOutput;
|
|
936
|
+
};
|
|
937
|
+
'providers.login.status': {
|
|
938
|
+
input: ProvidersLoginStatusInput;
|
|
939
|
+
output: ProvidersLoginStatusOutput;
|
|
940
|
+
};
|
|
941
|
+
'providers.login.pollOAuth': {
|
|
942
|
+
input: ProvidersLoginPollOAuthInput;
|
|
943
|
+
output: ProvidersLoginPollOAuthOutput;
|
|
944
|
+
};
|
|
945
|
+
'session.initialize': {
|
|
946
|
+
input: SessionInitializeInput;
|
|
947
|
+
output: SessionInitializeOutput;
|
|
948
|
+
};
|
|
949
|
+
'session.messages.list': {
|
|
950
|
+
input: SessionMessagesListInput;
|
|
951
|
+
output: SessionMessagesListOutput;
|
|
952
|
+
};
|
|
953
|
+
'session.export': {
|
|
954
|
+
input: SessionExportSessionMarkdownInput;
|
|
955
|
+
output: SessionExportSessionMarkdownOutput;
|
|
956
|
+
};
|
|
957
|
+
'session.getModel': {
|
|
958
|
+
input: SessionGetModelInput;
|
|
959
|
+
output: SessionGetModelOutput;
|
|
960
|
+
};
|
|
961
|
+
'session.send': {
|
|
962
|
+
input: SessionSendInput;
|
|
963
|
+
output: SessionSendOutput;
|
|
964
|
+
};
|
|
965
|
+
'session.cancel': {
|
|
966
|
+
input: SessionCancelInput;
|
|
967
|
+
output: SuccessResponse;
|
|
968
|
+
};
|
|
969
|
+
'session.addMessages': {
|
|
970
|
+
input: SessionAddMessagesInput;
|
|
971
|
+
output: SuccessResponse;
|
|
972
|
+
};
|
|
973
|
+
'session.compact': {
|
|
974
|
+
input: SessionCompactInput;
|
|
975
|
+
output: SessionCompactOutput;
|
|
976
|
+
};
|
|
977
|
+
'session.config.setApprovalMode': {
|
|
978
|
+
input: SessionConfigSetApprovalModeInput;
|
|
979
|
+
output: SuccessResponse;
|
|
980
|
+
};
|
|
981
|
+
'session.config.addApprovalTools': {
|
|
982
|
+
input: SessionConfigAddApprovalToolsInput;
|
|
983
|
+
output: SuccessResponse;
|
|
984
|
+
};
|
|
985
|
+
'session.config.setSummary': {
|
|
986
|
+
input: SessionConfigSetSummaryInput;
|
|
987
|
+
output: SuccessResponse;
|
|
988
|
+
};
|
|
989
|
+
'session.config.setPastedTextMap': {
|
|
990
|
+
input: SessionConfigSetPastedTextMapInput;
|
|
991
|
+
output: SuccessResponse;
|
|
992
|
+
};
|
|
993
|
+
'session.config.setPastedImageMap': {
|
|
994
|
+
input: SessionConfigSetPastedImageMapInput;
|
|
995
|
+
output: SuccessResponse;
|
|
996
|
+
};
|
|
997
|
+
'session.config.getAdditionalDirectories': {
|
|
998
|
+
input: SessionConfigGetAdditionalDirectoriesInput;
|
|
999
|
+
output: SessionConfigGetAdditionalDirectoriesOutput;
|
|
1000
|
+
};
|
|
1001
|
+
'session.config.addDirectory': {
|
|
1002
|
+
input: SessionConfigAddDirectoryInput;
|
|
1003
|
+
output: SuccessResponse;
|
|
1004
|
+
};
|
|
1005
|
+
'session.config.removeDirectory': {
|
|
1006
|
+
input: SessionConfigRemoveDirectoryInput;
|
|
1007
|
+
output: SuccessResponse;
|
|
1008
|
+
};
|
|
1009
|
+
'session.config.set': {
|
|
1010
|
+
input: SessionConfigSetInput;
|
|
1011
|
+
output: SuccessResponse;
|
|
1012
|
+
};
|
|
1013
|
+
'session.config.get': {
|
|
1014
|
+
input: SessionConfigGetInput;
|
|
1015
|
+
output: SessionConfigGetOutput;
|
|
1016
|
+
};
|
|
1017
|
+
'session.config.remove': {
|
|
1018
|
+
input: SessionConfigRemoveInput;
|
|
1019
|
+
output: SuccessResponse;
|
|
1020
|
+
};
|
|
1021
|
+
'sessions.remove': {
|
|
1022
|
+
input: SessionsRemoveInput;
|
|
1023
|
+
output: SessionsRemoveOutput;
|
|
1024
|
+
};
|
|
1025
|
+
'sessions.list': {
|
|
1026
|
+
input: SessionsListInput;
|
|
1027
|
+
output: SessionsListOutput;
|
|
1028
|
+
};
|
|
1029
|
+
'sessions.resume': {
|
|
1030
|
+
input: SessionsResumeInput;
|
|
1031
|
+
output: SessionsResumeOutput;
|
|
1032
|
+
};
|
|
1033
|
+
'skills.list': {
|
|
1034
|
+
input: SkillsListInput;
|
|
1035
|
+
output: SkillsListOutput;
|
|
1036
|
+
};
|
|
1037
|
+
'skills.get': {
|
|
1038
|
+
input: SkillsGetInput;
|
|
1039
|
+
output: SkillsGetOutput;
|
|
1040
|
+
};
|
|
1041
|
+
'skills.add': {
|
|
1042
|
+
input: SkillsAddInput;
|
|
1043
|
+
output: SkillsAddOutput;
|
|
1044
|
+
};
|
|
1045
|
+
'skills.remove': {
|
|
1046
|
+
input: SkillsRemoveInput;
|
|
1047
|
+
output: SkillsRemoveOutput;
|
|
1048
|
+
};
|
|
1049
|
+
'skills.preview': {
|
|
1050
|
+
input: SkillsPreviewInput;
|
|
1051
|
+
output: SkillsPreviewOutput;
|
|
1052
|
+
};
|
|
1053
|
+
'skills.install': {
|
|
1054
|
+
input: SkillsInstallInput;
|
|
1055
|
+
output: SkillsInstallOutput;
|
|
1056
|
+
};
|
|
1057
|
+
'slashCommand.list': {
|
|
1058
|
+
input: SlashCommandListInput;
|
|
1059
|
+
output: SlashCommandListOutput;
|
|
1060
|
+
};
|
|
1061
|
+
'slashCommand.get': {
|
|
1062
|
+
input: SlashCommandGetInput;
|
|
1063
|
+
output: SlashCommandGetOutput;
|
|
1064
|
+
};
|
|
1065
|
+
'slashCommand.execute': {
|
|
1066
|
+
input: SlashCommandExecuteInput;
|
|
1067
|
+
output: SlashCommandExecuteOutput;
|
|
1068
|
+
};
|
|
1069
|
+
'status.get': {
|
|
1070
|
+
input: StatusGetInput;
|
|
1071
|
+
output: StatusGetOutput;
|
|
1072
|
+
};
|
|
1073
|
+
'utils.query': {
|
|
1074
|
+
input: UtilsQueryInput;
|
|
1075
|
+
output: UtilsQueryOutput;
|
|
1076
|
+
};
|
|
1077
|
+
'utils.quickQuery': {
|
|
1078
|
+
input: UtilsQuickQueryInput;
|
|
1079
|
+
output: UtilsQuickQueryOutput;
|
|
1080
|
+
};
|
|
1081
|
+
'utils.summarizeMessage': {
|
|
1082
|
+
input: UtilsSummarizeMessageInput;
|
|
1083
|
+
output: UtilsSummarizeMessageOutput;
|
|
1084
|
+
};
|
|
1085
|
+
'utils.getPaths': {
|
|
1086
|
+
input: UtilsGetPathsInput;
|
|
1087
|
+
output: UtilsGetPathsOutput;
|
|
1088
|
+
};
|
|
1089
|
+
'utils.searchPaths': {
|
|
1090
|
+
input: UtilsSearchPathsInput;
|
|
1091
|
+
output: UtilsSearchPathsOutput;
|
|
1092
|
+
};
|
|
1093
|
+
'utils.telemetry': {
|
|
1094
|
+
input: UtilsTelemetryInput;
|
|
1095
|
+
output: SuccessResponse;
|
|
1096
|
+
};
|
|
1097
|
+
'utils.files.list': {
|
|
1098
|
+
input: UtilsFilesListInput;
|
|
1099
|
+
output: UtilsFilesListOutput;
|
|
1100
|
+
};
|
|
1101
|
+
'utils.tool.executeBash': {
|
|
1102
|
+
input: UtilsToolExecuteBashInput;
|
|
1103
|
+
output: UtilsToolExecuteBashOutput;
|
|
1104
|
+
};
|
|
1105
|
+
'utils.open': {
|
|
1106
|
+
input: UtilsOpenInput;
|
|
1107
|
+
output: SuccessResponse;
|
|
1108
|
+
};
|
|
1109
|
+
'utils.detectApps': {
|
|
1110
|
+
input: UtilsDetectAppsInput;
|
|
1111
|
+
output: UtilsDetectAppsOutput;
|
|
1112
|
+
};
|
|
1113
|
+
'utils.playSound': {
|
|
1114
|
+
input: UtilsPlaySoundInput;
|
|
1115
|
+
output: UtilsPlaySoundOutput;
|
|
1116
|
+
};
|
|
1117
|
+
'utils.notify': {
|
|
1118
|
+
input: UtilsNotifyInput;
|
|
1119
|
+
output: UtilsNotifyOutput;
|
|
1120
|
+
};
|
|
1121
|
+
toolApproval: {
|
|
1122
|
+
input: ToolApprovalInput;
|
|
1123
|
+
output: ToolApprovalOutput;
|
|
1124
|
+
};
|
|
1125
|
+
'snapshot.trackFile': {
|
|
1126
|
+
input: SnapshotTrackFileInput;
|
|
1127
|
+
output: SuccessResponse;
|
|
1128
|
+
};
|
|
1129
|
+
'snapshot.create': {
|
|
1130
|
+
input: SnapshotCreateInput;
|
|
1131
|
+
output: SnapshotCreateOutput;
|
|
1132
|
+
};
|
|
1133
|
+
'snapshot.list': {
|
|
1134
|
+
input: SnapshotListInput;
|
|
1135
|
+
output: SnapshotListOutput;
|
|
1136
|
+
};
|
|
1137
|
+
'snapshot.has': {
|
|
1138
|
+
input: SnapshotHasInput;
|
|
1139
|
+
output: SnapshotHasOutput;
|
|
1140
|
+
};
|
|
1141
|
+
'snapshot.rewind': {
|
|
1142
|
+
input: SnapshotRewindInput;
|
|
1143
|
+
output: SnapshotRewindOutput;
|
|
1144
|
+
};
|
|
1145
|
+
'snapshot.previewRewind': {
|
|
1146
|
+
input: SnapshotPreviewRewindInput;
|
|
1147
|
+
output: SnapshotPreviewRewindOutput;
|
|
1148
|
+
};
|
|
1149
|
+
'snapshot.loadFromSession': {
|
|
1150
|
+
input: SnapshotLoadFromSessionInput;
|
|
1151
|
+
output: SuccessResponse;
|
|
1152
|
+
};
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
declare type ImagePart = {
|
|
1156
|
+
type: 'image';
|
|
1157
|
+
data: string;
|
|
1158
|
+
mimeType: string;
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1161
|
+
declare type Interleaved = {
|
|
1162
|
+
tagName?: string;
|
|
1163
|
+
separator?: string;
|
|
1164
|
+
startWithReasoning?: boolean;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
declare interface LocalCommand extends BaseSlashCommand {
|
|
1168
|
+
type: 'local';
|
|
1169
|
+
call(args: string, context: Context): Promise<string>;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
declare interface LocalJSXCommand extends BaseSlashCommand {
|
|
1173
|
+
type: 'local-jsx';
|
|
1174
|
+
call(onDone: (result: string | null) => void, context: Context, args?: string): Promise<React.ReactNode>;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
declare type LoopResult = {
|
|
1178
|
+
success: true;
|
|
1179
|
+
data: Record<string, any>;
|
|
1180
|
+
metadata: {
|
|
1181
|
+
turnsCount: number;
|
|
1182
|
+
toolCallsCount: number;
|
|
1183
|
+
duration: number;
|
|
1184
|
+
};
|
|
1185
|
+
} | {
|
|
1186
|
+
success: false;
|
|
1187
|
+
error: {
|
|
1188
|
+
type: 'tool_denied' | 'max_turns_exceeded' | 'api_error' | 'canceled';
|
|
1189
|
+
message: string;
|
|
1190
|
+
details?: Record<string, any>;
|
|
1191
|
+
};
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
declare interface MCPConfig {
|
|
1195
|
+
type?: 'stdio' | 'sse' | 'http';
|
|
1196
|
+
command?: string;
|
|
1197
|
+
args?: string[];
|
|
1198
|
+
env?: Record<string, string>;
|
|
1199
|
+
url?: string;
|
|
1200
|
+
disable?: boolean;
|
|
1201
|
+
/**
|
|
1202
|
+
* The timeout for tool calls in milliseconds.
|
|
1203
|
+
*/
|
|
1204
|
+
timeout?: number;
|
|
1205
|
+
headers?: Record<string, string>;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
declare type McpGetStatusInput = {
|
|
1209
|
+
cwd: string;
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
declare type McpGetStatusOutput = {
|
|
1213
|
+
success: boolean;
|
|
1214
|
+
error?: string;
|
|
1215
|
+
data: {
|
|
1216
|
+
servers: Record<string, {
|
|
1217
|
+
status: string;
|
|
1218
|
+
error?: string;
|
|
1219
|
+
toolCount: number;
|
|
1220
|
+
tools: string[];
|
|
1221
|
+
}>;
|
|
1222
|
+
configs: Record<string, McpServerConfig>;
|
|
1223
|
+
globalConfigPath: string;
|
|
1224
|
+
projectConfigPath: string;
|
|
1225
|
+
isReady: boolean;
|
|
1226
|
+
isLoading: boolean;
|
|
1227
|
+
};
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
declare type McpHttpServerConfig = {
|
|
1231
|
+
type: 'http';
|
|
1232
|
+
url: string;
|
|
1233
|
+
disable?: boolean;
|
|
1234
|
+
headers?: Record<string, string>;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
declare type McpListInput = {
|
|
1238
|
+
cwd: string;
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
declare type McpListOutput = {
|
|
1242
|
+
success: boolean;
|
|
1243
|
+
data: {
|
|
1244
|
+
projectServers: Record<string, McpServerConfig>;
|
|
1245
|
+
globalServers: Record<string, McpServerConfig>;
|
|
1246
|
+
activeServers: Record<string, {
|
|
1247
|
+
status: 'pending' | 'connecting' | 'connected' | 'failed' | 'disconnected';
|
|
1248
|
+
config: McpServerConfig;
|
|
1249
|
+
error?: string;
|
|
1250
|
+
toolCount?: number;
|
|
1251
|
+
tools: string[];
|
|
1252
|
+
scope: 'global' | 'project';
|
|
1253
|
+
}>;
|
|
1254
|
+
projectConfigPath: string;
|
|
1255
|
+
globalConfigPath: string;
|
|
1256
|
+
isReady: boolean;
|
|
1257
|
+
isLoading: boolean;
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
declare class MCPManager {
|
|
1262
|
+
#private;
|
|
1263
|
+
private servers;
|
|
1264
|
+
private configs;
|
|
1265
|
+
private isInitialized;
|
|
1266
|
+
private initPromise?;
|
|
1267
|
+
private initLock;
|
|
1268
|
+
static create(mcpServers: Record<string, MCPConfig>): MCPManager;
|
|
1269
|
+
initAsync(): Promise<void>;
|
|
1270
|
+
private _performInit;
|
|
1271
|
+
private _connectServer;
|
|
1272
|
+
getAllTools(): Promise<Tool[]>;
|
|
1273
|
+
getTools(keys: string[]): Promise<Tool[]>;
|
|
1274
|
+
destroy(): Promise<void>;
|
|
1275
|
+
getServerNames(): string[];
|
|
1276
|
+
hasServer(name: string): boolean;
|
|
1277
|
+
getServerStatus(name: string): MCPServerStatus | undefined;
|
|
1278
|
+
getServerError(name: string): string | undefined;
|
|
1279
|
+
getAllServerStatus(): Promise<Record<string, {
|
|
1280
|
+
status: MCPServerStatus;
|
|
1281
|
+
error?: string;
|
|
1282
|
+
toolCount: number;
|
|
1283
|
+
}>>;
|
|
1284
|
+
isReady(): boolean;
|
|
1285
|
+
isLoading(): boolean;
|
|
1286
|
+
retryConnection(serverName: string): Promise<void>;
|
|
1287
|
+
private _createClient;
|
|
1288
|
+
private _testConnectionAndFetchTools;
|
|
1289
|
+
private _isTemporaryError;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
declare type McpReconnectInput = {
|
|
1293
|
+
cwd: string;
|
|
1294
|
+
serverName: string;
|
|
1295
|
+
};
|
|
1296
|
+
|
|
1297
|
+
declare type McpReconnectOutput = {
|
|
1298
|
+
success: boolean;
|
|
1299
|
+
message?: string;
|
|
1300
|
+
error?: string;
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
declare type McpServerConfig = McpStdioServerConfig | McpSSEServerConfig | McpHttpServerConfig;
|
|
1304
|
+
|
|
1305
|
+
declare type MCPServerStatus = 'pending' | 'connecting' | 'connected' | 'failed' | 'disconnected';
|
|
1306
|
+
|
|
1307
|
+
declare type McpSSEServerConfig = {
|
|
1308
|
+
type: 'sse';
|
|
1309
|
+
url: string;
|
|
1310
|
+
disable?: boolean;
|
|
1311
|
+
headers?: Record<string, string>;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
declare type McpStdioServerConfig = {
|
|
1315
|
+
type: 'stdio';
|
|
1316
|
+
command: string;
|
|
1317
|
+
args: string[];
|
|
1318
|
+
env?: Record<string, string>;
|
|
1319
|
+
disable?: boolean;
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
declare type Message = RequestMessage | ResponseMessage | EventMessage;
|
|
1323
|
+
|
|
1324
|
+
declare type Message_2 = SystemMessage | UserMessage | AssistantMessage | ToolMessage | ToolMessage2;
|
|
1325
|
+
|
|
1326
|
+
declare class MessageBus extends EventEmitter {
|
|
1327
|
+
messageHandlers: Map<string, MessageHandler>;
|
|
1328
|
+
private transport?;
|
|
1329
|
+
private pendingRequests;
|
|
1330
|
+
private eventHandlers;
|
|
1331
|
+
constructor();
|
|
1332
|
+
setTransport(transport: MessageTransport): void;
|
|
1333
|
+
isConnected(): boolean;
|
|
1334
|
+
request<K extends keyof HandlerMap>(method: K, params: HandlerMap[K]['input'], options?: {
|
|
1335
|
+
timeout?: number;
|
|
1336
|
+
}): Promise<HandlerMap[K]['output']>;
|
|
1337
|
+
request(method: string, params: any, options?: {
|
|
1338
|
+
timeout?: number;
|
|
1339
|
+
}): Promise<any>;
|
|
1340
|
+
registerHandler<K extends keyof HandlerMap>(method: K, handler: (data: HandlerMap[K]['input']) => Promise<HandlerMap[K]['output']>): void;
|
|
1341
|
+
registerHandler(method: string, handler: MessageHandler): void;
|
|
1342
|
+
unregisterHandler(method: string): void;
|
|
1343
|
+
emitEvent(event: string, data: any): Promise<void>;
|
|
1344
|
+
onEvent(event: string, handler: EventHandler): void;
|
|
1345
|
+
offEvent(event: string, handler: EventHandler): void;
|
|
1346
|
+
private handleIncomingMessage;
|
|
1347
|
+
private handleRequest;
|
|
1348
|
+
private handleResponse;
|
|
1349
|
+
private handleEvent;
|
|
1350
|
+
private sendResponse;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
declare type MessageHandler = (data: any) => Promise<any>;
|
|
1354
|
+
|
|
1355
|
+
declare type MessageId = string;
|
|
1356
|
+
|
|
1357
|
+
declare interface MessageTransport {
|
|
1358
|
+
send: (message: Message) => Promise<void>;
|
|
1359
|
+
onMessage: (handler: (message: Message) => void) => void;
|
|
1360
|
+
onError: (handler: (error: Error) => void) => void;
|
|
1361
|
+
onClose: (handler: () => void) => void;
|
|
1362
|
+
close: () => Promise<void>;
|
|
1363
|
+
isConnected: () => boolean;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
declare interface Model {
|
|
1367
|
+
id: string;
|
|
1368
|
+
name: string;
|
|
1369
|
+
shortName?: string;
|
|
1370
|
+
attachment: boolean;
|
|
1371
|
+
reasoning: boolean;
|
|
1372
|
+
temperature: boolean;
|
|
1373
|
+
tool_call: boolean;
|
|
1374
|
+
knowledge: string;
|
|
1375
|
+
release_date: string;
|
|
1376
|
+
last_updated: string;
|
|
1377
|
+
modalities: ModelModalities;
|
|
1378
|
+
open_weights: boolean;
|
|
1379
|
+
cost: ModelCost;
|
|
1380
|
+
limit: ModelLimit;
|
|
1381
|
+
aliases?: string[];
|
|
1382
|
+
apiFormat?: ApiFormat;
|
|
1383
|
+
createModel?: CreateModel;
|
|
1384
|
+
interleaved?: Interleaved;
|
|
1385
|
+
variants?: Record<string, any>;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
declare type ModelAlias = Record<string, string>;
|
|
1389
|
+
|
|
1390
|
+
declare interface ModelCost {
|
|
1391
|
+
input: number;
|
|
1392
|
+
output: number;
|
|
1393
|
+
cache_read?: number;
|
|
1394
|
+
cache_write?: number;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
declare type ModelInfo = {
|
|
1398
|
+
provider: Provider;
|
|
1399
|
+
model: Omit<Model, 'cost'>;
|
|
1400
|
+
_mCreator: (hooks?: {
|
|
1401
|
+
onRequest?: UtilsOnRequestHook;
|
|
1402
|
+
onResponse?: UtilsOnResponseHook;
|
|
1403
|
+
}) => Promise<LanguageModelV3>;
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
declare interface ModelLimit {
|
|
1407
|
+
context: number;
|
|
1408
|
+
output: number;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
declare type ModelMap = Record<string, Omit<Model, 'id' | 'cost'>>;
|
|
1412
|
+
|
|
1413
|
+
declare interface ModelModalities {
|
|
1414
|
+
input: ('text' | 'image' | 'audio' | 'video' | 'pdf')[];
|
|
1415
|
+
output: ('text' | 'audio' | 'image')[];
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
declare type ModelsListInput = {
|
|
1419
|
+
cwd: string;
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
declare type ModelsListOutput = {
|
|
1423
|
+
success: boolean;
|
|
1424
|
+
data: {
|
|
1425
|
+
groupedModels: Array<{
|
|
1426
|
+
provider: string;
|
|
1427
|
+
providerId: string;
|
|
1428
|
+
isActive: boolean;
|
|
1429
|
+
models: Array<{
|
|
1430
|
+
name: string;
|
|
1431
|
+
modelId: string;
|
|
1432
|
+
value: string;
|
|
1433
|
+
}>;
|
|
1434
|
+
}>;
|
|
1435
|
+
currentModel: any;
|
|
1436
|
+
currentModelInfo: {
|
|
1437
|
+
providerName: string;
|
|
1438
|
+
modelName: string;
|
|
1439
|
+
modelId: string;
|
|
1440
|
+
modelContextLimit: number;
|
|
1441
|
+
} | null;
|
|
1442
|
+
nullModels: Array<{
|
|
1443
|
+
providerId: string;
|
|
1444
|
+
modelId: string;
|
|
1445
|
+
}>;
|
|
1446
|
+
recentModels: string[];
|
|
1447
|
+
thinkingLevel: string | undefined;
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
declare type ModelsTestInput = {
|
|
1452
|
+
cwd?: string;
|
|
1453
|
+
model: string;
|
|
1454
|
+
timeout?: number;
|
|
1455
|
+
prompt?: string;
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
declare type ModelsTestOutput = {
|
|
1459
|
+
success: true;
|
|
1460
|
+
data: {
|
|
1461
|
+
model: string;
|
|
1462
|
+
provider: string;
|
|
1463
|
+
modelName: string;
|
|
1464
|
+
prompt: string;
|
|
1465
|
+
response: string;
|
|
1466
|
+
responseTime: number;
|
|
1467
|
+
usage: {
|
|
1468
|
+
input_tokens: number;
|
|
1469
|
+
output_tokens: number;
|
|
1470
|
+
} | null;
|
|
1471
|
+
};
|
|
1472
|
+
} | {
|
|
1473
|
+
success: false;
|
|
1474
|
+
error: string;
|
|
1475
|
+
};
|
|
1476
|
+
|
|
1477
|
+
declare type NodeBridgeHandlers = Partial<{
|
|
1478
|
+
[K in keyof HandlerMap]: (data: HandlerMap[K]['input'], context: Context) => Promise<HandlerMap[K]['output']> | HandlerMap[K]['output'];
|
|
1479
|
+
}>;
|
|
1480
|
+
|
|
1481
|
+
declare type NormalizedMessage = Message_2 & {
|
|
1482
|
+
type: 'message';
|
|
1483
|
+
timestamp: string;
|
|
1484
|
+
uuid: string;
|
|
1485
|
+
parentUuid: string | null;
|
|
1486
|
+
uiContent?: string;
|
|
1487
|
+
metadata?: {
|
|
1488
|
+
agentId?: string;
|
|
1489
|
+
agentType?: string;
|
|
1490
|
+
[key: string]: any;
|
|
1491
|
+
};
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
declare class OutputStyle {
|
|
1495
|
+
name: string;
|
|
1496
|
+
description: string;
|
|
1497
|
+
isCodingRelated: boolean;
|
|
1498
|
+
prompt: string;
|
|
1499
|
+
constructor(opts: OutputStyleOpts);
|
|
1500
|
+
isDefault(): boolean;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
declare type OutputStyleOpts = {
|
|
1504
|
+
name: string;
|
|
1505
|
+
description: string;
|
|
1506
|
+
isCodingRelated: boolean;
|
|
1507
|
+
prompt: string;
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
declare type OutputStylesListInput = {
|
|
1511
|
+
cwd: string;
|
|
1512
|
+
};
|
|
1513
|
+
|
|
1514
|
+
declare type OutputStylesListOutput = {
|
|
1515
|
+
success: boolean;
|
|
1516
|
+
data: {
|
|
1517
|
+
outputStyles: Array<{
|
|
1518
|
+
name: string;
|
|
1519
|
+
description: string;
|
|
1520
|
+
}>;
|
|
1521
|
+
currentOutputStyle: any;
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
|
|
1525
|
+
export declare function parseArgs(argv: any): Promise<Argv>;
|
|
1526
|
+
|
|
1527
|
+
declare class Paths {
|
|
1528
|
+
globalConfigDir: string;
|
|
1529
|
+
globalProjectDir: string;
|
|
1530
|
+
projectConfigDir: string;
|
|
1531
|
+
fileHistoryDir: string;
|
|
1532
|
+
constructor(opts: {
|
|
1533
|
+
productName: string;
|
|
1534
|
+
cwd: string;
|
|
1535
|
+
});
|
|
1536
|
+
getSessionLogPath(sessionId: string): string;
|
|
1537
|
+
getLatestSessionId(): string | undefined;
|
|
1538
|
+
getAllSessions(): {
|
|
1539
|
+
sessionId: string;
|
|
1540
|
+
modified: Date;
|
|
1541
|
+
created: Date;
|
|
1542
|
+
messageCount: number;
|
|
1543
|
+
summary: string;
|
|
1544
|
+
}[];
|
|
1545
|
+
getGlobalDataPath(): string;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
declare type PlanModeExitReturnDisplay = {
|
|
1549
|
+
type: 'plan_mode_exit';
|
|
1550
|
+
planFilePath: string;
|
|
1551
|
+
planContent: string | null;
|
|
1552
|
+
isAgent: boolean;
|
|
1553
|
+
scenario: 'approved_with_plan' | 'approved_without_plan' | 'agent_completed';
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
declare type Plugin_2 = {
|
|
1557
|
+
enforce?: Enforce;
|
|
1558
|
+
name?: string;
|
|
1559
|
+
config?: (this: TempPluginContext, opts: {
|
|
1560
|
+
config: Config;
|
|
1561
|
+
argvConfig: Record<string, any>;
|
|
1562
|
+
}) => Partial<Config> | Promise<Partial<Config>>;
|
|
1563
|
+
slashCommand?: (this: PluginContext) => Promise<SlashCommand[]> | SlashCommand[];
|
|
1564
|
+
skill?: (this: PluginContext) => Promise<string[]> | string[];
|
|
1565
|
+
outputStyle?: (this: PluginContext) => Promise<OutputStyle[]> | OutputStyle[];
|
|
1566
|
+
provider?: (this: PluginContext, providers: ProvidersMap, opts: {
|
|
1567
|
+
models: ModelMap;
|
|
1568
|
+
defaultModelCreator: (name: string, provider: Provider) => LanguageModelV3;
|
|
1569
|
+
createOpenAI: (options: any) => OpenAIProvider;
|
|
1570
|
+
createOpenAICompatible: (options: any) => OpenAICompatibleProvider;
|
|
1571
|
+
createAnthropic: (options: any) => AnthropicProvider;
|
|
1572
|
+
}) => Promise<ProvidersMap> | ProvidersMap;
|
|
1573
|
+
modelAlias?: (this: PluginContext, modelAlias: ModelAlias) => Promise<ModelAlias> | ModelAlias;
|
|
1574
|
+
initialized?: (this: PluginContext, opts: {
|
|
1575
|
+
cwd: string;
|
|
1576
|
+
quiet: boolean;
|
|
1577
|
+
}) => Promise<void> | void;
|
|
1578
|
+
destroy?: (this: PluginContext) => Promise<void> | void;
|
|
1579
|
+
context?: (this: PluginContext, opts: {
|
|
1580
|
+
userPrompt: string | null;
|
|
1581
|
+
sessionId: string;
|
|
1582
|
+
}) => Promise<Record<string, string> | {}> | Record<string, string> | {};
|
|
1583
|
+
env?: (this: PluginContext, opts: {
|
|
1584
|
+
userPrompt: string | null;
|
|
1585
|
+
sessionId: string;
|
|
1586
|
+
}) => Promise<Record<string, string> | {}> | Record<string, string> | {};
|
|
1587
|
+
userPrompt?: (this: PluginContext, userPrompt: string, opts: {
|
|
1588
|
+
sessionId: string;
|
|
1589
|
+
}) => Promise<string> | string;
|
|
1590
|
+
systemPrompt?: (this: PluginContext, systemPrompt: string, opts: {
|
|
1591
|
+
isPlan?: boolean;
|
|
1592
|
+
sessionId: string;
|
|
1593
|
+
}) => Promise<string> | string;
|
|
1594
|
+
tool?: (this: PluginContext, opts: {
|
|
1595
|
+
isPlan?: boolean;
|
|
1596
|
+
sessionId: string;
|
|
1597
|
+
}) => Promise<Tool[]> | Tool[];
|
|
1598
|
+
toolUse?: (this: PluginContext, toolUse: ToolUse, opts: {
|
|
1599
|
+
sessionId: string;
|
|
1600
|
+
}) => Promise<ToolUse> | ToolUse;
|
|
1601
|
+
toolResult?: (this: PluginContext, toolResult: ToolResult, opts: {
|
|
1602
|
+
toolUse: ToolUse;
|
|
1603
|
+
approved: boolean;
|
|
1604
|
+
sessionId: string;
|
|
1605
|
+
}) => Promise<ToolResult> | ToolResult;
|
|
1606
|
+
query?: (this: PluginContext, opts: {
|
|
1607
|
+
usage: Usage;
|
|
1608
|
+
startTime: Date;
|
|
1609
|
+
endTime: Date;
|
|
1610
|
+
sessionId: string;
|
|
1611
|
+
}) => Promise<void> | void;
|
|
1612
|
+
conversation?: (this: PluginContext, opts: {
|
|
1613
|
+
userPrompt: string | null;
|
|
1614
|
+
result: LoopResult;
|
|
1615
|
+
startTime: Date;
|
|
1616
|
+
endTime: Date;
|
|
1617
|
+
sessionId: string;
|
|
1618
|
+
}) => Promise<void> | void;
|
|
1619
|
+
status?: (this: PluginContext) => Promise<Status> | Status;
|
|
1620
|
+
agent?: (this: PluginContext) => Promise<PluginAgentDefinition[]> | PluginAgentDefinition[];
|
|
1621
|
+
telemetry?: (this: PluginContext, opts: {
|
|
1622
|
+
name: string;
|
|
1623
|
+
payload: Record<string, any>;
|
|
1624
|
+
}) => Promise<void> | void;
|
|
1625
|
+
stop?: (this: PluginContext, opts: {
|
|
1626
|
+
sessionId: string;
|
|
1627
|
+
result: LoopResult;
|
|
1628
|
+
usage: Usage;
|
|
1629
|
+
turnsCount: number;
|
|
1630
|
+
toolCallsCount: number;
|
|
1631
|
+
duration: number;
|
|
1632
|
+
model: string;
|
|
1633
|
+
}) => Promise<void> | void;
|
|
1634
|
+
subagentStop?: (this: PluginContext, opts: {
|
|
1635
|
+
parentSessionId: string;
|
|
1636
|
+
agentId: string;
|
|
1637
|
+
agentType: string;
|
|
1638
|
+
result: AgentExecutionResult;
|
|
1639
|
+
usage: {
|
|
1640
|
+
inputTokens: number;
|
|
1641
|
+
outputTokens: number;
|
|
1642
|
+
};
|
|
1643
|
+
totalToolCalls: number;
|
|
1644
|
+
totalDuration: number;
|
|
1645
|
+
model: string;
|
|
1646
|
+
}) => Promise<void> | void;
|
|
1647
|
+
nodeBridgeHandler?: (this: PluginContext) => Promise<NodeBridgeHandlers> | NodeBridgeHandlers;
|
|
1648
|
+
};
|
|
1649
|
+
export { Plugin_2 as Plugin }
|
|
1650
|
+
|
|
1651
|
+
declare type PluginAgentDefinition = Omit<AgentDefinition, 'source' | 'model'> & {
|
|
1652
|
+
model?: string;
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1655
|
+
declare type PluginApplyOpts = {
|
|
1656
|
+
hook: keyof Plugin_2;
|
|
1657
|
+
args: any[];
|
|
1658
|
+
memo?: any;
|
|
1659
|
+
type: PluginHookType;
|
|
1660
|
+
pluginContext: any;
|
|
1661
|
+
};
|
|
1662
|
+
|
|
1663
|
+
declare type PluginContext = Context;
|
|
1664
|
+
|
|
1665
|
+
declare enum PluginHookType {
|
|
1666
|
+
First = "first",
|
|
1667
|
+
Series = "series",
|
|
1668
|
+
SeriesMerge = "seriesMerge",
|
|
1669
|
+
SeriesLast = "seriesLast",
|
|
1670
|
+
Parallel = "parallel"
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
declare class PluginManager {
|
|
1674
|
+
#private;
|
|
1675
|
+
constructor(rawPlugins: Plugin_2[]);
|
|
1676
|
+
apply({ hook, args, memo, type, pluginContext, }: PluginApplyOpts): Promise<any>;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
declare interface PreviewSkillsResult {
|
|
1680
|
+
tempDir: string;
|
|
1681
|
+
skills: SkillPreview[];
|
|
1682
|
+
errors: SkillError[];
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
declare type ProjectAddHistoryInput = {
|
|
1686
|
+
cwd: string;
|
|
1687
|
+
history: string;
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1690
|
+
declare type ProjectAddMemoryInput = {
|
|
1691
|
+
cwd: string;
|
|
1692
|
+
global: boolean;
|
|
1693
|
+
rule: string;
|
|
1694
|
+
};
|
|
1695
|
+
|
|
1696
|
+
declare type ProjectAnalyzeContextInput = {
|
|
1697
|
+
cwd: string;
|
|
1698
|
+
sessionId: string;
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
declare type ProjectAnalyzeContextOutput = {
|
|
1702
|
+
success: boolean;
|
|
1703
|
+
error?: string;
|
|
1704
|
+
data?: {
|
|
1705
|
+
systemPrompt: {
|
|
1706
|
+
tokens: number;
|
|
1707
|
+
percentage: number;
|
|
1708
|
+
};
|
|
1709
|
+
systemTools: {
|
|
1710
|
+
tokens: number;
|
|
1711
|
+
percentage: number;
|
|
1712
|
+
};
|
|
1713
|
+
mcpTools: {
|
|
1714
|
+
tokens: number;
|
|
1715
|
+
percentage: number;
|
|
1716
|
+
};
|
|
1717
|
+
messages: {
|
|
1718
|
+
tokens: number;
|
|
1719
|
+
percentage: number;
|
|
1720
|
+
};
|
|
1721
|
+
freeSpace: {
|
|
1722
|
+
tokens: number;
|
|
1723
|
+
percentage: number;
|
|
1724
|
+
};
|
|
1725
|
+
totalContextWindow: number;
|
|
1726
|
+
};
|
|
1727
|
+
};
|
|
1728
|
+
|
|
1729
|
+
declare type ProjectClearContextInput = {
|
|
1730
|
+
cwd?: string;
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1733
|
+
declare type ProjectGenerateCommitInput = {
|
|
1734
|
+
cwd: string;
|
|
1735
|
+
language?: string;
|
|
1736
|
+
systemPrompt?: string;
|
|
1737
|
+
model?: string;
|
|
1738
|
+
diff?: string;
|
|
1739
|
+
fileList?: string;
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1742
|
+
declare type ProjectGenerateCommitOutput = {
|
|
1743
|
+
success: boolean;
|
|
1744
|
+
error?: string;
|
|
1745
|
+
data?: {
|
|
1746
|
+
commitMessage: string;
|
|
1747
|
+
branchName: string;
|
|
1748
|
+
isBreakingChange: boolean;
|
|
1749
|
+
summary: string;
|
|
1750
|
+
};
|
|
1751
|
+
};
|
|
1752
|
+
|
|
1753
|
+
declare type ProjectGetRepoInfoInput = {
|
|
1754
|
+
cwd: string;
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
declare type ProjectGetRepoInfoOutput = {
|
|
1758
|
+
success: boolean;
|
|
1759
|
+
error?: string;
|
|
1760
|
+
data?: {
|
|
1761
|
+
repoData: {
|
|
1762
|
+
path: string;
|
|
1763
|
+
name: string;
|
|
1764
|
+
workspaceIds: string[];
|
|
1765
|
+
metadata: {
|
|
1766
|
+
lastAccessed: number;
|
|
1767
|
+
settings: any;
|
|
1768
|
+
};
|
|
1769
|
+
gitRemote?: {
|
|
1770
|
+
originUrl: string | null;
|
|
1771
|
+
defaultBranch: string | null;
|
|
1772
|
+
};
|
|
1773
|
+
};
|
|
1774
|
+
timings?: Record<string, number>;
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
|
|
1778
|
+
declare type ProjectsListInput = {
|
|
1779
|
+
cwd: string;
|
|
1780
|
+
includeSessionDetails?: boolean;
|
|
1781
|
+
};
|
|
1782
|
+
|
|
1783
|
+
declare type ProjectsListOutput = {
|
|
1784
|
+
success: boolean;
|
|
1785
|
+
error?: string;
|
|
1786
|
+
data?: {
|
|
1787
|
+
projects: Array<{
|
|
1788
|
+
path: string;
|
|
1789
|
+
lastAccessed: number | null;
|
|
1790
|
+
sessionCount: number;
|
|
1791
|
+
sessions?: Array<{
|
|
1792
|
+
sessionId: string;
|
|
1793
|
+
modified: Date;
|
|
1794
|
+
created: Date;
|
|
1795
|
+
messageCount: number;
|
|
1796
|
+
summary: string;
|
|
1797
|
+
}>;
|
|
1798
|
+
}>;
|
|
1799
|
+
};
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
declare type ProjectWorkspacesCreateGithubPRInput = {
|
|
1803
|
+
cwd: string;
|
|
1804
|
+
name: string;
|
|
1805
|
+
title?: string;
|
|
1806
|
+
description?: string;
|
|
1807
|
+
baseBranch?: string;
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
declare type ProjectWorkspacesCreateGithubPROutput = {
|
|
1811
|
+
success: boolean;
|
|
1812
|
+
error?: string;
|
|
1813
|
+
data?: {
|
|
1814
|
+
prUrl: string;
|
|
1815
|
+
prNumber: number;
|
|
1816
|
+
};
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
declare type ProjectWorkspacesCreateInput = {
|
|
1820
|
+
cwd: string;
|
|
1821
|
+
name?: string;
|
|
1822
|
+
skipUpdate?: boolean;
|
|
1823
|
+
};
|
|
1824
|
+
|
|
1825
|
+
declare type ProjectWorkspacesCreateOutput = {
|
|
1826
|
+
success: boolean;
|
|
1827
|
+
error?: string;
|
|
1828
|
+
data?: {
|
|
1829
|
+
workspace: {
|
|
1830
|
+
name: string;
|
|
1831
|
+
path: string;
|
|
1832
|
+
branch: string;
|
|
1833
|
+
};
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
declare type ProjectWorkspacesDeleteInput = {
|
|
1838
|
+
cwd: string;
|
|
1839
|
+
name: string;
|
|
1840
|
+
force?: boolean;
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
declare type ProjectWorkspacesDeleteOutput = {
|
|
1844
|
+
success: boolean;
|
|
1845
|
+
error?: string;
|
|
1846
|
+
};
|
|
1847
|
+
|
|
1848
|
+
declare type ProjectWorkspacesGetInput = {
|
|
1849
|
+
cwd: string;
|
|
1850
|
+
workspaceId: string;
|
|
1851
|
+
};
|
|
1852
|
+
|
|
1853
|
+
declare type ProjectWorkspacesGetOutput = {
|
|
1854
|
+
success: boolean;
|
|
1855
|
+
error?: string;
|
|
1856
|
+
data?: WorkspaceData;
|
|
1857
|
+
};
|
|
1858
|
+
|
|
1859
|
+
declare type ProjectWorkspacesListInput = {
|
|
1860
|
+
cwd: string;
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
declare type ProjectWorkspacesListOutput = {
|
|
1864
|
+
success: boolean;
|
|
1865
|
+
error?: string;
|
|
1866
|
+
data?: {
|
|
1867
|
+
workspaces: WorkspaceData[];
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
declare type ProjectWorkspacesMergeInput = {
|
|
1872
|
+
cwd: string;
|
|
1873
|
+
name: string;
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
declare type ProjectWorkspacesMergeOutput = {
|
|
1877
|
+
success: boolean;
|
|
1878
|
+
error?: string;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
declare function prompt_2(message: string, options: SDKSessionOptions): Promise<SDKResultMessage>;
|
|
1882
|
+
export { prompt_2 as prompt }
|
|
1883
|
+
|
|
1884
|
+
declare interface PromptCommand extends BaseSlashCommand {
|
|
1885
|
+
type: 'prompt';
|
|
1886
|
+
progressMessage?: string;
|
|
1887
|
+
model?: string;
|
|
1888
|
+
getPromptForCommand(args: string): Promise<Array<{
|
|
1889
|
+
role: string;
|
|
1890
|
+
content: string;
|
|
1891
|
+
}>>;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
declare interface Provider {
|
|
1895
|
+
id: string;
|
|
1896
|
+
env: string[];
|
|
1897
|
+
name: string;
|
|
1898
|
+
apiEnv?: string[];
|
|
1899
|
+
api?: string;
|
|
1900
|
+
doc: string;
|
|
1901
|
+
models: Record<string, ProviderModel>;
|
|
1902
|
+
createModel?: CreateModel;
|
|
1903
|
+
apiFormat?: ApiFormat;
|
|
1904
|
+
options?: {
|
|
1905
|
+
baseURL?: string;
|
|
1906
|
+
apiKey?: string;
|
|
1907
|
+
headers?: Record<string, string>;
|
|
1908
|
+
httpProxy?: string;
|
|
1909
|
+
};
|
|
1910
|
+
source?: 'built-in' | string;
|
|
1911
|
+
headers?: Record<string, string>;
|
|
1912
|
+
middlewares?: LanguageModelMiddleware[];
|
|
1913
|
+
interleaved?: Interleaved;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
export declare type ProviderConfig = Partial<Omit<Provider, 'createModel'>>;
|
|
1917
|
+
|
|
1918
|
+
declare type ProviderModel = string | Partial<Model>;
|
|
1919
|
+
|
|
1920
|
+
declare type ProvidersListInput = {
|
|
1921
|
+
cwd: string;
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
declare type ProvidersListOutput = {
|
|
1925
|
+
success: boolean;
|
|
1926
|
+
data: {
|
|
1927
|
+
providers: Array<{
|
|
1928
|
+
id: string;
|
|
1929
|
+
name: string;
|
|
1930
|
+
doc?: string;
|
|
1931
|
+
env?: string[];
|
|
1932
|
+
apiEnv?: string[];
|
|
1933
|
+
api?: string;
|
|
1934
|
+
apiFormat?: 'anthropic' | 'openai' | 'responses';
|
|
1935
|
+
source?: 'built-in' | string;
|
|
1936
|
+
options?: {
|
|
1937
|
+
baseURL?: string;
|
|
1938
|
+
apiKey?: string;
|
|
1939
|
+
headers?: Record<string, string>;
|
|
1940
|
+
httpProxy?: string;
|
|
1941
|
+
};
|
|
1942
|
+
validEnvs: string[];
|
|
1943
|
+
hasApiKey: boolean;
|
|
1944
|
+
maskedApiKey?: string;
|
|
1945
|
+
apiKeyOrigin?: 'env' | 'config';
|
|
1946
|
+
apiKeyEnvName?: string;
|
|
1947
|
+
oauthUser?: string;
|
|
1948
|
+
}>;
|
|
1949
|
+
};
|
|
1950
|
+
};
|
|
1951
|
+
|
|
1952
|
+
declare type ProvidersLoginCompleteOAuthInput = {
|
|
1953
|
+
cwd: string;
|
|
1954
|
+
providerId: 'github-copilot' | 'qwen' | 'codex';
|
|
1955
|
+
oauthSessionId: string;
|
|
1956
|
+
code: string;
|
|
1957
|
+
};
|
|
1958
|
+
|
|
1959
|
+
declare type ProvidersLoginCompleteOAuthOutput = {
|
|
1960
|
+
success: true;
|
|
1961
|
+
data: {
|
|
1962
|
+
user?: string;
|
|
1963
|
+
};
|
|
1964
|
+
} | {
|
|
1965
|
+
success: false;
|
|
1966
|
+
error: string;
|
|
1967
|
+
};
|
|
1968
|
+
|
|
1969
|
+
declare type ProvidersLoginInitOAuthInput = {
|
|
1970
|
+
cwd: string;
|
|
1971
|
+
providerId: 'github-copilot' | 'qwen' | 'codex';
|
|
1972
|
+
timeout?: number;
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1975
|
+
declare type ProvidersLoginInitOAuthOutput = {
|
|
1976
|
+
success: true;
|
|
1977
|
+
data: {
|
|
1978
|
+
authUrl: string;
|
|
1979
|
+
userCode?: string;
|
|
1980
|
+
oauthSessionId: string;
|
|
1981
|
+
};
|
|
1982
|
+
} | {
|
|
1983
|
+
success: false;
|
|
1984
|
+
error: string;
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
declare type ProvidersLoginPollOAuthInput = {
|
|
1988
|
+
cwd: string;
|
|
1989
|
+
oauthSessionId: string;
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
declare type ProvidersLoginPollOAuthOutput = {
|
|
1993
|
+
success: true;
|
|
1994
|
+
data: {
|
|
1995
|
+
status: 'pending' | 'completed' | 'error';
|
|
1996
|
+
user?: string;
|
|
1997
|
+
error?: string;
|
|
1998
|
+
};
|
|
1999
|
+
} | {
|
|
2000
|
+
success: false;
|
|
2001
|
+
error: string;
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
declare type ProvidersLoginStatusInput = {
|
|
2005
|
+
cwd: string;
|
|
2006
|
+
providerId: string;
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
declare type ProvidersLoginStatusOutput = {
|
|
2010
|
+
success: true;
|
|
2011
|
+
data: {
|
|
2012
|
+
isLoggedIn: boolean;
|
|
2013
|
+
user?: string;
|
|
2014
|
+
};
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
declare type ProvidersMap = Record<string, Provider>;
|
|
2018
|
+
|
|
2019
|
+
export declare function _query(opts: {
|
|
2020
|
+
userPrompt: string;
|
|
2021
|
+
messages?: NormalizedMessage[];
|
|
2022
|
+
context?: Context;
|
|
2023
|
+
model?: ModelInfo;
|
|
2024
|
+
systemPrompt?: string;
|
|
2025
|
+
onMessage?: (message: NormalizedMessage) => Promise<void>;
|
|
2026
|
+
thinking?: ThinkingConfig | false;
|
|
2027
|
+
responseFormat?: ResponseFormat;
|
|
2028
|
+
}): Promise<LoopResult>;
|
|
2029
|
+
|
|
2030
|
+
declare type ReasoningEffort = 'low' | 'medium' | 'high' | 'max' | 'xhigh';
|
|
2031
|
+
|
|
2032
|
+
declare type ReasoningPart = {
|
|
2033
|
+
type: 'reasoning';
|
|
2034
|
+
text: string;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
declare type RequestMessage = BaseMessage & {
|
|
2038
|
+
type: 'request';
|
|
2039
|
+
method: string;
|
|
2040
|
+
params: any;
|
|
2041
|
+
};
|
|
2042
|
+
|
|
2043
|
+
declare type ResponseFormat = {
|
|
2044
|
+
type: 'text';
|
|
2045
|
+
} | {
|
|
2046
|
+
type: 'json';
|
|
2047
|
+
schema?: any;
|
|
2048
|
+
name?: string;
|
|
2049
|
+
description?: string;
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2052
|
+
declare type ResponseMessage = BaseMessage & {
|
|
2053
|
+
type: 'response';
|
|
2054
|
+
result?: any;
|
|
2055
|
+
error?: any;
|
|
2056
|
+
};
|
|
2057
|
+
|
|
2058
|
+
export declare function resumeSession(sessionId: string, options: SDKSessionOptions): Promise<SDKSession>;
|
|
2059
|
+
|
|
2060
|
+
declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoWriteReturnDisplay | AgentResultReturnDisplay | PlanModeExitReturnDisplay;
|
|
2061
|
+
|
|
2062
|
+
declare type RewindResult = {
|
|
2063
|
+
success: boolean;
|
|
2064
|
+
error?: string;
|
|
2065
|
+
filesChanged: string[];
|
|
2066
|
+
insertions: number;
|
|
2067
|
+
deletions: number;
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* Rewind operation result
|
|
2072
|
+
*/
|
|
2073
|
+
declare type RewindResult_2 = {
|
|
2074
|
+
success: boolean;
|
|
2075
|
+
error?: string;
|
|
2076
|
+
/** List of restored files */
|
|
2077
|
+
filesChanged: string[];
|
|
2078
|
+
/** Change statistics */
|
|
2079
|
+
insertions: number;
|
|
2080
|
+
deletions: number;
|
|
2081
|
+
/** File diffs for UI display (only in preview mode) */
|
|
2082
|
+
fileDiffs?: FileDiff[];
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
export declare function runNeovate(opts: {
|
|
2086
|
+
productName: string;
|
|
2087
|
+
productASCIIArt?: string;
|
|
2088
|
+
version: string;
|
|
2089
|
+
plugins: Plugin_2[];
|
|
2090
|
+
upgrade?: UpgradeOptions;
|
|
2091
|
+
argv: Argv;
|
|
2092
|
+
fetch?: typeof globalThis.fetch;
|
|
2093
|
+
}): Promise<{
|
|
2094
|
+
shutdown?: () => Promise<void>;
|
|
2095
|
+
}>;
|
|
2096
|
+
|
|
2097
|
+
export declare type SDKMessage = NormalizedMessage | SDKSystemMessage | SDKResultMessage;
|
|
2098
|
+
|
|
2099
|
+
declare type SDKResultMessage = {
|
|
2100
|
+
type: 'result';
|
|
2101
|
+
subtype: 'success' | 'error';
|
|
2102
|
+
isError: boolean;
|
|
2103
|
+
content: string;
|
|
2104
|
+
sessionId: string;
|
|
2105
|
+
__result?: any;
|
|
2106
|
+
usage?: {
|
|
2107
|
+
input_tokens: number;
|
|
2108
|
+
output_tokens: number;
|
|
2109
|
+
};
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
export declare interface SDKSession {
|
|
2113
|
+
readonly sessionId: string;
|
|
2114
|
+
send(message: string | SDKUserMessage): Promise<void>;
|
|
2115
|
+
receive(): AsyncGenerator<SDKMessage, void>;
|
|
2116
|
+
close(): void;
|
|
2117
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
export declare type SDKSessionOptions = {
|
|
2121
|
+
model: string;
|
|
2122
|
+
cwd?: string;
|
|
2123
|
+
productName?: string;
|
|
2124
|
+
plugins?: Plugin_2[];
|
|
2125
|
+
/**
|
|
2126
|
+
* Custom provider configurations to add or override built-in providers.
|
|
2127
|
+
* Allows specifying custom API endpoints and model definitions.
|
|
2128
|
+
*
|
|
2129
|
+
* @example
|
|
2130
|
+
* ```typescript
|
|
2131
|
+
* providers: {
|
|
2132
|
+
* "my-custom-provider": {
|
|
2133
|
+
* api: "https://my-api.example.com/v1",
|
|
2134
|
+
* env: ["MY_API_KEY"],
|
|
2135
|
+
* models: {
|
|
2136
|
+
* "my-model": "deepseek-v3.2" // Reference existing model
|
|
2137
|
+
* }
|
|
2138
|
+
* }
|
|
2139
|
+
* }
|
|
2140
|
+
* ```
|
|
2141
|
+
*/
|
|
2142
|
+
providers?: Record<string, ProviderConfig>;
|
|
2143
|
+
/**
|
|
2144
|
+
* Extra SKILL.md file paths for user-defined skills.
|
|
2145
|
+
* Accepts absolute paths to SKILL.md files or directories containing SKILL.md.
|
|
2146
|
+
*
|
|
2147
|
+
* @example
|
|
2148
|
+
* ```typescript
|
|
2149
|
+
* skills: [
|
|
2150
|
+
* "/path/to/my-skill/SKILL.md",
|
|
2151
|
+
* "/path/to/skill-directory"
|
|
2152
|
+
* ]
|
|
2153
|
+
* ```
|
|
2154
|
+
*/
|
|
2155
|
+
skills?: string[];
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
declare type SDKSystemMessage = {
|
|
2159
|
+
type: 'system';
|
|
2160
|
+
subtype: 'init';
|
|
2161
|
+
sessionId: string;
|
|
2162
|
+
model: string;
|
|
2163
|
+
cwd: string;
|
|
2164
|
+
tools: string[];
|
|
2165
|
+
};
|
|
2166
|
+
|
|
2167
|
+
export declare type SDKUserMessage = {
|
|
2168
|
+
type: 'user';
|
|
2169
|
+
message: UserContent;
|
|
2170
|
+
parentUuid: string | null;
|
|
2171
|
+
uuid: string;
|
|
2172
|
+
sessionId: string;
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
declare type SerializedSnapshot = {
|
|
2176
|
+
messageId: string;
|
|
2177
|
+
timestamp: string;
|
|
2178
|
+
trackedFileBackups: Record<string, {
|
|
2179
|
+
backupFileName: string | null;
|
|
2180
|
+
version: number;
|
|
2181
|
+
backupTime: string;
|
|
2182
|
+
}>;
|
|
2183
|
+
};
|
|
2184
|
+
|
|
2185
|
+
/**
|
|
2186
|
+
* Serialized snapshot data (for JSONL storage)
|
|
2187
|
+
*/
|
|
2188
|
+
declare type SerializedSnapshot_2 = {
|
|
2189
|
+
messageId: string;
|
|
2190
|
+
timestamp: string;
|
|
2191
|
+
trackedFileBackups: Record<string, {
|
|
2192
|
+
backupFileName: string | null;
|
|
2193
|
+
version: number;
|
|
2194
|
+
backupTime: string;
|
|
2195
|
+
}>;
|
|
2196
|
+
};
|
|
2197
|
+
|
|
2198
|
+
declare type SessionAddMessagesInput = {
|
|
2199
|
+
cwd: string;
|
|
2200
|
+
sessionId: string;
|
|
2201
|
+
messages: Message_2[];
|
|
2202
|
+
parentUuid?: string;
|
|
2203
|
+
};
|
|
2204
|
+
|
|
2205
|
+
declare type SessionCancelInput = {
|
|
2206
|
+
cwd: string;
|
|
2207
|
+
sessionId: string;
|
|
2208
|
+
};
|
|
2209
|
+
|
|
2210
|
+
declare type SessionCompactInput = {
|
|
2211
|
+
cwd: string;
|
|
2212
|
+
sessionId: string;
|
|
2213
|
+
messages: NormalizedMessage[];
|
|
2214
|
+
};
|
|
2215
|
+
|
|
2216
|
+
declare type SessionCompactOutput = {
|
|
2217
|
+
success: boolean;
|
|
2218
|
+
data: {
|
|
2219
|
+
summary: string;
|
|
2220
|
+
};
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2223
|
+
declare type SessionConfigAddApprovalToolsInput = {
|
|
2224
|
+
cwd: string;
|
|
2225
|
+
sessionId: string;
|
|
2226
|
+
approvalTool: string;
|
|
2227
|
+
};
|
|
2228
|
+
|
|
2229
|
+
declare type SessionConfigAddDirectoryInput = {
|
|
2230
|
+
cwd: string;
|
|
2231
|
+
sessionId: string;
|
|
2232
|
+
directory: string;
|
|
2233
|
+
};
|
|
2234
|
+
|
|
2235
|
+
declare type SessionConfigGetAdditionalDirectoriesInput = {
|
|
2236
|
+
cwd: string;
|
|
2237
|
+
sessionId: string;
|
|
2238
|
+
};
|
|
2239
|
+
|
|
2240
|
+
declare type SessionConfigGetAdditionalDirectoriesOutput = {
|
|
2241
|
+
success: boolean;
|
|
2242
|
+
data: {
|
|
2243
|
+
directories: string[];
|
|
2244
|
+
};
|
|
2245
|
+
};
|
|
2246
|
+
|
|
2247
|
+
declare type SessionConfigGetInput = {
|
|
2248
|
+
cwd: string;
|
|
2249
|
+
sessionId: string;
|
|
2250
|
+
key?: string;
|
|
2251
|
+
};
|
|
2252
|
+
|
|
2253
|
+
declare type SessionConfigGetOutput = {
|
|
2254
|
+
success: boolean;
|
|
2255
|
+
data: {
|
|
2256
|
+
value: any;
|
|
2257
|
+
};
|
|
2258
|
+
};
|
|
2259
|
+
|
|
2260
|
+
declare type SessionConfigRemoveDirectoryInput = {
|
|
2261
|
+
cwd: string;
|
|
2262
|
+
sessionId: string;
|
|
2263
|
+
directory: string;
|
|
2264
|
+
};
|
|
2265
|
+
|
|
2266
|
+
declare type SessionConfigRemoveInput = {
|
|
2267
|
+
cwd: string;
|
|
2268
|
+
sessionId: string;
|
|
2269
|
+
key: string;
|
|
2270
|
+
};
|
|
2271
|
+
|
|
2272
|
+
declare type SessionConfigSetApprovalModeInput = {
|
|
2273
|
+
cwd: string;
|
|
2274
|
+
sessionId: string;
|
|
2275
|
+
approvalMode: ApprovalMode;
|
|
2276
|
+
};
|
|
2277
|
+
|
|
2278
|
+
declare type SessionConfigSetInput = {
|
|
2279
|
+
cwd: string;
|
|
2280
|
+
sessionId: string;
|
|
2281
|
+
key: string;
|
|
2282
|
+
value: any;
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
declare type SessionConfigSetPastedImageMapInput = {
|
|
2286
|
+
cwd: string;
|
|
2287
|
+
sessionId: string;
|
|
2288
|
+
pastedImageMap: Record<string, string>;
|
|
2289
|
+
};
|
|
2290
|
+
|
|
2291
|
+
declare type SessionConfigSetPastedTextMapInput = {
|
|
2292
|
+
cwd: string;
|
|
2293
|
+
sessionId: string;
|
|
2294
|
+
pastedTextMap: Record<string, string>;
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
declare type SessionConfigSetSummaryInput = {
|
|
2298
|
+
cwd: string;
|
|
2299
|
+
sessionId: string;
|
|
2300
|
+
summary: string;
|
|
2301
|
+
};
|
|
2302
|
+
|
|
2303
|
+
declare type SessionExportSessionMarkdownInput = {
|
|
2304
|
+
cwd: string;
|
|
2305
|
+
sessionId: string | undefined;
|
|
2306
|
+
};
|
|
2307
|
+
|
|
2308
|
+
declare type SessionExportSessionMarkdownOutput = {
|
|
2309
|
+
success: true;
|
|
2310
|
+
data: {
|
|
2311
|
+
filePath: string;
|
|
2312
|
+
};
|
|
2313
|
+
} | {
|
|
2314
|
+
success: false;
|
|
2315
|
+
error: string;
|
|
2316
|
+
};
|
|
2317
|
+
|
|
2318
|
+
declare type SessionGetModelInput = {
|
|
2319
|
+
cwd: string;
|
|
2320
|
+
sessionId: string;
|
|
2321
|
+
includeModelInfo?: boolean;
|
|
2322
|
+
};
|
|
2323
|
+
|
|
2324
|
+
declare type SessionGetModelOutput = {
|
|
2325
|
+
success: true;
|
|
2326
|
+
data: {
|
|
2327
|
+
model: string | null;
|
|
2328
|
+
};
|
|
2329
|
+
} | {
|
|
2330
|
+
success: true;
|
|
2331
|
+
data: {
|
|
2332
|
+
model: string | null;
|
|
2333
|
+
modelInfo: ModelInfo | null;
|
|
2334
|
+
providers: ProvidersMap;
|
|
2335
|
+
};
|
|
2336
|
+
} | {
|
|
2337
|
+
success: false;
|
|
2338
|
+
error: any;
|
|
2339
|
+
};
|
|
2340
|
+
|
|
2341
|
+
declare type SessionInitializeInput = {
|
|
2342
|
+
cwd: string;
|
|
2343
|
+
sessionId?: string;
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2346
|
+
declare type SessionInitializeOutput = {
|
|
2347
|
+
success: boolean;
|
|
2348
|
+
error?: any;
|
|
2349
|
+
data: {
|
|
2350
|
+
productName: string;
|
|
2351
|
+
productASCIIArt: string | undefined;
|
|
2352
|
+
version: string;
|
|
2353
|
+
model: any;
|
|
2354
|
+
planModel: string | undefined;
|
|
2355
|
+
initializeModelError: string | null;
|
|
2356
|
+
providers: any;
|
|
2357
|
+
approvalMode: ApprovalMode;
|
|
2358
|
+
sessionSummary: string | undefined;
|
|
2359
|
+
pastedTextMap: Record<string, string>;
|
|
2360
|
+
pastedImageMap: Record<string, string>;
|
|
2361
|
+
thinkingLevel: string | undefined;
|
|
2362
|
+
};
|
|
2363
|
+
};
|
|
2364
|
+
|
|
2365
|
+
declare type SessionMessagesListInput = {
|
|
2366
|
+
cwd: string;
|
|
2367
|
+
sessionId: string;
|
|
2368
|
+
};
|
|
2369
|
+
|
|
2370
|
+
declare type SessionMessagesListOutput = {
|
|
2371
|
+
success: boolean;
|
|
2372
|
+
data: {
|
|
2373
|
+
messages: NormalizedMessage[];
|
|
2374
|
+
};
|
|
2375
|
+
};
|
|
2376
|
+
|
|
2377
|
+
declare type SessionSendInput = {
|
|
2378
|
+
message: string | null;
|
|
2379
|
+
cwd: string;
|
|
2380
|
+
sessionId: string | undefined;
|
|
2381
|
+
planMode: boolean;
|
|
2382
|
+
model?: string;
|
|
2383
|
+
attachments?: ImagePart[];
|
|
2384
|
+
parentUuid?: string;
|
|
2385
|
+
thinking?: ThinkingConfig;
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
declare type SessionSendOutput = any;
|
|
2389
|
+
|
|
2390
|
+
declare type SessionsListInput = {
|
|
2391
|
+
cwd: string;
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
declare type SessionsListOutput = {
|
|
2395
|
+
success: boolean;
|
|
2396
|
+
data: {
|
|
2397
|
+
sessions: Array<{
|
|
2398
|
+
sessionId: string;
|
|
2399
|
+
modified: Date;
|
|
2400
|
+
created: Date;
|
|
2401
|
+
messageCount: number;
|
|
2402
|
+
summary: string;
|
|
2403
|
+
}>;
|
|
2404
|
+
};
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
declare type SessionsRemoveInput = {
|
|
2408
|
+
cwd: string;
|
|
2409
|
+
sessionId: string;
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
declare type SessionsRemoveOutput = {
|
|
2413
|
+
success: boolean;
|
|
2414
|
+
error?: string;
|
|
2415
|
+
};
|
|
2416
|
+
|
|
2417
|
+
declare type SessionsResumeInput = {
|
|
2418
|
+
cwd: string;
|
|
2419
|
+
sessionId: string;
|
|
2420
|
+
};
|
|
2421
|
+
|
|
2422
|
+
declare type SessionsResumeOutput = {
|
|
2423
|
+
success: boolean;
|
|
2424
|
+
data: {
|
|
2425
|
+
sessionId: string;
|
|
2426
|
+
logFile: string;
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2430
|
+
declare interface SkillError {
|
|
2431
|
+
path: string;
|
|
2432
|
+
message: string;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
declare class SkillManager {
|
|
2436
|
+
private skillsMap;
|
|
2437
|
+
private errors;
|
|
2438
|
+
private paths;
|
|
2439
|
+
private context;
|
|
2440
|
+
constructor(opts: SkillManagerOpts);
|
|
2441
|
+
getSkills(): SkillMetadata[];
|
|
2442
|
+
getSkill(name: string): SkillMetadata | undefined;
|
|
2443
|
+
getErrors(): SkillError[];
|
|
2444
|
+
readSkillBody(skill: SkillMetadata): Promise<string>;
|
|
2445
|
+
loadSkills(): Promise<void>;
|
|
2446
|
+
private loadSkillsFromDirectory;
|
|
2447
|
+
private loadSkillFile;
|
|
2448
|
+
/**
|
|
2449
|
+
* Load skill from a path that can be either a SKILL.md file or a directory containing SKILL.md.
|
|
2450
|
+
*/
|
|
2451
|
+
private loadSkillPath;
|
|
2452
|
+
private parseSkillFile;
|
|
2453
|
+
addSkill(source: string, options?: AddSkillOptions): Promise<AddSkillResult>;
|
|
2454
|
+
private normalizeSource;
|
|
2455
|
+
private extractFolderName;
|
|
2456
|
+
private scanForSkills;
|
|
2457
|
+
private copyDirectory;
|
|
2458
|
+
private parseSkillFileForAdd;
|
|
2459
|
+
previewSkills(source: string): Promise<PreviewSkillsResult>;
|
|
2460
|
+
installFromPreview(preview: PreviewSkillsResult, selectedSkills: SkillPreview[], source: string, options?: AddSkillOptions): Promise<AddSkillResult>;
|
|
2461
|
+
cleanupPreview(preview: PreviewSkillsResult): void;
|
|
2462
|
+
removeSkill(name: string, targetDir?: string): Promise<{
|
|
2463
|
+
success: boolean;
|
|
2464
|
+
error?: string;
|
|
2465
|
+
}>;
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
declare interface SkillManagerOpts {
|
|
2469
|
+
context: Context;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
declare interface SkillMetadata {
|
|
2473
|
+
name: string;
|
|
2474
|
+
description: string;
|
|
2475
|
+
path: string;
|
|
2476
|
+
source: SkillSource;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
declare interface SkillPreview {
|
|
2480
|
+
name: string;
|
|
2481
|
+
description: string;
|
|
2482
|
+
skillPath: string;
|
|
2483
|
+
skillDir: string;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
declare type SkillsAddInput = {
|
|
2487
|
+
cwd: string;
|
|
2488
|
+
source: string;
|
|
2489
|
+
global?: boolean;
|
|
2490
|
+
claude?: boolean;
|
|
2491
|
+
overwrite?: boolean;
|
|
2492
|
+
name?: string;
|
|
2493
|
+
targetDir?: string;
|
|
2494
|
+
};
|
|
2495
|
+
|
|
2496
|
+
declare type SkillsAddOutput = {
|
|
2497
|
+
success: true;
|
|
2498
|
+
data: {
|
|
2499
|
+
installed: Array<{
|
|
2500
|
+
name: string;
|
|
2501
|
+
description: string;
|
|
2502
|
+
path: string;
|
|
2503
|
+
source: SkillSourceType;
|
|
2504
|
+
}>;
|
|
2505
|
+
skipped: Array<{
|
|
2506
|
+
name: string;
|
|
2507
|
+
reason: string;
|
|
2508
|
+
}>;
|
|
2509
|
+
errors: Array<{
|
|
2510
|
+
path: string;
|
|
2511
|
+
message: string;
|
|
2512
|
+
}>;
|
|
2513
|
+
};
|
|
2514
|
+
} | {
|
|
2515
|
+
success: false;
|
|
2516
|
+
error: string;
|
|
2517
|
+
};
|
|
2518
|
+
|
|
2519
|
+
declare type SkillsGetInput = {
|
|
2520
|
+
cwd: string;
|
|
2521
|
+
name: string;
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
declare type SkillsGetOutput = {
|
|
2525
|
+
success: true;
|
|
2526
|
+
data: {
|
|
2527
|
+
skill: {
|
|
2528
|
+
name: string;
|
|
2529
|
+
description: string;
|
|
2530
|
+
path: string;
|
|
2531
|
+
source: SkillSourceType;
|
|
2532
|
+
body: string;
|
|
2533
|
+
};
|
|
2534
|
+
};
|
|
2535
|
+
} | {
|
|
2536
|
+
success: false;
|
|
2537
|
+
error: string;
|
|
2538
|
+
};
|
|
2539
|
+
|
|
2540
|
+
declare type SkillsInstallInput = {
|
|
2541
|
+
cwd: string;
|
|
2542
|
+
previewId: string;
|
|
2543
|
+
selectedSkills: string[];
|
|
2544
|
+
source: string;
|
|
2545
|
+
global?: boolean;
|
|
2546
|
+
claude?: boolean;
|
|
2547
|
+
overwrite?: boolean;
|
|
2548
|
+
name?: string;
|
|
2549
|
+
targetDir?: string;
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
declare type SkillsInstallOutput = {
|
|
2553
|
+
success: true;
|
|
2554
|
+
data: {
|
|
2555
|
+
installed: Array<{
|
|
2556
|
+
name: string;
|
|
2557
|
+
description: string;
|
|
2558
|
+
path: string;
|
|
2559
|
+
source: SkillSourceType;
|
|
2560
|
+
}>;
|
|
2561
|
+
skipped: Array<{
|
|
2562
|
+
name: string;
|
|
2563
|
+
reason: string;
|
|
2564
|
+
}>;
|
|
2565
|
+
errors: Array<{
|
|
2566
|
+
path: string;
|
|
2567
|
+
message: string;
|
|
2568
|
+
}>;
|
|
2569
|
+
};
|
|
2570
|
+
} | {
|
|
2571
|
+
success: false;
|
|
2572
|
+
error: string;
|
|
2573
|
+
};
|
|
2574
|
+
|
|
2575
|
+
declare type SkillsListInput = {
|
|
2576
|
+
cwd: string;
|
|
2577
|
+
};
|
|
2578
|
+
|
|
2579
|
+
declare type SkillsListOutput = {
|
|
2580
|
+
success: boolean;
|
|
2581
|
+
data: {
|
|
2582
|
+
skills: Array<{
|
|
2583
|
+
name: string;
|
|
2584
|
+
description: string;
|
|
2585
|
+
path: string;
|
|
2586
|
+
source: SkillSourceType;
|
|
2587
|
+
}>;
|
|
2588
|
+
errors: Array<{
|
|
2589
|
+
path: string;
|
|
2590
|
+
message: string;
|
|
2591
|
+
}>;
|
|
2592
|
+
};
|
|
2593
|
+
};
|
|
2594
|
+
|
|
2595
|
+
declare enum SkillSource {
|
|
2596
|
+
Plugin = "plugin",
|
|
2597
|
+
Config = "config",
|
|
2598
|
+
GlobalClaude = "global-claude",
|
|
2599
|
+
Global = "global",
|
|
2600
|
+
ProjectClaude = "project-claude",
|
|
2601
|
+
Project = "project"
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
/** Skill source types */
|
|
2605
|
+
declare type SkillSourceType = 'plugin' | 'config' | 'global-claude' | 'global' | 'project-claude' | 'project';
|
|
2606
|
+
|
|
2607
|
+
declare type SkillsPreviewInput = {
|
|
2608
|
+
cwd: string;
|
|
2609
|
+
source: string;
|
|
2610
|
+
};
|
|
2611
|
+
|
|
2612
|
+
declare type SkillsPreviewOutput = {
|
|
2613
|
+
success: true;
|
|
2614
|
+
data: {
|
|
2615
|
+
previewId: string;
|
|
2616
|
+
skills: Array<{
|
|
2617
|
+
name: string;
|
|
2618
|
+
description: string;
|
|
2619
|
+
skillPath: string;
|
|
2620
|
+
}>;
|
|
2621
|
+
errors: Array<{
|
|
2622
|
+
path: string;
|
|
2623
|
+
message: string;
|
|
2624
|
+
}>;
|
|
2625
|
+
};
|
|
2626
|
+
} | {
|
|
2627
|
+
success: false;
|
|
2628
|
+
error: string;
|
|
2629
|
+
};
|
|
2630
|
+
|
|
2631
|
+
declare type SkillsRemoveInput = {
|
|
2632
|
+
cwd: string;
|
|
2633
|
+
name: string;
|
|
2634
|
+
targetDir?: string;
|
|
2635
|
+
};
|
|
2636
|
+
|
|
2637
|
+
declare type SkillsRemoveOutput = {
|
|
2638
|
+
success: boolean;
|
|
2639
|
+
error?: string;
|
|
2640
|
+
};
|
|
2641
|
+
|
|
2642
|
+
declare type SlashCommand = LocalCommand | LocalJSXCommand | PromptCommand;
|
|
2643
|
+
|
|
2644
|
+
declare type SlashCommandExecuteInput = {
|
|
2645
|
+
cwd: string;
|
|
2646
|
+
sessionId: string;
|
|
2647
|
+
command: string;
|
|
2648
|
+
args: string;
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
declare type SlashCommandExecuteOutput = {
|
|
2652
|
+
success: boolean;
|
|
2653
|
+
data: {
|
|
2654
|
+
messages: any[];
|
|
2655
|
+
};
|
|
2656
|
+
};
|
|
2657
|
+
|
|
2658
|
+
declare type SlashCommandGetInput = {
|
|
2659
|
+
cwd: string;
|
|
2660
|
+
command: string;
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
declare type SlashCommandGetOutput = {
|
|
2664
|
+
success: boolean;
|
|
2665
|
+
data: {
|
|
2666
|
+
commandEntry: any;
|
|
2667
|
+
};
|
|
2668
|
+
};
|
|
2669
|
+
|
|
2670
|
+
declare type SlashCommandListInput = {
|
|
2671
|
+
cwd: string;
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
declare type SlashCommandListOutput = {
|
|
2675
|
+
success: boolean;
|
|
2676
|
+
data: {
|
|
2677
|
+
slashCommands: any[];
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
|
|
2681
|
+
/**
|
|
2682
|
+
* File state snapshot at a specific message point
|
|
2683
|
+
*/
|
|
2684
|
+
declare type Snapshot = {
|
|
2685
|
+
/** Associated message UUID */
|
|
2686
|
+
messageId: string;
|
|
2687
|
+
/** Snapshot creation time */
|
|
2688
|
+
timestamp: Date;
|
|
2689
|
+
/** Relative path -> backup metadata mapping */
|
|
2690
|
+
trackedFileBackups: Record<string, FileBackupMeta>;
|
|
2691
|
+
};
|
|
2692
|
+
|
|
2693
|
+
declare type SnapshotCreateInput = {
|
|
2694
|
+
cwd: string;
|
|
2695
|
+
sessionId: string;
|
|
2696
|
+
messageId: string;
|
|
2697
|
+
description?: string;
|
|
2698
|
+
};
|
|
2699
|
+
|
|
2700
|
+
declare type SnapshotCreateOutput = {
|
|
2701
|
+
success: boolean;
|
|
2702
|
+
data: {
|
|
2703
|
+
snapshot: SnapshotPreview | null;
|
|
2704
|
+
};
|
|
2705
|
+
};
|
|
2706
|
+
|
|
2707
|
+
declare type SnapshotHasInput = {
|
|
2708
|
+
cwd: string;
|
|
2709
|
+
sessionId: string;
|
|
2710
|
+
messageId: string;
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
declare type SnapshotHasOutput = {
|
|
2714
|
+
success: boolean;
|
|
2715
|
+
data: {
|
|
2716
|
+
hasSnapshot: boolean;
|
|
2717
|
+
};
|
|
2718
|
+
};
|
|
2719
|
+
|
|
2720
|
+
declare type SnapshotListInput = {
|
|
2721
|
+
cwd: string;
|
|
2722
|
+
sessionId: string;
|
|
2723
|
+
};
|
|
2724
|
+
|
|
2725
|
+
declare type SnapshotListOutput = {
|
|
2726
|
+
success: boolean;
|
|
2727
|
+
data: {
|
|
2728
|
+
snapshots: SnapshotPreview[];
|
|
2729
|
+
};
|
|
2730
|
+
};
|
|
2731
|
+
|
|
2732
|
+
declare type SnapshotLoadFromSessionInput = {
|
|
2733
|
+
cwd: string;
|
|
2734
|
+
sessionId: string;
|
|
2735
|
+
snapshots: SerializedSnapshot[];
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2738
|
+
declare type SnapshotPreview = {
|
|
2739
|
+
messageId: string;
|
|
2740
|
+
timestamp: Date;
|
|
2741
|
+
fileCount: number;
|
|
2742
|
+
changes?: {
|
|
2743
|
+
insertions: number;
|
|
2744
|
+
deletions: number;
|
|
2745
|
+
filesChanged: number;
|
|
2746
|
+
};
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
/**
|
|
2750
|
+
* Snapshot preview info (for UI display)
|
|
2751
|
+
*/
|
|
2752
|
+
declare type SnapshotPreview_2 = {
|
|
2753
|
+
messageId: string;
|
|
2754
|
+
timestamp: Date;
|
|
2755
|
+
fileCount: number;
|
|
2756
|
+
/** Change statistics relative to previous snapshot */
|
|
2757
|
+
changes?: {
|
|
2758
|
+
insertions: number;
|
|
2759
|
+
deletions: number;
|
|
2760
|
+
filesChanged: number;
|
|
2761
|
+
};
|
|
2762
|
+
};
|
|
2763
|
+
|
|
2764
|
+
declare type SnapshotPreviewRewindInput = {
|
|
2765
|
+
cwd: string;
|
|
2766
|
+
sessionId: string;
|
|
2767
|
+
messageId: string;
|
|
2768
|
+
cumulative?: boolean;
|
|
2769
|
+
};
|
|
2770
|
+
|
|
2771
|
+
declare type SnapshotPreviewRewindOutput = {
|
|
2772
|
+
success: true;
|
|
2773
|
+
data: {
|
|
2774
|
+
result: RewindResult;
|
|
2775
|
+
};
|
|
2776
|
+
} | {
|
|
2777
|
+
success: false;
|
|
2778
|
+
error: string;
|
|
2779
|
+
};
|
|
2780
|
+
|
|
2781
|
+
declare type SnapshotRewindInput = {
|
|
2782
|
+
cwd: string;
|
|
2783
|
+
sessionId: string;
|
|
2784
|
+
messageId: string;
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2787
|
+
declare type SnapshotRewindOutput = {
|
|
2788
|
+
success: true;
|
|
2789
|
+
data: {
|
|
2790
|
+
result: RewindResult;
|
|
2791
|
+
};
|
|
2792
|
+
} | {
|
|
2793
|
+
success: false;
|
|
2794
|
+
error: string;
|
|
2795
|
+
};
|
|
2796
|
+
|
|
2797
|
+
declare type SnapshotTrackFileInput = {
|
|
2798
|
+
cwd: string;
|
|
2799
|
+
sessionId: string;
|
|
2800
|
+
filePath: string;
|
|
2801
|
+
isNewFile?: boolean;
|
|
2802
|
+
};
|
|
2803
|
+
|
|
2804
|
+
declare type Status = Record<string, {
|
|
2805
|
+
description?: string;
|
|
2806
|
+
items: string[];
|
|
2807
|
+
}>;
|
|
2808
|
+
|
|
2809
|
+
declare type StatusGetInput = {
|
|
2810
|
+
cwd: string;
|
|
2811
|
+
sessionId: string;
|
|
2812
|
+
};
|
|
2813
|
+
|
|
2814
|
+
declare type StatusGetOutput = {
|
|
2815
|
+
success: boolean;
|
|
2816
|
+
data: {
|
|
2817
|
+
status: Record<string, {
|
|
2818
|
+
description?: string;
|
|
2819
|
+
items: string[];
|
|
2820
|
+
}>;
|
|
2821
|
+
};
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
/** Standard success response without data */
|
|
2825
|
+
declare type SuccessResponse = {
|
|
2826
|
+
success: true;
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2829
|
+
declare type SystemMessage = {
|
|
2830
|
+
role: 'system';
|
|
2831
|
+
content: string;
|
|
2832
|
+
};
|
|
2833
|
+
|
|
2834
|
+
declare interface TaskToolInput {
|
|
2835
|
+
description: string;
|
|
2836
|
+
prompt: string;
|
|
2837
|
+
subagent_type: string;
|
|
2838
|
+
model?: string;
|
|
2839
|
+
resume?: string;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
declare type TempPluginContext = ContextCreateOpts & {
|
|
2843
|
+
pluginManager: PluginManager;
|
|
2844
|
+
config: Config;
|
|
2845
|
+
apply: (opts: PluginApplyOpts) => Promise<any> | any;
|
|
2846
|
+
};
|
|
2847
|
+
|
|
2848
|
+
declare type TextPart = {
|
|
2849
|
+
type: 'text';
|
|
2850
|
+
text: string;
|
|
2851
|
+
hidden?: boolean;
|
|
2852
|
+
};
|
|
2853
|
+
|
|
2854
|
+
declare type ThinkingConfig = {
|
|
2855
|
+
effort: ReasoningEffort;
|
|
2856
|
+
};
|
|
2857
|
+
|
|
2858
|
+
declare type TodoItem = _zod.infer<typeof TodoItemSchema>;
|
|
2859
|
+
|
|
2860
|
+
declare const TodoItemSchema: _zod.ZodObject<{
|
|
2861
|
+
id: _zod.ZodString;
|
|
2862
|
+
content: _zod.ZodString;
|
|
2863
|
+
status: _zod.ZodEnum<{
|
|
2864
|
+
completed: "completed";
|
|
2865
|
+
pending: "pending";
|
|
2866
|
+
in_progress: "in_progress";
|
|
2867
|
+
}>;
|
|
2868
|
+
priority: _zod.ZodEnum<{
|
|
2869
|
+
low: "low";
|
|
2870
|
+
medium: "medium";
|
|
2871
|
+
high: "high";
|
|
2872
|
+
}>;
|
|
2873
|
+
}, _zod.core.$strip>;
|
|
2874
|
+
|
|
2875
|
+
declare type TodoWriteReturnDisplay = {
|
|
2876
|
+
type: 'todo_write';
|
|
2877
|
+
oldTodos: TodoItem[];
|
|
2878
|
+
newTodos: TodoItem[];
|
|
2879
|
+
};
|
|
2880
|
+
|
|
2881
|
+
declare interface Tool<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
2882
|
+
name: string;
|
|
2883
|
+
description: string;
|
|
2884
|
+
getDescription?: ({ params, cwd, }: {
|
|
2885
|
+
params: z.output<TSchema>;
|
|
2886
|
+
cwd: string;
|
|
2887
|
+
}) => string;
|
|
2888
|
+
displayName?: string;
|
|
2889
|
+
execute: (params: z.output<TSchema>, toolCallId?: string) => Promise<ToolResult> | ToolResult;
|
|
2890
|
+
approval?: ToolApprovalInfo;
|
|
2891
|
+
parameters: TSchema;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
declare type ToolApprovalInfo = {
|
|
2895
|
+
needsApproval?: (context: ApprovalContext) => Promise<boolean> | boolean;
|
|
2896
|
+
category?: ApprovalCategory;
|
|
2897
|
+
};
|
|
2898
|
+
|
|
2899
|
+
declare type ToolApprovalInput = {
|
|
2900
|
+
toolUse: ToolUse;
|
|
2901
|
+
category?: ApprovalCategory;
|
|
2902
|
+
sessionId: string;
|
|
2903
|
+
};
|
|
2904
|
+
|
|
2905
|
+
declare type ToolApprovalOutput = {
|
|
2906
|
+
approved: boolean;
|
|
2907
|
+
params?: Record<string, unknown>;
|
|
2908
|
+
denyReason?: string;
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
declare type ToolApprovalResult = boolean | {
|
|
2912
|
+
approved: boolean;
|
|
2913
|
+
params?: ToolParams;
|
|
2914
|
+
denyReason?: string;
|
|
2915
|
+
};
|
|
2916
|
+
|
|
2917
|
+
declare type ToolContent = Array<ToolResultPart>;
|
|
2918
|
+
|
|
2919
|
+
declare type ToolMessage = {
|
|
2920
|
+
role: 'user';
|
|
2921
|
+
content: ToolContent;
|
|
2922
|
+
};
|
|
2923
|
+
|
|
2924
|
+
declare type ToolMessage2 = {
|
|
2925
|
+
role: 'tool';
|
|
2926
|
+
content: ToolResultPart2[];
|
|
2927
|
+
};
|
|
2928
|
+
|
|
2929
|
+
declare type ToolParams = Record<string, unknown>;
|
|
2930
|
+
|
|
2931
|
+
declare type ToolResult = {
|
|
2932
|
+
llmContent: string | (TextPart | ImagePart)[];
|
|
2933
|
+
returnDisplay?: ReturnDisplay;
|
|
2934
|
+
isError?: boolean;
|
|
2935
|
+
metadata?: {
|
|
2936
|
+
agentId?: string;
|
|
2937
|
+
agentType?: string;
|
|
2938
|
+
[key: string]: any;
|
|
2939
|
+
};
|
|
2940
|
+
truncated?: boolean;
|
|
2941
|
+
outputPath?: string;
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
declare type ToolResultPart = {
|
|
2945
|
+
type: 'tool_result';
|
|
2946
|
+
id: string;
|
|
2947
|
+
name: string;
|
|
2948
|
+
input: Record<string, any>;
|
|
2949
|
+
result: ToolResult;
|
|
2950
|
+
agentId?: string;
|
|
2951
|
+
agentType?: string;
|
|
2952
|
+
};
|
|
2953
|
+
|
|
2954
|
+
declare type ToolResultPart2 = {
|
|
2955
|
+
type: 'tool-result';
|
|
2956
|
+
toolCallId: string;
|
|
2957
|
+
toolName: string;
|
|
2958
|
+
input: Record<string, any>;
|
|
2959
|
+
result: ToolResult;
|
|
2960
|
+
agentId?: string;
|
|
2961
|
+
agentType?: string;
|
|
2962
|
+
pruned?: boolean;
|
|
2963
|
+
prunedAt?: number;
|
|
2964
|
+
};
|
|
2965
|
+
|
|
2966
|
+
declare type ToolUse = {
|
|
2967
|
+
name: string;
|
|
2968
|
+
params: Record<string, any>;
|
|
2969
|
+
callId: string;
|
|
2970
|
+
};
|
|
2971
|
+
|
|
2972
|
+
declare type ToolUsePart = {
|
|
2973
|
+
type: 'tool_use';
|
|
2974
|
+
id: string;
|
|
2975
|
+
name: string;
|
|
2976
|
+
input: Record<string, any>;
|
|
2977
|
+
displayName?: string;
|
|
2978
|
+
description?: string;
|
|
2979
|
+
};
|
|
2980
|
+
|
|
2981
|
+
declare type UpgradeOptions = {
|
|
2982
|
+
registryBase: string;
|
|
2983
|
+
name: string;
|
|
2984
|
+
version: string;
|
|
2985
|
+
installDir: string;
|
|
2986
|
+
files: string[];
|
|
2987
|
+
channel?: string;
|
|
2988
|
+
changelogUrl?: string;
|
|
2989
|
+
};
|
|
2990
|
+
|
|
2991
|
+
declare class Usage {
|
|
2992
|
+
promptTokens: number;
|
|
2993
|
+
completionTokens: number;
|
|
2994
|
+
totalTokens: number;
|
|
2995
|
+
constructor(init?: Partial<Usage>);
|
|
2996
|
+
static empty(): Usage;
|
|
2997
|
+
static fromEventUsage(eventUsage: any): Usage;
|
|
2998
|
+
static fromAssistantMessage(message: AssistantMessage): Usage;
|
|
2999
|
+
add(other: Usage): void;
|
|
3000
|
+
reset(): void;
|
|
3001
|
+
clone(): Usage;
|
|
3002
|
+
isValid(): boolean;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
declare type UserContent = string | Array<TextPart | ImagePart>;
|
|
3006
|
+
|
|
3007
|
+
declare type UserMessage = {
|
|
3008
|
+
role: 'user';
|
|
3009
|
+
content: UserContent;
|
|
3010
|
+
hidden?: boolean;
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
declare type UtilsDetectAppsInput = {
|
|
3014
|
+
cwd: string;
|
|
3015
|
+
apps?: App[];
|
|
3016
|
+
};
|
|
3017
|
+
|
|
3018
|
+
declare type UtilsDetectAppsOutput = {
|
|
3019
|
+
success: boolean;
|
|
3020
|
+
data: {
|
|
3021
|
+
apps: App[];
|
|
3022
|
+
};
|
|
3023
|
+
};
|
|
3024
|
+
|
|
3025
|
+
declare type UtilsFilesListInput = {
|
|
3026
|
+
cwd: string;
|
|
3027
|
+
query?: string;
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
declare type UtilsFilesListOutput = {
|
|
3031
|
+
success: boolean;
|
|
3032
|
+
data: {
|
|
3033
|
+
files: any[];
|
|
3034
|
+
};
|
|
3035
|
+
};
|
|
3036
|
+
|
|
3037
|
+
declare type UtilsGetPathsInput = {
|
|
3038
|
+
cwd: string;
|
|
3039
|
+
maxFiles?: number;
|
|
3040
|
+
};
|
|
3041
|
+
|
|
3042
|
+
declare type UtilsGetPathsOutput = {
|
|
3043
|
+
success: boolean;
|
|
3044
|
+
data: {
|
|
3045
|
+
paths: string[];
|
|
3046
|
+
};
|
|
3047
|
+
};
|
|
3048
|
+
|
|
3049
|
+
declare type UtilsNotifyInput = {
|
|
3050
|
+
cwd: string;
|
|
3051
|
+
config: string | false | undefined;
|
|
3052
|
+
};
|
|
3053
|
+
|
|
3054
|
+
declare type UtilsNotifyOutput = SuccessResponse;
|
|
3055
|
+
|
|
3056
|
+
declare type UtilsOnRequestHook = (req: {
|
|
3057
|
+
url: string;
|
|
3058
|
+
method: string;
|
|
3059
|
+
headers: Record<string, string>;
|
|
3060
|
+
body?: unknown;
|
|
3061
|
+
}) => void;
|
|
3062
|
+
|
|
3063
|
+
declare type UtilsOnResponseHook = (res: {
|
|
3064
|
+
url: string;
|
|
3065
|
+
status: number;
|
|
3066
|
+
headers: Record<string, string>;
|
|
3067
|
+
}) => void;
|
|
3068
|
+
|
|
3069
|
+
declare type UtilsOpenInput = {
|
|
3070
|
+
cwd: string;
|
|
3071
|
+
sessionId?: string;
|
|
3072
|
+
app: App;
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
declare type UtilsPlaySoundInput = {
|
|
3076
|
+
sound: string;
|
|
3077
|
+
volume?: number;
|
|
3078
|
+
};
|
|
3079
|
+
|
|
3080
|
+
declare type UtilsPlaySoundOutput = SuccessResponse | ErrorResponse;
|
|
3081
|
+
|
|
3082
|
+
declare type UtilsQueryInput = {
|
|
3083
|
+
userPrompt: string;
|
|
3084
|
+
cwd: string;
|
|
3085
|
+
systemPrompt?: string;
|
|
3086
|
+
model?: string;
|
|
3087
|
+
thinking?: ThinkingConfig;
|
|
3088
|
+
responseFormat?: ResponseFormat;
|
|
3089
|
+
};
|
|
3090
|
+
|
|
3091
|
+
declare type UtilsQueryOutput = any;
|
|
3092
|
+
|
|
3093
|
+
declare type UtilsQuickQueryInput = {
|
|
3094
|
+
userPrompt: string;
|
|
3095
|
+
cwd: string;
|
|
3096
|
+
systemPrompt?: string;
|
|
3097
|
+
model?: string;
|
|
3098
|
+
thinking?: ThinkingConfig;
|
|
3099
|
+
responseFormat?: ResponseFormat;
|
|
3100
|
+
};
|
|
3101
|
+
|
|
3102
|
+
declare type UtilsQuickQueryOutput = any;
|
|
3103
|
+
|
|
3104
|
+
declare type UtilsSearchPathsInput = {
|
|
3105
|
+
cwd: string;
|
|
3106
|
+
query: string;
|
|
3107
|
+
maxResults?: number;
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3110
|
+
declare type UtilsSearchPathsOutput = {
|
|
3111
|
+
success: boolean;
|
|
3112
|
+
data: {
|
|
3113
|
+
paths: string[];
|
|
3114
|
+
truncated: boolean;
|
|
3115
|
+
};
|
|
3116
|
+
};
|
|
3117
|
+
|
|
3118
|
+
declare type UtilsSummarizeMessageInput = {
|
|
3119
|
+
message: string;
|
|
3120
|
+
cwd: string;
|
|
3121
|
+
model?: string;
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3124
|
+
declare type UtilsSummarizeMessageOutput = any;
|
|
3125
|
+
|
|
3126
|
+
declare type UtilsTelemetryInput = {
|
|
3127
|
+
cwd: string;
|
|
3128
|
+
name: string;
|
|
3129
|
+
payload: Record<string, any>;
|
|
3130
|
+
};
|
|
3131
|
+
|
|
3132
|
+
declare type UtilsToolExecuteBashInput = {
|
|
3133
|
+
cwd: string;
|
|
3134
|
+
command: string;
|
|
3135
|
+
};
|
|
3136
|
+
|
|
3137
|
+
declare type UtilsToolExecuteBashOutput = {
|
|
3138
|
+
success: boolean;
|
|
3139
|
+
data?: any;
|
|
3140
|
+
error?: {
|
|
3141
|
+
message: string;
|
|
3142
|
+
};
|
|
3143
|
+
};
|
|
3144
|
+
|
|
3145
|
+
declare type WorkspaceData = {
|
|
3146
|
+
id: string;
|
|
3147
|
+
repoPath: string;
|
|
3148
|
+
branch: string;
|
|
3149
|
+
worktreePath: string;
|
|
3150
|
+
sessionIds: string[];
|
|
3151
|
+
gitState: {
|
|
3152
|
+
currentCommit: string;
|
|
3153
|
+
isDirty: boolean;
|
|
3154
|
+
pendingChanges: string[];
|
|
3155
|
+
};
|
|
3156
|
+
metadata: {
|
|
3157
|
+
createdAt: number;
|
|
3158
|
+
description: string;
|
|
3159
|
+
status: 'active' | 'archived' | 'stale';
|
|
3160
|
+
};
|
|
3161
|
+
context: {
|
|
3162
|
+
activeFiles: string[];
|
|
3163
|
+
settings: any;
|
|
3164
|
+
preferences: Record<string, unknown>;
|
|
3165
|
+
};
|
|
3166
|
+
};
|
|
3167
|
+
|
|
3168
|
+
export { _zod }
|
|
3169
|
+
|
|
3170
|
+
export { }
|