@opencode-ai/schema 0.0.0-beta-18414 → 0.0.0-beta-18593

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.
@@ -56,12 +56,24 @@ declare const Model_base: Schema.Class<Model, Schema.Struct<{
56
56
  readonly input: Schema.$Array<Schema.String>;
57
57
  readonly output: Schema.$Array<Schema.String>;
58
58
  readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
59
- }>>>, Schema.optionalKey<Schema.Struct<{
59
+ }> & {
60
+ default: () => {
61
+ tools: true;
62
+ input: string[];
63
+ output: string[];
64
+ };
65
+ }>>, Schema.optionalKey<Schema.Struct<{
60
66
  readonly tools: Schema.Boolean;
61
67
  readonly input: Schema.$Array<Schema.String>;
62
68
  readonly output: Schema.$Array<Schema.String>;
63
69
  readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
64
- }>>, never, never>;
70
+ }> & {
71
+ default: () => {
72
+ tools: true;
73
+ input: string[];
74
+ output: string[];
75
+ };
76
+ }>, never, never>;
65
77
  readonly variants: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
66
78
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
67
79
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
@@ -306,6 +306,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
306
306
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
307
307
  };
308
308
  }>, never, never>;
309
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
309
310
  readonly version: Schema.String;
310
311
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
311
312
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -389,6 +390,7 @@ export declare const ServerDefinitions: readonly [Schema.Struct<{
389
390
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
390
391
  };
391
392
  }>, never, never>;
393
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
392
394
  readonly version: Schema.String;
393
395
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
394
396
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -6348,6 +6350,7 @@ export declare const Definitions: readonly [Schema.Struct<{
6348
6350
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
6349
6351
  };
6350
6352
  }>, never, never>;
6353
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
6351
6354
  readonly version: Schema.String;
6352
6355
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
6353
6356
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -6431,6 +6434,7 @@ export declare const Definitions: readonly [Schema.Struct<{
6431
6434
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
6432
6435
  };
6433
6436
  }>, never, never>;
6437
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
6434
6438
  readonly version: Schema.String;
6435
6439
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
6436
6440
  create: () => string & import("effect/Brand").Brand<"SessionID">;
package/dist/model.d.ts CHANGED
@@ -53,7 +53,13 @@ export declare const Capabilities: Schema.Struct<{
53
53
  readonly input: Schema.$Array<Schema.String>;
54
54
  readonly output: Schema.$Array<Schema.String>;
55
55
  readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
56
- }>;
56
+ }> & {
57
+ default: () => {
58
+ tools: true;
59
+ input: string[];
60
+ output: string[];
61
+ };
62
+ };
57
63
  export interface Cost extends Schema.Schema.Type<typeof Cost> {
58
64
  }
59
65
  export declare const Cost: Schema.Struct<{
@@ -95,7 +101,13 @@ export declare const Info: Schema.Struct<{
95
101
  readonly input: Schema.$Array<Schema.String>;
96
102
  readonly output: Schema.$Array<Schema.String>;
97
103
  readonly responsesWebsockets: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
98
- }>;
104
+ }> & {
105
+ default: () => {
106
+ tools: true;
107
+ input: string[];
108
+ output: string[];
109
+ };
110
+ };
99
111
  readonly variants: Schema.$Array<Schema.Struct<{
100
112
  readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
101
113
  readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
package/dist/model.js CHANGED
@@ -50,7 +50,11 @@ export const Capabilities = Schema.Struct({
50
50
  input: Schema.Array(Schema.String),
51
51
  output: Schema.Array(Schema.String),
52
52
  responsesWebsockets: Schema.Boolean.pipe(optional),
53
- }).annotate({ identifier: "Model.Capabilities" });
53
+ })
54
+ .annotate({ identifier: "Model.Capabilities" })
55
+ .pipe(statics(() => ({
56
+ default: () => ({ tools: true, input: ["text", "image"], output: ["text"] }),
57
+ })));
54
58
  export const Cost = Schema.Struct({
55
59
  tier: Schema.Struct({
56
60
  type: Schema.tag("context"),
@@ -97,7 +101,7 @@ export const Info = Schema.Struct({
97
101
  modelID: id,
98
102
  providerID,
99
103
  name: id,
100
- capabilities: { tools: true, input: ["text", "image"], output: ["text"] },
104
+ capabilities: Capabilities.default(),
101
105
  variants: [],
102
106
  time: { released: 0 },
103
107
  cost: [],
@@ -97,6 +97,27 @@ export declare const Snapshot: Schema.Struct<{
97
97
  }>;
98
98
  export interface Snapshot extends Schema.Schema.Type<typeof Snapshot> {
99
99
  }
100
+ export declare const ReadLines: Schema.Int;
101
+ export declare const ReadResult: Schema.Struct<{
102
+ readonly ptyID: Schema.brand<Schema.String, "PtyID"> & {
103
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
104
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
105
+ };
106
+ readonly title: Schema.String;
107
+ readonly cwd: Schema.String;
108
+ readonly foregroundProcess: Schema.NullOr<Schema.String>;
109
+ readonly screen: Schema.Struct<{
110
+ readonly text: Schema.String;
111
+ readonly cols: Schema.Int;
112
+ readonly rows: Schema.Int;
113
+ readonly cursor: Schema.Struct<{
114
+ readonly x: Schema.Int;
115
+ readonly y: Schema.Int;
116
+ }>;
117
+ }>;
118
+ }>;
119
+ export interface ReadResult extends Schema.Schema.Type<typeof ReadResult> {
120
+ }
100
121
  export declare const Added: Schema.Struct<{
101
122
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
102
123
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -35,6 +35,21 @@ export const Snapshot = Schema.Struct({
35
35
  checkpoint: Schema.Uint8Array,
36
36
  cursor: Schema.Struct({ x: NonNegativeInt, y: NonNegativeInt }),
37
37
  }).annotate({ identifier: "PersistentPty.Snapshot" });
38
+ export const ReadLines = PositiveInt.check(Schema.isLessThanOrEqualTo(65535)).annotate({
39
+ identifier: "PersistentPty.ReadLines",
40
+ });
41
+ export const ReadResult = Schema.Struct({
42
+ ptyID: Pty.ID,
43
+ title: Schema.String,
44
+ cwd: Schema.String,
45
+ foregroundProcess: Schema.NullOr(Schema.String),
46
+ screen: Schema.Struct({
47
+ text: Schema.String,
48
+ cols: PositiveInt,
49
+ rows: PositiveInt,
50
+ cursor: Snapshot.fields.cursor,
51
+ }),
52
+ }).annotate({ identifier: "PersistentPty.ReadResult" });
38
53
  export const Added = ephemeral({ type: "persistent-pty.added", schema: { sessionID: Session.ID, terminal: Info } });
39
54
  export const Removed = ephemeral({ type: "persistent-pty.removed", schema: { sessionID: Session.ID, ptyID: Pty.ID } });
40
55
  export const Event = { Added, Removed, Definitions: inventory(Added, Removed) };
@@ -111,6 +111,8 @@ export declare const Created: Schema.Struct<{
111
111
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
112
112
  };
113
113
  }>, never, never>;
114
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
115
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
114
116
  readonly version: Schema.String;
115
117
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
116
118
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -194,6 +196,8 @@ export declare const Created: Schema.Struct<{
194
196
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
195
197
  };
196
198
  }>, never, never>;
199
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
200
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
197
201
  readonly version: Schema.String;
198
202
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
199
203
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -4234,6 +4238,8 @@ export declare const Definitions: readonly [Schema.Struct<{
4234
4238
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
4235
4239
  };
4236
4240
  }>, never, never>;
4241
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
4242
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
4237
4243
  readonly version: Schema.String;
4238
4244
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
4239
4245
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -4317,6 +4323,8 @@ export declare const Definitions: readonly [Schema.Struct<{
4317
4323
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
4318
4324
  };
4319
4325
  }>, never, never>;
4326
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
4327
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
4320
4328
  readonly version: Schema.String;
4321
4329
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
4322
4330
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -8159,6 +8167,8 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
8159
8167
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
8160
8168
  };
8161
8169
  }>, never, never>;
8170
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
8171
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
8162
8172
  readonly version: Schema.String;
8163
8173
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
8164
8174
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -8242,6 +8252,8 @@ export declare const DurableDefinitions: readonly [...((Schema.Struct<{
8242
8252
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
8243
8253
  };
8244
8254
  }>, never, never>;
8255
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
8256
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
8245
8257
  readonly version: Schema.String;
8246
8258
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
8247
8259
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -12161,6 +12173,8 @@ export declare const Durable: Schema.Union<readonly [...((Schema.Struct<{
12161
12173
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
12162
12174
  };
12163
12175
  }>, never, never>;
12176
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
12177
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
12164
12178
  readonly version: Schema.String;
12165
12179
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
12166
12180
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -12244,6 +12258,8 @@ export declare const Durable: Schema.Union<readonly [...((Schema.Struct<{
12244
12258
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
12245
12259
  };
12246
12260
  }>, never, never>;
12261
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
12262
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
12247
12263
  readonly version: Schema.String;
12248
12264
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
12249
12265
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -15837,6 +15853,8 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Union<re
15837
15853
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
15838
15854
  };
15839
15855
  }>, never, never>;
15856
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
15857
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
15840
15858
  readonly version: Schema.String;
15841
15859
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
15842
15860
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -15920,6 +15938,8 @@ export declare const All: Schema.toTaggedUnion<"type", readonly [Schema.Union<re
15920
15938
  readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
15921
15939
  };
15922
15940
  }>, never, never>;
15941
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
15942
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
15923
15943
  readonly version: Schema.String;
15924
15944
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
15925
15945
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -8,6 +8,7 @@ import { Model } from "./model.js";
8
8
  import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js";
9
9
  import { FileAttachment } from "./prompt.js";
10
10
  import { SessionID } from "./session-id.js";
11
+ import { SessionMetadata } from "./session-metadata.js";
11
12
  import { Location } from "./location.js";
12
13
  import { SessionMessage } from "./session-message.js";
13
14
  import { Revert } from "./session-revert.js";
@@ -53,6 +54,8 @@ export const Created = Event.durable({
53
54
  title: Schema.String.pipe(optional),
54
55
  agent: Agent.ID.pipe(optional),
55
56
  model: Model.Ref.pipe(optional),
57
+ /** Host-supplied annotations resolved at creation, including any inherited from a parent. */
58
+ metadata: SessionMetadata.pipe(optional),
56
59
  version: Schema.String,
57
60
  },
58
61
  });
@@ -0,0 +1,8 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Host-supplied session annotations, durable from creation and opaque to
4
+ * core. Keys are arbitrary; values must be JSON-serializable. Children and
5
+ * forks inherit the parent's metadata unless the creator supplies its own.
6
+ */
7
+ export declare const SessionMetadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
8
+ export type SessionMetadata = typeof SessionMetadata.Type;
@@ -0,0 +1,9 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Host-supplied session annotations, durable from creation and opaque to
4
+ * core. Keys are arbitrary; values must be JSON-serializable. Children and
5
+ * forks inherit the parent's metadata unless the creator supplies its own.
6
+ */
7
+ export const SessionMetadata = Schema.Record(Schema.String, Schema.Json).annotate({
8
+ identifier: "Session.Metadata",
9
+ });
@@ -477,4 +477,196 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
477
477
  };
478
478
  }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
479
479
  };
480
+ readonly matchOrElse: {
481
+ <Cases extends {
482
+ current?: ((value: {
483
+ readonly source: "current";
484
+ readonly revert: {
485
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
486
+ readonly files?: readonly {
487
+ readonly file: string;
488
+ readonly patch: string;
489
+ readonly additions: number;
490
+ readonly deletions: number;
491
+ readonly status: "added" | "deleted" | "modified";
492
+ }[] | undefined;
493
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
494
+ readonly partID?: string | undefined;
495
+ };
496
+ }) => any) | undefined;
497
+ legacy?: ((value: {
498
+ readonly source: "legacy";
499
+ readonly revert: {
500
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
501
+ readonly files?: readonly {
502
+ readonly path: string;
503
+ readonly status: "added" | "deleted" | "modified";
504
+ readonly additions: number;
505
+ readonly deletions: number;
506
+ readonly patch: string;
507
+ }[] | undefined;
508
+ readonly snapshot?: string | undefined;
509
+ readonly partID?: string | undefined;
510
+ readonly diff?: string | undefined;
511
+ };
512
+ }) => any) | undefined;
513
+ } & { [K in Exclude<keyof Cases, "current" | "legacy">]: never; }, OrElse extends (value: Exclude<{
514
+ readonly source: "current";
515
+ readonly revert: {
516
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
517
+ readonly files?: readonly {
518
+ readonly file: string;
519
+ readonly patch: string;
520
+ readonly additions: number;
521
+ readonly deletions: number;
522
+ readonly status: "added" | "deleted" | "modified";
523
+ }[] | undefined;
524
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
525
+ readonly partID?: string | undefined;
526
+ };
527
+ }, {
528
+ readonly source: keyof Cases;
529
+ }> | Exclude<{
530
+ readonly source: "legacy";
531
+ readonly revert: {
532
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
533
+ readonly files?: readonly {
534
+ readonly path: string;
535
+ readonly status: "added" | "deleted" | "modified";
536
+ readonly additions: number;
537
+ readonly deletions: number;
538
+ readonly patch: string;
539
+ }[] | undefined;
540
+ readonly snapshot?: string | undefined;
541
+ readonly partID?: string | undefined;
542
+ readonly diff?: string | undefined;
543
+ };
544
+ }, {
545
+ readonly source: keyof Cases;
546
+ }>) => any>(value: {
547
+ readonly source: "current";
548
+ readonly revert: {
549
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
550
+ readonly files?: readonly {
551
+ readonly file: string;
552
+ readonly patch: string;
553
+ readonly additions: number;
554
+ readonly deletions: number;
555
+ readonly status: "added" | "deleted" | "modified";
556
+ }[] | undefined;
557
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
558
+ readonly partID?: string | undefined;
559
+ };
560
+ } | {
561
+ readonly source: "legacy";
562
+ readonly revert: {
563
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
564
+ readonly files?: readonly {
565
+ readonly path: string;
566
+ readonly status: "added" | "deleted" | "modified";
567
+ readonly additions: number;
568
+ readonly deletions: number;
569
+ readonly patch: string;
570
+ }[] | undefined;
571
+ readonly snapshot?: string | undefined;
572
+ readonly partID?: string | undefined;
573
+ readonly diff?: string | undefined;
574
+ };
575
+ }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
576
+ <Cases extends {
577
+ current?: ((value: {
578
+ readonly source: "current";
579
+ readonly revert: {
580
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
581
+ readonly files?: readonly {
582
+ readonly file: string;
583
+ readonly patch: string;
584
+ readonly additions: number;
585
+ readonly deletions: number;
586
+ readonly status: "added" | "deleted" | "modified";
587
+ }[] | undefined;
588
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
589
+ readonly partID?: string | undefined;
590
+ };
591
+ }) => any) | undefined;
592
+ legacy?: ((value: {
593
+ readonly source: "legacy";
594
+ readonly revert: {
595
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
596
+ readonly files?: readonly {
597
+ readonly path: string;
598
+ readonly status: "added" | "deleted" | "modified";
599
+ readonly additions: number;
600
+ readonly deletions: number;
601
+ readonly patch: string;
602
+ }[] | undefined;
603
+ readonly snapshot?: string | undefined;
604
+ readonly partID?: string | undefined;
605
+ readonly diff?: string | undefined;
606
+ };
607
+ }) => any) | undefined;
608
+ } & { [K in Exclude<keyof Cases, "current" | "legacy">]: never; }, OrElse extends (value: Exclude<{
609
+ readonly source: "current";
610
+ readonly revert: {
611
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
612
+ readonly files?: readonly {
613
+ readonly file: string;
614
+ readonly patch: string;
615
+ readonly additions: number;
616
+ readonly deletions: number;
617
+ readonly status: "added" | "deleted" | "modified";
618
+ }[] | undefined;
619
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
620
+ readonly partID?: string | undefined;
621
+ };
622
+ }, {
623
+ readonly source: keyof Cases;
624
+ }> | Exclude<{
625
+ readonly source: "legacy";
626
+ readonly revert: {
627
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
628
+ readonly files?: readonly {
629
+ readonly path: string;
630
+ readonly status: "added" | "deleted" | "modified";
631
+ readonly additions: number;
632
+ readonly deletions: number;
633
+ readonly patch: string;
634
+ }[] | undefined;
635
+ readonly snapshot?: string | undefined;
636
+ readonly partID?: string | undefined;
637
+ readonly diff?: string | undefined;
638
+ };
639
+ }, {
640
+ readonly source: keyof Cases;
641
+ }>) => any>(cases: Cases, orElse: OrElse): (value: {
642
+ readonly source: "current";
643
+ readonly revert: {
644
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
645
+ readonly files?: readonly {
646
+ readonly file: string;
647
+ readonly patch: string;
648
+ readonly additions: number;
649
+ readonly deletions: number;
650
+ readonly status: "added" | "deleted" | "modified";
651
+ }[] | undefined;
652
+ readonly snapshot?: (string & import("effect/Brand").Brand<"Snapshot.ID">) | undefined;
653
+ readonly partID?: string | undefined;
654
+ };
655
+ } | {
656
+ readonly source: "legacy";
657
+ readonly revert: {
658
+ readonly messageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
659
+ readonly files?: readonly {
660
+ readonly path: string;
661
+ readonly status: "added" | "deleted" | "modified";
662
+ readonly additions: number;
663
+ readonly deletions: number;
664
+ readonly patch: string;
665
+ }[] | undefined;
666
+ readonly snapshot?: string | undefined;
667
+ readonly partID?: string | undefined;
668
+ readonly diff?: string | undefined;
669
+ };
670
+ }) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
671
+ };
480
672
  }, never, never>;
@@ -133,6 +133,7 @@ export declare const Data: Schema.Struct<{
133
133
  }>, never, never>;
134
134
  }>;
135
135
  readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
136
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
136
137
  readonly revert: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
137
138
  readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
138
139
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
package/dist/session.d.ts CHANGED
@@ -2,6 +2,7 @@ export * as Session from "./session.js";
2
2
  import { Schema } from "effect";
3
3
  import { SessionEvent } from "./session-event.js";
4
4
  import { SessionID } from "./session-id.js";
5
+ import { SessionMetadata } from "./session-metadata.js";
5
6
  import { Revert } from "./session-revert.js";
6
7
  import { SessionFork } from "./session-fork.js";
7
8
  export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
@@ -9,6 +10,8 @@ export declare const ID: Schema.brand<Schema.String, "SessionID"> & {
9
10
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
10
11
  };
11
12
  export type ID = SessionID;
13
+ export declare const Metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
14
+ export type Metadata = SessionMetadata;
12
15
  export declare const Event: typeof SessionEvent;
13
16
  export { Revert };
14
17
  export declare const ForkBoundary: Schema.Union<readonly [Schema.Struct<{
@@ -168,6 +171,7 @@ export declare const Info: Schema.Struct<{
168
171
  }>, never, never>;
169
172
  }>;
170
173
  readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
174
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
171
175
  readonly revert: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
172
176
  readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
173
177
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
package/dist/session.js CHANGED
@@ -7,11 +7,13 @@ import { Project } from "./project.js";
7
7
  import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
8
8
  import { SessionEvent } from "./session-event.js";
9
9
  import { SessionID } from "./session-id.js";
10
+ import { SessionMetadata } from "./session-metadata.js";
10
11
  import { Money } from "./money.js";
11
12
  import { TokenUsage } from "./token-usage.js";
12
13
  import { Revert } from "./session-revert.js";
13
14
  import { SessionFork } from "./session-fork.js";
14
15
  export const ID = SessionID;
16
+ export const Metadata = SessionMetadata;
15
17
  export const Event = SessionEvent;
16
18
  export { Revert };
17
19
  export const ForkBoundary = SessionFork.Boundary;
@@ -40,6 +42,7 @@ export const Info = Schema.Struct({
40
42
  title: Schema.String.pipe(optional),
41
43
  location: Location.Ref,
42
44
  subpath: RelativePath.pipe(optional),
45
+ metadata: Metadata.pipe(optional),
43
46
  revert: Revert.pipe(optional),
44
47
  }).annotate({ identifier: "Session.Info" });
45
48
  export const ListAnchor = Schema.Struct({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/schema",
4
- "version": "0.0.0-beta-18414",
4
+ "version": "0.0.0-beta-18593",
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.111"
34
+ "effect": "4.0.0-rc.112"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/bun": "1.0.9",