cc-claw 0.20.1 → 0.20.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 +93 -9
- 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.3" : (() => {
|
|
37
37
|
try {
|
|
38
38
|
return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
39
39
|
} catch {
|
|
@@ -11045,6 +11045,14 @@ var init_scheduler = __esm({
|
|
|
11045
11045
|
updates.push("fallbacks = ?");
|
|
11046
11046
|
values.push(JSON.stringify(body.fallbacks));
|
|
11047
11047
|
}
|
|
11048
|
+
if (body.target !== void 0) {
|
|
11049
|
+
updates.push("target = ?");
|
|
11050
|
+
values.push(body.target);
|
|
11051
|
+
}
|
|
11052
|
+
if (body.deliveryMode !== void 0) {
|
|
11053
|
+
updates.push("delivery_mode = ?");
|
|
11054
|
+
values.push(body.deliveryMode);
|
|
11055
|
+
}
|
|
11048
11056
|
if (updates.length === 0) {
|
|
11049
11057
|
return jsonResponse(res, { error: "No fields to update" }, 400);
|
|
11050
11058
|
}
|
|
@@ -18567,6 +18575,13 @@ Use /skills <page> to navigate (e.g. /skills 2)` : "";
|
|
|
18567
18575
|
if (safePage < totalPages) navRow.push({ label: `Page ${safePage + 1} \u2192`, data: `skills:page:${safePage + 1}` });
|
|
18568
18576
|
buttons.push(navRow);
|
|
18569
18577
|
}
|
|
18578
|
+
const { getSkillSuggestionsEnabled: getSkillSuggestionsEnabled2 } = await Promise.resolve().then(() => (init_store5(), store_exports5));
|
|
18579
|
+
const extractEnabled = getSkillSuggestionsEnabled2(chatId);
|
|
18580
|
+
buttons.push([{
|
|
18581
|
+
label: `${extractEnabled ? "\u2713" : "\u25CB"} Auto-Extract Skills`,
|
|
18582
|
+
data: "skills:toggle-extract",
|
|
18583
|
+
...extractEnabled ? { style: "primary" } : {}
|
|
18584
|
+
}]);
|
|
18570
18585
|
const header2 = totalPages > 1 ? `${skills2.length} skills (page ${safePage}/${totalPages}). Select one to invoke:` : `${skills2.length} skills available. Select one to invoke:`;
|
|
18571
18586
|
await sendOrEditKeyboard(chatId, channel, messageId, header2, buttons);
|
|
18572
18587
|
}
|
|
@@ -23690,6 +23705,12 @@ Salience: ${memory2.salience.toFixed(2)} | Created: ${memory2.created_at.slice(0
|
|
|
23690
23705
|
Example: /limits ${bid} daily 500000`, { parseMode: "plain" });
|
|
23691
23706
|
}
|
|
23692
23707
|
return;
|
|
23708
|
+
} else if (data === "skills:toggle-extract") {
|
|
23709
|
+
const { getSkillSuggestionsEnabled: getSkillSuggestionsEnabled2, setSkillSuggestionsEnabled: setSkillSuggestionsEnabled2 } = await Promise.resolve().then(() => (init_store5(), store_exports5));
|
|
23710
|
+
const current = getSkillSuggestionsEnabled2(chatId);
|
|
23711
|
+
setSkillSuggestionsEnabled2(chatId, !current);
|
|
23712
|
+
const skills2 = await discoverAllSkills();
|
|
23713
|
+
await sendSkillsPage(chatId, channel, skills2, 1, messageId);
|
|
23693
23714
|
} else if (data.startsWith("skills:page:")) {
|
|
23694
23715
|
const page = parseInt(data.slice(12), 10);
|
|
23695
23716
|
const skills2 = await discoverAllSkills();
|
|
@@ -23713,12 +23734,42 @@ Example: /limits ${bid} daily 500000`, { parseMode: "plain" });
|
|
|
23713
23734
|
});
|
|
23714
23735
|
const parsed = parseExtractedSkill2(extractionResponse.text);
|
|
23715
23736
|
if (parsed) {
|
|
23716
|
-
const {
|
|
23717
|
-
|
|
23718
|
-
|
|
23719
|
-
|
|
23737
|
+
const { storePendingDraft: updateDraft } = await Promise.resolve().then(() => (init_auto_create(), auto_create_exports));
|
|
23738
|
+
updateDraft(chatId, { ...draft, name: parsed.name, content: parsed.content });
|
|
23739
|
+
const escaped = parsed.content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
23740
|
+
const header2 = `\u{1F4CB} <b>Skill Preview: "${parsed.name}"</b>
|
|
23720
23741
|
|
|
23721
|
-
|
|
23742
|
+
`;
|
|
23743
|
+
const MAX_PREVIEW = 3500 - header2.length;
|
|
23744
|
+
if (typeof channel.sendKeyboard === "function") {
|
|
23745
|
+
if (escaped.length > MAX_PREVIEW) {
|
|
23746
|
+
await channel.sendText(chatId, `${header2}<pre>${escaped.slice(0, 3500)}</pre>
|
|
23747
|
+
|
|
23748
|
+
\u2026(truncated \u2014 full skill will be saved)`, { parseMode: "html" });
|
|
23749
|
+
await channel.sendKeyboard(
|
|
23750
|
+
chatId,
|
|
23751
|
+
`Save "${parsed.name}" as a reusable skill?`,
|
|
23752
|
+
[[
|
|
23753
|
+
{ label: "\u2705 Save Skill", data: "skill:confirm-save", style: "success" },
|
|
23754
|
+
{ label: "\u2715 Discard", data: "skill:discard" }
|
|
23755
|
+
]]
|
|
23756
|
+
);
|
|
23757
|
+
} else {
|
|
23758
|
+
await channel.sendKeyboard(
|
|
23759
|
+
chatId,
|
|
23760
|
+
`${header2}<pre>${escaped}</pre>`,
|
|
23761
|
+
[[
|
|
23762
|
+
{ label: "\u2705 Save Skill", data: "skill:confirm-save", style: "success" },
|
|
23763
|
+
{ label: "\u2715 Discard", data: "skill:discard" }
|
|
23764
|
+
]]
|
|
23765
|
+
);
|
|
23766
|
+
}
|
|
23767
|
+
} else {
|
|
23768
|
+
const { path } = await saveSkill2(parsed.name, parsed.content);
|
|
23769
|
+
clearPendingDraft2(chatId);
|
|
23770
|
+
await channel.sendText(chatId, `\u2705 Skill "${parsed.name}" saved.
|
|
23771
|
+
Path: ${path}`, { parseMode: "plain" });
|
|
23772
|
+
}
|
|
23722
23773
|
} else {
|
|
23723
23774
|
clearPendingDraft2(chatId);
|
|
23724
23775
|
await channel.sendText(chatId, "Could not extract a well-formed skill from this conversation. Try /remember to save key steps manually.", { parseMode: "plain" });
|
|
@@ -23728,6 +23779,28 @@ Use /skills to see all available skills.`, { parseMode: "plain" });
|
|
|
23728
23779
|
await channel.sendText(chatId, `Skill extraction failed: ${e.message}`, { parseMode: "plain" });
|
|
23729
23780
|
}
|
|
23730
23781
|
return;
|
|
23782
|
+
} else if (data === "skill:confirm-save") {
|
|
23783
|
+
const { getPendingDraft: getPendingDraft2, clearPendingDraft: clearPendingDraft2, saveSkill: saveSkill2 } = await Promise.resolve().then(() => (init_auto_create(), auto_create_exports));
|
|
23784
|
+
const draft = getPendingDraft2(chatId);
|
|
23785
|
+
if (!draft || !draft.name || !draft.content) {
|
|
23786
|
+
await channel.sendText(chatId, "No pending skill to save.", { parseMode: "plain" });
|
|
23787
|
+
return;
|
|
23788
|
+
}
|
|
23789
|
+
try {
|
|
23790
|
+
const { path } = await saveSkill2(draft.name, draft.content);
|
|
23791
|
+
clearPendingDraft2(chatId);
|
|
23792
|
+
if (messageId) await replaceWithText(`\u2705 Skill "${draft.name}" saved.
|
|
23793
|
+
Path: ${path}
|
|
23794
|
+
|
|
23795
|
+
Use /skills to see all available skills.`);
|
|
23796
|
+
else await channel.sendText(chatId, `\u2705 Skill "${draft.name}" saved.
|
|
23797
|
+
Path: ${path}
|
|
23798
|
+
|
|
23799
|
+
Use /skills to see all available skills.`, { parseMode: "plain" });
|
|
23800
|
+
} catch (e) {
|
|
23801
|
+
await channel.sendText(chatId, `Failed to save skill: ${e.message}`, { parseMode: "plain" });
|
|
23802
|
+
}
|
|
23803
|
+
return;
|
|
23731
23804
|
} else if (data === "skill:discard") {
|
|
23732
23805
|
const { clearPendingDraft: clearPendingDraft2 } = await Promise.resolve().then(() => (init_auto_create(), auto_create_exports));
|
|
23733
23806
|
clearPendingDraft2(chatId);
|
|
@@ -27041,10 +27114,16 @@ Use the CC-Claw CLI when you need to:
|
|
|
27041
27114
|
## CRITICAL: CC-Claw Is Your API Layer
|
|
27042
27115
|
|
|
27043
27116
|
- **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
|
|
27044
|
-
- **NEVER** modify the SQLite database directly (no INSERT/UPDATE/DELETE SQL)
|
|
27117
|
+
- **NEVER** modify the SQLite database directly (no INSERT/UPDATE/DELETE SQL, no sqlite3 commands)
|
|
27118
|
+
- **NEVER** read or grep CC-Claw source code, dist files, or node_modules to figure out how things work
|
|
27119
|
+
- **NEVER** use curl/API calls to the dashboard HTTP API directly \u2014 use the \`cc-claw\` CLI instead
|
|
27045
27120
|
- **ALWAYS** use CC-Claw slash commands (\`/remember\`, \`/evolve\`, etc.) or the \`cc-claw\` CLI for state changes
|
|
27046
27121
|
- Memory MUST be cross-backend persistent \u2014 only CC-Claw's own commands guarantee this
|
|
27047
|
-
- If you don't know the right command, ask the user or run \`cc-claw --
|
|
27122
|
+
- If you don't know the right command, ask the user or run \`cc-claw --help\` or \`cc-claw <command> --help\`
|
|
27123
|
+
|
|
27124
|
+
## Current Chat Context
|
|
27125
|
+
|
|
27126
|
+
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.
|
|
27048
27127
|
|
|
27049
27128
|
## Telegram Quick Reference
|
|
27050
27129
|
|
|
@@ -27179,6 +27258,9 @@ cc-claw cron edit 3 --backend gemini --model gemini-3-flash-preview # Change ba
|
|
|
27179
27258
|
cc-claw cron edit 3 --description "New task" --timeout 300 # Edit multiple fields
|
|
27180
27259
|
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
|
|
27181
27260
|
cc-claw cron edit 3 --fallback codex:gpt-5.4 --fallback gemini:gemini-3-flash-preview # Set fallbacks
|
|
27261
|
+
cc-claw cron edit 3 --target "-1003682312998:topic:14583" # Deliver to a forum topic (chatId:topic:threadId)
|
|
27262
|
+
cc-claw cron edit 3 --target "-1003682312998" # Deliver to group (General topic)
|
|
27263
|
+
cc-claw cron edit 3 --delivery webhook --target "https://example.com/hook" # Switch to webhook delivery
|
|
27182
27264
|
cc-claw cron cancel 3 # Cancel job #3
|
|
27183
27265
|
cc-claw cron pause 3 # Pause job
|
|
27184
27266
|
cc-claw cron resume 3 # Resume job
|
|
@@ -30504,6 +30586,8 @@ async function cronEdit(globalOpts, id, opts) {
|
|
|
30504
30586
|
payload.timeout = timeout;
|
|
30505
30587
|
}
|
|
30506
30588
|
if (opts.timezone) payload.timezone = opts.timezone;
|
|
30589
|
+
if (opts.target) payload.target = opts.target;
|
|
30590
|
+
if (opts.delivery) payload.deliveryMode = opts.delivery;
|
|
30507
30591
|
if (opts.fallback?.length) {
|
|
30508
30592
|
payload.fallbacks = parseFallbacks(opts.fallback);
|
|
30509
30593
|
}
|
|
@@ -33426,7 +33510,7 @@ function registerCronCommands(cmd) {
|
|
|
33426
33510
|
const { cronAction: cronAction2 } = await Promise.resolve().then(() => (init_cron2(), cron_exports2));
|
|
33427
33511
|
await cronAction2(program.opts(), "run", id);
|
|
33428
33512
|
});
|
|
33429
|
-
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) => {
|
|
33513
|
+
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) => {
|
|
33430
33514
|
const { cronEdit: cronEdit2 } = await Promise.resolve().then(() => (init_cron2(), cron_exports2));
|
|
33431
33515
|
await cronEdit2(program.opts(), id, opts);
|
|
33432
33516
|
});
|
package/package.json
CHANGED