@props-labs/mesh-os 0.2.4 → 0.2.6

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.
@@ -77,7 +77,7 @@ export interface SearchMemoryOptions {
77
77
  createdAtFilter?: Record<string, any>;
78
78
  }
79
79
  export interface ListMemoriesOptions {
80
- type?: string;
80
+ type?: string | string[];
81
81
  status?: 'active' | 'archived' | 'deleted';
82
82
  limit?: number;
83
83
  offset?: number;
@@ -97,6 +97,21 @@ export interface UpdateMemoryResult {
97
97
  memory: Memory;
98
98
  chunkCount?: number;
99
99
  }
100
+ export interface CreateTypeSchemaInput {
101
+ type: string;
102
+ schema: Record<string, any>;
103
+ metadata_schema?: Record<string, any>;
104
+ embedding_config?: {
105
+ model: string;
106
+ dimensions: number;
107
+ };
108
+ chunking_config?: {
109
+ chunk_size: number;
110
+ chunk_overlap: number;
111
+ };
112
+ validation_rules?: Record<string, any>;
113
+ behaviors?: Record<string, any>;
114
+ }
100
115
  export declare class MemoryManager {
101
116
  private url;
102
117
  private headers;
@@ -150,4 +165,8 @@ export declare class MemoryManager {
150
165
  * List memories with optional filtering and pagination
151
166
  */
152
167
  listMemories(options?: ListMemoriesOptions): Promise<Memory[]>;
168
+ /**
169
+ * Create a new type schema
170
+ */
171
+ createTypeSchema(input: CreateTypeSchemaInput): Promise<TypeSchema>;
153
172
  }
@@ -420,8 +420,11 @@ class MemoryManager {
420
420
  const { type, status, limit = 10, offset = 0, agentId, orderBy = [{ field: 'created_at', direction: 'desc' }] } = options;
421
421
  // Build where clause
422
422
  const where = {};
423
- if (type)
424
- where.type = { _eq: type };
423
+ if (type) {
424
+ where.type = Array.isArray(type)
425
+ ? { _in: type } // If array, use _in operator
426
+ : { _eq: type }; // If single string, use _eq operator
427
+ }
425
428
  if (status)
426
429
  where.status = { _eq: status };
427
430
  if (agentId)
@@ -462,5 +465,37 @@ class MemoryManager {
462
465
  });
463
466
  return result.memories.map(memory => memorySchema.parse(memory));
464
467
  }
468
+ /**
469
+ * Create a new type schema
470
+ */
471
+ async createTypeSchema(input) {
472
+ const query = `
473
+ mutation CreateTypeSchema($schema: type_schemas_insert_input!) {
474
+ insert_type_schemas_one(object: $schema) {
475
+ type
476
+ schema
477
+ metadata_schema
478
+ embedding_config
479
+ chunking_config
480
+ validation_rules
481
+ behaviors
482
+ created_at
483
+ updated_at
484
+ }
485
+ }
486
+ `;
487
+ const result = await this.executeQuery(query, {
488
+ schema: {
489
+ type: input.type,
490
+ schema: input.schema,
491
+ metadata_schema: input.metadata_schema || null,
492
+ embedding_config: input.embedding_config || null,
493
+ chunking_config: input.chunking_config || null,
494
+ validation_rules: input.validation_rules || null,
495
+ behaviors: input.behaviors || null
496
+ }
497
+ });
498
+ return typeSchemaSchema.parse(result.insert_type_schemas_one);
499
+ }
465
500
  }
466
501
  exports.MemoryManager = MemoryManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@props-labs/mesh-os",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "MeshOS - A memory system for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",