@axiom-lattice/react-sdk 4.10.0 → 4.11.0

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.
Files changed (70) hide show
  1. package/dist/{AgentDetailSideApp-EQDCKCXY.mjs → AgentDetailSideApp-ZGV4WC4V.mjs} +8 -8
  2. package/dist/AgentGovernanceWorkbench-HCVHQ3P7.mjs +20 -0
  3. package/dist/{MessageGraph-WWTTGLD7.mjs → MessageGraph-OA2HMEHI.mjs} +4 -4
  4. package/dist/{ReactChart-AOJAFAZM.mjs → ReactChart-DWIFRI5G.mjs} +4 -4
  5. package/dist/{SkillFlow-3ZGSHMHW.mjs → SkillFlow-IHRME3YO.mjs} +4 -4
  6. package/dist/{TasksSideApp-42BLTNY4.mjs → TasksSideApp-KKBQDSO4.mjs} +5 -5
  7. package/dist/{TeamWorkspace-U2IO3W4F.mjs → TeamWorkspace-ETVDJAYT.mjs} +4 -4
  8. package/dist/{TopologyRuntimeView-KJQVVUGE.mjs → TopologyRuntimeView-F7JQAXN2.mjs} +5 -5
  9. package/dist/{WorkflowAutomationView-3L3IMYYG.mjs → WorkflowAutomationView-PBZ5K43L.mjs} +7 -7
  10. package/dist/{chunk-4CGRA733.mjs → chunk-3FXH5ZAQ.mjs} +3 -3
  11. package/dist/{chunk-ECHGNV43.mjs → chunk-3MF4SALK.mjs} +6 -6
  12. package/dist/{chunk-HG7UMQO2.mjs → chunk-3SEKZBYQ.mjs} +3 -3
  13. package/dist/{chunk-HJDE5RQJ.mjs → chunk-57IPUJ5T.mjs} +3 -3
  14. package/dist/{chunk-TBQVOSCN.mjs → chunk-6XGZ74LQ.mjs} +24 -18
  15. package/dist/chunk-6XGZ74LQ.mjs.map +1 -0
  16. package/dist/{chunk-ZHOCTUDR.mjs → chunk-EHUPRLAS.mjs} +38 -10
  17. package/dist/chunk-EHUPRLAS.mjs.map +1 -0
  18. package/dist/{chunk-CRGVJY56.mjs → chunk-JQLUFZKH.mjs} +6 -6
  19. package/dist/{chunk-QTXQT77Q.mjs → chunk-KU634FOH.mjs} +4 -4
  20. package/dist/{chunk-XVZUC4U3.mjs → chunk-PEEXMLMK.mjs} +21 -5
  21. package/dist/chunk-PEEXMLMK.mjs.map +1 -0
  22. package/dist/{chunk-JNP2AHRT.mjs → chunk-TA243DB6.mjs} +36 -3
  23. package/dist/chunk-TA243DB6.mjs.map +1 -0
  24. package/dist/{embed-page-AgentDetailSideApp-GH3XNS5A.js → embed-page-AgentDetailSideApp-RM4TDSC5.js} +1 -1
  25. package/dist/{embed-page-AgentGovernanceWorkbench-AXHLZTUG.js → embed-page-AgentGovernanceWorkbench-G6A6QNZY.js} +1 -1
  26. package/dist/{embed-page-MessageGraph-HLLPBTLQ.js → embed-page-MessageGraph-ZLGTKJNE.js} +1 -1
  27. package/dist/{embed-page-ReactChart-46EYPRQ7.js → embed-page-ReactChart-IB6R6G57.js} +1 -1
  28. package/dist/{embed-page-SkillFlow-NMUDTNTY.js → embed-page-SkillFlow-STU36L34.js} +1 -1
  29. package/dist/{embed-page-TasksSideApp-DOCKHJCF.js → embed-page-TasksSideApp-X4APWG4G.js} +1 -1
  30. package/dist/{embed-page-TeamWorkspace-LXOIMYRW.js → embed-page-TeamWorkspace-EK4BNNGD.js} +1 -1
  31. package/dist/{embed-page-TopologyRuntimeView-DT7XXEK2.js → embed-page-TopologyRuntimeView-X5CHJPHN.js} +1 -1
  32. package/dist/{embed-page-WorkflowAutomationView-ONAY4RTM.js → embed-page-WorkflowAutomationView-3LIT27E2.js} +1 -1
  33. package/dist/{embed-page-chunk-JQSBSZMP.js → embed-page-chunk-5WPKSLDW.js} +1 -1
  34. package/dist/embed-page-chunk-64FTYZ5F.js +2 -0
  35. package/dist/{embed-page-chunk-LGZUYB7B.js → embed-page-chunk-734QFJP3.js} +1 -1
  36. package/dist/{embed-page-chunk-RA35MUYW.js → embed-page-chunk-7D54ACES.js} +1 -1
  37. package/dist/{embed-page-chunk-OY4CDWED.js → embed-page-chunk-DDK2VFYD.js} +7 -7
  38. package/dist/{embed-page-chunk-F7G2DME5.js → embed-page-chunk-EQRDCFN5.js} +1 -1
  39. package/dist/{embed-page-chunk-H4W4NDIY.js → embed-page-chunk-W45YCZIC.js} +7 -7
  40. package/dist/embed-page.js +1 -1
  41. package/dist/index.d.mts +41 -3
  42. package/dist/index.d.ts +41 -3
  43. package/dist/index.js +211 -125
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +10 -10
  46. package/dist/web-app.js +1 -6
  47. package/dist/web-app.js.map +1 -1
  48. package/dist/web-app.mjs +1 -1
  49. package/package.json +3 -3
  50. package/dist/AgentGovernanceWorkbench-2HCQ4POL.mjs +0 -20
  51. package/dist/chunk-JNP2AHRT.mjs.map +0 -1
  52. package/dist/chunk-TBQVOSCN.mjs.map +0 -1
  53. package/dist/chunk-XVZUC4U3.mjs.map +0 -1
  54. package/dist/chunk-ZHOCTUDR.mjs.map +0 -1
  55. package/dist/embed-page-chunk-NR2PTMJ6.js +0 -2
  56. /package/dist/{AgentDetailSideApp-EQDCKCXY.mjs.map → AgentDetailSideApp-ZGV4WC4V.mjs.map} +0 -0
  57. /package/dist/{AgentGovernanceWorkbench-2HCQ4POL.mjs.map → AgentGovernanceWorkbench-HCVHQ3P7.mjs.map} +0 -0
  58. /package/dist/{MessageGraph-WWTTGLD7.mjs.map → MessageGraph-OA2HMEHI.mjs.map} +0 -0
  59. /package/dist/{ReactChart-AOJAFAZM.mjs.map → ReactChart-DWIFRI5G.mjs.map} +0 -0
  60. /package/dist/{SkillFlow-3ZGSHMHW.mjs.map → SkillFlow-IHRME3YO.mjs.map} +0 -0
  61. /package/dist/{TasksSideApp-42BLTNY4.mjs.map → TasksSideApp-KKBQDSO4.mjs.map} +0 -0
  62. /package/dist/{TeamWorkspace-U2IO3W4F.mjs.map → TeamWorkspace-ETVDJAYT.mjs.map} +0 -0
  63. /package/dist/{TopologyRuntimeView-KJQVVUGE.mjs.map → TopologyRuntimeView-F7JQAXN2.mjs.map} +0 -0
  64. /package/dist/{WorkflowAutomationView-3L3IMYYG.mjs.map → WorkflowAutomationView-PBZ5K43L.mjs.map} +0 -0
  65. /package/dist/{chunk-4CGRA733.mjs.map → chunk-3FXH5ZAQ.mjs.map} +0 -0
  66. /package/dist/{chunk-ECHGNV43.mjs.map → chunk-3MF4SALK.mjs.map} +0 -0
  67. /package/dist/{chunk-HG7UMQO2.mjs.map → chunk-3SEKZBYQ.mjs.map} +0 -0
  68. /package/dist/{chunk-HJDE5RQJ.mjs.map → chunk-57IPUJ5T.mjs.map} +0 -0
  69. /package/dist/{chunk-CRGVJY56.mjs.map → chunk-JQLUFZKH.mjs.map} +0 -0
  70. /package/dist/{chunk-QTXQT77Q.mjs.map → chunk-KU634FOH.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -6803,18 +6803,19 @@ var init_useT = __esm({
6803
6803
  // src/i18n/useLocale.ts
6804
6804
 
6805
6805
  function useLocale() {
6806
- return _react.useContext.call(void 0, LocaleBridgeContext);
6806
+ return _nullishCoalesce(_react.useContext.call(void 0, LocaleBridgeContext), () => ( INERT_LOCALE_BRIDGE));
6807
6807
  }
6808
- var LocaleBridgeContext;
6808
+ var INERT_LOCALE_BRIDGE, LocaleBridgeContext;
6809
6809
  var init_useLocale = __esm({
6810
6810
  "src/i18n/useLocale.ts"() {
6811
6811
  "use strict";
6812
6812
  init_instance();
6813
- LocaleBridgeContext = _react.createContext.call(void 0, {
6813
+ INERT_LOCALE_BRIDGE = {
6814
6814
  locale: "en-US",
6815
6815
  setLocale: () => void 0,
6816
6816
  supportedLocales: SUPPORTED_LOCALES
6817
- });
6817
+ };
6818
+ LocaleBridgeContext = _react.createContext.call(void 0, null);
6818
6819
  }
6819
6820
  });
6820
6821
 
@@ -6887,6 +6888,25 @@ var init_LatticeLocaleProvider = __esm({
6887
6888
  }
6888
6889
  });
6889
6890
 
6891
+ // src/i18n/localeStorage.ts
6892
+ function readStoredLocale(storageKey = DEFAULT_LOCALE_STORAGE_KEY) {
6893
+ if (typeof window === "undefined") return void 0;
6894
+ try {
6895
+ const stored = window.localStorage.getItem(storageKey);
6896
+ return stored !== null && SUPPORTED_LOCALES.includes(stored) ? stored : void 0;
6897
+ } catch (e19) {
6898
+ return void 0;
6899
+ }
6900
+ }
6901
+ var DEFAULT_LOCALE_STORAGE_KEY;
6902
+ var init_localeStorage = __esm({
6903
+ "src/i18n/localeStorage.ts"() {
6904
+ "use strict";
6905
+ init_instance();
6906
+ DEFAULT_LOCALE_STORAGE_KEY = "lattice.locale";
6907
+ }
6908
+ });
6909
+
6890
6910
  // src/i18n/index.ts
6891
6911
  var init_i18n = __esm({
6892
6912
  "src/i18n/index.ts"() {
@@ -6894,6 +6914,7 @@ var init_i18n = __esm({
6894
6914
  init_useT();
6895
6915
  init_useLocale();
6896
6916
  init_LatticeLocaleProvider();
6917
+ init_localeStorage();
6897
6918
  init_instance();
6898
6919
  }
6899
6920
  });
@@ -6951,7 +6972,7 @@ var init_AuthContext = __esm({
6951
6972
  const storedPA = readAuthItem(getPAKey(ct.id));
6952
6973
  if (storedPA) setPersonalAssistant(JSON.parse(storedPA));
6953
6974
  }
6954
- } catch (e19) {
6975
+ } catch (e20) {
6955
6976
  removeAuthItem("lattice_user");
6956
6977
  removeAuthItem("lattice_tenants");
6957
6978
  removeAuthItem("lattice_current_tenant");
@@ -7246,8 +7267,12 @@ function AxiomLatticeProvider({
7246
7267
  config,
7247
7268
  onUnauthorized,
7248
7269
  createClient,
7270
+ locale: locale3,
7271
+ storageKey = DEFAULT_LOCALE_STORAGE_KEY,
7272
+ onLocaleChange,
7249
7273
  children: children2
7250
7274
  }) {
7275
+ const localeProvidedAbove = _react.useContext.call(void 0, LocaleBridgeContext) !== null;
7251
7276
  const authContext = _react.useContext.call(void 0, AuthContext);
7252
7277
  const tenantId = _optionalChain([authContext, 'optionalAccess', _38 => _38.currentTenant, 'optionalAccess', _39 => _39.id]);
7253
7278
  const effectiveApiKey = _react.useMemo.call(void 0, () => {
@@ -7306,7 +7331,32 @@ function AxiomLatticeProvider({
7306
7331
  }),
7307
7332
  [getClient]
7308
7333
  );
7309
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.App, { component: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AxiomLatticeContext.Provider, { value, children: children2 }) });
7334
+ const initialLocale = _react.useMemo.call(void 0,
7335
+ () => _nullishCoalesce(_nullishCoalesce(locale3, () => ( readStoredLocale(storageKey))), () => ( "en-US")),
7336
+ [locale3, storageKey]
7337
+ );
7338
+ const handleLocaleChange = _react.useMemo.call(void 0,
7339
+ () => _nullishCoalesce(onLocaleChange, () => ( (() => {
7340
+ if (typeof window !== "undefined") window.location.reload();
7341
+ }))),
7342
+ [onLocaleChange]
7343
+ );
7344
+ const content = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AxiomLatticeContext.Provider, { value, children: children2 });
7345
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _antd.App, { component: false, children: localeProvidedAbove ? content : (
7346
+ /* No locale layer above: supply one so a host that mounts only this
7347
+ * provider gets real copy and a working switch, not raw keys. The
7348
+ * dictionaries it loads are what `useT()` below would otherwise render
7349
+ * as keys. */
7350
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7351
+ LatticeLocaleProvider,
7352
+ {
7353
+ locale: initialLocale,
7354
+ storageKey,
7355
+ onLocaleChange: handleLocaleChange,
7356
+ children: content
7357
+ }
7358
+ )
7359
+ ) });
7310
7360
  }
7311
7361
  function useClient(assistantId) {
7312
7362
  const context = _react.useContext.call(void 0, AxiomLatticeContext);
@@ -7339,6 +7389,9 @@ var init_context = __esm({
7339
7389
  "use strict";
7340
7390
  init_AuthContext();
7341
7391
  init_authStorage();
7392
+ init_LatticeLocaleProvider();
7393
+ init_useLocale();
7394
+ init_localeStorage();
7342
7395
  AxiomLatticeContext = _react.createContext.call(void 0, {
7343
7396
  getClient: () => {
7344
7397
  throw new Error("getClient must be used within AxiomLatticeProvider");
@@ -9221,7 +9274,7 @@ var init_LoginForm = __esm({
9221
9274
  try {
9222
9275
  await login(values.email, values.password);
9223
9276
  _optionalChain([onSuccess, 'optionalCall', _76 => _76()]);
9224
- } catch (e20) {
9277
+ } catch (e21) {
9225
9278
  }
9226
9279
  };
9227
9280
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _antd.Card, { className: `${styles.card} ${className}`, style: { width: 400 }, children: [
@@ -10280,7 +10333,7 @@ function useUsers(options) {
10280
10333
  }
10281
10334
  const { data } = await response.json();
10282
10335
  return _optionalChain([data, 'optionalAccess', _97 => _97[0]]) || null;
10283
- } catch (e21) {
10336
+ } catch (e23) {
10284
10337
  return null;
10285
10338
  }
10286
10339
  }, [baseURL, tenantId, token]);
@@ -15235,7 +15288,7 @@ var init_TenantModelProvidersModal = __esm({
15235
15288
  let parsed;
15236
15289
  try {
15237
15290
  parsed = JSON.parse(raw);
15238
- } catch (e23) {
15291
+ } catch (e24) {
15239
15292
  _antd.message.error(t4("auth.modelProviders.extraInvalidJson"));
15240
15293
  return;
15241
15294
  }
@@ -18004,7 +18057,7 @@ function readStoredOptIn() {
18004
18057
  if (typeof window === "undefined") return false;
18005
18058
  try {
18006
18059
  return window.localStorage.getItem(STORAGE_KEY) === "1";
18007
- } catch (e24) {
18060
+ } catch (e25) {
18008
18061
  return false;
18009
18062
  }
18010
18063
  }
@@ -18027,7 +18080,7 @@ function setInPageOptIn(value) {
18027
18080
  try {
18028
18081
  if (value) window.localStorage.setItem(STORAGE_KEY, "1");
18029
18082
  else window.localStorage.removeItem(STORAGE_KEY);
18030
- } catch (e25) {
18083
+ } catch (e26) {
18031
18084
  }
18032
18085
  }
18033
18086
  emit();
@@ -18105,7 +18158,7 @@ async function detectPushSubscription() {
18105
18158
  if (subscription === null) return null;
18106
18159
  setPushSubscribed(true);
18107
18160
  return subscription;
18108
- } catch (e26) {
18161
+ } catch (e27) {
18109
18162
  return null;
18110
18163
  }
18111
18164
  }
@@ -18153,7 +18206,7 @@ function useWebPush(options = {}) {
18153
18206
  const payload = await response.json();
18154
18207
  const key = _optionalChain([payload, 'access', _260 => _260.data, 'optionalAccess', _261 => _261.publicKey]);
18155
18208
  return typeof key === "string" && key.length > 0 ? key : null;
18156
- } catch (e27) {
18209
+ } catch (e28) {
18157
18210
  return null;
18158
18211
  }
18159
18212
  }, [options.vapidPublicKey, vapidKeyUrl]);
@@ -18205,7 +18258,7 @@ function useWebPush(options = {}) {
18205
18258
  }
18206
18259
  setSubscribed(false);
18207
18260
  setPushSubscribed(false);
18208
- } catch (e28) {
18261
+ } catch (e29) {
18209
18262
  setSubscribed(false);
18210
18263
  setPushSubscribed(false);
18211
18264
  }
@@ -18768,7 +18821,7 @@ function ScopedRoomEventsProvider({ workspaceId, client, children: children2 })
18768
18821
  window.focus();
18769
18822
  notification.close();
18770
18823
  };
18771
- } catch (e29) {
18824
+ } catch (e30) {
18772
18825
  }
18773
18826
  }, [selfUserId, t4]);
18774
18827
  const launchStream = _react.useCallback.call(void 0, (generation) => {
@@ -21553,7 +21606,7 @@ var init_MarkdownViewer = __esm({
21553
21606
  } else {
21554
21607
  name = url.pathname.split("/").pop() || name;
21555
21608
  }
21556
- } catch (e30) {
21609
+ } catch (e31) {
21557
21610
  name = name.split("/").pop() || name;
21558
21611
  }
21559
21612
  } else {
@@ -21923,7 +21976,7 @@ var init_ShareModal = __esm({
21923
21976
  try {
21924
21977
  const all = await listShares();
21925
21978
  setShares(all.filter((r6) => filePathMatch(r6, filePath) && !r6.revoked));
21926
- } catch (e31) {
21979
+ } catch (e32) {
21927
21980
  }
21928
21981
  setLoading(false);
21929
21982
  }, [listShares, filePath]);
@@ -21976,7 +22029,7 @@ ${pwdText}`.trim());
21976
22029
  await unshareFile(token);
21977
22030
  _antd.message.success(t4("genui.share.revoked"));
21978
22031
  loadShares();
21979
- } catch (e32) {
22032
+ } catch (e33) {
21980
22033
  _antd.message.error(t4("genui.share.revokeFailed"));
21981
22034
  }
21982
22035
  }, [unshareFile, loadShares, t4]);
@@ -22123,7 +22176,7 @@ function parseEmbedContent(children2) {
22123
22176
  if (content.startsWith("{")) {
22124
22177
  try {
22125
22178
  return JSON.parse(content);
22126
- } catch (e33) {
22179
+ } catch (e34) {
22127
22180
  return { path: content };
22128
22181
  }
22129
22182
  }
@@ -22220,7 +22273,7 @@ var init_Embed = __esm({
22220
22273
  if (embedConfig.url) {
22221
22274
  try {
22222
22275
  return new URL(embedConfig.url).pathname.split("/").pop() || embedConfig.url;
22223
- } catch (e34) {
22276
+ } catch (e35) {
22224
22277
  return embedConfig.url;
22225
22278
  }
22226
22279
  }
@@ -33373,7 +33426,7 @@ function isLinkLoaded(link3) {
33373
33426
  return true;
33374
33427
  try {
33375
33428
  return !!link3.sheet;
33376
- } catch (e35) {
33429
+ } catch (e36) {
33377
33430
  return false;
33378
33431
  }
33379
33432
  }
@@ -33909,7 +33962,7 @@ var init_svg = __esm({
33909
33962
  function isRemoteResource(resource) {
33910
33963
  try {
33911
33964
  return Boolean(new URL(resource));
33912
- } catch (e36) {
33965
+ } catch (e37) {
33913
33966
  return false;
33914
33967
  }
33915
33968
  }
@@ -34236,7 +34289,7 @@ async function getResource(scene, config, datum2) {
34236
34289
  if (customLoader)
34237
34290
  resource = await customLoader(cfg);
34238
34291
  }
34239
- } catch (e37) {
34292
+ } catch (e38) {
34240
34293
  resource = null;
34241
34294
  }
34242
34295
  if (resource)
@@ -37520,7 +37573,7 @@ function isBrowser() {
37520
37573
  const rect = el.getBoundingClientRect();
37521
37574
  body.removeChild(el);
37522
37575
  hasRealLayout = rect.width === 37 && rect.height === 19 && rect.left !== 0 && rect.top !== 0;
37523
- } catch (e38) {
37576
+ } catch (e39) {
37524
37577
  hasRealLayout = false;
37525
37578
  }
37526
37579
  if (!hasRealLayout) {
@@ -37538,7 +37591,7 @@ function isBrowser() {
37538
37591
  ctx.font = "20px sans-serif";
37539
37592
  const metrics = ctx.measureText("Hello");
37540
37593
  hasRealCanvas = typeof metrics.width === "number" && metrics.width > 0 && metrics.width < 1e3;
37541
- } catch (e39) {
37594
+ } catch (e40) {
37542
37595
  hasRealCanvas = false;
37543
37596
  }
37544
37597
  if (hasRealCanvas)
@@ -37871,7 +37924,7 @@ function setTextContent(text, content) {
37871
37924
  if (entity) {
37872
37925
  try {
37873
37926
  entity.innerText = content;
37874
- } catch (e40) {
37927
+ } catch (e41) {
37875
37928
  entity.textContent = content;
37876
37929
  }
37877
37930
  }
@@ -38371,7 +38424,7 @@ function setSVGPadding(svg2, padding) {
38371
38424
  childList: true,
38372
38425
  subtree: true
38373
38426
  });
38374
- } catch (e41) {
38427
+ } catch (e42) {
38375
38428
  setSVGPaddingInNode(svg2, padding);
38376
38429
  }
38377
38430
  }
@@ -87545,7 +87598,7 @@ function linkifySandboxPaths(src, options) {
87545
87598
  let blocks;
87546
87599
  try {
87547
87600
  blocks = _marked.lexer.call(void 0, src);
87548
- } catch (e42) {
87601
+ } catch (e43) {
87549
87602
  return src;
87550
87603
  }
87551
87604
  const ranges2 = [];
@@ -88213,7 +88266,7 @@ function useVoiceRecorder(options) {
88213
88266
  }));
88214
88267
  };
88215
88268
  recorder.start(timeslice);
88216
- } catch (e43) {
88269
+ } catch (e44) {
88217
88270
  cleanupAudio();
88218
88271
  setState((prev) => ({
88219
88272
  ...prev,
@@ -89098,7 +89151,7 @@ var init_ToolCard = __esm({
89098
89151
  try {
89099
89152
  const jsonStr = JSON.stringify(value, null, 2);
89100
89153
  return jsonStr.length > 100 ? JSON.stringify(value) : jsonStr;
89101
- } catch (e44) {
89154
+ } catch (e45) {
89102
89155
  return String(value);
89103
89156
  }
89104
89157
  }
@@ -89519,7 +89572,7 @@ function toolResponseText(response) {
89519
89572
  try {
89520
89573
  const json2 = JSON.stringify(response);
89521
89574
  return typeof json2 === "string" ? json2 : "";
89522
- } catch (e45) {
89575
+ } catch (e46) {
89523
89576
  return "";
89524
89577
  }
89525
89578
  }
@@ -89540,7 +89593,7 @@ function extractUiRef(response) {
89540
89593
  if (!match) return null;
89541
89594
  try {
89542
89595
  return _protocols.parseMcpUiRef.call(void 0, JSON.parse(match[1].trim()));
89543
- } catch (e46) {
89596
+ } catch (e47) {
89544
89597
  return null;
89545
89598
  }
89546
89599
  }
@@ -89567,7 +89620,7 @@ function gatewayOriginOf(client) {
89567
89620
  if (!baseURL) return null;
89568
89621
  try {
89569
89622
  return new URL(baseURL, window.location.origin).origin;
89570
- } catch (e47) {
89623
+ } catch (e48) {
89571
89624
  return null;
89572
89625
  }
89573
89626
  }
@@ -89691,7 +89744,7 @@ var init_McpAppRenderer = __esm({
89691
89744
  };
89692
89745
  latestRef.current.openSideApp(card);
89693
89746
  return "fullscreen";
89694
- } catch (e48) {
89747
+ } catch (e49) {
89695
89748
  return "inline";
89696
89749
  }
89697
89750
  },
@@ -89998,7 +90051,7 @@ function parseManageEvalResponse(response) {
89998
90051
  return parsed;
89999
90052
  }
90000
90053
  return { success: true, data: parsed };
90001
- } catch (e49) {
90054
+ } catch (e50) {
90002
90055
  return { success: true, data: void 0 };
90003
90056
  }
90004
90057
  }
@@ -90666,7 +90719,7 @@ var init_EvalSuiteDetail = __esm({
90666
90719
  setAgentsLoading(true);
90667
90720
  try {
90668
90721
  setAgents(await client.assistants.list());
90669
- } catch (e50) {
90722
+ } catch (e51) {
90670
90723
  _antd.message.error(t4("eval.case.loadAgentsFailed"));
90671
90724
  } finally {
90672
90725
  setAgentsLoading(false);
@@ -91812,7 +91865,7 @@ var init_eval_detail_side_app = __esm({
91812
91865
  }
91813
91866
  }
91814
91867
  if (!cancelled) setResolved(rawInitial);
91815
- } catch (e51) {
91868
+ } catch (e52) {
91816
91869
  if (!cancelled) setResolved(rawInitial);
91817
91870
  }
91818
91871
  })();
@@ -96081,7 +96134,7 @@ function parseTaskExecution(response) {
96081
96134
  try {
96082
96135
  const parsed = JSON.parse(response);
96083
96136
  if (parsed && typeof parsed === "object") return parsed;
96084
- } catch (e52) {
96137
+ } catch (e53) {
96085
96138
  return void 0;
96086
96139
  }
96087
96140
  return void 0;
@@ -96091,7 +96144,7 @@ function parseTaskResult(response, t4) {
96091
96144
  let parsed;
96092
96145
  try {
96093
96146
  parsed = JSON.parse(response);
96094
- } catch (e53) {
96147
+ } catch (e54) {
96095
96148
  return { kind: "raw", text: response };
96096
96149
  }
96097
96150
  if (!parsed || typeof parsed !== "object") return { kind: "raw", text: response };
@@ -96136,7 +96189,7 @@ async function resolveExecutionThreadId(client, taskId, response, contextThreadI
96136
96189
  }
96137
96190
  }
96138
96191
  return latest;
96139
- } catch (e54) {
96192
+ } catch (e55) {
96140
96193
  return void 0;
96141
96194
  }
96142
96195
  }
@@ -103249,7 +103302,7 @@ function parseInterruptFence(value) {
103249
103302
  try {
103250
103303
  const parsed = JSON.parse(match[2]);
103251
103304
  return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? { key: match[1], data: parsed } : void 0;
103252
- } catch (e55) {
103305
+ } catch (e56) {
103253
103306
  return void 0;
103254
103307
  }
103255
103308
  }
@@ -105423,14 +105476,14 @@ var init_ModelSelector = __esm({
105423
105476
  getStoredModelKey = () => {
105424
105477
  try {
105425
105478
  return sessionStorage.getItem(STORAGE_KEY2);
105426
- } catch (e56) {
105479
+ } catch (e57) {
105427
105480
  return null;
105428
105481
  }
105429
105482
  };
105430
105483
  setStoredModelKey = (key) => {
105431
105484
  try {
105432
105485
  sessionStorage.setItem(STORAGE_KEY2, key);
105433
- } catch (e57) {
105486
+ } catch (e58) {
105434
105487
  }
105435
105488
  };
105436
105489
  ModelSelector = exports.ModelSelector = ({
@@ -106491,7 +106544,7 @@ function InitialMessageSubmitter({
106491
106544
  throwOnError: true,
106492
106545
  ...request.customRunConfig ? { customRunConfig: request.customRunConfig } : {}
106493
106546
  });
106494
- } catch (e58) {
106547
+ } catch (e59) {
106495
106548
  requestRegistryRef.current.delete(requestId);
106496
106549
  return;
106497
106550
  }
@@ -107523,7 +107576,7 @@ var init_internet_search_card = __esm({
107523
107576
  try {
107524
107577
  const urlObj = new URL(url);
107525
107578
  return urlObj.hostname.replace(/^www\./, "");
107526
- } catch (e59) {
107579
+ } catch (e60) {
107527
107580
  return url;
107528
107581
  }
107529
107582
  };
@@ -108193,7 +108246,7 @@ var init_TeamGraph = __esm({
108193
108246
  teammates: Array.isArray(_optionalChain([parsed, 'optionalAccess', _1563 => _1563.teammates])) ? parsed.teammates : [],
108194
108247
  tasks: Array.isArray(_optionalChain([parsed, 'optionalAccess', _1564 => _1564.tasks])) ? parsed.tasks : []
108195
108248
  };
108196
- } catch (e60) {
108249
+ } catch (e61) {
108197
108250
  return null;
108198
108251
  }
108199
108252
  }
@@ -114129,7 +114182,7 @@ var init_TaskCreateModal = __esm({
114129
114182
  });
114130
114183
  form.resetFields();
114131
114184
  onClose();
114132
- } catch (e61) {
114185
+ } catch (e62) {
114133
114186
  } finally {
114134
114187
  setLoading(false);
114135
114188
  }
@@ -114226,7 +114279,7 @@ var init_useOpenTaskChat = __esm({
114226
114279
  if (!task) return;
114227
114280
  try {
114228
114281
  openSideApp(buildTaskChatCard(task, threadId));
114229
- } catch (e62) {
114282
+ } catch (e63) {
114230
114283
  console.warn("Cannot open task chat: ChatUIContextProvider is not mounted");
114231
114284
  }
114232
114285
  },
@@ -114495,7 +114548,7 @@ var init_TasksSideApp = __esm({
114495
114548
  return refreshedTask ? [refreshedTask] : [];
114496
114549
  }));
114497
114550
  }
114498
- } catch (e63) {
114551
+ } catch (e64) {
114499
114552
  if (requestGeneration === tasksRequestGenerationRef.current && latestFilterScopeRef.current === requestedScope) {
114500
114553
  setTasksError(tasksRef.current.length > 0 ? t4("tasks.error.refresh") : t4("tasks.error.load"));
114501
114554
  }
@@ -114514,7 +114567,7 @@ var init_TasksSideApp = __esm({
114514
114567
  if (requestGeneration === workItemsRequestGenerationRef.current && selectedTaskIdRef.current === taskId) {
114515
114568
  setWorkItems(result);
114516
114569
  }
114517
- } catch (e64) {
114570
+ } catch (e65) {
114518
114571
  if (requestGeneration === workItemsRequestGenerationRef.current && selectedTaskIdRef.current === taskId) {
114519
114572
  setWorkItems([]);
114520
114573
  setActivityError(t4("tasks.error.activity"));
@@ -114612,7 +114665,7 @@ var init_TasksSideApp = __esm({
114612
114665
  messageApi.success(t4("tasks.created"));
114613
114666
  void fetchTasks();
114614
114667
  setShowCreate(false);
114615
- } catch (e65) {
114668
+ } catch (e66) {
114616
114669
  messageApi.error(t4("tasks.error.create"));
114617
114670
  }
114618
114671
  },
@@ -118755,7 +118808,7 @@ function errorText(error, t4) {
118755
118808
  try {
118756
118809
  const serialized = JSON.stringify(error);
118757
118810
  if (serialized !== void 0 && serialized !== "{}") return formatErrorMessage(serialized, fallback);
118758
- } catch (e66) {
118811
+ } catch (e67) {
118759
118812
  }
118760
118813
  return fallback;
118761
118814
  }
@@ -119927,7 +119980,7 @@ var init_ProjectRoomTasksPanel = __esm({
119927
119980
  try {
119928
119981
  const result = await client.tasks.workItems.list(task.id);
119929
119982
  if (generation === workItemsGenerationRef.current) setWorkItems(result);
119930
- } catch (e67) {
119983
+ } catch (e68) {
119931
119984
  if (generation === workItemsGenerationRef.current) {
119932
119985
  setWorkItems([]);
119933
119986
  setActivityError(t4("projectRoom.tasks.activityFailed"));
@@ -124090,7 +124143,7 @@ var init_ProjectGeneralSettings = __esm({
124090
124143
  let values;
124091
124144
  try {
124092
124145
  values = await form.validateFields();
124093
- } catch (e68) {
124146
+ } catch (e69) {
124094
124147
  return;
124095
124148
  }
124096
124149
  setSaving(true);
@@ -124707,7 +124760,7 @@ var init_ProjectCapabilityPanel = __esm({
124707
124760
  const afterEdit = async () => {
124708
124761
  try {
124709
124762
  await state2.previewDraft();
124710
- } catch (e69) {
124763
+ } catch (e70) {
124711
124764
  }
124712
124765
  };
124713
124766
  const addProfile = (bundleId) => {
@@ -126169,7 +126222,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126169
126222
  setTypeMeta({ type: connectionType, name: connectionType, description: "" });
126170
126223
  }
126171
126224
  }
126172
- } catch (e70) {
126225
+ } catch (e71) {
126173
126226
  setTypeMeta({ type: connectionType, name: connectionType, description: "" });
126174
126227
  } finally {
126175
126228
  setMetaLoading(false);
@@ -126187,7 +126240,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126187
126240
  _antd.message.error(result.message || t4("chatConfig.connection.loadFailed"));
126188
126241
  setConfigs([]);
126189
126242
  }
126190
- } catch (e71) {
126243
+ } catch (e72) {
126191
126244
  _antd.message.error(t4("chatConfig.connection.loadFailed"));
126192
126245
  setConfigs([]);
126193
126246
  } finally {
@@ -126207,7 +126260,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126207
126260
  } else {
126208
126261
  _antd.message.error(result.message || t4("chatConfig.connection.testFailed"));
126209
126262
  }
126210
- } catch (e72) {
126263
+ } catch (e73) {
126211
126264
  _antd.message.error(t4("chatConfig.connection.testError"));
126212
126265
  } finally {
126213
126266
  setTestingId(null);
@@ -126232,7 +126285,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126232
126285
  } else {
126233
126286
  _antd.message.error(result.message || t4("chatConfig.connection.deleteFailed"));
126234
126287
  }
126235
- } catch (e73) {
126288
+ } catch (e74) {
126236
126289
  _antd.message.error(t4("chatConfig.connection.deleteFailed"));
126237
126290
  }
126238
126291
  };
@@ -126425,7 +126478,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126425
126478
  setSelectedResources(discoverResult.resources.map((r6) => r6.id));
126426
126479
  }
126427
126480
  }
126428
- } catch (e74) {
126481
+ } catch (e75) {
126429
126482
  setTestResult({ ok: false, message: t4("chatConfig.connectionForm.testRequestFailed") });
126430
126483
  } finally {
126431
126484
  setTesting(false);
@@ -126479,7 +126532,7 @@ var init_ConnectionConfigDrawerContent = __esm({
126479
126532
  } else {
126480
126533
  _antd.message.error(result.message || t4("chatConfig.connectionForm.saveFailed"));
126481
126534
  }
126482
- } catch (e75) {
126535
+ } catch (e76) {
126483
126536
  _antd.message.error(t4("chatConfig.connectionForm.saveFailed"));
126484
126537
  } finally {
126485
126538
  setSaving(false);
@@ -129495,7 +129548,7 @@ var init_CollectionEntryTable = __esm({
129495
129548
  setSearchResults(null);
129496
129549
  setSearchQuery("");
129497
129550
  setLoadError(false);
129498
- } catch (e76) {
129551
+ } catch (e77) {
129499
129552
  setLoadError(true);
129500
129553
  _antd.message.error(t4("chatWorkspace.entries.loadFailed"));
129501
129554
  } finally {
@@ -129507,7 +129560,7 @@ var init_CollectionEntryTable = __esm({
129507
129560
  try {
129508
129561
  const res = await get4(`/api/collections/${collectionName}`);
129509
129562
  if (res.data) setCollection(res.data);
129510
- } catch (e77) {
129563
+ } catch (e78) {
129511
129564
  }
129512
129565
  }, [collectionName, get4]);
129513
129566
  _react.useEffect.call(void 0, () => {
@@ -131742,14 +131795,14 @@ var init_CapabilityBundleForm = __esm({
131742
131795
  function isRuntimeProfilesIntroDismissed() {
131743
131796
  try {
131744
131797
  return typeof localStorage !== "undefined" && localStorage.getItem(RUNTIME_PROFILES_INTRO_DISMISSED_KEY) === "true";
131745
- } catch (e78) {
131798
+ } catch (e79) {
131746
131799
  return false;
131747
131800
  }
131748
131801
  }
131749
131802
  function rememberRuntimeProfilesIntroDismissal() {
131750
131803
  try {
131751
131804
  localStorage.setItem(RUNTIME_PROFILES_INTRO_DISMISSED_KEY, "true");
131752
- } catch (e79) {
131805
+ } catch (e80) {
131753
131806
  }
131754
131807
  }
131755
131808
  function hasErrorCode(value, code) {
@@ -132864,7 +132917,7 @@ var init_PersonalAssistantChannelModal = __esm({
132864
132917
  setQrStatus("error");
132865
132918
  _antd.message.error(t4("chatConfig.paChannel.qr.getFailed"));
132866
132919
  }
132867
- } catch (e80) {
132920
+ } catch (e81) {
132868
132921
  setQrStatus("error");
132869
132922
  _antd.message.error(t4("chatConfig.paChannel.qr.getFailed"));
132870
132923
  } finally {
@@ -132893,7 +132946,7 @@ var init_PersonalAssistantChannelModal = __esm({
132893
132946
  setQrStatus("scaned");
132894
132947
  }
132895
132948
  }
132896
- } catch (e81) {
132949
+ } catch (e82) {
132897
132950
  _antd.message.error(t4("chatConfig.paChannel.qr.statusFailed"));
132898
132951
  }
132899
132952
  }, [get4, clearQrCountdown, form, t4]);
@@ -132911,7 +132964,7 @@ var init_PersonalAssistantChannelModal = __esm({
132911
132964
  } else {
132912
132965
  _antd.message.error(res.message || t4("chatConfig.paChannel.installationsLoadFailed"));
132913
132966
  }
132914
- } catch (e82) {
132967
+ } catch (e83) {
132915
132968
  _antd.message.error(t4("chatConfig.paChannel.installationsLoadFailed"));
132916
132969
  } finally {
132917
132970
  setLoading(false);
@@ -132973,7 +133026,7 @@ var init_PersonalAssistantChannelModal = __esm({
132973
133026
  } else {
132974
133027
  _antd.message.error(res.message || t4("chatConfig.paChannel.toggleFailed"));
132975
133028
  }
132976
- } catch (e83) {
133029
+ } catch (e84) {
132977
133030
  _antd.message.error(t4("chatConfig.paChannel.toggleFailed"));
132978
133031
  } finally {
132979
133032
  setTogglingId(null);
@@ -133072,7 +133125,7 @@ var init_PersonalAssistantChannelModal = __esm({
133072
133125
  } else {
133073
133126
  _antd.message.error(res.message || t4("chatConfig.paChannel.bindingRemoveFailed"));
133074
133127
  }
133075
- } catch (e84) {
133128
+ } catch (e85) {
133076
133129
  _antd.message.error(t4("chatConfig.paChannel.bindingRemoveFailed"));
133077
133130
  }
133078
133131
  };
@@ -133158,7 +133211,7 @@ var init_PersonalAssistantChannelModal = __esm({
133158
133211
  } else {
133159
133212
  _antd.message.error(res.message || t4("chatConfig.paChannel.installationDeleteFailed"));
133160
133213
  }
133161
- } catch (e85) {
133214
+ } catch (e86) {
133162
133215
  _antd.message.error(t4("chatConfig.paChannel.installationDeleteFailed"));
133163
133216
  }
133164
133217
  };
@@ -133683,7 +133736,7 @@ var init_PersonalAssistantPage = __esm({
133683
133736
  const info = { assistantId: b10.data.id, projectId: b10.data.projectId, workspaceId: b10.data.workspaceId || "default", tenantId: _optionalChain([currentTenant, 'optionalAccess', _2162 => _2162.id]) };
133684
133737
  setPersonalAssistant(info);
133685
133738
  _antd.message.success(t4("chatWorkspace.personalAssistant.done"));
133686
- } catch (e86) {
133739
+ } catch (e87) {
133687
133740
  _antd.message.error(t4("chatWorkspace.personalAssistant.networkError"));
133688
133741
  } finally {
133689
133742
  setCreating(false);
@@ -133741,7 +133794,7 @@ var init_PersonalAssistantPage = __esm({
133741
133794
  setCustomPersonality("");
133742
133795
  _antd.message.success(t4("chatWorkspace.personalAssistant.deleted"));
133743
133796
  setDeleteModalOpen(false);
133744
- } catch (e87) {
133797
+ } catch (e88) {
133745
133798
  _antd.message.error(t4("chatWorkspace.personalAssistant.networkError"));
133746
133799
  } finally {
133747
133800
  setDeleting(false);
@@ -134647,7 +134700,7 @@ var init_SharesPage = __esm({
134647
134700
  try {
134648
134701
  const data = await listShares();
134649
134702
  setShares(data);
134650
- } catch (e88) {
134703
+ } catch (e89) {
134651
134704
  _antd.message.error(t4("chatWorkspace.shares.loadFailed"));
134652
134705
  }
134653
134706
  setLoading(false);
@@ -136181,7 +136234,7 @@ var init_AgentConfigPanel = __esm({
136181
136234
  }
136182
136235
  try {
136183
136236
  return normalizeValue(JSON.parse(graphDefinition));
136184
- } catch (e89) {
136237
+ } catch (e90) {
136185
136238
  return graphDefinition;
136186
136239
  }
136187
136240
  };
@@ -136475,7 +136528,7 @@ var init_AgentConfigPanel = __esm({
136475
136528
  type: graphDef.type || "react",
136476
136529
  middleware: graphDef.middleware || []
136477
136530
  };
136478
- } catch (e90) {
136531
+ } catch (e91) {
136479
136532
  return null;
136480
136533
  }
136481
136534
  }, [assistant]);
@@ -137299,7 +137352,7 @@ var init_AgentEvalPanel = __esm({
137299
137352
  try {
137300
137353
  const result = await client.request("/api/tenant-models");
137301
137354
  setModels(toModelOptions(result.data));
137302
- } catch (e91) {
137355
+ } catch (e92) {
137303
137356
  }
137304
137357
  }, [client]);
137305
137358
  const handleCreateProject = async (values) => {
@@ -137495,7 +137548,7 @@ function parseEvents(data, projection2) {
137495
137548
  let value;
137496
137549
  try {
137497
137550
  value = JSON.parse(data);
137498
- } catch (e92) {
137551
+ } catch (e93) {
137499
137552
  throw streamFailed();
137500
137553
  }
137501
137554
  if (!record(value) || typeof value.type !== "string") throw streamFailed();
@@ -137554,7 +137607,7 @@ async function parseAgentWebAppEventStream(body, onEvent) {
137554
137607
  if (result.done) reachedEof = true;
137555
137608
  try {
137556
137609
  buffer += decoder.decode(result.value, { stream: !result.done });
137557
- } catch (e93) {
137610
+ } catch (e94) {
137558
137611
  throw streamFailed();
137559
137612
  }
137560
137613
  const blocks = buffer.split(/\r?\n\r?\n/);
@@ -137576,7 +137629,7 @@ async function parseAgentWebAppEventStream(body, onEvent) {
137576
137629
  if (!reachedEof) {
137577
137630
  try {
137578
137631
  await reader.cancel();
137579
- } catch (e94) {
137632
+ } catch (e95) {
137580
137633
  }
137581
137634
  }
137582
137635
  reader.releaseLock();
@@ -137747,7 +137800,7 @@ var init_client = __esm({
137747
137800
  if (!response.body || !_optionalChain([response, 'access', _2272 => _2272.headers, 'access', _2273 => _2273.get, 'call', _2274 => _2274("content-type"), 'optionalAccess', _2275 => _2275.toLowerCase, 'call', _2276 => _2276(), 'access', _2277 => _2277.includes, 'call', _2278 => _2278("text/event-stream")])) {
137748
137801
  if (response.body) try {
137749
137802
  await response.body.cancel();
137750
- } catch (e95) {
137803
+ } catch (e96) {
137751
137804
  }
137752
137805
  throw new AgentWebAppRuntimeClientError("STREAM_FAILED", _nullishCoalesce(_optionalChain([this, 'access', _2279 => _2279.translate, 'optionalCall', _2280 => _2280("integration.error.streamFailed")]), () => ( "Stream failed")), true, response.status);
137753
137806
  }
@@ -137774,7 +137827,7 @@ var init_client = __esm({
137774
137827
  let value;
137775
137828
  try {
137776
137829
  value = await response.json();
137777
- } catch (e96) {
137830
+ } catch (e97) {
137778
137831
  throw this.internalError(response.status);
137779
137832
  }
137780
137833
  if (isErrorEnvelope(value)) {
@@ -137807,7 +137860,7 @@ var init_client = __esm({
137807
137860
  let value;
137808
137861
  try {
137809
137862
  value = await response.json();
137810
- } catch (e97) {
137863
+ } catch (e98) {
137811
137864
  throw this.internalError(response.status);
137812
137865
  }
137813
137866
  if (isErrorEnvelope(value)) throw new AgentWebAppRuntimeClientError(value.error.code, value.error.message, value.error.retryable, response.status);
@@ -138017,7 +138070,7 @@ function validateProps(props) {
138017
138070
  if (!props.gatewayUrl.trim()) throw new Error("AgentChatApp requires gatewayUrl");
138018
138071
  try {
138019
138072
  new URL(props.gatewayUrl);
138020
- } catch (e98) {
138073
+ } catch (e99) {
138021
138074
  throw new Error("AgentChatApp gatewayUrl must be a valid URL");
138022
138075
  }
138023
138076
  if (!props.webAppId.trim()) throw new Error("AgentChatApp requires webAppId");
@@ -138038,11 +138091,36 @@ function identityScopeKey(identity9) {
138038
138091
  function AgentChatApp(props) {
138039
138092
  validateProps(props);
138040
138093
  const scopeKey = `${props.gatewayUrl}\0${props.webAppId}\0${identityScopeKey(props.identity)}`;
138094
+ const localeProvidedAbove = _react.useContext.call(void 0, LocaleBridgeContext) !== null;
138095
+ const storageKey = _nullishCoalesce(props.storageKey, () => ( DEFAULT_LOCALE_STORAGE_KEY));
138096
+ const initialLocale = _react.useMemo.call(void 0,
138097
+ () => _nullishCoalesce(_nullishCoalesce(props.locale, () => ( readStoredLocale(storageKey))), () => ( "en-US")),
138098
+ [props.locale, storageKey]
138099
+ );
138100
+ const onLocaleChange = _react.useMemo.call(void 0,
138101
+ () => _nullishCoalesce(props.onLocaleChange, () => ( (() => {
138102
+ if (typeof window !== "undefined") window.location.reload();
138103
+ }))),
138104
+ [props.onLocaleChange]
138105
+ );
138106
+ if (localeProvidedAbove) {
138107
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScopedAgentChatApp, { ...props }, scopeKey);
138108
+ }
138041
138109
  return (
138042
138110
  /* The locale provider sits ABOVE ScopedAgentChatApp on purpose: that
138043
138111
  * component calls useT() itself for its own loading/error copy, so a
138044
- * provider rendered inside its return value would only reach descendants. */
138045
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LatticeLocaleProvider, { locale: props.locale, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScopedAgentChatApp, { ...props }, scopeKey) })
138112
+ * provider rendered inside its return value would only reach descendants.
138113
+ * `locale` is passed down resolved so antd's built-in text follows the same
138114
+ * value the dictionaries were loaded for. */
138115
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
138116
+ LatticeLocaleProvider,
138117
+ {
138118
+ locale: initialLocale,
138119
+ storageKey,
138120
+ onLocaleChange,
138121
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ScopedAgentChatApp, { ...props, locale: initialLocale }, scopeKey)
138122
+ }
138123
+ )
138046
138124
  );
138047
138125
  }
138048
138126
  function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError, onChatReady, onChatMessage, fetch: fetchImplementation, className, welcome, quickPrompts, locale: locale3 = "en-US" }) {
@@ -138063,7 +138141,7 @@ function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError
138063
138141
  if (current.mode !== "verified") return { externalUserId: current.userId };
138064
138142
  try {
138065
138143
  return { bearerToken: await current.tokenProvider() };
138066
- } catch (e99) {
138144
+ } catch (e100) {
138067
138145
  throw new AgentWebAppRuntimeClientError("USER_ID_REQUIRED", t4("integration.error.identityTokenFailed"), true);
138068
138146
  }
138069
138147
  }
@@ -138273,6 +138351,8 @@ var init_AgentChatApp = __esm({
138273
138351
  init_appearance2();
138274
138352
  init_color5();
138275
138353
  init_i18n();
138354
+ init_i18n();
138355
+ init_useLocale();
138276
138356
  ANTD_LOCALES = {
138277
138357
  "en-US": _en_USjs2.default,
138278
138358
  "zh-CN": _zh_CNjs2.default
@@ -138329,7 +138409,7 @@ var init_AgentWebAppFormModal = __esm({
138329
138409
  let issuers;
138330
138410
  try {
138331
138411
  issuers = JSON.parse(_nullishCoalesce(fields.identityIssuers, () => ( "")));
138332
- } catch (e100) {
138412
+ } catch (e101) {
138333
138413
  throw new Error("Trusted issuers must be a valid JSON array");
138334
138414
  }
138335
138415
  if (!Array.isArray(issuers) || issuers.length === 0) {
@@ -138449,7 +138529,7 @@ var init_AgentWebAppFormModal = __esm({
138449
138529
  try {
138450
138530
  const parsed = JSON.parse(text);
138451
138531
  return Array.isArray(parsed) && parsed.length > 0 ? Promise.resolve() : Promise.reject(new Error(t4("governance.webApp.issuersEmpty")));
138452
- } catch (e101) {
138532
+ } catch (e102) {
138453
138533
  return Promise.reject(new Error(t4("governance.webApp.issuersInvalid")));
138454
138534
  }
138455
138535
  } }],
@@ -139839,7 +139919,7 @@ function getLearningTargetMode(assistant) {
139839
139919
  if (typeof raw === "string") {
139840
139920
  try {
139841
139921
  parsed = JSON.parse(raw);
139842
- } catch (e102) {
139922
+ } catch (e103) {
139843
139923
  parsed = {};
139844
139924
  }
139845
139925
  }
@@ -139951,7 +140031,7 @@ var init_StartLearningModal = __esm({
139951
140031
  if (cancelled) return;
139952
140032
  const rounds = (_nullishCoalesce(res.data, () => ( []))).filter(isTrainingRound);
139953
140033
  setActiveRound(_nullishCoalesce(rounds.find(isActiveTrainingRound), () => ( null)));
139954
- } catch (e103) {
140034
+ } catch (e104) {
139955
140035
  }
139956
140036
  })();
139957
140037
  return () => {
@@ -140615,7 +140695,7 @@ var init_LearningProgressCard = __esm({
140615
140695
  let refreshPromise;
140616
140696
  try {
140617
140697
  refreshPromise = Promise.resolve(onRefresh());
140618
- } catch (e104) {
140698
+ } catch (e105) {
140619
140699
  refreshPromise = Promise.reject(new Error("Task-list refresh failed"));
140620
140700
  }
140621
140701
  void refreshPromise.catch(() => {
@@ -143870,14 +143950,14 @@ var init_AgentConfigGraph = __esm({
143870
143950
  readGuideDismissed = () => {
143871
143951
  try {
143872
143952
  return typeof window !== "undefined" && _optionalChain([window, 'access', _2471 => _2471.localStorage, 'optionalAccess', _2472 => _2472.getItem, 'call', _2473 => _2473(GUIDE_DISMISSED_KEY)]) === "1";
143873
- } catch (e105) {
143953
+ } catch (e106) {
143874
143954
  return false;
143875
143955
  }
143876
143956
  };
143877
143957
  writeGuideDismissed = (dismissed) => {
143878
143958
  try {
143879
143959
  _optionalChain([window, 'access', _2474 => _2474.localStorage, 'optionalAccess', _2475 => _2475.setItem, 'call', _2476 => _2476(GUIDE_DISMISSED_KEY, dismissed ? "1" : "0")]);
143880
- } catch (e106) {
143960
+ } catch (e107) {
143881
143961
  }
143882
143962
  };
143883
143963
  CANVAS_LAYOUT_KEY = "axiom.trainingCanvas.layout";
@@ -143909,7 +143989,7 @@ var init_AgentConfigGraph = __esm({
143909
143989
  pinned: Array.isArray(record3.pinned) ? record3.pinned.filter((key) => typeof key === "string") : [],
143910
143990
  origins
143911
143991
  };
143912
- } catch (e107) {
143992
+ } catch (e108) {
143913
143993
  return null;
143914
143994
  }
143915
143995
  };
@@ -143917,13 +143997,13 @@ var init_AgentConfigGraph = __esm({
143917
143997
  try {
143918
143998
  const record3 = { version: 1, pinned: [...pinned], origins };
143919
143999
  _optionalChain([window, 'access', _2480 => _2480.localStorage, 'optionalAccess', _2481 => _2481.setItem, 'call', _2482 => _2482(CANVAS_LAYOUT_KEY, JSON.stringify(record3))]);
143920
- } catch (e108) {
144000
+ } catch (e109) {
143921
144001
  }
143922
144002
  };
143923
144003
  clearCanvasLayout = () => {
143924
144004
  try {
143925
144005
  _optionalChain([window, 'access', _2483 => _2483.localStorage, 'optionalAccess', _2484 => _2484.removeItem, 'call', _2485 => _2485(CANVAS_LAYOUT_KEY)]);
143926
- } catch (e109) {
144006
+ } catch (e110) {
143927
144007
  }
143928
144008
  };
143929
144009
  AgentConfigGraphInner = ({ graphDefinition, onSelectNode, assistantId, assistantName, workspaceId, onRemoveNode, initialMessageRequest, onInitialMessageSubmitted, projectId, onProjectChange, onLearningStarted, onToolActivity, learningTasks, onLearningRefresh, evalTick, evalData, hudTopOffset, copilotTemporarilyHidden, onOpenArchitect, architectOpenSignal = 0, architectRestoreFocusRef }) => {
@@ -145818,7 +145898,7 @@ function extractWorkflowDSL(graphDefinition) {
145818
145898
  if (typeof graphDefinition === "string") {
145819
145899
  try {
145820
145900
  def = JSON.parse(graphDefinition);
145821
- } catch (e110) {
145901
+ } catch (e111) {
145822
145902
  return null;
145823
145903
  }
145824
145904
  } else if (graphDefinition && typeof graphDefinition === "object") {
@@ -145828,7 +145908,7 @@ function extractWorkflowDSL(graphDefinition) {
145828
145908
  if (typeof def.workflowYaml !== "string") return null;
145829
145909
  try {
145830
145910
  return expandWorkflow(def.workflowYaml);
145831
- } catch (e111) {
145911
+ } catch (e112) {
145832
145912
  return null;
145833
145913
  }
145834
145914
  }
@@ -146100,7 +146180,7 @@ var init_NodeDock = __esm({
146100
146180
  const nextList = list2.some((m3) => m3.type === draft.type) ? list2.map((m3) => m3.type === draft.type ? nextEntry : m3) : [...list2, nextEntry];
146101
146181
  await onSaveGraph({ ...def, middleware: nextList });
146102
146182
  _antd.message.success(t4("governance.nodeDock.capabilitySaved"));
146103
- } catch (e112) {
146183
+ } catch (e113) {
146104
146184
  _antd.message.error(t4("governance.nodeDock.capabilitySaveFailed"));
146105
146185
  } finally {
146106
146186
  setSaving(false);
@@ -146133,7 +146213,7 @@ var init_NodeDock = __esm({
146133
146213
  try {
146134
146214
  await onSaveGraph({ ...def, description, prompt, modelKey });
146135
146215
  _antd.message.success(t4("governance.nodeDock.agentSaved"));
146136
- } catch (e113) {
146216
+ } catch (e114) {
146137
146217
  _antd.message.error(t4("governance.detail.saveFailed"));
146138
146218
  } finally {
146139
146219
  setSaving(false);
@@ -146169,7 +146249,7 @@ function getTrainingProjectId(graphDefinition) {
146169
146249
  if (typeof graphDefinition === "string") {
146170
146250
  try {
146171
146251
  parsed = JSON.parse(graphDefinition);
146172
- } catch (e114) {
146252
+ } catch (e115) {
146173
146253
  return void 0;
146174
146254
  }
146175
146255
  }
@@ -146464,7 +146544,7 @@ var init_AgentDetailView = __esm({
146464
146544
  if (typeof value === "string") {
146465
146545
  try {
146466
146546
  parsed = JSON.parse(value);
146467
- } catch (e115) {
146547
+ } catch (e116) {
146468
146548
  return {};
146469
146549
  }
146470
146550
  }
@@ -147114,7 +147194,7 @@ function normalizeAgentCardUrl(value, protocol, defaultProtocol = "https://") {
147114
147194
  function getAgentCardPort(agentCardUrl) {
147115
147195
  try {
147116
147196
  return new URL(agentCardUrl).port || void 0;
147117
- } catch (e116) {
147197
+ } catch (e117) {
147118
147198
  return void 0;
147119
147199
  }
147120
147200
  }
@@ -147323,7 +147403,7 @@ var init_CreateAssistantModal = __esm({
147323
147403
  } else {
147324
147404
  _antd.message.error(_optionalChain([data, 'access', _2622 => _2622.data, 'optionalAccess', _2623 => _2623.error]) || t4("chatConfig.createAssistant.connectionFailed"));
147325
147405
  }
147326
- } catch (e117) {
147406
+ } catch (e118) {
147327
147407
  _antd.message.error(t4("chatConfig.createAssistant.connectionTestFailed"));
147328
147408
  } finally {
147329
147409
  setTestingUrl(false);
@@ -148120,7 +148200,7 @@ var init_AgentGovernanceWorkbench = __esm({
148120
148200
  if (typeof value === "string") {
148121
148201
  try {
148122
148202
  parsed = JSON.parse(value);
148123
- } catch (e118) {
148203
+ } catch (e119) {
148124
148204
  return {};
148125
148205
  }
148126
148206
  }
@@ -148163,7 +148243,7 @@ var init_AgentGovernanceWorkbench = __esm({
148163
148243
  setStats(byId);
148164
148244
  setStatsExpiresAt(_nullishCoalesce(_optionalChain([statsRes, 'access', _2640 => _2640.cache, 'optionalAccess', _2641 => _2641.expiresAt]), () => ( null)));
148165
148245
  }
148166
- } catch (e119) {
148246
+ } catch (e120) {
148167
148247
  _antd.message.error(t4("governance.workbench.loadFailed"));
148168
148248
  } finally {
148169
148249
  setLoading(false);
@@ -148254,7 +148334,7 @@ var init_AgentGovernanceWorkbench = __esm({
148254
148334
  } else {
148255
148335
  _antd.message.error(t4("governance.detail.deleteFailed"));
148256
148336
  }
148257
- } catch (e120) {
148337
+ } catch (e121) {
148258
148338
  _antd.message.error(t4("governance.detail.deleteFailed"));
148259
148339
  } finally {
148260
148340
  setDeleting(false);
@@ -148907,7 +148987,7 @@ var init_TopologyRuntimeView = __esm({
148907
148987
  const matched = runsRes.data.records.find((r6) => r6.id === run.id);
148908
148988
  if (matched) onRunUpdate(matched);
148909
148989
  }
148910
- } catch (e121) {
148990
+ } catch (e122) {
148911
148991
  }
148912
148992
  }, [get4, run.id, onRunUpdate]);
148913
148993
  const fetchGraphDefinition = _react.useCallback.call(void 0, async () => {
@@ -148924,7 +149004,7 @@ var init_TopologyRuntimeView = __esm({
148924
149004
  } else {
148925
149005
  setGraphDefinition(null);
148926
149006
  }
148927
- } catch (e122) {
149007
+ } catch (e123) {
148928
149008
  setGraphDefinition(null);
148929
149009
  } finally {
148930
149010
  setGraphLoading(false);
@@ -149756,7 +149836,7 @@ function parseGraphDefinition3(value) {
149756
149836
  try {
149757
149837
  const parsed = JSON.parse(value);
149758
149838
  return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
149759
- } catch (e123) {
149839
+ } catch (e124) {
149760
149840
  return null;
149761
149841
  }
149762
149842
  }
@@ -149767,7 +149847,7 @@ function extractDSL(graphDef) {
149767
149847
  if (typeof graphDef === "string") {
149768
149848
  try {
149769
149849
  def = JSON.parse(graphDef);
149770
- } catch (e124) {
149850
+ } catch (e125) {
149771
149851
  return null;
149772
149852
  }
149773
149853
  } else if (graphDef && typeof graphDef === "object") {
@@ -150109,7 +150189,7 @@ var init_WorkflowAutomationView = __esm({
150109
150189
  if (typeof a4.graphDefinition === "string") {
150110
150190
  try {
150111
150191
  cfgs.push(JSON.parse(a4.graphDefinition));
150112
- } catch (e125) {
150192
+ } catch (e126) {
150113
150193
  }
150114
150194
  } else if (typeof a4.graphDefinition === "object") {
150115
150195
  cfgs.push(a4.graphDefinition);
@@ -150118,7 +150198,7 @@ var init_WorkflowAutomationView = __esm({
150118
150198
  setAgentConfigs(cfgs);
150119
150199
  setAgentNameMap(nameMap);
150120
150200
  }
150121
- } catch (e126) {
150201
+ } catch (e127) {
150122
150202
  }
150123
150203
  }, [get4]);
150124
150204
  const [copilotOpen, setCopilotOpen] = _react.useState.call(void 0, true);
@@ -150147,7 +150227,7 @@ var init_WorkflowAutomationView = __esm({
150147
150227
  try {
150148
150228
  const dsl2 = expandWorkflow(yamlStr);
150149
150229
  stepCount = dsl2.nodes.filter((n4) => n4.type !== "terminal").length;
150150
- } catch (e127) {
150230
+ } catch (e128) {
150151
150231
  }
150152
150232
  return {
150153
150233
  id: a4.id,
@@ -150174,7 +150254,7 @@ var init_WorkflowAutomationView = __esm({
150174
150254
  } else if (typeof raw === "string") {
150175
150255
  try {
150176
150256
  setGraphDef(JSON.parse(raw));
150177
- } catch (e128) {
150257
+ } catch (e129) {
150178
150258
  setGraphDef(null);
150179
150259
  }
150180
150260
  } else if (typeof raw === "object") {
@@ -150183,7 +150263,7 @@ var init_WorkflowAutomationView = __esm({
150183
150263
  setGraphDef(null);
150184
150264
  }
150185
150265
  }
150186
- } catch (e129) {
150266
+ } catch (e130) {
150187
150267
  setDsl(null);
150188
150268
  setGraphDef(null);
150189
150269
  }
@@ -150496,7 +150576,7 @@ var init_AgentDetailSideApp = __esm({
150496
150576
  if (typeof value === "string") {
150497
150577
  try {
150498
150578
  parsed = JSON.parse(value);
150499
- } catch (e130) {
150579
+ } catch (e131) {
150500
150580
  return {};
150501
150581
  }
150502
150582
  }
@@ -150522,7 +150602,7 @@ var init_AgentDetailSideApp = __esm({
150522
150602
  const records = _nullishCoalesce(_optionalChain([res, 'access', _2702 => _2702.data, 'optionalAccess', _2703 => _2703.records]), () => ( []));
150523
150603
  setAllAssistants(records);
150524
150604
  setAssistant(_nullishCoalesce(records.find((a4) => a4.id === assistantId), () => ( null)));
150525
- } catch (e131) {
150605
+ } catch (e132) {
150526
150606
  setError(t4("governance.detail.loadFailed"));
150527
150607
  } finally {
150528
150608
  setLoading(false);
@@ -151032,7 +151112,7 @@ var init_WorkspaceResourceManager = __esm({
151032
151112
  const items3 = json2.data.records.map(menuItemToSideMenuItemConfig);
151033
151113
  setFetchedCustomMenuItems(items3);
151034
151114
  }
151035
- } catch (e132) {
151115
+ } catch (e133) {
151036
151116
  }
151037
151117
  }, [get4]);
151038
151118
  _react.useEffect.call(void 0, () => {
@@ -151289,8 +151369,7 @@ var init_WorkspaceResourceManager = __esm({
151289
151369
  open: tenantSettingsOpen,
151290
151370
  onClose: () => setTenantSettingsOpen(false)
151291
151371
  }
151292
- ),
151293
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AppSwitcherModal, {})
151372
+ )
151294
151373
  ]
151295
151374
  }
151296
151375
  );
@@ -151316,10 +151395,17 @@ var init_WorkspaceResourceManager = __esm({
151316
151395
  };
151317
151396
  AppAwareShell = (props) => {
151318
151397
  const { currentAppId } = useApp();
151398
+ const switcher = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AppSwitcherModal, {});
151319
151399
  if (currentAppId === "cospace") {
151320
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WorkspaceContextProvider, { workspaceId: props.workspaceId, isolated: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CoSpaceStandaloneShell, { ...props }) });
151400
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, WorkspaceContextProvider, { workspaceId: props.workspaceId, isolated: true, children: [
151401
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CoSpaceStandaloneShell, { ...props }),
151402
+ switcher
151403
+ ] });
151321
151404
  }
151322
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WorkspaceChatUI, { ...props });
151405
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
151406
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WorkspaceChatUI, { ...props }),
151407
+ switcher
151408
+ ] });
151323
151409
  };
151324
151410
  }
151325
151411
  });
@@ -151507,7 +151593,7 @@ var init_PinToMenuButton = __esm({
151507
151593
  const result = await check({ contentType, assistantId, contentConfig: externalContentConfig, isMatch });
151508
151594
  setIsPinned(result.isPinned);
151509
151595
  setPinnedItemId(result.pinnedId);
151510
- } catch (e133) {
151596
+ } catch (e134) {
151511
151597
  } finally {
151512
151598
  setChecking(false);
151513
151599
  }