cc-claw 0.11.2 → 0.11.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 +18 -15
- 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.11.
|
|
75
|
+
VERSION = true ? "0.11.3" : (() => {
|
|
76
76
|
try {
|
|
77
77
|
return JSON.parse(readFileSync(join2(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
|
|
78
78
|
} catch {
|
|
@@ -2553,22 +2553,25 @@ function insertJob(params) {
|
|
|
2553
2553
|
return getJobById(Number(result.lastInsertRowid));
|
|
2554
2554
|
}
|
|
2555
2555
|
function backfillJobTitles(database) {
|
|
2556
|
-
const rows = database.prepare(
|
|
2556
|
+
const rows = database.prepare(
|
|
2557
|
+
"SELECT id, description FROM jobs WHERE active = 1 AND (title IS NULL OR title LIKE 'No thinking%' OR title LIKE 'You must%' OR title LIKE 'You MUST%')"
|
|
2558
|
+
).all();
|
|
2557
2559
|
if (rows.length === 0) return;
|
|
2558
|
-
const
|
|
2559
|
-
/^you\s+must\s+call\s+the\s+\w+\s+tool\b[^.]*\.\s*/i,
|
|
2560
|
-
/^important:\s*[^.]*\.\s*/i,
|
|
2561
|
-
/^always\s+use\s+[^.]*\.\s*/i,
|
|
2562
|
-
/^note:\s*[^.]*\.\s*/i
|
|
2563
|
-
];
|
|
2560
|
+
const instructionLinePattern = /^(?:you\s+must|important|always|note|never|no\s+thinking|do\s+not|don't|remember|make\s+sure|ensure|critical|warning|before\s+you|first,?\s+you|use\s+the|call\s+the)\b[^.\n]*[.!]?\s*/i;
|
|
2564
2561
|
for (const row of rows) {
|
|
2565
2562
|
let text = row.description;
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2563
|
+
let prevLen = 0;
|
|
2564
|
+
while (text.length !== prevLen && text.length > 0) {
|
|
2565
|
+
prevLen = text.length;
|
|
2566
|
+
text = text.replace(instructionLinePattern, "").trim();
|
|
2567
|
+
text = text.replace(/^\n+/, "").trim();
|
|
2568
|
+
}
|
|
2569
|
+
if (text.length < 10) text = row.description;
|
|
2570
|
+
text = text.replace(/https?:\/\/\S+/g, "").trim();
|
|
2571
|
+
text = text.replace(/\([^)]*\)\s*$/, "").trim();
|
|
2572
|
+
const firstLine = text.split(/\n/)[0].trim();
|
|
2573
|
+
const firstSentence = firstLine.match(/^.{5,55}(?:\b|[.!?])/)?.[0] ?? firstLine.slice(0, 55);
|
|
2574
|
+
const title = firstSentence.length > 55 ? firstSentence.slice(0, 52) + "\u2026" : firstSentence;
|
|
2572
2575
|
database.prepare("UPDATE jobs SET title = ? WHERE id = ?").run(title, row.id);
|
|
2573
2576
|
}
|
|
2574
2577
|
}
|
|
@@ -15875,7 +15878,7 @@ async function sendJobDetail(chatId, jobId, channel) {
|
|
|
15875
15878
|
const lines = [
|
|
15876
15879
|
`Job #${job.id}: ${job.title ?? job.description}`,
|
|
15877
15880
|
buildSectionHeader("", 22),
|
|
15878
|
-
...job.title ? [`Task: ${job.description
|
|
15881
|
+
...job.title ? [`Task: ${job.description}`] : [],
|
|
15879
15882
|
`Runs: ${schedule2}${tz}`,
|
|
15880
15883
|
`Backend: ${backend2} | Model: ${model2}`,
|
|
15881
15884
|
`Last run: ${lastRun}${lastRunStatus ? ` (${lastRunStatus})` : ""}`,
|
package/package.json
CHANGED