@opencode/plugin 0.0.0-dev-19911 → 0.0.0-dev-19913
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/promise/adapter.js
CHANGED
|
@@ -178,10 +178,10 @@ export function fromPromise(plugin) {
|
|
|
178
178
|
dispose: () => Effect.runPromiseWith(context)(registration.dispose),
|
|
179
179
|
}));
|
|
180
180
|
const run = (effect) => Effect.runPromiseWith(context)(effect);
|
|
181
|
-
const promiseExecutor = (execute) => (input,
|
|
182
|
-
...
|
|
183
|
-
progress: (update) => Effect.promise(() =>
|
|
184
|
-
}));
|
|
181
|
+
const promiseExecutor = (execute) => (input, tool) => Effect.runPromiseWith(context)(execute(input, {
|
|
182
|
+
...tool,
|
|
183
|
+
progress: (update) => Effect.promise(() => tool.progress(update)),
|
|
184
|
+
}), { signal: tool.signal });
|
|
185
185
|
const adaptApiMethod = (endpoint, method) => {
|
|
186
186
|
const compiled = compileEndpoint(endpoint);
|
|
187
187
|
return ((input) => Effect.gen(function* () {
|
|
@@ -441,7 +441,8 @@ export function fromPromise(plugin) {
|
|
|
441
441
|
function attempt(evaluate) {
|
|
442
442
|
return Effect.tryPromise({ try: evaluate, catch: (cause) => cause });
|
|
443
443
|
}
|
|
444
|
-
const executePromiseTool = (tool, input, context) => Effect.promise(() => tool.execute(input, {
|
|
444
|
+
const executePromiseTool = (tool, input, context) => Effect.promise((signal) => tool.execute(input, {
|
|
445
445
|
...context,
|
|
446
|
-
|
|
446
|
+
signal,
|
|
447
|
+
progress: (update) => Effect.runPromise(context.progress(update), { signal }),
|
|
447
448
|
}));
|
package/dist/promise/tool.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { SessionMessage } from "@opencode/schema/session-message";
|
|
|
7
7
|
import type { Types } from "effect";
|
|
8
8
|
import type { Hooks, Transform } from "./registration.js";
|
|
9
9
|
export interface ToolContext extends Omit<Tool.Context, "progress"> {
|
|
10
|
+
readonly signal: AbortSignal;
|
|
10
11
|
readonly progress: (update: Tool.Metadata) => Promise<void>;
|
|
11
12
|
}
|
|
12
13
|
export type Info<Input extends Tool.ValueSchema<any> = Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined = Tool.ValueSchema<any> | undefined> = Omit<Tool.Info<Input, Output>, "execute"> & {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/plugin",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19913",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ai-sdk/provider": "3.0.8",
|
|
46
|
-
"@opencode/ai": "0.0.0-dev-
|
|
47
|
-
"@opencode/client": "0.0.0-dev-
|
|
48
|
-
"@opencode/protocol": "0.0.0-dev-
|
|
49
|
-
"@opencode/schema": "0.0.0-dev-
|
|
50
|
-
"@opencode/util": "0.0.0-dev-
|
|
46
|
+
"@opencode/ai": "0.0.0-dev-19913",
|
|
47
|
+
"@opencode/client": "0.0.0-dev-19913",
|
|
48
|
+
"@opencode/protocol": "0.0.0-dev-19913",
|
|
49
|
+
"@opencode/schema": "0.0.0-dev-19913",
|
|
50
|
+
"@opencode/util": "0.0.0-dev-19913",
|
|
51
51
|
"@standard-schema/spec": "1.1.0",
|
|
52
52
|
"effect": "4.0.0-rc.112",
|
|
53
53
|
"zod": "4.1.8"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@opencode/theme": "0.0.0-dev-
|
|
56
|
+
"@opencode/theme": "0.0.0-dev-19913",
|
|
57
57
|
"@opentui/core": ">=0.5.10",
|
|
58
58
|
"@opentui/solid": ">=0.5.10",
|
|
59
59
|
"solid-js": ">=1.9.0"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@opencode/theme": "0.0.0-dev-
|
|
76
|
+
"@opencode/theme": "0.0.0-dev-19913",
|
|
77
77
|
"@opentui/core": "0.5.10",
|
|
78
78
|
"@opentui/solid": "0.5.10",
|
|
79
79
|
"@tsconfig/bun": "1.0.9",
|