@relayfx/sdk 0.3.5 → 0.3.7
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 +1 -1
- package/dist/http-server.js +1 -1
- package/dist/{index-cq8t8ka1.js → index-8awt651b.js} +513 -250
- package/dist/{index-5dqkw53p.js → index-h8rx4xya.js} +1 -1
- package/dist/{index-cyfx5y3r.js → index-pw46cfne.js} +14 -6
- package/dist/{index-8fpd6kvj.js → index-t5bbk8cp.js} +109 -56
- package/dist/index.js +9 -9
- package/dist/mysql.js +4 -4
- package/dist/postgres.js +4 -4
- package/dist/sqlite.js +4 -4
- package/dist/types/relay/operation.d.ts +3 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +3 -0
- package/dist/types/runtime/agent/relay-permissions.d.ts +0 -1
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +2 -2
- package/dist/types/runtime/agent/sequence-allocator.d.ts +1 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +3 -1
- package/dist/types/runtime/tool/tool-runtime-contract.d.ts +4 -1
- package/dist/types/runtime/tool/tool-runtime-identifiers.d.ts +9 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +1 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +6 -0
- package/dist/types/schema/agent-schema.d.ts +24 -0
- package/dist/types/schema/execution-schema.d.ts +3 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +10 -1
- package/package.json +3 -3
|
@@ -442,6 +442,9 @@ var DefinitionSchema = Schema5.Struct({
|
|
|
442
442
|
skill_definition_ids: Schema5.optionalKey(Schema5.Array(SkillDefinitionId)),
|
|
443
443
|
permission_rules: Schema5.optionalKey(PermissionRuleset),
|
|
444
444
|
turn_policy: Schema5.optionalKey(TurnPolicySnapshot),
|
|
445
|
+
tool_execution: Schema5.optionalKey(Schema5.Struct({
|
|
446
|
+
concurrency: PositiveSafeInteger
|
|
447
|
+
})),
|
|
445
448
|
compaction_policy: Schema5.optionalKey(CompactionPolicy),
|
|
446
449
|
max_tool_turns: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(1))),
|
|
447
450
|
max_wait_turns: Schema5.optionalKey(Schema5.Int.check(Schema5.isGreaterThanOrEqualTo(0))),
|
|
@@ -463,6 +466,7 @@ var define = (input) => ({
|
|
|
463
466
|
...input.skill_definition_ids === undefined ? {} : { skill_definition_ids: input.skill_definition_ids },
|
|
464
467
|
...input.permission_rules === undefined ? {} : { permission_rules: input.permission_rules },
|
|
465
468
|
...input.turn_policy === undefined ? {} : { turn_policy: input.turn_policy },
|
|
469
|
+
...input.tool_execution === undefined ? {} : { tool_execution: input.tool_execution },
|
|
466
470
|
...input.compaction_policy === undefined ? {} : { compaction_policy: input.compaction_policy },
|
|
467
471
|
...input.max_tool_turns === undefined ? {} : { max_tool_turns: input.max_tool_turns },
|
|
468
472
|
...input.max_wait_turns === undefined ? {} : { max_wait_turns: input.max_wait_turns },
|
|
@@ -1114,42 +1118,46 @@ var Classification = Schema17.Union([
|
|
|
1114
1118
|
TimerWait,
|
|
1115
1119
|
ExternalWait
|
|
1116
1120
|
]).annotate({ identifier: "Relay.WaitClassification" });
|
|
1117
|
-
var
|
|
1121
|
+
var scopedToolCallId = (waitId, namespace) => {
|
|
1122
|
+
const scope = waitId.slice(namespace.length);
|
|
1123
|
+
const separator = scope.indexOf(":");
|
|
1124
|
+
return ToolCallId.make(decodeURIComponent(scope.slice(separator + 1)));
|
|
1125
|
+
};
|
|
1118
1126
|
var classify = (input) => {
|
|
1119
1127
|
const waitId = input.wait_id;
|
|
1120
1128
|
if (waitId.startsWith("wait:permission:")) {
|
|
1121
1129
|
return {
|
|
1122
1130
|
kind: "permission",
|
|
1123
1131
|
wait_id: waitId,
|
|
1124
|
-
tool_call_id:
|
|
1132
|
+
tool_call_id: scopedToolCallId(waitId, "wait:permission:")
|
|
1125
1133
|
};
|
|
1126
1134
|
}
|
|
1127
1135
|
if (waitId.startsWith("wait:approval:")) {
|
|
1128
1136
|
return {
|
|
1129
1137
|
kind: "tool_approval",
|
|
1130
1138
|
wait_id: waitId,
|
|
1131
|
-
tool_call_id:
|
|
1139
|
+
tool_call_id: scopedToolCallId(waitId, "wait:approval:")
|
|
1132
1140
|
};
|
|
1133
1141
|
}
|
|
1134
1142
|
if (waitId.startsWith("wait:child:")) {
|
|
1135
1143
|
return {
|
|
1136
1144
|
kind: "child_join",
|
|
1137
1145
|
wait_id: waitId,
|
|
1138
|
-
child_execution_id: ChildExecutionId.make(
|
|
1146
|
+
child_execution_id: ChildExecutionId.make(waitId.slice("wait:child:".length))
|
|
1139
1147
|
};
|
|
1140
1148
|
}
|
|
1141
1149
|
if (waitId.startsWith("wait:inbox:")) {
|
|
1142
1150
|
return {
|
|
1143
1151
|
kind: "inbox",
|
|
1144
1152
|
wait_id: waitId,
|
|
1145
|
-
tool_call_id: ToolCallId.make(
|
|
1153
|
+
tool_call_id: ToolCallId.make(waitId.slice("wait:inbox:".length))
|
|
1146
1154
|
};
|
|
1147
1155
|
}
|
|
1148
1156
|
if (waitId.startsWith("wait:tool:")) {
|
|
1149
1157
|
return {
|
|
1150
1158
|
kind: "tool_placement",
|
|
1151
1159
|
wait_id: waitId,
|
|
1152
|
-
tool_call_id:
|
|
1160
|
+
tool_call_id: scopedToolCallId(waitId, "wait:tool:")
|
|
1153
1161
|
};
|
|
1154
1162
|
}
|
|
1155
1163
|
if (waitId.startsWith("wait:reply:") || input.envelope_id !== undefined && input.mode === "reply") {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__export
|
|
4
4
|
} from "./index-nb39b5ae.js";
|
|
5
5
|
|
|
6
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
6
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/turn-policy.js
|
|
7
7
|
var exports_turn_policy = {};
|
|
8
8
|
__export(exports_turn_policy, {
|
|
9
9
|
untilToolCall: () => untilToolCall,
|
|
@@ -74,7 +74,7 @@ var both = dual(2, (first, second) => ({
|
|
|
74
74
|
}));
|
|
75
75
|
var defaultPolicy = forever;
|
|
76
76
|
|
|
77
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
77
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/agent-event.js
|
|
78
78
|
var exports_agent_event = {};
|
|
79
79
|
__export(exports_agent_event, {
|
|
80
80
|
addUsage: () => addUsage,
|
|
@@ -169,9 +169,18 @@ class AgentSuspended extends Schema2.TaggedErrorClass()("@batonfx/core/AgentSusp
|
|
|
169
169
|
token: Schema2.String,
|
|
170
170
|
reason: Schema2.Literals(["tool-wait", "approval"]),
|
|
171
171
|
authorization_stage: Schema2.optional(Schema2.Literals(["permission", "approval"])),
|
|
172
|
+
tool_call_index: Schema2.optional(Schema2.Int.check(Schema2.isGreaterThanOrEqualTo(0))),
|
|
172
173
|
tool_call_id: Schema2.String,
|
|
173
174
|
tool_name: Schema2.String,
|
|
174
175
|
tool_params: Schema2.Unknown,
|
|
176
|
+
tool_call_batch: Schema2.Array(Schema2.Struct({
|
|
177
|
+
type: Schema2.Literal("tool-call"),
|
|
178
|
+
id: Schema2.String,
|
|
179
|
+
name: Schema2.String,
|
|
180
|
+
params: Schema2.Unknown,
|
|
181
|
+
providerExecuted: Schema2.Boolean,
|
|
182
|
+
metadata: Response2.ProviderMetadata
|
|
183
|
+
})),
|
|
175
184
|
active_tools: Schema2.optional(Schema2.Array(Schema2.String)),
|
|
176
185
|
activated_skills: Schema2.optional(Schema2.Array(Schema2.String))
|
|
177
186
|
}) {
|
|
@@ -184,7 +193,7 @@ class ResumeMismatch extends Schema2.TaggedErrorClass()("@batonfx/core/ResumeMis
|
|
|
184
193
|
}) {
|
|
185
194
|
}
|
|
186
195
|
|
|
187
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
196
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/tool-context.js
|
|
188
197
|
var exports_tool_context = {};
|
|
189
198
|
__export(exports_tool_context, {
|
|
190
199
|
testLayer: () => testLayer,
|
|
@@ -202,7 +211,7 @@ var layerDefault = Layer2.sync(ToolContext, () => ToolContext.of({
|
|
|
202
211
|
}));
|
|
203
212
|
var testLayer = (implementation) => Layer2.succeed(ToolContext, ToolContext.of(implementation));
|
|
204
213
|
|
|
205
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
214
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/tool-executor.js
|
|
206
215
|
var exports_tool_executor = {};
|
|
207
216
|
__export(exports_tool_executor, {
|
|
208
217
|
testLayer: () => testLayer2,
|
|
@@ -427,7 +436,7 @@ function router(routes) {
|
|
|
427
436
|
}
|
|
428
437
|
var testLayer2 = (implementation) => Layer3.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
429
438
|
|
|
430
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
439
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/approvals.js
|
|
431
440
|
var exports_approvals = {};
|
|
432
441
|
__export(exports_approvals, {
|
|
433
442
|
testLayer: () => testLayer3,
|
|
@@ -442,7 +451,7 @@ var autoApprove = Layer4.succeed(Approvals, Approvals.of({ check: () => Effect4.
|
|
|
442
451
|
var denyAll = Layer4.succeed(Approvals, Approvals.of({ check: () => Effect4.succeed({ _tag: "Denied" }) }));
|
|
443
452
|
var testLayer3 = (implementation) => Layer4.succeed(Approvals, Approvals.of(implementation));
|
|
444
453
|
|
|
445
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
454
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/memory.js
|
|
446
455
|
var exports_memory = {};
|
|
447
456
|
__export(exports_memory, {
|
|
448
457
|
testLayer: () => testLayer4,
|
|
@@ -510,7 +519,7 @@ var layerNoop = Layer5.succeed(Memory, Memory.of(noop));
|
|
|
510
519
|
var noopLayer = layerNoop;
|
|
511
520
|
var testLayer4 = (implementation) => Layer5.succeed(Memory, Memory.of(implementation));
|
|
512
521
|
|
|
513
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
522
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/session.js
|
|
514
523
|
var exports_session = {};
|
|
515
524
|
__export(exports_session, {
|
|
516
525
|
testLayer: () => testLayer5,
|
|
@@ -789,7 +798,7 @@ var layerMemory = Layer6.effect(SessionStore, Ref.make(initialState).pipe(Effect
|
|
|
789
798
|
var memoryLayer = layerMemory;
|
|
790
799
|
var testLayer5 = (implementation) => Layer6.succeed(SessionStore, SessionStore.of(implementation));
|
|
791
800
|
|
|
792
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
801
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/tool-output.js
|
|
793
802
|
var exports_tool_output = {};
|
|
794
803
|
__export(exports_tool_output, {
|
|
795
804
|
testLayer: () => testLayer6,
|
|
@@ -865,7 +874,7 @@ var bound = Function2.dual(2, (result, options) => Effect7.gen(function* () {
|
|
|
865
874
|
return boundedFromOriginal(encoded, bytes, options.maxBytes, [path.value]);
|
|
866
875
|
}));
|
|
867
876
|
|
|
868
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
877
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/compaction.js
|
|
869
878
|
var exports_compaction = {};
|
|
870
879
|
__export(exports_compaction, {
|
|
871
880
|
truncate: () => truncate,
|
|
@@ -1134,7 +1143,7 @@ var truncate = (maxTokens) => ({
|
|
|
1134
1143
|
});
|
|
1135
1144
|
var testLayer7 = (implementation) => Layer8.succeed(Compaction, Compaction.of(implementation));
|
|
1136
1145
|
|
|
1137
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1146
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/instructions.js
|
|
1138
1147
|
var exports_instructions = {};
|
|
1139
1148
|
__export(exports_instructions, {
|
|
1140
1149
|
testLayer: () => testLayer8,
|
|
@@ -1183,7 +1192,7 @@ var renderUpdate = dual3(2, (epoch, context) => Effect9.gen(function* () {
|
|
|
1183
1192
|
var layer2 = (sources) => Layer9.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
1184
1193
|
var testLayer8 = (implementation) => Layer9.succeed(Instructions, Instructions.of(implementation));
|
|
1185
1194
|
|
|
1186
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1195
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/model-middleware.js
|
|
1187
1196
|
var exports_model_middleware = {};
|
|
1188
1197
|
__export(exports_model_middleware, {
|
|
1189
1198
|
layerIdentity: () => layerIdentity,
|
|
@@ -1199,7 +1208,7 @@ var layerIdentity = Layer10.succeed(ModelMiddleware, []);
|
|
|
1199
1208
|
var identityLayer = layerIdentity;
|
|
1200
1209
|
var layer3 = (middleware) => Layer10.succeed(ModelMiddleware, middleware);
|
|
1201
1210
|
|
|
1202
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1211
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/model-registry.js
|
|
1203
1212
|
var exports_model_registry = {};
|
|
1204
1213
|
__export(exports_model_registry, {
|
|
1205
1214
|
testLayer: () => testLayer9,
|
|
@@ -1326,7 +1335,7 @@ var operate = Function4.dual(2, (selection, effect) => Effect11.gen(function* ()
|
|
|
1326
1335
|
var stream = Function4.dual(2, (selection, operation) => Stream2.unwrap(Service.pipe(Effect11.map((service) => service.stream(selection, operation)))));
|
|
1327
1336
|
var provide = operate;
|
|
1328
1337
|
|
|
1329
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1338
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/model-resilience.js
|
|
1330
1339
|
var exports_model_resilience = {};
|
|
1331
1340
|
__export(exports_model_resilience, {
|
|
1332
1341
|
testLayer: () => testLayer10,
|
|
@@ -1379,7 +1388,7 @@ var apply = Function5.dual(2, (model, resilience) => ({
|
|
|
1379
1388
|
streamText: (options) => retryStream(() => model.streamText(options), (error) => Response5.makePart("error", { error }), resilience)
|
|
1380
1389
|
}));
|
|
1381
1390
|
|
|
1382
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1391
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/permissions.js
|
|
1383
1392
|
var exports_permissions = {};
|
|
1384
1393
|
__export(exports_permissions, {
|
|
1385
1394
|
testLayer: () => testLayer11,
|
|
@@ -1513,7 +1522,7 @@ var ruleStoreMemory = (initialRules = []) => Layer13.effect(RuleStore, Ref4.make
|
|
|
1513
1522
|
var ruleStoreTestLayer = (implementation) => Layer13.succeed(RuleStore, RuleStore.of(implementation));
|
|
1514
1523
|
var testLayer11 = (implementation) => Layer13.succeed(Permissions, Permissions.of(implementation));
|
|
1515
1524
|
|
|
1516
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1525
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/skill-source.js
|
|
1517
1526
|
var exports_skill_source = {};
|
|
1518
1527
|
__export(exports_skill_source, {
|
|
1519
1528
|
testLayer: () => testLayer12,
|
|
@@ -1593,7 +1602,7 @@ var selectListings = Function6.dual(3, (skills, budgetTokens, recentlyUsed) => {
|
|
|
1593
1602
|
return selected;
|
|
1594
1603
|
});
|
|
1595
1604
|
|
|
1596
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1605
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/steering.js
|
|
1597
1606
|
var exports_steering = {};
|
|
1598
1607
|
__export(exports_steering, {
|
|
1599
1608
|
testLayer: () => testLayer13,
|
|
@@ -1651,7 +1660,7 @@ var layer7 = (options = {}) => Layer15.effect(Steering, Effect15.gen(function* (
|
|
|
1651
1660
|
}));
|
|
1652
1661
|
var testLayer13 = (implementation) => Layer15.succeed(Steering, Steering.of(implementation));
|
|
1653
1662
|
|
|
1654
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1663
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/agent.js
|
|
1655
1664
|
var exports_agent = {};
|
|
1656
1665
|
__export(exports_agent, {
|
|
1657
1666
|
streamObject: () => streamObject,
|
|
@@ -1670,7 +1679,7 @@ import { Cause as Cause4, Channel, Effect as Effect18, Equal, Exit as Exit2, Fib
|
|
|
1670
1679
|
import { dual as dual7 } from "effect/Function";
|
|
1671
1680
|
import { AiError as AiError3, Chat, LanguageModel as LanguageModel5, Prompt as Prompt9, Response as Response7, Telemetry, Tokenizer as Tokenizer2, Tool as Tool7, Toolkit as Toolkit4 } from "effect/unstable/ai";
|
|
1672
1681
|
|
|
1673
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1682
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/tool-authorization.js
|
|
1674
1683
|
import { Cause as Cause3, Context as Context15, Effect as Effect16, Layer as Layer16, Option as Option10, Schema as Schema13 } from "effect";
|
|
1675
1684
|
import { dual as dual5 } from "effect/Function";
|
|
1676
1685
|
import { Prompt as Prompt8, Response as Response6, Tool as Tool5 } from "effect/unstable/ai";
|
|
@@ -1697,6 +1706,7 @@ var suspension = (request, token, stage) => ({
|
|
|
1697
1706
|
tool_call_id: request.call.id,
|
|
1698
1707
|
tool_name: request.call.name,
|
|
1699
1708
|
tool_params: request.call.params,
|
|
1709
|
+
tool_call_batch: request.execution.toolCallBatch.calls,
|
|
1700
1710
|
active_tools: request.activeTools,
|
|
1701
1711
|
activated_skills: request.activatedSkills
|
|
1702
1712
|
})
|
|
@@ -1841,7 +1851,7 @@ var make4 = (options = {}) => ({
|
|
|
1841
1851
|
});
|
|
1842
1852
|
var fromPermissions = dual5((args) => args.length === 2 || args.length === 1 && ("evaluate" in args[0]), (permissions, options = {}) => make4({ ...options, permissions }));
|
|
1843
1853
|
|
|
1844
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1854
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/tool-registry.js
|
|
1845
1855
|
import { Effect as Effect17, HashMap as HashMap3, Option as Option11 } from "effect";
|
|
1846
1856
|
import { dual as dual6 } from "effect/Function";
|
|
1847
1857
|
import { Tool as Tool6, Toolkit as Toolkit3 } from "effect/unstable/ai";
|
|
@@ -1894,7 +1904,7 @@ var select = dual6(2, (registry, names) => {
|
|
|
1894
1904
|
};
|
|
1895
1905
|
});
|
|
1896
1906
|
|
|
1897
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
1907
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/agent.js
|
|
1898
1908
|
var AgentTypeId = Symbol.for("@batonfx/core/Agent");
|
|
1899
1909
|
var ModelLayerTypeId = Symbol.for("@batonfx/core/Agent/ModelLayer");
|
|
1900
1910
|
var classifyOtherFailure = () => "other";
|
|
@@ -1996,6 +2006,8 @@ var suspensionMetadata = Schema14.Struct({
|
|
|
1996
2006
|
token: Schema14.String,
|
|
1997
2007
|
reason: Schema14.Literals(["tool-wait", "approval"]),
|
|
1998
2008
|
authorization_stage: Schema14.optional(Schema14.Literals(["permission", "approval"])),
|
|
2009
|
+
tool_call_index: Schema14.optional(Schema14.Int.check(Schema14.isGreaterThanOrEqualTo(0))),
|
|
2010
|
+
tool_call_batch_ids: Schema14.Array(Schema14.String),
|
|
1999
2011
|
active_tools: Schema14.optional(Schema14.Array(Schema14.String)),
|
|
2000
2012
|
activated_skills: Schema14.optional(Schema14.Array(Schema14.String))
|
|
2001
2013
|
});
|
|
@@ -2010,7 +2022,7 @@ var releasePersistedChatLock = (persistence, chatId, lock) => {
|
|
|
2010
2022
|
if (locks.size === 0)
|
|
2011
2023
|
persistenceLocks.delete(persistence);
|
|
2012
2024
|
};
|
|
2013
|
-
var unresolvedToolCall = (messages) => {
|
|
2025
|
+
var unresolvedToolCall = (messages, toolCallId) => {
|
|
2014
2026
|
const unpaired = new Map;
|
|
2015
2027
|
const ambiguous = new Set;
|
|
2016
2028
|
for (const [messageIndex, message] of messages.entries()) {
|
|
@@ -2039,12 +2051,22 @@ var unresolvedToolCall = (messages) => {
|
|
|
2039
2051
|
}
|
|
2040
2052
|
}
|
|
2041
2053
|
const unresolved = [...unpaired.entries()].flatMap(([id, occurrences]) => ambiguous.has(id) ? [] : occurrences.filter(({ call }) => !call.providerExecuted));
|
|
2042
|
-
const pending = unresolved[
|
|
2043
|
-
|
|
2054
|
+
const pending = toolCallId === undefined ? unresolved.find(({ call }) => Option12.isSome(Schema14.decodeUnknownOption(suspensionMetadata)(call.options[suspensionCheckpointOption]))) : unresolved.find(({ call }) => call.id === toolCallId);
|
|
2055
|
+
const pendingMessage = pending === undefined ? undefined : messages[pending.messageIndex];
|
|
2056
|
+
const toolCallBatch = pendingMessage?.role === "assistant" ? pendingMessage.content.flatMap((part) => part.type === "tool-call" && !part.providerExecuted ? [
|
|
2057
|
+
Response7.makePart("tool-call", {
|
|
2058
|
+
id: part.id,
|
|
2059
|
+
name: part.name,
|
|
2060
|
+
params: part.params,
|
|
2061
|
+
providerExecuted: false
|
|
2062
|
+
})
|
|
2063
|
+
] : []) : [];
|
|
2064
|
+
return pending !== undefined ? {
|
|
2044
2065
|
call: pending.call,
|
|
2045
2066
|
messages: messages.slice(0, pending.messageIndex),
|
|
2046
2067
|
messageIndex: pending.messageIndex,
|
|
2047
|
-
partIndex: pending.partIndex
|
|
2068
|
+
partIndex: pending.partIndex,
|
|
2069
|
+
toolCallBatch
|
|
2048
2070
|
} : undefined;
|
|
2049
2071
|
};
|
|
2050
2072
|
var suspensionCheckpoint = (messages) => {
|
|
@@ -2054,18 +2076,21 @@ var suspensionCheckpoint = (messages) => {
|
|
|
2054
2076
|
const metadata = Schema14.decodeUnknownOption(suspensionMetadata)(unresolved.call.options[suspensionCheckpointOption]);
|
|
2055
2077
|
if (Option12.isNone(metadata))
|
|
2056
2078
|
return;
|
|
2079
|
+
if (!Equal.equals(metadata.value.tool_call_batch_ids, unresolved.toolCallBatch.map((call) => call.id)))
|
|
2080
|
+
return;
|
|
2057
2081
|
return {
|
|
2058
2082
|
call: unresolved.call,
|
|
2059
2083
|
messages: unresolved.messages,
|
|
2060
2084
|
suspension: AgentSuspended.make({
|
|
2061
2085
|
...metadata.value,
|
|
2086
|
+
tool_call_batch: unresolved.toolCallBatch,
|
|
2062
2087
|
tool_call_id: unresolved.call.id,
|
|
2063
2088
|
tool_name: unresolved.call.name,
|
|
2064
2089
|
tool_params: unresolved.call.params
|
|
2065
2090
|
})
|
|
2066
2091
|
};
|
|
2067
2092
|
};
|
|
2068
|
-
var sameSuspension = (left, right) => left.token === right.token && left.reason === right.reason && left.authorization_stage === right.authorization_stage && left.tool_call_id === right.tool_call_id && left.tool_name === right.tool_name && Equal.equals(left.tool_params, right.tool_params) && Equal.equals(left.active_tools, right.active_tools) && Equal.equals(left.activated_skills, right.activated_skills);
|
|
2093
|
+
var sameSuspension = (left, right) => left.token === right.token && left.reason === right.reason && left.authorization_stage === right.authorization_stage && left.tool_call_index === right.tool_call_index && Equal.equals(left.tool_call_batch, right.tool_call_batch) && left.tool_call_id === right.tool_call_id && left.tool_name === right.tool_name && Equal.equals(left.tool_params, right.tool_params) && Equal.equals(left.active_tools, right.active_tools) && Equal.equals(left.activated_skills, right.activated_skills);
|
|
2069
2094
|
var skillListingBudgetTokens = 2048;
|
|
2070
2095
|
var activateSkillToolName = "activate_skill";
|
|
2071
2096
|
var activateSkillParameters = Schema14.Struct({ name: Schema14.String });
|
|
@@ -2121,12 +2146,14 @@ var domainFailureResult = (call, outcome) => Response7.toolResultPart({
|
|
|
2121
2146
|
providerExecuted: false,
|
|
2122
2147
|
preliminary: false
|
|
2123
2148
|
});
|
|
2124
|
-
var suspended = (call, token, reason) => AgentSuspended.make({
|
|
2149
|
+
var suspended = (call, toolCallBatch, toolCallIndex, token, reason) => AgentSuspended.make({
|
|
2125
2150
|
token,
|
|
2126
2151
|
reason,
|
|
2152
|
+
tool_call_index: toolCallIndex,
|
|
2127
2153
|
tool_call_id: call.id,
|
|
2128
2154
|
tool_name: call.name,
|
|
2129
|
-
tool_params: call.params
|
|
2155
|
+
tool_params: call.params,
|
|
2156
|
+
tool_call_batch: toolCallBatch.calls
|
|
2130
2157
|
});
|
|
2131
2158
|
var withSystem = (instructions, prompt) => Prompt9.fromMessages([Prompt9.makeMessage("system", { content: instructions }), ...prompt.content]);
|
|
2132
2159
|
var skillListingsInstructions = (listings) => `Available skills:
|
|
@@ -2347,7 +2374,7 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2347
2374
|
const appendPending = (turn, pending) => pending.length === 0 ? Ref5.get(chat.history) : Ref5.updateAndGet(chat.history, (history) => Prompt9.concat(history, Prompt9.fromResponseParts(pending))).pipe(Effect18.tap(() => savePersisted(turn)));
|
|
2348
2375
|
const checkpointSuspended = (turn, pending, suspension2) => Effect18.gen(function* () {
|
|
2349
2376
|
const withPending = yield* appendPending(turn, pending);
|
|
2350
|
-
const unresolved = unresolvedToolCall(withPending.content);
|
|
2377
|
+
const unresolved = unresolvedToolCall(withPending.content, suspension2.tool_call_id);
|
|
2351
2378
|
if (unresolved === undefined || unresolved.call.id !== suspension2.tool_call_id || unresolved.call.name !== suspension2.tool_name || !Equal.equals(unresolved.call.params, suspension2.tool_params)) {
|
|
2352
2379
|
return yield* AgentError.make({
|
|
2353
2380
|
message: "Suspension does not match the unresolved checkpoint call",
|
|
@@ -2358,6 +2385,8 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2358
2385
|
token: suspension2.token,
|
|
2359
2386
|
reason: suspension2.reason,
|
|
2360
2387
|
...suspension2.authorization_stage === undefined ? {} : { authorization_stage: suspension2.authorization_stage },
|
|
2388
|
+
...suspension2.tool_call_index === undefined ? {} : { tool_call_index: suspension2.tool_call_index },
|
|
2389
|
+
tool_call_batch_ids: suspension2.tool_call_batch.map((call) => call.id),
|
|
2361
2390
|
...suspension2.active_tools === undefined ? {} : { active_tools: suspension2.active_tools },
|
|
2362
2391
|
...suspension2.activated_skills === undefined ? {} : { activated_skills: suspension2.activated_skills }
|
|
2363
2392
|
};
|
|
@@ -2384,7 +2413,7 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2384
2413
|
return yield* Ref5.get(chat.history);
|
|
2385
2414
|
});
|
|
2386
2415
|
const checkpointPending = (turn, pending) => appendPending(turn, pending).pipe(Effect18.tap((checkpoint) => syncSession(turn, checkpoint)));
|
|
2387
|
-
const failSuspended = (call, token, reason) => Stream4.fail(suspended(call, token, reason));
|
|
2416
|
+
const failSuspended = (call, toolCallBatch, toolCallIndex, token, reason) => Stream4.fail(suspended(call, toolCallBatch, toolCallIndex, token, reason));
|
|
2388
2417
|
const state = {
|
|
2389
2418
|
text: "",
|
|
2390
2419
|
turn: 0,
|
|
@@ -2603,7 +2632,7 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2603
2632
|
})
|
|
2604
2633
|
});
|
|
2605
2634
|
const boundedSuccessResult = (call, outcome) => options.toolOutputMaxBytes === undefined ? Effect18.succeed(successResult(call, outcome)) : bound(outcome, { toolCallId: call.id, maxBytes: options.toolOutputMaxBytes }).pipe(Effect18.map((bounded2) => successResult(call, bounded2)));
|
|
2606
|
-
const outcomeEvents = (turn, call, outcome, droppedProgress, registry) => {
|
|
2635
|
+
const outcomeEvents = (turn, toolCallBatch, toolCallIndex, call, outcome, droppedProgress, registry) => {
|
|
2607
2636
|
const metadata = droppedProgress === 0 ? {} : { metadata: { toolProgress: { dropped: droppedProgress } } };
|
|
2608
2637
|
switch (outcome._tag) {
|
|
2609
2638
|
case "Success":
|
|
@@ -2613,7 +2642,7 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2613
2642
|
return Effect18.succeed(Stream4.fromIterable([{ _tag: "ToolExecutionCompleted", turn, call, result, ...metadata }]));
|
|
2614
2643
|
}
|
|
2615
2644
|
case "Suspend":
|
|
2616
|
-
return Effect18.succeed(failSuspended(call, outcome.token, "tool-wait"));
|
|
2645
|
+
return Effect18.succeed(failSuspended(call, toolCallBatch, toolCallIndex, outcome.token, "tool-wait"));
|
|
2617
2646
|
}
|
|
2618
2647
|
};
|
|
2619
2648
|
const defaultExecute = (request, registry) => {
|
|
@@ -2680,7 +2709,7 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2680
2709
|
});
|
|
2681
2710
|
const execution = isSkillActivationCall(call, registry) ? activateSkillOutcome(turn, call) : Option12.isNone(executor) ? defaultExecute(request, registry) : executor.value.execute(request).pipe(Effect18.mapError((error) => Schema14.is(RemoteRetryError)(error) ? AgentError.make({ message: error.message, turn, cause: error }) : error));
|
|
2682
2711
|
const fiber = yield* execution.pipe(Effect18.provideService(ToolContext, context), Effect18.ensuring(Queue2.end(progressQueue).pipe(Effect18.asVoid)), Effect18.forkScoped({ startImmediately: true }));
|
|
2683
|
-
return Stream4.concat(Stream4.fromQueue(progressQueue), Stream4.fromEffect(Fiber.join(fiber)).pipe(Stream4.flatMap((outcome) => Stream4.unwrap(Ref5.get(droppedProgress).pipe(Effect18.flatMap((dropped) => outcomeEvents(turn, call, outcome, dropped, registry)))))));
|
|
2712
|
+
return Stream4.concat(Stream4.fromQueue(progressQueue), Stream4.fromEffect(Fiber.join(fiber)).pipe(Stream4.flatMap((outcome) => Stream4.unwrap(Ref5.get(droppedProgress).pipe(Effect18.flatMap((dropped) => outcomeEvents(turn, request.toolCallBatch, request.toolCallIndex, call, outcome, dropped, registry)))))));
|
|
2684
2713
|
})));
|
|
2685
2714
|
const activateSkillOutcome = (turn, call) => Effect18.gen(function* () {
|
|
2686
2715
|
if (skillRuntime === undefined) {
|
|
@@ -2734,8 +2763,8 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2734
2763
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
2735
2764
|
}).pipe(Effect18.mapError((error) => isToolNameCollision(error) || Schema14.is(FrameworkFailure)(error) ? error : skillError(turn, error)));
|
|
2736
2765
|
const authorizationError2 = (turn, error) => AgentError.make({ message: error.message, turn, cause: error });
|
|
2737
|
-
const toolCallEvents = (turn, call, messages, registry, authorizationStage, authorizationToken) => {
|
|
2738
|
-
const request = { call, turn, agentName: agent.name, sessionId };
|
|
2766
|
+
const toolCallEvents = (turn, toolCallBatch, toolCallIndex, call, messages, registry, authorizationStage, authorizationToken) => {
|
|
2767
|
+
const request = { call, toolCallBatch, turn, toolCallIndex, agentName: agent.name, sessionId };
|
|
2739
2768
|
const candidate = get(registry, call.name);
|
|
2740
2769
|
if (candidate === undefined)
|
|
2741
2770
|
return Stream4.fail(FrameworkFailure.make({
|
|
@@ -2774,9 +2803,11 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2774
2803
|
token: decision2.suspension.token,
|
|
2775
2804
|
reason: "approval",
|
|
2776
2805
|
authorization_stage: decision2.suspension.authorization_stage ?? "approval",
|
|
2806
|
+
tool_call_index: toolCallIndex,
|
|
2777
2807
|
tool_call_id: call.id,
|
|
2778
2808
|
tool_name: call.name,
|
|
2779
2809
|
tool_params: call.params,
|
|
2810
|
+
tool_call_batch: toolCallBatch.calls,
|
|
2780
2811
|
active_tools: activeTools,
|
|
2781
2812
|
activated_skills: activatedSkills
|
|
2782
2813
|
}));
|
|
@@ -2827,17 +2858,13 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2827
2858
|
function provideAgentModel(stream2) {
|
|
2828
2859
|
return agentModelRegistry === undefined || agentModel === undefined ? stream2 : agentModelRegistry.stream(agentModel, stream2).pipe(Stream4.catchTag("LanguageModelNotRegistered", (error) => Stream4.fail(AgentError.make({ message: errorMessage(error), turn: state.turn, cause: error }))));
|
|
2829
2860
|
}
|
|
2830
|
-
const partEvents = (turn, part
|
|
2861
|
+
const partEvents = (turn, part) => {
|
|
2831
2862
|
if (part.type === "error") {
|
|
2832
2863
|
if (isToolNameCollision(part.error))
|
|
2833
2864
|
return Stream4.fail(part.error);
|
|
2834
2865
|
return Stream4.fail(AgentError.make({ message: errorMessage(part.error), turn, cause: part.error }));
|
|
2835
2866
|
}
|
|
2836
2867
|
const modelPart = Stream4.fromIterable([{ _tag: "ModelPart", turn, part }]);
|
|
2837
|
-
if (part.type === "tool-call") {
|
|
2838
|
-
const call = part;
|
|
2839
|
-
return call.providerExecuted === true ? modelPart : Stream4.concat(modelPart, toolCallEvents(turn, call, messages, registry));
|
|
2840
|
-
}
|
|
2841
2868
|
if (part.type === "text-delta") {
|
|
2842
2869
|
state.text = `${state.text}${part.delta}`;
|
|
2843
2870
|
}
|
|
@@ -2940,13 +2967,29 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
2940
2967
|
return Option12.isSome(failure2) && AiError3.isAiError(failure2.value) ? Stream4.fail(AgentError.make({ message: errorMessage(failure2.value), turn, cause: failure2.value })) : Stream4.failCause(cause);
|
|
2941
2968
|
}));
|
|
2942
2969
|
};
|
|
2943
|
-
const parts = Stream4.unwrap(applyPromptChain(chain, Prompt9.make(prompt), { agentName: agent.name, turn }).pipe(Effect18.map((transformedPrompt) =>
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
|
-
|
|
2970
|
+
const parts = Stream4.unwrap(applyPromptChain(chain, Prompt9.make(prompt), { agentName: agent.name, turn }).pipe(Effect18.map((transformedPrompt) => {
|
|
2971
|
+
let nextToolCallIndex = 0;
|
|
2972
|
+
const calls = new Array;
|
|
2973
|
+
const executions = new Array;
|
|
2974
|
+
const toolCallBatch = { calls };
|
|
2975
|
+
const accepted = attempt(transformedPrompt, true).pipe(Stream4.mapEffect(({ accept, part, messages }) => accept.pipe(Effect18.as({ part, messages }))), Stream4.map(({ part, messages }) => {
|
|
2976
|
+
const toolCallIndex = nextToolCallIndex;
|
|
2977
|
+
if (part.type === "tool-call" && part.providerExecuted !== true) {
|
|
2978
|
+
const call = part;
|
|
2979
|
+
nextToolCallIndex += 1;
|
|
2980
|
+
calls.push(call);
|
|
2981
|
+
executions.push({ call, messages, toolCallIndex });
|
|
2982
|
+
}
|
|
2983
|
+
return { part, messages, toolCallIndex };
|
|
2984
|
+
}), Stream4.flatMap(({ part }) => partEvents(turn, part)));
|
|
2985
|
+
return Stream4.concat(accepted, Stream4.suspend(() => {
|
|
2986
|
+
Object.freeze(calls);
|
|
2987
|
+
Object.freeze(toolCallBatch);
|
|
2988
|
+
const concurrency = agent.toolExecution?.concurrency ?? 1;
|
|
2989
|
+
const executionStreams = Stream4.fromIterable(executions);
|
|
2990
|
+
return concurrency === 1 ? executionStreams.pipe(Stream4.flatMap(({ call, messages, toolCallIndex }) => toolCallEvents(turn, toolCallBatch, toolCallIndex, call, messages, activeRegistry)), Stream4.tap(recordPending)) : executionStreams.pipe(Stream4.mapEffect(({ call, messages, toolCallIndex }) => Stream4.runCollect(toolCallEvents(turn, toolCallBatch, toolCallIndex, call, messages, activeRegistry)), { concurrency }), Stream4.flatMap(Stream4.fromIterable), Stream4.tap(recordPending));
|
|
2991
|
+
}));
|
|
2992
|
+
})));
|
|
2950
2993
|
const resilientParts = Option12.match(resilienceService, {
|
|
2951
2994
|
onNone: () => parts,
|
|
2952
2995
|
onSome: (resilience) => Stream4.unwrap(LanguageModel5.LanguageModel.pipe(Effect18.map((model) => parts.pipe(Stream4.provideService(LanguageModel5.LanguageModel, apply(model, {
|
|
@@ -3098,12 +3141,22 @@ var streamInternal = (agent, options, structured) => Stream4.unwrap(Effect18.gen
|
|
|
3098
3141
|
const currentTurn = resetTurnState(0).pipe(Stream4.concat(Stream4.unwrap(Ref5.get(toolState).pipe(Effect18.map((tools) => {
|
|
3099
3142
|
const suspension2 = checkpoint.suspension;
|
|
3100
3143
|
const registry = suspension2.authorization_stage === undefined && suspension2.active_tools === undefined ? tools.registry : select(tools.registry, suspension2.active_tools ?? []);
|
|
3101
|
-
|
|
3102
|
-
id:
|
|
3103
|
-
name:
|
|
3104
|
-
params:
|
|
3105
|
-
providerExecuted:
|
|
3106
|
-
|
|
3144
|
+
const calls = suspension2.tool_call_batch.map((call) => Response7.makePart("tool-call", {
|
|
3145
|
+
id: call.id,
|
|
3146
|
+
name: call.name,
|
|
3147
|
+
params: call.params,
|
|
3148
|
+
providerExecuted: call.providerExecuted,
|
|
3149
|
+
metadata: call.metadata
|
|
3150
|
+
}));
|
|
3151
|
+
const toolCallBatch = { calls };
|
|
3152
|
+
const startIndex = suspension2.tool_call_index ?? 0;
|
|
3153
|
+
if (calls[startIndex] === undefined) {
|
|
3154
|
+
return Stream4.fail(AgentError.make({ message: "Suspension tool call index is outside its batch", turn: 0 }));
|
|
3155
|
+
}
|
|
3156
|
+
const executions = Stream4.fromIterable(calls.slice(startIndex).map((call, offset) => ({ call, toolCallIndex: startIndex + offset })));
|
|
3157
|
+
const execute = ({ call, toolCallIndex }) => toolCallEvents(0, toolCallBatch, toolCallIndex, call, checkpoint.messages, registry, toolCallIndex === startIndex ? suspension2.authorization_stage : undefined, toolCallIndex === startIndex ? suspension2.token : undefined);
|
|
3158
|
+
const concurrency = agent.toolExecution?.concurrency ?? 1;
|
|
3159
|
+
return concurrency === 1 ? executions.pipe(Stream4.flatMap(execute), Stream4.tap(recordPending)) : executions.pipe(Stream4.mapEffect((execution) => Stream4.runCollect(execute(execution)), { concurrency }), Stream4.flatMap(Stream4.fromIterable), Stream4.tap(recordPending));
|
|
3107
3160
|
})))), Stream4.concat(Stream4.unwrap(afterTurn(0).pipe(Effect18.map((result) => {
|
|
3108
3161
|
next = result.next;
|
|
3109
3162
|
return result.events;
|
|
@@ -3200,7 +3253,7 @@ var generatePersistedObject = dual7(2, (agent, options) => Stream4.runFold(persi
|
|
|
3200
3253
|
})
|
|
3201
3254
|
}))));
|
|
3202
3255
|
|
|
3203
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
3256
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/agent-tool.js
|
|
3204
3257
|
var exports_agent_tool = {};
|
|
3205
3258
|
__export(exports_agent_tool, {
|
|
3206
3259
|
asTool: () => asTool
|
|
@@ -3271,7 +3324,7 @@ var asTool = Function7.dual((args) => args.length !== 1 || ("name" in args[0]),
|
|
|
3271
3324
|
return lazyHandled(toolkit, name, handler);
|
|
3272
3325
|
});
|
|
3273
3326
|
|
|
3274
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
3327
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/guardrail.js
|
|
3275
3328
|
var exports_guardrail = {};
|
|
3276
3329
|
__export(exports_guardrail, {
|
|
3277
3330
|
validateInput: () => validateInput,
|
|
@@ -3352,7 +3405,7 @@ var filterOutput = (keep) => ({
|
|
|
3352
3405
|
transformPart: (part, context) => Effect20.succeed(part.type === "tool-call" || keep(part, context) ? Option13.some(part) : Option13.none())
|
|
3353
3406
|
});
|
|
3354
3407
|
|
|
3355
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
3408
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/handoff.js
|
|
3356
3409
|
var exports_handoff = {};
|
|
3357
3410
|
__export(exports_handoff, {
|
|
3358
3411
|
transferTool: () => transferTool,
|
|
@@ -3432,7 +3485,7 @@ var supervisor = (options) => {
|
|
|
3432
3485
|
};
|
|
3433
3486
|
};
|
|
3434
3487
|
|
|
3435
|
-
// ../../node_modules/.bun/@batonfx+core@0.6.
|
|
3488
|
+
// ../../node_modules/.bun/@batonfx+core@0.6.4/node_modules/@batonfx/core/dist/index.js
|
|
3436
3489
|
import { AiError as AiError5, Chat as Chat2, EmbeddingModel, IdGenerator, LanguageModel as LanguageModel7, Model as Model2, Prompt as Prompt13, Response as Response9, ResponseIdTracker, Telemetry as Telemetry2, Tokenizer as Tokenizer3, Tool as Tool10, Toolkit as Toolkit7 } from "effect/unstable/ai";
|
|
3437
3490
|
|
|
3438
3491
|
export { exports_turn_policy, exports_agent_event, exports_tool_context, exports_tool_executor, exports_approvals, exports_memory, exports_session, exports_tool_output, exports_compaction, exports_instructions, exports_model_middleware, exports_model_registry, exports_model_resilience, exports_permissions, exports_skill_source, exports_steering, exports_agent, exports_agent_tool, exports_guardrail, exports_handoff, AiError5 as AiError, Chat2 as Chat, EmbeddingModel, IdGenerator, Model2 as Model, Prompt13 as Prompt, Response9 as Response, ResponseIdTracker, Telemetry2 as Telemetry, Tokenizer3 as Tokenizer, Tool10 as Tool, Toolkit7 as Toolkit };
|
package/dist/index.js
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
exports_tool_runtime,
|
|
14
14
|
exports_workflow_definition_host,
|
|
15
15
|
makeDatabaseIdentity
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-8awt651b.js";
|
|
17
17
|
import {
|
|
18
18
|
exports_model_registry
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-t5bbk8cp.js";
|
|
20
20
|
import {
|
|
21
21
|
Service,
|
|
22
22
|
exports_address_schema,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
exports_tool_schema,
|
|
41
41
|
exports_wait_schema,
|
|
42
42
|
exports_workflow_schema
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-pw46cfne.js";
|
|
44
44
|
import {
|
|
45
45
|
__export
|
|
46
46
|
} from "./index-nb39b5ae.js";
|
|
@@ -170,13 +170,13 @@ __export(exports_language_model_registration, {
|
|
|
170
170
|
OpenAiAccountCredentialError: () => OpenAiAccountCredentialError
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
173
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/deterministic.js
|
|
174
174
|
import { OpenAiClient as OpenAiClient2 } from "@effect/ai-openai";
|
|
175
175
|
import { Config as Config2, Effect as Effect4, Layer as Layer3, Option, Stream as Stream2 } from "effect";
|
|
176
176
|
import { LanguageModel, Response } from "effect/unstable/ai";
|
|
177
177
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
178
178
|
|
|
179
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
179
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/openai.js
|
|
180
180
|
import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
181
181
|
import { Config, Effect as Effect3, Layer as Layer2, Redacted, Schema, Stream } from "effect";
|
|
182
182
|
import { AiError } from "effect/unstable/ai";
|
|
@@ -264,7 +264,7 @@ var openAiAccount = (input) => exports_model_registry.registrationFromLayer({
|
|
|
264
264
|
var withOpenAiAccount = (input) => exports_model_registry.layerFromRegistrationEffects([openAiAccount(input)]);
|
|
265
265
|
var withOpenAiAccountFetch = (input) => withOpenAiAccount(input).pipe(Layer2.provide(FetchHttpClient.layer));
|
|
266
266
|
|
|
267
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
267
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/deterministic.js
|
|
268
268
|
var deterministicModelLayer = Layer3.effect(LanguageModel.LanguageModel, LanguageModel.make({
|
|
269
269
|
generateText: () => Effect4.succeed([{ type: "text", text: "deterministic response" }]),
|
|
270
270
|
streamText: () => Stream2.make(Response.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -297,7 +297,7 @@ var withOpenAiOrDeterministic = (options) => Layer3.unwrap(Effect4.gen(function*
|
|
|
297
297
|
}));
|
|
298
298
|
var withOpenAiOrDeterministicFetch = (options) => withOpenAiOrDeterministic(options).pipe(Layer3.provide(FetchHttpClient2.layer));
|
|
299
299
|
|
|
300
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
300
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/anthropic.js
|
|
301
301
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
302
302
|
import { Config as Config3, Layer as Layer4, Redacted as Redacted2 } from "effect";
|
|
303
303
|
import { AiError as AiError2 } from "effect/unstable/ai";
|
|
@@ -322,7 +322,7 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
322
322
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
323
323
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer4.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })));
|
|
324
324
|
var withAnthropicFetch = (options) => withAnthropic(options).pipe(Layer4.provide(FetchHttpClient3.layer));
|
|
325
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
325
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/openai-compat.js
|
|
326
326
|
import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
327
327
|
import { Config as Config4, Layer as Layer5, Redacted as Redacted3 } from "effect";
|
|
328
328
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
@@ -345,7 +345,7 @@ var clientLayerConfig = (options) => OpenAiClient3.layerConfig({
|
|
|
345
345
|
});
|
|
346
346
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer5.provide(clientLayerConfig(options)));
|
|
347
347
|
var withOpenAiCompatibleFetch = (options) => withOpenAiCompatible(options).pipe(Layer5.provide(FetchHttpClient4.layer));
|
|
348
|
-
// ../../node_modules/.bun/@batonfx+providers@0.6.
|
|
348
|
+
// ../../node_modules/.bun/@batonfx+providers@0.6.4/node_modules/@batonfx/providers/dist/openrouter.js
|
|
349
349
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
350
350
|
import { Config as Config5, Layer as Layer6, Redacted as Redacted4 } from "effect";
|
|
351
351
|
import { AiError as AiError3 } from "effect/unstable/ai";
|