@cqfe/sxin-chat-core 1.0.6 → 1.0.7

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.
@@ -1367,6 +1367,9 @@ function applyToolMessage(msg, tools, byCallId) {
1367
1367
  if (extracted) tool.extracted = extracted;
1368
1368
  tool.status = String(msg?.status || "") === "error" ? "error" : "finished";
1369
1369
  }
1370
+ function isPresentFilesTool(name) {
1371
+ return String(name || "").trim().toLowerCase() === "present_files";
1372
+ }
1370
1373
  function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1371
1374
  const byKind = /* @__PURE__ */ new Map();
1372
1375
  for (const tool of tools) {
@@ -1382,6 +1385,13 @@ function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1382
1385
  });
1383
1386
  } else if (ex?.kind === "artifact") {
1384
1387
  byKind.set("artifact", { kind: "artifact", files: ex.files });
1388
+ } else if (isPresentFilesTool(tool.name)) {
1389
+ const paths = tool.input?.filepaths;
1390
+ if (Array.isArray(paths) && paths.length) {
1391
+ const prev = byKind.get("artifact");
1392
+ const prevFiles = prev?.kind === "artifact" && Array.isArray(prev.files) ? prev.files : [];
1393
+ byKind.set("artifact", { kind: "artifact", files: [...prevFiles, ...paths] });
1394
+ }
1385
1395
  } else if (twinEnabled && tool.name.includes(twinToolPrefix)) {
1386
1396
  byKind.set("twin", { kind: "twin", payload: tool.input });
1387
1397
  }
package/dist/index.cjs CHANGED
@@ -1789,6 +1789,9 @@ function applyToolMessage(msg, tools, byCallId) {
1789
1789
  if (extracted) tool.extracted = extracted;
1790
1790
  tool.status = String(msg?.status || "") === "error" ? "error" : "finished";
1791
1791
  }
1792
+ function isPresentFilesTool(name) {
1793
+ return String(name || "").trim().toLowerCase() === "present_files";
1794
+ }
1792
1795
  function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1793
1796
  const byKind = /* @__PURE__ */ new Map();
1794
1797
  for (const tool of tools) {
@@ -1804,6 +1807,13 @@ function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1804
1807
  });
1805
1808
  } else if (ex?.kind === "artifact") {
1806
1809
  byKind.set("artifact", { kind: "artifact", files: ex.files });
1810
+ } else if (isPresentFilesTool(tool.name)) {
1811
+ const paths = tool.input?.filepaths;
1812
+ if (Array.isArray(paths) && paths.length) {
1813
+ const prev = byKind.get("artifact");
1814
+ const prevFiles = prev?.kind === "artifact" && Array.isArray(prev.files) ? prev.files : [];
1815
+ byKind.set("artifact", { kind: "artifact", files: [...prevFiles, ...paths] });
1816
+ }
1807
1817
  } else if (twinEnabled && tool.name.includes(twinToolPrefix)) {
1808
1818
  byKind.set("twin", { kind: "twin", payload: tool.input });
1809
1819
  }
package/dist/index.mjs CHANGED
@@ -78,7 +78,7 @@ import {
78
78
  toRunMessage,
79
79
  tokenizeSxin,
80
80
  validateOutline
81
- } from "./chunk-7M2OXIYQ.mjs";
81
+ } from "./chunk-7A4ZPM4E.mjs";
82
82
 
83
83
  // src/parser/citation.ts
84
84
  var toStringArray = (v) => {
@@ -1288,6 +1288,9 @@ function applyToolMessage(msg, tools, byCallId) {
1288
1288
  if (extracted) tool.extracted = extracted;
1289
1289
  tool.status = String(msg?.status || "") === "error" ? "error" : "finished";
1290
1290
  }
1291
+ function isPresentFilesTool(name) {
1292
+ return String(name || "").trim().toLowerCase() === "present_files";
1293
+ }
1291
1294
  function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1292
1295
  const byKind = /* @__PURE__ */ new Map();
1293
1296
  for (const tool of tools) {
@@ -1303,6 +1306,13 @@ function assembleAttachments(tools, twinEnabled, twinToolPrefix) {
1303
1306
  });
1304
1307
  } else if (ex?.kind === "artifact") {
1305
1308
  byKind.set("artifact", { kind: "artifact", files: ex.files });
1309
+ } else if (isPresentFilesTool(tool.name)) {
1310
+ const paths = tool.input?.filepaths;
1311
+ if (Array.isArray(paths) && paths.length) {
1312
+ const prev = byKind.get("artifact");
1313
+ const prevFiles = prev?.kind === "artifact" && Array.isArray(prev.files) ? prev.files : [];
1314
+ byKind.set("artifact", { kind: "artifact", files: [...prevFiles, ...paths] });
1315
+ }
1306
1316
  } else if (twinEnabled && tool.name.includes(twinToolPrefix)) {
1307
1317
  byKind.set("twin", { kind: "twin", payload: tool.input });
1308
1318
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createChatCore
3
- } from "../chunk-7M2OXIYQ.mjs";
3
+ } from "../chunk-7A4ZPM4E.mjs";
4
4
 
5
5
  // src/vue/index.ts
6
6
  var instance = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqfe/sxin-chat-core",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "SXin 对话数据层核心:thread/session 管理、消息分组、block 解析(平台无关)",
5
5
  "type": "module",
6
6
  "sideEffects": false,