@gendive/chatllm 0.13.0 → 0.13.2

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.
@@ -452,6 +452,8 @@ interface ChatUIProps {
452
452
  templates?: PromptTemplate[];
453
453
  /** 개인화 설정 */
454
454
  personalization?: Partial<PersonalizationConfig>;
455
+ /** @Todo vibecode - 개인화 설정 변경 콜백 (백엔드 저장용) */
456
+ onPersonalizationChange?: (config: PersonalizationConfig) => void;
455
457
  /** API 키 (DevDive 등 외부 프로바이더용) */
456
458
  apiKey?: string;
457
459
  /** API 키 변경 핸들러 */
@@ -899,6 +901,8 @@ interface UseChatUIOptions {
899
901
  actions?: ActionItem[];
900
902
  /** 초기 개인화 설정 */
901
903
  initialPersonalization?: Partial<PersonalizationConfig>;
904
+ /** @Todo vibecode - 개인화 설정 변경 콜백 (백엔드 저장용) */
905
+ onPersonalizationChange?: (config: PersonalizationConfig) => void;
902
906
  /** API 키 */
903
907
  apiKey?: string;
904
908
  /** API 엔드포인트 */
@@ -452,6 +452,8 @@ interface ChatUIProps {
452
452
  templates?: PromptTemplate[];
453
453
  /** 개인화 설정 */
454
454
  personalization?: Partial<PersonalizationConfig>;
455
+ /** @Todo vibecode - 개인화 설정 변경 콜백 (백엔드 저장용) */
456
+ onPersonalizationChange?: (config: PersonalizationConfig) => void;
455
457
  /** API 키 (DevDive 등 외부 프로바이더용) */
456
458
  apiKey?: string;
457
459
  /** API 키 변경 핸들러 */
@@ -899,6 +901,8 @@ interface UseChatUIOptions {
899
901
  actions?: ActionItem[];
900
902
  /** 초기 개인화 설정 */
901
903
  initialPersonalization?: Partial<PersonalizationConfig>;
904
+ /** @Todo vibecode - 개인화 설정 변경 콜백 (백엔드 저장용) */
905
+ onPersonalizationChange?: (config: PersonalizationConfig) => void;
902
906
  /** API 키 */
903
907
  apiKey?: string;
904
908
  /** API 엔드포인트 */
@@ -1190,6 +1190,7 @@ var parsePollFromContent = (content) => {
1190
1190
  return { pollBlock: null, cleanContent: content };
1191
1191
  }
1192
1192
  console.log("[pollParser] Total polls parsed:", polls.length, polls.map((p) => p.question));
1193
+ cleanContent = cleanContent.replace(/\n{3,}/g, "\n\n");
1193
1194
  return {
1194
1195
  pollBlock: {
1195
1196
  id: generateId(),
@@ -1797,8 +1798,12 @@ ${newConversation}
1797
1798
  abortControllerRef.current?.abort();
1798
1799
  }, []);
1799
1800
  const updatePersonalization = (0, import_react4.useCallback)((config) => {
1800
- setPersonalization((prev) => ({ ...prev, ...config }));
1801
- }, []);
1801
+ setPersonalization((prev) => {
1802
+ const next = { ...prev, ...config };
1803
+ options.onPersonalizationChange?.(next);
1804
+ return next;
1805
+ });
1806
+ }, [options.onPersonalizationChange]);
1802
1807
  const toggleDeepResearchMode = (0, import_react4.useCallback)(() => {
1803
1808
  setIsDeepResearchMode((prev) => !prev);
1804
1809
  }, []);
@@ -5658,6 +5663,7 @@ var DeepResearchProgressUI = ({ progress }) => {
5658
5663
  // src/react/components/PollCard.tsx
5659
5664
  var import_react11 = require("react");
5660
5665
  var import_jsx_runtime8 = require("react/jsx-runtime");
5666
+ var stripMarkdown = (text) => text.replace(/\*\*(.+?)\*\*/g, "$1").replace(/__(.+?)__/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/_(.+?)_/g, "$1").replace(/`(.+?)`/g, "$1").replace(/~~(.+?)~~/g, "$1");
5661
5667
  var PollCard = ({
5662
5668
  questions,
5663
5669
  onSubmit,
@@ -5787,7 +5793,10 @@ var PollCard = ({
5787
5793
  },
5788
5794
  children: [
5789
5795
  hasSelection && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconSvg, { name: "check-line", size: 14, color: "var(--chatllm-success, #22c55e)" }),
5790
- q.question.length > 15 ? q.question.substring(0, 15) + "..." : q.question
5796
+ (() => {
5797
+ const t = stripMarkdown(q.question);
5798
+ return t.length > 15 ? t.substring(0, 15) + "..." : t;
5799
+ })()
5791
5800
  ]
5792
5801
  },
5793
5802
  q.id
@@ -5811,7 +5820,7 @@ var PollCard = ({
5811
5820
  fontWeight: 600,
5812
5821
  color: "var(--chatllm-text, #1e293b)"
5813
5822
  },
5814
- children: currentQuestion.question
5823
+ children: stripMarkdown(currentQuestion.question)
5815
5824
  }
5816
5825
  ),
5817
5826
  currentQuestion.multiSelect && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -5879,7 +5888,7 @@ var PollCard = ({
5879
5888
  color: "var(--chatllm-text, #1e293b)",
5880
5889
  lineHeight: "1.4"
5881
5890
  },
5882
- children: option.label
5891
+ children: stripMarkdown(option.label)
5883
5892
  }
5884
5893
  ),
5885
5894
  option.description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -5891,7 +5900,7 @@ var PollCard = ({
5891
5900
  marginTop: "2px",
5892
5901
  lineHeight: "1.3"
5893
5902
  },
5894
- children: option.description
5903
+ children: stripMarkdown(option.description)
5895
5904
  }
5896
5905
  )
5897
5906
  ] })
@@ -7884,6 +7893,7 @@ var ChatUI = ({
7884
7893
  actions = DEFAULT_ACTIONS,
7885
7894
  templates = DEFAULT_TEMPLATES,
7886
7895
  personalization,
7896
+ onPersonalizationChange,
7887
7897
  apiKey,
7888
7898
  onApiKeyChange,
7889
7899
  apiEndpoint = "/api/chat",
@@ -7923,6 +7933,7 @@ var ChatUI = ({
7923
7933
  models,
7924
7934
  actions,
7925
7935
  initialPersonalization: personalization,
7936
+ onPersonalizationChange,
7926
7937
  apiKey,
7927
7938
  apiEndpoint,
7928
7939
  initialModel: models[0]?.id,