@relayfx/sdk 0.7.3 → 0.7.4
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/ai.js +1 -1
- package/dist/http-server.js +1 -1
- package/dist/{index-5y7758mg.js → index-8jjqgjhf.js} +567 -196
- package/dist/{index-qa93yf6j.js → index-etc2cnk2.js} +47 -47
- package/dist/{index-pa991hq0.js → index-ex8w3c48.js} +1 -1
- package/dist/{index-syx9q5v3.js → index-nb078xsy.js} +831 -592
- package/dist/index.js +11 -11
- package/dist/mysql.js +4 -4
- package/dist/postgres.js +4 -4
- package/dist/sqlite.js +4 -4
- package/dist/types/relay/client-child-runs.d.ts +11 -0
- package/dist/types/relay/client-public-executions.d.ts +2 -2
- package/dist/types/relay/client-public.d.ts +2 -0
- package/dist/types/relay/operation.d.ts +282 -5
- package/dist/types/runtime/address/address-resolution-service.d.ts +1 -1
- package/dist/types/runtime/agent/agent-loop-events.d.ts +16 -5
- package/dist/types/runtime/agent/agent-loop-service.d.ts +1 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +2 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +22 -2
- package/dist/types/schema/agent-schema.d.ts +8 -8
- package/dist/types/schema/execution-analytics-schema.d.ts +507 -0
- package/dist/types/schema/execution-schema.d.ts +34 -20
- package/dist/types/store-sql/child/child-fan-out-repository.d.ts +2 -0
- package/package.json +4 -4
|
@@ -10,20 +10,21 @@ import { Equal, Schema as Schema2 } from "effect";
|
|
|
10
10
|
import { dual } from "effect/Function";
|
|
11
11
|
import { Schema as Schema5 } from "effect";
|
|
12
12
|
import { JsonSchema, Schema as Schema4, SchemaRepresentation } from "effect";
|
|
13
|
+
import { Schema as Schema9 } from "effect";
|
|
13
14
|
import { Schema as Schema8 } from "effect";
|
|
14
|
-
import { Schema as Schema7 } from "effect";
|
|
15
15
|
import { Schema as Schema6 } from "effect";
|
|
16
|
-
import { Schema as
|
|
17
|
-
import { Schema as Schema11 } from "effect";
|
|
16
|
+
import { Schema as Schema7 } from "effect";
|
|
18
17
|
import { Schema as Schema10 } from "effect";
|
|
19
18
|
import { Schema as Schema12 } from "effect";
|
|
19
|
+
import { Schema as Schema11 } from "effect";
|
|
20
20
|
import { Schema as Schema13 } from "effect";
|
|
21
21
|
import { Schema as Schema14 } from "effect";
|
|
22
22
|
import { Schema as Schema15 } from "effect";
|
|
23
23
|
import { Schema as Schema16 } from "effect";
|
|
24
24
|
import { Schema as Schema17 } from "effect";
|
|
25
|
-
import {
|
|
26
|
-
import { Schema as Schema19 } from "effect";
|
|
25
|
+
import { Schema as Schema18 } from "effect";
|
|
26
|
+
import { Encoding, Schema as Schema19 } from "effect";
|
|
27
|
+
import { Schema as Schema20 } from "effect";
|
|
27
28
|
var __defProp = Object.defineProperty;
|
|
28
29
|
var __returnValue = (v) => v;
|
|
29
30
|
function __exportSetter(name, newValue) {
|
|
@@ -343,6 +344,7 @@ var ModelSelection = Schema5.Struct({
|
|
|
343
344
|
metadata: Schema5.optionalKey(Metadata)
|
|
344
345
|
}).annotate({ identifier: "Relay.Agent.ModelSelection" });
|
|
345
346
|
var PositiveSafeInteger = Schema5.Finite.check(Schema5.makeFilter((value) => Number.isSafeInteger(value) && value > 0 ? undefined : "must be a positive safe integer"));
|
|
347
|
+
var ToolExecutionConcurrency = Schema5.Union([PositiveSafeInteger, Schema5.Literal("unbounded")]);
|
|
346
348
|
var CompactionPolicy = Schema5.Struct({
|
|
347
349
|
context_window: PositiveSafeInteger,
|
|
348
350
|
reserve_tokens: PositiveSafeInteger,
|
|
@@ -449,7 +451,7 @@ var DefinitionSchema = Schema5.Struct({
|
|
|
449
451
|
permission_rules: Schema5.optionalKey(PermissionRuleset),
|
|
450
452
|
turn_policy: Schema5.optionalKey(TurnPolicySnapshot),
|
|
451
453
|
tool_execution: Schema5.optionalKey(Schema5.Struct({
|
|
452
|
-
concurrency:
|
|
454
|
+
concurrency: ToolExecutionConcurrency
|
|
453
455
|
})),
|
|
454
456
|
compaction_policy: Schema5.optionalKey(CompactionPolicy),
|
|
455
457
|
max_tool_turns: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(1))),
|
|
@@ -524,19 +526,43 @@ __export2(exports_child_orchestration_schema, {
|
|
|
524
526
|
var exports_execution_schema = {};
|
|
525
527
|
__export2(exports_execution_schema, {
|
|
526
528
|
steeringMessageId: () => steeringMessageId,
|
|
529
|
+
executionOriginMetadataKey: () => executionOriginMetadataKey,
|
|
527
530
|
childSessionId: () => childSessionId,
|
|
528
531
|
SpawnChildRunInput: () => SpawnChildRunInput,
|
|
532
|
+
ModelUsageReportedEventData: () => ModelUsageReportedEventData,
|
|
533
|
+
ModelUsage: () => ModelUsage,
|
|
534
|
+
ModelRetryScheduledEventData: () => ModelRetryScheduledEventData,
|
|
535
|
+
ModelRetryReason: () => ModelRetryReason,
|
|
536
|
+
ModelFirstOutputKind: () => ModelFirstOutputKind,
|
|
537
|
+
ModelFinishReason: () => ModelFinishReason,
|
|
538
|
+
ModelFailureClassification: () => ModelFailureClassification,
|
|
539
|
+
ModelFailureCategory: () => ModelFailureCategory,
|
|
540
|
+
ModelCallStartedEventData: () => ModelCallStartedEventData,
|
|
541
|
+
ModelCallPurpose: () => ModelCallPurpose,
|
|
542
|
+
ModelCallFailedEventData: () => ModelCallFailedEventData,
|
|
543
|
+
ModelCallCompletedEventData: () => ModelCallCompletedEventData,
|
|
544
|
+
ModelAttemptStartedEventData: () => ModelAttemptStartedEventData,
|
|
545
|
+
ModelAttemptFirstOutputEventData: () => ModelAttemptFirstOutputEventData,
|
|
546
|
+
ModelAttemptFailedEventData: () => ModelAttemptFailedEventData,
|
|
547
|
+
ModelAttemptCompletedEventData: () => ModelAttemptCompletedEventData,
|
|
529
548
|
ExecutionStatus: () => ExecutionStatus,
|
|
549
|
+
ExecutionOriginBuild: () => ExecutionOriginBuild,
|
|
550
|
+
ExecutionOrigin: () => ExecutionOrigin,
|
|
530
551
|
ExecutionEventType: () => ExecutionEventType,
|
|
531
552
|
ExecutionEventSequence: () => ExecutionEventSequence,
|
|
532
553
|
ExecutionEvent: () => ExecutionEvent,
|
|
533
554
|
Execution: () => Execution,
|
|
555
|
+
CompactionTrigger: () => CompactionTrigger,
|
|
534
556
|
CompactionStartedEventData: () => CompactionStartedEventData,
|
|
557
|
+
CompactionKind: () => CompactionKind,
|
|
558
|
+
CompactionFailedEventData: () => CompactionFailedEventData,
|
|
559
|
+
CompactionCompletedEventData: () => CompactionCompletedEventData,
|
|
535
560
|
CompactionCommittedEventData: () => CompactionCommittedEventData,
|
|
536
561
|
ChildRunPreset: () => ChildRunPreset2,
|
|
537
562
|
ChildRunOverride: () => ChildRunOverride,
|
|
538
563
|
ChildRunContext: () => ChildRunContext,
|
|
539
|
-
ChildRunAccepted: () => ChildRunAccepted
|
|
564
|
+
ChildRunAccepted: () => ChildRunAccepted,
|
|
565
|
+
AnalyticalExecutionEvent: () => AnalyticalExecutionEvent
|
|
540
566
|
});
|
|
541
567
|
var exports_content_schema = {};
|
|
542
568
|
__export2(exports_content_schema, {
|
|
@@ -598,7 +624,174 @@ var Part = Schema6.Union([
|
|
|
598
624
|
ToolResultPart
|
|
599
625
|
]).pipe(Schema6.toTaggedUnion("type")).annotate({ identifier: "Relay.Content.Part" });
|
|
600
626
|
var text = (value) => ({ type: "text", text: value });
|
|
601
|
-
var
|
|
627
|
+
var ModelCallPurpose = Schema7.Literals(["conversation", "structured-output", "compaction-summary"]);
|
|
628
|
+
var ModelFailureCategory = Schema7.Literals([
|
|
629
|
+
"authentication",
|
|
630
|
+
"rate-limit",
|
|
631
|
+
"transport",
|
|
632
|
+
"provider-response",
|
|
633
|
+
"stream-decode",
|
|
634
|
+
"context-overflow",
|
|
635
|
+
"invalid-tool-call",
|
|
636
|
+
"token-budget",
|
|
637
|
+
"timeout",
|
|
638
|
+
"cancellation",
|
|
639
|
+
"unknown"
|
|
640
|
+
]);
|
|
641
|
+
var ModelFailureClassification = Schema7.Literals(["transient", "terminal"]);
|
|
642
|
+
var ModelRetryReason = Schema7.Literals(["provider-resilience", "invalid-tool-call-correction"]);
|
|
643
|
+
var ModelFirstOutputKind = Schema7.Literals(["reasoning", "text", "tool-call"]);
|
|
644
|
+
var ModelFinishReason = Schema7.Literals([
|
|
645
|
+
"stop",
|
|
646
|
+
"length",
|
|
647
|
+
"content-filter",
|
|
648
|
+
"tool-calls",
|
|
649
|
+
"error",
|
|
650
|
+
"pause",
|
|
651
|
+
"other",
|
|
652
|
+
"unknown"
|
|
653
|
+
]);
|
|
654
|
+
var CompactionTrigger = Schema7.Literals(["threshold", "overflow"]);
|
|
655
|
+
var CompactionKind = Schema7.Literals(["microcompact", "summarize", "unchanged"]);
|
|
656
|
+
var turn = Schema7.Int.check(Schema7.isGreaterThanOrEqualTo(0));
|
|
657
|
+
var attempt = Schema7.Int.check(Schema7.isGreaterThanOrEqualTo(0));
|
|
658
|
+
var nullableCount = Schema7.NullOr(Schema7.Int.check(Schema7.isGreaterThanOrEqualTo(0)));
|
|
659
|
+
var ModelUsage = Schema7.Struct({
|
|
660
|
+
input_tokens: nullableCount,
|
|
661
|
+
input_tokens_uncached: nullableCount,
|
|
662
|
+
input_tokens_cache_read: nullableCount,
|
|
663
|
+
input_tokens_cache_write: nullableCount,
|
|
664
|
+
output_tokens: nullableCount,
|
|
665
|
+
output_tokens_reasoning: nullableCount,
|
|
666
|
+
output_tokens_text: Schema7.optionalKey(nullableCount)
|
|
667
|
+
}).annotate({ identifier: "Relay.ModelUsage" });
|
|
668
|
+
var delivery = {
|
|
669
|
+
telemetry_session_id: Schema7.optionalKey(NonEmptyString),
|
|
670
|
+
delivery_id: Schema7.optionalKey(NonEmptyString)
|
|
671
|
+
};
|
|
672
|
+
var call = { turn, model_call_id: NonEmptyString, ...delivery };
|
|
673
|
+
var modelAttempt = { ...call, model_attempt_id: NonEmptyString, attempt };
|
|
674
|
+
var ModelCallStartedEventData = Schema7.Struct({
|
|
675
|
+
...call,
|
|
676
|
+
purpose: ModelCallPurpose,
|
|
677
|
+
provider: Schema7.optionalKey(Schema7.String),
|
|
678
|
+
model: Schema7.optionalKey(Schema7.String),
|
|
679
|
+
compaction_id: Schema7.optionalKey(NonEmptyString),
|
|
680
|
+
started_at: TimestampMillis
|
|
681
|
+
});
|
|
682
|
+
var ModelAttemptStartedEventData = Schema7.Struct({ ...modelAttempt, started_at: TimestampMillis });
|
|
683
|
+
var ModelAttemptFirstOutputEventData = Schema7.Struct({
|
|
684
|
+
...modelAttempt,
|
|
685
|
+
kind: ModelFirstOutputKind,
|
|
686
|
+
at: TimestampMillis
|
|
687
|
+
});
|
|
688
|
+
var ModelAttemptCompletedEventData = Schema7.Struct({
|
|
689
|
+
...modelAttempt,
|
|
690
|
+
completed_at: TimestampMillis,
|
|
691
|
+
usage: Schema7.optionalKey(ModelUsage),
|
|
692
|
+
usage_at: Schema7.optionalKey(TimestampMillis),
|
|
693
|
+
finish_reason: Schema7.optionalKey(ModelFinishReason),
|
|
694
|
+
request_id: Schema7.optionalKey(Schema7.String),
|
|
695
|
+
response_model: Schema7.optionalKey(Schema7.String),
|
|
696
|
+
service_tier: Schema7.optionalKey(Schema7.String),
|
|
697
|
+
cost: Schema7.optionalKey(Schema7.Struct({ amount: Schema7.Finite, currency: Schema7.String }))
|
|
698
|
+
});
|
|
699
|
+
var ModelAttemptFailedEventData = Schema7.Struct({
|
|
700
|
+
...modelAttempt,
|
|
701
|
+
failed_at: TimestampMillis,
|
|
702
|
+
category: ModelFailureCategory,
|
|
703
|
+
classification: ModelFailureClassification
|
|
704
|
+
});
|
|
705
|
+
var ModelRetryScheduledEventData = Schema7.Struct({
|
|
706
|
+
...call,
|
|
707
|
+
attempt,
|
|
708
|
+
reason: ModelRetryReason,
|
|
709
|
+
category: ModelFailureCategory,
|
|
710
|
+
delay_millis: Schema7.Finite.check(Schema7.isGreaterThanOrEqualTo(0)),
|
|
711
|
+
at: TimestampMillis
|
|
712
|
+
});
|
|
713
|
+
var ModelCallCompletedEventData = Schema7.Struct({
|
|
714
|
+
...call,
|
|
715
|
+
purpose: ModelCallPurpose,
|
|
716
|
+
attempts: attempt,
|
|
717
|
+
completed_at: TimestampMillis,
|
|
718
|
+
usage: Schema7.optionalKey(ModelUsage),
|
|
719
|
+
finish_reason: Schema7.optionalKey(ModelFinishReason)
|
|
720
|
+
});
|
|
721
|
+
var ModelCallFailedEventData = Schema7.Struct({
|
|
722
|
+
...call,
|
|
723
|
+
purpose: ModelCallPurpose,
|
|
724
|
+
attempts: attempt,
|
|
725
|
+
failed_at: TimestampMillis,
|
|
726
|
+
category: ModelFailureCategory
|
|
727
|
+
});
|
|
728
|
+
var CompactionStartedEventData = Schema7.Struct({
|
|
729
|
+
turn,
|
|
730
|
+
compaction_id: NonEmptyString,
|
|
731
|
+
...delivery,
|
|
732
|
+
trigger: CompactionTrigger,
|
|
733
|
+
started_at: TimestampMillis,
|
|
734
|
+
context_tokens_before: Schema7.optionalKey(Schema7.Finite),
|
|
735
|
+
entries_before: Schema7.optionalKey(Schema7.Finite)
|
|
736
|
+
});
|
|
737
|
+
var CompactionCompletedEventData = Schema7.Struct({
|
|
738
|
+
turn,
|
|
739
|
+
compaction_id: NonEmptyString,
|
|
740
|
+
...delivery,
|
|
741
|
+
kind: CompactionKind,
|
|
742
|
+
completed_at: TimestampMillis,
|
|
743
|
+
summary_model_call_id: Schema7.optionalKey(NonEmptyString)
|
|
744
|
+
});
|
|
745
|
+
var CompactionFailedEventData = Schema7.Struct({
|
|
746
|
+
turn,
|
|
747
|
+
compaction_id: NonEmptyString,
|
|
748
|
+
...delivery,
|
|
749
|
+
failed_at: TimestampMillis
|
|
750
|
+
});
|
|
751
|
+
var CompactionCommittedEventData = Schema7.Struct({
|
|
752
|
+
checkpoint_id: SessionEntryId,
|
|
753
|
+
session_id: SessionId,
|
|
754
|
+
compaction_id: NonEmptyString,
|
|
755
|
+
summary_model_call_id: Schema7.optionalKey(NonEmptyString),
|
|
756
|
+
context_tokens_before: Schema7.optionalKey(Schema7.Finite),
|
|
757
|
+
context_tokens_after: Schema7.optionalKey(Schema7.Finite),
|
|
758
|
+
entries_before: Schema7.optionalKey(Schema7.Finite),
|
|
759
|
+
entries_after: Schema7.optionalKey(Schema7.Finite)
|
|
760
|
+
}).annotate({ identifier: "Relay.CompactionCommittedEventData" });
|
|
761
|
+
var ModelUsageReportedEventData = Schema7.Struct({
|
|
762
|
+
...modelAttempt,
|
|
763
|
+
provider: NonEmptyString,
|
|
764
|
+
model: NonEmptyString,
|
|
765
|
+
model_snapshot: Schema7.optionalKey(NonEmptyString),
|
|
766
|
+
service_tier: Schema7.optionalKey(NonEmptyString),
|
|
767
|
+
finish_reason: Schema7.optionalKey(ModelFinishReason),
|
|
768
|
+
usage_at: TimestampMillis,
|
|
769
|
+
...ModelUsage.fields
|
|
770
|
+
}).annotate({ identifier: "Relay.ModelUsageReportedEventData" });
|
|
771
|
+
var envelope = {
|
|
772
|
+
id: EventId,
|
|
773
|
+
execution_id: ExecutionId,
|
|
774
|
+
sequence: Schema7.Int.check(Schema7.isGreaterThanOrEqualTo(0)),
|
|
775
|
+
cursor: NonEmptyString,
|
|
776
|
+
created_at: TimestampMillis
|
|
777
|
+
};
|
|
778
|
+
var analytical = (type, data) => Schema7.Struct({ ...envelope, type: Schema7.Literal(type), data });
|
|
779
|
+
var AnalyticalExecutionEvent = Schema7.Union([
|
|
780
|
+
analytical("model.call.started", ModelCallStartedEventData),
|
|
781
|
+
analytical("model.attempt.started", ModelAttemptStartedEventData),
|
|
782
|
+
analytical("model.attempt.first_output", ModelAttemptFirstOutputEventData),
|
|
783
|
+
analytical("model.attempt.completed", ModelAttemptCompletedEventData),
|
|
784
|
+
analytical("model.attempt.failed", ModelAttemptFailedEventData),
|
|
785
|
+
analytical("model.retry.scheduled", ModelRetryScheduledEventData),
|
|
786
|
+
analytical("model.call.completed", ModelCallCompletedEventData),
|
|
787
|
+
analytical("model.call.failed", ModelCallFailedEventData),
|
|
788
|
+
analytical("agent.compaction.started", CompactionStartedEventData),
|
|
789
|
+
analytical("agent.compaction.completed", CompactionCompletedEventData),
|
|
790
|
+
analytical("agent.compaction.failed", CompactionFailedEventData),
|
|
791
|
+
analytical("agent.compaction.committed", CompactionCommittedEventData),
|
|
792
|
+
analytical("model.usage.reported", ModelUsageReportedEventData)
|
|
793
|
+
]).annotate({ identifier: "Relay.AnalyticalExecutionEvent" });
|
|
794
|
+
var ExecutionStatus = Schema8.Literals([
|
|
602
795
|
"queued",
|
|
603
796
|
"running",
|
|
604
797
|
"waiting",
|
|
@@ -606,69 +799,83 @@ var ExecutionStatus = Schema7.Literals([
|
|
|
606
799
|
"failed",
|
|
607
800
|
"cancelled"
|
|
608
801
|
]).annotate({ identifier: "Relay.ExecutionStatus" });
|
|
609
|
-
var
|
|
802
|
+
var boundedIdentity = (maxLength) => NonEmptyString.check(Schema8.isMaxLength(maxLength));
|
|
803
|
+
var ExecutionOriginBuild = Schema8.Struct({
|
|
804
|
+
name: boundedIdentity(128),
|
|
805
|
+
version: Schema8.optionalKey(boundedIdentity(128)),
|
|
806
|
+
commit: Schema8.optionalKey(boundedIdentity(256))
|
|
807
|
+
}).annotate({ identifier: "Relay.ExecutionOriginBuild" });
|
|
808
|
+
var ExecutionOrigin = Schema8.Struct({
|
|
809
|
+
owner_kind: Schema8.Literals(["service", "user", "workflow", "system"]),
|
|
810
|
+
owner: boundedIdentity(256),
|
|
811
|
+
purpose: boundedIdentity(256),
|
|
812
|
+
build: Schema8.optionalKey(ExecutionOriginBuild)
|
|
813
|
+
}).annotate({ identifier: "Relay.ExecutionOrigin" });
|
|
814
|
+
var executionOriginMetadataKey = "relay_origin";
|
|
815
|
+
var Execution = Schema8.Struct({
|
|
610
816
|
id: ExecutionId,
|
|
611
817
|
root_address_id: AddressId,
|
|
612
|
-
session_id:
|
|
818
|
+
session_id: Schema8.optionalKey(SessionId),
|
|
613
819
|
status: ExecutionStatus,
|
|
614
|
-
agent_id:
|
|
615
|
-
agent_revision:
|
|
616
|
-
agent_snapshot:
|
|
617
|
-
agent_tool_input_schema_digests:
|
|
618
|
-
|
|
820
|
+
agent_id: Schema8.optionalKey(AgentId),
|
|
821
|
+
agent_revision: Schema8.optionalKey(DefinitionRevision),
|
|
822
|
+
agent_snapshot: Schema8.optionalKey(Definition2),
|
|
823
|
+
agent_tool_input_schema_digests: Schema8.optionalKey(ToolInputSchemaDigests),
|
|
824
|
+
origin: Schema8.optionalKey(ExecutionOrigin),
|
|
825
|
+
metadata: Schema8.optionalKey(Metadata),
|
|
619
826
|
created_at: TimestampMillis,
|
|
620
827
|
updated_at: TimestampMillis
|
|
621
828
|
}).annotate({ identifier: "Relay.Execution" });
|
|
622
|
-
var ExecutionEventSequence =
|
|
829
|
+
var ExecutionEventSequence = Schema8.Int.check(Schema8.isGreaterThanOrEqualTo(0)).annotate({
|
|
623
830
|
identifier: "Relay.ExecutionEventSequence"
|
|
624
831
|
});
|
|
625
|
-
var ChildRunContext =
|
|
626
|
-
instructions:
|
|
627
|
-
model:
|
|
628
|
-
compaction_policy:
|
|
629
|
-
tool_names:
|
|
630
|
-
permissions:
|
|
631
|
-
output_schema_ref:
|
|
632
|
-
metadata:
|
|
832
|
+
var ChildRunContext = Schema8.Struct({
|
|
833
|
+
instructions: Schema8.optionalKey(Schema8.String),
|
|
834
|
+
model: Schema8.optionalKey(ModelSelection),
|
|
835
|
+
compaction_policy: Schema8.optionalKey(CompactionPolicy),
|
|
836
|
+
tool_names: Schema8.Array(Schema8.String),
|
|
837
|
+
permissions: Schema8.Array(Schema8.String),
|
|
838
|
+
output_schema_ref: Schema8.optionalKey(Schema8.String),
|
|
839
|
+
metadata: Schema8.optionalKey(Metadata)
|
|
633
840
|
}).annotate({ identifier: "Relay.ChildRunContext" });
|
|
634
|
-
var ChildRunOverride =
|
|
635
|
-
instructions:
|
|
636
|
-
model:
|
|
637
|
-
compaction_policy:
|
|
638
|
-
tool_names:
|
|
639
|
-
permissions:
|
|
640
|
-
workspace_policy:
|
|
641
|
-
output_schema_ref:
|
|
642
|
-
metadata:
|
|
841
|
+
var ChildRunOverride = Schema8.Struct({
|
|
842
|
+
instructions: Schema8.optionalKey(Schema8.String),
|
|
843
|
+
model: Schema8.optionalKey(ModelSelection),
|
|
844
|
+
compaction_policy: Schema8.optionalKey(CompactionPolicy),
|
|
845
|
+
tool_names: Schema8.optionalKey(Schema8.Array(Schema8.String)),
|
|
846
|
+
permissions: Schema8.optionalKey(Schema8.Array(Schema8.String)),
|
|
847
|
+
workspace_policy: Schema8.optionalKey(ChildRunWorkspacePolicy),
|
|
848
|
+
output_schema_ref: Schema8.optionalKey(Schema8.String),
|
|
849
|
+
metadata: Schema8.optionalKey(Metadata)
|
|
643
850
|
}).annotate({ identifier: "Relay.ChildRunOverride" });
|
|
644
851
|
var ChildRunPreset2 = ChildRunOverride.annotate({ identifier: "Relay.ChildRunPreset" });
|
|
645
|
-
var SpawnChildRunInput =
|
|
852
|
+
var SpawnChildRunInput = Schema8.Struct({
|
|
646
853
|
execution_id: ExecutionId,
|
|
647
|
-
child_execution_id:
|
|
854
|
+
child_execution_id: Schema8.optionalKey(ChildExecutionId),
|
|
648
855
|
address_id: AddressId,
|
|
649
856
|
parent_context: ChildRunContext,
|
|
650
|
-
presets:
|
|
651
|
-
preset_name:
|
|
652
|
-
instructions:
|
|
653
|
-
model:
|
|
654
|
-
compaction_policy:
|
|
655
|
-
tool_names:
|
|
656
|
-
permissions:
|
|
657
|
-
workspace_policy:
|
|
658
|
-
output_schema_ref:
|
|
659
|
-
metadata:
|
|
660
|
-
input:
|
|
661
|
-
wait:
|
|
662
|
-
event_sequence:
|
|
663
|
-
created_at:
|
|
857
|
+
presets: Schema8.optionalKey(Schema8.Record(Schema8.String, ChildRunPreset2)),
|
|
858
|
+
preset_name: Schema8.optionalKey(NonEmptyString),
|
|
859
|
+
instructions: Schema8.optionalKey(Schema8.String),
|
|
860
|
+
model: Schema8.optionalKey(ModelSelection),
|
|
861
|
+
compaction_policy: Schema8.optionalKey(CompactionPolicy),
|
|
862
|
+
tool_names: Schema8.optionalKey(Schema8.Array(Schema8.String)),
|
|
863
|
+
permissions: Schema8.optionalKey(Schema8.Array(Schema8.String)),
|
|
864
|
+
workspace_policy: Schema8.optionalKey(ChildRunWorkspacePolicy),
|
|
865
|
+
output_schema_ref: Schema8.optionalKey(Schema8.String),
|
|
866
|
+
metadata: Schema8.optionalKey(Metadata),
|
|
867
|
+
input: Schema8.optionalKey(Schema8.Array(Part)),
|
|
868
|
+
wait: Schema8.optionalKey(Schema8.Boolean),
|
|
869
|
+
event_sequence: Schema8.optionalKey(ExecutionEventSequence),
|
|
870
|
+
created_at: Schema8.optionalKey(TimestampMillis)
|
|
664
871
|
}).annotate({ identifier: "Relay.SpawnChildRunInput" });
|
|
665
|
-
var ChildRunAccepted =
|
|
872
|
+
var ChildRunAccepted = Schema8.Struct({
|
|
666
873
|
child_execution_id: ChildExecutionId,
|
|
667
874
|
execution_id: ExecutionId
|
|
668
875
|
}).annotate({ identifier: "Relay.ChildRunAccepted" });
|
|
669
876
|
var childSessionId = (childExecutionId) => SessionId.make(`session:child:${childExecutionId}`);
|
|
670
877
|
var steeringMessageId = (input) => SteeringMessageId.make(`steering:${input.execution_id}:${input.kind}:${input.sequence}`);
|
|
671
|
-
var ExecutionEventType =
|
|
878
|
+
var ExecutionEventType = Schema8.Literals([
|
|
672
879
|
"execution.accepted",
|
|
673
880
|
"execution.started",
|
|
674
881
|
"execution.completed",
|
|
@@ -680,7 +887,17 @@ var ExecutionEventType = Schema7.Literals([
|
|
|
680
887
|
"model.toolcall.delta",
|
|
681
888
|
"model.output.completed",
|
|
682
889
|
"model.usage.reported",
|
|
890
|
+
"model.call.started",
|
|
891
|
+
"model.attempt.started",
|
|
892
|
+
"model.attempt.first_output",
|
|
893
|
+
"model.attempt.completed",
|
|
894
|
+
"model.attempt.failed",
|
|
895
|
+
"model.retry.scheduled",
|
|
896
|
+
"model.call.completed",
|
|
897
|
+
"model.call.failed",
|
|
683
898
|
"agent.compaction.started",
|
|
899
|
+
"agent.compaction.completed",
|
|
900
|
+
"agent.compaction.failed",
|
|
684
901
|
"agent.compaction.committed",
|
|
685
902
|
"budget.exceeded",
|
|
686
903
|
"tool.call.requested",
|
|
@@ -718,69 +935,60 @@ var ExecutionEventType = Schema7.Literals([
|
|
|
718
935
|
"workspace.lease.released",
|
|
719
936
|
"workspace.lease.failed"
|
|
720
937
|
]).annotate({ identifier: "Relay.ExecutionEventType" });
|
|
721
|
-
var
|
|
722
|
-
turn: Schema7.Finite,
|
|
723
|
-
overflow: Schema7.Boolean
|
|
724
|
-
}).annotate({ identifier: "Relay.CompactionStartedEventData" });
|
|
725
|
-
var CompactionCommittedEventData = Schema7.Struct({
|
|
726
|
-
checkpoint_id: SessionEntryId,
|
|
727
|
-
session_id: SessionId,
|
|
728
|
-
summary_present: Schema7.Boolean
|
|
729
|
-
}).annotate({ identifier: "Relay.CompactionCommittedEventData" });
|
|
730
|
-
var ExecutionEvent = Schema7.Struct({
|
|
938
|
+
var ExecutionEvent = Schema8.Struct({
|
|
731
939
|
id: EventId,
|
|
732
940
|
execution_id: ExecutionId,
|
|
733
|
-
child_execution_id:
|
|
941
|
+
child_execution_id: Schema8.optionalKey(ChildExecutionId),
|
|
734
942
|
type: ExecutionEventType,
|
|
735
943
|
sequence: ExecutionEventSequence,
|
|
736
944
|
cursor: NonEmptyString,
|
|
737
|
-
content:
|
|
738
|
-
data:
|
|
945
|
+
content: Schema8.optionalKey(Schema8.Array(Part)),
|
|
946
|
+
data: Schema8.optionalKey(Metadata),
|
|
739
947
|
created_at: TimestampMillis
|
|
740
948
|
}).annotate({ identifier: "Relay.ExecutionEvent" });
|
|
741
|
-
var JoinPolicy =
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
949
|
+
var JoinPolicy = Schema9.Union([
|
|
950
|
+
Schema9.TaggedStruct("all", {}),
|
|
951
|
+
Schema9.TaggedStruct("first-success", {}),
|
|
952
|
+
Schema9.TaggedStruct("quorum", { count: Schema9.Int.check(Schema9.isGreaterThan(0)) }),
|
|
953
|
+
Schema9.TaggedStruct("best-effort", {})
|
|
746
954
|
]).annotate({ identifier: "Relay.ChildOrchestration.JoinPolicy" });
|
|
747
|
-
var FanOutChild =
|
|
955
|
+
var FanOutChild = Schema9.Struct({
|
|
748
956
|
child_execution_id: ChildExecutionId,
|
|
749
957
|
address_id: AddressId,
|
|
750
|
-
override:
|
|
751
|
-
input:
|
|
752
|
-
metadata:
|
|
958
|
+
override: Schema9.optionalKey(ChildRunOverride),
|
|
959
|
+
input: Schema9.optionalKey(Schema9.Array(Part)),
|
|
960
|
+
metadata: Schema9.optionalKey(Metadata)
|
|
753
961
|
}).annotate({ identifier: "Relay.ChildOrchestration.FanOutChild" });
|
|
754
|
-
var FanOutDefinition =
|
|
962
|
+
var FanOutDefinition = Schema9.Struct({
|
|
755
963
|
fan_out_id: ChildFanOutId,
|
|
756
964
|
parent_execution_id: ExecutionId,
|
|
757
|
-
children:
|
|
758
|
-
max_concurrency:
|
|
965
|
+
children: Schema9.Array(FanOutChild).check(Schema9.isMinLength(1)),
|
|
966
|
+
max_concurrency: Schema9.Int.check(Schema9.isGreaterThan(0)),
|
|
759
967
|
join: JoinPolicy,
|
|
760
968
|
created_at: TimestampMillis,
|
|
761
|
-
metadata:
|
|
969
|
+
metadata: Schema9.optionalKey(Metadata)
|
|
762
970
|
}).annotate({ identifier: "Relay.ChildOrchestration.FanOutDefinition" });
|
|
763
|
-
var MemberState =
|
|
971
|
+
var MemberState = Schema9.Literals(["queued", "running", "completed", "failed", "cancelled"]).annotate({
|
|
764
972
|
identifier: "Relay.ChildOrchestration.MemberState"
|
|
765
973
|
});
|
|
766
|
-
var AggregateState =
|
|
974
|
+
var AggregateState = Schema9.Literals(["joining", "satisfied", "failed", "cancelled"]).annotate({
|
|
767
975
|
identifier: "Relay.ChildOrchestration.AggregateState"
|
|
768
976
|
});
|
|
769
|
-
var FanOutMember =
|
|
977
|
+
var FanOutMember = Schema9.Struct({
|
|
770
978
|
child_execution_id: ChildExecutionId,
|
|
771
|
-
ordinal:
|
|
979
|
+
ordinal: Schema9.Int.check(Schema9.isGreaterThanOrEqualTo(0)),
|
|
772
980
|
state: MemberState,
|
|
773
|
-
output:
|
|
774
|
-
error:
|
|
775
|
-
completed_at:
|
|
981
|
+
output: Schema9.optionalKey(Schema9.Array(Part)),
|
|
982
|
+
error: Schema9.optionalKey(Schema9.String),
|
|
983
|
+
completed_at: Schema9.optionalKey(TimestampMillis)
|
|
776
984
|
}).annotate({ identifier: "Relay.ChildOrchestration.FanOutMember" });
|
|
777
|
-
var FanOutState =
|
|
985
|
+
var FanOutState = Schema9.Struct({
|
|
778
986
|
...FanOutDefinition.fields,
|
|
779
987
|
state: AggregateState,
|
|
780
|
-
members:
|
|
781
|
-
satisfied_at:
|
|
782
|
-
failed_at:
|
|
783
|
-
cancelled_at:
|
|
988
|
+
members: Schema9.Array(FanOutMember),
|
|
989
|
+
satisfied_at: Schema9.optionalKey(TimestampMillis),
|
|
990
|
+
failed_at: Schema9.optionalKey(TimestampMillis),
|
|
991
|
+
cancelled_at: Schema9.optionalKey(TimestampMillis)
|
|
784
992
|
}).annotate({ identifier: "Relay.ChildOrchestration.FanOutState" });
|
|
785
993
|
var exports_envelope_schema = {};
|
|
786
994
|
__export2(exports_envelope_schema, {
|
|
@@ -791,45 +999,45 @@ __export2(exports_envelope_schema, {
|
|
|
791
999
|
EnvelopeAccepted: () => EnvelopeAccepted,
|
|
792
1000
|
Envelope: () => Envelope
|
|
793
1001
|
});
|
|
794
|
-
var WaitMode =
|
|
795
|
-
var Wait =
|
|
1002
|
+
var WaitMode = Schema10.Literals(["reply", "event", "until", "child"]).annotate({ identifier: "Relay.WaitMode" });
|
|
1003
|
+
var Wait = Schema10.Struct({
|
|
796
1004
|
mode: WaitMode,
|
|
797
|
-
timeout:
|
|
798
|
-
correlation_key:
|
|
799
|
-
metadata:
|
|
1005
|
+
timeout: Schema10.optionalKey(Schema10.String),
|
|
1006
|
+
correlation_key: Schema10.optionalKey(Schema10.String),
|
|
1007
|
+
metadata: Schema10.optionalKey(Metadata)
|
|
800
1008
|
}).annotate({ identifier: "Relay.Wait" });
|
|
801
|
-
var Envelope =
|
|
1009
|
+
var Envelope = Schema10.Struct({
|
|
802
1010
|
id: EnvelopeId,
|
|
803
1011
|
execution_id: ExecutionId,
|
|
804
1012
|
from: AddressId,
|
|
805
1013
|
to: AddressId,
|
|
806
|
-
content:
|
|
807
|
-
wait:
|
|
808
|
-
correlation_key:
|
|
809
|
-
metadata:
|
|
1014
|
+
content: Schema10.Array(Part),
|
|
1015
|
+
wait: Schema10.optionalKey(Wait),
|
|
1016
|
+
correlation_key: Schema10.optionalKey(Schema10.String),
|
|
1017
|
+
metadata: Schema10.optionalKey(Metadata),
|
|
810
1018
|
created_at: TimestampMillis
|
|
811
1019
|
}).annotate({ identifier: "Relay.Envelope" });
|
|
812
|
-
var SendInput =
|
|
1020
|
+
var SendInput = Schema10.Struct({
|
|
813
1021
|
from: AddressId,
|
|
814
1022
|
to: AddressId,
|
|
815
|
-
content:
|
|
816
|
-
idempotency_key:
|
|
817
|
-
wait:
|
|
818
|
-
correlation_key:
|
|
819
|
-
metadata:
|
|
1023
|
+
content: Schema10.Array(Part),
|
|
1024
|
+
idempotency_key: Schema10.optionalKey(Schema10.String),
|
|
1025
|
+
wait: Schema10.optionalKey(Wait),
|
|
1026
|
+
correlation_key: Schema10.optionalKey(Schema10.String),
|
|
1027
|
+
metadata: Schema10.optionalKey(Metadata)
|
|
820
1028
|
}).annotate({ identifier: "Relay.SendInput" });
|
|
821
|
-
var EnvelopeAccepted =
|
|
1029
|
+
var EnvelopeAccepted = Schema10.Struct({
|
|
822
1030
|
envelope_id: EnvelopeId,
|
|
823
1031
|
execution_id: ExecutionId,
|
|
824
|
-
wait_id:
|
|
1032
|
+
wait_id: Schema10.optionalKey(WaitId)
|
|
825
1033
|
}).annotate({ identifier: "Relay.EnvelopeAccepted" });
|
|
826
|
-
var EnvelopeReady =
|
|
1034
|
+
var EnvelopeReady = Schema10.Struct({
|
|
827
1035
|
id: EnvelopeReadyId,
|
|
828
1036
|
envelope_id: EnvelopeId,
|
|
829
|
-
route_key:
|
|
1037
|
+
route_key: Schema10.String,
|
|
830
1038
|
available_at: TimestampMillis,
|
|
831
|
-
attempt:
|
|
832
|
-
metadata:
|
|
1039
|
+
attempt: Schema10.Int,
|
|
1040
|
+
metadata: Schema10.optionalKey(Metadata)
|
|
833
1041
|
}).annotate({ identifier: "Relay.EnvelopeReady" });
|
|
834
1042
|
var exports_resident_schema = {};
|
|
835
1043
|
__export2(exports_resident_schema, {
|
|
@@ -843,47 +1051,47 @@ __export2(exports_inbox_schema, {
|
|
|
843
1051
|
Message: () => Message,
|
|
844
1052
|
InboxPolicy: () => InboxPolicy
|
|
845
1053
|
});
|
|
846
|
-
var MessageSequence =
|
|
1054
|
+
var MessageSequence = Schema11.Int.check(Schema11.isGreaterThanOrEqualTo(0)).annotate({
|
|
847
1055
|
identifier: "Relay.Inbox.MessageSequence"
|
|
848
1056
|
});
|
|
849
|
-
var Message =
|
|
1057
|
+
var Message = Schema11.Struct({
|
|
850
1058
|
execution_id: ExecutionId,
|
|
851
1059
|
sequence: MessageSequence,
|
|
852
1060
|
from: AddressId,
|
|
853
|
-
envelope_id:
|
|
854
|
-
content:
|
|
855
|
-
reply_wait_id:
|
|
856
|
-
correlation_key:
|
|
857
|
-
idempotency_key:
|
|
858
|
-
drain_id:
|
|
859
|
-
consumed_at:
|
|
860
|
-
metadata:
|
|
1061
|
+
envelope_id: Schema11.optionalKey(EnvelopeId),
|
|
1062
|
+
content: Schema11.Array(Part),
|
|
1063
|
+
reply_wait_id: Schema11.optionalKey(WaitId),
|
|
1064
|
+
correlation_key: Schema11.optionalKey(Schema11.String),
|
|
1065
|
+
idempotency_key: Schema11.optionalKey(Schema11.String),
|
|
1066
|
+
drain_id: Schema11.optionalKey(Schema11.String),
|
|
1067
|
+
consumed_at: Schema11.optionalKey(TimestampMillis),
|
|
1068
|
+
metadata: Schema11.optionalKey(Metadata),
|
|
861
1069
|
created_at: TimestampMillis
|
|
862
1070
|
}).annotate({ identifier: "Relay.Inbox.Message" });
|
|
863
|
-
var InboxPolicy =
|
|
864
|
-
drain:
|
|
865
|
-
max_batch:
|
|
1071
|
+
var InboxPolicy = Schema11.Struct({
|
|
1072
|
+
drain: Schema11.Literals(["all", "one"]),
|
|
1073
|
+
max_batch: Schema11.optionalKey(Schema11.Int.check(Schema11.isGreaterThan(0)))
|
|
866
1074
|
}).annotate({ identifier: "Relay.Inbox.InboxPolicy" });
|
|
867
|
-
var KindDefinition =
|
|
1075
|
+
var KindDefinition = Schema12.Struct({
|
|
868
1076
|
kind: ResidentKindName,
|
|
869
1077
|
agent_id: AgentId,
|
|
870
|
-
inbox:
|
|
871
|
-
state_enabled:
|
|
872
|
-
continue_as_new_after_turns:
|
|
873
|
-
metadata:
|
|
1078
|
+
inbox: Schema12.optionalKey(InboxPolicy),
|
|
1079
|
+
state_enabled: Schema12.optionalKey(Schema12.Boolean),
|
|
1080
|
+
continue_as_new_after_turns: Schema12.optionalKey(Schema12.Int.check(Schema12.isGreaterThan(0))),
|
|
1081
|
+
metadata: Schema12.optionalKey(Metadata)
|
|
874
1082
|
}).annotate({ identifier: "Relay.Resident.KindDefinition" });
|
|
875
|
-
var InstanceStatus =
|
|
1083
|
+
var InstanceStatus = Schema12.Literals(["active", "destroyed"]).annotate({
|
|
876
1084
|
identifier: "Relay.Resident.InstanceStatus"
|
|
877
1085
|
});
|
|
878
|
-
var Instance =
|
|
1086
|
+
var Instance = Schema12.Struct({
|
|
879
1087
|
kind: ResidentKindName,
|
|
880
1088
|
key: ResidentKey,
|
|
881
1089
|
address_id: AddressId,
|
|
882
1090
|
execution_id: ExecutionId,
|
|
883
|
-
generation:
|
|
1091
|
+
generation: Schema12.Int.check(Schema12.isGreaterThanOrEqualTo(0)),
|
|
884
1092
|
status: InstanceStatus,
|
|
885
1093
|
created_at: TimestampMillis,
|
|
886
|
-
destroyed_at:
|
|
1094
|
+
destroyed_at: Schema12.optionalKey(TimestampMillis)
|
|
887
1095
|
}).annotate({ identifier: "Relay.Resident.Instance" });
|
|
888
1096
|
var exports_pagination_schema = {};
|
|
889
1097
|
__export2(exports_pagination_schema, {
|
|
@@ -892,11 +1100,11 @@ __export2(exports_pagination_schema, {
|
|
|
892
1100
|
ExecutionCursorCodec: () => ExecutionCursorCodec,
|
|
893
1101
|
ExecutionCursor: () => ExecutionCursor
|
|
894
1102
|
});
|
|
895
|
-
var codec = (id2, identifier) =>
|
|
1103
|
+
var codec = (id2, identifier) => Schema13.StringFromBase64Url.pipe(Schema13.decodeTo(Schema13.fromJsonString(Schema13.Struct({
|
|
896
1104
|
id: id2,
|
|
897
1105
|
at: TimestampMillis
|
|
898
1106
|
})))).annotate({ identifier });
|
|
899
|
-
var opaque = (schema, identifier) =>
|
|
1107
|
+
var opaque = (schema, identifier) => Schema13.String.check(Schema13.makeFilter((value) => Schema13.decodeUnknownOption(schema)(value)._tag === "Some" ? undefined : "invalid pagination cursor")).annotate({ identifier });
|
|
900
1108
|
var ExecutionCursorCodec = codec(ExecutionId, "Relay.Pagination.ExecutionCursorCodec");
|
|
901
1109
|
var ExecutionCursor = opaque(ExecutionCursorCodec, "Relay.Pagination.ExecutionCursor");
|
|
902
1110
|
var SessionCursorCodec = codec(SessionId, "Relay.Pagination.SessionCursorCodec");
|
|
@@ -907,18 +1115,18 @@ __export2(exports_presence_schema, {
|
|
|
907
1115
|
Scope: () => Scope,
|
|
908
1116
|
Entry: () => Entry
|
|
909
1117
|
});
|
|
910
|
-
var Scope =
|
|
911
|
-
kind:
|
|
1118
|
+
var Scope = Schema14.Struct({
|
|
1119
|
+
kind: Schema14.Literals(["execution", "session"]),
|
|
912
1120
|
id: NonEmptyString
|
|
913
1121
|
}).annotate({ identifier: "Relay.Presence.Scope" });
|
|
914
|
-
var Entry =
|
|
1122
|
+
var Entry = Schema14.Struct({
|
|
915
1123
|
id: NonEmptyString,
|
|
916
1124
|
metadata: Metadata,
|
|
917
1125
|
connected_at: TimestampMillis
|
|
918
1126
|
}).annotate({ identifier: "Relay.Presence.Entry" });
|
|
919
|
-
var View =
|
|
1127
|
+
var View = Schema14.Struct({
|
|
920
1128
|
scope: Scope,
|
|
921
|
-
entries:
|
|
1129
|
+
entries: Schema14.Array(Entry),
|
|
922
1130
|
observed_at: TimestampMillis
|
|
923
1131
|
}).annotate({ identifier: "Relay.Presence.View" });
|
|
924
1132
|
var exports_schedule_schema = {};
|
|
@@ -928,26 +1136,26 @@ __export2(exports_schedule_schema, {
|
|
|
928
1136
|
ScheduleRecord: () => ScheduleRecord,
|
|
929
1137
|
ScheduleKind: () => ScheduleKind
|
|
930
1138
|
});
|
|
931
|
-
var ScheduleKind =
|
|
932
|
-
var ScheduleTargetKind =
|
|
1139
|
+
var ScheduleKind = Schema15.Literals(["once", "cron"]).annotate({ identifier: "Relay.ScheduleKind" });
|
|
1140
|
+
var ScheduleTargetKind = Schema15.Literals(["start-execution", "wake-wait", "timeout-wait"]).annotate({
|
|
933
1141
|
identifier: "Relay.ScheduleTargetKind"
|
|
934
1142
|
});
|
|
935
|
-
var ScheduleState =
|
|
1143
|
+
var ScheduleState = Schema15.Literals(["active", "claimed", "completed", "cancelled", "failed"]).annotate({
|
|
936
1144
|
identifier: "Relay.ScheduleState"
|
|
937
1145
|
});
|
|
938
|
-
var ScheduleRecord =
|
|
1146
|
+
var ScheduleRecord = Schema15.Struct({
|
|
939
1147
|
id: ScheduleId,
|
|
940
1148
|
kind: ScheduleKind,
|
|
941
1149
|
target_kind: ScheduleTargetKind,
|
|
942
|
-
address_id:
|
|
943
|
-
wait_id:
|
|
944
|
-
cron_expr:
|
|
945
|
-
input:
|
|
1150
|
+
address_id: Schema15.optionalKey(AddressId),
|
|
1151
|
+
wait_id: Schema15.optionalKey(WaitId),
|
|
1152
|
+
cron_expr: Schema15.optionalKey(NonEmptyString),
|
|
1153
|
+
input: Schema15.optionalKey(Schema15.Array(Part)),
|
|
946
1154
|
state: ScheduleState,
|
|
947
1155
|
next_run_at: TimestampMillis,
|
|
948
|
-
attempt:
|
|
949
|
-
last_error:
|
|
950
|
-
metadata:
|
|
1156
|
+
attempt: Schema15.Int,
|
|
1157
|
+
last_error: Schema15.optionalKey(Schema15.String),
|
|
1158
|
+
metadata: Schema15.optionalKey(Metadata),
|
|
951
1159
|
created_at: TimestampMillis,
|
|
952
1160
|
updated_at: TimestampMillis
|
|
953
1161
|
}).annotate({ identifier: "Relay.ScheduleRecord" });
|
|
@@ -965,62 +1173,62 @@ __export2(exports_skill_schema, {
|
|
|
965
1173
|
DefinitionList: () => DefinitionList2,
|
|
966
1174
|
Definition: () => Definition3
|
|
967
1175
|
});
|
|
968
|
-
var DefinitionRevision2 =
|
|
1176
|
+
var DefinitionRevision2 = Schema16.Int.check(Schema16.isGreaterThanOrEqualTo(1)).annotate({
|
|
969
1177
|
identifier: "Relay.Skill.DefinitionRevision"
|
|
970
1178
|
});
|
|
971
|
-
var Frontmatter =
|
|
1179
|
+
var Frontmatter = Schema16.Struct({
|
|
972
1180
|
name: NonEmptyString,
|
|
973
|
-
description:
|
|
974
|
-
when_to_use:
|
|
975
|
-
allowed_tools:
|
|
976
|
-
disable_model_invocation:
|
|
977
|
-
user_invocable:
|
|
978
|
-
context_fork:
|
|
979
|
-
agent:
|
|
980
|
-
model:
|
|
981
|
-
paths:
|
|
982
|
-
metadata:
|
|
1181
|
+
description: Schema16.String,
|
|
1182
|
+
when_to_use: Schema16.optionalKey(Schema16.String),
|
|
1183
|
+
allowed_tools: Schema16.optionalKey(Schema16.Array(Schema16.String)),
|
|
1184
|
+
disable_model_invocation: Schema16.optionalKey(Schema16.Boolean),
|
|
1185
|
+
user_invocable: Schema16.optionalKey(Schema16.Boolean),
|
|
1186
|
+
context_fork: Schema16.optionalKey(Schema16.Boolean),
|
|
1187
|
+
agent: Schema16.optionalKey(Schema16.String),
|
|
1188
|
+
model: Schema16.optionalKey(Schema16.String),
|
|
1189
|
+
paths: Schema16.optionalKey(Schema16.Array(Schema16.String)),
|
|
1190
|
+
metadata: Schema16.optionalKey(Metadata)
|
|
983
1191
|
}).annotate({ identifier: "Relay.Skill.Frontmatter" });
|
|
984
|
-
var Definition3 =
|
|
1192
|
+
var Definition3 = Schema16.Struct({
|
|
985
1193
|
frontmatter: Frontmatter,
|
|
986
|
-
body:
|
|
987
|
-
metadata:
|
|
1194
|
+
body: Schema16.String,
|
|
1195
|
+
metadata: Schema16.optionalKey(Metadata)
|
|
988
1196
|
}).annotate({ identifier: "Relay.Skill.Definition" });
|
|
989
|
-
var DefinitionRecord2 =
|
|
1197
|
+
var DefinitionRecord2 = Schema16.Struct({
|
|
990
1198
|
id: SkillDefinitionId,
|
|
991
1199
|
current_revision: DefinitionRevision2,
|
|
992
1200
|
definition: Definition3,
|
|
993
1201
|
created_at: TimestampMillis,
|
|
994
1202
|
updated_at: TimestampMillis
|
|
995
1203
|
}).annotate({ identifier: "Relay.Skill.DefinitionRecord" });
|
|
996
|
-
var DefinitionRevisionRecord2 =
|
|
1204
|
+
var DefinitionRevisionRecord2 = Schema16.Struct({
|
|
997
1205
|
id: SkillDefinitionId,
|
|
998
1206
|
revision: DefinitionRevision2,
|
|
999
1207
|
definition: Definition3,
|
|
1000
1208
|
created_at: TimestampMillis
|
|
1001
1209
|
}).annotate({ identifier: "Relay.Skill.DefinitionRevisionRecord" });
|
|
1002
|
-
var ExecutionPinRecord =
|
|
1210
|
+
var ExecutionPinRecord = Schema16.Struct({
|
|
1003
1211
|
execution_id: ExecutionId,
|
|
1004
1212
|
skill_definition_id: SkillDefinitionId,
|
|
1005
1213
|
skill_definition_revision: DefinitionRevision2,
|
|
1006
1214
|
skill_definition_snapshot: Definition3,
|
|
1007
1215
|
created_at: TimestampMillis
|
|
1008
1216
|
}).annotate({ identifier: "Relay.Skill.ExecutionPinRecord" });
|
|
1009
|
-
var RegisterDefinitionPayload2 =
|
|
1217
|
+
var RegisterDefinitionPayload2 = Schema16.Struct({
|
|
1010
1218
|
id: SkillDefinitionId,
|
|
1011
1219
|
definition: Definition3
|
|
1012
1220
|
}).annotate({ identifier: "Relay.Skill.RegisterDefinitionPayload" });
|
|
1013
|
-
var DefinitionRegistered2 =
|
|
1221
|
+
var DefinitionRegistered2 = Schema16.Struct({
|
|
1014
1222
|
record: DefinitionRecord2
|
|
1015
1223
|
}).annotate({ identifier: "Relay.Skill.DefinitionRegistered" });
|
|
1016
|
-
var DefinitionList2 =
|
|
1017
|
-
records:
|
|
1224
|
+
var DefinitionList2 = Schema16.Struct({
|
|
1225
|
+
records: Schema16.Array(DefinitionRecord2)
|
|
1018
1226
|
}).annotate({ identifier: "Relay.Skill.DefinitionList" });
|
|
1019
|
-
var DefinitionRevisionList2 =
|
|
1020
|
-
records:
|
|
1227
|
+
var DefinitionRevisionList2 = Schema16.Struct({
|
|
1228
|
+
records: Schema16.Array(DefinitionRevisionRecord2)
|
|
1021
1229
|
}).annotate({ identifier: "Relay.Skill.DefinitionRevisionList" });
|
|
1022
|
-
var ExecutionPinList =
|
|
1023
|
-
records:
|
|
1230
|
+
var ExecutionPinList = Schema16.Struct({
|
|
1231
|
+
records: Schema16.Array(ExecutionPinRecord)
|
|
1024
1232
|
}).annotate({ identifier: "Relay.Skill.ExecutionPinList" });
|
|
1025
1233
|
var exports_state_schema = {};
|
|
1026
1234
|
__export2(exports_state_schema, {
|
|
@@ -1031,16 +1239,16 @@ __export2(exports_state_schema, {
|
|
|
1031
1239
|
StateIdempotencyKey: () => StateIdempotencyKey,
|
|
1032
1240
|
StateDeletedEventData: () => StateDeletedEventData
|
|
1033
1241
|
});
|
|
1034
|
-
var StateKey = NonEmptyString.check(
|
|
1242
|
+
var StateKey = NonEmptyString.check(Schema17.isMaxLength(191)).annotate({
|
|
1035
1243
|
identifier: "Relay.State.StateKey"
|
|
1036
1244
|
});
|
|
1037
|
-
var StateIdempotencyKey = NonEmptyString.check(
|
|
1245
|
+
var StateIdempotencyKey = NonEmptyString.check(Schema17.isMaxLength(191)).annotate({
|
|
1038
1246
|
identifier: "Relay.State.StateIdempotencyKey"
|
|
1039
1247
|
});
|
|
1040
|
-
var StateVersion =
|
|
1248
|
+
var StateVersion = Schema17.Int.check(Schema17.isGreaterThanOrEqualTo(1)).annotate({
|
|
1041
1249
|
identifier: "Relay.State.StateVersion"
|
|
1042
1250
|
});
|
|
1043
|
-
var StateRecordView =
|
|
1251
|
+
var StateRecordView = Schema17.Struct({
|
|
1044
1252
|
execution_id: ExecutionId,
|
|
1045
1253
|
key: StateKey,
|
|
1046
1254
|
value: JsonValue,
|
|
@@ -1048,11 +1256,11 @@ var StateRecordView = Schema16.Struct({
|
|
|
1048
1256
|
created_at: TimestampMillis,
|
|
1049
1257
|
updated_at: TimestampMillis
|
|
1050
1258
|
}).annotate({ identifier: "Relay.State.StateRecordView" });
|
|
1051
|
-
var StateUpdatedEventData =
|
|
1052
|
-
|
|
1053
|
-
|
|
1259
|
+
var StateUpdatedEventData = Schema17.Union([
|
|
1260
|
+
Schema17.Struct({ key: StateKey, version: StateVersion, value: JsonValue }),
|
|
1261
|
+
Schema17.Struct({ key: StateKey, version: StateVersion, blob_ref: NonEmptyString })
|
|
1054
1262
|
]).annotate({ identifier: "Relay.State.StateUpdatedEventData" });
|
|
1055
|
-
var StateDeletedEventData =
|
|
1263
|
+
var StateDeletedEventData = Schema17.Struct({
|
|
1056
1264
|
key: StateKey,
|
|
1057
1265
|
version: StateVersion
|
|
1058
1266
|
}).annotate({ identifier: "Relay.State.StateDeletedEventData" });
|
|
@@ -1073,7 +1281,7 @@ __export2(exports_wait_schema, {
|
|
|
1073
1281
|
Classification: () => Classification,
|
|
1074
1282
|
ChildJoinWait: () => ChildJoinWait
|
|
1075
1283
|
});
|
|
1076
|
-
var WaitKind =
|
|
1284
|
+
var WaitKind = Schema18.Literals([
|
|
1077
1285
|
"permission",
|
|
1078
1286
|
"tool_approval",
|
|
1079
1287
|
"tool_placement",
|
|
@@ -1083,46 +1291,46 @@ var WaitKind = Schema17.Literals([
|
|
|
1083
1291
|
"timer",
|
|
1084
1292
|
"external"
|
|
1085
1293
|
]).annotate({ identifier: "Relay.WaitKind" });
|
|
1086
|
-
var PermissionWait =
|
|
1087
|
-
kind:
|
|
1294
|
+
var PermissionWait = Schema18.Struct({
|
|
1295
|
+
kind: Schema18.Literal("permission"),
|
|
1088
1296
|
wait_id: WaitId,
|
|
1089
1297
|
tool_call_id: ToolCallId
|
|
1090
1298
|
}).annotate({ identifier: "Relay.PermissionWait" });
|
|
1091
|
-
var ToolApprovalWait =
|
|
1092
|
-
kind:
|
|
1299
|
+
var ToolApprovalWait = Schema18.Struct({
|
|
1300
|
+
kind: Schema18.Literal("tool_approval"),
|
|
1093
1301
|
wait_id: WaitId,
|
|
1094
1302
|
tool_call_id: ToolCallId
|
|
1095
1303
|
}).annotate({ identifier: "Relay.ToolApprovalWait" });
|
|
1096
|
-
var ToolPlacementWait =
|
|
1097
|
-
kind:
|
|
1304
|
+
var ToolPlacementWait = Schema18.Struct({
|
|
1305
|
+
kind: Schema18.Literal("tool_placement"),
|
|
1098
1306
|
wait_id: WaitId,
|
|
1099
1307
|
tool_call_id: ToolCallId
|
|
1100
1308
|
}).annotate({ identifier: "Relay.ToolPlacementWait" });
|
|
1101
|
-
var ChildJoinWait =
|
|
1102
|
-
kind:
|
|
1309
|
+
var ChildJoinWait = Schema18.Struct({
|
|
1310
|
+
kind: Schema18.Literal("child_join"),
|
|
1103
1311
|
wait_id: WaitId,
|
|
1104
1312
|
child_execution_id: ChildExecutionId
|
|
1105
1313
|
}).annotate({ identifier: "Relay.ChildJoinWait" });
|
|
1106
|
-
var InboxWait =
|
|
1107
|
-
kind:
|
|
1314
|
+
var InboxWait = Schema18.Struct({
|
|
1315
|
+
kind: Schema18.Literal("inbox"),
|
|
1108
1316
|
wait_id: WaitId,
|
|
1109
1317
|
tool_call_id: ToolCallId
|
|
1110
1318
|
}).annotate({ identifier: "Relay.InboxWait" });
|
|
1111
|
-
var ReplyWait =
|
|
1112
|
-
kind:
|
|
1319
|
+
var ReplyWait = Schema18.Struct({
|
|
1320
|
+
kind: Schema18.Literal("reply"),
|
|
1113
1321
|
wait_id: WaitId,
|
|
1114
|
-
envelope_id:
|
|
1322
|
+
envelope_id: Schema18.optionalKey(EnvelopeId)
|
|
1115
1323
|
}).annotate({ identifier: "Relay.ReplyWait" });
|
|
1116
|
-
var TimerWait =
|
|
1117
|
-
kind:
|
|
1324
|
+
var TimerWait = Schema18.Struct({
|
|
1325
|
+
kind: Schema18.Literal("timer"),
|
|
1118
1326
|
wait_id: WaitId
|
|
1119
1327
|
}).annotate({ identifier: "Relay.TimerWait" });
|
|
1120
|
-
var ExternalWait =
|
|
1121
|
-
kind:
|
|
1328
|
+
var ExternalWait = Schema18.Struct({
|
|
1329
|
+
kind: Schema18.Literal("external"),
|
|
1122
1330
|
wait_id: WaitId,
|
|
1123
1331
|
mode: WaitMode
|
|
1124
1332
|
}).annotate({ identifier: "Relay.ExternalWait" });
|
|
1125
|
-
var Classification =
|
|
1333
|
+
var Classification = Schema18.Union([
|
|
1126
1334
|
PermissionWait,
|
|
1127
1335
|
ToolApprovalWait,
|
|
1128
1336
|
ToolPlacementWait,
|
|
@@ -1185,7 +1393,7 @@ var classify = (input) => {
|
|
|
1185
1393
|
return { kind: "timer", wait_id: waitId };
|
|
1186
1394
|
return { kind: "external", wait_id: waitId, mode: input.mode };
|
|
1187
1395
|
};
|
|
1188
|
-
var Resolver =
|
|
1396
|
+
var Resolver = Schema18.Literals(["resolve_permission", "resolve_tool_approval", "wake"]).annotate({
|
|
1189
1397
|
identifier: "Relay.WaitResolver"
|
|
1190
1398
|
});
|
|
1191
1399
|
var resolverFor = (classification) => {
|
|
@@ -1245,112 +1453,112 @@ __export2(exports_workflow_schema, {
|
|
|
1245
1453
|
BranchOperation: () => BranchOperation,
|
|
1246
1454
|
ApprovalOperation: () => ApprovalOperation
|
|
1247
1455
|
});
|
|
1248
|
-
var DefinitionRevision3 =
|
|
1456
|
+
var DefinitionRevision3 = Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(1)).annotate({
|
|
1249
1457
|
identifier: "Relay.WorkflowDefinitionRevision"
|
|
1250
1458
|
});
|
|
1251
|
-
var DefinitionDigest =
|
|
1459
|
+
var DefinitionDigest = Schema19.String.check(Schema19.isPattern(/^sha256:[0-9a-f]{64}$/)).annotate({
|
|
1252
1460
|
identifier: "Relay.WorkflowDefinitionDigest"
|
|
1253
1461
|
});
|
|
1254
1462
|
var OperationRef = WorkflowOperationId;
|
|
1255
1463
|
var base = { id: WorkflowOperationId };
|
|
1256
|
-
var SequenceOperation =
|
|
1464
|
+
var SequenceOperation = Schema19.Struct({
|
|
1257
1465
|
...base,
|
|
1258
|
-
kind:
|
|
1259
|
-
operations:
|
|
1466
|
+
kind: Schema19.Literal("sequence"),
|
|
1467
|
+
operations: Schema19.Array(OperationRef)
|
|
1260
1468
|
});
|
|
1261
|
-
var ChildOperation =
|
|
1469
|
+
var ChildOperation = Schema19.Struct({
|
|
1262
1470
|
...base,
|
|
1263
|
-
kind:
|
|
1471
|
+
kind: Schema19.Literal("child"),
|
|
1264
1472
|
workflow_id: WorkflowDefinitionId,
|
|
1265
|
-
input:
|
|
1473
|
+
input: Schema19.optionalKey(JsonValue)
|
|
1266
1474
|
});
|
|
1267
|
-
var DispatchableChildOperation =
|
|
1475
|
+
var DispatchableChildOperation = Schema19.Struct({
|
|
1268
1476
|
...base,
|
|
1269
|
-
kind:
|
|
1477
|
+
kind: Schema19.Literal("child"),
|
|
1270
1478
|
address_id: AddressId,
|
|
1271
|
-
preset_name:
|
|
1272
|
-
input:
|
|
1479
|
+
preset_name: Schema19.optionalKey(NonEmptyString),
|
|
1480
|
+
input: Schema19.optionalKey(JsonValue)
|
|
1273
1481
|
});
|
|
1274
|
-
var ToolOperation =
|
|
1482
|
+
var ToolOperation = Schema19.Struct({
|
|
1275
1483
|
...base,
|
|
1276
|
-
kind:
|
|
1484
|
+
kind: Schema19.Literal("tool"),
|
|
1277
1485
|
tool_name: NonEmptyString,
|
|
1278
|
-
input:
|
|
1486
|
+
input: Schema19.optionalKey(JsonValue)
|
|
1279
1487
|
});
|
|
1280
|
-
var ApprovalOperation =
|
|
1281
|
-
var TimerOperation =
|
|
1488
|
+
var ApprovalOperation = Schema19.Struct({ ...base, kind: Schema19.Literal("approval"), prompt: NonEmptyString });
|
|
1489
|
+
var TimerOperation = Schema19.Struct({
|
|
1282
1490
|
...base,
|
|
1283
|
-
kind:
|
|
1284
|
-
duration_ms:
|
|
1491
|
+
kind: Schema19.Literal("timer"),
|
|
1492
|
+
duration_ms: Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(0))
|
|
1285
1493
|
});
|
|
1286
|
-
var BranchOperation =
|
|
1494
|
+
var BranchOperation = Schema19.Struct({
|
|
1287
1495
|
...base,
|
|
1288
|
-
kind:
|
|
1496
|
+
kind: Schema19.Literal("branch"),
|
|
1289
1497
|
condition: NonEmptyString,
|
|
1290
1498
|
when_true: OperationRef,
|
|
1291
1499
|
when_false: OperationRef
|
|
1292
1500
|
});
|
|
1293
|
-
var ParallelOperation =
|
|
1501
|
+
var ParallelOperation = Schema19.Struct({
|
|
1294
1502
|
...base,
|
|
1295
|
-
kind:
|
|
1296
|
-
operations:
|
|
1503
|
+
kind: Schema19.Literal("parallel"),
|
|
1504
|
+
operations: Schema19.Array(OperationRef)
|
|
1297
1505
|
});
|
|
1298
|
-
var JoinOperation =
|
|
1506
|
+
var JoinOperation = Schema19.Struct({
|
|
1299
1507
|
...base,
|
|
1300
|
-
kind:
|
|
1301
|
-
operations:
|
|
1508
|
+
kind: Schema19.Literal("join"),
|
|
1509
|
+
operations: Schema19.Array(OperationRef)
|
|
1302
1510
|
});
|
|
1303
|
-
var ParallelOperationV2 =
|
|
1511
|
+
var ParallelOperationV2 = Schema19.Struct({
|
|
1304
1512
|
...base,
|
|
1305
|
-
kind:
|
|
1513
|
+
kind: Schema19.Literal("parallel"),
|
|
1306
1514
|
fan_out_key: NonEmptyString,
|
|
1307
|
-
operations:
|
|
1308
|
-
max_concurrency:
|
|
1515
|
+
operations: Schema19.Array(OperationRef).check(Schema19.isMinLength(1)),
|
|
1516
|
+
max_concurrency: Schema19.Int.check(Schema19.isGreaterThan(0))
|
|
1309
1517
|
});
|
|
1310
|
-
var JoinOperationV2 =
|
|
1518
|
+
var JoinOperationV2 = Schema19.Struct({
|
|
1311
1519
|
...base,
|
|
1312
|
-
kind:
|
|
1520
|
+
kind: Schema19.Literal("join"),
|
|
1313
1521
|
parallel_operation: OperationRef,
|
|
1314
|
-
members:
|
|
1315
|
-
policy:
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1522
|
+
members: Schema19.Array(OperationRef).check(Schema19.isMinLength(1)),
|
|
1523
|
+
policy: Schema19.Union([
|
|
1524
|
+
Schema19.TaggedStruct("all", {}),
|
|
1525
|
+
Schema19.TaggedStruct("first-success", {}),
|
|
1526
|
+
Schema19.TaggedStruct("quorum", { count: Schema19.Int.check(Schema19.isGreaterThan(0)) }),
|
|
1527
|
+
Schema19.TaggedStruct("best-effort", {})
|
|
1320
1528
|
])
|
|
1321
1529
|
});
|
|
1322
|
-
var RetryOperation =
|
|
1530
|
+
var RetryOperation = Schema19.Struct({
|
|
1323
1531
|
...base,
|
|
1324
|
-
kind:
|
|
1532
|
+
kind: Schema19.Literal("retry"),
|
|
1325
1533
|
operation: OperationRef,
|
|
1326
|
-
max_attempts:
|
|
1534
|
+
max_attempts: Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(1))
|
|
1327
1535
|
});
|
|
1328
|
-
var BudgetOperation =
|
|
1536
|
+
var BudgetOperation = Schema19.Struct({
|
|
1329
1537
|
...base,
|
|
1330
|
-
kind:
|
|
1538
|
+
kind: Schema19.Literal("budget"),
|
|
1331
1539
|
operation: OperationRef,
|
|
1332
|
-
limit:
|
|
1333
|
-
unit:
|
|
1540
|
+
limit: Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(1)),
|
|
1541
|
+
unit: Schema19.Literals(["tokens", "milliseconds", "operations"])
|
|
1334
1542
|
});
|
|
1335
|
-
var CancellationOperation =
|
|
1543
|
+
var CancellationOperation = Schema19.Struct({
|
|
1336
1544
|
...base,
|
|
1337
|
-
kind:
|
|
1545
|
+
kind: Schema19.Literal("cancellation"),
|
|
1338
1546
|
operation: OperationRef,
|
|
1339
|
-
on_cancel:
|
|
1547
|
+
on_cancel: Schema19.optionalKey(OperationRef)
|
|
1340
1548
|
});
|
|
1341
|
-
var CompensationOperation =
|
|
1549
|
+
var CompensationOperation = Schema19.Struct({
|
|
1342
1550
|
...base,
|
|
1343
|
-
kind:
|
|
1551
|
+
kind: Schema19.Literal("compensation"),
|
|
1344
1552
|
operation: OperationRef,
|
|
1345
1553
|
compensate_with: OperationRef
|
|
1346
1554
|
});
|
|
1347
|
-
var StructuredCompletionOperation =
|
|
1555
|
+
var StructuredCompletionOperation = Schema19.Struct({
|
|
1348
1556
|
...base,
|
|
1349
|
-
kind:
|
|
1557
|
+
kind: Schema19.Literal("structured-completion"),
|
|
1350
1558
|
schema_ref: NonEmptyString,
|
|
1351
1559
|
value_from: OperationRef
|
|
1352
1560
|
});
|
|
1353
|
-
var Operation =
|
|
1561
|
+
var Operation = Schema19.Union([
|
|
1354
1562
|
SequenceOperation,
|
|
1355
1563
|
ChildOperation,
|
|
1356
1564
|
ToolOperation,
|
|
@@ -1365,7 +1573,7 @@ var Operation = Schema18.Union([
|
|
|
1365
1573
|
CompensationOperation,
|
|
1366
1574
|
StructuredCompletionOperation
|
|
1367
1575
|
]).annotate({ identifier: "Relay.WorkflowOperation" });
|
|
1368
|
-
var OperationV2 =
|
|
1576
|
+
var OperationV2 = Schema19.Union([
|
|
1369
1577
|
SequenceOperation,
|
|
1370
1578
|
DispatchableChildOperation,
|
|
1371
1579
|
ToolOperation,
|
|
@@ -1404,7 +1612,7 @@ var references = (operation) => {
|
|
|
1404
1612
|
return [];
|
|
1405
1613
|
}
|
|
1406
1614
|
};
|
|
1407
|
-
var validGraph =
|
|
1615
|
+
var validGraph = Schema19.makeFilter((definition) => {
|
|
1408
1616
|
const ids = new Set(definition.operations.map((operation) => operation.id));
|
|
1409
1617
|
if (ids.size !== definition.operations.length)
|
|
1410
1618
|
return "workflow operation ids must be unique";
|
|
@@ -1421,7 +1629,7 @@ var referencesV2 = (operation) => {
|
|
|
1421
1629
|
return [operation.parallel_operation, ...operation.members];
|
|
1422
1630
|
return references(operation);
|
|
1423
1631
|
};
|
|
1424
|
-
var validGraphV2 =
|
|
1632
|
+
var validGraphV2 = Schema19.makeFilter((definition) => {
|
|
1425
1633
|
const operations = new Map(definition.operations.map((operation) => [operation.id, operation]));
|
|
1426
1634
|
if (operations.size !== definition.operations.length)
|
|
1427
1635
|
return "workflow operation ids must be unique";
|
|
@@ -1450,21 +1658,21 @@ var validGraphV2 = Schema18.makeFilter((definition) => {
|
|
|
1450
1658
|
}
|
|
1451
1659
|
return;
|
|
1452
1660
|
});
|
|
1453
|
-
var DefinitionV1 =
|
|
1454
|
-
version:
|
|
1661
|
+
var DefinitionV1 = Schema19.Struct({
|
|
1662
|
+
version: Schema19.Literal(1),
|
|
1455
1663
|
name: NonEmptyString,
|
|
1456
1664
|
entry_operation_id: WorkflowOperationId,
|
|
1457
|
-
operations:
|
|
1458
|
-
metadata:
|
|
1665
|
+
operations: Schema19.Array(Operation).check(Schema19.isMinLength(1)),
|
|
1666
|
+
metadata: Schema19.optionalKey(Metadata)
|
|
1459
1667
|
}).check(validGraph).annotate({ identifier: "Relay.WorkflowDefinitionV1" });
|
|
1460
|
-
var DefinitionV2 =
|
|
1461
|
-
version:
|
|
1668
|
+
var DefinitionV2 = Schema19.Struct({
|
|
1669
|
+
version: Schema19.Literal(2),
|
|
1462
1670
|
name: NonEmptyString,
|
|
1463
1671
|
entry_operation_id: WorkflowOperationId,
|
|
1464
|
-
operations:
|
|
1465
|
-
metadata:
|
|
1672
|
+
operations: Schema19.Array(OperationV2).check(Schema19.isMinLength(1)),
|
|
1673
|
+
metadata: Schema19.optionalKey(Metadata)
|
|
1466
1674
|
}).check(validGraphV2).annotate({ identifier: "Relay.WorkflowDefinitionV2" });
|
|
1467
|
-
var Definition4 =
|
|
1675
|
+
var Definition4 = Schema19.Union([DefinitionV1, DefinitionV2]).annotate({
|
|
1468
1676
|
identifier: "Relay.WorkflowDefinition"
|
|
1469
1677
|
});
|
|
1470
1678
|
var canonicalDefinition = (definition) => canonicalString(definition);
|
|
@@ -1574,36 +1782,36 @@ var sha256 = (value) => {
|
|
|
1574
1782
|
}
|
|
1575
1783
|
return hash.map((part) => (part >>> 0).toString(16).padStart(8, "0")).join("");
|
|
1576
1784
|
};
|
|
1577
|
-
var digestDefinition = (definition) =>
|
|
1578
|
-
var DefinitionRevisionRecord3 =
|
|
1785
|
+
var digestDefinition = (definition) => Schema19.decodeUnknownSync(DefinitionDigest)(`sha256:${sha256(canonicalDefinition(definition))}`);
|
|
1786
|
+
var DefinitionRevisionRecord3 = Schema19.Struct({
|
|
1579
1787
|
id: WorkflowDefinitionId,
|
|
1580
1788
|
revision: DefinitionRevision3,
|
|
1581
1789
|
digest: DefinitionDigest,
|
|
1582
1790
|
definition: Definition4,
|
|
1583
1791
|
created_at: TimestampMillis
|
|
1584
1792
|
}).annotate({ identifier: "Relay.WorkflowDefinitionRevisionRecord" });
|
|
1585
|
-
var RunPin =
|
|
1793
|
+
var RunPin = Schema19.Struct({
|
|
1586
1794
|
workflow_definition_id: WorkflowDefinitionId,
|
|
1587
1795
|
workflow_definition_revision: DefinitionRevision3,
|
|
1588
1796
|
workflow_definition_digest: DefinitionDigest
|
|
1589
1797
|
}).annotate({ identifier: "Relay.WorkflowRunPin" });
|
|
1590
|
-
var RegisterDefinitionPayload3 =
|
|
1591
|
-
var DefinitionRegistered3 =
|
|
1592
|
-
var DefinitionRevisionList3 =
|
|
1593
|
-
var RunStatus =
|
|
1594
|
-
var RunRecord =
|
|
1798
|
+
var RegisterDefinitionPayload3 = Schema19.Struct({ id: WorkflowDefinitionId, definition: Definition4 });
|
|
1799
|
+
var DefinitionRegistered3 = Schema19.Struct({ record: DefinitionRevisionRecord3 });
|
|
1800
|
+
var DefinitionRevisionList3 = Schema19.Struct({ records: Schema19.Array(DefinitionRevisionRecord3) });
|
|
1801
|
+
var RunStatus = Schema19.Literals(["running", "completed", "failed", "cancelled"]);
|
|
1802
|
+
var RunRecord = Schema19.Struct({
|
|
1595
1803
|
execution_id: ExecutionId,
|
|
1596
1804
|
pin: RunPin,
|
|
1597
1805
|
status: RunStatus,
|
|
1598
1806
|
created_at: TimestampMillis,
|
|
1599
1807
|
updated_at: TimestampMillis
|
|
1600
1808
|
});
|
|
1601
|
-
var StartRunPayload =
|
|
1809
|
+
var StartRunPayload = Schema19.Struct({
|
|
1602
1810
|
execution_id: ExecutionId,
|
|
1603
1811
|
workflow_definition_id: WorkflowDefinitionId,
|
|
1604
|
-
revision:
|
|
1812
|
+
revision: Schema19.optionalKey(DefinitionRevision3)
|
|
1605
1813
|
});
|
|
1606
|
-
var OperationStatus =
|
|
1814
|
+
var OperationStatus = Schema19.Literals([
|
|
1607
1815
|
"pending",
|
|
1608
1816
|
"started",
|
|
1609
1817
|
"waiting",
|
|
@@ -1612,21 +1820,21 @@ var OperationStatus = Schema18.Literals([
|
|
|
1612
1820
|
"compensating",
|
|
1613
1821
|
"compensated"
|
|
1614
1822
|
]);
|
|
1615
|
-
var OperationState =
|
|
1823
|
+
var OperationState = Schema19.Struct({
|
|
1616
1824
|
execution_id: ExecutionId,
|
|
1617
1825
|
operation_id: WorkflowOperationId,
|
|
1618
1826
|
status: OperationStatus,
|
|
1619
|
-
fan_out_id:
|
|
1620
|
-
decision:
|
|
1621
|
-
output:
|
|
1622
|
-
attempt:
|
|
1623
|
-
backoff_until:
|
|
1624
|
-
compensation_operation_id:
|
|
1625
|
-
started_at:
|
|
1626
|
-
completed_at:
|
|
1827
|
+
fan_out_id: Schema19.optionalKey(ChildFanOutId),
|
|
1828
|
+
decision: Schema19.optionalKey(Schema19.Boolean),
|
|
1829
|
+
output: Schema19.optionalKey(JsonValue),
|
|
1830
|
+
attempt: Schema19.optionalKey(Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(0))),
|
|
1831
|
+
backoff_until: Schema19.optionalKey(TimestampMillis),
|
|
1832
|
+
compensation_operation_id: Schema19.optionalKey(WorkflowOperationId),
|
|
1833
|
+
started_at: Schema19.optionalKey(TimestampMillis),
|
|
1834
|
+
completed_at: Schema19.optionalKey(TimestampMillis),
|
|
1627
1835
|
updated_at: TimestampMillis
|
|
1628
1836
|
});
|
|
1629
|
-
var LifecycleEventType =
|
|
1837
|
+
var LifecycleEventType = Schema19.Literals([
|
|
1630
1838
|
"workflow.started",
|
|
1631
1839
|
"operation.started",
|
|
1632
1840
|
"operation.waiting",
|
|
@@ -1642,12 +1850,12 @@ var LifecycleEventType = Schema18.Literals([
|
|
|
1642
1850
|
"workflow.completed",
|
|
1643
1851
|
"workflow.failed"
|
|
1644
1852
|
]);
|
|
1645
|
-
var LifecycleEvent =
|
|
1853
|
+
var LifecycleEvent = Schema19.Struct({
|
|
1646
1854
|
execution_id: ExecutionId,
|
|
1647
|
-
sequence:
|
|
1855
|
+
sequence: Schema19.Int.check(Schema19.isGreaterThanOrEqualTo(1)),
|
|
1648
1856
|
type: LifecycleEventType,
|
|
1649
|
-
operation_id:
|
|
1650
|
-
data:
|
|
1857
|
+
operation_id: Schema19.optionalKey(WorkflowOperationId),
|
|
1858
|
+
data: Schema19.optionalKey(JsonValue),
|
|
1651
1859
|
created_at: TimestampMillis
|
|
1652
1860
|
});
|
|
1653
1861
|
var exports_workspace_schema = {};
|
|
@@ -1662,7 +1870,7 @@ __export2(exports_workspace_schema, {
|
|
|
1662
1870
|
WorkspaceCapabilities: () => WorkspaceCapabilities
|
|
1663
1871
|
});
|
|
1664
1872
|
var WorkspaceProviderKey = NonEmptyString.annotate({ identifier: "Relay.WorkspaceProviderKey" });
|
|
1665
|
-
var WorkspaceLeaseStatus =
|
|
1873
|
+
var WorkspaceLeaseStatus = Schema20.Literals([
|
|
1666
1874
|
"planned",
|
|
1667
1875
|
"running",
|
|
1668
1876
|
"suspended",
|
|
@@ -1671,59 +1879,59 @@ var WorkspaceLeaseStatus = Schema19.Literals([
|
|
|
1671
1879
|
"released",
|
|
1672
1880
|
"failed"
|
|
1673
1881
|
]).annotate({ identifier: "Relay.WorkspaceLeaseStatus" });
|
|
1674
|
-
var WorkspaceResumeStrategy =
|
|
1882
|
+
var WorkspaceResumeStrategy = Schema20.Literals(["reattach", "restore_snapshot"]).annotate({
|
|
1675
1883
|
identifier: "Relay.WorkspaceResumeStrategy"
|
|
1676
1884
|
});
|
|
1677
|
-
var WorkspaceCapabilities =
|
|
1678
|
-
can_suspend:
|
|
1679
|
-
can_snapshot:
|
|
1680
|
-
can_fork:
|
|
1681
|
-
persistent_by_default:
|
|
1682
|
-
suspend_granularity:
|
|
1683
|
-
max_suspend_duration_ms:
|
|
1684
|
-
reattach_by_ref:
|
|
1885
|
+
var WorkspaceCapabilities = Schema20.Struct({
|
|
1886
|
+
can_suspend: Schema20.Boolean,
|
|
1887
|
+
can_snapshot: Schema20.Boolean,
|
|
1888
|
+
can_fork: Schema20.Boolean,
|
|
1889
|
+
persistent_by_default: Schema20.Boolean,
|
|
1890
|
+
suspend_granularity: Schema20.Literals(["memory", "filesystem", "none"]),
|
|
1891
|
+
max_suspend_duration_ms: Schema20.optionalKey(Schema20.Finite),
|
|
1892
|
+
reattach_by_ref: Schema20.Boolean
|
|
1685
1893
|
}).annotate({ identifier: "Relay.WorkspaceCapabilities" });
|
|
1686
|
-
var WorkspaceRequest =
|
|
1687
|
-
provider_key:
|
|
1688
|
-
resume_snapshot_ref:
|
|
1689
|
-
metadata:
|
|
1894
|
+
var WorkspaceRequest = Schema20.Struct({
|
|
1895
|
+
provider_key: Schema20.optionalKey(WorkspaceProviderKey),
|
|
1896
|
+
resume_snapshot_ref: Schema20.optionalKey(SnapshotRef),
|
|
1897
|
+
metadata: Schema20.optionalKey(Metadata)
|
|
1690
1898
|
}).annotate({ identifier: "Relay.WorkspaceRequest" });
|
|
1691
|
-
var WorkspaceLeaseRecord =
|
|
1899
|
+
var WorkspaceLeaseRecord = Schema20.Struct({
|
|
1692
1900
|
id: WorkspaceLeaseId,
|
|
1693
1901
|
execution_id: ExecutionId,
|
|
1694
1902
|
provider_key: WorkspaceProviderKey,
|
|
1695
|
-
sandbox_ref:
|
|
1696
|
-
latest_snapshot_ref:
|
|
1903
|
+
sandbox_ref: Schema20.optionalKey(WorkspaceRef),
|
|
1904
|
+
latest_snapshot_ref: Schema20.optionalKey(SnapshotRef),
|
|
1697
1905
|
status: WorkspaceLeaseStatus,
|
|
1698
1906
|
resume_strategy: WorkspaceResumeStrategy,
|
|
1699
|
-
region:
|
|
1700
|
-
request:
|
|
1701
|
-
metadata:
|
|
1907
|
+
region: Schema20.optionalKey(NonEmptyString),
|
|
1908
|
+
request: Schema20.optionalKey(WorkspaceRequest),
|
|
1909
|
+
metadata: Schema20.optionalKey(Metadata),
|
|
1702
1910
|
created_at: TimestampMillis,
|
|
1703
1911
|
updated_at: TimestampMillis
|
|
1704
1912
|
}).annotate({ identifier: "Relay.WorkspaceLeaseRecord" });
|
|
1705
|
-
var WorkspaceSnapshotReason =
|
|
1913
|
+
var WorkspaceSnapshotReason = Schema20.Literals([
|
|
1706
1914
|
"before_wait",
|
|
1707
1915
|
"before_child_fork",
|
|
1708
1916
|
"on_complete",
|
|
1709
1917
|
"on_failure",
|
|
1710
1918
|
"manual"
|
|
1711
1919
|
]).annotate({ identifier: "Relay.WorkspaceSnapshotReason" });
|
|
1712
|
-
var WorkspaceSnapshotRecord =
|
|
1920
|
+
var WorkspaceSnapshotRecord = Schema20.Struct({
|
|
1713
1921
|
id: WorkspaceSnapshotId,
|
|
1714
1922
|
lease_id: WorkspaceLeaseId,
|
|
1715
1923
|
execution_id: ExecutionId,
|
|
1716
1924
|
reason: WorkspaceSnapshotReason,
|
|
1717
1925
|
snapshot_ref: SnapshotRef,
|
|
1718
|
-
metadata:
|
|
1926
|
+
metadata: Schema20.optionalKey(Metadata),
|
|
1719
1927
|
created_at: TimestampMillis
|
|
1720
1928
|
}).annotate({ identifier: "Relay.WorkspaceSnapshotRecord" });
|
|
1721
1929
|
|
|
1722
1930
|
// src/state-version-conflict.ts
|
|
1723
|
-
import { Schema as
|
|
1724
|
-
var NonNegativeStateVersion =
|
|
1931
|
+
import { Schema as Schema21 } from "effect";
|
|
1932
|
+
var NonNegativeStateVersion = Schema21.Int.check(Schema21.isGreaterThanOrEqualTo(0));
|
|
1725
1933
|
|
|
1726
|
-
class StateVersionConflict extends
|
|
1934
|
+
class StateVersionConflict extends Schema21.TaggedErrorClass()("StateVersionConflict", {
|
|
1727
1935
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1728
1936
|
key: exports_state_schema.StateKey,
|
|
1729
1937
|
expected_version: NonNegativeStateVersion,
|
|
@@ -1747,6 +1955,7 @@ __export(exports_operation, {
|
|
|
1747
1955
|
ToolWorkReleased: () => ToolWorkReleased,
|
|
1748
1956
|
ToolWorkLease: () => ToolWorkLease,
|
|
1749
1957
|
ToolOutcomeAccepted: () => ToolOutcomeAccepted,
|
|
1958
|
+
ToolInvocation: () => ToolInvocation,
|
|
1750
1959
|
ToolCallSummary: () => ToolCallSummary,
|
|
1751
1960
|
ToolAttemptList: () => ToolAttemptList,
|
|
1752
1961
|
ToolAttempt: () => ToolAttempt,
|
|
@@ -1826,6 +2035,7 @@ __export(exports_operation, {
|
|
|
1826
2035
|
ClaimToolWorkInput: () => ClaimToolWorkInput,
|
|
1827
2036
|
ClaimEnvelopeReadyInput: () => ClaimEnvelopeReadyInput,
|
|
1828
2037
|
ChildRunSummary: () => ChildRunSummary,
|
|
2038
|
+
ChildRunEdge: () => ChildRunEdge,
|
|
1829
2039
|
CancelScheduleResult: () => CancelScheduleResult,
|
|
1830
2040
|
CancelScheduleInput: () => CancelScheduleInput,
|
|
1831
2041
|
CancelExecutionInput: () => CancelExecutionInput,
|
|
@@ -1835,170 +2045,171 @@ __export(exports_operation, {
|
|
|
1835
2045
|
AwaitWaitInput: () => AwaitWaitInput,
|
|
1836
2046
|
AckEnvelopeReadyInput: () => AckEnvelopeReadyInput
|
|
1837
2047
|
});
|
|
1838
|
-
import { Schema as
|
|
1839
|
-
var StartExecutionInput =
|
|
2048
|
+
import { Schema as Schema23 } from "effect";
|
|
2049
|
+
var StartExecutionInput = Schema23.Struct({
|
|
1840
2050
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1841
2051
|
root_address_id: exports_ids_schema.AddressId,
|
|
1842
|
-
session_id:
|
|
1843
|
-
input:
|
|
2052
|
+
session_id: Schema23.optionalKey(exports_ids_schema.SessionId),
|
|
2053
|
+
input: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
1844
2054
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
1845
2055
|
started_at: exports_shared_schema.TimestampMillis,
|
|
1846
2056
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
1847
|
-
agent_id:
|
|
1848
|
-
agent_revision:
|
|
1849
|
-
agent_snapshot:
|
|
1850
|
-
agent_tool_input_schema_digests:
|
|
1851
|
-
wait_id:
|
|
1852
|
-
|
|
2057
|
+
agent_id: Schema23.optionalKey(exports_ids_schema.AgentId),
|
|
2058
|
+
agent_revision: Schema23.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
2059
|
+
agent_snapshot: Schema23.optionalKey(exports_agent_schema.Definition),
|
|
2060
|
+
agent_tool_input_schema_digests: Schema23.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
2061
|
+
wait_id: Schema23.optionalKey(exports_ids_schema.WaitId),
|
|
2062
|
+
origin: Schema23.optionalKey(exports_execution_schema.ExecutionOrigin),
|
|
2063
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
1853
2064
|
}).annotate({ identifier: "Relay.Operation.StartExecutionInput" });
|
|
1854
|
-
var StartExecutionResult =
|
|
2065
|
+
var StartExecutionResult = Schema23.Struct({
|
|
1855
2066
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1856
2067
|
status: exports_execution_schema.ExecutionStatus,
|
|
1857
|
-
metadata:
|
|
2068
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
1858
2069
|
}).annotate({ identifier: "Relay.Operation.StartExecutionResult" });
|
|
1859
|
-
var SpawnResidentInput =
|
|
2070
|
+
var SpawnResidentInput = Schema23.Struct({
|
|
1860
2071
|
kind: exports_ids_schema.ResidentKindName,
|
|
1861
2072
|
key: exports_ids_schema.ResidentKey,
|
|
1862
|
-
input:
|
|
1863
|
-
metadata:
|
|
2073
|
+
input: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
2074
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata),
|
|
1864
2075
|
created_at: exports_shared_schema.TimestampMillis
|
|
1865
2076
|
}).annotate({ identifier: "Relay.Operation.SpawnResidentInput" });
|
|
1866
|
-
var GetResidentInput =
|
|
2077
|
+
var GetResidentInput = Schema23.Struct({ kind: exports_ids_schema.ResidentKindName, key: exports_ids_schema.ResidentKey }).annotate({
|
|
1867
2078
|
identifier: "Relay.Operation.GetResidentInput"
|
|
1868
2079
|
});
|
|
1869
|
-
var DestroyResidentInput =
|
|
2080
|
+
var DestroyResidentInput = Schema23.Struct({
|
|
1870
2081
|
kind: exports_ids_schema.ResidentKindName,
|
|
1871
2082
|
key: exports_ids_schema.ResidentKey,
|
|
1872
|
-
reason:
|
|
2083
|
+
reason: Schema23.optionalKey(Schema23.String),
|
|
1873
2084
|
destroyed_at: exports_shared_schema.TimestampMillis
|
|
1874
2085
|
}).annotate({ identifier: "Relay.Operation.DestroyResidentInput" });
|
|
1875
|
-
var ListResidentsInput =
|
|
1876
|
-
kind:
|
|
1877
|
-
after_kind:
|
|
1878
|
-
after_key:
|
|
1879
|
-
limit:
|
|
2086
|
+
var ListResidentsInput = Schema23.Struct({
|
|
2087
|
+
kind: Schema23.optionalKey(exports_ids_schema.ResidentKindName),
|
|
2088
|
+
after_kind: Schema23.optionalKey(exports_ids_schema.ResidentKindName),
|
|
2089
|
+
after_key: Schema23.optionalKey(Schema23.String),
|
|
2090
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
1880
2091
|
}).annotate({ identifier: "Relay.Operation.ListResidentsInput" });
|
|
1881
2092
|
var ResidentInstance = exports_resident_schema.Instance;
|
|
1882
|
-
var StreamExecutionInput =
|
|
2093
|
+
var StreamExecutionInput = Schema23.Struct({
|
|
1883
2094
|
execution_id: exports_execution_schema.Execution.fields.id,
|
|
1884
|
-
after_cursor:
|
|
1885
|
-
limit:
|
|
2095
|
+
after_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2096
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
1886
2097
|
}).annotate({ identifier: "Relay.Operation.StreamExecutionInput" });
|
|
1887
|
-
var GetResidentStateInput =
|
|
2098
|
+
var GetResidentStateInput = Schema23.Struct({ execution_id: exports_ids_schema.ExecutionId, key: exports_state_schema.StateKey }).annotate({
|
|
1888
2099
|
identifier: "Relay.Operation.GetResidentStateInput"
|
|
1889
2100
|
});
|
|
1890
|
-
var PutResidentStateInput =
|
|
2101
|
+
var PutResidentStateInput = Schema23.Struct({
|
|
1891
2102
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1892
2103
|
key: exports_state_schema.StateKey,
|
|
1893
2104
|
value: exports_shared_schema.JsonValue,
|
|
1894
|
-
expected_version:
|
|
1895
|
-
idempotency_key:
|
|
2105
|
+
expected_version: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(0))),
|
|
2106
|
+
idempotency_key: Schema23.optionalKey(exports_state_schema.StateIdempotencyKey.check(Schema23.makeFilter((value) => !value.startsWith("relay:internal:")))),
|
|
1896
2107
|
updated_at: exports_shared_schema.TimestampMillis
|
|
1897
2108
|
}).annotate({ identifier: "Relay.Operation.PutResidentStateInput" });
|
|
1898
|
-
var DeleteResidentStateInput =
|
|
2109
|
+
var DeleteResidentStateInput = Schema23.Struct({
|
|
1899
2110
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1900
2111
|
key: exports_state_schema.StateKey,
|
|
1901
|
-
expected_version:
|
|
1902
|
-
idempotency_key:
|
|
2112
|
+
expected_version: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(0))),
|
|
2113
|
+
idempotency_key: Schema23.optionalKey(exports_state_schema.StateIdempotencyKey.check(Schema23.makeFilter((value) => !value.startsWith("relay:internal:")))),
|
|
1903
2114
|
removed_at: exports_shared_schema.TimestampMillis
|
|
1904
2115
|
}).annotate({ identifier: "Relay.Operation.DeleteResidentStateInput" });
|
|
1905
|
-
var ListResidentStateInput =
|
|
2116
|
+
var ListResidentStateInput = Schema23.Struct({
|
|
1906
2117
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1907
|
-
prefix:
|
|
1908
|
-
after_key:
|
|
1909
|
-
limit:
|
|
2118
|
+
prefix: Schema23.optionalKey(Schema23.String),
|
|
2119
|
+
after_key: Schema23.optionalKey(Schema23.String),
|
|
2120
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
1910
2121
|
}).annotate({ identifier: "Relay.Operation.ListResidentStateInput" });
|
|
1911
|
-
var WaitTerminalState =
|
|
2122
|
+
var WaitTerminalState = Schema23.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
1912
2123
|
identifier: "Relay.Operation.WaitTerminalState"
|
|
1913
2124
|
});
|
|
1914
|
-
var AwaitWaitInput =
|
|
2125
|
+
var AwaitWaitInput = Schema23.Struct({
|
|
1915
2126
|
wait_id: exports_ids_schema.WaitId,
|
|
1916
2127
|
execution_id: exports_ids_schema.ExecutionId
|
|
1917
2128
|
}).annotate({ identifier: "Relay.Operation.AwaitWaitInput" });
|
|
1918
|
-
var WaitOutcome =
|
|
2129
|
+
var WaitOutcome = Schema23.Struct({
|
|
1919
2130
|
wait_id: exports_ids_schema.WaitId,
|
|
1920
2131
|
state: WaitTerminalState,
|
|
1921
|
-
content:
|
|
1922
|
-
metadata:
|
|
2132
|
+
content: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
2133
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
1923
2134
|
}).annotate({ identifier: "Relay.Operation.WaitOutcome" });
|
|
1924
|
-
var CancelExecutionInput =
|
|
2135
|
+
var CancelExecutionInput = Schema23.Struct({
|
|
1925
2136
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1926
2137
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
1927
|
-
reason:
|
|
2138
|
+
reason: Schema23.optionalKey(Schema23.String)
|
|
1928
2139
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionInput" });
|
|
1929
|
-
var CancelExecutionAccepted =
|
|
2140
|
+
var CancelExecutionAccepted = Schema23.Struct({
|
|
1930
2141
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1931
2142
|
status: exports_execution_schema.ExecutionStatus
|
|
1932
2143
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionAccepted" });
|
|
1933
|
-
var SteeringKind =
|
|
2144
|
+
var SteeringKind = Schema23.Literals(["steering", "follow_up"]).annotate({
|
|
1934
2145
|
identifier: "Relay.Operation.SteeringKind"
|
|
1935
2146
|
});
|
|
1936
|
-
var SteerInput =
|
|
2147
|
+
var SteerInput = Schema23.Struct({
|
|
1937
2148
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1938
2149
|
kind: SteeringKind,
|
|
1939
|
-
content:
|
|
2150
|
+
content: Schema23.Array(exports_content_schema.Part),
|
|
1940
2151
|
created_at: exports_shared_schema.TimestampMillis
|
|
1941
2152
|
}).annotate({ identifier: "Relay.Operation.SteerInput" });
|
|
1942
|
-
var SteerAccepted =
|
|
2153
|
+
var SteerAccepted = Schema23.Struct({
|
|
1943
2154
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1944
2155
|
kind: SteeringKind,
|
|
1945
|
-
sequence:
|
|
2156
|
+
sequence: Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(0)),
|
|
1946
2157
|
steering_message_id: exports_ids_schema.SteeringMessageId
|
|
1947
2158
|
}).annotate({ identifier: "Relay.Operation.SteerAccepted" });
|
|
1948
|
-
var WakeInput =
|
|
2159
|
+
var WakeInput = Schema23.Struct({
|
|
1949
2160
|
wait_id: exports_ids_schema.WaitId,
|
|
1950
2161
|
state: WaitTerminalState,
|
|
1951
2162
|
signaled_at: exports_shared_schema.TimestampMillis,
|
|
1952
|
-
from:
|
|
1953
|
-
content:
|
|
1954
|
-
correlation_key:
|
|
1955
|
-
metadata:
|
|
2163
|
+
from: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2164
|
+
content: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
2165
|
+
correlation_key: Schema23.optionalKey(Schema23.String),
|
|
2166
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
1956
2167
|
}).annotate({ identifier: "Relay.Operation.WakeInput" });
|
|
1957
|
-
var WakeAccepted =
|
|
2168
|
+
var WakeAccepted = Schema23.Struct({
|
|
1958
2169
|
wait_id: exports_ids_schema.WaitId,
|
|
1959
2170
|
state: WaitTerminalState,
|
|
1960
2171
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
1961
2172
|
}).annotate({ identifier: "Relay.Operation.WakeAccepted" });
|
|
1962
|
-
var WaitState =
|
|
2173
|
+
var WaitState = Schema23.Literals(["open", "resolved", "timed_out", "cancelled"]).annotate({
|
|
1963
2174
|
identifier: "Relay.Operation.WaitState"
|
|
1964
2175
|
});
|
|
1965
|
-
var ListWaitsInput =
|
|
1966
|
-
state:
|
|
1967
|
-
execution_id:
|
|
1968
|
-
limit:
|
|
2176
|
+
var ListWaitsInput = Schema23.Struct({
|
|
2177
|
+
state: Schema23.optionalKey(WaitState),
|
|
2178
|
+
execution_id: Schema23.optionalKey(exports_ids_schema.ExecutionId),
|
|
2179
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
1969
2180
|
}).annotate({ identifier: "Relay.Operation.ListWaitsInput" });
|
|
1970
|
-
var WaitView =
|
|
2181
|
+
var WaitView = Schema23.Struct({
|
|
1971
2182
|
wait_id: exports_ids_schema.WaitId,
|
|
1972
2183
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1973
|
-
envelope_id:
|
|
1974
|
-
kind:
|
|
2184
|
+
envelope_id: Schema23.optionalKey(exports_ids_schema.EnvelopeId),
|
|
2185
|
+
kind: Schema23.optionalKey(exports_wait_schema.WaitKind),
|
|
1975
2186
|
mode: exports_envelope_schema.WaitMode,
|
|
1976
|
-
correlation_key:
|
|
2187
|
+
correlation_key: Schema23.optionalKey(Schema23.String),
|
|
1977
2188
|
state: WaitState,
|
|
1978
2189
|
metadata: exports_shared_schema.Metadata,
|
|
1979
2190
|
created_at: exports_shared_schema.TimestampMillis,
|
|
1980
|
-
resolved_at:
|
|
2191
|
+
resolved_at: Schema23.optionalKey(exports_shared_schema.TimestampMillis)
|
|
1981
2192
|
}).annotate({ identifier: "Relay.Operation.WaitView" });
|
|
1982
|
-
var FollowStopReason =
|
|
1983
|
-
|
|
1984
|
-
|
|
2193
|
+
var FollowStopReason = Schema23.Union([
|
|
2194
|
+
Schema23.Struct({ _tag: Schema23.tag("terminal"), status: exports_execution_schema.ExecutionStatus }),
|
|
2195
|
+
Schema23.Struct({ _tag: Schema23.tag("actionable_wait"), wait: WaitView })
|
|
1985
2196
|
]).annotate({ identifier: "Relay.Operation.FollowStopReason" });
|
|
1986
|
-
var FollowExecutionItem =
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
_tag:
|
|
2197
|
+
var FollowExecutionItem = Schema23.Union([
|
|
2198
|
+
Schema23.Struct({ _tag: Schema23.tag("event"), event: exports_execution_schema.ExecutionEvent }),
|
|
2199
|
+
Schema23.Struct({ _tag: Schema23.tag("reconnecting"), message: Schema23.String, attempt: Schema23.Int }),
|
|
2200
|
+
Schema23.Struct({
|
|
2201
|
+
_tag: Schema23.tag("stopped"),
|
|
1991
2202
|
reason: FollowStopReason,
|
|
1992
|
-
cursor:
|
|
2203
|
+
cursor: Schema23.NullOr(exports_shared_schema.NonEmptyString)
|
|
1993
2204
|
})
|
|
1994
2205
|
]).annotate({ identifier: "Relay.Operation.FollowExecutionItem" });
|
|
1995
|
-
var FollowExecutionInput =
|
|
2206
|
+
var FollowExecutionInput = Schema23.Struct({
|
|
1996
2207
|
execution_id: exports_ids_schema.ExecutionId,
|
|
1997
|
-
after_cursor:
|
|
1998
|
-
stop_on_wait_modes:
|
|
1999
|
-
max_reconnects:
|
|
2208
|
+
after_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2209
|
+
stop_on_wait_modes: Schema23.optionalKey(Schema23.Array(exports_envelope_schema.WaitMode)),
|
|
2210
|
+
max_reconnects: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(0)))
|
|
2000
2211
|
}).annotate({ identifier: "Relay.Operation.FollowExecutionInput" });
|
|
2001
|
-
var PendingToolApproval =
|
|
2212
|
+
var PendingToolApproval = Schema23.Struct({
|
|
2002
2213
|
wait_id: exports_ids_schema.WaitId,
|
|
2003
2214
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2004
2215
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
@@ -2006,42 +2217,42 @@ var PendingToolApproval = Schema22.Struct({
|
|
|
2006
2217
|
input: exports_shared_schema.JsonValue,
|
|
2007
2218
|
requested_at: exports_shared_schema.TimestampMillis
|
|
2008
2219
|
}).annotate({ identifier: "Relay.Operation.PendingToolApproval" });
|
|
2009
|
-
var ListPendingApprovalsInput =
|
|
2220
|
+
var ListPendingApprovalsInput = Schema23.Struct({
|
|
2010
2221
|
execution_id: exports_ids_schema.ExecutionId
|
|
2011
2222
|
}).annotate({ identifier: "Relay.Operation.ListPendingApprovalsInput" });
|
|
2012
|
-
var PendingToolApprovalList =
|
|
2013
|
-
approvals:
|
|
2223
|
+
var PendingToolApprovalList = Schema23.Struct({
|
|
2224
|
+
approvals: Schema23.Array(PendingToolApproval)
|
|
2014
2225
|
}).annotate({ identifier: "Relay.Operation.PendingToolApprovalList" });
|
|
2015
|
-
var PendingToolCall =
|
|
2226
|
+
var PendingToolCall = Schema23.Struct({
|
|
2016
2227
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2017
2228
|
call: exports_tool_schema.Call,
|
|
2018
2229
|
definition: exports_tool_schema.Definition,
|
|
2019
2230
|
placement: exports_tool_schema.Placement,
|
|
2020
2231
|
state: exports_tool_schema.CallState,
|
|
2021
2232
|
wait_id: exports_ids_schema.WaitId,
|
|
2022
|
-
idempotency_key:
|
|
2233
|
+
idempotency_key: Schema23.String,
|
|
2023
2234
|
requested_at: exports_shared_schema.TimestampMillis
|
|
2024
2235
|
}).annotate({ identifier: "Relay.Operation.PendingToolCall" });
|
|
2025
|
-
var ListPendingToolCallsInput =
|
|
2026
|
-
execution_id:
|
|
2027
|
-
limit:
|
|
2236
|
+
var ListPendingToolCallsInput = Schema23.Struct({
|
|
2237
|
+
execution_id: Schema23.optionalKey(exports_ids_schema.ExecutionId),
|
|
2238
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
2028
2239
|
}).annotate({ identifier: "Relay.Operation.ListPendingToolCallsInput" });
|
|
2029
|
-
var PendingToolCallList =
|
|
2030
|
-
tool_calls:
|
|
2240
|
+
var PendingToolCallList = Schema23.Struct({
|
|
2241
|
+
tool_calls: Schema23.Array(PendingToolCall)
|
|
2031
2242
|
}).annotate({ identifier: "Relay.Operation.PendingToolCallList" });
|
|
2032
|
-
var FulfillToolCallInput =
|
|
2243
|
+
var FulfillToolCallInput = Schema23.Struct({
|
|
2033
2244
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2034
2245
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2035
2246
|
outcome: exports_tool_schema.ExternalOutcome,
|
|
2036
2247
|
fulfilled_at: exports_shared_schema.TimestampMillis
|
|
2037
2248
|
}).annotate({ identifier: "Relay.Operation.FulfillToolCallInput" });
|
|
2038
|
-
var ClaimToolWorkInput =
|
|
2249
|
+
var ClaimToolWorkInput = Schema23.Struct({
|
|
2039
2250
|
queue: exports_tool_schema.PlacementKey,
|
|
2040
2251
|
worker_id: exports_tool_schema.WorkerId,
|
|
2041
2252
|
now: exports_shared_schema.TimestampMillis,
|
|
2042
2253
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
2043
2254
|
}).annotate({ identifier: "Relay.Operation.ClaimToolWorkInput" });
|
|
2044
|
-
var CompleteToolWorkInput =
|
|
2255
|
+
var CompleteToolWorkInput = Schema23.Struct({
|
|
2045
2256
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2046
2257
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2047
2258
|
attempt_id: exports_ids_schema.ToolAttemptId,
|
|
@@ -2049,39 +2260,52 @@ var CompleteToolWorkInput = Schema22.Struct({
|
|
|
2049
2260
|
outcome: exports_tool_schema.ExternalOutcome,
|
|
2050
2261
|
completed_at: exports_shared_schema.TimestampMillis
|
|
2051
2262
|
}).annotate({ identifier: "Relay.Operation.CompleteToolWorkInput" });
|
|
2052
|
-
var ReleaseToolWorkInput =
|
|
2263
|
+
var ReleaseToolWorkInput = Schema23.Struct({
|
|
2053
2264
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2054
2265
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2055
2266
|
attempt_id: exports_ids_schema.ToolAttemptId,
|
|
2056
2267
|
worker_id: exports_tool_schema.WorkerId,
|
|
2057
2268
|
released_at: exports_shared_schema.TimestampMillis,
|
|
2058
2269
|
next_available_at: exports_shared_schema.TimestampMillis,
|
|
2059
|
-
error:
|
|
2270
|
+
error: Schema23.optionalKey(Schema23.String)
|
|
2060
2271
|
}).annotate({ identifier: "Relay.Operation.ReleaseToolWorkInput" });
|
|
2061
|
-
var ListToolAttemptsInput =
|
|
2272
|
+
var ListToolAttemptsInput = Schema23.Struct({
|
|
2062
2273
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2063
2274
|
tool_call_id: exports_ids_schema.ToolCallId
|
|
2064
2275
|
}).annotate({ identifier: "Relay.Operation.ListToolAttemptsInput" });
|
|
2065
|
-
var ToolAttempt =
|
|
2276
|
+
var ToolAttempt = Schema23.Struct({
|
|
2066
2277
|
attempt_id: exports_ids_schema.ToolAttemptId,
|
|
2067
2278
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2068
|
-
attempt_number:
|
|
2279
|
+
attempt_number: Schema23.Int.check(Schema23.isGreaterThan(0)),
|
|
2069
2280
|
state: exports_tool_schema.AttemptState,
|
|
2070
|
-
worker_id:
|
|
2071
|
-
claim_expires_at:
|
|
2072
|
-
error:
|
|
2281
|
+
worker_id: Schema23.optionalKey(Schema23.String),
|
|
2282
|
+
claim_expires_at: Schema23.optionalKey(exports_shared_schema.TimestampMillis),
|
|
2283
|
+
error: Schema23.optionalKey(Schema23.String),
|
|
2073
2284
|
created_at: exports_shared_schema.TimestampMillis,
|
|
2074
|
-
completed_at:
|
|
2285
|
+
completed_at: Schema23.optionalKey(exports_shared_schema.TimestampMillis)
|
|
2075
2286
|
}).annotate({ identifier: "Relay.Operation.ToolAttempt" });
|
|
2076
|
-
var ToolAttemptList =
|
|
2077
|
-
attempts:
|
|
2287
|
+
var ToolAttemptList = Schema23.Struct({
|
|
2288
|
+
attempts: Schema23.Array(ToolAttempt)
|
|
2078
2289
|
}).annotate({ identifier: "Relay.Operation.ToolAttemptList" });
|
|
2079
|
-
var
|
|
2290
|
+
var ToolInvocation = Schema23.Struct({
|
|
2291
|
+
invocation_id: exports_shared_schema.NonEmptyString,
|
|
2292
|
+
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2293
|
+
attempt_id: exports_ids_schema.ToolAttemptId,
|
|
2294
|
+
placement: Schema23.Literals(["local", "client", "remote", "mcp"]),
|
|
2295
|
+
state: exports_tool_schema.AttemptState,
|
|
2296
|
+
outcome: Schema23.optionalKey(Schema23.Literals(["success", "failure", "abandoned"])),
|
|
2297
|
+
failure_category: Schema23.optionalKey(Schema23.Literals(["handler", "worker", "abandoned", "unknown"])),
|
|
2298
|
+
started_at: exports_shared_schema.TimestampMillis,
|
|
2299
|
+
completed_at: Schema23.optionalKey(exports_shared_schema.TimestampMillis),
|
|
2300
|
+
claim_expires_at: Schema23.optionalKey(exports_shared_schema.TimestampMillis),
|
|
2301
|
+
worker_id: Schema23.optionalKey(exports_tool_schema.WorkerId)
|
|
2302
|
+
}).annotate({ identifier: "Relay.Operation.ToolInvocation" });
|
|
2303
|
+
var ToolOutcomeAccepted = Schema23.Struct({
|
|
2080
2304
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2081
2305
|
attempt: ToolAttempt,
|
|
2082
|
-
duplicate:
|
|
2306
|
+
duplicate: Schema23.Boolean
|
|
2083
2307
|
}).annotate({ identifier: "Relay.Operation.ToolOutcomeAccepted" });
|
|
2084
|
-
var ToolWorkLease =
|
|
2308
|
+
var ToolWorkLease = Schema23.Struct({
|
|
2085
2309
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2086
2310
|
call: exports_tool_schema.Call,
|
|
2087
2311
|
definition: exports_tool_schema.Definition,
|
|
@@ -2090,222 +2314,222 @@ var ToolWorkLease = Schema22.Struct({
|
|
|
2090
2314
|
queue: exports_tool_schema.PlacementKey,
|
|
2091
2315
|
worker_id: exports_tool_schema.WorkerId,
|
|
2092
2316
|
claim_expires_at: exports_shared_schema.TimestampMillis,
|
|
2093
|
-
idempotency_key:
|
|
2317
|
+
idempotency_key: Schema23.String
|
|
2094
2318
|
}).annotate({ identifier: "Relay.Operation.ToolWorkLease" });
|
|
2095
|
-
var ToolWorkReleased =
|
|
2319
|
+
var ToolWorkReleased = Schema23.Struct({
|
|
2096
2320
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2097
|
-
state:
|
|
2321
|
+
state: Schema23.Literal("waiting"),
|
|
2098
2322
|
next_available_at: exports_shared_schema.TimestampMillis
|
|
2099
2323
|
}).annotate({ identifier: "Relay.Operation.ToolWorkReleased" });
|
|
2100
|
-
var SpawnChildRunInput2 =
|
|
2324
|
+
var SpawnChildRunInput2 = Schema23.Struct({
|
|
2101
2325
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2102
|
-
child_execution_id:
|
|
2326
|
+
child_execution_id: Schema23.optionalKey(exports_ids_schema.ChildExecutionId),
|
|
2103
2327
|
address_id: exports_ids_schema.AddressId,
|
|
2104
|
-
preset_name:
|
|
2105
|
-
instructions:
|
|
2106
|
-
model:
|
|
2107
|
-
compaction_policy:
|
|
2108
|
-
tool_names:
|
|
2109
|
-
permissions:
|
|
2110
|
-
workspace_policy:
|
|
2111
|
-
output_schema_ref:
|
|
2112
|
-
metadata:
|
|
2113
|
-
input:
|
|
2114
|
-
wait:
|
|
2328
|
+
preset_name: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2329
|
+
instructions: Schema23.optionalKey(Schema23.String),
|
|
2330
|
+
model: Schema23.optionalKey(exports_agent_schema.ModelSelection),
|
|
2331
|
+
compaction_policy: Schema23.optionalKey(exports_agent_schema.CompactionPolicy),
|
|
2332
|
+
tool_names: Schema23.optionalKey(Schema23.Array(Schema23.String)),
|
|
2333
|
+
permissions: Schema23.optionalKey(Schema23.Array(Schema23.String)),
|
|
2334
|
+
workspace_policy: Schema23.optionalKey(exports_agent_schema.ChildRunWorkspacePolicy),
|
|
2335
|
+
output_schema_ref: Schema23.optionalKey(Schema23.String),
|
|
2336
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata),
|
|
2337
|
+
input: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
2338
|
+
wait: Schema23.optionalKey(Schema23.Boolean)
|
|
2115
2339
|
}).annotate({ identifier: "Relay.Operation.SpawnChildRunInput" });
|
|
2116
2340
|
var CreateChildFanOutInput = exports_child_orchestration_schema.FanOutDefinition.annotate({
|
|
2117
2341
|
identifier: "Relay.Operation.CreateChildFanOutInput"
|
|
2118
2342
|
});
|
|
2119
|
-
var CancelChildFanOutInput =
|
|
2343
|
+
var CancelChildFanOutInput = Schema23.Struct({
|
|
2120
2344
|
fan_out_id: exports_ids_schema.ChildFanOutId,
|
|
2121
2345
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
2122
|
-
reason:
|
|
2346
|
+
reason: Schema23.optionalKey(Schema23.String)
|
|
2123
2347
|
}).annotate({ identifier: "Relay.Operation.CancelChildFanOutInput" });
|
|
2124
|
-
var CancelChildFanOutResult =
|
|
2348
|
+
var CancelChildFanOutResult = Schema23.Struct({
|
|
2125
2349
|
fan_out: exports_child_orchestration_schema.FanOutState
|
|
2126
2350
|
}).annotate({ identifier: "Relay.Operation.CancelChildFanOutResult" });
|
|
2127
|
-
var InspectChildFanOutInput =
|
|
2351
|
+
var InspectChildFanOutInput = Schema23.Struct({
|
|
2128
2352
|
fan_out_id: exports_ids_schema.ChildFanOutId
|
|
2129
2353
|
}).annotate({ identifier: "Relay.Operation.InspectChildFanOutInput" });
|
|
2130
|
-
var InspectChildFanOutResult =
|
|
2131
|
-
fan_out:
|
|
2354
|
+
var InspectChildFanOutResult = Schema23.Struct({
|
|
2355
|
+
fan_out: Schema23.NullOr(exports_child_orchestration_schema.FanOutState)
|
|
2132
2356
|
}).annotate({ identifier: "Relay.Operation.InspectChildFanOutResult" });
|
|
2133
|
-
var ResolveToolApprovalInput =
|
|
2357
|
+
var ResolveToolApprovalInput = Schema23.Struct({
|
|
2134
2358
|
wait_id: exports_ids_schema.WaitId,
|
|
2135
|
-
approved:
|
|
2136
|
-
comment:
|
|
2359
|
+
approved: Schema23.Boolean,
|
|
2360
|
+
comment: Schema23.optionalKey(Schema23.String),
|
|
2137
2361
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
2138
2362
|
}).annotate({ identifier: "Relay.Operation.ResolveToolApprovalInput" });
|
|
2139
|
-
var PermissionAnswer =
|
|
2363
|
+
var PermissionAnswer = Schema23.Literals(["Approved", "Denied", "Always"]).annotate({
|
|
2140
2364
|
identifier: "Relay.Operation.PermissionAnswer"
|
|
2141
2365
|
});
|
|
2142
|
-
var ResolvePermissionInput =
|
|
2366
|
+
var ResolvePermissionInput = Schema23.Struct({
|
|
2143
2367
|
wait_id: exports_ids_schema.WaitId,
|
|
2144
2368
|
answer: PermissionAnswer,
|
|
2145
|
-
reason:
|
|
2369
|
+
reason: Schema23.optionalKey(Schema23.String),
|
|
2146
2370
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
2147
2371
|
}).annotate({ identifier: "Relay.Operation.ResolvePermissionInput" });
|
|
2148
|
-
var SubmitInboundEnvelopeInput =
|
|
2372
|
+
var SubmitInboundEnvelopeInput = Schema23.Struct({
|
|
2149
2373
|
envelope: exports_envelope_schema.SendInput,
|
|
2150
2374
|
wake: WakeInput
|
|
2151
2375
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeInput" });
|
|
2152
|
-
var SubmitInboundEnvelopeAccepted =
|
|
2376
|
+
var SubmitInboundEnvelopeAccepted = Schema23.Struct({
|
|
2153
2377
|
envelope: exports_envelope_schema.EnvelopeAccepted,
|
|
2154
2378
|
wake: WakeAccepted
|
|
2155
2379
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeAccepted" });
|
|
2156
|
-
var ClaimEnvelopeReadyInput =
|
|
2380
|
+
var ClaimEnvelopeReadyInput = Schema23.Struct({
|
|
2157
2381
|
route_type: exports_address_schema.RouteKind,
|
|
2158
|
-
route_key:
|
|
2382
|
+
route_key: Schema23.optionalKey(Schema23.String),
|
|
2159
2383
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
2160
2384
|
now: exports_shared_schema.TimestampMillis,
|
|
2161
2385
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
2162
2386
|
}).annotate({ identifier: "Relay.Operation.ClaimEnvelopeReadyInput" });
|
|
2163
|
-
var EnvelopeReadyLease =
|
|
2387
|
+
var EnvelopeReadyLease = Schema23.Struct({
|
|
2164
2388
|
ready: exports_envelope_schema.EnvelopeReady,
|
|
2165
2389
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
2166
2390
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
2167
2391
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyLease" });
|
|
2168
|
-
var AckEnvelopeReadyInput =
|
|
2392
|
+
var AckEnvelopeReadyInput = Schema23.Struct({
|
|
2169
2393
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
2170
2394
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
2171
2395
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
2172
2396
|
}).annotate({ identifier: "Relay.Operation.AckEnvelopeReadyInput" });
|
|
2173
|
-
var EnvelopeReadyAcked =
|
|
2397
|
+
var EnvelopeReadyAcked = Schema23.Struct({
|
|
2174
2398
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
2175
|
-
state:
|
|
2399
|
+
state: Schema23.Literal("acknowledged"),
|
|
2176
2400
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
2177
2401
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyAcked" });
|
|
2178
|
-
var ReleaseEnvelopeReadyInput =
|
|
2402
|
+
var ReleaseEnvelopeReadyInput = Schema23.Struct({
|
|
2179
2403
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
2180
2404
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
2181
2405
|
next_available_at: exports_shared_schema.TimestampMillis,
|
|
2182
|
-
error:
|
|
2406
|
+
error: Schema23.optionalKey(Schema23.String)
|
|
2183
2407
|
}).annotate({ identifier: "Relay.Operation.ReleaseEnvelopeReadyInput" });
|
|
2184
|
-
var EnvelopeReadyReleased =
|
|
2408
|
+
var EnvelopeReadyReleased = Schema23.Struct({
|
|
2185
2409
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
2186
|
-
state:
|
|
2410
|
+
state: Schema23.Literal("ready"),
|
|
2187
2411
|
next_available_at: exports_shared_schema.TimestampMillis
|
|
2188
2412
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyReleased" });
|
|
2189
|
-
var CreateScheduleInput =
|
|
2413
|
+
var CreateScheduleInput = Schema23.Struct({
|
|
2190
2414
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
2191
2415
|
kind: exports_schedule_schema.ScheduleKind,
|
|
2192
2416
|
target_kind: exports_schedule_schema.ScheduleTargetKind,
|
|
2193
|
-
address_id:
|
|
2194
|
-
wait_id:
|
|
2195
|
-
cron_expr:
|
|
2196
|
-
input:
|
|
2417
|
+
address_id: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2418
|
+
wait_id: Schema23.optionalKey(exports_ids_schema.WaitId),
|
|
2419
|
+
cron_expr: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2420
|
+
input: Schema23.optionalKey(Schema23.Array(exports_content_schema.Part)),
|
|
2197
2421
|
next_run_at: exports_shared_schema.TimestampMillis,
|
|
2198
|
-
idempotency_key:
|
|
2199
|
-
metadata:
|
|
2422
|
+
idempotency_key: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2423
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
2200
2424
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleInput" });
|
|
2201
|
-
var CreateScheduleResult =
|
|
2425
|
+
var CreateScheduleResult = Schema23.Struct({
|
|
2202
2426
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
2203
2427
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleResult" });
|
|
2204
|
-
var CancelScheduleInput =
|
|
2428
|
+
var CancelScheduleInput = Schema23.Struct({
|
|
2205
2429
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
2206
2430
|
cancelled_at: exports_shared_schema.TimestampMillis
|
|
2207
2431
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleInput" });
|
|
2208
|
-
var CancelScheduleResult =
|
|
2432
|
+
var CancelScheduleResult = Schema23.Struct({
|
|
2209
2433
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
2210
2434
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleResult" });
|
|
2211
|
-
var ListSchedulesInput =
|
|
2212
|
-
state:
|
|
2435
|
+
var ListSchedulesInput = Schema23.Struct({
|
|
2436
|
+
state: Schema23.optionalKey(exports_schedule_schema.ScheduleState)
|
|
2213
2437
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesInput" });
|
|
2214
|
-
var ListSchedulesResult =
|
|
2215
|
-
schedules:
|
|
2438
|
+
var ListSchedulesResult = Schema23.Struct({
|
|
2439
|
+
schedules: Schema23.Array(exports_schedule_schema.ScheduleRecord)
|
|
2216
2440
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesResult" });
|
|
2217
|
-
var ListExecutionsInput =
|
|
2218
|
-
root_address_id:
|
|
2219
|
-
status:
|
|
2220
|
-
limit:
|
|
2221
|
-
cursor:
|
|
2441
|
+
var ListExecutionsInput = Schema23.Struct({
|
|
2442
|
+
root_address_id: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2443
|
+
status: Schema23.optionalKey(exports_execution_schema.ExecutionStatus),
|
|
2444
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0))),
|
|
2445
|
+
cursor: Schema23.optionalKey(exports_pagination_schema.ExecutionCursor)
|
|
2222
2446
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsInput" });
|
|
2223
|
-
var SubscribeTopicInput =
|
|
2447
|
+
var SubscribeTopicInput = Schema23.Struct({
|
|
2224
2448
|
topic_address_id: exports_ids_schema.AddressId,
|
|
2225
2449
|
subscriber_execution_id: exports_ids_schema.ExecutionId,
|
|
2226
|
-
metadata:
|
|
2450
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata)
|
|
2227
2451
|
}).annotate({ identifier: "Relay.Operation.SubscribeTopicInput" });
|
|
2228
|
-
var TopicSubscription =
|
|
2452
|
+
var TopicSubscription = Schema23.Struct({
|
|
2229
2453
|
topic_address_id: exports_ids_schema.AddressId,
|
|
2230
2454
|
subscriber_execution_id: exports_ids_schema.ExecutionId,
|
|
2231
|
-
metadata:
|
|
2455
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata),
|
|
2232
2456
|
created_at: exports_shared_schema.TimestampMillis
|
|
2233
2457
|
}).annotate({ identifier: "Relay.Operation.TopicSubscription" });
|
|
2234
|
-
var PublishTopicInput =
|
|
2458
|
+
var PublishTopicInput = Schema23.Struct({
|
|
2235
2459
|
topic_address_id: exports_ids_schema.AddressId,
|
|
2236
2460
|
from: exports_ids_schema.AddressId,
|
|
2237
|
-
content:
|
|
2238
|
-
metadata:
|
|
2239
|
-
idempotency_key:
|
|
2461
|
+
content: Schema23.Array(exports_content_schema.Part),
|
|
2462
|
+
metadata: Schema23.optionalKey(exports_shared_schema.Metadata),
|
|
2463
|
+
idempotency_key: Schema23.optionalKey(exports_shared_schema.NonEmptyString)
|
|
2240
2464
|
}).annotate({ identifier: "Relay.Operation.PublishTopicInput" });
|
|
2241
|
-
var TopicPublishAccepted =
|
|
2465
|
+
var TopicPublishAccepted = Schema23.Struct({
|
|
2242
2466
|
envelope_id: exports_ids_schema.EnvelopeId,
|
|
2243
|
-
subscriber_count:
|
|
2467
|
+
subscriber_count: Schema23.Int.check(Schema23.isGreaterThanOrEqualTo(0))
|
|
2244
2468
|
}).annotate({ identifier: "Relay.Operation.TopicPublishAccepted" });
|
|
2245
|
-
var UnsubscribeTopicInput =
|
|
2469
|
+
var UnsubscribeTopicInput = Schema23.Struct({
|
|
2246
2470
|
topic_address_id: exports_ids_schema.AddressId,
|
|
2247
2471
|
subscriber_execution_id: exports_ids_schema.ExecutionId
|
|
2248
2472
|
}).annotate({ identifier: "Relay.Operation.UnsubscribeTopicInput" });
|
|
2249
|
-
var ListTopicSubscriptionsInput =
|
|
2250
|
-
topic_address_id:
|
|
2251
|
-
subscriber_execution_id:
|
|
2473
|
+
var ListTopicSubscriptionsInput = Schema23.Struct({
|
|
2474
|
+
topic_address_id: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2475
|
+
subscriber_execution_id: Schema23.optionalKey(exports_ids_schema.ExecutionId)
|
|
2252
2476
|
}).annotate({ identifier: "Relay.Operation.ListTopicSubscriptionsInput" });
|
|
2253
|
-
var ListInboxMessagesInput =
|
|
2477
|
+
var ListInboxMessagesInput = Schema23.Struct({
|
|
2254
2478
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2255
|
-
include_consumed:
|
|
2256
|
-
after_sequence:
|
|
2257
|
-
limit:
|
|
2479
|
+
include_consumed: Schema23.optionalKey(Schema23.Boolean),
|
|
2480
|
+
after_sequence: Schema23.optionalKey(exports_inbox_schema.MessageSequence),
|
|
2481
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
2258
2482
|
}).annotate({ identifier: "Relay.Operation.ListInboxMessagesInput" });
|
|
2259
|
-
var ConversationKind =
|
|
2483
|
+
var ConversationKind = Schema23.Literals(["user-agent", "agent-agent"]).annotate({
|
|
2260
2484
|
identifier: "Relay.Operation.ConversationKind"
|
|
2261
2485
|
});
|
|
2262
|
-
var ConversationSummary =
|
|
2486
|
+
var ConversationSummary = Schema23.Struct({
|
|
2263
2487
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2264
2488
|
root_address_id: exports_ids_schema.AddressId,
|
|
2265
|
-
session_id:
|
|
2489
|
+
session_id: Schema23.optionalKey(exports_ids_schema.SessionId),
|
|
2266
2490
|
status: exports_execution_schema.ExecutionStatus,
|
|
2267
2491
|
kind: ConversationKind,
|
|
2268
|
-
agent_id:
|
|
2492
|
+
agent_id: Schema23.optionalKey(exports_ids_schema.AgentId),
|
|
2269
2493
|
metadata: exports_shared_schema.Metadata,
|
|
2270
2494
|
created_at: exports_shared_schema.TimestampMillis,
|
|
2271
2495
|
updated_at: exports_shared_schema.TimestampMillis
|
|
2272
2496
|
}).annotate({ identifier: "Relay.Operation.ConversationSummary" });
|
|
2273
|
-
var ExecutionCursor2 =
|
|
2497
|
+
var ExecutionCursor2 = Schema23.Struct({
|
|
2274
2498
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2275
|
-
after_cursor:
|
|
2499
|
+
after_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString)
|
|
2276
2500
|
}).annotate({ identifier: "Relay.Operation.ExecutionCursor" });
|
|
2277
2501
|
|
|
2278
|
-
class EventLogCursorNotFound extends
|
|
2502
|
+
class EventLogCursorNotFound extends Schema23.TaggedErrorClass()("EventLogCursorNotFound", { execution_id: exports_ids_schema.ExecutionId, cursor: exports_shared_schema.NonEmptyString }) {
|
|
2279
2503
|
}
|
|
2280
|
-
var StreamSessionInput =
|
|
2504
|
+
var StreamSessionInput = Schema23.Struct({
|
|
2281
2505
|
session_id: exports_ids_schema.SessionId,
|
|
2282
|
-
resume:
|
|
2506
|
+
resume: Schema23.optionalKey(Schema23.Array(ExecutionCursor2))
|
|
2283
2507
|
}).annotate({ identifier: "Relay.Operation.StreamSessionInput" });
|
|
2284
|
-
var SessionStreamItem =
|
|
2285
|
-
|
|
2286
|
-
|
|
2508
|
+
var SessionStreamItem = Schema23.Union([
|
|
2509
|
+
Schema23.TaggedStruct("execution_joined", { execution: ConversationSummary }),
|
|
2510
|
+
Schema23.TaggedStruct("execution_event", { event: exports_execution_schema.ExecutionEvent })
|
|
2287
2511
|
]).annotate({ identifier: "Relay.Operation.SessionStreamItem" });
|
|
2288
|
-
var WatchExecutionsInput =
|
|
2289
|
-
root_address_id:
|
|
2290
|
-
session_id:
|
|
2291
|
-
status:
|
|
2292
|
-
limit:
|
|
2512
|
+
var WatchExecutionsInput = Schema23.Struct({
|
|
2513
|
+
root_address_id: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2514
|
+
session_id: Schema23.optionalKey(exports_ids_schema.SessionId),
|
|
2515
|
+
status: Schema23.optionalKey(exports_execution_schema.ExecutionStatus),
|
|
2516
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
2293
2517
|
}).annotate({ identifier: "Relay.Operation.WatchExecutionsInput" });
|
|
2294
|
-
var ExecutionListChange =
|
|
2295
|
-
|
|
2296
|
-
records:
|
|
2297
|
-
next_cursor:
|
|
2518
|
+
var ExecutionListChange = Schema23.Union([
|
|
2519
|
+
Schema23.TaggedStruct("snapshot", {
|
|
2520
|
+
records: Schema23.Array(ConversationSummary),
|
|
2521
|
+
next_cursor: Schema23.optionalKey(exports_pagination_schema.ExecutionCursor)
|
|
2298
2522
|
}),
|
|
2299
|
-
|
|
2523
|
+
Schema23.TaggedStruct("upsert", { record: ConversationSummary })
|
|
2300
2524
|
]).annotate({ identifier: "Relay.Operation.ExecutionListChange" });
|
|
2301
|
-
var ToolCallSummary =
|
|
2525
|
+
var ToolCallSummary = Schema23.Struct({
|
|
2302
2526
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
2303
2527
|
tool_name: exports_shared_schema.NonEmptyString,
|
|
2304
2528
|
input: exports_shared_schema.JsonValue,
|
|
2305
2529
|
metadata: exports_shared_schema.Metadata,
|
|
2306
2530
|
requested_at: exports_shared_schema.TimestampMillis
|
|
2307
2531
|
}).annotate({ identifier: "Relay.Operation.ToolCallSummary" });
|
|
2308
|
-
var ChildRunSummary =
|
|
2532
|
+
var ChildRunSummary = Schema23.Struct({
|
|
2309
2533
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
2310
2534
|
address_id: exports_ids_schema.AddressId,
|
|
2311
2535
|
status: exports_execution_schema.ExecutionStatus,
|
|
@@ -2313,117 +2537,132 @@ var ChildRunSummary = Schema22.Struct({
|
|
|
2313
2537
|
created_at: exports_shared_schema.TimestampMillis,
|
|
2314
2538
|
updated_at: exports_shared_schema.TimestampMillis
|
|
2315
2539
|
}).annotate({ identifier: "Relay.Operation.ChildRunSummary" });
|
|
2316
|
-
var
|
|
2540
|
+
var ChildRunEdge = Schema23.Struct({
|
|
2541
|
+
parent_execution_id: exports_ids_schema.ExecutionId,
|
|
2542
|
+
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
2543
|
+
address_id: exports_ids_schema.AddressId,
|
|
2544
|
+
depth: Schema23.Int.check(Schema23.isGreaterThan(0)),
|
|
2545
|
+
status: exports_execution_schema.ExecutionStatus,
|
|
2546
|
+
metadata: exports_shared_schema.Metadata,
|
|
2547
|
+
created_at: exports_shared_schema.TimestampMillis,
|
|
2548
|
+
updated_at: exports_shared_schema.TimestampMillis
|
|
2549
|
+
}).annotate({ identifier: "Relay.Operation.ChildRunEdge" });
|
|
2550
|
+
var ExecutionInspection = Schema23.Struct({
|
|
2317
2551
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2318
2552
|
status: exports_execution_schema.ExecutionStatus,
|
|
2319
|
-
waiting_on:
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2553
|
+
waiting_on: Schema23.Array(WaitView),
|
|
2554
|
+
waits: Schema23.Array(WaitView),
|
|
2555
|
+
pending_tool_calls: Schema23.Array(ToolCallSummary),
|
|
2556
|
+
tool_attempts: Schema23.Array(ToolAttempt),
|
|
2557
|
+
tool_invocations: Schema23.Array(ToolInvocation),
|
|
2558
|
+
child_runs: Schema23.Array(ChildRunSummary),
|
|
2559
|
+
child_tree: Schema23.Array(ChildRunEdge),
|
|
2560
|
+
fan_outs: Schema23.Array(exports_child_orchestration_schema.FanOutState),
|
|
2561
|
+
last_event_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString)
|
|
2323
2562
|
}).annotate({ identifier: "Relay.Operation.ExecutionInspection" });
|
|
2324
|
-
var ListExecutionsResult =
|
|
2325
|
-
records:
|
|
2326
|
-
next_cursor:
|
|
2563
|
+
var ListExecutionsResult = Schema23.Struct({
|
|
2564
|
+
records: Schema23.Array(ConversationSummary),
|
|
2565
|
+
next_cursor: Schema23.optionalKey(exports_pagination_schema.ExecutionCursor)
|
|
2327
2566
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsResult" });
|
|
2328
|
-
var ListSessionsInput =
|
|
2329
|
-
root_address_id:
|
|
2330
|
-
limit:
|
|
2331
|
-
cursor:
|
|
2567
|
+
var ListSessionsInput = Schema23.Struct({
|
|
2568
|
+
root_address_id: Schema23.optionalKey(exports_ids_schema.AddressId),
|
|
2569
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0))),
|
|
2570
|
+
cursor: Schema23.optionalKey(exports_pagination_schema.SessionCursor)
|
|
2332
2571
|
}).annotate({ identifier: "Relay.Operation.ListSessionsInput" });
|
|
2333
|
-
var SessionSummary =
|
|
2572
|
+
var SessionSummary = Schema23.Struct({
|
|
2334
2573
|
session_id: exports_ids_schema.SessionId,
|
|
2335
2574
|
root_address_id: exports_ids_schema.AddressId,
|
|
2336
2575
|
metadata: exports_shared_schema.Metadata,
|
|
2337
2576
|
created_at: exports_shared_schema.TimestampMillis,
|
|
2338
2577
|
updated_at: exports_shared_schema.TimestampMillis
|
|
2339
2578
|
}).annotate({ identifier: "Relay.Operation.SessionSummary" });
|
|
2340
|
-
var ListSessionsResult =
|
|
2341
|
-
records:
|
|
2342
|
-
next_cursor:
|
|
2579
|
+
var ListSessionsResult = Schema23.Struct({
|
|
2580
|
+
records: Schema23.Array(SessionSummary),
|
|
2581
|
+
next_cursor: Schema23.optionalKey(exports_pagination_schema.SessionCursor)
|
|
2343
2582
|
}).annotate({ identifier: "Relay.Operation.ListSessionsResult" });
|
|
2344
|
-
var GetSessionInput =
|
|
2583
|
+
var GetSessionInput = Schema23.Struct({
|
|
2345
2584
|
session_id: exports_ids_schema.SessionId,
|
|
2346
|
-
limit:
|
|
2347
|
-
cursor:
|
|
2585
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0))),
|
|
2586
|
+
cursor: Schema23.optionalKey(exports_pagination_schema.ExecutionCursor)
|
|
2348
2587
|
}).annotate({ identifier: "Relay.Operation.GetSessionInput" });
|
|
2349
|
-
var GetSessionResult =
|
|
2588
|
+
var GetSessionResult = Schema23.Struct({
|
|
2350
2589
|
session: SessionSummary,
|
|
2351
|
-
executions:
|
|
2352
|
-
next_cursor:
|
|
2590
|
+
executions: Schema23.Array(ConversationSummary),
|
|
2591
|
+
next_cursor: Schema23.optionalKey(exports_pagination_schema.ExecutionCursor)
|
|
2353
2592
|
}).annotate({ identifier: "Relay.Operation.GetSessionResult" });
|
|
2354
|
-
var ReplayExecutionInput =
|
|
2593
|
+
var ReplayExecutionInput = Schema23.Struct({
|
|
2355
2594
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2356
|
-
after_cursor:
|
|
2357
|
-
limit:
|
|
2595
|
+
after_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2596
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0)))
|
|
2358
2597
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionInput" });
|
|
2359
|
-
var ReplayExecutionResult =
|
|
2360
|
-
events:
|
|
2598
|
+
var ReplayExecutionResult = Schema23.Struct({
|
|
2599
|
+
events: Schema23.Array(exports_execution_schema.ExecutionEvent)
|
|
2361
2600
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionResult" });
|
|
2362
|
-
var ExecutionEventPageDirection =
|
|
2601
|
+
var ExecutionEventPageDirection = Schema23.Literals(["forward", "backward"]).annotate({
|
|
2363
2602
|
identifier: "Relay.Operation.ExecutionEventPageDirection"
|
|
2364
2603
|
});
|
|
2365
|
-
var PageExecutionEventsInput =
|
|
2604
|
+
var PageExecutionEventsInput = Schema23.Struct({
|
|
2366
2605
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2367
2606
|
direction: ExecutionEventPageDirection,
|
|
2368
|
-
after_cursor:
|
|
2369
|
-
before_cursor:
|
|
2370
|
-
limit:
|
|
2371
|
-
}).check(
|
|
2607
|
+
after_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2608
|
+
before_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2609
|
+
limit: Schema23.optionalKey(Schema23.Int.check(Schema23.isGreaterThan(0), Schema23.isLessThanOrEqualTo(1000)))
|
|
2610
|
+
}).check(Schema23.makeFilter((input) => {
|
|
2372
2611
|
if (input.direction === "forward") {
|
|
2373
2612
|
return input.before_cursor === undefined ? undefined : { path: ["before_cursor"], issue: "forward pages accept only after_cursor" };
|
|
2374
2613
|
}
|
|
2375
2614
|
return input.after_cursor === undefined ? undefined : { path: ["after_cursor"], issue: "backward pages accept only before_cursor" };
|
|
2376
2615
|
})).annotate({ identifier: "Relay.Operation.PageExecutionEventsInput" });
|
|
2377
|
-
var PageExecutionEventsResult =
|
|
2378
|
-
events:
|
|
2379
|
-
has_more:
|
|
2380
|
-
oldest_cursor:
|
|
2381
|
-
newest_cursor:
|
|
2616
|
+
var PageExecutionEventsResult = Schema23.Struct({
|
|
2617
|
+
events: Schema23.Array(exports_execution_schema.ExecutionEvent),
|
|
2618
|
+
has_more: Schema23.Boolean,
|
|
2619
|
+
oldest_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString),
|
|
2620
|
+
newest_cursor: Schema23.optionalKey(exports_shared_schema.NonEmptyString)
|
|
2382
2621
|
}).annotate({ identifier: "Relay.Operation.PageExecutionEventsResult" });
|
|
2383
|
-
var RunnerSummary =
|
|
2384
|
-
address:
|
|
2385
|
-
healthy:
|
|
2622
|
+
var RunnerSummary = Schema23.Struct({
|
|
2623
|
+
address: Schema23.String,
|
|
2624
|
+
healthy: Schema23.Boolean,
|
|
2386
2625
|
last_heartbeat: exports_shared_schema.TimestampMillis,
|
|
2387
|
-
owned_shards:
|
|
2626
|
+
owned_shards: Schema23.Int
|
|
2388
2627
|
}).annotate({ identifier: "Relay.Operation.RunnerSummary" });
|
|
2389
|
-
var ListRunnersResult =
|
|
2390
|
-
runners:
|
|
2391
|
-
total_shards:
|
|
2628
|
+
var ListRunnersResult = Schema23.Struct({
|
|
2629
|
+
runners: Schema23.Array(RunnerSummary),
|
|
2630
|
+
total_shards: Schema23.Int
|
|
2392
2631
|
}).annotate({ identifier: "Relay.Operation.ListRunnersResult" });
|
|
2393
|
-
var RouteExecutionResult =
|
|
2632
|
+
var RouteExecutionResult = Schema23.Struct({
|
|
2394
2633
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2395
|
-
shard:
|
|
2396
|
-
runner_address:
|
|
2397
|
-
owned:
|
|
2634
|
+
shard: Schema23.String,
|
|
2635
|
+
runner_address: Schema23.NullOr(Schema23.String),
|
|
2636
|
+
owned: Schema23.Boolean
|
|
2398
2637
|
}).annotate({ identifier: "Relay.Operation.RouteExecutionResult" });
|
|
2399
2638
|
// src/client-public.ts
|
|
2400
|
-
import { Context, Effect, Schema as
|
|
2639
|
+
import { Context, Effect, Schema as Schema24, Stream } from "effect";
|
|
2401
2640
|
|
|
2402
|
-
class ClientError extends
|
|
2403
|
-
message:
|
|
2641
|
+
class ClientError extends Schema24.TaggedErrorClass()("ClientError", {
|
|
2642
|
+
message: Schema24.String
|
|
2404
2643
|
}) {
|
|
2405
2644
|
}
|
|
2406
2645
|
|
|
2407
|
-
class ExecutionNotFound extends
|
|
2646
|
+
class ExecutionNotFound extends Schema24.TaggedErrorClass()("ExecutionNotFound", {
|
|
2408
2647
|
execution_id: exports_ids_schema.ExecutionId
|
|
2409
2648
|
}) {
|
|
2410
2649
|
}
|
|
2411
2650
|
|
|
2412
|
-
class ResidentNamespaceReserved extends
|
|
2651
|
+
class ResidentNamespaceReserved extends Schema24.TaggedErrorClass()("ResidentNamespaceReserved", { id: Schema24.String, message: Schema24.String }) {
|
|
2413
2652
|
}
|
|
2414
2653
|
|
|
2415
|
-
class WaitKindMismatch extends
|
|
2654
|
+
class WaitKindMismatch extends Schema24.TaggedErrorClass()("WaitKindMismatch", {
|
|
2416
2655
|
wait_id: exports_ids_schema.WaitId,
|
|
2417
|
-
expected:
|
|
2418
|
-
actual:
|
|
2419
|
-
message:
|
|
2656
|
+
expected: Schema24.String,
|
|
2657
|
+
actual: Schema24.String,
|
|
2658
|
+
message: Schema24.String
|
|
2420
2659
|
}) {
|
|
2421
2660
|
}
|
|
2422
2661
|
|
|
2423
2662
|
class Service extends Context.Service()("@relayfx/sdk/client-public/Service") {
|
|
2424
2663
|
}
|
|
2425
2664
|
var followTerminalStatus = (type) => type === "execution.completed" ? "completed" : type === "execution.failed" ? "failed" : type === "execution.cancelled" ? "cancelled" : undefined;
|
|
2426
|
-
var followReconnectDelayMillis = (
|
|
2665
|
+
var followReconnectDelayMillis = (attempt2) => Math.min(100 * 2 ** (attempt2 - 1), 5000);
|
|
2427
2666
|
var followStopped = (reason, cursor) => ({
|
|
2428
2667
|
_tag: "stopped",
|
|
2429
2668
|
reason,
|
|
@@ -2497,10 +2736,10 @@ var followExecutionFrom = (dependencies) => (input) => {
|
|
|
2497
2736
|
};
|
|
2498
2737
|
|
|
2499
2738
|
// ../runtime/src/presence/presence-contract.ts
|
|
2500
|
-
import { Context as Context2, Schema as
|
|
2739
|
+
import { Context as Context2, Schema as Schema25 } from "effect";
|
|
2501
2740
|
|
|
2502
|
-
class PresenceError extends
|
|
2503
|
-
message:
|
|
2741
|
+
class PresenceError extends Schema25.TaggedErrorClass()("PresenceError", {
|
|
2742
|
+
message: Schema25.String
|
|
2504
2743
|
}) {
|
|
2505
2744
|
}
|
|
2506
2745
|
|