@zero-library/chat-agent 2.1.7 → 2.1.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.
package/dist/index.cjs.js CHANGED
@@ -489,6 +489,7 @@ function createChatStore() {
489
489
  }
490
490
  config.hooks?.onAfterSwitchAgent?.(data);
491
491
  } catch (error) {
492
+ console.error(error);
492
493
  throw error;
493
494
  } finally {
494
495
  receiver.loading = false;
@@ -514,10 +515,13 @@ function createChatStore() {
514
515
  const getCharacters = async (agentId) => {
515
516
  try {
516
517
  character.loading = true;
517
- const res = await agentCharacterQuery(agentId);
518
+ const { data } = await agentCharacterQuery(agentId);
518
519
  if (receiver.active.id !== agentId) return;
519
- character.list = res.data;
520
- character.active = res.data.find((item) => item.selected);
520
+ character.list = data;
521
+ const active = data.find((item) => item.selected);
522
+ if (active) {
523
+ character.active = active;
524
+ }
521
525
  } finally {
522
526
  character.loading = false;
523
527
  }
@@ -1995,6 +1999,15 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
1995
1999
  ] }) }) }) });
1996
2000
  });
1997
2001
 
2002
+ exports.Attachments = Attachments_default;
1998
2003
  exports.ChatCopilot = layouts_default;
2004
+ exports.ChatSender = ChatSender_default;
2005
+ exports.MessageRender = MessageRender_default;
2006
+ Object.keys(x).forEach(function (k) {
2007
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
2008
+ enumerable: true,
2009
+ get: function () { return x[k]; }
2010
+ });
2011
+ });
1999
2012
  //# sourceMappingURL=index.cjs.js.map
2000
2013
  //# sourceMappingURL=index.cjs.js.map