novyx 2.5.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 +66 -1
- package/dist/index.d.ts +66 -1
- package/dist/index.js +49 -0
- package/dist/index.mjs +49 -0
- package/package.json +1 -1
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;
|
|
@@ -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;
|
|
@@ -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
|
@@ -442,6 +442,55 @@ var Novyx = class {
|
|
|
442
442
|
if (relation) params.relation = relation;
|
|
443
443
|
return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
|
|
444
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
|
+
}
|
|
445
494
|
};
|
|
446
495
|
// Annotate the CommonJS export names for ESM import in node:
|
|
447
496
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -409,6 +409,55 @@ var Novyx = class {
|
|
|
409
409
|
if (relation) params.relation = relation;
|
|
410
410
|
return this._request("GET", `/v1/memories/${memoryId}/links`, { params });
|
|
411
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
|
+
}
|
|
412
461
|
};
|
|
413
462
|
export {
|
|
414
463
|
Novyx,
|