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