@aiderdesk/extensions 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/cli.js +0 -0
- package/dist/index.d.ts +1477 -0
- package/dist/index.js +23 -0
- package/extensions.d.ts +24 -3
- package/package.json +9 -8
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1477 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export type LlmProviderName = "anthropic" | "anthropic-compatible" | "azure" | "bedrock" | "cerebras" | "claude-agent-sdk" | "deepseek" | "gemini" | "gemini-cli" | "gpustack" | "groq" | "alibaba-plan" | "kimi-plan" | "litellm" | "lmstudio" | "minimax" | "ollama" | "openai" | "openai-compatible" | "opencode" | "openrouter" | "requesty" | "synthetic" | "vertex-ai" | "zai-plan";
|
|
4
|
+
export interface LlmProviderBase {
|
|
5
|
+
name: LlmProviderName;
|
|
6
|
+
disableStreaming?: boolean;
|
|
7
|
+
voiceEnabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface VoiceControlSettings {
|
|
10
|
+
idleTimeoutMs: number;
|
|
11
|
+
systemInstructions: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OllamaProvider extends LlmProviderBase {
|
|
14
|
+
name: "ollama";
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
}
|
|
17
|
+
declare enum OpenAiVoiceModel {
|
|
18
|
+
Gpt4oMiniTranscribe = "gpt-4o-mini-transcribe",
|
|
19
|
+
Gpt4oTranscribe = "gpt-4o-transcribe"
|
|
20
|
+
}
|
|
21
|
+
export interface OpenAiVoiceControlSettings extends VoiceControlSettings {
|
|
22
|
+
model: OpenAiVoiceModel;
|
|
23
|
+
language: string;
|
|
24
|
+
}
|
|
25
|
+
export interface OpenAiProvider extends LlmProviderBase {
|
|
26
|
+
name: "openai";
|
|
27
|
+
apiKey: string;
|
|
28
|
+
reasoningEffort?: ReasoningEffort;
|
|
29
|
+
useWebSearch: boolean;
|
|
30
|
+
voice?: Partial<OpenAiVoiceControlSettings>;
|
|
31
|
+
}
|
|
32
|
+
export interface AzureProvider extends LlmProviderBase {
|
|
33
|
+
name: "azure";
|
|
34
|
+
apiKey: string;
|
|
35
|
+
resourceName: string;
|
|
36
|
+
apiVersion?: string;
|
|
37
|
+
reasoningEffort?: ReasoningEffort;
|
|
38
|
+
}
|
|
39
|
+
export interface AnthropicProvider extends LlmProviderBase {
|
|
40
|
+
name: "anthropic";
|
|
41
|
+
apiKey: string;
|
|
42
|
+
}
|
|
43
|
+
export interface AnthropicCompatibleProvider extends LlmProviderBase {
|
|
44
|
+
name: "anthropic-compatible";
|
|
45
|
+
apiKey: string;
|
|
46
|
+
baseUrl?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface KimiPlanProvider extends LlmProviderBase {
|
|
49
|
+
name: "kimi-plan";
|
|
50
|
+
apiKey: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AlibabaPlanProvider extends LlmProviderBase {
|
|
53
|
+
name: "alibaba-plan";
|
|
54
|
+
apiKey: string;
|
|
55
|
+
}
|
|
56
|
+
declare enum GeminiVoiceModel {
|
|
57
|
+
GeminiLive25FlashNativeAudio = "gemini-2.5-flash-native-audio-preview-12-2025"
|
|
58
|
+
}
|
|
59
|
+
export interface GeminiVoiceControlSettings extends VoiceControlSettings {
|
|
60
|
+
model: GeminiVoiceModel;
|
|
61
|
+
temperature: number;
|
|
62
|
+
}
|
|
63
|
+
export interface GeminiProvider extends LlmProviderBase {
|
|
64
|
+
name: "gemini";
|
|
65
|
+
apiKey: string;
|
|
66
|
+
customBaseUrl?: string;
|
|
67
|
+
includeThoughts: boolean;
|
|
68
|
+
thinkingBudget: number;
|
|
69
|
+
useSearchGrounding: boolean;
|
|
70
|
+
voice?: Partial<GeminiVoiceControlSettings>;
|
|
71
|
+
}
|
|
72
|
+
export interface VertexAiProvider extends LlmProviderBase {
|
|
73
|
+
name: "vertex-ai";
|
|
74
|
+
project: string;
|
|
75
|
+
location: string;
|
|
76
|
+
googleCloudCredentialsJson?: string;
|
|
77
|
+
includeThoughts: boolean;
|
|
78
|
+
thinkingBudget: number;
|
|
79
|
+
}
|
|
80
|
+
export interface LmStudioProvider extends LlmProviderBase {
|
|
81
|
+
name: "lmstudio";
|
|
82
|
+
baseUrl: string;
|
|
83
|
+
}
|
|
84
|
+
export interface DeepseekProvider extends LlmProviderBase {
|
|
85
|
+
name: "deepseek";
|
|
86
|
+
apiKey: string;
|
|
87
|
+
}
|
|
88
|
+
export interface GroqProvider extends LlmProviderBase {
|
|
89
|
+
name: "groq";
|
|
90
|
+
apiKey: string;
|
|
91
|
+
}
|
|
92
|
+
export interface CerebrasProvider extends LlmProviderBase {
|
|
93
|
+
name: "cerebras";
|
|
94
|
+
apiKey: string;
|
|
95
|
+
}
|
|
96
|
+
export interface ClaudeAgentSdkProvider extends LlmProviderBase {
|
|
97
|
+
name: "claude-agent-sdk";
|
|
98
|
+
systemPrompt?: string;
|
|
99
|
+
mcpServers?: Record<string, unknown>;
|
|
100
|
+
}
|
|
101
|
+
export interface GeminiCliProvider extends LlmProviderBase {
|
|
102
|
+
name: "gemini-cli";
|
|
103
|
+
projectId?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface BedrockProvider extends LlmProviderBase {
|
|
106
|
+
name: "bedrock";
|
|
107
|
+
accessKeyId: string;
|
|
108
|
+
secretAccessKey: string;
|
|
109
|
+
region: string;
|
|
110
|
+
sessionToken?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface OpenAiCompatibleProvider extends LlmProviderBase {
|
|
113
|
+
name: "openai-compatible";
|
|
114
|
+
apiKey: string;
|
|
115
|
+
baseUrl?: string;
|
|
116
|
+
reasoningEffort?: ReasoningEffort;
|
|
117
|
+
}
|
|
118
|
+
export interface LitellmProvider extends LlmProviderBase {
|
|
119
|
+
name: "litellm";
|
|
120
|
+
apiKey: string;
|
|
121
|
+
baseUrl: string;
|
|
122
|
+
}
|
|
123
|
+
export interface GpustackProvider extends LlmProviderBase {
|
|
124
|
+
name: "gpustack";
|
|
125
|
+
apiKey?: string;
|
|
126
|
+
baseUrl?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface OpenRouterProvider extends LlmProviderBase {
|
|
129
|
+
name: "openrouter";
|
|
130
|
+
apiKey: string;
|
|
131
|
+
requireParameters: boolean;
|
|
132
|
+
order: string[];
|
|
133
|
+
only: string[];
|
|
134
|
+
ignore: string[];
|
|
135
|
+
allowFallbacks: boolean;
|
|
136
|
+
dataCollection: "allow" | "deny";
|
|
137
|
+
quantizations: string[];
|
|
138
|
+
sort: "price" | "throughput" | null;
|
|
139
|
+
}
|
|
140
|
+
export interface RequestyProvider extends LlmProviderBase {
|
|
141
|
+
name: "requesty";
|
|
142
|
+
apiKey: string;
|
|
143
|
+
useAutoCache: boolean;
|
|
144
|
+
reasoningEffort: ReasoningEffort;
|
|
145
|
+
}
|
|
146
|
+
export interface OpenCodeProvider extends LlmProviderBase {
|
|
147
|
+
name: "opencode";
|
|
148
|
+
apiKey: string;
|
|
149
|
+
}
|
|
150
|
+
export interface ZaiPlanProvider extends LlmProviderBase {
|
|
151
|
+
name: "zai-plan";
|
|
152
|
+
apiKey: string;
|
|
153
|
+
thinkingEnabled?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface MinimaxProvider extends LlmProviderBase {
|
|
156
|
+
name: "minimax";
|
|
157
|
+
apiKey: string;
|
|
158
|
+
}
|
|
159
|
+
export interface SyntheticProvider extends LlmProviderBase {
|
|
160
|
+
name: "synthetic";
|
|
161
|
+
apiKey: string;
|
|
162
|
+
}
|
|
163
|
+
export type LlmProvider = OpenAiProvider | AnthropicProvider | AnthropicCompatibleProvider | AzureProvider | GeminiProvider | GeminiCliProvider | VertexAiProvider | LmStudioProvider | BedrockProvider | ClaudeAgentSdkProvider | DeepseekProvider | GroqProvider | GpustackProvider | CerebrasProvider | AlibabaPlanProvider | KimiPlanProvider | OpenAiCompatibleProvider | LitellmProvider | OllamaProvider | OpenCodeProvider | OpenRouterProvider | RequestyProvider | SyntheticProvider | ZaiPlanProvider | MinimaxProvider;
|
|
164
|
+
export type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
|
165
|
+
export type JSONObject = {
|
|
166
|
+
[key: string]: JSONValue;
|
|
167
|
+
};
|
|
168
|
+
export type JSONArray = JSONValue[];
|
|
169
|
+
export type DataContent = string | Uint8Array | ArrayBuffer | Buffer;
|
|
170
|
+
export type ToolResultOutput = {
|
|
171
|
+
type: "text";
|
|
172
|
+
value: string;
|
|
173
|
+
} | {
|
|
174
|
+
type: "json";
|
|
175
|
+
value: JSONValue;
|
|
176
|
+
} | {
|
|
177
|
+
type: "error-text";
|
|
178
|
+
value: string;
|
|
179
|
+
} | {
|
|
180
|
+
type: "error-json";
|
|
181
|
+
value: JSONValue;
|
|
182
|
+
} | {
|
|
183
|
+
type: "content";
|
|
184
|
+
value: Array<{
|
|
185
|
+
type: "text";
|
|
186
|
+
text: string;
|
|
187
|
+
} | {
|
|
188
|
+
type: "media";
|
|
189
|
+
data: string;
|
|
190
|
+
mediaType: string;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
193
|
+
export interface TextPart {
|
|
194
|
+
type: "text";
|
|
195
|
+
text: string;
|
|
196
|
+
}
|
|
197
|
+
export interface ImagePart {
|
|
198
|
+
type: "image";
|
|
199
|
+
image: DataContent | URL;
|
|
200
|
+
mediaType?: string;
|
|
201
|
+
}
|
|
202
|
+
export interface FilePart {
|
|
203
|
+
type: "file";
|
|
204
|
+
data: DataContent | URL;
|
|
205
|
+
filename?: string;
|
|
206
|
+
mediaType: string;
|
|
207
|
+
}
|
|
208
|
+
export interface ReasoningPart {
|
|
209
|
+
type: "reasoning";
|
|
210
|
+
text: string;
|
|
211
|
+
}
|
|
212
|
+
export interface ToolCallPart {
|
|
213
|
+
type: "tool-call";
|
|
214
|
+
toolCallId: string;
|
|
215
|
+
toolName: string;
|
|
216
|
+
input: unknown;
|
|
217
|
+
}
|
|
218
|
+
export interface ToolResultPart {
|
|
219
|
+
type: "tool-result";
|
|
220
|
+
toolCallId: string;
|
|
221
|
+
toolName: string;
|
|
222
|
+
output: ToolResultOutput;
|
|
223
|
+
}
|
|
224
|
+
export type UserContent = string | Array<TextPart | ImagePart | FilePart>;
|
|
225
|
+
export type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart>;
|
|
226
|
+
export type ToolContent = Array<ToolResultPart>;
|
|
227
|
+
export interface LocalizedString {
|
|
228
|
+
key: string;
|
|
229
|
+
params?: Record<string, unknown>;
|
|
230
|
+
}
|
|
231
|
+
export interface Group {
|
|
232
|
+
id: string;
|
|
233
|
+
name?: string | LocalizedString;
|
|
234
|
+
color?: string;
|
|
235
|
+
finished?: boolean;
|
|
236
|
+
interruptId?: string;
|
|
237
|
+
}
|
|
238
|
+
export interface UsageReportData {
|
|
239
|
+
model: string;
|
|
240
|
+
sentTokens: number;
|
|
241
|
+
receivedTokens: number;
|
|
242
|
+
messageCost: number;
|
|
243
|
+
cacheWriteTokens?: number;
|
|
244
|
+
cacheReadTokens?: number;
|
|
245
|
+
aiderTotalCost?: number;
|
|
246
|
+
agentTotalCost?: number;
|
|
247
|
+
}
|
|
248
|
+
export interface PromptContext {
|
|
249
|
+
id: string;
|
|
250
|
+
group?: Group;
|
|
251
|
+
}
|
|
252
|
+
declare enum MessageRole {
|
|
253
|
+
User = "user",
|
|
254
|
+
Assistant = "assistant"
|
|
255
|
+
}
|
|
256
|
+
export interface BaseContextMessage {
|
|
257
|
+
id: string;
|
|
258
|
+
usageReport?: UsageReportData;
|
|
259
|
+
promptContext?: PromptContext;
|
|
260
|
+
}
|
|
261
|
+
export interface ContextUserMessage extends BaseContextMessage {
|
|
262
|
+
role: "user";
|
|
263
|
+
content: UserContent;
|
|
264
|
+
}
|
|
265
|
+
export interface ContextAssistantMessage extends BaseContextMessage {
|
|
266
|
+
role: "assistant";
|
|
267
|
+
content: AssistantContent;
|
|
268
|
+
reflectedMessage?: string;
|
|
269
|
+
editedFiles?: string[];
|
|
270
|
+
commitHash?: string;
|
|
271
|
+
commitMessage?: string;
|
|
272
|
+
diff?: string;
|
|
273
|
+
}
|
|
274
|
+
export interface ContextToolMessage extends BaseContextMessage {
|
|
275
|
+
role: "tool";
|
|
276
|
+
content: ToolContent;
|
|
277
|
+
}
|
|
278
|
+
export type ContextMessage = ContextUserMessage | ContextAssistantMessage | ContextToolMessage;
|
|
279
|
+
export interface ConnectorMessage {
|
|
280
|
+
role: MessageRole;
|
|
281
|
+
content: string;
|
|
282
|
+
}
|
|
283
|
+
export interface ContextFile {
|
|
284
|
+
path: string;
|
|
285
|
+
readOnly?: boolean;
|
|
286
|
+
source?: "global-rule" | "project-rule" | "agent-rule";
|
|
287
|
+
}
|
|
288
|
+
declare enum ContextMemoryMode {
|
|
289
|
+
Off = "off",
|
|
290
|
+
FullContext = "full-context",
|
|
291
|
+
LastMessage = "last-message"
|
|
292
|
+
}
|
|
293
|
+
export interface ModeDefinition {
|
|
294
|
+
name: Mode;
|
|
295
|
+
label: string;
|
|
296
|
+
description?: string;
|
|
297
|
+
/** Icon name from react-icons (e.g., 'GoCodeReview', 'FiLayers') */
|
|
298
|
+
icon?: string;
|
|
299
|
+
}
|
|
300
|
+
export type Mode = string;
|
|
301
|
+
declare enum DiffViewMode {
|
|
302
|
+
SideBySide = "side-by-side",
|
|
303
|
+
Unified = "unified",
|
|
304
|
+
Compact = "compact"
|
|
305
|
+
}
|
|
306
|
+
declare enum MessageViewMode {
|
|
307
|
+
Full = "full",
|
|
308
|
+
Compact = "compact"
|
|
309
|
+
}
|
|
310
|
+
declare enum ReasoningEffort {
|
|
311
|
+
XHigh = "xhigh",
|
|
312
|
+
High = "high",
|
|
313
|
+
Medium = "medium",
|
|
314
|
+
Low = "low",
|
|
315
|
+
Minimal = "minimal",
|
|
316
|
+
None = "none"
|
|
317
|
+
}
|
|
318
|
+
export interface ResponseChunkData {
|
|
319
|
+
messageId: string;
|
|
320
|
+
baseDir: string;
|
|
321
|
+
taskId: string;
|
|
322
|
+
chunk: string;
|
|
323
|
+
reflectedMessage?: string;
|
|
324
|
+
promptContext?: PromptContext;
|
|
325
|
+
}
|
|
326
|
+
export interface ResponseCompletedData {
|
|
327
|
+
type: "response-completed";
|
|
328
|
+
messageId: string;
|
|
329
|
+
baseDir: string;
|
|
330
|
+
taskId: string;
|
|
331
|
+
content: string;
|
|
332
|
+
reflectedMessage?: string;
|
|
333
|
+
editedFiles?: string[];
|
|
334
|
+
commitHash?: string;
|
|
335
|
+
commitMessage?: string;
|
|
336
|
+
diff?: string;
|
|
337
|
+
usageReport?: UsageReportData;
|
|
338
|
+
sequenceNumber?: number;
|
|
339
|
+
promptContext?: PromptContext;
|
|
340
|
+
}
|
|
341
|
+
export interface UpdatedFile {
|
|
342
|
+
path: string;
|
|
343
|
+
additions: number;
|
|
344
|
+
deletions: number;
|
|
345
|
+
diff?: string;
|
|
346
|
+
}
|
|
347
|
+
export interface CommandsData {
|
|
348
|
+
baseDir: string;
|
|
349
|
+
customCommands: Command[];
|
|
350
|
+
extensionCommands: Command[];
|
|
351
|
+
}
|
|
352
|
+
export interface Answer {
|
|
353
|
+
text: string;
|
|
354
|
+
shortkey: string;
|
|
355
|
+
}
|
|
356
|
+
export interface QuestionData {
|
|
357
|
+
baseDir: string;
|
|
358
|
+
taskId: string;
|
|
359
|
+
text: string;
|
|
360
|
+
subject?: string;
|
|
361
|
+
isGroupQuestion?: boolean;
|
|
362
|
+
answers?: Answer[];
|
|
363
|
+
defaultAnswer: string;
|
|
364
|
+
internal?: boolean;
|
|
365
|
+
key?: string;
|
|
366
|
+
}
|
|
367
|
+
export interface QueuedPromptData {
|
|
368
|
+
id: string;
|
|
369
|
+
text: string;
|
|
370
|
+
mode: Mode;
|
|
371
|
+
timestamp: number;
|
|
372
|
+
}
|
|
373
|
+
declare const ProjectSettingsSchema: z.ZodObject<{
|
|
374
|
+
mainModel: z.ZodString;
|
|
375
|
+
weakModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
376
|
+
architectModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
377
|
+
agentProfileId: z.ZodString;
|
|
378
|
+
modelEditFormats: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
379
|
+
diff: "diff";
|
|
380
|
+
"diff-fenced": "diff-fenced";
|
|
381
|
+
whole: "whole";
|
|
382
|
+
udiff: "udiff";
|
|
383
|
+
"udiff-simple": "udiff-simple";
|
|
384
|
+
patch: "patch";
|
|
385
|
+
}>>;
|
|
386
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
387
|
+
thinkingTokens: z.ZodOptional<z.ZodString>;
|
|
388
|
+
currentMode: z.ZodString;
|
|
389
|
+
contextCompactingThreshold: z.ZodOptional<z.ZodNumber>;
|
|
390
|
+
weakModelLocked: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
+
autoApproveLocked: z.ZodOptional<z.ZodBoolean>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
|
|
394
|
+
declare enum ToolApprovalState {
|
|
395
|
+
Always = "always",
|
|
396
|
+
Never = "never",
|
|
397
|
+
Ask = "ask"
|
|
398
|
+
}
|
|
399
|
+
declare enum ProjectStartMode {
|
|
400
|
+
Empty = "empty",
|
|
401
|
+
Last = "last",
|
|
402
|
+
Remote = "remote"
|
|
403
|
+
}
|
|
404
|
+
declare enum SuggestionMode {
|
|
405
|
+
Automatically = "automatically",
|
|
406
|
+
OnTab = "onTab",
|
|
407
|
+
MentionAtSign = "mentionAtSign"
|
|
408
|
+
}
|
|
409
|
+
export interface PromptBehavior {
|
|
410
|
+
suggestionMode: SuggestionMode;
|
|
411
|
+
suggestionDelay: number;
|
|
412
|
+
requireCommandConfirmation: {
|
|
413
|
+
add: boolean;
|
|
414
|
+
readOnly: boolean;
|
|
415
|
+
model: boolean;
|
|
416
|
+
modeSwitching: boolean;
|
|
417
|
+
};
|
|
418
|
+
useVimBindings: boolean;
|
|
419
|
+
}
|
|
420
|
+
declare enum InvocationMode {
|
|
421
|
+
OnDemand = "on-demand",
|
|
422
|
+
Automatic = "automatic"
|
|
423
|
+
}
|
|
424
|
+
export interface SubagentConfig {
|
|
425
|
+
enabled: boolean;
|
|
426
|
+
contextMemory: ContextMemoryMode;
|
|
427
|
+
systemPrompt: string;
|
|
428
|
+
invocationMode: InvocationMode;
|
|
429
|
+
color: string;
|
|
430
|
+
description: string;
|
|
431
|
+
}
|
|
432
|
+
export interface BashToolSettings {
|
|
433
|
+
allowedPattern: string;
|
|
434
|
+
deniedPattern: string;
|
|
435
|
+
}
|
|
436
|
+
export type ToolSettings = BashToolSettings;
|
|
437
|
+
export interface AgentProfile {
|
|
438
|
+
id: string;
|
|
439
|
+
projectDir?: string;
|
|
440
|
+
name: string;
|
|
441
|
+
provider: string;
|
|
442
|
+
model: string;
|
|
443
|
+
maxIterations: number;
|
|
444
|
+
maxTokens?: number;
|
|
445
|
+
minTimeBetweenToolCalls: number;
|
|
446
|
+
temperature?: number;
|
|
447
|
+
enabledServers: string[];
|
|
448
|
+
toolApprovals: Record<string, ToolApprovalState>;
|
|
449
|
+
toolSettings: Record<string, ToolSettings>;
|
|
450
|
+
includeContextFiles: boolean;
|
|
451
|
+
includeRepoMap: boolean;
|
|
452
|
+
usePowerTools: boolean;
|
|
453
|
+
useAiderTools: boolean;
|
|
454
|
+
useTodoTools: boolean;
|
|
455
|
+
useSubagents: boolean;
|
|
456
|
+
useTaskTools: boolean;
|
|
457
|
+
useMemoryTools: boolean;
|
|
458
|
+
useSkillsTools: boolean;
|
|
459
|
+
useExtensionTools: boolean;
|
|
460
|
+
customInstructions: string;
|
|
461
|
+
subagent: SubagentConfig;
|
|
462
|
+
isSubagent?: boolean;
|
|
463
|
+
ruleFiles?: string[];
|
|
464
|
+
}
|
|
465
|
+
declare const THEMES: readonly [
|
|
466
|
+
"dark",
|
|
467
|
+
"light",
|
|
468
|
+
"charcoal",
|
|
469
|
+
"neon",
|
|
470
|
+
"neopunk",
|
|
471
|
+
"aurora",
|
|
472
|
+
"ocean",
|
|
473
|
+
"forest",
|
|
474
|
+
"lavender",
|
|
475
|
+
"bw",
|
|
476
|
+
"midnight",
|
|
477
|
+
"serenity",
|
|
478
|
+
"cappuccino",
|
|
479
|
+
"fresh",
|
|
480
|
+
"botanical-garden",
|
|
481
|
+
"botanical-garden-dark"
|
|
482
|
+
];
|
|
483
|
+
export type Theme = (typeof THEMES)[number];
|
|
484
|
+
declare const FONTS: readonly [
|
|
485
|
+
"Sono",
|
|
486
|
+
"Poppins",
|
|
487
|
+
"Nunito",
|
|
488
|
+
"Quicksand",
|
|
489
|
+
"PlayfairDisplay",
|
|
490
|
+
"Lora",
|
|
491
|
+
"SpaceGrotesk",
|
|
492
|
+
"Orbitron",
|
|
493
|
+
"Enriqueta",
|
|
494
|
+
"FunnelDisplay",
|
|
495
|
+
"GoogleSansCode",
|
|
496
|
+
"Inter",
|
|
497
|
+
"JetBrainsMono",
|
|
498
|
+
"RobotoMono",
|
|
499
|
+
"Sansation",
|
|
500
|
+
"Silkscreen",
|
|
501
|
+
"SourceCodePro",
|
|
502
|
+
"SpaceMono",
|
|
503
|
+
"UbuntuMono"
|
|
504
|
+
];
|
|
505
|
+
export type Font = (typeof FONTS)[number];
|
|
506
|
+
export interface HotkeyConfig {
|
|
507
|
+
projectHotkeys: {
|
|
508
|
+
closeProject: string;
|
|
509
|
+
newProject: string;
|
|
510
|
+
usageDashboard: string;
|
|
511
|
+
modelLibrary: string;
|
|
512
|
+
settings: string;
|
|
513
|
+
cycleNextProject: string;
|
|
514
|
+
cyclePrevProject: string;
|
|
515
|
+
switchProject1: string;
|
|
516
|
+
switchProject2: string;
|
|
517
|
+
switchProject3: string;
|
|
518
|
+
switchProject4: string;
|
|
519
|
+
switchProject5: string;
|
|
520
|
+
switchProject6: string;
|
|
521
|
+
switchProject7: string;
|
|
522
|
+
switchProject8: string;
|
|
523
|
+
switchProject9: string;
|
|
524
|
+
};
|
|
525
|
+
taskHotkeys: {
|
|
526
|
+
switchTask1: string;
|
|
527
|
+
switchTask2: string;
|
|
528
|
+
switchTask3: string;
|
|
529
|
+
switchTask4: string;
|
|
530
|
+
switchTask5: string;
|
|
531
|
+
switchTask6: string;
|
|
532
|
+
switchTask7: string;
|
|
533
|
+
switchTask8: string;
|
|
534
|
+
switchTask9: string;
|
|
535
|
+
focusPrompt: string;
|
|
536
|
+
newTask: string;
|
|
537
|
+
closeTask: string;
|
|
538
|
+
};
|
|
539
|
+
dialogHotkeys: {
|
|
540
|
+
browseFolder: string;
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
declare enum MemoryEmbeddingProvider {
|
|
544
|
+
SentenceTransformers = "sentence-transformers"
|
|
545
|
+
}
|
|
546
|
+
declare enum ContextCompactionType {
|
|
547
|
+
Compact = "compact",
|
|
548
|
+
Handoff = "handoff"
|
|
549
|
+
}
|
|
550
|
+
export interface TaskSettings {
|
|
551
|
+
smartTaskState: boolean;
|
|
552
|
+
autoGenerateTaskName: boolean;
|
|
553
|
+
showTaskStateActions: boolean;
|
|
554
|
+
worktreeSymlinkFolders: string[];
|
|
555
|
+
contextCompactingThreshold: number;
|
|
556
|
+
contextCompactionType: ContextCompactionType;
|
|
557
|
+
}
|
|
558
|
+
export interface MemoryConfig {
|
|
559
|
+
enabled: boolean;
|
|
560
|
+
provider: MemoryEmbeddingProvider;
|
|
561
|
+
model: string;
|
|
562
|
+
maxDistance: number;
|
|
563
|
+
}
|
|
564
|
+
export interface ExtensionsConfig {
|
|
565
|
+
repositories: string[];
|
|
566
|
+
disabled: string[];
|
|
567
|
+
}
|
|
568
|
+
export interface SettingsData {
|
|
569
|
+
onboardingFinished?: boolean;
|
|
570
|
+
language: string;
|
|
571
|
+
startupMode?: ProjectStartMode;
|
|
572
|
+
zoomLevel?: number;
|
|
573
|
+
notificationsEnabled?: boolean;
|
|
574
|
+
theme?: Theme;
|
|
575
|
+
font?: Font;
|
|
576
|
+
fontSize?: number;
|
|
577
|
+
renderMarkdown: boolean;
|
|
578
|
+
virtualizedRendering: boolean;
|
|
579
|
+
aiderDeskAutoUpdate: boolean;
|
|
580
|
+
diffViewMode?: DiffViewMode;
|
|
581
|
+
messageViewMode?: MessageViewMode;
|
|
582
|
+
aider: {
|
|
583
|
+
options: string;
|
|
584
|
+
environmentVariables: string;
|
|
585
|
+
addRuleFiles: boolean;
|
|
586
|
+
autoCommits: boolean;
|
|
587
|
+
cachingEnabled: boolean;
|
|
588
|
+
watchFiles: boolean;
|
|
589
|
+
confirmBeforeEdit: boolean;
|
|
590
|
+
};
|
|
591
|
+
preferredModels: string[];
|
|
592
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
593
|
+
llmProviders: {
|
|
594
|
+
openai?: OpenAiProvider;
|
|
595
|
+
anthropic?: AnthropicProvider;
|
|
596
|
+
gemini?: GeminiProvider;
|
|
597
|
+
groq?: GroqProvider;
|
|
598
|
+
bedrock?: BedrockProvider;
|
|
599
|
+
deepseek?: DeepseekProvider;
|
|
600
|
+
ollama?: OllamaProvider;
|
|
601
|
+
lmstudio?: LmStudioProvider;
|
|
602
|
+
minimax?: MinimaxProvider;
|
|
603
|
+
"openai-compatible"?: OpenAiCompatibleProvider;
|
|
604
|
+
opencode?: OpenCodeProvider;
|
|
605
|
+
openrouter?: OpenRouterProvider;
|
|
606
|
+
requesty?: RequestyProvider;
|
|
607
|
+
synthetic?: SyntheticProvider;
|
|
608
|
+
"vertex-ai"?: VertexAiProvider;
|
|
609
|
+
};
|
|
610
|
+
telemetryEnabled: boolean;
|
|
611
|
+
telemetryInformed?: boolean;
|
|
612
|
+
promptBehavior: PromptBehavior;
|
|
613
|
+
server: {
|
|
614
|
+
enabled: boolean;
|
|
615
|
+
basicAuth: {
|
|
616
|
+
enabled: boolean;
|
|
617
|
+
username: string;
|
|
618
|
+
password: string;
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
memory: MemoryConfig;
|
|
622
|
+
taskSettings: TaskSettings;
|
|
623
|
+
hotkeyConfig?: HotkeyConfig;
|
|
624
|
+
extensions?: ExtensionsConfig;
|
|
625
|
+
}
|
|
626
|
+
export interface ProviderProfile {
|
|
627
|
+
id: string;
|
|
628
|
+
name?: string;
|
|
629
|
+
provider: LlmProvider;
|
|
630
|
+
headers?: Record<string, string>;
|
|
631
|
+
disabled?: boolean;
|
|
632
|
+
}
|
|
633
|
+
export interface McpServerConfig {
|
|
634
|
+
command?: string;
|
|
635
|
+
args?: string[];
|
|
636
|
+
env?: Readonly<Record<string, string>>;
|
|
637
|
+
url?: string;
|
|
638
|
+
headers?: Readonly<Record<string, string>>;
|
|
639
|
+
}
|
|
640
|
+
declare const TaskDataSchema: z.ZodObject<{
|
|
641
|
+
id: z.ZodString;
|
|
642
|
+
baseDir: z.ZodString;
|
|
643
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
644
|
+
name: z.ZodString;
|
|
645
|
+
state: z.ZodOptional<z.ZodString>;
|
|
646
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
647
|
+
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
648
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
649
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
650
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
651
|
+
interruptedAt: z.ZodOptional<z.ZodString>;
|
|
652
|
+
completedAt: z.ZodOptional<z.ZodString>;
|
|
653
|
+
worktree: z.ZodOptional<z.ZodObject<{
|
|
654
|
+
path: z.ZodString;
|
|
655
|
+
baseBranch: z.ZodOptional<z.ZodString>;
|
|
656
|
+
baseCommit: z.ZodOptional<z.ZodString>;
|
|
657
|
+
prunable: z.ZodOptional<z.ZodBoolean>;
|
|
658
|
+
}, z.core.$strip>>;
|
|
659
|
+
workingMode: z.ZodOptional<z.ZodEnum<{
|
|
660
|
+
local: "local";
|
|
661
|
+
worktree: "worktree";
|
|
662
|
+
}>>;
|
|
663
|
+
lastMergeState: z.ZodOptional<z.ZodObject<{
|
|
664
|
+
beforeMergeCommitHash: z.ZodString;
|
|
665
|
+
worktreeBranchCommitHash: z.ZodString;
|
|
666
|
+
mainOriginalStashId: z.ZodOptional<z.ZodString>;
|
|
667
|
+
targetBranch: z.ZodOptional<z.ZodString>;
|
|
668
|
+
timestamp: z.ZodNumber;
|
|
669
|
+
}, z.core.$strip>>;
|
|
670
|
+
aiderTotalCost: z.ZodNumber;
|
|
671
|
+
agentTotalCost: z.ZodNumber;
|
|
672
|
+
autoApprove: z.ZodOptional<z.ZodBoolean>;
|
|
673
|
+
agentProfileId: z.ZodOptional<z.ZodString>;
|
|
674
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
675
|
+
model: z.ZodOptional<z.ZodString>;
|
|
676
|
+
mainModel: z.ZodString;
|
|
677
|
+
weakModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
678
|
+
architectModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
679
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
680
|
+
thinkingTokens: z.ZodOptional<z.ZodString>;
|
|
681
|
+
currentMode: z.ZodOptional<z.ZodString>;
|
|
682
|
+
contextCompactingThreshold: z.ZodOptional<z.ZodNumber>;
|
|
683
|
+
weakModelLocked: z.ZodOptional<z.ZodBoolean>;
|
|
684
|
+
handoff: z.ZodOptional<z.ZodBoolean>;
|
|
685
|
+
lastAgentProviderMetadata: z.ZodOptional<z.ZodUnknown>;
|
|
686
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
687
|
+
}, z.core.$strip>;
|
|
688
|
+
export type TaskData = z.infer<typeof TaskDataSchema>;
|
|
689
|
+
export interface CreateTaskParams {
|
|
690
|
+
parentId?: string | null;
|
|
691
|
+
name?: string;
|
|
692
|
+
autoApprove?: boolean;
|
|
693
|
+
activate?: boolean;
|
|
694
|
+
handoff?: boolean;
|
|
695
|
+
sendEvent?: boolean;
|
|
696
|
+
provider?: string;
|
|
697
|
+
model?: string;
|
|
698
|
+
}
|
|
699
|
+
export interface TodoItem {
|
|
700
|
+
name: string;
|
|
701
|
+
completed: boolean;
|
|
702
|
+
}
|
|
703
|
+
export interface Model {
|
|
704
|
+
id: string;
|
|
705
|
+
providerId: string;
|
|
706
|
+
maxInputTokens?: number;
|
|
707
|
+
maxOutputTokens?: number;
|
|
708
|
+
maxOutputTokensLimit?: number;
|
|
709
|
+
temperature?: number;
|
|
710
|
+
inputCostPerToken?: number;
|
|
711
|
+
outputCostPerToken?: number;
|
|
712
|
+
cacheWriteInputTokenCost?: number;
|
|
713
|
+
cacheReadInputTokenCost?: number;
|
|
714
|
+
supportsTools?: boolean;
|
|
715
|
+
isCustom?: boolean;
|
|
716
|
+
isHidden?: boolean;
|
|
717
|
+
hasModelOverrides?: boolean;
|
|
718
|
+
providerOverrides?: Record<string, unknown>;
|
|
719
|
+
}
|
|
720
|
+
export interface Command {
|
|
721
|
+
name: string;
|
|
722
|
+
description: string;
|
|
723
|
+
arguments: CommandArgument[];
|
|
724
|
+
}
|
|
725
|
+
export interface CommandArgument {
|
|
726
|
+
description: string;
|
|
727
|
+
required?: boolean;
|
|
728
|
+
options?: string[];
|
|
729
|
+
}
|
|
730
|
+
export interface CustomCommand extends Command {
|
|
731
|
+
template: string;
|
|
732
|
+
includeContext?: boolean;
|
|
733
|
+
autoApprove?: boolean;
|
|
734
|
+
}
|
|
735
|
+
export type AgentStepResult = unknown;
|
|
736
|
+
export declare const AIDER_DESK_EXTENSIONS_REPO_URL = "https://github.com/hotovo/aider-desk/tree/main/packages/extensions/extensions/";
|
|
737
|
+
export interface ResponseMessage {
|
|
738
|
+
id: string;
|
|
739
|
+
content: string;
|
|
740
|
+
reflectedMessage?: string;
|
|
741
|
+
finished: boolean;
|
|
742
|
+
usageReport?: UsageReportData;
|
|
743
|
+
promptContext?: PromptContext;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Metadata describing an extension
|
|
747
|
+
*/
|
|
748
|
+
export interface ExtensionMetadata {
|
|
749
|
+
/** Extension name (displayed in UI) */
|
|
750
|
+
name: string;
|
|
751
|
+
/** Semantic version (e.g., "1.0.0") */
|
|
752
|
+
version: string;
|
|
753
|
+
/** Brief description of extension functionality */
|
|
754
|
+
description?: string;
|
|
755
|
+
/** Author name or organization */
|
|
756
|
+
author?: string;
|
|
757
|
+
/** Optional list of extension capabilities (e.g., ["tools", "ui-elements"]) */
|
|
758
|
+
capabilities?: string[];
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Result returned by tool execution
|
|
762
|
+
*/
|
|
763
|
+
export interface ToolResult {
|
|
764
|
+
/** Content array with text or image data */
|
|
765
|
+
content: Array<{
|
|
766
|
+
type: "text";
|
|
767
|
+
text: string;
|
|
768
|
+
} | {
|
|
769
|
+
type: "image";
|
|
770
|
+
source: unknown;
|
|
771
|
+
}>;
|
|
772
|
+
/** Additional metadata for extensions */
|
|
773
|
+
details?: Record<string, unknown>;
|
|
774
|
+
/** Mark result as error */
|
|
775
|
+
isError?: boolean;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Definition of a tool that can be registered by an extension
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* ```typescript
|
|
782
|
+
* const myTool: ToolDefinition = {
|
|
783
|
+
* name: 'run-linter',
|
|
784
|
+
* description: 'Run the project linter',
|
|
785
|
+
* parameters: z.object({
|
|
786
|
+
* fix: z.boolean().optional().describe('Auto-fix issues'),
|
|
787
|
+
* }),
|
|
788
|
+
* async execute(input, signal, context) {
|
|
789
|
+
* const output = await runLinter(input.fix);
|
|
790
|
+
* return output;
|
|
791
|
+
* },
|
|
792
|
+
* };
|
|
793
|
+
* ```
|
|
794
|
+
*/
|
|
795
|
+
export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<string, unknown>>> {
|
|
796
|
+
/** Tool identifier in kebab-case (e.g., 'run-linter') */
|
|
797
|
+
name: string;
|
|
798
|
+
/** Description for LLM to understand tool purpose */
|
|
799
|
+
description: string;
|
|
800
|
+
/** Zod schema for parameter validation */
|
|
801
|
+
inputSchema: TSchema;
|
|
802
|
+
/** Execute function with type-safe args */
|
|
803
|
+
execute: (input: z.infer<TSchema>, signal: AbortSignal | undefined, context: ExtensionContext) => Promise<unknown>;
|
|
804
|
+
}
|
|
805
|
+
/** UI element types */
|
|
806
|
+
export type UIElementType = "action-button" | "status-indicator" | "badge";
|
|
807
|
+
/** Placement locations for UI elements */
|
|
808
|
+
export declare enum UIPlacement {
|
|
809
|
+
/** Task sidebar area */
|
|
810
|
+
TaskSidebar = "task-sidebar",
|
|
811
|
+
/** Chat toolbar area */
|
|
812
|
+
ChatToolbar = "chat-toolbar",
|
|
813
|
+
/** Message action buttons */
|
|
814
|
+
MessageActions = "message-actions",
|
|
815
|
+
/** Global toolbar */
|
|
816
|
+
GlobalToolbar = "global-toolbar"
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Definition of a UI element that can be registered by an extension
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* ```typescript
|
|
823
|
+
* const myButton: UIElementDefinition = {
|
|
824
|
+
* id: 'generate-jira-ticket',
|
|
825
|
+
* type: 'action-button',
|
|
826
|
+
* label: 'Create JIRA Ticket',
|
|
827
|
+
* icon: 'FiExternalLink',
|
|
828
|
+
* description: 'Create a JIRA ticket from this task',
|
|
829
|
+
* placement: UIPlacement.TaskSidebar,
|
|
830
|
+
* context: 'task',
|
|
831
|
+
* onClick: 'handleJiraClick',
|
|
832
|
+
* };
|
|
833
|
+
* ```
|
|
834
|
+
*/
|
|
835
|
+
export interface UIElementDefinition {
|
|
836
|
+
/** Unique element identifier in kebab-case */
|
|
837
|
+
id: string;
|
|
838
|
+
/** Element type (button, status indicator, etc.) */
|
|
839
|
+
type: UIElementType;
|
|
840
|
+
/** Display text for button or label */
|
|
841
|
+
label: string;
|
|
842
|
+
/** Optional icon name from react-icons library */
|
|
843
|
+
icon?: string;
|
|
844
|
+
/** Optional tooltip or help text */
|
|
845
|
+
description?: string;
|
|
846
|
+
/** Where in UI to render this element */
|
|
847
|
+
placement: UIPlacement;
|
|
848
|
+
/** Context type (task, project, global) */
|
|
849
|
+
context?: "task" | "project" | "global";
|
|
850
|
+
/** Handler ID to call in extension when clicked */
|
|
851
|
+
onClick: string;
|
|
852
|
+
/** Optional: Conditional visibility check */
|
|
853
|
+
enabled?: (context: unknown) => boolean;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Definition of a command that can be registered by an extension
|
|
857
|
+
*
|
|
858
|
+
* Extension commands are fully responsible for their own execution logic.
|
|
859
|
+
* The execute function should handle everything including:
|
|
860
|
+
* - Processing arguments
|
|
861
|
+
* - Performing any operations (file I/O, API calls, etc.)
|
|
862
|
+
* - Sending prompts to agent/aider if needed via context methods
|
|
863
|
+
* - Displaying results to the user
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```typescript
|
|
867
|
+
* const myCommand: CommandDefinition = {
|
|
868
|
+
* name: 'generate-tests',
|
|
869
|
+
* description: 'Generate unit tests for the current file',
|
|
870
|
+
* arguments: [
|
|
871
|
+
* { description: 'File path to generate tests for', required: true },
|
|
872
|
+
* { description: 'Test framework (jest, vitest, mocha)', required: false }
|
|
873
|
+
* ],
|
|
874
|
+
* async execute(args, context) {
|
|
875
|
+
* const filePath = args[0];
|
|
876
|
+
* const framework = args[1] || 'vitest';
|
|
877
|
+
*
|
|
878
|
+
* // Read file, process it, send prompt to agent, etc.
|
|
879
|
+
* const fileContent = await readFile(filePath);
|
|
880
|
+
* const prompt = `Generate tests for ${filePath} using ${framework}...`;
|
|
881
|
+
*
|
|
882
|
+
* // Extension handles sending the prompt
|
|
883
|
+
* // (context would provide methods to do this)
|
|
884
|
+
* },
|
|
885
|
+
* };
|
|
886
|
+
* ```
|
|
887
|
+
*/
|
|
888
|
+
export interface CommandDefinition {
|
|
889
|
+
/** Command name in kebab-case (e.g., 'generate-tests') */
|
|
890
|
+
name: string;
|
|
891
|
+
/** Description shown in autocomplete */
|
|
892
|
+
description: string;
|
|
893
|
+
/** Command arguments */
|
|
894
|
+
arguments?: CommandArgument[];
|
|
895
|
+
/** Execute function that handles the complete command logic */
|
|
896
|
+
execute: (args: string[], context: ExtensionContext) => Promise<void>;
|
|
897
|
+
}
|
|
898
|
+
/** Event payload for task creation events */
|
|
899
|
+
export interface TaskCreatedEvent {
|
|
900
|
+
task: TaskData;
|
|
901
|
+
}
|
|
902
|
+
/** Event payload for task prepared events */
|
|
903
|
+
export interface TaskPreparedEvent {
|
|
904
|
+
task: TaskData;
|
|
905
|
+
}
|
|
906
|
+
/** Event payload for task initialization events */
|
|
907
|
+
export interface TaskInitializedEvent {
|
|
908
|
+
readonly task: TaskData;
|
|
909
|
+
}
|
|
910
|
+
/** Event payload for task closed events */
|
|
911
|
+
export interface TaskClosedEvent {
|
|
912
|
+
readonly task: TaskData;
|
|
913
|
+
}
|
|
914
|
+
/** Event payload for task updated events */
|
|
915
|
+
export interface TaskUpdatedEvent {
|
|
916
|
+
task: TaskData;
|
|
917
|
+
}
|
|
918
|
+
/** Event payload for project opened events */
|
|
919
|
+
export interface ProjectStartedEvent {
|
|
920
|
+
readonly baseDir: string;
|
|
921
|
+
}
|
|
922
|
+
/** Event payload for project closed events */
|
|
923
|
+
export interface ProjectStoppedEvent {
|
|
924
|
+
readonly baseDir: string;
|
|
925
|
+
}
|
|
926
|
+
/** Event payload for prompt started events */
|
|
927
|
+
export interface PromptStartedEvent {
|
|
928
|
+
prompt: string;
|
|
929
|
+
mode: Mode;
|
|
930
|
+
promptContext: PromptContext;
|
|
931
|
+
blocked?: boolean;
|
|
932
|
+
}
|
|
933
|
+
/** Event payload for prompt finished events */
|
|
934
|
+
export interface PromptFinishedEvent {
|
|
935
|
+
responses: ResponseCompletedData[];
|
|
936
|
+
}
|
|
937
|
+
/** Event payload for prompt template events */
|
|
938
|
+
export interface PromptTemplateEvent {
|
|
939
|
+
/** Template name (e.g., 'system-prompt', 'init-project', etc.) */
|
|
940
|
+
readonly name: string;
|
|
941
|
+
/** Template data object */
|
|
942
|
+
readonly data: unknown;
|
|
943
|
+
/** Rendered prompt that can be overridden by extension */
|
|
944
|
+
prompt: string;
|
|
945
|
+
}
|
|
946
|
+
/** Event payload for agent started events */
|
|
947
|
+
export interface AgentStartedEvent {
|
|
948
|
+
readonly mode: Mode;
|
|
949
|
+
prompt: string | null;
|
|
950
|
+
agentProfile: AgentProfile;
|
|
951
|
+
providerProfile: ProviderProfile;
|
|
952
|
+
model: string;
|
|
953
|
+
promptContext?: PromptContext;
|
|
954
|
+
systemPrompt: string | undefined;
|
|
955
|
+
contextMessages: ContextMessage[];
|
|
956
|
+
contextFiles: ContextFile[];
|
|
957
|
+
blocked?: boolean;
|
|
958
|
+
}
|
|
959
|
+
/** Event payload for agent finished events */
|
|
960
|
+
export interface AgentFinishedEvent {
|
|
961
|
+
readonly mode: Mode;
|
|
962
|
+
readonly aborted: boolean;
|
|
963
|
+
readonly contextMessages: ContextMessage[];
|
|
964
|
+
resultMessages: ContextMessage[];
|
|
965
|
+
}
|
|
966
|
+
/** Event payload for agent step finished events */
|
|
967
|
+
export interface AgentStepFinishedEvent {
|
|
968
|
+
readonly mode: Mode;
|
|
969
|
+
readonly agentProfile: AgentProfile;
|
|
970
|
+
readonly currentResponseId: string;
|
|
971
|
+
readonly stepResult: AgentStepResult;
|
|
972
|
+
finishReason: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other" | "unknown";
|
|
973
|
+
responseMessages: ContextMessage[];
|
|
974
|
+
}
|
|
975
|
+
/** Event payload for message optimization events */
|
|
976
|
+
export interface OptimizeMessagesEvent {
|
|
977
|
+
readonly originalMessages: ContextMessage[];
|
|
978
|
+
optimizedMessages: ContextMessage[];
|
|
979
|
+
}
|
|
980
|
+
/** Event payload for important reminders events */
|
|
981
|
+
export interface ImportantRemindersEvent {
|
|
982
|
+
readonly profile: AgentProfile;
|
|
983
|
+
remindersContent: string;
|
|
984
|
+
}
|
|
985
|
+
/** Event payload for tool approval events */
|
|
986
|
+
export interface ToolApprovalEvent {
|
|
987
|
+
readonly toolName: string;
|
|
988
|
+
readonly input: Record<string, unknown> | undefined;
|
|
989
|
+
blocked?: boolean;
|
|
990
|
+
allowed?: boolean;
|
|
991
|
+
}
|
|
992
|
+
/** Event payload for tool called events */
|
|
993
|
+
export interface ToolCalledEvent {
|
|
994
|
+
readonly toolName: string;
|
|
995
|
+
readonly abortSignal?: AbortSignal;
|
|
996
|
+
input: Record<string, unknown> | undefined;
|
|
997
|
+
output?: unknown;
|
|
998
|
+
}
|
|
999
|
+
/** Event payload for tool finished events */
|
|
1000
|
+
export interface ToolFinishedEvent {
|
|
1001
|
+
readonly toolName: string;
|
|
1002
|
+
readonly input: Record<string, unknown> | undefined;
|
|
1003
|
+
output: unknown;
|
|
1004
|
+
}
|
|
1005
|
+
/** Event payload for files added events */
|
|
1006
|
+
export interface FilesAddedEvent {
|
|
1007
|
+
files: ContextFile[];
|
|
1008
|
+
}
|
|
1009
|
+
/** Event payload for files dropped events */
|
|
1010
|
+
export interface FilesDroppedEvent {
|
|
1011
|
+
files: ContextFile[];
|
|
1012
|
+
}
|
|
1013
|
+
/** Event payload for rule files retrieved events */
|
|
1014
|
+
export interface RuleFilesRetrievedEvent {
|
|
1015
|
+
files: ContextFile[];
|
|
1016
|
+
}
|
|
1017
|
+
/** Event payload for response message processed events */
|
|
1018
|
+
export interface ResponseChunkEvent {
|
|
1019
|
+
chunk: ResponseChunkData;
|
|
1020
|
+
}
|
|
1021
|
+
export interface ResponseCompletedEvent {
|
|
1022
|
+
response: ResponseCompletedData;
|
|
1023
|
+
}
|
|
1024
|
+
export interface HandleApprovalEvent {
|
|
1025
|
+
key: string;
|
|
1026
|
+
text: string;
|
|
1027
|
+
subject?: string;
|
|
1028
|
+
blocked?: boolean;
|
|
1029
|
+
allowed?: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
/** Event payload for subagent started events */
|
|
1032
|
+
export interface SubagentStartedEvent {
|
|
1033
|
+
subagentProfile: AgentProfile;
|
|
1034
|
+
prompt: string;
|
|
1035
|
+
promptContext?: PromptContext;
|
|
1036
|
+
contextMessages: ContextMessage[];
|
|
1037
|
+
contextFiles: ContextFile[];
|
|
1038
|
+
systemPrompt?: string;
|
|
1039
|
+
blocked?: boolean;
|
|
1040
|
+
}
|
|
1041
|
+
/** Event payload for subagent finished events */
|
|
1042
|
+
export interface SubagentFinishedEvent {
|
|
1043
|
+
readonly subagentProfile: AgentProfile;
|
|
1044
|
+
resultMessages: ContextMessage[];
|
|
1045
|
+
}
|
|
1046
|
+
/** Event payload for question asked events */
|
|
1047
|
+
export interface QuestionAskedEvent {
|
|
1048
|
+
question: QuestionData;
|
|
1049
|
+
answer?: string;
|
|
1050
|
+
}
|
|
1051
|
+
/** Event payload for question answered events */
|
|
1052
|
+
export interface QuestionAnsweredEvent {
|
|
1053
|
+
readonly question: QuestionData;
|
|
1054
|
+
answer: string;
|
|
1055
|
+
userInput?: string;
|
|
1056
|
+
}
|
|
1057
|
+
/** Event payload for command executed events */
|
|
1058
|
+
export interface CommandExecutedEvent {
|
|
1059
|
+
command: string;
|
|
1060
|
+
blocked?: boolean;
|
|
1061
|
+
}
|
|
1062
|
+
/** Event payload for custom command executed events */
|
|
1063
|
+
export interface CustomCommandExecutedEvent {
|
|
1064
|
+
command: CustomCommand;
|
|
1065
|
+
mode: Mode;
|
|
1066
|
+
blocked?: boolean;
|
|
1067
|
+
prompt?: string;
|
|
1068
|
+
}
|
|
1069
|
+
/** Event payload for aider prompt started events */
|
|
1070
|
+
export interface AiderPromptStartedEvent {
|
|
1071
|
+
prompt: string;
|
|
1072
|
+
mode: Mode;
|
|
1073
|
+
promptContext: PromptContext;
|
|
1074
|
+
messages: ConnectorMessage[];
|
|
1075
|
+
files: ContextFile[];
|
|
1076
|
+
blocked?: boolean;
|
|
1077
|
+
autoApprove?: boolean;
|
|
1078
|
+
denyCommands?: boolean;
|
|
1079
|
+
}
|
|
1080
|
+
/** Event payload for aider prompt finished events */
|
|
1081
|
+
export interface AiderPromptFinishedEvent {
|
|
1082
|
+
responses: ResponseCompletedData[];
|
|
1083
|
+
}
|
|
1084
|
+
/** Options for asking questions to the user */
|
|
1085
|
+
export interface QuestionOptions {
|
|
1086
|
+
subject?: string;
|
|
1087
|
+
answers?: Array<{
|
|
1088
|
+
text: string;
|
|
1089
|
+
shortkey: string;
|
|
1090
|
+
}>;
|
|
1091
|
+
defaultAnswer?: string;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Safe subset of Task capabilities exposed to extensions.
|
|
1095
|
+
* Provides read-only access to task data and safe operations.
|
|
1096
|
+
*/
|
|
1097
|
+
export interface TaskContext {
|
|
1098
|
+
readonly data: TaskData;
|
|
1099
|
+
getContextFiles(): Promise<ContextFile[]>;
|
|
1100
|
+
addFile(path: string, readOnly?: boolean): Promise<void>;
|
|
1101
|
+
addFiles(...files: ContextFile[]): Promise<void>;
|
|
1102
|
+
dropFile(path: string): Promise<void>;
|
|
1103
|
+
getContextMessages(): Promise<ContextMessage[]>;
|
|
1104
|
+
addContextMessage(message: ContextMessage, updateContextInfo?: boolean): Promise<void>;
|
|
1105
|
+
removeMessage(messageId: string): Promise<void>;
|
|
1106
|
+
removeLastMessage(): Promise<void>;
|
|
1107
|
+
removeMessagesUpTo(messageId: string): Promise<void>;
|
|
1108
|
+
loadContextMessages(messages: ContextMessage[]): Promise<void>;
|
|
1109
|
+
redoLastUserPrompt(mode?: string, updatedPrompt?: string): Promise<void>;
|
|
1110
|
+
addUserMessage(id: string, content: string, promptContext?: PromptContext): void;
|
|
1111
|
+
addToolMessage(id: string, serverName: string, toolName: string, input?: unknown, response?: string, usageReport?: UsageReportData, promptContext?: PromptContext, saveToDb?: boolean, finished?: boolean): void;
|
|
1112
|
+
addResponseMessage(message: ResponseMessage, saveToDb?: boolean): Promise<void>;
|
|
1113
|
+
getTaskDir(): string;
|
|
1114
|
+
getAddableFiles(searchRegex?: string): Promise<string[]>;
|
|
1115
|
+
getAllFiles(useGit?: boolean): Promise<string[]>;
|
|
1116
|
+
getUpdatedFiles(): Promise<UpdatedFile[]>;
|
|
1117
|
+
getRepoMap(): string;
|
|
1118
|
+
addToGit(path: string): Promise<void>;
|
|
1119
|
+
getTodos(): Promise<TodoItem[]>;
|
|
1120
|
+
addTodo(name: string): Promise<TodoItem[]>;
|
|
1121
|
+
updateTodo(name: string, updates: Partial<TodoItem>): Promise<TodoItem[]>;
|
|
1122
|
+
deleteTodo(name: string): Promise<TodoItem[]>;
|
|
1123
|
+
clearAllTodos(): Promise<TodoItem[]>;
|
|
1124
|
+
setTodos(items: TodoItem[], initialUserPrompt?: string): Promise<void>;
|
|
1125
|
+
runPrompt(prompt: string, mode?: string): Promise<void>;
|
|
1126
|
+
runCustomCommand(name: string, args?: string[], mode?: string): Promise<void>;
|
|
1127
|
+
runSubagent(agentProfile: AgentProfile, prompt: string): Promise<void>;
|
|
1128
|
+
runCommand(command: string): Promise<void>;
|
|
1129
|
+
interruptResponse(): Promise<void>;
|
|
1130
|
+
generateText(agentProfile: AgentProfile, systemPrompt: string, prompt: string): Promise<string | undefined>;
|
|
1131
|
+
askQuestion(text: string, options?: QuestionOptions): Promise<string>;
|
|
1132
|
+
addLogMessage(level: "info" | "error" | "warning", message?: string): void;
|
|
1133
|
+
addLoadingMessage(message?: string, finished?: boolean): void;
|
|
1134
|
+
updateTask(updates: Partial<TaskData>): Promise<TaskData>;
|
|
1135
|
+
handoffConversation(focus?: string, execute?: boolean): Promise<void>;
|
|
1136
|
+
clearContext(): Promise<void>;
|
|
1137
|
+
resetContext(): Promise<void>;
|
|
1138
|
+
compactConversation(instructions?: string): Promise<void>;
|
|
1139
|
+
generateContextMarkdown(): Promise<string | null>;
|
|
1140
|
+
isInitialized(): boolean;
|
|
1141
|
+
updateAutocompletionWords(words?: string[]): Promise<void>;
|
|
1142
|
+
getQueuedPrompts(): QueuedPromptData[];
|
|
1143
|
+
sendQueuedPromptNow(promptId: string): Promise<void>;
|
|
1144
|
+
removeQueuedPrompt(promptId: string): void;
|
|
1145
|
+
getTaskAgentProfile(): Promise<AgentProfile | null>;
|
|
1146
|
+
answerQuestion(answer: string, userInput?: string): Promise<boolean>;
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Safe subset of Project capabilities exposed to extensions.
|
|
1150
|
+
* Provides read-only access to project data and safe operations.
|
|
1151
|
+
*/
|
|
1152
|
+
export interface ProjectContext {
|
|
1153
|
+
readonly baseDir: string;
|
|
1154
|
+
createTask(params: CreateTaskParams): Promise<TaskData>;
|
|
1155
|
+
getTask(taskId: string): TaskContext | null;
|
|
1156
|
+
getTasks(): Promise<TaskData[]>;
|
|
1157
|
+
getMostRecentTask(): TaskContext | null;
|
|
1158
|
+
forkTask(taskId: string, messageId: string): Promise<TaskData>;
|
|
1159
|
+
duplicateTask(taskId: string): Promise<TaskData>;
|
|
1160
|
+
deleteTask(taskId: string): Promise<void>;
|
|
1161
|
+
getAgentProfiles(): AgentProfile[];
|
|
1162
|
+
getCommands(): CommandsData;
|
|
1163
|
+
getProjectSettings(): ProjectSettings;
|
|
1164
|
+
getInputHistory(): Promise<string[]>;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Context object passed to extension methods providing access to AiderDesk APIs
|
|
1168
|
+
*
|
|
1169
|
+
* @example
|
|
1170
|
+
* ```typescript
|
|
1171
|
+
* async onLoad(context: ExtensionContext) {
|
|
1172
|
+
* const taskContext = context.getTaskContext();
|
|
1173
|
+
* if (taskContext) {
|
|
1174
|
+
* context.log(`Task: ${taskContext.data.name}`, 'info');
|
|
1175
|
+
* }
|
|
1176
|
+
* }
|
|
1177
|
+
* ```
|
|
1178
|
+
*/
|
|
1179
|
+
export interface ExtensionContext {
|
|
1180
|
+
/**
|
|
1181
|
+
* Log a message to the AiderDesk console and log files
|
|
1182
|
+
* @param message - Message to log
|
|
1183
|
+
* @param type - Log level (info, error, warn, debug)
|
|
1184
|
+
*/
|
|
1185
|
+
log(message: string, type?: "info" | "error" | "warn" | "debug"): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* Get the current project directory path
|
|
1188
|
+
* @returns Absolute path to the project directory
|
|
1189
|
+
*/
|
|
1190
|
+
getProjectDir(): string;
|
|
1191
|
+
/**
|
|
1192
|
+
* Get the current task context for safe task operations
|
|
1193
|
+
* @returns TaskContext or null if no task is active
|
|
1194
|
+
*/
|
|
1195
|
+
getTaskContext(): TaskContext | null;
|
|
1196
|
+
/**
|
|
1197
|
+
* Get the project context for safe project operations
|
|
1198
|
+
* @returns ProjectContext
|
|
1199
|
+
*/
|
|
1200
|
+
getProjectContext(): ProjectContext;
|
|
1201
|
+
/**
|
|
1202
|
+
* Get all available model configurations
|
|
1203
|
+
* @returns Promise resolving to array of models
|
|
1204
|
+
*/
|
|
1205
|
+
getModelConfigs(): Promise<Model[]>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Get a specific setting value
|
|
1208
|
+
* @param key - Setting key (dot-notation supported, e.g., 'general.theme')
|
|
1209
|
+
* @returns Promise resolving to the setting value
|
|
1210
|
+
*/
|
|
1211
|
+
getSetting(key: string): Promise<unknown>;
|
|
1212
|
+
/**
|
|
1213
|
+
* Update multiple settings at once
|
|
1214
|
+
* @param updates - Partial settings object with updates
|
|
1215
|
+
* @returns Promise that resolves when settings are saved
|
|
1216
|
+
*/
|
|
1217
|
+
updateSettings(updates: Partial<SettingsData>): Promise<void>;
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Main extension interface that all extensions must implement
|
|
1221
|
+
*
|
|
1222
|
+
* All methods are optional - implement only what you need.
|
|
1223
|
+
* Event handlers can return void or a partial event to modify the event data.
|
|
1224
|
+
*
|
|
1225
|
+
* @example
|
|
1226
|
+
* ```typescript
|
|
1227
|
+
* class MyExtension implements Extension {
|
|
1228
|
+
* async onLoad(context: ExtensionContext) {
|
|
1229
|
+
* this.context = context;
|
|
1230
|
+
* context.log('My extension loaded!', 'info');
|
|
1231
|
+
* }
|
|
1232
|
+
*
|
|
1233
|
+
* getTools(context: ExtensionContext): ToolDefinition[] {
|
|
1234
|
+
* return [{
|
|
1235
|
+
* name: 'my-tool',
|
|
1236
|
+
* description: 'My custom tool',
|
|
1237
|
+
* parameters: z.object({ input: z.string() }),
|
|
1238
|
+
* async execute(args, signal, context) {
|
|
1239
|
+
* return { content: [{ type: 'text', text: args.input }] };
|
|
1240
|
+
* },
|
|
1241
|
+
* }];
|
|
1242
|
+
* }
|
|
1243
|
+
*
|
|
1244
|
+
* async onPromptSubmitted(event: PromptSubmittedEvent, context: ExtensionContext) {
|
|
1245
|
+
* context.log(`Prompt: ${event.prompt}`, 'debug');
|
|
1246
|
+
* }
|
|
1247
|
+
* }
|
|
1248
|
+
* ```
|
|
1249
|
+
*/
|
|
1250
|
+
export interface Extension {
|
|
1251
|
+
/**
|
|
1252
|
+
* Called when extension is loaded
|
|
1253
|
+
* Use this to initialize your extension, set up state, etc.
|
|
1254
|
+
*/
|
|
1255
|
+
onLoad?(context: ExtensionContext): void | Promise<void>;
|
|
1256
|
+
/**
|
|
1257
|
+
* Called when extension is unloaded
|
|
1258
|
+
* Clean up resources, save state, etc.
|
|
1259
|
+
*/
|
|
1260
|
+
onUnload?(): void | Promise<void>;
|
|
1261
|
+
/**
|
|
1262
|
+
* Return array of tools this extension provides
|
|
1263
|
+
* Called when extension is loaded and when tools need to be refreshed
|
|
1264
|
+
* @param context - Extension context
|
|
1265
|
+
* @param mode - Current mode
|
|
1266
|
+
* @param agentProfile - Current agent profile
|
|
1267
|
+
*/
|
|
1268
|
+
getTools?(context: ExtensionContext, mode: string, agentProfile: AgentProfile): ToolDefinition[];
|
|
1269
|
+
/**
|
|
1270
|
+
* Return array of commands this extension provides
|
|
1271
|
+
* Called when extension is loaded and when commands need to be refreshed
|
|
1272
|
+
*/
|
|
1273
|
+
getCommands?(context: ExtensionContext): CommandDefinition[];
|
|
1274
|
+
/**
|
|
1275
|
+
* Return array of modes this extension provides
|
|
1276
|
+
* Called when extension is loaded and when modes need to be refreshed
|
|
1277
|
+
*/
|
|
1278
|
+
getModes?(context: ExtensionContext): ModeDefinition[];
|
|
1279
|
+
/**
|
|
1280
|
+
* Return array of agent profiles this extension provides
|
|
1281
|
+
* Called when extension is loaded and when agents need to be refreshed
|
|
1282
|
+
* Extension-provided agents will be included in the list of all agents
|
|
1283
|
+
*/
|
|
1284
|
+
getAgents?(context: ExtensionContext): AgentProfile[];
|
|
1285
|
+
/**
|
|
1286
|
+
* Called when a user updates an extension-provided agent profile
|
|
1287
|
+
* Extension should persist the updated profile and return it from future getAgents() calls
|
|
1288
|
+
* @param context - Extension context (no project available for global operations)
|
|
1289
|
+
* @param agentId - The ID of the agent being updated
|
|
1290
|
+
* @param updatedProfile - The complete updated profile
|
|
1291
|
+
* @returns The updated agent profile
|
|
1292
|
+
*/
|
|
1293
|
+
onAgentProfileUpdated?(context: ExtensionContext, agentId: string, updatedProfile: AgentProfile): Promise<AgentProfile>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Called when a new task is created
|
|
1296
|
+
* @returns void or partial event to modify task data
|
|
1297
|
+
*/
|
|
1298
|
+
onTaskCreated?(event: TaskCreatedEvent, context: ExtensionContext): Promise<void | Partial<TaskCreatedEvent>>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Called when a task is prepared (both new and loaded tasks)
|
|
1301
|
+
* @returns void or partial event to modify task data
|
|
1302
|
+
*/
|
|
1303
|
+
onTaskPrepared?(event: TaskPreparedEvent, context: ExtensionContext): Promise<void | Partial<TaskPreparedEvent>>;
|
|
1304
|
+
/**
|
|
1305
|
+
* Called when a task is initialized and ready for use
|
|
1306
|
+
* @returns void or partial event to modify task data
|
|
1307
|
+
*/
|
|
1308
|
+
onTaskInitialized?(event: TaskInitializedEvent, context: ExtensionContext): Promise<void | Partial<TaskInitializedEvent>>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Called when a task is closed
|
|
1311
|
+
* @returns void or partial event to modify task data
|
|
1312
|
+
*/
|
|
1313
|
+
onTaskClosed?(event: TaskClosedEvent, context: ExtensionContext): Promise<void | Partial<TaskClosedEvent>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Called before a task is updated and saved
|
|
1316
|
+
* Modify event.task to change the task data before it's persisted
|
|
1317
|
+
* @returns void or partial event to modify task data
|
|
1318
|
+
*/
|
|
1319
|
+
onTaskUpdated?(event: TaskUpdatedEvent, context: ExtensionContext): Promise<void | Partial<TaskUpdatedEvent>>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Called when a project is started
|
|
1322
|
+
* @returns void or partial event to modify project data
|
|
1323
|
+
*/
|
|
1324
|
+
onProjectStarted?(event: ProjectStartedEvent, context: ExtensionContext): Promise<void | Partial<ProjectStartedEvent>>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Called when a project is closed
|
|
1327
|
+
* @returns void or partial event to modify project data
|
|
1328
|
+
*/
|
|
1329
|
+
onProjectStopped?(event: ProjectStoppedEvent, context: ExtensionContext): Promise<void | Partial<ProjectStoppedEvent>>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Called when prompt processing starts
|
|
1332
|
+
* @returns void or partial event to modify
|
|
1333
|
+
*/
|
|
1334
|
+
onPromptStarted?(event: PromptStartedEvent, context: ExtensionContext): Promise<void | Partial<PromptStartedEvent>>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Called when prompt processing finishes
|
|
1337
|
+
* @returns void or partial event to modify
|
|
1338
|
+
*/
|
|
1339
|
+
onPromptFinished?(event: PromptFinishedEvent, context: ExtensionContext): Promise<void | Partial<PromptFinishedEvent>>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Called when a prompt template is rendered
|
|
1342
|
+
* Modify event.prompt to override the rendered prompt
|
|
1343
|
+
* @returns void or partial event to modify prompt
|
|
1344
|
+
*/
|
|
1345
|
+
onPromptTemplate?(event: PromptTemplateEvent, context: ExtensionContext): Promise<void | Partial<PromptTemplateEvent>>;
|
|
1346
|
+
/**
|
|
1347
|
+
* Called when agent mode starts
|
|
1348
|
+
* @returns void or partial event to modify prompt
|
|
1349
|
+
*/
|
|
1350
|
+
onAgentStarted?(event: AgentStartedEvent, context: ExtensionContext): Promise<void | Partial<AgentStartedEvent>>;
|
|
1351
|
+
/**
|
|
1352
|
+
* Called when agent mode finishes
|
|
1353
|
+
* @returns void or partial event to modify result messages
|
|
1354
|
+
*/
|
|
1355
|
+
onAgentFinished?(event: AgentFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentFinishedEvent>>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Called after each agent step completes
|
|
1358
|
+
* @returns void or partial event
|
|
1359
|
+
*/
|
|
1360
|
+
onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Called when messages are optimized before being sent to the LLM
|
|
1363
|
+
* Modify event.optimizedMessages to change the messages that will be sent
|
|
1364
|
+
* @returns void or partial event to modify optimized messages
|
|
1365
|
+
*/
|
|
1366
|
+
onOptimizeMessages?(event: OptimizeMessagesEvent, context: ExtensionContext): Promise<void | Partial<OptimizeMessagesEvent>>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Called when important reminders are being added to the user message
|
|
1369
|
+
* Modify event.remindersContent to change the reminders content
|
|
1370
|
+
* @returns void or partial event to modify reminders content
|
|
1371
|
+
*/
|
|
1372
|
+
onImportantReminders?(event: ImportantRemindersEvent, context: ExtensionContext): Promise<void | Partial<ImportantRemindersEvent>>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Called when a tool requires approval
|
|
1375
|
+
* Set event.blocked = true to prevent execution
|
|
1376
|
+
* @returns void or partial event to modify approval behavior
|
|
1377
|
+
*/
|
|
1378
|
+
onToolApproval?(event: ToolApprovalEvent, context: ExtensionContext): Promise<void | Partial<ToolApprovalEvent>>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Called when a tool is about to be executed
|
|
1381
|
+
* Set event.blocked = true to prevent execution
|
|
1382
|
+
* @returns void or partial event to modify tool call
|
|
1383
|
+
*/
|
|
1384
|
+
onToolCalled?(event: ToolCalledEvent, context: ExtensionContext): Promise<void | Partial<ToolCalledEvent>>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Called after tool execution completes
|
|
1387
|
+
* Use modifiedResult to change the result
|
|
1388
|
+
* @returns void or partial event to modify result
|
|
1389
|
+
*/
|
|
1390
|
+
onToolFinished?(event: ToolFinishedEvent, context: ExtensionContext): Promise<void | Partial<ToolFinishedEvent>>;
|
|
1391
|
+
/**
|
|
1392
|
+
* Called when files are added to context
|
|
1393
|
+
* Modify event.files to filter, add, or clear files (return empty array to prevent addition)
|
|
1394
|
+
* @returns void or partial event to modify files
|
|
1395
|
+
*/
|
|
1396
|
+
onFilesAdded?(event: FilesAddedEvent, context: ExtensionContext): Promise<void | Partial<FilesAddedEvent>>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Called when files are dropped into the chat
|
|
1399
|
+
* Modify event.files to filter, add, or clear files (return empty array to prevent addition)
|
|
1400
|
+
* @returns void or partial event to modify files
|
|
1401
|
+
*/
|
|
1402
|
+
onFilesDropped?(event: FilesDroppedEvent, context: ExtensionContext): Promise<void | Partial<FilesDroppedEvent>>;
|
|
1403
|
+
/**
|
|
1404
|
+
* Called when rule files are retrieved
|
|
1405
|
+
* Modify event.files to filter, add, or clear rule files
|
|
1406
|
+
* @returns void or partial event to modify files
|
|
1407
|
+
*/
|
|
1408
|
+
onRuleFilesRetrieved?(event: RuleFilesRetrievedEvent, context: ExtensionContext): Promise<void | Partial<RuleFilesRetrievedEvent>>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Called on each response chunk
|
|
1411
|
+
* @returns void or partial event to modify message
|
|
1412
|
+
*/
|
|
1413
|
+
onResponseChunk?(event: ResponseChunkEvent, context: ExtensionContext): Promise<void | Partial<ResponseChunkEvent>>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Called on response completion
|
|
1416
|
+
* @returns void or partial event to modify message
|
|
1417
|
+
*/
|
|
1418
|
+
onResponseCompleted?(event: ResponseCompletedEvent, context: ExtensionContext): Promise<void | Partial<ResponseCompletedEvent>>;
|
|
1419
|
+
/**
|
|
1420
|
+
* Called when handling user approval requests
|
|
1421
|
+
* Set event.blocked = true to prevent approval handling
|
|
1422
|
+
* @returns void or partial event to modify approval
|
|
1423
|
+
*/
|
|
1424
|
+
onHandleApproval?(event: HandleApprovalEvent, context: ExtensionContext): Promise<void | Partial<HandleApprovalEvent>>;
|
|
1425
|
+
/**
|
|
1426
|
+
* Called when a subagent starts
|
|
1427
|
+
* Set event.blocked = true to prevent subagent spawning
|
|
1428
|
+
* @returns void or partial event to modify prompt
|
|
1429
|
+
*/
|
|
1430
|
+
onSubagentStarted?(event: SubagentStartedEvent, context: ExtensionContext): Promise<void | Partial<SubagentStartedEvent>>;
|
|
1431
|
+
/**
|
|
1432
|
+
* Called when a subagent finishes
|
|
1433
|
+
* @returns void or partial event to modify result
|
|
1434
|
+
*/
|
|
1435
|
+
onSubagentFinished?(event: SubagentFinishedEvent, context: ExtensionContext): Promise<void | Partial<SubagentFinishedEvent>>;
|
|
1436
|
+
/**
|
|
1437
|
+
* Called when a question is asked to the user
|
|
1438
|
+
* @returns void or partial event to modify question
|
|
1439
|
+
*/
|
|
1440
|
+
onQuestionAsked?(event: QuestionAskedEvent, context: ExtensionContext): Promise<void | Partial<QuestionAskedEvent>>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Called when user answers a question
|
|
1443
|
+
* @returns void or partial event to modify answer
|
|
1444
|
+
*/
|
|
1445
|
+
onQuestionAnswered?(event: QuestionAnsweredEvent, context: ExtensionContext): Promise<void | Partial<QuestionAnsweredEvent>>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Called when a slash command is executed
|
|
1448
|
+
* @returns void or partial event to modify command
|
|
1449
|
+
*/
|
|
1450
|
+
onCommandExecuted?(event: CommandExecutedEvent, context: ExtensionContext): Promise<void | Partial<CommandExecutedEvent>>;
|
|
1451
|
+
/**
|
|
1452
|
+
* Called when a custom command is executed
|
|
1453
|
+
* Set event.blocked = true to prevent execution
|
|
1454
|
+
* Set event.prompt to override the processed template
|
|
1455
|
+
* @returns void or partial event to modify command execution
|
|
1456
|
+
*/
|
|
1457
|
+
onCustomCommandExecuted?(event: CustomCommandExecutedEvent, context: ExtensionContext): Promise<void | Partial<CustomCommandExecutedEvent>>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Called when Aider prompt starts (legacy event)
|
|
1460
|
+
* @returns void or partial event to modify prompt
|
|
1461
|
+
*/
|
|
1462
|
+
onAiderPromptStarted?(event: AiderPromptStartedEvent, context: ExtensionContext): Promise<void | Partial<AiderPromptStartedEvent>>;
|
|
1463
|
+
/**
|
|
1464
|
+
* Called when Aider prompt finishes (legacy event)
|
|
1465
|
+
* @returns void or partial event to modify responses
|
|
1466
|
+
*/
|
|
1467
|
+
onAiderPromptFinished?(event: AiderPromptFinishedEvent, context: ExtensionContext): Promise<void | Partial<AiderPromptFinishedEvent>>;
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Constructor type for extension classes
|
|
1471
|
+
*/
|
|
1472
|
+
export interface ExtensionConstructor {
|
|
1473
|
+
new (): Extension;
|
|
1474
|
+
metadata?: ExtensionMetadata;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
export {};
|