sjz-opencode-sdk 1.2.244 → 1.2.245

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +17 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -8,6 +8,14 @@ export type ProviderContext = {
8
8
  info: Provider;
9
9
  options: Record<string, any>;
10
10
  };
11
+ export type CommandInput = {
12
+ name: string;
13
+ template: string;
14
+ description?: string;
15
+ agent?: string;
16
+ model?: string;
17
+ subtask?: boolean;
18
+ };
11
19
  export type PluginInput = {
12
20
  client: ReturnType<typeof createOpencodeClient>;
13
21
  project: Project;
@@ -28,6 +36,15 @@ export type PluginInput = {
28
36
  * Get the list of currently registered agents.
29
37
  */
30
38
  listAgents: () => Promise<import("@opencode-ai/sdk/v2").Agent[]>;
39
+ /**
40
+ * Dynamically register a new command (slash command).
41
+ * The command will be available immediately in the TUI via `/name`.
42
+ */
43
+ registerCommand: (cmd: CommandInput) => Promise<void>;
44
+ /**
45
+ * Unregister a dynamically added command.
46
+ */
47
+ unregisterCommand: (name: string) => Promise<void>;
31
48
  };
32
49
  export type Plugin = (input: PluginInput) => Promise<Hooks>;
33
50
  export type AuthHook = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "sjz-opencode-sdk",
4
- "version": "1.2.244",
4
+ "version": "1.2.245",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "exports": {