@relayfx/sdk 0.5.0 → 0.6.0
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 +1 -1
- package/dist/{index-h1cf8za4.js → index-0jx86sx3.js} +1 -1
- package/dist/{index-8asvg7x0.js → index-96b7htye.js} +878 -706
- package/dist/{index-x32kbvxv.js → index-c6jave5p.js} +989 -958
- package/dist/index.js +252 -117
- package/dist/migrations/20260721170000_session_writer_ownership/migration.sql +5 -0
- package/dist/migrations/mysql/0014_session_writer_ownership.sql +5 -0
- package/dist/migrations/pg/20260721170000_session_writer_ownership/migration.sql +5 -0
- package/dist/migrations/sqlite/0014_session_writer_ownership.sql +5 -0
- package/dist/mysql.js +13 -4
- package/dist/postgres.js +7 -4
- package/dist/sqlite.js +13 -4
- package/dist/types/ai/language-model/language-model-registration.d.ts +23 -11
- package/dist/types/relay/language-model-registration.d.ts +25 -11
- package/dist/types/relay/mysql-migrations.d.ts +1 -1
- package/dist/types/relay/sqlite-migrations.d.ts +6 -1
- package/dist/types/runtime/agent/agent-loop-error.d.ts +1 -1
- package/dist/types/runtime/agent/relay-permissions.d.ts +2 -2
- package/dist/types/runtime/execution/active-execution-registry.d.ts +1 -0
- package/dist/types/runtime/model/model-hub.d.ts +5 -5
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +4 -4
- package/dist/types/runtime/session/session-store-service.d.ts +1 -0
- package/dist/types/store-sql/schema/session-schema.d.ts +45 -0
- package/dist/types/store-sql/session/session-records.d.ts +5 -47
- package/dist/types/store-sql/session/session-repository.d.ts +35 -1
- package/dist/types/store-sql/session/session-row.d.ts +60 -0
- package/package.json +3 -3
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { ModelRegistry } from "@batonfx/core";
|
|
2
|
+
import { type AnthropicInput, type LayerOptions as WithAnthropicOptions, layer as withAnthropic } from "@batonfx/providers/anthropic";
|
|
3
|
+
import { type DeterministicInput } from "@batonfx/providers/deterministic";
|
|
4
|
+
import { type LayerOptions as WithOpenAiOptions, type OpenAiAccountInput, type OpenAiInput, layer as withOpenAi, layerAccount as withOpenAiAccount } from "@batonfx/providers/openai";
|
|
5
|
+
import { type LayerOptions as WithOpenAiCompatibleOptions, type OpenAiCompatibleInput, layer as withOpenAiCompatible } from "@batonfx/providers/openai-compat";
|
|
6
|
+
import { type LayerOptions as WithOpenRouterOptions, type OpenRouterInput, layer as withOpenRouter } from "@batonfx/providers/openrouter";
|
|
7
|
+
import { Layer } from "effect";
|
|
2
8
|
import type { Effect } from "effect";
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
export
|
|
9
|
+
export { layerConfig as anthropicClientLayerConfig } from "@batonfx/providers/anthropic";
|
|
10
|
+
export { layer as deterministicLayer, layerOpenAi as openAiOrDeterministicLayer, } from "@batonfx/providers/deterministic";
|
|
11
|
+
export { OpenAiAccountCredentialError, layerConfig as openAiClientLayerConfig } from "@batonfx/providers/openai";
|
|
12
|
+
export { layerConfig as openAiCompatibleClientLayerConfig } from "@batonfx/providers/openai-compat";
|
|
13
|
+
export { layerConfig as openRouterClientLayerConfig } from "@batonfx/providers/openrouter";
|
|
14
|
+
export type { OpenAiFallbackOptions } from "@batonfx/providers/deterministic";
|
|
15
|
+
export type { OpenAiAccountCredential, OpenAiAccountCredentials, RegistrationOptions } from "@batonfx/providers/openai";
|
|
16
|
+
export { withAnthropic, withOpenAi, withOpenAiAccount, withOpenAiCompatible, withOpenRouter };
|
|
17
|
+
export type { AnthropicInput, DeterministicInput, OpenAiAccountInput, OpenAiCompatibleInput, OpenAiInput, OpenRouterInput, WithAnthropicOptions, WithOpenAiCompatibleOptions, WithOpenAiOptions, WithOpenRouterOptions, };
|
|
18
|
+
export declare const deterministicModel: (input: DeterministicInput) => Effect.Effect<ModelRegistry.Registration>;
|
|
19
|
+
export declare const openAi: (input: OpenAiInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-openai/OpenAiClient").OpenAiClient>;
|
|
20
|
+
export declare const openAiCompatible: (input: OpenAiCompatibleInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-openai-compat/OpenAiClient").OpenAiClient>;
|
|
21
|
+
export declare const withOpenAiFetch: (input: WithOpenAiOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
22
|
+
export declare const withAnthropicFetch: (input: WithAnthropicOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
23
|
+
export declare const withOpenRouterFetch: (input: WithOpenRouterOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
24
|
+
export declare const withOpenAiCompatibleFetch: (input: WithOpenAiCompatibleOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
25
|
+
export declare const withOpenAiAccountFetch: (input: OpenAiAccountInput) => Layer.Layer<ModelRegistry.ModelRegistry, never, never>;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { ModelRegistry } from "@batonfx/core";
|
|
2
|
+
import { type AnthropicInput, type LayerOptions as WithAnthropicOptions, layer as withAnthropic } from "@batonfx/providers/anthropic";
|
|
3
|
+
import { type DeterministicInput } from "@batonfx/providers/deterministic";
|
|
4
|
+
import { type LayerOptions as WithOpenAiOptions, type OpenAiAccountInput, type OpenAiInput, layer as withOpenAi, layerAccount as withOpenAiAccount } from "@batonfx/providers/openai";
|
|
5
|
+
import { type LayerOptions as WithOpenAiCompatibleOptions, type OpenAiCompatibleInput, layer as withOpenAiCompatible } from "@batonfx/providers/openai-compat";
|
|
6
|
+
import { type LayerOptions as WithOpenRouterOptions, type OpenRouterInput, layer as withOpenRouter } from "@batonfx/providers/openrouter";
|
|
7
|
+
import { Layer } from "effect";
|
|
2
8
|
import type { Effect } from "effect";
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
export
|
|
9
|
+
export { layerConfig as anthropicClientLayerConfig } from "@batonfx/providers/anthropic";
|
|
10
|
+
export { layer as deterministicLayer, layerOpenAi as openAiOrDeterministicLayer, } from "@batonfx/providers/deterministic";
|
|
11
|
+
export { OpenAiAccountCredentialError, layerConfig as openAiClientLayerConfig } from "@batonfx/providers/openai";
|
|
12
|
+
export { layerConfig as openAiCompatibleClientLayerConfig } from "@batonfx/providers/openai-compat";
|
|
13
|
+
export { layerConfig as openRouterClientLayerConfig } from "@batonfx/providers/openrouter";
|
|
14
|
+
export type { OpenAiFallbackOptions } from "@batonfx/providers/deterministic";
|
|
15
|
+
export type { OpenAiAccountCredential, OpenAiAccountCredentials, RegistrationOptions } from "@batonfx/providers/openai";
|
|
16
|
+
export { withAnthropic, withOpenAi, withOpenAiAccount, withOpenAiCompatible, withOpenRouter };
|
|
17
|
+
export type { AnthropicInput, DeterministicInput, OpenAiAccountInput, OpenAiCompatibleInput, OpenAiInput, OpenRouterInput, WithAnthropicOptions, WithOpenAiCompatibleOptions, WithOpenAiOptions, WithOpenRouterOptions, };
|
|
18
|
+
export declare const deterministicModel: (input: DeterministicInput) => Effect.Effect<ModelRegistry.Registration>;
|
|
19
|
+
export declare const openAi: (input: OpenAiInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-openai/OpenAiClient").OpenAiClient>;
|
|
20
|
+
export declare const anthropic: (input: AnthropicInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-anthropic/AnthropicClient").AnthropicClient>;
|
|
21
|
+
export declare const openRouter: (input: OpenRouterInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-openrouter/OpenRouterClient").OpenRouterClient>;
|
|
22
|
+
export declare const openAiCompatible: (input: OpenAiCompatibleInput) => Effect.Effect<ModelRegistry.Registration, never, import("@effect/ai-openai-compat/OpenAiClient").OpenAiClient>;
|
|
23
|
+
export declare const withOpenAiFetch: (input: WithOpenAiOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
24
|
+
export declare const withAnthropicFetch: (input: WithAnthropicOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
25
|
+
export declare const withOpenRouterFetch: (input: WithOpenRouterOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
26
|
+
export declare const withOpenAiCompatibleFetch: (input: WithOpenAiCompatibleOptions) => Layer.Layer<ModelRegistry.ModelRegistry, import("effect/Config").ConfigError, never>;
|
|
27
|
+
export declare const withOpenAiAccountFetch: (input: OpenAiAccountInput) => Layer.Layer<ModelRegistry.ModelRegistry, never, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const migrations: readonly [readonly [1, "baseline", string], readonly [2, "durable_tool_placement", string], readonly [3, "durable_inbox", string], readonly [4, "execution_state", string], readonly [5, "durable_entities", string], readonly [6, "ephemeral_presence", string], readonly [7, "topic_subscriptions", string], readonly [8, "child_fan_out", string], readonly [9, "workflow_definitions", string], readonly [10, "workflow_runtime", string], readonly [11, "execution_scoped_tool_calls", string], readonly [12, "rename_entity_to_resident", string], readonly [13, "steering_delivered", string]];
|
|
1
|
+
export declare const migrations: readonly [readonly [1, "baseline", string], readonly [2, "durable_tool_placement", string], readonly [3, "durable_inbox", string], readonly [4, "execution_state", string], readonly [5, "durable_entities", string], readonly [6, "ephemeral_presence", string], readonly [7, "topic_subscriptions", string], readonly [8, "child_fan_out", string], readonly [9, "workflow_definitions", string], readonly [10, "workflow_runtime", string], readonly [11, "execution_scoped_tool_calls", string], readonly [12, "rename_entity_to_resident", string], readonly [13, "steering_delivered", string], readonly [14, "session_writer_ownership", string]];
|
|
@@ -65,5 +65,10 @@ export declare const migrations: readonly [{
|
|
|
65
65
|
readonly name: "steering_delivered";
|
|
66
66
|
readonly file: "0013_steering_delivered.sql";
|
|
67
67
|
readonly source: string;
|
|
68
|
+
}, {
|
|
69
|
+
readonly id: 14;
|
|
70
|
+
readonly name: "session_writer_ownership";
|
|
71
|
+
readonly file: "0014_session_writer_ownership.sql";
|
|
72
|
+
readonly source: string;
|
|
68
73
|
}];
|
|
69
|
-
export declare const loader: Effect.Effect<(readonly [1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13, "baseline" | "child_fan_out" | "durable_entities" | "durable_inbox" | "durable_tool_placement" | "ephemeral_presence" | "execution_scoped_tool_calls" | "execution_state" | "rename_entity_to_resident" | "steering_delivered" | "topic_subscriptions" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
|
|
74
|
+
export declare const loader: Effect.Effect<(readonly [1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14, "baseline" | "child_fan_out" | "durable_entities" | "durable_inbox" | "durable_tool_placement" | "ephemeral_presence" | "execution_scoped_tool_calls" | "execution_state" | "rename_entity_to_resident" | "session_writer_ownership" | "steering_delivered" | "topic_subscriptions" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
|
|
@@ -4,7 +4,7 @@ import { AiError } from "effect/unstable/ai";
|
|
|
4
4
|
declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
|
|
5
5
|
readonly message: Schema.String;
|
|
6
6
|
readonly failure_classification: Schema.optionalKey<Schema.Literal<"context-overflow">>;
|
|
7
|
-
readonly baton_failure: Schema.optionalKey<Schema.Union<readonly [typeof AgentEvent.AgentError, typeof AgentEvent.ResumeMismatch, typeof TurnPolicy.TurnPolicyError, typeof AgentEvent.TurnPolicyStopped, typeof AgentEvent.TurnLimitExceeded, typeof AgentEvent.MiddlewareViolation, typeof AgentEvent.DuplicateToolCallId, typeof AgentEvent.
|
|
7
|
+
readonly baton_failure: Schema.optionalKey<Schema.Union<readonly [typeof AgentEvent.AgentError, typeof AgentEvent.ResumeMismatch, typeof TurnPolicy.TurnPolicyError, typeof AgentEvent.TurnPolicyStopped, typeof AgentEvent.TurnLimitExceeded, typeof AgentEvent.MiddlewareViolation, typeof AgentEvent.DuplicateToolCallId, typeof AgentEvent.ProgressOverflow, typeof AgentEvent.ToolNameCollision, typeof AiError.AiError, typeof ModelRegistry.LanguageModelNotRegistered, typeof ToolExecutor.FrameworkFailure]>>;
|
|
8
8
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
9
9
|
}>, import("effect/Cause").YieldableError>;
|
|
10
10
|
export declare class AgentLoopError extends AgentLoopError_base {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Permissions } from "@batonfx/core";
|
|
1
|
+
import { Approvals, Permissions } from "@batonfx/core";
|
|
2
2
|
import { Agent, Execution, Ids } from "../../schema/index";
|
|
3
3
|
import { PermissionRuleRepository } from "../../store-sql/portable";
|
|
4
4
|
import { Effect, Layer } from "effect";
|
|
@@ -21,4 +21,4 @@ export interface Config {
|
|
|
21
21
|
readonly startedAt: number;
|
|
22
22
|
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
23
23
|
}
|
|
24
|
-
export declare const layer: (config: Config) => Layer.Layer<Permissions.Permissions | Permissions.RuleStore, never, never>;
|
|
24
|
+
export declare const layer: (config: Config) => Layer.Layer<Approvals.Approvals | Permissions.Permissions | Permissions.RuleStore, never, never>;
|
|
@@ -3,6 +3,7 @@ import { Context, Effect, Layer } from "effect";
|
|
|
3
3
|
export interface Interface {
|
|
4
4
|
readonly run: <A, E, R>(executionId: Ids.ExecutionId, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
5
5
|
readonly interrupt: (executionId: Ids.ExecutionId) => Effect.Effect<boolean>;
|
|
6
|
+
readonly awaitQuiescent: (executionId: Ids.ExecutionId) => Effect.Effect<void>;
|
|
6
7
|
}
|
|
7
8
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/execution/active-execution-registry/Service", Interface>;
|
|
8
9
|
export declare class Service extends Service_base {
|
|
@@ -16,12 +16,12 @@ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/mode
|
|
|
16
16
|
export declare class Service extends Service_base {
|
|
17
17
|
}
|
|
18
18
|
export declare const layer: {
|
|
19
|
-
(registrations: ReadonlyArray<ModelRegistry.Registration>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.
|
|
20
|
-
(options?: ModelRegistry.GovernanceOptions): (registrations: ReadonlyArray<ModelRegistry.Registration>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.
|
|
19
|
+
(registrations: ReadonlyArray<ModelRegistry.Registration>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.ModelRegistry, ModelRegistrationCollision>;
|
|
20
|
+
(options?: ModelRegistry.GovernanceOptions): (registrations: ReadonlyArray<ModelRegistry.Registration>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.ModelRegistry, ModelRegistrationCollision>;
|
|
21
21
|
};
|
|
22
22
|
export declare const layerFromRegistrationEffects: {
|
|
23
|
-
<E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.
|
|
24
|
-
(options?: ModelRegistry.GovernanceOptions): <E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.
|
|
23
|
+
<E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.ModelRegistry, E | ModelRegistrationCollision, Exclude<R, import("effect/Scope").Scope>>;
|
|
24
|
+
(options?: ModelRegistry.GovernanceOptions): <E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.ModelRegistry, E | ModelRegistrationCollision, Exclude<R, import("effect/Scope").Scope>>;
|
|
25
25
|
};
|
|
26
|
-
export declare const testLayer: (modelRegistry: ModelRegistry.Interface) => Layer.Layer<ModelRegistry.
|
|
26
|
+
export declare const testLayer: (modelRegistry: ModelRegistry.Interface) => Layer.Layer<ModelRegistry.ModelRegistry | LanguageModelService | Service, never, never>;
|
|
27
27
|
export {};
|
|
@@ -147,7 +147,7 @@ export declare const layerWithLanguageModelService: <DatabaseError, DatabaseIn,
|
|
|
147
147
|
readonly languageModelLayer: Layer.Layer<LanguageModelServiceService, LanguageModelError, LanguageModelIn>;
|
|
148
148
|
}) => Layer.Layer<MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | SchedulerServiceService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig | WorkflowEngine.WorkflowEngine, DatabaseError | LanguageModelError | ClusterConfigMismatch | Config.ConfigError, DatabaseIn | Exclude<LanguageModelIn, SqlClient> | Exclude<Exclude<LanguageModelIn, ArtifactStoreService>, SqlClient> | Exclude<Exclude<Exclude<Exclude<LanguageModelIn, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service>, BlobStoreService>, ArtifactStoreService>, SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<LanguageModelIn, never>, WorkflowEngine.WorkflowEngine>, MessageStorage.MessageStorage | Runners.Runners | Sharding.Sharding | ShardingConfig.ShardingConfig>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service>, BlobStoreService>, ArtifactStoreService>, SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<LanguageModelIn, import("../inbox/inbox-service").Service>, import("../address/address-book-service").Service | import("../inbox/inbox-service").Service | import("../envelope/envelope-service").Service>, import("../inbox/inbox-service").Service | import("../topic/topic-service").Service>, import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../agent/agent-registry-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service>, import("../state/execution-state-service").Service>, import("../wait/wait-service").Service>, import("../execution/event-log-service").Service>, LanguageModelServiceService>, never>, WorkflowEngine.WorkflowEngine>, MessageStorage.MessageStorage | Runners.Runners | Sharding.Sharding | ShardingConfig.ShardingConfig>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service>, BlobStoreService>, ArtifactStoreService>, SqlClient> | Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<LanguageModelIn, SchemaRegistryService>, import("../inbox/inbox-service").Service>, import("../address/address-book-service").Service | import("../inbox/inbox-service").Service | import("../envelope/envelope-service").Service>, import("../inbox/inbox-service").Service | import("../topic/topic-service").Service>, import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../agent/agent-registry-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service>, import("../state/execution-state-service").Service>, import("../wait/wait-service").Service>, import("../execution/event-log-service").Service>, LanguageModelServiceService>, never>, WorkflowEngine.WorkflowEngine>, MessageStorage.MessageStorage | Runners.Runners | Sharding.Sharding | ShardingConfig.ShardingConfig>, AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service>, BlobStoreService>, ArtifactStoreService>, SqlClient>>;
|
|
149
149
|
/** @deprecated Use `Runtime.layerEmbedded` for an embedded process role. */
|
|
150
|
-
export declare const layer: Layer.Layer<MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service |
|
|
150
|
+
export declare const layer: Layer.Layer<MessageStorage.MessageStorage | ModelRegistry.ModelRegistry | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | NotificationBus.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | ModelHubService | SchedulerServiceService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig | WorkflowEngine.WorkflowEngine, ClusterConfigMismatch | Config.ConfigError, SqlClient>;
|
|
151
151
|
/** @deprecated Use `Runtime.layerEmbedded` with a test database and test host layers. */
|
|
152
152
|
export declare const testLayerWithServices: <LanguageModelError, LanguageModelIn, ToolRuntimeError, ToolRuntimeIn>(options: {
|
|
153
153
|
readonly languageModelLayer: Layer.Layer<LanguageModelServiceService, LanguageModelError, LanguageModelIn>;
|
|
@@ -159,11 +159,11 @@ export declare const testLayerWithLanguageModelService: <LanguageModelError, Lan
|
|
|
159
159
|
/** @deprecated Use `Runtime.layerEmbedded` with a test database and test host layers. */
|
|
160
160
|
export declare const testLayer: Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | SchedulerServiceService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig | WorkflowEngine.WorkflowEngine, Config.ConfigError, never>;
|
|
161
161
|
/** @deprecated Use `Runtime.layerClient` with a test database. */
|
|
162
|
-
export declare const testClientLayer: Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service |
|
|
162
|
+
export declare const testClientLayer: Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | ModelRegistry.ModelRegistry | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | ModelHubService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig, Config.ConfigError, never>;
|
|
163
163
|
/** @deprecated Use `Runtime.layerEmbedded` and read `Runtime.Service.readiness`. */
|
|
164
|
-
export declare const testLayerWithDatabaseCheck: <CheckError>(checkDatabase: Effect.Effect<void, CheckError>) => Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service |
|
|
164
|
+
export declare const testLayerWithDatabaseCheck: <CheckError>(checkDatabase: Effect.Effect<void, CheckError>) => Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | ModelRegistry.ModelRegistry | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | ModelHubService | SchedulerServiceService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig | WorkflowEngine.WorkflowEngine, Config.ConfigError, never>;
|
|
165
165
|
/** @deprecated Use `Runtime.layerClient` and read `Runtime.Service.readiness`. */
|
|
166
|
-
export declare const testClientLayerWithDatabaseCheck: <CheckError>(checkDatabase: Effect.Effect<void, CheckError>) => Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service |
|
|
166
|
+
export declare const testClientLayerWithDatabaseCheck: <CheckError>(checkDatabase: Effect.Effect<void, CheckError>) => Layer.Layer<Crypto.Crypto | MessageStorage.MemoryDriver | MessageStorage.MessageStorage | ModelRegistry.ModelRegistry | Runners.Runners | AddressBookRepository.Service | AgentChatRepository.Service | AgentDefinitionRepository.Service | ChildExecutionRepository.Service | ChildFanOutRepository.Service | ClusterRegistryRepository.Service | CompactionRepository.Service | ContextEpochRepository.Service | EnvelopeRepository.Service | ResidentRepository.Service | ExecutionEventRepository.Service | ExecutionRepository.Service | ExecutionStateRepository.Service | InboxRepository.Service | TopicRepository.Service | MemoryRepository.Service | PermissionRuleRepository.Service | PresenceRepository.Service | ScheduleRepository.Service | SessionRepository.Service | SkillDefinitionRepository.Service | SteeringRepository.Service | ToolCallRepository.Service | WorkspaceLeaseRepository.Service | WorkflowDefinitionRepository.Service | import("../address/address-book-service").Service | import("../execution/event-log-service").Service | import("../wait/wait-service").Service | ToolRuntimeService | import("../agent/agent-registry-service").Service | import("../address/address-resolution-service").Service | import("../child/child-run-service").Service | LanguageModelServiceService | import("../model/model-call-policy").Service | import("../presence/presence-contract").Service | SchemaRegistryService | BlobStoreService | import("../state/execution-state-service").Service | ParentNotifierService | import("../skill/skill-registry-service").Service | import("../execution/execution-service").Service | import("../execution/active-execution-registry").Service | ToolTransitionCoordinatorService | import("../workspace/workspace-planner-service").Service | import("../inbox/inbox-service").Service | import("../topic/topic-service").Service | import("../envelope/envelope-service").Service | ArtifactStoreService | PromptAssemblerService | import("../agent/agent-loop-service").Service | import("../resident/resident-registry-service").Service | import("../resident/resident-instance-service").Service | import("../execution/execution-watch-service").Service | import("../execution/session-stream-service").Service | ModelHubService | Service | Sharding.Sharding | ShardingConfig.ShardingConfig, Config.ConfigError, never>;
|
|
167
167
|
/** @deprecated Read `Runtime.Service.readiness` from a unified Runtime layer. */
|
|
168
168
|
export declare const check: () => Effect.Effect<ReadinessStatus, RunnerRuntimeError, Service>;
|
|
169
169
|
export {};
|
|
@@ -8,6 +8,7 @@ export declare class Service extends Service_base {
|
|
|
8
8
|
}
|
|
9
9
|
export interface MakeOptions {
|
|
10
10
|
readonly onCheckpointCommitted?: (result: Session.CheckpointAppend) => Effect.Effect<void, Session.SessionStoreError | Session.SessionConflict>;
|
|
11
|
+
readonly writer?: SessionRepository.ExpectedSessionWriter;
|
|
11
12
|
}
|
|
12
13
|
export declare const make: (sessionId: string & import("effect/Brand").Brand<"Relay.SessionId">, entryScope?: string | undefined, makeOptions?: MakeOptions | undefined) => Effect.Effect<Session.Interface, never, SessionRepository.Service>;
|
|
13
14
|
export declare const serviceLayer: {
|
|
@@ -62,6 +62,51 @@ export declare const relaySessions: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
62
62
|
identity: undefined;
|
|
63
63
|
generated: undefined;
|
|
64
64
|
}>;
|
|
65
|
+
ownerExecutionId: import("drizzle-orm/pg-core").PgBuildColumn<"relay_sessions", import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgTextBuilder<[string, ...string[]]>, string & import("effect/Brand").Brand<"Relay.ExecutionId">>, {
|
|
66
|
+
name: string;
|
|
67
|
+
tableName: "relay_sessions";
|
|
68
|
+
dataType: "string";
|
|
69
|
+
data: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
70
|
+
driverParam: string;
|
|
71
|
+
notNull: false;
|
|
72
|
+
hasDefault: false;
|
|
73
|
+
isPrimaryKey: false;
|
|
74
|
+
isAutoincrement: false;
|
|
75
|
+
hasRuntimeDefault: false;
|
|
76
|
+
enumValues: undefined;
|
|
77
|
+
identity: undefined;
|
|
78
|
+
generated: undefined;
|
|
79
|
+
}>;
|
|
80
|
+
ownerEpoch: import("drizzle-orm/pg-core").PgBuildColumn<"relay_sessions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBigInt53Builder>>, {
|
|
81
|
+
name: string;
|
|
82
|
+
tableName: "relay_sessions";
|
|
83
|
+
dataType: "number int53";
|
|
84
|
+
data: number;
|
|
85
|
+
driverParam: string | number;
|
|
86
|
+
notNull: true;
|
|
87
|
+
hasDefault: true;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: undefined;
|
|
92
|
+
identity: undefined;
|
|
93
|
+
generated: undefined;
|
|
94
|
+
}>;
|
|
95
|
+
ownerReleased: import("drizzle-orm/pg-core").PgBuildColumn<"relay_sessions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgBooleanBuilder>>, {
|
|
96
|
+
name: string;
|
|
97
|
+
tableName: "relay_sessions";
|
|
98
|
+
dataType: "boolean";
|
|
99
|
+
data: boolean;
|
|
100
|
+
driverParam: boolean;
|
|
101
|
+
notNull: true;
|
|
102
|
+
hasDefault: true;
|
|
103
|
+
isPrimaryKey: false;
|
|
104
|
+
isAutoincrement: false;
|
|
105
|
+
hasRuntimeDefault: false;
|
|
106
|
+
enumValues: undefined;
|
|
107
|
+
identity: undefined;
|
|
108
|
+
generated: undefined;
|
|
109
|
+
}>;
|
|
65
110
|
metadataJson: import("drizzle-orm/pg-core").PgBuildColumn<"relay_sessions", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").Set$Type<import("drizzle-orm/pg-core").PgJsonbBuilder, {
|
|
66
111
|
readonly [x: string]: import("effect/Schema").Json;
|
|
67
112
|
}>>>, {
|
|
@@ -1,51 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect, Schema } from "effect";
|
|
1
|
+
import { Effect } from "effect";
|
|
3
2
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
4
3
|
import { sessionEntryRow } from "./session-entry-records";
|
|
5
|
-
import type {
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly leaf_entry_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
10
|
-
readonly metadata_json: Schema.Unknown;
|
|
11
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
12
|
-
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
13
|
-
}>;
|
|
14
|
-
export declare const metadata: (input: Shared.Metadata | undefined) => {
|
|
15
|
-
readonly [x: string]: Schema.Json;
|
|
16
|
-
};
|
|
17
|
-
export declare const listLimit: (input: ListSessionsInput) => number;
|
|
18
|
-
declare const nextCursorOf: (records: ReadonlyArray<SessionRecord>, fetched: number, limit: number) => SessionCursor | undefined;
|
|
19
|
-
declare const compareDesc: (left: SessionRecord, right: SessionRecord) => number;
|
|
20
|
-
declare const afterCursor: (record: SessionRecord, cursor: SessionCursor | undefined) => boolean;
|
|
21
|
-
export declare const sessionRecordPaging: {
|
|
22
|
-
nextCursorOf: typeof nextCursorOf;
|
|
23
|
-
compareDesc: typeof compareDesc;
|
|
24
|
-
afterCursor: typeof afterCursor;
|
|
25
|
-
};
|
|
26
|
-
interface SessionRecordErrors {
|
|
27
|
-
readonly SessionRepositoryError: Schema.Schema<SessionRepositoryError> & {
|
|
28
|
-
readonly make: (input: {
|
|
29
|
-
readonly message: string;
|
|
30
|
-
}) => SessionRepositoryError;
|
|
31
|
-
};
|
|
32
|
-
readonly DuplicateSession: {
|
|
33
|
-
readonly make: (input: {
|
|
34
|
-
readonly id: Ids.SessionId;
|
|
35
|
-
}) => DuplicateSession;
|
|
36
|
-
};
|
|
37
|
-
readonly SessionConflict: {
|
|
38
|
-
readonly make: (input: {
|
|
39
|
-
readonly reason: SessionConflict["reason"];
|
|
40
|
-
readonly message: string;
|
|
41
|
-
}) => SessionConflict;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export declare const makeSessionRecordSupport: (errors: SessionRecordErrors) => {
|
|
45
|
-
missingSession: (id: Ids.SessionId) => SessionRepositoryError;
|
|
46
|
-
rootMismatch: (id: Ids.SessionId) => SessionRepositoryError;
|
|
47
|
-
cloneSession: (record: SessionRecord) => SessionRecord;
|
|
48
|
-
currentLeaf: (session: SessionRecord) => Ids.SessionEntryId | null;
|
|
49
|
-
};
|
|
4
|
+
import type { Interface } from "./session-repository";
|
|
5
|
+
export { listLimit, metadata, sessionRow, sessionRecordPaging, toSessionRecord } from "./session-row";
|
|
6
|
+
import { type SessionRecordErrors } from "./session-row";
|
|
7
|
+
export { makeSessionRecordSupport, type SessionRecordErrors } from "./session-row";
|
|
50
8
|
export declare const makeSessionRepository: (errors: SessionRecordErrors) => Effect.Effect<Interface, never, SqlClient>;
|
|
51
9
|
export { sessionEntryRow };
|
|
@@ -14,15 +14,42 @@ declare const DuplicateSession_base: Schema.Class<DuplicateSession, Schema.Tagge
|
|
|
14
14
|
export declare class DuplicateSession extends DuplicateSession_base {
|
|
15
15
|
}
|
|
16
16
|
declare const SessionConflict_base: Schema.Class<SessionConflict, Schema.TaggedStruct<"SessionConflict", {
|
|
17
|
-
readonly reason: Schema.Literals<readonly ["stale-leaf", "checkpoint-id-reused", "checkpoint-not-on-active-path"]>;
|
|
17
|
+
readonly reason: Schema.Literals<readonly ["stale-leaf", "checkpoint-id-reused", "checkpoint-not-on-active-path", "fenced"]>;
|
|
18
18
|
readonly message: Schema.String;
|
|
19
19
|
}>, import("effect/Cause").YieldableError>;
|
|
20
20
|
export declare class SessionConflict extends SessionConflict_base {
|
|
21
21
|
}
|
|
22
|
+
export interface SessionWriter {
|
|
23
|
+
readonly executionId: Ids.ExecutionId;
|
|
24
|
+
readonly epoch: number;
|
|
25
|
+
readonly released: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ExpectedSessionWriter {
|
|
28
|
+
readonly executionId: Ids.ExecutionId;
|
|
29
|
+
readonly epoch: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ClaimSessionWriterInput {
|
|
32
|
+
readonly sessionId: Ids.SessionId;
|
|
33
|
+
readonly executionId: Ids.ExecutionId;
|
|
34
|
+
readonly now: number;
|
|
35
|
+
}
|
|
36
|
+
export interface ReleaseSessionWriterInput {
|
|
37
|
+
readonly sessionId: Ids.SessionId;
|
|
38
|
+
readonly executionId: Ids.ExecutionId;
|
|
39
|
+
readonly now: number;
|
|
40
|
+
}
|
|
41
|
+
export type ClaimSessionWriterResult = {
|
|
42
|
+
readonly _tag: "Claimed";
|
|
43
|
+
readonly writer: SessionWriter;
|
|
44
|
+
} | {
|
|
45
|
+
readonly _tag: "Busy";
|
|
46
|
+
readonly writer: SessionWriter;
|
|
47
|
+
};
|
|
22
48
|
export interface SessionRecord {
|
|
23
49
|
readonly id: Ids.SessionId;
|
|
24
50
|
readonly rootAddressId: Ids.AddressId;
|
|
25
51
|
readonly leafEntryId?: Ids.SessionEntryId;
|
|
52
|
+
readonly writer?: SessionWriter;
|
|
26
53
|
readonly metadata: Shared.Metadata;
|
|
27
54
|
readonly createdAt: number;
|
|
28
55
|
readonly updatedAt: number;
|
|
@@ -197,6 +224,7 @@ export interface AppendEntryInput {
|
|
|
197
224
|
readonly input: AppendSessionEntryInput;
|
|
198
225
|
readonly createdAt: number;
|
|
199
226
|
readonly expectedLeafId?: Ids.SessionEntryId | null;
|
|
227
|
+
readonly expectedWriter?: ExpectedSessionWriter;
|
|
200
228
|
}
|
|
201
229
|
export interface AppendCheckpointInput {
|
|
202
230
|
readonly id: Ids.SessionEntryId;
|
|
@@ -205,6 +233,7 @@ export interface AppendCheckpointInput {
|
|
|
205
233
|
readonly projectedHistory: Prompt.Prompt;
|
|
206
234
|
readonly summary?: string;
|
|
207
235
|
readonly createdAt: number;
|
|
236
|
+
readonly expectedWriter?: ExpectedSessionWriter;
|
|
208
237
|
}
|
|
209
238
|
export interface AppendCheckpointResult {
|
|
210
239
|
readonly _tag: "Appended" | "AlreadyPresent";
|
|
@@ -226,6 +255,8 @@ export interface SetLeafInput {
|
|
|
226
255
|
export interface Interface {
|
|
227
256
|
readonly create: (input: CreateSessionInput) => Effect.Effect<SessionRecord, DuplicateSession | SessionRepositoryError>;
|
|
228
257
|
readonly ensure: (input: EnsureSessionInput) => Effect.Effect<SessionRecord, SessionRepositoryError>;
|
|
258
|
+
readonly claimWriter: (input: ClaimSessionWriterInput) => Effect.Effect<ClaimSessionWriterResult, SessionRepositoryError>;
|
|
259
|
+
readonly releaseWriter: (input: ReleaseSessionWriterInput) => Effect.Effect<void, SessionRepositoryError>;
|
|
229
260
|
readonly get: (id: Ids.SessionId) => Effect.Effect<SessionRecord | undefined, SessionRepositoryError>;
|
|
230
261
|
readonly list: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, SessionRepositoryError>;
|
|
231
262
|
readonly touch: (input: TouchSessionInput) => Effect.Effect<SessionRecord, SessionRepositoryError>;
|
|
@@ -243,6 +274,9 @@ export declare const SessionRow: Schema.Struct<{
|
|
|
243
274
|
readonly id: Schema.String;
|
|
244
275
|
readonly root_address_id: Schema.String;
|
|
245
276
|
readonly leaf_entry_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
277
|
+
readonly owner_execution_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
278
|
+
readonly owner_epoch: Schema.Union<readonly [Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
279
|
+
readonly owner_released: Schema.Union<readonly [Schema.Boolean, Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
246
280
|
readonly metadata_json: Schema.Unknown;
|
|
247
281
|
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
248
282
|
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Ids, Shared } from "../../schema/index";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import type { DuplicateSession, ExpectedSessionWriter, ListSessionsInput, SessionConflict, SessionCursor, SessionRecord, SessionRepositoryError, SessionWriter } from "./session-repository";
|
|
4
|
+
export declare const sessionRow: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.String;
|
|
6
|
+
readonly root_address_id: Schema.String;
|
|
7
|
+
readonly leaf_entry_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
8
|
+
readonly owner_execution_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
9
|
+
readonly owner_epoch: Schema.Union<readonly [Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
10
|
+
readonly owner_released: Schema.Union<readonly [Schema.Boolean, Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
11
|
+
readonly metadata_json: Schema.Unknown;
|
|
12
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
13
|
+
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const CountRow: Schema.Struct<{
|
|
16
|
+
readonly value: Schema.Union<readonly [Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const metadata: (input: Shared.Metadata | undefined) => {
|
|
19
|
+
readonly [x: string]: Schema.Json;
|
|
20
|
+
};
|
|
21
|
+
export declare const toSessionRecord: (row: typeof sessionRow.Type) => SessionRecord;
|
|
22
|
+
export declare const listLimit: (input: ListSessionsInput) => number;
|
|
23
|
+
declare const nextCursorOf: (records: ReadonlyArray<SessionRecord>, fetched: number, limit: number) => SessionCursor | undefined;
|
|
24
|
+
declare const compareDesc: (left: SessionRecord, right: SessionRecord) => number;
|
|
25
|
+
declare const afterCursor: (record: SessionRecord, cursor: SessionCursor | undefined) => boolean;
|
|
26
|
+
export declare const sessionRecordPaging: {
|
|
27
|
+
nextCursorOf: typeof nextCursorOf;
|
|
28
|
+
compareDesc: typeof compareDesc;
|
|
29
|
+
afterCursor: typeof afterCursor;
|
|
30
|
+
};
|
|
31
|
+
export interface SessionRecordErrors {
|
|
32
|
+
readonly SessionRepositoryError: Schema.Schema<SessionRepositoryError> & {
|
|
33
|
+
readonly make: (input: {
|
|
34
|
+
readonly message: string;
|
|
35
|
+
}) => SessionRepositoryError;
|
|
36
|
+
};
|
|
37
|
+
readonly DuplicateSession: {
|
|
38
|
+
readonly make: (input: {
|
|
39
|
+
readonly id: Ids.SessionId;
|
|
40
|
+
}) => DuplicateSession;
|
|
41
|
+
};
|
|
42
|
+
readonly SessionConflict: {
|
|
43
|
+
readonly make: (input: {
|
|
44
|
+
readonly reason: SessionConflict["reason"];
|
|
45
|
+
readonly message: string;
|
|
46
|
+
}) => SessionConflict;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export declare const makeSessionRecordSupport: (errors: SessionRecordErrors) => {
|
|
50
|
+
missingSession: (id: Ids.SessionId) => SessionRepositoryError;
|
|
51
|
+
rootMismatch: (id: Ids.SessionId) => SessionRepositoryError;
|
|
52
|
+
cloneSession: (record: SessionRecord) => SessionRecord;
|
|
53
|
+
currentLeaf: (session: SessionRecord) => Ids.SessionEntryId | null;
|
|
54
|
+
writerFenceViolation: (session: SessionRecord, expected: ExpectedSessionWriter | undefined) => string | undefined;
|
|
55
|
+
nextWriterClaim: (current: SessionWriter | undefined, executionId: Ids.ExecutionId) => {
|
|
56
|
+
readonly _tag: "Claimed" | "Busy";
|
|
57
|
+
readonly writer: SessionWriter;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@relayfx/sdk",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"description": "Effect-native durable execution SDK for addressable agents and tools",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"typecheck": "bun tsc --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@batonfx/core": "0.
|
|
61
|
-
"@batonfx/providers": "0.
|
|
60
|
+
"@batonfx/core": "0.9.0",
|
|
61
|
+
"@batonfx/providers": "0.9.0",
|
|
62
62
|
"@effect/ai-anthropic": "4.0.0-beta.98",
|
|
63
63
|
"@effect/ai-openai": "4.0.0-beta.98",
|
|
64
64
|
"@effect/ai-openai-compat": "4.0.0-beta.98",
|