@opencode/schema 2.0.26 → 2.0.27

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.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)),
@@ -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,
@@ -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,
package/dist/provider.js CHANGED
@@ -3,7 +3,7 @@ import { Effect, Schema } from "effect";
3
3
  import { Integration } from "./integration.js";
4
4
  import { optional, statics } from "./schema.js";
5
5
  import { ephemeral, inventory } from "./event.js";
6
- export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), statics((schema) => ({
6
+ export const ID = Schema.String.pipe(Schema.brand("Provider.ID"), Schema.annotate({ identifier: "Provider.ID" }), statics((schema) => ({
7
7
  opencode: schema.make("opencode"),
8
8
  anthropic: schema.make("anthropic"),
9
9
  openai: schema.make("openai"),
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.27",
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",