@opencode-ai/plugin 0.0.0-v1-202510310553 → 0.0.0-windows-202511131746
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/dist/example.js +1 -5
- package/dist/index.d.ts +57 -2
- package/package.json +2 -2
package/dist/example.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { tool } from "./tool";
|
|
2
2
|
export const ExamplePlugin = async (ctx) => {
|
|
3
3
|
return {
|
|
4
|
-
permission: {},
|
|
5
4
|
tool: {
|
|
6
5
|
mytool: tool({
|
|
7
|
-
description: "This is a custom tool
|
|
6
|
+
description: "This is a custom tool",
|
|
8
7
|
args: {
|
|
9
8
|
foo: tool.schema.string().describe("foo"),
|
|
10
9
|
},
|
|
@@ -13,8 +12,5 @@ export const ExamplePlugin = async (ctx) => {
|
|
|
13
12
|
},
|
|
14
13
|
}),
|
|
15
14
|
},
|
|
16
|
-
async "chat.params"(_input, output) {
|
|
17
|
-
output.topP = 1;
|
|
18
|
-
},
|
|
19
15
|
};
|
|
20
16
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -24,13 +24,32 @@ export interface Hooks {
|
|
|
24
24
|
methods: ({
|
|
25
25
|
type: "oauth";
|
|
26
26
|
label: string;
|
|
27
|
-
|
|
27
|
+
prompts?: Array<{
|
|
28
|
+
type: "text";
|
|
29
|
+
key: string;
|
|
30
|
+
message: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
validate?: (value: string) => string | undefined;
|
|
33
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
34
|
+
} | {
|
|
35
|
+
type: "select";
|
|
36
|
+
key: string;
|
|
37
|
+
message: string;
|
|
38
|
+
options: Array<{
|
|
39
|
+
label: string;
|
|
40
|
+
value: string;
|
|
41
|
+
hint?: string;
|
|
42
|
+
}>;
|
|
43
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
44
|
+
}>;
|
|
45
|
+
authorize(inputs?: Record<string, string>): Promise<{
|
|
28
46
|
url: string;
|
|
29
47
|
instructions: string;
|
|
30
48
|
} & ({
|
|
31
49
|
method: "auto";
|
|
32
50
|
callback(): Promise<({
|
|
33
51
|
type: "success";
|
|
52
|
+
provider?: string;
|
|
34
53
|
} & ({
|
|
35
54
|
refresh: string;
|
|
36
55
|
access: string;
|
|
@@ -44,6 +63,7 @@ export interface Hooks {
|
|
|
44
63
|
method: "code";
|
|
45
64
|
callback(code: string): Promise<({
|
|
46
65
|
type: "success";
|
|
66
|
+
provider?: string;
|
|
47
67
|
} & ({
|
|
48
68
|
refresh: string;
|
|
49
69
|
access: string;
|
|
@@ -57,12 +77,45 @@ export interface Hooks {
|
|
|
57
77
|
} | {
|
|
58
78
|
type: "api";
|
|
59
79
|
label: string;
|
|
80
|
+
prompts?: Array<{
|
|
81
|
+
type: "text";
|
|
82
|
+
key: string;
|
|
83
|
+
message: string;
|
|
84
|
+
placeholder?: string;
|
|
85
|
+
validate?: (value: string) => string | undefined;
|
|
86
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
87
|
+
} | {
|
|
88
|
+
type: "select";
|
|
89
|
+
key: string;
|
|
90
|
+
message: string;
|
|
91
|
+
options: Array<{
|
|
92
|
+
label: string;
|
|
93
|
+
value: string;
|
|
94
|
+
hint?: string;
|
|
95
|
+
}>;
|
|
96
|
+
condition?: (inputs: Record<string, string>) => boolean;
|
|
97
|
+
}>;
|
|
98
|
+
authorize?(inputs?: Record<string, string>): Promise<{
|
|
99
|
+
type: "success";
|
|
100
|
+
key: string;
|
|
101
|
+
provider?: string;
|
|
102
|
+
} | {
|
|
103
|
+
type: "failed";
|
|
104
|
+
}>;
|
|
60
105
|
})[];
|
|
61
106
|
};
|
|
62
107
|
/**
|
|
63
108
|
* Called when a new message is received
|
|
64
109
|
*/
|
|
65
|
-
"chat.message"?: (input: {
|
|
110
|
+
"chat.message"?: (input: {
|
|
111
|
+
sessionID: string;
|
|
112
|
+
agent?: string;
|
|
113
|
+
model?: {
|
|
114
|
+
providerID: string;
|
|
115
|
+
modelID: string;
|
|
116
|
+
};
|
|
117
|
+
messageID?: string;
|
|
118
|
+
}, output: {
|
|
66
119
|
message: UserMessage;
|
|
67
120
|
parts: Part[];
|
|
68
121
|
}) => Promise<void>;
|
|
@@ -70,6 +123,8 @@ export interface Hooks {
|
|
|
70
123
|
* Modify parameters sent to LLM
|
|
71
124
|
*/
|
|
72
125
|
"chat.params"?: (input: {
|
|
126
|
+
sessionID: string;
|
|
127
|
+
agent: string;
|
|
73
128
|
model: Model;
|
|
74
129
|
provider: Provider;
|
|
75
130
|
message: UserMessage;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/plugin",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-windows-202511131746",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"typecheck": "tsgo --noEmit",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@opencode-ai/sdk": "0.0.0-
|
|
24
|
+
"@opencode-ai/sdk": "0.0.0-windows-202511131746",
|
|
25
25
|
"zod": "4.1.8"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|