@opencode-ai/protocol 0.0.0-dev-18115 → 0.0.0-dev-18122

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/api.d.ts CHANGED
@@ -32,11 +32,12 @@ import { WorktreeGroup } from "./groups/worktree.js";
32
32
  import { VcsGroup } from "./groups/vcs.js";
33
33
  import { MigrationGroup } from "./groups/migration.js";
34
34
  import { ConfigGroup } from "./groups/config.js";
35
- type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.AddMiddleware<typeof LocationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof AgentGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PluginGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ModelGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof GenerateGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProviderGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof IntegrationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WebSearchGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof McpGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CredentialGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
35
+ import { WorkspaceGroup } from "./groups/workspace.js";
36
+ type LocationGroups<LocationId extends HttpApiMiddleware.AnyId> = HttpApiGroup.AddMiddleware<typeof LocationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof AgentGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PluginGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ModelGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProviderGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof IntegrationGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WebSearchGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof McpGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CredentialGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
36
37
  type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | typeof MessageGroup;
37
38
  type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
38
39
  type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
39
- type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof HealthGroup | typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof WorktreeGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
40
+ type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof HealthGroup | typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof WorktreeGroup | typeof WorkspaceGroup | typeof GenerateGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
40
41
  type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
41
42
  export type Api<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = HttpApi.HttpApi<"server", HttpApiGroup.AddMiddleware<HttpApiGroup.AddMiddleware<ApiGroups<LocationId, LocationService, FormLocationId, FormLocationService, SessionLocationId, SessionLocationService, Event>, Authorization>, SchemaErrorMiddleware>>;
42
43
  export declare const makeApi: <const Definitions extends ReadonlyArray<Definition>, LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(options: {
package/dist/api.js CHANGED
@@ -31,6 +31,7 @@ import { WorktreeGroup } from "./groups/worktree.js";
31
31
  import { VcsGroup } from "./groups/vcs.js";
32
32
  import { MigrationGroup } from "./groups/migration.js";
33
33
  import { ConfigGroup } from "./groups/config.js";
34
+ import { WorkspaceGroup } from "./groups/workspace.js";
34
35
  // Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
35
36
  const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
36
37
  .add(HealthGroup)
@@ -41,7 +42,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
41
42
  .add(makeSessionGroup(sessionLocationMiddleware))
42
43
  .add(MessageGroup)
43
44
  .add(ModelGroup.middleware(locationMiddleware))
44
- .add(GenerateGroup.middleware(locationMiddleware))
45
+ .add(GenerateGroup)
45
46
  .add(ProviderGroup.middleware(locationMiddleware))
46
47
  .add(IntegrationGroup.middleware(locationMiddleware))
47
48
  .add(McpGroup.middleware(locationMiddleware))
@@ -57,6 +58,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
57
58
  .add(ShellGroup.middleware(locationMiddleware))
58
59
  .add(ReferenceGroup.middleware(locationMiddleware))
59
60
  .add(WorktreeGroup)
61
+ .add(WorkspaceGroup)
60
62
  .add(VcsGroup.middleware(locationMiddleware))
61
63
  .add(DebugGroup)
62
64
  .add(MigrationGroup)
package/dist/client.d.ts CHANGED
@@ -53,6 +53,7 @@ export declare const groupNames: {
53
53
  readonly "server.reference": "reference";
54
54
  readonly "server.project": "project";
55
55
  readonly "server.worktree": "worktree";
56
+ readonly "server.workspace": "workspace";
56
57
  readonly "server.vcs": "vcs";
57
58
  readonly "server.config": "config";
58
59
  };
package/dist/client.js CHANGED
@@ -40,6 +40,7 @@ export const groupNames = {
40
40
  "server.reference": "reference",
41
41
  "server.project": "project",
42
42
  "server.worktree": "worktree",
43
+ "server.workspace": "workspace",
43
44
  "server.vcs": "vcs",
44
45
  "server.config": "config",
45
46
  };
@@ -7503,7 +7503,7 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
7503
7503
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
7504
7504
  readonly data: {
7505
7505
  readonly message: string;
7506
- readonly variant: "error" | "success" | "info" | "warning";
7506
+ readonly variant: "error" | "info" | "success" | "warning";
7507
7507
  readonly duration: number;
7508
7508
  readonly title?: string | undefined;
7509
7509
  };
@@ -1,12 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
3
  import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
4
- export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.text", "POST", "/api/generate", never, Schema.toCodecStringTree<Schema.Struct<{
5
- readonly location: Schema.optional<Schema.Struct<{
6
- readonly directory: Schema.optional<Schema.String>;
7
- readonly workspace: Schema.optional<Schema.String>;
8
- }>>;
9
- }>>, Schema.toCodecJson<Schema.Struct<{
4
+ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.text", "POST", "/api/generate", never, never, Schema.toCodecJson<Schema.Struct<{
10
5
  readonly prompt: Schema.String;
11
6
  readonly model: Schema.optional<Schema.Struct<{
12
7
  readonly id: Schema.brand<Schema.String, "Model.ID">;
@@ -2,10 +2,8 @@ import { Model } from "@opencode-ai/schema/model";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
4
4
  import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
5
- import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
5
  export const GenerateGroup = HttpApiGroup.make("server.generate")
7
6
  .add(HttpApiEndpoint.post("generate.text", "/api/generate", {
8
- query: LocationQuery,
9
7
  payload: Schema.Struct({
10
8
  prompt: Schema.String,
11
9
  model: Model.Ref.pipe(Schema.optional),
@@ -14,12 +12,10 @@ export const GenerateGroup = HttpApiGroup.make("server.generate")
14
12
  data: Schema.Struct({ text: Schema.String }),
15
13
  }).annotate({ identifier: "GenerateTextResponse" }),
16
14
  error: [InvalidRequestError, ServiceUnavailableError],
17
- })
18
- .annotateMerge(locationQueryOpenApi)
19
- .annotateMerge(OpenApi.annotations({
15
+ }).annotateMerge(OpenApi.annotations({
20
16
  identifier: "v2.generate.text",
21
17
  summary: "Generate text",
22
- description: "Run one stateless model generation at the requested location and return the assistant text. Uses the location's default model when none is specified.",
18
+ description: "Run one stateless model generation using the server's base configuration and return the assistant text. Uses the base configuration's default model when none is specified.",
23
19
  })))
24
20
  .annotateMerge(OpenApi.annotations({
25
21
  title: "generate",
@@ -7,16 +7,16 @@ import { ConflictError, CommandExecutionError, CommandNotFoundError, InvalidCurs
7
7
  import { SessionEvent } from "@opencode-ai/schema/session-event";
8
8
  declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
9
9
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
10
- readonly workspace: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
11
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
12
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
13
- }>;
14
10
  readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
15
11
  create: () => string & import("effect/Brand").Brand<"SessionID">;
16
12
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
17
13
  }, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
18
14
  readonly search: Schema.optional<Schema.String>;
19
15
  readonly order: Schema.optional<Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>>;
16
+ readonly workspace: Schema.optional<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
20
  readonly anchor: Schema.Struct<{
21
21
  readonly id: Schema.brand<Schema.String, "SessionID"> & {
22
22
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -29,10 +29,6 @@ declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
29
29
  readonly project: Schema.brand<Schema.String, "Project.ID"> & {
30
30
  global: string & import("effect/Brand").Brand<"Project.ID">;
31
31
  };
32
- readonly workspace: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
33
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
34
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
35
- }>;
36
32
  readonly subpath: Schema.optional<Schema.brand<Schema.String, "RelativePath">>;
37
33
  readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
38
34
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -40,6 +36,10 @@ declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
40
36
  }, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
41
37
  readonly search: Schema.optional<Schema.String>;
42
38
  readonly order: Schema.optional<Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>>;
39
+ readonly workspace: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
40
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
41
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
42
+ }>;
43
43
  readonly anchor: Schema.Struct<{
44
44
  readonly id: Schema.brand<Schema.String, "SessionID"> & {
45
45
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -49,16 +49,16 @@ declare const SessionsCursorInput: Schema.Union<readonly [Schema.Struct<{
49
49
  readonly direction: Schema.Literals<readonly ["previous", "next"]>;
50
50
  }>;
51
51
  }>, Schema.Struct<{
52
- readonly workspace: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
53
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
54
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
55
- }>;
56
52
  readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
57
53
  create: () => string & import("effect/Brand").Brand<"SessionID">;
58
54
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
59
55
  }, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
60
56
  readonly search: Schema.optional<Schema.String>;
61
57
  readonly order: Schema.optional<Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>>;
58
+ readonly workspace: Schema.optional<Schema.brand<Schema.String, "Workspace.ID"> & {
59
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
60
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
61
+ }>;
62
62
  readonly anchor: Schema.Struct<{
63
63
  readonly id: Schema.brand<Schema.String, "SessionID"> & {
64
64
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -77,10 +77,10 @@ export declare const SessionsCursor: Schema.brand<Schema.String, "SessionsCursor
77
77
  readonly time: number;
78
78
  readonly direction: "previous" | "next";
79
79
  };
80
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
81
80
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
82
81
  readonly search?: string | undefined;
83
82
  readonly order?: "asc" | "desc" | undefined;
83
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
84
84
  } | {
85
85
  readonly project: string & import("effect/Brand").Brand<"Project.ID">;
86
86
  readonly anchor: {
@@ -88,21 +88,21 @@ export declare const SessionsCursor: Schema.brand<Schema.String, "SessionsCursor
88
88
  readonly time: number;
89
89
  readonly direction: "previous" | "next";
90
90
  };
91
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
92
91
  readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
93
92
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
94
93
  readonly search?: string | undefined;
95
94
  readonly order?: "asc" | "desc" | undefined;
95
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
96
96
  } | {
97
97
  readonly anchor: {
98
98
  readonly id: string & import("effect/Brand").Brand<"SessionID">;
99
99
  readonly time: number;
100
100
  readonly direction: "previous" | "next";
101
101
  };
102
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
103
102
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
104
103
  readonly search?: string | undefined;
105
104
  readonly order?: "asc" | "desc" | undefined;
105
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
106
106
  }, "Invalid cursor", never>;
107
107
  };
108
108
  export type SessionsCursor = typeof SessionsCursor.Type;
@@ -326,10 +326,10 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
326
326
  readonly time: number;
327
327
  readonly direction: "previous" | "next";
328
328
  };
329
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
330
329
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
331
330
  readonly search?: string | undefined;
332
331
  readonly order?: "asc" | "desc" | undefined;
332
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
333
333
  } | {
334
334
  readonly project: string & import("effect/Brand").Brand<"Project.ID">;
335
335
  readonly anchor: {
@@ -337,21 +337,21 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
337
337
  readonly time: number;
338
338
  readonly direction: "previous" | "next";
339
339
  };
340
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
341
340
  readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
342
341
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
343
342
  readonly search?: string | undefined;
344
343
  readonly order?: "asc" | "desc" | undefined;
344
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
345
345
  } | {
346
346
  readonly anchor: {
347
347
  readonly id: string & import("effect/Brand").Brand<"SessionID">;
348
348
  readonly time: number;
349
349
  readonly direction: "previous" | "next";
350
350
  };
351
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
352
351
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
353
352
  readonly search?: string | undefined;
354
353
  readonly order?: "asc" | "desc" | undefined;
354
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
355
355
  }, "Invalid cursor", never>;
356
356
  }>;
357
357
  readonly next: Schema.optional<Schema.brand<Schema.String, "SessionsCursor"> & {
@@ -363,10 +363,10 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
363
363
  readonly time: number;
364
364
  readonly direction: "previous" | "next";
365
365
  };
366
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
367
366
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
368
367
  readonly search?: string | undefined;
369
368
  readonly order?: "asc" | "desc" | undefined;
369
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
370
370
  } | {
371
371
  readonly project: string & import("effect/Brand").Brand<"Project.ID">;
372
372
  readonly anchor: {
@@ -374,21 +374,21 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
374
374
  readonly time: number;
375
375
  readonly direction: "previous" | "next";
376
376
  };
377
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
378
377
  readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
379
378
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
380
379
  readonly search?: string | undefined;
381
380
  readonly order?: "asc" | "desc" | undefined;
381
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
382
382
  } | {
383
383
  readonly anchor: {
384
384
  readonly id: string & import("effect/Brand").Brand<"SessionID">;
385
385
  readonly time: number;
386
386
  readonly direction: "previous" | "next";
387
387
  };
388
- readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
389
388
  readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
390
389
  readonly search?: string | undefined;
391
390
  readonly order?: "asc" | "desc" | undefined;
391
+ readonly workspace?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
392
392
  }, "Invalid cursor", never>;
393
393
  }>;
394
394
  }>;
@@ -8713,7 +8713,9 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
8713
8713
  };
8714
8714
  }>>, Schema.toCodecStringTree<Schema.Struct<{
8715
8715
  continue: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
8716
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.background", "POST", "/api/session/:sessionID/background", Schema.toCodecStringTree<Schema.Struct<{
8716
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
8717
+ readonly interrupted: Schema.Boolean;
8718
+ }>>, Schema.toCodecJson<typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.background", "POST", "/api/session/:sessionID/background", Schema.toCodecStringTree<Schema.Struct<{
8717
8719
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
8718
8720
  create: () => string & import("effect/Brand").Brand<"SessionID">;
8719
8721
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -489,14 +489,18 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
489
489
  .add(HttpApiEndpoint.post("session.interrupt", "/api/session/:sessionID/interrupt", {
490
490
  params: { sessionID: Session.ID },
491
491
  query: { continue: BooleanFromString.pipe(Schema.optional) },
492
- success: HttpApiSchema.NoContent,
492
+ success: Schema.Struct({
493
+ interrupted: Schema.Boolean.annotate({
494
+ description: "Whether an active execution owned by this OpenCode process was interrupted.",
495
+ }),
496
+ }).annotate({ identifier: "SessionInterruptResponse" }),
493
497
  error: SessionNotFoundError,
494
498
  })
495
499
  .middleware(sessionLocationMiddleware)
496
500
  .annotateMerge(OpenApi.annotations({
497
501
  identifier: "v2.session.interrupt",
498
502
  summary: "Interrupt session execution",
499
- description: "Interrupt active execution owned by this OpenCode process. Idle interruption is a no-op. When continue=true, execution resumes pending steering input and next-in-line control items (manual compaction, moves) while queued prompts remain parked.",
503
+ description: "Interrupt active execution owned by this OpenCode process. Returns interrupted=true when an active execution was interrupted and false for the idle no-op. When continue=true, execution resumes pending steering input and next-in-line control items (manual compaction, moves) while queued prompts remain parked.",
500
504
  })))
501
505
  .add(HttpApiEndpoint.post("session.background", "/api/session/:sessionID/background", {
502
506
  params: { sessionID: Session.ID },
@@ -0,0 +1,10 @@
1
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
2
+ import { UnknownError } from "../errors.js";
3
+ export declare const WorkspaceGroup: HttpApiGroup.HttpApiGroup<"server.workspace", HttpApiEndpoint.HttpApiEndpoint<"workspace.destroy", "DELETE", "/api/workspace/:workspaceID", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
4
+ workspaceID: import("effect/Schema").brand<import("effect/Schema").String, "Workspace.ID"> & {
5
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
6
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
7
+ };
8
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
9
+ readonly destroyed: import("effect/Schema").Boolean;
10
+ }>>, import("effect/Schema").toCodecJson<typeof UnknownError>, never, never>, false>;
@@ -0,0 +1,14 @@
1
+ import { Workspace } from "@opencode-ai/schema/workspace";
2
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
+ import { UnknownError } from "../errors.js";
4
+ export const WorkspaceGroup = HttpApiGroup.make("server.workspace")
5
+ .add(HttpApiEndpoint.delete("workspace.destroy", "/api/workspace/:workspaceID", {
6
+ params: { workspaceID: Workspace.ID },
7
+ success: Workspace.DestroyResult,
8
+ error: UnknownError,
9
+ }).annotateMerge(OpenApi.annotations({
10
+ identifier: "v2.workspace.destroy",
11
+ summary: "Destroy workspace",
12
+ 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`.",
13
+ })))
14
+ .annotateMerge(OpenApi.annotations({ title: "workspace", description: "Workspace lifecycle routes." }));
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-dev-18115",
4
+ "version": "0.0.0-dev-18122",
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-ai/schema": "0.0.0-dev-18115",
35
+ "@opencode-ai/schema": "0.0.0-dev-18122",
36
36
  "effect": "4.0.0-rc.111"
37
37
  },
38
38
  "devDependencies": {