novyx 2.6.0 → 2.7.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
@@ -90,6 +90,98 @@ interface EntityTraversalResult {
90
90
  as_object: KGTriple[];
91
91
  total_connections: number;
92
92
  }
93
+ interface ReplayTimelineEntry {
94
+ timestamp: string;
95
+ operation: string;
96
+ memory_id?: string;
97
+ observation_preview?: string;
98
+ agent_id?: string;
99
+ importance?: number;
100
+ content_hash?: string;
101
+ metadata?: Record<string, any>;
102
+ }
103
+ interface ReplayTimelineResult {
104
+ entries: ReplayTimelineEntry[];
105
+ total_count: number;
106
+ has_more: boolean;
107
+ period_start?: string;
108
+ period_end?: string;
109
+ }
110
+ interface ReplaySnapshotResult {
111
+ snapshot_at: string;
112
+ total_memories: number;
113
+ memories: Memory[];
114
+ edges: Edge[];
115
+ total_edges: number;
116
+ }
117
+ interface MemoryLifecycleEvent {
118
+ timestamp: string;
119
+ event_type: string;
120
+ detail?: Record<string, any>;
121
+ }
122
+ interface MemoryLifecycleResult {
123
+ memory_id: string;
124
+ observation: string;
125
+ created_at: string;
126
+ current_state?: string;
127
+ events: MemoryLifecycleEvent[];
128
+ versions: Record<string, any>[];
129
+ links: Edge[];
130
+ recall_count: number;
131
+ last_recalled_at?: string;
132
+ }
133
+ interface CounterfactualRecallResult {
134
+ query: string;
135
+ snapshot_at: string;
136
+ total_results: number;
137
+ results: {
138
+ uuid: string;
139
+ observation: string;
140
+ similarity: number;
141
+ score: number;
142
+ importance: number;
143
+ confidence: number;
144
+ created_at: string;
145
+ }[];
146
+ }
147
+ interface ReplayDiffResult {
148
+ from_timestamp: string;
149
+ to_timestamp: string;
150
+ added: ReplayDiffEntry[];
151
+ removed: ReplayDiffEntry[];
152
+ modified: ReplayDiffEntry[];
153
+ summary: {
154
+ added: number;
155
+ removed: number;
156
+ modified: number;
157
+ };
158
+ }
159
+ interface ReplayDiffEntry {
160
+ memory_id: string;
161
+ change_type: string;
162
+ observation_preview?: string;
163
+ importance?: number;
164
+ }
165
+ interface DriftAnalysisResult {
166
+ from_timestamp: string;
167
+ to_timestamp: string;
168
+ memory_count_from: number;
169
+ memory_count_to: number;
170
+ memory_count_delta: number;
171
+ avg_importance_from: number;
172
+ avg_importance_to: number;
173
+ avg_importance_delta: number;
174
+ tag_shifts: {
175
+ tag: string;
176
+ count_from: number;
177
+ count_to: number;
178
+ delta: number;
179
+ }[];
180
+ importance_distribution_from: Record<string, number>;
181
+ importance_distribution_to: Record<string, number>;
182
+ top_new_topics: string[];
183
+ top_lost_topics: string[];
184
+ }
93
185
 
94
186
  declare class NovyxSession {
95
187
  private client;
@@ -208,7 +300,7 @@ declare class Novyx {
208
300
  auditExport(format?: string): Promise<Response>;
209
301
  auditVerify(): Promise<Record<string, any>>;
210
302
  traceCreate(agentId: string, sessionId?: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
211
- traceStep(traceId: string, stepType: string, name: string, content?: string, attributes?: Record<string, any>): Promise<Record<string, any>>;
303
+ traceStep(traceId: string, stepType: string, content: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
212
304
  traceComplete(traceId: string): Promise<Record<string, any>>;
213
305
  traceVerify(traceId: string): Promise<Record<string, any>>;
214
306
  usage(): Promise<Record<string, any>>;
@@ -251,6 +343,24 @@ declare class Novyx {
251
343
  }): Promise<EntityListResult>;
252
344
  entity(entityId: string): Promise<EntityTraversalResult>;
253
345
  deleteEntity(entityId: string): Promise<Record<string, any>>;
346
+ replayTimeline(opts?: {
347
+ since?: string;
348
+ until?: string;
349
+ operations?: string[];
350
+ agent_id?: string;
351
+ limit?: number;
352
+ offset?: number;
353
+ }): Promise<ReplayTimelineResult>;
354
+ replaySnapshot(at: string, opts?: {
355
+ limit?: number;
356
+ offset?: number;
357
+ }): Promise<ReplaySnapshotResult>;
358
+ replayMemory(memoryId: string): Promise<MemoryLifecycleResult>;
359
+ replayRecall(query: string, at: string, opts?: {
360
+ limit?: number;
361
+ }): Promise<CounterfactualRecallResult>;
362
+ replayDiff(from: string, to: string): Promise<ReplayDiffResult>;
363
+ replayDrift(from: string, to: string): Promise<DriftAnalysisResult>;
254
364
  }
255
365
 
256
366
  declare class NovyxError extends Error {
@@ -281,4 +391,4 @@ declare class NovyxSecurityError extends NovyxError {
281
391
  constructor(message?: string);
282
392
  }
283
393
 
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 };
394
+ export { type ContextNowResult, type CounterfactualRecallResult, type DriftAnalysisResult, type Edge, type EdgesListResult, type EntityListResult, type EntityTraversalResult, type KGEntity, type KGTriple, type LinksResult, type ListResult, type Memory, type MemoryLifecycleEvent, type MemoryLifecycleResult, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type ReplayDiffEntry, type ReplayDiffResult, type ReplaySnapshotResult, type ReplayTimelineEntry, type ReplayTimelineResult, type SearchResult, type TripleListResult };
package/dist/index.d.ts CHANGED
@@ -90,6 +90,98 @@ interface EntityTraversalResult {
90
90
  as_object: KGTriple[];
91
91
  total_connections: number;
92
92
  }
93
+ interface ReplayTimelineEntry {
94
+ timestamp: string;
95
+ operation: string;
96
+ memory_id?: string;
97
+ observation_preview?: string;
98
+ agent_id?: string;
99
+ importance?: number;
100
+ content_hash?: string;
101
+ metadata?: Record<string, any>;
102
+ }
103
+ interface ReplayTimelineResult {
104
+ entries: ReplayTimelineEntry[];
105
+ total_count: number;
106
+ has_more: boolean;
107
+ period_start?: string;
108
+ period_end?: string;
109
+ }
110
+ interface ReplaySnapshotResult {
111
+ snapshot_at: string;
112
+ total_memories: number;
113
+ memories: Memory[];
114
+ edges: Edge[];
115
+ total_edges: number;
116
+ }
117
+ interface MemoryLifecycleEvent {
118
+ timestamp: string;
119
+ event_type: string;
120
+ detail?: Record<string, any>;
121
+ }
122
+ interface MemoryLifecycleResult {
123
+ memory_id: string;
124
+ observation: string;
125
+ created_at: string;
126
+ current_state?: string;
127
+ events: MemoryLifecycleEvent[];
128
+ versions: Record<string, any>[];
129
+ links: Edge[];
130
+ recall_count: number;
131
+ last_recalled_at?: string;
132
+ }
133
+ interface CounterfactualRecallResult {
134
+ query: string;
135
+ snapshot_at: string;
136
+ total_results: number;
137
+ results: {
138
+ uuid: string;
139
+ observation: string;
140
+ similarity: number;
141
+ score: number;
142
+ importance: number;
143
+ confidence: number;
144
+ created_at: string;
145
+ }[];
146
+ }
147
+ interface ReplayDiffResult {
148
+ from_timestamp: string;
149
+ to_timestamp: string;
150
+ added: ReplayDiffEntry[];
151
+ removed: ReplayDiffEntry[];
152
+ modified: ReplayDiffEntry[];
153
+ summary: {
154
+ added: number;
155
+ removed: number;
156
+ modified: number;
157
+ };
158
+ }
159
+ interface ReplayDiffEntry {
160
+ memory_id: string;
161
+ change_type: string;
162
+ observation_preview?: string;
163
+ importance?: number;
164
+ }
165
+ interface DriftAnalysisResult {
166
+ from_timestamp: string;
167
+ to_timestamp: string;
168
+ memory_count_from: number;
169
+ memory_count_to: number;
170
+ memory_count_delta: number;
171
+ avg_importance_from: number;
172
+ avg_importance_to: number;
173
+ avg_importance_delta: number;
174
+ tag_shifts: {
175
+ tag: string;
176
+ count_from: number;
177
+ count_to: number;
178
+ delta: number;
179
+ }[];
180
+ importance_distribution_from: Record<string, number>;
181
+ importance_distribution_to: Record<string, number>;
182
+ top_new_topics: string[];
183
+ top_lost_topics: string[];
184
+ }
93
185
 
94
186
  declare class NovyxSession {
95
187
  private client;
@@ -208,7 +300,7 @@ declare class Novyx {
208
300
  auditExport(format?: string): Promise<Response>;
209
301
  auditVerify(): Promise<Record<string, any>>;
210
302
  traceCreate(agentId: string, sessionId?: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
211
- traceStep(traceId: string, stepType: string, name: string, content?: string, attributes?: Record<string, any>): Promise<Record<string, any>>;
303
+ traceStep(traceId: string, stepType: string, content: string, metadata?: Record<string, any>): Promise<Record<string, any>>;
212
304
  traceComplete(traceId: string): Promise<Record<string, any>>;
213
305
  traceVerify(traceId: string): Promise<Record<string, any>>;
214
306
  usage(): Promise<Record<string, any>>;
@@ -251,6 +343,24 @@ declare class Novyx {
251
343
  }): Promise<EntityListResult>;
252
344
  entity(entityId: string): Promise<EntityTraversalResult>;
253
345
  deleteEntity(entityId: string): Promise<Record<string, any>>;
346
+ replayTimeline(opts?: {
347
+ since?: string;
348
+ until?: string;
349
+ operations?: string[];
350
+ agent_id?: string;
351
+ limit?: number;
352
+ offset?: number;
353
+ }): Promise<ReplayTimelineResult>;
354
+ replaySnapshot(at: string, opts?: {
355
+ limit?: number;
356
+ offset?: number;
357
+ }): Promise<ReplaySnapshotResult>;
358
+ replayMemory(memoryId: string): Promise<MemoryLifecycleResult>;
359
+ replayRecall(query: string, at: string, opts?: {
360
+ limit?: number;
361
+ }): Promise<CounterfactualRecallResult>;
362
+ replayDiff(from: string, to: string): Promise<ReplayDiffResult>;
363
+ replayDrift(from: string, to: string): Promise<DriftAnalysisResult>;
254
364
  }
255
365
 
256
366
  declare class NovyxError extends Error {
@@ -281,4 +391,4 @@ declare class NovyxSecurityError extends NovyxError {
281
391
  constructor(message?: string);
282
392
  }
283
393
 
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 };
394
+ export { type ContextNowResult, type CounterfactualRecallResult, type DriftAnalysisResult, type Edge, type EdgesListResult, type EntityListResult, type EntityTraversalResult, type KGEntity, type KGTriple, type LinksResult, type ListResult, type Memory, type MemoryLifecycleEvent, type MemoryLifecycleResult, Novyx, NovyxAuthError, type NovyxConfig, NovyxError, NovyxForbiddenError, NovyxNotFoundError, NovyxRateLimitError, NovyxSecurityError, NovyxSession, type ReplayDiffEntry, type ReplayDiffResult, type ReplaySnapshotResult, type ReplayTimelineEntry, type ReplayTimelineResult, 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
@@ -491,6 +489,39 @@ var Novyx = class {
491
489
  async deleteEntity(entityId) {
492
490
  return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
493
491
  }
492
+ // ========================================================================
493
+ // Replay (Pro+)
494
+ // ========================================================================
495
+ async replayTimeline(opts) {
496
+ const params = {
497
+ limit: opts?.limit ?? 100,
498
+ offset: opts?.offset ?? 0
499
+ };
500
+ if (opts?.since) params.since = opts.since;
501
+ if (opts?.until) params.until = opts.until;
502
+ if (opts?.operations) params.operations = opts.operations.join(",");
503
+ if (opts?.agent_id) params.agent_id = opts.agent_id;
504
+ return this._request("GET", "/v1/replay/timeline", { params });
505
+ }
506
+ async replaySnapshot(at, opts) {
507
+ return this._request("GET", "/v1/replay/snapshot", {
508
+ params: { at, limit: opts?.limit ?? 500, offset: opts?.offset ?? 0 }
509
+ });
510
+ }
511
+ async replayMemory(memoryId) {
512
+ return this._request("GET", `/v1/replay/memory/${memoryId}`);
513
+ }
514
+ async replayRecall(query, at, opts) {
515
+ return this._request("POST", "/v1/replay/recall", {
516
+ body: { query, at, limit: opts?.limit ?? 5 }
517
+ });
518
+ }
519
+ async replayDiff(from, to) {
520
+ return this._request("GET", "/v1/replay/diff", { params: { from, to } });
521
+ }
522
+ async replayDrift(from, to) {
523
+ return this._request("GET", "/v1/replay/drift", { params: { from, to } });
524
+ }
494
525
  };
495
526
  // Annotate the CommonJS export names for ESM import in node:
496
527
  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
@@ -458,6 +456,39 @@ var Novyx = class {
458
456
  async deleteEntity(entityId) {
459
457
  return this._request("DELETE", `/v1/knowledge/entities/${entityId}`);
460
458
  }
459
+ // ========================================================================
460
+ // Replay (Pro+)
461
+ // ========================================================================
462
+ async replayTimeline(opts) {
463
+ const params = {
464
+ limit: opts?.limit ?? 100,
465
+ offset: opts?.offset ?? 0
466
+ };
467
+ if (opts?.since) params.since = opts.since;
468
+ if (opts?.until) params.until = opts.until;
469
+ if (opts?.operations) params.operations = opts.operations.join(",");
470
+ if (opts?.agent_id) params.agent_id = opts.agent_id;
471
+ return this._request("GET", "/v1/replay/timeline", { params });
472
+ }
473
+ async replaySnapshot(at, opts) {
474
+ return this._request("GET", "/v1/replay/snapshot", {
475
+ params: { at, limit: opts?.limit ?? 500, offset: opts?.offset ?? 0 }
476
+ });
477
+ }
478
+ async replayMemory(memoryId) {
479
+ return this._request("GET", `/v1/replay/memory/${memoryId}`);
480
+ }
481
+ async replayRecall(query, at, opts) {
482
+ return this._request("POST", "/v1/replay/recall", {
483
+ body: { query, at, limit: opts?.limit ?? 5 }
484
+ });
485
+ }
486
+ async replayDiff(from, to) {
487
+ return this._request("GET", "/v1/replay/diff", { params: { from, to } });
488
+ }
489
+ async replayDrift(from, to) {
490
+ return this._request("GET", "/v1/replay/drift", { params: { from, to } });
491
+ }
461
492
  };
462
493
  export {
463
494
  Novyx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "novyx",
3
- "version": "2.6.0",
3
+ "version": "2.7.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",