novyx 2.4.0 → 2.6.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/dist/index.d.mts CHANGED
@@ -12,6 +12,8 @@ interface Memory {
12
12
  vector_clock?: Record<string, number>;
13
13
  conflict_metadata?: Record<string, any>;
14
14
  expires_at?: string;
15
+ superseded_by?: string;
16
+ match_confidence?: number;
15
17
  }
16
18
  interface SearchResult {
17
19
  query: string;
@@ -43,6 +45,51 @@ interface LinksResult {
43
45
  edges: Edge[];
44
46
  total: number;
45
47
  }
48
+ interface EdgesListResult {
49
+ edges: Edge[];
50
+ total: number;
51
+ }
52
+ interface ContextNowResult {
53
+ server_time_utc: string;
54
+ recent_memories: Memory[];
55
+ recent_count: number;
56
+ upcoming: Memory[];
57
+ upcoming_count: number;
58
+ last_session_at?: string;
59
+ seconds_since_last_session?: number;
60
+ }
61
+ interface KGEntity {
62
+ entity_id: string;
63
+ name: string;
64
+ entity_type?: string;
65
+ metadata: Record<string, any>;
66
+ created_at: string;
67
+ triple_count: number;
68
+ }
69
+ interface KGTriple {
70
+ triple_id: string;
71
+ subject: KGEntity;
72
+ predicate: string;
73
+ object: KGEntity;
74
+ confidence: number;
75
+ source_memory_id?: string;
76
+ metadata: Record<string, any>;
77
+ created_at: string;
78
+ }
79
+ interface TripleListResult {
80
+ triples: KGTriple[];
81
+ total: number;
82
+ }
83
+ interface EntityListResult {
84
+ entities: KGEntity[];
85
+ total: number;
86
+ }
87
+ interface EntityTraversalResult {
88
+ entity: KGEntity;
89
+ as_subject: KGTriple[];
90
+ as_object: KGTriple[];
91
+ total_connections: number;
92
+ }
46
93
 
47
94
  declare class NovyxSession {
48
95
  private client;
@@ -113,7 +160,11 @@ declare class Novyx {
113
160
  agents?: string[];
114
161
  include_shared?: boolean;
115
162
  space_id?: string;
163
+ recency_weight?: number;
164
+ include_superseded?: boolean;
116
165
  }): Promise<SearchResult>;
166
+ supersede(oldMemoryId: string, newMemoryId: string): Promise<Record<string, any>>;
167
+ contextNow(): Promise<ContextNowResult>;
117
168
  memories(opts?: {
118
169
  limit?: number;
119
170
  offset?: number;
@@ -163,7 +214,6 @@ declare class Novyx {
163
214
  usage(): Promise<Record<string, any>>;
164
215
  plans(): Promise<Record<string, any>[]>;
165
216
  health(): Promise<Record<string, any>>;
166
- contextNow(): Promise<Record<string, any>>;
167
217
  session(sessionId: string): NovyxSession;
168
218
  link(sourceId: string, targetId: string, opts?: {
169
219
  relation?: string;
@@ -172,6 +222,35 @@ declare class Novyx {
172
222
  }): Promise<Record<string, any>>;
173
223
  unlink(sourceId: string, targetId: string, relation?: string): Promise<Record<string, any>>;
174
224
  links(memoryId: string, relation?: string): Promise<LinksResult>;
225
+ edges(opts?: {
226
+ relation?: string;
227
+ limit?: number;
228
+ offset?: number;
229
+ }): Promise<EdgesListResult>;
230
+ triple(subject: string, predicate: string, object: string, opts?: {
231
+ confidence?: number;
232
+ source_memory_id?: string;
233
+ subject_type?: string;
234
+ object_type?: string;
235
+ metadata?: Record<string, any>;
236
+ }): Promise<KGTriple>;
237
+ triples(opts?: {
238
+ subject?: string;
239
+ predicate?: string;
240
+ object?: string;
241
+ source_memory_id?: string;
242
+ limit?: number;
243
+ offset?: number;
244
+ }): Promise<TripleListResult>;
245
+ deleteTriple(tripleId: string): Promise<Record<string, any>>;
246
+ entities(opts?: {
247
+ entity_type?: string;
248
+ q?: string;
249
+ limit?: number;
250
+ offset?: number;
251
+ }): Promise<EntityListResult>;
252
+ entity(entityId: string): Promise<EntityTraversalResult>;
253
+ deleteEntity(entityId: string): Promise<Record<string, any>>;
175
254
  }
176
255
 
177
256
  declare class NovyxError extends Error {
@@ -202,4 +281,4 @@ declare class NovyxSecurityError extends NovyxError {
202
281
  constructor(message?: string);
203
282
  }
204
283
 
205
- export { type Edge, type LinksResult, type ListResult, type Memory, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type SearchResult };
284
+ export { type ContextNowResult, type Edge, type EdgesListResult, type EntityListResult, type EntityTraversalResult, type KGEntity, type KGTriple, type LinksResult, type ListResult, type Memory, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type SearchResult, type TripleListResult };
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ interface Memory {
12
12
  vector_clock?: Record<string, number>;
13
13
  conflict_metadata?: Record<string, any>;
14
14
  expires_at?: string;
15
+ superseded_by?: string;
16
+ match_confidence?: number;
15
17
  }
16
18
  interface SearchResult {
17
19
  query: string;
@@ -43,6 +45,51 @@ interface LinksResult {
43
45
  edges: Edge[];
44
46
  total: number;
45
47
  }
48
+ interface EdgesListResult {
49
+ edges: Edge[];
50
+ total: number;
51
+ }
52
+ interface ContextNowResult {
53
+ server_time_utc: string;
54
+ recent_memories: Memory[];
55
+ recent_count: number;
56
+ upcoming: Memory[];
57
+ upcoming_count: number;
58
+ last_session_at?: string;
59
+ seconds_since_last_session?: number;
60
+ }
61
+ interface KGEntity {
62
+ entity_id: string;
63
+ name: string;
64
+ entity_type?: string;
65
+ metadata: Record<string, any>;
66
+ created_at: string;
67
+ triple_count: number;
68
+ }
69
+ interface KGTriple {
70
+ triple_id: string;
71
+ subject: KGEntity;
72
+ predicate: string;
73
+ object: KGEntity;
74
+ confidence: number;
75
+ source_memory_id?: string;
76
+ metadata: Record<string, any>;
77
+ created_at: string;
78
+ }
79
+ interface TripleListResult {
80
+ triples: KGTriple[];
81
+ total: number;
82
+ }
83
+ interface EntityListResult {
84
+ entities: KGEntity[];
85
+ total: number;
86
+ }
87
+ interface EntityTraversalResult {
88
+ entity: KGEntity;
89
+ as_subject: KGTriple[];
90
+ as_object: KGTriple[];
91
+ total_connections: number;
92
+ }
46
93
 
47
94
  declare class NovyxSession {
48
95
  private client;
@@ -113,7 +160,11 @@ declare class Novyx {
113
160
  agents?: string[];
114
161
  include_shared?: boolean;
115
162
  space_id?: string;
163
+ recency_weight?: number;
164
+ include_superseded?: boolean;
116
165
  }): Promise<SearchResult>;
166
+ supersede(oldMemoryId: string, newMemoryId: string): Promise<Record<string, any>>;
167
+ contextNow(): Promise<ContextNowResult>;
117
168
  memories(opts?: {
118
169
  limit?: number;
119
170
  offset?: number;
@@ -163,7 +214,6 @@ declare class Novyx {
163
214
  usage(): Promise<Record<string, any>>;
164
215
  plans(): Promise<Record<string, any>[]>;
165
216
  health(): Promise<Record<string, any>>;
166
- contextNow(): Promise<Record<string, any>>;
167
217
  session(sessionId: string): NovyxSession;
168
218
  link(sourceId: string, targetId: string, opts?: {
169
219
  relation?: string;
@@ -172,6 +222,35 @@ declare class Novyx {
172
222
  }): Promise<Record<string, any>>;
173
223
  unlink(sourceId: string, targetId: string, relation?: string): Promise<Record<string, any>>;
174
224
  links(memoryId: string, relation?: string): Promise<LinksResult>;
225
+ edges(opts?: {
226
+ relation?: string;
227
+ limit?: number;
228
+ offset?: number;
229
+ }): Promise<EdgesListResult>;
230
+ triple(subject: string, predicate: string, object: string, opts?: {
231
+ confidence?: number;
232
+ source_memory_id?: string;
233
+ subject_type?: string;
234
+ object_type?: string;
235
+ metadata?: Record<string, any>;
236
+ }): Promise<KGTriple>;
237
+ triples(opts?: {
238
+ subject?: string;
239
+ predicate?: string;
240
+ object?: string;
241
+ source_memory_id?: string;
242
+ limit?: number;
243
+ offset?: number;
244
+ }): Promise<TripleListResult>;
245
+ deleteTriple(tripleId: string): Promise<Record<string, any>>;
246
+ entities(opts?: {
247
+ entity_type?: string;
248
+ q?: string;
249
+ limit?: number;
250
+ offset?: number;
251
+ }): Promise<EntityListResult>;
252
+ entity(entityId: string): Promise<EntityTraversalResult>;
253
+ deleteEntity(entityId: string): Promise<Record<string, any>>;
175
254
  }
176
255
 
177
256
  declare class NovyxError extends Error {
@@ -202,4 +281,4 @@ declare class NovyxSecurityError extends NovyxError {
202
281
  constructor(message?: string);
203
282
  }
204
283
 
205
- export { type Edge, type LinksResult, type ListResult, type Memory, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type SearchResult };
284
+ export { type ContextNowResult, type Edge, type EdgesListResult, type EntityListResult, type EntityTraversalResult, type KGEntity, type KGTriple, type LinksResult, type ListResult, type Memory, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type SearchResult, type TripleListResult };
package/dist/index.js CHANGED
@@ -230,6 +230,8 @@ var Novyx = class {
230
230
  if (opts?.tags) params.tags = opts.tags.join(",");
231
231
  if (opts?.agents) params.agents = opts.agents.join(",");
232
232
  if (opts?.space_id) params.space_id = opts.space_id;
233
+ if (opts?.recency_weight !== void 0 && opts.recency_weight > 0) params.recency_weight = opts.recency_weight;
234
+ if (opts?.include_superseded) params.include_superseded = "true";
233
235
  const result = await this._request("GET", "/v1/memories/search", { params });
234
236
  const raw = Array.isArray(result) ? result : result.memories ?? [];
235
237
  return {
@@ -238,6 +240,14 @@ var Novyx = class {
238
240
  memories: raw
239
241
  };
240
242
  }
243
+ async supersede(oldMemoryId, newMemoryId) {
244
+ return this._request("PATCH", `/v1/memories/${oldMemoryId}`, {
245
+ body: { superseded_by: newMemoryId }
246
+ });
247
+ }
248
+ async contextNow() {
249
+ return this._request("GET", "/v1/context/now");
250
+ }
241
251
  async memories(opts) {
242
252
  const params = {
243
253
  limit: opts?.limit ?? 100,
@@ -401,12 +411,6 @@ var Novyx = class {
401
411
  }
402
412
  }
403
413
  // ========================================================================
404
- // Context
405
- // ========================================================================
406
- async contextNow() {
407
- return this._request("GET", "/v1/context/now");
408
- }
409
- // ========================================================================
410
414
  // Sessions
411
415
  // ========================================================================
412
416
  session(sessionId) {
@@ -438,6 +442,55 @@ var Novyx = class {
438
442
  if (relation) params.relation = relation;
439
443
  return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
440
444
  }
445
+ async edges(opts) {
446
+ const params = {
447
+ limit: opts?.limit ?? 100,
448
+ offset: opts?.offset ?? 0
449
+ };
450
+ if (opts?.relation) params.relation = opts.relation;
451
+ return this._request("GET", "/v1/memories/edges", { params });
452
+ }
453
+ // ========================================================================
454
+ // Knowledge Graph (Pro+)
455
+ // ========================================================================
456
+ async triple(subject, predicate, object, opts) {
457
+ const body = { subject, predicate, object };
458
+ if (opts?.confidence !== void 0) body.confidence = opts.confidence;
459
+ if (opts?.source_memory_id) body.source_memory_id = opts.source_memory_id;
460
+ if (opts?.subject_type) body.subject_type = opts.subject_type;
461
+ if (opts?.object_type) body.object_type = opts.object_type;
462
+ if (opts?.metadata) body.metadata = opts.metadata;
463
+ return this._request("POST", "/v1/knowledge/triples", { body });
464
+ }
465
+ async triples(opts) {
466
+ const params = {
467
+ limit: opts?.limit ?? 50,
468
+ offset: opts?.offset ?? 0
469
+ };
470
+ if (opts?.subject) params.subject = opts.subject;
471
+ if (opts?.predicate) params.predicate = opts.predicate;
472
+ if (opts?.object) params.object = opts.object;
473
+ if (opts?.source_memory_id) params.source_memory_id = opts.source_memory_id;
474
+ return this._request("GET", "/v1/knowledge/triples", { params });
475
+ }
476
+ async deleteTriple(tripleId) {
477
+ return this._request("DELETE", `/v1/knowledge/triples/${tripleId}`);
478
+ }
479
+ async entities(opts) {
480
+ const params = {
481
+ limit: opts?.limit ?? 50,
482
+ offset: opts?.offset ?? 0
483
+ };
484
+ if (opts?.entity_type) params.entity_type = opts.entity_type;
485
+ if (opts?.q) params.q = opts.q;
486
+ return this._request("GET", "/v1/knowledge/entities", { params });
487
+ }
488
+ async entity(entityId) {
489
+ return this._request("GET", `/v1/knowledge/entities/${entityId}`);
490
+ }
491
+ async deleteEntity(entityId) {
492
+ return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
493
+ }
441
494
  };
442
495
  // Annotate the CommonJS export names for ESM import in node:
443
496
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -197,6 +197,8 @@ var Novyx = class {
197
197
  if (opts?.tags) params.tags = opts.tags.join(",");
198
198
  if (opts?.agents) params.agents = opts.agents.join(",");
199
199
  if (opts?.space_id) params.space_id = opts.space_id;
200
+ if (opts?.recency_weight !== void 0 && opts.recency_weight > 0) params.recency_weight = opts.recency_weight;
201
+ if (opts?.include_superseded) params.include_superseded = "true";
200
202
  const result = await this._request("GET", "/v1/memories/search", { params });
201
203
  const raw = Array.isArray(result) ? result : result.memories ?? [];
202
204
  return {
@@ -205,6 +207,14 @@ var Novyx = class {
205
207
  memories: raw
206
208
  };
207
209
  }
210
+ async supersede(oldMemoryId, newMemoryId) {
211
+ return this._request("PATCH", `/v1/memories/${oldMemoryId}`, {
212
+ body: { superseded_by: newMemoryId }
213
+ });
214
+ }
215
+ async contextNow() {
216
+ return this._request("GET", "/v1/context/now");
217
+ }
208
218
  async memories(opts) {
209
219
  const params = {
210
220
  limit: opts?.limit ?? 100,
@@ -368,12 +378,6 @@ var Novyx = class {
368
378
  }
369
379
  }
370
380
  // ========================================================================
371
- // Context
372
- // ========================================================================
373
- async contextNow() {
374
- return this._request("GET", "/v1/context/now");
375
- }
376
- // ========================================================================
377
381
  // Sessions
378
382
  // ========================================================================
379
383
  session(sessionId) {
@@ -405,6 +409,55 @@ var Novyx = class {
405
409
  if (relation) params.relation = relation;
406
410
  return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
407
411
  }
412
+ async edges(opts) {
413
+ const params = {
414
+ limit: opts?.limit ?? 100,
415
+ offset: opts?.offset ?? 0
416
+ };
417
+ if (opts?.relation) params.relation = opts.relation;
418
+ return this._request("GET", "/v1/memories/edges", { params });
419
+ }
420
+ // ========================================================================
421
+ // Knowledge Graph (Pro+)
422
+ // ========================================================================
423
+ async triple(subject, predicate, object, opts) {
424
+ const body = { subject, predicate, object };
425
+ if (opts?.confidence !== void 0) body.confidence = opts.confidence;
426
+ if (opts?.source_memory_id) body.source_memory_id = opts.source_memory_id;
427
+ if (opts?.subject_type) body.subject_type = opts.subject_type;
428
+ if (opts?.object_type) body.object_type = opts.object_type;
429
+ if (opts?.metadata) body.metadata = opts.metadata;
430
+ return this._request("POST", "/v1/knowledge/triples", { body });
431
+ }
432
+ async triples(opts) {
433
+ const params = {
434
+ limit: opts?.limit ?? 50,
435
+ offset: opts?.offset ?? 0
436
+ };
437
+ if (opts?.subject) params.subject = opts.subject;
438
+ if (opts?.predicate) params.predicate = opts.predicate;
439
+ if (opts?.object) params.object = opts.object;
440
+ if (opts?.source_memory_id) params.source_memory_id = opts.source_memory_id;
441
+ return this._request("GET", "/v1/knowledge/triples", { params });
442
+ }
443
+ async deleteTriple(tripleId) {
444
+ return this._request("DELETE", `/v1/knowledge/triples/${tripleId}`);
445
+ }
446
+ async entities(opts) {
447
+ const params = {
448
+ limit: opts?.limit ?? 50,
449
+ offset: opts?.offset ?? 0
450
+ };
451
+ if (opts?.entity_type) params.entity_type = opts.entity_type;
452
+ if (opts?.q) params.q = opts.q;
453
+ return this._request("GET", "/v1/knowledge/entities", { params });
454
+ }
455
+ async entity(entityId) {
456
+ return this._request("GET", `/v1/knowledge/entities/${entityId}`);
457
+ }
458
+ async deleteEntity(entityId) {
459
+ return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
460
+ }
408
461
  };
409
462
  export {
410
463
  Novyx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "novyx",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "Novyx SDK - Persistent memory, rollback, and audit trail for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",