@smartmemory/sdk-js 1.4.87 → 1.4.91
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-BUZV42uF.js → core-D8pAeiLz.js} +157 -156
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
1
|
+
var q = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
const
|
|
4
|
+
var A = (a, e, t) => e.has(a) || q("Cannot " + t);
|
|
5
|
+
var R = (a, e, t) => (A(a, e, "read from private field"), t ? t.call(a) : e.get(a)), T = (a, e, t) => e.has(a) ? q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), C = (a, e, t, n) => (A(a, e, "write to private field"), n ? n.call(a, t) : e.set(a, t), t), L = (a, e, t) => (A(a, e, "access private method"), t);
|
|
6
|
+
const x = {
|
|
7
7
|
access: "smart_memory_auth_token",
|
|
8
8
|
refresh: "smart_memory_refresh_token",
|
|
9
9
|
user: "smart_memory_user",
|
|
10
10
|
tenant: "smart_memory_tenant_id",
|
|
11
11
|
team: "smart_memory_team_id"
|
|
12
|
-
},
|
|
12
|
+
}, w = {
|
|
13
13
|
access: ["access_token", "sm_token"],
|
|
14
14
|
refresh: ["refresh_token", "sm_refresh_token"],
|
|
15
15
|
user: ["sm_user"],
|
|
16
16
|
tenant: ["tenant_id", "workspace_id", "sm_workspace_id"],
|
|
17
17
|
team: ["team_id", "sm_team_id"]
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class z {
|
|
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 = { ...x, ...t }, this._memory = { access: null, refresh: null, user: null, tenant: null, team: null };
|
|
27
27
|
}
|
|
28
28
|
getAccessToken() {
|
|
29
|
-
return this.storageType === "memory" ? this._memory.access : this._getFromStorage(this.keys.access,
|
|
29
|
+
return this.storageType === "memory" ? this._memory.access : this._getFromStorage(this.keys.access, w.access);
|
|
30
30
|
}
|
|
31
31
|
setAccessToken(e) {
|
|
32
32
|
if (this.storageType === "memory") {
|
|
@@ -36,7 +36,7 @@ class x {
|
|
|
36
36
|
this._setInStorage(this.keys.access, e);
|
|
37
37
|
}
|
|
38
38
|
getRefreshToken() {
|
|
39
|
-
return this.storageType === "memory" ? this._memory.refresh : this._getFromStorage(this.keys.refresh,
|
|
39
|
+
return this.storageType === "memory" ? this._memory.refresh : this._getFromStorage(this.keys.refresh, w.refresh);
|
|
40
40
|
}
|
|
41
41
|
setRefreshToken(e) {
|
|
42
42
|
if (this.storageType === "memory") {
|
|
@@ -47,7 +47,7 @@ class x {
|
|
|
47
47
|
}
|
|
48
48
|
getUser() {
|
|
49
49
|
if (this.storageType === "memory") return this._memory.user;
|
|
50
|
-
const e = this._getFromStorage(this.keys.user,
|
|
50
|
+
const e = this._getFromStorage(this.keys.user, w.user);
|
|
51
51
|
if (!e) return null;
|
|
52
52
|
try {
|
|
53
53
|
return JSON.parse(e);
|
|
@@ -63,7 +63,7 @@ class x {
|
|
|
63
63
|
this._setInStorage(this.keys.user, e ? JSON.stringify(e) : null);
|
|
64
64
|
}
|
|
65
65
|
getTenantId() {
|
|
66
|
-
return this.storageType === "memory" ? this._memory.tenant : this._normalizeId(this._getFromStorage(this.keys.tenant,
|
|
66
|
+
return this.storageType === "memory" ? this._memory.tenant : this._normalizeId(this._getFromStorage(this.keys.tenant, w.tenant));
|
|
67
67
|
}
|
|
68
68
|
setTenantId(e) {
|
|
69
69
|
const t = this._normalizeId(e);
|
|
@@ -74,7 +74,7 @@ class x {
|
|
|
74
74
|
this._setInStorage(this.keys.tenant, t);
|
|
75
75
|
}
|
|
76
76
|
getTeamId() {
|
|
77
|
-
return this.storageType === "memory" ? this._memory.team : this._normalizeId(this._getFromStorage(this.keys.team,
|
|
77
|
+
return this.storageType === "memory" ? this._memory.team : this._normalizeId(this._getFromStorage(this.keys.team, w.team));
|
|
78
78
|
}
|
|
79
79
|
setTeamId(e) {
|
|
80
80
|
const t = this._normalizeId(e);
|
|
@@ -94,7 +94,7 @@ class x {
|
|
|
94
94
|
localStorage.removeItem(e), sessionStorage.removeItem(e);
|
|
95
95
|
} catch {
|
|
96
96
|
}
|
|
97
|
-
for (const e of Object.values(
|
|
97
|
+
for (const e of Object.values(w))
|
|
98
98
|
for (const t of e)
|
|
99
99
|
try {
|
|
100
100
|
localStorage.removeItem(t), sessionStorage.removeItem(t);
|
|
@@ -148,8 +148,8 @@ class x {
|
|
|
148
148
|
return n === "none" || n === "null" || n === "undefined" ? null : t;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
class
|
|
151
|
+
var f, U, M;
|
|
152
|
+
class F {
|
|
153
153
|
/**
|
|
154
154
|
* @param {Object} options
|
|
155
155
|
* @param {string} options.apiBaseUrl
|
|
@@ -160,22 +160,22 @@ class z {
|
|
|
160
160
|
* @param {function(): void} options.onRefreshFailed
|
|
161
161
|
*/
|
|
162
162
|
constructor({ apiBaseUrl: e, refreshEndpoint: t, tokenManager: n, useCookieAuth: s = !1, onTokenRefreshed: r, onRefreshFailed: i }) {
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
T(this, U);
|
|
164
|
+
T(this, f, null);
|
|
165
165
|
this.apiBaseUrl = e, this.refreshEndpoint = t, this.tokenManager = n, this.useCookieAuth = s, this.onTokenRefreshed = r, this.onRefreshFailed = i;
|
|
166
166
|
}
|
|
167
167
|
async refresh() {
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
|
|
168
|
+
if (R(this, f))
|
|
169
|
+
return R(this, f);
|
|
170
|
+
C(this, f, L(this, U, M).call(this));
|
|
171
171
|
try {
|
|
172
|
-
return await
|
|
172
|
+
return await R(this, f);
|
|
173
173
|
} finally {
|
|
174
|
-
|
|
174
|
+
C(this, f, null);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
f = new WeakMap(), U = new WeakSet(), M = 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");
|
|
@@ -190,8 +190,8 @@ g = new WeakMap(), S = new WeakSet(), E = async function() {
|
|
|
190
190
|
const s = await n.json();
|
|
191
191
|
return this.tokenManager.setAccessToken(s.access_token), s.refresh_token && this.tokenManager.setRefreshToken(s.refresh_token), this.onTokenRefreshed(s.access_token), s.access_token;
|
|
192
192
|
};
|
|
193
|
-
const
|
|
194
|
-
class
|
|
193
|
+
const P = "smart_memory_sso_redirect";
|
|
194
|
+
class O {
|
|
195
195
|
/**
|
|
196
196
|
* @param {Object} options
|
|
197
197
|
* @param {string} options.webAppUrl - Web app URL for login redirect
|
|
@@ -216,26 +216,26 @@ class F {
|
|
|
216
216
|
}
|
|
217
217
|
storeRedirect(e) {
|
|
218
218
|
try {
|
|
219
|
-
sessionStorage.setItem(
|
|
219
|
+
sessionStorage.setItem(P, e);
|
|
220
220
|
} catch (t) {
|
|
221
221
|
console.warn("Failed to store redirect URL:", t);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
getAndClearRedirect() {
|
|
225
225
|
try {
|
|
226
|
-
const e = sessionStorage.getItem(
|
|
227
|
-
return sessionStorage.removeItem(
|
|
226
|
+
const e = sessionStorage.getItem(P);
|
|
227
|
+
return sessionStorage.removeItem(P), e;
|
|
228
228
|
} catch {
|
|
229
229
|
return null;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class j {
|
|
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 z({
|
|
236
236
|
storage: e.storage || "localStorage",
|
|
237
237
|
keys: e.tokenKeys
|
|
238
|
-
}), this.mode !== "apiKey" ? this.refreshManager = new
|
|
238
|
+
}), this.mode !== "apiKey" ? this.refreshManager = new F({
|
|
239
239
|
apiBaseUrl: this.apiBaseUrl,
|
|
240
240
|
refreshEndpoint: this.endpoints.refresh || "/auth/refresh",
|
|
241
241
|
tokenManager: this.tokenManager,
|
|
@@ -247,7 +247,7 @@ class O {
|
|
|
247
247
|
onRefreshFailed: () => {
|
|
248
248
|
this.clearLocalAuth();
|
|
249
249
|
}
|
|
250
|
-
}) : this.refreshManager = null, this.mode === "sso" && (this.ssoManager = new
|
|
250
|
+
}) : this.refreshManager = null, this.mode === "sso" && (this.ssoManager = new O({
|
|
251
251
|
webAppUrl: e.webAppUrl,
|
|
252
252
|
allowedHosts: e.allowedRedirectHosts || [],
|
|
253
253
|
tokenManager: this.tokenManager
|
|
@@ -367,7 +367,7 @@ class O {
|
|
|
367
367
|
this.tokenManager.setTenantId(e), this.notifyListeners();
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
class
|
|
370
|
+
class k extends Error {
|
|
371
371
|
/**
|
|
372
372
|
* @param {string} message - Error message
|
|
373
373
|
* @param {number} [status=0] - HTTP status code (0 for network errors)
|
|
@@ -377,13 +377,13 @@ class $ extends Error {
|
|
|
377
377
|
super(e), this.name = "APIError", this.status = t, this.detail = n;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function S(a) {
|
|
381
381
|
return typeof FormData < "u" && a instanceof FormData;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function E(a) {
|
|
384
384
|
return (a == null ? void 0 : a.name) === "AbortError";
|
|
385
385
|
}
|
|
386
|
-
class
|
|
386
|
+
class B {
|
|
387
387
|
/**
|
|
388
388
|
* @param {import('../auth/AuthCore.js').AuthCore} authCore
|
|
389
389
|
* @param {{ fetchFn?: typeof globalThis.fetch }} [options]
|
|
@@ -407,7 +407,7 @@ class j {
|
|
|
407
407
|
async request(e, t = {}) {
|
|
408
408
|
var i, c;
|
|
409
409
|
const n = `${this.baseURL}${e}`, s = {
|
|
410
|
-
...
|
|
410
|
+
...S(t.body) ? {} : { "Content-Type": "application/json" },
|
|
411
411
|
...this.auth.getAuthHeaders(t.headers)
|
|
412
412
|
}, r = this.auth.getRequestOptions({ ...t, headers: s });
|
|
413
413
|
try {
|
|
@@ -415,25 +415,25 @@ class j {
|
|
|
415
415
|
if (o.status === 401 && !t.__isRetry)
|
|
416
416
|
try {
|
|
417
417
|
await this.auth.refreshToken();
|
|
418
|
-
const
|
|
419
|
-
...
|
|
418
|
+
const h = {
|
|
419
|
+
...S(t.body) ? {} : { "Content-Type": "application/json" },
|
|
420
420
|
...this.auth.getAuthHeaders(t.headers)
|
|
421
421
|
};
|
|
422
422
|
o = await this.fetchFn(
|
|
423
423
|
n,
|
|
424
|
-
this.auth.getRequestOptions({ ...r, headers:
|
|
424
|
+
this.auth.getRequestOptions({ ...r, headers: h, __isRetry: !0 })
|
|
425
425
|
);
|
|
426
426
|
} catch {
|
|
427
427
|
}
|
|
428
428
|
if (o.status === 401)
|
|
429
|
-
throw (c = (i = this.auth).clearLocalAuth) == null || c.call(i), new
|
|
429
|
+
throw (c = (i = this.auth).clearLocalAuth) == null || c.call(i), new k("Authentication required", 401, "auth_expired");
|
|
430
430
|
if (o.status === 204)
|
|
431
431
|
return null;
|
|
432
432
|
if (!o.ok)
|
|
433
433
|
throw await this._handleError(o);
|
|
434
434
|
return await o.json();
|
|
435
435
|
} catch (o) {
|
|
436
|
-
throw o instanceof
|
|
436
|
+
throw o instanceof k || E(o) ? o : new k(o.message, 0, "network_error");
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
async get(e, t = {}) {
|
|
@@ -449,7 +449,7 @@ class j {
|
|
|
449
449
|
async requestBinary(e, t = {}) {
|
|
450
450
|
var i, c;
|
|
451
451
|
const n = `${this.baseURL}${e}`, s = {
|
|
452
|
-
...
|
|
452
|
+
...S(t.body) ? {} : { "Content-Type": "application/json" },
|
|
453
453
|
...this.auth.getAuthHeaders(t.headers)
|
|
454
454
|
}, r = this.auth.getRequestOptions({ ...t, headers: s });
|
|
455
455
|
try {
|
|
@@ -457,23 +457,23 @@ class j {
|
|
|
457
457
|
if (o.status === 401 && !t.__isRetry)
|
|
458
458
|
try {
|
|
459
459
|
await this.auth.refreshToken();
|
|
460
|
-
const
|
|
461
|
-
...
|
|
460
|
+
const h = {
|
|
461
|
+
...S(t.body) ? {} : { "Content-Type": "application/json" },
|
|
462
462
|
...this.auth.getAuthHeaders(t.headers)
|
|
463
463
|
};
|
|
464
464
|
o = await this.fetchFn(
|
|
465
465
|
n,
|
|
466
|
-
this.auth.getRequestOptions({ ...r, headers:
|
|
466
|
+
this.auth.getRequestOptions({ ...r, headers: h, __isRetry: !0 })
|
|
467
467
|
);
|
|
468
468
|
} catch {
|
|
469
469
|
}
|
|
470
470
|
if (o.status === 401)
|
|
471
|
-
throw (c = (i = this.auth).clearLocalAuth) == null || c.call(i), new
|
|
471
|
+
throw (c = (i = this.auth).clearLocalAuth) == null || c.call(i), new k("Authentication required", 401, "auth_expired");
|
|
472
472
|
if (!o.ok)
|
|
473
473
|
throw await this._handleError(o);
|
|
474
474
|
return await o.arrayBuffer();
|
|
475
475
|
} catch (o) {
|
|
476
|
-
throw o instanceof
|
|
476
|
+
throw o instanceof k || E(o) ? o : new k(o.message, 0, "network_error");
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
async postForm(e, t, n = {}) {
|
|
@@ -510,7 +510,7 @@ class j {
|
|
|
510
510
|
} catch {
|
|
511
511
|
t = { message: `HTTP ${e.status}` };
|
|
512
512
|
}
|
|
513
|
-
return new
|
|
513
|
+
return new k(
|
|
514
514
|
this._extractMessage(t, e.status),
|
|
515
515
|
e.status,
|
|
516
516
|
t
|
|
@@ -540,7 +540,7 @@ class j {
|
|
|
540
540
|
return typeof (e == null ? void 0 : e.message) == "string" ? e.message : `HTTP ${t}`;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
class
|
|
543
|
+
class H {
|
|
544
544
|
constructor(e) {
|
|
545
545
|
this.api = e;
|
|
546
546
|
}
|
|
@@ -641,9 +641,8 @@ class B {
|
|
|
641
641
|
* @param {object} [options]
|
|
642
642
|
* @param {number} [options.limit=50]
|
|
643
643
|
* @param {number} [options.offset=0]
|
|
644
|
-
* @param {string|null} [options.type=null] -
|
|
645
|
-
*
|
|
646
|
-
* so nothing silently changes behaviour for callers already passing it.
|
|
644
|
+
* @param {string|null} [options.type=null] - Exact memory type filter, applied
|
|
645
|
+
* server-side before pagination and counting (sent as `memory_type`).
|
|
647
646
|
* @param {string|null} [options.metadataKey=null] - GRAPH-API-1l. Metadata key to filter
|
|
648
647
|
* on. Nested keys use dot syntax (`profile.tier`). Must be paired with `metadataValue`;
|
|
649
648
|
* sending only one half is a 422.
|
|
@@ -659,7 +658,7 @@ class B {
|
|
|
659
658
|
metadataValue: r = null
|
|
660
659
|
} = {}) {
|
|
661
660
|
const i = new URLSearchParams({ limit: e, offset: t });
|
|
662
|
-
return n && i.append("memory_type", n), s != null && i.append("metadata_key", s), r != null && i.append("metadata_value", r), this.api.get(`/memory/list?${i}`);
|
|
661
|
+
return n != null && i.append("memory_type", n), s != null && i.append("metadata_key", s), r != null && i.append("metadata_value", r), this.api.get(`/memory/list?${i}`);
|
|
663
662
|
}
|
|
664
663
|
/**
|
|
665
664
|
* Search for memory items.
|
|
@@ -701,6 +700,8 @@ class B {
|
|
|
701
700
|
* default CHANGED behaviour rather than preserving it — before
|
|
702
701
|
* CORE-ARCHIVED-RECALL-1 the server read `archived` on no search path at all, so
|
|
703
702
|
* archived items were returned ranked exactly like live ones.
|
|
703
|
+
* @param {boolean} [options.excludeSpeculative=false] - Exclude speculative
|
|
704
|
+
* memories from results. Sent as `exclude_speculative` only when true.
|
|
704
705
|
* @param {boolean} [options.cite=false] - When true (RECALL-CITATIONS-1), the
|
|
705
706
|
* envelope gains a `citations` array of `{n, item_id, item_type, preview, score, footnote_marker}`.
|
|
706
707
|
* Empty `citations: []` when no results — distinguishes "no results" from "no citations requested".
|
|
@@ -717,9 +718,9 @@ class B {
|
|
|
717
718
|
* result marked `'unresolved'` is PRESENT-DAY content and must not be rendered
|
|
718
719
|
* as a historical belief.
|
|
719
720
|
*/
|
|
720
|
-
async search(e, { topK: t = 5, enableHybrid: n = !0, memoryType: s = null, expertise: r = !1, cite: i = !1, decompose: c = !1, multiHop: o = !1, maxHops:
|
|
721
|
-
const
|
|
722
|
-
return s && (
|
|
721
|
+
async search(e, { topK: t = 5, enableHybrid: n = !0, memoryType: s = null, expertise: r = !1, cite: i = !1, decompose: c = !1, multiHop: o = !1, maxHops: h = 3, budgetMs: y = 1500, semanticHops: p = !1, includeReference: d = !1, includeConsolidated: _ = !1, consolidationFirst: $ = !1, asOfDate: g = null, asOfStrict: l = !1, includeSuperseded: b = !1, includeRetracted: I = !1, includeArchived: v = !1, excludeSpeculative: u = !1 } = {}) {
|
|
722
|
+
const m = { query: e, top_k: t, enable_hybrid: n };
|
|
723
|
+
return s && (m.memory_type = s), r && (m.expertise = !0), i && (m.cite = !0), c && (m.decompose = !0), o && (m.multi_hop = !0), o && h !== 3 && (m.max_hops = h), o && y !== 1500 && (m.budget_ms = y), o && p && (m.semantic_hops = !0), d && (m.include_reference = !0), _ && (m.include_consolidated = !0), $ && (m.consolidation_first = !0), g && (m.as_of_date = g instanceof Date ? g.toISOString() : g), l && (m.as_of_strict = !0), b && (m.include_superseded = !0), I && (m.include_retracted = !0), v && (m.include_archived = !0), u && (m.exclude_speculative = !0), this.api.post("/memory/search", m);
|
|
723
724
|
}
|
|
724
725
|
/**
|
|
725
726
|
* Ask a question and get a written answer plus the evidence behind it (DIST-LITE-9).
|
|
@@ -966,7 +967,7 @@ class B {
|
|
|
966
967
|
return this.api.get("/memory/clustering/stats");
|
|
967
968
|
}
|
|
968
969
|
}
|
|
969
|
-
class
|
|
970
|
+
class K {
|
|
970
971
|
constructor(e) {
|
|
971
972
|
this.api = e;
|
|
972
973
|
}
|
|
@@ -994,10 +995,10 @@ class H {
|
|
|
994
995
|
evidenceIds: i = null,
|
|
995
996
|
domain: c = null,
|
|
996
997
|
tags: o = null,
|
|
997
|
-
rejectedAlternatives:
|
|
998
|
-
rationale:
|
|
999
|
-
constraints:
|
|
1000
|
-
agentId:
|
|
998
|
+
rejectedAlternatives: h = null,
|
|
999
|
+
rationale: y = null,
|
|
1000
|
+
constraints: p = null,
|
|
1001
|
+
agentId: d = null
|
|
1001
1002
|
}) {
|
|
1002
1003
|
return this.api.post("/memory/decisions/create", {
|
|
1003
1004
|
content: e,
|
|
@@ -1008,10 +1009,10 @@ class H {
|
|
|
1008
1009
|
evidence_ids: i,
|
|
1009
1010
|
domain: c,
|
|
1010
1011
|
tags: o,
|
|
1011
|
-
rejected_alternatives:
|
|
1012
|
-
rationale:
|
|
1013
|
-
constraints:
|
|
1014
|
-
agent_id:
|
|
1012
|
+
rejected_alternatives: h,
|
|
1013
|
+
rationale: y,
|
|
1014
|
+
constraints: p,
|
|
1015
|
+
agent_id: d
|
|
1015
1016
|
});
|
|
1016
1017
|
}
|
|
1017
1018
|
/**
|
|
@@ -1184,7 +1185,7 @@ class H {
|
|
|
1184
1185
|
});
|
|
1185
1186
|
}
|
|
1186
1187
|
}
|
|
1187
|
-
class
|
|
1188
|
+
class G {
|
|
1188
1189
|
constructor(e) {
|
|
1189
1190
|
this.api = e;
|
|
1190
1191
|
}
|
|
@@ -1206,7 +1207,7 @@ class K {
|
|
|
1206
1207
|
return t.confidence !== void 0 && (n.confidence = t.confidence), t.subject !== void 0 && (n.subject = t.subject), t.subjectType !== void 0 && (n.subject_type = t.subjectType), t.disposition !== void 0 && (n.disposition = t.disposition), t.formedFrom !== void 0 && (n.formed_from = t.formedFrom), t.domain !== void 0 && (n.domain = t.domain), t.agentId !== void 0 && (n.agent_id = t.agentId), this.api.post("/memory/opinions/create", n);
|
|
1207
1208
|
}
|
|
1208
1209
|
}
|
|
1209
|
-
class
|
|
1210
|
+
class D {
|
|
1210
1211
|
constructor(e) {
|
|
1211
1212
|
this.api = e;
|
|
1212
1213
|
}
|
|
@@ -1355,7 +1356,7 @@ class G {
|
|
|
1355
1356
|
);
|
|
1356
1357
|
}
|
|
1357
1358
|
}
|
|
1358
|
-
class
|
|
1359
|
+
class N {
|
|
1359
1360
|
constructor(e) {
|
|
1360
1361
|
this.api = e;
|
|
1361
1362
|
}
|
|
@@ -1397,7 +1398,7 @@ class D {
|
|
|
1397
1398
|
return this.api.delete(`/memory/teams/${e}/members/${t}`);
|
|
1398
1399
|
}
|
|
1399
1400
|
}
|
|
1400
|
-
class
|
|
1401
|
+
class J {
|
|
1401
1402
|
constructor(e) {
|
|
1402
1403
|
this.api = e;
|
|
1403
1404
|
}
|
|
@@ -1419,7 +1420,7 @@ class N {
|
|
|
1419
1420
|
return this.api.patch("/auth/llm-keys", e);
|
|
1420
1421
|
}
|
|
1421
1422
|
}
|
|
1422
|
-
class
|
|
1423
|
+
class W {
|
|
1423
1424
|
constructor(e) {
|
|
1424
1425
|
this.api = e;
|
|
1425
1426
|
}
|
|
@@ -1445,7 +1446,7 @@ class J {
|
|
|
1445
1446
|
});
|
|
1446
1447
|
}
|
|
1447
1448
|
}
|
|
1448
|
-
class
|
|
1449
|
+
class V {
|
|
1449
1450
|
constructor(e) {
|
|
1450
1451
|
this.api = e;
|
|
1451
1452
|
}
|
|
@@ -1466,7 +1467,7 @@ class W {
|
|
|
1466
1467
|
return this.api.delete(`/memory/api-keys/${e}`);
|
|
1467
1468
|
}
|
|
1468
1469
|
}
|
|
1469
|
-
class
|
|
1470
|
+
class Y {
|
|
1470
1471
|
constructor(e) {
|
|
1471
1472
|
this.api = e;
|
|
1472
1473
|
}
|
|
@@ -1525,7 +1526,7 @@ class V {
|
|
|
1525
1526
|
return this.api.get(`/memory/agents/${e}/evaluation/history${r ? "?" + r : ""}`);
|
|
1526
1527
|
}
|
|
1527
1528
|
}
|
|
1528
|
-
class
|
|
1529
|
+
class X {
|
|
1529
1530
|
constructor(e) {
|
|
1530
1531
|
this.api = e;
|
|
1531
1532
|
}
|
|
@@ -1539,7 +1540,7 @@ class Y {
|
|
|
1539
1540
|
return this.api.get("/usage/tiers");
|
|
1540
1541
|
}
|
|
1541
1542
|
}
|
|
1542
|
-
class
|
|
1543
|
+
class Z {
|
|
1543
1544
|
constructor(e) {
|
|
1544
1545
|
this.api = e;
|
|
1545
1546
|
}
|
|
@@ -1556,7 +1557,7 @@ class X {
|
|
|
1556
1557
|
return this.api.get("/memory/plugins");
|
|
1557
1558
|
}
|
|
1558
1559
|
}
|
|
1559
|
-
class
|
|
1560
|
+
class Q {
|
|
1560
1561
|
constructor(e) {
|
|
1561
1562
|
this.api = e;
|
|
1562
1563
|
}
|
|
@@ -1579,7 +1580,7 @@ class Z {
|
|
|
1579
1580
|
return this.api.get("/memory/token-usage/current");
|
|
1580
1581
|
}
|
|
1581
1582
|
}
|
|
1582
|
-
class
|
|
1583
|
+
class ee {
|
|
1583
1584
|
constructor(e) {
|
|
1584
1585
|
this.api = e;
|
|
1585
1586
|
}
|
|
@@ -1725,7 +1726,7 @@ class Q {
|
|
|
1725
1726
|
return this.api.get(`/memory/temporal/relationships/${e}/valid-periods`);
|
|
1726
1727
|
}
|
|
1727
1728
|
}
|
|
1728
|
-
class
|
|
1729
|
+
class te {
|
|
1729
1730
|
constructor(e) {
|
|
1730
1731
|
this.api = e;
|
|
1731
1732
|
}
|
|
@@ -1794,7 +1795,7 @@ class ee {
|
|
|
1794
1795
|
return this.api.get("/memory/governance/summary");
|
|
1795
1796
|
}
|
|
1796
1797
|
}
|
|
1797
|
-
class
|
|
1798
|
+
class ne {
|
|
1798
1799
|
constructor(e) {
|
|
1799
1800
|
this.api = e;
|
|
1800
1801
|
}
|
|
@@ -1835,7 +1836,7 @@ class te {
|
|
|
1835
1836
|
return this.api.post("/memory/evolution/reinforce/opinions");
|
|
1836
1837
|
}
|
|
1837
1838
|
}
|
|
1838
|
-
class
|
|
1839
|
+
class se {
|
|
1839
1840
|
constructor(e) {
|
|
1840
1841
|
this.api = e;
|
|
1841
1842
|
}
|
|
@@ -1933,7 +1934,7 @@ class ne {
|
|
|
1933
1934
|
});
|
|
1934
1935
|
}
|
|
1935
1936
|
}
|
|
1936
|
-
class
|
|
1937
|
+
class re {
|
|
1937
1938
|
constructor(e) {
|
|
1938
1939
|
this.api = e;
|
|
1939
1940
|
}
|
|
@@ -1987,7 +1988,7 @@ class se {
|
|
|
1987
1988
|
return this.api.get(`/memory/reasoning/traces/${e}`);
|
|
1988
1989
|
}
|
|
1989
1990
|
}
|
|
1990
|
-
class
|
|
1991
|
+
class ie {
|
|
1991
1992
|
constructor(e) {
|
|
1992
1993
|
this.api = e;
|
|
1993
1994
|
}
|
|
@@ -2391,8 +2392,8 @@ class re {
|
|
|
2391
2392
|
async listTypes({ tier: e, layer: t, packId: n, hasIri: s, kind: r, limit: i = 100, cursor: c } = {}) {
|
|
2392
2393
|
const o = { limit: String(i) };
|
|
2393
2394
|
e !== void 0 && (o.tier = e), t !== void 0 && (o.layer = t), n !== void 0 && (o.pack_id = n), s !== void 0 && (o.has_iri = String(s)), r !== void 0 && (o.kind = r), c !== void 0 && (o.cursor = c);
|
|
2394
|
-
const
|
|
2395
|
-
return this.api.get(`/memory/ontology/types${
|
|
2395
|
+
const h = new URLSearchParams(o).toString();
|
|
2396
|
+
return this.api.get(`/memory/ontology/types${h ? "?" + h : ""}`);
|
|
2396
2397
|
}
|
|
2397
2398
|
/**
|
|
2398
2399
|
* Declare an ontology class (CORE-MEMTYPE-DECLARE-1).
|
|
@@ -2431,16 +2432,16 @@ class re {
|
|
|
2431
2432
|
storageSearchable: i,
|
|
2432
2433
|
iri: c,
|
|
2433
2434
|
wikidataQid: o,
|
|
2434
|
-
displayName:
|
|
2435
|
-
definition:
|
|
2436
|
-
description:
|
|
2437
|
-
aliases:
|
|
2438
|
-
examples:
|
|
2439
|
-
parentTypes:
|
|
2440
|
-
tier:
|
|
2435
|
+
displayName: h,
|
|
2436
|
+
definition: y,
|
|
2437
|
+
description: p,
|
|
2438
|
+
aliases: d,
|
|
2439
|
+
examples: _,
|
|
2440
|
+
parentTypes: $,
|
|
2441
|
+
tier: g = "confirmed"
|
|
2441
2442
|
} = {}) {
|
|
2442
|
-
const l = { name: e, kind: t, tier:
|
|
2443
|
-
return n !== void 0 && (l.properties_schema = n), s !== void 0 && (l.required_properties = s), r !== void 0 && (l.storage_strategy = r), i !== void 0 && (l.storage_searchable = i), c !== void 0 && (l.iri = c), o !== void 0 && (l.wikidata_qid = o),
|
|
2443
|
+
const l = { name: e, kind: t, tier: g };
|
|
2444
|
+
return n !== void 0 && (l.properties_schema = n), s !== void 0 && (l.required_properties = s), r !== void 0 && (l.storage_strategy = r), i !== void 0 && (l.storage_searchable = i), c !== void 0 && (l.iri = c), o !== void 0 && (l.wikidata_qid = o), h !== void 0 && (l.display_name = h), y !== void 0 && (l.definition = y), p !== void 0 && (l.description = p), d !== void 0 && (l.aliases = d), _ !== void 0 && (l.examples = _), $ !== void 0 && (l.parent_types = $), this.api.post("/memory/ontology/types", l);
|
|
2444
2445
|
}
|
|
2445
2446
|
/**
|
|
2446
2447
|
* Declare an ontology relation (CORE-MEMTYPE-DECLARE-1; declare-only in P1).
|
|
@@ -2477,20 +2478,20 @@ class re {
|
|
|
2477
2478
|
temporal: i,
|
|
2478
2479
|
propertiesSchema: c,
|
|
2479
2480
|
transitive: o,
|
|
2480
|
-
symmetric:
|
|
2481
|
-
reflexive:
|
|
2482
|
-
parentRelations:
|
|
2483
|
-
iri:
|
|
2484
|
-
wikidataPid:
|
|
2485
|
-
displayName:
|
|
2486
|
-
definition:
|
|
2481
|
+
symmetric: h,
|
|
2482
|
+
reflexive: y,
|
|
2483
|
+
parentRelations: p,
|
|
2484
|
+
iri: d,
|
|
2485
|
+
wikidataPid: _,
|
|
2486
|
+
displayName: $,
|
|
2487
|
+
definition: g,
|
|
2487
2488
|
description: l,
|
|
2488
|
-
aliases:
|
|
2489
|
-
examples:
|
|
2490
|
-
tier:
|
|
2489
|
+
aliases: b,
|
|
2490
|
+
examples: I,
|
|
2491
|
+
tier: v = "confirmed"
|
|
2491
2492
|
} = {}) {
|
|
2492
|
-
const u = { name: e, tier:
|
|
2493
|
-
return t !== void 0 && (u.domain = t), n !== void 0 && (u.range = n), s !== void 0 && (u.inverse_of = s), r !== void 0 && (u.cardinality = r), i !== void 0 && (u.temporal = i), c !== void 0 && (u.properties_schema = c), o !== void 0 && (u.transitive = o),
|
|
2493
|
+
const u = { name: e, tier: v };
|
|
2494
|
+
return t !== void 0 && (u.domain = t), n !== void 0 && (u.range = n), s !== void 0 && (u.inverse_of = s), r !== void 0 && (u.cardinality = r), i !== void 0 && (u.temporal = i), c !== void 0 && (u.properties_schema = c), o !== void 0 && (u.transitive = o), h !== void 0 && (u.symmetric = h), y !== void 0 && (u.reflexive = y), p !== void 0 && (u.parent_relations = p), d !== void 0 && (u.iri = d), _ !== void 0 && (u.wikidata_pid = _), $ !== void 0 && (u.display_name = $), g !== void 0 && (u.definition = g), l !== void 0 && (u.description = l), b !== void 0 && (u.aliases = b), I !== void 0 && (u.examples = I), this.api.post("/memory/ontology/relations", u);
|
|
2494
2495
|
}
|
|
2495
2496
|
/**
|
|
2496
2497
|
* List ontology relation types, keyset-paginated. Mirror of `listTypes`.
|
|
@@ -2677,7 +2678,7 @@ class re {
|
|
|
2677
2678
|
return s !== void 0 && (r.expected_tier = s), this.api.post("/memory/ontology/queue/bulk", r);
|
|
2678
2679
|
}
|
|
2679
2680
|
}
|
|
2680
|
-
class
|
|
2681
|
+
class ae {
|
|
2681
2682
|
constructor(e) {
|
|
2682
2683
|
this.api = e;
|
|
2683
2684
|
}
|
|
@@ -2706,7 +2707,7 @@ class ie {
|
|
|
2706
2707
|
return e !== null && (s.protected_attributes = e), t !== null && (s.sentiment_analysis = t), n !== null && (s.topic_analysis = n), this.api.post("/memory/analytics/bias", s);
|
|
2707
2708
|
}
|
|
2708
2709
|
}
|
|
2709
|
-
class
|
|
2710
|
+
class oe {
|
|
2710
2711
|
constructor(e) {
|
|
2711
2712
|
this.api = e;
|
|
2712
2713
|
}
|
|
@@ -2742,7 +2743,7 @@ class ae {
|
|
|
2742
2743
|
return this.api.get("/memory/inference/rules");
|
|
2743
2744
|
}
|
|
2744
2745
|
}
|
|
2745
|
-
class
|
|
2746
|
+
class ce {
|
|
2746
2747
|
constructor(e) {
|
|
2747
2748
|
this.api = e;
|
|
2748
2749
|
}
|
|
@@ -2858,7 +2859,7 @@ class oe {
|
|
|
2858
2859
|
return this.api.delete(`/memory/pipeline/configs/${e}`);
|
|
2859
2860
|
}
|
|
2860
2861
|
}
|
|
2861
|
-
class
|
|
2862
|
+
class ue {
|
|
2862
2863
|
constructor(e) {
|
|
2863
2864
|
this.api = e;
|
|
2864
2865
|
}
|
|
@@ -2884,7 +2885,7 @@ class ce {
|
|
|
2884
2885
|
return this.api.get(`/memory/archive/${e}`);
|
|
2885
2886
|
}
|
|
2886
2887
|
}
|
|
2887
|
-
class
|
|
2888
|
+
class le {
|
|
2888
2889
|
constructor(e) {
|
|
2889
2890
|
this.api = e;
|
|
2890
2891
|
}
|
|
@@ -3043,7 +3044,7 @@ class ue {
|
|
|
3043
3044
|
return this.api.get(`/memory/zettel/by-relation/${e}/${t}?limit=${n}`);
|
|
3044
3045
|
}
|
|
3045
3046
|
}
|
|
3046
|
-
class
|
|
3047
|
+
class me {
|
|
3047
3048
|
constructor(e) {
|
|
3048
3049
|
this.api = e;
|
|
3049
3050
|
}
|
|
@@ -3079,7 +3080,7 @@ class le {
|
|
|
3079
3080
|
return this.api.get("/memory/procedures/matches/stats");
|
|
3080
3081
|
}
|
|
3081
3082
|
}
|
|
3082
|
-
class
|
|
3083
|
+
class he {
|
|
3083
3084
|
constructor(e) {
|
|
3084
3085
|
this.api = e;
|
|
3085
3086
|
}
|
|
@@ -3128,7 +3129,7 @@ class me {
|
|
|
3128
3129
|
return this.api.delete(`/memory/procedures/candidates/${e}/dismiss`);
|
|
3129
3130
|
}
|
|
3130
3131
|
}
|
|
3131
|
-
class
|
|
3132
|
+
class ye {
|
|
3132
3133
|
constructor(e) {
|
|
3133
3134
|
this.api = e;
|
|
3134
3135
|
}
|
|
@@ -3183,7 +3184,7 @@ class he {
|
|
|
3183
3184
|
return this.api.get(`/memory/procedures/schemas/${e}`);
|
|
3184
3185
|
}
|
|
3185
3186
|
}
|
|
3186
|
-
class
|
|
3187
|
+
class pe {
|
|
3187
3188
|
constructor(e) {
|
|
3188
3189
|
this.api = e;
|
|
3189
3190
|
}
|
|
@@ -3255,7 +3256,7 @@ class ye {
|
|
|
3255
3256
|
return this.api.delete(`/memory/summary/${e}`);
|
|
3256
3257
|
}
|
|
3257
3258
|
}
|
|
3258
|
-
class
|
|
3259
|
+
class de {
|
|
3259
3260
|
constructor(e) {
|
|
3260
3261
|
this.api = e;
|
|
3261
3262
|
}
|
|
@@ -3319,7 +3320,7 @@ class pe {
|
|
|
3319
3320
|
}
|
|
3320
3321
|
}
|
|
3321
3322
|
}
|
|
3322
|
-
class
|
|
3323
|
+
class ge {
|
|
3323
3324
|
constructor(e) {
|
|
3324
3325
|
this.api = e;
|
|
3325
3326
|
}
|
|
@@ -3363,7 +3364,7 @@ class de {
|
|
|
3363
3364
|
}
|
|
3364
3365
|
}
|
|
3365
3366
|
}
|
|
3366
|
-
class
|
|
3367
|
+
class fe {
|
|
3367
3368
|
constructor(e) {
|
|
3368
3369
|
this.api = e;
|
|
3369
3370
|
}
|
|
@@ -3400,7 +3401,7 @@ class ge {
|
|
|
3400
3401
|
}))), s != null && (r.preset = s), this.api.post("/memory/recall/pack", r);
|
|
3401
3402
|
}
|
|
3402
3403
|
}
|
|
3403
|
-
class
|
|
3404
|
+
class _e {
|
|
3404
3405
|
constructor(e) {
|
|
3405
3406
|
this.api = e;
|
|
3406
3407
|
}
|
|
@@ -3429,11 +3430,11 @@ class fe {
|
|
|
3429
3430
|
return this.api.post("/memory/policy/events", e);
|
|
3430
3431
|
}
|
|
3431
3432
|
}
|
|
3432
|
-
class
|
|
3433
|
+
class ke {
|
|
3433
3434
|
constructor(e) {
|
|
3434
|
-
this.auth = new
|
|
3435
|
-
const t = new
|
|
3436
|
-
this._api = t, this.memories = new
|
|
3435
|
+
this.auth = new j(e);
|
|
3436
|
+
const t = new B(this.auth, { fetchFn: e.fetchFn });
|
|
3437
|
+
this._api = t, this.memories = new H(t), this.decisions = new K(t), this.opinions = new G(t), this.graph = new D(t), this.teams = new N(t), this.profiles = new J(t), this.subscriptions = new W(t), this.authAPI = new V(t), this.agents = new Y(t), this.usage = new X(t), this.insights = new Z(t), this.tokenUsage = new Q(t), this.temporal = new ee(t), this.governance = new te(t), this.evolution = new ne(t), this.reasoning = new se(t), this.reasoningTraces = new re(t), this.ontology = new ie(t), this.analytics = new ae(t), this.validation = new oe(t), this.pipeline = new ce(t), this.archive = new ue(t), this.zettelkasten = new le(t), this.procedureMatches = new me(t), this.procedureCandidates = new he(t), this.procedureDrift = new ye(t), this.summaries = new pe(t), this.locks = new de(t), this.sequences = new ge(t), this.recall = new fe(t), this.policy = new _e(t);
|
|
3437
3438
|
}
|
|
3438
3439
|
setTeamId(e) {
|
|
3439
3440
|
this.auth.tokenManager.setTeamId(e), this.auth.notifyListeners();
|
|
@@ -3459,38 +3460,38 @@ class $e {
|
|
|
3459
3460
|
}
|
|
3460
3461
|
}
|
|
3461
3462
|
export {
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3463
|
+
k as A,
|
|
3464
|
+
B,
|
|
3465
|
+
K as D,
|
|
3466
|
+
ne as E,
|
|
3467
|
+
te as G,
|
|
3468
|
+
Z as I,
|
|
3469
|
+
de as L,
|
|
3470
|
+
H as M,
|
|
3471
|
+
ie as O,
|
|
3472
|
+
ce as P,
|
|
3473
|
+
se as R,
|
|
3474
|
+
ge as S,
|
|
3475
|
+
N as T,
|
|
3476
|
+
X as U,
|
|
3477
|
+
oe as V,
|
|
3478
|
+
le as Z,
|
|
3479
|
+
Y as a,
|
|
3480
|
+
ae as b,
|
|
3481
|
+
ue as c,
|
|
3482
|
+
V as d,
|
|
3483
|
+
j as e,
|
|
3484
|
+
D as f,
|
|
3485
|
+
G as g,
|
|
3486
|
+
he as h,
|
|
3487
|
+
me as i,
|
|
3488
|
+
J as j,
|
|
3489
|
+
re as k,
|
|
3490
|
+
ke as l,
|
|
3491
|
+
W as m,
|
|
3492
|
+
ee as n,
|
|
3493
|
+
z as o,
|
|
3494
|
+
Q as p,
|
|
3495
|
+
F as q,
|
|
3496
|
+
O as r
|
|
3496
3497
|
};
|
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 o, f as n, I as t, M as g, O as i, j as m, q as M, r as h, l as f, m as l, T as S, o as p, U as u } from "./core-
|
|
1
|
+
import { A as e, a as r, d as A, e as I, B as P, D as o, f as n, I as t, M as g, O as i, j as m, q as M, r as h, l as f, m as l, T as S, o as p, U as u } from "./core-D8pAeiLz.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 P, d as b, e as h, D as I, E as g, G as x, f as p, I as w, L as m, M as k, O as v, g as T, P as B, h as y, i as C, j as S, R as E, k as R, S as F, l as L, m as M, T as O, n as G, o as U, p as $, U as D, V, Z } from "./core-
|
|
1
|
+
import { A as f, a as u, b as A, c as P, d as b, e as h, D as I, E as g, G as x, f as p, I as w, L as m, M as k, O as v, g as T, P as B, h as y, i as C, j as S, R as E, k as R, S as F, l as L, m as M, T as O, n as G, o as U, p as $, U as D, V, Z } from "./core-D8pAeiLz.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 S, useState as p, useEffect as C, useCallback as c, useContext as g } from "react";
|
|
2
|
-
import { l as y } from "./core-
|
|
2
|
+
import { l as y } from "./core-D8pAeiLz.js";
|
|
3
3
|
const m = d(null), f = d(null);
|
|
4
4
|
function b({ children: e, ...r }) {
|
|
5
5
|
const n = S(null);
|