@axiom-lattice/core 2.1.11 → 2.1.12
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/index.d.mts +339 -2
- package/dist/index.d.ts +339 -2
- package/dist/index.js +527 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +510 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -37,17 +37,23 @@ __export(index_exports, {
|
|
|
37
37
|
AgentType: () => import_protocols.AgentType,
|
|
38
38
|
ChunkBuffer: () => ChunkBuffer,
|
|
39
39
|
ChunkBufferLatticeManager: () => ChunkBufferLatticeManager,
|
|
40
|
+
EmbeddingsLatticeManager: () => EmbeddingsLatticeManager,
|
|
40
41
|
GraphBuildOptions: () => import_protocols.GraphBuildOptions,
|
|
42
|
+
InMemoryAssistantStore: () => InMemoryAssistantStore,
|
|
41
43
|
InMemoryChunkBuffer: () => InMemoryChunkBuffer,
|
|
44
|
+
InMemoryThreadStore: () => InMemoryThreadStore,
|
|
42
45
|
MemoryLatticeManager: () => MemoryLatticeManager,
|
|
43
46
|
MemoryQueueClient: () => MemoryQueueClient,
|
|
44
47
|
MemoryType: () => import_protocols2.MemoryType,
|
|
45
48
|
ModelLatticeManager: () => ModelLatticeManager,
|
|
46
49
|
Protocols: () => Protocols,
|
|
47
50
|
QueueLatticeManager: () => QueueLatticeManager,
|
|
51
|
+
StoreLatticeManager: () => StoreLatticeManager,
|
|
48
52
|
ThreadStatus: () => ThreadStatus,
|
|
49
53
|
ToolLatticeManager: () => ToolLatticeManager,
|
|
54
|
+
VectorStoreLatticeManager: () => VectorStoreLatticeManager,
|
|
50
55
|
agentLatticeManager: () => agentLatticeManager,
|
|
56
|
+
embeddingsLatticeManager: () => embeddingsLatticeManager,
|
|
51
57
|
eventBus: () => eventBus,
|
|
52
58
|
eventBusDefault: () => event_bus_default,
|
|
53
59
|
getAgentClient: () => getAgentClient,
|
|
@@ -57,11 +63,16 @@ __export(index_exports, {
|
|
|
57
63
|
getAllToolDefinitions: () => getAllToolDefinitions,
|
|
58
64
|
getCheckpointSaver: () => getCheckpointSaver,
|
|
59
65
|
getChunkBuffer: () => getChunkBuffer,
|
|
66
|
+
getEmbeddingsClient: () => getEmbeddingsClient,
|
|
67
|
+
getEmbeddingsLattice: () => getEmbeddingsLattice,
|
|
60
68
|
getModelLattice: () => getModelLattice,
|
|
61
69
|
getQueueLattice: () => getQueueLattice,
|
|
70
|
+
getStoreLattice: () => getStoreLattice,
|
|
62
71
|
getToolClient: () => getToolClient,
|
|
63
72
|
getToolDefinition: () => getToolDefinition,
|
|
64
73
|
getToolLattice: () => getToolLattice,
|
|
74
|
+
getVectorStoreClient: () => getVectorStoreClient,
|
|
75
|
+
getVectorStoreLattice: () => getVectorStoreLattice,
|
|
65
76
|
hasChunkBuffer: () => hasChunkBuffer,
|
|
66
77
|
modelLatticeManager: () => modelLatticeManager,
|
|
67
78
|
queueLatticeManager: () => queueLatticeManager,
|
|
@@ -69,12 +80,17 @@ __export(index_exports, {
|
|
|
69
80
|
registerAgentLattices: () => registerAgentLattices,
|
|
70
81
|
registerCheckpointSaver: () => registerCheckpointSaver,
|
|
71
82
|
registerChunkBuffer: () => registerChunkBuffer,
|
|
83
|
+
registerEmbeddingsLattice: () => registerEmbeddingsLattice,
|
|
72
84
|
registerModelLattice: () => registerModelLattice,
|
|
73
85
|
registerQueueLattice: () => registerQueueLattice,
|
|
86
|
+
registerStoreLattice: () => registerStoreLattice,
|
|
74
87
|
registerToolLattice: () => registerToolLattice,
|
|
88
|
+
registerVectorStoreLattice: () => registerVectorStoreLattice,
|
|
89
|
+
storeLatticeManager: () => storeLatticeManager,
|
|
75
90
|
toolLatticeManager: () => toolLatticeManager,
|
|
76
91
|
validateAgentInput: () => validateAgentInput,
|
|
77
|
-
validateToolInput: () => validateToolInput
|
|
92
|
+
validateToolInput: () => validateToolInput,
|
|
93
|
+
vectorStoreLatticeManager: () => vectorStoreLatticeManager
|
|
78
94
|
});
|
|
79
95
|
module.exports = __toCommonJS(index_exports);
|
|
80
96
|
|
|
@@ -650,30 +666,17 @@ registerToolLattice(
|
|
|
650
666
|
topic = "general",
|
|
651
667
|
includeRawContent = false
|
|
652
668
|
}, config) => {
|
|
653
|
-
console.log("[DEBUG][internet_search] Starting search with params:", {
|
|
654
|
-
query,
|
|
655
|
-
maxResults,
|
|
656
|
-
topic,
|
|
657
|
-
includeRawContent
|
|
658
|
-
});
|
|
659
|
-
console.log("[DEBUG][internet_search] Creating TavilySearch instance...");
|
|
660
669
|
const tavilySearch = new import_tavily.TavilySearch({
|
|
661
670
|
maxResults,
|
|
662
671
|
tavilyApiKey: process.env.TAVILY_API_KEY,
|
|
663
672
|
includeRawContent,
|
|
664
673
|
topic
|
|
665
674
|
});
|
|
666
|
-
console.log("[DEBUG][internet_search] Invoking search for query:", query);
|
|
667
675
|
const tavilyResponse = await tavilySearch.invoke({ query });
|
|
668
|
-
console.log(
|
|
669
|
-
"[DEBUG][internet_search] Search completed. Results count:",
|
|
670
|
-
tavilyResponse.results?.length ?? 0
|
|
671
|
-
);
|
|
672
676
|
const result = genUICard("Internet Search:" + query, "generic_data_table", {
|
|
673
677
|
dataSource: tavilyResponse.results
|
|
674
678
|
});
|
|
675
|
-
|
|
676
|
-
return result;
|
|
679
|
+
return JSON.stringify(tavilyResponse.results);
|
|
677
680
|
}
|
|
678
681
|
);
|
|
679
682
|
|
|
@@ -2182,7 +2185,6 @@ function createTaskTool(options) {
|
|
|
2182
2185
|
input: { ...subagentState, message: description }
|
|
2183
2186
|
});
|
|
2184
2187
|
const result = workerResult.finalState?.values;
|
|
2185
|
-
console.log("workerResult", workerResult);
|
|
2186
2188
|
if (!config.toolCall?.id) {
|
|
2187
2189
|
throw new Error("Tool call ID is required for subagent invocation");
|
|
2188
2190
|
}
|
|
@@ -3273,6 +3275,498 @@ var getChunkBuffer = (key) => ChunkBufferLatticeManager.getInstance().get(key);
|
|
|
3273
3275
|
var registerChunkBuffer = (key, buffer) => ChunkBufferLatticeManager.getInstance().register(key, buffer);
|
|
3274
3276
|
var hasChunkBuffer = (key) => ChunkBufferLatticeManager.getInstance().has(key);
|
|
3275
3277
|
|
|
3278
|
+
// src/store_lattice/InMemoryThreadStore.ts
|
|
3279
|
+
var InMemoryThreadStore = class {
|
|
3280
|
+
constructor() {
|
|
3281
|
+
// Map<assistantId, Map<threadId, Thread>>
|
|
3282
|
+
this.threads = /* @__PURE__ */ new Map();
|
|
3283
|
+
}
|
|
3284
|
+
/**
|
|
3285
|
+
* Get all threads for a specific assistant
|
|
3286
|
+
*/
|
|
3287
|
+
async getThreadsByAssistantId(assistantId) {
|
|
3288
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3289
|
+
if (!assistantThreads) {
|
|
3290
|
+
return [];
|
|
3291
|
+
}
|
|
3292
|
+
return Array.from(assistantThreads.values());
|
|
3293
|
+
}
|
|
3294
|
+
/**
|
|
3295
|
+
* Get a thread by ID for a specific assistant
|
|
3296
|
+
*/
|
|
3297
|
+
async getThreadById(assistantId, threadId) {
|
|
3298
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3299
|
+
if (!assistantThreads) {
|
|
3300
|
+
return void 0;
|
|
3301
|
+
}
|
|
3302
|
+
return assistantThreads.get(threadId);
|
|
3303
|
+
}
|
|
3304
|
+
/**
|
|
3305
|
+
* Create a new thread for an assistant
|
|
3306
|
+
*/
|
|
3307
|
+
async createThread(assistantId, threadId, data) {
|
|
3308
|
+
const now = /* @__PURE__ */ new Date();
|
|
3309
|
+
const thread = {
|
|
3310
|
+
id: threadId,
|
|
3311
|
+
assistantId,
|
|
3312
|
+
metadata: data.metadata || {},
|
|
3313
|
+
createdAt: now,
|
|
3314
|
+
updatedAt: now
|
|
3315
|
+
};
|
|
3316
|
+
if (!this.threads.has(assistantId)) {
|
|
3317
|
+
this.threads.set(assistantId, /* @__PURE__ */ new Map());
|
|
3318
|
+
}
|
|
3319
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3320
|
+
assistantThreads.set(threadId, thread);
|
|
3321
|
+
return thread;
|
|
3322
|
+
}
|
|
3323
|
+
/**
|
|
3324
|
+
* Update an existing thread
|
|
3325
|
+
*/
|
|
3326
|
+
async updateThread(assistantId, threadId, updates) {
|
|
3327
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3328
|
+
if (!assistantThreads) {
|
|
3329
|
+
return null;
|
|
3330
|
+
}
|
|
3331
|
+
const existing = assistantThreads.get(threadId);
|
|
3332
|
+
if (!existing) {
|
|
3333
|
+
return null;
|
|
3334
|
+
}
|
|
3335
|
+
const updated = {
|
|
3336
|
+
...existing,
|
|
3337
|
+
metadata: {
|
|
3338
|
+
...existing.metadata,
|
|
3339
|
+
...updates.metadata || {}
|
|
3340
|
+
},
|
|
3341
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
3342
|
+
};
|
|
3343
|
+
assistantThreads.set(threadId, updated);
|
|
3344
|
+
return updated;
|
|
3345
|
+
}
|
|
3346
|
+
/**
|
|
3347
|
+
* Delete a thread by ID
|
|
3348
|
+
*/
|
|
3349
|
+
async deleteThread(assistantId, threadId) {
|
|
3350
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3351
|
+
if (!assistantThreads) {
|
|
3352
|
+
return false;
|
|
3353
|
+
}
|
|
3354
|
+
return assistantThreads.delete(threadId);
|
|
3355
|
+
}
|
|
3356
|
+
/**
|
|
3357
|
+
* Check if thread exists
|
|
3358
|
+
*/
|
|
3359
|
+
async hasThread(assistantId, threadId) {
|
|
3360
|
+
const assistantThreads = this.threads.get(assistantId);
|
|
3361
|
+
if (!assistantThreads) {
|
|
3362
|
+
return false;
|
|
3363
|
+
}
|
|
3364
|
+
return assistantThreads.has(threadId);
|
|
3365
|
+
}
|
|
3366
|
+
/**
|
|
3367
|
+
* Clear all threads (useful for testing)
|
|
3368
|
+
*/
|
|
3369
|
+
clear() {
|
|
3370
|
+
this.threads.clear();
|
|
3371
|
+
}
|
|
3372
|
+
/**
|
|
3373
|
+
* Get all threads for all assistants (useful for debugging)
|
|
3374
|
+
*/
|
|
3375
|
+
getAllThreads() {
|
|
3376
|
+
const allThreads = [];
|
|
3377
|
+
for (const assistantThreads of this.threads.values()) {
|
|
3378
|
+
allThreads.push(...Array.from(assistantThreads.values()));
|
|
3379
|
+
}
|
|
3380
|
+
return allThreads;
|
|
3381
|
+
}
|
|
3382
|
+
};
|
|
3383
|
+
|
|
3384
|
+
// src/store_lattice/InMemoryAssistantStore.ts
|
|
3385
|
+
var InMemoryAssistantStore = class {
|
|
3386
|
+
constructor() {
|
|
3387
|
+
this.assistants = /* @__PURE__ */ new Map();
|
|
3388
|
+
}
|
|
3389
|
+
/**
|
|
3390
|
+
* Get all assistants
|
|
3391
|
+
*/
|
|
3392
|
+
async getAllAssistants() {
|
|
3393
|
+
return Array.from(this.assistants.values());
|
|
3394
|
+
}
|
|
3395
|
+
/**
|
|
3396
|
+
* Get assistant by ID
|
|
3397
|
+
*/
|
|
3398
|
+
async getAssistantById(id) {
|
|
3399
|
+
return this.assistants.get(id) || null;
|
|
3400
|
+
}
|
|
3401
|
+
/**
|
|
3402
|
+
* Create a new assistant
|
|
3403
|
+
*/
|
|
3404
|
+
async createAssistant(id, data) {
|
|
3405
|
+
const now = /* @__PURE__ */ new Date();
|
|
3406
|
+
const assistant = {
|
|
3407
|
+
id,
|
|
3408
|
+
name: data.name,
|
|
3409
|
+
description: data.description,
|
|
3410
|
+
graphDefinition: data.graphDefinition,
|
|
3411
|
+
createdAt: now,
|
|
3412
|
+
updatedAt: now
|
|
3413
|
+
};
|
|
3414
|
+
this.assistants.set(id, assistant);
|
|
3415
|
+
return assistant;
|
|
3416
|
+
}
|
|
3417
|
+
/**
|
|
3418
|
+
* Update an existing assistant
|
|
3419
|
+
*/
|
|
3420
|
+
async updateAssistant(id, updates) {
|
|
3421
|
+
const existing = this.assistants.get(id);
|
|
3422
|
+
if (!existing) {
|
|
3423
|
+
return null;
|
|
3424
|
+
}
|
|
3425
|
+
const updated = {
|
|
3426
|
+
...existing,
|
|
3427
|
+
...updates,
|
|
3428
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
3429
|
+
};
|
|
3430
|
+
this.assistants.set(id, updated);
|
|
3431
|
+
return updated;
|
|
3432
|
+
}
|
|
3433
|
+
/**
|
|
3434
|
+
* Delete an assistant by ID
|
|
3435
|
+
*/
|
|
3436
|
+
async deleteAssistant(id) {
|
|
3437
|
+
return this.assistants.delete(id);
|
|
3438
|
+
}
|
|
3439
|
+
/**
|
|
3440
|
+
* Check if assistant exists
|
|
3441
|
+
*/
|
|
3442
|
+
async hasAssistant(id) {
|
|
3443
|
+
return this.assistants.has(id);
|
|
3444
|
+
}
|
|
3445
|
+
/**
|
|
3446
|
+
* Clear all assistants (useful for testing)
|
|
3447
|
+
*/
|
|
3448
|
+
clear() {
|
|
3449
|
+
this.assistants.clear();
|
|
3450
|
+
}
|
|
3451
|
+
};
|
|
3452
|
+
|
|
3453
|
+
// src/store_lattice/StoreLatticeManager.ts
|
|
3454
|
+
var StoreLatticeManager = class _StoreLatticeManager extends BaseLatticeManager {
|
|
3455
|
+
/**
|
|
3456
|
+
* Get StoreLatticeManager singleton instance
|
|
3457
|
+
*/
|
|
3458
|
+
static getInstance() {
|
|
3459
|
+
if (!_StoreLatticeManager._instance) {
|
|
3460
|
+
_StoreLatticeManager._instance = new _StoreLatticeManager();
|
|
3461
|
+
}
|
|
3462
|
+
return _StoreLatticeManager._instance;
|
|
3463
|
+
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Get Lattice type prefix
|
|
3466
|
+
*/
|
|
3467
|
+
getLatticeType() {
|
|
3468
|
+
return "stores";
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Generate composite key from key and type
|
|
3472
|
+
* @param key Lattice key name
|
|
3473
|
+
* @param type Store type
|
|
3474
|
+
* @returns Composite key string
|
|
3475
|
+
*/
|
|
3476
|
+
getCompositeKey(key, type) {
|
|
3477
|
+
return `${key}:${type}`;
|
|
3478
|
+
}
|
|
3479
|
+
/**
|
|
3480
|
+
* Register store Lattice with type safety
|
|
3481
|
+
* Uses composite key (key + type) as unique identifier
|
|
3482
|
+
* @param key Lattice key name
|
|
3483
|
+
* @param type Store type (e.g., "thread")
|
|
3484
|
+
* @param store Store implementation instance matching the type
|
|
3485
|
+
*/
|
|
3486
|
+
registerLattice(key, type, store) {
|
|
3487
|
+
const storeLattice = {
|
|
3488
|
+
key,
|
|
3489
|
+
type,
|
|
3490
|
+
store
|
|
3491
|
+
};
|
|
3492
|
+
const compositeKey = this.getCompositeKey(key, type);
|
|
3493
|
+
this.register(compositeKey, storeLattice);
|
|
3494
|
+
}
|
|
3495
|
+
/**
|
|
3496
|
+
* Get StoreLattice with type safety
|
|
3497
|
+
* Uses composite key (key + type) to retrieve the store
|
|
3498
|
+
* @param key Lattice key name
|
|
3499
|
+
* @param type Expected store type for type checking
|
|
3500
|
+
* @returns StoreLattice with typed store
|
|
3501
|
+
*/
|
|
3502
|
+
getStoreLattice(key, type) {
|
|
3503
|
+
const compositeKey = this.getCompositeKey(key, type);
|
|
3504
|
+
const storeLattice = this.get(compositeKey);
|
|
3505
|
+
if (!storeLattice) {
|
|
3506
|
+
throw new Error(`StoreLattice ${key}:${type} not found`);
|
|
3507
|
+
}
|
|
3508
|
+
if (storeLattice.type !== type) {
|
|
3509
|
+
throw new Error(
|
|
3510
|
+
`StoreLattice ${key}:${type} has type "${storeLattice.type}", expected "${type}"`
|
|
3511
|
+
);
|
|
3512
|
+
}
|
|
3513
|
+
return storeLattice;
|
|
3514
|
+
}
|
|
3515
|
+
/**
|
|
3516
|
+
* Get StoreLattice without type checking (for backward compatibility)
|
|
3517
|
+
* @param key Lattice key name
|
|
3518
|
+
* @param type Store type
|
|
3519
|
+
* @returns StoreLattice (type may be unknown)
|
|
3520
|
+
*/
|
|
3521
|
+
getStoreLatticeUnsafe(key, type) {
|
|
3522
|
+
const compositeKey = this.getCompositeKey(key, type);
|
|
3523
|
+
const storeLattice = this.get(compositeKey);
|
|
3524
|
+
if (!storeLattice) {
|
|
3525
|
+
throw new Error(`StoreLattice ${key}:${type} not found`);
|
|
3526
|
+
}
|
|
3527
|
+
return storeLattice;
|
|
3528
|
+
}
|
|
3529
|
+
/**
|
|
3530
|
+
* Get all Lattices
|
|
3531
|
+
*/
|
|
3532
|
+
getAllLattices() {
|
|
3533
|
+
return this.getAll();
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Check if Lattice exists
|
|
3537
|
+
* Uses composite key (key + type) to check existence
|
|
3538
|
+
* @param key Lattice key name
|
|
3539
|
+
* @param type Store type
|
|
3540
|
+
*/
|
|
3541
|
+
hasLattice(key, type) {
|
|
3542
|
+
const compositeKey = this.getCompositeKey(key, type);
|
|
3543
|
+
return this.has(compositeKey);
|
|
3544
|
+
}
|
|
3545
|
+
/**
|
|
3546
|
+
* Remove Lattice
|
|
3547
|
+
* Uses composite key (key + type) to remove the store
|
|
3548
|
+
* @param key Lattice key name
|
|
3549
|
+
* @param type Store type
|
|
3550
|
+
*/
|
|
3551
|
+
removeLattice(key, type) {
|
|
3552
|
+
const compositeKey = this.getCompositeKey(key, type);
|
|
3553
|
+
return this.remove(compositeKey);
|
|
3554
|
+
}
|
|
3555
|
+
/**
|
|
3556
|
+
* Clear all Lattices
|
|
3557
|
+
*/
|
|
3558
|
+
clearLattices() {
|
|
3559
|
+
this.clear();
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* Get Lattice count
|
|
3563
|
+
*/
|
|
3564
|
+
getLatticeCount() {
|
|
3565
|
+
return this.count();
|
|
3566
|
+
}
|
|
3567
|
+
/**
|
|
3568
|
+
* Get Lattice key list
|
|
3569
|
+
*/
|
|
3570
|
+
getLatticeKeys() {
|
|
3571
|
+
return this.keys();
|
|
3572
|
+
}
|
|
3573
|
+
};
|
|
3574
|
+
var storeLatticeManager = StoreLatticeManager.getInstance();
|
|
3575
|
+
var registerStoreLattice = (key, type, store) => storeLatticeManager.registerLattice(key, type, store);
|
|
3576
|
+
var getStoreLattice = (key, type) => storeLatticeManager.getStoreLattice(key, type);
|
|
3577
|
+
var defaultThreadStore = new InMemoryThreadStore();
|
|
3578
|
+
var defaultAssistantStore = new InMemoryAssistantStore();
|
|
3579
|
+
storeLatticeManager.registerLattice("default", "thread", defaultThreadStore);
|
|
3580
|
+
storeLatticeManager.registerLattice(
|
|
3581
|
+
"default",
|
|
3582
|
+
"assistant",
|
|
3583
|
+
defaultAssistantStore
|
|
3584
|
+
);
|
|
3585
|
+
|
|
3586
|
+
// src/embeddings_lattice/EmbeddingsLatticeManager.ts
|
|
3587
|
+
var EmbeddingsLatticeManager = class _EmbeddingsLatticeManager extends BaseLatticeManager {
|
|
3588
|
+
/**
|
|
3589
|
+
* Get EmbeddingsLatticeManager singleton instance
|
|
3590
|
+
*/
|
|
3591
|
+
static getInstance() {
|
|
3592
|
+
if (!_EmbeddingsLatticeManager._instance) {
|
|
3593
|
+
_EmbeddingsLatticeManager._instance = new _EmbeddingsLatticeManager();
|
|
3594
|
+
}
|
|
3595
|
+
return _EmbeddingsLatticeManager._instance;
|
|
3596
|
+
}
|
|
3597
|
+
/**
|
|
3598
|
+
* Get Lattice type prefix
|
|
3599
|
+
*/
|
|
3600
|
+
getLatticeType() {
|
|
3601
|
+
return "embeddings";
|
|
3602
|
+
}
|
|
3603
|
+
/**
|
|
3604
|
+
* Register embeddings Lattice
|
|
3605
|
+
* @param key Lattice key name
|
|
3606
|
+
* @param embeddings Embeddings instance
|
|
3607
|
+
*/
|
|
3608
|
+
registerLattice(key, embeddings) {
|
|
3609
|
+
const embeddingsLattice = {
|
|
3610
|
+
key,
|
|
3611
|
+
client: embeddings
|
|
3612
|
+
};
|
|
3613
|
+
this.register(key, embeddingsLattice);
|
|
3614
|
+
}
|
|
3615
|
+
/**
|
|
3616
|
+
* Get EmbeddingsLattice
|
|
3617
|
+
* @param key Lattice key name
|
|
3618
|
+
*/
|
|
3619
|
+
getEmbeddingsLattice(key) {
|
|
3620
|
+
const embeddingsLattice = this.get(key);
|
|
3621
|
+
if (!embeddingsLattice) {
|
|
3622
|
+
throw new Error(`EmbeddingsLattice ${key} not found`);
|
|
3623
|
+
}
|
|
3624
|
+
return embeddingsLattice;
|
|
3625
|
+
}
|
|
3626
|
+
/**
|
|
3627
|
+
* Get all Lattices
|
|
3628
|
+
*/
|
|
3629
|
+
getAllLattices() {
|
|
3630
|
+
return this.getAll();
|
|
3631
|
+
}
|
|
3632
|
+
/**
|
|
3633
|
+
* Check if Lattice exists
|
|
3634
|
+
* @param key Lattice key name
|
|
3635
|
+
*/
|
|
3636
|
+
hasLattice(key) {
|
|
3637
|
+
return this.has(key);
|
|
3638
|
+
}
|
|
3639
|
+
/**
|
|
3640
|
+
* Remove Lattice
|
|
3641
|
+
* @param key Lattice key name
|
|
3642
|
+
*/
|
|
3643
|
+
removeLattice(key) {
|
|
3644
|
+
return this.remove(key);
|
|
3645
|
+
}
|
|
3646
|
+
/**
|
|
3647
|
+
* Clear all Lattices
|
|
3648
|
+
*/
|
|
3649
|
+
clearLattices() {
|
|
3650
|
+
this.clear();
|
|
3651
|
+
}
|
|
3652
|
+
/**
|
|
3653
|
+
* Get Lattice count
|
|
3654
|
+
*/
|
|
3655
|
+
getLatticeCount() {
|
|
3656
|
+
return this.count();
|
|
3657
|
+
}
|
|
3658
|
+
/**
|
|
3659
|
+
* Get Lattice key list
|
|
3660
|
+
*/
|
|
3661
|
+
getLatticeKeys() {
|
|
3662
|
+
return this.keys();
|
|
3663
|
+
}
|
|
3664
|
+
/**
|
|
3665
|
+
* Get embeddings client
|
|
3666
|
+
* @param key Lattice key name
|
|
3667
|
+
*/
|
|
3668
|
+
getEmbeddingsClient(key) {
|
|
3669
|
+
const embeddingsLattice = this.getEmbeddingsLattice(key);
|
|
3670
|
+
return embeddingsLattice.client;
|
|
3671
|
+
}
|
|
3672
|
+
};
|
|
3673
|
+
var embeddingsLatticeManager = EmbeddingsLatticeManager.getInstance();
|
|
3674
|
+
var registerEmbeddingsLattice = (key, embeddings) => embeddingsLatticeManager.registerLattice(key, embeddings);
|
|
3675
|
+
var getEmbeddingsLattice = (key) => embeddingsLatticeManager.getEmbeddingsLattice(key);
|
|
3676
|
+
var getEmbeddingsClient = (key) => embeddingsLatticeManager.getEmbeddingsClient(key);
|
|
3677
|
+
|
|
3678
|
+
// src/vectorstore_lattice/VectorStoreLatticeManager.ts
|
|
3679
|
+
var VectorStoreLatticeManager = class _VectorStoreLatticeManager extends BaseLatticeManager {
|
|
3680
|
+
/**
|
|
3681
|
+
* Get VectorStoreLatticeManager singleton instance
|
|
3682
|
+
*/
|
|
3683
|
+
static getInstance() {
|
|
3684
|
+
if (!_VectorStoreLatticeManager._instance) {
|
|
3685
|
+
_VectorStoreLatticeManager._instance = new _VectorStoreLatticeManager();
|
|
3686
|
+
}
|
|
3687
|
+
return _VectorStoreLatticeManager._instance;
|
|
3688
|
+
}
|
|
3689
|
+
/**
|
|
3690
|
+
* Get Lattice type prefix
|
|
3691
|
+
*/
|
|
3692
|
+
getLatticeType() {
|
|
3693
|
+
return "vectorstores";
|
|
3694
|
+
}
|
|
3695
|
+
/**
|
|
3696
|
+
* Register vector store Lattice
|
|
3697
|
+
* @param key Lattice key name
|
|
3698
|
+
* @param vectorStore VectorStore instance
|
|
3699
|
+
*/
|
|
3700
|
+
registerLattice(key, vectorStore) {
|
|
3701
|
+
const vectorStoreLattice = {
|
|
3702
|
+
key,
|
|
3703
|
+
client: vectorStore
|
|
3704
|
+
};
|
|
3705
|
+
this.register(key, vectorStoreLattice);
|
|
3706
|
+
}
|
|
3707
|
+
/**
|
|
3708
|
+
* Get VectorStoreLattice
|
|
3709
|
+
* @param key Lattice key name
|
|
3710
|
+
*/
|
|
3711
|
+
getVectorStoreLattice(key) {
|
|
3712
|
+
const vectorStoreLattice = this.get(key);
|
|
3713
|
+
if (!vectorStoreLattice) {
|
|
3714
|
+
throw new Error(`VectorStoreLattice ${key} not found`);
|
|
3715
|
+
}
|
|
3716
|
+
return vectorStoreLattice;
|
|
3717
|
+
}
|
|
3718
|
+
/**
|
|
3719
|
+
* Get all Lattices
|
|
3720
|
+
*/
|
|
3721
|
+
getAllLattices() {
|
|
3722
|
+
return this.getAll();
|
|
3723
|
+
}
|
|
3724
|
+
/**
|
|
3725
|
+
* Check if Lattice exists
|
|
3726
|
+
* @param key Lattice key name
|
|
3727
|
+
*/
|
|
3728
|
+
hasLattice(key) {
|
|
3729
|
+
return this.has(key);
|
|
3730
|
+
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Remove Lattice
|
|
3733
|
+
* @param key Lattice key name
|
|
3734
|
+
*/
|
|
3735
|
+
removeLattice(key) {
|
|
3736
|
+
return this.remove(key);
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Clear all Lattices
|
|
3740
|
+
*/
|
|
3741
|
+
clearLattices() {
|
|
3742
|
+
this.clear();
|
|
3743
|
+
}
|
|
3744
|
+
/**
|
|
3745
|
+
* Get Lattice count
|
|
3746
|
+
*/
|
|
3747
|
+
getLatticeCount() {
|
|
3748
|
+
return this.count();
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Get Lattice key list
|
|
3752
|
+
*/
|
|
3753
|
+
getLatticeKeys() {
|
|
3754
|
+
return this.keys();
|
|
3755
|
+
}
|
|
3756
|
+
/**
|
|
3757
|
+
* Get vector store client
|
|
3758
|
+
* @param key Lattice key name
|
|
3759
|
+
*/
|
|
3760
|
+
getVectorStoreClient(key) {
|
|
3761
|
+
const vectorStoreLattice = this.getVectorStoreLattice(key);
|
|
3762
|
+
return vectorStoreLattice.client;
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
var vectorStoreLatticeManager = VectorStoreLatticeManager.getInstance();
|
|
3766
|
+
var registerVectorStoreLattice = (key, vectorStore) => vectorStoreLatticeManager.registerLattice(key, vectorStore);
|
|
3767
|
+
var getVectorStoreLattice = (key) => vectorStoreLatticeManager.getVectorStoreLattice(key);
|
|
3768
|
+
var getVectorStoreClient = (key) => vectorStoreLatticeManager.getVectorStoreClient(key);
|
|
3769
|
+
|
|
3276
3770
|
// src/index.ts
|
|
3277
3771
|
var Protocols = __toESM(require("@axiom-lattice/protocols"));
|
|
3278
3772
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -3284,17 +3778,23 @@ var Protocols = __toESM(require("@axiom-lattice/protocols"));
|
|
|
3284
3778
|
AgentType,
|
|
3285
3779
|
ChunkBuffer,
|
|
3286
3780
|
ChunkBufferLatticeManager,
|
|
3781
|
+
EmbeddingsLatticeManager,
|
|
3287
3782
|
GraphBuildOptions,
|
|
3783
|
+
InMemoryAssistantStore,
|
|
3288
3784
|
InMemoryChunkBuffer,
|
|
3785
|
+
InMemoryThreadStore,
|
|
3289
3786
|
MemoryLatticeManager,
|
|
3290
3787
|
MemoryQueueClient,
|
|
3291
3788
|
MemoryType,
|
|
3292
3789
|
ModelLatticeManager,
|
|
3293
3790
|
Protocols,
|
|
3294
3791
|
QueueLatticeManager,
|
|
3792
|
+
StoreLatticeManager,
|
|
3295
3793
|
ThreadStatus,
|
|
3296
3794
|
ToolLatticeManager,
|
|
3795
|
+
VectorStoreLatticeManager,
|
|
3297
3796
|
agentLatticeManager,
|
|
3797
|
+
embeddingsLatticeManager,
|
|
3298
3798
|
eventBus,
|
|
3299
3799
|
eventBusDefault,
|
|
3300
3800
|
getAgentClient,
|
|
@@ -3304,11 +3804,16 @@ var Protocols = __toESM(require("@axiom-lattice/protocols"));
|
|
|
3304
3804
|
getAllToolDefinitions,
|
|
3305
3805
|
getCheckpointSaver,
|
|
3306
3806
|
getChunkBuffer,
|
|
3807
|
+
getEmbeddingsClient,
|
|
3808
|
+
getEmbeddingsLattice,
|
|
3307
3809
|
getModelLattice,
|
|
3308
3810
|
getQueueLattice,
|
|
3811
|
+
getStoreLattice,
|
|
3309
3812
|
getToolClient,
|
|
3310
3813
|
getToolDefinition,
|
|
3311
3814
|
getToolLattice,
|
|
3815
|
+
getVectorStoreClient,
|
|
3816
|
+
getVectorStoreLattice,
|
|
3312
3817
|
hasChunkBuffer,
|
|
3313
3818
|
modelLatticeManager,
|
|
3314
3819
|
queueLatticeManager,
|
|
@@ -3316,11 +3821,16 @@ var Protocols = __toESM(require("@axiom-lattice/protocols"));
|
|
|
3316
3821
|
registerAgentLattices,
|
|
3317
3822
|
registerCheckpointSaver,
|
|
3318
3823
|
registerChunkBuffer,
|
|
3824
|
+
registerEmbeddingsLattice,
|
|
3319
3825
|
registerModelLattice,
|
|
3320
3826
|
registerQueueLattice,
|
|
3827
|
+
registerStoreLattice,
|
|
3321
3828
|
registerToolLattice,
|
|
3829
|
+
registerVectorStoreLattice,
|
|
3830
|
+
storeLatticeManager,
|
|
3322
3831
|
toolLatticeManager,
|
|
3323
3832
|
validateAgentInput,
|
|
3324
|
-
validateToolInput
|
|
3833
|
+
validateToolInput,
|
|
3834
|
+
vectorStoreLatticeManager
|
|
3325
3835
|
});
|
|
3326
3836
|
//# sourceMappingURL=index.js.map
|