@opencode/protocol 0.0.0-reserved → 2.0.0

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 (78) hide show
  1. package/dist/api.d.ts +56 -0
  2. package/dist/api.js +79 -0
  3. package/dist/client.d.ts +64 -0
  4. package/dist/client.js +50 -0
  5. package/dist/errors.d.ts +153 -0
  6. package/dist/errors.js +122 -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 +15 -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 +32 -0
  14. package/dist/groups/credential.js +40 -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 +14643 -0
  18. package/dist/groups/event.js +51 -0
  19. package/dist/groups/form.d.ts +781 -0
  20. package/dist/groups/form.js +95 -0
  21. package/dist/groups/fs.d.ts +35 -0
  22. package/dist/groups/fs.js +53 -0
  23. package/dist/groups/generate.d.ts +33 -0
  24. package/dist/groups/generate.js +23 -0
  25. package/dist/groups/health.d.ts +15 -0
  26. package/dist/groups/health.js +20 -0
  27. package/dist/groups/integration.d.ts +1154 -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 +734 -0
  34. package/dist/groups/message.js +51 -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 +314 -0
  38. package/dist/groups/model.js +33 -0
  39. package/dist/groups/permission.d.ts +167 -0
  40. package/dist/groups/permission.js +109 -0
  41. package/dist/groups/persistent-pty.d.ts +249 -0
  42. package/dist/groups/persistent-pty.js +91 -0
  43. package/dist/groups/plugin.d.ts +91 -0
  44. package/dist/groups/plugin.js +55 -0
  45. package/dist/groups/project.d.ts +90 -0
  46. package/dist/groups/project.js +39 -0
  47. package/dist/groups/provider.d.ts +156 -0
  48. package/dist/groups/provider.js +34 -0
  49. package/dist/groups/pty.d.ts +147 -0
  50. package/dist/groups/pty.js +113 -0
  51. package/dist/groups/reference.d.ts +29 -0
  52. package/dist/groups/reference.js +20 -0
  53. package/dist/groups/rpc.d.ts +22 -0
  54. package/dist/groups/rpc.js +24 -0
  55. package/dist/groups/server.d.ts +5 -0
  56. package/dist/groups/server.js +11 -0
  57. package/dist/groups/session.d.ts +10794 -0
  58. package/dist/groups/session.js +549 -0
  59. package/dist/groups/shell.d.ts +152 -0
  60. package/dist/groups/shell.js +82 -0
  61. package/dist/groups/skill.d.ts +20 -0
  62. package/dist/groups/skill.js +20 -0
  63. package/dist/groups/vcs.d.ts +70 -0
  64. package/dist/groups/vcs.js +76 -0
  65. package/dist/groups/websearch.d.ts +28 -0
  66. package/dist/groups/websearch.js +34 -0
  67. package/dist/groups/workspace.d.ts +22 -0
  68. package/dist/groups/workspace.js +27 -0
  69. package/dist/groups/worktree.d.ts +47 -0
  70. package/dist/groups/worktree.js +61 -0
  71. package/dist/middleware/authorization.d.ts +13 -0
  72. package/dist/middleware/authorization.js +6 -0
  73. package/dist/middleware/schema-error.d.ts +13 -0
  74. package/dist/middleware/schema-error.js +4 -0
  75. package/dist/simulation.d.ts +1801 -0
  76. package/dist/simulation.js +487 -0
  77. package/package.json +36 -6
  78. package/README.md +0 -5
@@ -0,0 +1,51 @@
1
+ import { Session } from "@opencode/schema/session";
2
+ import { SessionMessage } from "@opencode/schema/session-message";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
+ import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js";
6
+ export const SessionMessagesQuery = Schema.Struct({
7
+ limit: Schema.optional(Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(200))).annotate({
8
+ description: "Maximum number of messages to return. When omitted, the endpoint returns its default page size.",
9
+ }),
10
+ order: Schema.optional(Schema.Union([Schema.Literal("asc"), Schema.Literal("desc")])).annotate({
11
+ description: "Message order for the first page. Use desc for newest first or asc for oldest first.",
12
+ }),
13
+ cursor: Schema.optional(Schema.String.annotate({
14
+ description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.",
15
+ })),
16
+ type: Schema.optional(Schema.Literals([
17
+ "agent-switched",
18
+ "model-switched",
19
+ "location-switched",
20
+ "user",
21
+ "synthetic",
22
+ "system",
23
+ "skill",
24
+ "shell",
25
+ "assistant",
26
+ "compaction",
27
+ ])).annotate({
28
+ description: "Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.",
29
+ }),
30
+ }).annotate({ identifier: "SessionMessagesQuery" });
31
+ export const MessageGroup = HttpApiGroup.make("server.message")
32
+ .add(HttpApiEndpoint.get("session.messages", "/api/session/:sessionID/message", {
33
+ params: { sessionID: Session.ID },
34
+ query: SessionMessagesQuery,
35
+ success: Schema.Struct({
36
+ data: Schema.Array(SessionMessage.Info),
37
+ cursor: Schema.Struct({
38
+ previous: Schema.String.pipe(Schema.optional),
39
+ next: Schema.String.pipe(Schema.optional),
40
+ }),
41
+ }).annotate({ identifier: "SessionMessagesResponse" }),
42
+ error: [InvalidCursorError, SessionNotFoundError, UnknownError],
43
+ }).annotateMerge(OpenApi.annotations({
44
+ identifier: "v2.message.list",
45
+ summary: "Get session messages",
46
+ description: "Retrieve projected messages for a session, optionally filtered by type. Items keep the requested order across pages; use cursor.next or cursor.previous to move through the ordered timeline, passing the same type filter on each page.",
47
+ })))
48
+ .annotateMerge(OpenApi.annotations({
49
+ title: "session",
50
+ description: "Experimental message routes.",
51
+ }));
@@ -0,0 +1,28 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
3
+ export declare const V1MigrationStatus: Schema.Union<readonly [Schema.Struct<{
4
+ readonly status: Schema.Literals<readonly ["required", "completed"]>;
5
+ }>, Schema.Struct<{
6
+ readonly status: Schema.Literal<"running">;
7
+ readonly progress: Schema.Struct<{
8
+ readonly label: Schema.String;
9
+ readonly numerator: Schema.optional<Schema.Int>;
10
+ readonly denominator: Schema.optional<Schema.Int>;
11
+ }>;
12
+ }>, Schema.Struct<{
13
+ readonly status: Schema.Literal<"error">;
14
+ readonly error: Schema.String;
15
+ }>]>;
16
+ export declare const MigrationGroup: HttpApiGroup.HttpApiGroup<"server.migration", HttpApiEndpoint.HttpApiEndpoint<"migration.v1.status", "GET", "/api/experimental/migration/v1", never, never, never, never, Schema.toCodecJson<Schema.Union<readonly [Schema.Struct<{
17
+ readonly status: Schema.Literals<readonly ["required", "completed"]>;
18
+ }>, Schema.Struct<{
19
+ readonly status: Schema.Literal<"running">;
20
+ readonly progress: Schema.Struct<{
21
+ readonly label: Schema.String;
22
+ readonly numerator: Schema.optional<Schema.Int>;
23
+ readonly denominator: Schema.optional<Schema.Int>;
24
+ }>;
25
+ }>, Schema.Struct<{
26
+ readonly status: Schema.Literal<"error">;
27
+ readonly error: Schema.String;
28
+ }>]>>, never, never, never>, false>;
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
3
+ const V1MigrationProgress = Schema.Struct({
4
+ label: Schema.String,
5
+ numerator: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
6
+ denominator: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
7
+ });
8
+ export const V1MigrationStatus = Schema.Union([
9
+ Schema.Struct({ status: Schema.Literals(["required", "completed"]) }),
10
+ Schema.Struct({ status: Schema.Literal("running"), progress: V1MigrationProgress }),
11
+ Schema.Struct({ status: Schema.Literal("error"), error: Schema.String }),
12
+ ]);
13
+ export const MigrationGroup = HttpApiGroup.make("server.migration")
14
+ .add(HttpApiEndpoint.get("migration.v1.status", "/api/experimental/migration/v1", {
15
+ success: V1MigrationStatus,
16
+ }).annotateMerge(OpenApi.annotations({
17
+ identifier: "v2.experimental.migration.v1.status",
18
+ summary: "Get V1 migration status",
19
+ description: "Return the progress of the V1 to V2 session history migration.",
20
+ })))
21
+ .annotateMerge(OpenApi.annotations({ title: "migration" }));
@@ -0,0 +1,314 @@
1
+ import { Model } from "@opencode/schema/model";
2
+ import { Location } from "@opencode/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
5
+ import { ServiceUnavailableError } from "../errors.js";
6
+ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.list", "GET", "/api/model", 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 capabilities: Schema.Struct<{
15
+ readonly tools: Schema.Boolean;
16
+ readonly input: Schema.$Array<Schema.String>;
17
+ readonly output: Schema.$Array<Schema.String>;
18
+ readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
19
+ }> & {
20
+ default: () => {
21
+ tools: true;
22
+ input: string[];
23
+ output: string[];
24
+ };
25
+ };
26
+ readonly variants: Schema.$Array<Schema.Struct<{
27
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
28
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
29
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
30
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
31
+ }>>;
32
+ readonly time: Schema.Struct<{
33
+ readonly released: Schema.Finite;
34
+ }>;
35
+ readonly cost: Schema.$Array<Schema.Struct<{
36
+ readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
37
+ readonly type: Schema.tag<"context">;
38
+ readonly size: Schema.Int;
39
+ }>>>, Schema.optionalKey<Schema.Struct<{
40
+ readonly type: Schema.tag<"context">;
41
+ readonly size: Schema.Int;
42
+ }>>, never, never>;
43
+ readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
44
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
45
+ };
46
+ readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
47
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
48
+ };
49
+ readonly cache: Schema.Struct<{
50
+ readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
51
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
52
+ };
53
+ readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
54
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
55
+ };
56
+ }>;
57
+ }>>;
58
+ readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
59
+ readonly enabled: Schema.Boolean;
60
+ readonly limit: Schema.Struct<{
61
+ readonly context: Schema.Int;
62
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
63
+ readonly output: Schema.Int;
64
+ }>;
65
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
66
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
67
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
68
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
69
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
70
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
71
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
72
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
73
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
74
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
75
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
76
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
77
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
78
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
79
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
80
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
81
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
82
+ };
83
+ readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
84
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
85
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
86
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
87
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
88
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
89
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
90
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
91
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
92
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
93
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
94
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
95
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Provider.ID"> & {
96
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
97
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
98
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
99
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
100
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
101
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
102
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
103
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
104
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
105
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
106
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
107
+ }>, never, never>;
108
+ readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
109
+ readonly name: Schema.String;
110
+ readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
111
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
112
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
113
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
114
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
115
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
116
+ }>>>, Schema.optionalKey<Schema.Struct<{
117
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
118
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
119
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
120
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
121
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
122
+ }>>, never, never>;
123
+ readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
124
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
125
+ readonly mode: Schema.Literal<"local">;
126
+ }>, Schema.Struct<{
127
+ readonly mode: Schema.Literal<"provider">;
128
+ readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
129
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
130
+ readonly mode: Schema.Literal<"local">;
131
+ }>, Schema.Struct<{
132
+ readonly mode: Schema.Literal<"provider">;
133
+ readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
134
+ }>]>>, never, never>;
135
+ readonly websocket: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
136
+ }> & {
137
+ default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
138
+ id: string & import("effect/Brand").Brand<"Model.ID">;
139
+ modelID: string & import("effect/Brand").Brand<"Model.ID">;
140
+ providerID: string & import("effect/Brand").Brand<"Provider.ID">;
141
+ name: string & import("effect/Brand").Brand<"Model.ID">;
142
+ capabilities: {
143
+ tools: true;
144
+ input: string[];
145
+ output: string[];
146
+ };
147
+ variants: never[];
148
+ time: {
149
+ released: number;
150
+ };
151
+ cost: never[];
152
+ status: "active";
153
+ enabled: true;
154
+ limit: {
155
+ context: number;
156
+ output: number;
157
+ };
158
+ };
159
+ }>;
160
+ }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", never, Schema.toCodecStringTree<Schema.Struct<{
161
+ readonly location: Schema.optional<Schema.Struct<{
162
+ readonly directory: Schema.optional<Schema.String>;
163
+ readonly workspace: Schema.optional<Schema.String>;
164
+ }>>;
165
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
166
+ readonly location: typeof Location.Info;
167
+ readonly data: Schema.UndefinedOr<Schema.Struct<{
168
+ readonly capabilities: Schema.Struct<{
169
+ readonly tools: Schema.Boolean;
170
+ readonly input: Schema.$Array<Schema.String>;
171
+ readonly output: Schema.$Array<Schema.String>;
172
+ readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
173
+ }> & {
174
+ default: () => {
175
+ tools: true;
176
+ input: string[];
177
+ output: string[];
178
+ };
179
+ };
180
+ readonly variants: Schema.$Array<Schema.Struct<{
181
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
182
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
183
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
184
+ readonly id: Schema.brand<Schema.String, "Model.VariantID">;
185
+ }>>;
186
+ readonly time: Schema.Struct<{
187
+ readonly released: Schema.Finite;
188
+ }>;
189
+ readonly cost: Schema.$Array<Schema.Struct<{
190
+ readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
191
+ readonly type: Schema.tag<"context">;
192
+ readonly size: Schema.Int;
193
+ }>>>, Schema.optionalKey<Schema.Struct<{
194
+ readonly type: Schema.tag<"context">;
195
+ readonly size: Schema.Int;
196
+ }>>, never, never>;
197
+ readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
198
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
199
+ };
200
+ readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
201
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
202
+ };
203
+ readonly cache: Schema.Struct<{
204
+ readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
205
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
206
+ };
207
+ readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
208
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
209
+ };
210
+ }>;
211
+ }>>;
212
+ readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
213
+ readonly enabled: Schema.Boolean;
214
+ readonly limit: Schema.Struct<{
215
+ readonly context: Schema.Int;
216
+ readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
217
+ readonly output: Schema.Int;
218
+ }>;
219
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
220
+ readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
221
+ readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
222
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
223
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
224
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
225
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
226
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
227
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
228
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
229
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
230
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
231
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
232
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
233
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
234
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
235
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
236
+ };
237
+ readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
238
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
239
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
240
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
241
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
242
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
243
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
244
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
245
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
246
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
247
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
248
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
249
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Provider.ID"> & {
250
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
251
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
252
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
253
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
254
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
255
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
256
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
257
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
258
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
259
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
260
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
261
+ }>, never, never>;
262
+ readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
263
+ readonly name: Schema.String;
264
+ readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
265
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
266
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
267
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
268
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
269
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
270
+ }>>>, Schema.optionalKey<Schema.Struct<{
271
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
272
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
273
+ readonly maxTokensField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>>, Schema.optionalKey<Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>>, never, never>;
274
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
275
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
276
+ }>>, never, never>;
277
+ readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
278
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
279
+ readonly mode: Schema.Literal<"local">;
280
+ }>, Schema.Struct<{
281
+ readonly mode: Schema.Literal<"provider">;
282
+ readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
283
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
284
+ readonly mode: Schema.Literal<"local">;
285
+ }>, Schema.Struct<{
286
+ readonly mode: Schema.Literal<"provider">;
287
+ readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
288
+ }>]>>, never, never>;
289
+ readonly websocket: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
290
+ }> & {
291
+ default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
292
+ id: string & import("effect/Brand").Brand<"Model.ID">;
293
+ modelID: string & import("effect/Brand").Brand<"Model.ID">;
294
+ providerID: string & import("effect/Brand").Brand<"Provider.ID">;
295
+ name: string & import("effect/Brand").Brand<"Model.ID">;
296
+ capabilities: {
297
+ tools: true;
298
+ input: string[];
299
+ output: string[];
300
+ };
301
+ variants: never[];
302
+ time: {
303
+ released: number;
304
+ };
305
+ cost: never[];
306
+ status: "active";
307
+ enabled: true;
308
+ limit: {
309
+ context: number;
310
+ output: number;
311
+ };
312
+ };
313
+ }>;
314
+ }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never>, false>;
@@ -0,0 +1,33 @@
1
+ import { Model } from "@opencode/schema/model";
2
+ import { Location } from "@opencode/schema/location";
3
+ import { Schema } from "effect";
4
+ import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
5
+ import { ServiceUnavailableError } from "../errors.js";
6
+ import { LocationQuery, locationQueryOpenApi } from "./location.js";
7
+ export const ModelGroup = HttpApiGroup.make("server.model")
8
+ .add(HttpApiEndpoint.get("model.list", "/api/model", {
9
+ query: LocationQuery,
10
+ success: Location.response(Schema.Array(Model.Info)),
11
+ error: ServiceUnavailableError,
12
+ })
13
+ .annotateMerge(locationQueryOpenApi)
14
+ .annotateMerge(OpenApi.annotations({
15
+ identifier: "v2.model.list",
16
+ summary: "List models",
17
+ description: "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.",
18
+ })))
19
+ .add(HttpApiEndpoint.get("model.default", "/api/model/default", {
20
+ query: LocationQuery,
21
+ success: Location.response(Schema.UndefinedOr(Model.Info)),
22
+ error: ServiceUnavailableError,
23
+ })
24
+ .annotateMerge(locationQueryOpenApi)
25
+ .annotateMerge(OpenApi.annotations({
26
+ identifier: "v2.model.default",
27
+ summary: "Get default model",
28
+ description: "Retrieve the model used when a session has no explicit model selection.",
29
+ })))
30
+ .annotateMerge(OpenApi.annotations({
31
+ title: "model",
32
+ description: "Experimental model routes.",
33
+ }));
@@ -0,0 +1,167 @@
1
+ import { Location } from "@opencode/schema/location";
2
+ import { Context, Schema } from "effect";
3
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
4
+ import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
5
+ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(locationMiddleware: Context.Key<LocationId, LocationService>, sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>) => HttpApiGroup.HttpApiGroup<"server.permission", HttpApiEndpoint.HttpApiEndpoint<"permission.request.list", "GET", "/api/permission/request", never, Schema.toCodecStringTree<Schema.Struct<{
6
+ readonly location: Schema.optional<Schema.Struct<{
7
+ readonly directory: Schema.optional<Schema.String>;
8
+ readonly workspace: Schema.optional<Schema.String>;
9
+ }>>;
10
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
11
+ readonly location: typeof Location.Info;
12
+ readonly data: Schema.$Array<Schema.Struct<{
13
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
15
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
16
+ };
17
+ readonly action: Schema.String;
18
+ readonly resources: Schema.$Array<Schema.String>;
19
+ readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
20
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
21
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
22
+ readonly type: Schema.Literal<"tool">;
23
+ readonly messageID: Schema.String;
24
+ readonly id: Schema.String;
25
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
26
+ readonly type: Schema.Literal<"tool">;
27
+ readonly messageID: Schema.String;
28
+ readonly id: Schema.String;
29
+ }>]>>, never, never>;
30
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
31
+ readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
32
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
33
+ };
34
+ }>>;
35
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.list", "GET", "/api/permission/saved", never, Schema.toCodecStringTree<Schema.Struct<{
36
+ readonly projectID: Schema.optional<Schema.brand<Schema.String, "Project.ID"> & {
37
+ global: string & import("effect/Brand").Brand<"Project.ID">;
38
+ }>;
39
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
40
+ readonly data: Schema.$Array<Schema.Struct<{
41
+ readonly id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
42
+ create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
43
+ };
44
+ readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
45
+ global: string & import("effect/Brand").Brand<"Project.ID">;
46
+ };
47
+ readonly action: Schema.String;
48
+ readonly resource: Schema.String;
49
+ }>>;
50
+ }>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.remove", "DELETE", "/api/permission/saved/:id", Schema.toCodecStringTree<Schema.Struct<{
51
+ id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
52
+ create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
53
+ };
54
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.create", "POST", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
55
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
56
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
57
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
58
+ };
59
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
60
+ readonly id: Schema.optional<Schema.brand<Schema.String, "Permission.ID"> & {
61
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
62
+ }>;
63
+ readonly action: Schema.String;
64
+ readonly resources: Schema.$Array<Schema.String>;
65
+ readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
66
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
67
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
68
+ readonly type: Schema.Literal<"tool">;
69
+ readonly messageID: Schema.String;
70
+ readonly id: Schema.String;
71
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
72
+ readonly type: Schema.Literal<"tool">;
73
+ readonly messageID: Schema.String;
74
+ readonly id: Schema.String;
75
+ }>]>>, never, never>;
76
+ readonly agent: Schema.optional<Schema.brand<Schema.String, "Agent.ID">>;
77
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
78
+ readonly data: Schema.Struct<{
79
+ readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
80
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
81
+ };
82
+ readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
83
+ }>;
84
+ }>>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.list", "GET", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
85
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
86
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
87
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
88
+ };
89
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
90
+ readonly data: Schema.$Array<Schema.Struct<{
91
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
92
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
93
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
94
+ };
95
+ readonly action: Schema.String;
96
+ readonly resources: Schema.$Array<Schema.String>;
97
+ readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
98
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
99
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
100
+ readonly type: Schema.Literal<"tool">;
101
+ readonly messageID: Schema.String;
102
+ readonly id: Schema.String;
103
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
104
+ readonly type: Schema.Literal<"tool">;
105
+ readonly messageID: Schema.String;
106
+ readonly id: Schema.String;
107
+ }>]>>, never, never>;
108
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
109
+ readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
110
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
111
+ };
112
+ }>>;
113
+ }>>, Schema.toCodecJson<typeof SessionNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", Schema.toCodecStringTree<Schema.Struct<{
114
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
115
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
116
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
117
+ };
118
+ requestID: Schema.brand<Schema.String, "Permission.ID"> & {
119
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
120
+ };
121
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
122
+ readonly data: Schema.Struct<{
123
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
124
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
125
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
126
+ };
127
+ readonly action: Schema.String;
128
+ readonly resources: Schema.$Array<Schema.String>;
129
+ readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
130
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
131
+ readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
132
+ readonly type: Schema.Literal<"tool">;
133
+ readonly messageID: Schema.String;
134
+ readonly id: Schema.String;
135
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
136
+ readonly type: Schema.Literal<"tool">;
137
+ readonly messageID: Schema.String;
138
+ readonly id: Schema.String;
139
+ }>]>>, never, never>;
140
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
141
+ readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
142
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
143
+ };
144
+ }>;
145
+ }>>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.reply", "POST", "/api/session/:sessionID/permission/:requestID/reply", Schema.toCodecStringTree<Schema.Struct<{
146
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
147
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
148
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
149
+ };
150
+ requestID: Schema.brand<Schema.String, "Permission.ID"> & {
151
+ create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
152
+ };
153
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
154
+ readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
155
+ readonly message: Schema.optional<Schema.String>;
156
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.rules", "PUT", "/api/session/:sessionID/permission/rules", Schema.toCodecStringTree<Schema.Struct<{
157
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
158
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
159
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
160
+ };
161
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
162
+ readonly permissions: Schema.$Array<Schema.Struct<{
163
+ readonly action: Schema.String;
164
+ readonly resource: Schema.String;
165
+ readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
166
+ }>>;
167
+ }>>, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>>, false>;