@relayfx/sdk 0.0.6 → 0.0.7
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/index.js +7437 -3239
- package/dist/migrations/20260705003847_nervous_banshee/migration.sql +11 -0
- package/dist/migrations/20260705003847_nervous_banshee/snapshot.json +2954 -0
- package/dist/migrations/20260705012626_common_stryfe/migration.sql +31 -0
- package/dist/migrations/20260705012626_common_stryfe/snapshot.json +3378 -0
- package/dist/migrations/20260705015420_sweet_captain_marvel/migration.sql +10 -0
- package/dist/migrations/20260705015420_sweet_captain_marvel/snapshot.json +3485 -0
- package/dist/migrations/20260705023041_chunky_scalphunter/migration.sql +22 -0
- package/dist/migrations/20260705023041_chunky_scalphunter/snapshot.json +3753 -0
- package/dist/migrations/20260705030344_short_patriot/migration.sql +11 -0
- package/dist/migrations/20260705030344_short_patriot/snapshot.json +3873 -0
- package/dist/migrations/20260705045546_heavy_ben_grimm/migration.sql +30 -0
- package/dist/migrations/20260705045546_heavy_ben_grimm/snapshot.json +4193 -0
- package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +45 -0
- package/dist/types/ai/index.d.ts +1 -0
- package/dist/types/relay/client.d.ts +20 -4
- package/dist/types/relay/index.d.ts +3 -3
- package/dist/types/relay/operation.d.ts +242 -1
- package/dist/types/runtime/address/address-resolution-service.d.ts +15 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +39 -5
- package/dist/types/runtime/agent/relay-approvals.d.ts +15 -3
- package/dist/types/runtime/agent/relay-compaction.d.ts +22 -0
- package/dist/types/runtime/agent/relay-instructions.d.ts +22 -0
- package/dist/types/runtime/agent/relay-permissions.d.ts +25 -0
- package/dist/types/runtime/agent/relay-steering.d.ts +17 -0
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +3 -0
- package/dist/types/runtime/agent/relay-tool-output.d.ts +7 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +209 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +101 -2
- package/dist/types/runtime/execution/event-log-service.d.ts +6 -0
- package/dist/types/runtime/execution/execution-service.d.ts +1 -0
- package/dist/types/runtime/index.d.ts +9 -0
- package/dist/types/runtime/memory/memory-service.d.ts +20 -0
- package/dist/types/runtime/model/embedding-model-service.d.ts +68 -0
- package/dist/types/runtime/model/model-call-policy.d.ts +30 -11
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +41 -21
- package/dist/types/runtime/schedule/scheduler-service.d.ts +4 -4
- package/dist/types/runtime/session/session-store-service.d.ts +14 -0
- package/dist/types/runtime/skill/skill-registry-service.d.ts +44 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +5 -0
- package/dist/types/runtime/wait/wait-signal.d.ts +2 -1
- package/dist/types/runtime/workflow/execution-workflow.d.ts +73 -4
- package/dist/types/schema/agent-schema.d.ts +130 -0
- package/dist/types/schema/content-schema.d.ts +12 -0
- package/dist/types/schema/envelope-schema.d.ts +12 -0
- package/dist/types/schema/execution-schema.d.ts +32 -2
- package/dist/types/schema/ids-schema.d.ts +16 -0
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/schedule-schema.d.ts +6 -0
- package/dist/types/schema/skill-schema.d.ts +260 -0
- package/dist/types/schema/tool-schema.d.ts +2 -0
- package/dist/types/store-sql/child/child-execution-repository.d.ts +1 -0
- package/dist/types/store-sql/compaction/compaction-repository.d.ts +37 -0
- package/dist/types/store-sql/execution/execution-repository.d.ts +3 -0
- package/dist/types/store-sql/index.d.ts +7 -0
- package/dist/types/store-sql/memory/memory-repository.d.ts +50 -0
- package/dist/types/store-sql/permission/permission-rule-repository.d.ts +37 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +1039 -8
- package/dist/types/store-sql/session/context-epoch-repository.d.ts +33 -0
- package/dist/types/store-sql/session/session-repository.d.ts +138 -0
- package/dist/types/store-sql/skill/skill-definition-repository.d.ts +71 -0
- package/dist/types/store-sql/steering/steering-repository.d.ts +59 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExecutionRepository } from "../../store-sql/index";
|
|
1
|
+
import type { ChildExecutionRepository, ExecutionRepository } from "../../store-sql/index";
|
|
2
2
|
import { Entity } from "effect/unstable/cluster";
|
|
3
3
|
import { Rpc } from "effect/unstable/rpc";
|
|
4
4
|
import type { WorkflowEngine } from "effect/unstable/workflow";
|
|
@@ -14,25 +14,32 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
14
14
|
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
15
15
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
16
16
|
};
|
|
17
|
+
readonly session_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SessionId"> & {
|
|
18
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
19
|
+
}>;
|
|
17
20
|
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
18
21
|
readonly type: Schema.Literal<"text">;
|
|
19
22
|
readonly text: Schema.String;
|
|
23
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
20
24
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
21
25
|
}>, Schema.Struct<{
|
|
22
26
|
readonly type: Schema.Literal<"structured">;
|
|
23
27
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
24
28
|
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
29
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
25
30
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
31
|
}>, Schema.Struct<{
|
|
27
32
|
readonly type: Schema.Literal<"blob-reference">;
|
|
28
33
|
readonly uri: Schema.String;
|
|
29
34
|
readonly media_type: Schema.String;
|
|
30
35
|
readonly filename: Schema.optionalKey<Schema.String>;
|
|
36
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
31
37
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
32
38
|
}>, Schema.Struct<{
|
|
33
39
|
readonly type: Schema.Literal<"artifact-reference">;
|
|
34
40
|
readonly artifact_id: Schema.String;
|
|
35
41
|
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
42
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
36
43
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
37
44
|
}>, Schema.Struct<{
|
|
38
45
|
readonly type: Schema.Literal<"tool-call">;
|
|
@@ -44,6 +51,7 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
44
51
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
45
52
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
46
53
|
}>;
|
|
54
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
47
55
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
48
56
|
}>, Schema.Struct<{
|
|
49
57
|
readonly type: Schema.Literal<"tool-result">;
|
|
@@ -55,6 +63,7 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
55
63
|
readonly error: Schema.optionalKey<Schema.String>;
|
|
56
64
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
57
65
|
}>;
|
|
66
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
58
67
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
59
68
|
}>]>>>;
|
|
60
69
|
readonly event_sequence: Schema.Int;
|
|
@@ -80,6 +89,17 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
80
89
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
81
90
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
82
91
|
}>>;
|
|
92
|
+
readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
|
|
93
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
|
|
94
|
+
}>>;
|
|
95
|
+
readonly permission_rules: Schema.optionalKey<Schema.Struct<{
|
|
96
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
97
|
+
readonly pattern: Schema.String;
|
|
98
|
+
readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
99
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
100
|
+
}>>;
|
|
101
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
102
|
+
}>>;
|
|
83
103
|
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
84
104
|
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
85
105
|
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
@@ -101,12 +121,25 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
101
121
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
102
122
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
103
123
|
}>>>;
|
|
124
|
+
readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
125
|
+
readonly name: Schema.String;
|
|
126
|
+
readonly preset_name: Schema.String;
|
|
127
|
+
}>>>;
|
|
104
128
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
105
129
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
106
130
|
}>>;
|
|
107
131
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
108
132
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
109
133
|
}>;
|
|
134
|
+
readonly resume_tool_call: Schema.optionalKey<Schema.Struct<{
|
|
135
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
136
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
137
|
+
};
|
|
138
|
+
readonly name: Schema.String;
|
|
139
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
140
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
141
|
+
}>>;
|
|
142
|
+
readonly workflow_generation: Schema.optionalKey<Schema.Int>;
|
|
110
143
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
111
144
|
}>, Schema.Struct<{
|
|
112
145
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
@@ -146,25 +179,32 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
146
179
|
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
147
180
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
148
181
|
};
|
|
182
|
+
readonly session_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SessionId"> & {
|
|
183
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
184
|
+
}>;
|
|
149
185
|
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
150
186
|
readonly type: Schema.Literal<"text">;
|
|
151
187
|
readonly text: Schema.String;
|
|
188
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
152
189
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
153
190
|
}>, Schema.Struct<{
|
|
154
191
|
readonly type: Schema.Literal<"structured">;
|
|
155
192
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
156
193
|
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
194
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
157
195
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
158
196
|
}>, Schema.Struct<{
|
|
159
197
|
readonly type: Schema.Literal<"blob-reference">;
|
|
160
198
|
readonly uri: Schema.String;
|
|
161
199
|
readonly media_type: Schema.String;
|
|
162
200
|
readonly filename: Schema.optionalKey<Schema.String>;
|
|
201
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
163
202
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
164
203
|
}>, Schema.Struct<{
|
|
165
204
|
readonly type: Schema.Literal<"artifact-reference">;
|
|
166
205
|
readonly artifact_id: Schema.String;
|
|
167
206
|
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
207
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
168
208
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
169
209
|
}>, Schema.Struct<{
|
|
170
210
|
readonly type: Schema.Literal<"tool-call">;
|
|
@@ -176,6 +216,7 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
176
216
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
177
217
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
178
218
|
}>;
|
|
219
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
179
220
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
180
221
|
}>, Schema.Struct<{
|
|
181
222
|
readonly type: Schema.Literal<"tool-result">;
|
|
@@ -187,6 +228,7 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
187
228
|
readonly error: Schema.optionalKey<Schema.String>;
|
|
188
229
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
189
230
|
}>;
|
|
231
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
190
232
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
191
233
|
}>]>>>;
|
|
192
234
|
readonly event_sequence: Schema.Int;
|
|
@@ -212,6 +254,17 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
212
254
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
213
255
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
214
256
|
}>>;
|
|
257
|
+
readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
|
|
258
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
|
|
259
|
+
}>>;
|
|
260
|
+
readonly permission_rules: Schema.optionalKey<Schema.Struct<{
|
|
261
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
262
|
+
readonly pattern: Schema.String;
|
|
263
|
+
readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
264
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
265
|
+
}>>;
|
|
266
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
267
|
+
}>>;
|
|
215
268
|
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
216
269
|
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
217
270
|
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
@@ -233,12 +286,25 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
233
286
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
234
287
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
235
288
|
}>>>;
|
|
289
|
+
readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
290
|
+
readonly name: Schema.String;
|
|
291
|
+
readonly preset_name: Schema.String;
|
|
292
|
+
}>>>;
|
|
236
293
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
237
294
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
238
295
|
}>>;
|
|
239
296
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
240
297
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
241
298
|
}>;
|
|
299
|
+
readonly resume_tool_call: Schema.optionalKey<Schema.Struct<{
|
|
300
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
301
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
302
|
+
};
|
|
303
|
+
readonly name: Schema.String;
|
|
304
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
305
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
306
|
+
}>>;
|
|
307
|
+
readonly workflow_generation: Schema.optionalKey<Schema.Int>;
|
|
242
308
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
243
309
|
}>, Schema.Struct<{
|
|
244
310
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
@@ -269,7 +335,7 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
269
335
|
};
|
|
270
336
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
271
337
|
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>>;
|
|
272
|
-
export declare const layer: import("effect/Layer").Layer<never, never, ExecutionRepository.Service | EventLog.Service | WaitService.Service | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
338
|
+
export declare const layer: import("effect/Layer").Layer<never, never, ChildExecutionRepository.Service | ExecutionRepository.Service | EventLog.Service | WaitService.Service | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
273
339
|
export declare const client: Effect.Effect<(entityId: string) => import("effect/unstable/rpc/RpcClient").RpcClient.From<Rpc.Rpc<"start", Schema.Struct<{
|
|
274
340
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
275
341
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
@@ -277,25 +343,32 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
277
343
|
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
278
344
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
279
345
|
};
|
|
346
|
+
readonly session_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SessionId"> & {
|
|
347
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
348
|
+
}>;
|
|
280
349
|
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
281
350
|
readonly type: Schema.Literal<"text">;
|
|
282
351
|
readonly text: Schema.String;
|
|
352
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
283
353
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
284
354
|
}>, Schema.Struct<{
|
|
285
355
|
readonly type: Schema.Literal<"structured">;
|
|
286
356
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
287
357
|
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
358
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
288
359
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
289
360
|
}>, Schema.Struct<{
|
|
290
361
|
readonly type: Schema.Literal<"blob-reference">;
|
|
291
362
|
readonly uri: Schema.String;
|
|
292
363
|
readonly media_type: Schema.String;
|
|
293
364
|
readonly filename: Schema.optionalKey<Schema.String>;
|
|
365
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
294
366
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
295
367
|
}>, Schema.Struct<{
|
|
296
368
|
readonly type: Schema.Literal<"artifact-reference">;
|
|
297
369
|
readonly artifact_id: Schema.String;
|
|
298
370
|
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
371
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
299
372
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
300
373
|
}>, Schema.Struct<{
|
|
301
374
|
readonly type: Schema.Literal<"tool-call">;
|
|
@@ -307,6 +380,7 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
307
380
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
308
381
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
309
382
|
}>;
|
|
383
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
310
384
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
311
385
|
}>, Schema.Struct<{
|
|
312
386
|
readonly type: Schema.Literal<"tool-result">;
|
|
@@ -318,6 +392,7 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
318
392
|
readonly error: Schema.optionalKey<Schema.String>;
|
|
319
393
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
320
394
|
}>;
|
|
395
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
321
396
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
322
397
|
}>]>>>;
|
|
323
398
|
readonly event_sequence: Schema.Int;
|
|
@@ -343,6 +418,17 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
343
418
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
344
419
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
345
420
|
}>>;
|
|
421
|
+
readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
|
|
422
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
|
|
423
|
+
}>>;
|
|
424
|
+
readonly permission_rules: Schema.optionalKey<Schema.Struct<{
|
|
425
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
426
|
+
readonly pattern: Schema.String;
|
|
427
|
+
readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
428
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
429
|
+
}>>;
|
|
430
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
431
|
+
}>>;
|
|
346
432
|
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
347
433
|
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
348
434
|
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
@@ -364,12 +450,25 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
364
450
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
365
451
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
366
452
|
}>>>;
|
|
453
|
+
readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
454
|
+
readonly name: Schema.String;
|
|
455
|
+
readonly preset_name: Schema.String;
|
|
456
|
+
}>>>;
|
|
367
457
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
368
458
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
369
459
|
}>>;
|
|
370
460
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
371
461
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
372
462
|
}>;
|
|
463
|
+
readonly resume_tool_call: Schema.optionalKey<Schema.Struct<{
|
|
464
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
465
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
466
|
+
};
|
|
467
|
+
readonly name: Schema.String;
|
|
468
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
469
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
470
|
+
}>>;
|
|
471
|
+
readonly workflow_generation: Schema.optionalKey<Schema.Int>;
|
|
373
472
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
374
473
|
}>, Schema.Struct<{
|
|
375
474
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
@@ -24,6 +24,10 @@ export interface FindBySequenceOrCursorInput {
|
|
|
24
24
|
readonly sequence: Execution.ExecutionEventSequence;
|
|
25
25
|
readonly cursor: string;
|
|
26
26
|
}
|
|
27
|
+
export interface FindByCursorInput {
|
|
28
|
+
readonly executionId: Ids.ExecutionId;
|
|
29
|
+
readonly cursor: string;
|
|
30
|
+
}
|
|
27
31
|
export interface FindFirstByTypeAfterSequenceInput {
|
|
28
32
|
readonly executionId: Ids.ExecutionId;
|
|
29
33
|
readonly type: Execution.ExecutionEventType;
|
|
@@ -34,6 +38,7 @@ export interface Interface {
|
|
|
34
38
|
readonly replay: (input: ReplayInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, EventLogCursorNotFound | EventLogError>;
|
|
35
39
|
readonly stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | EventLogError>;
|
|
36
40
|
readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
41
|
+
readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
37
42
|
readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
38
43
|
readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, EventLogError>;
|
|
39
44
|
/**
|
|
@@ -54,6 +59,7 @@ export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<
|
|
|
54
59
|
export declare const appendIdempotent: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
|
|
55
60
|
export declare const replay: (input: ReplayInput) => Effect.Effect<readonly Execution.ExecutionEvent[], EventLogCursorNotFound | EventLogError, Service>;
|
|
56
61
|
export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
62
|
+
export declare const findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
57
63
|
export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
58
64
|
export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, EventLogError, Service>;
|
|
59
65
|
export declare const sumUsage: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number, EventLogError, Service>;
|
|
@@ -13,6 +13,7 @@ export declare class ExecutionServiceError extends ExecutionServiceError_base {
|
|
|
13
13
|
export interface AcceptInput {
|
|
14
14
|
readonly executionId: Ids.ExecutionId;
|
|
15
15
|
readonly rootAddressId: Ids.AddressId;
|
|
16
|
+
readonly sessionId?: Ids.SessionId;
|
|
16
17
|
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
17
18
|
readonly createdAt: number;
|
|
18
19
|
readonly agentDefinitionId?: Ids.AgentDefinitionId;
|
|
@@ -5,17 +5,26 @@ export * as AgentRegistry from "./agent/agent-registry-service";
|
|
|
5
5
|
export * as ArtifactStore from "./content/artifact-store-service";
|
|
6
6
|
export * as BlobStore from "./content/blob-store-service";
|
|
7
7
|
export * as ChildRunService from "./child/child-run-service";
|
|
8
|
+
export * as SpawnChildRunTool from "./child/spawn-child-run-tool";
|
|
8
9
|
export * as ExecutionEntity from "./cluster/execution-entity";
|
|
9
10
|
export * as EnvelopeService from "./envelope/envelope-service";
|
|
10
11
|
export * as EventLog from "./execution/event-log-service";
|
|
11
12
|
export * as ExecutionService from "./execution/execution-service";
|
|
13
|
+
export * as EmbeddingModelService from "./model/embedding-model-service";
|
|
12
14
|
export * as LanguageModelService from "./model/language-model-service";
|
|
15
|
+
export * as MemoryService from "./memory/memory-service";
|
|
13
16
|
export * as ModelCallPolicy from "./model/model-call-policy";
|
|
14
17
|
export * as ParentNotifier from "./child/parent-notifier-service";
|
|
15
18
|
export * as PromptAssembler from "./agent/prompt-assembler-service";
|
|
19
|
+
export * as RelayCompaction from "./agent/relay-compaction";
|
|
20
|
+
export * as RelayPermissions from "./agent/relay-permissions";
|
|
21
|
+
export * as RelaySteering from "./agent/relay-steering";
|
|
22
|
+
export * as RelayToolOutput from "./agent/relay-tool-output";
|
|
16
23
|
export * as RunnerRuntime from "./runner/runner-runtime-service";
|
|
17
24
|
export * as SchedulerService from "./schedule/scheduler-service";
|
|
18
25
|
export * as SchemaRegistry from "./schema-registry/schema-registry-service";
|
|
26
|
+
export * as RelaySessionStore from "./session/session-store-service";
|
|
27
|
+
export * as SkillRegistry from "./skill/skill-registry-service";
|
|
19
28
|
export * as ToolRuntime from "./tool/tool-runtime-service";
|
|
20
29
|
export * as WaitService from "./wait/wait-service";
|
|
21
30
|
export * as WaitSignal from "./wait/wait-signal";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Memory } from "@batonfx/core";
|
|
2
|
+
import { MemoryRepository } from "../../store-sql/index";
|
|
3
|
+
import { Context, Effect, Layer } from "effect";
|
|
4
|
+
import * as EmbeddingModelService from "../model/embedding-model-service";
|
|
5
|
+
export interface Options {
|
|
6
|
+
readonly topK?: number | undefined;
|
|
7
|
+
readonly minScore?: number | undefined;
|
|
8
|
+
readonly embeddingSelection?: EmbeddingModelService.ModelSelection | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface Interface extends Memory.Interface {
|
|
11
|
+
}
|
|
12
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/MemoryService", Interface>;
|
|
13
|
+
export declare class Service extends Service_base {
|
|
14
|
+
}
|
|
15
|
+
export declare const layer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelService.Service>;
|
|
16
|
+
export declare const memoryLayer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelService.Service>;
|
|
17
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service | Memory.Memory>;
|
|
18
|
+
export declare const recall: (input: Memory.RecallInput) => Effect.Effect<readonly Memory.Item[], Memory.MemoryError, Service>;
|
|
19
|
+
export declare const remember: (input: Memory.RememberInput) => Effect.Effect<void, Memory.MemoryError, Service>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Agent, Shared } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import * as Ai from "effect/unstable/ai";
|
|
4
|
+
declare const EmbeddingModelNotRegistered_base: Schema.Class<EmbeddingModelNotRegistered, Schema.TaggedStruct<"EmbeddingModelNotRegistered", {
|
|
5
|
+
readonly provider: Schema.String;
|
|
6
|
+
readonly model: Schema.String;
|
|
7
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
8
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
|
+
export declare class EmbeddingModelNotRegistered extends EmbeddingModelNotRegistered_base {
|
|
10
|
+
}
|
|
11
|
+
export interface ModelSelection {
|
|
12
|
+
readonly provider: string;
|
|
13
|
+
readonly model: string;
|
|
14
|
+
readonly registrationKey?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export type ModelEnvironment = Ai.EmbeddingModel.EmbeddingModel | Ai.EmbeddingModel.Dimensions | Ai.Model.ProviderName | Ai.Model.ModelName;
|
|
17
|
+
export interface Registration {
|
|
18
|
+
readonly provider: string;
|
|
19
|
+
readonly model: string;
|
|
20
|
+
readonly registrationKey?: string | undefined;
|
|
21
|
+
readonly layer: Layer.Layer<ModelEnvironment>;
|
|
22
|
+
readonly metadata?: Shared.Metadata | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface RegisterInput {
|
|
25
|
+
readonly provider: string;
|
|
26
|
+
readonly model: string;
|
|
27
|
+
readonly registrationKey?: string | undefined;
|
|
28
|
+
readonly layer: Layer.Layer<ModelEnvironment>;
|
|
29
|
+
readonly metadata?: Shared.Metadata | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface LayerOptions {
|
|
32
|
+
readonly defaultSelection?: ModelSelection | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface DeterministicOptions {
|
|
35
|
+
readonly provider?: string | undefined;
|
|
36
|
+
readonly model?: string | undefined;
|
|
37
|
+
readonly dimensions?: number | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface Interface {
|
|
40
|
+
readonly register: (input: RegisterInput) => Effect.Effect<void>;
|
|
41
|
+
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
42
|
+
readonly provide: <A, E, R>(selection: ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
43
|
+
readonly provideDefault: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
44
|
+
readonly provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
45
|
+
}
|
|
46
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EmbeddingModelService", Interface>;
|
|
47
|
+
export declare class Service extends Service_base {
|
|
48
|
+
}
|
|
49
|
+
export declare const registrationFromLayer: <Provides extends ModelEnvironment, R>(input: {
|
|
50
|
+
readonly provider: string;
|
|
51
|
+
readonly model: string;
|
|
52
|
+
readonly registrationKey?: string | undefined;
|
|
53
|
+
readonly layer: Layer.Layer<Provides, never, R>;
|
|
54
|
+
readonly metadata?: Shared.Metadata | undefined;
|
|
55
|
+
}) => Effect.Effect<Registration, never, R>;
|
|
56
|
+
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>, options?: LayerOptions) => Layer.Layer<Service, never, never>;
|
|
57
|
+
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: LayerOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
58
|
+
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: LayerOptions) => Layer.Layer<Service, never, never>;
|
|
59
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
60
|
+
export declare const deterministicLayer: (options?: DeterministicOptions) => Layer.Layer<Ai.EmbeddingModel.EmbeddingModel | Ai.EmbeddingModel.Dimensions, never, never>;
|
|
61
|
+
export declare const deterministicRegistration: (options?: DeterministicOptions) => Effect.Effect<Registration, never, never>;
|
|
62
|
+
export declare const deterministicTestLayer: (options?: DeterministicOptions) => Layer.Layer<Service, never, never>;
|
|
63
|
+
export declare const register: (input: RegisterInput) => Effect.Effect<void, never, Service>;
|
|
64
|
+
export declare const registrations: () => Effect.Effect<readonly Registration[], never, Service>;
|
|
65
|
+
export declare const provide: <A, E, R>(selection: ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
|
|
66
|
+
export declare const provideDefault: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
|
|
67
|
+
export declare const provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
|
|
68
|
+
export {};
|
|
@@ -1,33 +1,52 @@
|
|
|
1
|
+
import { ModelResilience } from "@batonfx/core";
|
|
1
2
|
import { Context, Layer, Schedule } from "effect";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Shim over `@batonfx/core`'s `ModelResilience` seam. Baton's `Agent.stream`
|
|
5
|
+
* resolves `ModelResilience.ModelResilience` via `Effect.serviceOption` and
|
|
6
|
+
* applies `ModelResilience.apply` to the model internally, so Relay no longer
|
|
7
|
+
* hand-wraps the model with its own retry logic (see `agent-loop-service.ts`,
|
|
8
|
+
* which resolves this policy and re-provides it under Baton's own tag —
|
|
9
|
+
* `Baton.ModelResilience.ModelResilience` — for the duration of a run).
|
|
10
|
+
*
|
|
11
|
+
* This module keeps its own local service tag (rather than re-exporting
|
|
12
|
+
* Baton's tag directly) because `@batonfx/core` ships its `exports` field
|
|
13
|
+
* pointed at TS source under `node_modules`; a re-exported tag's nominal type
|
|
14
|
+
* resolves to that nested source path, which `tsc --declaration` cannot name
|
|
15
|
+
* portably from deeply composed call sites (TS2742) such as
|
|
16
|
+
* `runner-runtime-service.ts`'s layer-composition helpers. Keeping a local,
|
|
17
|
+
* package-owned tag avoids that while still sharing Baton's `Interface`
|
|
18
|
+
* shape, `Classification` type, and `defaultClassify` implementation
|
|
19
|
+
* one-for-one — and `agent-loop-service.ts` explicitly re-provides the
|
|
20
|
+
* resolved policy under Baton's tag at the one call site that needs it, so
|
|
21
|
+
* the two tags never need to be identical for Baton to see the seam.
|
|
22
|
+
*
|
|
23
|
+
* Preserves every historical export name and Relay's historical default
|
|
24
|
+
* schedule (jittered exponential from 1s, up to 4 retries) — Baton's own
|
|
25
|
+
* `ModelResilience.make()` defaults to `Schedule.recurs(0)` (no retry), so
|
|
26
|
+
* Relay must keep supplying its own default or retries silently vanish.
|
|
4
27
|
*
|
|
5
28
|
* @experimental
|
|
6
29
|
*/
|
|
7
|
-
export type Classification =
|
|
30
|
+
export type Classification = ModelResilience.Classification;
|
|
8
31
|
/**
|
|
9
|
-
* Runtime-level policy for retrying transient model-call failures.
|
|
10
|
-
*
|
|
11
32
|
* @experimental
|
|
12
33
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
readonly retrySchedule: Schedule.Schedule<unknown>;
|
|
16
|
-
}
|
|
17
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ModelCallPolicy", Interface>;
|
|
34
|
+
export type Interface = ModelResilience.Interface;
|
|
35
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ModelCallPolicy", ModelResilience.Interface>;
|
|
18
36
|
/**
|
|
19
37
|
* @experimental
|
|
20
38
|
*/
|
|
21
39
|
export declare class Service extends Service_base {
|
|
22
40
|
}
|
|
23
41
|
/**
|
|
24
|
-
* Default classification:
|
|
42
|
+
* Default classification: malformed model output is terminal, other failures follow Baton.
|
|
25
43
|
*
|
|
26
44
|
* @experimental
|
|
27
45
|
*/
|
|
28
46
|
export declare const defaultClassify: (error: unknown) => Classification;
|
|
29
47
|
/**
|
|
30
|
-
* Default schedule: jittered exponential from 1s, at most 4 retries.
|
|
48
|
+
* Default schedule: jittered exponential from 1s, at most 4 retries. Relay's
|
|
49
|
+
* historical default — Baton's own default is `Schedule.recurs(0)` (no retry).
|
|
31
50
|
*
|
|
32
51
|
* @experimental
|
|
33
52
|
*/
|