@aiderdesk/aiderdesk 0.74.0 → 0.76.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.
Files changed (79) hide show
  1. package/out/{open-telemetry-baOvr6sK.js → open-telemetry-B7yROZIC.js} +3 -0
  2. package/out/renderer/assets/{AgentSettings-B-793Wr6.js → AgentSettings-Dc8h1zSI.js} +2 -2
  3. package/out/renderer/assets/{InfoIcon-cuLXzJtV.js → InfoIcon-BuABw5oZ.js} +1 -1
  4. package/out/renderer/assets/{Onboarding-xrPWRnXm.js → Onboarding-lX23sGcW.js} +4 -4
  5. package/out/renderer/assets/{ProviderHeader-CMVyqpPa.js → ProviderHeader-s7JSikLR.js} +275 -197
  6. package/out/renderer/assets/{SettingsPage-BBtDhv80.js → SettingsPage-CcsH6kmE.js} +314 -276
  7. package/out/renderer/assets/{UsageDashboard-CGI4iwCD.js → UsageDashboard-oAQNYvYh.js} +3795 -2366
  8. package/out/renderer/assets/{arc-CFENq1wJ.js → arc-BiaIwS79.js} +1 -1
  9. package/out/renderer/assets/{architectureDiagram-3BPJPVTR-BRG_9Mao.js → architectureDiagram-3BPJPVTR-d7fu6X13.js} +4 -4
  10. package/out/renderer/assets/{blockDiagram-GPEHLZMM-B3c7WMY4.js → blockDiagram-GPEHLZMM-CWD8GVpw.js} +4 -4
  11. package/out/renderer/assets/{c4Diagram-AAUBKEIU-BYQrxMcW.js → c4Diagram-AAUBKEIU-b5nYOm14.js} +2 -2
  12. package/out/renderer/assets/{channel-DPxL1rpa.js → channel-B99g0IUF.js} +1 -1
  13. package/out/renderer/assets/{chunk-2J33WTMH-C-kk05Nj.js → chunk-2J33WTMH-DmrXuNY-.js} +1 -1
  14. package/out/renderer/assets/{chunk-4BX2VUAB-BV8PWxnG.js → chunk-4BX2VUAB-4Soxfj2i.js} +1 -1
  15. package/out/renderer/assets/{chunk-55IACEB6-Cj6KHkUp.js → chunk-55IACEB6-BtS727h4.js} +1 -1
  16. package/out/renderer/assets/{chunk-727SXJPM-BaIkuSPr.js → chunk-727SXJPM-CVxcBF7D.js} +5 -5
  17. package/out/renderer/assets/{chunk-AQP2D5EJ-DVZR_bfB.js → chunk-AQP2D5EJ-m8ArTZfD.js} +3 -3
  18. package/out/renderer/assets/{chunk-FMBD7UC4-CNrb2a0a.js → chunk-FMBD7UC4-yWO_9Kky.js} +1 -1
  19. package/out/renderer/assets/{chunk-ND2GUHAM-ClOnPDjy.js → chunk-ND2GUHAM-BkVCmcvx.js} +1 -1
  20. package/out/renderer/assets/{chunk-QZHKN3VN-B2sJx9j2.js → chunk-QZHKN3VN-DwLbWeqf.js} +1 -1
  21. package/out/renderer/assets/{classDiagram-4FO5ZUOK-ZzwWMcLO.js → classDiagram-4FO5ZUOK-B3t9RWJZ.js} +6 -6
  22. package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-ZzwWMcLO.js → classDiagram-v2-Q7XG4LA2-B3t9RWJZ.js} +6 -6
  23. package/out/renderer/assets/{cose-bilkent-S5V4N54A-DBx-UiMU.js → cose-bilkent-S5V4N54A-W70GNPEp.js} +2 -2
  24. package/out/renderer/assets/{cytoscape.esm-Bm8DJGmZ.js → cytoscape.esm-BNSvh83I.js} +957 -957
  25. package/out/renderer/assets/{dagre-BM42HDAG-B_vMvYpz.js → dagre-BM42HDAG-D_Val_ih.js} +3 -3
  26. package/out/renderer/assets/{diagram-2AECGRRQ-Do-w2xXO.js → diagram-2AECGRRQ-Z7UeOtJN.js} +3 -3
  27. package/out/renderer/assets/{diagram-5GNKFQAL-JzG77sgb.js → diagram-5GNKFQAL-DY9Yifty.js} +4 -4
  28. package/out/renderer/assets/{diagram-KO2AKTUF-CGMx2nPP.js → diagram-KO2AKTUF-CGi0HZww.js} +3 -3
  29. package/out/renderer/assets/{diagram-LMA3HP47-BqXnQeNu.js → diagram-LMA3HP47-bdoVxL2p.js} +3 -3
  30. package/out/renderer/assets/{diagram-OG6HWLK6-BR4e0lIb.js → diagram-OG6HWLK6-2K829auL.js} +4 -4
  31. package/out/renderer/assets/{erDiagram-TEJ5UH35-B7QK0XSy.js → erDiagram-TEJ5UH35-D4sO1GH8.js} +4 -4
  32. package/out/renderer/assets/{flowDiagram-I6XJVG4X-BOySqejA.js → flowDiagram-I6XJVG4X-DQNz4Jg_.js} +6 -6
  33. package/out/renderer/assets/{ganttDiagram-6RSMTGT7-BORAleML.js → ganttDiagram-6RSMTGT7-B3dUFX1p.js} +3 -3
  34. package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-DTReLiJT.js → gitGraphDiagram-PVQCEYII-B95Lrq_7.js} +4 -4
  35. package/out/renderer/assets/{graph-Bf8U9r0n.js → graph-7kCtdoo_.js} +1 -1
  36. package/out/renderer/assets/{index-D3R9tjiT.js → index-58fbbmhI.js} +1 -1
  37. package/out/renderer/assets/{index-D6b3rMtW.js → index-B2TL7Kll.js} +1 -1
  38. package/out/renderer/assets/{index-BS5vy5uH.js → index-BHaWBJe9.js} +1 -1
  39. package/out/renderer/assets/{index-DUoUqcJ_.js → index-Bihcg0ql.js} +1 -1
  40. package/out/renderer/assets/{index-BOQBc3Qj.js → index-BnFS7uhp.js} +576 -252
  41. package/out/renderer/assets/{index-5i67azF0.js → index-BoogYopJ.js} +1 -1
  42. package/out/renderer/assets/{index-Dq3ldCAy.js → index-CNgsMipO.js} +9967 -8310
  43. package/out/renderer/assets/{index-CmQY2QKE.js → index-CRfveI6m.js} +1 -1
  44. package/out/renderer/assets/{index-7NwOg_q_.css → index-DcD881Q1.css} +89 -880
  45. package/out/renderer/assets/{index-COyr1I0o.js → index-GRVDmgjb.js} +1 -1
  46. package/out/renderer/assets/{index-Dtxgil7l.js → index-pvhejocY.js} +1 -1
  47. package/out/renderer/assets/{infoDiagram-5YYISTIA-Ryv-Emth.js → infoDiagram-5YYISTIA-C0OH2to7.js} +2 -2
  48. package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-Blzp6JLN.js → ishikawaDiagram-YF4QCWOH-DsgR-cKp.js} +1 -1
  49. package/out/renderer/assets/{journeyDiagram-JHISSGLW--KB4ASET.js → journeyDiagram-JHISSGLW-Bg6okgzG.js} +4 -4
  50. package/out/renderer/assets/{jsx-dev-runtime-DAzw_Red.js → jsx-dev-runtime-DLJNe6VM.js} +1 -1
  51. package/out/renderer/assets/{kanban-definition-UN3LZRKU-BzNpCu_x.js → kanban-definition-UN3LZRKU-1UvLCrWk.js} +2 -2
  52. package/out/renderer/assets/{katex-DK1nL-FM.js → katex-Co8xHYNH.js} +193 -193
  53. package/out/renderer/assets/{layout-BQu4M-KW.js → layout-9w0fH2nL.js} +2 -2
  54. package/out/renderer/assets/{linear-DNZEF2Al.js → linear-WTE7GZY2.js} +1 -1
  55. package/out/renderer/assets/{mindmap-definition-RKZ34NQL-CxQjZIps.js → mindmap-definition-RKZ34NQL-BlxjYw-a.js} +3 -3
  56. package/out/renderer/assets/{pieDiagram-4H26LBE5-qJt7eGwM.js → pieDiagram-4H26LBE5-C4jZuzAH.js} +4 -4
  57. package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-mMOhLjN_.js → quadrantDiagram-W4KKPZXB-BLG4PrcM.js} +2 -2
  58. package/out/renderer/assets/{requirementDiagram-4Y6WPE33-GLhMtLW7.js → requirementDiagram-4Y6WPE33-CTTFFDvR.js} +3 -3
  59. package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-Kcd8qR8y.js → sankeyDiagram-5OEKKPKP-CjDlOfXf.js} +1 -1
  60. package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-CpmBIgMJ.js → sequenceDiagram-3UESZ5HK-6PJo_0SQ.js} +3 -3
  61. package/out/renderer/assets/{stateDiagram-AJRCARHV-D00qZ9cQ.js → stateDiagram-AJRCARHV-Cnhm9mmx.js} +6 -6
  62. package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-CkEgNJrB.js → stateDiagram-v2-BHNVJYJU-BxKTEg-3.js} +4 -4
  63. package/out/renderer/assets/{time-CQSoUo1N.js → time-YGhgEMYh.js} +1 -1
  64. package/out/renderer/assets/{timeline-definition-PNZ67QCA-CmydTbH6.js → timeline-definition-PNZ67QCA-ooi5Tti4.js} +2 -2
  65. package/out/renderer/assets/{vennDiagram-CIIHVFJN-B4QGhnvI.js → vennDiagram-CIIHVFJN-B_kwCHhU.js} +1 -1
  66. package/out/renderer/assets/{wardley-L42UT6IY-B-mpW52K.js → wardley-L42UT6IY-Dnx4ZTc4.js} +1 -1
  67. package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-Cz1pK1MY.js → wardleyDiagram-YWT4CUSO-cqZcXF7R.js} +3 -3
  68. package/out/renderer/assets/{xychartDiagram-2RQKCTM6-H-Q9Zv48.js → xychartDiagram-2RQKCTM6-BBUpFNY4.js} +2 -2
  69. package/out/renderer/index.html +2 -2
  70. package/out/resources/skills/extension-creator/SKILL.md +71 -7
  71. package/out/resources/skills/extension-creator/references/event-types.md +568 -40
  72. package/out/resources/skills/extension-creator/references/examples-gallery.md +23 -14
  73. package/out/resources/skills/extension-creator/references/extension-interface.md +1189 -199
  74. package/out/resources/skills/extension-creator/references/ui-components.md +40 -6
  75. package/out/runner.js +886 -399
  76. package/package.json +22 -20
  77. package/patches/@requesty+ai-sdk+3.5.0.patch +84 -0
  78. package/patches/ai+7.0.37.patch +33 -0
  79. package/patches/ai+5.0.195.patch +0 -33
@@ -1,116 +1,766 @@
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
+
26
+ ```typescript
27
+ interface Extension {
28
+ /** Called when extension is loaded. Use this to initialize state, set up resources, etc. */
29
+ onLoad?(context: ExtensionContext): void | Promise<void>;
30
+
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. */
41
+ getTools?(context: ExtensionContext, mode: string, agentProfile: AgentProfile): ToolDefinition[];
42
+
43
+ /** Return array of commands this extension provides. */
44
+ getCommands?(context: ExtensionContext): CommandDefinition[];
45
+
46
+ /** Return array of modes this extension provides. */
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). */
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>`. */
62
+ getUIComponentsLibraries?(): Record<string, string>;
63
+
64
+ /** Return data for a specific UI component. Called on mount or when UI refresh is triggered. */
65
+ getUIExtensionData?(componentId: string, context: ExtensionContext): Promise<unknown>;
66
+
67
+ /** Handle an action triggered from a UI component via executeExtensionAction. */
68
+ executeUIExtensionAction?(componentId: string, action: string, args: unknown[], context: ExtensionContext): Promise<unknown>;
69
+ }
70
+ ```
71
+
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. */
77
+ getConfigComponent?(context: ExtensionContext): string | undefined;
78
+
79
+ /** Return the current configuration data for this extension's settings. */
80
+ getConfigData?(context: ExtensionContext): Promise<unknown>;
81
+
82
+ /** Save configuration data for this extension's settings. Called when user clicks Save. */
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
+ ```
95
+
96
+ ### Task Events
97
+
98
+ ```typescript
99
+ interface Extension {
100
+ /** Called when a new task is created. Return partial event to modify task data. */
101
+ onTaskCreated?(event: TaskCreatedEvent, context: ExtensionContext): Promise<void | Partial<TaskCreatedEvent>>;
102
+
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. */
149
+ onAgentStarted?(event: AgentStartedEvent, context: ExtensionContext): Promise<void | Partial<AgentStartedEvent>>;
150
+
151
+ /** Called when agent mode finishes. */
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. */
158
+ onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
159
+
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. */
182
+ onToolApproval?(event: ToolApprovalEvent, context: ExtensionContext): Promise<void | Partial<ToolApprovalEvent>>;
183
+
184
+ /** Called when a tool is about to be executed. */
185
+ onToolCalled?(event: ToolCalledEvent, context: ExtensionContext): Promise<void | Partial<ToolCalledEvent>>;
186
+
187
+ /** Called after tool execution completes. */
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>>;
198
+
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>>;
201
+
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
+ ```
227
+
228
+ ### Subagent Events
229
+
230
+ ```typescript
231
+ interface Extension {
232
+ /** Called when a subagent starts. Set `event.blocked = true` to prevent subagent spawning. */
233
+ onSubagentStarted?(event: SubagentStartedEvent, context: ExtensionContext): Promise<void | Partial<SubagentStartedEvent>>;
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>>;
273
+ }
274
+ ```
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
+
290
+ ## ExtensionContext
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
+
299
+ ```typescript
300
+ interface ExtensionContext {
301
+ /** Log a message prefixed with the extension name. Type defaults to 'info'. */
302
+ log(message: string, type?: 'info' | 'error' | 'warn' | 'debug'): void;
303
+
304
+ /** Get the current project directory path. Returns empty string when no project is available. */
305
+ getProjectDir(): string;
306
+
307
+ /** Get the base directories of all currently open projects (open project tabs/windows).
308
+ * Available regardless of whether the context itself is scoped to a project or task. */
309
+ getOpenProjectDirs(): string[];
310
+
311
+ /** Get the task context for the current task. Returns null when no task is available. */
312
+ getTaskContext(): TaskContext | null;
313
+
314
+ /** Get the project context for safe project-level operations. Throws if no project is available. */
315
+ getProjectContext(): ProjectContext;
316
+
317
+ /** Get all available model configurations from all enabled providers. */
318
+ getModelConfigs(): Promise<Model[]>;
319
+
320
+ /** Get a specific setting value from global settings using dot-notation (e.g., 'general.theme'). */
321
+ getSetting(key: string): Promise<unknown>;
322
+
323
+ /** Update global settings by merging the provided partial updates. */
324
+ updateSettings(updates: Partial<SettingsData>): Promise<void>;
325
+
326
+ /** Trigger a data refresh for UI components. Optionally target a specific component and/or task. */
327
+ triggerUIDataRefresh(componentId?: string, taskId?: string): void;
328
+
329
+ /** Trigger a full reload of all UI component definitions for this extension. */
330
+ triggerUIComponentsReload(): void;
331
+
332
+ /** Open a URL. Target: 'external' (system browser), 'window' (new Electron window), or 'modal-overlay' (iframe in modal). */
333
+ openUrl(url: string, target?: 'external' | 'window' | 'modal-overlay'): Promise<void>;
334
+
335
+ /** Open a file or directory in the system's default application. Returns true if opened successfully. */
336
+ openPath(path: string): Promise<boolean>;
337
+
338
+ /** Get a narrowed Electron App object (e.g., for getAppMetrics CPU/memory stats). Returns null when not running in Electron. */
339
+ getElectronApp(): Promise<ElectronApp | null>;
340
+
341
+ /** Get the memory context for vector store operations (store, retrieve, update, delete memories). */
342
+ getMemoryContext(): MemoryContext;
343
+
344
+ /** Truncate a tool result string that exceeds size limits (lines, bytes, tokens). Saves full content to a temp file by default. */
345
+ truncateToolResult(
346
+ content: string,
347
+ maxLines?: number,
348
+ maxSizeKB?: number,
349
+ maxTokens?: number,
350
+ saveToFile?: boolean,
351
+ truncationSuffix?: string,
352
+ ): Promise<string>;
353
+ }
354
+ ```
355
+
356
+ ### ElectronApp and Related Types
357
+
358
+ ```typescript
359
+ /** Narrow subset of Electron's App object exposed to extensions. */
360
+ interface ElectronApp {
361
+ /** Returns process metrics (memory + CPU usage) for all app processes. Memory is in KB. */
362
+ getAppMetrics(): ElectronProcessMetric[];
363
+ /** Current application version. */
364
+ getVersion(): string;
365
+ /** Current application name. */
366
+ getName(): string;
367
+ /** True when the application has finished initializing. */
368
+ isReady(): boolean;
369
+ }
370
+
371
+ interface ElectronCPUUsage {
372
+ /** Percentage of CPU used since last call (0–100). */
373
+ percentCPUUsage?: number;
374
+ /** Cumulative CPU time in seconds since process start. */
375
+ cumulativeCPUUsage?: number;
376
+ }
377
+
378
+ interface ElectronMemoryInfo {
379
+ /** Working set size in KB. */
380
+ workingSetSize?: number;
381
+ /** Peak working set size in KB. */
382
+ peakWorkingSetSize?: number;
383
+ }
384
+
385
+ interface ElectronProcessMetric {
386
+ pid?: number;
387
+ /** One of: Browser, Renderer, GPU, Utility, etc. */
388
+ type?: string;
389
+ serviceName?: string;
390
+ name?: string;
391
+ cpu?: ElectronCPUUsage;
392
+ memory?: ElectronMemoryInfo;
393
+ }
394
+ ```
395
+
396
+ ---
397
+
398
+ ## TaskContext
399
+
400
+ Safe subset of Task capabilities exposed to extensions. Provides read-only access to task data and safe write operations.
401
+
402
+ ### Task Data
403
+
404
+ ```typescript
405
+ interface TaskContext {
406
+ /** Read-only snapshot of the current task state (id, name, status, mode, all persisted fields). */
407
+ readonly data: TaskData;
408
+ }
409
+ ```
410
+
411
+ ### Context Files (Read + Safe Write)
412
+
413
+ ```typescript
414
+ interface TaskContext {
415
+ /** Get the list of files currently in the task's context. */
416
+ getContextFiles(): Promise<ContextFile[]>;
417
+
418
+ /** Add a single file to the task's context by path. Dispatches `onFilesAdded` event before adding. */
419
+ addFile(path: string, readOnly?: boolean): Promise<void>;
420
+
421
+ /** Add multiple files to the task's context at once. Dispatches `onFilesAdded` for each file. */
422
+ addFiles(...files: ContextFile[]): Promise<void>;
423
+
424
+ /** Remove a file from the task's context by path. Dispatches `onFilesDropped` event before removing. */
425
+ dropFile(path: string): Promise<void>;
426
+ }
427
+ ```
428
+
429
+ ### Context Messages (Read + Safe Write)
430
+
431
+ ```typescript
432
+ interface TaskContext {
433
+ /** Get the full conversation history from the task's context manager. */
434
+ getContextMessages(): Promise<ContextMessage[]>;
435
+
436
+ /** Append a message to the context messages. Auto-saves to disk. */
437
+ addContextMessage(message: ContextMessage, updateContextInfo?: boolean): Promise<void>;
438
+
439
+ /** Remove a specific message from the context by its ID. */
440
+ removeMessage(messageId: string): Promise<void>;
441
+
442
+ /** Remove the most recent message from the context. */
443
+ removeLastMessage(): Promise<void>;
444
+
445
+ /** Remove a message and all messages after it (inclusive). */
446
+ removeMessagesUpTo(messageId: string): Promise<void>;
447
+
448
+ /** Load a set of messages, replacing the current in-memory messages. Used for loading pre-authored context. */
449
+ loadContextMessages(messages: ContextMessage[]): Promise<void>;
450
+
451
+ /** Re-execute a user prompt at a specific message ID, optionally with a different mode or edited text. */
452
+ redoUserPrompt(messageId: string, mode?: string, updatedPrompt?: string): Promise<void>;
453
+
454
+ /** Re-execute the last user prompt. Convenience method that finds the last user message and calls redoUserPrompt. */
455
+ redoLastUserPrompt(mode?: string, updatedPrompt?: string): Promise<void>;
456
+ }
457
+ ```
458
+
459
+ ### UI Messages
460
+
461
+ ```typescript
462
+ interface TaskContext {
463
+ /** Send a user message to the UI for display. Does NOT add to context or persist. */
464
+ addUserMessage(id: string, content: string, promptContext?: PromptContext): void;
465
+
466
+ /** Send a tool execution message to the UI. Optionally persists via data manager. */
467
+ addToolMessage(
468
+ id: string,
469
+ serverName: string,
470
+ toolName: string,
471
+ input?: unknown,
472
+ response?: string,
473
+ usageReport?: UsageReportData,
474
+ promptContext?: PromptContext,
475
+ saveToDb?: boolean,
476
+ finished?: boolean,
477
+ ): void;
478
+
479
+ /** Process a response message — streams chunks to UI, sends completed response when finished. Dispatches `onResponseChunk` and `onResponseCompleted`. */
480
+ addResponseMessage(message: ResponseMessage, saveToDb?: boolean): Promise<void>;
481
+ }
482
+ ```
483
+
484
+ ### Files & Repo (Read-only)
485
+
486
+ ```typescript
487
+ interface TaskContext {
488
+ /** Get the working directory for this task (worktree path or project base directory). */
489
+ getTaskDir(): string;
490
+
491
+ /** Get files that can be added to context (not already in context), optionally filtered by regex. */
492
+ getAddableFiles(searchRegex?: string): Promise<string[]>;
493
+
494
+ /** Get all files in the task directory, optionally filtered by git tracking. */
495
+ getAllFiles(useGit?: boolean): Promise<string[]>;
496
+
497
+ /** Get files modified during the current task's execution (compares against main branch). */
498
+ getUpdatedFiles(): Promise<UpdatedFile[]>;
499
+
500
+ /** Get the cached repository map string summarizing the codebase structure. */
501
+ getRepoMap(): string;
502
+
503
+ /** Stage a file in git (equivalent to `git add`). No-op if not a git repo. */
504
+ addToGit(path: string): Promise<void>;
505
+ }
506
+ ```
507
+
508
+ ### Todos
509
+
510
+ ```typescript
511
+ interface TaskContext {
512
+ /** Get all todo items for this task. */
513
+ getTodos(): Promise<TodoItem[]>;
514
+
515
+ /** Create a new uncompleted todo item. Returns updated array of all todos. */
516
+ addTodo(name: string): Promise<TodoItem[]>;
517
+
518
+ /** Update an existing todo item's properties (e.g., `{ completed: true }`). Returns updated array. */
519
+ updateTodo(name: string, updates: Partial<TodoItem>): Promise<TodoItem[]>;
520
+
521
+ /** Remove a todo item by name. Returns updated array. */
522
+ deleteTodo(name: string): Promise<TodoItem[]>;
523
+
524
+ /** Remove all todo items. Returns empty array. */
525
+ clearAllTodos(): Promise<TodoItem[]>;
526
+
527
+ /** Replace the entire todo list with the provided items. */
528
+ setTodos(items: TodoItem[], initialUserPrompt?: string): Promise<void>;
529
+ }
530
+ ```
531
+
532
+ ### Execution
533
+
534
+ ```typescript
535
+ interface TaskContext {
536
+ /** Submit a prompt for processing. If a prompt is running, the new one is queued. */
537
+ runPrompt(prompt: string, mode?: string): Promise<void>;
538
+
539
+ /** Execute a prompt directly using a specific agent profile. Returns array of response completion data. */
540
+ runPromptInAgent(
541
+ profile: AgentProfile,
542
+ mode: string,
543
+ prompt: string | null,
544
+ promptContext?: PromptContext,
545
+ contextMessages?: ContextMessage[],
546
+ contextFiles?: ContextFile[],
547
+ systemPrompt?: string,
548
+ waitForCurrentAgentToFinish?: boolean,
549
+ sendNotification?: boolean,
550
+ ): Promise<ResponseCompletedData[]>;
551
+
552
+ /** Execute a registered custom command by name. */
553
+ runCustomCommand(name: string, args?: string[], mode?: string): Promise<void>;
554
+
555
+ /** Spawn a subagent with the given profile and prompt. Dispatches `onSubagentStarted` and `onSubagentFinished`. */
556
+ runSubagent(agentProfile: AgentProfile, prompt: string): Promise<void>;
557
+
558
+ /** Execute a slash command in the task's context. Dispatches `onCommandExecuted`. */
559
+ runCommand(command: string): Promise<void>;
560
+
561
+ /** Interrupt the currently running agent response or subagent. */
562
+ interruptResponse(): Promise<void>;
563
+
564
+ /** Generate text using a specific model without running the full agent loop. */
565
+ generateText(modelId: string, systemPrompt: string, prompt: string): Promise<string | undefined>;
566
+
567
+ /** Generate a structured object using a specific model and Zod schema, without running the full agent loop. */
568
+ generateObject<T>(modelId: string, systemPrompt: string, prompt: string, schema: z.ZodType<T>): Promise<T | undefined>;
569
+ }
570
+ ```
571
+
572
+ ### User Interaction
573
+
574
+ ```typescript
575
+ interface TaskContext {
576
+ /** Ask the user a question and wait for their response. Supports answer choices via QuestionOptions. */
577
+ askQuestion(text: string, options?: QuestionOptions): Promise<string>;
578
+
579
+ /** Send a log message to the UI (appears in the task's message stream). */
580
+ addLogMessage(level: 'info' | 'error' | 'warning', message?: string): void;
581
+
582
+ /** Show or update a loading indicator in the task's UI. Pass `finished: true` to dismiss. */
583
+ addLoadingMessage(message?: string, finished?: boolean): void;
584
+ }
585
+ ```
586
+
587
+ ### Task Management
588
+
589
+ ```typescript
590
+ interface TaskContext {
591
+ /** Update the task's data with partial changes and persist them. */
592
+ updateTask(updates: Partial<TaskData>): Promise<TaskData>;
593
+
594
+ /** Generate a handoff summary and optionally execute a follow-up prompt. */
595
+ handoffConversation(focus?: string, execute?: boolean): Promise<void>;
596
+ }
597
+ ```
598
+
599
+ ### Context Management
600
+
601
+ ```typescript
602
+ interface TaskContext {
603
+ /** Clear the task's conversation context (messages, connectors, UI). */
604
+ clearContext(): Promise<void>;
605
+
606
+ /** Reset the task context by clearing both context files and messages, then saving to disk. */
607
+ resetContext(): Promise<void>;
608
+
609
+ /** Compact the conversation by summarizing history via a compact-conversation agent. */
610
+ compactConversation(instructions?: string): Promise<void>;
611
+
612
+ /** Generate a markdown representation of the context messages. */
613
+ generateContextMarkdown(): Promise<string | null>;
614
+
615
+ /** Check whether the task has been fully initialized and is ready for use. */
616
+ isInitialized(): boolean;
617
+
618
+ /** Update the autocompletion data sent to the UI. */
619
+ updateAutocompletionWords(words?: string[]): Promise<void>;
620
+ }
621
+ ```
622
+
623
+ ### Queued Prompts
624
+
7
625
  ```typescript
8
- interface Extension {
9
- // Lifecycle
10
- onLoad?(context: ExtensionContext): Promise<void> | void;
11
- onUnload?(context: ExtensionContext): Promise<void> | void;
626
+ interface TaskContext {
627
+ /** Get all prompts currently queued for execution. */
628
+ getQueuedPrompts(): QueuedPromptData[];
12
629
 
13
- // Registration
14
- getCommands?(context: ExtensionContext): CommandDefinition[];
15
- getTools?(context: ExtensionContext, mode: string, agentProfile: AgentProfile): ToolDefinition[];
16
- getAgents?(context: ExtensionContext): AgentProfile[];
17
- getModes?(context: ExtensionContext): ModeDefinition[];
18
- getUIComponents?(context: ExtensionContext): UIComponentDefinition[];
19
- getUIComponentsLibraries?(): Record<string, string>;
20
-
21
- // UI Component support
22
- getUIExtensionData?(componentId: string, context: ExtensionContext): Promise<unknown>;
23
- executeUIExtensionAction?(componentId: string, action: string, args: unknown[], context: ExtensionContext): Promise<unknown>;
630
+ /** Immediately execute a queued prompt by moving it to the front and interrupting the current response. */
631
+ sendQueuedPromptNow(promptId: string): Promise<void>;
24
632
 
25
- // Settings configuration (per-extension settings UI)
26
- getConfigComponent?(context: ExtensionContext): string | undefined;
27
- getConfigData?(context: ExtensionContext): Promise<unknown>;
28
- saveConfigData?(configData: unknown, context: ExtensionContext): Promise<unknown>;
633
+ /** Remove a prompt from the execution queue without running it. */
634
+ removeQueuedPrompt(promptId: string): void;
29
635
 
30
- // Task Events
31
- 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>;
636
+ /** Reorder the queued prompts to a specific arrangement. */
637
+ reorderQueuedPrompts(prompts: QueuedPromptData[]): void;
34
638
 
35
- // Agent Events
36
- onAgentStarted?(event: AgentStartedEvent, context: ExtensionContext): Promise<void | Partial<AgentStartedEvent>>;
37
- onAgentFinished?(event: AgentFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentFinishedEvent>>;
38
- onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
39
- onAgentProfileUpdated?(context: ExtensionContext, agentId: string, updatedProfile: AgentProfile): Promise<AgentProfile>;
639
+ /** Edit the text content of an existing queued prompt. */
640
+ editQueuedPrompt(promptId: string, newText: string): void;
641
+ }
642
+ ```
40
643
 
41
- // Tool Events
42
- onToolApproval?(event: ToolApprovalEvent, context: ExtensionContext): Promise<void | Partial<ToolApprovalEvent>>;
43
- onToolCalled?(event: ToolCalledEvent, context: ExtensionContext): Promise<void | Partial<ToolCalledEvent>>;
44
- onToolFinished?(event: ToolFinishedEvent, context: ExtensionContext): Promise<void | Partial<ToolFinishedEvent>>;
644
+ ### Advanced
45
645
 
46
- // File Events
47
- onFileAdded?(event: FileAddedEvent, context: ExtensionContext): Promise<void>;
48
- onFileDropped?(event: FileDroppedEvent, context: ExtensionContext): Promise<void>;
646
+ ```typescript
647
+ interface TaskContext {
648
+ /** Get the agent profile assigned to this task (checks task-level, then project-level). Returns null if none configured. */
649
+ getTaskAgentProfile(): Promise<AgentProfile | null>;
650
+
651
+ /** Programmatically answer a pending question. Returns true if a question was answered, false if none pending. */
652
+ answerQuestion(answer: string, userInput?: string): Promise<boolean>;
653
+ }
654
+ ```
49
655
 
50
- // Prompt Events
51
- onPromptSubmitted?(event: PromptSubmittedEvent, context: ExtensionContext): Promise<void | Partial<PromptSubmittedEvent>>;
52
- onPromptStarted?(event: PromptStartedEvent, context: ExtensionContext): Promise<void>;
53
- onPromptFinished?(event: PromptFinishedEvent, context: ExtensionContext): Promise<void>;
656
+ ### Working Mode & Worktrees
54
657
 
55
- // Message Events
56
- onResponseMessageProcessed?(event: ResponseMessageProcessedEvent, context: ExtensionContext): Promise<void | Partial<ResponseMessageProcessedEvent>>;
658
+ ```typescript
659
+ interface TaskContext {
660
+ /** Switch the task to worktree working mode, optionally carrying over uncommitted changes. */
661
+ switchToWorktreeWorkingMode(options?: SwitchToWorktreeOptions): Promise<void>;
57
662
 
58
- // Other Events
59
- onProjectOpen?(context: ExtensionContext): Promise<void>;
60
- onRuleFilesRetrieved?(context: ExtensionContext, ruleFiles: string[]): Promise<string[]>;
61
- onSubagentStarted?(event: SubagentStartedEvent, context: ExtensionContext): Promise<void | Partial<SubagentStartedEvent>>;
62
- onSubagentFinished?(event: SubagentFinishedEvent, context: ExtensionContext): Promise<void>;
63
- onQuestionAsked?(event: QuestionAskedEvent, context: ExtensionContext): Promise<void>;
64
- onQuestionAnswered?(event: QuestionAnsweredEvent, context: ExtensionContext): Promise<void>;
65
- onCommandExecuted?(event: CommandExecutedEvent, context: ExtensionContext): Promise<void>;
663
+ /** Switch the task to local working mode, optionally merging the worktree branch first. */
664
+ switchToLocalWorkingMode(options?: SwitchToLocalOptions): Promise<void>;
665
+
666
+ /** Get uncommitted files from the project's main repository (not from a worktree). */
667
+ getLocalUncommittedFiles(): Promise<WorktreeUncommittedFiles>;
668
+
669
+ /** Apply uncommitted changes from the task's worktree to a target branch in the main repository. */
670
+ applyUncommittedChanges(targetBranch?: string): Promise<void>;
671
+
672
+ /** Merge commits and optionally uncommitted changes from this task's worktree to a target worktree directory. */
673
+ mergeWorktreeToWorktree(targetWorktreeDir: string, includeUncommitted?: boolean): Promise<void>;
674
+ }
675
+
676
+ ### Resume
677
+
678
+ ```typescript
679
+ interface TaskContext {
680
+ /** Resume the task — starts execution as if the user clicked the "Execute"/"Resume" button.
681
+ * In agent mode, this runs the last user prompt through the agent pipeline.
682
+ * In Aider modes, this re-executes the last user message.
683
+ * No-op if the task is already running or has no prior user message to resume from. */
684
+ resumeTask(): Promise<void>;
66
685
  }
67
686
  ```
68
687
 
69
- ## ExtensionContext
688
+ ---
689
+
690
+ ## ProjectContext
691
+
692
+ Safe subset of Project capabilities exposed to extensions. Provides read-only access to project data and safe operations.
70
693
 
71
694
  ```typescript
72
- interface ExtensionContext {
73
- // Logging (backend/dev console only — NOT visible to users in chat UI)
74
- log(message: string, type: 'info' | 'error' | 'warn' | 'debug'): void;
695
+ interface ProjectContext {
696
+ /** Absolute path to the project's root directory. */
697
+ readonly baseDir: string;
75
698
 
76
- // Project access
77
- getProjectDir(): string;
78
- getTaskContext(): TaskContext | null;
79
- getProjectContext(): ProjectContext;
699
+ /** Create a new task within the project. Inherits settings from the most recent task (or parent task). */
700
+ createTask(params: CreateTaskParams): Promise<TaskData>;
80
701
 
81
- // Memory access
82
- getMemoryContext(): MemoryContext;
702
+ /** Get a TaskContext for a specific loaded task by ID. Returns null if not loaded. */
703
+ getTask(taskId: string): TaskContext | null;
83
704
 
84
- // Settings
85
- getSetting(key: string): Promise<unknown>;
86
- updateSettings(updates: Record<string, unknown>): Promise<void>;
705
+ /** Get all loaded tasks in the project (most recent first). */
706
+ getTasks(): Promise<TaskData[]>;
87
707
 
88
- // Models
89
- getModelConfigs(): Promise<Model[]>;
90
-
91
- // UI updates
92
- triggerUIDataRefresh(componentId?: string, taskId?: string): void;
93
- triggerUIComponentsReload(): void;
94
-
95
- // Navigation
96
- openUrl(url: string, target?: 'external' | 'window' | 'modal-overlay'): Promise<void>;
97
- openPath(path: string): Promise<boolean>;
708
+ /** Get the TaskContext for the most recently updated task, or null if no tasks exist. */
709
+ getMostRecentTask(): TaskContext | null;
710
+
711
+ /** Fork a task at a specific message, creating a new subtask. Copies context up to and including the specified message. */
712
+ forkTask(taskId: string, messageId: string): Promise<TaskData>;
713
+
714
+ /** Create a duplicate of an existing task (copies all context messages and files). */
715
+ duplicateTask(taskId: string): Promise<TaskData>;
716
+
717
+ /** Permanently delete a task and all its subtasks. */
718
+ deleteTask(taskId: string): Promise<void>;
719
+
720
+ /** Get all agent profiles available for this project (built-in, user-defined, and extension-provided). */
721
+ getAgentProfiles(): AgentProfile[];
722
+
723
+ /** Get all custom commands registered in the project (file-based and extension-provided). */
724
+ getCommands(): CommandsData;
725
+
726
+ /** Get the project-level settings. */
727
+ getProjectSettings(): ProjectSettings;
728
+
729
+ /** Load the input history file for the project (most recent first). */
730
+ getInputHistory(): Promise<string[]>;
98
731
  }
99
732
  ```
100
733
 
734
+ ---
735
+
101
736
  ## MemoryContext
102
737
 
103
- Provides access to AiderDesk's memory system — the same underlying vector store used by the built-in memory tools. Available via `context.getMemoryContext()` in any extension method.
738
+ Provides access to AiderDesk's memory system. Uses the same underlying vector store as the built-in memory MCP tools.
104
739
 
105
740
  ```typescript
106
741
  interface MemoryContext {
742
+ /** Store a new memory entry. Returns the ID of the created memory. */
107
743
  storeMemory(projectId: string, taskId: string, type: MemoryEntryType, content: string): Promise<string>;
744
+
745
+ /** Retrieve memories by semantic similarity. Returns array ranked by relevance. */
108
746
  retrieveMemories(projectId: string, query: string, limit?: number): Promise<MemoryEntry[]>;
747
+
748
+ /** Get a single memory by ID. */
109
749
  getMemory(id: string): Promise<MemoryEntry | null>;
750
+
751
+ /** Delete a specific memory by ID. */
110
752
  deleteMemory(id: string): Promise<boolean>;
753
+
754
+ /** Update the content of an existing memory. */
111
755
  updateMemory(id: string, content: string): Promise<boolean>;
756
+
757
+ /** Get all stored memories. */
112
758
  getAllMemories(): Promise<MemoryEntry[]>;
759
+
760
+ /** Check if the memory system is enabled and initialized. */
113
761
  isMemoryEnabled(): boolean;
762
+
763
+ /** Enable or disable the memory system. Persists the setting. */
114
764
  setMemoryEnabled(enabled: boolean): void;
115
765
  }
116
766
  ```
@@ -138,97 +788,207 @@ interface MemoryEntry {
138
788
  }
139
789
  ```
140
790
 
141
- ### Usage example
791
+ ---
142
792
 
143
- ```typescript
144
- async onAgentFinished(event: AgentFinishedEvent, context: ExtensionContext) {
145
- const memory = context.getMemoryContext();
146
- if (!memory.isMemoryEnabled()) return;
793
+ ## Supporting Types
147
794
 
148
- const projectId = context.getProjectDir();
149
- const taskContext = context.getTaskContext();
150
- const taskId = taskContext?.data.id ?? '';
795
+ ### ExtensionMetadata
796
+
797
+ ```typescript
798
+ interface ExtensionMetadata {
799
+ /** Extension name (displayed in UI) */
800
+ name: string;
801
+ /** Semantic version (e.g., "1.0.0") */
802
+ version: string;
803
+ /** Brief description of extension functionality */
804
+ description?: string;
805
+ /** Author name or organization */
806
+ author?: string;
807
+ /** Optional list of extension capabilities (e.g., ["tools", "ui-elements"]) */
808
+ capabilities?: string[];
809
+ /** Optional URL to an icon image */
810
+ iconUrl?: string;
811
+ /** Optional list of supported operating systems. If undefined, all OSes are supported. */
812
+ supportedOS?: OS[];
813
+ }
814
+ ```
151
815
 
152
- await memory.storeMemory(
153
- projectId,
154
- taskId,
155
- 'code-pattern',
156
- 'Always use clsx for conditional class names in React components',
157
- );
816
+ ### ResponseMessage
158
817
 
159
- const memories = await memory.retrieveMemories(projectId, 'React class names');
160
- context.log(`Found ${memories.length} relevant memories`, 'info');
818
+ ```typescript
819
+ interface ResponseMessage {
820
+ id: string;
821
+ content: string;
822
+ reasoning?: string;
823
+ reflectedMessage?: string;
824
+ finished: boolean;
825
+ usageReport?: UsageReportData;
826
+ promptContext?: PromptContext;
827
+ timestamp?: number;
161
828
  }
162
829
  ```
163
830
 
164
- ## TaskContext
831
+ ### ModelCallSettings
832
+
833
+ Used with `AgentStartedEvent.modelCallSettings` to override AI SDK model-call parameters. On dispatch, it contains computed defaults such as `maxRetries` and `abortSignal`; a returned partial value is merged with those defaults.
165
834
 
166
835
  ```typescript
167
- interface TaskContext {
168
- // Logging to chat (visible to users in the task's chat UI)
169
- addLogMessage(level: 'info' | 'error' | 'warning', message?: string): void;
170
- addLoadingMessage(message?: string, finished?: boolean): void;
836
+ type Reasoning = 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
171
837
 
172
- // Task operations
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>;
838
+ interface ModelCallTimeout {
839
+ totalMs?: number;
840
+ stepMs?: number;
841
+ chunkMs?: number;
842
+ toolMs?: number;
843
+ tools?: Record<string, number>;
844
+ }
178
845
 
179
- // File operations
180
- getRepoMap(): string;
181
- getContextFiles(): ContextFile[];
182
- addContextFiles(files: ContextFile[]): Promise<void>;
846
+ interface ModelCallSettings {
847
+ maxOutputTokens?: number;
848
+ temperature?: number;
849
+ topP?: number;
850
+ topK?: number;
851
+ presencePenalty?: number;
852
+ frequencyPenalty?: number;
853
+ stopSequences?: string[];
854
+ seed?: number;
855
+ reasoning?: Reasoning;
856
+ maxRetries?: number;
857
+ abortSignal?: AbortSignal;
858
+ timeout?: number | ModelCallTimeout;
859
+ headers?: Record<string, string>;
860
+ }
861
+ ```
183
862
 
184
- // Questions
185
- askQuestion(text: string, options?: QuestionOptions): Promise<string>;
863
+ Use either `temperature` or `topP` for sampling. When `reasoning` is specified, it takes precedence over provider-specific reasoning options.
864
+
865
+ ### QuestionOptions
866
+
867
+ > ⚠️ **CRITICAL:** There is **no `options` field** on `QuestionOptions`. Multiple-choice answers are provided via the **`answers`** array, where each entry has `{ text, shortkey }`.
868
+
869
+ ```typescript
870
+ interface QuestionOptions {
871
+ /** Optional subject/title for the question dialog */
872
+ subject?: string;
873
+ /** Multiple-choice answers. Each has display text and a short key (e.g., 'y', 'n'). */
874
+ answers?: Array<{ text: string; shortkey: string }>;
875
+ /** Default answer if user doesn't choose */
876
+ defaultAnswer?: string;
186
877
  }
187
878
  ```
188
879
 
189
- ## UIComponentDefinition
880
+ ### CreateTaskParams
190
881
 
191
882
  ```typescript
192
- interface UIComponentDefinition {
193
- /** Unique component identifier */
883
+ interface CreateTaskParams {
884
+ parentId?: string | null;
885
+ name?: string;
886
+ autonomyMode?: AutonomyMode;
887
+ activate?: boolean;
888
+ handoff?: boolean;
889
+ sendEvent?: boolean;
890
+ provider?: string;
891
+ model?: string;
892
+ agentProfileId?: string;
893
+ mode?: Mode;
894
+ workingMode?: WorkingMode;
895
+ addInitialContextFiles?: boolean;
896
+ }
897
+ ```
898
+
899
+ ### ContextMessage
900
+
901
+ `ContextMessage` is a union type representing messages in the conversation context. The `content` field varies by role:
902
+
903
+ ```typescript
904
+ type ContextMessage = ContextUserMessage | ContextAssistantMessage | ContextToolMessage;
905
+
906
+ interface ContextUserMessage {
194
907
  id: string;
195
-
196
- /** Where in UI to render this component */
197
- placement: UIComponentPlacement;
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;
908
+ role: 'user';
909
+ content: UserContent; // string | Array<TextPart | ImagePart | FilePart>
910
+ timestamp?: number;
911
+ usageReport?: UsageReportData;
912
+ promptContext?: PromptContext;
210
913
  }
211
914
 
212
- interface MessageFilter {
213
- /** Message types this component handles (e.g. 'user', 'tool', 'response', 'log') */
214
- types?: string[];
215
- /** For tool messages: filter by server name */
216
- serverName?: string;
217
- /** For tool messages: filter by tool name */
218
- toolName?: string;
915
+ interface ContextAssistantMessage {
916
+ id: string;
917
+ role: 'assistant';
918
+ content: AssistantContent; // string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart>
919
+ reflectedMessage?: string;
920
+ editedFiles?: string[];
921
+ commitHash?: string;
922
+ commitMessage?: string;
923
+ diff?: string;
924
+ timestamp?: number;
925
+ usageReport?: UsageReportData;
926
+ promptContext?: PromptContext;
927
+ }
928
+
929
+ interface ContextToolMessage {
930
+ id: string;
931
+ role: 'tool';
932
+ content: ToolContent; // Array<ToolResultPart>
933
+ timestamp?: number;
934
+ usageReport?: UsageReportData;
935
+ promptContext?: PromptContext;
936
+ }
937
+ ```
938
+
939
+ The `content` can be a plain **string** (for user/assistant messages) or an **array of parts**. To extract plain text from any content:
940
+
941
+ ```typescript
942
+ function extractText(content: UserContent | AssistantContent): string {
943
+ if (typeof content === 'string') return content;
944
+ return content
945
+ .filter((part): part is TextPart => part.type === 'text')
946
+ .map((part) => part.text)
947
+ .join('\n');
948
+ }
949
+ ```
950
+
951
+ ### Content Part Types
952
+
953
+ ```typescript
954
+ interface TextPart { type: 'text'; text: string; }
955
+ interface ImagePart { type: 'image'; image: DataContent | URL; mediaType?: string; }
956
+ interface FilePart { type: 'file'; data: DataContent | URL; filename?: string; mediaType: string; }
957
+ interface ReasoningPart { type: 'reasoning'; text: string; }
958
+ interface ToolCallPart { type: 'tool-call'; toolCallId: string; toolName: string; input: unknown; }
959
+ interface ToolResultPart { type: 'tool-result'; toolCallId: string; toolName: string; output: ToolResultOutput; }
960
+ ```
961
+
962
+ ### ContextFile
963
+
964
+ ```typescript
965
+ interface ContextFile {
966
+ path: string;
967
+ readOnly?: boolean;
968
+ source?: 'global-rule' | 'project-rule' | 'agent-rule';
219
969
  }
970
+ ```
971
+
972
+ ### UIComponentPlacement
220
973
 
974
+ > ⚠️ There is **no generic `'floating'`** placement. Use `'task-floating'`, `'project-floating'`, or `'app-floating'`.
975
+
976
+ ```typescript
221
977
  type UIComponentPlacement =
222
978
  | 'task-status-bar-left'
223
979
  | 'task-status-bar-right'
224
980
  | 'task-usage-info-bottom'
225
981
  | 'task-messages-top'
226
982
  | 'task-messages-bottom'
983
+ | 'header-left'
984
+ | 'header-right'
227
985
  | 'task-input-above'
228
986
  | 'task-input-toolbar-left'
229
987
  | 'task-input-toolbar-right'
230
988
  | 'tasks-sidebar-header'
231
989
  | 'tasks-sidebar-bottom'
990
+ | 'tasks-sidebar-actions-left'
991
+ | 'tasks-sidebar-actions-right'
232
992
  | 'task-message'
233
993
  | 'task-message-above'
234
994
  | 'task-message-below'
@@ -237,87 +997,317 @@ type UIComponentPlacement =
237
997
  | 'task-top-bar-right'
238
998
  | 'task-state-actions'
239
999
  | 'task-state-actions-all'
240
- | 'header-left'
241
- | 'header-right'
242
- | 'welcome-page';
243
- ```
244
-
245
- ## UIComponentProps
246
-
247
- Props available to UI components via the `data` prop (React is globally available, not a prop):
248
-
249
- ```typescript
250
- interface UIComponentProps {
251
- // Context data
252
- projectDir?: string;
253
- task?: TaskData;
254
- agentProfile?: AgentProfile;
255
- models: Model[];
256
- providers: ProviderProfile[];
257
-
258
- // UI library
259
- ui: UIComponents;
260
-
261
- // Icons library (organized by icon set)
262
- icons: Record<string, Record<string, IconComponent>>;
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;
1000
+ | 'task-sidebar-item-badges'
1001
+ | 'welcome-page'
1002
+ | 'task-floating'
1003
+ | 'project-floating'
1004
+ | 'app-floating';
1005
+ ```
1006
+
1007
+ ### UIComponentDefinition
1008
+
1009
+ ```typescript
1010
+ interface UIComponentDefinition {
1011
+ /** Unique component identifier */
1012
+ id: string;
1013
+ /** Where in UI to render this component */
1014
+ placement: UIComponentPlacement;
1015
+ /** Display name (used as floating panel title, tooltip, etc.) */
1016
+ name?: string;
1017
+ /** JSX/TSX component as string to be parsed by string-to-react-component */
1018
+ jsx: string;
1019
+ /** If true, component will load data from extension via getUIExtensionData (default: false) */
1020
+ loadData?: boolean;
1021
+ /** If true, data is always fetched fresh on render — disables caching (default: false) */
1022
+ noDataCache?: boolean;
1023
+ /** Optional filter for which messages this component should handle (for task-message placement) */
1024
+ messageFilter?: MessageFilter;
1025
+ }
1026
+ ```
1027
+
1028
+ ### MessageFilter
1029
+
1030
+ ```typescript
1031
+ interface MessageFilter {
1032
+ /** Message types this component handles (e.g., 'user', 'tool', 'response', 'log') */
1033
+ types?: string[];
1034
+ /** For tool messages: filter by server name */
1035
+ serverName?: string;
1036
+ /** For tool messages: filter by tool name */
1037
+ toolName?: string;
275
1038
  }
1039
+ ```
1040
+
1041
+ ### UIComponents
276
1042
 
1043
+ Common UI components available to extension JSX components via `props.ui`:
1044
+
1045
+ ```typescript
277
1046
  interface UIComponents {
278
- Button: Component;
279
- Checkbox: Component;
280
- Input: Component;
281
- Select: Component;
282
- TextArea: Component;
283
- IconButton: Component;
284
- RadioButton: Component;
285
- MultiSelect: Component;
286
- Slider: Component;
287
- DatePicker: Component;
288
- Chip: Component;
289
- ModelSelector: Component;
290
- Tooltip: Component;
291
- LoadingOverlay: Component;
292
- ConfirmDialog: Component;
1047
+ Button: UIComponent;
1048
+ Checkbox: UIComponent;
1049
+ Input: UIComponent;
1050
+ Select: UIComponent;
1051
+ TextArea: UIComponent;
1052
+ IconButton: UIComponent;
1053
+ RadioButton: UIComponent;
1054
+ MultiSelect: UIComponent;
1055
+ Slider: UIComponent;
1056
+ DatePicker: UIComponent;
1057
+ Chip: UIComponent;
1058
+ ModelSelector: UIComponent;
1059
+ Tooltip: UIComponent;
1060
+ LoadingOverlay: UIComponent;
1061
+ ConfirmDialog: UIComponent;
1062
+ ModalOverlayLayout: UIComponent;
293
1063
  }
294
1064
  ```
295
1065
 
296
- ## Metadata
1066
+ ### ToolDefinition
1067
+
1068
+ ```typescript
1069
+ interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<string, unknown>>> {
1070
+ /** Tool identifier in kebab-case (e.g., 'run-linter') */
1071
+ name: string;
1072
+ /** Description for LLM to understand tool purpose */
1073
+ description: string;
1074
+ /** Zod schema for parameter validation */
1075
+ inputSchema: TSchema;
1076
+ /** Execute function with type-safe args */
1077
+ execute: (
1078
+ input: z.infer<TSchema>,
1079
+ signal: AbortSignal | undefined,
1080
+ context: ExtensionContext,
1081
+ allTools: Record<string, Tool>,
1082
+ ) => Promise<unknown>;
1083
+ }
1084
+ ```
297
1085
 
298
- Metadata is defined as a **static property** on the extension class:
1086
+ ### CommandDefinition
299
1087
 
300
1088
  ```typescript
301
- export default class MyExtension implements Extension {
302
- static metadata = {
303
- name: 'My Extension',
304
- version: '1.0.0',
305
- description: 'What this extension does',
306
- author: 'Author Name',
307
- capabilities: ['events', 'commands'],
308
- };
1089
+ interface CommandDefinition {
1090
+ /** Command name in kebab-case (e.g., 'generate-tests') */
1091
+ name: string;
1092
+ /** Description shown in autocomplete */
1093
+ description: string;
1094
+ /** Command arguments */
1095
+ arguments?: CommandArgument[];
1096
+ /** Execute function that handles the complete command logic */
1097
+ execute: (args: string[], context: ExtensionContext) => Promise<void>;
309
1098
  }
310
1099
  ```
311
1100
 
312
- **Important:** Metadata must be a `static` property on the class. Do NOT use a separate `export const metadata = { ... }` — the extension loader reads it from `ExtensionClass.metadata`.
1101
+ ### ProviderDefinition
313
1102
 
314
1103
  ```typescript
315
- interface ExtensionMetadata {
1104
+ interface ProviderDefinition {
1105
+ /** Unique provider identifier (e.g., 'my-provider') */
1106
+ id: string;
1107
+ /** Provider name — can be new or a built-in provider name to override */
316
1108
  name: string;
317
- version: string;
318
- description?: string;
319
- author?: string;
320
- capabilities?: string[];
321
- iconUrl?: string;
1109
+ /** Provider configuration (not UI-editable, extension-owned) */
1110
+ provider: { name: string; [key: string]: unknown };
1111
+ /** Provider strategy implementation */
1112
+ strategy: ExtensionProviderStrategy;
1113
+ /** Optional HTTP headers for API requests */
1114
+ headers?: Record<string, string>;
1115
+ }
1116
+ ```
1117
+
1118
+ ### Event Payload Types
1119
+
1120
+ <details>
1121
+ <summary>Click to expand all event payload interfaces</summary>
1122
+
1123
+ ```typescript
1124
+ interface TaskCreatedEvent { task: TaskData; }
1125
+ interface TaskPreparedEvent { task: TaskData; }
1126
+ interface TaskInitializedEvent { readonly task: TaskData; }
1127
+ interface TaskClosedEvent { readonly task: TaskData; }
1128
+ interface TaskUpdatedEvent { task: TaskData; }
1129
+
1130
+ interface ProjectStartedEvent { readonly baseDir: string; }
1131
+ interface ProjectStoppedEvent { readonly baseDir: string; }
1132
+
1133
+ interface PromptStartedEvent {
1134
+ prompt: string;
1135
+ mode: Mode;
1136
+ promptContext: PromptContext;
1137
+ blocked?: boolean;
1138
+ }
1139
+
1140
+ interface PromptFinishedEvent {
1141
+ responses: ResponseCompletedData[];
1142
+ }
1143
+
1144
+ interface PromptTemplateEvent {
1145
+ readonly name: string;
1146
+ readonly data: unknown;
1147
+ prompt: string;
1148
+ }
1149
+
1150
+ interface AgentStartedEvent {
1151
+ readonly mode: Mode;
1152
+ prompt: string | null;
1153
+ agentProfile: AgentProfile;
1154
+ providerProfile: ProviderProfile;
1155
+ model: string;
1156
+ promptContext?: PromptContext;
1157
+ systemPrompt: string | undefined;
1158
+ contextMessages: ContextMessage[];
1159
+ contextFiles: ContextFile[];
1160
+ blocked?: boolean;
1161
+ images?: string[];
1162
+ skillsToActivate?: string[];
1163
+ }
1164
+
1165
+ interface AgentFinishedEvent {
1166
+ readonly mode: Mode;
1167
+ readonly aborted: boolean;
1168
+ readonly contextMessages: ContextMessage[];
1169
+ resultMessages: ContextMessage[];
1170
+ }
1171
+
1172
+ interface AgentStepStartedEvent {
1173
+ readonly mode: Mode;
1174
+ readonly agentProfile: AgentProfile;
1175
+ readonly currentResponseId: string;
1176
+ readonly iterationCount: number;
1177
+ messages: ContextMessage[];
1178
+ }
1179
+
1180
+ interface AgentStepFinishedEvent {
1181
+ readonly mode: Mode;
1182
+ readonly agentProfile: AgentProfile;
1183
+ readonly currentResponseId: string;
1184
+ readonly stepResult: AgentStepResult;
1185
+ finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
1186
+ responseMessages: ContextMessage[];
1187
+ }
1188
+
1189
+ interface OptimizeMessagesEvent {
1190
+ readonly originalMessages: ContextMessage[];
1191
+ optimizedMessages: ContextMessage[];
1192
+ }
1193
+
1194
+ interface ImportantRemindersEvent {
1195
+ /** @deprecated Use `agentProfile` instead. */
1196
+ readonly profile: AgentProfile;
1197
+ readonly agentProfile: AgentProfile;
1198
+ remindersContent: string;
1199
+ }
1200
+
1201
+ interface ToolApprovalEvent {
1202
+ readonly toolName: string;
1203
+ readonly input: Record<string, unknown> | undefined;
1204
+ blocked?: boolean | string;
1205
+ allowed?: boolean;
1206
+ }
1207
+
1208
+ interface ToolCalledEvent {
1209
+ readonly toolCallId: string;
1210
+ readonly toolName: string;
1211
+ readonly agentProfile: AgentProfile;
1212
+ readonly abortSignal?: AbortSignal;
1213
+ input: Record<string, unknown> | undefined;
1214
+ output?: unknown;
1215
+ }
1216
+
1217
+ interface ToolFinishedEvent {
1218
+ readonly toolCallId: string;
1219
+ readonly toolName: string;
1220
+ readonly agentProfile: AgentProfile;
1221
+ readonly input: Record<string, unknown> | undefined;
1222
+ output: unknown;
1223
+ }
1224
+
1225
+ interface FilesAddedEvent { files: ContextFile[]; }
1226
+ interface FilesDroppedEvent { files: ContextFile[]; }
1227
+ interface RuleFilesRetrievedEvent { files: ContextFile[]; }
1228
+
1229
+ interface ResponseChunkEvent { chunk: ResponseChunkData; }
1230
+ interface ResponseCompletedEvent { response: ResponseCompletedData; }
1231
+
1232
+ interface HandleApprovalEvent {
1233
+ key: string;
1234
+ text: string;
1235
+ subject?: string;
1236
+ blocked?: boolean;
1237
+ allowed?: boolean;
1238
+ }
1239
+
1240
+ interface SubagentStartedEvent {
1241
+ subagentProfile: AgentProfile;
1242
+ prompt: string;
1243
+ promptContext?: PromptContext;
1244
+ contextMessages: ContextMessage[];
1245
+ contextFiles: ContextFile[];
1246
+ systemPrompt?: string;
1247
+ blocked?: boolean;
1248
+ }
1249
+
1250
+ interface SubagentFinishedEvent {
1251
+ readonly subagentProfile: AgentProfile;
1252
+ resultMessages: ContextMessage[];
1253
+ }
1254
+
1255
+ interface QuestionAskedEvent {
1256
+ question: QuestionData;
1257
+ readonly storedAnswer?: string;
1258
+ answer?: string;
1259
+ }
1260
+
1261
+ interface QuestionAnsweredEvent {
1262
+ readonly question: QuestionData;
1263
+ answer: string;
1264
+ userInput?: string;
1265
+ }
1266
+
1267
+ interface CommandExecutedEvent {
1268
+ command: string;
1269
+ blocked?: boolean;
1270
+ }
1271
+
1272
+ interface CustomCommandExecutedEvent {
1273
+ command: CustomCommand;
1274
+ mode: Mode;
1275
+ blocked?: boolean;
1276
+ prompt?: string;
1277
+ }
1278
+
1279
+ interface AiderPromptStartedEvent {
1280
+ prompt: string;
1281
+ mode: Mode;
1282
+ promptContext: PromptContext;
1283
+ messages: ConnectorMessage[];
1284
+ files: ContextFile[];
1285
+ blocked?: boolean;
1286
+ autonomyMode?: AutonomyMode;
1287
+ denyCommands?: boolean;
1288
+ }
1289
+
1290
+ interface AiderPromptFinishedEvent {
1291
+ responses: ResponseCompletedData[];
1292
+ }
1293
+
1294
+ interface InterruptedEvent {
1295
+ /** Optional interrupt ID for targeting a specific subagent or conflict-resolution agent */
1296
+ interruptId?: string;
1297
+ /** Set to true by extension to skip the default interrupt cleanup */
1298
+ blocked?: boolean;
1299
+ }
1300
+
1301
+ interface BeforeCommitEvent {
1302
+ message: string;
1303
+ amend: boolean;
1304
+ blocked?: boolean;
1305
+ }
1306
+
1307
+ interface AfterCommitEvent {
1308
+ readonly message: string;
1309
+ readonly amend: boolean;
322
1310
  }
323
1311
  ```
1312
+
1313
+ </details>