@relayfx/sdk 0.0.45 → 0.0.46
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
|
@@ -3500,6 +3500,7 @@ __export(exports_memory_repository, {
|
|
|
3500
3500
|
query: () => query,
|
|
3501
3501
|
memoryLayer: () => memoryLayer11,
|
|
3502
3502
|
layer: () => layer13,
|
|
3503
|
+
forget: () => forget,
|
|
3503
3504
|
Service: () => Service14,
|
|
3504
3505
|
MemoryRow: () => MemoryRow,
|
|
3505
3506
|
MemoryRepositoryError: () => MemoryRepositoryError
|
|
@@ -3668,7 +3669,17 @@ var layer13 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
|
3668
3669
|
const decoded = yield* Effect14.forEach(rows, decodeRow9);
|
|
3669
3670
|
return yield* rankMatches(decoded.map(toRecord7), input.embedding, input.topK);
|
|
3670
3671
|
});
|
|
3671
|
-
|
|
3672
|
+
const forget = Effect14.fn("MemoryRepository.forget")(function* (input) {
|
|
3673
|
+
const tenantId = yield* current();
|
|
3674
|
+
yield* (input.id === undefined ? sql2`
|
|
3675
|
+
DELETE FROM relay_memory_records
|
|
3676
|
+
WHERE tenant_id = ${tenantId} AND agent = ${input.agent} AND subject = ${input.subject}
|
|
3677
|
+
` : sql2`
|
|
3678
|
+
DELETE FROM relay_memory_records
|
|
3679
|
+
WHERE tenant_id = ${tenantId} AND agent = ${input.agent} AND subject = ${input.subject} AND id = ${input.id}
|
|
3680
|
+
`).pipe(Effect14.asVoid, Effect14.mapError(toRepositoryError10));
|
|
3681
|
+
});
|
|
3682
|
+
return Service14.of({ upsert: upsert2, query, forget });
|
|
3672
3683
|
}));
|
|
3673
3684
|
var memoryLayer11 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
3674
3685
|
const records = yield* Ref2.make(new Map);
|
|
@@ -3698,7 +3709,20 @@ var memoryLayer11 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
|
3698
3709
|
const scoped = Array.from(current2.values()).filter((record2) => record2.agent === input.agent && record2.subject === input.subject).map(cloneRecord4);
|
|
3699
3710
|
return yield* rankMatches(scoped, input.embedding, input.topK);
|
|
3700
3711
|
});
|
|
3701
|
-
|
|
3712
|
+
const forget = Effect14.fn("MemoryRepository.memory.forget")(function* (input) {
|
|
3713
|
+
yield* Ref2.update(records, (current2) => {
|
|
3714
|
+
const next = new Map(current2);
|
|
3715
|
+
for (const [id2, record2] of current2) {
|
|
3716
|
+
if (record2.agent !== input.agent || record2.subject !== input.subject)
|
|
3717
|
+
continue;
|
|
3718
|
+
if (input.id !== undefined && id2 !== input.id)
|
|
3719
|
+
continue;
|
|
3720
|
+
next.delete(id2);
|
|
3721
|
+
}
|
|
3722
|
+
return next;
|
|
3723
|
+
});
|
|
3724
|
+
});
|
|
3725
|
+
return Service14.of({ upsert: upsert2, query, forget });
|
|
3702
3726
|
}));
|
|
3703
3727
|
var testLayer11 = (implementation) => Layer14.succeed(Service14, Service14.of(implementation));
|
|
3704
3728
|
var upsert2 = Effect14.fn("MemoryRepository.upsert.call")(function* (input) {
|
|
@@ -3709,6 +3733,10 @@ var query = Effect14.fn("MemoryRepository.query.call")(function* (input) {
|
|
|
3709
3733
|
const repository = yield* Service14;
|
|
3710
3734
|
return yield* repository.query(input);
|
|
3711
3735
|
});
|
|
3736
|
+
var forget = Effect14.fn("MemoryRepository.forget.call")(function* (input) {
|
|
3737
|
+
const repository = yield* Service14;
|
|
3738
|
+
return yield* repository.forget(input);
|
|
3739
|
+
});
|
|
3712
3740
|
// ../store-sql/src/permission/permission-rule-repository.ts
|
|
3713
3741
|
var exports_permission_rule_repository = {};
|
|
3714
3742
|
__export(exports_permission_rule_repository, {
|
|
@@ -8400,7 +8428,7 @@ __export(exports_agent_loop_service, {
|
|
|
8400
8428
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8401
8429
|
});
|
|
8402
8430
|
|
|
8403
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8431
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent.ts
|
|
8404
8432
|
var exports_agent = {};
|
|
8405
8433
|
__export(exports_agent, {
|
|
8406
8434
|
streamObject: () => streamObject,
|
|
@@ -8413,7 +8441,7 @@ __export(exports_agent, {
|
|
|
8413
8441
|
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";
|
|
8414
8442
|
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";
|
|
8415
8443
|
|
|
8416
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8444
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent-event.ts
|
|
8417
8445
|
var exports_agent_event = {};
|
|
8418
8446
|
__export(exports_agent_event, {
|
|
8419
8447
|
addUsage: () => addUsage,
|
|
@@ -8470,7 +8498,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8470
8498
|
}) {
|
|
8471
8499
|
}
|
|
8472
8500
|
|
|
8473
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8501
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/approvals.ts
|
|
8474
8502
|
var exports_approvals = {};
|
|
8475
8503
|
__export(exports_approvals, {
|
|
8476
8504
|
testLayer: () => testLayer26,
|
|
@@ -8486,7 +8514,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8486
8514
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8487
8515
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8488
8516
|
|
|
8489
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8517
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/compaction.ts
|
|
8490
8518
|
var exports_compaction = {};
|
|
8491
8519
|
__export(exports_compaction, {
|
|
8492
8520
|
truncate: () => truncate,
|
|
@@ -8504,7 +8532,7 @@ __export(exports_compaction, {
|
|
|
8504
8532
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8505
8533
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8506
8534
|
|
|
8507
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8535
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/session.ts
|
|
8508
8536
|
var exports_session = {};
|
|
8509
8537
|
__export(exports_session, {
|
|
8510
8538
|
testLayer: () => testLayer27,
|
|
@@ -8677,7 +8705,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8677
8705
|
}))));
|
|
8678
8706
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8679
8707
|
|
|
8680
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8708
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-output.ts
|
|
8681
8709
|
var exports_tool_output = {};
|
|
8682
8710
|
__export(exports_tool_output, {
|
|
8683
8711
|
testLayer: () => testLayer28,
|
|
@@ -8737,7 +8765,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8737
8765
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8738
8766
|
});
|
|
8739
8767
|
|
|
8740
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8768
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/compaction.ts
|
|
8741
8769
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8742
8770
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8743
8771
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8920,7 +8948,7 @@ var truncate = (maxTokens) => ({
|
|
|
8920
8948
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8921
8949
|
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));
|
|
8922
8950
|
|
|
8923
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8951
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/instructions.ts
|
|
8924
8952
|
var exports_instructions = {};
|
|
8925
8953
|
__export(exports_instructions, {
|
|
8926
8954
|
testLayer: () => testLayer30,
|
|
@@ -8969,7 +8997,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
8969
8997
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
8970
8998
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
8971
8999
|
|
|
8972
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9000
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/memory.ts
|
|
8973
9001
|
var exports_memory = {};
|
|
8974
9002
|
__export(exports_memory, {
|
|
8975
9003
|
testLayer: () => testLayer31,
|
|
@@ -8989,16 +9017,18 @@ class Memory extends Context34.Service()("@batonfx/core/Memory") {
|
|
|
8989
9017
|
}
|
|
8990
9018
|
var noop = {
|
|
8991
9019
|
recall: () => Effect36.succeed([]),
|
|
8992
|
-
remember: () => Effect36.void
|
|
9020
|
+
remember: () => Effect36.void,
|
|
9021
|
+
forget: () => Effect36.void
|
|
8993
9022
|
};
|
|
8994
9023
|
var merge = (first, second) => ({
|
|
8995
9024
|
recall: (input) => Effect36.all([first.recall(input), second.recall(input)]).pipe(Effect36.map(([firstItems, secondItems]) => [...firstItems, ...secondItems])),
|
|
8996
|
-
remember: (input) => Effect36.all([first.remember(input), second.remember(input)], { discard: true })
|
|
9025
|
+
remember: (input) => Effect36.all([first.remember(input), second.remember(input)], { discard: true }),
|
|
9026
|
+
forget: (input) => Effect36.all([first.forget(input), second.forget(input)], { discard: true })
|
|
8997
9027
|
});
|
|
8998
9028
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
8999
9029
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
9000
9030
|
|
|
9001
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9031
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-middleware.ts
|
|
9002
9032
|
var exports_model_middleware = {};
|
|
9003
9033
|
__export(exports_model_middleware, {
|
|
9004
9034
|
layer: () => layer28,
|
|
@@ -9012,7 +9042,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
9012
9042
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
9013
9043
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
9014
9044
|
|
|
9015
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9045
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-resilience.ts
|
|
9016
9046
|
var exports_model_resilience = {};
|
|
9017
9047
|
__export(exports_model_resilience, {
|
|
9018
9048
|
testLayer: () => testLayer32,
|
|
@@ -9058,7 +9088,7 @@ var apply = (model, resilience) => ({
|
|
|
9058
9088
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
9059
9089
|
});
|
|
9060
9090
|
|
|
9061
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9091
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/permissions.ts
|
|
9062
9092
|
var exports_permissions = {};
|
|
9063
9093
|
__export(exports_permissions, {
|
|
9064
9094
|
testLayer: () => testLayer33,
|
|
@@ -9188,7 +9218,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9188
9218
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9189
9219
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9190
9220
|
|
|
9191
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9221
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/skill-source.ts
|
|
9192
9222
|
var exports_skill_source = {};
|
|
9193
9223
|
__export(exports_skill_source, {
|
|
9194
9224
|
testLayer: () => testLayer34,
|
|
@@ -9246,7 +9276,7 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9246
9276
|
return selected;
|
|
9247
9277
|
};
|
|
9248
9278
|
|
|
9249
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9279
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/steering.ts
|
|
9250
9280
|
var exports_steering = {};
|
|
9251
9281
|
__export(exports_steering, {
|
|
9252
9282
|
testLayer: () => testLayer35,
|
|
@@ -9303,7 +9333,7 @@ var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function*
|
|
|
9303
9333
|
}));
|
|
9304
9334
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9305
9335
|
|
|
9306
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9336
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-context.ts
|
|
9307
9337
|
var exports_tool_context = {};
|
|
9308
9338
|
__export(exports_tool_context, {
|
|
9309
9339
|
testLayer: () => testLayer36,
|
|
@@ -9321,7 +9351,7 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9321
9351
|
}));
|
|
9322
9352
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9323
9353
|
|
|
9324
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9354
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9325
9355
|
var exports_tool_executor = {};
|
|
9326
9356
|
__export(exports_tool_executor, {
|
|
9327
9357
|
testLayer: () => testLayer37,
|
|
@@ -9447,7 +9477,7 @@ function router(routes) {
|
|
|
9447
9477
|
}
|
|
9448
9478
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9449
9479
|
|
|
9450
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9480
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9451
9481
|
var exports_turn_policy = {};
|
|
9452
9482
|
__export(exports_turn_policy, {
|
|
9453
9483
|
untilToolCall: () => untilToolCall,
|
|
@@ -9486,7 +9516,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9486
9516
|
}));
|
|
9487
9517
|
var defaultPolicy = recurs(8);
|
|
9488
9518
|
|
|
9489
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9519
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent.ts
|
|
9490
9520
|
function make5(nameOrOptions, options = {}) {
|
|
9491
9521
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9492
9522
|
return {
|
|
@@ -10169,7 +10199,7 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10169
10199
|
})
|
|
10170
10200
|
})
|
|
10171
10201
|
})));
|
|
10172
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10202
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10173
10203
|
var exports_agent_tool = {};
|
|
10174
10204
|
__export(exports_agent_tool, {
|
|
10175
10205
|
asTool: () => asTool
|
|
@@ -10227,7 +10257,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10227
10257
|
});
|
|
10228
10258
|
return lazyHandled(toolkit, name, handler);
|
|
10229
10259
|
};
|
|
10230
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10260
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/guardrail.ts
|
|
10231
10261
|
var exports_guardrail = {};
|
|
10232
10262
|
__export(exports_guardrail, {
|
|
10233
10263
|
validateInput: () => validateInput2,
|
|
@@ -10307,7 +10337,7 @@ var redactOutput = (options) => ({
|
|
|
10307
10337
|
var filterOutput = (keep) => ({
|
|
10308
10338
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10309
10339
|
});
|
|
10310
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10340
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/handoff.ts
|
|
10311
10341
|
var exports_handoff = {};
|
|
10312
10342
|
__export(exports_handoff, {
|
|
10313
10343
|
transferTool: () => transferTool,
|
|
@@ -10370,7 +10400,7 @@ var supervisor = (options) => {
|
|
|
10370
10400
|
toolkit
|
|
10371
10401
|
};
|
|
10372
10402
|
};
|
|
10373
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10403
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-registry.ts
|
|
10374
10404
|
var exports_model_registry = {};
|
|
10375
10405
|
__export(exports_model_registry, {
|
|
10376
10406
|
testLayer: () => testLayer38,
|
|
@@ -10459,7 +10489,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10459
10489
|
return yield* service.provide(selection, effect);
|
|
10460
10490
|
});
|
|
10461
10491
|
|
|
10462
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10492
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/index.ts
|
|
10463
10493
|
import {
|
|
10464
10494
|
AiError as AiError3,
|
|
10465
10495
|
Chat as Chat2,
|
|
@@ -11255,7 +11285,15 @@ var make6 = (options = {}) => Effect54.gen(function* () {
|
|
|
11255
11285
|
createdAt
|
|
11256
11286
|
}).pipe(Effect54.mapError(memoryError));
|
|
11257
11287
|
});
|
|
11258
|
-
|
|
11288
|
+
const forget2 = Effect54.fn("MemoryService.forget")(function* (input) {
|
|
11289
|
+
const subject = yield* decodeSubject(input.key.subject);
|
|
11290
|
+
yield* repository.forget({
|
|
11291
|
+
agent: input.key.agent,
|
|
11292
|
+
subject,
|
|
11293
|
+
...input.id === undefined ? {} : { id: input.id }
|
|
11294
|
+
}).pipe(Effect54.mapError(memoryError));
|
|
11295
|
+
});
|
|
11296
|
+
return { recall, remember: remember2, forget: forget2 };
|
|
11259
11297
|
});
|
|
11260
11298
|
var serviceLayer = (options) => Layer47.effect(Service33, make6(options).pipe(Effect54.map(Service33.of)));
|
|
11261
11299
|
var batonLayer = Layer47.effect(exports_memory.Memory, Effect54.gen(function* () {
|
|
@@ -11271,6 +11309,10 @@ var remember2 = Effect54.fn("MemoryService.remember.call")(function* (input) {
|
|
|
11271
11309
|
const service = yield* Service33;
|
|
11272
11310
|
return yield* service.remember(input);
|
|
11273
11311
|
});
|
|
11312
|
+
var forget2 = Effect54.fn("MemoryService.forget.call")(function* (input) {
|
|
11313
|
+
const service = yield* Service33;
|
|
11314
|
+
return yield* service.forget(input);
|
|
11315
|
+
});
|
|
11274
11316
|
|
|
11275
11317
|
// ../runtime/src/model/language-model-service.ts
|
|
11276
11318
|
var exports_language_model_service = {};
|
|
@@ -12586,7 +12628,8 @@ var terminalMemoryTranscript = (prompt, text3) => {
|
|
|
12586
12628
|
};
|
|
12587
12629
|
var recallOnlyMemory = (memory) => exports_memory.Memory.of({
|
|
12588
12630
|
recall: memory.recall,
|
|
12589
|
-
remember: () => Effect67.void
|
|
12631
|
+
remember: () => Effect67.void,
|
|
12632
|
+
forget: () => Effect67.void
|
|
12590
12633
|
});
|
|
12591
12634
|
var metadataValue = (metadata11, key2) => metadata11?.[key2];
|
|
12592
12635
|
var decodeOptionalNumber = (value, key2, valid) => {
|
|
@@ -15583,7 +15626,7 @@ __export(exports_language_model_registration, {
|
|
|
15583
15626
|
anthropic: () => anthropic
|
|
15584
15627
|
});
|
|
15585
15628
|
|
|
15586
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15629
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/anthropic.ts
|
|
15587
15630
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
15588
15631
|
import { Layer as Layer70 } from "effect";
|
|
15589
15632
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -15599,13 +15642,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15599
15642
|
});
|
|
15600
15643
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
15601
15644
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer70.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer70.provide(FetchHttpClient2.layer));
|
|
15602
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15645
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15603
15646
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
15604
15647
|
import { Effect as Effect79, Layer as Layer72, Option as Option28, Stream as Stream11 } from "effect";
|
|
15605
15648
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
15606
15649
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
15607
15650
|
|
|
15608
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15651
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openai.ts
|
|
15609
15652
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
15610
15653
|
import { Layer as Layer71 } from "effect";
|
|
15611
15654
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -15622,7 +15665,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
15622
15665
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
15623
15666
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer71.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer71.provide(FetchHttpClient3.layer));
|
|
15624
15667
|
|
|
15625
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15668
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/deterministic.ts
|
|
15626
15669
|
var deterministicModelLayer = Layer72.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
15627
15670
|
generateText: () => Effect79.succeed([{ type: "text", text: "deterministic response" }]),
|
|
15628
15671
|
streamText: () => Stream11.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -15646,7 +15689,7 @@ var withOpenAiOrDeterministic = (options) => Layer72.unwrap(Effect79.gen(functio
|
|
|
15646
15689
|
...Option28.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
15647
15690
|
]);
|
|
15648
15691
|
}));
|
|
15649
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15692
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
15650
15693
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
15651
15694
|
import { Config as Config8, Layer as Layer73 } from "effect";
|
|
15652
15695
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -15667,7 +15710,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
15667
15710
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
15668
15711
|
});
|
|
15669
15712
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer73.provide(clientLayerConfig(options)), Layer73.provide(FetchHttpClient5.layer));
|
|
15670
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
15713
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openrouter.ts
|
|
15671
15714
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
15672
15715
|
import { Layer as Layer74 } from "effect";
|
|
15673
15716
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|
package/dist/index.js
CHANGED
|
@@ -3553,6 +3553,7 @@ __export(exports_memory_repository, {
|
|
|
3553
3553
|
query: () => query,
|
|
3554
3554
|
memoryLayer: () => memoryLayer11,
|
|
3555
3555
|
layer: () => layer13,
|
|
3556
|
+
forget: () => forget,
|
|
3556
3557
|
Service: () => Service14,
|
|
3557
3558
|
MemoryRow: () => MemoryRow,
|
|
3558
3559
|
MemoryRepositoryError: () => MemoryRepositoryError
|
|
@@ -3721,7 +3722,17 @@ var layer13 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
|
3721
3722
|
const decoded = yield* Effect14.forEach(rows, decodeRow9);
|
|
3722
3723
|
return yield* rankMatches(decoded.map(toRecord7), input.embedding, input.topK);
|
|
3723
3724
|
});
|
|
3724
|
-
|
|
3725
|
+
const forget = Effect14.fn("MemoryRepository.forget")(function* (input) {
|
|
3726
|
+
const tenantId = yield* current();
|
|
3727
|
+
yield* (input.id === undefined ? sql2`
|
|
3728
|
+
DELETE FROM relay_memory_records
|
|
3729
|
+
WHERE tenant_id = ${tenantId} AND agent = ${input.agent} AND subject = ${input.subject}
|
|
3730
|
+
` : sql2`
|
|
3731
|
+
DELETE FROM relay_memory_records
|
|
3732
|
+
WHERE tenant_id = ${tenantId} AND agent = ${input.agent} AND subject = ${input.subject} AND id = ${input.id}
|
|
3733
|
+
`).pipe(Effect14.asVoid, Effect14.mapError(toRepositoryError10));
|
|
3734
|
+
});
|
|
3735
|
+
return Service14.of({ upsert: upsert2, query, forget });
|
|
3725
3736
|
}));
|
|
3726
3737
|
var memoryLayer11 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
3727
3738
|
const records = yield* Ref2.make(new Map);
|
|
@@ -3751,7 +3762,20 @@ var memoryLayer11 = Layer14.effect(Service14, Effect14.gen(function* () {
|
|
|
3751
3762
|
const scoped = Array.from(current2.values()).filter((record2) => record2.agent === input.agent && record2.subject === input.subject).map(cloneRecord4);
|
|
3752
3763
|
return yield* rankMatches(scoped, input.embedding, input.topK);
|
|
3753
3764
|
});
|
|
3754
|
-
|
|
3765
|
+
const forget = Effect14.fn("MemoryRepository.memory.forget")(function* (input) {
|
|
3766
|
+
yield* Ref2.update(records, (current2) => {
|
|
3767
|
+
const next = new Map(current2);
|
|
3768
|
+
for (const [id2, record2] of current2) {
|
|
3769
|
+
if (record2.agent !== input.agent || record2.subject !== input.subject)
|
|
3770
|
+
continue;
|
|
3771
|
+
if (input.id !== undefined && id2 !== input.id)
|
|
3772
|
+
continue;
|
|
3773
|
+
next.delete(id2);
|
|
3774
|
+
}
|
|
3775
|
+
return next;
|
|
3776
|
+
});
|
|
3777
|
+
});
|
|
3778
|
+
return Service14.of({ upsert: upsert2, query, forget });
|
|
3755
3779
|
}));
|
|
3756
3780
|
var testLayer11 = (implementation) => Layer14.succeed(Service14, Service14.of(implementation));
|
|
3757
3781
|
var upsert2 = Effect14.fn("MemoryRepository.upsert.call")(function* (input) {
|
|
@@ -3762,6 +3786,10 @@ var query = Effect14.fn("MemoryRepository.query.call")(function* (input) {
|
|
|
3762
3786
|
const repository = yield* Service14;
|
|
3763
3787
|
return yield* repository.query(input);
|
|
3764
3788
|
});
|
|
3789
|
+
var forget = Effect14.fn("MemoryRepository.forget.call")(function* (input) {
|
|
3790
|
+
const repository = yield* Service14;
|
|
3791
|
+
return yield* repository.forget(input);
|
|
3792
|
+
});
|
|
3765
3793
|
// ../store-sql/src/permission/permission-rule-repository.ts
|
|
3766
3794
|
var exports_permission_rule_repository = {};
|
|
3767
3795
|
__export(exports_permission_rule_repository, {
|
|
@@ -8453,7 +8481,7 @@ __export(exports_agent_loop_service, {
|
|
|
8453
8481
|
AgentLoopBudgetExceeded: () => AgentLoopBudgetExceeded
|
|
8454
8482
|
});
|
|
8455
8483
|
|
|
8456
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8484
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent.ts
|
|
8457
8485
|
var exports_agent = {};
|
|
8458
8486
|
__export(exports_agent, {
|
|
8459
8487
|
streamObject: () => streamObject,
|
|
@@ -8466,7 +8494,7 @@ __export(exports_agent, {
|
|
|
8466
8494
|
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";
|
|
8467
8495
|
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";
|
|
8468
8496
|
|
|
8469
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8497
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent-event.ts
|
|
8470
8498
|
var exports_agent_event = {};
|
|
8471
8499
|
__export(exports_agent_event, {
|
|
8472
8500
|
addUsage: () => addUsage,
|
|
@@ -8523,7 +8551,7 @@ class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSus
|
|
|
8523
8551
|
}) {
|
|
8524
8552
|
}
|
|
8525
8553
|
|
|
8526
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8554
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/approvals.ts
|
|
8527
8555
|
var exports_approvals = {};
|
|
8528
8556
|
__export(exports_approvals, {
|
|
8529
8557
|
testLayer: () => testLayer26,
|
|
@@ -8539,7 +8567,7 @@ var autoApprove = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect3
|
|
|
8539
8567
|
var denyAll = Layer29.succeed(Approvals, Approvals.of({ check: () => Effect31.succeed({ _tag: "Denied" }) }));
|
|
8540
8568
|
var testLayer26 = (implementation) => Layer29.succeed(Approvals, Approvals.of(implementation));
|
|
8541
8569
|
|
|
8542
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8570
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/compaction.ts
|
|
8543
8571
|
var exports_compaction = {};
|
|
8544
8572
|
__export(exports_compaction, {
|
|
8545
8573
|
truncate: () => truncate,
|
|
@@ -8557,7 +8585,7 @@ __export(exports_compaction, {
|
|
|
8557
8585
|
import { Context as Context32, Effect as Effect34, Layer as Layer32, Option as Option10, Schema as Schema41 } from "effect";
|
|
8558
8586
|
import { LanguageModel, Prompt as Prompt3, Tokenizer, Toolkit as Toolkit2 } from "effect/unstable/ai";
|
|
8559
8587
|
|
|
8560
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8588
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/session.ts
|
|
8561
8589
|
var exports_session = {};
|
|
8562
8590
|
__export(exports_session, {
|
|
8563
8591
|
testLayer: () => testLayer27,
|
|
@@ -8730,7 +8758,7 @@ var memoryLayer24 = Layer30.effect(SessionStore, Ref7.make(initialState).pipe(Ef
|
|
|
8730
8758
|
}))));
|
|
8731
8759
|
var testLayer27 = (implementation) => Layer30.succeed(SessionStore, SessionStore.of(implementation));
|
|
8732
8760
|
|
|
8733
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8761
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-output.ts
|
|
8734
8762
|
var exports_tool_output = {};
|
|
8735
8763
|
__export(exports_tool_output, {
|
|
8736
8764
|
testLayer: () => testLayer28,
|
|
@@ -8790,7 +8818,7 @@ var bound = (result, options) => Effect33.gen(function* () {
|
|
|
8790
8818
|
return { _tag: "Success", result: output, encodedResult: output };
|
|
8791
8819
|
});
|
|
8792
8820
|
|
|
8793
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
8821
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/compaction.ts
|
|
8794
8822
|
var DEFAULT_RESERVE_TOKENS = 16384;
|
|
8795
8823
|
var DEFAULT_KEEP_RECENT_TOKENS = 20000;
|
|
8796
8824
|
var SUMMARY_TEMPLATE = `Summarize the conversation so another agent can continue seamlessly.
|
|
@@ -8973,7 +9001,7 @@ var truncate = (maxTokens) => ({
|
|
|
8973
9001
|
var testLayer29 = (implementation) => Layer32.succeed(Compaction, Compaction.of(implementation));
|
|
8974
9002
|
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));
|
|
8975
9003
|
|
|
8976
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9004
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/instructions.ts
|
|
8977
9005
|
var exports_instructions = {};
|
|
8978
9006
|
__export(exports_instructions, {
|
|
8979
9007
|
testLayer: () => testLayer30,
|
|
@@ -9022,7 +9050,7 @@ var renderUpdate = (epoch, context) => Effect35.gen(function* () {
|
|
|
9022
9050
|
var layer27 = (sources) => Layer33.succeed(Instructions, Instructions.of({ sources: [...sources] }));
|
|
9023
9051
|
var testLayer30 = (implementation) => Layer33.succeed(Instructions, Instructions.of(implementation));
|
|
9024
9052
|
|
|
9025
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9053
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/memory.ts
|
|
9026
9054
|
var exports_memory = {};
|
|
9027
9055
|
__export(exports_memory, {
|
|
9028
9056
|
testLayer: () => testLayer31,
|
|
@@ -9042,16 +9070,18 @@ class Memory extends Context34.Service()("@batonfx/core/Memory") {
|
|
|
9042
9070
|
}
|
|
9043
9071
|
var noop = {
|
|
9044
9072
|
recall: () => Effect36.succeed([]),
|
|
9045
|
-
remember: () => Effect36.void
|
|
9073
|
+
remember: () => Effect36.void,
|
|
9074
|
+
forget: () => Effect36.void
|
|
9046
9075
|
};
|
|
9047
9076
|
var merge = (first, second) => ({
|
|
9048
9077
|
recall: (input) => Effect36.all([first.recall(input), second.recall(input)]).pipe(Effect36.map(([firstItems, secondItems]) => [...firstItems, ...secondItems])),
|
|
9049
|
-
remember: (input) => Effect36.all([first.remember(input), second.remember(input)], { discard: true })
|
|
9078
|
+
remember: (input) => Effect36.all([first.remember(input), second.remember(input)], { discard: true }),
|
|
9079
|
+
forget: (input) => Effect36.all([first.forget(input), second.forget(input)], { discard: true })
|
|
9050
9080
|
});
|
|
9051
9081
|
var noopLayer = Layer34.succeed(Memory, Memory.of(noop));
|
|
9052
9082
|
var testLayer31 = (implementation) => Layer34.succeed(Memory, Memory.of(implementation));
|
|
9053
9083
|
|
|
9054
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9084
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-middleware.ts
|
|
9055
9085
|
var exports_model_middleware = {};
|
|
9056
9086
|
__export(exports_model_middleware, {
|
|
9057
9087
|
layer: () => layer28,
|
|
@@ -9065,7 +9095,7 @@ class ModelMiddleware extends Context35.Service()("@batonfx/core/ModelMiddleware
|
|
|
9065
9095
|
var identityLayer = Layer35.succeed(ModelMiddleware, []);
|
|
9066
9096
|
var layer28 = (middleware) => Layer35.succeed(ModelMiddleware, middleware);
|
|
9067
9097
|
|
|
9068
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9098
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-resilience.ts
|
|
9069
9099
|
var exports_model_resilience = {};
|
|
9070
9100
|
__export(exports_model_resilience, {
|
|
9071
9101
|
testLayer: () => testLayer32,
|
|
@@ -9111,7 +9141,7 @@ var apply = (model, resilience) => ({
|
|
|
9111
9141
|
}).pipe(Stream5.retry(retryStreamSchedule(resilience)))
|
|
9112
9142
|
});
|
|
9113
9143
|
|
|
9114
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9144
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/permissions.ts
|
|
9115
9145
|
var exports_permissions = {};
|
|
9116
9146
|
__export(exports_permissions, {
|
|
9117
9147
|
testLayer: () => testLayer33,
|
|
@@ -9241,7 +9271,7 @@ var ruleStoreMemory = (initialRules = []) => Layer37.effect(RuleStore, Ref9.make
|
|
|
9241
9271
|
var ruleStoreTestLayer = (implementation) => Layer37.succeed(RuleStore, RuleStore.of(implementation));
|
|
9242
9272
|
var testLayer33 = (implementation) => Layer37.succeed(Permissions, Permissions.of(implementation));
|
|
9243
9273
|
|
|
9244
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9274
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/skill-source.ts
|
|
9245
9275
|
var exports_skill_source = {};
|
|
9246
9276
|
__export(exports_skill_source, {
|
|
9247
9277
|
testLayer: () => testLayer34,
|
|
@@ -9299,7 +9329,7 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
9299
9329
|
return selected;
|
|
9300
9330
|
};
|
|
9301
9331
|
|
|
9302
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9332
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/steering.ts
|
|
9303
9333
|
var exports_steering = {};
|
|
9304
9334
|
__export(exports_steering, {
|
|
9305
9335
|
testLayer: () => testLayer35,
|
|
@@ -9356,7 +9386,7 @@ var layer30 = (options = {}) => Layer39.effect(Steering, Effect41.gen(function*
|
|
|
9356
9386
|
}));
|
|
9357
9387
|
var testLayer35 = (implementation) => Layer39.succeed(Steering, Steering.of(implementation));
|
|
9358
9388
|
|
|
9359
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9389
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-context.ts
|
|
9360
9390
|
var exports_tool_context = {};
|
|
9361
9391
|
__export(exports_tool_context, {
|
|
9362
9392
|
testLayer: () => testLayer36,
|
|
@@ -9374,7 +9404,7 @@ var layerDefault = Layer40.sync(ToolContext, () => ToolContext.of({
|
|
|
9374
9404
|
}));
|
|
9375
9405
|
var testLayer36 = (implementation) => Layer40.succeed(ToolContext, ToolContext.of(implementation));
|
|
9376
9406
|
|
|
9377
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9407
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/tool-executor.ts
|
|
9378
9408
|
var exports_tool_executor = {};
|
|
9379
9409
|
__export(exports_tool_executor, {
|
|
9380
9410
|
testLayer: () => testLayer37,
|
|
@@ -9500,7 +9530,7 @@ function router(routes) {
|
|
|
9500
9530
|
}
|
|
9501
9531
|
var testLayer37 = (implementation) => Layer41.succeed(ToolExecutor, ToolExecutor.of(implementation));
|
|
9502
9532
|
|
|
9503
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9533
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/turn-policy.ts
|
|
9504
9534
|
var exports_turn_policy = {};
|
|
9505
9535
|
__export(exports_turn_policy, {
|
|
9506
9536
|
untilToolCall: () => untilToolCall,
|
|
@@ -9539,7 +9569,7 @@ var both = (first, second) => make4((info) => Effect44.gen(function* () {
|
|
|
9539
9569
|
}));
|
|
9540
9570
|
var defaultPolicy = recurs(8);
|
|
9541
9571
|
|
|
9542
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
9572
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent.ts
|
|
9543
9573
|
function make5(nameOrOptions, options = {}) {
|
|
9544
9574
|
const resolved = typeof nameOrOptions === "string" ? { ...options, name: nameOrOptions } : nameOrOptions;
|
|
9545
9575
|
return {
|
|
@@ -10222,7 +10252,7 @@ var generateObject = (agent, options) => Stream7.runFold(streamObject(agent, opt
|
|
|
10222
10252
|
})
|
|
10223
10253
|
})
|
|
10224
10254
|
})));
|
|
10225
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10255
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/agent-tool.ts
|
|
10226
10256
|
var exports_agent_tool = {};
|
|
10227
10257
|
__export(exports_agent_tool, {
|
|
10228
10258
|
asTool: () => asTool
|
|
@@ -10280,7 +10310,7 @@ var asTool = (agent, options = {}) => {
|
|
|
10280
10310
|
});
|
|
10281
10311
|
return lazyHandled(toolkit, name, handler);
|
|
10282
10312
|
};
|
|
10283
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10313
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/guardrail.ts
|
|
10284
10314
|
var exports_guardrail = {};
|
|
10285
10315
|
__export(exports_guardrail, {
|
|
10286
10316
|
validateInput: () => validateInput2,
|
|
@@ -10360,7 +10390,7 @@ var redactOutput = (options) => ({
|
|
|
10360
10390
|
var filterOutput = (keep) => ({
|
|
10361
10391
|
transformPart: (part, context) => Effect47.succeed(part.type === "tool-call" || keep(part, context) ? Option16.some(part) : Option16.none())
|
|
10362
10392
|
});
|
|
10363
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10393
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/handoff.ts
|
|
10364
10394
|
var exports_handoff = {};
|
|
10365
10395
|
__export(exports_handoff, {
|
|
10366
10396
|
transferTool: () => transferTool,
|
|
@@ -10423,7 +10453,7 @@ var supervisor = (options) => {
|
|
|
10423
10453
|
toolkit
|
|
10424
10454
|
};
|
|
10425
10455
|
};
|
|
10426
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10456
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/model-registry.ts
|
|
10427
10457
|
var exports_model_registry = {};
|
|
10428
10458
|
__export(exports_model_registry, {
|
|
10429
10459
|
testLayer: () => testLayer38,
|
|
@@ -10512,7 +10542,7 @@ var provide = (selection, effect) => Effect49.gen(function* () {
|
|
|
10512
10542
|
return yield* service.provide(selection, effect);
|
|
10513
10543
|
});
|
|
10514
10544
|
|
|
10515
|
-
// ../../node_modules/.bun/@batonfx+core@0.3.
|
|
10545
|
+
// ../../node_modules/.bun/@batonfx+core@0.3.5/node_modules/@batonfx/core/src/index.ts
|
|
10516
10546
|
import {
|
|
10517
10547
|
AiError as AiError3,
|
|
10518
10548
|
Chat as Chat2,
|
|
@@ -11308,7 +11338,15 @@ var make6 = (options = {}) => Effect54.gen(function* () {
|
|
|
11308
11338
|
createdAt
|
|
11309
11339
|
}).pipe(Effect54.mapError(memoryError));
|
|
11310
11340
|
});
|
|
11311
|
-
|
|
11341
|
+
const forget2 = Effect54.fn("MemoryService.forget")(function* (input) {
|
|
11342
|
+
const subject = yield* decodeSubject(input.key.subject);
|
|
11343
|
+
yield* repository.forget({
|
|
11344
|
+
agent: input.key.agent,
|
|
11345
|
+
subject,
|
|
11346
|
+
...input.id === undefined ? {} : { id: input.id }
|
|
11347
|
+
}).pipe(Effect54.mapError(memoryError));
|
|
11348
|
+
});
|
|
11349
|
+
return { recall, remember: remember2, forget: forget2 };
|
|
11312
11350
|
});
|
|
11313
11351
|
var serviceLayer = (options) => Layer47.effect(Service33, make6(options).pipe(Effect54.map(Service33.of)));
|
|
11314
11352
|
var batonLayer = Layer47.effect(exports_memory.Memory, Effect54.gen(function* () {
|
|
@@ -11324,6 +11362,10 @@ var remember2 = Effect54.fn("MemoryService.remember.call")(function* (input) {
|
|
|
11324
11362
|
const service = yield* Service33;
|
|
11325
11363
|
return yield* service.remember(input);
|
|
11326
11364
|
});
|
|
11365
|
+
var forget2 = Effect54.fn("MemoryService.forget.call")(function* (input) {
|
|
11366
|
+
const service = yield* Service33;
|
|
11367
|
+
return yield* service.forget(input);
|
|
11368
|
+
});
|
|
11327
11369
|
|
|
11328
11370
|
// ../runtime/src/model/language-model-service.ts
|
|
11329
11371
|
var exports_language_model_service = {};
|
|
@@ -12639,7 +12681,8 @@ var terminalMemoryTranscript = (prompt, text3) => {
|
|
|
12639
12681
|
};
|
|
12640
12682
|
var recallOnlyMemory = (memory) => exports_memory.Memory.of({
|
|
12641
12683
|
recall: memory.recall,
|
|
12642
|
-
remember: () => Effect67.void
|
|
12684
|
+
remember: () => Effect67.void,
|
|
12685
|
+
forget: () => Effect67.void
|
|
12643
12686
|
});
|
|
12644
12687
|
var metadataValue = (metadata11, key2) => metadata11?.[key2];
|
|
12645
12688
|
var decodeOptionalNumber = (value, key2, valid) => {
|
|
@@ -16720,7 +16763,7 @@ __export(exports_language_model_registration, {
|
|
|
16720
16763
|
anthropic: () => anthropic
|
|
16721
16764
|
});
|
|
16722
16765
|
|
|
16723
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16766
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/anthropic.ts
|
|
16724
16767
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
16725
16768
|
import { Layer as Layer72 } from "effect";
|
|
16726
16769
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -16736,13 +16779,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16736
16779
|
});
|
|
16737
16780
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
16738
16781
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer72.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer72.provide(FetchHttpClient2.layer));
|
|
16739
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16782
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16740
16783
|
import { OpenAiClient as OpenAiClient3 } from "@effect/ai-openai";
|
|
16741
16784
|
import { Effect as Effect81, Layer as Layer74, Option as Option29, Stream as Stream12 } from "effect";
|
|
16742
16785
|
import { LanguageModel as LanguageModel8, Response as Response7 } from "effect/unstable/ai";
|
|
16743
16786
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
16744
16787
|
|
|
16745
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16788
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openai.ts
|
|
16746
16789
|
import { OpenAiClient as OpenAiClient2, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
16747
16790
|
import { Layer as Layer73 } from "effect";
|
|
16748
16791
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
@@ -16759,7 +16802,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
16759
16802
|
var openAiClientLayerConfig2 = OpenAiClient2.layerConfig;
|
|
16760
16803
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer73.provide(OpenAiClient2.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer73.provide(FetchHttpClient3.layer));
|
|
16761
16804
|
|
|
16762
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16805
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/deterministic.ts
|
|
16763
16806
|
var deterministicModelLayer = Layer74.effect(LanguageModel8.LanguageModel, LanguageModel8.make({
|
|
16764
16807
|
generateText: () => Effect81.succeed([{ type: "text", text: "deterministic response" }]),
|
|
16765
16808
|
streamText: () => Stream12.make(Response7.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -16783,7 +16826,7 @@ var withOpenAiOrDeterministic = (options) => Layer74.unwrap(Effect81.gen(functio
|
|
|
16783
16826
|
...Option29.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
16784
16827
|
]);
|
|
16785
16828
|
}));
|
|
16786
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16829
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openai-compat.ts
|
|
16787
16830
|
import { OpenAiClient as OpenAiClient4, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
16788
16831
|
import { Config as Config8, Layer as Layer75 } from "effect";
|
|
16789
16832
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
|
@@ -16804,7 +16847,7 @@ var clientLayerConfig = (options) => OpenAiClient4.layerConfig({
|
|
|
16804
16847
|
...options.baseUrl === undefined ? {} : { apiUrl: Config8.succeed(options.baseUrl) }
|
|
16805
16848
|
});
|
|
16806
16849
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer75.provide(clientLayerConfig(options)), Layer75.provide(FetchHttpClient5.layer));
|
|
16807
|
-
// ../../node_modules/.bun/@batonfx+providers@0.3.
|
|
16850
|
+
// ../../node_modules/.bun/@batonfx+providers@0.3.5/node_modules/@batonfx/providers/src/openrouter.ts
|
|
16808
16851
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
16809
16852
|
import { Layer as Layer76 } from "effect";
|
|
16810
16853
|
import { FetchHttpClient as FetchHttpClient6 } from "effect/unstable/http";
|
|
@@ -18,4 +18,5 @@ export declare const memoryLayer: (options?: Options) => Layer.Layer<Service | M
|
|
|
18
18
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service | Memory.Memory>;
|
|
19
19
|
export declare const recall: (input: Memory.RecallInput) => Effect.Effect<readonly Memory.Item[], Memory.MemoryError, Service>;
|
|
20
20
|
export declare const remember: (input: Memory.RememberInput) => Effect.Effect<void, Memory.MemoryError, Service>;
|
|
21
|
+
export declare const forget: (input: Memory.ForgetInput) => Effect.Effect<void, Memory.MemoryError, Service>;
|
|
21
22
|
export {};
|
|
@@ -35,9 +35,15 @@ export interface QueryInput {
|
|
|
35
35
|
readonly embedding: ReadonlyArray<number>;
|
|
36
36
|
readonly topK: number;
|
|
37
37
|
}
|
|
38
|
+
export interface ForgetInput {
|
|
39
|
+
readonly agent: string;
|
|
40
|
+
readonly subject: Ids.MemorySubjectId;
|
|
41
|
+
readonly id?: string | undefined;
|
|
42
|
+
}
|
|
38
43
|
export interface Interface {
|
|
39
44
|
readonly upsert: (input: UpsertInput) => Effect.Effect<MemoryRecord, MemoryRepositoryError>;
|
|
40
45
|
readonly query: (input: QueryInput) => Effect.Effect<ReadonlyArray<MemoryMatch>, MemoryRepositoryError>;
|
|
46
|
+
readonly forget: (input: ForgetInput) => Effect.Effect<void, MemoryRepositoryError>;
|
|
41
47
|
}
|
|
42
48
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/store-sql/MemoryRepository", Interface>;
|
|
43
49
|
export declare class Service extends Service_base {
|
|
@@ -57,4 +63,5 @@ export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
|
57
63
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
58
64
|
export declare const upsert: (input: UpsertInput) => Effect.Effect<MemoryRecord, MemoryRepositoryError, Service>;
|
|
59
65
|
export declare const query: (input: QueryInput) => Effect.Effect<readonly MemoryMatch[], MemoryRepositoryError, Service>;
|
|
66
|
+
export declare const forget: (input: ForgetInput) => Effect.Effect<void, MemoryRepositoryError, Service>;
|
|
60
67
|
export {};
|
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.0.
|
|
4
|
+
"version": "0.0.46",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "bun tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@batonfx/core": "0.3.
|
|
29
|
-
"@batonfx/providers": "0.3.
|
|
28
|
+
"@batonfx/core": "0.3.5",
|
|
29
|
+
"@batonfx/providers": "0.3.5",
|
|
30
30
|
"@effect/ai-anthropic": "4.0.0-beta.93",
|
|
31
31
|
"@effect/ai-openai": "4.0.0-beta.93",
|
|
32
32
|
"@effect/ai-openai-compat": "4.0.0-beta.93",
|