@smartmemory/sdk-js 1.4.44 → 1.4.45
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/{core-C_2OxSk3.js → core-BWFexoX-.js} +273 -93
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var I = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var I = (a) => {
|
|
2
|
+
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var $ = (
|
|
5
|
-
var p = (
|
|
6
|
-
const
|
|
4
|
+
var $ = (a, e, t) => e.has(a) || I("Cannot " + t);
|
|
5
|
+
var p = (a, e, t) => ($(a, e, "read from private field"), t ? t.call(a) : e.get(a)), k = (a, e, t) => e.has(a) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), w = (a, e, t, s) => ($(a, e, "write to private field"), s ? s.call(a, t) : e.set(a, t), t), S = (a, e, t) => ($(a, e, "access private method"), t);
|
|
6
|
+
const U = {
|
|
7
7
|
access: "smart_memory_auth_token",
|
|
8
8
|
refresh: "smart_memory_refresh_token",
|
|
9
9
|
user: "smart_memory_user",
|
|
@@ -16,14 +16,14 @@ const R = {
|
|
|
16
16
|
tenant: ["tenant_id", "workspace_id", "sm_workspace_id"],
|
|
17
17
|
team: ["team_id", "sm_team_id"]
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class A {
|
|
20
20
|
/**
|
|
21
21
|
* @param {Object} options
|
|
22
22
|
* @param {'localStorage' | 'sessionStorage' | 'memory'} [options.storage='localStorage']
|
|
23
23
|
* @param {Object} [options.keys] - Custom storage key names
|
|
24
24
|
*/
|
|
25
25
|
constructor({ storage: e = "localStorage", keys: t = {} } = {}) {
|
|
26
|
-
this.storageType = e, this.keys = { ...
|
|
26
|
+
this.storageType = e, this.keys = { ...U, ...t }, this._memory = { access: null, refresh: null, user: null, tenant: null, team: null };
|
|
27
27
|
}
|
|
28
28
|
getAccessToken() {
|
|
29
29
|
return this.storageType === "memory" ? this._memory.access : this._getFromStorage(this.keys.access, h.access);
|
|
@@ -114,15 +114,15 @@ class U {
|
|
|
114
114
|
try {
|
|
115
115
|
const s = this.storageType === "localStorage" ? localStorage : sessionStorage, r = this.storageType === "localStorage" ? sessionStorage : localStorage, n = s.getItem(e) || r.getItem(e);
|
|
116
116
|
if (n != null) return n;
|
|
117
|
-
for (const
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
this._setInStorage(e,
|
|
117
|
+
for (const i of t) {
|
|
118
|
+
const o = s.getItem(i) || r.getItem(i);
|
|
119
|
+
if (o != null) {
|
|
120
|
+
this._setInStorage(e, o);
|
|
121
121
|
try {
|
|
122
|
-
s.removeItem(
|
|
122
|
+
s.removeItem(i), r.removeItem(i);
|
|
123
123
|
} catch {
|
|
124
124
|
}
|
|
125
|
-
return
|
|
125
|
+
return o;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
return null;
|
|
@@ -148,7 +148,7 @@ class U {
|
|
|
148
148
|
return s === "none" || s === "null" || s === "undefined" ? null : t;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
var
|
|
151
|
+
var l, d, R;
|
|
152
152
|
class P {
|
|
153
153
|
/**
|
|
154
154
|
* @param {Object} options
|
|
@@ -159,23 +159,23 @@ class P {
|
|
|
159
159
|
* @param {function(string): void} options.onTokenRefreshed
|
|
160
160
|
* @param {function(): void} options.onRefreshFailed
|
|
161
161
|
*/
|
|
162
|
-
constructor({ apiBaseUrl: e, refreshEndpoint: t, tokenManager: s, useCookieAuth: r = !1, onTokenRefreshed: n, onRefreshFailed:
|
|
162
|
+
constructor({ apiBaseUrl: e, refreshEndpoint: t, tokenManager: s, useCookieAuth: r = !1, onTokenRefreshed: n, onRefreshFailed: i }) {
|
|
163
163
|
k(this, d);
|
|
164
|
-
k(this,
|
|
165
|
-
this.apiBaseUrl = e, this.refreshEndpoint = t, this.tokenManager = s, this.useCookieAuth = r, this.onTokenRefreshed = n, this.onRefreshFailed =
|
|
164
|
+
k(this, l, null);
|
|
165
|
+
this.apiBaseUrl = e, this.refreshEndpoint = t, this.tokenManager = s, this.useCookieAuth = r, this.onTokenRefreshed = n, this.onRefreshFailed = i;
|
|
166
166
|
}
|
|
167
167
|
async refresh() {
|
|
168
|
-
if (p(this,
|
|
169
|
-
return p(this,
|
|
170
|
-
w(this,
|
|
168
|
+
if (p(this, l))
|
|
169
|
+
return p(this, l);
|
|
170
|
+
w(this, l, S(this, d, R).call(this));
|
|
171
171
|
try {
|
|
172
|
-
return await p(this,
|
|
172
|
+
return await p(this, l);
|
|
173
173
|
} finally {
|
|
174
|
-
w(this,
|
|
174
|
+
w(this, l, null);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
l = new WeakMap(), d = new WeakSet(), R = async function() {
|
|
179
179
|
const e = this.tokenManager.getRefreshToken();
|
|
180
180
|
if (!e && !this.useCookieAuth)
|
|
181
181
|
throw this.onRefreshFailed(), new Error("No refresh token");
|
|
@@ -230,9 +230,9 @@ class C {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class L {
|
|
234
234
|
constructor(e) {
|
|
235
|
-
this.mode = e.mode, this.apiBaseUrl = e.apiBaseUrl, this.endpoints = e.endpoints || {}, this.listeners = /* @__PURE__ */ new Set(), this.useCookieAuth = e.useCookieAuth ?? this.mode === "sso", this.apiKey = e.apiKey || null, this.apiKey && (this.mode = "apiKey"), this.tokenManager = new
|
|
235
|
+
this.mode = e.mode, this.apiBaseUrl = e.apiBaseUrl, this.endpoints = e.endpoints || {}, this.listeners = /* @__PURE__ */ new Set(), this.useCookieAuth = e.useCookieAuth ?? this.mode === "sso", this.apiKey = e.apiKey || null, this.apiKey && (this.mode = "apiKey"), this.tokenManager = new A({
|
|
236
236
|
storage: e.storage || "localStorage",
|
|
237
237
|
keys: e.tokenKeys
|
|
238
238
|
}), this.mode !== "apiKey" ? this.refreshManager = new P({
|
|
@@ -376,7 +376,7 @@ class g extends Error {
|
|
|
376
376
|
super(e), this.name = "APIError", this.status = t, this.detail = s;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
class
|
|
379
|
+
class q {
|
|
380
380
|
/**
|
|
381
381
|
* @param {import('../auth/AuthCore.js').AuthCore} authCore
|
|
382
382
|
* @param {{ fetchFn?: typeof globalThis.fetch }} [options]
|
|
@@ -388,35 +388,35 @@ class L {
|
|
|
388
388
|
return this._customFetchFn || globalThis.fetch.bind(globalThis);
|
|
389
389
|
}
|
|
390
390
|
async request(e, t = {}) {
|
|
391
|
-
var
|
|
391
|
+
var i, o;
|
|
392
392
|
const s = `${this.baseURL}${e}`, r = {
|
|
393
393
|
"Content-Type": "application/json",
|
|
394
394
|
...this.auth.getAuthHeaders(t.headers)
|
|
395
395
|
}, n = this.auth.getRequestOptions({ ...t, headers: r });
|
|
396
396
|
try {
|
|
397
|
-
let
|
|
398
|
-
if (
|
|
397
|
+
let c = await this.fetchFn(s, n);
|
|
398
|
+
if (c.status === 401 && !t.__isRetry)
|
|
399
399
|
try {
|
|
400
400
|
await this.auth.refreshToken();
|
|
401
401
|
const u = {
|
|
402
402
|
"Content-Type": "application/json",
|
|
403
403
|
...this.auth.getAuthHeaders(t.headers)
|
|
404
404
|
};
|
|
405
|
-
|
|
405
|
+
c = await this.fetchFn(
|
|
406
406
|
s,
|
|
407
407
|
this.auth.getRequestOptions({ ...n, headers: u, __isRetry: !0 })
|
|
408
408
|
);
|
|
409
409
|
} catch {
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
412
|
-
throw (
|
|
413
|
-
if (
|
|
411
|
+
if (c.status === 401)
|
|
412
|
+
throw (o = (i = this.auth).clearLocalAuth) == null || o.call(i), new g("Authentication required", 401, "auth_expired");
|
|
413
|
+
if (c.status === 204)
|
|
414
414
|
return null;
|
|
415
|
-
if (!
|
|
416
|
-
throw await this._handleError(
|
|
417
|
-
return await
|
|
418
|
-
} catch (
|
|
419
|
-
throw
|
|
415
|
+
if (!c.ok)
|
|
416
|
+
throw await this._handleError(c);
|
|
417
|
+
return await c.json();
|
|
418
|
+
} catch (c) {
|
|
419
|
+
throw c instanceof g ? c : new g(c.message, 0, "network_error");
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
async get(e, t = {}) {
|
|
@@ -486,7 +486,7 @@ class L {
|
|
|
486
486
|
return typeof (e == null ? void 0 : e.message) == "string" ? e.message : `HTTP ${t}`;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
class
|
|
489
|
+
class M {
|
|
490
490
|
constructor(e) {
|
|
491
491
|
this.api = e;
|
|
492
492
|
}
|
|
@@ -496,16 +496,16 @@ class z {
|
|
|
496
496
|
metadata: s = null,
|
|
497
497
|
usePipeline: r = !0,
|
|
498
498
|
profileName: n = null,
|
|
499
|
-
conversationContext:
|
|
499
|
+
conversationContext: i = null
|
|
500
500
|
}) {
|
|
501
|
-
const
|
|
501
|
+
const o = {
|
|
502
502
|
content: e,
|
|
503
503
|
memory_type: t,
|
|
504
504
|
metadata: s,
|
|
505
505
|
use_pipeline: r,
|
|
506
506
|
profile_name: n
|
|
507
507
|
};
|
|
508
|
-
return
|
|
508
|
+
return i != null && (o.conversation_context = i), this.api.post("/memory/add", o);
|
|
509
509
|
}
|
|
510
510
|
async get(e) {
|
|
511
511
|
const t = await this.api.get(`/memory/${e}`);
|
|
@@ -563,17 +563,17 @@ class z {
|
|
|
563
563
|
* present only under `cite: true`. Pre-LINEAGE-1 callers who indexed into a
|
|
564
564
|
* bare array must read `response.results` instead.
|
|
565
565
|
*/
|
|
566
|
-
async search(e, { topK: t = 5, enableHybrid: s = !0, memoryType: r = null, expertise: n = !1, cite:
|
|
567
|
-
const
|
|
568
|
-
return r && (
|
|
566
|
+
async search(e, { topK: t = 5, enableHybrid: s = !0, memoryType: r = null, expertise: n = !1, cite: i = !1, decompose: o = !1, multiHop: c = !1, maxHops: u = 3, budgetMs: y = 1500, semanticHops: f = !1, includeReference: _ = !1, includeConsolidated: v = !1, consolidationFirst: T = !1 } = {}) {
|
|
567
|
+
const m = { query: e, top_k: t, enable_hybrid: s };
|
|
568
|
+
return r && (m.memory_type = r), n && (m.expertise = !0), i && (m.cite = !0), o && (m.decompose = !0), c && (m.multi_hop = !0), c && u !== 3 && (m.max_hops = u), c && y !== 1500 && (m.budget_ms = y), c && f && (m.semantic_hops = !0), _ && (m.include_reference = !0), v && (m.include_consolidated = !0), T && (m.consolidation_first = !0), this.api.post("/memory/search", m);
|
|
569
569
|
}
|
|
570
570
|
async getWorkingContext(e, t, { k: s = 20, maxTokens: r = null, strategy: n = null } = {}) {
|
|
571
|
-
const
|
|
571
|
+
const i = {
|
|
572
572
|
session_id: e,
|
|
573
573
|
query: t,
|
|
574
574
|
k: s
|
|
575
575
|
};
|
|
576
|
-
return r != null && (
|
|
576
|
+
return r != null && (i.max_tokens = r), n != null && (i.strategy = n), this.api.post("/memory/context", i);
|
|
577
577
|
}
|
|
578
578
|
async searchAdvanced(e, { algorithm: t = "query_traversal", maxResults: s = 15, useSSG: r = !0 } = {}) {
|
|
579
579
|
return this.api.post("/memory/search/advanced", {
|
|
@@ -612,11 +612,11 @@ class z {
|
|
|
612
612
|
conversationId: s = null,
|
|
613
613
|
sessionDates: r = null,
|
|
614
614
|
turnsPerChunk: n = 15,
|
|
615
|
-
maxChunkChars:
|
|
616
|
-
maxConcurrent:
|
|
615
|
+
maxChunkChars: i = 12e3,
|
|
616
|
+
maxConcurrent: o = 4
|
|
617
617
|
} = {}) {
|
|
618
|
-
const
|
|
619
|
-
return t && (
|
|
618
|
+
const c = { turns: e, turns_per_chunk: n, max_chunk_chars: i, max_concurrent: o };
|
|
619
|
+
return t && (c.session_boundaries = t), s && (c.conversation_id = s), r && (c.session_dates = r), this.api.post("/memory/ingest/conversation", c);
|
|
620
620
|
}
|
|
621
621
|
async ingestDocument(e, { title: t = null, source: s = null, chunkStrategy: r = null } = {}) {
|
|
622
622
|
const n = { content: e };
|
|
@@ -627,8 +627,8 @@ class z {
|
|
|
627
627
|
return t && (r.repo = t), s && (r.commit = s), this.api.post("/memory/code/index", r);
|
|
628
628
|
}
|
|
629
629
|
async codeSearch(e, { entityType: t = null, repo: s = null, limit: r = 20, semantic: n = !1 } = {}) {
|
|
630
|
-
const
|
|
631
|
-
return t &&
|
|
630
|
+
const i = new URLSearchParams({ query: e, limit: r, semantic: n });
|
|
631
|
+
return t && i.append("entity_type", t), s && i.append("repo", s), this.api.get(`/memory/code/search?${i}`);
|
|
632
632
|
}
|
|
633
633
|
async codeContext(e, { repo: t = null } = {}) {
|
|
634
634
|
const s = new URLSearchParams({ entity_name: e });
|
|
@@ -709,8 +709,8 @@ class z {
|
|
|
709
709
|
}
|
|
710
710
|
async getChanges(e, { since: t = null, until: s = null, changeType: r = null } = {}) {
|
|
711
711
|
let n = `/memory/temporal/${e}/changes`;
|
|
712
|
-
const
|
|
713
|
-
return t &&
|
|
712
|
+
const i = [];
|
|
713
|
+
return t && i.push(`since=${t}`), s && i.push(`until=${s}`), r && i.push(`change_type=${r}`), i.length && (n += `?${i.join("&")}`), this.api.get(n);
|
|
714
714
|
}
|
|
715
715
|
async compareVersions(e, t, s) {
|
|
716
716
|
return this.api.post(`/memory/temporal/${e}/compare?v1=${t}&v2=${s}`);
|
|
@@ -728,7 +728,7 @@ class z {
|
|
|
728
728
|
return this.api.get("/memory/clustering/stats");
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
class
|
|
731
|
+
class z {
|
|
732
732
|
constructor(e) {
|
|
733
733
|
this.api = e;
|
|
734
734
|
}
|
|
@@ -753,9 +753,9 @@ class E {
|
|
|
753
753
|
confidence: s = 0.8,
|
|
754
754
|
sourceTraceId: r = null,
|
|
755
755
|
sourceSessionId: n = null,
|
|
756
|
-
evidenceIds:
|
|
757
|
-
domain:
|
|
758
|
-
tags:
|
|
756
|
+
evidenceIds: i = null,
|
|
757
|
+
domain: o = null,
|
|
758
|
+
tags: c = null,
|
|
759
759
|
rejectedAlternatives: u = null,
|
|
760
760
|
rationale: y = null,
|
|
761
761
|
constraints: f = null,
|
|
@@ -767,9 +767,9 @@ class E {
|
|
|
767
767
|
confidence: s,
|
|
768
768
|
source_trace_id: r,
|
|
769
769
|
source_session_id: n,
|
|
770
|
-
evidence_ids:
|
|
771
|
-
domain:
|
|
772
|
-
tags:
|
|
770
|
+
evidence_ids: i,
|
|
771
|
+
domain: o,
|
|
772
|
+
tags: c,
|
|
773
773
|
rejected_alternatives: u,
|
|
774
774
|
rationale: y,
|
|
775
775
|
constraints: f,
|
|
@@ -943,7 +943,7 @@ class E {
|
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
class
|
|
946
|
+
class E {
|
|
947
947
|
constructor(e) {
|
|
948
948
|
this.api = e;
|
|
949
949
|
}
|
|
@@ -965,7 +965,7 @@ class x {
|
|
|
965
965
|
return t.confidence !== void 0 && (s.confidence = t.confidence), t.subject !== void 0 && (s.subject = t.subject), t.subjectType !== void 0 && (s.subject_type = t.subjectType), t.disposition !== void 0 && (s.disposition = t.disposition), t.formedFrom !== void 0 && (s.formed_from = t.formedFrom), t.domain !== void 0 && (s.domain = t.domain), t.agentId !== void 0 && (s.agent_id = t.agentId), this.api.post("/memory/opinions/create", s);
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
class
|
|
968
|
+
class x {
|
|
969
969
|
constructor(e) {
|
|
970
970
|
this.api = e;
|
|
971
971
|
}
|
|
@@ -1310,7 +1310,7 @@ class N {
|
|
|
1310
1310
|
return this.api.get("/memory/token-usage/current");
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
class
|
|
1313
|
+
class D {
|
|
1314
1314
|
constructor(e) {
|
|
1315
1315
|
this.api = e;
|
|
1316
1316
|
}
|
|
@@ -1358,8 +1358,8 @@ class V {
|
|
|
1358
1358
|
*/
|
|
1359
1359
|
async getChanges(e, { since: t = null, until: s = null, changeType: r = null } = {}) {
|
|
1360
1360
|
let n = `/memory/temporal/${e}/changes`;
|
|
1361
|
-
const
|
|
1362
|
-
return t &&
|
|
1361
|
+
const i = [];
|
|
1362
|
+
return t && i.push(`since=${t}`), s && i.push(`until=${s}`), r && i.push(`change_type=${r}`), i.length && (n += `?${i.join("&")}`), this.api.get(n);
|
|
1363
1363
|
}
|
|
1364
1364
|
// === VERSION COMPARISON ===
|
|
1365
1365
|
/**
|
|
@@ -1395,9 +1395,9 @@ class V {
|
|
|
1395
1395
|
* @param {string} [options.endTime]
|
|
1396
1396
|
*/
|
|
1397
1397
|
async getAuditTrail(e, { changeType: t = null, userId: s = null, startTime: r = null, endTime: n = null } = {}) {
|
|
1398
|
-
let
|
|
1399
|
-
const
|
|
1400
|
-
return t &&
|
|
1398
|
+
let i = `/memory/temporal/${e}/audit`;
|
|
1399
|
+
const o = [];
|
|
1400
|
+
return t && o.push(`change_type=${t}`), s && o.push(`user_id=${s}`), r && o.push(`start_time=${r}`), n && o.push(`end_time=${n}`), o.length && (i += `?${o.join("&")}`), this.api.get(i);
|
|
1401
1401
|
}
|
|
1402
1402
|
// === TEMPORAL SEARCH ===
|
|
1403
1403
|
/**
|
|
@@ -1428,8 +1428,8 @@ class V {
|
|
|
1428
1428
|
async complianceReport(e, t, { reportType: s = "HIPAA", itemIds: r = null } = {}) {
|
|
1429
1429
|
let n = `/memory/temporal/compliance/report?start_date=${e}&end_date=${t}&report_type=${s}`;
|
|
1430
1430
|
if (r && r.length)
|
|
1431
|
-
for (const
|
|
1432
|
-
n += `&item_ids=${encodeURIComponent(
|
|
1431
|
+
for (const i of r)
|
|
1432
|
+
n += `&item_ids=${encodeURIComponent(i)}`;
|
|
1433
1433
|
return this.api.get(n);
|
|
1434
1434
|
}
|
|
1435
1435
|
// === TEMPORAL RELATIONSHIPS ===
|
|
@@ -1456,7 +1456,7 @@ class V {
|
|
|
1456
1456
|
return this.api.get(`/memory/temporal/relationships/${e}/valid-periods`);
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
|
-
class
|
|
1459
|
+
class J {
|
|
1460
1460
|
constructor(e) {
|
|
1461
1461
|
this.api = e;
|
|
1462
1462
|
}
|
|
@@ -1525,7 +1525,7 @@ class D {
|
|
|
1525
1525
|
return this.api.get("/memory/governance/summary");
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
class
|
|
1528
|
+
class V {
|
|
1529
1529
|
constructor(e) {
|
|
1530
1530
|
this.api = e;
|
|
1531
1531
|
}
|
|
@@ -1595,14 +1595,14 @@ class W {
|
|
|
1595
1595
|
* @param {boolean} [params.useWikipedia=true]
|
|
1596
1596
|
* @param {boolean} [params.useLlm=true]
|
|
1597
1597
|
*/
|
|
1598
|
-
async resolve({ existingItemId: e, newFact: t, autoResolve: s = !0, strategy: r = null, useWikipedia: n = !0, useLlm:
|
|
1598
|
+
async resolve({ existingItemId: e, newFact: t, autoResolve: s = !0, strategy: r = null, useWikipedia: n = !0, useLlm: i = !0 }) {
|
|
1599
1599
|
return this.api.post("/memory/reasoning/resolve", {
|
|
1600
1600
|
existing_item_id: e,
|
|
1601
1601
|
new_fact: t,
|
|
1602
1602
|
auto_resolve: s,
|
|
1603
1603
|
strategy: r,
|
|
1604
1604
|
use_wikipedia: n,
|
|
1605
|
-
use_llm:
|
|
1605
|
+
use_llm: i
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
// === CONFLICT QUERIES ===
|
|
@@ -2107,8 +2107,188 @@ class Z {
|
|
|
2107
2107
|
async resolveHitl(e, { action: t, note: s = null }) {
|
|
2108
2108
|
return this.api.post(`/memory/ontology/hitl/${e}/resolve`, { action: t, note: s });
|
|
2109
2109
|
}
|
|
2110
|
+
// --- ONTO-CRUD-1 read / audit / migration surface -------------------------
|
|
2111
|
+
/**
|
|
2112
|
+
* List ontology types, keyset-paginated.
|
|
2113
|
+
* @param {Object} [options]
|
|
2114
|
+
* @param {string} [options.tier] working|proposed|confirmed|retired
|
|
2115
|
+
* @param {string} [options.layer] public|domain|private
|
|
2116
|
+
* @param {string} [options.packId] filter by originating pack id
|
|
2117
|
+
* @param {boolean} [options.hasIri] only types with (or without) an IRI
|
|
2118
|
+
* @param {number} [options.limit=100]
|
|
2119
|
+
* @param {string} [options.cursor] opaque keyset continuation token
|
|
2120
|
+
*/
|
|
2121
|
+
async listTypes({ tier: e, layer: t, packId: s, hasIri: r, limit: n = 100, cursor: i } = {}) {
|
|
2122
|
+
const o = { limit: String(n) };
|
|
2123
|
+
e !== void 0 && (o.tier = e), t !== void 0 && (o.layer = t), s !== void 0 && (o.pack_id = s), r !== void 0 && (o.has_iri = String(r)), i !== void 0 && (o.cursor = i);
|
|
2124
|
+
const c = new URLSearchParams(o).toString();
|
|
2125
|
+
return this.api.get(`/memory/ontology/types${c ? "?" + c : ""}`);
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* List ontology relation types, keyset-paginated. Mirror of `listTypes`.
|
|
2129
|
+
* @param {Object} [options]
|
|
2130
|
+
* @param {string} [options.tier] working|proposed|confirmed|retired
|
|
2131
|
+
* @param {string} [options.layer] public|domain|private
|
|
2132
|
+
* @param {string} [options.packId] filter by originating pack id
|
|
2133
|
+
* @param {boolean} [options.hasIri] only relations with (or without) an IRI
|
|
2134
|
+
* @param {number} [options.limit=100]
|
|
2135
|
+
* @param {string} [options.cursor] opaque keyset continuation token
|
|
2136
|
+
*/
|
|
2137
|
+
async listRelations({ tier: e, layer: t, packId: s, hasIri: r, limit: n = 100, cursor: i } = {}) {
|
|
2138
|
+
const o = { limit: String(n) };
|
|
2139
|
+
e !== void 0 && (o.tier = e), t !== void 0 && (o.layer = t), s !== void 0 && (o.pack_id = s), r !== void 0 && (o.has_iri = String(r)), i !== void 0 && (o.cursor = i);
|
|
2140
|
+
const c = new URLSearchParams(o).toString();
|
|
2141
|
+
return this.api.get(`/memory/ontology/relations${c ? "?" + c : ""}`);
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Resolve a single ontology type by iri/qid/name.
|
|
2145
|
+
* @param {string} typeId
|
|
2146
|
+
*/
|
|
2147
|
+
async getType(e) {
|
|
2148
|
+
return this.api.get(`/memory/ontology/types/${encodeURIComponent(e)}`);
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Resolve a single ontology relation type by its identity (iri -> pid -> name).
|
|
2152
|
+
* @param {string} relationId
|
|
2153
|
+
*/
|
|
2154
|
+
async getRelation(e) {
|
|
2155
|
+
return this.api.get(`/memory/ontology/relations/${encodeURIComponent(e)}`);
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* Cross-entity, newest-first ontology audit feed.
|
|
2159
|
+
* @param {Object} [options]
|
|
2160
|
+
* @param {string} [options.actor]
|
|
2161
|
+
* @param {string} [options.action] e.g. migrate, retire
|
|
2162
|
+
* @param {string} [options.since] full ISO-8601 lower bound (inclusive)
|
|
2163
|
+
* @param {string} [options.until] full ISO-8601 upper bound (inclusive)
|
|
2164
|
+
* @param {number} [options.limit=200]
|
|
2165
|
+
*/
|
|
2166
|
+
async listAudit({ actor: e, action: t, since: s, until: r, limit: n = 200 } = {}) {
|
|
2167
|
+
const i = { limit: String(n) };
|
|
2168
|
+
e !== void 0 && (i.actor = e), t !== void 0 && (i.action = t), s !== void 0 && (i.since = s), r !== void 0 && (i.until = r);
|
|
2169
|
+
const o = new URLSearchParams(i).toString();
|
|
2170
|
+
return this.api.get(`/memory/ontology/audit${o ? "?" + o : ""}`);
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Full append-only audit trail for one ontology type (oldest-first).
|
|
2174
|
+
* @param {string} typeId
|
|
2175
|
+
*/
|
|
2176
|
+
async getTypeAudit(e) {
|
|
2177
|
+
return this.api.get(`/memory/ontology/types/${encodeURIComponent(e)}/audit`);
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Full append-only audit trail for one ontology relation (oldest-first).
|
|
2181
|
+
* @param {string} relationId
|
|
2182
|
+
*/
|
|
2183
|
+
async getRelationAudit(e) {
|
|
2184
|
+
return this.api.get(`/memory/ontology/relations/${encodeURIComponent(e)}/audit`);
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Full append-only audit trail for a pack (oldest-first), optionally version-scoped.
|
|
2188
|
+
* @param {string} packId
|
|
2189
|
+
* @param {Object} [options]
|
|
2190
|
+
* @param {string} [options.packVersion] scope to one installed version; omit for all
|
|
2191
|
+
*/
|
|
2192
|
+
async getPackAudit(e, { packVersion: t = null } = {}) {
|
|
2193
|
+
const s = {};
|
|
2194
|
+
t !== null && (s.pack_version = t);
|
|
2195
|
+
const r = new URLSearchParams(s).toString();
|
|
2196
|
+
return this.api.get(`/memory/ontology/packs/${encodeURIComponent(e)}/audit${r ? "?" + r : ""}`);
|
|
2197
|
+
}
|
|
2198
|
+
/**
|
|
2199
|
+
* Reclassify every instance of `fromId` onto `toId`. Both types stay live.
|
|
2200
|
+
* @param {string} fromId
|
|
2201
|
+
* @param {string} toId
|
|
2202
|
+
* @param {Object} params
|
|
2203
|
+
* @param {string} params.reason why the migration is being performed (audit evidence)
|
|
2204
|
+
* @param {number} [params.batchSize=500] instance edges rewritten per chunk
|
|
2205
|
+
*/
|
|
2206
|
+
async migrateTypeInstances(e, t, { reason: s, batchSize: r = 500 }) {
|
|
2207
|
+
return this.api.post(
|
|
2208
|
+
`/memory/ontology/types/${encodeURIComponent(e)}/migrate-to/${encodeURIComponent(t)}`,
|
|
2209
|
+
{ reason: s, batch_size: r }
|
|
2210
|
+
);
|
|
2211
|
+
}
|
|
2212
|
+
// --- ONTO-HITL-CURATE-1 curation queue surface ---------------------------
|
|
2213
|
+
/**
|
|
2214
|
+
* List ontology review queue items, keyset-paginated.
|
|
2215
|
+
* @param {Object} [options]
|
|
2216
|
+
* @param {string} [options.tier] working|proposed
|
|
2217
|
+
* @param {string} [options.assignee] filter by review assignee
|
|
2218
|
+
* @param {string} [options.source] filter by source string
|
|
2219
|
+
* @param {number} [options.limit=100]
|
|
2220
|
+
* @param {string} [options.cursor] opaque keyset continuation token
|
|
2221
|
+
*/
|
|
2222
|
+
async listReviewQueue({ tier: e, assignee: t, source: s, limit: r = 100, cursor: n } = {}) {
|
|
2223
|
+
const i = { limit: String(r) };
|
|
2224
|
+
e !== void 0 && (i.tier = e), t !== void 0 && (i.assignee = t), s !== void 0 && (i.source = s), n !== void 0 && (i.cursor = n);
|
|
2225
|
+
const o = new URLSearchParams(i).toString();
|
|
2226
|
+
return this.api.get(`/memory/ontology/queue${o ? "?" + o : ""}`);
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Approve one ontology review type.
|
|
2230
|
+
* @param {string} typeId private-layer ontology type name
|
|
2231
|
+
* @param {Object} [options]
|
|
2232
|
+
* @param {string} [options.expectedTier] optional optimistic tier precondition
|
|
2233
|
+
*/
|
|
2234
|
+
async approveReviewType(e, { expectedTier: t } = {}) {
|
|
2235
|
+
const s = {};
|
|
2236
|
+
return t !== void 0 && (s.expected_tier = t), this.api.post(`/memory/ontology/queue/${encodeURIComponent(e)}/approve`, s);
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Reject one ontology review type.
|
|
2240
|
+
* @param {string} typeId private-layer ontology type name
|
|
2241
|
+
* @param {Object} [options]
|
|
2242
|
+
* @param {string} [options.expectedTier] optional optimistic tier precondition
|
|
2243
|
+
*/
|
|
2244
|
+
async rejectReviewType(e, { expectedTier: t } = {}) {
|
|
2245
|
+
const s = {};
|
|
2246
|
+
return t !== void 0 && (s.expected_tier = t), this.api.post(`/memory/ontology/queue/${encodeURIComponent(e)}/reject`, s);
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Merge one ontology review type into another type.
|
|
2250
|
+
* @param {string} typeId private-layer ontology type name being reviewed
|
|
2251
|
+
* @param {string} intoId destination type identifier
|
|
2252
|
+
* @param {Object} [options]
|
|
2253
|
+
* @param {string} [options.expectedTier] optional optimistic tier precondition
|
|
2254
|
+
*/
|
|
2255
|
+
async mergeReviewType(e, t, { expectedTier: s } = {}) {
|
|
2256
|
+
const r = { into_id: t };
|
|
2257
|
+
return s !== void 0 && (r.expected_tier = s), this.api.post(`/memory/ontology/queue/${encodeURIComponent(e)}/merge`, r);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Edit and promote one ontology review type.
|
|
2261
|
+
* @param {string} typeId private-layer ontology type name being reviewed
|
|
2262
|
+
* @param {Object} edits edit payload accepted by the service
|
|
2263
|
+
* @param {Object} [options]
|
|
2264
|
+
* @param {string} [options.expectedTier] optional optimistic tier precondition
|
|
2265
|
+
*/
|
|
2266
|
+
async editPromoteReviewType(e, t, { expectedTier: s } = {}) {
|
|
2267
|
+
const r = { edits: t };
|
|
2268
|
+
return s !== void 0 && (r.expected_tier = s), this.api.post(`/memory/ontology/queue/${encodeURIComponent(e)}/edit-promote`, r);
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Assign or clear the reviewer for one ontology review type.
|
|
2272
|
+
* @param {string} typeId private-layer ontology type name being reviewed
|
|
2273
|
+
* @param {string|null} assignee reviewer identifier, or null to clear assignment
|
|
2274
|
+
*/
|
|
2275
|
+
async assignReviewer(e, t) {
|
|
2276
|
+
return this.api.post(`/memory/ontology/queue/${encodeURIComponent(e)}/assign`, { assignee: t });
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Apply a curation action to many ontology review types.
|
|
2280
|
+
* @param {string} action approve|reject|merge|edit_promote|assign
|
|
2281
|
+
* @param {string[]} ids private-layer ontology type names to process
|
|
2282
|
+
* @param {Object} [options]
|
|
2283
|
+
* @param {Object} [options.params] action-specific params
|
|
2284
|
+
* @param {string} [options.expectedTier] optional optimistic tier precondition
|
|
2285
|
+
*/
|
|
2286
|
+
async bulkReviewAction(e, t, { params: s, expectedTier: r } = {}) {
|
|
2287
|
+
const n = { action: e, ids: t, params: s === void 0 ? {} : s };
|
|
2288
|
+
return r !== void 0 && (n.expected_tier = r), this.api.post("/memory/ontology/queue/bulk", n);
|
|
2289
|
+
}
|
|
2110
2290
|
}
|
|
2111
|
-
class
|
|
2291
|
+
class Q {
|
|
2112
2292
|
constructor(e) {
|
|
2113
2293
|
this.api = e;
|
|
2114
2294
|
}
|
|
@@ -2137,7 +2317,7 @@ class X {
|
|
|
2137
2317
|
return e !== null && (r.protected_attributes = e), t !== null && (r.sentiment_analysis = t), s !== null && (r.topic_analysis = s), this.api.post("/memory/analytics/bias", r);
|
|
2138
2318
|
}
|
|
2139
2319
|
}
|
|
2140
|
-
class
|
|
2320
|
+
class X {
|
|
2141
2321
|
constructor(e) {
|
|
2142
2322
|
this.api = e;
|
|
2143
2323
|
}
|
|
@@ -2688,9 +2868,9 @@ class ae {
|
|
|
2688
2868
|
}
|
|
2689
2869
|
class ce {
|
|
2690
2870
|
constructor(e) {
|
|
2691
|
-
this.auth = new
|
|
2692
|
-
const t = new
|
|
2693
|
-
this.memories = new
|
|
2871
|
+
this.auth = new L(e);
|
|
2872
|
+
const t = new q(this.auth, { fetchFn: e.fetchFn });
|
|
2873
|
+
this.memories = new M(t), this.decisions = new z(t), this.opinions = new E(t), this.graph = new x(t), this.teams = new O(t), this.profiles = new j(t), this.subscriptions = new F(t), this.authAPI = new H(t), this.agents = new K(t), this.usage = new B(t), this.insights = new G(t), this.tokenUsage = new N(t), this.temporal = new D(t), this.governance = new J(t), this.evolution = new V(t), this.reasoning = new W(t), this.reasoningTraces = new Y(t), this.ontology = new Z(t), this.analytics = new Q(t), this.validation = new X(t), this.pipeline = new ee(t), this.archive = new te(t), this.zettelkasten = new se(t), this.procedureMatches = new re(t), this.procedureCandidates = new ne(t), this.procedureDrift = new ie(t), this.summaries = new ae(t);
|
|
2694
2874
|
}
|
|
2695
2875
|
setTeamId(e) {
|
|
2696
2876
|
this.auth.tokenManager.setTeamId(e), this.auth.notifyListeners();
|
|
@@ -2701,34 +2881,34 @@ class ce {
|
|
|
2701
2881
|
}
|
|
2702
2882
|
export {
|
|
2703
2883
|
g as A,
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2884
|
+
q as B,
|
|
2885
|
+
z as D,
|
|
2886
|
+
V as E,
|
|
2887
|
+
J as G,
|
|
2708
2888
|
G as I,
|
|
2709
|
-
|
|
2889
|
+
M,
|
|
2710
2890
|
Z as O,
|
|
2711
2891
|
ee as P,
|
|
2712
2892
|
W as R,
|
|
2713
2893
|
ce as S,
|
|
2714
2894
|
O as T,
|
|
2715
2895
|
B as U,
|
|
2716
|
-
|
|
2896
|
+
X as V,
|
|
2717
2897
|
se as Z,
|
|
2718
2898
|
K as a,
|
|
2719
|
-
|
|
2899
|
+
Q as b,
|
|
2720
2900
|
te as c,
|
|
2721
2901
|
H as d,
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2902
|
+
L as e,
|
|
2903
|
+
x as f,
|
|
2904
|
+
E as g,
|
|
2725
2905
|
ne as h,
|
|
2726
2906
|
re as i,
|
|
2727
2907
|
j,
|
|
2728
2908
|
Y as k,
|
|
2729
2909
|
F as l,
|
|
2730
|
-
|
|
2731
|
-
|
|
2910
|
+
D as m,
|
|
2911
|
+
A as n,
|
|
2732
2912
|
N as o,
|
|
2733
2913
|
P as p,
|
|
2734
2914
|
C as q
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as r, d as A, e as I, B as P, D as n, f as o, I as t, M as i, j as g, p as M, q as h, S as m, l as S, T as f, n as p, U as l } from "./core-
|
|
1
|
+
import { A as e, a as r, d as A, e as I, B as P, D as n, f as o, I as t, M as i, j as g, p as M, q as h, S as m, l as S, T as f, n as p, U as l } from "./core-BWFexoX-.js";
|
|
2
2
|
export {
|
|
3
3
|
e as APIError,
|
|
4
4
|
r as AgentAPI,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as f, a as u, b as A, c as b, d as P, e as h, D as I, E as g, G as x, f as p, I as w, M as m, O as k, g as v, P as T, h as B, i as y, j as C, R as E, k as S, S as R, l as F, T as M, m as L, n as O, o as G, U, V as $, Z as D } from "./core-
|
|
1
|
+
import { A as f, a as u, b as A, c as b, d as P, e as h, D as I, E as g, G as x, f as p, I as w, M as m, O as k, g as v, P as T, h as B, i as y, j as C, R as E, k as S, S as R, l as F, T as M, m as L, n as O, o as G, U, V as $, Z as D } from "./core-BWFexoX-.js";
|
|
2
2
|
const i = {
|
|
3
3
|
variables: {
|
|
4
4
|
colorBackground: "transparent",
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import h, { createContext as d, useRef as y, useState as v, useEffect as b, useCallback as c, useContext as f } from "react";
|
|
2
|
-
import { S as x } from "./core-
|
|
2
|
+
import { S as x } from "./core-BWFexoX-.js";
|
|
3
3
|
const m = d(null), g = d(null);
|
|
4
4
|
function U({ children: e, ...r }) {
|
|
5
5
|
const n = y(null);
|