@opencode/schema 0.0.0-dev-1141 → 0.0.0-dev-1147

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.
@@ -299,6 +299,7 @@ declare const ModelConfig_base: Schema.Class<ModelConfig, Schema.Struct<{
299
299
  readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
300
300
  readonly capabilities: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
301
301
  readonly tools: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
302
+ readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
302
303
  readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
303
304
  readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
304
305
  readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
@@ -331,6 +332,7 @@ declare const ModelConfig_base: Schema.Class<ModelConfig, Schema.Struct<{
331
332
  }>]>>, never, never>;
332
333
  }>>>, Schema.optionalKey<Schema.Struct<{
333
334
  readonly tools: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
335
+ readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
334
336
  readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
335
337
  readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
336
338
  readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
@@ -75,6 +75,7 @@ class ModelConfig extends Schema.Class("Config.Model")({
75
75
  // Partial: unset fields fall back to the base model's capabilities, then the defaults.
76
76
  capabilities: Capabilities.mapFields((fields) => ({
77
77
  tools: optional(fields.tools),
78
+ freeform: fields.freeform,
78
79
  input: optional(fields.input),
79
80
  output: optional(fields.output),
80
81
  temperature: fields.temperature,
package/dist/model.d.ts CHANGED
@@ -207,6 +207,8 @@ export interface Capabilities extends Schema.Schema.Type<typeof Capabilities> {
207
207
  }
208
208
  export declare const Capabilities: Schema.Struct<{
209
209
  readonly tools: Schema.Boolean;
210
+ /** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
211
+ readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
210
212
  readonly input: Schema.$Array<Schema.String>;
211
213
  readonly output: Schema.$Array<Schema.String>;
212
214
  /** Whether the model accepts a sampling temperature. Unknown when unset. */
@@ -413,6 +415,8 @@ export declare const Info: Schema.Struct<{
413
415
  readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
414
416
  readonly capabilities: Schema.Struct<{
415
417
  readonly tools: Schema.Boolean;
418
+ /** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
419
+ readonly freeform: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>>, Schema.optionalKey<Schema.$Array<Schema.Literals<("lark" | "regex" | "text")[]>>>, never, never>;
416
420
  readonly input: Schema.$Array<Schema.String>;
417
421
  readonly output: Schema.$Array<Schema.String>;
418
422
  /** Whether the model accepts a sampling temperature. Unknown when unset. */
package/dist/model.js CHANGED
@@ -4,6 +4,7 @@ import { optional, statics } from "./schema.js";
4
4
  import { Provider } from "./provider.js";
5
5
  import { Compatibility, MaxTokensField, MediaInput, ReasoningField } from "./model-compatibility.js";
6
6
  import { Money } from "./money.js";
7
+ import { FreeformFormat } from "./tool.js";
7
8
  import { ephemeral, inventory } from "./event.js";
8
9
  export const ID = Schema.String.pipe(Schema.brand("Model.ID"));
9
10
  const Updated = ephemeral({ type: "model.updated", schema: {} });
@@ -51,6 +52,8 @@ export const Overlays = {
51
52
  };
52
53
  export const Capabilities = Schema.Struct({
53
54
  tools: Schema.Boolean,
55
+ /** Freeform tool input formats advertised by the selected API. Absent or empty means JSON tools only. */
56
+ freeform: Schema.Array(FreeformFormat).pipe(optional),
54
57
  input: Schema.Array(Schema.String),
55
58
  output: Schema.Array(Schema.String),
56
59
  /** Whether the model accepts a sampling temperature. Unknown when unset. */
package/dist/tool.d.ts CHANGED
@@ -5,6 +5,18 @@ import type { Agent } from "./agent.js";
5
5
  import type { Session } from "./session.js";
6
6
  import type { SessionMessage } from "./session-message.js";
7
7
  export type Metadata = Readonly<Record<string, any>>;
8
+ /** Optional wire encoding of a tool's single required string field. Execution still receives the object. */
9
+ export declare const Freeform: Schema.Union<readonly [Schema.Struct<{
10
+ readonly type: Schema.Literal<"text">;
11
+ }>, Schema.Struct<{
12
+ readonly type: Schema.Literal<"regex">;
13
+ readonly pattern: Schema.String;
14
+ }>, Schema.Struct<{
15
+ readonly type: Schema.Literal<"lark">;
16
+ readonly grammar: Schema.String;
17
+ }>]>;
18
+ export type Freeform = typeof Freeform.Type;
19
+ export declare const FreeformFormat: Schema.Literals<("lark" | "regex" | "text")[]>;
8
20
  export declare const CallID: Schema.brand<Schema.String, "Tool.CallID">;
9
21
  export type CallID = typeof CallID.Type;
10
22
  export interface Context {
@@ -76,6 +88,7 @@ export interface Result<Output extends ValueSchema<any> | undefined = ValueSchem
76
88
  export type Info<Input extends ValueSchema<any> = ValueSchema<any>, Output extends ValueSchema<any> | undefined = ValueSchema<any> | undefined> = {
77
89
  readonly name: string;
78
90
  readonly input: Input;
91
+ readonly freeform?: Freeform;
79
92
  readonly description: string;
80
93
  readonly execute: (input: InputValue<Input>, context: Context) => Effect.Effect<Result<Output>, Error>;
81
94
  readonly output?: Output;
package/dist/tool.js CHANGED
@@ -1,5 +1,14 @@
1
1
  export * as Tool from "./tool.js";
2
2
  import { Effect, JsonSchema, Schema } from "effect";
3
+ /** Optional wire encoding of a tool's single required string field. Execution still receives the object. */
4
+ export const Freeform = Schema.Union([
5
+ Schema.Struct({ type: Schema.Literal("text") }),
6
+ Schema.Struct({ type: Schema.Literal("regex"), pattern: Schema.String }),
7
+ Schema.Struct({ type: Schema.Literal("lark"), grammar: Schema.String }),
8
+ ]).annotate({ identifier: "Tool.Freeform" });
9
+ export const FreeformFormat = Schema.Literals(Freeform.members.map((member) => member.fields.type.literal)).annotate({
10
+ identifier: "Tool.FreeformFormat",
11
+ });
3
12
  export const CallID = Schema.String.pipe(Schema.brand("Tool.CallID"));
4
13
  export class Error extends Schema.TaggedError()("Tool.Error", {
5
14
  message: Schema.String,
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": "0.0.0-dev-1141",
4
+ "version": "0.0.0-dev-1147",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {