@aiderdesk/aiderdesk 0.74.0 → 0.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/{open-telemetry-baOvr6sK.js → open-telemetry-B7yROZIC.js} +3 -0
- package/out/renderer/assets/{AgentSettings-B-793Wr6.js → AgentSettings-DX34HLFv.js} +2 -2
- package/out/renderer/assets/{InfoIcon-cuLXzJtV.js → InfoIcon-DzyZQ7Ye.js} +1 -1
- package/out/renderer/assets/{Onboarding-xrPWRnXm.js → Onboarding-FwXfKZ8B.js} +4 -4
- package/out/renderer/assets/{ProviderHeader-CMVyqpPa.js → ProviderHeader-Cii9aAmV.js} +275 -197
- package/out/renderer/assets/{SettingsPage-BBtDhv80.js → SettingsPage-XanGltUZ.js} +3 -3
- package/out/renderer/assets/{UsageDashboard-CGI4iwCD.js → UsageDashboard-eHbvZTZC.js} +3795 -2366
- package/out/renderer/assets/{arc-CFENq1wJ.js → arc-CVfdiTl1.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-3BPJPVTR-BRG_9Mao.js → architectureDiagram-3BPJPVTR-DsLLo_Ek.js} +3 -3
- package/out/renderer/assets/{blockDiagram-GPEHLZMM-B3c7WMY4.js → blockDiagram-GPEHLZMM-eWy47S0_.js} +4 -4
- package/out/renderer/assets/{c4Diagram-AAUBKEIU-BYQrxMcW.js → c4Diagram-AAUBKEIU-BH9b_e6y.js} +2 -2
- package/out/renderer/assets/{channel-DPxL1rpa.js → channel-D1z_mPGJ.js} +1 -1
- package/out/renderer/assets/{chunk-2J33WTMH-C-kk05Nj.js → chunk-2J33WTMH-DK0Yw_7f.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-BV8PWxnG.js → chunk-4BX2VUAB-DIGR8Y5b.js} +1 -1
- package/out/renderer/assets/{chunk-55IACEB6-Cj6KHkUp.js → chunk-55IACEB6-DoCkLI5e.js} +1 -1
- package/out/renderer/assets/{chunk-727SXJPM-BaIkuSPr.js → chunk-727SXJPM-C2gQLzLi.js} +5 -5
- package/out/renderer/assets/{chunk-AQP2D5EJ-DVZR_bfB.js → chunk-AQP2D5EJ-D83_SlRR.js} +3 -3
- package/out/renderer/assets/{chunk-FMBD7UC4-CNrb2a0a.js → chunk-FMBD7UC4-CyiPoUsC.js} +1 -1
- package/out/renderer/assets/{chunk-ND2GUHAM-ClOnPDjy.js → chunk-ND2GUHAM-DfGsUYDD.js} +1 -1
- package/out/renderer/assets/{chunk-QZHKN3VN-B2sJx9j2.js → chunk-QZHKN3VN-BhnTFlht.js} +1 -1
- package/out/renderer/assets/{classDiagram-4FO5ZUOK-ZzwWMcLO.js → classDiagram-4FO5ZUOK-Dy7E8tVe.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-ZzwWMcLO.js → classDiagram-v2-Q7XG4LA2-Dy7E8tVe.js} +6 -6
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-DBx-UiMU.js → cose-bilkent-S5V4N54A-Dsl61WN3.js} +1 -1
- package/out/renderer/assets/{dagre-BM42HDAG-B_vMvYpz.js → dagre-BM42HDAG-D-u18G94.js} +3 -3
- package/out/renderer/assets/{diagram-2AECGRRQ-Do-w2xXO.js → diagram-2AECGRRQ-BumP49Qp.js} +3 -3
- package/out/renderer/assets/{diagram-5GNKFQAL-JzG77sgb.js → diagram-5GNKFQAL-VpUN87Sw.js} +4 -4
- package/out/renderer/assets/{diagram-KO2AKTUF-CGMx2nPP.js → diagram-KO2AKTUF-CXCWwzRa.js} +3 -3
- package/out/renderer/assets/{diagram-LMA3HP47-BqXnQeNu.js → diagram-LMA3HP47-vlOcStwn.js} +3 -3
- package/out/renderer/assets/{diagram-OG6HWLK6-BR4e0lIb.js → diagram-OG6HWLK6-DS1BscxN.js} +4 -4
- package/out/renderer/assets/{erDiagram-TEJ5UH35-B7QK0XSy.js → erDiagram-TEJ5UH35-DPi6-CLL.js} +4 -4
- package/out/renderer/assets/{flowDiagram-I6XJVG4X-BOySqejA.js → flowDiagram-I6XJVG4X-BYlX12Cd.js} +6 -6
- package/out/renderer/assets/{ganttDiagram-6RSMTGT7-BORAleML.js → ganttDiagram-6RSMTGT7-BJQl-A9d.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-DTReLiJT.js → gitGraphDiagram-PVQCEYII-CUFXx3IZ.js} +4 -4
- package/out/renderer/assets/{graph-Bf8U9r0n.js → graph-CbFubTTc.js} +1 -1
- package/out/renderer/assets/{index-BS5vy5uH.js → index-9GNr8q1O.js} +1 -1
- package/out/renderer/assets/{index-DUoUqcJ_.js → index-B6R_BNfE.js} +1 -1
- package/out/renderer/assets/{index-D3R9tjiT.js → index-B9iW9QmT.js} +1 -1
- package/out/renderer/assets/{index-D6b3rMtW.js → index-BkdacTnN.js} +1 -1
- package/out/renderer/assets/{index-CmQY2QKE.js → index-C7885gEz.js} +1 -1
- package/out/renderer/assets/{index-BOQBc3Qj.js → index-Cg7tn967.js} +575 -251
- package/out/renderer/assets/{index-7NwOg_q_.css → index-DCILJy4w.css} +42 -0
- package/out/renderer/assets/{index-Dq3ldCAy.js → index-DNlMJMPg.js} +3239 -2487
- package/out/renderer/assets/{index-COyr1I0o.js → index-DYKLRIHT.js} +1 -1
- package/out/renderer/assets/{index-5i67azF0.js → index-DeoI6jti.js} +1 -1
- package/out/renderer/assets/{index-Dtxgil7l.js → index-fD843lMX.js} +1 -1
- package/out/renderer/assets/{infoDiagram-5YYISTIA-Ryv-Emth.js → infoDiagram-5YYISTIA-IWJLFUYz.js} +2 -2
- package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-Blzp6JLN.js → ishikawaDiagram-YF4QCWOH-BuNfm7cB.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-JHISSGLW--KB4ASET.js → journeyDiagram-JHISSGLW-CfceKUHO.js} +4 -4
- package/out/renderer/assets/{jsx-dev-runtime-DAzw_Red.js → jsx-dev-runtime-DT3FTts0.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UN3LZRKU-BzNpCu_x.js → kanban-definition-UN3LZRKU-Bb6YnEgS.js} +2 -2
- package/out/renderer/assets/{layout-BQu4M-KW.js → layout-BkrDn6V9.js} +2 -2
- package/out/renderer/assets/{linear-DNZEF2Al.js → linear-jxO_dc8P.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-RKZ34NQL-CxQjZIps.js → mindmap-definition-RKZ34NQL-BPRx7p9A.js} +3 -3
- package/out/renderer/assets/{pieDiagram-4H26LBE5-qJt7eGwM.js → pieDiagram-4H26LBE5-CPR4AuPM.js} +4 -4
- package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-mMOhLjN_.js → quadrantDiagram-W4KKPZXB-BKzlAr7m.js} +2 -2
- package/out/renderer/assets/{requirementDiagram-4Y6WPE33-GLhMtLW7.js → requirementDiagram-4Y6WPE33-CUan3EZI.js} +3 -3
- package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-Kcd8qR8y.js → sankeyDiagram-5OEKKPKP-y8X8qnX2.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-CpmBIgMJ.js → sequenceDiagram-3UESZ5HK-B4xv8iDW.js} +3 -3
- package/out/renderer/assets/{stateDiagram-AJRCARHV-D00qZ9cQ.js → stateDiagram-AJRCARHV-DTPE2Z4L.js} +6 -6
- package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-CkEgNJrB.js → stateDiagram-v2-BHNVJYJU-BmZ9o6q3.js} +4 -4
- package/out/renderer/assets/{time-CQSoUo1N.js → time-D391Z6zp.js} +1 -1
- package/out/renderer/assets/{timeline-definition-PNZ67QCA-CmydTbH6.js → timeline-definition-PNZ67QCA-DVLUB2HD.js} +2 -2
- package/out/renderer/assets/{vennDiagram-CIIHVFJN-B4QGhnvI.js → vennDiagram-CIIHVFJN-BGGBlVN1.js} +1 -1
- package/out/renderer/assets/{wardley-L42UT6IY-B-mpW52K.js → wardley-L42UT6IY-ZVVSjQUD.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-Cz1pK1MY.js → wardleyDiagram-YWT4CUSO-CRAH-LRw.js} +3 -3
- package/out/renderer/assets/{xychartDiagram-2RQKCTM6-H-Q9Zv48.js → xychartDiagram-2RQKCTM6-DQqvm7M3.js} +2 -2
- package/out/renderer/index.html +2 -2
- package/out/resources/linux/probe +0 -0
- package/out/resources/linux-x64/probe +0 -0
- package/out/resources/skills/extension-creator/SKILL.md +71 -7
- package/out/resources/skills/extension-creator/references/event-types.md +543 -40
- package/out/resources/skills/extension-creator/references/examples-gallery.md +23 -14
- package/out/resources/skills/extension-creator/references/extension-interface.md +1111 -171
- package/out/resources/skills/extension-creator/references/ui-components.md +34 -6
- package/out/runner.js +428 -320
- package/package.json +21 -19
- package/patches/@requesty+ai-sdk+3.5.0.patch +84 -0
- package/patches/ai+7.0.28.patch +33 -0
- package/patches/ai+5.0.195.patch +0 -33
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
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 (
|
|
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,41 @@ interface AgentStartedEvent {
|
|
|
26
197
|
contextMessages: ContextMessage[];
|
|
27
198
|
contextFiles: ContextFile[];
|
|
28
199
|
blocked?: boolean;
|
|
200
|
+
images?: string[];
|
|
201
|
+
skillsToActivate?: string[];
|
|
29
202
|
}
|
|
30
203
|
```
|
|
31
204
|
|
|
32
205
|
### AgentFinishedEvent
|
|
33
206
|
|
|
207
|
+
Dispatched when the agent has finished processing.
|
|
208
|
+
|
|
34
209
|
```typescript
|
|
35
210
|
interface AgentFinishedEvent {
|
|
36
211
|
readonly mode: Mode;
|
|
37
|
-
readonly
|
|
212
|
+
readonly aborted: boolean;
|
|
213
|
+
readonly contextMessages: ContextMessage[];
|
|
38
214
|
resultMessages: ContextMessage[];
|
|
39
215
|
}
|
|
40
216
|
```
|
|
41
217
|
|
|
42
|
-
###
|
|
218
|
+
### AgentStepStartedEvent
|
|
219
|
+
|
|
220
|
+
Dispatched at the start of each agent step/iteration.
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
interface AgentStepStartedEvent {
|
|
224
|
+
readonly mode: Mode;
|
|
225
|
+
readonly agentProfile: AgentProfile;
|
|
226
|
+
readonly currentResponseId: string;
|
|
227
|
+
readonly iterationCount: number;
|
|
228
|
+
messages: ContextMessage[];
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### AgentStepFinishedEvent
|
|
233
|
+
|
|
234
|
+
Dispatched at the end of each agent step/iteration.
|
|
43
235
|
|
|
44
236
|
```typescript
|
|
45
237
|
interface AgentStepFinishedEvent {
|
|
@@ -47,62 +239,181 @@ interface AgentStepFinishedEvent {
|
|
|
47
239
|
readonly agentProfile: AgentProfile;
|
|
48
240
|
readonly currentResponseId: string;
|
|
49
241
|
readonly stepResult: AgentStepResult;
|
|
50
|
-
finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other'
|
|
242
|
+
finishReason: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
|
|
51
243
|
responseMessages: ContextMessage[];
|
|
52
244
|
}
|
|
53
245
|
```
|
|
54
246
|
|
|
247
|
+
### OptimizeMessagesEvent
|
|
248
|
+
|
|
249
|
+
Dispatched during context message optimization. Extensions can provide optimized messages.
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
interface OptimizeMessagesEvent {
|
|
253
|
+
readonly originalMessages: ContextMessage[];
|
|
254
|
+
optimizedMessages: ContextMessage[];
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### ImportantRemindersEvent
|
|
259
|
+
|
|
260
|
+
Dispatched when important reminders content is being assembled. Extensions can modify the reminders content.
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
interface ImportantRemindersEvent {
|
|
264
|
+
/** @deprecated Use `agentProfile` instead. Will be removed in a future version. */
|
|
265
|
+
readonly profile: AgentProfile;
|
|
266
|
+
readonly agentProfile: AgentProfile;
|
|
267
|
+
remindersContent: string;
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Interrupt Events
|
|
274
|
+
|
|
275
|
+
### InterruptedEvent (Can Block)
|
|
276
|
+
|
|
277
|
+
Dispatched when an interrupt occurs. Set `blocked: true` to skip the default interrupt cleanup.
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
interface InterruptedEvent {
|
|
281
|
+
/** Optional interrupt ID for targeting a specific subagent or conflict-resolution agent */
|
|
282
|
+
interruptId?: string;
|
|
283
|
+
/** Set to true to skip the default interrupt cleanup */
|
|
284
|
+
blocked?: boolean;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
55
290
|
## Tool Events
|
|
56
291
|
|
|
57
|
-
###
|
|
292
|
+
### ToolApprovalEvent (Can Block)
|
|
293
|
+
|
|
294
|
+
Dispatched when a tool requires approval. Set `blocked` to a boolean or string message to block; set `allowed: true` to auto-approve.
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
interface ToolApprovalEvent {
|
|
298
|
+
readonly toolName: string;
|
|
299
|
+
readonly input: Record<string, unknown> | undefined;
|
|
300
|
+
blocked?: boolean | string;
|
|
301
|
+
allowed?: boolean;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### ToolCalledEvent
|
|
306
|
+
|
|
307
|
+
Dispatched when a tool is about to be called. Extensions can modify `input` and `output`.
|
|
58
308
|
|
|
59
309
|
```typescript
|
|
60
310
|
interface ToolCalledEvent {
|
|
61
|
-
readonly
|
|
62
|
-
readonly
|
|
311
|
+
readonly toolCallId: string;
|
|
312
|
+
readonly toolName: string;
|
|
63
313
|
readonly agentProfile: AgentProfile;
|
|
64
|
-
|
|
314
|
+
readonly abortSignal?: AbortSignal;
|
|
315
|
+
input: Record<string, unknown> | undefined;
|
|
316
|
+
output?: unknown;
|
|
65
317
|
}
|
|
66
318
|
```
|
|
67
319
|
|
|
68
|
-
### ToolFinishedEvent
|
|
320
|
+
### ToolFinishedEvent
|
|
321
|
+
|
|
322
|
+
Dispatched after a tool has finished executing. Extensions can modify `output`.
|
|
69
323
|
|
|
70
324
|
```typescript
|
|
71
325
|
interface ToolFinishedEvent {
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
326
|
+
readonly toolCallId: string;
|
|
327
|
+
readonly toolName: string;
|
|
74
328
|
readonly agentProfile: AgentProfile;
|
|
75
|
-
|
|
76
|
-
|
|
329
|
+
readonly input: Record<string, unknown> | undefined;
|
|
330
|
+
output: unknown;
|
|
77
331
|
}
|
|
78
332
|
```
|
|
79
333
|
|
|
80
|
-
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## File Events
|
|
337
|
+
|
|
338
|
+
### FilesAddedEvent
|
|
81
339
|
|
|
82
|
-
|
|
340
|
+
Dispatched before files are added to the context. Extensions can modify the `files` array.
|
|
83
341
|
|
|
84
342
|
```typescript
|
|
85
|
-
interface
|
|
86
|
-
|
|
87
|
-
mode: Mode;
|
|
88
|
-
promptContext: PromptContext;
|
|
89
|
-
blocked?: boolean;
|
|
343
|
+
interface FilesAddedEvent {
|
|
344
|
+
files: ContextFile[];
|
|
90
345
|
}
|
|
91
346
|
```
|
|
92
347
|
|
|
93
|
-
|
|
348
|
+
### FilesDroppedEvent
|
|
94
349
|
|
|
95
|
-
|
|
350
|
+
Dispatched before files are dropped from the context. Extensions can modify the `files` array.
|
|
96
351
|
|
|
97
352
|
```typescript
|
|
98
|
-
interface
|
|
99
|
-
files:
|
|
353
|
+
interface FilesDroppedEvent {
|
|
354
|
+
files: ContextFile[];
|
|
100
355
|
}
|
|
101
356
|
```
|
|
102
357
|
|
|
358
|
+
### RuleFilesRetrievedEvent
|
|
359
|
+
|
|
360
|
+
Dispatched when rule files are retrieved. Extensions can modify the `files` array.
|
|
361
|
+
|
|
362
|
+
```typescript
|
|
363
|
+
interface RuleFilesRetrievedEvent {
|
|
364
|
+
files: ContextFile[];
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Message Events
|
|
371
|
+
|
|
372
|
+
### ResponseChunkEvent
|
|
373
|
+
|
|
374
|
+
Dispatched for each response chunk (streaming).
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
interface ResponseChunkEvent {
|
|
378
|
+
chunk: ResponseChunkData;
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### ResponseCompletedEvent
|
|
383
|
+
|
|
384
|
+
Dispatched when a response is completed.
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
interface ResponseCompletedEvent {
|
|
388
|
+
response: ResponseCompletedData;
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Approval Events
|
|
395
|
+
|
|
396
|
+
### HandleApprovalEvent (Can Block)
|
|
397
|
+
|
|
398
|
+
Dispatched when an approval dialog is about to be shown. Set `blocked: true` to prevent the dialog, or `allowed: true` to auto-approve.
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
interface HandleApprovalEvent {
|
|
402
|
+
key: string;
|
|
403
|
+
text: string;
|
|
404
|
+
subject?: string;
|
|
405
|
+
blocked?: boolean;
|
|
406
|
+
allowed?: boolean;
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
103
412
|
## Subagent Events
|
|
104
413
|
|
|
105
|
-
### SubagentStartedEvent (
|
|
414
|
+
### SubagentStartedEvent (Can Block)
|
|
415
|
+
|
|
416
|
+
Dispatched when a subagent is about to start. Set `blocked: true` to prevent the subagent from launching.
|
|
106
417
|
|
|
107
418
|
```typescript
|
|
108
419
|
interface SubagentStartedEvent {
|
|
@@ -116,41 +427,233 @@ interface SubagentStartedEvent {
|
|
|
116
427
|
}
|
|
117
428
|
```
|
|
118
429
|
|
|
430
|
+
### SubagentFinishedEvent
|
|
431
|
+
|
|
432
|
+
Dispatched when a subagent has finished.
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
interface SubagentFinishedEvent {
|
|
436
|
+
readonly subagentProfile: AgentProfile;
|
|
437
|
+
resultMessages: ContextMessage[];
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Question Events
|
|
444
|
+
|
|
445
|
+
### QuestionAskedEvent
|
|
446
|
+
|
|
447
|
+
Dispatched when a question is asked to the user. Extensions can set `answer` to auto-answer.
|
|
448
|
+
|
|
449
|
+
```typescript
|
|
450
|
+
interface QuestionAskedEvent {
|
|
451
|
+
question: QuestionData;
|
|
452
|
+
readonly storedAnswer?: string;
|
|
453
|
+
answer?: string;
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### QuestionAnsweredEvent
|
|
458
|
+
|
|
459
|
+
Dispatched after a question has been answered.
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
interface QuestionAnsweredEvent {
|
|
463
|
+
readonly question: QuestionData;
|
|
464
|
+
answer: string;
|
|
465
|
+
userInput?: string;
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## Command Events
|
|
472
|
+
|
|
473
|
+
### CommandExecutedEvent (Can Block)
|
|
474
|
+
|
|
475
|
+
Dispatched when a command is about to be executed. Set `blocked: true` to prevent execution.
|
|
476
|
+
|
|
477
|
+
```typescript
|
|
478
|
+
interface CommandExecutedEvent {
|
|
479
|
+
command: string;
|
|
480
|
+
blocked?: boolean;
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### CustomCommandExecutedEvent (Can Block)
|
|
485
|
+
|
|
486
|
+
Dispatched when a custom command is about to be executed. Set `blocked: true` to prevent execution.
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
interface CustomCommandExecutedEvent {
|
|
490
|
+
command: CustomCommand;
|
|
491
|
+
mode: Mode;
|
|
492
|
+
blocked?: boolean;
|
|
493
|
+
prompt?: string;
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Aider Events (Legacy)
|
|
500
|
+
|
|
501
|
+
These events are dispatched for backward compatibility with the Aider connector.
|
|
502
|
+
|
|
503
|
+
### AiderPromptStartedEvent (Can Block)
|
|
504
|
+
|
|
505
|
+
Dispatched when an Aider prompt is about to start. Set `blocked: true` to prevent it.
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
interface AiderPromptStartedEvent {
|
|
509
|
+
prompt: string;
|
|
510
|
+
mode: Mode;
|
|
511
|
+
promptContext: PromptContext;
|
|
512
|
+
messages: ConnectorMessage[];
|
|
513
|
+
files: ContextFile[];
|
|
514
|
+
blocked?: boolean;
|
|
515
|
+
autonomyMode?: AutonomyMode;
|
|
516
|
+
denyCommands?: boolean;
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
### AiderPromptFinishedEvent
|
|
521
|
+
|
|
522
|
+
Dispatched after an Aider prompt has finished.
|
|
523
|
+
|
|
524
|
+
```typescript
|
|
525
|
+
interface AiderPromptFinishedEvent {
|
|
526
|
+
responses: ResponseCompletedData[];
|
|
527
|
+
}
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## Commit Events
|
|
533
|
+
|
|
534
|
+
### BeforeCommitEvent (Can Block)
|
|
535
|
+
|
|
536
|
+
Dispatched before a git commit is made. Set `blocked: true` to prevent the commit.
|
|
537
|
+
|
|
538
|
+
```typescript
|
|
539
|
+
interface BeforeCommitEvent {
|
|
540
|
+
message: string;
|
|
541
|
+
amend: boolean;
|
|
542
|
+
blocked?: boolean;
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### AfterCommitEvent (Read-Only)
|
|
547
|
+
|
|
548
|
+
Dispatched after a git commit is made. This event is read-only — handlers return `Promise<void>`.
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
interface AfterCommitEvent {
|
|
552
|
+
readonly message: string;
|
|
553
|
+
readonly amend: boolean;
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
119
559
|
## Common Patterns
|
|
120
560
|
|
|
121
561
|
### Blocking Execution
|
|
122
562
|
|
|
563
|
+
Block dangerous tool calls by setting `blocked: true`:
|
|
564
|
+
|
|
123
565
|
```typescript
|
|
124
|
-
async
|
|
125
|
-
|
|
566
|
+
async onToolApproval(
|
|
567
|
+
event: ToolApprovalEvent,
|
|
568
|
+
context: ExtensionContext
|
|
569
|
+
): Promise<Partial<ToolApprovalEvent>> {
|
|
570
|
+
if (event.toolName === 'power---bash' && isDangerous(event.input)) {
|
|
571
|
+
return { blocked: 'This command requires manual approval.' };
|
|
572
|
+
}
|
|
573
|
+
return {};
|
|
574
|
+
}
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
### Blocking Prompts
|
|
578
|
+
|
|
579
|
+
Block a prompt from being submitted:
|
|
580
|
+
|
|
581
|
+
```typescript
|
|
582
|
+
async onPromptStarted(
|
|
583
|
+
event: PromptStartedEvent,
|
|
584
|
+
context: ExtensionContext
|
|
585
|
+
): Promise<Partial<PromptStartedEvent>> {
|
|
586
|
+
if (containsSecrets(event.prompt)) {
|
|
126
587
|
return { blocked: true };
|
|
127
588
|
}
|
|
128
589
|
return {};
|
|
129
590
|
}
|
|
130
591
|
```
|
|
131
592
|
|
|
132
|
-
### Modifying Messages
|
|
593
|
+
### Modifying Context Messages
|
|
594
|
+
|
|
595
|
+
Add a custom system instruction when the agent starts:
|
|
133
596
|
|
|
134
597
|
```typescript
|
|
135
|
-
async onAgentStarted(
|
|
598
|
+
async onAgentStarted(
|
|
599
|
+
event: AgentStartedEvent,
|
|
600
|
+
context: ExtensionContext
|
|
601
|
+
): Promise<Partial<AgentStartedEvent>> {
|
|
136
602
|
return {
|
|
137
603
|
contextMessages: [
|
|
138
|
-
{ id: 'custom', role: 'user', content: '
|
|
139
|
-
...event.contextMessages
|
|
140
|
-
]
|
|
604
|
+
{ id: 'custom', role: 'user', content: 'Always use TypeScript.' },
|
|
605
|
+
...event.contextMessages,
|
|
606
|
+
],
|
|
141
607
|
};
|
|
142
608
|
}
|
|
143
609
|
```
|
|
144
610
|
|
|
145
611
|
### Modifying Profile
|
|
146
612
|
|
|
613
|
+
Override agent profile fields when the agent starts:
|
|
614
|
+
|
|
147
615
|
```typescript
|
|
148
|
-
async onAgentStarted(
|
|
616
|
+
async onAgentStarted(
|
|
617
|
+
event: AgentStartedEvent,
|
|
618
|
+
context: ExtensionContext
|
|
619
|
+
): Promise<Partial<AgentStartedEvent>> {
|
|
149
620
|
return {
|
|
150
621
|
agentProfile: {
|
|
151
622
|
...event.agentProfile,
|
|
152
|
-
includeRepoMap: false
|
|
153
|
-
}
|
|
623
|
+
includeRepoMap: false,
|
|
624
|
+
},
|
|
154
625
|
};
|
|
155
626
|
}
|
|
156
627
|
```
|
|
628
|
+
|
|
629
|
+
### Modifying Files
|
|
630
|
+
|
|
631
|
+
Add or filter context files before they are added:
|
|
632
|
+
|
|
633
|
+
```typescript
|
|
634
|
+
async onFilesAdded(
|
|
635
|
+
event: FilesAddedEvent,
|
|
636
|
+
context: ExtensionContext
|
|
637
|
+
): Promise<Partial<FilesAddedEvent>> {
|
|
638
|
+
// Filter out generated files from being added
|
|
639
|
+
return {
|
|
640
|
+
files: event.files.filter((f) => !f.path.includes('node_modules')),
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
### Overriding Prompt Templates
|
|
646
|
+
|
|
647
|
+
Override the rendered output of a prompt template:
|
|
648
|
+
|
|
649
|
+
```typescript
|
|
650
|
+
async onPromptTemplate(
|
|
651
|
+
event: PromptTemplateEvent,
|
|
652
|
+
context: ExtensionContext
|
|
653
|
+
): Promise<Partial<PromptTemplateEvent>> {
|
|
654
|
+
if (event.name === 'system-prompt') {
|
|
655
|
+
return { prompt: event.prompt + '\n\nAdditional rules...' };
|
|
656
|
+
}
|
|
657
|
+
return {};
|
|
658
|
+
}
|
|
659
|
+
```
|