@opencode/protocol 0.0.0-dev-19555 → 0.0.0-dev-19559

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.
@@ -1,5 +1,4 @@
1
1
  import { SessionMessage } from "@opencode/schema/session-message";
2
- import { SessionTransfer } from "@opencode/schema/session-transfer";
3
2
  import { SessionInbox } from "@opencode/schema/session-inbox";
4
3
  import { PromptInput } from "@opencode/schema/prompt-input";
5
4
  import { Session } from "@opencode/schema/session";
@@ -8,7 +7,6 @@ import { InstructionEntry } from "@opencode/schema/instruction-entry";
8
7
  import { Project } from "@opencode/schema/project";
9
8
  import { AbsolutePath, NonNegativeInt, PositiveInt, RelativePath, statics } from "@opencode/schema/schema";
10
9
  import { Event } from "@opencode/schema/event";
11
- import { Workspace } from "@opencode/schema/workspace";
12
10
  import { Context, Effect, Encoding, Result, Schema, SchemaGetter, Struct } from "effect";
13
11
  import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
14
12
  import { ConflictError, CommandExecutionError, CommandNotFoundError, InvalidCursorError, InvalidRequestError, MessageNotFoundError, ServiceUnavailableError, SessionBusyError, SessionNotFoundError, SkillNotFoundError, UnknownError, } from "../errors.js";
@@ -20,6 +18,7 @@ import { Location } from "@opencode/schema/location";
20
18
  import { SessionEvent } from "@opencode/schema/session-event";
21
19
  import { EventLog } from "@opencode/schema/event-log";
22
20
  import { FileDiff } from "@opencode/schema/file-diff";
21
+ import { PublicSessionMessage } from "./message.js";
23
22
  const ParentIDFilter = Schema.Union([
24
23
  Session.ID,
25
24
  Schema.Null.pipe(Schema.encodeTo(Schema.Literal("null"), {
@@ -30,7 +29,6 @@ const ParentIDFilter = Schema.Union([
30
29
  description: "Filter by parent session. Use null to return only root sessions.",
31
30
  });
32
31
  const SessionsQueryFields = {
33
- workspace: Workspace.ID.pipe(Schema.optional),
34
32
  limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional).annotate({
35
33
  description: "Maximum number of sessions to return. Defaults to the newest 50 sessions.",
36
34
  }),
@@ -78,6 +76,28 @@ export const SessionsCursor = Schema.String.pipe(Schema.brand("SessionsCursor"),
78
76
  const SessionActive = Schema.Struct({
79
77
  type: Schema.Literal("running"),
80
78
  }).annotate({ identifier: "SessionActive" });
79
+ const PublicSessionInfo = Schema.Struct({
80
+ ...Struct.omit(Session.Info.fields, ["location"]),
81
+ location: Location.PublicRef,
82
+ }).annotate({ identifier: "Session.Info" });
83
+ const PublicSessionTransfer = Schema.Struct({
84
+ info: PublicSessionInfo,
85
+ messages: Schema.Array(PublicSessionMessage),
86
+ }).annotate({ identifier: "SessionTransfer.Data" });
87
+ const PublicMovePayload = Schema.Struct({
88
+ ...Struct.omit(SessionInbox.MovePayload.fields, ["location"]),
89
+ location: Location.PublicRef,
90
+ }).annotate({ identifier: "Session.Inbox.MovePayload" });
91
+ const PublicMove = Schema.Struct({
92
+ ...Struct.omit(SessionInbox.Move.fields, ["payload"]),
93
+ payload: PublicMovePayload,
94
+ }).annotate({ identifier: "Session.Inbox.Move" });
95
+ const PublicInboxInfo = Schema.Union([
96
+ SessionInbox.User,
97
+ SessionInbox.Synthetic,
98
+ SessionInbox.Compaction,
99
+ PublicMove,
100
+ ]).annotate({ identifier: "Session.Inbox.Info" });
81
101
  const BooleanFromString = Schema.Literals(["true", "false"]).pipe(Schema.decodeTo(Schema.Boolean, {
82
102
  decode: SchemaGetter.transform((value) => value === "true"),
83
103
  encode: SchemaGetter.transform((value) => (value ? "true" : "false")),
@@ -96,7 +116,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
96
116
  .add(HttpApiEndpoint.get("session.list", "/api/session", {
97
117
  query: SessionsQuery,
98
118
  success: Schema.Struct({
99
- data: Schema.Array(Session.Info),
119
+ data: Schema.Array(PublicSessionInfo),
100
120
  cursor: Schema.Struct({
101
121
  previous: SessionsCursor.pipe(Schema.optional),
102
122
  next: SessionsCursor.pipe(Schema.optional),
@@ -129,11 +149,11 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
129
149
  title: Schema.String.pipe(Schema.optional),
130
150
  agent: Agent.ID.pipe(Schema.optional),
131
151
  model: Model.Ref.pipe(Schema.optional),
132
- location: Location.Ref.pipe(Schema.optional),
152
+ location: Location.PublicRef.pipe(Schema.optional),
133
153
  metadata: Session.Metadata.pipe(Schema.optional),
134
154
  permissions: Permission.Ruleset.pipe(Schema.optional),
135
155
  }),
136
- success: Schema.Struct({ data: Session.Info }),
156
+ success: Schema.Struct({ data: PublicSessionInfo }),
137
157
  }).annotateMerge(OpenApi.annotations({
138
158
  identifier: "session.create",
139
159
  summary: "Create session",
@@ -141,10 +161,10 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
141
161
  })))
142
162
  .add(HttpApiEndpoint.post("session.import", "/api/session/import", {
143
163
  payload: Schema.Struct({
144
- ...SessionTransfer.Data.fields,
145
- location: Location.Ref.pipe(Schema.optional),
164
+ ...PublicSessionTransfer.fields,
165
+ location: Location.PublicRef.pipe(Schema.optional),
146
166
  }),
147
- success: Schema.Struct({ data: Session.Info }),
167
+ success: Schema.Struct({ data: PublicSessionInfo }),
148
168
  error: [ConflictError, SessionNotFoundError],
149
169
  }).annotateMerge(OpenApi.annotations({
150
170
  identifier: "session.import",
@@ -154,7 +174,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
154
174
  .add(HttpApiEndpoint.get("session.export", "/api/session/:sessionID/export", {
155
175
  params: { sessionID: Session.ID },
156
176
  query: Schema.Struct({ sanitize: BooleanFromString.pipe(Schema.optional) }),
157
- success: Schema.Struct({ data: SessionTransfer.Data }),
177
+ success: Schema.Struct({ data: PublicSessionTransfer }),
158
178
  error: [SessionNotFoundError, UnknownError],
159
179
  }).annotateMerge(OpenApi.annotations({
160
180
  identifier: "session.export",
@@ -170,7 +190,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
170
190
  })))
171
191
  .add(HttpApiEndpoint.get("session.get", "/api/session/:sessionID", {
172
192
  params: { sessionID: Session.ID },
173
- success: Schema.Struct({ data: Session.Info }),
193
+ success: Schema.Struct({ data: PublicSessionInfo }),
174
194
  error: SessionNotFoundError,
175
195
  }).annotateMerge(OpenApi.annotations({
176
196
  identifier: "session.get",
@@ -189,7 +209,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
189
209
  .add(HttpApiEndpoint.post("session.fork", "/api/session/:sessionID/fork", {
190
210
  params: { sessionID: Session.ID },
191
211
  payload: Schema.Struct({ boundary: Session.ForkRequestBoundary }),
192
- success: Schema.Struct({ data: Session.Info }),
212
+ success: Schema.Struct({ data: PublicSessionInfo }),
193
213
  error: [SessionNotFoundError, MessageNotFoundError, InvalidRequestError],
194
214
  })
195
215
  .middleware(sessionLocationMiddleware)
@@ -236,7 +256,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
236
256
  })))
237
257
  .add(HttpApiEndpoint.post("session.move", "/api/session/:sessionID/move", {
238
258
  params: { sessionID: Session.ID },
239
- payload: Schema.Struct({ ...Location.Ref.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }),
259
+ payload: Schema.Struct({ ...Location.PublicRef.fields, delivery: SessionInbox.Delivery.pipe(Schema.optional) }),
240
260
  success: HttpApiSchema.NoContent,
241
261
  error: [SessionNotFoundError, InvalidRequestError],
242
262
  }).annotateMerge(OpenApi.annotations({
@@ -382,7 +402,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
382
402
  .annotateMerge(OpenApi.annotations({ identifier: "session.revert.commit", summary: "Commit staged revert" })))
383
403
  .add(HttpApiEndpoint.get("session.context", "/api/session/:sessionID/context", {
384
404
  params: { sessionID: Session.ID },
385
- success: Schema.Struct({ data: Schema.Array(SessionMessage.Info) }),
405
+ success: Schema.Struct({ data: Schema.Array(PublicSessionMessage) }),
386
406
  error: [SessionNotFoundError, UnknownError],
387
407
  }).annotateMerge(OpenApi.annotations({
388
408
  identifier: "session.context",
@@ -411,7 +431,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
411
431
  })))
412
432
  .add(HttpApiEndpoint.get("session.inbox.list", "/api/session/:sessionID/inbox", {
413
433
  params: { sessionID: Session.ID },
414
- success: Schema.Struct({ data: Schema.Array(SessionInbox.Info) }),
434
+ success: Schema.Struct({ data: Schema.Array(PublicInboxInfo) }),
415
435
  error: SessionNotFoundError,
416
436
  }).annotateMerge(OpenApi.annotations({
417
437
  identifier: "session.inbox.list",
@@ -537,7 +557,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
537
557
  })))
538
558
  .add(HttpApiEndpoint.get("session.message", "/api/session/:sessionID/message/:messageID", {
539
559
  params: { sessionID: Session.ID, messageID: SessionMessage.ID },
540
- success: Schema.Struct({ data: SessionMessage.Info }),
560
+ success: Schema.Struct({ data: PublicSessionMessage }),
541
561
  error: [SessionNotFoundError, MessageNotFoundError],
542
562
  }).annotateMerge(OpenApi.annotations({
543
563
  identifier: "session.message",
@@ -1,14 +1,14 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
4
3
  import { ShellNotFoundError } from "../errors.js";
5
4
  export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpApiEndpoint.HttpApiEndpoint<"shell.list", "GET", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
6
5
  readonly location: Schema.optional<Schema.Struct<{
7
6
  readonly directory: Schema.optional<Schema.String>;
8
- readonly workspace: Schema.optional<Schema.String>;
9
7
  }>>;
10
8
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
11
- readonly location: typeof Location.Info;
9
+ readonly location: Schema.Struct<{
10
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
11
+ }>;
12
12
  readonly data: Schema.$Array<Schema.Struct<{
13
13
  readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
14
14
  create: () => string & import("effect/Brand").Brand<"Shell.ID">;
@@ -30,7 +30,6 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
30
30
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"shell.create", "POST", "/api/shell", never, Schema.toCodecStringTree<Schema.Struct<{
31
31
  readonly location: Schema.optional<Schema.Struct<{
32
32
  readonly directory: Schema.optional<Schema.String>;
33
- readonly workspace: Schema.optional<Schema.String>;
34
33
  }>>;
35
34
  }>>, Schema.toCodecJson<Schema.Struct<{
36
35
  readonly command: Schema.String;
@@ -38,7 +37,9 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
38
37
  readonly timeout: Schema.Int;
39
38
  readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
40
39
  }>>, never, Schema.toCodecJson<Schema.Struct<{
41
- readonly location: typeof Location.Info;
40
+ readonly location: Schema.Struct<{
41
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
42
+ }>;
42
43
  readonly data: Schema.Struct<{
43
44
  readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
44
45
  create: () => string & import("effect/Brand").Brand<"Shell.ID">;
@@ -65,10 +66,11 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
65
66
  }>>, Schema.toCodecStringTree<Schema.Struct<{
66
67
  readonly location: Schema.optional<Schema.Struct<{
67
68
  readonly directory: Schema.optional<Schema.String>;
68
- readonly workspace: Schema.optional<Schema.String>;
69
69
  }>>;
70
70
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
71
- readonly location: typeof Location.Info;
71
+ readonly location: Schema.Struct<{
72
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
73
+ }>;
72
74
  readonly data: Schema.Struct<{
73
75
  readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
74
76
  create: () => string & import("effect/Brand").Brand<"Shell.ID">;
@@ -95,12 +97,13 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
95
97
  }>>, Schema.toCodecStringTree<Schema.Struct<{
96
98
  readonly location: Schema.optional<Schema.Struct<{
97
99
  readonly directory: Schema.optional<Schema.String>;
98
- readonly workspace: Schema.optional<Schema.String>;
99
100
  }>>;
100
101
  }>>, Schema.toCodecJson<Schema.Struct<{
101
102
  readonly timeout: Schema.Int;
102
103
  }>>, never, Schema.toCodecJson<Schema.Struct<{
103
- readonly location: typeof Location.Info;
104
+ readonly location: Schema.Struct<{
105
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
106
+ }>;
104
107
  readonly data: Schema.Struct<{
105
108
  readonly id: Schema.brand<Schema.String, "Shell.ID"> & {
106
109
  create: () => string & import("effect/Brand").Brand<"Shell.ID">;
@@ -129,10 +132,11 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
129
132
  readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
130
133
  readonly location: Schema.optional<Schema.Struct<{
131
134
  readonly directory: Schema.optional<Schema.String>;
132
- readonly workspace: Schema.optional<Schema.String>;
133
135
  }>>;
134
136
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
135
- readonly location: typeof Location.Info;
137
+ readonly location: Schema.Struct<{
138
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
139
+ }>;
136
140
  readonly data: Schema.Struct<{
137
141
  readonly output: Schema.String;
138
142
  readonly cursor: Schema.Int;
@@ -147,6 +151,5 @@ export declare const ShellGroup: HttpApiGroup.HttpApiGroup<"server.shell", HttpA
147
151
  }>>, Schema.toCodecStringTree<Schema.Struct<{
148
152
  readonly location: Schema.optional<Schema.Struct<{
149
153
  readonly directory: Schema.optional<Schema.String>;
150
- readonly workspace: Schema.optional<Schema.String>;
151
154
  }>>;
152
155
  }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ShellNotFoundError>, never, never>, false>;
@@ -1,13 +1,13 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
3
  export declare const SkillGroup: HttpApiGroup.HttpApiGroup<"server.skill", HttpApiEndpoint.HttpApiEndpoint<"skill.list", "GET", "/api/skill", never, Schema.toCodecStringTree<Schema.Struct<{
5
4
  readonly location: Schema.optional<Schema.Struct<{
6
5
  readonly directory: Schema.optional<Schema.String>;
7
- readonly workspace: Schema.optional<Schema.String>;
8
6
  }>>;
9
7
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
10
- readonly location: typeof Location.Info;
8
+ readonly location: Schema.Struct<{
9
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
10
+ }>;
11
11
  readonly data: Schema.$Array<Schema.Struct<{
12
12
  readonly id: Schema.brand<Schema.String, "Skill.ID">;
13
13
  readonly name: Schema.brand<Schema.String, "Skill.Name">;
@@ -1,14 +1,14 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { Schema } from "effect";
3
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
3
  import { ServiceUnavailableError } from "../errors.js";
5
4
  export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEndpoint.HttpApiEndpoint<"vcs.get", "GET", "/api/vcs", never, Schema.toCodecStringTree<Schema.Struct<{
6
5
  readonly location: Schema.optional<Schema.Struct<{
7
6
  readonly directory: Schema.optional<Schema.String>;
8
- readonly workspace: Schema.optional<Schema.String>;
9
7
  }>>;
10
8
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
11
- readonly location: typeof Location.Info;
9
+ readonly location: Schema.Struct<{
10
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
11
+ }>;
12
12
  readonly data: Schema.Struct<{
13
13
  readonly branch: Schema.Struct<{
14
14
  readonly current: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -18,10 +18,11 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
18
18
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.base", "GET", "/api/vcs/base", never, Schema.toCodecStringTree<Schema.Struct<{
19
19
  readonly location: Schema.optional<Schema.Struct<{
20
20
  readonly directory: Schema.optional<Schema.String>;
21
- readonly workspace: Schema.optional<Schema.String>;
22
21
  }>>;
23
22
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
24
- readonly location: typeof Location.Info;
23
+ readonly location: Schema.Struct<{
24
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
25
+ }>;
25
26
  readonly data: Schema.NullOr<Schema.Struct<{
26
27
  readonly name: Schema.String;
27
28
  readonly ref: Schema.String;
@@ -30,10 +31,11 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
30
31
  }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.status", "GET", "/api/vcs/status", never, Schema.toCodecStringTree<Schema.Struct<{
31
32
  readonly location: Schema.optional<Schema.Struct<{
32
33
  readonly directory: Schema.optional<Schema.String>;
33
- readonly workspace: Schema.optional<Schema.String>;
34
34
  }>>;
35
35
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
36
- readonly location: typeof Location.Info;
36
+ readonly location: Schema.Struct<{
37
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
38
+ }>;
37
39
  readonly data: Schema.$Array<Schema.Struct<{
38
40
  readonly file: Schema.String;
39
41
  readonly additions: Schema.Int;
@@ -45,10 +47,11 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
45
47
  readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
46
48
  readonly location: Schema.optional<Schema.Struct<{
47
49
  readonly directory: Schema.optional<Schema.String>;
48
- readonly workspace: Schema.optional<Schema.String>;
49
50
  }>>;
50
51
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
51
- readonly location: typeof Location.Info;
52
+ readonly location: Schema.Struct<{
53
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
54
+ }>;
52
55
  readonly data: Schema.$Array<Schema.String>;
53
56
  }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"vcs.diff", "GET", "/api/vcs/diff", never, Schema.toCodecStringTree<Schema.Struct<{
54
57
  readonly mode: Schema.Literals<readonly ["working", "branch", "committed"]>;
@@ -56,10 +59,11 @@ export declare const VcsGroup: HttpApiGroup.HttpApiGroup<"server.vcs", HttpApiEn
56
59
  readonly context: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
57
60
  readonly location: Schema.optional<Schema.Struct<{
58
61
  readonly directory: Schema.optional<Schema.String>;
59
- readonly workspace: Schema.optional<Schema.String>;
60
62
  }>>;
61
63
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
62
- readonly location: typeof Location.Info;
64
+ readonly location: Schema.Struct<{
65
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
66
+ }>;
63
67
  readonly data: Schema.$Array<Schema.Struct<{
64
68
  readonly file: Schema.String;
65
69
  readonly patch: Schema.String;
@@ -1,4 +1,3 @@
1
- import { Location } from "@opencode/schema/location";
2
1
  import { WebSearch } from "@opencode/schema/websearch";
3
2
  import { Schema } from "effect";
4
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
@@ -6,10 +5,11 @@ import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
6
5
  export declare const WebSearchGroup: HttpApiGroup.HttpApiGroup<"server.websearch", HttpApiEndpoint.HttpApiEndpoint<"websearch.providers", "GET", "/api/websearch/provider", never, Schema.toCodecStringTree<Schema.Struct<{
7
6
  readonly location: Schema.optional<Schema.Struct<{
8
7
  readonly directory: Schema.optional<Schema.String>;
9
- readonly workspace: Schema.optional<Schema.String>;
10
8
  }>>;
11
9
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
12
- readonly location: typeof Location.Info;
10
+ readonly location: Schema.Struct<{
11
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12
+ }>;
13
13
  readonly data: Schema.$Array<Schema.Struct<{
14
14
  readonly id: Schema.brand<Schema.String, "WebSearch.ID">;
15
15
  readonly name: Schema.String;
@@ -17,12 +17,13 @@ export declare const WebSearchGroup: HttpApiGroup.HttpApiGroup<"server.websearch
17
17
  }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"websearch.query", "POST", "/api/websearch", never, Schema.toCodecStringTree<Schema.Struct<{
18
18
  readonly location: Schema.optional<Schema.Struct<{
19
19
  readonly directory: Schema.optional<Schema.String>;
20
- readonly workspace: Schema.optional<Schema.String>;
21
20
  }>>;
22
21
  }>>, Schema.toCodecJson<Schema.Struct<{
23
22
  readonly query: Schema.String;
24
23
  readonly providerID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WebSearch.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "WebSearch.ID">>, never, never>;
25
24
  }>>, never, Schema.toCodecJson<Schema.Struct<{
26
- readonly location: typeof Location.Info;
25
+ readonly location: Schema.Struct<{
26
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
27
+ }>;
27
28
  readonly data: typeof WebSearch.Response;
28
29
  }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never>, false>;
@@ -12,7 +12,6 @@ export declare class WorktreeError extends WorktreeError_base {
12
12
  export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree", HttpApiEndpoint.HttpApiEndpoint<"worktree.list", "GET", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
13
13
  readonly location: Schema.optional<Schema.Struct<{
14
14
  readonly directory: Schema.optional<Schema.String>;
15
- readonly workspace: Schema.optional<Schema.String>;
16
15
  }>>;
17
16
  }>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
18
17
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
@@ -20,7 +19,6 @@ export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree",
20
19
  }>>>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.create", "POST", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
21
20
  readonly location: Schema.optional<Schema.Struct<{
22
21
  readonly directory: Schema.optional<Schema.String>;
23
- readonly workspace: Schema.optional<Schema.String>;
24
22
  }>>;
25
23
  }>>, Schema.toCodecJson<Schema.Struct<{
26
24
  readonly strategy: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Trim, "Worktree.StrategyID">>>, Schema.optionalKey<Schema.brand<Schema.Trim, "Worktree.StrategyID">>, never, never>;
@@ -33,7 +31,6 @@ export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree",
33
31
  }>>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.remove", "DELETE", "/api/worktree", never, Schema.toCodecStringTree<Schema.Struct<{
34
32
  readonly location: Schema.optional<Schema.Struct<{
35
33
  readonly directory: Schema.optional<Schema.String>;
36
- readonly workspace: Schema.optional<Schema.String>;
37
34
  }>>;
38
35
  }>>, Schema.toCodecJson<Schema.Struct<{
39
36
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
@@ -41,7 +38,6 @@ export declare const WorktreeGroup: HttpApiGroup.HttpApiGroup<"server.worktree",
41
38
  }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof WorktreeError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"worktree.refresh", "POST", "/api/worktree/refresh", never, Schema.toCodecStringTree<Schema.Struct<{
42
39
  readonly location: Schema.optional<Schema.Struct<{
43
40
  readonly directory: Schema.optional<Schema.String>;
44
- readonly workspace: Schema.optional<Schema.String>;
45
41
  }>>;
46
42
  }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof WorktreeError>, never, never>, false>;
47
43
  export {};
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-19555",
4
+ "version": "0.0.0-dev-19559",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsgo --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@opencode/schema": "0.0.0-dev-19555",
35
+ "@opencode/schema": "0.0.0-dev-19559",
36
36
  "effect": "4.0.0-rc.112"
37
37
  },
38
38
  "devDependencies": {
@@ -1,22 +0,0 @@
1
- import { Schema } from "effect";
2
- import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
- import { ConflictError, ProviderNotFoundError, UnknownError } from "../errors.js";
4
- export declare const WorkspaceGroup: HttpApiGroup.HttpApiGroup<"server.workspace", HttpApiEndpoint.HttpApiEndpoint<"workspace.create", "POST", "/api/workspace", never, never, Schema.toCodecJson<Schema.Struct<{
5
- readonly id: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
6
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
7
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
8
- }>;
9
- readonly provider: Schema.String;
10
- }>>, never, Schema.toCodecJson<Schema.Struct<{
11
- readonly data: Schema.brand<Schema.String, "Workspace.ID"> & {
12
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
13
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
14
- };
15
- }>>, Schema.toCodecJson<typeof ConflictError | typeof ProviderNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"workspace.destroy", "DELETE", "/api/workspace/:workspaceID", Schema.toCodecStringTree<Schema.Struct<{
16
- workspaceID: Schema.brand<Schema.String, "Workspace.ID"> & {
17
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
18
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
19
- };
20
- }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
21
- readonly destroyed: Schema.Boolean;
22
- }>>, Schema.toCodecJson<typeof UnknownError>, never, never>, false>;
@@ -1,27 +0,0 @@
1
- import { Workspace } from "@opencode/schema/workspace";
2
- import { Schema } from "effect";
3
- import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
4
- import { ConflictError, ProviderNotFoundError, UnknownError } from "../errors.js";
5
- export const WorkspaceGroup = HttpApiGroup.make("server.workspace")
6
- .add(HttpApiEndpoint.post("workspace.create", "/api/workspace", {
7
- payload: Schema.Struct({
8
- id: Workspace.ID.pipe(Schema.optional),
9
- provider: Schema.String,
10
- }),
11
- success: Schema.Struct({ data: Workspace.ID }),
12
- error: [ConflictError, ProviderNotFoundError],
13
- }).annotateMerge(OpenApi.annotations({
14
- identifier: "workspace.create",
15
- summary: "Create workspace",
16
- description: "Create a logical workspace. A caller-supplied ID is idempotent when retried with the same provider; reusing it with another provider returns a conflict.",
17
- })))
18
- .add(HttpApiEndpoint.delete("workspace.destroy", "/api/workspace/:workspaceID", {
19
- params: { workspaceID: Workspace.ID },
20
- success: Workspace.DestroyResult,
21
- error: UnknownError,
22
- }).annotateMerge(OpenApi.annotations({
23
- identifier: "workspace.destroy",
24
- summary: "Destroy workspace",
25
- description: "Make a workspace not exist. This operation is idempotent: an already-missing workspace succeeds with `destroyed: false`, while a workspace removed by this request returns `destroyed: true`.",
26
- })))
27
- .annotateMerge(OpenApi.annotations({ title: "workspace", description: "Workspace lifecycle routes." }));