@opencode/plugin 0.0.0-dev-19595 → 0.0.0-dev-19598
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/model.d.ts +29 -0
- package/dist/effect/plugin.d.ts +4 -2
- package/dist/effect/provider.d.ts +34 -0
- package/dist/effect/provider.js +0 -0
- package/dist/promise/adapter.js +12 -12
- package/dist/promise/model.d.ts +29 -0
- package/dist/promise/model.js +0 -0
- package/dist/promise/plugin.d.ts +4 -2
- package/dist/promise/provider.d.ts +34 -0
- package/dist/promise/provider.js +0 -0
- package/package.json +8 -8
- package/dist/effect/catalog.d.ts +0 -33
- package/dist/effect/catalog.js +0 -2
- package/dist/promise/catalog.d.ts +0 -33
- /package/dist/{promise/catalog.js → effect/model.js} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ModelApi } from "@opencode/client/effect/api";
|
|
2
|
+
import type { Model } from "@opencode/schema/model";
|
|
3
|
+
import type { Effect, Types } from "effect";
|
|
4
|
+
import type { ProviderRecord } from "./provider.js";
|
|
5
|
+
import type { Transform } from "./registration.js";
|
|
6
|
+
export interface ModelEditor {
|
|
7
|
+
/** Candidates from available providers, including models disabled by earlier transforms. */
|
|
8
|
+
list(providerID?: string): readonly Types.DeepMutable<Model.Info>[];
|
|
9
|
+
get(providerID: string, modelID: string): Types.DeepMutable<Model.Info> | undefined;
|
|
10
|
+
/** Edits raw model overrides; cannot create an unavailable provider. */
|
|
11
|
+
update(providerID: string, modelID: string, update: (model: Types.DeepMutable<Model.Info>) => void): void;
|
|
12
|
+
remove(providerID: string, modelID: string): void;
|
|
13
|
+
readonly default: {
|
|
14
|
+
get(): {
|
|
15
|
+
providerID: string;
|
|
16
|
+
modelID: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
set(providerID: string, modelID: string): void;
|
|
19
|
+
};
|
|
20
|
+
/** Immutable provider inputs, including inactive templates, before model transforms. */
|
|
21
|
+
readonly provider: {
|
|
22
|
+
list(): readonly ProviderRecord[];
|
|
23
|
+
get(providerID: string): ProviderRecord | undefined;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ModelDomain extends ModelApi<unknown> {
|
|
27
|
+
readonly transform: Transform<ModelEditor>;
|
|
28
|
+
readonly reload: () => Effect.Effect<void>;
|
|
29
|
+
}
|
package/dist/effect/plugin.d.ts
CHANGED
|
@@ -5,12 +5,13 @@ import type { PluginOptions } from "../options.js";
|
|
|
5
5
|
import type { App } from "../app.js";
|
|
6
6
|
import type { AgentDomain } from "./agent.js";
|
|
7
7
|
import type { AISDKDomain } from "./aisdk.js";
|
|
8
|
-
import type { CatalogDomain } from "./catalog.js";
|
|
9
8
|
import type { CommandDomain } from "./command.js";
|
|
10
9
|
import type { EventDomain } from "./event.js";
|
|
11
10
|
import type { IntegrationDomain } from "./integration.js";
|
|
12
11
|
import type { MCPDomain } from "./mcp.js";
|
|
12
|
+
import type { ModelDomain } from "./model.js";
|
|
13
13
|
import type { PermissionDomain } from "./permission.js";
|
|
14
|
+
import type { ProviderDomain } from "./provider.js";
|
|
14
15
|
import type { ReferenceDomain } from "./reference.js";
|
|
15
16
|
import type { RpcDomain } from "./rpc.js";
|
|
16
17
|
import type { SessionDomain } from "./session.js";
|
|
@@ -27,7 +28,6 @@ export interface Context {
|
|
|
27
28
|
readonly options: PluginOptions;
|
|
28
29
|
readonly agent: AgentDomain;
|
|
29
30
|
readonly aisdk: AISDKDomain;
|
|
30
|
-
readonly catalog: CatalogDomain;
|
|
31
31
|
readonly command: CommandDomain;
|
|
32
32
|
readonly event: EventDomain;
|
|
33
33
|
readonly experimental: {
|
|
@@ -35,9 +35,11 @@ export interface Context {
|
|
|
35
35
|
};
|
|
36
36
|
readonly integration: IntegrationDomain;
|
|
37
37
|
readonly mcp: MCPDomain;
|
|
38
|
+
readonly model: ModelDomain;
|
|
38
39
|
readonly generate: GenerateApi<unknown>;
|
|
39
40
|
readonly permission: PermissionDomain;
|
|
40
41
|
readonly plugin: Pick<PluginApi<unknown>, "list">;
|
|
42
|
+
readonly provider: ProviderDomain;
|
|
41
43
|
readonly reference: ReferenceDomain;
|
|
42
44
|
readonly rpc: RpcDomain;
|
|
43
45
|
readonly session: SessionDomain;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ProviderApi } from "@opencode/client/effect/api";
|
|
2
|
+
import type { Model } from "@opencode/schema/model";
|
|
3
|
+
import type { Provider } from "@opencode/schema/provider";
|
|
4
|
+
import type { ConnectionInfo } from "@opencode/client";
|
|
5
|
+
import type { Effect, Types } from "effect";
|
|
6
|
+
import type { Transform } from "./registration.js";
|
|
7
|
+
/** Provider metadata and immutable source definitions, including inactive providers. */
|
|
8
|
+
export interface ProviderRecord {
|
|
9
|
+
readonly provider: Provider.Info;
|
|
10
|
+
readonly models: ReadonlyMap<string, Model.Info>;
|
|
11
|
+
readonly sourceConnection?: ConnectionInfo;
|
|
12
|
+
}
|
|
13
|
+
export interface ProviderEditor {
|
|
14
|
+
list(): readonly ProviderRecord[];
|
|
15
|
+
get(providerID: string): ProviderRecord | undefined;
|
|
16
|
+
/** A discovered account-specific inventory can be bound to the connection that produced it. */
|
|
17
|
+
add(input: {
|
|
18
|
+
info: Provider.Info;
|
|
19
|
+
models: readonly Model.Info[];
|
|
20
|
+
sourceConnection?: ConnectionInfo;
|
|
21
|
+
}): void;
|
|
22
|
+
update(providerID: string, update: (provider: Types.DeepMutable<Provider.Info>) => void): void;
|
|
23
|
+
remove(providerID: string): void;
|
|
24
|
+
readonly models: {
|
|
25
|
+
set(providerID: string, models: readonly Model.Info[]): void;
|
|
26
|
+
/** Updates an owned copy of a source definition. */
|
|
27
|
+
update(providerID: string, modelID: string, update: (model: Types.DeepMutable<Model.Info>) => void): void;
|
|
28
|
+
remove(providerID: string, modelID: string): void;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface ProviderDomain extends ProviderApi<unknown> {
|
|
32
|
+
readonly transform: Transform<ProviderEditor>;
|
|
33
|
+
readonly reload: () => Effect.Effect<void>;
|
|
34
|
+
}
|
|
File without changes
|
package/dist/promise/adapter.js
CHANGED
|
@@ -210,18 +210,6 @@ export function fromPromise(plugin) {
|
|
|
210
210
|
aisdk: {
|
|
211
211
|
hook: (name, callback, options) => register(host.aisdk.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))), options)),
|
|
212
212
|
},
|
|
213
|
-
catalog: {
|
|
214
|
-
provider: {
|
|
215
|
-
list: adaptApiMethod(ProviderEndpoints["provider.list"], host.catalog.provider.list),
|
|
216
|
-
get: adaptApiMethod(ProviderEndpoints["provider.get"], host.catalog.provider.get),
|
|
217
|
-
},
|
|
218
|
-
model: {
|
|
219
|
-
list: adaptApiMethod(ModelEndpoints["model.list"], host.catalog.model.list),
|
|
220
|
-
default: adaptApiMethod(ModelEndpoints["model.default"], host.catalog.model.default),
|
|
221
|
-
},
|
|
222
|
-
transform: transform(host.catalog),
|
|
223
|
-
reload: () => run(host.catalog.reload()),
|
|
224
|
-
},
|
|
225
213
|
command: {
|
|
226
214
|
list: adaptApiMethod(CommandEndpoints["command.list"], host.command.list),
|
|
227
215
|
transform: (callback) => register(host.command.transform((editor) => callback({
|
|
@@ -243,6 +231,18 @@ export function fromPromise(plugin) {
|
|
|
243
231
|
generate: {
|
|
244
232
|
text: adaptApiMethod(GenerateEndpoints["generate.text"], host.generate.text),
|
|
245
233
|
},
|
|
234
|
+
model: {
|
|
235
|
+
list: adaptApiMethod(ModelEndpoints["model.list"], host.model.list),
|
|
236
|
+
default: adaptApiMethod(ModelEndpoints["model.default"], host.model.default),
|
|
237
|
+
transform: transform(host.model),
|
|
238
|
+
reload: () => run(host.model.reload()),
|
|
239
|
+
},
|
|
240
|
+
provider: {
|
|
241
|
+
list: adaptApiMethod(ProviderEndpoints["provider.list"], host.provider.list),
|
|
242
|
+
get: adaptApiMethod(ProviderEndpoints["provider.get"], host.provider.get),
|
|
243
|
+
transform: transform(host.provider),
|
|
244
|
+
reload: () => run(host.provider.reload()),
|
|
245
|
+
},
|
|
246
246
|
integration: {
|
|
247
247
|
list: adaptApiMethod(IntegrationEndpoints["integration.list"], host.integration.list),
|
|
248
248
|
get: adaptApiMethod(IntegrationEndpoints["integration.get"], host.integration.get),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ModelApi } from "@opencode/client/promise/api";
|
|
2
|
+
import type { Model } from "@opencode/schema/model";
|
|
3
|
+
import type { ProviderRecord } from "./provider.js";
|
|
4
|
+
import type { Transform } from "./registration.js";
|
|
5
|
+
import type { DeepMutable } from "./types.js";
|
|
6
|
+
export interface ModelEditor {
|
|
7
|
+
/** Candidates from available providers, including models disabled by earlier transforms. */
|
|
8
|
+
list(providerID?: string): readonly DeepMutable<Model.Info>[];
|
|
9
|
+
get(providerID: string, modelID: string): DeepMutable<Model.Info> | undefined;
|
|
10
|
+
/** Edits raw model overrides; cannot create an unavailable provider. */
|
|
11
|
+
update(providerID: string, modelID: string, update: (model: DeepMutable<Model.Info>) => void): void;
|
|
12
|
+
remove(providerID: string, modelID: string): void;
|
|
13
|
+
readonly default: {
|
|
14
|
+
get(): {
|
|
15
|
+
providerID: string;
|
|
16
|
+
modelID: string;
|
|
17
|
+
} | undefined;
|
|
18
|
+
set(providerID: string, modelID: string): void;
|
|
19
|
+
};
|
|
20
|
+
/** Immutable provider inputs, including inactive templates, before model transforms. */
|
|
21
|
+
readonly provider: {
|
|
22
|
+
list(): readonly ProviderRecord[];
|
|
23
|
+
get(providerID: string): ProviderRecord | undefined;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ModelDomain extends ModelApi {
|
|
27
|
+
readonly transform: Transform<ModelEditor>;
|
|
28
|
+
readonly reload: () => Promise<void>;
|
|
29
|
+
}
|
|
File without changes
|
package/dist/promise/plugin.d.ts
CHANGED
|
@@ -5,12 +5,13 @@ import type { PluginOptions } from "../options.js";
|
|
|
5
5
|
import type { App } from "../app.js";
|
|
6
6
|
import type { AgentDomain } from "./agent.js";
|
|
7
7
|
import type { AISDKDomain } from "./aisdk.js";
|
|
8
|
-
import type { CatalogDomain } from "./catalog.js";
|
|
9
8
|
import type { CommandDomain } from "./command.js";
|
|
10
9
|
import type { EventDomain } from "./event.js";
|
|
11
10
|
import type { IntegrationDomain } from "./integration.js";
|
|
12
11
|
import type { MCPDomain } from "./mcp.js";
|
|
12
|
+
import type { ModelDomain } from "./model.js";
|
|
13
13
|
import type { PermissionDomain } from "./permission.js";
|
|
14
|
+
import type { ProviderDomain } from "./provider.js";
|
|
14
15
|
import type { ReferenceDomain } from "./reference.js";
|
|
15
16
|
import type { RpcDomain } from "./rpc.js";
|
|
16
17
|
import type { SessionDomain } from "./session.js";
|
|
@@ -27,7 +28,6 @@ export interface Context {
|
|
|
27
28
|
readonly options: PluginOptions;
|
|
28
29
|
readonly agent: AgentDomain;
|
|
29
30
|
readonly aisdk: AISDKDomain;
|
|
30
|
-
readonly catalog: CatalogDomain;
|
|
31
31
|
readonly command: CommandDomain;
|
|
32
32
|
readonly event: EventDomain;
|
|
33
33
|
readonly experimental: {
|
|
@@ -35,9 +35,11 @@ export interface Context {
|
|
|
35
35
|
};
|
|
36
36
|
readonly integration: IntegrationDomain;
|
|
37
37
|
readonly mcp: MCPDomain;
|
|
38
|
+
readonly model: ModelDomain;
|
|
38
39
|
readonly generate: GenerateApi;
|
|
39
40
|
readonly permission: PermissionDomain;
|
|
40
41
|
readonly plugin: Pick<PluginApi, "list">;
|
|
42
|
+
readonly provider: ProviderDomain;
|
|
41
43
|
readonly reference: ReferenceDomain;
|
|
42
44
|
readonly rpc: RpcDomain;
|
|
43
45
|
readonly session: SessionDomain;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ProviderApi } from "@opencode/client/promise/api";
|
|
2
|
+
import type { Model } from "@opencode/schema/model";
|
|
3
|
+
import type { Provider } from "@opencode/schema/provider";
|
|
4
|
+
import type { ConnectionInfo } from "@opencode/client";
|
|
5
|
+
import type { Transform } from "./registration.js";
|
|
6
|
+
import type { DeepMutable } from "./types.js";
|
|
7
|
+
/** Provider metadata and immutable source definitions, including inactive providers. */
|
|
8
|
+
export interface ProviderRecord {
|
|
9
|
+
readonly provider: Provider.Info;
|
|
10
|
+
readonly models: ReadonlyMap<string, Model.Info>;
|
|
11
|
+
readonly sourceConnection?: ConnectionInfo;
|
|
12
|
+
}
|
|
13
|
+
export interface ProviderEditor {
|
|
14
|
+
list(): readonly ProviderRecord[];
|
|
15
|
+
get(providerID: string): ProviderRecord | undefined;
|
|
16
|
+
/** A discovered account-specific inventory can be bound to the connection that produced it. */
|
|
17
|
+
add(input: {
|
|
18
|
+
info: Provider.Info;
|
|
19
|
+
models: readonly Model.Info[];
|
|
20
|
+
sourceConnection?: ConnectionInfo;
|
|
21
|
+
}): void;
|
|
22
|
+
update(providerID: string, update: (provider: DeepMutable<Provider.Info>) => void): void;
|
|
23
|
+
remove(providerID: string): void;
|
|
24
|
+
readonly models: {
|
|
25
|
+
set(providerID: string, models: readonly Model.Info[]): void;
|
|
26
|
+
/** Updates an owned copy of a source definition. */
|
|
27
|
+
update(providerID: string, modelID: string, update: (model: DeepMutable<Model.Info>) => void): void;
|
|
28
|
+
remove(providerID: string, modelID: string): void;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface ProviderDomain extends ProviderApi {
|
|
32
|
+
readonly transform: Transform<ProviderEditor>;
|
|
33
|
+
readonly reload: () => Promise<void>;
|
|
34
|
+
}
|
|
File without changes
|
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-19598",
|
|
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-19598",
|
|
47
|
+
"@opencode/client": "0.0.0-dev-19598",
|
|
48
|
+
"@opencode/protocol": "0.0.0-dev-19598",
|
|
49
|
+
"@opencode/schema": "0.0.0-dev-19598",
|
|
50
|
+
"@opencode/util": "0.0.0-dev-19598",
|
|
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-19598",
|
|
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-19598",
|
|
77
77
|
"@opentui/core": "0.5.10",
|
|
78
78
|
"@opentui/solid": "0.5.10",
|
|
79
79
|
"@tsconfig/bun": "1.0.9",
|
package/dist/effect/catalog.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { CatalogApi } from "@opencode/client/effect/api";
|
|
2
|
-
import { Model } from "@opencode/schema/model";
|
|
3
|
-
import { Provider } from "@opencode/schema/provider";
|
|
4
|
-
import type { Effect, Types } from "effect";
|
|
5
|
-
import type { Transform } from "./registration.js";
|
|
6
|
-
export interface CatalogProviderRecord {
|
|
7
|
-
readonly provider: Types.DeepMutable<Provider.Info>;
|
|
8
|
-
readonly models: ReadonlyMap<string, Types.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: Types.DeepMutable<Provider.Info>) => void): void;
|
|
15
|
-
remove(providerID: string): void;
|
|
16
|
-
};
|
|
17
|
-
readonly model: {
|
|
18
|
-
get(providerID: string, modelID: string): Types.DeepMutable<Model.Info> | undefined;
|
|
19
|
-
update(providerID: string, modelID: string, update: (model: Types.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<unknown> {
|
|
31
|
-
readonly transform: Transform<CatalogEditor>;
|
|
32
|
-
readonly reload: () => Effect.Effect<void>;
|
|
33
|
-
}
|
package/dist/effect/catalog.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { CatalogApi } from "@opencode/client/promise/api";
|
|
2
|
-
import type { Model } from "@opencode/schema/model";
|
|
3
|
-
import type { Provider } from "@opencode/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
|
-
}
|
|
File without changes
|