modscode / Gallery / console-status
console-status
Claude Console:跨專案 STATUS、Claude/Codex 派工、工作階段與用量總覽(含手機 Remote Control)
What it does
- Draws a band above the prompt, a pane, toasts
- Hooks prompt.compose, prompt.submit, session.start, turn.complete and 2 more
- Keeps its own state between turns
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- Handles errors
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like console-status by SaM-runtime (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/sam-runtime-console-status/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const name = '…'
const t = '…'
const t2 = '…'
const t3 = '…'
const pipelineText = '…'
const others = '…'
const button = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="nowrap" height={1} overflow="hidden">
<Box flexShrink={0} height={1}>
<Text bold color="#E5EAF0">
{name}
{" "}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1} height={1} overflow="hidden">
<Text wrap="truncate-end">
<Text>
{t}
</Text>
<Text>
{t2}
</Text>
<Text>
{t3}
</Text>
<Text color="#CAD3E0">
{" "}
{pipelineText}
</Text>
<Text color="#F0C674">
{` 其他 ${others} 個專案待處理`}
</Text>
</Text>
</Box>
<Box flexShrink={0} height={1} overflow="hidden">
<Button plain dimColor label={`${button}`} />
</Box>
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "主控台" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Client } = $.ui.resolve(e)
const length = '…'
const time = '…'
const executor = '…'
const name = '…'
const STAGE_GLYPH = '…'
const label = '…'
const STAGE_GLYPH2 = '…'
const label2 = '…'
const STAGE_GLYPH3 = '…'
const label3 = '…'
const note = '…'
const value = '…'
const blockedReason = '…'
const actionLabel = '…'
const pendingConfirm = '…'
const reason = '…'
const verify = '…'
const value2 = '…'
const line = '…'
const line2 = '…'
const line3 = '…'
const LABEL = '…'
const c = '…'
const LABEL2 = '…'
const c2 = '…'
const LABEL3 = '…'
const c3 = '…'
const project = '…'
const item = '…'
const t = '…'
const t2 = '…'
const t3 = '…'
const age = '…'
const item2 = '…'
const t4 = '…'
const t5 = '…'
const t6 = '…'
const age2 = '…'
const item3 = '…'
const t7 = '…'
const t8 = '…'
const t9 = '…'
const age3 = '…'
const name2 = '…'
const STAGE_GLYPH4 = '…'
const label4 = '…'
const STAGE_GLYPH5 = '…'
const label5 = '…'
const STAGE_GLYPH6 = '…'
const label6 = '…'
const note2 = '…'
const id = '…'
const meta = '…'
const last = '…'
const id2 = '…'
const meta2 = '…'
const last2 = '…'
const id3 = '…'
const meta3 = '…'
const last3 = '…'
const state = '…'
const title = '…'
const key = '…'
const text = '…'
const key2 = '…'
const text2 = '…'
const key3 = '…'
const text3 = '…'
const title2 = '…'
const key4 = '…'
const text4 = '…'
const key5 = '…'
const text5 = '…'
const key6 = '…'
const text6 = '…'
const title3 = '…'
const key7 = '…'
const text7 = '…'
const key8 = '…'
const text8 = '…'
const key9 = '…'
const text9 = '…'
const gate = '…'
const value3 = '…'
const gitLine = '…'
const prLine = '…'
const blockedReason2 = '…'
const pendingConfirm2 = '…'
const reason2 = '…'
const verify2 = '…'
const value4 = '…'
const line4 = '…'
const line5 = '…'
const line6 = '…'
const sel = '…'
const name3 = '…'
const STAGE_GLYPH7 = '…'
const label7 = '…'
const STAGE_GLYPH8 = '…'
const label8 = '…'
const STAGE_GLYPH9 = '…'
const label9 = '…'
const note3 = '…'
const id4 = '…'
const meta4 = '…'
const last4 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box justifyContent="space-between">
<Text bold color="#E5EAF0">
主控台
<Text color="#6E7787" backgroundColor="#1C222B">
{" 示範資料 "}
</Text>
<Text color="#6E7787">
{" "}
{length}
{" 個專案"}
</Text>
</Text>
<Text color="#6E7787">
{time}
{" 更新"}
</Text>
</Box>
<Box gap={1} flexWrap="wrap">
<Text color="#6E7787">
執行者
</Text>
<Box>
<Button plain label={`${executor}`} />
</Box>
<Text color="#6E7787">
·
</Text>
<Box>
<Button plain label="預設" />
</Box>
<Text color="#6E7787">
·
</Text>
<Box>
<Button plain label="預設" />
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="#8BD5CA" paddingX={1}>
<Box justifyContent="space-between" gap={1}>
<Text bold color="#8BD5CA" wrap="truncate-end">
{"專案模式 "}
<Text color="#E5EAF0">
{name}
</Text>
</Text>
<Text color="#6E7787">
/console mode console 切回主控台
</Text>
</Box>
<Box flexDirection="column">
<Box flexWrap="wrap">
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH}
{" "}
{label}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH2}
{" "}
{label2}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH3}
{" "}
{label3}
</Text>
</Text>
</Box>
<Text wrap="wrap">
{note}
</Text>
</Box>
<Text color="#CAD3E0" wrap="wrap">
<Text color="#6E7787">
{"下一步 "}
</Text>
{value}
</Text>
<Box flexDirection="column">
<Box gap={2} flexWrap="wrap">
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Text color="#6E7787">
派工鎖定:
{blockedReason}
</Text>
<Box>
<Button plain label={`⇢ 改用 Claude 派工(${actionLabel})`} />
</Box>
</Box>
<Text color="#F0C674" wrap="wrap">
{pendingConfirm}
</Text>
<Box gap={1} flexWrap="wrap">
<Text color="#6E7787">
執行者
</Text>
<Box gap={1}>
<Button plain label="[下一步]" />
<Button plain label="[下一步]" />
<Button plain label="[下一步]" />
</Box>
<Text color="#6E7787">
手動交接:面板不派工(CARD、驗證、關卡照常)
</Text>
<Text color="#F0C674" wrap="truncate-end">
Codex 未派工:
{reason}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="#6E7787" wrap="wrap">
驗證指令
:
{verify}
</Text>
<Text color="#A6D189">
✓
{" 最後驗證 "}
{value2}
(
未正常結束
)
</Text>
<Text color="#F0C674">
輸出已被執行器截斷,以下是擷取內容
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line}
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line2}
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line3}
</Text>
</Box>
</Box>
<Box flexDirection="column" backgroundColor="#1C222B" paddingX={1}>
<Box justifyContent="space-between">
<Text bold color="#F0C674">
下一步
</Text>
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
</Box>
<Text color="#E5EAF0" wrap="wrap">
目前沒有需要處理的項目
</Text>
</Box>
<Box gap={3} flexWrap="wrap">
<Box>
<Text color="#4A5260">
{"● "}
{LABEL}
{" "}
<Text bold>
{c}
</Text>
</Text>
</Box>
<Box>
<Text color="#4A5260">
{"● "}
{LABEL2}
{" "}
<Text bold>
{c2}
</Text>
</Text>
</Box>
<Box>
<Text color="#4A5260">
{"● "}
{LABEL3}
{" "}
<Text bold>
{c3}
</Text>
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box gap={1} paddingRight={1}>
<Box width={8}>
<Text color="#6E7787">
{" 狀態"}
</Text>
</Box>
<Box>
<Text color="#6E7787">
專案
</Text>
</Box>
<Box flexGrow={1}>
<Text color="#6E7787">
項目
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
流程
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
Git
</Text>
</Box>
<Box width={4} justifyContent="flex-end">
<Text color="#6E7787">
更新
</Text>
</Box>
</Box>
<Text color="#4A5260" wrap="truncate-end" />
<Box flexDirection="column">
<Box gap={1} backgroundColor="#22304A">
<Box width={8}>
<Text bold>
{` ${LABEL} `}
</Text>
</Box>
<Box>
<Button plain label={`${project}`} />
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{item}
</Text>
</Box>
<Box flexShrink={0}>
<Text>
<Text>
{t}
</Text>
<Text>
{t2}
</Text>
<Text>
{t3}
</Text>
</Text>
</Box>
<Box flexShrink={0} overflow="hidden">
<Text wrap="truncate-end" />
</Box>
<Box width={4} justifyContent="flex-end">
<Text color="#6E7787">
{age}
</Text>
</Box>
</Box>
<Box gap={1} backgroundColor="#22304A">
<Box width={8}>
<Text bold>
{` ${LABEL} `}
</Text>
</Box>
<Box>
<Button plain label={`${project}`} />
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{item2}
</Text>
</Box>
<Box flexShrink={0}>
<Text>
<Text>
{t4}
</Text>
<Text>
{t5}
</Text>
<Text>
{t6}
</Text>
</Text>
</Box>
<Box flexShrink={0} overflow="hidden">
<Text wrap="truncate-end" />
</Box>
<Box width={4} justifyContent="flex-end">
<Text color="#6E7787">
{age2}
</Text>
</Box>
</Box>
<Box gap={1} backgroundColor="#22304A">
<Box width={8}>
<Text bold>
{` ${LABEL} `}
</Text>
</Box>
<Box>
<Button plain label={`${project}`} />
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{item3}
</Text>
</Box>
<Box flexShrink={0}>
<Text>
<Text>
{t7}
</Text>
<Text>
{t8}
</Text>
<Text>
{t9}
</Text>
</Text>
</Box>
<Box flexShrink={0} overflow="hidden">
<Text wrap="truncate-end" />
</Box>
<Box width={4} justifyContent="flex-end">
<Text color="#6E7787">
{age3}
</Text>
</Box>
</Box>
</Box>
<Text color="#4A5260" wrap="truncate-end" />
<Box flexDirection="column" borderStyle="round" borderColor="#8AADF4" paddingX={1} marginTop={1}>
<Box justifyContent="space-between" gap={1}>
<Box gap={1} flexShrink={1}>
<Text bold color="#E5EAF0" wrap="truncate-end">
{name2}
</Text>
</Box>
<Button plain dimColor label="✕ 關閉" />
</Box>
<Box marginTop={1}>
<Box flexDirection="column">
<Box flexWrap="wrap">
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH4}
{" "}
{label4}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH5}
{" "}
{label5}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH6}
{" "}
{label6}
</Text>
</Text>
</Box>
<Text wrap="wrap">
{note2}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box gap={1}>
<Box width={2} flexShrink={0}>
<Text color="#8BD5CA">
◉
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E5EAF0" wrap="truncate-end">
{id}
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
{meta}
</Text>
</Box>
</Box>
<Text color="#6E7787" wrap="truncate-end">
{" › "}
{last}
</Text>
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Box width={2} flexShrink={0}>
<Text color="#8BD5CA">
◉
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E5EAF0" wrap="truncate-end">
{id2}
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
{meta2}
</Text>
</Box>
</Box>
<Text color="#6E7787" wrap="truncate-end">
{" › "}
{last2}
</Text>
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Box width={2} flexShrink={0}>
<Text color="#8BD5CA">
◉
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E5EAF0" wrap="truncate-end">
{id3}
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
{meta3}
</Text>
</Box>
</Box>
<Text color="#6E7787" wrap="truncate-end">
{" › "}
{last3}
</Text>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
狀態
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{state}
</Text>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
待決
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Box flexDirection="column">
<Box flexDirection="column" marginTop={1}>
<Box gap={1}>
<Box width={3} flexShrink={0}>
<Text bold color="#F0C674">
11.
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#F0C674" wrap="wrap">
{title}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key2}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text2}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key3}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text3}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box gap={1}>
<Box width={3} flexShrink={0}>
<Text bold color="#F0C674">
11.
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#F0C674" wrap="wrap">
{title2}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key4}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text4}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key5}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text5}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key6}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text6}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box gap={1}>
<Box width={3} flexShrink={0}>
<Text bold color="#F0C674">
11.
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#F0C674" wrap="wrap">
{title3}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key7}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text7}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key8}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text8}
</Text>
</Box>
</Box>
<Box gap={1} paddingLeft={4}>
<Box width={3} flexShrink={0}>
<Text bold color="#E5EAF0">
{key9}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{text9}
</Text>
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
關卡
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CA9EE6" wrap="wrap">
{gate}
</Text>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
下一步
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#CAD3E0" wrap="wrap">
{value3}
</Text>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
同步
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#8AADF4" wrap="wrap">
執行者已結束,結果未寫回 STATUS
</Text>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
Git
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E78284" wrap="wrap">
{gitLine}
</Text>
</Box>
</Box>
<Box gap={2}>
<Box width={6} flexShrink={0}>
<Text color="#6E7787">
PR
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E78284" wrap="wrap">
{prLine}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain dimColor label="↗ 開啟" />
</Box>
</Box>
</Box>
<Box marginTop={1}>
<Box flexDirection="column">
<Box gap={2} flexWrap="wrap">
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Box gap={1}>
<Client module="./spinner.tsx" width={1} height={1} />
<Button plain label="下一步" />
</Box>
<Text color="#6E7787">
派工鎖定:
{blockedReason2}
</Text>
<Box>
<Button plain label={`⇢ 改用 Claude 派工(${actionLabel})`} />
</Box>
</Box>
<Text color="#F0C674" wrap="wrap">
{pendingConfirm2}
</Text>
<Box gap={1} flexWrap="wrap">
<Text color="#6E7787">
執行者
</Text>
<Box gap={1}>
<Button plain label="[下一步]" />
<Button plain label="[下一步]" />
<Button plain label="[下一步]" />
</Box>
<Text color="#6E7787">
手動交接:面板不派工(CARD、驗證、關卡照常)
</Text>
<Text color="#F0C674" wrap="truncate-end">
Codex 未派工:
{reason2}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="#6E7787" wrap="wrap">
驗證指令
:
{verify2}
</Text>
<Text color="#A6D189">
✓
{" 最後驗證 "}
{value4}
(
未正常結束
)
</Text>
<Text color="#F0C674">
輸出已被執行器截斷,以下是擷取內容
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line4}
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line5}
</Text>
<Text color="#6E7787" wrap="truncate-end">
{line6}
</Text>
</Box>
</Box>
<Box justifyContent="space-between">
<Text color="#8AADF4" wrap="truncate-end">
{"◆ 已選取 "}
{sel}
<Text color="#6E7787">
{" 下一則提示會附上此專案"}
</Text>
</Text>
<Button plain dimColor label="✕ 取消" />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="round" borderColor="#4A5260" paddingX={1} marginY={1}>
<Box justifyContent="space-between" gap={1}>
<Box gap={1} flexShrink={1}>
<Text bold>
{` ${LABEL} `}
</Text>
<Text bold color="#E5EAF0" wrap="truncate-end">
{name3}
</Text>
</Box>
<Text color="#6E7787">
{`${age}前更新`}
</Text>
</Box>
<Box marginTop={1}>
<Box flexDirection="column">
<Box flexWrap="wrap">
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH7}
{" "}
{label7}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH8}
{" "}
{label8}
</Text>
</Text>
<Text wrap="truncate-end">
<Text>
{" ─ "}
</Text>
<Text>
{STAGE_GLYPH9}
{" "}
{label9}
</Text>
</Text>
</Box>
<Text wrap="wrap">
{note3}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box gap={1}>
<Box width={2} flexShrink={0}>
<Text color="#8BD5CA">
◉
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="#E5EAF0" wrap="truncate-end">
{id4}
</Text>
</Box>
<Box flexShrink={0}>
<Text color="#6E7787">
{meta4}
</Text>
</Box>
</Box>
<Text color="#6E7787" wrap="truncate-end">
{" › "}
{last4}
</Text>
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Box width={2} flexShrink={0}>
<Text color="#8BD5CA">
◉
</Text>
</Box>
<Box flexGrow={1} flexShrink={1} />
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
const actionLabel = '…'
await $.ui.toast(`示範資料:不執行專案操作;/console refresh 回到實際資料。`)
await $.ui.toast(`${name}:${actionLabel}…`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugins/console-status/hooks/register.tsx lines 886–932 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, nextHook) => {
const generation = dataGeneration
const demo = await demoEnabled($)
const stored = await read($, snapshot)
const s = demo && !stored?.demo ? demoSnapshot(await $.clock.now()) : stored
if (e.props.hasSurvey || s === null || (await read($, isBandHidden))) return nextHook(e)
const { Box, Text, Button } = $.ui.resolve(e)
const paneOpen = await read($, isPaneOpen)
const columns = Math.max(0, Math.floor(e.props.bodyColumns ?? 80))
const here = await focused($, options, s)
if (here && generation === dataGeneration) {
const button = paneOpen ? '主控台 ▾' : '主控台 ▸'
const buttonWidth = button.length + 1
const others = s.projects.filter(p => p !== here.project && (hasAsk(p) || parseGate(p.gate))).length
return (
<Box flexDirection="row" flexWrap="nowrap" width={columns} height={1} overflow="hidden">
<Box flexShrink={0} height={1}><Text bold color={C.strong}>{here.project.name} </Text></Box>
<Box flexGrow={1} flexShrink={1} height={1} overflow="hidden">
<Text wrap="truncate-end">
{pipelineParts(here.pipeline, PIPE).map((part, index) => <Text key={'bp-' + index} color={part.c}>{part.t}</Text>)}
<Text color={C.text}> {pipelineText(here.pipeline).replace(/^\S+\s?/, '')}</Text>
{others > 0 && <Text color={C.amber}>{` 其他 ${others} 個專案待處理`}</Text>}
</Text>
</Box>
<Box width={buttonWidth} flexShrink={0} height={1} overflow="hidden">
<Button key="pane" plain dimColor label={button} onPress={() => void openPane($)} />
</Box>
</Box>
)
}
const band = layoutBand(s, { columns, demo, paneOpen })
if (generation !== dataGeneration) return <Box height={1} width={columns} overflow="hidden"><Text color={C.dim} wrap="truncate-end">{demoActive ? ' 示範資料 ' : '讀取中…'}</Text></Box>
return (
<Box flexDirection="row" flexWrap="nowrap" width={columns} height={1} overflow="hidden">
<Box gap={1} flexShrink={0} height={1}>
{band.items.map(item => <Box key={'band-' + item.id} width={item.width} flexShrink={0} height={1} overflow="hidden">
<Text wrap="truncate-end" color={item.zero ? C.faint : item.id === 'demo' ? C.dim : item.id === 'next' ? C.amber : item.id === 'context' || item.id === 'ci' ? C.red : FG[item.id as State] ?? C.text}
backgroundColor={item.id === 'demo' ? C.bar : undefined}>{item.text}</Text>
</Box>)}
</Box>
<Box flexGrow={1} minWidth={band.items.length ? 1 : 0} />
<Box width={band.buttonWidth} flexShrink={0} height={1} overflow="hidden">
<Button key="pane" plain dimColor label={band.button} onPress={() => void openPane($)} />
</Box>
</Box>
)
})plugins/console-status/hooks/register.tsx lines 982–1141 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const generation = dataGeneration
const ui = $.ui.resolve(e) as any
const { Box, Text, Button } = ui
const demo = await demoEnabled($)
const stored = await read($, snapshot)
const s = demo && !stored?.demo ? demoSnapshot(await $.clock.now()) : stored
if (s === null) return <Text color={C.dim}>讀取各專案狀態中…</Text>
const detail = await read($, isDetail)
const selectedName = await read($, selected)
const sel = demo && !s.projects.some(project => project.name === selectedName) ? null : selectedName
const cur = await read($, cursor)
const feed = demo ? demoEvents(s.at) : await read($, feedAtom)
const hov = await read($, hovered)
const menu = await read($, menuFor)
const refreshing = await read($, isRefreshing)
const pending = await read($, pendingActions)
const confirmations = await read($, continueConfirmations)
const verified = await read($, verificationResults)
const trusted = await read($, trustedVerify)
await read($, actionPulse) // redraws running action labels once a second
const offers = demo ? {} : await read($, fallbackOffers)
const renderedAt = Object.keys(pending).length ? await $.clock.now() : s.at
const revision = await read($, dispatchRevision)
// Drawing never touches the disk on its own: settings are re-read after a write (revision) or a refresh (s.at).
const { config, dispatch } = demo
? { config: demoContext?.config ?? resolveConfig(options, '', '', '/tmp'), dispatch: demoContext?.dispatch ?? { settings: { executor: s.executor ?? 'claude', model: '', effort: '' }, models: [] } }
: await renderDispatch($, options, `${revision}|${s.at}`)
const cycle = async (field: GlobalField) => {
try {
const saved = await changeDispatch($, config, field)
if (await demoEnabled($)) demoContext = { config, dispatch: await readDispatch($, config) }
await update($, dispatchRevision, v => v + 1)
if (field === 'executor') await refresh($, options, true)
$.ui.toast(`派工設定已儲存:${saved.executor} · ${saved.model || '預設'} · ${saved.effort || '預設'}`)
} catch (error) { $.ui.toast(`設定未儲存:${error instanceof Error ? error.message : String(error)}`) }
}
/**
* Pick one project's executor ('' = inherit). The snapshot is patched at once so the label,
* the actions and the dispatch guard all agree before the (slow) refresh comes back.
*/
const chooseProjectExecutor = async (p: Project, value: '' | 'claude' | 'codex' | 'manual') => {
if (await demoEnabled($)) { $.ui.toast('示範資料:不變更專案設定。'); return }
try {
const root = projectRoot(p.statusPath)
const saved = await changeProjectDispatch($, config, root, 'executor', value)
const eff = effectiveDispatch(saved, root, p.registryExecutor)
await update($, snapshot, current => current && {
...current,
projects: current.projects.map(item => item.statusPath === p.statusPath ? { ...item, executor: eff.executor, executorSource: eff.source } : item),
})
await update($, fallbackOffers, values => { const rest = { ...values }; delete rest[p.statusPath]; return rest })
await update($, dispatchRevision, v => v + 1)
$.ui.toast(`${p.name} 執行者:${eff.executor}(${SOURCE_LABEL[eff.source]})`)
void refresh($, options, true)
} catch (error) { $.ui.toast(`設定未儲存:${error instanceof Error ? error.message : String(error)}`) }
}
const codexShown = dispatch.settings.executor === 'codex' || !!s.codexInUse
const n = next(s)
const c = counts(s)
const ctx = s.contextPercent
const time = new Date(s.at).toTimeString().slice(0, 5)
const health = codexHealth(s.codex)
const width: number = Math.max(40, (e.props.bodyColumns ?? 80) - 1)
const list = rows(s)
const now = await $.clock.now()
const showGit = s.projects.some(p => p.git)
const W = { state: 8, project: projectColumnWidth(list.map(row => row.project)), age: 4, flow: width >= 64 ? 6 : 0, git: showGit && width >= 80 ? 7 : 0 }
const badges = new Map(s.projects.map(p => [p.name, gitBadge(p.git, p.pr)]))
const GIT_TONE: Record<string, string> = { red: C.red, amber: C.amber, blue: C.blue, teal: C.teal, green: C.green, dim: C.dim }
const pipes = new Map(s.projects.map(p => [p.name, pipeline(p, verified[p.statusPath])]))
const here = demo ? null : await focused($, options, s)
const specs = list.map(r => ({
id: r.full,
shimmer: r.state === 'RUNNING',
breathe: r.state === 'ACTION' ? [C.amberBg, '#443925', '#4D412B'] : r.state === 'GATE' ? [C.purpleBg, '#3D304B', '#463755'] : undefined,
changedAt: s.projects.find(project => project.name === r.full)?.changedAt,
cells: [
{ t: ` ${LABEL[r.state]} `, c: FG[r.state], bg: BG[r.state], b: r.state !== 'IDLE', w: W.state },
{ t: r.project, c: r.state === 'IDLE' ? C.dim : C.strong, w: W.project },
{ t: r.item, c: r.state === 'IDLE' ? C.dim : C.text },
...(W.flow ? [{ t: '', w: W.flow, parts: pipes.get(r.full) ? pipelineParts(pipes.get(r.full)!, PIPE) : [] }] : []),
...(W.git ? [{ t: badges.get(r.full)?.text ?? '', c: GIT_TONE[badges.get(r.full)?.tone ?? 'dim'], w: W.git }] : []),
{ t: r.age, c: C.dim, w: W.age, right: true },
],
}))
const rich = (e.surface === 'terminal' || e.surface === 'desktop') && Boolean(ui.Client) && !(await read($, isPlain))
const table = rich
? (
<ui.Client key="rows" module="./rows.tsx" width="100%"
props={JSON.parse(JSON.stringify({ rows: specs, now, changed: ['#2C3B4B', '#24303D', '#1C252F'], selected: sel, cursor: cur, selectedBg: C.sel, hoverBg: C.hover, shimmer: SHIMMER }))} />
)
: (
<Box flexDirection="column">
{list.map(r => (
<Box key={'row-' + r.project} gap={1} backgroundColor={sel === r.full ? C.sel : undefined}>
<Box width={W.state}><Text bold color={FG[r.state]} backgroundColor={BG[r.state]}>{` ${LABEL[r.state]} `}</Text></Box>
<Box width={W.project}>
<Button key={'sel-' + r.project} plain label={r.project}
onPress={() => void update($, selected, v => (v === r.full ? null : r.full))} />
</Box>
<Box flexGrow={1} flexShrink={1}><Text color={C.text} wrap={detail ? 'wrap' : 'truncate-end'}>{r.item}</Text></Box>
{W.flow > 0 && <Box width={W.flow} flexShrink={0}><Text>{(pipes.get(r.full) ? pipelineParts(pipes.get(r.full)!, PIPE) : []).map((part, index) => <Text key={'fp-' + index} color={part.c}>{part.t}</Text>)}</Text></Box>}
{W.git > 0 && <Box width={W.git} flexShrink={0} overflow="hidden"><Text color={GIT_TONE[badges.get(r.full)?.tone ?? 'dim']} wrap="truncate-end">{badges.get(r.full)?.text ?? ''}</Text></Box>}
<Box width={W.age} justifyContent="flex-end"><Text color={C.dim}>{r.age}</Text></Box>
</Box>
))}
</Box>
)
// Hidden line that appears while anything in the same hover scope is under the pointer.
// Full, untruncated text of a row (the table cell is cut to fit).
const fullItem = (full: string) => {
const p = s.projects.find(x => x.name === full)
if (!p) return ''
if (!p.hasCard) return 'STATUS 卡不存在'
if (hasAsk(p)) return askSummary(p.ask)
if (parseGate(p.gate)) return `關卡:${p.gate}`
const run = p.jobs.find(j => j.kind === 'running')
if (run) return runLine(run, s.at)
if (p.jobs.some(j => j.kind === 'newer')) return '結果未同步至 STATUS'
return p.state || '—'
}
const hovRow = hov === null ? null : list.find(x => x.full === hov) ?? null
// One-line help strip; labels replace its contents without adding a blank row above the controls.
const helpStrip = (
<Box key="help" height={1} backgroundColor={C.bar} paddingX={1}>
{hovRow !== null
? <Text color={C.text} wrap="truncate-end"><Text bold color={FG[hovRow.state]}>{hovRow.project} </Text>{fullItem(hovRow.full)}</Text>
: <Text color={C.faint}>ⓘ 滑鼠移到標籤或專案列上,這裡會顯示說明或完整內容</Text>}
{Object.keys(HELP).map(id => (
<Box key={'tip-' + id} position="absolute" top={0} left={0} width="100%" height={1} paddingX={1}
backgroundColor={C.bar} display="none" hover={{ scope: 'help-' + id, display: 'flex' }}>
<Text color={C.blue} wrap="truncate-end">ⓘ {HELP[id]}</Text>
</Box>
))}
</Box>
)
// iPhone-style battery: body shows what is left, turns amber then red as it runs out; the nub follows.
const Battery = ({ id, label, used, hint, note }: { id: string; label: string; used: number; hint: string; note?: string }) => {
// Context goes low where rotation is advised (half used), red at 30% left.
const b = id === 'ctx' ? battery(used, 10, 100 - ROTATE_PERCENT, 30) : battery(used, 10)
const tone = b.tone === 'red' ? C.red : b.tone === 'low' ? C.orange : C.green
return (
<Box flexDirection="column">
<Box gap={1} hover={{ scope: 'help-' + id }}>
<Box width={9}><Text color={C.dim}>{label}</Text></Box>
{rich ? <ui.Client key={'battery-' + id + '-' + label} module="./battery.tsx" width={16} height={1} props={{ percent: b.left, tone }} /> : batteryBody(b.left, tone, ui)}
{hint !== '' && <Text color={C.red}>{hint}</Text>}
{note ? <Text color={C.dim} wrap="truncate-end">{note}</Text> : null}
</Box>
</Box>
)
}
const target = nextProject(s)
const targetProject = s.projects.find(p => p.name === target)
const targetState = list.find(r => r.full === target)?.state
const primaryAction: ActionKind | null = targetState === 'ACTION' ? 'decide' : targetState === 'GATE' && parseGate(targetProject?.gate)?.kind !== 'unknown' ? 'gate' : targetState === 'SYNC' && targetProject && !isManual(targetProject) ? 'sync' : nullplugins/console-status/hooks/pipeline-view.tsx lines 25–36 · Pane
export function pipelineLine(pl: Pipeline, palette: PipelinePalette, elements: any, key: string, opts: { noteless?: boolean } = {}) {
const { Box, Text } = elements
return <Box key={key} flexDirection="column">
<Box flexWrap="wrap">
{pl.stages.map((stage, index) => <Text key={key + '-' + stage.id} wrap="truncate-end">
{index > 0 && <Text color={pl.stages[index - 1]!.status === 'done' ? palette.green : palette.faint}>{' ─ '}</Text>}
<Text color={stageColor(stage, palette)} bold={stage.id === pl.current}>{STAGE_GLYPH[stage.status]} {stage.label}</Text>
</Text>)}
</Box>
{!opts.noteless && pl.note && <Text color={pl.current ? stageColor(pl.stages.find(stage => stage.id === pl.current)!, palette) : palette.dim} wrap="wrap">{pl.note}</Text>}
</Box>
}Licence text (MIT)
MIT License Copyright (c) 2026 SaM-runtime Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
runs programswrites filesenv varsdrives Clauderemembers
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit 10c3020028f4 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugins/console-status/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.19 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, with its own branch for the desktop |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.plugins/console-status/hooks/register.tsx:264 a program named at run time; plugins/console-status/hooks/register.tsx:290 a program named at run time; plugins/console-status/hooks/register.tsx:307 a program named at run time; plugins/console-status/hooks/register.tsx:322 a program named at run time; plugins/console-status/hooks/register.tsx:507 a program named at run time |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add SaM-runtime/claude-console/plugin install console-status@claude-consoleThis installs the marketplace's latest commit, which may not be the one read here (10c3020028f4). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "sam-runtime-console-status" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Ask Claude…
-
Ask Claude…Temper Run◈ TemperIntentUntitled runAcceptance criteria (what must be true) · 3 of 3 metNo criteria found in intent.md.✔ Walk through✔ Walk through✔ Walk throughand 3 more. Open the pane in a wider terminal.Phase · DiscussFix login · paused● build● build● build✓ done ● you are here ○ upcoming ↺ redo14:32Teach meTimeline, oldest firstCheckCheckCheckOpen findings · 3#a1b2c3d high: ResumeFixAccept with reasonExplain#a1b2c3d high: ResumeFixAccept with reasonExplain#a1b2c3d high: ResumeFixAccept with reasonExplainMore actions. Press the number shown.K build K PlanK build K PlanK build K Plan0 Fewer actions 0 Show or hide the other actions.8 Close the game 8 A small game for the wait.
-
Ask Claude…Agents●●●✻ AgentsEditNo agents yet. They show here while they run.Agent──Fix login────────● build ········━━━━━━━━········2h 10m● build ········━━━━━━━━········2h 10m● build ········━━━━━━━━········2h 10m✗ Grepclick an agent to open it · click "done" to hide finished ones
-
Ask Claude…Pick a look for builddraw your own with /familiar draw. esc closes●●●●●●●●●clawd 3●●●●●●●●●clawd 3●●●●●●●●●clawd 3
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
What it does
- Draws a pane, a band above the prompt
- Adds /lingo
- Hooks prompt.edit, prompt.submit, session.start
- Keeps its own state between turns