@relayfx/test 0.2.14 → 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/index.js +1789 -1494
- package/dist/types/runtime/address/address-book-service.d.ts +3 -3
- package/dist/types/runtime/address/address-resolution-service.d.ts +60 -38
- 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-compaction.d.ts +3 -2
- 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 +12 -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 +20 -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 +143 -104
- 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 +388 -228
- package/dist/types/schema/child-orchestration-schema.d.ts +78 -57
- package/dist/types/schema/execution-schema.d.ts +118 -54
- package/dist/types/schema/workflow-schema.d.ts +243 -243
- package/dist/types/schema/workspace-schema.d.ts +1 -1
- package/dist/types/test/captured-model.d.ts +10 -4
- package/dist/types/test/scripted-model.d.ts +16 -6
- package/dist/types/test/wait-test-kit.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schedule } from "../../schema/index";
|
|
2
2
|
import { ExecutionRepository, ScheduleRepository } from "@relayfx/store-sql/portable";
|
|
3
|
-
import { Config, Context, Cron, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import { Config, Context, Cron, Effect, Layer, Option, Schema } from "effect";
|
|
4
4
|
import { Service as EventLogService } from "../execution/event-log-service";
|
|
5
5
|
import { Service as WaitServiceService } from "../wait/wait-service";
|
|
6
6
|
declare const SchedulerError_base: Schema.Class<SchedulerError, Schema.TaggedStruct<"SchedulerError", {
|
|
@@ -17,13 +17,13 @@ export declare class ScheduleCronInvalid extends ScheduleCronInvalid_base {
|
|
|
17
17
|
export interface Interface {
|
|
18
18
|
readonly runOnce: Effect.Effect<number, SchedulerError>;
|
|
19
19
|
}
|
|
20
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
20
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/schedule/scheduler-service/Service", Interface>;
|
|
21
21
|
export declare class Service extends Service_base {
|
|
22
22
|
}
|
|
23
23
|
export declare const pollIntervalMillisConfig: Config.Config<number>;
|
|
24
24
|
export declare const claimTtlMillisConfig: Config.Config<number>;
|
|
25
25
|
export declare const enabledConfig: Config.Config<boolean>;
|
|
26
|
-
export declare const workerIdConfig: Config.Config<string
|
|
26
|
+
export declare const workerIdConfig: Config.Config<Option.Option<string>>;
|
|
27
27
|
export declare const parseCron: (cronExpr: string) => Effect.Effect<Cron.Cron, ScheduleCronInvalid>;
|
|
28
28
|
export declare const startIdempotencyKey: (schedule: Schedule.ScheduleRecord) => string;
|
|
29
29
|
export declare const make: Effect.Effect<Interface, Config.ConfigError, ExecutionRepository.Service | ScheduleRepository.Service | EventLogService | WaitServiceService | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
@@ -15,11 +15,11 @@ export interface Interface {
|
|
|
15
15
|
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
16
16
|
readonly resolve: (ref: string) => Effect.Effect<Registration, SchemaRefNotRegistered>;
|
|
17
17
|
}
|
|
18
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
18
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/schema-registry/schema-registry-service/Service", Interface>;
|
|
19
19
|
export declare class Service extends Service_base {
|
|
20
20
|
}
|
|
21
21
|
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service, never, never>;
|
|
22
|
-
export declare const memoryLayer:
|
|
22
|
+
export declare const memoryLayer: typeof layer;
|
|
23
23
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
24
24
|
export declare const register: (registration: Registration) => Effect.Effect<void, never, Service>;
|
|
25
25
|
export declare const registrations: () => Effect.Effect<readonly Registration[], never, Service>;
|
|
@@ -3,12 +3,21 @@ import { Ids } from "../../schema/index";
|
|
|
3
3
|
import { SessionRepository } from "@relayfx/store-sql/portable";
|
|
4
4
|
import { Context, Effect, Layer } from "effect";
|
|
5
5
|
export type Interface = Session.Interface;
|
|
6
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
6
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/session/session-store-service/Service", Session.Interface>;
|
|
7
7
|
export declare class Service extends Service_base {
|
|
8
8
|
}
|
|
9
9
|
export declare const make: (sessionId: string & import("effect/Brand").Brand<"Relay.SessionId">, entryScope?: string | undefined) => Effect.Effect<Session.Interface, never, SessionRepository.Service>;
|
|
10
|
-
export declare const serviceLayer:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export declare const serviceLayer: {
|
|
11
|
+
(sessionId: Ids.SessionId, entryScope?: string): Layer.Layer<Service, never, SessionRepository.Service>;
|
|
12
|
+
(entryScope?: string): (sessionId: Ids.SessionId) => Layer.Layer<Service, never, SessionRepository.Service>;
|
|
13
|
+
};
|
|
14
|
+
export declare const layer: {
|
|
15
|
+
(sessionId: Ids.SessionId, entryScope?: string): Layer.Layer<Session.SessionStore, never, SessionRepository.Service>;
|
|
16
|
+
(entryScope?: string): (sessionId: Ids.SessionId) => Layer.Layer<Session.SessionStore, never, SessionRepository.Service>;
|
|
17
|
+
};
|
|
18
|
+
export declare const memoryLayer: {
|
|
19
|
+
(sessionId: Ids.SessionId, entryScope?: string): Layer.Layer<Session.SessionStore>;
|
|
20
|
+
(entryScope?: string): (sessionId: Ids.SessionId) => Layer.Layer<Session.SessionStore>;
|
|
21
|
+
};
|
|
13
22
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Session.SessionStore, never, never>;
|
|
14
23
|
export {};
|
|
@@ -20,13 +20,13 @@ export interface Interface {
|
|
|
20
20
|
readonly register: (input: Skill.RegisterDefinitionPayload) => Effect.Effect<Skill.DefinitionRegistered, SkillDefinitionInvalid | SkillRegistryError>;
|
|
21
21
|
readonly get: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRecord | undefined, SkillRegistryError>;
|
|
22
22
|
readonly getRevision: (input: SkillDefinitionRepository.GetSkillDefinitionRevisionInput) => Effect.Effect<Skill.DefinitionRevisionRecord | undefined, SkillRegistryError>;
|
|
23
|
-
readonly list:
|
|
23
|
+
readonly list: Effect.Effect<Skill.DefinitionList, SkillRegistryError>;
|
|
24
24
|
readonly listRevisions: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRevisionList, SkillRegistryError>;
|
|
25
25
|
readonly pinExecution: (input: PinExecutionSkillsInput) => Effect.Effect<Skill.ExecutionPinList, SkillRegistryError>;
|
|
26
26
|
readonly listPins: (executionId: Ids.ExecutionId) => Effect.Effect<Skill.ExecutionPinList, SkillRegistryError>;
|
|
27
27
|
readonly getPinned: (input: SkillDefinitionRepository.GetPinnedSkillInput) => Effect.Effect<Skill.ExecutionPinRecord | undefined, SkillRegistryError>;
|
|
28
28
|
}
|
|
29
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
29
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/skill/skill-registry-service/Service", Interface>;
|
|
30
30
|
export declare class Service extends Service_base {
|
|
31
31
|
}
|
|
32
32
|
export declare const layer: Layer.Layer<Service, never, SkillDefinitionRepository.Service>;
|
|
@@ -19,7 +19,10 @@ export interface StateKey<A, I extends Shared.JsonValue> {
|
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly schema: Schema.Codec<A, I>;
|
|
21
21
|
}
|
|
22
|
-
export declare const key:
|
|
22
|
+
export declare const key: {
|
|
23
|
+
<A, I extends Shared.JsonValue>(name: string, schema: Schema.Codec<A, I>): StateKey<A, I>;
|
|
24
|
+
(name: string): <A, I extends Shared.JsonValue>(schema: Schema.Codec<A, I>) => StateKey<A, I>;
|
|
25
|
+
};
|
|
23
26
|
export interface PutInput<A, I extends Shared.JsonValue> {
|
|
24
27
|
readonly executionId: Ids.ExecutionId;
|
|
25
28
|
readonly key: StateKey<A, I>;
|
|
@@ -48,7 +51,7 @@ export interface Interface {
|
|
|
48
51
|
readonly remove: (input: RemoveInput) => Effect.Effect<State.StateRecordView | undefined, ExecutionStateRepository.StateVersionConflict | ExecutionStateError>;
|
|
49
52
|
readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<State.StateRecordView>, ExecutionStateError>;
|
|
50
53
|
}
|
|
51
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
54
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/state/execution-state-service/Service", Interface>;
|
|
52
55
|
export declare class Service extends Service_base {
|
|
53
56
|
}
|
|
54
57
|
export declare const layer: Layer.Layer<Service, never, ExecutionStateRepository.Service | BlobStoreService>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
|
-
import {
|
|
2
|
+
import { ToolCallRepository } from "@relayfx/store-sql/portable";
|
|
3
3
|
import { Tool as AiTool, Toolkit } from "effect/unstable/ai";
|
|
4
4
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
5
|
import { Service as EventLogService } from "../execution/event-log-service";
|
|
@@ -50,7 +50,7 @@ export interface ToolExecutionContext {
|
|
|
50
50
|
}
|
|
51
51
|
export interface ToolCallInfoData extends ToolExecutionContext {
|
|
52
52
|
}
|
|
53
|
-
declare const ToolCallInfo_base: Context.ServiceClass<ToolCallInfo, "@relayfx/runtime/ToolCallInfo", ToolCallInfoData>;
|
|
53
|
+
declare const ToolCallInfo_base: Context.ServiceClass<ToolCallInfo, "@relayfx/runtime/tool/tool-runtime-service/ToolCallInfo", ToolCallInfoData>;
|
|
54
54
|
export declare class ToolCallInfo extends ToolCallInfo_base {
|
|
55
55
|
}
|
|
56
56
|
export interface RegisteredTool {
|
|
@@ -58,10 +58,10 @@ export interface RegisteredTool {
|
|
|
58
58
|
readonly tool: AiTool.Any;
|
|
59
59
|
readonly placement?: Tool.Placement | undefined;
|
|
60
60
|
readonly requiredPermissions?: ReadonlyArray<string>;
|
|
61
|
-
readonly validateInput?: (input: Shared.JsonValue) => Effect.Effect<void, ToolInputInvalid
|
|
62
|
-
readonly run?: ((input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue,
|
|
61
|
+
readonly validateInput?: (input: Shared.JsonValue) => Effect.Effect<void, ToolInputInvalid>;
|
|
62
|
+
readonly run?: ((input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue, ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError>) | undefined;
|
|
63
63
|
}
|
|
64
|
-
export interface ToolOptions<Input extends Schema.
|
|
64
|
+
export interface ToolOptions<Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>> {
|
|
65
65
|
readonly description: string;
|
|
66
66
|
readonly input: Input;
|
|
67
67
|
readonly output: Output;
|
|
@@ -71,7 +71,7 @@ export interface ToolOptions<Input extends Schema.Constraint, Output extends Sch
|
|
|
71
71
|
readonly needsApproval?: boolean | undefined;
|
|
72
72
|
readonly metadata?: Shared.Metadata | undefined;
|
|
73
73
|
readonly placement?: Tool.Placement | undefined;
|
|
74
|
-
readonly run: (input: Input["Type"], context: ToolExecutionContext) => Effect.Effect<Output["Type"],
|
|
74
|
+
readonly run: (input: Input["Type"], context: ToolExecutionContext) => Effect.Effect<Output["Type"], ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, ToolCallInfo>;
|
|
75
75
|
}
|
|
76
76
|
export interface DynamicToolOptions {
|
|
77
77
|
readonly description: string;
|
|
@@ -83,7 +83,7 @@ export interface DynamicToolOptions {
|
|
|
83
83
|
readonly needsApproval?: boolean | undefined;
|
|
84
84
|
readonly metadata?: Shared.Metadata | undefined;
|
|
85
85
|
readonly placement?: Tool.Placement | undefined;
|
|
86
|
-
readonly run: (input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue,
|
|
86
|
+
readonly run: (input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue, ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError>;
|
|
87
87
|
}
|
|
88
88
|
export interface ToolkitToolOptions {
|
|
89
89
|
readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
|
|
@@ -107,15 +107,24 @@ export interface Interface {
|
|
|
107
107
|
readonly register: (tool: RegisteredTool) => Effect.Effect<void>;
|
|
108
108
|
readonly definitions: Effect.Effect<ReadonlyArray<Tool.Definition>>;
|
|
109
109
|
readonly registeredTools: Effect.Effect<ReadonlyArray<RegisteredTool>>;
|
|
110
|
-
readonly run: (input: RunInput) => Effect.Effect<Tool.Result, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError,
|
|
110
|
+
readonly run: (input: RunInput) => Effect.Effect<Tool.Result, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, never>;
|
|
111
111
|
}
|
|
112
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
112
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/tool/tool-runtime-service/Service", Interface>;
|
|
113
113
|
export declare class Service extends Service_base {
|
|
114
114
|
}
|
|
115
115
|
export declare const toolFromRegistered: (tool: RegisteredTool) => AiTool.Any;
|
|
116
|
-
export declare const toolsFromToolkit:
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
export declare const toolsFromToolkit: {
|
|
117
|
+
<Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.WithHandler<Tools>, options?: ToolkitRegistrationOptions): ReadonlyArray<RegisteredTool>;
|
|
118
|
+
(options?: ToolkitRegistrationOptions): <Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.WithHandler<Tools>) => ReadonlyArray<RegisteredTool>;
|
|
119
|
+
};
|
|
120
|
+
export declare const tool: {
|
|
121
|
+
<const Name extends string, Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>>(name: Name, options: ToolOptions<Input, Output>): RegisteredTool;
|
|
122
|
+
<Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>>(options: ToolOptions<Input, Output>): <const Name extends string>(name: Name) => RegisteredTool;
|
|
123
|
+
};
|
|
124
|
+
export declare const dynamicTool: {
|
|
125
|
+
<const Name extends string>(name: Name, options: DynamicToolOptions): RegisteredTool;
|
|
126
|
+
(options: DynamicToolOptions): <const Name extends string>(name: Name) => RegisteredTool;
|
|
127
|
+
};
|
|
119
128
|
export interface PlacedToolOptions {
|
|
120
129
|
readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
|
|
121
130
|
readonly requiredPermissions?: ReadonlyArray<string> | undefined;
|
|
@@ -123,17 +132,31 @@ export interface PlacedToolOptions {
|
|
|
123
132
|
readonly needsApproval?: boolean | undefined;
|
|
124
133
|
readonly metadata?: Shared.Metadata | undefined;
|
|
125
134
|
}
|
|
126
|
-
export declare const clientTool:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
135
|
+
export declare const clientTool: {
|
|
136
|
+
(modelTool: AiTool.Any, options?: PlacedToolOptions): RegisteredTool;
|
|
137
|
+
(options?: PlacedToolOptions): (modelTool: AiTool.Any) => RegisteredTool;
|
|
138
|
+
};
|
|
139
|
+
export declare const remoteTool: {
|
|
140
|
+
(modelTool: AiTool.Any, options: PlacedToolOptions & {
|
|
141
|
+
readonly queue: Tool.PlacementKey;
|
|
142
|
+
}): RegisteredTool;
|
|
143
|
+
(options: PlacedToolOptions & {
|
|
144
|
+
readonly queue: Tool.PlacementKey;
|
|
145
|
+
}): (modelTool: AiTool.Any) => RegisteredTool;
|
|
146
|
+
};
|
|
130
147
|
export declare const layer: (initialTools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, ToolCallRepository.Service | EventLogService | WaitServiceService>;
|
|
131
|
-
export declare const layerFromToolkit:
|
|
148
|
+
export declare const layerFromToolkit: {
|
|
149
|
+
<Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>, options?: ToolkitRegistrationOptions): Layer.Layer<Service, never, ToolCallRepository.Service | EventLogService | WaitServiceService | AiTool.HandlersFor<Tools>>;
|
|
150
|
+
(options?: ToolkitRegistrationOptions): <Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<Service, never, ToolCallRepository.Service | EventLogService | WaitServiceService | AiTool.HandlersFor<Tools>>;
|
|
151
|
+
};
|
|
132
152
|
export declare const memoryLayer: (tools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, never>;
|
|
133
|
-
export declare const memoryLayerFromToolkit:
|
|
153
|
+
export declare const memoryLayerFromToolkit: {
|
|
154
|
+
<Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>, options?: ToolkitRegistrationOptions): Layer.Layer<Service, never, Exclude<AiTool.HandlersFor<Tools>, ToolCallRepository.Service | EventLogService | WaitServiceService>>;
|
|
155
|
+
(options?: ToolkitRegistrationOptions): <Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<Service, never, Exclude<AiTool.HandlersFor<Tools>, ToolCallRepository.Service | EventLogService | WaitServiceService>>;
|
|
156
|
+
};
|
|
134
157
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
135
158
|
export declare const register: (registeredTool: RegisteredTool) => Effect.Effect<void, never, Service>;
|
|
136
159
|
export declare const definitions: () => Effect.Effect<readonly Tool.Definition[], never, Service>;
|
|
137
160
|
export declare const registeredTools: () => Effect.Effect<readonly RegisteredTool[], never, Service>;
|
|
138
|
-
export declare const run: (input: RunInput) => Effect.Effect<Tool.Result,
|
|
161
|
+
export declare const run: (input: RunInput) => Effect.Effect<Tool.Result, ToolExecutionFailed | ToolExecutionWaitRequested | ToolInputInvalid | ToolNotRegistered | ToolPermissionDenied | ToolRuntimeError, Service>;
|
|
139
162
|
export {};
|
|
@@ -4,10 +4,10 @@ import type { SqlError } from "effect/unstable/sql/SqlError";
|
|
|
4
4
|
export interface Interface {
|
|
5
5
|
readonly coordinate: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | SqlError, R>;
|
|
6
6
|
}
|
|
7
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
7
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/tool/tool-transition-coordinator/Service", Interface>;
|
|
8
8
|
export declare class Service extends Service_base {
|
|
9
9
|
}
|
|
10
10
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
11
11
|
export declare const sqlLayer: Layer.Layer<Service, never, SqlClient>;
|
|
12
|
-
export declare const coordinate: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A,
|
|
12
|
+
export declare const coordinate: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | SqlError, R | Service>;
|
|
13
13
|
export {};
|
|
@@ -37,7 +37,7 @@ export interface Interface {
|
|
|
37
37
|
readonly publish: (input: PublishInput) => Effect.Effect<PublishResult, TopicServiceError>;
|
|
38
38
|
readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<TopicRepository.Subscription>, TopicServiceError>;
|
|
39
39
|
}
|
|
40
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
40
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/topic/topic-service/Service", Interface>;
|
|
41
41
|
export declare class Service extends Service_base {
|
|
42
42
|
}
|
|
43
43
|
export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | ExecutionRepository.Service | TopicRepository.Service | InboxServiceService>;
|
|
@@ -66,7 +66,7 @@ export interface Interface {
|
|
|
66
66
|
readonly timeout: (input: TimeoutInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError>;
|
|
67
67
|
readonly cancel: (input: CancelWaitInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError>;
|
|
68
68
|
}
|
|
69
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
69
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/wait/wait-service/Service", Interface>;
|
|
70
70
|
export declare class Service extends Service_base {
|
|
71
71
|
}
|
|
72
72
|
export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | ScheduleRepository.Service | EventLogService>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Ids } from "../../schema/index";
|
|
2
2
|
import { ExecutionRepository } from "@relayfx/store-sql/portable";
|
|
3
|
-
import { Effect } from "effect";
|
|
3
|
+
import { Effect, Schema } from "effect";
|
|
4
|
+
import { ExecutionWorkflowFailed } from "../workflow/execution-workflow";
|
|
4
5
|
import type { SignalWaitInput, WaitSignalState } from "../workflow/execution-workflow";
|
|
5
6
|
export interface ExecutionSignalClient {
|
|
6
|
-
readonly signalWait: (input: SignalWaitInput) => Effect.Effect<void,
|
|
7
|
+
readonly signalWait: (input: SignalWaitInput) => Effect.Effect<void, {
|
|
8
|
+
readonly _tag: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
declare const WaitSignalError_base: Schema.Class<WaitSignalError, Schema.TaggedStruct<"WaitSignalError", {
|
|
12
|
+
readonly message: Schema.String;
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
export declare class WaitSignalError extends WaitSignalError_base {
|
|
7
15
|
}
|
|
8
16
|
export type ExecutionClientFactory = (executionId: Ids.ExecutionId) => ExecutionSignalClient;
|
|
9
17
|
export interface SignalWorkflowWaitInput {
|
|
@@ -13,4 +21,5 @@ export interface SignalWorkflowWaitInput {
|
|
|
13
21
|
readonly state: WaitSignalState;
|
|
14
22
|
readonly signaledAt: number;
|
|
15
23
|
}
|
|
16
|
-
export declare const signalWorkflowWait: (input: SignalWorkflowWaitInput) => Effect.Effect<void,
|
|
24
|
+
export declare const signalWorkflowWait: (input: SignalWorkflowWaitInput) => Effect.Effect<void, WaitSignalError | ExecutionWorkflowFailed, ExecutionRepository.Service>;
|
|
25
|
+
export {};
|
|
@@ -72,9 +72,13 @@ export declare const currentManifest: () => Effect.Effect<{
|
|
|
72
72
|
signature_hash: string;
|
|
73
73
|
}[];
|
|
74
74
|
}, import("effect/PlatformError").PlatformError, Crypto.Crypto>;
|
|
75
|
-
export declare
|
|
76
|
-
breaking: ActivityManifestChange
|
|
77
|
-
additive: ActivityManifestChange
|
|
75
|
+
export declare function diffManifests(baseline: ActivityManifest, current: ActivityManifest): {
|
|
76
|
+
breaking: Array<ActivityManifestChange>;
|
|
77
|
+
additive: Array<ActivityManifestChange>;
|
|
78
|
+
};
|
|
79
|
+
export declare function diffManifests(current: ActivityManifest): (baseline: ActivityManifest) => {
|
|
80
|
+
breaking: Array<ActivityManifestChange>;
|
|
81
|
+
additive: Array<ActivityManifestChange>;
|
|
78
82
|
};
|
|
79
83
|
export declare const evaluateGuard: (input: {
|
|
80
84
|
readonly baseline: ActivityManifest;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChildOrchestration, Ids, Shared, Workflow } from "../../schema/index";
|
|
2
2
|
import { WorkflowDefinitionRepository } from "@relayfx/store-sql/portable";
|
|
3
3
|
import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import { SqlError } from "effect/unstable/sql/SqlError";
|
|
4
5
|
export interface SideEffectContext {
|
|
5
6
|
readonly execution_id: Ids.ExecutionId;
|
|
6
7
|
readonly operation_id: Ids.WorkflowOperationId;
|
|
@@ -28,32 +29,45 @@ declare const PinnedDefinitionMismatch_base: Schema.Class<PinnedDefinitionMismat
|
|
|
28
29
|
}>, Cause.YieldableError>;
|
|
29
30
|
export declare class PinnedDefinitionMismatch extends PinnedDefinitionMismatch_base {
|
|
30
31
|
}
|
|
32
|
+
declare const WorkflowRuntimeError_base: Schema.Class<WorkflowRuntimeError, Schema.TaggedStruct<"WorkflowRuntimeError", {
|
|
33
|
+
readonly message: Schema.String;
|
|
34
|
+
}>, Cause.YieldableError>;
|
|
35
|
+
export declare class WorkflowRuntimeError extends WorkflowRuntimeError_base {
|
|
36
|
+
}
|
|
37
|
+
declare const WorkflowJoinPolicyNotSatisfied_base: Schema.Class<WorkflowJoinPolicyNotSatisfied, Schema.TaggedStruct<"WorkflowJoinPolicyNotSatisfied", {
|
|
38
|
+
readonly policy: Schema.String;
|
|
39
|
+
}>, Cause.YieldableError>;
|
|
40
|
+
export declare class WorkflowJoinPolicyNotSatisfied extends WorkflowJoinPolicyNotSatisfied_base {
|
|
41
|
+
}
|
|
31
42
|
export interface Handlers {
|
|
32
|
-
readonly tool?: (executionId: Ids.ExecutionId, operation: typeof Workflow.ToolOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue,
|
|
33
|
-
readonly child: (executionId: Ids.ExecutionId, operation: typeof Workflow.ChildOperation.Type | typeof Workflow.DispatchableChildOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue,
|
|
34
|
-
readonly approval: (executionId: Ids.ExecutionId, operation: typeof Workflow.ApprovalOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue,
|
|
35
|
-
readonly timer: (executionId: Ids.ExecutionId, operation: typeof Workflow.TimerOperation.Type, context: SideEffectContext) => Effect.Effect<void,
|
|
36
|
-
readonly branch: (executionId: Ids.ExecutionId, operation: typeof Workflow.BranchOperation.Type, context: SideEffectContext) => Effect.Effect<boolean,
|
|
37
|
-
readonly structuredCompletion: (schemaRef: string, value: Shared.JsonValue | undefined, context: SideEffectContext) => Effect.Effect<Shared.JsonValue,
|
|
38
|
-
readonly createChildFanOut?: (definition: ChildOrchestration.FanOutDefinition, context: SideEffectContext) => Effect.Effect<ChildOrchestration.FanOutState,
|
|
39
|
-
readonly admitChildFanOut?: (fanOutId: Ids.ChildFanOutId) => Effect.Effect<void,
|
|
40
|
-
readonly inspectChildFanOut?: (fanOutId: Ids.ChildFanOutId) => Effect.Effect<ChildOrchestration.FanOutState | undefined,
|
|
43
|
+
readonly tool?: (executionId: Ids.ExecutionId, operation: typeof Workflow.ToolOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, WorkflowRuntimeError>;
|
|
44
|
+
readonly child: (executionId: Ids.ExecutionId, operation: typeof Workflow.ChildOperation.Type | typeof Workflow.DispatchableChildOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, WorkflowRuntimeError>;
|
|
45
|
+
readonly approval: (executionId: Ids.ExecutionId, operation: typeof Workflow.ApprovalOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, WorkflowRuntimeError>;
|
|
46
|
+
readonly timer: (executionId: Ids.ExecutionId, operation: typeof Workflow.TimerOperation.Type, context: SideEffectContext) => Effect.Effect<void, WorkflowRuntimeError>;
|
|
47
|
+
readonly branch: (executionId: Ids.ExecutionId, operation: typeof Workflow.BranchOperation.Type, context: SideEffectContext) => Effect.Effect<boolean, WorkflowRuntimeError>;
|
|
48
|
+
readonly structuredCompletion: (schemaRef: string, value: Shared.JsonValue | undefined, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, WorkflowRuntimeError>;
|
|
49
|
+
readonly createChildFanOut?: (definition: ChildOrchestration.FanOutDefinition, context: SideEffectContext) => Effect.Effect<ChildOrchestration.FanOutState, WorkflowRuntimeError>;
|
|
50
|
+
readonly admitChildFanOut?: (fanOutId: Ids.ChildFanOutId) => Effect.Effect<void, WorkflowRuntimeError>;
|
|
51
|
+
readonly inspectChildFanOut?: (fanOutId: Ids.ChildFanOutId) => Effect.Effect<ChildOrchestration.FanOutState | undefined, WorkflowRuntimeError>;
|
|
41
52
|
}
|
|
42
|
-
declare const HandlerService_base: Context.ServiceClass<HandlerService, "@relayfx/runtime/
|
|
53
|
+
declare const HandlerService_base: Context.ServiceClass<HandlerService, "@relayfx/runtime/workflow/definition-runtime/HandlerService", Handlers>;
|
|
43
54
|
export declare class HandlerService extends HandlerService_base {
|
|
44
55
|
}
|
|
45
56
|
export interface Interface {
|
|
46
|
-
readonly start: (input: Workflow.StartRunPayload) => Effect.Effect<Workflow.RunRecord,
|
|
47
|
-
readonly run: (executionId: Ids.ExecutionId) => Effect.Effect<Shared.JsonValue | undefined,
|
|
48
|
-
readonly recover:
|
|
49
|
-
readonly inspect: (executionId: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined,
|
|
50
|
-
readonly replay: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.LifecycleEvent>,
|
|
51
|
-
readonly cancel: (executionId: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined,
|
|
57
|
+
readonly start: (input: Workflow.StartRunPayload) => Effect.Effect<Workflow.RunRecord, WorkflowDefinitionRepository.RepositoryError | SqlError>;
|
|
58
|
+
readonly run: (executionId: Ids.ExecutionId) => Effect.Effect<Shared.JsonValue | undefined, WorkflowExecutionError>;
|
|
59
|
+
readonly recover: Effect.Effect<ReadonlyArray<Ids.ExecutionId>, WorkflowRuntimeError>;
|
|
60
|
+
readonly inspect: (executionId: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined, WorkflowDefinitionRepository.RepositoryError | SqlError>;
|
|
61
|
+
readonly replay: (executionId: Ids.ExecutionId) => Effect.Effect<ReadonlyArray<Workflow.LifecycleEvent>, WorkflowDefinitionRepository.RepositoryError | SqlError>;
|
|
62
|
+
readonly cancel: (executionId: Ids.ExecutionId) => Effect.Effect<Workflow.RunRecord | undefined, WorkflowDefinitionRepository.RepositoryError | SqlError>;
|
|
52
63
|
}
|
|
53
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/
|
|
64
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/workflow/definition-runtime/Service", Interface>;
|
|
54
65
|
export declare class Service extends Service_base {
|
|
55
66
|
}
|
|
56
|
-
export declare const fanOutIdFor:
|
|
67
|
+
export declare const fanOutIdFor: {
|
|
68
|
+
(fanOutKey: string): (executionId: Ids.ExecutionId) => Ids.ChildFanOutId;
|
|
69
|
+
(executionId: Ids.ExecutionId, fanOutKey: string): Ids.ChildFanOutId;
|
|
70
|
+
};
|
|
57
71
|
declare const WorkflowCancelled_base: Schema.Class<WorkflowCancelled, Schema.TaggedStruct<"WorkflowCancelled", {}>, Cause.YieldableError>;
|
|
58
72
|
export declare class WorkflowCancelled extends WorkflowCancelled_base {
|
|
59
73
|
}
|
|
@@ -71,10 +85,11 @@ declare const WorkflowJoining_base: Schema.Class<WorkflowJoining, Schema.TaggedS
|
|
|
71
85
|
}>, Cause.YieldableError>;
|
|
72
86
|
export declare class WorkflowJoining extends WorkflowJoining_base {
|
|
73
87
|
}
|
|
88
|
+
type WorkflowExecutionError = WorkflowDefinitionRepository.RepositoryError | SqlError | WorkflowRuntimeError | UnsupportedOperation | PinnedDefinitionNotFound | PinnedDefinitionMismatch | WorkflowCancelled | WorkflowBudgetExceeded | WorkflowJoining | WorkflowJoinPolicyNotSatisfied;
|
|
74
89
|
export declare const validate: (definition: Workflow.Definition) => Effect.Effect<void, never, never> | Effect.Effect<never, UnsupportedOperation, never>;
|
|
75
|
-
export declare const run: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Schema.Json | undefined,
|
|
90
|
+
export declare const run: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Schema.Json | undefined, PinnedDefinitionMismatch | PinnedDefinitionNotFound | WorkflowDefinitionRepository.RepositoryError | SqlError | UnsupportedOperation | WorkflowBudgetExceeded | WorkflowCancelled | WorkflowJoinPolicyNotSatisfied | WorkflowJoining | WorkflowRuntimeError, HandlerService | WorkflowDefinitionRepository.Service>;
|
|
76
91
|
export declare const handlersLayer: (handlers: Handlers) => Layer.Layer<HandlerService, never, never>;
|
|
77
|
-
export declare const testHandlersLayer:
|
|
78
|
-
export declare const layerFromRuntime: Layer.Layer<Service,
|
|
79
|
-
export declare const layer: Layer.Layer<Service,
|
|
92
|
+
export declare const testHandlersLayer: typeof handlersLayer;
|
|
93
|
+
export declare const layerFromRuntime: Layer.Layer<Service, WorkflowRuntimeError, HandlerService | WorkflowDefinitionRepository.Service>;
|
|
94
|
+
export declare const layer: Layer.Layer<Service, WorkflowRuntimeError, HandlerService | WorkflowDefinitionRepository.Service>;
|
|
80
95
|
export {};
|