@relayfx/sdk 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +67 -37
- package/dist/http-server.js +22 -0
- package/dist/{index-c2skef55.js → index-70m3hgk1.js} +16521 -18783
- package/dist/index-bknsjvwf.js +3423 -0
- package/dist/index-cphmds30.js +2852 -0
- package/dist/index-nb39b5ae.js +17 -0
- package/dist/{index-vwbatywf.js → index-szzswx0z.js} +23 -30
- package/dist/index.js +315 -844
- package/dist/mysql.js +18 -18
- package/dist/postgres.js +724 -24
- package/dist/sqlite.js +57 -147
- package/dist/types/ai/index.d.ts +2 -1
- package/dist/types/ai/language-model/language-model-registration.d.ts +9 -6
- package/dist/types/relay/adapter-outbox.d.ts +1 -1
- package/dist/types/relay/ai.d.ts +34 -2
- package/dist/types/relay/child-fan-out-admission.d.ts +5 -0
- package/dist/types/relay/child-fan-out-host.d.ts +73 -0
- package/dist/types/relay/client-public.d.ts +481 -0
- package/dist/types/relay/client.d.ts +1 -478
- package/dist/types/relay/database-identity.d.ts +4 -0
- package/dist/types/relay/http-server.d.ts +95 -0
- package/dist/types/relay/index.d.ts +37 -14
- package/dist/types/relay/internal-client.d.ts +22 -0
- package/dist/types/relay/language-model-registration.d.ts +13 -0
- package/dist/types/relay/mysql.d.ts +6 -7
- package/dist/types/relay/operation.d.ts +4 -4
- package/dist/types/relay/postgres.d.ts +10 -7
- package/dist/types/relay/runtime-acquisition-error.d.ts +61 -0
- package/dist/types/relay/runtime-database-adapter.d.ts +8 -5
- package/dist/types/relay/runtime-database-owner.d.ts +13 -0
- package/dist/types/relay/runtime-database-public.d.ts +10 -0
- package/dist/types/relay/runtime.d.ts +77 -72
- package/dist/types/relay/sqlite-runtime.d.ts +5 -18
- package/dist/types/relay/sqlite.d.ts +4 -31
- package/dist/types/relay/state-version-conflict.d.ts +12 -0
- package/dist/types/relay/tool-runtime.d.ts +44 -0
- package/dist/types/relay/tool-worker.d.ts +2 -2
- package/dist/types/relay/workflow-definition-host.d.ts +32 -0
- package/dist/types/runtime/agent/agent-loop-error.d.ts +21 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +6 -16
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +3 -3
- package/dist/types/runtime/cluster/execution-entity.d.ts +3 -3
- package/dist/types/runtime/execution/execution-service.d.ts +3 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/runtime/model/language-model-service.d.ts +5 -12
- package/dist/types/runtime/model/model-hub.d.ts +27 -0
- package/dist/types/runtime/presence/presence-contract.d.ts +24 -0
- package/dist/types/runtime/presence/presence-service.d.ts +6 -24
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +29 -13
- package/dist/types/runtime/session/session-store-service.d.ts +4 -1
- package/dist/types/runtime/tool/tool-runtime-contract.d.ts +121 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +6 -120
- package/dist/types/runtime/workflow/execution-workflow.d.ts +22 -24
- package/dist/types/schema/agent-schema.d.ts +4 -1
- package/dist/types/schema/execution-schema.d.ts +13 -2
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/pagination-schema.d.ts +17 -0
- package/dist/types/schema/shared-schema.d.ts +4 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +12 -12
- package/dist/types/store-sql/session/session-repository.d.ts +54 -11
- package/package.json +17 -14
- package/dist/index-d3dme13d.js +0 -141
- package/dist/index-pn652eef.js +0 -2860
- package/dist/types/relay/database.d.ts +0 -16
|
@@ -1,14 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as AdapterOutboxModule from "./adapter-outbox";
|
|
2
|
+
import * as ClientModule from "./client-public";
|
|
3
|
+
import * as ChildFanOutHostModule from "./child-fan-out-host";
|
|
4
|
+
import * as CommandModule from "./command";
|
|
5
|
+
import * as OperationModule from "./operation";
|
|
6
|
+
import * as ToolWorkerModule from "./tool-worker";
|
|
7
|
+
import * as RuntimeModule from "./runtime";
|
|
8
|
+
import * as WorkflowDefinitionHostModule from "./workflow-definition-host";
|
|
9
|
+
import { DatabaseIdentity, makeDatabaseIdentity } from "./database-identity";
|
|
10
|
+
import { Address, Agent, ChildOrchestration, Content, Entity, Envelope, Execution, Ids, Inbox, Pagination, Presence, Schedule, Shared, Skill, State, Tool, Waits, Workflow } from "../schema/index";
|
|
11
|
+
import * as ArtifactStoreModule from "../runtime/content/artifact-store-service";
|
|
12
|
+
import * as BlobStoreModule from "../runtime/content/blob-store-service";
|
|
13
|
+
import * as EmbeddingModelServiceModule from "../runtime/model/embedding-model-service";
|
|
14
|
+
import * as LanguageModelServiceModule from "../runtime/model/language-model-service";
|
|
15
|
+
import * as ModelHubModule from "../runtime/model/model-hub";
|
|
16
|
+
import * as PromptAssemblerModule from "../runtime/agent/prompt-assembler-service";
|
|
17
|
+
import * as SchemaRegistryModule from "../runtime/schema-registry/schema-registry-service";
|
|
18
|
+
import * as ToolRuntimeModule from "./tool-runtime";
|
|
19
|
+
import * as LanguageModelRegistrationModule from "./language-model-registration";
|
|
20
|
+
export import AdapterOutbox = AdapterOutboxModule;
|
|
21
|
+
export import Client = ClientModule;
|
|
22
|
+
export import ChildFanOutHost = ChildFanOutHostModule;
|
|
23
|
+
export import Command = CommandModule;
|
|
24
|
+
export import Operation = OperationModule;
|
|
25
|
+
export import ToolWorker = ToolWorkerModule;
|
|
26
|
+
export import Runtime = RuntimeModule;
|
|
27
|
+
export import WorkflowDefinitionHost = WorkflowDefinitionHostModule;
|
|
28
|
+
export import ArtifactStore = ArtifactStoreModule;
|
|
29
|
+
export import BlobStore = BlobStoreModule;
|
|
30
|
+
export import EmbeddingModelService = EmbeddingModelServiceModule;
|
|
31
|
+
export import LanguageModelService = LanguageModelServiceModule;
|
|
32
|
+
export import ModelHub = ModelHubModule;
|
|
33
|
+
export import PromptAssembler = PromptAssemblerModule;
|
|
34
|
+
export import SchemaRegistry = SchemaRegistryModule;
|
|
35
|
+
export import ToolRuntime = ToolRuntimeModule;
|
|
36
|
+
export import LanguageModelRegistration = LanguageModelRegistrationModule;
|
|
37
|
+
export { Address, Agent, ChildOrchestration, Content, DatabaseIdentity, Entity, Envelope, Execution, Ids, Inbox, Pagination, Presence, Schedule, Shared, Skill, State, Tool, Waits, Workflow, makeDatabaseIdentity, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Service as AddressBookService } from "../runtime/address/address-book-service";
|
|
2
|
+
import { Service as AgentRegistryService } from "../runtime/agent/agent-registry-service";
|
|
3
|
+
import { Service as EnvelopeServiceService } from "../runtime/envelope/envelope-service";
|
|
4
|
+
import { Service as EntityInstanceServiceService } from "../runtime/entity/entity-instance-service";
|
|
5
|
+
import { Service as EntityRegistryService } from "../runtime/entity/entity-registry-service";
|
|
6
|
+
import { Service as EventLogService } from "../runtime/execution/event-log-service";
|
|
7
|
+
import { Service as ExecutionServiceService } from "../runtime/execution/execution-service";
|
|
8
|
+
import { Service as ExecutionWatchService } from "../runtime/execution/execution-watch-service";
|
|
9
|
+
import { Service as SessionStreamService } from "../runtime/execution/session-stream-service";
|
|
10
|
+
import { Service as PresenceServiceService } from "../runtime/presence/presence-contract";
|
|
11
|
+
import { Service as SkillRegistryService } from "../runtime/skill/skill-registry-service";
|
|
12
|
+
import { Service as ExecutionStateService } from "../runtime/state/execution-state-service";
|
|
13
|
+
import { Service as ToolTransitionCoordinatorService } from "../runtime/tool/tool-transition-coordinator";
|
|
14
|
+
import { Service as TopicServiceService } from "../runtime/topic/topic-service";
|
|
15
|
+
import { Service as WaitServiceService } from "../runtime/wait/wait-service";
|
|
16
|
+
import { ChildExecutionRepository, ChildFanOutRepository, ClusterRegistryRepository, EnvelopeRepository, ExecutionRepository, InboxRepository, ScheduleRepository, SessionRepository, SteeringRepository, ToolCallRepository, WorkflowDefinitionRepository } from "../store-sql/portable";
|
|
17
|
+
import { Layer } from "effect";
|
|
18
|
+
import { Sharding, ShardingConfig } from "effect/unstable/cluster";
|
|
19
|
+
import { Service, type Interface } from "./client-public";
|
|
20
|
+
export type RuntimeRequirements = AgentRegistryService | EntityRegistryService | EntityInstanceServiceService | AddressBookService | ExecutionServiceService | EnvelopeServiceService | WaitServiceService | EventLogService | SessionStreamService | ExecutionWatchService | ExecutionStateService | PresenceServiceService | EnvelopeRepository.Service | ExecutionRepository.Service | InboxRepository.Service | TopicServiceService | ToolCallRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | SessionRepository.Service | SteeringRepository.Service | ClusterRegistryRepository.Service | ScheduleRepository.Service | SkillRegistryService | ToolTransitionCoordinatorService | WorkflowDefinitionRepository.Service | Sharding.Sharding | ShardingConfig.ShardingConfig;
|
|
21
|
+
export declare const layerFromRuntime: Layer.Layer<Service, never, RuntimeRequirements>;
|
|
22
|
+
export declare const testLayer: (implementation: Omit<Interface, "registerWorkflowDefinition" | "getWorkflowDefinitionRevision" | "listWorkflowDefinitionRevisions" | "startWorkflowRun" | "inspectWorkflowRun" | "replayWorkflowRun" | "cancelWorkflowRun" | "streamSession" | "watchExecutions" | "getPresence" | "watchPresence" | "registerEntityKind" | "getOrCreateEntity" | "getEntity" | "destroyEntity" | "listEntities" | "followExecution" | "pageExecutionEvents"> & Partial<Interface>) => Layer.Layer<Service, never, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModelRegistry } from "@batonfx/core";
|
|
2
|
+
import type { Effect } from "effect";
|
|
3
|
+
export type { AnthropicInput, WithAnthropicOptions } from "@batonfx/providers/anthropic";
|
|
4
|
+
export { anthropic, anthropicClientLayerConfig, withAnthropic, withAnthropicFetch } from "@batonfx/providers/anthropic";
|
|
5
|
+
export type { DeterministicInput, WithOpenAiOrDeterministicOptions } from "@batonfx/providers/deterministic";
|
|
6
|
+
export { withDeterministic, withOpenAiOrDeterministic, withOpenAiOrDeterministicFetch, } from "@batonfx/providers/deterministic";
|
|
7
|
+
export declare const deterministicModel: (input: import("@batonfx/providers/deterministic").DeterministicInput) => Effect.Effect<ModelRegistry.Registration>;
|
|
8
|
+
export type { OpenAiAccountCredential, OpenAiAccountCredentials, OpenAiAccountInput, OpenAiInput, RegistrationOptions, WithOpenAiOptions, } from "@batonfx/providers/openai";
|
|
9
|
+
export { openAi, openAiAccount, OpenAiAccountCredentialError, openAiClientLayerConfig, withOpenAi, withOpenAiAccount, withOpenAiAccountFetch, withOpenAiFetch, } from "@batonfx/providers/openai";
|
|
10
|
+
export type { OpenAiCompatibleInput, WithOpenAiCompatibleOptions } from "@batonfx/providers/openai-compat";
|
|
11
|
+
export { openAiCompatible, openAiCompatibleClientLayerConfig, withOpenAiCompatible, withOpenAiCompatibleFetch, } from "@batonfx/providers/openai-compat";
|
|
12
|
+
export type { OpenRouterInput, WithOpenRouterOptions } from "@batonfx/providers/openrouter";
|
|
13
|
+
export { openRouter, openRouterClientLayerConfig, withOpenRouter, withOpenRouterFetch, } from "@batonfx/providers/openrouter";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Layer } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
-
import { RuntimeMigrationError, type DatabaseIdentity, type
|
|
4
|
-
|
|
3
|
+
import { type AcquisitionError, RuntimeMigrationError, type DatabaseIdentity, type Database, type RuntimeConfigurationError } from "./runtime";
|
|
4
|
+
interface MySQLRuntimeDatabaseOptions<E, R> {
|
|
5
5
|
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
6
6
|
readonly databaseIdentity: DatabaseIdentity;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
export declare const migrate: <E, R>(options: MySQLRuntimeDatabaseOptions<E, R>) => Effect.Effect<void, RuntimeConfigurationError | RuntimeMigrationError, R>;
|
|
8
|
+
declare const database: <E, R>(options: MySQLRuntimeDatabaseOptions<E, R>) => Database<"mysql", RuntimeConfigurationError | RuntimeMigrationError | Extract<E, AcquisitionError>, R>;
|
|
10
9
|
export declare const MySQL: {
|
|
11
|
-
readonly
|
|
12
|
-
readonly migrate: typeof migrate;
|
|
10
|
+
readonly database: typeof database;
|
|
13
11
|
};
|
|
12
|
+
export {};
|
|
@@ -644,7 +644,7 @@ export declare const FollowExecutionItem: Schema.Union<readonly [Schema.Struct<{
|
|
|
644
644
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
645
645
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
646
646
|
}>;
|
|
647
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
647
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
648
648
|
readonly sequence: Schema.Int;
|
|
649
649
|
readonly cursor: Schema.String;
|
|
650
650
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -2392,7 +2392,7 @@ export declare const SessionStreamItem: Schema.Union<readonly [Schema.TaggedStru
|
|
|
2392
2392
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
2393
2393
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
2394
2394
|
}>;
|
|
2395
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2395
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2396
2396
|
readonly sequence: Schema.Int;
|
|
2397
2397
|
readonly cursor: Schema.String;
|
|
2398
2398
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -2703,7 +2703,7 @@ export declare const ReplayExecutionResult: Schema.Struct<{
|
|
|
2703
2703
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
2704
2704
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
2705
2705
|
}>;
|
|
2706
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2706
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2707
2707
|
readonly sequence: Schema.Int;
|
|
2708
2708
|
readonly cursor: Schema.String;
|
|
2709
2709
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -2785,7 +2785,7 @@ export declare const PageExecutionEventsResult: Schema.Struct<{
|
|
|
2785
2785
|
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
2786
2786
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
2787
2787
|
}>;
|
|
2788
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2788
|
+
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
2789
2789
|
readonly sequence: Schema.Int;
|
|
2790
2790
|
readonly cursor: Schema.String;
|
|
2791
2791
|
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Layer } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
-
import { RuntimeMigrationError, type DatabaseIdentity, type
|
|
4
|
-
|
|
3
|
+
import { type AcquisitionError, RuntimeMigrationError, type DatabaseIdentity, type Database, type RuntimeConfigurationError } from "./runtime";
|
|
4
|
+
interface PostgresRuntimeDatabaseOptions<E, R> {
|
|
5
5
|
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
6
6
|
readonly databaseIdentity: DatabaseIdentity;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
|
|
8
|
+
export interface PgTypeParsers {
|
|
9
|
+
readonly getTypeParser: (typeId: number, format?: "text" | "binary") => (value: string) => unknown;
|
|
10
|
+
}
|
|
11
|
+
declare const database: <E, R>(options: PostgresRuntimeDatabaseOptions<E, R>) => Database<"pg", RuntimeConfigurationError | RuntimeMigrationError | Extract<E, AcquisitionError>, R>;
|
|
10
12
|
export declare const Postgres: {
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
+
readonly database: typeof database;
|
|
14
|
+
readonly pgTypeParsers: PgTypeParsers;
|
|
13
15
|
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Cause, Schema } from "effect";
|
|
2
|
+
export declare const RuntimeConfigurationCategory: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
3
|
+
export type RuntimeConfigurationCategory = typeof RuntimeConfigurationCategory.Type;
|
|
4
|
+
export declare const RuntimeConfigurationScope: Schema.Literals<readonly ["host-layer", "database-client"]>;
|
|
5
|
+
export type RuntimeConfigurationScope = typeof RuntimeConfigurationScope.Type;
|
|
6
|
+
declare const RuntimeHostLayerFailure_base: Schema.Class<RuntimeHostLayerFailure, Schema.TaggedStruct<"RuntimeHostLayerFailure", {
|
|
7
|
+
readonly category: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
8
|
+
}>, Cause.YieldableError>;
|
|
9
|
+
export declare class RuntimeHostLayerFailure extends RuntimeHostLayerFailure_base {
|
|
10
|
+
}
|
|
11
|
+
export declare const SafeCauseReason: Schema.TaggedUnion<{
|
|
12
|
+
readonly Die: Schema.TaggedStruct<"Die", {
|
|
13
|
+
readonly defectTag: Schema.Literal<"UnknownDefect">;
|
|
14
|
+
}>;
|
|
15
|
+
readonly Fail: Schema.TaggedStruct<"Fail", {
|
|
16
|
+
readonly category: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
17
|
+
readonly errorTag: Schema.Literals<readonly ["RuntimeHostLayerFailure", "UnknownTypedFailure"]>;
|
|
18
|
+
}>;
|
|
19
|
+
readonly Interrupt: Schema.TaggedStruct<"Interrupt", {}>;
|
|
20
|
+
}>;
|
|
21
|
+
export type SafeCauseReason = typeof SafeCauseReason.Type;
|
|
22
|
+
export declare const SafeCause: Schema.Struct<{
|
|
23
|
+
readonly reasons: Schema.$Array<Schema.TaggedUnion<{
|
|
24
|
+
readonly Die: Schema.TaggedStruct<"Die", {
|
|
25
|
+
readonly defectTag: Schema.Literal<"UnknownDefect">;
|
|
26
|
+
}>;
|
|
27
|
+
readonly Fail: Schema.TaggedStruct<"Fail", {
|
|
28
|
+
readonly category: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
29
|
+
readonly errorTag: Schema.Literals<readonly ["RuntimeHostLayerFailure", "UnknownTypedFailure"]>;
|
|
30
|
+
}>;
|
|
31
|
+
readonly Interrupt: Schema.TaggedStruct<"Interrupt", {}>;
|
|
32
|
+
}>>;
|
|
33
|
+
readonly truncated: Schema.Boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export type SafeCause = typeof SafeCause.Type;
|
|
36
|
+
declare const RuntimeConfigurationError_base: Schema.Class<RuntimeConfigurationError, Schema.TaggedStruct<"RuntimeConfigurationError", {
|
|
37
|
+
readonly category: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
38
|
+
readonly scope: Schema.Literals<readonly ["host-layer", "database-client"]>;
|
|
39
|
+
readonly cause: Schema.Struct<{
|
|
40
|
+
readonly reasons: Schema.$Array<Schema.TaggedUnion<{
|
|
41
|
+
readonly Die: Schema.TaggedStruct<"Die", {
|
|
42
|
+
readonly defectTag: Schema.Literal<"UnknownDefect">;
|
|
43
|
+
}>;
|
|
44
|
+
readonly Fail: Schema.TaggedStruct<"Fail", {
|
|
45
|
+
readonly category: Schema.Literals<readonly ["missing-http-client", "provider-config", "model-registration", "tool-dependency", "database-config", "unknown-host-layer"]>;
|
|
46
|
+
readonly errorTag: Schema.Literals<readonly ["RuntimeHostLayerFailure", "UnknownTypedFailure"]>;
|
|
47
|
+
}>;
|
|
48
|
+
readonly Interrupt: Schema.TaggedStruct<"Interrupt", {}>;
|
|
49
|
+
}>>;
|
|
50
|
+
readonly truncated: Schema.Boolean;
|
|
51
|
+
}>;
|
|
52
|
+
}>, Cause.YieldableError>;
|
|
53
|
+
export declare class RuntimeConfigurationError extends RuntimeConfigurationError_base {
|
|
54
|
+
}
|
|
55
|
+
export declare const safeCause: <E>(cause: Cause.Cause<E>) => SafeCause;
|
|
56
|
+
export declare const normalizeAcquisitionCause: {
|
|
57
|
+
<E, P extends E = never>(cause: Cause.Cause<E>, scope: RuntimeConfigurationScope, preserve?: (error: E) => error is P): Cause.Cause<RuntimeConfigurationError | P>;
|
|
58
|
+
(scope: RuntimeConfigurationScope): <E>(cause: Cause.Cause<E>) => Cause.Cause<RuntimeConfigurationError>;
|
|
59
|
+
};
|
|
60
|
+
export declare const renderConfigurationError: (error: RuntimeConfigurationError) => string;
|
|
61
|
+
export {};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Effect, Layer } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
3
|
+
import type { Database } from "./runtime-database-public";
|
|
4
|
+
import { RuntimeConfigurationError, RuntimeMigrationError, type AcquisitionError, type DatabaseIdentity, type Dialect } from "./runtime";
|
|
5
|
+
export declare const normalizeClientLayer: <E, R>(clientLayer: Layer.Layer<SqlClient, E, R>) => Layer.Layer<SqlClient, RuntimeConfigurationError | Extract<E, AcquisitionError>, R>;
|
|
6
|
+
export declare const database: <D extends Dialect, E, R>(options: {
|
|
6
7
|
readonly dialect: D;
|
|
7
8
|
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
8
9
|
readonly databaseIdentity: DatabaseIdentity;
|
|
9
10
|
readonly ownership: "runtime-exclusive" | "shared-multi-node";
|
|
10
11
|
readonly schemaHead: string;
|
|
11
|
-
readonly
|
|
12
|
-
|
|
12
|
+
readonly acquire: Effect.Effect<void, RuntimeMigrationError, SqlClient>;
|
|
13
|
+
readonly verify: Effect.Effect<void, RuntimeMigrationError, SqlClient>;
|
|
14
|
+
readonly migrate: Effect.Effect<void, RuntimeMigrationError, SqlClient>;
|
|
15
|
+
}) => Database<D, RuntimeConfigurationError | RuntimeMigrationError | Extract<E, AcquisitionError>, R>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import type { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
+
import type { Service as RuntimeDatabaseService } from "./runtime-database";
|
|
4
|
+
import type { Dialect } from "./runtime";
|
|
5
|
+
import type { Database } from "./runtime-database-public";
|
|
6
|
+
import { RuntimeConfigurationError } from "./runtime-acquisition-error";
|
|
7
|
+
export declare const make: <D extends Dialect, E, R>(value: {
|
|
8
|
+
readonly dialect: D;
|
|
9
|
+
readonly migrate: Effect.Effect<void, E, R>;
|
|
10
|
+
readonly verify: Effect.Effect<void, E, R>;
|
|
11
|
+
readonly runtimeLayer: Layer.Layer<RuntimeDatabaseService | SqlClient, E, R>;
|
|
12
|
+
}) => Database<D, E, R>;
|
|
13
|
+
export declare const runtimeLayer: <D extends Dialect, E, R>(database: Database<D, E, R>) => Layer.Layer<RuntimeDatabaseService | SqlClient, E | RuntimeConfigurationError, R>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import type { Dialect } from "./runtime";
|
|
3
|
+
declare const DatabaseTypeId: unique symbol;
|
|
4
|
+
export interface Database<D extends Dialect, E = never, R = never> {
|
|
5
|
+
readonly [DatabaseTypeId]: D;
|
|
6
|
+
readonly dialect: D;
|
|
7
|
+
readonly migrate: Effect.Effect<void, E, R>;
|
|
8
|
+
readonly verify: Effect.Effect<void, E, R>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Service as PromptAssemblerService } from "../runtime/agent/prompt-assembler-service";
|
|
2
|
+
import { Service as ArtifactStoreService } from "../runtime/content/artifact-store-service";
|
|
3
|
+
import { Service as BlobStoreService } from "../runtime/content/blob-store-service";
|
|
4
|
+
import { Service as EmbeddingModelServiceService } from "../runtime/model/embedding-model-service";
|
|
5
|
+
import { Service as LanguageModelServiceService } from "../runtime/model/language-model-service";
|
|
6
|
+
import { Service as SchemaRegistryService } from "../runtime/schema-registry/schema-registry-service";
|
|
2
7
|
import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
3
8
|
import type { Duration } from "effect";
|
|
4
9
|
import type { HttpServer } from "effect/unstable/http/HttpServer";
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import { Service as
|
|
10
|
+
export { RuntimeConfigurationCategory, RuntimeConfigurationError, RuntimeConfigurationScope, RuntimeHostLayerFailure, SafeCause, SafeCauseReason, normalizeAcquisitionCause, renderConfigurationError, safeCause, } from "./runtime-acquisition-error";
|
|
11
|
+
import { RuntimeConfigurationError } from "./runtime-acquisition-error";
|
|
12
|
+
import { Service as ClientService } from "./client-public";
|
|
13
|
+
export { DatabaseIdentity, makeDatabaseIdentity } from "./database-identity";
|
|
14
|
+
import { Service as ChildFanOutHostService } from "./child-fan-out-host";
|
|
15
|
+
import { Service as WorkflowDefinitionHostService } from "./workflow-definition-host";
|
|
16
|
+
import type { Database } from "./runtime-database-public";
|
|
17
|
+
import type { ClientIdentifier, PresenceIdentifier } from "./http-server";
|
|
18
|
+
import type { Service as RuntimePresenceService } from "../runtime/presence/presence-contract";
|
|
19
|
+
import { HostService as ToolRuntimeHostService } from "./tool-runtime";
|
|
8
20
|
export { RuntimeCapabilityUnavailable } from "./runtime-capability-policy";
|
|
9
|
-
export
|
|
10
|
-
export declare const DatabaseIdentity: Schema.brand<Schema.NonEmptyString, "@relayfx/sdk/DatabaseIdentity">;
|
|
11
|
-
export type DatabaseIdentity = typeof DatabaseIdentity.Type;
|
|
12
|
-
export declare const makeDatabaseIdentity: (input: unknown) => DatabaseIdentity;
|
|
21
|
+
export type { Database } from "./runtime-database-public";
|
|
13
22
|
export declare const Dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
14
23
|
export type Dialect = typeof Dialect.Type;
|
|
15
|
-
export declare const DatabaseDialect: unique symbol;
|
|
16
|
-
export type DatabaseLayer<D extends Dialect, E = never, R = never> = Layer.Layer<RuntimeDatabaseService | SqlClient, E, R> & {
|
|
17
|
-
readonly [DatabaseDialect]: D;
|
|
18
|
-
};
|
|
19
|
-
declare const HostLayerError_base: Schema.Class<HostLayerError, Schema.TaggedStruct<"HostLayerError", {
|
|
20
|
-
readonly service: Schema.String;
|
|
21
|
-
readonly reason: Schema.String;
|
|
22
|
-
}>, Cause.YieldableError>;
|
|
23
|
-
export declare class HostLayerError extends HostLayerError_base {
|
|
24
|
-
}
|
|
25
|
-
declare const ConfigFailure_base: Schema.Class<ConfigFailure, Schema.TaggedStruct<"ConfigFailure", {
|
|
26
|
-
readonly reason: Schema.String;
|
|
27
|
-
}>, Cause.YieldableError>;
|
|
28
|
-
export declare class ConfigFailure extends ConfigFailure_base {
|
|
29
|
-
readonly originalCause?: unknown;
|
|
30
|
-
}
|
|
31
24
|
declare const NotificationFailure_base: Schema.Class<NotificationFailure, Schema.TaggedStruct<"NotificationFailure", {
|
|
32
25
|
readonly reason: Schema.String;
|
|
33
26
|
}>, Cause.YieldableError>;
|
|
@@ -82,21 +75,12 @@ declare const HostUnavailable_base: Schema.Class<HostUnavailable, Schema.TaggedS
|
|
|
82
75
|
}>, Cause.YieldableError>;
|
|
83
76
|
export declare class HostUnavailable extends HostUnavailable_base {
|
|
84
77
|
}
|
|
85
|
-
export type RuntimeConfigurationCause = ConfigFailure | HostLayerError;
|
|
86
78
|
export type RuntimeTopologyCause = ClusterFailure | DatabaseDialectMismatch | DatabaseAlreadyOwned | UnsupportedTopology;
|
|
87
79
|
export type RuntimeMigrationCause = SqlFailure | MigratorError | SchemaHeadMismatch;
|
|
88
80
|
export type RuntimeReadinessCause = SqlFailure | NotificationFailure | ClusterFailure | HostUnavailable;
|
|
89
|
-
export declare const RuntimeConfigurationCause: Schema.Schema<RuntimeConfigurationCause>;
|
|
90
81
|
export declare const RuntimeTopologyCause: Schema.Schema<RuntimeTopologyCause>;
|
|
91
82
|
export declare const RuntimeMigrationCause: Schema.Schema<RuntimeMigrationCause>;
|
|
92
83
|
export declare const RuntimeReadinessCause: Schema.Schema<RuntimeReadinessCause>;
|
|
93
|
-
declare const RuntimeConfigurationError_base: Schema.Class<RuntimeConfigurationError, Schema.TaggedStruct<"RuntimeConfigurationError", {
|
|
94
|
-
readonly setting: Schema.String;
|
|
95
|
-
readonly nextAction: Schema.Literals<readonly ["provide-setting", "provide-host-layer"]>;
|
|
96
|
-
readonly cause: Schema.Schema<RuntimeConfigurationCause>;
|
|
97
|
-
}>, Cause.YieldableError>;
|
|
98
|
-
export declare class RuntimeConfigurationError extends RuntimeConfigurationError_base {
|
|
99
|
-
}
|
|
100
84
|
declare const RuntimeTopologyError_base: Schema.Class<RuntimeTopologyError, Schema.TaggedStruct<"RuntimeTopologyError", {
|
|
101
85
|
readonly dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
102
86
|
readonly role: Schema.Literals<readonly ["embedded", "runner", "client"]>;
|
|
@@ -120,26 +104,45 @@ declare const RuntimeReadinessError_base: Schema.Class<RuntimeReadinessError, Sc
|
|
|
120
104
|
export declare class RuntimeReadinessError extends RuntimeReadinessError_base {
|
|
121
105
|
}
|
|
122
106
|
export type AcquisitionError = RuntimeConfigurationError | RuntimeTopologyError | RuntimeMigrationError;
|
|
123
|
-
export
|
|
124
|
-
readonly enabled: false
|
|
125
|
-
readonly source: "local-host"
|
|
126
|
-
readonly health: "not-applicable"
|
|
127
|
-
}
|
|
128
|
-
readonly enabled: true
|
|
129
|
-
readonly source: "local-host"
|
|
130
|
-
readonly health: "healthy"
|
|
131
|
-
}
|
|
132
|
-
export
|
|
133
|
-
|
|
134
|
-
readonly
|
|
135
|
-
readonly
|
|
136
|
-
readonly
|
|
137
|
-
readonly
|
|
138
|
-
readonly
|
|
139
|
-
readonly
|
|
140
|
-
|
|
141
|
-
readonly
|
|
142
|
-
|
|
107
|
+
export declare const RuntimeCapabilityStatus: Schema.Union<readonly [Schema.Struct<{
|
|
108
|
+
readonly enabled: Schema.Literal<false>;
|
|
109
|
+
readonly source: Schema.Literals<readonly ["local-host", "role-unavailable"]>;
|
|
110
|
+
readonly health: Schema.Literal<"not-applicable">;
|
|
111
|
+
}>, Schema.Struct<{
|
|
112
|
+
readonly enabled: Schema.Literal<true>;
|
|
113
|
+
readonly source: Schema.Literal<"local-host">;
|
|
114
|
+
readonly health: Schema.Literals<readonly ["healthy", "unhealthy"]>;
|
|
115
|
+
}>]>;
|
|
116
|
+
export type RuntimeCapabilityStatus = typeof RuntimeCapabilityStatus.Type;
|
|
117
|
+
export declare const ReadinessStatus: Schema.Struct<{
|
|
118
|
+
readonly ready: Schema.Literal<true>;
|
|
119
|
+
readonly role: Schema.Literals<readonly ["embedded", "runner", "client"]>;
|
|
120
|
+
readonly dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
121
|
+
readonly databaseIdentity: Schema.brand<Schema.NonEmptyString, "@relayfx/sdk/DatabaseIdentity">;
|
|
122
|
+
readonly schemaHead: Schema.String;
|
|
123
|
+
readonly notification: Schema.Literals<readonly ["pg-listen-notify", "polling", "in-process"]>;
|
|
124
|
+
readonly capabilities: Schema.Struct<{
|
|
125
|
+
readonly fanOut: Schema.Union<readonly [Schema.Struct<{
|
|
126
|
+
readonly enabled: Schema.Literal<false>;
|
|
127
|
+
readonly source: Schema.Literals<readonly ["local-host", "role-unavailable"]>;
|
|
128
|
+
readonly health: Schema.Literal<"not-applicable">;
|
|
129
|
+
}>, Schema.Struct<{
|
|
130
|
+
readonly enabled: Schema.Literal<true>;
|
|
131
|
+
readonly source: Schema.Literal<"local-host">;
|
|
132
|
+
readonly health: Schema.Literals<readonly ["healthy", "unhealthy"]>;
|
|
133
|
+
}>]>;
|
|
134
|
+
readonly workflowDefinition: Schema.Union<readonly [Schema.Struct<{
|
|
135
|
+
readonly enabled: Schema.Literal<false>;
|
|
136
|
+
readonly source: Schema.Literals<readonly ["local-host", "role-unavailable"]>;
|
|
137
|
+
readonly health: Schema.Literal<"not-applicable">;
|
|
138
|
+
}>, Schema.Struct<{
|
|
139
|
+
readonly enabled: Schema.Literal<true>;
|
|
140
|
+
readonly source: Schema.Literal<"local-host">;
|
|
141
|
+
readonly health: Schema.Literals<readonly ["healthy", "unhealthy"]>;
|
|
142
|
+
}>]>;
|
|
143
|
+
}>;
|
|
144
|
+
}>;
|
|
145
|
+
export interface ReadinessStatus extends Schema.Schema.Type<typeof ReadinessStatus> {
|
|
143
146
|
}
|
|
144
147
|
export interface Interface {
|
|
145
148
|
readonly readiness: Effect.Effect<ReadinessStatus, RuntimeReadinessError>;
|
|
@@ -164,35 +167,37 @@ export interface ClusterClientOptions {
|
|
|
164
167
|
readonly shardLockExpiration?: Duration.Input;
|
|
165
168
|
readonly shardLockDisableAdvisory?: boolean;
|
|
166
169
|
}
|
|
167
|
-
export type
|
|
170
|
+
export type MultiNodeDatabase<E = never, R = never> = Database<"pg", E, R> | Database<"mysql", E, R>;
|
|
168
171
|
type HostOptions<HostE, HostR, ToolE = HostE, ToolR = HostR> = {
|
|
169
|
-
readonly languageModelLayer: Layer.Layer<
|
|
170
|
-
readonly toolRuntimeLayer: Layer.Layer<
|
|
171
|
-
readonly embeddingModelLayer?: Layer.Layer<
|
|
172
|
-
readonly blobStoreLayer?: Layer.Layer<
|
|
173
|
-
readonly artifactStoreLayer?: Layer.Layer<
|
|
174
|
-
readonly promptAssemblerLayer?: Layer.Layer<
|
|
175
|
-
readonly schemaRegistryLayer?: Layer.Layer<
|
|
172
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelServiceService, HostE, HostR>;
|
|
173
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntimeHostService, ToolE, ToolR>;
|
|
174
|
+
readonly embeddingModelLayer?: Layer.Layer<EmbeddingModelServiceService, HostE, HostR>;
|
|
175
|
+
readonly blobStoreLayer?: Layer.Layer<BlobStoreService, HostE, HostR>;
|
|
176
|
+
readonly artifactStoreLayer?: Layer.Layer<ArtifactStoreService, HostE, HostR>;
|
|
177
|
+
readonly promptAssemblerLayer?: Layer.Layer<PromptAssemblerService, HostE, HostR>;
|
|
178
|
+
readonly schemaRegistryLayer?: Layer.Layer<SchemaRegistryService, HostE, HostR>;
|
|
176
179
|
};
|
|
177
180
|
type EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> = HostOptions<HostE, HostR, ToolE, ToolR> & {
|
|
178
|
-
readonly
|
|
179
|
-
readonly
|
|
181
|
+
readonly childFanOutHostLayer?: Layer.Layer<ChildFanOutHostService, ChildE, ChildR>;
|
|
182
|
+
readonly workflowDefinitionHostLayer?: Layer.Layer<WorkflowDefinitionHostService, WorkflowE, WorkflowR>;
|
|
180
183
|
};
|
|
181
184
|
export interface RunnerOptions<DBE, DBR, HostE, HostR> extends HostOptions<HostE, HostR> {
|
|
182
|
-
readonly
|
|
185
|
+
readonly database: MultiNodeDatabase<DBE, DBR>;
|
|
183
186
|
readonly cluster: ClusterHttpOptions;
|
|
184
187
|
}
|
|
185
188
|
export interface ClientOptions<DBE, DBR> {
|
|
186
|
-
readonly
|
|
189
|
+
readonly database: MultiNodeDatabase<DBE, DBR>;
|
|
187
190
|
readonly cluster?: ClusterClientOptions;
|
|
188
191
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
export type
|
|
192
|
+
type PublicServiceOutput = ClientService | ClientIdentifier | RuntimePresenceService | PresenceIdentifier;
|
|
193
|
+
type ExecutionStateIdentifier = "@relayfx/runtime/state/execution-state-service/Service";
|
|
194
|
+
export type EmbeddedOutput = Service | PublicServiceOutput | ExecutionStateIdentifier;
|
|
195
|
+
export type RunnerOutput = Service | PublicServiceOutput | ExecutionStateIdentifier;
|
|
196
|
+
export type ClientOutput = Service | PublicServiceOutput | ExecutionStateIdentifier;
|
|
192
197
|
export declare function layerEmbedded<D extends Dialect, DBE, DBR, HostE, HostR, ChildE = never, ChildR = never, WorkflowE = never, WorkflowR = never, ToolE = never, ToolR = never>(options: EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> & {
|
|
193
|
-
readonly
|
|
194
|
-
}): Layer.Layer<EmbeddedOutput, AcquisitionError, DBR | HostR | ToolR |
|
|
198
|
+
readonly database: Database<D, DBE, DBR>;
|
|
199
|
+
}): Layer.Layer<EmbeddedOutput, AcquisitionError, DBR | HostR | ToolR | ChildR | WorkflowR>;
|
|
195
200
|
export declare const layerRunner: <DBE, DBR, HostE, HostR, ToolE, ToolR>(options: Omit<RunnerOptions<DBE, DBR, HostE, HostR>, "toolRuntimeLayer"> & {
|
|
196
|
-
readonly toolRuntimeLayer: Layer.Layer<
|
|
197
|
-
}) => Layer.Layer<RunnerOutput, AcquisitionError, DBR |
|
|
201
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntimeHostService, ToolE, ToolR>;
|
|
202
|
+
}) => Layer.Layer<RunnerOutput, AcquisitionError, DBR | HttpServer | HostR | ToolR>;
|
|
198
203
|
export declare const layerClient: <DBE, DBR>(options: ClientOptions<DBE, DBR>) => Layer.Layer<ClientOutput, AcquisitionError, DBR>;
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
5
|
-
import { RuntimeConfigurationError, RuntimeMigrationError, RuntimeTopologyError, type DatabaseLayer } from "./runtime";
|
|
6
|
-
export declare const clientLayer: (options: SqliteClientConfig) => Layer.Layer<SqlClient | import("@effect/sql-sqlite-bun/SqliteClient").SqliteClient, never, never>;
|
|
7
|
-
export interface SQLiteRuntimeDatabaseOptions {
|
|
1
|
+
import type { Database } from "./runtime-database-public";
|
|
2
|
+
import { RuntimeConfigurationError, RuntimeMigrationError, RuntimeTopologyError } from "./runtime";
|
|
3
|
+
interface SQLiteRuntimeDatabaseOptions {
|
|
8
4
|
readonly filename: string;
|
|
9
5
|
readonly disableWAL?: boolean;
|
|
10
6
|
readonly spanAttributes?: Record<string, unknown>;
|
|
11
7
|
readonly transformResultNames?: (name: string) => string;
|
|
12
8
|
readonly transformQueryNames?: (name: string) => string;
|
|
13
9
|
}
|
|
14
|
-
export declare const
|
|
15
|
-
export
|
|
16
|
-
export declare const layer: (options: SqliteClientConfig) => Layer.Layer<SqlClient, import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
17
|
-
export declare const workflowLayer: {
|
|
18
|
-
<E, R>(handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>): (options: SqliteClientConfig) => ReturnType<typeof workflowLayer<E, R>>;
|
|
19
|
-
<E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>): Layer.Layer<WorkflowDefinitionRuntime.Service, unknown, R>;
|
|
20
|
-
};
|
|
21
|
-
export declare const childFanOutLayer: {
|
|
22
|
-
<E, R>(handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>): (options: SqliteClientConfig) => Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
|
|
23
|
-
<E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>): Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
|
|
24
|
-
};
|
|
10
|
+
export declare const database: (options: SQLiteRuntimeDatabaseOptions) => Database<"sqlite", RuntimeConfigurationError | RuntimeTopologyError | RuntimeMigrationError>;
|
|
11
|
+
export {};
|
|
@@ -1,31 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { Address, Agent, Content, Entity, Envelope, Execution, Ids, Schedule, Shared, Skill, Tool, Workflow, } from "../schema/index";
|
|
6
|
-
export * as AddressBook from "../runtime/address/address-book-service";
|
|
7
|
-
export * as AddressResolution from "../runtime/address/address-resolution-service";
|
|
8
|
-
export * as AgentLoop from "../runtime/agent/agent-loop-service";
|
|
9
|
-
export * as AgentRegistry from "../runtime/agent/agent-registry-service";
|
|
10
|
-
export * as ActivityVersionRegistry from "../runtime/workflow/activity-version-registry";
|
|
11
|
-
export * as ArtifactStore from "../runtime/content/artifact-store-service";
|
|
12
|
-
export * as BlobStore from "../runtime/content/blob-store-service";
|
|
13
|
-
export * as ChildRunService from "../runtime/child/child-run-service";
|
|
14
|
-
export * as ChildFanOutRuntime from "../runtime/child/child-fan-out-runtime";
|
|
15
|
-
export * as EnvelopeService from "../runtime/envelope/envelope-service";
|
|
16
|
-
export * as EventLog from "../runtime/execution/event-log-service";
|
|
17
|
-
export * as ExecutionEntity from "../runtime/cluster/execution-entity";
|
|
18
|
-
export * as ExecutionService from "../runtime/execution/execution-service";
|
|
19
|
-
export * as ExecutionWorkflow from "../runtime/workflow/execution-workflow";
|
|
20
|
-
export * as EmbeddingModelService from "../runtime/model/embedding-model-service";
|
|
21
|
-
export * as LanguageModelService from "../runtime/model/language-model-service";
|
|
22
|
-
export * as ModelCallPolicy from "../runtime/model/model-call-policy";
|
|
23
|
-
export * as PromptAssembler from "../runtime/agent/prompt-assembler-service";
|
|
24
|
-
export * as RunnerRuntime from "../runtime/runner/runner-runtime-service";
|
|
25
|
-
export * as SchedulerService from "../runtime/schedule/scheduler-service";
|
|
26
|
-
export * as SchemaRegistry from "../runtime/schema-registry/schema-registry-service";
|
|
27
|
-
export * as SkillRegistry from "../runtime/skill/skill-registry-service";
|
|
28
|
-
export * as ToolRuntime from "../runtime/tool/tool-runtime-service";
|
|
29
|
-
export * as WaitService from "../runtime/wait/wait-service";
|
|
30
|
-
export * as WorkflowDefinitionRuntime from "../runtime/workflow/definition-runtime";
|
|
31
|
-
export declare const relaySqlitePackage = "@relayfx/sdk/sqlite";
|
|
1
|
+
import { database } from "./sqlite-runtime";
|
|
2
|
+
export declare const SQLite: {
|
|
3
|
+
readonly database: typeof database;
|
|
4
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const StateVersionConflict_base: Schema.Class<StateVersionConflict, Schema.TaggedStruct<"StateVersionConflict", {
|
|
3
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
4
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
5
|
+
};
|
|
6
|
+
readonly key: Schema.String;
|
|
7
|
+
readonly expected_version: Schema.Int;
|
|
8
|
+
readonly actual_version: Schema.Int;
|
|
9
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
|
+
export declare class StateVersionConflict extends StateVersionConflict_base {
|
|
11
|
+
}
|
|
12
|
+
export {};
|