@relayfx/sdk 0.0.42 → 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 +304 -271
- package/dist/index.js +433 -400
- 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,7 +9251,7 @@ 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,
|
|
@@ -9239,7 +9266,7 @@ __export(exports_tool_executor, {
|
|
|
9239
9266
|
client: () => client,
|
|
9240
9267
|
ToolExecutor: () => ToolExecutor
|
|
9241
9268
|
});
|
|
9242
|
-
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as
|
|
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";
|
|
9243
9270
|
class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
|
|
9244
9271
|
}
|
|
9245
9272
|
var failureMessage = (cause) => {
|
|
@@ -9262,10 +9289,10 @@ var resultMessage = (result) => {
|
|
|
9262
9289
|
var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
|
|
9263
9290
|
var decodeSuccess = (tool2, result) => {
|
|
9264
9291
|
const successSchema = tool2.successSchema;
|
|
9265
|
-
if (!
|
|
9292
|
+
if (!Schema46.isSchema(successSchema)) {
|
|
9266
9293
|
return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
|
|
9267
9294
|
}
|
|
9268
|
-
return
|
|
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))}`))));
|
|
9269
9296
|
};
|
|
9270
9297
|
var placementOutcome = (placement, tool2, response) => {
|
|
9271
9298
|
switch (response._tag) {
|
|
@@ -9350,7 +9377,7 @@ function router(routes) {
|
|
|
9350
9377
|
}
|
|
9351
9378
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9352
9379
|
|
|
9353
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9380
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9354
9381
|
var exports_turn_policy = {};
|
|
9355
9382
|
__export(exports_turn_policy, {
|
|
9356
9383
|
untilToolCall: () => untilToolCall,
|
|
@@ -9389,7 +9416,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9389
9416
|
}));
|
|
9390
9417
|
var defaultPolicy = recurs(8);
|
|
9391
9418
|
|
|
9392
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9419
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
|
|
9393
9420
|
function make5(nameOrOptions, options = {}) {
|
|
9394
9421
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9395
9422
|
return {
|
|
@@ -9400,16 +9427,22 @@ function make5(nameOrOptions, options = {}) {
|
|
|
9400
9427
|
};
|
|
9401
9428
|
}
|
|
9402
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
|
+
});
|
|
9403
9436
|
var skillListingBudgetTokens = 2048;
|
|
9404
9437
|
var activateSkillToolName = "activate_skill";
|
|
9405
|
-
var activateSkillParameters =
|
|
9438
|
+
var activateSkillParameters = Schema47.Struct({ name: Schema47.String });
|
|
9406
9439
|
var activateSkillTool = Tool4.make(activateSkillToolName, {
|
|
9407
9440
|
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
9408
9441
|
parameters: activateSkillParameters,
|
|
9409
|
-
success:
|
|
9410
|
-
name:
|
|
9411
|
-
body:
|
|
9412
|
-
allowedTools:
|
|
9442
|
+
success: Schema47.Struct({
|
|
9443
|
+
name: Schema47.String,
|
|
9444
|
+
body: Schema47.String,
|
|
9445
|
+
allowedTools: Schema47.Array(Schema47.String)
|
|
9413
9446
|
})
|
|
9414
9447
|
});
|
|
9415
9448
|
var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
@@ -9712,7 +9745,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9712
9745
|
const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
|
|
9713
9746
|
if (skillRuntime === undefined)
|
|
9714
9747
|
return { _tag: "Failure", message: "SkillSource is not available" };
|
|
9715
|
-
const params =
|
|
9748
|
+
const params = Schema47.decodeUnknownOption(activateSkillParameters)(call.params);
|
|
9716
9749
|
if (Option15.isNone(params))
|
|
9717
9750
|
return { _tag: "Failure", message: "Skill activation requires a name" };
|
|
9718
9751
|
const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
|
|
@@ -9951,7 +9984,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9951
9984
|
const followUp = yield* takeFollowUp();
|
|
9952
9985
|
if (followUp.length > 0) {
|
|
9953
9986
|
return {
|
|
9954
|
-
events: Stream7.fromIterable([completed]),
|
|
9987
|
+
events: Stream7.fromIterable([completed, steeringDrainedEvent(turn, "followUp", followUp)]),
|
|
9955
9988
|
next: { prompt: promptFromSteeringMessages(followUp) }
|
|
9956
9989
|
};
|
|
9957
9990
|
}
|
|
@@ -9987,7 +10020,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9987
10020
|
const basePrompt = steering.length === 0 ? toolPrompt : Prompt4.concat(promptFromSteeringMessages(steering), toolPrompt);
|
|
9988
10021
|
const prompt = decision2.overrides?.instructions === undefined ? basePrompt : withSystem(decision2.overrides.instructions, basePrompt);
|
|
9989
10022
|
return {
|
|
9990
|
-
events: Stream7.fromIterable([completed]),
|
|
10023
|
+
events: Stream7.fromIterable(steering.length === 0 ? [completed] : [completed, steeringDrainedEvent(turn, "steering", steering)]),
|
|
9991
10024
|
next: { prompt, ...decision2.overrides === undefined ? {} : { overrides: decision2.overrides } }
|
|
9992
10025
|
};
|
|
9993
10026
|
});
|
|
@@ -10066,14 +10099,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10066
10099
|
})
|
|
10067
10100
|
})
|
|
10068
10101
|
})));
|
|
10069
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10102
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10070
10103
|
var exports_agent_tool = {};
|
|
10071
10104
|
__export(exports_agent_tool, {
|
|
10072
10105
|
asTool: () => asTool
|
|
10073
10106
|
});
|
|
10074
|
-
import { Cause as Cause4, Effect as Effect46, Schema as
|
|
10107
|
+
import { Cause as Cause4, Effect as Effect46, Schema as Schema48 } from "effect";
|
|
10075
10108
|
import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
10076
|
-
var defaultParameters =
|
|
10109
|
+
var defaultParameters = Schema48.Struct({ prompt: Schema48.String });
|
|
10077
10110
|
var errorMessage2 = (error) => {
|
|
10078
10111
|
if (error instanceof AgentSuspended) {
|
|
10079
10112
|
return `suspended on ${error.tool_name}: ${error.reason}`;
|
|
@@ -10099,14 +10132,14 @@ var lazyHandled = (toolkit, name, handler) => ({
|
|
|
10099
10132
|
var asTool = (agent, options = {}) => {
|
|
10100
10133
|
const name = options.name ?? agent.name;
|
|
10101
10134
|
const parameters = options.parameters ?? defaultParameters;
|
|
10102
|
-
const success2 = options.success ??
|
|
10135
|
+
const success2 = options.success ?? Schema48.String;
|
|
10103
10136
|
const toPrompt = options.toPrompt ?? ((params) => params.prompt);
|
|
10104
10137
|
const fromResult = options.fromResult ?? ((result) => result.text);
|
|
10105
10138
|
const tool2 = Tool5.make(name, {
|
|
10106
10139
|
...options.description === undefined ? {} : { description: options.description },
|
|
10107
10140
|
parameters,
|
|
10108
10141
|
success: success2,
|
|
10109
|
-
failure:
|
|
10142
|
+
failure: Schema48.String,
|
|
10110
10143
|
failureMode: "return"
|
|
10111
10144
|
});
|
|
10112
10145
|
const toolkit = Toolkit4.make(tool2);
|
|
@@ -10124,7 +10157,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10124
10157
|
});
|
|
10125
10158
|
return lazyHandled(toolkit, name, handler);
|
|
10126
10159
|
};
|
|
10127
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10160
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/guardrail.ts
|
|
10128
10161
|
var exports_guardrail = {};
|
|
10129
10162
|
__export(exports_guardrail, {
|
|
10130
10163
|
validateInput: () => validateInput2,
|
|
@@ -10204,16 +10237,16 @@ var redactOutput = (options) => ({
|
|
|
10204
10237
|
var filterOutput = (keep) => ({
|
|
10205
10238
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10206
10239
|
});
|
|
10207
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10240
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/handoff.ts
|
|
10208
10241
|
var exports_handoff = {};
|
|
10209
10242
|
__export(exports_handoff, {
|
|
10210
10243
|
transferTool: () => transferTool,
|
|
10211
10244
|
supervisor: () => supervisor,
|
|
10212
10245
|
fanOut: () => fanOut
|
|
10213
10246
|
});
|
|
10214
|
-
import { Effect as Effect48, Schema as
|
|
10247
|
+
import { Effect as Effect48, Schema as Schema49 } from "effect";
|
|
10215
10248
|
import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
|
|
10216
|
-
var defaultTransferParameters =
|
|
10249
|
+
var defaultTransferParameters = Schema49.Struct({ prompt: Schema49.String });
|
|
10217
10250
|
var transferName = (agentName) => `transfer_to_${agentName}`;
|
|
10218
10251
|
var positiveConcurrency = (value) => {
|
|
10219
10252
|
const concurrency = value ?? 4;
|
|
@@ -10267,7 +10300,7 @@ var supervisor = (options) => {
|
|
|
10267
10300
|
toolkit
|
|
10268
10301
|
};
|
|
10269
10302
|
};
|
|
10270
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10303
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-registry.ts
|
|
10271
10304
|
var exports_model_registry = {};
|
|
10272
10305
|
__export(exports_model_registry, {
|
|
10273
10306
|
testLayer: () => testLayer38,
|
|
@@ -10282,13 +10315,13 @@ __export(exports_model_registry, {
|
|
|
10282
10315
|
Service: () => Service29,
|
|
10283
10316
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
10284
10317
|
});
|
|
10285
|
-
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";
|
|
10286
10319
|
import { Model } from "effect/unstable/ai";
|
|
10287
10320
|
|
|
10288
|
-
class LanguageModelNotRegistered extends
|
|
10289
|
-
provider:
|
|
10290
|
-
model:
|
|
10291
|
-
registration_key:
|
|
10321
|
+
class LanguageModelNotRegistered extends Schema50.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
10322
|
+
provider: Schema50.String,
|
|
10323
|
+
model: Schema50.String,
|
|
10324
|
+
registration_key: Schema50.optionalKey(Schema50.String)
|
|
10292
10325
|
}) {
|
|
10293
10326
|
}
|
|
10294
10327
|
|
|
@@ -10356,7 +10389,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10356
10389
|
return yield* service.provide(selection, effect);
|
|
10357
10390
|
});
|
|
10358
10391
|
|
|
10359
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10392
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/index.ts
|
|
10360
10393
|
import {
|
|
10361
10394
|
AiError as AiError3,
|
|
10362
10395
|
Chat as Chat2,
|
|
@@ -10374,7 +10407,7 @@ import {
|
|
|
10374
10407
|
} from "effect/unstable/ai";
|
|
10375
10408
|
|
|
10376
10409
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
10377
|
-
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";
|
|
10378
10411
|
import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
10379
10412
|
|
|
10380
10413
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -10394,31 +10427,31 @@ __export(exports_child_run_service, {
|
|
|
10394
10427
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
10395
10428
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
10396
10429
|
});
|
|
10397
|
-
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";
|
|
10398
10431
|
|
|
10399
10432
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
10400
|
-
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";
|
|
10401
10434
|
|
|
10402
|
-
class WorkspaceNotFound extends
|
|
10435
|
+
class WorkspaceNotFound extends Schema51.TaggedErrorClass()("WorkspaceNotFound", {
|
|
10403
10436
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
10404
10437
|
}) {
|
|
10405
10438
|
}
|
|
10406
10439
|
|
|
10407
|
-
class WorkspaceUnavailable extends
|
|
10440
|
+
class WorkspaceUnavailable extends Schema51.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
10408
10441
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
10409
|
-
message:
|
|
10442
|
+
message: Schema51.String
|
|
10410
10443
|
}) {
|
|
10411
10444
|
}
|
|
10412
10445
|
|
|
10413
|
-
class WorkspaceCapabilityUnsupported extends
|
|
10414
|
-
capability:
|
|
10446
|
+
class WorkspaceCapabilityUnsupported extends Schema51.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
10447
|
+
capability: Schema51.Literals(["suspend", "snapshot", "fork"]),
|
|
10415
10448
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
10416
10449
|
}) {
|
|
10417
10450
|
}
|
|
10418
10451
|
|
|
10419
|
-
class WorkspaceProviderError extends
|
|
10452
|
+
class WorkspaceProviderError extends Schema51.TaggedErrorClass()("WorkspaceProviderError", {
|
|
10420
10453
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
10421
|
-
message:
|
|
10454
|
+
message: Schema51.String
|
|
10422
10455
|
}) {
|
|
10423
10456
|
}
|
|
10424
10457
|
|
|
@@ -10450,28 +10483,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
10450
10483
|
});
|
|
10451
10484
|
|
|
10452
10485
|
// ../runtime/src/child/child-run-service.ts
|
|
10453
|
-
class StaticChildRunPresetNotFound extends
|
|
10486
|
+
class StaticChildRunPresetNotFound extends Schema52.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
10454
10487
|
preset_name: exports_shared_schema.NonEmptyString
|
|
10455
10488
|
}) {
|
|
10456
10489
|
}
|
|
10457
10490
|
|
|
10458
|
-
class ChildRunScopeBroadened extends
|
|
10459
|
-
field:
|
|
10491
|
+
class ChildRunScopeBroadened extends Schema52.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
10492
|
+
field: Schema52.Literals(["tool_names", "permissions"]),
|
|
10460
10493
|
value: exports_shared_schema.NonEmptyString
|
|
10461
10494
|
}) {
|
|
10462
10495
|
}
|
|
10463
10496
|
|
|
10464
|
-
class ChildRunServiceError extends
|
|
10465
|
-
message:
|
|
10497
|
+
class ChildRunServiceError extends Schema52.TaggedErrorClass()("ChildRunServiceError", {
|
|
10498
|
+
message: Schema52.String
|
|
10466
10499
|
}) {
|
|
10467
10500
|
}
|
|
10468
10501
|
|
|
10469
|
-
class ChildRunWorkspaceUnavailable extends
|
|
10470
|
-
reason:
|
|
10502
|
+
class ChildRunWorkspaceUnavailable extends Schema52.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
10503
|
+
reason: Schema52.String
|
|
10471
10504
|
}) {
|
|
10472
10505
|
}
|
|
10473
10506
|
|
|
10474
|
-
class ChildRunModelMissing extends
|
|
10507
|
+
class ChildRunModelMissing extends Schema52.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
10475
10508
|
}
|
|
10476
10509
|
|
|
10477
10510
|
class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -10699,26 +10732,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
10699
10732
|
});
|
|
10700
10733
|
|
|
10701
10734
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
10702
|
-
import { Effect as Effect52, Schema as
|
|
10735
|
+
import { Effect as Effect52, Schema as Schema53 } from "effect";
|
|
10703
10736
|
var toolName = "spawn_child_run";
|
|
10704
10737
|
var permissionName = "relay.child_run.spawn";
|
|
10705
|
-
var Input =
|
|
10706
|
-
preset_name:
|
|
10707
|
-
instructions:
|
|
10708
|
-
model:
|
|
10709
|
-
tool_names:
|
|
10710
|
-
permissions:
|
|
10711
|
-
output_schema_ref:
|
|
10712
|
-
metadata:
|
|
10713
|
-
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))
|
|
10714
10747
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
10715
|
-
var Output =
|
|
10748
|
+
var Output = Schema53.Struct({
|
|
10716
10749
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
10717
|
-
status:
|
|
10718
|
-
output:
|
|
10750
|
+
status: Schema53.Literals(["completed", "failed", "cancelled"]),
|
|
10751
|
+
output: Schema53.Array(exports_content_schema.Part)
|
|
10719
10752
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
10720
|
-
var TransferInput =
|
|
10721
|
-
input:
|
|
10753
|
+
var TransferInput = Schema53.Struct({
|
|
10754
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10722
10755
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
10723
10756
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
10724
10757
|
var parentContext = (agent) => ({
|
|
@@ -10905,17 +10938,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
10905
10938
|
});
|
|
10906
10939
|
|
|
10907
10940
|
// ../runtime/src/memory/memory-service.ts
|
|
10908
|
-
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";
|
|
10909
10942
|
import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
|
|
10910
10943
|
|
|
10911
10944
|
// ../runtime/src/model/embedding-model-service.ts
|
|
10912
|
-
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";
|
|
10913
10946
|
import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
|
|
10914
10947
|
|
|
10915
|
-
class EmbeddingModelNotRegistered extends
|
|
10916
|
-
provider:
|
|
10917
|
-
model:
|
|
10918
|
-
registration_key:
|
|
10948
|
+
class EmbeddingModelNotRegistered extends Schema54.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
10949
|
+
provider: Schema54.String,
|
|
10950
|
+
model: Schema54.String,
|
|
10951
|
+
registration_key: Schema54.optionalKey(Schema54.String)
|
|
10919
10952
|
}) {
|
|
10920
10953
|
}
|
|
10921
10954
|
|
|
@@ -11041,7 +11074,7 @@ var defaultTopK = 5;
|
|
|
11041
11074
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
11042
11075
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
11043
11076
|
});
|
|
11044
|
-
var decodeSubject = (subject) =>
|
|
11077
|
+
var decodeSubject = (subject) => Schema55.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
|
|
11045
11078
|
var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
|
|
11046
11079
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
11047
11080
|
`).trim();
|
|
@@ -11263,9 +11296,9 @@ __export(exports_schema_registry_service, {
|
|
|
11263
11296
|
Service: () => Service36,
|
|
11264
11297
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
11265
11298
|
});
|
|
11266
|
-
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";
|
|
11267
11300
|
|
|
11268
|
-
class SchemaRefNotRegistered extends
|
|
11301
|
+
class SchemaRefNotRegistered extends Schema56.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
11269
11302
|
}
|
|
11270
11303
|
|
|
11271
11304
|
class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -11398,16 +11431,16 @@ __export(exports_blob_store_service, {
|
|
|
11398
11431
|
BlobStoreError: () => BlobStoreError,
|
|
11399
11432
|
BlobNotResolvable: () => BlobNotResolvable
|
|
11400
11433
|
});
|
|
11401
|
-
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";
|
|
11402
11435
|
|
|
11403
|
-
class BlobNotResolvable extends
|
|
11404
|
-
uri:
|
|
11405
|
-
reason:
|
|
11436
|
+
class BlobNotResolvable extends Schema57.TaggedErrorClass()("BlobNotResolvable", {
|
|
11437
|
+
uri: Schema57.String,
|
|
11438
|
+
reason: Schema57.String
|
|
11406
11439
|
}) {
|
|
11407
11440
|
}
|
|
11408
11441
|
|
|
11409
|
-
class BlobStoreError extends
|
|
11410
|
-
message:
|
|
11442
|
+
class BlobStoreError extends Schema57.TaggedErrorClass()("BlobStoreError", {
|
|
11443
|
+
message: Schema57.String
|
|
11411
11444
|
}) {
|
|
11412
11445
|
}
|
|
11413
11446
|
|
|
@@ -11480,7 +11513,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
11480
11513
|
Service: () => Service40,
|
|
11481
11514
|
PromptAssemblerError: () => PromptAssemblerError
|
|
11482
11515
|
});
|
|
11483
|
-
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";
|
|
11484
11517
|
import { Prompt as Prompt10 } from "effect/unstable/ai";
|
|
11485
11518
|
|
|
11486
11519
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -11495,11 +11528,11 @@ __export(exports_artifact_store_service, {
|
|
|
11495
11528
|
Memory: () => Memory2,
|
|
11496
11529
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
11497
11530
|
});
|
|
11498
|
-
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";
|
|
11499
11532
|
|
|
11500
|
-
class ArtifactNotResolvable extends
|
|
11501
|
-
artifact_id:
|
|
11502
|
-
reason:
|
|
11533
|
+
class ArtifactNotResolvable extends Schema58.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
11534
|
+
artifact_id: Schema58.String,
|
|
11535
|
+
reason: Schema58.String
|
|
11503
11536
|
}) {
|
|
11504
11537
|
}
|
|
11505
11538
|
|
|
@@ -11541,14 +11574,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
11541
11574
|
});
|
|
11542
11575
|
|
|
11543
11576
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
11544
|
-
class PromptAssemblerError extends
|
|
11545
|
-
message:
|
|
11577
|
+
class PromptAssemblerError extends Schema59.TaggedErrorClass()("PromptAssemblerError", {
|
|
11578
|
+
message: Schema59.String
|
|
11546
11579
|
}) {
|
|
11547
11580
|
}
|
|
11548
11581
|
|
|
11549
11582
|
class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
|
|
11550
11583
|
}
|
|
11551
|
-
var jsonValue2 = (value) =>
|
|
11584
|
+
var jsonValue2 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11552
11585
|
var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
|
|
11553
11586
|
var contentToPromptPart = (part) => {
|
|
11554
11587
|
const options = part.provider_options;
|
|
@@ -11692,8 +11725,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
11692
11725
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
11693
11726
|
|
|
11694
11727
|
// ../runtime/src/agent/relay-permissions.ts
|
|
11695
|
-
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as
|
|
11696
|
-
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);
|
|
11697
11730
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
11698
11731
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
11699
11732
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -11859,7 +11892,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
11859
11892
|
});
|
|
11860
11893
|
var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
11861
11894
|
const createdAt = yield* Clock6.currentTimeMillis;
|
|
11862
|
-
const decodedRule = yield*
|
|
11895
|
+
const decodedRule = yield* Schema60.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
|
|
11863
11896
|
yield* config.repository.remember({
|
|
11864
11897
|
agent: config.agentName,
|
|
11865
11898
|
scope: config.scope,
|
|
@@ -11875,9 +11908,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
|
|
|
11875
11908
|
})));
|
|
11876
11909
|
|
|
11877
11910
|
// ../runtime/src/agent/relay-steering.ts
|
|
11878
|
-
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";
|
|
11879
11912
|
import { Prompt as Prompt11 } from "effect/unstable/ai";
|
|
11880
|
-
var jsonValue4 = (value) =>
|
|
11913
|
+
var jsonValue4 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11881
11914
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
|
|
11882
11915
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
11883
11916
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -11910,7 +11943,7 @@ var contentFromMessage = (message) => {
|
|
|
11910
11943
|
const textParts = promptTextParts(prompt);
|
|
11911
11944
|
if (textParts.length > 0)
|
|
11912
11945
|
return textParts;
|
|
11913
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
11946
|
+
return [exports_content_schema.text(stringifyJson2(Schema61.encodeSync(Prompt11.Prompt)(prompt)))];
|
|
11914
11947
|
};
|
|
11915
11948
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
11916
11949
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -11955,8 +11988,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
|
|
|
11955
11988
|
}));
|
|
11956
11989
|
|
|
11957
11990
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
11958
|
-
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as
|
|
11959
|
-
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);
|
|
11960
11993
|
var errorDetail = (error) => {
|
|
11961
11994
|
switch (error._tag) {
|
|
11962
11995
|
case "ToolNotRegistered":
|
|
@@ -12063,29 +12096,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
|
|
|
12063
12096
|
})));
|
|
12064
12097
|
|
|
12065
12098
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
12066
|
-
class AgentLoopError extends
|
|
12067
|
-
message:
|
|
12068
|
-
next_event_sequence:
|
|
12099
|
+
class AgentLoopError extends Schema63.TaggedErrorClass()("AgentLoopError", {
|
|
12100
|
+
message: Schema63.String,
|
|
12101
|
+
next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12069
12102
|
}) {
|
|
12070
12103
|
}
|
|
12071
12104
|
|
|
12072
|
-
class AgentLoopWaitRequested extends
|
|
12105
|
+
class AgentLoopWaitRequested extends Schema63.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
12073
12106
|
wait_id: exports_ids_schema.WaitId,
|
|
12074
12107
|
tool_call: exports_tool_schema.Call,
|
|
12075
12108
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12076
12109
|
}) {
|
|
12077
12110
|
}
|
|
12078
12111
|
|
|
12079
|
-
class AgentLoopBudgetExceeded extends
|
|
12080
|
-
tokens_used:
|
|
12081
|
-
token_budget:
|
|
12112
|
+
class AgentLoopBudgetExceeded extends Schema63.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
12113
|
+
tokens_used: Schema63.Int,
|
|
12114
|
+
token_budget: Schema63.Int,
|
|
12082
12115
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12083
12116
|
}) {
|
|
12084
12117
|
}
|
|
12085
12118
|
|
|
12086
12119
|
class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
|
|
12087
12120
|
}
|
|
12088
|
-
var jsonValue6 = (value) =>
|
|
12121
|
+
var jsonValue6 = (value) => Schema63.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
12089
12122
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
12090
12123
|
var availableRegisteredTools = (agent, registered) => {
|
|
12091
12124
|
const names = toolNames(agent);
|
|
@@ -12661,7 +12694,7 @@ __export(exports_execution_entity, {
|
|
|
12661
12694
|
});
|
|
12662
12695
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
12663
12696
|
import { Rpc } from "effect/unstable/rpc";
|
|
12664
|
-
import { Schema as
|
|
12697
|
+
import { Schema as Schema70 } from "effect";
|
|
12665
12698
|
|
|
12666
12699
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
12667
12700
|
var exports_execution_workflow = {};
|
|
@@ -12692,15 +12725,15 @@ __export(exports_execution_workflow, {
|
|
|
12692
12725
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
12693
12726
|
});
|
|
12694
12727
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
12695
|
-
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";
|
|
12696
12729
|
|
|
12697
12730
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
12698
|
-
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as
|
|
12699
|
-
class ParentNotifyError extends
|
|
12700
|
-
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
|
|
12701
12734
|
}) {
|
|
12702
12735
|
}
|
|
12703
|
-
var ChildTerminalStatus =
|
|
12736
|
+
var ChildTerminalStatus = Schema64.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
12704
12737
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
12705
12738
|
});
|
|
12706
12739
|
|
|
@@ -12799,15 +12832,15 @@ __export(exports_skill_registry_service, {
|
|
|
12799
12832
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
12800
12833
|
Service: () => Service43
|
|
12801
12834
|
});
|
|
12802
|
-
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";
|
|
12803
12836
|
|
|
12804
|
-
class SkillDefinitionInvalid extends
|
|
12805
|
-
message:
|
|
12837
|
+
class SkillDefinitionInvalid extends Schema65.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
12838
|
+
message: Schema65.String
|
|
12806
12839
|
}) {
|
|
12807
12840
|
}
|
|
12808
12841
|
|
|
12809
|
-
class SkillRegistryError extends
|
|
12810
|
-
message:
|
|
12842
|
+
class SkillRegistryError extends Schema65.TaggedErrorClass()("SkillRegistryError", {
|
|
12843
|
+
message: Schema65.String
|
|
12811
12844
|
}) {
|
|
12812
12845
|
}
|
|
12813
12846
|
|
|
@@ -12976,11 +13009,11 @@ __export(exports_execution_service, {
|
|
|
12976
13009
|
Service: () => Service44,
|
|
12977
13010
|
ExecutionServiceError: () => ExecutionServiceError
|
|
12978
13011
|
});
|
|
12979
|
-
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";
|
|
12980
13013
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
12981
|
-
class ExecutionServiceError extends
|
|
12982
|
-
message:
|
|
12983
|
-
next_event_sequence:
|
|
13014
|
+
class ExecutionServiceError extends Schema66.TaggedErrorClass()("ExecutionServiceError", {
|
|
13015
|
+
message: Schema66.String,
|
|
13016
|
+
next_event_sequence: Schema66.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12984
13017
|
}) {
|
|
12985
13018
|
}
|
|
12986
13019
|
|
|
@@ -13296,13 +13329,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
13296
13329
|
var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
|
|
13297
13330
|
|
|
13298
13331
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13299
|
-
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";
|
|
13300
13333
|
|
|
13301
13334
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
13302
|
-
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";
|
|
13303
13336
|
|
|
13304
|
-
class WorkspaceRuntimeError extends
|
|
13305
|
-
message:
|
|
13337
|
+
class WorkspaceRuntimeError extends Schema67.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
13338
|
+
message: Schema67.String
|
|
13306
13339
|
}) {
|
|
13307
13340
|
}
|
|
13308
13341
|
|
|
@@ -13330,18 +13363,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
13330
13363
|
});
|
|
13331
13364
|
|
|
13332
13365
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13333
|
-
class WorkspaceRuntimeMissing extends
|
|
13366
|
+
class WorkspaceRuntimeMissing extends Schema68.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
13334
13367
|
execution_id: exports_ids_schema.ExecutionId
|
|
13335
13368
|
}) {
|
|
13336
13369
|
}
|
|
13337
13370
|
|
|
13338
|
-
class WorkspaceLeaseMissingRef extends
|
|
13371
|
+
class WorkspaceLeaseMissingRef extends Schema68.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
13339
13372
|
execution_id: exports_ids_schema.ExecutionId
|
|
13340
13373
|
}) {
|
|
13341
13374
|
}
|
|
13342
13375
|
|
|
13343
|
-
class WorkspacePlannerError extends
|
|
13344
|
-
message:
|
|
13376
|
+
class WorkspacePlannerError extends Schema68.TaggedErrorClass()("WorkspacePlannerError", {
|
|
13377
|
+
message: Schema68.String
|
|
13345
13378
|
}) {
|
|
13346
13379
|
}
|
|
13347
13380
|
|
|
@@ -13527,67 +13560,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
13527
13560
|
});
|
|
13528
13561
|
|
|
13529
13562
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
13530
|
-
class ExecutionWorkflowFailed extends
|
|
13531
|
-
message:
|
|
13563
|
+
class ExecutionWorkflowFailed extends Schema69.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
13564
|
+
message: Schema69.String
|
|
13532
13565
|
}) {
|
|
13533
13566
|
}
|
|
13534
|
-
var StartInput =
|
|
13567
|
+
var StartInput = Schema69.Struct({
|
|
13535
13568
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13536
13569
|
root_address_id: exports_ids_schema.AddressId,
|
|
13537
|
-
session_id:
|
|
13538
|
-
input:
|
|
13570
|
+
session_id: Schema69.optionalKey(exports_ids_schema.SessionId),
|
|
13571
|
+
input: Schema69.optionalKey(Schema69.Array(exports_content_schema.Part)),
|
|
13539
13572
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
13540
13573
|
started_at: exports_shared_schema.TimestampMillis,
|
|
13541
13574
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
13542
|
-
agent_id:
|
|
13543
|
-
agent_revision:
|
|
13544
|
-
agent_snapshot:
|
|
13545
|
-
agent_tool_input_schema_digests:
|
|
13546
|
-
wait_id:
|
|
13547
|
-
resume_tool_call:
|
|
13548
|
-
workflow_generation:
|
|
13549
|
-
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)
|
|
13550
13583
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
13551
|
-
var WaitSignalState =
|
|
13584
|
+
var WaitSignalState = Schema69.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
13552
13585
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
13553
13586
|
});
|
|
13554
|
-
var WaitSignal =
|
|
13587
|
+
var WaitSignal = Schema69.Struct({
|
|
13555
13588
|
wait_id: exports_ids_schema.WaitId,
|
|
13556
13589
|
state: WaitSignalState,
|
|
13557
13590
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13558
13591
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
13559
|
-
var SignalWaitInput =
|
|
13560
|
-
workflow_execution_id:
|
|
13592
|
+
var SignalWaitInput = Schema69.Struct({
|
|
13593
|
+
workflow_execution_id: Schema69.String,
|
|
13561
13594
|
wait_id: exports_ids_schema.WaitId,
|
|
13562
13595
|
state: WaitSignalState,
|
|
13563
13596
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13564
13597
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
13565
|
-
var CancelExecutionInput =
|
|
13598
|
+
var CancelExecutionInput = Schema69.Struct({
|
|
13566
13599
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13567
13600
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
13568
|
-
reason:
|
|
13601
|
+
reason: Schema69.optionalKey(Schema69.String)
|
|
13569
13602
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
13570
|
-
var CancelExecutionResult =
|
|
13603
|
+
var CancelExecutionResult = Schema69.Struct({
|
|
13571
13604
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13572
13605
|
status: exports_execution_schema.ExecutionStatus
|
|
13573
13606
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
13574
|
-
var WaitSnapshot =
|
|
13607
|
+
var WaitSnapshot = Schema69.Struct({
|
|
13575
13608
|
id: exports_ids_schema.WaitId,
|
|
13576
13609
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13577
|
-
envelope_id:
|
|
13610
|
+
envelope_id: Schema69.optionalKey(exports_ids_schema.EnvelopeId),
|
|
13578
13611
|
mode: exports_envelope_schema.WaitMode,
|
|
13579
|
-
correlation_key:
|
|
13580
|
-
state:
|
|
13612
|
+
correlation_key: Schema69.optionalKey(Schema69.String),
|
|
13613
|
+
state: Schema69.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
13581
13614
|
metadata: exports_shared_schema.Metadata,
|
|
13582
13615
|
created_at: exports_shared_schema.TimestampMillis,
|
|
13583
|
-
resolved_at:
|
|
13616
|
+
resolved_at: Schema69.optionalKey(exports_shared_schema.TimestampMillis)
|
|
13584
13617
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
13585
|
-
var StartResult =
|
|
13618
|
+
var StartResult = Schema69.Struct({
|
|
13586
13619
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13587
13620
|
status: exports_execution_schema.ExecutionStatus,
|
|
13588
|
-
wait_id:
|
|
13589
|
-
wait_state:
|
|
13590
|
-
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)
|
|
13591
13624
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
13592
13625
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
13593
13626
|
var ActivityNames = {
|
|
@@ -13797,7 +13830,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
13797
13830
|
});
|
|
13798
13831
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
13799
13832
|
name: ActivityNames.checkCancel(turn),
|
|
13800
|
-
success:
|
|
13833
|
+
success: Schema69.Boolean,
|
|
13801
13834
|
error: ExecutionWorkflowFailed,
|
|
13802
13835
|
execute: Effect73.gen(function* () {
|
|
13803
13836
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -13807,7 +13840,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
13807
13840
|
});
|
|
13808
13841
|
var loadWait = (name, waitId) => Activity.make({
|
|
13809
13842
|
name,
|
|
13810
|
-
success:
|
|
13843
|
+
success: Schema69.UndefinedOr(WaitSnapshot),
|
|
13811
13844
|
error: ExecutionWorkflowFailed,
|
|
13812
13845
|
execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
|
|
13813
13846
|
});
|
|
@@ -13898,7 +13931,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
13898
13931
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
13899
13932
|
};
|
|
13900
13933
|
});
|
|
13901
|
-
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" }));
|
|
13902
13935
|
var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
13903
13936
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
13904
13937
|
if (executionSubject !== undefined)
|
|
@@ -13916,7 +13949,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
13916
13949
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
|
|
13917
13950
|
var ensureWorkspace = (input) => Activity.make({
|
|
13918
13951
|
name: ActivityNames.ensureWorkspace,
|
|
13919
|
-
success:
|
|
13952
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13920
13953
|
error: ExecutionWorkflowFailed,
|
|
13921
13954
|
execute: Effect73.gen(function* () {
|
|
13922
13955
|
if (input.agent_snapshot === undefined)
|
|
@@ -13933,19 +13966,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
13933
13966
|
});
|
|
13934
13967
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
13935
13968
|
name: ActivityNames.suspendWorkspace(key2),
|
|
13936
|
-
success:
|
|
13969
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13937
13970
|
error: ExecutionWorkflowFailed,
|
|
13938
13971
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13939
13972
|
});
|
|
13940
13973
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
13941
13974
|
name: ActivityNames.resumeWorkspace(key2),
|
|
13942
|
-
success:
|
|
13975
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13943
13976
|
error: ExecutionWorkflowFailed,
|
|
13944
13977
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
|
|
13945
13978
|
});
|
|
13946
13979
|
var releaseWorkspace = (input) => Activity.make({
|
|
13947
13980
|
name: ActivityNames.releaseWorkspace,
|
|
13948
|
-
success:
|
|
13981
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13949
13982
|
error: ExecutionWorkflowFailed,
|
|
13950
13983
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13951
13984
|
});
|
|
@@ -14046,7 +14079,7 @@ var childDispatchContext = (input) => {
|
|
|
14046
14079
|
};
|
|
14047
14080
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
14048
14081
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
14049
|
-
success:
|
|
14082
|
+
success: Schema69.Boolean,
|
|
14050
14083
|
error: ExecutionWorkflowFailed,
|
|
14051
14084
|
execute: Effect73.gen(function* () {
|
|
14052
14085
|
const context = childDispatchContext(input);
|
|
@@ -14058,7 +14091,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
14058
14091
|
});
|
|
14059
14092
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
14060
14093
|
name: ActivityNames.notifyParent(status),
|
|
14061
|
-
success:
|
|
14094
|
+
success: Schema69.Void,
|
|
14062
14095
|
error: ExecutionWorkflowFailed,
|
|
14063
14096
|
execute: Effect73.gen(function* () {
|
|
14064
14097
|
const notifier = yield* Effect73.serviceOption(Service42);
|
|
@@ -14111,7 +14144,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
14111
14144
|
};
|
|
14112
14145
|
var pendingToolCallFromExecution = (execution) => {
|
|
14113
14146
|
const pending = execution.metadata?.pending_tool_call;
|
|
14114
|
-
return
|
|
14147
|
+
return Schema69.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
14115
14148
|
};
|
|
14116
14149
|
var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
14117
14150
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -14325,7 +14358,7 @@ var Start = Rpc.make("start", {
|
|
|
14325
14358
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14326
14359
|
var SignalWait = Rpc.make("signalWait", {
|
|
14327
14360
|
payload: SignalWaitInput,
|
|
14328
|
-
success:
|
|
14361
|
+
success: Schema70.Void,
|
|
14329
14362
|
error: ExecutionWorkflowFailed
|
|
14330
14363
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14331
14364
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -14353,26 +14386,26 @@ __export(exports_envelope_service, {
|
|
|
14353
14386
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
14354
14387
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
14355
14388
|
});
|
|
14356
|
-
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as
|
|
14357
|
-
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", {
|
|
14358
14391
|
address_id: exports_ids_schema.AddressId
|
|
14359
14392
|
}) {
|
|
14360
14393
|
}
|
|
14361
14394
|
|
|
14362
|
-
class EnvelopeRouteUnavailable extends
|
|
14395
|
+
class EnvelopeRouteUnavailable extends Schema71.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
14363
14396
|
address_id: exports_ids_schema.AddressId,
|
|
14364
|
-
route_key:
|
|
14397
|
+
route_key: Schema71.String
|
|
14365
14398
|
}) {
|
|
14366
14399
|
}
|
|
14367
14400
|
|
|
14368
|
-
class EnvelopeRouteDeferred extends
|
|
14401
|
+
class EnvelopeRouteDeferred extends Schema71.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
14369
14402
|
address_id: exports_ids_schema.AddressId,
|
|
14370
|
-
route_key:
|
|
14403
|
+
route_key: Schema71.String
|
|
14371
14404
|
}) {
|
|
14372
14405
|
}
|
|
14373
14406
|
|
|
14374
|
-
class EnvelopeServiceError extends
|
|
14375
|
-
message:
|
|
14407
|
+
class EnvelopeServiceError extends Schema71.TaggedErrorClass()("EnvelopeServiceError", {
|
|
14408
|
+
message: Schema71.String
|
|
14376
14409
|
}) {
|
|
14377
14410
|
}
|
|
14378
14411
|
|
|
@@ -14530,7 +14563,7 @@ __export(exports_runner_runtime_service, {
|
|
|
14530
14563
|
DatabaseMode: () => DatabaseMode,
|
|
14531
14564
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
14532
14565
|
});
|
|
14533
|
-
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";
|
|
14534
14567
|
import {
|
|
14535
14568
|
ClusterWorkflowEngine,
|
|
14536
14569
|
HttpRunner,
|
|
@@ -14568,7 +14601,7 @@ __export(exports_scheduler_service, {
|
|
|
14568
14601
|
SchedulerError: () => SchedulerError,
|
|
14569
14602
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
14570
14603
|
});
|
|
14571
|
-
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";
|
|
14572
14605
|
|
|
14573
14606
|
// ../runtime/src/wait/wait-signal.ts
|
|
14574
14607
|
var exports_wait_signal = {};
|
|
@@ -14588,14 +14621,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
14588
14621
|
});
|
|
14589
14622
|
|
|
14590
14623
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
14591
|
-
class SchedulerError extends
|
|
14592
|
-
message:
|
|
14624
|
+
class SchedulerError extends Schema72.TaggedErrorClass()("SchedulerError", {
|
|
14625
|
+
message: Schema72.String
|
|
14593
14626
|
}) {
|
|
14594
14627
|
}
|
|
14595
14628
|
|
|
14596
|
-
class ScheduleCronInvalid extends
|
|
14597
|
-
cron_expr:
|
|
14598
|
-
message:
|
|
14629
|
+
class ScheduleCronInvalid extends Schema72.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
14630
|
+
cron_expr: Schema72.String,
|
|
14631
|
+
message: Schema72.String
|
|
14599
14632
|
}) {
|
|
14600
14633
|
}
|
|
14601
14634
|
|
|
@@ -14746,25 +14779,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
14746
14779
|
});
|
|
14747
14780
|
|
|
14748
14781
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
14749
|
-
var DatabaseMode =
|
|
14782
|
+
var DatabaseMode = Schema73.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
|
|
14750
14783
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
14751
14784
|
});
|
|
14752
|
-
var ReadinessStatus =
|
|
14785
|
+
var ReadinessStatus = Schema73.Struct({
|
|
14753
14786
|
database: DatabaseMode,
|
|
14754
|
-
cluster:
|
|
14755
|
-
workflow:
|
|
14756
|
-
executionEntity:
|
|
14787
|
+
cluster: Schema73.Literal("ready"),
|
|
14788
|
+
workflow: Schema73.Literals(["ready", "client"]),
|
|
14789
|
+
executionEntity: Schema73.Literals(["registered", "client"])
|
|
14757
14790
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
14758
14791
|
|
|
14759
|
-
class RunnerRuntimeError extends
|
|
14760
|
-
message:
|
|
14792
|
+
class RunnerRuntimeError extends Schema73.TaggedErrorClass()("RunnerRuntimeError", {
|
|
14793
|
+
message: Schema73.String
|
|
14761
14794
|
}) {
|
|
14762
14795
|
}
|
|
14763
14796
|
|
|
14764
|
-
class ClusterConfigMismatch extends
|
|
14765
|
-
field:
|
|
14766
|
-
expected:
|
|
14767
|
-
actual:
|
|
14797
|
+
class ClusterConfigMismatch extends Schema73.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
14798
|
+
field: Schema73.String,
|
|
14799
|
+
expected: Schema73.String,
|
|
14800
|
+
actual: Schema73.String
|
|
14768
14801
|
}) {
|
|
14769
14802
|
}
|
|
14770
14803
|
|
|
@@ -14778,7 +14811,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
|
|
|
14778
14811
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
14779
14812
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
14780
14813
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
14781
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
14814
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema73.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
14782
14815
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
14783
14816
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
14784
14817
|
var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
|
|
@@ -15108,51 +15141,51 @@ __export(exports_activity_version_registry, {
|
|
|
15108
15141
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
15109
15142
|
ActivityManifest: () => ActivityManifest
|
|
15110
15143
|
});
|
|
15111
|
-
import { Crypto as Crypto5, Effect as Effect78, Schema as
|
|
15144
|
+
import { Crypto as Crypto5, Effect as Effect78, Schema as Schema74 } from "effect";
|
|
15112
15145
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
15113
|
-
var ActivityManifestEntry =
|
|
15114
|
-
name:
|
|
15115
|
-
signature_hash:
|
|
15146
|
+
var ActivityManifestEntry = Schema74.Struct({
|
|
15147
|
+
name: Schema74.String,
|
|
15148
|
+
signature_hash: Schema74.String
|
|
15116
15149
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
15117
|
-
var ActivityManifest =
|
|
15118
|
-
version:
|
|
15119
|
-
generated_from:
|
|
15120
|
-
hash_algorithm:
|
|
15121
|
-
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)
|
|
15122
15155
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
15123
|
-
var ActivityManifestChange =
|
|
15124
|
-
type:
|
|
15125
|
-
name:
|
|
15126
|
-
baseline_hash:
|
|
15127
|
-
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)
|
|
15128
15161
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
15129
|
-
var ActivityManifestGuardResult =
|
|
15130
|
-
status:
|
|
15131
|
-
waiting_executions:
|
|
15132
|
-
breaking_changes:
|
|
15133
|
-
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)
|
|
15134
15167
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
15135
15168
|
|
|
15136
|
-
class ActivityManifestGuardFailed extends
|
|
15137
|
-
message:
|
|
15169
|
+
class ActivityManifestGuardFailed extends Schema74.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
15170
|
+
message: Schema74.String,
|
|
15138
15171
|
result: ActivityManifestGuardResult
|
|
15139
15172
|
}) {
|
|
15140
15173
|
}
|
|
15141
|
-
var TurnInput =
|
|
15174
|
+
var TurnInput = Schema74.Struct({
|
|
15142
15175
|
start: StartInput,
|
|
15143
|
-
turn:
|
|
15176
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0))
|
|
15144
15177
|
});
|
|
15145
|
-
var WaitIdInput =
|
|
15178
|
+
var WaitIdInput = Schema74.Struct({
|
|
15146
15179
|
wait_id: exports_ids_schema.WaitId
|
|
15147
15180
|
});
|
|
15148
|
-
var WorkspaceKeyInput =
|
|
15181
|
+
var WorkspaceKeyInput = Schema74.Struct({
|
|
15149
15182
|
start: StartInput,
|
|
15150
|
-
key:
|
|
15183
|
+
key: Schema74.String
|
|
15151
15184
|
});
|
|
15152
15185
|
var contracts = [
|
|
15153
15186
|
{
|
|
15154
15187
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
15155
|
-
input:
|
|
15188
|
+
input: Schema74.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
15156
15189
|
success: LocalAgentTarget,
|
|
15157
15190
|
error: ExecutionWorkflowFailed
|
|
15158
15191
|
},
|
|
@@ -15164,66 +15197,66 @@ var contracts = [
|
|
|
15164
15197
|
},
|
|
15165
15198
|
{
|
|
15166
15199
|
name: ActivityNameTemplates.cancel,
|
|
15167
|
-
input:
|
|
15200
|
+
input: Schema74.Struct({ start: StartInput, turn: Schema74.Int, reason: Schema74.String }),
|
|
15168
15201
|
success: exports_execution_schema.Execution,
|
|
15169
15202
|
error: ExecutionWorkflowFailed
|
|
15170
15203
|
},
|
|
15171
15204
|
{
|
|
15172
15205
|
name: ActivityNameTemplates.checkCancel,
|
|
15173
15206
|
input: TurnInput,
|
|
15174
|
-
success:
|
|
15207
|
+
success: Schema74.Boolean,
|
|
15175
15208
|
error: ExecutionWorkflowFailed
|
|
15176
15209
|
},
|
|
15177
15210
|
{
|
|
15178
15211
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
15179
15212
|
input: WaitIdInput,
|
|
15180
|
-
success:
|
|
15213
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15181
15214
|
error: ExecutionWorkflowFailed
|
|
15182
15215
|
},
|
|
15183
15216
|
{
|
|
15184
15217
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
15185
15218
|
input: WaitIdInput,
|
|
15186
|
-
success:
|
|
15219
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15187
15220
|
error: ExecutionWorkflowFailed
|
|
15188
15221
|
},
|
|
15189
15222
|
{
|
|
15190
15223
|
name: ActivityNameTemplates.markWaiting,
|
|
15191
|
-
input:
|
|
15224
|
+
input: Schema74.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
15192
15225
|
success: exports_execution_schema.Execution,
|
|
15193
15226
|
error: ExecutionWorkflowFailed
|
|
15194
15227
|
},
|
|
15195
15228
|
{
|
|
15196
15229
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
15197
15230
|
input: StartInput,
|
|
15198
|
-
success:
|
|
15231
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15199
15232
|
error: ExecutionWorkflowFailed
|
|
15200
15233
|
},
|
|
15201
15234
|
{
|
|
15202
15235
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
15203
15236
|
input: WorkspaceKeyInput,
|
|
15204
|
-
success:
|
|
15237
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15205
15238
|
error: ExecutionWorkflowFailed
|
|
15206
15239
|
},
|
|
15207
15240
|
{
|
|
15208
15241
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
15209
15242
|
input: WorkspaceKeyInput,
|
|
15210
|
-
success:
|
|
15243
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15211
15244
|
error: ExecutionWorkflowFailed
|
|
15212
15245
|
},
|
|
15213
15246
|
{
|
|
15214
15247
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
15215
15248
|
input: StartInput,
|
|
15216
|
-
success:
|
|
15249
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15217
15250
|
error: ExecutionWorkflowFailed
|
|
15218
15251
|
},
|
|
15219
15252
|
{
|
|
15220
15253
|
name: ActivityNameTemplates.complete,
|
|
15221
|
-
input:
|
|
15254
|
+
input: Schema74.Struct({
|
|
15222
15255
|
start: StartInput,
|
|
15223
|
-
turn:
|
|
15224
|
-
wait_id:
|
|
15225
|
-
wait_state:
|
|
15226
|
-
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)
|
|
15227
15260
|
}),
|
|
15228
15261
|
success: exports_execution_schema.Execution,
|
|
15229
15262
|
error: ExecutionWorkflowFailed
|
|
@@ -15231,24 +15264,24 @@ var contracts = [
|
|
|
15231
15264
|
{
|
|
15232
15265
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
15233
15266
|
input: StartInput,
|
|
15234
|
-
success:
|
|
15267
|
+
success: Schema74.Boolean,
|
|
15235
15268
|
error: ExecutionWorkflowFailed
|
|
15236
15269
|
},
|
|
15237
15270
|
{
|
|
15238
15271
|
name: ActivityNameTemplates.notifyParent,
|
|
15239
|
-
input:
|
|
15272
|
+
input: Schema74.Struct({
|
|
15240
15273
|
start: StartInput,
|
|
15241
15274
|
status: ChildTerminalStatus,
|
|
15242
|
-
output:
|
|
15275
|
+
output: Schema74.Array(exports_content_schema.Part)
|
|
15243
15276
|
}),
|
|
15244
|
-
success:
|
|
15277
|
+
success: Schema74.Void,
|
|
15245
15278
|
error: ExecutionWorkflowFailed
|
|
15246
15279
|
},
|
|
15247
15280
|
{
|
|
15248
15281
|
name: ActivityNameTemplates.continueAsNew,
|
|
15249
|
-
input:
|
|
15282
|
+
input: Schema74.Struct({
|
|
15250
15283
|
start: StartInput,
|
|
15251
|
-
turn:
|
|
15284
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15252
15285
|
wait_id: exports_ids_schema.WaitId,
|
|
15253
15286
|
pending_tool_call: exports_tool_schema.Call
|
|
15254
15287
|
}),
|
|
@@ -15256,7 +15289,7 @@ var contracts = [
|
|
|
15256
15289
|
error: ExecutionWorkflowFailed
|
|
15257
15290
|
}
|
|
15258
15291
|
];
|
|
15259
|
-
var schemaJson = (schema) =>
|
|
15292
|
+
var schemaJson = (schema) => Schema74.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema74.toJsonSchemaDocument(schema));
|
|
15260
15293
|
var canonical = (value) => {
|
|
15261
15294
|
if (value === null || typeof value !== "object")
|
|
15262
15295
|
return value;
|
|
@@ -15347,11 +15380,11 @@ var guard = Effect78.fn("ActivityVersionRegistry.guard")(function* (input) {
|
|
|
15347
15380
|
}));
|
|
15348
15381
|
});
|
|
15349
15382
|
// src/client.ts
|
|
15350
|
-
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";
|
|
15351
15384
|
import { EntityId, ShardId, Sharding as Sharding2, ShardingConfig as ShardingConfig3 } from "effect/unstable/cluster";
|
|
15352
15385
|
|
|
15353
|
-
class ClientError extends
|
|
15354
|
-
message:
|
|
15386
|
+
class ClientError extends Schema75.TaggedErrorClass()("ClientError", {
|
|
15387
|
+
message: Schema75.String
|
|
15355
15388
|
}) {
|
|
15356
15389
|
}
|
|
15357
15390
|
|
|
@@ -15383,11 +15416,11 @@ var decodeCursorFields = (wire) => Effect79.gen(function* () {
|
|
|
15383
15416
|
return yield* Effect79.fail(malformedCursor(wire));
|
|
15384
15417
|
return { updatedAt, id: decoded.slice(separator + 1) };
|
|
15385
15418
|
});
|
|
15386
|
-
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 }), {
|
|
15387
15420
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
15388
15421
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
15389
15422
|
})).annotate({ identifier: "Relay.Client.ExecutionCursor" });
|
|
15390
|
-
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 }), {
|
|
15391
15424
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
15392
15425
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
15393
15426
|
})).annotate({ identifier: "Relay.Client.SessionCursor" });
|
|
@@ -15475,7 +15508,7 @@ var registerAgentPayload = (input) => {
|
|
|
15475
15508
|
return exports_agent_schema.define(input);
|
|
15476
15509
|
return exports_agent_schema.define({
|
|
15477
15510
|
id: input.id,
|
|
15478
|
-
name:
|
|
15511
|
+
name: Schema75.decodeUnknownSync(exports_shared_schema.NonEmptyString)(input.agent.name),
|
|
15479
15512
|
...input.agent.instructions === undefined ? {} : { instructions: input.agent.instructions },
|
|
15480
15513
|
model: input.model,
|
|
15481
15514
|
tools: toolRefsFromBatonAgent(input.agent),
|
|
@@ -15719,27 +15752,27 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15719
15752
|
return records.map(toWaitView);
|
|
15720
15753
|
}),
|
|
15721
15754
|
listExecutions: Effect79.fn("Client.runtime.listExecutions")(function* (input) {
|
|
15722
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15755
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15723
15756
|
const result = yield* executionRepository.list({
|
|
15724
15757
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
15725
15758
|
...input.status === undefined ? {} : { status: input.status },
|
|
15726
15759
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15727
15760
|
...cursor === undefined ? {} : { cursor }
|
|
15728
15761
|
}).pipe(Effect79.mapError(toClientError));
|
|
15729
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15762
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15730
15763
|
return {
|
|
15731
15764
|
records: result.records.map(toConversationSummary),
|
|
15732
15765
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
15733
15766
|
};
|
|
15734
15767
|
}),
|
|
15735
15768
|
listSessions: Effect79.fn("Client.runtime.listSessions")(function* (input) {
|
|
15736
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15769
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(SessionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15737
15770
|
const result = yield* sessionRepository.list({
|
|
15738
15771
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
15739
15772
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15740
15773
|
...cursor === undefined ? {} : { cursor }
|
|
15741
15774
|
}).pipe(Effect79.mapError(toClientError));
|
|
15742
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15775
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(SessionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15743
15776
|
return {
|
|
15744
15777
|
records: result.records.map(toSessionSummary),
|
|
15745
15778
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
@@ -15749,13 +15782,13 @@ var layerFromRuntime = Layer70.effect(Service50, Effect79.gen(function* () {
|
|
|
15749
15782
|
const session = yield* sessionRepository.get(input.session_id).pipe(Effect79.mapError(toClientError));
|
|
15750
15783
|
if (session === undefined)
|
|
15751
15784
|
return yield* new ClientError({ message: `Session not found: ${input.session_id}` });
|
|
15752
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
15785
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema75.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect79.mapError(toClientError));
|
|
15753
15786
|
const result = yield* executionRepository.list({
|
|
15754
15787
|
sessionId: input.session_id,
|
|
15755
15788
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
15756
15789
|
...cursor === undefined ? {} : { cursor }
|
|
15757
15790
|
}).pipe(Effect79.mapError(toClientError));
|
|
15758
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
15791
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema75.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect79.mapError(toClientError));
|
|
15759
15792
|
return {
|
|
15760
15793
|
session: toSessionSummary(session),
|
|
15761
15794
|
executions: result.records.map(toConversationSummary),
|
|
@@ -16168,92 +16201,92 @@ __export(exports_operation, {
|
|
|
16168
16201
|
CancelExecutionAccepted: () => CancelExecutionAccepted,
|
|
16169
16202
|
AckEnvelopeReadyInput: () => AckEnvelopeReadyInput
|
|
16170
16203
|
});
|
|
16171
|
-
import { Schema as
|
|
16172
|
-
var StartExecutionInput =
|
|
16204
|
+
import { Schema as Schema76 } from "effect";
|
|
16205
|
+
var StartExecutionInput = Schema76.Struct({
|
|
16173
16206
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16174
16207
|
root_address_id: exports_ids_schema.AddressId,
|
|
16175
|
-
session_id:
|
|
16176
|
-
input:
|
|
16208
|
+
session_id: Schema76.optionalKey(exports_ids_schema.SessionId),
|
|
16209
|
+
input: Schema76.optionalKey(Schema76.Array(exports_content_schema.Part)),
|
|
16177
16210
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
16178
16211
|
started_at: exports_shared_schema.TimestampMillis,
|
|
16179
16212
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
16180
|
-
agent_id:
|
|
16181
|
-
agent_revision:
|
|
16182
|
-
agent_snapshot:
|
|
16183
|
-
agent_tool_input_schema_digests:
|
|
16184
|
-
wait_id:
|
|
16185
|
-
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)
|
|
16186
16219
|
}).annotate({ identifier: "Relay.Operation.StartExecutionInput" });
|
|
16187
|
-
var StartExecutionResult =
|
|
16220
|
+
var StartExecutionResult = Schema76.Struct({
|
|
16188
16221
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16189
16222
|
status: exports_execution_schema.ExecutionStatus,
|
|
16190
|
-
metadata:
|
|
16223
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16191
16224
|
}).annotate({ identifier: "Relay.Operation.StartExecutionResult" });
|
|
16192
|
-
var StreamExecutionInput =
|
|
16225
|
+
var StreamExecutionInput = Schema76.Struct({
|
|
16193
16226
|
execution_id: exports_execution_schema.Execution.fields.id,
|
|
16194
|
-
after_cursor:
|
|
16195
|
-
limit:
|
|
16227
|
+
after_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16228
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0)))
|
|
16196
16229
|
}).annotate({ identifier: "Relay.Operation.StreamExecutionInput" });
|
|
16197
|
-
var WaitTerminalState =
|
|
16230
|
+
var WaitTerminalState = Schema76.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
16198
16231
|
identifier: "Relay.Operation.WaitTerminalState"
|
|
16199
16232
|
});
|
|
16200
|
-
var CancelExecutionInput2 =
|
|
16233
|
+
var CancelExecutionInput2 = Schema76.Struct({
|
|
16201
16234
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16202
16235
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
16203
|
-
reason:
|
|
16236
|
+
reason: Schema76.optionalKey(Schema76.String)
|
|
16204
16237
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionInput" });
|
|
16205
|
-
var CancelExecutionAccepted =
|
|
16238
|
+
var CancelExecutionAccepted = Schema76.Struct({
|
|
16206
16239
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16207
16240
|
status: exports_execution_schema.ExecutionStatus
|
|
16208
16241
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionAccepted" });
|
|
16209
|
-
var SteeringKind =
|
|
16242
|
+
var SteeringKind = Schema76.Literals(["steering", "follow_up"]).annotate({
|
|
16210
16243
|
identifier: "Relay.Operation.SteeringKind"
|
|
16211
16244
|
});
|
|
16212
|
-
var SteerInput =
|
|
16245
|
+
var SteerInput = Schema76.Struct({
|
|
16213
16246
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16214
16247
|
kind: SteeringKind,
|
|
16215
|
-
content:
|
|
16248
|
+
content: Schema76.Array(exports_content_schema.Part),
|
|
16216
16249
|
created_at: exports_shared_schema.TimestampMillis
|
|
16217
16250
|
}).annotate({ identifier: "Relay.Operation.SteerInput" });
|
|
16218
|
-
var SteerAccepted =
|
|
16251
|
+
var SteerAccepted = Schema76.Struct({
|
|
16219
16252
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16220
16253
|
kind: SteeringKind,
|
|
16221
|
-
sequence:
|
|
16254
|
+
sequence: Schema76.Int.check(Schema76.isGreaterThanOrEqualTo(0))
|
|
16222
16255
|
}).annotate({ identifier: "Relay.Operation.SteerAccepted" });
|
|
16223
|
-
var WakeInput =
|
|
16256
|
+
var WakeInput = Schema76.Struct({
|
|
16224
16257
|
wait_id: exports_ids_schema.WaitId,
|
|
16225
16258
|
state: WaitTerminalState,
|
|
16226
16259
|
signaled_at: exports_shared_schema.TimestampMillis,
|
|
16227
|
-
from:
|
|
16228
|
-
content:
|
|
16229
|
-
correlation_key:
|
|
16230
|
-
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)
|
|
16231
16264
|
}).annotate({ identifier: "Relay.Operation.WakeInput" });
|
|
16232
|
-
var WakeAccepted =
|
|
16265
|
+
var WakeAccepted = Schema76.Struct({
|
|
16233
16266
|
wait_id: exports_ids_schema.WaitId,
|
|
16234
16267
|
state: WaitTerminalState,
|
|
16235
16268
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
16236
16269
|
}).annotate({ identifier: "Relay.Operation.WakeAccepted" });
|
|
16237
|
-
var WaitState2 =
|
|
16270
|
+
var WaitState2 = Schema76.Literals(["open", "resolved", "timed_out", "cancelled"]).annotate({
|
|
16238
16271
|
identifier: "Relay.Operation.WaitState"
|
|
16239
16272
|
});
|
|
16240
|
-
var ListWaitsInput =
|
|
16241
|
-
state:
|
|
16242
|
-
execution_id:
|
|
16243
|
-
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)))
|
|
16244
16277
|
}).annotate({ identifier: "Relay.Operation.ListWaitsInput" });
|
|
16245
|
-
var WaitView =
|
|
16278
|
+
var WaitView = Schema76.Struct({
|
|
16246
16279
|
wait_id: exports_ids_schema.WaitId,
|
|
16247
16280
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16248
|
-
envelope_id:
|
|
16281
|
+
envelope_id: Schema76.optionalKey(exports_ids_schema.EnvelopeId),
|
|
16249
16282
|
mode: exports_envelope_schema.WaitMode,
|
|
16250
|
-
correlation_key:
|
|
16283
|
+
correlation_key: Schema76.optionalKey(Schema76.String),
|
|
16251
16284
|
state: WaitState2,
|
|
16252
16285
|
metadata: exports_shared_schema.Metadata,
|
|
16253
16286
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16254
|
-
resolved_at:
|
|
16287
|
+
resolved_at: Schema76.optionalKey(exports_shared_schema.TimestampMillis)
|
|
16255
16288
|
}).annotate({ identifier: "Relay.Operation.WaitView" });
|
|
16256
|
-
var PendingToolApproval =
|
|
16289
|
+
var PendingToolApproval = Schema76.Struct({
|
|
16257
16290
|
wait_id: exports_ids_schema.WaitId,
|
|
16258
16291
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16259
16292
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
@@ -16261,169 +16294,169 @@ var PendingToolApproval = Schema75.Struct({
|
|
|
16261
16294
|
input: exports_shared_schema.JsonValue,
|
|
16262
16295
|
requested_at: exports_shared_schema.TimestampMillis
|
|
16263
16296
|
}).annotate({ identifier: "Relay.Operation.PendingToolApproval" });
|
|
16264
|
-
var ListPendingApprovalsInput =
|
|
16297
|
+
var ListPendingApprovalsInput = Schema76.Struct({
|
|
16265
16298
|
execution_id: exports_ids_schema.ExecutionId
|
|
16266
16299
|
}).annotate({ identifier: "Relay.Operation.ListPendingApprovalsInput" });
|
|
16267
|
-
var PendingToolApprovalList =
|
|
16268
|
-
approvals:
|
|
16300
|
+
var PendingToolApprovalList = Schema76.Struct({
|
|
16301
|
+
approvals: Schema76.Array(PendingToolApproval)
|
|
16269
16302
|
}).annotate({ identifier: "Relay.Operation.PendingToolApprovalList" });
|
|
16270
|
-
var ResolveToolApprovalInput =
|
|
16303
|
+
var ResolveToolApprovalInput = Schema76.Struct({
|
|
16271
16304
|
wait_id: exports_ids_schema.WaitId,
|
|
16272
|
-
approved:
|
|
16273
|
-
comment:
|
|
16305
|
+
approved: Schema76.Boolean,
|
|
16306
|
+
comment: Schema76.optionalKey(Schema76.String),
|
|
16274
16307
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
16275
16308
|
}).annotate({ identifier: "Relay.Operation.ResolveToolApprovalInput" });
|
|
16276
|
-
var PermissionAnswer =
|
|
16309
|
+
var PermissionAnswer = Schema76.Literals(["Approved", "Denied", "Always"]).annotate({
|
|
16277
16310
|
identifier: "Relay.Operation.PermissionAnswer"
|
|
16278
16311
|
});
|
|
16279
|
-
var ResolvePermissionInput =
|
|
16312
|
+
var ResolvePermissionInput = Schema76.Struct({
|
|
16280
16313
|
wait_id: exports_ids_schema.WaitId,
|
|
16281
16314
|
answer: PermissionAnswer,
|
|
16282
|
-
reason:
|
|
16315
|
+
reason: Schema76.optionalKey(Schema76.String),
|
|
16283
16316
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
16284
16317
|
}).annotate({ identifier: "Relay.Operation.ResolvePermissionInput" });
|
|
16285
|
-
var SubmitInboundEnvelopeInput =
|
|
16318
|
+
var SubmitInboundEnvelopeInput = Schema76.Struct({
|
|
16286
16319
|
envelope: exports_envelope_schema.SendInput,
|
|
16287
16320
|
wake: WakeInput
|
|
16288
16321
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeInput" });
|
|
16289
|
-
var SubmitInboundEnvelopeAccepted =
|
|
16322
|
+
var SubmitInboundEnvelopeAccepted = Schema76.Struct({
|
|
16290
16323
|
envelope: exports_envelope_schema.EnvelopeAccepted,
|
|
16291
16324
|
wake: WakeAccepted
|
|
16292
16325
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeAccepted" });
|
|
16293
|
-
var ClaimEnvelopeReadyInput =
|
|
16326
|
+
var ClaimEnvelopeReadyInput = Schema76.Struct({
|
|
16294
16327
|
route_type: exports_address_schema.RouteKind,
|
|
16295
|
-
route_key:
|
|
16328
|
+
route_key: Schema76.optionalKey(Schema76.String),
|
|
16296
16329
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16297
16330
|
now: exports_shared_schema.TimestampMillis,
|
|
16298
16331
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
16299
16332
|
}).annotate({ identifier: "Relay.Operation.ClaimEnvelopeReadyInput" });
|
|
16300
|
-
var EnvelopeReadyLease =
|
|
16333
|
+
var EnvelopeReadyLease = Schema76.Struct({
|
|
16301
16334
|
ready: exports_envelope_schema.EnvelopeReady,
|
|
16302
16335
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16303
16336
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
16304
16337
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyLease" });
|
|
16305
|
-
var AckEnvelopeReadyInput =
|
|
16338
|
+
var AckEnvelopeReadyInput = Schema76.Struct({
|
|
16306
16339
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16307
16340
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16308
16341
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
16309
16342
|
}).annotate({ identifier: "Relay.Operation.AckEnvelopeReadyInput" });
|
|
16310
|
-
var EnvelopeReadyAcked =
|
|
16343
|
+
var EnvelopeReadyAcked = Schema76.Struct({
|
|
16311
16344
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16312
|
-
state:
|
|
16345
|
+
state: Schema76.Literal("acknowledged"),
|
|
16313
16346
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
16314
16347
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyAcked" });
|
|
16315
|
-
var ReleaseEnvelopeReadyInput =
|
|
16348
|
+
var ReleaseEnvelopeReadyInput = Schema76.Struct({
|
|
16316
16349
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16317
16350
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
16318
16351
|
next_available_at: exports_shared_schema.TimestampMillis,
|
|
16319
|
-
error:
|
|
16352
|
+
error: Schema76.optionalKey(Schema76.String)
|
|
16320
16353
|
}).annotate({ identifier: "Relay.Operation.ReleaseEnvelopeReadyInput" });
|
|
16321
|
-
var EnvelopeReadyReleased =
|
|
16354
|
+
var EnvelopeReadyReleased = Schema76.Struct({
|
|
16322
16355
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
16323
|
-
state:
|
|
16356
|
+
state: Schema76.Literal("ready"),
|
|
16324
16357
|
next_available_at: exports_shared_schema.TimestampMillis
|
|
16325
16358
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyReleased" });
|
|
16326
|
-
var CreateScheduleInput =
|
|
16359
|
+
var CreateScheduleInput = Schema76.Struct({
|
|
16327
16360
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
16328
16361
|
kind: exports_schedule_schema.ScheduleKind,
|
|
16329
16362
|
target_kind: exports_schedule_schema.ScheduleTargetKind,
|
|
16330
|
-
address_id:
|
|
16331
|
-
wait_id:
|
|
16332
|
-
cron_expr:
|
|
16333
|
-
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)),
|
|
16334
16367
|
next_run_at: exports_shared_schema.TimestampMillis,
|
|
16335
|
-
idempotency_key:
|
|
16336
|
-
metadata:
|
|
16368
|
+
idempotency_key: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16369
|
+
metadata: Schema76.optionalKey(exports_shared_schema.Metadata)
|
|
16337
16370
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleInput" });
|
|
16338
|
-
var CreateScheduleResult =
|
|
16371
|
+
var CreateScheduleResult = Schema76.Struct({
|
|
16339
16372
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
16340
16373
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleResult" });
|
|
16341
|
-
var CancelScheduleInput =
|
|
16374
|
+
var CancelScheduleInput = Schema76.Struct({
|
|
16342
16375
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
16343
16376
|
cancelled_at: exports_shared_schema.TimestampMillis
|
|
16344
16377
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleInput" });
|
|
16345
|
-
var CancelScheduleResult =
|
|
16378
|
+
var CancelScheduleResult = Schema76.Struct({
|
|
16346
16379
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
16347
16380
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleResult" });
|
|
16348
|
-
var ListSchedulesInput =
|
|
16349
|
-
state:
|
|
16381
|
+
var ListSchedulesInput = Schema76.Struct({
|
|
16382
|
+
state: Schema76.optionalKey(exports_schedule_schema.ScheduleState)
|
|
16350
16383
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesInput" });
|
|
16351
|
-
var ListSchedulesResult =
|
|
16352
|
-
schedules:
|
|
16384
|
+
var ListSchedulesResult = Schema76.Struct({
|
|
16385
|
+
schedules: Schema76.Array(exports_schedule_schema.ScheduleRecord)
|
|
16353
16386
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesResult" });
|
|
16354
|
-
var ListExecutionsInput =
|
|
16355
|
-
root_address_id:
|
|
16356
|
-
status:
|
|
16357
|
-
limit:
|
|
16358
|
-
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)
|
|
16359
16392
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsInput" });
|
|
16360
|
-
var ConversationKind =
|
|
16393
|
+
var ConversationKind = Schema76.Literals(["user-agent", "agent-agent"]).annotate({
|
|
16361
16394
|
identifier: "Relay.Operation.ConversationKind"
|
|
16362
16395
|
});
|
|
16363
|
-
var ConversationSummary =
|
|
16396
|
+
var ConversationSummary = Schema76.Struct({
|
|
16364
16397
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16365
16398
|
root_address_id: exports_ids_schema.AddressId,
|
|
16366
|
-
session_id:
|
|
16399
|
+
session_id: Schema76.optionalKey(exports_ids_schema.SessionId),
|
|
16367
16400
|
status: exports_execution_schema.ExecutionStatus,
|
|
16368
16401
|
kind: ConversationKind,
|
|
16369
|
-
agent_id:
|
|
16402
|
+
agent_id: Schema76.optionalKey(exports_ids_schema.AgentId),
|
|
16370
16403
|
metadata: exports_shared_schema.Metadata,
|
|
16371
16404
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16372
16405
|
updated_at: exports_shared_schema.TimestampMillis
|
|
16373
16406
|
}).annotate({ identifier: "Relay.Operation.ConversationSummary" });
|
|
16374
|
-
var ListExecutionsResult =
|
|
16375
|
-
records:
|
|
16376
|
-
next_cursor:
|
|
16407
|
+
var ListExecutionsResult = Schema76.Struct({
|
|
16408
|
+
records: Schema76.Array(ConversationSummary),
|
|
16409
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16377
16410
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsResult" });
|
|
16378
|
-
var ListSessionsInput =
|
|
16379
|
-
root_address_id:
|
|
16380
|
-
limit:
|
|
16381
|
-
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)
|
|
16382
16415
|
}).annotate({ identifier: "Relay.Operation.ListSessionsInput" });
|
|
16383
|
-
var SessionSummary =
|
|
16416
|
+
var SessionSummary = Schema76.Struct({
|
|
16384
16417
|
session_id: exports_ids_schema.SessionId,
|
|
16385
16418
|
root_address_id: exports_ids_schema.AddressId,
|
|
16386
16419
|
metadata: exports_shared_schema.Metadata,
|
|
16387
16420
|
created_at: exports_shared_schema.TimestampMillis,
|
|
16388
16421
|
updated_at: exports_shared_schema.TimestampMillis
|
|
16389
16422
|
}).annotate({ identifier: "Relay.Operation.SessionSummary" });
|
|
16390
|
-
var ListSessionsResult =
|
|
16391
|
-
records:
|
|
16392
|
-
next_cursor:
|
|
16423
|
+
var ListSessionsResult = Schema76.Struct({
|
|
16424
|
+
records: Schema76.Array(SessionSummary),
|
|
16425
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16393
16426
|
}).annotate({ identifier: "Relay.Operation.ListSessionsResult" });
|
|
16394
|
-
var GetSessionInput =
|
|
16427
|
+
var GetSessionInput = Schema76.Struct({
|
|
16395
16428
|
session_id: exports_ids_schema.SessionId,
|
|
16396
|
-
limit:
|
|
16397
|
-
cursor:
|
|
16429
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0))),
|
|
16430
|
+
cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16398
16431
|
}).annotate({ identifier: "Relay.Operation.GetSessionInput" });
|
|
16399
|
-
var GetSessionResult =
|
|
16432
|
+
var GetSessionResult = Schema76.Struct({
|
|
16400
16433
|
session: SessionSummary,
|
|
16401
|
-
executions:
|
|
16402
|
-
next_cursor:
|
|
16434
|
+
executions: Schema76.Array(ConversationSummary),
|
|
16435
|
+
next_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString)
|
|
16403
16436
|
}).annotate({ identifier: "Relay.Operation.GetSessionResult" });
|
|
16404
|
-
var ReplayExecutionInput =
|
|
16437
|
+
var ReplayExecutionInput = Schema76.Struct({
|
|
16405
16438
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16406
|
-
after_cursor:
|
|
16407
|
-
limit:
|
|
16439
|
+
after_cursor: Schema76.optionalKey(exports_shared_schema.NonEmptyString),
|
|
16440
|
+
limit: Schema76.optionalKey(Schema76.Int.check(Schema76.isGreaterThan(0)))
|
|
16408
16441
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionInput" });
|
|
16409
|
-
var ReplayExecutionResult =
|
|
16410
|
-
events:
|
|
16442
|
+
var ReplayExecutionResult = Schema76.Struct({
|
|
16443
|
+
events: Schema76.Array(exports_execution_schema.ExecutionEvent)
|
|
16411
16444
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionResult" });
|
|
16412
|
-
var RunnerSummary =
|
|
16413
|
-
address:
|
|
16414
|
-
healthy:
|
|
16445
|
+
var RunnerSummary = Schema76.Struct({
|
|
16446
|
+
address: Schema76.String,
|
|
16447
|
+
healthy: Schema76.Boolean,
|
|
16415
16448
|
last_heartbeat: exports_shared_schema.TimestampMillis,
|
|
16416
|
-
owned_shards:
|
|
16449
|
+
owned_shards: Schema76.Int
|
|
16417
16450
|
}).annotate({ identifier: "Relay.Operation.RunnerSummary" });
|
|
16418
|
-
var ListRunnersResult =
|
|
16419
|
-
runners:
|
|
16420
|
-
total_shards:
|
|
16451
|
+
var ListRunnersResult = Schema76.Struct({
|
|
16452
|
+
runners: Schema76.Array(RunnerSummary),
|
|
16453
|
+
total_shards: Schema76.Int
|
|
16421
16454
|
}).annotate({ identifier: "Relay.Operation.ListRunnersResult" });
|
|
16422
|
-
var RouteExecutionResult =
|
|
16455
|
+
var RouteExecutionResult = Schema76.Struct({
|
|
16423
16456
|
execution_id: exports_ids_schema.ExecutionId,
|
|
16424
|
-
shard:
|
|
16425
|
-
runner_address:
|
|
16426
|
-
owned:
|
|
16457
|
+
shard: Schema76.String,
|
|
16458
|
+
runner_address: Schema76.NullOr(Schema76.String),
|
|
16459
|
+
owned: Schema76.Boolean
|
|
16427
16460
|
}).annotate({ identifier: "Relay.Operation.RouteExecutionResult" });
|
|
16428
16461
|
// ../ai/src/embedding-model/embedding-model-registration.ts
|
|
16429
16462
|
import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai";
|
|
@@ -16455,7 +16488,7 @@ __export(exports_language_model_registration, {
|
|
|
16455
16488
|
anthropic: () => anthropic
|
|
16456
16489
|
});
|
|
16457
16490
|
|
|
16458
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16491
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/anthropic.ts
|
|
16459
16492
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
16460
16493
|
import { Layer as Layer72 } from "effect";
|
|
16461
16494
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -16471,13 +16504,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16471
16504
|
});
|
|
16472
16505
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
16473
16506
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer72.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer72.provide(FetchHttpClient2.layer));
|
|
16474
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16507
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16475
16508
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
16476
16509
|
import { Effect as Effect81, Layer as Layer74, Option as Option29, Stream as Stream12 } from "effect";
|
|
16477
16510
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
16478
16511
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
16479
16512
|
|
|
16480
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16513
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai.ts
|
|
16481
16514
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
16482
16515
|
import { Layer as Layer73 } from "effect";
|
|
16483
16516
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -16494,7 +16527,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16494
16527
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
16495
16528
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer73.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer73.provide(FetchHttpClient3.layer));
|
|
16496
16529
|
|
|
16497
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16530
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16498
16531
|
var deterministicModelLayer = Layer74.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
16499
16532
|
generateText: () => Effect81.succeed([{ type: "text", text: "deterministic response" }]),
|
|
16500
16533
|
streamText: () => Stream12.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -16518,7 +16551,7 @@ var withOpenAiOrDeterministic = (options) => Layer74.unwrap(Effect81.gen(functio
|
|
|
16518
16551
|
...Option29.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
16519
16552
|
]);
|
|
16520
16553
|
}));
|
|
16521
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16554
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
16522
16555
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
16523
16556
|
import { Config as Config8, Layer as Layer75 } from "effect";
|
|
16524
16557
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -16539,7 +16572,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
16539
16572
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
16540
16573
|
});
|
|
16541
16574
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer75.provide(clientLayerConfig(options)), Layer75.provide(FetchHttpClient5.layer));
|
|
16542
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16575
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openrouter.ts
|
|
16543
16576
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
16544
16577
|
import { Layer as Layer76 } from "effect";
|
|
16545
16578
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|