cc-claw 0.20.13 → 0.20.14
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 +18 -10
- 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.20.
|
|
36
|
+
VERSION = true ? "0.20.14" : (() => {
|
|
37
37
|
try {
|
|
38
38
|
return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
39
39
|
} catch {
|
|
@@ -8088,8 +8088,11 @@ function revokeSubAgentToken(agentId) {
|
|
|
8088
8088
|
function authenticateRequest(req, url) {
|
|
8089
8089
|
const authHeader = req.headers.authorization ?? "";
|
|
8090
8090
|
const bearerToken = authHeader.startsWith("Bearer ") ? authHeader.slice(7) : "";
|
|
8091
|
-
const
|
|
8092
|
-
const
|
|
8091
|
+
const queryToken = url.searchParams.get("token") ?? "";
|
|
8092
|
+
const isBrowserRoute = BROWSER_ROUTES.has(url.pathname) || url.pathname.startsWith("/files");
|
|
8093
|
+
const effectiveToken = bearerToken || (isBrowserRoute ? queryToken : "");
|
|
8094
|
+
const isMainToken = effectiveToken === DASHBOARD_TOKEN;
|
|
8095
|
+
const subEntry = subAgentTokens.get(effectiveToken);
|
|
8093
8096
|
const isSubAgentToken = !!subEntry && subEntry.expiresAt > Date.now();
|
|
8094
8097
|
if (!isMainToken && !isSubAgentToken) {
|
|
8095
8098
|
return { authenticated: false, isSubAgent: false };
|
|
@@ -8136,7 +8139,7 @@ function validateAgentIdentity(req, body) {
|
|
|
8136
8139
|
throw new Error(`IDENTITY_MISMATCH: Token bound to agent ${boundAgentId}, but request claims ${callerAgentId}`);
|
|
8137
8140
|
}
|
|
8138
8141
|
}
|
|
8139
|
-
var PORT, DASHBOARD_TOKEN, SUB_AGENT_TOKEN_TTL_MS, subAgentTokens, SUB_AGENT_ALLOWED_PATHS, MAX_BODY_BYTES;
|
|
8142
|
+
var PORT, DASHBOARD_TOKEN, SUB_AGENT_TOKEN_TTL_MS, subAgentTokens, SUB_AGENT_ALLOWED_PATHS, BROWSER_ROUTES, MAX_BODY_BYTES;
|
|
8140
8143
|
var init_middleware = __esm({
|
|
8141
8144
|
"src/dashboard/middleware.ts"() {
|
|
8142
8145
|
"use strict";
|
|
@@ -8172,6 +8175,7 @@ var init_middleware = __esm({
|
|
|
8172
8175
|
"/api/memory/history",
|
|
8173
8176
|
"/api/memory/summaries"
|
|
8174
8177
|
]);
|
|
8178
|
+
BROWSER_ROUTES = /* @__PURE__ */ new Set(["/", "/index.html", "/upload"]);
|
|
8175
8179
|
MAX_BODY_BYTES = 1048576;
|
|
8176
8180
|
}
|
|
8177
8181
|
});
|
|
@@ -17871,7 +17875,7 @@ function makeToolActionCallback(chatId, channel, level) {
|
|
|
17871
17875
|
};
|
|
17872
17876
|
}
|
|
17873
17877
|
async function processFileSends2(chatId, channel, text) {
|
|
17874
|
-
const fileSendPattern = /\[SEND_FILE
|
|
17878
|
+
const fileSendPattern = /\[\s*SEND_FILE:\s*(.+?)\s*\]/g;
|
|
17875
17879
|
const filePaths = [];
|
|
17876
17880
|
for (const match of text.matchAll(fileSendPattern)) {
|
|
17877
17881
|
filePaths.push(match[1].trim());
|
|
@@ -17892,7 +17896,7 @@ async function processFileSends2(chatId, channel, text) {
|
|
|
17892
17896
|
return text.replace(fileSendPattern, "").trim();
|
|
17893
17897
|
}
|
|
17894
17898
|
async function processImageGenerations(chatId, channel, text) {
|
|
17895
|
-
const pattern = /\[GENERATE_IMAGE
|
|
17899
|
+
const pattern = /\[\s*GENERATE_IMAGE:\s*(.+?)\s*\]/g;
|
|
17896
17900
|
const prompts = [];
|
|
17897
17901
|
for (const match of text.matchAll(pattern)) {
|
|
17898
17902
|
prompts.push(match[1].trim());
|
|
@@ -17920,7 +17924,7 @@ async function processImageGenerations(chatId, channel, text) {
|
|
|
17920
17924
|
return text.replace(pattern, "").trim();
|
|
17921
17925
|
}
|
|
17922
17926
|
async function processReaction(chatId, channel, text, messageId) {
|
|
17923
|
-
const reactPatternGlobal = /\[REACT
|
|
17927
|
+
const reactPatternGlobal = /\[\s*REACT:\s*(.+?)\s*\]/g;
|
|
17924
17928
|
if (!reactPatternGlobal.test(text)) return text;
|
|
17925
17929
|
let reacted = false;
|
|
17926
17930
|
reactPatternGlobal.lastIndex = 0;
|
|
@@ -17934,7 +17938,7 @@ async function processReaction(chatId, channel, text, messageId) {
|
|
|
17934
17938
|
reacted = true;
|
|
17935
17939
|
}
|
|
17936
17940
|
}
|
|
17937
|
-
return text.replace(/\[REACT
|
|
17941
|
+
return text.replace(/\[\s*REACT:\s*(.+?)\s*\]/g, "").trim();
|
|
17938
17942
|
}
|
|
17939
17943
|
async function sendResponse(chatId, channel, text, messageId, replyToMessageId) {
|
|
17940
17944
|
text = await processReaction(chatId, channel, text, messageId);
|
|
@@ -17947,9 +17951,9 @@ async function sendResponse(chatId, channel, text, messageId, replyToMessageId)
|
|
|
17947
17951
|
}
|
|
17948
17952
|
}
|
|
17949
17953
|
let afterHistory = afterUpdates;
|
|
17950
|
-
const historySearchMatch = afterHistory.match(/\[HISTORY_SEARCH
|
|
17954
|
+
const historySearchMatch = afterHistory.match(/\[\s*HISTORY_SEARCH:\s*([^\]]+?)\s*\]/);
|
|
17951
17955
|
if (historySearchMatch) {
|
|
17952
|
-
afterHistory = afterHistory.replace(/\[HISTORY_SEARCH
|
|
17956
|
+
afterHistory = afterHistory.replace(/\[\s*HISTORY_SEARCH:\s*[^\]]+?\s*\]/g, "").trim();
|
|
17953
17957
|
const hsQuery = historySearchMatch[1].trim();
|
|
17954
17958
|
const hsResults = searchMessageLog(chatId, hsQuery, 10);
|
|
17955
17959
|
if (hsResults.length > 0) {
|
|
@@ -27660,6 +27664,8 @@ var init_telegram2 = __esm({
|
|
|
27660
27664
|
{ command: "newchat", description: "Start a fresh conversation" },
|
|
27661
27665
|
{ command: "summarize", description: "Save session to memory (or 'all' for pre-restart)" },
|
|
27662
27666
|
{ command: "stop", description: "Cancel the current running task" },
|
|
27667
|
+
{ command: "debug", description: "Toggle session debug logging" },
|
|
27668
|
+
{ command: "imagine", description: "Generate an image from a prompt" },
|
|
27663
27669
|
// Backend & model
|
|
27664
27670
|
{ command: "backend", description: "Switch AI backend (Claude/Gemini/Codex/Cursor)" },
|
|
27665
27671
|
{ command: "claude", description: "Switch to Claude backend" },
|
|
@@ -27708,6 +27714,8 @@ var init_telegram2 = __esm({
|
|
|
27708
27714
|
{ command: "mcp", description: "List MCP servers across all backends" },
|
|
27709
27715
|
// Skills & profile
|
|
27710
27716
|
{ command: "skills", description: "List and invoke skills" },
|
|
27717
|
+
{ command: "extract_skill", description: "Extract a reusable skill from this session" },
|
|
27718
|
+
{ command: "skill_install", description: "Install a skill from GitHub" },
|
|
27711
27719
|
{ command: "voice", description: "Toggle voice responses" },
|
|
27712
27720
|
{ command: "voice_config", description: "Configure voice provider and voice" },
|
|
27713
27721
|
{ command: "response_style", description: "Set the AI response style (concise/normal/detailed)" },
|
package/package.json
CHANGED