@aiderdesk/extensions 0.1.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/README.md +88 -0
- package/dist/cli.js +316 -0
- package/examples.json +129 -0
- package/extensions.d.ts +1455 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @aiderdesk/extensions
|
|
2
|
+
|
|
3
|
+
TypeScript type definitions and examples for building [AiderDesk](https://aiderdesk.hotovo.com) extensions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @aiderdesk/extensions
|
|
9
|
+
# or
|
|
10
|
+
yarn add @aiderdesk/extensions
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @aiderdesk/extensions
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { Extension, ExtensionContext, ToolDefinition } from '@aiderdesk/extensions';
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
|
|
21
|
+
export default class MyExtension implements Extension {
|
|
22
|
+
async onLoad(context: ExtensionContext) {
|
|
23
|
+
context.log('Extension loaded!', 'info');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Example Extensions
|
|
29
|
+
|
|
30
|
+
This directory contains example extensions demonstrating various capabilities of the AiderDesk extension system.
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
For comprehensive documentation on creating and using extensions, see the [Extensions documentation](https://aiderdesk.hotovo.com/docs/extensions/):
|
|
35
|
+
|
|
36
|
+
- [Extensions Overview](https://aiderdesk.hotovo.com/docs/extensions/) - What extensions can do
|
|
37
|
+
- [Creating Extensions](https://aiderdesk.hotovo.com/docs/extensions/creating-extensions) - How to build extensions
|
|
38
|
+
- [Installation Guide](https://aiderdesk.hotovo.com/docs/extensions/installation) - Install extensions globally or per-project
|
|
39
|
+
- [API Reference](https://aiderdesk.hotovo.com/docs/extensions/api-reference) - Complete API documentation
|
|
40
|
+
- [Events Reference](https://aiderdesk.hotovo.com/docs/extensions/events) - All available events
|
|
41
|
+
- [Examples Gallery](https://aiderdesk.hotovo.com/docs/extensions/examples) - Browse all examples
|
|
42
|
+
|
|
43
|
+
## Example Extensions
|
|
44
|
+
|
|
45
|
+
| Extension | Description | Extension Functions |
|
|
46
|
+
|-----------|-------------|---------------------|
|
|
47
|
+
| **[theme.ts](./theme.ts)** | Adds `/theme` command to switch AiderDesk themes | `onLoad`, `getCommands` |
|
|
48
|
+
| **[sound-notification.ts](./sound-notification.ts)** | Plays a "Jobs Done" sound when a prompt finishes | `onLoad`, `onPromptFinished` |
|
|
49
|
+
| **[protected-paths.ts](./protected-paths.ts)** | Blocks file operations on protected paths (`.env`, `.git/`, `node_modules/`) | `onLoad`, `onToolCalled` |
|
|
50
|
+
| **[plan-mode.ts](./plan-mode.ts)** | Adds a Plan mode that enforces planning before coding | `onLoad`, `getModes`, `onAgentStarted` |
|
|
51
|
+
| **[pirate.ts](./pirate.ts)** | Adds a Pirate agent that speaks like a swashbuckling sea dog | `onLoad`, `getAgents`, `onAgentProfileUpdated` |
|
|
52
|
+
| **[permission-gate.ts](./permission-gate.ts)** | Prompts for confirmation before running dangerous bash commands (`rm -rf`, `sudo`, `chmod/chown 777`) | `onLoad`, `onToolCalled` |
|
|
53
|
+
| **[generate-tests.ts](./generate-tests.ts)** | Adds `/generate-tests` command to generate unit tests for files | `onLoad`, `getCommands` |
|
|
54
|
+
| **[sandbox/](./sandbox/)** | OS-level sandboxing for bash commands using `@anthropic-ai/sandbox-runtime` | `onLoad`, `onUnload`, `onTaskInitialized`, `onTaskClosed`, `onToolCalled` |
|
|
55
|
+
| **[rtk/](./rtk/)** | Transparently rewrites shell commands to RTK equivalents, reducing LLM token consumption by 60-90% | `onLoad`, `getCommands`, `onToolCalled` |
|
|
56
|
+
| **[chunkhound-search/](./chunkhound-search/)** | Provides `chunkhound-search` tool using ChunkHound for semantic code search | `onLoad`, `onUnload`, `onProjectOpen`, `onToolFinished`, `getTools` |
|
|
57
|
+
| **[chunkhound-on-semantic-search-tool/](./chunkhound-on-semantic-search-tool/)** | Overrides `power---semantic_search` to use ChunkHound for better semantic understanding | `onLoad`, `onUnload`, `onProjectOpen`, `onToolCalled`, `onToolFinished` |
|
|
58
|
+
| **[wakatime.ts](./wakatime.ts)** | Tracks coding activity by sending heartbeats to WakaTime via wakatime-cli | `onLoad`, `onPromptStarted`, `onPromptFinished`, `onToolFinished`, `onFilesAdded` |
|
|
59
|
+
| **[redact-secrets/](./redact-secrets/)** | Redacts secret values from `.env*` files in file read results | `onLoad`, `onProjectOpen`, `onToolFinished` |
|
|
60
|
+
| **[external-rules.ts](./external-rules.ts)** | Includes rule files from Cursor, Claude Code, and Roo Code configurations | `onLoad`, `onRuleFilesRetrieved` |
|
|
61
|
+
| **[ultrathink.ts](./ultrathink.ts)** | Detects prompts like "ultrathink" / "think hard" and increases OpenAI/OpenAI-compatible reasoning effort (`xhigh` for `-max` models, otherwise `high`) | `onLoad`, `onAgentStarted` |
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
### 1. Download Type Definitions
|
|
66
|
+
|
|
67
|
+
For TypeScript support and autocompletion, download the extension type definitions:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Download to your project
|
|
71
|
+
curl -o extension-types.d.ts https://raw.githubusercontent.com/hotovo/aider-desk/main/packages/extensions/extensions.d.ts
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. Install an Extension
|
|
75
|
+
|
|
76
|
+
Copy the extension file(s) to your AiderDesk extensions directory:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Global extensions (available to all projects)
|
|
80
|
+
cp sound-notification.ts ~/.aider-desk/extensions/
|
|
81
|
+
|
|
82
|
+
# Project-specific extensions
|
|
83
|
+
cp sound-notification.ts .aider-desk/extensions/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 3. Hot Reload
|
|
87
|
+
|
|
88
|
+
Extensions are automatically reloaded when files change. No restart needed!
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// src/cli.ts
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { existsSync, mkdirSync, cpSync, writeFileSync, rmSync } from "node:fs";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
import { Command } from "commander";
|
|
10
|
+
import { checkbox, confirm } from "@inquirer/prompts";
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import ora from "ora";
|
|
13
|
+
var require2 = createRequire(import.meta.url);
|
|
14
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
var __dirname = dirname(__filename);
|
|
16
|
+
var EXAMPLES_JSON_PATH = join(__dirname, "..", "examples.json");
|
|
17
|
+
var PACKAGE_VERSION = require2("../package.json").version;
|
|
18
|
+
function loadExamples() {
|
|
19
|
+
try {
|
|
20
|
+
return require2(EXAMPLES_JSON_PATH);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error(chalk.red("Error: Could not load examples.json"));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function getInstallDirectory(options) {
|
|
27
|
+
if (options.directory) {
|
|
28
|
+
return options.directory;
|
|
29
|
+
}
|
|
30
|
+
if (options.global) {
|
|
31
|
+
return join(homedir(), ".aider-desk", "extensions");
|
|
32
|
+
}
|
|
33
|
+
return join(process.cwd(), ".aider-desk", "extensions");
|
|
34
|
+
}
|
|
35
|
+
function isUrl(str) {
|
|
36
|
+
try {
|
|
37
|
+
new URL(str);
|
|
38
|
+
return true;
|
|
39
|
+
} catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function installExtensionById(extId, extensions, targetDir) {
|
|
44
|
+
const ext = extensions.find((e) => e.id === extId);
|
|
45
|
+
if (!ext) {
|
|
46
|
+
console.error(chalk.red(`
|
|
47
|
+
Error: Extension "${extId}" not found.`));
|
|
48
|
+
console.log(chalk.yellow("\nAvailable extensions:"));
|
|
49
|
+
extensions.forEach((e) => console.log(chalk.gray(` - ${e.id}`)));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
if (!existsSync(targetDir)) {
|
|
53
|
+
mkdirSync(targetDir, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
console.log(chalk.cyan(`
|
|
56
|
+
Installing ${ext.name} to: ${targetDir}
|
|
57
|
+
`));
|
|
58
|
+
const spinner = ora(`Installing ${ext.name}...`).start();
|
|
59
|
+
try {
|
|
60
|
+
const packageDir = join(__dirname, "..");
|
|
61
|
+
const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/hotovo/aider-desk/main/packages/extensions";
|
|
62
|
+
const GITHUB_REPO = "https://github.com/hotovo/aider-desk";
|
|
63
|
+
if (ext.type === "single" && ext.file) {
|
|
64
|
+
const localPath = join(packageDir, ext.file);
|
|
65
|
+
if (existsSync(localPath)) {
|
|
66
|
+
spinner.text = `Copying ${ext.name} from package...`;
|
|
67
|
+
const targetPath = join(targetDir, ext.file);
|
|
68
|
+
cpSync(localPath, targetPath);
|
|
69
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name}`));
|
|
70
|
+
} else {
|
|
71
|
+
spinner.text = `Downloading ${ext.name} from GitHub...`;
|
|
72
|
+
const url = `${GITHUB_RAW_BASE}/${ext.file}`;
|
|
73
|
+
const response = await fetch(url);
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
throw new Error(`Failed to download from GitHub: ${response.statusText}`);
|
|
76
|
+
}
|
|
77
|
+
const code = await response.text();
|
|
78
|
+
const targetPath = join(targetDir, ext.file);
|
|
79
|
+
writeFileSync(targetPath, code, "utf-8");
|
|
80
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name} from GitHub`));
|
|
81
|
+
}
|
|
82
|
+
} else if (ext.type === "folder" && ext.folder) {
|
|
83
|
+
const localPath = join(packageDir, ext.folder);
|
|
84
|
+
if (existsSync(localPath)) {
|
|
85
|
+
spinner.text = `Copying ${ext.name} from package...`;
|
|
86
|
+
const targetPath = join(targetDir, ext.folder);
|
|
87
|
+
cpSync(localPath, targetPath, { recursive: true });
|
|
88
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name}`));
|
|
89
|
+
if (ext.hasDependencies && existsSync(join(targetPath, "package.json"))) {
|
|
90
|
+
const installDeps = await confirm({
|
|
91
|
+
message: `${ext.name} has dependencies. Install them now?`,
|
|
92
|
+
default: true
|
|
93
|
+
});
|
|
94
|
+
if (installDeps) {
|
|
95
|
+
await installDependencies(targetPath);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
spinner.text = `Downloading ${ext.name} from GitHub...`;
|
|
100
|
+
const tempDir = join(process.cwd(), `.temp-ext-${Date.now()}`);
|
|
101
|
+
try {
|
|
102
|
+
await runCommand("git", ["clone", "--depth", "1", GITHUB_REPO, tempDir]);
|
|
103
|
+
const sourceDir = join(tempDir, "packages", "extensions", ext.folder);
|
|
104
|
+
const targetPath = join(targetDir, ext.folder);
|
|
105
|
+
if (!existsSync(sourceDir)) {
|
|
106
|
+
throw new Error(`Extension folder not found in repository`);
|
|
107
|
+
}
|
|
108
|
+
cpSync(sourceDir, targetPath, { recursive: true });
|
|
109
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name} from GitHub`));
|
|
110
|
+
if (ext.hasDependencies && existsSync(join(targetPath, "package.json"))) {
|
|
111
|
+
const installDeps = await confirm({
|
|
112
|
+
message: `${ext.name} has dependencies. Install them now?`,
|
|
113
|
+
default: true
|
|
114
|
+
});
|
|
115
|
+
if (installDeps) {
|
|
116
|
+
await installDependencies(targetPath);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
} finally {
|
|
120
|
+
if (existsSync(tempDir)) {
|
|
121
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
console.log(chalk.cyan("\n\u2728 Installation complete!\n"));
|
|
127
|
+
console.log(chalk.gray("Extensions will be automatically loaded when you restart AiderDesk."));
|
|
128
|
+
console.log(chalk.gray("Or they will hot-reload if AiderDesk is already running.\n"));
|
|
129
|
+
} catch (error) {
|
|
130
|
+
spinner.fail(chalk.red(`\u2717 Failed to install ${ext.name}: ${error}`));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function installFromUrl(url, targetDir) {
|
|
135
|
+
const spinner = ora("Downloading extension...").start();
|
|
136
|
+
try {
|
|
137
|
+
if (!existsSync(targetDir)) {
|
|
138
|
+
mkdirSync(targetDir, { recursive: true });
|
|
139
|
+
}
|
|
140
|
+
const urlPath = new URL(url).pathname;
|
|
141
|
+
const fileName = urlPath.split("/").pop() || "extension.ts";
|
|
142
|
+
if (fileName.endsWith(".ts") || fileName.endsWith(".js")) {
|
|
143
|
+
spinner.text = "Downloading single file extension...";
|
|
144
|
+
const response = await fetch(url);
|
|
145
|
+
if (!response.ok) {
|
|
146
|
+
throw new Error(`Failed to download: ${response.statusText}`);
|
|
147
|
+
}
|
|
148
|
+
const code = await response.text();
|
|
149
|
+
const targetPath = join(targetDir, fileName);
|
|
150
|
+
writeFileSync(targetPath, code, "utf-8");
|
|
151
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${fileName} to ${targetDir}`));
|
|
152
|
+
} else {
|
|
153
|
+
spinner.text = "Downloading extension folder...";
|
|
154
|
+
if (url.includes("github.com")) {
|
|
155
|
+
const tempDir = join(process.cwd(), `.temp-ext-${Date.now()}`);
|
|
156
|
+
try {
|
|
157
|
+
await runCommand("git", ["clone", "--depth", "1", url, tempDir]);
|
|
158
|
+
const extName = urlPath.split("/").pop() || "extension";
|
|
159
|
+
const sourceDir = join(tempDir, extName);
|
|
160
|
+
const targetPath = join(targetDir, extName);
|
|
161
|
+
if (existsSync(sourceDir)) {
|
|
162
|
+
cpSync(sourceDir, targetPath, { recursive: true });
|
|
163
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${extName} to ${targetDir}`));
|
|
164
|
+
if (existsSync(join(targetPath, "package.json"))) {
|
|
165
|
+
const installDeps = await confirm({
|
|
166
|
+
message: "This extension has dependencies. Install them now?",
|
|
167
|
+
default: true
|
|
168
|
+
});
|
|
169
|
+
if (installDeps) {
|
|
170
|
+
await installDependencies(targetPath);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
} else {
|
|
174
|
+
throw new Error(`Extension folder not found in repository`);
|
|
175
|
+
}
|
|
176
|
+
} finally {
|
|
177
|
+
if (existsSync(tempDir)) {
|
|
178
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
throw new Error("Only GitHub URLs are supported for folder extensions");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
spinner.fail(chalk.red(`Failed to install extension: ${error}`));
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async function installFromExamples(extensions, targetDir) {
|
|
191
|
+
console.log(chalk.cyan("\n\u{1F4E6} Available AiderDesk Extensions\n"));
|
|
192
|
+
const choices = extensions.map((ext) => ({
|
|
193
|
+
name: `${ext.name} - ${ext.description}`,
|
|
194
|
+
value: ext.id,
|
|
195
|
+
disabled: false
|
|
196
|
+
}));
|
|
197
|
+
const selectedIds = await checkbox({
|
|
198
|
+
message: "Select extensions to install (space to select, enter to confirm):",
|
|
199
|
+
choices,
|
|
200
|
+
pageSize: 15
|
|
201
|
+
});
|
|
202
|
+
if (selectedIds.length === 0) {
|
|
203
|
+
console.log(chalk.yellow("\nNo extensions selected. Exiting."));
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (!existsSync(targetDir)) {
|
|
207
|
+
mkdirSync(targetDir, { recursive: true });
|
|
208
|
+
}
|
|
209
|
+
console.log(chalk.cyan(`
|
|
210
|
+
Installing to: ${targetDir}
|
|
211
|
+
`));
|
|
212
|
+
for (const extId of selectedIds) {
|
|
213
|
+
const ext = extensions.find((e) => e.id === extId);
|
|
214
|
+
if (!ext) continue;
|
|
215
|
+
const spinner = ora(`Installing ${ext.name}...`).start();
|
|
216
|
+
try {
|
|
217
|
+
const packageDir = join(__dirname, "..");
|
|
218
|
+
if (ext.type === "single" && ext.file) {
|
|
219
|
+
const sourcePath = join(packageDir, ext.file);
|
|
220
|
+
const targetPath = join(targetDir, ext.file);
|
|
221
|
+
if (!existsSync(sourcePath)) {
|
|
222
|
+
spinner.fail(chalk.yellow(`\u26A0 ${ext.name} source file not found, skipping`));
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
cpSync(sourcePath, targetPath);
|
|
226
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name}`));
|
|
227
|
+
} else if (ext.type === "folder" && ext.folder) {
|
|
228
|
+
const sourcePath = join(packageDir, ext.folder);
|
|
229
|
+
const targetPath = join(targetDir, ext.folder);
|
|
230
|
+
if (!existsSync(sourcePath)) {
|
|
231
|
+
spinner.fail(chalk.yellow(`\u26A0 ${ext.name} source folder not found, skipping`));
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
cpSync(sourcePath, targetPath, { recursive: true });
|
|
235
|
+
spinner.succeed(chalk.green(`\u2713 Installed ${ext.name}`));
|
|
236
|
+
if (ext.hasDependencies && existsSync(join(targetPath, "package.json"))) {
|
|
237
|
+
const installDeps = await confirm({
|
|
238
|
+
message: `${ext.name} has dependencies. Install them now?`,
|
|
239
|
+
default: true
|
|
240
|
+
});
|
|
241
|
+
if (installDeps) {
|
|
242
|
+
await installDependencies(targetPath);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
} catch (error) {
|
|
247
|
+
spinner.fail(chalk.red(`\u2717 Failed to install ${ext.name}: ${error}`));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
console.log(chalk.cyan("\n\u2728 Installation complete!\n"));
|
|
251
|
+
console.log(chalk.gray("Extensions will be automatically loaded when you restart AiderDesk."));
|
|
252
|
+
console.log(chalk.gray("Or they will hot-reload if AiderDesk is already running.\n"));
|
|
253
|
+
}
|
|
254
|
+
async function installDependencies(targetPath) {
|
|
255
|
+
const spinner = ora("Installing dependencies...").start();
|
|
256
|
+
try {
|
|
257
|
+
await runCommand("npm", ["install"], { cwd: targetPath });
|
|
258
|
+
spinner.succeed(chalk.green("\u2713 Dependencies installed"));
|
|
259
|
+
} catch (error) {
|
|
260
|
+
spinner.fail(chalk.red(`Failed to install dependencies: ${error}`));
|
|
261
|
+
console.log(chalk.yellow(`You may need to manually run: cd ${targetPath} && npm install`));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function runCommand(command, args, options) {
|
|
265
|
+
return new Promise((resolve, reject) => {
|
|
266
|
+
const child = spawn(command, args, {
|
|
267
|
+
cwd: options?.cwd || process.cwd(),
|
|
268
|
+
stdio: "inherit",
|
|
269
|
+
shell: true
|
|
270
|
+
});
|
|
271
|
+
child.on("error", reject);
|
|
272
|
+
child.on("exit", (code) => {
|
|
273
|
+
if (code === 0) {
|
|
274
|
+
resolve();
|
|
275
|
+
} else {
|
|
276
|
+
reject(new Error(`Command failed with exit code ${code}`));
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async function main() {
|
|
282
|
+
const program = new Command();
|
|
283
|
+
program.name("aiderdesk-extensions").description("CLI tool for installing AiderDesk extensions").version(PACKAGE_VERSION);
|
|
284
|
+
program.command("install [extension]").description("Install AiderDesk extensions interactively, by ID, or from a URL").option("-d, --directory <path>", "Custom installation directory").option("-g, --global", "Install to global directory (~/.aider-desk/extensions)").action(async (extension, options) => {
|
|
285
|
+
const targetDir = getInstallDirectory(options);
|
|
286
|
+
const examples = loadExamples();
|
|
287
|
+
console.log(chalk.cyan.bold("\n\u{1F680} AiderDesk Extension Installer\n"));
|
|
288
|
+
if (extension) {
|
|
289
|
+
if (isUrl(extension)) {
|
|
290
|
+
await installFromUrl(extension, targetDir);
|
|
291
|
+
} else {
|
|
292
|
+
await installExtensionById(extension, examples.extensions, targetDir);
|
|
293
|
+
}
|
|
294
|
+
} else {
|
|
295
|
+
await installFromExamples(examples.extensions, targetDir);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
program.command("list").description("List all available example extensions").action(() => {
|
|
299
|
+
const examples = loadExamples();
|
|
300
|
+
console.log(chalk.cyan.bold("\n\u{1F4E6} Available AiderDesk Extensions\n"));
|
|
301
|
+
examples.extensions.forEach((ext) => {
|
|
302
|
+
console.log(chalk.white.bold(` ${ext.name}`));
|
|
303
|
+
console.log(chalk.gray(` ${ext.description}`));
|
|
304
|
+
console.log(chalk.gray(` Type: ${ext.type}`));
|
|
305
|
+
if (ext.hasDependencies) {
|
|
306
|
+
console.log(chalk.yellow(` \u26A0 Has dependencies`));
|
|
307
|
+
}
|
|
308
|
+
console.log();
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
program.parse();
|
|
312
|
+
}
|
|
313
|
+
main().catch((error) => {
|
|
314
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
315
|
+
process.exit(1);
|
|
316
|
+
});
|
package/examples.json
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extensions": [
|
|
3
|
+
{
|
|
4
|
+
"id": "wakatime",
|
|
5
|
+
"name": "WakaTime",
|
|
6
|
+
"description": "Tracks coding activity by sending heartbeats to WakaTime via wakatime-cli",
|
|
7
|
+
"file": "wakatime.ts",
|
|
8
|
+
"type": "single",
|
|
9
|
+
"capabilities": ["onLoad", "onPromptStarted", "onPromptFinished", "onToolFinished", "onFilesAdded"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "pirate",
|
|
13
|
+
"name": "Pirate Agent",
|
|
14
|
+
"description": "Adds a Pirate agent that speaks like a swashbuckling sea dog",
|
|
15
|
+
"file": "pirate.ts",
|
|
16
|
+
"type": "single",
|
|
17
|
+
"capabilities": ["onLoad", "getAgents", "onAgentProfileUpdated"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "generate-tests",
|
|
21
|
+
"name": "Generate Tests",
|
|
22
|
+
"description": "Adds /generate-tests command to generate unit tests for files",
|
|
23
|
+
"file": "generate-tests.ts",
|
|
24
|
+
"type": "single",
|
|
25
|
+
"capabilities": ["onLoad", "getCommands"]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "theme",
|
|
29
|
+
"name": "Theme Switcher",
|
|
30
|
+
"description": "Adds /theme command to switch AiderDesk themes",
|
|
31
|
+
"file": "theme.ts",
|
|
32
|
+
"type": "single",
|
|
33
|
+
"capabilities": ["onLoad", "getCommands"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "plan-mode",
|
|
37
|
+
"name": "Plan Mode",
|
|
38
|
+
"description": "Adds a Plan mode that enforces planning before coding",
|
|
39
|
+
"file": "plan-mode.ts",
|
|
40
|
+
"type": "single",
|
|
41
|
+
"capabilities": ["onLoad", "getModes", "onAgentStarted"]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "protected-paths",
|
|
45
|
+
"name": "Protected Paths",
|
|
46
|
+
"description": "Blocks file operations on protected paths (.env, .git/, node_modules/)",
|
|
47
|
+
"file": "protected-paths.ts",
|
|
48
|
+
"type": "single",
|
|
49
|
+
"capabilities": ["onLoad", "onToolCalled"]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "permission-gate",
|
|
53
|
+
"name": "Permission Gate",
|
|
54
|
+
"description": "Prompts for confirmation before running dangerous bash commands",
|
|
55
|
+
"file": "permission-gate.ts",
|
|
56
|
+
"type": "single",
|
|
57
|
+
"capabilities": ["onLoad", "onToolCalled"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "ultrathink",
|
|
61
|
+
"name": "Ultrathink",
|
|
62
|
+
"description": "Detects 'ultrathink' / 'think hard' and increases reasoning effort",
|
|
63
|
+
"file": "ultrathink.ts",
|
|
64
|
+
"type": "single",
|
|
65
|
+
"capabilities": ["onLoad", "onAgentStarted"]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "external-rules",
|
|
69
|
+
"name": "External Rules",
|
|
70
|
+
"description": "Includes rule files from Cursor, Claude Code, and Roo Code",
|
|
71
|
+
"file": "external-rules.ts",
|
|
72
|
+
"type": "single",
|
|
73
|
+
"capabilities": ["onLoad", "onRuleFilesRetrieved"]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "sound-notification",
|
|
77
|
+
"name": "Sound Notification",
|
|
78
|
+
"description": "Plays a 'Jobs Done' sound when a prompt finishes",
|
|
79
|
+
"file": "sound-notification.ts",
|
|
80
|
+
"type": "single",
|
|
81
|
+
"capabilities": ["onLoad", "onPromptFinished"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "sandbox",
|
|
85
|
+
"name": "Sandbox",
|
|
86
|
+
"description": "OS-level sandboxing for bash commands using @anthropic-ai/sandbox-runtime",
|
|
87
|
+
"folder": "sandbox",
|
|
88
|
+
"type": "folder",
|
|
89
|
+
"hasDependencies": true,
|
|
90
|
+
"capabilities": ["onLoad", "onUnload", "onTaskInitialized", "onTaskClosed", "onToolCalled"]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "rtk",
|
|
94
|
+
"name": "RTK Auto-Rewrite",
|
|
95
|
+
"description": "Rewrites shell commands to RTK equivalents, reducing token usage by 60-90%",
|
|
96
|
+
"folder": "rtk",
|
|
97
|
+
"type": "folder",
|
|
98
|
+
"hasDependencies": false,
|
|
99
|
+
"capabilities": ["onLoad", "getCommands", "onToolCalled"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "redact-secrets",
|
|
103
|
+
"name": "Redact Secrets",
|
|
104
|
+
"description": "Redacts secret values from .env* files in file read results",
|
|
105
|
+
"folder": "redact-secrets",
|
|
106
|
+
"type": "folder",
|
|
107
|
+
"hasDependencies": true,
|
|
108
|
+
"capabilities": ["onLoad", "onProjectOpen", "onToolFinished"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "chunkhound-search",
|
|
112
|
+
"name": "ChunkHound Search",
|
|
113
|
+
"description": "Provides chunkhound-search tool for semantic code search",
|
|
114
|
+
"folder": "chunkhound-search",
|
|
115
|
+
"type": "folder",
|
|
116
|
+
"hasDependencies": false,
|
|
117
|
+
"capabilities": ["onLoad", "onUnload", "onProjectOpen", "onToolFinished", "getTools"]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "chunkhound-on-semantic-search-tool",
|
|
121
|
+
"name": "ChunkHound Semantic Search Override",
|
|
122
|
+
"description": "Overrides power---semantic_search to use ChunkHound for better semantic understanding",
|
|
123
|
+
"folder": "chunkhound-on-semantic-search-tool",
|
|
124
|
+
"type": "folder",
|
|
125
|
+
"hasDependencies": false,
|
|
126
|
+
"capabilities": ["onLoad", "onUnload", "onProjectOpen", "onToolCalled", "onToolFinished"]
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|