opencode-agent-modes 0.1.0 → 0.1.2

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
@@ -41,7 +41,7 @@ Add the plugin to your `opencode.json`:
41
41
  ```
42
42
 
43
43
  The following command files are automatically copied to
44
- `~/.config/opencode/command/` on installation:
44
+ `~/.config/opencode/command/` when the plugin initializes:
45
45
 
46
46
  - `mode-performance.md`
47
47
  - `mode-economy.md`
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview Command file installer for OpenCode slash commands.
3
+ *
4
+ * This module handles copying slash command markdown files from the plugin's
5
+ * commands directory to OpenCode's configuration directory during plugin
6
+ * initialization. This ensures command files are available without requiring
7
+ * manual postinstall script execution.
8
+ *
9
+ * @module config/command-installer
10
+ */
11
+ /**
12
+ * Copies slash command markdown files to OpenCode's command directory.
13
+ *
14
+ * This function is called during plugin initialization to ensure
15
+ * command files are available without manual postinstall execution.
16
+ * It creates the destination directory if it doesn't exist and copies
17
+ * all `.md` files from the source commands directory.
18
+ *
19
+ * The function is designed to be non-fatal: if copying fails (e.g., due to
20
+ * permission issues), it logs a warning but doesn't throw an error,
21
+ * allowing the plugin to continue initializing.
22
+ *
23
+ * @returns Number of files successfully copied, or -1 if source directory
24
+ * not found or an error occurred during copying
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const copied = copyCommandFiles();
29
+ * if (copied > 0) {
30
+ * console.log(`Copied ${copied} command files`);
31
+ * }
32
+ * ```
33
+ */
34
+ export declare function copyCommandFiles(): number;
@@ -1,3 +1,4 @@
1
1
  export * from './types.ts';
2
2
  export * from './loader.ts';
3
3
  export * from './initializer.ts';
4
+ export * from './command-installer.ts';