@opencode-ai/protocol 0.0.0-next-14953 → 0.0.0-next-14957

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.
@@ -3,7 +3,8 @@ import { Location } from "@opencode-ai/schema/location";
3
3
  import { Schema } from "effect";
4
4
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
5
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
- export const AgentGroup = HttpApiGroup.make("server.agent").add(HttpApiEndpoint.get("agent.list", "/api/agent", {
6
+ export const AgentGroup = HttpApiGroup.make("server.agent")
7
+ .add(HttpApiEndpoint.get("agent.list", "/api/agent", {
7
8
  query: LocationQuery,
8
9
  success: Location.response(Schema.Array(Agent.Info)),
9
10
  })
@@ -12,4 +13,5 @@ export const AgentGroup = HttpApiGroup.make("server.agent").add(HttpApiEndpoint.
12
13
  identifier: "v2.agent.list",
13
14
  summary: "List agents",
14
15
  description: "Retrieve currently registered agents.",
15
- })));
16
+ })))
17
+ .annotateMerge(OpenApi.annotations({ title: "agent" }));
@@ -15,6 +15,6 @@ export const CommandGroup = HttpApiGroup.make("server.command")
15
15
  description: "Retrieve currently registered commands.",
16
16
  })))
17
17
  .annotateMerge(OpenApi.annotations({
18
- title: "commands",
18
+ title: "command",
19
19
  description: "Experimental command routes.",
20
20
  }));
@@ -15,6 +15,7 @@ export const CredentialGroup = HttpApiGroup.make("server.credential")
15
15
  summary: "Update credential",
16
16
  description: "Update a stored credential label.",
17
17
  })))
18
+ .annotateMerge(OpenApi.annotations({ title: "credential" }))
18
19
  .add(HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", {
19
20
  params: { credentialID: Credential.ID },
20
21
  query: LocationQuery,
@@ -1,10 +1,12 @@
1
1
  import { Location } from "@opencode-ai/schema/location";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
4
- export const DebugGroup = HttpApiGroup.make("server.debug").add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
4
+ export const DebugGroup = HttpApiGroup.make("server.debug")
5
+ .add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
5
6
  success: Schema.Array(Location.Ref),
6
7
  }).annotateMerge(OpenApi.annotations({
7
8
  identifier: "v2.debug.location",
8
9
  summary: "List loaded locations",
9
10
  description: "List locations currently loaded by the server.",
10
- })));
11
+ })))
12
+ .annotateMerge(OpenApi.annotations({ title: "debug" }));
@@ -40,7 +40,7 @@ const make = (definitions) => {
40
40
  summary: "Subscribe to change hints",
41
41
  description: "Payload-free hint channel: after an event commits, a subscriber eventually receives a hint for that aggregate with seq at or beyond the event, or a sweep-required marker. Hints coalesce to the latest seq per aggregate under backpressure and the stream never fails from overflow. No consumer may derive correctness from receiving a hint; correctness always comes from durable log reads plus the consumer's own checkpoint. A sweep-required marker is emitted first on every (re)subscribe and whenever hint retention is exceeded: treat every aggregate as potentially dirty and recover via bounded sweep plus log reads.",
42
42
  })))
43
- .annotateMerge(OpenApi.annotations({ title: "events", description: "Experimental event stream routes." })),
43
+ .annotateMerge(OpenApi.annotations({ title: "event", description: "Experimental event stream routes." })),
44
44
  };
45
45
  };
46
46
  export const makeEventGroup = (definitions) => make(definitions).group;
@@ -96,4 +96,4 @@ export const makeFormGroup = (locationMiddleware, formLocationMiddleware) => Htt
96
96
  summary: "Cancel form",
97
97
  description: "Cancel a pending form.",
98
98
  })))
99
- .annotateMerge(OpenApi.annotations({ title: "forms", description: "Session form routes." }));
99
+ .annotateMerge(OpenApi.annotations({ title: "form", description: "Session form routes." }));
@@ -1,9 +1,11 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
- export const HealthGroup = HttpApiGroup.make("server.health").add(HttpApiEndpoint.get("health.get", "/api/health", {
3
+ export const HealthGroup = HttpApiGroup.make("server.health")
4
+ .add(HttpApiEndpoint.get("health.get", "/api/health", {
4
5
  success: Schema.Struct({ healthy: Schema.Literal(true) }),
5
6
  }).annotateMerge(OpenApi.annotations({
6
7
  identifier: "v2.health.get",
7
8
  summary: "Check server health",
8
9
  description: "Check whether the API server is ready to accept requests.",
9
- })));
10
+ })))
11
+ .annotateMerge(OpenApi.annotations({ title: "health" }));
@@ -95,4 +95,4 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
95
95
  summary: "Cancel OAuth connection",
96
96
  description: "Cancel an OAuth attempt and release its resources.",
97
97
  })))
98
- .annotateMerge(OpenApi.annotations({ title: "integrations", description: "Integration discovery and authentication routes." }));
98
+ .annotateMerge(OpenApi.annotations({ title: "integration", description: "Integration discovery and authentication routes." }));
@@ -20,7 +20,8 @@ export const locationQueryOpenApi = OpenApi.annotations({
20
20
  };
21
21
  },
22
22
  });
23
- export const LocationGroup = HttpApiGroup.make("server.location").add(HttpApiEndpoint.get("location.get", "/api/location", {
23
+ export const LocationGroup = HttpApiGroup.make("server.location")
24
+ .add(HttpApiEndpoint.get("location.get", "/api/location", {
24
25
  query: LocationQuery,
25
26
  success: Location.Info,
26
27
  })
@@ -29,4 +30,5 @@ export const LocationGroup = HttpApiGroup.make("server.location").add(HttpApiEnd
29
30
  identifier: "v2.location.get",
30
31
  summary: "Get location",
31
32
  description: "Resolve the requested location or the server default location.",
32
- })));
33
+ })))
34
+ .annotateMerge(OpenApi.annotations({ title: "location" }));
@@ -37,6 +37,6 @@ export const MessageGroup = HttpApiGroup.make("server.message")
37
37
  description: "Retrieve projected messages for a session. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline.",
38
38
  })))
39
39
  .annotateMerge(OpenApi.annotations({
40
- title: "messages",
40
+ title: "session",
41
41
  description: "Experimental message routes.",
42
42
  }));
@@ -28,6 +28,6 @@ export const ModelGroup = HttpApiGroup.make("server.model")
28
28
  description: "Retrieve the model used when a session has no explicit model selection.",
29
29
  })))
30
30
  .annotateMerge(OpenApi.annotations({
31
- title: "models",
31
+ title: "model",
32
32
  description: "Experimental model routes.",
33
33
  }));
@@ -96,4 +96,4 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
96
96
  summary: "Reply to pending permission request",
97
97
  description: "Respond to a pending permission request owned by a session.",
98
98
  })))
99
- .annotateMerge(OpenApi.annotations({ title: "permissions", description: "Experimental permission routes." }));
99
+ .annotateMerge(OpenApi.annotations({ title: "permission", description: "Experimental permission routes." }));
@@ -15,6 +15,6 @@ export const PluginGroup = HttpApiGroup.make("server.plugin")
15
15
  description: "Retrieve currently loaded plugins.",
16
16
  })))
17
17
  .annotateMerge(OpenApi.annotations({
18
- title: "plugins",
18
+ title: "plugin",
19
19
  description: "Experimental plugin routes.",
20
20
  }));
@@ -1,24 +1,52 @@
1
+ import { Schema } from "effect";
1
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
2
- export declare const ProjectGroup: HttpApiGroup.HttpApiGroup<"server.project", HttpApiEndpoint.HttpApiEndpoint<"project.current", "GET", "/api/project/current", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
3
- readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
4
- readonly directory: import("effect/Schema").optional<import("effect/Schema").String>;
5
- readonly workspace: import("effect/Schema").optional<import("effect/Schema").String>;
3
+ export declare const ProjectGroup: HttpApiGroup.HttpApiGroup<"server.project", HttpApiEndpoint.HttpApiEndpoint<"project.list", "GET", "/api/project", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
4
+ readonly id: Schema.brand<Schema.String, "Project.ID"> & {
5
+ global: string & import("effect/Brand").Brand<"Project.ID">;
6
+ };
7
+ readonly worktree: Schema.String;
8
+ readonly vcs: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["git", "hg"]>>>, Schema.optionalKey<Schema.Literals<readonly ["git", "hg"]>>, never, never>;
9
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
10
+ readonly icon: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
11
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
12
+ readonly override: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
13
+ readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14
+ }>>>, Schema.optionalKey<Schema.Struct<{
15
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
16
+ readonly override: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
17
+ readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
18
+ }>>, never, never>;
19
+ readonly commands: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
20
+ readonly start: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
21
+ }>>>, Schema.optionalKey<Schema.Struct<{
22
+ readonly start: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
23
+ }>>, never, never>;
24
+ readonly time: Schema.Struct<{
25
+ readonly created: Schema.Int;
26
+ readonly updated: Schema.Int;
27
+ readonly initialized: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
28
+ }>;
29
+ readonly sandboxes: Schema.$Array<Schema.String>;
30
+ }>>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"project.current", "GET", "/api/project/current", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
31
+ readonly location: Schema.optional<Schema.Struct<{
32
+ readonly directory: Schema.optional<Schema.String>;
33
+ readonly workspace: Schema.optional<Schema.String>;
6
34
  }>>;
7
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
8
- readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Project.ID"> & {
35
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
36
+ readonly id: Schema.brand<Schema.String, "Project.ID"> & {
9
37
  global: string & import("effect/Brand").Brand<"Project.ID">;
10
38
  };
11
- readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
12
- }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"project.directories", "GET", "/api/project/:projectID/directories", HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
13
- projectID: import("effect/Schema").brand<import("effect/Schema").String, "Project.ID"> & {
39
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
40
+ }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"project.directories", "GET", "/api/project/:projectID/directories", HttpApiEndpoint.StringTree<Schema.Struct<{
41
+ projectID: Schema.brand<Schema.String, "Project.ID"> & {
14
42
  global: string & import("effect/Brand").Brand<"Project.ID">;
15
43
  };
16
- }>>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
17
- readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
18
- readonly directory: import("effect/Schema").optional<import("effect/Schema").String>;
19
- readonly workspace: import("effect/Schema").optional<import("effect/Schema").String>;
44
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
45
+ readonly location: Schema.optional<Schema.Struct<{
46
+ readonly directory: Schema.optional<Schema.String>;
47
+ readonly workspace: Schema.optional<Schema.String>;
20
48
  }>>;
21
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
22
- readonly directory: import("effect/Schema").brand<import("effect/Schema").String, "AbsolutePath">;
23
- readonly strategy: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
49
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
50
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
51
+ readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
24
52
  }>>>, HttpApiEndpoint.Json<never>, never, never>, false>;
@@ -1,8 +1,16 @@
1
1
  import { Project } from "@opencode-ai/schema/project";
2
+ import { Schema } from "effect";
2
3
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
4
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
4
5
  const root = "/api/project";
5
6
  export const ProjectGroup = HttpApiGroup.make("server.project")
7
+ .add(HttpApiEndpoint.get("project.list", root, {
8
+ success: Schema.Array(Project.Info),
9
+ }).annotateMerge(OpenApi.annotations({
10
+ identifier: "v2.project.list",
11
+ summary: "List projects",
12
+ description: "List known projects.",
13
+ })))
6
14
  .add(HttpApiEndpoint.get("project.current", `${root}/current`, {
7
15
  query: LocationQuery,
8
16
  success: Project.Current,
@@ -25,6 +33,6 @@ export const ProjectGroup = HttpApiGroup.make("server.project")
25
33
  description: "List known local absolute directories for a project.",
26
34
  })))
27
35
  .annotateMerge(OpenApi.annotations({
28
- title: "projects",
36
+ title: "project",
29
37
  description: "Location-scoped project routes.",
30
38
  }));
@@ -29,6 +29,6 @@ export const ProviderGroup = HttpApiGroup.make("server.provider")
29
29
  description: "Retrieve a single AI provider so clients can inspect its availability and endpoint settings.",
30
30
  })))
31
31
  .annotateMerge(OpenApi.annotations({
32
- title: "providers",
32
+ title: "provider",
33
33
  description: "Experimental provider routes.",
34
34
  }));
@@ -16,7 +16,7 @@ export const makeQuestionGroup = (locationMiddleware, sessionLocationMiddleware)
16
16
  summary: "List pending question requests",
17
17
  description: "Retrieve pending question requests for a location.",
18
18
  })))
19
- .annotateMerge(OpenApi.annotations({ title: "questions", description: "Experimental question routes." }))
19
+ .annotateMerge(OpenApi.annotations({ title: "question", description: "Experimental question routes." }))
20
20
  // Effect applies group middleware only to endpoints already added; session endpoints use session placement below.
21
21
  .middleware(locationMiddleware)
22
22
  .add(HttpApiEndpoint.get("session.question.list", "/api/session/:sessionID/question", {
@@ -53,4 +53,4 @@ export const makeQuestionGroup = (locationMiddleware, sessionLocationMiddleware)
53
53
  summary: "Reject pending question request",
54
54
  description: "Reject a pending question request owned by a session.",
55
55
  })))
56
- .annotateMerge(OpenApi.annotations({ title: "session questions", description: "Experimental session question routes." }));
56
+ .annotateMerge(OpenApi.annotations({ title: "question", description: "Experimental session question routes." }));
@@ -418,6 +418,6 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
418
418
  description: "Retrieve one projected message owned by the Session.",
419
419
  })))
420
420
  .annotateMerge(OpenApi.annotations({
421
- title: "sessions",
421
+ title: "session",
422
422
  description: "Experimental session routes.",
423
423
  }));
@@ -15,6 +15,6 @@ export const SkillGroup = HttpApiGroup.make("server.skill")
15
15
  description: "Retrieve currently registered skills.",
16
16
  })))
17
17
  .annotateMerge(OpenApi.annotations({
18
- title: "skills",
18
+ title: "skill",
19
19
  description: "Experimental skill routes.",
20
20
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-14953",
4
+ "version": "0.0.0-next-14957",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsgo --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-14953",
29
+ "@opencode-ai/schema": "0.0.0-next-14957",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {