@studiomopoke/crosschat 1.6.0 → 1.8.0

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/bin/cli.cjs CHANGED
@@ -31,6 +31,7 @@ const CROSSCHAT_PERMISSIONS = [
31
31
  "mcp__crosschat__list_tasks",
32
32
  "mcp__crosschat__clear_session",
33
33
  "mcp__crosschat__get_room_digest",
34
+ "mcp__crosschat__request_digest",
34
35
  ];
35
36
 
36
37
  const { spawn } = require("child_process");
package/crosschat.md CHANGED
@@ -85,8 +85,9 @@ Use the Agent tool with `run_in_background: true` and the following prompt (repl
85
85
  > If you filter out a message, loop back and wait for the next one. Only return to the main agent when there's something actionable.
86
86
 
87
87
  When the agent completes and you're notified:
88
- - **Message received** (`received: true`): The listener has already filtered for relevance tell the user who sent it and what they said, then act on it (reply, start a task, etc.). Spawn a new listener.
89
- - **Timeout** (`received: false`): Spawn a new listener silently.
88
+ - **ALWAYS spawn a new listener FIRST.** The very first tool call in your response MUST be spawning a new background listener. Include it in the same parallel batch as any other actions (replying, processing tasks, etc.) but never delay it behind message processing.
89
+ - **Message received** (`received: true`): Spawn listener + tell the user who sent it and what they said + act on it (reply, start a task, etc.) — all in the first batch of tool calls.
90
+ - **Timeout** (`received: false`): Spawn a new listener silently. No other action needed.
90
91
 
91
92
  Keep this loop going until the user says stop.
92
93
 
@@ -191,6 +192,8 @@ When you receive a message with `mentionType: "direct"`, it was specifically add
191
192
  ## Listener lifecycle — CRITICAL
192
193
  **You MUST keep the background listener alive at all times.** Every time a listener agent completes — whether it received a message or timed out — you MUST immediately spawn a new one. No exceptions. Do this silently without telling the user.
193
194
 
195
+ **Spawn the listener FIRST.** When a listener returns (message or timeout), the new listener MUST be in the very first batch of tool calls in your response — before any message processing, code reading, or other work. This minimizes the dead time where no listener is active. Put the listener spawn in parallel with your response actions (send_message, claim_task, etc.) so there is never a sequential delay.
196
+
194
197
  If you notice the listener is not running (e.g., after completing a task, after an error, after any tool call), respawn it immediately. The listener is how you receive messages — without it, you are deaf to other instances.
195
198
 
196
199
  **After every action you take** (responding to a message, completing a task, replying to the user), check: is the listener running? If not, spawn one. This is not optional.
@@ -0,0 +1 @@
1
+ :root{--bg: #0f0f13;--bg-secondary: #1a1a24;--bg-tertiary: #22222e;--text: #c4c4d4;--text-muted: #7a7a8e;--text-bright: #ededf5;--accent: #6c5ce7;--accent-hover: #7d6ff0;--accent-light: rgba(108, 92, 231, .15);--border: #2a2a3a;--success: #2ed573;--danger: #ff4757;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--mono: "SF Mono", "Fira Code", monospace}*{margin:0;padding:0;box-sizing:border-box}body{font-family:var(--sans);background:var(--bg);color:var(--text);line-height:1.5}#root{height:100vh;display:flex}button{cursor:pointer;border:none;font-family:var(--sans);font-size:14px}input{font-family:var(--sans);font-size:14px;outline:none}.app{display:flex;width:100%;height:100vh;overflow:hidden}.username-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--bg);display:flex;align-items:center;justify-content:center}.username-modal{background:var(--bg-secondary);border:1px solid var(--border);border-radius:12px;padding:40px;text-align:center;max-width:400px;width:90%}.username-modal h2{color:var(--text-bright);font-size:24px;margin-bottom:8px}.username-modal p{color:var(--text-muted);margin-bottom:24px}.username-modal form{display:flex;gap:8px}.username-modal input{flex:1;padding:10px 14px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:8px;color:var(--text-bright)}.username-modal input:focus{border-color:var(--accent)}.username-modal button{padding:10px 20px;background:var(--accent);color:#fff;border-radius:8px;font-weight:600}.username-modal button:hover:not(:disabled){background:var(--accent-hover)}.username-modal button:disabled{opacity:.5;cursor:not-allowed}.error-banner{position:fixed;top:0;left:0;right:0;background:var(--danger);color:#fff;padding:8px 16px;text-align:center;font-size:14px;cursor:pointer;z-index:100}.sidebar{width:260px;min-width:260px;background:var(--bg-secondary);border-right:1px solid var(--border);display:flex;flex-direction:column;height:100vh;overflow-y:auto}.sidebar-header{padding:20px;border-bottom:1px solid var(--border)}.sidebar-header h1{font-size:18px;font-weight:600;color:var(--text-bright);letter-spacing:0;margin:0}.room-list{list-style:none;flex:1;overflow-y:auto;padding:8px}.room-item{padding:10px 12px;border-radius:6px;cursor:pointer;transition:background .15s;margin-bottom:2px}.room-item:hover{background:var(--bg-tertiary)}.room-item.active{background:var(--accent-light);color:var(--text-bright)}.room-item.empty{color:var(--text-muted);font-style:italic;cursor:default}.room-item.empty:hover{background:none}.room-name{font-size:14px;font-weight:500}.create-room-form{padding:12px;border-top:1px solid var(--border);display:flex;gap:6px}.create-room-form input{flex:1;padding:8px 10px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;color:var(--text-bright);font-size:13px}.create-room-form input:focus{border-color:var(--accent)}.create-room-form button{padding:8px 14px;background:var(--accent);color:#fff;border-radius:6px;font-size:16px;font-weight:700;line-height:1}.create-room-form button:hover:not(:disabled){background:var(--accent-hover)}.create-room-form button:disabled{opacity:.4;cursor:not-allowed}.sidebar-footer{margin-top:auto;padding:12px;border-top:1px solid var(--border)}.hub-shutdown-btn{width:100%;padding:8px;font-size:12px;font-weight:500;color:var(--text-muted);background:none;border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .15s}.hub-shutdown-btn:hover{color:var(--danger, #ff4757);border-color:#ff475766;background:#ff475714}.peers-bar{padding:12px 16px;border-bottom:1px solid var(--border)}.peers-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:8px;font-weight:600}.peers-list{display:flex;flex-direction:column;gap:6px}.peer-item{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:6px;transition:background .15s}.peer-item:hover{background:var(--bg-tertiary)}.peer-icon{position:relative;width:32px;height:32px;min-width:32px;border-radius:50%;background:var(--bg-tertiary);border:2px solid var(--border);display:flex;align-items:center;justify-content:center;cursor:default;transition:border-color .15s}.peer-icon.available{border-color:var(--success, #22c55e)}.peer-icon.busy{border-color:var(--warning, #f59e0b)}.peer-icon-letter{font-size:13px;font-weight:700;color:var(--text-bright)}.peer-status-dot{position:absolute;bottom:-1px;right:-1px;width:9px;height:9px;border-radius:50%;border:2px solid var(--bg-secondary)}.peer-status-dot.available{background:var(--success, #22c55e)}.peer-status-dot.busy{background:var(--warning, #f59e0b)}.peer-info{display:flex;flex-direction:column;min-width:0}.peer-name{font-size:13px;font-weight:600;color:var(--text-bright);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.peer-room{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.peer-badges{display:flex;gap:4px;flex-wrap:wrap;margin-top:3px}.peer-badge{position:relative;display:inline-flex;align-items:center;gap:3px;padding:1px 6px;font-size:10px;font-weight:500;border-radius:4px;background:var(--bg-tertiary);border:1px solid var(--border);color:var(--text-muted);cursor:default;white-space:nowrap;max-width:90px;overflow:hidden;text-overflow:ellipsis}.peer-badge-icon{font-size:9px;flex-shrink:0}.peer-badge-label{overflow:hidden;text-overflow:ellipsis}.peer-badge.available .peer-badge-icon{color:var(--success, #22c55e)}.peer-badge.busy .peer-badge-icon{color:var(--warning, #f59e0b)}.peer-badge.dir,.peer-badge.session .peer-badge-icon{color:var(--text-muted)}.peer-badge.task{background:#f59e0b1a;border-color:#f59e0b4d;color:var(--warning, #f59e0b)}.peer-badge-tooltip{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;padding:6px 10px;font-size:11px;font-weight:400;color:var(--text-bright);white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis;z-index:50;pointer-events:none;box-shadow:0 4px 12px #0000004d}.peer-badge-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:var(--border)}.peer-badge:hover .peer-badge-tooltip{display:block}.message-badges{display:inline-flex;gap:3px;align-items:center;vertical-align:middle;margin-left:4px}.main-content{flex:1;display:flex;flex-direction:column;min-width:0;height:100vh;overflow:hidden}.tab-bar{display:flex;align-items:center;padding:0 24px;border-bottom:1px solid var(--border);background:var(--bg-secondary);min-height:46px}.tab-bar-left{display:flex;gap:0}.tab-item{padding:12px 20px;font-size:14px;font-weight:500;color:var(--text-muted);background:none;border:none;border-bottom:2px solid transparent;cursor:pointer;transition:color .15s,border-color .15s;white-space:nowrap}.tab-item:hover{color:var(--text-bright)}.tab-item.active{color:var(--text-bright);border-bottom-color:var(--accent)}.chat-area{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.chat-area.empty-state{align-items:center;justify-content:center;color:var(--text-muted);font-size:16px}.chat-header{padding:16px 24px;border-bottom:1px solid var(--border)}.chat-header h2{font-size:16px;font-weight:600;color:var(--text-bright);margin:0}.messages{flex:1;overflow-y:auto;padding:16px 24px;display:flex;flex-direction:column;gap:4px}.message{max-width:70%;padding:8px 14px;background:var(--bg-secondary);border:1px solid var(--border);border-radius:4px 12px 12px;align-self:flex-start}.message.own{background:var(--accent-light);border-color:var(--accent);border-top-left-radius:12px;border-top-right-radius:4px;align-self:flex-end}.message-header{display:flex;gap:8px;align-items:baseline;margin-bottom:2px}.message-author{font-size:13px;font-weight:600;color:var(--accent)}.own .message-author{color:var(--text-bright)}.message-time{font-size:11px;color:var(--text-muted)}.message-text{font-size:14px;color:var(--text-bright);word-break:break-word;white-space:pre-wrap}.reply-btn{font-size:11px;font-weight:500;color:var(--text-muted);background:none;border:none;cursor:pointer;padding:0 4px;transition:color .15s}.reply-btn:hover{color:var(--accent)}.reply-bar{display:flex;align-items:center;justify-content:space-between;padding:6px 24px;background:var(--bg-secondary);border-top:1px solid var(--accent);font-size:13px;color:var(--text-muted)}.reply-bar-text strong{color:var(--accent)}.reply-bar-close{background:none;border:none;color:var(--text-muted);font-size:18px;cursor:pointer;padding:0 4px;line-height:1}.reply-bar-close:hover{color:var(--text-bright)}.mention{color:var(--accent);font-weight:600;background:#6366f11a;padding:1px 4px;border-radius:3px}.mention-here{color:#f59e0b;background:#f59e0b1a}.event-notice{text-align:center;color:var(--text-muted);font-size:12px;padding:4px 0;font-style:italic}.message-form{padding:16px 24px;border-top:1px solid var(--border);display:flex;gap:8px}.message-form input{flex:1;padding:12px 16px;background:var(--bg-secondary);border:1px solid var(--border);border-radius:8px;color:var(--text-bright);font-size:14px}.message-form input:focus{border-color:var(--accent)}.message-form button{padding:12px 24px;background:var(--accent);color:#fff;border-radius:8px;font-weight:600}.message-form button:hover:not(:disabled){background:var(--accent-hover)}.message-form button:disabled{opacity:.4;cursor:not-allowed}.tasks-panel{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.tasks-header{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-bottom:1px solid var(--border);flex-shrink:0;gap:12px}.tasks-filters{display:flex;gap:4px;overflow-x:auto}.tasks-add-btn{padding:6px 14px;font-size:12px;font-weight:500;color:var(--text-bright);background:var(--accent);border:none;border-radius:6px;cursor:pointer;white-space:nowrap;transition:background .15s}.tasks-add-btn:hover{background:var(--accent-hover)}.tasks-error{padding:8px 24px;color:var(--error, #ff6b6b);font-size:13px;cursor:pointer}.task-form{display:flex;flex-direction:column;gap:8px;padding:16px 24px;border-bottom:1px solid var(--border);background:var(--bg-secondary)}.task-form textarea{padding:10px 12px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:13px;font-family:inherit;resize:vertical}.task-form textarea:focus{outline:none;border-color:var(--accent)}.task-form-row{display:flex;gap:8px;align-items:center}.task-form-row select{padding:8px 10px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:13px;min-width:0;flex:1}.task-form-row select:focus{outline:none;border-color:var(--accent)}.task-form-row button{padding:8px 18px;background:var(--accent);border:none;border-radius:6px;color:var(--text-bright);font-size:13px;font-weight:500;cursor:pointer;white-space:nowrap;transition:background .15s}.task-form-row button:hover:not(:disabled){background:var(--accent-hover)}.task-form-row button:disabled{opacity:.4;cursor:not-allowed}.tasks-filter-btn{padding:6px 12px;font-size:12px;font-weight:500;color:var(--text-muted);background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .15s;white-space:nowrap}.tasks-filter-btn:hover{color:var(--text-bright);border-color:var(--text-muted)}.tasks-filter-btn.active{color:var(--text-bright);background:var(--accent-light);border-color:var(--accent)}.tasks-list{flex:1;overflow-y:auto;padding:16px 24px;display:flex;flex-direction:column;gap:8px}.tasks-empty{color:var(--text-muted);text-align:center;padding:40px 0;font-size:14px}.task-card{background:var(--bg-secondary);border:1px solid var(--border);border-radius:8px;transition:border-color .15s}.task-card:hover{border-color:var(--text-muted)}.task-card.expanded{border-color:var(--accent)}.task-card-header{padding:14px 16px;cursor:pointer}.task-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.task-card-time{font-size:11px;color:var(--text-muted)}.task-card-description{font-size:14px;font-weight:500;color:var(--text-bright);margin-bottom:6px;line-height:1.4;word-break:break-word}.task-card-meta{display:flex;gap:12px;flex-wrap:wrap}.task-meta-item{font-size:12px;color:var(--text-muted)}.task-card-detail{padding:0 16px 14px;border-top:1px solid var(--border);margin-top:0}.task-section-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-weight:600;margin-top:12px;margin-bottom:6px}.task-context-text,.task-result-text{font-size:13px;color:var(--text);line-height:1.5;white-space:pre-wrap;word-break:break-word;background:var(--bg-tertiary);padding:10px 12px;border-radius:6px;border:1px solid var(--border)}.task-loading{color:var(--text-muted);font-size:13px;padding:12px 0}.task-notes{margin-top:4px}.task-note{padding:8px 12px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;margin-bottom:6px}.task-note-header{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px}.task-note-author{font-size:12px;font-weight:600;color:var(--accent)}.task-note-time{font-size:11px;color:var(--text-muted)}.task-note-content{font-size:13px;color:var(--text);line-height:1.5;white-space:pre-wrap;word-break:break-word}.status-badge{display:inline-block;padding:2px 8px;font-size:11px;font-weight:600;border-radius:4px;text-transform:uppercase;letter-spacing:.03em}.status-badge.open{background:#2ed57326;color:#2ed573}.status-badge.claimed{background:#f59e0b26;color:#f59e0b}.status-badge.in_progress{background:#3b82f626;color:#3b82f6}.status-badge.completed{background:#22c55e26;color:#22c55e}.status-badge.failed{background:#ff475726;color:#ff4757}.status-badge.archived{background:#7a7a8e26;color:var(--text-muted)}.filter-badges{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}.filter-badge{display:inline-block;padding:2px 6px;font-size:10px;font-weight:500;color:var(--text-muted);background:var(--bg-tertiary);border:1px solid var(--border);border-radius:4px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.archive-btn{margin-top:12px;padding:8px 16px;font-size:13px;font-weight:500;color:var(--text-muted);background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .15s}.archive-btn:hover:not(:disabled){color:var(--text-bright);border-color:var(--text-muted)}.archive-btn:disabled{opacity:.4;cursor:not-allowed}.instances-panel{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.instances-header{display:flex;align-items:center;justify-content:space-between;padding:12px 24px;border-bottom:1px solid var(--border);flex-shrink:0}.instances-title{font-size:14px;font-weight:600;color:var(--text-bright)}.instances-add-btn{padding:6px 14px;font-size:12px;font-weight:600;color:var(--accent);background:#6366f11a;border:1px solid rgba(99,102,241,.3);border-radius:6px;cursor:pointer;transition:all .15s}.instances-add-btn:hover{background:#6366f133;border-color:var(--accent)}.instances-error{padding:8px 24px;font-size:13px;color:var(--danger, #ff4757);background:#ff475714;border-bottom:1px solid rgba(255,71,87,.2);cursor:pointer}.instance-form{display:flex;flex-direction:column;gap:8px;padding:16px 24px;border-bottom:1px solid var(--border);background:var(--bg-secondary)}.instance-form input{padding:10px 12px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;color:var(--text-bright);font-size:13px}.instance-form input:focus{border-color:var(--accent)}.instance-form button{align-self:flex-start;padding:8px 18px;background:var(--accent);color:#fff;border-radius:6px;font-size:13px;font-weight:600}.instance-form button:hover:not(:disabled){background:var(--accent-hover)}.instance-form button:disabled{opacity:.4;cursor:not-allowed}.instances-list{flex:1;overflow-y:auto;padding:16px 24px;display:flex;flex-direction:column;gap:8px}.instances-empty{color:var(--text-muted);text-align:center;padding:40px 0;font-size:14px}.instance-card{background:var(--bg-secondary);border:1px solid var(--border);border-radius:8px;transition:border-color .15s}.instance-card:hover{border-color:var(--text-muted)}.instance-card-header{padding:14px 16px 10px}.instance-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.instance-card-name{font-size:14px;font-weight:600;color:var(--text-bright)}.instance-active-indicator{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:500;color:var(--success, #22c55e)}.instance-active-dot{width:7px;height:7px;border-radius:50%;background:var(--success, #22c55e)}.instance-card-path{font-size:12px;font-family:SF Mono,Menlo,Consolas,monospace;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:4px}.instance-card-description{font-size:13px;color:var(--text);line-height:1.4}.instance-card-actions{display:flex;gap:8px;padding:0 16px 12px}.instance-launch-btn{padding:6px 16px;font-size:12px;font-weight:600;color:#fff;background:var(--accent);border:none;border-radius:6px;cursor:pointer;transition:all .15s}.instance-launch-btn:hover:not(:disabled){background:var(--accent-hover)}.instance-launch-btn:disabled{opacity:.5;cursor:not-allowed}.instance-remove-btn{padding:6px 12px;font-size:12px;font-weight:500;color:var(--text-muted);background:none;border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:all .15s}.instance-remove-btn:hover:not(:disabled){color:var(--danger, #ff4757);border-color:#ff475766;background:#ff475714}.instance-remove-btn:disabled{opacity:.4;cursor:not-allowed}.permission-popups{position:fixed;top:16px;right:16px;z-index:200;display:flex;flex-direction:column;gap:10px;max-width:380px;width:100%;pointer-events:none}.permission-toast{pointer-events:auto;background:var(--bg-secondary);border:1px solid var(--warning, #f59e0b);border-radius:10px;padding:14px 16px;box-shadow:0 8px 24px #0006,0 0 0 1px #f59e0b26;animation:permission-slide-in .3s ease-out}.permission-toast.deciding{opacity:.6;pointer-events:none}@keyframes permission-slide-in{0%{opacity:0;transform:translate(40px)}to{opacity:1;transform:translate(0)}}.permission-toast-header{display:flex;align-items:center;gap:8px;margin-bottom:8px}.permission-agent-badge{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--text-bright)}.permission-agent-letter{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;min-width:22px;border-radius:50%;background:var(--bg-tertiary);border:2px solid var(--warning, #f59e0b);font-size:11px;font-weight:700;color:var(--text-bright)}.permission-tool-badge{display:inline-block;padding:2px 8px;font-size:11px;font-weight:600;border-radius:4px;background:#f59e0b1f;color:var(--warning, #f59e0b);text-transform:uppercase;letter-spacing:.03em}.permission-description{font-size:13px;color:var(--text);margin-bottom:6px;line-height:1.4}.permission-context{margin-bottom:10px}.permission-context code{display:block;font-size:12px;color:var(--text-bright);background:var(--bg-tertiary);border:1px solid var(--border);border-radius:6px;padding:8px 10px;white-space:pre-wrap;word-break:break-all;max-height:80px;overflow-y:auto;font-family:SF Mono,Menlo,Consolas,monospace}.permission-actions{display:flex;gap:8px}.permission-btn{flex:1;padding:8px 0;font-size:13px;font-weight:600;border-radius:6px;cursor:pointer;transition:all .15s;border:1px solid transparent}.permission-btn.allow{background:#22c55e26;color:#22c55e;border-color:#22c55e4d}.permission-btn.allow:hover:not(:disabled){background:#22c55e40;border-color:#22c55e}.permission-btn.deny{background:#ff475726;color:#ff4757;border-color:#ff47574d}.permission-btn.deny:hover:not(:disabled){background:#ff475740;border-color:#ff4757}.permission-btn:disabled{opacity:.4;cursor:not-allowed}