@opencode-ai/plugin 0.3.126 → 0.3.128

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 CHANGED
@@ -1,5 +1,8 @@
1
- export const ExamplePlugin = async ({ app, client }) => {
1
+ export const ExamplePlugin = async ({ app, client, $ }) => {
2
2
  return {
3
3
  permission: {},
4
+ async "chat.params"(input, output) {
5
+ output.topP = 1;
6
+ },
4
7
  };
5
8
  };
package/dist/index.d.ts CHANGED
@@ -10,58 +10,41 @@ export interface Hooks {
10
10
  event?: (input: {
11
11
  event: Event;
12
12
  }) => Promise<void>;
13
- chat?: {
14
- /**
15
- * Called when a new message is received
16
- */
17
- message?: (input: {}, output: {
18
- message: UserMessage;
19
- parts: Part[];
20
- }) => Promise<void>;
21
- /**
22
- * Modify parameters sent to LLM
23
- */
24
- params?: (input: {
25
- model: Model;
26
- provider: Provider;
27
- message: UserMessage;
28
- }, output: {
29
- temperature: number;
30
- topP: number;
31
- }) => Promise<void>;
32
- };
33
- permission?: {
34
- /**
35
- * Called when a permission is asked
36
- */
37
- ask?: (input: Permission, output: {
38
- status: "ask" | "deny" | "allow";
39
- }) => Promise<void>;
40
- };
41
- tool?: {
42
- execute?: {
43
- /**
44
- * Called before a tool is executed
45
- */
46
- before?: (input: {
47
- tool: string;
48
- sessionID: string;
49
- callID: string;
50
- }, output: {
51
- args: any;
52
- }) => Promise<void>;
53
- /**
54
- * Called after a tool is executed
55
- */
56
- after?: (input: {
57
- tool: string;
58
- sessionID: string;
59
- callID: string;
60
- }, output: {
61
- title: string;
62
- output: string;
63
- metadata: any;
64
- }) => Promise<void>;
65
- };
66
- };
13
+ /**
14
+ * Called when a new message is received
15
+ */
16
+ "chat.message"?: (input: {}, output: {
17
+ message: UserMessage;
18
+ parts: Part[];
19
+ }) => Promise<void>;
20
+ /**
21
+ * Modify parameters sent to LLM
22
+ */
23
+ "chat.params"?: (input: {
24
+ model: Model;
25
+ provider: Provider;
26
+ message: UserMessage;
27
+ }, output: {
28
+ temperature: number;
29
+ topP: number;
30
+ }) => Promise<void>;
31
+ "permission.ask"?: (input: Permission, output: {
32
+ status: "ask" | "deny" | "allow";
33
+ }) => Promise<void>;
34
+ "tool.execute.before"?: (input: {
35
+ tool: string;
36
+ sessionID: string;
37
+ callID: string;
38
+ }, output: {
39
+ args: any;
40
+ }) => Promise<void>;
41
+ "tool.execute.after"?: (input: {
42
+ tool: string;
43
+ sessionID: string;
44
+ callID: string;
45
+ }, output: {
46
+ title: string;
47
+ output: string;
48
+ metadata: any;
49
+ }) => Promise<void>;
67
50
  }
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.3.126",
4
+ "version": "0.3.128",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit"
@@ -16,6 +16,6 @@
16
16
  "typescript": "5.8.2",
17
17
  "@hey-api/openapi-ts": "0.80.1",
18
18
  "@tsconfig/node22": "22.0.2",
19
- "@opencode-ai/sdk": "0.3.123"
19
+ "@opencode-ai/sdk": "0.3.127"
20
20
  }
21
21
  }