mariomosca/agent-team-os/tree/main/mods/bus-band
关于这个 mod
bus-band
一个 Claude Code mod,会在提示符上方绘制一条信息带,显示 Agent Team OS 总线中等待此会话处理的消息。
Bus alita/work-hub: 2 in attesa, 1 urgenti o alta (+1 di altri workspace) [Nascondi]
!! [ALTA] da kai: crewmoor-stato-piano-v1
[normale] da vera: content-brief
- UI 文本使用意大利语(代理的工作语言)。只有存在待处理消息时才显示;收件箱清空后会消失。
- 范围与 shell lib(v1.4)相同:根据 cwd 前缀从
AGENT_MAP.json找到 agent,以工作区 basename 作为 slug,共享inboxes/<agent>/和inboxes/<agent>/@<slug>/;context.project_path属于其他工作区的消息会单独计数。 - 优先级会明确写出(
URGENTE、ALTA和!!标记),不会只靠颜色表达。 - 新的
urgent/high消息到达时显示 toast。每 20 s 轮询一次,并在每轮结束时轮询。 /bus-band可切换显示;Nascondi 按钮会将其隐藏到下一条新消息出现为止。- 只读:从不移动、归档或写入消息。要处理消息,仍使用
/read、/inbox和 MCP 工具。 - 与 shell lib 一样遵守
AB_HOME(默认值为~/.agent-team-os)。
安装
这个 mod 是独立于主 agent-team-os plugin 的单独 plugin,因此手动安装(在 settings.json 中注册 hooks)时不会重复注册 hooks。
使用 install.sh(手动安装):安装器会将它复制到 ~/.claude/mods/bus-band/。将该文件夹加入 ~/.claude/settings.json 的 env 块中的 CLAUDE_CODE_PLUGIN_DIRS,即可在每个会话加载:
{ "env": { "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/bus-band" } }
仅当前会话:claude --plugin-dir /path/to/agent-team-os/mods/bus-band。
安全
Mods 没有沙箱:它们以 Claude Code 自身的权限运行。这个 mod 只读取 ~/.agent-team-os/ 和 $HOME/AB_HOME,不会读取其他内容,也不会发起网络请求。使用 claude plugin validate mods/bus-band 检查它;该命令会列出模块接触到的每个 engine call 和环境变量。
开发
claude plugin validate mods/bus-band # manifest, hooks, calls, state contract
claude plugin test mods/bus-band # hooks/bus.test.ts: cwd→agent, slug, scoping, sort
纯 bus 逻辑位于 hooks/bus.ts(与 scripts/agent-team-os-lib.sh 对应);hooks/register.tsx 保存 hooks 和绘制逻辑。已知差异:shell lib 还会匹配 cwd 的 realpath;mod 匹配 Claude Code 报告的 cwd,而该路径在实际使用中已经解析。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add mariomosca/agent-team-os claude plugin install bus-band
原文 / README
bus-band
A Claude Code mod (Claude Code 2.1.287+) that draws a band above the prompt with the messages waiting for this session on the Agent Team OS bus.
Bus alita/work-hub: 2 in attesa, 1 urgenti o alta (+1 di altri workspace) [Nascondi]
!! [ALTA] da kai: crewmoor-stato-piano-v1
[normale] da vera: content-brief
- UI text is in Italian (the agents' working language). Shows only when something is pending; disappears when the inbox is empty.
- Same scoping as the shell lib (v1.4): agent from
AGENT_MAP.jsonby cwd prefix, slug = workspace basename, shared rootinboxes/<agent>/plusinboxes/<agent>/@<slug>/, messages whosecontext.project_pathbelongs to another workspace counted apart. - Priority is spelled out (
URGENTE,ALTA, a!!marker), never colour alone. - A toast when a new
urgent/highmessage arrives. Polls every 20 s and at the end of every turn. /bus-bandtoggles it; the Nascondi button hides it until the next new message.- Read-only: it never moves, archives or writes a message.
/read,/inboxand the MCP tools stay the way to act on them. - Honours
AB_HOMElike the shell lib (default~/.agent-team-os).
Install
The mod is its own plugin, separate from the main agent-team-os plugin, so a manual install (hooks registered in settings.json) never gets its hooks registered twice.
With install.sh (manual install): the installer copies it to ~/.claude/mods/bus-band/. Load it in every session by adding the folder to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/bus-band" } }
One session only: claude --plugin-dir /path/to/agent-team-os/mods/bus-band.
Security
Mods are not sandboxed: they run with Claude Code's own access. This one reads ~/.agent-team-os/ and $HOME/AB_HOME, nothing else, and makes no network call. Check with claude plugin validate mods/bus-band, which lists every engine call and env variable the module touches.
Develop
claude plugin validate mods/bus-band # manifest, hooks, calls, state contract
claude plugin test mods/bus-band # hooks/bus.test.ts: cwd→agent, slug, scoping, sort
The pure bus logic lives in hooks/bus.ts (mirrors scripts/agent-team-os-lib.sh); hooks/register.tsx holds the hooks and the drawing. Known gap: the shell lib also matches the realpath of the cwd; the mod matches the cwd Claude Code reports, which is already resolved in practice.
