sjz-opencode-sdk 1.2.245 → 1.2.271

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 +27 -0
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -16,6 +16,11 @@ export type CommandInput = {
16
16
  model?: string;
17
17
  subtask?: boolean;
18
18
  };
19
+ export type SkillInput = {
20
+ name: string;
21
+ description: string;
22
+ content: string;
23
+ };
19
24
  export type PluginInput = {
20
25
  client: ReturnType<typeof createOpencodeClient>;
21
26
  project: Project;
@@ -45,8 +50,22 @@ export type PluginInput = {
45
50
  * Unregister a dynamically added command.
46
51
  */
47
52
  unregisterCommand: (name: string) => Promise<void>;
53
+ /**
54
+ * Dynamically register a new skill.
55
+ * The skill will be available immediately without restarting.
56
+ */
57
+ registerSkill: (skill: SkillInput) => Promise<void>;
58
+ /**
59
+ * Unregister a dynamically added skill.
60
+ */
61
+ unregisterSkill: (name: string) => Promise<void>;
48
62
  };
49
63
  export type Plugin = (input: PluginInput) => Promise<Hooks>;
64
+ type Rule = {
65
+ key: string;
66
+ op: "eq" | "neq";
67
+ value: string;
68
+ };
50
69
  export type AuthHook = {
51
70
  provider: string;
52
71
  loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>;
@@ -59,7 +78,9 @@ export type AuthHook = {
59
78
  message: string;
60
79
  placeholder?: string;
61
80
  validate?: (value: string) => string | undefined;
81
+ /** @deprecated Use `when` instead */
62
82
  condition?: (inputs: Record<string, string>) => boolean;
83
+ when?: Rule;
63
84
  } | {
64
85
  type: "select";
65
86
  key: string;
@@ -69,7 +90,9 @@ export type AuthHook = {
69
90
  value: string;
70
91
  hint?: string;
71
92
  }>;
93
+ /** @deprecated Use `when` instead */
72
94
  condition?: (inputs: Record<string, string>) => boolean;
95
+ when?: Rule;
73
96
  }>;
74
97
  authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>;
75
98
  } | {
@@ -81,7 +104,9 @@ export type AuthHook = {
81
104
  message: string;
82
105
  placeholder?: string;
83
106
  validate?: (value: string) => string | undefined;
107
+ /** @deprecated Use `when` instead */
84
108
  condition?: (inputs: Record<string, string>) => boolean;
109
+ when?: Rule;
85
110
  } | {
86
111
  type: "select";
87
112
  key: string;
@@ -91,7 +116,9 @@ export type AuthHook = {
91
116
  value: string;
92
117
  hint?: string;
93
118
  }>;
119
+ /** @deprecated Use `when` instead */
94
120
  condition?: (inputs: Record<string, string>) => boolean;
121
+ when?: Rule;
95
122
  }>;
96
123
  authorize?(inputs?: Record<string, string>): Promise<{
97
124
  type: "success";
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.245",
4
+ "version": "1.2.271",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -18,7 +18,7 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@opencode-ai/sdk": "1.2.24",
21
+ "@opencode-ai/sdk": "1.2.27",
22
22
  "zod": "4.1.8"
23
23
  }
24
24
  }