@lih-x-x/kmr 1.0.69 → 1.0.70
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/cli.js +3 -3
- package/dist/index.js +17 -21
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,9 @@ async function checkUpdate() {
|
|
|
6
6
|
try {
|
|
7
7
|
const res = await fetch(`https://registry.npmjs.org/${"@lih-x-x/kmr"}/latest`, { signal: AbortSignal.timeout(3e3) });
|
|
8
8
|
const data = await res.json();
|
|
9
|
-
if (data.version && data.version !== "1.0.
|
|
9
|
+
if (data.version && data.version !== "1.0.70") {
|
|
10
10
|
console.log(`
|
|
11
|
-
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.
|
|
11
|
+
\u2B06\uFE0F \u65B0\u7248\u672C\u53EF\u7528: ${"1.0.70"} \u2192 ${data.version}`);
|
|
12
12
|
console.log(` \u8FD0\u884C npm install -g ${"@lih-x-x/kmr"} \u66F4\u65B0
|
|
13
13
|
`);
|
|
14
14
|
}
|
|
@@ -56,7 +56,7 @@ KMR\uFF08Key Meetings Record\uFF09\u2014 \u4F1A\u8BAE\u6316\u6398\u673A
|
|
|
56
56
|
kmr --help \u663E\u793A\u5E2E\u52A9
|
|
57
57
|
`);
|
|
58
58
|
} else if (command === "--version" || command === "-v") {
|
|
59
|
-
console.log("1.0.
|
|
59
|
+
console.log("1.0.70");
|
|
60
60
|
} else if (command === "list") {
|
|
61
61
|
const { loadConfig } = await import("./config-WIQGW5OC.js");
|
|
62
62
|
const { JsonStore } = await import("./jsonStore-I6ATOECA.js");
|
package/dist/index.js
CHANGED
|
@@ -752,31 +752,27 @@ ${text}`;
|
|
|
752
752
|
extractReply(output) {
|
|
753
753
|
const lines = output.split("\n");
|
|
754
754
|
const metaPrefixes = ["[client]", "[tool]", "[thinking]", "[done]", "[error]", "[warn]", "[info]"];
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
755
|
+
const replyLines = [];
|
|
756
|
+
let inToolBlock = false;
|
|
757
|
+
for (const line of lines) {
|
|
758
|
+
const trimmed = line.trim();
|
|
759
|
+
if (/^\s{2,}(kind|input|output):/.test(line) || /\(completed\)/.test(line) || /^\s{2,}```/.test(line)) {
|
|
760
|
+
inToolBlock = true;
|
|
761
|
+
continue;
|
|
762
762
|
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
let startIdx = endIdx;
|
|
766
|
-
while (startIdx > 0) {
|
|
767
|
-
const prevLine = lines[startIdx - 1];
|
|
768
|
-
const prevTrimmed = prevLine.trim();
|
|
769
|
-
const isToolOrMeta = metaPrefixes.some((p) => prevTrimmed.startsWith(p)) || /^\s{2,}(kind|input|output):/.test(prevLine) || /\(completed\)/.test(prevLine) || /^\s{2,}```/.test(prevLine) || prevLine.startsWith(" ") && /^\s{2,}\S/.test(prevLine);
|
|
770
|
-
if (isToolOrMeta) break;
|
|
771
|
-
if (prevTrimmed.length === 0) {
|
|
772
|
-
startIdx--;
|
|
763
|
+
if (metaPrefixes.some((p) => trimmed.startsWith(p))) {
|
|
764
|
+
inToolBlock = false;
|
|
773
765
|
continue;
|
|
774
766
|
}
|
|
775
|
-
|
|
767
|
+
if (!line.startsWith(" ")) {
|
|
768
|
+
inToolBlock = false;
|
|
769
|
+
}
|
|
770
|
+
if (!inToolBlock) {
|
|
771
|
+
replyLines.push(line);
|
|
772
|
+
}
|
|
776
773
|
}
|
|
777
|
-
const reply =
|
|
778
|
-
|
|
779
|
-
return output.trim();
|
|
774
|
+
const reply = replyLines.join("\n").trim();
|
|
775
|
+
return reply.length > 0 ? reply : output.trim();
|
|
780
776
|
}
|
|
781
777
|
async appendSummary(userId, userText, aiReply) {
|
|
782
778
|
const userDir = path2.join(this.sessionDir, userId);
|