@relayfx/sdk 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2173 -1645
- package/dist/types/relay/index.d.ts +1 -1
- package/dist/types/relay/operation.d.ts +4 -1
- package/dist/types/runtime/address/address-resolution-service.d.ts +3 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +25 -4
- package/dist/types/runtime/agent/relay-approvals.d.ts +9 -0
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +35 -0
- package/dist/types/runtime/agent/sequence-allocator.d.ts +27 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +9 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +7 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/runtime/model/language-model-service.d.ts +9 -3
- package/dist/types/runtime/observability/runtime-metrics.d.ts +19 -9
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +17 -13
- package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +67 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +6 -0
- package/dist/types/schema/agent-schema.d.ts +31 -0
- package/dist/types/schema/execution-schema.d.ts +5 -2
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ export * as Client from "./client";
|
|
|
3
3
|
export * as Database from "./database";
|
|
4
4
|
export * as Operation from "./operation";
|
|
5
5
|
export { Address, Agent, Content, Envelope, Execution, Ids, Schedule, Shared, Tool } from "../schema/index";
|
|
6
|
-
export { AddressBook, AddressResolution, AgentLoop, AgentRegistry, ArtifactStore, BlobStore, ChildRunService, EnvelopeService, EventLog, ExecutionEntity, ExecutionService, ExecutionWorkflow, LanguageModelService, ModelCallPolicy, PromptAssembler, SchedulerService, ToolRuntime, WaitService, } from "../runtime/index";
|
|
6
|
+
export { AddressBook, AddressResolution, AgentLoop, AgentRegistry, ArtifactStore, BlobStore, ChildRunService, EnvelopeService, EventLog, ExecutionEntity, ExecutionService, ExecutionWorkflow, LanguageModelService, ModelCallPolicy, PromptAssembler, SchedulerService, SchemaRegistry, ToolRuntime, WaitService, } from "../runtime/index";
|
|
7
7
|
export { RunnerRuntime } from "../runtime/index";
|
|
8
8
|
export { LanguageModelRegistration } from "../ai/index";
|
|
9
9
|
export { RelaySchema } from "../store-sql/index";
|
|
@@ -72,6 +72,9 @@ export declare const StartExecutionInput: Schema.Struct<{
|
|
|
72
72
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
73
73
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
74
74
|
}>>;
|
|
75
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
76
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
77
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
75
78
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
76
79
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
77
80
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -838,7 +841,7 @@ export declare const ReplayExecutionResult: Schema.Struct<{
|
|
|
838
841
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
839
842
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
840
843
|
}>;
|
|
841
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
844
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "model.usage.reported", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
842
845
|
readonly sequence: Schema.Int;
|
|
843
846
|
readonly cursor: Schema.String;
|
|
844
847
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -70,6 +70,9 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
70
70
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
71
71
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
72
72
|
}>>;
|
|
73
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
74
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
75
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
73
76
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
74
77
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
75
78
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -4,8 +4,9 @@ import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
|
4
4
|
import * as EventLog from "../execution/event-log-service";
|
|
5
5
|
import * as LanguageModelService from "../model/language-model-service";
|
|
6
6
|
import * as ModelCallPolicy from "../model/model-call-policy";
|
|
7
|
-
import * as
|
|
7
|
+
import * as SchemaRegistry from "../schema-registry/schema-registry-service";
|
|
8
8
|
import * as ToolRuntime from "../tool/tool-runtime-service";
|
|
9
|
+
import * as PromptAssembler from "./prompt-assembler-service";
|
|
9
10
|
declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
|
|
10
11
|
readonly message: Schema.String;
|
|
11
12
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
@@ -28,6 +29,18 @@ declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested,
|
|
|
28
29
|
}>, Cause.YieldableError>;
|
|
29
30
|
export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base {
|
|
30
31
|
}
|
|
32
|
+
declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
|
|
33
|
+
readonly tokens_used: Schema.Int;
|
|
34
|
+
readonly token_budget: Schema.Int;
|
|
35
|
+
readonly next_event_sequence: Schema.Int;
|
|
36
|
+
}>, Cause.YieldableError>;
|
|
37
|
+
/**
|
|
38
|
+
* Raised when an agent's per-execution `token_budget` is reached. Checked
|
|
39
|
+
* between turns at durable boundaries (never mid-stream); the execution fails
|
|
40
|
+
* terminally, exactly like `AgentLoopError` (docs/spec/07 + ADR-0021).
|
|
41
|
+
*/
|
|
42
|
+
export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
|
|
43
|
+
}
|
|
31
44
|
export interface RunInput {
|
|
32
45
|
readonly executionId: Ids.ExecutionId;
|
|
33
46
|
readonly agent: Agent.Definition;
|
|
@@ -42,12 +55,20 @@ export interface RunResult {
|
|
|
42
55
|
readonly nextEventSequence: Execution.ExecutionEventSequence;
|
|
43
56
|
}
|
|
44
57
|
export interface Interface {
|
|
45
|
-
readonly run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested>;
|
|
58
|
+
readonly run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded>;
|
|
46
59
|
}
|
|
47
60
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AgentLoop", Interface>;
|
|
48
61
|
export declare class Service extends Service_base {
|
|
49
62
|
}
|
|
50
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Prompt for the terminal structured turn. The transcript already holds the full
|
|
65
|
+
* conversation history (system message, user input, and every tool result), so
|
|
66
|
+
* this single instruction is enough to elicit the typed final output.
|
|
67
|
+
*
|
|
68
|
+
* @experimental
|
|
69
|
+
*/
|
|
70
|
+
export declare const STRUCTURED_TURN_PROMPT = "Return the final structured output for the task above.";
|
|
71
|
+
export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | ToolRuntime.Service | PromptAssembler.Service>;
|
|
51
72
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
52
|
-
export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested, Service>;
|
|
73
|
+
export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded, Service>;
|
|
53
74
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Approvals } from "@batonfx/core";
|
|
2
|
+
/**
|
|
3
|
+
* Relay's binding for Baton's `Approvals` seam. No Relay tool definition carries
|
|
4
|
+
* `needsApproval` today, so auto-approval leaves behavior unchanged; the file is
|
|
5
|
+
* the named seam the durable-Wait-backed HITL implementation will replace.
|
|
6
|
+
*
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export declare const layer: import("effect/Layer").Layer<Approvals.Approvals, never, never>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ToolExecutor } from "@batonfx/core";
|
|
2
|
+
import { Execution, Ids, Tool } from "../../schema/index";
|
|
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
|
+
*/
|
|
12
|
+
export interface Config {
|
|
13
|
+
readonly toolRuntime: ToolRuntime.Interface;
|
|
14
|
+
readonly eventLog: EventLog.Interface;
|
|
15
|
+
readonly allocator: {
|
|
16
|
+
readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
|
|
17
|
+
readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
|
|
18
|
+
};
|
|
19
|
+
readonly executionId: Ids.ExecutionId;
|
|
20
|
+
readonly permissions: ReadonlyArray<Tool.Permission>;
|
|
21
|
+
readonly startedAt: number;
|
|
22
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Baton `ToolExecutor` over Relay's `ToolRuntime`. Allocates sequences and maps
|
|
26
|
+
* errors; `ToolRuntime.run` itself appends `tool.call.requested` /
|
|
27
|
+
* `tool.result.received` and enforces idempotency by `call.id`.
|
|
28
|
+
*
|
|
29
|
+
* @experimental
|
|
30
|
+
*/
|
|
31
|
+
export declare const make: (config: Config) => ToolExecutor.Interface;
|
|
32
|
+
/**
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
export declare const layer: (config: Config) => Layer.Layer<ToolExecutor.ToolExecutor>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Execution } from "../../schema/index";
|
|
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
|
+
export interface SequenceAllocator {
|
|
12
|
+
/** Return the current sequence and advance the counter by `count`. */
|
|
13
|
+
readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
|
|
14
|
+
/** Read the current sequence without advancing. */
|
|
15
|
+
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
|
+
readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export declare const make: (first: Execution.ExecutionEventSequence) => Effect.Effect<SequenceAllocator>;
|
|
@@ -80,6 +80,9 @@ export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
|
80
80
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
81
81
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
82
82
|
}>>;
|
|
83
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
84
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
85
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
83
86
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
84
87
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
85
88
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -209,6 +212,9 @@ export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", S
|
|
|
209
212
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
210
213
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
211
214
|
}>>;
|
|
215
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
216
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
217
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
212
218
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
213
219
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
214
220
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -337,6 +343,9 @@ export declare const client: Effect.Effect<(entityId: string) => import("effect/
|
|
|
337
343
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
338
344
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
339
345
|
}>>;
|
|
346
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
347
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
348
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
340
349
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
341
350
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
342
351
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -36,6 +36,12 @@ export interface Interface {
|
|
|
36
36
|
readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
37
37
|
readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
38
38
|
readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, EventLogError>;
|
|
39
|
+
/**
|
|
40
|
+
* Total tokens (input + output) reported across every `model.usage.reported`
|
|
41
|
+
* event for the execution. Used to seed per-agent budget accounting on resume
|
|
42
|
+
* without replaying the full log.
|
|
43
|
+
*/
|
|
44
|
+
readonly sumUsage: (executionId: Ids.ExecutionId) => Effect.Effect<number, EventLogError>;
|
|
39
45
|
}
|
|
40
46
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EventLog", Interface>;
|
|
41
47
|
export declare class Service extends Service_base {
|
|
@@ -50,5 +56,6 @@ export declare const replay: (input: ReplayInput) => Effect.Effect<readonly Exec
|
|
|
50
56
|
export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
51
57
|
export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
52
58
|
export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, EventLogError, Service>;
|
|
59
|
+
export declare const sumUsage: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number, EventLogError, Service>;
|
|
53
60
|
export declare const stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | EventLogError, Service>;
|
|
54
61
|
export {};
|
|
@@ -15,6 +15,7 @@ export * as ParentNotifier from "./child/parent-notifier-service";
|
|
|
15
15
|
export * as PromptAssembler from "./agent/prompt-assembler-service";
|
|
16
16
|
export * as RunnerRuntime from "./runner/runner-runtime-service";
|
|
17
17
|
export * as SchedulerService from "./schedule/scheduler-service";
|
|
18
|
+
export * as SchemaRegistry from "./schema-registry/schema-registry-service";
|
|
18
19
|
export * as ToolRuntime from "./tool/tool-runtime-service";
|
|
19
20
|
export * as WaitService from "./wait/wait-service";
|
|
20
21
|
export * as WaitSignal from "./wait/wait-signal";
|
|
@@ -12,6 +12,12 @@ export declare const LanguageModelNotRegistered: typeof ModelRegistry.LanguageMo
|
|
|
12
12
|
export type LanguageModelNotRegistered = ModelRegistry.LanguageModelNotRegistered;
|
|
13
13
|
/** @deprecated Use `ModelRegistry.Registration`. */
|
|
14
14
|
export type Registration = ModelRegistry.Registration;
|
|
15
|
+
/**
|
|
16
|
+
* Throughput governance for the model registry layer.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Use `ModelRegistry.GovernanceOptions`.
|
|
19
|
+
*/
|
|
20
|
+
export type GovernanceOptions = ModelRegistry.GovernanceOptions;
|
|
15
21
|
/** @deprecated Use `ModelRegistry.RegisterInput`. */
|
|
16
22
|
export type RegisterInput = ModelRegistry.RegisterInput;
|
|
17
23
|
/** @deprecated Use `ModelRegistry.ModelEnvironment`. */
|
|
@@ -40,11 +46,11 @@ export declare const registrationFromLayer: <R>(input: {
|
|
|
40
46
|
readonly metadata?: ModelRegistry.Metadata;
|
|
41
47
|
}) => Effect.Effect<ModelRegistry.Registration, never, R>;
|
|
42
48
|
/** @deprecated Use `ModelRegistry.layer`. */
|
|
43
|
-
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration
|
|
49
|
+
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
|
|
44
50
|
/** @deprecated Use `ModelRegistry.layerFromRegistrationEffects`. */
|
|
45
|
-
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R
|
|
51
|
+
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: GovernanceOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
46
52
|
/** @deprecated Use `ModelRegistry.memoryLayer`. */
|
|
47
|
-
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration
|
|
53
|
+
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
|
|
48
54
|
/** @deprecated Use `ModelRegistry.testLayer`. */
|
|
49
55
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
50
56
|
/** @deprecated Use `ModelRegistry.register`. */
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
export declare const recordExecutionAccepted: Effect.Effect<void, never, never>;
|
|
3
|
+
export declare const recordExecutionFinished: (status: string) => Effect.Effect<void, never, never>;
|
|
4
|
+
export declare const recordEnvelopeSent: (routeKind: string) => Effect.Effect<void, never, never>;
|
|
5
|
+
export declare const recordWaitTransitioned: (state: string) => Effect.Effect<void, never, never>;
|
|
6
|
+
export declare const recordChildRunSpawned: (kind: string) => Effect.Effect<void, never, never>;
|
|
7
|
+
export declare const recordAddressResolved: (routeKind: string) => Effect.Effect<void, never, never>;
|
|
8
|
+
export declare const recordEventAppended: (eventType: string) => Effect.Effect<void, never, never>;
|
|
9
|
+
export declare const recordEventReplayed: (source: string, count: number) => Effect.Effect<void, never, never>;
|
|
10
|
+
export declare const recordRunnerReadinessChecked: (database: string) => Effect.Effect<void, never, never>;
|
|
11
|
+
export declare const recordModelUsage: (input: {
|
|
12
|
+
readonly provider: string;
|
|
13
|
+
readonly model: string;
|
|
14
|
+
readonly finishReason: string;
|
|
15
|
+
readonly inputTokens: number;
|
|
16
|
+
readonly outputTokens: number;
|
|
17
|
+
}) => Effect.Effect<void, never, never>;
|
|
18
|
+
export declare const recordToolCall: (tool: string, outcome: "success" | "failure" | "denied" | "wait") => Effect.Effect<void, never, never>;
|
|
19
|
+
export declare const recordExecutionDuration: (status: string, durationMillis: number) => Effect.Effect<void, never, never>;
|
|
@@ -16,6 +16,7 @@ import * as ModelCallPolicy from "../model/model-call-policy";
|
|
|
16
16
|
import * as ParentNotifier from "../child/parent-notifier-service";
|
|
17
17
|
import * as PromptAssembler from "../agent/prompt-assembler-service";
|
|
18
18
|
import * as SchedulerService from "../schedule/scheduler-service";
|
|
19
|
+
import * as SchemaRegistry from "../schema-registry/schema-registry-service";
|
|
19
20
|
import * as ToolRuntime from "../tool/tool-runtime-service";
|
|
20
21
|
import * as WaitService from "../wait/wait-service";
|
|
21
22
|
import * as WorkspacePlanner from "../workspace/workspace-planner-service";
|
|
@@ -79,7 +80,8 @@ export declare const layerWith: <CheckError, CheckIn, ClusterOut, ClusterError,
|
|
|
79
80
|
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
80
81
|
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
81
82
|
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
82
|
-
|
|
83
|
+
readonly schemaRegistryLayer?: Layer.Layer<SchemaRegistry.Service> | undefined;
|
|
84
|
+
}) => Layer.Layer<AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | SchedulerService.Service | Service | ClusterOut | RepositoryOut | LanguageModelOut, CheckError | ClusterError | RepositoryError | LanguageModelError | ToolRuntimeError | SchedulerError, RepositoryIn | Exclude<ClusterIn, RepositoryOut> | Exclude<Exclude<Sharding.Sharding, ClusterOut>, RepositoryOut> | Exclude<Exclude<MessageStorage.MessageStorage, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<AddressBookRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<AgentChatRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<AgentDefinitionRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<ChildExecutionRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<EnvelopeRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<ExecutionEventRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<ExecutionRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<ScheduleRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<WorkspaceLeaseRepository.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<LanguageModelService.Service, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<ShardingConfig.ShardingConfig, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<WorkflowEngine.WorkflowEngine, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<Sharding.Sharding, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<CheckIn, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<Exclude<SchedulerIn, AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | WorkspacePlanner.Service>, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut>>;
|
|
83
85
|
export declare const layerWithClient: <CheckError, CheckIn, ClusterOut, ClusterError, ClusterIn, RepositoryOut, RepositoryError, RepositoryIn, LanguageModelOut, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
84
86
|
readonly checkLayer: Layer.Layer<Service, CheckError, CheckIn>;
|
|
85
87
|
readonly clusterLayer: Layer.Layer<ClusterOut, ClusterError, ClusterIn>;
|
|
@@ -89,7 +91,8 @@ export declare const layerWithClient: <CheckError, CheckIn, ClusterOut, ClusterE
|
|
|
89
91
|
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
90
92
|
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
91
93
|
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
92
|
-
|
|
94
|
+
readonly schemaRegistryLayer?: Layer.Layer<SchemaRegistry.Service> | undefined;
|
|
95
|
+
}) => Layer.Layer<AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | WorkspacePlanner.Service | Service | ClusterOut | RepositoryOut | LanguageModelOut, CheckError | ClusterError | RepositoryError | LanguageModelError | ToolRuntimeError, RepositoryIn | Exclude<ClusterIn, RepositoryOut> | Exclude<Exclude<LanguageModelIn, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<AddressBookRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<AgentChatRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<AgentDefinitionRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<ChildExecutionRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<EnvelopeRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<ExecutionEventRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<ExecutionRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<ScheduleRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<WorkspaceLeaseRepository.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<LanguageModelService.Service, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<ShardingConfig.ShardingConfig, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Sharding.Sharding, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<CheckIn, LanguageModelOut>, ClusterOut>, RepositoryOut> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelOut>, ClusterOut>, RepositoryOut>>;
|
|
93
96
|
export declare const layerWithServices: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
94
97
|
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
95
98
|
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
@@ -97,7 +100,8 @@ export declare const layerWithServices: <DatabaseError, DatabaseIn, LanguageMode
|
|
|
97
100
|
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
98
101
|
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
99
102
|
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
100
|
-
|
|
103
|
+
readonly schemaRegistryLayer?: Layer.Layer<SchemaRegistry.Service> | undefined;
|
|
104
|
+
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage, Config.ConfigError | DatabaseError | LanguageModelError | ToolRuntimeError, import("effect/unstable/sql/SqlClient").SqlClient | DatabaseIn | Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelService.Service>, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
101
105
|
export declare const layerWithServicesMultiNode: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
102
106
|
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
103
107
|
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
@@ -107,26 +111,26 @@ export declare const layerWithServicesMultiNode: <DatabaseError, DatabaseIn, Lan
|
|
|
107
111
|
readonly rpcPort: number;
|
|
108
112
|
readonly assignedShardGroups: ReadonlyArray<string>;
|
|
109
113
|
} & ClusterHttpTuning;
|
|
110
|
-
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
114
|
+
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage, Config.ConfigError | DatabaseError | LanguageModelError | ToolRuntimeError, import("effect/unstable/sql/SqlClient").SqlClient | DatabaseIn | import("effect/unstable/http/HttpServer").HttpServer | Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelService.Service>, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
111
115
|
export declare const layerWithServicesMultiNodeClientOnly: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
112
116
|
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
113
117
|
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
114
118
|
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
115
119
|
readonly cluster?: ClusterHttpTuning | undefined;
|
|
116
|
-
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
120
|
+
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | Sharding.Sharding | Service | Runners.Runners | MessageStorage.MessageStorage, DatabaseError | LanguageModelError | ToolRuntimeError, import("effect/unstable/sql/SqlClient").SqlClient | DatabaseIn | Exclude<Exclude<LanguageModelIn, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelService.Service>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
117
121
|
export declare const layerWithLanguageModelService: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn>(options: {
|
|
118
122
|
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
119
123
|
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
120
|
-
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
121
|
-
export declare const layer: Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
124
|
+
}) => Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage, Config.ConfigError | DatabaseError | LanguageModelError, import("effect/unstable/sql/SqlClient").SqlClient | DatabaseIn | Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage>, Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
125
|
+
export declare const layer: Layer.Layer<Database.Service | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage, Config.ConfigError, import("@effect/sql-pg/PgClient").PgClient | import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
122
126
|
export declare const testLayerWithServices: <LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
123
127
|
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
124
128
|
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
125
|
-
}) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
126
|
-
export declare const testLayerWithLanguageModelService: <LanguageModelError, LanguageModelIn>(languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
127
|
-
export declare const testLayer: Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
128
|
-
export declare const testClientLayer: Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
129
|
-
export declare const testLayerWithDatabaseCheck: <DatabaseError, DatabaseIn>(databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
130
|
-
export declare const testClientLayerWithDatabaseCheck: <DatabaseError, DatabaseIn>(databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service |
|
|
129
|
+
}) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, Config.ConfigError | LanguageModelError | ToolRuntimeError, Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, SchemaRegistry.Service>, WaitService.Service>, EventLog.Service>, LanguageModelService.Service>, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
130
|
+
export declare const testLayerWithLanguageModelService: <LanguageModelError, LanguageModelIn>(languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, Config.ConfigError | LanguageModelError, Exclude<Exclude<Exclude<LanguageModelIn, WorkflowEngine.WorkflowEngine>, ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service>>;
|
|
131
|
+
export declare const testLayer: Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, Config.ConfigError, never>;
|
|
132
|
+
export declare const testClientLayer: Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | Sharding.Sharding | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, never, never>;
|
|
133
|
+
export declare const testLayerWithDatabaseCheck: <DatabaseError, DatabaseIn>(databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | WorkflowEngine.WorkflowEngine | Sharding.Sharding | SchedulerService.Service | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, Config.ConfigError | DatabaseError, DatabaseIn>;
|
|
134
|
+
export declare const testClientLayerWithDatabaseCheck: <DatabaseError, DatabaseIn>(databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>) => Layer.Layer<AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ClusterRegistryRepository.Service | EnvelopeRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ScheduleRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | LanguageModelService.Service | ModelCallPolicy.Service | SchemaRegistry.Service | WaitService.Service | ToolRuntime.Service | PromptAssembler.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | Sharding.Sharding | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, DatabaseError, DatabaseIn>;
|
|
131
135
|
export declare const check: () => Effect.Effect<ReadinessStatus, RunnerRuntimeError, Service>;
|
|
132
136
|
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Shared } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
declare const SchemaRefNotRegistered_base: Schema.Class<SchemaRefNotRegistered, Schema.TaggedStruct<"SchemaRefNotRegistered", {
|
|
4
|
+
readonly schema_ref: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
/**
|
|
7
|
+
* Raised when a `schema_ref` carried by an agent (`output_schema_ref` /
|
|
8
|
+
* `StructuredPart.schema_ref`) cannot be resolved to a registered schema.
|
|
9
|
+
* No fallback is applied — resolution is an execution-time typed failure,
|
|
10
|
+
* mirroring `ModelRegistry.LanguageModelNotRegistered`.
|
|
11
|
+
*
|
|
12
|
+
* @experimental
|
|
13
|
+
*/
|
|
14
|
+
export declare class SchemaRefNotRegistered extends SchemaRefNotRegistered_base {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A named schema registration. `ref` is the string agents carry in
|
|
18
|
+
* `output_schema_ref` / `StructuredPart.schema_ref` (e.g. `"schema:review-output"`).
|
|
19
|
+
* Schemas are code; refs are the durable pointer. Registration is
|
|
20
|
+
* composition-time (a layer input), never persisted.
|
|
21
|
+
*
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
24
|
+
export interface Registration {
|
|
25
|
+
readonly ref: string;
|
|
26
|
+
readonly schema: Schema.Top;
|
|
27
|
+
readonly metadata?: Shared.Metadata;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @experimental
|
|
31
|
+
*/
|
|
32
|
+
export interface Interface {
|
|
33
|
+
readonly register: (registration: Registration) => Effect.Effect<void>;
|
|
34
|
+
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
35
|
+
readonly resolve: (ref: string) => Effect.Effect<Registration, SchemaRefNotRegistered>;
|
|
36
|
+
}
|
|
37
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/SchemaRegistry", Interface>;
|
|
38
|
+
/**
|
|
39
|
+
* @experimental
|
|
40
|
+
*/
|
|
41
|
+
export declare class Service extends Service_base {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @experimental
|
|
45
|
+
*/
|
|
46
|
+
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service, never, never>;
|
|
47
|
+
/**
|
|
48
|
+
* @experimental
|
|
49
|
+
*/
|
|
50
|
+
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service, never, never>;
|
|
51
|
+
/**
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
55
|
+
/**
|
|
56
|
+
* @experimental
|
|
57
|
+
*/
|
|
58
|
+
export declare const register: (registration: Registration) => Effect.Effect<void, never, Service>;
|
|
59
|
+
/**
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
export declare const registrations: () => Effect.Effect<readonly Registration[], never, Service>;
|
|
63
|
+
/**
|
|
64
|
+
* @experimental
|
|
65
|
+
*/
|
|
66
|
+
export declare const resolve: (ref: string) => Effect.Effect<Registration, SchemaRefNotRegistered, Service>;
|
|
67
|
+
export {};
|
|
@@ -87,6 +87,9 @@ export declare const StartInput: Schema.Struct<{
|
|
|
87
87
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
88
88
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
89
89
|
}>>;
|
|
90
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
91
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
92
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
90
93
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
91
94
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
92
95
|
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
@@ -258,6 +261,9 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
258
261
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
259
262
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
260
263
|
}>>;
|
|
264
|
+
readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
|
|
265
|
+
readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
|
|
266
|
+
readonly token_budget: Schema.optionalKey<Schema.Int>;
|
|
261
267
|
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
262
268
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
263
269
|
readonly model: Schema.optionalKey<Schema.Struct<{
|