@relayfx/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/index.js +8449 -0
  2. package/dist/migrations/20260701002839_sour_cerebro/migration.sql +160 -0
  3. package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +1971 -0
  4. package/dist/migrations/20260701041134_acoustic_hulk/migration.sql +30 -0
  5. package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +2372 -0
  6. package/dist/migrations/20260701160543_condemned_stryfe/migration.sql +2 -0
  7. package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +2442 -0
  8. package/dist/migrations/20260701220315_heavy_gorgon/migration.sql +5 -0
  9. package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +2495 -0
  10. package/dist/migrations/20260701225444_polite_lord_hawal/migration.sql +24 -0
  11. package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +2821 -0
  12. package/dist/migrations/20260702030128_flaky_misty_knight/migration.sql +1 -0
  13. package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +2821 -0
  14. package/dist/types/ai/index.d.ts +2 -0
  15. package/dist/types/ai/language-model/language-model-registration.d.ts +89 -0
  16. package/dist/types/relay/adapter-outbox.d.ts +19 -0
  17. package/dist/types/relay/client.d.ts +102 -0
  18. package/dist/types/relay/database.d.ts +11 -0
  19. package/dist/types/relay/index.d.ts +10 -0
  20. package/dist/types/relay/operation.d.ts +921 -0
  21. package/dist/types/runtime/address/address-book-service.d.ts +74 -0
  22. package/dist/types/runtime/address/address-resolution-service.d.ts +106 -0
  23. package/dist/types/runtime/agent/agent-loop-service.d.ts +53 -0
  24. package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
  25. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +102 -0
  26. package/dist/types/runtime/child/child-run-service.d.ts +90 -0
  27. package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
  28. package/dist/types/runtime/cluster/execution-entity.d.ts +393 -0
  29. package/dist/types/runtime/content/artifact-store-service.d.ts +73 -0
  30. package/dist/types/runtime/content/blob-store-service.d.ts +87 -0
  31. package/dist/types/runtime/envelope/envelope-service.d.ts +52 -0
  32. package/dist/types/runtime/execution/event-log-service.d.ts +54 -0
  33. package/dist/types/runtime/execution/execution-service.d.ts +62 -0
  34. package/dist/types/runtime/index.d.ts +25 -0
  35. package/dist/types/runtime/model/language-model-service.d.ts +58 -0
  36. package/dist/types/runtime/model/model-call-policy.d.ts +53 -0
  37. package/dist/types/runtime/observability/runtime-metrics.d.ts +9 -0
  38. package/dist/types/runtime/runner/runner-runtime-service.d.ts +132 -0
  39. package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
  40. package/dist/types/runtime/tool/tool-runtime-service.d.ts +85 -0
  41. package/dist/types/runtime/wait/wait-service.d.ts +80 -0
  42. package/dist/types/runtime/wait/wait-signal.d.ts +15 -0
  43. package/dist/types/runtime/workflow/execution-workflow.d.ts +335 -0
  44. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +63 -0
  45. package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
  46. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
  47. package/dist/types/schema/address-schema.d.ts +77 -0
  48. package/dist/types/schema/agent-schema.d.ts +360 -0
  49. package/dist/types/schema/content-schema.d.ts +106 -0
  50. package/dist/types/schema/envelope-schema.d.ts +167 -0
  51. package/dist/types/schema/execution-schema.d.ts +297 -0
  52. package/dist/types/schema/ids-schema.d.ts +61 -0
  53. package/dist/types/schema/index.d.ts +11 -0
  54. package/dist/types/schema/schedule-schema.d.ts +73 -0
  55. package/dist/types/schema/shared-schema.d.ts +11 -0
  56. package/dist/types/schema/tool-schema.d.ts +53 -0
  57. package/dist/types/schema/workspace-schema.d.ts +78 -0
  58. package/dist/types/store-sql/address/address-book-repository.d.ts +48 -0
  59. package/dist/types/store-sql/agent/agent-definition-repository.d.ts +49 -0
  60. package/dist/types/store-sql/chat/agent-chat-repository.d.ts +31 -0
  61. package/dist/types/store-sql/child/child-execution-repository.d.ts +61 -0
  62. package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +35 -0
  63. package/dist/types/store-sql/database/database-service.d.ts +25 -0
  64. package/dist/types/store-sql/envelope/envelope-repository.d.ts +158 -0
  65. package/dist/types/store-sql/execution/execution-event-repository.d.ts +86 -0
  66. package/dist/types/store-sql/execution/execution-repository.d.ts +80 -0
  67. package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +42 -0
  68. package/dist/types/store-sql/index.d.ts +15 -0
  69. package/dist/types/store-sql/schedule/schedule-repository.d.ts +83 -0
  70. package/dist/types/store-sql/schema/relay-schema.d.ts +2302 -0
  71. package/dist/types/store-sql/tool/tool-call-repository.d.ts +66 -0
  72. package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +87 -0
  73. package/package.json +44 -0
@@ -0,0 +1,53 @@
1
+ import { Schema } from "effect";
2
+ export declare const Permission: Schema.Struct<{
3
+ readonly name: Schema.String;
4
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
5
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
6
+ }>;
7
+ export interface Permission extends Schema.Schema.Type<typeof Permission> {
8
+ }
9
+ export declare const RuntimeRequirement: Schema.Union<readonly [Schema.Struct<{
10
+ readonly type: Schema.Literal<"workspace">;
11
+ readonly mode: Schema.Literals<readonly ["read", "write", "exec"]>;
12
+ }>]>;
13
+ export interface RuntimeRequirement extends Schema.Schema.Type<typeof RuntimeRequirement> {
14
+ }
15
+ export declare const Definition: Schema.Struct<{
16
+ readonly name: Schema.String;
17
+ readonly description: Schema.String;
18
+ readonly input_schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
19
+ readonly output_schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
20
+ readonly permissions: Schema.$Array<Schema.Struct<{
21
+ readonly name: Schema.String;
22
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
23
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
24
+ }>>;
25
+ readonly requirements: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
26
+ readonly type: Schema.Literal<"workspace">;
27
+ readonly mode: Schema.Literals<readonly ["read", "write", "exec"]>;
28
+ }>]>>>;
29
+ readonly needs_approval: Schema.optionalKey<Schema.Boolean>;
30
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
31
+ }>;
32
+ export interface Definition extends Schema.Schema.Type<typeof Definition> {
33
+ }
34
+ export declare const Call: Schema.Struct<{
35
+ readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
36
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
37
+ };
38
+ readonly name: Schema.String;
39
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
40
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
41
+ }>;
42
+ export interface Call extends Schema.Schema.Type<typeof Call> {
43
+ }
44
+ export declare const Result: Schema.Struct<{
45
+ readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
46
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
47
+ };
48
+ readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
49
+ readonly error: Schema.optionalKey<Schema.String>;
50
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
51
+ }>;
52
+ export interface Result extends Schema.Schema.Type<typeof Result> {
53
+ }
@@ -0,0 +1,78 @@
1
+ import { Schema } from "effect";
2
+ export declare const WorkspaceProviderKey: Schema.String;
3
+ export type WorkspaceProviderKey = typeof WorkspaceProviderKey.Type;
4
+ export declare const WorkspaceLeaseStatus: Schema.Literals<readonly ["planned", "running", "suspended", "snapshotted", "archived", "released", "failed"]>;
5
+ export type WorkspaceLeaseStatus = typeof WorkspaceLeaseStatus.Type;
6
+ export declare const WorkspaceResumeStrategy: Schema.Literals<readonly ["reattach", "restore_snapshot"]>;
7
+ export type WorkspaceResumeStrategy = typeof WorkspaceResumeStrategy.Type;
8
+ export declare const WorkspaceCapabilities: Schema.Struct<{
9
+ readonly can_suspend: Schema.Boolean;
10
+ readonly can_snapshot: Schema.Boolean;
11
+ readonly can_fork: Schema.Boolean;
12
+ readonly persistent_by_default: Schema.Boolean;
13
+ readonly suspend_granularity: Schema.Literals<readonly ["memory", "filesystem", "none"]>;
14
+ readonly max_suspend_duration_ms: Schema.optionalKey<Schema.Number>;
15
+ readonly reattach_by_ref: Schema.Boolean;
16
+ }>;
17
+ export interface WorkspaceCapabilities extends Schema.Schema.Type<typeof WorkspaceCapabilities> {
18
+ }
19
+ export declare const WorkspaceRequest: Schema.Struct<{
20
+ readonly provider_key: Schema.optionalKey<Schema.String>;
21
+ readonly resume_snapshot_ref: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SnapshotRef"> & {
22
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SnapshotRef">;
23
+ }>;
24
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
25
+ }>;
26
+ export interface WorkspaceRequest extends Schema.Schema.Type<typeof WorkspaceRequest> {
27
+ }
28
+ export declare const WorkspaceLeaseRecord: Schema.Struct<{
29
+ readonly id: Schema.brand<Schema.String, "Relay.WorkspaceLeaseId"> & {
30
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkspaceLeaseId">;
31
+ };
32
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
33
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
34
+ };
35
+ readonly provider_key: Schema.String;
36
+ readonly sandbox_ref: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WorkspaceRef"> & {
37
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkspaceRef">;
38
+ }>;
39
+ readonly latest_snapshot_ref: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SnapshotRef"> & {
40
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SnapshotRef">;
41
+ }>;
42
+ readonly status: Schema.Literals<readonly ["planned", "running", "suspended", "snapshotted", "archived", "released", "failed"]>;
43
+ readonly resume_strategy: Schema.Literals<readonly ["reattach", "restore_snapshot"]>;
44
+ readonly region: Schema.optionalKey<Schema.String>;
45
+ readonly request: Schema.optionalKey<Schema.Struct<{
46
+ readonly provider_key: Schema.optionalKey<Schema.String>;
47
+ readonly resume_snapshot_ref: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SnapshotRef"> & {
48
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SnapshotRef">;
49
+ }>;
50
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
51
+ }>>;
52
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
53
+ readonly created_at: Schema.Int;
54
+ readonly updated_at: Schema.Int;
55
+ }>;
56
+ export interface WorkspaceLeaseRecord extends Schema.Schema.Type<typeof WorkspaceLeaseRecord> {
57
+ }
58
+ export declare const WorkspaceSnapshotReason: Schema.Literals<readonly ["before_wait", "before_child_fork", "on_complete", "on_failure", "manual"]>;
59
+ export type WorkspaceSnapshotReason = typeof WorkspaceSnapshotReason.Type;
60
+ export declare const WorkspaceSnapshotRecord: Schema.Struct<{
61
+ readonly id: Schema.brand<Schema.String, "Relay.WorkspaceSnapshotId"> & {
62
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkspaceSnapshotId">;
63
+ };
64
+ readonly lease_id: Schema.brand<Schema.String, "Relay.WorkspaceLeaseId"> & {
65
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkspaceLeaseId">;
66
+ };
67
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
68
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
69
+ };
70
+ readonly reason: Schema.Literals<readonly ["before_wait", "before_child_fork", "on_complete", "on_failure", "manual"]>;
71
+ readonly snapshot_ref: Schema.brand<Schema.String, "Relay.SnapshotRef"> & {
72
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SnapshotRef">;
73
+ };
74
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
75
+ readonly created_at: Schema.Int;
76
+ }>;
77
+ export interface WorkspaceSnapshotRecord extends Schema.Schema.Type<typeof WorkspaceSnapshotRecord> {
78
+ }
@@ -0,0 +1,48 @@
1
+ import { Ids, Shared } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ export declare const RouteKind: Schema.Literals<readonly ["local-agent", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
5
+ export type RouteKind = typeof RouteKind.Type;
6
+ declare const AddressNotFound_base: Schema.Class<AddressNotFound, Schema.TaggedStruct<"AddressNotFound", {
7
+ readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
8
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
9
+ };
10
+ }>, import("effect/Cause").YieldableError>;
11
+ export declare class AddressNotFound extends AddressNotFound_base {
12
+ }
13
+ declare const AddressBookRepositoryError_base: Schema.Class<AddressBookRepositoryError, Schema.TaggedStruct<"AddressBookRepositoryError", {
14
+ readonly message: Schema.String;
15
+ }>, import("effect/Cause").YieldableError>;
16
+ export declare class AddressBookRepositoryError extends AddressBookRepositoryError_base {
17
+ }
18
+ export interface AddressBookEntry {
19
+ readonly id: Ids.AddressBookEntryId;
20
+ readonly addressId: Ids.AddressId;
21
+ readonly routeKind: RouteKind;
22
+ readonly routeKey: string;
23
+ readonly metadata: Shared.Metadata;
24
+ readonly createdAt: number;
25
+ readonly updatedAt: number;
26
+ }
27
+ export interface UpsertAddressBookEntryInput {
28
+ readonly id: Ids.AddressBookEntryId;
29
+ readonly addressId: Ids.AddressId;
30
+ readonly routeKind: RouteKind;
31
+ readonly routeKey: string;
32
+ readonly metadata?: Shared.Metadata;
33
+ }
34
+ export interface Interface {
35
+ readonly upsert: (input: UpsertAddressBookEntryInput) => Effect.Effect<AddressBookEntry, AddressBookRepositoryError>;
36
+ readonly resolve: (addressId: Ids.AddressId) => Effect.Effect<AddressBookEntry, AddressNotFound | AddressBookRepositoryError>;
37
+ readonly list: () => Effect.Effect<ReadonlyArray<AddressBookEntry>, AddressBookRepositoryError>;
38
+ }
39
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/AddressBookRepository", Interface>;
40
+ export declare class Service extends Service_base {
41
+ }
42
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
43
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
44
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
45
+ export declare const upsert: (input: UpsertAddressBookEntryInput) => Effect.Effect<AddressBookEntry, AddressBookRepositoryError, Service>;
46
+ export declare const resolve: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<AddressBookEntry, AddressNotFound | AddressBookRepositoryError, Service>;
47
+ export declare const list: () => Effect.Effect<readonly AddressBookEntry[], AddressBookRepositoryError, Service>;
48
+ export {};
@@ -0,0 +1,49 @@
1
+ import { Agent, Ids } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ declare const AgentDefinitionRepositoryError_base: Schema.Class<AgentDefinitionRepositoryError, Schema.TaggedStruct<"AgentDefinitionRepositoryError", {
5
+ readonly message: Schema.String;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ export declare class AgentDefinitionRepositoryError extends AgentDefinitionRepositoryError_base {
8
+ }
9
+ export interface AgentDefinitionRecord {
10
+ readonly id: Ids.AgentDefinitionId;
11
+ readonly currentRevision: Agent.DefinitionRevision;
12
+ readonly definition: Agent.Definition;
13
+ readonly createdAt: number;
14
+ readonly updatedAt: number;
15
+ }
16
+ export interface AgentDefinitionRevisionRecord {
17
+ readonly id: Ids.AgentDefinitionId;
18
+ readonly revision: Agent.DefinitionRevision;
19
+ readonly definition: Agent.Definition;
20
+ readonly createdAt: number;
21
+ }
22
+ export interface PutAgentDefinitionInput {
23
+ readonly id: Ids.AgentDefinitionId;
24
+ readonly definition: Agent.Definition;
25
+ readonly now: number;
26
+ }
27
+ export interface GetAgentDefinitionRevisionInput {
28
+ readonly id: Ids.AgentDefinitionId;
29
+ readonly revision: Agent.DefinitionRevision;
30
+ }
31
+ export interface Interface {
32
+ readonly put: (input: PutAgentDefinitionInput) => Effect.Effect<AgentDefinitionRecord, AgentDefinitionRepositoryError>;
33
+ readonly get: (id: Ids.AgentDefinitionId) => Effect.Effect<AgentDefinitionRecord | undefined, AgentDefinitionRepositoryError>;
34
+ readonly getRevision: (input: GetAgentDefinitionRevisionInput) => Effect.Effect<AgentDefinitionRevisionRecord | undefined, AgentDefinitionRepositoryError>;
35
+ readonly list: () => Effect.Effect<ReadonlyArray<AgentDefinitionRecord>, AgentDefinitionRepositoryError>;
36
+ readonly listRevisions: (id: Ids.AgentDefinitionId) => Effect.Effect<ReadonlyArray<AgentDefinitionRevisionRecord>, AgentDefinitionRepositoryError>;
37
+ }
38
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/AgentDefinitionRepository", Interface>;
39
+ export declare class Service extends Service_base {
40
+ }
41
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
42
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
43
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
44
+ export declare const put: (input: PutAgentDefinitionInput) => Effect.Effect<AgentDefinitionRecord, AgentDefinitionRepositoryError, Service>;
45
+ export declare const get: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<AgentDefinitionRecord | undefined, AgentDefinitionRepositoryError, Service>;
46
+ export declare const getRevision: (input: GetAgentDefinitionRevisionInput) => Effect.Effect<AgentDefinitionRevisionRecord | undefined, AgentDefinitionRepositoryError, Service>;
47
+ export declare const list: () => Effect.Effect<readonly AgentDefinitionRecord[], AgentDefinitionRepositoryError, Service>;
48
+ export declare const listRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">) => Effect.Effect<readonly AgentDefinitionRevisionRecord[], AgentDefinitionRepositoryError, Service>;
49
+ export {};
@@ -0,0 +1,31 @@
1
+ import { Ids } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ declare const AgentChatRepositoryError_base: Schema.Class<AgentChatRepositoryError, Schema.TaggedStruct<"AgentChatRepositoryError", {
5
+ readonly message: Schema.String;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ export declare class AgentChatRepositoryError extends AgentChatRepositoryError_base {
8
+ }
9
+ export interface AgentChatRecord {
10
+ readonly executionId: Ids.ExecutionId;
11
+ readonly exportData: unknown;
12
+ readonly updatedAt: number;
13
+ }
14
+ export interface SaveInput {
15
+ readonly executionId: Ids.ExecutionId;
16
+ readonly exportData: unknown;
17
+ readonly updatedAt: number;
18
+ }
19
+ export interface Interface {
20
+ readonly save: (input: SaveInput) => Effect.Effect<AgentChatRecord, AgentChatRepositoryError>;
21
+ readonly get: (executionId: Ids.ExecutionId) => Effect.Effect<AgentChatRecord | undefined, AgentChatRepositoryError>;
22
+ }
23
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/AgentChatRepository", Interface>;
24
+ export declare class Service extends Service_base {
25
+ }
26
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
27
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
28
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
29
+ export declare const save: (input: SaveInput) => Effect.Effect<AgentChatRecord, AgentChatRepositoryError, Service>;
30
+ export declare const get: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<AgentChatRecord | undefined, AgentChatRepositoryError, Service>;
31
+ export {};
@@ -0,0 +1,61 @@
1
+ import { Execution, Ids, Shared } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ declare const ChildExecutionRepositoryError_base: Schema.Class<ChildExecutionRepositoryError, Schema.TaggedStruct<"ChildExecutionRepositoryError", {
5
+ readonly message: Schema.String;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ export declare class ChildExecutionRepositoryError extends ChildExecutionRepositoryError_base {
8
+ }
9
+ declare const DuplicateChildExecution_base: Schema.Class<DuplicateChildExecution, Schema.TaggedStruct<"DuplicateChildExecution", {
10
+ readonly id: Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
11
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
12
+ };
13
+ }>, import("effect/Cause").YieldableError>;
14
+ export declare class DuplicateChildExecution extends DuplicateChildExecution_base {
15
+ }
16
+ declare const ChildExecutionNotFound_base: Schema.Class<ChildExecutionNotFound, Schema.TaggedStruct<"ChildExecutionNotFound", {
17
+ readonly id: Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
18
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
19
+ };
20
+ }>, import("effect/Cause").YieldableError>;
21
+ export declare class ChildExecutionNotFound extends ChildExecutionNotFound_base {
22
+ }
23
+ export interface ChildExecutionRecord {
24
+ readonly id: Ids.ChildExecutionId;
25
+ readonly executionId: Ids.ExecutionId;
26
+ readonly addressId: Ids.AddressId;
27
+ readonly status: Execution.ExecutionStatus;
28
+ readonly metadata: Shared.Metadata;
29
+ readonly createdAt: number;
30
+ readonly updatedAt: number;
31
+ }
32
+ export interface CreateChildExecutionInput {
33
+ readonly id: Ids.ChildExecutionId;
34
+ readonly executionId: Ids.ExecutionId;
35
+ readonly addressId: Ids.AddressId;
36
+ readonly status: Execution.ExecutionStatus;
37
+ readonly metadata?: Shared.Metadata;
38
+ readonly createdAt: number;
39
+ }
40
+ export interface UpdateChildExecutionStatusInput {
41
+ readonly id: Ids.ChildExecutionId;
42
+ readonly status: Execution.ExecutionStatus;
43
+ readonly updatedAt: number;
44
+ }
45
+ export interface Interface {
46
+ readonly create: (input: CreateChildExecutionInput) => Effect.Effect<ChildExecutionRecord, DuplicateChildExecution | ChildExecutionRepositoryError>;
47
+ readonly get: (id: Ids.ChildExecutionId) => Effect.Effect<ChildExecutionRecord | undefined, ChildExecutionRepositoryError>;
48
+ readonly listByExecution: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<ChildExecutionRecord>, ChildExecutionRepositoryError>;
49
+ readonly updateStatus: (input: UpdateChildExecutionStatusInput) => Effect.Effect<ChildExecutionRecord, ChildExecutionNotFound | ChildExecutionRepositoryError>;
50
+ }
51
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/ChildExecutionRepository", Interface>;
52
+ export declare class Service extends Service_base {
53
+ }
54
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
55
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
56
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
57
+ export declare const create: (input: CreateChildExecutionInput) => Effect.Effect<ChildExecutionRecord, ChildExecutionRepositoryError | DuplicateChildExecution, Service>;
58
+ export declare const get: (id: string & import("effect/Brand").Brand<"Relay.ChildExecutionId">) => Effect.Effect<ChildExecutionRecord | undefined, ChildExecutionRepositoryError, Service>;
59
+ export declare const listByExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<readonly ChildExecutionRecord[], ChildExecutionRepositoryError, Service>;
60
+ export declare const updateStatus: (input: UpdateChildExecutionStatusInput) => Effect.Effect<ChildExecutionRecord, ChildExecutionRepositoryError | ChildExecutionNotFound, Service>;
61
+ export {};
@@ -0,0 +1,35 @@
1
+ import { Context, Effect, Layer, Schema } from "effect";
2
+ import { SqlClient } from "effect/unstable/sql";
3
+ declare const ClusterRegistryError_base: Schema.Class<ClusterRegistryError, Schema.TaggedStruct<"ClusterRegistryError", {
4
+ readonly message: Schema.String;
5
+ }>, import("effect/Cause").YieldableError>;
6
+ export declare class ClusterRegistryError extends ClusterRegistryError_base {
7
+ }
8
+ export interface RunnerRecord {
9
+ readonly address: string;
10
+ readonly healthy: boolean;
11
+ readonly lastHeartbeat: number;
12
+ readonly ownedShards: number;
13
+ }
14
+ export interface Interface {
15
+ readonly listRunners: () => Effect.Effect<ReadonlyArray<RunnerRecord>, ClusterRegistryError>;
16
+ readonly lockOwner: (shardId: string) => Effect.Effect<string | undefined, ClusterRegistryError>;
17
+ }
18
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/ClusterRegistryRepository", Interface>;
19
+ export declare class Service extends Service_base {
20
+ }
21
+ export declare const RunnerRow: Schema.Struct<{
22
+ readonly address: Schema.String;
23
+ readonly healthy: Schema.Boolean;
24
+ readonly last_heartbeat: Schema.Union<readonly [Schema.Date, Schema.DateFromString]>;
25
+ readonly owned_shards: Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>;
26
+ }>;
27
+ export declare const LockRow: Schema.Struct<{
28
+ readonly address: Schema.String;
29
+ }>;
30
+ export declare const layer: Layer.Layer<Service, never, SqlClient.SqlClient>;
31
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
32
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
33
+ export declare const listRunners: () => Effect.Effect<readonly RunnerRecord[], ClusterRegistryError, Service>;
34
+ export declare const lockOwner: (shardId: string) => Effect.Effect<string | undefined, ClusterRegistryError, Service>;
35
+ export {};
@@ -0,0 +1,25 @@
1
+ import * as PgClient from "@effect/sql-pg/PgClient";
2
+ import * as PgDrizzle from "drizzle-orm/effect-postgres";
3
+ import type { EffectDrizzleQueryError } from "drizzle-orm/effect-core/errors";
4
+ import { Config, Context, Effect, Layer } from "effect";
5
+ import type { SqlError } from "effect/unstable/sql/SqlError";
6
+ export type Drizzle = PgDrizzle.EffectPgDatabase & {
7
+ readonly $client: PgClient.PgClient;
8
+ };
9
+ export type PgTimestamp = Date | string | number;
10
+ export type DatabaseError = EffectDrizzleQueryError | SqlError;
11
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/Database", Drizzle>;
12
+ export declare class Service extends Service_base {
13
+ }
14
+ export declare const toPgDate: (timestamp: number) => Date;
15
+ export declare const fromPgDate: (timestamp: PgTimestamp) => number;
16
+ export declare const fromNullablePgDate: (timestamp: PgTimestamp | null | undefined) => number | undefined;
17
+ export declare const pgTypeParsers: {
18
+ getTypeParser: (typeId: number, format?: "text" | "binary") => any;
19
+ };
20
+ export declare const PgClientLive: Layer.Layer<PgClient.PgClient | import("effect/unstable/sql/SqlClient").SqlClient, SqlError | Config.ConfigError, never>;
21
+ export declare const layerFromPgClient: Layer.Layer<Service, never, PgClient.PgClient>;
22
+ export declare const layer: Layer.Layer<Service, SqlError | Config.ConfigError, never>;
23
+ export declare const testLayer: (db: Drizzle) => Layer.Layer<Service, never, never>;
24
+ export declare const check: () => Effect.Effect<void, EffectDrizzleQueryError, Service>;
25
+ export {};
@@ -0,0 +1,158 @@
1
+ import { Address, Envelope, Ids, Shared } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ export declare const WaitState: Schema.Literals<readonly ["open", "resolved", "timed_out", "cancelled"]>;
5
+ export type WaitState = typeof WaitState.Type;
6
+ export declare const EnvelopeReadyState: Schema.Literals<readonly ["ready", "claimed", "acknowledged"]>;
7
+ export type EnvelopeReadyState = typeof EnvelopeReadyState.Type;
8
+ declare const EnvelopeRepositoryError_base: Schema.Class<EnvelopeRepositoryError, Schema.TaggedStruct<"EnvelopeRepositoryError", {
9
+ readonly message: Schema.String;
10
+ }>, import("effect/Cause").YieldableError>;
11
+ export declare class EnvelopeRepositoryError extends EnvelopeRepositoryError_base {
12
+ }
13
+ declare const EnvelopeNotFound_base: Schema.Class<EnvelopeNotFound, Schema.TaggedStruct<"EnvelopeNotFound", {
14
+ readonly id: Schema.brand<Schema.String, "Relay.EnvelopeId"> & {
15
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EnvelopeId">;
16
+ };
17
+ }>, import("effect/Cause").YieldableError>;
18
+ export declare class EnvelopeNotFound extends EnvelopeNotFound_base {
19
+ }
20
+ declare const WaitNotFound_base: Schema.Class<WaitNotFound, Schema.TaggedStruct<"WaitNotFound", {
21
+ readonly id: Schema.brand<Schema.String, "Relay.WaitId"> & {
22
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
23
+ };
24
+ }>, import("effect/Cause").YieldableError>;
25
+ export declare class WaitNotFound extends WaitNotFound_base {
26
+ }
27
+ declare const EnvelopeReadyNotFound_base: Schema.Class<EnvelopeReadyNotFound, Schema.TaggedStruct<"EnvelopeReadyNotFound", {
28
+ readonly id: Schema.brand<Schema.String, "Relay.EnvelopeReadyId"> & {
29
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EnvelopeReadyId">;
30
+ };
31
+ }>, import("effect/Cause").YieldableError>;
32
+ export declare class EnvelopeReadyNotFound extends EnvelopeReadyNotFound_base {
33
+ }
34
+ declare const EnvelopeReadyClaimMismatch_base: Schema.Class<EnvelopeReadyClaimMismatch, Schema.TaggedStruct<"EnvelopeReadyClaimMismatch", {
35
+ readonly id: Schema.brand<Schema.String, "Relay.EnvelopeReadyId"> & {
36
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EnvelopeReadyId">;
37
+ };
38
+ readonly worker_id: Schema.String;
39
+ }>, import("effect/Cause").YieldableError>;
40
+ export declare class EnvelopeReadyClaimMismatch extends EnvelopeReadyClaimMismatch_base {
41
+ }
42
+ export interface CreateEnvelopeReadyInput {
43
+ readonly id: Ids.EnvelopeReadyId;
44
+ readonly routeType: Address.RouteKind;
45
+ readonly routeKey: string;
46
+ readonly availableAt: number;
47
+ readonly idempotencyKey?: string;
48
+ readonly metadata?: Shared.Metadata;
49
+ }
50
+ export interface AcceptEnvelopeInput {
51
+ readonly envelope: Envelope.Envelope;
52
+ readonly waitId?: Ids.WaitId;
53
+ readonly ready?: CreateEnvelopeReadyInput;
54
+ }
55
+ export interface WaitRecord {
56
+ readonly id: Ids.WaitId;
57
+ readonly executionId: Ids.ExecutionId;
58
+ readonly envelopeId?: Ids.EnvelopeId;
59
+ readonly mode: Envelope.WaitMode;
60
+ readonly correlationKey?: string;
61
+ readonly state: WaitState;
62
+ readonly metadata: Shared.Metadata;
63
+ readonly createdAt: number;
64
+ readonly resolvedAt?: number;
65
+ }
66
+ export interface EnvelopeReadyRecord {
67
+ readonly id: Ids.EnvelopeReadyId;
68
+ readonly envelopeId: Ids.EnvelopeId;
69
+ readonly routeType: Address.RouteKind;
70
+ readonly routeKey: string;
71
+ readonly state: EnvelopeReadyState;
72
+ readonly availableAt: number;
73
+ readonly attempt: number;
74
+ readonly claimOwner?: string;
75
+ readonly claimExpiresAt?: number;
76
+ readonly lastError?: string;
77
+ readonly idempotencyKey?: string;
78
+ readonly metadata: Shared.Metadata;
79
+ readonly createdAt: number;
80
+ readonly updatedAt: number;
81
+ readonly claimedAt?: number;
82
+ readonly acknowledgedAt?: number;
83
+ }
84
+ export interface ClaimReadyInput {
85
+ readonly routeType: Address.RouteKind;
86
+ readonly routeKey?: string;
87
+ readonly workerId: string;
88
+ readonly now: number;
89
+ readonly claimExpiresAt: number;
90
+ }
91
+ export interface ReleaseReadyInput {
92
+ readonly id: Ids.EnvelopeReadyId;
93
+ readonly workerId: string;
94
+ readonly nextAvailableAt: number;
95
+ readonly error?: string;
96
+ }
97
+ export interface AckReadyInput {
98
+ readonly id: Ids.EnvelopeReadyId;
99
+ readonly workerId: string;
100
+ readonly now: number;
101
+ }
102
+ export interface ResolveWaitInput {
103
+ readonly waitId: Ids.WaitId;
104
+ readonly resolvedAt: number;
105
+ readonly metadata?: Shared.Metadata;
106
+ }
107
+ export interface CreateWaitInput {
108
+ readonly waitId: Ids.WaitId;
109
+ readonly executionId: Ids.ExecutionId;
110
+ readonly mode: Envelope.WaitMode;
111
+ readonly correlationKey?: string;
112
+ readonly metadata?: Shared.Metadata;
113
+ readonly createdAt: number;
114
+ }
115
+ export interface ListWaitsInput {
116
+ readonly state?: WaitState;
117
+ readonly executionId?: Ids.ExecutionId;
118
+ readonly limit?: number;
119
+ }
120
+ export interface CompleteWaitInput {
121
+ readonly waitId: Ids.WaitId;
122
+ readonly state: Exclude<WaitState, "open">;
123
+ readonly completedAt: number;
124
+ readonly metadata?: Shared.Metadata;
125
+ }
126
+ export interface CompleteWaitResult {
127
+ readonly wait: WaitRecord;
128
+ readonly transitioned: boolean;
129
+ }
130
+ export interface Interface {
131
+ readonly acceptEnvelope: (input: AcceptEnvelopeInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeRepositoryError>;
132
+ readonly getEnvelope: (id: Ids.EnvelopeId) => Effect.Effect<Envelope.Envelope | undefined, EnvelopeRepositoryError>;
133
+ readonly getWait: (id: Ids.WaitId) => Effect.Effect<WaitRecord | undefined, EnvelopeRepositoryError>;
134
+ readonly createWait: (input: CreateWaitInput) => Effect.Effect<WaitRecord, EnvelopeRepositoryError>;
135
+ readonly listWaits: (input: ListWaitsInput) => Effect.Effect<ReadonlyArray<WaitRecord>, EnvelopeRepositoryError>;
136
+ readonly claimReady: (input: ClaimReadyInput) => Effect.Effect<EnvelopeReadyRecord | undefined, EnvelopeRepositoryError>;
137
+ readonly releaseReady: (input: ReleaseReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch | EnvelopeRepositoryError>;
138
+ readonly ackReady: (input: AckReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch | EnvelopeRepositoryError>;
139
+ readonly completeWait: (input: CompleteWaitInput) => Effect.Effect<CompleteWaitResult, WaitNotFound | EnvelopeRepositoryError>;
140
+ readonly resolveWait: (input: ResolveWaitInput) => Effect.Effect<WaitRecord, WaitNotFound | EnvelopeRepositoryError>;
141
+ }
142
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/EnvelopeRepository", Interface>;
143
+ export declare class Service extends Service_base {
144
+ }
145
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
146
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
147
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
148
+ export declare const acceptEnvelope: (input: AcceptEnvelopeInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeRepositoryError, Service>;
149
+ export declare const getEnvelope: (id: string & import("effect/Brand").Brand<"Relay.EnvelopeId">) => Effect.Effect<Envelope.Envelope | undefined, EnvelopeRepositoryError, Service>;
150
+ export declare const getWait: (id: string & import("effect/Brand").Brand<"Relay.WaitId">) => Effect.Effect<WaitRecord | undefined, EnvelopeRepositoryError, Service>;
151
+ export declare const createWait: (input: CreateWaitInput) => Effect.Effect<WaitRecord, EnvelopeRepositoryError, Service>;
152
+ export declare const listWaits: (input: ListWaitsInput) => Effect.Effect<readonly WaitRecord[], EnvelopeRepositoryError, Service>;
153
+ export declare const claimReady: (input: ClaimReadyInput) => Effect.Effect<EnvelopeReadyRecord | undefined, EnvelopeRepositoryError, Service>;
154
+ export declare const releaseReady: (input: ReleaseReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeRepositoryError | EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch, Service>;
155
+ export declare const ackReady: (input: AckReadyInput) => Effect.Effect<EnvelopeReadyRecord, EnvelopeRepositoryError | EnvelopeReadyNotFound | EnvelopeReadyClaimMismatch, Service>;
156
+ export declare const completeWait: (input: CompleteWaitInput) => Effect.Effect<CompleteWaitResult, EnvelopeRepositoryError | WaitNotFound, Service>;
157
+ export declare const resolveWait: (input: ResolveWaitInput) => Effect.Effect<WaitRecord, EnvelopeRepositoryError | WaitNotFound, Service>;
158
+ export {};
@@ -0,0 +1,86 @@
1
+ import { Execution, Ids } from "../../schema/index";
2
+ import { Context, Effect, Layer, Option, Schema, Stream } from "effect";
3
+ import * as Database from "../database/database-service";
4
+ export declare const executionEventsChannel = "relay_execution_events";
5
+ declare const DuplicateExecutionEvent_base: Schema.Class<DuplicateExecutionEvent, Schema.TaggedStruct<"DuplicateExecutionEvent", {
6
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
7
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
8
+ };
9
+ readonly sequence: Schema.Int;
10
+ readonly cursor: Schema.String;
11
+ }>, import("effect/Cause").YieldableError>;
12
+ export declare class DuplicateExecutionEvent extends DuplicateExecutionEvent_base {
13
+ }
14
+ declare const ExecutionEventOrderViolation_base: Schema.Class<ExecutionEventOrderViolation, Schema.TaggedStruct<"ExecutionEventOrderViolation", {
15
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
16
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
17
+ };
18
+ readonly sequence: Schema.Int;
19
+ readonly previous_sequence: Schema.Int;
20
+ }>, import("effect/Cause").YieldableError>;
21
+ export declare class ExecutionEventOrderViolation extends ExecutionEventOrderViolation_base {
22
+ }
23
+ declare const ExecutionEventCursorNotFound_base: Schema.Class<ExecutionEventCursorNotFound, Schema.TaggedStruct<"ExecutionEventCursorNotFound", {
24
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
25
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
26
+ };
27
+ readonly cursor: Schema.String;
28
+ }>, import("effect/Cause").YieldableError>;
29
+ export declare class ExecutionEventCursorNotFound extends ExecutionEventCursorNotFound_base {
30
+ }
31
+ declare const ExecutionEventRepositoryError_base: Schema.Class<ExecutionEventRepositoryError, Schema.TaggedStruct<"ExecutionEventRepositoryError", {
32
+ readonly message: Schema.String;
33
+ }>, import("effect/Cause").YieldableError>;
34
+ export declare class ExecutionEventRepositoryError extends ExecutionEventRepositoryError_base {
35
+ }
36
+ export interface ListInput {
37
+ readonly executionId: Ids.ExecutionId;
38
+ readonly afterCursor?: string;
39
+ readonly limit?: number;
40
+ }
41
+ export interface FindBySequenceOrCursorInput {
42
+ readonly executionId: Ids.ExecutionId;
43
+ readonly sequence: Execution.ExecutionEventSequence;
44
+ readonly cursor: string;
45
+ }
46
+ export interface FindByCursorInput {
47
+ readonly executionId: Ids.ExecutionId;
48
+ readonly cursor: string;
49
+ }
50
+ export interface FindFirstByTypeAfterSequenceInput {
51
+ readonly executionId: Ids.ExecutionId;
52
+ readonly type: Execution.ExecutionEventType;
53
+ readonly afterSequence: Execution.ExecutionEventSequence;
54
+ }
55
+ export interface ListAfterSequenceInput {
56
+ readonly executionId: Ids.ExecutionId;
57
+ readonly afterSequence: Execution.ExecutionEventSequence | undefined;
58
+ readonly limit: number;
59
+ }
60
+ export interface Interface {
61
+ readonly append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, DuplicateExecutionEvent | ExecutionEventOrderViolation | ExecutionEventRepositoryError>;
62
+ readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, ExecutionEventCursorNotFound | ExecutionEventRepositoryError>;
63
+ readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
64
+ readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
65
+ readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
66
+ readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, ExecutionEventRepositoryError>;
67
+ readonly notifyAppended: (event: Execution.ExecutionEvent) => Effect.Effect<void, ExecutionEventRepositoryError>;
68
+ readonly appendedSignals: (executionId: Ids.ExecutionId) => Stream.Stream<Execution.ExecutionEventSequence, ExecutionEventRepositoryError>;
69
+ readonly listAfterSequence: (input: ListAfterSequenceInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
70
+ }
71
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/ExecutionEventRepository", Interface>;
72
+ export declare class Service extends Service_base {
73
+ }
74
+ export declare const layer: Layer.Layer<Service, never, Database.Service>;
75
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
76
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
77
+ export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, DuplicateExecutionEvent | ExecutionEventOrderViolation | ExecutionEventRepositoryError, Service>;
78
+ export declare const list: (input: ListInput) => Effect.Effect<readonly Execution.ExecutionEvent[], ExecutionEventCursorNotFound | ExecutionEventRepositoryError, Service>;
79
+ export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
80
+ export declare const findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
81
+ export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
82
+ export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, ExecutionEventRepositoryError, Service>;
83
+ export declare const notifyAppended: (event: Execution.ExecutionEvent) => Effect.Effect<void, ExecutionEventRepositoryError, Service>;
84
+ export declare const appendedSignals: (executionId: Ids.ExecutionId) => Stream.Stream<number, ExecutionEventRepositoryError, Service>;
85
+ export declare const listAfterSequence: (input: ListAfterSequenceInput) => Effect.Effect<readonly Execution.ExecutionEvent[], ExecutionEventRepositoryError, Service>;
86
+ export {};