@gendive/chatllm 0.17.15 → 0.17.17

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.
@@ -2585,6 +2585,8 @@ ${finalContent}`;
2585
2585
  }
2586
2586
  abortControllerRef.current = new AbortController();
2587
2587
  try {
2588
+ const shouldSkipSkillParsing = skipNextSkillParsingRef.current;
2589
+ skipNextSkillParsingRef.current = false;
2588
2590
  let messagesToSend = [...existingMessages, userMessage];
2589
2591
  const recompressionThreshold = DEFAULT_RECOMPRESSION_THRESHOLD;
2590
2592
  const tokenLimit = DEFAULT_TOKEN_LIMIT;
@@ -2648,11 +2650,12 @@ ${part.result.content}`).join("\n\n");
2648
2650
  if (attachmentContext) {
2649
2651
  chatMessages.push({
2650
2652
  role: "user",
2651
- content: `\uD30C\uC77C \uBD84\uC11D \uACB0\uACFC:
2653
+ /** @Todo vibecode - 원본 파일 재요청 방지 + skill_use 태그 사용 금지 명시 */
2654
+ content: `\uC0AC\uC6A9\uC790\uAC00 \uCCA8\uBD80\uD55C \uD30C\uC77C\uC758 \uBD84\uC11D \uACB0\uACFC\uC785\uB2C8\uB2E4. \uC6D0\uBCF8 \uD30C\uC77C \uB0B4\uC6A9\uC774 \uC774\uBBF8 \uC544\uB798\uC5D0 \uD3EC\uD568\uB418\uC5B4 \uC788\uC73C\uBBC0\uB85C \uC6D0\uBCF8 \uD30C\uC77C\uC744 \uB2E4\uC2DC \uC694\uCCAD\uD558\uC9C0 \uB9C8\uC138\uC694.
2652
2655
 
2653
2656
  ${attachmentContext}
2654
2657
 
2655
- \uC704 \uACB0\uACFC\uB97C \uCC38\uACE0\uD558\uC5EC \uB2F5\uBCC0\uD574\uC8FC\uC138\uC694.`
2658
+ \uC704 \uBD84\uC11D \uACB0\uACFC\uB9CC\uC73C\uB85C \uC0AC\uC6A9\uC790\uC758 \uC9C8\uBB38\uC5D0 \uB2F5\uBCC0\uD574\uC8FC\uC138\uC694. skill_use \uD0DC\uADF8\uB294 \uC0AC\uC6A9\uD558\uC9C0 \uB9C8\uC138\uC694.`
2656
2659
  });
2657
2660
  }
2658
2661
  }
@@ -2746,7 +2749,7 @@ ${attachmentContext}
2746
2749
  const thinking = parsed.message?.thinking || "";
2747
2750
  if (content2 || thinking) {
2748
2751
  if (content2) accumulatedContent += content2;
2749
- if (!skipNextSkillParsingRef.current && accumulatedContent.includes("</skill_use>")) {
2752
+ if (!shouldSkipSkillParsing && accumulatedContent.includes("</skill_use>")) {
2750
2753
  const endIdx = accumulatedContent.indexOf("</skill_use>");
2751
2754
  accumulatedContent = accumulatedContent.substring(0, endIdx + "</skill_use>".length);
2752
2755
  skillTagDetected = true;
@@ -2813,7 +2816,7 @@ ${attachmentContext}
2813
2816
  } catch {
2814
2817
  }
2815
2818
  }
2816
- if (!skipNextSkillParsingRef.current) {
2819
+ if (!shouldSkipSkillParsing) {
2817
2820
  const assistantContent = accumulatedContent;
2818
2821
  const { skillCall: detectedSkill, cleanContent: skillCleanContent } = parseSkillCallFromContent(assistantContent);
2819
2822
  if (detectedSkill && resolvedSkills[detectedSkill.name]) {
@@ -2994,8 +2997,6 @@ ${result.content}
2994
2997
  return;
2995
2998
  }
2996
2999
  }
2997
- } else {
2998
- skipNextSkillParsingRef.current = false;
2999
3000
  }
3000
3001
  setSessions(
3001
3002
  (prev) => prev.map((s) => {
@@ -6512,7 +6513,12 @@ var MarkdownRenderer = ({
6512
6513
  processedContent = processedContent.replace(UNCLOSED_THINKING_TAG_REGEX, "");
6513
6514
  }
6514
6515
  processedContent = processedContent.replace(/<poll[^>]*>[\s\S]*?<\/poll>/gi, "");
6516
+ const hasUnfinishedPoll = UNCLOSED_POLL_TAG_REGEX.test(processedContent);
6517
+ UNCLOSED_POLL_TAG_REGEX.lastIndex = 0;
6515
6518
  processedContent = processedContent.replace(UNCLOSED_POLL_TAG_REGEX, "");
6519
+ if (hasUnfinishedPoll) {
6520
+ processedContent += "\n\xA7POLL_LOADING\xA7";
6521
+ }
6516
6522
  processedContent = processedContent.replace(UNCLOSED_SKILL_TAG_REGEX, "");
6517
6523
  const codeBlocks = [];
6518
6524
  processedContent = processedContent.replace(CODE_BLOCK_REGEX, (match, lang, code) => {
@@ -6648,6 +6654,46 @@ var MarkdownRenderer = ({
6648
6654
  );
6649
6655
  return;
6650
6656
  }
6657
+ if (line.trim() === "\xA7POLL_LOADING\xA7") {
6658
+ flushList();
6659
+ flushBlockquote();
6660
+ elements.push(
6661
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
6662
+ "div",
6663
+ {
6664
+ style: {
6665
+ display: "flex",
6666
+ alignItems: "center",
6667
+ gap: "8px",
6668
+ padding: "14px 16px",
6669
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
6670
+ borderRadius: "10px",
6671
+ border: "1px solid var(--chatllm-border, #e5e7eb)",
6672
+ marginTop: "12px",
6673
+ animation: "chatllm-pulse 1.5s ease-in-out infinite"
6674
+ },
6675
+ children: [
6676
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
6677
+ "div",
6678
+ {
6679
+ style: {
6680
+ width: "18px",
6681
+ height: "18px",
6682
+ borderRadius: "50%",
6683
+ border: "2px solid var(--chatllm-primary, #4A90E2)",
6684
+ borderTopColor: "transparent",
6685
+ animation: "chatllm-spin 0.8s linear infinite"
6686
+ }
6687
+ }
6688
+ ),
6689
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { fontSize: "13px", color: "var(--chatllm-text-muted, #64748b)" }, children: "\uC120\uD0DD\uC9C0\uB97C \uC900\uBE44\uD558\uACE0 \uC788\uC5B4\uC694..." })
6690
+ ]
6691
+ },
6692
+ `poll-loading-${lineIndex}`
6693
+ )
6694
+ );
6695
+ return;
6696
+ }
6651
6697
  const codeBlockMatch = line.match(/§CODEBLOCK§(\d+)§\/CODEBLOCK§/);
6652
6698
  if (codeBlockMatch) {
6653
6699
  flushList();
@@ -7215,6 +7261,26 @@ var PollCard = ({
7215
7261
  const currentHasSelection = getSelectionCount(currentQuestion.id) > 0;
7216
7262
  const isLastTab = activeTab === questions.length - 1;
7217
7263
  const totalSelected = questions.reduce((sum, q) => sum + getSelectionCount(q.id), 0);
7264
+ const [visibleCount, setVisibleCount] = (0, import_react13.useState)(0);
7265
+ const [cardVisible, setCardVisible] = (0, import_react13.useState)(false);
7266
+ (0, import_react13.useEffect)(() => {
7267
+ const fadeTimer = setTimeout(() => setCardVisible(true), 50);
7268
+ const totalItems = currentQuestion.options.length + 1;
7269
+ const timers = [fadeTimer];
7270
+ for (let i = 1; i <= totalItems; i++) {
7271
+ timers.push(setTimeout(() => setVisibleCount(i), 150 + i * 80));
7272
+ }
7273
+ return () => timers.forEach(clearTimeout);
7274
+ }, [currentQuestion.options.length]);
7275
+ (0, import_react13.useEffect)(() => {
7276
+ setVisibleCount(0);
7277
+ const totalItems = currentQuestion.options.length + 1;
7278
+ const timers = [];
7279
+ for (let i = 1; i <= totalItems; i++) {
7280
+ timers.push(setTimeout(() => setVisibleCount(i), i * 80));
7281
+ }
7282
+ return () => timers.forEach(clearTimeout);
7283
+ }, [activeTab, currentQuestion.options.length]);
7218
7284
  const handleNext = (0, import_react13.useCallback)(() => {
7219
7285
  if (!isLastTab) {
7220
7286
  setActiveTab((prev) => prev + 1);
@@ -7231,6 +7297,9 @@ var PollCard = ({
7231
7297
  borderRadius: "12px",
7232
7298
  border: "1px solid var(--chatllm-border, #e5e7eb)",
7233
7299
  overflow: "hidden",
7300
+ opacity: cardVisible ? 1 : 0,
7301
+ transform: cardVisible ? "translateY(0)" : "translateY(8px)",
7302
+ transition: "opacity 0.3s ease, transform 0.3s ease",
7234
7303
  marginTop: "12px"
7235
7304
  },
7236
7305
  children: [
@@ -7312,8 +7381,9 @@ var PollCard = ({
7312
7381
  }
7313
7382
  ),
7314
7383
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { padding: "8px" }, children: [
7315
- currentQuestion.options.map((option) => {
7384
+ currentQuestion.options.map((option, optIdx) => {
7316
7385
  const isSelected = selections[currentQuestion.id]?.has(option.id) || false;
7386
+ const isVisible = optIdx < visibleCount;
7317
7387
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
7318
7388
  "button",
7319
7389
  {
@@ -7329,8 +7399,10 @@ var PollCard = ({
7329
7399
  borderRadius: "8px",
7330
7400
  cursor: "pointer",
7331
7401
  textAlign: "left",
7332
- transition: "all 0.15s ease",
7333
- marginBottom: "6px"
7402
+ transition: "all 0.2s ease",
7403
+ marginBottom: "6px",
7404
+ opacity: isVisible ? 1 : 0,
7405
+ transform: isVisible ? "translateY(0)" : "translateY(6px)"
7334
7406
  },
7335
7407
  children: [
7336
7408
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -7383,68 +7455,73 @@ var PollCard = ({
7383
7455
  option.id
7384
7456
  );
7385
7457
  }),
7386
- currentQuestion.allowOther !== false && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
7387
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
7388
- "button",
7389
- {
7390
- onClick: () => handleOtherToggle(currentQuestion.id, currentQuestion.multiSelect ?? false),
7391
- style: {
7392
- width: "100%",
7393
- display: "flex",
7394
- alignItems: "center",
7395
- gap: "12px",
7396
- padding: "12px 14px",
7397
- backgroundColor: otherSelected[currentQuestion.id] ? "var(--chatllm-primary-light, rgba(74, 144, 226, 0.08))" : "transparent",
7398
- border: otherSelected[currentQuestion.id] ? "1px solid var(--chatllm-primary, #4A90E2)" : "1px solid var(--chatllm-border, #e5e7eb)",
7399
- borderRadius: "8px",
7400
- cursor: "pointer",
7401
- textAlign: "left",
7402
- transition: "all 0.15s ease"
7403
- },
7404
- children: [
7405
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
7406
- "div",
7407
- {
7408
- style: {
7409
- width: "20px",
7410
- height: "20px",
7411
- borderRadius: currentQuestion.multiSelect ? "4px" : "50%",
7412
- border: `2px solid ${otherSelected[currentQuestion.id] ? "var(--chatllm-primary, #4A90E2)" : "var(--chatllm-border, #d1d5db)"}`,
7413
- backgroundColor: otherSelected[currentQuestion.id] ? "var(--chatllm-primary, #4A90E2)" : "transparent",
7414
- display: "flex",
7415
- alignItems: "center",
7416
- justifyContent: "center",
7417
- flexShrink: 0,
7418
- transition: "all 0.15s ease"
7419
- },
7420
- children: otherSelected[currentQuestion.id] && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconSvg, { name: "check-line", size: 14, color: "#fff" })
7421
- }
7422
- ),
7423
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: "14px", color: "var(--chatllm-text-muted, #64748b)" }, children: "\uAE30\uD0C0" })
7424
- ]
7425
- }
7426
- ),
7427
- otherSelected[currentQuestion.id] && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "8px 0 4px 32px" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
7428
- "input",
7429
- {
7430
- type: "text",
7431
- value: otherTexts[currentQuestion.id] || "",
7432
- onChange: (e) => setOtherTexts((prev) => ({ ...prev, [currentQuestion.id]: e.target.value })),
7433
- placeholder: "\uC9C1\uC811 \uC785\uB825...",
7434
- style: {
7435
- width: "100%",
7436
- padding: "10px 12px",
7437
- backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
7438
- border: "1px solid var(--chatllm-border, #e5e7eb)",
7439
- borderRadius: "6px",
7440
- color: "var(--chatllm-text, #1e293b)",
7441
- fontSize: "13px",
7442
- outline: "none"
7443
- },
7444
- autoFocus: true
7445
- }
7446
- ) })
7447
- ] })
7458
+ currentQuestion.allowOther !== false && (() => {
7459
+ const otherVisible = currentQuestion.options.length < visibleCount;
7460
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
7461
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
7462
+ "button",
7463
+ {
7464
+ onClick: () => handleOtherToggle(currentQuestion.id, currentQuestion.multiSelect ?? false),
7465
+ style: {
7466
+ width: "100%",
7467
+ display: "flex",
7468
+ alignItems: "center",
7469
+ gap: "12px",
7470
+ padding: "12px 14px",
7471
+ backgroundColor: otherSelected[currentQuestion.id] ? "var(--chatllm-primary-light, rgba(74, 144, 226, 0.08))" : "transparent",
7472
+ border: otherSelected[currentQuestion.id] ? "1px solid var(--chatllm-primary, #4A90E2)" : "1px solid var(--chatllm-border, #e5e7eb)",
7473
+ borderRadius: "8px",
7474
+ cursor: "pointer",
7475
+ textAlign: "left",
7476
+ transition: "all 0.2s ease",
7477
+ opacity: otherVisible ? 1 : 0,
7478
+ transform: otherVisible ? "translateY(0)" : "translateY(6px)"
7479
+ },
7480
+ children: [
7481
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
7482
+ "div",
7483
+ {
7484
+ style: {
7485
+ width: "20px",
7486
+ height: "20px",
7487
+ borderRadius: currentQuestion.multiSelect ? "4px" : "50%",
7488
+ border: `2px solid ${otherSelected[currentQuestion.id] ? "var(--chatllm-primary, #4A90E2)" : "var(--chatllm-border, #d1d5db)"}`,
7489
+ backgroundColor: otherSelected[currentQuestion.id] ? "var(--chatllm-primary, #4A90E2)" : "transparent",
7490
+ display: "flex",
7491
+ alignItems: "center",
7492
+ justifyContent: "center",
7493
+ flexShrink: 0,
7494
+ transition: "all 0.15s ease"
7495
+ },
7496
+ children: otherSelected[currentQuestion.id] && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconSvg, { name: "check-line", size: 14, color: "#fff" })
7497
+ }
7498
+ ),
7499
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { fontSize: "14px", color: "var(--chatllm-text-muted, #64748b)" }, children: "\uAE30\uD0C0" })
7500
+ ]
7501
+ }
7502
+ ),
7503
+ otherSelected[currentQuestion.id] && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { padding: "8px 0 4px 32px" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
7504
+ "input",
7505
+ {
7506
+ type: "text",
7507
+ value: otherTexts[currentQuestion.id] || "",
7508
+ onChange: (e) => setOtherTexts((prev) => ({ ...prev, [currentQuestion.id]: e.target.value })),
7509
+ placeholder: "\uC9C1\uC811 \uC785\uB825...",
7510
+ style: {
7511
+ width: "100%",
7512
+ padding: "10px 12px",
7513
+ backgroundColor: "var(--chatllm-bg-secondary, #f9fafb)",
7514
+ border: "1px solid var(--chatllm-border, #e5e7eb)",
7515
+ borderRadius: "6px",
7516
+ color: "var(--chatllm-text, #1e293b)",
7517
+ fontSize: "13px",
7518
+ outline: "none"
7519
+ },
7520
+ autoFocus: true
7521
+ }
7522
+ ) })
7523
+ ] });
7524
+ })()
7448
7525
  ] }),
7449
7526
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
7450
7527
  "div",