@opencode/protocol 0.0.0-dev-21922 → 0.0.0-dev-51
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/groups/event.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Definition } from "@opencode/schema/event";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
4
|
-
export declare const makeEventGroup: <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never,
|
|
4
|
+
export declare const makeEventGroup: <const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) => HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Union<readonly [Schema.Literals<readonly Definitions[number]["type"][]>, Schema.TemplateLiteral<readonly ["rpc.", Schema.String]>]>>>;
|
|
6
|
+
}>>, never, never, HttpApiSchema.StreamSse<HttpApiSchema.SseEventFromData<Schema.Union<readonly [...Definitions, Schema.Struct<{
|
|
5
7
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
6
8
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
9
|
};
|
|
@@ -46,7 +48,9 @@ export declare const makeEventGroup: <const Definitions extends ReadonlyArray<De
|
|
|
46
48
|
readonly type: "server.connected";
|
|
47
49
|
readonly data: {};
|
|
48
50
|
}[]])[number]>, never, never, never>, false>;
|
|
49
|
-
export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never,
|
|
51
|
+
export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
52
|
+
readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Union<readonly [Schema.Literals<readonly ("agent.updated" | "command.updated" | "config.updated" | "credential.switched" | "credential.updated" | "filesystem.changed" | "form.cancelled" | "form.created" | "form.replied" | "installation.update-available" | "installation.updated" | "integration.updated" | "location.shutdown" | "mcp.resources.changed" | "mcp.status.changed" | "model.updated" | "models-dev.refreshed" | "permission.asked" | "permission.replied" | "persistent-pty.added" | "persistent-pty.removed" | "plugin.updated" | "project.updated" | "provider.updated" | "pty.created" | "pty.deleted" | "pty.exited" | "pty.updated" | "reference.updated" | "session.agent.selected" | "session.archived" | "session.compaction.delta" | "session.compaction.ended" | "session.compaction.failed" | "session.compaction.started" | "session.created" | "session.deleted" | "session.execution.failed" | "session.execution.interrupted" | "session.execution.started" | "session.execution.succeeded" | "session.forked" | "session.idle" | "session.inbox.cancelled" | "session.inbox.delivered" | "session.inbox.delivery.changed" | "session.inbox.enqueued" | "session.instructions.updated" | "session.metadata.updated" | "session.model.selected" | "session.moved" | "session.permissions" | "session.reasoning.delta" | "session.reasoning.ended" | "session.reasoning.started" | "session.renamed" | "session.retry.scheduled" | "session.revert.cleared" | "session.revert.committed" | "session.revert.staged" | "session.shell.ended" | "session.shell.started" | "session.skill.activated" | "session.status" | "session.step.ended" | "session.step.failed" | "session.step.started" | "session.step.streamed" | "session.synthetic" | "session.text.delta" | "session.text.ended" | "session.text.started" | "session.tool.called" | "session.tool.failed" | "session.tool.input.delta" | "session.tool.input.ended" | "session.tool.input.started" | "session.tool.progress" | "session.tool.success" | "session.unarchived" | "session.usage.updated" | "session.viewed" | "shell.created" | "shell.deleted" | "shell.exited" | "skill.updated" | "tui.command.execute" | "tui.prompt.append" | "tui.session.select" | "tui.toast.show" | "vcs.branch.updated" | "websearch.updated" | "worktree.resolved" | "worktree.updated")[]>, Schema.TemplateLiteral<readonly ["rpc.", Schema.String]>]>>>;
|
|
53
|
+
}>>, never, never, HttpApiSchema.StreamSse<HttpApiSchema.SseEventFromData<Schema.Union<readonly [Schema.Struct<{
|
|
50
54
|
readonly id: Schema.brand<Schema.String, "Event.ID"> & {
|
|
51
55
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
52
56
|
};
|
package/dist/groups/event.js
CHANGED
|
@@ -29,12 +29,21 @@ const schema = (definitions) => Schema.Union([
|
|
|
29
29
|
}).annotate({ identifier: "V2Event.server.connected" }),
|
|
30
30
|
]),
|
|
31
31
|
]).annotate({ identifier: "V2Event" });
|
|
32
|
+
const query = (definitions) => Schema.Struct({
|
|
33
|
+
types: Schema.optional(Schema.ArrayEnsure(Schema.Union([
|
|
34
|
+
Schema.Literals(definitions.map((definition) => definition.type)),
|
|
35
|
+
rpcEvent.fields.type,
|
|
36
|
+
]))).annotate({
|
|
37
|
+
description: "Only send events of these types, plus the initial server.connected event. When omitted, all events are sent.",
|
|
38
|
+
}),
|
|
39
|
+
}).annotate({ identifier: "EventSubscribeQuery" });
|
|
32
40
|
const make = (definitions) => {
|
|
33
41
|
const EventSchema = schema(definitions);
|
|
34
42
|
return {
|
|
35
43
|
schema: EventSchema,
|
|
36
44
|
group: HttpApiGroup.make("server.event")
|
|
37
45
|
.add(HttpApiEndpoint.get("event.subscribe", "/api/event", {
|
|
46
|
+
query: query(definitions),
|
|
38
47
|
success: HttpApiSchema.StreamSse({ data: EventSchema }),
|
|
39
48
|
}).annotateMerge(OpenApi.annotations({
|
|
40
49
|
identifier: "event.subscribe",
|
|
@@ -106,6 +106,7 @@ 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>;
|
|
109
110
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
110
111
|
readonly methods: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
111
112
|
readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
@@ -879,6 +880,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
|
|
|
879
880
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
880
881
|
readonly id: Schema.brand<Schema.String, "Integration.ID">;
|
|
881
882
|
readonly name: Schema.String;
|
|
883
|
+
readonly configured: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
882
884
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
883
885
|
readonly methods: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
884
886
|
readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
|
package/dist/groups/model.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
86
86
|
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
87
87
|
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
88
88
|
}>, never, never>;
|
|
89
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.Type, Model.Type, never, never>>>, Schema.optionalKey<Schema.Codec<Model.Type, Model.Type, never, never>>, never, never>;
|
|
89
90
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
90
91
|
readonly name: Schema.String;
|
|
91
92
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
@@ -223,6 +224,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
223
224
|
readonly location: Schema.optional<Schema.Struct<{
|
|
224
225
|
readonly directory: Schema.optional<Schema.String>;
|
|
225
226
|
}>>;
|
|
227
|
+
readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Codec<Model.Type, Model.Type, never, never>>>;
|
|
226
228
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
227
229
|
readonly location: Schema.Struct<{
|
|
228
230
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
@@ -303,6 +305,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
303
305
|
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
304
306
|
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
305
307
|
}>, never, never>;
|
|
308
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.Type, Model.Type, never, never>>>, Schema.optionalKey<Schema.Codec<Model.Type, Model.Type, never, never>>, never, never>;
|
|
306
309
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
307
310
|
readonly name: Schema.String;
|
|
308
311
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
package/dist/groups/model.js
CHANGED
|
@@ -4,9 +4,15 @@ import { Schema } from "effect";
|
|
|
4
4
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
5
5
|
import { ServiceUnavailableError } from "../errors.js";
|
|
6
6
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
|
+
const ListQuery = Schema.Struct({
|
|
8
|
+
...LocationQuery.fields,
|
|
9
|
+
types: Schema.optional(Schema.ArrayEnsure(Model.Type)).annotate({
|
|
10
|
+
description: "Only list models of these types. Defaults to chat, the only type offered for sessions.",
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
7
13
|
export const ModelGroup = HttpApiGroup.make("server.model")
|
|
8
14
|
.add(HttpApiEndpoint.get("model.list", "/api/model", {
|
|
9
|
-
query:
|
|
15
|
+
query: ListQuery,
|
|
10
16
|
success: Location.response(Schema.Array(Model.Info)),
|
|
11
17
|
error: ServiceUnavailableError,
|
|
12
18
|
})
|
|
@@ -14,7 +20,7 @@ export const ModelGroup = HttpApiGroup.make("server.model")
|
|
|
14
20
|
.annotateMerge(OpenApi.annotations({
|
|
15
21
|
identifier: "model.list",
|
|
16
22
|
summary: "List models",
|
|
17
|
-
description: "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.",
|
|
23
|
+
description: "Retrieve the current snapshot of available models of the requested types, chat by default, ordered by release date within each type. The snapshot may precede initial plugin settlement.",
|
|
18
24
|
})))
|
|
19
25
|
.add(HttpApiEndpoint.get("model.default", "/api/model/default", {
|
|
20
26
|
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-51",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "bun run script/build.ts",
|
|
30
|
+
"pack": "bun run script/pack.ts",
|
|
30
31
|
"generate": "bun run script/generate-openapi.ts",
|
|
31
32
|
"check:generated": "bun run script/generate-openapi.ts --check",
|
|
32
33
|
"test": "bun test --only-failures",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"typecheck:tsc": "tsc --noEmit"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@opencode/schema": "0.0.0-dev-
|
|
38
|
+
"@opencode/schema": "0.0.0-dev-51",
|
|
38
39
|
"effect": "4.0.1"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|