@rivetkit/effect 0.0.0-feat-workflows-public-host-apis.86c0443 → 0.0.0-feat-sqlite-sync.18dce02

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.
@@ -1,3 +1,4 @@
1
+ import { describe, expectTypeOf, it, test } from "@effect/vitest";
1
2
  import { Action, Actor, Client, type State } from "@rivetkit/effect";
2
3
  import {
3
4
  Context,
@@ -8,7 +9,6 @@ import {
8
9
  } from "effect";
9
10
  import type { RawAccess } from "rivetkit/db";
10
11
  import { db } from "rivetkit/db";
11
- import { describe, expectTypeOf, it, test } from "@effect/vitest";
12
12
 
13
13
  class SomeDep extends Context.Service<SomeDep, { readonly x: number }>()(
14
14
  "SomeDep",
@@ -43,7 +43,7 @@ const TagsCsv = Schema.String.pipe(
43
43
  const ServiceDependentNumber = Schema.Number.pipe(
44
44
  Schema.decodeTo(
45
45
  Schema.Number,
46
- SchemaTransformation.transformOrFail({
46
+ SchemaTransformation.transformEffect({
47
47
  decode: (n: number) =>
48
48
  Effect.gen(function* () {
49
49
  const dep = yield* SomeDep;
@@ -58,7 +58,7 @@ const ServiceDependentNumber = Schema.Number.pipe(
58
58
  ),
59
59
  );
60
60
 
61
- class ServiceDependentError extends Schema.TaggedErrorClass<ServiceDependentError>()(
61
+ class ServiceDependentError extends Schema.TaggedError<ServiceDependentError>()(
62
62
  "ServiceDependentError",
63
63
  {
64
64
  limit: ServiceDependentNumber,
@@ -288,6 +288,12 @@ describe("Actor.make(...).toLayer", () => {
288
288
  expectTypeOf(
289
289
  wakeOptions.rawRivetkitContext.db,
290
290
  ).toEqualTypeOf<RawAccess>();
291
+ expectTypeOf(
292
+ wakeOptions.rawRivetkitContext.db.transaction(
293
+ async () => {},
294
+ { name: "effect-operation", timeout: 1_000 },
295
+ ),
296
+ ).toEqualTypeOf<Promise<void>>();
291
297
 
292
298
  return {
293
299
  Ping: () => Effect.succeed(0),
@@ -4,7 +4,7 @@ import type {
4
4
  HttpServerError,
5
5
  HttpServerRequest,
6
6
  HttpServerResponse,
7
- } from "effect/unstable/http";
7
+ } from "effect/http";
8
8
  import { describe, expectTypeOf, test } from "vitest";
9
9
 
10
10
  const TestActor = Actor.make("TestActor", {
@@ -1,7 +1,7 @@
1
1
  import { assert, describe, it } from "@effect/vitest";
2
2
  import { Action, Actor, Registry, RivetLogger } from "@rivetkit/effect";
3
3
  import { Effect, Layer } from "effect";
4
- import { HttpEffect } from "effect/unstable/http";
4
+ import { HttpEffect } from "effect/http";
5
5
  import * as RivetkitLog from "rivetkit/log";
6
6
  import { vi } from "vitest";
7
7
 
package/src/Registry.ts CHANGED
@@ -5,9 +5,9 @@ import {
5
5
  type HttpServerError,
6
6
  type HttpServerRequest,
7
7
  type HttpServerResponse,
8
- } from "effect/unstable/http";
8
+ } from "effect/http";
9
9
  import * as Rivetkit from "rivetkit";
10
- import * as RivetkitLog from "rivetkit/log";
10
+ import type * as RivetkitLog from "rivetkit/log";
11
11
  import * as Client from "./Client.ts";
12
12
  import { BaseLogger, getOrCreateBaseLogger } from "./internal/logging.ts";
13
13
  import * as RivetLogger from "./RivetLogger.ts";
package/src/RivetError.ts CHANGED
@@ -4,7 +4,7 @@ import * as RivetkitErrors from "rivetkit/errors";
4
4
  const ReasonTypeId = "~@rivetkit/effect/RivetError/Reason" as const;
5
5
  const TypeId = "~@rivetkit/effect/RivetError" as const;
6
6
 
7
- export class Forbidden extends Schema.TaggedErrorClass<Forbidden>(
7
+ export class Forbidden extends Schema.TaggedError<Forbidden>(
8
8
  `${ReasonTypeId}/Forbidden`,
9
9
  )("Forbidden", {
10
10
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -31,12 +31,15 @@ export class Forbidden extends Schema.TaggedErrorClass<Forbidden>(
31
31
  get public() {
32
32
  return this.cause.public;
33
33
  }
34
+ get rayId() {
35
+ return this.cause.rayId;
36
+ }
34
37
  get isRetryable(): boolean {
35
38
  return false;
36
39
  }
37
40
  }
38
41
 
39
- export class ActorNotFound extends Schema.TaggedErrorClass<ActorNotFound>(
42
+ export class ActorNotFound extends Schema.TaggedError<ActorNotFound>(
40
43
  `${ReasonTypeId}/ActorNotFound`,
41
44
  )("ActorNotFound", {
42
45
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -63,12 +66,15 @@ export class ActorNotFound extends Schema.TaggedErrorClass<ActorNotFound>(
63
66
  get public() {
64
67
  return this.cause.public;
65
68
  }
69
+ get rayId() {
70
+ return this.cause.rayId;
71
+ }
66
72
  get isRetryable(): boolean {
67
73
  return false;
68
74
  }
69
75
  }
70
76
 
71
- export class ActorStopping extends Schema.TaggedErrorClass<ActorStopping>(
77
+ export class ActorStopping extends Schema.TaggedError<ActorStopping>(
72
78
  `${ReasonTypeId}/ActorStopping`,
73
79
  )("ActorStopping", {
74
80
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -95,12 +101,15 @@ export class ActorStopping extends Schema.TaggedErrorClass<ActorStopping>(
95
101
  get public() {
96
102
  return this.cause.public;
97
103
  }
104
+ get rayId() {
105
+ return this.cause.rayId;
106
+ }
98
107
  get isRetryable(): boolean {
99
108
  return true;
100
109
  }
101
110
  }
102
111
 
103
- export class ActorRestarting extends Schema.TaggedErrorClass<ActorRestarting>(
112
+ export class ActorRestarting extends Schema.TaggedError<ActorRestarting>(
104
113
  `${ReasonTypeId}/ActorRestarting`,
105
114
  )("ActorRestarting", {
106
115
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -127,6 +136,9 @@ export class ActorRestarting extends Schema.TaggedErrorClass<ActorRestarting>(
127
136
  get public() {
128
137
  return this.cause.public;
129
138
  }
139
+ get rayId() {
140
+ return this.cause.rayId;
141
+ }
130
142
  get isRetryable(): boolean {
131
143
  return true;
132
144
  }
@@ -140,7 +152,7 @@ export class ActorRestarting extends Schema.TaggedErrorClass<ActorRestarting>(
140
152
  }
141
153
  }
142
154
 
143
- export class ActionNotFound extends Schema.TaggedErrorClass<ActionNotFound>(
155
+ export class ActionNotFound extends Schema.TaggedError<ActionNotFound>(
144
156
  `${ReasonTypeId}/ActionNotFound`,
145
157
  )("ActionNotFound", {
146
158
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -167,12 +179,15 @@ export class ActionNotFound extends Schema.TaggedErrorClass<ActionNotFound>(
167
179
  get public() {
168
180
  return this.cause.public;
169
181
  }
182
+ get rayId() {
183
+ return this.cause.rayId;
184
+ }
170
185
  get isRetryable(): boolean {
171
186
  return false;
172
187
  }
173
188
  }
174
189
 
175
- export class ActionTimedOut extends Schema.TaggedErrorClass<ActionTimedOut>(
190
+ export class ActionTimedOut extends Schema.TaggedError<ActionTimedOut>(
176
191
  `${ReasonTypeId}/ActionTimedOut`,
177
192
  )("ActionTimedOut", { cause: Schema.instanceOf(RivetkitErrors.RivetError) }) {
178
193
  readonly [ReasonTypeId] = ReasonTypeId;
@@ -197,12 +212,15 @@ export class ActionTimedOut extends Schema.TaggedErrorClass<ActionTimedOut>(
197
212
  get public() {
198
213
  return this.cause.public;
199
214
  }
215
+ get rayId() {
216
+ return this.cause.rayId;
217
+ }
200
218
  get isRetryable(): boolean {
201
219
  return true;
202
220
  }
203
221
  }
204
222
 
205
- export class ActionAborted extends Schema.TaggedErrorClass<ActionAborted>(
223
+ export class ActionAborted extends Schema.TaggedError<ActionAborted>(
206
224
  `${ReasonTypeId}/ActionAborted`,
207
225
  )("ActionAborted", {
208
226
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -229,12 +247,15 @@ export class ActionAborted extends Schema.TaggedErrorClass<ActionAborted>(
229
247
  get public() {
230
248
  return this.cause.public;
231
249
  }
250
+ get rayId() {
251
+ return this.cause.rayId;
252
+ }
232
253
  get isRetryable(): boolean {
233
254
  return false;
234
255
  }
235
256
  }
236
257
 
237
- export class ActorOverloaded extends Schema.TaggedErrorClass<ActorOverloaded>(
258
+ export class ActorOverloaded extends Schema.TaggedError<ActorOverloaded>(
238
259
  `${ReasonTypeId}/ActorOverloaded`,
239
260
  )("ActorOverloaded", {
240
261
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -261,12 +282,15 @@ export class ActorOverloaded extends Schema.TaggedErrorClass<ActorOverloaded>(
261
282
  get public() {
262
283
  return this.cause.public;
263
284
  }
285
+ get rayId() {
286
+ return this.cause.rayId;
287
+ }
264
288
  get isRetryable(): boolean {
265
289
  return true;
266
290
  }
267
291
  }
268
292
 
269
- export class IncomingMessageTooLong extends Schema.TaggedErrorClass<IncomingMessageTooLong>(
293
+ export class IncomingMessageTooLong extends Schema.TaggedError<IncomingMessageTooLong>(
270
294
  `${ReasonTypeId}/IncomingMessageTooLong`,
271
295
  )("IncomingMessageTooLong", {
272
296
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -293,12 +317,15 @@ export class IncomingMessageTooLong extends Schema.TaggedErrorClass<IncomingMess
293
317
  get public() {
294
318
  return this.cause.public;
295
319
  }
320
+ get rayId() {
321
+ return this.cause.rayId;
322
+ }
296
323
  get isRetryable(): boolean {
297
324
  return false;
298
325
  }
299
326
  }
300
327
 
301
- export class OutgoingMessageTooLong extends Schema.TaggedErrorClass<OutgoingMessageTooLong>(
328
+ export class OutgoingMessageTooLong extends Schema.TaggedError<OutgoingMessageTooLong>(
302
329
  `${ReasonTypeId}/OutgoingMessageTooLong`,
303
330
  )("OutgoingMessageTooLong", {
304
331
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -325,12 +352,15 @@ export class OutgoingMessageTooLong extends Schema.TaggedErrorClass<OutgoingMess
325
352
  get public() {
326
353
  return this.cause.public;
327
354
  }
355
+ get rayId() {
356
+ return this.cause.rayId;
357
+ }
328
358
  get isRetryable(): boolean {
329
359
  return false;
330
360
  }
331
361
  }
332
362
 
333
- export class InvalidEncoding extends Schema.TaggedErrorClass<InvalidEncoding>(
363
+ export class InvalidEncoding extends Schema.TaggedError<InvalidEncoding>(
334
364
  `${ReasonTypeId}/InvalidEncoding`,
335
365
  )("InvalidEncoding", {
336
366
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -357,12 +387,15 @@ export class InvalidEncoding extends Schema.TaggedErrorClass<InvalidEncoding>(
357
387
  get public() {
358
388
  return this.cause.public;
359
389
  }
390
+ get rayId() {
391
+ return this.cause.rayId;
392
+ }
360
393
  get isRetryable(): boolean {
361
394
  return false;
362
395
  }
363
396
  }
364
397
 
365
- export class InvalidRequest extends Schema.TaggedErrorClass<InvalidRequest>(
398
+ export class InvalidRequest extends Schema.TaggedError<InvalidRequest>(
366
399
  `${ReasonTypeId}/InvalidRequest`,
367
400
  )("InvalidRequest", {
368
401
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -389,12 +422,15 @@ export class InvalidRequest extends Schema.TaggedErrorClass<InvalidRequest>(
389
422
  get public() {
390
423
  return this.cause.public;
391
424
  }
425
+ get rayId() {
426
+ return this.cause.rayId;
427
+ }
392
428
  get isRetryable(): boolean {
393
429
  return false;
394
430
  }
395
431
  }
396
432
 
397
- export class GuardActorReadyTimeout extends Schema.TaggedErrorClass<GuardActorReadyTimeout>(
433
+ export class GuardActorReadyTimeout extends Schema.TaggedError<GuardActorReadyTimeout>(
398
434
  `${ReasonTypeId}/GuardActorReadyTimeout`,
399
435
  )("GuardActorReadyTimeout", {
400
436
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -421,12 +457,15 @@ export class GuardActorReadyTimeout extends Schema.TaggedErrorClass<GuardActorRe
421
457
  get public() {
422
458
  return this.cause.public;
423
459
  }
460
+ get rayId() {
461
+ return this.cause.rayId;
462
+ }
424
463
  get isRetryable(): boolean {
425
464
  return true;
426
465
  }
427
466
  }
428
467
 
429
- export class GuardActorWakeRetriesExceeded extends Schema.TaggedErrorClass<GuardActorWakeRetriesExceeded>(
468
+ export class GuardActorWakeRetriesExceeded extends Schema.TaggedError<GuardActorWakeRetriesExceeded>(
430
469
  `${ReasonTypeId}/GuardActorWakeRetriesExceeded`,
431
470
  )("GuardActorWakeRetriesExceeded", {
432
471
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -453,12 +492,15 @@ export class GuardActorWakeRetriesExceeded extends Schema.TaggedErrorClass<Guard
453
492
  get public() {
454
493
  return this.cause.public;
455
494
  }
495
+ get rayId() {
496
+ return this.cause.rayId;
497
+ }
456
498
  get isRetryable(): boolean {
457
499
  return true;
458
500
  }
459
501
  }
460
502
 
461
- export class GuardActorRunnerFailed extends Schema.TaggedErrorClass<GuardActorRunnerFailed>(
503
+ export class GuardActorRunnerFailed extends Schema.TaggedError<GuardActorRunnerFailed>(
462
504
  `${ReasonTypeId}/GuardActorRunnerFailed`,
463
505
  )("GuardActorRunnerFailed", {
464
506
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -485,12 +527,15 @@ export class GuardActorRunnerFailed extends Schema.TaggedErrorClass<GuardActorRu
485
527
  get public() {
486
528
  return this.cause.public;
487
529
  }
530
+ get rayId() {
531
+ return this.cause.rayId;
532
+ }
488
533
  get isRetryable(): boolean {
489
534
  return false;
490
535
  }
491
536
  }
492
537
 
493
- export class GuardServiceUnavailable extends Schema.TaggedErrorClass<GuardServiceUnavailable>(
538
+ export class GuardServiceUnavailable extends Schema.TaggedError<GuardServiceUnavailable>(
494
539
  `${ReasonTypeId}/GuardServiceUnavailable`,
495
540
  )("GuardServiceUnavailable", {
496
541
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -517,12 +562,15 @@ export class GuardServiceUnavailable extends Schema.TaggedErrorClass<GuardServic
517
562
  get public() {
518
563
  return this.cause.public;
519
564
  }
565
+ get rayId() {
566
+ return this.cause.rayId;
567
+ }
520
568
  get isRetryable(): boolean {
521
569
  return true;
522
570
  }
523
571
  }
524
572
 
525
- export class GuardActorStoppedWhileWaiting extends Schema.TaggedErrorClass<GuardActorStoppedWhileWaiting>(
573
+ export class GuardActorStoppedWhileWaiting extends Schema.TaggedError<GuardActorStoppedWhileWaiting>(
526
574
  `${ReasonTypeId}/GuardActorStoppedWhileWaiting`,
527
575
  )("GuardActorStoppedWhileWaiting", {
528
576
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -549,12 +597,15 @@ export class GuardActorStoppedWhileWaiting extends Schema.TaggedErrorClass<Guard
549
597
  get public() {
550
598
  return this.cause.public;
551
599
  }
600
+ get rayId() {
601
+ return this.cause.rayId;
602
+ }
552
603
  get isRetryable(): boolean {
553
604
  return true;
554
605
  }
555
606
  }
556
607
 
557
- export class GuardTunnelRequestAborted extends Schema.TaggedErrorClass<GuardTunnelRequestAborted>(
608
+ export class GuardTunnelRequestAborted extends Schema.TaggedError<GuardTunnelRequestAborted>(
558
609
  `${ReasonTypeId}/GuardTunnelRequestAborted`,
559
610
  )("GuardTunnelRequestAborted", {
560
611
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -581,12 +632,15 @@ export class GuardTunnelRequestAborted extends Schema.TaggedErrorClass<GuardTunn
581
632
  get public() {
582
633
  return this.cause.public;
583
634
  }
635
+ get rayId() {
636
+ return this.cause.rayId;
637
+ }
584
638
  get isRetryable(): boolean {
585
639
  return true;
586
640
  }
587
641
  }
588
642
 
589
- export class GuardTunnelMessageTimeout extends Schema.TaggedErrorClass<GuardTunnelMessageTimeout>(
643
+ export class GuardTunnelMessageTimeout extends Schema.TaggedError<GuardTunnelMessageTimeout>(
590
644
  `${ReasonTypeId}/GuardTunnelMessageTimeout`,
591
645
  )("GuardTunnelMessageTimeout", {
592
646
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -613,12 +667,15 @@ export class GuardTunnelMessageTimeout extends Schema.TaggedErrorClass<GuardTunn
613
667
  get public() {
614
668
  return this.cause.public;
615
669
  }
670
+ get rayId() {
671
+ return this.cause.rayId;
672
+ }
616
673
  get isRetryable(): boolean {
617
674
  return true;
618
675
  }
619
676
  }
620
677
 
621
- export class GuardTunnelResponseClosed extends Schema.TaggedErrorClass<GuardTunnelResponseClosed>(
678
+ export class GuardTunnelResponseClosed extends Schema.TaggedError<GuardTunnelResponseClosed>(
622
679
  `${ReasonTypeId}/GuardTunnelResponseClosed`,
623
680
  )("GuardTunnelResponseClosed", {
624
681
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -645,12 +702,15 @@ export class GuardTunnelResponseClosed extends Schema.TaggedErrorClass<GuardTunn
645
702
  get public() {
646
703
  return this.cause.public;
647
704
  }
705
+ get rayId() {
706
+ return this.cause.rayId;
707
+ }
648
708
  get isRetryable(): boolean {
649
709
  return true;
650
710
  }
651
711
  }
652
712
 
653
- export class GuardGatewayResponseStartTimeout extends Schema.TaggedErrorClass<GuardGatewayResponseStartTimeout>(
713
+ export class GuardGatewayResponseStartTimeout extends Schema.TaggedError<GuardGatewayResponseStartTimeout>(
654
714
  `${ReasonTypeId}/GuardGatewayResponseStartTimeout`,
655
715
  )("GuardGatewayResponseStartTimeout", {
656
716
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -677,12 +737,15 @@ export class GuardGatewayResponseStartTimeout extends Schema.TaggedErrorClass<Gu
677
737
  get public() {
678
738
  return this.cause.public;
679
739
  }
740
+ get rayId() {
741
+ return this.cause.rayId;
742
+ }
680
743
  get isRetryable(): boolean {
681
744
  return true;
682
745
  }
683
746
  }
684
747
 
685
- export class InternalError extends Schema.TaggedErrorClass<InternalError>(
748
+ export class InternalError extends Schema.TaggedError<InternalError>(
686
749
  `${ReasonTypeId}/InternalError`,
687
750
  )("InternalError", {
688
751
  cause: Schema.instanceOf(RivetkitErrors.RivetError),
@@ -709,12 +772,15 @@ export class InternalError extends Schema.TaggedErrorClass<InternalError>(
709
772
  get public() {
710
773
  return this.cause.public;
711
774
  }
775
+ get rayId() {
776
+ return this.cause.rayId;
777
+ }
712
778
  get isRetryable(): boolean {
713
779
  return false;
714
780
  }
715
781
  }
716
782
 
717
- export class ActionErrorDecodeFailed extends Schema.TaggedErrorClass<ActionErrorDecodeFailed>(
783
+ export class ActionErrorDecodeFailed extends Schema.TaggedError<ActionErrorDecodeFailed>(
718
784
  `${ReasonTypeId}/ActionErrorDecodeFailed`,
719
785
  )("ActionErrorDecodeFailed", {
720
786
  cause: Schema.instanceOf(Schema.SchemaError),
@@ -742,6 +808,9 @@ export class ActionErrorDecodeFailed extends Schema.TaggedErrorClass<ActionError
742
808
  get public() {
743
809
  return this.rivetError.public;
744
810
  }
811
+ get rayId() {
812
+ return this.rivetError.rayId;
813
+ }
745
814
  get isRetryable(): boolean {
746
815
  return false;
747
816
  }
@@ -757,7 +826,7 @@ export class ActionErrorDecodeFailed extends Schema.TaggedErrorClass<ActionError
757
826
  * receive those errors **typed** in the error channel; this reason is
758
827
  * the catch-all for everything else.
759
828
  */
760
- export class UnknownUserError extends Schema.TaggedErrorClass<UnknownUserError>(
829
+ export class UnknownUserError extends Schema.TaggedError<UnknownUserError>(
761
830
  `${ReasonTypeId}/UnknownUserError`,
762
831
  )("UnknownUserError", { cause: Schema.instanceOf(RivetkitErrors.RivetError) }) {
763
832
  readonly [ReasonTypeId] = ReasonTypeId;
@@ -782,6 +851,9 @@ export class UnknownUserError extends Schema.TaggedErrorClass<UnknownUserError>(
782
851
  get public() {
783
852
  return this.cause.public;
784
853
  }
854
+ get rayId() {
855
+ return this.cause.rayId;
856
+ }
785
857
  get isRetryable(): boolean {
786
858
  return false;
787
859
  }
@@ -792,7 +864,7 @@ export class UnknownUserError extends Schema.TaggedErrorClass<UnknownUserError>(
792
864
  * not recognize yet, and for malformed non-Rivet failures. Known wire
793
865
  * fields are mirrored when present, while `cause` preserves the raw input.
794
866
  */
795
- export class UnknownError extends Schema.TaggedErrorClass<UnknownError>(
867
+ export class UnknownError extends Schema.TaggedError<UnknownError>(
796
868
  `${ReasonTypeId}/UnknownError`,
797
869
  )("UnknownError", {
798
870
  message: Schema.String,
@@ -829,6 +901,11 @@ export class UnknownError extends Schema.TaggedErrorClass<UnknownError>(
829
901
  ? this.cause.public
830
902
  : undefined;
831
903
  }
904
+ get rayId() {
905
+ return this.cause instanceof RivetkitErrors.RivetError
906
+ ? this.cause.rayId
907
+ : undefined;
908
+ }
832
909
  get isRetryable(): boolean {
833
910
  return false;
834
911
  }
@@ -941,7 +1018,7 @@ export const isRivetErrorReason = (u: unknown): u is RivetErrorReason =>
941
1018
  * arrive in the typed error channel separately and do NOT flow through
942
1019
  * `RivetError`.
943
1020
  */
944
- export class RivetError extends Schema.TaggedErrorClass<RivetError>(
1021
+ export class RivetError extends Schema.TaggedError<RivetError>(
945
1022
  "@rivetkit/effect/RivetError",
946
1023
  )("RivetError", {
947
1024
  reason: RivetErrorReason,
@@ -987,6 +1064,11 @@ export class RivetError extends Schema.TaggedErrorClass<RivetError>(
987
1064
  return "public" in this.reason ? this.reason.public : undefined;
988
1065
  }
989
1066
 
1067
+ /** Delegates to the underlying reason's `rayId` if present. */
1068
+ get rayId(): string | undefined {
1069
+ return "rayId" in this.reason ? this.reason.rayId : undefined;
1070
+ }
1071
+
990
1072
  /** Delegates to the underlying reason's `isRetryable` getter. */
991
1073
  get isRetryable(): boolean {
992
1074
  return this.reason.isRetryable;
@@ -2,11 +2,11 @@ import {
2
2
  Config,
3
3
  Context,
4
4
  Effect,
5
+ Record as EffectRecord,
5
6
  Logger,
7
+ type LogLevel,
6
8
  Option,
7
9
  Predicate,
8
- Record as EffectRecord,
9
- type LogLevel,
10
10
  References,
11
11
  } from "effect";
12
12
  import type * as Rivetkit from "rivetkit";
@@ -51,7 +51,7 @@ const RivetkitLevelByEffectLevel = {
51
51
  All: "trace",
52
52
  } as Record<LogLevel.LogLevel, RivetkitLog.LogLevel>;
53
53
 
54
- const rivetLogLevelFromEnv = Config.string("RIVET_LOG_LEVEL").pipe(
54
+ const rivetLogLevelFromEnv = Config.String("RIVET_LOG_LEVEL").pipe(
55
55
  Effect.option,
56
56
  Effect.map((maybeRivetLogLevel) => {
57
57
  if (Option.isNone(maybeRivetLogLevel)) return Option.none();