@opencode-ai/protocol 0.0.0-next-15090 → 0.0.0-next-15092

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.
@@ -11,9 +11,9 @@ import { Context, Effect, Encoding, Result, Schema, SchemaGetter, Struct } from
11
11
  import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
12
12
  import { ConflictError, CommandEvaluationError, CommandNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
13
13
  import { Agent } from "@opencode-ai/schema/agent";
14
+ import { Skill } from "@opencode-ai/schema/skill";
14
15
  import { Model } from "@opencode-ai/schema/model";
15
16
  import { Location } from "@opencode-ai/schema/location";
16
- import { Revert } from "@opencode-ai/schema/revert";
17
17
  import { SessionEvent } from "@opencode-ai/schema/session-event";
18
18
  import { EventLog } from "@opencode-ai/schema/event-log";
19
19
  const ParentIDFilter = Schema.Union([
@@ -232,7 +232,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
232
232
  id: SessionMessage.ID.pipe(Schema.optional),
233
233
  command: Schema.String,
234
234
  arguments: Schema.String.pipe(Schema.optional),
235
- agent: Schema.String.pipe(Schema.optional),
235
+ agent: Agent.ID.pipe(Schema.optional),
236
236
  model: Model.Ref.pipe(Schema.optional),
237
237
  files: PromptInput.Prompt.fields.files,
238
238
  agents: PromptInput.Prompt.fields.agents,
@@ -252,7 +252,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
252
252
  params: { sessionID: Session.ID },
253
253
  payload: Schema.Struct({
254
254
  id: SessionMessage.ID.pipe(Schema.optional),
255
- skill: Schema.String,
255
+ skill: Skill.ID,
256
256
  resume: Schema.Boolean.pipe(Schema.optional),
257
257
  }),
258
258
  success: HttpApiSchema.NoContent,
@@ -322,7 +322,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
322
322
  .add(HttpApiEndpoint.post("session.revert.stage", "/api/session/:sessionID/revert/stage", {
323
323
  params: { sessionID: Session.ID },
324
324
  payload: Schema.Struct({ messageID: SessionMessage.ID, files: Schema.Boolean.pipe(Schema.optional) }),
325
- success: Schema.Struct({ data: Revert.State }),
325
+ success: Schema.Struct({ data: Session.Revert }),
326
326
  error: [MessageNotFoundError, SessionNotFoundError, SessionBusyError, UnknownError],
327
327
  })
328
328
  .middleware(sessionLocationMiddleware)
@@ -347,7 +347,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
347
347
  .annotateMerge(OpenApi.annotations({ identifier: "v2.session.revert.commit", summary: "Commit staged revert" })))
348
348
  .add(HttpApiEndpoint.get("session.context", "/api/session/:sessionID/context", {
349
349
  params: { sessionID: Session.ID },
350
- success: Schema.Struct({ data: Schema.Array(SessionMessage.Message) }),
350
+ success: Schema.Struct({ data: Schema.Array(SessionMessage.Info) }),
351
351
  error: [SessionNotFoundError, UnknownError],
352
352
  })
353
353
  .middleware(sessionLocationMiddleware)
@@ -431,7 +431,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
431
431
  })))
432
432
  .add(HttpApiEndpoint.get("session.message", "/api/session/:sessionID/message/:messageID", {
433
433
  params: { sessionID: Session.ID, messageID: SessionMessage.ID },
434
- success: Schema.Struct({ data: SessionMessage.Message }),
434
+ success: Schema.Struct({ data: SessionMessage.Info }),
435
435
  error: [SessionNotFoundError, MessageNotFoundError],
436
436
  })
437
437
  .middleware(sessionLocationMiddleware)
@@ -10,9 +10,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
10
10
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
11
11
  readonly location: typeof Location.Info;
12
12
  readonly data: Schema.$Array<Schema.Struct<{
13
- readonly id: Schema.brand<Schema.String, "ShellID"> & {
14
- create: () => string & import("effect/Brand").Brand<"ShellID">;
15
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
13
+ readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
14
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
15
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
16
16
  };
17
17
  readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
18
18
  readonly command: Schema.String;
@@ -40,9 +40,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
40
40
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
41
41
  readonly location: typeof Location.Info;
42
42
  readonly data: Schema.Struct<{
43
- readonly id: Schema.brand<Schema.String, "ShellID"> & {
44
- create: () => string & import("effect/Brand").Brand<"ShellID">;
45
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
43
+ readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
44
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
45
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
46
46
  };
47
47
  readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
48
48
  readonly command: Schema.String;
@@ -58,9 +58,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
58
58
  }>;
59
59
  }>;
60
60
  }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.get", "GET", "/api/shell/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
61
- id: Schema.brand<Schema.String, "ShellID"> & {
62
- create: () => string & import("effect/Brand").Brand<"ShellID">;
63
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
61
+ id: Schema.brand<Schema.String, "Shell.ID"> & {
62
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
63
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
64
64
  };
65
65
  }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
66
66
  readonly location: Schema.optional<Schema.Struct<{
@@ -70,9 +70,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
70
70
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
71
71
  readonly location: typeof Location.Info;
72
72
  readonly data: Schema.Struct<{
73
- readonly id: Schema.brand<Schema.String, "ShellID"> & {
74
- create: () => string & import("effect/Brand").Brand<"ShellID">;
75
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
73
+ readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
74
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
75
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
76
76
  };
77
77
  readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
78
78
  readonly command: Schema.String;
@@ -88,9 +88,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
88
88
  }>;
89
89
  }>;
90
90
  }>>, HttpApiEndpoint.Json<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.timeout", "PATCH", "/api/shell/:id/timeout", HttpApiEndpoint.StringTree<Schema.Struct<{
91
- id: Schema.brand<Schema.String, "ShellID"> & {
92
- create: () => string & import("effect/Brand").Brand<"ShellID">;
93
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
91
+ id: Schema.brand<Schema.String, "Shell.ID"> & {
92
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
93
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
94
94
  };
95
95
  }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
96
96
  readonly location: Schema.optional<Schema.Struct<{
@@ -102,9 +102,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
102
102
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
103
103
  readonly location: typeof Location.Info;
104
104
  readonly data: Schema.Struct<{
105
- readonly id: Schema.brand<Schema.String, "ShellID"> & {
106
- create: () => string & import("effect/Brand").Brand<"ShellID">;
107
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
105
+ readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
106
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
107
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
108
108
  };
109
109
  readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
110
110
  readonly command: Schema.String;
@@ -120,9 +120,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
120
120
  }>;
121
121
  }>;
122
122
  }>>, HttpApiEndpoint.Json<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.output", "GET", "/api/shell/:id/output", HttpApiEndpoint.StringTree<Schema.Struct<{
123
- id: Schema.brand<Schema.String, "ShellID"> & {
124
- create: () => string & import("effect/Brand").Brand<"ShellID">;
125
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
123
+ id: Schema.brand<Schema.String, "Shell.ID"> & {
124
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
125
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
126
126
  };
127
127
  }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
128
128
  readonly cursor: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
@@ -140,9 +140,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
140
140
  readonly truncated: Schema.Boolean;
141
141
  }>;
142
142
  }>>, HttpApiEndpoint.Json<typeof ShellNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.remove", "DELETE", "/api/shell/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
143
- id: Schema.brand<Schema.String, "ShellID"> & {
144
- create: () => string & import("effect/Brand").Brand<"ShellID">;
145
- ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
143
+ id: Schema.brand<Schema.String, "Shell.ID"> & {
144
+ create: () => string & import("effect/Brand").Brand<"Shell.ID">;
145
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
146
146
  };
147
147
  }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
148
148
  readonly location: Schema.optional<Schema.Struct<{
@@ -9,7 +9,8 @@ export declare const SkillGroup: HttpApiGroup.HttpApiGroup<"server.skill", HttpA
9
9
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
10
10
  readonly location: typeof Location.Info;
11
11
  readonly data: Schema.$Array<Schema.Struct<{
12
- readonly name: Schema.String;
12
+ readonly id: Schema.brand<Schema.String, "Skill.ID">;
13
+ readonly name: Schema.brand<Schema.String, "Skill.Name">;
13
14
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14
15
  readonly slash: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
15
16
  readonly autoinvoke: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
@@ -24,10 +24,10 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
24
24
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
25
25
  readonly location: typeof Location.Info;
26
26
  readonly data: Schema.$Array<Schema.Struct<{
27
- readonly file: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
28
- readonly patch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
29
- readonly additions: Schema.Finite;
30
- readonly deletions: Schema.Finite;
31
- readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["added", "deleted", "modified"]>>>, Schema.optionalKey<Schema.Literals<readonly ["added", "deleted", "modified"]>>, never, never>;
27
+ readonly file: Schema.String;
28
+ readonly patch: Schema.String;
29
+ readonly additions: Schema.Int;
30
+ readonly deletions: Schema.Int;
31
+ readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
32
32
  }>>;
33
33
  }>>, HttpApiEndpoint.Json<never>, never, never>, false>;
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-15090",
4
+ "version": "0.0.0-next-15092",
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-15090",
29
+ "@opencode-ai/schema": "0.0.0-next-15092",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {