@relayfx/sdk 0.0.39 → 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 (70) hide show
  1. package/dist/index.js +1185 -1086
  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 +50 -163
  11. package/dist/types/relay/database.d.ts +11 -10
  12. package/dist/types/relay/operation.d.ts +7 -7
  13. package/dist/types/runtime/address/address-resolution-service.d.ts +7 -7
  14. package/dist/types/runtime/agent/agent-loop-service.d.ts +15 -15
  15. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +6 -44
  16. package/dist/types/runtime/agent/relay-approvals.d.ts +0 -19
  17. package/dist/types/runtime/agent/relay-instructions.d.ts +0 -15
  18. package/dist/types/runtime/agent/relay-permissions.d.ts +4 -4
  19. package/dist/types/runtime/agent/relay-steering.d.ts +2 -2
  20. package/dist/types/runtime/agent/relay-tool-executor.d.ts +5 -21
  21. package/dist/types/runtime/agent/relay-tool-output.d.ts +5 -5
  22. package/dist/types/runtime/agent/sequence-allocator.d.ts +0 -19
  23. package/dist/types/runtime/child/child-run-service.d.ts +2 -2
  24. package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -4
  25. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +14 -14
  26. package/dist/types/runtime/cluster/execution-entity.d.ts +25 -25
  27. package/dist/types/runtime/content/artifact-store-service.d.ts +0 -47
  28. package/dist/types/runtime/content/blob-store-service.d.ts +0 -33
  29. package/dist/types/runtime/envelope/envelope-service.d.ts +4 -4
  30. package/dist/types/runtime/execution/event-log-service.d.ts +0 -5
  31. package/dist/types/runtime/execution/execution-service.d.ts +9 -8
  32. package/dist/types/runtime/memory/memory-service.d.ts +5 -4
  33. package/dist/types/runtime/model/embedding-model-service.d.ts +3 -3
  34. package/dist/types/runtime/model/language-model-service.d.ts +0 -30
  35. package/dist/types/runtime/model/model-call-policy.d.ts +0 -58
  36. package/dist/types/runtime/runner/runner-runtime-service.d.ts +63 -74
  37. package/dist/types/runtime/schedule/scheduler-service.d.ts +5 -5
  38. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +0 -40
  39. package/dist/types/runtime/tool/tool-runtime-service.d.ts +6 -6
  40. package/dist/types/runtime/wait/wait-service.d.ts +2 -2
  41. package/dist/types/runtime/wait/wait-signal.d.ts +3 -3
  42. package/dist/types/runtime/workflow/execution-workflow.d.ts +15 -20
  43. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +16 -15
  44. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +4 -4
  45. package/dist/types/schema/agent-schema.d.ts +0 -8
  46. package/dist/types/schema/execution-schema.d.ts +4 -4
  47. package/dist/types/store-sql/address/address-book-repository.d.ts +2 -2
  48. package/dist/types/store-sql/agent/agent-definition-repository.d.ts +3 -3
  49. package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
  50. package/dist/types/store-sql/child/child-execution-repository.d.ts +2 -2
  51. package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +2 -2
  52. package/dist/types/store-sql/compaction/compaction-repository.d.ts +2 -2
  53. package/dist/types/store-sql/database/database-service.d.ts +11 -12
  54. package/dist/types/store-sql/database/notification-bus.d.ts +3 -3
  55. package/dist/types/store-sql/envelope/envelope-repository.d.ts +2 -2
  56. package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
  57. package/dist/types/store-sql/execution/execution-repository.d.ts +12 -12
  58. package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +3 -3
  59. package/dist/types/store-sql/memory/memory-repository.d.ts +5 -5
  60. package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
  61. package/dist/types/store-sql/schedule/schedule-repository.d.ts +2 -2
  62. package/dist/types/store-sql/schema/relay-schema.d.ts +21 -21
  63. package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
  64. package/dist/types/store-sql/session/session-repository.d.ts +6 -6
  65. package/dist/types/store-sql/skill/skill-definition-repository.d.ts +2 -2
  66. package/dist/types/store-sql/steering/steering-repository.d.ts +2 -2
  67. package/dist/types/store-sql/tenant/tenant-id.d.ts +3 -1
  68. package/dist/types/store-sql/tool/tool-call-repository.d.ts +2 -2
  69. package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +2 -2
  70. package/package.json +3 -14
@@ -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>;
@@ -4,19 +4,4 @@ export interface ContextEpoch {
4
4
  readonly dynamicSourceIds: ReadonlyArray<string>;
5
5
  }
6
6
  export declare const layerFromEpoch: (epoch: ContextEpoch) => import("effect/Layer").Layer<Instructions.Instructions, never, never>;
7
- /**
8
- * Delivers the assembled turn-zero system prompt through Baton's `Instructions`
9
- * seam instead of `Baton.Agent.RunOptions.system` (which makes Baton ignore its
10
- * `Instructions` registry entirely). Only the assembled SYSTEM STRING moves
11
- * through this seam — `PromptAssembler`'s blob/artifact prompt resolution has
12
- * no Baton equivalent and remains a permanent Relay responsibility
13
- * (docs/spec/28-prompt-assembly.md).
14
- *
15
- * Provided per-run, for fresh runs only: on resume, Baton ignores `Instructions`
16
- * once `RunOptions.history` is set (the durable transcript already carries the
17
- * assembled system message), so `agent-loop-service.ts` does not provide this
18
- * layer on the resume branch.
19
- *
20
- * @experimental
21
- */
22
7
  export declare const layer: (system: string) => import("effect/Layer").Layer<Instructions.Instructions, never, never>;
@@ -2,8 +2,8 @@ import { Permissions } from "@batonfx/core";
2
2
  import { Agent, Execution, Ids } from "../../schema/index";
3
3
  import { PermissionRuleRepository } from "../../store-sql/index";
4
4
  import { Effect, Layer } from "effect";
5
- import * as EventLog from "../execution/event-log-service";
6
- import * as WaitService from "../wait/wait-service";
5
+ import type { Interface as EventLogInterface } from "../execution/event-log-service";
6
+ import type { Interface as WaitServiceInterface } from "../wait/wait-service";
7
7
  export interface SequenceAllocator {
8
8
  readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
9
9
  readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
@@ -12,8 +12,8 @@ export interface SequenceAllocator {
12
12
  export interface Config {
13
13
  readonly ruleset: Agent.PermissionRuleset;
14
14
  readonly repository: PermissionRuleRepository.Interface;
15
- readonly waits: WaitService.Interface;
16
- readonly eventLog: EventLog.Interface;
15
+ readonly waits: WaitServiceInterface;
16
+ readonly eventLog: EventLogInterface;
17
17
  readonly allocator: SequenceAllocator;
18
18
  readonly executionId: Ids.ExecutionId;
19
19
  readonly agentName: string;
@@ -2,13 +2,13 @@ import { Steering } from "@batonfx/core";
2
2
  import { Execution, Ids } from "../../schema/index";
3
3
  import { SteeringRepository } from "../../store-sql/index";
4
4
  import { Effect, Layer } from "effect";
5
- import * as EventLog from "../execution/event-log-service";
5
+ import type { Interface } from "../execution/event-log-service";
6
6
  export interface SequenceAllocator {
7
7
  readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
8
8
  }
9
9
  export interface Config {
10
10
  readonly repository: SteeringRepository.Interface;
11
- readonly eventLog: EventLog.Interface;
11
+ readonly eventLog: Interface;
12
12
  readonly allocator: SequenceAllocator;
13
13
  readonly executionId: Ids.ExecutionId;
14
14
  readonly startedAt: number;
@@ -1,17 +1,11 @@
1
1
  import { ToolExecutor } from "@batonfx/core";
2
2
  import { Execution, Ids, Tool } from "../../schema/index";
3
3
  import { Effect, Layer } from "effect";
4
- import * as EventLog from "../execution/event-log-service";
5
- import * as ToolRuntime from "../tool/tool-runtime-service";
6
- /**
7
- * Per-run inputs the executor closes over. Mirrors the fields `runToolCall`
8
- * threaded before Baton owned the loop.
9
- *
10
- * @experimental
11
- */
4
+ import type { Interface as ToolRuntimeInterface, RegisteredTool } from "../tool/tool-runtime-service";
5
+ import type { Interface as EventLogInterface } from "../execution/event-log-service";
12
6
  export interface Config {
13
- readonly toolRuntime: ToolRuntime.Interface;
14
- readonly eventLog: EventLog.Interface;
7
+ readonly toolRuntime: ToolRuntimeInterface;
8
+ readonly eventLog: EventLogInterface;
15
9
  readonly allocator: {
16
10
  readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
17
11
  readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
@@ -22,17 +16,7 @@ export interface Config {
22
16
  readonly eventSequence: Execution.ExecutionEventSequence;
23
17
  readonly toolOutputMaxBytes?: number;
24
18
  readonly resumedToolCallId?: Ids.ToolCallId;
25
- readonly extraTools?: ReadonlyArray<ToolRuntime.RegisteredTool>;
19
+ readonly extraTools?: ReadonlyArray<RegisteredTool>;
26
20
  }
27
- /**
28
- * Baton `ToolExecutor` over Relay's `ToolRuntime`. Allocates sequences and maps
29
- * errors; `ToolRuntime.run` itself appends `tool.call.requested` /
30
- * `tool.result.received` and enforces idempotency by `call.id`.
31
- *
32
- * @experimental
33
- */
34
21
  export declare const make: (config: Config) => ToolExecutor.Interface;
35
- /**
36
- * @experimental
37
- */
38
22
  export declare const layer: (config: Config) => Layer.Layer<ToolExecutor.ToolExecutor>;
@@ -1,7 +1,7 @@
1
1
  import { ToolOutput } from "@batonfx/core";
2
2
  import { Effect, Layer, Option } from "effect";
3
- import * as BlobStore from "../content/blob-store-service";
4
- export declare const store: (blobStore: BlobStore.Interface, toolCallId: string, content: unknown) => Effect.Effect<Option.Option<string>, ToolOutput.ToolOutputError>;
5
- export declare const make: (blobStore: BlobStore.Interface) => ToolOutput.StoreInterface;
6
- export declare const layerFromBlobStore: (blobStore: BlobStore.Interface) => Layer.Layer<ToolOutput.ToolOutputStore>;
7
- export declare const layer: Layer.Layer<ToolOutput.ToolOutputStore, never, BlobStore.Service>;
3
+ import type { Interface as BlobStoreInterface, Service as BlobStoreService } from "../content/blob-store-service";
4
+ export declare const store: (blobStore: BlobStoreInterface, toolCallId: string, content: unknown) => Effect.Effect<Option.Option<string>, ToolOutput.ToolOutputError>;
5
+ export declare const make: (blobStore: BlobStoreInterface) => ToolOutput.StoreInterface;
6
+ export declare const layerFromBlobStore: (blobStore: BlobStoreInterface) => Layer.Layer<ToolOutput.ToolOutputStore>;
7
+ export declare const layer: Layer.Layer<ToolOutput.ToolOutputStore, never, BlobStoreService>;
@@ -1,27 +1,8 @@
1
1
  import { Execution } from "../../schema/index";
2
2
  import { Effect } from "effect";
3
- /**
4
- * Per-run monotonic execution-event sequence counter. Created inside
5
- * `AgentLoop.run` and closed over by the durable fold (delta / usage events) and
6
- * the `RelayToolExecutor` (tool events), so both share one counter exactly how
7
- * `state.nextEventSequence` threaded before Baton owned the loop.
8
- *
9
- * @experimental
10
- */
11
3
  export interface SequenceAllocator {
12
- /** Return the current sequence and advance the counter by `count`. */
13
4
  readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
14
- /** Read the current sequence without advancing. */
15
5
  readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
16
- /**
17
- * Set the counter to `sequence` (may move it down). Used to re-seed from the
18
- * durable log after `ToolRuntime.run`, mirroring the old `nextLoggedSequence`
19
- * recovery — a wait appends only `tool.call.requested`, so a naive advance
20
- * would over-count.
21
- */
22
6
  readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
23
7
  }
24
- /**
25
- * @experimental
26
- */
27
8
  export declare const make: (first: Execution.ExecutionEventSequence) => Effect.Effect<SequenceAllocator>;
@@ -1,7 +1,7 @@
1
1
  import { Agent, Execution, Ids, Shared } from "../../schema/index";
2
2
  import { ChildExecutionRepository } from "../../store-sql/index";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
- import * as EventLog from "../execution/event-log-service";
4
+ import { Service as EventLogService } from "../execution/event-log-service";
5
5
  declare const StaticChildRunPresetNotFound_base: Schema.Class<StaticChildRunPresetNotFound, Schema.TaggedStruct<"StaticChildRunPresetNotFound", {
6
6
  readonly preset_name: Schema.String;
7
7
  }>, import("effect/Cause").YieldableError>;
@@ -80,7 +80,7 @@ export interface ResolvedChildContext {
80
80
  readonly outputSchemaRef?: string;
81
81
  readonly metadata: Shared.Metadata;
82
82
  }
83
- export declare const layer: Layer.Layer<Service, never, ChildExecutionRepository.Service | EventLog.Service>;
83
+ export declare const layer: Layer.Layer<Service, never, ChildExecutionRepository.Service | EventLogService>;
84
84
  export declare const memoryLayer: Layer.Layer<Service, never, never>;
85
85
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
86
86
  export declare const resolveForDispatch: (input: Execution.SpawnChildRunInput) => Effect.Effect<ResolvedChildContext, StaticChildRunPresetNotFound | ChildRunScopeBroadened, never>;
@@ -1,8 +1,8 @@
1
1
  import { Content, Ids } from "../../schema/index";
2
2
  import { ChildExecutionRepository } from "../../store-sql/index";
3
3
  import { Context, Effect, Layer, Ref, Schema } from "effect";
4
- import * as EventLog from "../execution/event-log-service";
5
- import * as WaitService from "../wait/wait-service";
4
+ import { Service as EventLogService } from "../execution/event-log-service";
5
+ import { Service as WaitServiceService } from "../wait/wait-service";
6
6
  declare const ParentNotifyError_base: Schema.Class<ParentNotifyError, Schema.TaggedStruct<"ParentNotifyError", {
7
7
  readonly message: Schema.String;
8
8
  }>, import("effect/Cause").YieldableError>;
@@ -32,8 +32,8 @@ export interface SignalParentWaitInput {
32
32
  export interface MakeOptions {
33
33
  readonly signalWait: (input: SignalParentWaitInput) => Effect.Effect<void, unknown>;
34
34
  }
35
- export declare const make: (options: MakeOptions) => Effect.Effect<Interface, never, ChildExecutionRepository.Service | EventLog.Service | WaitService.Service>;
36
- export declare const layerWith: (options: MakeOptions) => Layer.Layer<Service, never, ChildExecutionRepository.Service | EventLog.Service | WaitService.Service>;
35
+ export declare const make: (options: MakeOptions) => Effect.Effect<Interface, never, ChildExecutionRepository.Service | EventLogService | WaitServiceService>;
36
+ export declare const layerWith: (options: MakeOptions) => Layer.Layer<Service, never, ChildExecutionRepository.Service | EventLogService | WaitServiceService>;
37
37
  export declare const memoryLayer: (notifications?: Ref.Ref<ReadonlyArray<NotifyInput>>) => Layer.Layer<Service, never, never>;
38
38
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
39
39
  export declare const notify: (input: NotifyInput) => Effect.Effect<void, ParentNotifyError, Service>;
@@ -1,9 +1,9 @@
1
1
  import { Agent, Content, Execution, Ids, Shared } from "../../schema/index";
2
2
  import { Effect, Schema } from "effect";
3
- import * as EventLog from "../execution/event-log-service";
4
- import * as ToolRuntime from "../tool/tool-runtime-service";
5
- import * as WaitService from "../wait/wait-service";
6
- import * as ChildRunService from "./child-run-service";
3
+ import type { RegisteredTool } from "../tool/tool-runtime-service";
4
+ import type { Interface as EventLogInterface } from "../execution/event-log-service";
5
+ import type { Interface as WaitServiceInterface } from "../wait/wait-service";
6
+ import type { Interface as ChildRunServiceInterface } from "./child-run-service";
7
7
  export declare const toolName = "spawn_child_run";
8
8
  export declare const permissionName = "relay.child_run.spawn";
9
9
  export declare const Input: Schema.Struct<{
@@ -190,22 +190,22 @@ export interface DispatchInput {
190
190
  readonly startedAt: number;
191
191
  readonly completedAt: number;
192
192
  readonly agentId: Ids.AgentId;
193
- readonly agentDefinitionRevision: Agent.DefinitionRevision;
194
- readonly agentDefinitionSnapshot: Agent.Definition;
195
- readonly agentDefinitionToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
193
+ readonly agentRevision: Agent.DefinitionRevision;
194
+ readonly agentSnapshot: Agent.Definition;
195
+ readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
196
196
  readonly metadata: Shared.Metadata;
197
197
  }
198
198
  export interface Config {
199
199
  readonly agent: Agent.Definition;
200
200
  readonly agentId: Ids.AgentId;
201
- readonly agentDefinitionRevision: Agent.DefinitionRevision;
202
- readonly agentDefinitionToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
203
- readonly childRuns: ChildRunService.Interface;
204
- readonly eventLog: EventLog.Interface;
205
- readonly waits: WaitService.Interface;
201
+ readonly agentRevision: Agent.DefinitionRevision;
202
+ readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
203
+ readonly childRuns: ChildRunServiceInterface;
204
+ readonly eventLog: EventLogInterface;
205
+ readonly waits: WaitServiceInterface;
206
206
  readonly dispatch: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
207
207
  }
208
208
  export declare const enabled: (agent: Agent.Definition) => boolean;
209
- export declare const registeredTool: (config: Config) => ToolRuntime.RegisteredTool;
209
+ export declare const registeredTool: (config: Config) => RegisteredTool;
210
210
  export declare const transferToolName: (name: string) => string;
211
- export declare const transferTools: (config: Config) => ReadonlyArray<ToolRuntime.RegisteredTool>;
211
+ export declare const transferTools: (config: Config) => ReadonlyArray<RegisteredTool>;
@@ -4,9 +4,9 @@ import { Rpc } from "effect/unstable/rpc";
4
4
  import type { WorkflowEngine } from "effect/unstable/workflow";
5
5
  import { Schema } from "effect";
6
6
  import type { Effect } from "effect";
7
- import type * as EventLog from "../execution/event-log-service";
8
- import type * as WaitService from "../wait/wait-service";
9
- import * as ExecutionWorkflow from "../workflow/execution-workflow";
7
+ import { ExecutionWorkflowFailed } from "../workflow/execution-workflow";
8
+ import type { Service as EventLogService } from "../execution/event-log-service";
9
+ import type { Service as WaitServiceService } from "../wait/wait-service";
10
10
  export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
11
11
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
12
12
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -69,11 +69,11 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
69
69
  readonly event_sequence: Schema.Int;
70
70
  readonly started_at: Schema.Int;
71
71
  readonly completed_at: Schema.Int;
72
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
72
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
73
73
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
74
74
  }>;
75
- readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
76
- readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
75
+ readonly agent_revision: Schema.optionalKey<Schema.Int>;
76
+ readonly agent_snapshot: Schema.optionalKey<Schema.Struct<{
77
77
  readonly name: Schema.String;
78
78
  readonly instructions: Schema.optionalKey<Schema.String>;
79
79
  readonly model: Schema.Struct<{
@@ -128,7 +128,7 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
128
128
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
129
129
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
130
130
  }>>;
131
- readonly agent_definition_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
131
+ readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
132
132
  readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
133
133
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
134
134
  }>;
@@ -152,7 +152,7 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
152
152
  }>;
153
153
  readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
154
154
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
155
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
155
+ }>, typeof ExecutionWorkflowFailed, never, never>;
156
156
  export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
157
157
  readonly workflow_execution_id: Schema.String;
158
158
  readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
@@ -160,7 +160,7 @@ export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
160
160
  };
161
161
  readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
162
162
  readonly signaled_at: Schema.Int;
163
- }>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
163
+ }>, Schema.Void, typeof ExecutionWorkflowFailed, never, never>;
164
164
  export declare const Cancel: Rpc.Rpc<"cancel", Schema.Struct<{
165
165
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
166
166
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -172,7 +172,7 @@ export declare const Cancel: Rpc.Rpc<"cancel", Schema.Struct<{
172
172
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
173
173
  };
174
174
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
175
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
175
+ }>, typeof ExecutionWorkflowFailed, never, never>;
176
176
  export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", Schema.Struct<{
177
177
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
178
178
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -235,11 +235,11 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
235
235
  readonly event_sequence: Schema.Int;
236
236
  readonly started_at: Schema.Int;
237
237
  readonly completed_at: Schema.Int;
238
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
238
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
239
239
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
240
240
  }>;
241
- readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
242
- readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
241
+ readonly agent_revision: Schema.optionalKey<Schema.Int>;
242
+ readonly agent_snapshot: Schema.optionalKey<Schema.Struct<{
243
243
  readonly name: Schema.String;
244
244
  readonly instructions: Schema.optionalKey<Schema.String>;
245
245
  readonly model: Schema.Struct<{
@@ -294,7 +294,7 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
294
294
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
295
295
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
296
296
  }>>;
297
- readonly agent_definition_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
297
+ readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
298
298
  readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
299
299
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
300
300
  }>;
@@ -318,14 +318,14 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
318
318
  }>;
319
319
  readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
320
320
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
321
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
321
+ }>, typeof ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
322
322
  readonly workflow_execution_id: Schema.String;
323
323
  readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
324
324
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
325
325
  };
326
326
  readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
327
327
  readonly signaled_at: Schema.Int;
328
- }>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
328
+ }>, Schema.Void, typeof ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
329
329
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
330
330
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
331
331
  };
@@ -336,8 +336,8 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
336
336
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
337
337
  };
338
338
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
339
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>>;
340
- 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>;
339
+ }>, typeof ExecutionWorkflowFailed, never, never>>;
340
+ export declare const layer: import("effect/Layer").Layer<never, never, ChildExecutionRepository.Service | ExecutionRepository.Service | EventLogService | WaitServiceService | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
341
341
  export declare const client: Effect.Effect<(entityId: string) => import("effect/unstable/rpc/RpcClient").RpcClient.From<Rpc.Rpc<"start", Schema.Struct<{
342
342
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
343
343
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -400,11 +400,11 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
400
400
  readonly event_sequence: Schema.Int;
401
401
  readonly started_at: Schema.Int;
402
402
  readonly completed_at: Schema.Int;
403
- readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
403
+ readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
404
404
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
405
405
  }>;
406
- readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
407
- readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
406
+ readonly agent_revision: Schema.optionalKey<Schema.Int>;
407
+ readonly agent_snapshot: Schema.optionalKey<Schema.Struct<{
408
408
  readonly name: Schema.String;
409
409
  readonly instructions: Schema.optionalKey<Schema.String>;
410
410
  readonly model: Schema.Struct<{
@@ -459,7 +459,7 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
459
459
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
460
460
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
461
461
  }>>;
462
- readonly agent_definition_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
462
+ readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
463
463
  readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
464
464
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
465
465
  }>;
@@ -483,14 +483,14 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
483
483
  }>;
484
484
  readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
485
485
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
486
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
486
+ }>, typeof ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
487
487
  readonly workflow_execution_id: Schema.String;
488
488
  readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
489
489
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
490
490
  };
491
491
  readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
492
492
  readonly signaled_at: Schema.Int;
493
- }>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
493
+ }>, Schema.Void, typeof ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
494
494
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
495
495
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
496
496
  };
@@ -501,4 +501,4 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
501
501
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
502
502
  };
503
503
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
504
- }>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>, import("effect/unstable/cluster/ClusterError").MailboxFull | import("effect/unstable/cluster/ClusterError").AlreadyProcessingMessage | import("effect/unstable/cluster/ClusterError").PersistenceError>, never, import("effect/unstable/cluster/Sharding").Sharding>;
504
+ }>, typeof ExecutionWorkflowFailed, never, never>, import("effect/unstable/cluster/ClusterError").MailboxFull | import("effect/unstable/cluster/ClusterError").AlreadyProcessingMessage | import("effect/unstable/cluster/ClusterError").PersistenceError>, never, import("effect/unstable/cluster/Sharding").Sharding>;
@@ -4,70 +4,23 @@ declare const ArtifactNotResolvable_base: Schema.Class<ArtifactNotResolvable, Sc
4
4
  readonly artifact_id: Schema.String;
5
5
  readonly reason: Schema.String;
6
6
  }>, import("effect/Cause").YieldableError>;
7
- /**
8
- * @experimental
9
- */
10
7
  export declare class ArtifactNotResolvable extends ArtifactNotResolvable_base {
11
8
  }
12
- /**
13
- * Artifacts resolve to Content parts (an artifact may be text, structured data,
14
- * or a blob reference). Resolution is single-level: the assembler resolves any
15
- * produced `blob-reference` through `BlobStore` in the same pass, but a nested
16
- * `artifact-reference` is an error.
17
- *
18
- * @experimental
19
- */
20
9
  export interface Interface {
21
10
  readonly resolve: (part: Content.ArtifactReferencePart) => Effect.Effect<ReadonlyArray<Content.Part>, ArtifactNotResolvable>;
22
11
  }
23
12
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ArtifactStore", Interface>;
24
- /**
25
- * @experimental
26
- */
27
13
  export declare class Service extends Service_base {
28
14
  }
29
- /**
30
- * Default store: preserves today's behavior — every artifact reference resolves
31
- * to a single text part carrying the stringified reference.
32
- *
33
- * @experimental
34
- */
35
15
  export declare const passthroughLayer: Layer.Layer<Service>;
36
- /**
37
- * Memory store implementation plus a `register` helper for tests.
38
- *
39
- * @experimental
40
- */
41
16
  export interface MemoryInterface extends Interface {
42
17
  readonly register: (artifact_id: string, parts: ReadonlyArray<Content.Part>) => Effect.Effect<void>;
43
18
  }
44
19
  declare const Memory_base: Context.ServiceClass<Memory, "@relayfx/runtime/ArtifactStore/Memory", MemoryInterface>;
45
- /**
46
- * @experimental
47
- */
48
20
  export declare class Memory extends Memory_base {
49
21
  }
50
- /**
51
- * In-memory store; `resolve` fails typed when the artifact is unknown. Provides
52
- * both {@link Service} and {@link Memory} (for `register` in tests).
53
- *
54
- * @experimental
55
- */
56
22
  export declare const memoryLayer: Layer.Layer<Service | Memory>;
57
- /**
58
- * Wraps a custom store implementation as a layer.
59
- *
60
- * @experimental
61
- */
62
23
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
63
- /**
64
- * @experimental
65
- */
66
24
  export declare const resolve: (part: Content.ArtifactReferencePart) => Effect.Effect<readonly Content.Part[], ArtifactNotResolvable, Service>;
67
- /**
68
- * Registers artifact parts in the memory store (see {@link memoryLayer}).
69
- *
70
- * @experimental
71
- */
72
25
  export declare const register: (artifact_id: string, parts: readonly Content.Part[]) => Effect.Effect<void, never, Memory>;
73
26
  export {};