@aiderdesk/extensions 0.37.0 → 0.39.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/dist/index.d.ts CHANGED
@@ -255,38 +255,56 @@ export type ToolResultOutput = {
255
255
  }>;
256
256
  };
257
257
  export interface TextPart {
258
+ providerOptions?: ProviderOptions;
258
259
  type: "text";
259
260
  text: string;
260
261
  }
261
262
  export interface ImagePart {
263
+ providerOptions?: ProviderOptions;
262
264
  type: "image";
263
265
  image: DataContent | URL;
264
266
  mediaType?: string;
265
267
  }
266
268
  export interface FilePart {
269
+ providerOptions?: ProviderOptions;
267
270
  type: "file";
268
271
  data: DataContent | URL;
269
272
  filename?: string;
270
273
  mediaType: string;
271
274
  }
272
275
  export interface ReasoningPart {
276
+ providerOptions?: ProviderOptions;
273
277
  type: "reasoning";
274
278
  text: string;
275
279
  }
276
280
  export interface ToolCallPart {
281
+ providerExecuted?: boolean;
282
+ providerOptions?: ProviderOptions;
277
283
  type: "tool-call";
278
284
  toolCallId: string;
279
285
  toolName: string;
280
286
  input: unknown;
281
287
  }
282
288
  export interface ToolResultPart {
289
+ providerOptions?: ProviderOptions;
283
290
  type: "tool-result";
284
291
  toolCallId: string;
285
292
  toolName: string;
286
293
  output: ToolResultOutput;
287
294
  }
295
+ export interface ReasoningFilePart {
296
+ type: "reasoning-file";
297
+ data: DataContent | URL;
298
+ mediaType: string;
299
+ providerOptions?: ProviderOptions;
300
+ }
301
+ export interface CustomPart {
302
+ type: "custom";
303
+ kind: string;
304
+ providerOptions?: ProviderOptions;
305
+ }
288
306
  export type UserContent = string | Array<TextPart | ImagePart | FilePart>;
289
- export type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart>;
307
+ export type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | CustomPart | ToolCallPart | ToolResultPart>;
290
308
  export type ToolContent = Array<ToolResultPart>;
291
309
  export interface LocalizedString {
292
310
  key: string;
@@ -311,6 +329,10 @@ export interface UsageReportData {
311
329
  agentTotalCost?: number;
312
330
  }
313
331
  export interface PromptContext {
332
+ userMessageId?: string;
333
+ parentPromptContextId?: string;
334
+ parentToolCallId?: string;
335
+ parentChildIndex?: number;
314
336
  id: string;
315
337
  group?: Group;
316
338
  }
@@ -319,6 +341,7 @@ declare enum MessageRole {
319
341
  Assistant = "assistant"
320
342
  }
321
343
  export interface BaseContextMessage {
344
+ providerOptions?: ProviderOptions;
322
345
  id: string;
323
346
  timestamp?: number;
324
347
  usageReport?: UsageReportData;
@@ -474,6 +497,7 @@ export interface ResponseCompletedData {
474
497
  }
475
498
  export interface UpdatedFile {
476
499
  path: string;
500
+ previousPath?: string;
477
501
  additions: number;
478
502
  deletions: number;
479
503
  diff?: string;
@@ -547,6 +571,11 @@ declare const ProjectSettingsSchema: z.ZodObject<{
547
571
  contextSidebarSectionsHidden: z.ZodDefault<z.ZodArray<z.ZodString>>;
548
572
  }, z.core.$strip>;
549
573
  export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
574
+ export declare enum ToolRecoveryMode {
575
+ Forget = "forget",
576
+ Safe = "safe",
577
+ Notify = "notify"
578
+ }
550
579
  export declare enum ToolApprovalState {
551
580
  Always = "always",
552
581
  Never = "never",
@@ -604,6 +633,7 @@ export interface AgentProfile {
604
633
  temperature?: number;
605
634
  enabledServers: string[];
606
635
  toolApprovals: Record<string, ToolApprovalState>;
636
+ toolRecoveryModes?: Record<string, ToolRecoveryMode>;
607
637
  toolSettings: Record<string, ToolSettings>;
608
638
  includeContextFiles: boolean;
609
639
  includeRepoMap: boolean;
@@ -770,6 +800,7 @@ export interface SettingsData {
770
800
  onboardingFinished?: boolean;
771
801
  language: string;
772
802
  startupMode?: ProjectStartMode;
803
+ resumeAgentAfterRestart?: boolean;
773
804
  zoomLevel?: number;
774
805
  notificationsEnabled?: boolean;
775
806
  theme?: Theme;
@@ -870,6 +901,7 @@ export interface SwitchToLocalOptions {
870
901
  discardWorktreeChanges?: boolean;
871
902
  }
872
903
  export interface SwitchToWorktreeOptions {
904
+ baseBranch?: string;
873
905
  carryOverUncommittedChanges?: boolean;
874
906
  dropSourceChanges?: boolean;
875
907
  }
@@ -1087,6 +1119,7 @@ export interface Tool {
1087
1119
  * ```
1088
1120
  */
1089
1121
  export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<string, unknown>>> {
1122
+ recoveryMode?: ToolRecoveryMode;
1090
1123
  /** Tool identifier in kebab-case (e.g., 'run-linter') */
1091
1124
  name: string;
1092
1125
  /** Description for LLM to understand tool purpose */
@@ -1115,13 +1148,17 @@ export interface CacheControl {
1115
1148
  providerOptions: Record<string, Record<string, JSONValue>>;
1116
1149
  placement?: "message" | "message-part";
1117
1150
  }
1151
+ export type ProviderToolApprovalHandler = (toolName: string, input: Record<string, unknown>, text: string, subject?: string) => Promise<[
1152
+ approved: boolean,
1153
+ reason?: string
1154
+ ]>;
1118
1155
  /**
1119
1156
  * Simplified provider strategy for extensions.
1120
1157
  * Only `createLlm` and `loadModels` are required.
1121
1158
  * All other methods are optional and will use built-in defaults when omitted.
1122
1159
  */
1123
1160
  export interface ExtensionProviderStrategy {
1124
- createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string, toolSet?: unknown, systemPrompt?: string, providerMetadata?: unknown, tlsRegistrar?: TlsPolicyRegistrar, sessionId?: string) => unknown | Promise<unknown>;
1161
+ createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string, toolSet?: unknown, systemPrompt?: string, providerMetadata?: unknown, tlsRegistrar?: TlsPolicyRegistrar, sessionId?: string, approveTool?: ProviderToolApprovalHandler) => unknown | Promise<unknown>;
1125
1162
  loadModels: (profile: ProviderProfile, settings: SettingsData, tlsRegistrar?: TlsPolicyRegistrar) => Promise<LoadModelsResponse>;
1126
1163
  getAiderMapping?: (provider: ProviderProfile, modelId: string, settings: SettingsData, projectDir: string) => AiderModelMapping;
1127
1164
  getUsageReport?: (task: unknown, provider: ProviderProfile, model: Model, usage: unknown, providerMetadata?: unknown) => UsageReportData;
@@ -1387,11 +1424,22 @@ export interface AgentStepFinishedEvent {
1387
1424
  finishReason: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other";
1388
1425
  responseMessages: ContextMessage[];
1389
1426
  }
1390
- /** Event payload for message optimization events */
1427
+ /** Event payload for stored-context to model-message transformations. */
1428
+ export interface TransformMessagesEvent {
1429
+ readonly originalMessages: ContextMessage[];
1430
+ transformedMessages: ContextMessage[];
1431
+ }
1432
+ /** Event payload for optional optimizations. Original messages are the transformation stage's output. */
1391
1433
  export interface OptimizeMessagesEvent {
1392
1434
  readonly originalMessages: ContextMessage[];
1393
1435
  optimizedMessages: ContextMessage[];
1394
1436
  }
1437
+ /** Event payload after provider compatibility and default cache annotation. */
1438
+ export interface ApplyCacheControlEvent {
1439
+ readonly originalMessages: ContextMessage[];
1440
+ readonly cacheControl?: CacheControl;
1441
+ messages: ContextMessage[];
1442
+ }
1395
1443
  /** Event payload for important reminders events */
1396
1444
  export interface ImportantRemindersEvent {
1397
1445
  /** @deprecated Use `agentProfile` instead. Will be removed in a future version. */
@@ -1408,6 +1456,9 @@ export interface ToolApprovalEvent {
1408
1456
  }
1409
1457
  /** Event payload for tool called events */
1410
1458
  export interface ToolCalledEvent {
1459
+ recoveryMode?: ToolRecoveryMode;
1460
+ readonly isReplay?: boolean;
1461
+ readonly replayAttempt?: number;
1411
1462
  readonly toolCallId: string;
1412
1463
  readonly toolName: string;
1413
1464
  readonly agentProfile: AgentProfile;
@@ -1425,10 +1476,33 @@ export interface ToolFinishedEvent {
1425
1476
  }
1426
1477
  /** A tool entry as exposed to extensions in toolset events */
1427
1478
  export interface ToolsetToolEntry {
1479
+ recoveryMode?: ToolRecoveryMode;
1480
+ recoveryModeKey?: string;
1481
+ replayOwner?: string;
1428
1482
  description?: string;
1429
1483
  inputSchema?: unknown;
1430
1484
  execute?(input: Record<string, unknown>, options?: unknown): Promise<unknown>;
1431
1485
  }
1486
+ /**
1487
+ * Marker key set on a tool's execution options when the tool is invoked internally by an
1488
+ * extension (through the `allTools` map passed to `ExtensionTool.execute`) instead of by the
1489
+ * model. The agent's tool wrapper reads it to honour the documented contract that
1490
+ * extension-internal tool calls are not propagated to the UI and do not take part in durability.
1491
+ */
1492
+ export declare const EXTENSION_ORIGIN: unique symbol;
1493
+ /**
1494
+ * Flags describing how an extension-originated tool call should be handled.
1495
+ *
1496
+ * Both flags are currently always `false`. They are kept as a structured option (instead of a
1497
+ * bare boolean) to prepare for a future capability where extensions can opt their internal tool
1498
+ * calls into UI surfacing and/or durable execution.
1499
+ */
1500
+ export interface ExtensionToolOrigin {
1501
+ /** Whether the internal call should participate in durable execution/replay. */
1502
+ durable: boolean;
1503
+ /** Whether the internal call should be surfaced as a tool message in the UI. */
1504
+ surfaceInUi: boolean;
1505
+ }
1432
1506
  /** Event payload for toolset created events */
1433
1507
  export interface ToolsetCreatedEvent {
1434
1508
  readonly mode: Mode;
@@ -1746,9 +1820,10 @@ export interface TaskContext {
1746
1820
  * Get the diff for a single updated file (lazily loaded from the backend)
1747
1821
  * @param filePath Path of the file (as returned by getUpdatedFiles)
1748
1822
  * @param commitHash Optional commit hash for per-commit diffs in grouped worktree mode
1823
+ * @param previousPath Optional original path for renamed files (as returned by getUpdatedFiles)
1749
1824
  * @returns Unified diff string (empty for binary files or on error)
1750
1825
  */
1751
- getUpdatedFileDiff(filePath: string, commitHash?: string): Promise<string>;
1826
+ getUpdatedFileDiff(filePath: string, commitHash?: string, previousPath?: string): Promise<string>;
1752
1827
  /**
1753
1828
  * Get the cached repository map string.
1754
1829
  * The repo map summarizes the codebase structure and is maintained by the Aider manager.
@@ -2687,9 +2762,20 @@ export interface Extension {
2687
2762
  * @returns void or partial event
2688
2763
  */
2689
2764
  onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
2765
+ /**
2766
+ * Override default context transformations, including Aider and subagent result reduction.
2767
+ * Original messages include reminders. Transformations are not reapplied after this hook.
2768
+ */
2769
+ onTransformMessages?(event: TransformMessagesEvent, context: ExtensionContext): Promise<void | Partial<TransformMessagesEvent>>;
2770
+ /**
2771
+ * Override cache annotation after provider compatibility conversion, even without a default cache policy.
2772
+ * Return originalMessages as messages to disable default cache annotation.
2773
+ */
2774
+ onApplyCacheControl?(event: ApplyCacheControlEvent, context: ExtensionContext): Promise<void | Partial<ApplyCacheControlEvent>>;
2690
2775
  /**
2691
2776
  * Called when messages are optimized before being sent to the LLM
2692
- * Modify event.optimizedMessages to change the messages that will be sent
2777
+ * Original messages are the transformation output, not raw stored context.
2778
+ * Modify event.optimizedMessages to override optional optimizations
2693
2779
  * @returns void or partial event to modify optimized messages
2694
2780
  */
2695
2781
  onOptimizeMessages?(event: OptimizeMessagesEvent, context: ExtensionContext): Promise<void | Partial<OptimizeMessagesEvent>>;
package/dist/index.js CHANGED
@@ -28,10 +28,17 @@ var ContextMemoryMode = /* @__PURE__ */ ((ContextMemoryMode2) => {
28
28
  ContextMemoryMode2["LastMessage"] = "last-message";
29
29
  return ContextMemoryMode2;
30
30
  })(ContextMemoryMode || {});
31
+ var ToolRecoveryMode = /* @__PURE__ */ ((ToolRecoveryMode2) => {
32
+ ToolRecoveryMode2["Forget"] = "forget";
33
+ ToolRecoveryMode2["Safe"] = "safe";
34
+ ToolRecoveryMode2["Notify"] = "notify";
35
+ return ToolRecoveryMode2;
36
+ })(ToolRecoveryMode || {});
31
37
  export {
32
38
  AutonomyMode,
33
39
  ContextMemoryMode,
34
40
  InvocationMode,
35
41
  OS,
36
- ToolApprovalState
42
+ ToolApprovalState,
43
+ ToolRecoveryMode
37
44
  };
package/extensions.d.ts CHANGED
@@ -255,38 +255,56 @@ export type ToolResultOutput = {
255
255
  }>;
256
256
  };
257
257
  export interface TextPart {
258
+ providerOptions?: ProviderOptions;
258
259
  type: "text";
259
260
  text: string;
260
261
  }
261
262
  export interface ImagePart {
263
+ providerOptions?: ProviderOptions;
262
264
  type: "image";
263
265
  image: DataContent | URL;
264
266
  mediaType?: string;
265
267
  }
266
268
  export interface FilePart {
269
+ providerOptions?: ProviderOptions;
267
270
  type: "file";
268
271
  data: DataContent | URL;
269
272
  filename?: string;
270
273
  mediaType: string;
271
274
  }
272
275
  export interface ReasoningPart {
276
+ providerOptions?: ProviderOptions;
273
277
  type: "reasoning";
274
278
  text: string;
275
279
  }
276
280
  export interface ToolCallPart {
281
+ providerExecuted?: boolean;
282
+ providerOptions?: ProviderOptions;
277
283
  type: "tool-call";
278
284
  toolCallId: string;
279
285
  toolName: string;
280
286
  input: unknown;
281
287
  }
282
288
  export interface ToolResultPart {
289
+ providerOptions?: ProviderOptions;
283
290
  type: "tool-result";
284
291
  toolCallId: string;
285
292
  toolName: string;
286
293
  output: ToolResultOutput;
287
294
  }
295
+ export interface ReasoningFilePart {
296
+ type: "reasoning-file";
297
+ data: DataContent | URL;
298
+ mediaType: string;
299
+ providerOptions?: ProviderOptions;
300
+ }
301
+ export interface CustomPart {
302
+ type: "custom";
303
+ kind: string;
304
+ providerOptions?: ProviderOptions;
305
+ }
288
306
  export type UserContent = string | Array<TextPart | ImagePart | FilePart>;
289
- export type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart>;
307
+ export type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | CustomPart | ToolCallPart | ToolResultPart>;
290
308
  export type ToolContent = Array<ToolResultPart>;
291
309
  export interface LocalizedString {
292
310
  key: string;
@@ -311,6 +329,10 @@ export interface UsageReportData {
311
329
  agentTotalCost?: number;
312
330
  }
313
331
  export interface PromptContext {
332
+ userMessageId?: string;
333
+ parentPromptContextId?: string;
334
+ parentToolCallId?: string;
335
+ parentChildIndex?: number;
314
336
  id: string;
315
337
  group?: Group;
316
338
  }
@@ -319,6 +341,7 @@ declare enum MessageRole {
319
341
  Assistant = "assistant"
320
342
  }
321
343
  export interface BaseContextMessage {
344
+ providerOptions?: ProviderOptions;
322
345
  id: string;
323
346
  timestamp?: number;
324
347
  usageReport?: UsageReportData;
@@ -474,6 +497,7 @@ export interface ResponseCompletedData {
474
497
  }
475
498
  export interface UpdatedFile {
476
499
  path: string;
500
+ previousPath?: string;
477
501
  additions: number;
478
502
  deletions: number;
479
503
  diff?: string;
@@ -547,6 +571,11 @@ declare const ProjectSettingsSchema: z.ZodObject<{
547
571
  contextSidebarSectionsHidden: z.ZodDefault<z.ZodArray<z.ZodString>>;
548
572
  }, z.core.$strip>;
549
573
  export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
574
+ export declare enum ToolRecoveryMode {
575
+ Forget = "forget",
576
+ Safe = "safe",
577
+ Notify = "notify"
578
+ }
550
579
  export declare enum ToolApprovalState {
551
580
  Always = "always",
552
581
  Never = "never",
@@ -604,6 +633,7 @@ export interface AgentProfile {
604
633
  temperature?: number;
605
634
  enabledServers: string[];
606
635
  toolApprovals: Record<string, ToolApprovalState>;
636
+ toolRecoveryModes?: Record<string, ToolRecoveryMode>;
607
637
  toolSettings: Record<string, ToolSettings>;
608
638
  includeContextFiles: boolean;
609
639
  includeRepoMap: boolean;
@@ -770,6 +800,7 @@ export interface SettingsData {
770
800
  onboardingFinished?: boolean;
771
801
  language: string;
772
802
  startupMode?: ProjectStartMode;
803
+ resumeAgentAfterRestart?: boolean;
773
804
  zoomLevel?: number;
774
805
  notificationsEnabled?: boolean;
775
806
  theme?: Theme;
@@ -870,6 +901,7 @@ export interface SwitchToLocalOptions {
870
901
  discardWorktreeChanges?: boolean;
871
902
  }
872
903
  export interface SwitchToWorktreeOptions {
904
+ baseBranch?: string;
873
905
  carryOverUncommittedChanges?: boolean;
874
906
  dropSourceChanges?: boolean;
875
907
  }
@@ -1087,6 +1119,7 @@ export interface Tool {
1087
1119
  * ```
1088
1120
  */
1089
1121
  export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<string, unknown>>> {
1122
+ recoveryMode?: ToolRecoveryMode;
1090
1123
  /** Tool identifier in kebab-case (e.g., 'run-linter') */
1091
1124
  name: string;
1092
1125
  /** Description for LLM to understand tool purpose */
@@ -1115,13 +1148,17 @@ export interface CacheControl {
1115
1148
  providerOptions: Record<string, Record<string, JSONValue>>;
1116
1149
  placement?: "message" | "message-part";
1117
1150
  }
1151
+ export type ProviderToolApprovalHandler = (toolName: string, input: Record<string, unknown>, text: string, subject?: string) => Promise<[
1152
+ approved: boolean,
1153
+ reason?: string
1154
+ ]>;
1118
1155
  /**
1119
1156
  * Simplified provider strategy for extensions.
1120
1157
  * Only `createLlm` and `loadModels` are required.
1121
1158
  * All other methods are optional and will use built-in defaults when omitted.
1122
1159
  */
1123
1160
  export interface ExtensionProviderStrategy {
1124
- createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string, toolSet?: unknown, systemPrompt?: string, providerMetadata?: unknown, tlsRegistrar?: TlsPolicyRegistrar, sessionId?: string) => unknown | Promise<unknown>;
1161
+ createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string, toolSet?: unknown, systemPrompt?: string, providerMetadata?: unknown, tlsRegistrar?: TlsPolicyRegistrar, sessionId?: string, approveTool?: ProviderToolApprovalHandler) => unknown | Promise<unknown>;
1125
1162
  loadModels: (profile: ProviderProfile, settings: SettingsData, tlsRegistrar?: TlsPolicyRegistrar) => Promise<LoadModelsResponse>;
1126
1163
  getAiderMapping?: (provider: ProviderProfile, modelId: string, settings: SettingsData, projectDir: string) => AiderModelMapping;
1127
1164
  getUsageReport?: (task: unknown, provider: ProviderProfile, model: Model, usage: unknown, providerMetadata?: unknown) => UsageReportData;
@@ -1387,11 +1424,22 @@ export interface AgentStepFinishedEvent {
1387
1424
  finishReason: "stop" | "length" | "content-filter" | "tool-calls" | "error" | "other";
1388
1425
  responseMessages: ContextMessage[];
1389
1426
  }
1390
- /** Event payload for message optimization events */
1427
+ /** Event payload for stored-context to model-message transformations. */
1428
+ export interface TransformMessagesEvent {
1429
+ readonly originalMessages: ContextMessage[];
1430
+ transformedMessages: ContextMessage[];
1431
+ }
1432
+ /** Event payload for optional optimizations. Original messages are the transformation stage's output. */
1391
1433
  export interface OptimizeMessagesEvent {
1392
1434
  readonly originalMessages: ContextMessage[];
1393
1435
  optimizedMessages: ContextMessage[];
1394
1436
  }
1437
+ /** Event payload after provider compatibility and default cache annotation. */
1438
+ export interface ApplyCacheControlEvent {
1439
+ readonly originalMessages: ContextMessage[];
1440
+ readonly cacheControl?: CacheControl;
1441
+ messages: ContextMessage[];
1442
+ }
1395
1443
  /** Event payload for important reminders events */
1396
1444
  export interface ImportantRemindersEvent {
1397
1445
  /** @deprecated Use `agentProfile` instead. Will be removed in a future version. */
@@ -1408,6 +1456,9 @@ export interface ToolApprovalEvent {
1408
1456
  }
1409
1457
  /** Event payload for tool called events */
1410
1458
  export interface ToolCalledEvent {
1459
+ recoveryMode?: ToolRecoveryMode;
1460
+ readonly isReplay?: boolean;
1461
+ readonly replayAttempt?: number;
1411
1462
  readonly toolCallId: string;
1412
1463
  readonly toolName: string;
1413
1464
  readonly agentProfile: AgentProfile;
@@ -1425,10 +1476,33 @@ export interface ToolFinishedEvent {
1425
1476
  }
1426
1477
  /** A tool entry as exposed to extensions in toolset events */
1427
1478
  export interface ToolsetToolEntry {
1479
+ recoveryMode?: ToolRecoveryMode;
1480
+ recoveryModeKey?: string;
1481
+ replayOwner?: string;
1428
1482
  description?: string;
1429
1483
  inputSchema?: unknown;
1430
1484
  execute?(input: Record<string, unknown>, options?: unknown): Promise<unknown>;
1431
1485
  }
1486
+ /**
1487
+ * Marker key set on a tool's execution options when the tool is invoked internally by an
1488
+ * extension (through the `allTools` map passed to `ExtensionTool.execute`) instead of by the
1489
+ * model. The agent's tool wrapper reads it to honour the documented contract that
1490
+ * extension-internal tool calls are not propagated to the UI and do not take part in durability.
1491
+ */
1492
+ export declare const EXTENSION_ORIGIN: unique symbol;
1493
+ /**
1494
+ * Flags describing how an extension-originated tool call should be handled.
1495
+ *
1496
+ * Both flags are currently always `false`. They are kept as a structured option (instead of a
1497
+ * bare boolean) to prepare for a future capability where extensions can opt their internal tool
1498
+ * calls into UI surfacing and/or durable execution.
1499
+ */
1500
+ export interface ExtensionToolOrigin {
1501
+ /** Whether the internal call should participate in durable execution/replay. */
1502
+ durable: boolean;
1503
+ /** Whether the internal call should be surfaced as a tool message in the UI. */
1504
+ surfaceInUi: boolean;
1505
+ }
1432
1506
  /** Event payload for toolset created events */
1433
1507
  export interface ToolsetCreatedEvent {
1434
1508
  readonly mode: Mode;
@@ -1746,9 +1820,10 @@ export interface TaskContext {
1746
1820
  * Get the diff for a single updated file (lazily loaded from the backend)
1747
1821
  * @param filePath Path of the file (as returned by getUpdatedFiles)
1748
1822
  * @param commitHash Optional commit hash for per-commit diffs in grouped worktree mode
1823
+ * @param previousPath Optional original path for renamed files (as returned by getUpdatedFiles)
1749
1824
  * @returns Unified diff string (empty for binary files or on error)
1750
1825
  */
1751
- getUpdatedFileDiff(filePath: string, commitHash?: string): Promise<string>;
1826
+ getUpdatedFileDiff(filePath: string, commitHash?: string, previousPath?: string): Promise<string>;
1752
1827
  /**
1753
1828
  * Get the cached repository map string.
1754
1829
  * The repo map summarizes the codebase structure and is maintained by the Aider manager.
@@ -2687,9 +2762,20 @@ export interface Extension {
2687
2762
  * @returns void or partial event
2688
2763
  */
2689
2764
  onAgentStepFinished?(event: AgentStepFinishedEvent, context: ExtensionContext): Promise<void | Partial<AgentStepFinishedEvent>>;
2765
+ /**
2766
+ * Override default context transformations, including Aider and subagent result reduction.
2767
+ * Original messages include reminders. Transformations are not reapplied after this hook.
2768
+ */
2769
+ onTransformMessages?(event: TransformMessagesEvent, context: ExtensionContext): Promise<void | Partial<TransformMessagesEvent>>;
2770
+ /**
2771
+ * Override cache annotation after provider compatibility conversion, even without a default cache policy.
2772
+ * Return originalMessages as messages to disable default cache annotation.
2773
+ */
2774
+ onApplyCacheControl?(event: ApplyCacheControlEvent, context: ExtensionContext): Promise<void | Partial<ApplyCacheControlEvent>>;
2690
2775
  /**
2691
2776
  * Called when messages are optimized before being sent to the LLM
2692
- * Modify event.optimizedMessages to change the messages that will be sent
2777
+ * Original messages are the transformation output, not raw stored context.
2778
+ * Modify event.optimizedMessages to override optional optimizations
2693
2779
  * @returns void or partial event to modify optimized messages
2694
2780
  */
2695
2781
  onOptimizeMessages?(event: OptimizeMessagesEvent, context: ExtensionContext): Promise<void | Partial<OptimizeMessagesEvent>>;
package/extensions.json CHANGED
@@ -1,5 +1,17 @@
1
1
  {
2
2
  "extensions": [
3
+ {
4
+ "id": "opencode-free",
5
+ "name": "OpenCode Free",
6
+ "description": "Free OpenCode models with native shell/read and AiderDesk tools over MCP",
7
+ "folder": "opencode-free",
8
+ "type": "folder",
9
+ "hasDependencies": true,
10
+ "capabilities": [
11
+ "providers"
12
+ ],
13
+ "installCount": 0
14
+ },
3
15
  {
4
16
  "id": "jev",
5
17
  "name": "Jev",
@@ -10,7 +22,7 @@
10
22
  "capabilities": [
11
23
  "tools"
12
24
  ],
13
- "installCount": 12
25
+ "installCount": 16
14
26
  },
15
27
  {
16
28
  "id": "binary-files",
@@ -23,7 +35,7 @@
23
35
  "tools",
24
36
  "ui"
25
37
  ],
26
- "installCount": 38
38
+ "installCount": 40
27
39
  },
28
40
  {
29
41
  "id": "wakatime",
@@ -58,7 +70,7 @@
58
70
  "commands",
59
71
  "example"
60
72
  ],
61
- "installCount": 24
73
+ "installCount": 25
62
74
  },
63
75
  {
64
76
  "id": "questions",
@@ -71,7 +83,7 @@
71
83
  "commands",
72
84
  "ui"
73
85
  ],
74
- "installCount": 46
86
+ "installCount": 50
75
87
  },
76
88
  {
77
89
  "id": "theme",
@@ -93,7 +105,7 @@
93
105
  "capabilities": [
94
106
  "modes"
95
107
  ],
96
- "installCount": 99
108
+ "installCount": 109
97
109
  },
98
110
  {
99
111
  "id": "protected-paths",
@@ -105,7 +117,7 @@
105
117
  "capabilities": [
106
118
  "security"
107
119
  ],
108
- "installCount": 47
120
+ "installCount": 53
109
121
  },
110
122
  {
111
123
  "id": "permission-gate",
@@ -116,7 +128,7 @@
116
128
  "capabilities": [
117
129
  "security"
118
130
  ],
119
- "installCount": 36
131
+ "installCount": 39
120
132
  },
121
133
  {
122
134
  "id": "ultrathink",
@@ -127,7 +139,7 @@
127
139
  "capabilities": [
128
140
  "optimization"
129
141
  ],
130
- "installCount": 48
142
+ "installCount": 52
131
143
  },
132
144
  {
133
145
  "id": "external-rules",
@@ -151,7 +163,7 @@
151
163
  "capabilities": [
152
164
  "context"
153
165
  ],
154
- "installCount": 62
166
+ "installCount": 70
155
167
  },
156
168
  {
157
169
  "id": "learn",
@@ -164,7 +176,7 @@
164
176
  "commands",
165
177
  "tools"
166
178
  ],
167
- "installCount": 82
179
+ "installCount": 98
168
180
  },
169
181
  {
170
182
  "id": "legacy-system-prompt",
@@ -176,19 +188,19 @@
176
188
  "capabilities": [
177
189
  "context"
178
190
  ],
179
- "installCount": 15
191
+ "installCount": 16
180
192
  },
181
193
  {
182
194
  "id": "sound-notification",
183
195
  "name": "Sound Notification",
184
- "description": "Plays sound notifications using packs from og-packs",
196
+ "description": "Plays sound notifications using og-packs or custom audio files",
185
197
  "folder": "sound-notification",
186
198
  "type": "folder",
187
199
  "hasDependencies": false,
188
200
  "capabilities": [
189
201
  "notifications"
190
202
  ],
191
- "installCount": 28
203
+ "installCount": 35
192
204
  },
193
205
  {
194
206
  "id": "sandbox",
@@ -204,7 +216,7 @@
204
216
  "linux",
205
217
  "macos"
206
218
  ],
207
- "installCount": 12
219
+ "installCount": 14
208
220
  },
209
221
  {
210
222
  "id": "rtk",
@@ -221,7 +233,7 @@
221
233
  "linux",
222
234
  "macos"
223
235
  ],
224
- "installCount": 29
236
+ "installCount": 30
225
237
  },
226
238
  {
227
239
  "id": "redact-secrets",
@@ -233,7 +245,7 @@
233
245
  "capabilities": [
234
246
  "security"
235
247
  ],
236
- "installCount": 29
248
+ "installCount": 30
237
249
  },
238
250
  {
239
251
  "id": "chunkhound-search",
@@ -245,7 +257,7 @@
245
257
  "capabilities": [
246
258
  "search"
247
259
  ],
248
- "installCount": 15
260
+ "installCount": 17
249
261
  },
250
262
  {
251
263
  "id": "chunkhound-on-semantic-search-tool",
@@ -257,7 +269,7 @@
257
269
  "capabilities": [
258
270
  "search"
259
271
  ],
260
- "installCount": 15
272
+ "installCount": 16
261
273
  },
262
274
  {
263
275
  "id": "tree-sitter-repo-map",
@@ -270,7 +282,7 @@
270
282
  "context",
271
283
  "commands"
272
284
  ],
273
- "installCount": 75
285
+ "installCount": 81
274
286
  },
275
287
  {
276
288
  "id": "context-autocompletion-words",
@@ -295,7 +307,7 @@
295
307
  "tools",
296
308
  "code-intelligence"
297
309
  ],
298
- "installCount": 80
310
+ "installCount": 91
299
311
  },
300
312
  {
301
313
  "id": "plannotator",
@@ -310,7 +322,7 @@
310
322
  "commands",
311
323
  "workflows"
312
324
  ],
313
- "installCount": 25
325
+ "installCount": 27
314
326
  },
315
327
  {
316
328
  "id": "programmatic-tool-calls",
@@ -322,7 +334,7 @@
322
334
  "capabilities": [
323
335
  "tools"
324
336
  ],
325
- "installCount": 33
337
+ "installCount": 39
326
338
  },
327
339
  {
328
340
  "id": "ui-placement-demo",
@@ -334,7 +346,7 @@
334
346
  "ui",
335
347
  "example"
336
348
  ],
337
- "installCount": 13
349
+ "installCount": 15
338
350
  },
339
351
  {
340
352
  "id": "multi-model-run",
@@ -359,7 +371,7 @@
359
371
  "capabilities": [
360
372
  "ui"
361
373
  ],
362
- "installCount": 8
374
+ "installCount": 9
363
375
  },
364
376
  {
365
377
  "id": "openai-codex",
@@ -371,7 +383,7 @@
371
383
  "capabilities": [
372
384
  "providers"
373
385
  ],
374
- "installCount": 30
386
+ "installCount": 32
375
387
  },
376
388
  {
377
389
  "id": "fff",
@@ -388,7 +400,7 @@
388
400
  "linux",
389
401
  "macos"
390
402
  ],
391
- "installCount": 37
403
+ "installCount": 40
392
404
  },
393
405
  {
394
406
  "id": "searxng-search",
@@ -401,7 +413,7 @@
401
413
  "tools",
402
414
  "search"
403
415
  ],
404
- "installCount": 28
416
+ "installCount": 31
405
417
  },
406
418
  {
407
419
  "id": "seek",
@@ -418,7 +430,7 @@
418
430
  "linux",
419
431
  "macos"
420
432
  ],
421
- "installCount": 16
433
+ "installCount": 19
422
434
  },
423
435
  {
424
436
  "id": "tps-counter",
@@ -430,7 +442,7 @@
430
442
  "capabilities": [
431
443
  "metrics"
432
444
  ],
433
- "installCount": 91
445
+ "installCount": 109
434
446
  },
435
447
  {
436
448
  "id": "verifier",
@@ -443,7 +455,7 @@
443
455
  "workflows",
444
456
  "ui"
445
457
  ],
446
- "installCount": 52
458
+ "installCount": 56
447
459
  },
448
460
  {
449
461
  "id": "bmad",
@@ -456,7 +468,7 @@
456
468
  "modes",
457
469
  "ui"
458
470
  ],
459
- "installCount": 16
471
+ "installCount": 18
460
472
  },
461
473
  {
462
474
  "id": "claude-agent-sdk",
@@ -469,7 +481,7 @@
469
481
  "providers",
470
482
  "agent-loop"
471
483
  ],
472
- "installCount": 24
484
+ "installCount": 27
473
485
  },
474
486
  {
475
487
  "id": "auggie-sdk",
@@ -493,7 +505,7 @@
493
505
  "capabilities": [
494
506
  "providers"
495
507
  ],
496
- "installCount": 10
508
+ "installCount": 11
497
509
  },
498
510
  {
499
511
  "id": "cursor-sdk",
@@ -506,7 +518,7 @@
506
518
  "providers",
507
519
  "agent-loop"
508
520
  ],
509
- "installCount": 10
521
+ "installCount": 11
510
522
  },
511
523
  {
512
524
  "id": "github-copilot",
@@ -519,7 +531,7 @@
519
531
  "providers",
520
532
  "agent-loop"
521
533
  ],
522
- "installCount": 10
534
+ "installCount": 11
523
535
  },
524
536
  {
525
537
  "id": "checkpoints",
@@ -532,7 +544,7 @@
532
544
  "events",
533
545
  "ui"
534
546
  ],
535
- "installCount": 39
547
+ "installCount": 41
536
548
  },
537
549
  {
538
550
  "id": "codegraph",
@@ -545,7 +557,7 @@
545
557
  "tools",
546
558
  "search"
547
559
  ],
548
- "installCount": 72
560
+ "installCount": 84
549
561
  },
550
562
  {
551
563
  "id": "kanban",
@@ -557,7 +569,7 @@
557
569
  "capabilities": [
558
570
  "ui"
559
571
  ],
560
- "installCount": 45
572
+ "installCount": 50
561
573
  },
562
574
  {
563
575
  "id": "doom",
@@ -582,7 +594,7 @@
582
594
  "agents",
583
595
  "example"
584
596
  ],
585
- "installCount": 52
597
+ "installCount": 61
586
598
  },
587
599
  {
588
600
  "id": "wigolo",
@@ -595,7 +607,7 @@
595
607
  "tools",
596
608
  "search"
597
609
  ],
598
- "installCount": 62
610
+ "installCount": 68
599
611
  },
600
612
  {
601
613
  "id": "destructive-command-guard",
@@ -608,7 +620,7 @@
608
620
  "security",
609
621
  "commands"
610
622
  ],
611
- "installCount": 46
623
+ "installCount": 51
612
624
  },
613
625
  {
614
626
  "id": "git-log",
@@ -620,7 +632,7 @@
620
632
  "capabilities": [
621
633
  "ui"
622
634
  ],
623
- "installCount": 51
635
+ "installCount": 55
624
636
  },
625
637
  {
626
638
  "id": "skill-gallery",
@@ -632,7 +644,7 @@
632
644
  "capabilities": [
633
645
  "ui"
634
646
  ],
635
- "installCount": 126
647
+ "installCount": 155
636
648
  },
637
649
  {
638
650
  "id": "task-scheduler",
@@ -646,7 +658,7 @@
646
658
  "commands",
647
659
  "events"
648
660
  ],
649
- "installCount": 26
661
+ "installCount": 29
650
662
  },
651
663
  {
652
664
  "id": "reasoning-selector",
@@ -658,7 +670,7 @@
658
670
  "capabilities": [
659
671
  "ui"
660
672
  ],
661
- "installCount": 120
673
+ "installCount": 133
662
674
  },
663
675
  {
664
676
  "id": "dbx",
@@ -683,7 +695,7 @@
683
695
  "ui",
684
696
  "commands"
685
697
  ],
686
- "installCount": 11
698
+ "installCount": 13
687
699
  }
688
700
  ]
689
701
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiderdesk/extensions",
3
- "version": "0.37.0",
3
+ "version": "0.39.0",
4
4
  "description": "Type definitions and examples for AiderDesk extensions",
5
5
  "author": "Hotovo",
6
6
  "homepage": "https://aiderdesk.hotovo.com",