@relayfx/sdk 0.6.1 → 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-dm4yqr8f.js → index-7mmmxqw7.js} +1 -1
- package/dist/{index-ftgf8py0.js → index-n5sqnw4s.js} +1168 -1070
- package/dist/{index-fh2ftte9.js → index-q7xzf506.js} +6 -0
- package/dist/{index-5vjhqzbk.js → index-qa93yf6j.js} +1516 -800
- package/dist/index.js +265 -229
- package/dist/mysql.js +4 -4
- package/dist/postgres.js +4 -4
- 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 +7 -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,94 +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 responseErrorCode = (error) => {
|
|
222
|
-
if (typeof error !== "object" || error === null || Array.isArray(error))
|
|
223
|
-
return;
|
|
224
|
-
const event = error;
|
|
225
|
-
if (event.type !== "error")
|
|
226
|
-
return;
|
|
227
|
-
if (typeof event.code === "string")
|
|
228
|
-
return event.code;
|
|
229
|
-
const details = event.error;
|
|
230
|
-
if (typeof details !== "object" || details === null || Array.isArray(details))
|
|
231
|
-
return;
|
|
232
|
-
const code = details.code;
|
|
233
|
-
return typeof code === "string" ? code : undefined;
|
|
234
|
-
};
|
|
235
|
-
var classifyFailure2 = (error) => {
|
|
236
|
-
const eventCode = responseErrorCode(error);
|
|
237
|
-
if (eventCode !== undefined && contextOverflowCodes.has(eventCode))
|
|
238
|
-
return "context-overflow";
|
|
239
|
-
if (!AiError2.isAiError(error))
|
|
240
|
-
return "other";
|
|
241
|
-
const reason = error.reason;
|
|
242
|
-
if (reason._tag !== "InvalidRequestError" && reason._tag !== "UnknownError")
|
|
243
|
-
return "other";
|
|
244
|
-
const metadata = reason.metadata.openai;
|
|
245
|
-
if (metadata !== null && metadata !== undefined) {
|
|
246
|
-
if (metadata.errorCode !== null && contextOverflowCodes.has(metadata.errorCode) || metadata.errorType !== null && contextOverflowCodes.has(metadata.errorType)) {
|
|
247
|
-
return "context-overflow";
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return reason._tag === "InvalidRequestError" && /maximum context length|context length exceeded|input exceeds (?:the )?context window/i.test(reason.description ?? "") ? "context-overflow" : "other";
|
|
251
|
-
};
|
|
285
|
+
var classifyFailure2 = exports_context_overflow.classify;
|
|
252
286
|
var layer3 = (input) => exports_model_registry.layer([
|
|
253
287
|
exports_model_registry.registration({
|
|
254
288
|
provider: "openai",
|
|
255
289
|
model: input.model,
|
|
256
|
-
layer: OpenAiLanguageModel.layer({
|
|
290
|
+
layer: layerImageSources(OpenAiLanguageModel.layer({
|
|
257
291
|
model: input.model,
|
|
258
292
|
...input.config === undefined ? {} : { config: input.config }
|
|
259
|
-
}),
|
|
293
|
+
})),
|
|
260
294
|
classifyFailure: classifyFailure2,
|
|
261
295
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
262
296
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
263
297
|
})
|
|
264
|
-
]).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
|
+
});
|
|
265
310
|
var stringifyJson = Schema.encodeSync(Schema.UnknownFromJsonString);
|
|
266
311
|
var parseJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);
|
|
267
312
|
var dataLinePrefix = /^data: ?/;
|
|
@@ -273,16 +318,19 @@ var flattenErrorPayload = (payload) => {
|
|
|
273
318
|
if (Option.isNone(decoded) || typeof decoded.value !== "object" || decoded.value === null)
|
|
274
319
|
return;
|
|
275
320
|
const record = decoded.value;
|
|
276
|
-
if (record.type !== "error"
|
|
321
|
+
if (record.type !== "error")
|
|
322
|
+
return;
|
|
323
|
+
if (typeof record.message === "string" && "code" in record)
|
|
277
324
|
return;
|
|
278
325
|
const details = record.error;
|
|
279
326
|
if (typeof details !== "object" || details === null || Array.isArray(details))
|
|
280
327
|
return;
|
|
281
328
|
const nested = details;
|
|
329
|
+
const message = typeof nested.message === "string" ? nested.message : record.message;
|
|
282
330
|
return stringifyJson({
|
|
283
331
|
type: "error",
|
|
284
332
|
code: typeof nested.code === "string" ? nested.code : null,
|
|
285
|
-
message: typeof
|
|
333
|
+
message: typeof message === "string" ? message : stringifyJson(nested),
|
|
286
334
|
param: typeof nested.param === "string" ? nested.param : null,
|
|
287
335
|
sequence_number: typeof record.sequence_number === "number" ? record.sequence_number : 0
|
|
288
336
|
});
|
|
@@ -294,17 +342,26 @@ var rewriteFrame = (frame) => {
|
|
|
294
342
|
if (dataLinePrefix.test(segments[index] ?? ""))
|
|
295
343
|
dataIndexes.push(index);
|
|
296
344
|
}
|
|
297
|
-
if (dataIndexes.length
|
|
345
|
+
if (dataIndexes.length === 0)
|
|
298
346
|
return frame;
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
const flattened = flattenErrorPayload(
|
|
347
|
+
const payload = dataIndexes.map((index) => segments[index].replace(dataLinePrefix, "")).join(`
|
|
348
|
+
`);
|
|
349
|
+
const flattened = flattenErrorPayload(payload);
|
|
302
350
|
if (flattened === undefined)
|
|
303
351
|
return frame;
|
|
304
|
-
segments[dataIndexes[0]]
|
|
305
|
-
|
|
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);
|
|
306
363
|
};
|
|
307
|
-
var normalizeSseErrorFrames = (body) => body.pipe(
|
|
364
|
+
var normalizeSseErrorFrames = (body) => body.pipe(Stream2.decodeText(), Stream2.mapAccum(() => "", (buffer, chunk) => {
|
|
308
365
|
const pieces = (buffer + chunk).split(frameSeparator);
|
|
309
366
|
const tail = pieces.length % 2 === 1 ? pieces.pop() : "";
|
|
310
367
|
const output = [];
|
|
@@ -312,14 +369,13 @@ var normalizeSseErrorFrames = (body) => body.pipe(Stream.decodeText(), Stream.ma
|
|
|
312
369
|
output.push(rewriteFrame(pieces[index]) + pieces[index + 1]);
|
|
313
370
|
}
|
|
314
371
|
return [tail, output];
|
|
315
|
-
}, { onHalt: (buffer) => buffer.length === 0 ? [] : [rewriteFrame(buffer)] }),
|
|
316
|
-
var normalizeResponsesSse = (client) => HttpClient.transformResponse(client, (effect) =>
|
|
317
|
-
|
|
318
|
-
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))
|
|
319
375
|
return response;
|
|
320
|
-
return HttpClientResponse.fromWeb(response.request, new Response(
|
|
376
|
+
return HttpClientResponse.fromWeb(response.request, new Response(Stream2.toReadableStream(normalizeSseErrorFrames(response.stream)), {
|
|
321
377
|
status: response.status,
|
|
322
|
-
headers: {
|
|
378
|
+
headers: { ...response.headers }
|
|
323
379
|
}));
|
|
324
380
|
}));
|
|
325
381
|
var layerConfig2 = (options) => OpenAiClient.layerConfig({
|
|
@@ -332,12 +388,12 @@ class OpenAiAccountCredentialError extends Schema.TaggedErrorClass()("@batonfx/p
|
|
|
332
388
|
}) {
|
|
333
389
|
}
|
|
334
390
|
var credentialsFromAccountAuthImpl = (service, expectedFingerprint) => {
|
|
335
|
-
const mapCredential = (operation) =>
|
|
336
|
-
const accountCredential = (operation) =>
|
|
391
|
+
const mapCredential = (operation) => Effect4.mapError(() => OpenAiAccountCredentialError.make({ operation }));
|
|
392
|
+
const accountCredential = (operation) => Effect4.flatMap((credential) => credential.fingerprint === expectedFingerprint ? Effect4.succeed({
|
|
337
393
|
accessToken: credential.accessToken,
|
|
338
394
|
accountId: Redacted2.value(credential.accountId),
|
|
339
395
|
generation: credential.generation
|
|
340
|
-
}) :
|
|
396
|
+
}) : Effect4.fail(OpenAiAccountCredentialError.make({ operation })));
|
|
341
397
|
return {
|
|
342
398
|
acquire: service.acquire.pipe(accountCredential("acquire"), mapCredential("acquire")),
|
|
343
399
|
refreshRejected: (generation) => service.refreshRejected(generation).pipe(accountCredential("refreshRejected"), mapCredential("refreshRejected"))
|
|
@@ -356,145 +412,125 @@ var withCredential = (request, credential) => {
|
|
|
356
412
|
const streaming = body._tag === "Uint8Array" && body.contentType === "application/json" && new TextDecoder().decode(body.body).includes('"stream":true');
|
|
357
413
|
return request.pipe(HttpClientRequest.setUrl(openAiAccountResponsesUrl), HttpClientRequest.bearerToken(credential.accessToken), HttpClientRequest.setHeader(openAiAccountIdHeader, credential.accountId), HttpClientRequest.accept(streaming ? "text/event-stream" : "application/json"));
|
|
358
414
|
};
|
|
359
|
-
var executeWithCredential = (client, request, credential) => client.postprocess(
|
|
360
|
-
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) => {
|
|
361
417
|
if (error.reason._tag !== "StatusCodeError")
|
|
362
|
-
return
|
|
363
|
-
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)));
|
|
364
420
|
})))));
|
|
365
|
-
var withAccountHeaderRedaction = (effect) => effect.pipe(
|
|
366
|
-
var withoutOpenAiSocket = (effect) => effect.pipe(
|
|
367
|
-
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({
|
|
368
424
|
apiUrl: openAiAccountApiUrl,
|
|
369
425
|
transformClient: (client) => client.pipe(normalizeResponsesSse, accountClientTransform(credentials))
|
|
370
|
-
}).pipe(
|
|
426
|
+
}).pipe(Effect4.map((client) => OpenAiClient.OpenAiClient.of({
|
|
371
427
|
client: client.client,
|
|
372
428
|
createResponse: (options) => withAccountHeaderRedaction(client.createResponse(options)),
|
|
373
|
-
createResponseStream: (options) => client.createResponseStream(options).pipe(withoutOpenAiSocket, withAccountHeaderRedaction,
|
|
429
|
+
createResponseStream: (options) => client.createResponseStream(options).pipe(withoutOpenAiSocket, withAccountHeaderRedaction, Effect4.map(([response, stream]) => [
|
|
374
430
|
response,
|
|
375
|
-
stream.pipe(
|
|
431
|
+
stream.pipe(Stream2.updateService(Headers.CurrentRedactedNames, (names) => [...names, openAiAccountIdHeader]))
|
|
376
432
|
])),
|
|
377
433
|
createEmbedding: (options) => withAccountHeaderRedaction(client.createEmbedding(options))
|
|
378
434
|
}))));
|
|
379
435
|
var registrationAccount = (input) => exports_model_registry.registration({
|
|
380
436
|
provider: "openai",
|
|
381
437
|
model: input.model,
|
|
382
|
-
layer: OpenAiLanguageModel.layer({
|
|
438
|
+
layer: layerImageSources(OpenAiLanguageModel.layer({
|
|
383
439
|
model: input.model,
|
|
384
440
|
...input.config === undefined ? {} : { config: input.config }
|
|
385
|
-
}).pipe(
|
|
441
|
+
})).pipe(Layer4.provide(openAiAccountClientLayer(input.credentials))),
|
|
386
442
|
classifyFailure: classifyFailure2,
|
|
387
443
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
388
444
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
389
445
|
});
|
|
390
446
|
var layerAccount = (input) => exports_model_registry.layer([registrationAccount(input)]);
|
|
391
447
|
|
|
392
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
393
|
-
var deterministicModelLayer =
|
|
394
|
-
generateText: () =>
|
|
395
|
-
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" }))
|
|
396
452
|
}));
|
|
397
|
-
var
|
|
453
|
+
var registration2 = (input = {}) => exports_model_registry.registration({
|
|
398
454
|
provider: input.provider ?? "deterministic",
|
|
399
455
|
model: input.model ?? "deterministic",
|
|
400
456
|
layer: deterministicModelLayer,
|
|
401
457
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
402
458
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
403
459
|
});
|
|
404
|
-
var layer4 = (input = {}) => exports_model_registry.layer([
|
|
405
|
-
var layerOpenAi = (options) =>
|
|
406
|
-
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({
|
|
407
463
|
provider: options.fallbackProvider ?? "deterministic",
|
|
408
464
|
model: options.fallbackModel
|
|
409
465
|
});
|
|
410
466
|
const configuredApiKey = yield* Config3.option(options.apiKey);
|
|
411
467
|
const openAiRegistration = yield* Option2.match(configuredApiKey, {
|
|
412
|
-
onNone: () =>
|
|
413
|
-
onSome: (apiKey) =>
|
|
468
|
+
onNone: () => Effect5.succeedNone,
|
|
469
|
+
onSome: (apiKey) => Layer5.build(OpenAiClient2.layerConfig({
|
|
414
470
|
...options.clientConfig,
|
|
415
471
|
apiKey: Config3.succeed(apiKey)
|
|
416
|
-
})).pipe(
|
|
417
|
-
provider: "openai",
|
|
472
|
+
})).pipe(Effect5.flatMap((context) => registration({
|
|
418
473
|
model: options.model,
|
|
419
|
-
|
|
420
|
-
model: options.model,
|
|
421
|
-
...options.config === undefined ? {} : { config: options.config }
|
|
422
|
-
}),
|
|
423
|
-
classifyFailure: classifyFailure2,
|
|
474
|
+
...options.config === undefined ? {} : { config: options.config },
|
|
424
475
|
...options.registrationKey === undefined ? {} : { registrationKey: options.registrationKey },
|
|
425
476
|
...options.metadata === undefined ? {} : { metadata: options.metadata }
|
|
426
|
-
}).pipe(
|
|
477
|
+
}).pipe(Effect5.provide(context))), Effect5.asSome)
|
|
427
478
|
});
|
|
428
479
|
return exports_model_registry.layer([
|
|
429
|
-
|
|
430
|
-
...Option2.isSome(openAiRegistration) ? [
|
|
480
|
+
Effect5.succeed(deterministic),
|
|
481
|
+
...Option2.isSome(openAiRegistration) ? [Effect5.succeed(openAiRegistration.value)] : []
|
|
431
482
|
]);
|
|
432
483
|
}));
|
|
433
484
|
|
|
434
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
435
|
-
import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as
|
|
436
|
-
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";
|
|
437
488
|
var layer5 = (input) => exports_model_registry.layer([
|
|
438
489
|
exports_model_registry.registration({
|
|
439
490
|
provider: input.provider ?? "openai-compatible",
|
|
440
491
|
model: input.model,
|
|
441
|
-
layer:
|
|
492
|
+
layer: layerImageSources(OpenAiLanguageModel2.layer({
|
|
442
493
|
model: input.model,
|
|
443
494
|
...input.config === undefined ? {} : { config: input.config }
|
|
444
|
-
}),
|
|
495
|
+
})),
|
|
445
496
|
...input.classifyFailure === undefined ? {} : { classifyFailure: input.classifyFailure },
|
|
446
497
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
447
498
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
448
499
|
})
|
|
449
|
-
]).pipe(
|
|
500
|
+
]).pipe(Layer6.provide(OpenAiClient3.layerConfig({
|
|
450
501
|
...input.clientConfig,
|
|
451
502
|
...input.apiKey === undefined ? {} : { apiKey: input.apiKey },
|
|
452
503
|
...input.baseUrl === undefined ? {} : { apiUrl: Config4.succeed(input.baseUrl) }
|
|
453
504
|
})));
|
|
454
505
|
var layerConfig3 = OpenAiClient3.layerConfig;
|
|
455
506
|
|
|
456
|
-
// ../../node_modules/.bun/@batonfx+providers@0.
|
|
507
|
+
// ../../node_modules/.bun/@batonfx+providers@0.11.3+74997d64abff4185/node_modules/@batonfx/providers/dist/openrouter.js
|
|
457
508
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
458
|
-
import { Config as Config5, Layer as
|
|
459
|
-
|
|
460
|
-
var contextOverflowCodes2 = new Set(["context_length_exceeded", "context_window_exceeded", "input_too_long"]);
|
|
461
|
-
var classifyFailure3 = (error) => {
|
|
462
|
-
if (!AiError3.isAiError(error))
|
|
463
|
-
return "other";
|
|
464
|
-
const reason = error.reason;
|
|
465
|
-
if (reason._tag !== "InvalidRequestError" && reason._tag !== "UnknownError")
|
|
466
|
-
return "other";
|
|
467
|
-
const metadata = reason.metadata.openrouter;
|
|
468
|
-
if (metadata !== null && metadata !== undefined) {
|
|
469
|
-
if (typeof metadata.errorCode === "string" && contextOverflowCodes2.has(metadata.errorCode) || metadata.errorType !== null && contextOverflowCodes2.has(metadata.errorType)) {
|
|
470
|
-
return "context-overflow";
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
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";
|
|
474
|
-
};
|
|
509
|
+
import { Config as Config5, Layer as Layer7, Redacted as Redacted4 } from "effect";
|
|
510
|
+
var classifyFailure3 = exports_context_overflow.classify;
|
|
475
511
|
var layer6 = (input) => exports_model_registry.layer([
|
|
476
512
|
exports_model_registry.registration({
|
|
477
513
|
provider: "openrouter",
|
|
478
514
|
model: input.model,
|
|
479
|
-
layer: OpenRouterLanguageModel.layer({
|
|
515
|
+
layer: layerImageSources(OpenRouterLanguageModel.layer({
|
|
480
516
|
model: input.model,
|
|
481
517
|
...input.config === undefined ? {} : { config: input.config }
|
|
482
|
-
}),
|
|
518
|
+
})),
|
|
483
519
|
classifyFailure: classifyFailure3,
|
|
484
520
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
485
521
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
486
522
|
})
|
|
487
|
-
]).pipe(
|
|
523
|
+
]).pipe(Layer7.provide(OpenRouterClient.layerConfig({ ...input.clientConfig, apiKey: input.apiKey })));
|
|
488
524
|
var layerConfig4 = OpenRouterClient.layerConfig;
|
|
489
525
|
|
|
490
526
|
// src/language-model-registration.ts
|
|
491
|
-
import { Layer as
|
|
527
|
+
import { Layer as Layer8 } from "effect";
|
|
492
528
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
493
|
-
var deterministicModel = (input) =>
|
|
529
|
+
var deterministicModel = (input) => registration2(input);
|
|
494
530
|
var openAi = (input) => exports_model_registry.registration({
|
|
495
531
|
provider: "openai",
|
|
496
532
|
model: input.model,
|
|
497
|
-
layer:
|
|
533
|
+
layer: OpenAiLanguageModel3.layer({
|
|
498
534
|
model: input.model,
|
|
499
535
|
...input.config === undefined ? {} : { config: input.config }
|
|
500
536
|
}),
|
|
@@ -535,11 +571,11 @@ var openAiCompatible = (input) => exports_model_registry.registration({
|
|
|
535
571
|
...input.registrationKey === undefined ? {} : { registrationKey: input.registrationKey },
|
|
536
572
|
...input.metadata === undefined ? {} : { metadata: input.metadata }
|
|
537
573
|
});
|
|
538
|
-
var withOpenAiFetch = (input) => layer3(input).pipe(
|
|
539
|
-
var withAnthropicFetch = (input) => layer2(input).pipe(
|
|
540
|
-
var withOpenRouterFetch = (input) => layer6(input).pipe(
|
|
541
|
-
var withOpenAiCompatibleFetch = (input) => layer5(input).pipe(
|
|
542
|
-
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));
|
|
543
579
|
|
|
544
580
|
// src/client.ts
|
|
545
581
|
var exports_client = {};
|
|
@@ -570,326 +606,326 @@ __export(exports_client, {
|
|
|
570
606
|
});
|
|
571
607
|
|
|
572
608
|
// src/client-public-agents.ts
|
|
573
|
-
import { Effect as
|
|
574
|
-
var registerAgentDefinition =
|
|
609
|
+
import { Effect as Effect6 } from "effect";
|
|
610
|
+
var registerAgentDefinition = Effect6.fn("Client.registerAgentDefinition.call")(function* (input) {
|
|
575
611
|
const service = yield* Service;
|
|
576
612
|
return yield* service.agents.registerDefinition(input);
|
|
577
613
|
});
|
|
578
614
|
function registerAgent(input) {
|
|
579
|
-
return
|
|
615
|
+
return Effect6.gen(function* () {
|
|
580
616
|
const service = yield* Service;
|
|
581
617
|
if (isRegisterBatonAgentInput(input))
|
|
582
618
|
return yield* service.agents.register(input);
|
|
583
619
|
return yield* service.agents.register(input);
|
|
584
|
-
}).pipe(
|
|
620
|
+
}).pipe(Effect6.withSpan("Client.registerAgent.call"));
|
|
585
621
|
}
|
|
586
622
|
var isRegisterBatonAgentInput = (input) => ("agent" in input);
|
|
587
|
-
var getAgentDefinition =
|
|
623
|
+
var getAgentDefinition = Effect6.fn("Client.getAgentDefinition.call")(function* (id) {
|
|
588
624
|
const service = yield* Service;
|
|
589
625
|
return yield* service.agents.getDefinition(id);
|
|
590
626
|
});
|
|
591
|
-
var listAgentDefinitions =
|
|
627
|
+
var listAgentDefinitions = Effect6.fn("Client.listAgentDefinitions.call")(function* () {
|
|
592
628
|
const service = yield* Service;
|
|
593
629
|
return yield* service.agents.listDefinitions();
|
|
594
630
|
});
|
|
595
|
-
var listAgentDefinitionRevisions =
|
|
631
|
+
var listAgentDefinitionRevisions = Effect6.fn("Client.listAgentDefinitionRevisions.call")(function* (id) {
|
|
596
632
|
const service = yield* Service;
|
|
597
633
|
return yield* service.agents.listDefinitionRevisions(id);
|
|
598
634
|
});
|
|
599
|
-
var getSkillDefinition =
|
|
635
|
+
var getSkillDefinition = Effect6.fn("Client.getSkillDefinition.call")(function* (id) {
|
|
600
636
|
const service = yield* Service;
|
|
601
637
|
return yield* service.skills.getDefinition(id);
|
|
602
638
|
});
|
|
603
|
-
var listSkillDefinitions =
|
|
639
|
+
var listSkillDefinitions = Effect6.fn("Client.listSkillDefinitions.call")(function* () {
|
|
604
640
|
const service = yield* Service;
|
|
605
641
|
return yield* service.skills.listDefinitions();
|
|
606
642
|
});
|
|
607
|
-
var listSkillDefinitionRevisions =
|
|
643
|
+
var listSkillDefinitionRevisions = Effect6.fn("Client.listSkillDefinitionRevisions.call")(function* (id) {
|
|
608
644
|
const service = yield* Service;
|
|
609
645
|
return yield* service.skills.listDefinitionRevisions(id);
|
|
610
646
|
});
|
|
611
647
|
|
|
612
648
|
// src/client-public-child-runs.ts
|
|
613
|
-
import { Effect as
|
|
614
|
-
var spawnChildRun =
|
|
649
|
+
import { Effect as Effect7 } from "effect";
|
|
650
|
+
var spawnChildRun = Effect7.fn("Client.spawnChildRun.call")(function* (input) {
|
|
615
651
|
const service = yield* Service;
|
|
616
652
|
return yield* service.childRuns.spawn(input);
|
|
617
653
|
});
|
|
618
|
-
var createChildFanOut =
|
|
654
|
+
var createChildFanOut = Effect7.fn("Client.createChildFanOut.call")(function* (input) {
|
|
619
655
|
const service = yield* Service;
|
|
620
656
|
return yield* service.childRuns.createFanOut(input);
|
|
621
657
|
});
|
|
622
|
-
var cancelChildFanOut =
|
|
658
|
+
var cancelChildFanOut = Effect7.fn("Client.cancelChildFanOut.call")(function* (input) {
|
|
623
659
|
const service = yield* Service;
|
|
624
660
|
return yield* service.childRuns.cancelFanOut(input);
|
|
625
661
|
});
|
|
626
|
-
var inspectChildFanOut =
|
|
662
|
+
var inspectChildFanOut = Effect7.fn("Client.inspectChildFanOut.call")(function* (input) {
|
|
627
663
|
const service = yield* Service;
|
|
628
664
|
return yield* service.childRuns.inspectFanOut(input);
|
|
629
665
|
});
|
|
630
666
|
|
|
631
667
|
// src/client-public-envelope-ready.ts
|
|
632
|
-
import { Effect as
|
|
633
|
-
var claimEnvelopeReady =
|
|
668
|
+
import { Effect as Effect8 } from "effect";
|
|
669
|
+
var claimEnvelopeReady = Effect8.fn("Client.claimEnvelopeReady.call")(function* (input) {
|
|
634
670
|
const service = yield* Service;
|
|
635
671
|
return yield* service.envelopes.claimReady(input);
|
|
636
672
|
});
|
|
637
|
-
var ackEnvelopeReady =
|
|
673
|
+
var ackEnvelopeReady = Effect8.fn("Client.ackEnvelopeReady.call")(function* (input) {
|
|
638
674
|
const service = yield* Service;
|
|
639
675
|
return yield* service.envelopes.ackReady(input);
|
|
640
676
|
});
|
|
641
|
-
var releaseEnvelopeReady =
|
|
677
|
+
var releaseEnvelopeReady = Effect8.fn("Client.releaseEnvelopeReady.call")(function* (input) {
|
|
642
678
|
const service = yield* Service;
|
|
643
679
|
return yield* service.envelopes.releaseReady(input);
|
|
644
680
|
});
|
|
645
681
|
|
|
646
682
|
// src/client-public-executions.ts
|
|
647
|
-
import { Effect as
|
|
648
|
-
var startExecution =
|
|
683
|
+
import { Effect as Effect9, Stream as Stream4 } from "effect";
|
|
684
|
+
var startExecution = Effect9.fn("Client.startExecution.call")(function* (input) {
|
|
649
685
|
const service = yield* Service;
|
|
650
686
|
return yield* service.executions.start(input);
|
|
651
687
|
});
|
|
652
|
-
var startExecutionByAddress =
|
|
688
|
+
var startExecutionByAddress = Effect9.fn("Client.startExecutionByAddress.call")(function* (input) {
|
|
653
689
|
const service = yield* Service;
|
|
654
690
|
return yield* service.executions.startByAddress(input);
|
|
655
691
|
});
|
|
656
|
-
var startExecutionByAgentDefinition =
|
|
692
|
+
var startExecutionByAgentDefinition = Effect9.fn("Client.startExecutionByAgentDefinition.call")(function* (input) {
|
|
657
693
|
const service = yield* Service;
|
|
658
694
|
return yield* service.executions.startByAgentDefinition(input);
|
|
659
695
|
});
|
|
660
|
-
var cancelExecution =
|
|
696
|
+
var cancelExecution = Effect9.fn("Client.cancelExecution.call")(function* (input) {
|
|
661
697
|
const service = yield* Service;
|
|
662
698
|
return yield* service.executions.cancel(input);
|
|
663
699
|
});
|
|
664
|
-
var steer =
|
|
700
|
+
var steer = Effect9.fn("Client.steer.call")(function* (input) {
|
|
665
701
|
const service = yield* Service;
|
|
666
702
|
return yield* service.executions.steer(input);
|
|
667
703
|
});
|
|
668
|
-
var getExecution =
|
|
704
|
+
var getExecution = Effect9.fn("Client.getExecution.call")(function* (id) {
|
|
669
705
|
const service = yield* Service;
|
|
670
706
|
return yield* service.executions.get(id);
|
|
671
707
|
});
|
|
672
|
-
var listExecutions =
|
|
708
|
+
var listExecutions = Effect9.fn("Client.listExecutions.call")(function* (input) {
|
|
673
709
|
const service = yield* Service;
|
|
674
710
|
return yield* service.executions.list(input);
|
|
675
711
|
});
|
|
676
|
-
var listSessions =
|
|
712
|
+
var listSessions = Effect9.fn("Client.listSessions.call")(function* (input) {
|
|
677
713
|
const service = yield* Service;
|
|
678
714
|
return yield* service.sessions.list(input);
|
|
679
715
|
});
|
|
680
|
-
var getSession =
|
|
716
|
+
var getSession = Effect9.fn("Client.getSession.call")(function* (input) {
|
|
681
717
|
const service = yield* Service;
|
|
682
718
|
return yield* service.sessions.get(input);
|
|
683
719
|
});
|
|
684
|
-
var listWaits =
|
|
720
|
+
var listWaits = Effect9.fn("Client.listWaits.call")(function* (input) {
|
|
685
721
|
const service = yield* Service;
|
|
686
722
|
return yield* service.waits.list(input);
|
|
687
723
|
});
|
|
688
|
-
var replayExecution =
|
|
724
|
+
var replayExecution = Effect9.fn("Client.replayExecution.call")(function* (input) {
|
|
689
725
|
const service = yield* Service;
|
|
690
726
|
return yield* service.executions.replay(input);
|
|
691
727
|
});
|
|
692
|
-
var pageExecutionEvents =
|
|
728
|
+
var pageExecutionEvents = Effect9.fn("Client.pageExecutionEvents.call")(function* (input) {
|
|
693
729
|
const service = yield* Service;
|
|
694
730
|
return yield* service.executions.pageEvents(input);
|
|
695
731
|
});
|
|
696
|
-
var listRunners =
|
|
732
|
+
var listRunners = Effect9.fn("Client.listRunners.call")(function* () {
|
|
697
733
|
const service = yield* Service;
|
|
698
734
|
return yield* service.runners.list();
|
|
699
735
|
});
|
|
700
|
-
var routeExecution =
|
|
736
|
+
var routeExecution = Effect9.fn("Client.routeExecution.call")(function* (executionId) {
|
|
701
737
|
const service = yield* Service;
|
|
702
738
|
return yield* service.executions.route(executionId);
|
|
703
739
|
});
|
|
704
|
-
var inspectExecution =
|
|
740
|
+
var inspectExecution = Effect9.fn("Client.inspectExecution.call")(function* (executionId) {
|
|
705
741
|
const service = yield* Service;
|
|
706
742
|
return yield* service.executions.inspect(executionId);
|
|
707
743
|
});
|
|
708
|
-
var streamExecution = (input) =>
|
|
709
|
-
var followExecution = (input) =>
|
|
710
|
-
var streamSession = (input) =>
|
|
711
|
-
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))));
|
|
712
748
|
|
|
713
749
|
// src/client-public-messaging.ts
|
|
714
|
-
import { Effect as
|
|
715
|
-
var registerAddressBookRoute =
|
|
750
|
+
import { Effect as Effect10, Stream as Stream5 } from "effect";
|
|
751
|
+
var registerAddressBookRoute = Effect10.fn("Client.registerAddressBookRoute.call")(function* (input) {
|
|
716
752
|
const service = yield* Service;
|
|
717
753
|
return yield* service.addressBook.register(input);
|
|
718
754
|
});
|
|
719
|
-
var getAddressBookRoute =
|
|
755
|
+
var getAddressBookRoute = Effect10.fn("Client.getAddressBookRoute.call")(function* (id) {
|
|
720
756
|
const service = yield* Service;
|
|
721
757
|
return yield* service.addressBook.get(id);
|
|
722
758
|
});
|
|
723
|
-
var listAddressBookRoutes =
|
|
759
|
+
var listAddressBookRoutes = Effect10.fn("Client.listAddressBookRoutes.call")(function* () {
|
|
724
760
|
const service = yield* Service;
|
|
725
761
|
return yield* service.addressBook.list();
|
|
726
762
|
});
|
|
727
|
-
var subscribeTopic =
|
|
763
|
+
var subscribeTopic = Effect10.fn("Client.subscribeTopic.call")(function* (input) {
|
|
728
764
|
const service = yield* Service;
|
|
729
765
|
return yield* service.topics.subscribe(input);
|
|
730
766
|
});
|
|
731
|
-
var unsubscribeTopic =
|
|
767
|
+
var unsubscribeTopic = Effect10.fn("Client.unsubscribeTopic.call")(function* (input) {
|
|
732
768
|
const service = yield* Service;
|
|
733
769
|
return yield* service.topics.unsubscribe(input);
|
|
734
770
|
});
|
|
735
|
-
var publishTopic =
|
|
771
|
+
var publishTopic = Effect10.fn("Client.publishTopic.call")(function* (input) {
|
|
736
772
|
const service = yield* Service;
|
|
737
773
|
return yield* service.topics.publish(input);
|
|
738
774
|
});
|
|
739
|
-
var listTopicSubscriptions =
|
|
775
|
+
var listTopicSubscriptions = Effect10.fn("Client.listTopicSubscriptions.call")(function* (input) {
|
|
740
776
|
const service = yield* Service;
|
|
741
777
|
return yield* service.topics.listSubscriptions(input);
|
|
742
778
|
});
|
|
743
|
-
var listInboxMessages =
|
|
779
|
+
var listInboxMessages = Effect10.fn("Client.listInboxMessages.call")(function* (input) {
|
|
744
780
|
const service = yield* Service;
|
|
745
781
|
return yield* service.envelopes.listInbox(input);
|
|
746
782
|
});
|
|
747
|
-
var send =
|
|
783
|
+
var send = Effect10.fn("Client.send.call")(function* (input) {
|
|
748
784
|
const service = yield* Service;
|
|
749
785
|
return yield* service.envelopes.send(input);
|
|
750
786
|
});
|
|
751
|
-
var getPresence =
|
|
787
|
+
var getPresence = Effect10.fn("Client.getPresence.call")(function* (scope) {
|
|
752
788
|
const service = yield* Service;
|
|
753
789
|
return yield* service.presence.get(scope);
|
|
754
790
|
});
|
|
755
|
-
var watchPresence = (scope) =>
|
|
756
|
-
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) {
|
|
757
793
|
const service = yield* Service;
|
|
758
794
|
return yield* service.waits.wake(input);
|
|
759
795
|
});
|
|
760
|
-
var submitInboundEnvelope =
|
|
796
|
+
var submitInboundEnvelope = Effect10.fn("Client.submitInboundEnvelope.call")(function* (input) {
|
|
761
797
|
const service = yield* Service;
|
|
762
798
|
return yield* service.envelopes.submitInbound(input);
|
|
763
799
|
});
|
|
764
|
-
var awaitWait =
|
|
800
|
+
var awaitWait = Effect10.fn("Client.awaitWait.call")(function* (input) {
|
|
765
801
|
const service = yield* Service;
|
|
766
802
|
return yield* service.waits.await(input);
|
|
767
803
|
});
|
|
768
804
|
|
|
769
805
|
// src/client-public-residents.ts
|
|
770
|
-
import { Effect as
|
|
771
|
-
var registerResidentKind =
|
|
806
|
+
import { Effect as Effect11 } from "effect";
|
|
807
|
+
var registerResidentKind = Effect11.fn("Client.registerResidentKind.call")(function* (input) {
|
|
772
808
|
const service = yield* Service;
|
|
773
809
|
return yield* service.residents.registerKind(input);
|
|
774
810
|
});
|
|
775
|
-
var spawnResident =
|
|
811
|
+
var spawnResident = Effect11.fn("Client.spawnResident.call")(function* (input) {
|
|
776
812
|
const service = yield* Service;
|
|
777
813
|
return yield* service.residents.spawn(input);
|
|
778
814
|
});
|
|
779
|
-
var getResident =
|
|
815
|
+
var getResident = Effect11.fn("Client.getResident.call")(function* (input) {
|
|
780
816
|
const service = yield* Service;
|
|
781
817
|
return yield* service.residents.get(input);
|
|
782
818
|
});
|
|
783
|
-
var destroyResident =
|
|
819
|
+
var destroyResident = Effect11.fn("Client.destroyResident.call")(function* (input) {
|
|
784
820
|
const service = yield* Service;
|
|
785
821
|
return yield* service.residents.destroy(input);
|
|
786
822
|
});
|
|
787
|
-
var listResidents =
|
|
823
|
+
var listResidents = Effect11.fn("Client.listResidents.call")(function* (input) {
|
|
788
824
|
const service = yield* Service;
|
|
789
825
|
return yield* service.residents.list(input);
|
|
790
826
|
});
|
|
791
|
-
var askResident =
|
|
827
|
+
var askResident = Effect11.fn("Client.askResident.call")(function* (input) {
|
|
792
828
|
const service = yield* Service;
|
|
793
829
|
return yield* service.residents.ask(input);
|
|
794
830
|
});
|
|
795
|
-
var getResidentState =
|
|
831
|
+
var getResidentState = Effect11.fn("Client.getResidentState.call")(function* (input) {
|
|
796
832
|
const service = yield* Service;
|
|
797
833
|
return yield* service.residents.getState(input);
|
|
798
834
|
});
|
|
799
|
-
var putResidentState =
|
|
835
|
+
var putResidentState = Effect11.fn("Client.putResidentState.call")(function* (input) {
|
|
800
836
|
const service = yield* Service;
|
|
801
837
|
return yield* service.residents.putState(input);
|
|
802
838
|
});
|
|
803
|
-
var deleteResidentState =
|
|
839
|
+
var deleteResidentState = Effect11.fn("Client.deleteResidentState.call")(function* (input) {
|
|
804
840
|
const service = yield* Service;
|
|
805
841
|
return yield* service.residents.deleteState(input);
|
|
806
842
|
});
|
|
807
|
-
var listResidentState =
|
|
843
|
+
var listResidentState = Effect11.fn("Client.listResidentState.call")(function* (input) {
|
|
808
844
|
const service = yield* Service;
|
|
809
845
|
return yield* service.residents.listState(input);
|
|
810
846
|
});
|
|
811
847
|
|
|
812
848
|
// src/client-public-schedules.ts
|
|
813
|
-
import { Effect as
|
|
814
|
-
var createSchedule =
|
|
849
|
+
import { Effect as Effect12 } from "effect";
|
|
850
|
+
var createSchedule = Effect12.fn("Client.createSchedule.call")(function* (input) {
|
|
815
851
|
const service = yield* Service;
|
|
816
852
|
return yield* service.schedules.create(input);
|
|
817
853
|
});
|
|
818
|
-
var cancelSchedule =
|
|
854
|
+
var cancelSchedule = Effect12.fn("Client.cancelSchedule.call")(function* (input) {
|
|
819
855
|
const service = yield* Service;
|
|
820
856
|
return yield* service.schedules.cancel(input);
|
|
821
857
|
});
|
|
822
|
-
var listSchedules =
|
|
858
|
+
var listSchedules = Effect12.fn("Client.listSchedules.call")(function* (input) {
|
|
823
859
|
const service = yield* Service;
|
|
824
860
|
return yield* service.schedules.list(input);
|
|
825
861
|
});
|
|
826
862
|
|
|
827
863
|
// src/client-public-tools.ts
|
|
828
|
-
import { Effect as
|
|
829
|
-
var listPendingApprovals =
|
|
864
|
+
import { Effect as Effect13 } from "effect";
|
|
865
|
+
var listPendingApprovals = Effect13.fn("Client.listPendingApprovals.call")(function* (input) {
|
|
830
866
|
const service = yield* Service;
|
|
831
867
|
return yield* service.tools.listPendingApprovals(input);
|
|
832
868
|
});
|
|
833
|
-
var resolveToolApproval =
|
|
869
|
+
var resolveToolApproval = Effect13.fn("Client.resolveToolApproval.call")(function* (input) {
|
|
834
870
|
const service = yield* Service;
|
|
835
871
|
return yield* service.tools.resolveApproval(input);
|
|
836
872
|
});
|
|
837
|
-
var resolvePermission =
|
|
873
|
+
var resolvePermission = Effect13.fn("Client.resolvePermission.call")(function* (input) {
|
|
838
874
|
const service = yield* Service;
|
|
839
875
|
return yield* service.tools.resolvePermission(input);
|
|
840
876
|
});
|
|
841
|
-
var listPendingToolCalls =
|
|
877
|
+
var listPendingToolCalls = Effect13.fn("Client.listPendingToolCalls.call")(function* (input) {
|
|
842
878
|
const service = yield* Service;
|
|
843
879
|
return yield* service.tools.listPending(input);
|
|
844
880
|
});
|
|
845
|
-
var fulfillToolCall =
|
|
881
|
+
var fulfillToolCall = Effect13.fn("Client.fulfillToolCall.call")(function* (input) {
|
|
846
882
|
const service = yield* Service;
|
|
847
883
|
return yield* service.tools.fulfill(input);
|
|
848
884
|
});
|
|
849
|
-
var claimToolWork =
|
|
885
|
+
var claimToolWork = Effect13.fn("Client.claimToolWork.call")(function* (input) {
|
|
850
886
|
const service = yield* Service;
|
|
851
887
|
return yield* service.tools.claimWork(input);
|
|
852
888
|
});
|
|
853
|
-
var completeToolWork =
|
|
889
|
+
var completeToolWork = Effect13.fn("Client.completeToolWork.call")(function* (input) {
|
|
854
890
|
const service = yield* Service;
|
|
855
891
|
return yield* service.tools.completeWork(input);
|
|
856
892
|
});
|
|
857
|
-
var releaseToolWork =
|
|
893
|
+
var releaseToolWork = Effect13.fn("Client.releaseToolWork.call")(function* (input) {
|
|
858
894
|
const service = yield* Service;
|
|
859
895
|
return yield* service.tools.releaseWork(input);
|
|
860
896
|
});
|
|
861
|
-
var listToolAttempts =
|
|
897
|
+
var listToolAttempts = Effect13.fn("Client.listToolAttempts.call")(function* (input) {
|
|
862
898
|
const service = yield* Service;
|
|
863
899
|
return yield* service.tools.listAttempts(input);
|
|
864
900
|
});
|
|
865
901
|
|
|
866
902
|
// src/client-public-workflows.ts
|
|
867
|
-
import { Effect as
|
|
868
|
-
var registerWorkflowDefinition =
|
|
903
|
+
import { Effect as Effect14 } from "effect";
|
|
904
|
+
var registerWorkflowDefinition = Effect14.fn("Client.registerWorkflowDefinition.call")(function* (input) {
|
|
869
905
|
const service = yield* Service;
|
|
870
906
|
return yield* service.workflows.registerDefinition(input);
|
|
871
907
|
});
|
|
872
|
-
var getWorkflowDefinitionRevision =
|
|
908
|
+
var getWorkflowDefinitionRevision = Effect14.fn("Client.getWorkflowDefinitionRevision.call")(function* (id, revision) {
|
|
873
909
|
const service = yield* Service;
|
|
874
910
|
return yield* service.workflows.getDefinitionRevision(id, revision);
|
|
875
911
|
});
|
|
876
|
-
var listWorkflowDefinitionRevisions =
|
|
912
|
+
var listWorkflowDefinitionRevisions = Effect14.fn("Client.listWorkflowDefinitionRevisions.call")(function* (id) {
|
|
877
913
|
const service = yield* Service;
|
|
878
914
|
return yield* service.workflows.listDefinitionRevisions(id);
|
|
879
915
|
});
|
|
880
|
-
var startWorkflowRun =
|
|
916
|
+
var startWorkflowRun = Effect14.fn("Client.startWorkflowRun.call")(function* (input) {
|
|
881
917
|
const service = yield* Service;
|
|
882
918
|
return yield* service.workflows.startRun(input);
|
|
883
919
|
});
|
|
884
|
-
var cancelWorkflowRun =
|
|
920
|
+
var cancelWorkflowRun = Effect14.fn("Client.cancelWorkflowRun.call")(function* (id) {
|
|
885
921
|
const service = yield* Service;
|
|
886
922
|
return yield* service.workflows.cancelRun(id);
|
|
887
923
|
});
|
|
888
|
-
var replayWorkflowRun =
|
|
924
|
+
var replayWorkflowRun = Effect14.fn("Client.replayWorkflowRun.call")(function* (id) {
|
|
889
925
|
const service = yield* Service;
|
|
890
926
|
return yield* service.workflows.replayRun(id);
|
|
891
927
|
});
|
|
892
|
-
var inspectWorkflowRun =
|
|
928
|
+
var inspectWorkflowRun = Effect14.fn("Client.inspectWorkflowRun.call")(function* (id) {
|
|
893
929
|
const service = yield* Service;
|
|
894
930
|
return yield* service.workflows.inspectRun(id);
|
|
895
931
|
});
|