meme-watch
Live USD PnL for the top 5 memecoin positions in a Solana wallet, plus a live chart terminal for any token. Helius only.
何をするか
- プロンプトの上の帯・欄・トーストを描く
- /memes・/token を足す
- session.start・ui.closeにフックする
- ターンをまたいで自分の状態を持つ
- ネットワークに出る
良いところ
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like meme-watch by Nathan Liow (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/nathanliow-meme-watch/
// 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 } = $.ui.resolve(e)
const sym = '…'
const formatUsd = '…'
const formatUsd2 = '…'
const formatPct = '…'
const sym2 = '…'
const formatUsd3 = '…'
const formatUsd4 = '…'
const formatPct2 = '…'
const sym3 = '…'
const formatUsd5 = '…'
const formatUsd6 = '…'
const formatPct3 = '…'
return (
<Box flexDirection="column">
<Box>
<Text>
🐸
{" "}
<Text>
{" · "}
<Text bold>
{sym}
</Text>
{" "}
{formatUsd}
{" "}
<Text color="green">
{formatUsd2}
{" ("}
{formatPct}
)
</Text>
</Text>
<Text>
{" · "}
<Text bold>
{sym2}
</Text>
{" "}
{formatUsd3}
{" "}
<Text color="green">
{formatUsd4}
{" ("}
{formatPct2}
)
</Text>
</Text>
<Text>
{" · "}
<Text bold>
{sym3}
</Text>
{" "}
{formatUsd5}
{" "}
<Text color="green">
{formatUsd6}
{" ("}
{formatPct3}
)
</Text>
</Text>
</Text>
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Chart" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const sym = '…'
const name = '…'
const mint = '…'
const fmtPrice = '…'
const fmtPct = '…'
const slot = '…'
const lagMs = '…'
const fmtUsd = '…'
const fmtNum = '…'
const histText = '…'
const label = '…'
const i = '…'
const k = '…'
const k2 = '…'
const fmtPct2 = '…'
const k3 = '…'
const fmtPct3 = '…'
const top10Pct = '…'
const hhmmss = '…'
const fmtPrice2 = '…'
const fmtUsd2 = '…'
const fmtNum2 = '…'
const maker = '…'
const hhmmss2 = '…'
const fmtPrice3 = '…'
const fmtUsd3 = '…'
const fmtNum3 = '…'
const maker2 = '…'
const hhmmss3 = '…'
const fmtPrice4 = '…'
const fmtUsd4 = '…'
const fmtNum4 = '…'
const maker3 = '…'
const err = '…'
const formatPrice = '…'
const formatUsd = '…'
const formatUsd2 = '…'
const formatPct = '…'
const formatPrice2 = '…'
const formatUsd3 = '…'
const formatUsd4 = '…'
const formatPct2 = '…'
const formatPrice3 = '…'
const formatUsd5 = '…'
const formatUsd6 = '…'
const formatPct3 = '…'
const err2 = '…'
const owner = '…'
const formatPrice4 = '…'
return (
<Box flexDirection="column">
<Box marginBottom={1}>
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1}>
<Box flexDirection="column">
<Text wrap="truncate">
<Text color="#eaecef" bold>
{sym}
</Text>
<Text color="#5e6673">
{` ${name} · ${mint}`}
</Text>
</Text>
<Text>
<Text bold>
{fmtPrice}
</Text>
<Text bold>
{` ${fmtPct}`}
</Text>
<Text color="#5e6673">
{" 24h"}
</Text>
</Text>
</Box>
</Box>
<Box flexDirection="column" alignItems="flex-end">
<Text color="#0ecb81" bold>
● LIVE · LaserStream
</Text>
<Text color="#5e6673" wrap="truncate">
{`slot ${slot} · Δ${lagMs}ms · SOL ${fmtPrice}`}
</Text>
</Box>
</Box>
<Text wrap="truncate">
<Text>
<Text color="#5e6673">
MCAP
{" "}
</Text>
<Text bold>
{fmtUsd}
</Text>
<Text>
{" "}
</Text>
</Text>
<Text>
<Text color="#5e6673">
SUPPLY
{" "}
</Text>
<Text bold>
{fmtNum}
</Text>
<Text>
{" "}
</Text>
</Text>
<Text>
<Text color="#5e6673">
HISTORY
{" "}
</Text>
<Text color="#848e9c" bold>
{histText}
</Text>
<Text>
{" "}
</Text>
</Text>
</Text>
<Box flexDirection="row" justifyContent="space-between" marginTop={1}>
<Box flexDirection="row" gap={1}>
<Button label={`${label}`} hotkey={`${i}`} variant="primary" />
<Button label={`${label}`} hotkey={`${i}`} variant="primary" />
<Button label={`${label}`} hotkey={`${i}`} variant="primary" />
</Box>
<Text wrap="truncate">
<Text>
<Text color="#5e6673">
{k}
{" "}
</Text>
<Text>
{fmtPct}
</Text>
<Text>
{" "}
</Text>
</Text>
<Text>
<Text color="#5e6673">
{k2}
{" "}
</Text>
<Text>
{fmtPct2}
</Text>
<Text>
{" "}
</Text>
</Text>
<Text>
<Text color="#5e6673">
{k3}
{" "}
</Text>
<Text>
{fmtPct3}
</Text>
<Text>
{" "}
</Text>
</Text>
</Text>
</Box>
<Box flexDirection="row" gap={1}>
<Box flexDirection="column" borderStyle="round" borderColor="#2b3139" paddingX={1}>
<Box flexDirection="column" marginBottom={1}>
<Text>
<Text color="#848e9c" bold>
LAST 60s
</Text>
<Text color="#5e6673">
{" vol "}
</Text>
<Text color="#eaecef">
0
</Text>
</Text>
<Text>
<Text color="#0ecb81">
0
{" buys"}
</Text>
<Text color="#5e6673">
{" / "}
</Text>
<Text color="#f6465d">
0
{" sells"}
</Text>
<Text color="#5e6673">
{" · "}
0
{" wallets"}
</Text>
</Text>
<Text>
<Text color="#0ecb81">
████████
</Text>
<Text color="#f6465d">
████████
</Text>
</Text>
</Box>
<Box flexDirection="column" marginBottom={1}>
<Text>
<Text color="#848e9c" bold>
1H
</Text>
<Text color="#5e6673">
{" vol "}
</Text>
<Text color="#eaecef">
0
</Text>
</Text>
<Text>
<Text color="#0ecb81">
0
{" buys"}
</Text>
<Text color="#5e6673">
{" / "}
</Text>
<Text color="#f6465d">
0
{" sells"}
</Text>
<Text color="#5e6673">
{" · "}
0
{" wallets"}
</Text>
</Text>
<Text>
<Text color="#0ecb81">
████████
</Text>
<Text color="#f6465d">
████████
</Text>
</Text>
</Box>
<Box flexDirection="column" marginBottom={1}>
<Text>
<Text color="#848e9c" bold>
24H
</Text>
<Text color="#5e6673">
{" vol "}
</Text>
<Text color="#eaecef">
0
</Text>
</Text>
<Text>
<Text color="#0ecb81">
0
{" buys"}
</Text>
<Text color="#5e6673">
{" / "}
</Text>
<Text color="#f6465d">
0
{" sells"}
</Text>
<Text color="#5e6673">
{" · "}
0
{" wallets"}
</Text>
</Text>
<Text>
<Text color="#0ecb81">
████████
</Text>
<Text color="#f6465d">
████████
</Text>
</Text>
</Box>
<Text color="#848e9c" bold>
TOP 10 ACCOUNTS
</Text>
<Text>
<Text color="#5e6673">
{"hold "}
</Text>
<Text color="#f0b90b">
{top10Pct}
%
</Text>
<Text color="#5e6673">
{" (incl. pools)"}
</Text>
</Text>
<Text color="#f0b90b">
████████░░░░░░░░
</Text>
</Box>
</Box>
<Text color="#5e6673" wrap="truncate">
{"TIME "}
{"SIDE "}
{"PRICE "}
{" SIZE"}
{" "}
{" FLOW "}
{" AMOUNT"}
{" "}
MAKER
</Text>
<Text wrap="truncate">
<Text color="#5e6673">
{hhmmss}
</Text>
<Text bold>
{"▲ BUY "}
</Text>
<Text color="#eaecef">
{fmtPrice2}
</Text>
<Text>
{fmtUsd2}
{" ◆◆"}
</Text>
<Text>
{" ▮▮▮▮▮▮▮▮ "}
</Text>
<Text color="#848e9c">
{fmtNum2}
{" "}
</Text>
<Text color="#5e6673">
{maker}
</Text>
</Text>
<Text wrap="truncate">
<Text color="#5e6673">
{hhmmss2}
</Text>
<Text bold>
{"▲ BUY "}
</Text>
<Text color="#eaecef">
{fmtPrice3}
</Text>
<Text>
{fmtUsd3}
{" ◆◆"}
</Text>
<Text>
{" ▮▮▮▮▮▮▮▮ "}
</Text>
<Text color="#848e9c">
{fmtNum3}
{" "}
</Text>
<Text color="#5e6673">
{maker2}
</Text>
</Text>
<Text wrap="truncate">
<Text color="#5e6673">
{hhmmss3}
</Text>
<Text bold>
{"▲ BUY "}
</Text>
<Text color="#eaecef">
{fmtPrice4}
</Text>
<Text>
{fmtUsd4}
{" ◆◆"}
</Text>
<Text>
{" ▮▮▮▮▮▮▮▮ "}
</Text>
<Text color="#848e9c">
{fmtNum4}
{" "}
</Text>
<Text color="#5e6673">
{maker3}
</Text>
</Text>
<Box flexDirection="column" marginTop={1}>
<Input label="token: " placeholder="paste a token address, Enter" submitLabel="chart" />
<Box flexDirection="row" gap={2}>
<Button label="older history" hotkey="o" plain />
<Button label={`copy ${mint}`} hotkey="c" plain />
<Text color="#5e6673">
1-7 timeframe · Esc to the prompt
</Text>
</Box>
</Box>
<Text color="#f0b90b" wrap="truncate">
{err}
</Text>
</Box>
</Box>
<Text dimColor>
{"TOKEN "}
{" PRICE"}
{" VALUE"}
{" INVESTED"}
{" PnL"}
{" %"}
</Text>
<Text dimColor>
/memes <wallet> to start.
</Text>
<Text dimColor>
Loading positions…
</Text>
<Box flexDirection="row">
<Box width={9}>
<Button label={`${sym}`} plain autoFocus />
</Box>
<Text>
{formatPrice}
{formatUsd}
{" …"}
<Text>
{formatUsd2}
{formatPct}
</Text>
</Text>
</Box>
<Box flexDirection="row">
<Box width={9}>
<Button label={`${sym}`} plain autoFocus />
</Box>
<Text>
{formatPrice2}
{formatUsd3}
{" …"}
<Text>
{formatUsd4}
{formatPct2}
</Text>
</Text>
</Box>
<Box flexDirection="row">
<Box width={9}>
<Button label={`${sym}`} plain autoFocus />
</Box>
<Text>
{formatPrice3}
{formatUsd5}
{" …"}
<Text>
{formatUsd6}
{formatPct3}
</Text>
</Text>
</Box>
<Text color="yellow">
{err2}
</Text>
<Input label="chart any token: " placeholder="paste a token address, Enter" submitLabel="chart" />
<Text dimColor>
Tab to focus · ↑↓ highlight a token · Enter charts it · 1-7 timeframe · Esc back to the prompt
</Text>
<Text dimColor>
{`${owner}…${owner} · `}
{"SOL "}
{formatPrice4}
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Not a Solana token address`)
await $.ui.toast(`Not a Solana token address`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 714〜735 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
// Only positions with a PnL: still-scanning ones join once their basis is in.
const list = (await read($, positions)).flatMap(p => {
const r = pnl(p)
return r ? [{ ...p, r }] : []
})
if (e.props.hasSurvey || !list.length) return next(e)
const { Box, Text } = $.ui.resolve(e)
return (
<Box>
<Text>
🐸{' '}
{list.map(({ sym, valueUsd, r }, i) => (
<Text>
{i ? ' · ' : ''}<Text bold>{sym}</Text> {formatUsd(valueUsd)}{' '}
<Text color={r.usd >= 0 ? 'green' : 'red'}>{formatUsd(r.usd, true)} ({formatPct(r.pct)})</Text>
</Text>
))}
</Text>
</Box>
)
})hooks/register.tsx 737〜777 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const els = $.ui.resolve(e)
const { Box, Text, Button } = els
const owner = await read($, wallet)
const list = await read($, positions)
const sol = await read($, solUsd)
const err = await read($, error)
const color = (n: number) => (n >= 0 ? 'green' : 'red')
const chartRows = (e.props.scroll.bodyRows || 40) - list.length - 7
return (
<Box flexDirection="column">
<Box marginBottom={1}>{await chartView($, e, true, chartRows)}</Box>
<Text dimColor>{'TOKEN'.padEnd(9)}{'PRICE'.padStart(11)}{'VALUE'.padStart(10)}{'INVESTED'.padStart(10)}{'PnL'.padStart(11)}{'%'.padStart(9)}</Text>
{!owner && <Text dimColor>/memes <wallet> to start.</Text>}
{owner && list.length === 0 && !err && <Text dimColor>Loading positions…</Text>}
{list.map((p, i) => {
const r = pnl(p)
return (
<Box flexDirection="row">
<Box width={9}>
<Button key={`chart-${p.mint}`} label={p.sym.slice(0, 8)} plain autoFocus={i === 0 ? true : undefined} onPress={() => void chartInMemes($, p.mint)} />
</Box>
<Text>
{formatPrice(p.priceUsd).padStart(11)}
{formatUsd(p.valueUsd).padStart(10)}
{(p.basis ? formatUsd(p.basis.buyUsd) : '…').padStart(10)}
{r ? <Text color={color(r.usd)}>{formatUsd(r.usd, true).padStart(11)}{formatPct(r.pct).padStart(9)}</Text> : <Text dimColor>{'scanning'.padStart(11)}</Text>}
</Text>
</Box>
)
})}
{err !== '' && <Text color="yellow">{err}</Text>}
{'Input' in els && <els.Input key="token" label="chart any token: " placeholder="paste a token address, Enter" submitLabel="chart" onSubmit={v => void chartInMemes($, v.trim())} />}
<Text dimColor>Tab to focus · ↑↓ highlight a token · Enter charts it · 1-7 timeframe · Esc back to the prompt</Text>
<Text dimColor>
{owner ? `${owner.slice(0, 4)}…${owner.slice(-4)} · ` : ''}SOL {formatPrice(sol)}
</Text>
</Box>
)
})hooks/register.tsx 818〜977 行 · ペイン
async function chartView($: EngineInterface, e: Extract<RenderInput, { component: 'Pane' }>, inMemes: boolean, rows: number) {
const els = $.ui.resolve(e)
const { Box, Text, Button } = els
const mint = await read($, tokenA)
const info = await read($, infoA)
const tf = tfOf(await read($, tfA))
const candles = await read($, candlesA)
const trades = await read($, tradesA)
const feed = await read($, feedA)
const hist = await read($, historyA)
const sol = await read($, solUsd)
const err = await read($, tokenErrorA)
const addressBox = 'Input' in els ? <els.Input key="mint" label="token: " placeholder="paste a token address, Enter" submitLabel="chart" onSubmit={v => void openToken($, v.trim())} /> : null
if (!mint) return inMemes ? <Text dimColor>Highlight a token below to chart it.</Text> : <Box flexDirection="column">{addressBox}<Text dimColor>Tab to focus, paste an address, Enter.</Text></Box>
const W = e.props.bodyColumns
const now = Date.now() / 1000
const price = candles[candles.length - 1]?.c ?? trades[0]?.price ?? 0
// A window's numbers only once the history reaches back that far (or holds the token's whole life).
const covers = (sec: number) => !hist.more || (hist.count > 0 && hist.from <= now - sec)
const change = (sec: number) => (covers(sec) ? changeSince(all, now - sec, price) : undefined)
const ch24 = change(86400)
const tick = trades[0]?.side === 'sell' ? C.down : C.up
const sym = info?.symbol ?? short(mint)
const color = (n: number) => (n >= 0 ? C.up : C.down)
// Layout over `rows`: header 2, stats 1, timeframe bar 2, chart, tape header 1, tape, footer 2-3.
const rest = Math.max(10, rows - (inMemes ? 9 : 10))
const tapeRows = inMemes ? 3 : Math.max(3, Math.min(40, Math.round(rest * 0.36)))
const chartRows = Math.max(6, Math.min(120, rest - tapeRows))
const side = W >= 100 ? 30 : 0
const chartCols = Math.max(20, Math.min(255, W - side - (side ? 1 : 0)))
const stat = (label: string, value: string, valueColor = C.bright) => (
<Text>
<Text color={C.dim}>{label} </Text>
<Text color={valueColor} bold>{value}</Text>
<Text>{' '}</Text>
</Text>
)
const feedBadge =
feed.mode === 'live' ? <Text color={C.up} bold>● LIVE · LaserStream</Text>
: feed.mode === 'polling' ? <Text color={C.warn} bold>◐ POLLING · Helius RPC</Text>
: feed.mode === 'connecting' ? <Text color={C.warn} bold>◌ CONNECTING</Text>
: <Text color={C.dim} bold>○ OFF</Text>
let chart
if (e.surface === 'terminal') {
const { Raster } = $.ui.resolve(e)
const key = `${sym}|${info?.supply}|${tf.label}|${chartCols}x${chartRows}|${candles.length}|${candles[0]?.t}|${JSON.stringify(candles[candles.length - 1] ?? null)}`
if (chartCache.key !== key) chartCache = { key, b64: toBase64(new Uint8Array(rasterChart(candles, chartCols, chartRows, info?.supply ?? 0).buffer)) }
chart = <Raster key="chart" columns={chartCols} rows={chartRows} cells={chartCache.b64} />
} else {
chart = <Box width={chartCols} height={chartRows}><Text color={C.dim}>The chart draws in the terminal.</Text></Box>
}
// Flow bars for the side panel: green buys against red sells.
const bw = side - 4
const flowBar = (a: number, b: number) => {
const n = a + b ? Math.round((a / (a + b)) * bw) : Math.round(bw / 2)
return <Text><Text color={C.up}>{'█'.repeat(n)}</Text><Text color={C.down}>{'█'.repeat(bw - n)}</Text></Text>
}
const flowBlock = (title: string, sec: number) => {
const f = flowSince(all, now - sec)
return (
<Box flexDirection="column" marginBottom={1}>
<Text><Text color={C.text} bold>{title}</Text><Text color={C.dim}> vol </Text><Text color={C.bright}>{fmtUsd(f.volUsd)}</Text></Text>
<Text><Text color={C.up}>{fmtNum(f.buys)} buys</Text><Text color={C.dim}> / </Text><Text color={C.down}>{fmtNum(f.sells)} sells</Text><Text color={C.dim}> · {fmtNum(f.makers)} wallets</Text></Text>
{flowBar(f.buyUsd, f.sellUsd)}
</Box>
)
}
const span = hist.count ? now - hist.from : 0
const panel = side ? (
<Box flexDirection="column" width={side} height={chartRows} borderStyle="round" borderColor={C.line} paddingX={1}>
{flowBlock('LAST 60s', 60)}
{covers(3600) && flowBlock('1H', 3600)}
{covers(86400) ? flowBlock('24H', 86400) : hist.count > 0 && flowBlock(`LOADED ${fmtSpan(span)}`, span + 1)}
{info?.top10Pct != null && <Text color={C.text} bold>TOP 10 ACCOUNTS</Text>}
{info?.top10Pct != null && <Text><Text color={C.dim}>hold </Text><Text color={info.top10Pct > 30 ? C.warn : C.bright}>{info.top10Pct.toFixed(1)}%</Text><Text color={C.dim}> (incl. pools)</Text></Text>}
{info?.top10Pct != null && <Text color={info.top10Pct > 30 ? C.warn : C.text}>{bar(info.top10Pct / 100, bw)}</Text>}
</Box>
) : null
// Time & sales, sized against the biggest print on screen.
const shown = trades.slice(0, tapeRows)
const maxUsd = Math.max(1, ...shown.map(t => t.usd))
const wide = W >= 96
const tape = shown.map(t => {
const c = t.side === 'buy' ? C.up : C.down
const big = t.usd >= 1000
return (
<Text wrap="truncate">
<Text color={C.dim}>{hhmmss(t.t).padEnd(10)}</Text>
<Text color={c} bold>{(t.side === 'buy' ? '▲ BUY ' : '▼ SELL').padEnd(8)}</Text>
<Text color={C.bright}>{fmtPrice(t.price).padEnd(14)}</Text>
<Text color={c} bold={big}>{fmtUsd(t.usd).padStart(9)}{big ? (t.usd >= 10_000 ? ' ◆◆' : ' ◆ ') : ' '}</Text>
{wide && <Text color={c}>{' ' + '▮'.repeat(Math.max(1, Math.round((t.usd / maxUsd) * 12))).padEnd(13)}</Text>}
<Text color={C.text}>{fmtNum(t.tokens).padStart(10)} </Text>
<Text color={C.dim}>{short(t.maker)}</Text>
</Text>
)
})
const histText = hist.loading ? `loading history… ${fmtNum(hist.count)} swaps` : hist.count ? `${fmtNum(hist.count)} swaps over ${fmtSpan(span)}${hist.more ? '' : ' (all)'}` : 'no swaps yet'
return (
<Box flexDirection="column" width={W}>
{/* Header: identity and price on the left, the feed on the right. */}
<Box flexDirection="row" justifyContent="space-between">
<Box flexDirection="row" gap={1}>
<Box flexDirection="column">
<Text wrap="truncate">
<Text color={C.bright} bold>{sym}</Text>
<Text color={C.dim}>{info?.name ? ` ${info.name} · ${short(mint)}` : ` ${short(mint)}`}</Text>
</Text>
<Text>
<Text color={tick} bold>{fmtPrice(price)}</Text>
{ch24 != null && <Text color={color(ch24)} bold>{' ' + fmtPct(ch24)}</Text>}
{ch24 != null && <Text color={C.dim}> 24h</Text>}
</Text>
</Box>
</Box>
<Box flexDirection="column" alignItems="flex-end">
{feedBadge}
<Text color={C.dim} wrap="truncate">
{feed.msg || (feed.slot ? `slot ${feed.slot.toLocaleString('en-US')} · Δ${feed.lagMs}ms · SOL ${fmtPrice(sol)}` : `SOL ${fmtPrice(sol)}`)}
</Text>
</Box>
</Box>
{/* Stats strip. */}
<Text wrap="truncate">
{info?.supply ? stat('MCAP', fmtUsd(price * info.supply)) : null}
{info?.supply ? stat('SUPPLY', fmtNum(info.supply)) : null}
{stat('HISTORY', histText, C.text)}
</Text>
{/* Timeframes (hotkeys 1-7) and change over each window the history covers. */}
<Box flexDirection="row" justifyContent="space-between" marginTop={1}>
<Box flexDirection="row" gap={1}>
{TIMEFRAMES.map((t, i) => (
<Button key={`tf-${t.label}`} label={t.label} hotkey={String(i + 1)} variant={t.label === tf.label ? 'primary' : 'secondary'} onPress={() => setTimeframe($, t.label)} />
))}
</Box>
<Text wrap="truncate">
{([['5M', 300], ['1H', 3600], ['6H', 21600], ['24H', 86400]] as const).map(([k, sec]) => {
const c = change(sec)
return c == null ? null : <Text><Text color={C.dim}>{k} </Text><Text color={color(c)}>{fmtPct(c)}</Text><Text>{' '}</Text></Text>
})}
</Text>
</Box>
{/* Chart and side panel. */}
<Box flexDirection="row" gap={side ? 1 : 0}>
{chart}
{panel}
</Box>
{/* Time & sales. */}ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Nathan Liow 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.
コードが呼ぶもの
通信プログラム起動ファイル読み取り環境変数保存
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 5b81e3d8b951 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。3 ファイルを解析 |
| コードが 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 のホスト)がコードに書いてあるか。https://mainnet.helius-rpc.com |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。hooks/register.tsx:534 node(シェル・インタプリタ) |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。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 nathanliow/meme-watch/plugin install meme-watch@meme-watch入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(5b81e3d8b951)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「nathanliow-meme-watch」をコードごと読んで、同じようなペインを作って似たデザイン
-
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
-
slop Edit1 of 3accepteditrejectClaude に頼む…
-
Claude に頼む…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Claude に頼む…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel
-
Claude に頼む…Fanyi settingsOnAPI · OpusenOn this MacAPIHost src/ SaveKey K · paste a new one, Enter SaveOpus↻ RefreshCustom model model id, for an API that lists none UseFanyi settingsHostClose
-
Claude に頼む…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts