@aiderdesk/aiderdesk 0.73.0 → 0.75.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/out/{open-telemetry-baOvr6sK.js → open-telemetry-B7yROZIC.js} +3 -0
- package/out/renderer/assets/{AgentSettings-B8NFKgLb.js → AgentSettings-DX34HLFv.js} +4561 -3203
- package/out/renderer/assets/{InfoIcon-DhMP8XnB.js → InfoIcon-DzyZQ7Ye.js} +1 -1
- package/out/renderer/assets/{Onboarding-CmlEw4fh.js → Onboarding-FwXfKZ8B.js} +4 -4
- package/out/renderer/assets/{ProviderHeader-DMNcKpGs.js → ProviderHeader-Cii9aAmV.js} +418 -197
- package/out/renderer/assets/{SettingsPage-CmOR4wA1.js → SettingsPage-XanGltUZ.js} +13 -7
- package/out/renderer/assets/{UsageDashboard-BGAWd1b2.js → UsageDashboard-eHbvZTZC.js} +3795 -2366
- package/out/renderer/assets/{arc-Jg3VSYdu.js → arc-CVfdiTl1.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-3BPJPVTR-BhT1Ad0h.js → architectureDiagram-3BPJPVTR-DsLLo_Ek.js} +3 -3
- package/out/renderer/assets/{blockDiagram-GPEHLZMM-BZuMX6U_.js → blockDiagram-GPEHLZMM-eWy47S0_.js} +4 -4
- package/out/renderer/assets/{c4Diagram-AAUBKEIU-QL7T5rpZ.js → c4Diagram-AAUBKEIU-BH9b_e6y.js} +2 -2
- package/out/renderer/assets/{channel-K2W31OE5.js → channel-D1z_mPGJ.js} +1 -1
- package/out/renderer/assets/{chunk-2J33WTMH-LumY2cbE.js → chunk-2J33WTMH-DK0Yw_7f.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-GLhRzKG1.js → chunk-4BX2VUAB-DIGR8Y5b.js} +1 -1
- package/out/renderer/assets/{chunk-55IACEB6-B3B3AcnH.js → chunk-55IACEB6-DoCkLI5e.js} +1 -1
- package/out/renderer/assets/{chunk-727SXJPM-DMyZUEKf.js → chunk-727SXJPM-C2gQLzLi.js} +5 -5
- package/out/renderer/assets/{chunk-AQP2D5EJ-CQsD5TCd.js → chunk-AQP2D5EJ-D83_SlRR.js} +3 -3
- package/out/renderer/assets/{chunk-FMBD7UC4-x4SmU5Oe.js → chunk-FMBD7UC4-CyiPoUsC.js} +1 -1
- package/out/renderer/assets/{chunk-ND2GUHAM-pT6s9nFT.js → chunk-ND2GUHAM-DfGsUYDD.js} +1 -1
- package/out/renderer/assets/{chunk-QZHKN3VN-Cv8umQxL.js → chunk-QZHKN3VN-BhnTFlht.js} +1 -1
- package/out/renderer/assets/{classDiagram-4FO5ZUOK-DmOcXaER.js → classDiagram-4FO5ZUOK-Dy7E8tVe.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-DmOcXaER.js → classDiagram-v2-Q7XG4LA2-Dy7E8tVe.js} +6 -6
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-Bi6ESdxa.js → cose-bilkent-S5V4N54A-Dsl61WN3.js} +1 -1
- package/out/renderer/assets/{dagre-BM42HDAG-BK2slT53.js → dagre-BM42HDAG-D-u18G94.js} +3 -3
- package/out/renderer/assets/{diagram-2AECGRRQ-DkgLH6e2.js → diagram-2AECGRRQ-BumP49Qp.js} +3 -3
- package/out/renderer/assets/{diagram-5GNKFQAL-BwAieVd0.js → diagram-5GNKFQAL-VpUN87Sw.js} +4 -4
- package/out/renderer/assets/{diagram-KO2AKTUF-D6Km_LB9.js → diagram-KO2AKTUF-CXCWwzRa.js} +3 -3
- package/out/renderer/assets/{diagram-LMA3HP47-BhWSHEeO.js → diagram-LMA3HP47-vlOcStwn.js} +3 -3
- package/out/renderer/assets/{diagram-OG6HWLK6-zoN4RvNr.js → diagram-OG6HWLK6-DS1BscxN.js} +4 -4
- package/out/renderer/assets/{erDiagram-TEJ5UH35-DooZS_mc.js → erDiagram-TEJ5UH35-DPi6-CLL.js} +4 -4
- package/out/renderer/assets/{flowDiagram-I6XJVG4X-CmZPvaDJ.js → flowDiagram-I6XJVG4X-BYlX12Cd.js} +6 -6
- package/out/renderer/assets/{ganttDiagram-6RSMTGT7-Bx6OJzRM.js → ganttDiagram-6RSMTGT7-BJQl-A9d.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-BPUT8Ht7.js → gitGraphDiagram-PVQCEYII-CUFXx3IZ.js} +4 -4
- package/out/renderer/assets/{graph-CwC0h_b8.js → graph-CbFubTTc.js} +1 -1
- package/out/renderer/assets/{index-DOOlJc12.js → index-9GNr8q1O.js} +1 -1
- package/out/renderer/assets/{index-BSFaA4XQ.js → index-B6R_BNfE.js} +1 -1
- package/out/renderer/assets/{index-PGLvyST0.js → index-B9iW9QmT.js} +1 -1
- package/out/renderer/assets/{index-DqiktxfT.js → index-BkdacTnN.js} +1 -1
- package/out/renderer/assets/{index-ChKmR4QP.js → index-C7885gEz.js} +1 -1
- package/out/renderer/assets/{index-CXq4cCbe.js → index-Cg7tn967.js} +576 -251
- package/out/renderer/assets/{index-B3o44aT2.css → index-DCILJy4w.css} +50 -16
- package/out/renderer/assets/{index-CI0IUNzz.js → index-DNlMJMPg.js} +4194 -3241
- package/out/renderer/assets/{index-BrZFlbuf.js → index-DYKLRIHT.js} +1 -1
- package/out/renderer/assets/{index-Ds5GQdTm.js → index-DeoI6jti.js} +1 -1
- package/out/renderer/assets/{index-xI0MsLE8.js → index-fD843lMX.js} +1 -1
- package/out/renderer/assets/{infoDiagram-5YYISTIA-C77gIx1a.js → infoDiagram-5YYISTIA-IWJLFUYz.js} +2 -2
- package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-DZ8xk7_N.js → ishikawaDiagram-YF4QCWOH-BuNfm7cB.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-JHISSGLW-BLPdv_c5.js → journeyDiagram-JHISSGLW-CfceKUHO.js} +4 -4
- package/out/renderer/assets/{jsx-dev-runtime-1M6DZ35g.js → jsx-dev-runtime-DT3FTts0.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UN3LZRKU-CMHVN7c3.js → kanban-definition-UN3LZRKU-Bb6YnEgS.js} +2 -2
- package/out/renderer/assets/{layout-BJqshyQm.js → layout-BkrDn6V9.js} +2 -2
- package/out/renderer/assets/{linear-CbEhS1qE.js → linear-jxO_dc8P.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-RKZ34NQL-C8Cz7pQU.js → mindmap-definition-RKZ34NQL-BPRx7p9A.js} +3 -3
- package/out/renderer/assets/{pieDiagram-4H26LBE5-Bx5tSw6i.js → pieDiagram-4H26LBE5-CPR4AuPM.js} +4 -4
- package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-CX6DcDEk.js → quadrantDiagram-W4KKPZXB-BKzlAr7m.js} +2 -2
- package/out/renderer/assets/{requirementDiagram-4Y6WPE33-qBp8nKy9.js → requirementDiagram-4Y6WPE33-CUan3EZI.js} +3 -3
- package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-B5zYIsBo.js → sankeyDiagram-5OEKKPKP-y8X8qnX2.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-C57DtTdH.js → sequenceDiagram-3UESZ5HK-B4xv8iDW.js} +3 -3
- package/out/renderer/assets/{stateDiagram-AJRCARHV-CGRyr6CG.js → stateDiagram-AJRCARHV-DTPE2Z4L.js} +6 -6
- package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-3hvBe5lv.js → stateDiagram-v2-BHNVJYJU-BmZ9o6q3.js} +4 -4
- package/out/renderer/assets/{time-B3bXse3U.js → time-D391Z6zp.js} +1 -1
- package/out/renderer/assets/{timeline-definition-PNZ67QCA-Dpq0iPd0.js → timeline-definition-PNZ67QCA-DVLUB2HD.js} +2 -2
- package/out/renderer/assets/{vennDiagram-CIIHVFJN-_jSNuVb5.js → vennDiagram-CIIHVFJN-BGGBlVN1.js} +1 -1
- package/out/renderer/assets/{wardley-L42UT6IY-DixmVaQZ.js → wardley-L42UT6IY-ZVVSjQUD.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-DMK4zc32.js → wardleyDiagram-YWT4CUSO-CRAH-LRw.js} +3 -3
- package/out/renderer/assets/{xychartDiagram-2RQKCTM6-DKPuWmAF.js → xychartDiagram-2RQKCTM6-DQqvm7M3.js} +2 -2
- package/out/renderer/index.html +2 -2
- package/out/resources/linux/probe +0 -0
- package/out/resources/linux-x64/probe +0 -0
- package/out/resources/skills/agent-creator/SKILL.md +223 -0
- package/out/resources/skills/agent-creator/assets/examples/sample-profile.json +47 -0
- package/out/resources/skills/agent-creator/assets/templates/config.json.template +47 -0
- package/out/resources/skills/agent-creator/references/agent-profile-schema.md +294 -0
- package/out/resources/skills/agent-creator/references/profile-examples.md +490 -0
- package/out/resources/skills/agent-creator/references/subagent-guide.md +317 -0
- package/out/resources/skills/agent-creator/references/tool-approval-guide.md +484 -0
- package/out/resources/skills/extension-creator/SKILL.md +71 -7
- package/out/resources/skills/extension-creator/references/event-types.md +543 -40
- package/out/resources/skills/extension-creator/references/examples-gallery.md +23 -14
- package/out/resources/skills/extension-creator/references/extension-interface.md +1111 -171
- package/out/resources/skills/extension-creator/references/ui-components.md +34 -6
- package/out/runner.js +11164 -10392
- package/package.json +21 -19
- package/patches/@requesty+ai-sdk+3.5.0.patch +84 -0
- package/patches/ai+7.0.28.patch +33 -0
- package/patches/ai+5.0.195.patch +0 -33
|
@@ -1,116 +1,751 @@
|
|
|
1
1
|
# Extension Interface
|
|
2
2
|
|
|
3
|
-
Full TypeScript interface for AiderDesk extensions.
|
|
3
|
+
Full TypeScript interface reference for AiderDesk extensions. All methods are optional — implement only what you need.
|
|
4
|
+
|
|
5
|
+
> **IMPORTANT:** This is a comprehensive reference, but for the absolute latest types, always refer to the authoritative source: [extensions.ts on GitHub](https://raw.githubusercontent.com/hotovo/aider-desk/refs/heads/main/packages/common/src/extensions.ts). See also [context.ts](https://raw.githubusercontent.com/hotovo/aider-desk/refs/heads/main/packages/common/src/types/context.ts) for context message types and [common.ts](https://raw.githubusercontent.com/hotovo/aider-desk/refs/heads/main/packages/common/src/types/common.ts) for task/common types.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Extension Interface](#extension-interface)
|
|
12
|
+
- [ExtensionContext](#extensioncontext)
|
|
13
|
+
- [TaskContext](#taskcontext)
|
|
14
|
+
- [ProjectContext](#projectcontext)
|
|
15
|
+
- [MemoryContext](#memorycontext)
|
|
16
|
+
- [Supporting Types](#supporting-types)
|
|
17
|
+
|
|
18
|
+
---
|
|
4
19
|
|
|
5
20
|
## Extension Interface
|
|
6
21
|
|
|
22
|
+
The main interface all extensions implement. Every method is optional. Event handlers may return `void` or a partial event object to modify the event data.
|
|
23
|
+
|
|
24
|
+
### Lifecycle
|
|
25
|
+
|
|
7
26
|
```typescript
|
|
8
27
|
interface Extension {
|
|
9
|
-
|
|
10
|
-
onLoad?(context: ExtensionContext):
|
|
11
|
-
onUnload?(context: ExtensionContext): Promise<void> | void;
|
|
28
|
+
/** Called when extension is loaded. Use this to initialize state, set up resources, etc. */
|
|
29
|
+
onLoad?(context: ExtensionContext): void | Promise<void>;
|
|
12
30
|
|
|
13
|
-
|
|
14
|
-
|
|
31
|
+
/** Called when extension is unloaded. Clean up resources, save state, etc. */
|
|
32
|
+
onUnload?(): void | Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Registration
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
interface Extension {
|
|
40
|
+
/** Return array of tools this extension provides. Called on load and when tools need refresh. */
|
|
15
41
|
getTools?(context: ExtensionContext, mode: string, agentProfile: AgentProfile): ToolDefinition[];
|
|
16
|
-
|
|
42
|
+
|
|
43
|
+
/** Return array of commands this extension provides. */
|
|
44
|
+
getCommands?(context: ExtensionContext): CommandDefinition[];
|
|
45
|
+
|
|
46
|
+
/** Return array of modes this extension provides. */
|
|
17
47
|
getModes?(context: ExtensionContext): ModeDefinition[];
|
|
48
|
+
|
|
49
|
+
/** Return array of agent profiles this extension provides. */
|
|
50
|
+
getAgents?(context: ExtensionContext): AgentProfile[];
|
|
51
|
+
|
|
52
|
+
/** Return array of LLM providers this extension provides. Providers appear as read-only in the UI — the extension owns the config. */
|
|
53
|
+
getProviders?(context: ExtensionContext): ProviderDefinition[];
|
|
54
|
+
|
|
55
|
+
/** Return array of skills this extension provides. Each skill must have name, description, location, and dirPath. */
|
|
56
|
+
getSkills?(context: ExtensionContext): SkillDefinition[];
|
|
57
|
+
|
|
58
|
+
/** Return array of React UI components this extension provides (as JSX strings). */
|
|
18
59
|
getUIComponents?(context: ExtensionContext): UIComponentDefinition[];
|
|
60
|
+
|
|
61
|
+
/** Return list of npm packages that extension UI components need (resolved via esm.sh). Keys become `props.libraries.<key>`. */
|
|
19
62
|
getUIComponentsLibraries?(): Record<string, string>;
|
|
20
|
-
|
|
21
|
-
|
|
63
|
+
|
|
64
|
+
/** Return data for a specific UI component. Called on mount or when UI refresh is triggered. */
|
|
22
65
|
getUIExtensionData?(componentId: string, context: ExtensionContext): Promise<unknown>;
|
|
66
|
+
|
|
67
|
+
/** Handle an action triggered from a UI component via executeExtensionAction. */
|
|
23
68
|
executeUIExtensionAction?(componentId: string, action: string, args: unknown[], context: ExtensionContext): Promise<unknown>;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
24
71
|
|
|
25
|
-
|
|
72
|
+
### Settings Config
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
interface Extension {
|
|
76
|
+
/** Return this extension's settings/config UI component as a JSX string. Receives `{ config, updateConfig }` props. */
|
|
26
77
|
getConfigComponent?(context: ExtensionContext): string | undefined;
|
|
78
|
+
|
|
79
|
+
/** Return the current configuration data for this extension's settings. */
|
|
27
80
|
getConfigData?(context: ExtensionContext): Promise<unknown>;
|
|
81
|
+
|
|
82
|
+
/** Save configuration data for this extension's settings. Called when user clicks Save. */
|
|
28
83
|
saveConfigData?(configData: unknown, context: ExtensionContext): Promise<unknown>;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Profile Updates
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
interface Extension {
|
|
91
|
+
/** Called when a user updates an extension-provided agent profile. Extension should persist the updated profile. */
|
|
92
|
+
onAgentProfileUpdated?(context: ExtensionContext, agentId: string, updatedProfile: AgentProfile): Promise<AgentProfile>;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
29
95
|
|
|
30
|
-
|
|
96
|
+
### Task Events
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
interface Extension {
|
|
100
|
+
/** Called when a new task is created. Return partial event to modify task data. */
|
|
31
101
|
onTaskCreated?(event: TaskCreatedEvent, context: ExtensionContext): Promise<void | Partial<TaskCreatedEvent>>;
|
|
32
|
-
onTaskInitialized?(event: TaskInitializedEvent, context: ExtensionContext): Promise<void>;
|
|
33
|
-
onTaskClosed?(event: TaskClosedEvent, context: ExtensionContext): Promise<void>;
|
|
34
102
|
|
|
35
|
-
|
|
103
|
+
/** Called when a task is prepared (both new and loaded tasks). */
|
|
104
|
+
onTaskPrepared?(event: TaskPreparedEvent, context: ExtensionContext): Promise<void | Partial<TaskPreparedEvent>>;
|
|
105
|
+
|
|
106
|
+
/** Called when a task is initialized and ready for use. */
|
|
107
|
+
onTaskInitialized?(event: TaskInitializedEvent, context: ExtensionContext): Promise<void | Partial<TaskInitializedEvent>>;
|
|
108
|
+
|
|
109
|
+
/** Called when a task is closed. */
|
|
110
|
+
onTaskClosed?(event: TaskClosedEvent, context: ExtensionContext): Promise<void | Partial<TaskClosedEvent>>;
|
|
111
|
+
|
|
112
|
+
/** Called before a task is updated and saved. Modify `event.task` to change the task data before it's persisted. */
|
|
113
|
+
onTaskUpdated?(event: TaskUpdatedEvent, context: ExtensionContext): Promise<void | Partial<TaskUpdatedEvent>>;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Project Events
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
interface Extension {
|
|
121
|
+
/** Called when a project is started. */
|
|
122
|
+
onProjectStarted?(event: ProjectStartedEvent, context: ExtensionContext): Promise<void | Partial<ProjectStartedEvent>>;
|
|
123
|
+
|
|
124
|
+
/** Called when a project is closed/stopped. */
|
|
125
|
+
onProjectStopped?(event: ProjectStoppedEvent, context: ExtensionContext): Promise<void | Partial<ProjectStoppedEvent>>;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Prompt Events
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
interface Extension {
|
|
133
|
+
/** Called when prompt processing starts. */
|
|
134
|
+
onPromptStarted?(event: PromptStartedEvent, context: ExtensionContext): Promise<void | Partial<PromptStartedEvent>>;
|
|
135
|
+
|
|
136
|
+
/** Called when prompt processing finishes. */
|
|
137
|
+
onPromptFinished?(event: PromptFinishedEvent, context: ExtensionContext): Promise<void | Partial<PromptFinishedEvent>>;
|
|
138
|
+
|
|
139
|
+
/** Called when a prompt template is rendered. Modify `event.prompt` to override the rendered prompt. */
|
|
140
|
+
onPromptTemplate?(event: PromptTemplateEvent, context: ExtensionContext): Promise<void | Partial<PromptTemplateEvent>>;
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Agent Events
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
interface Extension {
|
|
148
|
+
/** Called when agent mode starts. */
|
|
36
149
|
onAgentStarted?(event: AgentStartedEvent, context: ExtensionContext): Promise<void | Partial<AgentStartedEvent>>;
|
|
150
|
+
|
|
151
|
+
/** Called when agent mode finishes. */
|
|
37
152
|
onAgentFinished?(event: AgentFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentFinishedEvent>>;
|
|
153
|
+
|
|
154
|
+
/** Called before each agent step starts. Modify `event.messages` to change messages sent to the LLM. */
|
|
155
|
+
onAgentStepStarted?(event: AgentStepStartedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepStartedEvent>>;
|
|
156
|
+
|
|
157
|
+
/** Called after each agent step completes. */
|
|
38
158
|
onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
|
|
39
|
-
onAgentProfileUpdated?(context: ExtensionContext, agentId: string, updatedProfile: AgentProfile): Promise<AgentProfile>;
|
|
40
159
|
|
|
41
|
-
|
|
160
|
+
/** Called when messages are optimized before being sent to the LLM. Modify `event.optimizedMessages` to change what's sent. */
|
|
161
|
+
onOptimizeMessages?(event: OptimizeMessagesEvent, context: ExtensionContext): Promise<void | Partial<OptimizeMessagesEvent>>;
|
|
162
|
+
|
|
163
|
+
/** Called when important reminders are added to the user message. Modify `event.remindersContent`. */
|
|
164
|
+
onImportantReminders?(event: ImportantRemindersEvent, context: ExtensionContext): Promise<void | Partial<ImportantRemindersEvent>>;
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Interrupt Events
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
interface Extension {
|
|
172
|
+
/** Called when a response is interrupted (e.g., user clicks Stop). Set `event.blocked = true` to skip default interrupt cleanup. */
|
|
173
|
+
onInterrupted?(event: InterruptedEvent, context: ExtensionContext): Promise<void | Partial<InterruptedEvent>>;
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Tool Events
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
interface Extension {
|
|
181
|
+
/** Called when a tool requires approval. Set `event.blocked = true` (or a reason string) to prevent execution. */
|
|
42
182
|
onToolApproval?(event: ToolApprovalEvent, context: ExtensionContext): Promise<void | Partial<ToolApprovalEvent>>;
|
|
183
|
+
|
|
184
|
+
/** Called when a tool is about to be executed. */
|
|
43
185
|
onToolCalled?(event: ToolCalledEvent, context: ExtensionContext): Promise<void | Partial<ToolCalledEvent>>;
|
|
186
|
+
|
|
187
|
+
/** Called after tool execution completes. */
|
|
44
188
|
onToolFinished?(event: ToolFinishedEvent, context: ExtensionContext): Promise<void | Partial<ToolFinishedEvent>>;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### File Events
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
interface Extension {
|
|
196
|
+
/** Called when files are added to context. Modify `event.files` to filter, add, or clear files. Return empty array to prevent addition. */
|
|
197
|
+
onFilesAdded?(event: FilesAddedEvent, context: ExtensionContext): Promise<void | Partial<FilesAddedEvent>>;
|
|
45
198
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onFileDropped?(event: FileDroppedEvent, context: ExtensionContext): Promise<void>;
|
|
199
|
+
/** Called when files are dropped into the chat. Modify `event.files` to filter, add, or clear files. */
|
|
200
|
+
onFilesDropped?(event: FilesDroppedEvent, context: ExtensionContext): Promise<void | Partial<FilesDroppedEvent>>;
|
|
49
201
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
202
|
+
/** Called when rule files are retrieved. Modify `event.files` to filter, add, or clear rule files. */
|
|
203
|
+
onRuleFilesRetrieved?(event: RuleFilesRetrievedEvent, context: ExtensionContext): Promise<void | Partial<RuleFilesRetrievedEvent>>;
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Message Events
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
interface Extension {
|
|
211
|
+
/** Called on each response chunk. */
|
|
212
|
+
onResponseChunk?(event: ResponseChunkEvent, context: ExtensionContext): Promise<void | Partial<ResponseChunkEvent>>;
|
|
213
|
+
|
|
214
|
+
/** Called on response completion. */
|
|
215
|
+
onResponseCompleted?(event: ResponseCompletedEvent, context: ExtensionContext): Promise<void | Partial<ResponseCompletedEvent>>;
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Approval Events
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
interface Extension {
|
|
223
|
+
/** Called when handling user approval requests. Set `event.blocked = true` to prevent approval handling. */
|
|
224
|
+
onHandleApproval?(event: HandleApprovalEvent, context: ExtensionContext): Promise<void | Partial<HandleApprovalEvent>>;
|
|
225
|
+
}
|
|
226
|
+
```
|
|
54
227
|
|
|
55
|
-
|
|
56
|
-
onResponseMessageProcessed?(event: ResponseMessageProcessedEvent, context: ExtensionContext): Promise<void | Partial<ResponseMessageProcessedEvent>>;
|
|
228
|
+
### Subagent Events
|
|
57
229
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
230
|
+
```typescript
|
|
231
|
+
interface Extension {
|
|
232
|
+
/** Called when a subagent starts. Set `event.blocked = true` to prevent subagent spawning. */
|
|
61
233
|
onSubagentStarted?(event: SubagentStartedEvent, context: ExtensionContext): Promise<void | Partial<SubagentStartedEvent>>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
234
|
+
|
|
235
|
+
/** Called when a subagent finishes. */
|
|
236
|
+
onSubagentFinished?(event: SubagentFinishedEvent, context: ExtensionContext): Promise<void | Partial<SubagentFinishedEvent>>;
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Question Events
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
interface Extension {
|
|
244
|
+
/** Called when a question is asked to the user. Event includes optional `storedAnswer` when a cached/auto answer exists. */
|
|
245
|
+
onQuestionAsked?(event: QuestionAskedEvent, context: ExtensionContext): Promise<void | Partial<QuestionAskedEvent>>;
|
|
246
|
+
|
|
247
|
+
/** Called when user answers a question. */
|
|
248
|
+
onQuestionAnswered?(event: QuestionAnsweredEvent, context: ExtensionContext): Promise<void | Partial<QuestionAnsweredEvent>>;
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Command Events
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
interface Extension {
|
|
256
|
+
/** Called when a slash command is executed. */
|
|
257
|
+
onCommandExecuted?(event: CommandExecutedEvent, context: ExtensionContext): Promise<void | Partial<CommandExecutedEvent>>;
|
|
258
|
+
|
|
259
|
+
/** Called when a custom command is executed. Set `event.blocked = true` to prevent execution, `event.prompt` to override template. */
|
|
260
|
+
onCustomCommandExecuted?(event: CustomCommandExecutedEvent, context: ExtensionContext): Promise<void | Partial<CustomCommandExecutedEvent>>;
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Aider Events (Legacy)
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
interface Extension {
|
|
268
|
+
/** Called when Aider prompt starts (legacy event). */
|
|
269
|
+
onAiderPromptStarted?(event: AiderPromptStartedEvent, context: ExtensionContext): Promise<void | Partial<AiderPromptStartedEvent>>;
|
|
270
|
+
|
|
271
|
+
/** Called when Aider prompt finishes (legacy event). */
|
|
272
|
+
onAiderPromptFinished?(event: AiderPromptFinishedEvent, context: ExtensionContext): Promise<void | Partial<AiderPromptFinishedEvent>>;
|
|
66
273
|
}
|
|
67
274
|
```
|
|
68
275
|
|
|
276
|
+
### Commit Events
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
interface Extension {
|
|
280
|
+
/** Called before changes are committed. Modify `event.message` and `event.amend`, or set `event.blocked = true` to prevent the commit. */
|
|
281
|
+
onBeforeCommit?(event: BeforeCommitEvent, context: ExtensionContext): Promise<void | Partial<BeforeCommitEvent>>;
|
|
282
|
+
|
|
283
|
+
/** Called after changes are committed (read-only event). */
|
|
284
|
+
onAfterCommit?(event: AfterCommitEvent, context: ExtensionContext): Promise<void>;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
69
290
|
## ExtensionContext
|
|
70
291
|
|
|
292
|
+
Context object passed to extension methods, providing access to AiderDesk APIs.
|
|
293
|
+
|
|
294
|
+
> **Context Availability:**
|
|
295
|
+
> - **Global context** (e.g., `onLoad` without project, `getAgents`, `getConfigComponent`): project and task are not available. `getProjectDir()` returns empty string, `getTaskContext()` returns null, and `getProjectContext()` throws.
|
|
296
|
+
> - **Project context** (e.g., event handlers, `getTools`, `getCommands`): project is available but task may not be.
|
|
297
|
+
> - **Task context** (e.g., task-specific event handlers, command execution): both project and task are available.
|
|
298
|
+
|
|
71
299
|
```typescript
|
|
72
300
|
interface ExtensionContext {
|
|
73
|
-
|
|
74
|
-
log(message: string, type
|
|
301
|
+
/** Log a message prefixed with the extension name. Type defaults to 'info'. */
|
|
302
|
+
log(message: string, type?: 'info' | 'error' | 'warn' | 'debug'): void;
|
|
75
303
|
|
|
76
|
-
|
|
304
|
+
/** Get the current project directory path. Returns empty string when no project is available. */
|
|
77
305
|
getProjectDir(): string;
|
|
306
|
+
|
|
307
|
+
/** Get the task context for the current task. Returns null when no task is available. */
|
|
78
308
|
getTaskContext(): TaskContext | null;
|
|
309
|
+
|
|
310
|
+
/** Get the project context for safe project-level operations. Throws if no project is available. */
|
|
79
311
|
getProjectContext(): ProjectContext;
|
|
80
312
|
|
|
81
|
-
|
|
82
|
-
|
|
313
|
+
/** Get all available model configurations from all enabled providers. */
|
|
314
|
+
getModelConfigs(): Promise<Model[]>;
|
|
83
315
|
|
|
84
|
-
|
|
316
|
+
/** Get a specific setting value from global settings using dot-notation (e.g., 'general.theme'). */
|
|
85
317
|
getSetting(key: string): Promise<unknown>;
|
|
86
|
-
updateSettings(updates: Record<string, unknown>): Promise<void>;
|
|
87
318
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
319
|
+
/** Update global settings by merging the provided partial updates. */
|
|
320
|
+
updateSettings(updates: Partial<SettingsData>): Promise<void>;
|
|
321
|
+
|
|
322
|
+
/** Trigger a data refresh for UI components. Optionally target a specific component and/or task. */
|
|
92
323
|
triggerUIDataRefresh(componentId?: string, taskId?: string): void;
|
|
324
|
+
|
|
325
|
+
/** Trigger a full reload of all UI component definitions for this extension. */
|
|
93
326
|
triggerUIComponentsReload(): void;
|
|
94
|
-
|
|
95
|
-
|
|
327
|
+
|
|
328
|
+
/** Open a URL. Target: 'external' (system browser), 'window' (new Electron window), or 'modal-overlay' (iframe in modal). */
|
|
96
329
|
openUrl(url: string, target?: 'external' | 'window' | 'modal-overlay'): Promise<void>;
|
|
330
|
+
|
|
331
|
+
/** Open a file or directory in the system's default application. Returns true if opened successfully. */
|
|
97
332
|
openPath(path: string): Promise<boolean>;
|
|
333
|
+
|
|
334
|
+
/** Get a narrowed Electron App object (e.g., for getAppMetrics CPU/memory stats). Returns null when not running in Electron. */
|
|
335
|
+
getElectronApp(): Promise<ElectronApp | null>;
|
|
336
|
+
|
|
337
|
+
/** Get the memory context for vector store operations (store, retrieve, update, delete memories). */
|
|
338
|
+
getMemoryContext(): MemoryContext;
|
|
339
|
+
|
|
340
|
+
/** Truncate a tool result string that exceeds size limits (lines, bytes, tokens). Saves full content to a temp file by default. */
|
|
341
|
+
truncateToolResult(
|
|
342
|
+
content: string,
|
|
343
|
+
maxLines?: number,
|
|
344
|
+
maxSizeKB?: number,
|
|
345
|
+
maxTokens?: number,
|
|
346
|
+
saveToFile?: boolean,
|
|
347
|
+
truncationSuffix?: string,
|
|
348
|
+
): Promise<string>;
|
|
98
349
|
}
|
|
99
350
|
```
|
|
100
351
|
|
|
352
|
+
### ElectronApp and Related Types
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
/** Narrow subset of Electron's App object exposed to extensions. */
|
|
356
|
+
interface ElectronApp {
|
|
357
|
+
/** Returns process metrics (memory + CPU usage) for all app processes. Memory is in KB. */
|
|
358
|
+
getAppMetrics(): ElectronProcessMetric[];
|
|
359
|
+
/** Current application version. */
|
|
360
|
+
getVersion(): string;
|
|
361
|
+
/** Current application name. */
|
|
362
|
+
getName(): string;
|
|
363
|
+
/** True when the application has finished initializing. */
|
|
364
|
+
isReady(): boolean;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
interface ElectronCPUUsage {
|
|
368
|
+
/** Percentage of CPU used since last call (0–100). */
|
|
369
|
+
percentCPUUsage?: number;
|
|
370
|
+
/** Cumulative CPU time in seconds since process start. */
|
|
371
|
+
cumulativeCPUUsage?: number;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
interface ElectronMemoryInfo {
|
|
375
|
+
/** Working set size in KB. */
|
|
376
|
+
workingSetSize?: number;
|
|
377
|
+
/** Peak working set size in KB. */
|
|
378
|
+
peakWorkingSetSize?: number;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
interface ElectronProcessMetric {
|
|
382
|
+
pid?: number;
|
|
383
|
+
/** One of: Browser, Renderer, GPU, Utility, etc. */
|
|
384
|
+
type?: string;
|
|
385
|
+
serviceName?: string;
|
|
386
|
+
name?: string;
|
|
387
|
+
cpu?: ElectronCPUUsage;
|
|
388
|
+
memory?: ElectronMemoryInfo;
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## TaskContext
|
|
395
|
+
|
|
396
|
+
Safe subset of Task capabilities exposed to extensions. Provides read-only access to task data and safe write operations.
|
|
397
|
+
|
|
398
|
+
### Task Data
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
interface TaskContext {
|
|
402
|
+
/** Read-only snapshot of the current task state (id, name, status, mode, all persisted fields). */
|
|
403
|
+
readonly data: TaskData;
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Context Files (Read + Safe Write)
|
|
408
|
+
|
|
409
|
+
```typescript
|
|
410
|
+
interface TaskContext {
|
|
411
|
+
/** Get the list of files currently in the task's context. */
|
|
412
|
+
getContextFiles(): Promise<ContextFile[]>;
|
|
413
|
+
|
|
414
|
+
/** Add a single file to the task's context by path. Dispatches `onFilesAdded` event before adding. */
|
|
415
|
+
addFile(path: string, readOnly?: boolean): Promise<void>;
|
|
416
|
+
|
|
417
|
+
/** Add multiple files to the task's context at once. Dispatches `onFilesAdded` for each file. */
|
|
418
|
+
addFiles(...files: ContextFile[]): Promise<void>;
|
|
419
|
+
|
|
420
|
+
/** Remove a file from the task's context by path. Dispatches `onFilesDropped` event before removing. */
|
|
421
|
+
dropFile(path: string): Promise<void>;
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Context Messages (Read + Safe Write)
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
interface TaskContext {
|
|
429
|
+
/** Get the full conversation history from the task's context manager. */
|
|
430
|
+
getContextMessages(): Promise<ContextMessage[]>;
|
|
431
|
+
|
|
432
|
+
/** Append a message to the context messages. Auto-saves to disk. */
|
|
433
|
+
addContextMessage(message: ContextMessage, updateContextInfo?: boolean): Promise<void>;
|
|
434
|
+
|
|
435
|
+
/** Remove a specific message from the context by its ID. */
|
|
436
|
+
removeMessage(messageId: string): Promise<void>;
|
|
437
|
+
|
|
438
|
+
/** Remove the most recent message from the context. */
|
|
439
|
+
removeLastMessage(): Promise<void>;
|
|
440
|
+
|
|
441
|
+
/** Remove a message and all messages after it (inclusive). */
|
|
442
|
+
removeMessagesUpTo(messageId: string): Promise<void>;
|
|
443
|
+
|
|
444
|
+
/** Load a set of messages, replacing the current in-memory messages. Used for loading pre-authored context. */
|
|
445
|
+
loadContextMessages(messages: ContextMessage[]): Promise<void>;
|
|
446
|
+
|
|
447
|
+
/** Re-execute a user prompt at a specific message ID, optionally with a different mode or edited text. */
|
|
448
|
+
redoUserPrompt(messageId: string, mode?: string, updatedPrompt?: string): Promise<void>;
|
|
449
|
+
|
|
450
|
+
/** Re-execute the last user prompt. Convenience method that finds the last user message and calls redoUserPrompt. */
|
|
451
|
+
redoLastUserPrompt(mode?: string, updatedPrompt?: string): Promise<void>;
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### UI Messages
|
|
456
|
+
|
|
457
|
+
```typescript
|
|
458
|
+
interface TaskContext {
|
|
459
|
+
/** Send a user message to the UI for display. Does NOT add to context or persist. */
|
|
460
|
+
addUserMessage(id: string, content: string, promptContext?: PromptContext): void;
|
|
461
|
+
|
|
462
|
+
/** Send a tool execution message to the UI. Optionally persists via data manager. */
|
|
463
|
+
addToolMessage(
|
|
464
|
+
id: string,
|
|
465
|
+
serverName: string,
|
|
466
|
+
toolName: string,
|
|
467
|
+
input?: unknown,
|
|
468
|
+
response?: string,
|
|
469
|
+
usageReport?: UsageReportData,
|
|
470
|
+
promptContext?: PromptContext,
|
|
471
|
+
saveToDb?: boolean,
|
|
472
|
+
finished?: boolean,
|
|
473
|
+
): void;
|
|
474
|
+
|
|
475
|
+
/** Process a response message — streams chunks to UI, sends completed response when finished. Dispatches `onResponseChunk` and `onResponseCompleted`. */
|
|
476
|
+
addResponseMessage(message: ResponseMessage, saveToDb?: boolean): Promise<void>;
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Files & Repo (Read-only)
|
|
481
|
+
|
|
482
|
+
```typescript
|
|
483
|
+
interface TaskContext {
|
|
484
|
+
/** Get the working directory for this task (worktree path or project base directory). */
|
|
485
|
+
getTaskDir(): string;
|
|
486
|
+
|
|
487
|
+
/** Get files that can be added to context (not already in context), optionally filtered by regex. */
|
|
488
|
+
getAddableFiles(searchRegex?: string): Promise<string[]>;
|
|
489
|
+
|
|
490
|
+
/** Get all files in the task directory, optionally filtered by git tracking. */
|
|
491
|
+
getAllFiles(useGit?: boolean): Promise<string[]>;
|
|
492
|
+
|
|
493
|
+
/** Get files modified during the current task's execution (compares against main branch). */
|
|
494
|
+
getUpdatedFiles(): Promise<UpdatedFile[]>;
|
|
495
|
+
|
|
496
|
+
/** Get the cached repository map string summarizing the codebase structure. */
|
|
497
|
+
getRepoMap(): string;
|
|
498
|
+
|
|
499
|
+
/** Stage a file in git (equivalent to `git add`). No-op if not a git repo. */
|
|
500
|
+
addToGit(path: string): Promise<void>;
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Todos
|
|
505
|
+
|
|
506
|
+
```typescript
|
|
507
|
+
interface TaskContext {
|
|
508
|
+
/** Get all todo items for this task. */
|
|
509
|
+
getTodos(): Promise<TodoItem[]>;
|
|
510
|
+
|
|
511
|
+
/** Create a new uncompleted todo item. Returns updated array of all todos. */
|
|
512
|
+
addTodo(name: string): Promise<TodoItem[]>;
|
|
513
|
+
|
|
514
|
+
/** Update an existing todo item's properties (e.g., `{ completed: true }`). Returns updated array. */
|
|
515
|
+
updateTodo(name: string, updates: Partial<TodoItem>): Promise<TodoItem[]>;
|
|
516
|
+
|
|
517
|
+
/** Remove a todo item by name. Returns updated array. */
|
|
518
|
+
deleteTodo(name: string): Promise<TodoItem[]>;
|
|
519
|
+
|
|
520
|
+
/** Remove all todo items. Returns empty array. */
|
|
521
|
+
clearAllTodos(): Promise<TodoItem[]>;
|
|
522
|
+
|
|
523
|
+
/** Replace the entire todo list with the provided items. */
|
|
524
|
+
setTodos(items: TodoItem[], initialUserPrompt?: string): Promise<void>;
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Execution
|
|
529
|
+
|
|
530
|
+
```typescript
|
|
531
|
+
interface TaskContext {
|
|
532
|
+
/** Submit a prompt for processing. If a prompt is running, the new one is queued. */
|
|
533
|
+
runPrompt(prompt: string, mode?: string): Promise<void>;
|
|
534
|
+
|
|
535
|
+
/** Execute a prompt directly using a specific agent profile. Returns array of response completion data. */
|
|
536
|
+
runPromptInAgent(
|
|
537
|
+
profile: AgentProfile,
|
|
538
|
+
mode: string,
|
|
539
|
+
prompt: string | null,
|
|
540
|
+
promptContext?: PromptContext,
|
|
541
|
+
contextMessages?: ContextMessage[],
|
|
542
|
+
contextFiles?: ContextFile[],
|
|
543
|
+
systemPrompt?: string,
|
|
544
|
+
waitForCurrentAgentToFinish?: boolean,
|
|
545
|
+
sendNotification?: boolean,
|
|
546
|
+
): Promise<ResponseCompletedData[]>;
|
|
547
|
+
|
|
548
|
+
/** Execute a registered custom command by name. */
|
|
549
|
+
runCustomCommand(name: string, args?: string[], mode?: string): Promise<void>;
|
|
550
|
+
|
|
551
|
+
/** Spawn a subagent with the given profile and prompt. Dispatches `onSubagentStarted` and `onSubagentFinished`. */
|
|
552
|
+
runSubagent(agentProfile: AgentProfile, prompt: string): Promise<void>;
|
|
553
|
+
|
|
554
|
+
/** Execute a slash command in the task's context. Dispatches `onCommandExecuted`. */
|
|
555
|
+
runCommand(command: string): Promise<void>;
|
|
556
|
+
|
|
557
|
+
/** Interrupt the currently running agent response or subagent. */
|
|
558
|
+
interruptResponse(): Promise<void>;
|
|
559
|
+
|
|
560
|
+
/** Generate text using a specific model without running the full agent loop. */
|
|
561
|
+
generateText(modelId: string, systemPrompt: string, prompt: string): Promise<string | undefined>;
|
|
562
|
+
|
|
563
|
+
/** Generate a structured object using a specific model and Zod schema, without running the full agent loop. */
|
|
564
|
+
generateObject<T>(modelId: string, systemPrompt: string, prompt: string, schema: z.ZodType<T>): Promise<T | undefined>;
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### User Interaction
|
|
569
|
+
|
|
570
|
+
```typescript
|
|
571
|
+
interface TaskContext {
|
|
572
|
+
/** Ask the user a question and wait for their response. Supports answer choices via QuestionOptions. */
|
|
573
|
+
askQuestion(text: string, options?: QuestionOptions): Promise<string>;
|
|
574
|
+
|
|
575
|
+
/** Send a log message to the UI (appears in the task's message stream). */
|
|
576
|
+
addLogMessage(level: 'info' | 'error' | 'warning', message?: string): void;
|
|
577
|
+
|
|
578
|
+
/** Show or update a loading indicator in the task's UI. Pass `finished: true` to dismiss. */
|
|
579
|
+
addLoadingMessage(message?: string, finished?: boolean): void;
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
### Task Management
|
|
584
|
+
|
|
585
|
+
```typescript
|
|
586
|
+
interface TaskContext {
|
|
587
|
+
/** Update the task's data with partial changes and persist them. */
|
|
588
|
+
updateTask(updates: Partial<TaskData>): Promise<TaskData>;
|
|
589
|
+
|
|
590
|
+
/** Generate a handoff summary and optionally execute a follow-up prompt. */
|
|
591
|
+
handoffConversation(focus?: string, execute?: boolean): Promise<void>;
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
### Context Management
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
interface TaskContext {
|
|
599
|
+
/** Clear the task's conversation context (messages, connectors, UI). */
|
|
600
|
+
clearContext(): Promise<void>;
|
|
601
|
+
|
|
602
|
+
/** Reset the task context by clearing both context files and messages, then saving to disk. */
|
|
603
|
+
resetContext(): Promise<void>;
|
|
604
|
+
|
|
605
|
+
/** Compact the conversation by summarizing history via a compact-conversation agent. */
|
|
606
|
+
compactConversation(instructions?: string): Promise<void>;
|
|
607
|
+
|
|
608
|
+
/** Generate a markdown representation of the context messages. */
|
|
609
|
+
generateContextMarkdown(): Promise<string | null>;
|
|
610
|
+
|
|
611
|
+
/** Check whether the task has been fully initialized and is ready for use. */
|
|
612
|
+
isInitialized(): boolean;
|
|
613
|
+
|
|
614
|
+
/** Update the autocompletion data sent to the UI. */
|
|
615
|
+
updateAutocompletionWords(words?: string[]): Promise<void>;
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
### Queued Prompts
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
interface TaskContext {
|
|
623
|
+
/** Get all prompts currently queued for execution. */
|
|
624
|
+
getQueuedPrompts(): QueuedPromptData[];
|
|
625
|
+
|
|
626
|
+
/** Immediately execute a queued prompt by moving it to the front and interrupting the current response. */
|
|
627
|
+
sendQueuedPromptNow(promptId: string): Promise<void>;
|
|
628
|
+
|
|
629
|
+
/** Remove a prompt from the execution queue without running it. */
|
|
630
|
+
removeQueuedPrompt(promptId: string): void;
|
|
631
|
+
|
|
632
|
+
/** Reorder the queued prompts to a specific arrangement. */
|
|
633
|
+
reorderQueuedPrompts(prompts: QueuedPromptData[]): void;
|
|
634
|
+
|
|
635
|
+
/** Edit the text content of an existing queued prompt. */
|
|
636
|
+
editQueuedPrompt(promptId: string, newText: string): void;
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### Advanced
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
interface TaskContext {
|
|
644
|
+
/** Get the agent profile assigned to this task (checks task-level, then project-level). Returns null if none configured. */
|
|
645
|
+
getTaskAgentProfile(): Promise<AgentProfile | null>;
|
|
646
|
+
|
|
647
|
+
/** Programmatically answer a pending question. Returns true if a question was answered, false if none pending. */
|
|
648
|
+
answerQuestion(answer: string, userInput?: string): Promise<boolean>;
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### Working Mode & Worktrees
|
|
653
|
+
|
|
654
|
+
```typescript
|
|
655
|
+
interface TaskContext {
|
|
656
|
+
/** Switch the task to worktree working mode, optionally carrying over uncommitted changes. */
|
|
657
|
+
switchToWorktreeWorkingMode(options?: SwitchToWorktreeOptions): Promise<void>;
|
|
658
|
+
|
|
659
|
+
/** Switch the task to local working mode, optionally merging the worktree branch first. */
|
|
660
|
+
switchToLocalWorkingMode(options?: SwitchToLocalOptions): Promise<void>;
|
|
661
|
+
|
|
662
|
+
/** Get uncommitted files from the project's main repository (not from a worktree). */
|
|
663
|
+
getLocalUncommittedFiles(): Promise<WorktreeUncommittedFiles>;
|
|
664
|
+
|
|
665
|
+
/** Apply uncommitted changes from the task's worktree to a target branch in the main repository. */
|
|
666
|
+
applyUncommittedChanges(targetBranch?: string): Promise<void>;
|
|
667
|
+
|
|
668
|
+
/** Merge commits and optionally uncommitted changes from this task's worktree to a target worktree directory. */
|
|
669
|
+
mergeWorktreeToWorktree(targetWorktreeDir: string, includeUncommitted?: boolean): Promise<void>;
|
|
670
|
+
}
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
## ProjectContext
|
|
676
|
+
|
|
677
|
+
Safe subset of Project capabilities exposed to extensions. Provides read-only access to project data and safe operations.
|
|
678
|
+
|
|
679
|
+
```typescript
|
|
680
|
+
interface ProjectContext {
|
|
681
|
+
/** Absolute path to the project's root directory. */
|
|
682
|
+
readonly baseDir: string;
|
|
683
|
+
|
|
684
|
+
/** Create a new task within the project. Inherits settings from the most recent task (or parent task). */
|
|
685
|
+
createTask(params: CreateTaskParams): Promise<TaskData>;
|
|
686
|
+
|
|
687
|
+
/** Get a TaskContext for a specific loaded task by ID. Returns null if not loaded. */
|
|
688
|
+
getTask(taskId: string): TaskContext | null;
|
|
689
|
+
|
|
690
|
+
/** Get all loaded tasks in the project (most recent first). */
|
|
691
|
+
getTasks(): Promise<TaskData[]>;
|
|
692
|
+
|
|
693
|
+
/** Get the TaskContext for the most recently updated task, or null if no tasks exist. */
|
|
694
|
+
getMostRecentTask(): TaskContext | null;
|
|
695
|
+
|
|
696
|
+
/** Fork a task at a specific message, creating a new subtask. Copies context up to and including the specified message. */
|
|
697
|
+
forkTask(taskId: string, messageId: string): Promise<TaskData>;
|
|
698
|
+
|
|
699
|
+
/** Create a duplicate of an existing task (copies all context messages and files). */
|
|
700
|
+
duplicateTask(taskId: string): Promise<TaskData>;
|
|
701
|
+
|
|
702
|
+
/** Permanently delete a task and all its subtasks. */
|
|
703
|
+
deleteTask(taskId: string): Promise<void>;
|
|
704
|
+
|
|
705
|
+
/** Get all agent profiles available for this project (built-in, user-defined, and extension-provided). */
|
|
706
|
+
getAgentProfiles(): AgentProfile[];
|
|
707
|
+
|
|
708
|
+
/** Get all custom commands registered in the project (file-based and extension-provided). */
|
|
709
|
+
getCommands(): CommandsData;
|
|
710
|
+
|
|
711
|
+
/** Get the project-level settings. */
|
|
712
|
+
getProjectSettings(): ProjectSettings;
|
|
713
|
+
|
|
714
|
+
/** Load the input history file for the project (most recent first). */
|
|
715
|
+
getInputHistory(): Promise<string[]>;
|
|
716
|
+
}
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
101
721
|
## MemoryContext
|
|
102
722
|
|
|
103
|
-
Provides access to AiderDesk's memory system
|
|
723
|
+
Provides access to AiderDesk's memory system. Uses the same underlying vector store as the built-in memory MCP tools.
|
|
104
724
|
|
|
105
725
|
```typescript
|
|
106
726
|
interface MemoryContext {
|
|
727
|
+
/** Store a new memory entry. Returns the ID of the created memory. */
|
|
107
728
|
storeMemory(projectId: string, taskId: string, type: MemoryEntryType, content: string): Promise<string>;
|
|
729
|
+
|
|
730
|
+
/** Retrieve memories by semantic similarity. Returns array ranked by relevance. */
|
|
108
731
|
retrieveMemories(projectId: string, query: string, limit?: number): Promise<MemoryEntry[]>;
|
|
732
|
+
|
|
733
|
+
/** Get a single memory by ID. */
|
|
109
734
|
getMemory(id: string): Promise<MemoryEntry | null>;
|
|
735
|
+
|
|
736
|
+
/** Delete a specific memory by ID. */
|
|
110
737
|
deleteMemory(id: string): Promise<boolean>;
|
|
738
|
+
|
|
739
|
+
/** Update the content of an existing memory. */
|
|
111
740
|
updateMemory(id: string, content: string): Promise<boolean>;
|
|
741
|
+
|
|
742
|
+
/** Get all stored memories. */
|
|
112
743
|
getAllMemories(): Promise<MemoryEntry[]>;
|
|
744
|
+
|
|
745
|
+
/** Check if the memory system is enabled and initialized. */
|
|
113
746
|
isMemoryEnabled(): boolean;
|
|
747
|
+
|
|
748
|
+
/** Enable or disable the memory system. Persists the setting. */
|
|
114
749
|
setMemoryEnabled(enabled: boolean): void;
|
|
115
750
|
}
|
|
116
751
|
```
|
|
@@ -138,97 +773,173 @@ interface MemoryEntry {
|
|
|
138
773
|
}
|
|
139
774
|
```
|
|
140
775
|
|
|
141
|
-
|
|
776
|
+
---
|
|
777
|
+
|
|
778
|
+
## Supporting Types
|
|
779
|
+
|
|
780
|
+
### ExtensionMetadata
|
|
781
|
+
|
|
782
|
+
```typescript
|
|
783
|
+
interface ExtensionMetadata {
|
|
784
|
+
/** Extension name (displayed in UI) */
|
|
785
|
+
name: string;
|
|
786
|
+
/** Semantic version (e.g., "1.0.0") */
|
|
787
|
+
version: string;
|
|
788
|
+
/** Brief description of extension functionality */
|
|
789
|
+
description?: string;
|
|
790
|
+
/** Author name or organization */
|
|
791
|
+
author?: string;
|
|
792
|
+
/** Optional list of extension capabilities (e.g., ["tools", "ui-elements"]) */
|
|
793
|
+
capabilities?: string[];
|
|
794
|
+
/** Optional URL to an icon image */
|
|
795
|
+
iconUrl?: string;
|
|
796
|
+
/** Optional list of supported operating systems. If undefined, all OSes are supported. */
|
|
797
|
+
supportedOS?: OS[];
|
|
798
|
+
}
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
### ResponseMessage
|
|
142
802
|
|
|
143
803
|
```typescript
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
804
|
+
interface ResponseMessage {
|
|
805
|
+
id: string;
|
|
806
|
+
content: string;
|
|
807
|
+
reasoning?: string;
|
|
808
|
+
reflectedMessage?: string;
|
|
809
|
+
finished: boolean;
|
|
810
|
+
usageReport?: UsageReportData;
|
|
811
|
+
promptContext?: PromptContext;
|
|
812
|
+
timestamp?: number;
|
|
813
|
+
}
|
|
814
|
+
```
|
|
147
815
|
|
|
148
|
-
|
|
149
|
-
const taskContext = context.getTaskContext();
|
|
150
|
-
const taskId = taskContext?.data.id ?? '';
|
|
816
|
+
### QuestionOptions
|
|
151
817
|
|
|
152
|
-
|
|
153
|
-
projectId,
|
|
154
|
-
taskId,
|
|
155
|
-
'code-pattern',
|
|
156
|
-
'Always use clsx for conditional class names in React components',
|
|
157
|
-
);
|
|
818
|
+
> ⚠️ **CRITICAL:** There is **no `options` field** on `QuestionOptions`. Multiple-choice answers are provided via the **`answers`** array, where each entry has `{ text, shortkey }`.
|
|
158
819
|
|
|
159
|
-
|
|
160
|
-
|
|
820
|
+
```typescript
|
|
821
|
+
interface QuestionOptions {
|
|
822
|
+
/** Optional subject/title for the question dialog */
|
|
823
|
+
subject?: string;
|
|
824
|
+
/** Multiple-choice answers. Each has display text and a short key (e.g., 'y', 'n'). */
|
|
825
|
+
answers?: Array<{ text: string; shortkey: string }>;
|
|
826
|
+
/** Default answer if user doesn't choose */
|
|
827
|
+
defaultAnswer?: string;
|
|
161
828
|
}
|
|
162
829
|
```
|
|
163
830
|
|
|
164
|
-
|
|
831
|
+
### CreateTaskParams
|
|
165
832
|
|
|
166
833
|
```typescript
|
|
167
|
-
interface
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
834
|
+
interface CreateTaskParams {
|
|
835
|
+
parentId?: string | null;
|
|
836
|
+
name?: string;
|
|
837
|
+
autonomyMode?: AutonomyMode;
|
|
838
|
+
activate?: boolean;
|
|
839
|
+
handoff?: boolean;
|
|
840
|
+
sendEvent?: boolean;
|
|
841
|
+
provider?: string;
|
|
842
|
+
model?: string;
|
|
843
|
+
agentProfileId?: string;
|
|
844
|
+
mode?: Mode;
|
|
845
|
+
workingMode?: WorkingMode;
|
|
846
|
+
addInitialContextFiles?: boolean;
|
|
847
|
+
}
|
|
848
|
+
```
|
|
171
849
|
|
|
172
|
-
|
|
173
|
-
updateTask(updates: Partial<TaskData>): Promise<TaskData>;
|
|
174
|
-
runPrompt(prompt: string, mode?: string): Promise<void>;
|
|
175
|
-
runCustomCommand(name: string, args?: string[], mode?: string): Promise<void>;
|
|
176
|
-
runSubagent(agentProfile: AgentProfile, prompt: string): Promise<void>;
|
|
177
|
-
interruptResponse(): Promise<void>;
|
|
850
|
+
### ContextMessage
|
|
178
851
|
|
|
179
|
-
|
|
180
|
-
getRepoMap(): string;
|
|
181
|
-
getContextFiles(): ContextFile[];
|
|
182
|
-
addContextFiles(files: ContextFile[]): Promise<void>;
|
|
852
|
+
`ContextMessage` is a union type representing messages in the conversation context. The `content` field varies by role:
|
|
183
853
|
|
|
184
|
-
|
|
185
|
-
|
|
854
|
+
```typescript
|
|
855
|
+
type ContextMessage = ContextUserMessage | ContextAssistantMessage | ContextToolMessage;
|
|
856
|
+
|
|
857
|
+
interface ContextUserMessage {
|
|
858
|
+
id: string;
|
|
859
|
+
role: 'user';
|
|
860
|
+
content: UserContent; // string | Array<TextPart | ImagePart | FilePart>
|
|
861
|
+
timestamp?: number;
|
|
862
|
+
usageReport?: UsageReportData;
|
|
863
|
+
promptContext?: PromptContext;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
interface ContextAssistantMessage {
|
|
867
|
+
id: string;
|
|
868
|
+
role: 'assistant';
|
|
869
|
+
content: AssistantContent; // string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart>
|
|
870
|
+
reflectedMessage?: string;
|
|
871
|
+
editedFiles?: string[];
|
|
872
|
+
commitHash?: string;
|
|
873
|
+
commitMessage?: string;
|
|
874
|
+
diff?: string;
|
|
875
|
+
timestamp?: number;
|
|
876
|
+
usageReport?: UsageReportData;
|
|
877
|
+
promptContext?: PromptContext;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
interface ContextToolMessage {
|
|
881
|
+
id: string;
|
|
882
|
+
role: 'tool';
|
|
883
|
+
content: ToolContent; // Array<ToolResultPart>
|
|
884
|
+
timestamp?: number;
|
|
885
|
+
usageReport?: UsageReportData;
|
|
886
|
+
promptContext?: PromptContext;
|
|
186
887
|
}
|
|
187
888
|
```
|
|
188
889
|
|
|
189
|
-
|
|
890
|
+
The `content` can be a plain **string** (for user/assistant messages) or an **array of parts**. To extract plain text from any content:
|
|
190
891
|
|
|
191
892
|
```typescript
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
/** JSX/TSX component as string to be parsed */
|
|
200
|
-
jsx: string;
|
|
201
|
-
|
|
202
|
-
/** Optional flag to load data from extension (default: false) */
|
|
203
|
-
loadData?: boolean;
|
|
204
|
-
|
|
205
|
-
/** Optional flag to disable data caching (default: false) */
|
|
206
|
-
noDataCache?: boolean;
|
|
207
|
-
|
|
208
|
-
/** Optional filter for which messages this component handles (required for task-message placement) */
|
|
209
|
-
messageFilter?: MessageFilter;
|
|
893
|
+
function extractText(content: UserContent | AssistantContent): string {
|
|
894
|
+
if (typeof content === 'string') return content;
|
|
895
|
+
return content
|
|
896
|
+
.filter((part): part is TextPart => part.type === 'text')
|
|
897
|
+
.map((part) => part.text)
|
|
898
|
+
.join('\n');
|
|
210
899
|
}
|
|
900
|
+
```
|
|
211
901
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
902
|
+
### Content Part Types
|
|
903
|
+
|
|
904
|
+
```typescript
|
|
905
|
+
interface TextPart { type: 'text'; text: string; }
|
|
906
|
+
interface ImagePart { type: 'image'; image: DataContent | URL; mediaType?: string; }
|
|
907
|
+
interface FilePart { type: 'file'; data: DataContent | URL; filename?: string; mediaType: string; }
|
|
908
|
+
interface ReasoningPart { type: 'reasoning'; text: string; }
|
|
909
|
+
interface ToolCallPart { type: 'tool-call'; toolCallId: string; toolName: string; input: unknown; }
|
|
910
|
+
interface ToolResultPart { type: 'tool-result'; toolCallId: string; toolName: string; output: ToolResultOutput; }
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
### ContextFile
|
|
914
|
+
|
|
915
|
+
```typescript
|
|
916
|
+
interface ContextFile {
|
|
917
|
+
path: string;
|
|
918
|
+
readOnly?: boolean;
|
|
919
|
+
source?: 'global-rule' | 'project-rule' | 'agent-rule';
|
|
219
920
|
}
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
### UIComponentPlacement
|
|
220
924
|
|
|
925
|
+
> ⚠️ There is **no generic `'floating'`** placement. Use `'task-floating'`, `'project-floating'`, or `'app-floating'`.
|
|
926
|
+
|
|
927
|
+
```typescript
|
|
221
928
|
type UIComponentPlacement =
|
|
222
929
|
| 'task-status-bar-left'
|
|
223
930
|
| 'task-status-bar-right'
|
|
224
931
|
| 'task-usage-info-bottom'
|
|
225
932
|
| 'task-messages-top'
|
|
226
933
|
| 'task-messages-bottom'
|
|
934
|
+
| 'header-left'
|
|
935
|
+
| 'header-right'
|
|
227
936
|
| 'task-input-above'
|
|
228
937
|
| 'task-input-toolbar-left'
|
|
229
938
|
| 'task-input-toolbar-right'
|
|
230
939
|
| 'tasks-sidebar-header'
|
|
231
940
|
| 'tasks-sidebar-bottom'
|
|
941
|
+
| 'tasks-sidebar-actions-left'
|
|
942
|
+
| 'tasks-sidebar-actions-right'
|
|
232
943
|
| 'task-message'
|
|
233
944
|
| 'task-message-above'
|
|
234
945
|
| 'task-message-below'
|
|
@@ -237,87 +948,316 @@ type UIComponentPlacement =
|
|
|
237
948
|
| 'task-top-bar-right'
|
|
238
949
|
| 'task-state-actions'
|
|
239
950
|
| 'task-state-actions-all'
|
|
240
|
-
| '
|
|
241
|
-
| '
|
|
242
|
-
| '
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// Extension actions
|
|
265
|
-
executeExtensionAction: (action: string, ...args: unknown[]) => Promise<unknown>;
|
|
266
|
-
|
|
267
|
-
// External libraries (loaded via getUIComponentsLibraries)
|
|
268
|
-
libraries: Record<string, Record<string, unknown>>;
|
|
269
|
-
|
|
270
|
-
// Data from getUIExtensionData() (if loadData: true)
|
|
271
|
-
data?: unknown;
|
|
272
|
-
|
|
273
|
-
// Message-specific (for message placements)
|
|
274
|
-
message?: MessageData;
|
|
951
|
+
| 'welcome-page'
|
|
952
|
+
| 'task-floating'
|
|
953
|
+
| 'project-floating'
|
|
954
|
+
| 'app-floating';
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
### UIComponentDefinition
|
|
958
|
+
|
|
959
|
+
```typescript
|
|
960
|
+
interface UIComponentDefinition {
|
|
961
|
+
/** Unique component identifier */
|
|
962
|
+
id: string;
|
|
963
|
+
/** Where in UI to render this component */
|
|
964
|
+
placement: UIComponentPlacement;
|
|
965
|
+
/** Display name (used as floating panel title, tooltip, etc.) */
|
|
966
|
+
name?: string;
|
|
967
|
+
/** JSX/TSX component as string to be parsed by string-to-react-component */
|
|
968
|
+
jsx: string;
|
|
969
|
+
/** If true, component will load data from extension via getUIExtensionData (default: false) */
|
|
970
|
+
loadData?: boolean;
|
|
971
|
+
/** If true, data is always fetched fresh on render — disables caching (default: false) */
|
|
972
|
+
noDataCache?: boolean;
|
|
973
|
+
/** Optional filter for which messages this component should handle (for task-message placement) */
|
|
974
|
+
messageFilter?: MessageFilter;
|
|
275
975
|
}
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
### MessageFilter
|
|
276
979
|
|
|
980
|
+
```typescript
|
|
981
|
+
interface MessageFilter {
|
|
982
|
+
/** Message types this component handles (e.g., 'user', 'tool', 'response', 'log') */
|
|
983
|
+
types?: string[];
|
|
984
|
+
/** For tool messages: filter by server name */
|
|
985
|
+
serverName?: string;
|
|
986
|
+
/** For tool messages: filter by tool name */
|
|
987
|
+
toolName?: string;
|
|
988
|
+
}
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
### UIComponents
|
|
992
|
+
|
|
993
|
+
Common UI components available to extension JSX components via `props.ui`:
|
|
994
|
+
|
|
995
|
+
```typescript
|
|
277
996
|
interface UIComponents {
|
|
278
|
-
Button:
|
|
279
|
-
Checkbox:
|
|
280
|
-
Input:
|
|
281
|
-
Select:
|
|
282
|
-
TextArea:
|
|
283
|
-
IconButton:
|
|
284
|
-
RadioButton:
|
|
285
|
-
MultiSelect:
|
|
286
|
-
Slider:
|
|
287
|
-
DatePicker:
|
|
288
|
-
Chip:
|
|
289
|
-
ModelSelector:
|
|
290
|
-
Tooltip:
|
|
291
|
-
LoadingOverlay:
|
|
292
|
-
ConfirmDialog:
|
|
997
|
+
Button: UIComponent;
|
|
998
|
+
Checkbox: UIComponent;
|
|
999
|
+
Input: UIComponent;
|
|
1000
|
+
Select: UIComponent;
|
|
1001
|
+
TextArea: UIComponent;
|
|
1002
|
+
IconButton: UIComponent;
|
|
1003
|
+
RadioButton: UIComponent;
|
|
1004
|
+
MultiSelect: UIComponent;
|
|
1005
|
+
Slider: UIComponent;
|
|
1006
|
+
DatePicker: UIComponent;
|
|
1007
|
+
Chip: UIComponent;
|
|
1008
|
+
ModelSelector: UIComponent;
|
|
1009
|
+
Tooltip: UIComponent;
|
|
1010
|
+
LoadingOverlay: UIComponent;
|
|
1011
|
+
ConfirmDialog: UIComponent;
|
|
1012
|
+
ModalOverlayLayout: UIComponent;
|
|
293
1013
|
}
|
|
294
1014
|
```
|
|
295
1015
|
|
|
296
|
-
|
|
1016
|
+
### ToolDefinition
|
|
297
1017
|
|
|
298
|
-
|
|
1018
|
+
```typescript
|
|
1019
|
+
interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<string, unknown>>> {
|
|
1020
|
+
/** Tool identifier in kebab-case (e.g., 'run-linter') */
|
|
1021
|
+
name: string;
|
|
1022
|
+
/** Description for LLM to understand tool purpose */
|
|
1023
|
+
description: string;
|
|
1024
|
+
/** Zod schema for parameter validation */
|
|
1025
|
+
inputSchema: TSchema;
|
|
1026
|
+
/** Execute function with type-safe args */
|
|
1027
|
+
execute: (
|
|
1028
|
+
input: z.infer<TSchema>,
|
|
1029
|
+
signal: AbortSignal | undefined,
|
|
1030
|
+
context: ExtensionContext,
|
|
1031
|
+
allTools: Record<string, Tool>,
|
|
1032
|
+
) => Promise<unknown>;
|
|
1033
|
+
}
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
### CommandDefinition
|
|
299
1037
|
|
|
300
1038
|
```typescript
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
1039
|
+
interface CommandDefinition {
|
|
1040
|
+
/** Command name in kebab-case (e.g., 'generate-tests') */
|
|
1041
|
+
name: string;
|
|
1042
|
+
/** Description shown in autocomplete */
|
|
1043
|
+
description: string;
|
|
1044
|
+
/** Command arguments */
|
|
1045
|
+
arguments?: CommandArgument[];
|
|
1046
|
+
/** Execute function that handles the complete command logic */
|
|
1047
|
+
execute: (args: string[], context: ExtensionContext) => Promise<void>;
|
|
309
1048
|
}
|
|
310
1049
|
```
|
|
311
1050
|
|
|
312
|
-
|
|
1051
|
+
### ProviderDefinition
|
|
313
1052
|
|
|
314
1053
|
```typescript
|
|
315
|
-
interface
|
|
1054
|
+
interface ProviderDefinition {
|
|
1055
|
+
/** Unique provider identifier (e.g., 'my-provider') */
|
|
1056
|
+
id: string;
|
|
1057
|
+
/** Provider name — can be new or a built-in provider name to override */
|
|
316
1058
|
name: string;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
1059
|
+
/** Provider configuration (not UI-editable, extension-owned) */
|
|
1060
|
+
provider: { name: string; [key: string]: unknown };
|
|
1061
|
+
/** Provider strategy implementation */
|
|
1062
|
+
strategy: ExtensionProviderStrategy;
|
|
1063
|
+
/** Optional HTTP headers for API requests */
|
|
1064
|
+
headers?: Record<string, string>;
|
|
1065
|
+
}
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1068
|
+
### Event Payload Types
|
|
1069
|
+
|
|
1070
|
+
<details>
|
|
1071
|
+
<summary>Click to expand all event payload interfaces</summary>
|
|
1072
|
+
|
|
1073
|
+
```typescript
|
|
1074
|
+
interface TaskCreatedEvent { task: TaskData; }
|
|
1075
|
+
interface TaskPreparedEvent { task: TaskData; }
|
|
1076
|
+
interface TaskInitializedEvent { readonly task: TaskData; }
|
|
1077
|
+
interface TaskClosedEvent { readonly task: TaskData; }
|
|
1078
|
+
interface TaskUpdatedEvent { task: TaskData; }
|
|
1079
|
+
|
|
1080
|
+
interface ProjectStartedEvent { readonly baseDir: string; }
|
|
1081
|
+
interface ProjectStoppedEvent { readonly baseDir: string; }
|
|
1082
|
+
|
|
1083
|
+
interface PromptStartedEvent {
|
|
1084
|
+
prompt: string;
|
|
1085
|
+
mode: Mode;
|
|
1086
|
+
promptContext: PromptContext;
|
|
1087
|
+
blocked?: boolean;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
interface PromptFinishedEvent {
|
|
1091
|
+
responses: ResponseCompletedData[];
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
interface PromptTemplateEvent {
|
|
1095
|
+
readonly name: string;
|
|
1096
|
+
readonly data: unknown;
|
|
1097
|
+
prompt: string;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
interface AgentStartedEvent {
|
|
1101
|
+
readonly mode: Mode;
|
|
1102
|
+
prompt: string | null;
|
|
1103
|
+
agentProfile: AgentProfile;
|
|
1104
|
+
providerProfile: ProviderProfile;
|
|
1105
|
+
model: string;
|
|
1106
|
+
promptContext?: PromptContext;
|
|
1107
|
+
systemPrompt: string | undefined;
|
|
1108
|
+
contextMessages: ContextMessage[];
|
|
1109
|
+
contextFiles: ContextFile[];
|
|
1110
|
+
blocked?: boolean;
|
|
1111
|
+
images?: string[];
|
|
1112
|
+
skillsToActivate?: string[];
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
interface AgentFinishedEvent {
|
|
1116
|
+
readonly mode: Mode;
|
|
1117
|
+
readonly aborted: boolean;
|
|
1118
|
+
readonly contextMessages: ContextMessage[];
|
|
1119
|
+
resultMessages: ContextMessage[];
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
interface AgentStepStartedEvent {
|
|
1123
|
+
readonly mode: Mode;
|
|
1124
|
+
readonly agentProfile: AgentProfile;
|
|
1125
|
+
readonly currentResponseId: string;
|
|
1126
|
+
readonly iterationCount: number;
|
|
1127
|
+
messages: ContextMessage[];
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
interface AgentStepFinishedEvent {
|
|
1131
|
+
readonly mode: Mode;
|
|
1132
|
+
readonly agentProfile: AgentProfile;
|
|
1133
|
+
readonly currentResponseId: string;
|
|
1134
|
+
readonly stepResult: AgentStepResult;
|
|
1135
|
+
finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
1136
|
+
responseMessages: ContextMessage[];
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
interface OptimizeMessagesEvent {
|
|
1140
|
+
readonly originalMessages: ContextMessage[];
|
|
1141
|
+
optimizedMessages: ContextMessage[];
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
interface ImportantRemindersEvent {
|
|
1145
|
+
/** @deprecated Use `agentProfile` instead. */
|
|
1146
|
+
readonly profile: AgentProfile;
|
|
1147
|
+
readonly agentProfile: AgentProfile;
|
|
1148
|
+
remindersContent: string;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
interface ToolApprovalEvent {
|
|
1152
|
+
readonly toolName: string;
|
|
1153
|
+
readonly input: Record<string, unknown> | undefined;
|
|
1154
|
+
blocked?: boolean | string;
|
|
1155
|
+
allowed?: boolean;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
interface ToolCalledEvent {
|
|
1159
|
+
readonly toolCallId: string;
|
|
1160
|
+
readonly toolName: string;
|
|
1161
|
+
readonly agentProfile: AgentProfile;
|
|
1162
|
+
readonly abortSignal?: AbortSignal;
|
|
1163
|
+
input: Record<string, unknown> | undefined;
|
|
1164
|
+
output?: unknown;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
interface ToolFinishedEvent {
|
|
1168
|
+
readonly toolCallId: string;
|
|
1169
|
+
readonly toolName: string;
|
|
1170
|
+
readonly agentProfile: AgentProfile;
|
|
1171
|
+
readonly input: Record<string, unknown> | undefined;
|
|
1172
|
+
output: unknown;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
interface FilesAddedEvent { files: ContextFile[]; }
|
|
1176
|
+
interface FilesDroppedEvent { files: ContextFile[]; }
|
|
1177
|
+
interface RuleFilesRetrievedEvent { files: ContextFile[]; }
|
|
1178
|
+
|
|
1179
|
+
interface ResponseChunkEvent { chunk: ResponseChunkData; }
|
|
1180
|
+
interface ResponseCompletedEvent { response: ResponseCompletedData; }
|
|
1181
|
+
|
|
1182
|
+
interface HandleApprovalEvent {
|
|
1183
|
+
key: string;
|
|
1184
|
+
text: string;
|
|
1185
|
+
subject?: string;
|
|
1186
|
+
blocked?: boolean;
|
|
1187
|
+
allowed?: boolean;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
interface SubagentStartedEvent {
|
|
1191
|
+
subagentProfile: AgentProfile;
|
|
1192
|
+
prompt: string;
|
|
1193
|
+
promptContext?: PromptContext;
|
|
1194
|
+
contextMessages: ContextMessage[];
|
|
1195
|
+
contextFiles: ContextFile[];
|
|
1196
|
+
systemPrompt?: string;
|
|
1197
|
+
blocked?: boolean;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
interface SubagentFinishedEvent {
|
|
1201
|
+
readonly subagentProfile: AgentProfile;
|
|
1202
|
+
resultMessages: ContextMessage[];
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
interface QuestionAskedEvent {
|
|
1206
|
+
question: QuestionData;
|
|
1207
|
+
readonly storedAnswer?: string;
|
|
1208
|
+
answer?: string;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
interface QuestionAnsweredEvent {
|
|
1212
|
+
readonly question: QuestionData;
|
|
1213
|
+
answer: string;
|
|
1214
|
+
userInput?: string;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
interface CommandExecutedEvent {
|
|
1218
|
+
command: string;
|
|
1219
|
+
blocked?: boolean;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
interface CustomCommandExecutedEvent {
|
|
1223
|
+
command: CustomCommand;
|
|
1224
|
+
mode: Mode;
|
|
1225
|
+
blocked?: boolean;
|
|
1226
|
+
prompt?: string;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
interface AiderPromptStartedEvent {
|
|
1230
|
+
prompt: string;
|
|
1231
|
+
mode: Mode;
|
|
1232
|
+
promptContext: PromptContext;
|
|
1233
|
+
messages: ConnectorMessage[];
|
|
1234
|
+
files: ContextFile[];
|
|
1235
|
+
blocked?: boolean;
|
|
1236
|
+
autonomyMode?: AutonomyMode;
|
|
1237
|
+
denyCommands?: boolean;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
interface AiderPromptFinishedEvent {
|
|
1241
|
+
responses: ResponseCompletedData[];
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
interface InterruptedEvent {
|
|
1245
|
+
/** Optional interrupt ID for targeting a specific subagent or conflict-resolution agent */
|
|
1246
|
+
interruptId?: string;
|
|
1247
|
+
/** Set to true by extension to skip the default interrupt cleanup */
|
|
1248
|
+
blocked?: boolean;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
interface BeforeCommitEvent {
|
|
1252
|
+
message: string;
|
|
1253
|
+
amend: boolean;
|
|
1254
|
+
blocked?: boolean;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
interface AfterCommitEvent {
|
|
1258
|
+
readonly message: string;
|
|
1259
|
+
readonly amend: boolean;
|
|
322
1260
|
}
|
|
323
1261
|
```
|
|
1262
|
+
|
|
1263
|
+
</details>
|