@relayfx/test 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +29 -20481
  3. package/dist/types/test/index.d.ts +0 -2
  4. package/dist/types/test/test-runtime.d.ts +6 -7
  5. package/dist/types/test/test-tools.d.ts +2 -2
  6. package/dist/types/test/wait-test-kit.d.ts +1 -1
  7. package/package.json +7 -6
  8. package/dist/types/runtime/address/address-book-service.d.ts +0 -74
  9. package/dist/types/runtime/address/address-resolution-service.d.ts +0 -172
  10. package/dist/types/runtime/agent/agent-loop-service.d.ts +0 -92
  11. package/dist/types/runtime/agent/agent-registry-service.d.ts +0 -31
  12. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +0 -64
  13. package/dist/types/runtime/agent/relay-approvals.d.ts +0 -2
  14. package/dist/types/runtime/agent/relay-compaction.d.ts +0 -24
  15. package/dist/types/runtime/agent/relay-instructions.d.ts +0 -7
  16. package/dist/types/runtime/agent/relay-permissions.d.ts +0 -25
  17. package/dist/types/runtime/agent/relay-steering.d.ts +0 -17
  18. package/dist/types/runtime/agent/relay-tool-executor.d.ts +0 -22
  19. package/dist/types/runtime/agent/relay-tool-output.d.ts +0 -10
  20. package/dist/types/runtime/agent/sequence-allocator.d.ts +0 -8
  21. package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +0 -30
  22. package/dist/types/runtime/child/child-fan-out-runtime.d.ts +0 -40
  23. package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +0 -25
  24. package/dist/types/runtime/child/child-run-service.d.ts +0 -96
  25. package/dist/types/runtime/child/parent-notifier-service.d.ts +0 -42
  26. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +0 -225
  27. package/dist/types/runtime/cluster/execution-entity.d.ts +0 -39
  28. package/dist/types/runtime/content/artifact-store-service.d.ts +0 -26
  29. package/dist/types/runtime/content/blob-store-service.d.ts +0 -54
  30. package/dist/types/runtime/entity/entity-instance-service.d.ts +0 -76
  31. package/dist/types/runtime/entity/entity-registry-service.d.ts +0 -35
  32. package/dist/types/runtime/envelope/envelope-service.d.ts +0 -56
  33. package/dist/types/runtime/execution/active-execution-registry.d.ts +0 -12
  34. package/dist/types/runtime/execution/event-log-service.d.ts +0 -93
  35. package/dist/types/runtime/execution/execution-service.d.ts +0 -66
  36. package/dist/types/runtime/execution/execution-watch-service.d.ts +0 -32
  37. package/dist/types/runtime/execution/session-stream-service.d.ts +0 -33
  38. package/dist/types/runtime/inbox/inbox-service.d.ts +0 -76
  39. package/dist/types/runtime/inbox/send-message-tool.d.ts +0 -27
  40. package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +0 -34
  41. package/dist/types/runtime/index.d.ts +0 -56
  42. package/dist/types/runtime/memory/memory-service.d.ts +0 -22
  43. package/dist/types/runtime/model/embedding-model-service.d.ts +0 -81
  44. package/dist/types/runtime/model/language-model-service.d.ts +0 -48
  45. package/dist/types/runtime/model/model-call-policy.d.ts +0 -14
  46. package/dist/types/runtime/observability/runtime-metrics.d.ts +0 -28
  47. package/dist/types/runtime/presence/presence-service.d.ts +0 -30
  48. package/dist/types/runtime/presence/presence-tool.d.ts +0 -20
  49. package/dist/types/runtime/runner/runner-runtime-service.d.ts +0 -149
  50. package/dist/types/runtime/schedule/scheduler-service.d.ts +0 -34
  51. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +0 -27
  52. package/dist/types/runtime/session/session-store-service.d.ts +0 -23
  53. package/dist/types/runtime/skill/skill-registry-service.d.ts +0 -44
  54. package/dist/types/runtime/state/execution-state-service.d.ts +0 -60
  55. package/dist/types/runtime/state/state-tools.d.ts +0 -5
  56. package/dist/types/runtime/tool/tool-input-schema-digest.d.ts +0 -6
  57. package/dist/types/runtime/tool/tool-runtime-service.d.ts +0 -162
  58. package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +0 -13
  59. package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +0 -24
  60. package/dist/types/runtime/topic/topic-service.d.ts +0 -50
  61. package/dist/types/runtime/wait/wait-service.d.ts +0 -81
  62. package/dist/types/runtime/wait/wait-signal.d.ts +0 -25
  63. package/dist/types/runtime/workflow/activity-version-registry.d.ts +0 -93
  64. package/dist/types/runtime/workflow/definition-runtime.d.ts +0 -95
  65. package/dist/types/runtime/workflow/execution-workflow.d.ts +0 -534
  66. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +0 -64
  67. package/dist/types/runtime/workspace/workspace-provider-service.d.ts +0 -112
  68. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +0 -21
  69. package/dist/types/schema/address-schema.d.ts +0 -77
  70. package/dist/types/schema/agent-schema.d.ts +0 -901
  71. package/dist/types/schema/child-orchestration-schema.d.ts +0 -429
  72. package/dist/types/schema/content-schema.d.ts +0 -118
  73. package/dist/types/schema/entity-schema.d.ts +0 -40
  74. package/dist/types/schema/envelope-schema.d.ts +0 -180
  75. package/dist/types/schema/execution-schema.d.ts +0 -453
  76. package/dist/types/schema/ids-schema.d.ts +0 -106
  77. package/dist/types/schema/inbox-schema.d.ts +0 -81
  78. package/dist/types/schema/index.d.ts +0 -19
  79. package/dist/types/schema/presence-schema.d.ts +0 -28
  80. package/dist/types/schema/schedule-schema.d.ts +0 -79
  81. package/dist/types/schema/shared-schema.d.ts +0 -13
  82. package/dist/types/schema/skill-schema.d.ts +0 -260
  83. package/dist/types/schema/state-schema.d.ts +0 -35
  84. package/dist/types/schema/tool-schema.d.ts +0 -84
  85. package/dist/types/schema/wait-schema.d.ts +0 -98
  86. package/dist/types/schema/workflow-schema.d.ts +0 -2062
  87. package/dist/types/schema/workspace-schema.d.ts +0 -78
  88. package/dist/types/test/captured-model.d.ts +0 -19
  89. package/dist/types/test/scripted-model.d.ts +0 -49
@@ -1,5 +0,0 @@
1
- import { Agent } from "../../schema/index";
2
- import type { RegisteredTool } from "../tool/tool-runtime-service";
3
- import { type Interface } from "./execution-state-service";
4
- export declare const enabled: (agent: Agent.Definition) => boolean;
5
- export declare const registeredTools: (state: Interface) => ReadonlyArray<RegisteredTool>;
@@ -1,6 +0,0 @@
1
- import { Tool } from "../../schema/index";
2
- import { Crypto, Effect } from "effect";
3
- export declare const digestInputSchema: (inputSchema: import("effect/Schema").Json) => Effect.Effect<string, import("effect/PlatformError").PlatformError, Crypto.Crypto>;
4
- export declare const digestDefinitions: (definitions: readonly Tool.Definition[], toolNames: readonly string[]) => Effect.Effect<{
5
- [k: string]: string;
6
- }, import("effect/PlatformError").PlatformError, Crypto.Crypto>;
@@ -1,162 +0,0 @@
1
- import { Execution, Ids, Shared, Tool } from "../../schema/index";
2
- import { ToolCallRepository } from "@relayfx/store-sql/portable";
3
- import { Tool as AiTool, Toolkit } from "effect/unstable/ai";
4
- import { Context, Effect, Layer, Schema } from "effect";
5
- import { Service as EventLogService } from "../execution/event-log-service";
6
- import { Service as WaitServiceService } from "../wait/wait-service";
7
- declare const ToolNotRegistered_base: Schema.Class<ToolNotRegistered, Schema.TaggedStruct<"ToolNotRegistered", {
8
- readonly tool_name: Schema.String;
9
- }>, import("effect/Cause").YieldableError>;
10
- export declare class ToolNotRegistered extends ToolNotRegistered_base {
11
- }
12
- declare const ToolPermissionDenied_base: Schema.Class<ToolPermissionDenied, Schema.TaggedStruct<"ToolPermissionDenied", {
13
- readonly tool_name: Schema.String;
14
- readonly permission_name: Schema.String;
15
- }>, import("effect/Cause").YieldableError>;
16
- export declare class ToolPermissionDenied extends ToolPermissionDenied_base {
17
- }
18
- declare const ToolInputInvalid_base: Schema.Class<ToolInputInvalid, Schema.TaggedStruct<"ToolInputInvalid", {
19
- readonly tool_name: Schema.String;
20
- readonly message: Schema.String;
21
- }>, import("effect/Cause").YieldableError>;
22
- export declare class ToolInputInvalid extends ToolInputInvalid_base {
23
- }
24
- declare const ToolExecutionFailed_base: Schema.Class<ToolExecutionFailed, Schema.TaggedStruct<"ToolExecutionFailed", {
25
- readonly tool_name: Schema.String;
26
- readonly message: Schema.String;
27
- }>, import("effect/Cause").YieldableError>;
28
- export declare class ToolExecutionFailed extends ToolExecutionFailed_base {
29
- }
30
- declare const ToolExecutionWaitRequested_base: Schema.Class<ToolExecutionWaitRequested, Schema.TaggedStruct<"ToolExecutionWaitRequested", {
31
- readonly tool_name: Schema.String;
32
- readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
33
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
34
- };
35
- }>, import("effect/Cause").YieldableError>;
36
- export declare class ToolExecutionWaitRequested extends ToolExecutionWaitRequested_base {
37
- }
38
- declare const ToolRuntimeError_base: Schema.Class<ToolRuntimeError, Schema.TaggedStruct<"ToolRuntimeError", {
39
- readonly message: Schema.String;
40
- }>, import("effect/Cause").YieldableError>;
41
- export declare class ToolRuntimeError extends ToolRuntimeError_base {
42
- }
43
- export interface ToolExecutionContext {
44
- readonly executionId: Ids.ExecutionId;
45
- readonly call: Tool.Call;
46
- readonly permissions: ReadonlyArray<Tool.Permission>;
47
- readonly eventSequence: Execution.ExecutionEventSequence;
48
- readonly createdAt: number;
49
- readonly idempotencyKey: string;
50
- }
51
- export interface ToolCallInfoData extends ToolExecutionContext {
52
- }
53
- declare const ToolCallInfo_base: Context.ServiceClass<ToolCallInfo, "@relayfx/runtime/tool/tool-runtime-service/ToolCallInfo", ToolCallInfoData>;
54
- export declare class ToolCallInfo extends ToolCallInfo_base {
55
- }
56
- export interface RegisteredTool {
57
- readonly definition: Tool.Definition;
58
- readonly tool: AiTool.Any;
59
- readonly placement?: Tool.Placement | undefined;
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, ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError>) | undefined;
63
- }
64
- export interface ToolOptions<Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>> {
65
- readonly description: string;
66
- readonly input: Input;
67
- readonly output: Output;
68
- readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
69
- readonly requiredPermissions?: ReadonlyArray<string> | undefined;
70
- readonly requirements?: ReadonlyArray<Tool.RuntimeRequirement> | undefined;
71
- readonly needsApproval?: boolean | undefined;
72
- readonly metadata?: Shared.Metadata | undefined;
73
- readonly placement?: Tool.Placement | undefined;
74
- readonly run: (input: Input["Type"], context: ToolExecutionContext) => Effect.Effect<Output["Type"], ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, ToolCallInfo>;
75
- }
76
- export interface DynamicToolOptions {
77
- readonly description: string;
78
- readonly inputSchema: Shared.JsonValue;
79
- readonly outputSchema: Shared.JsonValue;
80
- readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
81
- readonly requiredPermissions?: ReadonlyArray<string> | undefined;
82
- readonly requirements?: ReadonlyArray<Tool.RuntimeRequirement> | undefined;
83
- readonly needsApproval?: boolean | undefined;
84
- readonly metadata?: Shared.Metadata | undefined;
85
- readonly placement?: Tool.Placement | undefined;
86
- readonly run: (input: Shared.JsonValue, context: ToolExecutionContext) => Effect.Effect<Shared.JsonValue, ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError>;
87
- }
88
- export interface ToolkitToolOptions {
89
- readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
90
- readonly requiredPermissions?: ReadonlyArray<string> | undefined;
91
- readonly requirements?: ReadonlyArray<Tool.RuntimeRequirement> | undefined;
92
- readonly needsApproval?: boolean | undefined;
93
- readonly metadata?: Shared.Metadata | undefined;
94
- readonly placement?: Tool.Placement | undefined;
95
- }
96
- export type ToolkitRegistrationOptions = ToolkitToolOptions | ((tool: AiTool.Any) => ToolkitToolOptions);
97
- export interface RunInput {
98
- readonly executionId: Ids.ExecutionId;
99
- readonly call: Tool.Call;
100
- readonly permissions: ReadonlyArray<Tool.Permission>;
101
- readonly eventSequence: Execution.ExecutionEventSequence;
102
- readonly createdAt: number;
103
- readonly extraTools?: ReadonlyArray<RegisteredTool>;
104
- readonly transformResult?: (result: Tool.Result) => Effect.Effect<Tool.Result, ToolRuntimeError>;
105
- }
106
- export interface Interface {
107
- readonly register: (tool: RegisteredTool) => Effect.Effect<void>;
108
- readonly definitions: Effect.Effect<ReadonlyArray<Tool.Definition>>;
109
- readonly registeredTools: Effect.Effect<ReadonlyArray<RegisteredTool>>;
110
- readonly run: (input: RunInput) => Effect.Effect<Tool.Result, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError, never>;
111
- }
112
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/tool/tool-runtime-service/Service", Interface>;
113
- export declare class Service extends Service_base {
114
- }
115
- export declare const toolFromRegistered: (tool: RegisteredTool) => AiTool.Any;
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
- };
128
- export interface PlacedToolOptions {
129
- readonly permissions?: ReadonlyArray<Tool.Permission> | undefined;
130
- readonly requiredPermissions?: ReadonlyArray<string> | undefined;
131
- readonly requirements?: ReadonlyArray<Tool.RuntimeRequirement> | undefined;
132
- readonly needsApproval?: boolean | undefined;
133
- readonly metadata?: Shared.Metadata | undefined;
134
- }
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
- };
147
- export declare const layer: (initialTools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, ToolCallRepository.Service | EventLogService | WaitServiceService>;
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
- };
152
- export declare const memoryLayer: (tools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service, never, never>;
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
- };
157
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
158
- export declare const register: (registeredTool: RegisteredTool) => Effect.Effect<void, never, Service>;
159
- export declare const definitions: () => Effect.Effect<readonly Tool.Definition[], never, Service>;
160
- export declare const registeredTools: () => Effect.Effect<readonly RegisteredTool[], never, Service>;
161
- export declare const run: (input: RunInput) => Effect.Effect<Tool.Result, ToolExecutionFailed | ToolExecutionWaitRequested | ToolInputInvalid | ToolNotRegistered | ToolPermissionDenied | ToolRuntimeError, Service>;
162
- export {};
@@ -1,13 +0,0 @@
1
- import { Context, Effect, Layer } from "effect";
2
- import { SqlClient } from "effect/unstable/sql/SqlClient";
3
- import type { SqlError } from "effect/unstable/sql/SqlError";
4
- export interface Interface {
5
- readonly coordinate: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | SqlError, R>;
6
- }
7
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/tool/tool-transition-coordinator/Service", Interface>;
8
- export declare class Service extends Service_base {
9
- }
10
- export declare const memoryLayer: Layer.Layer<Service, never, never>;
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, E | SqlError, R | Service>;
13
- export {};
@@ -1,24 +0,0 @@
1
- import { Ids } from "../../schema/index";
2
- import { Schema } from "effect";
3
- import type { RegisteredTool } from "../tool/tool-runtime-service";
4
- import type { Interface as TopicInterface } from "./topic-service";
5
- export declare const toolName = "publish_to_topic";
6
- export declare const permissionName = "relay.topic.publish";
7
- export declare const Input: Schema.Struct<{
8
- readonly topic: Schema.String;
9
- readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
10
- readonly type: Schema.Literal<"text">;
11
- readonly text: Schema.String;
12
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
13
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
14
- }>>]>;
15
- }>;
16
- export declare const Output: Schema.Struct<{
17
- readonly envelope_id: Schema.String;
18
- readonly subscriber_count: Schema.Int;
19
- }>;
20
- export interface Config {
21
- readonly topics: TopicInterface;
22
- readonly from: Ids.AddressId;
23
- }
24
- export declare const registeredTool: (config: Config) => RegisteredTool;
@@ -1,50 +0,0 @@
1
- import { Content, Ids, Shared } from "../../schema/index";
2
- import { EnvelopeRepository, ExecutionRepository, TopicRepository } from "@relayfx/store-sql/portable";
3
- import { Context, Effect, Layer, Schema } from "effect";
4
- import { Service as InboxServiceService } from "../inbox/inbox-service";
5
- declare const TopicServiceError_base: Schema.Class<TopicServiceError, Schema.TaggedStruct<"TopicServiceError", {
6
- readonly message: Schema.String;
7
- }>, import("effect/Cause").YieldableError>;
8
- export declare class TopicServiceError extends TopicServiceError_base {
9
- }
10
- export interface SubscribeInput {
11
- readonly topicAddressId: Ids.AddressId;
12
- readonly subscriberExecutionId: Ids.ExecutionId;
13
- readonly metadata?: Shared.Metadata;
14
- }
15
- export interface UnsubscribeInput {
16
- readonly topicAddressId: Ids.AddressId;
17
- readonly subscriberExecutionId: Ids.ExecutionId;
18
- }
19
- export interface PublishInput {
20
- readonly topicAddressId: Ids.AddressId;
21
- readonly from: Ids.AddressId;
22
- readonly content: ReadonlyArray<Content.Part>;
23
- readonly metadata?: Shared.Metadata;
24
- readonly idempotencyKey?: string;
25
- }
26
- export interface PublishResult {
27
- readonly envelope_id: Ids.EnvelopeId;
28
- readonly subscriber_count: number;
29
- }
30
- export interface ListInput {
31
- readonly topicAddressId?: Ids.AddressId;
32
- readonly subscriberExecutionId?: Ids.ExecutionId;
33
- }
34
- export interface Interface {
35
- readonly subscribe: (input: SubscribeInput) => Effect.Effect<TopicRepository.Subscription, TopicServiceError>;
36
- readonly unsubscribe: (input: UnsubscribeInput) => Effect.Effect<void, TopicServiceError>;
37
- readonly publish: (input: PublishInput) => Effect.Effect<PublishResult, TopicServiceError>;
38
- readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<TopicRepository.Subscription>, TopicServiceError>;
39
- }
40
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/topic/topic-service/Service", Interface>;
41
- export declare class Service extends Service_base {
42
- }
43
- export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | ExecutionRepository.Service | TopicRepository.Service | InboxServiceService>;
44
- export declare const memoryLayer: Layer.Layer<Service, never, EnvelopeRepository.Service | ExecutionRepository.Service | InboxServiceService>;
45
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
46
- export declare const subscribe: (input: SubscribeInput) => Effect.Effect<TopicRepository.Subscription, TopicServiceError, Service>;
47
- export declare const unsubscribe: (input: UnsubscribeInput) => Effect.Effect<void, TopicServiceError, Service>;
48
- export declare const publish: (input: PublishInput) => Effect.Effect<PublishResult, TopicServiceError, Service>;
49
- export declare const list: (input: ListInput) => Effect.Effect<readonly TopicRepository.Subscription[], TopicServiceError, Service>;
50
- export {};
@@ -1,81 +0,0 @@
1
- import { Envelope, Execution, Ids, Shared } from "../../schema/index";
2
- import { EnvelopeRepository, ScheduleRepository } from "@relayfx/store-sql/portable";
3
- import { Context, Effect, Layer, Schema } from "effect";
4
- import { Service as EventLogService } from "../execution/event-log-service";
5
- declare const WaitNotFound_base: Schema.Class<WaitNotFound, Schema.TaggedStruct<"WaitNotFound", {
6
- readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
7
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
8
- };
9
- }>, import("effect/Cause").YieldableError>;
10
- export declare class WaitNotFound extends WaitNotFound_base {
11
- }
12
- declare const WaitDefinitionMissing_base: Schema.Class<WaitDefinitionMissing, Schema.TaggedStruct<"WaitDefinitionMissing", {
13
- readonly envelope_id: Schema.brand<Schema.String, "Relay.EnvelopeId"> & {
14
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EnvelopeId">;
15
- };
16
- }>, import("effect/Cause").YieldableError>;
17
- export declare class WaitDefinitionMissing extends WaitDefinitionMissing_base {
18
- }
19
- declare const WaitServiceError_base: Schema.Class<WaitServiceError, Schema.TaggedStruct<"WaitServiceError", {
20
- readonly message: Schema.String;
21
- }>, import("effect/Cause").YieldableError>;
22
- export declare class WaitServiceError extends WaitServiceError_base {
23
- }
24
- export interface CreateWaitInput {
25
- readonly waitId: Ids.WaitId;
26
- readonly envelope: Envelope.Envelope;
27
- readonly eventSequence: Execution.ExecutionEventSequence;
28
- }
29
- export interface CreateDetachedWaitInput {
30
- readonly waitId: Ids.WaitId;
31
- readonly executionId: Ids.ExecutionId;
32
- readonly mode: Envelope.WaitMode;
33
- readonly correlationKey?: string;
34
- readonly metadata?: Shared.Metadata;
35
- readonly timeout?: string;
36
- readonly eventSequence: Execution.ExecutionEventSequence;
37
- readonly createdAt: number;
38
- }
39
- export interface WakeInput {
40
- readonly waitId: Ids.WaitId;
41
- readonly resolvedAt: number;
42
- readonly eventSequence: Execution.ExecutionEventSequence;
43
- readonly metadata?: Shared.Metadata;
44
- }
45
- export interface TimeoutInput {
46
- readonly waitId: Ids.WaitId;
47
- readonly timedOutAt: number;
48
- readonly eventSequence: Execution.ExecutionEventSequence;
49
- readonly metadata?: Shared.Metadata;
50
- }
51
- export interface CancelWaitInput {
52
- readonly waitId: Ids.WaitId;
53
- readonly cancelledAt: number;
54
- readonly eventSequence: Execution.ExecutionEventSequence;
55
- readonly metadata?: Shared.Metadata;
56
- }
57
- export interface WaitTransition {
58
- readonly wait: EnvelopeRepository.WaitRecord;
59
- readonly transitioned: boolean;
60
- }
61
- export interface Interface {
62
- readonly create: (input: CreateWaitInput) => Effect.Effect<EnvelopeRepository.WaitRecord, WaitDefinitionMissing | WaitServiceError>;
63
- readonly createDetached: (input: CreateDetachedWaitInput) => Effect.Effect<EnvelopeRepository.WaitRecord, WaitServiceError>;
64
- readonly get: (id: Ids.WaitId) => Effect.Effect<EnvelopeRepository.WaitRecord | undefined, WaitServiceError>;
65
- readonly wake: (input: WakeInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError>;
66
- readonly timeout: (input: TimeoutInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError>;
67
- readonly cancel: (input: CancelWaitInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError>;
68
- }
69
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/wait/wait-service/Service", Interface>;
70
- export declare class Service extends Service_base {
71
- }
72
- export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | ScheduleRepository.Service | EventLogService>;
73
- export declare const memoryLayer: Layer.Layer<Service, never, never>;
74
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
75
- export declare const create: (input: CreateWaitInput) => Effect.Effect<EnvelopeRepository.WaitRecord, WaitDefinitionMissing | WaitServiceError, Service>;
76
- export declare const createDetached: (input: CreateDetachedWaitInput) => Effect.Effect<EnvelopeRepository.WaitRecord, WaitServiceError, Service>;
77
- export declare const get: (id: string & import("effect/Brand").Brand<"Relay.WaitId">) => Effect.Effect<EnvelopeRepository.WaitRecord | undefined, WaitServiceError, Service>;
78
- export declare const wake: (input: WakeInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError, Service>;
79
- export declare const timeout: (input: TimeoutInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError, Service>;
80
- export declare const cancel: (input: CancelWaitInput) => Effect.Effect<WaitTransition, WaitNotFound | WaitServiceError, Service>;
81
- export {};
@@ -1,25 +0,0 @@
1
- import { Ids } from "../../schema/index";
2
- import { ExecutionRepository } from "@relayfx/store-sql/portable";
3
- import { Effect, Schema } from "effect";
4
- import { ExecutionWorkflowFailed } from "../workflow/execution-workflow";
5
- import type { SignalWaitInput, WaitSignalState } from "../workflow/execution-workflow";
6
- export interface ExecutionSignalClient {
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 {
15
- }
16
- export type ExecutionClientFactory = (executionId: Ids.ExecutionId) => ExecutionSignalClient;
17
- export interface SignalWorkflowWaitInput {
18
- readonly makeExecutionClient: ExecutionClientFactory;
19
- readonly executionId: Ids.ExecutionId;
20
- readonly waitId: Ids.WaitId;
21
- readonly state: WaitSignalState;
22
- readonly signaledAt: number;
23
- }
24
- export declare const signalWorkflowWait: (input: SignalWorkflowWaitInput) => Effect.Effect<void, WaitSignalError | ExecutionWorkflowFailed, ExecutionRepository.Service>;
25
- export {};
@@ -1,93 +0,0 @@
1
- import { Crypto, Effect, Schema } from "effect";
2
- export declare const ActivityManifestEntry: Schema.Struct<{
3
- readonly name: Schema.String;
4
- readonly signature_hash: Schema.String;
5
- }>;
6
- export interface ActivityManifestEntry extends Schema.Schema.Type<typeof ActivityManifestEntry> {
7
- }
8
- export declare const ActivityManifest: Schema.Struct<{
9
- readonly version: Schema.Literal<1>;
10
- readonly generated_from: Schema.String;
11
- readonly hash_algorithm: Schema.Literal<"sha256-json-schema-v1">;
12
- readonly activities: Schema.$Array<Schema.Struct<{
13
- readonly name: Schema.String;
14
- readonly signature_hash: Schema.String;
15
- }>>;
16
- }>;
17
- export interface ActivityManifest extends Schema.Schema.Type<typeof ActivityManifest> {
18
- }
19
- export declare const ActivityManifestChange: Schema.Struct<{
20
- readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
21
- readonly name: Schema.String;
22
- readonly baseline_hash: Schema.optionalKey<Schema.String>;
23
- readonly current_hash: Schema.optionalKey<Schema.String>;
24
- }>;
25
- export interface ActivityManifestChange extends Schema.Schema.Type<typeof ActivityManifestChange> {
26
- }
27
- export declare const ActivityManifestGuardResult: Schema.Struct<{
28
- readonly status: Schema.Literals<readonly ["pass", "fail"]>;
29
- readonly waiting_executions: Schema.Int;
30
- readonly breaking_changes: Schema.$Array<Schema.Struct<{
31
- readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
32
- readonly name: Schema.String;
33
- readonly baseline_hash: Schema.optionalKey<Schema.String>;
34
- readonly current_hash: Schema.optionalKey<Schema.String>;
35
- }>>;
36
- readonly additive_changes: Schema.$Array<Schema.Struct<{
37
- readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
38
- readonly name: Schema.String;
39
- readonly baseline_hash: Schema.optionalKey<Schema.String>;
40
- readonly current_hash: Schema.optionalKey<Schema.String>;
41
- }>>;
42
- }>;
43
- export interface ActivityManifestGuardResult extends Schema.Schema.Type<typeof ActivityManifestGuardResult> {
44
- }
45
- declare const ActivityManifestGuardFailed_base: Schema.Class<ActivityManifestGuardFailed, Schema.TaggedStruct<"ActivityManifestGuardFailed", {
46
- readonly message: Schema.String;
47
- readonly result: Schema.Struct<{
48
- readonly status: Schema.Literals<readonly ["pass", "fail"]>;
49
- readonly waiting_executions: Schema.Int;
50
- readonly breaking_changes: Schema.$Array<Schema.Struct<{
51
- readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
52
- readonly name: Schema.String;
53
- readonly baseline_hash: Schema.optionalKey<Schema.String>;
54
- readonly current_hash: Schema.optionalKey<Schema.String>;
55
- }>>;
56
- readonly additive_changes: Schema.$Array<Schema.Struct<{
57
- readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
58
- readonly name: Schema.String;
59
- readonly baseline_hash: Schema.optionalKey<Schema.String>;
60
- readonly current_hash: Schema.optionalKey<Schema.String>;
61
- }>>;
62
- }>;
63
- }>, import("effect/Cause").YieldableError>;
64
- export declare class ActivityManifestGuardFailed extends ActivityManifestGuardFailed_base {
65
- }
66
- export declare const currentManifest: () => Effect.Effect<{
67
- version: 1;
68
- generated_from: string;
69
- hash_algorithm: "sha256-json-schema-v1";
70
- activities: {
71
- name: string;
72
- signature_hash: string;
73
- }[];
74
- }, import("effect/PlatformError").PlatformError, Crypto.Crypto>;
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>;
82
- };
83
- export declare const evaluateGuard: (input: {
84
- readonly baseline: ActivityManifest;
85
- readonly current: ActivityManifest;
86
- readonly waitingExecutions: number;
87
- }) => ActivityManifestGuardResult;
88
- export declare const guard: (input: {
89
- readonly baseline: ActivityManifest;
90
- readonly current: ActivityManifest;
91
- readonly waitingExecutions: number;
92
- }) => Effect.Effect<ActivityManifestGuardResult, ActivityManifestGuardFailed, never>;
93
- export {};
@@ -1,95 +0,0 @@
1
- import { ChildOrchestration, Ids, Shared, Workflow } from "../../schema/index";
2
- import { WorkflowDefinitionRepository } from "@relayfx/store-sql/portable";
3
- import { Cause, Context, Effect, Layer, Schema } from "effect";
4
- import { SqlError } from "effect/unstable/sql/SqlError";
5
- export interface SideEffectContext {
6
- readonly execution_id: Ids.ExecutionId;
7
- readonly operation_id: Ids.WorkflowOperationId;
8
- readonly idempotency_key: string;
9
- }
10
- declare const UnsupportedOperation_base: Schema.Class<UnsupportedOperation, Schema.TaggedStruct<"UnsupportedWorkflowOperation", {
11
- readonly operation_id: Schema.brand<Schema.String, "Relay.WorkflowOperationId"> & {
12
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkflowOperationId">;
13
- };
14
- readonly kind: Schema.String;
15
- }>, Cause.YieldableError>;
16
- export declare class UnsupportedOperation extends UnsupportedOperation_base {
17
- }
18
- declare const PinnedDefinitionNotFound_base: Schema.Class<PinnedDefinitionNotFound, Schema.TaggedStruct<"PinnedWorkflowDefinitionNotFound", {
19
- readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
20
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
21
- };
22
- }>, Cause.YieldableError>;
23
- export declare class PinnedDefinitionNotFound extends PinnedDefinitionNotFound_base {
24
- }
25
- declare const PinnedDefinitionMismatch_base: Schema.Class<PinnedDefinitionMismatch, Schema.TaggedStruct<"PinnedWorkflowDefinitionMismatch", {
26
- readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
27
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
28
- };
29
- }>, Cause.YieldableError>;
30
- export declare class PinnedDefinitionMismatch extends PinnedDefinitionMismatch_base {
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
- }
42
- export interface Handlers {
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>;
52
- }
53
- declare const HandlerService_base: Context.ServiceClass<HandlerService, "@relayfx/runtime/workflow/definition-runtime/HandlerService", Handlers>;
54
- export declare class HandlerService extends HandlerService_base {
55
- }
56
- export interface Interface {
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>;
63
- }
64
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/workflow/definition-runtime/Service", Interface>;
65
- export declare class Service extends Service_base {
66
- }
67
- export declare const fanOutIdFor: {
68
- (fanOutKey: string): (executionId: Ids.ExecutionId) => Ids.ChildFanOutId;
69
- (executionId: Ids.ExecutionId, fanOutKey: string): Ids.ChildFanOutId;
70
- };
71
- declare const WorkflowCancelled_base: Schema.Class<WorkflowCancelled, Schema.TaggedStruct<"WorkflowCancelled", {}>, Cause.YieldableError>;
72
- export declare class WorkflowCancelled extends WorkflowCancelled_base {
73
- }
74
- declare const WorkflowBudgetExceeded_base: Schema.Class<WorkflowBudgetExceeded, Schema.TaggedStruct<"WorkflowBudgetExceeded", {
75
- readonly operation_id: Schema.brand<Schema.String, "Relay.WorkflowOperationId"> & {
76
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkflowOperationId">;
77
- };
78
- }>, Cause.YieldableError>;
79
- export declare class WorkflowBudgetExceeded extends WorkflowBudgetExceeded_base {
80
- }
81
- declare const WorkflowJoining_base: Schema.Class<WorkflowJoining, Schema.TaggedStruct<"WorkflowJoining", {
82
- readonly fan_out_id: Schema.brand<Schema.String, "Relay.ChildFanOutId"> & {
83
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildFanOutId">;
84
- };
85
- }>, Cause.YieldableError>;
86
- export declare class WorkflowJoining extends WorkflowJoining_base {
87
- }
88
- type WorkflowExecutionError = WorkflowDefinitionRepository.RepositoryError | SqlError | WorkflowRuntimeError | UnsupportedOperation | PinnedDefinitionNotFound | PinnedDefinitionMismatch | WorkflowCancelled | WorkflowBudgetExceeded | WorkflowJoining | WorkflowJoinPolicyNotSatisfied;
89
- export declare const validate: (definition: Workflow.Definition) => Effect.Effect<void, never, never> | Effect.Effect<never, UnsupportedOperation, never>;
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>;
91
- export declare const handlersLayer: (handlers: Handlers) => Layer.Layer<HandlerService, never, never>;
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>;
95
- export {};