@inetafrica/open-claudia 1.4.3 → 1.4.4
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/bot.js +11 -10
- package/package.json +1 -1
package/bot.js
CHANGED
|
@@ -636,7 +636,7 @@ async function runClaude(prompt, cwd, replyToMsgId, opts = {}) {
|
|
|
636
636
|
streamInterval = setInterval(async () => {
|
|
637
637
|
bot.sendChatAction(CHAT_ID, "typing");
|
|
638
638
|
const elapsed = Math.floor((Date.now() - startTime) / 1000);
|
|
639
|
-
const display = formatProgress(assistantText, toolUses, currentTool);
|
|
639
|
+
const display = formatProgress(assistantText, toolUses, currentTool, elapsed);
|
|
640
640
|
if (display && display !== lastUpdate) {
|
|
641
641
|
if (!statusMessageId && assistantText) {
|
|
642
642
|
statusMessageId = await send(display.length > 4000 ? display.slice(-4000) : display, { replyTo: replyToMsgId });
|
|
@@ -676,11 +676,8 @@ async function runClaude(prompt, cwd, replyToMsgId, opts = {}) {
|
|
|
676
676
|
clearInterval(streamInterval); streamInterval = null;
|
|
677
677
|
const finalText = assistantText || "(no output)";
|
|
678
678
|
const chunks = splitMessage(finalText);
|
|
679
|
-
//
|
|
679
|
+
// Keep the streaming progress message and send final result as a new message
|
|
680
680
|
// This ensures the user gets a notification for the final answer
|
|
681
|
-
if (statusMessageId) {
|
|
682
|
-
await deleteMessage(statusMessageId);
|
|
683
|
-
}
|
|
684
681
|
await send(chunks[0], { replyTo: replyToMsgId });
|
|
685
682
|
for (let i = 1; i < chunks.length; i++) {
|
|
686
683
|
await send(chunks[i]);
|
|
@@ -727,13 +724,17 @@ async function runClaudeSilent(prompt, cwd, label) {
|
|
|
727
724
|
});
|
|
728
725
|
}
|
|
729
726
|
|
|
730
|
-
function formatProgress(text, tools, currentTool) {
|
|
727
|
+
function formatProgress(text, tools, currentTool, elapsed) {
|
|
728
|
+
const mins = Math.floor(elapsed / 60);
|
|
729
|
+
const secs = elapsed % 60;
|
|
730
|
+
const time = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
|
731
|
+
|
|
731
732
|
const parts = [];
|
|
732
|
-
|
|
733
|
-
|
|
733
|
+
const status = currentTool ? `Working: ${currentTool}` : (tools.length > 0 ? "Processing..." : "Thinking...");
|
|
734
|
+
parts.push(`${status} (${time})`);
|
|
735
|
+
if (tools.length > 0) parts.push(`Steps: ${[...new Set(tools)].join(" > ")}`);
|
|
734
736
|
if (text) parts.push(text.length > 800 ? "..." + text.slice(-800) : text);
|
|
735
|
-
|
|
736
|
-
return parts.join("\n\n") || "Thinking...";
|
|
737
|
+
return parts.join("\n\n");
|
|
737
738
|
}
|
|
738
739
|
|
|
739
740
|
// ── Cron System ─────────────────────────────────────────────────────
|