@relayfx/sdk 0.0.41 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/ai.js +361 -286
  2. package/dist/index.js +505 -430
  3. 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.0/node_modules/@batonfx/core/src/agent.ts
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 Schema45, Stream as Stream7 } from "effect";
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.0/node_modules/@batonfx/core/src/agent-event.ts
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.0/node_modules/@batonfx/core/src/approvals.ts
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.0/node_modules/@batonfx/core/src/compaction.ts
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.0/node_modules/@batonfx/core/src/session.ts
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.0/node_modules/@batonfx/core/src/tool-output.ts
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.0/node_modules/@batonfx/core/src/compaction.ts
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.0/node_modules/@batonfx/core/src/instructions.ts
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.0/node_modules/@batonfx/core/src/memory.ts
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.0/node_modules/@batonfx/core/src/model-middleware.ts
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.0/node_modules/@batonfx/core/src/model-resilience.ts
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.0/node_modules/@batonfx/core/src/permissions.ts
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.0/node_modules/@batonfx/core/src/skill-source.ts
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.0/node_modules/@batonfx/core/src/steering.ts
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* Queue.unbounded();
9144
- const followUpQueue = yield* Queue.unbounded();
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) => Queue.offer(steeringQueue, message).pipe(Effect41.asVoid),
9149
- followUp: (message) => Queue.offer(followUpQueue, message).pipe(Effect41.asVoid),
9150
- takeSteering: () => drain(steeringQueue, steeringMode),
9151
- takeFollowUp: () => drain(followUpQueue, followUpMode)
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.0/node_modules/@batonfx/core/src/tool-context.ts
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,18 +9198,22 @@ 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.0/node_modules/@batonfx/core/src/tool-executor.ts
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,
9205
+ sandbox: () => sandbox,
9178
9206
  router: () => router,
9179
9207
  routeToolkit: () => routeToolkit,
9180
9208
  route: () => route,
9209
+ remote: () => remote,
9210
+ mcp: () => mcp,
9181
9211
  fromToolkit: () => fromToolkit,
9182
9212
  executeToolkit: () => executeToolkit,
9213
+ client: () => client,
9183
9214
  ToolExecutor: () => ToolExecutor
9184
9215
  });
9185
- import { Cause as Cause2, Context as Context41, Effect as Effect43, Layer as Layer41, Option as Option14, Sink as Sink2, Stream as Stream6 } from "effect";
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";
9186
9217
  class ToolExecutor extends Context41.Service()("@batonfx/core/ToolExecutor") {
9187
9218
  }
9188
9219
  var failureMessage = (cause) => {
@@ -9202,6 +9233,24 @@ var resultMessage = (result) => {
9202
9233
  return String(result);
9203
9234
  }
9204
9235
  };
9236
+ var schemaMessage = (error) => error instanceof Error ? error.message : typeof error === "string" ? error : resultMessage(error);
9237
+ var decodeSuccess = (tool2, result) => {
9238
+ const successSchema = tool2.successSchema;
9239
+ if (!Schema46.isSchema(successSchema)) {
9240
+ return Effect43.succeed({ _tag: "Success", result, encodedResult: result });
9241
+ }
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))}`))));
9243
+ };
9244
+ var placementOutcome = (placement, tool2, response) => {
9245
+ switch (response._tag) {
9246
+ case "Failure":
9247
+ return Effect43.succeed(failureOutcome(response.message));
9248
+ case "Suspend":
9249
+ return Effect43.succeed({ _tag: "Suspend", token: response.token });
9250
+ case "Success":
9251
+ return decodeSuccess(tool2, response.result).pipe(Effect43.map((outcome) => outcome._tag === "Failure" ? failureOutcome(outcome.message.replace("invalid client result", `invalid ${placement} result`)) : outcome));
9252
+ }
9253
+ };
9205
9254
  var executeWithToolkit = (toolkit, request) => {
9206
9255
  if (toolkit.tools[request.call.name] === undefined) {
9207
9256
  return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
@@ -9239,6 +9288,24 @@ var route = (options) => {
9239
9288
  execute: options.execute
9240
9289
  };
9241
9290
  };
9291
+ var placementRoute = (placement, options) => {
9292
+ const routedTools = options.tools ?? Object.keys(options.toolkit.tools);
9293
+ return route({
9294
+ tools: routedTools,
9295
+ execute: (request) => {
9296
+ const tool2 = options.toolkit.tools[request.call.name];
9297
+ if (tool2 === undefined)
9298
+ return Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`));
9299
+ const effect = options.execute({ ...request, placement, tool: tool2 });
9300
+ const scheduled = "schedule" in options && options.schedule !== undefined ? Effect43.retry(effect, options.schedule) : effect;
9301
+ return scheduled.pipe(Effect43.flatMap((response) => placementOutcome(placement, tool2, response)), Effect43.catchCause((cause) => Cause2.hasInterrupts(cause) ? Effect43.interrupt : Effect43.succeed(failureOutcome(`${placement} tool infrastructure failed: ${failureMessage(cause)}`))));
9302
+ }
9303
+ });
9304
+ };
9305
+ var client = (options) => placementRoute("client", options);
9306
+ var remote = (options) => placementRoute("remote", options);
9307
+ var mcp = (options) => placementRoute("mcp", options);
9308
+ var sandbox = (options) => placementRoute("sandbox", options);
9242
9309
  function routeToolkit(toolkit) {
9243
9310
  const makeRoute = (handled) => route({
9244
9311
  tools: Object.keys(handled.tools),
@@ -9247,15 +9314,17 @@ function routeToolkit(toolkit) {
9247
9314
  return "handle" in toolkit ? makeRoute(toolkit) : toolkit.pipe(Effect43.map(makeRoute));
9248
9315
  }
9249
9316
  var routeInputEffect = (input) => Effect43.isEffect(input) ? input : Effect43.succeed(input);
9250
- var router = (routes) => Layer41.effect(ToolExecutor, Effect43.all(Array.from(routes, routeInputEffect)).pipe(Effect43.map((resolved) => ToolExecutor.of({
9251
- execute: (request) => {
9252
- const matched = resolved.find((candidate) => candidate.matches(request));
9253
- return matched === undefined ? Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`)) : matched.execute(request);
9254
- }
9255
- }))));
9317
+ function router(routes) {
9318
+ return Layer41.effect(ToolExecutor, Effect43.all(Array.from(routes, routeInputEffect)).pipe(Effect43.map((resolved) => ToolExecutor.of({
9319
+ execute: (request) => {
9320
+ const matched = resolved.find((candidate) => candidate.matches(request));
9321
+ return matched === undefined ? Effect43.succeed(failureOutcome(`Tool ${request.call.name} is not registered`)) : matched.execute(request);
9322
+ }
9323
+ }))));
9324
+ }
9256
9325
  var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
9257
9326
 
9258
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/turn-policy.ts
9327
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/turn-policy.ts
9259
9328
  var exports_turn_policy = {};
9260
9329
  __export(exports_turn_policy, {
9261
9330
  untilToolCall: () => untilToolCall,
@@ -9294,7 +9363,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
9294
9363
  }));
9295
9364
  var defaultPolicy = recurs(8);
9296
9365
 
9297
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/agent.ts
9366
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent.ts
9298
9367
  function make5(nameOrOptions, options = {}) {
9299
9368
  const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
9300
9369
  return {
@@ -9305,16 +9374,22 @@ function make5(nameOrOptions, options = {}) {
9305
9374
  };
9306
9375
  }
9307
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
+ });
9308
9383
  var skillListingBudgetTokens = 2048;
9309
9384
  var activateSkillToolName = "activate_skill";
9310
- var activateSkillParameters = Schema45.Struct({ name: Schema45.String });
9385
+ var activateSkillParameters = Schema47.Struct({ name: Schema47.String });
9311
9386
  var activateSkillTool = Tool4.make(activateSkillToolName, {
9312
9387
  description: "Load the full body for one listed Baton skill by name before applying that skill.",
9313
9388
  parameters: activateSkillParameters,
9314
- success: Schema45.Struct({
9315
- name: Schema45.String,
9316
- body: Schema45.String,
9317
- allowedTools: Schema45.Array(Schema45.String)
9389
+ success: Schema47.Struct({
9390
+ name: Schema47.String,
9391
+ body: Schema47.String,
9392
+ allowedTools: Schema47.Array(Schema47.String)
9318
9393
  })
9319
9394
  });
9320
9395
  var errorMessage = (error) => error instanceof Error ? `${error.name}: ${error.message}` : String(error);
@@ -9617,7 +9692,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
9617
9692
  const activateSkillOutcome = (turn, call) => Effect45.gen(function* () {
9618
9693
  if (skillRuntime === undefined)
9619
9694
  return { _tag: "Failure", message: "SkillSource is not available" };
9620
- const params = Schema45.decodeUnknownOption(activateSkillParameters)(call.params);
9695
+ const params = Schema47.decodeUnknownOption(activateSkillParameters)(call.params);
9621
9696
  if (Option15.isNone(params))
9622
9697
  return { _tag: "Failure", message: "Skill activation requires a name" };
9623
9698
  const skill = yield* skillRuntime.source.get(params.value.name).pipe(Effect45.mapError((error) => skillError(turn, error)));
@@ -9856,7 +9931,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
9856
9931
  const followUp = yield* takeFollowUp();
9857
9932
  if (followUp.length > 0) {
9858
9933
  return {
9859
- events: Stream7.fromIterable([completed]),
9934
+ events: Stream7.fromIterable([completed, steeringDrainedEvent(turn, "followUp", followUp)]),
9860
9935
  next: { prompt: promptFromSteeringMessages(followUp) }
9861
9936
  };
9862
9937
  }
@@ -9892,7 +9967,7 @@ var streamInternal = (agent, options, structured) => Stream7.unwrap(Effect45.gen
9892
9967
  const basePrompt = steering.length === 0 ? toolPrompt : Prompt4.concat(promptFromSteeringMessages(steering), toolPrompt);
9893
9968
  const prompt = decision2.overrides?.instructions === undefined ? basePrompt : withSystem(decision2.overrides.instructions, basePrompt);
9894
9969
  return {
9895
- events: Stream7.fromIterable([completed]),
9970
+ events: Stream7.fromIterable(steering.length === 0 ? [completed] : [completed, steeringDrainedEvent(turn, "steering", steering)]),
9896
9971
  next: { prompt, ...decision2.overrides === undefined ? {} : { overrides: decision2.overrides } }
9897
9972
  };
9898
9973
  });
@@ -9971,14 +10046,14 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
9971
10046
  })
9972
10047
  })
9973
10048
  })));
9974
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/agent-tool.ts
10049
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/agent-tool.ts
9975
10050
  var exports_agent_tool = {};
9976
10051
  __export(exports_agent_tool, {
9977
10052
  asTool: () => asTool
9978
10053
  });
9979
- import { Cause as Cause4, Effect as Effect46, Schema as Schema46 } from "effect";
10054
+ import { Cause as Cause4, Effect as Effect46, Schema as Schema48 } from "effect";
9980
10055
  import { Tool as Tool5, Toolkit as Toolkit4 } from "effect/unstable/ai";
9981
- var defaultParameters = Schema46.Struct({ prompt: Schema46.String });
10056
+ var defaultParameters = Schema48.Struct({ prompt: Schema48.String });
9982
10057
  var errorMessage2 = (error) => {
9983
10058
  if (error instanceof AgentSuspended) {
9984
10059
  return `suspended on ${error.tool_name}: ${error.reason}`;
@@ -10004,14 +10079,14 @@ var lazyHandled = (toolkit, name, handler) => ({
10004
10079
  var asTool = (agent, options = {}) => {
10005
10080
  const name = options.name ?? agent.name;
10006
10081
  const parameters = options.parameters ?? defaultParameters;
10007
- const success2 = options.success ?? Schema46.String;
10082
+ const success2 = options.success ?? Schema48.String;
10008
10083
  const toPrompt = options.toPrompt ?? ((params) => params.prompt);
10009
10084
  const fromResult = options.fromResult ?? ((result) => result.text);
10010
10085
  const tool2 = Tool5.make(name, {
10011
10086
  ...options.description === undefined ? {} : { description: options.description },
10012
10087
  parameters,
10013
10088
  success: success2,
10014
- failure: Schema46.String,
10089
+ failure: Schema48.String,
10015
10090
  failureMode: "return"
10016
10091
  });
10017
10092
  const toolkit = Toolkit4.make(tool2);
@@ -10029,7 +10104,7 @@ var asTool = (agent, options = {}) => {
10029
10104
  });
10030
10105
  return lazyHandled(toolkit, name, handler);
10031
10106
  };
10032
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/guardrail.ts
10107
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/guardrail.ts
10033
10108
  var exports_guardrail = {};
10034
10109
  __export(exports_guardrail, {
10035
10110
  validateInput: () => validateInput2,
@@ -10109,16 +10184,16 @@ var redactOutput = (options) => ({
10109
10184
  var filterOutput = (keep) => ({
10110
10185
  transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
10111
10186
  });
10112
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/handoff.ts
10187
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/handoff.ts
10113
10188
  var exports_handoff = {};
10114
10189
  __export(exports_handoff, {
10115
10190
  transferTool: () => transferTool,
10116
10191
  supervisor: () => supervisor,
10117
10192
  fanOut: () => fanOut
10118
10193
  });
10119
- import { Effect as Effect48, Schema as Schema47 } from "effect";
10194
+ import { Effect as Effect48, Schema as Schema49 } from "effect";
10120
10195
  import { AiError as AiError2, Toolkit as Toolkit5 } from "effect/unstable/ai";
10121
- var defaultTransferParameters = Schema47.Struct({ prompt: Schema47.String });
10196
+ var defaultTransferParameters = Schema49.Struct({ prompt: Schema49.String });
10122
10197
  var transferName = (agentName) => `transfer_to_${agentName}`;
10123
10198
  var positiveConcurrency = (value) => {
10124
10199
  const concurrency = value ?? 4;
@@ -10172,7 +10247,7 @@ var supervisor = (options) => {
10172
10247
  toolkit
10173
10248
  };
10174
10249
  };
10175
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/model-registry.ts
10250
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/model-registry.ts
10176
10251
  var exports_model_registry = {};
10177
10252
  __export(exports_model_registry, {
10178
10253
  testLayer: () => testLayer38,
@@ -10187,13 +10262,13 @@ __export(exports_model_registry, {
10187
10262
  Service: () => Service29,
10188
10263
  LanguageModelNotRegistered: () => LanguageModelNotRegistered
10189
10264
  });
10190
- import { Chunk as Chunk2, Context as Context42, Effect as Effect49, Layer as Layer43, Option as Option17, Ref as Ref11, Schema as Schema48, Semaphore as Semaphore3 } from "effect";
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";
10191
10266
  import { Model } from "effect/unstable/ai";
10192
10267
 
10193
- class LanguageModelNotRegistered extends Schema48.TaggedErrorClass()("LanguageModelNotRegistered", {
10194
- provider: Schema48.String,
10195
- model: Schema48.String,
10196
- registration_key: Schema48.optionalKey(Schema48.String)
10268
+ class LanguageModelNotRegistered extends Schema50.TaggedErrorClass()("LanguageModelNotRegistered", {
10269
+ provider: Schema50.String,
10270
+ model: Schema50.String,
10271
+ registration_key: Schema50.optionalKey(Schema50.String)
10197
10272
  }) {
10198
10273
  }
10199
10274
 
@@ -10261,7 +10336,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
10261
10336
  return yield* service.provide(selection, effect);
10262
10337
  });
10263
10338
 
10264
- // ../../node_modules/.bun/@batonfx+core@0.3.0/node_modules/@batonfx/core/src/index.ts
10339
+ // ../../node_modules/.bun/@batonfx+core@0.3.2/node_modules/@batonfx/core/src/index.ts
10265
10340
  import {
10266
10341
  AiError as AiError3,
10267
10342
  Chat as Chat2,
@@ -10279,7 +10354,7 @@ import {
10279
10354
  } from "effect/unstable/ai";
10280
10355
 
10281
10356
  // ../runtime/src/agent/agent-loop-service.ts
10282
- 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 Schema61, Stream as Stream8 } from "effect";
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";
10283
10358
  import { Chat as Chat3, LanguageModel as LanguageModel6, Prompt as Prompt12, Tokenizer as Tokenizer4, Toolkit as Toolkit7 } from "effect/unstable/ai";
10284
10359
 
10285
10360
  // ../runtime/src/child/child-run-service.ts
@@ -10299,31 +10374,31 @@ __export(exports_child_run_service, {
10299
10374
  ChildRunScopeBroadened: () => ChildRunScopeBroadened,
10300
10375
  ChildRunModelMissing: () => ChildRunModelMissing
10301
10376
  });
10302
- import { Context as Context44, Effect as Effect51, HashSet as HashSet5, Layer as Layer45, Option as Option18, Result as Result2, Schema as Schema50 } from "effect";
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";
10303
10378
 
10304
10379
  // ../runtime/src/workspace/workspace-provider-service.ts
10305
- import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema49 } from "effect";
10380
+ import { Context as Context43, Effect as Effect50, Layer as Layer44, Ref as Ref12, Schema as Schema51 } from "effect";
10306
10381
 
10307
- class WorkspaceNotFound extends Schema49.TaggedErrorClass()("WorkspaceNotFound", {
10382
+ class WorkspaceNotFound extends Schema51.TaggedErrorClass()("WorkspaceNotFound", {
10308
10383
  sandbox_ref: exports_ids_schema.WorkspaceRef
10309
10384
  }) {
10310
10385
  }
10311
10386
 
10312
- class WorkspaceUnavailable extends Schema49.TaggedErrorClass()("WorkspaceUnavailable", {
10387
+ class WorkspaceUnavailable extends Schema51.TaggedErrorClass()("WorkspaceUnavailable", {
10313
10388
  sandbox_ref: exports_ids_schema.WorkspaceRef,
10314
- message: Schema49.String
10389
+ message: Schema51.String
10315
10390
  }) {
10316
10391
  }
10317
10392
 
10318
- class WorkspaceCapabilityUnsupported extends Schema49.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
10319
- capability: Schema49.Literals(["suspend", "snapshot", "fork"]),
10393
+ class WorkspaceCapabilityUnsupported extends Schema51.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
10394
+ capability: Schema51.Literals(["suspend", "snapshot", "fork"]),
10320
10395
  provider_key: exports_workspace_schema.WorkspaceProviderKey
10321
10396
  }) {
10322
10397
  }
10323
10398
 
10324
- class WorkspaceProviderError extends Schema49.TaggedErrorClass()("WorkspaceProviderError", {
10399
+ class WorkspaceProviderError extends Schema51.TaggedErrorClass()("WorkspaceProviderError", {
10325
10400
  provider_key: exports_workspace_schema.WorkspaceProviderKey,
10326
- message: Schema49.String
10401
+ message: Schema51.String
10327
10402
  }) {
10328
10403
  }
10329
10404
 
@@ -10355,28 +10430,28 @@ var destroy = Effect50.fn("WorkspaceProvider.destroy.call")(function* (ref) {
10355
10430
  });
10356
10431
 
10357
10432
  // ../runtime/src/child/child-run-service.ts
10358
- class StaticChildRunPresetNotFound extends Schema50.TaggedErrorClass()("StaticChildRunPresetNotFound", {
10433
+ class StaticChildRunPresetNotFound extends Schema52.TaggedErrorClass()("StaticChildRunPresetNotFound", {
10359
10434
  preset_name: exports_shared_schema.NonEmptyString
10360
10435
  }) {
10361
10436
  }
10362
10437
 
10363
- class ChildRunScopeBroadened extends Schema50.TaggedErrorClass()("ChildRunScopeBroadened", {
10364
- field: Schema50.Literals(["tool_names", "permissions"]),
10438
+ class ChildRunScopeBroadened extends Schema52.TaggedErrorClass()("ChildRunScopeBroadened", {
10439
+ field: Schema52.Literals(["tool_names", "permissions"]),
10365
10440
  value: exports_shared_schema.NonEmptyString
10366
10441
  }) {
10367
10442
  }
10368
10443
 
10369
- class ChildRunServiceError extends Schema50.TaggedErrorClass()("ChildRunServiceError", {
10370
- message: Schema50.String
10444
+ class ChildRunServiceError extends Schema52.TaggedErrorClass()("ChildRunServiceError", {
10445
+ message: Schema52.String
10371
10446
  }) {
10372
10447
  }
10373
10448
 
10374
- class ChildRunWorkspaceUnavailable extends Schema50.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
10375
- reason: Schema50.String
10449
+ class ChildRunWorkspaceUnavailable extends Schema52.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
10450
+ reason: Schema52.String
10376
10451
  }) {
10377
10452
  }
10378
10453
 
10379
- class ChildRunModelMissing extends Schema50.TaggedErrorClass()("ChildRunModelMissing", {}) {
10454
+ class ChildRunModelMissing extends Schema52.TaggedErrorClass()("ChildRunModelMissing", {}) {
10380
10455
  }
10381
10456
 
10382
10457
  class Service31 extends Context44.Service()("@relayfx/runtime/ChildRunService") {
@@ -10604,26 +10679,26 @@ var spawnDynamic = Effect51.fn("ChildRunService.spawnDynamic.call")(function* (i
10604
10679
  });
10605
10680
 
10606
10681
  // ../runtime/src/child/spawn-child-run-tool.ts
10607
- import { Effect as Effect52, Schema as Schema51 } from "effect";
10682
+ import { Effect as Effect52, Schema as Schema53 } from "effect";
10608
10683
  var toolName = "spawn_child_run";
10609
10684
  var permissionName = "relay.child_run.spawn";
10610
- var Input = Schema51.Struct({
10611
- preset_name: Schema51.optionalKey(exports_shared_schema.NonEmptyString),
10612
- instructions: Schema51.optionalKey(Schema51.String),
10613
- model: Schema51.optionalKey(exports_agent_schema.ModelSelection),
10614
- tool_names: Schema51.optionalKey(Schema51.Array(Schema51.String)),
10615
- permissions: Schema51.optionalKey(Schema51.Array(Schema51.String)),
10616
- output_schema_ref: Schema51.optionalKey(Schema51.String),
10617
- metadata: Schema51.optionalKey(exports_shared_schema.Metadata),
10618
- input: Schema51.optionalKey(Schema51.Array(exports_content_schema.Part))
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))
10619
10694
  }).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
10620
- var Output = Schema51.Struct({
10695
+ var Output = Schema53.Struct({
10621
10696
  child_execution_id: exports_ids_schema.ChildExecutionId,
10622
- status: Schema51.Literals(["completed", "failed", "cancelled"]),
10623
- output: Schema51.Array(exports_content_schema.Part)
10697
+ status: Schema53.Literals(["completed", "failed", "cancelled"]),
10698
+ output: Schema53.Array(exports_content_schema.Part)
10624
10699
  }).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
10625
- var TransferInput = Schema51.Struct({
10626
- input: Schema51.optionalKey(Schema51.Array(exports_content_schema.Part))
10700
+ var TransferInput = Schema53.Struct({
10701
+ input: Schema53.optionalKey(Schema53.Array(exports_content_schema.Part))
10627
10702
  }).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
10628
10703
  var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
10629
10704
  var parentContext = (agent) => ({
@@ -10810,17 +10885,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
10810
10885
  });
10811
10886
 
10812
10887
  // ../runtime/src/memory/memory-service.ts
10813
- import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema53 } from "effect";
10888
+ import { Clock as Clock3, Context as Context46, Effect as Effect54, Layer as Layer47, Schema as Schema55 } from "effect";
10814
10889
  import { EmbeddingModel as EmbeddingModel3, Prompt as Prompt9 } from "effect/unstable/ai";
10815
10890
 
10816
10891
  // ../runtime/src/model/embedding-model-service.ts
10817
- import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema52 } from "effect";
10892
+ import { Context as Context45, Effect as Effect53, Layer as Layer46, Ref as Ref13, Schema as Schema54 } from "effect";
10818
10893
  import { EmbeddingModel as EmbeddingModel2, Model as Model3 } from "effect/unstable/ai";
10819
10894
 
10820
- class EmbeddingModelNotRegistered extends Schema52.TaggedErrorClass()("EmbeddingModelNotRegistered", {
10821
- provider: Schema52.String,
10822
- model: Schema52.String,
10823
- registration_key: Schema52.optionalKey(Schema52.String)
10895
+ class EmbeddingModelNotRegistered extends Schema54.TaggedErrorClass()("EmbeddingModelNotRegistered", {
10896
+ provider: Schema54.String,
10897
+ model: Schema54.String,
10898
+ registration_key: Schema54.optionalKey(Schema54.String)
10824
10899
  }) {
10825
10900
  }
10826
10901
 
@@ -10946,7 +11021,7 @@ var defaultTopK = 5;
10946
11021
  var memoryError = (error) => new exports_memory.MemoryError({
10947
11022
  message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
10948
11023
  });
10949
- var decodeSubject = (subject) => Schema53.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
11024
+ var decodeSubject = (subject) => Schema55.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect54.mapError(memoryError));
10950
11025
  var textPart = (text3) => Prompt9.makePart("text", { text: text3 });
10951
11026
  var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
10952
11027
  `).trim();
@@ -11140,20 +11215,20 @@ __export(exports_model_call_policy, {
11140
11215
  defaultClassify: () => defaultClassify2,
11141
11216
  Service: () => Service35
11142
11217
  });
11143
- import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as Schedule3 } from "effect";
11218
+ import { Context as Context48, Duration as Duration3, Layer as Layer49, Schedule as Schedule4 } from "effect";
11144
11219
  import { AiError as AiError4 } from "effect/unstable/ai";
11145
11220
 
11146
11221
  class Service35 extends Context48.Service()("@relayfx/runtime/ModelCallPolicy") {
11147
11222
  }
11148
11223
  var isOutputValidationError = (error) => AiError4.isAiError(error) ? error.reason._tag === "InvalidOutputError" : AiError4.isAiErrorReason(error) && error._tag === "InvalidOutputError";
11149
11224
  var defaultClassify2 = (error) => isOutputValidationError(error) ? "terminal" : exports_model_resilience.defaultClassify(error);
11150
- var defaultSchedule = Schedule3.exponential(Duration3.seconds(1)).pipe(Schedule3.jittered, Schedule3.both(Schedule3.recurs(4)));
11225
+ var defaultSchedule = Schedule4.exponential(Duration3.seconds(1)).pipe(Schedule4.jittered, Schedule4.both(Schedule4.recurs(4)));
11151
11226
  var make7 = (input) => ({
11152
11227
  classify: input?.classify ?? defaultClassify2,
11153
11228
  retrySchedule: input?.retrySchedule ?? defaultSchedule
11154
11229
  });
11155
11230
  var layer36 = (input) => Layer49.succeed(Service35, Service35.of(make7(input)));
11156
- var noRetryLayer = layer36({ retrySchedule: Schedule3.recurs(0) });
11231
+ var noRetryLayer = layer36({ retrySchedule: Schedule4.recurs(0) });
11157
11232
  var testLayer41 = (implementation) => Layer49.succeed(Service35, Service35.of(implementation));
11158
11233
 
11159
11234
  // ../runtime/src/schema-registry/schema-registry-service.ts
@@ -11168,9 +11243,9 @@ __export(exports_schema_registry_service, {
11168
11243
  Service: () => Service36,
11169
11244
  SchemaRefNotRegistered: () => SchemaRefNotRegistered
11170
11245
  });
11171
- import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema54 } from "effect";
11246
+ import { Context as Context49, Effect as Effect56, Layer as Layer50, Ref as Ref14, Schema as Schema56 } from "effect";
11172
11247
 
11173
- class SchemaRefNotRegistered extends Schema54.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
11248
+ class SchemaRefNotRegistered extends Schema56.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
11174
11249
  }
11175
11250
 
11176
11251
  class Service36 extends Context49.Service()("@relayfx/runtime/SchemaRegistry") {
@@ -11303,16 +11378,16 @@ __export(exports_blob_store_service, {
11303
11378
  BlobStoreError: () => BlobStoreError,
11304
11379
  BlobNotResolvable: () => BlobNotResolvable
11305
11380
  });
11306
- import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema55 } from "effect";
11381
+ import { Context as Context51, Effect as Effect58, Layer as Layer52, Ref as Ref16, Schema as Schema57 } from "effect";
11307
11382
 
11308
- class BlobNotResolvable extends Schema55.TaggedErrorClass()("BlobNotResolvable", {
11309
- uri: Schema55.String,
11310
- reason: Schema55.String
11383
+ class BlobNotResolvable extends Schema57.TaggedErrorClass()("BlobNotResolvable", {
11384
+ uri: Schema57.String,
11385
+ reason: Schema57.String
11311
11386
  }) {
11312
11387
  }
11313
11388
 
11314
- class BlobStoreError extends Schema55.TaggedErrorClass()("BlobStoreError", {
11315
- message: Schema55.String
11389
+ class BlobStoreError extends Schema57.TaggedErrorClass()("BlobStoreError", {
11390
+ message: Schema57.String
11316
11391
  }) {
11317
11392
  }
11318
11393
 
@@ -11385,7 +11460,7 @@ __export(exports_prompt_assembler_service, {
11385
11460
  Service: () => Service40,
11386
11461
  PromptAssemblerError: () => PromptAssemblerError
11387
11462
  });
11388
- import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema57 } from "effect";
11463
+ import { Context as Context53, Effect as Effect60, Layer as Layer54, Schema as Schema59 } from "effect";
11389
11464
  import { Prompt as Prompt10 } from "effect/unstable/ai";
11390
11465
 
11391
11466
  // ../runtime/src/content/artifact-store-service.ts
@@ -11400,11 +11475,11 @@ __export(exports_artifact_store_service, {
11400
11475
  Memory: () => Memory2,
11401
11476
  ArtifactNotResolvable: () => ArtifactNotResolvable
11402
11477
  });
11403
- import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema56 } from "effect";
11478
+ import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema58 } from "effect";
11404
11479
 
11405
- class ArtifactNotResolvable extends Schema56.TaggedErrorClass()("ArtifactNotResolvable", {
11406
- artifact_id: Schema56.String,
11407
- reason: Schema56.String
11480
+ class ArtifactNotResolvable extends Schema58.TaggedErrorClass()("ArtifactNotResolvable", {
11481
+ artifact_id: Schema58.String,
11482
+ reason: Schema58.String
11408
11483
  }) {
11409
11484
  }
11410
11485
 
@@ -11446,14 +11521,14 @@ var register8 = Effect59.fn("ArtifactStore.register.call")(function* (artifact_i
11446
11521
  });
11447
11522
 
11448
11523
  // ../runtime/src/agent/prompt-assembler-service.ts
11449
- class PromptAssemblerError extends Schema57.TaggedErrorClass()("PromptAssemblerError", {
11450
- message: Schema57.String
11524
+ class PromptAssemblerError extends Schema59.TaggedErrorClass()("PromptAssemblerError", {
11525
+ message: Schema59.String
11451
11526
  }) {
11452
11527
  }
11453
11528
 
11454
11529
  class Service40 extends Context53.Service()("@relayfx/runtime/PromptAssembler") {
11455
11530
  }
11456
- var jsonValue2 = (value) => Schema57.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
11531
+ var jsonValue2 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
11457
11532
  var stringifyJson = (value) => JSON.stringify(jsonValue2(value));
11458
11533
  var contentToPromptPart = (part) => {
11459
11534
  const options = part.provider_options;
@@ -11597,8 +11672,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
11597
11672
  var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
11598
11673
 
11599
11674
  // ../runtime/src/agent/relay-permissions.ts
11600
- import { Clock as Clock6, Effect as Effect62, Equal as Equal2, Layer as Layer56, Option as Option19, Schema as Schema58 } from "effect";
11601
- var jsonValue3 = (value) => Schema58.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : 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);
11602
11677
  var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
11603
11678
  var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
11604
11679
  var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
@@ -11764,7 +11839,7 @@ var awaitAnswer = Effect62.fn("RelayPermissions.awaitAnswer")(function* (config,
11764
11839
  });
11765
11840
  var rememberRule = Effect62.fn("RelayPermissions.rememberRule")(function* (config, rule) {
11766
11841
  const createdAt = yield* Clock6.currentTimeMillis;
11767
- const decodedRule = yield* Schema58.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
11842
+ const decodedRule = yield* Schema60.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect62.mapError((error) => permissionError(error.message)));
11768
11843
  yield* config.repository.remember({
11769
11844
  agent: config.agentName,
11770
11845
  scope: config.scope,
@@ -11780,9 +11855,9 @@ var layer40 = (config) => Layer56.mergeAll(Layer56.succeed(exports_permissions.P
11780
11855
  })));
11781
11856
 
11782
11857
  // ../runtime/src/agent/relay-steering.ts
11783
- import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema59 } from "effect";
11858
+ import { Clock as Clock7, Effect as Effect63, Layer as Layer57, Schema as Schema61 } from "effect";
11784
11859
  import { Prompt as Prompt11 } from "effect/unstable/ai";
11785
- var jsonValue4 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
11860
+ var jsonValue4 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
11786
11861
  var stringifyJson2 = (value) => JSON.stringify(jsonValue4(value));
11787
11862
  var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
11788
11863
  var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
@@ -11815,7 +11890,7 @@ var contentFromMessage = (message) => {
11815
11890
  const textParts = promptTextParts(prompt);
11816
11891
  if (textParts.length > 0)
11817
11892
  return textParts;
11818
- return [exports_content_schema.text(stringifyJson2(Schema59.encodeSync(Prompt11.Prompt)(prompt)))];
11893
+ return [exports_content_schema.text(stringifyJson2(Schema61.encodeSync(Prompt11.Prompt)(prompt)))];
11819
11894
  };
11820
11895
  var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
11821
11896
  id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
@@ -11860,8 +11935,8 @@ var layer41 = (config) => Layer57.succeed(exports_steering.Steering, exports_ste
11860
11935
  }));
11861
11936
 
11862
11937
  // ../runtime/src/agent/relay-tool-executor.ts
11863
- import { Effect as Effect64, Layer as Layer58, Option as Option20, Schema as Schema60 } from "effect";
11864
- var jsonValue5 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(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);
11865
11940
  var errorDetail = (error) => {
11866
11941
  switch (error._tag) {
11867
11942
  case "ToolNotRegistered":
@@ -11968,29 +12043,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect66.map((ref) => ({
11968
12043
  })));
11969
12044
 
11970
12045
  // ../runtime/src/agent/agent-loop-service.ts
11971
- class AgentLoopError extends Schema61.TaggedErrorClass()("AgentLoopError", {
11972
- message: Schema61.String,
11973
- next_event_sequence: Schema61.optionalKey(exports_execution_schema.ExecutionEventSequence)
12046
+ class AgentLoopError extends Schema63.TaggedErrorClass()("AgentLoopError", {
12047
+ message: Schema63.String,
12048
+ next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
11974
12049
  }) {
11975
12050
  }
11976
12051
 
11977
- class AgentLoopWaitRequested extends Schema61.TaggedErrorClass()("AgentLoopWaitRequested", {
12052
+ class AgentLoopWaitRequested extends Schema63.TaggedErrorClass()("AgentLoopWaitRequested", {
11978
12053
  wait_id: exports_ids_schema.WaitId,
11979
12054
  tool_call: exports_tool_schema.Call,
11980
12055
  next_event_sequence: exports_execution_schema.ExecutionEventSequence
11981
12056
  }) {
11982
12057
  }
11983
12058
 
11984
- class AgentLoopBudgetExceeded extends Schema61.TaggedErrorClass()("AgentLoopBudgetExceeded", {
11985
- tokens_used: Schema61.Int,
11986
- token_budget: Schema61.Int,
12059
+ class AgentLoopBudgetExceeded extends Schema63.TaggedErrorClass()("AgentLoopBudgetExceeded", {
12060
+ tokens_used: Schema63.Int,
12061
+ token_budget: Schema63.Int,
11987
12062
  next_event_sequence: exports_execution_schema.ExecutionEventSequence
11988
12063
  }) {
11989
12064
  }
11990
12065
 
11991
12066
  class Service41 extends Context54.Service()("@relayfx/runtime/AgentLoop") {
11992
12067
  }
11993
- var jsonValue6 = (value) => Schema61.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
12068
+ var jsonValue6 = (value) => Schema63.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
11994
12069
  var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
11995
12070
  var availableRegisteredTools = (agent, registered) => {
11996
12071
  const names = toolNames(agent);
@@ -12559,14 +12634,14 @@ var exports_execution_entity = {};
12559
12634
  __export(exports_execution_entity, {
12560
12635
  layer: () => layer49,
12561
12636
  entity: () => entity,
12562
- client: () => client,
12637
+ client: () => client2,
12563
12638
  Start: () => Start,
12564
12639
  SignalWait: () => SignalWait,
12565
12640
  Cancel: () => Cancel
12566
12641
  });
12567
12642
  import { ClusterSchema, Entity } from "effect/unstable/cluster";
12568
12643
  import { Rpc } from "effect/unstable/rpc";
12569
- import { Schema as Schema68 } from "effect";
12644
+ import { Schema as Schema70 } from "effect";
12570
12645
 
12571
12646
  // ../runtime/src/workflow/execution-workflow.ts
12572
12647
  var exports_execution_workflow = {};
@@ -12597,15 +12672,15 @@ __export(exports_execution_workflow, {
12597
12672
  ActivityNameTemplates: () => ActivityNameTemplates
12598
12673
  });
12599
12674
  import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
12600
- import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema67 } from "effect";
12675
+ import { Effect as Effect73, Exit as Exit2, Option as Option26, Schema as Schema69 } from "effect";
12601
12676
 
12602
12677
  // ../runtime/src/child/parent-notifier-service.ts
12603
- import { Context as Context55, Effect as Effect68, Layer as Layer61, Option as Option23, Ref as Ref19, Schema as Schema62 } from "effect";
12604
- class ParentNotifyError extends Schema62.TaggedErrorClass()("ParentNotifyError", {
12605
- message: Schema62.String
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
12606
12681
  }) {
12607
12682
  }
12608
- var ChildTerminalStatus = Schema62.Literals(["completed", "failed", "cancelled"]).annotate({
12683
+ var ChildTerminalStatus = Schema64.Literals(["completed", "failed", "cancelled"]).annotate({
12609
12684
  identifier: "Relay.ParentNotifier.ChildTerminalStatus"
12610
12685
  });
12611
12686
 
@@ -12704,15 +12779,15 @@ __export(exports_skill_registry_service, {
12704
12779
  SkillDefinitionInvalid: () => SkillDefinitionInvalid,
12705
12780
  Service: () => Service43
12706
12781
  });
12707
- import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema63 } from "effect";
12782
+ import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Schema as Schema65 } from "effect";
12708
12783
 
12709
- class SkillDefinitionInvalid extends Schema63.TaggedErrorClass()("SkillDefinitionInvalid", {
12710
- message: Schema63.String
12784
+ class SkillDefinitionInvalid extends Schema65.TaggedErrorClass()("SkillDefinitionInvalid", {
12785
+ message: Schema65.String
12711
12786
  }) {
12712
12787
  }
12713
12788
 
12714
- class SkillRegistryError extends Schema63.TaggedErrorClass()("SkillRegistryError", {
12715
- message: Schema63.String
12789
+ class SkillRegistryError extends Schema65.TaggedErrorClass()("SkillRegistryError", {
12790
+ message: Schema65.String
12716
12791
  }) {
12717
12792
  }
12718
12793
 
@@ -12881,11 +12956,11 @@ __export(exports_execution_service, {
12881
12956
  Service: () => Service44,
12882
12957
  ExecutionServiceError: () => ExecutionServiceError
12883
12958
  });
12884
- import { Clock as Clock9, Context as Context57, Effect as Effect70, Layer as Layer63, Option as Option24, Schema as Schema64, Stream as Stream9 } from "effect";
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";
12885
12960
  import { ShardingConfig } from "effect/unstable/cluster";
12886
- class ExecutionServiceError extends Schema64.TaggedErrorClass()("ExecutionServiceError", {
12887
- message: Schema64.String,
12888
- next_event_sequence: Schema64.optionalKey(exports_execution_schema.ExecutionEventSequence)
12961
+ class ExecutionServiceError extends Schema66.TaggedErrorClass()("ExecutionServiceError", {
12962
+ message: Schema66.String,
12963
+ next_event_sequence: Schema66.optionalKey(exports_execution_schema.ExecutionEventSequence)
12889
12964
  }) {
12890
12965
  }
12891
12966
 
@@ -13201,13 +13276,13 @@ var spawnChildRun = Effect70.fn("ExecutionService.spawnChildRun.call")(function*
13201
13276
  var stream3 = (input) => Stream9.unwrap(Service44.pipe(Effect70.map((service) => service.stream(input))));
13202
13277
 
13203
13278
  // ../runtime/src/workspace/workspace-planner-service.ts
13204
- import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema66 } from "effect";
13279
+ import { Context as Context59, Effect as Effect72, HashSet as HashSet7, Layer as Layer65, Option as Option25, Schema as Schema68 } from "effect";
13205
13280
 
13206
13281
  // ../runtime/src/workspace/workspace-runtime-service.ts
13207
- import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema65 } from "effect";
13282
+ import { Context as Context58, Effect as Effect71, Layer as Layer64, Schema as Schema67 } from "effect";
13208
13283
 
13209
- class WorkspaceRuntimeError extends Schema65.TaggedErrorClass()("WorkspaceRuntimeError", {
13210
- message: Schema65.String
13284
+ class WorkspaceRuntimeError extends Schema67.TaggedErrorClass()("WorkspaceRuntimeError", {
13285
+ message: Schema67.String
13211
13286
  }) {
13212
13287
  }
13213
13288
 
@@ -13235,18 +13310,18 @@ var exec = Effect71.fn("WorkspaceRuntime.exec.call")(function* (input) {
13235
13310
  });
13236
13311
 
13237
13312
  // ../runtime/src/workspace/workspace-planner-service.ts
13238
- class WorkspaceRuntimeMissing extends Schema66.TaggedErrorClass()("WorkspaceRuntimeMissing", {
13313
+ class WorkspaceRuntimeMissing extends Schema68.TaggedErrorClass()("WorkspaceRuntimeMissing", {
13239
13314
  execution_id: exports_ids_schema.ExecutionId
13240
13315
  }) {
13241
13316
  }
13242
13317
 
13243
- class WorkspaceLeaseMissingRef extends Schema66.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
13318
+ class WorkspaceLeaseMissingRef extends Schema68.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
13244
13319
  execution_id: exports_ids_schema.ExecutionId
13245
13320
  }) {
13246
13321
  }
13247
13322
 
13248
- class WorkspacePlannerError extends Schema66.TaggedErrorClass()("WorkspacePlannerError", {
13249
- message: Schema66.String
13323
+ class WorkspacePlannerError extends Schema68.TaggedErrorClass()("WorkspacePlannerError", {
13324
+ message: Schema68.String
13250
13325
  }) {
13251
13326
  }
13252
13327
 
@@ -13432,67 +13507,67 @@ var fail = Effect72.fn("WorkspacePlanner.fail.call")(function* (input) {
13432
13507
  });
13433
13508
 
13434
13509
  // ../runtime/src/workflow/execution-workflow.ts
13435
- class ExecutionWorkflowFailed extends Schema67.TaggedErrorClass()("ExecutionWorkflowFailed", {
13436
- message: Schema67.String
13510
+ class ExecutionWorkflowFailed extends Schema69.TaggedErrorClass()("ExecutionWorkflowFailed", {
13511
+ message: Schema69.String
13437
13512
  }) {
13438
13513
  }
13439
- var StartInput = Schema67.Struct({
13514
+ var StartInput = Schema69.Struct({
13440
13515
  execution_id: exports_ids_schema.ExecutionId,
13441
13516
  root_address_id: exports_ids_schema.AddressId,
13442
- session_id: Schema67.optionalKey(exports_ids_schema.SessionId),
13443
- input: Schema67.optionalKey(Schema67.Array(exports_content_schema.Part)),
13517
+ session_id: Schema69.optionalKey(exports_ids_schema.SessionId),
13518
+ input: Schema69.optionalKey(Schema69.Array(exports_content_schema.Part)),
13444
13519
  event_sequence: exports_execution_schema.ExecutionEventSequence,
13445
13520
  started_at: exports_shared_schema.TimestampMillis,
13446
13521
  completed_at: exports_shared_schema.TimestampMillis,
13447
- agent_id: Schema67.optionalKey(exports_ids_schema.AgentId),
13448
- agent_revision: Schema67.optionalKey(exports_agent_schema.DefinitionRevision),
13449
- agent_snapshot: Schema67.optionalKey(exports_agent_schema.Definition),
13450
- agent_tool_input_schema_digests: Schema67.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
13451
- wait_id: Schema67.optionalKey(exports_ids_schema.WaitId),
13452
- resume_tool_call: Schema67.optionalKey(exports_tool_schema.Call),
13453
- workflow_generation: Schema67.optionalKey(Schema67.Int.check(Schema67.isGreaterThanOrEqualTo(0))),
13454
- metadata: Schema67.optionalKey(exports_shared_schema.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)
13455
13530
  }).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
13456
- var WaitSignalState = Schema67.Literals(["resolved", "timed_out", "cancelled"]).annotate({
13531
+ var WaitSignalState = Schema69.Literals(["resolved", "timed_out", "cancelled"]).annotate({
13457
13532
  identifier: "Relay.ExecutionWorkflow.WaitSignalState"
13458
13533
  });
13459
- var WaitSignal = Schema67.Struct({
13534
+ var WaitSignal = Schema69.Struct({
13460
13535
  wait_id: exports_ids_schema.WaitId,
13461
13536
  state: WaitSignalState,
13462
13537
  signaled_at: exports_shared_schema.TimestampMillis
13463
13538
  }).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
13464
- var SignalWaitInput = Schema67.Struct({
13465
- workflow_execution_id: Schema67.String,
13539
+ var SignalWaitInput = Schema69.Struct({
13540
+ workflow_execution_id: Schema69.String,
13466
13541
  wait_id: exports_ids_schema.WaitId,
13467
13542
  state: WaitSignalState,
13468
13543
  signaled_at: exports_shared_schema.TimestampMillis
13469
13544
  }).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
13470
- var CancelExecutionInput = Schema67.Struct({
13545
+ var CancelExecutionInput = Schema69.Struct({
13471
13546
  execution_id: exports_ids_schema.ExecutionId,
13472
13547
  cancelled_at: exports_shared_schema.TimestampMillis,
13473
- reason: Schema67.optionalKey(Schema67.String)
13548
+ reason: Schema69.optionalKey(Schema69.String)
13474
13549
  }).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
13475
- var CancelExecutionResult = Schema67.Struct({
13550
+ var CancelExecutionResult = Schema69.Struct({
13476
13551
  execution_id: exports_ids_schema.ExecutionId,
13477
13552
  status: exports_execution_schema.ExecutionStatus
13478
13553
  }).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
13479
- var WaitSnapshot = Schema67.Struct({
13554
+ var WaitSnapshot = Schema69.Struct({
13480
13555
  id: exports_ids_schema.WaitId,
13481
13556
  execution_id: exports_ids_schema.ExecutionId,
13482
- envelope_id: Schema67.optionalKey(exports_ids_schema.EnvelopeId),
13557
+ envelope_id: Schema69.optionalKey(exports_ids_schema.EnvelopeId),
13483
13558
  mode: exports_envelope_schema.WaitMode,
13484
- correlation_key: Schema67.optionalKey(Schema67.String),
13485
- state: Schema67.Literals(["open", "resolved", "timed_out", "cancelled"]),
13559
+ correlation_key: Schema69.optionalKey(Schema69.String),
13560
+ state: Schema69.Literals(["open", "resolved", "timed_out", "cancelled"]),
13486
13561
  metadata: exports_shared_schema.Metadata,
13487
13562
  created_at: exports_shared_schema.TimestampMillis,
13488
- resolved_at: Schema67.optionalKey(exports_shared_schema.TimestampMillis)
13563
+ resolved_at: Schema69.optionalKey(exports_shared_schema.TimestampMillis)
13489
13564
  }).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
13490
- var StartResult = Schema67.Struct({
13565
+ var StartResult = Schema69.Struct({
13491
13566
  execution_id: exports_ids_schema.ExecutionId,
13492
13567
  status: exports_execution_schema.ExecutionStatus,
13493
- wait_id: Schema67.optionalKey(exports_ids_schema.WaitId),
13494
- wait_state: Schema67.optionalKey(Schema67.Literals(["resolved", "timed_out", "cancelled"])),
13495
- metadata: Schema67.optionalKey(exports_shared_schema.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)
13496
13571
  }).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
13497
13572
  var StartExecutionWorkflowName = "Relay/Execution/Start";
13498
13573
  var ActivityNames = {
@@ -13702,7 +13777,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
13702
13777
  });
13703
13778
  var loadCancellationRequested = (input, turn) => Activity.make({
13704
13779
  name: ActivityNames.checkCancel(turn),
13705
- success: Schema67.Boolean,
13780
+ success: Schema69.Boolean,
13706
13781
  error: ExecutionWorkflowFailed,
13707
13782
  execute: Effect73.gen(function* () {
13708
13783
  const repository = yield* exports_execution_repository.Service;
@@ -13712,7 +13787,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
13712
13787
  });
13713
13788
  var loadWait = (name, waitId) => Activity.make({
13714
13789
  name,
13715
- success: Schema67.UndefinedOr(WaitSnapshot),
13790
+ success: Schema69.UndefinedOr(WaitSnapshot),
13716
13791
  error: ExecutionWorkflowFailed,
13717
13792
  execute: get11(waitId).pipe(Effect73.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect73.mapError(mapWaitError2))
13718
13793
  });
@@ -13803,7 +13878,7 @@ var compactionForStart = Effect73.fn("ExecutionWorkflow.compactionForStart")(fun
13803
13878
  ...keepRecentTokens === undefined ? {} : { keepRecentTokens }
13804
13879
  };
13805
13880
  });
13806
- var decodeMemorySubject = (value) => typeof value === "string" ? Schema67.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" }));
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" }));
13807
13882
  var memorySubjectForStart = Effect73.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
13808
13883
  const executionSubject = memorySubjectFromMetadata(input.metadata);
13809
13884
  if (executionSubject !== undefined)
@@ -13821,7 +13896,7 @@ var steeringEnabledForStart = (input) => {
13821
13896
  var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect73.map((max) => max === undefined ? 0 : max + 1), Effect73.mapError(mapEventLogError6));
13822
13897
  var ensureWorkspace = (input) => Activity.make({
13823
13898
  name: ActivityNames.ensureWorkspace,
13824
- success: Schema67.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13899
+ success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13825
13900
  error: ExecutionWorkflowFailed,
13826
13901
  execute: Effect73.gen(function* () {
13827
13902
  if (input.agent_snapshot === undefined)
@@ -13838,19 +13913,19 @@ var ensureWorkspace = (input) => Activity.make({
13838
13913
  });
13839
13914
  var suspendWorkspace = (input, key2) => Activity.make({
13840
13915
  name: ActivityNames.suspendWorkspace(key2),
13841
- success: Schema67.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13916
+ success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13842
13917
  error: ExecutionWorkflowFailed,
13843
13918
  execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.mapError(mapWorkspaceError))
13844
13919
  });
13845
13920
  var resumeWorkspace = (input, key2) => Activity.make({
13846
13921
  name: ActivityNames.resumeWorkspace(key2),
13847
- success: Schema67.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13922
+ success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13848
13923
  error: ExecutionWorkflowFailed,
13849
13924
  execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect73.map((plan2) => plan2?.lease), Effect73.mapError(mapWorkspaceError))
13850
13925
  });
13851
13926
  var releaseWorkspace = (input) => Activity.make({
13852
13927
  name: ActivityNames.releaseWorkspace,
13853
- success: Schema67.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13928
+ success: Schema69.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
13854
13929
  error: ExecutionWorkflowFailed,
13855
13930
  execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect73.mapError(mapWorkspaceError))
13856
13931
  });
@@ -13951,7 +14026,7 @@ var childDispatchContext = (input) => {
13951
14026
  };
13952
14027
  var loadChildCancellationRequested = (input) => Activity.make({
13953
14028
  name: ActivityNames.checkQueuedChildCancellation,
13954
- success: Schema67.Boolean,
14029
+ success: Schema69.Boolean,
13955
14030
  error: ExecutionWorkflowFailed,
13956
14031
  execute: Effect73.gen(function* () {
13957
14032
  const context = childDispatchContext(input);
@@ -13963,7 +14038,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
13963
14038
  });
13964
14039
  var notifyParentActivity = (input, context, status, output) => Activity.make({
13965
14040
  name: ActivityNames.notifyParent(status),
13966
- success: Schema67.Void,
14041
+ success: Schema69.Void,
13967
14042
  error: ExecutionWorkflowFailed,
13968
14043
  execute: Effect73.gen(function* () {
13969
14044
  const notifier = yield* Effect73.serviceOption(Service42);
@@ -14016,7 +14091,7 @@ var waitIdFromExecution = (execution) => {
14016
14091
  };
14017
14092
  var pendingToolCallFromExecution = (execution) => {
14018
14093
  const pending = execution.metadata?.pending_tool_call;
14019
- return Schema67.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
14094
+ return Schema69.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
14020
14095
  };
14021
14096
  var finishCancelledWait = Effect73.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
14022
14097
  const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
@@ -14230,7 +14305,7 @@ var Start = Rpc.make("start", {
14230
14305
  }).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
14231
14306
  var SignalWait = Rpc.make("signalWait", {
14232
14307
  payload: SignalWaitInput,
14233
- success: Schema68.Void,
14308
+ success: Schema70.Void,
14234
14309
  error: ExecutionWorkflowFailed
14235
14310
  }).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
14236
14311
  var Cancel = Rpc.make("cancel", {
@@ -14244,7 +14319,7 @@ var layer49 = entity.toLayer(entity.of({
14244
14319
  signalWait: (request) => signalWait(request.payload),
14245
14320
  cancel: (request) => cancelRequest(request.payload)
14246
14321
  }), { concurrency: "unbounded" });
14247
- var client = entity.client;
14322
+ var client2 = entity.client;
14248
14323
  // ../runtime/src/envelope/envelope-service.ts
14249
14324
  var exports_envelope_service = {};
14250
14325
  __export(exports_envelope_service, {
@@ -14258,26 +14333,26 @@ __export(exports_envelope_service, {
14258
14333
  EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
14259
14334
  EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
14260
14335
  });
14261
- import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema69 } from "effect";
14262
- class EnvelopeAddressNotFound extends Schema69.TaggedErrorClass()("EnvelopeAddressNotFound", {
14336
+ import { Context as Context60, Effect as Effect74, Layer as Layer67, Schema as Schema71 } from "effect";
14337
+ class EnvelopeAddressNotFound extends Schema71.TaggedErrorClass()("EnvelopeAddressNotFound", {
14263
14338
  address_id: exports_ids_schema.AddressId
14264
14339
  }) {
14265
14340
  }
14266
14341
 
14267
- class EnvelopeRouteUnavailable extends Schema69.TaggedErrorClass()("EnvelopeRouteUnavailable", {
14342
+ class EnvelopeRouteUnavailable extends Schema71.TaggedErrorClass()("EnvelopeRouteUnavailable", {
14268
14343
  address_id: exports_ids_schema.AddressId,
14269
- route_key: Schema69.String
14344
+ route_key: Schema71.String
14270
14345
  }) {
14271
14346
  }
14272
14347
 
14273
- class EnvelopeRouteDeferred extends Schema69.TaggedErrorClass()("EnvelopeRouteDeferred", {
14348
+ class EnvelopeRouteDeferred extends Schema71.TaggedErrorClass()("EnvelopeRouteDeferred", {
14274
14349
  address_id: exports_ids_schema.AddressId,
14275
- route_key: Schema69.String
14350
+ route_key: Schema71.String
14276
14351
  }) {
14277
14352
  }
14278
14353
 
14279
- class EnvelopeServiceError extends Schema69.TaggedErrorClass()("EnvelopeServiceError", {
14280
- message: Schema69.String
14354
+ class EnvelopeServiceError extends Schema71.TaggedErrorClass()("EnvelopeServiceError", {
14355
+ message: Schema71.String
14281
14356
  }) {
14282
14357
  }
14283
14358
 
@@ -14435,7 +14510,7 @@ __export(exports_runner_runtime_service, {
14435
14510
  DatabaseMode: () => DatabaseMode,
14436
14511
  ClusterConfigMismatch: () => ClusterConfigMismatch
14437
14512
  });
14438
- import { Config as Config5, Context as Context62, Crypto as Crypto4, Duration as Duration5, Effect as Effect77, Layer as Layer69, Option as Option27, Schema as Schema71, Stream as Stream10 } from "effect";
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";
14439
14514
  import {
14440
14515
  ClusterWorkflowEngine,
14441
14516
  HttpRunner,
@@ -14473,7 +14548,7 @@ __export(exports_scheduler_service, {
14473
14548
  SchedulerError: () => SchedulerError,
14474
14549
  ScheduleCronInvalid: () => ScheduleCronInvalid
14475
14550
  });
14476
- 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 Schema70 } from "effect";
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";
14477
14552
 
14478
14553
  // ../runtime/src/wait/wait-signal.ts
14479
14554
  var exports_wait_signal = {};
@@ -14483,8 +14558,8 @@ __export(exports_wait_signal, {
14483
14558
  import { Effect as Effect75 } from "effect";
14484
14559
  var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function* (input) {
14485
14560
  const workflowExecutionId2 = yield* activeWorkflowExecutionIdForExecution(input.executionId);
14486
- const client2 = input.makeExecutionClient(input.executionId);
14487
- yield* client2.signalWait({
14561
+ const client3 = input.makeExecutionClient(input.executionId);
14562
+ yield* client3.signalWait({
14488
14563
  workflow_execution_id: workflowExecutionId2,
14489
14564
  wait_id: input.waitId,
14490
14565
  state: input.state,
@@ -14493,14 +14568,14 @@ var signalWorkflowWait = Effect75.fn("WaitSignal.signalWorkflowWait")(function*
14493
14568
  });
14494
14569
 
14495
14570
  // ../runtime/src/schedule/scheduler-service.ts
14496
- class SchedulerError extends Schema70.TaggedErrorClass()("SchedulerError", {
14497
- message: Schema70.String
14571
+ class SchedulerError extends Schema72.TaggedErrorClass()("SchedulerError", {
14572
+ message: Schema72.String
14498
14573
  }) {
14499
14574
  }
14500
14575
 
14501
- class ScheduleCronInvalid extends Schema70.TaggedErrorClass()("ScheduleCronInvalid", {
14502
- cron_expr: Schema70.String,
14503
- message: Schema70.String
14576
+ class ScheduleCronInvalid extends Schema72.TaggedErrorClass()("ScheduleCronInvalid", {
14577
+ cron_expr: Schema72.String,
14578
+ message: Schema72.String
14504
14579
  }) {
14505
14580
  }
14506
14581
 
@@ -14538,7 +14613,7 @@ var make14 = Effect76.gen(function* () {
14538
14613
  const waits = yield* Service25;
14539
14614
  const eventLog = yield* Service24;
14540
14615
  const executionRepository = yield* exports_execution_repository.Service;
14541
- const makeExecutionClient = yield* client;
14616
+ const makeExecutionClient = yield* client2;
14542
14617
  const workerId = yield* workerIdConfig;
14543
14618
  const claimTtlMillis = yield* claimTtlMillisConfig;
14544
14619
  const pollIntervalMillis = yield* pollIntervalMillisConfig;
@@ -14651,25 +14726,25 @@ var runOnce2 = Effect76.fn("SchedulerService.runOnce.call")(function* () {
14651
14726
  });
14652
14727
 
14653
14728
  // ../runtime/src/runner/runner-runtime-service.ts
14654
- var DatabaseMode = Schema71.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
14729
+ var DatabaseMode = Schema73.Literals(["sql", "pg", "mysql", "sqlite", "memory"]).annotate({
14655
14730
  identifier: "Relay.RunnerRuntime.DatabaseMode"
14656
14731
  });
14657
- var ReadinessStatus = Schema71.Struct({
14732
+ var ReadinessStatus = Schema73.Struct({
14658
14733
  database: DatabaseMode,
14659
- cluster: Schema71.Literal("ready"),
14660
- workflow: Schema71.Literals(["ready", "client"]),
14661
- executionEntity: Schema71.Literals(["registered", "client"])
14734
+ cluster: Schema73.Literal("ready"),
14735
+ workflow: Schema73.Literals(["ready", "client"]),
14736
+ executionEntity: Schema73.Literals(["registered", "client"])
14662
14737
  }).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
14663
14738
 
14664
- class RunnerRuntimeError extends Schema71.TaggedErrorClass()("RunnerRuntimeError", {
14665
- message: Schema71.String
14739
+ class RunnerRuntimeError extends Schema73.TaggedErrorClass()("RunnerRuntimeError", {
14740
+ message: Schema73.String
14666
14741
  }) {
14667
14742
  }
14668
14743
 
14669
- class ClusterConfigMismatch extends Schema71.TaggedErrorClass()("ClusterConfigMismatch", {
14670
- field: Schema71.String,
14671
- expected: Schema71.String,
14672
- actual: Schema71.String
14744
+ class ClusterConfigMismatch extends Schema73.TaggedErrorClass()("ClusterConfigMismatch", {
14745
+ field: Schema73.String,
14746
+ expected: Schema73.String,
14747
+ actual: Schema73.String
14673
14748
  }) {
14674
14749
  }
14675
14750
 
@@ -14683,7 +14758,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer69.provideMerge(Runners.layerN
14683
14758
  var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
14684
14759
  var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
14685
14760
  var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
14686
- var clusterShardGroups = Config5.schema(Config5.Array(Schema71.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
14761
+ var clusterShardGroups = Config5.schema(Config5.Array(Schema73.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
14687
14762
  var runnerAddressKey = (address) => `${address.host}:${address.port}`;
14688
14763
  var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
14689
14764
  var shardingConfigFromEnv = () => Layer69.effect(ShardingConfig2.ShardingConfig, Effect77.gen(function* () {
@@ -14784,7 +14859,7 @@ var testCryptoLayer = Layer69.succeed(Crypto4.Crypto, Crypto4.make({
14784
14859
  var executionServiceLayer = layer46.pipe(Layer69.provideMerge(layer32));
14785
14860
  var addressResolutionLayerWith = (toolRuntimeLayer) => layer25.pipe(Layer69.provideMerge(layerFromRepository), Layer69.provideMerge(layer24.pipe(Layer69.provideMerge(toolRuntimeLayer))));
14786
14861
  var parentNotifierLayer = Layer69.effect(Service42, Effect77.gen(function* () {
14787
- const makeExecutionClient = yield* client;
14862
+ const makeExecutionClient = yield* client2;
14788
14863
  const executionRepository = yield* exports_execution_repository.Service;
14789
14864
  return yield* make13({
14790
14865
  signalWait: (input) => signalWorkflowWait({
@@ -14803,7 +14878,7 @@ var workflowAndEntityLayerWith = (toolRuntimeLayer, schedulerLayer, promptAssemb
14803
14878
  var makeService2 = (database, checkDatabase) => Effect77.gen(function* () {
14804
14879
  const sharding = yield* Sharding.Sharding;
14805
14880
  const workflow = yield* WorkflowEngine.WorkflowEngine;
14806
- const makeClient = yield* client;
14881
+ const makeClient = yield* client2;
14807
14882
  return Service49.of({
14808
14883
  check: Effect77.fn("RunnerRuntime.check")(function* () {
14809
14884
  yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
@@ -14850,7 +14925,7 @@ var sqlCheckLayer = Layer69.effect(Service49, Effect77.gen(function* () {
14850
14925
  }));
14851
14926
  var makeClientService = (database, checkDatabase) => Effect77.gen(function* () {
14852
14927
  const sharding = yield* Sharding.Sharding;
14853
- const makeClient = yield* client;
14928
+ const makeClient = yield* client2;
14854
14929
  return Service49.of({
14855
14930
  check: Effect77.fn("RunnerRuntime.check")(function* () {
14856
14931
  yield* Effect77.annotateCurrentSpan("relay.database.mode", database);
@@ -15013,51 +15088,51 @@ __export(exports_activity_version_registry, {
15013
15088
  ActivityManifestChange: () => ActivityManifestChange,
15014
15089
  ActivityManifest: () => ActivityManifest
15015
15090
  });
15016
- import { Crypto as Crypto5, Effect as Effect78, Schema as Schema72 } from "effect";
15091
+ import { Crypto as Crypto5, Effect as Effect78, Schema as Schema74 } from "effect";
15017
15092
  var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
15018
- var ActivityManifestEntry = Schema72.Struct({
15019
- name: Schema72.String,
15020
- signature_hash: Schema72.String
15093
+ var ActivityManifestEntry = Schema74.Struct({
15094
+ name: Schema74.String,
15095
+ signature_hash: Schema74.String
15021
15096
  }).annotate({ identifier: "Relay.ActivityManifestEntry" });
15022
- var ActivityManifest = Schema72.Struct({
15023
- version: Schema72.Literal(1),
15024
- generated_from: Schema72.String,
15025
- hash_algorithm: Schema72.Literal("sha256-json-schema-v1"),
15026
- activities: Schema72.Array(ActivityManifestEntry)
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)
15027
15102
  }).annotate({ identifier: "Relay.ActivityManifest" });
15028
- var ActivityManifestChange = Schema72.Struct({
15029
- type: Schema72.Literals(["removed", "changed", "added"]),
15030
- name: Schema72.String,
15031
- baseline_hash: Schema72.optionalKey(Schema72.String),
15032
- current_hash: Schema72.optionalKey(Schema72.String)
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)
15033
15108
  }).annotate({ identifier: "Relay.ActivityManifestChange" });
15034
- var ActivityManifestGuardResult = Schema72.Struct({
15035
- status: Schema72.Literals(["pass", "fail"]),
15036
- waiting_executions: Schema72.Int.check(Schema72.isGreaterThanOrEqualTo(0)),
15037
- breaking_changes: Schema72.Array(ActivityManifestChange),
15038
- additive_changes: Schema72.Array(ActivityManifestChange)
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)
15039
15114
  }).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
15040
15115
 
15041
- class ActivityManifestGuardFailed extends Schema72.TaggedErrorClass()("ActivityManifestGuardFailed", {
15042
- message: Schema72.String,
15116
+ class ActivityManifestGuardFailed extends Schema74.TaggedErrorClass()("ActivityManifestGuardFailed", {
15117
+ message: Schema74.String,
15043
15118
  result: ActivityManifestGuardResult
15044
15119
  }) {
15045
15120
  }
15046
- var TurnInput = Schema72.Struct({
15121
+ var TurnInput = Schema74.Struct({
15047
15122
  start: StartInput,
15048
- turn: Schema72.Int.check(Schema72.isGreaterThanOrEqualTo(0))
15123
+ turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0))
15049
15124
  });
15050
- var WaitIdInput = Schema72.Struct({
15125
+ var WaitIdInput = Schema74.Struct({
15051
15126
  wait_id: exports_ids_schema.WaitId
15052
15127
  });
15053
- var WorkspaceKeyInput = Schema72.Struct({
15128
+ var WorkspaceKeyInput = Schema74.Struct({
15054
15129
  start: StartInput,
15055
- key: Schema72.String
15130
+ key: Schema74.String
15056
15131
  });
15057
15132
  var contracts = [
15058
15133
  {
15059
15134
  name: ActivityNameTemplates.resolveLocalAgent,
15060
- input: Schema72.Struct({ address_id: exports_ids_schema.AddressId }),
15135
+ input: Schema74.Struct({ address_id: exports_ids_schema.AddressId }),
15061
15136
  success: LocalAgentTarget,
15062
15137
  error: ExecutionWorkflowFailed
15063
15138
  },
@@ -15069,66 +15144,66 @@ var contracts = [
15069
15144
  },
15070
15145
  {
15071
15146
  name: ActivityNameTemplates.cancel,
15072
- input: Schema72.Struct({ start: StartInput, turn: Schema72.Int, reason: Schema72.String }),
15147
+ input: Schema74.Struct({ start: StartInput, turn: Schema74.Int, reason: Schema74.String }),
15073
15148
  success: exports_execution_schema.Execution,
15074
15149
  error: ExecutionWorkflowFailed
15075
15150
  },
15076
15151
  {
15077
15152
  name: ActivityNameTemplates.checkCancel,
15078
15153
  input: TurnInput,
15079
- success: Schema72.Boolean,
15154
+ success: Schema74.Boolean,
15080
15155
  error: ExecutionWorkflowFailed
15081
15156
  },
15082
15157
  {
15083
15158
  name: ActivityNameTemplates.loadWaitBeforeSleep,
15084
15159
  input: WaitIdInput,
15085
- success: Schema72.UndefinedOr(WaitSnapshot),
15160
+ success: Schema74.UndefinedOr(WaitSnapshot),
15086
15161
  error: ExecutionWorkflowFailed
15087
15162
  },
15088
15163
  {
15089
15164
  name: ActivityNameTemplates.loadWaitAfterWake,
15090
15165
  input: WaitIdInput,
15091
- success: Schema72.UndefinedOr(WaitSnapshot),
15166
+ success: Schema74.UndefinedOr(WaitSnapshot),
15092
15167
  error: ExecutionWorkflowFailed
15093
15168
  },
15094
15169
  {
15095
15170
  name: ActivityNameTemplates.markWaiting,
15096
- input: Schema72.Struct({ start: StartInput, wait: WaitSnapshot }),
15171
+ input: Schema74.Struct({ start: StartInput, wait: WaitSnapshot }),
15097
15172
  success: exports_execution_schema.Execution,
15098
15173
  error: ExecutionWorkflowFailed
15099
15174
  },
15100
15175
  {
15101
15176
  name: ActivityNameTemplates.ensureWorkspace,
15102
15177
  input: StartInput,
15103
- success: Schema72.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15178
+ success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15104
15179
  error: ExecutionWorkflowFailed
15105
15180
  },
15106
15181
  {
15107
15182
  name: ActivityNameTemplates.suspendWorkspace,
15108
15183
  input: WorkspaceKeyInput,
15109
- success: Schema72.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15184
+ success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15110
15185
  error: ExecutionWorkflowFailed
15111
15186
  },
15112
15187
  {
15113
15188
  name: ActivityNameTemplates.resumeWorkspace,
15114
15189
  input: WorkspaceKeyInput,
15115
- success: Schema72.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15190
+ success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15116
15191
  error: ExecutionWorkflowFailed
15117
15192
  },
15118
15193
  {
15119
15194
  name: ActivityNameTemplates.releaseWorkspace,
15120
15195
  input: StartInput,
15121
- success: Schema72.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15196
+ success: Schema74.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
15122
15197
  error: ExecutionWorkflowFailed
15123
15198
  },
15124
15199
  {
15125
15200
  name: ActivityNameTemplates.complete,
15126
- input: Schema72.Struct({
15201
+ input: Schema74.Struct({
15127
15202
  start: StartInput,
15128
- turn: Schema72.Int.check(Schema72.isGreaterThanOrEqualTo(0)),
15129
- wait_id: Schema72.optionalKey(exports_ids_schema.WaitId),
15130
- wait_state: Schema72.optionalKey(WaitSignalState),
15131
- pending_tool_call: Schema72.optionalKey(exports_tool_schema.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)
15132
15207
  }),
15133
15208
  success: exports_execution_schema.Execution,
15134
15209
  error: ExecutionWorkflowFailed
@@ -15136,24 +15211,24 @@ var contracts = [
15136
15211
  {
15137
15212
  name: ActivityNameTemplates.checkQueuedChildCancellation,
15138
15213
  input: StartInput,
15139
- success: Schema72.Boolean,
15214
+ success: Schema74.Boolean,
15140
15215
  error: ExecutionWorkflowFailed
15141
15216
  },
15142
15217
  {
15143
15218
  name: ActivityNameTemplates.notifyParent,
15144
- input: Schema72.Struct({
15219
+ input: Schema74.Struct({
15145
15220
  start: StartInput,
15146
15221
  status: ChildTerminalStatus,
15147
- output: Schema72.Array(exports_content_schema.Part)
15222
+ output: Schema74.Array(exports_content_schema.Part)
15148
15223
  }),
15149
- success: Schema72.Void,
15224
+ success: Schema74.Void,
15150
15225
  error: ExecutionWorkflowFailed
15151
15226
  },
15152
15227
  {
15153
15228
  name: ActivityNameTemplates.continueAsNew,
15154
- input: Schema72.Struct({
15229
+ input: Schema74.Struct({
15155
15230
  start: StartInput,
15156
- turn: Schema72.Int.check(Schema72.isGreaterThanOrEqualTo(0)),
15231
+ turn: Schema74.Int.check(Schema74.isGreaterThanOrEqualTo(0)),
15157
15232
  wait_id: exports_ids_schema.WaitId,
15158
15233
  pending_tool_call: exports_tool_schema.Call
15159
15234
  }),
@@ -15161,7 +15236,7 @@ var contracts = [
15161
15236
  error: ExecutionWorkflowFailed
15162
15237
  }
15163
15238
  ];
15164
- var schemaJson = (schema) => Schema72.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema72.toJsonSchemaDocument(schema));
15239
+ var schemaJson = (schema) => Schema74.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema74.toJsonSchemaDocument(schema));
15165
15240
  var canonical = (value) => {
15166
15241
  if (value === null || typeof value !== "object")
15167
15242
  return value;
@@ -15276,7 +15351,7 @@ __export(exports_language_model_registration, {
15276
15351
  anthropic: () => anthropic
15277
15352
  });
15278
15353
 
15279
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/anthropic.ts
15354
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/anthropic.ts
15280
15355
  import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
15281
15356
  import { Layer as Layer70 } from "effect";
15282
15357
  import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
@@ -15292,13 +15367,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
15292
15367
  });
15293
15368
  var anthropicClientLayerConfig = AnthropicClient.layerConfig;
15294
15369
  var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer70.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer70.provide(FetchHttpClient2.layer));
15295
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/deterministic.ts
15370
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
15296
15371
  import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
15297
15372
  import { Effect as Effect79, Layer as Layer72, Option as Option28, Stream as Stream11 } from "effect";
15298
15373
  import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
15299
15374
  import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
15300
15375
 
15301
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/openai.ts
15376
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai.ts
15302
15377
  import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
15303
15378
  import { Layer as Layer71 } from "effect";
15304
15379
  import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
@@ -15315,7 +15390,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
15315
15390
  var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
15316
15391
  var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer71.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer71.provide(FetchHttpClient3.layer));
15317
15392
 
15318
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/deterministic.ts
15393
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/deterministic.ts
15319
15394
  var deterministicModelLayer = Layer72.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
15320
15395
  generateText: () => Effect79.succeed([{ type: "text", text: "deterministic response" }]),
15321
15396
  streamText: () => Stream11.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
@@ -15339,7 +15414,7 @@ var withOpenAiOrDeterministic = (options) => Layer72.unwrap(Effect79.gen(functio
15339
15414
  ...Option28.isSome(openAiRegistration) ? [openAiRegistration.value] : []
15340
15415
  ]);
15341
15416
  }));
15342
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/openai-compat.ts
15417
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openai-compat.ts
15343
15418
  import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
15344
15419
  import { Config as Config8, Layer as Layer73 } from "effect";
15345
15420
  import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
@@ -15360,7 +15435,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
15360
15435
  ...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
15361
15436
  });
15362
15437
  var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer73.provide(clientLayerConfig(options)), Layer73.provide(FetchHttpClient5.layer));
15363
- // ../../node_modules/.bun/@batonfx+providers@0.3.0/node_modules/@batonfx/providers/src/openrouter.ts
15438
+ // ../../node_modules/.bun/@batonfx+providers@0.3.2/node_modules/@batonfx/providers/src/openrouter.ts
15364
15439
  import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
15365
15440
  import { Layer as Layer74 } from "effect";
15366
15441
  import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";