@opencode/schema 2.1.4 → 2.2.1

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.
Files changed (43) hide show
  1. package/dist/agent.d.ts +5 -0
  2. package/dist/config/experimental.d.ts +39 -0
  3. package/dist/config/experimental.js +19 -0
  4. package/dist/config/provider.d.ts +57 -11
  5. package/dist/config/provider.js +15 -16
  6. package/dist/config.d.ts +1 -0
  7. package/dist/config.js +3 -0
  8. package/dist/event-manifest.d.ts +8 -0
  9. package/dist/file-diff.d.ts +2 -0
  10. package/dist/file-diff.js +2 -0
  11. package/dist/generate.d.ts +355 -0
  12. package/dist/generate.js +134 -0
  13. package/dist/goal.d.ts +126 -0
  14. package/dist/goal.js +40 -0
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/mcp.d.ts +1 -0
  18. package/dist/mcp.js +2 -0
  19. package/dist/model-compatibility.d.ts +15 -4
  20. package/dist/model-compatibility.js +15 -4
  21. package/dist/model.d.ts +39 -8
  22. package/dist/model.js +12 -7
  23. package/dist/plugin.d.ts +15 -0
  24. package/dist/plugin.js +11 -1
  25. package/dist/prompt.d.ts +96 -0
  26. package/dist/prompt.js +17 -1
  27. package/dist/provider.d.ts +40 -0
  28. package/dist/provider.js +14 -3
  29. package/dist/schedule.d.ts +220 -0
  30. package/dist/schedule.js +110 -0
  31. package/dist/session-event.d.ts +20 -0
  32. package/dist/session-inbox.d.ts +714 -86
  33. package/dist/session-inbox.js +10 -1
  34. package/dist/session-message.d.ts +968 -0
  35. package/dist/session-message.js +19 -1
  36. package/dist/session-revert.d.ts +37 -0
  37. package/dist/session-transfer.d.ts +4 -0
  38. package/dist/session.d.ts +4 -0
  39. package/dist/usage-limits.d.ts +227 -0
  40. package/dist/usage-limits.js +59 -0
  41. package/dist/vcs.d.ts +3 -0
  42. package/dist/vcs.js +2 -0
  43. package/package.json +2 -1
@@ -5,7 +5,7 @@ import { Content } from "./tool.js";
5
5
  import { Location } from "./location.js";
6
6
  import { Model } from "./model.js";
7
7
  import { Project } from "./project.js";
8
- import { Prompt } from "./prompt.js";
8
+ import { Attachment, Prompt } from "./prompt.js";
9
9
  import { DateTimeUtcFromMillis, PositiveInt, RelativePath, statics } from "./schema.js";
10
10
  import { ascending } from "./identifier.js";
11
11
  import { Shell as ShellSchema } from "./shell.js";
@@ -64,6 +64,10 @@ export const User = Schema.Struct({
64
64
  skills: Prompt.fields.skills,
65
65
  type: Schema.tag("user"),
66
66
  }).annotate({ identifier: "Session.Message.User" });
67
+ export const MediaUser = Schema.Struct({
68
+ ...User.fields,
69
+ files: Schema.Array(Attachment).pipe(optional),
70
+ }).annotate({ identifier: "Session.Message.MediaUser" });
67
71
  export const Synthetic = Schema.Struct({
68
72
  ...Base,
69
73
  text: Schema.String,
@@ -232,3 +236,17 @@ export const Info = Schema.Union([
232
236
  Compaction,
233
237
  Idle,
234
238
  ]).annotate({ identifier: "Session.Message.Info" });
239
+ /** {@link Info} with {@link MediaUser} for clients that opt into `experimental-media-uri`. */
240
+ export const MediaInfo = Schema.Union([
241
+ AgentSelected,
242
+ ModelSelected,
243
+ LocationSwitched,
244
+ MediaUser,
245
+ Synthetic,
246
+ System,
247
+ Skill,
248
+ Shell,
249
+ Assistant,
250
+ Compaction,
251
+ Idle,
252
+ ]).annotate({ identifier: "Session.Message.MediaInfo" });
@@ -15,12 +15,14 @@ export declare const Revert: Schema.Struct<{
15
15
  readonly additions: Schema.Int;
16
16
  readonly deletions: Schema.Int;
17
17
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
18
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
18
19
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
19
20
  readonly file: Schema.String;
20
21
  readonly patch: Schema.String;
21
22
  readonly additions: Schema.Int;
22
23
  readonly deletions: Schema.Int;
23
24
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
25
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
24
26
  }>>>, never, never>;
25
27
  }>;
26
28
  export interface RevertV1 extends Schema.Schema.Type<typeof RevertV1> {
@@ -62,12 +64,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
62
64
  readonly additions: Schema.Int;
63
65
  readonly deletions: Schema.Int;
64
66
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
67
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
65
68
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
66
69
  readonly file: Schema.String;
67
70
  readonly patch: Schema.String;
68
71
  readonly additions: Schema.Int;
69
72
  readonly deletions: Schema.Int;
70
73
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
74
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
71
75
  }>>>, never, never>;
72
76
  }>>, Schema.Union<readonly [Schema.decodeTo<Schema.Struct<{
73
77
  readonly source: Schema.tag<"current">;
@@ -85,12 +89,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
85
89
  readonly additions: Schema.Int;
86
90
  readonly deletions: Schema.Int;
87
91
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
92
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
88
93
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
89
94
  readonly file: Schema.String;
90
95
  readonly patch: Schema.String;
91
96
  readonly additions: Schema.Int;
92
97
  readonly deletions: Schema.Int;
93
98
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
99
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
94
100
  }>>>, never, never>;
95
101
  }>>;
96
102
  }>, Schema.Struct<{
@@ -107,12 +113,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
107
113
  readonly additions: Schema.Int;
108
114
  readonly deletions: Schema.Int;
109
115
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
116
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
110
117
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
111
118
  readonly file: Schema.String;
112
119
  readonly patch: Schema.String;
113
120
  readonly additions: Schema.Int;
114
121
  readonly deletions: Schema.Int;
115
122
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
123
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
116
124
  }>>>, never, never>;
117
125
  }>, never, never>, Schema.decodeTo<Schema.Struct<{
118
126
  readonly source: Schema.tag<"legacy">;
@@ -178,12 +186,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
178
186
  readonly additions: Schema.Int;
179
187
  readonly deletions: Schema.Int;
180
188
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
189
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
181
190
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
182
191
  readonly file: Schema.String;
183
192
  readonly patch: Schema.String;
184
193
  readonly additions: Schema.Int;
185
194
  readonly deletions: Schema.Int;
186
195
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
196
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
187
197
  }>>>, never, never>;
188
198
  }>>;
189
199
  }>, Schema.Struct<{
@@ -200,12 +210,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
200
210
  readonly additions: Schema.Int;
201
211
  readonly deletions: Schema.Int;
202
212
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
213
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
203
214
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
204
215
  readonly file: Schema.String;
205
216
  readonly patch: Schema.String;
206
217
  readonly additions: Schema.Int;
207
218
  readonly deletions: Schema.Int;
208
219
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
220
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
209
221
  }>>>, never, never>;
210
222
  }>, never, never>;
211
223
  legacy: Schema.decodeTo<Schema.Struct<{
@@ -267,6 +279,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
267
279
  readonly additions: number;
268
280
  readonly deletions: number;
269
281
  readonly status: "added" | "deleted" | "modified";
282
+ readonly more?: true | undefined;
270
283
  }[] | undefined;
271
284
  };
272
285
  } | {
@@ -296,6 +309,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
296
309
  readonly additions: number;
297
310
  readonly deletions: number;
298
311
  readonly status: "added" | "deleted" | "modified";
312
+ readonly more?: true | undefined;
299
313
  }[] | undefined;
300
314
  };
301
315
  }, {
@@ -331,6 +345,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
331
345
  readonly additions: number;
332
346
  readonly deletions: number;
333
347
  readonly status: "added" | "deleted" | "modified";
348
+ readonly more?: true | undefined;
334
349
  }[] | undefined;
335
350
  };
336
351
  };
@@ -368,12 +383,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
368
383
  readonly additions: Schema.Int;
369
384
  readonly deletions: Schema.Int;
370
385
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
386
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
371
387
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
372
388
  readonly file: Schema.String;
373
389
  readonly patch: Schema.String;
374
390
  readonly additions: Schema.Int;
375
391
  readonly deletions: Schema.Int;
376
392
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
393
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
377
394
  }>>>, never, never>;
378
395
  }>>;
379
396
  }>, Schema.Struct<{
@@ -390,12 +407,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
390
407
  readonly additions: Schema.Int;
391
408
  readonly deletions: Schema.Int;
392
409
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
410
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
393
411
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
394
412
  readonly file: Schema.String;
395
413
  readonly patch: Schema.String;
396
414
  readonly additions: Schema.Int;
397
415
  readonly deletions: Schema.Int;
398
416
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
417
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
399
418
  }>>>, never, never>;
400
419
  }>, never, never> | Schema.decodeTo<Schema.Struct<{
401
420
  readonly source: Schema.tag<"legacy">;
@@ -454,6 +473,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
454
473
  readonly additions: number;
455
474
  readonly deletions: number;
456
475
  readonly status: "added" | "deleted" | "modified";
476
+ readonly more?: true | undefined;
457
477
  }[] | undefined;
458
478
  };
459
479
  } | {
@@ -488,12 +508,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
488
508
  readonly additions: Schema.Int;
489
509
  readonly deletions: Schema.Int;
490
510
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
511
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
491
512
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
492
513
  readonly file: Schema.String;
493
514
  readonly patch: Schema.String;
494
515
  readonly additions: Schema.Int;
495
516
  readonly deletions: Schema.Int;
496
517
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
518
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
497
519
  }>>>, never, never>;
498
520
  }>>;
499
521
  }>, Schema.Struct<{
@@ -510,12 +532,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
510
532
  readonly additions: Schema.Int;
511
533
  readonly deletions: Schema.Int;
512
534
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
535
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
513
536
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
514
537
  readonly file: Schema.String;
515
538
  readonly patch: Schema.String;
516
539
  readonly additions: Schema.Int;
517
540
  readonly deletions: Schema.Int;
518
541
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
542
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
519
543
  }>>>, never, never>;
520
544
  }>, never, never> | Schema.decodeTo<Schema.Struct<{
521
545
  readonly source: Schema.tag<"legacy">;
@@ -574,6 +598,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
574
598
  readonly additions: number;
575
599
  readonly deletions: number;
576
600
  readonly status: "added" | "deleted" | "modified";
601
+ readonly more?: true | undefined;
577
602
  }[] | undefined;
578
603
  };
579
604
  } | {
@@ -610,12 +635,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
610
635
  readonly additions: Schema.Int;
611
636
  readonly deletions: Schema.Int;
612
637
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
638
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
613
639
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
614
640
  readonly file: Schema.String;
615
641
  readonly patch: Schema.String;
616
642
  readonly additions: Schema.Int;
617
643
  readonly deletions: Schema.Int;
618
644
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
645
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
619
646
  }>>>, never, never>;
620
647
  }>>;
621
648
  }>, Schema.Struct<{
@@ -632,12 +659,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
632
659
  readonly additions: Schema.Int;
633
660
  readonly deletions: Schema.Int;
634
661
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
662
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
635
663
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
636
664
  readonly file: Schema.String;
637
665
  readonly patch: Schema.String;
638
666
  readonly additions: Schema.Int;
639
667
  readonly deletions: Schema.Int;
640
668
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
669
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
641
670
  }>>>, never, never>;
642
671
  }>, never, never> | Schema.decodeTo<Schema.Struct<{
643
672
  readonly source: Schema.tag<"legacy">;
@@ -696,6 +725,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
696
725
  readonly additions: number;
697
726
  readonly deletions: number;
698
727
  readonly status: "added" | "deleted" | "modified";
728
+ readonly more?: true | undefined;
699
729
  }[] | undefined;
700
730
  };
701
731
  } | {
@@ -725,6 +755,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
725
755
  readonly additions: number;
726
756
  readonly deletions: number;
727
757
  readonly status: "added" | "deleted" | "modified";
758
+ readonly more?: true | undefined;
728
759
  }[] | undefined;
729
760
  };
730
761
  } | {
@@ -759,12 +790,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
759
790
  readonly additions: Schema.Int;
760
791
  readonly deletions: Schema.Int;
761
792
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
793
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
762
794
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
763
795
  readonly file: Schema.String;
764
796
  readonly patch: Schema.String;
765
797
  readonly additions: Schema.Int;
766
798
  readonly deletions: Schema.Int;
767
799
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
800
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
768
801
  }>>>, never, never>;
769
802
  }>>;
770
803
  }>, Schema.Struct<{
@@ -781,12 +814,14 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
781
814
  readonly additions: Schema.Int;
782
815
  readonly deletions: Schema.Int;
783
816
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
817
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
784
818
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
785
819
  readonly file: Schema.String;
786
820
  readonly patch: Schema.String;
787
821
  readonly additions: Schema.Int;
788
822
  readonly deletions: Schema.Int;
789
823
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
824
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
790
825
  }>>>, never, never>;
791
826
  }>, never, never> | Schema.decodeTo<Schema.Struct<{
792
827
  readonly source: Schema.tag<"legacy">;
@@ -845,6 +880,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
845
880
  readonly additions: number;
846
881
  readonly deletions: number;
847
882
  readonly status: "added" | "deleted" | "modified";
883
+ readonly more?: true | undefined;
848
884
  }[] | undefined;
849
885
  };
850
886
  } | {
@@ -874,6 +910,7 @@ export declare const PersistedRevert: Schema.decodeTo<Schema.toType<Schema.Struc
874
910
  readonly additions: number;
875
911
  readonly deletions: number;
876
912
  readonly status: "added" | "deleted" | "modified";
913
+ readonly more?: true | undefined;
877
914
  }[] | undefined;
878
915
  };
879
916
  } | {
@@ -151,12 +151,14 @@ export declare const Data: Schema.Struct<{
151
151
  readonly additions: Schema.Int;
152
152
  readonly deletions: Schema.Int;
153
153
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
154
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
154
155
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
155
156
  readonly file: Schema.String;
156
157
  readonly patch: Schema.String;
157
158
  readonly additions: Schema.Int;
158
159
  readonly deletions: Schema.Int;
159
160
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
161
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
160
162
  }>>>, never, never>;
161
163
  }>>>, Schema.optionalKey<Schema.Struct<{
162
164
  readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
@@ -171,12 +173,14 @@ export declare const Data: Schema.Struct<{
171
173
  readonly additions: Schema.Int;
172
174
  readonly deletions: Schema.Int;
173
175
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
176
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
174
177
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
175
178
  readonly file: Schema.String;
176
179
  readonly patch: Schema.String;
177
180
  readonly additions: Schema.Int;
178
181
  readonly deletions: Schema.Int;
179
182
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
183
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
180
184
  }>>>, never, never>;
181
185
  }>>, never, never>;
182
186
  }>;
package/dist/session.d.ts CHANGED
@@ -179,12 +179,14 @@ export declare const Info: Schema.Struct<{
179
179
  readonly additions: Schema.Int;
180
180
  readonly deletions: Schema.Int;
181
181
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
182
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
182
183
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
183
184
  readonly file: Schema.String;
184
185
  readonly patch: Schema.String;
185
186
  readonly additions: Schema.Int;
186
187
  readonly deletions: Schema.Int;
187
188
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
189
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
188
190
  }>>>, never, never>;
189
191
  }>>>, Schema.optionalKey<Schema.Struct<{
190
192
  readonly messageID: Schema.brand<Schema.String, "Session.Message.ID"> & {
@@ -199,12 +201,14 @@ export declare const Info: Schema.Struct<{
199
201
  readonly additions: Schema.Int;
200
202
  readonly deletions: Schema.Int;
201
203
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
204
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
202
205
  }>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
203
206
  readonly file: Schema.String;
204
207
  readonly patch: Schema.String;
205
208
  readonly additions: Schema.Int;
206
209
  readonly deletions: Schema.Int;
207
210
  readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
211
+ readonly more: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
208
212
  }>>>, never, never>;
209
213
  }>>, never, never>;
210
214
  }>;
@@ -0,0 +1,227 @@
1
+ export * as UsageLimits from "./usage-limits.js";
2
+ import { Schema } from "effect";
3
+ /** One window of the OpenCode Go allowance. */
4
+ export interface Meter extends Schema.Schema.Type<typeof Meter> {
5
+ }
6
+ export declare const Meter: Schema.Struct<{
7
+ /** How much of the window's allowance is used. */
8
+ readonly percent: Schema.Finite;
9
+ /** Go refuses requests until the window resets. */
10
+ readonly limited: Schema.Boolean;
11
+ readonly resetsAt: Schema.Finite;
12
+ }>;
13
+ /** The OpenCode Go allowance of a workspace the member subscribes to Go in. */
14
+ export interface Go extends Schema.Schema.Type<typeof Go> {
15
+ }
16
+ export declare const Go: Schema.Struct<{
17
+ readonly rolling: Schema.Struct<{
18
+ /** How much of the window's allowance is used. */
19
+ readonly percent: Schema.Finite;
20
+ /** Go refuses requests until the window resets. */
21
+ readonly limited: Schema.Boolean;
22
+ readonly resetsAt: Schema.Finite;
23
+ }>;
24
+ readonly weekly: Schema.Struct<{
25
+ /** How much of the window's allowance is used. */
26
+ readonly percent: Schema.Finite;
27
+ /** Go refuses requests until the window resets. */
28
+ readonly limited: Schema.Boolean;
29
+ readonly resetsAt: Schema.Finite;
30
+ }>;
31
+ readonly monthly: Schema.Struct<{
32
+ /** How much of the window's allowance is used. */
33
+ readonly percent: Schema.Finite;
34
+ /** Go refuses requests until the window resets. */
35
+ readonly limited: Schema.Boolean;
36
+ readonly resetsAt: Schema.Finite;
37
+ }>;
38
+ }>;
39
+ /** A model a budget covers, by the IDs OpenCode knows it by. */
40
+ export interface BudgetModel extends Schema.Schema.Type<typeof BudgetModel> {
41
+ }
42
+ export declare const BudgetModel: Schema.Struct<{
43
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
44
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
45
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
46
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
47
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
48
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
49
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
50
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
51
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
52
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
53
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
54
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
55
+ };
56
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
57
+ readonly name: Schema.String;
58
+ /** What a per-model budget's member has spent on this model this month. */
59
+ readonly spent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
60
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
61
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
62
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
63
+ }>, never, never>;
64
+ }>;
65
+ /** A monthly spend limit the OpenCode Console workspace sets on the member. */
66
+ export interface Budget extends Schema.Schema.Type<typeof Budget> {
67
+ }
68
+ export declare const Budget: Schema.Struct<{
69
+ readonly id: Schema.String;
70
+ readonly limit: Schema.brand<Schema.Finite, "Money.USD"> & {
71
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
72
+ };
73
+ /** The member's spend this month, or the pooled spend of a combined budget; per model, the most on one model. */
74
+ readonly spent: Schema.brand<Schema.Finite, "Money.USD"> & {
75
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
76
+ };
77
+ /** `each` limits every member separately; `combined` pools everyone's spend against one limit. */
78
+ readonly scope: Schema.Literals<readonly ["each", "combined"]>;
79
+ /** `set` counts spend across the budget's models; `model` limits each model separately. */
80
+ readonly per: Schema.Literals<readonly ["set", "model"]>;
81
+ /** `all` covers every model and billable service; `models` covers only `models`. */
82
+ readonly coverage: Schema.Literals<readonly ["all", "models"]>;
83
+ readonly models: Schema.$Array<Schema.Struct<{
84
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
85
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
86
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
87
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
88
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
89
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
90
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
91
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
92
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
93
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
94
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
95
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
96
+ };
97
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
98
+ readonly name: Schema.String;
99
+ /** What a per-model budget's member has spent on this model this month. */
100
+ readonly spent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
101
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
102
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
103
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
104
+ }>, never, never>;
105
+ }>>;
106
+ /** The vendors whose models the budget counts, by name; empty when it doesn't count by vendor. */
107
+ readonly vendors: Schema.$Array<Schema.String>;
108
+ /** The input price per 1M tokens from which the budget counts a model, when it sets one. */
109
+ readonly inputPriceAtLeast: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
110
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
111
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
112
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
113
+ }>, never, never>;
114
+ /** The budget counts models picked one by one, rather than by vendor or price. */
115
+ readonly picked: Schema.Boolean;
116
+ /** Everyone in the workspace pools spend against it, so reaching it pauses model use for all of them. */
117
+ readonly shared: Schema.Boolean;
118
+ readonly resetsAt: Schema.Finite;
119
+ }>;
120
+ /** The usage limits of the OpenCode Console workspace a location is signed in to. */
121
+ export interface Info extends Schema.Schema.Type<typeof Info> {
122
+ }
123
+ export declare const Info: Schema.Struct<{
124
+ readonly workspace: Schema.Struct<{
125
+ readonly id: Schema.String;
126
+ readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
127
+ /** The member's usage page in OpenCode Console. */
128
+ readonly usageURL: Schema.String;
129
+ }>;
130
+ readonly go: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
131
+ readonly rolling: Schema.Struct<{
132
+ /** How much of the window's allowance is used. */
133
+ readonly percent: Schema.Finite;
134
+ /** Go refuses requests until the window resets. */
135
+ readonly limited: Schema.Boolean;
136
+ readonly resetsAt: Schema.Finite;
137
+ }>;
138
+ readonly weekly: Schema.Struct<{
139
+ /** How much of the window's allowance is used. */
140
+ readonly percent: Schema.Finite;
141
+ /** Go refuses requests until the window resets. */
142
+ readonly limited: Schema.Boolean;
143
+ readonly resetsAt: Schema.Finite;
144
+ }>;
145
+ readonly monthly: Schema.Struct<{
146
+ /** How much of the window's allowance is used. */
147
+ readonly percent: Schema.Finite;
148
+ /** Go refuses requests until the window resets. */
149
+ readonly limited: Schema.Boolean;
150
+ readonly resetsAt: Schema.Finite;
151
+ }>;
152
+ }>>>, Schema.optionalKey<Schema.Struct<{
153
+ readonly rolling: Schema.Struct<{
154
+ /** How much of the window's allowance is used. */
155
+ readonly percent: Schema.Finite;
156
+ /** Go refuses requests until the window resets. */
157
+ readonly limited: Schema.Boolean;
158
+ readonly resetsAt: Schema.Finite;
159
+ }>;
160
+ readonly weekly: Schema.Struct<{
161
+ /** How much of the window's allowance is used. */
162
+ readonly percent: Schema.Finite;
163
+ /** Go refuses requests until the window resets. */
164
+ readonly limited: Schema.Boolean;
165
+ readonly resetsAt: Schema.Finite;
166
+ }>;
167
+ readonly monthly: Schema.Struct<{
168
+ /** How much of the window's allowance is used. */
169
+ readonly percent: Schema.Finite;
170
+ /** Go refuses requests until the window resets. */
171
+ readonly limited: Schema.Boolean;
172
+ readonly resetsAt: Schema.Finite;
173
+ }>;
174
+ }>>, never, never>;
175
+ readonly budgets: Schema.$Array<Schema.Struct<{
176
+ readonly id: Schema.String;
177
+ readonly limit: Schema.brand<Schema.Finite, "Money.USD"> & {
178
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
179
+ };
180
+ /** The member's spend this month, or the pooled spend of a combined budget; per model, the most on one model. */
181
+ readonly spent: Schema.brand<Schema.Finite, "Money.USD"> & {
182
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
183
+ };
184
+ /** `each` limits every member separately; `combined` pools everyone's spend against one limit. */
185
+ readonly scope: Schema.Literals<readonly ["each", "combined"]>;
186
+ /** `set` counts spend across the budget's models; `model` limits each model separately. */
187
+ readonly per: Schema.Literals<readonly ["set", "model"]>;
188
+ /** `all` covers every model and billable service; `models` covers only `models`. */
189
+ readonly coverage: Schema.Literals<readonly ["all", "models"]>;
190
+ readonly models: Schema.$Array<Schema.Struct<{
191
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
192
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
193
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
194
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
195
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
196
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
197
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
198
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
199
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
200
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
201
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
202
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
203
+ };
204
+ readonly modelID: Schema.brand<Schema.String, "Model.ID">;
205
+ readonly name: Schema.String;
206
+ /** What a per-model budget's member has spent on this model this month. */
207
+ readonly spent: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
208
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
209
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
210
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
211
+ }>, never, never>;
212
+ }>>;
213
+ /** The vendors whose models the budget counts, by name; empty when it doesn't count by vendor. */
214
+ readonly vendors: Schema.$Array<Schema.String>;
215
+ /** The input price per 1M tokens from which the budget counts a model, when it sets one. */
216
+ readonly inputPriceAtLeast: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
217
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
218
+ }>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
219
+ zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
220
+ }>, never, never>;
221
+ /** The budget counts models picked one by one, rather than by vendor or price. */
222
+ readonly picked: Schema.Boolean;
223
+ /** Everyone in the workspace pools spend against it, so reaching it pauses model use for all of them. */
224
+ readonly shared: Schema.Boolean;
225
+ readonly resetsAt: Schema.Finite;
226
+ }>>;
227
+ }>;