@opencode/schema 2.0.26 → 2.0.28

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
@@ -71,6 +71,7 @@ export declare const Info: Schema.Struct<{
71
71
  readonly type: Schema.Literal<"native">;
72
72
  }>]>>, never, never>;
73
73
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
74
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
74
75
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
75
76
  readonly headers: Schema.$Record<Schema.String, Schema.String>;
76
77
  readonly body: Schema.$Record<Schema.String, Schema.Any>;
package/dist/agent.js CHANGED
@@ -7,7 +7,7 @@ import { Permission } from "./permission.js";
7
7
  import { Provider } from "./provider.js";
8
8
  import { PositiveInt, statics } from "./schema.js";
9
9
  const Updated = ephemeral({ type: "agent.updated", schema: {} });
10
- export const ID = Schema.String.pipe(Schema.brand("Agent.ID"));
10
+ export const ID = Schema.String.pipe(Schema.brand("Agent.ID"), Schema.annotate({ identifier: "Agent.ID" }));
11
11
  export const Name = Schema.String.pipe(Schema.brand("Agent.Name"));
12
12
  export const Color = Schema.String.annotate({ identifier: "Agent.Color" });
13
13
  export const Info = Schema.Struct({
@@ -4,7 +4,7 @@ import { Permission } from "../permission.js";
4
4
  import { optional, PositiveInt } from "../schema.js";
5
5
  import { ConfigModel } from "./model.js";
6
6
  import { ConfigProvider } from "./provider.js";
7
- export const Color = Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/));
7
+ export const Color = Schema.String.check(Schema.isPattern(/^#[0-9a-fA-F]{6}$/u));
8
8
  export class Info extends Schema.Class("Config.Agent")({
9
9
  model: ConfigModel.Selection.pipe(optional),
10
10
  request: ConfigProvider.Request.pipe(optional),
@@ -3,15 +3,15 @@ import { Schema, SchemaGetter } from "effect";
3
3
  import { Model } from "../model.js";
4
4
  import { Provider } from "../provider.js";
5
5
  import { optional } from "../schema.js";
6
- const ProviderID = Provider.ID.check(Schema.isPattern(/^[^/#]+$/));
7
- const ModelID = Model.ID.check(Schema.isPattern(/^[^#]+$/));
8
- const VariantID = Model.VariantID.check(Schema.isPattern(/^[^#]+$/));
6
+ const ProviderID = Provider.ID.check(Schema.isPattern(/^[^/#]+$/u));
7
+ const ModelID = Model.ID.check(Schema.isPattern(/^[^#]+$/u));
8
+ const VariantID = Model.VariantID.check(Schema.isPattern(/^[^#]+$/u));
9
9
  const Explicit = Schema.Struct({
10
10
  providerID: ProviderID,
11
11
  model: ModelID,
12
12
  variant: VariantID.pipe(optional),
13
13
  });
14
- const Short = Schema.String.check(Schema.isPattern(/^[^/#]+\/[^#]+(?:#[^#]+)?$/));
14
+ const Short = Schema.String.check(Schema.isPattern(/^[^/#]+\/[^#]+(?:#[^#]+)?$/u));
15
15
  export const Selection = Schema.Union([Short, Explicit])
16
16
  .pipe(Schema.decodeTo(Explicit, {
17
17
  decode: SchemaGetter.transform((input) => (typeof input === "string" ? parse(input) : input)),
@@ -14,6 +14,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
14
14
  readonly type: Schema.Literal<"native">;
15
15
  }>]>>, never, never>;
16
16
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
17
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
17
18
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
18
19
  export type Settings = typeof Settings.Type;
19
20
  export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
@@ -26,6 +27,7 @@ export declare const ModelSettings: Schema.StructWithRest<Schema.Struct<{
26
27
  }>, Schema.Struct<{
27
28
  readonly type: Schema.Literal<"native">;
28
29
  }>]>>, never, never>;
30
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
29
31
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>;
30
32
  export type ModelSettings = typeof ModelSettings.Type;
31
33
  export declare const Overlays: {
@@ -43,6 +45,7 @@ export declare const Overlays: {
43
45
  readonly type: Schema.Literal<"native">;
44
46
  }>]>>, never, never>;
45
47
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
48
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
46
49
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
47
50
  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>;
48
51
  readonly headerTimeout: 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>;
@@ -57,6 +60,7 @@ export declare const Overlays: {
57
60
  readonly type: Schema.Literal<"native">;
58
61
  }>]>>, never, never>;
59
62
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
63
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
60
64
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
61
65
  headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
62
66
  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>;
@@ -127,6 +131,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
127
131
  }>, Schema.Struct<{
128
132
  readonly type: Schema.Literal<"native">;
129
133
  }>]>>, never, never>;
134
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
130
135
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
131
136
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
132
137
  readonly type: Schema.Literal<"summary">;
@@ -137,6 +142,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
137
142
  }>, Schema.Struct<{
138
143
  readonly type: Schema.Literal<"native">;
139
144
  }>]>>, never, never>;
145
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
140
146
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
141
147
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
142
148
  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>;
@@ -152,6 +158,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
152
158
  }>, Schema.Struct<{
153
159
  readonly type: Schema.Literal<"native">;
154
160
  }>]>>, never, never>;
161
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
155
162
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
156
163
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
157
164
  readonly type: Schema.Literal<"summary">;
@@ -162,6 +169,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
162
169
  }>, Schema.Struct<{
163
170
  readonly type: Schema.Literal<"native">;
164
171
  }>]>>, never, never>;
172
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
165
173
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
166
174
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
167
175
  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>;
@@ -180,6 +188,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
180
188
  }>, Schema.Struct<{
181
189
  readonly type: Schema.Literal<"native">;
182
190
  }>]>>, never, never>;
191
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
183
192
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
184
193
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
185
194
  readonly type: Schema.Literal<"summary">;
@@ -190,6 +199,7 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
190
199
  }>, Schema.Struct<{
191
200
  readonly type: Schema.Literal<"native">;
192
201
  }>]>>, never, never>;
202
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
193
203
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
194
204
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
195
205
  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>;
@@ -197,21 +207,23 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
197
207
  readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
198
208
  readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
199
209
  readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
200
- readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>, never, never>;
210
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
201
211
  readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
202
212
  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>;
203
213
  readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
204
214
  readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
205
215
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
216
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
206
217
  readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
207
218
  readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
208
219
  }>>>, Schema.optionalKey<Schema.Struct<{
209
- readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model.js").ReasoningField, import("../model.js").ReasoningField, never, never>>, never, never>;
220
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
210
221
  readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
211
222
  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>;
212
223
  readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
213
224
  readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
214
225
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
226
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
215
227
  readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
216
228
  readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
217
229
  }>>, never, never>;
@@ -235,6 +247,7 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
235
247
  readonly type: Schema.Literal<"native">;
236
248
  }>]>>, never, never>;
237
249
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
250
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
238
251
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
239
252
  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>;
240
253
  readonly headerTimeout: 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>;
@@ -249,6 +262,7 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
249
262
  readonly type: Schema.Literal<"native">;
250
263
  }>]>>, never, never>;
251
264
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
265
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
252
266
  }>, readonly [Schema.$Record<Schema.String, Schema.UndefinedOr<Schema.Codec<Schema.Json, Schema.Json, never, never>>>]>>, never, never>;
253
267
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
254
268
  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>;
@@ -280,6 +294,23 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
280
294
  readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
281
295
  readonly env: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
282
296
  readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
297
+ readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
298
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
299
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
300
+ 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>;
301
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
302
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
303
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
304
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
305
+ }>>>, Schema.optionalKey<Schema.Struct<{
306
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("../model-compatibility.js").ReasoningField, import("../model-compatibility.js").ReasoningField, never, never>>, never, never>;
307
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
308
+ 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>;
309
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
310
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
311
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
312
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
313
+ }>>, never, never>;
283
314
  }>, {}>;
284
315
  export declare class Info extends Info_base {
285
316
  }
@@ -2,6 +2,7 @@ export * as ConfigProvider from "./provider.js";
2
2
  import { Schema } from "effect";
3
3
  import { Money } from "../money.js";
4
4
  import { Capabilities, Compatibility, Family, ID, VariantID } from "../model.js";
5
+ import { ProviderCompatibility } from "../model-compatibility.js";
5
6
  import { Provider } from "../provider.js";
6
7
  import { optional } from "../schema.js";
7
8
  export const Settings = Schema.StructWithRest(Schema.Struct({
@@ -10,9 +11,11 @@ export const Settings = Schema.StructWithRest(Schema.Struct({
10
11
  chunkTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
11
12
  compaction: Provider.Compaction.pipe(optional),
12
13
  transport: Provider.Transport.pipe(optional),
14
+ encoding: Provider.Encoding.pipe(optional),
13
15
  }), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Provider.Settings" });
14
16
  export const ModelSettings = Schema.StructWithRest(Schema.Struct({
15
17
  compaction: Provider.Compaction.pipe(optional),
18
+ encoding: Provider.Encoding.pipe(optional),
16
19
  }), [Schema.Record(Schema.String, Schema.UndefinedOr(Schema.Json))]).annotate({ identifier: "Config.Model.Settings" });
17
20
  const JsonRecord = Schema.Record(Schema.String, Schema.Json);
18
21
  export const Overlays = {
@@ -80,6 +83,8 @@ export class Info extends Schema.Class("Config.Provider")({
80
83
  name: Schema.String.pipe(optional),
81
84
  env: Schema.String.pipe(Schema.Array, optional),
82
85
  package: Schema.String.pipe(optional),
86
+ // Defaults for every model of this provider; model compatibility overrides individual fields.
87
+ compatibility: ProviderCompatibility.pipe(optional),
83
88
  ...Overlays,
84
89
  models: Schema.Record(Schema.String, Model).pipe(optional),
85
90
  }) {
@@ -6,7 +6,7 @@ import { IntegrationID, IntegrationMethodID } from "./integration-id.js";
6
6
  import { ascending } from "./identifier.js";
7
7
  import { NonNegativeInt, statics } from "./schema.js";
8
8
  import { Form } from "./form.js";
9
- export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
9
+ export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), Schema.annotate({ identifier: "Credential.ID" }), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
10
10
  const Updated = ephemeral({
11
11
  type: "credential.updated",
12
12
  schema: {},
@@ -4715,6 +4715,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
4715
4715
  readonly created: Schema.Int;
4716
4716
  readonly updated: Schema.Int;
4717
4717
  readonly active: Schema.Int;
4718
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
4718
4719
  }>;
4719
4720
  readonly sandboxes: Schema.$Array<Schema.String>;
4720
4721
  }>;
@@ -4747,6 +4748,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
4747
4748
  readonly created: Schema.Int;
4748
4749
  readonly updated: Schema.Int;
4749
4750
  readonly active: Schema.Int;
4751
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
4750
4752
  }>;
4751
4753
  readonly sandboxes: Schema.$Array<Schema.String>;
4752
4754
  }>;
@@ -11123,6 +11125,7 @@ export declare const Definitions: readonly [Schema.Struct<{
11123
11125
  readonly created: Schema.Int;
11124
11126
  readonly updated: Schema.Int;
11125
11127
  readonly active: Schema.Int;
11128
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
11126
11129
  }>;
11127
11130
  readonly sandboxes: Schema.$Array<Schema.String>;
11128
11131
  }>;
@@ -11155,6 +11158,7 @@ export declare const Definitions: readonly [Schema.Struct<{
11155
11158
  readonly created: Schema.Int;
11156
11159
  readonly updated: Schema.Int;
11157
11160
  readonly active: Schema.Int;
11161
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
11158
11162
  }>;
11159
11163
  readonly sandboxes: Schema.$Array<Schema.String>;
11160
11164
  }>;
package/dist/event.js CHANGED
@@ -4,15 +4,15 @@ import { optional } from "./schema.js";
4
4
  import { ascending } from "./identifier.js";
5
5
  import { Location } from "./location.js";
6
6
  import { statics } from "./schema.js";
7
- export const ID = Schema.String.check(Schema.isStartsWith("evt_")).pipe(Schema.brand("Event.ID"), statics((schema) => ({ create: () => schema.make("evt_" + ascending()) })));
7
+ export const ID = Schema.String.check(Schema.isStartingWith("evt_")).pipe(Schema.brand("Event.ID"), Schema.annotate({ identifier: "Event.ID" }), statics((schema) => ({ create: () => schema.make("evt_" + ascending()) })));
8
8
  /**
9
9
  * Position in one aggregate's durable log. Values originate from the durable
10
10
  * event envelope and synced markers;
11
11
  * `after` cursors accept only values that came from those sources.
12
12
  */
13
- export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"));
13
+ export const Seq = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand("Event.Seq"), Schema.annotate({ identifier: "Event.Seq" }));
14
14
  /** Durable schema version of one event type, from the event definition that committed it. */
15
- export const Version = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("Event.Version"));
15
+ export const Version = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)).pipe(Schema.brand("Event.Version"), Schema.annotate({ identifier: "Event.Version" }));
16
16
  const DurableEnvelope = Schema.Struct({ aggregateID: Schema.String, seq: Seq, version: Version });
17
17
  export function durable(input) {
18
18
  const data = Schema.Struct(input.schema);
package/dist/form.js CHANGED
@@ -3,7 +3,7 @@ import { Schema } from "effect";
3
3
  import { ephemeral, inventory } from "./event.js";
4
4
  import { ascending } from "./identifier.js";
5
5
  import { NonNegativeInt, optional, statics } from "./schema.js";
6
- const IDSchema = Schema.String.check(Schema.isStartsWith("frm_")).pipe(Schema.brand("Form.ID"));
6
+ const IDSchema = Schema.String.check(Schema.isStartingWith("frm_")).pipe(Schema.brand("Form.ID"), Schema.annotate({ identifier: "Form.ID" }));
7
7
  export const ID = IDSchema.pipe(statics((schema) => ({ create: (id) => schema.make(id ?? "frm_" + ascending()) })));
8
8
  export const Metadata = Schema.Record(Schema.String, Schema.Unknown).annotate({ identifier: "Form.Metadata" });
9
9
  export const Option = Schema.Struct({
@@ -5,7 +5,7 @@ import { Schema } from "effect";
5
5
  * derives the namespaced Instructions key as `api/<key>`, keeping the
6
6
  * `api/*` namespace enforced by construction.
7
7
  */
8
- export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*$/)).annotate({
8
+ export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*$/u)).annotate({
9
9
  identifier: "InstructionEntry.Key",
10
10
  description: "Instruction entry key (lowercase alphanumerics plus . _ -)",
11
11
  });
@@ -1,7 +1,7 @@
1
1
  export * as Instruction from "./instruction.js";
2
2
  import { Schema } from "effect";
3
- export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._/-]*$/)).pipe(Schema.brand("Instruction.Key"));
4
- export const Hash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/)).pipe(Schema.brand("Instruction.Hash"));
3
+ export const Key = Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._/-]*$/u)).pipe(Schema.brand("Instruction.Key"), Schema.annotate({ identifier: "Instruction.Key" }));
4
+ export const Hash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u)).pipe(Schema.brand("Instruction.Hash"), Schema.annotate({ identifier: "Instruction.Hash" }));
5
5
  export const Values = Schema.Record(Key, Hash);
6
6
  export const Removed = Schema.Literal("removed");
7
7
  export const removed = Removed.make("removed");
@@ -1,3 +1,3 @@
1
1
  import { Schema } from "effect";
2
- export const IntegrationID = Schema.String.pipe(Schema.brand("Integration.ID"));
3
- export const IntegrationMethodID = Schema.String.pipe(Schema.brand("Integration.MethodID"));
2
+ export const IntegrationID = Schema.String.pipe(Schema.brand("Integration.ID"), Schema.annotate({ identifier: "Integration.ID" }));
3
+ export const IntegrationMethodID = Schema.String.pipe(Schema.brand("Integration.MethodID"), Schema.annotate({ identifier: "Integration.MethodID" }));
@@ -56,7 +56,7 @@ export const Info = Schema.Struct({
56
56
  methods: Schema.Array(Method),
57
57
  connections: Schema.Array(Connection.Info),
58
58
  }).annotate({ identifier: "Integration.Info" });
59
- export const AttemptID = Schema.String.pipe(Schema.brand("Integration.AttemptID"), statics((schema) => ({ create: () => schema.make("con_" + ascending()) })));
59
+ export const AttemptID = Schema.String.pipe(Schema.brand("Integration.AttemptID"), Schema.annotate({ identifier: "Integration.AttemptID" }), statics((schema) => ({ create: () => schema.make("con_" + ascending()) })));
60
60
  const AttemptTime = Schema.Struct({
61
61
  created: Schema.Number,
62
62
  expires: Schema.Number,
@@ -0,0 +1,35 @@
1
+ import { Schema } from "effect";
2
+ export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
3
+ export declare const ReasoningField: Schema.Codec<ReasoningField>;
4
+ export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
5
+ export type MaxTokensField = typeof MaxTokensField.Type;
6
+ export declare const CacheFormat: Schema.Literals<readonly ["anthropic", "alibaba"]>;
7
+ export type CacheFormat = typeof CacheFormat.Type;
8
+ export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
9
+ }
10
+ export declare const Compatibility: Schema.Struct<{
11
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
12
+ /** Require every assistant message to include its reasoning field, even when empty. */
13
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
14
+ 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>;
15
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
16
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
17
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
18
+ /** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
19
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
20
+ /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
21
+ readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
22
+ /** Supports per-message effort updates. Overrides model-ID detection. */
23
+ readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
24
+ }>;
25
+ export interface ProviderCompatibility extends Schema.Schema.Type<typeof ProviderCompatibility> {
26
+ }
27
+ export declare const ProviderCompatibility: Schema.Struct<{
28
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
29
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
30
+ 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>;
31
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
32
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
33
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
34
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
35
+ }>;
@@ -0,0 +1,26 @@
1
+ import { Schema, Struct } from "effect";
2
+ import { optional } from "./schema.js";
3
+ export const ReasoningField = Schema.Union([
4
+ Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
5
+ Schema.String,
6
+ ]).annotate({ identifier: "Model.ReasoningField" });
7
+ export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
8
+ identifier: "Model.MaxTokensField",
9
+ });
10
+ export const CacheFormat = Schema.Literals(["anthropic", "alibaba"]).annotate({ identifier: "Model.CacheFormat" });
11
+ export const Compatibility = Schema.Struct({
12
+ reasoningField: ReasoningField.pipe(optional),
13
+ /** Require every assistant message to include its reasoning field, even when empty. */
14
+ requireReasoning: Schema.Boolean.pipe(optional),
15
+ maxTokensField: MaxTokensField.pipe(optional),
16
+ requireFinishReason: Schema.Boolean.pipe(optional),
17
+ requireAssistantAfterTool: Schema.Boolean.pipe(optional),
18
+ supportsPromptCacheKey: Schema.Boolean.pipe(optional),
19
+ /** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
20
+ cacheFormat: CacheFormat.pipe(optional),
21
+ /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
22
+ supportsThinkingBlockBinding: Schema.Boolean.pipe(optional),
23
+ /** Supports per-message effort updates. Overrides model-ID detection. */
24
+ supportsEffortUpdates: Schema.Boolean.pipe(optional),
25
+ }).annotate({ identifier: "Model.Compatibility" });
26
+ export const ProviderCompatibility = Schema.Struct(Struct.omit(Compatibility.fields, ["supportsThinkingBlockBinding", "supportsEffortUpdates"])).annotate({ identifier: "Provider.Compatibility" });
package/dist/model.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * as Model from "./model.js";
2
2
  import { Schema } from "effect";
3
3
  import { Provider } from "./provider.js";
4
+ import { Compatibility, MaxTokensField, ReasoningField } from "./model-compatibility.js";
4
5
  export declare const ID: Schema.brand<Schema.String, "Model.ID">;
5
6
  export type ID = typeof ID.Type;
6
7
  export declare const Event: {
@@ -98,12 +99,9 @@ export declare const Ref: Schema.Struct<{
98
99
  };
99
100
  export interface Ref extends Schema.Schema.Type<typeof Ref> {
100
101
  }
102
+ export { Compatibility, MaxTokensField, ReasoningField };
101
103
  export declare const Family: Schema.brand<Schema.String, "Model.Family">;
102
104
  export type Family = typeof Family.Type;
103
- export type ReasoningField = "reasoning" | "reasoning_content" | "reasoning_text" | (string & {});
104
- export declare const ReasoningField: Schema.Codec<ReasoningField>;
105
- export declare const MaxTokensField: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
106
- export type MaxTokensField = typeof MaxTokensField.Type;
107
105
  export declare const Settings: Schema.StructWithRest<Schema.Struct<{
108
106
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
109
107
  readonly type: Schema.Literal<"summary">;
@@ -114,6 +112,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
114
112
  }>, Schema.Struct<{
115
113
  readonly type: Schema.Literal<"native">;
116
114
  }>]>>, never, never>;
115
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
117
116
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
118
117
  export type Settings = typeof Settings.Type;
119
118
  export declare const Overlays: {
@@ -127,6 +126,7 @@ export declare const Overlays: {
127
126
  }>, Schema.Struct<{
128
127
  readonly type: Schema.Literal<"native">;
129
128
  }>]>>, never, never>;
129
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
130
130
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
131
131
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
132
132
  readonly type: Schema.Literal<"summary">;
@@ -137,25 +137,11 @@ export declare const Overlays: {
137
137
  }>, Schema.Struct<{
138
138
  readonly type: Schema.Literal<"native">;
139
139
  }>]>>, never, never>;
140
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
140
141
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
141
142
  headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
142
143
  body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
143
144
  };
144
- export interface Compatibility extends Schema.Schema.Type<typeof Compatibility> {
145
- }
146
- export declare const Compatibility: Schema.Struct<{
147
- readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
148
- /** Require every assistant message to include its reasoning field, even when empty. */
149
- readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
150
- 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>;
151
- readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
152
- readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
153
- readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
154
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
155
- readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
156
- /** Supports per-message effort updates. Overrides model-ID detection. */
157
- readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
158
- }>;
159
145
  export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
160
146
  }
161
147
  export declare const Capabilities: Schema.Struct<{
@@ -207,6 +193,7 @@ export declare const Variant: Schema.Struct<{
207
193
  }>, Schema.Struct<{
208
194
  readonly type: Schema.Literal<"native">;
209
195
  }>]>>, never, never>;
196
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
210
197
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
211
198
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
212
199
  readonly type: Schema.Literal<"summary">;
@@ -217,6 +204,7 @@ export declare const Variant: Schema.Struct<{
217
204
  }>, Schema.Struct<{
218
205
  readonly type: Schema.Literal<"native">;
219
206
  }>]>>, never, never>;
207
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
220
208
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
221
209
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
222
210
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
@@ -247,6 +235,7 @@ export declare const Info: Schema.Struct<{
247
235
  }>, Schema.Struct<{
248
236
  readonly type: Schema.Literal<"native">;
249
237
  }>]>>, never, never>;
238
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
250
239
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
251
240
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
252
241
  readonly type: Schema.Literal<"summary">;
@@ -257,6 +246,7 @@ export declare const Info: Schema.Struct<{
257
246
  }>, Schema.Struct<{
258
247
  readonly type: Schema.Literal<"native">;
259
248
  }>]>>, never, never>;
249
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
260
250
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
261
251
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
262
252
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
@@ -305,6 +295,7 @@ export declare const Info: Schema.Struct<{
305
295
  }>, Schema.Struct<{
306
296
  readonly type: Schema.Literal<"native">;
307
297
  }>]>>, never, never>;
298
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
308
299
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
309
300
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
310
301
  readonly type: Schema.Literal<"summary">;
@@ -315,6 +306,7 @@ export declare const Info: Schema.Struct<{
315
306
  }>, Schema.Struct<{
316
307
  readonly type: Schema.Literal<"native">;
317
308
  }>]>>, never, never>;
309
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
318
310
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
319
311
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
320
312
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
@@ -362,27 +354,23 @@ export declare const Info: Schema.Struct<{
362
354
  readonly name: Schema.String;
363
355
  readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
364
356
  readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
365
- /** Require every assistant message to include its reasoning field, even when empty. */
366
357
  readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
367
358
  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>;
368
359
  readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
369
360
  readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
370
361
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
371
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
362
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
372
363
  readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
373
- /** Supports per-message effort updates. Overrides model-ID detection. */
374
364
  readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
375
365
  }>>>, Schema.optionalKey<Schema.Struct<{
376
366
  readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<ReasoningField, ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<ReasoningField, ReasoningField, never, never>>, never, never>;
377
- /** Require every assistant message to include its reasoning field, even when empty. */
378
367
  readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
379
368
  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>;
380
369
  readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
381
370
  readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
382
371
  readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
383
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
372
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
384
373
  readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
385
- /** Supports per-message effort updates. Overrides model-ID detection. */
386
374
  readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
387
375
  }>>, never, never>;
388
376
  readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
package/dist/model.js CHANGED
@@ -2,6 +2,7 @@ export * as Model from "./model.js";
2
2
  import { Schema } from "effect";
3
3
  import { optional, statics } from "./schema.js";
4
4
  import { Provider } from "./provider.js";
5
+ import { Compatibility, MaxTokensField, ReasoningField } from "./model-compatibility.js";
5
6
  import { Money } from "./money.js";
6
7
  import { ephemeral, inventory } from "./event.js";
7
8
  export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
@@ -32,16 +33,11 @@ export const Ref = Schema.Struct({
32
33
  });
33
34
  },
34
35
  })));
36
+ export { Compatibility, MaxTokensField, ReasoningField };
35
37
  export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
36
- export const ReasoningField = Schema.Union([
37
- Schema.Literals(["reasoning", "reasoning_content", "reasoning_text"]),
38
- Schema.String,
39
- ]).annotate({ identifier: "Model.ReasoningField" });
40
- export const MaxTokensField = Schema.Literals(["max_completion_tokens", "max_tokens"]).annotate({
41
- identifier: "Model.MaxTokensField",
42
- });
43
38
  export const Settings = Schema.StructWithRest(Schema.Struct({
44
39
  compaction: Provider.Compaction.pipe(optional),
40
+ encoding: Provider.Encoding.pipe(optional),
45
41
  }),
46
42
  // Provider packages may define arbitrary model-level options beyond OpenCode's shared compaction policy.
47
43
  [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Model.Settings" });
@@ -50,19 +46,6 @@ export const Overlays = {
50
46
  headers: Schema.Record(Schema.String, Schema.String).pipe(optional),
51
47
  body: Schema.Record(Schema.String, Schema.Any).pipe(optional),
52
48
  };
53
- export const Compatibility = Schema.Struct({
54
- reasoningField: ReasoningField.pipe(optional),
55
- /** Require every assistant message to include its reasoning field, even when empty. */
56
- requireReasoning: Schema.Boolean.pipe(optional),
57
- maxTokensField: MaxTokensField.pipe(optional),
58
- requireFinishReason: Schema.Boolean.pipe(optional),
59
- requireAssistantAfterTool: Schema.Boolean.pipe(optional),
60
- supportsPromptCacheKey: Schema.Boolean.pipe(optional),
61
- /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
62
- supportsThinkingBlockBinding: Schema.Boolean.pipe(optional),
63
- /** Supports per-message effort updates. Overrides model-ID detection. */
64
- supportsEffortUpdates: Schema.Boolean.pipe(optional),
65
- }).annotate({ identifier: "Model.Compatibility" });
66
49
  export const Capabilities = Schema.Struct({
67
50
  tools: Schema.Boolean,
68
51
  input: Schema.Array(Schema.String),
@@ -3,7 +3,7 @@ import { Schema } from "effect";
3
3
  import { ascending } from "./identifier.js";
4
4
  import { ProjectID } from "./project-id.js";
5
5
  import { DateTimeUtcFromMillis, statics } from "./schema.js";
6
- export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
6
+ export const ID = Schema.String.pipe(Schema.brand("PermissionSaved.ID"), Schema.annotate({ identifier: "PermissionSaved.ID" }), statics((schema) => ({ create: () => schema.make("psv_" + ascending()) })));
7
7
  export const Info = Schema.Struct({
8
8
  id: ID,
9
9
  projectID: ProjectID,
@@ -5,7 +5,7 @@ import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { SessionID } from "./session-id.js";
7
7
  import { statics } from "./schema.js";
8
- export const ID = Schema.String.check(Schema.isStartsWith("per")).pipe(Schema.brand("Permission.ID"), statics((schema) => ({ create: (id) => schema.make(id ?? "per_" + ascending()) })));
8
+ export const ID = Schema.String.check(Schema.isStartingWith("per")).pipe(Schema.brand("Permission.ID"), Schema.annotate({ identifier: "Permission.ID" }), statics((schema) => ({ create: (id) => schema.make(id ?? "per_" + ascending()) })));
9
9
  export const Source = Schema.Union([
10
10
  Schema.Struct({
11
11
  type: Schema.Literal("tool"),
@@ -1,3 +1,3 @@
1
1
  import { Schema } from "effect";
2
2
  import { statics } from "./schema.js";
3
- export const ProjectID = Schema.String.pipe(Schema.brand("Project.ID"), statics((schema) => ({ global: schema.make("global") })));
3
+ export const ProjectID = Schema.String.pipe(Schema.brand("Project.ID"), Schema.annotate({ identifier: "Project.ID" }), statics((schema) => ({ global: schema.make("global") })));
package/dist/project.d.ts CHANGED
@@ -30,6 +30,7 @@ export declare const Time: Schema.Struct<{
30
30
  readonly created: Schema.Int;
31
31
  readonly updated: Schema.Int;
32
32
  readonly active: Schema.Int;
33
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
33
34
  }>;
34
35
  export interface Time extends Schema.Schema.Type<typeof Time> {
35
36
  }
@@ -58,6 +59,7 @@ export declare const Info: Schema.Struct<{
58
59
  readonly created: Schema.Int;
59
60
  readonly updated: Schema.Int;
60
61
  readonly active: Schema.Int;
62
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
61
63
  }>;
62
64
  readonly sandboxes: Schema.$Array<Schema.String>;
63
65
  }>;
@@ -138,6 +140,7 @@ export declare const Event: {
138
140
  readonly created: Schema.Int;
139
141
  readonly updated: Schema.Int;
140
142
  readonly active: Schema.Int;
143
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
141
144
  }>;
142
145
  readonly sandboxes: Schema.$Array<Schema.String>;
143
146
  }>;
@@ -170,6 +173,7 @@ export declare const Event: {
170
173
  readonly created: Schema.Int;
171
174
  readonly updated: Schema.Int;
172
175
  readonly active: Schema.Int;
176
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
173
177
  }>;
174
178
  readonly sandboxes: Schema.$Array<Schema.String>;
175
179
  }>;
@@ -225,6 +229,7 @@ export declare const Event: {
225
229
  readonly created: Schema.Int;
226
230
  readonly updated: Schema.Int;
227
231
  readonly active: Schema.Int;
232
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
228
233
  }>;
229
234
  readonly sandboxes: Schema.$Array<Schema.String>;
230
235
  }>;
@@ -257,6 +262,7 @@ export declare const Event: {
257
262
  readonly created: Schema.Int;
258
263
  readonly updated: Schema.Int;
259
264
  readonly active: Schema.Int;
265
+ readonly archived: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
260
266
  }>;
261
267
  readonly sandboxes: Schema.$Array<Schema.String>;
262
268
  }>;
package/dist/project.js CHANGED
@@ -4,7 +4,7 @@ import { ephemeral, inventory } from "./event.js";
4
4
  import { AbsolutePath, NonNegativeInt, optional } from "./schema.js";
5
5
  import { ProjectID } from "./project-id.js";
6
6
  export const ID = ProjectID;
7
- export const Vcs = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9._-]*$/)).annotate({
7
+ export const Vcs = Schema.String.check(Schema.isPattern(/^[a-z][a-z0-9._-]*$/u)).annotate({
8
8
  identifier: "Project.Vcs",
9
9
  });
10
10
  export const Current = Schema.Struct({
@@ -24,6 +24,7 @@ export const Time = Schema.Struct({
24
24
  created: NonNegativeInt,
25
25
  updated: NonNegativeInt,
26
26
  active: NonNegativeInt,
27
+ archived: optional(NonNegativeInt),
27
28
  }).annotate({ identifier: "Project.Time" });
28
29
  export const Info = Schema.Struct({
29
30
  id: ID,
package/dist/prompt.js CHANGED
@@ -13,7 +13,7 @@ export const FileSource = Schema.Union([
13
13
  ])
14
14
  .pipe(Schema.toTaggedUnion("type"))
15
15
  .annotate({ identifier: "Prompt.FileSource" });
16
- export const Base64 = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/)).annotate({ identifier: "Prompt.Base64" });
16
+ export const Base64 = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u)).annotate({ identifier: "Prompt.Base64" });
17
17
  export const FileAttachment = Schema.Struct({
18
18
  data: Base64,
19
19
  mime: Schema.String,
@@ -95,6 +95,9 @@ export type Compaction = typeof Compaction.Type;
95
95
  /** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
96
96
  export declare const Transport: Schema.Literals<readonly ["http", "websocket"]>;
97
97
  export type Transport = typeof Transport.Type;
98
+ /** HTTP request body compression; only endpoints known to decode it should enable it. */
99
+ export declare const Encoding: Schema.Literals<readonly ["zstd", "gzip", "none"]>;
100
+ export type Encoding = typeof Encoding.Type;
98
101
  export declare const Settings: Schema.StructWithRest<Schema.Struct<{
99
102
  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
103
  readonly headerTimeout: 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>;
@@ -109,6 +112,7 @@ export declare const Settings: Schema.StructWithRest<Schema.Struct<{
109
112
  readonly type: Schema.Literal<"native">;
110
113
  }>]>>, never, never>;
111
114
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
115
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
112
116
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>;
113
117
  export type Settings = typeof Settings.Type;
114
118
  export declare const Overlays: {
@@ -126,6 +130,7 @@ export declare const Overlays: {
126
130
  readonly type: Schema.Literal<"native">;
127
131
  }>]>>, never, never>;
128
132
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
133
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
129
134
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
130
135
  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>;
131
136
  readonly headerTimeout: 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>;
@@ -140,6 +145,7 @@ export declare const Overlays: {
140
145
  readonly type: Schema.Literal<"native">;
141
146
  }>]>>, never, never>;
142
147
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
148
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
143
149
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
144
150
  headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
145
151
  body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
@@ -161,6 +167,7 @@ export declare const Request: Schema.Struct<{
161
167
  readonly type: Schema.Literal<"native">;
162
168
  }>]>>, never, never>;
163
169
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
170
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
164
171
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
165
172
  readonly headers: Schema.$Record<Schema.String, Schema.String>;
166
173
  readonly body: Schema.$Record<Schema.String, Schema.Any>;
@@ -182,6 +189,7 @@ export declare const Info: Schema.Struct<{
182
189
  readonly type: Schema.Literal<"native">;
183
190
  }>]>>, never, never>;
184
191
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
192
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
185
193
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
186
194
  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>;
187
195
  readonly headerTimeout: 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>;
@@ -196,6 +204,7 @@ export declare const Info: Schema.Struct<{
196
204
  readonly type: Schema.Literal<"native">;
197
205
  }>]>>, never, never>;
198
206
  readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
207
+ readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
199
208
  }>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
200
209
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
201
210
  readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
@@ -241,6 +250,24 @@ export declare const Info: Schema.Struct<{
241
250
  readonly name: Schema.String;
242
251
  readonly activation: Schema.Literals<readonly ["auto", "enabled", "disabled"]>;
243
252
  readonly package: Schema.String;
253
+ /** Inherited by every model of this provider; model compatibility overrides individual fields. */
254
+ readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
255
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>, never, never>;
256
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
257
+ 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>;
258
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
259
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
260
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
261
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
262
+ }>>>, Schema.optionalKey<Schema.Struct<{
263
+ readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("./model-compatibility.js").ReasoningField, import("./model-compatibility.js").ReasoningField, never, never>>, never, never>;
264
+ readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
265
+ 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>;
266
+ readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
267
+ readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
268
+ readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
269
+ readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
270
+ }>>, never, never>;
244
271
  }> & {
245
272
  empty: (id: ID) => Info;
246
273
  };
package/dist/provider.js CHANGED
@@ -1,9 +1,10 @@
1
1
  export * as Provider from "./provider.js";
2
2
  import { Effect, Schema } from "effect";
3
3
  import { Integration } from "./integration.js";
4
+ import { ProviderCompatibility } from "./model-compatibility.js";
4
5
  import { optional, statics } from "./schema.js";
5
6
  import { ephemeral, inventory } from "./event.js";
6
- export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), statics((schema) => ({
7
+ export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), Schema.annotate({ identifier: "Provider.ID" }), statics((schema) => ({
7
8
  opencode: schema.make("opencode"),
8
9
  anthropic: schema.make("anthropic"),
9
10
  openai: schema.make("openai"),
@@ -28,12 +29,15 @@ export const Compaction = Schema.Union([
28
29
  .annotate({ identifier: "Provider.Compaction" });
29
30
  /** "websocket" on a route without a WebSocket channel warns and falls back to HTTP. */
30
31
  export const Transport = Schema.Literals(["http", "websocket"]).annotate({ identifier: "Provider.Transport" });
32
+ /** HTTP request body compression; only endpoints known to decode it should enable it. */
33
+ export const Encoding = Schema.Literals(["zstd", "gzip", "none"]).annotate({ identifier: "Provider.Encoding" });
31
34
  export const Settings = Schema.StructWithRest(Schema.Struct({
32
35
  timeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
33
36
  headerTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
34
37
  chunkTimeout: Schema.Union([Schema.Finite, Schema.Literal(false)]).pipe(optional),
35
38
  compaction: Compaction.pipe(optional),
36
39
  transport: Transport.pipe(optional),
40
+ encoding: Encoding.pipe(optional),
37
41
  }), [Schema.Record(Schema.String, Schema.Any)]).annotate({ identifier: "Provider.Settings" });
38
42
  export const Overlays = {
39
43
  settings: Settings.pipe(optional),
@@ -52,6 +56,8 @@ export const Info = Schema.Struct({
52
56
  name: Schema.String,
53
57
  activation: Activation,
54
58
  package: Package,
59
+ /** Inherited by every model of this provider; model compatibility overrides individual fields. */
60
+ compatibility: ProviderCompatibility.pipe(optional),
55
61
  ...Overlays,
56
62
  })
57
63
  .annotate({ identifier: "Provider.Info" })
package/dist/pty.js CHANGED
@@ -4,7 +4,7 @@ import { optional } from "./schema.js";
4
4
  import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { NonNegativeInt, PositiveInt, statics } from "./schema.js";
7
- const IDSchema = Schema.String.check(Schema.isStartsWith("pty")).pipe(Schema.brand("PtyID"));
7
+ const IDSchema = Schema.String.check(Schema.isStartingWith("pty")).pipe(Schema.brand("PtyID"), Schema.annotate({ identifier: "Pty.ID" }));
8
8
  export const ID = IDSchema.pipe(statics((schema) => {
9
9
  const create = () => schema.make("pty_" + ascending());
10
10
  return {
package/dist/schema.d.ts CHANGED
@@ -6,5 +6,6 @@ export type RelativePath = typeof RelativePath.Type;
6
6
  export declare const AbsolutePath: Schema.brand<Schema.String, "AbsolutePath">;
7
7
  export type AbsolutePath = typeof AbsolutePath.Type;
8
8
  export declare const optional: <S extends Schema.Top>(schema: S) => Schema.decodeTo<Schema.optional<Schema.toType<S>>, Schema.optionalKey<S>, never, never>;
9
+ export declare const withStatics: <S extends object, M extends Record<string, unknown>>(schema: S, methods: M) => S & M;
9
10
  export declare const statics: <S extends object, M extends Record<string, unknown>>(methods: (schema: S) => M) => (schema: S) => S & M;
10
11
  export declare const DateTimeUtcFromMillis: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
package/dist/schema.js CHANGED
@@ -1,13 +1,16 @@
1
1
  import { DateTime, Option, Schema, SchemaGetter } from "effect";
2
2
  export const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));
3
3
  export const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
4
- export const RelativePath = Schema.String.pipe(Schema.brand("RelativePath"));
5
- export const AbsolutePath = Schema.String.pipe(Schema.brand("AbsolutePath"));
4
+ export const RelativePath = Schema.String.pipe(Schema.brand("RelativePath"), Schema.annotate({ identifier: "RelativePath" }));
5
+ export const AbsolutePath = Schema.String.pipe(Schema.brand("AbsolutePath"), Schema.annotate({ identifier: "AbsolutePath" }));
6
6
  export const optional = (schema) => Schema.optionalKey(schema).pipe(Schema.decodeTo(Schema.optional(Schema.toType(schema)), {
7
7
  decode: SchemaGetter.passthrough({ strict: false }),
8
8
  encode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)),
9
9
  }));
10
- export const statics = (methods) => (schema) => Object.assign(schema, methods(schema));
10
+ // Effect schemas expose `make` through prototype getters, so `Object.assign` cannot override it.
11
+ // Defining the properties replaces a constructor as long as the schema's own `make` has not been read.
12
+ export const withStatics = (schema, methods) => Object.defineProperties(schema, Object.getOwnPropertyDescriptors(methods));
13
+ export const statics = (methods) => (schema) => withStatics(schema, methods(schema));
11
14
  export const DateTimeUtcFromMillis = Schema.Finite.pipe(Schema.decodeTo(Schema.DateTimeUtc, {
12
15
  decode: SchemaGetter.transform((value) => DateTime.makeUnsafe(value)),
13
16
  encode: SchemaGetter.transform((value) => DateTime.toEpochMillis(value)),
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { descending } from "./identifier.js";
3
3
  import { statics } from "./schema.js";
4
- export const SessionID = Schema.String.check(Schema.isStartsWith("ses")).pipe(Schema.brand("SessionID"), statics((schema) => {
4
+ export const SessionID = Schema.String.check(Schema.isStartingWith("ses")).pipe(Schema.brand("SessionID"), Schema.annotate({ identifier: "Session.ID" }), statics((schema) => {
5
5
  const create = () => schema.make("ses_" + descending());
6
6
  return {
7
7
  create,
@@ -1366,6 +1366,25 @@ export interface Idle extends Schema.Schema.Type<typeof Idle> {
1366
1366
  export declare const Idle: Schema.Struct<{
1367
1367
  readonly type: Schema.tag<"idle">;
1368
1368
  readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
1369
+ readonly error: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1370
+ readonly type: Schema.String;
1371
+ readonly message: Schema.String;
1372
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1373
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1374
+ readonly body: Schema.String;
1375
+ }>>>, Schema.optionalKey<Schema.Struct<{
1376
+ readonly body: Schema.String;
1377
+ }>>, never, never>;
1378
+ }>>>, Schema.optionalKey<Schema.Struct<{
1379
+ readonly type: Schema.String;
1380
+ readonly message: Schema.String;
1381
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
1382
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
1383
+ readonly body: Schema.String;
1384
+ }>>>, Schema.optionalKey<Schema.Struct<{
1385
+ readonly body: Schema.String;
1386
+ }>>, never, never>;
1387
+ }>>, never, never>;
1369
1388
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
1370
1389
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
1371
1390
  fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -2119,6 +2138,25 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
2119
2138
  }>]>, Schema.Struct<{
2120
2139
  readonly type: Schema.tag<"idle">;
2121
2140
  readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
2141
+ readonly error: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2142
+ readonly type: Schema.String;
2143
+ readonly message: Schema.String;
2144
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
2145
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2146
+ readonly body: Schema.String;
2147
+ }>>>, Schema.optionalKey<Schema.Struct<{
2148
+ readonly body: Schema.String;
2149
+ }>>, never, never>;
2150
+ }>>>, Schema.optionalKey<Schema.Struct<{
2151
+ readonly type: Schema.String;
2152
+ readonly message: Schema.String;
2153
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
2154
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
2155
+ readonly body: Schema.String;
2156
+ }>>>, Schema.optionalKey<Schema.Struct<{
2157
+ readonly body: Schema.String;
2158
+ }>>, never, never>;
2159
+ }>>, never, never>;
2122
2160
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
2123
2161
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
2124
2162
  fromEvent: (eventID: Event.ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -18,7 +18,7 @@ import { Skill as SkillSchema } from "./skill.js";
18
18
  import { Money } from "./money.js";
19
19
  import { Snapshot } from "./snapshot.js";
20
20
  import { TokenUsage } from "./token-usage.js";
21
- export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(Schema.brand("Session.Message.ID"), statics((schema) => ({
21
+ export const ID = Schema.String.check(Schema.isStartingWith("msg_")).pipe(Schema.brand("Session.Message.ID"), Schema.annotate({ identifier: "Session.Message.ID" }), statics((schema) => ({
22
22
  create: () => schema.make("msg_" + ascending()),
23
23
  fromEvent: (eventID) => schema.make(eventID.replace(/^evt_/, "msg_")),
24
24
  })));
@@ -217,6 +217,7 @@ export const Idle = Schema.Struct({
217
217
  ...Base,
218
218
  type: Schema.tag("idle"),
219
219
  outcome: Schema.Literals(["succeeded", "failed", "interrupted"]),
220
+ error: SessionError.Error.pipe(optional),
220
221
  }).annotate({ identifier: "Session.Message.Idle" });
221
222
  export const Info = Schema.Union([
222
223
  AgentSelected,
@@ -926,6 +926,25 @@ export declare const Data: Schema.Struct<{
926
926
  }>]>, Schema.Struct<{
927
927
  readonly type: Schema.tag<"idle">;
928
928
  readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
929
+ readonly error: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
930
+ readonly type: Schema.String;
931
+ readonly message: Schema.String;
932
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
933
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
934
+ readonly body: Schema.String;
935
+ }>>>, Schema.optionalKey<Schema.Struct<{
936
+ readonly body: Schema.String;
937
+ }>>, never, never>;
938
+ }>>>, Schema.optionalKey<Schema.Struct<{
939
+ readonly type: Schema.String;
940
+ readonly message: Schema.String;
941
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
942
+ readonly response: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
943
+ readonly body: Schema.String;
944
+ }>>>, Schema.optionalKey<Schema.Struct<{
945
+ readonly body: Schema.String;
946
+ }>>, never, never>;
947
+ }>>, never, never>;
929
948
  readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
930
949
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
931
950
  fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
package/dist/shell.js CHANGED
@@ -4,7 +4,7 @@ import { optional } from "./schema.js";
4
4
  import { ephemeral, inventory } from "./event.js";
5
5
  import { ascending } from "./identifier.js";
6
6
  import { NonNegativeInt, statics } from "./schema.js";
7
- const IDSchema = Schema.String.check(Schema.isStartsWith("sh_")).pipe(Schema.brand("Shell.ID"));
7
+ const IDSchema = Schema.String.check(Schema.isStartingWith("sh_")).pipe(Schema.brand("Shell.ID"), Schema.annotate({ identifier: "Shell.ID" }));
8
8
  export const ID = IDSchema.pipe(statics((schema) => {
9
9
  const create = () => schema.make("sh_" + ascending());
10
10
  return {
package/dist/skill.js CHANGED
@@ -3,8 +3,8 @@ import { Schema } from "effect";
3
3
  import { optional } from "./schema.js";
4
4
  import { AbsolutePath } from "./schema.js";
5
5
  import { ephemeral, inventory } from "./event.js";
6
- export const ID = Schema.String.pipe(Schema.brand("Skill.ID"));
7
- export const Name = Schema.String.pipe(Schema.brand("Skill.Name"));
6
+ export const ID = Schema.String.pipe(Schema.brand("Skill.ID"), Schema.annotate({ identifier: "Skill.ID" }));
7
+ export const Name = Schema.String.pipe(Schema.brand("Skill.Name"), Schema.annotate({ identifier: "Skill.Name" }));
8
8
  export const DirectorySource = Schema.Struct({
9
9
  type: Schema.tag("directory"),
10
10
  path: AbsolutePath,
package/dist/snapshot.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * as Snapshot from "./snapshot.js";
2
2
  import { Schema } from "effect";
3
- export const ID = Schema.String.pipe(Schema.brand("Snapshot.ID"));
3
+ export const ID = Schema.String.pipe(Schema.brand("Snapshot.ID"), Schema.annotate({ identifier: "Snapshot.ID" }));
@@ -5,7 +5,7 @@ import { ascending } from "../identifier.js";
5
5
  import { Project } from "../project.js";
6
6
  import { statics } from "../schema.js";
7
7
  import { SessionID } from "../session-id.js";
8
- export const ID = Schema.String.check(Schema.isStartsWith("per")).pipe(Schema.brand("PermissionV1.ID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "per_" + ascending()) })));
8
+ export const ID = Schema.String.check(Schema.isStartingWith("per")).pipe(Schema.brand("PermissionV1.ID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "per_" + ascending()) })));
9
9
  export const Action = Schema.Literals(["allow", "deny", "ask"]).annotate({ identifier: "PermissionV1.Action" });
10
10
  export const Rule = Schema.Struct({ permission: Schema.String, pattern: Schema.String, action: Action }).annotate({
11
11
  identifier: "PermissionV1.Rule",
@@ -11,8 +11,8 @@ import { WorkspaceID } from "../workspace-id.js";
11
11
  import { PermissionV1 } from "./permission.js";
12
12
  import { FileDiff } from "../file-diff.js";
13
13
  const Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
14
- export const MessageID = Schema.String.check(Schema.isStartsWith("msg")).pipe(Schema.brand("SessionV1.MessageID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "msg_" + ascending()) })));
15
- export const PartID = Schema.String.check(Schema.isStartsWith("prt")).pipe(Schema.brand("SessionV1.PartID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "prt_" + ascending()) })));
14
+ export const MessageID = Schema.String.check(Schema.isStartingWith("msg")).pipe(Schema.brand("SessionV1.MessageID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "msg_" + ascending()) })));
15
+ export const PartID = Schema.String.check(Schema.isStartingWith("prt")).pipe(Schema.brand("SessionV1.PartID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "prt_" + ascending()) })));
16
16
  const namedError = (name, fields) => {
17
17
  const schema = Schema.Struct({ name: Schema.Literal(name), data: Schema.Struct(fields) }).annotate({
18
18
  identifier: name,
package/dist/websearch.js CHANGED
@@ -2,7 +2,7 @@ export * as WebSearch from "./websearch.js";
2
2
  import { Schema } from "effect";
3
3
  import { ephemeral, inventory } from "./event.js";
4
4
  import { optional } from "./schema.js";
5
- export const ID = Schema.String.pipe(Schema.brand("WebSearch.ID"));
5
+ export const ID = Schema.String.pipe(Schema.brand("WebSearch.ID"), Schema.annotate({ identifier: "WebSearch.ID" }));
6
6
  export const Provider = Schema.Struct({
7
7
  id: ID,
8
8
  name: Schema.String,
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { ascending } from "./identifier.js";
3
3
  import { statics } from "./schema.js";
4
- export const WorkspaceID = Schema.String.check(Schema.isStartsWith("wrk")).pipe(Schema.brand("Workspace.ID"), statics((schema) => {
4
+ export const WorkspaceID = Schema.String.check(Schema.isStartingWith("wrk")).pipe(Schema.brand("Workspace.ID"), Schema.annotate({ identifier: "Workspace.ID" }), statics((schema) => {
5
5
  const create = () => schema.make("wrk_" + ascending());
6
6
  return {
7
7
  ascending: (id) => {
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.26",
4
+ "version": "2.0.28",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@standard-schema/spec": "1.1.0",
34
- "effect": "4.0.0-rc.112"
34
+ "effect": "4.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/bun": "1.0.9",