@rozek/nanoclaw 0.0.21 → 0.0.24

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.
Files changed (41) hide show
  1. package/CLAUDE.md +4 -0
  2. package/README.md +5 -5
  3. package/container/Dockerfile +1 -1
  4. package/dist/channels/index.d.ts +1 -0
  5. package/dist/channels/index.d.ts.map +1 -1
  6. package/dist/channels/index.js +1 -0
  7. package/dist/channels/index.js.map +1 -1
  8. package/dist/channels/telegram.d.ts +20 -0
  9. package/dist/channels/telegram.d.ts.map +1 -0
  10. package/dist/channels/telegram.js +226 -0
  11. package/dist/channels/telegram.js.map +1 -0
  12. package/dist/channels/telegram.test.d.ts +2 -0
  13. package/dist/channels/telegram.test.d.ts.map +1 -0
  14. package/dist/channels/telegram.test.js +624 -0
  15. package/dist/channels/telegram.test.js.map +1 -0
  16. package/dist/channels/web.js.map +1 -1
  17. package/dist/config.d.ts +1 -1
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/config.js +18 -5
  20. package/dist/config.js.map +1 -1
  21. package/dist/container-runner.d.ts.map +1 -1
  22. package/dist/container-runner.js +16 -20
  23. package/dist/container-runner.js.map +1 -1
  24. package/dist/container-runner.test.js +4 -10
  25. package/dist/container-runner.test.js.map +1 -1
  26. package/dist/container-runtime.d.ts +9 -0
  27. package/dist/container-runtime.d.ts.map +1 -1
  28. package/dist/container-runtime.js +27 -0
  29. package/dist/container-runtime.js.map +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +6 -21
  32. package/dist/index.js.map +1 -1
  33. package/dist/timezone.d.ts +10 -0
  34. package/dist/timezone.d.ts.map +1 -1
  35. package/dist/timezone.js +21 -1
  36. package/dist/timezone.js.map +1 -1
  37. package/dist/timezone.test.js +33 -1
  38. package/dist/timezone.test.js.map +1 -1
  39. package/package.json +3 -2
  40. package/setup/index.ts +1 -0
  41. package/setup/timezone.ts +67 -0
package/CLAUDE.md CHANGED
@@ -21,6 +21,10 @@ Single Node.js process with skill-based channel system. Channels (WhatsApp, Tele
21
21
  | `groups/{name}/CLAUDE.md` | Per-group memory (isolated) |
22
22
  | `container/skills/` | Skills loaded inside agent containers (browser, status, formatting) |
23
23
 
24
+ ## Secrets / Credentials / Proxy (OneCLI)
25
+
26
+ API keys, secret keys, OAuth tokens, and auth credentials are managed by the OneCLI gateway — which handles secret injection into containers at request time, so no keys or tokens are ever passed to containers directly. Run `onecli --help`.
27
+
24
28
  ## Skills
25
29
 
26
30
  Four types of skills exist in NanoClaw. See [CONTRIBUTING.md](CONTRIBUTING.md) for the full taxonomy and guidelines.
package/README.md CHANGED
@@ -17,8 +17,8 @@
17
17
  ---
18
18
 
19
19
  > **Important:** this is my own fork of the original [qwibitai/nanoclaw](https://github.com/qwibitai/nanoclaw).
20
- >
21
- > It adds a **built-in web channel** (multi-session browser UI with Markdown Support + HTTP server) and a CLI entry point that lets you start NanoClaw with a single `npx @rozek/nanoclaw` command — no cloning or manual setup required. See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for the full installation guide.
20
+ >
21
+ > It adds a **built-in web channel** (multi-session browser UI with Markdown Support + HTTP server) and a CLI entry point that lets you start NanoClaw with a single `npx @rozek/nanoclaw` command — no cloning or manual setup required. See [Installation guide](NanoClaw_with_Web-Channel/Installation.md) · [What changed vs. upstream](NanoClaw_with_Web-Channel/Changes.md)
22
22
 
23
23
  ---
24
24
 
@@ -62,7 +62,7 @@ Then open **http://localhost:3099** in your browser. That's it.
62
62
  npx @rozek/nanoclaw --port 8080 --workspace ~/my-workspace --token mySecretToken
63
63
  ```
64
64
 
65
- See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for all options and prerequisites.
65
+ See [NanoClaw_with_Web-Channel/Installation.md](NanoClaw_with_Web-Channel/Installation.md) for all options and prerequisites.
66
66
 
67
67
  ### From source (upstream workflow)
68
68
 
@@ -107,7 +107,7 @@ Then run `/setup`. Claude Code handles everything: dependencies, authentication,
107
107
 
108
108
  ## What It Supports
109
109
 
110
- - **Built-in web channel** — Start with `npx @rozek/nanoclaw` and open your browser. No messaging app required. Full-featured chat UI with Markdown, math (KaTeX), syntax highlighting, and Mermaid diagrams. Multi-session, persistent, accessible from the LAN. *(Added in this fork — see [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md))*
110
+ - **Built-in web channel** — Start with `npx @rozek/nanoclaw` and open your browser. No messaging app required. Full-featured chat UI with Markdown, math (KaTeX), syntax highlighting, and Mermaid diagrams. Multi-session, persistent, accessible from the LAN. *(Added in this fork — see [NanoClaw_with_Web-Channel/Installation.md](NanoClaw_with_Web-Channel/Installation.md))*
111
111
  - **Multi-channel messaging** - Talk to your assistant from WhatsApp, Telegram, Discord, Slack, or Gmail. Add channels with skills like `/add-whatsapp` or `/add-telegram`. Run one or many at the same time.
112
112
  - **Isolated group context** - Each group has its own `CLAUDE.md` memory, isolated filesystem, and runs in its own container sandbox with only that filesystem mounted to it.
113
113
  - **Main channel** - Your private channel (self-chat) for admin control; every group is completely isolated
@@ -208,7 +208,7 @@ Agents run in containers, not behind application-level permission checks. They c
208
208
 
209
209
  **Should I protect the web UI with a token?**
210
210
 
211
- Yes, if NanoClaw is accessible from your LAN or the internet. Pass `--token mySecretToken` to `npx @rozek/nanoclaw`. See [NanoClaw_with_Web-Support.md](NanoClaw_with_Web-Support.md) for details.
211
+ Yes, if NanoClaw is accessible from your LAN or the internet. Pass `--token mySecretToken` to `npx @rozek/nanoclaw`. See [NanoClaw_with_Web-Channel/Installation.md](NanoClaw_with_Web-Channel/Installation.md) for details.
212
212
 
213
213
  **Why no configuration files?**
214
214
 
@@ -1,7 +1,7 @@
1
1
  # NanoClaw Agent Container
2
2
  # Runs Claude Agent SDK in isolated Linux VM with browser automation
3
3
 
4
- FROM node:24-slim
4
+ FROM node:22-slim
5
5
 
6
6
  # Install system dependencies for Chromium
7
7
  RUN apt-get update && apt-get install -y \
@@ -1,2 +1,3 @@
1
+ import './telegram.js';
1
2
  import './web.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAcA,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAUA,OAAO,eAAe,CAAC;AAKvB,OAAO,UAAU,CAAC"}
@@ -4,6 +4,7 @@
4
4
  // gmail
5
5
  // slack
6
6
  // telegram
7
+ import './telegram.js';
7
8
  // whatsapp
8
9
  // web
9
10
  import './web.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oEAAoE;AAEpE,UAAU;AAEV,QAAQ;AAER,QAAQ;AAER,WAAW;AAEX,WAAW;AAEX,MAAM;AACN,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channels/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,oEAAoE;AAEpE,UAAU;AAEV,QAAQ;AAER,QAAQ;AAER,WAAW;AACX,OAAO,eAAe,CAAC;AAEvB,WAAW;AAEX,MAAM;AACN,OAAO,UAAU,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Channel, OnChatMetadata, OnInboundMessage, RegisteredGroup } from '../types.js';
2
+ export interface TelegramChannelOpts {
3
+ onMessage: OnInboundMessage;
4
+ onChatMetadata: OnChatMetadata;
5
+ registeredGroups: () => Record<string, RegisteredGroup>;
6
+ }
7
+ export declare class TelegramChannel implements Channel {
8
+ name: string;
9
+ private bot;
10
+ private opts;
11
+ private botToken;
12
+ constructor(botToken: string, opts: TelegramChannelOpts);
13
+ connect(): Promise<void>;
14
+ sendMessage(jid: string, text: string): Promise<void>;
15
+ isConnected(): boolean;
16
+ ownsJid(jid: string): boolean;
17
+ disconnect(): Promise<void>;
18
+ setTyping(jid: string, isTyping: boolean): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=telegram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram.d.ts","sourceRoot":"","sources":["../../src/channels/telegram.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACzD;AAyBD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,IAAI,SAAc;IAElB,OAAO,CAAC,GAAG,CAAoB;IAC/B,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB;IAKjD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwLxB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4B3D,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAS/D"}
@@ -0,0 +1,226 @@
1
+ import https from 'https';
2
+ import { Bot } from 'grammy';
3
+ import { ASSISTANT_NAME, TRIGGER_PATTERN } from '../config.js';
4
+ import { readEnvFile } from '../env.js';
5
+ import { logger } from '../logger.js';
6
+ import { registerChannel } from './registry.js';
7
+ /**
8
+ * Send a message with Telegram Markdown parse mode, falling back to plain text.
9
+ * Claude's output naturally matches Telegram's Markdown v1 format:
10
+ * *bold*, _italic_, `code`, ```code blocks```, [links](url)
11
+ */
12
+ async function sendTelegramMessage(api, chatId, text, options = {}) {
13
+ try {
14
+ await api.sendMessage(chatId, text, {
15
+ ...options,
16
+ parse_mode: 'Markdown',
17
+ });
18
+ }
19
+ catch (err) {
20
+ // Fallback: send as plain text if Markdown parsing fails
21
+ logger.debug({ err }, 'Markdown send failed, falling back to plain text');
22
+ await api.sendMessage(chatId, text, options);
23
+ }
24
+ }
25
+ export class TelegramChannel {
26
+ name = 'telegram';
27
+ bot = null;
28
+ opts;
29
+ botToken;
30
+ constructor(botToken, opts) {
31
+ this.botToken = botToken;
32
+ this.opts = opts;
33
+ }
34
+ async connect() {
35
+ this.bot = new Bot(this.botToken, {
36
+ client: {
37
+ baseFetchConfig: { agent: https.globalAgent, compress: true },
38
+ },
39
+ });
40
+ // Command to get chat ID (useful for registration)
41
+ this.bot.command('chatid', (ctx) => {
42
+ const chatId = ctx.chat.id;
43
+ const chatType = ctx.chat.type;
44
+ const chatName = chatType === 'private'
45
+ ? ctx.from?.first_name || 'Private'
46
+ : ctx.chat.title || 'Unknown';
47
+ ctx.reply(`Chat ID: \`tg:${chatId}\`\nName: ${chatName}\nType: ${chatType}`, { parse_mode: 'Markdown' });
48
+ });
49
+ // Command to check bot status
50
+ this.bot.command('ping', (ctx) => {
51
+ ctx.reply(`${ASSISTANT_NAME} is online.`);
52
+ });
53
+ // Telegram bot commands handled above — skip them in the general handler
54
+ // so they don't also get stored as messages. All other /commands flow through.
55
+ const TELEGRAM_BOT_COMMANDS = new Set(['chatid', 'ping']);
56
+ this.bot.on('message:text', async (ctx) => {
57
+ if (ctx.message.text.startsWith('/')) {
58
+ const cmd = ctx.message.text.slice(1).split(/[\s@]/)[0].toLowerCase();
59
+ if (TELEGRAM_BOT_COMMANDS.has(cmd))
60
+ return;
61
+ }
62
+ const chatJid = `tg:${ctx.chat.id}`;
63
+ let content = ctx.message.text;
64
+ const timestamp = new Date(ctx.message.date * 1000).toISOString();
65
+ const senderName = ctx.from?.first_name ||
66
+ ctx.from?.username ||
67
+ ctx.from?.id.toString() ||
68
+ 'Unknown';
69
+ const sender = ctx.from?.id.toString() || '';
70
+ const msgId = ctx.message.message_id.toString();
71
+ // Determine chat name
72
+ const chatName = ctx.chat.type === 'private'
73
+ ? senderName
74
+ : ctx.chat.title || chatJid;
75
+ // Translate Telegram @bot_username mentions into TRIGGER_PATTERN format.
76
+ // Telegram @mentions (e.g., @andy_ai_bot) won't match TRIGGER_PATTERN
77
+ // (e.g., ^@Andy\b), so we prepend the trigger when the bot is @mentioned.
78
+ const botUsername = ctx.me?.username?.toLowerCase();
79
+ if (botUsername) {
80
+ const entities = ctx.message.entities || [];
81
+ const isBotMentioned = entities.some((entity) => {
82
+ if (entity.type === 'mention') {
83
+ const mentionText = content
84
+ .substring(entity.offset, entity.offset + entity.length)
85
+ .toLowerCase();
86
+ return mentionText === `@${botUsername}`;
87
+ }
88
+ return false;
89
+ });
90
+ if (isBotMentioned && !TRIGGER_PATTERN.test(content)) {
91
+ content = `@${ASSISTANT_NAME} ${content}`;
92
+ }
93
+ }
94
+ // Store chat metadata for discovery
95
+ const isGroup = ctx.chat.type === 'group' || ctx.chat.type === 'supergroup';
96
+ this.opts.onChatMetadata(chatJid, timestamp, chatName, 'telegram', isGroup);
97
+ // Only deliver full message for registered groups
98
+ const group = this.opts.registeredGroups()[chatJid];
99
+ if (!group) {
100
+ logger.debug({ chatJid, chatName }, 'Message from unregistered Telegram chat');
101
+ return;
102
+ }
103
+ // Deliver message — startMessageLoop() will pick it up
104
+ this.opts.onMessage(chatJid, {
105
+ id: msgId,
106
+ chat_jid: chatJid,
107
+ sender,
108
+ sender_name: senderName,
109
+ content,
110
+ timestamp,
111
+ is_from_me: false,
112
+ });
113
+ logger.info({ chatJid, chatName, sender: senderName }, 'Telegram message stored');
114
+ });
115
+ // Handle non-text messages with placeholders so the agent knows something was sent
116
+ const storeNonText = (ctx, placeholder) => {
117
+ const chatJid = `tg:${ctx.chat.id}`;
118
+ const group = this.opts.registeredGroups()[chatJid];
119
+ if (!group)
120
+ return;
121
+ const timestamp = new Date(ctx.message.date * 1000).toISOString();
122
+ const senderName = ctx.from?.first_name ||
123
+ ctx.from?.username ||
124
+ ctx.from?.id?.toString() ||
125
+ 'Unknown';
126
+ const caption = ctx.message.caption ? ` ${ctx.message.caption}` : '';
127
+ const isGroup = ctx.chat.type === 'group' || ctx.chat.type === 'supergroup';
128
+ this.opts.onChatMetadata(chatJid, timestamp, undefined, 'telegram', isGroup);
129
+ this.opts.onMessage(chatJid, {
130
+ id: ctx.message.message_id.toString(),
131
+ chat_jid: chatJid,
132
+ sender: ctx.from?.id?.toString() || '',
133
+ sender_name: senderName,
134
+ content: `${placeholder}${caption}`,
135
+ timestamp,
136
+ is_from_me: false,
137
+ });
138
+ };
139
+ this.bot.on('message:photo', (ctx) => storeNonText(ctx, '[Photo]'));
140
+ this.bot.on('message:video', (ctx) => storeNonText(ctx, '[Video]'));
141
+ this.bot.on('message:voice', (ctx) => storeNonText(ctx, '[Voice message]'));
142
+ this.bot.on('message:audio', (ctx) => storeNonText(ctx, '[Audio]'));
143
+ this.bot.on('message:document', (ctx) => {
144
+ const name = ctx.message.document?.file_name || 'file';
145
+ storeNonText(ctx, `[Document: ${name}]`);
146
+ });
147
+ this.bot.on('message:sticker', (ctx) => {
148
+ const emoji = ctx.message.sticker?.emoji || '';
149
+ storeNonText(ctx, `[Sticker ${emoji}]`);
150
+ });
151
+ this.bot.on('message:location', (ctx) => storeNonText(ctx, '[Location]'));
152
+ this.bot.on('message:contact', (ctx) => storeNonText(ctx, '[Contact]'));
153
+ // Handle errors gracefully
154
+ this.bot.catch((err) => {
155
+ logger.error({ err: err.message }, 'Telegram bot error');
156
+ });
157
+ // Start polling — returns a Promise that resolves when started
158
+ return new Promise((resolve) => {
159
+ this.bot.start({
160
+ onStart: (botInfo) => {
161
+ logger.info({ username: botInfo.username, id: botInfo.id }, 'Telegram bot connected');
162
+ console.log(`\n Telegram bot: @${botInfo.username}`);
163
+ console.log(` Send /chatid to the bot to get a chat's registration ID\n`);
164
+ resolve();
165
+ },
166
+ });
167
+ });
168
+ }
169
+ async sendMessage(jid, text) {
170
+ if (!this.bot) {
171
+ logger.warn('Telegram bot not initialized');
172
+ return;
173
+ }
174
+ try {
175
+ const numericId = jid.replace(/^tg:/, '');
176
+ // Telegram has a 4096 character limit per message — split if needed
177
+ const MAX_LENGTH = 4096;
178
+ if (text.length <= MAX_LENGTH) {
179
+ await sendTelegramMessage(this.bot.api, numericId, text);
180
+ }
181
+ else {
182
+ for (let i = 0; i < text.length; i += MAX_LENGTH) {
183
+ await sendTelegramMessage(this.bot.api, numericId, text.slice(i, i + MAX_LENGTH));
184
+ }
185
+ }
186
+ logger.info({ jid, length: text.length }, 'Telegram message sent');
187
+ }
188
+ catch (err) {
189
+ logger.error({ jid, err }, 'Failed to send Telegram message');
190
+ }
191
+ }
192
+ isConnected() {
193
+ return this.bot !== null;
194
+ }
195
+ ownsJid(jid) {
196
+ return jid.startsWith('tg:');
197
+ }
198
+ async disconnect() {
199
+ if (this.bot) {
200
+ this.bot.stop();
201
+ this.bot = null;
202
+ logger.info('Telegram bot stopped');
203
+ }
204
+ }
205
+ async setTyping(jid, isTyping) {
206
+ if (!this.bot || !isTyping)
207
+ return;
208
+ try {
209
+ const numericId = jid.replace(/^tg:/, '');
210
+ await this.bot.api.sendChatAction(numericId, 'typing');
211
+ }
212
+ catch (err) {
213
+ logger.debug({ jid, err }, 'Failed to send Telegram typing indicator');
214
+ }
215
+ }
216
+ }
217
+ registerChannel('telegram', (opts) => {
218
+ const envVars = readEnvFile(['TELEGRAM_BOT_TOKEN']);
219
+ const token = process.env.TELEGRAM_BOT_TOKEN || envVars.TELEGRAM_BOT_TOKEN || '';
220
+ if (!token) {
221
+ logger.warn('Telegram: TELEGRAM_BOT_TOKEN not set');
222
+ return null;
223
+ }
224
+ return new TelegramChannel(token, opts);
225
+ });
226
+ //# sourceMappingURL=telegram.js.map
@@ -0,0 +1 @@
1
+ {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MAAM,EAAE,EAAE,CAAC,CAAC;YAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACzD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,0CAA0C,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF;AAED,eAAe,CAAC,UAAU,EAAE,CAAC,IAAiB,EAAE,EAAE;IAChD,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACpD,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC;IACrE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=telegram.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram.test.d.ts","sourceRoot":"","sources":["../../src/channels/telegram.test.ts"],"names":[],"mappings":""}