@opencode-ai/plugin 0.0.0-dev-19025 → 0.0.0-dev-202609031800
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-workspace.d.ts +3 -0
- package/dist/example-workspace.js +30 -0
- package/dist/example.d.ts +2 -0
- package/dist/example.js +16 -0
- package/dist/index.d.ts +322 -0
- package/dist/index.js +1 -0
- package/dist/shell.d.ts +109 -0
- package/dist/shell.js +1 -0
- package/dist/tool.d.ts +60 -0
- package/dist/tool.js +5 -0
- package/dist/tui.d.ts +510 -0
- package/dist/tui.js +7 -0
- package/dist/v2/effect/agent.d.ts +12 -0
- package/dist/v2/effect/agent.js +1 -0
- package/dist/{effect → v2/effect}/aisdk.d.ts +6 -9
- package/dist/v2/effect/aisdk.js +1 -0
- package/dist/v2/effect/catalog.d.ts +29 -0
- package/dist/v2/effect/catalog.js +1 -0
- package/dist/v2/effect/command.d.ts +11 -0
- package/dist/v2/effect/command.js +1 -0
- package/dist/v2/effect/context.d.ts +21 -0
- package/dist/v2/effect/context.js +1 -0
- package/dist/v2/effect/event.d.ts +8 -0
- package/dist/v2/effect/event.js +1 -0
- package/dist/v2/effect/filesystem.d.ts +23 -0
- package/dist/v2/effect/filesystem.js +1 -0
- package/dist/v2/effect/index.d.ts +3 -0
- package/dist/v2/effect/index.js +1 -0
- package/dist/v2/effect/integration.d.ts +46 -0
- package/dist/v2/effect/integration.js +1 -0
- package/dist/v2/effect/location.d.ts +6 -0
- package/dist/v2/effect/location.js +1 -0
- package/dist/v2/effect/npm.d.ts +7 -0
- package/dist/v2/effect/npm.js +1 -0
- package/dist/v2/effect/path.d.ts +8 -0
- package/dist/v2/effect/path.js +1 -0
- package/dist/v2/effect/plugin.d.ts +11 -0
- package/dist/v2/effect/reference.d.ts +10 -0
- package/dist/v2/effect/reference.js +1 -0
- package/dist/v2/effect/registration.d.ts +10 -0
- package/dist/v2/effect/registration.js +1 -0
- package/dist/v2/effect/skill.d.ts +9 -0
- package/dist/v2/effect/skill.js +1 -0
- package/dist/v2/options.js +1 -0
- package/dist/v2/promise/agent.d.ts +6 -0
- package/dist/v2/promise/agent.js +1 -0
- package/dist/{promise → v2/promise}/aisdk.d.ts +6 -9
- package/dist/v2/promise/aisdk.js +1 -0
- package/dist/v2/promise/catalog.d.ts +6 -0
- package/dist/v2/promise/catalog.js +1 -0
- package/dist/v2/promise/command.d.ts +6 -0
- package/dist/v2/promise/command.js +1 -0
- package/dist/v2/promise/context.d.ts +21 -0
- package/dist/v2/promise/context.js +1 -0
- package/dist/v2/promise/index.d.ts +12 -0
- package/dist/v2/promise/index.js +1 -0
- package/dist/v2/promise/integration.d.ts +12 -0
- package/dist/v2/promise/integration.js +1 -0
- package/dist/v2/promise/plugin.d.ts +10 -0
- package/dist/v2/promise/reference.d.ts +6 -0
- package/dist/v2/promise/reference.js +1 -0
- package/dist/v2/promise/registration.d.ts +9 -0
- package/dist/v2/promise/registration.js +1 -0
- package/dist/v2/promise/skill.d.ts +6 -0
- package/dist/v2/promise/skill.js +1 -0
- package/package.json +34 -39
- package/dist/app.d.ts +0 -5
- package/dist/app.js +0 -0
- package/dist/effect/agent.d.ts +0 -15
- package/dist/effect/agent.js +0 -0
- package/dist/effect/aisdk.js +0 -0
- package/dist/effect/catalog.d.ts +0 -33
- package/dist/effect/catalog.js +0 -2
- package/dist/effect/command.d.ts +0 -23
- package/dist/effect/command.js +0 -0
- package/dist/effect/event.d.ts +0 -3
- package/dist/effect/event.js +0 -0
- package/dist/effect/index.d.ts +0 -17
- package/dist/effect/index.js +0 -16
- package/dist/effect/integration.d.ts +0 -80
- package/dist/effect/integration.js +0 -2
- package/dist/effect/mcp.d.ts +0 -15
- package/dist/effect/mcp.js +0 -0
- package/dist/effect/permission.d.ts +0 -21
- package/dist/effect/permission.js +0 -0
- package/dist/effect/plugin.d.ts +0 -54
- package/dist/effect/reference.d.ts +0 -14
- package/dist/effect/reference.js +0 -0
- package/dist/effect/registration.d.ts +0 -13
- package/dist/effect/registration.js +0 -0
- package/dist/effect/rpc.d.ts +0 -19
- package/dist/effect/rpc.js +0 -0
- package/dist/effect/session.d.ts +0 -77
- package/dist/effect/session.js +0 -0
- package/dist/effect/shell.d.ts +0 -14
- package/dist/effect/shell.js +0 -0
- package/dist/effect/skill.d.ts +0 -15
- package/dist/effect/skill.js +0 -1
- package/dist/effect/storage.d.ts +0 -8
- package/dist/effect/storage.js +0 -0
- package/dist/effect/tool.d.ts +0 -52
- package/dist/effect/tool.js +0 -1
- package/dist/effect/vcs.d.ts +0 -41
- package/dist/effect/vcs.js +0 -0
- package/dist/effect/websearch.d.ts +0 -20
- package/dist/effect/websearch.js +0 -0
- package/dist/host.d.ts +0 -12
- package/dist/host.js +0 -33
- package/dist/options.js +0 -0
- package/dist/promise/adapter.d.ts +0 -12
- package/dist/promise/adapter.js +0 -424
- package/dist/promise/agent.d.ts +0 -15
- package/dist/promise/agent.js +0 -0
- package/dist/promise/aisdk.js +0 -0
- package/dist/promise/catalog.d.ts +0 -33
- package/dist/promise/catalog.js +0 -0
- package/dist/promise/command.d.ts +0 -22
- package/dist/promise/command.js +0 -0
- package/dist/promise/event.d.ts +0 -3
- package/dist/promise/event.js +0 -0
- package/dist/promise/index.d.ts +0 -18
- package/dist/promise/index.js +0 -16
- package/dist/promise/integration.d.ts +0 -79
- package/dist/promise/integration.js +0 -2
- package/dist/promise/mcp.d.ts +0 -15
- package/dist/promise/mcp.js +0 -0
- package/dist/promise/permission.d.ts +0 -21
- package/dist/promise/permission.js +0 -0
- package/dist/promise/plugin.d.ts +0 -55
- package/dist/promise/reference.d.ts +0 -13
- package/dist/promise/reference.js +0 -0
- package/dist/promise/registration.d.ts +0 -12
- package/dist/promise/registration.js +0 -0
- package/dist/promise/rpc.d.ts +0 -22
- package/dist/promise/rpc.js +0 -0
- package/dist/promise/session.d.ts +0 -77
- package/dist/promise/session.js +0 -0
- package/dist/promise/shell.d.ts +0 -14
- package/dist/promise/shell.js +0 -0
- package/dist/promise/skill.d.ts +0 -15
- package/dist/promise/skill.js +0 -0
- package/dist/promise/storage.d.ts +0 -8
- package/dist/promise/storage.js +0 -0
- package/dist/promise/tool.d.ts +0 -56
- package/dist/promise/tool.js +0 -2
- package/dist/promise/types.d.ts +0 -3
- package/dist/promise/types.js +0 -0
- package/dist/promise/vcs.d.ts +0 -50
- package/dist/promise/vcs.js +0 -0
- package/dist/promise/websearch.d.ts +0 -21
- package/dist/promise/websearch.js +0 -0
- package/dist/rpc.d.ts +0 -1
- package/dist/rpc.js +0 -1
- package/dist/storage.d.ts +0 -14
- package/dist/storage.js +0 -0
- package/dist/tui/context.d.ts +0 -428
- package/dist/tui/context.js +0 -0
- package/dist/tui/index.d.ts +0 -2
- package/dist/tui/index.js +0 -2
- package/dist/tui/plugin.d.ts +0 -8
- package/dist/tui/plugin.js +0 -3
- package/dist/tui/solid.d.ts +0 -7
- package/dist/tui/solid.js +0 -16
- /package/dist/{effect → v2/effect}/plugin.js +0 -0
- /package/dist/{options.d.ts → v2/options.d.ts} +0 -0
- /package/dist/{promise → v2/promise}/plugin.js +0 -0
package/dist/promise/adapter.js
DELETED
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { Tool } from "@opencode-ai/schema/tool";
|
|
2
|
-
import { Effect, Schema, SchemaAST, Stream } from "effect";
|
|
3
|
-
import { HttpApiEndpoint, HttpApiSchema } from "effect/unstable/httpapi";
|
|
4
|
-
import { define } from "../effect/plugin.js";
|
|
5
|
-
const compiledEndpoints = new WeakMap();
|
|
6
|
-
class ReturnedRpcError extends Error {
|
|
7
|
-
type;
|
|
8
|
-
data;
|
|
9
|
-
constructor(type, message, data) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.type = type;
|
|
12
|
-
this.data = data;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const makeStreams = Effect.fn("Plugin.Event.makeStreams")(function* () {
|
|
16
|
-
const context = yield* Effect.context();
|
|
17
|
-
const subscriptions = new Set();
|
|
18
|
-
// Async iterators own separate scopes, so close them when the plugin unloads.
|
|
19
|
-
yield* Effect.addFinalizer(() => Effect.promise(() => Promise.all(Array.from(subscriptions, (close) => close()))));
|
|
20
|
-
return ((stream, options) => ({
|
|
21
|
-
[Symbol.asyncIterator]() {
|
|
22
|
-
const iterator = Stream.toAsyncIterableWith(stream, context)[Symbol.asyncIterator]();
|
|
23
|
-
const close = () => {
|
|
24
|
-
subscriptions.delete(close);
|
|
25
|
-
options?.signal?.removeEventListener("abort", abort);
|
|
26
|
-
return iterator.return?.() ?? Promise.resolve({ done: true, value: undefined });
|
|
27
|
-
};
|
|
28
|
-
const abort = () => {
|
|
29
|
-
void close();
|
|
30
|
-
};
|
|
31
|
-
subscriptions.add(close);
|
|
32
|
-
options?.signal?.addEventListener("abort", abort, { once: true });
|
|
33
|
-
if (options?.signal?.aborted)
|
|
34
|
-
abort();
|
|
35
|
-
return {
|
|
36
|
-
next: () => iterator.next().then((result) => (result.done ? close().then(() => result) : result), (error) => close().then(() => Promise.reject(error))),
|
|
37
|
-
return: close,
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
}));
|
|
41
|
-
});
|
|
42
|
-
const rpcFromEffect = Effect.fn("Plugin.Rpc.fromEffect")(function* (host, streams) {
|
|
43
|
-
const context = yield* Effect.context();
|
|
44
|
-
const run = Effect.runPromiseWith(context);
|
|
45
|
-
const client = (definition) => {
|
|
46
|
-
const local = host(definition);
|
|
47
|
-
const subscribe = (name, options) => streams(local.events.subscribe(name), options);
|
|
48
|
-
return Object.assign(Object.fromEntries(Object.keys(definition.methods).map((name) => [
|
|
49
|
-
name,
|
|
50
|
-
(input, options) => {
|
|
51
|
-
// SAFETY: The local client was built from this definition, so every declared key is an Effect method.
|
|
52
|
-
// oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
|
|
53
|
-
const method = local[name];
|
|
54
|
-
return run(method(input), { signal: options?.signal });
|
|
55
|
-
},
|
|
56
|
-
])), {
|
|
57
|
-
events: {
|
|
58
|
-
subscribe,
|
|
59
|
-
on: (name, handler, options) => {
|
|
60
|
-
const controller = new AbortController();
|
|
61
|
-
const signal = options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
|
|
62
|
-
void (async () => {
|
|
63
|
-
for await (const event of subscribe(name, { signal }))
|
|
64
|
-
await handler(event);
|
|
65
|
-
})().catch((error) => run(Effect.logError(error)));
|
|
66
|
-
return () => controller.abort();
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
const register = (definition, handlers) => run(host.register(definition,
|
|
72
|
-
// SAFETY: Each entry preserves its definition key; Core restores that method's erased schema and error types.
|
|
73
|
-
// oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
|
|
74
|
-
Object.fromEntries(Object.entries(handlers).map(([name, handler]) => [
|
|
75
|
-
name,
|
|
76
|
-
(input, context) => Effect.tryPromise({
|
|
77
|
-
try: (signal) => {
|
|
78
|
-
// SAFETY: Promise RPC handlers return Promise values before this adapter erases their concrete types.
|
|
79
|
-
// oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
|
|
80
|
-
return Reflect.apply(handler, undefined, [
|
|
81
|
-
input,
|
|
82
|
-
{
|
|
83
|
-
signal,
|
|
84
|
-
error: (type, message, data) => new ReturnedRpcError(type, message, data),
|
|
85
|
-
},
|
|
86
|
-
]);
|
|
87
|
-
},
|
|
88
|
-
catch: (error) => hostRpcError(context, error),
|
|
89
|
-
}).pipe(Effect.flatMap((result) => result instanceof ReturnedRpcError
|
|
90
|
-
? Effect.fail(hostRpcError(context, result))
|
|
91
|
-
: Effect.succeed(result))),
|
|
92
|
-
])))).then((registration) => ({
|
|
93
|
-
dispose: () => run(registration.dispose),
|
|
94
|
-
events: { emit: (...args) => run(registration.events.emit(...args)) },
|
|
95
|
-
}));
|
|
96
|
-
// SAFETY: Client and register implement RpcDomain from the same portable definitions and schema adapters.
|
|
97
|
-
// oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
|
|
98
|
-
return Object.assign(client, { register });
|
|
99
|
-
});
|
|
100
|
-
function hostRpcError(context, error) {
|
|
101
|
-
if (!(error instanceof ReturnedRpcError))
|
|
102
|
-
return error;
|
|
103
|
-
return context.error(error.type, error.message, error.data);
|
|
104
|
-
}
|
|
105
|
-
function compileEndpoint(endpoint) {
|
|
106
|
-
const cached = compiledEndpoints.get(endpoint);
|
|
107
|
-
if (cached)
|
|
108
|
-
return cached;
|
|
109
|
-
const payloadSchemas = Array.from(endpoint.payload.values()).flatMap(({ schemas }) => schemas);
|
|
110
|
-
const successSchemas = Array.from(endpoint.success);
|
|
111
|
-
if (payloadSchemas.length > 1 || successSchemas.length > 1) {
|
|
112
|
-
throw new Error(`Unsupported API schema cardinality: ${endpoint.identifier}`);
|
|
113
|
-
}
|
|
114
|
-
const inputs = [
|
|
115
|
-
endpoint.params,
|
|
116
|
-
endpoint.query === undefined ? undefined : Schema.toType(endpoint.query),
|
|
117
|
-
endpoint.headers,
|
|
118
|
-
...payloadSchemas,
|
|
119
|
-
].filter((schema) => schema !== undefined);
|
|
120
|
-
const success = (successSchemas[0] ?? HttpApiSchema.NoContent);
|
|
121
|
-
const noContent = HttpApiSchema.isNoContent(success.ast);
|
|
122
|
-
const type = Schema.toType(success).ast;
|
|
123
|
-
const data = SchemaAST.isObjects(success.ast)
|
|
124
|
-
? success.ast.propertySignatures.find((property) => property.name === "data")
|
|
125
|
-
: undefined;
|
|
126
|
-
const output = !noContent &&
|
|
127
|
-
SchemaAST.isObjects(type) &&
|
|
128
|
-
type.indexSignatures.length === 0 &&
|
|
129
|
-
type.propertySignatures.length === 1 &&
|
|
130
|
-
type.propertySignatures[0]?.name === "data" &&
|
|
131
|
-
data !== undefined
|
|
132
|
-
? Schema.make(data.type)
|
|
133
|
-
: success;
|
|
134
|
-
const compiled = {
|
|
135
|
-
decode: inputs.map((schema) => Schema.decodeUnknownEffect(schema)),
|
|
136
|
-
encode: Schema.encodeUnknownEffect(output),
|
|
137
|
-
noContent,
|
|
138
|
-
};
|
|
139
|
-
compiledEndpoints.set(endpoint, compiled);
|
|
140
|
-
return compiled;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Adapts a Promise plugin into an Effect plugin so the existing Effect-only
|
|
144
|
-
* Core plugin runtime can run it unchanged.
|
|
145
|
-
*
|
|
146
|
-
* Hook registrations created during the async `setup` attach to the plugin's
|
|
147
|
-
* scope, so unloading the plugin disposes them. The captured fiber context
|
|
148
|
-
* preserves boot-time batching, so Promise-plugin transforms still coalesce
|
|
149
|
-
* into one reload per domain.
|
|
150
|
-
*/
|
|
151
|
-
export function fromPromise(plugin) {
|
|
152
|
-
return define({
|
|
153
|
-
id: plugin.id,
|
|
154
|
-
effect: (host) => Effect.gen(function* () {
|
|
155
|
-
const [{ ClientApi }, { OpenCodeEvent }] = yield* Effect.promise(() => Promise.all([import("@opencode-ai/protocol/client"), import("@opencode-ai/protocol/groups/event")]));
|
|
156
|
-
const AgentEndpoints = ClientApi.groups["server.agent"].endpoints;
|
|
157
|
-
const CommandEndpoints = ClientApi.groups["server.command"].endpoints;
|
|
158
|
-
const ExperimentalEndpoints = ClientApi.groups["server.experimental"].endpoints;
|
|
159
|
-
const GenerateEndpoints = ClientApi.groups["server.generate"].endpoints;
|
|
160
|
-
const IntegrationEndpoints = ClientApi.groups["server.integration"].endpoints;
|
|
161
|
-
const McpEndpoints = ClientApi.groups["server.mcp"].endpoints;
|
|
162
|
-
const ModelEndpoints = ClientApi.groups["server.model"].endpoints;
|
|
163
|
-
const PluginEndpoints = ClientApi.groups["server.plugin"].endpoints;
|
|
164
|
-
const PermissionEndpoints = ClientApi.groups["server.permission"].endpoints;
|
|
165
|
-
const ProviderEndpoints = ClientApi.groups["server.provider"].endpoints;
|
|
166
|
-
const ReferenceEndpoints = ClientApi.groups["server.reference"].endpoints;
|
|
167
|
-
const SessionEndpoints = ClientApi.groups["server.session"].endpoints;
|
|
168
|
-
const SkillEndpoints = ClientApi.groups["server.skill"].endpoints;
|
|
169
|
-
const VcsEndpoints = ClientApi.groups["server.vcs"].endpoints;
|
|
170
|
-
const WebSearchEndpoints = ClientApi.groups["server.websearch"].endpoints;
|
|
171
|
-
const context = yield* Effect.context();
|
|
172
|
-
const streams = yield* makeStreams();
|
|
173
|
-
// Run a hook registration on the plugin scope and resolve once it is registered.
|
|
174
|
-
const register = (effect) => Effect.runPromiseWith(context)(effect).then((registration) => ({
|
|
175
|
-
dispose: () => Effect.runPromiseWith(context)(registration.dispose),
|
|
176
|
-
}));
|
|
177
|
-
const run = (effect) => Effect.runPromiseWith(context)(effect);
|
|
178
|
-
const promiseExecutor = (execute) => (input, context) => run(execute(input, {
|
|
179
|
-
...context,
|
|
180
|
-
progress: (update) => Effect.promise(() => context.progress(update)),
|
|
181
|
-
}));
|
|
182
|
-
const adaptApiMethod = (endpoint, method) => {
|
|
183
|
-
const compiled = compileEndpoint(endpoint);
|
|
184
|
-
return ((input) => Effect.gen(function* () {
|
|
185
|
-
const decoded = yield* Effect.forEach(compiled.decode, (decode) => decode(input ?? {}));
|
|
186
|
-
const result = yield* method(Object.assign({}, ...decoded));
|
|
187
|
-
if (compiled.noContent)
|
|
188
|
-
return undefined;
|
|
189
|
-
return yield* compiled.encode(result);
|
|
190
|
-
}).pipe(Effect.runPromiseWith(context)));
|
|
191
|
-
};
|
|
192
|
-
const transform = (domain) => (callback) => register(domain.transform((editor) => {
|
|
193
|
-
callback(editor);
|
|
194
|
-
}));
|
|
195
|
-
const context2 = {
|
|
196
|
-
app: host.app,
|
|
197
|
-
location: host.location,
|
|
198
|
-
options: host.options,
|
|
199
|
-
agent: {
|
|
200
|
-
get: adaptApiMethod(AgentEndpoints["agent.get"], host.agent.get),
|
|
201
|
-
list: adaptApiMethod(AgentEndpoints["agent.list"], host.agent.list),
|
|
202
|
-
transform: transform(host.agent),
|
|
203
|
-
reload: () => run(host.agent.reload()),
|
|
204
|
-
},
|
|
205
|
-
aisdk: {
|
|
206
|
-
hook: (name, callback, options) => register(host.aisdk.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))), options)),
|
|
207
|
-
},
|
|
208
|
-
catalog: {
|
|
209
|
-
provider: {
|
|
210
|
-
list: adaptApiMethod(ProviderEndpoints["provider.list"], host.catalog.provider.list),
|
|
211
|
-
get: adaptApiMethod(ProviderEndpoints["provider.get"], host.catalog.provider.get),
|
|
212
|
-
},
|
|
213
|
-
model: {
|
|
214
|
-
list: adaptApiMethod(ModelEndpoints["model.list"], host.catalog.model.list),
|
|
215
|
-
default: adaptApiMethod(ModelEndpoints["model.default"], host.catalog.model.default),
|
|
216
|
-
},
|
|
217
|
-
transform: transform(host.catalog),
|
|
218
|
-
reload: () => run(host.catalog.reload()),
|
|
219
|
-
},
|
|
220
|
-
command: {
|
|
221
|
-
list: adaptApiMethod(CommandEndpoints["command.list"], host.command.list),
|
|
222
|
-
transform: (callback) => register(host.command.transform((editor) => callback({
|
|
223
|
-
add: (definition) => editor.add({
|
|
224
|
-
...definition,
|
|
225
|
-
execute: (input) => Effect.tryPromise({ try: () => definition.execute(input), catch: (cause) => cause }),
|
|
226
|
-
}),
|
|
227
|
-
}))),
|
|
228
|
-
reload: () => run(host.command.reload()),
|
|
229
|
-
},
|
|
230
|
-
event: {
|
|
231
|
-
subscribe: (options) => streams(host.event.subscribe().pipe(Stream.mapEffect((event) => Schema.encodeUnknownEffect(OpenCodeEvent)(event)), Stream.map((event) => event)), options),
|
|
232
|
-
},
|
|
233
|
-
experimental: {
|
|
234
|
-
terminal: {
|
|
235
|
-
read: adaptApiMethod(ExperimentalEndpoints["persistentPty.read"], host.experimental.terminal.read),
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
generate: {
|
|
239
|
-
text: adaptApiMethod(GenerateEndpoints["generate.text"], host.generate.text),
|
|
240
|
-
},
|
|
241
|
-
integration: {
|
|
242
|
-
list: adaptApiMethod(IntegrationEndpoints["integration.list"], host.integration.list),
|
|
243
|
-
get: adaptApiMethod(IntegrationEndpoints["integration.get"], host.integration.get),
|
|
244
|
-
connect: {
|
|
245
|
-
key: adaptApiMethod(IntegrationEndpoints["integration.connect.key"], host.integration.connect.key),
|
|
246
|
-
},
|
|
247
|
-
oauth: {
|
|
248
|
-
connect: adaptApiMethod(IntegrationEndpoints["integration.oauth.connect"], host.integration.oauth.connect),
|
|
249
|
-
status: adaptApiMethod(IntegrationEndpoints["integration.oauth.status"], host.integration.oauth.status),
|
|
250
|
-
complete: adaptApiMethod(IntegrationEndpoints["integration.oauth.complete"], host.integration.oauth.complete),
|
|
251
|
-
cancel: adaptApiMethod(IntegrationEndpoints["integration.oauth.cancel"], host.integration.oauth.cancel),
|
|
252
|
-
},
|
|
253
|
-
command: {
|
|
254
|
-
connect: adaptApiMethod(IntegrationEndpoints["integration.command.connect"], host.integration.command.connect),
|
|
255
|
-
status: adaptApiMethod(IntegrationEndpoints["integration.command.status"], host.integration.command.status),
|
|
256
|
-
cancel: adaptApiMethod(IntegrationEndpoints["integration.command.cancel"], host.integration.command.cancel),
|
|
257
|
-
},
|
|
258
|
-
transform: (callback) => register(host.integration.transform((editor) => callback({
|
|
259
|
-
list: editor.list,
|
|
260
|
-
get: editor.get,
|
|
261
|
-
update: editor.update,
|
|
262
|
-
remove: editor.remove,
|
|
263
|
-
method: {
|
|
264
|
-
list: editor.method.list,
|
|
265
|
-
update: (input) => {
|
|
266
|
-
if (!("authorize" in input))
|
|
267
|
-
return editor.method.update(input);
|
|
268
|
-
const refresh = input.refresh;
|
|
269
|
-
editor.method.update({
|
|
270
|
-
...input,
|
|
271
|
-
authorize: (answer) => Effect.promise(() => input.authorize(answer)).pipe(Effect.map((authorization) => authorization.mode === "auto"
|
|
272
|
-
? {
|
|
273
|
-
...authorization,
|
|
274
|
-
callback: Effect.promise(() => authorization.callback),
|
|
275
|
-
}
|
|
276
|
-
: {
|
|
277
|
-
...authorization,
|
|
278
|
-
callback: (code) => Effect.promise(() => authorization.callback(code)),
|
|
279
|
-
})),
|
|
280
|
-
refresh: refresh === undefined
|
|
281
|
-
? undefined
|
|
282
|
-
: (credential) => Effect.promise(() => refresh(credential)),
|
|
283
|
-
});
|
|
284
|
-
},
|
|
285
|
-
remove: editor.method.remove,
|
|
286
|
-
},
|
|
287
|
-
}))),
|
|
288
|
-
reload: () => run(host.integration.reload()),
|
|
289
|
-
connection: {
|
|
290
|
-
active: (id) => Effect.runPromiseWith(context)(host.integration.connection.active(id)),
|
|
291
|
-
resolve: (connection) => Effect.runPromiseWith(context)(host.integration.connection.resolve(connection)),
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
mcp: {
|
|
295
|
-
list: adaptApiMethod(McpEndpoints["mcp.list"], host.mcp.list),
|
|
296
|
-
transform: transform(host.mcp),
|
|
297
|
-
reload: () => run(host.mcp.reload()),
|
|
298
|
-
},
|
|
299
|
-
permission: {
|
|
300
|
-
hook: (name, callback) => register(host.permission.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
|
301
|
-
list: adaptApiMethod(PermissionEndpoints["session.permission.list"], host.permission.list),
|
|
302
|
-
get: adaptApiMethod(PermissionEndpoints["session.permission.get"], host.permission.get),
|
|
303
|
-
reply: adaptApiMethod(PermissionEndpoints["session.permission.reply"], host.permission.reply),
|
|
304
|
-
},
|
|
305
|
-
plugin: {
|
|
306
|
-
list: adaptApiMethod(PluginEndpoints["plugin.list"], host.plugin.list),
|
|
307
|
-
},
|
|
308
|
-
reference: {
|
|
309
|
-
list: adaptApiMethod(ReferenceEndpoints["reference.list"], host.reference.list),
|
|
310
|
-
transform: transform(host.reference),
|
|
311
|
-
reload: () => run(host.reference.reload()),
|
|
312
|
-
},
|
|
313
|
-
rpc: yield* rpcFromEffect(host.rpc, streams),
|
|
314
|
-
skill: {
|
|
315
|
-
list: adaptApiMethod(SkillEndpoints["skill.list"], host.skill.list),
|
|
316
|
-
transform: transform(host.skill),
|
|
317
|
-
reload: () => run(host.skill.reload()),
|
|
318
|
-
},
|
|
319
|
-
storage: {
|
|
320
|
-
get: (key) => run(host.storage.get(key)),
|
|
321
|
-
set: (key, value) => run(host.storage.set(key, value)),
|
|
322
|
-
remove: (key) => run(host.storage.remove(key)),
|
|
323
|
-
scan: (options) => run(host.storage.scan(options)),
|
|
324
|
-
},
|
|
325
|
-
tool: {
|
|
326
|
-
reload: () => run(host.tool.reload()),
|
|
327
|
-
transform: (callback) => register(host.tool.transform((editor) => callback({
|
|
328
|
-
list: () => editor.list().map((tool) => ({ ...tool, execute: promiseExecutor(tool.execute) })),
|
|
329
|
-
get: (id) => {
|
|
330
|
-
const tool = editor.get(id);
|
|
331
|
-
return tool ? { ...tool, execute: promiseExecutor(tool.execute) } : undefined;
|
|
332
|
-
},
|
|
333
|
-
namespace: editor.namespace,
|
|
334
|
-
add: (tool) => editor.add({
|
|
335
|
-
...tool,
|
|
336
|
-
execute: (input, context) => executePromiseTool(tool, input, context),
|
|
337
|
-
}),
|
|
338
|
-
update: (id, update) => editor.update(id, (tool) => {
|
|
339
|
-
const value = {
|
|
340
|
-
...tool,
|
|
341
|
-
execute: promiseExecutor(tool.execute),
|
|
342
|
-
};
|
|
343
|
-
update(value);
|
|
344
|
-
Object.assign(tool, value, {
|
|
345
|
-
output: value.output,
|
|
346
|
-
options: value.options,
|
|
347
|
-
execute: (input, context) => executePromiseTool(value, input, context),
|
|
348
|
-
});
|
|
349
|
-
}),
|
|
350
|
-
remove: editor.remove,
|
|
351
|
-
}))),
|
|
352
|
-
hook: (name, callback) => register(host.tool.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
|
353
|
-
},
|
|
354
|
-
vcs: {
|
|
355
|
-
get: adaptApiMethod(VcsEndpoints["vcs.get"], host.vcs.get),
|
|
356
|
-
base: adaptApiMethod(VcsEndpoints["vcs.base"], host.vcs.base),
|
|
357
|
-
branches: adaptApiMethod(VcsEndpoints["vcs.branches"], host.vcs.branches),
|
|
358
|
-
status: adaptApiMethod(VcsEndpoints["vcs.status"], host.vcs.status),
|
|
359
|
-
diff: adaptApiMethod(VcsEndpoints["vcs.diff"], host.vcs.diff),
|
|
360
|
-
reload: () => run(host.vcs.reload()),
|
|
361
|
-
transform: (callback) => register(host.vcs.transform((editor) => {
|
|
362
|
-
callback({
|
|
363
|
-
add: (definition) => {
|
|
364
|
-
const base = definition.base?.bind(definition);
|
|
365
|
-
editor.add({
|
|
366
|
-
id: definition.id,
|
|
367
|
-
name: definition.name,
|
|
368
|
-
info: (input) => attempt((signal) => definition.info(input, { signal })),
|
|
369
|
-
base: base ? (input) => attempt((signal) => base(input, { signal })) : undefined,
|
|
370
|
-
branches: (input) => attempt((signal) => definition.branches(input, { signal })),
|
|
371
|
-
status: (input) => attempt((signal) => definition.status(input, { signal })),
|
|
372
|
-
diff: (input) => attempt((signal) => definition.diff(input, { signal })),
|
|
373
|
-
});
|
|
374
|
-
},
|
|
375
|
-
default: editor.default,
|
|
376
|
-
});
|
|
377
|
-
})),
|
|
378
|
-
},
|
|
379
|
-
websearch: {
|
|
380
|
-
providers: adaptApiMethod(WebSearchEndpoints["websearch.providers"], host.websearch.providers),
|
|
381
|
-
query: adaptApiMethod(WebSearchEndpoints["websearch.query"], host.websearch.query),
|
|
382
|
-
reload: () => run(host.websearch.reload()),
|
|
383
|
-
transform: (callback) => register(host.websearch.transform((editor) => {
|
|
384
|
-
callback({
|
|
385
|
-
add: (definition) => editor.add({
|
|
386
|
-
id: definition.id,
|
|
387
|
-
name: definition.name,
|
|
388
|
-
execute: (input) => attempt((signal) => definition.execute(input, { signal })),
|
|
389
|
-
}),
|
|
390
|
-
default: editor.default,
|
|
391
|
-
});
|
|
392
|
-
})),
|
|
393
|
-
},
|
|
394
|
-
session: {
|
|
395
|
-
hook: (name, callback, options) => register(host.session.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))), options)),
|
|
396
|
-
create: adaptApiMethod(SessionEndpoints["session.create"], host.session.create),
|
|
397
|
-
get: adaptApiMethod(SessionEndpoints["session.get"], host.session.get),
|
|
398
|
-
switchAgent: adaptApiMethod(SessionEndpoints["session.switchAgent"], host.session.switchAgent),
|
|
399
|
-
switchModel: adaptApiMethod(SessionEndpoints["session.switchModel"], host.session.switchModel),
|
|
400
|
-
prompt: adaptApiMethod(SessionEndpoints["session.prompt"], host.session.prompt),
|
|
401
|
-
generate: adaptApiMethod(SessionEndpoints["session.generate"], host.session.generate),
|
|
402
|
-
command: adaptApiMethod(SessionEndpoints["session.command"], host.session.command),
|
|
403
|
-
synthetic: adaptApiMethod(SessionEndpoints["session.synthetic"], host.session.synthetic),
|
|
404
|
-
interrupt: adaptApiMethod(SessionEndpoints["session.interrupt"], host.session.interrupt),
|
|
405
|
-
rename: adaptApiMethod(SessionEndpoints["session.rename"], host.session.rename),
|
|
406
|
-
move: adaptApiMethod(SessionEndpoints["session.move"], host.session.move),
|
|
407
|
-
wait: adaptApiMethod(SessionEndpoints["session.wait"], host.session.wait),
|
|
408
|
-
context: adaptApiMethod(SessionEndpoints["session.context"], host.session.context),
|
|
409
|
-
},
|
|
410
|
-
shell: {
|
|
411
|
-
hook: (name, callback) => register(host.shell.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
|
412
|
-
},
|
|
413
|
-
};
|
|
414
|
-
yield* Effect.acquireRelease(Effect.promise(() => Promise.resolve(plugin.setup(context2))), (cleanup) => (cleanup ? Effect.promise(() => Promise.resolve(cleanup())) : Effect.void));
|
|
415
|
-
}),
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
function attempt(evaluate) {
|
|
419
|
-
return Effect.tryPromise({ try: evaluate, catch: (cause) => cause });
|
|
420
|
-
}
|
|
421
|
-
const executePromiseTool = (tool, input, context) => Effect.promise(() => tool.execute(input, {
|
|
422
|
-
...context,
|
|
423
|
-
progress: (update) => Effect.runPromise(context.progress(update)),
|
|
424
|
-
}));
|
package/dist/promise/agent.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AgentApi } from "@opencode-ai/client/promise/api";
|
|
2
|
-
import type { Agent } from "@opencode-ai/schema/agent";
|
|
3
|
-
import type { Transform } from "./registration.js";
|
|
4
|
-
import type { DeepMutable } from "./types.js";
|
|
5
|
-
export interface AgentEditor {
|
|
6
|
-
list(): readonly DeepMutable<Agent.Info>[];
|
|
7
|
-
get(id: string): DeepMutable<Agent.Info> | undefined;
|
|
8
|
-
default(id: string | undefined): void;
|
|
9
|
-
update(id: string, update: (agent: DeepMutable<Agent.Info>) => void): void;
|
|
10
|
-
remove(id: string): void;
|
|
11
|
-
}
|
|
12
|
-
export interface AgentDomain extends AgentApi {
|
|
13
|
-
readonly transform: Transform<AgentEditor>;
|
|
14
|
-
readonly reload: () => Promise<void>;
|
|
15
|
-
}
|
package/dist/promise/agent.js
DELETED
|
File without changes
|
package/dist/promise/aisdk.js
DELETED
|
File without changes
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { CatalogApi } from "@opencode-ai/client/promise/api";
|
|
2
|
-
import type { Model } from "@opencode-ai/schema/model";
|
|
3
|
-
import type { Provider } from "@opencode-ai/schema/provider";
|
|
4
|
-
import type { Transform } from "./registration.js";
|
|
5
|
-
import type { DeepMutable } from "./types.js";
|
|
6
|
-
export interface CatalogProviderRecord {
|
|
7
|
-
readonly provider: DeepMutable<Provider.Info>;
|
|
8
|
-
readonly models: ReadonlyMap<string, DeepMutable<Model.Info>>;
|
|
9
|
-
}
|
|
10
|
-
export interface CatalogEditor {
|
|
11
|
-
readonly provider: {
|
|
12
|
-
list(): readonly CatalogProviderRecord[];
|
|
13
|
-
get(providerID: string): CatalogProviderRecord | undefined;
|
|
14
|
-
update(providerID: string, update: (provider: DeepMutable<Provider.Info>) => void): void;
|
|
15
|
-
remove(providerID: string): void;
|
|
16
|
-
};
|
|
17
|
-
readonly model: {
|
|
18
|
-
get(providerID: string, modelID: string): DeepMutable<Model.Info> | undefined;
|
|
19
|
-
update(providerID: string, modelID: string, update: (model: DeepMutable<Model.Info>) => void): void;
|
|
20
|
-
remove(providerID: string, modelID: string): void;
|
|
21
|
-
readonly default: {
|
|
22
|
-
get(): {
|
|
23
|
-
providerID: string;
|
|
24
|
-
modelID: string;
|
|
25
|
-
} | undefined;
|
|
26
|
-
set(providerID: string, modelID: string): void;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export interface CatalogDomain extends CatalogApi {
|
|
31
|
-
readonly transform: Transform<CatalogEditor>;
|
|
32
|
-
readonly reload: () => Promise<void>;
|
|
33
|
-
}
|
package/dist/promise/catalog.js
DELETED
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { CommandApi } from "@opencode-ai/client/promise/api";
|
|
2
|
-
import type { PromptInput } from "@opencode-ai/schema/prompt-input";
|
|
3
|
-
import type { Session } from "@opencode-ai/schema/session";
|
|
4
|
-
import type { SessionInbox } from "@opencode-ai/schema/session-inbox";
|
|
5
|
-
import type { Transform } from "./registration.js";
|
|
6
|
-
export interface CommandInvocation {
|
|
7
|
-
readonly sessionID: Session.ID;
|
|
8
|
-
readonly prompt: PromptInput.Prompt;
|
|
9
|
-
readonly delivery: SessionInbox.Delivery;
|
|
10
|
-
}
|
|
11
|
-
export interface CommandDefinition {
|
|
12
|
-
readonly name: string;
|
|
13
|
-
readonly description?: string;
|
|
14
|
-
readonly execute: (input: CommandInvocation) => Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export interface CommandEditor {
|
|
17
|
-
add(definition: CommandDefinition): void;
|
|
18
|
-
}
|
|
19
|
-
export interface CommandDomain extends Pick<CommandApi, "list"> {
|
|
20
|
-
readonly transform: Transform<CommandEditor>;
|
|
21
|
-
readonly reload: () => Promise<void>;
|
|
22
|
-
}
|
package/dist/promise/command.js
DELETED
|
File without changes
|
package/dist/promise/event.d.ts
DELETED
package/dist/promise/event.js
DELETED
|
File without changes
|
package/dist/promise/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type { PluginOptions } from "../options.js";
|
|
2
|
-
export type { StorageEntry, StorageScanOptions, StorageScanResult } from "../storage.js";
|
|
3
|
-
export * as Plugin from "./plugin.js";
|
|
4
|
-
export { Agent } from "@opencode-ai/schema/agent";
|
|
5
|
-
export { Command } from "@opencode-ai/schema/command";
|
|
6
|
-
export { Connection } from "@opencode-ai/schema/connection";
|
|
7
|
-
export { Credential } from "@opencode-ai/schema/credential";
|
|
8
|
-
export { Integration } from "@opencode-ai/schema/integration";
|
|
9
|
-
export { Location } from "@opencode-ai/schema/location";
|
|
10
|
-
export { Mcp } from "@opencode-ai/schema/mcp";
|
|
11
|
-
export { Model } from "@opencode-ai/schema/model";
|
|
12
|
-
export { PersistentPty } from "@opencode-ai/schema/persistent-pty";
|
|
13
|
-
export { Provider } from "@opencode-ai/schema/provider";
|
|
14
|
-
export { Reference } from "@opencode-ai/schema/reference";
|
|
15
|
-
export { Rpc } from "@opencode-ai/schema/rpc";
|
|
16
|
-
export { Skill } from "@opencode-ai/schema/skill";
|
|
17
|
-
export { Vcs } from "@opencode-ai/schema/vcs";
|
|
18
|
-
export { WebSearch } from "@opencode-ai/schema/websearch";
|
package/dist/promise/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * as Plugin from "./plugin.js";
|
|
2
|
-
export { Agent } from "@opencode-ai/schema/agent";
|
|
3
|
-
export { Command } from "@opencode-ai/schema/command";
|
|
4
|
-
export { Connection } from "@opencode-ai/schema/connection";
|
|
5
|
-
export { Credential } from "@opencode-ai/schema/credential";
|
|
6
|
-
export { Integration } from "@opencode-ai/schema/integration";
|
|
7
|
-
export { Location } from "@opencode-ai/schema/location";
|
|
8
|
-
export { Mcp } from "@opencode-ai/schema/mcp";
|
|
9
|
-
export { Model } from "@opencode-ai/schema/model";
|
|
10
|
-
export { PersistentPty } from "@opencode-ai/schema/persistent-pty";
|
|
11
|
-
export { Provider } from "@opencode-ai/schema/provider";
|
|
12
|
-
export { Reference } from "@opencode-ai/schema/reference";
|
|
13
|
-
export { Rpc } from "@opencode-ai/schema/rpc";
|
|
14
|
-
export { Skill } from "@opencode-ai/schema/skill";
|
|
15
|
-
export { Vcs } from "@opencode-ai/schema/vcs";
|
|
16
|
-
export { WebSearch } from "@opencode-ai/schema/websearch";
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { ConnectionInfo } from "@opencode-ai/client";
|
|
2
|
-
import type { IntegrationApi } from "@opencode-ai/client/promise/api";
|
|
3
|
-
import { Credential } from "@opencode-ai/schema/credential";
|
|
4
|
-
import { Form } from "@opencode-ai/schema/form";
|
|
5
|
-
import type { Transform } from "./registration.js";
|
|
6
|
-
type IntegrationRef = {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
export interface IntegrationOAuthMethod {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly type: "oauth";
|
|
13
|
-
readonly label: string;
|
|
14
|
-
readonly form?: Form.Fields;
|
|
15
|
-
}
|
|
16
|
-
export interface IntegrationCommandMethod {
|
|
17
|
-
readonly id: string;
|
|
18
|
-
readonly type: "command";
|
|
19
|
-
readonly label: string;
|
|
20
|
-
readonly command: ReadonlyArray<string>;
|
|
21
|
-
}
|
|
22
|
-
export interface IntegrationKeyMethod {
|
|
23
|
-
readonly type: "key";
|
|
24
|
-
readonly label?: string;
|
|
25
|
-
readonly form?: Form.Fields;
|
|
26
|
-
}
|
|
27
|
-
export interface IntegrationEnvMethod {
|
|
28
|
-
readonly type: "env";
|
|
29
|
-
readonly names: ReadonlyArray<string>;
|
|
30
|
-
}
|
|
31
|
-
export type IntegrationMethod = IntegrationOAuthMethod | IntegrationCommandMethod | IntegrationKeyMethod | IntegrationEnvMethod;
|
|
32
|
-
export type IntegrationOAuthAuthorization = {
|
|
33
|
-
readonly url: string;
|
|
34
|
-
readonly instructions: string;
|
|
35
|
-
readonly expiresAt?: number;
|
|
36
|
-
} & ({
|
|
37
|
-
readonly mode: "auto";
|
|
38
|
-
readonly callback: Promise<Credential.OAuth>;
|
|
39
|
-
} | {
|
|
40
|
-
readonly mode: "code";
|
|
41
|
-
readonly callback: (code: string) => Promise<Credential.OAuth>;
|
|
42
|
-
});
|
|
43
|
-
export type IntegrationOAuthMethodRegistration = {
|
|
44
|
-
readonly integrationID: string;
|
|
45
|
-
readonly method: IntegrationOAuthMethod;
|
|
46
|
-
readonly authorize: (answer: Form.Answer) => Promise<IntegrationOAuthAuthorization>;
|
|
47
|
-
readonly refresh?: (credential: Credential.OAuth) => Promise<Credential.OAuth>;
|
|
48
|
-
readonly label?: (credential: Credential.OAuth) => string | undefined;
|
|
49
|
-
};
|
|
50
|
-
export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
|
|
51
|
-
readonly integrationID: string;
|
|
52
|
-
readonly method: IntegrationCommandMethod;
|
|
53
|
-
} | {
|
|
54
|
-
readonly integrationID: string;
|
|
55
|
-
readonly method: IntegrationKeyMethod;
|
|
56
|
-
} | {
|
|
57
|
-
readonly integrationID: string;
|
|
58
|
-
readonly method: IntegrationEnvMethod;
|
|
59
|
-
};
|
|
60
|
-
export interface IntegrationEditor {
|
|
61
|
-
list(): readonly IntegrationRef[];
|
|
62
|
-
get(id: string): IntegrationRef | undefined;
|
|
63
|
-
update(id: string, update: (integration: IntegrationRef) => void): void;
|
|
64
|
-
remove(id: string): void;
|
|
65
|
-
readonly method: {
|
|
66
|
-
list(integrationID: string): readonly IntegrationMethod[];
|
|
67
|
-
update(input: IntegrationMethodRegistration): void;
|
|
68
|
-
remove(integrationID: string, method: IntegrationMethod): void;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export interface IntegrationDomain extends Omit<IntegrationApi, "wellknown"> {
|
|
72
|
-
readonly transform: Transform<IntegrationEditor>;
|
|
73
|
-
readonly reload: () => Promise<void>;
|
|
74
|
-
readonly connection: {
|
|
75
|
-
readonly active: (integrationID: string) => Promise<ConnectionInfo | undefined>;
|
|
76
|
-
readonly resolve: (connection: ConnectionInfo) => Promise<Credential.Value | undefined>;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
export {};
|
package/dist/promise/mcp.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { McpApi } from "@opencode-ai/client/promise/api";
|
|
2
|
-
import type { Mcp } from "@opencode-ai/schema/mcp";
|
|
3
|
-
import type { Transform } from "./registration.js";
|
|
4
|
-
import type { DeepMutable } from "./types.js";
|
|
5
|
-
export interface MCPEditor {
|
|
6
|
-
list(): readonly [string, DeepMutable<Mcp.ServerConfig>][];
|
|
7
|
-
get(name: string): DeepMutable<Mcp.ServerConfig> | undefined;
|
|
8
|
-
set(name: string, config: Mcp.ServerConfig): void;
|
|
9
|
-
update(name: string, update: (config: DeepMutable<Mcp.ServerConfig>) => void): void;
|
|
10
|
-
remove(name: string): void;
|
|
11
|
-
}
|
|
12
|
-
export interface MCPDomain extends Pick<McpApi, "list"> {
|
|
13
|
-
readonly transform: Transform<MCPEditor>;
|
|
14
|
-
readonly reload: () => Promise<void>;
|
|
15
|
-
}
|
package/dist/promise/mcp.js
DELETED
|
File without changes
|