@relayfx/sdk 0.0.38 → 0.0.40

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.
Files changed (72) hide show
  1. package/dist/index.js +1366 -1215
  2. package/dist/migrations/20260709030349_agent_id_rename/migration.sql +8 -0
  3. package/dist/migrations/20260709030349_agent_id_rename/snapshot.json +4883 -0
  4. package/dist/migrations/mysql/0001_baseline.sql +8 -8
  5. package/dist/migrations/pg/20260709030349_agent_id_rename/migration.sql +8 -0
  6. package/dist/migrations/pg/20260709030349_agent_id_rename/snapshot.json +4883 -0
  7. package/dist/migrations/sqlite/0001_baseline.sql +8 -8
  8. package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +2 -4
  9. package/dist/types/relay/adapter-outbox.d.ts +11 -11
  10. package/dist/types/relay/client.d.ts +54 -54
  11. package/dist/types/relay/database.d.ts +11 -10
  12. package/dist/types/relay/operation.d.ts +11 -11
  13. package/dist/types/runtime/address/address-resolution-service.d.ts +9 -9
  14. package/dist/types/runtime/agent/agent-loop-service.d.ts +16 -35
  15. package/dist/types/runtime/agent/agent-registry-service.d.ts +4 -4
  16. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +6 -44
  17. package/dist/types/runtime/agent/relay-approvals.d.ts +0 -19
  18. package/dist/types/runtime/agent/relay-instructions.d.ts +0 -15
  19. package/dist/types/runtime/agent/relay-permissions.d.ts +4 -4
  20. package/dist/types/runtime/agent/relay-steering.d.ts +2 -2
  21. package/dist/types/runtime/agent/relay-tool-executor.d.ts +5 -21
  22. package/dist/types/runtime/agent/relay-tool-output.d.ts +5 -5
  23. package/dist/types/runtime/agent/sequence-allocator.d.ts +0 -19
  24. package/dist/types/runtime/child/child-run-service.d.ts +2 -2
  25. package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -4
  26. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +16 -16
  27. package/dist/types/runtime/cluster/execution-entity.d.ts +28 -28
  28. package/dist/types/runtime/content/artifact-store-service.d.ts +0 -47
  29. package/dist/types/runtime/content/blob-store-service.d.ts +0 -33
  30. package/dist/types/runtime/envelope/envelope-service.d.ts +4 -4
  31. package/dist/types/runtime/execution/event-log-service.d.ts +0 -5
  32. package/dist/types/runtime/execution/execution-service.d.ts +10 -9
  33. package/dist/types/runtime/memory/memory-service.d.ts +5 -4
  34. package/dist/types/runtime/model/embedding-model-service.d.ts +3 -3
  35. package/dist/types/runtime/model/language-model-service.d.ts +0 -30
  36. package/dist/types/runtime/model/model-call-policy.d.ts +0 -58
  37. package/dist/types/runtime/runner/runner-runtime-service.d.ts +63 -74
  38. package/dist/types/runtime/schedule/scheduler-service.d.ts +5 -5
  39. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +0 -40
  40. package/dist/types/runtime/tool/tool-runtime-service.d.ts +40 -13
  41. package/dist/types/runtime/wait/wait-service.d.ts +2 -2
  42. package/dist/types/runtime/wait/wait-signal.d.ts +3 -3
  43. package/dist/types/runtime/workflow/execution-workflow.d.ts +17 -22
  44. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +16 -15
  45. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +4 -4
  46. package/dist/types/schema/agent-schema.d.ts +14 -22
  47. package/dist/types/schema/execution-schema.d.ts +5 -5
  48. package/dist/types/schema/ids-schema.d.ts +3 -3
  49. package/dist/types/store-sql/address/address-book-repository.d.ts +2 -2
  50. package/dist/types/store-sql/agent/agent-definition-repository.d.ts +11 -11
  51. package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
  52. package/dist/types/store-sql/child/child-execution-repository.d.ts +2 -2
  53. package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +2 -2
  54. package/dist/types/store-sql/compaction/compaction-repository.d.ts +2 -2
  55. package/dist/types/store-sql/database/database-service.d.ts +11 -12
  56. package/dist/types/store-sql/database/notification-bus.d.ts +3 -3
  57. package/dist/types/store-sql/envelope/envelope-repository.d.ts +2 -2
  58. package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
  59. package/dist/types/store-sql/execution/execution-repository.d.ts +14 -14
  60. package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +3 -3
  61. package/dist/types/store-sql/memory/memory-repository.d.ts +5 -5
  62. package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
  63. package/dist/types/store-sql/schedule/schedule-repository.d.ts +2 -2
  64. package/dist/types/store-sql/schema/relay-schema.d.ts +26 -26
  65. package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
  66. package/dist/types/store-sql/session/session-repository.d.ts +6 -6
  67. package/dist/types/store-sql/skill/skill-definition-repository.d.ts +2 -2
  68. package/dist/types/store-sql/steering/steering-repository.d.ts +2 -2
  69. package/dist/types/store-sql/tenant/tenant-id.d.ts +3 -1
  70. package/dist/types/store-sql/tool/tool-call-repository.d.ts +2 -2
  71. package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +2 -2
  72. package/package.json +3 -14
@@ -26,18 +26,18 @@ CREATE TABLE "relay_agent_definitions" (
26
26
  --> statement-breakpoint
27
27
  CREATE INDEX "idx_relay_agent_definitions_name" ON "relay_agent_definitions" ("tenant_id", "name");
28
28
  --> statement-breakpoint
29
- CREATE TABLE "relay_agent_definition_revisions" (
29
+ CREATE TABLE "relay_agent_revisions" (
30
30
  "tenant_id" TEXT NOT NULL DEFAULT 'system',
31
- "agent_definition_id" TEXT NOT NULL,
31
+ "agent_id" TEXT NOT NULL,
32
32
  "revision" INTEGER NOT NULL,
33
33
  "name" TEXT NOT NULL,
34
34
  "definition_json" TEXT NOT NULL,
35
35
  "tool_input_schema_digests_json" TEXT NOT NULL DEFAULT '{}',
36
36
  "created_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
37
- CONSTRAINT "pk_relay_agent_definition_revisions" PRIMARY KEY ("tenant_id", "agent_definition_id", "revision")
37
+ CONSTRAINT "pk_relay_agent_revisions" PRIMARY KEY ("tenant_id", "agent_id", "revision")
38
38
  );
39
39
  --> statement-breakpoint
40
- CREATE INDEX "idx_relay_agent_definition_revisions_definition" ON "relay_agent_definition_revisions" ("tenant_id", "agent_definition_id", "revision");
40
+ CREATE INDEX "idx_relay_agent_revisions_definition" ON "relay_agent_revisions" ("tenant_id", "agent_id", "revision");
41
41
  --> statement-breakpoint
42
42
  CREATE TABLE "relay_skill_definitions" (
43
43
  "tenant_id" TEXT NOT NULL DEFAULT 'system',
@@ -194,10 +194,10 @@ CREATE TABLE "relay_executions" (
194
194
  "root_address_id" TEXT NOT NULL,
195
195
  "session_id" TEXT,
196
196
  "status" TEXT NOT NULL,
197
- "agent_definition_id" TEXT,
198
- "agent_definition_revision" INTEGER,
199
- "agent_definition_snapshot_json" TEXT,
200
- "agent_definition_tool_input_schema_digests_json" TEXT NOT NULL DEFAULT '{}',
197
+ "agent_id" TEXT,
198
+ "agent_revision" INTEGER,
199
+ "agent_snapshot_json" TEXT,
200
+ "agent_tool_input_schema_digests_json" TEXT NOT NULL DEFAULT '{}',
201
201
  "metadata_json" TEXT NOT NULL DEFAULT '{}',
202
202
  "created_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
203
203
  "updated_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
@@ -1,7 +1,5 @@
1
- import * as OpenAiClient from "@effect/ai-openai/OpenAiClient";
2
- import * as OpenAiEmbeddingModel from "@effect/ai-openai/OpenAiEmbeddingModel";
3
- import * as OpenAiCompatibleClient from "@effect/ai-openai-compat/OpenAiClient";
4
- import * as OpenAiCompatibleEmbeddingModel from "@effect/ai-openai-compat/OpenAiEmbeddingModel";
1
+ import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai";
2
+ import { OpenAiClient as OpenAiCompatibleClient, OpenAiEmbeddingModel as OpenAiCompatibleEmbeddingModel } from "@effect/ai-openai-compat";
5
3
  import { EmbeddingModelService } from "../../runtime/index";
6
4
  export interface OpenAiEmbeddingInput {
7
5
  readonly model: OpenAiEmbeddingModel.Model | (string & {});
@@ -1,19 +1,19 @@
1
1
  import { Context, Effect, Layer } from "effect";
2
- import * as Client from "./client";
3
- import * as Operation from "./operation";
2
+ import { ClientError, Service as ClientService } from "./client";
3
+ import { AckEnvelopeReadyInput, ClaimEnvelopeReadyInput, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, ReleaseEnvelopeReadyInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput } from "./operation";
4
4
  export interface Interface {
5
- readonly claim: (input: Operation.ClaimEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyLease | null, Client.ClientError>;
6
- readonly ack: (input: Operation.AckEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyAcked, Client.ClientError>;
7
- readonly release: (input: Operation.ReleaseEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyReleased, Client.ClientError>;
8
- readonly submitInbound: (input: Operation.SubmitInboundEnvelopeInput) => Effect.Effect<Operation.SubmitInboundEnvelopeAccepted, Client.ClientError>;
5
+ readonly claim: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError>;
6
+ readonly ack: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError>;
7
+ readonly release: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError>;
8
+ readonly submitInbound: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError>;
9
9
  }
10
10
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/AdapterOutbox", Interface>;
11
11
  export declare class Service extends Service_base {
12
12
  }
13
- export declare const layer: Layer.Layer<Service, never, Client.Service>;
13
+ export declare const layer: Layer.Layer<Service, never, ClientService>;
14
14
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
15
- export declare const claim: (input: Operation.ClaimEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyLease | null, Client.ClientError, Service>;
16
- export declare const ack: (input: Operation.AckEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyAcked, Client.ClientError, Service>;
17
- export declare const release: (input: Operation.ReleaseEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyReleased, Client.ClientError, Service>;
18
- export declare const submitInbound: (input: Operation.SubmitInboundEnvelopeInput) => Effect.Effect<Operation.SubmitInboundEnvelopeAccepted, Client.ClientError, Service>;
15
+ export declare const claim: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
16
+ export declare const ack: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError, Service>;
17
+ export declare const release: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError, Service>;
18
+ export declare const submitInbound: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError, Service>;
19
19
  export {};
@@ -3,7 +3,7 @@ import { Address, Agent, Content, Envelope, Execution, Ids, Shared, Skill } from
3
3
  import { ClusterRegistryRepository, EnvelopeRepository, ExecutionRepository, ScheduleRepository, SessionRepository, SteeringRepository } from "../store-sql/index";
4
4
  import { Context, Effect, Layer, Schema, Stream } from "effect";
5
5
  import { Sharding, ShardingConfig } from "effect/unstable/cluster";
6
- import * as Operation from "./operation";
6
+ import type { AckEnvelopeReadyInput, CancelExecutionAccepted, CancelExecutionInput, CancelScheduleInput, CancelScheduleResult, ClaimEnvelopeReadyInput, CreateScheduleInput, CreateScheduleResult, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, GetSessionInput, GetSessionResult, ListExecutionsInput, ListExecutionsResult, ListPendingApprovalsInput, ListRunnersResult, ListSchedulesInput, ListSchedulesResult, ListSessionsInput, ListSessionsResult, ListWaitsInput, PendingToolApprovalList, ReleaseEnvelopeReadyInput, ReplayExecutionInput, ReplayExecutionResult, ResolvePermissionInput, ResolveToolApprovalInput, RouteExecutionResult, StartExecutionInput, StartExecutionResult, SteerAccepted, SteerInput, StreamExecutionInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput, WaitView, WakeAccepted, WakeInput } from "./operation";
7
7
  declare const ClientError_base: Schema.Class<ClientError, Schema.TaggedStruct<"ClientError", {
8
8
  readonly message: Schema.String;
9
9
  }>, import("effect/Cause").YieldableError>;
@@ -24,7 +24,7 @@ export interface StartExecutionByAddressInput {
24
24
  export interface StartExecutionByAgentDefinitionInput {
25
25
  readonly root_address_id: Ids.AddressId;
26
26
  readonly session_id?: Ids.SessionId;
27
- readonly agent_definition_id: Ids.AgentDefinitionId;
27
+ readonly agent_id: Ids.AgentId;
28
28
  readonly input?: ReadonlyArray<Content.Part>;
29
29
  readonly idempotency_key: Shared.NonEmptyString;
30
30
  readonly execution_id?: Ids.ExecutionId;
@@ -40,42 +40,42 @@ export interface RegisterAgentInput extends Agent.DefineInput {
40
40
  export interface Interface {
41
41
  readonly registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
42
42
  readonly registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
43
- readonly getAgentDefinition: (id: Ids.AgentDefinitionId) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError>;
43
+ readonly getAgentDefinition: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError>;
44
44
  readonly listAgentDefinitions: () => Effect.Effect<Agent.DefinitionList, ClientError>;
45
- readonly listAgentDefinitionRevisions: (id: Ids.AgentDefinitionId) => Effect.Effect<Agent.DefinitionRevisionList, ClientError>;
45
+ readonly listAgentDefinitionRevisions: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRevisionList, ClientError>;
46
46
  readonly getSkillDefinition: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRecord | undefined, ClientError>;
47
47
  readonly listSkillDefinitions: () => Effect.Effect<Skill.DefinitionList, ClientError>;
48
48
  readonly listSkillDefinitionRevisions: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRevisionList, ClientError>;
49
49
  readonly registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ClientError>;
50
50
  readonly getAddressBookRoute: (id: Ids.AddressId) => Effect.Effect<Address.RouteRecord | undefined, ClientError>;
51
51
  readonly listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError>;
52
- readonly startExecution: (input: Operation.StartExecutionInput) => Effect.Effect<Operation.StartExecutionResult, ClientError>;
53
- readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<Operation.StartExecutionResult, ClientError>;
54
- readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<Operation.StartExecutionResult, ClientError>;
55
- readonly cancelExecution: (input: Operation.CancelExecutionInput) => Effect.Effect<Operation.CancelExecutionAccepted, ClientError>;
56
- readonly steer: (input: Operation.SteerInput) => Effect.Effect<Operation.SteerAccepted, ClientError>;
52
+ readonly startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ClientError>;
53
+ readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ClientError>;
54
+ readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ClientError>;
55
+ readonly cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError>;
56
+ readonly steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError>;
57
57
  readonly getExecution: (id: Ids.ExecutionId) => Effect.Effect<Execution.Execution | undefined, ClientError>;
58
- readonly listExecutions: (input: Operation.ListExecutionsInput) => Effect.Effect<Operation.ListExecutionsResult, ClientError>;
59
- readonly listSessions: (input: Operation.ListSessionsInput) => Effect.Effect<Operation.ListSessionsResult, ClientError>;
60
- readonly getSession: (input: Operation.GetSessionInput) => Effect.Effect<Operation.GetSessionResult, ClientError>;
61
- readonly listWaits: (input: Operation.ListWaitsInput) => Effect.Effect<ReadonlyArray<Operation.WaitView>, ClientError>;
62
- readonly replayExecution: (input: Operation.ReplayExecutionInput) => Effect.Effect<Operation.ReplayExecutionResult, ClientError>;
63
- readonly listRunners: () => Effect.Effect<Operation.ListRunnersResult, ClientError>;
64
- readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<Operation.RouteExecutionResult, ClientError>;
58
+ readonly listExecutions: (input: ListExecutionsInput) => Effect.Effect<ListExecutionsResult, ClientError>;
59
+ readonly listSessions: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, ClientError>;
60
+ readonly getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError>;
61
+ readonly listWaits: (input: ListWaitsInput) => Effect.Effect<ReadonlyArray<WaitView>, ClientError>;
62
+ readonly replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError>;
63
+ readonly listRunners: () => Effect.Effect<ListRunnersResult, ClientError>;
64
+ readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<RouteExecutionResult, ClientError>;
65
65
  readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError>;
66
- readonly streamExecution: (input: Operation.StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError>;
67
- readonly wake: (input: Operation.WakeInput) => Effect.Effect<Operation.WakeAccepted, ClientError>;
68
- readonly listPendingApprovals: (input: Operation.ListPendingApprovalsInput) => Effect.Effect<Operation.PendingToolApprovalList, ClientError>;
69
- readonly resolveToolApproval: (input: Operation.ResolveToolApprovalInput) => Effect.Effect<Operation.WakeAccepted, ClientError>;
70
- readonly resolvePermission: (input: Operation.ResolvePermissionInput) => Effect.Effect<Operation.WakeAccepted, ClientError>;
71
- readonly submitInboundEnvelope: (input: Operation.SubmitInboundEnvelopeInput) => Effect.Effect<Operation.SubmitInboundEnvelopeAccepted, ClientError>;
66
+ readonly streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError>;
67
+ readonly wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError>;
68
+ readonly listPendingApprovals: (input: ListPendingApprovalsInput) => Effect.Effect<PendingToolApprovalList, ClientError>;
69
+ readonly resolveToolApproval: (input: ResolveToolApprovalInput) => Effect.Effect<WakeAccepted, ClientError>;
70
+ readonly resolvePermission: (input: ResolvePermissionInput) => Effect.Effect<WakeAccepted, ClientError>;
71
+ readonly submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError>;
72
72
  readonly spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError>;
73
- readonly claimEnvelopeReady: (input: Operation.ClaimEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyLease | null, ClientError>;
74
- readonly ackEnvelopeReady: (input: Operation.AckEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyAcked, ClientError>;
75
- readonly releaseEnvelopeReady: (input: Operation.ReleaseEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyReleased, ClientError>;
76
- readonly createSchedule: (input: Operation.CreateScheduleInput) => Effect.Effect<Operation.CreateScheduleResult, ClientError>;
77
- readonly cancelSchedule: (input: Operation.CancelScheduleInput) => Effect.Effect<Operation.CancelScheduleResult, ClientError>;
78
- readonly listSchedules: (input: Operation.ListSchedulesInput) => Effect.Effect<Operation.ListSchedulesResult, ClientError>;
73
+ readonly claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError>;
74
+ readonly ackEnvelopeReady: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError>;
75
+ readonly releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError>;
76
+ readonly createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError>;
77
+ readonly cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError>;
78
+ readonly listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError>;
79
79
  }
80
80
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/Client", Interface>;
81
81
  export declare class Service extends Service_base {
@@ -84,40 +84,40 @@ export declare const layerFromRuntime: Layer.Layer<Service, never, AgentRegistry
84
84
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
85
85
  export declare const registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
86
86
  export declare const registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
87
- export declare const getAgentDefinition: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError, Service>;
87
+ export declare const getAgentDefinition: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError, Service>;
88
88
  export declare const listAgentDefinitions: () => Effect.Effect<Agent.DefinitionList, ClientError, Service>;
89
- export declare const listAgentDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<Agent.DefinitionRevisionList, ClientError, Service>;
89
+ export declare const listAgentDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRevisionList, ClientError, Service>;
90
90
  export declare const getSkillDefinition: (id: string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">) => Effect.Effect<Skill.DefinitionRecord | undefined, ClientError, Service>;
91
91
  export declare const listSkillDefinitions: () => Effect.Effect<Skill.DefinitionList, ClientError, Service>;
92
92
  export declare const listSkillDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">) => Effect.Effect<Skill.DefinitionRevisionList, ClientError, Service>;
93
93
  export declare const registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ClientError, Service>;
94
94
  export declare const getAddressBookRoute: (id: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Address.RouteRecord | undefined, ClientError, Service>;
95
95
  export declare const listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError, Service>;
96
- export declare const startExecution: (input: Operation.StartExecutionInput) => Effect.Effect<Operation.StartExecutionResult, ClientError, Service>;
97
- export declare const startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<Operation.StartExecutionResult, ClientError, Service>;
98
- export declare const startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<Operation.StartExecutionResult, ClientError, Service>;
99
- export declare const cancelExecution: (input: Operation.CancelExecutionInput) => Effect.Effect<Operation.CancelExecutionAccepted, ClientError, Service>;
100
- export declare const steer: (input: Operation.SteerInput) => Effect.Effect<Operation.SteerAccepted, ClientError, Service>;
96
+ export declare const startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
97
+ export declare const startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
98
+ export declare const startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
99
+ export declare const cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError, Service>;
100
+ export declare const steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError, Service>;
101
101
  export declare const getExecution: (id: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Execution.Execution | undefined, ClientError, Service>;
102
- export declare const listExecutions: (input: Operation.ListExecutionsInput) => Effect.Effect<Operation.ListExecutionsResult, ClientError, Service>;
103
- export declare const listSessions: (input: Operation.ListSessionsInput) => Effect.Effect<Operation.ListSessionsResult, ClientError, Service>;
104
- export declare const getSession: (input: Operation.GetSessionInput) => Effect.Effect<Operation.GetSessionResult, ClientError, Service>;
105
- export declare const listWaits: (input: Operation.ListWaitsInput) => Effect.Effect<readonly Operation.WaitView[], ClientError, Service>;
106
- export declare const replayExecution: (input: Operation.ReplayExecutionInput) => Effect.Effect<Operation.ReplayExecutionResult, ClientError, Service>;
107
- export declare const listRunners: () => Effect.Effect<Operation.ListRunnersResult, ClientError, Service>;
108
- export declare const routeExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Operation.RouteExecutionResult, ClientError, Service>;
102
+ export declare const listExecutions: (input: ListExecutionsInput) => Effect.Effect<ListExecutionsResult, ClientError, Service>;
103
+ export declare const listSessions: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, ClientError, Service>;
104
+ export declare const getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError, Service>;
105
+ export declare const listWaits: (input: ListWaitsInput) => Effect.Effect<readonly WaitView[], ClientError, Service>;
106
+ export declare const replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError, Service>;
107
+ export declare const listRunners: () => Effect.Effect<ListRunnersResult, ClientError, Service>;
108
+ export declare const routeExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<RouteExecutionResult, ClientError, Service>;
109
109
  export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError, Service>;
110
- export declare const streamExecution: (input: Operation.StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError, Service>;
111
- export declare const wake: (input: Operation.WakeInput) => Effect.Effect<Operation.WakeAccepted, ClientError, Service>;
112
- export declare const listPendingApprovals: (input: Operation.ListPendingApprovalsInput) => Effect.Effect<Operation.PendingToolApprovalList, ClientError, Service>;
113
- export declare const resolveToolApproval: (input: Operation.ResolveToolApprovalInput) => Effect.Effect<Operation.WakeAccepted, ClientError, Service>;
114
- export declare const resolvePermission: (input: Operation.ResolvePermissionInput) => Effect.Effect<Operation.WakeAccepted, ClientError, Service>;
115
- export declare const submitInboundEnvelope: (input: Operation.SubmitInboundEnvelopeInput) => Effect.Effect<Operation.SubmitInboundEnvelopeAccepted, ClientError, Service>;
110
+ export declare const streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError, Service>;
111
+ export declare const wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
112
+ export declare const listPendingApprovals: (input: ListPendingApprovalsInput) => Effect.Effect<PendingToolApprovalList, ClientError, Service>;
113
+ export declare const resolveToolApproval: (input: ResolveToolApprovalInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
114
+ export declare const resolvePermission: (input: ResolvePermissionInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
115
+ export declare const submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError, Service>;
116
116
  export declare const spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError, Service>;
117
- export declare const claimEnvelopeReady: (input: Operation.ClaimEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyLease | null, ClientError, Service>;
118
- export declare const ackEnvelopeReady: (input: Operation.AckEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyAcked, ClientError, Service>;
119
- export declare const releaseEnvelopeReady: (input: Operation.ReleaseEnvelopeReadyInput) => Effect.Effect<Operation.EnvelopeReadyReleased, ClientError, Service>;
120
- export declare const createSchedule: (input: Operation.CreateScheduleInput) => Effect.Effect<Operation.CreateScheduleResult, ClientError, Service>;
121
- export declare const cancelSchedule: (input: Operation.CancelScheduleInput) => Effect.Effect<Operation.CancelScheduleResult, ClientError, Service>;
122
- export declare const listSchedules: (input: Operation.ListSchedulesInput) => Effect.Effect<Operation.ListSchedulesResult, ClientError, Service>;
117
+ export declare const claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
118
+ export declare const ackEnvelopeReady: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError, Service>;
119
+ export declare const releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError, Service>;
120
+ export declare const createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError, Service>;
121
+ export declare const cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError, Service>;
122
+ export declare const listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError, Service>;
123
123
  export {};
@@ -1,14 +1,15 @@
1
- import * as StoreSql from "../store-sql/index";
2
- export type Drizzle = StoreSql.Database.Drizzle;
3
- export type PgTimestamp = StoreSql.Database.PgTimestamp;
4
- export type DatabaseError = StoreSql.Database.DatabaseError;
5
- export type Dialect = StoreSql.Database.Dialect;
6
- export declare const Service: typeof StoreSql.Database.Service;
7
- export declare const layerFromPgClient: import("effect/Layer").Layer<StoreSql.Database.Service, never, import("@effect/sql-pg/PgClient").PgClient>;
8
- export declare const testLayer: (db: StoreSql.Database.Drizzle) => import("effect/Layer").Layer<StoreSql.Database.Service, never, never>;
9
- export declare const check: () => import("effect/Effect").Effect<void, import("drizzle-orm/effect-core").EffectDrizzleQueryError, StoreSql.Database.Service>;
1
+ import { Database } from "../store-sql/index";
2
+ import type { Context, Effect } from "effect";
3
+ export type Drizzle = Context.Service.Shape<typeof Database.Service>;
4
+ export type PgTimestamp = Parameters<typeof Database.fromPgDate>[0];
5
+ export type DatabaseError = Effect.Error<ReturnType<typeof Database.check>>;
6
+ export type Dialect = typeof Database.Dialect.Type;
7
+ export declare const Service: typeof Database.Service;
8
+ export declare const layerFromPgClient: import("effect/Layer").Layer<Database.Service, never, import("@effect/sql-pg/PgClient").PgClient>;
9
+ export declare const testLayer: (db: Database.Drizzle) => import("effect/Layer").Layer<Database.Service, never, never>;
10
+ export declare const check: () => Effect.Effect<void, import("drizzle-orm/effect-core").EffectDrizzleQueryError, Database.Service>;
10
11
  export declare const pgTypeParsers: {
11
12
  getTypeParser: (typeId: number, format?: "text" | "binary") => any;
12
13
  };
13
14
  export declare const Dialect: import("effect/Schema").Literals<readonly ["pg", "mysql", "sqlite"]>;
14
- export declare const dialect: import("effect/Effect").Effect<"pg" | "mysql" | "sqlite", never, import("effect/unstable/sql/SqlClient").SqlClient>;
15
+ export declare const dialect: Effect.Effect<"pg" | "mysql" | "sqlite", never, import("effect/unstable/sql/SqlClient").SqlClient>;
@@ -61,11 +61,11 @@ export declare const StartExecutionInput: Schema.Struct<{
61
61
  readonly event_sequence: Schema.Int;
62
62
  readonly started_at: Schema.Int;
63
63
  readonly completed_at: Schema.Int;
64
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
65
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
64
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
65
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
66
66
  }>;
67
- readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
68
- readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
67
+ readonly agent_revision: Schema.optionalKey<Schema.Int>;
68
+ readonly agent_snapshot: Schema.optionalKey<Schema.Struct<{
69
69
  readonly name: Schema.String;
70
70
  readonly instructions: Schema.optionalKey<Schema.String>;
71
71
  readonly model: Schema.Struct<{
@@ -120,7 +120,7 @@ export declare const StartExecutionInput: Schema.Struct<{
120
120
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
121
121
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
122
122
  }>>;
123
- readonly agent_definition_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
123
+ readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
124
124
  readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
125
125
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
126
126
  }>;
@@ -942,8 +942,8 @@ export declare const ConversationSummary: Schema.Struct<{
942
942
  }>;
943
943
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
944
944
  readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
945
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
946
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
945
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
946
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
947
947
  }>;
948
948
  readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
949
949
  readonly created_at: Schema.Int;
@@ -964,8 +964,8 @@ export declare const ListExecutionsResult: Schema.Struct<{
964
964
  }>;
965
965
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
966
966
  readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
967
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
968
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
967
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
968
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
969
969
  }>;
970
970
  readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
971
971
  readonly created_at: Schema.Int;
@@ -1046,8 +1046,8 @@ export declare const GetSessionResult: Schema.Struct<{
1046
1046
  }>;
1047
1047
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
1048
1048
  readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
1049
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
1050
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
1049
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
1050
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
1051
1051
  }>;
1052
1052
  readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
1053
1053
  readonly created_at: Schema.Int;
@@ -1,7 +1,7 @@
1
1
  import { Ids } from "../../schema/index";
2
2
  import { Context, Effect, Layer, Schema } from "effect";
3
- import * as AddressBook from "./address-book-service";
4
- import * as AgentRegistry from "../agent/agent-registry-service";
3
+ import { Service as AddressBookService } from "./address-book-service";
4
+ import { Service as AgentRegistryService } from "../agent/agent-registry-service";
5
5
  declare const AddressRouteNotFound_base: Schema.Class<AddressRouteNotFound, Schema.TaggedStruct<"AddressRouteNotFound", {
6
6
  readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
7
7
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
@@ -23,8 +23,8 @@ declare const AddressAgentDefinitionNotFound_base: Schema.Class<AddressAgentDefi
23
23
  readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
24
24
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
25
25
  };
26
- readonly agent_definition_id: Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
27
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
26
+ readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
27
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
28
28
  };
29
29
  }>, import("effect/Cause").YieldableError>;
30
30
  export declare class AddressAgentDefinitionNotFound extends AddressAgentDefinitionNotFound_base {
@@ -50,11 +50,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
50
50
  readonly route_key: Schema.String;
51
51
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
52
52
  }>;
53
- readonly agent_definition_id: Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
54
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
53
+ readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
54
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
55
55
  };
56
- readonly agent_definition_revision: Schema.Int;
57
- readonly agent_definition_snapshot: Schema.Struct<{
56
+ readonly agent_revision: Schema.Int;
57
+ readonly agent_snapshot: Schema.Struct<{
58
58
  readonly name: Schema.String;
59
59
  readonly instructions: Schema.optionalKey<Schema.String>;
60
60
  readonly model: Schema.Struct<{
@@ -119,7 +119,7 @@ export interface Interface {
119
119
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AddressResolution", Interface>;
120
120
  export declare class Service extends Service_base {
121
121
  }
122
- export declare const layer: Layer.Layer<Service, never, AddressBook.Service | AgentRegistry.Service>;
122
+ export declare const layer: Layer.Layer<Service, never, AddressBookService | AgentRegistryService>;
123
123
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
124
124
  export declare const resolveLocalAgent: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<LocalAgentTarget, AddressRouteNotFound | AddressRouteKindMismatch | AddressAgentDefinitionNotFound | AddressResolutionError, Service>;
125
125
  export {};
@@ -1,15 +1,15 @@
1
1
  import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
2
2
  import { AgentChatRepository } from "../../store-sql/index";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
- import * as Ai from "effect/unstable/ai";
5
- import * as SpawnChildRunTool from "../child/spawn-child-run-tool";
6
- import * as EventLog from "../execution/event-log-service";
7
- import * as LanguageModelService from "../model/language-model-service";
8
- import * as ModelCallPolicy from "../model/model-call-policy";
9
- import * as SchemaRegistry from "../schema-registry/schema-registry-service";
10
- import * as ToolRuntime from "../tool/tool-runtime-service";
11
- import * as PromptAssembler from "./prompt-assembler-service";
12
- import * as RelayCompaction from "./relay-compaction";
4
+ import { Tool as AiTool } from "effect/unstable/ai";
5
+ import type { DispatchInput } from "../child/spawn-child-run-tool";
6
+ import { Service as EventLogService } from "../execution/event-log-service";
7
+ import { Service as LanguageModelServiceService } from "../model/language-model-service";
8
+ import { Service as ModelCallPolicyService } from "../model/model-call-policy";
9
+ import { Service as SchemaRegistryService } from "../schema-registry/schema-registry-service";
10
+ import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
11
+ import { Service as PromptAssemblerService } from "./prompt-assembler-service";
12
+ import type { Options } from "./relay-compaction";
13
13
  declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
14
14
  readonly message: Schema.String;
15
15
  readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
@@ -43,9 +43,9 @@ export interface RunInput {
43
43
  readonly executionId: Ids.ExecutionId;
44
44
  readonly sessionId?: Ids.SessionId;
45
45
  readonly agent: Agent.Definition;
46
- readonly agentDefinitionId?: Ids.AgentDefinitionId;
47
- readonly agentDefinitionRevision?: Agent.DefinitionRevision;
48
- readonly agentDefinitionToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
46
+ readonly agentId?: Ids.AgentId;
47
+ readonly agentRevision?: Agent.DefinitionRevision;
48
+ readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
49
49
  readonly input: ReadonlyArray<Content.Part>;
50
50
  readonly resumeToolCall?: Tool.Call;
51
51
  readonly memorySubjectId?: Ids.MemorySubjectId;
@@ -54,9 +54,9 @@ export interface RunInput {
54
54
  readonly completedAt: number;
55
55
  readonly steeringEnabled?: boolean;
56
56
  readonly toolOutputMaxBytes?: number | null;
57
- readonly compaction?: RelayCompaction.Options | null;
57
+ readonly compaction?: Options | null;
58
58
  readonly sessionEntryScope?: string;
59
- readonly dispatchChildRun?: (input: SpawnChildRunTool.DispatchInput) => Effect.Effect<void, unknown, any>;
59
+ readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
60
60
  }
61
61
  export interface RunResult {
62
62
  readonly metadata: Shared.Metadata;
@@ -76,29 +76,10 @@ export declare class Service extends Service_base {
76
76
  * @experimental
77
77
  */
78
78
  export declare const STRUCTURED_TURN_PROMPT = "Return the final structured output for the task above.";
79
- /**
80
- * Converts a Relay `Tool.Definition` into the `Ai.Tool` Baton's toolkit
81
- * consumes. Exported for direct unit testing of the `needsApproval` mapping
82
- * (see `agent-loop-service.test.ts`) — `Tool.Definition.needs_approval` must
83
- * reach the constructed tool honestly so Relay tools self-describe correctly
84
- * even outside Relay's own durable approval gate (docs/spec/27).
85
- *
86
- * @experimental
87
- */
88
- /**
89
- * Build the model-facing `Ai.Tool` from a bare `Tool.Definition`, delegating to
90
- * the single canonical mapping in `ToolRuntime` so the parameters schema is a real
91
- * object AST (not the `Schema.Unknown` placeholder that breaks OpenRouter/Anthropic
92
- * tool preparation). Retained and exported only for the unit tests that assert the
93
- * `needs_approval` mapping; the run loop builds its toolkit from `RegisteredTool`s
94
- * (which may carry a tool's own concrete `aiTool`), not from definitions.
95
- *
96
- * @experimental
97
- */
98
- export declare const aiToolFromDefinition: (definition: Tool.Definition) => Ai.Tool.Any;
79
+ export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool.Any;
99
80
  /** Map a Baton run failure (or an upstream model error) to the public error types. */
100
81
  export declare const mapBoundaryError: (error: unknown, current: Execution.ExecutionEventSequence) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
101
- export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLog.Service | ToolRuntime.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | PromptAssembler.Service>;
82
+ export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
102
83
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
103
84
  export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded, Service>;
104
85
  export {};
@@ -13,10 +13,10 @@ export declare class AgentRegistryError extends AgentRegistryError_base {
13
13
  }
14
14
  export interface Interface {
15
15
  readonly register: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, AgentDefinitionInvalid | AgentRegistryError>;
16
- readonly get: (id: Ids.AgentDefinitionId) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError>;
16
+ readonly get: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError>;
17
17
  readonly getRevision: (input: AgentDefinitionRepository.GetAgentDefinitionRevisionInput) => Effect.Effect<Agent.DefinitionRevisionRecord | undefined, AgentRegistryError>;
18
18
  readonly list: () => Effect.Effect<Agent.DefinitionList, AgentRegistryError>;
19
- readonly listRevisions: (id: Ids.AgentDefinitionId) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError>;
19
+ readonly listRevisions: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError>;
20
20
  }
21
21
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AgentRegistry", Interface>;
22
22
  export declare class Service extends Service_base {
@@ -24,8 +24,8 @@ export declare class Service extends Service_base {
24
24
  export declare const layer: Layer.Layer<Service, never, AgentDefinitionRepository.Service>;
25
25
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
26
26
  export declare const register: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, AgentDefinitionInvalid | AgentRegistryError, Service>;
27
- export declare const get: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError, Service>;
27
+ export declare const get: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError, Service>;
28
28
  export declare const getRevision: (input: AgentDefinitionRepository.GetAgentDefinitionRevisionInput) => Effect.Effect<Agent.DefinitionRevisionRecord | undefined, AgentRegistryError, Service>;
29
29
  export declare const list: () => Effect.Effect<Agent.DefinitionList, AgentRegistryError, Service>;
30
- export declare const listRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError, Service>;
30
+ export declare const listRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError, Service>;
31
31
  export {};
@@ -1,70 +1,32 @@
1
1
  import { Agent, Content, Shared, Tool } from "../../schema/index";
2
2
  import { Context, Effect, Layer, Schema } from "effect";
3
- import * as Ai from "effect/unstable/ai";
4
- import * as ArtifactStore from "../content/artifact-store-service";
5
- import * as BlobStore from "../content/blob-store-service";
3
+ import { Prompt } from "effect/unstable/ai";
4
+ import { Service as ArtifactStoreService } from "../content/artifact-store-service";
5
+ import { Service as BlobStoreService } from "../content/blob-store-service";
6
6
  declare const PromptAssemblerError_base: Schema.Class<PromptAssemblerError, Schema.TaggedStruct<"PromptAssemblerError", {
7
7
  readonly message: Schema.String;
8
8
  }>, import("effect/Cause").YieldableError>;
9
- /**
10
- * @experimental
11
- */
12
9
  export declare class PromptAssemblerError extends PromptAssemblerError_base {
13
10
  }
14
- /**
15
- * Everything an assembler may consider when building the turn-zero prompt.
16
- *
17
- * @experimental
18
- */
19
11
  export interface AssembleInput {
20
12
  readonly agent: Agent.Definition;
21
13
  readonly tools: ReadonlyArray<Tool.Definition>;
22
14
  readonly input: ReadonlyArray<Content.Part>;
23
- /**
24
- * Reserved truncation hook: when set, the assembler SHOULD keep the
25
- * assembled prompt within this many tokens. The default layer ignores it
26
- * (no tokenizer implementation exists yet); summarization/memory layers
27
- * implement it later. Interface-only in v1.
28
- */
29
15
  readonly tokenBudget?: number;
30
16
  readonly metadata?: Shared.Metadata;
31
17
  }
32
- /**
33
- * @experimental
34
- */
35
18
  export interface Assembled {
36
- /** Content of the system message the chat is seeded with. */
37
19
  readonly system: string;
38
- /** The turn-zero prompt (typically one user message built from `input`). */
39
- readonly prompt: Ai.Prompt.Prompt;
20
+ readonly prompt: Prompt.Prompt;
40
21
  }
41
- /**
42
- * @experimental
43
- */
44
22
  export interface Interface {
45
23
  readonly assemble: (input: AssembleInput) => Effect.Effect<Assembled, PromptAssemblerError>;
46
24
  }
47
25
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/PromptAssembler", Interface>;
48
- /**
49
- * @experimental
50
- */
51
26
  export declare class Service extends Service_base {
52
27
  }
53
- /**
54
- * Content parts whose conversion is pure — everything except the reference
55
- * parts (`blob-reference`, `artifact-reference`), which are resolved
56
- * effectfully through {@link BlobStore} / {@link ArtifactStore}.
57
- *
58
- * @experimental
59
- */
60
28
  export type PureContentPart = Content.TextPart | Content.StructuredPart | Content.ToolCallPart | Content.ToolResultPart;
61
- /**
62
- * Converts a pure Relay content part into an Effect AI user-message prompt part.
63
- * Reference parts are resolved separately (see the default layer).
64
- *
65
- * @experimental
66
- */
67
- export declare const contentToPromptPart: (part: PureContentPart) => Ai.Prompt.UserMessagePart;
29
+ export declare const contentToPromptPart: (part: PureContentPart) => Prompt.UserMessagePart;
68
30
  /**
69
31
  * Default assembler that resolves reference content parts through the
70
32
  * {@link BlobStore} and {@link ArtifactStore} it reads from context. Requires
@@ -73,7 +35,7 @@ export declare const contentToPromptPart: (part: PureContentPart) => Ai.Prompt.U
73
35
  *
74
36
  * @experimental
75
37
  */
76
- export declare const defaultLayerWithStores: Layer.Layer<Service, never, BlobStore.Service | ArtifactStore.Service>;
38
+ export declare const defaultLayerWithStores: Layer.Layer<Service, never, BlobStoreService | ArtifactStoreService>;
77
39
  /**
78
40
  * Default assembler: reproduces the agent loop's historical prompt construction,
79
41
  * minus the model-selection dump (see `docs/spec/28-prompt-assembly.md`).
@@ -1,21 +1,2 @@
1
1
  import { Approvals } from "@batonfx/core";
2
- /**
3
- * Relay's binding for Baton's `Approvals` seam: a DELIBERATE, PERMANENT
4
- * auto-approving pass-through, not a placeholder.
5
- *
6
- * Decision authority for `needs_approval` tools lives one seam downstream, in
7
- * the durable `ToolRuntime.run` gate (docs/spec/27-tool-approvals.md) — a
8
- * deterministic `wait:approval:${tool_call_id}` row plus
9
- * `tool.approval.requested` / `tool.approval.resolved` events. Baton dispatches
10
- * a `needsApproval` tool call to `Approvals.check` first and, on `Approved`,
11
- * hands off to `ToolExecutor.execute` (`RelayToolExecutor`, wrapping
12
- * `ToolRuntime.run`) — where the REAL gate runs and suspends the call via
13
- * Baton's `Suspend` outcome (`ToolExecutionWaitRequested`) until a decision is
14
- * recorded. Auto-approving here just clears Baton's own pre-execution check so
15
- * every call reaches that durable gate; it does not skip approval enforcement.
16
- * Moving the gate into `Approvals.check` instead would change the durable
17
- * event order that `test/e2e/tool-approval-durability.e2e.test.ts` depends on.
18
- *
19
- * @experimental
20
- */
21
2
  export declare const layer: import("effect/Layer").Layer<Approvals.Approvals, never, never>;