@aiderdesk/extensions 0.1.0 → 0.2.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 CHANGED
@@ -44,21 +44,21 @@ For comprehensive documentation on creating and using extensions, see the [Exten
44
44
 
45
45
  | Extension | Description | Extension Functions |
46
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` |
47
+ | **[theme.ts](./extensions/theme.ts)** | Adds `/theme` command to switch AiderDesk themes | `onLoad`, `getCommands` |
48
+ | **[sound-notification.ts](./extensions/sound-notification.ts)** | Plays a "Jobs Done" sound when a prompt finishes | `onLoad`, `onPromptFinished` |
49
+ | **[protected-paths.ts](./extensions/protected-paths.ts)** | Blocks file operations on protected paths (`.env`, `.git/`, `node_modules/`) | `onLoad`, `onToolCalled` |
50
+ | **[plan-mode.ts](./extensions/plan-mode.ts)** | Adds a Plan mode that enforces planning before coding | `onLoad`, `getModes`, `onAgentStarted` |
51
+ | **[pirate.ts](./extensions/pirate.ts)** | Adds a Pirate agent that speaks like a swashbuckling sea dog | `onLoad`, `getAgents`, `onAgentProfileUpdated` |
52
+ | **[permission-gate.ts](./extensions/permission-gate.ts)** | Prompts for confirmation before running dangerous bash commands (`rm -rf`, `sudo`, `chmod/chown 777`) | `onLoad`, `onToolCalled` |
53
+ | **[generate-tests.ts](./extensions/generate-tests.ts)** | Adds `/generate-tests` command to generate unit tests for files | `onLoad`, `getCommands` |
54
+ | **[sandbox/](./extensions/sandbox/)** | OS-level sandboxing for bash commands using `@anthropic-ai/sandbox-runtime` | `onLoad`, `onUnload`, `onTaskInitialized`, `onTaskClosed`, `onToolCalled` |
55
+ | **[rtk/](./extensions/rtk/)** | Transparently rewrites shell commands to RTK equivalents, reducing LLM token consumption by 60-90% | `onLoad`, `getCommands`, `onToolCalled` |
56
+ | **[chunkhound-search/](./extensions/chunkhound-search/)** | Provides `chunkhound-search` tool using ChunkHound for semantic code search | `onLoad`, `onUnload`, `onProjectOpen`, `onToolFinished`, `getTools` |
57
+ | **[chunkhound-on-semantic-search-tool/](./extensions/chunkhound-on-semantic-search-tool/)** | Overrides `power---semantic_search` to use ChunkHound for better semantic understanding | `onLoad`, `onUnload`, `onProjectOpen`, `onToolCalled`, `onToolFinished` |
58
+ | **[wakatime.ts](./extensions/wakatime.ts)** | Tracks coding activity by sending heartbeats to WakaTime via wakatime-cli | `onLoad`, `onPromptStarted`, `onPromptFinished`, `onToolFinished`, `onFilesAdded` |
59
+ | **[redact-secrets/](./extensions/redact-secrets/)** | Redacts secret values from `.env*` files in file read results | `onLoad`, `onProjectOpen`, `onToolFinished` |
60
+ | **[external-rules.ts](./extensions/external-rules.ts)** | Includes rule files from Cursor, Claude Code, and Roo Code configurations | `onLoad`, `onRuleFilesRetrieved` |
61
+ | **[ultrathink.ts](./extensions/ultrathink.ts)** | Detects prompts like "ultrathink" / "think hard" and increases OpenAI/OpenAI-compatible reasoning effort (`xhigh` for `-max` models, otherwise `high`) | `onLoad`, `onAgentStarted` |
62
62
 
63
63
  ## Quick Start
64
64
 
@@ -77,10 +77,10 @@ Copy the extension file(s) to your AiderDesk extensions directory:
77
77
 
78
78
  ```bash
79
79
  # Global extensions (available to all projects)
80
- cp sound-notification.ts ~/.aider-desk/extensions/
80
+ cp extensions/sound-notification.ts ~/.aider-desk/extensions/
81
81
 
82
82
  # Project-specific extensions
83
- cp sound-notification.ts .aider-desk/extensions/
83
+ cp extensions/sound-notification.ts .aider-desk/extensions/
84
84
  ```
85
85
 
86
86
  ### 3. Hot Reload
package/dist/cli.js CHANGED
@@ -13,13 +13,14 @@ import ora from "ora";
13
13
  var require2 = createRequire(import.meta.url);
14
14
  var __filename = fileURLToPath(import.meta.url);
15
15
  var __dirname = dirname(__filename);
16
- var EXAMPLES_JSON_PATH = join(__dirname, "..", "examples.json");
16
+ var EXTENSIONS_JSON_PATH = join(__dirname, "..", "extensions.json");
17
+ var EXTENSIONS_DIR = join(__dirname, "..", "extensions");
17
18
  var PACKAGE_VERSION = require2("../package.json").version;
18
- function loadExamples() {
19
+ function loadExtensions() {
19
20
  try {
20
- return require2(EXAMPLES_JSON_PATH);
21
- } catch (error) {
22
- console.error(chalk.red("Error: Could not load examples.json"));
21
+ return require2(EXTENSIONS_JSON_PATH);
22
+ } catch {
23
+ console.error(chalk.red("Error: Could not load extensions.json"));
23
24
  process.exit(1);
24
25
  }
25
26
  }
@@ -57,11 +58,10 @@ Installing ${ext.name} to: ${targetDir}
57
58
  `));
58
59
  const spinner = ora(`Installing ${ext.name}...`).start();
59
60
  try {
60
- const packageDir = join(__dirname, "..");
61
- const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/hotovo/aider-desk/main/packages/extensions";
61
+ const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/hotovo/aider-desk/main/packages/extensions/extensions";
62
62
  const GITHUB_REPO = "https://github.com/hotovo/aider-desk";
63
63
  if (ext.type === "single" && ext.file) {
64
- const localPath = join(packageDir, ext.file);
64
+ const localPath = join(EXTENSIONS_DIR, ext.file);
65
65
  if (existsSync(localPath)) {
66
66
  spinner.text = `Copying ${ext.name} from package...`;
67
67
  const targetPath = join(targetDir, ext.file);
@@ -80,7 +80,7 @@ Installing ${ext.name} to: ${targetDir}
80
80
  spinner.succeed(chalk.green(`\u2713 Installed ${ext.name} from GitHub`));
81
81
  }
82
82
  } else if (ext.type === "folder" && ext.folder) {
83
- const localPath = join(packageDir, ext.folder);
83
+ const localPath = join(EXTENSIONS_DIR, ext.folder);
84
84
  if (existsSync(localPath)) {
85
85
  spinner.text = `Copying ${ext.name} from package...`;
86
86
  const targetPath = join(targetDir, ext.folder);
@@ -100,10 +100,10 @@ Installing ${ext.name} to: ${targetDir}
100
100
  const tempDir = join(process.cwd(), `.temp-ext-${Date.now()}`);
101
101
  try {
102
102
  await runCommand("git", ["clone", "--depth", "1", GITHUB_REPO, tempDir]);
103
- const sourceDir = join(tempDir, "packages", "extensions", ext.folder);
103
+ const sourceDir = join(tempDir, "packages", "extensions", "extensions", ext.folder);
104
104
  const targetPath = join(targetDir, ext.folder);
105
105
  if (!existsSync(sourceDir)) {
106
- throw new Error(`Extension folder not found in repository`);
106
+ throw new Error("Extension folder not found in repository");
107
107
  }
108
108
  cpSync(sourceDir, targetPath, { recursive: true });
109
109
  spinner.succeed(chalk.green(`\u2713 Installed ${ext.name} from GitHub`));
@@ -171,7 +171,7 @@ async function installFromUrl(url, targetDir) {
171
171
  }
172
172
  }
173
173
  } else {
174
- throw new Error(`Extension folder not found in repository`);
174
+ throw new Error("Extension folder not found in repository");
175
175
  }
176
176
  } finally {
177
177
  if (existsSync(tempDir)) {
@@ -211,12 +211,13 @@ Installing to: ${targetDir}
211
211
  `));
212
212
  for (const extId of selectedIds) {
213
213
  const ext = extensions.find((e) => e.id === extId);
214
- if (!ext) continue;
214
+ if (!ext) {
215
+ continue;
216
+ }
215
217
  const spinner = ora(`Installing ${ext.name}...`).start();
216
218
  try {
217
- const packageDir = join(__dirname, "..");
218
219
  if (ext.type === "single" && ext.file) {
219
- const sourcePath = join(packageDir, ext.file);
220
+ const sourcePath = join(EXTENSIONS_DIR, ext.file);
220
221
  const targetPath = join(targetDir, ext.file);
221
222
  if (!existsSync(sourcePath)) {
222
223
  spinner.fail(chalk.yellow(`\u26A0 ${ext.name} source file not found, skipping`));
@@ -225,7 +226,7 @@ Installing to: ${targetDir}
225
226
  cpSync(sourcePath, targetPath);
226
227
  spinner.succeed(chalk.green(`\u2713 Installed ${ext.name}`));
227
228
  } else if (ext.type === "folder" && ext.folder) {
228
- const sourcePath = join(packageDir, ext.folder);
229
+ const sourcePath = join(EXTENSIONS_DIR, ext.folder);
229
230
  const targetPath = join(targetDir, ext.folder);
230
231
  if (!existsSync(sourcePath)) {
231
232
  spinner.fail(chalk.yellow(`\u26A0 ${ext.name} source folder not found, skipping`));
@@ -283,7 +284,7 @@ async function main() {
283
284
  program.name("aiderdesk-extensions").description("CLI tool for installing AiderDesk extensions").version(PACKAGE_VERSION);
284
285
  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
286
  const targetDir = getInstallDirectory(options);
286
- const examples = loadExamples();
287
+ const examples = loadExtensions();
287
288
  console.log(chalk.cyan.bold("\n\u{1F680} AiderDesk Extension Installer\n"));
288
289
  if (extension) {
289
290
  if (isUrl(extension)) {
@@ -296,14 +297,14 @@ async function main() {
296
297
  }
297
298
  });
298
299
  program.command("list").description("List all available example extensions").action(() => {
299
- const examples = loadExamples();
300
+ const examples = loadExtensions();
300
301
  console.log(chalk.cyan.bold("\n\u{1F4E6} Available AiderDesk Extensions\n"));
301
302
  examples.extensions.forEach((ext) => {
302
303
  console.log(chalk.white.bold(` ${ext.name}`));
303
304
  console.log(chalk.gray(` ${ext.description}`));
304
305
  console.log(chalk.gray(` Type: ${ext.type}`));
305
306
  if (ext.hasDependencies) {
306
- console.log(chalk.yellow(` \u26A0 Has dependencies`));
307
+ console.log(chalk.yellow(" \u26A0 Has dependencies"));
307
308
  }
308
309
  console.log();
309
310
  });
@@ -124,6 +124,15 @@
124
124
  "type": "folder",
125
125
  "hasDependencies": false,
126
126
  "capabilities": ["onLoad", "onUnload", "onProjectOpen", "onToolCalled", "onToolFinished"]
127
+ },
128
+ {
129
+ "id": "tree-sitter-repo-map",
130
+ "name": "Tree-Sitter Repo Map",
131
+ "description": "Enhanced repository map using tree-sitter parsing with PageRank-based symbol ranking",
132
+ "folder": "tree-sitter-repo-map",
133
+ "type": "folder",
134
+ "hasDependencies": true,
135
+ "capabilities": ["onLoad", "onAgentStarted", "getCommands"]
127
136
  }
128
137
  ]
129
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiderdesk/extensions",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Type definitions and examples for AiderDesk extensions",
5
5
  "author": "Hotovo",
6
6
  "homepage": "https://aiderdesk.hotovo.com",
@@ -29,7 +29,7 @@
29
29
  "extensions.d.ts",
30
30
  "README.md",
31
31
  "dist/cli.js",
32
- "examples.json"
32
+ "extensions.json"
33
33
  ],
34
34
  "scripts": {
35
35
  "build": "dts-bundle-generator --external-imports zod node --project ../../tsconfig.node.json --no-check --no-banner -o extensions.d.ts ../../src/common/extensions.ts",