@zero-library/chat-agent 2.1.12 → 2.1.13

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
@@ -560,8 +560,8 @@ function createChatStore() {
560
560
  character.loading = true;
561
561
  const { data } = await config.services.request.agentCharacterQuery(agentId);
562
562
  if (receiver.active.id !== agentId) return;
563
- character.list = data;
564
- const active = data.find((item) => item.selected);
563
+ character.list = data || [];
564
+ const active = character.list.find((item) => item.selected);
565
565
  if (active) {
566
566
  character.active = active;
567
567
  }
@@ -1388,7 +1388,7 @@ var AgentCharacter_default = () => {
1388
1388
  chatStore.getCharacters(receiverState.active.id);
1389
1389
  }
1390
1390
  }, [receiverState.active.id]);
1391
- return characterState.active.id && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1391
+ return characterState.active?.id && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1392
1392
  /* @__PURE__ */ jsxRuntime.jsx("div", { title: "\u6027\u683C", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { onClick: chatStore.openCharacterList, className: "cursor-pointer", src: characterState.active.logo }) }),
1393
1393
  characterState.open && /* @__PURE__ */ jsxRuntime.jsx(CharacterList_default, {})
1394
1394
  ] });
@@ -1753,9 +1753,9 @@ var SenderPromptsItems_default = () => {
1753
1753
  const chatStore = useChatStore();
1754
1754
  const receiverState = valtio.useSnapshot(chatStore.receiver);
1755
1755
  const component = react.useMemo(
1756
- () => receiverState.active.config?.labels?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, className: "overflow-hidden", children: [
1756
+ () => receiverState.active.config?.labels?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, wrap: true, children: [
1757
1757
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { disabled: true, color: "default", variant: "text", children: "\u968F\u4FBF\u804A\u804A" }),
1758
- receiverState.active.config.labels.map((question) => /* @__PURE__ */ jsxRuntime.jsx(
1758
+ receiverState.active.config.labels.slice(0, 6).map((question) => /* @__PURE__ */ jsxRuntime.jsx(
1759
1759
  antd.Popover,
1760
1760
  {
1761
1761
  content: /* @__PURE__ */ jsxRuntime.jsx(