@relayfx/sdk 0.2.15 → 0.2.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.
- package/dist/ai.js +2 -2
- package/dist/{index-z9xk02sv.js → index-5x686v8w.js} +1782 -1542
- package/dist/{index-gxskhyra.js → index-6dv1dqq1.js} +8 -8
- package/dist/{index-xbbfagnb.js → index-a6vwwhcp.js} +116 -105
- package/dist/{index-d8q4kfjy.js → index-per7tyzq.js} +12 -8
- package/dist/index.js +5 -5
- package/dist/mysql.js +24 -9
- package/dist/postgres.js +18 -13
- package/dist/sqlite.js +26 -29
- package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +2 -2
- package/dist/types/relay/adapter-outbox.d.ts +1 -1
- package/dist/types/relay/client.d.ts +28 -28
- package/dist/types/relay/command.d.ts +10 -4
- package/dist/types/relay/database.d.ts +4 -4
- package/dist/types/relay/migration-errors.d.ts +8 -2
- package/dist/types/relay/mysql.d.ts +2 -2
- package/dist/types/relay/operation.d.ts +126 -126
- package/dist/types/relay/postgres.d.ts +2 -2
- package/dist/types/relay/runtime-capability-policy.d.ts +11 -5
- package/dist/types/relay/runtime-database.d.ts +1 -1
- package/dist/types/relay/runtime.d.ts +4 -4
- package/dist/types/relay/sqlite-migrations.d.ts +1 -1
- package/dist/types/relay/sqlite-runtime.d.ts +10 -5
- package/dist/types/relay/tool-worker.d.ts +6 -5
- package/dist/types/runtime/address/address-book-service.d.ts +3 -3
- package/dist/types/runtime/address/address-resolution-service.d.ts +41 -41
- package/dist/types/runtime/agent/agent-loop-service.d.ts +14 -5
- package/dist/types/runtime/agent/agent-registry-service.d.ts +2 -2
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +1 -1
- package/dist/types/runtime/agent/relay-tool-output.d.ts +4 -1
- package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +1 -1
- package/dist/types/runtime/child/child-fan-out-runtime.d.ts +12 -8
- package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +1 -1
- package/dist/types/runtime/child/child-run-service.d.ts +7 -4
- package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -2
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +5 -4
- package/dist/types/runtime/cluster/execution-entity.d.ts +2 -2
- package/dist/types/runtime/content/artifact-store-service.d.ts +2 -2
- package/dist/types/runtime/content/blob-store-service.d.ts +1 -1
- package/dist/types/runtime/entity/entity-instance-service.d.ts +14 -5
- package/dist/types/runtime/entity/entity-registry-service.d.ts +2 -2
- package/dist/types/runtime/envelope/envelope-service.d.ts +2 -2
- package/dist/types/runtime/execution/active-execution-registry.d.ts +1 -1
- package/dist/types/runtime/execution/event-log-service.d.ts +5 -2
- package/dist/types/runtime/execution/execution-service.d.ts +1 -1
- package/dist/types/runtime/execution/execution-watch-service.d.ts +1 -1
- package/dist/types/runtime/execution/session-stream-service.d.ts +1 -1
- package/dist/types/runtime/inbox/inbox-service.d.ts +1 -1
- package/dist/types/runtime/memory/memory-service.d.ts +1 -1
- package/dist/types/runtime/model/embedding-model-service.d.ts +23 -10
- package/dist/types/runtime/model/language-model-service.d.ts +19 -6
- package/dist/types/runtime/model/model-call-policy.d.ts +1 -1
- package/dist/types/runtime/observability/runtime-metrics.d.ts +12 -3
- package/dist/types/runtime/presence/presence-service.d.ts +1 -1
- package/dist/types/runtime/presence/presence-tool.d.ts +1 -1
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +19 -19
- package/dist/types/runtime/schedule/scheduler-service.d.ts +3 -3
- package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +2 -2
- package/dist/types/runtime/session/session-store-service.d.ts +13 -4
- package/dist/types/runtime/skill/skill-registry-service.d.ts +2 -2
- package/dist/types/runtime/state/execution-state-service.d.ts +5 -2
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +42 -19
- package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +2 -2
- package/dist/types/runtime/topic/topic-service.d.ts +1 -1
- package/dist/types/runtime/wait/wait-service.d.ts +1 -1
- package/dist/types/runtime/wait/wait-signal.d.ts +12 -3
- package/dist/types/runtime/workflow/activity-version-registry.d.ts +7 -3
- package/dist/types/runtime/workflow/definition-runtime.d.ts +37 -22
- package/dist/types/runtime/workflow/execution-workflow.d.ts +105 -110
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +6 -6
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +11 -7
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +1 -1
- package/dist/types/schema/agent-schema.d.ts +246 -246
- package/dist/types/schema/child-orchestration-schema.d.ts +64 -64
- package/dist/types/schema/execution-schema.d.ts +57 -57
- package/dist/types/schema/workflow-schema.d.ts +243 -243
- package/dist/types/schema/workspace-schema.d.ts +1 -1
- package/dist/types/store-sql/address/address-book-repository.d.ts +5 -5
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +7 -7
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
- package/dist/types/store-sql/child/child-execution-repository.d.ts +4 -4
- package/dist/types/store-sql/child/child-fan-out-repository.d.ts +2 -2
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +5 -5
- package/dist/types/store-sql/compaction/compaction-repository.d.ts +3 -3
- package/dist/types/store-sql/database/database-service.d.ts +3 -3
- package/dist/types/store-sql/database/notification-bus.d.ts +1 -1
- package/dist/types/store-sql/database/sql-dialect.d.ts +4 -1
- package/dist/types/store-sql/entity/entity-repository.d.ts +2 -2
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +13 -13
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
- package/dist/types/store-sql/execution/execution-repository.d.ts +8 -8
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +5 -5
- package/dist/types/store-sql/inbox/inbox-repository.d.ts +1 -1
- package/dist/types/store-sql/memory/memory-repository.d.ts +3 -3
- package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
- package/dist/types/store-sql/presence/presence-repository.d.ts +2 -2
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +9 -9
- package/dist/types/store-sql/schema/relay-schema.d.ts +257 -257
- package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
- package/dist/types/store-sql/session/session-repository.d.ts +5 -5
- package/dist/types/store-sql/skill/skill-definition-repository.d.ts +9 -9
- package/dist/types/store-sql/state/execution-state-repository.d.ts +2 -2
- package/dist/types/store-sql/steering/steering-repository.d.ts +5 -5
- package/dist/types/store-sql/tenant/tenant-id.d.ts +2 -2
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +19 -16
- package/dist/types/store-sql/topic/topic-repository.d.ts +1 -1
- package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +16 -14
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +11 -11
- package/package.json +3 -3
|
@@ -22,14 +22,14 @@ export interface Interface {
|
|
|
22
22
|
readonly save: (input: SaveInput) => Effect.Effect<ContextEpochRecord, ContextEpochRepositoryError>;
|
|
23
23
|
readonly get: (executionId: Ids.ExecutionId) => Effect.Effect<ContextEpochRecord | undefined, ContextEpochRepositoryError>;
|
|
24
24
|
}
|
|
25
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
25
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/session/context-epoch-repository/Service", Interface>;
|
|
26
26
|
export declare class Service extends Service_base {
|
|
27
27
|
}
|
|
28
28
|
export declare const ContextEpochRow: Schema.Struct<{
|
|
29
29
|
readonly execution_id: Schema.String;
|
|
30
30
|
readonly baseline: Schema.String;
|
|
31
31
|
readonly dynamic_source_ids_json: Schema.Unknown;
|
|
32
|
-
readonly opened_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
32
|
+
readonly opened_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
33
33
|
}>;
|
|
34
34
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
35
35
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
@@ -195,7 +195,7 @@ export interface Interface {
|
|
|
195
195
|
readonly setLeaf: (input: SetLeafInput) => Effect.Effect<void, SessionRepositoryError>;
|
|
196
196
|
readonly leaf: (sessionId: Ids.SessionId) => Effect.Effect<Ids.SessionEntryId | null, SessionRepositoryError>;
|
|
197
197
|
}
|
|
198
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
198
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/session/session-repository/Service", Interface>;
|
|
199
199
|
export declare class Service extends Service_base {
|
|
200
200
|
}
|
|
201
201
|
export declare const SessionRow: Schema.Struct<{
|
|
@@ -203,8 +203,8 @@ export declare const SessionRow: Schema.Struct<{
|
|
|
203
203
|
readonly root_address_id: Schema.String;
|
|
204
204
|
readonly leaf_entry_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
205
205
|
readonly metadata_json: Schema.Unknown;
|
|
206
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
207
|
-
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
206
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
207
|
+
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
208
208
|
}>;
|
|
209
209
|
export declare const SessionEntryRow: Schema.Struct<{
|
|
210
210
|
readonly id: Schema.String;
|
|
@@ -212,13 +212,13 @@ export declare const SessionEntryRow: Schema.Struct<{
|
|
|
212
212
|
readonly parent_id: Schema.Union<readonly [Schema.String, Schema.Null, Schema.Undefined]>;
|
|
213
213
|
readonly tag: Schema.String;
|
|
214
214
|
readonly payload_json: Schema.Unknown;
|
|
215
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
215
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
216
216
|
}>;
|
|
217
217
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
218
218
|
export declare const layerFromTenant: Layer.Layer<Service, never, SqlClient>;
|
|
219
219
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
220
220
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
221
|
-
export declare const create: (input: CreateSessionInput) => Effect.Effect<SessionRecord,
|
|
221
|
+
export declare const create: (input: CreateSessionInput) => Effect.Effect<SessionRecord, DuplicateSession | SessionRepositoryError, Service>;
|
|
222
222
|
export declare const ensure: (input: EnsureSessionInput) => Effect.Effect<SessionRecord, SessionRepositoryError, Service>;
|
|
223
223
|
export declare const get: (id: string & import("effect/Brand").Brand<"Relay.SessionId">) => Effect.Effect<SessionRecord | undefined, SessionRepositoryError, Service>;
|
|
224
224
|
export declare const list: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, SessionRepositoryError, Service>;
|
|
@@ -48,34 +48,34 @@ export interface Interface {
|
|
|
48
48
|
readonly put: (input: PutSkillDefinitionInput) => Effect.Effect<SkillDefinitionRecord, SkillDefinitionRepositoryError>;
|
|
49
49
|
readonly get: (id: Ids.SkillDefinitionId) => Effect.Effect<SkillDefinitionRecord | undefined, SkillDefinitionRepositoryError>;
|
|
50
50
|
readonly getRevision: (input: GetSkillDefinitionRevisionInput) => Effect.Effect<SkillDefinitionRevisionRecord | undefined, SkillDefinitionRepositoryError>;
|
|
51
|
-
readonly list: () => Effect.Effect<ReadonlyArray<SkillDefinitionRecord>, SkillDefinitionRepositoryError>;
|
|
51
|
+
readonly list: (_?: never) => Effect.Effect<ReadonlyArray<SkillDefinitionRecord>, SkillDefinitionRepositoryError>;
|
|
52
52
|
readonly listRevisions: (id: Ids.SkillDefinitionId) => Effect.Effect<ReadonlyArray<SkillDefinitionRevisionRecord>, SkillDefinitionRepositoryError>;
|
|
53
53
|
readonly pinExecution: (input: PinExecutionSkillsInput) => Effect.Effect<ReadonlyArray<ExecutionSkillPinRecord>, SkillDefinitionRepositoryError>;
|
|
54
54
|
readonly listPins: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<ExecutionSkillPinRecord>, SkillDefinitionRepositoryError>;
|
|
55
55
|
readonly getPinned: (input: GetPinnedSkillInput) => Effect.Effect<ExecutionSkillPinRecord | undefined, SkillDefinitionRepositoryError>;
|
|
56
56
|
}
|
|
57
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
57
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/skill/skill-definition-repository/Service", Interface>;
|
|
58
58
|
export declare class Service extends Service_base {
|
|
59
59
|
}
|
|
60
60
|
export declare const SkillDefinitionRow: Schema.Struct<{
|
|
61
61
|
readonly id: Schema.String;
|
|
62
|
-
readonly current_revision: Schema.
|
|
62
|
+
readonly current_revision: Schema.Finite;
|
|
63
63
|
readonly definition_json: Schema.Unknown;
|
|
64
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
65
|
-
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
64
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
65
|
+
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
66
66
|
}>;
|
|
67
67
|
export declare const SkillDefinitionRevisionRow: Schema.Struct<{
|
|
68
68
|
readonly skill_definition_id: Schema.String;
|
|
69
|
-
readonly revision: Schema.
|
|
69
|
+
readonly revision: Schema.Finite;
|
|
70
70
|
readonly definition_json: Schema.Unknown;
|
|
71
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
71
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
72
72
|
}>;
|
|
73
73
|
export declare const ExecutionSkillPinRow: Schema.Struct<{
|
|
74
74
|
readonly execution_id: Schema.String;
|
|
75
75
|
readonly skill_definition_id: Schema.String;
|
|
76
|
-
readonly skill_definition_revision: Schema.
|
|
76
|
+
readonly skill_definition_revision: Schema.Finite;
|
|
77
77
|
readonly skill_definition_snapshot_json: Schema.Unknown;
|
|
78
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
78
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
79
79
|
}>;
|
|
80
80
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
81
81
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
@@ -71,10 +71,10 @@ export interface Interface {
|
|
|
71
71
|
readonly remove: (input: RemoveInput) => Effect.Effect<State.StateRecordView | undefined, StateVersionConflict | StateIdempotencyConflict | ExecutionStateExecutionNotFound | ExecutionStateRepositoryError>;
|
|
72
72
|
readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<State.StateRecordView>, ExecutionStateRepositoryError>;
|
|
73
73
|
}
|
|
74
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
74
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/state/execution-state-repository/Service", Interface>;
|
|
75
75
|
export declare class Service extends Service_base {
|
|
76
76
|
}
|
|
77
77
|
export declare const memoryLayer: Layer.Layer<Service, never, ExecutionEventRepositoryService | ExecutionRepositoryService>;
|
|
78
|
-
export declare const layer: Layer.Layer<Service, never,
|
|
78
|
+
export declare const layer: Layer.Layer<Service, never, ExecutionEventRepositoryService | SqlClient>;
|
|
79
79
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
80
80
|
export {};
|
|
@@ -47,24 +47,24 @@ export interface Interface {
|
|
|
47
47
|
readonly appendForRunning: (input: AppendInput) => Effect.Effect<SteeringMessageRecord, SteeringRepositoryError>;
|
|
48
48
|
readonly drainUnconsumed: (input: DrainInput) => Effect.Effect<DrainResult, SteeringRepositoryError>;
|
|
49
49
|
}
|
|
50
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
50
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/steering/steering-repository/Service", Interface>;
|
|
51
51
|
export declare class Service extends Service_base {
|
|
52
52
|
}
|
|
53
53
|
export declare const SteeringMessageRow: Schema.Struct<{
|
|
54
54
|
readonly execution_id: Schema.String;
|
|
55
55
|
readonly kind: Schema.Literals<readonly ["steering", "follow_up"]>;
|
|
56
|
-
readonly sequence: Schema.Union<readonly [Schema.
|
|
56
|
+
readonly sequence: Schema.Union<readonly [Schema.Finite, Schema.String]>;
|
|
57
57
|
readonly content_json: Schema.Unknown;
|
|
58
58
|
readonly drain_id: Schema.NullishOr<Schema.String>;
|
|
59
|
-
readonly consumed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
60
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
59
|
+
readonly consumed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
60
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
61
61
|
}>;
|
|
62
62
|
export declare const SteeringDrainRow: Schema.Struct<{
|
|
63
63
|
readonly execution_id: Schema.String;
|
|
64
64
|
readonly kind: Schema.Literals<readonly ["steering", "follow_up"]>;
|
|
65
65
|
readonly drain_id: Schema.String;
|
|
66
66
|
readonly message_sequences_json: Schema.Unknown;
|
|
67
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
67
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
68
68
|
}>;
|
|
69
69
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
70
70
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
@@ -3,13 +3,13 @@ import { Context, Effect, Layer } from "effect";
|
|
|
3
3
|
export interface Interface {
|
|
4
4
|
readonly tenantId: Ids.TenantId;
|
|
5
5
|
}
|
|
6
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
6
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/tenant/tenant-id/Service", Interface>;
|
|
7
7
|
export declare class Service extends Service_base {
|
|
8
8
|
}
|
|
9
9
|
export declare const make: (tenantId: Ids.TenantId) => Interface;
|
|
10
10
|
export declare const layer: (tenantId: Ids.TenantId) => Layer.Layer<Service, never, never>;
|
|
11
11
|
export declare const systemLayer: Layer.Layer<Service, never, never>;
|
|
12
12
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
13
|
-
export declare const testLayer:
|
|
13
|
+
export declare const testLayer: typeof layer;
|
|
14
14
|
export declare const current: () => Effect.Effect<string & import("effect/Brand").Brand<"Relay.TenantId">, never, never>;
|
|
15
15
|
export {};
|
|
@@ -155,7 +155,10 @@ export interface FailOpenForExecutionInput {
|
|
|
155
155
|
readonly failedAt: number;
|
|
156
156
|
}
|
|
157
157
|
export type ToolCallStateError = ToolCallNotFound | ToolCallConflict | ToolCallTransitionRejected | ToolOutcomeConflict | ToolClaimRejected | ToolCallRepositoryError;
|
|
158
|
-
export declare const toolCallIdempotencyKey:
|
|
158
|
+
export declare const toolCallIdempotencyKey: {
|
|
159
|
+
(executionId: Ids.ExecutionId, callId: Ids.ToolCallId): (tenantId: Ids.TenantId) => string;
|
|
160
|
+
(tenantId: Ids.TenantId, executionId: Ids.ExecutionId, callId: Ids.ToolCallId): string;
|
|
161
|
+
};
|
|
159
162
|
export interface RecordResultInput {
|
|
160
163
|
readonly result: Tool.Result;
|
|
161
164
|
readonly createdAt: number;
|
|
@@ -176,7 +179,7 @@ export interface Interface {
|
|
|
176
179
|
readonly listAttempts: (callId: Ids.ToolCallId) => Effect.Effect<ReadonlyArray<ToolAttemptRecord>, ToolCallRepositoryError>;
|
|
177
180
|
readonly failOpenForExecution: (input: FailOpenForExecutionInput) => Effect.Effect<ReadonlyArray<ToolCallRecord>, ToolCallNotFound | ToolCallRepositoryError>;
|
|
178
181
|
}
|
|
179
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
182
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/tool/tool-call-repository/Service", Interface>;
|
|
180
183
|
export declare class Service extends Service_base {
|
|
181
184
|
}
|
|
182
185
|
export declare const ToolCallRow: Schema.Struct<{
|
|
@@ -190,43 +193,43 @@ export declare const ToolCallRow: Schema.Struct<{
|
|
|
190
193
|
readonly state: Schema.String;
|
|
191
194
|
readonly wait_id: Schema.NullishOr<Schema.String>;
|
|
192
195
|
readonly idempotency_key: Schema.String;
|
|
193
|
-
readonly available_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
196
|
+
readonly available_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
194
197
|
readonly active_attempt_id: Schema.NullishOr<Schema.String>;
|
|
195
198
|
readonly claim_owner: Schema.NullishOr<Schema.String>;
|
|
196
|
-
readonly claimed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
197
|
-
readonly claim_expires_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
199
|
+
readonly claimed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
200
|
+
readonly claim_expires_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
198
201
|
readonly external_outcome_json: Schema.NullishOr<Schema.Unknown>;
|
|
199
|
-
readonly external_outcome_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
202
|
+
readonly external_outcome_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
200
203
|
readonly metadata_json: Schema.Unknown;
|
|
201
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
202
|
-
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
204
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
205
|
+
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
203
206
|
}>;
|
|
204
207
|
export declare const ToolAttemptRow: Schema.Struct<{
|
|
205
208
|
readonly id: Schema.String;
|
|
206
209
|
readonly tool_call_id: Schema.String;
|
|
207
|
-
readonly attempt_number: Schema.Union<readonly [Schema.
|
|
210
|
+
readonly attempt_number: Schema.Union<readonly [Schema.Finite, Schema.String, Schema.BigInt]>;
|
|
208
211
|
readonly state: Schema.String;
|
|
209
212
|
readonly worker_id: Schema.NullishOr<Schema.String>;
|
|
210
|
-
readonly claim_expires_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
213
|
+
readonly claim_expires_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
211
214
|
readonly error: Schema.NullishOr<Schema.String>;
|
|
212
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
213
|
-
readonly completed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
215
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
216
|
+
readonly completed_at: Schema.NullishOr<Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>>;
|
|
214
217
|
}>;
|
|
215
218
|
export declare const ToolResultRow: Schema.Struct<{
|
|
216
219
|
readonly tool_call_id: Schema.String;
|
|
217
220
|
readonly output_json: Schema.Unknown;
|
|
218
221
|
readonly error: Schema.NullishOr<Schema.String>;
|
|
219
222
|
readonly metadata_json: Schema.Unknown;
|
|
220
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
223
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
221
224
|
}>;
|
|
222
225
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
223
226
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
224
227
|
type TestInterface = Pick<Interface, "recordCall" | "getCall" | "listCalls" | "recordResult" | "getResult"> & Partial<Interface>;
|
|
225
228
|
export declare const testLayer: (implementation: TestInterface) => Layer.Layer<Service, never, never>;
|
|
226
|
-
export declare const recordCall: (input: RecordCallInput) => Effect.Effect<ToolCallRecord,
|
|
229
|
+
export declare const recordCall: (input: RecordCallInput) => Effect.Effect<ToolCallRecord, DuplicateToolCall | ToolCallRepositoryError, Service>;
|
|
227
230
|
export declare const getCall: (id: string & import("effect/Brand").Brand<"Relay.ToolCallId">) => Effect.Effect<ToolCallRecord | undefined, ToolCallRepositoryError, Service>;
|
|
228
231
|
export declare const listCalls: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<readonly ToolCallRecord[], ToolCallRepositoryError, Service>;
|
|
229
|
-
export declare const recordResult: (input: RecordResultInput) => Effect.Effect<ToolResultRecord,
|
|
232
|
+
export declare const recordResult: (input: RecordResultInput) => Effect.Effect<ToolResultRecord, DuplicateToolResult | ToolCallNotFound | ToolCallRepositoryError, Service>;
|
|
230
233
|
export declare const getResult: (callId: string & import("effect/Brand").Brand<"Relay.ToolCallId">) => Effect.Effect<ToolResultRecord | undefined, ToolCallRepositoryError, Service>;
|
|
231
234
|
export declare const ensureCall: (input: EnsureCallInput) => Effect.Effect<ToolCallRecord, ToolCallStateError, Service>;
|
|
232
235
|
export declare const prepareExternalWait: (input: PrepareExternalWaitInput) => Effect.Effect<ToolCallRecord, ToolCallStateError, Service>;
|
|
@@ -236,5 +239,5 @@ export declare const claimRemote: (input: ClaimRemoteInput) => Effect.Effect<Too
|
|
|
236
239
|
export declare const releaseRemote: (input: ReleaseRemoteInput) => Effect.Effect<ToolCallRecord, ToolCallStateError, Service>;
|
|
237
240
|
export declare const acceptRemoteOutcome: (input: AcceptRemoteOutcomeInput) => Effect.Effect<AcceptedOutcome, ToolCallStateError, Service>;
|
|
238
241
|
export declare const listAttempts: (callId: string & import("effect/Brand").Brand<"Relay.ToolCallId">) => Effect.Effect<readonly ToolAttemptRecord[], ToolCallRepositoryError, Service>;
|
|
239
|
-
export declare const failOpenForExecution: (input: FailOpenForExecutionInput) => Effect.Effect<readonly ToolCallRecord[],
|
|
242
|
+
export declare const failOpenForExecution: (input: FailOpenForExecutionInput) => Effect.Effect<readonly ToolCallRecord[], ToolCallNotFound | ToolCallRepositoryError, Service>;
|
|
240
243
|
export {};
|
|
@@ -32,7 +32,7 @@ export interface Interface {
|
|
|
32
32
|
readonly remove: (input: RemoveInput) => Effect.Effect<void, TopicRepositoryError>;
|
|
33
33
|
readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<Subscription>, TopicRepositoryError>;
|
|
34
34
|
}
|
|
35
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
35
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/topic/topic-repository/Service", Interface>;
|
|
36
36
|
export declare class Service extends Service_base {
|
|
37
37
|
}
|
|
38
38
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { Ids, Workflow } from "../../schema/index";
|
|
2
2
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
3
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
4
|
+
import { SqlError } from "effect/unstable/sql/SqlError";
|
|
4
5
|
declare const RepositoryError_base: Schema.Class<RepositoryError, Schema.TaggedStruct<"WorkflowDefinitionRepositoryError", {
|
|
5
6
|
readonly message: Schema.String;
|
|
6
7
|
}>, import("effect/Cause").YieldableError>;
|
|
7
8
|
export declare class RepositoryError extends RepositoryError_base {
|
|
8
9
|
}
|
|
10
|
+
type RepositoryFailure = RepositoryError | SqlError;
|
|
9
11
|
export interface Interface {
|
|
10
|
-
readonly register: (input: Workflow.RegisterDefinitionPayload) => Effect.Effect<Workflow.DefinitionRevisionRecord,
|
|
11
|
-
readonly get: (id: Ids.WorkflowDefinitionId, revision?: Workflow.DefinitionRevision) => Effect.Effect<Workflow.DefinitionRevisionRecord | undefined,
|
|
12
|
-
readonly list: (id: Ids.WorkflowDefinitionId) => Effect.Effect<ReadonlyArray<Workflow.DefinitionRevisionRecord>,
|
|
13
|
-
readonly start: (input: Workflow.StartRunPayload) => Effect.Effect<Workflow.RunRecord,
|
|
14
|
-
readonly inspect: (id: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined,
|
|
15
|
-
readonly listNonterminal: () => Effect.Effect<ReadonlyArray<Workflow.RunRecord>,
|
|
16
|
-
readonly cancel: (id: Ids.ExecutionId) => Effect.Effect<TransitionResult,
|
|
17
|
-
readonly getOperation: (executionId: Ids.ExecutionId, operationId: Ids.WorkflowOperationId) => Effect.Effect<Workflow.OperationState | undefined,
|
|
18
|
-
readonly putOperation: (state: Workflow.OperationState) => Effect.Effect<Workflow.OperationState,
|
|
19
|
-
readonly listOperations: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.OperationState>,
|
|
20
|
-
readonly appendLifecycle: (event: Omit<Workflow.LifecycleEvent, "sequence">) => Effect.Effect<Workflow.LifecycleEvent,
|
|
21
|
-
readonly listLifecycle: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.LifecycleEvent>,
|
|
22
|
-
readonly finish: (id: Ids.ExecutionId, status: "completed" | "failed", data?: Workflow.LifecycleEvent["data"]) => Effect.Effect<TransitionResult,
|
|
12
|
+
readonly register: (input: Workflow.RegisterDefinitionPayload) => Effect.Effect<Workflow.DefinitionRevisionRecord, RepositoryFailure>;
|
|
13
|
+
readonly get: (id: Ids.WorkflowDefinitionId, revision?: Workflow.DefinitionRevision) => Effect.Effect<Workflow.DefinitionRevisionRecord | undefined, RepositoryFailure>;
|
|
14
|
+
readonly list: (id: Ids.WorkflowDefinitionId) => Effect.Effect<ReadonlyArray<Workflow.DefinitionRevisionRecord>, RepositoryFailure>;
|
|
15
|
+
readonly start: (input: Workflow.StartRunPayload) => Effect.Effect<Workflow.RunRecord, RepositoryFailure>;
|
|
16
|
+
readonly inspect: (id: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined, RepositoryFailure>;
|
|
17
|
+
readonly listNonterminal: (_?: never) => Effect.Effect<ReadonlyArray<Workflow.RunRecord>, RepositoryFailure>;
|
|
18
|
+
readonly cancel: (id: Ids.ExecutionId) => Effect.Effect<TransitionResult, RepositoryFailure>;
|
|
19
|
+
readonly getOperation: (executionId: Ids.ExecutionId, operationId: Ids.WorkflowOperationId) => Effect.Effect<Workflow.OperationState | undefined, RepositoryFailure>;
|
|
20
|
+
readonly putOperation: (state: Workflow.OperationState) => Effect.Effect<Workflow.OperationState, RepositoryFailure>;
|
|
21
|
+
readonly listOperations: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.OperationState>, RepositoryFailure>;
|
|
22
|
+
readonly appendLifecycle: (event: Omit<Workflow.LifecycleEvent, "sequence">) => Effect.Effect<Workflow.LifecycleEvent, RepositoryFailure>;
|
|
23
|
+
readonly listLifecycle: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.LifecycleEvent>, RepositoryFailure>;
|
|
24
|
+
readonly finish: (id: Ids.ExecutionId, status: "completed" | "failed", data?: Workflow.LifecycleEvent["data"]) => Effect.Effect<TransitionResult, RepositoryFailure>;
|
|
23
25
|
}
|
|
24
26
|
export interface TransitionResult {
|
|
25
27
|
readonly transitioned: boolean;
|
|
26
28
|
readonly record: Workflow.RunRecord | undefined;
|
|
27
29
|
}
|
|
28
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
30
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/workflow/workflow-definition-repository/Service", Interface>;
|
|
29
31
|
export declare class Service extends Service_base {
|
|
30
32
|
}
|
|
31
33
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
@@ -70,7 +70,7 @@ export interface Interface {
|
|
|
70
70
|
readonly markReleased: (input: MarkTerminalInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
71
71
|
readonly markFailed: (input: MarkTerminalInput) => Effect.Effect<WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError>;
|
|
72
72
|
}
|
|
73
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/
|
|
73
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/workspace/workspace-lease-repository/Service", Interface>;
|
|
74
74
|
export declare class Service extends Service_base {
|
|
75
75
|
}
|
|
76
76
|
export declare const WorkspaceLeaseRow: Schema.Struct<{
|
|
@@ -84,8 +84,8 @@ export declare const WorkspaceLeaseRow: Schema.Struct<{
|
|
|
84
84
|
readonly region: Schema.NullishOr<Schema.String>;
|
|
85
85
|
readonly request_json: Schema.NullishOr<Schema.Unknown>;
|
|
86
86
|
readonly metadata_json: Schema.Unknown;
|
|
87
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
88
|
-
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
87
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
88
|
+
readonly updated_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
89
89
|
}>;
|
|
90
90
|
export declare const WorkspaceSnapshotRow: Schema.Struct<{
|
|
91
91
|
readonly id: Schema.String;
|
|
@@ -94,17 +94,17 @@ export declare const WorkspaceSnapshotRow: Schema.Struct<{
|
|
|
94
94
|
readonly reason: Schema.String;
|
|
95
95
|
readonly snapshot_ref: Schema.String;
|
|
96
96
|
readonly metadata_json: Schema.Unknown;
|
|
97
|
-
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.
|
|
97
|
+
readonly created_at: Schema.Union<readonly [Schema.Date, Schema.String, Schema.Finite]>;
|
|
98
98
|
}>;
|
|
99
99
|
export declare const layer: Layer.Layer<Service, never, SqlClient>;
|
|
100
100
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
101
101
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
102
|
-
export declare const plan: (input: PlanInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
102
|
+
export declare const plan: (input: PlanInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, DuplicateWorkspaceLease | WorkspaceLeaseRepositoryError, Service>;
|
|
103
103
|
export declare const getByExecution: (id: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Workspace.WorkspaceLeaseRecord | undefined, WorkspaceLeaseRepositoryError, Service>;
|
|
104
|
-
export declare const markRunning: (input: MarkRunningInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
105
|
-
export declare const markSuspended: (input: MarkSuspendedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
106
|
-
export declare const markResumed: (input: MarkResumedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
107
|
-
export declare const recordSnapshot: (input: RecordSnapshotInput) => Effect.Effect<Workspace.WorkspaceSnapshotRecord,
|
|
108
|
-
export declare const markReleased: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
109
|
-
export declare const markFailed: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord,
|
|
104
|
+
export declare const markRunning: (input: MarkRunningInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
105
|
+
export declare const markSuspended: (input: MarkSuspendedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
106
|
+
export declare const markResumed: (input: MarkResumedInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
107
|
+
export declare const recordSnapshot: (input: RecordSnapshotInput) => Effect.Effect<Workspace.WorkspaceSnapshotRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
108
|
+
export declare const markReleased: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
109
|
+
export declare const markFailed: (input: MarkTerminalInput) => Effect.Effect<Workspace.WorkspaceLeaseRecord, WorkspaceLeaseNotFound | WorkspaceLeaseRepositoryError, Service>;
|
|
110
110
|
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.2.
|
|
4
|
+
"version": "0.2.16",
|
|
5
5
|
"description": "Effect-native durable execution SDK for addressable agents and tools",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"typecheck": "bun tsc --noEmit"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@batonfx/core": "0.4.
|
|
58
|
-
"@batonfx/providers": "0.4.
|
|
57
|
+
"@batonfx/core": "0.4.4",
|
|
58
|
+
"@batonfx/providers": "0.4.4",
|
|
59
59
|
"@effect/ai-anthropic": "4.0.0-beta.93",
|
|
60
60
|
"@effect/ai-openai": "4.0.0-beta.93",
|
|
61
61
|
"@effect/ai-openai-compat": "4.0.0-beta.93",
|