@relayfx/sdk 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  exports_tool_executor,
33
33
  exports_tool_output,
34
34
  exports_turn_policy
35
- } from "./index-8yv2a8ce.js";
35
+ } from "./index-58425087.js";
36
36
  import"./index-nb39b5ae.js";
37
37
 
38
38
  // src/ai.ts
@@ -3,7 +3,7 @@ import {
3
3
  __export
4
4
  } from "./index-nb39b5ae.js";
5
5
 
6
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/turn-policy.js
6
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/turn-policy.js
7
7
  var exports_turn_policy = {};
8
8
  __export(exports_turn_policy, {
9
9
  untilToolCall: () => untilToolCall,
@@ -72,7 +72,7 @@ var both = dual(2, (first, second) => ({
72
72
  }));
73
73
  var defaultPolicy = forever;
74
74
 
75
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-event.js
75
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-event.js
76
76
  var exports_agent_event = {};
77
77
  __export(exports_agent_event, {
78
78
  addUsage: () => addUsage,
@@ -90,7 +90,7 @@ __export(exports_agent_event, {
90
90
  import { Function, Schema as Schema4 } from "effect";
91
91
  import { Prompt as Prompt3, Response as Response3, Tool } from "effect/unstable/ai";
92
92
 
93
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-telemetry.js
93
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-telemetry.js
94
94
  var exports_model_telemetry = {};
95
95
  __export(exports_model_telemetry, {
96
96
  layerNoop: () => layerNoop,
@@ -348,7 +348,7 @@ var CurrentSummaryCall = Context.Reference("@batonfx/core/ModelTelemetry/Current
348
348
  } });
349
349
  var generateId = Effect2.flatMap(Effect2.serviceOption(IdGenerator.IdGenerator), (service) => Option.getOrElse(service, () => IdGenerator.defaultIdGenerator).generateId());
350
350
 
351
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/session-sync.js
351
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/session-sync.js
352
352
  import { Equal, Schema as Schema3 } from "effect";
353
353
  import { dual as dual2 } from "effect/Function";
354
354
  import { Prompt as Prompt2 } from "effect/unstable/ai";
@@ -452,7 +452,7 @@ var diagnose = (input) => {
452
452
  };
453
453
  };
454
454
 
455
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-event.js
455
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-event.js
456
456
  var addUsageField = (left, right) => left === undefined && right === undefined ? undefined : (left ?? 0) + (right ?? 0);
457
457
  var addUsage = Function.dual(2, (left, right) => Response3.Usage.make({
458
458
  inputTokens: {
@@ -555,7 +555,7 @@ class ResumeMismatch extends Schema4.TaggedErrorClass()("@batonfx/core/ResumeMis
555
555
  }) {
556
556
  }
557
557
 
558
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/memory.js
558
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/memory.js
559
559
  var exports_memory = {};
560
560
  __export(exports_memory, {
561
561
  replaceRecalledMessage: () => replaceRecalledMessage,
@@ -621,7 +621,7 @@ var merge = dual3(2, (first, second) => ({
621
621
  var layerNoop2 = Layer3.succeed(Memory, Memory.of(noop));
622
622
  var layerTest = (implementation) => Layer3.succeed(Memory, Memory.of(implementation));
623
623
 
624
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-registry.js
624
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-registry.js
625
625
  var exports_model_registry = {};
626
626
  __export(exports_model_registry, {
627
627
  stream: () => stream,
@@ -640,7 +640,7 @@ __export(exports_model_registry, {
640
640
  import { Context as Context3, Effect as Effect4, Fiber, Function as Function2, HashMap, Layer as Layer4, Option as Option3, Ref, Schema as Schema6, Scope, Semaphore, Stream } from "effect";
641
641
  import { LanguageModel as LanguageModel3, Model } from "effect/unstable/ai";
642
642
 
643
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/context-overflow.js
643
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/context-overflow.js
644
644
  var exports_context_overflow = {};
645
645
  __export(exports_context_overflow, {
646
646
  classify: () => classify
@@ -679,7 +679,7 @@ var evidence = (value, depth) => {
679
679
  };
680
680
  var classify = (error) => overflowEvidence.test(evidence(error, 0)) ? "context-overflow" : "other";
681
681
 
682
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-registry.js
682
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-registry.js
683
683
  var FailureClassifierTypeId = Symbol.for("@batonfx/core/model-registry/FailureClassifier");
684
684
  var classifyFailure = Function2.dual(2, (model, error) => {
685
685
  const classified = model[FailureClassifierTypeId]?.(error);
@@ -797,7 +797,7 @@ var operate = Function2.dual(2, (selection, effect) => Effect4.gen(function* ()
797
797
  }));
798
798
  var stream = Function2.dual(2, (selection, operation) => Stream.unwrap(ModelRegistry.pipe(Effect4.map((service) => service.stream(selection, operation)))));
799
799
 
800
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-context.js
800
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-context.js
801
801
  var exports_tool_context = {};
802
802
  __export(exports_tool_context, {
803
803
  layerTest: () => layerTest3,
@@ -815,7 +815,7 @@ var layerDefault = Layer5.sync(ToolContext, () => ToolContext.of({
815
815
  }));
816
816
  var layerTest3 = (implementation) => Layer5.succeed(ToolContext, ToolContext.of(implementation));
817
817
 
818
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-executor.js
818
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-executor.js
819
819
  var exports_tool_executor = {};
820
820
  __export(exports_tool_executor, {
821
821
  sandbox: () => sandbox,
@@ -836,11 +836,11 @@ __export(exports_tool_executor, {
836
836
  import { Context as Context5, Effect as Effect8, Layer as Layer6, Option as Option4, Schema as Schema8, Stream as Stream2 } from "effect";
837
837
  import { AiError as AiError4, Response as Response4, Tool as Tool4, Toolkit } from "effect/unstable/ai";
838
838
 
839
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-placement.js
839
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-placement.js
840
840
  import { Effect as Effect7, Schedule } from "effect";
841
841
  import { Tool as Tool3 } from "effect/unstable/ai";
842
842
 
843
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-result-codec.js
843
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-result-codec.js
844
844
  import { Effect as Effect6, Schema as Schema7 } from "effect";
845
845
  import { AiError as AiError3, Tool as Tool2 } from "effect/unstable/ai";
846
846
  var resultMessage = (result) => {
@@ -905,7 +905,7 @@ var toolResultCodec = {
905
905
  schemaMessage
906
906
  };
907
907
 
908
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-placement.js
908
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-placement.js
909
909
  var placementOutcomeFromResponse = (placement, tool, response) => {
910
910
  if (typeof response !== "object" || response === null || !("_tag" in response)) {
911
911
  return Effect7.fail(toolResultCodec.frameworkFailure("placement", tool.name, "Placement returned an invalid response"));
@@ -923,7 +923,7 @@ var placementOutcomeFromResponse = (placement, tool, response) => {
923
923
  };
924
924
  var placementOutcome = { fromResponse: placementOutcomeFromResponse };
925
925
 
926
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-executor.js
926
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-executor.js
927
927
  var FrameworkStage = Schema8.Literals([
928
928
  "decode-input",
929
929
  "handler",
@@ -1064,7 +1064,7 @@ function layerRouter(routes) {
1064
1064
  }
1065
1065
  var layerTest4 = (implementation) => Layer6.succeed(ToolExecutor, ToolExecutor.of(implementation));
1066
1066
 
1067
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/approvals.js
1067
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/approvals.js
1068
1068
  var exports_approvals = {};
1069
1069
  __export(exports_approvals, {
1070
1070
  layerTest: () => layerTest5,
@@ -1080,7 +1080,7 @@ var layerAutoApprove = Layer7.succeed(Approvals, Approvals.of({ resolve: () => E
1080
1080
  var layerDenyAll = Layer7.succeed(Approvals, Approvals.of({ resolve: () => Effect9.succeed({ _tag: "Denied" }) }));
1081
1081
  var layerTest5 = (implementation) => Layer7.succeed(Approvals, Approvals.of(implementation));
1082
1082
 
1083
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/session.js
1083
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/session.js
1084
1084
  var exports_session = {};
1085
1085
  __export(exports_session, {
1086
1086
  layerTest: () => layerTest6,
@@ -1372,7 +1372,7 @@ var layerMemory2 = Layer8.effect(SessionStore, Ref2.make(initialState).pipe(Effe
1372
1372
  }))));
1373
1373
  var layerTest6 = (implementation) => Layer8.succeed(SessionStore, SessionStore.of(implementation));
1374
1374
 
1375
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-output.js
1375
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-output.js
1376
1376
  var exports_tool_output = {};
1377
1377
  __export(exports_tool_output, {
1378
1378
  layerTest: () => layerTest7,
@@ -1448,7 +1448,7 @@ var bound = Function3.dual(2, (result, options) => Effect11.gen(function* () {
1448
1448
  return boundedFromOriginal(encoded, bytes, options.maxBytes, [path.value]);
1449
1449
  }));
1450
1450
 
1451
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/compaction.js
1451
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/compaction.js
1452
1452
  var exports_compaction = {};
1453
1453
  __export(exports_compaction, {
1454
1454
  withLifecycle: () => withLifecycle,
@@ -1471,7 +1471,7 @@ __export(exports_compaction, {
1471
1471
  import { Context as Context10, Effect as Effect14, Function as Function5, Layer as Layer11, Option as Option8, Schema as Schema11 } from "effect";
1472
1472
  import { LanguageModel as LanguageModel6, Prompt as Prompt6, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
1473
1473
 
1474
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/compaction-telemetry.js
1474
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/compaction-telemetry.js
1475
1475
  import { Clock, Effect as Effect12, Exit, Function as Function4, Option as Option7 } from "effect";
1476
1476
  import { LanguageModel as LanguageModel4 } from "effect/unstable/ai";
1477
1477
  var resultKind = (result) => Option7.isNone(result) ? "unchanged" : result.value._tag === "Summarize" ? "summarize" : "microcompact";
@@ -1507,7 +1507,7 @@ var summaryLanguageModel = Effect12.gen(function* () {
1507
1507
  return instrumentation === undefined ? model : instrumentation.wrap(model);
1508
1508
  });
1509
1509
 
1510
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/summary-model.js
1510
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/summary-model.js
1511
1511
  import { Context as Context9, Deferred, Effect as Effect13, Fiber as Fiber2, Layer as Layer10, Scope as Scope2 } from "effect";
1512
1512
  import { LanguageModel as LanguageModel5 } from "effect/unstable/ai";
1513
1513
  var makeSummaryModelProvider = (model) => {
@@ -1532,7 +1532,7 @@ var makeSummaryModelProvider = (model) => {
1532
1532
  });
1533
1533
  };
1534
1534
 
1535
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/compaction.js
1535
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/compaction.js
1536
1536
  var DEFAULT_RESERVE_TOKENS = 16384;
1537
1537
  var DEFAULT_KEEP_RECENT_TOKENS = 20000;
1538
1538
  var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
@@ -1790,7 +1790,7 @@ var truncate = (maxTokens) => ({
1790
1790
  });
1791
1791
  var layerTest8 = (implementation) => Layer11.succeed(Compaction, Compaction.of(implementation));
1792
1792
 
1793
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/instructions.js
1793
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/instructions.js
1794
1794
  var exports_instructions = {};
1795
1795
  __export(exports_instructions, {
1796
1796
  staticSource: () => staticSource,
@@ -1821,7 +1821,7 @@ var openEpoch = dual5(2, (instructions, context) => Effect15.gen(function* () {
1821
1821
  var layer3 = (sources) => Layer12.succeed(Instructions, Instructions.of({ sources: [...sources] }));
1822
1822
  var layerTest9 = (implementation) => Layer12.succeed(Instructions, Instructions.of(implementation));
1823
1823
 
1824
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-middleware.js
1824
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-middleware.js
1825
1825
  var exports_model_middleware = {};
1826
1826
  __export(exports_model_middleware, {
1827
1827
  layerIdentity: () => layerIdentity,
@@ -1835,7 +1835,7 @@ class ModelMiddleware extends Context12.Service()("@batonfx/core/ModelMiddleware
1835
1835
  var layerIdentity = Layer13.succeed(ModelMiddleware, []);
1836
1836
  var layer4 = (middleware) => Layer13.succeed(ModelMiddleware, middleware);
1837
1837
 
1838
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-resilience.js
1838
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-resilience.js
1839
1839
  var exports_model_resilience = {};
1840
1840
  __export(exports_model_resilience, {
1841
1841
  none: () => none,
@@ -1888,7 +1888,7 @@ var apply = Function6.dual(2, (model, resilience) => ({
1888
1888
  streamText: (options) => retryStream(() => model.streamText(options), (error) => Response6.makePart("error", { error }), resilience)
1889
1889
  }));
1890
1890
 
1891
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/permissions.js
1891
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/permissions.js
1892
1892
  var exports_permissions = {};
1893
1893
  __export(exports_permissions, {
1894
1894
  matches: () => matches,
@@ -2033,7 +2033,7 @@ var layerRuleStoreMemory = (initialRules = []) => Layer15.effect(RuleStore, Ref4
2033
2033
  var layerRuleStoreTest = (implementation) => Layer15.succeed(RuleStore, RuleStore.of(implementation));
2034
2034
  var layerTest11 = (implementation) => Layer15.succeed(Permissions, Permissions.of(implementation));
2035
2035
 
2036
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/skill-source.js
2036
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/skill-source.js
2037
2037
  var exports_skill_source = {};
2038
2038
  __export(exports_skill_source, {
2039
2039
  selectListings: () => selectListings,
@@ -2123,7 +2123,7 @@ var selectListings = Function7.dual(3, (skills, budgetTokens, recentlyUsed) => {
2123
2123
  return selected;
2124
2124
  });
2125
2125
 
2126
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/steering.js
2126
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/steering.js
2127
2127
  var exports_steering = {};
2128
2128
  __export(exports_steering, {
2129
2129
  layerTest: () => layerTest13,
@@ -2181,7 +2181,7 @@ var layer7 = (options = {}) => Layer17.effect(Steering, Effect20.gen(function* (
2181
2181
  }));
2182
2182
  var layerTest13 = (implementation) => Layer17.succeed(Steering, Steering.of(implementation));
2183
2183
 
2184
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent.js
2184
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent.js
2185
2185
  var exports_agent = {};
2186
2186
  __export(exports_agent, {
2187
2187
  stream: () => stream2,
@@ -2195,11 +2195,11 @@ import { Effect as Effect27, Option as Option17, Schema as Schema21, Stream as S
2195
2195
  import { dual as dual8 } from "effect/Function";
2196
2196
  import { AiError as AiError8, Chat as Chat3, LanguageModel as LanguageModel10, Prompt as Prompt12, Tool as Tool10, Toolkit as Toolkit5 } from "effect/unstable/ai";
2197
2197
 
2198
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-run.js
2198
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-run.js
2199
2199
  import { Cause as Cause6, Channel, Effect as Effect26, Equal as Equal3, Exit as Exit4, Fiber as Fiber3, HashMap as HashMap6, Option as Option16, Queue as Queue2, Ref as Ref5, Schema as Schema20, Semaphore as Semaphore3, Stream as Stream5 } from "effect";
2200
2200
  import { AiError as AiError7, Chat as Chat2, LanguageModel as LanguageModel9, Prompt as Prompt11, Response as Response11, Telemetry, Tokenizer as Tokenizer2, Tool as Tool9, Toolkit as Toolkit4 } from "effect/unstable/ai";
2201
2201
 
2202
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/model-instrumentation.js
2202
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/model-instrumentation.js
2203
2203
  import { Cause as Cause4, Clock as Clock2, Duration, Effect as Effect21, Exit as Exit3, Function as Function8, Option as Option12, Schedule as Schedule3, Stream as Stream4 } from "effect";
2204
2204
  import { AiError as AiError6, LanguageModel as LanguageModel8, Model as Model2, Response as Response7 } from "effect/unstable/ai";
2205
2205
  var makeIdentityCell = () => ({ current: undefined });
@@ -2454,7 +2454,7 @@ var instrument = Function8.dual(2, (model, options) => {
2454
2454
  };
2455
2455
  });
2456
2456
 
2457
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-authorization.js
2457
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-authorization.js
2458
2458
  import { Cause as Cause5, Context as Context17, Effect as Effect22, Layer as Layer18, Schema as Schema16 } from "effect";
2459
2459
  import"effect/unstable/ai";
2460
2460
  class PermissionDenied extends Schema16.TaggedErrorClass()("@batonfx/core/PermissionDenied", {
@@ -2528,7 +2528,7 @@ var make4 = (options) => ({
2528
2528
  })
2529
2529
  });
2530
2530
 
2531
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/tool-registry.js
2531
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/tool-registry.js
2532
2532
  import { Array as Array2, Effect as Effect23, HashMap as HashMap4, Option as Option13 } from "effect";
2533
2533
  import { dual as dual7 } from "effect/Function";
2534
2534
  import { Tool as Tool7, Toolkit as Toolkit3 } from "effect/unstable/ai";
@@ -2574,7 +2574,7 @@ var select = dual7(2, (registry, names) => {
2574
2574
  };
2575
2575
  });
2576
2576
 
2577
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-persistence-lock.js
2577
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-persistence-lock.js
2578
2578
  import { Context as Context18, Effect as Effect24, Layer as Layer19, RcMap, Scope as Scope3, Semaphore as Semaphore2 } from "effect";
2579
2579
  import { Chat } from "effect/unstable/ai";
2580
2580
 
@@ -2592,11 +2592,11 @@ var makeRuntime = Effect24.gen(function* () {
2592
2592
  });
2593
2593
  var layerRuntime = Layer19.effect(Runtime, makeRuntime);
2594
2594
 
2595
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-message.js
2595
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-message.js
2596
2596
  import { Effect as Effect25, Option as Option14, Schema as Schema18 } from "effect";
2597
2597
  import { Prompt as Prompt9, Response as Response8 } from "effect/unstable/ai";
2598
2598
 
2599
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-skill-tool.js
2599
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-skill-tool.js
2600
2600
  import { Schema as Schema17 } from "effect";
2601
2601
  import { Tool as Tool8 } from "effect/unstable/ai";
2602
2602
  var skillListingBudgetTokens = 2048;
@@ -2619,7 +2619,7 @@ var activateSkillTool = Tool8.make(activateSkillToolName, {
2619
2619
  failureMode: "return"
2620
2620
  });
2621
2621
 
2622
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-message.js
2622
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-message.js
2623
2623
  var withSystem = (instructions, prompt) => Prompt9.fromMessages([Prompt9.makeMessage("system", { content: instructions }), ...prompt.content]);
2624
2624
  var skillListingsInstructions = (listings) => `Available skills:
2625
2625
  ${listings}
@@ -2667,7 +2667,7 @@ var applyPartChain = (chain, part, context) => Effect25.gen(function* () {
2667
2667
  return current;
2668
2668
  });
2669
2669
 
2670
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-suspension.js
2670
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-suspension.js
2671
2671
  import { Equal as Equal2, Option as Option15, Schema as Schema19 } from "effect";
2672
2672
  import { Prompt as Prompt10, Response as Response9 } from "effect/unstable/ai";
2673
2673
  var suspensionCheckpointOption = "@batonfx/core/suspension";
@@ -2773,7 +2773,7 @@ var suspended = (call, toolCallBatch, toolCallIndex, token, reason) => AgentSusp
2773
2773
  tool_call_batch: toolCallBatch.calls
2774
2774
  });
2775
2775
 
2776
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-tool-result.js
2776
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-tool-result.js
2777
2777
  import { HashMap as HashMap5 } from "effect";
2778
2778
  import { Response as Response10 } from "effect/unstable/ai";
2779
2779
  var successResult = (call, outcome) => Response10.toolResultPart({
@@ -2795,7 +2795,7 @@ var domainFailureResult = (call, outcome) => Response10.toolResultPart({
2795
2795
  preliminary: false
2796
2796
  });
2797
2797
 
2798
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-run.js
2798
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-run.js
2799
2799
  var classifyOtherFailure = (error) => classify(error);
2800
2800
  var defaultProgressOverflowPolicy = { _tag: "Backpressure", capacity: 64 };
2801
2801
  var progressCapacitySchema = Schema20.Finite.pipe(Schema20.check(Schema20.isInt(), Schema20.isGreaterThan(0)));
@@ -3639,6 +3639,7 @@ var streamInternal = (agent, options, structured) => Stream5.unwrap(Effect26.gen
3639
3639
  })))));
3640
3640
  const attempt = (activePrompt, retryOverflow, compactOverflow = false, overflowCause) => {
3641
3641
  let emitted = false;
3642
+ let completed = false;
3642
3643
  let classifyFailure2 = classifyOtherFailure;
3643
3644
  const transformedParts = new Array;
3644
3645
  let preparedState;
@@ -3694,8 +3695,10 @@ var streamInternal = (agent, options, structured) => Stream5.unwrap(Effect26.gen
3694
3695
  accept: validateToolCallId(toolCallIds, part).pipe(Effect26.andThen(Effect26.sync(() => {
3695
3696
  transformedParts.push(part);
3696
3697
  })))
3697
- })));
3698
- })).pipe(Stream5.toChannel), (_, exit) => preparedState === undefined || Exit4.isFailure(exit) && retryableOverflow(exit.cause, emitted) ? Effect26.void : Ref5.set(chat.history, Prompt11.concat(Prompt11.concat(preparedState.history, preparedState.preparedPrompt), Prompt11.fromResponseParts(transformedParts))).pipe(Effect26.andThen(persisted === undefined ? Effect26.void : persisted.save), Effect26.orDie, Effect26.asVoid))).pipe(Stream5.catchCause((cause) => {
3698
+ })), Stream5.concat(Stream5.fromEffect(Effect26.sync(() => {
3699
+ completed = true;
3700
+ })).pipe(Stream5.drain)));
3701
+ })).pipe(Stream5.toChannel), (_, exit) => preparedState === undefined || !completed || Exit4.isFailure(exit) && retryableOverflow(exit.cause, emitted) ? Effect26.void : Ref5.set(chat.history, Prompt11.concat(Prompt11.concat(preparedState.history, preparedState.preparedPrompt), Prompt11.fromResponseParts(transformedParts))).pipe(Effect26.andThen(persisted === undefined ? Effect26.void : persisted.save), Effect26.orDie, Effect26.asVoid))).pipe(Stream5.catchCause((cause) => {
3699
3702
  if (Cause6.hasInterrupts(cause) || Cause6.hasDies(cause))
3700
3703
  return Stream5.failCause(cause);
3701
3704
  if (retryableOverflow(cause, emitted)) {
@@ -3933,7 +3936,7 @@ var streamInternal = (agent, options, structured) => Stream5.unwrap(Effect26.gen
3933
3936
  }));
3934
3937
  })).pipe(Stream5.withSpan("Baton.Agent.run", { attributes: { "baton.agent.name": agent.name } }));
3935
3938
 
3936
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent.js
3939
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent.js
3937
3940
  var AgentTypeId = Symbol.for("@batonfx/core/Agent");
3938
3941
  function make5(options) {
3939
3942
  const declaredTools = "tools" in options && Array.isArray(options.tools) ? options.tools : undefined;
@@ -3998,7 +4001,7 @@ var generate = dual8(2, (agent, options) => options.output === undefined ? gener
3998
4001
  objectPrompt: options.output.prompt ?? defaultObjectPrompt
3999
4002
  }));
4000
4003
 
4001
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/agent-tool.js
4004
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/agent-tool.js
4002
4005
  var exports_agent_tool = {};
4003
4006
  __export(exports_agent_tool, {
4004
4007
  asTool: () => asTool
@@ -4069,7 +4072,7 @@ var asTool = Function9.dual((args) => args.length !== 1 || ("name" in args[0]),
4069
4072
  return lazyHandled(toolkit, name, handler);
4070
4073
  });
4071
4074
 
4072
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/guardrail.js
4075
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/guardrail.js
4073
4076
  var exports_guardrail = {};
4074
4077
  __export(exports_guardrail, {
4075
4078
  validateInput: () => validateInput,
@@ -4150,7 +4153,7 @@ var filterOutput = (keep) => ({
4150
4153
  transformPart: (part, context) => Effect29.succeed(part.type === "tool-call" || keep(part, context) ? Option18.some(part) : Option18.none())
4151
4154
  });
4152
4155
 
4153
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/handoff.js
4156
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/handoff.js
4154
4157
  var exports_handoff = {};
4155
4158
  __export(exports_handoff, {
4156
4159
  transferTool: () => transferTool,
@@ -4230,7 +4233,7 @@ var supervisor = (options) => {
4230
4233
  };
4231
4234
  };
4232
4235
 
4233
- // ../../node_modules/.bun/@batonfx+core@0.11.5+74997d64abff4185/node_modules/@batonfx/core/dist/index.js
4236
+ // ../../node_modules/.bun/@batonfx+core@0.11.6+74997d64abff4185/node_modules/@batonfx/core/dist/index.js
4234
4237
  import { AiError as AiError10, Chat as Chat4, EmbeddingModel, IdGenerator as IdGenerator2, LanguageModel as LanguageModel12, Model as Model3, Prompt as Prompt16, Response as Response13, ResponseIdTracker, Telemetry as Telemetry2, Tokenizer as Tokenizer3, Tool as Tool13, Toolkit as Toolkit8 } from "effect/unstable/ai";
4235
4238
 
4236
4239
  export { exports_model_telemetry, exports_turn_policy, exports_agent_event, exports_memory, exports_context_overflow, exports_model_registry, exports_tool_context, exports_tool_executor, exports_approvals, exports_session, exports_tool_output, exports_compaction, exports_instructions, exports_model_middleware, exports_model_resilience, exports_permissions, exports_skill_source, exports_steering, exports_agent, exports_agent_tool, exports_guardrail, exports_handoff, AiError10 as AiError, Chat4 as Chat, EmbeddingModel, IdGenerator2 as IdGenerator, Model3 as Model, Prompt16 as Prompt, Response13 as Response, ResponseIdTracker, Telemetry2 as Telemetry, Tokenizer3 as Tokenizer, Tool13 as Tool, Toolkit8 as Toolkit };
@@ -17,7 +17,7 @@ import {
17
17
  exports_tool_executor,
18
18
  exports_tool_output,
19
19
  exports_turn_policy
20
- } from "./index-8yv2a8ce.js";
20
+ } from "./index-58425087.js";
21
21
  import {
22
22
  ClientError,
23
23
  EventLogCursorNotFound,
@@ -8,7 +8,7 @@ import {
8
8
  SqlFailure,
9
9
  make,
10
10
  normalizeAcquisitionCause
11
- } from "./index-ny80vfgx.js";
11
+ } from "./index-8dmwyvx7.js";
12
12
 
13
13
  // src/migration-errors.ts
14
14
  import { Cause, Effect, Function } from "effect";
package/dist/index.js CHANGED
@@ -14,11 +14,11 @@ import {
14
14
  exports_tool_runtime,
15
15
  exports_workflow_definition_host,
16
16
  makeDatabaseIdentity
17
- } from "./index-ny80vfgx.js";
17
+ } from "./index-8dmwyvx7.js";
18
18
  import {
19
19
  exports_context_overflow,
20
20
  exports_model_registry
21
- } from "./index-8yv2a8ce.js";
21
+ } from "./index-58425087.js";
22
22
  import {
23
23
  ClientError,
24
24
  EventLogCursorNotFound,
@@ -179,11 +179,11 @@ import { OpenAiLanguageModel as OpenAiLanguageModel3 } from "@effect/ai-openai";
179
179
  import { OpenAiLanguageModel as OpenAiCompatibleLanguageModel } from "@effect/ai-openai-compat";
180
180
  import { OpenRouterLanguageModel as OpenRouterLanguageModel2 } from "@effect/ai-openrouter";
181
181
 
182
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
182
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
183
183
  import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
184
184
  import { Config, Layer as Layer3, Redacted } from "effect";
185
185
 
186
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/image-source.js
186
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/image-source.js
187
187
  import { Effect as Effect3, Encoding, Layer as Layer2, Result, Stream } from "effect";
188
188
  import { AiError, LanguageModel, Prompt } from "effect/unstable/ai";
189
189
  var imageMediaTypes = new Set(["image/gif", "image/jpeg", "image/png", "image/webp"]);
@@ -252,7 +252,7 @@ var conformImageSourceModel = (model) => {
252
252
  };
253
253
  var layerImageSources = (layer2) => Layer2.effect(LanguageModel.LanguageModel, Effect3.map(LanguageModel.LanguageModel, conformImageSourceModel)).pipe(Layer2.provide(layer2));
254
254
 
255
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
255
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/anthropic.js
256
256
  var classifyFailure = exports_context_overflow.classify;
257
257
  var layer2 = (input) => exports_model_registry.layer([
258
258
  exports_model_registry.registration({
@@ -269,13 +269,13 @@ var layer2 = (input) => exports_model_registry.layer([
269
269
  ]).pipe(Layer3.provide(AnthropicClient.layerConfig({ ...input.clientConfig, apiKey: input.apiKey })));
270
270
  var layerConfig = AnthropicClient.layerConfig;
271
271
 
272
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
272
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
273
273
  import { OpenAiClient as OpenAiClient2 } from "@effect/ai-openai";
274
274
  import { Config as Config3, Effect as Effect5, Layer as Layer5, Option as Option2, Stream as Stream3 } from "effect";
275
275
  import { LanguageModel as LanguageModel2, Response as Response2 } from "effect/unstable/ai";
276
276
  import { HttpClient as HttpClient2 } from "effect/unstable/http";
277
277
 
278
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/openai.js
278
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/openai.js
279
279
  import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai";
280
280
  import { Config as Config2, Effect as Effect4, Function, Layer as Layer4, Option, Redacted as Redacted2, Schema, Stream as Stream2 } from "effect";
281
281
  import { FetchHttpClient, Headers, HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/unstable/http";
@@ -445,7 +445,7 @@ var registrationAccount = (input) => exports_model_registry.registration({
445
445
  });
446
446
  var layerAccount = (input) => exports_model_registry.layer([registrationAccount(input)]);
447
447
 
448
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
448
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/deterministic.js
449
449
  var deterministicModelLayer = Layer5.effect(LanguageModel2.LanguageModel, LanguageModel2.make({
450
450
  generateText: () => Effect5.succeed([{ type: "text", text: "deterministic response" }]),
451
451
  streamText: () => Stream3.make(Response2.makePart("text-delta", { id: "text", delta: "deterministic response" }))
@@ -482,7 +482,7 @@ var layerOpenAi = (options) => Layer5.unwrap(Effect5.gen(function* () {
482
482
  ]);
483
483
  }));
484
484
 
485
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/openai-compat.js
485
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/openai-compat.js
486
486
  import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
487
487
  import { Config as Config4, Layer as Layer6, Redacted as Redacted3 } from "effect";
488
488
  var layer5 = (input) => exports_model_registry.layer([
@@ -504,7 +504,7 @@ var layer5 = (input) => exports_model_registry.layer([
504
504
  })));
505
505
  var layerConfig3 = OpenAiClient3.layerConfig;
506
506
 
507
- // ../../node_modules/.bun/@batonfx+providers@0.11.5+74997d64abff4185/node_modules/@batonfx/providers/dist/openrouter.js
507
+ // ../../node_modules/.bun/@batonfx+providers@0.11.6+74997d64abff4185/node_modules/@batonfx/providers/dist/openrouter.js
508
508
  import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
509
509
  import { Config as Config5, Layer as Layer7, Redacted as Redacted4 } from "effect";
510
510
  var classifyFailure3 = exports_context_overflow.classify;
package/dist/mysql.js CHANGED
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-3tdatbg4.js";
5
+ } from "./index-hwfe65v0.js";
6
6
  import {
7
7
  MigratorError,
8
8
  RuntimeMigrationError,
9
9
  SqlFailure
10
- } from "./index-ny80vfgx.js";
11
- import"./index-8yv2a8ce.js";
10
+ } from "./index-8dmwyvx7.js";
11
+ import"./index-58425087.js";
12
12
  import"./index-nb078xsy.js";
13
13
  import"./index-nb39b5ae.js";
14
14
 
package/dist/postgres.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-3tdatbg4.js";
5
+ } from "./index-hwfe65v0.js";
6
6
  import {
7
7
  Dialect,
8
8
  RuntimeMigrationError,
@@ -14,8 +14,8 @@ import {
14
14
  fromDbTimestamp,
15
15
  fromNullableDbTimestamp,
16
16
  timestampParam
17
- } from "./index-ny80vfgx.js";
18
- import"./index-8yv2a8ce.js";
17
+ } from "./index-8dmwyvx7.js";
18
+ import"./index-58425087.js";
19
19
  import {
20
20
  exports_ids_schema
21
21
  } from "./index-nb078xsy.js";
package/dist/sqlite.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-3tdatbg4.js";
5
+ } from "./index-hwfe65v0.js";
6
6
  import {
7
7
  DatabaseAlreadyOwned,
8
8
  RuntimeConfigurationError,
@@ -12,8 +12,8 @@ import {
12
12
  make,
13
13
  makeDatabaseIdentity,
14
14
  runtimeLayer
15
- } from "./index-ny80vfgx.js";
16
- import"./index-8yv2a8ce.js";
15
+ } from "./index-8dmwyvx7.js";
16
+ import"./index-58425087.js";
17
17
  import"./index-nb078xsy.js";
18
18
  import"./index-nb39b5ae.js";
19
19
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@relayfx/sdk",
4
- "version": "0.7.7",
4
+ "version": "0.7.8",
5
5
  "description": "Effect-native durable execution SDK for addressable agents and tools",
6
6
  "type": "module",
7
7
  "exports": {
@@ -57,8 +57,8 @@
57
57
  "typecheck": "bun tsc --noEmit"
58
58
  },
59
59
  "dependencies": {
60
- "@batonfx/core": "0.11.5",
61
- "@batonfx/providers": "0.11.5",
60
+ "@batonfx/core": "0.11.6",
61
+ "@batonfx/providers": "0.11.6",
62
62
  "@effect/ai-anthropic": "4.0.0-beta.98",
63
63
  "@effect/ai-openai": "4.0.0-beta.98",
64
64
  "@effect/ai-openai-compat": "4.0.0-beta.98",
@@ -75,7 +75,7 @@
75
75
  "@effect/vitest": "4.0.0-beta.98",
76
76
  "@relayfx/ai": "0.0.0",
77
77
  "@relayfx/runtime": "0.0.0",
78
- "@relayfx/schema": "0.7.7",
78
+ "@relayfx/schema": "0.7.8",
79
79
  "@relayfx/store-sql": "0.0.0",
80
80
  "@types/bun": "1.3.14",
81
81
  "typescript": "7.0.2",