@relayfx/sdk 0.7.14 → 0.7.16

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.
@@ -0,0 +1,23 @@
1
+ import { Context, Layer, Schema } from "effect";
2
+ export type ProviderErrorKind = "not-found" | "precondition" | "conditional-conflict" | "other";
3
+ declare const ProviderError_base: Schema.Class<ProviderError, Schema.TaggedStruct<"ProviderError", {
4
+ readonly kind: Schema.Literals<readonly ["not-found", "precondition", "conditional-conflict", "other"]>;
5
+ }>, import("effect/Cause").YieldableError>;
6
+ /** Safe provider classification. Raw SDK errors must not cross this adapter boundary. */
7
+ export declare class ProviderError extends ProviderError_base {
8
+ }
9
+ export declare const classifyProviderError: (cause: unknown) => ProviderError;
10
+ export interface S3Sender {
11
+ readonly send: (command: never, options?: {
12
+ readonly abortSignal?: AbortSignal;
13
+ }) => Promise<unknown>;
14
+ }
15
+ export interface Interface {
16
+ readonly client: S3Sender;
17
+ }
18
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/execution/event-history-s3-client/Service", Interface>;
19
+ export declare class Service extends Service_base {
20
+ }
21
+ export declare const layer: (client: S3Sender) => Layer.Layer<Service>;
22
+ export declare const testLayer: typeof layer;
23
+ export {};
@@ -0,0 +1,22 @@
1
+ import { Crypto, Effect, Layer } from "effect";
2
+ import { ProviderError, Service as S3ClientService } from "./event-history-s3-client";
3
+ import { HistoryObjectSizeError, HistoryReadError, HistoryWriteError, Service } from "./event-history-store";
4
+ export interface Options {
5
+ readonly bucket: string;
6
+ readonly prefix: string;
7
+ readonly operationGate: OperationGate;
8
+ }
9
+ type OperationError = ProviderError | HistoryObjectSizeError | HistoryReadError;
10
+ export interface OperationGate {
11
+ readonly run: <A>(start: (signal: AbortSignal) => Promise<A>) => Effect.Effect<A, OperationError>;
12
+ }
13
+ /** FIFO admission whose detached host operation retains the slot until it actually settles. */
14
+ export declare const makeOperationGate: () => OperationGate;
15
+ export declare const readRootMarker: (options: Options) => Effect.Effect<string | undefined, HistoryReadError, S3ClientService>;
16
+ export declare const readProvisionalRootMarker: (options: Options) => Effect.Effect<string | undefined, HistoryReadError, S3ClientService>;
17
+ export declare const prepareProvisionalRootMarker: (options: Options, identity: string) => Effect.Effect<void, HistoryReadError | HistoryWriteError, S3ClientService>;
18
+ export declare const publishRootMarker: (options: Options, identity: string) => Effect.Effect<undefined, HistoryReadError | HistoryWriteError, S3ClientService>;
19
+ export declare const initializeRoot: (options: Options, identity: string) => Effect.Effect<undefined, HistoryReadError | HistoryWriteError, S3ClientService>;
20
+ export declare const checkRoot: (options: Options, identity: string) => Effect.Effect<undefined, HistoryReadError, S3ClientService>;
21
+ export declare const layer: (options: Options) => Layer.Layer<Service, never, Crypto.Crypto | S3ClientService>;
22
+ export {};
@@ -51,6 +51,7 @@ export interface TransitionExecutionInput {
51
51
  readonly status: Execution.ExecutionStatus;
52
52
  readonly metadata?: Shared.Metadata;
53
53
  readonly updatedAt: number;
54
+ readonly unlessCancellationRequested?: boolean;
54
55
  }
55
56
  export interface ExecutionCursor {
56
57
  readonly updatedAt: number;
@@ -3,10 +3,17 @@ import { FileSystem } from "effect/FileSystem";
3
3
  import { Path } from "effect/Path";
4
4
  import { SqlClient } from "effect/unstable/sql/SqlClient";
5
5
  import { type Options } from "./event-history-file-system";
6
+ import { makeOperationGate, type Options as S3Options } from "./event-history-s3";
7
+ import { Service as S3ClientService } from "./event-history-s3-client";
6
8
  import { HistoryReadError, HistoryWriteError } from "./event-history-store";
7
9
  import { Service } from "./execution-event-repository";
8
- export declare const initializeFileSystem: (options: Options) => Effect.Effect<undefined, HistoryWriteError, Crypto.Crypto | FileSystem | Path | SqlClient>;
9
- export declare const fileSystemHealth: (options: Options) => Effect.Effect<undefined, HistoryReadError, FileSystem | SqlClient>;
10
+ export declare const initializeFileSystem: (options: Options) => Effect.Effect<void, HistoryWriteError, Crypto.Crypto | FileSystem | Path | SqlClient>;
11
+ export declare const initializeS3: (options: S3Options) => Effect.Effect<void, HistoryWriteError, Crypto.Crypto | S3ClientService | SqlClient>;
12
+ export declare const fileSystemHealth: (options: Options) => Effect.Effect<undefined, HistoryReadError, Crypto.Crypto | FileSystem | Path | SqlClient>;
13
+ export declare const s3Health: (options: S3Options) => Effect.Effect<undefined, HistoryReadError, S3ClientService | SqlClient>;
14
+ export declare const makeS3OperationGate: typeof makeOperationGate;
10
15
  /** Internal runtime composition. Archive repositories and codecs are intentionally not exported. */
11
16
  export declare const fileSystemRepositoryLayer: (options: Options) => Layer.Layer<Service, HistoryWriteError, Crypto.Crypto | FileSystem | Path | import("../database/notification-bus").Service | SqlClient>;
17
+ export declare const s3RepositoryLayer: (options: S3Options) => Layer.Layer<Service, HistoryWriteError, Crypto.Crypto | import("../database/notification-bus").Service | S3ClientService | SqlClient>;
12
18
  export type FileSystemRequirements = FileSystem | Crypto.Crypto | Path | SqlClient;
19
+ export type S3Requirements = S3ClientService | Crypto.Crypto | SqlClient;
@@ -10,6 +10,8 @@ export * as EnvelopeRepository from "./envelope/envelope-repository";
10
10
  export * as ResidentRepository from "./resident/resident-repository";
11
11
  export * as ExecutionEventRepository from "./execution/execution-event-repository";
12
12
  export * as RuntimeEventHistory from "./execution/runtime-event-history";
13
+ export * as EventHistoryS3 from "./execution/event-history-s3";
14
+ export * as EventHistoryS3Client from "./execution/event-history-s3-client";
13
15
  export * as ExecutionRepository from "./execution/execution-repository";
14
16
  export * as ExecutionStateRepository from "./state/execution-state-repository";
15
17
  export * as IdempotencyRepository from "./idempotency/idempotency-repository";
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.7.14",
4
+ "version": "0.7.16",
5
5
  "description": "Effect-native durable execution SDK for addressable agents and tools",
6
6
  "type": "module",
7
7
  "exports": {
@@ -51,12 +51,13 @@
51
51
  "url": "https://github.com/In-Time-Tec/relayfx/issues"
52
52
  },
53
53
  "scripts": {
54
- "build": "rm -rf dist && bun build ./src/index.ts ./src/ai.ts ./src/http-server.ts ./src/sqlite.ts ./src/postgres.ts ./src/mysql.ts --outdir dist --target bun --format esm --splitting --external effect --external 'effect/*' --external '@effect/*' --external drizzle-orm --external 'drizzle-orm/*' --external pg && bun scripts/build-types.ts",
54
+ "build": "rm -rf dist && bun build ./src/index.ts ./src/ai.ts ./src/http-server.ts ./src/sqlite.ts ./src/postgres.ts ./src/mysql.ts --outdir dist --target bun --format esm --splitting --external effect --external 'effect/*' --external '@effect/*' --external '@aws-sdk/*' --external drizzle-orm --external 'drizzle-orm/*' --external pg && bun scripts/build-types.ts",
55
55
  "lint": "bun --cwd ../.. oxlint packages/relay/src packages/relay/scripts packages/relay/test",
56
- "test": "bun --cwd ../.. vitest run packages/relay/test --passWithNoTests && bun test/sqlite.integration.ts && bun test/mysql-migration-recovery.integration.ts",
56
+ "test": "bun --cwd ../.. vitest run packages/relay/test --passWithNoTests && bun test/sqlite.integration.ts && bun test/mysql-migration-recovery.integration.ts && bun test/s3-cold-history.integration.ts",
57
57
  "typecheck": "bun tsc --noEmit"
58
58
  },
59
59
  "dependencies": {
60
+ "@aws-sdk/client-s3": "3.1094.0",
60
61
  "@batonfx/core": "0.11.8",
61
62
  "@batonfx/providers": "0.11.8",
62
63
  "@effect/ai-anthropic": "4.0.0-beta.98",
@@ -75,7 +76,7 @@
75
76
  "@effect/vitest": "4.0.0-beta.98",
76
77
  "@relayfx/ai": "0.0.0",
77
78
  "@relayfx/runtime": "0.0.0",
78
- "@relayfx/schema": "0.7.14",
79
+ "@relayfx/schema": "0.7.16",
79
80
  "@relayfx/store-sql": "0.0.0",
80
81
  "@types/bun": "1.3.14",
81
82
  "typescript": "7.0.2",