@opencode/schema 2.0.32 → 2.1.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.
- package/dist/config/experimental.d.ts +1 -0
- package/dist/config/experimental.js +3 -0
- package/dist/config/provider.d.ts +56 -52
- package/dist/credential-legacy.d.ts +54 -0
- package/dist/credential-legacy.js +19 -0
- package/dist/credential.d.ts +0 -4
- package/dist/credential.js +0 -2
- package/dist/event-manifest.d.ts +1111 -1149
- package/dist/event-manifest.js +1 -2
- package/dist/form.d.ts +213 -213
- package/dist/instruction-entry.d.ts +1 -1
- package/dist/integration.d.ts +257 -257
- package/dist/model-compatibility.d.ts +3 -0
- package/dist/model-compatibility.js +2 -0
- package/dist/model.d.ts +76 -74
- package/dist/persistent-pty.d.ts +88 -88
- package/dist/prompt-input.d.ts +3 -3
- package/dist/prompt.d.ts +28 -28
- package/dist/provider.d.ts +2 -0
- package/dist/session-event.d.ts +5729 -5723
- package/dist/session-event.js +20 -13
- package/dist/session-inbox.d.ts +20 -20
- package/dist/session-legacy.d.ts +7 -0
- package/dist/session-legacy.js +118 -0
- package/dist/session-message.d.ts +125 -268
- package/dist/session-message.js +13 -12
- package/dist/session-revert.d.ts +407 -183
- package/dist/session-transfer.d.ts +33 -83
- package/dist/session.d.ts +109 -1
- package/dist/session.js +64 -2
- package/dist/v1/permission.d.ts +8 -8
- package/dist/v1/session.d.ts +696 -696
- package/package.json +4 -4
- package/dist/session-compaction-event.d.ts +0 -87
- package/dist/session-compaction-event.js +0 -10
- package/dist/session-provider-context.d.ts +0 -54
- package/dist/session-provider-context.js +0 -17
|
@@ -186,9 +186,18 @@ export declare const Data: Schema.Struct<{
|
|
|
186
186
|
}>>, never, never>;
|
|
187
187
|
}>;
|
|
188
188
|
readonly messages: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
189
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
190
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
191
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
192
|
+
};
|
|
193
|
+
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
194
|
+
readonly time: Schema.Struct<{
|
|
195
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
196
|
+
}>;
|
|
189
197
|
readonly type: Schema.tag<"agent-switched">;
|
|
190
198
|
readonly agent: Schema.brand<Schema.String, "Agent.ID">;
|
|
191
199
|
readonly previous: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Agent.ID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Agent.ID">>, never, never>;
|
|
200
|
+
}>, Schema.Struct<{
|
|
192
201
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
193
202
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
194
203
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -197,7 +206,6 @@ export declare const Data: Schema.Struct<{
|
|
|
197
206
|
readonly time: Schema.Struct<{
|
|
198
207
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
199
208
|
}>;
|
|
200
|
-
}>, Schema.Struct<{
|
|
201
209
|
readonly type: Schema.tag<"model-switched">;
|
|
202
210
|
readonly model: Schema.Struct<{
|
|
203
211
|
readonly id: Schema.brand<Schema.String, "Model.ID">;
|
|
@@ -267,6 +275,7 @@ export declare const Data: Schema.Struct<{
|
|
|
267
275
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
268
276
|
};
|
|
269
277
|
}>, never, never>;
|
|
278
|
+
}>, Schema.Struct<{
|
|
270
279
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
271
280
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
272
281
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -275,7 +284,6 @@ export declare const Data: Schema.Struct<{
|
|
|
275
284
|
readonly time: Schema.Struct<{
|
|
276
285
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
277
286
|
}>;
|
|
278
|
-
}>, Schema.Struct<{
|
|
279
287
|
readonly type: Schema.tag<"location-switched">;
|
|
280
288
|
readonly location: Schema.Struct<{
|
|
281
289
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
@@ -328,6 +336,7 @@ export declare const Data: Schema.Struct<{
|
|
|
328
336
|
}>, never, never>;
|
|
329
337
|
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
330
338
|
}>>, never, never>;
|
|
339
|
+
}>, Schema.Struct<{
|
|
331
340
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
332
341
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
333
342
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -336,7 +345,6 @@ export declare const Data: Schema.Struct<{
|
|
|
336
345
|
readonly time: Schema.Struct<{
|
|
337
346
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
338
347
|
}>;
|
|
339
|
-
}>, Schema.Struct<{
|
|
340
348
|
readonly text: Schema.String;
|
|
341
349
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
342
350
|
readonly data: Schema.String;
|
|
@@ -361,15 +369,15 @@ export declare const Data: Schema.Struct<{
|
|
|
361
369
|
}> & {
|
|
362
370
|
create: (input: import("./prompt.js").FileAttachment) => {
|
|
363
371
|
readonly data: string;
|
|
372
|
+
readonly mime: string;
|
|
364
373
|
readonly source: {
|
|
365
374
|
readonly type: "inline";
|
|
366
375
|
} | {
|
|
367
376
|
readonly type: "uri";
|
|
368
377
|
readonly uri: string;
|
|
369
378
|
};
|
|
370
|
-
readonly mime: string;
|
|
371
|
-
readonly description?: string | undefined;
|
|
372
379
|
readonly name?: string | undefined;
|
|
380
|
+
readonly description?: string | undefined;
|
|
373
381
|
readonly mention?: {
|
|
374
382
|
readonly start: number;
|
|
375
383
|
readonly end: number;
|
|
@@ -399,15 +407,15 @@ export declare const Data: Schema.Struct<{
|
|
|
399
407
|
}> & {
|
|
400
408
|
create: (input: import("./prompt.js").FileAttachment) => {
|
|
401
409
|
readonly data: string;
|
|
410
|
+
readonly mime: string;
|
|
402
411
|
readonly source: {
|
|
403
412
|
readonly type: "inline";
|
|
404
413
|
} | {
|
|
405
414
|
readonly type: "uri";
|
|
406
415
|
readonly uri: string;
|
|
407
416
|
};
|
|
408
|
-
readonly mime: string;
|
|
409
|
-
readonly description?: string | undefined;
|
|
410
417
|
readonly name?: string | undefined;
|
|
418
|
+
readonly description?: string | undefined;
|
|
411
419
|
readonly mention?: {
|
|
412
420
|
readonly start: number;
|
|
413
421
|
readonly end: number;
|
|
@@ -466,6 +474,7 @@ export declare const Data: Schema.Struct<{
|
|
|
466
474
|
}>>, never, never>;
|
|
467
475
|
}>>>, never, never>;
|
|
468
476
|
readonly type: Schema.tag<"user">;
|
|
477
|
+
}>, Schema.Struct<{
|
|
469
478
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
470
479
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
471
480
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -474,10 +483,10 @@ export declare const Data: Schema.Struct<{
|
|
|
474
483
|
readonly time: Schema.Struct<{
|
|
475
484
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
476
485
|
}>;
|
|
477
|
-
}>, Schema.Struct<{
|
|
478
486
|
readonly text: Schema.String;
|
|
479
487
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
480
488
|
readonly type: Schema.tag<"synthetic">;
|
|
489
|
+
}>, Schema.Struct<{
|
|
481
490
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
482
491
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
483
492
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -486,10 +495,10 @@ export declare const Data: Schema.Struct<{
|
|
|
486
495
|
readonly time: Schema.Struct<{
|
|
487
496
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
488
497
|
}>;
|
|
489
|
-
}>, Schema.Struct<{
|
|
490
498
|
readonly type: Schema.tag<"system">;
|
|
491
499
|
readonly text: Schema.String;
|
|
492
500
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
501
|
+
}>, Schema.Struct<{
|
|
493
502
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
494
503
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
495
504
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -498,20 +507,16 @@ export declare const Data: Schema.Struct<{
|
|
|
498
507
|
readonly time: Schema.Struct<{
|
|
499
508
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
500
509
|
}>;
|
|
501
|
-
}>, Schema.Struct<{
|
|
502
510
|
readonly type: Schema.tag<"skill">;
|
|
503
511
|
readonly skill: Schema.brand<Schema.String, "Skill.ID">;
|
|
504
512
|
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
505
513
|
readonly text: Schema.String;
|
|
514
|
+
}>, Schema.Struct<{
|
|
506
515
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
507
516
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
508
517
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
509
518
|
};
|
|
510
519
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
511
|
-
readonly time: Schema.Struct<{
|
|
512
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
513
|
-
}>;
|
|
514
|
-
}>, Schema.Struct<{
|
|
515
520
|
readonly type: Schema.tag<"shell">;
|
|
516
521
|
readonly shellID: Schema.brand<Schema.String, "Shell.ID"> & {
|
|
517
522
|
create: () => string & import("effect/Brand").Brand<"Shell.ID">;
|
|
@@ -535,12 +540,12 @@ export declare const Data: Schema.Struct<{
|
|
|
535
540
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
536
541
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
537
542
|
}>;
|
|
543
|
+
}>, Schema.Struct<{
|
|
538
544
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
539
545
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
540
546
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
541
547
|
};
|
|
542
548
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
543
|
-
}>, Schema.Struct<{
|
|
544
549
|
readonly type: Schema.tag<"assistant">;
|
|
545
550
|
readonly agent: Schema.brand<Schema.String, "Agent.ID">;
|
|
546
551
|
readonly model: Schema.Struct<{
|
|
@@ -569,11 +574,11 @@ export declare const Data: Schema.Struct<{
|
|
|
569
574
|
readonly content: Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
570
575
|
readonly type: Schema.tag<"text">;
|
|
571
576
|
readonly text: Schema.String;
|
|
572
|
-
readonly
|
|
577
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
573
578
|
}>, Schema.Struct<{
|
|
574
579
|
readonly type: Schema.tag<"reasoning">;
|
|
575
580
|
readonly text: Schema.String;
|
|
576
|
-
readonly
|
|
581
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
577
582
|
readonly time: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
578
583
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
579
584
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
@@ -586,8 +591,7 @@ export declare const Data: Schema.Struct<{
|
|
|
586
591
|
readonly id: Schema.String;
|
|
587
592
|
readonly name: Schema.String;
|
|
588
593
|
readonly executed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
589
|
-
readonly
|
|
590
|
-
readonly providerResultState: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
594
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
591
595
|
readonly state: Schema.toTaggedUnion<"status", readonly [Schema.Struct<{
|
|
592
596
|
readonly status: Schema.tag<"streaming">;
|
|
593
597
|
readonly input: Schema.String;
|
|
@@ -657,7 +661,7 @@ export declare const Data: Schema.Struct<{
|
|
|
657
661
|
}>>, never, never>;
|
|
658
662
|
readonly finish: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>>>, Schema.optionalKey<Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>>, never, never>;
|
|
659
663
|
readonly rawFinish: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
660
|
-
readonly
|
|
664
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
661
665
|
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
662
666
|
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
663
667
|
}>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
@@ -731,16 +735,20 @@ export declare const Data: Schema.Struct<{
|
|
|
731
735
|
readonly streamed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
732
736
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
733
737
|
}>;
|
|
738
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
734
739
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
735
740
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
736
741
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
737
742
|
};
|
|
738
743
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
739
|
-
|
|
744
|
+
readonly time: Schema.Struct<{
|
|
745
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
746
|
+
}>;
|
|
747
|
+
readonly type: Schema.tag<"compaction">;
|
|
740
748
|
readonly status: Schema.tag<"running">;
|
|
741
749
|
readonly reason: Schema.Literals<readonly ["auto", "manual"]>;
|
|
742
750
|
readonly summary: Schema.String;
|
|
743
|
-
|
|
751
|
+
}>, Schema.Struct<{
|
|
744
752
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
745
753
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
746
754
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -750,7 +758,6 @@ export declare const Data: Schema.Struct<{
|
|
|
750
758
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
751
759
|
}>;
|
|
752
760
|
readonly type: Schema.tag<"compaction">;
|
|
753
|
-
}>, Schema.Struct<{
|
|
754
761
|
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
755
762
|
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
756
763
|
}>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
@@ -820,56 +827,9 @@ export declare const Data: Schema.Struct<{
|
|
|
820
827
|
readonly variant?: (string & import("effect/Brand").Brand<"Model.VariantID">) | undefined;
|
|
821
828
|
};
|
|
822
829
|
}>, never, never>;
|
|
823
|
-
readonly
|
|
830
|
+
readonly native: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
824
831
|
readonly summary: Schema.String;
|
|
825
|
-
|
|
826
|
-
readonly providerContext: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
827
|
-
readonly version: Schema.Literal<1>;
|
|
828
|
-
readonly provenance: Schema.Struct<{
|
|
829
|
-
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
830
|
-
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
831
|
-
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
832
|
-
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
833
|
-
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
834
|
-
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
835
|
-
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
836
|
-
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
837
|
-
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
838
|
-
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
839
|
-
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
840
|
-
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
841
|
-
};
|
|
842
|
-
readonly provider: Schema.String;
|
|
843
|
-
readonly modelID: Schema.String;
|
|
844
|
-
readonly route: Schema.String;
|
|
845
|
-
readonly protocol: Schema.String;
|
|
846
|
-
readonly endpoint: Schema.String;
|
|
847
|
-
}>;
|
|
848
|
-
readonly messages: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
849
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
850
|
-
readonly version: Schema.Literal<1>;
|
|
851
|
-
readonly provenance: Schema.Struct<{
|
|
852
|
-
readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
|
|
853
|
-
opencode: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
854
|
-
anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
855
|
-
openai: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
856
|
-
google: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
857
|
-
googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
858
|
-
githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
859
|
-
amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
860
|
-
azure: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
861
|
-
openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
862
|
-
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
863
|
-
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
864
|
-
};
|
|
865
|
-
readonly provider: Schema.String;
|
|
866
|
-
readonly modelID: Schema.String;
|
|
867
|
-
readonly route: Schema.String;
|
|
868
|
-
readonly protocol: Schema.String;
|
|
869
|
-
readonly endpoint: Schema.String;
|
|
870
|
-
}>;
|
|
871
|
-
readonly messages: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
872
|
-
}>>, never, never>;
|
|
832
|
+
}>, Schema.Struct<{
|
|
873
833
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
874
834
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
875
835
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -879,7 +839,6 @@ export declare const Data: Schema.Struct<{
|
|
|
879
839
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
880
840
|
}>;
|
|
881
841
|
readonly type: Schema.tag<"compaction">;
|
|
882
|
-
}>, Schema.Struct<{
|
|
883
842
|
readonly cost: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
884
843
|
zero: number & import("effect/Brand").Brand<"Money.USD">;
|
|
885
844
|
}>>, Schema.optionalKey<Schema.brand<Schema.Finite, "Money.USD"> & {
|
|
@@ -914,6 +873,7 @@ export declare const Data: Schema.Struct<{
|
|
|
914
873
|
readonly body: Schema.String;
|
|
915
874
|
}>>, never, never>;
|
|
916
875
|
}>;
|
|
876
|
+
}>]>, Schema.Struct<{
|
|
917
877
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
918
878
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
919
879
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -922,8 +882,6 @@ export declare const Data: Schema.Struct<{
|
|
|
922
882
|
readonly time: Schema.Struct<{
|
|
923
883
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
924
884
|
}>;
|
|
925
|
-
readonly type: Schema.tag<"compaction">;
|
|
926
|
-
}>]>, Schema.Struct<{
|
|
927
885
|
readonly type: Schema.tag<"idle">;
|
|
928
886
|
readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "interrupted"]>;
|
|
929
887
|
readonly error: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
@@ -945,13 +903,5 @@ export declare const Data: Schema.Struct<{
|
|
|
945
903
|
readonly body: Schema.String;
|
|
946
904
|
}>>, never, never>;
|
|
947
905
|
}>>, never, never>;
|
|
948
|
-
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
949
|
-
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
950
|
-
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
951
|
-
};
|
|
952
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
953
|
-
readonly time: Schema.Struct<{
|
|
954
|
-
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
955
|
-
}>;
|
|
956
906
|
}>]>>;
|
|
957
907
|
}>;
|
package/dist/session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as Session from "./session.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
3
|
import { SessionEvent } from "./session-event.js";
|
|
4
4
|
import { SessionID } from "./session-id.js";
|
|
5
5
|
import { SessionMetadata } from "./session-metadata.js";
|
|
@@ -224,3 +224,111 @@ export declare const ListAnchor: Schema.Struct<{
|
|
|
224
224
|
}>;
|
|
225
225
|
export interface ListAnchor extends Schema.Schema.Type<typeof ListAnchor> {
|
|
226
226
|
}
|
|
227
|
+
export declare const ListFilter: Schema.Struct<{
|
|
228
|
+
readonly order: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
229
|
+
readonly search: Schema.optional<Schema.String>;
|
|
230
|
+
readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
|
|
231
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
232
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
233
|
+
}, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
|
|
234
|
+
readonly archived: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
|
|
235
|
+
readonly directory: Schema.optional<Schema.brand<Schema.String, "AbsolutePath">>;
|
|
236
|
+
readonly project: Schema.optional<Schema.brand<Schema.String, "Project.ID"> & {
|
|
237
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
238
|
+
}>;
|
|
239
|
+
readonly subpath: Schema.optional<Schema.brand<Schema.String, "RelativePath">>;
|
|
240
|
+
}>;
|
|
241
|
+
export interface ListFilter extends Schema.Schema.Type<typeof ListFilter> {
|
|
242
|
+
}
|
|
243
|
+
declare const ListCursorInput: Schema.Union<readonly [Schema.Struct<{
|
|
244
|
+
readonly order: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
245
|
+
readonly search: Schema.optional<Schema.String>;
|
|
246
|
+
readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
|
|
247
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
248
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
249
|
+
}, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
|
|
250
|
+
readonly archived: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
|
|
251
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
252
|
+
readonly anchor: Schema.Struct<{
|
|
253
|
+
readonly id: Schema.brand<Schema.String, "SessionID"> & {
|
|
254
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
255
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
256
|
+
};
|
|
257
|
+
readonly time: Schema.Finite;
|
|
258
|
+
readonly direction: Schema.Literals<readonly ["previous", "next"]>;
|
|
259
|
+
}>;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly order: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
262
|
+
readonly search: Schema.optional<Schema.String>;
|
|
263
|
+
readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
|
|
264
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
265
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
266
|
+
}, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
|
|
267
|
+
readonly archived: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
|
|
268
|
+
readonly project: Schema.brand<Schema.String, "Project.ID"> & {
|
|
269
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
270
|
+
};
|
|
271
|
+
readonly subpath: Schema.optional<Schema.brand<Schema.String, "RelativePath">>;
|
|
272
|
+
readonly anchor: Schema.Struct<{
|
|
273
|
+
readonly id: Schema.brand<Schema.String, "SessionID"> & {
|
|
274
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
275
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
276
|
+
};
|
|
277
|
+
readonly time: Schema.Finite;
|
|
278
|
+
readonly direction: Schema.Literals<readonly ["previous", "next"]>;
|
|
279
|
+
}>;
|
|
280
|
+
}>, Schema.Struct<{
|
|
281
|
+
readonly order: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
282
|
+
readonly search: Schema.optional<Schema.String>;
|
|
283
|
+
readonly parentID: Schema.optional<Schema.Union<readonly [Schema.brand<Schema.String, "SessionID"> & {
|
|
284
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
285
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
286
|
+
}, Schema.decodeTo<Schema.Null, Schema.Literal<"null">, never, never>]>>;
|
|
287
|
+
readonly archived: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
|
|
288
|
+
readonly anchor: Schema.Struct<{
|
|
289
|
+
readonly id: Schema.brand<Schema.String, "SessionID"> & {
|
|
290
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
291
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
292
|
+
};
|
|
293
|
+
readonly time: Schema.Finite;
|
|
294
|
+
readonly direction: Schema.Literals<readonly ["previous", "next"]>;
|
|
295
|
+
}>;
|
|
296
|
+
}>]>;
|
|
297
|
+
export declare const ListCursor: Schema.brand<Schema.String, "SessionsCursor"> & {
|
|
298
|
+
make: (input: typeof ListCursorInput.Type) => string & import("effect/Brand").Brand<"SessionsCursor">;
|
|
299
|
+
parse: (input: string) => Effect.Effect<{
|
|
300
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
301
|
+
readonly search?: string | undefined;
|
|
302
|
+
readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
|
|
303
|
+
readonly archived?: boolean | undefined;
|
|
304
|
+
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
305
|
+
readonly anchor: {
|
|
306
|
+
readonly id: string & import("effect/Brand").Brand<"SessionID">;
|
|
307
|
+
readonly time: number;
|
|
308
|
+
readonly direction: "next" | "previous";
|
|
309
|
+
};
|
|
310
|
+
} | {
|
|
311
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
312
|
+
readonly search?: string | undefined;
|
|
313
|
+
readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
|
|
314
|
+
readonly archived?: boolean | undefined;
|
|
315
|
+
readonly project: string & import("effect/Brand").Brand<"Project.ID">;
|
|
316
|
+
readonly subpath?: (string & import("effect/Brand").Brand<"RelativePath">) | undefined;
|
|
317
|
+
readonly anchor: {
|
|
318
|
+
readonly id: string & import("effect/Brand").Brand<"SessionID">;
|
|
319
|
+
readonly time: number;
|
|
320
|
+
readonly direction: "next" | "previous";
|
|
321
|
+
};
|
|
322
|
+
} | {
|
|
323
|
+
readonly order?: "asc" | "desc" | undefined;
|
|
324
|
+
readonly search?: string | undefined;
|
|
325
|
+
readonly parentID?: (string & import("effect/Brand").Brand<"SessionID">) | null | undefined;
|
|
326
|
+
readonly archived?: boolean | undefined;
|
|
327
|
+
readonly anchor: {
|
|
328
|
+
readonly id: string & import("effect/Brand").Brand<"SessionID">;
|
|
329
|
+
readonly time: number;
|
|
330
|
+
readonly direction: "next" | "previous";
|
|
331
|
+
};
|
|
332
|
+
}, "Invalid cursor", never>;
|
|
333
|
+
};
|
|
334
|
+
export type ListCursor = typeof ListCursor.Type;
|
package/dist/session.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * as Session from "./session.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
2
|
+
import { Effect, Result, Schema, SchemaGetter, SchemaParser } from "effect";
|
|
3
|
+
import { Base64Url } from "effect/encoding";
|
|
3
4
|
import { Agent } from "./agent.js";
|
|
4
5
|
import { Location } from "./location.js";
|
|
5
6
|
import { Model } from "./model.js";
|
|
6
7
|
import { Project } from "./project.js";
|
|
7
|
-
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
8
|
+
import { AbsolutePath, DateTimeUtcFromMillis, optional, RelativePath, statics } from "./schema.js";
|
|
8
9
|
import { SessionEvent } from "./session-event.js";
|
|
9
10
|
import { SessionID } from "./session-id.js";
|
|
10
11
|
import { SessionMetadata } from "./session-metadata.js";
|
|
@@ -52,3 +53,64 @@ export const ListAnchor = Schema.Struct({
|
|
|
52
53
|
time: Schema.Finite,
|
|
53
54
|
direction: Schema.Literals(["previous", "next"]),
|
|
54
55
|
}).annotate({ identifier: "Session.ListAnchor" });
|
|
56
|
+
// These fields are also the session.list HTTP query parameters. Raw Schema.optional keeps that
|
|
57
|
+
// endpoint's OpenAPI parameters unchanged.
|
|
58
|
+
const ListFilterFields = {
|
|
59
|
+
order: Schema.Literals(["asc", "desc"]).pipe(Schema.optional).annotate({
|
|
60
|
+
description: "Session order for the first page. Use desc for newest first or asc for oldest first.",
|
|
61
|
+
}),
|
|
62
|
+
search: Schema.String.pipe(Schema.optional),
|
|
63
|
+
parentID: Schema.Union([
|
|
64
|
+
ID,
|
|
65
|
+
Schema.Null.pipe(Schema.encodeTo(Schema.Literal("null"), {
|
|
66
|
+
decode: SchemaGetter.transform(() => null),
|
|
67
|
+
encode: SchemaGetter.transform(() => "null"),
|
|
68
|
+
})),
|
|
69
|
+
])
|
|
70
|
+
.annotate({ description: "Filter by parent session. Use null to return only root sessions." })
|
|
71
|
+
.pipe(Schema.optional),
|
|
72
|
+
archived: Schema.Literals(["true", "false"])
|
|
73
|
+
.pipe(Schema.decodeTo(Schema.Boolean, {
|
|
74
|
+
decode: SchemaGetter.transform((value) => value === "true"),
|
|
75
|
+
encode: SchemaGetter.transform((value) => (value ? "true" : "false")),
|
|
76
|
+
}))
|
|
77
|
+
.annotate({
|
|
78
|
+
description: "Filter by archive state. Use true to return only archived sessions or false to exclude them. Omit to include both.",
|
|
79
|
+
})
|
|
80
|
+
.pipe(Schema.optional),
|
|
81
|
+
};
|
|
82
|
+
export const ListFilter = Schema.Struct({
|
|
83
|
+
...ListFilterFields,
|
|
84
|
+
directory: AbsolutePath.pipe(Schema.optional),
|
|
85
|
+
project: Project.ID.pipe(Schema.optional),
|
|
86
|
+
subpath: RelativePath.pipe(Schema.optional),
|
|
87
|
+
}).annotate({ identifier: "Session.ListFilter" });
|
|
88
|
+
const ListCursorInput = Schema.Union([
|
|
89
|
+
Schema.Struct({ ...ListFilterFields, directory: AbsolutePath, anchor: ListAnchor }),
|
|
90
|
+
Schema.Struct({
|
|
91
|
+
...ListFilterFields,
|
|
92
|
+
project: Project.ID,
|
|
93
|
+
subpath: RelativePath.pipe(Schema.optional),
|
|
94
|
+
anchor: ListAnchor,
|
|
95
|
+
}),
|
|
96
|
+
Schema.Struct({ ...ListFilterFields, anchor: ListAnchor }),
|
|
97
|
+
]);
|
|
98
|
+
const ListCursorJson = Schema.fromJsonString(ListCursorInput);
|
|
99
|
+
const encodeListCursor = Schema.encodeSync(ListCursorJson);
|
|
100
|
+
const decodeListCursor = Schema.decodeUnknownEffect(ListCursorJson);
|
|
101
|
+
export const ListCursor = Schema.String.pipe(Schema.brand("SessionsCursor"), Schema.annotate({
|
|
102
|
+
identifier: "SessionsCursor",
|
|
103
|
+
description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response.",
|
|
104
|
+
}), statics((schema) => {
|
|
105
|
+
// Read the default constructor without caching it on the schema, so `make` can be replaced.
|
|
106
|
+
const make = SchemaParser.make(schema);
|
|
107
|
+
return {
|
|
108
|
+
make: (input) => make(Base64Url.encode(encodeListCursor(input))),
|
|
109
|
+
parse: (input) => Effect.suspend(() => {
|
|
110
|
+
const result = Base64Url.decodeString(input);
|
|
111
|
+
return Result.isFailure(result)
|
|
112
|
+
? Effect.fail("Invalid cursor")
|
|
113
|
+
: decodeListCursor(result.success).pipe(Effect.mapError(() => "Invalid cursor"));
|
|
114
|
+
}),
|
|
115
|
+
};
|
|
116
|
+
}));
|
package/dist/v1/permission.d.ts
CHANGED
|
@@ -51,14 +51,6 @@ export declare const Approval: Schema.Struct<{
|
|
|
51
51
|
}>;
|
|
52
52
|
export type Approval = typeof Approval.Type;
|
|
53
53
|
export declare const AskInput: Schema.Struct<{
|
|
54
|
-
readonly id: Schema.optional<Schema.brand<Schema.String, "PermissionV1.ID"> & {
|
|
55
|
-
ascending: (id?: string) => string & import("effect/Brand").Brand<"PermissionV1.ID">;
|
|
56
|
-
}>;
|
|
57
|
-
readonly ruleset: Schema.$Array<Schema.Struct<{
|
|
58
|
-
readonly permission: Schema.String;
|
|
59
|
-
readonly pattern: Schema.String;
|
|
60
|
-
readonly action: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
61
|
-
}>>;
|
|
62
54
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
63
55
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
64
56
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -71,6 +63,14 @@ export declare const AskInput: Schema.Struct<{
|
|
|
71
63
|
readonly messageID: Schema.String;
|
|
72
64
|
readonly callID: Schema.String;
|
|
73
65
|
}>>;
|
|
66
|
+
readonly id: Schema.optional<Schema.brand<Schema.String, "PermissionV1.ID"> & {
|
|
67
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"PermissionV1.ID">;
|
|
68
|
+
}>;
|
|
69
|
+
readonly ruleset: Schema.$Array<Schema.Struct<{
|
|
70
|
+
readonly permission: Schema.String;
|
|
71
|
+
readonly pattern: Schema.String;
|
|
72
|
+
readonly action: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
73
|
+
}>>;
|
|
74
74
|
}>;
|
|
75
75
|
export type AskInput = typeof AskInput.Type;
|
|
76
76
|
export declare const ReplyInput: Schema.Struct<{
|