@opencode/plugin 2.1.4 → 2.2.0
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/effect/event.d.ts +8 -2
- package/dist/effect/plugin.d.ts +4 -1
- package/dist/effect/session.d.ts +2 -2
- package/dist/effect/vcs.d.ts +1 -0
- package/dist/gui/browser.d.ts +36 -0
- package/dist/gui/browser.js +3 -0
- package/dist/gui/context.d.ts +271 -0
- package/dist/gui/context.js +0 -0
- package/dist/gui/core.d.ts +560 -0
- package/dist/gui/core.js +86 -0
- package/dist/gui/declarations.d.ts +24 -0
- package/dist/gui/declarations.js +0 -0
- package/dist/gui/file.d.ts +122 -0
- package/dist/gui/file.js +7 -0
- package/dist/gui/host-apis.d.ts +1925 -0
- package/dist/gui/host-apis.js +0 -0
- package/dist/gui/icon-name.d.ts +2 -0
- package/dist/gui/icon-name.js +1 -0
- package/dist/gui/index.d.ts +7 -0
- package/dist/gui/index.js +6 -0
- package/dist/gui/internal.d.ts +44 -0
- package/dist/gui/internal.js +33 -0
- package/dist/gui/main.d.ts +279 -0
- package/dist/gui/main.js +20 -0
- package/dist/gui/modules.d.ts +15 -0
- package/dist/gui/modules.js +30 -0
- package/dist/gui/plugin.d.ts +86 -0
- package/dist/gui/plugin.js +9 -0
- package/dist/gui/reactive.d.ts +93 -0
- package/dist/gui/reactive.js +130 -0
- package/dist/gui/registries.d.ts +783 -0
- package/dist/gui/registries.js +110 -0
- package/dist/gui/review.d.ts +73 -0
- package/dist/gui/review.js +3 -0
- package/dist/gui/scope.d.ts +64 -0
- package/dist/gui/scope.js +85 -0
- package/dist/gui/solid.d.ts +99 -0
- package/dist/gui/solid.js +74 -0
- package/dist/gui/vite.d.ts +24 -0
- package/dist/gui/vite.js +49 -0
- package/dist/host.d.ts +12 -1
- package/dist/host.js +34 -2
- package/dist/promise/adapter.js +13 -1
- package/dist/promise/event.d.ts +6 -2
- package/dist/promise/plugin.d.ts +4 -1
- package/dist/promise/session.d.ts +2 -2
- package/dist/runtime-modules.js +3 -1
- package/package.json +65 -15
package/dist/promise/adapter.js
CHANGED
|
@@ -227,12 +227,17 @@ export function fromPromise(plugin) {
|
|
|
227
227
|
activate: adaptApiMethod(CredentialEndpoints["credential.activate"], host.credential.activate),
|
|
228
228
|
},
|
|
229
229
|
event: {
|
|
230
|
-
subscribe: (options) => streams(host.event.subscribe().pipe(Stream.mapEffect((event) => encodeOpenCodeEvent(event)), Stream.map((event) => event)), options),
|
|
230
|
+
subscribe: (options) => streams(host.event.subscribe({ types: options?.types }).pipe(Stream.mapEffect((event) => encodeOpenCodeEvent(event)), Stream.map((event) => event)), options),
|
|
231
231
|
},
|
|
232
232
|
experimental: {
|
|
233
233
|
terminal: {
|
|
234
234
|
read: adaptApiMethod(ExperimentalEndpoints["persistentPty.read"], host.experimental.terminal.read),
|
|
235
235
|
},
|
|
236
|
+
generate: {
|
|
237
|
+
text: adaptApiMethod(GenerateEndpoints["generate.text"], host.experimental.generate.text),
|
|
238
|
+
image: adaptApiMethod(GenerateEndpoints["generate.image"], host.experimental.generate.image),
|
|
239
|
+
decisions: adaptApiMethod(GenerateEndpoints["generate.decisions"], host.experimental.generate.decisions),
|
|
240
|
+
},
|
|
236
241
|
},
|
|
237
242
|
generate: {
|
|
238
243
|
text: adaptApiMethod(GenerateEndpoints["generate.text"], host.generate.text),
|
|
@@ -443,6 +448,13 @@ export function fromPromise(plugin) {
|
|
|
443
448
|
move: adaptApiMethod(SessionEndpoints["session.move"], host.session.move),
|
|
444
449
|
wait: adaptApiMethod(SessionEndpoints["session.wait"], host.session.wait),
|
|
445
450
|
context: adaptApiMethod(SessionEndpoints["session.context"], host.session.context),
|
|
451
|
+
instructions: {
|
|
452
|
+
entry: {
|
|
453
|
+
list: adaptApiMethod(SessionEndpoints["session.instructions.entry.list"], host.session.instructions.entry.list),
|
|
454
|
+
put: adaptApiMethod(SessionEndpoints["session.instructions.entry.put"], host.session.instructions.entry.put),
|
|
455
|
+
remove: adaptApiMethod(SessionEndpoints["session.instructions.entry.remove"], host.session.instructions.entry.remove),
|
|
456
|
+
},
|
|
457
|
+
},
|
|
446
458
|
},
|
|
447
459
|
shell: {
|
|
448
460
|
hook: (name, callback) => register(host.shell.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
package/dist/promise/event.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { OpenCodeEvent } from "@opencode/client";
|
|
2
|
+
import type { SelectedEvent, SubscribeOptions } from "@opencode/client/promise/api";
|
|
3
|
+
type EventType = Exclude<OpenCodeEvent["type"], "server.connected">;
|
|
4
|
+
export interface EventDomain {
|
|
5
|
+
readonly subscribe: <Type extends EventType = EventType>(options?: SubscribeOptions<Type>) => AsyncIterable<SelectedEvent<OpenCodeEvent, Type>>;
|
|
3
6
|
}
|
|
7
|
+
export {};
|
package/dist/promise/plugin.d.ts
CHANGED
|
@@ -33,11 +33,14 @@ export interface Context {
|
|
|
33
33
|
readonly event: EventDomain;
|
|
34
34
|
readonly experimental: {
|
|
35
35
|
readonly terminal: Pick<OpenCodeClient["experimental"]["persistentPty"], "read">;
|
|
36
|
+
/** Stateless generation with a model and a prompt: no session, history or tools. */
|
|
37
|
+
readonly generate: GenerateApi;
|
|
36
38
|
};
|
|
37
39
|
readonly integration: IntegrationDomain;
|
|
38
40
|
readonly mcp: MCPDomain;
|
|
39
41
|
readonly model: ModelDomain;
|
|
40
|
-
|
|
42
|
+
/** @deprecated Use `experimental.generate.text`. */
|
|
43
|
+
readonly generate: Pick<GenerateApi, "text">;
|
|
41
44
|
readonly permission: PermissionDomain;
|
|
42
45
|
readonly plugin: Pick<PluginApi, "list">;
|
|
43
46
|
readonly provider: ProviderDomain;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionApi } from "@opencode/client/promise/api";
|
|
2
|
-
import type { GenerationOptionsFields, Message, SystemPart } from "@opencode/ai";
|
|
2
|
+
import type { GenerationOptionsFields, Message, SystemPart } from "@opencode/ai/effect";
|
|
3
3
|
import type { Agent } from "@opencode/schema/agent";
|
|
4
4
|
import type { Model } from "@opencode/schema/model";
|
|
5
5
|
import type { PromptInput } from "@opencode/schema/prompt-input";
|
|
@@ -141,6 +141,6 @@ export interface SessionHooks {
|
|
|
141
141
|
readonly "experimental.ws.receive": SessionWebSocketReceive;
|
|
142
142
|
readonly retry: SessionRetry;
|
|
143
143
|
}
|
|
144
|
-
export type SessionDomain = Pick<SessionApi, "list" | "create" | "get" | "remove" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "compact" | "synthetic" | "interrupt" | "update" | "move" | "wait" | "context"> & {
|
|
144
|
+
export type SessionDomain = Pick<SessionApi, "list" | "create" | "get" | "remove" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "compact" | "synthetic" | "interrupt" | "update" | "move" | "wait" | "context" | "instructions"> & {
|
|
145
145
|
readonly hook: ModelHooks<SessionHooks>;
|
|
146
146
|
};
|
package/dist/runtime-modules.js
CHANGED
|
@@ -29,10 +29,12 @@ export function discoverPluginRuntimeSpecifiers(from = import.meta.dir, packages
|
|
|
29
29
|
entries.set(pkgName, toLoadPath(rootEntry));
|
|
30
30
|
for (const file of new Bun.Glob(`**/*${ext}`).scanSync({ cwd: scanDir })) {
|
|
31
31
|
const normalized = file.replaceAll("\\", "/");
|
|
32
|
+
// The GUI SDK and its Vite preset (`gui/`) run in the desktop app and at build time, never in the server or the TUI.
|
|
32
33
|
if (normalized.startsWith("internal/") ||
|
|
33
34
|
normalized.includes("/internal/") ||
|
|
34
35
|
normalized.startsWith("source.") ||
|
|
35
|
-
normalized.startsWith("runtime")
|
|
36
|
+
normalized.startsWith("runtime") ||
|
|
37
|
+
normalized.startsWith("gui/")) {
|
|
36
38
|
continue;
|
|
37
39
|
}
|
|
38
40
|
const base = normalized.slice(0, -ext.length);
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/plugin",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "bun test --only-failures",
|
|
9
9
|
"typecheck": "bun check --no-script",
|
|
10
10
|
"typecheck:tsc": "tsc --noEmit",
|
|
11
|
-
"build": "tsc -p tsconfig.build.json"
|
|
11
|
+
"build": "tsc -p tsconfig.build.json",
|
|
12
|
+
"pack": "bun run script/pack.ts",
|
|
13
|
+
"generate": "bun script/icon-name.ts"
|
|
12
14
|
},
|
|
13
15
|
"exports": {
|
|
14
16
|
".": {
|
|
@@ -31,6 +33,34 @@
|
|
|
31
33
|
"import": "./dist/tui/index.js",
|
|
32
34
|
"types": "./dist/tui/index.d.ts"
|
|
33
35
|
},
|
|
36
|
+
"./gui": {
|
|
37
|
+
"import": "./dist/gui/index.js",
|
|
38
|
+
"types": "./dist/gui/index.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./gui/main": {
|
|
41
|
+
"import": "./dist/gui/main.js",
|
|
42
|
+
"types": "./dist/gui/main.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./gui/host": null,
|
|
45
|
+
"./gui/builtin": null,
|
|
46
|
+
"./gui/file": {
|
|
47
|
+
"import": "./dist/gui/file.js",
|
|
48
|
+
"types": "./dist/gui/file.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./gui/review": {
|
|
51
|
+
"import": "./dist/gui/review.js",
|
|
52
|
+
"types": "./dist/gui/review.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./gui/browser": {
|
|
55
|
+
"import": "./dist/gui/browser.js",
|
|
56
|
+
"types": "./dist/gui/browser.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./gui/updater": null,
|
|
59
|
+
"./gui/vite": {
|
|
60
|
+
"import": "./dist/gui/vite.js",
|
|
61
|
+
"types": "./dist/gui/vite.d.ts"
|
|
62
|
+
},
|
|
63
|
+
"./gui/*": null,
|
|
34
64
|
"./*": {
|
|
35
65
|
"import": "./dist/*.js",
|
|
36
66
|
"types": "./dist/*.d.ts"
|
|
@@ -48,18 +78,21 @@
|
|
|
48
78
|
],
|
|
49
79
|
"dependencies": {
|
|
50
80
|
"@ai-sdk/provider": "3.0.8",
|
|
51
|
-
"@opencode/ai": "2.
|
|
52
|
-
"@opencode/client": "2.
|
|
53
|
-
"@opencode/protocol": "2.
|
|
54
|
-
"@opencode/schema": "2.
|
|
55
|
-
"@opencode/util": "2.
|
|
81
|
+
"@opencode/ai": "2.2.0",
|
|
82
|
+
"@opencode/client": "2.2.0",
|
|
83
|
+
"@opencode/protocol": "2.2.0",
|
|
84
|
+
"@opencode/schema": "2.2.0",
|
|
85
|
+
"@opencode/util": "2.2.0",
|
|
56
86
|
"effect": "4.0.1"
|
|
57
87
|
},
|
|
58
88
|
"peerDependencies": {
|
|
59
|
-
"@opencode/theme": "2.
|
|
60
|
-
"@opentui/core": "
|
|
61
|
-
"@opentui/solid": "
|
|
62
|
-
"
|
|
89
|
+
"@opencode/theme": "2.2.0",
|
|
90
|
+
"@opentui/core": "0.7.0",
|
|
91
|
+
"@opentui/solid": "0.7.0",
|
|
92
|
+
"electron": "*",
|
|
93
|
+
"solid-js": ">=1.9.0",
|
|
94
|
+
"vite": ">=6",
|
|
95
|
+
"vite-plugin-solid": ">=2.11"
|
|
63
96
|
},
|
|
64
97
|
"peerDependenciesMeta": {
|
|
65
98
|
"@opencode/theme": {
|
|
@@ -71,20 +104,37 @@
|
|
|
71
104
|
"@opentui/solid": {
|
|
72
105
|
"optional": true
|
|
73
106
|
},
|
|
107
|
+
"electron": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
74
110
|
"solid-js": {
|
|
75
111
|
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"vite": {
|
|
114
|
+
"optional": true
|
|
115
|
+
},
|
|
116
|
+
"vite-plugin-solid": {
|
|
117
|
+
"optional": true
|
|
76
118
|
}
|
|
77
119
|
},
|
|
78
120
|
"devDependencies": {
|
|
79
|
-
"@opencode/theme": "2.
|
|
80
|
-
"@opentui/core": "0.
|
|
81
|
-
"@opentui/solid": "0.
|
|
121
|
+
"@opencode/theme": "2.2.0",
|
|
122
|
+
"@opentui/core": "0.7.0",
|
|
123
|
+
"@opentui/solid": "0.7.0",
|
|
82
124
|
"@tsconfig/bun": "1.0.9",
|
|
83
125
|
"@tsconfig/node22": "22.0.2",
|
|
84
126
|
"@types/bun": "1.4.3",
|
|
85
127
|
"@types/node": "24.12.2",
|
|
128
|
+
"electron": "44.9.1",
|
|
86
129
|
"solid-js": "1.9.15",
|
|
87
130
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
131
|
+
"vite": "7.3.6",
|
|
132
|
+
"vite-plugin-solid": "2.11.10",
|
|
88
133
|
"@typescript/native": "npm:typescript@7.1.0-beta"
|
|
134
|
+
},
|
|
135
|
+
"repository": {
|
|
136
|
+
"type": "git",
|
|
137
|
+
"url": "git+https://github.com/anomalyco/opencode.git",
|
|
138
|
+
"directory": "packages/plugin"
|
|
89
139
|
}
|
|
90
|
-
}
|
|
140
|
+
}
|