@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
@@ -2,17 +2,188 @@
2
2
 
3
3
  All event types and their payloads for extension event handlers.
4
4
 
5
+ > **IMPORTANT:** For the authoritative event type definitions, see [extensions.ts on GitHub](https://raw.githubusercontent.com/hotovo/aider-desk/refs/heads/main/packages/common/src/extensions.ts) (event interfaces start at line ~360).
6
+
7
+ ---
8
+
9
+ ## Extension Method → Event Mapping
10
+
11
+ Every Extension interface method dispatches a specific event type. All handlers return `Promise<void | Partial<Event>>` except `onAfterCommit` which returns `Promise<void>` (read-only).
12
+
13
+ | Extension Method | Event Type | Can Block |
14
+ |---|---|---|
15
+ | `onTaskCreated` | `TaskCreatedEvent` | — |
16
+ | `onTaskPrepared` | `TaskPreparedEvent` | — |
17
+ | `onTaskInitialized` | `TaskInitializedEvent` | — |
18
+ | `onTaskClosed` | `TaskClosedEvent` | — |
19
+ | `onTaskUpdated` | `TaskUpdatedEvent` | — |
20
+ | `onProjectStarted` | `ProjectStartedEvent` | — |
21
+ | `onProjectStopped` | `ProjectStoppedEvent` | — |
22
+ | `onPromptStarted` | `PromptStartedEvent` | ✅ Yes |
23
+ | `onPromptFinished` | `PromptFinishedEvent` | — |
24
+ | `onPromptTemplate` | `PromptTemplateEvent` | — |
25
+ | `onAgentStarted` | `AgentStartedEvent` | ✅ Yes |
26
+ | `onAgentFinished` | `AgentFinishedEvent` | — |
27
+ | `onAgentStepStarted` | `AgentStepStartedEvent` | — |
28
+ | `onAgentStepFinished` | `AgentStepFinishedEvent` | — |
29
+ | `onOptimizeMessages` | `OptimizeMessagesEvent` | — |
30
+ | `onImportantReminders` | `ImportantRemindersEvent` | — |
31
+ | `onInterrupted` | `InterruptedEvent` | ✅ Yes |
32
+ | `onToolApproval` | `ToolApprovalEvent` | ✅ Yes |
33
+ | `onToolCalled` | `ToolCalledEvent` | — |
34
+ | `onToolFinished` | `ToolFinishedEvent` | — |
35
+ | `onFilesAdded` | `FilesAddedEvent` | — |
36
+ | `onFilesDropped` | `FilesDroppedEvent` | — |
37
+ | `onRuleFilesRetrieved` | `RuleFilesRetrievedEvent` | — |
38
+ | `onResponseChunk` | `ResponseChunkEvent` | — |
39
+ | `onResponseCompleted` | `ResponseCompletedEvent` | — |
40
+ | `onHandleApproval` | `HandleApprovalEvent` | ✅ Yes |
41
+ | `onSubagentStarted` | `SubagentStartedEvent` | ✅ Yes |
42
+ | `onSubagentFinished` | `SubagentFinishedEvent` | — |
43
+ | `onQuestionAsked` | `QuestionAskedEvent` | — |
44
+ | `onQuestionAnswered` | `QuestionAnsweredEvent` | — |
45
+ | `onCommandExecuted` | `CommandExecutedEvent` | ✅ Yes |
46
+ | `onCustomCommandExecuted` | `CustomCommandExecutedEvent` | ✅ Yes |
47
+ | `onAiderPromptStarted` | `AiderPromptStartedEvent` | ✅ Yes |
48
+ | `onAiderPromptFinished` | `AiderPromptFinishedEvent` | — |
49
+ | `onBeforeCommit` | `BeforeCommitEvent` | ✅ Yes |
50
+ | `onAfterCommit` | `AfterCommitEvent` (read-only) | — |
51
+
52
+ ---
53
+
5
54
  ## Event Modification Modes
6
55
 
7
- | Mode | Events | Can Block | Can Modify |
8
- |------|--------|-----------|------------|
9
- | Read-Only | onTaskCreated, onTaskClosed, onFileAdded, etc. | No | No |
10
- | Blocking | onToolApproval, onToolCalled, onPromptSubmitted, onHandleApproval, onSubagentStarted | Yes | Some |
11
- | Modifying | onToolFinished, onResponseMessageProcessed, onAgentStarted | No | Yes |
56
+ Events with a `blocked?: boolean` field allow extensions to **block** the operation by returning `{ blocked: true }` from the handler. Events without `blocked` fields are still modifiable (non-readonly fields can be changed by returning a `Partial` result), but cannot prevent the operation.
57
+
58
+ | Capability | Events |
59
+ |---|---|
60
+ | **Can Block** (have `blocked?` field) | `PromptStartedEvent`, `AgentStartedEvent`, `InterruptedEvent`, `ToolApprovalEvent`, `ToolCalledEvent`, `HandleApprovalEvent`, `SubagentStartedEvent`, `CommandExecutedEvent`, `CustomCommandExecutedEvent`, `AiderPromptStartedEvent`, `BeforeCommitEvent` |
61
+ | **Read-Only** (all fields `readonly`) | `TaskInitializedEvent`, `TaskClosedEvent`, `ProjectStartedEvent`, `ProjectStoppedEvent`, `AfterCommitEvent` |
62
+
63
+ ---
64
+
65
+ ## Task Events
66
+
67
+ ### TaskCreatedEvent
68
+
69
+ Dispatched after a task is created.
70
+
71
+ ```typescript
72
+ interface TaskCreatedEvent {
73
+ task: TaskData;
74
+ }
75
+ ```
76
+
77
+ ### TaskPreparedEvent
78
+
79
+ Dispatched when a task is prepared (resources allocated, ready to initialize).
80
+
81
+ ```typescript
82
+ interface TaskPreparedEvent {
83
+ task: TaskData;
84
+ }
85
+ ```
86
+
87
+ ### TaskInitializedEvent
88
+
89
+ Dispatched after a task is initialized. All fields are read-only.
90
+
91
+ ```typescript
92
+ interface TaskInitializedEvent {
93
+ readonly task: TaskData;
94
+ }
95
+ ```
96
+
97
+ ### TaskClosedEvent
98
+
99
+ Dispatched when a task is closed. All fields are read-only.
100
+
101
+ ```typescript
102
+ interface TaskClosedEvent {
103
+ readonly task: TaskData;
104
+ }
105
+ ```
106
+
107
+ ### TaskUpdatedEvent
108
+
109
+ Dispatched whenever task data is updated.
110
+
111
+ ```typescript
112
+ interface TaskUpdatedEvent {
113
+ task: TaskData;
114
+ }
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Project Events
120
+
121
+ ### ProjectStartedEvent
122
+
123
+ Dispatched when a project is started/opened. All fields are read-only.
124
+
125
+ ```typescript
126
+ interface ProjectStartedEvent {
127
+ readonly baseDir: string;
128
+ }
129
+ ```
130
+
131
+ ### ProjectStoppedEvent
132
+
133
+ Dispatched when a project is stopped/closed. All fields are read-only.
134
+
135
+ ```typescript
136
+ interface ProjectStoppedEvent {
137
+ readonly baseDir: string;
138
+ }
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Prompt Events
144
+
145
+ ### PromptStartedEvent (Can Block)
146
+
147
+ Dispatched when a prompt is about to be submitted. Set `blocked: true` to prevent the prompt.
148
+
149
+ ```typescript
150
+ interface PromptStartedEvent {
151
+ prompt: string;
152
+ mode: Mode;
153
+ promptContext: PromptContext;
154
+ blocked?: boolean;
155
+ }
156
+ ```
157
+
158
+ ### PromptFinishedEvent
159
+
160
+ Dispatched after a prompt has been fully processed.
161
+
162
+ ```typescript
163
+ interface PromptFinishedEvent {
164
+ responses: ResponseCompletedData[];
165
+ }
166
+ ```
167
+
168
+ ### PromptTemplateEvent
169
+
170
+ Dispatched when a prompt template is rendered. Extensions can override the `prompt` field.
171
+
172
+ ```typescript
173
+ interface PromptTemplateEvent {
174
+ readonly name: string;
175
+ readonly data: unknown;
176
+ prompt: string;
177
+ }
178
+ ```
179
+
180
+ ---
12
181
 
13
182
  ## Agent Events
14
183
 
15
- ### AgentStartedEvent (Modifying)
184
+ ### AgentStartedEvent (Can Block)
185
+
186
+ Dispatched when the agent is about to start processing. Set `blocked: true` to prevent the agent from running.
16
187
 
17
188
  ```typescript
18
189
  interface AgentStartedEvent {
@@ -26,20 +197,45 @@ interface AgentStartedEvent {
26
197
  contextMessages: ContextMessage[];
27
198
  contextFiles: ContextFile[];
28
199
  blocked?: boolean;
200
+ images?: string[];
201
+ skillsToActivate?: string[];
202
+ /** Computed defaults on dispatch; returned overrides are merged with them. */
203
+ modelCallSettings?: ModelCallSettings;
29
204
  }
30
205
  ```
31
206
 
207
+ Use `modelCallSettings` to override AI SDK model-call parameters. The dispatched value includes computed defaults such as `maxRetries` and `abortSignal`; return only the settings to override.
208
+
32
209
  ### AgentFinishedEvent
33
210
 
211
+ Dispatched when the agent has finished processing.
212
+
34
213
  ```typescript
35
214
  interface AgentFinishedEvent {
36
215
  readonly mode: Mode;
37
- readonly agentProfile: AgentProfile;
216
+ readonly aborted: boolean;
217
+ readonly contextMessages: ContextMessage[];
38
218
  resultMessages: ContextMessage[];
39
219
  }
40
220
  ```
41
221
 
42
- ### AgentStepFinishedEvent (Modifying)
222
+ ### AgentStepStartedEvent
223
+
224
+ Dispatched at the start of each agent step/iteration.
225
+
226
+ ```typescript
227
+ interface AgentStepStartedEvent {
228
+ readonly mode: Mode;
229
+ readonly agentProfile: AgentProfile;
230
+ readonly currentResponseId: string;
231
+ readonly iterationCount: number;
232
+ messages: ContextMessage[];
233
+ }
234
+ ```
235
+
236
+ ### AgentStepFinishedEvent
237
+
238
+ Dispatched at the end of each agent step/iteration.
43
239
 
44
240
  ```typescript
45
241
  interface AgentStepFinishedEvent {
@@ -47,62 +243,181 @@ interface AgentStepFinishedEvent {
47
243
  readonly agentProfile: AgentProfile;
48
244
  readonly currentResponseId: string;
49
245
  readonly stepResult: AgentStepResult;
50
- finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | 'unknown';
246
+ finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
51
247
  responseMessages: ContextMessage[];
52
248
  }
53
249
  ```
54
250
 
251
+ ### OptimizeMessagesEvent
252
+
253
+ Dispatched during context message optimization. Extensions can provide optimized messages.
254
+
255
+ ```typescript
256
+ interface OptimizeMessagesEvent {
257
+ readonly originalMessages: ContextMessage[];
258
+ optimizedMessages: ContextMessage[];
259
+ }
260
+ ```
261
+
262
+ ### ImportantRemindersEvent
263
+
264
+ Dispatched when important reminders content is being assembled. Extensions can modify the reminders content.
265
+
266
+ ```typescript
267
+ interface ImportantRemindersEvent {
268
+ /** @deprecated Use `agentProfile` instead. Will be removed in a future version. */
269
+ readonly profile: AgentProfile;
270
+ readonly agentProfile: AgentProfile;
271
+ remindersContent: string;
272
+ }
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Interrupt Events
278
+
279
+ ### InterruptedEvent (Can Block)
280
+
281
+ Dispatched when an interrupt occurs. Set `blocked: true` to skip the default interrupt cleanup.
282
+
283
+ ```typescript
284
+ interface InterruptedEvent {
285
+ /** Optional interrupt ID for targeting a specific subagent or conflict-resolution agent */
286
+ interruptId?: string;
287
+ /** Set to true to skip the default interrupt cleanup */
288
+ blocked?: boolean;
289
+ }
290
+ ```
291
+
292
+ ---
293
+
55
294
  ## Tool Events
56
295
 
57
- ### ToolCalledEvent (Blocking)
296
+ ### ToolApprovalEvent (Can Block)
297
+
298
+ Dispatched when a tool requires approval. Set `blocked` to a boolean or string message to block; set `allowed: true` to auto-approve.
299
+
300
+ ```typescript
301
+ interface ToolApprovalEvent {
302
+ readonly toolName: string;
303
+ readonly input: Record<string, unknown> | undefined;
304
+ blocked?: boolean | string;
305
+ allowed?: boolean;
306
+ }
307
+ ```
308
+
309
+ ### ToolCalledEvent
310
+
311
+ Dispatched when a tool is about to be called. Extensions can modify `input` and `output`.
58
312
 
59
313
  ```typescript
60
314
  interface ToolCalledEvent {
61
- readonly tool: string;
62
- readonly toolInput: Record<string, unknown>;
315
+ readonly toolCallId: string;
316
+ readonly toolName: string;
63
317
  readonly agentProfile: AgentProfile;
64
- blocked?: boolean;
318
+ readonly abortSignal?: AbortSignal;
319
+ input: Record<string, unknown> | undefined;
320
+ output?: unknown;
65
321
  }
66
322
  ```
67
323
 
68
- ### ToolFinishedEvent (Modifying)
324
+ ### ToolFinishedEvent
325
+
326
+ Dispatched after a tool has finished executing. Extensions can modify `output`.
69
327
 
70
328
  ```typescript
71
329
  interface ToolFinishedEvent {
72
- readonly tool: string;
73
- readonly toolInput: Record<string, unknown>;
330
+ readonly toolCallId: string;
331
+ readonly toolName: string;
74
332
  readonly agentProfile: AgentProfile;
75
- toolResult: unknown;
76
- metadata?: Record<string, unknown>;
333
+ readonly input: Record<string, unknown> | undefined;
334
+ output: unknown;
77
335
  }
78
336
  ```
79
337
 
80
- ## Prompt Events
338
+ ---
339
+
340
+ ## File Events
341
+
342
+ ### FilesAddedEvent
81
343
 
82
- ### PromptSubmittedEvent (Blocking/Modifying)
344
+ Dispatched before files are added to the context. Extensions can modify the `files` array.
83
345
 
84
346
  ```typescript
85
- interface PromptSubmittedEvent {
86
- prompt: string;
87
- mode: Mode;
88
- promptContext: PromptContext;
89
- blocked?: boolean;
347
+ interface FilesAddedEvent {
348
+ files: ContextFile[];
90
349
  }
91
350
  ```
92
351
 
93
- ## File Events
352
+ ### FilesDroppedEvent
94
353
 
95
- ### FileAddedEvent
354
+ Dispatched before files are dropped from the context. Extensions can modify the `files` array.
96
355
 
97
356
  ```typescript
98
- interface FileAddedEvent {
99
- files: string[];
357
+ interface FilesDroppedEvent {
358
+ files: ContextFile[];
100
359
  }
101
360
  ```
102
361
 
362
+ ### RuleFilesRetrievedEvent
363
+
364
+ Dispatched when rule files are retrieved. Extensions can modify the `files` array.
365
+
366
+ ```typescript
367
+ interface RuleFilesRetrievedEvent {
368
+ files: ContextFile[];
369
+ }
370
+ ```
371
+
372
+ ---
373
+
374
+ ## Message Events
375
+
376
+ ### ResponseChunkEvent
377
+
378
+ Dispatched for each response chunk (streaming).
379
+
380
+ ```typescript
381
+ interface ResponseChunkEvent {
382
+ chunk: ResponseChunkData;
383
+ }
384
+ ```
385
+
386
+ ### ResponseCompletedEvent
387
+
388
+ Dispatched when a response is completed.
389
+
390
+ ```typescript
391
+ interface ResponseCompletedEvent {
392
+ response: ResponseCompletedData;
393
+ }
394
+ ```
395
+
396
+ ---
397
+
398
+ ## Approval Events
399
+
400
+ ### HandleApprovalEvent (Can Block)
401
+
402
+ Dispatched when an approval dialog is about to be shown. Set `blocked: true` to prevent the dialog, or `allowed: true` to auto-approve.
403
+
404
+ ```typescript
405
+ interface HandleApprovalEvent {
406
+ key: string;
407
+ text: string;
408
+ subject?: string;
409
+ blocked?: boolean;
410
+ allowed?: boolean;
411
+ }
412
+ ```
413
+
414
+ ---
415
+
103
416
  ## Subagent Events
104
417
 
105
- ### SubagentStartedEvent (Blocking/Modifying)
418
+ ### SubagentStartedEvent (Can Block)
419
+
420
+ Dispatched when a subagent is about to start. Set `blocked: true` to prevent the subagent from launching.
106
421
 
107
422
  ```typescript
108
423
  interface SubagentStartedEvent {
@@ -116,41 +431,254 @@ interface SubagentStartedEvent {
116
431
  }
117
432
  ```
118
433
 
434
+ ### SubagentFinishedEvent
435
+
436
+ Dispatched when a subagent has finished.
437
+
438
+ ```typescript
439
+ interface SubagentFinishedEvent {
440
+ readonly subagentProfile: AgentProfile;
441
+ resultMessages: ContextMessage[];
442
+ }
443
+ ```
444
+
445
+ ---
446
+
447
+ ## Question Events
448
+
449
+ ### QuestionAskedEvent
450
+
451
+ Dispatched when a question is asked to the user. Extensions can set `answer` to auto-answer.
452
+
453
+ ```typescript
454
+ interface QuestionAskedEvent {
455
+ question: QuestionData;
456
+ readonly storedAnswer?: string;
457
+ answer?: string;
458
+ }
459
+ ```
460
+
461
+ ### QuestionAnsweredEvent
462
+
463
+ Dispatched after a question has been answered.
464
+
465
+ ```typescript
466
+ interface QuestionAnsweredEvent {
467
+ readonly question: QuestionData;
468
+ answer: string;
469
+ userInput?: string;
470
+ }
471
+ ```
472
+
473
+ ---
474
+
475
+ ## Command Events
476
+
477
+ ### CommandExecutedEvent (Can Block)
478
+
479
+ Dispatched when a command is about to be executed. Set `blocked: true` to prevent execution.
480
+
481
+ ```typescript
482
+ interface CommandExecutedEvent {
483
+ command: string;
484
+ blocked?: boolean;
485
+ }
486
+ ```
487
+
488
+ ### CustomCommandExecutedEvent (Can Block)
489
+
490
+ Dispatched when a custom command is about to be executed. Set `blocked: true` to prevent execution.
491
+
492
+ ```typescript
493
+ interface CustomCommandExecutedEvent {
494
+ command: CustomCommand;
495
+ mode: Mode;
496
+ blocked?: boolean;
497
+ prompt?: string;
498
+ }
499
+ ```
500
+
501
+ ---
502
+
503
+ ## Aider Events (Legacy)
504
+
505
+ These events are dispatched for backward compatibility with the Aider connector.
506
+
507
+ ### AiderPromptStartedEvent (Can Block)
508
+
509
+ Dispatched when an Aider prompt is about to start. Set `blocked: true` to prevent it.
510
+
511
+ ```typescript
512
+ interface AiderPromptStartedEvent {
513
+ prompt: string;
514
+ mode: Mode;
515
+ promptContext: PromptContext;
516
+ messages: ConnectorMessage[];
517
+ files: ContextFile[];
518
+ blocked?: boolean;
519
+ autonomyMode?: AutonomyMode;
520
+ denyCommands?: boolean;
521
+ }
522
+ ```
523
+
524
+ ### AiderPromptFinishedEvent
525
+
526
+ Dispatched after an Aider prompt has finished.
527
+
528
+ ```typescript
529
+ interface AiderPromptFinishedEvent {
530
+ responses: ResponseCompletedData[];
531
+ }
532
+ ```
533
+
534
+ ---
535
+
536
+ ## Commit Events
537
+
538
+ ### BeforeCommitEvent (Can Block)
539
+
540
+ Dispatched before a git commit is made. Set `blocked: true` to prevent the commit.
541
+
542
+ ```typescript
543
+ interface BeforeCommitEvent {
544
+ message: string;
545
+ amend: boolean;
546
+ blocked?: boolean;
547
+ }
548
+ ```
549
+
550
+ ### AfterCommitEvent (Read-Only)
551
+
552
+ Dispatched after a git commit is made. This event is read-only — handlers return `Promise<void>`.
553
+
554
+ ```typescript
555
+ interface AfterCommitEvent {
556
+ readonly message: string;
557
+ readonly amend: boolean;
558
+ }
559
+ ```
560
+
561
+ ---
562
+
119
563
  ## Common Patterns
120
564
 
121
565
  ### Blocking Execution
122
566
 
567
+ Block dangerous tool calls by setting `blocked: true`:
568
+
569
+ ```typescript
570
+ async onToolApproval(
571
+ event: ToolApprovalEvent,
572
+ context: ExtensionContext
573
+ ): Promise<Partial<ToolApprovalEvent>> {
574
+ if (event.toolName === 'power---bash' && isDangerous(event.input)) {
575
+ return { blocked: 'This command requires manual approval.' };
576
+ }
577
+ return {};
578
+ }
579
+ ```
580
+
581
+ ### Blocking Prompts
582
+
583
+ Block a prompt from being submitted:
584
+
123
585
  ```typescript
124
- async onToolCalled(event: ToolCalledEvent): Promise<Partial<ToolCalledEvent>> {
125
- if (event.tool === 'power---bash' && isDangerous(event.toolInput)) {
586
+ async onPromptStarted(
587
+ event: PromptStartedEvent,
588
+ context: ExtensionContext
589
+ ): Promise<Partial<PromptStartedEvent>> {
590
+ if (containsSecrets(event.prompt)) {
126
591
  return { blocked: true };
127
592
  }
128
593
  return {};
129
594
  }
130
595
  ```
131
596
 
132
- ### Modifying Messages
597
+ ### Modifying Context Messages
598
+
599
+ Add a custom system instruction when the agent starts:
133
600
 
134
601
  ```typescript
135
- async onAgentStarted(event: AgentStartedEvent): Promise<Partial<AgentStartedEvent>> {
602
+ async onAgentStarted(
603
+ event: AgentStartedEvent,
604
+ context: ExtensionContext
605
+ ): Promise<Partial<AgentStartedEvent>> {
136
606
  return {
137
607
  contextMessages: [
138
- { id: 'custom', role: 'user', content: 'Custom instruction' },
139
- ...event.contextMessages
140
- ]
608
+ { id: 'custom', role: 'user', content: 'Always use TypeScript.' },
609
+ ...event.contextMessages,
610
+ ],
141
611
  };
142
612
  }
143
613
  ```
144
614
 
145
615
  ### Modifying Profile
146
616
 
617
+ Override agent profile fields when the agent starts:
618
+
147
619
  ```typescript
148
- async onAgentStarted(event: AgentStartedEvent): Promise<Partial<AgentStartedEvent>> {
620
+ async onAgentStarted(
621
+ event: AgentStartedEvent,
622
+ context: ExtensionContext
623
+ ): Promise<Partial<AgentStartedEvent>> {
149
624
  return {
150
625
  agentProfile: {
151
626
  ...event.agentProfile,
152
- includeRepoMap: false
153
- }
627
+ includeRepoMap: false,
628
+ },
629
+ };
630
+ }
631
+ ```
632
+
633
+ ### Overriding Model Call Settings
634
+
635
+ Override AI SDK model-call parameters when the agent starts. Return only the values to change; they are merged with the computed defaults in `event.modelCallSettings`.
636
+
637
+ ```typescript
638
+ async onAgentStarted(
639
+ event: AgentStartedEvent,
640
+ context: ExtensionContext
641
+ ): Promise<Partial<AgentStartedEvent>> {
642
+ return {
643
+ modelCallSettings: {
644
+ temperature: 0.2,
645
+ maxOutputTokens: 4096,
646
+ timeout: { totalMs: 120_000 },
647
+ },
154
648
  };
155
649
  }
156
650
  ```
651
+
652
+ Use either `temperature` or `topP` for sampling. Set `reasoning` to use AI SDK's portable reasoning control, which takes precedence over provider-specific reasoning options.
653
+
654
+ ### Modifying Files
655
+
656
+ Add or filter context files before they are added:
657
+
658
+ ```typescript
659
+ async onFilesAdded(
660
+ event: FilesAddedEvent,
661
+ context: ExtensionContext
662
+ ): Promise<Partial<FilesAddedEvent>> {
663
+ // Filter out generated files from being added
664
+ return {
665
+ files: event.files.filter((f) => !f.path.includes('node_modules')),
666
+ };
667
+ }
668
+ ```
669
+
670
+ ### Overriding Prompt Templates
671
+
672
+ Override the rendered output of a prompt template:
673
+
674
+ ```typescript
675
+ async onPromptTemplate(
676
+ event: PromptTemplateEvent,
677
+ context: ExtensionContext
678
+ ): Promise<Partial<PromptTemplateEvent>> {
679
+ if (event.name === 'system-prompt') {
680
+ return { prompt: event.prompt + '\n\nAdditional rules...' };
681
+ }
682
+ return {};
683
+ }
684
+ ```