@relayfx/sdk 0.0.47 → 0.0.49
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 +2050 -579
- package/dist/index.js +2879 -862
- 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,11 +1,12 @@
|
|
|
1
|
-
import { Ids } from "../../schema/index";
|
|
2
|
-
import { ChildExecutionRepository, ExecutionRepository } from "../../store-sql/index";
|
|
1
|
+
import { Agent, Ids } from "../../schema/index";
|
|
2
|
+
import { ChildExecutionRepository, EnvelopeRepository, ExecutionRepository, ToolCallRepository } from "../../store-sql/index";
|
|
3
3
|
import { Workflow } from "effect/unstable/workflow";
|
|
4
4
|
import { Effect, Layer, Option, Schema } from "effect";
|
|
5
5
|
import { Service as AgentLoopService } from "../agent/agent-loop-service";
|
|
6
6
|
import { ChildTerminalStatus } from "../child/parent-notifier-service";
|
|
7
7
|
import { Service as EventLogService } from "../execution/event-log-service";
|
|
8
8
|
import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
|
|
9
|
+
import { Service as ToolTransitionCoordinatorService } from "../tool/tool-transition-coordinator";
|
|
9
10
|
declare const ExecutionWorkflowFailed_base: Schema.Class<ExecutionWorkflowFailed, Schema.TaggedStruct<"ExecutionWorkflowFailed", {
|
|
10
11
|
readonly message: Schema.String;
|
|
11
12
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -77,61 +78,76 @@ export declare const StartInput: Schema.Struct<{
|
|
|
77
78
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
78
79
|
}>;
|
|
79
80
|
readonly agent_revision: Schema.optionalKey<Schema.Int>;
|
|
80
|
-
readonly agent_snapshot: Schema.optionalKey<Schema.
|
|
81
|
-
readonly name:
|
|
82
|
-
readonly
|
|
83
|
-
|
|
84
|
-
readonly
|
|
85
|
-
readonly
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
readonly
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
readonly
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
readonly
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
81
|
+
readonly agent_snapshot: Schema.optionalKey<Schema.Codec<Agent.Definition, {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly permissions: readonly {
|
|
84
|
+
readonly name: string;
|
|
85
|
+
readonly value: Schema.Json;
|
|
86
|
+
readonly metadata?: {
|
|
87
|
+
readonly [x: string]: Schema.Json;
|
|
88
|
+
};
|
|
89
|
+
}[];
|
|
90
|
+
readonly model: {
|
|
91
|
+
readonly provider: string;
|
|
92
|
+
readonly model: string;
|
|
93
|
+
readonly metadata?: {
|
|
94
|
+
readonly [x: string]: Schema.Json;
|
|
95
|
+
};
|
|
96
|
+
readonly registration_key?: string;
|
|
97
|
+
readonly request_options?: {
|
|
98
|
+
readonly [x: string]: Schema.Json;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly tool_names: readonly string[];
|
|
102
|
+
readonly metadata?: {
|
|
103
|
+
readonly [x: string]: Schema.Json;
|
|
104
|
+
};
|
|
105
|
+
readonly instructions?: string;
|
|
106
|
+
readonly output_schema_ref?: string;
|
|
107
|
+
readonly skill_definition_ids?: readonly string[];
|
|
108
|
+
readonly permission_rules?: {
|
|
109
|
+
readonly rules: readonly {
|
|
110
|
+
readonly pattern: string;
|
|
111
|
+
readonly level: "allow" | "deny" | "ask";
|
|
112
|
+
readonly reason?: string;
|
|
113
|
+
}[];
|
|
114
|
+
readonly fallback?: "allow" | "deny" | "ask";
|
|
115
|
+
};
|
|
116
|
+
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
117
|
+
readonly max_tool_turns?: number;
|
|
118
|
+
readonly max_wait_turns?: number;
|
|
119
|
+
readonly token_budget?: number;
|
|
120
|
+
readonly child_run_presets?: {
|
|
121
|
+
readonly [x: string]: {
|
|
122
|
+
readonly metadata?: {
|
|
123
|
+
readonly [x: string]: Schema.Json;
|
|
124
|
+
};
|
|
125
|
+
readonly permissions?: readonly string[];
|
|
126
|
+
readonly model?: {
|
|
127
|
+
readonly provider: string;
|
|
128
|
+
readonly model: string;
|
|
129
|
+
readonly metadata?: {
|
|
130
|
+
readonly [x: string]: Schema.Json;
|
|
131
|
+
};
|
|
132
|
+
readonly registration_key?: string;
|
|
133
|
+
readonly request_options?: {
|
|
134
|
+
readonly [x: string]: Schema.Json;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly instructions?: string;
|
|
138
|
+
readonly tool_names?: readonly string[];
|
|
139
|
+
readonly workspace_policy?: {
|
|
140
|
+
readonly mode: "share" | "fork";
|
|
141
|
+
readonly fallback?: "fail" | "fresh";
|
|
142
|
+
};
|
|
143
|
+
readonly output_schema_ref?: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
|
|
129
147
|
readonly name: Schema.String;
|
|
130
148
|
readonly preset_name: Schema.String;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
134
|
-
}>>;
|
|
149
|
+
}, "Encoded">[];
|
|
150
|
+
}, never, never>>;
|
|
135
151
|
readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
136
152
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
137
153
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
@@ -320,61 +336,76 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
320
336
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
321
337
|
}>;
|
|
322
338
|
readonly agent_revision: Schema.optionalKey<Schema.Int>;
|
|
323
|
-
readonly agent_snapshot: Schema.optionalKey<Schema.
|
|
324
|
-
readonly name:
|
|
325
|
-
readonly
|
|
326
|
-
|
|
327
|
-
readonly
|
|
328
|
-
readonly
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
readonly
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
readonly
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
readonly
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
339
|
+
readonly agent_snapshot: Schema.optionalKey<Schema.Codec<Agent.Definition, {
|
|
340
|
+
readonly name: string;
|
|
341
|
+
readonly permissions: readonly {
|
|
342
|
+
readonly name: string;
|
|
343
|
+
readonly value: Schema.Json;
|
|
344
|
+
readonly metadata?: {
|
|
345
|
+
readonly [x: string]: Schema.Json;
|
|
346
|
+
};
|
|
347
|
+
}[];
|
|
348
|
+
readonly model: {
|
|
349
|
+
readonly provider: string;
|
|
350
|
+
readonly model: string;
|
|
351
|
+
readonly metadata?: {
|
|
352
|
+
readonly [x: string]: Schema.Json;
|
|
353
|
+
};
|
|
354
|
+
readonly registration_key?: string;
|
|
355
|
+
readonly request_options?: {
|
|
356
|
+
readonly [x: string]: Schema.Json;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
readonly tool_names: readonly string[];
|
|
360
|
+
readonly metadata?: {
|
|
361
|
+
readonly [x: string]: Schema.Json;
|
|
362
|
+
};
|
|
363
|
+
readonly instructions?: string;
|
|
364
|
+
readonly output_schema_ref?: string;
|
|
365
|
+
readonly skill_definition_ids?: readonly string[];
|
|
366
|
+
readonly permission_rules?: {
|
|
367
|
+
readonly rules: readonly {
|
|
368
|
+
readonly pattern: string;
|
|
369
|
+
readonly level: "allow" | "deny" | "ask";
|
|
370
|
+
readonly reason?: string;
|
|
371
|
+
}[];
|
|
372
|
+
readonly fallback?: "allow" | "deny" | "ask";
|
|
373
|
+
};
|
|
374
|
+
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
375
|
+
readonly max_tool_turns?: number;
|
|
376
|
+
readonly max_wait_turns?: number;
|
|
377
|
+
readonly token_budget?: number;
|
|
378
|
+
readonly child_run_presets?: {
|
|
379
|
+
readonly [x: string]: {
|
|
380
|
+
readonly metadata?: {
|
|
381
|
+
readonly [x: string]: Schema.Json;
|
|
382
|
+
};
|
|
383
|
+
readonly permissions?: readonly string[];
|
|
384
|
+
readonly model?: {
|
|
385
|
+
readonly provider: string;
|
|
386
|
+
readonly model: string;
|
|
387
|
+
readonly metadata?: {
|
|
388
|
+
readonly [x: string]: Schema.Json;
|
|
389
|
+
};
|
|
390
|
+
readonly registration_key?: string;
|
|
391
|
+
readonly request_options?: {
|
|
392
|
+
readonly [x: string]: Schema.Json;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
readonly instructions?: string;
|
|
396
|
+
readonly tool_names?: readonly string[];
|
|
397
|
+
readonly workspace_policy?: {
|
|
398
|
+
readonly mode: "share" | "fork";
|
|
399
|
+
readonly fallback?: "fail" | "fresh";
|
|
400
|
+
};
|
|
401
|
+
readonly output_schema_ref?: string;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
|
|
372
405
|
readonly name: Schema.String;
|
|
373
406
|
readonly preset_name: Schema.String;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
377
|
-
}>>;
|
|
407
|
+
}, "Encoded">[];
|
|
408
|
+
}, never, never>>;
|
|
378
409
|
readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
379
410
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
380
411
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
@@ -401,12 +432,12 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
401
432
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
402
433
|
}>, typeof ExecutionWorkflowFailed>;
|
|
403
434
|
export declare const sessionEntryScope: (input: StartInput, turn: number) => string;
|
|
404
|
-
export declare const layer: Layer.Layer<never, never, ChildExecutionRepository.Service | ExecutionRepository.Service | EventLogService | import("../wait/wait-service").Service | ToolRuntimeService | import("../address/address-resolution-service").Service | AgentLoopService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../workspace/workspace-planner-service").Service | import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
435
|
+
export declare const layer: Layer.Layer<never, never, ChildExecutionRepository.Service | EnvelopeRepository.Service | ExecutionRepository.Service | ToolCallRepository.Service | EventLogService | import("../wait/wait-service").Service | ToolRuntimeService | import("../address/address-resolution-service").Service | AgentLoopService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
405
436
|
export declare const start: <const Discard extends boolean = false>(input: StartInput, options?: {
|
|
406
437
|
readonly discard?: Discard;
|
|
407
438
|
}) => Effect.Effect<Discard extends true ? string : {
|
|
408
439
|
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
409
|
-
readonly status: "
|
|
440
|
+
readonly status: "waiting" | "running" | "completed" | "failed" | "queued" | "cancelled";
|
|
410
441
|
readonly metadata?: {
|
|
411
442
|
readonly [x: string]: Schema.Json;
|
|
412
443
|
};
|
|
@@ -415,20 +446,21 @@ export declare const start: <const Discard extends boolean = false>(input: Start
|
|
|
415
446
|
}, Discard extends true ? never : ExecutionWorkflowFailed, import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
416
447
|
export declare const startRequest: (input: StartInput) => Effect.Effect<{
|
|
417
448
|
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
418
|
-
readonly status: "
|
|
449
|
+
readonly status: "waiting" | "running" | "completed" | "failed" | "queued" | "cancelled";
|
|
419
450
|
readonly metadata?: {
|
|
420
451
|
readonly [x: string]: Schema.Json;
|
|
421
452
|
};
|
|
422
453
|
readonly wait_id?: string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
423
454
|
readonly wait_state?: "cancelled" | "resolved" | "timed_out";
|
|
424
455
|
}, ExecutionWorkflowFailed, import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
456
|
+
export declare const dispatchRequest: (input: StartInput) => Effect.Effect<void, never, import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
425
457
|
export declare const cancelRequest: (input: CancelExecutionInput) => Effect.Effect<{
|
|
426
458
|
execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
427
|
-
status: "
|
|
428
|
-
}, ExecutionWorkflowFailed, ChildExecutionRepository.Service | ExecutionRepository.Service | EventLogService | import("../wait/wait-service").Service | import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
459
|
+
status: "waiting" | "running" | "completed" | "failed" | "queued" | "cancelled";
|
|
460
|
+
}, ExecutionWorkflowFailed, ChildExecutionRepository.Service | EnvelopeRepository.Service | ExecutionRepository.Service | ToolCallRepository.Service | EventLogService | import("../wait/wait-service").Service | ToolTransitionCoordinatorService | import("effect/unstable/workflow/WorkflowEngine").WorkflowEngine>;
|
|
429
461
|
export declare const poll: (executionId: string) => Effect.Effect<Option.Option<Workflow.Result<{
|
|
430
462
|
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
431
|
-
readonly status: "
|
|
463
|
+
readonly status: "waiting" | "running" | "completed" | "failed" | "queued" | "cancelled";
|
|
432
464
|
readonly metadata?: {
|
|
433
465
|
readonly [x: string]: Schema.Json;
|
|
434
466
|
};
|