novyx 2.5.0 → 2.6.1

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
@@ -45,6 +45,10 @@ interface LinksResult {
45
45
  edges: Edge[];
46
46
  total: number;
47
47
  }
48
+ interface EdgesListResult {
49
+ edges: Edge[];
50
+ total: number;
51
+ }
48
52
  interface ContextNowResult {
49
53
  server_time_utc: string;
50
54
  recent_memories: Memory[];
@@ -54,6 +58,38 @@ interface ContextNowResult {
54
58
  last_session_at?: string;
55
59
  seconds_since_last_session?: number;
56
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
+ }
57
93
 
58
94
  declare class NovyxSession {
59
95
  private client;
@@ -172,7 +208,7 @@ declare class Novyx {
172
208
  auditExport(format?: string): Promise<Response>;
173
209
  auditVerify(): Promise<Record<string, any>>;
174
210
  traceCreate(agentId: string, sessionId?: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
175
- traceStep(traceId: string, stepType: string, name: string, content?: string, attributes?: Record<string, any>): Promise<Record<string, any>>;
211
+ traceStep(traceId: string, stepType: string, content: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
176
212
  traceComplete(traceId: string): Promise<Record<string, any>>;
177
213
  traceVerify(traceId: string): Promise<Record<string, any>>;
178
214
  usage(): Promise<Record<string, any>>;
@@ -186,6 +222,35 @@ declare class Novyx {
186
222
  }): Promise<Record<string, any>>;
187
223
  unlink(sourceId: string, targetId: string, relation?: string): Promise<Record<string, any>>;
188
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>>;
189
254
  }
190
255
 
191
256
  declare class NovyxError extends Error {
@@ -216,4 +281,4 @@ declare class NovyxSecurityError extends NovyxError {
216
281
  constructor(message?: string);
217
282
  }
218
283
 
219
- export { type ContextNowResult, 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
@@ -45,6 +45,10 @@ interface LinksResult {
45
45
  edges: Edge[];
46
46
  total: number;
47
47
  }
48
+ interface EdgesListResult {
49
+ edges: Edge[];
50
+ total: number;
51
+ }
48
52
  interface ContextNowResult {
49
53
  server_time_utc: string;
50
54
  recent_memories: Memory[];
@@ -54,6 +58,38 @@ interface ContextNowResult {
54
58
  last_session_at?: string;
55
59
  seconds_since_last_session?: number;
56
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
+ }
57
93
 
58
94
  declare class NovyxSession {
59
95
  private client;
@@ -172,7 +208,7 @@ declare class Novyx {
172
208
  auditExport(format?: string): Promise<Response>;
173
209
  auditVerify(): Promise<Record<string, any>>;
174
210
  traceCreate(agentId: string, sessionId?: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
175
- traceStep(traceId: string, stepType: string, name: string, content?: string, attributes?: Record<string, any>): Promise<Record<string, any>>;
211
+ traceStep(traceId: string, stepType: string, content: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
176
212
  traceComplete(traceId: string): Promise<Record<string, any>>;
177
213
  traceVerify(traceId: string): Promise<Record<string, any>>;
178
214
  usage(): Promise<Record<string, any>>;
@@ -186,6 +222,35 @@ declare class Novyx {
186
222
  }): Promise<Record<string, any>>;
187
223
  unlink(sourceId: string, targetId: string, relation?: string): Promise<Record<string, any>>;
188
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>>;
189
254
  }
190
255
 
191
256
  declare class NovyxError extends Error {
@@ -216,4 +281,4 @@ declare class NovyxSecurityError extends NovyxError {
216
281
  constructor(message?: string);
217
282
  }
218
283
 
219
- export { type ContextNowResult, 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
@@ -369,21 +369,19 @@ var Novyx = class {
369
369
  }
370
370
  });
371
371
  }
372
- async traceStep(traceId, stepType, name, content, attributes) {
373
- return this._request("POST", `/v1/traces/${traceId}/steps`, {
374
- body: {
375
- step_type: stepType,
376
- name,
377
- content,
378
- attributes: attributes ?? {}
379
- }
380
- });
372
+ async traceStep(traceId, stepType, content, metadata) {
373
+ const body = {
374
+ type: stepType,
375
+ content
376
+ };
377
+ if (metadata) body.metadata = metadata;
378
+ return this._request("POST", `/v1/traces/${traceId}/steps`, { body });
381
379
  }
382
380
  async traceComplete(traceId) {
383
381
  return this._request("POST", `/v1/traces/${traceId}/complete`);
384
382
  }
385
383
  async traceVerify(traceId) {
386
- return this._request("GET", `/v1/traces/${traceId}/verify`);
384
+ return this._request("POST", `/v1/traces/${traceId}/verify`);
387
385
  }
388
386
  // ========================================================================
389
387
  // Usage & Plans
@@ -442,6 +440,55 @@ var Novyx = class {
442
440
  if (relation) params.relation = relation;
443
441
  return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
444
442
  }
443
+ async edges(opts) {
444
+ const params = {
445
+ limit: opts?.limit ?? 100,
446
+ offset: opts?.offset ?? 0
447
+ };
448
+ if (opts?.relation) params.relation = opts.relation;
449
+ return this._request("GET", "/v1/memories/edges", { params });
450
+ }
451
+ // ========================================================================
452
+ // Knowledge Graph (Pro+)
453
+ // ========================================================================
454
+ async triple(subject, predicate, object, opts) {
455
+ const body = { subject, predicate, object };
456
+ if (opts?.confidence !== void 0) body.confidence = opts.confidence;
457
+ if (opts?.source_memory_id) body.source_memory_id = opts.source_memory_id;
458
+ if (opts?.subject_type) body.subject_type = opts.subject_type;
459
+ if (opts?.object_type) body.object_type = opts.object_type;
460
+ if (opts?.metadata) body.metadata = opts.metadata;
461
+ return this._request("POST", "/v1/knowledge/triples", { body });
462
+ }
463
+ async triples(opts) {
464
+ const params = {
465
+ limit: opts?.limit ?? 50,
466
+ offset: opts?.offset ?? 0
467
+ };
468
+ if (opts?.subject) params.subject = opts.subject;
469
+ if (opts?.predicate) params.predicate = opts.predicate;
470
+ if (opts?.object) params.object = opts.object;
471
+ if (opts?.source_memory_id) params.source_memory_id = opts.source_memory_id;
472
+ return this._request("GET", "/v1/knowledge/triples", { params });
473
+ }
474
+ async deleteTriple(tripleId) {
475
+ return this._request("DELETE", `/v1/knowledge/triples/${tripleId}`);
476
+ }
477
+ async entities(opts) {
478
+ const params = {
479
+ limit: opts?.limit ?? 50,
480
+ offset: opts?.offset ?? 0
481
+ };
482
+ if (opts?.entity_type) params.entity_type = opts.entity_type;
483
+ if (opts?.q) params.q = opts.q;
484
+ return this._request("GET", "/v1/knowledge/entities", { params });
485
+ }
486
+ async entity(entityId) {
487
+ return this._request("GET", `/v1/knowledge/entities/${entityId}`);
488
+ }
489
+ async deleteEntity(entityId) {
490
+ return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
491
+ }
445
492
  };
446
493
  // Annotate the CommonJS export names for ESM import in node:
447
494
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -336,21 +336,19 @@ var Novyx = class {
336
336
  }
337
337
  });
338
338
  }
339
- async traceStep(traceId, stepType, name, content, attributes) {
340
- return this._request("POST", `/v1/traces/${traceId}/steps`, {
341
- body: {
342
- step_type: stepType,
343
- name,
344
- content,
345
- attributes: attributes ?? {}
346
- }
347
- });
339
+ async traceStep(traceId, stepType, content, metadata) {
340
+ const body = {
341
+ type: stepType,
342
+ content
343
+ };
344
+ if (metadata) body.metadata = metadata;
345
+ return this._request("POST", `/v1/traces/${traceId}/steps`, { body });
348
346
  }
349
347
  async traceComplete(traceId) {
350
348
  return this._request("POST", `/v1/traces/${traceId}/complete`);
351
349
  }
352
350
  async traceVerify(traceId) {
353
- return this._request("GET", `/v1/traces/${traceId}/verify`);
351
+ return this._request("POST", `/v1/traces/${traceId}/verify`);
354
352
  }
355
353
  // ========================================================================
356
354
  // Usage & Plans
@@ -409,6 +407,55 @@ var Novyx = class {
409
407
  if (relation) params.relation = relation;
410
408
  return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
411
409
  }
410
+ async edges(opts) {
411
+ const params = {
412
+ limit: opts?.limit ?? 100,
413
+ offset: opts?.offset ?? 0
414
+ };
415
+ if (opts?.relation) params.relation = opts.relation;
416
+ return this._request("GET", "/v1/memories/edges", { params });
417
+ }
418
+ // ========================================================================
419
+ // Knowledge Graph (Pro+)
420
+ // ========================================================================
421
+ async triple(subject, predicate, object, opts) {
422
+ const body = { subject, predicate, object };
423
+ if (opts?.confidence !== void 0) body.confidence = opts.confidence;
424
+ if (opts?.source_memory_id) body.source_memory_id = opts.source_memory_id;
425
+ if (opts?.subject_type) body.subject_type = opts.subject_type;
426
+ if (opts?.object_type) body.object_type = opts.object_type;
427
+ if (opts?.metadata) body.metadata = opts.metadata;
428
+ return this._request("POST", "/v1/knowledge/triples", { body });
429
+ }
430
+ async triples(opts) {
431
+ const params = {
432
+ limit: opts?.limit ?? 50,
433
+ offset: opts?.offset ?? 0
434
+ };
435
+ if (opts?.subject) params.subject = opts.subject;
436
+ if (opts?.predicate) params.predicate = opts.predicate;
437
+ if (opts?.object) params.object = opts.object;
438
+ if (opts?.source_memory_id) params.source_memory_id = opts.source_memory_id;
439
+ return this._request("GET", "/v1/knowledge/triples", { params });
440
+ }
441
+ async deleteTriple(tripleId) {
442
+ return this._request("DELETE", `/v1/knowledge/triples/${tripleId}`);
443
+ }
444
+ async entities(opts) {
445
+ const params = {
446
+ limit: opts?.limit ?? 50,
447
+ offset: opts?.offset ?? 0
448
+ };
449
+ if (opts?.entity_type) params.entity_type = opts.entity_type;
450
+ if (opts?.q) params.q = opts.q;
451
+ return this._request("GET", "/v1/knowledge/entities", { params });
452
+ }
453
+ async entity(entityId) {
454
+ return this._request("GET", `/v1/knowledge/entities/${entityId}`);
455
+ }
456
+ async deleteEntity(entityId) {
457
+ return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
458
+ }
412
459
  };
413
460
  export {
414
461
  Novyx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "novyx",
3
- "version": "2.5.0",
3
+ "version": "2.6.1",
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",