@opencode-ai/protocol 0.0.0-dev-17471

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 (71) hide show
  1. package/dist/api.d.ts +53 -0
  2. package/dist/api.js +73 -0
  3. package/dist/client.d.ts +61 -0
  4. package/dist/client.js +47 -0
  5. package/dist/errors.d.ts +133 -0
  6. package/dist/errors.js +105 -0
  7. package/dist/groups/agent.d.ts +194 -0
  8. package/dist/groups/agent.js +30 -0
  9. package/dist/groups/command.d.ts +63 -0
  10. package/dist/groups/command.js +20 -0
  11. package/dist/groups/config.d.ts +9 -0
  12. package/dist/groups/config.js +16 -0
  13. package/dist/groups/credential.d.ts +23 -0
  14. package/dist/groups/credential.js +29 -0
  15. package/dist/groups/debug.d.ts +17 -0
  16. package/dist/groups/debug.js +23 -0
  17. package/dist/groups/event.d.ts +12882 -0
  18. package/dist/groups/event.js +42 -0
  19. package/dist/groups/form.d.ts +781 -0
  20. package/dist/groups/form.js +97 -0
  21. package/dist/groups/fs.d.ts +35 -0
  22. package/dist/groups/fs.js +51 -0
  23. package/dist/groups/generate.d.ts +38 -0
  24. package/dist/groups/generate.js +27 -0
  25. package/dist/groups/health.d.ts +27 -0
  26. package/dist/groups/health.js +34 -0
  27. package/dist/groups/integration.d.ts +1152 -0
  28. package/dist/groups/integration.js +149 -0
  29. package/dist/groups/location.d.ts +16 -0
  30. package/dist/groups/location.js +34 -0
  31. package/dist/groups/mcp.d.ts +82 -0
  32. package/dist/groups/mcp.js +78 -0
  33. package/dist/groups/message.d.ts +592 -0
  34. package/dist/groups/message.js +37 -0
  35. package/dist/groups/migration.d.ts +28 -0
  36. package/dist/groups/migration.js +21 -0
  37. package/dist/groups/model.d.ts +218 -0
  38. package/dist/groups/model.js +33 -0
  39. package/dist/groups/permission.d.ts +153 -0
  40. package/dist/groups/permission.js +99 -0
  41. package/dist/groups/plugin.d.ts +14 -0
  42. package/dist/groups/plugin.js +20 -0
  43. package/dist/groups/project.d.ts +41 -0
  44. package/dist/groups/project.js +27 -0
  45. package/dist/groups/provider.d.ts +82 -0
  46. package/dist/groups/provider.js +34 -0
  47. package/dist/groups/pty.d.ts +145 -0
  48. package/dist/groups/pty.js +112 -0
  49. package/dist/groups/reference.d.ts +29 -0
  50. package/dist/groups/reference.js +20 -0
  51. package/dist/groups/server.d.ts +5 -0
  52. package/dist/groups/server.js +11 -0
  53. package/dist/groups/session.d.ts +9247 -0
  54. package/dist/groups/session.js +515 -0
  55. package/dist/groups/shell.d.ts +152 -0
  56. package/dist/groups/shell.js +82 -0
  57. package/dist/groups/skill.d.ts +20 -0
  58. package/dist/groups/skill.js +20 -0
  59. package/dist/groups/vcs.d.ts +46 -0
  60. package/dist/groups/vcs.js +47 -0
  61. package/dist/groups/websearch.d.ts +28 -0
  62. package/dist/groups/websearch.js +34 -0
  63. package/dist/groups/worktree.d.ts +42 -0
  64. package/dist/groups/worktree.js +54 -0
  65. package/dist/middleware/authorization.d.ts +13 -0
  66. package/dist/middleware/authorization.js +6 -0
  67. package/dist/middleware/schema-error.d.ts +13 -0
  68. package/dist/middleware/schema-error.js +4 -0
  69. package/dist/simulation.d.ts +1590 -0
  70. package/dist/simulation.js +460 -0
  71. package/package.json +44 -0
@@ -0,0 +1,194 @@
1
+ import { Agent } from "@opencode-ai/schema/agent";
2
+ import { Location } from "@opencode-ai/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
+ import { AgentNotFoundError } from "../errors.js";
6
+ export declare const AgentGroup: HttpApiGroup.HttpApiGroup<"server.agent", HttpApiEndpoint.HttpApiEndpoint<"agent.list", "GET", "/api/agent", never, Schema.toCodecStringTree<Schema.Struct<{
7
+ readonly location: Schema.optional<Schema.Struct<{
8
+ readonly directory: Schema.optional<Schema.String>;
9
+ readonly workspace: Schema.optional<Schema.String>;
10
+ }>>;
11
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
12
+ readonly location: typeof Location.Info;
13
+ readonly data: Schema.$Array<Schema.Struct<{
14
+ readonly id: Schema.brand<Schema.String, "Agent.ID">;
15
+ readonly name: Schema.brand<Schema.String, "Agent.Name">;
16
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
17
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
18
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
19
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
20
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
21
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
22
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
23
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
24
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
25
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
26
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
27
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
28
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
29
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
30
+ };
31
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
32
+ }> & {
33
+ parse: (input: string) => {
34
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
35
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
36
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
37
+ };
38
+ }>>, Schema.optionalKey<Schema.Struct<{
39
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
40
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
41
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
42
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
43
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
44
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
45
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
46
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
47
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
48
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
49
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
50
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
51
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
52
+ };
53
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
54
+ }> & {
55
+ parse: (input: string) => {
56
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
57
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
58
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
59
+ };
60
+ }>, never, never>;
61
+ readonly request: Schema.Struct<{
62
+ readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Any>>;
63
+ readonly headers: Schema.$Record<Schema.String, Schema.String>;
64
+ readonly body: Schema.$Record<Schema.String, Schema.Any>;
65
+ }>;
66
+ readonly system: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
67
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
68
+ readonly mode: Schema.Literals<readonly ["subagent", "primary", "all"]>;
69
+ readonly hidden: Schema.Boolean;
70
+ readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
71
+ readonly steps: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
72
+ readonly permissions: Schema.$Array<Schema.Struct<{
73
+ readonly action: Schema.String;
74
+ readonly resource: Schema.String;
75
+ readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
76
+ }>>;
77
+ }> & {
78
+ default: (id: Agent.ID) => {
79
+ id: string & import("effect/Brand").Brand<"Agent.ID">;
80
+ name: string & import("effect/Brand").Brand<"Agent.Name">;
81
+ request: {
82
+ settings: {};
83
+ headers: {};
84
+ body: {};
85
+ };
86
+ mode: "primary";
87
+ hidden: false;
88
+ permissions: ({
89
+ action: string;
90
+ resource: string;
91
+ effect: "allow";
92
+ } | {
93
+ action: string;
94
+ resource: string;
95
+ effect: "ask";
96
+ })[];
97
+ };
98
+ }>;
99
+ }>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"agent.get", "GET", "/api/agent/:agentID", Schema.toCodecStringTree<Schema.Struct<{
100
+ agentID: Schema.brand<Schema.String, "Agent.ID">;
101
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
102
+ readonly location: Schema.optional<Schema.Struct<{
103
+ readonly directory: Schema.optional<Schema.String>;
104
+ readonly workspace: Schema.optional<Schema.String>;
105
+ }>>;
106
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
107
+ readonly location: typeof Location.Info;
108
+ readonly data: Schema.Struct<{
109
+ readonly id: Schema.brand<Schema.String, "Agent.ID">;
110
+ readonly name: Schema.brand<Schema.String, "Agent.Name">;
111
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
112
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
113
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
114
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
115
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
116
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
117
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
118
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
119
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
120
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
121
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
122
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
123
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
124
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
125
+ };
126
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
127
+ }> & {
128
+ parse: (input: string) => {
129
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
130
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
131
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
132
+ };
133
+ }>>, Schema.optionalKey<Schema.Struct<{
134
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
135
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
136
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
137
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
138
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
139
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
140
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
141
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
142
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
143
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
144
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
145
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
146
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
147
+ };
148
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
149
+ }> & {
150
+ parse: (input: string) => {
151
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
152
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
153
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
154
+ };
155
+ }>, never, never>;
156
+ readonly request: Schema.Struct<{
157
+ readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Any>>;
158
+ readonly headers: Schema.$Record<Schema.String, Schema.String>;
159
+ readonly body: Schema.$Record<Schema.String, Schema.Any>;
160
+ }>;
161
+ readonly system: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
162
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
163
+ readonly mode: Schema.Literals<readonly ["subagent", "primary", "all"]>;
164
+ readonly hidden: Schema.Boolean;
165
+ readonly color: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
166
+ readonly steps: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
167
+ readonly permissions: Schema.$Array<Schema.Struct<{
168
+ readonly action: Schema.String;
169
+ readonly resource: Schema.String;
170
+ readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
171
+ }>>;
172
+ }> & {
173
+ default: (id: Agent.ID) => {
174
+ id: string & import("effect/Brand").Brand<"Agent.ID">;
175
+ name: string & import("effect/Brand").Brand<"Agent.Name">;
176
+ request: {
177
+ settings: {};
178
+ headers: {};
179
+ body: {};
180
+ };
181
+ mode: "primary";
182
+ hidden: false;
183
+ permissions: ({
184
+ action: string;
185
+ resource: string;
186
+ effect: "allow";
187
+ } | {
188
+ action: string;
189
+ resource: string;
190
+ effect: "ask";
191
+ })[];
192
+ };
193
+ };
194
+ }>>, Schema.toCodecJson<typeof AgentNotFoundError>, never, never>, false>;
@@ -0,0 +1,30 @@
1
+ import { Agent } from "@opencode-ai/schema/agent";
2
+ import { Location } from "@opencode-ai/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
+ import { AgentNotFoundError } from "../errors.js";
7
+ export const AgentGroup = HttpApiGroup.make("server.agent")
8
+ .add(HttpApiEndpoint.get("agent.list", "/api/agent", {
9
+ query: LocationQuery,
10
+ success: Location.response(Schema.Array(Agent.Info)),
11
+ })
12
+ .annotateMerge(locationQueryOpenApi)
13
+ .annotateMerge(OpenApi.annotations({
14
+ identifier: "v2.agent.list",
15
+ summary: "List agents",
16
+ description: "Retrieve currently registered agents.",
17
+ })))
18
+ .add(HttpApiEndpoint.get("agent.get", "/api/agent/:agentID", {
19
+ params: { agentID: Agent.ID },
20
+ query: LocationQuery,
21
+ success: Location.response(Agent.Info),
22
+ error: AgentNotFoundError,
23
+ })
24
+ .annotateMerge(locationQueryOpenApi)
25
+ .annotateMerge(OpenApi.annotations({
26
+ identifier: "v2.agent.get",
27
+ summary: "Get agent",
28
+ description: "Retrieve a single currently registered agent.",
29
+ })))
30
+ .annotateMerge(OpenApi.annotations({ title: "agent" }));
@@ -0,0 +1,63 @@
1
+ import { Location } from "@opencode-ai/schema/location";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
+ export declare const CommandGroup: HttpApiGroup.HttpApiGroup<"server.command", HttpApiEndpoint.HttpApiEndpoint<"command.list", "GET", "/api/command", 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
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
10
+ readonly location: typeof Location.Info;
11
+ readonly data: Schema.$Array<Schema.Struct<{
12
+ readonly name: Schema.String;
13
+ readonly template: Schema.String;
14
+ readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
15
+ readonly agent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Agent.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Agent.ID">>, never, never>;
16
+ readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
17
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
18
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
19
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
20
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
21
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
22
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
23
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
24
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
25
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
26
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
27
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
28
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
29
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
30
+ };
31
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
32
+ }> & {
33
+ parse: (input: string) => {
34
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
35
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
36
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
37
+ };
38
+ }>>, Schema.optionalKey<Schema.Struct<{
39
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
40
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
41
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
42
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
43
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
44
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
45
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
46
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
47
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
48
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
49
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
50
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
51
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
52
+ };
53
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
54
+ }> & {
55
+ parse: (input: string) => {
56
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
57
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
58
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
59
+ };
60
+ }>, never, never>;
61
+ readonly subtask: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
62
+ }>>;
63
+ }>>, never, never, never>, false>;
@@ -0,0 +1,20 @@
1
+ import { Command } from "@opencode-ai/schema/command";
2
+ import { Location } from "@opencode-ai/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
6
+ export const CommandGroup = HttpApiGroup.make("server.command")
7
+ .add(HttpApiEndpoint.get("command.list", "/api/command", {
8
+ query: LocationQuery,
9
+ success: Location.response(Schema.Array(Command.Info)),
10
+ })
11
+ .annotateMerge(locationQueryOpenApi)
12
+ .annotateMerge(OpenApi.annotations({
13
+ identifier: "v2.command.list",
14
+ summary: "List commands",
15
+ description: "Retrieve currently registered commands.",
16
+ })))
17
+ .annotateMerge(OpenApi.annotations({
18
+ title: "command",
19
+ description: "Experimental command routes.",
20
+ }));
@@ -0,0 +1,9 @@
1
+ import { Config } from "@opencode-ai/schema/config";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
+ export declare const ConfigGroup: HttpApiGroup.HttpApiGroup<"server.config", HttpApiEndpoint.HttpApiEndpoint<"config.get", "GET", "/api/config", 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
+ }>>, never, never, Schema.toCodecJson<Schema.$Array<Schema.Union<readonly [typeof Config.Document, typeof Config.Directory, typeof Config.AgentsDirectory, typeof Config.ClaudeDirectory]>>>, never, never, never>, false>;
@@ -0,0 +1,16 @@
1
+ import { Config } from "@opencode-ai/schema/config";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
4
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
5
+ export const ConfigGroup = HttpApiGroup.make("server.config")
6
+ .add(HttpApiEndpoint.get("config.get", "/api/config", {
7
+ query: LocationQuery,
8
+ success: Schema.Array(Config.Entry),
9
+ })
10
+ .annotateMerge(locationQueryOpenApi)
11
+ .annotateMerge(OpenApi.annotations({
12
+ identifier: "v2.config.get",
13
+ summary: "Get configuration",
14
+ description: "Return configuration documents and discovery sources for the requested location, from lowest to highest priority.",
15
+ })))
16
+ .annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." }));
@@ -0,0 +1,23 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
3
+ export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credential", HttpApiEndpoint.HttpApiEndpoint<"credential.update", "PATCH", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
4
+ credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
5
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
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<{
13
+ readonly label: Schema.String;
14
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.remove", "DELETE", "/api/credential/:credentialID", Schema.toCodecStringTree<Schema.Struct<{
15
+ credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
16
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
17
+ };
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>, false>;
@@ -0,0 +1,29 @@
1
+ import { Credential } from "@opencode-ai/schema/credential";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
4
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
5
+ export const CredentialGroup = HttpApiGroup.make("server.credential")
6
+ .add(HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", {
7
+ params: { credentialID: Credential.ID },
8
+ query: LocationQuery,
9
+ payload: Schema.Struct({ label: Schema.String }),
10
+ success: HttpApiSchema.NoContent,
11
+ })
12
+ .annotateMerge(locationQueryOpenApi)
13
+ .annotateMerge(OpenApi.annotations({
14
+ identifier: "v2.credential.update",
15
+ summary: "Update credential",
16
+ description: "Update a stored credential label.",
17
+ })))
18
+ .annotateMerge(OpenApi.annotations({ title: "credential" }))
19
+ .add(HttpApiEndpoint.delete("credential.remove", "/api/credential/:credentialID", {
20
+ params: { credentialID: Credential.ID },
21
+ query: LocationQuery,
22
+ success: HttpApiSchema.NoContent,
23
+ })
24
+ .annotateMerge(locationQueryOpenApi)
25
+ .annotateMerge(OpenApi.annotations({
26
+ identifier: "v2.credential.remove",
27
+ summary: "Remove credential",
28
+ description: "Remove a stored integration credential.",
29
+ })));
@@ -0,0 +1,17 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
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
+ 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
+ }>>>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"debug.location.evict", "DELETE", "/api/debug/location", never, Schema.toCodecStringTree<Schema.Struct<{
13
+ readonly location: Schema.optional<Schema.Struct<{
14
+ readonly directory: Schema.optional<Schema.String>;
15
+ readonly workspace: Schema.optional<Schema.String>;
16
+ }>>;
17
+ }>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>, false>;
@@ -0,0 +1,23 @@
1
+ import { Location } from "@opencode-ai/schema/location";
2
+ import { Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
4
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
5
+ export const DebugGroup = HttpApiGroup.make("server.debug")
6
+ .add(HttpApiEndpoint.get("debug.location", "/api/debug/location", {
7
+ success: Schema.Array(Location.Ref),
8
+ }).annotateMerge(OpenApi.annotations({
9
+ identifier: "v2.debug.location.list",
10
+ summary: "List loaded locations",
11
+ description: "List locations currently loaded by the server.",
12
+ })))
13
+ .add(HttpApiEndpoint.delete("debug.location.evict", "/api/debug/location", {
14
+ query: LocationQuery,
15
+ success: HttpApiSchema.NoContent,
16
+ })
17
+ .annotateMerge(locationQueryOpenApi)
18
+ .annotateMerge(OpenApi.annotations({
19
+ identifier: "v2.debug.location.evict",
20
+ summary: "Evict a loaded location",
21
+ description: "Dispose the requested location's cached services so its next use boots them fresh.",
22
+ })))
23
+ .annotateMerge(OpenApi.annotations({ title: "debug" }));