@relayfx/sdk 0.0.41 → 0.0.43
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 +361 -286
- package/dist/index.js +505 -430
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8371,7 +8371,7 @@ __export(exports_agent_loop_service, {
|
|
|
8371
8371
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8372
8372
|
});
|
|
8373
8373
|
|
|
8374
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8374
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
|
|
8375
8375
|
var exports_agent = {};
|
|
8376
8376
|
__export(exports_agent, {
|
|
8377
8377
|
streamObject: () => streamObject,
|
|
@@ -8381,10 +8381,10 @@ __export(exports_agent, {
|
|
|
8381
8381
|
generate: () => generate,
|
|
8382
8382
|
defaultObjectPrompt: () => defaultObjectPrompt
|
|
8383
8383
|
});
|
|
8384
|
-
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as
|
|
8384
|
+
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as Schema47, Stream as Stream7 } from "effect";
|
|
8385
8385
|
import { Chat, LanguageModel as LanguageModel3, Prompt as Prompt4, Response as Response3, Telemetry, Tokenizer as Tokenizer2, Tool as Tool4, Toolkit as Toolkit3 } from "effect/unstable/ai";
|
|
8386
8386
|
|
|
8387
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8387
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-event.ts
|
|
8388
8388
|
var exports_agent_event = {};
|
|
8389
8389
|
__export(exports_agent_event, {
|
|
8390
8390
|
addUsage: () => addUsage,
|
|
@@ -8441,7 +8441,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8441
8441
|
}) {
|
|
8442
8442
|
}
|
|
8443
8443
|
|
|
8444
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8444
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/approvals.ts
|
|
8445
8445
|
var exports_approvals = {};
|
|
8446
8446
|
__export(exports_approvals, {
|
|
8447
8447
|
testLayer: () => testLayer26,
|
|
@@ -8457,7 +8457,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8457
8457
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8458
8458
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8459
8459
|
|
|
8460
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8460
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/compaction.ts
|
|
8461
8461
|
var exports_compaction = {};
|
|
8462
8462
|
__export(exports_compaction, {
|
|
8463
8463
|
truncate: () => truncate,
|
|
@@ -8475,7 +8475,7 @@ __export(exports_compaction, {
|
|
|
8475
8475
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8476
8476
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8477
8477
|
|
|
8478
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8478
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/session.ts
|
|
8479
8479
|
var exports_session = {};
|
|
8480
8480
|
__export(exports_session, {
|
|
8481
8481
|
testLayer: () => testLayer27,
|
|
@@ -8607,7 +8607,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8607
8607
|
}))));
|
|
8608
8608
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8609
8609
|
|
|
8610
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8610
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-output.ts
|
|
8611
8611
|
var exports_tool_output = {};
|
|
8612
8612
|
__export(exports_tool_output, {
|
|
8613
8613
|
testLayer: () => testLayer28,
|
|
@@ -8667,7 +8667,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8667
8667
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8668
8668
|
});
|
|
8669
8669
|
|
|
8670
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8670
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/compaction.ts
|
|
8671
8671
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8672
8672
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8673
8673
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8850,7 +8850,7 @@ var truncate = (maxTokens) => ({
|
|
|
8850
8850
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8851
8851
|
var isContextOverflow = (error) => /context|token|prompt/i.test(error instanceof Error ? `${error.name}: ${error.message}` : String(error)) && /overflow|exceed|exceeded|maximum|too large|too long|length/i.test(error instanceof Error ? `${error.name}: ${error.message}` : String(error));
|
|
8852
8852
|
|
|
8853
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8853
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/instructions.ts
|
|
8854
8854
|
var exports_instructions = {};
|
|
8855
8855
|
__export(exports_instructions, {
|
|
8856
8856
|
testLayer: () => testLayer30,
|
|
@@ -8899,7 +8899,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
8899
8899
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
8900
8900
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
8901
8901
|
|
|
8902
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8902
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/memory.ts
|
|
8903
8903
|
var exports_memory = {};
|
|
8904
8904
|
__export(exports_memory, {
|
|
8905
8905
|
testLayer: () => testLayer31,
|
|
@@ -8928,7 +8928,7 @@ var merge = (first, second) => ({
|
|
|
8928
8928
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
8929
8929
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
8930
8930
|
|
|
8931
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8931
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-middleware.ts
|
|
8932
8932
|
var exports_model_middleware = {};
|
|
8933
8933
|
__export(exports_model_middleware, {
|
|
8934
8934
|
layer: () => layer28,
|
|
@@ -8942,7 +8942,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
8942
8942
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
8943
8943
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
8944
8944
|
|
|
8945
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8945
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-resilience.ts
|
|
8946
8946
|
var exports_model_resilience = {};
|
|
8947
8947
|
__export(exports_model_resilience, {
|
|
8948
8948
|
testLayer: () => testLayer32,
|
|
@@ -8988,7 +8988,7 @@ var apply = (model, resilience) => ({
|
|
|
8988
8988
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
8989
8989
|
});
|
|
8990
8990
|
|
|
8991
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8991
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/permissions.ts
|
|
8992
8992
|
var exports_permissions = {};
|
|
8993
8993
|
__export(exports_permissions, {
|
|
8994
8994
|
testLayer: () => testLayer33,
|
|
@@ -9118,7 +9118,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9118
9118
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9119
9119
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9120
9120
|
|
|
9121
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9121
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/skill-source.ts
|
|
9122
9122
|
var exports_skill_source = {};
|
|
9123
9123
|
__export(exports_skill_source, {
|
|
9124
9124
|
testLayer: () => testLayer34,
|
|
@@ -9176,37 +9176,64 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9176
9176
|
return selected;
|
|
9177
9177
|
};
|
|
9178
9178
|
|
|
9179
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9179
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/steering.ts
|
|
9180
9180
|
var exports_steering = {};
|
|
9181
9181
|
__export(exports_steering, {
|
|
9182
9182
|
testLayer: () => testLayer35,
|
|
9183
9183
|
layer: () => layer30,
|
|
9184
|
+
SteeringQueueFull: () => SteeringQueueFull,
|
|
9184
9185
|
Steering: () => Steering
|
|
9185
9186
|
});
|
|
9186
|
-
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue } from "effect";
|
|
9187
|
+
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue, Schema as Schema45 } from "effect";
|
|
9187
9188
|
|
|
9188
9189
|
class Steering extends Context39.Service()("@batonfx/core/Steering") {
|
|
9189
9190
|
}
|
|
9191
|
+
|
|
9192
|
+
class SteeringQueueFull extends Schema45.TaggedErrorClass()("@batonfx/core/SteeringQueueFull", {
|
|
9193
|
+
queue: Schema45.Literals(["steering", "followUp"]),
|
|
9194
|
+
capacity: Schema45.Number
|
|
9195
|
+
}) {
|
|
9196
|
+
}
|
|
9197
|
+
var resolvePolicy = (policy, mode) => ({
|
|
9198
|
+
mode: policy?.mode ?? mode,
|
|
9199
|
+
...policy?.capacity === undefined ? {} : { capacity: policy.capacity },
|
|
9200
|
+
onFull: policy?.onFull ?? "fail"
|
|
9201
|
+
});
|
|
9202
|
+
var queueStrategy = (strategy) => {
|
|
9203
|
+
switch (strategy) {
|
|
9204
|
+
case "drop-oldest":
|
|
9205
|
+
return "sliding";
|
|
9206
|
+
case "drop-newest":
|
|
9207
|
+
case "fail":
|
|
9208
|
+
return "dropping";
|
|
9209
|
+
case "suspend":
|
|
9210
|
+
return "suspend";
|
|
9211
|
+
}
|
|
9212
|
+
};
|
|
9213
|
+
var makeQueue = (name, policy) => (policy.capacity === undefined ? Queue.unbounded() : Queue.make({ capacity: policy.capacity, strategy: queueStrategy(policy.onFull) })).pipe(Effect41.map((queue) => ({ name, queue, policy })));
|
|
9214
|
+
var offer = (runtime, message) => Queue.offer(runtime.queue, message).pipe(Effect41.flatMap((offered) => {
|
|
9215
|
+
if (offered || runtime.policy.capacity === undefined || runtime.policy.onFull !== "fail")
|
|
9216
|
+
return Effect41.void;
|
|
9217
|
+
return Effect41.fail(new SteeringQueueFull({ queue: runtime.name, capacity: runtime.policy.capacity }));
|
|
9218
|
+
}));
|
|
9190
9219
|
var drainOne = (queue) => Effect41.sync(() => {
|
|
9191
9220
|
const taken = Queue.takeUnsafe(queue);
|
|
9192
9221
|
return taken === undefined || !Exit.isSuccess(taken) ? [] : [taken.value];
|
|
9193
9222
|
});
|
|
9194
9223
|
var drain = (queue, mode) => mode === "all" ? Queue.clear(queue) : drainOne(queue);
|
|
9195
9224
|
var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function* () {
|
|
9196
|
-
const steeringQueue = yield*
|
|
9197
|
-
const followUpQueue = yield*
|
|
9198
|
-
const steeringMode = options.steeringMode ?? "all";
|
|
9199
|
-
const followUpMode = options.followUpMode ?? "one-at-a-time";
|
|
9225
|
+
const steeringQueue = yield* makeQueue("steering", resolvePolicy(options.steering, "all"));
|
|
9226
|
+
const followUpQueue = yield* makeQueue("followUp", resolvePolicy(options.followUp, "one-at-a-time"));
|
|
9200
9227
|
return Steering.of({
|
|
9201
|
-
steer: (message) =>
|
|
9202
|
-
followUp: (message) =>
|
|
9203
|
-
takeSteering: () => drain(steeringQueue,
|
|
9204
|
-
takeFollowUp: () => drain(followUpQueue,
|
|
9228
|
+
steer: (message) => offer(steeringQueue, message),
|
|
9229
|
+
followUp: (message) => offer(followUpQueue, message),
|
|
9230
|
+
takeSteering: () => drain(steeringQueue.queue, steeringQueue.policy.mode),
|
|
9231
|
+
takeFollowUp: () => drain(followUpQueue.queue, followUpQueue.policy.mode)
|
|
9205
9232
|
});
|
|
9206
9233
|
}));
|
|
9207
9234
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9208
9235
|
|
|
9209
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9236
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-context.ts
|
|
9210
9237
|
var exports_tool_context = {};
|
|
9211
9238
|
__export(exports_tool_context, {
|
|
9212
9239
|
testLayer: () => testLayer36,
|
|
@@ -9224,18 +9251,22 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9224
9251
|
}));
|
|
9225
9252
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9226
9253
|
|
|
9227
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9254
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9228
9255
|
var exports_tool_executor = {};
|
|
9229
9256
|
__export(exports_tool_executor, {
|
|
9230
9257
|
testLayer: () => testLayer37,
|
|
9258
|
+
sandbox: () => sandbox,
|
|
9231
9259
|
router: () => router,
|
|
9232
9260
|
routeToolkit: () => routeToolkit,
|
|
9233
9261
|
route: () => route,
|
|
9262
|
+
remote: () => remote,
|
|
9263
|
+
mcp: () => mcp,
|
|
9234
9264
|
fromToolkit: () => fromToolkit,
|
|
9235
9265
|
executeToolkit: () => executeToolkit,
|
|
9266
|
+
client: () => client,
|
|
9236
9267
|
ToolExecutor: () => ToolExecutor
|
|
9237
9268
|
});
|
|
9238
|
-
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Sink as Sink2, Stream as Stream6 } from "effect";
|
|
9269
|
+
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as Schema46, Sink as Sink2, Stream as Stream6 } from "effect";
|
|
9239
9270
|
class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
|
|
9240
9271
|
}
|
|
9241
9272
|
var failureMessage = (cause) => {
|
|
@@ -9255,6 +9286,24 @@ var resultMessage = (result) => {
|
|
|
9255
9286
|
return String(result);
|
|
9256
9287
|
}
|
|
9257
9288
|
};
|
|
9289
|
+
var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
|
|
9290
|
+
var decodeSuccess = (tool2, result) => {
|
|
9291
|
+
const successSchema = tool2.successSchema;
|
|
9292
|
+
if (!Schema46.isSchema(successSchema)) {
|
|
9293
|
+
return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
|
|
9294
|
+
}
|
|
9295
|
+
return Schema46.decodeUnknownEffect(successSchema)(result).pipe(Effect43.flatMap((decoded) => Schema46.encodeUnknownEffect(successSchema)(decoded).pipe(Effect43.map((encoded) => ({ _tag: "Success", result: decoded, encodedResult: encoded })))), Effect43.catchCause((cause) => Effect43.succeed(failureOutcome(`invalid client result: ${schemaMessage(Cause2.squash(cause))}`))));
|
|
9296
|
+
};
|
|
9297
|
+
var placementOutcome = (placement, tool2, response) => {
|
|
9298
|
+
switch (response._tag) {
|
|
9299
|
+
case "Failure":
|
|
9300
|
+
return Effect43.succeed(failureOutcome(response.message));
|
|
9301
|
+
case "Suspend":
|
|
9302
|
+
return Effect43.succeed({ _tag: "Suspend", token: response.token });
|
|
9303
|
+
case "Success":
|
|
9304
|
+
return decodeSuccess(tool2, response.result).pipe(Effect43.map((outcome) => outcome._tag === "Failure" ? failureOutcome(outcome.message.replace("invalid client result", `invalid ${placement} result`)) : outcome));
|
|
9305
|
+
}
|
|
9306
|
+
};
|
|
9258
9307
|
var executeWithToolkit = (toolkit, request) => {
|
|
9259
9308
|
if (toolkit.tools[request.call.name] === undefined) {
|
|
9260
9309
|
return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
|
|
@@ -9292,6 +9341,24 @@ var route = (options) => {
|
|
|
9292
9341
|
execute: options.execute
|
|
9293
9342
|
};
|
|
9294
9343
|
};
|
|
9344
|
+
var placementRoute = (placement, options) => {
|
|
9345
|
+
const routedTools = options.tools ?? Object.keys(options.toolkit.tools);
|
|
9346
|
+
return route({
|
|
9347
|
+
tools: routedTools,
|
|
9348
|
+
execute: (request) => {
|
|
9349
|
+
const tool2 = options.toolkit.tools[request.call.name];
|
|
9350
|
+
if (tool2 === undefined)
|
|
9351
|
+
return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
|
|
9352
|
+
const effect = options.execute({ ...request, placement, tool: tool2 });
|
|
9353
|
+
const scheduled = "schedule" in options && options.schedule !== undefined ? Effect43.retry(effect, options.schedule) : effect;
|
|
9354
|
+
return scheduled.pipe(Effect43.flatMap((response) => placementOutcome(placement, tool2, response)), Effect43.catchCause((cause) => Cause2.hasInterrupts(cause) ? Effect43.interrupt : Effect43.succeed(failureOutcome(`${placement} tool infrastructure failed: ${failureMessage(cause)}`))));
|
|
9355
|
+
}
|
|
9356
|
+
});
|
|
9357
|
+
};
|
|
9358
|
+
var client = (options) => placementRoute("client", options);
|
|
9359
|
+
var remote = (options) => placementRoute("remote", options);
|
|
9360
|
+
var mcp = (options) => placementRoute("mcp", options);
|
|
9361
|
+
var sandbox = (options) => placementRoute("sandbox", options);
|
|
9295
9362
|
function routeToolkit(toolkit) {
|
|
9296
9363
|
const makeRoute = (handled) => route({
|
|
9297
9364
|
tools: Object.keys(handled.tools),
|
|
@@ -9300,15 +9367,17 @@ function routeToolkit(toolkit) {
|
|
|
9300
9367
|
return "handle" in toolkit ? makeRoute(toolkit) : toolkit.pipe(Effect43.map(makeRoute));
|
|
9301
9368
|
}
|
|
9302
9369
|
var routeInputEffect = (input) => Effect43.isEffect(input) ? input : Effect43.succeed(input);
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
}
|
|
9370
|
+
function router(routes) {
|
|
9371
|
+
return Layer41.effect(ToolExecutor, Effect43.all(Array.from(routes, routeInputEffect)).pipe(Effect43.map((resolved) => ToolExecutor.of({
|
|
9372
|
+
execute: (request) => {
|
|
9373
|
+
const matched = resolved.find((candidate) => candidate.matches(request));
|
|
9374
|
+
return matched === undefined ? Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`)) : matched.execute(request);
|
|
9375
|
+
}
|
|
9376
|
+
}))));
|
|
9377
|
+
}
|
|
9309
9378
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9310
9379
|
|
|
9311
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9380
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9312
9381
|
var exports_turn_policy = {};
|
|
9313
9382
|
__export(exports_turn_policy, {
|
|
9314
9383
|
untilToolCall: () => untilToolCall,
|
|
@@ -9347,7 +9416,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9347
9416
|
}));
|
|
9348
9417
|
var defaultPolicy = recurs(8);
|
|
9349
9418
|
|
|
9350
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9419
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
|
|
9351
9420
|
function make5(nameOrOptions, options = {}) {
|
|
9352
9421
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9353
9422
|
return {
|
|
@@ -9358,16 +9427,22 @@ function make5(nameOrOptions, options = {}) {
|
|
|
9358
9427
|
};
|
|
9359
9428
|
}
|
|
9360
9429
|
var defaultObjectPrompt = "Return the final structured output for the task above.";
|
|
9430
|
+
var steeringDrainedEvent = (turn, queue, messages) => ({
|
|
9431
|
+
_tag: "SteeringDrained",
|
|
9432
|
+
turn,
|
|
9433
|
+
queue,
|
|
9434
|
+
count: messages.length
|
|
9435
|
+
});
|
|
9361
9436
|
var skillListingBudgetTokens = 2048;
|
|
9362
9437
|
var activateSkillToolName = "activate_skill";
|
|
9363
|
-
var activateSkillParameters =
|
|
9438
|
+
var activateSkillParameters = Schema47.Struct({ name: Schema47.String });
|
|
9364
9439
|
var activateSkillTool = Tool4.make(activateSkillToolName, {
|
|
9365
9440
|
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
9366
9441
|
parameters: activateSkillParameters,
|
|
9367
|
-
success:
|
|
9368
|
-
name:
|
|
9369
|
-
body:
|
|
9370
|
-
allowedTools:
|
|
9442
|
+
success: Schema47.Struct({
|
|
9443
|
+
name: Schema47.String,
|
|
9444
|
+
body: Schema47.String,
|
|
9445
|
+
allowedTools: Schema47.Array(Schema47.String)
|
|
9371
9446
|
})
|
|
9372
9447
|
});
|
|
9373
9448
|
var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
@@ -9670,7 +9745,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9670
9745
|
const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
|
|
9671
9746
|
if (skillRuntime === undefined)
|
|
9672
9747
|
return { _tag: "Failure", message: "SkillSource is not available" };
|
|
9673
|
-
const params =
|
|
9748
|
+
const params = Schema47.decodeUnknownOption(activateSkillParameters)(call.params);
|
|
9674
9749
|
if (Option15.isNone(params))
|
|
9675
9750
|
return { _tag: "Failure", message: "Skill activation requires a name" };
|
|
9676
9751
|
const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
|
|
@@ -9909,7 +9984,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9909
9984
|
const followUp = yield* takeFollowUp();
|
|
9910
9985
|
if (followUp.length > 0) {
|
|
9911
9986
|
return {
|
|
9912
|
-
events: Stream7.fromIterable([completed]),
|
|
9987
|
+
events: Stream7.fromIterable([completed, steeringDrainedEvent(turn, "followUp", followUp)]),
|
|
9913
9988
|
next: { prompt: promptFromSteeringMessages(followUp) }
|
|
9914
9989
|
};
|
|
9915
9990
|
}
|
|
@@ -9945,7 +10020,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9945
10020
|
const basePrompt = steering.length === 0 ? toolPrompt : Prompt4.concat(promptFromSteeringMessages(steering), toolPrompt);
|
|
9946
10021
|
const prompt = decision2.overrides?.instructions === undefined ? basePrompt : withSystem(decision2.overrides.instructions, basePrompt);
|
|
9947
10022
|
return {
|
|
9948
|
-
events: Stream7.fromIterable([completed]),
|
|
10023
|
+
events: Stream7.fromIterable(steering.length === 0 ? [completed] : [completed, steeringDrainedEvent(turn, "steering", steering)]),
|
|
9949
10024
|
next: { prompt, ...decision2.overrides === undefined ? {} : { overrides: decision2.overrides } }
|
|
9950
10025
|
};
|
|
9951
10026
|
});
|
|
@@ -10024,14 +10099,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10024
10099
|
})
|
|
10025
10100
|
})
|
|
10026
10101
|
})));
|
|
10027
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10102
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10028
10103
|
var exports_agent_tool = {};
|
|
10029
10104
|
__export(exports_agent_tool, {
|
|
10030
10105
|
asTool: () => asTool
|
|
10031
10106
|
});
|
|
10032
|
-
import { Cause as Cause4, Effect as Effect46, Schema as
|
|
10107
|
+
import { Cause as Cause4, Effect as Effect46, Schema as Schema48 } from "effect";
|
|
10033
10108
|
import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
10034
|
-
var defaultParameters =
|
|
10109
|
+
var defaultParameters = Schema48.Struct({ prompt: Schema48.String });
|
|
10035
10110
|
var errorMessage2 = (error) => {
|
|
10036
10111
|
if (error instanceof AgentSuspended) {
|
|
10037
10112
|
return `suspended on ${error.tool_name}: ${error.reason}`;
|
|
@@ -10057,14 +10132,14 @@ var lazyHandled = (toolkit, name, handler) => ({
|
|
|
10057
10132
|
var asTool = (agent, options = {}) => {
|
|
10058
10133
|
const name = options.name ?? agent.name;
|
|
10059
10134
|
const parameters = options.parameters ?? defaultParameters;
|
|
10060
|
-
const success2 = options.success ??
|
|
10135
|
+
const success2 = options.success ?? Schema48.String;
|
|
10061
10136
|
const toPrompt = options.toPrompt ?? ((params) => params.prompt);
|
|
10062
10137
|
const fromResult = options.fromResult ?? ((result) => result.text);
|
|
10063
10138
|
const tool2 = Tool5.make(name, {
|
|
10064
10139
|
...options.description === undefined ? {} : { description: options.description },
|
|
10065
10140
|
parameters,
|
|
10066
10141
|
success: success2,
|
|
10067
|
-
failure:
|
|
10142
|
+
failure: Schema48.String,
|
|
10068
10143
|
failureMode: "return"
|
|
10069
10144
|
});
|
|
10070
10145
|
const toolkit = Toolkit4.make(tool2);
|
|
@@ -10082,7 +10157,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10082
10157
|
});
|
|
10083
10158
|
return lazyHandled(toolkit, name, handler);
|
|
10084
10159
|
};
|
|
10085
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10160
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/guardrail.ts
|
|
10086
10161
|
var exports_guardrail = {};
|
|
10087
10162
|
__export(exports_guardrail, {
|
|
10088
10163
|
validateInput: () => validateInput2,
|
|
@@ -10162,16 +10237,16 @@ var redactOutput = (options) => ({
|
|
|
10162
10237
|
var filterOutput = (keep) => ({
|
|
10163
10238
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10164
10239
|
});
|
|
10165
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10240
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/handoff.ts
|
|
10166
10241
|
var exports_handoff = {};
|
|
10167
10242
|
__export(exports_handoff, {
|
|
10168
10243
|
transferTool: () => transferTool,
|
|
10169
10244
|
supervisor: () => supervisor,
|
|
10170
10245
|
fanOut: () => fanOut
|
|
10171
10246
|
});
|
|
10172
|
-
import { Effect as Effect48, Schema as
|
|
10247
|
+
import { Effect as Effect48, Schema as Schema49 } from "effect";
|
|
10173
10248
|
import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
|
|
10174
|
-
var defaultTransferParameters =
|
|
10249
|
+
var defaultTransferParameters = Schema49.Struct({ prompt: Schema49.String });
|
|
10175
10250
|
var transferName = (agentName) => `transfer_to_${agentName}`;
|
|
10176
10251
|
var positiveConcurrency = (value) => {
|
|
10177
10252
|
const concurrency = value ?? 4;
|
|
@@ -10225,7 +10300,7 @@ var supervisor = (options) => {
|
|
|
10225
10300
|
toolkit
|
|
10226
10301
|
};
|
|
10227
10302
|
};
|
|
10228
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10303
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-registry.ts
|
|
10229
10304
|
var exports_model_registry = {};
|
|
10230
10305
|
__export(exports_model_registry, {
|
|
10231
10306
|
testLayer: () => testLayer38,
|
|
@@ -10240,13 +10315,13 @@ __export(exports_model_registry, {
|
|
|
10240
10315
|
Service: () => Service29,
|
|
10241
10316
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
10242
10317
|
});
|
|
10243
|
-
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as
|
|
10318
|
+
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as Schema50, Semaphore as Semaphore3 } from "effect";
|
|
10244
10319
|
import { Model } from "effect/unstable/ai";
|
|
10245
10320
|
|
|
10246
|
-
class LanguageModelNotRegistered extends
|
|
10247
|
-
provider:
|
|
10248
|
-
model:
|
|
10249
|
-
registration_key:
|
|
10321
|
+
class LanguageModelNotRegistered extends Schema50.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
10322
|
+
provider: Schema50.String,
|
|
10323
|
+
model: Schema50.String,
|
|
10324
|
+
registration_key: Schema50.optionalKey(Schema50.String)
|
|
10250
10325
|
}) {
|
|
10251
10326
|
}
|
|
10252
10327
|
|
|
@@ -10314,7 +10389,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10314
10389
|
return yield* service.provide(selection, effect);
|
|
10315
10390
|
});
|
|
10316
10391
|
|
|
10317
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10392
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/index.ts
|
|
10318
10393
|
import {
|
|
10319
10394
|
AiError as AiError3,
|
|
10320
10395
|
Chat as Chat2,
|
|
@@ -10332,7 +10407,7 @@ import {
|
|
|
10332
10407
|
} from "effect/unstable/ai";
|
|
10333
10408
|
|
|
10334
10409
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
10335
|
-
import { Config as Config3, Context as Context54, Crypto as Crypto3, Effect as Effect67, HashSet as HashSet6, Layer as Layer60, Option as Option22, Ref as Ref18, Schema as
|
|
10410
|
+
import { Config as Config3, Context as Context54, Crypto as Crypto3, Effect as Effect67, HashSet as HashSet6, Layer as Layer60, Option as Option22, Ref as Ref18, Schema as Schema63, Stream as Stream8 } from "effect";
|
|
10336
10411
|
import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
10337
10412
|
|
|
10338
10413
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -10352,31 +10427,31 @@ __export(exports_child_run_service, {
|
|
|
10352
10427
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
10353
10428
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
10354
10429
|
});
|
|
10355
|
-
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as
|
|
10430
|
+
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as Schema52 } from "effect";
|
|
10356
10431
|
|
|
10357
10432
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
10358
|
-
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as
|
|
10433
|
+
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema51 } from "effect";
|
|
10359
10434
|
|
|
10360
|
-
class WorkspaceNotFound extends
|
|
10435
|
+
class WorkspaceNotFound extends Schema51.TaggedErrorClass()("WorkspaceNotFound", {
|
|
10361
10436
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
10362
10437
|
}) {
|
|
10363
10438
|
}
|
|
10364
10439
|
|
|
10365
|
-
class WorkspaceUnavailable extends
|
|
10440
|
+
class WorkspaceUnavailable extends Schema51.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
10366
10441
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
10367
|
-
message:
|
|
10442
|
+
message: Schema51.String
|
|
10368
10443
|
}) {
|
|
10369
10444
|
}
|
|
10370
10445
|
|
|
10371
|
-
class WorkspaceCapabilityUnsupported extends
|
|
10372
|
-
capability:
|
|
10446
|
+
class WorkspaceCapabilityUnsupported extends Schema51.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
10447
|
+
capability: Schema51.Literals(["suspend", "snapshot", "fork"]),
|
|
10373
10448
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
10374
10449
|
}) {
|
|
10375
10450
|
}
|
|
10376
10451
|
|
|
10377
|
-
class WorkspaceProviderError extends
|
|
10452
|
+
class WorkspaceProviderError extends Schema51.TaggedErrorClass()("WorkspaceProviderError", {
|
|
10378
10453
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
10379
|
-
message:
|
|
10454
|
+
message: Schema51.String
|
|
10380
10455
|
}) {
|
|
10381
10456
|
}
|
|
10382
10457
|
|
|
@@ -10408,28 +10483,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
10408
10483
|
});
|
|
10409
10484
|
|
|
10410
10485
|
// ../runtime/src/child/child-run-service.ts
|
|
10411
|
-
class StaticChildRunPresetNotFound extends
|
|
10486
|
+
class StaticChildRunPresetNotFound extends Schema52.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
10412
10487
|
preset_name: exports_shared_schema.NonEmptyString
|
|
10413
10488
|
}) {
|
|
10414
10489
|
}
|
|
10415
10490
|
|
|
10416
|
-
class ChildRunScopeBroadened extends
|
|
10417
|
-
field:
|
|
10491
|
+
class ChildRunScopeBroadened extends Schema52.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
10492
|
+
field: Schema52.Literals(["tool_names", "permissions"]),
|
|
10418
10493
|
value: exports_shared_schema.NonEmptyString
|
|
10419
10494
|
}) {
|
|
10420
10495
|
}
|
|
10421
10496
|
|
|
10422
|
-
class ChildRunServiceError extends
|
|
10423
|
-
message:
|
|
10497
|
+
class ChildRunServiceError extends Schema52.TaggedErrorClass()("ChildRunServiceError", {
|
|
10498
|
+
message: Schema52.String
|
|
10424
10499
|
}) {
|
|
10425
10500
|
}
|
|
10426
10501
|
|
|
10427
|
-
class ChildRunWorkspaceUnavailable extends
|
|
10428
|
-
reason:
|
|
10502
|
+
class ChildRunWorkspaceUnavailable extends Schema52.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
10503
|
+
reason: Schema52.String
|
|
10429
10504
|
}) {
|
|
10430
10505
|
}
|
|
10431
10506
|
|
|
10432
|
-
class ChildRunModelMissing extends
|
|
10507
|
+
class ChildRunModelMissing extends Schema52.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
10433
10508
|
}
|
|
10434
10509
|
|
|
10435
10510
|
class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -10657,26 +10732,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
10657
10732
|
});
|
|
10658
10733
|
|
|
10659
10734
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
10660
|
-
import { Effect as Effect52, Schema as
|
|
10735
|
+
import { Effect as Effect52, Schema as Schema53 } from "effect";
|
|
10661
10736
|
var toolName = "spawn_child_run";
|
|
10662
10737
|
var permissionName = "relay.child_run.spawn";
|
|
10663
|
-
var Input =
|
|
10664
|
-
preset_name:
|
|
10665
|
-
instructions:
|
|
10666
|
-
model:
|
|
10667
|
-
tool_names:
|
|
10668
|
-
permissions:
|
|
10669
|
-
output_schema_ref:
|
|
10670
|
-
metadata:
|
|
10671
|
-
input:
|
|
10738
|
+
var Input = Schema53.Struct({
|
|
10739
|
+
preset_name: Schema53.optionalKey(exports_shared_schema.NonEmptyString),
|
|
10740
|
+
instructions: Schema53.optionalKey(Schema53.String),
|
|
10741
|
+
model: Schema53.optionalKey(exports_agent_schema.ModelSelection),
|
|
10742
|
+
tool_names: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10743
|
+
permissions: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10744
|
+
output_schema_ref: Schema53.optionalKey(Schema53.String),
|
|
10745
|
+
metadata: Schema53.optionalKey(exports_shared_schema.Metadata),
|
|
10746
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10672
10747
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
10673
|
-
var Output =
|
|
10748
|
+
var Output = Schema53.Struct({
|
|
10674
10749
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
10675
|
-
status:
|
|
10676
|
-
output:
|
|
10750
|
+
status: Schema53.Literals(["completed", "failed", "cancelled"]),
|
|
10751
|
+
output: Schema53.Array(exports_content_schema.Part)
|
|
10677
10752
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
10678
|
-
var TransferInput =
|
|
10679
|
-
input:
|
|
10753
|
+
var TransferInput = Schema53.Struct({
|
|
10754
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10680
10755
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
10681
10756
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
10682
10757
|
var parentContext = (agent) => ({
|
|
@@ -10863,17 +10938,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
10863
10938
|
});
|
|
10864
10939
|
|
|
10865
10940
|
// ../runtime/src/memory/memory-service.ts
|
|
10866
|
-
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as
|
|
10941
|
+
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema55 } from "effect";
|
|
10867
10942
|
import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
|
|
10868
10943
|
|
|
10869
10944
|
// ../runtime/src/model/embedding-model-service.ts
|
|
10870
|
-
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as
|
|
10945
|
+
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema54 } from "effect";
|
|
10871
10946
|
import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
|
|
10872
10947
|
|
|
10873
|
-
class EmbeddingModelNotRegistered extends
|
|
10874
|
-
provider:
|
|
10875
|
-
model:
|
|
10876
|
-
registration_key:
|
|
10948
|
+
class EmbeddingModelNotRegistered extends Schema54.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
10949
|
+
provider: Schema54.String,
|
|
10950
|
+
model: Schema54.String,
|
|
10951
|
+
registration_key: Schema54.optionalKey(Schema54.String)
|
|
10877
10952
|
}) {
|
|
10878
10953
|
}
|
|
10879
10954
|
|
|
@@ -10999,7 +11074,7 @@ var defaultTopK = 5;
|
|
|
10999
11074
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
11000
11075
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
11001
11076
|
});
|
|
11002
|
-
var decodeSubject = (subject) =>
|
|
11077
|
+
var decodeSubject = (subject) => Schema55.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
|
|
11003
11078
|
var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
|
|
11004
11079
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
11005
11080
|
`).trim();
|
|
@@ -11193,20 +11268,20 @@ __export(exports_model_call_policy, {
|
|
|
11193
11268
|
defaultClassify: () => defaultClassify2,
|
|
11194
11269
|
Service: () => Service35
|
|
11195
11270
|
});
|
|
11196
|
-
import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as
|
|
11271
|
+
import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as Schedule4 } from "effect";
|
|
11197
11272
|
import { AiError as AiError4 } from "effect/unstable/ai";
|
|
11198
11273
|
|
|
11199
11274
|
class Service35 extends Context48.Service()("@relayfx/runtime/ModelCallPolicy") {
|
|
11200
11275
|
}
|
|
11201
11276
|
var isOutputValidationError = (error) => AiError4.isAiError(error) ? error.reason._tag === "InvalidOutputError" : AiError4.isAiErrorReason(error) && error._tag === "InvalidOutputError";
|
|
11202
11277
|
var defaultClassify2 = (error) => isOutputValidationError(error) ? "terminal" : exports_model_resilience.defaultClassify(error);
|
|
11203
|
-
var defaultSchedule =
|
|
11278
|
+
var defaultSchedule = Schedule4.exponential(Duration3.seconds(1)).pipe(Schedule4.jittered, Schedule4.both(Schedule4.recurs(4)));
|
|
11204
11279
|
var make7 = (input) => ({
|
|
11205
11280
|
classify: input?.classify ?? defaultClassify2,
|
|
11206
11281
|
retrySchedule: input?.retrySchedule ?? defaultSchedule
|
|
11207
11282
|
});
|
|
11208
11283
|
var layer36 = (input) => Layer49.succeed(Service35, Service35.of(make7(input)));
|
|
11209
|
-
var noRetryLayer = layer36({ retrySchedule:
|
|
11284
|
+
var noRetryLayer = layer36({ retrySchedule: Schedule4.recurs(0) });
|
|
11210
11285
|
var testLayer41 = (implementation) => Layer49.succeed(Service35, Service35.of(implementation));
|
|
11211
11286
|
|
|
11212
11287
|
// ../runtime/src/schema-registry/schema-registry-service.ts
|
|
@@ -11221,9 +11296,9 @@ __export(exports_schema_registry_service, {
|
|
|
11221
11296
|
Service: () => Service36,
|
|
11222
11297
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
11223
11298
|
});
|
|
11224
|
-
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as
|
|
11299
|
+
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema56 } from "effect";
|
|
11225
11300
|
|
|
11226
|
-
class SchemaRefNotRegistered extends
|
|
11301
|
+
class SchemaRefNotRegistered extends Schema56.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
11227
11302
|
}
|
|
11228
11303
|
|
|
11229
11304
|
class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -11356,16 +11431,16 @@ __export(exports_blob_store_service, {
|
|
|
11356
11431
|
BlobStoreError: () => BlobStoreError,
|
|
11357
11432
|
BlobNotResolvable: () => BlobNotResolvable
|
|
11358
11433
|
});
|
|
11359
|
-
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as
|
|
11434
|
+
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema57 } from "effect";
|
|
11360
11435
|
|
|
11361
|
-
class BlobNotResolvable extends
|
|
11362
|
-
uri:
|
|
11363
|
-
reason:
|
|
11436
|
+
class BlobNotResolvable extends Schema57.TaggedErrorClass()("BlobNotResolvable", {
|
|
11437
|
+
uri: Schema57.String,
|
|
11438
|
+
reason: Schema57.String
|
|
11364
11439
|
}) {
|
|
11365
11440
|
}
|
|
11366
11441
|
|
|
11367
|
-
class BlobStoreError extends
|
|
11368
|
-
message:
|
|
11442
|
+
class BlobStoreError extends Schema57.TaggedErrorClass()("BlobStoreError", {
|
|
11443
|
+
message: Schema57.String
|
|
11369
11444
|
}) {
|
|
11370
11445
|
}
|
|
11371
11446
|
|
|
@@ -11438,7 +11513,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
11438
11513
|
Service: () => Service40,
|
|
11439
11514
|
PromptAssemblerError: () => PromptAssemblerError
|
|
11440
11515
|
});
|
|
11441
|
-
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as
|
|
11516
|
+
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema59 } from "effect";
|
|
11442
11517
|
import { Prompt as Prompt10 } from "effect/unstable/ai";
|
|
11443
11518
|
|
|
11444
11519
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -11453,11 +11528,11 @@ __export(exports_artifact_store_service, {
|
|
|
11453
11528
|
Memory: () => Memory2,
|
|
11454
11529
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
11455
11530
|
});
|
|
11456
|
-
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as
|
|
11531
|
+
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema58 } from "effect";
|
|
11457
11532
|
|
|
11458
|
-
class ArtifactNotResolvable extends
|
|
11459
|
-
artifact_id:
|
|
11460
|
-
reason:
|
|
11533
|
+
class ArtifactNotResolvable extends Schema58.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
11534
|
+
artifact_id: Schema58.String,
|
|
11535
|
+
reason: Schema58.String
|
|
11461
11536
|
}) {
|
|
11462
11537
|
}
|
|
11463
11538
|
|
|
@@ -11499,14 +11574,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
11499
11574
|
});
|
|
11500
11575
|
|
|
11501
11576
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
11502
|
-
class PromptAssemblerError extends
|
|
11503
|
-
message:
|
|
11577
|
+
class PromptAssemblerError extends Schema59.TaggedErrorClass()("PromptAssemblerError", {
|
|
11578
|
+
message: Schema59.String
|
|
11504
11579
|
}) {
|
|
11505
11580
|
}
|
|
11506
11581
|
|
|
11507
11582
|
class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
|
|
11508
11583
|
}
|
|
11509
|
-
var jsonValue2 = (value) =>
|
|
11584
|
+
var jsonValue2 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11510
11585
|
var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
|
|
11511
11586
|
var contentToPromptPart = (part) => {
|
|
11512
11587
|
const options = part.provider_options;
|
|
@@ -11650,8 +11725,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
11650
11725
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
11651
11726
|
|
|
11652
11727
|
// ../runtime/src/agent/relay-permissions.ts
|
|
11653
|
-
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as
|
|
11654
|
-
var jsonValue3 = (value) =>
|
|
11728
|
+
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as Schema60 } from "effect";
|
|
11729
|
+
var jsonValue3 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : value);
|
|
11655
11730
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
11656
11731
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
11657
11732
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -11817,7 +11892,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
11817
11892
|
});
|
|
11818
11893
|
var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
11819
11894
|
const createdAt = yield* Clock6.currentTimeMillis;
|
|
11820
|
-
const decodedRule = yield*
|
|
11895
|
+
const decodedRule = yield* Schema60.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
|
|
11821
11896
|
yield* config.repository.remember({
|
|
11822
11897
|
agent: config.agentName,
|
|
11823
11898
|
scope: config.scope,
|
|
@@ -11833,9 +11908,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
|
|
|
11833
11908
|
})));
|
|
11834
11909
|
|
|
11835
11910
|
// ../runtime/src/agent/relay-steering.ts
|
|
11836
|
-
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as
|
|
11911
|
+
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema61 } from "effect";
|
|
11837
11912
|
import { Prompt as Prompt11 } from "effect/unstable/ai";
|
|
11838
|
-
var jsonValue4 = (value) =>
|
|
11913
|
+
var jsonValue4 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11839
11914
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
|
|
11840
11915
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
11841
11916
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -11868,7 +11943,7 @@ var contentFromMessage = (message) => {
|
|
|
11868
11943
|
const textParts = promptTextParts(prompt);
|
|
11869
11944
|
if (textParts.length > 0)
|
|
11870
11945
|
return textParts;
|
|
11871
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
11946
|
+
return [exports_content_schema.text(stringifyJson2(Schema61.encodeSync(Prompt11.Prompt)(prompt)))];
|
|
11872
11947
|
};
|
|
11873
11948
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
11874
11949
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -11913,8 +11988,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
|
|
|
11913
11988
|
}));
|
|
11914
11989
|
|
|
11915
11990
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
11916
|
-
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as
|
|
11917
|
-
var jsonValue5 = (value) =>
|
|
11991
|
+
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as Schema62 } from "effect";
|
|
11992
|
+
var jsonValue5 = (value) => Schema62.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11918
11993
|
var errorDetail = (error) => {
|
|
11919
11994
|
switch (error._tag) {
|
|
11920
11995
|
case "ToolNotRegistered":
|
|
@@ -12021,29 +12096,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
|
|
|
12021
12096
|
})));
|
|
12022
12097
|
|
|
12023
12098
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
12024
|
-
class AgentLoopError extends
|
|
12025
|
-
message:
|
|
12026
|
-
next_event_sequence:
|
|
12099
|
+
class AgentLoopError extends Schema63.TaggedErrorClass()("AgentLoopError", {
|
|
12100
|
+
message: Schema63.String,
|
|
12101
|
+
next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12027
12102
|
}) {
|
|
12028
12103
|
}
|
|
12029
12104
|
|
|
12030
|
-
class AgentLoopWaitRequested extends
|
|
12105
|
+
class AgentLoopWaitRequested extends Schema63.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
12031
12106
|
wait_id: exports_ids_schema.WaitId,
|
|
12032
12107
|
tool_call: exports_tool_schema.Call,
|
|
12033
12108
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12034
12109
|
}) {
|
|
12035
12110
|
}
|
|
12036
12111
|
|
|
12037
|
-
class AgentLoopBudgetExceeded extends
|
|
12038
|
-
tokens_used:
|
|
12039
|
-
token_budget:
|
|
12112
|
+
class AgentLoopBudgetExceeded extends Schema63.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
12113
|
+
tokens_used: Schema63.Int,
|
|
12114
|
+
token_budget: Schema63.Int,
|
|
12040
12115
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12041
12116
|
}) {
|
|
12042
12117
|
}
|
|
12043
12118
|
|
|
12044
12119
|
class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
|
|
12045
12120
|
}
|
|
12046
|
-
var jsonValue6 = (value) =>
|
|
12121
|
+
var jsonValue6 = (value) => Schema63.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
12047
12122
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
12048
12123
|
var availableRegisteredTools = (agent, registered) => {
|
|
12049
12124
|
const names = toolNames(agent);
|
|
@@ -12612,14 +12687,14 @@ var exports_execution_entity = {};
|
|
|
12612
12687
|
__export(exports_execution_entity, {
|
|
12613
12688
|
layer: () => layer49,
|
|
12614
12689
|
entity: () => entity,
|
|
12615
|
-
client: () =>
|
|
12690
|
+
client: () => client2,
|
|
12616
12691
|
Start: () => Start,
|
|
12617
12692
|
SignalWait: () => SignalWait,
|
|
12618
12693
|
Cancel: () => Cancel
|
|
12619
12694
|
});
|
|
12620
12695
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
12621
12696
|
import { Rpc } from "effect/unstable/rpc";
|
|
12622
|
-
import { Schema as
|
|
12697
|
+
import { Schema as Schema70 } from "effect";
|
|
12623
12698
|
|
|
12624
12699
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
12625
12700
|
var exports_execution_workflow = {};
|
|
@@ -12650,15 +12725,15 @@ __export(exports_execution_workflow, {
|
|
|
12650
12725
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
12651
12726
|
});
|
|
12652
12727
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
12653
|
-
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as
|
|
12728
|
+
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema69 } from "effect";
|
|
12654
12729
|
|
|
12655
12730
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
12656
|
-
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as
|
|
12657
|
-
class ParentNotifyError extends
|
|
12658
|
-
message:
|
|
12731
|
+
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as Schema64 } from "effect";
|
|
12732
|
+
class ParentNotifyError extends Schema64.TaggedErrorClass()("ParentNotifyError", {
|
|
12733
|
+
message: Schema64.String
|
|
12659
12734
|
}) {
|
|
12660
12735
|
}
|
|
12661
|
-
var ChildTerminalStatus =
|
|
12736
|
+
var ChildTerminalStatus = Schema64.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
12662
12737
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
12663
12738
|
});
|
|
12664
12739
|
|
|
@@ -12757,15 +12832,15 @@ __export(exports_skill_registry_service, {
|
|
|
12757
12832
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
12758
12833
|
Service: () => Service43
|
|
12759
12834
|
});
|
|
12760
|
-
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as
|
|
12835
|
+
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema65 } from "effect";
|
|
12761
12836
|
|
|
12762
|
-
class SkillDefinitionInvalid extends
|
|
12763
|
-
message:
|
|
12837
|
+
class SkillDefinitionInvalid extends Schema65.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
12838
|
+
message: Schema65.String
|
|
12764
12839
|
}) {
|
|
12765
12840
|
}
|
|
12766
12841
|
|
|
12767
|
-
class SkillRegistryError extends
|
|
12768
|
-
message:
|
|
12842
|
+
class SkillRegistryError extends Schema65.TaggedErrorClass()("SkillRegistryError", {
|
|
12843
|
+
message: Schema65.String
|
|
12769
12844
|
}) {
|
|
12770
12845
|
}
|
|
12771
12846
|
|
|
@@ -12934,11 +13009,11 @@ __export(exports_execution_service, {
|
|
|
12934
13009
|
Service: () => Service44,
|
|
12935
13010
|
ExecutionServiceError: () => ExecutionServiceError
|
|
12936
13011
|
});
|
|
12937
|
-
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as
|
|
13012
|
+
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as Schema66, Stream as Stream9 } from "effect";
|
|
12938
13013
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
12939
|
-
class ExecutionServiceError extends
|
|
12940
|
-
message:
|
|
12941
|
-
next_event_sequence:
|
|
13014
|
+
class ExecutionServiceError extends Schema66.TaggedErrorClass()("ExecutionServiceError", {
|
|
13015
|
+
message: Schema66.String,
|
|
13016
|
+
next_event_sequence: Schema66.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12942
13017
|
}) {
|
|
12943
13018
|
}
|
|
12944
13019
|
|
|
@@ -13254,13 +13329,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
13254
13329
|
var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
|
|
13255
13330
|
|
|
13256
13331
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13257
|
-
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as
|
|
13332
|
+
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema68 } from "effect";
|
|
13258
13333
|
|
|
13259
13334
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
13260
|
-
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as
|
|
13335
|
+
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema67 } from "effect";
|
|
13261
13336
|
|
|
13262
|
-
class WorkspaceRuntimeError extends
|
|
13263
|
-
message:
|
|
13337
|
+
class WorkspaceRuntimeError extends Schema67.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
13338
|
+
message: Schema67.String
|
|
13264
13339
|
}) {
|
|
13265
13340
|
}
|
|
13266
13341
|
|
|
@@ -13288,18 +13363,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
13288
13363
|
});
|
|
13289
13364
|
|
|
13290
13365
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13291
|
-
class WorkspaceRuntimeMissing extends
|
|
13366
|
+
class WorkspaceRuntimeMissing extends Schema68.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
13292
13367
|
execution_id: exports_ids_schema.ExecutionId
|
|
13293
13368
|
}) {
|
|
13294
13369
|
}
|
|
13295
13370
|
|
|
13296
|
-
class WorkspaceLeaseMissingRef extends
|
|
13371
|
+
class WorkspaceLeaseMissingRef extends Schema68.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
13297
13372
|
execution_id: exports_ids_schema.ExecutionId
|
|
13298
13373
|
}) {
|
|
13299
13374
|
}
|
|
13300
13375
|
|
|
13301
|
-
class WorkspacePlannerError extends
|
|
13302
|
-
message:
|
|
13376
|
+
class WorkspacePlannerError extends Schema68.TaggedErrorClass()("WorkspacePlannerError", {
|
|
13377
|
+
message: Schema68.String
|
|
13303
13378
|
}) {
|
|
13304
13379
|
}
|
|
13305
13380
|
|
|
@@ -13485,67 +13560,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
13485
13560
|
});
|
|
13486
13561
|
|
|
13487
13562
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
13488
|
-
class ExecutionWorkflowFailed extends
|
|
13489
|
-
message:
|
|
13563
|
+
class ExecutionWorkflowFailed extends Schema69.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
13564
|
+
message: Schema69.String
|
|
13490
13565
|
}) {
|
|
13491
13566
|
}
|
|
13492
|
-
var StartInput =
|
|
13567
|
+
var StartInput = Schema69.Struct({
|
|
13493
13568
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13494
13569
|
root_address_id: exports_ids_schema.AddressId,
|
|
13495
|
-
session_id:
|
|
13496
|
-
input:
|
|
13570
|
+
session_id: Schema69.optionalKey(exports_ids_schema.SessionId),
|
|
13571
|
+
input: Schema69.optionalKey(Schema69.Array(exports_content_schema.Part)),
|
|
13497
13572
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
13498
13573
|
started_at: exports_shared_schema.TimestampMillis,
|
|
13499
13574
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
13500
|
-
agent_id:
|
|
13501
|
-
agent_revision:
|
|
13502
|
-
agent_snapshot:
|
|
13503
|
-
agent_tool_input_schema_digests:
|
|
13504
|
-
wait_id:
|
|
13505
|
-
resume_tool_call:
|
|
13506
|
-
workflow_generation:
|
|
13507
|
-
metadata:
|
|
13575
|
+
agent_id: Schema69.optionalKey(exports_ids_schema.AgentId),
|
|
13576
|
+
agent_revision: Schema69.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
13577
|
+
agent_snapshot: Schema69.optionalKey(exports_agent_schema.Definition),
|
|
13578
|
+
agent_tool_input_schema_digests: Schema69.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
13579
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13580
|
+
resume_tool_call: Schema69.optionalKey(exports_tool_schema.Call),
|
|
13581
|
+
workflow_generation: Schema69.optionalKey(Schema69.Int.check(Schema69.isGreaterThanOrEqualTo(0))),
|
|
13582
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13508
13583
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
13509
|
-
var WaitSignalState =
|
|
13584
|
+
var WaitSignalState = Schema69.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
13510
13585
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
13511
13586
|
});
|
|
13512
|
-
var WaitSignal =
|
|
13587
|
+
var WaitSignal = Schema69.Struct({
|
|
13513
13588
|
wait_id: exports_ids_schema.WaitId,
|
|
13514
13589
|
state: WaitSignalState,
|
|
13515
13590
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13516
13591
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
13517
|
-
var SignalWaitInput =
|
|
13518
|
-
workflow_execution_id:
|
|
13592
|
+
var SignalWaitInput = Schema69.Struct({
|
|
13593
|
+
workflow_execution_id: Schema69.String,
|
|
13519
13594
|
wait_id: exports_ids_schema.WaitId,
|
|
13520
13595
|
state: WaitSignalState,
|
|
13521
13596
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13522
13597
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
13523
|
-
var CancelExecutionInput =
|
|
13598
|
+
var CancelExecutionInput = Schema69.Struct({
|
|
13524
13599
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13525
13600
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
13526
|
-
reason:
|
|
13601
|
+
reason: Schema69.optionalKey(Schema69.String)
|
|
13527
13602
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
13528
|
-
var CancelExecutionResult =
|
|
13603
|
+
var CancelExecutionResult = Schema69.Struct({
|
|
13529
13604
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13530
13605
|
status: exports_execution_schema.ExecutionStatus
|
|
13531
13606
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
13532
|
-
var WaitSnapshot =
|
|
13607
|
+
var WaitSnapshot = Schema69.Struct({
|
|
13533
13608
|
id: exports_ids_schema.WaitId,
|
|
13534
13609
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13535
|
-
envelope_id:
|
|
13610
|
+
envelope_id: Schema69.optionalKey(exports_ids_schema.EnvelopeId),
|
|
13536
13611
|
mode: exports_envelope_schema.WaitMode,
|
|
13537
|
-
correlation_key:
|
|
13538
|
-
state:
|
|
13612
|
+
correlation_key: Schema69.optionalKey(Schema69.String),
|
|
13613
|
+
state: Schema69.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
13539
13614
|
metadata: exports_shared_schema.Metadata,
|
|
13540
13615
|
created_at: exports_shared_schema.TimestampMillis,
|
|
13541
|
-
resolved_at:
|
|
13616
|
+
resolved_at: Schema69.optionalKey(exports_shared_schema.TimestampMillis)
|
|
13542
13617
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
13543
|
-
var StartResult =
|
|
13618
|
+
var StartResult = Schema69.Struct({
|
|
13544
13619
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13545
13620
|
status: exports_execution_schema.ExecutionStatus,
|
|
13546
|
-
wait_id:
|
|
13547
|
-
wait_state:
|
|
13548
|
-
metadata:
|
|
13621
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13622
|
+
wait_state: Schema69.optionalKey(Schema69.Literals(["resolved", "timed_out", "cancelled"])),
|
|
13623
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13549
13624
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
13550
13625
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
13551
13626
|
var ActivityNames = {
|
|
@@ -13755,7 +13830,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
13755
13830
|
});
|
|
13756
13831
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
13757
13832
|
name: ActivityNames.checkCancel(turn),
|
|
13758
|
-
success:
|
|
13833
|
+
success: Schema69.Boolean,
|
|
13759
13834
|
error: ExecutionWorkflowFailed,
|
|
13760
13835
|
execute: Effect73.gen(function* () {
|
|
13761
13836
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -13765,7 +13840,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
13765
13840
|
});
|
|
13766
13841
|
var loadWait = (name, waitId) => Activity.make({
|
|
13767
13842
|
name,
|
|
13768
|
-
success:
|
|
13843
|
+
success: Schema69.UndefinedOr(WaitSnapshot),
|
|
13769
13844
|
error: ExecutionWorkflowFailed,
|
|
13770
13845
|
execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
|
|
13771
13846
|
});
|
|
@@ -13856,7 +13931,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
13856
13931
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
13857
13932
|
};
|
|
13858
13933
|
});
|
|
13859
|
-
var decodeMemorySubject = (value) => typeof value === "string" ?
|
|
13934
|
+
var decodeMemorySubject = (value) => typeof value === "string" ? Schema69.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(value).pipe(Effect73.mapError(() => new ExecutionWorkflowFailed({ message: `Invalid memory_subject_id metadata value: ${value}` }))) : Effect73.fail(new ExecutionWorkflowFailed({ message: "memory_subject_id metadata value must be a string" }));
|
|
13860
13935
|
var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
13861
13936
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
13862
13937
|
if (executionSubject !== undefined)
|
|
@@ -13874,7 +13949,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
13874
13949
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
|
|
13875
13950
|
var ensureWorkspace = (input) => Activity.make({
|
|
13876
13951
|
name: ActivityNames.ensureWorkspace,
|
|
13877
|
-
success:
|
|
13952
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13878
13953
|
error: ExecutionWorkflowFailed,
|
|
13879
13954
|
execute: Effect73.gen(function* () {
|
|
13880
13955
|
if (input.agent_snapshot === undefined)
|
|
@@ -13891,19 +13966,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
13891
13966
|
});
|
|
13892
13967
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
13893
13968
|
name: ActivityNames.suspendWorkspace(key2),
|
|
13894
|
-
success:
|
|
13969
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13895
13970
|
error: ExecutionWorkflowFailed,
|
|
13896
13971
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13897
13972
|
});
|
|
13898
13973
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
13899
13974
|
name: ActivityNames.resumeWorkspace(key2),
|
|
13900
|
-
success:
|
|
13975
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13901
13976
|
error: ExecutionWorkflowFailed,
|
|
13902
13977
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
|
|
13903
13978
|
});
|
|
13904
13979
|
var releaseWorkspace = (input) => Activity.make({
|
|
13905
13980
|
name: ActivityNames.releaseWorkspace,
|
|
13906
|
-
success:
|
|
13981
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13907
13982
|
error: ExecutionWorkflowFailed,
|
|
13908
13983
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13909
13984
|
});
|
|
@@ -14004,7 +14079,7 @@ var childDispatchContext = (input) => {
|
|
|
14004
14079
|
};
|
|
14005
14080
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
14006
14081
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
14007
|
-
success:
|
|
14082
|
+
success: Schema69.Boolean,
|
|
14008
14083
|
error: ExecutionWorkflowFailed,
|
|
14009
14084
|
execute: Effect73.gen(function* () {
|
|
14010
14085
|
const context = childDispatchContext(input);
|
|
@@ -14016,7 +14091,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
14016
14091
|
});
|
|
14017
14092
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
14018
14093
|
name: ActivityNames.notifyParent(status),
|
|
14019
|
-
success:
|
|
14094
|
+
success: Schema69.Void,
|
|
14020
14095
|
error: ExecutionWorkflowFailed,
|
|
14021
14096
|
execute: Effect73.gen(function* () {
|
|
14022
14097
|
const notifier = yield* Effect73.serviceOption(Service42);
|
|
@@ -14069,7 +14144,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
14069
14144
|
};
|
|
14070
14145
|
var pendingToolCallFromExecution = (execution) => {
|
|
14071
14146
|
const pending = execution.metadata?.pending_tool_call;
|
|
14072
|
-
return
|
|
14147
|
+
return Schema69.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
14073
14148
|
};
|
|
14074
14149
|
var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
14075
14150
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -14283,7 +14358,7 @@ var Start = Rpc.make("start", {
|
|
|
14283
14358
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14284
14359
|
var SignalWait = Rpc.make("signalWait", {
|
|
14285
14360
|
payload: SignalWaitInput,
|
|
14286
|
-
success:
|
|
14361
|
+
success: Schema70.Void,
|
|
14287
14362
|
error: ExecutionWorkflowFailed
|
|
14288
14363
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14289
14364
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -14297,7 +14372,7 @@ var layer49 = entity.toLayer(entity.of({
|
|
|
14297
14372
|
signalWait: (request) => signalWait(request.payload),
|
|
14298
14373
|
cancel: (request) => cancelRequest(request.payload)
|
|
14299
14374
|
}), { concurrency: "unbounded" });
|
|
14300
|
-
var
|
|
14375
|
+
var client2 = entity.client;
|
|
14301
14376
|
// ../runtime/src/envelope/envelope-service.ts
|
|
14302
14377
|
var exports_envelope_service = {};
|
|
14303
14378
|
__export(exports_envelope_service, {
|
|
@@ -14311,26 +14386,26 @@ __export(exports_envelope_service, {
|
|
|
14311
14386
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
14312
14387
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
14313
14388
|
});
|
|
14314
|
-
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as
|
|
14315
|
-
class EnvelopeAddressNotFound extends
|
|
14389
|
+
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema71 } from "effect";
|
|
14390
|
+
class EnvelopeAddressNotFound extends Schema71.TaggedErrorClass()("EnvelopeAddressNotFound", {
|
|
14316
14391
|
address_id: exports_ids_schema.AddressId
|
|
14317
14392
|
}) {
|
|
14318
14393
|
}
|
|
14319
14394
|
|
|
14320
|
-
class EnvelopeRouteUnavailable extends
|
|
14395
|
+
class EnvelopeRouteUnavailable extends Schema71.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
14321
14396
|
address_id: exports_ids_schema.AddressId,
|
|
14322
|
-
route_key:
|
|
14397
|
+
route_key: Schema71.String
|
|
14323
14398
|
}) {
|
|
14324
14399
|
}
|
|
14325
14400
|
|
|
14326
|
-
class EnvelopeRouteDeferred extends
|
|
14401
|
+
class EnvelopeRouteDeferred extends Schema71.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
14327
14402
|
address_id: exports_ids_schema.AddressId,
|
|
14328
|
-
route_key:
|
|
14403
|
+
route_key: Schema71.String
|
|
14329
14404
|
}) {
|
|
14330
14405
|
}
|
|
14331
14406
|
|
|
14332
|
-
class EnvelopeServiceError extends
|
|
14333
|
-
message:
|
|
14407
|
+
class EnvelopeServiceError extends Schema71.TaggedErrorClass()("EnvelopeServiceError", {
|
|
14408
|
+
message: Schema71.String
|
|
14334
14409
|
}) {
|
|
14335
14410
|
}
|
|
14336
14411
|
|
|
@@ -14488,7 +14563,7 @@ __export(exports_runner_runtime_service, {
|
|
|
14488
14563
|
DatabaseMode: () => DatabaseMode,
|
|
14489
14564
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
14490
14565
|
});
|
|
14491
|
-
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as
|
|
14566
|
+
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as Schema73, Stream as Stream10 } from "effect";
|
|
14492
14567
|
import {
|
|
14493
14568
|
ClusterWorkflowEngine,
|
|
14494
14569
|
HttpRunner,
|
|
@@ -14526,7 +14601,7 @@ __export(exports_scheduler_service, {
|
|
|
14526
14601
|
SchedulerError: () => SchedulerError,
|
|
14527
14602
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
14528
14603
|
});
|
|
14529
|
-
import { Clock as Clock10, Config as Config4, Context as Context61, Cron, Duration as Duration4, Effect as Effect76, Layer as Layer68, Random, Result as Result3, Schema as
|
|
14604
|
+
import { Clock as Clock10, Config as Config4, Context as Context61, Cron, Duration as Duration4, Effect as Effect76, Layer as Layer68, Random, Result as Result3, Schema as Schema72 } from "effect";
|
|
14530
14605
|
|
|
14531
14606
|
// ../runtime/src/wait/wait-signal.ts
|
|
14532
14607
|
var exports_wait_signal = {};
|
|
@@ -14536,8 +14611,8 @@ __export(exports_wait_signal, {
|
|
|
14536
14611
|
import { Effect as Effect75 } from "effect";
|
|
14537
14612
|
var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function* (input) {
|
|
14538
14613
|
const workflowExecutionId2 = yield* activeWorkflowExecutionIdForExecution(input.executionId);
|
|
14539
|
-
const
|
|
14540
|
-
yield*
|
|
14614
|
+
const client3 = input.makeExecutionClient(input.executionId);
|
|
14615
|
+
yield* client3.signalWait({
|
|
14541
14616
|
workflow_execution_id: workflowExecutionId2,
|
|
14542
14617
|
wait_id: input.waitId,
|
|
14543
14618
|
state: input.state,
|
|
@@ -14546,14 +14621,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
14546
14621
|
});
|
|
14547
14622
|
|
|
14548
14623
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
14549
|
-
class SchedulerError extends
|
|
14550
|
-
message:
|
|
14624
|
+
class SchedulerError extends Schema72.TaggedErrorClass()("SchedulerError", {
|
|
14625
|
+
message: Schema72.String
|
|
14551
14626
|
}) {
|
|
14552
14627
|
}
|
|
14553
14628
|
|
|
14554
|
-
class ScheduleCronInvalid extends
|
|
14555
|
-
cron_expr:
|
|
14556
|
-
message:
|
|
14629
|
+
class ScheduleCronInvalid extends Schema72.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
14630
|
+
cron_expr: Schema72.String,
|
|
14631
|
+
message: Schema72.String
|
|
14557
14632
|
}) {
|
|
14558
14633
|
}
|
|
14559
14634
|
|
|
@@ -14591,7 +14666,7 @@ var make14 = Effect76.gen(function* () {
|
|
|
14591
14666
|
const waits = yield* Service25;
|
|
14592
14667
|
const eventLog = yield* Service24;
|
|
14593
14668
|
const executionRepository = yield* exports_execution_repository.Service;
|
|
14594
|
-
const makeExecutionClient = yield*
|
|
14669
|
+
const makeExecutionClient = yield* client2;
|
|
14595
14670
|
const workerId = yield* workerIdConfig;
|
|
14596
14671
|
const claimTtlMillis = yield* claimTtlMillisConfig;
|
|
14597
14672
|
const pollIntervalMillis = yield* pollIntervalMillisConfig;
|
|
@@ -14704,25 +14779,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
14704
14779
|
});
|
|
14705
14780
|
|
|
14706
14781
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
14707
|
-
var DatabaseMode =
|
|
14782
|
+
var DatabaseMode = Schema73.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
|
|
14708
14783
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
14709
14784
|
});
|
|
14710
|
-
var ReadinessStatus =
|
|
14785
|
+
var ReadinessStatus = Schema73.Struct({
|
|
14711
14786
|
database: DatabaseMode,
|
|
14712
|
-
cluster:
|
|
14713
|
-
workflow:
|
|
14714
|
-
executionEntity:
|
|
14787
|
+
cluster: Schema73.Literal("ready"),
|
|
14788
|
+
workflow: Schema73.Literals(["ready", "client"]),
|
|
14789
|
+
executionEntity: Schema73.Literals(["registered", "client"])
|
|
14715
14790
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
14716
14791
|
|
|
14717
|
-
class RunnerRuntimeError extends
|
|
14718
|
-
message:
|
|
14792
|
+
class RunnerRuntimeError extends Schema73.TaggedErrorClass()("RunnerRuntimeError", {
|
|
14793
|
+
message: Schema73.String
|
|
14719
14794
|
}) {
|
|
14720
14795
|
}
|
|
14721
14796
|
|
|
14722
|
-
class ClusterConfigMismatch extends
|
|
14723
|
-
field:
|
|
14724
|
-
expected:
|
|
14725
|
-
actual:
|
|
14797
|
+
class ClusterConfigMismatch extends Schema73.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
14798
|
+
field: Schema73.String,
|
|
14799
|
+
expected: Schema73.String,
|
|
14800
|
+
actual: Schema73.String
|
|
14726
14801
|
}) {
|
|
14727
14802
|
}
|
|
14728
14803
|
|
|
@@ -14736,7 +14811,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
|
|
|
14736
14811
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
14737
14812
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
14738
14813
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
14739
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
14814
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema73.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
14740
14815
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
14741
14816
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
14742
14817
|
var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
|
|
@@ -14837,7 +14912,7 @@ var testCryptoLayer = Layer69.succeed(Crypto4.Crypto, Crypto4.make({
|
|
|
14837
14912
|
var executionServiceLayer = layer46.pipe(Layer69.provideMerge(layer32));
|
|
14838
14913
|
var addressResolutionLayerWith = (toolRuntimeLayer) => layer25.pipe(Layer69.provideMerge(layerFromRepository), Layer69.provideMerge(layer24.pipe(Layer69.provideMerge(toolRuntimeLayer))));
|
|
14839
14914
|
var parentNotifierLayer = Layer69.effect(Service42, Effect77.gen(function* () {
|
|
14840
|
-
const makeExecutionClient = yield*
|
|
14915
|
+
const makeExecutionClient = yield* client2;
|
|
14841
14916
|
const executionRepository = yield* exports_execution_repository.Service;
|
|
14842
14917
|
return yield* make13({
|
|
14843
14918
|
signalWait: (input) => signalWorkflowWait({
|
|
@@ -14856,7 +14931,7 @@ var workflowAndEntityLayerWith = (toolRuntimeLayer, schedulerLayer, promptAssemb
|
|
|
14856
14931
|
var makeService2 = (database, checkDatabase) => Effect77.gen(function* () {
|
|
14857
14932
|
const sharding = yield* Sharding.Sharding;
|
|
14858
14933
|
const workflow = yield* WorkflowEngine.WorkflowEngine;
|
|
14859
|
-
const makeClient = yield*
|
|
14934
|
+
const makeClient = yield* client2;
|
|
14860
14935
|
return Service49.of({
|
|
14861
14936
|
check: Effect77.fn("RunnerRuntime.check")(function* () {
|
|
14862
14937
|
yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
|
|
@@ -14903,7 +14978,7 @@ var sqlCheckLayer = Layer69.effect(Service49, Effect77.gen(function* () {
|
|
|
14903
14978
|
}));
|
|
14904
14979
|
var makeClientService = (database, checkDatabase) => Effect77.gen(function* () {
|
|
14905
14980
|
const sharding = yield* Sharding.Sharding;
|
|
14906
|
-
const makeClient = yield*
|
|
14981
|
+
const makeClient = yield* client2;
|
|
14907
14982
|
return Service49.of({
|
|
14908
14983
|
check: Effect77.fn("RunnerRuntime.check")(function* () {
|
|
14909
14984
|
yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
|
|
@@ -15066,51 +15141,51 @@ __export(exports_activity_version_registry, {
|
|
|
15066
15141
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
15067
15142
|
ActivityManifest: () => ActivityManifest
|
|
15068
15143
|
});
|
|
15069
|
-
import { Crypto as Crypto5, Effect as Effect78, Schema as
|
|
15144
|
+
import { Crypto as Crypto5, Effect as Effect78, Schema as Schema74 } from "effect";
|
|
15070
15145
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
15071
|
-
var ActivityManifestEntry =
|
|
15072
|
-
name:
|
|
15073
|
-
signature_hash:
|
|
15146
|
+
var ActivityManifestEntry = Schema74.Struct({
|
|
15147
|
+
name: Schema74.String,
|
|
15148
|
+
signature_hash: Schema74.String
|
|
15074
15149
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
15075
|
-
var ActivityManifest =
|
|
15076
|
-
version:
|
|
15077
|
-
generated_from:
|
|
15078
|
-
hash_algorithm:
|
|
15079
|
-
activities:
|
|
15150
|
+
var ActivityManifest = Schema74.Struct({
|
|
15151
|
+
version: Schema74.Literal(1),
|
|
15152
|
+
generated_from: Schema74.String,
|
|
15153
|
+
hash_algorithm: Schema74.Literal("sha256-json-schema-v1"),
|
|
15154
|
+
activities: Schema74.Array(ActivityManifestEntry)
|
|
15080
15155
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
15081
|
-
var ActivityManifestChange =
|
|
15082
|
-
type:
|
|
15083
|
-
name:
|
|
15084
|
-
baseline_hash:
|
|
15085
|
-
current_hash:
|
|
15156
|
+
var ActivityManifestChange = Schema74.Struct({
|
|
15157
|
+
type: Schema74.Literals(["removed", "changed", "added"]),
|
|
15158
|
+
name: Schema74.String,
|
|
15159
|
+
baseline_hash: Schema74.optionalKey(Schema74.String),
|
|
15160
|
+
current_hash: Schema74.optionalKey(Schema74.String)
|
|
15086
15161
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
15087
|
-
var ActivityManifestGuardResult =
|
|
15088
|
-
status:
|
|
15089
|
-
waiting_executions:
|
|
15090
|
-
breaking_changes:
|
|
15091
|
-
additive_changes:
|
|
15162
|
+
var ActivityManifestGuardResult = Schema74.Struct({
|
|
15163
|
+
status: Schema74.Literals(["pass", "fail"]),
|
|
15164
|
+
waiting_executions: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15165
|
+
breaking_changes: Schema74.Array(ActivityManifestChange),
|
|
15166
|
+
additive_changes: Schema74.Array(ActivityManifestChange)
|
|
15092
15167
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
15093
15168
|
|
|
15094
|
-
class ActivityManifestGuardFailed extends
|
|
15095
|
-
message:
|
|
15169
|
+
class ActivityManifestGuardFailed extends Schema74.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
15170
|
+
message: Schema74.String,
|
|
15096
15171
|
result: ActivityManifestGuardResult
|
|
15097
15172
|
}) {
|
|
15098
15173
|
}
|
|
15099
|
-
var TurnInput =
|
|
15174
|
+
var TurnInput = Schema74.Struct({
|
|
15100
15175
|
start: StartInput,
|
|
15101
|
-
turn:
|
|
15176
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0))
|
|
15102
15177
|
});
|
|
15103
|
-
var WaitIdInput =
|
|
15178
|
+
var WaitIdInput = Schema74.Struct({
|
|
15104
15179
|
wait_id: exports_ids_schema.WaitId
|
|
15105
15180
|
});
|
|
15106
|
-
var WorkspaceKeyInput =
|
|
15181
|
+
var WorkspaceKeyInput = Schema74.Struct({
|
|
15107
15182
|
start: StartInput,
|
|
15108
|
-
key:
|
|
15183
|
+
key: Schema74.String
|
|
15109
15184
|
});
|
|
15110
15185
|
var contracts = [
|
|
15111
15186
|
{
|
|
15112
15187
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
15113
|
-
input:
|
|
15188
|
+
input: Schema74.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
15114
15189
|
success: LocalAgentTarget,
|
|
15115
15190
|
error: ExecutionWorkflowFailed
|
|
15116
15191
|
},
|
|
@@ -15122,66 +15197,66 @@ var contracts = [
|
|
|
15122
15197
|
},
|
|
15123
15198
|
{
|
|
15124
15199
|
name: ActivityNameTemplates.cancel,
|
|
15125
|
-
input:
|
|
15200
|
+
input: Schema74.Struct({ start: StartInput, turn: Schema74.Int, reason: Schema74.String }),
|
|
15126
15201
|
success: exports_execution_schema.Execution,
|
|
15127
15202
|
error: ExecutionWorkflowFailed
|
|
15128
15203
|
},
|
|
15129
15204
|
{
|
|
15130
15205
|
name: ActivityNameTemplates.checkCancel,
|
|
15131
15206
|
input: TurnInput,
|
|
15132
|
-
success:
|
|
15207
|
+
success: Schema74.Boolean,
|
|
15133
15208
|
error: ExecutionWorkflowFailed
|
|
15134
15209
|
},
|
|
15135
15210
|
{
|
|
15136
15211
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
15137
15212
|
input: WaitIdInput,
|
|
15138
|
-
success:
|
|
15213
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15139
15214
|
error: ExecutionWorkflowFailed
|
|
15140
15215
|
},
|
|
15141
15216
|
{
|
|
15142
15217
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
15143
15218
|
input: WaitIdInput,
|
|
15144
|
-
success:
|
|
15219
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15145
15220
|
error: ExecutionWorkflowFailed
|
|
15146
15221
|
},
|
|
15147
15222
|
{
|
|
15148
15223
|
name: ActivityNameTemplates.markWaiting,
|
|
15149
|
-
input:
|
|
15224
|
+
input: Schema74.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
15150
15225
|
success: exports_execution_schema.Execution,
|
|
15151
15226
|
error: ExecutionWorkflowFailed
|
|
15152
15227
|
},
|
|
15153
15228
|
{
|
|
15154
15229
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
15155
15230
|
input: StartInput,
|
|
15156
|
-
success:
|
|
15231
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15157
15232
|
error: ExecutionWorkflowFailed
|
|
15158
15233
|
},
|
|
15159
15234
|
{
|
|
15160
15235
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
15161
15236
|
input: WorkspaceKeyInput,
|
|
15162
|
-
success:
|
|
15237
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15163
15238
|
error: ExecutionWorkflowFailed
|
|
15164
15239
|
},
|
|
15165
15240
|
{
|
|
15166
15241
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
15167
15242
|
input: WorkspaceKeyInput,
|
|
15168
|
-
success:
|
|
15243
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15169
15244
|
error: ExecutionWorkflowFailed
|
|
15170
15245
|
},
|
|
15171
15246
|
{
|
|
15172
15247
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
15173
15248
|
input: StartInput,
|
|
15174
|
-
success:
|
|
15249
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15175
15250
|
error: ExecutionWorkflowFailed
|
|
15176
15251
|
},
|
|
15177
15252
|
{
|
|
15178
15253
|
name: ActivityNameTemplates.complete,
|
|
15179
|
-
input:
|
|
15254
|
+
input: Schema74.Struct({
|
|
15180
15255
|
start: StartInput,
|
|
15181
|
-
turn:
|
|
15182
|
-
wait_id:
|
|
15183
|
-
wait_state:
|
|
15184
|
-
pending_tool_call:
|
|
15256
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15257
|
+
wait_id: Schema74.optionalKey(exports_ids_schema.WaitId),
|
|
15258
|
+
wait_state: Schema74.optionalKey(WaitSignalState),
|
|
15259
|
+
pending_tool_call: Schema74.optionalKey(exports_tool_schema.Call)
|
|
15185
15260
|
}),
|
|
15186
15261
|
success: exports_execution_schema.Execution,
|
|
15187
15262
|
error: ExecutionWorkflowFailed
|
|
@@ -15189,24 +15264,24 @@ var contracts = [
|
|
|
15189
15264
|
{
|
|
15190
15265
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
15191
15266
|
input: StartInput,
|
|
15192
|
-
success:
|
|
15267
|
+
success: Schema74.Boolean,
|
|
15193
15268
|
error: ExecutionWorkflowFailed
|
|
15194
15269
|
},
|
|
15195
15270
|
{
|
|
15196
15271
|
name: ActivityNameTemplates.notifyParent,
|
|
15197
|
-
input:
|
|
15272
|
+
input: Schema74.Struct({
|
|
15198
15273
|
start: StartInput,
|
|
15199
15274
|
status: ChildTerminalStatus,
|
|
15200
|
-
output:
|
|
15275
|
+
output: Schema74.Array(exports_content_schema.Part)
|
|
15201
15276
|
}),
|
|
15202
|
-
success:
|
|
15277
|
+
success: Schema74.Void,
|
|
15203
15278
|
error: ExecutionWorkflowFailed
|
|
15204
15279
|
},
|
|
15205
15280
|
{
|
|
15206
15281
|
name: ActivityNameTemplates.continueAsNew,
|
|
15207
|
-
input:
|
|
15282
|
+
input: Schema74.Struct({
|
|
15208
15283
|
start: StartInput,
|
|
15209
|
-
turn:
|
|
15284
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15210
15285
|
wait_id: exports_ids_schema.WaitId,
|
|
15211
15286
|
pending_tool_call: exports_tool_schema.Call
|
|
15212
15287
|
}),
|
|
@@ -15214,7 +15289,7 @@ var contracts = [
|
|
|
15214
15289
|
error: ExecutionWorkflowFailed
|
|
15215
15290
|
}
|
|
15216
15291
|
];
|
|
15217
|
-
var schemaJson = (schema) =>
|
|
15292
|
+
var schemaJson = (schema) => Schema74.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema74.toJsonSchemaDocument(schema));
|
|
15218
15293
|
var canonical = (value) => {
|
|
15219
15294
|
if (value === null || typeof value !== "object")
|
|
15220
15295
|
return value;
|
|
@@ -15305,11 +15380,11 @@ var guard = Effect78.fn("ActivityVersionRegistry.guard")(function* (input) {
|
|
|
15305
15380
|
}));
|
|
15306
15381
|
});
|
|
15307
15382
|
// src/client.ts
|
|
15308
|
-
import { Clock as Clock11, Context as Context63, Effect as Effect79, Layer as Layer70, Option as Option28, Schema as
|
|
15383
|
+
import { Clock as Clock11, Context as Context63, Effect as Effect79, Layer as Layer70, Option as Option28, Schema as Schema75, SchemaGetter, SchemaIssue, Stream as Stream11 } from "effect";
|
|
15309
15384
|
import { EntityId, ShardId, Sharding as Sharding2, ShardingConfig as ShardingConfig3 } from "effect/unstable/cluster";
|
|
15310
15385
|
|
|
15311
|
-
class ClientError extends
|
|
15312
|
-
message:
|
|
15386
|
+
class ClientError extends Schema75.TaggedErrorClass()("ClientError", {
|
|
15387
|
+
message: Schema75.String
|
|
15313
15388
|
}) {
|
|
15314
15389
|
}
|
|
15315
15390
|
|
|
@@ -15341,11 +15416,11 @@ var decodeCursorFields = (wire) => Effect79.gen(function* () {
|
|
|
15341
15416
|
return yield* Effect79.fail(malformedCursor(wire));
|
|
15342
15417
|
return { updatedAt, id: decoded.slice(separator + 1) };
|
|
15343
15418
|
});
|
|
15344
|
-
var ExecutionCursorFromString = exports_shared_schema.NonEmptyString.pipe(
|
|
15419
|
+
var ExecutionCursorFromString = exports_shared_schema.NonEmptyString.pipe(Schema75.decodeTo(Schema75.Struct({ updatedAt: Schema75.Int, id: exports_ids_schema.ExecutionId }), {
|
|
15345
15420
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
15346
15421
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
15347
15422
|
})).annotate({ identifier: "Relay.Client.ExecutionCursor" });
|
|
15348
|
-
var SessionCursorFromString = exports_shared_schema.NonEmptyString.pipe(
|
|
15423
|
+
var SessionCursorFromString = exports_shared_schema.NonEmptyString.pipe(Schema75.decodeTo(Schema75.Struct({ updatedAt: Schema75.Int, id: exports_ids_schema.SessionId }), {
|
|
15349
15424
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
15350
15425
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
15351
15426
|
})).annotate({ identifier: "Relay.Client.SessionCursor" });
|
|
@@ -15433,7 +15508,7 @@ var registerAgentPayload = (input) => {
|
|
|
15433
15508
|
return exports_agent_schema.define(input);
|
|
15434
15509
|
return exports_agent_schema.define({
|
|
15435
15510
|
id: input.id,
|
|
15436
|
-
name:
|
|
15511
|
+
name: Schema75.decodeUnknownSync(exports_shared_schema.NonEmptyString)(input.agent.name),
|
|
15437
15512
|
...input.agent.instructions === undefined ? {} : { instructions: input.agent.instructions },
|
|
15438
15513
|
model: input.model,
|
|
15439
15514
|
tools: toolRefsFromBatonAgent(input.agent),
|
|
@@ -15624,25 +15699,25 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15624
15699
|
return yield* addressBook.list().pipe(Effect79.mapError(toClientError));
|
|
15625
15700
|
}),
|
|
15626
15701
|
startExecution: Effect79.fn("Client.runtime.startExecution")(function* (input) {
|
|
15627
|
-
const
|
|
15628
|
-
return yield*
|
|
15702
|
+
const client3 = makeExecutionClient(input.execution_id);
|
|
15703
|
+
return yield* client3.start(input).pipe(Effect79.mapError(toClientError));
|
|
15629
15704
|
}),
|
|
15630
15705
|
startExecutionByAddress: Effect79.fn("Client.runtime.startExecutionByAddress")(function* (input) {
|
|
15631
15706
|
const payload = startExecutionByAddressPayload(input);
|
|
15632
|
-
const
|
|
15633
|
-
return yield*
|
|
15707
|
+
const client3 = makeExecutionClient(payload.execution_id);
|
|
15708
|
+
return yield* client3.start(payload).pipe(Effect79.mapError(toClientError));
|
|
15634
15709
|
}),
|
|
15635
15710
|
startExecutionByAgentDefinition: Effect79.fn("Client.runtime.startExecutionByAgentDefinition")(function* (input) {
|
|
15636
15711
|
const definition = yield* agentRegistry.get(input.agent_id).pipe(Effect79.mapError(toClientError));
|
|
15637
15712
|
if (definition === undefined)
|
|
15638
15713
|
return yield* Effect79.fail(agentDefinitionNotFound(input.agent_id));
|
|
15639
15714
|
const payload = startExecutionByAgentDefinitionPayload(input, definition);
|
|
15640
|
-
const
|
|
15641
|
-
return yield*
|
|
15715
|
+
const client3 = makeExecutionClient(payload.execution_id);
|
|
15716
|
+
return yield* client3.start(payload).pipe(Effect79.mapError(toClientError));
|
|
15642
15717
|
}),
|
|
15643
15718
|
cancelExecution: Effect79.fn("Client.runtime.cancelExecution")(function* (input) {
|
|
15644
|
-
const
|
|
15645
|
-
return yield*
|
|
15719
|
+
const client3 = makeExecutionClient(input.execution_id);
|
|
15720
|
+
return yield* client3.cancel({
|
|
15646
15721
|
execution_id: input.execution_id,
|
|
15647
15722
|
cancelled_at: input.cancelled_at,
|
|
15648
15723
|
...input.reason === undefined ? {} : { reason: input.reason }
|
|
@@ -15677,27 +15752,27 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15677
15752
|
return records.map(toWaitView);
|
|
15678
15753
|
}),
|
|
15679
15754
|
listExecutions: Effect79.fn("Client.runtime.listExecutions")(function* (input) {
|
|
15680
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15755
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15681
15756
|
const result = yield* executionRepository.list({
|
|
15682
15757
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
15683
15758
|
...input.status === undefined ? {} : { status: input.status },
|
|
15684
15759
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15685
15760
|
...cursor === undefined ? {} : { cursor }
|
|
15686
15761
|
}).pipe(Effect79.mapError(toClientError));
|
|
15687
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15762
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15688
15763
|
return {
|
|
15689
15764
|
records: result.records.map(toConversationSummary),
|
|
15690
15765
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
15691
15766
|
};
|
|
15692
15767
|
}),
|
|
15693
15768
|
listSessions: Effect79.fn("Client.runtime.listSessions")(function* (input) {
|
|
15694
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15769
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(SessionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15695
15770
|
const result = yield* sessionRepository.list({
|
|
15696
15771
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
15697
15772
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15698
15773
|
...cursor === undefined ? {} : { cursor }
|
|
15699
15774
|
}).pipe(Effect79.mapError(toClientError));
|
|
15700
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15775
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(SessionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15701
15776
|
return {
|
|
15702
15777
|
records: result.records.map(toSessionSummary),
|
|
15703
15778
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
@@ -15707,13 +15782,13 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15707
15782
|
const session = yield* sessionRepository.get(input.session_id).pipe(Effect79.mapError(toClientError));
|
|
15708
15783
|
if (session === undefined)
|
|
15709
15784
|
return yield* new ClientError({ message: `Session not found: ${input.session_id}` });
|
|
15710
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15785
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15711
15786
|
const result = yield* executionRepository.list({
|
|
15712
15787
|
sessionId: input.session_id,
|
|
15713
15788
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15714
15789
|
...cursor === undefined ? {} : { cursor }
|
|
15715
15790
|
}).pipe(Effect79.mapError(toClientError));
|
|
15716
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15791
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15717
15792
|
return {
|
|
15718
15793
|
session: toSessionSummary(session),
|
|
15719
15794
|
executions: result.records.map(toConversationSummary),
|
|
@@ -15802,8 +15877,8 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15802
15877
|
const createdAt = input.created_at ?? (yield* Clock11.currentTimeMillis);
|
|
15803
15878
|
const parentWaitId = input.wait === true ? yield* createChildJoinWait(waits, eventLog, input, accepted2, createdAt) : undefined;
|
|
15804
15879
|
const startPayload = childStartInput(input, accepted2, pin, definition, createdAt, parentWaitId);
|
|
15805
|
-
const
|
|
15806
|
-
yield*
|
|
15880
|
+
const client3 = makeExecutionClient(startPayload.execution_id);
|
|
15881
|
+
yield* client3.start(startPayload).pipe(Effect79.catchCause(() => Effect79.void), Effect79.forkDetach);
|
|
15807
15882
|
return accepted2;
|
|
15808
15883
|
}),
|
|
15809
15884
|
claimEnvelopeReady: Effect79.fn("Client.runtime.claimEnvelopeReady")(function* (input) {
|
|
@@ -16023,19 +16098,19 @@ var listSchedules = Effect79.fn("Client.listSchedules.call")(function* (input) {
|
|
|
16023
16098
|
class Service51 extends Context64.Service()("@relayfx/sdk/AdapterOutbox") {
|
|
16024
16099
|
}
|
|
16025
16100
|
var layer53 = Layer71.effect(Service51, Effect80.gen(function* () {
|
|
16026
|
-
const
|
|
16101
|
+
const client3 = yield* Service50;
|
|
16027
16102
|
return Service51.of({
|
|
16028
16103
|
claim: Effect80.fn("AdapterOutbox.claim")(function* (input) {
|
|
16029
|
-
return yield*
|
|
16104
|
+
return yield* client3.claimEnvelopeReady(input);
|
|
16030
16105
|
}),
|
|
16031
16106
|
ack: Effect80.fn("AdapterOutbox.ack")(function* (input) {
|
|
16032
|
-
return yield*
|
|
16107
|
+
return yield* client3.ackEnvelopeReady(input);
|
|
16033
16108
|
}),
|
|
16034
16109
|
release: Effect80.fn("AdapterOutbox.release")(function* (input) {
|
|
16035
|
-
return yield*
|
|
16110
|
+
return yield* client3.releaseEnvelopeReady(input);
|
|
16036
16111
|
}),
|
|
16037
16112
|
submitInbound: Effect80.fn("AdapterOutbox.submitInbound")(function* (input) {
|
|
16038
|
-
return yield*
|
|
16113
|
+
return yield* client3.submitInboundEnvelope(input);
|
|
16039
16114
|
})
|
|
16040
16115
|
});
|
|
16041
16116
|
}));
|
|
@@ -16126,92 +16201,92 @@ __export(exports_operation, {
|
|
|
16126
16201
|
CancelExecutionAccepted: () => CancelExecutionAccepted,
|
|
16127
16202
|
AckEnvelopeReadyInput: () => AckEnvelopeReadyInput
|
|
16128
16203
|
});
|
|
16129
|
-
import { Schema as
|
|
16130
|
-
var StartExecutionInput =
|
|
16204
|
+
import { Schema as Schema76 } from "effect";
|
|
16205
|
+
var StartExecutionInput = Schema76.Struct({
|
|
16131
16206
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16132
16207
|
root_address_id: exports_ids_schema.AddressId,
|
|
16133
|
-
session_id:
|
|
16134
|
-
input:
|
|
16208
|
+
session_id: Schema76.optionalKey(exports_ids_schema.SessionId),
|
|
16209
|
+
input: Schema76.optionalKey(Schema76.Array(exports_content_schema.Part)),
|
|
16135
16210
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
16136
16211
|
started_at: exports_shared_schema.TimestampMillis,
|
|
16137
16212
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
16138
|
-
agent_id:
|
|
16139
|
-
agent_revision:
|
|
16140
|
-
agent_snapshot:
|
|
16141
|
-
agent_tool_input_schema_digests:
|
|
16142
|
-
wait_id:
|
|
16143
|
-
metadata:
|
|
16213
|
+
agent_id: Schema76.optionalKey(exports_ids_schema.AgentId),
|
|
16214
|
+
agent_revision: Schema76.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
16215
|
+
agent_snapshot: Schema76.optionalKey(exports_agent_schema.Definition),
|
|
16216
|
+
agent_tool_input_schema_digests: Schema76.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
16217
|
+
wait_id: Schema76.optionalKey(exports_ids_schema.WaitId),
|
|
16218
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16144
16219
|
}).annotate({ identifier: "Relay.Operation.StartExecutionInput" });
|
|
16145
|
-
var StartExecutionResult =
|
|
16220
|
+
var StartExecutionResult = Schema76.Struct({
|
|
16146
16221
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16147
16222
|
status: exports_execution_schema.ExecutionStatus,
|
|
16148
|
-
metadata:
|
|
16223
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16149
16224
|
}).annotate({ identifier: "Relay.Operation.StartExecutionResult" });
|
|
16150
|
-
var StreamExecutionInput =
|
|
16225
|
+
var StreamExecutionInput = Schema76.Struct({
|
|
16151
16226
|
execution_id: exports_execution_schema.Execution.fields.id,
|
|
16152
|
-
after_cursor:
|
|
16153
|
-
limit:
|
|
16227
|
+
after_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16228
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0)))
|
|
16154
16229
|
}).annotate({ identifier: "Relay.Operation.StreamExecutionInput" });
|
|
16155
|
-
var WaitTerminalState =
|
|
16230
|
+
var WaitTerminalState = Schema76.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
16156
16231
|
identifier: "Relay.Operation.WaitTerminalState"
|
|
16157
16232
|
});
|
|
16158
|
-
var CancelExecutionInput2 =
|
|
16233
|
+
var CancelExecutionInput2 = Schema76.Struct({
|
|
16159
16234
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16160
16235
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
16161
|
-
reason:
|
|
16236
|
+
reason: Schema76.optionalKey(Schema76.String)
|
|
16162
16237
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionInput" });
|
|
16163
|
-
var CancelExecutionAccepted =
|
|
16238
|
+
var CancelExecutionAccepted = Schema76.Struct({
|
|
16164
16239
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16165
16240
|
status: exports_execution_schema.ExecutionStatus
|
|
16166
16241
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionAccepted" });
|
|
16167
|
-
var SteeringKind =
|
|
16242
|
+
var SteeringKind = Schema76.Literals(["steering", "follow_up"]).annotate({
|
|
16168
16243
|
identifier: "Relay.Operation.SteeringKind"
|
|
16169
16244
|
});
|
|
16170
|
-
var SteerInput =
|
|
16245
|
+
var SteerInput = Schema76.Struct({
|
|
16171
16246
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16172
16247
|
kind: SteeringKind,
|
|
16173
|
-
content:
|
|
16248
|
+
content: Schema76.Array(exports_content_schema.Part),
|
|
16174
16249
|
created_at: exports_shared_schema.TimestampMillis
|
|
16175
16250
|
}).annotate({ identifier: "Relay.Operation.SteerInput" });
|
|
16176
|
-
var SteerAccepted =
|
|
16251
|
+
var SteerAccepted = Schema76.Struct({
|
|
16177
16252
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16178
16253
|
kind: SteeringKind,
|
|
16179
|
-
sequence:
|
|
16254
|
+
sequence: Schema76.Int.check(Schema76.isGreaterThanOrEqualTo(0))
|
|
16180
16255
|
}).annotate({ identifier: "Relay.Operation.SteerAccepted" });
|
|
16181
|
-
var WakeInput =
|
|
16256
|
+
var WakeInput = Schema76.Struct({
|
|
16182
16257
|
wait_id: exports_ids_schema.WaitId,
|
|
16183
16258
|
state: WaitTerminalState,
|
|
16184
16259
|
signaled_at: exports_shared_schema.TimestampMillis,
|
|
16185
|
-
from:
|
|
16186
|
-
content:
|
|
16187
|
-
correlation_key:
|
|
16188
|
-
metadata:
|
|
16260
|
+
from: Schema76.optionalKey(exports_ids_schema.AddressId),
|
|
16261
|
+
content: Schema76.optionalKey(Schema76.Array(exports_content_schema.Part)),
|
|
16262
|
+
correlation_key: Schema76.optionalKey(Schema76.String),
|
|
16263
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16189
16264
|
}).annotate({ identifier: "Relay.Operation.WakeInput" });
|
|
16190
|
-
var WakeAccepted =
|
|
16265
|
+
var WakeAccepted = Schema76.Struct({
|
|
16191
16266
|
wait_id: exports_ids_schema.WaitId,
|
|
16192
16267
|
state: WaitTerminalState,
|
|
16193
16268
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
16194
16269
|
}).annotate({ identifier: "Relay.Operation.WakeAccepted" });
|
|
16195
|
-
var WaitState2 =
|
|
16270
|
+
var WaitState2 = Schema76.Literals(["open", "resolved", "timed_out", "cancelled"]).annotate({
|
|
16196
16271
|
identifier: "Relay.Operation.WaitState"
|
|
16197
16272
|
});
|
|
16198
|
-
var ListWaitsInput =
|
|
16199
|
-
state:
|
|
16200
|
-
execution_id:
|
|
16201
|
-
limit:
|
|
16273
|
+
var ListWaitsInput = Schema76.Struct({
|
|
16274
|
+
state: Schema76.optionalKey(WaitState2),
|
|
16275
|
+
execution_id: Schema76.optionalKey(exports_ids_schema.ExecutionId),
|
|
16276
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0)))
|
|
16202
16277
|
}).annotate({ identifier: "Relay.Operation.ListWaitsInput" });
|
|
16203
|
-
var WaitView =
|
|
16278
|
+
var WaitView = Schema76.Struct({
|
|
16204
16279
|
wait_id: exports_ids_schema.WaitId,
|
|
16205
16280
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16206
|
-
envelope_id:
|
|
16281
|
+
envelope_id: Schema76.optionalKey(exports_ids_schema.EnvelopeId),
|
|
16207
16282
|
mode: exports_envelope_schema.WaitMode,
|
|
16208
|
-
correlation_key:
|
|
16283
|
+
correlation_key: Schema76.optionalKey(Schema76.String),
|
|
16209
16284
|
state: WaitState2,
|
|
16210
16285
|
metadata: exports_shared_schema.Metadata,
|
|
16211
16286
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16212
|
-
resolved_at:
|
|
16287
|
+
resolved_at: Schema76.optionalKey(exports_shared_schema.TimestampMillis)
|
|
16213
16288
|
}).annotate({ identifier: "Relay.Operation.WaitView" });
|
|
16214
|
-
var PendingToolApproval =
|
|
16289
|
+
var PendingToolApproval = Schema76.Struct({
|
|
16215
16290
|
wait_id: exports_ids_schema.WaitId,
|
|
16216
16291
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16217
16292
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
@@ -16219,169 +16294,169 @@ var PendingToolApproval = Schema74.Struct({
|
|
|
16219
16294
|
input: exports_shared_schema.JsonValue,
|
|
16220
16295
|
requested_at: exports_shared_schema.TimestampMillis
|
|
16221
16296
|
}).annotate({ identifier: "Relay.Operation.PendingToolApproval" });
|
|
16222
|
-
var ListPendingApprovalsInput =
|
|
16297
|
+
var ListPendingApprovalsInput = Schema76.Struct({
|
|
16223
16298
|
execution_id: exports_ids_schema.ExecutionId
|
|
16224
16299
|
}).annotate({ identifier: "Relay.Operation.ListPendingApprovalsInput" });
|
|
16225
|
-
var PendingToolApprovalList =
|
|
16226
|
-
approvals:
|
|
16300
|
+
var PendingToolApprovalList = Schema76.Struct({
|
|
16301
|
+
approvals: Schema76.Array(PendingToolApproval)
|
|
16227
16302
|
}).annotate({ identifier: "Relay.Operation.PendingToolApprovalList" });
|
|
16228
|
-
var ResolveToolApprovalInput =
|
|
16303
|
+
var ResolveToolApprovalInput = Schema76.Struct({
|
|
16229
16304
|
wait_id: exports_ids_schema.WaitId,
|
|
16230
|
-
approved:
|
|
16231
|
-
comment:
|
|
16305
|
+
approved: Schema76.Boolean,
|
|
16306
|
+
comment: Schema76.optionalKey(Schema76.String),
|
|
16232
16307
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
16233
16308
|
}).annotate({ identifier: "Relay.Operation.ResolveToolApprovalInput" });
|
|
16234
|
-
var PermissionAnswer =
|
|
16309
|
+
var PermissionAnswer = Schema76.Literals(["Approved", "Denied", "Always"]).annotate({
|
|
16235
16310
|
identifier: "Relay.Operation.PermissionAnswer"
|
|
16236
16311
|
});
|
|
16237
|
-
var ResolvePermissionInput =
|
|
16312
|
+
var ResolvePermissionInput = Schema76.Struct({
|
|
16238
16313
|
wait_id: exports_ids_schema.WaitId,
|
|
16239
16314
|
answer: PermissionAnswer,
|
|
16240
|
-
reason:
|
|
16315
|
+
reason: Schema76.optionalKey(Schema76.String),
|
|
16241
16316
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
16242
16317
|
}).annotate({ identifier: "Relay.Operation.ResolvePermissionInput" });
|
|
16243
|
-
var SubmitInboundEnvelopeInput =
|
|
16318
|
+
var SubmitInboundEnvelopeInput = Schema76.Struct({
|
|
16244
16319
|
envelope: exports_envelope_schema.SendInput,
|
|
16245
16320
|
wake: WakeInput
|
|
16246
16321
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeInput" });
|
|
16247
|
-
var SubmitInboundEnvelopeAccepted =
|
|
16322
|
+
var SubmitInboundEnvelopeAccepted = Schema76.Struct({
|
|
16248
16323
|
envelope: exports_envelope_schema.EnvelopeAccepted,
|
|
16249
16324
|
wake: WakeAccepted
|
|
16250
16325
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeAccepted" });
|
|
16251
|
-
var ClaimEnvelopeReadyInput =
|
|
16326
|
+
var ClaimEnvelopeReadyInput = Schema76.Struct({
|
|
16252
16327
|
route_type: exports_address_schema.RouteKind,
|
|
16253
|
-
route_key:
|
|
16328
|
+
route_key: Schema76.optionalKey(Schema76.String),
|
|
16254
16329
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16255
16330
|
now: exports_shared_schema.TimestampMillis,
|
|
16256
16331
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
16257
16332
|
}).annotate({ identifier: "Relay.Operation.ClaimEnvelopeReadyInput" });
|
|
16258
|
-
var EnvelopeReadyLease =
|
|
16333
|
+
var EnvelopeReadyLease = Schema76.Struct({
|
|
16259
16334
|
ready: exports_envelope_schema.EnvelopeReady,
|
|
16260
16335
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16261
16336
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
16262
16337
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyLease" });
|
|
16263
|
-
var AckEnvelopeReadyInput =
|
|
16338
|
+
var AckEnvelopeReadyInput = Schema76.Struct({
|
|
16264
16339
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16265
16340
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16266
16341
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
16267
16342
|
}).annotate({ identifier: "Relay.Operation.AckEnvelopeReadyInput" });
|
|
16268
|
-
var EnvelopeReadyAcked =
|
|
16343
|
+
var EnvelopeReadyAcked = Schema76.Struct({
|
|
16269
16344
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16270
|
-
state:
|
|
16345
|
+
state: Schema76.Literal("acknowledged"),
|
|
16271
16346
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
16272
16347
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyAcked" });
|
|
16273
|
-
var ReleaseEnvelopeReadyInput =
|
|
16348
|
+
var ReleaseEnvelopeReadyInput = Schema76.Struct({
|
|
16274
16349
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16275
16350
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16276
16351
|
next_available_at: exports_shared_schema.TimestampMillis,
|
|
16277
|
-
error:
|
|
16352
|
+
error: Schema76.optionalKey(Schema76.String)
|
|
16278
16353
|
}).annotate({ identifier: "Relay.Operation.ReleaseEnvelopeReadyInput" });
|
|
16279
|
-
var EnvelopeReadyReleased =
|
|
16354
|
+
var EnvelopeReadyReleased = Schema76.Struct({
|
|
16280
16355
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16281
|
-
state:
|
|
16356
|
+
state: Schema76.Literal("ready"),
|
|
16282
16357
|
next_available_at: exports_shared_schema.TimestampMillis
|
|
16283
16358
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyReleased" });
|
|
16284
|
-
var CreateScheduleInput =
|
|
16359
|
+
var CreateScheduleInput = Schema76.Struct({
|
|
16285
16360
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
16286
16361
|
kind: exports_schedule_schema.ScheduleKind,
|
|
16287
16362
|
target_kind: exports_schedule_schema.ScheduleTargetKind,
|
|
16288
|
-
address_id:
|
|
16289
|
-
wait_id:
|
|
16290
|
-
cron_expr:
|
|
16291
|
-
input:
|
|
16363
|
+
address_id: Schema76.optionalKey(exports_ids_schema.AddressId),
|
|
16364
|
+
wait_id: Schema76.optionalKey(exports_ids_schema.WaitId),
|
|
16365
|
+
cron_expr: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16366
|
+
input: Schema76.optionalKey(Schema76.Array(exports_content_schema.Part)),
|
|
16292
16367
|
next_run_at: exports_shared_schema.TimestampMillis,
|
|
16293
|
-
idempotency_key:
|
|
16294
|
-
metadata:
|
|
16368
|
+
idempotency_key: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16369
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16295
16370
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleInput" });
|
|
16296
|
-
var CreateScheduleResult =
|
|
16371
|
+
var CreateScheduleResult = Schema76.Struct({
|
|
16297
16372
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
16298
16373
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleResult" });
|
|
16299
|
-
var CancelScheduleInput =
|
|
16374
|
+
var CancelScheduleInput = Schema76.Struct({
|
|
16300
16375
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
16301
16376
|
cancelled_at: exports_shared_schema.TimestampMillis
|
|
16302
16377
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleInput" });
|
|
16303
|
-
var CancelScheduleResult =
|
|
16378
|
+
var CancelScheduleResult = Schema76.Struct({
|
|
16304
16379
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
16305
16380
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleResult" });
|
|
16306
|
-
var ListSchedulesInput =
|
|
16307
|
-
state:
|
|
16381
|
+
var ListSchedulesInput = Schema76.Struct({
|
|
16382
|
+
state: Schema76.optionalKey(exports_schedule_schema.ScheduleState)
|
|
16308
16383
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesInput" });
|
|
16309
|
-
var ListSchedulesResult =
|
|
16310
|
-
schedules:
|
|
16384
|
+
var ListSchedulesResult = Schema76.Struct({
|
|
16385
|
+
schedules: Schema76.Array(exports_schedule_schema.ScheduleRecord)
|
|
16311
16386
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesResult" });
|
|
16312
|
-
var ListExecutionsInput =
|
|
16313
|
-
root_address_id:
|
|
16314
|
-
status:
|
|
16315
|
-
limit:
|
|
16316
|
-
cursor:
|
|
16387
|
+
var ListExecutionsInput = Schema76.Struct({
|
|
16388
|
+
root_address_id: Schema76.optionalKey(exports_ids_schema.AddressId),
|
|
16389
|
+
status: Schema76.optionalKey(exports_execution_schema.ExecutionStatus),
|
|
16390
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0))),
|
|
16391
|
+
cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16317
16392
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsInput" });
|
|
16318
|
-
var ConversationKind =
|
|
16393
|
+
var ConversationKind = Schema76.Literals(["user-agent", "agent-agent"]).annotate({
|
|
16319
16394
|
identifier: "Relay.Operation.ConversationKind"
|
|
16320
16395
|
});
|
|
16321
|
-
var ConversationSummary =
|
|
16396
|
+
var ConversationSummary = Schema76.Struct({
|
|
16322
16397
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16323
16398
|
root_address_id: exports_ids_schema.AddressId,
|
|
16324
|
-
session_id:
|
|
16399
|
+
session_id: Schema76.optionalKey(exports_ids_schema.SessionId),
|
|
16325
16400
|
status: exports_execution_schema.ExecutionStatus,
|
|
16326
16401
|
kind: ConversationKind,
|
|
16327
|
-
agent_id:
|
|
16402
|
+
agent_id: Schema76.optionalKey(exports_ids_schema.AgentId),
|
|
16328
16403
|
metadata: exports_shared_schema.Metadata,
|
|
16329
16404
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16330
16405
|
updated_at: exports_shared_schema.TimestampMillis
|
|
16331
16406
|
}).annotate({ identifier: "Relay.Operation.ConversationSummary" });
|
|
16332
|
-
var ListExecutionsResult =
|
|
16333
|
-
records:
|
|
16334
|
-
next_cursor:
|
|
16407
|
+
var ListExecutionsResult = Schema76.Struct({
|
|
16408
|
+
records: Schema76.Array(ConversationSummary),
|
|
16409
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16335
16410
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsResult" });
|
|
16336
|
-
var ListSessionsInput =
|
|
16337
|
-
root_address_id:
|
|
16338
|
-
limit:
|
|
16339
|
-
cursor:
|
|
16411
|
+
var ListSessionsInput = Schema76.Struct({
|
|
16412
|
+
root_address_id: Schema76.optionalKey(exports_ids_schema.AddressId),
|
|
16413
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0))),
|
|
16414
|
+
cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16340
16415
|
}).annotate({ identifier: "Relay.Operation.ListSessionsInput" });
|
|
16341
|
-
var SessionSummary =
|
|
16416
|
+
var SessionSummary = Schema76.Struct({
|
|
16342
16417
|
session_id: exports_ids_schema.SessionId,
|
|
16343
16418
|
root_address_id: exports_ids_schema.AddressId,
|
|
16344
16419
|
metadata: exports_shared_schema.Metadata,
|
|
16345
16420
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16346
16421
|
updated_at: exports_shared_schema.TimestampMillis
|
|
16347
16422
|
}).annotate({ identifier: "Relay.Operation.SessionSummary" });
|
|
16348
|
-
var ListSessionsResult =
|
|
16349
|
-
records:
|
|
16350
|
-
next_cursor:
|
|
16423
|
+
var ListSessionsResult = Schema76.Struct({
|
|
16424
|
+
records: Schema76.Array(SessionSummary),
|
|
16425
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16351
16426
|
}).annotate({ identifier: "Relay.Operation.ListSessionsResult" });
|
|
16352
|
-
var GetSessionInput =
|
|
16427
|
+
var GetSessionInput = Schema76.Struct({
|
|
16353
16428
|
session_id: exports_ids_schema.SessionId,
|
|
16354
|
-
limit:
|
|
16355
|
-
cursor:
|
|
16429
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0))),
|
|
16430
|
+
cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16356
16431
|
}).annotate({ identifier: "Relay.Operation.GetSessionInput" });
|
|
16357
|
-
var GetSessionResult =
|
|
16432
|
+
var GetSessionResult = Schema76.Struct({
|
|
16358
16433
|
session: SessionSummary,
|
|
16359
|
-
executions:
|
|
16360
|
-
next_cursor:
|
|
16434
|
+
executions: Schema76.Array(ConversationSummary),
|
|
16435
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16361
16436
|
}).annotate({ identifier: "Relay.Operation.GetSessionResult" });
|
|
16362
|
-
var ReplayExecutionInput =
|
|
16437
|
+
var ReplayExecutionInput = Schema76.Struct({
|
|
16363
16438
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16364
|
-
after_cursor:
|
|
16365
|
-
limit:
|
|
16439
|
+
after_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16440
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0)))
|
|
16366
16441
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionInput" });
|
|
16367
|
-
var ReplayExecutionResult =
|
|
16368
|
-
events:
|
|
16442
|
+
var ReplayExecutionResult = Schema76.Struct({
|
|
16443
|
+
events: Schema76.Array(exports_execution_schema.ExecutionEvent)
|
|
16369
16444
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionResult" });
|
|
16370
|
-
var RunnerSummary =
|
|
16371
|
-
address:
|
|
16372
|
-
healthy:
|
|
16445
|
+
var RunnerSummary = Schema76.Struct({
|
|
16446
|
+
address: Schema76.String,
|
|
16447
|
+
healthy: Schema76.Boolean,
|
|
16373
16448
|
last_heartbeat: exports_shared_schema.TimestampMillis,
|
|
16374
|
-
owned_shards:
|
|
16449
|
+
owned_shards: Schema76.Int
|
|
16375
16450
|
}).annotate({ identifier: "Relay.Operation.RunnerSummary" });
|
|
16376
|
-
var ListRunnersResult =
|
|
16377
|
-
runners:
|
|
16378
|
-
total_shards:
|
|
16451
|
+
var ListRunnersResult = Schema76.Struct({
|
|
16452
|
+
runners: Schema76.Array(RunnerSummary),
|
|
16453
|
+
total_shards: Schema76.Int
|
|
16379
16454
|
}).annotate({ identifier: "Relay.Operation.ListRunnersResult" });
|
|
16380
|
-
var RouteExecutionResult =
|
|
16455
|
+
var RouteExecutionResult = Schema76.Struct({
|
|
16381
16456
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16382
|
-
shard:
|
|
16383
|
-
runner_address:
|
|
16384
|
-
owned:
|
|
16457
|
+
shard: Schema76.String,
|
|
16458
|
+
runner_address: Schema76.NullOr(Schema76.String),
|
|
16459
|
+
owned: Schema76.Boolean
|
|
16385
16460
|
}).annotate({ identifier: "Relay.Operation.RouteExecutionResult" });
|
|
16386
16461
|
// ../ai/src/embedding-model/embedding-model-registration.ts
|
|
16387
16462
|
import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai";
|
|
@@ -16413,7 +16488,7 @@ __export(exports_language_model_registration, {
|
|
|
16413
16488
|
anthropic: () => anthropic
|
|
16414
16489
|
});
|
|
16415
16490
|
|
|
16416
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16491
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/anthropic.ts
|
|
16417
16492
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
16418
16493
|
import { Layer as Layer72 } from "effect";
|
|
16419
16494
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -16429,13 +16504,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16429
16504
|
});
|
|
16430
16505
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
16431
16506
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer72.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer72.provide(FetchHttpClient2.layer));
|
|
16432
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16507
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16433
16508
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
16434
16509
|
import { Effect as Effect81, Layer as Layer74, Option as Option29, Stream as Stream12 } from "effect";
|
|
16435
16510
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
16436
16511
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
16437
16512
|
|
|
16438
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16513
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai.ts
|
|
16439
16514
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
16440
16515
|
import { Layer as Layer73 } from "effect";
|
|
16441
16516
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -16452,7 +16527,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16452
16527
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
16453
16528
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer73.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer73.provide(FetchHttpClient3.layer));
|
|
16454
16529
|
|
|
16455
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16530
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16456
16531
|
var deterministicModelLayer = Layer74.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
16457
16532
|
generateText: () => Effect81.succeed([{ type: "text", text: "deterministic response" }]),
|
|
16458
16533
|
streamText: () => Stream12.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -16476,7 +16551,7 @@ var withOpenAiOrDeterministic = (options) => Layer74.unwrap(Effect81.gen(functio
|
|
|
16476
16551
|
...Option29.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
16477
16552
|
]);
|
|
16478
16553
|
}));
|
|
16479
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16554
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
16480
16555
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
16481
16556
|
import { Config as Config8, Layer as Layer75 } from "effect";
|
|
16482
16557
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -16497,7 +16572,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
16497
16572
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
16498
16573
|
});
|
|
16499
16574
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer75.provide(clientLayerConfig(options)), Layer75.provide(FetchHttpClient5.layer));
|
|
16500
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16575
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openrouter.ts
|
|
16501
16576
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
16502
16577
|
import { Layer as Layer76 } from "effect";
|
|
16503
16578
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|