cc-claw 0.20.2 → 0.20.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/dist/cli.js +84 -5
- 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.4" : (() => {
|
|
37
37
|
try {
|
|
38
38
|
return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
39
39
|
} catch {
|
|
@@ -8716,7 +8716,8 @@ var init_helpers = __esm({
|
|
|
8716
8716
|
{ cmd: "/mcps", desc: "List MCP servers" },
|
|
8717
8717
|
{ cmd: "/mcp", desc: "Manage MCP servers" },
|
|
8718
8718
|
{ cmd: "/evolve", desc: "Self-learning controls" },
|
|
8719
|
-
{ cmd: "/intent", desc: "Test intent classifier" }
|
|
8719
|
+
{ cmd: "/intent", desc: "Test intent classifier" },
|
|
8720
|
+
{ cmd: "/info", desc: "Current chat/topic context" }
|
|
8720
8721
|
]
|
|
8721
8722
|
};
|
|
8722
8723
|
USAGE_WINDOW_MAP = { "24h": "daily", "7d": "weekly" };
|
|
@@ -11045,6 +11046,14 @@ var init_scheduler = __esm({
|
|
|
11045
11046
|
updates.push("fallbacks = ?");
|
|
11046
11047
|
values.push(JSON.stringify(body.fallbacks));
|
|
11047
11048
|
}
|
|
11049
|
+
if (body.target !== void 0) {
|
|
11050
|
+
updates.push("target = ?");
|
|
11051
|
+
values.push(body.target);
|
|
11052
|
+
}
|
|
11053
|
+
if (body.deliveryMode !== void 0) {
|
|
11054
|
+
updates.push("delivery_mode = ?");
|
|
11055
|
+
values.push(body.deliveryMode);
|
|
11056
|
+
}
|
|
11048
11057
|
if (updates.length === 0) {
|
|
11049
11058
|
return jsonResponse(res, { error: "No fields to update" }, 400);
|
|
11050
11059
|
}
|
|
@@ -21583,6 +21592,48 @@ async function handleRunsCommand(chatId, commandArgs, msg, channel) {
|
|
|
21583
21592
|
await channel.sendText(chatId, lines.join("\n\n"), { parseMode: "plain" });
|
|
21584
21593
|
}
|
|
21585
21594
|
}
|
|
21595
|
+
async function handleInfoCommand(chatId, commandArgs, msg, channel) {
|
|
21596
|
+
const lines = ["\u2139\uFE0F Chat Info", "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"];
|
|
21597
|
+
if (msg.senderId) lines.push(`User ID: ${msg.senderId}`);
|
|
21598
|
+
if (msg.senderUsername) lines.push(`Username: ${msg.senderUsername}`);
|
|
21599
|
+
if (msg.senderName) lines.push(`Name: ${msg.senderName}`);
|
|
21600
|
+
lines.push("");
|
|
21601
|
+
lines.push(`Chat ID: ${chatId}`);
|
|
21602
|
+
if (msg.chatTitle) lines.push(`Group: ${msg.chatTitle}`);
|
|
21603
|
+
if (msg.threadId) lines.push(`Topic thread: ${msg.threadId}`);
|
|
21604
|
+
const aliases = getAllChatAliases();
|
|
21605
|
+
const alias = aliases.find((a) => a.chatId === chatId);
|
|
21606
|
+
if (alias) lines.push(`Alias: ${alias.alias}`);
|
|
21607
|
+
const sessionId = getSessionId(chatId);
|
|
21608
|
+
if (sessionId) lines.push(`Session: ${sessionId.slice(0, 13)}\u2026`);
|
|
21609
|
+
const backendId = getBackend(chatId) ?? "claude";
|
|
21610
|
+
const currentModel = getModel(chatId);
|
|
21611
|
+
lines.push(`Backend: ${backendId}`);
|
|
21612
|
+
if (currentModel) lines.push(`Model: ${currentModel}`);
|
|
21613
|
+
const execMode = getExecMode(chatId);
|
|
21614
|
+
lines.push(`Exec mode: ${execMode}`);
|
|
21615
|
+
const { getSkillSuggestionsEnabled: getSkillSuggestionsEnabled2 } = await Promise.resolve().then(() => (init_store5(), store_exports5));
|
|
21616
|
+
const skillSuggestions = getSkillSuggestionsEnabled2(chatId);
|
|
21617
|
+
lines.push(`Skill suggestions: ${skillSuggestions ? "on" : "off"}`);
|
|
21618
|
+
const cwd = getCwd(chatId);
|
|
21619
|
+
if (cwd) lines.push(`CWD: ${cwd}`);
|
|
21620
|
+
const { getMessagePairCount: getMessagePairCount2 } = await Promise.resolve().then(() => (init_session_log(), session_log_exports));
|
|
21621
|
+
const pairCount = getMessagePairCount2(chatId);
|
|
21622
|
+
if (pairCount > 0) lines.push(`Messages this session: ${pairCount} pairs`);
|
|
21623
|
+
try {
|
|
21624
|
+
const { getReflectionStatus: getReflectionStatus2 } = await Promise.resolve().then(() => (init_store4(), store_exports4));
|
|
21625
|
+
const db3 = getDb();
|
|
21626
|
+
const reflectionStatus = getReflectionStatus2(db3, chatId);
|
|
21627
|
+
lines.push(`Reflection: ${reflectionStatus}`);
|
|
21628
|
+
} catch {
|
|
21629
|
+
}
|
|
21630
|
+
if (msg.source) lines.push(`Channel: ${msg.source}`);
|
|
21631
|
+
if (msg.threadId) {
|
|
21632
|
+
lines.push("");
|
|
21633
|
+
lines.push(`\u{1F4CB} Target for cron: ${chatId}:topic:${msg.threadId}`);
|
|
21634
|
+
}
|
|
21635
|
+
await channel.sendText(chatId, lines.join("\n"), { parseMode: "plain" });
|
|
21636
|
+
}
|
|
21586
21637
|
async function handleSkillsCommand(chatId, commandArgs, msg, channel) {
|
|
21587
21638
|
const skills2 = await discoverAllSkills();
|
|
21588
21639
|
if (skills2.length === 0) {
|
|
@@ -22521,6 +22572,9 @@ async function handleCommand(msg, channel) {
|
|
|
22521
22572
|
case "debate":
|
|
22522
22573
|
await handleCouncilCommand(chatId, commandArgs, msg, channel);
|
|
22523
22574
|
break;
|
|
22575
|
+
case "info":
|
|
22576
|
+
await handleInfoCommand(chatId, commandArgs, msg, channel);
|
|
22577
|
+
break;
|
|
22524
22578
|
case "evolve":
|
|
22525
22579
|
await handleEvolveCommandWrapper(chatId, commandArgs, msg, channel);
|
|
22526
22580
|
break;
|
|
@@ -26600,6 +26654,8 @@ var init_telegram2 = __esm({
|
|
|
26600
26654
|
const chatId = ctx.chat.id.toString();
|
|
26601
26655
|
const messageId = ctx.message?.message_id?.toString() ?? "";
|
|
26602
26656
|
const senderName = ctx.from?.first_name ?? "User";
|
|
26657
|
+
const senderId = ctx.from?.id?.toString();
|
|
26658
|
+
const senderUsername = ctx.from?.username ? `@${ctx.from.username}` : void 0;
|
|
26603
26659
|
const chatTitle = ctx.chat?.title;
|
|
26604
26660
|
const replyTo = ctx.message?.reply_to_message;
|
|
26605
26661
|
const replyToRaw = replyTo ? replyTo.text ?? replyTo.caption ?? "" : "";
|
|
@@ -26614,6 +26670,8 @@ var init_telegram2 = __esm({
|
|
|
26614
26670
|
messageId,
|
|
26615
26671
|
text: "",
|
|
26616
26672
|
senderName,
|
|
26673
|
+
senderId,
|
|
26674
|
+
senderUsername,
|
|
26617
26675
|
type: "voice",
|
|
26618
26676
|
source: "telegram",
|
|
26619
26677
|
fileName: ctx.message.voice.file_id,
|
|
@@ -26633,6 +26691,8 @@ var init_telegram2 = __esm({
|
|
|
26633
26691
|
messageId,
|
|
26634
26692
|
text: "",
|
|
26635
26693
|
senderName,
|
|
26694
|
+
senderId,
|
|
26695
|
+
senderUsername,
|
|
26636
26696
|
type: "photo",
|
|
26637
26697
|
source: "telegram",
|
|
26638
26698
|
caption: ctx.message.caption ?? "",
|
|
@@ -26651,6 +26711,8 @@ var init_telegram2 = __esm({
|
|
|
26651
26711
|
messageId,
|
|
26652
26712
|
text: "",
|
|
26653
26713
|
senderName,
|
|
26714
|
+
senderId,
|
|
26715
|
+
senderUsername,
|
|
26654
26716
|
type: "document",
|
|
26655
26717
|
source: "telegram",
|
|
26656
26718
|
caption: ctx.message.caption ?? "",
|
|
@@ -26670,6 +26732,8 @@ var init_telegram2 = __esm({
|
|
|
26670
26732
|
messageId,
|
|
26671
26733
|
text: "",
|
|
26672
26734
|
senderName,
|
|
26735
|
+
senderId,
|
|
26736
|
+
senderUsername,
|
|
26673
26737
|
type: "video",
|
|
26674
26738
|
source: "telegram",
|
|
26675
26739
|
caption: ctx.message.caption ?? "",
|
|
@@ -26701,6 +26765,8 @@ var init_telegram2 = __esm({
|
|
|
26701
26765
|
messageId,
|
|
26702
26766
|
text,
|
|
26703
26767
|
senderName,
|
|
26768
|
+
senderId,
|
|
26769
|
+
senderUsername,
|
|
26704
26770
|
type: "command",
|
|
26705
26771
|
source: "telegram",
|
|
26706
26772
|
command,
|
|
@@ -26717,6 +26783,8 @@ var init_telegram2 = __esm({
|
|
|
26717
26783
|
messageId,
|
|
26718
26784
|
text,
|
|
26719
26785
|
senderName,
|
|
26786
|
+
senderId,
|
|
26787
|
+
senderUsername,
|
|
26720
26788
|
type: "text",
|
|
26721
26789
|
source: "telegram",
|
|
26722
26790
|
chatTitle,
|
|
@@ -27106,10 +27174,16 @@ Use the CC-Claw CLI when you need to:
|
|
|
27106
27174
|
## CRITICAL: CC-Claw Is Your API Layer
|
|
27107
27175
|
|
|
27108
27176
|
- **NEVER** use native CLI memory/storage tools (Gemini's \`save_memory\`, Claude's memory, etc.) \u2014 they save to backend-local storage, invisible to other backends
|
|
27109
|
-
- **NEVER** modify the SQLite database directly (no INSERT/UPDATE/DELETE SQL)
|
|
27177
|
+
- **NEVER** modify the SQLite database directly (no INSERT/UPDATE/DELETE SQL, no sqlite3 commands)
|
|
27178
|
+
- **NEVER** read or grep CC-Claw source code, dist files, or node_modules to figure out how things work
|
|
27179
|
+
- **NEVER** use curl/API calls to the dashboard HTTP API directly \u2014 use the \`cc-claw\` CLI instead
|
|
27110
27180
|
- **ALWAYS** use CC-Claw slash commands (\`/remember\`, \`/evolve\`, etc.) or the \`cc-claw\` CLI for state changes
|
|
27111
27181
|
- Memory MUST be cross-backend persistent \u2014 only CC-Claw's own commands guarantee this
|
|
27112
|
-
- If you don't know the right command, ask the user or run \`cc-claw --
|
|
27182
|
+
- If you don't know the right command, ask the user or run \`cc-claw --help\` or \`cc-claw <command> --help\`
|
|
27183
|
+
|
|
27184
|
+
## Current Chat Context
|
|
27185
|
+
|
|
27186
|
+
You are running inside CC-Claw. Your current chat ID, group name, and forum topic thread ID (if applicable) are injected into your prompt at the start. Use this info when the user asks you to target "this chat" or "this topic" \u2014 you already know where you are.
|
|
27113
27187
|
|
|
27114
27188
|
## Telegram Quick Reference
|
|
27115
27189
|
|
|
@@ -27244,6 +27318,9 @@ cc-claw cron edit 3 --backend gemini --model gemini-3-flash-preview # Change ba
|
|
|
27244
27318
|
cc-claw cron edit 3 --description "New task" --timeout 300 # Edit multiple fields
|
|
27245
27319
|
cc-claw cron create --description "Report" --cron "0 9 * * *" --backend claude --model claude-sonnet-4-6 --fallback codex:gpt-5.4 --fallback gemini:gemini-3-flash-preview # With fallback chain
|
|
27246
27320
|
cc-claw cron edit 3 --fallback codex:gpt-5.4 --fallback gemini:gemini-3-flash-preview # Set fallbacks
|
|
27321
|
+
cc-claw cron edit 3 --target "-1003682312998:topic:14583" # Deliver to a forum topic (chatId:topic:threadId)
|
|
27322
|
+
cc-claw cron edit 3 --target "-1003682312998" # Deliver to group (General topic)
|
|
27323
|
+
cc-claw cron edit 3 --delivery webhook --target "https://example.com/hook" # Switch to webhook delivery
|
|
27247
27324
|
cc-claw cron cancel 3 # Cancel job #3
|
|
27248
27325
|
cc-claw cron pause 3 # Pause job
|
|
27249
27326
|
cc-claw cron resume 3 # Resume job
|
|
@@ -30569,6 +30646,8 @@ async function cronEdit(globalOpts, id, opts) {
|
|
|
30569
30646
|
payload.timeout = timeout;
|
|
30570
30647
|
}
|
|
30571
30648
|
if (opts.timezone) payload.timezone = opts.timezone;
|
|
30649
|
+
if (opts.target) payload.target = opts.target;
|
|
30650
|
+
if (opts.delivery) payload.deliveryMode = opts.delivery;
|
|
30572
30651
|
if (opts.fallback?.length) {
|
|
30573
30652
|
payload.fallbacks = parseFallbacks(opts.fallback);
|
|
30574
30653
|
}
|
|
@@ -33491,7 +33570,7 @@ function registerCronCommands(cmd) {
|
|
|
33491
33570
|
const { cronAction: cronAction2 } = await Promise.resolve().then(() => (init_cron2(), cron_exports2));
|
|
33492
33571
|
await cronAction2(program.opts(), "run", id);
|
|
33493
33572
|
});
|
|
33494
|
-
cmd.command("edit <id>").description("Edit a job (same flags as create)").option("--title <text>", "Short title for job list").option("--description <text>").option("--cron <expr>").option("--at <iso8601>").option("--every <interval>").option("--backend <name>").option("--model <name>").option("--thinking <level>").option("--timeout <seconds>", "Job timeout in seconds (30-3600)").option("--fallback <backend:model>", "Fallback backend:model (repeatable, max 3)", (val, prev) => [...prev, val], []).option("--timezone <tz>").action(async (id, opts) => {
|
|
33573
|
+
cmd.command("edit <id>").description("Edit a job (same flags as create)").option("--title <text>", "Short title for job list").option("--description <text>").option("--cron <expr>").option("--at <iso8601>").option("--every <interval>").option("--backend <name>").option("--model <name>").option("--thinking <level>").option("--timeout <seconds>", "Job timeout in seconds (30-3600)").option("--fallback <backend:model>", "Fallback backend:model (repeatable, max 3)", (val, prev) => [...prev, val], []).option("--timezone <tz>").option("--target <id>", "Delivery target (chat ID, or chatId:topicId for forum topics)").option("--delivery <mode>", "Delivery mode (announce/webhook/none)").action(async (id, opts) => {
|
|
33495
33574
|
const { cronEdit: cronEdit2 } = await Promise.resolve().then(() => (init_cron2(), cron_exports2));
|
|
33496
33575
|
await cronEdit2(program.opts(), id, opts);
|
|
33497
33576
|
});
|
package/package.json
CHANGED