@smartmemory/sdk-js 1.4.93 → 1.4.100
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/README.md +8 -0
- package/dist/{core-D8pAeiLz.js → core-McKeQ81o.js} +274 -208
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -329,3 +329,11 @@ MIT
|
|
|
329
329
|
## Documentation
|
|
330
330
|
|
|
331
331
|
Full SmartMemory documentation: https://docs.smartmemory.ai
|
|
332
|
+
|
|
333
|
+
## Lexical search migration
|
|
334
|
+
|
|
335
|
+
Search uses `lexical` with default weight 0.8. Replace removed `contains` and `keyword-bm25` channel weights explicitly. A zero weight disables lexical, and omission preserves the existing default/profile behavior. Required lexical unavailability fails the whole search. Service callers receive 400 for query/name validation and 503 for unavailable indexes.
|
|
336
|
+
|
|
337
|
+
Use `memory.search(query, {channelWeights: {lexical: 0}})`. The optional JS property forwards `channel_weights` without a REST signature change.
|
|
338
|
+
|
|
339
|
+
Quiesce old writers before first-open indexing. Verify the engine capability pin and use `sm rebuild --lexical` for recovery. [Migration, targets and measured limitations](https://github.com/smart-memory/smart-memory-docs/blob/main/docs/features/CORE-LEXICAL-INDEX-1/migration.md).
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var M = (o) => {
|
|
2
|
+
throw TypeError(o);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
const
|
|
4
|
+
var P = (o, e, t) => e.has(o) || M("Cannot " + t);
|
|
5
|
+
var v = (o, e, t) => (P(o, e, "read from private field"), t ? t.call(o) : e.get(o)), q = (o, e, t) => e.has(o) ? M("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), L = (o, e, t, n) => (P(o, e, "write to private field"), n ? n.call(o, t) : e.set(o, t), t), z = (o, e, t) => (P(o, e, "access private method"), t);
|
|
6
|
+
const H = {
|
|
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
|
+
}, b = {
|
|
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 K {
|
|
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 = { ...H, ...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, b.access);
|
|
30
30
|
}
|
|
31
31
|
setAccessToken(e) {
|
|
32
32
|
if (this.storageType === "memory") {
|
|
@@ -36,7 +36,7 @@ class z {
|
|
|
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, b.refresh);
|
|
40
40
|
}
|
|
41
41
|
setRefreshToken(e) {
|
|
42
42
|
if (this.storageType === "memory") {
|
|
@@ -47,7 +47,7 @@ class z {
|
|
|
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, b.user);
|
|
51
51
|
if (!e) return null;
|
|
52
52
|
try {
|
|
53
53
|
return JSON.parse(e);
|
|
@@ -63,7 +63,7 @@ class z {
|
|
|
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, b.tenant));
|
|
67
67
|
}
|
|
68
68
|
setTenantId(e) {
|
|
69
69
|
const t = this._normalizeId(e);
|
|
@@ -74,7 +74,7 @@ class z {
|
|
|
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, b.team));
|
|
78
78
|
}
|
|
79
79
|
setTeamId(e) {
|
|
80
80
|
const t = this._normalizeId(e);
|
|
@@ -94,7 +94,7 @@ class z {
|
|
|
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(b))
|
|
98
98
|
for (const t of e)
|
|
99
99
|
try {
|
|
100
100
|
localStorage.removeItem(t), sessionStorage.removeItem(t);
|
|
@@ -115,14 +115,14 @@ class z {
|
|
|
115
115
|
const n = this.storageType === "localStorage" ? localStorage : sessionStorage, s = this.storageType === "localStorage" ? sessionStorage : localStorage, r = n.getItem(e) || s.getItem(e);
|
|
116
116
|
if (r != null) return r;
|
|
117
117
|
for (const i of t) {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
-
this._setInStorage(e,
|
|
118
|
+
const a = n.getItem(i) || s.getItem(i);
|
|
119
|
+
if (a != null) {
|
|
120
|
+
this._setInStorage(e, a);
|
|
121
121
|
try {
|
|
122
122
|
n.removeItem(i), s.removeItem(i);
|
|
123
123
|
} catch {
|
|
124
124
|
}
|
|
125
|
-
return
|
|
125
|
+
return a;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
return null;
|
|
@@ -148,8 +148,8 @@ class z {
|
|
|
148
148
|
return n === "none" || n === "null" || n === "undefined" ? null : t;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
class
|
|
151
|
+
var _, A, j;
|
|
152
|
+
class D {
|
|
153
153
|
/**
|
|
154
154
|
* @param {Object} options
|
|
155
155
|
* @param {string} options.apiBaseUrl
|
|
@@ -160,22 +160,22 @@ class F {
|
|
|
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
|
+
q(this, A);
|
|
164
|
+
q(this, _, 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 (v(this, _))
|
|
169
|
+
return v(this, _);
|
|
170
|
+
L(this, _, z(this, A, j).call(this));
|
|
171
171
|
try {
|
|
172
|
-
return await
|
|
172
|
+
return await v(this, _);
|
|
173
173
|
} finally {
|
|
174
|
-
|
|
174
|
+
L(this, _, null);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
_ = new WeakMap(), A = new WeakSet(), j = 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 @@ f = new WeakMap(), U = new WeakSet(), M = 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 E = "smart_memory_sso_redirect";
|
|
194
|
+
class G {
|
|
195
195
|
/**
|
|
196
196
|
* @param {Object} options
|
|
197
197
|
* @param {string} options.webAppUrl - Web app URL for login redirect
|
|
@@ -216,26 +216,26 @@ class O {
|
|
|
216
216
|
}
|
|
217
217
|
storeRedirect(e) {
|
|
218
218
|
try {
|
|
219
|
-
sessionStorage.setItem(
|
|
219
|
+
sessionStorage.setItem(E, 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(E);
|
|
227
|
+
return sessionStorage.removeItem(E), e;
|
|
228
228
|
} catch {
|
|
229
229
|
return null;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class N {
|
|
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 K({
|
|
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 D({
|
|
239
239
|
apiBaseUrl: this.apiBaseUrl,
|
|
240
240
|
refreshEndpoint: this.endpoints.refresh || "/auth/refresh",
|
|
241
241
|
tokenManager: this.tokenManager,
|
|
@@ -247,7 +247,7 @@ class j {
|
|
|
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 G({
|
|
251
251
|
webAppUrl: e.webAppUrl,
|
|
252
252
|
allowedHosts: e.allowedRedirectHosts || [],
|
|
253
253
|
tokenManager: this.tokenManager
|
|
@@ -367,7 +367,7 @@ class j {
|
|
|
367
367
|
this.tokenManager.setTenantId(e), this.notifyListeners();
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
class
|
|
370
|
+
class w 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 k extends Error {
|
|
|
377
377
|
super(e), this.name = "APIError", this.status = t, this.detail = n;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
return typeof FormData < "u" &&
|
|
380
|
+
function U(o) {
|
|
381
|
+
return typeof FormData < "u" && o instanceof FormData;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return (
|
|
383
|
+
function O(o) {
|
|
384
|
+
return (o == null ? void 0 : o.name) === "AbortError";
|
|
385
385
|
}
|
|
386
|
-
class
|
|
386
|
+
class J {
|
|
387
387
|
/**
|
|
388
388
|
* @param {import('../auth/AuthCore.js').AuthCore} authCore
|
|
389
389
|
* @param {{ fetchFn?: typeof globalThis.fetch }} [options]
|
|
@@ -405,35 +405,35 @@ class B {
|
|
|
405
405
|
* @param {RequestInit & { signal?: AbortSignal }} [options]
|
|
406
406
|
*/
|
|
407
407
|
async request(e, t = {}) {
|
|
408
|
-
var i,
|
|
408
|
+
var i, a;
|
|
409
409
|
const n = `${this.baseURL}${e}`, s = {
|
|
410
|
-
...
|
|
410
|
+
...U(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 {
|
|
414
|
-
let
|
|
415
|
-
if (
|
|
414
|
+
let c = await this.fetchFn(n, r);
|
|
415
|
+
if (c.status === 401 && !t.__isRetry)
|
|
416
416
|
try {
|
|
417
417
|
await this.auth.refreshToken();
|
|
418
|
-
const
|
|
419
|
-
...
|
|
418
|
+
const u = {
|
|
419
|
+
...U(t.body) ? {} : { "Content-Type": "application/json" },
|
|
420
420
|
...this.auth.getAuthHeaders(t.headers)
|
|
421
421
|
};
|
|
422
|
-
|
|
422
|
+
c = await this.fetchFn(
|
|
423
423
|
n,
|
|
424
|
-
this.auth.getRequestOptions({ ...r, headers:
|
|
424
|
+
this.auth.getRequestOptions({ ...r, headers: u, __isRetry: !0 })
|
|
425
425
|
);
|
|
426
426
|
} catch {
|
|
427
427
|
}
|
|
428
|
-
if (
|
|
429
|
-
throw (
|
|
430
|
-
if (
|
|
428
|
+
if (c.status === 401)
|
|
429
|
+
throw (a = (i = this.auth).clearLocalAuth) == null || a.call(i), new w("Authentication required", 401, "auth_expired");
|
|
430
|
+
if (c.status === 204)
|
|
431
431
|
return null;
|
|
432
|
-
if (!
|
|
433
|
-
throw await this._handleError(
|
|
434
|
-
return await
|
|
435
|
-
} catch (
|
|
436
|
-
throw
|
|
432
|
+
if (!c.ok)
|
|
433
|
+
throw await this._handleError(c);
|
|
434
|
+
return await c.json();
|
|
435
|
+
} catch (c) {
|
|
436
|
+
throw c instanceof w || O(c) ? c : new w(c.message, 0, "network_error");
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
async get(e, t = {}) {
|
|
@@ -447,33 +447,33 @@ class B {
|
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
async requestBinary(e, t = {}) {
|
|
450
|
-
var i,
|
|
450
|
+
var i, a;
|
|
451
451
|
const n = `${this.baseURL}${e}`, s = {
|
|
452
|
-
...
|
|
452
|
+
...U(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 {
|
|
456
|
-
let
|
|
457
|
-
if (
|
|
456
|
+
let c = await this.fetchFn(n, r);
|
|
457
|
+
if (c.status === 401 && !t.__isRetry)
|
|
458
458
|
try {
|
|
459
459
|
await this.auth.refreshToken();
|
|
460
|
-
const
|
|
461
|
-
...
|
|
460
|
+
const u = {
|
|
461
|
+
...U(t.body) ? {} : { "Content-Type": "application/json" },
|
|
462
462
|
...this.auth.getAuthHeaders(t.headers)
|
|
463
463
|
};
|
|
464
|
-
|
|
464
|
+
c = await this.fetchFn(
|
|
465
465
|
n,
|
|
466
|
-
this.auth.getRequestOptions({ ...r, headers:
|
|
466
|
+
this.auth.getRequestOptions({ ...r, headers: u, __isRetry: !0 })
|
|
467
467
|
);
|
|
468
468
|
} catch {
|
|
469
469
|
}
|
|
470
|
-
if (
|
|
471
|
-
throw (
|
|
472
|
-
if (!
|
|
473
|
-
throw await this._handleError(
|
|
474
|
-
return await
|
|
475
|
-
} catch (
|
|
476
|
-
throw
|
|
470
|
+
if (c.status === 401)
|
|
471
|
+
throw (a = (i = this.auth).clearLocalAuth) == null || a.call(i), new w("Authentication required", 401, "auth_expired");
|
|
472
|
+
if (!c.ok)
|
|
473
|
+
throw await this._handleError(c);
|
|
474
|
+
return await c.arrayBuffer();
|
|
475
|
+
} catch (c) {
|
|
476
|
+
throw c instanceof w || O(c) ? c : new w(c.message, 0, "network_error");
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
async postForm(e, t, n = {}) {
|
|
@@ -510,7 +510,7 @@ class B {
|
|
|
510
510
|
} catch {
|
|
511
511
|
t = { message: `HTTP ${e.status}` };
|
|
512
512
|
}
|
|
513
|
-
return new
|
|
513
|
+
return new w(
|
|
514
514
|
this._extractMessage(t, e.status),
|
|
515
515
|
e.status,
|
|
516
516
|
t
|
|
@@ -540,7 +540,7 @@ class B {
|
|
|
540
540
|
return typeof (e == null ? void 0 : e.message) == "string" ? e.message : `HTTP ${t}`;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
class
|
|
543
|
+
class V {
|
|
544
544
|
constructor(e) {
|
|
545
545
|
this.api = e;
|
|
546
546
|
}
|
|
@@ -571,16 +571,16 @@ class H {
|
|
|
571
571
|
usePipeline: s = !0,
|
|
572
572
|
profileName: r = null,
|
|
573
573
|
conversationContext: i = null,
|
|
574
|
-
embed:
|
|
574
|
+
embed: a = null
|
|
575
575
|
}) {
|
|
576
|
-
const
|
|
576
|
+
const c = {
|
|
577
577
|
content: e,
|
|
578
578
|
memory_type: t,
|
|
579
579
|
metadata: n,
|
|
580
580
|
use_pipeline: s,
|
|
581
581
|
profile_name: r
|
|
582
582
|
};
|
|
583
|
-
return i != null && (
|
|
583
|
+
return i != null && (c.conversation_context = i), a != null && (c.embed = a), this.api.post("/memory/add", c);
|
|
584
584
|
}
|
|
585
585
|
async get(e) {
|
|
586
586
|
const t = await this.api.get(`/memory/${encodeURIComponent(e)}`);
|
|
@@ -647,7 +647,9 @@ class H {
|
|
|
647
647
|
* on. Nested keys use dot syntax (`profile.tier`). Must be paired with `metadataValue`;
|
|
648
648
|
* sending only one half is a 422.
|
|
649
649
|
* @param {string|null} [options.metadataValue=null] - Value the key must equal.
|
|
650
|
-
* @
|
|
650
|
+
* @param {boolean|null} [options.includeGrounding=null] - Include grounding nodes.
|
|
651
|
+
* Omit to inherit workspace then env (default OFF); false is sent explicitly.
|
|
652
|
+
* @returns {Promise<{items: object[], total: number, limit: number, offset: number, policy: {include_grounding: boolean, source: string}}>}
|
|
651
653
|
* `total` counts the filtered set, so it drives pagination directly.
|
|
652
654
|
*/
|
|
653
655
|
async list({
|
|
@@ -655,10 +657,11 @@ class H {
|
|
|
655
657
|
offset: t = 0,
|
|
656
658
|
type: n = null,
|
|
657
659
|
metadataKey: s = null,
|
|
658
|
-
metadataValue: r = null
|
|
660
|
+
metadataValue: r = null,
|
|
661
|
+
includeGrounding: i = null
|
|
659
662
|
} = {}) {
|
|
660
|
-
const
|
|
661
|
-
return n != null &&
|
|
663
|
+
const a = new URLSearchParams({ limit: e, offset: t });
|
|
664
|
+
return n != null && a.append("memory_type", n), s != null && a.append("metadata_key", s), r != null && a.append("metadata_value", r), i != null && a.append("include_grounding", i), this.api.get(`/memory/list?${a}`);
|
|
662
665
|
}
|
|
663
666
|
/**
|
|
664
667
|
* Search for memory items.
|
|
@@ -705,7 +708,9 @@ class H {
|
|
|
705
708
|
* @param {boolean} [options.cite=false] - When true (RECALL-CITATIONS-1), the
|
|
706
709
|
* envelope gains a `citations` array of `{n, item_id, item_type, preview, score, footnote_marker}`.
|
|
707
710
|
* Empty `citations: []` when no results — distinguishes "no results" from "no citations requested".
|
|
708
|
-
* @returns {Promise<{results: Array|Object, group_roots: Object, citations?: Array}>}
|
|
711
|
+
* @returns {Promise<{results: Array|Object, group_roots: Object, citations?: Array, coverage?: {complete?: boolean, refill_rounds?: number, vector_scope_incomplete?: boolean, created_at_excluded_count?: number, created_at_backfilled_boundary?: string|null, note?: string}}>}
|
|
712
|
+
* `coverage.complete === false` means the server exhausted its candidate budget before
|
|
713
|
+
* filling `topK`; eligible items may exist beyond the returned page (CORE-RECALL-SEMANTICS-1).
|
|
709
714
|
* CORE-RECALL-LINEAGE-1: the response is ALWAYS a `SearchResponse` envelope —
|
|
710
715
|
* `results` is a flat array by default and a `{bucket: [...]}` map under
|
|
711
716
|
* `expertise: true`; `group_roots` is always present (possibly `{}`) and
|
|
@@ -718,9 +723,25 @@ class H {
|
|
|
718
723
|
* result marked `'unresolved'` is PRESENT-DAY content and must not be rendered
|
|
719
724
|
* as a historical belief.
|
|
720
725
|
*/
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
726
|
+
/**
|
|
727
|
+
* Each result carries RerankEvidence (including expertise buckets and citation modes).
|
|
728
|
+
* hopStrategy: consensus follows entities several top results agree on; relevance follows
|
|
729
|
+
* best-result entities and one-off bridges; semantic asks an LLM. Omitted preserves core default.
|
|
730
|
+
* since/until: ISO strings or Dates bounding created_at in [since, until), independent of asOfDate. */
|
|
731
|
+
async search(e, { topK: t = 5, enableHybrid: n = !0, memoryType: s = null, expertise: r = !1, cite: i = !1, decompose: a = !1, multiHop: c = !1, maxHops: u = 3, budgetMs: y = 1500, semanticHops: p = !1, includeReference: d = !1, includeConsolidated: $ = !1, consolidationFirst: k = !1, asOfDate: g = null, asOfStrict: h = !1, includeSuperseded: I = !1, includeRetracted: R = !1, includeArchived: T = !1, excludeSpeculative: m = !1, since: F = null, until: B = null, hopStrategy: x = null, channelWeights: C = null } = {}) {
|
|
732
|
+
const l = { query: e, top_k: t, enable_hybrid: n };
|
|
733
|
+
if (C != null) {
|
|
734
|
+
const S = /* @__PURE__ */ new Set(["entity-graph", "ssg-traversal", "semantic", "regex-text", "lexical", "spreading-activation", "facts", "structural-semantic"]);
|
|
735
|
+
for (const f of Object.keys(C)) {
|
|
736
|
+
if (["contains", "keyword-bm25"].includes(f))
|
|
737
|
+
throw new Error(`Channel ${f} was removed; use lexical.`);
|
|
738
|
+
if (!S.has(f)) throw new Error(`Unknown search channel ${f}. Accepted: ${[...S].join(", ")}`);
|
|
739
|
+
}
|
|
740
|
+
l.channel_weights = C;
|
|
741
|
+
}
|
|
742
|
+
for (const [S, f] of Object.entries({ since: F, until: B }))
|
|
743
|
+
f != null && (l[S] = f instanceof Date ? f.toISOString() : f);
|
|
744
|
+
return s && (l.memory_type = s), r && (l.expertise = !0), i && (l.cite = !0), a && (l.decompose = !0), x != null && (l.hop_strategy = x), c && (l.multi_hop = !0), c && u !== 3 && (l.max_hops = u), c && y !== 1500 && (l.budget_ms = y), c && p && (l.semantic_hops = !0), d && (l.include_reference = !0), $ && (l.include_consolidated = !0), k && (l.consolidation_first = !0), g && (l.as_of_date = g instanceof Date ? g.toISOString() : g), h && (l.as_of_strict = !0), I && (l.include_superseded = !0), R && (l.include_retracted = !0), T && (l.include_archived = !0), m && (l.exclude_speculative = !0), this.api.post("/memory/search", l);
|
|
724
745
|
}
|
|
725
746
|
/**
|
|
726
747
|
* Ask a question and get a written answer plus the evidence behind it (DIST-LITE-9).
|
|
@@ -804,13 +825,15 @@ class H {
|
|
|
804
825
|
* endpoints return slightly different item shapes, so migrate deliberately rather
|
|
805
826
|
* than by find-and-replace.
|
|
806
827
|
*/
|
|
807
|
-
async searchByMetadata(e, t, { memoryType: n = null, limit: s = 25 } = {}) {
|
|
808
|
-
const
|
|
828
|
+
async searchByMetadata(e, t, { memoryType: n = null, limit: s = 25, since: r = null, until: i = null } = {}) {
|
|
829
|
+
const a = new URLSearchParams({
|
|
809
830
|
metadata_key: e,
|
|
810
831
|
metadata_value: t,
|
|
811
832
|
limit: s
|
|
812
833
|
});
|
|
813
|
-
|
|
834
|
+
for (const [c, u] of Object.entries({ since: r, until: i }))
|
|
835
|
+
u != null && a.append(c, u instanceof Date ? u.toISOString() : u);
|
|
836
|
+
return n && a.append("memory_type", n), this.api.get(`/memory/by-metadata?${a}`);
|
|
814
837
|
}
|
|
815
838
|
async getNeighbors(e) {
|
|
816
839
|
return this.api.get(`/memory/${encodeURIComponent(e)}/neighbors`);
|
|
@@ -824,14 +847,15 @@ class H {
|
|
|
824
847
|
sessionDates: s = null,
|
|
825
848
|
turnsPerChunk: r = 15,
|
|
826
849
|
maxChunkChars: i = 12e3,
|
|
827
|
-
maxConcurrent:
|
|
850
|
+
maxConcurrent: a = 4,
|
|
851
|
+
context: c = null
|
|
828
852
|
} = {}) {
|
|
829
|
-
const
|
|
830
|
-
return t && (
|
|
853
|
+
const u = { turns: e, turns_per_chunk: r, max_chunk_chars: i, max_concurrent: a };
|
|
854
|
+
return t && (u.session_boundaries = t), n && (u.conversation_id = n), s && (u.session_dates = s), c !== null && (u.context = c), this.api.post("/memory/ingest/conversation", u);
|
|
831
855
|
}
|
|
832
|
-
async ingestDocument(e, { title: t = null, source: n = null, chunkStrategy: s = null } = {}) {
|
|
833
|
-
const
|
|
834
|
-
return t && (
|
|
856
|
+
async ingestDocument(e, { title: t = null, source: n = null, chunkStrategy: s = null, context: r = null } = {}) {
|
|
857
|
+
const i = { content: e };
|
|
858
|
+
return t && (i.title = t), n && (i.source = n), s && (i.chunk_strategy = s), r !== null && (i.context = r), this.api.post("/memory/ingest/document", i);
|
|
835
859
|
}
|
|
836
860
|
/**
|
|
837
861
|
* Import a ChatGPT or Claude conversation export (DIST-CHAT-IMPORT-1).
|
|
@@ -905,6 +929,12 @@ class H {
|
|
|
905
929
|
routines: t
|
|
906
930
|
});
|
|
907
931
|
}
|
|
932
|
+
/**
|
|
933
|
+
* Request personalization.
|
|
934
|
+
*
|
|
935
|
+
* The endpoint currently returns HTTP 501 because
|
|
936
|
+
* CORE-PERSONALIZATION-CONTRACT-1 is not implemented.
|
|
937
|
+
*/
|
|
908
938
|
async personalize(e = {}, t = {}) {
|
|
909
939
|
return this.api.post("/memory/personalize", { traits: e, preferences: t });
|
|
910
940
|
}
|
|
@@ -924,6 +954,12 @@ class H {
|
|
|
924
954
|
const s = { item_ids: e, outcome: t };
|
|
925
955
|
return n != null && (s.query = n), this.api.post("/memory/feedback", s);
|
|
926
956
|
}
|
|
957
|
+
/**
|
|
958
|
+
* Request grounding for a memory item.
|
|
959
|
+
*
|
|
960
|
+
* The endpoint currently returns HTTP 501 because
|
|
961
|
+
* CORE-GROUND-ROUTE-CONTRACT-1 is not implemented.
|
|
962
|
+
*/
|
|
927
963
|
async ground(e, t, n = null) {
|
|
928
964
|
return this.api.post(`/memory/${encodeURIComponent(e)}/ground`, {
|
|
929
965
|
item_id: e,
|
|
@@ -967,7 +1003,7 @@ class H {
|
|
|
967
1003
|
return this.api.get("/memory/clustering/stats");
|
|
968
1004
|
}
|
|
969
1005
|
}
|
|
970
|
-
class
|
|
1006
|
+
class W {
|
|
971
1007
|
constructor(e) {
|
|
972
1008
|
this.api = e;
|
|
973
1009
|
}
|
|
@@ -993,9 +1029,9 @@ class K {
|
|
|
993
1029
|
sourceTraceId: s = null,
|
|
994
1030
|
sourceSessionId: r = null,
|
|
995
1031
|
evidenceIds: i = null,
|
|
996
|
-
domain:
|
|
997
|
-
tags:
|
|
998
|
-
rejectedAlternatives:
|
|
1032
|
+
domain: a = null,
|
|
1033
|
+
tags: c = null,
|
|
1034
|
+
rejectedAlternatives: u = null,
|
|
999
1035
|
rationale: y = null,
|
|
1000
1036
|
constraints: p = null,
|
|
1001
1037
|
agentId: d = null
|
|
@@ -1007,9 +1043,9 @@ class K {
|
|
|
1007
1043
|
source_trace_id: s,
|
|
1008
1044
|
source_session_id: r,
|
|
1009
1045
|
evidence_ids: i,
|
|
1010
|
-
domain:
|
|
1011
|
-
tags:
|
|
1012
|
-
rejected_alternatives:
|
|
1046
|
+
domain: a,
|
|
1047
|
+
tags: c,
|
|
1048
|
+
rejected_alternatives: u,
|
|
1013
1049
|
rationale: y,
|
|
1014
1050
|
constraints: p,
|
|
1015
1051
|
agent_id: d
|
|
@@ -1029,6 +1065,15 @@ class K {
|
|
|
1029
1065
|
* provenance subgraph contains this memory id. Filters compose in-query so
|
|
1030
1066
|
* the response never silently truncates below `limit` when more matches exist.
|
|
1031
1067
|
* Unknown or out-of-scope memory ids return an empty list (never 404).
|
|
1068
|
+
*
|
|
1069
|
+
* Every returned decision carries three Dempster-Shafer belief reads derived from
|
|
1070
|
+
* its reinforce/contradict evidence (CORE-DECISION-BELIEF-SURFACE-1):
|
|
1071
|
+
* `belief_hold` (lower bound that the decision should stand), `plausibility_hold`
|
|
1072
|
+
* (upper bound), and `ignorance` (the width of that interval, so 1.0 means no
|
|
1073
|
+
* evidence has been recorded either way). They are evidence-only and independent of
|
|
1074
|
+
* the prior scalar `confidence`, and they separate "disputed" (high `contest`) from
|
|
1075
|
+
* "not yet known" (high `ignorance`) -- a distinction `stability` cannot express,
|
|
1076
|
+
* since it reads 0.5 for both.
|
|
1032
1077
|
*/
|
|
1033
1078
|
async list(e = {}) {
|
|
1034
1079
|
const t = new URLSearchParams(e).toString();
|
|
@@ -1038,6 +1083,15 @@ class K {
|
|
|
1038
1083
|
* Search for active decisions related to a topic.
|
|
1039
1084
|
* @param {string} topic
|
|
1040
1085
|
* @param {number} [limit=20]
|
|
1086
|
+
*
|
|
1087
|
+
* Every returned decision carries three Dempster-Shafer belief reads derived from
|
|
1088
|
+
* its reinforce/contradict evidence (CORE-DECISION-BELIEF-SURFACE-1):
|
|
1089
|
+
* `belief_hold` (lower bound that the decision should stand), `plausibility_hold`
|
|
1090
|
+
* (upper bound), and `ignorance` (the width of that interval, so 1.0 means no
|
|
1091
|
+
* evidence has been recorded either way). They are evidence-only and independent of
|
|
1092
|
+
* the prior scalar `confidence`, and they separate "disputed" (high `contest`) from
|
|
1093
|
+
* "not yet known" (high `ignorance`) -- a distinction `stability` cannot express,
|
|
1094
|
+
* since it reads 0.5 for both.
|
|
1041
1095
|
*/
|
|
1042
1096
|
async search(e, t = 20) {
|
|
1043
1097
|
return this.api.get(`/memory/decisions/search?topic=${encodeURIComponent(e)}&limit=${t}`);
|
|
@@ -1090,6 +1144,15 @@ class K {
|
|
|
1090
1144
|
/**
|
|
1091
1145
|
* Retrieve a decision by ID.
|
|
1092
1146
|
* @param {string} decisionId
|
|
1147
|
+
*
|
|
1148
|
+
* Every returned decision carries three Dempster-Shafer belief reads derived from
|
|
1149
|
+
* its reinforce/contradict evidence (CORE-DECISION-BELIEF-SURFACE-1):
|
|
1150
|
+
* `belief_hold` (lower bound that the decision should stand), `plausibility_hold`
|
|
1151
|
+
* (upper bound), and `ignorance` (the width of that interval, so 1.0 means no
|
|
1152
|
+
* evidence has been recorded either way). They are evidence-only and independent of
|
|
1153
|
+
* the prior scalar `confidence`, and they separate "disputed" (high `contest`) from
|
|
1154
|
+
* "not yet known" (high `ignorance`) -- a distinction `stability` cannot express,
|
|
1155
|
+
* since it reads 0.5 for both.
|
|
1093
1156
|
*/
|
|
1094
1157
|
async get(e) {
|
|
1095
1158
|
return this.api.get(`/memory/decisions/${e}`);
|
|
@@ -1102,6 +1165,9 @@ class K {
|
|
|
1102
1165
|
* @param {string} [data.new_decision_type='inference']
|
|
1103
1166
|
* @param {number} [data.new_confidence=0.8]
|
|
1104
1167
|
* @param {string} data.reason
|
|
1168
|
+
* @param {string[]|null} [data.rejected_alternatives=null]
|
|
1169
|
+
* @param {string|null} [data.rationale=null]
|
|
1170
|
+
* @param {string[]|null} [data.constraints=null]
|
|
1105
1171
|
*/
|
|
1106
1172
|
async supersede(e, t = {}) {
|
|
1107
1173
|
return this.api.post(`/memory/decisions/${e}/supersede`, t);
|
|
@@ -1185,7 +1251,7 @@ class K {
|
|
|
1185
1251
|
});
|
|
1186
1252
|
}
|
|
1187
1253
|
}
|
|
1188
|
-
class
|
|
1254
|
+
class Y {
|
|
1189
1255
|
constructor(e) {
|
|
1190
1256
|
this.api = e;
|
|
1191
1257
|
}
|
|
@@ -1207,7 +1273,7 @@ class G {
|
|
|
1207
1273
|
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);
|
|
1208
1274
|
}
|
|
1209
1275
|
}
|
|
1210
|
-
class
|
|
1276
|
+
class X {
|
|
1211
1277
|
constructor(e) {
|
|
1212
1278
|
this.api = e;
|
|
1213
1279
|
}
|
|
@@ -1356,7 +1422,7 @@ class D {
|
|
|
1356
1422
|
);
|
|
1357
1423
|
}
|
|
1358
1424
|
}
|
|
1359
|
-
class
|
|
1425
|
+
class Z {
|
|
1360
1426
|
constructor(e) {
|
|
1361
1427
|
this.api = e;
|
|
1362
1428
|
}
|
|
@@ -1398,7 +1464,7 @@ class N {
|
|
|
1398
1464
|
return this.api.delete(`/memory/teams/${e}/members/${t}`);
|
|
1399
1465
|
}
|
|
1400
1466
|
}
|
|
1401
|
-
class
|
|
1467
|
+
class Q {
|
|
1402
1468
|
constructor(e) {
|
|
1403
1469
|
this.api = e;
|
|
1404
1470
|
}
|
|
@@ -1420,7 +1486,7 @@ class J {
|
|
|
1420
1486
|
return this.api.patch("/auth/llm-keys", e);
|
|
1421
1487
|
}
|
|
1422
1488
|
}
|
|
1423
|
-
class
|
|
1489
|
+
class ee {
|
|
1424
1490
|
constructor(e) {
|
|
1425
1491
|
this.api = e;
|
|
1426
1492
|
}
|
|
@@ -1446,7 +1512,7 @@ class W {
|
|
|
1446
1512
|
});
|
|
1447
1513
|
}
|
|
1448
1514
|
}
|
|
1449
|
-
class
|
|
1515
|
+
class te {
|
|
1450
1516
|
constructor(e) {
|
|
1451
1517
|
this.api = e;
|
|
1452
1518
|
}
|
|
@@ -1467,7 +1533,7 @@ class V {
|
|
|
1467
1533
|
return this.api.delete(`/memory/api-keys/${e}`);
|
|
1468
1534
|
}
|
|
1469
1535
|
}
|
|
1470
|
-
class
|
|
1536
|
+
class ne {
|
|
1471
1537
|
constructor(e) {
|
|
1472
1538
|
this.api = e;
|
|
1473
1539
|
}
|
|
@@ -1526,7 +1592,7 @@ class Y {
|
|
|
1526
1592
|
return this.api.get(`/memory/agents/${e}/evaluation/history${r ? "?" + r : ""}`);
|
|
1527
1593
|
}
|
|
1528
1594
|
}
|
|
1529
|
-
class
|
|
1595
|
+
class se {
|
|
1530
1596
|
constructor(e) {
|
|
1531
1597
|
this.api = e;
|
|
1532
1598
|
}
|
|
@@ -1540,7 +1606,7 @@ class X {
|
|
|
1540
1606
|
return this.api.get("/usage/tiers");
|
|
1541
1607
|
}
|
|
1542
1608
|
}
|
|
1543
|
-
class
|
|
1609
|
+
class re {
|
|
1544
1610
|
constructor(e) {
|
|
1545
1611
|
this.api = e;
|
|
1546
1612
|
}
|
|
@@ -1557,7 +1623,7 @@ class Z {
|
|
|
1557
1623
|
return this.api.get("/memory/plugins");
|
|
1558
1624
|
}
|
|
1559
1625
|
}
|
|
1560
|
-
class
|
|
1626
|
+
class ie {
|
|
1561
1627
|
constructor(e) {
|
|
1562
1628
|
this.api = e;
|
|
1563
1629
|
}
|
|
@@ -1580,7 +1646,7 @@ class Q {
|
|
|
1580
1646
|
return this.api.get("/memory/token-usage/current");
|
|
1581
1647
|
}
|
|
1582
1648
|
}
|
|
1583
|
-
class
|
|
1649
|
+
class ae {
|
|
1584
1650
|
constructor(e) {
|
|
1585
1651
|
this.api = e;
|
|
1586
1652
|
}
|
|
@@ -1666,8 +1732,8 @@ class ee {
|
|
|
1666
1732
|
*/
|
|
1667
1733
|
async getAuditTrail(e, { changeType: t = null, userId: n = null, startTime: s = null, endTime: r = null } = {}) {
|
|
1668
1734
|
let i = `/memory/temporal/${e}/audit`;
|
|
1669
|
-
const
|
|
1670
|
-
return t &&
|
|
1735
|
+
const a = [];
|
|
1736
|
+
return t && a.push(`change_type=${t}`), n && a.push(`user_id=${n}`), s && a.push(`start_time=${s}`), r && a.push(`end_time=${r}`), a.length && (i += `?${a.join("&")}`), this.api.get(i);
|
|
1671
1737
|
}
|
|
1672
1738
|
// === TEMPORAL SEARCH ===
|
|
1673
1739
|
/**
|
|
@@ -1726,7 +1792,7 @@ class ee {
|
|
|
1726
1792
|
return this.api.get(`/memory/temporal/relationships/${e}/valid-periods`);
|
|
1727
1793
|
}
|
|
1728
1794
|
}
|
|
1729
|
-
class
|
|
1795
|
+
class oe {
|
|
1730
1796
|
constructor(e) {
|
|
1731
1797
|
this.api = e;
|
|
1732
1798
|
}
|
|
@@ -1795,7 +1861,7 @@ class te {
|
|
|
1795
1861
|
return this.api.get("/memory/governance/summary");
|
|
1796
1862
|
}
|
|
1797
1863
|
}
|
|
1798
|
-
class
|
|
1864
|
+
class ce {
|
|
1799
1865
|
constructor(e) {
|
|
1800
1866
|
this.api = e;
|
|
1801
1867
|
}
|
|
@@ -1836,7 +1902,7 @@ class ne {
|
|
|
1836
1902
|
return this.api.post("/memory/evolution/reinforce/opinions");
|
|
1837
1903
|
}
|
|
1838
1904
|
}
|
|
1839
|
-
class
|
|
1905
|
+
class ue {
|
|
1840
1906
|
constructor(e) {
|
|
1841
1907
|
this.api = e;
|
|
1842
1908
|
}
|
|
@@ -1934,7 +2000,7 @@ class se {
|
|
|
1934
2000
|
});
|
|
1935
2001
|
}
|
|
1936
2002
|
}
|
|
1937
|
-
class
|
|
2003
|
+
class le {
|
|
1938
2004
|
constructor(e) {
|
|
1939
2005
|
this.api = e;
|
|
1940
2006
|
}
|
|
@@ -1988,7 +2054,7 @@ class re {
|
|
|
1988
2054
|
return this.api.get(`/memory/reasoning/traces/${e}`);
|
|
1989
2055
|
}
|
|
1990
2056
|
}
|
|
1991
|
-
class
|
|
2057
|
+
class me {
|
|
1992
2058
|
constructor(e) {
|
|
1993
2059
|
this.api = e;
|
|
1994
2060
|
}
|
|
@@ -2389,11 +2455,11 @@ class ie {
|
|
|
2389
2455
|
* @param {number} [options.limit=100]
|
|
2390
2456
|
* @param {string} [options.cursor] opaque keyset continuation token
|
|
2391
2457
|
*/
|
|
2392
|
-
async listTypes({ tier: e, layer: t, packId: n, hasIri: s, kind: r, limit: i = 100, cursor:
|
|
2393
|
-
const
|
|
2394
|
-
e !== void 0 && (
|
|
2395
|
-
const
|
|
2396
|
-
return this.api.get(`/memory/ontology/types${
|
|
2458
|
+
async listTypes({ tier: e, layer: t, packId: n, hasIri: s, kind: r, limit: i = 100, cursor: a } = {}) {
|
|
2459
|
+
const c = { limit: String(i) };
|
|
2460
|
+
e !== void 0 && (c.tier = e), t !== void 0 && (c.layer = t), n !== void 0 && (c.pack_id = n), s !== void 0 && (c.has_iri = String(s)), r !== void 0 && (c.kind = r), a !== void 0 && (c.cursor = a);
|
|
2461
|
+
const u = new URLSearchParams(c).toString();
|
|
2462
|
+
return this.api.get(`/memory/ontology/types${u ? "?" + u : ""}`);
|
|
2397
2463
|
}
|
|
2398
2464
|
/**
|
|
2399
2465
|
* Declare an ontology class (CORE-MEMTYPE-DECLARE-1).
|
|
@@ -2430,18 +2496,18 @@ class ie {
|
|
|
2430
2496
|
requiredProperties: s,
|
|
2431
2497
|
storageStrategy: r,
|
|
2432
2498
|
storageSearchable: i,
|
|
2433
|
-
iri:
|
|
2434
|
-
wikidataQid:
|
|
2435
|
-
displayName:
|
|
2499
|
+
iri: a,
|
|
2500
|
+
wikidataQid: c,
|
|
2501
|
+
displayName: u,
|
|
2436
2502
|
definition: y,
|
|
2437
2503
|
description: p,
|
|
2438
2504
|
aliases: d,
|
|
2439
|
-
examples:
|
|
2440
|
-
parentTypes:
|
|
2505
|
+
examples: $,
|
|
2506
|
+
parentTypes: k,
|
|
2441
2507
|
tier: g = "confirmed"
|
|
2442
2508
|
} = {}) {
|
|
2443
|
-
const
|
|
2444
|
-
return n !== void 0 && (
|
|
2509
|
+
const h = { name: e, kind: t, tier: g };
|
|
2510
|
+
return n !== void 0 && (h.properties_schema = n), s !== void 0 && (h.required_properties = s), r !== void 0 && (h.storage_strategy = r), i !== void 0 && (h.storage_searchable = i), a !== void 0 && (h.iri = a), c !== void 0 && (h.wikidata_qid = c), u !== void 0 && (h.display_name = u), y !== void 0 && (h.definition = y), p !== void 0 && (h.description = p), d !== void 0 && (h.aliases = d), $ !== void 0 && (h.examples = $), k !== void 0 && (h.parent_types = k), this.api.post("/memory/ontology/types", h);
|
|
2445
2511
|
}
|
|
2446
2512
|
/**
|
|
2447
2513
|
* Declare an ontology relation (CORE-MEMTYPE-DECLARE-1; declare-only in P1).
|
|
@@ -2476,22 +2542,22 @@ class ie {
|
|
|
2476
2542
|
inverseOf: s,
|
|
2477
2543
|
cardinality: r,
|
|
2478
2544
|
temporal: i,
|
|
2479
|
-
propertiesSchema:
|
|
2480
|
-
transitive:
|
|
2481
|
-
symmetric:
|
|
2545
|
+
propertiesSchema: a,
|
|
2546
|
+
transitive: c,
|
|
2547
|
+
symmetric: u,
|
|
2482
2548
|
reflexive: y,
|
|
2483
2549
|
parentRelations: p,
|
|
2484
2550
|
iri: d,
|
|
2485
|
-
wikidataPid:
|
|
2486
|
-
displayName:
|
|
2551
|
+
wikidataPid: $,
|
|
2552
|
+
displayName: k,
|
|
2487
2553
|
definition: g,
|
|
2488
|
-
description:
|
|
2489
|
-
aliases:
|
|
2490
|
-
examples:
|
|
2491
|
-
tier:
|
|
2554
|
+
description: h,
|
|
2555
|
+
aliases: I,
|
|
2556
|
+
examples: R,
|
|
2557
|
+
tier: T = "confirmed"
|
|
2492
2558
|
} = {}) {
|
|
2493
|
-
const
|
|
2494
|
-
return t !== void 0 && (
|
|
2559
|
+
const m = { name: e, tier: T };
|
|
2560
|
+
return t !== void 0 && (m.domain = t), n !== void 0 && (m.range = n), s !== void 0 && (m.inverse_of = s), r !== void 0 && (m.cardinality = r), i !== void 0 && (m.temporal = i), a !== void 0 && (m.properties_schema = a), c !== void 0 && (m.transitive = c), u !== void 0 && (m.symmetric = u), y !== void 0 && (m.reflexive = y), p !== void 0 && (m.parent_relations = p), d !== void 0 && (m.iri = d), $ !== void 0 && (m.wikidata_pid = $), k !== void 0 && (m.display_name = k), g !== void 0 && (m.definition = g), h !== void 0 && (m.description = h), I !== void 0 && (m.aliases = I), R !== void 0 && (m.examples = R), this.api.post("/memory/ontology/relations", m);
|
|
2495
2561
|
}
|
|
2496
2562
|
/**
|
|
2497
2563
|
* List ontology relation types, keyset-paginated. Mirror of `listTypes`.
|
|
@@ -2504,10 +2570,10 @@ class ie {
|
|
|
2504
2570
|
* @param {string} [options.cursor] opaque keyset continuation token
|
|
2505
2571
|
*/
|
|
2506
2572
|
async listRelations({ tier: e, layer: t, packId: n, hasIri: s, limit: r = 100, cursor: i } = {}) {
|
|
2507
|
-
const
|
|
2508
|
-
e !== void 0 && (
|
|
2509
|
-
const
|
|
2510
|
-
return this.api.get(`/memory/ontology/relations${
|
|
2573
|
+
const a = { limit: String(r) };
|
|
2574
|
+
e !== void 0 && (a.tier = e), t !== void 0 && (a.layer = t), n !== void 0 && (a.pack_id = n), s !== void 0 && (a.has_iri = String(s)), i !== void 0 && (a.cursor = i);
|
|
2575
|
+
const c = new URLSearchParams(a).toString();
|
|
2576
|
+
return this.api.get(`/memory/ontology/relations${c ? "?" + c : ""}`);
|
|
2511
2577
|
}
|
|
2512
2578
|
/**
|
|
2513
2579
|
* Resolve a single ontology type by iri/qid/name.
|
|
@@ -2535,8 +2601,8 @@ class ie {
|
|
|
2535
2601
|
async listAudit({ actor: e, action: t, since: n, until: s, limit: r = 200 } = {}) {
|
|
2536
2602
|
const i = { limit: String(r) };
|
|
2537
2603
|
e !== void 0 && (i.actor = e), t !== void 0 && (i.action = t), n !== void 0 && (i.since = n), s !== void 0 && (i.until = s);
|
|
2538
|
-
const
|
|
2539
|
-
return this.api.get(`/memory/ontology/audit${
|
|
2604
|
+
const a = new URLSearchParams(i).toString();
|
|
2605
|
+
return this.api.get(`/memory/ontology/audit${a ? "?" + a : ""}`);
|
|
2540
2606
|
}
|
|
2541
2607
|
/**
|
|
2542
2608
|
* Full append-only audit trail for one ontology type (oldest-first).
|
|
@@ -2612,8 +2678,8 @@ class ie {
|
|
|
2612
2678
|
async listReviewQueue({ tier: e, assignee: t, source: n, limit: s = 100, cursor: r } = {}) {
|
|
2613
2679
|
const i = { limit: String(s) };
|
|
2614
2680
|
e !== void 0 && (i.tier = e), t !== void 0 && (i.assignee = t), n !== void 0 && (i.source = n), r !== void 0 && (i.cursor = r);
|
|
2615
|
-
const
|
|
2616
|
-
return this.api.get(`/memory/ontology/queue${
|
|
2681
|
+
const a = new URLSearchParams(i).toString();
|
|
2682
|
+
return this.api.get(`/memory/ontology/queue${a ? "?" + a : ""}`);
|
|
2617
2683
|
}
|
|
2618
2684
|
/**
|
|
2619
2685
|
* Approve one ontology review type.
|
|
@@ -2678,7 +2744,7 @@ class ie {
|
|
|
2678
2744
|
return s !== void 0 && (r.expected_tier = s), this.api.post("/memory/ontology/queue/bulk", r);
|
|
2679
2745
|
}
|
|
2680
2746
|
}
|
|
2681
|
-
class
|
|
2747
|
+
class he {
|
|
2682
2748
|
constructor(e) {
|
|
2683
2749
|
this.api = e;
|
|
2684
2750
|
}
|
|
@@ -2707,7 +2773,7 @@ class ae {
|
|
|
2707
2773
|
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);
|
|
2708
2774
|
}
|
|
2709
2775
|
}
|
|
2710
|
-
class
|
|
2776
|
+
class ye {
|
|
2711
2777
|
constructor(e) {
|
|
2712
2778
|
this.api = e;
|
|
2713
2779
|
}
|
|
@@ -2743,7 +2809,7 @@ class oe {
|
|
|
2743
2809
|
return this.api.get("/memory/inference/rules");
|
|
2744
2810
|
}
|
|
2745
2811
|
}
|
|
2746
|
-
class
|
|
2812
|
+
class pe {
|
|
2747
2813
|
constructor(e) {
|
|
2748
2814
|
this.api = e;
|
|
2749
2815
|
}
|
|
@@ -2859,7 +2925,7 @@ class ce {
|
|
|
2859
2925
|
return this.api.delete(`/memory/pipeline/configs/${e}`);
|
|
2860
2926
|
}
|
|
2861
2927
|
}
|
|
2862
|
-
class
|
|
2928
|
+
class de {
|
|
2863
2929
|
constructor(e) {
|
|
2864
2930
|
this.api = e;
|
|
2865
2931
|
}
|
|
@@ -2885,7 +2951,7 @@ class ue {
|
|
|
2885
2951
|
return this.api.get(`/memory/archive/${e}`);
|
|
2886
2952
|
}
|
|
2887
2953
|
}
|
|
2888
|
-
class
|
|
2954
|
+
class ge {
|
|
2889
2955
|
constructor(e) {
|
|
2890
2956
|
this.api = e;
|
|
2891
2957
|
}
|
|
@@ -3044,7 +3110,7 @@ class le {
|
|
|
3044
3110
|
return this.api.get(`/memory/zettel/by-relation/${e}/${t}?limit=${n}`);
|
|
3045
3111
|
}
|
|
3046
3112
|
}
|
|
3047
|
-
class
|
|
3113
|
+
class fe {
|
|
3048
3114
|
constructor(e) {
|
|
3049
3115
|
this.api = e;
|
|
3050
3116
|
}
|
|
@@ -3080,7 +3146,7 @@ class me {
|
|
|
3080
3146
|
return this.api.get("/memory/procedures/matches/stats");
|
|
3081
3147
|
}
|
|
3082
3148
|
}
|
|
3083
|
-
class
|
|
3149
|
+
class _e {
|
|
3084
3150
|
constructor(e) {
|
|
3085
3151
|
this.api = e;
|
|
3086
3152
|
}
|
|
@@ -3129,7 +3195,7 @@ class he {
|
|
|
3129
3195
|
return this.api.delete(`/memory/procedures/candidates/${e}/dismiss`);
|
|
3130
3196
|
}
|
|
3131
3197
|
}
|
|
3132
|
-
class
|
|
3198
|
+
class $e {
|
|
3133
3199
|
constructor(e) {
|
|
3134
3200
|
this.api = e;
|
|
3135
3201
|
}
|
|
@@ -3184,7 +3250,7 @@ class ye {
|
|
|
3184
3250
|
return this.api.get(`/memory/procedures/schemas/${e}`);
|
|
3185
3251
|
}
|
|
3186
3252
|
}
|
|
3187
|
-
class
|
|
3253
|
+
class ke {
|
|
3188
3254
|
constructor(e) {
|
|
3189
3255
|
this.api = e;
|
|
3190
3256
|
}
|
|
@@ -3256,7 +3322,7 @@ class pe {
|
|
|
3256
3322
|
return this.api.delete(`/memory/summary/${e}`);
|
|
3257
3323
|
}
|
|
3258
3324
|
}
|
|
3259
|
-
class
|
|
3325
|
+
class we {
|
|
3260
3326
|
constructor(e) {
|
|
3261
3327
|
this.api = e;
|
|
3262
3328
|
}
|
|
@@ -3295,10 +3361,10 @@ class de {
|
|
|
3295
3361
|
return await this.api.post(`/memory/locks/${e}/renew`, s, {
|
|
3296
3362
|
headers: { "X-Lease-Token": t }
|
|
3297
3363
|
});
|
|
3298
|
-
} catch (
|
|
3299
|
-
if ((
|
|
3364
|
+
} catch (a) {
|
|
3365
|
+
if ((a == null ? void 0 : a.status) === 409 && ((i = (r = a.detail) == null ? void 0 : r.detail) == null ? void 0 : i.reason) === "not_owner")
|
|
3300
3366
|
return null;
|
|
3301
|
-
throw
|
|
3367
|
+
throw a;
|
|
3302
3368
|
}
|
|
3303
3369
|
}
|
|
3304
3370
|
/**
|
|
@@ -3320,7 +3386,7 @@ class de {
|
|
|
3320
3386
|
}
|
|
3321
3387
|
}
|
|
3322
3388
|
}
|
|
3323
|
-
class
|
|
3389
|
+
class be {
|
|
3324
3390
|
constructor(e) {
|
|
3325
3391
|
this.api = e;
|
|
3326
3392
|
}
|
|
@@ -3364,7 +3430,7 @@ class ge {
|
|
|
3364
3430
|
}
|
|
3365
3431
|
}
|
|
3366
3432
|
}
|
|
3367
|
-
class
|
|
3433
|
+
class Ie {
|
|
3368
3434
|
constructor(e) {
|
|
3369
3435
|
this.api = e;
|
|
3370
3436
|
}
|
|
@@ -3395,13 +3461,13 @@ class fe {
|
|
|
3395
3461
|
*/
|
|
3396
3462
|
async pack({ budgetTokens: e, query: t, sections: n, preset: s } = {}) {
|
|
3397
3463
|
const r = { budget_tokens: e };
|
|
3398
|
-
return t != null && (r.query = t), n != null && (r.sections = n.map(({ name: i, cap_tokens:
|
|
3464
|
+
return t != null && (r.query = t), n != null && (r.sections = n.map(({ name: i, cap_tokens: a, capTokens: c }) => ({
|
|
3399
3465
|
name: i,
|
|
3400
|
-
cap_tokens:
|
|
3466
|
+
cap_tokens: a !== void 0 ? a : c
|
|
3401
3467
|
}))), s != null && (r.preset = s), this.api.post("/memory/recall/pack", r);
|
|
3402
3468
|
}
|
|
3403
3469
|
}
|
|
3404
|
-
class
|
|
3470
|
+
class Re {
|
|
3405
3471
|
constructor(e) {
|
|
3406
3472
|
this.api = e;
|
|
3407
3473
|
}
|
|
@@ -3430,11 +3496,11 @@ class _e {
|
|
|
3430
3496
|
return this.api.post("/memory/policy/events", e);
|
|
3431
3497
|
}
|
|
3432
3498
|
}
|
|
3433
|
-
class
|
|
3499
|
+
class ve {
|
|
3434
3500
|
constructor(e) {
|
|
3435
|
-
this.auth = new
|
|
3436
|
-
const t = new
|
|
3437
|
-
this._api = t, this.memories = new
|
|
3501
|
+
this.auth = new N(e);
|
|
3502
|
+
const t = new J(this.auth, { fetchFn: e.fetchFn });
|
|
3503
|
+
this._api = t, this.memories = new V(t), this.decisions = new W(t), this.opinions = new Y(t), this.graph = new X(t), this.teams = new Z(t), this.profiles = new Q(t), this.subscriptions = new ee(t), this.authAPI = new te(t), this.agents = new ne(t), this.usage = new se(t), this.insights = new re(t), this.tokenUsage = new ie(t), this.temporal = new ae(t), this.governance = new oe(t), this.evolution = new ce(t), this.reasoning = new ue(t), this.reasoningTraces = new le(t), this.ontology = new me(t), this.analytics = new he(t), this.validation = new ye(t), this.pipeline = new pe(t), this.archive = new de(t), this.zettelkasten = new ge(t), this.procedureMatches = new fe(t), this.procedureCandidates = new _e(t), this.procedureDrift = new $e(t), this.summaries = new ke(t), this.locks = new we(t), this.sequences = new be(t), this.recall = new Ie(t), this.policy = new Re(t);
|
|
3438
3504
|
}
|
|
3439
3505
|
setTeamId(e) {
|
|
3440
3506
|
this.auth.tokenManager.setTeamId(e), this.auth.notifyListeners();
|
|
@@ -3460,38 +3526,38 @@ class ke {
|
|
|
3460
3526
|
}
|
|
3461
3527
|
}
|
|
3462
3528
|
export {
|
|
3463
|
-
|
|
3464
|
-
B,
|
|
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
|
-
|
|
3496
|
-
|
|
3529
|
+
w as A,
|
|
3530
|
+
J as B,
|
|
3531
|
+
W as D,
|
|
3532
|
+
ce as E,
|
|
3533
|
+
oe as G,
|
|
3534
|
+
re as I,
|
|
3535
|
+
we as L,
|
|
3536
|
+
V as M,
|
|
3537
|
+
me as O,
|
|
3538
|
+
pe as P,
|
|
3539
|
+
ue as R,
|
|
3540
|
+
be as S,
|
|
3541
|
+
Z as T,
|
|
3542
|
+
se as U,
|
|
3543
|
+
ye as V,
|
|
3544
|
+
ge as Z,
|
|
3545
|
+
ne as a,
|
|
3546
|
+
he as b,
|
|
3547
|
+
de as c,
|
|
3548
|
+
te as d,
|
|
3549
|
+
N as e,
|
|
3550
|
+
X as f,
|
|
3551
|
+
Y as g,
|
|
3552
|
+
_e as h,
|
|
3553
|
+
fe as i,
|
|
3554
|
+
Q as j,
|
|
3555
|
+
le as k,
|
|
3556
|
+
ve as l,
|
|
3557
|
+
ee as m,
|
|
3558
|
+
ae as n,
|
|
3559
|
+
K as o,
|
|
3560
|
+
ie as p,
|
|
3561
|
+
D as q,
|
|
3562
|
+
G as r
|
|
3497
3563
|
};
|
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-McKeQ81o.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-McKeQ81o.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-McKeQ81o.js";
|
|
3
3
|
const m = d(null), f = d(null);
|
|
4
4
|
function b({ children: e, ...r }) {
|
|
5
5
|
const n = S(null);
|