@opencode/schema 2.3.0 → 2.3.2

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.
@@ -1,19 +1,23 @@
1
1
  export * as ConfigFlag from "./flag.js";
2
- /** The `OPENCODE_FLAGS` entry that turns every flag on, as in `all,-media_blob`. It is not a flag key. */
2
+ /** The `OPENCODE_FLAGS` entry that enables all flags except opt-in-only flags, as in `all,-media_blob`. */
3
3
  export declare const wildcard = "all";
4
4
  /**
5
- * Every feature flag, by key, with what it turns on. A flag is on in local and dev builds and off in released ones;
6
- * `experimental.<key>` in config and `OPENCODE_FLAGS` override that, and `OPENCODE_FLAGS=all` or
7
- * `experimental.all_flags: true` turn every flag on. Read one with Core's `Flag.enabled("<key>")`.
5
+ * Flags default to on in local and dev builds and off in releases, except for `optInOnly` flags, which must be
6
+ * named explicitly in `experimental.<key>` or `OPENCODE_FLAGS`. Read a flag with Core's `Flag.enabled("<key>")`.
8
7
  */
9
8
  export declare const registry: {
10
9
  readonly todo: "Enable the experimental todowrite tool.";
11
- readonly background_compaction: "Enable experimental background compaction: summarize the conversation in the background as it nears the compaction threshold, so automatic compaction does not wait for the summary. Background summaries that are never used still cost tokens.";
12
10
  readonly media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.";
13
- readonly schedules: "Enable experimental scheduled tasks that wake a session with a prompt.";
11
+ readonly automations: "Run a prompt or Code Mode action on a timer, or on a connected MCP server's push event when mcp_events is enabled.";
14
12
  readonly artifacts: "Enable experimental artifacts backed by pluggable providers.";
15
- readonly shell_timeout_background: "Move foreground shell commands to the background when their timeout expires.";
13
+ readonly video_generate: "Enable the experimental video generation API.";
16
14
  readonly console_watches: "Watch Slack threads, GitHub pull requests, issues, commits and Actions runs, and the workspace's MCP servers' events through OpenCode Console, and wake sessions when they change.";
17
15
  readonly mcp_events: "Enable experimental MCP Events, a draft MCP extension: declare support to MCP servers and read the events of servers that offer them.";
16
+ readonly full_codemode: "Enable the full Code Mode work in progress. Off by default in every build, including local and dev; opt in with OPENCODE_FLAGS=full_codemode or experimental.full_codemode: true.";
18
17
  };
19
18
  export type Key = keyof typeof registry;
19
+ export declare const optInOnly: ReadonlySet<Key>;
20
+ /** Earlier names of a flag, still read from `experimental.<name>` and `OPENCODE_FLAGS` when the new key is unset. */
21
+ export declare const aliases: {
22
+ readonly schedules: "automations";
23
+ };
@@ -1,18 +1,22 @@
1
1
  export * as ConfigFlag from "./flag.js";
2
- /** The `OPENCODE_FLAGS` entry that turns every flag on, as in `all,-media_blob`. It is not a flag key. */
2
+ /** The `OPENCODE_FLAGS` entry that enables all flags except opt-in-only flags, as in `all,-media_blob`. */
3
3
  export const wildcard = "all";
4
4
  /**
5
- * Every feature flag, by key, with what it turns on. A flag is on in local and dev builds and off in released ones;
6
- * `experimental.<key>` in config and `OPENCODE_FLAGS` override that, and `OPENCODE_FLAGS=all` or
7
- * `experimental.all_flags: true` turn every flag on. Read one with Core's `Flag.enabled("<key>")`.
5
+ * Flags default to on in local and dev builds and off in releases, except for `optInOnly` flags, which must be
6
+ * named explicitly in `experimental.<key>` or `OPENCODE_FLAGS`. Read a flag with Core's `Flag.enabled("<key>")`.
8
7
  */
9
8
  export const registry = {
10
9
  todo: "Enable the experimental todowrite tool.",
11
- background_compaction: "Enable experimental background compaction: summarize the conversation in the background as it nears the compaction threshold, so automatic compaction does not wait for the summary. Background summaries that are never used still cost tokens.",
12
10
  media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.",
13
- schedules: "Enable experimental scheduled tasks that wake a session with a prompt.",
11
+ automations: "Run a prompt or Code Mode action on a timer, or on a connected MCP server's push event when mcp_events is enabled.",
14
12
  artifacts: "Enable experimental artifacts backed by pluggable providers.",
15
- shell_timeout_background: "Move foreground shell commands to the background when their timeout expires.",
13
+ video_generate: "Enable the experimental video generation API.",
16
14
  console_watches: "Watch Slack threads, GitHub pull requests, issues, commits and Actions runs, and the workspace's MCP servers' events through OpenCode Console, and wake sessions when they change.",
17
15
  mcp_events: "Enable experimental MCP Events, a draft MCP extension: declare support to MCP servers and read the events of servers that offer them.",
16
+ full_codemode: "Enable the full Code Mode work in progress. Off by default in every build, including local and dev; opt in with OPENCODE_FLAGS=full_codemode or experimental.full_codemode: true.",
17
+ };
18
+ export const optInOnly = new Set(["full_codemode"]);
19
+ /** Earlier names of a flag, still read from `experimental.<name>` and `OPENCODE_FLAGS` when the new key is unset. */
20
+ export const aliases = {
21
+ schedules: "automations",
18
22
  };
@@ -7,6 +7,13 @@ export declare const File: Schema.Struct<{
7
7
  readonly mime: Schema.String;
8
8
  readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
9
9
  }>;
10
+ export interface ImageFile extends Schema.Schema.Type<typeof ImageFile> {
11
+ }
12
+ export declare const ImageFile: Schema.Struct<{
13
+ readonly data: Schema.String;
14
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
15
+ readonly mime: Schema.String;
16
+ }>;
10
17
  export interface Usage extends Schema.Schema.Type<typeof Usage> {
11
18
  }
12
19
  export declare const Usage: Schema.Struct<{
@@ -92,6 +99,133 @@ export declare const ImageResult: Schema.Struct<{
92
99
  }>>, never, never>;
93
100
  readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
94
101
  }>;
102
+ export declare const VideoID: Schema.brand<Schema.String, "Generate.VideoID"> & {
103
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
104
+ };
105
+ export type VideoID = typeof VideoID.Type;
106
+ export type VideoAspect = `${number}:${number}` | "auto";
107
+ export declare const VideoAspect: Schema.Codec<VideoAspect>;
108
+ export type VideoResolution = "480p" | "720p" | "1080p" | "4k" | (string & {});
109
+ export declare const VideoResolution: Schema.Codec<VideoResolution>;
110
+ export interface VideoRequest extends Schema.Schema.Type<typeof VideoRequest> {
111
+ }
112
+ export declare const VideoRequest: Schema.Struct<{
113
+ readonly model: Schema.Struct<{
114
+ readonly id: Schema.brand<Schema.String, "Model.ID">;
115
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
116
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
117
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
118
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
119
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
120
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
121
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
122
+ claudeAgent: string & import("effect/Brand").Brand<"Provider.ID">;
123
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
124
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
125
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
126
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
127
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
128
+ };
129
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
130
+ }> & {
131
+ parse: (input: string) => {
132
+ readonly id: string & import("effect/Brand").Brand<"Model.ID">;
133
+ readonly providerID: string & import("effect/Brand").Brand<"Provider.ID">;
134
+ readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
135
+ };
136
+ };
137
+ readonly prompt: Schema.String;
138
+ readonly start: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
139
+ readonly data: Schema.String;
140
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
141
+ readonly mime: Schema.String;
142
+ }>>>, Schema.optionalKey<Schema.Struct<{
143
+ readonly data: Schema.String;
144
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
145
+ readonly mime: Schema.String;
146
+ }>>, never, never>;
147
+ readonly end: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
148
+ readonly data: Schema.String;
149
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
150
+ readonly mime: Schema.String;
151
+ }>>>, Schema.optionalKey<Schema.Struct<{
152
+ readonly data: Schema.String;
153
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
154
+ readonly mime: Schema.String;
155
+ }>>, never, never>;
156
+ readonly references: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
157
+ readonly data: Schema.String;
158
+ readonly mime: Schema.String;
159
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
160
+ }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
161
+ readonly data: Schema.String;
162
+ readonly mime: Schema.String;
163
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
164
+ }>>>, never, never>;
165
+ readonly duration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
166
+ readonly aspect: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<VideoAspect, VideoAspect, never, never>>>, Schema.optionalKey<Schema.Codec<VideoAspect, VideoAspect, never, never>>, never, never>;
167
+ readonly resolution: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<VideoResolution, VideoResolution, never, never>>>, Schema.optionalKey<Schema.Codec<VideoResolution, VideoResolution, never, never>>, never, never>;
168
+ readonly sound: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
169
+ }>;
170
+ export declare const VideoErrorReason: Schema.Literals<readonly ["failed", "cancelled", "expired", "unknown"]>;
171
+ export type VideoErrorReason = typeof VideoErrorReason.Type;
172
+ export interface VideoRunning extends Schema.Schema.Type<typeof VideoRunning> {
173
+ }
174
+ export declare const VideoRunning: Schema.Struct<{
175
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
176
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
177
+ };
178
+ readonly status: Schema.Literal<"running">;
179
+ }>;
180
+ export interface VideoCompleted extends Schema.Schema.Type<typeof VideoCompleted> {
181
+ }
182
+ export declare const VideoCompleted: Schema.Struct<{
183
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
184
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
185
+ };
186
+ readonly status: Schema.Literal<"completed">;
187
+ readonly blobs: Schema.$Array<Schema.Struct<{
188
+ readonly id: Schema.brand<Schema.String, "Blob.ID">;
189
+ readonly mime: Schema.String;
190
+ readonly bytes: Schema.Finite;
191
+ readonly expiresAt: Schema.Finite;
192
+ }>>;
193
+ }>;
194
+ export interface VideoError extends Schema.Schema.Type<typeof VideoError> {
195
+ }
196
+ export declare const VideoError: Schema.Struct<{
197
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
198
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
199
+ };
200
+ readonly status: Schema.Literal<"error">;
201
+ readonly error: Schema.String;
202
+ readonly reason: Schema.Literals<readonly ["failed", "cancelled", "expired", "unknown"]>;
203
+ }>;
204
+ export type VideoJob = VideoRunning | VideoCompleted | VideoError;
205
+ export declare const VideoJob: Schema.Union<readonly [Schema.Struct<{
206
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
207
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
208
+ };
209
+ readonly status: Schema.Literal<"running">;
210
+ }>, Schema.Struct<{
211
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
212
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
213
+ };
214
+ readonly status: Schema.Literal<"completed">;
215
+ readonly blobs: Schema.$Array<Schema.Struct<{
216
+ readonly id: Schema.brand<Schema.String, "Blob.ID">;
217
+ readonly mime: Schema.String;
218
+ readonly bytes: Schema.Finite;
219
+ readonly expiresAt: Schema.Finite;
220
+ }>>;
221
+ }>, Schema.Struct<{
222
+ readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
223
+ create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
224
+ };
225
+ readonly status: Schema.Literal<"error">;
226
+ readonly error: Schema.String;
227
+ readonly reason: Schema.Literals<readonly ["failed", "cancelled", "expired", "unknown"]>;
228
+ }>]>;
95
229
  export interface DecisionTextPart extends Schema.Schema.Type<typeof DecisionTextPart> {
96
230
  }
97
231
  export declare const DecisionTextPart: Schema.Struct<{
package/dist/generate.js CHANGED
@@ -1,15 +1,21 @@
1
1
  export * as Generate from "./generate.js";
2
2
  import { Schema } from "effect";
3
+ import { BlobStore } from "./blob-store.js";
4
+ import { descending } from "./identifier.js";
3
5
  import { Model } from "./model.js";
4
6
  import { Money } from "./money.js";
5
7
  import { Base64 } from "./prompt.js";
6
- import { PositiveInt, optional } from "./schema.js";
8
+ import { PositiveInt, optional, statics } from "./schema.js";
7
9
  const description = (text) => ({ description: text });
8
10
  export const File = Schema.Struct({
9
11
  data: Base64,
10
12
  mime: Schema.String,
11
13
  name: Schema.String.pipe(optional),
12
14
  }).annotate({ identifier: "Generate.File" });
15
+ export const ImageFile = Schema.Struct({
16
+ ...File.fields,
17
+ mime: Schema.String.check(Schema.isPattern(/^image\//iu)),
18
+ }).annotate({ identifier: "Generate.ImageFile" });
13
19
  export const Usage = Schema.Struct({
14
20
  input: Schema.Finite.pipe(optional),
15
21
  output: Schema.Finite.pipe(optional),
@@ -49,6 +55,56 @@ export const ImageResult = Schema.Struct({
49
55
  tokens: Usage.pipe(optional),
50
56
  native: Native.pipe(optional),
51
57
  }).annotate({ identifier: "Generate.ImageResult" });
58
+ // ---------------------------------------------------------------------------
59
+ // Video
60
+ // ---------------------------------------------------------------------------
61
+ // Strict, because the server names files after it.
62
+ export const VideoID = Schema.String.check(Schema.isPattern(/^video_[0-9a-f]{12}[0-9A-Za-z]{14}$/u)).pipe(Schema.brand("Generate.VideoID"), Schema.annotate({ identifier: "Generate.VideoID" }), statics((schema) => ({
63
+ create: () => schema.make("video_" + descending()),
64
+ })));
65
+ export const VideoAspect = Schema.Union([ImageAspect, Schema.Literal("auto")]).annotate({
66
+ identifier: "Generate.VideoAspect",
67
+ description: "Aspect ratio as width:height, or auto to follow the start image",
68
+ });
69
+ export const VideoResolution = Schema.Union([
70
+ Schema.Literals(["480p", "720p", "1080p", "4k"]),
71
+ Schema.String,
72
+ ]).annotate({ identifier: "Generate.VideoResolution" });
73
+ export const VideoRequest = Schema.Struct({
74
+ model: Model.Ref,
75
+ prompt: Schema.String,
76
+ start: ImageFile.pipe(optional).annotate(description("Image the video starts on exactly")),
77
+ end: ImageFile.pipe(optional).annotate(description("Image the video ends on exactly")),
78
+ references: Schema.Array(File)
79
+ .pipe(optional)
80
+ .annotate(description("Images, videos or audio that guide the subject or style without pinning a frame")),
81
+ duration: PositiveInt.pipe(optional).annotate(description("Length in seconds")),
82
+ aspect: VideoAspect.pipe(optional),
83
+ resolution: VideoResolution.pipe(optional),
84
+ sound: Schema.Boolean.pipe(optional).annotate(description("Whether the video has a generated soundtrack; unset leaves the model's default")),
85
+ }).annotate({ identifier: "Generate.VideoRequest" });
86
+ export const VideoErrorReason = Schema.Literals(["failed", "cancelled", "expired", "unknown"]).annotate({
87
+ identifier: "Generate.VideoErrorReason",
88
+ description: "failed: the provider failed the job. cancelled: the provider cancelled it. expired: the provider expired it. unknown: the provider gave no result in time",
89
+ });
90
+ export const VideoRunning = Schema.Struct({
91
+ id: VideoID,
92
+ status: Schema.Literal("running"),
93
+ }).annotate({ identifier: "Generate.VideoRunning" });
94
+ export const VideoCompleted = Schema.Struct({
95
+ id: VideoID,
96
+ status: Schema.Literal("completed"),
97
+ blobs: Schema.Array(BlobStore.Info).annotate(description("The finished videos, usually one. Read each with GET /api/experimental/blob/:id")),
98
+ }).annotate({ identifier: "Generate.VideoCompleted" });
99
+ export const VideoError = Schema.Struct({
100
+ id: VideoID,
101
+ status: Schema.Literal("error"),
102
+ error: Schema.String,
103
+ reason: VideoErrorReason,
104
+ }).annotate({ identifier: "Generate.VideoError" });
105
+ export const VideoJob = Schema.Union([VideoRunning, VideoCompleted, VideoError]).annotate({
106
+ identifier: "Generate.VideoJob",
107
+ });
52
108
  export const DecisionTextPart = Schema.Struct({ type: Schema.Literal("text"), text: Schema.String }).annotate({
53
109
  identifier: "Generate.DecisionTextPart",
54
110
  });
package/dist/job.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * as Job from "./job.js";
2
2
  import { Schema } from "effect";
3
- export declare const Kind: Schema.Literals<readonly ["shell", "subagent", "image"]>;
3
+ export declare const Kind: Schema.Literals<readonly ["shell", "subagent", "image", "codemode"]>;
4
4
  export type Kind = typeof Kind.Type;
5
5
  export declare const Status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
6
6
  export type Status = typeof Status.Type;
@@ -64,6 +64,21 @@ export declare const Image: Schema.Struct<{
64
64
  readonly path: Schema.String;
65
65
  readonly model: Schema.String;
66
66
  }>;
67
+ export interface CodeMode extends Schema.Schema.Type<typeof CodeMode> {
68
+ }
69
+ export declare const CodeMode: Schema.Struct<{
70
+ readonly id: Schema.String;
71
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
72
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
73
+ };
74
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
75
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
76
+ readonly time: Schema.Struct<{
77
+ readonly started: Schema.Finite;
78
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
79
+ }>;
80
+ readonly kind: Schema.tag<"codemode">;
81
+ }>;
67
82
  export declare const Info: Schema.Union<readonly [Schema.Struct<{
68
83
  readonly id: Schema.String;
69
84
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
@@ -109,5 +124,17 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
109
124
  readonly kind: Schema.tag<"image">;
110
125
  readonly path: Schema.String;
111
126
  readonly model: Schema.String;
127
+ }>, Schema.Struct<{
128
+ readonly id: Schema.String;
129
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
130
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
131
+ };
132
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
133
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
134
+ readonly time: Schema.Struct<{
135
+ readonly started: Schema.Finite;
136
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
137
+ }>;
138
+ readonly kind: Schema.tag<"codemode">;
112
139
  }>]>;
113
140
  export type Info = typeof Info.Type;
package/dist/job.js CHANGED
@@ -2,7 +2,7 @@ export * as Job from "./job.js";
2
2
  import { Schema } from "effect";
3
3
  import { optional } from "./schema.js";
4
4
  import { SessionID } from "./session-id.js";
5
- export const Kind = Schema.Literals(["shell", "subagent", "image"]).annotate({ identifier: "Job.Kind" });
5
+ export const Kind = Schema.Literals(["shell", "subagent", "image", "codemode"]).annotate({ identifier: "Job.Kind" });
6
6
  export const Status = Schema.Literals(["running", "completed", "error", "cancelled"]).annotate({
7
7
  identifier: "Job.Status",
8
8
  });
@@ -38,4 +38,7 @@ export const Image = Schema.Struct({
38
38
  path: Schema.String,
39
39
  model: Schema.String,
40
40
  }).annotate({ identifier: "Job.Image" });
41
- export const Info = Schema.Union([Shell, Subagent, Image]).pipe(Schema.toTaggedUnion("kind"), Schema.annotate({ identifier: "Job.Info" }));
41
+ export const CodeMode = Schema.Struct({ kind: Schema.tag("codemode"), ...Base }).annotate({
42
+ identifier: "Job.CodeMode",
43
+ });
44
+ export const Info = Schema.Union([Shell, Subagent, Image, CodeMode]).pipe(Schema.toTaggedUnion("kind"), Schema.annotate({ identifier: "Job.Info" }));
package/dist/model.d.ts CHANGED
@@ -104,7 +104,7 @@ export { Compatibility, MaxTokensField, MediaInput, ReasoningField };
104
104
  export declare const Family: Schema.brand<Schema.String, "Model.Family">;
105
105
  export type Family = typeof Family.Type;
106
106
  /** What a model produces, from models.dev. Open-ended: new types keep being added. Only chat models are offered for sessions; an unset type means chat. */
107
- export type Type = "chat" | "decision" | "image" | (string & {});
107
+ export type Type = "chat" | "decision" | "image" | "video" | (string & {});
108
108
  export declare const Type: Schema.Codec<Type>;
109
109
  export declare const Settings: Schema.StructWithRest<Schema.Struct<{
110
110
  readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
package/dist/model.js CHANGED
@@ -37,7 +37,7 @@ export const Ref = Schema.Struct({
37
37
  export { Compatibility, MaxTokensField, MediaInput, ReasoningField };
38
38
  export const Family = Schema.String.pipe(Schema.brand("Model.Family"));
39
39
  export const Type = Schema.Union([
40
- Schema.Literals(["chat", "decision", "image"]),
40
+ Schema.Literals(["chat", "decision", "image", "video"]),
41
41
  Schema.String,
42
42
  ]).annotate({ identifier: "Model.Type" });
43
43
  export const Settings = Schema.StructWithRest(Schema.Struct(Struct.pick(Provider.Settings.schema.fields, ["compaction", "cache", "encoding"])),
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.3.0",
4
+ "version": "2.3.2",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {