Implementation:23blocks OS Ai maestro Attention Queue
| Knowledge Sources | |
|---|---|
| Domains | UI, Task_Management |
| Last Updated | 2026-10-26 18:00 GMT |
Overview
Concrete tool for ranking and merging attention signals — needs-you agents, waiting cards, in-review cards — into one list, longest waiting first, across hosts, provided by AI Maestro's `lib/attention.ts`.
Description
The attention module builds one list of what needs the operator, across every agent and host. It only ranks and merges signals that already exist; it decides nothing itself. Signals: an agent in the "Needs you" state (from the server feed via `presenceOf`), a card waiting on the operator (status `waiting`, `waitingOn` juan), and a card in review. Multi-host: agent IDs are unique across hosts, cards are deduplicated by id (most recently updated copy wins). Overdue cards (past due date) are ranked first. Items are sorted longest-waiting first.
Usage
Call `buildAttentionQueue(agents, cards)` to get a ranked `AttentionItem[]`. Read `kind` (needs-you, waiting-on-you, in-review, overdue) and `what` for each item.
Code Reference
Source Location
- Repository: ai-maestro
- File: lib/attention.ts
- Lines: L1-L163
Signature
export type AttentionKind = 'needs-you' | 'waiting-on-you' | 'in-review' | 'overdue'
export function buildAttentionQueue(
agents: AttentionAgentInput[],
cards: AttentionCardInput[]
): AttentionItem[]
Import
import { buildAttentionQueue, type AttentionItem } from '@/lib/attention'
I/O Contract
| Name | Type | Description |
|---|---|---|
| AttentionItem[] | object[] | Ranked items with kind, agentName, what, waitingSince |
Usage Examples
import { buildAttentionQueue } from '@/lib/attention'
const items = buildAttentionQueue(agents, cards)
for (const item of items) {
console.log(`${item.kind}: ${item.agentName} — ${item.what}`)
}