cc-claw 0.14.1 → 0.14.3
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 +32 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -72,7 +72,7 @@ var VERSION;
|
|
|
72
72
|
var init_version = __esm({
|
|
73
73
|
"src/version.ts"() {
|
|
74
74
|
"use strict";
|
|
75
|
-
VERSION = true ? "0.14.
|
|
75
|
+
VERSION = true ? "0.14.3" : (() => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(readFileSync(join2(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
78
78
|
} catch {
|
|
@@ -10000,7 +10000,7 @@ function spawnQuery(adapter, config2, model2, cancelState, thinkingLevel, timeou
|
|
|
10000
10000
|
proc.stderr?.on("data", (chunk) => stderrChunks.push(chunk));
|
|
10001
10001
|
const rl2 = createInterface4({ input: proc.stdout });
|
|
10002
10002
|
let firstLine = true;
|
|
10003
|
-
const frTimeoutMs = opts?.firstResponseTimeoutMs ?? FIRST_RESPONSE_TIMEOUT_MS;
|
|
10003
|
+
const frTimeoutMs = adapter.id === "gemini" ? opts?.firstResponseTimeoutMs ?? FIRST_RESPONSE_TIMEOUT_MS : 0;
|
|
10004
10004
|
let firstResponseTimer;
|
|
10005
10005
|
let gotModelContent = false;
|
|
10006
10006
|
if (frTimeoutMs > 0) {
|
|
@@ -15220,9 +15220,21 @@ ${content}
|
|
|
15220
15220
|
await channel.sendText(chatId, `Error processing file: ${errorMessage(err)}`, { parseMode: "plain" });
|
|
15221
15221
|
}
|
|
15222
15222
|
}
|
|
15223
|
+
function buildContextPrefix(msg) {
|
|
15224
|
+
const parts = [];
|
|
15225
|
+
if (msg.forwardedFrom) {
|
|
15226
|
+
parts.push(`[Forwarded from: "${msg.forwardedFrom}"]`);
|
|
15227
|
+
}
|
|
15228
|
+
if (msg.replyToText) {
|
|
15229
|
+
parts.push(`[Replying to: "${msg.replyToText}"]`);
|
|
15230
|
+
}
|
|
15231
|
+
return parts.length > 0 ? parts.join("\n") + "\n\n" : "";
|
|
15232
|
+
}
|
|
15223
15233
|
async function handleText(msg, channel) {
|
|
15224
15234
|
const { chatId } = msg;
|
|
15225
15235
|
let { text } = msg;
|
|
15236
|
+
const contextPrefix = buildContextPrefix(msg);
|
|
15237
|
+
if (contextPrefix) text = contextPrefix + text;
|
|
15226
15238
|
if (hasActiveProfile(chatId)) {
|
|
15227
15239
|
await handleProfileText(chatId, text, channel);
|
|
15228
15240
|
return;
|
|
@@ -19204,6 +19216,12 @@ var init_telegram2 = __esm({
|
|
|
19204
19216
|
const messageId = ctx.message?.message_id?.toString() ?? "";
|
|
19205
19217
|
const senderName = ctx.from?.first_name ?? "User";
|
|
19206
19218
|
const chatTitle = ctx.chat?.title;
|
|
19219
|
+
const replyTo = ctx.message?.reply_to_message;
|
|
19220
|
+
const replyToRaw = replyTo ? replyTo.text ?? replyTo.caption ?? "" : "";
|
|
19221
|
+
const replyToText = replyToRaw ? replyToRaw.length > 300 ? replyToRaw.slice(0, 297) + "\u2026" : replyToRaw : void 0;
|
|
19222
|
+
const fwdOrigin = ctx.message?.forward_origin;
|
|
19223
|
+
const fwdFromChat = ctx.message?.forward_from_chat;
|
|
19224
|
+
const forwardedFrom = fwdOrigin?.chat?.title ?? fwdOrigin?.sender_chat?.title ?? fwdOrigin?.sender_user?.first_name ?? fwdOrigin?.sender_user_name ?? fwdFromChat?.title ?? void 0;
|
|
19207
19225
|
if (ctx.message?.voice) {
|
|
19208
19226
|
return {
|
|
19209
19227
|
chatId,
|
|
@@ -19215,6 +19233,8 @@ var init_telegram2 = __esm({
|
|
|
19215
19233
|
fileName: ctx.message.voice.file_id,
|
|
19216
19234
|
mimeType: "audio/ogg",
|
|
19217
19235
|
chatTitle,
|
|
19236
|
+
replyToText,
|
|
19237
|
+
forwardedFrom,
|
|
19218
19238
|
raw: ctx
|
|
19219
19239
|
};
|
|
19220
19240
|
}
|
|
@@ -19232,6 +19252,8 @@ var init_telegram2 = __esm({
|
|
|
19232
19252
|
fileName: largest.file_id,
|
|
19233
19253
|
mimeType: "image/jpeg",
|
|
19234
19254
|
chatTitle,
|
|
19255
|
+
replyToText,
|
|
19256
|
+
forwardedFrom,
|
|
19235
19257
|
raw: ctx
|
|
19236
19258
|
};
|
|
19237
19259
|
}
|
|
@@ -19247,6 +19269,8 @@ var init_telegram2 = __esm({
|
|
|
19247
19269
|
fileName: ctx.message.document.file_id,
|
|
19248
19270
|
mimeType: ctx.message.document.mime_type ?? "application/octet-stream",
|
|
19249
19271
|
chatTitle,
|
|
19272
|
+
replyToText,
|
|
19273
|
+
forwardedFrom,
|
|
19250
19274
|
raw: ctx
|
|
19251
19275
|
};
|
|
19252
19276
|
}
|
|
@@ -19271,6 +19295,8 @@ var init_telegram2 = __esm({
|
|
|
19271
19295
|
mimeType: video.mime_type ?? "video/mp4"
|
|
19272
19296
|
},
|
|
19273
19297
|
chatTitle,
|
|
19298
|
+
replyToText,
|
|
19299
|
+
forwardedFrom,
|
|
19274
19300
|
raw: ctx
|
|
19275
19301
|
};
|
|
19276
19302
|
}
|
|
@@ -19290,6 +19316,8 @@ var init_telegram2 = __esm({
|
|
|
19290
19316
|
command,
|
|
19291
19317
|
commandArgs,
|
|
19292
19318
|
chatTitle,
|
|
19319
|
+
replyToText,
|
|
19320
|
+
forwardedFrom,
|
|
19293
19321
|
raw: ctx
|
|
19294
19322
|
};
|
|
19295
19323
|
}
|
|
@@ -19301,6 +19329,8 @@ var init_telegram2 = __esm({
|
|
|
19301
19329
|
type: "text",
|
|
19302
19330
|
source: "telegram",
|
|
19303
19331
|
chatTitle,
|
|
19332
|
+
replyToText,
|
|
19333
|
+
forwardedFrom,
|
|
19304
19334
|
raw: ctx
|
|
19305
19335
|
};
|
|
19306
19336
|
}
|
package/package.json
CHANGED