wtt-connect 0.2.8 → 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 +1 -1
- package/package.json +1 -1
- package/src/runner.js +8 -1
package/README.md
CHANGED
|
@@ -293,7 +293,7 @@ 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`,
|
|
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
297
|
|
|
298
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.
|
|
299
299
|
|
package/package.json
CHANGED
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,14 @@ 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
|
|
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.',
|
|
576
578
|
'',
|
|
577
579
|
'Internal WTT group-collaboration operating standard. Use it silently to structure useful replies:',
|
|
578
580
|
'- Treat the topic as a shared workboard. Preserve shared state: goal, assumptions, decisions, owners, artifacts, blockers, and evidence.',
|
|
@@ -600,6 +602,7 @@ function shouldTriggerChatInference(m, config) {
|
|
|
600
602
|
if (topicType === 'broadcast') return false;
|
|
601
603
|
if (topicType === 'p2p') return shouldTriggerP2PChatInference(m, config);
|
|
602
604
|
if (topicType === 'discussion' || topicType === 'collaborative') {
|
|
605
|
+
if (hasBroadcastMention(String(m.content || ''))) return true;
|
|
603
606
|
if (messageTargetsAgent(m.mention_target_agent_ids || m.mentionTargetAgentIds, config)) return true;
|
|
604
607
|
if (matchesAgentIdentity(m.runner_agent_id || m.runnerAgentId, config)) return true;
|
|
605
608
|
if (matchesAgentIdentity(m.runner_agent_name || m.runnerAgentName, config)) return true;
|
|
@@ -657,6 +660,10 @@ function mentionMatchesAgent(content, config) {
|
|
|
657
660
|
return false;
|
|
658
661
|
}
|
|
659
662
|
|
|
663
|
+
function hasBroadcastMention(content) {
|
|
664
|
+
return extractMentionChunks(content).some((mention) => BROADCAST_MENTIONS.has(mention));
|
|
665
|
+
}
|
|
666
|
+
|
|
660
667
|
function matchesAgentIdentity(candidate, config) {
|
|
661
668
|
const normalized = normalizeMentionToken(String(candidate || ''));
|
|
662
669
|
if (!normalized) return false;
|