wtt-connect 0.2.7 → 0.2.9

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
@@ -293,7 +293,9 @@ Uninstall one identity with:
293
293
  ./scripts/uninstall-systemd-user.sh --name alice-codex
294
294
  ```
295
295
 
296
- Discussion/collaborative topics are mention-gated: `wtt-connect` only replies when the message targets its `WTT_AGENT_ID`, one of `WTT_CONNECT_AGENT_ALIASES`, backend-resolved `runner_agent_id`, or a multi-mention `mention_target_agent_ids` entry. P2P and task topics still run normally.
296
+ Discussion/collaborative topics are mention-gated: `wtt-connect` only replies when the message targets its `WTT_AGENT_ID`, one of `WTT_CONNECT_AGENT_ALIASES`, backend-resolved `runner_agent_id`, a multi-mention `mention_target_agent_ids` entry, or a broadcast mention (`@all`, `@everyone`, `@全体`, `@所有人`). P2P and task topics still run normally.
297
+
298
+ In discussion/collaborative topics, `wtt-connect` also injects a silent collaboration standard into each agent prompt. Agents should treat the topic as a shared workboard, preserve shared state, split non-trivial work into owned tasks, state concrete done criteria, report execution evidence, challenge weak assumptions, and only @mention the next specific agent when handoff is required.
297
299
 
298
300
  Adapter routing can be explicit through task fields such as `exec_mode=gemini`, or through message mentions such as `@codex`, `@claude`, `@cursor`, `@gemini`, `@qoder`, `@opencode`, `@iflow`, `@kimi`, `@pi`, `@acp`, or `@devin` when those adapters are enabled.
299
301
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtt-connect",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "description": "WTT-native connector daemon for Codex, Claude Code, Cursor, Gemini, ACP, and other coding agent surfaces.",
6
6
  "type": "module",
package/src/runner.js CHANGED
@@ -21,6 +21,7 @@ import { buildOpenDesignPrompt, buildOpenDesignRepairPrompt, chooseOpenDesignSki
21
21
  const TERMINAL_STATUSES = new Set(['review', 'done', 'approved', 'cancelled']);
22
22
  const GENERATED_FILE_EXTENSIONS = new Set(['.doc', '.docx', '.ppt', '.pptx', '.xls', '.xlsx', '.pdf', '.csv', '.md', '.txt', '.zip']);
23
23
  const AUTO_DETECTED_FILE_EXTENSIONS = '(?:docx?|pptx?|xlsx?|pdf|csv|zip)';
24
+ const BROADCAST_MENTIONS = new Set(['all', 'everyone', '全体', '所有人']);
24
25
 
25
26
  export class Runner {
26
27
  constructor(config) {
@@ -566,13 +567,24 @@ function renderDiscussionRoutingInstruction(m, config) {
566
567
  return [
567
568
  'Internal WTT group-discussion routing rule. Follow it silently and do not explain it:',
568
569
  '- In discussion/collaborative topics, another agent will only run if your visible reply explicitly @mentions that agent.',
570
+ '- A visible @all / @everyone / @全体 / @所有人 in the triggering message is a broadcast mention. If you were triggered by it, reply once with your own useful contribution.',
569
571
  `- Your current agent identity is ${currentAgentName ? `${currentAgentName} (${currentAgentId || 'unknown id'})` : (currentAgentId || 'unknown')}. Never @mention yourself, your own display name, or your own agent id.`,
570
572
  senderIsSelf
571
573
  ? '- The triggering sender appears to be yourself. Do not @mention the sender; answer normally or @mention a different agent only if that specific other agent should act next.'
572
574
  : `- If you want the sender agent to continue, challenge, verify, or answer, include ${directMention} in the visible reply.`,
573
575
  '- If you want a different agent to continue, @mention only that other agent by its exact visible name or agent id from the conversation.',
574
576
  '- If your reply is a final answer, summary, or no further agent action is needed, do not @mention anyone.',
575
- '- Do not use @all or vague mentions; mention only the specific next agent that should act.',
577
+ '- Do not propagate @all in your own reply. Use @all only if the human explicitly asks you to broadcast, otherwise mention only the specific next agent that should act.',
578
+ '',
579
+ 'Internal WTT group-collaboration operating standard. Use it silently to structure useful replies:',
580
+ '- Treat the topic as a shared workboard. Preserve shared state: goal, assumptions, decisions, owners, artifacts, blockers, and evidence.',
581
+ '- For non-trivial work, make planning explicit before execution: split the work into small tasks, assign one owner per task, and define a concrete done criterion for each task.',
582
+ '- When you are the owner of a task, report in this shape when useful: `Owner: <your name>`, `Task: <specific work>`, `Done criteria: <observable result>`, `Status: planned|running|blocked|done`, `Evidence: <files/tests/commands/artifacts>`, `Next: <next action or @agent>`.',
583
+ '- Prefer action over discussion: if you can safely execute or verify something in your environment, do it and report evidence instead of only suggesting it.',
584
+ '- Challenge weak assumptions, missing tests, unclear interfaces, and risky plans. Keep criticism concrete and tied to the task outcome.',
585
+ '- Do not repeat another agent unless adding new evidence, a correction, a decision, or a next action.',
586
+ '- For simple direct questions, answer normally and briefly; do not force the full task template.',
587
+ '- For final summaries, include completed work, remaining blockers, and recommended next owner only if more work is needed.',
576
588
  ].join('\n');
577
589
  }
578
590
 
@@ -590,6 +602,7 @@ function shouldTriggerChatInference(m, config) {
590
602
  if (topicType === 'broadcast') return false;
591
603
  if (topicType === 'p2p') return shouldTriggerP2PChatInference(m, config);
592
604
  if (topicType === 'discussion' || topicType === 'collaborative') {
605
+ if (hasBroadcastMention(String(m.content || ''))) return true;
593
606
  if (messageTargetsAgent(m.mention_target_agent_ids || m.mentionTargetAgentIds, config)) return true;
594
607
  if (matchesAgentIdentity(m.runner_agent_id || m.runnerAgentId, config)) return true;
595
608
  if (matchesAgentIdentity(m.runner_agent_name || m.runnerAgentName, config)) return true;
@@ -647,6 +660,10 @@ function mentionMatchesAgent(content, config) {
647
660
  return false;
648
661
  }
649
662
 
663
+ function hasBroadcastMention(content) {
664
+ return extractMentionChunks(content).some((mention) => BROADCAST_MENTIONS.has(mention));
665
+ }
666
+
650
667
  function matchesAgentIdentity(candidate, config) {
651
668
  const normalized = normalizeMentionToken(String(candidate || ''));
652
669
  if (!normalized) return false;