@iblai/web-utils 1.11.7 → 1.11.8

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.
@@ -6,7 +6,7 @@ type GetReportsArgs = {
6
6
  type GetReportDetailArgs = {
7
7
  key: string;
8
8
  reportName: string;
9
- mentorUniqueId?: string;
9
+ mentor_unique_id?: string;
10
10
  };
11
11
  type CreateReportArgs = {
12
12
  key: string;
package/dist/index.esm.js CHANGED
@@ -14479,6 +14479,7 @@ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, t
14479
14479
  // `addUserMessage`) between the two `getChats` resolutions.
14480
14480
  const startNewChatInFlightRef = React__default.useRef(false);
14481
14481
  const startNewChat = React__default.useCallback(async () => {
14482
+ var _a, _b, _c;
14482
14483
  // Reset all chat state
14483
14484
  if (!showingSharedChat) {
14484
14485
  dispatch(chatActions.resetChats(undefined));
@@ -14511,6 +14512,10 @@ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, t
14511
14512
  requestBody,
14512
14513
  }).unwrap();
14513
14514
  dispatch(chatActions.updateSessionIds(response.session_id));
14515
+ // The backend is the source of truth for which tools/artifacts are
14516
+ // enabled by default; seed the UI toggles from the create-session response.
14517
+ dispatch(chatActions.setTools((_b = (_a = response.tools) === null || _a === void 0 ? void 0 : _a.map((t) => t.slug).filter(Boolean)) !== null && _b !== void 0 ? _b : []));
14518
+ dispatch(chatActions.setArtifactsEnabled((_c = response.enable_artifacts) !== null && _c !== void 0 ? _c : false));
14514
14519
  onStartNewChat === null || onStartNewChat === void 0 ? void 0 : onStartNewChat(response.session_id);
14515
14520
  }
14516
14521
  catch (error) {
@@ -14630,7 +14635,7 @@ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, t
14630
14635
  sendMessage,
14631
14636
  ]);
14632
14637
  async function changeTab(tab) {
14633
- var _a, _b, _c, _d;
14638
+ var _a, _b, _c, _d, _e, _f, _g;
14634
14639
  // while responding to a message, do not change the tab
14635
14640
  if (streaming) {
14636
14641
  errorHandler === null || errorHandler === void 0 ? void 0 : errorHandler("Cannot change tab while streaming");
@@ -14659,14 +14664,18 @@ function useAdvancedChat({ tenantKey, mentorId, username = ANONYMOUS_USERNAME, t
14659
14664
  requestBody,
14660
14665
  }).unwrap();
14661
14666
  dispatch(chatActions.updateSessionIds(response.session_id));
14667
+ // The backend is the source of truth for which tools/artifacts are
14668
+ // enabled by default; seed the UI toggles from the create-session response.
14669
+ dispatch(chatActions.setTools((_b = (_a = response.tools) === null || _a === void 0 ? void 0 : _a.map((t) => t.slug).filter(Boolean)) !== null && _b !== void 0 ? _b : []));
14670
+ dispatch(chatActions.setArtifactsEnabled((_c = response.enable_artifacts) !== null && _c !== void 0 ? _c : false));
14662
14671
  // if the tab we are going to activate has no session Id (this is the first time we are creating the session for this tag)
14663
14672
  // we need to send a proactive prompt if the advanced tabs properties has no tag.
14664
14673
  // (presence of tag indicates an ACTIONABLE UI)
14665
- if (!((_a = advancedTabsProperties[tab]) === null || _a === void 0 ? void 0 : _a.tag)) {
14666
- for (const prompt of (_c = (_b = advancedTabsProperties[tab]) === null || _b === void 0 ? void 0 : _b.prompts) !== null && _c !== void 0 ? _c : []) {
14674
+ if (!((_d = advancedTabsProperties[tab]) === null || _d === void 0 ? void 0 : _d.tag)) {
14675
+ for (const prompt of (_f = (_e = advancedTabsProperties[tab]) === null || _e === void 0 ? void 0 : _e.prompts) !== null && _f !== void 0 ? _f : []) {
14667
14676
  // @ts-expect-error - Type mismatch
14668
14677
  if (prompt.type === "human" && (prompt === null || prompt === void 0 ? void 0 : prompt.proactive)) {
14669
- sendMessage(tab, (_d = prompt.content) !== null && _d !== void 0 ? _d : "", { visible: false });
14678
+ sendMessage(tab, (_g = prompt.content) !== null && _g !== void 0 ? _g : "", { visible: false });
14670
14679
  }
14671
14680
  }
14672
14681
  }