@smartmemory/sdk-js 1.4.100 → 1.4.119

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.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-McKeQ81o.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 p, o as S, U as c, W as u } from "./core-BLQpDtod.js";
2
2
  export {
3
3
  e as APIError,
4
4
  r as AgentAPI,
@@ -15,7 +15,8 @@ export {
15
15
  h as SSOManager,
16
16
  f as SmartMemoryClient,
17
17
  l as SubscriptionAPI,
18
- S as TeamAPI,
19
- p as TokenManager,
20
- u as UsageAPI
18
+ p as TeamAPI,
19
+ S as TokenManager,
20
+ c as UsageAPI,
21
+ u as WorkspaceAPI
21
22
  };
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-McKeQ81o.js";
1
+ import { A as f, a as u, b as A, c as P, d as b, e as I, D as h, E as g, G as x, f as p, I as w, L as k, M as m, 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 W, U as $, V as D, W as V, Z } from "./core-BLQpDtod.js";
2
2
  const i = {
3
3
  variables: {
4
4
  colorBackground: "transparent",
@@ -65,13 +65,15 @@ async function l({
65
65
  credentials: "include"
66
66
  });
67
67
  if (!e.ok) {
68
- const t = await e.text().catch(() => "");
69
- throw new Error(t || `Session bootstrap failed (${e.status})`);
68
+ const s = await e.text().catch(() => "");
69
+ throw new Error(s || `Session bootstrap failed (${e.status})`);
70
70
  }
71
+ const t = e.headers.get("x-sm-workspace-id");
71
72
  return {
72
73
  response: e,
73
74
  accessToken: e.headers.get("x-sm-access-token"),
74
- teamId: e.headers.get("x-sm-workspace-id")
75
+ workspaceId: t,
76
+ teamId: t
75
77
  };
76
78
  }
77
79
  export {
@@ -80,15 +82,15 @@ export {
80
82
  A as AnalyticsAPI,
81
83
  P as ArchiveAPI,
82
84
  b as AuthAPI,
83
- h as AuthCore,
85
+ I as AuthCore,
84
86
  i as CLERK_APPEARANCE,
85
- I as DecisionAPI,
87
+ h as DecisionAPI,
86
88
  g as EvolutionAPI,
87
89
  x as GovernanceAPI,
88
90
  p as GraphAPI,
89
91
  w as InsightsAPI,
90
- m as LockAPI,
91
- k as MemoryAPI,
92
+ k as LockAPI,
93
+ m as MemoryAPI,
92
94
  v as OntologyAPI,
93
95
  T as OpinionAPI,
94
96
  B as PipelineAPI,
@@ -103,9 +105,10 @@ export {
103
105
  O as TeamAPI,
104
106
  G as TemporalAPI,
105
107
  U as TokenManager,
106
- $ as TokenUsageAPI,
107
- D as UsageAPI,
108
- V as ValidationAPI,
108
+ W as TokenUsageAPI,
109
+ $ as UsageAPI,
110
+ D as ValidationAPI,
111
+ V as WorkspaceAPI,
109
112
  Z as ZettelkastenAPI,
110
113
  l as exchangeClerkSession,
111
114
  n as getClerkTokenWithRetry
package/dist/react.js CHANGED
@@ -1,40 +1,40 @@
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-McKeQ81o.js";
3
- const m = d(null), f = d(null);
1
+ import h, { createContext as d, useRef as I, useState as S, useEffect as C, useCallback as c, useContext as g } from "react";
2
+ import { l as y } from "./core-BLQpDtod.js";
3
+ const f = d(null), m = d(null);
4
4
  function b({ children: e, ...r }) {
5
- const n = S(null);
5
+ const n = I(null);
6
6
  n.current || (n.current = new y(r));
7
- const t = n.current, [o, u] = p({
7
+ const t = n.current, [o, u] = S({
8
8
  isAuthenticated: t.auth.isAuthenticated(),
9
9
  user: t.auth.getCurrentUser(),
10
10
  token: t.auth.getCurrentToken(),
11
11
  tenantId: t.auth.getTenantId(),
12
- workspaceId: t.auth.tokenManager.getTeamId(),
12
+ workspaceId: t.auth.tokenManager.getWorkspaceId(),
13
13
  loading: !1,
14
14
  error: null
15
15
  });
16
- C(() => t.auth.addListener((i) => {
17
- u((I) => ({
18
- ...I,
19
- isAuthenticated: i.isAuthenticated,
20
- user: i.user,
21
- token: i.token,
22
- tenantId: i.tenantId,
23
- workspaceId: i.workspaceId
16
+ C(() => t.auth.addListener((s) => {
17
+ u((p) => ({
18
+ ...p,
19
+ isAuthenticated: s.isAuthenticated,
20
+ user: s.user,
21
+ token: s.token,
22
+ tenantId: s.tenantId,
23
+ workspaceId: s.workspaceId
24
24
  }));
25
25
  }), [t]);
26
26
  const a = c(async () => {
27
27
  await t.auth.logout();
28
- }, [t]), w = c((s) => t.auth.hasRole(s), [t]), A = c((s) => t.auth.getLoginUrl(s), [t]), k = {
28
+ }, [t]), w = c((i) => t.auth.hasRole(i), [t]), A = c((i) => t.auth.getLoginUrl(i), [t]), k = {
29
29
  ...o,
30
30
  logout: a,
31
31
  hasRole: w,
32
32
  getLoginUrl: A
33
33
  };
34
- return /* @__PURE__ */ h.createElement(m.Provider, { value: k }, /* @__PURE__ */ h.createElement(f.Provider, { value: t }, e));
34
+ return /* @__PURE__ */ h.createElement(f.Provider, { value: k }, /* @__PURE__ */ h.createElement(m.Provider, { value: t }, e));
35
35
  }
36
36
  function l() {
37
- const e = g(m);
37
+ const e = g(f);
38
38
  if (!e)
39
39
  throw new Error("useAuth must be used within a SmartMemoryProvider");
40
40
  return e;
@@ -48,7 +48,7 @@ function R() {
48
48
  return { login: e, logout: r, hasRole: n, getLoginUrl: t };
49
49
  }
50
50
  function U() {
51
- const e = g(f);
51
+ const e = g(m);
52
52
  if (!e)
53
53
  throw new Error("useSmartMemory must be used within a SmartMemoryProvider");
54
54
  return e;
@@ -68,9 +68,9 @@ function E({ children: e, fallback: r = null, redirectToLogin: n = !1 }) {
68
68
  return e;
69
69
  }
70
70
  export {
71
- m as AuthContext,
71
+ f as AuthContext,
72
72
  E as AuthWrapper,
73
- f as ClientContext,
73
+ m as ClientContext,
74
74
  b as SmartMemoryProvider,
75
75
  l as useAuth,
76
76
  R as useAuthActions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartmemory/sdk-js",
3
- "version": "1.4.100",
3
+ "version": "1.4.119",
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",