@opencode-ai/plugin 0.0.0-next-17224 → 0.0.0-next-17226
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/tui/context.d.ts +73 -7
- package/package.json +6 -6
package/dist/tui/context.d.ts
CHANGED
|
@@ -124,13 +124,27 @@ export interface Page {
|
|
|
124
124
|
readonly data?: Record<string, any>;
|
|
125
125
|
}) => JSX.Element;
|
|
126
126
|
}
|
|
127
|
+
type PromptFooterInput = {
|
|
128
|
+
readonly sessionID?: string;
|
|
129
|
+
readonly mode: "normal" | "shell";
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* The host UI's slot tree. Every path is one slot: a named boundary a plugin
|
|
133
|
+
* may render around, inside, or take over. Paths are absolute and
|
|
134
|
+
* dot-separated, and a path contains every path it prefixes — replacing
|
|
135
|
+
* `prompt.footer` owns everything under `prompt.footer.*`.
|
|
136
|
+
*
|
|
137
|
+
* Each slot publishes an input: reactive props passed to every claim render
|
|
138
|
+
* targeting it. Inputs carry only what the SDK cannot answer — instance
|
|
139
|
+
* identity and client-local state. Paths and their inputs are documented
|
|
140
|
+
* API: coarse, few, and kept stable across host refactors.
|
|
141
|
+
*/
|
|
127
142
|
export interface SlotMap {
|
|
128
143
|
readonly app: Readonly<Record<string, never>>;
|
|
129
144
|
readonly "home.footer": Readonly<Record<string, never>>;
|
|
130
|
-
readonly "prompt.footer
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
};
|
|
145
|
+
readonly "prompt.footer": PromptFooterInput;
|
|
146
|
+
readonly "prompt.footer.status": PromptFooterInput;
|
|
147
|
+
readonly "prompt.footer.file": PromptFooterInput;
|
|
134
148
|
readonly "session.composer.top": {
|
|
135
149
|
readonly sessionID: string;
|
|
136
150
|
};
|
|
@@ -139,8 +153,59 @@ export interface SlotMap {
|
|
|
139
153
|
};
|
|
140
154
|
readonly "sidebar.footer": Readonly<Record<string, never>>;
|
|
141
155
|
}
|
|
142
|
-
export type
|
|
143
|
-
|
|
156
|
+
export type SlotPath = keyof SlotMap;
|
|
157
|
+
/**
|
|
158
|
+
* One contribution to the slot tree. Exactly one placement key names an
|
|
159
|
+
* absolute target path:
|
|
160
|
+
* - `prepend` / `append`: first/last inside the target's boundary
|
|
161
|
+
* - `before` / `after`: siblings adjacent to the target, outside its boundary
|
|
162
|
+
* - `replace`: take over the target. The boundary itself survives — siblings
|
|
163
|
+
* anchored `before`/`after` it still compose — but the original content and
|
|
164
|
+
* every claim inside the boundary are suppressed and recorded, never
|
|
165
|
+
* silently dropped. At the same target the last-enabled claim wins; an
|
|
166
|
+
* ancestor replacement beats a descendant one regardless of enable order.
|
|
167
|
+
*
|
|
168
|
+
* A claim aimed at a path the host no longer publishes degrades: additive
|
|
169
|
+
* claims append to the nearest surviving ancestor, replacements are
|
|
170
|
+
* suppressed. Several claims at one anchor coexist in plugin enable order.
|
|
171
|
+
*
|
|
172
|
+
* `render` receives the target slot's input, reactively. The `?: never`
|
|
173
|
+
* fields make the variants mutually exclusive: a claim with two placement
|
|
174
|
+
* keys is a type error, not a silent priority pick.
|
|
175
|
+
*/
|
|
176
|
+
export type SlotClaim<Path extends SlotPath = SlotPath> = Path extends SlotPath ? {
|
|
177
|
+
readonly render: (input: SlotMap[Path]) => JSX.Element;
|
|
178
|
+
} & ({
|
|
179
|
+
readonly prepend: Path;
|
|
180
|
+
readonly append?: never;
|
|
181
|
+
readonly before?: never;
|
|
182
|
+
readonly after?: never;
|
|
183
|
+
readonly replace?: never;
|
|
184
|
+
} | {
|
|
185
|
+
readonly append: Path;
|
|
186
|
+
readonly prepend?: never;
|
|
187
|
+
readonly before?: never;
|
|
188
|
+
readonly after?: never;
|
|
189
|
+
readonly replace?: never;
|
|
190
|
+
} | {
|
|
191
|
+
readonly before: Path;
|
|
192
|
+
readonly prepend?: never;
|
|
193
|
+
readonly append?: never;
|
|
194
|
+
readonly after?: never;
|
|
195
|
+
readonly replace?: never;
|
|
196
|
+
} | {
|
|
197
|
+
readonly after: Path;
|
|
198
|
+
readonly prepend?: never;
|
|
199
|
+
readonly append?: never;
|
|
200
|
+
readonly before?: never;
|
|
201
|
+
readonly replace?: never;
|
|
202
|
+
} | {
|
|
203
|
+
readonly replace: Path;
|
|
204
|
+
readonly prepend?: never;
|
|
205
|
+
readonly append?: never;
|
|
206
|
+
readonly before?: never;
|
|
207
|
+
readonly after?: never;
|
|
208
|
+
}) : never;
|
|
144
209
|
export interface App {
|
|
145
210
|
readonly version: string;
|
|
146
211
|
readonly channel: string;
|
|
@@ -332,7 +397,8 @@ export interface UI {
|
|
|
332
397
|
/** Closes an open tab, or the active tab when omitted, and returns false when no tab matched. */
|
|
333
398
|
close(sessionID?: string): boolean;
|
|
334
399
|
};
|
|
335
|
-
|
|
400
|
+
/** Claims a place in the slot tree; see SlotClaim. */
|
|
401
|
+
readonly slot: (claim: SlotClaim) => () => void;
|
|
336
402
|
}
|
|
337
403
|
export interface Context {
|
|
338
404
|
readonly options: Readonly<Record<string, any>>;
|
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-next-
|
|
4
|
+
"version": "0.0.0-next-17226",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ai-sdk/provider": "3.0.8",
|
|
39
|
-
"@opencode-ai/ai": "0.0.0-next-
|
|
40
|
-
"@opencode-ai/client": "0.0.0-next-
|
|
41
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
39
|
+
"@opencode-ai/ai": "0.0.0-next-17226",
|
|
40
|
+
"@opencode-ai/client": "0.0.0-next-17226",
|
|
41
|
+
"@opencode-ai/schema": "0.0.0-next-17226",
|
|
42
42
|
"@opencode-ai/sdk": "1.18.5",
|
|
43
43
|
"@standard-schema/spec": "1.1.0",
|
|
44
44
|
"effect": "4.0.0-beta.101",
|
|
45
45
|
"zod": "4.1.8"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@opencode-ai/theme": "0.0.0-next-
|
|
48
|
+
"@opencode-ai/theme": "0.0.0-next-17226",
|
|
49
49
|
"@opentui/core": "0.0.0-20260808-9ecf7c0a",
|
|
50
50
|
"@opentui/keymap": "0.0.0-20260808-9ecf7c0a",
|
|
51
51
|
"@opentui/solid": "0.0.0-20260808-9ecf7c0a",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@opencode-ai/theme": "0.0.0-next-
|
|
72
|
+
"@opencode-ai/theme": "0.0.0-next-17226",
|
|
73
73
|
"@opentui/core": "0.0.0-20260808-9ecf7c0a",
|
|
74
74
|
"@opentui/keymap": "0.0.0-20260808-9ecf7c0a",
|
|
75
75
|
"@opentui/solid": "0.0.0-20260808-9ecf7c0a",
|