@gonzih/cc-tg 0.9.51 → 0.9.53
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/bot.d.ts +0 -2
- package/dist/bot.js +9 -16
- package/package.json +2 -2
package/dist/bot.d.ts
CHANGED
package/dist/bot.js
CHANGED
|
@@ -17,7 +17,7 @@ import { getCurrentToken, rotateToken, getTokenIndex, getTokenCount } from "./to
|
|
|
17
17
|
import { writeChatLog } from "./notifier.js";
|
|
18
18
|
import { CronManager } from "./cron.js";
|
|
19
19
|
import { parseRoutingTag, ensureMetaAgent, routeToMetaAgent } from "./router.js";
|
|
20
|
-
import { VOICE_PENDING_KEY, VOICE_FAILED_KEY, TTL, metaAgentStatusKey } from "@gonzih/cc-wire";
|
|
20
|
+
import { VOICE_PENDING_KEY, VOICE_FAILED_KEY, TTL, metaAgentStatusKey, wikiKey, wikiUpdatedKey } from "@gonzih/cc-wire";
|
|
21
21
|
const BOT_COMMANDS = [
|
|
22
22
|
{ command: "start", description: "Reset session and start fresh" },
|
|
23
23
|
{ command: "reset", description: "Reset Claude session" },
|
|
@@ -1409,13 +1409,6 @@ export class CcTgBot {
|
|
|
1409
1409
|
await this.replyToChat(chatId, `Failed to get agents status: ${err.message}`, threadId);
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
// ─── Wiki helpers ───────────────────────────────────────────────────────────
|
|
1413
|
-
wikiKey(repoSlug) {
|
|
1414
|
-
return `cca:wiki:${repoSlug}`;
|
|
1415
|
-
}
|
|
1416
|
-
wikiUpdatedKey(repoSlug) {
|
|
1417
|
-
return `cca:wiki:${repoSlug}:updated`;
|
|
1418
|
-
}
|
|
1419
1412
|
async handleWiki(chatId, text, threadId) {
|
|
1420
1413
|
const args = text.slice("/wiki".length).trim();
|
|
1421
1414
|
const parts = args.split(/\s+/);
|
|
@@ -1467,7 +1460,7 @@ export class CcTgBot {
|
|
|
1467
1460
|
return;
|
|
1468
1461
|
}
|
|
1469
1462
|
if (repoSlug) {
|
|
1470
|
-
const pages = await this.redis.hkeys(
|
|
1463
|
+
const pages = await this.redis.hkeys(wikiKey(repoSlug));
|
|
1471
1464
|
if (!pages.length) {
|
|
1472
1465
|
await this.replyToChat(chatId, `No wiki pages for "${repoSlug}".`, threadId);
|
|
1473
1466
|
return;
|
|
@@ -1500,7 +1493,7 @@ export class CcTgBot {
|
|
|
1500
1493
|
await this.replyToChat(chatId, "Redis not configured — wiki unavailable.", threadId);
|
|
1501
1494
|
return;
|
|
1502
1495
|
}
|
|
1503
|
-
const content = await this.redis.hget(
|
|
1496
|
+
const content = await this.redis.hget(wikiKey(repoSlug), pageName);
|
|
1504
1497
|
if (!content) {
|
|
1505
1498
|
await this.replyToChat(chatId, `Page "${pageName}" not found in "${repoSlug}".`, threadId);
|
|
1506
1499
|
return;
|
|
@@ -1520,8 +1513,8 @@ export class CcTgBot {
|
|
|
1520
1513
|
await this.replyToChat(chatId, "Redis not configured — wiki unavailable.", threadId);
|
|
1521
1514
|
return;
|
|
1522
1515
|
}
|
|
1523
|
-
await this.redis.hset(
|
|
1524
|
-
await this.redis.set(
|
|
1516
|
+
await this.redis.hset(wikiKey(repoSlug), pageName, content);
|
|
1517
|
+
await this.redis.set(wikiUpdatedKey(repoSlug), new Date().toISOString());
|
|
1525
1518
|
await this.replyToChat(chatId, `Updated "${pageName}" in "${repoSlug}".`, threadId);
|
|
1526
1519
|
}
|
|
1527
1520
|
async handleWikiDelete(chatId, repoSlug, pageName, threadId) {
|
|
@@ -1529,9 +1522,9 @@ export class CcTgBot {
|
|
|
1529
1522
|
await this.replyToChat(chatId, "Redis not configured — wiki unavailable.", threadId);
|
|
1530
1523
|
return;
|
|
1531
1524
|
}
|
|
1532
|
-
const deleted = await this.redis.hdel(
|
|
1525
|
+
const deleted = await this.redis.hdel(wikiKey(repoSlug), pageName);
|
|
1533
1526
|
if (deleted) {
|
|
1534
|
-
await this.redis.set(
|
|
1527
|
+
await this.redis.set(wikiUpdatedKey(repoSlug), new Date().toISOString());
|
|
1535
1528
|
await this.replyToChat(chatId, `Deleted "${pageName}" from "${repoSlug}".`, threadId);
|
|
1536
1529
|
}
|
|
1537
1530
|
else {
|
|
@@ -1567,7 +1560,7 @@ export class CcTgBot {
|
|
|
1567
1560
|
const pageName = file.replace(/\.md$/, "");
|
|
1568
1561
|
try {
|
|
1569
1562
|
const content = readFileSync(join(wikiDir, file), "utf8");
|
|
1570
|
-
await this.redis.hset(
|
|
1563
|
+
await this.redis.hset(wikiKey(repoSlug), pageName, content);
|
|
1571
1564
|
synced++;
|
|
1572
1565
|
}
|
|
1573
1566
|
catch (err) {
|
|
@@ -1575,7 +1568,7 @@ export class CcTgBot {
|
|
|
1575
1568
|
}
|
|
1576
1569
|
}
|
|
1577
1570
|
if (synced > 0) {
|
|
1578
|
-
await this.redis.set(
|
|
1571
|
+
await this.redis.set(wikiUpdatedKey(repoSlug), new Date().toISOString());
|
|
1579
1572
|
}
|
|
1580
1573
|
let reply = `Synced ${synced}/${files.length} pages to cca:wiki:${repoSlug}`;
|
|
1581
1574
|
if (errors.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gonzih/cc-tg",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.53",
|
|
4
4
|
"description": "Claude Code Telegram bot — chat with Claude Code via Telegram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@gonzih/agent-ops": "^0.1.0",
|
|
22
|
-
"@gonzih/cc-wire": "^0.1.
|
|
22
|
+
"@gonzih/cc-wire": "^0.1.4",
|
|
23
23
|
"node-telegram-bot-api": "^0.66.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|