@opencode/schema 2.0.20 → 2.0.21

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/form.d.ts CHANGED
@@ -536,6 +536,7 @@ export declare const State: Schema.Union<readonly [Schema.Struct<{
536
536
  readonly answer: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>;
537
537
  }>, Schema.Struct<{
538
538
  readonly status: Schema.Literal<"cancelled">;
539
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
539
540
  }>]>;
540
541
  export type State = typeof State.Type;
541
542
  export declare const Detail: Schema.Struct<{
@@ -546,6 +547,7 @@ export declare const Detail: Schema.Struct<{
546
547
  readonly answer: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>;
547
548
  }>, Schema.Struct<{
548
549
  readonly status: Schema.Literal<"cancelled">;
550
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
549
551
  }>]>;
550
552
  readonly fields: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
551
553
  readonly type: Schema.Literal<"string">;
package/dist/form.js CHANGED
@@ -110,7 +110,8 @@ export const Answer = Schema.Record(Schema.String, Value).annotate({ identifier:
110
110
  export const State = Schema.Union([
111
111
  Schema.Struct({ status: Schema.Literal("pending") }),
112
112
  Schema.Struct({ status: Schema.Literal("answered"), answer: Answer }),
113
- Schema.Struct({ status: Schema.Literal("cancelled") }),
113
+ // A message tells the asker why nobody answered, e.g. a non-interactive client.
114
+ Schema.Struct({ status: Schema.Literal("cancelled"), message: Schema.String.pipe(optional) }),
114
115
  ])
115
116
  .pipe(Schema.toTaggedUnion("status"))
116
117
  .annotate({ identifier: "Form.State" });
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.20",
4
+ "version": "2.0.21",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {