@relayfx/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8449 -0
- package/dist/migrations/20260701002839_sour_cerebro/migration.sql +160 -0
- package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +1971 -0
- package/dist/migrations/20260701041134_acoustic_hulk/migration.sql +30 -0
- package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +2372 -0
- package/dist/migrations/20260701160543_condemned_stryfe/migration.sql +2 -0
- package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +2442 -0
- package/dist/migrations/20260701220315_heavy_gorgon/migration.sql +5 -0
- package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +2495 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/migration.sql +24 -0
- package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +2821 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/migration.sql +1 -0
- package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +2821 -0
- package/dist/types/ai/index.d.ts +2 -0
- package/dist/types/ai/language-model/language-model-registration.d.ts +89 -0
- package/dist/types/relay/adapter-outbox.d.ts +19 -0
- package/dist/types/relay/client.d.ts +102 -0
- package/dist/types/relay/database.d.ts +11 -0
- package/dist/types/relay/index.d.ts +10 -0
- package/dist/types/relay/operation.d.ts +921 -0
- package/dist/types/runtime/address/address-book-service.d.ts +74 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +106 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +53 -0
- package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +102 -0
- package/dist/types/runtime/child/child-run-service.d.ts +90 -0
- package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +393 -0
- package/dist/types/runtime/content/artifact-store-service.d.ts +73 -0
- package/dist/types/runtime/content/blob-store-service.d.ts +87 -0
- package/dist/types/runtime/envelope/envelope-service.d.ts +52 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +54 -0
- package/dist/types/runtime/execution/execution-service.d.ts +62 -0
- package/dist/types/runtime/index.d.ts +25 -0
- package/dist/types/runtime/model/language-model-service.d.ts +58 -0
- package/dist/types/runtime/model/model-call-policy.d.ts +53 -0
- package/dist/types/runtime/observability/runtime-metrics.d.ts +9 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +132 -0
- package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +85 -0
- package/dist/types/runtime/wait/wait-service.d.ts +80 -0
- package/dist/types/runtime/wait/wait-signal.d.ts +15 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +335 -0
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +63 -0
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
- package/dist/types/schema/address-schema.d.ts +77 -0
- package/dist/types/schema/agent-schema.d.ts +360 -0
- package/dist/types/schema/content-schema.d.ts +106 -0
- package/dist/types/schema/envelope-schema.d.ts +167 -0
- package/dist/types/schema/execution-schema.d.ts +297 -0
- package/dist/types/schema/ids-schema.d.ts +61 -0
- package/dist/types/schema/index.d.ts +11 -0
- package/dist/types/schema/schedule-schema.d.ts +73 -0
- package/dist/types/schema/shared-schema.d.ts +11 -0
- package/dist/types/schema/tool-schema.d.ts +53 -0
- package/dist/types/schema/workspace-schema.d.ts +78 -0
- package/dist/types/store-sql/address/address-book-repository.d.ts +48 -0
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +49 -0
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +31 -0
- package/dist/types/store-sql/child/child-execution-repository.d.ts +61 -0
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +35 -0
- package/dist/types/store-sql/database/database-service.d.ts +25 -0
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +158 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +86 -0
- package/dist/types/store-sql/execution/execution-repository.d.ts +80 -0
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +42 -0
- package/dist/types/store-sql/index.d.ts +15 -0
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +83 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +2302 -0
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +66 -0
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +87 -0
- package/package.json +44 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import type { ExecutionRepository } from "../../store-sql/index";
|
|
2
|
+
import { Entity } from "effect/unstable/cluster";
|
|
3
|
+
import { Rpc } from "effect/unstable/rpc";
|
|
4
|
+
import type { WorkflowEngine } from "effect/unstable/workflow";
|
|
5
|
+
import { Schema } from "effect";
|
|
6
|
+
import type { Effect } from "effect";
|
|
7
|
+
import type * as EventLog from "../execution/event-log-service";
|
|
8
|
+
import type * as WaitService from "../wait/wait-service";
|
|
9
|
+
import * as ExecutionWorkflow from "../workflow/execution-workflow";
|
|
10
|
+
export declare const Start: Rpc.Rpc<"start", Schema.Struct<{
|
|
11
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
12
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
13
|
+
};
|
|
14
|
+
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
15
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
16
|
+
};
|
|
17
|
+
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly type: Schema.Literal<"text">;
|
|
19
|
+
readonly text: Schema.String;
|
|
20
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
readonly type: Schema.Literal<"structured">;
|
|
23
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
24
|
+
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
26
|
+
}>, Schema.Struct<{
|
|
27
|
+
readonly type: Schema.Literal<"blob-reference">;
|
|
28
|
+
readonly uri: Schema.String;
|
|
29
|
+
readonly media_type: Schema.String;
|
|
30
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
31
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"artifact-reference">;
|
|
34
|
+
readonly artifact_id: Schema.String;
|
|
35
|
+
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
36
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly type: Schema.Literal<"tool-call">;
|
|
39
|
+
readonly call: Schema.Struct<{
|
|
40
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
41
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
42
|
+
};
|
|
43
|
+
readonly name: Schema.String;
|
|
44
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
45
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
46
|
+
}>;
|
|
47
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
48
|
+
}>, Schema.Struct<{
|
|
49
|
+
readonly type: Schema.Literal<"tool-result">;
|
|
50
|
+
readonly result: Schema.Struct<{
|
|
51
|
+
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
52
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
53
|
+
};
|
|
54
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
55
|
+
readonly error: Schema.optionalKey<Schema.String>;
|
|
56
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
57
|
+
}>;
|
|
58
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
59
|
+
}>]>>>;
|
|
60
|
+
readonly event_sequence: Schema.Int;
|
|
61
|
+
readonly started_at: Schema.Int;
|
|
62
|
+
readonly completed_at: Schema.Int;
|
|
63
|
+
readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
|
|
64
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
|
|
65
|
+
}>;
|
|
66
|
+
readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
|
|
67
|
+
readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
|
|
68
|
+
readonly name: Schema.String;
|
|
69
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
70
|
+
readonly model: Schema.Struct<{
|
|
71
|
+
readonly provider: Schema.String;
|
|
72
|
+
readonly model: Schema.String;
|
|
73
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
74
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
75
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
76
|
+
}>;
|
|
77
|
+
readonly tool_names: Schema.$Array<Schema.String>;
|
|
78
|
+
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
79
|
+
readonly name: Schema.String;
|
|
80
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
81
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
82
|
+
}>>;
|
|
83
|
+
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
84
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
85
|
+
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
86
|
+
readonly provider: Schema.String;
|
|
87
|
+
readonly model: Schema.String;
|
|
88
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
89
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
90
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
91
|
+
}>>;
|
|
92
|
+
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
93
|
+
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
94
|
+
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
95
|
+
readonly mode: Schema.Literals<readonly ["share", "fork"]>;
|
|
96
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
|
|
97
|
+
}>>;
|
|
98
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
99
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
100
|
+
}>>>;
|
|
101
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
102
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
103
|
+
}>>;
|
|
104
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
105
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
106
|
+
}>;
|
|
107
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
108
|
+
}>, Schema.Struct<{
|
|
109
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
110
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
111
|
+
};
|
|
112
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
113
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
114
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
115
|
+
}>;
|
|
116
|
+
readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
|
|
117
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
118
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
|
|
119
|
+
export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
|
|
120
|
+
readonly workflow_execution_id: Schema.String;
|
|
121
|
+
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
122
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
123
|
+
};
|
|
124
|
+
readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
|
|
125
|
+
readonly signaled_at: Schema.Int;
|
|
126
|
+
}>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
|
|
127
|
+
export declare const Cancel: Rpc.Rpc<"cancel", Schema.Struct<{
|
|
128
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
129
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
130
|
+
};
|
|
131
|
+
readonly cancelled_at: Schema.Int;
|
|
132
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
133
|
+
}>, Schema.Struct<{
|
|
134
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
135
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
136
|
+
};
|
|
137
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
138
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>;
|
|
139
|
+
export declare const entity: Entity.Entity<"Relay/Execution", Rpc.Rpc<"start", Schema.Struct<{
|
|
140
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
141
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
142
|
+
};
|
|
143
|
+
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
144
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
145
|
+
};
|
|
146
|
+
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
147
|
+
readonly type: Schema.Literal<"text">;
|
|
148
|
+
readonly text: Schema.String;
|
|
149
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
150
|
+
}>, Schema.Struct<{
|
|
151
|
+
readonly type: Schema.Literal<"structured">;
|
|
152
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
153
|
+
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
154
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
readonly type: Schema.Literal<"blob-reference">;
|
|
157
|
+
readonly uri: Schema.String;
|
|
158
|
+
readonly media_type: Schema.String;
|
|
159
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
160
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
161
|
+
}>, Schema.Struct<{
|
|
162
|
+
readonly type: Schema.Literal<"artifact-reference">;
|
|
163
|
+
readonly artifact_id: Schema.String;
|
|
164
|
+
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
165
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
166
|
+
}>, Schema.Struct<{
|
|
167
|
+
readonly type: Schema.Literal<"tool-call">;
|
|
168
|
+
readonly call: Schema.Struct<{
|
|
169
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
170
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
171
|
+
};
|
|
172
|
+
readonly name: Schema.String;
|
|
173
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
174
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
175
|
+
}>;
|
|
176
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
177
|
+
}>, Schema.Struct<{
|
|
178
|
+
readonly type: Schema.Literal<"tool-result">;
|
|
179
|
+
readonly result: Schema.Struct<{
|
|
180
|
+
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
181
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
182
|
+
};
|
|
183
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
184
|
+
readonly error: Schema.optionalKey<Schema.String>;
|
|
185
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
186
|
+
}>;
|
|
187
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
188
|
+
}>]>>>;
|
|
189
|
+
readonly event_sequence: Schema.Int;
|
|
190
|
+
readonly started_at: Schema.Int;
|
|
191
|
+
readonly completed_at: Schema.Int;
|
|
192
|
+
readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
|
|
193
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
|
|
194
|
+
}>;
|
|
195
|
+
readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
|
|
196
|
+
readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
|
|
197
|
+
readonly name: Schema.String;
|
|
198
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
199
|
+
readonly model: Schema.Struct<{
|
|
200
|
+
readonly provider: Schema.String;
|
|
201
|
+
readonly model: Schema.String;
|
|
202
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
203
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
204
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
205
|
+
}>;
|
|
206
|
+
readonly tool_names: Schema.$Array<Schema.String>;
|
|
207
|
+
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
208
|
+
readonly name: Schema.String;
|
|
209
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
210
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
211
|
+
}>>;
|
|
212
|
+
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
213
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
214
|
+
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
215
|
+
readonly provider: Schema.String;
|
|
216
|
+
readonly model: Schema.String;
|
|
217
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
218
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
219
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
220
|
+
}>>;
|
|
221
|
+
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
222
|
+
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
223
|
+
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
224
|
+
readonly mode: Schema.Literals<readonly ["share", "fork"]>;
|
|
225
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
|
|
226
|
+
}>>;
|
|
227
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
228
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
229
|
+
}>>>;
|
|
230
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
231
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
232
|
+
}>>;
|
|
233
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
234
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
235
|
+
}>;
|
|
236
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
237
|
+
}>, Schema.Struct<{
|
|
238
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
239
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
240
|
+
};
|
|
241
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
242
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
243
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
244
|
+
}>;
|
|
245
|
+
readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
|
|
246
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
247
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
|
|
248
|
+
readonly workflow_execution_id: Schema.String;
|
|
249
|
+
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
250
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
251
|
+
};
|
|
252
|
+
readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
|
|
253
|
+
readonly signaled_at: Schema.Int;
|
|
254
|
+
}>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
|
|
255
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
256
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
257
|
+
};
|
|
258
|
+
readonly cancelled_at: Schema.Int;
|
|
259
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
262
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
263
|
+
};
|
|
264
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
265
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>>;
|
|
266
|
+
export declare const layer: import("effect/Layer").Layer<never, never, ExecutionRepository.Service | EventLog.Service | WaitService.Service | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
|
|
267
|
+
export declare const client: Effect.Effect<(entityId: string) => import("effect/unstable/rpc/RpcClient").RpcClient.From<Rpc.Rpc<"start", Schema.Struct<{
|
|
268
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
269
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
270
|
+
};
|
|
271
|
+
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
272
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
273
|
+
};
|
|
274
|
+
readonly input: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
275
|
+
readonly type: Schema.Literal<"text">;
|
|
276
|
+
readonly text: Schema.String;
|
|
277
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
278
|
+
}>, Schema.Struct<{
|
|
279
|
+
readonly type: Schema.Literal<"structured">;
|
|
280
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
281
|
+
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
282
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
283
|
+
}>, Schema.Struct<{
|
|
284
|
+
readonly type: Schema.Literal<"blob-reference">;
|
|
285
|
+
readonly uri: Schema.String;
|
|
286
|
+
readonly media_type: Schema.String;
|
|
287
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
288
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
289
|
+
}>, Schema.Struct<{
|
|
290
|
+
readonly type: Schema.Literal<"artifact-reference">;
|
|
291
|
+
readonly artifact_id: Schema.String;
|
|
292
|
+
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
293
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
294
|
+
}>, Schema.Struct<{
|
|
295
|
+
readonly type: Schema.Literal<"tool-call">;
|
|
296
|
+
readonly call: Schema.Struct<{
|
|
297
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
298
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
299
|
+
};
|
|
300
|
+
readonly name: Schema.String;
|
|
301
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
302
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
303
|
+
}>;
|
|
304
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
305
|
+
}>, Schema.Struct<{
|
|
306
|
+
readonly type: Schema.Literal<"tool-result">;
|
|
307
|
+
readonly result: Schema.Struct<{
|
|
308
|
+
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
309
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
310
|
+
};
|
|
311
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
312
|
+
readonly error: Schema.optionalKey<Schema.String>;
|
|
313
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
314
|
+
}>;
|
|
315
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
316
|
+
}>]>>>;
|
|
317
|
+
readonly event_sequence: Schema.Int;
|
|
318
|
+
readonly started_at: Schema.Int;
|
|
319
|
+
readonly completed_at: Schema.Int;
|
|
320
|
+
readonly agent_definition_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
|
|
321
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
|
|
322
|
+
}>;
|
|
323
|
+
readonly agent_definition_revision: Schema.optionalKey<Schema.Int>;
|
|
324
|
+
readonly agent_definition_snapshot: Schema.optionalKey<Schema.Struct<{
|
|
325
|
+
readonly name: Schema.String;
|
|
326
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
327
|
+
readonly model: Schema.Struct<{
|
|
328
|
+
readonly provider: Schema.String;
|
|
329
|
+
readonly model: Schema.String;
|
|
330
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
331
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
332
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
333
|
+
}>;
|
|
334
|
+
readonly tool_names: Schema.$Array<Schema.String>;
|
|
335
|
+
readonly permissions: Schema.$Array<Schema.Struct<{
|
|
336
|
+
readonly name: Schema.String;
|
|
337
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
338
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
339
|
+
}>>;
|
|
340
|
+
readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
341
|
+
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
342
|
+
readonly model: Schema.optionalKey<Schema.Struct<{
|
|
343
|
+
readonly provider: Schema.String;
|
|
344
|
+
readonly model: Schema.String;
|
|
345
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
346
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
347
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
348
|
+
}>>;
|
|
349
|
+
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
350
|
+
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
351
|
+
readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
|
|
352
|
+
readonly mode: Schema.Literals<readonly ["share", "fork"]>;
|
|
353
|
+
readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
|
|
354
|
+
}>>;
|
|
355
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
356
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
357
|
+
}>>>;
|
|
358
|
+
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
359
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
360
|
+
}>>;
|
|
361
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
362
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
363
|
+
}>;
|
|
364
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
365
|
+
}>, Schema.Struct<{
|
|
366
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
367
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
368
|
+
};
|
|
369
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
370
|
+
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
371
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
372
|
+
}>;
|
|
373
|
+
readonly wait_state: Schema.optionalKey<Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>>;
|
|
374
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
375
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"signalWait", Schema.Struct<{
|
|
376
|
+
readonly workflow_execution_id: Schema.String;
|
|
377
|
+
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
378
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
379
|
+
};
|
|
380
|
+
readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
|
|
381
|
+
readonly signaled_at: Schema.Int;
|
|
382
|
+
}>, Schema.Void, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never> | Rpc.Rpc<"cancel", Schema.Struct<{
|
|
383
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
384
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
385
|
+
};
|
|
386
|
+
readonly cancelled_at: Schema.Int;
|
|
387
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
388
|
+
}>, Schema.Struct<{
|
|
389
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
390
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
391
|
+
};
|
|
392
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
393
|
+
}>, typeof ExecutionWorkflow.ExecutionWorkflowFailed, never, never>, import("effect/unstable/cluster/ClusterError").MailboxFull | import("effect/unstable/cluster/ClusterError").AlreadyProcessingMessage | import("effect/unstable/cluster/ClusterError").PersistenceError>, never, import("effect/unstable/cluster/Sharding").Sharding>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Content } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
declare const ArtifactNotResolvable_base: Schema.Class<ArtifactNotResolvable, Schema.TaggedStruct<"ArtifactNotResolvable", {
|
|
4
|
+
readonly artifact_id: Schema.String;
|
|
5
|
+
readonly reason: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/**
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export declare class ArtifactNotResolvable extends ArtifactNotResolvable_base {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Artifacts resolve to Content parts (an artifact may be text, structured data,
|
|
14
|
+
* or a blob reference). Resolution is single-level: the assembler resolves any
|
|
15
|
+
* produced `blob-reference` through `BlobStore` in the same pass, but a nested
|
|
16
|
+
* `artifact-reference` is an error.
|
|
17
|
+
*
|
|
18
|
+
* @experimental
|
|
19
|
+
*/
|
|
20
|
+
export interface Interface {
|
|
21
|
+
readonly resolve: (part: Content.ArtifactReferencePart) => Effect.Effect<ReadonlyArray<Content.Part>, ArtifactNotResolvable>;
|
|
22
|
+
}
|
|
23
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ArtifactStore", Interface>;
|
|
24
|
+
/**
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export declare class Service extends Service_base {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Default store: preserves today's behavior — every artifact reference resolves
|
|
31
|
+
* to a single text part carrying the stringified reference.
|
|
32
|
+
*
|
|
33
|
+
* @experimental
|
|
34
|
+
*/
|
|
35
|
+
export declare const passthroughLayer: Layer.Layer<Service>;
|
|
36
|
+
/**
|
|
37
|
+
* Memory store implementation plus a `register` helper for tests.
|
|
38
|
+
*
|
|
39
|
+
* @experimental
|
|
40
|
+
*/
|
|
41
|
+
export interface MemoryInterface extends Interface {
|
|
42
|
+
readonly register: (artifact_id: string, parts: ReadonlyArray<Content.Part>) => Effect.Effect<void>;
|
|
43
|
+
}
|
|
44
|
+
declare const Memory_base: Context.ServiceClass<Memory, "@relayfx/runtime/ArtifactStore/Memory", MemoryInterface>;
|
|
45
|
+
/**
|
|
46
|
+
* @experimental
|
|
47
|
+
*/
|
|
48
|
+
export declare class Memory extends Memory_base {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* In-memory store; `resolve` fails typed when the artifact is unknown. Provides
|
|
52
|
+
* both {@link Service} and {@link Memory} (for `register` in tests).
|
|
53
|
+
*
|
|
54
|
+
* @experimental
|
|
55
|
+
*/
|
|
56
|
+
export declare const memoryLayer: Layer.Layer<Service | Memory>;
|
|
57
|
+
/**
|
|
58
|
+
* Wraps a custom store implementation as a layer.
|
|
59
|
+
*
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
|
|
63
|
+
/**
|
|
64
|
+
* @experimental
|
|
65
|
+
*/
|
|
66
|
+
export declare const resolve: (part: Content.ArtifactReferencePart) => Effect.Effect<readonly Content.Part[], ArtifactNotResolvable, Service>;
|
|
67
|
+
/**
|
|
68
|
+
* Registers artifact parts in the memory store (see {@link memoryLayer}).
|
|
69
|
+
*
|
|
70
|
+
* @experimental
|
|
71
|
+
*/
|
|
72
|
+
export declare const register: (artifact_id: string, parts: readonly Content.Part[]) => Effect.Effect<void, never, Memory>;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Content, Shared } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
declare const BlobNotResolvable_base: Schema.Class<BlobNotResolvable, Schema.TaggedStruct<"BlobNotResolvable", {
|
|
4
|
+
readonly uri: Schema.String;
|
|
5
|
+
readonly reason: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/**
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export declare class BlobNotResolvable extends BlobNotResolvable_base {
|
|
11
|
+
}
|
|
12
|
+
declare const BlobStoreError_base: Schema.Class<BlobStoreError, Schema.TaggedStruct<"BlobStoreError", {
|
|
13
|
+
readonly message: Schema.String;
|
|
14
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
|
+
/**
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export declare class BlobStoreError extends BlobStoreError_base {
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* What a resolved blob looks like to the loop. `Url` means "pass this through to
|
|
22
|
+
* the provider as-is"; `Bytes` means "hand these bytes to the provider".
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
export type ResolvedBlob = {
|
|
27
|
+
readonly _tag: "Bytes";
|
|
28
|
+
readonly bytes: Uint8Array;
|
|
29
|
+
readonly mediaType: string;
|
|
30
|
+
readonly fileName?: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly _tag: "Url";
|
|
33
|
+
readonly url: string;
|
|
34
|
+
readonly mediaType: string;
|
|
35
|
+
readonly fileName?: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @experimental
|
|
39
|
+
*/
|
|
40
|
+
export interface PutBlobInput {
|
|
41
|
+
readonly bytes: Uint8Array;
|
|
42
|
+
readonly mediaType: string;
|
|
43
|
+
readonly fileName?: string;
|
|
44
|
+
readonly metadata?: Shared.Metadata;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @experimental
|
|
48
|
+
*/
|
|
49
|
+
export interface Interface {
|
|
50
|
+
readonly resolve: (part: Content.BlobReferencePart) => Effect.Effect<ResolvedBlob, BlobNotResolvable | BlobStoreError>;
|
|
51
|
+
readonly put: (input: PutBlobInput) => Effect.Effect<Content.BlobReferencePart, BlobStoreError>;
|
|
52
|
+
}
|
|
53
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/BlobStore", Interface>;
|
|
54
|
+
/**
|
|
55
|
+
* @experimental
|
|
56
|
+
*/
|
|
57
|
+
export declare class Service extends Service_base {
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Default store: preserves today's behavior bit-for-bit. `resolve` returns the
|
|
61
|
+
* reference uri as a passthrough `Url`; `put` is unsupported.
|
|
62
|
+
*
|
|
63
|
+
* @experimental
|
|
64
|
+
*/
|
|
65
|
+
export declare const passthroughLayer: Layer.Layer<Service>;
|
|
66
|
+
/**
|
|
67
|
+
* In-memory store. `put` mints monotonic `memory://blob/<n>` uris (no
|
|
68
|
+
* `Math.random`); `resolve` fails typed when the uri is unknown.
|
|
69
|
+
*
|
|
70
|
+
* @experimental
|
|
71
|
+
*/
|
|
72
|
+
export declare const memoryLayer: Layer.Layer<Service>;
|
|
73
|
+
/**
|
|
74
|
+
* Wraps a custom store implementation as a layer.
|
|
75
|
+
*
|
|
76
|
+
* @experimental
|
|
77
|
+
*/
|
|
78
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
|
|
79
|
+
/**
|
|
80
|
+
* @experimental
|
|
81
|
+
*/
|
|
82
|
+
export declare const resolve: (part: Content.BlobReferencePart) => Effect.Effect<ResolvedBlob, BlobNotResolvable | BlobStoreError, Service>;
|
|
83
|
+
/**
|
|
84
|
+
* @experimental
|
|
85
|
+
*/
|
|
86
|
+
export declare const put: (input: PutBlobInput) => Effect.Effect<Content.BlobReferencePart, BlobStoreError, Service>;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Envelope, Execution, Ids } from "../../schema/index";
|
|
2
|
+
import { EnvelopeRepository } from "../../store-sql/index";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import * as AddressBook from "../address/address-book-service";
|
|
5
|
+
import * as EventLog from "../execution/event-log-service";
|
|
6
|
+
declare const EnvelopeAddressNotFound_base: Schema.Class<EnvelopeAddressNotFound, Schema.TaggedStruct<"EnvelopeAddressNotFound", {
|
|
7
|
+
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
8
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
9
|
+
};
|
|
10
|
+
}>, import("effect/Cause").YieldableError>;
|
|
11
|
+
export declare class EnvelopeAddressNotFound extends EnvelopeAddressNotFound_base {
|
|
12
|
+
}
|
|
13
|
+
declare const EnvelopeRouteUnavailable_base: Schema.Class<EnvelopeRouteUnavailable, Schema.TaggedStruct<"EnvelopeRouteUnavailable", {
|
|
14
|
+
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
15
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
16
|
+
};
|
|
17
|
+
readonly route_key: Schema.String;
|
|
18
|
+
}>, import("effect/Cause").YieldableError>;
|
|
19
|
+
export declare class EnvelopeRouteUnavailable extends EnvelopeRouteUnavailable_base {
|
|
20
|
+
}
|
|
21
|
+
declare const EnvelopeRouteDeferred_base: Schema.Class<EnvelopeRouteDeferred, Schema.TaggedStruct<"EnvelopeRouteDeferred", {
|
|
22
|
+
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
23
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
24
|
+
};
|
|
25
|
+
readonly route_key: Schema.String;
|
|
26
|
+
}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
export declare class EnvelopeRouteDeferred extends EnvelopeRouteDeferred_base {
|
|
28
|
+
}
|
|
29
|
+
declare const EnvelopeServiceError_base: Schema.Class<EnvelopeServiceError, Schema.TaggedStruct<"EnvelopeServiceError", {
|
|
30
|
+
readonly message: Schema.String;
|
|
31
|
+
}>, import("effect/Cause").YieldableError>;
|
|
32
|
+
export declare class EnvelopeServiceError extends EnvelopeServiceError_base {
|
|
33
|
+
}
|
|
34
|
+
export interface SendInput {
|
|
35
|
+
readonly envelopeId: Ids.EnvelopeId;
|
|
36
|
+
readonly executionId: Ids.ExecutionId;
|
|
37
|
+
readonly input: Envelope.SendInput;
|
|
38
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
39
|
+
readonly createdAt: number;
|
|
40
|
+
readonly waitId?: Ids.WaitId;
|
|
41
|
+
}
|
|
42
|
+
export interface Interface {
|
|
43
|
+
readonly send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError>;
|
|
44
|
+
}
|
|
45
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EnvelopeService", Interface>;
|
|
46
|
+
export declare class Service extends Service_base {
|
|
47
|
+
}
|
|
48
|
+
export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | AddressBook.Service | EventLog.Service>;
|
|
49
|
+
export declare const memoryLayer: (routes?: Iterable<readonly [Ids.AddressId, AddressBook.Route]>) => Layer.Layer<Service, never, never>;
|
|
50
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
51
|
+
export declare const send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError, Service>;
|
|
52
|
+
export {};
|