@relayfx/sdk 0.0.1
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 +8449 -0
- package/dist/migrations/20260701002839_sour_cerebro/migration.sql +160 -0
- package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +1971 -0
- package/dist/migrations/20260701041134_acoustic_hulk/migration.sql +30 -0
- package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +2372 -0
- package/dist/migrations/20260701160543_condemned_stryfe/migration.sql +2 -0
- package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +2442 -0
- package/dist/migrations/20260701220315_heavy_gorgon/migration.sql +5 -0
- package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +2495 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/migration.sql +24 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +2821 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/migration.sql +1 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +2821 -0
- package/dist/types/ai/index.d.ts +2 -0
- package/dist/types/ai/language-model/language-model-registration.d.ts +89 -0
- package/dist/types/relay/adapter-outbox.d.ts +19 -0
- package/dist/types/relay/client.d.ts +102 -0
- package/dist/types/relay/database.d.ts +11 -0
- package/dist/types/relay/index.d.ts +10 -0
- package/dist/types/relay/operation.d.ts +921 -0
- package/dist/types/runtime/address/address-book-service.d.ts +74 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +106 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +53 -0
- package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +102 -0
- package/dist/types/runtime/child/child-run-service.d.ts +90 -0
- package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +393 -0
- package/dist/types/runtime/content/artifact-store-service.d.ts +73 -0
- package/dist/types/runtime/content/blob-store-service.d.ts +87 -0
- package/dist/types/runtime/envelope/envelope-service.d.ts +52 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +54 -0
- package/dist/types/runtime/execution/execution-service.d.ts +62 -0
- package/dist/types/runtime/index.d.ts +25 -0
- package/dist/types/runtime/model/language-model-service.d.ts +58 -0
- package/dist/types/runtime/model/model-call-policy.d.ts +53 -0
- package/dist/types/runtime/observability/runtime-metrics.d.ts +9 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +132 -0
- package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +85 -0
- package/dist/types/runtime/wait/wait-service.d.ts +80 -0
- package/dist/types/runtime/wait/wait-signal.d.ts +15 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +335 -0
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +63 -0
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
- package/dist/types/schema/address-schema.d.ts +77 -0
- package/dist/types/schema/agent-schema.d.ts +360 -0
- package/dist/types/schema/content-schema.d.ts +106 -0
- package/dist/types/schema/envelope-schema.d.ts +167 -0
- package/dist/types/schema/execution-schema.d.ts +297 -0
- package/dist/types/schema/ids-schema.d.ts +61 -0
- package/dist/types/schema/index.d.ts +11 -0
- package/dist/types/schema/schedule-schema.d.ts +73 -0
- package/dist/types/schema/shared-schema.d.ts +11 -0
- package/dist/types/schema/tool-schema.d.ts +53 -0
- package/dist/types/schema/workspace-schema.d.ts +78 -0
- package/dist/types/store-sql/address/address-book-repository.d.ts +48 -0
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +49 -0
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +31 -0
- package/dist/types/store-sql/child/child-execution-repository.d.ts +61 -0
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +35 -0
- package/dist/types/store-sql/database/database-service.d.ts +25 -0
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +158 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +86 -0
- package/dist/types/store-sql/execution/execution-repository.d.ts +80 -0
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +42 -0
- package/dist/types/store-sql/index.d.ts +15 -0
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +83 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +2302 -0
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +66 -0
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +87 -0
- package/package.json +44 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Execution, Ids } from "../../schema/index";
|
|
2
|
+
import { ExecutionEventRepository } from "../../store-sql/index";
|
|
3
|
+
import { Context, Effect, Layer, Option, Schema, Stream } from "effect";
|
|
4
|
+
declare const EventLogCursorNotFound_base: Schema.Class<EventLogCursorNotFound, Schema.TaggedStruct<"EventLogCursorNotFound", {
|
|
5
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
6
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
7
|
+
};
|
|
8
|
+
readonly cursor: Schema.String;
|
|
9
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
|
+
export declare class EventLogCursorNotFound extends EventLogCursorNotFound_base {
|
|
11
|
+
}
|
|
12
|
+
declare const EventLogError_base: Schema.Class<EventLogError, Schema.TaggedStruct<"EventLogError", {
|
|
13
|
+
readonly message: Schema.String;
|
|
14
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
|
+
export declare class EventLogError extends EventLogError_base {
|
|
16
|
+
}
|
|
17
|
+
export interface ReplayInput {
|
|
18
|
+
readonly executionId: Ids.ExecutionId;
|
|
19
|
+
readonly afterCursor?: string;
|
|
20
|
+
readonly limit?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface FindBySequenceOrCursorInput {
|
|
23
|
+
readonly executionId: Ids.ExecutionId;
|
|
24
|
+
readonly sequence: Execution.ExecutionEventSequence;
|
|
25
|
+
readonly cursor: string;
|
|
26
|
+
}
|
|
27
|
+
export interface FindFirstByTypeAfterSequenceInput {
|
|
28
|
+
readonly executionId: Ids.ExecutionId;
|
|
29
|
+
readonly type: Execution.ExecutionEventType;
|
|
30
|
+
readonly afterSequence: Execution.ExecutionEventSequence;
|
|
31
|
+
}
|
|
32
|
+
export interface Interface {
|
|
33
|
+
readonly append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError>;
|
|
34
|
+
readonly replay: (input: ReplayInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, EventLogCursorNotFound | EventLogError>;
|
|
35
|
+
readonly stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | EventLogError>;
|
|
36
|
+
readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
37
|
+
readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
38
|
+
readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, EventLogError>;
|
|
39
|
+
}
|
|
40
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EventLog", Interface>;
|
|
41
|
+
export declare class Service extends Service_base {
|
|
42
|
+
}
|
|
43
|
+
export declare const layerFromRepository: Layer.Layer<Service, never, ExecutionEventRepository.Service>;
|
|
44
|
+
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
45
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
46
|
+
export declare const appendIdempotentTo: (eventLog: Interface, input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, never>;
|
|
47
|
+
export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
|
|
48
|
+
export declare const appendIdempotent: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
|
|
49
|
+
export declare const replay: (input: ReplayInput) => Effect.Effect<readonly Execution.ExecutionEvent[], EventLogCursorNotFound | EventLogError, Service>;
|
|
50
|
+
export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
51
|
+
export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError, Service>;
|
|
52
|
+
export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, EventLogError, Service>;
|
|
53
|
+
export declare const stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | EventLogError, Service>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Agent, Envelope, Execution, Ids, Shared } from "../../schema/index";
|
|
2
|
+
import { ExecutionRepository } from "../../store-sql/index";
|
|
3
|
+
import { Context, Effect, Layer, Schema, Stream } from "effect";
|
|
4
|
+
import { ShardingConfig } from "effect/unstable/cluster";
|
|
5
|
+
import * as ChildRunService from "../child/child-run-service";
|
|
6
|
+
import * as EventLog from "./event-log-service";
|
|
7
|
+
declare const ExecutionServiceError_base: Schema.Class<ExecutionServiceError, Schema.TaggedStruct<"ExecutionServiceError", {
|
|
8
|
+
readonly message: Schema.String;
|
|
9
|
+
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
10
|
+
}>, import("effect/Cause").YieldableError>;
|
|
11
|
+
export declare class ExecutionServiceError extends ExecutionServiceError_base {
|
|
12
|
+
}
|
|
13
|
+
export interface AcceptInput {
|
|
14
|
+
readonly executionId: Ids.ExecutionId;
|
|
15
|
+
readonly rootAddressId: Ids.AddressId;
|
|
16
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
17
|
+
readonly createdAt: number;
|
|
18
|
+
readonly agentDefinitionId?: Ids.AgentDefinitionId;
|
|
19
|
+
readonly agentDefinitionRevision?: Agent.DefinitionRevision;
|
|
20
|
+
readonly agentDefinitionSnapshot?: Agent.Definition;
|
|
21
|
+
readonly metadata?: Shared.Metadata;
|
|
22
|
+
}
|
|
23
|
+
export interface RunInput {
|
|
24
|
+
readonly executionId: Ids.ExecutionId;
|
|
25
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
26
|
+
readonly startedAt: number;
|
|
27
|
+
readonly completedAt: number;
|
|
28
|
+
readonly program: Effect.Effect<RunProgramResult, ExecutionServiceError>;
|
|
29
|
+
}
|
|
30
|
+
export interface RunProgramResult {
|
|
31
|
+
readonly _tag?: "completed" | "waiting";
|
|
32
|
+
readonly waitId?: Ids.WaitId;
|
|
33
|
+
readonly metadata?: Shared.Metadata;
|
|
34
|
+
readonly nextEventSequence?: Execution.ExecutionEventSequence;
|
|
35
|
+
}
|
|
36
|
+
export interface CancelInput {
|
|
37
|
+
readonly executionId: Ids.ExecutionId;
|
|
38
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
39
|
+
readonly cancelledAt: number;
|
|
40
|
+
readonly reason?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface Interface {
|
|
43
|
+
readonly accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
|
|
44
|
+
readonly run: (input: RunInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
|
|
45
|
+
readonly cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
|
|
46
|
+
readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError>;
|
|
47
|
+
readonly spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError>;
|
|
48
|
+
readonly stream: (input: EventLog.ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError>;
|
|
49
|
+
}
|
|
50
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ExecutionService", Interface>;
|
|
51
|
+
export declare class Service extends Service_base {
|
|
52
|
+
}
|
|
53
|
+
export declare const layer: Layer.Layer<Service, never, ExecutionRepository.Service | EventLog.Service | ChildRunService.Service | ShardingConfig.ShardingConfig>;
|
|
54
|
+
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
55
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
56
|
+
export declare const accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
|
|
57
|
+
export declare const run: (input: RunInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
|
|
58
|
+
export declare const cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
|
|
59
|
+
export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError, Service>;
|
|
60
|
+
export declare const spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError, Service>;
|
|
61
|
+
export declare const stream: (input: EventLog.ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError, Service>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * as AddressBook from "./address/address-book-service";
|
|
2
|
+
export * as AddressResolution from "./address/address-resolution-service";
|
|
3
|
+
export * as AgentLoop from "./agent/agent-loop-service";
|
|
4
|
+
export * as AgentRegistry from "./agent/agent-registry-service";
|
|
5
|
+
export * as ArtifactStore from "./content/artifact-store-service";
|
|
6
|
+
export * as BlobStore from "./content/blob-store-service";
|
|
7
|
+
export * as ChildRunService from "./child/child-run-service";
|
|
8
|
+
export * as ExecutionEntity from "./cluster/execution-entity";
|
|
9
|
+
export * as EnvelopeService from "./envelope/envelope-service";
|
|
10
|
+
export * as EventLog from "./execution/event-log-service";
|
|
11
|
+
export * as ExecutionService from "./execution/execution-service";
|
|
12
|
+
export * as LanguageModelService from "./model/language-model-service";
|
|
13
|
+
export * as ModelCallPolicy from "./model/model-call-policy";
|
|
14
|
+
export * as ParentNotifier from "./child/parent-notifier-service";
|
|
15
|
+
export * as PromptAssembler from "./agent/prompt-assembler-service";
|
|
16
|
+
export * as RunnerRuntime from "./runner/runner-runtime-service";
|
|
17
|
+
export * as SchedulerService from "./schedule/scheduler-service";
|
|
18
|
+
export * as ToolRuntime from "./tool/tool-runtime-service";
|
|
19
|
+
export * as WaitService from "./wait/wait-service";
|
|
20
|
+
export * as WaitSignal from "./wait/wait-signal";
|
|
21
|
+
export * as WorkspacePlanner from "./workspace/workspace-planner-service";
|
|
22
|
+
export * as WorkspaceProvider from "./workspace/workspace-provider-service";
|
|
23
|
+
export * as WorkspaceRuntime from "./workspace/workspace-runtime-service";
|
|
24
|
+
export * as ExecutionWorkflow from "./workflow/execution-workflow";
|
|
25
|
+
export declare const runtimePackage = "./index";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Delegates to `@batonfx/core` `ModelRegistry`. Import Baton's
|
|
3
|
+
* `ModelRegistry` directly in new code; this module remains only so existing
|
|
4
|
+
* Relay runtime consumers keep their `Agent.ModelSelection`-based surface.
|
|
5
|
+
*/
|
|
6
|
+
import { ModelRegistry } from "@batonfx/core";
|
|
7
|
+
import { Agent } from "../../schema/index";
|
|
8
|
+
import { Context, Effect, Layer } from "effect";
|
|
9
|
+
/** @deprecated Use `ModelRegistry.LanguageModelNotRegistered`. */
|
|
10
|
+
export declare const LanguageModelNotRegistered: typeof ModelRegistry.LanguageModelNotRegistered;
|
|
11
|
+
/** @deprecated Use `ModelRegistry.LanguageModelNotRegistered`. */
|
|
12
|
+
export type LanguageModelNotRegistered = ModelRegistry.LanguageModelNotRegistered;
|
|
13
|
+
/** @deprecated Use `ModelRegistry.Registration`. */
|
|
14
|
+
export type Registration = ModelRegistry.Registration;
|
|
15
|
+
/** @deprecated Use `ModelRegistry.RegisterInput`. */
|
|
16
|
+
export type RegisterInput = ModelRegistry.RegisterInput;
|
|
17
|
+
/** @deprecated Use `ModelRegistry.ModelEnvironment`. */
|
|
18
|
+
export type ModelEnvironment = ModelRegistry.ModelEnvironment;
|
|
19
|
+
/** @deprecated Use `ModelRegistry.Interface`. */
|
|
20
|
+
export interface Interface {
|
|
21
|
+
readonly register: (input: RegisterInput) => Effect.Effect<void>;
|
|
22
|
+
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
23
|
+
readonly provide: <A, E, R>(selection: Agent.ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | LanguageModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
24
|
+
readonly provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | LanguageModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
25
|
+
}
|
|
26
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/LanguageModelService", Interface>;
|
|
27
|
+
/** @deprecated Use `ModelRegistry.Service`. */
|
|
28
|
+
export declare class Service extends Service_base {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use `ModelRegistry.registrationFromLayer`. Note the `metadata`
|
|
32
|
+
* parameter type widens from `Shared.Metadata` to `ModelRegistry.Metadata`,
|
|
33
|
+
* which `Shared.Metadata` satisfies.
|
|
34
|
+
*/
|
|
35
|
+
export declare const registrationFromLayer: <R>(input: {
|
|
36
|
+
readonly provider: string;
|
|
37
|
+
readonly model: string;
|
|
38
|
+
readonly registrationKey?: string;
|
|
39
|
+
readonly layer: Layer.Layer<import("effect/unstable/ai/LanguageModel").LanguageModel, never, R>;
|
|
40
|
+
readonly metadata?: ModelRegistry.Metadata;
|
|
41
|
+
}) => Effect.Effect<ModelRegistry.Registration, never, R>;
|
|
42
|
+
/** @deprecated Use `ModelRegistry.layer`. */
|
|
43
|
+
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service, never, never>;
|
|
44
|
+
/** @deprecated Use `ModelRegistry.layerFromRegistrationEffects`. */
|
|
45
|
+
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
46
|
+
/** @deprecated Use `ModelRegistry.memoryLayer`. */
|
|
47
|
+
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service, never, never>;
|
|
48
|
+
/** @deprecated Use `ModelRegistry.testLayer`. */
|
|
49
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
50
|
+
/** @deprecated Use `ModelRegistry.register`. */
|
|
51
|
+
export declare const register: (input: ModelRegistry.RegisterInput) => Effect.Effect<void, never, Service>;
|
|
52
|
+
/** @deprecated Use `ModelRegistry.registrations`. */
|
|
53
|
+
export declare const registrations: () => Effect.Effect<readonly ModelRegistry.Registration[], never, Service>;
|
|
54
|
+
/** @deprecated Use `ModelRegistry.provide`. */
|
|
55
|
+
export declare const provide: <A, E, R>(selection: Agent.ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
|
|
56
|
+
/** @deprecated Use `ModelRegistry.provide` with the agent's model selection. */
|
|
57
|
+
export declare const provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Context, Layer, Schedule } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Classification of a model-call failure.
|
|
4
|
+
*
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export type Classification = "transient" | "terminal";
|
|
8
|
+
/**
|
|
9
|
+
* Runtime-level policy for retrying transient model-call failures.
|
|
10
|
+
*
|
|
11
|
+
* @experimental
|
|
12
|
+
*/
|
|
13
|
+
export interface Interface {
|
|
14
|
+
readonly classify: (error: unknown) => Classification;
|
|
15
|
+
readonly retrySchedule: Schedule.Schedule<unknown>;
|
|
16
|
+
}
|
|
17
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ModelCallPolicy", Interface>;
|
|
18
|
+
/**
|
|
19
|
+
* @experimental
|
|
20
|
+
*/
|
|
21
|
+
export declare class Service extends Service_base {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Default classification: retryable AiErrors are transient, everything else terminal.
|
|
25
|
+
*
|
|
26
|
+
* @experimental
|
|
27
|
+
*/
|
|
28
|
+
export declare const defaultClassify: (error: unknown) => Classification;
|
|
29
|
+
/**
|
|
30
|
+
* Default schedule: jittered exponential from 1s, at most 4 retries.
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
export declare const defaultSchedule: Schedule.Schedule<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* @experimental
|
|
37
|
+
*/
|
|
38
|
+
export declare const make: (input?: Partial<Interface>) => Interface;
|
|
39
|
+
/**
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
export declare const layer: (input?: Partial<Interface>) => Layer.Layer<Service, never, never>;
|
|
43
|
+
/**
|
|
44
|
+
* Never retries — useful for tests that assert single-attempt behavior.
|
|
45
|
+
*
|
|
46
|
+
* @experimental
|
|
47
|
+
*/
|
|
48
|
+
export declare const noRetryLayer: Layer.Layer<Service, never, never>;
|
|
49
|
+
/**
|
|
50
|
+
* @experimental
|
|
51
|
+
*/
|
|
52
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const recordExecutionAccepted: import("effect/Effect").Effect<void, never, never>;
|
|
2
|
+
export declare const recordExecutionFinished: (status: string) => import("effect/Effect").Effect<void, never, never>;
|
|
3
|
+
export declare const recordEnvelopeSent: (routeKind: string) => import("effect/Effect").Effect<void, never, never>;
|
|
4
|
+
export declare const recordWaitTransitioned: (state: string) => import("effect/Effect").Effect<void, never, never>;
|
|
5
|
+
export declare const recordChildRunSpawned: (kind: string) => import("effect/Effect").Effect<void, never, never>;
|
|
6
|
+
export declare const recordAddressResolved: (routeKind: string) => import("effect/Effect").Effect<void, never, never>;
|
|
7
|
+
export declare const recordEventAppended: (eventType: string) => import("effect/Effect").Effect<void, never, never>;
|
|
8
|
+
export declare const recordEventReplayed: (source: string, count: number) => import("effect/Effect").Effect<void, never, never>;
|
|
9
|
+
export declare const recordRunnerReadinessChecked: (database: string) => import("effect/Effect").Effect<void, never, never>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { AddressBookRepository, AgentChatRepository, AgentDefinitionRepository, ChildExecutionRepository, ClusterRegistryRepository, Database, EnvelopeRepository, ExecutionEventRepository, ExecutionRepository, ScheduleRepository, ToolCallRepository, WorkspaceLeaseRepository } from "../../store-sql/index";
|
|
2
|
+
import { Config, Context, Duration, Effect, Layer, Option, Schema } from "effect";
|
|
3
|
+
import { MessageStorage, RunnerAddress, Runners, Sharding, ShardingConfig } from "effect/unstable/cluster";
|
|
4
|
+
import { WorkflowEngine } from "effect/unstable/workflow";
|
|
5
|
+
import * as AgentRegistry from "../agent/agent-registry-service";
|
|
6
|
+
import * as AgentLoop from "../agent/agent-loop-service";
|
|
7
|
+
import * as AddressBook from "../address/address-book-service";
|
|
8
|
+
import * as AddressResolution from "../address/address-resolution-service";
|
|
9
|
+
import * as ArtifactStore from "../content/artifact-store-service";
|
|
10
|
+
import * as BlobStore from "../content/blob-store-service";
|
|
11
|
+
import * as ChildRunService from "../child/child-run-service";
|
|
12
|
+
import * as EventLog from "../execution/event-log-service";
|
|
13
|
+
import * as ExecutionService from "../execution/execution-service";
|
|
14
|
+
import * as LanguageModelService from "../model/language-model-service";
|
|
15
|
+
import * as ModelCallPolicy from "../model/model-call-policy";
|
|
16
|
+
import * as ParentNotifier from "../child/parent-notifier-service";
|
|
17
|
+
import * as PromptAssembler from "../agent/prompt-assembler-service";
|
|
18
|
+
import * as SchedulerService from "../schedule/scheduler-service";
|
|
19
|
+
import * as ToolRuntime from "../tool/tool-runtime-service";
|
|
20
|
+
import * as WaitService from "../wait/wait-service";
|
|
21
|
+
import * as WorkspacePlanner from "../workspace/workspace-planner-service";
|
|
22
|
+
export declare const DatabaseMode: Schema.Literals<readonly ["sql", "memory"]>;
|
|
23
|
+
export type DatabaseMode = typeof DatabaseMode.Type;
|
|
24
|
+
export declare const ReadinessStatus: Schema.Struct<{
|
|
25
|
+
readonly database: Schema.Literals<readonly ["sql", "memory"]>;
|
|
26
|
+
readonly cluster: Schema.Literal<"ready">;
|
|
27
|
+
readonly workflow: Schema.Literals<readonly ["ready", "client"]>;
|
|
28
|
+
readonly executionEntity: Schema.Literals<readonly ["registered", "client"]>;
|
|
29
|
+
}>;
|
|
30
|
+
export interface ReadinessStatus extends Schema.Schema.Type<typeof ReadinessStatus> {
|
|
31
|
+
}
|
|
32
|
+
declare const RunnerRuntimeError_base: Schema.Class<RunnerRuntimeError, Schema.TaggedStruct<"RunnerRuntimeError", {
|
|
33
|
+
readonly message: Schema.String;
|
|
34
|
+
}>, import("effect/Cause").YieldableError>;
|
|
35
|
+
export declare class RunnerRuntimeError extends RunnerRuntimeError_base {
|
|
36
|
+
}
|
|
37
|
+
declare const ClusterConfigMismatch_base: Schema.Class<ClusterConfigMismatch, Schema.TaggedStruct<"ClusterConfigMismatch", {
|
|
38
|
+
readonly field: Schema.String;
|
|
39
|
+
readonly expected: Schema.String;
|
|
40
|
+
readonly actual: Schema.String;
|
|
41
|
+
}>, import("effect/Cause").YieldableError>;
|
|
42
|
+
export declare class ClusterConfigMismatch extends ClusterConfigMismatch_base {
|
|
43
|
+
}
|
|
44
|
+
export interface Interface {
|
|
45
|
+
readonly check: () => Effect.Effect<ReadinessStatus, RunnerRuntimeError>;
|
|
46
|
+
}
|
|
47
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/RunnerRuntime", Interface>;
|
|
48
|
+
export declare class Service extends Service_base {
|
|
49
|
+
}
|
|
50
|
+
export declare const shardingConfigFromEnv: () => Layer.Layer<ShardingConfig.ShardingConfig, Config.ConfigError, never>;
|
|
51
|
+
export interface ClusterHttpTuning {
|
|
52
|
+
readonly availableShardGroups?: ReadonlyArray<string> | undefined;
|
|
53
|
+
readonly shardsPerGroup?: number | undefined;
|
|
54
|
+
readonly shardLockRefreshInterval?: Duration.Input | undefined;
|
|
55
|
+
readonly shardLockExpiration?: Duration.Input | undefined;
|
|
56
|
+
readonly shardLockDisableAdvisory?: boolean | undefined;
|
|
57
|
+
}
|
|
58
|
+
export declare const clusterShardingConfigLayer: (options: {
|
|
59
|
+
readonly runnerAddress: Option.Option<RunnerAddress.RunnerAddress>;
|
|
60
|
+
readonly assignedShardGroups: ReadonlyArray<string>;
|
|
61
|
+
} & ClusterHttpTuning) => Layer.Layer<ShardingConfig.ShardingConfig, never, never>;
|
|
62
|
+
export declare const clusterLayerHttp: (options: {
|
|
63
|
+
readonly runnerHost: string;
|
|
64
|
+
readonly rpcPort: number;
|
|
65
|
+
readonly assignedShardGroups: ReadonlyArray<string>;
|
|
66
|
+
} & ClusterHttpTuning) => Layer.Layer<ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage, never, import("effect/unstable/sql/SqlClient").SqlClient | import("effect/unstable/http/HttpServer").HttpServer>;
|
|
67
|
+
export declare const clusterLayerHttpClientOnly: (options?: ClusterHttpTuning) => Layer.Layer<ShardingConfig.ShardingConfig | Sharding.Sharding | Runners.Runners | MessageStorage.MessageStorage, never, import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
68
|
+
export declare const assertClusterConfig: (expected: {
|
|
69
|
+
readonly shardsPerGroup: number;
|
|
70
|
+
readonly availableShardGroups: ReadonlyArray<string>;
|
|
71
|
+
}) => Effect.Effect<undefined, ClusterConfigMismatch, ShardingConfig.ShardingConfig>;
|
|
72
|
+
export declare const layerWith: <CheckError, CheckIn, ClusterOut, ClusterError, ClusterIn, RepositoryOut, RepositoryError, RepositoryIn, LanguageModelOut, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn, SchedulerError, SchedulerIn>(options: {
|
|
73
|
+
readonly checkLayer: Layer.Layer<Service, CheckError, CheckIn>;
|
|
74
|
+
readonly clusterLayer: Layer.Layer<ClusterOut, ClusterError, ClusterIn>;
|
|
75
|
+
readonly repositoryLayer: Layer.Layer<RepositoryOut, RepositoryError, RepositoryIn>;
|
|
76
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelOut, LanguageModelError, LanguageModelIn>;
|
|
77
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
78
|
+
readonly schedulerLayer: Layer.Layer<SchedulerService.Service, SchedulerError, SchedulerIn>;
|
|
79
|
+
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
80
|
+
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
81
|
+
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
82
|
+
}) => Layer.Layer<AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | ModelCallPolicy.Service | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | WorkspacePlanner.Service>, LanguageModelOut>, WorkflowEngine.WorkflowEngine>, ClusterOut>, RepositoryOut>>;
|
|
83
|
+
export declare const layerWithClient: <CheckError, CheckIn, ClusterOut, ClusterError, ClusterIn, RepositoryOut, RepositoryError, RepositoryIn, LanguageModelOut, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
84
|
+
readonly checkLayer: Layer.Layer<Service, CheckError, CheckIn>;
|
|
85
|
+
readonly clusterLayer: Layer.Layer<ClusterOut, ClusterError, ClusterIn>;
|
|
86
|
+
readonly repositoryLayer: Layer.Layer<RepositoryOut, RepositoryError, RepositoryIn>;
|
|
87
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelOut, LanguageModelError, LanguageModelIn>;
|
|
88
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
89
|
+
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
90
|
+
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
91
|
+
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
92
|
+
}) => Layer.Layer<AddressBook.Service | AgentRegistry.Service | AddressResolution.Service | EventLog.Service | ModelCallPolicy.Service | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.Service>, WaitService.Service>, EventLog.Service>, LanguageModelOut>, ClusterOut>, RepositoryOut>>;
|
|
93
|
+
export declare const layerWithServices: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
94
|
+
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
95
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
96
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
97
|
+
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service> | undefined;
|
|
98
|
+
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service> | undefined;
|
|
99
|
+
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service> | undefined;
|
|
100
|
+
}) => 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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.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
|
+
export declare const layerWithServicesMultiNode: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
102
|
+
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
103
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
104
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
105
|
+
readonly cluster: {
|
|
106
|
+
readonly runnerHost: string;
|
|
107
|
+
readonly rpcPort: number;
|
|
108
|
+
readonly assignedShardGroups: ReadonlyArray<string>;
|
|
109
|
+
} & 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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.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
|
+
export declare const layerWithServicesMultiNodeClientOnly: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
112
|
+
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
113
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
114
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolRuntimeError, ToolRuntimeIn>;
|
|
115
|
+
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.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
|
+
export declare const layerWithLanguageModelService: <DatabaseError, DatabaseIn, LanguageModelError, LanguageModelIn>(options: {
|
|
118
|
+
readonly databaseLayer: Layer.Layer<Database.Service, DatabaseError, DatabaseIn>;
|
|
119
|
+
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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>>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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
|
+
export declare const testLayerWithServices: <LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
123
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, LanguageModelError, LanguageModelIn>;
|
|
124
|
+
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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<ToolRuntimeIn, ModelCallPolicy.Service>, PromptAssembler.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>>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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>>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.Service | AgentLoop.Service | ChildRunService.Service | ParentNotifier.Service | ExecutionService.Service | ShardingConfig.ShardingConfig | WorkspacePlanner.Service | Sharding.Sharding | Service | Runners.Runners | MessageStorage.MessageStorage | MessageStorage.MemoryDriver, never, never>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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>;
|
|
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 | PromptAssembler.Service | WaitService.Service | ToolRuntime.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
|
+
export declare const check: () => Effect.Effect<ReadinessStatus, RunnerRuntimeError, Service>;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Schedule } from "../../schema/index";
|
|
2
|
+
import { ScheduleRepository } from "../../store-sql/index";
|
|
3
|
+
import { Config, Context, Cron, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import * as EventLog from "../execution/event-log-service";
|
|
5
|
+
import * as WaitService from "../wait/wait-service";
|
|
6
|
+
declare const SchedulerError_base: Schema.Class<SchedulerError, Schema.TaggedStruct<"SchedulerError", {
|
|
7
|
+
readonly message: Schema.String;
|
|
8
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
|
+
export declare class SchedulerError extends SchedulerError_base {
|
|
10
|
+
}
|
|
11
|
+
declare const ScheduleCronInvalid_base: Schema.Class<ScheduleCronInvalid, Schema.TaggedStruct<"ScheduleCronInvalid", {
|
|
12
|
+
readonly cron_expr: Schema.String;
|
|
13
|
+
readonly message: Schema.String;
|
|
14
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
|
+
export declare class ScheduleCronInvalid extends ScheduleCronInvalid_base {
|
|
16
|
+
}
|
|
17
|
+
export interface Interface {
|
|
18
|
+
readonly runOnce: Effect.Effect<number, SchedulerError>;
|
|
19
|
+
}
|
|
20
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/SchedulerService", Interface>;
|
|
21
|
+
export declare class Service extends Service_base {
|
|
22
|
+
}
|
|
23
|
+
export declare const pollIntervalMillisConfig: Config.Config<number>;
|
|
24
|
+
export declare const claimTtlMillisConfig: Config.Config<number>;
|
|
25
|
+
export declare const enabledConfig: Config.Config<boolean>;
|
|
26
|
+
export declare const workerIdConfig: Config.Config<string>;
|
|
27
|
+
export declare const parseCron: (cronExpr: string) => Effect.Effect<Cron.Cron, ScheduleCronInvalid>;
|
|
28
|
+
export declare const startIdempotencyKey: (schedule: Schedule.ScheduleRecord) => string;
|
|
29
|
+
export declare const make: Effect.Effect<Interface, Config.ConfigError, ScheduleRepository.Service | EventLog.Service | WaitService.Service | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
30
|
+
export declare const layer: Layer.Layer<Service, Config.ConfigError, ScheduleRepository.Service | EventLog.Service | WaitService.Service | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
31
|
+
export declare const memoryLayer: Layer.Layer<Service, Config.ConfigError, ScheduleRepository.Service | EventLog.Service | WaitService.Service | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
32
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
33
|
+
export declare const runOnce: () => Effect.Effect<number, SchedulerError, Service>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
|
+
import { ToolCallRepository } from "../../store-sql/index";
|
|
3
|
+
import * as Ai from "effect/unstable/ai";
|
|
4
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
+
import * as EventLog from "../execution/event-log-service";
|
|
6
|
+
import * as WaitService from "../wait/wait-service";
|
|
7
|
+
declare const ToolNotRegistered_base: Schema.Class<ToolNotRegistered, Schema.TaggedStruct<"ToolNotRegistered", {
|
|
8
|
+
readonly tool_name: Schema.String;
|
|
9
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
|
+
export declare class ToolNotRegistered extends ToolNotRegistered_base {
|
|
11
|
+
}
|
|
12
|
+
declare const ToolPermissionDenied_base: Schema.Class<ToolPermissionDenied, Schema.TaggedStruct<"ToolPermissionDenied", {
|
|
13
|
+
readonly tool_name: Schema.String;
|
|
14
|
+
readonly permission_name: Schema.String;
|
|
15
|
+
}>, import("effect/Cause").YieldableError>;
|
|
16
|
+
export declare class ToolPermissionDenied extends ToolPermissionDenied_base {
|
|
17
|
+
}
|
|
18
|
+
declare const ToolInputInvalid_base: Schema.Class<ToolInputInvalid, Schema.TaggedStruct<"ToolInputInvalid", {
|
|
19
|
+
readonly tool_name: Schema.String;
|
|
20
|
+
readonly message: Schema.String;
|
|
21
|
+
}>, import("effect/Cause").YieldableError>;
|
|
22
|
+
export declare class ToolInputInvalid extends ToolInputInvalid_base {
|
|
23
|
+
}
|
|
24
|
+
declare const ToolExecutionFailed_base: Schema.Class<ToolExecutionFailed, Schema.TaggedStruct<"ToolExecutionFailed", {
|
|
25
|
+
readonly tool_name: Schema.String;
|
|
26
|
+
readonly message: Schema.String;
|
|
27
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28
|
+
export declare class ToolExecutionFailed extends ToolExecutionFailed_base {
|
|
29
|
+
}
|
|
30
|
+
declare const ToolExecutionWaitRequested_base: Schema.Class<ToolExecutionWaitRequested, Schema.TaggedStruct<"ToolExecutionWaitRequested", {
|
|
31
|
+
readonly tool_name: Schema.String;
|
|
32
|
+
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
33
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
34
|
+
};
|
|
35
|
+
}>, import("effect/Cause").YieldableError>;
|
|
36
|
+
export declare class ToolExecutionWaitRequested extends ToolExecutionWaitRequested_base {
|
|
37
|
+
}
|
|
38
|
+
declare const ToolRuntimeError_base: Schema.Class<ToolRuntimeError, Schema.TaggedStruct<"ToolRuntimeError", {
|
|
39
|
+
readonly message: Schema.String;
|
|
40
|
+
}>, import("effect/Cause").YieldableError>;
|
|
41
|
+
export declare class ToolRuntimeError extends ToolRuntimeError_base {
|
|
42
|
+
}
|
|
43
|
+
export interface ToolExecutionContext {
|
|
44
|
+
readonly executionId: Ids.ExecutionId;
|
|
45
|
+
readonly call: Tool.Call;
|
|
46
|
+
readonly permissions: ReadonlyArray<Tool.Permission>;
|
|
47
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
48
|
+
readonly createdAt: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ToolCallInfoData extends ToolExecutionContext {
|
|
51
|
+
}
|
|
52
|
+
declare const ToolCallInfo_base: Context.ServiceClass<ToolCallInfo, "@relayfx/runtime/ToolCallInfo", ToolCallInfoData>;
|
|
53
|
+
export declare class ToolCallInfo extends ToolCallInfo_base {
|
|
54
|
+
}
|
|
55
|
+
export interface RegisteredTool {
|
|
56
|
+
readonly definition: Tool.Definition;
|
|
57
|
+
readonly aiTool?: Ai.Tool.Any;
|
|
58
|
+
readonly requiredPermissions?: ReadonlyArray<string>;
|
|
59
|
+
readonly inputSchema?: Schema.ConstraintDecoder<unknown, never>;
|
|
60
|
+
readonly handler?: (input: any, context: Ai.Toolkit.HandlerContext<Ai.Tool.Any>) => Effect.Effect<unknown, unknown, any>;
|
|
61
|
+
readonly run: (input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue, ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, any>;
|
|
62
|
+
}
|
|
63
|
+
export interface RunInput {
|
|
64
|
+
readonly executionId: Ids.ExecutionId;
|
|
65
|
+
readonly call: Tool.Call;
|
|
66
|
+
readonly permissions: ReadonlyArray<Tool.Permission>;
|
|
67
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
68
|
+
readonly createdAt: number;
|
|
69
|
+
}
|
|
70
|
+
export interface Interface {
|
|
71
|
+
readonly register: (tool: RegisteredTool) => Effect.Effect<void>;
|
|
72
|
+
readonly definitions: Effect.Effect<ReadonlyArray<Tool.Definition>>;
|
|
73
|
+
readonly run: (input: RunInput) => Effect.Effect<Tool.Result, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError>;
|
|
74
|
+
}
|
|
75
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ToolRuntime", Interface>;
|
|
76
|
+
export declare class Service extends Service_base {
|
|
77
|
+
}
|
|
78
|
+
export declare const definitionFromAiTool: (tool: Ai.Tool.Any, permissions?: ReadonlyArray<Tool.Permission>) => Tool.Definition;
|
|
79
|
+
export declare const layer: (initialTools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, ToolCallRepository.Service | EventLog.Service | WaitService.Service>;
|
|
80
|
+
export declare const memoryLayer: (tools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, never>;
|
|
81
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
82
|
+
export declare const register: (tool: RegisteredTool) => Effect.Effect<void, never, Service>;
|
|
83
|
+
export declare const definitions: () => Effect.Effect<readonly Tool.Definition[], never, Service>;
|
|
84
|
+
export declare const run: (input: RunInput) => Effect.Effect<Tool.Result, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, Service>;
|
|
85
|
+
export {};
|