@smartmemory/sdk-js 0.6.4 → 1.4.25
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-BIdNSA4o.js → core-CLtPrdbi.js} +116 -74
- package/dist/core.js +4 -4
- package/dist/index.js +3 -3
- package/dist/progress.js +83 -82
- package/dist/react.js +9 -9
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var I = (i) => {
|
|
|
3
3
|
};
|
|
4
4
|
var $ = (i, e, t) => e.has(i) || I("Cannot " + t);
|
|
5
5
|
var p = (i, e, t) => ($(i, e, "read from private field"), t ? t.call(i) : e.get(i)), k = (i, e, t) => e.has(i) ? I("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), w = (i, e, t, r) => ($(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t), S = (i, e, t) => ($(i, e, "access private method"), t);
|
|
6
|
-
const
|
|
6
|
+
const R = {
|
|
7
7
|
access: "smart_memory_auth_token",
|
|
8
8
|
refresh: "smart_memory_refresh_token",
|
|
9
9
|
user: "smart_memory_user",
|
|
@@ -16,14 +16,14 @@ const v = {
|
|
|
16
16
|
tenant: ["tenant_id", "workspace_id", "sm_workspace_id"],
|
|
17
17
|
team: ["team_id", "sm_team_id"]
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class U {
|
|
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 = { ...R, ...t }, this._memory = { access: null, refresh: null, user: null, tenant: null, team: null };
|
|
27
27
|
}
|
|
28
28
|
getAccessToken() {
|
|
29
29
|
return this.storageType === "memory" ? this._memory.access : this._getFromStorage(this.keys.access, h.access);
|
|
@@ -149,7 +149,7 @@ class A {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
var m, d, T;
|
|
152
|
-
class
|
|
152
|
+
class P {
|
|
153
153
|
/**
|
|
154
154
|
* @param {Object} options
|
|
155
155
|
* @param {string} options.apiBaseUrl
|
|
@@ -191,7 +191,7 @@ m = new WeakMap(), d = new WeakSet(), T = async function() {
|
|
|
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
193
|
const b = "smart_memory_sso_redirect";
|
|
194
|
-
class
|
|
194
|
+
class C {
|
|
195
195
|
/**
|
|
196
196
|
* @param {Object} options
|
|
197
197
|
* @param {string} options.webAppUrl - Web app URL for login redirect
|
|
@@ -230,12 +230,12 @@ class U {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class L {
|
|
234
234
|
constructor(e) {
|
|
235
|
-
this.mode = e.mode, this.apiBaseUrl = e.apiBaseUrl, this.endpoints = e.endpoints || {}, this.listeners = /* @__PURE__ */ new Set(), this.useCookieAuth = e.useCookieAuth ?? this.mode === "sso", this.apiKey = e.apiKey || null, this.apiKey && (this.mode = "apiKey"), this.tokenManager = new
|
|
235
|
+
this.mode = e.mode, this.apiBaseUrl = e.apiBaseUrl, this.endpoints = e.endpoints || {}, this.listeners = /* @__PURE__ */ new Set(), this.useCookieAuth = e.useCookieAuth ?? this.mode === "sso", this.apiKey = e.apiKey || null, this.apiKey && (this.mode = "apiKey"), this.tokenManager = new U({
|
|
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 P({
|
|
239
239
|
apiBaseUrl: this.apiBaseUrl,
|
|
240
240
|
refreshEndpoint: this.endpoints.refresh || "/auth/refresh",
|
|
241
241
|
tokenManager: this.tokenManager,
|
|
@@ -247,7 +247,7 @@ class P {
|
|
|
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 C({
|
|
251
251
|
webAppUrl: e.webAppUrl,
|
|
252
252
|
allowedHosts: e.allowedRedirectHosts || [],
|
|
253
253
|
tokenManager: this.tokenManager
|
|
@@ -376,7 +376,7 @@ class g extends Error {
|
|
|
376
376
|
super(e), this.name = "APIError", this.status = t, this.detail = r;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
class
|
|
379
|
+
class M {
|
|
380
380
|
/**
|
|
381
381
|
* @param {import('../auth/AuthCore.js').AuthCore} authCore
|
|
382
382
|
* @param {{ fetchFn?: typeof globalThis.fetch }} [options]
|
|
@@ -463,7 +463,7 @@ class C {
|
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class z {
|
|
467
467
|
constructor(e) {
|
|
468
468
|
this.api = e;
|
|
469
469
|
}
|
|
@@ -523,6 +523,11 @@ class L {
|
|
|
523
523
|
* the response shape changes from a flat list to `{results: {<expertise_type>: [items]}}`
|
|
524
524
|
* keyed by expertise type (decision, constraint, learned, opinion, reasoning, observation).
|
|
525
525
|
* Each bucket holds up to topK items.
|
|
526
|
+
* @param {boolean} [options.includeConsolidated=false] - When true (CORE-CONSOLIDATE-1),
|
|
527
|
+
* include consolidated source memories (normally hidden) in results.
|
|
528
|
+
* @param {boolean} [options.consolidationFirst=false] - When true (NEURO-1d), surface a
|
|
529
|
+
* consolidated summary above the scattered source memories it consolidates — best for
|
|
530
|
+
* synthesis queries. Opt-in; implies includeConsolidated.
|
|
526
531
|
* @param {boolean} [options.cite=false] - When true (RECALL-CITATIONS-1), the
|
|
527
532
|
* envelope gains a `citations` array of `{n, item_id, item_type, preview, score, footnote_marker}`.
|
|
528
533
|
* Empty `citations: []` when no results — distinguishes "no results" from "no citations requested".
|
|
@@ -535,9 +540,9 @@ class L {
|
|
|
535
540
|
* present only under `cite: true`. Pre-LINEAGE-1 callers who indexed into a
|
|
536
541
|
* bare array must read `response.results` instead.
|
|
537
542
|
*/
|
|
538
|
-
async search(e, { topK: t = 5, enableHybrid: r = !0, memoryType: s = null, expertise: n = !1, cite: a = !1, decompose: c = !1, multiHop: o = !1, maxHops: u = 3, budgetMs: y = 1500, semanticHops: f = !1, includeReference: _ = !1 } = {}) {
|
|
543
|
+
async search(e, { topK: t = 5, enableHybrid: r = !0, memoryType: s = null, expertise: n = !1, cite: a = !1, decompose: c = !1, multiHop: o = !1, maxHops: u = 3, budgetMs: y = 1500, semanticHops: f = !1, includeReference: _ = !1, includeConsolidated: v = !1, consolidationFirst: A = !1 } = {}) {
|
|
539
544
|
const l = { query: e, top_k: t, enable_hybrid: r };
|
|
540
|
-
return s && (l.memory_type = s), n && (l.expertise = !0), a && (l.cite = !0), c && (l.decompose = !0), o && (l.multi_hop = !0), o && u !== 3 && (l.max_hops = u), o && y !== 1500 && (l.budget_ms = y), o && f && (l.semantic_hops = !0), _ && (l.include_reference = !0), this.api.post("/memory/search", l);
|
|
545
|
+
return s && (l.memory_type = s), n && (l.expertise = !0), a && (l.cite = !0), c && (l.decompose = !0), o && (l.multi_hop = !0), o && u !== 3 && (l.max_hops = u), o && y !== 1500 && (l.budget_ms = y), o && f && (l.semantic_hops = !0), _ && (l.include_reference = !0), v && (l.include_consolidated = !0), A && (l.consolidation_first = !0), this.api.post("/memory/search", l);
|
|
541
546
|
}
|
|
542
547
|
async getWorkingContext(e, t, { k: r = 20, maxTokens: s = null, strategy: n = null } = {}) {
|
|
543
548
|
const a = {
|
|
@@ -700,7 +705,7 @@ class L {
|
|
|
700
705
|
return this.api.get("/memory/clustering/stats");
|
|
701
706
|
}
|
|
702
707
|
}
|
|
703
|
-
class
|
|
708
|
+
class E {
|
|
704
709
|
constructor(e) {
|
|
705
710
|
this.api = e;
|
|
706
711
|
}
|
|
@@ -877,7 +882,7 @@ class M {
|
|
|
877
882
|
});
|
|
878
883
|
}
|
|
879
884
|
}
|
|
880
|
-
class
|
|
885
|
+
class O {
|
|
881
886
|
constructor(e) {
|
|
882
887
|
this.api = e;
|
|
883
888
|
}
|
|
@@ -899,7 +904,7 @@ class z {
|
|
|
899
904
|
return t.confidence !== void 0 && (r.confidence = t.confidence), t.subject !== void 0 && (r.subject = t.subject), t.subjectType !== void 0 && (r.subject_type = t.subjectType), t.disposition !== void 0 && (r.disposition = t.disposition), t.formedFrom !== void 0 && (r.formed_from = t.formedFrom), t.domain !== void 0 && (r.domain = t.domain), t.agentId !== void 0 && (r.agent_id = t.agentId), this.api.post("/memory/opinions/create", r);
|
|
900
905
|
}
|
|
901
906
|
}
|
|
902
|
-
class
|
|
907
|
+
class x {
|
|
903
908
|
constructor(e) {
|
|
904
909
|
this.api = e;
|
|
905
910
|
}
|
|
@@ -984,8 +989,45 @@ class E {
|
|
|
984
989
|
async getLinks(e) {
|
|
985
990
|
return this.api.get(`/memory/${encodeURIComponent(e)}/links`);
|
|
986
991
|
}
|
|
992
|
+
/**
|
|
993
|
+
* Merge unambiguous single-token entity aliases ("Hudson") into their
|
|
994
|
+
* multi-token canonical ("Rock Hudson") over the caller's workspace graph,
|
|
995
|
+
* abstaining on collisions (>=2 canonical candidates).
|
|
996
|
+
*
|
|
997
|
+
* `dry_run` is a query parameter (matching the /clustering/run precedent),
|
|
998
|
+
* not a JSON body — POST .../resolve-aliases?dry_run=true.
|
|
999
|
+
*
|
|
1000
|
+
* @param {Object} [options]
|
|
1001
|
+
* @param {boolean} [options.dryRun=false] - Compute the resolve/abstain plan and report counts without mutating the graph.
|
|
1002
|
+
* @param {boolean} [options.disambiguate=false] - Opt-in (CORE-GRAPH-ALIAS-DISAMBIG-1): additionally recover colliding surfaces by structural typed-neighbor overlap, merging only on a confident, clear winner (never mis-merge). Extractor-dependent; helps LLM-extracted graphs.
|
|
1003
|
+
* @returns {Promise<AliasResolveReport>}
|
|
1004
|
+
*/
|
|
1005
|
+
async resolveAliases({ dryRun: e = !1, disambiguate: t = !1 } = {}) {
|
|
1006
|
+
return this.api.post(`/memory/graph/resolve-aliases?dry_run=${e}&disambiguate=${t}`);
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Dedup cross-extractor fragmented entity nodes (CORE-GRAPH-CANONICAL-DEDUP-1).
|
|
1010
|
+
*
|
|
1011
|
+
* Collapses same-name entity-node fragments (the same entity split across >1 node because two
|
|
1012
|
+
* extractors disagreed on its type -> divergent canonical_key -> the write-time dedup missed them)
|
|
1013
|
+
* into one node, precision-first, over the caller's workspace graph. Unblocks ensemble alias
|
|
1014
|
+
* disambiguation. Opt-in, default-off. Recommended ensemble sequence: dedupEntities() then
|
|
1015
|
+
* resolveAliases({ disambiguate: true }).
|
|
1016
|
+
*
|
|
1017
|
+
* Both flags are query parameters, not a JSON body — POST .../dedup-entities?dry_run=true.
|
|
1018
|
+
*
|
|
1019
|
+
* @param {Object} [options]
|
|
1020
|
+
* @param {boolean} [options.dryRun=false] - Compute the dedup plan and report counts without mutating the graph.
|
|
1021
|
+
* @param {boolean} [options.requireStructuralConfirmation=true] - When true, a same-name pair merges only on T0 (same QID), T1 (same canonical_key), or T2 (>= tau_min shared typed entity-neighbors). When false, exact same-name clusters merge on name alone once T0/T1 fail (riskier disjoint-edge-tail recovery).
|
|
1022
|
+
* @returns {Promise<EntityDedupReport>}
|
|
1023
|
+
*/
|
|
1024
|
+
async dedupEntities({ dryRun: e = !1, requireStructuralConfirmation: t = !0 } = {}) {
|
|
1025
|
+
return this.api.post(
|
|
1026
|
+
`/memory/graph/dedup-entities?dry_run=${e}&require_structural_confirmation=${t}`
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
987
1029
|
}
|
|
988
|
-
class
|
|
1030
|
+
class q {
|
|
989
1031
|
constructor(e) {
|
|
990
1032
|
this.api = e;
|
|
991
1033
|
}
|
|
@@ -1025,7 +1067,7 @@ class O {
|
|
|
1025
1067
|
return this.api.delete(`/memory/teams/${e}/members/${t}`);
|
|
1026
1068
|
}
|
|
1027
1069
|
}
|
|
1028
|
-
class
|
|
1070
|
+
class j {
|
|
1029
1071
|
constructor(e) {
|
|
1030
1072
|
this.api = e;
|
|
1031
1073
|
}
|
|
@@ -1042,7 +1084,7 @@ class x {
|
|
|
1042
1084
|
return this.api.patch("/auth/llm-keys", e);
|
|
1043
1085
|
}
|
|
1044
1086
|
}
|
|
1045
|
-
class
|
|
1087
|
+
class F {
|
|
1046
1088
|
constructor(e) {
|
|
1047
1089
|
this.api = e;
|
|
1048
1090
|
}
|
|
@@ -1068,7 +1110,7 @@ class q {
|
|
|
1068
1110
|
});
|
|
1069
1111
|
}
|
|
1070
1112
|
}
|
|
1071
|
-
class
|
|
1113
|
+
class K {
|
|
1072
1114
|
constructor(e) {
|
|
1073
1115
|
this.api = e;
|
|
1074
1116
|
}
|
|
@@ -1089,7 +1131,7 @@ class j {
|
|
|
1089
1131
|
return this.api.delete(`/memory/api-keys/${e}`);
|
|
1090
1132
|
}
|
|
1091
1133
|
}
|
|
1092
|
-
class
|
|
1134
|
+
class H {
|
|
1093
1135
|
constructor(e) {
|
|
1094
1136
|
this.api = e;
|
|
1095
1137
|
}
|
|
@@ -1148,7 +1190,7 @@ class F {
|
|
|
1148
1190
|
return this.api.get(`/memory/agents/${e}/evaluation/history${n ? "?" + n : ""}`);
|
|
1149
1191
|
}
|
|
1150
1192
|
}
|
|
1151
|
-
class
|
|
1193
|
+
class B {
|
|
1152
1194
|
constructor(e) {
|
|
1153
1195
|
this.api = e;
|
|
1154
1196
|
}
|
|
@@ -1162,7 +1204,7 @@ class K {
|
|
|
1162
1204
|
return this.api.get("/usage/tiers");
|
|
1163
1205
|
}
|
|
1164
1206
|
}
|
|
1165
|
-
class
|
|
1207
|
+
class D {
|
|
1166
1208
|
constructor(e) {
|
|
1167
1209
|
this.api = e;
|
|
1168
1210
|
}
|
|
@@ -1179,7 +1221,7 @@ class H {
|
|
|
1179
1221
|
return this.api.get("/memory/plugins");
|
|
1180
1222
|
}
|
|
1181
1223
|
}
|
|
1182
|
-
class
|
|
1224
|
+
class G {
|
|
1183
1225
|
constructor(e) {
|
|
1184
1226
|
this.api = e;
|
|
1185
1227
|
}
|
|
@@ -1202,7 +1244,7 @@ class B {
|
|
|
1202
1244
|
return this.api.get("/memory/token-usage/current");
|
|
1203
1245
|
}
|
|
1204
1246
|
}
|
|
1205
|
-
class
|
|
1247
|
+
class N {
|
|
1206
1248
|
constructor(e) {
|
|
1207
1249
|
this.api = e;
|
|
1208
1250
|
}
|
|
@@ -1348,7 +1390,7 @@ class D {
|
|
|
1348
1390
|
return this.api.get(`/memory/temporal/relationships/${e}/valid-periods`);
|
|
1349
1391
|
}
|
|
1350
1392
|
}
|
|
1351
|
-
class
|
|
1393
|
+
class V {
|
|
1352
1394
|
constructor(e) {
|
|
1353
1395
|
this.api = e;
|
|
1354
1396
|
}
|
|
@@ -1417,7 +1459,7 @@ class G {
|
|
|
1417
1459
|
return this.api.get("/memory/governance/summary");
|
|
1418
1460
|
}
|
|
1419
1461
|
}
|
|
1420
|
-
class
|
|
1462
|
+
class J {
|
|
1421
1463
|
constructor(e) {
|
|
1422
1464
|
this.api = e;
|
|
1423
1465
|
}
|
|
@@ -1458,7 +1500,7 @@ class N {
|
|
|
1458
1500
|
return this.api.post("/memory/evolution/reinforce/opinions");
|
|
1459
1501
|
}
|
|
1460
1502
|
}
|
|
1461
|
-
class
|
|
1503
|
+
class W {
|
|
1462
1504
|
constructor(e) {
|
|
1463
1505
|
this.api = e;
|
|
1464
1506
|
}
|
|
@@ -1556,7 +1598,7 @@ class V {
|
|
|
1556
1598
|
});
|
|
1557
1599
|
}
|
|
1558
1600
|
}
|
|
1559
|
-
class
|
|
1601
|
+
class Y {
|
|
1560
1602
|
constructor(e) {
|
|
1561
1603
|
this.api = e;
|
|
1562
1604
|
}
|
|
@@ -1610,7 +1652,7 @@ class J {
|
|
|
1610
1652
|
return this.api.get(`/memory/reasoning/traces/${e}`);
|
|
1611
1653
|
}
|
|
1612
1654
|
}
|
|
1613
|
-
class
|
|
1655
|
+
class Z {
|
|
1614
1656
|
constructor(e) {
|
|
1615
1657
|
this.api = e;
|
|
1616
1658
|
}
|
|
@@ -1978,7 +2020,7 @@ class W {
|
|
|
1978
2020
|
return this.api.get(`/memory/ontology/updates/stats?history=${e}`);
|
|
1979
2021
|
}
|
|
1980
2022
|
}
|
|
1981
|
-
class
|
|
2023
|
+
class X {
|
|
1982
2024
|
constructor(e) {
|
|
1983
2025
|
this.api = e;
|
|
1984
2026
|
}
|
|
@@ -2007,7 +2049,7 @@ class Y {
|
|
|
2007
2049
|
return e !== null && (s.protected_attributes = e), t !== null && (s.sentiment_analysis = t), r !== null && (s.topic_analysis = r), this.api.post("/memory/analytics/bias", s);
|
|
2008
2050
|
}
|
|
2009
2051
|
}
|
|
2010
|
-
class
|
|
2052
|
+
class Q {
|
|
2011
2053
|
constructor(e) {
|
|
2012
2054
|
this.api = e;
|
|
2013
2055
|
}
|
|
@@ -2043,7 +2085,7 @@ class Z {
|
|
|
2043
2085
|
return this.api.get("/memory/validation/inference/rules");
|
|
2044
2086
|
}
|
|
2045
2087
|
}
|
|
2046
|
-
class
|
|
2088
|
+
class ee {
|
|
2047
2089
|
constructor(e) {
|
|
2048
2090
|
this.api = e;
|
|
2049
2091
|
}
|
|
@@ -2159,7 +2201,7 @@ class X {
|
|
|
2159
2201
|
return this.api.delete(`/memory/pipeline/configs/${e}`);
|
|
2160
2202
|
}
|
|
2161
2203
|
}
|
|
2162
|
-
class
|
|
2204
|
+
class te {
|
|
2163
2205
|
constructor(e) {
|
|
2164
2206
|
this.api = e;
|
|
2165
2207
|
}
|
|
@@ -2185,7 +2227,7 @@ class Q {
|
|
|
2185
2227
|
return this.api.get(`/memory/archive/${e}`);
|
|
2186
2228
|
}
|
|
2187
2229
|
}
|
|
2188
|
-
class
|
|
2230
|
+
class re {
|
|
2189
2231
|
constructor(e) {
|
|
2190
2232
|
this.api = e;
|
|
2191
2233
|
}
|
|
@@ -2344,7 +2386,7 @@ class ee {
|
|
|
2344
2386
|
return this.api.get(`/memory/zettel/by-relation/${e}/${t}?limit=${r}`);
|
|
2345
2387
|
}
|
|
2346
2388
|
}
|
|
2347
|
-
class
|
|
2389
|
+
class se {
|
|
2348
2390
|
constructor(e) {
|
|
2349
2391
|
this.api = e;
|
|
2350
2392
|
}
|
|
@@ -2380,7 +2422,7 @@ class te {
|
|
|
2380
2422
|
return this.api.get("/memory/procedures/matches/stats");
|
|
2381
2423
|
}
|
|
2382
2424
|
}
|
|
2383
|
-
class
|
|
2425
|
+
class ne {
|
|
2384
2426
|
constructor(e) {
|
|
2385
2427
|
this.api = e;
|
|
2386
2428
|
}
|
|
@@ -2429,7 +2471,7 @@ class re {
|
|
|
2429
2471
|
return this.api.delete(`/memory/procedures/candidates/${e}/dismiss`);
|
|
2430
2472
|
}
|
|
2431
2473
|
}
|
|
2432
|
-
class
|
|
2474
|
+
class ie {
|
|
2433
2475
|
constructor(e) {
|
|
2434
2476
|
this.api = e;
|
|
2435
2477
|
}
|
|
@@ -2484,7 +2526,7 @@ class se {
|
|
|
2484
2526
|
return this.api.get(`/memory/procedures/schemas/${e}`);
|
|
2485
2527
|
}
|
|
2486
2528
|
}
|
|
2487
|
-
class
|
|
2529
|
+
class ae {
|
|
2488
2530
|
constructor(e) {
|
|
2489
2531
|
this.api = e;
|
|
2490
2532
|
}
|
|
@@ -2556,11 +2598,11 @@ class ne {
|
|
|
2556
2598
|
return this.api.delete(`/memory/summary/${e}`);
|
|
2557
2599
|
}
|
|
2558
2600
|
}
|
|
2559
|
-
class
|
|
2601
|
+
class ce {
|
|
2560
2602
|
constructor(e) {
|
|
2561
|
-
this.auth = new
|
|
2562
|
-
const t = new
|
|
2563
|
-
this.memories = new
|
|
2603
|
+
this.auth = new L(e);
|
|
2604
|
+
const t = new M(this.auth, { fetchFn: e.fetchFn });
|
|
2605
|
+
this.memories = new z(t), this.decisions = new E(t), this.opinions = new O(t), this.graph = new x(t), this.teams = new q(t), this.profiles = new j(t), this.subscriptions = new F(t), this.authAPI = new K(t), this.agents = new H(t), this.usage = new B(t), this.insights = new D(t), this.tokenUsage = new G(t), this.temporal = new N(t), this.governance = new V(t), this.evolution = new J(t), this.reasoning = new W(t), this.reasoningTraces = new Y(t), this.ontology = new Z(t), this.analytics = new X(t), this.validation = new Q(t), this.pipeline = new ee(t), this.archive = new te(t), this.zettelkasten = new re(t), this.procedureMatches = new se(t), this.procedureCandidates = new ne(t), this.procedureDrift = new ie(t), this.summaries = new ae(t);
|
|
2564
2606
|
}
|
|
2565
2607
|
setTeamId(e) {
|
|
2566
2608
|
this.auth.tokenManager.setTeamId(e), this.auth.notifyListeners();
|
|
@@ -2571,35 +2613,35 @@ class ae {
|
|
|
2571
2613
|
}
|
|
2572
2614
|
export {
|
|
2573
2615
|
g as A,
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
G,
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2616
|
+
M as B,
|
|
2617
|
+
E as D,
|
|
2618
|
+
J as E,
|
|
2619
|
+
V as G,
|
|
2620
|
+
D as I,
|
|
2621
|
+
z as M,
|
|
2622
|
+
Z as O,
|
|
2623
|
+
ee as P,
|
|
2624
|
+
W as R,
|
|
2625
|
+
ce as S,
|
|
2626
|
+
q as T,
|
|
2627
|
+
B as U,
|
|
2628
|
+
Q as V,
|
|
2629
|
+
re as Z,
|
|
2630
|
+
H as a,
|
|
2631
|
+
X as b,
|
|
2632
|
+
te as c,
|
|
2633
|
+
K as d,
|
|
2634
|
+
L as e,
|
|
2635
|
+
x as f,
|
|
2636
|
+
O as g,
|
|
2637
|
+
ne as h,
|
|
2638
|
+
se as i,
|
|
2639
|
+
j,
|
|
2640
|
+
Y as k,
|
|
2641
|
+
F as l,
|
|
2642
|
+
N as m,
|
|
2643
|
+
U as n,
|
|
2644
|
+
G as o,
|
|
2645
|
+
P as p,
|
|
2646
|
+
C as q
|
|
2605
2647
|
};
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as r, d as A, e as I, B as P, D as n, f as o, I as t, M as i, j as g,
|
|
1
|
+
import { A as e, a as r, d as A, e as I, B as P, D as n, f as o, I as t, M as i, j as g, p as M, q as h, S as m, l as S, T as f, n as p, U as l } from "./core-CLtPrdbi.js";
|
|
2
2
|
export {
|
|
3
3
|
e as APIError,
|
|
4
4
|
r as AgentAPI,
|
|
@@ -10,9 +10,9 @@ export {
|
|
|
10
10
|
t as InsightsAPI,
|
|
11
11
|
i as MemoryAPI,
|
|
12
12
|
g as ProfileAPI,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
M as RefreshManager,
|
|
14
|
+
h as SSOManager,
|
|
15
|
+
m as SmartMemoryClient,
|
|
16
16
|
S as SubscriptionAPI,
|
|
17
17
|
f as TeamAPI,
|
|
18
18
|
p as TokenManager,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as f, a as u, b as A, c as b, d as P, e as h, D as I, E as g, G as x, f as p, I as w, M as m, O as k, g as v, P as T, h as B, i as y, j as C, R as E, k as
|
|
1
|
+
import { A as f, a as u, b as A, c as b, d as P, e as h, D as I, E as g, G as x, f as p, I as w, M as m, O as k, g as v, P as T, h as B, i as y, j as C, R as E, k as S, S as R, l as F, T as M, m as L, n as O, o as G, U, V as $, Z as D } from "./core-CLtPrdbi.js";
|
|
2
2
|
const i = {
|
|
3
3
|
variables: {
|
|
4
4
|
colorBackground: "transparent",
|
|
@@ -95,8 +95,8 @@ export {
|
|
|
95
95
|
y as ProcedureMatchAPI,
|
|
96
96
|
C as ProfileAPI,
|
|
97
97
|
E as ReasoningAPI,
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
S as ReasoningTracesAPI,
|
|
99
|
+
R as SmartMemoryClient,
|
|
100
100
|
F as SubscriptionAPI,
|
|
101
101
|
M as TeamAPI,
|
|
102
102
|
L as TemporalAPI,
|
package/dist/progress.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function _(r, n) {
|
|
2
2
|
const t = r.getReader();
|
|
3
3
|
let e;
|
|
4
4
|
for (; !(e = await t.read()).done; )
|
|
5
5
|
n(e.value);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function R(r) {
|
|
8
8
|
let n, t, e, o = !1;
|
|
9
|
-
return function(
|
|
10
|
-
n === void 0 ? (n =
|
|
9
|
+
return function(s) {
|
|
10
|
+
n === void 0 ? (n = s, t = 0, e = -1) : n = L(n, s);
|
|
11
11
|
const i = n.length;
|
|
12
|
-
let
|
|
12
|
+
let a = 0;
|
|
13
13
|
for (; t < i; ) {
|
|
14
|
-
o && (n[t] === 10 && (
|
|
15
|
-
let
|
|
16
|
-
for (; t < i &&
|
|
14
|
+
o && (n[t] === 10 && (a = ++t), o = !1);
|
|
15
|
+
let c = -1;
|
|
16
|
+
for (; t < i && c === -1; ++t)
|
|
17
17
|
switch (n[t]) {
|
|
18
18
|
case 58:
|
|
19
|
-
e === -1 && (e = t -
|
|
19
|
+
e === -1 && (e = t - a);
|
|
20
20
|
break;
|
|
21
21
|
case 13:
|
|
22
22
|
o = !0;
|
|
23
23
|
case 10:
|
|
24
|
-
|
|
24
|
+
c = t;
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
27
|
+
if (c === -1)
|
|
28
28
|
break;
|
|
29
|
-
r(n.subarray(
|
|
29
|
+
r(n.subarray(a, c), e), a = t, e = -1;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
a === i ? n = void 0 : a !== 0 && (n = n.subarray(a), t -= a);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
let e =
|
|
34
|
+
function P(r, n, t) {
|
|
35
|
+
let e = A();
|
|
36
36
|
const o = new TextDecoder();
|
|
37
|
-
return function(
|
|
38
|
-
if (
|
|
39
|
-
t == null || t(e), e =
|
|
37
|
+
return function(s, i) {
|
|
38
|
+
if (s.length === 0)
|
|
39
|
+
t == null || t(e), e = A();
|
|
40
40
|
else if (i > 0) {
|
|
41
|
-
const
|
|
42
|
-
switch (
|
|
41
|
+
const a = o.decode(s.subarray(0, i)), c = i + (s[i + 1] === 32 ? 2 : 1), l = o.decode(s.subarray(c));
|
|
42
|
+
switch (a) {
|
|
43
43
|
case "data":
|
|
44
44
|
e.data = e.data ? e.data + `
|
|
45
|
-
` +
|
|
45
|
+
` + l : l;
|
|
46
46
|
break;
|
|
47
47
|
case "event":
|
|
48
|
-
e.event =
|
|
48
|
+
e.event = l;
|
|
49
49
|
break;
|
|
50
50
|
case "id":
|
|
51
|
-
r(e.id =
|
|
51
|
+
r(e.id = l);
|
|
52
52
|
break;
|
|
53
53
|
case "retry":
|
|
54
|
-
const f = parseInt(
|
|
54
|
+
const f = parseInt(l, 10);
|
|
55
55
|
isNaN(f) || n(e.retry = f);
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
@@ -62,7 +62,7 @@ function L(r, n) {
|
|
|
62
62
|
const t = new Uint8Array(r.length + n.length);
|
|
63
63
|
return t.set(r), t.set(n, r.length), t;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function A() {
|
|
66
66
|
return {
|
|
67
67
|
data: "",
|
|
68
68
|
event: "",
|
|
@@ -70,7 +70,7 @@ function k() {
|
|
|
70
70
|
retry: void 0
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
var
|
|
73
|
+
var j = function(r, n) {
|
|
74
74
|
var t = {};
|
|
75
75
|
for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && n.indexOf(e) < 0 && (t[e] = r[e]);
|
|
76
76
|
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -78,114 +78,115 @@ var $ = function(r, n) {
|
|
|
78
78
|
n.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, e[o]) && (t[e[o]] = r[e[o]]);
|
|
79
79
|
return t;
|
|
80
80
|
};
|
|
81
|
-
const
|
|
82
|
-
function
|
|
83
|
-
var { signal: t, headers: e, onopen: o, onmessage:
|
|
84
|
-
return new Promise((f,
|
|
85
|
-
const
|
|
86
|
-
|
|
81
|
+
const k = "text/event-stream", x = 1e3, I = "last-event-id";
|
|
82
|
+
function N(r, n) {
|
|
83
|
+
var { signal: t, headers: e, onopen: o, onmessage: g, onclose: s, onerror: i, openWhenHidden: a, fetch: c } = n, l = j(n, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
84
|
+
return new Promise((f, E) => {
|
|
85
|
+
const y = Object.assign({}, e);
|
|
86
|
+
y.accept || (y.accept = k);
|
|
87
87
|
let v;
|
|
88
|
-
function
|
|
89
|
-
v.abort(), document.hidden ||
|
|
88
|
+
function h() {
|
|
89
|
+
v.abort(), document.hidden || O();
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
let
|
|
91
|
+
a || document.addEventListener("visibilitychange", h);
|
|
92
|
+
let d = x, b = 0;
|
|
93
93
|
function u() {
|
|
94
|
-
document.removeEventListener("visibilitychange",
|
|
94
|
+
document.removeEventListener("visibilitychange", h), window.clearTimeout(b), v.abort();
|
|
95
95
|
}
|
|
96
96
|
t == null || t.addEventListener("abort", () => {
|
|
97
97
|
u(), f();
|
|
98
98
|
});
|
|
99
|
-
const
|
|
100
|
-
async function
|
|
101
|
-
var
|
|
99
|
+
const w = c ?? window.fetch, m = o ?? $;
|
|
100
|
+
async function O() {
|
|
101
|
+
var T;
|
|
102
102
|
v = new AbortController();
|
|
103
103
|
try {
|
|
104
|
-
const
|
|
105
|
-
await
|
|
106
|
-
|
|
107
|
-
}, (
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
} catch (
|
|
104
|
+
const S = await w(r, Object.assign(Object.assign({}, l), { headers: y, signal: v.signal }));
|
|
105
|
+
await m(S), await _(S.body, R(P((p) => {
|
|
106
|
+
p ? y[I] = p : delete y[I];
|
|
107
|
+
}, (p) => {
|
|
108
|
+
d = p;
|
|
109
|
+
}, g))), s == null || s(), u(), f();
|
|
110
|
+
} catch (S) {
|
|
111
111
|
if (!v.signal.aborted)
|
|
112
112
|
try {
|
|
113
|
-
const
|
|
114
|
-
window.clearTimeout(
|
|
115
|
-
} catch (
|
|
116
|
-
u(),
|
|
113
|
+
const p = (T = i == null ? void 0 : i(S)) !== null && T !== void 0 ? T : d;
|
|
114
|
+
window.clearTimeout(b), b = window.setTimeout(O, p);
|
|
115
|
+
} catch (p) {
|
|
116
|
+
u(), E(p);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
O();
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function $(r) {
|
|
124
124
|
const n = r.headers.get("content-type");
|
|
125
|
-
if (!(n != null && n.startsWith(
|
|
126
|
-
throw new Error(`Expected content-type to be ${
|
|
125
|
+
if (!(n != null && n.startsWith(k)))
|
|
126
|
+
throw new Error(`Expected content-type to be ${k}, Actual: ${n}`);
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
128
|
+
const C = "/memory/progress/stream", H = 3, W = 1e3, q = /* @__PURE__ */ new Set([401, 403, 404]);
|
|
129
|
+
function U(r) {
|
|
130
130
|
const {
|
|
131
131
|
baseUrl: n = "",
|
|
132
132
|
token: t,
|
|
133
133
|
apiKey: e,
|
|
134
134
|
workspaceId: o,
|
|
135
|
-
runId:
|
|
136
|
-
fromSeq:
|
|
135
|
+
runId: g,
|
|
136
|
+
fromSeq: s,
|
|
137
137
|
since: i,
|
|
138
|
-
onEvent:
|
|
139
|
-
onError:
|
|
140
|
-
onReconnect:
|
|
138
|
+
onEvent: a,
|
|
139
|
+
onError: c,
|
|
140
|
+
onReconnect: l
|
|
141
141
|
} = r, f = new URLSearchParams();
|
|
142
|
-
|
|
143
|
-
const
|
|
142
|
+
g !== void 0 && f.set("run_id", g), s !== void 0 && f.set("from_seq", String(s)), i !== void 0 && f.set("since", i);
|
|
143
|
+
const E = f.toString(), y = `${n}${C}${E ? "?" + E : ""}`, v = {
|
|
144
144
|
Accept: "text/event-stream"
|
|
145
145
|
};
|
|
146
146
|
t ? v.Authorization = `Bearer ${t}` : e && (v["X-API-Key"] = e), o && (v["X-Workspace-Id"] = o);
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
return
|
|
147
|
+
const h = new AbortController();
|
|
148
|
+
let d = !1, b = 0;
|
|
149
|
+
return N(y, {
|
|
150
150
|
headers: v,
|
|
151
|
-
signal:
|
|
151
|
+
signal: h.signal,
|
|
152
152
|
openWhenHidden: !0,
|
|
153
153
|
async onopen(u) {
|
|
154
154
|
if (u.ok) {
|
|
155
|
-
|
|
155
|
+
b = 0;
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
const w = u.status, m = new Error(`SSE connection failed: HTTP ${w}`);
|
|
159
|
+
throw q.has(w) && (d = !0, c(m), h.abort()), m;
|
|
159
160
|
},
|
|
160
161
|
onmessage(u) {
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
let
|
|
162
|
+
if (d || !u.data) return;
|
|
163
|
+
b = 0;
|
|
164
|
+
let w;
|
|
164
165
|
try {
|
|
165
|
-
|
|
166
|
+
w = JSON.parse(u.data);
|
|
166
167
|
} catch {
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
|
-
|
|
170
|
+
a(w);
|
|
170
171
|
},
|
|
171
172
|
onerror(u) {
|
|
172
|
-
if (!
|
|
173
|
-
if (
|
|
174
|
-
|
|
173
|
+
if (!d) {
|
|
174
|
+
if (b += 1, b >= H) {
|
|
175
|
+
c(u), d = !0, h.abort();
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
|
-
return
|
|
178
|
+
return l == null || l(), W * b;
|
|
178
179
|
}
|
|
179
180
|
},
|
|
180
181
|
onclose() {
|
|
181
|
-
|
|
182
|
+
d || (d = !0, c(new Error("SSE connection closed by server")));
|
|
182
183
|
}
|
|
183
184
|
}), {
|
|
184
185
|
close() {
|
|
185
|
-
|
|
186
|
+
d || (d = !0, h.abort());
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
}
|
|
189
190
|
export {
|
|
190
|
-
|
|
191
|
+
U as subscribeProgress
|
|
191
192
|
};
|
package/dist/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import h, { createContext as d, useRef as y, useState as v, useEffect as b, useCallback as c, useContext as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import h, { createContext as d, useRef as y, useState as v, useEffect as b, useCallback as c, useContext as f } from "react";
|
|
2
|
+
import { S as x } from "./core-CLtPrdbi.js";
|
|
3
|
+
const m = d(null), g = d(null);
|
|
4
4
|
function U({ children: e, ...r }) {
|
|
5
5
|
const n = y(null);
|
|
6
6
|
n.current || (n.current = new x(r));
|
|
@@ -23,16 +23,16 @@ function U({ children: e, ...r }) {
|
|
|
23
23
|
}), [t]);
|
|
24
24
|
const s = c(async () => {
|
|
25
25
|
await t.auth.logout();
|
|
26
|
-
}, [t]), A = c((i) => t.auth.hasRole(i), [t]),
|
|
26
|
+
}, [t]), A = c((i) => t.auth.hasRole(i), [t]), S = c((i) => t.auth.getLoginUrl(i), [t]), w = {
|
|
27
27
|
...u,
|
|
28
28
|
logout: s,
|
|
29
29
|
hasRole: A,
|
|
30
|
-
getLoginUrl:
|
|
30
|
+
getLoginUrl: S
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ h.createElement(
|
|
32
|
+
return /* @__PURE__ */ h.createElement(m.Provider, { value: w }, /* @__PURE__ */ h.createElement(g.Provider, { value: t }, e));
|
|
33
33
|
}
|
|
34
34
|
function l() {
|
|
35
|
-
const e = m
|
|
35
|
+
const e = f(m);
|
|
36
36
|
if (!e)
|
|
37
37
|
throw new Error("useAuth must be used within a SmartMemoryProvider");
|
|
38
38
|
return e;
|
|
@@ -46,7 +46,7 @@ function p() {
|
|
|
46
46
|
return { login: e, logout: r, hasRole: n, getLoginUrl: t };
|
|
47
47
|
}
|
|
48
48
|
function E() {
|
|
49
|
-
const e =
|
|
49
|
+
const e = f(g);
|
|
50
50
|
if (!e)
|
|
51
51
|
throw new Error("useSmartMemory must be used within a SmartMemoryProvider");
|
|
52
52
|
return e;
|
|
@@ -66,7 +66,7 @@ function I({ children: e, fallback: r = null, redirectToLogin: n = !1 }) {
|
|
|
66
66
|
return e;
|
|
67
67
|
}
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
m as AuthContext,
|
|
70
70
|
I as AuthWrapper,
|
|
71
71
|
g as ClientContext,
|
|
72
72
|
U as SmartMemoryProvider,
|