@opencode/protocol 0.0.0-dev-19575 → 0.0.0-dev-19578

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
@@ -33,11 +33,11 @@ import { WorktreeGroup } from "./groups/worktree.js";
33
33
  import { VcsGroup } from "./groups/vcs.js";
34
34
  import { MigrationGroup } from "./groups/migration.js";
35
35
  import { ConfigGroup } from "./groups/config.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 RpcGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WorktreeGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
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 ProjectGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof FileSystemGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof CommandGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof SkillGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof RpcGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof PtyGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ShellGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ReferenceGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof WorktreeGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
37
37
  type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | typeof MessageGroup;
38
38
  type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
39
39
  type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
40
- type ApiGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, Event extends HttpApiGroup.Constraint> = typeof ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof GenerateGroup | typeof PersistentPtyGroup | 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 ServerGroup | typeof DebugGroup | typeof MigrationGroup | typeof GenerateGroup | typeof PersistentPtyGroup | typeof CredentialGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService, FormLocationId, FormLocationService> | SessionGroups<SessionLocationId, SessionLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
41
41
  type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
42
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>>;
43
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
@@ -45,7 +45,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
45
45
  .add(ProviderGroup.middleware(locationMiddleware))
46
46
  .add(IntegrationGroup.middleware(locationMiddleware))
47
47
  .add(McpGroup.middleware(locationMiddleware))
48
- .add(CredentialGroup.middleware(locationMiddleware))
48
+ .add(CredentialGroup)
49
49
  .add(ProjectGroup.middleware(locationMiddleware))
50
50
  .add(makeFormGroup(locationMiddleware, formLocationMiddleware))
51
51
  .add(makePermissionGroup(locationMiddleware, sessionLocationMiddleware))
package/dist/errors.d.ts CHANGED
@@ -61,6 +61,20 @@ declare const IntegrationNotFoundError_base: Schema.Class<IntegrationNotFoundErr
61
61
  }>, import("effect/Cause").YieldableError>;
62
62
  export declare class IntegrationNotFoundError extends IntegrationNotFoundError_base {
63
63
  }
64
+ declare const IntegrationAttemptNotFoundError_base: Schema.Class<IntegrationAttemptNotFoundError, Schema.TaggedStruct<"IntegrationAttemptNotFoundError", {
65
+ readonly integrationID: Schema.String;
66
+ readonly attemptID: Schema.String;
67
+ readonly message: Schema.String;
68
+ }>, import("effect/Cause").YieldableError>;
69
+ export declare class IntegrationAttemptNotFoundError extends IntegrationAttemptNotFoundError_base {
70
+ }
71
+ declare const IntegrationMethodNotFoundError_base: Schema.Class<IntegrationMethodNotFoundError, Schema.TaggedStruct<"IntegrationMethodNotFoundError", {
72
+ readonly integrationID: Schema.String;
73
+ readonly methodID: Schema.String;
74
+ readonly message: Schema.String;
75
+ }>, import("effect/Cause").YieldableError>;
76
+ export declare class IntegrationMethodNotFoundError extends IntegrationMethodNotFoundError_base {
77
+ }
64
78
  declare const ProjectNotFoundError_base: Schema.Class<ProjectNotFoundError, Schema.TaggedStruct<"ProjectNotFoundError", {
65
79
  readonly projectID: Schema.String;
66
80
  readonly message: Schema.String;
package/dist/errors.js CHANGED
@@ -50,6 +50,18 @@ export class IntegrationNotFoundError extends Schema.TaggedError()("IntegrationN
50
50
  message: Schema.String,
51
51
  }, { httpApiStatus: 404 }) {
52
52
  }
53
+ export class IntegrationAttemptNotFoundError extends Schema.TaggedError()("IntegrationAttemptNotFoundError", {
54
+ integrationID: Schema.String,
55
+ attemptID: Schema.String,
56
+ message: Schema.String,
57
+ }, { httpApiStatus: 404 }) {
58
+ }
59
+ export class IntegrationMethodNotFoundError extends Schema.TaggedError()("IntegrationMethodNotFoundError", {
60
+ integrationID: Schema.String,
61
+ methodID: Schema.String,
62
+ message: Schema.String,
63
+ }, { httpApiStatus: 404 }) {
64
+ }
53
65
  export class ProjectNotFoundError extends Schema.TaggedError()("ProjectNotFoundError", {
54
66
  projectID: Schema.String,
55
67
  message: Schema.String,
@@ -4,26 +4,14 @@ export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credenti
4
4
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
5
5
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
6
6
  };
7
- }>>, Schema.toCodecStringTree<Schema.Struct<{
8
- readonly location: Schema.optional<Schema.Struct<{
9
- readonly directory: Schema.optional<Schema.String>;
10
- }>>;
11
- }>>, Schema.toCodecJson<Schema.Struct<{
7
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
12
8
  readonly label: Schema.String;
13
9
  }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.activate", "POST", "/api/credential/:credentialID/activate", Schema.toCodecStringTree<Schema.Struct<{
14
10
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
15
11
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
16
12
  };
17
- }>>, Schema.toCodecStringTree<Schema.Struct<{
18
- readonly location: Schema.optional<Schema.Struct<{
19
- readonly directory: Schema.optional<Schema.String>;
20
- }>>;
21
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.remove", "DELETE", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
13
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.remove", "DELETE", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
22
14
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
23
15
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
24
16
  };
25
- }>>, Schema.toCodecStringTree<Schema.Struct<{
26
- readonly location: Schema.optional<Schema.Struct<{
27
- readonly directory: Schema.optional<Schema.String>;
28
- }>>;
29
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
17
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -1,15 +1,12 @@
1
1
  import { Credential } from "@opencode/schema/credential";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
4
- import { LocationQuery, locationQueryOpenApi } from "./location.js";
5
4
  export const CredentialGroup = HttpApiGroup.make("server.credential")
6
5
  .add(HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", {
7
6
  params: { credentialID: Credential.ID },
8
- query: LocationQuery,
9
7
  payload: Schema.Struct({ label: Schema.String }),
10
8
  success: HttpApiSchema.NoContent,
11
9
  })
12
- .annotateMerge(locationQueryOpenApi)
13
10
  .annotateMerge(OpenApi.annotations({
14
11
  identifier: "credential.update",
15
12
  summary: "Update credential",
@@ -18,10 +15,8 @@ export const CredentialGroup = HttpApiGroup.make("server.credential")
18
15
  .annotateMerge(OpenApi.annotations({ title: "credential" }))
19
16
  .add(HttpApiEndpoint.post("credential.activate", "/api/credential/:credentialID/activate", {
20
17
  params: { credentialID: Credential.ID },
21
- query: LocationQuery,
22
18
  success: HttpApiSchema.NoContent,
23
19
  })
24
- .annotateMerge(locationQueryOpenApi)
25
20
  .annotateMerge(OpenApi.annotations({
26
21
  identifier: "credential.activate",
27
22
  summary: "Activate credential",
@@ -29,10 +24,8 @@ export const CredentialGroup = HttpApiGroup.make("server.credential")
29
24
  })))
30
25
  .add(HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", {
31
26
  params: { credentialID: Credential.ID },
32
- query: LocationQuery,
33
27
  success: HttpApiSchema.NoContent,
34
28
  })
35
- .annotateMerge(locationQueryOpenApi)
36
29
  .annotateMerge(OpenApi.annotations({
37
30
  identifier: "credential.remove",
38
31
  summary: "Remove credential",
@@ -1,7 +1,7 @@
1
1
  import { Integration } from "@opencode/schema/integration";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
4
- import { IntegrationNotFoundError, InvalidRequestError } from "../errors.js";
4
+ import { IntegrationAttemptNotFoundError, IntegrationMethodNotFoundError, IntegrationNotFoundError, InvalidRequestError } from "../errors.js";
5
5
  export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integration", HttpApiEndpoint.HttpApiEndpoint<"integration.list", "GET", "/api/integration", never, Schema.toCodecStringTree<Schema.Struct<{
6
6
  readonly location: Schema.optional<Schema.Struct<{
7
7
  readonly directory: Schema.optional<Schema.String>;
@@ -1006,7 +1006,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
1006
1006
  readonly key: Schema.String;
1007
1007
  readonly answer: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>;
1008
1008
  readonly label: Schema.optional<Schema.String>;
1009
- }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.connect", "POST", "/api/integration/:integrationID/connect/oauth", Schema.toCodecStringTree<Schema.Struct<{
1009
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof IntegrationNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.connect", "POST", "/api/integration/:integrationID/connect/oauth", Schema.toCodecStringTree<Schema.Struct<{
1010
1010
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
1011
1011
  }>>, Schema.toCodecStringTree<Schema.Struct<{
1012
1012
  readonly location: Schema.optional<Schema.Struct<{
@@ -1060,7 +1060,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
1060
1060
  readonly expires: Schema.Number;
1061
1061
  }>;
1062
1062
  }>]>;
1063
- }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.complete", "POST", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", Schema.toCodecStringTree<Schema.Struct<{
1063
+ }>>, Schema.toCodecJson<typeof IntegrationNotFoundError | typeof IntegrationAttemptNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.complete", "POST", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", Schema.toCodecStringTree<Schema.Struct<{
1064
1064
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
1065
1065
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
1066
1066
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
@@ -1071,7 +1071,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
1071
1071
  }>>;
1072
1072
  }>>, Schema.toCodecJson<Schema.Struct<{
1073
1073
  readonly code: Schema.optional<Schema.String>;
1074
- }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.cancel", "DELETE", "/api/integration/:integrationID/connect/oauth/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1074
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof InvalidRequestError | typeof IntegrationNotFoundError | typeof IntegrationAttemptNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.cancel", "DELETE", "/api/integration/:integrationID/connect/oauth/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1075
1075
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
1076
1076
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
1077
1077
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
@@ -1102,7 +1102,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
1102
1102
  readonly expires: Schema.Number;
1103
1103
  }>;
1104
1104
  }>;
1105
- }>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.status", "GET", "/api/integration/:integrationID/connect/command/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1105
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof IntegrationNotFoundError | typeof IntegrationMethodNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.status", "GET", "/api/integration/:integrationID/connect/command/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1106
1106
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
1107
1107
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
1108
1108
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
@@ -1142,7 +1142,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
1142
1142
  readonly expires: Schema.Number;
1143
1143
  }>;
1144
1144
  }>]>;
1145
- }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.cancel", "DELETE", "/api/integration/:integrationID/connect/command/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1145
+ }>>, Schema.toCodecJson<typeof IntegrationNotFoundError | typeof IntegrationAttemptNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.cancel", "DELETE", "/api/integration/:integrationID/connect/command/:attemptID", Schema.toCodecStringTree<Schema.Struct<{
1146
1146
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
1147
1147
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
1148
1148
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
@@ -3,7 +3,7 @@ import { Location } from "@opencode/schema/location";
3
3
  import { Form } from "@opencode/schema/form";
4
4
  import { Schema } from "effect";
5
5
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
6
- import { IntegrationNotFoundError, InvalidRequestError } from "../errors.js";
6
+ import { IntegrationAttemptNotFoundError, IntegrationMethodNotFoundError, IntegrationNotFoundError, InvalidRequestError, } from "../errors.js";
7
7
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
8
8
  export const IntegrationGroup = HttpApiGroup.make("server.integration")
9
9
  .add(HttpApiEndpoint.get("integration.list", "/api/integration", {
@@ -49,7 +49,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
49
49
  label: Schema.optional(Schema.String),
50
50
  }),
51
51
  success: HttpApiSchema.NoContent,
52
- error: InvalidRequestError,
52
+ error: [IntegrationNotFoundError, InvalidRequestError],
53
53
  })
54
54
  .annotateMerge(locationQueryOpenApi)
55
55
  .annotateMerge(OpenApi.annotations({
@@ -78,6 +78,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
78
78
  params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
79
79
  query: LocationQuery,
80
80
  success: Location.response(Integration.AttemptStatus),
81
+ error: [IntegrationNotFoundError, IntegrationAttemptNotFoundError],
81
82
  })
82
83
  .annotateMerge(locationQueryOpenApi)
83
84
  .annotateMerge(OpenApi.annotations({
@@ -90,7 +91,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
90
91
  query: LocationQuery,
91
92
  payload: Schema.Struct({ code: Schema.optional(Schema.String) }),
92
93
  success: HttpApiSchema.NoContent,
93
- error: InvalidRequestError,
94
+ error: [IntegrationNotFoundError, IntegrationAttemptNotFoundError, InvalidRequestError],
94
95
  })
95
96
  .annotateMerge(locationQueryOpenApi)
96
97
  .annotateMerge(OpenApi.annotations({
@@ -117,7 +118,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
117
118
  label: Schema.optional(Schema.String),
118
119
  }),
119
120
  success: Location.response(Integration.CommandAttempt),
120
- error: InvalidRequestError,
121
+ error: [IntegrationNotFoundError, IntegrationMethodNotFoundError, InvalidRequestError],
121
122
  })
122
123
  .annotateMerge(locationQueryOpenApi)
123
124
  .annotateMerge(OpenApi.annotations({
@@ -129,6 +130,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
129
130
  params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
130
131
  query: LocationQuery,
131
132
  success: Location.response(Integration.CommandAttemptStatus),
133
+ error: [IntegrationNotFoundError, IntegrationAttemptNotFoundError],
132
134
  })
133
135
  .annotateMerge(locationQueryOpenApi)
134
136
  .annotateMerge(OpenApi.annotations({
@@ -26,7 +26,7 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"server.mcp", HttpApiEn
26
26
  }>]>;
27
27
  readonly integrationID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Integration.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Integration.ID">>, never, never>;
28
28
  }>>;
29
- }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.add", "PUT", "/api/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
29
+ }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.add", "PUT", "/api/experimental/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
30
30
  server: Schema.String;
31
31
  }>>, Schema.toCodecStringTree<Schema.Struct<{
32
32
  readonly location: Schema.optional<Schema.Struct<{
@@ -34,19 +34,19 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"server.mcp", HttpApiEn
34
34
  }>>;
35
35
  }>>, Schema.toCodecJson<Schema.Struct<{
36
36
  readonly config: Schema.toTaggedUnion<"type", readonly [typeof Mcp.LocalConfig, typeof Mcp.RemoteConfig]>;
37
- }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.remove", "DELETE", "/api/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
37
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.remove", "DELETE", "/api/experimental/mcp/:server", Schema.toCodecStringTree<Schema.Struct<{
38
38
  server: Schema.String;
39
39
  }>>, Schema.toCodecStringTree<Schema.Struct<{
40
40
  readonly location: Schema.optional<Schema.Struct<{
41
41
  readonly directory: Schema.optional<Schema.String>;
42
42
  }>>;
43
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.connect", "POST", "/api/mcp/:server/connect", Schema.toCodecStringTree<Schema.Struct<{
43
+ }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.connect", "POST", "/api/experimental/mcp/:server/connect", Schema.toCodecStringTree<Schema.Struct<{
44
44
  server: Schema.String;
45
45
  }>>, Schema.toCodecStringTree<Schema.Struct<{
46
46
  readonly location: Schema.optional<Schema.Struct<{
47
47
  readonly directory: Schema.optional<Schema.String>;
48
48
  }>>;
49
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.disconnect", "POST", "/api/mcp/:server/disconnect", Schema.toCodecStringTree<Schema.Struct<{
49
+ }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof McpServerNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mcp.disconnect", "POST", "/api/experimental/mcp/:server/disconnect", Schema.toCodecStringTree<Schema.Struct<{
50
50
  server: Schema.String;
51
51
  }>>, Schema.toCodecStringTree<Schema.Struct<{
52
52
  readonly location: Schema.optional<Schema.Struct<{
@@ -15,7 +15,7 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
15
15
  summary: "List MCP servers",
16
16
  description: "Retrieve configured MCP servers and their connection status.",
17
17
  })))
18
- .add(HttpApiEndpoint.put("mcp.add", "/api/mcp/:server", {
18
+ .add(HttpApiEndpoint.put("mcp.add", "/api/experimental/mcp/:server", {
19
19
  params: { server: Schema.String },
20
20
  query: LocationQuery,
21
21
  // Wrapped in a struct because the client codegen flattens payload fields and cannot
@@ -25,11 +25,11 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
25
25
  })
26
26
  .annotateMerge(locationQueryOpenApi)
27
27
  .annotateMerge(OpenApi.annotations({
28
- identifier: "mcp.add",
28
+ identifier: "experimental.mcp.add",
29
29
  summary: "Add MCP server",
30
30
  description: "Add an MCP server at runtime or replace an existing one, connecting it immediately.",
31
31
  })))
32
- .add(HttpApiEndpoint.delete("mcp.remove", "/api/mcp/:server", {
32
+ .add(HttpApiEndpoint.delete("mcp.remove", "/api/experimental/mcp/:server", {
33
33
  params: { server: Schema.String },
34
34
  query: LocationQuery,
35
35
  success: HttpApiSchema.NoContent,
@@ -37,11 +37,11 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
37
37
  })
38
38
  .annotateMerge(locationQueryOpenApi)
39
39
  .annotateMerge(OpenApi.annotations({
40
- identifier: "mcp.remove",
40
+ identifier: "experimental.mcp.remove",
41
41
  summary: "Remove MCP server",
42
42
  description: "Stop an MCP server and remove it from the runtime set until restart.",
43
43
  })))
44
- .add(HttpApiEndpoint.post("mcp.connect", "/api/mcp/:server/connect", {
44
+ .add(HttpApiEndpoint.post("mcp.connect", "/api/experimental/mcp/:server/connect", {
45
45
  params: { server: Schema.String },
46
46
  query: LocationQuery,
47
47
  success: HttpApiSchema.NoContent,
@@ -49,11 +49,11 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
49
49
  })
50
50
  .annotateMerge(locationQueryOpenApi)
51
51
  .annotateMerge(OpenApi.annotations({
52
- identifier: "mcp.connect",
52
+ identifier: "experimental.mcp.connect",
53
53
  summary: "Connect MCP server",
54
54
  description: "Connect an MCP server at runtime, overriding a disabled configuration until restart.",
55
55
  })))
56
- .add(HttpApiEndpoint.post("mcp.disconnect", "/api/mcp/:server/disconnect", {
56
+ .add(HttpApiEndpoint.post("mcp.disconnect", "/api/experimental/mcp/:server/disconnect", {
57
57
  params: { server: Schema.String },
58
58
  query: LocationQuery,
59
59
  success: HttpApiSchema.NoContent,
@@ -61,7 +61,7 @@ export const McpGroup = HttpApiGroup.make("server.mcp")
61
61
  })
62
62
  .annotateMerge(locationQueryOpenApi)
63
63
  .annotateMerge(OpenApi.annotations({
64
- identifier: "mcp.disconnect",
64
+ identifier: "experimental.mcp.disconnect",
65
65
  summary: "Disconnect MCP server",
66
66
  description: "Disconnect an MCP server at runtime, removing its tools until reconnected.",
67
67
  })))
@@ -366,7 +366,7 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
366
366
  }, "Invalid cursor", never>;
367
367
  }>;
368
368
  }>;
369
- }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof InvalidCursorError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.stats", "GET", "/api/session/stats", never, Schema.toCodecStringTree<Schema.Struct<{
369
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof InvalidCursorError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.stats", "GET", "/api/experimental/session/stats", never, Schema.toCodecStringTree<Schema.Struct<{
370
370
  readonly from: Schema.optional<Schema.NumberFromString>;
371
371
  readonly to: Schema.optional<Schema.NumberFromString>;
372
372
  readonly project: Schema.optional<Schema.brand<Schema.String, "Project.ID"> & {
@@ -2800,15 +2800,10 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S>(se
2800
2800
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
2801
2801
  };
2802
2802
  }>>, never, Schema.toCodecJson<Schema.Struct<{
2803
- readonly boundary: Schema.Union<readonly [Schema.Struct<{
2804
- readonly type: Schema.Literal<"before">;
2805
- readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
2806
- create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2807
- fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2808
- };
2809
- }>, Schema.Struct<{
2810
- readonly type: Schema.Literal<"through">;
2811
- }>]>;
2803
+ readonly before: Schema.optional<Schema.brand<Schema.String, "Session.Message.ID"> & {
2804
+ create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2805
+ fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
2806
+ }>;
2812
2807
  }>>, never, Schema.toCodecJson<Schema.Struct<{
2813
2808
  readonly data: Schema.Struct<{
2814
2809
  readonly location: Schema.Struct<{
@@ -128,7 +128,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
128
128
  summary: "List sessions",
129
129
  description: "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
130
130
  })))
131
- .add(HttpApiEndpoint.get("session.stats", "/api/session/stats", {
131
+ .add(HttpApiEndpoint.get("session.stats", "/api/experimental/session/stats", {
132
132
  query: Schema.Struct({
133
133
  from: Schema.NumberFromString.pipe(Schema.optional),
134
134
  to: Schema.NumberFromString.pipe(Schema.optional),
@@ -139,7 +139,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
139
139
  success: Schema.Struct({ data: SessionStats.Info }),
140
140
  error: InvalidRequestError,
141
141
  }).annotateMerge(OpenApi.annotations({
142
- identifier: "session.stats",
142
+ identifier: "experimental.session.stats",
143
143
  summary: "Get session statistics",
144
144
  description: "Aggregate local session activity, usage, and tool reliability for a time range.",
145
145
  })))
@@ -208,7 +208,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
208
208
  })))
209
209
  .add(HttpApiEndpoint.post("session.fork", "/api/session/:sessionID/fork", {
210
210
  params: { sessionID: Session.ID },
211
- payload: Schema.Struct({ boundary: Session.ForkRequestBoundary }),
211
+ payload: Schema.Struct({ before: SessionMessage.ID.pipe(Schema.optional) }),
212
212
  success: Schema.Struct({ data: PublicSessionInfo }),
213
213
  error: [SessionNotFoundError, MessageNotFoundError, InvalidRequestError],
214
214
  })
@@ -216,7 +216,7 @@ export const makeSessionGroup = (sessionLocationMiddleware) => HttpApiGroup.make
216
216
  .annotateMerge(OpenApi.annotations({
217
217
  identifier: "session.fork",
218
218
  summary: "Fork session",
219
- description: "Create a child session by copying projected history through or before a message boundary.",
219
+ description: "Create a child session by copying projected history before a message. Omit before to copy the full history.",
220
220
  })))
221
221
  .add(HttpApiEndpoint.post("session.switchAgent", "/api/session/:sessionID/agent", {
222
222
  params: { sessionID: Session.ID },
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-19575",
4
+ "version": "0.0.0-dev-19578",
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-19575",
35
+ "@opencode/schema": "0.0.0-dev-19578",
36
36
  "effect": "4.0.0-rc.112"
37
37
  },
38
38
  "devDependencies": {