deck
A pane beside the conversation for the work behind it: running shells and agents, the model and a clickable effort meter, and step-by-step progress of any job as a tree: /deck
何をするか
- 欄・トーストを描く
- /deck を足す
- Bash・TaskStop・TaskCreate・TaskUpdate の呼び出しを見張る(止めることがある)
- agent.spawn・classic.Stop・prompt.compose・session.end ほか 4 個にフックする
- ターンをまたいで自分の状態を持つ
良いところ
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like deck by Barış Demirhan (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/barisdemirhan-deck/
// 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 pane: open it with $.ui.open({ id: 'my-pane', title: "deck" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const split = '…'
const effortOf = '…'
const context = '…'
const usage = '…'
const length = '…'
const GLYPHS = '…'
const title = '…'
const kind = '…'
const jobSpan = '…'
const detailOf = '…'
const GLYPHS2 = '…'
const kind2 = '…'
const jobSpan2 = '…'
const title2 = '…'
const detailOf2 = '…'
const GLYPHS3 = '…'
const kind3 = '…'
const jobSpan3 = '…'
const title3 = '…'
const detailOf3 = '…'
const GLYPHS4 = '…'
const kind4 = '…'
const jobSpan4 = '…'
const title4 = '…'
const detailOf4 = '…'
const GLYPHS5 = '…'
const kind5 = '…'
const jobSpan5 = '…'
const title5 = '…'
const detailOf5 = '…'
const GLYPHS6 = '…'
const kind6 = '…'
const jobSpan6 = '…'
const title6 = '…'
const detailOf6 = '…'
const STEP_GLYPHS = '…'
const STEP_GLYPHS2 = '…'
const title7 = '…'
const meter = '…'
const count = '…'
const span = '…'
const title8 = '…'
const STEP_GLYPHS3 = '…'
const STEP_GLYPHS4 = '…'
const title9 = '…'
const meter2 = '…'
const count2 = '…'
const span2 = '…'
const title10 = '…'
const STEP_GLYPHS5 = '…'
const STEP_GLYPHS6 = '…'
const title11 = '…'
const meter3 = '…'
const count3 = '…'
const span3 = '…'
const title12 = '…'
const STEP_GLYPHS7 = '…'
const STEP_GLYPHS8 = '…'
const title13 = '…'
const meter4 = '…'
const count4 = '…'
const span4 = '…'
const title14 = '…'
const STEP_GLYPHS9 = '…'
const STEP_GLYPHS10 = '…'
const title15 = '…'
const meter5 = '…'
const count5 = '…'
const span5 = '…'
const title16 = '…'
const STEP_GLYPHS11 = '…'
const STEP_GLYPHS12 = '…'
const title17 = '…'
const meter6 = '…'
const count6 = '…'
const span6 = '…'
const title18 = '…'
const STEP_GLYPHS13 = '…'
const STEP_GLYPHS14 = '…'
const title19 = '…'
const meter7 = '…'
const count7 = '…'
const span7 = '…'
const title20 = '…'
const STEP_GLYPHS15 = '…'
const STEP_GLYPHS16 = '…'
const title21 = '…'
const meter8 = '…'
const count8 = '…'
const span8 = '…'
const title22 = '…'
const STEP_GLYPHS17 = '…'
const STEP_GLYPHS18 = '…'
const title23 = '…'
const meter9 = '…'
const count9 = '…'
const span9 = '…'
const title24 = '…'
const GLYPHS7 = '…'
const kind7 = '…'
const jobSpan7 = '…'
const title25 = '…'
const detailOf7 = '…'
const GLYPHS8 = '…'
const kind8 = '…'
const jobSpan8 = '…'
const title26 = '…'
const detailOf8 = '…'
const GLYPHS9 = '…'
const kind9 = '…'
const jobSpan9 = '…'
const title27 = '…'
const detailOf9 = '…'
const GLYPHS10 = '…'
const kind10 = '…'
const jobSpan10 = '…'
const title28 = '…'
const detailOf10 = '…'
const STEP_GLYPHS19 = '…'
const STEP_GLYPHS20 = '…'
const title29 = '…'
const meter10 = '…'
const count10 = '…'
const span10 = '…'
const title30 = '…'
return (
<Box flexDirection="column" paddingX={1}>
<Box flexDirection="column">
<Box columnGap={2} flexWrap="wrap" justifyContent="space-between">
<Box columnGap={2}>
<Text bold>
Claude
</Text>
<Box columnGap={1}>
<Text>
{split}
</Text>
<Button plain label={`${effortOf} ⟳`} />
</Box>
</Box>
<Text>
{context}
</Text>
</Box>
<Text color="warning" wrap="truncate-end">
{usage}
</Text>
</Box>
<Text dimColor wrap="truncate">
────────
</Text>
<Text dimColor>
Nothing runs yet.
</Text>
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold dimColor>
{`SHELLS · ${length}`}
</Text>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title}
</Text>
<Text dimColor wrap="wrap">
{detailOf}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS2}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind2}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan2}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title2}
</Text>
<Text dimColor wrap="wrap">
{detailOf2}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS3}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind3}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan3}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title3}
</Text>
<Text dimColor wrap="wrap">
{detailOf3}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS4}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind4}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan4}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title4}
</Text>
<Text dimColor wrap="wrap">
{detailOf4}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS5}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind5}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan5}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title5}
</Text>
<Text dimColor wrap="wrap">
{detailOf5}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS6}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind6}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan6}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title6}
</Text>
<Text dimColor wrap="wrap">
{detailOf6}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS2}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title7}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title8}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS3}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS4}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title9}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter2}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count2}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span2}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title10}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS5}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS6}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title11}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter3}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count3}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span3}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title12}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS7}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS8}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title13}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter4}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count4}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span4}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title14}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS9}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS10}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title15}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter5}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count5}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span5}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title16}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS11}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS12}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title17}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter6}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count6}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span6}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title18}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS13}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS14}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title19}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter7}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count7}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span7}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title20}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS15}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS16}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title21}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter8}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count8}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span8}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title22}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS17}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS18}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title23}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter9}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count9}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span9}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title24}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS7}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind7}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan7}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title25}
</Text>
<Text dimColor wrap="wrap">
{detailOf7}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS8}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind8}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan8}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title26}
</Text>
<Text dimColor wrap="wrap">
{detailOf8}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS9}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind9}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan9}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title27}
</Text>
<Text dimColor wrap="wrap">
{detailOf9}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button plain label="▾" />
</Box>
<Box width={2} flexShrink={0}>
<Text>
{GLYPHS10}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button plain label={`${title}`} />
</Box>
<Box width={7} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{kind10}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{jobSpan10}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Text wrap="wrap">
{title28}
</Text>
<Text dimColor wrap="wrap">
{detailOf10}
</Text>
<Box>
<Button plain label="■ stop" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS19}
</Text>
</Box>
<Box width={2} flexShrink={0}>
<Text>
{STEP_GLYPHS20}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Text color="error" wrap="truncate-end">
{title29}
</Text>
</Box>
<Box width={9} flexShrink={0} justifyContent="flex-end">
<Text>
{meter10}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text>
{count10}
</Text>
</Box>
<Box width={8} flexShrink={0} justifyContent="flex-end">
<Text>
{span10}
</Text>
</Box>
</Box>
<Box>
<Text wrap="wrap">
{title30}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box>
<Box flexShrink={0} />
<Box width={2} flexShrink={0} />
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const reason = '…'
await $.ui.toast(`Deck's pane waits: ${reason}`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 1164〜1209 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
await read($, now)
const at = await $.clock.now()
const all = await read($, runs)
const shut = await read($, folds)
const active = activeOf(all)
const jobs = await read($, work)
// A run a running agent opened is drawn under that agent's row.
const isNested = (run: Run): boolean =>
isLive(run) && jobs.running.some((job) => job.kind === 'agent' && job.id === run.loop)
return paneTree($.ui.resolve(e), {
meter: await read($, meter),
work: jobs,
now: at,
columns: e.props.bodyColumns,
onEffort: () => {
void update($, meter, stepped)
},
runs: ordered(all)
.filter((run) => !isNested(run))
.map((run) => rowsOf(run, shut, at, run.id === active?.id)),
nested: Object.fromEntries(
jobs.running.map((job) => [
job.id,
all
.filter((run) => isNested(run) && run.loop === job.id)
// Under its agent's row a run needs no owner's name.
.map((run) => rowsOf({ ...run, owner: '' }, shut, at, true)),
]),
),
open: shut,
onJob: (job) => {
void update($, folds, (kept) => ({ ...kept, [`job:${job.id}`]: kept[`job:${job.id}`] !== true }))
},
onStop: (job) => {
void halted($, job)
},
onClear: () => {
void sweptAway($)
},
onFold: (row) => {
void update($, folds, (kept) => ({ ...kept, [row.key]: !(kept[row.key] ?? row.isOpen) }))
},
})
})hooks/pane.tsx 407〜446 行 · ペイン
export const paneTree = (kit: Kit, view: PaneView): RenderElement => {
const { Box, Text, Button } = kit
const { work } = view
const columns = Math.max(1, view.columns - 2 * PAD)
const line = rule(kit, columns)
const more = runSections(kit, view)
const isIdle = work.running.length === 0 && work.recent.length === 0 && more.length === 0
const isOver = (rows: readonly Row[]): boolean =>
rows[0]?.status === 'done' || rows[0]?.status === 'failed' || rows[0]?.isStopped === true
const canClear = work.recent.length > 0 || view.runs.some(isOver)
// What runs, in two sections: the shells nobody's agent started, then each
// agent with what it started under it.
const isTop = (job: Job): boolean => !work.running.some((one) => one.id === job.owner)
const shells = work.running.filter((job) => job.kind === 'shell' && isTop(job))
const agents = work.running.filter((job) => job.kind === 'agent' && isTop(job))
const blank = <Text> </Text>
const clear = (
<Button key="clear" plain dimColor label="× clear" onPress={view.onClear} />
)
return (
<Box flexDirection="column" paddingX={PAD}>
{head(kit, view)}
{line}
{work.running.length === 0 && (
<Text dimColor>{isIdle ? 'Nothing runs yet.' : 'Nothing runs right now.'}</Text>
)}
{shells.length > 0 && section(kit, `SHELLS · ${shells.length}`, blank, shells, view, false)}
{shells.length > 0 && agents.length > 0 && line}
{agents.length > 0 && section(kit, `AGENTS · ${agents.length}`, blank, agents, view, false)}
{isIdle && (
<Text dimColor>Shells, agents and task lists Claude starts show here while they run.</Text>
)}
{more.flatMap((part) => [line, part])}
{work.recent.length > 0 && line}
{work.recent.length > 0 && section(kit, 'RECENT', blank, work.recent, view)}
{canClear && <Box justifyContent="flex-end">{clear}</Box>}
</Box>
)
}hooks/pane.tsx 199〜238 行 · ペイン
const head = (kit: Kit, view: PaneView): RenderElement => {
const { Box, Text, Button } = kit
const { meter } = view
const effort = effortText(meter)
const context = contextText(meter)
const usage = usageText(meter)
return (
<Box flexDirection="column">
<Box columnGap={2} flexWrap="wrap" justifyContent="space-between">
<Box columnGap={2}>
<Text bold>{modelName(meter.model) || 'Claude'}</Text>
{canStep(meter) ? (
<Box columnGap={1}>
<Text color={effortColor(meter)} dimColor={effortOf(meter) === 'low'}>
{effort.split(' ')[0]}
</Text>
<Button
key="effort"
plain
label={`${effortOf(meter)} ${isHeld(meter) ? '⟳' : '↑'}`.padEnd(LEVEL_CELLS + 2)}
onPress={view.onEffort}
/>
</Box>
) : (
<Text dimColor>
{effort || (meter.isSeen ? 'no effort setting' : 'effort shows with the first request')}
</Text>
)}
</Box>
{context !== '' && <Text dimColor={meter.context < 80}>{context}</Text>}
</Box>
{usage !== '' && (
<Text color={isTight(meter) ? 'warning' : undefined} dimColor={!isTight(meter)} wrap="truncate-end">
{usage}
</Text>
)}
</Box>
)
}hooks/pane.tsx 77〜81 行 · ペイン
const rule = ({ Text }: Kit, columns: number): RenderElement => (
<Text dimColor wrap="truncate">
{'─'.repeat(Math.max(1, columns))}
</Text>
)hooks/pane.tsx 240〜261 行 · ペイン
const section = (
kit: Kit,
title: string,
aside: RenderElement,
jobs: readonly Job[],
view: PaneView,
hasKind = true,
): RenderElement => {
const { Box, Text } = kit
return (
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold dimColor>
{title}
</Text>
{aside}
</Box>
{jobs.map((job) => jobRow(kit, job, view, 0, hasKind))}
</Box>
)
}hooks/pane.tsx 106〜193 行 · ペイン
const jobRow = (
kit: Kit,
job: Job,
view: PaneView,
indent = 0,
wantsKind = true,
): RenderElement => {
const { Box, Text, Button } = kit
const hasKind = wantsKind && view.columns >= KIND_FROM
// The row's cells less its fold and state marks, its indent and its columns at the right.
const room =
view.columns - 2 * PAD - 4 - 2 * indent - SPAN_CELLS - (hasKind ? KIND_CELLS : 0) - 1
const title = fitted(job.title, room)
// What the agent of this row started and still runs is drawn under it.
const own =
job.kind === 'agent' && job.status === 'running'
? view.work.running.filter((one) => one.owner === job.id)
: []
const isOpen = view.open[`job:${job.id}`] === true
const canStop = job.status === 'running' && job.taskId !== ''
return (
<Box flexDirection="column">
<Box>
<Box width={2 * indent} flexShrink={0} />
<Box width={2} flexShrink={0}>
<Button
key={`job-mark:${job.id}`}
plain
label={isOpen ? '▾' : '▸'}
onPress={() => {
view.onJob(job)
}}
/>
</Box>
<Box width={2} flexShrink={0}>
<Text color={COLORS[job.status]} dimColor={job.status === 'ended'}>
{GLYPHS[job.status]}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1}>
<Button
key={`job:${job.id}`}
plain
dimColor={!isOpen && job.status !== 'running' && job.status !== 'failed'}
label={title}
onPress={() => {
view.onJob(job)
}}
/>
</Box>
{hasKind && (
<Box width={KIND_CELLS} flexShrink={0} justifyContent="flex-end">
<Text dimColor>{job.kind}</Text>
</Box>
)}
<Box width={SPAN_CELLS} flexShrink={0} justifyContent="flex-end">
<Text dimColor={job.status !== 'running'}>{jobSpan(job, view.now)}</Text>
</Box>
</Box>
{isOpen && (
<Box flexDirection="column" paddingLeft={4 + 2 * indent}>
{title !== job.title && <Text wrap="wrap">{job.title}</Text>}
<Text dimColor wrap="wrap">
{detailOf(job, view.columns - 2 * PAD - 4 - 2 * indent)}
</Text>
{canStop && (
<Box>
<Button
key={`stop:${job.id}`}
plain
label="■ stop"
onPress={() => {
view.onStop(job)
}}
/>
</Box>
)}
</Box>
)}
{own.map((one) => jobRow(kit, one, view, indent + 1, wantsKind))}
{job.status === 'running' &&
(view.nested[job.id] ?? []).flatMap((rows) =>
rows.map((row) => stepRow(kit, row, view, indent + 1)),
)}
</Box>
)
}ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Barış Demirhan 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.
コードが呼ぶもの
通信プログラム起動環境変数Claude を動かすツール呼び出し保存
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 69f182f231b0 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。9 ファイルを解析 |
| コードが Mod の中で完結 | import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中 |
| 読める | 圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし |
| 呼び出しが見える | 通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で |
| 入れる前に自分で判断する材料 | |
| 描く場所 | コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに同じように描く |
| 入れる手順 | リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる |
| Windows のプログラム | $.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。git(通信する) |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。読んだうえで通信する |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add barisdemirhan/claude-deck/plugin install deck@claude-deck入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(69f182f231b0)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「barisdemirhan-deck」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Fix login▸★ build ok▸★ build ok▸★ build ok+3 moretasks 3 pending · Glob claimed · 3 doneConsensus42%
-
Claude に頼む…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
Claude に頼む…moai-boardmoai-boardPickedx closebuild 1build 2build 3r refreshQueue not read yetokPick
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
Claude に頼む…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Claude に頼む…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd