@opencode-ai/plugin 0.0.0-opentui-202510312235 → 0.0.0-test-bedrock-202511260007

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 +99 -42
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -10,6 +10,93 @@ export type PluginInput = {
10
10
  $: BunShell;
11
11
  };
12
12
  export type Plugin = (input: PluginInput) => Promise<Hooks>;
13
+ export type AuthHook = {
14
+ provider: string;
15
+ loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>;
16
+ methods: ({
17
+ type: "oauth";
18
+ label: string;
19
+ prompts?: Array<{
20
+ type: "text";
21
+ key: string;
22
+ message: string;
23
+ placeholder?: string;
24
+ validate?: (value: string) => string | undefined;
25
+ condition?: (inputs: Record<string, string>) => boolean;
26
+ } | {
27
+ type: "select";
28
+ key: string;
29
+ message: string;
30
+ options: Array<{
31
+ label: string;
32
+ value: string;
33
+ hint?: string;
34
+ }>;
35
+ condition?: (inputs: Record<string, string>) => boolean;
36
+ }>;
37
+ authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>;
38
+ } | {
39
+ type: "api";
40
+ label: string;
41
+ prompts?: Array<{
42
+ type: "text";
43
+ key: string;
44
+ message: string;
45
+ placeholder?: string;
46
+ validate?: (value: string) => string | undefined;
47
+ condition?: (inputs: Record<string, string>) => boolean;
48
+ } | {
49
+ type: "select";
50
+ key: string;
51
+ message: string;
52
+ options: Array<{
53
+ label: string;
54
+ value: string;
55
+ hint?: string;
56
+ }>;
57
+ condition?: (inputs: Record<string, string>) => boolean;
58
+ }>;
59
+ authorize?(inputs?: Record<string, string>): Promise<{
60
+ type: "success";
61
+ key: string;
62
+ provider?: string;
63
+ } | {
64
+ type: "failed";
65
+ }>;
66
+ })[];
67
+ };
68
+ export type AuthOuathResult = {
69
+ url: string;
70
+ instructions: string;
71
+ } & ({
72
+ method: "auto";
73
+ callback(): Promise<({
74
+ type: "success";
75
+ provider?: string;
76
+ } & ({
77
+ refresh: string;
78
+ access: string;
79
+ expires: number;
80
+ } | {
81
+ key: string;
82
+ })) | {
83
+ type: "failed";
84
+ }>;
85
+ } | {
86
+ method: "code";
87
+ callback(code: string): Promise<({
88
+ type: "success";
89
+ provider?: string;
90
+ } & ({
91
+ refresh: string;
92
+ access: string;
93
+ expires: number;
94
+ } | {
95
+ key: string;
96
+ })) | {
97
+ type: "failed";
98
+ }>;
99
+ });
13
100
  export interface Hooks {
14
101
  event?: (input: {
15
102
  event: Event;
@@ -18,51 +105,19 @@ export interface Hooks {
18
105
  tool?: {
19
106
  [key: string]: ToolDefinition;
20
107
  };
21
- auth?: {
22
- provider: string;
23
- loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>;
24
- methods: ({
25
- type: "oauth";
26
- label: string;
27
- authorize(): Promise<{
28
- url: string;
29
- instructions: string;
30
- } & ({
31
- method: "auto";
32
- callback(): Promise<({
33
- type: "success";
34
- } & ({
35
- refresh: string;
36
- access: string;
37
- expires: number;
38
- } | {
39
- key: string;
40
- })) | {
41
- type: "failed";
42
- }>;
43
- } | {
44
- method: "code";
45
- callback(code: string): Promise<({
46
- type: "success";
47
- } & ({
48
- refresh: string;
49
- access: string;
50
- expires: number;
51
- } | {
52
- key: string;
53
- })) | {
54
- type: "failed";
55
- }>;
56
- })>;
57
- } | {
58
- type: "api";
59
- label: string;
60
- })[];
61
- };
108
+ auth?: AuthHook;
62
109
  /**
63
110
  * Called when a new message is received
64
111
  */
65
- "chat.message"?: (input: {}, output: {
112
+ "chat.message"?: (input: {
113
+ sessionID: string;
114
+ agent?: string;
115
+ model?: {
116
+ providerID: string;
117
+ modelID: string;
118
+ };
119
+ messageID?: string;
120
+ }, output: {
66
121
  message: UserMessage;
67
122
  parts: Part[];
68
123
  }) => Promise<void>;
@@ -70,6 +125,8 @@ export interface Hooks {
70
125
  * Modify parameters sent to LLM
71
126
  */
72
127
  "chat.params"?: (input: {
128
+ sessionID: string;
129
+ agent: string;
73
130
  model: Model;
74
131
  provider: Provider;
75
132
  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-opentui-202510312235",
4
+ "version": "0.0.0-test-bedrock-202511260007",
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-opentui-202510312235",
24
+ "@opencode-ai/sdk": "0.0.0-test-bedrock-202511260007",
25
25
  "zod": "4.1.8"
26
26
  },
27
27
  "devDependencies": {