@yielded/agent-platform-cloudflare 0.1.0-beta.178 → 0.1.0-beta.181

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,7 +1,7 @@
1
1
  import { DurableAlarmError, DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace, ThreadObjectPlacement } from "./CloudflareBindings.mjs";
2
2
  import { l as CloudflarePlatformConfigError, s as CloudflareDurableRuntimeConfig, t as AdmissionLimitExceeded } from "./CloudflareConfig-C9MvPbX8.mjs";
3
3
  import { DurableAlarmService, MaintenancePassFailure, ThreadMaintenance, ThreadMaintenanceAlarm, ThreadMaintenanceFailpoint, ThreadMaintenanceFailpointHandler, ThreadMutationGate, ThreadPublication, ThreadRecoveryEvents } from "./Alarm.mjs";
4
- import { E as SubmitRequest, _ as HostProtocolError } from "./CloudflareThreadClient-Bo0cBJe9.mjs";
4
+ import { E as SubmitRequest, _ as HostProtocolError } from "./CloudflareThreadClient-Atp-Clb4.mjs";
5
5
  import { AgentRegistration } from "@yielded/agent/agent-registration";
6
6
  import { ApprovalSuspensionError, DurableAgentRuntime, DurableRuntimeConfig, RecoveryBlocked, RecoveryReport } from "@yielded/agent/durable-agent-runtime";
7
7
  import { SubmissionId, ThreadId } from "@yielded/agent/identifiers";
@@ -324,516 +324,7 @@ declare const decodeAdminExplainRequest: (input: unknown, options?: import("effe
324
324
  declare const decodeAdminVerifyRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminVerifyRequest, Schema.SchemaError, never>;
325
325
  declare const decodeRetryCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<RetryCommand, Schema.SchemaError, never>;
326
326
  declare const decodeObligationThresholds: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<ObligationThresholds, Schema.SchemaError, never>;
327
- declare const encodeAdminResponse: (input: AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
328
- readonly _tag: "ExplainedRecovery";
329
- readonly explanations: readonly {
330
- readonly submission: {
331
- readonly submissionId: string;
332
- readonly threadId: string;
333
- readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "settled" | "suspended" | "unknown";
334
- readonly queueSequence: number;
335
- readonly createdAt: string;
336
- readonly readyAt?: string | undefined;
337
- readonly ageSeconds: number;
338
- readonly readyAgeSeconds?: number | undefined;
339
- readonly parentLinkage?: {
340
- readonly parentSubmissionId: string;
341
- readonly parentToolCallId: string;
342
- } | undefined;
343
- };
344
- readonly evidence: {
345
- readonly threadMaterialized: boolean;
346
- readonly inputRecorded: boolean;
347
- readonly abortRecorded: boolean;
348
- readonly recordedSettlementOutcome?: "aborted" | "completed" | "failed" | undefined;
349
- readonly openToolCalls: readonly {
350
- readonly toolCallId: string;
351
- readonly toolName: string;
352
- readonly turn: number;
353
- }[];
354
- readonly pendingOperations: readonly {
355
- readonly toolCallId: string;
356
- readonly toolName: string;
357
- readonly executionClass: "idempotent" | "readonly" | "uncertain";
358
- readonly executionKind: "delegation" | "orchestration" | "ordinary";
359
- readonly replay: string;
360
- readonly runId: string;
361
- readonly turnId: string;
362
- readonly turn: number;
363
- readonly parameters: Schema.Json;
364
- readonly parametersDigest: string;
365
- }[];
366
- readonly openDelegationCalls: readonly {
367
- readonly toolCallId: string;
368
- readonly toolName: string;
369
- readonly turn: number;
370
- readonly requested: boolean;
371
- readonly started: boolean;
372
- readonly joined: boolean;
373
- readonly childThreadId?: string | undefined;
374
- readonly childSubmissionId?: string | undefined;
375
- readonly admission?: "admitted" | "indeterminate" | "not-admitted" | undefined;
376
- }[];
377
- readonly approvalsPending: readonly {
378
- readonly toolCallId: string;
379
- readonly turn: number;
380
- }[];
381
- readonly unknownCalls: readonly {
382
- readonly toolCallId: string;
383
- readonly toolName: string;
384
- readonly reason: string;
385
- readonly recordedAt: string;
386
- readonly resolved: boolean;
387
- }[];
388
- readonly approvalDecisions: readonly {
389
- readonly submissionId: string;
390
- readonly toolCallId: string;
391
- readonly decision: "approved" | "denied";
392
- readonly resolver: string;
393
- readonly reason: string;
394
- readonly decidedAt: string;
395
- readonly canonicalRecordId?: string | undefined;
396
- }[];
397
- readonly unknownResolutions: readonly {
398
- readonly submissionId: string;
399
- readonly toolCallId: string;
400
- readonly author: string;
401
- readonly reason: string;
402
- readonly resolution: {
403
- readonly _tag: "SafeToRetry";
404
- } | {
405
- readonly _tag: "CompletedWithResult";
406
- readonly result: Schema.Json;
407
- readonly isFailure: boolean;
408
- } | {
409
- readonly _tag: "NeverHappened";
410
- } | {
411
- readonly _tag: "AbortSubmission";
412
- };
413
- readonly resolvedAt: string;
414
- readonly canonicalRecordId?: string | undefined;
415
- }[];
416
- readonly childAttachments: readonly {
417
- readonly toolCallId: string;
418
- readonly childSubmissionId: string;
419
- readonly childState: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "settled" | "suspended" | "unknown";
420
- readonly childOutcome?: "aborted" | "completed" | "failed" | undefined;
421
- }[];
422
- readonly joins: readonly {
423
- readonly submissionId: string;
424
- readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "settled" | "suspended" | "unknown";
425
- readonly hostSubmissionId: string;
426
- }[];
427
- readonly hostSubmissionId?: string | undefined;
428
- readonly suspension?: {
429
- readonly reason: {
430
- readonly _tag: "ApprovalPending";
431
- readonly toolCallIds: readonly [string, ...string[]];
432
- } | {
433
- readonly _tag: "WaitingForChild";
434
- readonly children: readonly [{
435
- readonly toolCallId: string;
436
- readonly childSubmissionId: string;
437
- }, ...{
438
- readonly toolCallId: string;
439
- readonly childSubmissionId: string;
440
- }[]];
441
- };
442
- readonly suspendedAt: string;
443
- } | undefined;
444
- readonly abortIntent?: {
445
- readonly submissionId: string;
446
- readonly author: string;
447
- readonly reason: string;
448
- readonly requestedAt: string;
449
- readonly canonicalRecordId?: string | undefined;
450
- } | undefined;
451
- };
452
- readonly decision: {
453
- readonly _tag: "CompleteMaterialization";
454
- readonly submissionId: string;
455
- } | {
456
- readonly _tag: "RepairReadiness";
457
- readonly submissionId: string;
458
- } | {
459
- readonly _tag: "ApplyInput";
460
- readonly submissionId: string;
461
- } | {
462
- readonly _tag: "RepairInputMarker";
463
- readonly submissionId: string;
464
- } | {
465
- readonly _tag: "ResumeFromTurnBoundary";
466
- readonly submissionId: string;
467
- } | {
468
- readonly _tag: "FinalizeLedgerFromHistory";
469
- readonly submissionId: string;
470
- readonly settlementId: string;
471
- readonly outcome: "aborted" | "completed" | "failed";
472
- } | {
473
- readonly _tag: "SettleAborted";
474
- readonly submissionId: string;
475
- } | {
476
- readonly _tag: "MarkUnknown";
477
- readonly submissionId: string;
478
- readonly reason: string;
479
- readonly openToolCallIds: readonly string[];
480
- } | {
481
- readonly _tag: "ResumePendingToolBatch";
482
- readonly submissionId: string;
483
- readonly turn: number;
484
- } | {
485
- readonly _tag: "AwaitApprovalDecision";
486
- readonly submissionId: string;
487
- } | {
488
- readonly _tag: "ResumeSuspended";
489
- readonly submissionId: string;
490
- } | {
491
- readonly _tag: "AwaitUnknownResolution";
492
- readonly submissionId: string;
493
- } | {
494
- readonly _tag: "ApplyUnknownResolutions";
495
- readonly submissionId: string;
496
- } | {
497
- readonly _tag: "RevertJoining";
498
- readonly submissionId: string;
499
- } | {
500
- readonly _tag: "RepairJoinMarker";
501
- readonly submissionId: string;
502
- } | {
503
- readonly _tag: "SettleJoinedWithHost";
504
- readonly submissionId: string;
505
- readonly outcome: "aborted" | "completed" | "failed";
506
- } | {
507
- readonly _tag: "AwaitHostSettlement";
508
- readonly submissionId: string;
509
- readonly hostSubmissionId?: string | undefined;
510
- } | {
511
- readonly _tag: "CompleteChildAdmission";
512
- readonly submissionId: string;
513
- readonly toolCallId: string;
514
- } | {
515
- readonly _tag: "AwaitChildAdmissionResolution";
516
- readonly submissionId: string;
517
- readonly toolCallId: string;
518
- } | {
519
- readonly _tag: "RepairSubagentStartLink";
520
- readonly submissionId: string;
521
- readonly toolCallId: string;
522
- } | {
523
- readonly _tag: "EnsureWaitingForChild";
524
- readonly submissionId: string;
525
- readonly children: readonly [{
526
- readonly toolCallId: string;
527
- readonly childSubmissionId: string;
528
- }, ...{
529
- readonly toolCallId: string;
530
- readonly childSubmissionId: string;
531
- }[]];
532
- } | {
533
- readonly _tag: "AwaitChildSettlement";
534
- readonly submissionId: string;
535
- } | {
536
- readonly _tag: "ResumeWaitingParent";
537
- readonly submissionId: string;
538
- readonly children: readonly [{
539
- readonly toolCallId: string;
540
- readonly childSubmissionId: string;
541
- }, ...{
542
- readonly toolCallId: string;
543
- readonly childSubmissionId: string;
544
- }[]];
545
- } | {
546
- readonly _tag: "ApplyJoinAccounting";
547
- readonly submissionId: string;
548
- readonly toolCallId: string;
549
- readonly reservationId: string;
550
- } | {
551
- readonly _tag: "PropagateChildAbort";
552
- readonly submissionId: string;
553
- readonly children: readonly [{
554
- readonly toolCallId: string;
555
- readonly childSubmissionId: string;
556
- }, ...{
557
- readonly toolCallId: string;
558
- readonly childSubmissionId: string;
559
- }[]];
560
- } | {
561
- readonly _tag: "ReleaseOrphanChildReservation";
562
- readonly submissionId: string;
563
- readonly reservationIds: readonly [string, ...string[]];
564
- } | {
565
- readonly _tag: "AwaitParentEstablishment";
566
- readonly submissionId: string;
567
- readonly parentSubmissionId: string;
568
- readonly parentToolCallId: string;
569
- } | {
570
- readonly _tag: "NoAction";
571
- readonly submissionId: string;
572
- };
573
- readonly decisionMeaning: string;
574
- readonly disposition: "deferred" | "none" | "repaired" | "unknown";
575
- readonly explainedAt: string;
576
- }[];
577
- } | {
578
- readonly _tag: "VerifiedIntegrity";
579
- readonly report: {
580
- readonly threadId: string;
581
- readonly tailSequence: number;
582
- readonly recordCount: number;
583
- readonly submissionCount: number;
584
- readonly checks: readonly {
585
- readonly name: "all-settled" | "checkpoint-binding" | "continuation-evidence" | "fifo-input-order" | "input-before-settlement" | "ledger-canonical-agreement" | "record-identity" | "schema-round-trip" | "sequence-contiguity" | "terminal-uniqueness";
586
- readonly status: "failed" | "passed" | "skipped";
587
- readonly detail?: string | undefined;
588
- }[];
589
- readonly ok: boolean;
590
- };
591
- } | {
592
- readonly _tag: "RetryExecuted";
593
- readonly report: {
594
- readonly submissionId: string;
595
- readonly threadId: string;
596
- readonly decision: {
597
- readonly _tag: "CompleteMaterialization";
598
- readonly submissionId: string;
599
- } | {
600
- readonly _tag: "RepairReadiness";
601
- readonly submissionId: string;
602
- } | {
603
- readonly _tag: "ApplyInput";
604
- readonly submissionId: string;
605
- } | {
606
- readonly _tag: "RepairInputMarker";
607
- readonly submissionId: string;
608
- } | {
609
- readonly _tag: "ResumeFromTurnBoundary";
610
- readonly submissionId: string;
611
- } | {
612
- readonly _tag: "FinalizeLedgerFromHistory";
613
- readonly submissionId: string;
614
- readonly settlementId: string;
615
- readonly outcome: "aborted" | "completed" | "failed";
616
- } | {
617
- readonly _tag: "SettleAborted";
618
- readonly submissionId: string;
619
- } | {
620
- readonly _tag: "MarkUnknown";
621
- readonly submissionId: string;
622
- readonly reason: string;
623
- readonly openToolCallIds: readonly string[];
624
- } | {
625
- readonly _tag: "ResumePendingToolBatch";
626
- readonly submissionId: string;
627
- readonly turn: number;
628
- } | {
629
- readonly _tag: "AwaitApprovalDecision";
630
- readonly submissionId: string;
631
- } | {
632
- readonly _tag: "ResumeSuspended";
633
- readonly submissionId: string;
634
- } | {
635
- readonly _tag: "AwaitUnknownResolution";
636
- readonly submissionId: string;
637
- } | {
638
- readonly _tag: "ApplyUnknownResolutions";
639
- readonly submissionId: string;
640
- } | {
641
- readonly _tag: "RevertJoining";
642
- readonly submissionId: string;
643
- } | {
644
- readonly _tag: "RepairJoinMarker";
645
- readonly submissionId: string;
646
- } | {
647
- readonly _tag: "SettleJoinedWithHost";
648
- readonly submissionId: string;
649
- readonly outcome: "aborted" | "completed" | "failed";
650
- } | {
651
- readonly _tag: "AwaitHostSettlement";
652
- readonly submissionId: string;
653
- readonly hostSubmissionId?: string | undefined;
654
- } | {
655
- readonly _tag: "CompleteChildAdmission";
656
- readonly submissionId: string;
657
- readonly toolCallId: string;
658
- } | {
659
- readonly _tag: "AwaitChildAdmissionResolution";
660
- readonly submissionId: string;
661
- readonly toolCallId: string;
662
- } | {
663
- readonly _tag: "RepairSubagentStartLink";
664
- readonly submissionId: string;
665
- readonly toolCallId: string;
666
- } | {
667
- readonly _tag: "EnsureWaitingForChild";
668
- readonly submissionId: string;
669
- readonly children: readonly [{
670
- readonly toolCallId: string;
671
- readonly childSubmissionId: string;
672
- }, ...{
673
- readonly toolCallId: string;
674
- readonly childSubmissionId: string;
675
- }[]];
676
- } | {
677
- readonly _tag: "AwaitChildSettlement";
678
- readonly submissionId: string;
679
- } | {
680
- readonly _tag: "ResumeWaitingParent";
681
- readonly submissionId: string;
682
- readonly children: readonly [{
683
- readonly toolCallId: string;
684
- readonly childSubmissionId: string;
685
- }, ...{
686
- readonly toolCallId: string;
687
- readonly childSubmissionId: string;
688
- }[]];
689
- } | {
690
- readonly _tag: "ApplyJoinAccounting";
691
- readonly submissionId: string;
692
- readonly toolCallId: string;
693
- readonly reservationId: string;
694
- } | {
695
- readonly _tag: "PropagateChildAbort";
696
- readonly submissionId: string;
697
- readonly children: readonly [{
698
- readonly toolCallId: string;
699
- readonly childSubmissionId: string;
700
- }, ...{
701
- readonly toolCallId: string;
702
- readonly childSubmissionId: string;
703
- }[]];
704
- } | {
705
- readonly _tag: "ReleaseOrphanChildReservation";
706
- readonly submissionId: string;
707
- readonly reservationIds: readonly [string, ...string[]];
708
- } | {
709
- readonly _tag: "AwaitParentEstablishment";
710
- readonly submissionId: string;
711
- readonly parentSubmissionId: string;
712
- readonly parentToolCallId: string;
713
- } | {
714
- readonly _tag: "NoAction";
715
- readonly submissionId: string;
716
- };
717
- readonly disposition: "deferred" | "none" | "repaired" | "unknown";
718
- };
719
- } | {
720
- readonly _tag: "ObligationsScanned";
721
- readonly report: {
722
- readonly thresholds: {
723
- readonly agingSeconds: number;
724
- readonly overdueSeconds: number;
725
- };
726
- readonly entries: readonly {
727
- readonly submissionId: string;
728
- readonly threadId: string;
729
- readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "settled" | "suspended" | "unknown";
730
- readonly blockedOn: "approval" | "ready-aged" | "running-aged" | "unknown" | "waitingForChild";
731
- readonly ageSeconds: number;
732
- readonly severity: "aging" | "ok" | "overdue";
733
- }[];
734
- readonly generatedAt: string;
735
- };
736
- } | {
737
- readonly _tag: "AdminFailed";
738
- readonly failure: {
739
- readonly _tag: "DurableAlarmError";
740
- readonly operation: string;
741
- readonly message: string;
742
- readonly cause?: Schema.Json | undefined;
743
- } | {
744
- readonly _tag: "LedgerError";
745
- readonly operation: string;
746
- readonly message: string;
747
- readonly cause?: import("@yielded/agent/failure-diagnostic").Diagnostic | undefined;
748
- } | {
749
- readonly _tag: "ThreadStoreError";
750
- readonly operation: string;
751
- readonly message: string;
752
- readonly cause?: Schema.Json | undefined;
753
- readonly diagnostic?: {
754
- readonly causeTag: string;
755
- readonly operation: string;
756
- readonly decoder?: string | undefined;
757
- readonly issueTag?: string | undefined;
758
- readonly sequence?: number | undefined;
759
- } | undefined;
760
- } | {
761
- readonly _tag: "ThreadNotMaterialized";
762
- readonly threadId: string;
763
- } | {
764
- readonly _tag: "AppendConflict";
765
- readonly threadId: string;
766
- readonly batchId: string;
767
- readonly reason: "batch-content" | "record-identity" | "stale-command" | "tail";
768
- readonly actualTailSequence?: number | undefined;
769
- } | {
770
- readonly _tag: "OwnershipLost";
771
- readonly submissionId: string;
772
- } | {
773
- readonly _tag: "OperationDenied";
774
- readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
775
- readonly reason: string;
776
- readonly threadId?: string | undefined;
777
- readonly submissionId?: string | undefined;
778
- } | {
779
- readonly _tag: "SettlementConflict";
780
- readonly submissionId: string;
781
- readonly existingOutcome: "aborted" | "completed" | "failed";
782
- } | {
783
- readonly _tag: "WorkDiscoveryUnavailable";
784
- readonly threadId: string;
785
- readonly reason: "incomplete-rebuild" | "missing-index" | "unsupported";
786
- } | {
787
- readonly _tag: "RecoveryBlocked";
788
- readonly threadId: string;
789
- readonly failure: {
790
- readonly phase: "history" | "recovery";
791
- readonly reason: "defect" | "failure" | "timeout";
792
- readonly errorTag: string;
793
- readonly operation: string;
794
- readonly causes: readonly {
795
- readonly errorTag: "AdmissionPolicyError" | "AggregateError" | "AppendConflict" | "DigestError" | "DurableRuntimeFailpointError" | "Error" | "EvalError" | "ForeignError" | "LedgerError" | "NonErrorCause" | "OwnershipLost" | "RangeError" | "ReferenceError" | "RunJournalError" | "SchemaError" | "SettlementConflict" | "SyntaxError" | "ThreadNotMaterialized" | "ThreadStoreError" | "TypeError" | "URIError" | "WorkDiscoveryUnavailable";
796
- }[];
797
- readonly causesTruncated?: true | undefined;
798
- readonly diagnostic?: {
799
- readonly causeTag: string;
800
- readonly operation: string;
801
- readonly decoder?: string | undefined;
802
- readonly issueTag?: string | undefined;
803
- readonly sequence?: number | undefined;
804
- } | undefined;
805
- };
806
- } | {
807
- readonly _tag: "AdmissionPolicyError";
808
- readonly reason: "occupied" | "refused" | "unavailable";
809
- readonly code: string;
810
- readonly cause?: import("@yielded/agent/failure-diagnostic").Diagnostic | undefined;
811
- readonly stack?: string | undefined;
812
- } | {
813
- readonly _tag: "ApprovalSuspensionError";
814
- readonly cause: Schema.Json;
815
- } | {
816
- readonly _tag: "DigestError";
817
- readonly message: string;
818
- readonly cause?: Schema.Json | undefined;
819
- } | {
820
- readonly _tag: "DurableRuntimeFailpointError";
821
- readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "claim:after-claim" | "compaction:after-canonical-append" | "compaction:before-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-duration-append" | "run:after-start-append" | "run:before-duration-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "subagent:before-join-append" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:before-publication" | "tools:after-dispatch-fence" | "tools:after-unavailable-append" | "tools:before-dispatch-fence" | "tools:before-unavailable-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "update:after-canonical-append" | "update:after-delivery-insert" | "update:before-canonical-append" | "update:before-delivery-insert" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "worker:after-stop-append" | "worker:after-stop-seal" | "worker:after-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-stop-append" | "worker:before-stop-seal" | "worker:before-subtree-append";
822
- } | {
823
- readonly _tag: "RunJournalError";
824
- readonly message: string;
825
- readonly cause?: Schema.Json | undefined;
826
- } | {
827
- readonly _tag: "HostProtocolError";
828
- readonly message: string;
829
- } | {
830
- readonly _tag: "RetryRefused";
831
- readonly submissionId: string;
832
- readonly refusal: "await-approval-decision" | "await-unknown-resolution" | "settled";
833
- readonly decisionTag: string;
834
- readonly message: string;
835
- };
836
- }, Schema.SchemaError, never>;
327
+ declare const encodeAdminResponse: ReturnType<typeof Schema.encodeEffect<typeof AdminResponse>>;
837
328
  declare const decodeAdminResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AdminFailed | ExplainedRecovery | ObligationsScanned | RetryExecuted | VerifiedIntegrity, Schema.SchemaError, never>;
838
329
  declare const portCall: (encoded: unknown) => Effect.Effect<unknown, never, ThreadObjectPorts | ThreadMaintenance | DurableAlarmService | ThreadObjectIdentity>;
839
330
  /** The per-Thread wire operations supported by native and application-owned endpoints. */
@@ -888,4 +379,4 @@ interface Class<EventServices = never> {
888
379
  declare const make: <ApplicationServices, ApplicationError, EventServices = never, EventLayerError = never, AlarmServices = never, AlarmError = never>(applicationLayer: Layer.Layer<CloudflareDurableRuntimeServices | ApplicationServices, ApplicationError, CloudflareBootstrapServices | ThreadMaintenanceAlarm | NoInfer<AlarmServices> | DurableObjectState$1.DurableObjectState | WorkerEnvironment | DurableObjectContext | ThreadObjectNamespace>, options: Options<ApplicationServices, EventServices, EventLayerError, AlarmServices, AlarmError>) => Class<ApplicationServices | EventServices | AlarmServices>;
889
380
  //#endregion
890
381
  export { ThreadHostMutation as A, make as C, CloudflareDurableRuntimeInitializationError as D, CloudflareBootstrapServices as E, layerHostConfig as F, layerInHost as I, ThreadPublicationOptions as M, layer$1 as N, CloudflareDurableRuntimeOptions as O, layerConfig as P, handleRpc as S, submit as T, decodeAdminResponse as _, AdminVerifyRequest as a, decodeRetryCommand as b, Instance as c, RetryExecuted as d, ThreadObject_d_exports as f, decodeAdminExplainRequest as g, alarms as h, AdminResponse as i, ThreadObjectPorts as j, CloudflareDurableRuntimeServices as k, ObligationsScanned as l, VerifiedIntegrity as m, AdminFailed as n, Class as o, ThreadRpcOperation as p, AdminFailure as r, ExplainedRecovery as s, AdminExplainRequest as t, Options as u, decodeAdminVerifyRequest as v, portCall as w, encodeAdminResponse as x, decodeObligationThresholds as y };
891
- //# sourceMappingURL=ThreadObject-DQfv28fe.d.mts.map
382
+ //# sourceMappingURL=ThreadObject-B1Rv8jPn.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { DurableAlarmError, DurableObjectContext, ThreadObjectIdentity, ThreadObjectNamespace, ThreadObjectPlacement, callThreadObject, threadNamespaceFromEnv } from "./CloudflareBindings.mjs";
3
3
  import { AdmissionLimitExceeded, CLOUDFLARE_RUNTIME_DEFAULTS, CloudflareDurableRuntimeConfig, CloudflareDurableRuntimeConfigValue, CloudflarePlatformConfigError } from "./CloudflareConfig.mjs";
4
- import { _ as Messages, a as ThreadMaintenance, b as Publication, c as ThreadMessageDelivery, d as ThreadPublication, g as Lifecycle, h as HostLaneId, l as ThreadMutationGate, m as publishCommitted, n as DurableAlarmService, o as ThreadMaintenanceAlarm, s as ThreadMaintenanceFailpoint, u as ThreadNativeMaintenance, v as Native, y as Projection } from "./Alarm-CZO-Gbts.mjs";
4
+ import { _ as Messages, a as ThreadMaintenance, b as Publication, c as ThreadMessageDelivery, d as ThreadPublication, g as Lifecycle, h as HostLaneId, l as ThreadMutationGate, m as publishCommitted, n as DurableAlarmService, o as ThreadMaintenanceAlarm, s as ThreadMaintenanceFailpoint, u as ThreadNativeMaintenance, v as Native, y as Projection } from "./Alarm-C257DCAJ.mjs";
5
5
  import { B as encodeHostResponse, C as boundHostDiagnostic, D as decodeAwaitSettlementRequest, E as decodeAwaitProgressRequest, G as Frame, K as MAX_DELTA_LENGTH, M as decodeReceipt, N as decodeSubmitRequest, O as decodeCancelProgressRequest, P as decodeUnknownResolutionCommand, S as UnknownResolutionRecorded, T as decodeApprovalDecisionCommand, X as isBoundedEvent, Y as Request, Z as cloudflareCryptoLayer, _ as SettlementRecordReached, b as SubmitSucceeded, c as HostFailed, g as SettlementReached, h as ProgressObserved, j as decodeObservePageRequest, m as ProgressCancelled, n as ApprovalRecorded, o as CloudflareThreadClient, p as ObservedPage, t as AbortRecorded, u as HostProtocolError, v as SubmissionStatusResponse, w as decodeAbortCommand } from "./CloudflareThreadClient-CEUjVwis.mjs";
6
6
  import { t as cloudflarePreparedInputAdmissionLayer } from "./prepared-admission-C3uBqIz0.mjs";
7
7
  import { cloudflareWakeSchedulerLayer } from "./WakeScheduler.mjs";
@@ -36,7 +36,7 @@ import { MessageDeliveryDriver, MessageDeliveryError, MessageDeliveryStore } fro
36
36
  import { CurrentToolFailureObserver, RunContextPreparationPassthrough, RunToolAuthorization, toolFailureObserverLayer } from "@yielded/agent/run-options";
37
37
  import { StorageOwner, layer } from "@yielded/agent/run-storage";
38
38
  import { SettlementPublisher, validatePublication } from "@yielded/agent/settlement-publisher";
39
- import { SqlStorageOwner } from "@yielded/agent/sql-memory-store";
39
+ import { SqlStorageOwner } from "@yielded/agent/sql-storage-owner";
40
40
  import { ToolReconciler } from "@yielded/agent/tool-reconciler";
41
41
  import * as Response from "effect/ai/Response";
42
42
  //#region src/internal/live-text.ts
@@ -595,7 +595,7 @@ const sharedLayer = (application, options = {}) => Layer.unwrap(Effect.gen(funct
595
595
  })).pipe(Layer.provide(localPorts), Layer.provide(messageStore), Layer.provide(wakes));
596
596
  const routedPorts = Layer.mergeAll(Layer.effect(StorageOwner, StorageOwner), routedSubmissionLedgerLayer({ ownsThread }), routedSettlementPublisherLayer({ ownsThread }), routedThreadStoreLayer({ ownsThread }), routedWorkerAdmissionLayer({ ownsThread })).pipe(Layer.provide(localPorts), Layer.provide(threadPortTransportLayer));
597
597
  const routedMessages = routedMessageDeliveryStoreLayer({ ownsThread }).pipe(Layer.provide(messageStore), Layer.provide(threadPortTransportLayer));
598
- const runtimeStack = application.pipe(Layer.provideMerge(layer()), Layer.provide(cloudflarePreparedInputAdmissionLayer.pipe(Layer.provide(CloudflareThreadClient.layer))), Layer.provideMerge(routedMessages), Layer.provideMerge(routedPorts), Layer.provideMerge(wakes), Layer.provideMerge(base), Layer.provideMerge(portsEndpointLayer));
598
+ const runtimeStack = Layer.suspend(() => application.pipe(Layer.provideMerge(layer()), Layer.provide(cloudflarePreparedInputAdmissionLayer.pipe(Layer.provide(CloudflareThreadClient.layer))), Layer.provideMerge(routedMessages), Layer.provideMerge(routedPorts), Layer.provideMerge(wakes), Layer.provideMerge(base), Layer.provideMerge(portsEndpointLayer)));
599
599
  const maintenanceRuntime = options.lifecyclePublication === void 0 ? runtimeStack : Layer.merge(runtimeStack, Layer.effect(ThreadNativeMaintenance)(Effect.gen(function* () {
600
600
  const previous = yield* ThreadNativeMaintenance;
601
601
  const storage = (yield* ThreadStore).lifecyclePublications;
@@ -982,7 +982,7 @@ const decodeAdminExplainRequest = Schema.decodeUnknownEffect(AdminExplainRequest
982
982
  const decodeAdminVerifyRequest = Schema.decodeUnknownEffect(AdminVerifyRequest);
983
983
  const decodeRetryCommand = Schema.decodeUnknownEffect(RetryCommand);
984
984
  const decodeObligationThresholds = Schema.decodeUnknownEffect(ObligationThresholds);
985
- const encodeAdminResponse = Schema.encodeEffect(AdminResponse);
985
+ const encodeAdminResponse = (...args) => Schema.encodeEffect(AdminResponse)(...args);
986
986
  const decodeAdminResponse = Schema.decodeUnknownEffect(AdminResponse);
987
987
  /** Fold one admin endpoint's typed failures into the uniform `AdminResponse` envelope. */
988
988
  const respondAdmin = (effect) => effect.pipe(Effect.map((result) => result), Effect.catch((failure) => Effect.succeed(AdminFailed.make({ failure }))));
@@ -1134,20 +1134,14 @@ const effectCfPlatformLayer = (namespaceBinding, rpcTracing = false) => Layer.ef
1134
1134
  */
1135
1135
  const make = (applicationLayer, options) => {
1136
1136
  const application = applicationLayer.pipe(Layer.provideMerge(layerConfig(options)), Layer.provideMerge(effectCfPlatformLayer(options.namespaceBinding, options.rpcTracing)));
1137
- const runtime = Layer.effectContext(Effect.gen(function* () {
1138
- const state = yield* DurableObjectState.DurableObjectState;
1139
- const scope = yield* Effect.scope;
1140
- return yield* state.blockConcurrencyWhile(Effect.gen(function* () {
1141
- const applicationServices = yield* Layer.buildWithScope(application, scope);
1142
- const scheduling = Context.get(applicationServices, DurableObjectAlarm.ScheduleConfiguration);
1143
- const services = Context.add(applicationServices, DurableObjectAlarm.ScheduleConfiguration, {
1144
- ...scheduling,
1145
- dispatchAfterEvent: scheduling.dispatchAfterEvent ?? true
1146
- });
1147
- yield* gateEndpoint.pipe(Effect.provide(services));
1148
- return services;
1149
- }));
1150
- }));
1137
+ const runtime = Layer.flatMap(application, (applicationServices) => {
1138
+ const scheduling = Context.get(applicationServices, DurableObjectAlarm.ScheduleConfiguration);
1139
+ const services = Context.add(applicationServices, DurableObjectAlarm.ScheduleConfiguration, {
1140
+ ...scheduling,
1141
+ dispatchAfterEvent: scheduling.dispatchAfterEvent ?? true
1142
+ });
1143
+ return Layer.effectContext(gateEndpoint.pipe(Effect.provide(services), Effect.as(services)));
1144
+ });
1151
1145
  const rpc = {
1152
1146
  ...threadRpc,
1153
1147
  explainEncoded: (encoded) => explainEndpoint(encoded),
@@ -1166,4 +1160,4 @@ const make = (applicationLayer, options) => {
1166
1160
  //#endregion
1167
1161
  export { ThreadObjectPorts as C, layerInHost as D, layerHostConfig as E, submit as S, layerConfig as T, decodeRetryCommand as _, AdminVerifyRequest as a, make as b, RetryExecuted as c, VerifiedIntegrity as d, alarms as f, decodeObligationThresholds as g, decodeAdminVerifyRequest as h, AdminResponse as i, ThreadObject_exports as l, decodeAdminResponse as m, AdminFailed as n, ExplainedRecovery as o, decodeAdminExplainRequest as p, AdminFailure as r, ObligationsScanned as s, AdminExplainRequest as t, ThreadRpcOperation as u, encodeAdminResponse as v, layer$1 as w, portCall as x, handleRpc as y };
1168
1162
 
1169
- //# sourceMappingURL=ThreadObject-v-mwNRZ0.mjs.map
1163
+ //# sourceMappingURL=ThreadObject-vmc0jRTS.mjs.map