metame-cli 1.5.20 → 1.5.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metame-cli",
3
- "version": "1.5.20",
3
+ "version": "1.5.21",
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": {
@@ -4,7 +4,7 @@ let userAcl = null;
4
4
  try { userAcl = require('./daemon-user-acl'); } catch { /* optional */ }
5
5
  const { findTeamMember: _findTeamMember } = require('./daemon-team-dispatch');
6
6
  const { isRemoteMember } = require('./daemon-remote-dispatch');
7
- const { buildThreadChatId, rawChatId: _threadRawChatId } = require('./core/thread-chat-id');
7
+ const { buildThreadChatId, isThreadChatId, rawChatId: _threadRawChatId } = require('./core/thread-chat-id');
8
8
  const imessageIO = (() => { try { return require('./daemon-siri-imessage'); } catch { return null; } })();
9
9
  const siriBridgeMod = (() => { try { return require('./daemon-siri-bridge'); } catch { return null; } })();
10
10
  const weixinBridgeMod = (() => { try { return require('./daemon-weixin-bridge'); } catch { return null; } })();
@@ -310,7 +310,12 @@ function createBridgeStarter(deps) {
310
310
  return;
311
311
  }
312
312
 
313
- const virtualChatId = `_agent_${member.key}`;
313
+ // When dispatching from a topic thread, include the thread ID in the
314
+ // virtual session key so each topic gets its own independent session.
315
+ const realChatIdStr = String(realChatId || '');
316
+ const virtualChatId = isThreadChatId(realChatIdStr)
317
+ ? `_agent_${member.key}::${realChatIdStr}`
318
+ : `_agent_${member.key}`;
314
319
  const parentCwd = member.cwd || boundProj.cwd;
315
320
  const resolvedParentCwd = parentCwd.replace(/^~/, require('os').homedir());
316
321
  const memberCwd = _getMemberCwd(
@@ -880,7 +885,9 @@ function createBridgeStarter(deps) {
880
885
  // Priority 3: bare /stop → sticky
881
886
  if (!_targetKey && !_stopArg) _targetKey = _stickyKey;
882
887
  if (_targetKey) {
883
- const vid = `_agent_${_targetKey}`;
888
+ const vid = isThreadChatId(String(pipelineChatId))
889
+ ? `_agent_${_targetKey}::${pipelineChatId}`
890
+ : `_agent_${_targetKey}`;
884
891
  const member = _boundProj.team.find(t => t.key === _targetKey);
885
892
  const label = member ? `${member.icon || '🤖'} ${member.name}` : _targetKey;
886
893
  pipeline.clearQueue(vid);
@@ -934,7 +941,10 @@ function createBridgeStarter(deps) {
934
941
  bot.sendMarkdown(pipelineChatId, `${member.icon || '🤖'} **${member.name}** 在线`)
935
942
  .then((msg) => {
936
943
  if (msg && msg.message_id) {
937
- trackBridgeReplyMapping(msg.message_id, inferSessionMapping(`_agent_${member.key}`, {
944
+ const _vidNick = isThreadChatId(String(pipelineChatId))
945
+ ? `_agent_${member.key}::${pipelineChatId}`
946
+ : `_agent_${member.key}`;
947
+ trackBridgeReplyMapping(msg.message_id, inferSessionMapping(_vidNick, {
938
948
  agentKey: member.key,
939
949
  cwd: member.cwd || _boundProj.cwd,
940
950
  engine: member.engine || _boundProj.engine || 'claude',