@gonzih/cc-tg 0.3.15 → 0.4.0

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/README.md CHANGED
@@ -25,6 +25,7 @@ Open your bot in Telegram and start chatting.
25
25
  | `TELEGRAM_BOT_TOKEN` | yes | From @BotFather |
26
26
  | `CLAUDE_CODE_TOKEN` | yes* | Claude Code OAuth token (starts with `sk-ant-oat`) |
27
27
  | `CLAUDE_CODE_OAUTH_TOKEN` | yes* | Alias for `CLAUDE_CODE_TOKEN` |
28
+ | `CLAUDE_CODE_OAUTH_TOKENS` | no | Comma-separated OAuth tokens for rotation — e.g. `token1,token2,token3`. When one account hits its usage limit, automatically switches to the next token instead of sleeping. |
28
29
  | `ANTHROPIC_API_KEY` | yes* | Alternative — API key from console.anthropic.com |
29
30
  | `ALLOWED_USER_IDS` | no | Comma-separated Telegram user IDs. Leave empty to allow anyone |
30
31
  | `CWD` | no | Working directory for Claude Code. Defaults to current directory |
@@ -157,6 +158,9 @@ cc-tg works with the [cc-agent](https://github.com/Gonzih/cc-agent) MCP server t
157
158
  <string>your_token</string>
158
159
  <key>CLAUDE_CODE_TOKEN</key>
159
160
  <string>your_claude_token</string>
161
+ <!-- Optional: comma-separated OAuth tokens for automatic rotation on usage limit -->
162
+ <!-- <key>CLAUDE_CODE_OAUTH_TOKENS</key> -->
163
+ <!-- <string>token1,token2,token3</string> -->
160
164
  <key>ALLOWED_USER_IDS</key>
161
165
  <string>your_telegram_id</string>
162
166
  <key>CWD</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-tg",
3
- "version": "0.3.15",
3
+ "version": "0.4.0",
4
4
  "description": "Claude Code Telegram bot — chat with Claude Code via Telegram",
5
5
  "type": "module",
6
6
  "bin": {
package/dist/bot.d.ts DELETED
@@ -1,56 +0,0 @@
1
- /**
2
- * Telegram bot that routes messages to/from a Claude Code subprocess.
3
- * One ClaudeProcess per chat_id — sessions are isolated per user.
4
- */
5
- import TelegramBot from "node-telegram-bot-api";
6
- export interface BotOptions {
7
- telegramToken: string;
8
- claudeToken?: string;
9
- cwd?: string;
10
- allowedUserIds?: number[];
11
- groupChatIds?: number[];
12
- }
13
- export declare class CcTgBot {
14
- private bot;
15
- private sessions;
16
- private pendingRetries;
17
- private opts;
18
- private cron;
19
- private costStore;
20
- private botUsername;
21
- private botId;
22
- constructor(opts: BotOptions);
23
- private registerBotCommands;
24
- private isAllowed;
25
- private handleTelegram;
26
- private handleVoice;
27
- private handlePhoto;
28
- private handleDocument;
29
- private getOrCreateSession;
30
- private handleClaudeMessage;
31
- private startTyping;
32
- private stopTyping;
33
- private flushPending;
34
- private trackWrittenFiles;
35
- private isSensitiveFile;
36
- private uploadMentionedFiles;
37
- private extractToolName;
38
- private runCronTask;
39
- private handleCron;
40
- private handleCronEdit;
41
- /** Find cc-agent PIDs via pgrep. Returns array of numeric PIDs. */
42
- private findCcAgentPids;
43
- /** Kill cc-agent PIDs with SIGTERM. Returns the list of killed PIDs. */
44
- private killCcAgent;
45
- private handleReloadMcp;
46
- private handleMcpStatus;
47
- private handleMcpVersion;
48
- private handleClearNpxCache;
49
- private handleRestart;
50
- private handleGetFile;
51
- private callCcAgentTool;
52
- private killSession;
53
- getMe(): Promise<TelegramBot.User>;
54
- stop(): void;
55
- }
56
- export declare function splitMessage(text: string, maxLen?: number): string[];