@ai.ntellect/core 0.7.8 → 1.0.0
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/README.md +158 -81
- package/index.ts +462 -22
- package/package copy.json +21 -0
- package/package.json +9 -44
- package/tsconfig.json +108 -22
- package/types.ts +62 -0
- package/utils/executor.ts +42 -0
- package/.mocharc.json +0 -5
- package/dist/graph/controller.d.ts +0 -31
- package/dist/graph/controller.d.ts.map +0 -1
- package/dist/graph/controller.js +0 -71
- package/dist/graph/controller.js.map +0 -1
- package/dist/graph/event-manager.d.ts +0 -93
- package/dist/graph/event-manager.d.ts.map +0 -1
- package/dist/graph/event-manager.js +0 -296
- package/dist/graph/event-manager.js.map +0 -1
- package/dist/graph/index.d.ts +0 -159
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -303
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/logger.d.ts +0 -46
- package/dist/graph/logger.d.ts.map +0 -1
- package/dist/graph/logger.js +0 -69
- package/dist/graph/logger.js.map +0 -1
- package/dist/graph/node.d.ts +0 -93
- package/dist/graph/node.d.ts.map +0 -1
- package/dist/graph/node.js +0 -259
- package/dist/graph/node.js.map +0 -1
- package/dist/graph/observer.d.ts +0 -115
- package/dist/graph/observer.d.ts.map +0 -1
- package/dist/graph/observer.js +0 -198
- package/dist/graph/observer.js.map +0 -1
- package/dist/index.d.ts +0 -26
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -42
- package/dist/index.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -447
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -75
- package/dist/interfaces/index.js.map +0 -1
- package/dist/modules/agenda/adapters/node-cron/index.d.ts +0 -17
- package/dist/modules/agenda/adapters/node-cron/index.d.ts.map +0 -1
- package/dist/modules/agenda/adapters/node-cron/index.js +0 -30
- package/dist/modules/agenda/adapters/node-cron/index.js.map +0 -1
- package/dist/modules/agenda/index.d.ts +0 -63
- package/dist/modules/agenda/index.d.ts.map +0 -1
- package/dist/modules/agenda/index.js +0 -141
- package/dist/modules/agenda/index.js.map +0 -1
- package/dist/modules/embedding/adapters/ai/index.d.ts +0 -29
- package/dist/modules/embedding/adapters/ai/index.d.ts.map +0 -1
- package/dist/modules/embedding/adapters/ai/index.js +0 -58
- package/dist/modules/embedding/adapters/ai/index.js.map +0 -1
- package/dist/modules/embedding/index.d.ts +0 -36
- package/dist/modules/embedding/index.d.ts.map +0 -1
- package/dist/modules/embedding/index.js +0 -60
- package/dist/modules/embedding/index.js.map +0 -1
- package/dist/modules/memory/adapters/in-memory/index.d.ts +0 -120
- package/dist/modules/memory/adapters/in-memory/index.d.ts.map +0 -1
- package/dist/modules/memory/adapters/in-memory/index.js +0 -211
- package/dist/modules/memory/adapters/in-memory/index.js.map +0 -1
- package/dist/modules/memory/adapters/meilisearch/index.d.ts +0 -110
- package/dist/modules/memory/adapters/meilisearch/index.d.ts.map +0 -1
- package/dist/modules/memory/adapters/meilisearch/index.js +0 -321
- package/dist/modules/memory/adapters/meilisearch/index.js.map +0 -1
- package/dist/modules/memory/adapters/redis/index.d.ts +0 -82
- package/dist/modules/memory/adapters/redis/index.d.ts.map +0 -1
- package/dist/modules/memory/adapters/redis/index.js +0 -159
- package/dist/modules/memory/adapters/redis/index.js.map +0 -1
- package/dist/modules/memory/index.d.ts +0 -67
- package/dist/modules/memory/index.d.ts.map +0 -1
- package/dist/modules/memory/index.js +0 -104
- package/dist/modules/memory/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -170
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/generate-action-schema.d.ts +0 -5
- package/dist/utils/generate-action-schema.d.ts.map +0 -1
- package/dist/utils/generate-action-schema.js +0 -44
- package/dist/utils/generate-action-schema.js.map +0 -1
- package/dist/utils/header-builder.d.ts +0 -12
- package/dist/utils/header-builder.d.ts.map +0 -1
- package/dist/utils/header-builder.js +0 -35
- package/dist/utils/header-builder.js.map +0 -1
- package/graph/controller.ts +0 -74
- package/graph/event-manager.ts +0 -363
- package/graph/index.ts +0 -395
- package/graph/logger.ts +0 -70
- package/graph/node.ts +0 -327
- package/graph/observer.ts +0 -368
- package/interfaces/index.ts +0 -548
- package/modules/agenda/adapters/node-cron/index.ts +0 -25
- package/modules/agenda/index.ts +0 -146
- package/modules/embedding/adapters/ai/index.ts +0 -42
- package/modules/embedding/index.ts +0 -45
- package/modules/memory/adapters/in-memory/index.ts +0 -207
- package/modules/memory/adapters/meilisearch/index.ts +0 -361
- package/modules/memory/adapters/redis/index.ts +0 -164
- package/modules/memory/index.ts +0 -93
- package/test/graph/controller.test.ts +0 -187
- package/test/graph/event-manager.test.ts +0 -118
- package/test/graph/index.test.ts +0 -684
- package/test/graph/node.test.ts +0 -655
- package/test/graph/observer.test.ts +0 -398
- package/test/modules/agenda/node-cron.test.ts +0 -307
- package/test/modules/memory/adapters/in-memory.test.ts +0 -153
- package/test/modules/memory/adapters/meilisearch.test.ts +0 -287
- package/test/modules/memory/base.test.ts +0 -230
- package/types/index.ts +0 -190
- package/utils/generate-action-schema.ts +0 -46
- package/utils/header-builder.ts +0 -40
@@ -1,82 +0,0 @@
|
|
1
|
-
import { IMemoryAdapter } from "../../../../interfaces";
|
2
|
-
import { BaseMemoryType, CreateMemoryInput } from "../../../../types";
|
3
|
-
/**
|
4
|
-
* @module RedisAdapter
|
5
|
-
* @description Adapter implementation for Redis as a memory storage solution.
|
6
|
-
* Provides integration with Redis for storing and retrieving memory entries with TTL support.
|
7
|
-
* @implements {IMemoryAdapter}
|
8
|
-
*/
|
9
|
-
export declare class RedisAdapter implements IMemoryAdapter {
|
10
|
-
private readonly redisUrl;
|
11
|
-
private redis;
|
12
|
-
private readonly cachePrefix;
|
13
|
-
private readonly cacheTTL;
|
14
|
-
/**
|
15
|
-
* Creates an instance of RedisAdapter
|
16
|
-
* @param {string} redisUrl - Redis connection URL
|
17
|
-
* @param {Object} options - Configuration options
|
18
|
-
* @param {string} [options.cachePrefix="memory:"] - Prefix for Redis keys
|
19
|
-
* @param {number} [options.cacheTTL=3600] - Default TTL in seconds
|
20
|
-
*/
|
21
|
-
constructor(redisUrl: string, options: {
|
22
|
-
cachePrefix?: string;
|
23
|
-
cacheTTL?: number;
|
24
|
-
});
|
25
|
-
/**
|
26
|
-
* Initializes the Redis connection
|
27
|
-
* @param {string} roomId - Room identifier
|
28
|
-
* @returns {Promise<void>}
|
29
|
-
*/
|
30
|
-
init(roomId: string): Promise<void>;
|
31
|
-
/**
|
32
|
-
* Creates a new memory entry in Redis
|
33
|
-
* @param {CreateMemoryInput & { embedding?: number[] }} input - Memory data with optional embedding
|
34
|
-
* @returns {Promise<BaseMemoryType | undefined>} Created memory or undefined
|
35
|
-
*/
|
36
|
-
createMemory(input: CreateMemoryInput & {
|
37
|
-
embedding?: number[];
|
38
|
-
}): Promise<BaseMemoryType | undefined>;
|
39
|
-
/**
|
40
|
-
* Retrieves a memory by ID and room ID from Redis
|
41
|
-
* @param {string} id - Memory identifier
|
42
|
-
* @param {string} roomId - Room identifier
|
43
|
-
* @returns {Promise<BaseMemoryType | null>} Memory entry or null if not found
|
44
|
-
*/
|
45
|
-
getMemoryById(id: string, roomId: string): Promise<BaseMemoryType | null>;
|
46
|
-
/**
|
47
|
-
* Searches for memories in Redis based on pattern matching
|
48
|
-
* @param {string} query - Search query
|
49
|
-
* @param {Object} options - Search options
|
50
|
-
* @param {string} options.roomId - Room identifier
|
51
|
-
* @param {number} [options.limit] - Maximum number of results
|
52
|
-
* @returns {Promise<BaseMemoryType[]>} Array of matching memories
|
53
|
-
*/
|
54
|
-
getMemoryByIndex(query: string, options: {
|
55
|
-
roomId: string;
|
56
|
-
limit?: number;
|
57
|
-
}): Promise<BaseMemoryType[]>;
|
58
|
-
/**
|
59
|
-
* Retrieves all memories for a room from Redis
|
60
|
-
* @param {string} roomId - Room identifier
|
61
|
-
* @returns {Promise<BaseMemoryType[]>} Array of all memories
|
62
|
-
*/
|
63
|
-
getAllMemories(roomId: string): Promise<BaseMemoryType[]>;
|
64
|
-
/**
|
65
|
-
* Deletes a specific memory from Redis
|
66
|
-
* @param {string} id - Memory identifier
|
67
|
-
* @param {string} roomId - Room identifier
|
68
|
-
* @returns {Promise<void>}
|
69
|
-
*/
|
70
|
-
clearMemoryById(id: string, roomId: string): Promise<void>;
|
71
|
-
/**
|
72
|
-
* Clears all memories across all rooms from Redis
|
73
|
-
* @returns {Promise<void>}
|
74
|
-
*/
|
75
|
-
clearAllMemories(): Promise<void>;
|
76
|
-
/**
|
77
|
-
* Closes the Redis connection
|
78
|
-
* @returns {Promise<void>}
|
79
|
-
*/
|
80
|
-
quit(): Promise<void>;
|
81
|
-
}
|
82
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../modules/memory/adapters/redis/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,cAAc;IAa/C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAZ3B,OAAO,CAAC,KAAK,CAAC;IACd,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC;;;;;;OAMG;gBAEgB,QAAQ,EAAE,MAAM,EACjC,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAaH;;;;OAIG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzC;;;;OAIG;IACG,YAAY,CAChB,KAAK,EAAE,iBAAiB,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAClD,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAoBtC;;;;;OAKG;IACG,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAMjC;;;;;;;OAOG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAY5B;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAY/D;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE;;;OAGG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOvC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
|
@@ -1,159 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.RedisAdapter = void 0;
|
13
|
-
const redis_1 = require("redis");
|
14
|
-
/**
|
15
|
-
* @module RedisAdapter
|
16
|
-
* @description Adapter implementation for Redis as a memory storage solution.
|
17
|
-
* Provides integration with Redis for storing and retrieving memory entries with TTL support.
|
18
|
-
* @implements {IMemoryAdapter}
|
19
|
-
*/
|
20
|
-
class RedisAdapter {
|
21
|
-
/**
|
22
|
-
* Creates an instance of RedisAdapter
|
23
|
-
* @param {string} redisUrl - Redis connection URL
|
24
|
-
* @param {Object} options - Configuration options
|
25
|
-
* @param {string} [options.cachePrefix="memory:"] - Prefix for Redis keys
|
26
|
-
* @param {number} [options.cacheTTL=3600] - Default TTL in seconds
|
27
|
-
*/
|
28
|
-
constructor(redisUrl, options) {
|
29
|
-
this.redisUrl = redisUrl;
|
30
|
-
this.cachePrefix = options.cachePrefix || "memory:";
|
31
|
-
this.cacheTTL = options.cacheTTL || 3600;
|
32
|
-
this.redis = (0, redis_1.createClient)({
|
33
|
-
url: redisUrl,
|
34
|
-
socket: {
|
35
|
-
tls: true,
|
36
|
-
rejectUnauthorized: true,
|
37
|
-
},
|
38
|
-
});
|
39
|
-
}
|
40
|
-
/**
|
41
|
-
* Initializes the Redis connection
|
42
|
-
* @param {string} roomId - Room identifier
|
43
|
-
* @returns {Promise<void>}
|
44
|
-
*/
|
45
|
-
init(roomId) {
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
47
|
-
this.redis.on("error", (err) => console.error("Redis Client Error:", err));
|
48
|
-
yield this.redis.connect();
|
49
|
-
});
|
50
|
-
}
|
51
|
-
/**
|
52
|
-
* Creates a new memory entry in Redis
|
53
|
-
* @param {CreateMemoryInput & { embedding?: number[] }} input - Memory data with optional embedding
|
54
|
-
* @returns {Promise<BaseMemoryType | undefined>} Created memory or undefined
|
55
|
-
*/
|
56
|
-
createMemory(input) {
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
58
|
-
const memory = {
|
59
|
-
id: input.id || crypto.randomUUID(),
|
60
|
-
data: input.data,
|
61
|
-
embedding: input.embedding,
|
62
|
-
roomId: input.roomId,
|
63
|
-
createdAt: new Date(),
|
64
|
-
};
|
65
|
-
const key = memory.roomId
|
66
|
-
? `${this.cachePrefix}${memory.roomId}:${memory.id}`
|
67
|
-
: `${this.cachePrefix}${memory.id}`;
|
68
|
-
yield this.redis.set(key, JSON.stringify(memory), {
|
69
|
-
EX: this.cacheTTL,
|
70
|
-
});
|
71
|
-
return memory;
|
72
|
-
});
|
73
|
-
}
|
74
|
-
/**
|
75
|
-
* Retrieves a memory by ID and room ID from Redis
|
76
|
-
* @param {string} id - Memory identifier
|
77
|
-
* @param {string} roomId - Room identifier
|
78
|
-
* @returns {Promise<BaseMemoryType | null>} Memory entry or null if not found
|
79
|
-
*/
|
80
|
-
getMemoryById(id, roomId) {
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
82
|
-
const key = `${this.cachePrefix}${roomId}:${id}`;
|
83
|
-
const data = yield this.redis.get(key);
|
84
|
-
return data ? JSON.parse(data) : null;
|
85
|
-
});
|
86
|
-
}
|
87
|
-
/**
|
88
|
-
* Searches for memories in Redis based on pattern matching
|
89
|
-
* @param {string} query - Search query
|
90
|
-
* @param {Object} options - Search options
|
91
|
-
* @param {string} options.roomId - Room identifier
|
92
|
-
* @param {number} [options.limit] - Maximum number of results
|
93
|
-
* @returns {Promise<BaseMemoryType[]>} Array of matching memories
|
94
|
-
*/
|
95
|
-
getMemoryByIndex(query, options) {
|
96
|
-
return __awaiter(this, void 0, void 0, function* () {
|
97
|
-
const pattern = `${this.cachePrefix}${options.roomId}:*`;
|
98
|
-
const keys = yield this.redis.keys(pattern);
|
99
|
-
const memories = yield Promise.all(keys.map((key) => __awaiter(this, void 0, void 0, function* () {
|
100
|
-
const data = yield this.redis.get(key);
|
101
|
-
return data ? JSON.parse(data) : null;
|
102
|
-
})));
|
103
|
-
return memories.filter(Boolean).slice(0, options.limit || 10);
|
104
|
-
});
|
105
|
-
}
|
106
|
-
/**
|
107
|
-
* Retrieves all memories for a room from Redis
|
108
|
-
* @param {string} roomId - Room identifier
|
109
|
-
* @returns {Promise<BaseMemoryType[]>} Array of all memories
|
110
|
-
*/
|
111
|
-
getAllMemories(roomId) {
|
112
|
-
return __awaiter(this, void 0, void 0, function* () {
|
113
|
-
const pattern = `${this.cachePrefix}${roomId}:*`;
|
114
|
-
const keys = yield this.redis.keys(pattern);
|
115
|
-
const memories = yield Promise.all(keys.map((key) => __awaiter(this, void 0, void 0, function* () {
|
116
|
-
const data = yield this.redis.get(key);
|
117
|
-
return data ? JSON.parse(data) : null;
|
118
|
-
})));
|
119
|
-
return memories.filter(Boolean);
|
120
|
-
});
|
121
|
-
}
|
122
|
-
/**
|
123
|
-
* Deletes a specific memory from Redis
|
124
|
-
* @param {string} id - Memory identifier
|
125
|
-
* @param {string} roomId - Room identifier
|
126
|
-
* @returns {Promise<void>}
|
127
|
-
*/
|
128
|
-
clearMemoryById(id, roomId) {
|
129
|
-
return __awaiter(this, void 0, void 0, function* () {
|
130
|
-
const key = `${this.cachePrefix}${roomId}:${id}`;
|
131
|
-
yield this.redis.del(key);
|
132
|
-
});
|
133
|
-
}
|
134
|
-
/**
|
135
|
-
* Clears all memories across all rooms from Redis
|
136
|
-
* @returns {Promise<void>}
|
137
|
-
*/
|
138
|
-
clearAllMemories() {
|
139
|
-
return __awaiter(this, void 0, void 0, function* () {
|
140
|
-
const keys = yield this.redis.keys(`${this.cachePrefix}*`);
|
141
|
-
if (keys.length > 0) {
|
142
|
-
yield this.redis.del(keys);
|
143
|
-
}
|
144
|
-
});
|
145
|
-
}
|
146
|
-
/**
|
147
|
-
* Closes the Redis connection
|
148
|
-
* @returns {Promise<void>}
|
149
|
-
*/
|
150
|
-
quit() {
|
151
|
-
return __awaiter(this, void 0, void 0, function* () {
|
152
|
-
if (this.redis) {
|
153
|
-
yield this.redis.quit();
|
154
|
-
}
|
155
|
-
});
|
156
|
-
}
|
157
|
-
}
|
158
|
-
exports.RedisAdapter = RedisAdapter;
|
159
|
-
//# sourceMappingURL=index.js.map
|
@@ -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I;;YACR,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC;KAAA;CACF;AAzJD,oCAyJC"}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import { BaseMemory, IMemoryAdapter } from "../../interfaces";
|
2
|
-
import { BaseMemoryType, CreateMemoryInput } from "../../types";
|
3
|
-
/**
|
4
|
-
* @module Memory
|
5
|
-
* @description A module for managing memory storage and retrieval operations.
|
6
|
-
* Implements the BaseMemory abstract class and provides concrete implementations
|
7
|
-
* for memory-related operations using the provided adapter.
|
8
|
-
* @extends {BaseMemory}
|
9
|
-
*/
|
10
|
-
export declare class Memory extends BaseMemory {
|
11
|
-
/**
|
12
|
-
* Creates an instance of Memory
|
13
|
-
* @param {IMemoryAdapter} adapter - The memory adapter implementation to use
|
14
|
-
*/
|
15
|
-
constructor(adapter: IMemoryAdapter);
|
16
|
-
/**
|
17
|
-
* Initializes the memory module with default room
|
18
|
-
* @returns {Promise<void>}
|
19
|
-
*/
|
20
|
-
init(): Promise<void>;
|
21
|
-
/**
|
22
|
-
* Creates a new memory entry
|
23
|
-
* @param {CreateMemoryInput & { embedding?: number[] }} input - Memory data with optional embedding
|
24
|
-
* @returns {Promise<BaseMemoryType | undefined>} Created memory or undefined
|
25
|
-
*/
|
26
|
-
createMemory(input: CreateMemoryInput & {
|
27
|
-
embedding?: number[];
|
28
|
-
}): Promise<BaseMemoryType | undefined>;
|
29
|
-
/**
|
30
|
-
* Retrieves a memory by ID and room ID
|
31
|
-
* @param {string} id - Memory identifier
|
32
|
-
* @param {string} roomId - Room identifier
|
33
|
-
* @returns {Promise<BaseMemoryType | null>} Memory entry or null if not found
|
34
|
-
*/
|
35
|
-
getMemoryById(id: string, roomId: string): Promise<BaseMemoryType | null>;
|
36
|
-
/**
|
37
|
-
* Searches for memories based on query and options
|
38
|
-
* @param {string} query - Search query
|
39
|
-
* @param {Object} options - Search options
|
40
|
-
* @param {string} options.roomId - Room identifier
|
41
|
-
* @param {number} [options.limit] - Maximum number of results to return
|
42
|
-
* @returns {Promise<BaseMemoryType[]>} Array of matching memories
|
43
|
-
*/
|
44
|
-
getMemoryByIndex(query: string, options: {
|
45
|
-
roomId: string;
|
46
|
-
limit?: number;
|
47
|
-
}): Promise<BaseMemoryType[]>;
|
48
|
-
/**
|
49
|
-
* Retrieves all memories for a specific room
|
50
|
-
* @param {string} roomId - Room identifier
|
51
|
-
* @returns {Promise<BaseMemoryType[]>} Array of all memories in the room
|
52
|
-
*/
|
53
|
-
getAllMemories(roomId: string): Promise<BaseMemoryType[]>;
|
54
|
-
/**
|
55
|
-
* Deletes a specific memory
|
56
|
-
* @param {string} id - Memory identifier
|
57
|
-
* @param {string} roomId - Room identifier
|
58
|
-
* @returns {Promise<void>}
|
59
|
-
*/
|
60
|
-
clearMemoryById(id: string, roomId: string): Promise<void>;
|
61
|
-
/**
|
62
|
-
* Clears all memories across all rooms
|
63
|
-
* @returns {Promise<void>}
|
64
|
-
*/
|
65
|
-
clearAllMemories(): Promise<void>;
|
66
|
-
}
|
67
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC;;;OAGG;gBACS,OAAO,EAAE,cAAc;IAInC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;OAIG;IACG,YAAY,CAChB,KAAK,EAAE,iBAAiB,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAClD,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAItC;;;;;OAKG;IACG,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAIjC;;;;;;;OAOG;IACG,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAI5B;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/D;;;;;OAKG;IACG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE;;;OAGG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|
@@ -1,104 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.Memory = void 0;
|
13
|
-
const interfaces_1 = require("../../interfaces");
|
14
|
-
/**
|
15
|
-
* @module Memory
|
16
|
-
* @description A module for managing memory storage and retrieval operations.
|
17
|
-
* Implements the BaseMemory abstract class and provides concrete implementations
|
18
|
-
* for memory-related operations using the provided adapter.
|
19
|
-
* @extends {BaseMemory}
|
20
|
-
*/
|
21
|
-
class Memory extends interfaces_1.BaseMemory {
|
22
|
-
/**
|
23
|
-
* Creates an instance of Memory
|
24
|
-
* @param {IMemoryAdapter} adapter - The memory adapter implementation to use
|
25
|
-
*/
|
26
|
-
constructor(adapter) {
|
27
|
-
super(adapter);
|
28
|
-
}
|
29
|
-
/**
|
30
|
-
* Initializes the memory module with default room
|
31
|
-
* @returns {Promise<void>}
|
32
|
-
*/
|
33
|
-
init() {
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
35
|
-
yield this.adapter.init("default");
|
36
|
-
});
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* Creates a new memory entry
|
40
|
-
* @param {CreateMemoryInput & { embedding?: number[] }} input - Memory data with optional embedding
|
41
|
-
* @returns {Promise<BaseMemoryType | undefined>} Created memory or undefined
|
42
|
-
*/
|
43
|
-
createMemory(input) {
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
45
|
-
return this.adapter.createMemory(input);
|
46
|
-
});
|
47
|
-
}
|
48
|
-
/**
|
49
|
-
* Retrieves a memory by ID and room ID
|
50
|
-
* @param {string} id - Memory identifier
|
51
|
-
* @param {string} roomId - Room identifier
|
52
|
-
* @returns {Promise<BaseMemoryType | null>} Memory entry or null if not found
|
53
|
-
*/
|
54
|
-
getMemoryById(id, roomId) {
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
56
|
-
return this.adapter.getMemoryById(id, roomId);
|
57
|
-
});
|
58
|
-
}
|
59
|
-
/**
|
60
|
-
* Searches for memories based on query and options
|
61
|
-
* @param {string} query - Search query
|
62
|
-
* @param {Object} options - Search options
|
63
|
-
* @param {string} options.roomId - Room identifier
|
64
|
-
* @param {number} [options.limit] - Maximum number of results to return
|
65
|
-
* @returns {Promise<BaseMemoryType[]>} Array of matching memories
|
66
|
-
*/
|
67
|
-
getMemoryByIndex(query, options) {
|
68
|
-
return __awaiter(this, void 0, void 0, function* () {
|
69
|
-
return this.adapter.getMemoryByIndex(query, options);
|
70
|
-
});
|
71
|
-
}
|
72
|
-
/**
|
73
|
-
* Retrieves all memories for a specific room
|
74
|
-
* @param {string} roomId - Room identifier
|
75
|
-
* @returns {Promise<BaseMemoryType[]>} Array of all memories in the room
|
76
|
-
*/
|
77
|
-
getAllMemories(roomId) {
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
79
|
-
return this.adapter.getAllMemories(roomId);
|
80
|
-
});
|
81
|
-
}
|
82
|
-
/**
|
83
|
-
* Deletes a specific memory
|
84
|
-
* @param {string} id - Memory identifier
|
85
|
-
* @param {string} roomId - Room identifier
|
86
|
-
* @returns {Promise<void>}
|
87
|
-
*/
|
88
|
-
clearMemoryById(id, roomId) {
|
89
|
-
return __awaiter(this, void 0, void 0, function* () {
|
90
|
-
yield this.adapter.clearMemoryById(id, roomId);
|
91
|
-
});
|
92
|
-
}
|
93
|
-
/**
|
94
|
-
* Clears all memories across all rooms
|
95
|
-
* @returns {Promise<void>}
|
96
|
-
*/
|
97
|
-
clearAllMemories() {
|
98
|
-
return __awaiter(this, void 0, void 0, function* () {
|
99
|
-
yield this.adapter.clearAllMemories();
|
100
|
-
});
|
101
|
-
}
|
102
|
-
}
|
103
|
-
exports.Memory = Memory;
|
104
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../modules/memory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8D;AAG9D;;;;;;GAMG;AACH,MAAa,MAAO,SAAQ,uBAAU;IACpC;;;OAGG;IACH,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;;OAGG;IACG,IAAI;;YACR,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC;KAAA;IAED;;;;OAIG;IACG,YAAY,CAChB,KAAmD;;YAEnD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;KAAA;IAED;;;;;OAKG;IACG,aAAa,CACjB,EAAU,EACV,MAAc;;YAEd,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;KAAA;IAED;;;;;;;OAOG;IACG,gBAAgB,CACpB,KAAa,EACb,OAA2C;;YAE3C,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;KAAA;IAED;;;;OAIG;IACG,cAAc,CAAC,MAAc;;YACjC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;KAAA;IAED;;;;;OAKG;IACG,eAAe,CAAC,EAAU,EAAE,MAAc;;YAC9C,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC;KAAA;IAED;;;OAGG;IACG,gBAAgB;;YACpB,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QACxC,CAAC;KAAA;CACF;AAlFD,wBAkFC"}
|
package/dist/types/index.d.ts
DELETED
@@ -1,170 +0,0 @@
|
|
1
|
-
import { EventEmitter } from "events";
|
2
|
-
import { ZodSchema } from "zod";
|
3
|
-
import { IEventEmitter } from "../interfaces";
|
4
|
-
/**
|
5
|
-
* Represents the input structure for creating a memory entry.
|
6
|
-
* @typedef {Object} CreateMemoryInput
|
7
|
-
* @property {string} query - The query associated with the memory.
|
8
|
-
* @property {any} data - The data to be stored.
|
9
|
-
* @property {string} roomId - The room identifier.
|
10
|
-
* @property {number} [ttl] - Time-to-live in seconds (optional).
|
11
|
-
*/
|
12
|
-
export interface CreateMemoryInput {
|
13
|
-
id?: string;
|
14
|
-
data: string;
|
15
|
-
embedding?: number[];
|
16
|
-
roomId: string;
|
17
|
-
ttl?: number;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Represents a stored memory entry.
|
21
|
-
* @typedef {Object} BaseMemoryType
|
22
|
-
* @property {string} id - Unique identifier of the memory entry.
|
23
|
-
* @property {string} data - Stored data as a string.
|
24
|
-
* @property {string} query - The associated query.
|
25
|
-
* @property {number[] | null} embedding - Vector representation of the data.
|
26
|
-
* @property {string} roomId - The associated room ID.
|
27
|
-
* @property {Date} createdAt - Creation date.
|
28
|
-
*/
|
29
|
-
export interface BaseMemoryType {
|
30
|
-
id: string;
|
31
|
-
data: string;
|
32
|
-
embedding?: number[];
|
33
|
-
roomId: string;
|
34
|
-
createdAt: Date;
|
35
|
-
}
|
36
|
-
/**
|
37
|
-
* Type for scheduled request entries
|
38
|
-
* @typedef {Object} ScheduledRequest
|
39
|
-
*/
|
40
|
-
export type ScheduledRequest = {
|
41
|
-
/** Unique identifier for the scheduled request */
|
42
|
-
id: string;
|
43
|
-
/** The original request string */
|
44
|
-
originalRequest: string;
|
45
|
-
/** The cron expression for scheduling */
|
46
|
-
cronExpression: string;
|
47
|
-
/** Whether the request is recurring */
|
48
|
-
isRecurring: boolean;
|
49
|
-
/** The creation date */
|
50
|
-
createdAt: Date;
|
51
|
-
};
|
52
|
-
/**
|
53
|
-
* Utility type for extracting schema type from Zod schema
|
54
|
-
* @template T - Zod schema type
|
55
|
-
*/
|
56
|
-
export type SchemaType<T> = T extends ZodSchema<infer U> ? U : never;
|
57
|
-
/**
|
58
|
-
* Type for graph context based on schema
|
59
|
-
* @template T - Schema type
|
60
|
-
*/
|
61
|
-
export type GraphContext<T extends ZodSchema> = {
|
62
|
-
[key: string]: any;
|
63
|
-
};
|
64
|
-
/**
|
65
|
-
* Interface representing a node in the graph
|
66
|
-
* @interface
|
67
|
-
* @template T - Schema type
|
68
|
-
* @template I - Input schema type
|
69
|
-
* @template O - Output schema type
|
70
|
-
*/
|
71
|
-
export interface Node<T extends ZodSchema, P = any> {
|
72
|
-
/** Name of the node */
|
73
|
-
name: string;
|
74
|
-
/** Description of the node */
|
75
|
-
description?: string;
|
76
|
-
/** Schema for node inputs */
|
77
|
-
params?: P extends void ? never : ZodSchema<P>;
|
78
|
-
/** Execute function for the node */
|
79
|
-
execute: (context: GraphContext<T>, params?: P, tools?: {
|
80
|
-
eventEmitter: IEventEmitter;
|
81
|
-
}) => Promise<void>;
|
82
|
-
/** Optional condition for node execution */
|
83
|
-
condition?: (context: GraphContext<T>, params?: P) => boolean;
|
84
|
-
/** Array of next node names */
|
85
|
-
next?: string[] | ((context: GraphContext<T>) => string[]);
|
86
|
-
/** Array of event names that trigger this node */
|
87
|
-
events?: string[];
|
88
|
-
/** Wait for a single event before continuing */
|
89
|
-
waitForEvent?: boolean;
|
90
|
-
/** Wait for multiple events configuration */
|
91
|
-
waitForEvents?: WaitForEvents;
|
92
|
-
/** Event correlation configuration */
|
93
|
-
correlateEvents?: {
|
94
|
-
events: string[];
|
95
|
-
timeout: number;
|
96
|
-
correlation: (events: any[]) => boolean;
|
97
|
-
};
|
98
|
-
/** Retry configuration */
|
99
|
-
retry?: {
|
100
|
-
/** Maximum number of retry attempts */
|
101
|
-
maxAttempts: number;
|
102
|
-
/** Delay between retries in milliseconds */
|
103
|
-
delay: number;
|
104
|
-
/** Error handler function */
|
105
|
-
onRetryFailed?: (error: Error, context: GraphContext<T>) => Promise<void>;
|
106
|
-
/** Continue execution on failed retry */
|
107
|
-
continueOnFailed?: boolean;
|
108
|
-
};
|
109
|
-
/** Error handler function */
|
110
|
-
onError?: (error: Error) => void;
|
111
|
-
}
|
112
|
-
/**
|
113
|
-
* Interface for graph definition
|
114
|
-
* @interface
|
115
|
-
* @template T - Schema type
|
116
|
-
*/
|
117
|
-
export interface GraphDefinition<T extends ZodSchema> {
|
118
|
-
/** Name of the graph */
|
119
|
-
name: string;
|
120
|
-
/** Array of nodes in the graph */
|
121
|
-
nodes: Node<T, any>[];
|
122
|
-
/** Initial context */
|
123
|
-
context: SchemaType<T>;
|
124
|
-
/** Schema for validation */
|
125
|
-
schema: T;
|
126
|
-
/** Global error handler */
|
127
|
-
onError?: (error: Error, context: GraphContext<T>) => void;
|
128
|
-
/** Entry node name */
|
129
|
-
entryNode?: string;
|
130
|
-
/** Event emitter instance */
|
131
|
-
eventEmitter?: IEventEmitter | EventEmitter;
|
132
|
-
/** Array of events */
|
133
|
-
events?: string[];
|
134
|
-
}
|
135
|
-
/**
|
136
|
-
* Configuration type for Meilisearch
|
137
|
-
* @typedef {Object} MeilisearchConfig
|
138
|
-
*/
|
139
|
-
export type MeilisearchConfig = {
|
140
|
-
/** Meilisearch host URL */
|
141
|
-
host: string;
|
142
|
-
/** API key for authentication */
|
143
|
-
apiKey: string;
|
144
|
-
/** Array of searchable attributes */
|
145
|
-
searchableAttributes?: string[];
|
146
|
-
/** Array of sortable attributes */
|
147
|
-
sortableAttributes?: string[];
|
148
|
-
};
|
149
|
-
/**
|
150
|
-
* Settings type for Meilisearch
|
151
|
-
* @typedef {Object} MeilisearchSettings
|
152
|
-
*/
|
153
|
-
export type MeilisearchSettings = {
|
154
|
-
/** Array of searchable attributes */
|
155
|
-
searchableAttributes?: string[];
|
156
|
-
/** Array of sortable attributes */
|
157
|
-
sortableAttributes?: string[];
|
158
|
-
};
|
159
|
-
export interface GraphEvent<T extends ZodSchema> {
|
160
|
-
type: string;
|
161
|
-
payload?: any;
|
162
|
-
timestamp: number;
|
163
|
-
}
|
164
|
-
export interface WaitForEvents {
|
165
|
-
events: string[];
|
166
|
-
timeout?: number;
|
167
|
-
strategy: "all" | "any" | "race";
|
168
|
-
onSuccess?: <T extends ZodSchema>(context: GraphContext<T>) => Promise<void>;
|
169
|
-
}
|
170
|
-
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,SAAS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EAAE,GAAG,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E"}
|
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":""}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { z } from "zod";
|
2
|
-
import { GraphFlow } from "../graph/index";
|
3
|
-
export declare const generateActionSchema: (graphs: GraphFlow<any>[]) => string;
|
4
|
-
export declare const getSchemaString: (schema: z.ZodType) => string;
|
5
|
-
//# sourceMappingURL=generate-action-schema.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generate-action-schema.d.ts","sourceRoot":"","sources":["../../utils/generate-action-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,WAAY,SAAS,CAAC,GAAG,CAAC,EAAE,WAU5D,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,CAAC,CAAC,OAAO,KAAG,MA8BnD,CAAC"}
|