metame-cli 1.4.3 → 1.4.5

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
@@ -205,6 +205,8 @@ metame daemon install-launchd # Auto-start on boot + crash recovery
205
205
 
206
206
  Done. Open Telegram, message your bot.
207
207
 
208
+ > **First message?** New chats aren't whitelisted yet. The bot will reply with a one-step setup command — just send `/bind personal ~/` and you're in.
209
+
208
210
  ---
209
211
 
210
212
  ## Core Capabilities
@@ -341,7 +343,7 @@ All agents share your cognitive profile (`~/.claude_profile.yaml`) — they all
341
343
  ## Security
342
344
 
343
345
  - All data stays on your machine. No cloud, no telemetry.
344
- - `allowed_chat_ids` whitelist — unauthorized users are silently ignored.
346
+ - `allowed_chat_ids` whitelist — unauthorized users get a one-step `/bind` guide instead of silent rejection.
345
347
  - `operator_ids` for shared groups — non-operators get read-only mode.
346
348
  - `~/.metame/` directory is mode 700.
347
349
  - Bot tokens stored locally, never transmitted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metame-cli",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "The Cognitive Profile Layer for Claude Code. Knows how you think, not just what you said.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/scripts/daemon.js CHANGED
@@ -1126,9 +1126,10 @@ async function startTelegramBridge(config, executeTaskByName) {
1126
1126
  // Exception: /bind and /agent bind/new are allowed from any chat so users can self-register new groups
1127
1127
  const allowedIds = (loadConfig().telegram && loadConfig().telegram.allowed_chat_ids) || [];
1128
1128
  const trimmedText = msg.text && msg.text.trim();
1129
- const isBindCmd = trimmedText && (trimmedText.startsWith('/agent bind') || trimmedText.startsWith('/agent new'));
1129
+ const isBindCmd = trimmedText && (trimmedText.startsWith('/bind') || trimmedText.startsWith('/agent bind') || trimmedText.startsWith('/agent new'));
1130
1130
  if (!allowedIds.includes(chatId) && !isBindCmd) {
1131
1131
  log('WARN', `Rejected message from unauthorized chat: ${chatId}`);
1132
+ bot.sendMessage(chatId, `⚠️ This chat (ID: ${chatId}) is not authorized.\n\nTo get started, send:\n/bind personal ~/\n\nThis will register this chat and bind it to your home directory.`).catch(() => {});
1132
1133
  continue;
1133
1134
  }
1134
1135
 
@@ -1997,6 +1998,11 @@ async function handleCommand(bot, chatId, text, config, executeTaskByName, sende
1997
1998
  }
1998
1999
  }
1999
2000
 
2001
+ // /bind <name> [cwd] → alias for /agent bind <name> [cwd]
2002
+ if (text === '/bind' || text.startsWith('/bind ')) {
2003
+ text = '/agent bind' + text.slice(5);
2004
+ }
2005
+
2000
2006
  if (text === '/agent' || text.startsWith('/agent ')) {
2001
2007
  const agentArg = text === '/agent' ? '' : text.slice(7).trim();
2002
2008
  const agentParts = agentArg.split(/\s+/);
@@ -4604,9 +4610,10 @@ async function startFeishuBridge(config, executeTaskByName) {
4604
4610
  const liveCfg = loadConfig();
4605
4611
  const allowedIds = (liveCfg.feishu && liveCfg.feishu.allowed_chat_ids) || [];
4606
4612
  const trimmedText = text && text.trim();
4607
- const isBindCmd = trimmedText && (trimmedText.startsWith('/agent bind') || trimmedText.startsWith('/agent new'));
4613
+ const isBindCmd = trimmedText && (trimmedText.startsWith('/bind') || trimmedText.startsWith('/agent bind') || trimmedText.startsWith('/agent new'));
4608
4614
  if (!allowedIds.includes(chatId) && !isBindCmd) {
4609
4615
  log('WARN', `Feishu: rejected message from ${chatId}`);
4616
+ bot.sendMessage(chatId, `⚠️ 此会话 (ID: ${chatId}) 未授权。\n\n发送以下命令注册:\n/bind personal ~/\n\n这会将此会话绑定到你的主目录。`).catch(() => {});
4610
4617
  return;
4611
4618
  }
4612
4619