@opencode-ai/plugin 0.0.0-dev-18211 → 0.0.0-dev-18215
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/permission.d.ts +21 -0
- package/dist/effect/permission.js +0 -0
- package/dist/effect/plugin.d.ts +4 -1
- package/dist/effect/session.d.ts +1 -1
- package/dist/promise/adapter.js +12 -0
- package/dist/promise/permission.d.ts +21 -0
- package/dist/promise/permission.js +0 -0
- package/dist/promise/plugin.d.ts +4 -1
- package/dist/promise/session.d.ts +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PermissionApi } from "@opencode-ai/client/effect/api";
|
|
2
|
+
import type { Agent } from "@opencode-ai/schema/agent";
|
|
3
|
+
import type { Permission } from "@opencode-ai/schema/permission";
|
|
4
|
+
import type { Session } from "@opencode-ai/schema/session";
|
|
5
|
+
import type { Hooks } from "./registration.js";
|
|
6
|
+
export interface PermissionEvaluation {
|
|
7
|
+
readonly sessionID: Session.ID;
|
|
8
|
+
readonly agent?: Agent.ID;
|
|
9
|
+
readonly action: string;
|
|
10
|
+
readonly resources: ReadonlyArray<string>;
|
|
11
|
+
readonly metadata?: Record<string, unknown>;
|
|
12
|
+
readonly source?: Permission.Source;
|
|
13
|
+
effect: Permission.Effect;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PermissionHooks {
|
|
17
|
+
readonly evaluate: PermissionEvaluation;
|
|
18
|
+
}
|
|
19
|
+
export type PermissionDomain = Pick<PermissionApi<unknown>, "list" | "get" | "reply"> & {
|
|
20
|
+
readonly hook: Hooks<PermissionHooks>;
|
|
21
|
+
};
|
|
File without changes
|
package/dist/effect/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginApi } from "@opencode-ai/client/effect/api";
|
|
1
|
+
import type { GenerateApi, PluginApi } from "@opencode-ai/client/effect/api";
|
|
2
2
|
import type { Effect, Scope } from "effect";
|
|
3
3
|
import type { PluginOptions } from "../options.js";
|
|
4
4
|
import type { App } from "../app.js";
|
|
@@ -9,6 +9,7 @@ import type { CommandDomain } from "./command.js";
|
|
|
9
9
|
import type { EventDomain } from "./event.js";
|
|
10
10
|
import type { IntegrationDomain } from "./integration.js";
|
|
11
11
|
import type { MCPDomain } from "./mcp.js";
|
|
12
|
+
import type { PermissionDomain } from "./permission.js";
|
|
12
13
|
import type { ReferenceDomain } from "./reference.js";
|
|
13
14
|
import type { SessionDomain } from "./session.js";
|
|
14
15
|
import type { ShellDomain } from "./shell.js";
|
|
@@ -27,6 +28,8 @@ export interface Context {
|
|
|
27
28
|
readonly event: EventDomain;
|
|
28
29
|
readonly integration: IntegrationDomain;
|
|
29
30
|
readonly mcp: MCPDomain;
|
|
31
|
+
readonly generate: GenerateApi<unknown>;
|
|
32
|
+
readonly permission: PermissionDomain;
|
|
30
33
|
readonly plugin: PluginApi<unknown>;
|
|
31
34
|
readonly reference: ReferenceDomain;
|
|
32
35
|
readonly session: SessionDomain;
|
package/dist/effect/session.d.ts
CHANGED
|
@@ -42,6 +42,6 @@ export interface SessionHooks {
|
|
|
42
42
|
readonly "http.request": SessionHttpRequest;
|
|
43
43
|
readonly "http.response": SessionHttpResponse;
|
|
44
44
|
}
|
|
45
|
-
export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "wait"> & {
|
|
45
|
+
export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "wait" | "context"> & {
|
|
46
46
|
readonly hook: ModelHooks<SessionHooks>;
|
|
47
47
|
};
|
package/dist/promise/adapter.js
CHANGED
|
@@ -57,10 +57,12 @@ export function fromPromise(plugin) {
|
|
|
57
57
|
const [{ ClientApi }, { OpenCodeEvent }] = yield* Effect.promise(() => Promise.all([import("@opencode-ai/protocol/client"), import("@opencode-ai/protocol/groups/event")]));
|
|
58
58
|
const AgentEndpoints = ClientApi.groups["server.agent"].endpoints;
|
|
59
59
|
const CommandEndpoints = ClientApi.groups["server.command"].endpoints;
|
|
60
|
+
const GenerateEndpoints = ClientApi.groups["server.generate"].endpoints;
|
|
60
61
|
const IntegrationEndpoints = ClientApi.groups["server.integration"].endpoints;
|
|
61
62
|
const McpEndpoints = ClientApi.groups["server.mcp"].endpoints;
|
|
62
63
|
const ModelEndpoints = ClientApi.groups["server.model"].endpoints;
|
|
63
64
|
const PluginEndpoints = ClientApi.groups["server.plugin"].endpoints;
|
|
65
|
+
const PermissionEndpoints = ClientApi.groups["server.permission"].endpoints;
|
|
64
66
|
const ProviderEndpoints = ClientApi.groups["server.provider"].endpoints;
|
|
65
67
|
const ReferenceEndpoints = ClientApi.groups["server.reference"].endpoints;
|
|
66
68
|
const SessionEndpoints = ClientApi.groups["server.session"].endpoints;
|
|
@@ -123,6 +125,9 @@ export function fromPromise(plugin) {
|
|
|
123
125
|
event: {
|
|
124
126
|
subscribe: () => Stream.toAsyncIterable(host.event.subscribe().pipe(Stream.mapEffect((event) => Schema.encodeUnknownEffect(OpenCodeEvent)(event)), Stream.map((event) => event))),
|
|
125
127
|
},
|
|
128
|
+
generate: {
|
|
129
|
+
text: adaptApiMethod(GenerateEndpoints["generate.text"], host.generate.text),
|
|
130
|
+
},
|
|
126
131
|
integration: {
|
|
127
132
|
list: adaptApiMethod(IntegrationEndpoints["integration.list"], host.integration.list),
|
|
128
133
|
get: adaptApiMethod(IntegrationEndpoints["integration.get"], host.integration.get),
|
|
@@ -185,6 +190,12 @@ export function fromPromise(plugin) {
|
|
|
185
190
|
transform: transform(host.mcp),
|
|
186
191
|
reload: () => run(host.mcp.reload()),
|
|
187
192
|
},
|
|
193
|
+
permission: {
|
|
194
|
+
hook: (name, callback) => register(host.permission.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
|
195
|
+
list: adaptApiMethod(PermissionEndpoints["session.permission.list"], host.permission.list),
|
|
196
|
+
get: adaptApiMethod(PermissionEndpoints["session.permission.get"], host.permission.get),
|
|
197
|
+
reply: adaptApiMethod(PermissionEndpoints["session.permission.reply"], host.permission.reply),
|
|
198
|
+
},
|
|
188
199
|
plugin: {
|
|
189
200
|
list: adaptApiMethod(PluginEndpoints["plugin.list"], host.plugin.list),
|
|
190
201
|
},
|
|
@@ -261,6 +272,7 @@ export function fromPromise(plugin) {
|
|
|
261
272
|
interrupt: adaptApiMethod(SessionEndpoints["session.interrupt"], host.session.interrupt),
|
|
262
273
|
rename: adaptApiMethod(SessionEndpoints["session.rename"], host.session.rename),
|
|
263
274
|
wait: adaptApiMethod(SessionEndpoints["session.wait"], host.session.wait),
|
|
275
|
+
context: adaptApiMethod(SessionEndpoints["session.context"], host.session.context),
|
|
264
276
|
},
|
|
265
277
|
shell: {
|
|
266
278
|
hook: (name, callback) => register(host.shell.hook(name, (event) => Effect.promise(() => Promise.resolve(callback(event))))),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PermissionApi } from "@opencode-ai/client/promise/api";
|
|
2
|
+
import type { Agent } from "@opencode-ai/schema/agent";
|
|
3
|
+
import type { Permission } from "@opencode-ai/schema/permission";
|
|
4
|
+
import type { Session } from "@opencode-ai/schema/session";
|
|
5
|
+
import type { Hooks } from "./registration.js";
|
|
6
|
+
export interface PermissionEvaluation {
|
|
7
|
+
readonly sessionID: Session.ID;
|
|
8
|
+
readonly agent?: Agent.ID;
|
|
9
|
+
readonly action: string;
|
|
10
|
+
readonly resources: ReadonlyArray<string>;
|
|
11
|
+
readonly metadata?: Record<string, unknown>;
|
|
12
|
+
readonly source?: Permission.Source;
|
|
13
|
+
effect: Permission.Effect;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PermissionHooks {
|
|
17
|
+
readonly evaluate: PermissionEvaluation;
|
|
18
|
+
}
|
|
19
|
+
export type PermissionDomain = Pick<PermissionApi, "list" | "get" | "reply"> & {
|
|
20
|
+
readonly hook: Hooks<PermissionHooks>;
|
|
21
|
+
};
|
|
File without changes
|
package/dist/promise/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginApi } from "@opencode-ai/client/promise/api";
|
|
1
|
+
import type { GenerateApi, PluginApi } from "@opencode-ai/client/promise/api";
|
|
2
2
|
import type { PluginOptions } from "../options.js";
|
|
3
3
|
import type { App } from "../app.js";
|
|
4
4
|
import type { AgentDomain } from "./agent.js";
|
|
@@ -8,6 +8,7 @@ import type { CommandDomain } from "./command.js";
|
|
|
8
8
|
import type { EventDomain } from "./event.js";
|
|
9
9
|
import type { IntegrationDomain } from "./integration.js";
|
|
10
10
|
import type { MCPDomain } from "./mcp.js";
|
|
11
|
+
import type { PermissionDomain } from "./permission.js";
|
|
11
12
|
import type { ReferenceDomain } from "./reference.js";
|
|
12
13
|
import type { SessionDomain } from "./session.js";
|
|
13
14
|
import type { ShellDomain } from "./shell.js";
|
|
@@ -26,6 +27,8 @@ export interface Context {
|
|
|
26
27
|
readonly event: EventDomain;
|
|
27
28
|
readonly integration: IntegrationDomain;
|
|
28
29
|
readonly mcp: MCPDomain;
|
|
30
|
+
readonly generate: GenerateApi;
|
|
31
|
+
readonly permission: PermissionDomain;
|
|
29
32
|
readonly plugin: PluginApi;
|
|
30
33
|
readonly reference: ReferenceDomain;
|
|
31
34
|
readonly session: SessionDomain;
|
|
@@ -42,6 +42,6 @@ export interface SessionHooks {
|
|
|
42
42
|
readonly "http.request": SessionHttpRequest;
|
|
43
43
|
readonly "http.response": SessionHttpResponse;
|
|
44
44
|
}
|
|
45
|
-
export type SessionDomain = Pick<SessionApi, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "wait"> & {
|
|
45
|
+
export type SessionDomain = Pick<SessionApi, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "wait" | "context"> & {
|
|
46
46
|
readonly hook: ModelHooks<SessionHooks>;
|
|
47
47
|
};
|
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-dev-
|
|
4
|
+
"version": "0.0.0-dev-18215",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ai-sdk/provider": "3.0.8",
|
|
35
|
-
"@opencode-ai/ai": "0.0.0-dev-
|
|
36
|
-
"@opencode-ai/client": "0.0.0-dev-
|
|
37
|
-
"@opencode-ai/protocol": "0.0.0-dev-
|
|
38
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
35
|
+
"@opencode-ai/ai": "0.0.0-dev-18215",
|
|
36
|
+
"@opencode-ai/client": "0.0.0-dev-18215",
|
|
37
|
+
"@opencode-ai/protocol": "0.0.0-dev-18215",
|
|
38
|
+
"@opencode-ai/schema": "0.0.0-dev-18215",
|
|
39
39
|
"@standard-schema/spec": "1.1.0",
|
|
40
40
|
"effect": "4.0.0-rc.111",
|
|
41
41
|
"zod": "4.1.8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@opencode-ai/theme": "0.0.0-dev-
|
|
44
|
+
"@opencode-ai/theme": "0.0.0-dev-18215",
|
|
45
45
|
"@opentui/core": ">=0.5.8",
|
|
46
46
|
"@opentui/solid": ">=0.5.8",
|
|
47
47
|
"solid-js": ">=1.9.0"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@opencode-ai/theme": "0.0.0-dev-
|
|
64
|
+
"@opencode-ai/theme": "0.0.0-dev-18215",
|
|
65
65
|
"@opentui/core": "0.5.8",
|
|
66
66
|
"@opentui/solid": "0.5.8",
|
|
67
67
|
"@tsconfig/bun": "1.0.9",
|