modscode EN

modscode / 図鑑 / dashboard

dashboard

Unified workbench: a status band for subagents and mmrun reviews, plus a seven-page pane (Overview / Agents / Reviews / GPU / Timeline / Usage / Progress; Reviews, GPU and Progress show once they have data); the Progress page lists the per…

確かめやすいコードターミナル+デスクトップペインバンドステータスライントーストBoxButtonText

何をするか

  • プロンプトの上の帯・欄を描く
  • /dashboard・/subagents・/mmrun・/timeline を足す
  • AskUserQuestion の呼び出しを見張る(止めることがある)
  • agent.spawn・classic.PermissionDenied・classic.PermissionRequest・classic.PostModelSwitch ほか 18 個にフックする
  • ターンをまたいで自分の状態を持つ

良いところ

  • ネットワークに出ない
  • TypeScript で書かれている
  • デスクトップ専用の分岐がある
  • エラーを扱う

作り始めるためのコード

2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。

雛形(register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like dashboard by Paradox07127 (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/paradox07127-dashboard/
// 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 map = '…'
    const workbench = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column" width="100%">
          <Box justifyContent="space-between" columnGap={1} alignItems="center">
            <Text wrap="truncate">
              {map}
            </Text>
            <Button label={`${workbench}`} variant="primary" />
          </Box>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "‹workbench›" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box } = $.ui.resolve(e)
    return (
      <Box flexDirection="column" rowGap={1}>
        <Box flexDirection="column" rowGap={1}>
          <Box flexDirection="row" columnGap={1} />
          <Box flexDirection="row" columnGap={1} />
        </Box>
      </Box>
    )
  })
}

Mod 自身のコード

Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。

plugins/dashboard/hooks/register.tsx 2289〜2348 行 · バンド
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    // A reload for a changed option raises no session.start: the first drawing starts the loops instead.
    start($)
    docksPanes = e.viewport?.isFullscreen
    await read($, tick)

    if (e.props.hasSurvey) {
      return next(e)
    }

    const bNow = await boardNow($)

    armBandWake($, nextBandChange(await read($, gates), bNow.now, await read($, trees)), bNow.now)

    const board = bandLines(bNow, Math.min(e.props.maxRows, MAX_BAND_ROWS), e.props.bodyColumns - buttonColumns())
    const lines = board.length === 0 ? [await idleNow($)] : board
    const needsYou = bNow.entries.some(entry => entry.tier === 1)

    if (e.surface === 'desktop') {
      const el = $.ui.resolve(e)
      const { Box } = el

      return (
        <Box flexDirection="column">
          {drawDesktopBand(el, lines, () => void goTo($, 'overview'), needsYou)}
          {await next(e)}
        </Box>
      )
    }

    const { Box, Button, Text } = $.ui.resolve(e)
    const width = e.props.bodyColumns
    const draw = (line: Line, columns: number) => (
      <Text wrap="truncate">
        {fitLine(line, columns).map(seg => (
          <Text
            {...(seg.color !== undefined && { color: seg.color })}
            {...(seg.bold === true && { bold: true })}
            {...(seg.dim === true && { dimColor: true })}
          >
            {seg.text}
          </Text>
        ))}
      </Text>
    )

    return (
      <Box flexDirection="column">
        <Box flexDirection="column">
          <Box>
            {draw(lines[0] ?? [], width - buttonColumns())}
            <Text> </Text>
            <Button key="dash-open" label={t().workbench} onPress={() => void goTo($, 'overview')} />
          </Box>
          {lines.slice(1).map(line => draw(line, width))}
        </Box>
        {await next(e)}
      </Box>
    )
  }).catch(($, e, next) => {
plugins/dashboard/hooks/desktop.tsx 209〜238 行 · バンド
export function drawDesktopBand(el: El, lines: readonly Line[], onOpen: () => void, needsYou = false) {
  const { Box, Button, Text } = el
  const draw = (line: Line) => (
    <Text wrap="truncate">
      {line.map(seg => (
        <Text
          {...(seg.color !== undefined && { color: seg.color })}
          {...(seg.bold === true && { bold: true })}
          {...(seg.dim === true && { dimColor: true })}
        >
          {seg.text.replace(/ {3,}/g, '  ')}
        </Text>
      ))}
    </Text>
  )

  const isPrimary =
    needsYou ||
    lines.some(l => l.some(s => s.color === 'error' || (s.color === 'warning' && s.text.includes('!'))))

  return (
    <Box flexDirection="column" width="100%">
      <Box justifyContent="space-between" columnGap={1} alignItems="center">
        {draw(lines[0] ?? [])}
        <Button key="dash-open" label={t().workbench} variant={isPrimary ? 'primary' : 'secondary'} onPress={onOpen} />
      </Box>
      {lines.slice(1).map(draw)}
    </Box>
  )
}
plugins/dashboard/hooks/register.tsx 2498〜2498 行 · バンド
    const draw = (line: Line) => <Text wrap="truncate">{fitLine(line, columns).map(segText)}</Text>
plugins/dashboard/hooks/register.tsx 2412〜2571 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE_ID }, async ($, e) => {
    await read($, tick)
    await resumeGpu($)
    // A pane drawn before any opening this load, as after a reload, checks once here.
    shownTabs ??= await tabsWithData($).catch(() => null)

    if (e.surface === 'desktop') {
      const current = (await read($, page)) ?? 'overview'

      return drawDesktopPane($.ui.resolve(e), {
        page: current,
        pages: pagesShown(current),
        now: await $.clock.now(),
        columns: e.props.bodyColumns,
        agents: await read($, agents),
        snap: await read($, runs),
        seen: await read($, seen),
        gpu: await read($, gpu),
        gpuHosts: autoHosts,
        onConnectGpu: host => void connectGpu($, host),
        onChangeGpuHost: () => void forgetGpu($),
        disclosures: openDisclosures,
        onToggleDisclosure: key => toggleDisclosure($, key),
        gates: await read($, gates),
        trees: await read($, trees),
        guards: (await read($, guards))?.blocks ?? [],
        peers: (await read($, peers)) ?? [],
        paneRuns: PANE_RUNS,
        detail: await read($, detail),
        reports: await read($, reports),
        timeline: await read($, timeline),
        timelineTurnId: (await read($, timelineTurn)) ?? undefined,
        flights: await flightsNow($),
        agentsSeenBefore: await read($, agentsSeenBefore),
        isFoldOpen: await read($, agentsFoldOpen),
        peek: await read($, peek),
        usage: await usageNow($),
        progress: await read($, progress),
        onToggleFold: () => void update($, agentsFoldOpen, was => !was),
        onTimelineTurn: turnId => void pickTurn($, turnId ?? null),
        timelineView: await read($, timelineView),
        onTimelineView: () => void update($, timelineView, was => (was === 'hotspots' ? 'turn' : 'hotspots')),
        timelinePage: (await read($, timelinePage)) ?? undefined,
        onTimelinePage: to => void update($, timelinePage, () => to),
        onPage: to => void goTo($, to),
        onReadAgent: agentId => void readAgent($, agentId),
        onReadRun: runid => void readRun($, runid),
        onOpenItem: item => void openItem($, item),
        onBack: () => void closeDetail($),
        onToggleSeverity: () => void toggleSeverity($),
        onPickModel: model => void pickReportModel($, model),
        onFinding: finding => void pickFinding($, finding),
        onCopyResume: (sessionId, surface) => void copyResume($, sessionId, surface),
        onCopyCd: (path, surface) => void copyCd($, path, surface),
        onClose: () =>
          void (async () => {
            await closedByPerson($)
            await $.ui.close({ id: PANE_ID })
            await syncStatus($)
          })(),
      })
    }

    const { Box, Button, Markdown, Text } = $.ui.resolve(e)
    const current = (await read($, page)) ?? 'overview'
    const now = await $.clock.now()
    const columns = e.props.bodyColumns
    const plain = (text: string, style: { dim?: boolean; color?: string; bold?: boolean } = {}) => (
      <Text
        wrap="truncate"
        {...(style.dim === true && { dimColor: true })}
        {...(style.color !== undefined && { color: style.color })}
        {...(style.bold === true && { bold: true })}
      >
        {fit(text, columns)}
      </Text>
    )
    const segText = (seg: Seg) => (
      <Text
        {...(seg.color !== undefined && { color: seg.color })}
        {...(seg.bold === true && { bold: true })}
        {...(seg.dim === true && { dimColor: true })}
      >
        {seg.text}
      </Text>
    )
    const draw = (line: Line) => <Text wrap="truncate">{fitLine(line, columns).map(segText)}</Text>
    const buttonRow = (row: ButtonRow, key: string, hotkey: string | undefined, onPress: () => void, isDim = false) => (
      <Box>
        {row.before.map(segText)}
        <Button key={key} label={row.label} plain {...(hotkey !== undefined && { hotkey })} {...(isDim && { dimColor: true })} onPress={onPress} />
        {row.after.map(segText)}
      </Box>
    )
    const tabs = paneTabs($, { Box, Button }, current)
    const backRow = (title: string) => (
      <Box columnGap={1}>
        <Button key="dash-back" label={t().back} onPress={() => void closeDetail($)} />
        <Text bold wrap="truncate">
          {title}
        </Text>
      </Box>
    )
    const open = await read($, detail)
    const openAgent = open?.page === 'agents' && current === 'agents' ? (await read($, agents)).find(one => one.agentId === open.agentId) : undefined
    const openRun = open?.page === 'mmrun' && current === 'mmrun' ? (await read($, runs))?.runs.find(one => one.runid === open.runid) : undefined
    const openReport = openRun === undefined ? undefined : (await read($, reports))[openRun.runid]
    let body

    if (openAgent !== undefined) {
      const last = await read($, peek)
      const peeked = openAgent.state === 'running' && last?.agentId === openAgent.agentId ? last : undefined
      const labelled = (label: string, text: string) => draw([{ text: `${label}  `, dim: true }, { text }])
      const peekRows =
        peeked === undefined
          ? []
          : peeked.failed === true
            ? [plain(t().peekUnreadable, { color: 'warning' })]
            : [
                ...(peeked.task === '' ? [] : [labelled(t().peekTask, peeked.task)]),
                ...(peeked.calls.length === 0 ? [] : [plain(t().peekCalls, { dim: true }), ...peeked.calls.map(call => plain(`  ${call}`))]),
                ...(peeked.text === '' ? [] : [labelled(t().peekText, peeked.text)]),
              ]

      body = [
        backRow(`${openAgent.subagentType} · ${openAgent.description}`),
        plain(openAgent.state === 'running' ? t().agentStillRunning : t().agentAnswerHead, { color: 'warning', bold: true }),
        ...(openAgent.usage === undefined ? [] : [plain(usageText(openAgent.usage), { dim: true })]),
        ...peekRows,
        <Markdown text={openAgent.answer ?? ''} />,
      ]
    } else if (open?.page === 'mmrun' && openRun !== undefined && openReport !== undefined) {
      body = [
        backRow(`${runLabel(openRun)} · ${openRun.runid}`),
        <Box columnGap={1}>
          <Text color="warning" bold>
            {t().modelReport}
          </Text>
          <Button key="dash-severity" label={open.showAll ? t().criticalMajorOnly : t().allSeverities} onPress={() => void toggleSeverity($)} />
        </Box>,
        ...openReport.models.flatMap(model => [
          <Text wrap="truncate">
            <Text bold>{model.name}</Text>
            <Text dimColor>{`  ${model.status}`}</Text>
          </Text>,
          <Markdown text={model.markdown} />,
        ]),
      ]
    } else if (current === 'overview') {
      const snap = await read($, runs)
      const polledAt = snap?.polledAt ?? now
      const allGates = await read($, gates)
      const found = await read($, trees)
      const overview = overviewOf(await read($, agents), snap, await read($, seen), now, (await read($, peers)) ?? [], allGates, found)
      const flights = await flightsNow($)
      const recent = recentGates(allGates, OVERVIEW_GATES)
      const blocks = (await read($, guards))?.blocks ?? []
      const section = (rows: RenderChildren) => (
        <Box flexDirection="column" marginTop={1}>
          {rows}
plugins/dashboard/hooks/desktop.tsx 1314〜1338 行 · ペイン
export function drawDesktopPane(el: El, data: PaneData) {
  const { Box } = el
  const body =
    detailBody(el, data) ??
    (data.page === 'overview'
      ? overview(el, data)
      : data.page === 'agents'
        ? agentCards(el, data)
        : data.page === 'mmrun'
          ? runCards(el, data)
          : data.page === 'timeline'
            ? timelineBody(el, data)
            : data.page === 'usage'
              ? usageBody(el, data)
              : data.page === 'progress'
                ? progressBody(el, data)
                : gpuBody(el, data))

  return (
    <Box flexDirection="column" rowGap={1}>
      {tabs(el, data)}
      {body}
    </Box>
  )
}
plugins/dashboard/hooks/desktop.tsx 240〜273 行 · ペイン
function tabs(el: El, data: Pick<PaneData, 'page' | 'pages' | 'onPage' | 'columns'>) {
  const { Box, Button } = el
  const isNarrow = widthTierOf(data.columns) === 'narrow'
  const buttonOf = (one: { page: DashPage; label: string }) => (
    <Button
      key={`page-${one.page}`}
      label={one.label}
      variant={one.page === data.page ? 'primary' : 'secondary'}
      onPress={() => data.onPage(one.page)}
    />
  )

  if (isNarrow) {
    const row1 = data.pages.slice(0, 3).map(buttonOf)
    const row2 = data.pages.slice(3).map(buttonOf)

    return (
      <Box flexDirection="column" rowGap={1}>
        <Box flexDirection="row" columnGap={1}>
          {row1}
        </Box>
        <Box flexDirection="row" columnGap={1}>
          {row2}
        </Box>
      </Box>
    )
  }

  return (
    <Box flexDirection="row" columnGap={1}>
      {data.pages.map(buttonOf)}
    </Box>
  )
}
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 Paradox07127

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 を動かすツール呼び出し保存

コードから読めること

2026-10-06 に読んだコミット 0b3a6da7617f のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。plugins/dashboard/hooks/register.tsx
解析できるすべてのファイルが TypeScript か JavaScript として解析できる。21 ファイルを解析
コードが 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/… などは無い)。plugins/dashboard/hooks/register.tsx:675 kill(Windows にない); plugins/dashboard/hooks/register.tsx:1045 tail(Windows にない); plugins/dashboard/hooks/register.tsx:1895 tail(Windows にない); plugins/dashboard/hooks/register.tsx:2015 tail(Windows にない)
通信fetch の送り先(https のホスト)がコードに書いてあるか。通信なし
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。plugins/dashboard/hooks/register.tsx:1341 実行時に決まるプログラム
読んで送るファイルや環境変数を読み、かつ通信するか。reads environment variables and files and reaches the network
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件

入れる

入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。

リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。

/plugin marketplace add Paradox07127/claude-utopia
/plugin install dashboard@claude-utopia

入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(0b3a6da7617f)と違うことがあります。入れる前に見比べてください。

Claude に聞く

modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:

modscode のデザイン「paradox07127-dashboard」をコードごと読んで、同じようなペインを作って

Claude から探す: MCP コネクタ

似たデザイン