@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/ai.js
CHANGED
|
@@ -8318,7 +8318,7 @@ __export(exports_agent_loop_service, {
|
|
|
8318
8318
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8319
8319
|
});
|
|
8320
8320
|
|
|
8321
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8321
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
|
|
8322
8322
|
var exports_agent = {};
|
|
8323
8323
|
__export(exports_agent, {
|
|
8324
8324
|
streamObject: () => streamObject,
|
|
@@ -8328,10 +8328,10 @@ __export(exports_agent, {
|
|
|
8328
8328
|
generate: () => generate,
|
|
8329
8329
|
defaultObjectPrompt: () => defaultObjectPrompt
|
|
8330
8330
|
});
|
|
8331
|
-
import { Cause as Cause3, Effect as Effect45, Fiber, Option as Option15, Queue as Queue2, Ref as Ref10, Schema as
|
|
8331
|
+
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";
|
|
8332
8332
|
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";
|
|
8333
8333
|
|
|
8334
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8334
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-event.ts
|
|
8335
8335
|
var exports_agent_event = {};
|
|
8336
8336
|
__export(exports_agent_event, {
|
|
8337
8337
|
addUsage: () => addUsage,
|
|
@@ -8388,7 +8388,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8388
8388
|
}) {
|
|
8389
8389
|
}
|
|
8390
8390
|
|
|
8391
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8391
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/approvals.ts
|
|
8392
8392
|
var exports_approvals = {};
|
|
8393
8393
|
__export(exports_approvals, {
|
|
8394
8394
|
testLayer: () => testLayer26,
|
|
@@ -8404,7 +8404,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8404
8404
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8405
8405
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8406
8406
|
|
|
8407
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8407
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/compaction.ts
|
|
8408
8408
|
var exports_compaction = {};
|
|
8409
8409
|
__export(exports_compaction, {
|
|
8410
8410
|
truncate: () => truncate,
|
|
@@ -8422,7 +8422,7 @@ __export(exports_compaction, {
|
|
|
8422
8422
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8423
8423
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8424
8424
|
|
|
8425
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8425
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/session.ts
|
|
8426
8426
|
var exports_session = {};
|
|
8427
8427
|
__export(exports_session, {
|
|
8428
8428
|
testLayer: () => testLayer27,
|
|
@@ -8554,7 +8554,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8554
8554
|
}))));
|
|
8555
8555
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8556
8556
|
|
|
8557
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8557
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-output.ts
|
|
8558
8558
|
var exports_tool_output = {};
|
|
8559
8559
|
__export(exports_tool_output, {
|
|
8560
8560
|
testLayer: () => testLayer28,
|
|
@@ -8614,7 +8614,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8614
8614
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8615
8615
|
});
|
|
8616
8616
|
|
|
8617
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8617
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/compaction.ts
|
|
8618
8618
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8619
8619
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8620
8620
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8797,7 +8797,7 @@ var truncate = (maxTokens) => ({
|
|
|
8797
8797
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8798
8798
|
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));
|
|
8799
8799
|
|
|
8800
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8800
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/instructions.ts
|
|
8801
8801
|
var exports_instructions = {};
|
|
8802
8802
|
__export(exports_instructions, {
|
|
8803
8803
|
testLayer: () => testLayer30,
|
|
@@ -8846,7 +8846,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
8846
8846
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
8847
8847
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
8848
8848
|
|
|
8849
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8849
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/memory.ts
|
|
8850
8850
|
var exports_memory = {};
|
|
8851
8851
|
__export(exports_memory, {
|
|
8852
8852
|
testLayer: () => testLayer31,
|
|
@@ -8875,7 +8875,7 @@ var merge = (first, second) => ({
|
|
|
8875
8875
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
8876
8876
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
8877
8877
|
|
|
8878
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8878
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-middleware.ts
|
|
8879
8879
|
var exports_model_middleware = {};
|
|
8880
8880
|
__export(exports_model_middleware, {
|
|
8881
8881
|
layer: () => layer28,
|
|
@@ -8889,7 +8889,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
8889
8889
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
8890
8890
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
8891
8891
|
|
|
8892
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8892
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-resilience.ts
|
|
8893
8893
|
var exports_model_resilience = {};
|
|
8894
8894
|
__export(exports_model_resilience, {
|
|
8895
8895
|
testLayer: () => testLayer32,
|
|
@@ -8935,7 +8935,7 @@ var apply = (model, resilience) => ({
|
|
|
8935
8935
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
8936
8936
|
});
|
|
8937
8937
|
|
|
8938
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8938
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/permissions.ts
|
|
8939
8939
|
var exports_permissions = {};
|
|
8940
8940
|
__export(exports_permissions, {
|
|
8941
8941
|
testLayer: () => testLayer33,
|
|
@@ -9065,7 +9065,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9065
9065
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9066
9066
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9067
9067
|
|
|
9068
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9068
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/skill-source.ts
|
|
9069
9069
|
var exports_skill_source = {};
|
|
9070
9070
|
__export(exports_skill_source, {
|
|
9071
9071
|
testLayer: () => testLayer34,
|
|
@@ -9123,37 +9123,64 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9123
9123
|
return selected;
|
|
9124
9124
|
};
|
|
9125
9125
|
|
|
9126
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9126
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/steering.ts
|
|
9127
9127
|
var exports_steering = {};
|
|
9128
9128
|
__export(exports_steering, {
|
|
9129
9129
|
testLayer: () => testLayer35,
|
|
9130
9130
|
layer: () => layer30,
|
|
9131
|
+
SteeringQueueFull: () => SteeringQueueFull,
|
|
9131
9132
|
Steering: () => Steering
|
|
9132
9133
|
});
|
|
9133
|
-
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue } from "effect";
|
|
9134
|
+
import { Context as Context39, Effect as Effect41, Exit, Layer as Layer39, Queue, Schema as Schema45 } from "effect";
|
|
9134
9135
|
|
|
9135
9136
|
class Steering extends Context39.Service()("@batonfx/core/Steering") {
|
|
9136
9137
|
}
|
|
9138
|
+
|
|
9139
|
+
class SteeringQueueFull extends Schema45.TaggedErrorClass()("@batonfx/core/SteeringQueueFull", {
|
|
9140
|
+
queue: Schema45.Literals(["steering", "followUp"]),
|
|
9141
|
+
capacity: Schema45.Number
|
|
9142
|
+
}) {
|
|
9143
|
+
}
|
|
9144
|
+
var resolvePolicy = (policy, mode) => ({
|
|
9145
|
+
mode: policy?.mode ?? mode,
|
|
9146
|
+
...policy?.capacity === undefined ? {} : { capacity: policy.capacity },
|
|
9147
|
+
onFull: policy?.onFull ?? "fail"
|
|
9148
|
+
});
|
|
9149
|
+
var queueStrategy = (strategy) => {
|
|
9150
|
+
switch (strategy) {
|
|
9151
|
+
case "drop-oldest":
|
|
9152
|
+
return "sliding";
|
|
9153
|
+
case "drop-newest":
|
|
9154
|
+
case "fail":
|
|
9155
|
+
return "dropping";
|
|
9156
|
+
case "suspend":
|
|
9157
|
+
return "suspend";
|
|
9158
|
+
}
|
|
9159
|
+
};
|
|
9160
|
+
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 })));
|
|
9161
|
+
var offer = (runtime, message) => Queue.offer(runtime.queue, message).pipe(Effect41.flatMap((offered) => {
|
|
9162
|
+
if (offered || runtime.policy.capacity === undefined || runtime.policy.onFull !== "fail")
|
|
9163
|
+
return Effect41.void;
|
|
9164
|
+
return Effect41.fail(new SteeringQueueFull({ queue: runtime.name, capacity: runtime.policy.capacity }));
|
|
9165
|
+
}));
|
|
9137
9166
|
var drainOne = (queue) => Effect41.sync(() => {
|
|
9138
9167
|
const taken = Queue.takeUnsafe(queue);
|
|
9139
9168
|
return taken === undefined || !Exit.isSuccess(taken) ? [] : [taken.value];
|
|
9140
9169
|
});
|
|
9141
9170
|
var drain = (queue, mode) => mode === "all" ? Queue.clear(queue) : drainOne(queue);
|
|
9142
9171
|
var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function* () {
|
|
9143
|
-
const steeringQueue = yield*
|
|
9144
|
-
const followUpQueue = yield*
|
|
9145
|
-
const steeringMode = options.steeringMode ?? "all";
|
|
9146
|
-
const followUpMode = options.followUpMode ?? "one-at-a-time";
|
|
9172
|
+
const steeringQueue = yield* makeQueue("steering", resolvePolicy(options.steering, "all"));
|
|
9173
|
+
const followUpQueue = yield* makeQueue("followUp", resolvePolicy(options.followUp, "one-at-a-time"));
|
|
9147
9174
|
return Steering.of({
|
|
9148
|
-
steer: (message) =>
|
|
9149
|
-
followUp: (message) =>
|
|
9150
|
-
takeSteering: () => drain(steeringQueue,
|
|
9151
|
-
takeFollowUp: () => drain(followUpQueue,
|
|
9175
|
+
steer: (message) => offer(steeringQueue, message),
|
|
9176
|
+
followUp: (message) => offer(followUpQueue, message),
|
|
9177
|
+
takeSteering: () => drain(steeringQueue.queue, steeringQueue.policy.mode),
|
|
9178
|
+
takeFollowUp: () => drain(followUpQueue.queue, followUpQueue.policy.mode)
|
|
9152
9179
|
});
|
|
9153
9180
|
}));
|
|
9154
9181
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9155
9182
|
|
|
9156
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9183
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-context.ts
|
|
9157
9184
|
var exports_tool_context = {};
|
|
9158
9185
|
__export(exports_tool_context, {
|
|
9159
9186
|
testLayer: () => testLayer36,
|
|
@@ -9171,7 +9198,7 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9171
9198
|
}));
|
|
9172
9199
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9173
9200
|
|
|
9174
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9201
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9175
9202
|
var exports_tool_executor = {};
|
|
9176
9203
|
__export(exports_tool_executor, {
|
|
9177
9204
|
testLayer: () => testLayer37,
|
|
@@ -9186,7 +9213,7 @@ __export(exports_tool_executor, {
|
|
|
9186
9213
|
client: () => client,
|
|
9187
9214
|
ToolExecutor: () => ToolExecutor
|
|
9188
9215
|
});
|
|
9189
|
-
import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Schema as
|
|
9216
|
+
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";
|
|
9190
9217
|
class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
|
|
9191
9218
|
}
|
|
9192
9219
|
var failureMessage = (cause) => {
|
|
@@ -9209,10 +9236,10 @@ var resultMessage = (result) => {
|
|
|
9209
9236
|
var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
|
|
9210
9237
|
var decodeSuccess = (tool2, result) => {
|
|
9211
9238
|
const successSchema = tool2.successSchema;
|
|
9212
|
-
if (!
|
|
9239
|
+
if (!Schema46.isSchema(successSchema)) {
|
|
9213
9240
|
return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
|
|
9214
9241
|
}
|
|
9215
|
-
return
|
|
9242
|
+
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))}`))));
|
|
9216
9243
|
};
|
|
9217
9244
|
var placementOutcome = (placement, tool2, response) => {
|
|
9218
9245
|
switch (response._tag) {
|
|
@@ -9297,7 +9324,7 @@ function router(routes) {
|
|
|
9297
9324
|
}
|
|
9298
9325
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9299
9326
|
|
|
9300
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9327
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9301
9328
|
var exports_turn_policy = {};
|
|
9302
9329
|
__export(exports_turn_policy, {
|
|
9303
9330
|
untilToolCall: () => untilToolCall,
|
|
@@ -9336,7 +9363,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9336
9363
|
}));
|
|
9337
9364
|
var defaultPolicy = recurs(8);
|
|
9338
9365
|
|
|
9339
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9366
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
|
|
9340
9367
|
function make5(nameOrOptions, options = {}) {
|
|
9341
9368
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9342
9369
|
return {
|
|
@@ -9347,16 +9374,22 @@ function make5(nameOrOptions, options = {}) {
|
|
|
9347
9374
|
};
|
|
9348
9375
|
}
|
|
9349
9376
|
var defaultObjectPrompt = "Return the final structured output for the task above.";
|
|
9377
|
+
var steeringDrainedEvent = (turn, queue, messages) => ({
|
|
9378
|
+
_tag: "SteeringDrained",
|
|
9379
|
+
turn,
|
|
9380
|
+
queue,
|
|
9381
|
+
count: messages.length
|
|
9382
|
+
});
|
|
9350
9383
|
var skillListingBudgetTokens = 2048;
|
|
9351
9384
|
var activateSkillToolName = "activate_skill";
|
|
9352
|
-
var activateSkillParameters =
|
|
9385
|
+
var activateSkillParameters = Schema47.Struct({ name: Schema47.String });
|
|
9353
9386
|
var activateSkillTool = Tool4.make(activateSkillToolName, {
|
|
9354
9387
|
description: "Load the full body for one listed Baton skill by name before applying that skill.",
|
|
9355
9388
|
parameters: activateSkillParameters,
|
|
9356
|
-
success:
|
|
9357
|
-
name:
|
|
9358
|
-
body:
|
|
9359
|
-
allowedTools:
|
|
9389
|
+
success: Schema47.Struct({
|
|
9390
|
+
name: Schema47.String,
|
|
9391
|
+
body: Schema47.String,
|
|
9392
|
+
allowedTools: Schema47.Array(Schema47.String)
|
|
9360
9393
|
})
|
|
9361
9394
|
});
|
|
9362
9395
|
var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
@@ -9659,7 +9692,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9659
9692
|
const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
|
|
9660
9693
|
if (skillRuntime === undefined)
|
|
9661
9694
|
return { _tag: "Failure", message: "SkillSource is not available" };
|
|
9662
|
-
const params =
|
|
9695
|
+
const params = Schema47.decodeUnknownOption(activateSkillParameters)(call.params);
|
|
9663
9696
|
if (Option15.isNone(params))
|
|
9664
9697
|
return { _tag: "Failure", message: "Skill activation requires a name" };
|
|
9665
9698
|
const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
|
|
@@ -9898,7 +9931,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9898
9931
|
const followUp = yield* takeFollowUp();
|
|
9899
9932
|
if (followUp.length > 0) {
|
|
9900
9933
|
return {
|
|
9901
|
-
events: Stream7.fromIterable([completed]),
|
|
9934
|
+
events: Stream7.fromIterable([completed, steeringDrainedEvent(turn, "followUp", followUp)]),
|
|
9902
9935
|
next: { prompt: promptFromSteeringMessages(followUp) }
|
|
9903
9936
|
};
|
|
9904
9937
|
}
|
|
@@ -9934,7 +9967,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
|
|
|
9934
9967
|
const basePrompt = steering.length === 0 ? toolPrompt : Prompt4.concat(promptFromSteeringMessages(steering), toolPrompt);
|
|
9935
9968
|
const prompt = decision2.overrides?.instructions === undefined ? basePrompt : withSystem(decision2.overrides.instructions, basePrompt);
|
|
9936
9969
|
return {
|
|
9937
|
-
events: Stream7.fromIterable([completed]),
|
|
9970
|
+
events: Stream7.fromIterable(steering.length === 0 ? [completed] : [completed, steeringDrainedEvent(turn, "steering", steering)]),
|
|
9938
9971
|
next: { prompt, ...decision2.overrides === undefined ? {} : { overrides: decision2.overrides } }
|
|
9939
9972
|
};
|
|
9940
9973
|
});
|
|
@@ -10013,14 +10046,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10013
10046
|
})
|
|
10014
10047
|
})
|
|
10015
10048
|
})));
|
|
10016
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10049
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10017
10050
|
var exports_agent_tool = {};
|
|
10018
10051
|
__export(exports_agent_tool, {
|
|
10019
10052
|
asTool: () => asTool
|
|
10020
10053
|
});
|
|
10021
|
-
import { Cause as Cause4, Effect as Effect46, Schema as
|
|
10054
|
+
import { Cause as Cause4, Effect as Effect46, Schema as Schema48 } from "effect";
|
|
10022
10055
|
import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
10023
|
-
var defaultParameters =
|
|
10056
|
+
var defaultParameters = Schema48.Struct({ prompt: Schema48.String });
|
|
10024
10057
|
var errorMessage2 = (error) => {
|
|
10025
10058
|
if (error instanceof AgentSuspended) {
|
|
10026
10059
|
return `suspended on ${error.tool_name}: ${error.reason}`;
|
|
@@ -10046,14 +10079,14 @@ var lazyHandled = (toolkit, name, handler) => ({
|
|
|
10046
10079
|
var asTool = (agent, options = {}) => {
|
|
10047
10080
|
const name = options.name ?? agent.name;
|
|
10048
10081
|
const parameters = options.parameters ?? defaultParameters;
|
|
10049
|
-
const success2 = options.success ??
|
|
10082
|
+
const success2 = options.success ?? Schema48.String;
|
|
10050
10083
|
const toPrompt = options.toPrompt ?? ((params) => params.prompt);
|
|
10051
10084
|
const fromResult = options.fromResult ?? ((result) => result.text);
|
|
10052
10085
|
const tool2 = Tool5.make(name, {
|
|
10053
10086
|
...options.description === undefined ? {} : { description: options.description },
|
|
10054
10087
|
parameters,
|
|
10055
10088
|
success: success2,
|
|
10056
|
-
failure:
|
|
10089
|
+
failure: Schema48.String,
|
|
10057
10090
|
failureMode: "return"
|
|
10058
10091
|
});
|
|
10059
10092
|
const toolkit = Toolkit4.make(tool2);
|
|
@@ -10071,7 +10104,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10071
10104
|
});
|
|
10072
10105
|
return lazyHandled(toolkit, name, handler);
|
|
10073
10106
|
};
|
|
10074
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10107
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/guardrail.ts
|
|
10075
10108
|
var exports_guardrail = {};
|
|
10076
10109
|
__export(exports_guardrail, {
|
|
10077
10110
|
validateInput: () => validateInput2,
|
|
@@ -10151,16 +10184,16 @@ var redactOutput = (options) => ({
|
|
|
10151
10184
|
var filterOutput = (keep) => ({
|
|
10152
10185
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10153
10186
|
});
|
|
10154
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10187
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/handoff.ts
|
|
10155
10188
|
var exports_handoff = {};
|
|
10156
10189
|
__export(exports_handoff, {
|
|
10157
10190
|
transferTool: () => transferTool,
|
|
10158
10191
|
supervisor: () => supervisor,
|
|
10159
10192
|
fanOut: () => fanOut
|
|
10160
10193
|
});
|
|
10161
|
-
import { Effect as Effect48, Schema as
|
|
10194
|
+
import { Effect as Effect48, Schema as Schema49 } from "effect";
|
|
10162
10195
|
import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
|
|
10163
|
-
var defaultTransferParameters =
|
|
10196
|
+
var defaultTransferParameters = Schema49.Struct({ prompt: Schema49.String });
|
|
10164
10197
|
var transferName = (agentName) => `transfer_to_${agentName}`;
|
|
10165
10198
|
var positiveConcurrency = (value) => {
|
|
10166
10199
|
const concurrency = value ?? 4;
|
|
@@ -10214,7 +10247,7 @@ var supervisor = (options) => {
|
|
|
10214
10247
|
toolkit
|
|
10215
10248
|
};
|
|
10216
10249
|
};
|
|
10217
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10250
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-registry.ts
|
|
10218
10251
|
var exports_model_registry = {};
|
|
10219
10252
|
__export(exports_model_registry, {
|
|
10220
10253
|
testLayer: () => testLayer38,
|
|
@@ -10229,13 +10262,13 @@ __export(exports_model_registry, {
|
|
|
10229
10262
|
Service: () => Service29,
|
|
10230
10263
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
10231
10264
|
});
|
|
10232
|
-
import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as
|
|
10265
|
+
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";
|
|
10233
10266
|
import { Model } from "effect/unstable/ai";
|
|
10234
10267
|
|
|
10235
|
-
class LanguageModelNotRegistered extends
|
|
10236
|
-
provider:
|
|
10237
|
-
model:
|
|
10238
|
-
registration_key:
|
|
10268
|
+
class LanguageModelNotRegistered extends Schema50.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
10269
|
+
provider: Schema50.String,
|
|
10270
|
+
model: Schema50.String,
|
|
10271
|
+
registration_key: Schema50.optionalKey(Schema50.String)
|
|
10239
10272
|
}) {
|
|
10240
10273
|
}
|
|
10241
10274
|
|
|
@@ -10303,7 +10336,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10303
10336
|
return yield* service.provide(selection, effect);
|
|
10304
10337
|
});
|
|
10305
10338
|
|
|
10306
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10339
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/index.ts
|
|
10307
10340
|
import {
|
|
10308
10341
|
AiError as AiError3,
|
|
10309
10342
|
Chat as Chat2,
|
|
@@ -10321,7 +10354,7 @@ import {
|
|
|
10321
10354
|
} from "effect/unstable/ai";
|
|
10322
10355
|
|
|
10323
10356
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
10324
|
-
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
|
|
10357
|
+
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";
|
|
10325
10358
|
import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
10326
10359
|
|
|
10327
10360
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -10341,31 +10374,31 @@ __export(exports_child_run_service, {
|
|
|
10341
10374
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
10342
10375
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
10343
10376
|
});
|
|
10344
|
-
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as
|
|
10377
|
+
import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as Schema52 } from "effect";
|
|
10345
10378
|
|
|
10346
10379
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
10347
|
-
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as
|
|
10380
|
+
import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema51 } from "effect";
|
|
10348
10381
|
|
|
10349
|
-
class WorkspaceNotFound extends
|
|
10382
|
+
class WorkspaceNotFound extends Schema51.TaggedErrorClass()("WorkspaceNotFound", {
|
|
10350
10383
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
10351
10384
|
}) {
|
|
10352
10385
|
}
|
|
10353
10386
|
|
|
10354
|
-
class WorkspaceUnavailable extends
|
|
10387
|
+
class WorkspaceUnavailable extends Schema51.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
10355
10388
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
10356
|
-
message:
|
|
10389
|
+
message: Schema51.String
|
|
10357
10390
|
}) {
|
|
10358
10391
|
}
|
|
10359
10392
|
|
|
10360
|
-
class WorkspaceCapabilityUnsupported extends
|
|
10361
|
-
capability:
|
|
10393
|
+
class WorkspaceCapabilityUnsupported extends Schema51.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
10394
|
+
capability: Schema51.Literals(["suspend", "snapshot", "fork"]),
|
|
10362
10395
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
10363
10396
|
}) {
|
|
10364
10397
|
}
|
|
10365
10398
|
|
|
10366
|
-
class WorkspaceProviderError extends
|
|
10399
|
+
class WorkspaceProviderError extends Schema51.TaggedErrorClass()("WorkspaceProviderError", {
|
|
10367
10400
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
10368
|
-
message:
|
|
10401
|
+
message: Schema51.String
|
|
10369
10402
|
}) {
|
|
10370
10403
|
}
|
|
10371
10404
|
|
|
@@ -10397,28 +10430,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
10397
10430
|
});
|
|
10398
10431
|
|
|
10399
10432
|
// ../runtime/src/child/child-run-service.ts
|
|
10400
|
-
class StaticChildRunPresetNotFound extends
|
|
10433
|
+
class StaticChildRunPresetNotFound extends Schema52.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
10401
10434
|
preset_name: exports_shared_schema.NonEmptyString
|
|
10402
10435
|
}) {
|
|
10403
10436
|
}
|
|
10404
10437
|
|
|
10405
|
-
class ChildRunScopeBroadened extends
|
|
10406
|
-
field:
|
|
10438
|
+
class ChildRunScopeBroadened extends Schema52.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
10439
|
+
field: Schema52.Literals(["tool_names", "permissions"]),
|
|
10407
10440
|
value: exports_shared_schema.NonEmptyString
|
|
10408
10441
|
}) {
|
|
10409
10442
|
}
|
|
10410
10443
|
|
|
10411
|
-
class ChildRunServiceError extends
|
|
10412
|
-
message:
|
|
10444
|
+
class ChildRunServiceError extends Schema52.TaggedErrorClass()("ChildRunServiceError", {
|
|
10445
|
+
message: Schema52.String
|
|
10413
10446
|
}) {
|
|
10414
10447
|
}
|
|
10415
10448
|
|
|
10416
|
-
class ChildRunWorkspaceUnavailable extends
|
|
10417
|
-
reason:
|
|
10449
|
+
class ChildRunWorkspaceUnavailable extends Schema52.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
10450
|
+
reason: Schema52.String
|
|
10418
10451
|
}) {
|
|
10419
10452
|
}
|
|
10420
10453
|
|
|
10421
|
-
class ChildRunModelMissing extends
|
|
10454
|
+
class ChildRunModelMissing extends Schema52.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
10422
10455
|
}
|
|
10423
10456
|
|
|
10424
10457
|
class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -10646,26 +10679,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
10646
10679
|
});
|
|
10647
10680
|
|
|
10648
10681
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
10649
|
-
import { Effect as Effect52, Schema as
|
|
10682
|
+
import { Effect as Effect52, Schema as Schema53 } from "effect";
|
|
10650
10683
|
var toolName = "spawn_child_run";
|
|
10651
10684
|
var permissionName = "relay.child_run.spawn";
|
|
10652
|
-
var Input =
|
|
10653
|
-
preset_name:
|
|
10654
|
-
instructions:
|
|
10655
|
-
model:
|
|
10656
|
-
tool_names:
|
|
10657
|
-
permissions:
|
|
10658
|
-
output_schema_ref:
|
|
10659
|
-
metadata:
|
|
10660
|
-
input:
|
|
10685
|
+
var Input = Schema53.Struct({
|
|
10686
|
+
preset_name: Schema53.optionalKey(exports_shared_schema.NonEmptyString),
|
|
10687
|
+
instructions: Schema53.optionalKey(Schema53.String),
|
|
10688
|
+
model: Schema53.optionalKey(exports_agent_schema.ModelSelection),
|
|
10689
|
+
tool_names: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10690
|
+
permissions: Schema53.optionalKey(Schema53.Array(Schema53.String)),
|
|
10691
|
+
output_schema_ref: Schema53.optionalKey(Schema53.String),
|
|
10692
|
+
metadata: Schema53.optionalKey(exports_shared_schema.Metadata),
|
|
10693
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10661
10694
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
10662
|
-
var Output =
|
|
10695
|
+
var Output = Schema53.Struct({
|
|
10663
10696
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
10664
|
-
status:
|
|
10665
|
-
output:
|
|
10697
|
+
status: Schema53.Literals(["completed", "failed", "cancelled"]),
|
|
10698
|
+
output: Schema53.Array(exports_content_schema.Part)
|
|
10666
10699
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
10667
|
-
var TransferInput =
|
|
10668
|
-
input:
|
|
10700
|
+
var TransferInput = Schema53.Struct({
|
|
10701
|
+
input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
|
|
10669
10702
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
10670
10703
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
10671
10704
|
var parentContext = (agent) => ({
|
|
@@ -10852,17 +10885,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
10852
10885
|
});
|
|
10853
10886
|
|
|
10854
10887
|
// ../runtime/src/memory/memory-service.ts
|
|
10855
|
-
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as
|
|
10888
|
+
import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema55 } from "effect";
|
|
10856
10889
|
import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
|
|
10857
10890
|
|
|
10858
10891
|
// ../runtime/src/model/embedding-model-service.ts
|
|
10859
|
-
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as
|
|
10892
|
+
import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema54 } from "effect";
|
|
10860
10893
|
import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
|
|
10861
10894
|
|
|
10862
|
-
class EmbeddingModelNotRegistered extends
|
|
10863
|
-
provider:
|
|
10864
|
-
model:
|
|
10865
|
-
registration_key:
|
|
10895
|
+
class EmbeddingModelNotRegistered extends Schema54.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
10896
|
+
provider: Schema54.String,
|
|
10897
|
+
model: Schema54.String,
|
|
10898
|
+
registration_key: Schema54.optionalKey(Schema54.String)
|
|
10866
10899
|
}) {
|
|
10867
10900
|
}
|
|
10868
10901
|
|
|
@@ -10988,7 +11021,7 @@ var defaultTopK = 5;
|
|
|
10988
11021
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
10989
11022
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
10990
11023
|
});
|
|
10991
|
-
var decodeSubject = (subject) =>
|
|
11024
|
+
var decodeSubject = (subject) => Schema55.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
|
|
10992
11025
|
var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
|
|
10993
11026
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
10994
11027
|
`).trim();
|
|
@@ -11210,9 +11243,9 @@ __export(exports_schema_registry_service, {
|
|
|
11210
11243
|
Service: () => Service36,
|
|
11211
11244
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
11212
11245
|
});
|
|
11213
|
-
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as
|
|
11246
|
+
import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema56 } from "effect";
|
|
11214
11247
|
|
|
11215
|
-
class SchemaRefNotRegistered extends
|
|
11248
|
+
class SchemaRefNotRegistered extends Schema56.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
11216
11249
|
}
|
|
11217
11250
|
|
|
11218
11251
|
class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -11345,16 +11378,16 @@ __export(exports_blob_store_service, {
|
|
|
11345
11378
|
BlobStoreError: () => BlobStoreError,
|
|
11346
11379
|
BlobNotResolvable: () => BlobNotResolvable
|
|
11347
11380
|
});
|
|
11348
|
-
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as
|
|
11381
|
+
import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema57 } from "effect";
|
|
11349
11382
|
|
|
11350
|
-
class BlobNotResolvable extends
|
|
11351
|
-
uri:
|
|
11352
|
-
reason:
|
|
11383
|
+
class BlobNotResolvable extends Schema57.TaggedErrorClass()("BlobNotResolvable", {
|
|
11384
|
+
uri: Schema57.String,
|
|
11385
|
+
reason: Schema57.String
|
|
11353
11386
|
}) {
|
|
11354
11387
|
}
|
|
11355
11388
|
|
|
11356
|
-
class BlobStoreError extends
|
|
11357
|
-
message:
|
|
11389
|
+
class BlobStoreError extends Schema57.TaggedErrorClass()("BlobStoreError", {
|
|
11390
|
+
message: Schema57.String
|
|
11358
11391
|
}) {
|
|
11359
11392
|
}
|
|
11360
11393
|
|
|
@@ -11427,7 +11460,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
11427
11460
|
Service: () => Service40,
|
|
11428
11461
|
PromptAssemblerError: () => PromptAssemblerError
|
|
11429
11462
|
});
|
|
11430
|
-
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as
|
|
11463
|
+
import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema59 } from "effect";
|
|
11431
11464
|
import { Prompt as Prompt10 } from "effect/unstable/ai";
|
|
11432
11465
|
|
|
11433
11466
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -11442,11 +11475,11 @@ __export(exports_artifact_store_service, {
|
|
|
11442
11475
|
Memory: () => Memory2,
|
|
11443
11476
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
11444
11477
|
});
|
|
11445
|
-
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as
|
|
11478
|
+
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema58 } from "effect";
|
|
11446
11479
|
|
|
11447
|
-
class ArtifactNotResolvable extends
|
|
11448
|
-
artifact_id:
|
|
11449
|
-
reason:
|
|
11480
|
+
class ArtifactNotResolvable extends Schema58.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
11481
|
+
artifact_id: Schema58.String,
|
|
11482
|
+
reason: Schema58.String
|
|
11450
11483
|
}) {
|
|
11451
11484
|
}
|
|
11452
11485
|
|
|
@@ -11488,14 +11521,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
11488
11521
|
});
|
|
11489
11522
|
|
|
11490
11523
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
11491
|
-
class PromptAssemblerError extends
|
|
11492
|
-
message:
|
|
11524
|
+
class PromptAssemblerError extends Schema59.TaggedErrorClass()("PromptAssemblerError", {
|
|
11525
|
+
message: Schema59.String
|
|
11493
11526
|
}) {
|
|
11494
11527
|
}
|
|
11495
11528
|
|
|
11496
11529
|
class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
|
|
11497
11530
|
}
|
|
11498
|
-
var jsonValue2 = (value) =>
|
|
11531
|
+
var jsonValue2 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11499
11532
|
var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
|
|
11500
11533
|
var contentToPromptPart = (part) => {
|
|
11501
11534
|
const options = part.provider_options;
|
|
@@ -11639,8 +11672,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
11639
11672
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
11640
11673
|
|
|
11641
11674
|
// ../runtime/src/agent/relay-permissions.ts
|
|
11642
|
-
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as
|
|
11643
|
-
var jsonValue3 = (value) =>
|
|
11675
|
+
import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as Schema60 } from "effect";
|
|
11676
|
+
var jsonValue3 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : value);
|
|
11644
11677
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
11645
11678
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
11646
11679
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -11806,7 +11839,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
11806
11839
|
});
|
|
11807
11840
|
var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
11808
11841
|
const createdAt = yield* Clock6.currentTimeMillis;
|
|
11809
|
-
const decodedRule = yield*
|
|
11842
|
+
const decodedRule = yield* Schema60.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
|
|
11810
11843
|
yield* config.repository.remember({
|
|
11811
11844
|
agent: config.agentName,
|
|
11812
11845
|
scope: config.scope,
|
|
@@ -11822,9 +11855,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
|
|
|
11822
11855
|
})));
|
|
11823
11856
|
|
|
11824
11857
|
// ../runtime/src/agent/relay-steering.ts
|
|
11825
|
-
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as
|
|
11858
|
+
import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema61 } from "effect";
|
|
11826
11859
|
import { Prompt as Prompt11 } from "effect/unstable/ai";
|
|
11827
|
-
var jsonValue4 = (value) =>
|
|
11860
|
+
var jsonValue4 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11828
11861
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
|
|
11829
11862
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
11830
11863
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -11857,7 +11890,7 @@ var contentFromMessage = (message) => {
|
|
|
11857
11890
|
const textParts = promptTextParts(prompt);
|
|
11858
11891
|
if (textParts.length > 0)
|
|
11859
11892
|
return textParts;
|
|
11860
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
11893
|
+
return [exports_content_schema.text(stringifyJson2(Schema61.encodeSync(Prompt11.Prompt)(prompt)))];
|
|
11861
11894
|
};
|
|
11862
11895
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
11863
11896
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -11902,8 +11935,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
|
|
|
11902
11935
|
}));
|
|
11903
11936
|
|
|
11904
11937
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
11905
|
-
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as
|
|
11906
|
-
var jsonValue5 = (value) =>
|
|
11938
|
+
import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as Schema62 } from "effect";
|
|
11939
|
+
var jsonValue5 = (value) => Schema62.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
11907
11940
|
var errorDetail = (error) => {
|
|
11908
11941
|
switch (error._tag) {
|
|
11909
11942
|
case "ToolNotRegistered":
|
|
@@ -12010,29 +12043,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
|
|
|
12010
12043
|
})));
|
|
12011
12044
|
|
|
12012
12045
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
12013
|
-
class AgentLoopError extends
|
|
12014
|
-
message:
|
|
12015
|
-
next_event_sequence:
|
|
12046
|
+
class AgentLoopError extends Schema63.TaggedErrorClass()("AgentLoopError", {
|
|
12047
|
+
message: Schema63.String,
|
|
12048
|
+
next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12016
12049
|
}) {
|
|
12017
12050
|
}
|
|
12018
12051
|
|
|
12019
|
-
class AgentLoopWaitRequested extends
|
|
12052
|
+
class AgentLoopWaitRequested extends Schema63.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
12020
12053
|
wait_id: exports_ids_schema.WaitId,
|
|
12021
12054
|
tool_call: exports_tool_schema.Call,
|
|
12022
12055
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12023
12056
|
}) {
|
|
12024
12057
|
}
|
|
12025
12058
|
|
|
12026
|
-
class AgentLoopBudgetExceeded extends
|
|
12027
|
-
tokens_used:
|
|
12028
|
-
token_budget:
|
|
12059
|
+
class AgentLoopBudgetExceeded extends Schema63.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
12060
|
+
tokens_used: Schema63.Int,
|
|
12061
|
+
token_budget: Schema63.Int,
|
|
12029
12062
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
12030
12063
|
}) {
|
|
12031
12064
|
}
|
|
12032
12065
|
|
|
12033
12066
|
class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
|
|
12034
12067
|
}
|
|
12035
|
-
var jsonValue6 = (value) =>
|
|
12068
|
+
var jsonValue6 = (value) => Schema63.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
12036
12069
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
12037
12070
|
var availableRegisteredTools = (agent, registered) => {
|
|
12038
12071
|
const names = toolNames(agent);
|
|
@@ -12608,7 +12641,7 @@ __export(exports_execution_entity, {
|
|
|
12608
12641
|
});
|
|
12609
12642
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
12610
12643
|
import { Rpc } from "effect/unstable/rpc";
|
|
12611
|
-
import { Schema as
|
|
12644
|
+
import { Schema as Schema70 } from "effect";
|
|
12612
12645
|
|
|
12613
12646
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
12614
12647
|
var exports_execution_workflow = {};
|
|
@@ -12639,15 +12672,15 @@ __export(exports_execution_workflow, {
|
|
|
12639
12672
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
12640
12673
|
});
|
|
12641
12674
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
12642
|
-
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as
|
|
12675
|
+
import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema69 } from "effect";
|
|
12643
12676
|
|
|
12644
12677
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
12645
|
-
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as
|
|
12646
|
-
class ParentNotifyError extends
|
|
12647
|
-
message:
|
|
12678
|
+
import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as Schema64 } from "effect";
|
|
12679
|
+
class ParentNotifyError extends Schema64.TaggedErrorClass()("ParentNotifyError", {
|
|
12680
|
+
message: Schema64.String
|
|
12648
12681
|
}) {
|
|
12649
12682
|
}
|
|
12650
|
-
var ChildTerminalStatus =
|
|
12683
|
+
var ChildTerminalStatus = Schema64.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
12651
12684
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
12652
12685
|
});
|
|
12653
12686
|
|
|
@@ -12746,15 +12779,15 @@ __export(exports_skill_registry_service, {
|
|
|
12746
12779
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
12747
12780
|
Service: () => Service43
|
|
12748
12781
|
});
|
|
12749
|
-
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as
|
|
12782
|
+
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema65 } from "effect";
|
|
12750
12783
|
|
|
12751
|
-
class SkillDefinitionInvalid extends
|
|
12752
|
-
message:
|
|
12784
|
+
class SkillDefinitionInvalid extends Schema65.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
12785
|
+
message: Schema65.String
|
|
12753
12786
|
}) {
|
|
12754
12787
|
}
|
|
12755
12788
|
|
|
12756
|
-
class SkillRegistryError extends
|
|
12757
|
-
message:
|
|
12789
|
+
class SkillRegistryError extends Schema65.TaggedErrorClass()("SkillRegistryError", {
|
|
12790
|
+
message: Schema65.String
|
|
12758
12791
|
}) {
|
|
12759
12792
|
}
|
|
12760
12793
|
|
|
@@ -12923,11 +12956,11 @@ __export(exports_execution_service, {
|
|
|
12923
12956
|
Service: () => Service44,
|
|
12924
12957
|
ExecutionServiceError: () => ExecutionServiceError
|
|
12925
12958
|
});
|
|
12926
|
-
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as
|
|
12959
|
+
import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as Schema66, Stream as Stream9 } from "effect";
|
|
12927
12960
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
12928
|
-
class ExecutionServiceError extends
|
|
12929
|
-
message:
|
|
12930
|
-
next_event_sequence:
|
|
12961
|
+
class ExecutionServiceError extends Schema66.TaggedErrorClass()("ExecutionServiceError", {
|
|
12962
|
+
message: Schema66.String,
|
|
12963
|
+
next_event_sequence: Schema66.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
12931
12964
|
}) {
|
|
12932
12965
|
}
|
|
12933
12966
|
|
|
@@ -13243,13 +13276,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
13243
13276
|
var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
|
|
13244
13277
|
|
|
13245
13278
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13246
|
-
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as
|
|
13279
|
+
import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema68 } from "effect";
|
|
13247
13280
|
|
|
13248
13281
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
13249
|
-
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as
|
|
13282
|
+
import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema67 } from "effect";
|
|
13250
13283
|
|
|
13251
|
-
class WorkspaceRuntimeError extends
|
|
13252
|
-
message:
|
|
13284
|
+
class WorkspaceRuntimeError extends Schema67.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
13285
|
+
message: Schema67.String
|
|
13253
13286
|
}) {
|
|
13254
13287
|
}
|
|
13255
13288
|
|
|
@@ -13277,18 +13310,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
13277
13310
|
});
|
|
13278
13311
|
|
|
13279
13312
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
13280
|
-
class WorkspaceRuntimeMissing extends
|
|
13313
|
+
class WorkspaceRuntimeMissing extends Schema68.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
13281
13314
|
execution_id: exports_ids_schema.ExecutionId
|
|
13282
13315
|
}) {
|
|
13283
13316
|
}
|
|
13284
13317
|
|
|
13285
|
-
class WorkspaceLeaseMissingRef extends
|
|
13318
|
+
class WorkspaceLeaseMissingRef extends Schema68.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
13286
13319
|
execution_id: exports_ids_schema.ExecutionId
|
|
13287
13320
|
}) {
|
|
13288
13321
|
}
|
|
13289
13322
|
|
|
13290
|
-
class WorkspacePlannerError extends
|
|
13291
|
-
message:
|
|
13323
|
+
class WorkspacePlannerError extends Schema68.TaggedErrorClass()("WorkspacePlannerError", {
|
|
13324
|
+
message: Schema68.String
|
|
13292
13325
|
}) {
|
|
13293
13326
|
}
|
|
13294
13327
|
|
|
@@ -13474,67 +13507,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
13474
13507
|
});
|
|
13475
13508
|
|
|
13476
13509
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
13477
|
-
class ExecutionWorkflowFailed extends
|
|
13478
|
-
message:
|
|
13510
|
+
class ExecutionWorkflowFailed extends Schema69.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
13511
|
+
message: Schema69.String
|
|
13479
13512
|
}) {
|
|
13480
13513
|
}
|
|
13481
|
-
var StartInput =
|
|
13514
|
+
var StartInput = Schema69.Struct({
|
|
13482
13515
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13483
13516
|
root_address_id: exports_ids_schema.AddressId,
|
|
13484
|
-
session_id:
|
|
13485
|
-
input:
|
|
13517
|
+
session_id: Schema69.optionalKey(exports_ids_schema.SessionId),
|
|
13518
|
+
input: Schema69.optionalKey(Schema69.Array(exports_content_schema.Part)),
|
|
13486
13519
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
13487
13520
|
started_at: exports_shared_schema.TimestampMillis,
|
|
13488
13521
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
13489
|
-
agent_id:
|
|
13490
|
-
agent_revision:
|
|
13491
|
-
agent_snapshot:
|
|
13492
|
-
agent_tool_input_schema_digests:
|
|
13493
|
-
wait_id:
|
|
13494
|
-
resume_tool_call:
|
|
13495
|
-
workflow_generation:
|
|
13496
|
-
metadata:
|
|
13522
|
+
agent_id: Schema69.optionalKey(exports_ids_schema.AgentId),
|
|
13523
|
+
agent_revision: Schema69.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
13524
|
+
agent_snapshot: Schema69.optionalKey(exports_agent_schema.Definition),
|
|
13525
|
+
agent_tool_input_schema_digests: Schema69.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
13526
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13527
|
+
resume_tool_call: Schema69.optionalKey(exports_tool_schema.Call),
|
|
13528
|
+
workflow_generation: Schema69.optionalKey(Schema69.Int.check(Schema69.isGreaterThanOrEqualTo(0))),
|
|
13529
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13497
13530
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
13498
|
-
var WaitSignalState =
|
|
13531
|
+
var WaitSignalState = Schema69.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
13499
13532
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
13500
13533
|
});
|
|
13501
|
-
var WaitSignal =
|
|
13534
|
+
var WaitSignal = Schema69.Struct({
|
|
13502
13535
|
wait_id: exports_ids_schema.WaitId,
|
|
13503
13536
|
state: WaitSignalState,
|
|
13504
13537
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13505
13538
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
13506
|
-
var SignalWaitInput =
|
|
13507
|
-
workflow_execution_id:
|
|
13539
|
+
var SignalWaitInput = Schema69.Struct({
|
|
13540
|
+
workflow_execution_id: Schema69.String,
|
|
13508
13541
|
wait_id: exports_ids_schema.WaitId,
|
|
13509
13542
|
state: WaitSignalState,
|
|
13510
13543
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
13511
13544
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
13512
|
-
var CancelExecutionInput =
|
|
13545
|
+
var CancelExecutionInput = Schema69.Struct({
|
|
13513
13546
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13514
13547
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
13515
|
-
reason:
|
|
13548
|
+
reason: Schema69.optionalKey(Schema69.String)
|
|
13516
13549
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
13517
|
-
var CancelExecutionResult =
|
|
13550
|
+
var CancelExecutionResult = Schema69.Struct({
|
|
13518
13551
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13519
13552
|
status: exports_execution_schema.ExecutionStatus
|
|
13520
13553
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
13521
|
-
var WaitSnapshot =
|
|
13554
|
+
var WaitSnapshot = Schema69.Struct({
|
|
13522
13555
|
id: exports_ids_schema.WaitId,
|
|
13523
13556
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13524
|
-
envelope_id:
|
|
13557
|
+
envelope_id: Schema69.optionalKey(exports_ids_schema.EnvelopeId),
|
|
13525
13558
|
mode: exports_envelope_schema.WaitMode,
|
|
13526
|
-
correlation_key:
|
|
13527
|
-
state:
|
|
13559
|
+
correlation_key: Schema69.optionalKey(Schema69.String),
|
|
13560
|
+
state: Schema69.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
13528
13561
|
metadata: exports_shared_schema.Metadata,
|
|
13529
13562
|
created_at: exports_shared_schema.TimestampMillis,
|
|
13530
|
-
resolved_at:
|
|
13563
|
+
resolved_at: Schema69.optionalKey(exports_shared_schema.TimestampMillis)
|
|
13531
13564
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
13532
|
-
var StartResult =
|
|
13565
|
+
var StartResult = Schema69.Struct({
|
|
13533
13566
|
execution_id: exports_ids_schema.ExecutionId,
|
|
13534
13567
|
status: exports_execution_schema.ExecutionStatus,
|
|
13535
|
-
wait_id:
|
|
13536
|
-
wait_state:
|
|
13537
|
-
metadata:
|
|
13568
|
+
wait_id: Schema69.optionalKey(exports_ids_schema.WaitId),
|
|
13569
|
+
wait_state: Schema69.optionalKey(Schema69.Literals(["resolved", "timed_out", "cancelled"])),
|
|
13570
|
+
metadata: Schema69.optionalKey(exports_shared_schema.Metadata)
|
|
13538
13571
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
13539
13572
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
13540
13573
|
var ActivityNames = {
|
|
@@ -13744,7 +13777,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
13744
13777
|
});
|
|
13745
13778
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
13746
13779
|
name: ActivityNames.checkCancel(turn),
|
|
13747
|
-
success:
|
|
13780
|
+
success: Schema69.Boolean,
|
|
13748
13781
|
error: ExecutionWorkflowFailed,
|
|
13749
13782
|
execute: Effect73.gen(function* () {
|
|
13750
13783
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -13754,7 +13787,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
13754
13787
|
});
|
|
13755
13788
|
var loadWait = (name, waitId) => Activity.make({
|
|
13756
13789
|
name,
|
|
13757
|
-
success:
|
|
13790
|
+
success: Schema69.UndefinedOr(WaitSnapshot),
|
|
13758
13791
|
error: ExecutionWorkflowFailed,
|
|
13759
13792
|
execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
|
|
13760
13793
|
});
|
|
@@ -13845,7 +13878,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
13845
13878
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
13846
13879
|
};
|
|
13847
13880
|
});
|
|
13848
|
-
var decodeMemorySubject = (value) => typeof value === "string" ?
|
|
13881
|
+
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" }));
|
|
13849
13882
|
var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
13850
13883
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
13851
13884
|
if (executionSubject !== undefined)
|
|
@@ -13863,7 +13896,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
13863
13896
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
|
|
13864
13897
|
var ensureWorkspace = (input) => Activity.make({
|
|
13865
13898
|
name: ActivityNames.ensureWorkspace,
|
|
13866
|
-
success:
|
|
13899
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13867
13900
|
error: ExecutionWorkflowFailed,
|
|
13868
13901
|
execute: Effect73.gen(function* () {
|
|
13869
13902
|
if (input.agent_snapshot === undefined)
|
|
@@ -13880,19 +13913,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
13880
13913
|
});
|
|
13881
13914
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
13882
13915
|
name: ActivityNames.suspendWorkspace(key2),
|
|
13883
|
-
success:
|
|
13916
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13884
13917
|
error: ExecutionWorkflowFailed,
|
|
13885
13918
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13886
13919
|
});
|
|
13887
13920
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
13888
13921
|
name: ActivityNames.resumeWorkspace(key2),
|
|
13889
|
-
success:
|
|
13922
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13890
13923
|
error: ExecutionWorkflowFailed,
|
|
13891
13924
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
|
|
13892
13925
|
});
|
|
13893
13926
|
var releaseWorkspace = (input) => Activity.make({
|
|
13894
13927
|
name: ActivityNames.releaseWorkspace,
|
|
13895
|
-
success:
|
|
13928
|
+
success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13896
13929
|
error: ExecutionWorkflowFailed,
|
|
13897
13930
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
|
|
13898
13931
|
});
|
|
@@ -13993,7 +14026,7 @@ var childDispatchContext = (input) => {
|
|
|
13993
14026
|
};
|
|
13994
14027
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
13995
14028
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
13996
|
-
success:
|
|
14029
|
+
success: Schema69.Boolean,
|
|
13997
14030
|
error: ExecutionWorkflowFailed,
|
|
13998
14031
|
execute: Effect73.gen(function* () {
|
|
13999
14032
|
const context = childDispatchContext(input);
|
|
@@ -14005,7 +14038,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
14005
14038
|
});
|
|
14006
14039
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
14007
14040
|
name: ActivityNames.notifyParent(status),
|
|
14008
|
-
success:
|
|
14041
|
+
success: Schema69.Void,
|
|
14009
14042
|
error: ExecutionWorkflowFailed,
|
|
14010
14043
|
execute: Effect73.gen(function* () {
|
|
14011
14044
|
const notifier = yield* Effect73.serviceOption(Service42);
|
|
@@ -14058,7 +14091,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
14058
14091
|
};
|
|
14059
14092
|
var pendingToolCallFromExecution = (execution) => {
|
|
14060
14093
|
const pending = execution.metadata?.pending_tool_call;
|
|
14061
|
-
return
|
|
14094
|
+
return Schema69.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
14062
14095
|
};
|
|
14063
14096
|
var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
14064
14097
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -14272,7 +14305,7 @@ var Start = Rpc.make("start", {
|
|
|
14272
14305
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14273
14306
|
var SignalWait = Rpc.make("signalWait", {
|
|
14274
14307
|
payload: SignalWaitInput,
|
|
14275
|
-
success:
|
|
14308
|
+
success: Schema70.Void,
|
|
14276
14309
|
error: ExecutionWorkflowFailed
|
|
14277
14310
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
14278
14311
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -14300,26 +14333,26 @@ __export(exports_envelope_service, {
|
|
|
14300
14333
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
14301
14334
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
14302
14335
|
});
|
|
14303
|
-
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as
|
|
14304
|
-
class EnvelopeAddressNotFound extends
|
|
14336
|
+
import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema71 } from "effect";
|
|
14337
|
+
class EnvelopeAddressNotFound extends Schema71.TaggedErrorClass()("EnvelopeAddressNotFound", {
|
|
14305
14338
|
address_id: exports_ids_schema.AddressId
|
|
14306
14339
|
}) {
|
|
14307
14340
|
}
|
|
14308
14341
|
|
|
14309
|
-
class EnvelopeRouteUnavailable extends
|
|
14342
|
+
class EnvelopeRouteUnavailable extends Schema71.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
14310
14343
|
address_id: exports_ids_schema.AddressId,
|
|
14311
|
-
route_key:
|
|
14344
|
+
route_key: Schema71.String
|
|
14312
14345
|
}) {
|
|
14313
14346
|
}
|
|
14314
14347
|
|
|
14315
|
-
class EnvelopeRouteDeferred extends
|
|
14348
|
+
class EnvelopeRouteDeferred extends Schema71.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
14316
14349
|
address_id: exports_ids_schema.AddressId,
|
|
14317
|
-
route_key:
|
|
14350
|
+
route_key: Schema71.String
|
|
14318
14351
|
}) {
|
|
14319
14352
|
}
|
|
14320
14353
|
|
|
14321
|
-
class EnvelopeServiceError extends
|
|
14322
|
-
message:
|
|
14354
|
+
class EnvelopeServiceError extends Schema71.TaggedErrorClass()("EnvelopeServiceError", {
|
|
14355
|
+
message: Schema71.String
|
|
14323
14356
|
}) {
|
|
14324
14357
|
}
|
|
14325
14358
|
|
|
@@ -14477,7 +14510,7 @@ __export(exports_runner_runtime_service, {
|
|
|
14477
14510
|
DatabaseMode: () => DatabaseMode,
|
|
14478
14511
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
14479
14512
|
});
|
|
14480
|
-
import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as
|
|
14513
|
+
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";
|
|
14481
14514
|
import {
|
|
14482
14515
|
ClusterWorkflowEngine,
|
|
14483
14516
|
HttpRunner,
|
|
@@ -14515,7 +14548,7 @@ __export(exports_scheduler_service, {
|
|
|
14515
14548
|
SchedulerError: () => SchedulerError,
|
|
14516
14549
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
14517
14550
|
});
|
|
14518
|
-
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
|
|
14551
|
+
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";
|
|
14519
14552
|
|
|
14520
14553
|
// ../runtime/src/wait/wait-signal.ts
|
|
14521
14554
|
var exports_wait_signal = {};
|
|
@@ -14535,14 +14568,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
14535
14568
|
});
|
|
14536
14569
|
|
|
14537
14570
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
14538
|
-
class SchedulerError extends
|
|
14539
|
-
message:
|
|
14571
|
+
class SchedulerError extends Schema72.TaggedErrorClass()("SchedulerError", {
|
|
14572
|
+
message: Schema72.String
|
|
14540
14573
|
}) {
|
|
14541
14574
|
}
|
|
14542
14575
|
|
|
14543
|
-
class ScheduleCronInvalid extends
|
|
14544
|
-
cron_expr:
|
|
14545
|
-
message:
|
|
14576
|
+
class ScheduleCronInvalid extends Schema72.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
14577
|
+
cron_expr: Schema72.String,
|
|
14578
|
+
message: Schema72.String
|
|
14546
14579
|
}) {
|
|
14547
14580
|
}
|
|
14548
14581
|
|
|
@@ -14693,25 +14726,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
14693
14726
|
});
|
|
14694
14727
|
|
|
14695
14728
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
14696
|
-
var DatabaseMode =
|
|
14729
|
+
var DatabaseMode = Schema73.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
|
|
14697
14730
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
14698
14731
|
});
|
|
14699
|
-
var ReadinessStatus =
|
|
14732
|
+
var ReadinessStatus = Schema73.Struct({
|
|
14700
14733
|
database: DatabaseMode,
|
|
14701
|
-
cluster:
|
|
14702
|
-
workflow:
|
|
14703
|
-
executionEntity:
|
|
14734
|
+
cluster: Schema73.Literal("ready"),
|
|
14735
|
+
workflow: Schema73.Literals(["ready", "client"]),
|
|
14736
|
+
executionEntity: Schema73.Literals(["registered", "client"])
|
|
14704
14737
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
14705
14738
|
|
|
14706
|
-
class RunnerRuntimeError extends
|
|
14707
|
-
message:
|
|
14739
|
+
class RunnerRuntimeError extends Schema73.TaggedErrorClass()("RunnerRuntimeError", {
|
|
14740
|
+
message: Schema73.String
|
|
14708
14741
|
}) {
|
|
14709
14742
|
}
|
|
14710
14743
|
|
|
14711
|
-
class ClusterConfigMismatch extends
|
|
14712
|
-
field:
|
|
14713
|
-
expected:
|
|
14714
|
-
actual:
|
|
14744
|
+
class ClusterConfigMismatch extends Schema73.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
14745
|
+
field: Schema73.String,
|
|
14746
|
+
expected: Schema73.String,
|
|
14747
|
+
actual: Schema73.String
|
|
14715
14748
|
}) {
|
|
14716
14749
|
}
|
|
14717
14750
|
|
|
@@ -14725,7 +14758,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
|
|
|
14725
14758
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
14726
14759
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
14727
14760
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
14728
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
14761
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema73.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
14729
14762
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
14730
14763
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
14731
14764
|
var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
|
|
@@ -15055,51 +15088,51 @@ __export(exports_activity_version_registry, {
|
|
|
15055
15088
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
15056
15089
|
ActivityManifest: () => ActivityManifest
|
|
15057
15090
|
});
|
|
15058
|
-
import { Crypto as Crypto5, Effect as Effect78, Schema as
|
|
15091
|
+
import { Crypto as Crypto5, Effect as Effect78, Schema as Schema74 } from "effect";
|
|
15059
15092
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
15060
|
-
var ActivityManifestEntry =
|
|
15061
|
-
name:
|
|
15062
|
-
signature_hash:
|
|
15093
|
+
var ActivityManifestEntry = Schema74.Struct({
|
|
15094
|
+
name: Schema74.String,
|
|
15095
|
+
signature_hash: Schema74.String
|
|
15063
15096
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
15064
|
-
var ActivityManifest =
|
|
15065
|
-
version:
|
|
15066
|
-
generated_from:
|
|
15067
|
-
hash_algorithm:
|
|
15068
|
-
activities:
|
|
15097
|
+
var ActivityManifest = Schema74.Struct({
|
|
15098
|
+
version: Schema74.Literal(1),
|
|
15099
|
+
generated_from: Schema74.String,
|
|
15100
|
+
hash_algorithm: Schema74.Literal("sha256-json-schema-v1"),
|
|
15101
|
+
activities: Schema74.Array(ActivityManifestEntry)
|
|
15069
15102
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
15070
|
-
var ActivityManifestChange =
|
|
15071
|
-
type:
|
|
15072
|
-
name:
|
|
15073
|
-
baseline_hash:
|
|
15074
|
-
current_hash:
|
|
15103
|
+
var ActivityManifestChange = Schema74.Struct({
|
|
15104
|
+
type: Schema74.Literals(["removed", "changed", "added"]),
|
|
15105
|
+
name: Schema74.String,
|
|
15106
|
+
baseline_hash: Schema74.optionalKey(Schema74.String),
|
|
15107
|
+
current_hash: Schema74.optionalKey(Schema74.String)
|
|
15075
15108
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
15076
|
-
var ActivityManifestGuardResult =
|
|
15077
|
-
status:
|
|
15078
|
-
waiting_executions:
|
|
15079
|
-
breaking_changes:
|
|
15080
|
-
additive_changes:
|
|
15109
|
+
var ActivityManifestGuardResult = Schema74.Struct({
|
|
15110
|
+
status: Schema74.Literals(["pass", "fail"]),
|
|
15111
|
+
waiting_executions: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15112
|
+
breaking_changes: Schema74.Array(ActivityManifestChange),
|
|
15113
|
+
additive_changes: Schema74.Array(ActivityManifestChange)
|
|
15081
15114
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
15082
15115
|
|
|
15083
|
-
class ActivityManifestGuardFailed extends
|
|
15084
|
-
message:
|
|
15116
|
+
class ActivityManifestGuardFailed extends Schema74.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
15117
|
+
message: Schema74.String,
|
|
15085
15118
|
result: ActivityManifestGuardResult
|
|
15086
15119
|
}) {
|
|
15087
15120
|
}
|
|
15088
|
-
var TurnInput =
|
|
15121
|
+
var TurnInput = Schema74.Struct({
|
|
15089
15122
|
start: StartInput,
|
|
15090
|
-
turn:
|
|
15123
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0))
|
|
15091
15124
|
});
|
|
15092
|
-
var WaitIdInput =
|
|
15125
|
+
var WaitIdInput = Schema74.Struct({
|
|
15093
15126
|
wait_id: exports_ids_schema.WaitId
|
|
15094
15127
|
});
|
|
15095
|
-
var WorkspaceKeyInput =
|
|
15128
|
+
var WorkspaceKeyInput = Schema74.Struct({
|
|
15096
15129
|
start: StartInput,
|
|
15097
|
-
key:
|
|
15130
|
+
key: Schema74.String
|
|
15098
15131
|
});
|
|
15099
15132
|
var contracts = [
|
|
15100
15133
|
{
|
|
15101
15134
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
15102
|
-
input:
|
|
15135
|
+
input: Schema74.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
15103
15136
|
success: LocalAgentTarget,
|
|
15104
15137
|
error: ExecutionWorkflowFailed
|
|
15105
15138
|
},
|
|
@@ -15111,66 +15144,66 @@ var contracts = [
|
|
|
15111
15144
|
},
|
|
15112
15145
|
{
|
|
15113
15146
|
name: ActivityNameTemplates.cancel,
|
|
15114
|
-
input:
|
|
15147
|
+
input: Schema74.Struct({ start: StartInput, turn: Schema74.Int, reason: Schema74.String }),
|
|
15115
15148
|
success: exports_execution_schema.Execution,
|
|
15116
15149
|
error: ExecutionWorkflowFailed
|
|
15117
15150
|
},
|
|
15118
15151
|
{
|
|
15119
15152
|
name: ActivityNameTemplates.checkCancel,
|
|
15120
15153
|
input: TurnInput,
|
|
15121
|
-
success:
|
|
15154
|
+
success: Schema74.Boolean,
|
|
15122
15155
|
error: ExecutionWorkflowFailed
|
|
15123
15156
|
},
|
|
15124
15157
|
{
|
|
15125
15158
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
15126
15159
|
input: WaitIdInput,
|
|
15127
|
-
success:
|
|
15160
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15128
15161
|
error: ExecutionWorkflowFailed
|
|
15129
15162
|
},
|
|
15130
15163
|
{
|
|
15131
15164
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
15132
15165
|
input: WaitIdInput,
|
|
15133
|
-
success:
|
|
15166
|
+
success: Schema74.UndefinedOr(WaitSnapshot),
|
|
15134
15167
|
error: ExecutionWorkflowFailed
|
|
15135
15168
|
},
|
|
15136
15169
|
{
|
|
15137
15170
|
name: ActivityNameTemplates.markWaiting,
|
|
15138
|
-
input:
|
|
15171
|
+
input: Schema74.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
15139
15172
|
success: exports_execution_schema.Execution,
|
|
15140
15173
|
error: ExecutionWorkflowFailed
|
|
15141
15174
|
},
|
|
15142
15175
|
{
|
|
15143
15176
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
15144
15177
|
input: StartInput,
|
|
15145
|
-
success:
|
|
15178
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15146
15179
|
error: ExecutionWorkflowFailed
|
|
15147
15180
|
},
|
|
15148
15181
|
{
|
|
15149
15182
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
15150
15183
|
input: WorkspaceKeyInput,
|
|
15151
|
-
success:
|
|
15184
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15152
15185
|
error: ExecutionWorkflowFailed
|
|
15153
15186
|
},
|
|
15154
15187
|
{
|
|
15155
15188
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
15156
15189
|
input: WorkspaceKeyInput,
|
|
15157
|
-
success:
|
|
15190
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15158
15191
|
error: ExecutionWorkflowFailed
|
|
15159
15192
|
},
|
|
15160
15193
|
{
|
|
15161
15194
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
15162
15195
|
input: StartInput,
|
|
15163
|
-
success:
|
|
15196
|
+
success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
15164
15197
|
error: ExecutionWorkflowFailed
|
|
15165
15198
|
},
|
|
15166
15199
|
{
|
|
15167
15200
|
name: ActivityNameTemplates.complete,
|
|
15168
|
-
input:
|
|
15201
|
+
input: Schema74.Struct({
|
|
15169
15202
|
start: StartInput,
|
|
15170
|
-
turn:
|
|
15171
|
-
wait_id:
|
|
15172
|
-
wait_state:
|
|
15173
|
-
pending_tool_call:
|
|
15203
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15204
|
+
wait_id: Schema74.optionalKey(exports_ids_schema.WaitId),
|
|
15205
|
+
wait_state: Schema74.optionalKey(WaitSignalState),
|
|
15206
|
+
pending_tool_call: Schema74.optionalKey(exports_tool_schema.Call)
|
|
15174
15207
|
}),
|
|
15175
15208
|
success: exports_execution_schema.Execution,
|
|
15176
15209
|
error: ExecutionWorkflowFailed
|
|
@@ -15178,24 +15211,24 @@ var contracts = [
|
|
|
15178
15211
|
{
|
|
15179
15212
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
15180
15213
|
input: StartInput,
|
|
15181
|
-
success:
|
|
15214
|
+
success: Schema74.Boolean,
|
|
15182
15215
|
error: ExecutionWorkflowFailed
|
|
15183
15216
|
},
|
|
15184
15217
|
{
|
|
15185
15218
|
name: ActivityNameTemplates.notifyParent,
|
|
15186
|
-
input:
|
|
15219
|
+
input: Schema74.Struct({
|
|
15187
15220
|
start: StartInput,
|
|
15188
15221
|
status: ChildTerminalStatus,
|
|
15189
|
-
output:
|
|
15222
|
+
output: Schema74.Array(exports_content_schema.Part)
|
|
15190
15223
|
}),
|
|
15191
|
-
success:
|
|
15224
|
+
success: Schema74.Void,
|
|
15192
15225
|
error: ExecutionWorkflowFailed
|
|
15193
15226
|
},
|
|
15194
15227
|
{
|
|
15195
15228
|
name: ActivityNameTemplates.continueAsNew,
|
|
15196
|
-
input:
|
|
15229
|
+
input: Schema74.Struct({
|
|
15197
15230
|
start: StartInput,
|
|
15198
|
-
turn:
|
|
15231
|
+
turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
|
|
15199
15232
|
wait_id: exports_ids_schema.WaitId,
|
|
15200
15233
|
pending_tool_call: exports_tool_schema.Call
|
|
15201
15234
|
}),
|
|
@@ -15203,7 +15236,7 @@ var contracts = [
|
|
|
15203
15236
|
error: ExecutionWorkflowFailed
|
|
15204
15237
|
}
|
|
15205
15238
|
];
|
|
15206
|
-
var schemaJson = (schema) =>
|
|
15239
|
+
var schemaJson = (schema) => Schema74.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema74.toJsonSchemaDocument(schema));
|
|
15207
15240
|
var canonical = (value) => {
|
|
15208
15241
|
if (value === null || typeof value !== "object")
|
|
15209
15242
|
return value;
|
|
@@ -15318,7 +15351,7 @@ __export(exports_language_model_registration, {
|
|
|
15318
15351
|
anthropic: () => anthropic
|
|
15319
15352
|
});
|
|
15320
15353
|
|
|
15321
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15354
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/anthropic.ts
|
|
15322
15355
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
15323
15356
|
import { Layer as Layer70 } from "effect";
|
|
15324
15357
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -15334,13 +15367,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15334
15367
|
});
|
|
15335
15368
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
15336
15369
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer70.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer70.provide(FetchHttpClient2.layer));
|
|
15337
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15370
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15338
15371
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
15339
15372
|
import { Effect as Effect79, Layer as Layer72, Option as Option28, Stream as Stream11 } from "effect";
|
|
15340
15373
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
15341
15374
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
15342
15375
|
|
|
15343
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15376
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai.ts
|
|
15344
15377
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
15345
15378
|
import { Layer as Layer71 } from "effect";
|
|
15346
15379
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -15357,7 +15390,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15357
15390
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
15358
15391
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer71.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer71.provide(FetchHttpClient3.layer));
|
|
15359
15392
|
|
|
15360
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15393
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15361
15394
|
var deterministicModelLayer = Layer72.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
15362
15395
|
generateText: () => Effect79.succeed([{ type: "text", text: "deterministic response" }]),
|
|
15363
15396
|
streamText: () => Stream11.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -15381,7 +15414,7 @@ var withOpenAiOrDeterministic = (options) => Layer72.unwrap(Effect79.gen(functio
|
|
|
15381
15414
|
...Option28.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
15382
15415
|
]);
|
|
15383
15416
|
}));
|
|
15384
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15417
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
15385
15418
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
15386
15419
|
import { Config as Config8, Layer as Layer73 } from "effect";
|
|
15387
15420
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -15402,7 +15435,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
15402
15435
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
15403
15436
|
});
|
|
15404
15437
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer73.provide(clientLayerConfig(options)), Layer73.provide(FetchHttpClient5.layer));
|
|
15405
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15438
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openrouter.ts
|
|
15406
15439
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
15407
15440
|
import { Layer as Layer74 } from "effect";
|
|
15408
15441
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|