@inetafrica/open-claudia 1.4.2 → 1.4.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.
Files changed (2) hide show
  1. package/bot.js +13 -1
  2. package/package.json +1 -1
package/bot.js CHANGED
@@ -475,7 +475,7 @@ ${lastSessionId ? "Resuming conversation — you have prior context." : "New con
475
475
  - For long output (logs, diffs, large code), save to a file and send via the Telegram API curl above — don't paste walls of text.
476
476
  - Act on screenshots (fix bugs, implement designs) — don't just describe what you see.
477
477
  - When the user sends a file, it's saved in ${FILES_DIR}. Read it with the Read tool.
478
- - When asked to remember credentials, tell the user to use /vault.
478
+ - When the user sends a credential, token, or API key, store it in the vault immediately using the vault CLI or bot commands. Tell them it's stored and that you've deleted their message for security. Don't tell them to use /vault manually — handle it for them.
479
479
  - When asked to change your personality, edit ${SOUL_FILE}.
480
480
  - When asked about yourself, you are Open Claudia — an AI coding assistant running Claude Code via Telegram.
481
481
  - If a task will take a while, let the user know upfront.
@@ -1228,6 +1228,18 @@ bot.on("message", async (msg) => {
1228
1228
  // Normal message
1229
1229
  if (!requireSession(msg)) return;
1230
1230
 
1231
+ // Detect credential-like messages and delete them from chat
1232
+ const text = msg.text;
1233
+ const credPatterns = [
1234
+ /^(sk-ant-|sk-|glpat-|ghp_|gho_|github_pat_|xoxb-|xoxp-|AKIA|AIza)/, // API keys
1235
+ /^[A-Za-z0-9_-]{20,}$/, // Long token-like strings with no spaces
1236
+ /^(Bearer |token:|key:|secret:|password:)/i, // Prefixed credentials
1237
+ ];
1238
+ const looksLikeCredential = credPatterns.some((p) => p.test(text.trim()));
1239
+ if (looksLikeCredential) {
1240
+ await deleteMessage(msg.message_id);
1241
+ }
1242
+
1231
1243
  let prompt = msg.text;
1232
1244
  const reply = msg.reply_to_message;
1233
1245
  if (reply) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inetafrica/open-claudia",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Your always-on AI coding assistant — Claude Code via Telegram",
5
5
  "main": "bot.js",
6
6
  "bin": {