@relayfx/sdk 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +1 -1
- package/dist/http-server.js +1 -1
- package/dist/{index-0jx86sx3.js → index-7mmmxqw7.js} +1 -1
- package/dist/{index-96b7htye.js → index-n5sqnw4s.js} +1178 -1070
- package/dist/{index-fh2ftte9.js → index-q7xzf506.js} +6 -0
- package/dist/{index-c6jave5p.js → index-qa93yf6j.js} +1518 -796
- package/dist/index.js +265 -212
- package/dist/mysql.js +4 -4
- package/dist/postgres.js +6 -5
- package/dist/sqlite.js +4 -4
- package/dist/types/relay/client-public-executions.d.ts +2 -2
- package/dist/types/relay/operation.d.ts +4 -4
- package/dist/types/runtime/agent/agent-loop-error.d.ts +2 -2
- package/dist/types/runtime/agent/relay-compaction.d.ts +4 -0
- package/dist/types/schema/execution-schema.d.ts +8 -2
- package/dist/types/store-sql/prompt-wire.d.ts +4 -0
- package/dist/types/store-sql/session/session-entry-records.d.ts +3 -0
- package/dist/types/store-sql/session/session-repository.d.ts +9 -0
- package/package.json +15 -4
package/dist/index.js
CHANGED
|
@@ -14,10 +14,11 @@ import {
|
|
|
14
14
|
exports_tool_runtime,
|
|
15
15
|
exports_workflow_definition_host,
|
|
16
16
|
makeDatabaseIdentity
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-n5sqnw4s.js";
|
|
18
18
|
import {
|
|
19
|
+
exports_context_overflow,
|
|
19
20
|
exports_model_registry
|
|
20
|
-
} from "./index-
|
|
21
|
+
} from "./index-qa93yf6j.js";
|
|
21
22
|
import {
|
|
22
23
|
ClientError,
|
|
23
24
|
EventLogCursorNotFound,
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
exports_wait_schema,
|
|
47
48
|
exports_workflow_schema,
|
|
48
49
|
followExecutionFrom
|
|
49
|
-
} from "./index-
|
|
50
|
+
} from "./index-q7xzf506.js";
|
|
50
51
|
import {
|
|
51
52
|
__export
|
|
52
53
|
} from "./index-nb39b5ae.js";
|
|
@@ -174,77 +175,138 @@ __export(exports_language_model_registration, {
|
|
|
174
175
|
OpenAiAccountCredentialError: () => OpenAiAccountCredentialError
|
|
175
176
|
});
|
|
176
177
|
import { AnthropicLanguageModel as AnthropicLanguageModel2 } from "@effect/ai-anthropic";
|
|
177
|
-
import { OpenAiLanguageModel as
|
|
178
|
+
import { OpenAiLanguageModel as OpenAiLanguageModel3 } from "@effect/ai-openai";
|
|
178
179
|
import { OpenAiLanguageModel as OpenAiCompatibleLanguageModel } from "@effect/ai-openai-compat";
|
|
179
180
|
import { OpenRouterLanguageModel as OpenRouterLanguageModel2 } from "@effect/ai-openrouter";
|
|
180
181
|
|
|
181
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
182
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
|
|
182
183
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
183
|
-
import { Config, Layer as
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
import { Config, Layer as Layer3, Redacted } from "effect";
|
|
185
|
+
|
|
186
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/image-source.js
|
|
187
|
+
import { Effect as Effect3, Encoding, Layer as Layer2, Result, Stream } from "effect";
|
|
188
|
+
import { AiError, LanguageModel, Prompt } from "effect/unstable/ai";
|
|
189
|
+
var imageMediaTypes = new Set(["image/gif", "image/jpeg", "image/png", "image/webp"]);
|
|
190
|
+
var base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
191
|
+
var dataUriPattern = /^data:([^;,]+);base64,(.*)$/s;
|
|
192
|
+
var isImageMediaType = (mediaType) => mediaType.slice(0, 6).toLowerCase() === "image/";
|
|
193
|
+
var fail = (description) => AiError.AiError.make({
|
|
194
|
+
module: "BatonImageSource",
|
|
195
|
+
method: "normalize",
|
|
196
|
+
reason: AiError.InvalidRequestError.make({ description })
|
|
197
|
+
});
|
|
198
|
+
var decodeBase64 = (value) => {
|
|
199
|
+
if (value.length === 0 || !base64Pattern.test(value))
|
|
200
|
+
return Effect3.fail(fail("image data must be valid base64"));
|
|
201
|
+
return Encoding.decodeBase64(value).pipe(Result.mapError(() => fail("image data must be valid base64")), Effect3.fromResult, Effect3.filterOrFail((data) => Encoding.encodeBase64(data) === value, () => fail("image data must use canonical base64 encoding")));
|
|
202
|
+
};
|
|
203
|
+
var normalizePart = (part) => {
|
|
204
|
+
if (!imageMediaTypes.has(part.mediaType)) {
|
|
205
|
+
return Effect3.fail(fail(`unsupported image MIME type: ${part.mediaType}`));
|
|
206
|
+
}
|
|
207
|
+
if (part.data instanceof Uint8Array || part.data instanceof URL)
|
|
208
|
+
return Effect3.succeed(part);
|
|
209
|
+
const dataUri = part.data.match(dataUriPattern);
|
|
210
|
+
if (dataUri !== null && dataUri[1] !== part.mediaType) {
|
|
211
|
+
return Effect3.fail(fail(`image data URI MIME type '${dataUri[1]}' does not match '${part.mediaType}'`));
|
|
212
|
+
}
|
|
213
|
+
const value = dataUri?.[2] ?? part.data;
|
|
214
|
+
if (part.data.startsWith("data:") && dataUri === null) {
|
|
215
|
+
return Effect3.fail(fail("image data URI must use the canonical data:<MIME>;base64,<data> form"));
|
|
216
|
+
}
|
|
217
|
+
return Effect3.map(decodeBase64(value), (data) => ({ ...part, data }));
|
|
218
|
+
};
|
|
219
|
+
var normalizePrompt = Effect3.fnUntraced(function* (input) {
|
|
220
|
+
const prompt = yield* Effect3.try({
|
|
221
|
+
try: () => Prompt.make(input),
|
|
222
|
+
catch: () => fail("prompt contains invalid image data")
|
|
223
|
+
});
|
|
224
|
+
const messages = [];
|
|
225
|
+
for (const message of prompt.content) {
|
|
226
|
+
if (message.role === "assistant" && message.content.some((part) => part.type === "file" && isImageMediaType(part.mediaType))) {
|
|
227
|
+
return yield* fail("image file parts are only supported in user messages");
|
|
228
|
+
}
|
|
229
|
+
if (message.role !== "user") {
|
|
230
|
+
messages.push(message);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
const content = [];
|
|
234
|
+
for (const part of message.content) {
|
|
235
|
+
content.push(part.type === "file" && isImageMediaType(part.mediaType) ? yield* normalizePart(part) : part);
|
|
236
|
+
}
|
|
237
|
+
messages.push({ ...message, content });
|
|
238
|
+
}
|
|
239
|
+
return messages;
|
|
240
|
+
});
|
|
241
|
+
var normalizeOptions = (options) => Effect3.map(normalizePrompt(options.prompt), (prompt) => ({ ...options, prompt }));
|
|
242
|
+
var conformImageSourceModel = (model) => {
|
|
243
|
+
const generateText = model.generateText;
|
|
244
|
+
const generateObject = model.generateObject;
|
|
245
|
+
const streamText = model.streamText;
|
|
246
|
+
return {
|
|
247
|
+
...model,
|
|
248
|
+
generateText: (options) => Effect3.flatMap(normalizeOptions(options), generateText),
|
|
249
|
+
generateObject: (options) => Effect3.flatMap(normalizeOptions(options), generateObject),
|
|
250
|
+
streamText: (options) => Stream.unwrap(Effect3.map(normalizeOptions(options), streamText))
|
|
251
|
+
};
|
|
190
252
|
};
|
|
253
|
+
var layerImageSources = (layer2) => Layer2.effect(LanguageModel.LanguageModel, Effect3.map(LanguageModel.LanguageModel, conformImageSourceModel)).pipe(Layer2.provide(layer2));
|
|
254
|
+
|
|
255
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
|
|
256
|
+
var classifyFailure = exports_context_overflow.classify;
|
|
191
257
|
var layer2 = (input) => exports_model_registry.layer([
|
|
192
258
|
exports_model_registry.registration({
|
|
193
259
|
provider: "anthropic",
|
|
194
260
|
model: input.model,
|
|
195
|
-
layer: AnthropicLanguageModel.layer({
|
|
261
|
+
layer: layerImageSources(AnthropicLanguageModel.layer({
|
|
196
262
|
model: input.model,
|
|
197
263
|
...input.config === undefined ? {} : { config: input.config }
|
|
198
|
-
}),
|
|
264
|
+
})),
|
|
199
265
|
classifyFailure,
|
|
200
266
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
201
267
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
202
268
|
})
|
|
203
|
-
]).pipe(
|
|
269
|
+
]).pipe(Layer3.provide(AnthropicClient.layerConfig({ ...input.clientConfig, apiKey: input.apiKey })));
|
|
204
270
|
var layerConfig = AnthropicClient.layerConfig;
|
|
205
271
|
|
|
206
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
207
|
-
import { OpenAiClient as OpenAiClient2
|
|
208
|
-
import { Config as Config3, Effect as
|
|
209
|
-
import { LanguageModel, Response as Response2 } from "effect/unstable/ai";
|
|
272
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
|
|
273
|
+
import { OpenAiClient as OpenAiClient2 } from "@effect/ai-openai";
|
|
274
|
+
import { Config as Config3, Effect as Effect5, Layer as Layer5, Option as Option2, Stream as Stream3 } from "effect";
|
|
275
|
+
import { LanguageModel as LanguageModel2, Response as Response2 } from "effect/unstable/ai";
|
|
210
276
|
import { HttpClient as HttpClient2 } from "effect/unstable/http";
|
|
211
277
|
|
|
212
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
278
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/openai.js
|
|
213
279
|
import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
214
|
-
import { Config as Config2, Effect as
|
|
215
|
-
import { AiError as AiError2 } from "effect/unstable/ai";
|
|
280
|
+
import { Config as Config2, Effect as Effect4, Function, Layer as Layer4, Option, Redacted as Redacted2, Schema, Stream as Stream2 } from "effect";
|
|
216
281
|
import { FetchHttpClient, Headers, HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/unstable/http";
|
|
217
282
|
var openAiAccountApiUrl = "https://chatgpt.com/backend-api/codex";
|
|
218
283
|
var openAiAccountResponsesUrl = `${openAiAccountApiUrl}/responses`;
|
|
219
284
|
var openAiAccountIdHeader = "ChatGPT-Account-ID";
|
|
220
|
-
var
|
|
221
|
-
var classifyFailure2 = (error) => {
|
|
222
|
-
if (!AiError2.isAiError(error))
|
|
223
|
-
return "other";
|
|
224
|
-
const reason = error.reason;
|
|
225
|
-
if (reason._tag !== "InvalidRequestError" && reason._tag !== "UnknownError")
|
|
226
|
-
return "other";
|
|
227
|
-
const metadata = reason.metadata.openai;
|
|
228
|
-
if (metadata !== null && metadata !== undefined) {
|
|
229
|
-
if (metadata.errorCode !== null && contextOverflowCodes.has(metadata.errorCode) || metadata.errorType !== null && contextOverflowCodes.has(metadata.errorType)) {
|
|
230
|
-
return "context-overflow";
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return reason._tag === "InvalidRequestError" && /maximum context length|context length exceeded|input exceeds (?:the )?context window/i.test(reason.description ?? "") ? "context-overflow" : "other";
|
|
234
|
-
};
|
|
285
|
+
var classifyFailure2 = exports_context_overflow.classify;
|
|
235
286
|
var layer3 = (input) => exports_model_registry.layer([
|
|
236
287
|
exports_model_registry.registration({
|
|
237
288
|
provider: "openai",
|
|
238
289
|
model: input.model,
|
|
239
|
-
layer: OpenAiLanguageModel.layer({
|
|
290
|
+
layer: layerImageSources(OpenAiLanguageModel.layer({
|
|
240
291
|
model: input.model,
|
|
241
292
|
...input.config === undefined ? {} : { config: input.config }
|
|
242
|
-
}),
|
|
293
|
+
})),
|
|
243
294
|
classifyFailure: classifyFailure2,
|
|
244
295
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
245
296
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
246
297
|
})
|
|
247
|
-
]).pipe(
|
|
298
|
+
]).pipe(Layer4.provide(layerConfig2({ ...input.clientConfig, apiKey: input.apiKey })));
|
|
299
|
+
var registration = (input) => exports_model_registry.registration({
|
|
300
|
+
provider: "openai",
|
|
301
|
+
model: input.model,
|
|
302
|
+
layer: layerImageSources(OpenAiLanguageModel.layer({
|
|
303
|
+
model: input.model,
|
|
304
|
+
...input.config === undefined ? {} : { config: input.config }
|
|
305
|
+
})),
|
|
306
|
+
classifyFailure: classifyFailure2,
|
|
307
|
+
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
308
|
+
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
309
|
+
});
|
|
248
310
|
var stringifyJson = Schema.encodeSync(Schema.UnknownFromJsonString);
|
|
249
311
|
var parseJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);
|
|
250
312
|
var dataLinePrefix = /^data: ?/;
|
|
@@ -256,16 +318,19 @@ var flattenErrorPayload = (payload) => {
|
|
|
256
318
|
if (Option.isNone(decoded) || typeof decoded.value !== "object" || decoded.value === null)
|
|
257
319
|
return;
|
|
258
320
|
const record = decoded.value;
|
|
259
|
-
if (record.type !== "error"
|
|
321
|
+
if (record.type !== "error")
|
|
322
|
+
return;
|
|
323
|
+
if (typeof record.message === "string" && "code" in record)
|
|
260
324
|
return;
|
|
261
325
|
const details = record.error;
|
|
262
326
|
if (typeof details !== "object" || details === null || Array.isArray(details))
|
|
263
327
|
return;
|
|
264
328
|
const nested = details;
|
|
329
|
+
const message = typeof nested.message === "string" ? nested.message : record.message;
|
|
265
330
|
return stringifyJson({
|
|
266
331
|
type: "error",
|
|
267
332
|
code: typeof nested.code === "string" ? nested.code : null,
|
|
268
|
-
message: typeof
|
|
333
|
+
message: typeof message === "string" ? message : stringifyJson(nested),
|
|
269
334
|
param: typeof nested.param === "string" ? nested.param : null,
|
|
270
335
|
sequence_number: typeof record.sequence_number === "number" ? record.sequence_number : 0
|
|
271
336
|
});
|
|
@@ -277,17 +342,26 @@ var rewriteFrame = (frame) => {
|
|
|
277
342
|
if (dataLinePrefix.test(segments[index] ?? ""))
|
|
278
343
|
dataIndexes.push(index);
|
|
279
344
|
}
|
|
280
|
-
if (dataIndexes.length
|
|
345
|
+
if (dataIndexes.length === 0)
|
|
281
346
|
return frame;
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
const flattened = flattenErrorPayload(
|
|
347
|
+
const payload = dataIndexes.map((index) => segments[index].replace(dataLinePrefix, "")).join(`
|
|
348
|
+
`);
|
|
349
|
+
const flattened = flattenErrorPayload(payload);
|
|
285
350
|
if (flattened === undefined)
|
|
286
351
|
return frame;
|
|
287
|
-
segments[dataIndexes[0]]
|
|
288
|
-
|
|
352
|
+
const prefix = segments[dataIndexes[0]].match(dataLinePrefix)[0];
|
|
353
|
+
const separator = segments[1] ?? `
|
|
354
|
+
`;
|
|
355
|
+
const rewritten = [];
|
|
356
|
+
for (let index = 0;index < segments.length; index += 2) {
|
|
357
|
+
if (index === dataIndexes[0])
|
|
358
|
+
rewritten.push(`${prefix}${flattened}`);
|
|
359
|
+
else if (!dataLinePrefix.test(segments[index] ?? ""))
|
|
360
|
+
rewritten.push(segments[index]);
|
|
361
|
+
}
|
|
362
|
+
return rewritten.join(separator);
|
|
289
363
|
};
|
|
290
|
-
var normalizeSseErrorFrames = (body) => body.pipe(
|
|
364
|
+
var normalizeSseErrorFrames = (body) => body.pipe(Stream2.decodeText(), Stream2.mapAccum(() => "", (buffer, chunk) => {
|
|
291
365
|
const pieces = (buffer + chunk).split(frameSeparator);
|
|
292
366
|
const tail = pieces.length % 2 === 1 ? pieces.pop() : "";
|
|
293
367
|
const output = [];
|
|
@@ -295,14 +369,13 @@ var normalizeSseErrorFrames = (body) => body.pipe(Stream.decodeText(), Stream.ma
|
|
|
295
369
|
output.push(rewriteFrame(pieces[index]) + pieces[index + 1]);
|
|
296
370
|
}
|
|
297
371
|
return [tail, output];
|
|
298
|
-
}, { onHalt: (buffer) => buffer.length === 0 ? [] : [rewriteFrame(buffer)] }),
|
|
299
|
-
var normalizeResponsesSse = (client) => HttpClient.transformResponse(client, (effect) =>
|
|
300
|
-
|
|
301
|
-
if (!contentType.includes("text/event-stream") || !isResponsesUrl(response.request.url))
|
|
372
|
+
}, { onHalt: (buffer) => buffer.length === 0 ? [] : [rewriteFrame(buffer)] }), Stream2.encodeText);
|
|
373
|
+
var normalizeResponsesSse = (client) => HttpClient.transformResponse(client, (effect) => Effect4.map(effect, (response) => {
|
|
374
|
+
if (!isResponsesUrl(response.request.url))
|
|
302
375
|
return response;
|
|
303
|
-
return HttpClientResponse.fromWeb(response.request, new Response(
|
|
376
|
+
return HttpClientResponse.fromWeb(response.request, new Response(Stream2.toReadableStream(normalizeSseErrorFrames(response.stream)), {
|
|
304
377
|
status: response.status,
|
|
305
|
-
headers: {
|
|
378
|
+
headers: { ...response.headers }
|
|
306
379
|
}));
|
|
307
380
|
}));
|
|
308
381
|
var layerConfig2 = (options) => OpenAiClient.layerConfig({
|
|
@@ -315,12 +388,12 @@ class OpenAiAccountCredentialError extends Schema.TaggedErrorClass()("@batonfx/p
|
|
|
315
388
|
}) {
|
|
316
389
|
}
|
|
317
390
|
var credentialsFromAccountAuthImpl = (service, expectedFingerprint) => {
|
|
318
|
-
const mapCredential = (operation) =>
|
|
319
|
-
const accountCredential = (operation) =>
|
|
391
|
+
const mapCredential = (operation) => Effect4.mapError(() => OpenAiAccountCredentialError.make({ operation }));
|
|
392
|
+
const accountCredential = (operation) => Effect4.flatMap((credential) => credential.fingerprint === expectedFingerprint ? Effect4.succeed({
|
|
320
393
|
accessToken: credential.accessToken,
|
|
321
394
|
accountId: Redacted2.value(credential.accountId),
|
|
322
395
|
generation: credential.generation
|
|
323
|
-
}) :
|
|
396
|
+
}) : Effect4.fail(OpenAiAccountCredentialError.make({ operation })));
|
|
324
397
|
return {
|
|
325
398
|
acquire: service.acquire.pipe(accountCredential("acquire"), mapCredential("acquire")),
|
|
326
399
|
refreshRejected: (generation) => service.refreshRejected(generation).pipe(accountCredential("refreshRejected"), mapCredential("refreshRejected"))
|
|
@@ -339,145 +412,125 @@ var withCredential = (request, credential) => {
|
|
|
339
412
|
const streaming = body._tag === "Uint8Array" && body.contentType === "application/json" && new TextDecoder().decode(body.body).includes('"stream":true');
|
|
340
413
|
return request.pipe(HttpClientRequest.setUrl(openAiAccountResponsesUrl), HttpClientRequest.bearerToken(credential.accessToken), HttpClientRequest.setHeader(openAiAccountIdHeader, credential.accountId), HttpClientRequest.accept(streaming ? "text/event-stream" : "application/json"));
|
|
341
414
|
};
|
|
342
|
-
var executeWithCredential = (client, request, credential) => client.postprocess(
|
|
343
|
-
var accountClientTransform = (credentials) => (client) => HttpClient.transform(client, (_, request) => credentials.acquire.pipe(
|
|
415
|
+
var executeWithCredential = (client, request, credential) => client.postprocess(Effect4.succeed(withCredential(request, credential))).pipe(Effect4.provideService(FetchHttpClient.RequestInit, { redirect: "error" }), Effect4.updateService(Headers.CurrentRedactedNames, (names) => [...names, openAiAccountIdHeader]));
|
|
416
|
+
var accountClientTransform = (credentials) => (client) => HttpClient.transform(client, (_, request) => credentials.acquire.pipe(Effect4.mapError((error) => credentialFailure(request, error)), Effect4.flatMap((credential) => executeWithCredential(client, request, credential).pipe(Effect4.catchIf((error) => error.reason._tag === "StatusCodeError" && error.reason.response.status === 401, (error) => {
|
|
344
417
|
if (error.reason._tag !== "StatusCodeError")
|
|
345
|
-
return
|
|
346
|
-
return
|
|
418
|
+
return Effect4.fail(error);
|
|
419
|
+
return Stream2.runDrain(error.reason.response.stream).pipe(Effect4.ignore, Effect4.andThen(credentials.refreshRejected(credential.generation)), Effect4.mapError((credentialError) => credentialFailure(request, credentialError)), Effect4.flatMap((refreshed) => executeWithCredential(client, request, refreshed)));
|
|
347
420
|
})))));
|
|
348
|
-
var withAccountHeaderRedaction = (effect) => effect.pipe(
|
|
349
|
-
var withoutOpenAiSocket = (effect) => effect.pipe(
|
|
350
|
-
var openAiAccountClientLayer = (credentials) =>
|
|
421
|
+
var withAccountHeaderRedaction = (effect) => effect.pipe(Effect4.updateService(Headers.CurrentRedactedNames, (names) => [...names, openAiAccountIdHeader]));
|
|
422
|
+
var withoutOpenAiSocket = (effect) => effect.pipe(Effect4.provideService(OpenAiClient.OpenAiSocket, null));
|
|
423
|
+
var openAiAccountClientLayer = (credentials) => Layer4.effect(OpenAiClient.OpenAiClient, OpenAiClient.make({
|
|
351
424
|
apiUrl: openAiAccountApiUrl,
|
|
352
425
|
transformClient: (client) => client.pipe(normalizeResponsesSse, accountClientTransform(credentials))
|
|
353
|
-
}).pipe(
|
|
426
|
+
}).pipe(Effect4.map((client) => OpenAiClient.OpenAiClient.of({
|
|
354
427
|
client: client.client,
|
|
355
428
|
createResponse: (options) => withAccountHeaderRedaction(client.createResponse(options)),
|
|
356
|
-
createResponseStream: (options) => client.createResponseStream(options).pipe(withoutOpenAiSocket, withAccountHeaderRedaction,
|
|
429
|
+
createResponseStream: (options) => client.createResponseStream(options).pipe(withoutOpenAiSocket, withAccountHeaderRedaction, Effect4.map(([response, stream]) => [
|
|
357
430
|
response,
|
|
358
|
-
stream.pipe(
|
|
431
|
+
stream.pipe(Stream2.updateService(Headers.CurrentRedactedNames, (names) => [...names, openAiAccountIdHeader]))
|
|
359
432
|
])),
|
|
360
433
|
createEmbedding: (options) => withAccountHeaderRedaction(client.createEmbedding(options))
|
|
361
434
|
}))));
|
|
362
435
|
var registrationAccount = (input) => exports_model_registry.registration({
|
|
363
436
|
provider: "openai",
|
|
364
437
|
model: input.model,
|
|
365
|
-
layer: OpenAiLanguageModel.layer({
|
|
438
|
+
layer: layerImageSources(OpenAiLanguageModel.layer({
|
|
366
439
|
model: input.model,
|
|
367
440
|
...input.config === undefined ? {} : { config: input.config }
|
|
368
|
-
}).pipe(
|
|
441
|
+
})).pipe(Layer4.provide(openAiAccountClientLayer(input.credentials))),
|
|
369
442
|
classifyFailure: classifyFailure2,
|
|
370
443
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
371
444
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
372
445
|
});
|
|
373
446
|
var layerAccount = (input) => exports_model_registry.layer([registrationAccount(input)]);
|
|
374
447
|
|
|
375
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
376
|
-
var deterministicModelLayer =
|
|
377
|
-
generateText: () =>
|
|
378
|
-
streamText: () =>
|
|
448
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
|
|
449
|
+
var deterministicModelLayer = Layer5.effect(LanguageModel2.LanguageModel, LanguageModel2.make({
|
|
450
|
+
generateText: () => Effect5.succeed([{ type: "text", text: "deterministic response" }]),
|
|
451
|
+
streamText: () => Stream3.make(Response2.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
379
452
|
}));
|
|
380
|
-
var
|
|
453
|
+
var registration2 = (input = {}) => exports_model_registry.registration({
|
|
381
454
|
provider: input.provider ?? "deterministic",
|
|
382
455
|
model: input.model ?? "deterministic",
|
|
383
456
|
layer: deterministicModelLayer,
|
|
384
457
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
385
458
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
386
459
|
});
|
|
387
|
-
var layer4 = (input = {}) => exports_model_registry.layer([
|
|
388
|
-
var layerOpenAi = (options) =>
|
|
389
|
-
const deterministic = yield*
|
|
460
|
+
var layer4 = (input = {}) => exports_model_registry.layer([registration2(input)]);
|
|
461
|
+
var layerOpenAi = (options) => Layer5.unwrap(Effect5.gen(function* () {
|
|
462
|
+
const deterministic = yield* registration2({
|
|
390
463
|
provider: options.fallbackProvider ?? "deterministic",
|
|
391
464
|
model: options.fallbackModel
|
|
392
465
|
});
|
|
393
466
|
const configuredApiKey = yield* Config3.option(options.apiKey);
|
|
394
467
|
const openAiRegistration = yield* Option2.match(configuredApiKey, {
|
|
395
|
-
onNone: () =>
|
|
396
|
-
onSome: (apiKey) =>
|
|
468
|
+
onNone: () => Effect5.succeedNone,
|
|
469
|
+
onSome: (apiKey) => Layer5.build(OpenAiClient2.layerConfig({
|
|
397
470
|
...options.clientConfig,
|
|
398
471
|
apiKey: Config3.succeed(apiKey)
|
|
399
|
-
})).pipe(
|
|
400
|
-
provider: "openai",
|
|
472
|
+
})).pipe(Effect5.flatMap((context) => registration({
|
|
401
473
|
model: options.model,
|
|
402
|
-
|
|
403
|
-
model: options.model,
|
|
404
|
-
...options.config === undefined ? {} : { config: options.config }
|
|
405
|
-
}),
|
|
406
|
-
classifyFailure: classifyFailure2,
|
|
474
|
+
...options.config === undefined ? {} : { config: options.config },
|
|
407
475
|
...options.registrationKey === undefined ? {} : { registrationKey: options.registrationKey },
|
|
408
476
|
...options.metadata === undefined ? {} : { metadata: options.metadata }
|
|
409
|
-
}).pipe(
|
|
477
|
+
}).pipe(Effect5.provide(context))), Effect5.asSome)
|
|
410
478
|
});
|
|
411
479
|
return exports_model_registry.layer([
|
|
412
|
-
|
|
413
|
-
...Option2.isSome(openAiRegistration) ? [
|
|
480
|
+
Effect5.succeed(deterministic),
|
|
481
|
+
...Option2.isSome(openAiRegistration) ? [Effect5.succeed(openAiRegistration.value)] : []
|
|
414
482
|
]);
|
|
415
483
|
}));
|
|
416
484
|
|
|
417
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
418
|
-
import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as
|
|
419
|
-
import { Config as Config4, Layer as
|
|
485
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/openai-compat.js
|
|
486
|
+
import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
487
|
+
import { Config as Config4, Layer as Layer6, Redacted as Redacted3 } from "effect";
|
|
420
488
|
var layer5 = (input) => exports_model_registry.layer([
|
|
421
489
|
exports_model_registry.registration({
|
|
422
490
|
provider: input.provider ?? "openai-compatible",
|
|
423
491
|
model: input.model,
|
|
424
|
-
layer:
|
|
492
|
+
layer: layerImageSources(OpenAiLanguageModel2.layer({
|
|
425
493
|
model: input.model,
|
|
426
494
|
...input.config === undefined ? {} : { config: input.config }
|
|
427
|
-
}),
|
|
495
|
+
})),
|
|
428
496
|
...input.classifyFailure === undefined ? {} : { classifyFailure: input.classifyFailure },
|
|
429
497
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
430
498
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
431
499
|
})
|
|
432
|
-
]).pipe(
|
|
500
|
+
]).pipe(Layer6.provide(OpenAiClient3.layerConfig({
|
|
433
501
|
...input.clientConfig,
|
|
434
502
|
...input.apiKey === undefined ? {} : { apiKey: input.apiKey },
|
|
435
503
|
...input.baseUrl === undefined ? {} : { apiUrl: Config4.succeed(input.baseUrl) }
|
|
436
504
|
})));
|
|
437
505
|
var layerConfig3 = OpenAiClient3.layerConfig;
|
|
438
506
|
|
|
439
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
507
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/openrouter.js
|
|
440
508
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
441
|
-
import { Config as Config5, Layer as
|
|
442
|
-
|
|
443
|
-
var contextOverflowCodes2 = new Set(["context_length_exceeded", "context_window_exceeded", "input_too_long"]);
|
|
444
|
-
var classifyFailure3 = (error) => {
|
|
445
|
-
if (!AiError3.isAiError(error))
|
|
446
|
-
return "other";
|
|
447
|
-
const reason = error.reason;
|
|
448
|
-
if (reason._tag !== "InvalidRequestError" && reason._tag !== "UnknownError")
|
|
449
|
-
return "other";
|
|
450
|
-
const metadata = reason.metadata.openrouter;
|
|
451
|
-
if (metadata !== null && metadata !== undefined) {
|
|
452
|
-
if (typeof metadata.errorCode === "string" && contextOverflowCodes2.has(metadata.errorCode) || metadata.errorType !== null && contextOverflowCodes2.has(metadata.errorType)) {
|
|
453
|
-
return "context-overflow";
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
return reason._tag === "InvalidRequestError" && /maximum context length|context length exceeded|input exceeds (?:the )?context window|prompt is too long/i.test(reason.description ?? "") ? "context-overflow" : "other";
|
|
457
|
-
};
|
|
509
|
+
import { Config as Config5, Layer as Layer7, Redacted as Redacted4 } from "effect";
|
|
510
|
+
var classifyFailure3 = exports_context_overflow.classify;
|
|
458
511
|
var layer6 = (input) => exports_model_registry.layer([
|
|
459
512
|
exports_model_registry.registration({
|
|
460
513
|
provider: "openrouter",
|
|
461
514
|
model: input.model,
|
|
462
|
-
layer: OpenRouterLanguageModel.layer({
|
|
515
|
+
layer: layerImageSources(OpenRouterLanguageModel.layer({
|
|
463
516
|
model: input.model,
|
|
464
517
|
...input.config === undefined ? {} : { config: input.config }
|
|
465
|
-
}),
|
|
518
|
+
})),
|
|
466
519
|
classifyFailure: classifyFailure3,
|
|
467
520
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
468
521
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
469
522
|
})
|
|
470
|
-
]).pipe(
|
|
523
|
+
]).pipe(Layer7.provide(OpenRouterClient.layerConfig({ ...input.clientConfig, apiKey: input.apiKey })));
|
|
471
524
|
var layerConfig4 = OpenRouterClient.layerConfig;
|
|
472
525
|
|
|
473
526
|
// src/language-model-registration.ts
|
|
474
|
-
import { Layer as
|
|
527
|
+
import { Layer as Layer8 } from "effect";
|
|
475
528
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
476
|
-
var deterministicModel = (input) =>
|
|
529
|
+
var deterministicModel = (input) => registration2(input);
|
|
477
530
|
var openAi = (input) => exports_model_registry.registration({
|
|
478
531
|
provider: "openai",
|
|
479
532
|
model: input.model,
|
|
480
|
-
layer:
|
|
533
|
+
layer: OpenAiLanguageModel3.layer({
|
|
481
534
|
model: input.model,
|
|
482
535
|
...input.config === undefined ? {} : { config: input.config }
|
|
483
536
|
}),
|
|
@@ -518,11 +571,11 @@ var openAiCompatible = (input) => exports_model_registry.registration({
|
|
|
518
571
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
519
572
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
520
573
|
});
|
|
521
|
-
var withOpenAiFetch = (input) => layer3(input).pipe(
|
|
522
|
-
var withAnthropicFetch = (input) => layer2(input).pipe(
|
|
523
|
-
var withOpenRouterFetch = (input) => layer6(input).pipe(
|
|
524
|
-
var withOpenAiCompatibleFetch = (input) => layer5(input).pipe(
|
|
525
|
-
var withOpenAiAccountFetch = (input) => layerAccount(input).pipe(
|
|
574
|
+
var withOpenAiFetch = (input) => layer3(input).pipe(Layer8.provide(FetchHttpClient2.layer));
|
|
575
|
+
var withAnthropicFetch = (input) => layer2(input).pipe(Layer8.provide(FetchHttpClient2.layer));
|
|
576
|
+
var withOpenRouterFetch = (input) => layer6(input).pipe(Layer8.provide(FetchHttpClient2.layer));
|
|
577
|
+
var withOpenAiCompatibleFetch = (input) => layer5(input).pipe(Layer8.provide(FetchHttpClient2.layer));
|
|
578
|
+
var withOpenAiAccountFetch = (input) => layerAccount(input).pipe(Layer8.provide(FetchHttpClient2.layer));
|
|
526
579
|
|
|
527
580
|
// src/client.ts
|
|
528
581
|
var exports_client = {};
|
|
@@ -553,326 +606,326 @@ __export(exports_client, {
|
|
|
553
606
|
});
|
|
554
607
|
|
|
555
608
|
// src/client-public-agents.ts
|
|
556
|
-
import { Effect as
|
|
557
|
-
var registerAgentDefinition =
|
|
609
|
+
import { Effect as Effect6 } from "effect";
|
|
610
|
+
var registerAgentDefinition = Effect6.fn("Client.registerAgentDefinition.call")(function* (input) {
|
|
558
611
|
const service = yield* Service;
|
|
559
612
|
return yield* service.agents.registerDefinition(input);
|
|
560
613
|
});
|
|
561
614
|
function registerAgent(input) {
|
|
562
|
-
return
|
|
615
|
+
return Effect6.gen(function* () {
|
|
563
616
|
const service = yield* Service;
|
|
564
617
|
if (isRegisterBatonAgentInput(input))
|
|
565
618
|
return yield* service.agents.register(input);
|
|
566
619
|
return yield* service.agents.register(input);
|
|
567
|
-
}).pipe(
|
|
620
|
+
}).pipe(Effect6.withSpan("Client.registerAgent.call"));
|
|
568
621
|
}
|
|
569
622
|
var isRegisterBatonAgentInput = (input) => ("agent" in input);
|
|
570
|
-
var getAgentDefinition =
|
|
623
|
+
var getAgentDefinition = Effect6.fn("Client.getAgentDefinition.call")(function* (id) {
|
|
571
624
|
const service = yield* Service;
|
|
572
625
|
return yield* service.agents.getDefinition(id);
|
|
573
626
|
});
|
|
574
|
-
var listAgentDefinitions =
|
|
627
|
+
var listAgentDefinitions = Effect6.fn("Client.listAgentDefinitions.call")(function* () {
|
|
575
628
|
const service = yield* Service;
|
|
576
629
|
return yield* service.agents.listDefinitions();
|
|
577
630
|
});
|
|
578
|
-
var listAgentDefinitionRevisions =
|
|
631
|
+
var listAgentDefinitionRevisions = Effect6.fn("Client.listAgentDefinitionRevisions.call")(function* (id) {
|
|
579
632
|
const service = yield* Service;
|
|
580
633
|
return yield* service.agents.listDefinitionRevisions(id);
|
|
581
634
|
});
|
|
582
|
-
var getSkillDefinition =
|
|
635
|
+
var getSkillDefinition = Effect6.fn("Client.getSkillDefinition.call")(function* (id) {
|
|
583
636
|
const service = yield* Service;
|
|
584
637
|
return yield* service.skills.getDefinition(id);
|
|
585
638
|
});
|
|
586
|
-
var listSkillDefinitions =
|
|
639
|
+
var listSkillDefinitions = Effect6.fn("Client.listSkillDefinitions.call")(function* () {
|
|
587
640
|
const service = yield* Service;
|
|
588
641
|
return yield* service.skills.listDefinitions();
|
|
589
642
|
});
|
|
590
|
-
var listSkillDefinitionRevisions =
|
|
643
|
+
var listSkillDefinitionRevisions = Effect6.fn("Client.listSkillDefinitionRevisions.call")(function* (id) {
|
|
591
644
|
const service = yield* Service;
|
|
592
645
|
return yield* service.skills.listDefinitionRevisions(id);
|
|
593
646
|
});
|
|
594
647
|
|
|
595
648
|
// src/client-public-child-runs.ts
|
|
596
|
-
import { Effect as
|
|
597
|
-
var spawnChildRun =
|
|
649
|
+
import { Effect as Effect7 } from "effect";
|
|
650
|
+
var spawnChildRun = Effect7.fn("Client.spawnChildRun.call")(function* (input) {
|
|
598
651
|
const service = yield* Service;
|
|
599
652
|
return yield* service.childRuns.spawn(input);
|
|
600
653
|
});
|
|
601
|
-
var createChildFanOut =
|
|
654
|
+
var createChildFanOut = Effect7.fn("Client.createChildFanOut.call")(function* (input) {
|
|
602
655
|
const service = yield* Service;
|
|
603
656
|
return yield* service.childRuns.createFanOut(input);
|
|
604
657
|
});
|
|
605
|
-
var cancelChildFanOut =
|
|
658
|
+
var cancelChildFanOut = Effect7.fn("Client.cancelChildFanOut.call")(function* (input) {
|
|
606
659
|
const service = yield* Service;
|
|
607
660
|
return yield* service.childRuns.cancelFanOut(input);
|
|
608
661
|
});
|
|
609
|
-
var inspectChildFanOut =
|
|
662
|
+
var inspectChildFanOut = Effect7.fn("Client.inspectChildFanOut.call")(function* (input) {
|
|
610
663
|
const service = yield* Service;
|
|
611
664
|
return yield* service.childRuns.inspectFanOut(input);
|
|
612
665
|
});
|
|
613
666
|
|
|
614
667
|
// src/client-public-envelope-ready.ts
|
|
615
|
-
import { Effect as
|
|
616
|
-
var claimEnvelopeReady =
|
|
668
|
+
import { Effect as Effect8 } from "effect";
|
|
669
|
+
var claimEnvelopeReady = Effect8.fn("Client.claimEnvelopeReady.call")(function* (input) {
|
|
617
670
|
const service = yield* Service;
|
|
618
671
|
return yield* service.envelopes.claimReady(input);
|
|
619
672
|
});
|
|
620
|
-
var ackEnvelopeReady =
|
|
673
|
+
var ackEnvelopeReady = Effect8.fn("Client.ackEnvelopeReady.call")(function* (input) {
|
|
621
674
|
const service = yield* Service;
|
|
622
675
|
return yield* service.envelopes.ackReady(input);
|
|
623
676
|
});
|
|
624
|
-
var releaseEnvelopeReady =
|
|
677
|
+
var releaseEnvelopeReady = Effect8.fn("Client.releaseEnvelopeReady.call")(function* (input) {
|
|
625
678
|
const service = yield* Service;
|
|
626
679
|
return yield* service.envelopes.releaseReady(input);
|
|
627
680
|
});
|
|
628
681
|
|
|
629
682
|
// src/client-public-executions.ts
|
|
630
|
-
import { Effect as
|
|
631
|
-
var startExecution =
|
|
683
|
+
import { Effect as Effect9, Stream as Stream4 } from "effect";
|
|
684
|
+
var startExecution = Effect9.fn("Client.startExecution.call")(function* (input) {
|
|
632
685
|
const service = yield* Service;
|
|
633
686
|
return yield* service.executions.start(input);
|
|
634
687
|
});
|
|
635
|
-
var startExecutionByAddress =
|
|
688
|
+
var startExecutionByAddress = Effect9.fn("Client.startExecutionByAddress.call")(function* (input) {
|
|
636
689
|
const service = yield* Service;
|
|
637
690
|
return yield* service.executions.startByAddress(input);
|
|
638
691
|
});
|
|
639
|
-
var startExecutionByAgentDefinition =
|
|
692
|
+
var startExecutionByAgentDefinition = Effect9.fn("Client.startExecutionByAgentDefinition.call")(function* (input) {
|
|
640
693
|
const service = yield* Service;
|
|
641
694
|
return yield* service.executions.startByAgentDefinition(input);
|
|
642
695
|
});
|
|
643
|
-
var cancelExecution =
|
|
696
|
+
var cancelExecution = Effect9.fn("Client.cancelExecution.call")(function* (input) {
|
|
644
697
|
const service = yield* Service;
|
|
645
698
|
return yield* service.executions.cancel(input);
|
|
646
699
|
});
|
|
647
|
-
var steer =
|
|
700
|
+
var steer = Effect9.fn("Client.steer.call")(function* (input) {
|
|
648
701
|
const service = yield* Service;
|
|
649
702
|
return yield* service.executions.steer(input);
|
|
650
703
|
});
|
|
651
|
-
var getExecution =
|
|
704
|
+
var getExecution = Effect9.fn("Client.getExecution.call")(function* (id) {
|
|
652
705
|
const service = yield* Service;
|
|
653
706
|
return yield* service.executions.get(id);
|
|
654
707
|
});
|
|
655
|
-
var listExecutions =
|
|
708
|
+
var listExecutions = Effect9.fn("Client.listExecutions.call")(function* (input) {
|
|
656
709
|
const service = yield* Service;
|
|
657
710
|
return yield* service.executions.list(input);
|
|
658
711
|
});
|
|
659
|
-
var listSessions =
|
|
712
|
+
var listSessions = Effect9.fn("Client.listSessions.call")(function* (input) {
|
|
660
713
|
const service = yield* Service;
|
|
661
714
|
return yield* service.sessions.list(input);
|
|
662
715
|
});
|
|
663
|
-
var getSession =
|
|
716
|
+
var getSession = Effect9.fn("Client.getSession.call")(function* (input) {
|
|
664
717
|
const service = yield* Service;
|
|
665
718
|
return yield* service.sessions.get(input);
|
|
666
719
|
});
|
|
667
|
-
var listWaits =
|
|
720
|
+
var listWaits = Effect9.fn("Client.listWaits.call")(function* (input) {
|
|
668
721
|
const service = yield* Service;
|
|
669
722
|
return yield* service.waits.list(input);
|
|
670
723
|
});
|
|
671
|
-
var replayExecution =
|
|
724
|
+
var replayExecution = Effect9.fn("Client.replayExecution.call")(function* (input) {
|
|
672
725
|
const service = yield* Service;
|
|
673
726
|
return yield* service.executions.replay(input);
|
|
674
727
|
});
|
|
675
|
-
var pageExecutionEvents =
|
|
728
|
+
var pageExecutionEvents = Effect9.fn("Client.pageExecutionEvents.call")(function* (input) {
|
|
676
729
|
const service = yield* Service;
|
|
677
730
|
return yield* service.executions.pageEvents(input);
|
|
678
731
|
});
|
|
679
|
-
var listRunners =
|
|
732
|
+
var listRunners = Effect9.fn("Client.listRunners.call")(function* () {
|
|
680
733
|
const service = yield* Service;
|
|
681
734
|
return yield* service.runners.list();
|
|
682
735
|
});
|
|
683
|
-
var routeExecution =
|
|
736
|
+
var routeExecution = Effect9.fn("Client.routeExecution.call")(function* (executionId) {
|
|
684
737
|
const service = yield* Service;
|
|
685
738
|
return yield* service.executions.route(executionId);
|
|
686
739
|
});
|
|
687
|
-
var inspectExecution =
|
|
740
|
+
var inspectExecution = Effect9.fn("Client.inspectExecution.call")(function* (executionId) {
|
|
688
741
|
const service = yield* Service;
|
|
689
742
|
return yield* service.executions.inspect(executionId);
|
|
690
743
|
});
|
|
691
|
-
var streamExecution = (input) =>
|
|
692
|
-
var followExecution = (input) =>
|
|
693
|
-
var streamSession = (input) =>
|
|
694
|
-
var watchExecutions = (input) =>
|
|
744
|
+
var streamExecution = (input) => Stream4.unwrap(Service.pipe(Effect9.map((service) => service.executions.stream(input))));
|
|
745
|
+
var followExecution = (input) => Stream4.unwrap(Service.pipe(Effect9.map((service) => service.executions.follow(input))));
|
|
746
|
+
var streamSession = (input) => Stream4.unwrap(Service.pipe(Effect9.map((service) => service.sessions.stream(input))));
|
|
747
|
+
var watchExecutions = (input) => Stream4.unwrap(Service.pipe(Effect9.map((service) => service.executions.watch(input))));
|
|
695
748
|
|
|
696
749
|
// src/client-public-messaging.ts
|
|
697
|
-
import { Effect as
|
|
698
|
-
var registerAddressBookRoute =
|
|
750
|
+
import { Effect as Effect10, Stream as Stream5 } from "effect";
|
|
751
|
+
var registerAddressBookRoute = Effect10.fn("Client.registerAddressBookRoute.call")(function* (input) {
|
|
699
752
|
const service = yield* Service;
|
|
700
753
|
return yield* service.addressBook.register(input);
|
|
701
754
|
});
|
|
702
|
-
var getAddressBookRoute =
|
|
755
|
+
var getAddressBookRoute = Effect10.fn("Client.getAddressBookRoute.call")(function* (id) {
|
|
703
756
|
const service = yield* Service;
|
|
704
757
|
return yield* service.addressBook.get(id);
|
|
705
758
|
});
|
|
706
|
-
var listAddressBookRoutes =
|
|
759
|
+
var listAddressBookRoutes = Effect10.fn("Client.listAddressBookRoutes.call")(function* () {
|
|
707
760
|
const service = yield* Service;
|
|
708
761
|
return yield* service.addressBook.list();
|
|
709
762
|
});
|
|
710
|
-
var subscribeTopic =
|
|
763
|
+
var subscribeTopic = Effect10.fn("Client.subscribeTopic.call")(function* (input) {
|
|
711
764
|
const service = yield* Service;
|
|
712
765
|
return yield* service.topics.subscribe(input);
|
|
713
766
|
});
|
|
714
|
-
var unsubscribeTopic =
|
|
767
|
+
var unsubscribeTopic = Effect10.fn("Client.unsubscribeTopic.call")(function* (input) {
|
|
715
768
|
const service = yield* Service;
|
|
716
769
|
return yield* service.topics.unsubscribe(input);
|
|
717
770
|
});
|
|
718
|
-
var publishTopic =
|
|
771
|
+
var publishTopic = Effect10.fn("Client.publishTopic.call")(function* (input) {
|
|
719
772
|
const service = yield* Service;
|
|
720
773
|
return yield* service.topics.publish(input);
|
|
721
774
|
});
|
|
722
|
-
var listTopicSubscriptions =
|
|
775
|
+
var listTopicSubscriptions = Effect10.fn("Client.listTopicSubscriptions.call")(function* (input) {
|
|
723
776
|
const service = yield* Service;
|
|
724
777
|
return yield* service.topics.listSubscriptions(input);
|
|
725
778
|
});
|
|
726
|
-
var listInboxMessages =
|
|
779
|
+
var listInboxMessages = Effect10.fn("Client.listInboxMessages.call")(function* (input) {
|
|
727
780
|
const service = yield* Service;
|
|
728
781
|
return yield* service.envelopes.listInbox(input);
|
|
729
782
|
});
|
|
730
|
-
var send =
|
|
783
|
+
var send = Effect10.fn("Client.send.call")(function* (input) {
|
|
731
784
|
const service = yield* Service;
|
|
732
785
|
return yield* service.envelopes.send(input);
|
|
733
786
|
});
|
|
734
|
-
var getPresence =
|
|
787
|
+
var getPresence = Effect10.fn("Client.getPresence.call")(function* (scope) {
|
|
735
788
|
const service = yield* Service;
|
|
736
789
|
return yield* service.presence.get(scope);
|
|
737
790
|
});
|
|
738
|
-
var watchPresence = (scope) =>
|
|
739
|
-
var wake =
|
|
791
|
+
var watchPresence = (scope) => Stream5.unwrap(Service.pipe(Effect10.map((service) => service.presence.watch(scope))));
|
|
792
|
+
var wake = Effect10.fn("Client.wake.call")(function* (input) {
|
|
740
793
|
const service = yield* Service;
|
|
741
794
|
return yield* service.waits.wake(input);
|
|
742
795
|
});
|
|
743
|
-
var submitInboundEnvelope =
|
|
796
|
+
var submitInboundEnvelope = Effect10.fn("Client.submitInboundEnvelope.call")(function* (input) {
|
|
744
797
|
const service = yield* Service;
|
|
745
798
|
return yield* service.envelopes.submitInbound(input);
|
|
746
799
|
});
|
|
747
|
-
var awaitWait =
|
|
800
|
+
var awaitWait = Effect10.fn("Client.awaitWait.call")(function* (input) {
|
|
748
801
|
const service = yield* Service;
|
|
749
802
|
return yield* service.waits.await(input);
|
|
750
803
|
});
|
|
751
804
|
|
|
752
805
|
// src/client-public-residents.ts
|
|
753
|
-
import { Effect as
|
|
754
|
-
var registerResidentKind =
|
|
806
|
+
import { Effect as Effect11 } from "effect";
|
|
807
|
+
var registerResidentKind = Effect11.fn("Client.registerResidentKind.call")(function* (input) {
|
|
755
808
|
const service = yield* Service;
|
|
756
809
|
return yield* service.residents.registerKind(input);
|
|
757
810
|
});
|
|
758
|
-
var spawnResident =
|
|
811
|
+
var spawnResident = Effect11.fn("Client.spawnResident.call")(function* (input) {
|
|
759
812
|
const service = yield* Service;
|
|
760
813
|
return yield* service.residents.spawn(input);
|
|
761
814
|
});
|
|
762
|
-
var getResident =
|
|
815
|
+
var getResident = Effect11.fn("Client.getResident.call")(function* (input) {
|
|
763
816
|
const service = yield* Service;
|
|
764
817
|
return yield* service.residents.get(input);
|
|
765
818
|
});
|
|
766
|
-
var destroyResident =
|
|
819
|
+
var destroyResident = Effect11.fn("Client.destroyResident.call")(function* (input) {
|
|
767
820
|
const service = yield* Service;
|
|
768
821
|
return yield* service.residents.destroy(input);
|
|
769
822
|
});
|
|
770
|
-
var listResidents =
|
|
823
|
+
var listResidents = Effect11.fn("Client.listResidents.call")(function* (input) {
|
|
771
824
|
const service = yield* Service;
|
|
772
825
|
return yield* service.residents.list(input);
|
|
773
826
|
});
|
|
774
|
-
var askResident =
|
|
827
|
+
var askResident = Effect11.fn("Client.askResident.call")(function* (input) {
|
|
775
828
|
const service = yield* Service;
|
|
776
829
|
return yield* service.residents.ask(input);
|
|
777
830
|
});
|
|
778
|
-
var getResidentState =
|
|
831
|
+
var getResidentState = Effect11.fn("Client.getResidentState.call")(function* (input) {
|
|
779
832
|
const service = yield* Service;
|
|
780
833
|
return yield* service.residents.getState(input);
|
|
781
834
|
});
|
|
782
|
-
var putResidentState =
|
|
835
|
+
var putResidentState = Effect11.fn("Client.putResidentState.call")(function* (input) {
|
|
783
836
|
const service = yield* Service;
|
|
784
837
|
return yield* service.residents.putState(input);
|
|
785
838
|
});
|
|
786
|
-
var deleteResidentState =
|
|
839
|
+
var deleteResidentState = Effect11.fn("Client.deleteResidentState.call")(function* (input) {
|
|
787
840
|
const service = yield* Service;
|
|
788
841
|
return yield* service.residents.deleteState(input);
|
|
789
842
|
});
|
|
790
|
-
var listResidentState =
|
|
843
|
+
var listResidentState = Effect11.fn("Client.listResidentState.call")(function* (input) {
|
|
791
844
|
const service = yield* Service;
|
|
792
845
|
return yield* service.residents.listState(input);
|
|
793
846
|
});
|
|
794
847
|
|
|
795
848
|
// src/client-public-schedules.ts
|
|
796
|
-
import { Effect as
|
|
797
|
-
var createSchedule =
|
|
849
|
+
import { Effect as Effect12 } from "effect";
|
|
850
|
+
var createSchedule = Effect12.fn("Client.createSchedule.call")(function* (input) {
|
|
798
851
|
const service = yield* Service;
|
|
799
852
|
return yield* service.schedules.create(input);
|
|
800
853
|
});
|
|
801
|
-
var cancelSchedule =
|
|
854
|
+
var cancelSchedule = Effect12.fn("Client.cancelSchedule.call")(function* (input) {
|
|
802
855
|
const service = yield* Service;
|
|
803
856
|
return yield* service.schedules.cancel(input);
|
|
804
857
|
});
|
|
805
|
-
var listSchedules =
|
|
858
|
+
var listSchedules = Effect12.fn("Client.listSchedules.call")(function* (input) {
|
|
806
859
|
const service = yield* Service;
|
|
807
860
|
return yield* service.schedules.list(input);
|
|
808
861
|
});
|
|
809
862
|
|
|
810
863
|
// src/client-public-tools.ts
|
|
811
|
-
import { Effect as
|
|
812
|
-
var listPendingApprovals =
|
|
864
|
+
import { Effect as Effect13 } from "effect";
|
|
865
|
+
var listPendingApprovals = Effect13.fn("Client.listPendingApprovals.call")(function* (input) {
|
|
813
866
|
const service = yield* Service;
|
|
814
867
|
return yield* service.tools.listPendingApprovals(input);
|
|
815
868
|
});
|
|
816
|
-
var resolveToolApproval =
|
|
869
|
+
var resolveToolApproval = Effect13.fn("Client.resolveToolApproval.call")(function* (input) {
|
|
817
870
|
const service = yield* Service;
|
|
818
871
|
return yield* service.tools.resolveApproval(input);
|
|
819
872
|
});
|
|
820
|
-
var resolvePermission =
|
|
873
|
+
var resolvePermission = Effect13.fn("Client.resolvePermission.call")(function* (input) {
|
|
821
874
|
const service = yield* Service;
|
|
822
875
|
return yield* service.tools.resolvePermission(input);
|
|
823
876
|
});
|
|
824
|
-
var listPendingToolCalls =
|
|
877
|
+
var listPendingToolCalls = Effect13.fn("Client.listPendingToolCalls.call")(function* (input) {
|
|
825
878
|
const service = yield* Service;
|
|
826
879
|
return yield* service.tools.listPending(input);
|
|
827
880
|
});
|
|
828
|
-
var fulfillToolCall =
|
|
881
|
+
var fulfillToolCall = Effect13.fn("Client.fulfillToolCall.call")(function* (input) {
|
|
829
882
|
const service = yield* Service;
|
|
830
883
|
return yield* service.tools.fulfill(input);
|
|
831
884
|
});
|
|
832
|
-
var claimToolWork =
|
|
885
|
+
var claimToolWork = Effect13.fn("Client.claimToolWork.call")(function* (input) {
|
|
833
886
|
const service = yield* Service;
|
|
834
887
|
return yield* service.tools.claimWork(input);
|
|
835
888
|
});
|
|
836
|
-
var completeToolWork =
|
|
889
|
+
var completeToolWork = Effect13.fn("Client.completeToolWork.call")(function* (input) {
|
|
837
890
|
const service = yield* Service;
|
|
838
891
|
return yield* service.tools.completeWork(input);
|
|
839
892
|
});
|
|
840
|
-
var releaseToolWork =
|
|
893
|
+
var releaseToolWork = Effect13.fn("Client.releaseToolWork.call")(function* (input) {
|
|
841
894
|
const service = yield* Service;
|
|
842
895
|
return yield* service.tools.releaseWork(input);
|
|
843
896
|
});
|
|
844
|
-
var listToolAttempts =
|
|
897
|
+
var listToolAttempts = Effect13.fn("Client.listToolAttempts.call")(function* (input) {
|
|
845
898
|
const service = yield* Service;
|
|
846
899
|
return yield* service.tools.listAttempts(input);
|
|
847
900
|
});
|
|
848
901
|
|
|
849
902
|
// src/client-public-workflows.ts
|
|
850
|
-
import { Effect as
|
|
851
|
-
var registerWorkflowDefinition =
|
|
903
|
+
import { Effect as Effect14 } from "effect";
|
|
904
|
+
var registerWorkflowDefinition = Effect14.fn("Client.registerWorkflowDefinition.call")(function* (input) {
|
|
852
905
|
const service = yield* Service;
|
|
853
906
|
return yield* service.workflows.registerDefinition(input);
|
|
854
907
|
});
|
|
855
|
-
var getWorkflowDefinitionRevision =
|
|
908
|
+
var getWorkflowDefinitionRevision = Effect14.fn("Client.getWorkflowDefinitionRevision.call")(function* (id, revision) {
|
|
856
909
|
const service = yield* Service;
|
|
857
910
|
return yield* service.workflows.getDefinitionRevision(id, revision);
|
|
858
911
|
});
|
|
859
|
-
var listWorkflowDefinitionRevisions =
|
|
912
|
+
var listWorkflowDefinitionRevisions = Effect14.fn("Client.listWorkflowDefinitionRevisions.call")(function* (id) {
|
|
860
913
|
const service = yield* Service;
|
|
861
914
|
return yield* service.workflows.listDefinitionRevisions(id);
|
|
862
915
|
});
|
|
863
|
-
var startWorkflowRun =
|
|
916
|
+
var startWorkflowRun = Effect14.fn("Client.startWorkflowRun.call")(function* (input) {
|
|
864
917
|
const service = yield* Service;
|
|
865
918
|
return yield* service.workflows.startRun(input);
|
|
866
919
|
});
|
|
867
|
-
var cancelWorkflowRun =
|
|
920
|
+
var cancelWorkflowRun = Effect14.fn("Client.cancelWorkflowRun.call")(function* (id) {
|
|
868
921
|
const service = yield* Service;
|
|
869
922
|
return yield* service.workflows.cancelRun(id);
|
|
870
923
|
});
|
|
871
|
-
var replayWorkflowRun =
|
|
924
|
+
var replayWorkflowRun = Effect14.fn("Client.replayWorkflowRun.call")(function* (id) {
|
|
872
925
|
const service = yield* Service;
|
|
873
926
|
return yield* service.workflows.replayRun(id);
|
|
874
927
|
});
|
|
875
|
-
var inspectWorkflowRun =
|
|
928
|
+
var inspectWorkflowRun = Effect14.fn("Client.inspectWorkflowRun.call")(function* (id) {
|
|
876
929
|
const service = yield* Service;
|
|
877
930
|
return yield* service.workflows.inspectRun(id);
|
|
878
931
|
});
|