@aiderdesk/extensions 0.11.0 → 0.12.1
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/cli.js +30 -17
- package/dist/index.d.ts +74 -2
- package/extensions.d.ts +74 -2
- package/extensions.json +9 -0
- package/package.json +4 -2
package/dist/cli.js
CHANGED
|
@@ -273,26 +273,39 @@ async function installFromUrl(url, targetDir) {
|
|
|
273
273
|
if (!cloneUrl) {
|
|
274
274
|
throw new Error("Invalid GitHub URL - could not extract repository URL");
|
|
275
275
|
}
|
|
276
|
-
if (!extensionsPath) {
|
|
277
|
-
throw new Error("Invalid GitHub URL - could not extract extension path from URL");
|
|
278
|
-
}
|
|
279
276
|
const extName = urlPath.split("/").pop() || "extension";
|
|
280
277
|
const tempDir = join(process.cwd(), `.temp-ext-${Date.now()}`);
|
|
281
278
|
try {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
279
|
+
if (extensionsPath) {
|
|
280
|
+
spinner.text = "Cloning repository with sparse checkout...";
|
|
281
|
+
await runCommand("git", ["clone", "--depth", "1", "--sparse", cloneUrl, tempDir]);
|
|
282
|
+
spinner.text = "Configuring sparse checkout path...";
|
|
283
|
+
await runCommand("git", ["-C", tempDir, "sparse-checkout", "set", extensionsPath]);
|
|
284
|
+
const sourceDir = join(tempDir, extensionsPath);
|
|
285
|
+
const targetPath = join(targetDir, extName);
|
|
286
|
+
if (!existsSync(sourceDir)) {
|
|
287
|
+
throw new Error(`Extension folder not found in repository: ${extensionsPath}`);
|
|
288
|
+
}
|
|
289
|
+
spinner.text = "Copying extension files...";
|
|
290
|
+
cpSync(sourceDir, targetPath, { recursive: true });
|
|
291
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${extName} to ${targetDir}`));
|
|
292
|
+
if (existsSync(join(targetDir, "package.json"))) {
|
|
293
|
+
await installDependencies(targetPath);
|
|
294
|
+
}
|
|
295
|
+
} else {
|
|
296
|
+
spinner.text = "Cloning repository...";
|
|
297
|
+
await runCommand("git", ["clone", "--depth", "1", cloneUrl, tempDir]);
|
|
298
|
+
const targetPath = join(targetDir, extName);
|
|
299
|
+
spinner.text = `Installing ${extName}...`;
|
|
300
|
+
cpSync(tempDir, targetPath, { recursive: true });
|
|
301
|
+
const gitDir = join(targetPath, ".git");
|
|
302
|
+
if (existsSync(gitDir)) {
|
|
303
|
+
rmSync(gitDir, { recursive: true, force: true });
|
|
304
|
+
}
|
|
305
|
+
if (existsSync(join(targetPath, "package.json"))) {
|
|
306
|
+
await installDependencies(targetPath);
|
|
307
|
+
}
|
|
308
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${extName} to ${targetPath}`));
|
|
296
309
|
}
|
|
297
310
|
} finally {
|
|
298
311
|
if (existsSync(tempDir)) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
export type LlmProviderName = "anthropic" | "anthropic-compatible" | "auggie" | "azure" | "bedrock" | "cerebras" | "claude-agent-sdk" | "deepseek" | "gemini" | "gemini-cli" | "gpustack" | "groq" | "alibaba-plan" | "kimi-plan" | "litellm" | "lmstudio" | "minimax" | "ollama" | "openai" | "openai-compatible" | "opencode" | "openrouter" | "requesty" | "synthetic" | "vertex-ai" | "zai-plan";
|
|
3
|
+
export type LlmProviderName = "anthropic" | "anthropic-compatible" | "auggie" | "azure" | "bedrock" | "cerebras" | "claude-agent-sdk" | "deepseek" | "gemini" | "gemini-cli" | "gpustack" | "groq" | "alibaba-plan" | "kimi-plan" | "litellm" | "lmstudio" | "minimax" | "ollama" | "openai" | "openai-compatible" | "opencode" | "openrouter" | "requesty" | "synthetic" | "vertex-ai" | "zai-plan" | string;
|
|
4
4
|
export interface LlmProviderBase {
|
|
5
5
|
name: LlmProviderName;
|
|
6
6
|
disableStreaming?: boolean;
|
|
@@ -167,7 +167,10 @@ export interface SyntheticProvider extends LlmProviderBase {
|
|
|
167
167
|
name: "synthetic";
|
|
168
168
|
apiKey: string;
|
|
169
169
|
}
|
|
170
|
-
export
|
|
170
|
+
export interface ExtensionLlmProvider extends LlmProviderBase {
|
|
171
|
+
[key: string]: unknown;
|
|
172
|
+
}
|
|
173
|
+
export type LlmProvider = OpenAiProvider | AnthropicProvider | AnthropicCompatibleProvider | AuggieProvider | AzureProvider | GeminiProvider | GeminiCliProvider | VertexAiProvider | LmStudioProvider | BedrockProvider | ClaudeAgentSdkProvider | DeepseekProvider | GroqProvider | GpustackProvider | CerebrasProvider | AlibabaPlanProvider | KimiPlanProvider | OpenAiCompatibleProvider | LitellmProvider | OllamaProvider | OpenCodeProvider | OpenRouterProvider | RequestyProvider | SyntheticProvider | ZaiPlanProvider | MinimaxProvider | ExtensionLlmProvider;
|
|
171
174
|
export type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
|
172
175
|
export type JSONObject = {
|
|
173
176
|
[key: string]: JSONValue;
|
|
@@ -643,6 +646,12 @@ export interface ProviderProfile {
|
|
|
643
646
|
provider: LlmProvider;
|
|
644
647
|
headers?: Record<string, string>;
|
|
645
648
|
disabled?: boolean;
|
|
649
|
+
extensionId?: string;
|
|
650
|
+
}
|
|
651
|
+
export interface VoiceSession {
|
|
652
|
+
ephemeralToken: string;
|
|
653
|
+
model: string;
|
|
654
|
+
idleTimeoutMs: number;
|
|
646
655
|
}
|
|
647
656
|
export interface McpServerConfig {
|
|
648
657
|
command?: string;
|
|
@@ -833,6 +842,61 @@ export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<str
|
|
|
833
842
|
/** Execute function with type-safe args */
|
|
834
843
|
execute: (input: z.infer<TSchema>, signal: AbortSignal | undefined, context: ExtensionContext, allTools: Record<string, Tool>) => Promise<unknown>;
|
|
835
844
|
}
|
|
845
|
+
/**
|
|
846
|
+
* Response from loading models for a provider
|
|
847
|
+
*/
|
|
848
|
+
export interface LoadModelsResponse {
|
|
849
|
+
models: Model[];
|
|
850
|
+
success: boolean;
|
|
851
|
+
error?: string;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Aider-compatible model mapping with environment variables
|
|
855
|
+
*/
|
|
856
|
+
export interface AiderModelMapping {
|
|
857
|
+
modelName: string;
|
|
858
|
+
environmentVariables: Record<string, string>;
|
|
859
|
+
}
|
|
860
|
+
export interface CacheControl {
|
|
861
|
+
providerOptions: Record<string, Record<string, JSONValue>>;
|
|
862
|
+
placement?: "message" | "message-part";
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Simplified provider strategy for extensions.
|
|
866
|
+
* Only `createLlm` and `loadModels` are required.
|
|
867
|
+
* All other methods are optional and will use built-in defaults when omitted.
|
|
868
|
+
*/
|
|
869
|
+
export interface ExtensionProviderStrategy {
|
|
870
|
+
createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string) => unknown | Promise<unknown>;
|
|
871
|
+
loadModels: (profile: ProviderProfile, settings: SettingsData) => Promise<LoadModelsResponse>;
|
|
872
|
+
getAiderMapping?: (provider: ProviderProfile, modelId: string, settings: SettingsData, projectDir: string) => AiderModelMapping;
|
|
873
|
+
getUsageReport?: (task: unknown, provider: ProviderProfile, model: Model, usage: unknown, providerMetadata?: unknown) => UsageReportData;
|
|
874
|
+
getProviderOptions?: (model: Model) => Record<string, Record<string, JSONValue>> | undefined;
|
|
875
|
+
getCacheControl?: (profile: AgentProfile) => CacheControl | undefined;
|
|
876
|
+
getProviderTools?: (model: Model) => Record<string, Tool> | Promise<Record<string, Tool>>;
|
|
877
|
+
getProviderParameters?: (model: Model) => Record<string, unknown>;
|
|
878
|
+
createVoiceSession?: (profile: ProviderProfile, settings: SettingsData) => Promise<VoiceSession>;
|
|
879
|
+
isRetryable?: (error: unknown) => boolean;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Definition of an LLM provider that can be registered by an extension.
|
|
883
|
+
* The extension fully owns the provider config — it is not UI-editable.
|
|
884
|
+
*/
|
|
885
|
+
export interface ProviderDefinition {
|
|
886
|
+
/** Unique provider identifier (e.g., 'my-provider') */
|
|
887
|
+
id: string;
|
|
888
|
+
/** Provider name — can be a new name or a built-in provider name to override it */
|
|
889
|
+
name: string;
|
|
890
|
+
/** Provider configuration (not UI-editable, extension-owned) */
|
|
891
|
+
provider: {
|
|
892
|
+
name: string;
|
|
893
|
+
[key: string]: unknown;
|
|
894
|
+
};
|
|
895
|
+
/** Provider strategy implementation */
|
|
896
|
+
strategy: ExtensionProviderStrategy;
|
|
897
|
+
/** Optional HTTP headers for API requests */
|
|
898
|
+
headers?: Record<string, string>;
|
|
899
|
+
}
|
|
836
900
|
/** Placement locations for extension UI components */
|
|
837
901
|
export type UIComponentPlacement = "task-status-bar-left" | "task-status-bar-right" | "task-usage-info-bottom" | "task-messages-top" | "task-messages-bottom" | "header-left" | "header-right" | "task-input-above" | "task-input-toolbar-left" | "task-input-toolbar-right" | "tasks-sidebar-header" | "tasks-sidebar-bottom" | "task-message-above" | "task-message-below" | "task-message-bar" | "task-top-bar-left" | "task-top-bar-right" | "task-state-actions" | "task-state-actions-all" | "welcome-page";
|
|
838
902
|
/**
|
|
@@ -1371,6 +1435,14 @@ export interface Extension {
|
|
|
1371
1435
|
* Extension-provided agents will be included in the list of all agents
|
|
1372
1436
|
*/
|
|
1373
1437
|
getAgents?(context: ExtensionContext): AgentProfile[];
|
|
1438
|
+
/**
|
|
1439
|
+
* Return array of LLM providers this extension provides
|
|
1440
|
+
* Each provider includes a strategy for LLM creation and model loading,
|
|
1441
|
+
* and a pre-configured provider profile.
|
|
1442
|
+
* Extension providers appear as read-only in the UI — the extension owns the configuration.
|
|
1443
|
+
* Provider names can override built-in providers (user responsibility to avoid conflicts between extensions).
|
|
1444
|
+
*/
|
|
1445
|
+
getProviders?(context: ExtensionContext): ProviderDefinition[];
|
|
1374
1446
|
/**
|
|
1375
1447
|
* Called when a user updates an extension-provided agent profile
|
|
1376
1448
|
* Extension should persist the updated profile and return it from future getAgents() calls
|
package/extensions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
export type LlmProviderName = "anthropic" | "anthropic-compatible" | "auggie" | "azure" | "bedrock" | "cerebras" | "claude-agent-sdk" | "deepseek" | "gemini" | "gemini-cli" | "gpustack" | "groq" | "alibaba-plan" | "kimi-plan" | "litellm" | "lmstudio" | "minimax" | "ollama" | "openai" | "openai-compatible" | "opencode" | "openrouter" | "requesty" | "synthetic" | "vertex-ai" | "zai-plan";
|
|
3
|
+
export type LlmProviderName = "anthropic" | "anthropic-compatible" | "auggie" | "azure" | "bedrock" | "cerebras" | "claude-agent-sdk" | "deepseek" | "gemini" | "gemini-cli" | "gpustack" | "groq" | "alibaba-plan" | "kimi-plan" | "litellm" | "lmstudio" | "minimax" | "ollama" | "openai" | "openai-compatible" | "opencode" | "openrouter" | "requesty" | "synthetic" | "vertex-ai" | "zai-plan" | string;
|
|
4
4
|
export interface LlmProviderBase {
|
|
5
5
|
name: LlmProviderName;
|
|
6
6
|
disableStreaming?: boolean;
|
|
@@ -167,7 +167,10 @@ export interface SyntheticProvider extends LlmProviderBase {
|
|
|
167
167
|
name: "synthetic";
|
|
168
168
|
apiKey: string;
|
|
169
169
|
}
|
|
170
|
-
export
|
|
170
|
+
export interface ExtensionLlmProvider extends LlmProviderBase {
|
|
171
|
+
[key: string]: unknown;
|
|
172
|
+
}
|
|
173
|
+
export type LlmProvider = OpenAiProvider | AnthropicProvider | AnthropicCompatibleProvider | AuggieProvider | AzureProvider | GeminiProvider | GeminiCliProvider | VertexAiProvider | LmStudioProvider | BedrockProvider | ClaudeAgentSdkProvider | DeepseekProvider | GroqProvider | GpustackProvider | CerebrasProvider | AlibabaPlanProvider | KimiPlanProvider | OpenAiCompatibleProvider | LitellmProvider | OllamaProvider | OpenCodeProvider | OpenRouterProvider | RequestyProvider | SyntheticProvider | ZaiPlanProvider | MinimaxProvider | ExtensionLlmProvider;
|
|
171
174
|
export type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
|
172
175
|
export type JSONObject = {
|
|
173
176
|
[key: string]: JSONValue;
|
|
@@ -643,6 +646,12 @@ export interface ProviderProfile {
|
|
|
643
646
|
provider: LlmProvider;
|
|
644
647
|
headers?: Record<string, string>;
|
|
645
648
|
disabled?: boolean;
|
|
649
|
+
extensionId?: string;
|
|
650
|
+
}
|
|
651
|
+
export interface VoiceSession {
|
|
652
|
+
ephemeralToken: string;
|
|
653
|
+
model: string;
|
|
654
|
+
idleTimeoutMs: number;
|
|
646
655
|
}
|
|
647
656
|
export interface McpServerConfig {
|
|
648
657
|
command?: string;
|
|
@@ -833,6 +842,61 @@ export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType<Record<str
|
|
|
833
842
|
/** Execute function with type-safe args */
|
|
834
843
|
execute: (input: z.infer<TSchema>, signal: AbortSignal | undefined, context: ExtensionContext, allTools: Record<string, Tool>) => Promise<unknown>;
|
|
835
844
|
}
|
|
845
|
+
/**
|
|
846
|
+
* Response from loading models for a provider
|
|
847
|
+
*/
|
|
848
|
+
export interface LoadModelsResponse {
|
|
849
|
+
models: Model[];
|
|
850
|
+
success: boolean;
|
|
851
|
+
error?: string;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Aider-compatible model mapping with environment variables
|
|
855
|
+
*/
|
|
856
|
+
export interface AiderModelMapping {
|
|
857
|
+
modelName: string;
|
|
858
|
+
environmentVariables: Record<string, string>;
|
|
859
|
+
}
|
|
860
|
+
export interface CacheControl {
|
|
861
|
+
providerOptions: Record<string, Record<string, JSONValue>>;
|
|
862
|
+
placement?: "message" | "message-part";
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Simplified provider strategy for extensions.
|
|
866
|
+
* Only `createLlm` and `loadModels` are required.
|
|
867
|
+
* All other methods are optional and will use built-in defaults when omitted.
|
|
868
|
+
*/
|
|
869
|
+
export interface ExtensionProviderStrategy {
|
|
870
|
+
createLlm: (profile: ProviderProfile, model: Model, settings: SettingsData, projectDir: string) => unknown | Promise<unknown>;
|
|
871
|
+
loadModels: (profile: ProviderProfile, settings: SettingsData) => Promise<LoadModelsResponse>;
|
|
872
|
+
getAiderMapping?: (provider: ProviderProfile, modelId: string, settings: SettingsData, projectDir: string) => AiderModelMapping;
|
|
873
|
+
getUsageReport?: (task: unknown, provider: ProviderProfile, model: Model, usage: unknown, providerMetadata?: unknown) => UsageReportData;
|
|
874
|
+
getProviderOptions?: (model: Model) => Record<string, Record<string, JSONValue>> | undefined;
|
|
875
|
+
getCacheControl?: (profile: AgentProfile) => CacheControl | undefined;
|
|
876
|
+
getProviderTools?: (model: Model) => Record<string, Tool> | Promise<Record<string, Tool>>;
|
|
877
|
+
getProviderParameters?: (model: Model) => Record<string, unknown>;
|
|
878
|
+
createVoiceSession?: (profile: ProviderProfile, settings: SettingsData) => Promise<VoiceSession>;
|
|
879
|
+
isRetryable?: (error: unknown) => boolean;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Definition of an LLM provider that can be registered by an extension.
|
|
883
|
+
* The extension fully owns the provider config — it is not UI-editable.
|
|
884
|
+
*/
|
|
885
|
+
export interface ProviderDefinition {
|
|
886
|
+
/** Unique provider identifier (e.g., 'my-provider') */
|
|
887
|
+
id: string;
|
|
888
|
+
/** Provider name — can be a new name or a built-in provider name to override it */
|
|
889
|
+
name: string;
|
|
890
|
+
/** Provider configuration (not UI-editable, extension-owned) */
|
|
891
|
+
provider: {
|
|
892
|
+
name: string;
|
|
893
|
+
[key: string]: unknown;
|
|
894
|
+
};
|
|
895
|
+
/** Provider strategy implementation */
|
|
896
|
+
strategy: ExtensionProviderStrategy;
|
|
897
|
+
/** Optional HTTP headers for API requests */
|
|
898
|
+
headers?: Record<string, string>;
|
|
899
|
+
}
|
|
836
900
|
/** Placement locations for extension UI components */
|
|
837
901
|
export type UIComponentPlacement = "task-status-bar-left" | "task-status-bar-right" | "task-usage-info-bottom" | "task-messages-top" | "task-messages-bottom" | "header-left" | "header-right" | "task-input-above" | "task-input-toolbar-left" | "task-input-toolbar-right" | "tasks-sidebar-header" | "tasks-sidebar-bottom" | "task-message-above" | "task-message-below" | "task-message-bar" | "task-top-bar-left" | "task-top-bar-right" | "task-state-actions" | "task-state-actions-all" | "welcome-page";
|
|
838
902
|
/**
|
|
@@ -1371,6 +1435,14 @@ export interface Extension {
|
|
|
1371
1435
|
* Extension-provided agents will be included in the list of all agents
|
|
1372
1436
|
*/
|
|
1373
1437
|
getAgents?(context: ExtensionContext): AgentProfile[];
|
|
1438
|
+
/**
|
|
1439
|
+
* Return array of LLM providers this extension provides
|
|
1440
|
+
* Each provider includes a strategy for LLM creation and model loading,
|
|
1441
|
+
* and a pre-configured provider profile.
|
|
1442
|
+
* Extension providers appear as read-only in the UI — the extension owns the configuration.
|
|
1443
|
+
* Provider names can override built-in providers (user responsibility to avoid conflicts between extensions).
|
|
1444
|
+
*/
|
|
1445
|
+
getProviders?(context: ExtensionContext): ProviderDefinition[];
|
|
1374
1446
|
/**
|
|
1375
1447
|
* Called when a user updates an extension-provided agent profile
|
|
1376
1448
|
* Extension should persist the updated profile and return it from future getAgents() calls
|
package/extensions.json
CHANGED
|
@@ -205,6 +205,15 @@
|
|
|
205
205
|
"hasDependencies": true,
|
|
206
206
|
"capabilities": ["ui"]
|
|
207
207
|
},
|
|
208
|
+
{
|
|
209
|
+
"id": "fff",
|
|
210
|
+
"name": "FFF",
|
|
211
|
+
"description": "Fast file content search using FFF (Freakin Fast File Finder) — replaces the internal grep tool",
|
|
212
|
+
"folder": "fff",
|
|
213
|
+
"type": "folder",
|
|
214
|
+
"hasDependencies": true,
|
|
215
|
+
"capabilities": ["tools", "search"]
|
|
216
|
+
},
|
|
208
217
|
{
|
|
209
218
|
"id": "seek",
|
|
210
219
|
"name": "Seek",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiderdesk/extensions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Type definitions and examples for AiderDesk extensions",
|
|
5
5
|
"author": "Hotovo",
|
|
6
6
|
"homepage": "https://aiderdesk.hotovo.com",
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "dts-bundle-generator --external-imports zod node --project ../../tsconfig.node.json --no-check --no-banner -o extensions.d.ts ../../packages/common/src/extensions.ts && node scripts/build.mjs",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
|
-
"prepublishOnly": "npm run build"
|
|
39
|
+
"prepublishOnly": "npm run build",
|
|
40
|
+
"publish:next": "node scripts/publish-next.mjs",
|
|
41
|
+
"release:latest": "node scripts/release-latest.mjs"
|
|
40
42
|
},
|
|
41
43
|
"keywords": [
|
|
42
44
|
"aiderdesk",
|