@relayfx/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8449 -0
- package/dist/migrations/20260701002839_sour_cerebro/migration.sql +160 -0
- package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +1971 -0
- package/dist/migrations/20260701041134_acoustic_hulk/migration.sql +30 -0
- package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +2372 -0
- package/dist/migrations/20260701160543_condemned_stryfe/migration.sql +2 -0
- package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +2442 -0
- package/dist/migrations/20260701220315_heavy_gorgon/migration.sql +5 -0
- package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +2495 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/migration.sql +24 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +2821 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/migration.sql +1 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +2821 -0
- package/dist/types/ai/index.d.ts +2 -0
- package/dist/types/ai/language-model/language-model-registration.d.ts +89 -0
- package/dist/types/relay/adapter-outbox.d.ts +19 -0
- package/dist/types/relay/client.d.ts +102 -0
- package/dist/types/relay/database.d.ts +11 -0
- package/dist/types/relay/index.d.ts +10 -0
- package/dist/types/relay/operation.d.ts +921 -0
- package/dist/types/runtime/address/address-book-service.d.ts +74 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +106 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +53 -0
- package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +102 -0
- package/dist/types/runtime/child/child-run-service.d.ts +90 -0
- package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +393 -0
- package/dist/types/runtime/content/artifact-store-service.d.ts +73 -0
- package/dist/types/runtime/content/blob-store-service.d.ts +87 -0
- package/dist/types/runtime/envelope/envelope-service.d.ts +52 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +54 -0
- package/dist/types/runtime/execution/execution-service.d.ts +62 -0
- package/dist/types/runtime/index.d.ts +25 -0
- package/dist/types/runtime/model/language-model-service.d.ts +58 -0
- package/dist/types/runtime/model/model-call-policy.d.ts +53 -0
- package/dist/types/runtime/observability/runtime-metrics.d.ts +9 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +132 -0
- package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +85 -0
- package/dist/types/runtime/wait/wait-service.d.ts +80 -0
- package/dist/types/runtime/wait/wait-signal.d.ts +15 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +335 -0
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +63 -0
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
- package/dist/types/schema/address-schema.d.ts +77 -0
- package/dist/types/schema/agent-schema.d.ts +360 -0
- package/dist/types/schema/content-schema.d.ts +106 -0
- package/dist/types/schema/envelope-schema.d.ts +167 -0
- package/dist/types/schema/execution-schema.d.ts +297 -0
- package/dist/types/schema/ids-schema.d.ts +61 -0
- package/dist/types/schema/index.d.ts +11 -0
- package/dist/types/schema/schedule-schema.d.ts +73 -0
- package/dist/types/schema/shared-schema.d.ts +11 -0
- package/dist/types/schema/tool-schema.d.ts +53 -0
- package/dist/types/schema/workspace-schema.d.ts +78 -0
- package/dist/types/store-sql/address/address-book-repository.d.ts +48 -0
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +49 -0
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +31 -0
- package/dist/types/store-sql/child/child-execution-repository.d.ts +61 -0
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +35 -0
- package/dist/types/store-sql/database/database-service.d.ts +25 -0
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +158 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +86 -0
- package/dist/types/store-sql/execution/execution-repository.d.ts +80 -0
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +42 -0
- package/dist/types/store-sql/index.d.ts +15 -0
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +83 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +2302 -0
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +66 -0
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +87 -0
- package/package.json +44 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Ids, Tool } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import * as Database from "../database/database-service";
|
|
4
|
+
declare const ToolCallRepositoryError_base: Schema.Class<ToolCallRepositoryError, Schema.TaggedStruct<"ToolCallRepositoryError", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class ToolCallRepositoryError extends ToolCallRepositoryError_base {
|
|
8
|
+
}
|
|
9
|
+
declare const ToolCallNotFound_base: Schema.Class<ToolCallNotFound, Schema.TaggedStruct<"ToolCallNotFound", {
|
|
10
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
11
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
12
|
+
};
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
export declare class ToolCallNotFound extends ToolCallNotFound_base {
|
|
15
|
+
}
|
|
16
|
+
declare const DuplicateToolCall_base: Schema.Class<DuplicateToolCall, Schema.TaggedStruct<"DuplicateToolCall", {
|
|
17
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
18
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
19
|
+
};
|
|
20
|
+
}>, import("effect/Cause").YieldableError>;
|
|
21
|
+
export declare class DuplicateToolCall extends DuplicateToolCall_base {
|
|
22
|
+
}
|
|
23
|
+
declare const DuplicateToolResult_base: Schema.Class<DuplicateToolResult, Schema.TaggedStruct<"DuplicateToolResult", {
|
|
24
|
+
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
25
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
26
|
+
};
|
|
27
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28
|
+
export declare class DuplicateToolResult extends DuplicateToolResult_base {
|
|
29
|
+
}
|
|
30
|
+
export interface ToolCallRecord {
|
|
31
|
+
readonly executionId: Ids.ExecutionId;
|
|
32
|
+
readonly call: Tool.Call;
|
|
33
|
+
readonly createdAt: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ToolResultRecord {
|
|
36
|
+
readonly result: Tool.Result;
|
|
37
|
+
readonly createdAt: number;
|
|
38
|
+
}
|
|
39
|
+
export interface RecordCallInput {
|
|
40
|
+
readonly executionId: Ids.ExecutionId;
|
|
41
|
+
readonly call: Tool.Call;
|
|
42
|
+
readonly createdAt: number;
|
|
43
|
+
}
|
|
44
|
+
export interface RecordResultInput {
|
|
45
|
+
readonly result: Tool.Result;
|
|
46
|
+
readonly createdAt: number;
|
|
47
|
+
}
|
|
48
|
+
export interface Interface {
|
|
49
|
+
readonly recordCall: (input: RecordCallInput) => Effect.Effect<ToolCallRecord, DuplicateToolCall | ToolCallRepositoryError>;
|
|
50
|
+
readonly getCall: (id: Ids.ToolCallId) => Effect.Effect<ToolCallRecord | undefined, ToolCallRepositoryError>;
|
|
51
|
+
readonly listCalls: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<ToolCallRecord>, ToolCallRepositoryError>;
|
|
52
|
+
readonly recordResult: (input: RecordResultInput) => Effect.Effect<ToolResultRecord, ToolCallNotFound | DuplicateToolResult | ToolCallRepositoryError>;
|
|
53
|
+
readonly getResult: (callId: Ids.ToolCallId) => Effect.Effect<ToolResultRecord | undefined, ToolCallRepositoryError>;
|
|
54
|
+
}
|
|
55
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/ToolCallRepository", Interface>;
|
|
56
|
+
export declare class Service extends Service_base {
|
|
57
|
+
}
|
|
58
|
+
export declare const layer: Layer.Layer<Service, never, Database.Service>;
|
|
59
|
+
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
60
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
61
|
+
export declare const recordCall: (input: RecordCallInput) => Effect.Effect<ToolCallRecord, ToolCallRepositoryError | DuplicateToolCall, Service>;
|
|
62
|
+
export declare const getCall: (id: string & import("effect/Brand").Brand<"Relay.ToolCallId">) => Effect.Effect<ToolCallRecord | undefined, ToolCallRepositoryError, Service>;
|
|
63
|
+
export declare const listCalls: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<readonly ToolCallRecord[], ToolCallRepositoryError, Service>;
|
|
64
|
+
export declare const recordResult: (input: RecordResultInput) => Effect.Effect<ToolResultRecord, ToolCallRepositoryError | ToolCallNotFound | DuplicateToolResult, Service>;
|
|
65
|
+
export declare const getResult: (callId: string & import("effect/Brand").Brand<"Relay.ToolCallId">) => Effect.Effect<ToolResultRecord | undefined, ToolCallRepositoryError, Service>;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Ids, Shared, Workspace } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import * as Database from "../database/database-service";
|
|
4
|
+
declare const WorkspaceLeaseRepositoryError_base: Schema.Class<WorkspaceLeaseRepositoryError, Schema.TaggedStruct<"WorkspaceLeaseRepositoryError", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class WorkspaceLeaseRepositoryError extends WorkspaceLeaseRepositoryError_base {
|
|
8
|
+
}
|
|
9
|
+
declare const DuplicateWorkspaceLease_base: Schema.Class<DuplicateWorkspaceLease, Schema.TaggedStruct<"DuplicateWorkspaceLease", {
|
|
10
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
11
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
12
|
+
};
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
export declare class DuplicateWorkspaceLease extends DuplicateWorkspaceLease_base {
|
|
15
|
+
}
|
|
16
|
+
declare const WorkspaceLeaseNotFound_base: Schema.Class<WorkspaceLeaseNotFound, Schema.TaggedStruct<"WorkspaceLeaseNotFound", {
|
|
17
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
18
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
19
|
+
};
|
|
20
|
+
}>, import("effect/Cause").YieldableError>;
|
|
21
|
+
export declare class WorkspaceLeaseNotFound extends WorkspaceLeaseNotFound_base {
|
|
22
|
+
}
|
|
23
|
+
export type WorkspaceLeaseRecord = Workspace.WorkspaceLeaseRecord;
|
|
24
|
+
export type WorkspaceSnapshotRecord = Workspace.WorkspaceSnapshotRecord;
|
|
25
|
+
export interface PlanInput {
|
|
26
|
+
readonly id: Ids.WorkspaceLeaseId;
|
|
27
|
+
readonly executionId: Ids.ExecutionId;
|
|
28
|
+
readonly providerKey: Workspace.WorkspaceProviderKey;
|
|
29
|
+
readonly resumeStrategy?: Workspace.WorkspaceResumeStrategy;
|
|
30
|
+
readonly region?: string;
|
|
31
|
+
readonly request?: Workspace.WorkspaceRequest;
|
|
32
|
+
readonly metadata?: Shared.Metadata;
|
|
33
|
+
readonly now: number;
|
|
34
|
+
}
|
|
35
|
+
export interface MarkRunningInput {
|
|
36
|
+
readonly executionId: Ids.ExecutionId;
|
|
37
|
+
readonly sandboxRef: Ids.WorkspaceRef;
|
|
38
|
+
readonly updatedAt: number;
|
|
39
|
+
}
|
|
40
|
+
export interface MarkSuspendedInput {
|
|
41
|
+
readonly executionId: Ids.ExecutionId;
|
|
42
|
+
readonly updatedAt: number;
|
|
43
|
+
}
|
|
44
|
+
export interface MarkResumedInput {
|
|
45
|
+
readonly executionId: Ids.ExecutionId;
|
|
46
|
+
readonly sandboxRef?: Ids.WorkspaceRef;
|
|
47
|
+
readonly updatedAt: number;
|
|
48
|
+
}
|
|
49
|
+
export interface RecordSnapshotInput {
|
|
50
|
+
readonly id: Ids.WorkspaceSnapshotId;
|
|
51
|
+
readonly leaseId: Ids.WorkspaceLeaseId;
|
|
52
|
+
readonly executionId: Ids.ExecutionId;
|
|
53
|
+
readonly reason: Workspace.WorkspaceSnapshotReason;
|
|
54
|
+
readonly snapshotRef: Ids.SnapshotRef;
|
|
55
|
+
readonly metadata?: Shared.Metadata;
|
|
56
|
+
readonly createdAt: number;
|
|
57
|
+
}
|
|
58
|
+
export interface MarkTerminalInput {
|
|
59
|
+
readonly executionId: Ids.ExecutionId;
|
|
60
|
+
readonly metadata?: Shared.Metadata;
|
|
61
|
+
readonly updatedAt: number;
|
|
62
|
+
}
|
|
63
|
+
export interface Interface {
|
|
64
|
+
readonly plan: (input: PlanInput) => Effect.Effect<WorkspaceLeaseRecord, DuplicateWorkspaceLease | WorkspaceLeaseRepositoryError>;
|
|
65
|
+
readonly getByExecution: (id: Ids.ExecutionId) => Effect.Effect<WorkspaceLeaseRecord | undefined, WorkspaceLeaseRepositoryError>;
|
|
66
|
+
readonly markRunning: (input: MarkRunningInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
67
|
+
readonly markSuspended: (input: MarkSuspendedInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
68
|
+
readonly markResumed: (input: MarkResumedInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
69
|
+
readonly recordSnapshot: (input: RecordSnapshotInput) => Effect.Effect<WorkspaceSnapshotRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
70
|
+
readonly markReleased: (input: MarkTerminalInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
71
|
+
readonly markFailed: (input: MarkTerminalInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
72
|
+
}
|
|
73
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/WorkspaceLeaseRepository", Interface>;
|
|
74
|
+
export declare class Service extends Service_base {
|
|
75
|
+
}
|
|
76
|
+
export declare const layer: Layer.Layer<Service, never, Database.Service>;
|
|
77
|
+
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
78
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
79
|
+
export declare const plan: (input: PlanInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | DuplicateWorkspaceLease, Service>;
|
|
80
|
+
export declare const getByExecution: (id: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Workspace.WorkspaceLeaseRecord | undefined, WorkspaceLeaseRepositoryError, Service>;
|
|
81
|
+
export declare const markRunning: (input: MarkRunningInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
82
|
+
export declare const markSuspended: (input: MarkSuspendedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
83
|
+
export declare const markResumed: (input: MarkResumedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
84
|
+
export declare const recordSnapshot: (input: RecordSnapshotInput) => Effect.Effect<Workspace.WorkspaceSnapshotRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
85
|
+
export declare const markReleased: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
86
|
+
export declare const markFailed: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseRepositoryError | WorkspaceLeaseNotFound, Service>;
|
|
87
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
+
"name": "@relayfx/sdk",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/types/relay/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./migrations/*": "./dist/migrations/*"
|
|
12
|
+
},
|
|
13
|
+
"types": "./dist/types/relay/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "bun build ./src/index.ts --outdir dist --target bun --format esm --external effect --external 'effect/*' --external '@effect/*' --external drizzle-orm --external 'drizzle-orm/*' --external pg && bun scripts/build-types.ts",
|
|
19
|
+
"lint": "bun --cwd ../.. oxlint packages/relay/src packages/relay/scripts packages/relay/test",
|
|
20
|
+
"test": "bun --cwd ../.. vitest run packages/relay/test --passWithNoTests",
|
|
21
|
+
"typecheck": "bun tsc --noEmit"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@effect/ai-anthropic": "4.0.0-beta.90",
|
|
25
|
+
"@effect/ai-openai": "4.0.0-beta.90",
|
|
26
|
+
"@effect/ai-openai-compat": "4.0.0-beta.90",
|
|
27
|
+
"@effect/ai-openrouter": "4.0.0-beta.90",
|
|
28
|
+
"@effect/sql-pg": "4.0.0-beta.90",
|
|
29
|
+
"drizzle-orm": "1.0.0-rc.3",
|
|
30
|
+
"effect": "4.0.0-beta.90",
|
|
31
|
+
"pg": "8.21.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@effect/platform-bun": "4.0.0-beta.90",
|
|
35
|
+
"@effect/vitest": "4.0.0-beta.90",
|
|
36
|
+
"@relayfx/ai": "0.0.0",
|
|
37
|
+
"@relayfx/runtime": "0.0.0",
|
|
38
|
+
"@relayfx/schema": "0.0.0",
|
|
39
|
+
"@relayfx/store-sql": "0.0.0",
|
|
40
|
+
"@types/bun": "1.3.13",
|
|
41
|
+
"typescript": "5.8.2",
|
|
42
|
+
"vitest": "4.0.16"
|
|
43
|
+
}
|
|
44
|
+
}
|