@props-labs/mesh-os 0.2.2 → 0.2.3
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.
@@ -171,6 +171,23 @@ export declare const MEMORY_MOCKS: {
|
|
171
171
|
})[];
|
172
172
|
};
|
173
173
|
};
|
174
|
+
listMemories: {
|
175
|
+
data: {
|
176
|
+
memories: {
|
177
|
+
id: string;
|
178
|
+
type: string;
|
179
|
+
status: string;
|
180
|
+
content: string;
|
181
|
+
metadata: {
|
182
|
+
source: string;
|
183
|
+
tags: string[];
|
184
|
+
};
|
185
|
+
created_at: string;
|
186
|
+
updated_at: string;
|
187
|
+
agent_id: "d7f3668d-5ebf-4f95-9b5c-07301f5d4c62";
|
188
|
+
}[];
|
189
|
+
};
|
190
|
+
};
|
174
191
|
};
|
175
192
|
export declare const WORKFLOW_MOCKS: {
|
176
193
|
listSchemas: {
|
@@ -151,6 +151,51 @@ exports.MEMORY_MOCKS = {
|
|
151
151
|
}
|
152
152
|
]
|
153
153
|
}
|
154
|
+
},
|
155
|
+
listMemories: {
|
156
|
+
data: {
|
157
|
+
memories: [
|
158
|
+
{
|
159
|
+
id: exports.SAMPLE_IDS.MEMORY,
|
160
|
+
type: 'text_document',
|
161
|
+
status: 'active',
|
162
|
+
content: 'Test memory 1',
|
163
|
+
metadata: {
|
164
|
+
source: 'test',
|
165
|
+
tags: ['test', 'first']
|
166
|
+
},
|
167
|
+
created_at: '2025-02-18T00:00:00Z',
|
168
|
+
updated_at: '2025-02-18T00:00:00Z',
|
169
|
+
agent_id: exports.SAMPLE_IDS.AGENT
|
170
|
+
},
|
171
|
+
{
|
172
|
+
id: '22222222-2222-2222-2222-222222222222',
|
173
|
+
type: 'code_snippet',
|
174
|
+
status: 'active',
|
175
|
+
content: 'Test memory 2',
|
176
|
+
metadata: {
|
177
|
+
source: 'test',
|
178
|
+
tags: ['test', 'second']
|
179
|
+
},
|
180
|
+
created_at: '2025-02-18T00:00:01Z',
|
181
|
+
updated_at: '2025-02-18T00:00:01Z',
|
182
|
+
agent_id: exports.SAMPLE_IDS.AGENT
|
183
|
+
},
|
184
|
+
{
|
185
|
+
id: '33333333-3333-3333-3333-333333333333',
|
186
|
+
type: 'text_document',
|
187
|
+
status: 'archived',
|
188
|
+
content: 'Test memory 3',
|
189
|
+
metadata: {
|
190
|
+
source: 'test',
|
191
|
+
tags: ['test', 'third']
|
192
|
+
},
|
193
|
+
created_at: '2025-02-18T00:00:02Z',
|
194
|
+
updated_at: '2025-02-18T00:00:02Z',
|
195
|
+
agent_id: exports.SAMPLE_IDS.AGENT
|
196
|
+
}
|
197
|
+
]
|
198
|
+
}
|
154
199
|
}
|
155
200
|
};
|
156
201
|
// Workflow mock responses
|
@@ -343,6 +388,9 @@ const createMockFetch = (mocks) => {
|
|
343
388
|
else if (query.includes('GetLastWorkflowResult')) {
|
344
389
|
mockResponse = mocks.getLastResult;
|
345
390
|
}
|
391
|
+
else if (query.includes('ListMemories')) {
|
392
|
+
mockResponse = mocks.listMemories;
|
393
|
+
}
|
346
394
|
if (!mockResponse) {
|
347
395
|
throw new Error(`No mock response found for query: ${query}`);
|
348
396
|
}
|
package/dist/core/memories.d.ts
CHANGED
@@ -76,6 +76,17 @@ export interface SearchMemoryOptions {
|
|
76
76
|
metadataFilter?: Record<string, any>;
|
77
77
|
createdAtFilter?: Record<string, any>;
|
78
78
|
}
|
79
|
+
export interface ListMemoriesOptions {
|
80
|
+
type?: string;
|
81
|
+
status?: 'active' | 'archived' | 'deleted';
|
82
|
+
limit?: number;
|
83
|
+
offset?: number;
|
84
|
+
agentId?: string;
|
85
|
+
orderBy?: Array<{
|
86
|
+
field: string;
|
87
|
+
direction: 'asc' | 'desc';
|
88
|
+
}>;
|
89
|
+
}
|
79
90
|
export interface UpdateMemoryInput {
|
80
91
|
id: string;
|
81
92
|
content?: string;
|
@@ -135,4 +146,8 @@ export declare class MemoryManager {
|
|
135
146
|
* List all available type schemas
|
136
147
|
*/
|
137
148
|
listSchemas(): Promise<TypeSchema[]>;
|
149
|
+
/**
|
150
|
+
* List memories with optional filtering and pagination
|
151
|
+
*/
|
152
|
+
listMemories(options?: ListMemoriesOptions): Promise<Memory[]>;
|
138
153
|
}
|
package/dist/core/memories.js
CHANGED
@@ -413,5 +413,54 @@ class MemoryManager {
|
|
413
413
|
const result = await this.executeQuery(query, {});
|
414
414
|
return result.type_schemas.map(schema => typeSchemaSchema.parse(schema));
|
415
415
|
}
|
416
|
+
/**
|
417
|
+
* List memories with optional filtering and pagination
|
418
|
+
*/
|
419
|
+
async listMemories(options = {}) {
|
420
|
+
const { type, status, limit = 10, offset = 0, agentId, orderBy = [{ field: 'created_at', direction: 'desc' }] } = options;
|
421
|
+
// Build where clause
|
422
|
+
const where = {};
|
423
|
+
if (type)
|
424
|
+
where.type = { _eq: type };
|
425
|
+
if (status)
|
426
|
+
where.status = { _eq: status };
|
427
|
+
if (agentId)
|
428
|
+
where.agent_id = { _eq: agentId };
|
429
|
+
// Convert orderBy to Hasura format
|
430
|
+
const orderByClause = orderBy.map(({ field, direction }) => ({
|
431
|
+
[field]: direction
|
432
|
+
}));
|
433
|
+
const query = `
|
434
|
+
query ListMemories(
|
435
|
+
$where: memories_bool_exp!,
|
436
|
+
$limit: Int!,
|
437
|
+
$offset: Int!,
|
438
|
+
$orderBy: [memories_order_by!]!
|
439
|
+
) {
|
440
|
+
memories(
|
441
|
+
where: $where,
|
442
|
+
limit: $limit,
|
443
|
+
offset: $offset,
|
444
|
+
order_by: $orderBy
|
445
|
+
) {
|
446
|
+
id
|
447
|
+
type
|
448
|
+
status
|
449
|
+
metadata
|
450
|
+
content
|
451
|
+
created_at
|
452
|
+
updated_at
|
453
|
+
agent_id
|
454
|
+
}
|
455
|
+
}
|
456
|
+
`;
|
457
|
+
const result = await this.executeQuery(query, {
|
458
|
+
where,
|
459
|
+
limit,
|
460
|
+
offset,
|
461
|
+
orderBy: orderByClause
|
462
|
+
});
|
463
|
+
return result.memories.map(memory => memorySchema.parse(memory));
|
464
|
+
}
|
416
465
|
}
|
417
466
|
exports.MemoryManager = MemoryManager;
|