@opencode/schema 2.2.6 → 2.2.7

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.
@@ -4,7 +4,6 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
4
4
  readonly portable_shell_scanner: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
5
5
  readonly all_flags: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
6
6
  readonly part_rows: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
7
- readonly codemode_vm: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
8
7
  readonly image_generate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
9
8
  readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.Struct<{
10
9
  readonly providerID: Schema.brand<Schema.String, "Provider.ID">;
@@ -63,6 +62,8 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
63
62
  }>, never, never>>>, never, never>;
64
63
  readonly artifacts: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
65
64
  readonly background_compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
65
+ readonly codemode_vm: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
66
+ readonly console_watches: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
66
67
  readonly media_blob: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
67
68
  readonly schedules: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
68
69
  readonly todo: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
@@ -17,9 +17,6 @@ export class Info extends Schema.Class("ConfigExperimental.Info")({
17
17
  part_rows: Schema.Boolean.pipe(optional).annotate({
18
18
  description: "Write each assistant part as its own session_part row instead of rewriting the whole message on every event. Defaults to false.",
19
19
  }),
20
- codemode_vm: Schema.Boolean.pipe(optional).annotate({
21
- description: "Run the Code Mode execute tool on the experimental bytecode VM instead of the legacy interpreter. Defaults to false.",
22
- }),
23
20
  image_generate: Schema.Union([
24
21
  Schema.Boolean,
25
22
  Schema.Struct({
@@ -12,5 +12,7 @@ export declare const registry: {
12
12
  readonly media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.";
13
13
  readonly schedules: "Enable experimental scheduled tasks that wake a session with a prompt.";
14
14
  readonly artifacts: "Enable experimental artifacts backed by pluggable providers.";
15
+ readonly codemode_vm: "Run the Code Mode execute tool on the experimental bytecode VM instead of the legacy interpreter.";
16
+ 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.";
15
17
  };
16
18
  export type Key = keyof typeof registry;
@@ -12,4 +12,6 @@ export const registry = {
12
12
  media_blob: "Store new session media once in a deduplicated blob table instead of inline in every message row.",
13
13
  schedules: "Enable experimental scheduled tasks that wake a session with a prompt.",
14
14
  artifacts: "Enable experimental artifacts backed by pluggable providers.",
15
+ codemode_vm: "Run the Code Mode execute tool on the experimental bytecode VM instead of the legacy interpreter.",
16
+ 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.",
15
17
  };
@@ -8,7 +8,7 @@ export class Info extends Schema.Class("Config.Warming")({
8
8
  interval: Schema.Union([Schema.Literal("auto"), Schema.DurationFromString])
9
9
  .pipe(optional)
10
10
  .annotate({
11
- description: 'Idle time between keep-alive requests (default: "4 minutes"). "auto" uses 90% of the model\'s cache.ttl and skips models without one.',
11
+ description: 'Idle time between keep-alive requests (default: "auto"). "auto" uses 90% of the model\'s cache.ttl, or 4 minutes when it has none.',
12
12
  }),
13
13
  duration: Schema.DurationFromString.pipe(optional).annotate({
14
14
  description: 'Time after the last active request to keep a session warm (default: "30 minutes")',
@@ -31,12 +31,22 @@ export declare const Event: {
31
31
  create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
32
32
  }>, never, never>;
33
33
  }>>, never, never>;
34
- readonly data: Schema.Struct<{}>;
34
+ readonly data: Schema.Struct<{
35
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
36
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
37
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
38
+ };
39
+ }>;
35
40
  }> & {
36
41
  type: "credential.updated";
37
42
  durability: "ephemeral";
38
43
  durable: undefined;
39
- data: Schema.Struct<{}>;
44
+ data: Schema.Struct<{
45
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
46
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
47
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
48
+ };
49
+ }>;
40
50
  };
41
51
  Switched: Schema.Struct<{
42
52
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
@@ -107,12 +117,22 @@ export declare const Event: {
107
117
  create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
108
118
  }>, never, never>;
109
119
  }>>, never, never>;
110
- readonly data: Schema.Struct<{}>;
120
+ readonly data: Schema.Struct<{
121
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
122
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
123
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
124
+ };
125
+ }>;
111
126
  }> & {
112
127
  type: "credential.updated";
113
128
  durability: "ephemeral";
114
129
  durable: undefined;
115
- data: Schema.Struct<{}>;
130
+ data: Schema.Struct<{
131
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
132
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
133
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
134
+ };
135
+ }>;
116
136
  }, Schema.Struct<{
117
137
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
118
138
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -6,9 +6,10 @@ import { IntegrationID, IntegrationMethodID } from "./integration-id.js";
6
6
  import { ascending } from "./identifier.js";
7
7
  import { NonNegativeInt, statics } from "./schema.js";
8
8
  export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), Schema.annotate({ identifier: "Credential.ID" }), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
9
+ // A login was added, renamed or removed. Every change is to exactly one credential.
9
10
  const Updated = ephemeral({
10
11
  type: "credential.updated",
11
- schema: {},
12
+ schema: { integrationID: IntegrationID, credentialID: ID },
12
13
  });
13
14
  const Switched = ephemeral({
14
15
  type: "credential.switched",
@@ -92,12 +92,22 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
92
92
  create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
93
93
  }>, never, never>;
94
94
  }>>, never, never>;
95
- readonly data: Schema.Struct<{}>;
95
+ readonly data: Schema.Struct<{
96
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
97
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
98
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
99
+ };
100
+ }>;
96
101
  }> & {
97
102
  type: "credential.updated";
98
103
  durability: "ephemeral";
99
104
  durable: undefined;
100
- data: Schema.Struct<{}>;
105
+ data: Schema.Struct<{
106
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
107
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
108
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
109
+ };
110
+ }>;
101
111
  }, Schema.Struct<{
102
112
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
103
113
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -6466,12 +6476,22 @@ export declare const Definitions: readonly [Schema.Struct<{
6466
6476
  create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
6467
6477
  }>, never, never>;
6468
6478
  }>>, never, never>;
6469
- readonly data: Schema.Struct<{}>;
6479
+ readonly data: Schema.Struct<{
6480
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
6481
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
6482
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
6483
+ };
6484
+ }>;
6470
6485
  }> & {
6471
6486
  type: "credential.updated";
6472
6487
  durability: "ephemeral";
6473
6488
  durable: undefined;
6474
- data: Schema.Struct<{}>;
6489
+ data: Schema.Struct<{
6490
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
6491
+ readonly credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
6492
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
6493
+ };
6494
+ }>;
6475
6495
  }, Schema.Struct<{
6476
6496
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
6477
6497
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -133,6 +133,13 @@ export declare const PredicateQuestion: Schema.Struct<{
133
133
  readonly type: Schema.Literal<"predicate">;
134
134
  readonly name: Schema.String;
135
135
  readonly instructions: Schema.String;
136
+ readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
137
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
138
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
139
+ }>>>, Schema.optionalKey<Schema.Struct<{
140
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
141
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
142
+ }>>, never, never>;
136
143
  }>;
137
144
  export interface ChoiceQuestion extends Schema.Schema.Type<typeof ChoiceQuestion> {
138
145
  }
@@ -161,6 +168,13 @@ export declare const DecisionQuestion: Schema.Union<readonly [Schema.Struct<{
161
168
  readonly type: Schema.Literal<"predicate">;
162
169
  readonly name: Schema.String;
163
170
  readonly instructions: Schema.String;
171
+ readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
172
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
173
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
174
+ }>>>, Schema.optionalKey<Schema.Struct<{
175
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
176
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
177
+ }>>, never, never>;
164
178
  }>, Schema.Struct<{
165
179
  readonly type: Schema.Literal<"choice">;
166
180
  readonly name: Schema.String;
@@ -221,6 +235,13 @@ export declare const DecisionRequest: Schema.Struct<{
221
235
  readonly type: Schema.Literal<"predicate">;
222
236
  readonly name: Schema.String;
223
237
  readonly instructions: Schema.String;
238
+ readonly criteria: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
239
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
240
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
241
+ }>>>, Schema.optionalKey<Schema.Struct<{
242
+ readonly true: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
243
+ readonly false: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
244
+ }>>, never, never>;
224
245
  }>, Schema.Struct<{
225
246
  readonly type: Schema.Literal<"choice">;
226
247
  readonly name: Schema.String;
package/dist/generate.js CHANGED
@@ -71,6 +71,9 @@ export const PredicateQuestion = Schema.Struct({
71
71
  type: Schema.Literal("predicate"),
72
72
  name: QuestionName,
73
73
  instructions: Schema.String,
74
+ criteria: Schema.Struct({ true: Schema.String.pipe(optional), false: Schema.String.pipe(optional) })
75
+ .pipe(optional)
76
+ .annotate(description("What counts as true and as false, for statements the instructions alone leave ambiguous")),
74
77
  }).annotate({ identifier: "Generate.PredicateQuestion", description: "The probability that a statement is true" });
75
78
  export const ChoiceQuestion = Schema.Struct({
76
79
  type: Schema.Literal("choice"),
package/dist/provider.js CHANGED
@@ -41,7 +41,7 @@ export const CacheWarming = Schema.Union([
41
41
  // Settings hold JSON, so durations stay strings here; the warming plugin parses them.
42
42
  interval: Schema.Union([Schema.Literal("auto"), Schema.String])
43
43
  .pipe(optional)
44
- .annotate({ description: 'Duration such as "4 minutes", or "auto" for 90% of the model\'s cache.ttl' }),
44
+ .annotate({ description: 'Duration such as "4 minutes", or "auto" (default) for 90% of the model\'s cache.ttl' }),
45
45
  duration: Schema.String.pipe(optional).annotate({ description: 'Duration such as "30 minutes"' }),
46
46
  }),
47
47
  ]).annotate({ identifier: "Provider.CacheWarming" });
@@ -1107,7 +1107,7 @@ export declare const UsageRecorded: Schema.Struct<{
1107
1107
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1108
1108
  create: () => string & import("effect/Brand").Brand<"SessionID">;
1109
1109
  };
1110
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
1110
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
1111
1111
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
1112
1112
  zero: number & import("effect/Brand").Brand<"Money.USD">;
1113
1113
  };
@@ -1132,7 +1132,7 @@ export declare const UsageRecorded: Schema.Struct<{
1132
1132
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
1133
1133
  create: () => string & import("effect/Brand").Brand<"SessionID">;
1134
1134
  };
1135
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
1135
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
1136
1136
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
1137
1137
  zero: number & import("effect/Brand").Brand<"Money.USD">;
1138
1138
  };
@@ -12461,7 +12461,7 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
12461
12461
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
12462
12462
  create: () => string & import("effect/Brand").Brand<"SessionID">;
12463
12463
  };
12464
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
12464
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
12465
12465
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
12466
12466
  zero: number & import("effect/Brand").Brand<"Money.USD">;
12467
12467
  };
@@ -12486,7 +12486,7 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
12486
12486
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
12487
12487
  create: () => string & import("effect/Brand").Brand<"SessionID">;
12488
12488
  };
12489
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
12489
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
12490
12490
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
12491
12491
  zero: number & import("effect/Brand").Brand<"Money.USD">;
12492
12492
  };
@@ -16859,7 +16859,7 @@ export declare const Durable: Schema.toTaggedUnion<"type", readonly [...((Schema
16859
16859
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
16860
16860
  create: () => string & import("effect/Brand").Brand<"SessionID">;
16861
16861
  };
16862
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
16862
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
16863
16863
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
16864
16864
  zero: number & import("effect/Brand").Brand<"Money.USD">;
16865
16865
  };
@@ -16884,7 +16884,7 @@ export declare const Durable: Schema.toTaggedUnion<"type", readonly [...((Schema
16884
16884
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
16885
16885
  create: () => string & import("effect/Brand").Brand<"SessionID">;
16886
16886
  };
16887
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
16887
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
16888
16888
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
16889
16889
  zero: number & import("effect/Brand").Brand<"Money.USD">;
16890
16890
  };
@@ -20943,7 +20943,7 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.toTagged
20943
20943
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
20944
20944
  create: () => string & import("effect/Brand").Brand<"SessionID">;
20945
20945
  };
20946
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
20946
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
20947
20947
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
20948
20948
  zero: number & import("effect/Brand").Brand<"Money.USD">;
20949
20949
  };
@@ -20968,7 +20968,7 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.toTagged
20968
20968
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
20969
20969
  create: () => string & import("effect/Brand").Brand<"SessionID">;
20970
20970
  };
20971
- readonly source: Schema.Literals<readonly ["title", "compaction"]>;
20971
+ readonly source: Schema.Literals<readonly ["title", "compaction", "generate"]>;
20972
20972
  readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
20973
20973
  zero: number & import("effect/Brand").Brand<"Money.USD">;
20974
20974
  };
@@ -137,7 +137,7 @@ export const UsageRecorded = Event.durable({
137
137
  ...options,
138
138
  schema: {
139
139
  ...Base,
140
- source: Schema.Literals(["title", "compaction"]),
140
+ source: Schema.Literals(["title", "compaction", "generate"]),
141
141
  cost: Money.USD,
142
142
  tokens: TokenUsage.Info,
143
143
  },
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.2.6",
4
+ "version": "2.2.7",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -17,12 +17,12 @@
17
17
  ],
18
18
  "exports": {
19
19
  ".": {
20
- "import": "./dist/index.js",
21
- "types": "./dist/index.d.ts"
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
22
  },
23
23
  "./*": {
24
- "import": "./dist/*.js",
25
- "types": "./dist/*.d.ts"
24
+ "types": "./dist/*.d.ts",
25
+ "import": "./dist/*.js"
26
26
  }
27
27
  },
28
28
  "scripts": {