@smartmemory/sdk-js 1.4.86 → 1.4.88

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.
@@ -1,32 +1,32 @@
1
- var P = (a) => {
1
+ var q = (a) => {
2
2
  throw TypeError(a);
3
3
  };
4
- var v = (a, e, t) => e.has(a) || P("Cannot " + t);
5
- var I = (a, e, t) => (v(a, e, "read from private field"), t ? t.call(a) : e.get(a)), A = (a, e, t) => e.has(a) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), T = (a, e, t, n) => (v(a, e, "write to private field"), n ? n.call(a, t) : e.set(a, t), t), q = (a, e, t) => (v(a, e, "access private method"), t);
6
- const M = {
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
- }, k = {
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 x {
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 = { ...M, ...t }, this._memory = { access: null, refresh: null, user: null, tenant: null, team: null };
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, k.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, k.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, k.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, k.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, k.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(k))
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 g, S, E;
152
- class z {
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
- A(this, S);
164
- A(this, g, null);
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 (I(this, g))
169
- return I(this, g);
170
- T(this, g, q(this, S, E).call(this));
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 I(this, g);
172
+ return await R(this, f);
173
173
  } finally {
174
- T(this, g, null);
174
+ C(this, f, null);
175
175
  }
176
176
  }
177
177
  }
178
- g = new WeakMap(), S = new WeakSet(), E = async function() {
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 C = "smart_memory_sso_redirect";
194
- class F {
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(C, e);
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(C);
227
- return sessionStorage.removeItem(C), e;
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 O {
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 x({
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 z({
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 F({
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 $ extends Error {
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 R(a) {
380
+ function S(a) {
381
381
  return typeof FormData < "u" && a instanceof FormData;
382
382
  }
383
- function L(a) {
383
+ function E(a) {
384
384
  return (a == null ? void 0 : a.name) === "AbortError";
385
385
  }
386
- class j {
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
- ...R(t.body) ? {} : { "Content-Type": "application/json" },
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 m = {
419
- ...R(t.body) ? {} : { "Content-Type": "application/json" },
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: m, __isRetry: !0 })
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 $("Authentication required", 401, "auth_expired");
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 $ || L(o) ? o : new $(o.message, 0, "network_error");
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
- ...R(t.body) ? {} : { "Content-Type": "application/json" },
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 m = {
461
- ...R(t.body) ? {} : { "Content-Type": "application/json" },
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: m, __isRetry: !0 })
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 $("Authentication required", 401, "auth_expired");
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 $ || L(o) ? o : new $(o.message, 0, "network_error");
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 B {
543
+ class H {
544
544
  constructor(e) {
545
545
  this.api = e;
546
546
  }
@@ -701,6 +701,8 @@ class B {
701
701
  * default CHANGED behaviour rather than preserving it — before
702
702
  * CORE-ARCHIVED-RECALL-1 the server read `archived` on no search path at all, so
703
703
  * archived items were returned ranked exactly like live ones.
704
+ * @param {boolean} [options.excludeSpeculative=false] - Exclude speculative
705
+ * memories from results. Sent as `exclude_speculative` only when true.
704
706
  * @param {boolean} [options.cite=false] - When true (RECALL-CITATIONS-1), the
705
707
  * envelope gains a `citations` array of `{n, item_id, item_type, preview, score, footnote_marker}`.
706
708
  * Empty `citations: []` when no results — distinguishes "no results" from "no citations requested".
@@ -717,9 +719,9 @@ class B {
717
719
  * result marked `'unresolved'` is PRESENT-DAY content and must not be rendered
718
720
  * as a historical belief.
719
721
  */
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: m = 3, budgetMs: h = 1500, semanticHops: y = !1, includeReference: p = !1, includeConsolidated: f = !1, consolidationFirst: _ = !1, asOfDate: d = null, asOfStrict: l = !1, includeSuperseded: w = !1, includeRetracted: b = !1, includeArchived: U = !1 } = {}) {
721
- const u = { query: e, top_k: t, enable_hybrid: n };
722
- return s && (u.memory_type = s), r && (u.expertise = !0), i && (u.cite = !0), c && (u.decompose = !0), o && (u.multi_hop = !0), o && m !== 3 && (u.max_hops = m), o && h !== 1500 && (u.budget_ms = h), o && y && (u.semantic_hops = !0), p && (u.include_reference = !0), f && (u.include_consolidated = !0), _ && (u.consolidation_first = !0), d && (u.as_of_date = d instanceof Date ? d.toISOString() : d), l && (u.as_of_strict = !0), w && (u.include_superseded = !0), b && (u.include_retracted = !0), U && (u.include_archived = !0), this.api.post("/memory/search", u);
722
+ 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 } = {}) {
723
+ const m = { query: e, top_k: t, enable_hybrid: n };
724
+ 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
725
  }
724
726
  /**
725
727
  * Ask a question and get a written answer plus the evidence behind it (DIST-LITE-9).
@@ -966,7 +968,7 @@ class B {
966
968
  return this.api.get("/memory/clustering/stats");
967
969
  }
968
970
  }
969
- class H {
971
+ class K {
970
972
  constructor(e) {
971
973
  this.api = e;
972
974
  }
@@ -994,10 +996,10 @@ class H {
994
996
  evidenceIds: i = null,
995
997
  domain: c = null,
996
998
  tags: o = null,
997
- rejectedAlternatives: m = null,
998
- rationale: h = null,
999
- constraints: y = null,
1000
- agentId: p = null
999
+ rejectedAlternatives: h = null,
1000
+ rationale: y = null,
1001
+ constraints: p = null,
1002
+ agentId: d = null
1001
1003
  }) {
1002
1004
  return this.api.post("/memory/decisions/create", {
1003
1005
  content: e,
@@ -1008,10 +1010,10 @@ class H {
1008
1010
  evidence_ids: i,
1009
1011
  domain: c,
1010
1012
  tags: o,
1011
- rejected_alternatives: m,
1012
- rationale: h,
1013
- constraints: y,
1014
- agent_id: p
1013
+ rejected_alternatives: h,
1014
+ rationale: y,
1015
+ constraints: p,
1016
+ agent_id: d
1015
1017
  });
1016
1018
  }
1017
1019
  /**
@@ -1184,7 +1186,7 @@ class H {
1184
1186
  });
1185
1187
  }
1186
1188
  }
1187
- class K {
1189
+ class G {
1188
1190
  constructor(e) {
1189
1191
  this.api = e;
1190
1192
  }
@@ -1206,7 +1208,7 @@ class K {
1206
1208
  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
1209
  }
1208
1210
  }
1209
- class G {
1211
+ class D {
1210
1212
  constructor(e) {
1211
1213
  this.api = e;
1212
1214
  }
@@ -1355,7 +1357,7 @@ class G {
1355
1357
  );
1356
1358
  }
1357
1359
  }
1358
- class D {
1360
+ class N {
1359
1361
  constructor(e) {
1360
1362
  this.api = e;
1361
1363
  }
@@ -1397,7 +1399,7 @@ class D {
1397
1399
  return this.api.delete(`/memory/teams/${e}/members/${t}`);
1398
1400
  }
1399
1401
  }
1400
- class N {
1402
+ class J {
1401
1403
  constructor(e) {
1402
1404
  this.api = e;
1403
1405
  }
@@ -1419,7 +1421,7 @@ class N {
1419
1421
  return this.api.patch("/auth/llm-keys", e);
1420
1422
  }
1421
1423
  }
1422
- class J {
1424
+ class W {
1423
1425
  constructor(e) {
1424
1426
  this.api = e;
1425
1427
  }
@@ -1445,7 +1447,7 @@ class J {
1445
1447
  });
1446
1448
  }
1447
1449
  }
1448
- class W {
1450
+ class V {
1449
1451
  constructor(e) {
1450
1452
  this.api = e;
1451
1453
  }
@@ -1466,7 +1468,7 @@ class W {
1466
1468
  return this.api.delete(`/memory/api-keys/${e}`);
1467
1469
  }
1468
1470
  }
1469
- class V {
1471
+ class Y {
1470
1472
  constructor(e) {
1471
1473
  this.api = e;
1472
1474
  }
@@ -1525,7 +1527,7 @@ class V {
1525
1527
  return this.api.get(`/memory/agents/${e}/evaluation/history${r ? "?" + r : ""}`);
1526
1528
  }
1527
1529
  }
1528
- class Y {
1530
+ class X {
1529
1531
  constructor(e) {
1530
1532
  this.api = e;
1531
1533
  }
@@ -1539,7 +1541,7 @@ class Y {
1539
1541
  return this.api.get("/usage/tiers");
1540
1542
  }
1541
1543
  }
1542
- class X {
1544
+ class Z {
1543
1545
  constructor(e) {
1544
1546
  this.api = e;
1545
1547
  }
@@ -1556,7 +1558,7 @@ class X {
1556
1558
  return this.api.get("/memory/plugins");
1557
1559
  }
1558
1560
  }
1559
- class Z {
1561
+ class Q {
1560
1562
  constructor(e) {
1561
1563
  this.api = e;
1562
1564
  }
@@ -1579,7 +1581,7 @@ class Z {
1579
1581
  return this.api.get("/memory/token-usage/current");
1580
1582
  }
1581
1583
  }
1582
- class Q {
1584
+ class ee {
1583
1585
  constructor(e) {
1584
1586
  this.api = e;
1585
1587
  }
@@ -1725,7 +1727,7 @@ class Q {
1725
1727
  return this.api.get(`/memory/temporal/relationships/${e}/valid-periods`);
1726
1728
  }
1727
1729
  }
1728
- class ee {
1730
+ class te {
1729
1731
  constructor(e) {
1730
1732
  this.api = e;
1731
1733
  }
@@ -1794,7 +1796,7 @@ class ee {
1794
1796
  return this.api.get("/memory/governance/summary");
1795
1797
  }
1796
1798
  }
1797
- class te {
1799
+ class ne {
1798
1800
  constructor(e) {
1799
1801
  this.api = e;
1800
1802
  }
@@ -1835,7 +1837,7 @@ class te {
1835
1837
  return this.api.post("/memory/evolution/reinforce/opinions");
1836
1838
  }
1837
1839
  }
1838
- class ne {
1840
+ class se {
1839
1841
  constructor(e) {
1840
1842
  this.api = e;
1841
1843
  }
@@ -1933,7 +1935,7 @@ class ne {
1933
1935
  });
1934
1936
  }
1935
1937
  }
1936
- class se {
1938
+ class re {
1937
1939
  constructor(e) {
1938
1940
  this.api = e;
1939
1941
  }
@@ -1987,7 +1989,7 @@ class se {
1987
1989
  return this.api.get(`/memory/reasoning/traces/${e}`);
1988
1990
  }
1989
1991
  }
1990
- class re {
1992
+ class ie {
1991
1993
  constructor(e) {
1992
1994
  this.api = e;
1993
1995
  }
@@ -2391,8 +2393,8 @@ class re {
2391
2393
  async listTypes({ tier: e, layer: t, packId: n, hasIri: s, kind: r, limit: i = 100, cursor: c } = {}) {
2392
2394
  const o = { limit: String(i) };
2393
2395
  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 m = new URLSearchParams(o).toString();
2395
- return this.api.get(`/memory/ontology/types${m ? "?" + m : ""}`);
2396
+ const h = new URLSearchParams(o).toString();
2397
+ return this.api.get(`/memory/ontology/types${h ? "?" + h : ""}`);
2396
2398
  }
2397
2399
  /**
2398
2400
  * Declare an ontology class (CORE-MEMTYPE-DECLARE-1).
@@ -2431,16 +2433,16 @@ class re {
2431
2433
  storageSearchable: i,
2432
2434
  iri: c,
2433
2435
  wikidataQid: o,
2434
- displayName: m,
2435
- definition: h,
2436
- description: y,
2437
- aliases: p,
2438
- examples: f,
2439
- parentTypes: _,
2440
- tier: d = "confirmed"
2436
+ displayName: h,
2437
+ definition: y,
2438
+ description: p,
2439
+ aliases: d,
2440
+ examples: _,
2441
+ parentTypes: $,
2442
+ tier: g = "confirmed"
2441
2443
  } = {}) {
2442
- const l = { name: e, kind: t, tier: d };
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), m !== void 0 && (l.display_name = m), h !== void 0 && (l.definition = h), y !== void 0 && (l.description = y), p !== void 0 && (l.aliases = p), f !== void 0 && (l.examples = f), _ !== void 0 && (l.parent_types = _), this.api.post("/memory/ontology/types", l);
2444
+ const l = { name: e, kind: t, tier: g };
2445
+ 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
2446
  }
2445
2447
  /**
2446
2448
  * Declare an ontology relation (CORE-MEMTYPE-DECLARE-1; declare-only in P1).
@@ -2477,20 +2479,20 @@ class re {
2477
2479
  temporal: i,
2478
2480
  propertiesSchema: c,
2479
2481
  transitive: o,
2480
- symmetric: m,
2481
- reflexive: h,
2482
- parentRelations: y,
2483
- iri: p,
2484
- wikidataPid: f,
2485
- displayName: _,
2486
- definition: d,
2482
+ symmetric: h,
2483
+ reflexive: y,
2484
+ parentRelations: p,
2485
+ iri: d,
2486
+ wikidataPid: _,
2487
+ displayName: $,
2488
+ definition: g,
2487
2489
  description: l,
2488
- aliases: w,
2489
- examples: b,
2490
- tier: U = "confirmed"
2490
+ aliases: b,
2491
+ examples: I,
2492
+ tier: v = "confirmed"
2491
2493
  } = {}) {
2492
- const u = { name: e, tier: U };
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), m !== void 0 && (u.symmetric = m), h !== void 0 && (u.reflexive = h), y !== void 0 && (u.parent_relations = y), p !== void 0 && (u.iri = p), f !== void 0 && (u.wikidata_pid = f), _ !== void 0 && (u.display_name = _), d !== void 0 && (u.definition = d), l !== void 0 && (u.description = l), w !== void 0 && (u.aliases = w), b !== void 0 && (u.examples = b), this.api.post("/memory/ontology/relations", u);
2494
+ const u = { name: e, tier: v };
2495
+ 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
2496
  }
2495
2497
  /**
2496
2498
  * List ontology relation types, keyset-paginated. Mirror of `listTypes`.
@@ -2677,7 +2679,7 @@ class re {
2677
2679
  return s !== void 0 && (r.expected_tier = s), this.api.post("/memory/ontology/queue/bulk", r);
2678
2680
  }
2679
2681
  }
2680
- class ie {
2682
+ class ae {
2681
2683
  constructor(e) {
2682
2684
  this.api = e;
2683
2685
  }
@@ -2706,7 +2708,7 @@ class ie {
2706
2708
  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
2709
  }
2708
2710
  }
2709
- class ae {
2711
+ class oe {
2710
2712
  constructor(e) {
2711
2713
  this.api = e;
2712
2714
  }
@@ -2742,7 +2744,7 @@ class ae {
2742
2744
  return this.api.get("/memory/inference/rules");
2743
2745
  }
2744
2746
  }
2745
- class oe {
2747
+ class ce {
2746
2748
  constructor(e) {
2747
2749
  this.api = e;
2748
2750
  }
@@ -2858,7 +2860,7 @@ class oe {
2858
2860
  return this.api.delete(`/memory/pipeline/configs/${e}`);
2859
2861
  }
2860
2862
  }
2861
- class ce {
2863
+ class ue {
2862
2864
  constructor(e) {
2863
2865
  this.api = e;
2864
2866
  }
@@ -2884,7 +2886,7 @@ class ce {
2884
2886
  return this.api.get(`/memory/archive/${e}`);
2885
2887
  }
2886
2888
  }
2887
- class ue {
2889
+ class le {
2888
2890
  constructor(e) {
2889
2891
  this.api = e;
2890
2892
  }
@@ -3043,7 +3045,7 @@ class ue {
3043
3045
  return this.api.get(`/memory/zettel/by-relation/${e}/${t}?limit=${n}`);
3044
3046
  }
3045
3047
  }
3046
- class le {
3048
+ class me {
3047
3049
  constructor(e) {
3048
3050
  this.api = e;
3049
3051
  }
@@ -3079,7 +3081,7 @@ class le {
3079
3081
  return this.api.get("/memory/procedures/matches/stats");
3080
3082
  }
3081
3083
  }
3082
- class me {
3084
+ class he {
3083
3085
  constructor(e) {
3084
3086
  this.api = e;
3085
3087
  }
@@ -3128,7 +3130,7 @@ class me {
3128
3130
  return this.api.delete(`/memory/procedures/candidates/${e}/dismiss`);
3129
3131
  }
3130
3132
  }
3131
- class he {
3133
+ class ye {
3132
3134
  constructor(e) {
3133
3135
  this.api = e;
3134
3136
  }
@@ -3183,7 +3185,7 @@ class he {
3183
3185
  return this.api.get(`/memory/procedures/schemas/${e}`);
3184
3186
  }
3185
3187
  }
3186
- class ye {
3188
+ class pe {
3187
3189
  constructor(e) {
3188
3190
  this.api = e;
3189
3191
  }
@@ -3255,7 +3257,7 @@ class ye {
3255
3257
  return this.api.delete(`/memory/summary/${e}`);
3256
3258
  }
3257
3259
  }
3258
- class pe {
3260
+ class de {
3259
3261
  constructor(e) {
3260
3262
  this.api = e;
3261
3263
  }
@@ -3319,7 +3321,7 @@ class pe {
3319
3321
  }
3320
3322
  }
3321
3323
  }
3322
- class de {
3324
+ class ge {
3323
3325
  constructor(e) {
3324
3326
  this.api = e;
3325
3327
  }
@@ -3363,7 +3365,7 @@ class de {
3363
3365
  }
3364
3366
  }
3365
3367
  }
3366
- class ge {
3368
+ class fe {
3367
3369
  constructor(e) {
3368
3370
  this.api = e;
3369
3371
  }
@@ -3400,7 +3402,7 @@ class ge {
3400
3402
  }))), s != null && (r.preset = s), this.api.post("/memory/recall/pack", r);
3401
3403
  }
3402
3404
  }
3403
- class fe {
3405
+ class _e {
3404
3406
  constructor(e) {
3405
3407
  this.api = e;
3406
3408
  }
@@ -3429,11 +3431,11 @@ class fe {
3429
3431
  return this.api.post("/memory/policy/events", e);
3430
3432
  }
3431
3433
  }
3432
- class $e {
3434
+ class ke {
3433
3435
  constructor(e) {
3434
- this.auth = new O(e);
3435
- const t = new j(this.auth, { fetchFn: e.fetchFn });
3436
- this._api = t, this.memories = new B(t), this.decisions = new H(t), this.opinions = new K(t), this.graph = new G(t), this.teams = new D(t), this.profiles = new N(t), this.subscriptions = new J(t), this.authAPI = new W(t), this.agents = new V(t), this.usage = new Y(t), this.insights = new X(t), this.tokenUsage = new Z(t), this.temporal = new Q(t), this.governance = new ee(t), this.evolution = new te(t), this.reasoning = new ne(t), this.reasoningTraces = new se(t), this.ontology = new re(t), this.analytics = new ie(t), this.validation = new ae(t), this.pipeline = new oe(t), this.archive = new ce(t), this.zettelkasten = new ue(t), this.procedureMatches = new le(t), this.procedureCandidates = new me(t), this.procedureDrift = new he(t), this.summaries = new ye(t), this.locks = new pe(t), this.sequences = new de(t), this.recall = new ge(t), this.policy = new fe(t);
3436
+ this.auth = new j(e);
3437
+ const t = new B(this.auth, { fetchFn: e.fetchFn });
3438
+ 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
3439
  }
3438
3440
  setTeamId(e) {
3439
3441
  this.auth.tokenManager.setTeamId(e), this.auth.notifyListeners();
@@ -3459,38 +3461,38 @@ class $e {
3459
3461
  }
3460
3462
  }
3461
3463
  export {
3462
- $ as A,
3463
- j as B,
3464
- H as D,
3465
- te as E,
3466
- ee as G,
3467
- X as I,
3468
- pe as L,
3469
- B as M,
3470
- re as O,
3471
- oe as P,
3472
- ne as R,
3473
- de as S,
3474
- D as T,
3475
- Y as U,
3476
- ae as V,
3477
- ue as Z,
3478
- V as a,
3479
- ie as b,
3480
- ce as c,
3481
- W as d,
3482
- O as e,
3483
- G as f,
3484
- K as g,
3485
- me as h,
3486
- le as i,
3487
- N as j,
3488
- se as k,
3489
- $e as l,
3490
- J as m,
3491
- Q as n,
3492
- x as o,
3493
- Z as p,
3494
- z as q,
3495
- F as r
3464
+ k as A,
3465
+ B,
3466
+ K as D,
3467
+ ne as E,
3468
+ te as G,
3469
+ Z as I,
3470
+ de as L,
3471
+ H as M,
3472
+ ie as O,
3473
+ ce as P,
3474
+ se as R,
3475
+ ge as S,
3476
+ N as T,
3477
+ X as U,
3478
+ oe as V,
3479
+ le as Z,
3480
+ Y as a,
3481
+ ae as b,
3482
+ ue as c,
3483
+ V as d,
3484
+ j as e,
3485
+ D as f,
3486
+ G as g,
3487
+ he as h,
3488
+ me as i,
3489
+ J as j,
3490
+ re as k,
3491
+ ke as l,
3492
+ W as m,
3493
+ ee as n,
3494
+ z as o,
3495
+ Q as p,
3496
+ F as q,
3497
+ O as r
3496
3498
  };
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-BUZV42uF.js";
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-l0p31h_c.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-BUZV42uF.js";
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-l0p31h_c.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-BUZV42uF.js";
2
+ import { l as y } from "./core-l0p31h_c.js";
3
3
  const m = d(null), f = d(null);
4
4
  function b({ children: e, ...r }) {
5
5
  const n = S(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartmemory/sdk-js",
3
- "version": "1.4.86",
3
+ "version": "1.4.88",
4
4
  "description": "Unified JavaScript SDK for SmartMemory API — auth + API client for all frontends",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",