@relayfx/sdk 0.0.48 → 0.0.50
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 +2054 -576
- package/dist/index.js +2884 -860
- package/dist/migrations/20260709214238_faithful_black_widow/migration.sql +53 -0
- package/dist/migrations/20260709214238_faithful_black_widow/snapshot.json +5426 -0
- package/dist/migrations/20260709220016_fearless_aaron_stack/migration.sql +2 -0
- package/dist/migrations/20260709220016_fearless_aaron_stack/snapshot.json +5426 -0
- package/dist/migrations/mysql/0002_durable_tool_placement.sql +75 -0
- package/dist/migrations/pg/20260709214238_faithful_black_widow/migration.sql +53 -0
- package/dist/migrations/pg/20260709214238_faithful_black_widow/snapshot.json +5426 -0
- package/dist/migrations/pg/20260709220016_fearless_aaron_stack/migration.sql +2 -0
- package/dist/migrations/pg/20260709220016_fearless_aaron_stack/snapshot.json +5426 -0
- package/dist/migrations/sqlite/0002_durable_tool_placement.sql +71 -0
- package/dist/types/relay/client.d.ts +27 -6
- package/dist/types/relay/index.d.ts +1 -0
- package/dist/types/relay/operation.d.ts +525 -53
- package/dist/types/relay/tool-worker.d.ts +19 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +69 -54
- package/dist/types/runtime/agent/relay-compaction.d.ts +1 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +10 -477
- package/dist/types/runtime/execution/event-log-service.d.ts +6 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +18 -15
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +17 -1
- package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +13 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +146 -114
- package/dist/types/schema/agent-schema.d.ts +431 -320
- package/dist/types/schema/execution-schema.d.ts +69 -53
- package/dist/types/schema/ids-schema.d.ts +4 -0
- package/dist/types/schema/tool-schema.d.ts +29 -0
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +6 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +6 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +386 -7
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +160 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
+
import { Definition } from "./agent-schema";
|
|
2
3
|
export declare const ExecutionStatus: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
3
4
|
export type ExecutionStatus = typeof ExecutionStatus.Type;
|
|
4
5
|
export declare const Execution: Schema.Struct<{
|
|
@@ -16,61 +17,76 @@ export declare const Execution: Schema.Struct<{
|
|
|
16
17
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
17
18
|
}>;
|
|
18
19
|
readonly agent_revision: Schema.optionalKey<Schema.Int>;
|
|
19
|
-
readonly agent_snapshot: Schema.optionalKey<Schema.
|
|
20
|
-
readonly name:
|
|
21
|
-
readonly
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
readonly
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
readonly
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
20
|
+
readonly agent_snapshot: Schema.optionalKey<Schema.Codec<Definition, {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly permissions: readonly {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly value: Schema.Json;
|
|
25
|
+
readonly metadata?: {
|
|
26
|
+
readonly [x: string]: Schema.Json;
|
|
27
|
+
};
|
|
28
|
+
}[];
|
|
29
|
+
readonly model: {
|
|
30
|
+
readonly provider: string;
|
|
31
|
+
readonly model: string;
|
|
32
|
+
readonly metadata?: {
|
|
33
|
+
readonly [x: string]: Schema.Json;
|
|
34
|
+
};
|
|
35
|
+
readonly registration_key?: string;
|
|
36
|
+
readonly request_options?: {
|
|
37
|
+
readonly [x: string]: Schema.Json;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly tool_names: readonly string[];
|
|
41
|
+
readonly metadata?: {
|
|
42
|
+
readonly [x: string]: Schema.Json;
|
|
43
|
+
};
|
|
44
|
+
readonly instructions?: string;
|
|
45
|
+
readonly output_schema_ref?: string;
|
|
46
|
+
readonly skill_definition_ids?: readonly string[];
|
|
47
|
+
readonly permission_rules?: {
|
|
48
|
+
readonly rules: readonly {
|
|
49
|
+
readonly pattern: string;
|
|
50
|
+
readonly level: "allow" | "deny" | "ask";
|
|
51
|
+
readonly reason?: string;
|
|
52
|
+
}[];
|
|
53
|
+
readonly fallback?: "allow" | "deny" | "ask";
|
|
54
|
+
};
|
|
55
|
+
readonly turn_policy?: import("./agent-schema").TurnPolicySnapshot;
|
|
56
|
+
readonly max_tool_turns?: number;
|
|
57
|
+
readonly max_wait_turns?: number;
|
|
58
|
+
readonly token_budget?: number;
|
|
59
|
+
readonly child_run_presets?: {
|
|
60
|
+
readonly [x: string]: {
|
|
61
|
+
readonly metadata?: {
|
|
62
|
+
readonly [x: string]: Schema.Json;
|
|
63
|
+
};
|
|
64
|
+
readonly permissions?: readonly string[];
|
|
65
|
+
readonly model?: {
|
|
66
|
+
readonly provider: string;
|
|
67
|
+
readonly model: string;
|
|
68
|
+
readonly metadata?: {
|
|
69
|
+
readonly [x: string]: Schema.Json;
|
|
70
|
+
};
|
|
71
|
+
readonly registration_key?: string;
|
|
72
|
+
readonly request_options?: {
|
|
73
|
+
readonly [x: string]: Schema.Json;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly instructions?: string;
|
|
77
|
+
readonly tool_names?: readonly string[];
|
|
78
|
+
readonly workspace_policy?: {
|
|
79
|
+
readonly mode: "share" | "fork";
|
|
80
|
+
readonly fallback?: "fail" | "fresh";
|
|
81
|
+
};
|
|
82
|
+
readonly output_schema_ref?: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
|
|
68
86
|
readonly name: Schema.String;
|
|
69
87
|
readonly preset_name: Schema.String;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
73
|
-
}>>;
|
|
88
|
+
}, "Encoded">[];
|
|
89
|
+
}, never, never>>;
|
|
74
90
|
readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
75
91
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
76
92
|
readonly created_at: Schema.Int;
|
|
@@ -68,6 +68,10 @@ export declare const ToolCallId: Schema.brand<Schema.String, "Relay.ToolCallId">
|
|
|
68
68
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
69
69
|
};
|
|
70
70
|
export type ToolCallId = typeof ToolCallId.Type;
|
|
71
|
+
export declare const ToolAttemptId: Schema.brand<Schema.String, "Relay.ToolAttemptId"> & {
|
|
72
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolAttemptId">;
|
|
73
|
+
};
|
|
74
|
+
export type ToolAttemptId = typeof ToolAttemptId.Type;
|
|
71
75
|
export declare const WaitId: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
72
76
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
73
77
|
};
|
|
@@ -13,6 +13,34 @@ export declare const RuntimeRequirement: Schema.Union<readonly [Schema.Struct<{
|
|
|
13
13
|
}>]>;
|
|
14
14
|
export interface RuntimeRequirement extends Schema.Schema.Type<typeof RuntimeRequirement> {
|
|
15
15
|
}
|
|
16
|
+
export declare const PlacementKey: Schema.String;
|
|
17
|
+
export type PlacementKey = typeof PlacementKey.Type;
|
|
18
|
+
export declare const WorkerId: Schema.String;
|
|
19
|
+
export type WorkerId = typeof WorkerId.Type;
|
|
20
|
+
export declare const Placement: Schema.Union<readonly [Schema.Struct<{
|
|
21
|
+
readonly kind: Schema.Literal<"local">;
|
|
22
|
+
}>, Schema.Struct<{
|
|
23
|
+
readonly kind: Schema.Literal<"client">;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly kind: Schema.Literal<"remote">;
|
|
26
|
+
readonly queue: Schema.String;
|
|
27
|
+
}>, Schema.Struct<{
|
|
28
|
+
readonly kind: Schema.Literal<"mcp">;
|
|
29
|
+
readonly server_id: Schema.String;
|
|
30
|
+
}>]>;
|
|
31
|
+
export type Placement = typeof Placement.Type;
|
|
32
|
+
export declare const ExternalOutcome: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly kind: Schema.Literal<"success">;
|
|
34
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
35
|
+
}>, Schema.Struct<{
|
|
36
|
+
readonly kind: Schema.Literal<"failure">;
|
|
37
|
+
readonly message: Schema.String;
|
|
38
|
+
}>]>;
|
|
39
|
+
export type ExternalOutcome = typeof ExternalOutcome.Type;
|
|
40
|
+
export declare const CallState: Schema.Literals<readonly ["requested", "waiting", "running", "submitted", "completed", "failed"]>;
|
|
41
|
+
export type CallState = typeof CallState.Type;
|
|
42
|
+
export declare const AttemptState: Schema.Literals<readonly ["running", "completed", "failed", "released", "expired", "abandoned"]>;
|
|
43
|
+
export type AttemptState = typeof AttemptState.Type;
|
|
16
44
|
export declare const Definition: Schema.Struct<{
|
|
17
45
|
readonly name: Schema.String;
|
|
18
46
|
readonly description: Schema.String;
|
|
@@ -53,3 +81,4 @@ export declare const Result: Schema.Struct<{
|
|
|
53
81
|
export interface Result extends Schema.Schema.Type<typeof Result> {
|
|
54
82
|
}
|
|
55
83
|
export declare const parametersSchema: (inputSchema: JsonValue) => Schema.Top;
|
|
84
|
+
export declare const resultSchema: (outputSchema: JsonValue) => Schema.Codec<unknown>;
|
|
@@ -117,6 +117,10 @@ export interface ListWaitsInput {
|
|
|
117
117
|
readonly executionId?: Ids.ExecutionId;
|
|
118
118
|
readonly limit?: number;
|
|
119
119
|
}
|
|
120
|
+
export interface ListAllWaitsInput {
|
|
121
|
+
readonly state?: WaitState;
|
|
122
|
+
readonly executionId?: Ids.ExecutionId;
|
|
123
|
+
}
|
|
120
124
|
export interface CompleteWaitInput {
|
|
121
125
|
readonly waitId: Ids.WaitId;
|
|
122
126
|
readonly state: Exclude<WaitState, "open">;
|
|
@@ -133,6 +137,7 @@ export interface Interface {
|
|
|
133
137
|
readonly getWait: (id: Ids.WaitId) => Effect.Effect<WaitRecord | undefined, EnvelopeRepositoryError>;
|
|
134
138
|
readonly createWait: (input: CreateWaitInput) => Effect.Effect<WaitRecord, EnvelopeRepositoryError>;
|
|
135
139
|
readonly listWaits: (input: ListWaitsInput) => Effect.Effect<ReadonlyArray<WaitRecord>, EnvelopeRepositoryError>;
|
|
140
|
+
readonly listAllWaits: (input: ListAllWaitsInput) => Effect.Effect<ReadonlyArray<WaitRecord>, EnvelopeRepositoryError>;
|
|
136
141
|
readonly claimReady: (input: ClaimReadyInput) => Effect.Effect<EnvelopeReadyRecord | undefined, EnvelopeRepositoryError>;
|
|
137
142
|
readonly releaseReady: (input: ReleaseReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch | EnvelopeRepositoryError>;
|
|
138
143
|
readonly ackReady: (input: AckReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch | EnvelopeRepositoryError>;
|
|
@@ -190,6 +195,7 @@ export declare const getEnvelope: (id: string & import("effect/Brand").Brand<"Re
|
|
|
190
195
|
export declare const getWait: (id: string & import("effect/Brand").Brand<"Relay.WaitId">) => Effect.Effect<WaitRecord | undefined, EnvelopeRepositoryError, Service>;
|
|
191
196
|
export declare const createWait: (input: CreateWaitInput) => Effect.Effect<WaitRecord, EnvelopeRepositoryError, Service>;
|
|
192
197
|
export declare const listWaits: (input: ListWaitsInput) => Effect.Effect<readonly WaitRecord[], EnvelopeRepositoryError, Service>;
|
|
198
|
+
export declare const listAllWaits: (input: ListAllWaitsInput) => Effect.Effect<readonly WaitRecord[], EnvelopeRepositoryError, Service>;
|
|
193
199
|
export declare const claimReady: (input: ClaimReadyInput) => Effect.Effect<EnvelopeReadyRecord | undefined, EnvelopeRepositoryError, Service>;
|
|
194
200
|
export declare const releaseReady: (input: ReleaseReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeRepositoryError | EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch, Service>;
|
|
195
201
|
export declare const ackReady: (input: AckReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeRepositoryError | EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch, Service>;
|
|
@@ -48,6 +48,10 @@ export interface FindByCursorInput {
|
|
|
48
48
|
readonly executionId: Ids.ExecutionId;
|
|
49
49
|
readonly cursor: string;
|
|
50
50
|
}
|
|
51
|
+
export interface FindBySequenceInput {
|
|
52
|
+
readonly executionId: Ids.ExecutionId;
|
|
53
|
+
readonly sequence: Execution.ExecutionEventSequence;
|
|
54
|
+
}
|
|
51
55
|
export interface FindFirstByTypeAfterSequenceInput {
|
|
52
56
|
readonly executionId: Ids.ExecutionId;
|
|
53
57
|
readonly type: Execution.ExecutionEventType;
|
|
@@ -63,6 +67,7 @@ export interface Interface {
|
|
|
63
67
|
readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, ExecutionEventCursorNotFound | ExecutionEventRepositoryError>;
|
|
64
68
|
readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
|
|
65
69
|
readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
|
|
70
|
+
readonly findBySequence: (input: FindBySequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
|
|
66
71
|
readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
|
|
67
72
|
readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, ExecutionEventRepositoryError>;
|
|
68
73
|
readonly sumUsage: (executionId: Ids.ExecutionId) => Effect.Effect<number, ExecutionEventRepositoryError>;
|
|
@@ -92,6 +97,7 @@ export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<
|
|
|
92
97
|
export declare const list: (input: ListInput) => Effect.Effect<readonly Execution.ExecutionEvent[], ExecutionEventCursorNotFound | ExecutionEventRepositoryError, Service>;
|
|
93
98
|
export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
|
|
94
99
|
export declare const findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
|
|
100
|
+
export declare const findBySequence: (input: FindBySequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
|
|
95
101
|
export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
|
|
96
102
|
export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, ExecutionEventRepositoryError, Service>;
|
|
97
103
|
export declare const sumUsage: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number, ExecutionEventRepositoryError, Service>;
|