@opencode/protocol 2.0.2 → 2.0.4

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.
Files changed (69) hide show
  1. package/dist/api.d.ts +4 -6
  2. package/dist/api.js +4 -8
  3. package/dist/client.d.ts +0 -2
  4. package/dist/client.js +0 -2
  5. package/dist/errors.d.ts +20 -0
  6. package/dist/errors.js +17 -0
  7. package/dist/groups/agent.d.ts +6 -5
  8. package/dist/groups/agent.js +2 -2
  9. package/dist/groups/command.d.ts +3 -3
  10. package/dist/groups/command.js +1 -1
  11. package/dist/groups/config.d.ts +5 -13
  12. package/dist/groups/config.js +11 -18
  13. package/dist/groups/credential.d.ts +3 -18
  14. package/dist/groups/credential.js +3 -10
  15. package/dist/groups/debug.d.ts +0 -8
  16. package/dist/groups/debug.js +3 -3
  17. package/dist/groups/event.d.ts +99 -74
  18. package/dist/groups/event.js +3 -3
  19. package/dist/groups/form.d.ts +6 -654
  20. package/dist/groups/form.js +6 -83
  21. package/dist/groups/fs.d.ts +6 -6
  22. package/dist/groups/fs.js +3 -3
  23. package/dist/groups/generate.d.ts +1 -1
  24. package/dist/groups/generate.js +2 -2
  25. package/dist/groups/integration.d.ts +27 -27
  26. package/dist/groups/integration.js +19 -16
  27. package/dist/groups/location.d.ts +10 -4
  28. package/dist/groups/location.js +2 -3
  29. package/dist/groups/mcp.d.ts +11 -13
  30. package/dist/groups/mcp.js +10 -10
  31. package/dist/groups/message.d.ts +710 -41
  32. package/dist/groups/message.js +26 -3
  33. package/dist/groups/migration.js +1 -1
  34. package/dist/groups/model.d.ts +12 -9
  35. package/dist/groups/model.js +2 -2
  36. package/dist/groups/permission.d.ts +9 -16
  37. package/dist/groups/permission.js +8 -20
  38. package/dist/groups/persistent-pty.js +1 -1
  39. package/dist/groups/plugin.d.ts +7 -12
  40. package/dist/groups/plugin.js +3 -13
  41. package/dist/groups/project.d.ts +1 -14
  42. package/dist/groups/project.js +2 -13
  43. package/dist/groups/provider.d.ts +8 -7
  44. package/dist/groups/provider.js +2 -2
  45. package/dist/groups/pty.d.ts +15 -12
  46. package/dist/groups/pty.js +8 -8
  47. package/dist/groups/reference.d.ts +8 -12
  48. package/dist/groups/reference.js +16 -3
  49. package/dist/groups/rpc.d.ts +0 -1
  50. package/dist/groups/rpc.js +1 -1
  51. package/dist/groups/server.d.ts +9 -1
  52. package/dist/groups/server.js +11 -5
  53. package/dist/groups/session.d.ts +1146 -787
  54. package/dist/groups/session.js +192 -93
  55. package/dist/groups/shell.d.ts +13 -43
  56. package/dist/groups/shell.js +6 -24
  57. package/dist/groups/skill.d.ts +4 -5
  58. package/dist/groups/skill.js +1 -1
  59. package/dist/groups/vcs.d.ts +17 -12
  60. package/dist/groups/vcs.js +6 -6
  61. package/dist/groups/websearch.d.ts +6 -5
  62. package/dist/groups/websearch.js +2 -2
  63. package/dist/groups/worktree.d.ts +17 -23
  64. package/dist/groups/worktree.js +21 -30
  65. package/package.json +2 -2
  66. package/dist/groups/health.d.ts +0 -15
  67. package/dist/groups/health.js +0 -20
  68. package/dist/groups/workspace.d.ts +0 -22
  69. package/dist/groups/workspace.js +0 -27
package/dist/api.d.ts CHANGED
@@ -16,7 +16,6 @@ import { EventGroup, makeEventGroup } from "./groups/event.js";
16
16
  import type { Definition } from "@opencode/schema/event";
17
17
  import { AgentGroup } from "./groups/agent.js";
18
18
  import { PluginGroup } from "./groups/plugin.js";
19
- import { HealthGroup } from "./groups/health.js";
20
19
  import { ServerGroup } from "./groups/server.js";
21
20
  import { DebugGroup } from "./groups/debug.js";
22
21
  import { PtyGroup } from "./groups/pty.js";
@@ -34,12 +33,11 @@ import { WorktreeGroup } from "./groups/worktree.js";
34
33
  import { VcsGroup } from "./groups/vcs.js";
35
34
  import { MigrationGroup } from "./groups/migration.js";
36
35
  import { ConfigGroup } from "./groups/config.js";
37
- import { WorkspaceGroup } from "./groups/workspace.js";
38
- 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>;
39
- type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService>> | typeof MessageGroup;
40
- type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService, FormLocationId, FormLocationService>>;
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 VcsGroup, LocationId> | HttpApiGroup.AddMiddleware<typeof ConfigGroup, LocationId>;
37
+ type SessionGroups<SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService, FormLocationId extends HttpApiMiddleware.AnyId, FormLocationService> = ReturnType<typeof makeSessionGroup<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService>> | typeof MessageGroup;
38
+ type FormGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService> = ReturnType<typeof makeFormGroup<LocationId, LocationService>>;
41
39
  type MixedMiddlewareGroups<LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService> = ReturnType<typeof makePermissionGroup<LocationId, LocationService, SessionLocationId, SessionLocationService>>;
42
- 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 WorkspaceGroup | 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 WorktreeGroup | typeof GenerateGroup | typeof PersistentPtyGroup | typeof CredentialGroup | LocationGroups<LocationId> | FormGroups<LocationId, LocationService> | SessionGroups<SessionLocationId, SessionLocationService, FormLocationId, FormLocationService> | MixedMiddlewareGroups<LocationId, LocationService, SessionLocationId, SessionLocationService> | Event;
43
41
  type EventGroupFor<Definitions extends ReadonlyArray<Definition>> = ReturnType<typeof makeEventGroup<Definitions>>;
44
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>>;
45
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
@@ -15,7 +15,6 @@ import { RpcGroup } from "./groups/rpc.js";
15
15
  import { EventGroup, makeEventGroup } from "./groups/event.js";
16
16
  import { AgentGroup } from "./groups/agent.js";
17
17
  import { PluginGroup } from "./groups/plugin.js";
18
- import { HealthGroup } from "./groups/health.js";
19
18
  import { ServerGroup } from "./groups/server.js";
20
19
  import { DebugGroup } from "./groups/debug.js";
21
20
  import { PtyGroup } from "./groups/pty.js";
@@ -33,24 +32,22 @@ import { WorktreeGroup } from "./groups/worktree.js";
33
32
  import { VcsGroup } from "./groups/vcs.js";
34
33
  import { MigrationGroup } from "./groups/migration.js";
35
34
  import { ConfigGroup } from "./groups/config.js";
36
- import { WorkspaceGroup } from "./groups/workspace.js";
37
35
  // Protocol owns middleware placement, while Server injects concrete keys so Core service identities stay downstream.
38
36
  const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware, sessionLocationMiddleware) => HttpApi.make("server")
39
- .add(HealthGroup)
40
37
  .add(ServerGroup)
41
38
  .add(LocationGroup.middleware(locationMiddleware))
42
39
  .add(AgentGroup.middleware(locationMiddleware))
43
40
  .add(PluginGroup.middleware(locationMiddleware))
44
- .add(makeSessionGroup(sessionLocationMiddleware))
41
+ .add(makeSessionGroup(sessionLocationMiddleware, formLocationMiddleware))
45
42
  .add(MessageGroup)
46
43
  .add(ModelGroup.middleware(locationMiddleware))
47
44
  .add(GenerateGroup)
48
45
  .add(ProviderGroup.middleware(locationMiddleware))
49
46
  .add(IntegrationGroup.middleware(locationMiddleware))
50
47
  .add(McpGroup.middleware(locationMiddleware))
51
- .add(CredentialGroup.middleware(locationMiddleware))
48
+ .add(CredentialGroup)
52
49
  .add(ProjectGroup.middleware(locationMiddleware))
53
- .add(makeFormGroup(locationMiddleware, formLocationMiddleware))
50
+ .add(makeFormGroup(locationMiddleware))
54
51
  .add(makePermissionGroup(locationMiddleware, sessionLocationMiddleware))
55
52
  .add(FileSystemGroup.middleware(locationMiddleware))
56
53
  .add(CommandGroup.middleware(locationMiddleware))
@@ -61,8 +58,7 @@ const makeApiFromGroup = (eventGroup, locationMiddleware, formLocationMiddleware
61
58
  .add(PersistentPtyGroup)
62
59
  .add(ShellGroup.middleware(locationMiddleware))
63
60
  .add(ReferenceGroup.middleware(locationMiddleware))
64
- .add(WorktreeGroup.middleware(locationMiddleware))
65
- .add(WorkspaceGroup)
61
+ .add(WorktreeGroup)
66
62
  .add(VcsGroup.middleware(locationMiddleware))
67
63
  .add(DebugGroup)
68
64
  .add(MigrationGroup)
package/dist/client.d.ts CHANGED
@@ -26,7 +26,6 @@ declare class SessionLocationMiddleware extends SessionLocationMiddleware_base {
26
26
  type ClientApiShape = Api<Context.Service.Identifier<typeof LocationMiddleware>, Context.Service.Shape<typeof LocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, Context.Service.Identifier<typeof SessionLocationMiddleware>, Context.Service.Shape<typeof SessionLocationMiddleware>, typeof EventGroup>;
27
27
  export declare const ClientApi: ClientApiShape;
28
28
  export declare const groupNames: {
29
- readonly "server.health": "health";
30
29
  readonly "server.server": "server";
31
30
  readonly "server.debug": "debug";
32
31
  readonly "server.migration": "migration";
@@ -55,7 +54,6 @@ export declare const groupNames: {
55
54
  readonly "server.reference": "reference";
56
55
  readonly "server.project": "project";
57
56
  readonly "server.worktree": "worktree";
58
- readonly "server.workspace": "workspace";
59
57
  readonly "server.vcs": "vcs";
60
58
  readonly "server.config": "config";
61
59
  };
package/dist/client.js CHANGED
@@ -13,7 +13,6 @@ export const ClientApi = makeDefaultApi({
13
13
  sessionLocationMiddleware: SessionLocationMiddleware,
14
14
  });
15
15
  export const groupNames = {
16
- "server.health": "health",
17
16
  "server.server": "server",
18
17
  "server.debug": "debug",
19
18
  "server.migration": "migration",
@@ -42,7 +41,6 @@ export const groupNames = {
42
41
  "server.reference": "reference",
43
42
  "server.project": "project",
44
43
  "server.worktree": "worktree",
45
- "server.workspace": "workspace",
46
44
  "server.vcs": "vcs",
47
45
  "server.config": "config",
48
46
  };
package/dist/errors.d.ts CHANGED
@@ -55,6 +55,26 @@ declare const ProviderNotFoundError_base: Schema.Class<ProviderNotFoundError, Sc
55
55
  }>, import("effect/Cause").YieldableError>;
56
56
  export declare class ProviderNotFoundError extends ProviderNotFoundError_base {
57
57
  }
58
+ declare const IntegrationNotFoundError_base: Schema.Class<IntegrationNotFoundError, Schema.TaggedStruct<"IntegrationNotFoundError", {
59
+ readonly integrationID: Schema.String;
60
+ readonly message: Schema.String;
61
+ }>, import("effect/Cause").YieldableError>;
62
+ export declare class IntegrationNotFoundError extends IntegrationNotFoundError_base {
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
+ }
58
78
  declare const ProjectNotFoundError_base: Schema.Class<ProjectNotFoundError, Schema.TaggedStruct<"ProjectNotFoundError", {
59
79
  readonly projectID: Schema.String;
60
80
  readonly message: Schema.String;
package/dist/errors.js CHANGED
@@ -45,6 +45,23 @@ export class ProviderNotFoundError extends Schema.TaggedError()("ProviderNotFoun
45
45
  message: Schema.String,
46
46
  }, { httpApiStatus: 404 }) {
47
47
  }
48
+ export class IntegrationNotFoundError extends Schema.TaggedError()("IntegrationNotFoundError", {
49
+ integrationID: Schema.String,
50
+ message: Schema.String,
51
+ }, { httpApiStatus: 404 }) {
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
+ }
48
65
  export class ProjectNotFoundError extends Schema.TaggedError()("ProjectNotFoundError", {
49
66
  projectID: Schema.String,
50
67
  message: Schema.String,
@@ -1,15 +1,15 @@
1
1
  import { Agent } from "@opencode/schema/agent";
2
- import { Location } from "@opencode/schema/location";
3
2
  import { Schema } from "effect";
4
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
4
  import { AgentNotFoundError } from "../errors.js";
6
5
  export declare const AgentGroup: HttpApiGroup.HttpApiGroup<"server.agent", HttpApiEndpoint.HttpApiEndpoint<"agent.list", "GET", "/api/agent", 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, "Agent.ID">;
15
15
  readonly name: Schema.brand<Schema.String, "Agent.Name">;
@@ -101,10 +101,11 @@ export declare const AgentGroup: HttpApiGroup.HttpApiGroup<"server.agent", HttpA
101
101
  }>>, Schema.toCodecStringTree<Schema.Struct<{
102
102
  readonly location: Schema.optional<Schema.Struct<{
103
103
  readonly directory: Schema.optional<Schema.String>;
104
- readonly workspace: Schema.optional<Schema.String>;
105
104
  }>>;
106
105
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
107
- readonly location: typeof Location.Info;
106
+ readonly location: Schema.Struct<{
107
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
108
+ }>;
108
109
  readonly data: Schema.Struct<{
109
110
  readonly id: Schema.brand<Schema.String, "Agent.ID">;
110
111
  readonly name: Schema.brand<Schema.String, "Agent.Name">;
@@ -11,7 +11,7 @@ export const AgentGroup = HttpApiGroup.make("server.agent")
11
11
  })
12
12
  .annotateMerge(locationQueryOpenApi)
13
13
  .annotateMerge(OpenApi.annotations({
14
- identifier: "v2.agent.list",
14
+ identifier: "agent.list",
15
15
  summary: "List agents",
16
16
  description: "Retrieve currently registered agents.",
17
17
  })))
@@ -23,7 +23,7 @@ export const AgentGroup = HttpApiGroup.make("server.agent")
23
23
  })
24
24
  .annotateMerge(locationQueryOpenApi)
25
25
  .annotateMerge(OpenApi.annotations({
26
- identifier: "v2.agent.get",
26
+ identifier: "agent.get",
27
27
  summary: "Get agent",
28
28
  description: "Retrieve a single currently registered agent.",
29
29
  })))
@@ -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 CommandGroup: HttpApiGroup.HttpApiGroup<"server.command", HttpApiEndpoint.HttpApiEndpoint<"command.list", "GET", "/api/command", 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 name: Schema.String;
13
13
  readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -10,7 +10,7 @@ export const CommandGroup = HttpApiGroup.make("server.command")
10
10
  })
11
11
  .annotateMerge(locationQueryOpenApi)
12
12
  .annotateMerge(OpenApi.annotations({
13
- identifier: "v2.command.list",
13
+ identifier: "command.list",
14
14
  summary: "List commands",
15
15
  description: "Retrieve currently registered commands.",
16
16
  })))
@@ -1,22 +1,14 @@
1
1
  import { Config } from "@opencode/schema/config";
2
2
  import { Schema } from "effect";
3
- import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
4
4
  export declare const ConfigGroup: HttpApiGroup.HttpApiGroup<"server.config", HttpApiEndpoint.HttpApiEndpoint<"config.get", "GET", "/api/config", never, Schema.toCodecStringTree<Schema.Struct<{
5
5
  readonly location: Schema.optional<Schema.Struct<{
6
6
  readonly directory: Schema.optional<Schema.String>;
7
- readonly workspace: Schema.optional<Schema.String>;
8
7
  }>>;
9
- }>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Union<readonly [typeof Config.Document, typeof Config.Directory, typeof Config.AgentsDirectory, typeof Config.ClaudeDirectory]>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.preferences", "GET", "/api/config/preferences", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
10
- readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
11
- readonly websearch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>, never, never>;
12
- }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.updatePreferences", "PATCH", "/api/config/preferences", never, never, Schema.toCodecJson<Schema.Struct<{
13
- readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.String>>>, Schema.optionalKey<Schema.NullOr<Schema.String>>, never, never>;
14
- readonly websearch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.NullOr<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>>>, Schema.optionalKey<Schema.NullOr<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>>, never, never>;
15
- }>>, never, Schema.toCodecJson<Schema.Struct<{
16
- readonly shell: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
17
- readonly websearch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Literal<false>, typeof import("@opencode/schema/config/websearch").Info]>>, never, never>;
18
- }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.shells", "GET", "/api/config/shell", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
8
+ }>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Union<readonly [typeof Config.Document, typeof Config.Directory]>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.shells", "GET", "/api/config/shell", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
19
9
  readonly path: Schema.String;
20
10
  readonly name: Schema.String;
21
11
  readonly acceptable: Schema.Boolean;
22
- }>>>, never, never, never>, false>;
12
+ }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"config.update", "PATCH", "/api/experimental/config", never, never, Schema.toCodecJson<Schema.Struct<{
13
+ readonly shell: Schema.NullOr<Schema.String>;
14
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -1,7 +1,7 @@
1
1
  import { Config } from "@opencode/schema/config";
2
2
  import { ConfigShell } from "@opencode/schema/config/shell";
3
3
  import { Schema } from "effect";
4
- import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
4
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
5
5
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
6
  export const ConfigGroup = HttpApiGroup.make("server.config")
7
7
  .add(HttpApiEndpoint.get("config.get", "/api/config", {
@@ -10,30 +10,23 @@ export const ConfigGroup = HttpApiGroup.make("server.config")
10
10
  })
11
11
  .annotateMerge(locationQueryOpenApi)
12
12
  .annotateMerge(OpenApi.annotations({
13
- identifier: "v2.config.get",
13
+ identifier: "config.get",
14
14
  summary: "Get configuration",
15
15
  description: "Return configuration documents and discovery sources for the requested location, from lowest to highest priority.",
16
- })))
17
- .add(HttpApiEndpoint.get("config.preferences", "/api/config/preferences", {
18
- success: Config.Preferences,
19
- }).annotateMerge(OpenApi.annotations({
20
- identifier: "v2.config.preferences",
21
- summary: "Get global preferences",
22
- description: "Return preferences from the highest-precedence global configuration document.",
23
- })))
24
- .add(HttpApiEndpoint.patch("config.updatePreferences", "/api/config/preferences", {
25
- payload: Config.PreferencesPatch,
26
- success: Config.Preferences,
27
- }).annotateMerge(OpenApi.annotations({
28
- identifier: "v2.config.updatePreferences",
29
- summary: "Update global preferences",
30
- description: "Patch preferences in the highest-precedence global configuration document.",
31
16
  })))
32
17
  .add(HttpApiEndpoint.get("config.shells", "/api/config/shell", {
33
18
  success: Schema.Array(ConfigShell.Option),
34
19
  }).annotateMerge(OpenApi.annotations({
35
- identifier: "v2.config.shells",
20
+ identifier: "config.shells",
36
21
  summary: "List available shells",
37
22
  description: "Return shells available to terminal and agent execution.",
23
+ })))
24
+ .add(HttpApiEndpoint.patch("config.update", "/api/experimental/config", {
25
+ payload: Config.Patch,
26
+ success: HttpApiSchema.NoContent,
27
+ }).annotateMerge(OpenApi.annotations({
28
+ identifier: "experimental.config.update",
29
+ summary: "Update global configuration",
30
+ description: "Patch supported fields in the highest-precedence global configuration document.",
38
31
  })))
39
32
  .annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." }));
@@ -4,29 +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
- readonly workspace: Schema.optional<Schema.String>;
11
- }>>;
12
- }>>, Schema.toCodecJson<Schema.Struct<{
7
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
13
8
  readonly label: Schema.String;
14
9
  }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.activate", "POST", "/api/credential/:credentialID/activate", Schema.toCodecStringTree<Schema.Struct<{
15
10
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
16
11
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
17
12
  };
18
- }>>, Schema.toCodecStringTree<Schema.Struct<{
19
- readonly location: Schema.optional<Schema.Struct<{
20
- readonly directory: Schema.optional<Schema.String>;
21
- readonly workspace: Schema.optional<Schema.String>;
22
- }>>;
23
- }>>, 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<{
24
14
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
25
15
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
26
16
  };
27
- }>>, Schema.toCodecStringTree<Schema.Struct<{
28
- readonly location: Schema.optional<Schema.Struct<{
29
- readonly directory: Schema.optional<Schema.String>;
30
- readonly workspace: Schema.optional<Schema.String>;
31
- }>>;
32
- }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
17
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -1,40 +1,33 @@
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
- identifier: "v2.credential.update",
11
+ identifier: "credential.update",
15
12
  summary: "Update credential",
16
13
  description: "Update a stored credential label.",
17
14
  })))
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
- identifier: "v2.credential.activate",
21
+ identifier: "credential.activate",
27
22
  summary: "Activate credential",
28
23
  description: "Activate a stored integration 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
- identifier: "v2.credential.remove",
30
+ identifier: "credential.remove",
38
31
  summary: "Remove credential",
39
32
  description: "Remove a stored integration credential.",
40
33
  })));
@@ -2,16 +2,8 @@ import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
3
3
  export declare const DebugGroup: HttpApiGroup.HttpApiGroup<"server.debug", HttpApiEndpoint.HttpApiEndpoint<"debug.location", "GET", "/api/debug/location", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
4
4
  readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
5
- readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<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
- }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
9
- ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
10
- create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
11
- }>, never, never>;
12
5
  }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location.evict", "DELETE", "/api/debug/location", never, Schema.toCodecStringTree<Schema.Struct<{
13
6
  readonly location: Schema.optional<Schema.Struct<{
14
7
  readonly directory: Schema.optional<Schema.String>;
15
- readonly workspace: Schema.optional<Schema.String>;
16
8
  }>>;
17
9
  }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -4,9 +4,9 @@ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/un
4
4
  import { LocationQuery, locationQueryOpenApi } from "./location.js";
5
5
  export const DebugGroup = HttpApiGroup.make("server.debug")
6
6
  .add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
7
- success: Schema.Array(Location.Ref),
7
+ success: Schema.Array(Location.PublicRef),
8
8
  }).annotateMerge(OpenApi.annotations({
9
- identifier: "v2.debug.location.list",
9
+ identifier: "debug.location.list",
10
10
  summary: "List loaded locations",
11
11
  description: "List locations currently loaded by the server.",
12
12
  })))
@@ -16,7 +16,7 @@ export const DebugGroup = HttpApiGroup.make("server.debug")
16
16
  })
17
17
  .annotateMerge(locationQueryOpenApi)
18
18
  .annotateMerge(OpenApi.annotations({
19
- identifier: "v2.debug.location.evict",
19
+ identifier: "debug.location.evict",
20
20
  summary: "Evict a loaded location",
21
21
  description: "Dispose the requested location's cached services so its next use boots them fresh.",
22
22
  })))