@opencode/protocol 0.0.0-dev-51 → 0.0.0-dev-56
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/errors.d.ts +6 -0
- package/dist/errors.js +5 -0
- package/dist/groups/integration.d.ts +0 -2
- package/dist/groups/plugin.d.ts +18 -2
- package/dist/groups/plugin.js +15 -1
- package/package.json +2 -2
package/dist/errors.d.ts
CHANGED
|
@@ -95,6 +95,12 @@ declare const FileNotFoundError_base: Schema.Class<FileNotFoundError, Schema.Tag
|
|
|
95
95
|
}>, import("effect/Cause").YieldableError>;
|
|
96
96
|
export declare class FileNotFoundError extends FileNotFoundError_base {
|
|
97
97
|
}
|
|
98
|
+
declare const PluginNotFoundError_base: Schema.Class<PluginNotFoundError, Schema.TaggedStruct<"PluginNotFoundError", {
|
|
99
|
+
readonly pluginID: Schema.String;
|
|
100
|
+
readonly message: Schema.String;
|
|
101
|
+
}>, import("effect/Cause").YieldableError>;
|
|
102
|
+
export declare class PluginNotFoundError extends PluginNotFoundError_base {
|
|
103
|
+
}
|
|
98
104
|
declare const AgentNotFoundError_base: Schema.Class<AgentNotFoundError, Schema.TaggedStruct<"AgentNotFoundError", {
|
|
99
105
|
readonly agentID: Schema.String;
|
|
100
106
|
readonly message: Schema.String;
|
package/dist/errors.js
CHANGED
|
@@ -75,6 +75,11 @@ export class FileNotFoundError extends Schema.TaggedError()("FileNotFoundError",
|
|
|
75
75
|
message: Schema.String,
|
|
76
76
|
}, { httpApiStatus: 404 }) {
|
|
77
77
|
}
|
|
78
|
+
export class PluginNotFoundError extends Schema.TaggedError()("PluginNotFoundError", {
|
|
79
|
+
pluginID: Schema.String,
|
|
80
|
+
message: Schema.String,
|
|
81
|
+
}, { httpApiStatus: 404 }) {
|
|
82
|
+
}
|
|
78
83
|
export class AgentNotFoundError extends Schema.TaggedError()("AgentNotFoundError", {
|
|
79
84
|
agentID: Schema.String,
|
|
80
85
|
message: Schema.String,
|
|
@@ -106,7 +106,6 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
|
|
|
106
106
|
readonly data: Schema.Struct<{
|
|
107
107
|
readonly id: Schema.brand<Schema.String, "Integration.ID">;
|
|
108
108
|
readonly name: Schema.String;
|
|
109
|
-
readonly configured: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
110
109
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
111
110
|
readonly methods: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
112
111
|
readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
@@ -880,7 +879,6 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
|
|
|
880
879
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
881
880
|
readonly id: Schema.brand<Schema.String, "Integration.ID">;
|
|
882
881
|
readonly name: Schema.String;
|
|
883
|
-
readonly configured: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
884
882
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
885
883
|
readonly methods: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
886
884
|
readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
|
package/dist/groups/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
3
|
+
import { InvalidRequestError, PluginNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", HttpApiEndpoint.HttpApiEndpoint<"plugin.check", "POST", "/api/plugin/check", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
6
|
readonly directory: Schema.optional<Schema.String>;
|
|
@@ -31,6 +31,7 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
31
31
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
32
32
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
33
33
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
34
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
34
35
|
}>;
|
|
35
36
|
readonly state: Schema.Union<readonly [Schema.Struct<{
|
|
36
37
|
readonly status: Schema.Literal<"active">;
|
|
@@ -40,7 +41,21 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
40
41
|
readonly ref: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
41
42
|
}>]>;
|
|
42
43
|
}>>;
|
|
43
|
-
}>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.
|
|
44
|
+
}>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.gui", "GET", "/api/plugin/gui", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
45
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
46
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly id: Schema.brand<Schema.String, "Plugin.ID">;
|
|
49
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
50
|
+
readonly location: Schema.Struct<{
|
|
51
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
52
|
+
}>;
|
|
53
|
+
readonly data: Schema.Struct<{
|
|
54
|
+
readonly code: Schema.String;
|
|
55
|
+
readonly revision: Schema.String;
|
|
56
|
+
readonly options: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
57
|
+
}>;
|
|
58
|
+
}>>, Schema.toCodecJson<typeof PluginNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.list", "GET", "/api/plugin", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
44
59
|
readonly location: Schema.optional<Schema.Struct<{
|
|
45
60
|
readonly directory: Schema.optional<Schema.String>;
|
|
46
61
|
}>>;
|
|
@@ -68,6 +83,7 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
68
83
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
69
84
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
70
85
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
86
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
71
87
|
}>;
|
|
72
88
|
readonly state: Schema.Union<readonly [Schema.Struct<{
|
|
73
89
|
readonly status: Schema.Literal<"active">;
|
package/dist/groups/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Location } from "@opencode/schema/location";
|
|
|
2
2
|
import { Plugin } from "@opencode/schema/plugin";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
5
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
5
|
+
import { InvalidRequestError, PluginNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
6
6
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
7
|
export const PluginGroup = HttpApiGroup.make("server.plugin")
|
|
8
8
|
.add(HttpApiEndpoint.get("plugin.list", "/api/plugin", {
|
|
@@ -14,6 +14,20 @@ export const PluginGroup = HttpApiGroup.make("server.plugin")
|
|
|
14
14
|
identifier: "plugin.list",
|
|
15
15
|
summary: "List plugins",
|
|
16
16
|
description: "Retrieve enabled server plugins and their current status.",
|
|
17
|
+
})))
|
|
18
|
+
.add(HttpApiEndpoint.get("plugin.gui", "/api/plugin/gui", {
|
|
19
|
+
query: Schema.Struct({
|
|
20
|
+
...LocationQuery.fields,
|
|
21
|
+
id: Plugin.ID,
|
|
22
|
+
}),
|
|
23
|
+
success: Location.response(Plugin.GuiBundle),
|
|
24
|
+
error: PluginNotFoundError,
|
|
25
|
+
})
|
|
26
|
+
.annotateMerge(locationQueryOpenApi)
|
|
27
|
+
.annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "plugin.gui",
|
|
29
|
+
summary: "Read plugin GUI bundle",
|
|
30
|
+
description: "Read an active plugin's prebuilt CommonJS `./gui-experimental` bundle. Desktop app windows run its default export; the desktop app's main process runs its `main` export. Fails with not found when no active plugin has the id or the plugin exports no `./gui-experimental`.",
|
|
17
31
|
})))
|
|
18
32
|
.add(HttpApiEndpoint.post("plugin.check", "/api/plugin/check", {
|
|
19
33
|
query: LocationQuery,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/protocol",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-56",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"typecheck:tsc": "tsc --noEmit"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@opencode/schema": "0.0.0-dev-
|
|
38
|
+
"@opencode/schema": "0.0.0-dev-56",
|
|
39
39
|
"effect": "4.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|