cc-claw 0.29.0 → 0.29.1
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 +26 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var VERSION;
|
|
|
33
33
|
var init_version = __esm({
|
|
34
34
|
"src/version.ts"() {
|
|
35
35
|
"use strict";
|
|
36
|
-
VERSION = true ? "0.29.
|
|
36
|
+
VERSION = true ? "0.29.1" : (() => {
|
|
37
37
|
try {
|
|
38
38
|
return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
39
39
|
} catch {
|
|
@@ -34568,6 +34568,28 @@ You're still in discussion mode \u2014 try again or click a button to exit.`, {
|
|
|
34568
34568
|
}
|
|
34569
34569
|
};
|
|
34570
34570
|
}
|
|
34571
|
+
const DRAFT_FLUSH_INTERVAL_MS = 500;
|
|
34572
|
+
const useDraftStreaming = channel.sendMessageDraft && channel.isDraftCapable?.(chatId);
|
|
34573
|
+
const draftState = useDraftStreaming ? { accumulated: "", draftId: Date.now() & 2147483647, dirty: false, flushTimer: null } : null;
|
|
34574
|
+
let onStreamCb;
|
|
34575
|
+
if (draftState) {
|
|
34576
|
+
draftState.flushTimer = setInterval(() => {
|
|
34577
|
+
if (draftState.dirty) {
|
|
34578
|
+
draftState.dirty = false;
|
|
34579
|
+
channel.sendMessageDraft(chatId, draftState.draftId, draftState.accumulated);
|
|
34580
|
+
}
|
|
34581
|
+
}, DRAFT_FLUSH_INTERVAL_MS);
|
|
34582
|
+
onStreamCb = (chunk) => {
|
|
34583
|
+
draftState.accumulated += chunk;
|
|
34584
|
+
draftState.dirty = true;
|
|
34585
|
+
};
|
|
34586
|
+
}
|
|
34587
|
+
const stopDraftTimer2 = () => {
|
|
34588
|
+
if (draftState?.flushTimer) {
|
|
34589
|
+
clearInterval(draftState.flushTimer);
|
|
34590
|
+
draftState.flushTimer = null;
|
|
34591
|
+
}
|
|
34592
|
+
};
|
|
34571
34593
|
let toolUseCount = 0;
|
|
34572
34594
|
const sigT0 = Date.now();
|
|
34573
34595
|
const response = await askAgent(chatId, cleanText || text, {
|
|
@@ -34580,6 +34602,7 @@ You're still in discussion mode \u2014 try again or click a button to exit.`, {
|
|
|
34580
34602
|
agentMode: effectiveAgentMode,
|
|
34581
34603
|
...effectiveThinking ? { thinkingLevel: effectiveThinking } : {},
|
|
34582
34604
|
chatContext: { chatTitle: msg.chatTitle, threadId: msg.threadId },
|
|
34605
|
+
onStream: onStreamCb,
|
|
34583
34606
|
onThinking: liveStatus || sessionLog ? (chunk) => {
|
|
34584
34607
|
if (liveStatus) liveStatus.addThinking(chunk);
|
|
34585
34608
|
if (sessionLog) sessionLog.logThinking(chunk);
|
|
@@ -34617,6 +34640,7 @@ You're still in discussion mode \u2014 try again or click a button to exit.`, {
|
|
|
34617
34640
|
});
|
|
34618
34641
|
}
|
|
34619
34642
|
});
|
|
34643
|
+
stopDraftTimer2();
|
|
34620
34644
|
const elapsedMs = Date.now() - sigT0;
|
|
34621
34645
|
const elapsedSec = (elapsedMs / 1e3).toFixed(1);
|
|
34622
34646
|
if (liveStatus && response.thinkingText?.trim()) {
|
|
@@ -34782,6 +34806,7 @@ Approve paid usage for this session?`,
|
|
|
34782
34806
|
const userMsg = diagnoseAgentError(errMsg, chatId);
|
|
34783
34807
|
await channel.sendText(chatId, userMsg, { parseMode: "plain" });
|
|
34784
34808
|
} finally {
|
|
34809
|
+
stopDraftTimer();
|
|
34785
34810
|
getTypingManager().release(chatId);
|
|
34786
34811
|
const pending = pendingInterrupts.get(chatId);
|
|
34787
34812
|
if (pending) {
|
package/package.json
CHANGED