@opencode/schema 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent.d.ts CHANGED
@@ -57,7 +57,20 @@ export declare const Info: Schema.Struct<{
57
57
  };
58
58
  }>, never, never>;
59
59
  readonly request: Schema.Struct<{
60
- readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Any>>;
60
+ readonly settings: Schema.withConstructorDefault<Schema.StructWithRest<Schema.Struct<{
61
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
62
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
63
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
64
+ readonly type: Schema.Literal<"summary">;
65
+ }>, Schema.Struct<{
66
+ readonly type: Schema.Literal<"native">;
67
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
68
+ readonly type: Schema.Literal<"summary">;
69
+ }>, Schema.Struct<{
70
+ readonly type: Schema.Literal<"native">;
71
+ }>]>>, never, never>;
72
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
73
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
61
74
  readonly headers: Schema.$Record<Schema.String, Schema.String>;
62
75
  readonly body: Schema.$Record<Schema.String, Schema.Any>;
63
76
  }>;
@@ -1,7 +1,60 @@
1
1
  export * as ConfigProvider from "./provider.js";
2
2
  import { Schema } from "effect";
3
+ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
4
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
5
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
6
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
7
+ readonly type: Schema.Literal<"summary">;
8
+ }>, Schema.Struct<{
9
+ readonly type: Schema.Literal<"native">;
10
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
11
+ readonly type: Schema.Literal<"summary">;
12
+ }>, Schema.Struct<{
13
+ readonly type: Schema.Literal<"native">;
14
+ }>]>>, never, never>;
15
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
16
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
17
+ export type Settings = typeof Settings.Type;
18
+ export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
19
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
20
+ readonly type: Schema.Literal<"summary">;
21
+ }>, Schema.Struct<{
22
+ readonly type: Schema.Literal<"native">;
23
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
24
+ readonly type: Schema.Literal<"summary">;
25
+ }>, Schema.Struct<{
26
+ readonly type: Schema.Literal<"native">;
27
+ }>]>>, never, never>;
28
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
29
+ export type ModelSettings = typeof ModelSettings.Type;
3
30
  export declare const Overlays: {
4
- settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
31
+ settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
32
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
33
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
34
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
35
+ readonly type: Schema.Literal<"summary">;
36
+ }>, Schema.Struct<{
37
+ readonly type: Schema.Literal<"native">;
38
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
39
+ readonly type: Schema.Literal<"summary">;
40
+ }>, Schema.Struct<{
41
+ readonly type: Schema.Literal<"native">;
42
+ }>]>>, never, never>;
43
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
44
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
45
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
46
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
47
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
48
+ readonly type: Schema.Literal<"summary">;
49
+ }>, Schema.Struct<{
50
+ readonly type: Schema.Literal<"native">;
51
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
52
+ readonly type: Schema.Literal<"summary">;
53
+ }>, Schema.Struct<{
54
+ readonly type: Schema.Literal<"native">;
55
+ }>]>>, never, never>;
56
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
57
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
5
58
  headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
6
59
  body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
7
60
  };
@@ -73,12 +126,52 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
73
126
  };
74
127
  }>, never, never>;
75
128
  readonly variants: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
76
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
129
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
130
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
131
+ readonly type: Schema.Literal<"summary">;
132
+ }>, Schema.Struct<{
133
+ readonly type: Schema.Literal<"native">;
134
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
135
+ readonly type: Schema.Literal<"summary">;
136
+ }>, Schema.Struct<{
137
+ readonly type: Schema.Literal<"native">;
138
+ }>]>>, never, never>;
139
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
140
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
141
+ readonly type: Schema.Literal<"summary">;
142
+ }>, Schema.Struct<{
143
+ readonly type: Schema.Literal<"native">;
144
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
145
+ readonly type: Schema.Literal<"summary">;
146
+ }>, Schema.Struct<{
147
+ readonly type: Schema.Literal<"native">;
148
+ }>]>>, never, never>;
149
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
77
150
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
78
151
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
79
152
  readonly id: Schema.brand<Schema.String, "Model.VariantID">;
80
153
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
81
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
154
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
155
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
156
+ readonly type: Schema.Literal<"summary">;
157
+ }>, Schema.Struct<{
158
+ readonly type: Schema.Literal<"native">;
159
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
160
+ readonly type: Schema.Literal<"summary">;
161
+ }>, Schema.Struct<{
162
+ readonly type: Schema.Literal<"native">;
163
+ }>]>>, never, never>;
164
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
165
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
166
+ readonly type: Schema.Literal<"summary">;
167
+ }>, Schema.Struct<{
168
+ readonly type: Schema.Literal<"native">;
169
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
170
+ readonly type: Schema.Literal<"summary">;
171
+ }>, Schema.Struct<{
172
+ readonly type: Schema.Literal<"native">;
173
+ }>]>>, never, never>;
174
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
82
175
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
83
176
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
84
177
  readonly id: Schema.brand<Schema.String, "Model.VariantID">;
@@ -86,21 +179,29 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
86
179
  readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [typeof Cost, Schema.$Array<typeof Cost>]>>>, Schema.optionalKey<Schema.Union<readonly [typeof Cost, Schema.$Array<typeof Cost>]>>, never, never>;
87
180
  readonly disabled: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
88
181
  readonly limit: Schema.decodeTo<Schema.optional<Schema.toType<typeof Limit>>, Schema.optionalKey<typeof Limit>, never, never>;
89
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
182
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
183
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
184
+ readonly type: Schema.Literal<"summary">;
185
+ }>, Schema.Struct<{
186
+ readonly type: Schema.Literal<"native">;
187
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
188
+ readonly type: Schema.Literal<"summary">;
189
+ }>, Schema.Struct<{
190
+ readonly type: Schema.Literal<"native">;
191
+ }>]>>, never, never>;
192
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
193
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
194
+ readonly type: Schema.Literal<"summary">;
195
+ }>, Schema.Struct<{
196
+ readonly type: Schema.Literal<"native">;
197
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
198
+ readonly type: Schema.Literal<"summary">;
199
+ }>, Schema.Struct<{
200
+ readonly type: Schema.Literal<"native">;
201
+ }>]>>, never, never>;
202
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
90
203
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
91
204
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
92
- readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
93
- readonly mode: Schema.Literal<"local">;
94
- }>, Schema.Struct<{
95
- readonly mode: Schema.Literal<"provider">;
96
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
97
- }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
98
- readonly mode: Schema.Literal<"local">;
99
- }>, Schema.Struct<{
100
- readonly mode: Schema.Literal<"provider">;
101
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
102
- }>]>>, never, never>;
103
- readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
104
205
  readonly modelID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.ID">>, never, never>;
105
206
  readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
106
207
  readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -125,21 +226,35 @@ declare class Model extends Model_base {
125
226
  }
126
227
  declare const Info_base: Schema.Class<Info, Schema.Struct<{
127
228
  readonly models: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, typeof Model>>>, Schema.optionalKey<Schema.$Record<Schema.String, typeof Model>>, never, never>;
128
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
229
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
230
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
231
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
232
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
233
+ readonly type: Schema.Literal<"summary">;
234
+ }>, Schema.Struct<{
235
+ readonly type: Schema.Literal<"native">;
236
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
237
+ readonly type: Schema.Literal<"summary">;
238
+ }>, Schema.Struct<{
239
+ readonly type: Schema.Literal<"native">;
240
+ }>]>>, never, never>;
241
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
242
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
243
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
244
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
245
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
246
+ readonly type: Schema.Literal<"summary">;
247
+ }>, Schema.Struct<{
248
+ readonly type: Schema.Literal<"native">;
249
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
250
+ readonly type: Schema.Literal<"summary">;
251
+ }>, Schema.Struct<{
252
+ readonly type: Schema.Literal<"native">;
253
+ }>]>>, never, never>;
254
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
255
+ }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
129
256
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
130
257
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
131
- readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
132
- readonly mode: Schema.Literal<"local">;
133
- }>, Schema.Struct<{
134
- readonly mode: Schema.Literal<"provider">;
135
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
136
- }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
137
- readonly mode: Schema.Literal<"local">;
138
- }>, Schema.Struct<{
139
- readonly mode: Schema.Literal<"provider">;
140
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
141
- }>]>>, never, never>;
142
- readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
143
258
  readonly canonical: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Provider.ID"> & {
144
259
  opencode: string & import("effect/Brand").Brand<"Provider.ID">;
145
260
  anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
@@ -4,9 +4,23 @@ import { Money } from "../money.js";
4
4
  import { Capabilities, Compatibility, Family, ID, VariantID } from "../model.js";
5
5
  import { Provider } from "../provider.js";
6
6
  import { optional } from "../schema.js";
7
+ export const Settings = Schema.StructWithRest(Schema.Struct({
8
+ timeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
9
+ chunkTimeout: Schema.Finite.pipe(optional),
10
+ compaction: Provider.Compaction.pipe(optional),
11
+ transport: Provider.Transport.pipe(optional),
12
+ }), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Provider.Settings" });
13
+ export const ModelSettings = Schema.StructWithRest(Schema.Struct({
14
+ compaction: Provider.Compaction.pipe(optional),
15
+ }), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Model.Settings" });
7
16
  const JsonRecord = Schema.Record(Schema.String, Schema.Json);
8
17
  export const Overlays = {
9
- settings: JsonRecord.pipe(optional),
18
+ settings: Settings.pipe(optional),
19
+ headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
20
+ body: JsonRecord.pipe(optional),
21
+ };
22
+ const ModelOverlays = {
23
+ settings: ModelSettings.pipe(optional),
10
24
  headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
11
25
  body: JsonRecord.pipe(optional),
12
26
  };
@@ -37,20 +51,16 @@ class Limit extends Schema.Class("Config.Model.Limit")({
37
51
  }) {
38
52
  }
39
53
  class Model extends Schema.Class("Config.Model")({
40
- compaction: Provider.Compaction.pipe(optional),
41
- transport: Provider.Transport.pipe(optional).annotate({
42
- description: "Session transport for this model. Defaults to the provider transport.",
43
- }),
44
54
  modelID: ID.pipe(optional),
45
55
  family: Family.pipe(optional),
46
56
  name: Schema.String.pipe(optional),
47
57
  compatibility: Compatibility.pipe(optional),
48
58
  package: Schema.String.pipe(optional),
49
- ...Overlays,
59
+ ...ModelOverlays,
50
60
  capabilities: Capabilities.pipe(optional),
51
61
  variants: Schema.Struct({
52
62
  id: VariantID,
53
- ...Overlays,
63
+ ...ModelOverlays,
54
64
  }).pipe(Schema.Array, optional),
55
65
  cost: Schema.Union([Cost, Cost.pipe(Schema.Array)]).pipe(optional),
56
66
  disabled: Schema.Boolean.pipe(optional),
@@ -58,10 +68,6 @@ class Model extends Schema.Class("Config.Model")({
58
68
  }) {
59
69
  }
60
70
  export class Info extends Schema.Class("Config.Provider")({
61
- compaction: Provider.Compaction.pipe(optional),
62
- transport: Provider.Transport.pipe(optional).annotate({
63
- description: "Session transport for this provider's models. Defaults to the built-in policy; \"websocket\" on a route without a WebSocket channel warns and falls back to HTTP.",
64
- }),
65
71
  canonical: Provider.ID.pipe(optional),
66
72
  name: Schema.String.pipe(optional),
67
73
  env: Schema.String.pipe(Schema.Array, optional),
package/dist/model.d.ts CHANGED
@@ -104,6 +104,43 @@ export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text
104
104
  export declare const ReasoningField: Schema.Codec<ReasoningField>;
105
105
  export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
106
106
  export type MaxTokensField = typeof MaxTokensField.Type;
107
+ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
108
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
109
+ readonly type: Schema.Literal<"summary">;
110
+ }>, Schema.Struct<{
111
+ readonly type: Schema.Literal<"native">;
112
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
113
+ readonly type: Schema.Literal<"summary">;
114
+ }>, Schema.Struct<{
115
+ readonly type: Schema.Literal<"native">;
116
+ }>]>>, never, never>;
117
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
118
+ export type Settings = typeof Settings.Type;
119
+ export declare const Overlays: {
120
+ settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
121
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
122
+ readonly type: Schema.Literal<"summary">;
123
+ }>, Schema.Struct<{
124
+ readonly type: Schema.Literal<"native">;
125
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
126
+ readonly type: Schema.Literal<"summary">;
127
+ }>, Schema.Struct<{
128
+ readonly type: Schema.Literal<"native">;
129
+ }>]>>, never, never>;
130
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
131
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
132
+ readonly type: Schema.Literal<"summary">;
133
+ }>, Schema.Struct<{
134
+ readonly type: Schema.Literal<"native">;
135
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
136
+ readonly type: Schema.Literal<"summary">;
137
+ }>, Schema.Struct<{
138
+ readonly type: Schema.Literal<"native">;
139
+ }>]>>, never, never>;
140
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
141
+ headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
142
+ body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
143
+ };
107
144
  export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
108
145
  }
109
146
  export declare const Compatibility: Schema.Struct<{
@@ -156,7 +193,27 @@ export declare const Cost: Schema.Struct<{
156
193
  export interface Variant extends Schema.Schema.Type<typeof Variant> {
157
194
  }
158
195
  export declare const Variant: Schema.Struct<{
159
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
196
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
197
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
198
+ readonly type: Schema.Literal<"summary">;
199
+ }>, Schema.Struct<{
200
+ readonly type: Schema.Literal<"native">;
201
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
202
+ readonly type: Schema.Literal<"summary">;
203
+ }>, Schema.Struct<{
204
+ readonly type: Schema.Literal<"native">;
205
+ }>]>>, never, never>;
206
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
207
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
208
+ readonly type: Schema.Literal<"summary">;
209
+ }>, Schema.Struct<{
210
+ readonly type: Schema.Literal<"native">;
211
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
212
+ readonly type: Schema.Literal<"summary">;
213
+ }>, Schema.Struct<{
214
+ readonly type: Schema.Literal<"native">;
215
+ }>]>>, never, never>;
216
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
160
217
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
161
218
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
162
219
  readonly id: Schema.brand<Schema.String, "Model.VariantID">;
@@ -176,7 +233,27 @@ export declare const Info: Schema.Struct<{
176
233
  };
177
234
  };
178
235
  readonly variants: Schema.$Array<Schema.Struct<{
179
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
236
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
237
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
238
+ readonly type: Schema.Literal<"summary">;
239
+ }>, Schema.Struct<{
240
+ readonly type: Schema.Literal<"native">;
241
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
242
+ readonly type: Schema.Literal<"summary">;
243
+ }>, Schema.Struct<{
244
+ readonly type: Schema.Literal<"native">;
245
+ }>]>>, never, never>;
246
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
247
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
248
+ readonly type: Schema.Literal<"summary">;
249
+ }>, Schema.Struct<{
250
+ readonly type: Schema.Literal<"native">;
251
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
252
+ readonly type: Schema.Literal<"summary">;
253
+ }>, Schema.Struct<{
254
+ readonly type: Schema.Literal<"native">;
255
+ }>]>>, never, never>;
256
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
180
257
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
181
258
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
182
259
  readonly id: Schema.brand<Schema.String, "Model.VariantID">;
@@ -214,7 +291,27 @@ export declare const Info: Schema.Struct<{
214
291
  readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
215
292
  readonly output: Schema.Int;
216
293
  }>;
217
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
294
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
295
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
296
+ readonly type: Schema.Literal<"summary">;
297
+ }>, Schema.Struct<{
298
+ readonly type: Schema.Literal<"native">;
299
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
300
+ readonly type: Schema.Literal<"summary">;
301
+ }>, Schema.Struct<{
302
+ readonly type: Schema.Literal<"native">;
303
+ }>]>>, never, never>;
304
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
305
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
306
+ readonly type: Schema.Literal<"summary">;
307
+ }>, Schema.Struct<{
308
+ readonly type: Schema.Literal<"native">;
309
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
310
+ readonly type: Schema.Literal<"summary">;
311
+ }>, Schema.Struct<{
312
+ readonly type: Schema.Literal<"native">;
313
+ }>]>>, never, never>;
314
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
218
315
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
219
316
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
220
317
  readonly id: Schema.brand<Schema.String, "Model.ID">;
@@ -277,19 +374,6 @@ export declare const Info: Schema.Struct<{
277
374
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
278
375
  }>>, never, never>;
279
376
  readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
280
- readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
281
- readonly mode: Schema.Literal<"local">;
282
- }>, Schema.Struct<{
283
- readonly mode: Schema.Literal<"provider">;
284
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
285
- }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
286
- readonly mode: Schema.Literal<"local">;
287
- }>, Schema.Struct<{
288
- readonly mode: Schema.Literal<"provider">;
289
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
290
- }>]>>, never, never>;
291
- /** Session transport; omitted inherits the provider transport, then defaults to HTTP. */
292
- readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
293
377
  }> & {
294
378
  default: (providerID: Provider.ID, id: ID) => {
295
379
  id: string & import("effect/Brand").Brand<"Model.ID">;
package/dist/model.js CHANGED
@@ -40,6 +40,16 @@ export const ReasoningField = Schema.Union([
40
40
  export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
41
41
  identifier: "Model.MaxTokensField",
42
42
  });
43
+ export const Settings = Schema.StructWithRest(Schema.Struct({
44
+ compaction: Provider.Compaction.pipe(optional),
45
+ }),
46
+ // Provider packages may define arbitrary model-level options beyond OpenCode's shared compaction policy.
47
+ [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Model.Settings" });
48
+ export const Overlays = {
49
+ settings: Settings.pipe(optional),
50
+ headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
51
+ body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
52
+ };
43
53
  export const Compatibility = Schema.Struct({
44
54
  reasoningField: ReasoningField.pipe(optional),
45
55
  /** Require every assistant message to include its reasoning field, even when empty. */
@@ -72,7 +82,7 @@ export const Cost = Schema.Struct({
72
82
  }).annotate({ identifier: "Model.Cost" });
73
83
  export const Variant = Schema.Struct({
74
84
  id: VariantID,
75
- ...Provider.Overlays,
85
+ ...Overlays,
76
86
  }).annotate({ identifier: "Model.Variant" });
77
87
  export const Info = Schema.Struct({
78
88
  id: ID,
@@ -83,10 +93,7 @@ export const Info = Schema.Struct({
83
93
  name: Schema.String,
84
94
  compatibility: Compatibility.pipe(optional),
85
95
  package: Provider.Package.pipe(optional),
86
- compaction: Provider.Compaction.pipe(optional),
87
- /** Session transport; omitted inherits the provider transport, then defaults to HTTP. */
88
- transport: Provider.Transport.pipe(optional),
89
- ...Provider.Overlays,
96
+ ...Overlays,
90
97
  capabilities: Capabilities,
91
98
  variants: Schema.Array(Variant),
92
99
  time: Schema.Struct({
@@ -86,34 +86,111 @@ export declare const Package: Schema.String;
86
86
  export type Package = typeof Package.Type;
87
87
  export declare const Activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
88
88
  export type Activation = typeof Activation.Type;
89
- export type Compaction = typeof Compaction.Type;
90
89
  export declare const Compaction: Schema.Union<readonly [Schema.Struct<{
91
- readonly mode: Schema.Literal<"local">;
90
+ readonly type: Schema.Literal<"summary">;
92
91
  }>, Schema.Struct<{
93
- readonly mode: Schema.Literal<"provider">;
94
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
92
+ readonly type: Schema.Literal<"native">;
95
93
  }>]>;
94
+ export type Compaction = typeof Compaction.Type;
96
95
  /** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
97
96
  export declare const Transport: Schema.Literals<readonly ["http", "websocket"]>;
98
97
  export type Transport = typeof Transport.Type;
98
+ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
99
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
100
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
101
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
102
+ readonly type: Schema.Literal<"summary">;
103
+ }>, Schema.Struct<{
104
+ readonly type: Schema.Literal<"native">;
105
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
106
+ readonly type: Schema.Literal<"summary">;
107
+ }>, Schema.Struct<{
108
+ readonly type: Schema.Literal<"native">;
109
+ }>]>>, never, never>;
110
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
111
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
112
+ export type Settings = typeof Settings.Type;
99
113
  export declare const Overlays: {
100
- settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
114
+ settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
115
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
116
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
117
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
118
+ readonly type: Schema.Literal<"summary">;
119
+ }>, Schema.Struct<{
120
+ readonly type: Schema.Literal<"native">;
121
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
122
+ readonly type: Schema.Literal<"summary">;
123
+ }>, Schema.Struct<{
124
+ readonly type: Schema.Literal<"native">;
125
+ }>]>>, never, never>;
126
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
127
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
128
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
129
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
130
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
131
+ readonly type: Schema.Literal<"summary">;
132
+ }>, Schema.Struct<{
133
+ readonly type: Schema.Literal<"native">;
134
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
135
+ readonly type: Schema.Literal<"summary">;
136
+ }>, Schema.Struct<{
137
+ readonly type: Schema.Literal<"native">;
138
+ }>]>>, never, never>;
139
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
140
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
101
141
  headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
102
142
  body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
103
143
  };
104
- export declare const Settings: Schema.$Record<Schema.String, Schema.Any>;
105
- export type Settings = typeof Settings.Type;
106
144
  export interface Request extends Schema.Schema.Type<typeof Request> {
107
145
  }
108
146
  export declare const Request: Schema.Struct<{
109
- readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Any>>;
147
+ readonly settings: Schema.withConstructorDefault<Schema.StructWithRest<Schema.Struct<{
148
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
149
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
150
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
151
+ readonly type: Schema.Literal<"summary">;
152
+ }>, Schema.Struct<{
153
+ readonly type: Schema.Literal<"native">;
154
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
155
+ readonly type: Schema.Literal<"summary">;
156
+ }>, Schema.Struct<{
157
+ readonly type: Schema.Literal<"native">;
158
+ }>]>>, never, never>;
159
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
160
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
110
161
  readonly headers: Schema.$Record<Schema.String, Schema.String>;
111
162
  readonly body: Schema.$Record<Schema.String, Schema.Any>;
112
163
  }>;
113
164
  export interface Info extends Schema.Schema.Type<typeof Info> {
114
165
  }
115
166
  export declare const Info: Schema.Struct<{
116
- readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
167
+ readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
168
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
169
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
170
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
171
+ readonly type: Schema.Literal<"summary">;
172
+ }>, Schema.Struct<{
173
+ readonly type: Schema.Literal<"native">;
174
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
175
+ readonly type: Schema.Literal<"summary">;
176
+ }>, Schema.Struct<{
177
+ readonly type: Schema.Literal<"native">;
178
+ }>]>>, never, never>;
179
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
180
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
181
+ readonly timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.Literal<false>]>>, never, never>;
182
+ readonly chunkTimeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
183
+ readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
184
+ readonly type: Schema.Literal<"summary">;
185
+ }>, Schema.Struct<{
186
+ readonly type: Schema.Literal<"native">;
187
+ }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
188
+ readonly type: Schema.Literal<"summary">;
189
+ }>, Schema.Struct<{
190
+ readonly type: Schema.Literal<"native">;
191
+ }>]>>, never, never>;
192
+ readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
193
+ }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
117
194
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
118
195
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
119
196
  readonly id: Schema.brand<Schema.String, "Provider.ID"> & {
@@ -158,19 +235,6 @@ export declare const Info: Schema.Struct<{
158
235
  readonly name: Schema.String;
159
236
  readonly activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
160
237
  readonly package: Schema.String;
161
- readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
162
- readonly mode: Schema.Literal<"local">;
163
- }>, Schema.Struct<{
164
- readonly mode: Schema.Literal<"provider">;
165
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
166
- }>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
167
- readonly mode: Schema.Literal<"local">;
168
- }>, Schema.Struct<{
169
- readonly mode: Schema.Literal<"provider">;
170
- readonly threshold: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
171
- }>]>>, never, never>;
172
- /** Session transport for this provider's models; omitted means HTTP. */
173
- readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
174
238
  }> & {
175
239
  empty: (id: ID) => Info;
176
240
  };
package/dist/provider.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export * as Provider from "./provider.js";
2
2
  import { Effect, Schema } from "effect";
3
3
  import { Integration } from "./integration.js";
4
- import { optional, PositiveInt, statics } from "./schema.js";
4
+ import { optional, statics } from "./schema.js";
5
5
  import { ephemeral, inventory } from "./event.js";
6
6
  export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), statics((schema) => ({
7
7
  opencode: schema.make("opencode"),
@@ -21,17 +21,24 @@ export const Event = { Updated, Definitions: inventory(Updated) };
21
21
  export const Package = Schema.String;
22
22
  export const Activation = Schema.Literals(["auto", "enabled", "disabled"]);
23
23
  export const Compaction = Schema.Union([
24
- Schema.Struct({ mode: Schema.Literal("local") }),
25
- Schema.Struct({ mode: Schema.Literal("provider"), threshold: PositiveInt.pipe(optional) }),
26
- ]).annotate({ identifier: "Provider.Compaction" });
24
+ Schema.Struct({ type: Schema.Literal("summary") }),
25
+ Schema.Struct({ type: Schema.Literal("native") }),
26
+ ])
27
+ .pipe(Schema.toTaggedUnion("type"))
28
+ .annotate({ identifier: "Provider.Compaction" });
27
29
  /** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
28
30
  export const Transport = Schema.Literals(["http", "websocket"]).annotate({ identifier: "Provider.Transport" });
31
+ export const Settings = Schema.StructWithRest(Schema.Struct({
32
+ timeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
33
+ chunkTimeout: Schema.Finite.pipe(optional),
34
+ compaction: Compaction.pipe(optional),
35
+ transport: Transport.pipe(optional),
36
+ }), [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Provider.Settings" });
29
37
  export const Overlays = {
30
- settings: Schema.Record(Schema.String, Schema.Any).pipe(optional),
38
+ settings: Settings.pipe(optional),
31
39
  headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
32
40
  body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
33
41
  };
34
- export const Settings = Schema.Record(Schema.String, Schema.Any).annotate({ identifier: "Provider.Settings" });
35
42
  export const Request = Schema.Struct({
36
43
  settings: Settings.pipe(Schema.withConstructorDefault(Effect.succeed({}))),
37
44
  headers: Schema.Record(Schema.String, Schema.String),
@@ -44,9 +51,6 @@ export const Info = Schema.Struct({
44
51
  name: Schema.String,
45
52
  activation: Activation,
46
53
  package: Package,
47
- compaction: Compaction.pipe(optional),
48
- /** Session transport for this provider's models; omitted means HTTP. */
49
- transport: Transport.pipe(optional),
50
54
  ...Overlays,
51
55
  })
52
56
  .annotate({ identifier: "Provider.Info" })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "2.0.8",
4
+ "version": "2.0.10",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {