modscode JA

modscode / Gallery / vome-esphome

vome-esphome

A side pane for ESPHome in Claude Code: a map of the device from its YAML (board, network, buses, entities, pins, triggers) with what a save changed lit up, and the build Claude is running as it happens (phase, progress, the latest output,…

Code you can checkTerminal + desktopPaneBoxButtonCodeMarkdownText

What it does

  • Draws a pane in the desktop app
  • Adds /esphome
  • Watches tool calls and can refuse them
  • Hooks plugin.register, session.start
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

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)

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

// Drawn like vome-esphome by Vortitron (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/vortitron-vome-esphome/
// 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: "ESPHome" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Markdown, Code, Button } = $.ui.resolve(e)
    const verb = '…'
    const configuration = '…'
    const status = '…'
    const uploadPercent = '…'
    const error = '…'
    const line = '…'
    const line2 = '…'
    const line3 = '…'
    const name = '…'
    const configuration2 = '…'
    const deployed = '…'
    const current = '…'
    const name2 = '…'
    const configuration3 = '…'
    const name3 = '…'
    const configuration4 = '…'
    const allowLines = '…'
    return (
      <Box flexDirection="column">
        <Text bold wrap="truncate-end">
          {verb}
          {" "}
          {configuration}
        </Text>
        <Text color="success" wrap="truncate-end">
          {status}
        </Text>
        <Text color="suggestion">
          ████████░░░░░░░░
          {" "}
          {uploadPercent}
          %
        </Text>
        <Text dimColor wrap="truncate-end">
          {" "}
        </Text>
        <Text color="error" wrap="wrap">
          {error}
        </Text>
        <Box flexDirection="column">
          <Text wrap="truncate-end">
            {line}
          </Text>
          <Text wrap="truncate-end">
            {line2}
          </Text>
          <Text wrap="truncate-end">
            {line3}
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Text bold>
            Devices
          </Text>
          <Text wrap="truncate-end">
            <Text color="warning">
              {"↑ "}
            </Text>
            {name}
            <Text dimColor>
              {"  "}
              {configuration2}
              {`  ${deployed}`}
              {` → ${current} available`}
            </Text>
          </Text>
          <Text wrap="truncate-end">
            <Text color="warning">
              {"↑ "}
            </Text>
            {name2}
            <Text dimColor>
              {"  "}
              {configuration3}
              {`  ${deployed}`}
              {` → ${current} available`}
            </Text>
          </Text>
          <Text wrap="truncate-end">
            <Text color="warning">
              {"↑ "}
            </Text>
            {name3}
            <Text dimColor>
              {"  "}
              {configuration4}
              {`  ${deployed}`}
              {` → ${current} available`}
            </Text>
          </Text>
        </Box>
        <Box flexDirection="column" borderStyle="round" borderColor="warning" paddingX={1} marginTop={1}>
          <Text color="warning" wrap="wrap">
            {"Auto mode refused the pane's read of the build's progress or the device's YAML. Add these to permissions.allow in "}
            ~/.claude/settings.json
            , then the next build shows live:
          </Text>
          <Markdown text="[~/.claude/settings.json](file://~/.claude/settings.json)" />
          <Code source={`${allowLines}`} />
          <Box flexDirection="row" gap={2}>
            <Button hotkey="c">
              Copy the lines
            </Button>
            <Button hotkey="r">
              Retry
            </Button>
          </Box>
        </Box>
        <Box flexDirection="row" gap={2} marginTop={1}>
          <Text dimColor wrap="wrap">
            {"Working on automations too? The automation pane shows them, and their runs: "}
            <Text color="suggestion">
              /plugin install vome-automation --marketplace Vortitron/home-assistant-mcp
            </Text>
          </Text>
          <Button dimColor>
            Hide
          </Button>
        </Box>
        <Box marginTop={1} gap={2}>
          <Button hotkey="l" dimColor>
            Map and latest lines
          </Button>
          <Button hotkey="b" dimColor>
            Animation off
          </Button>
        </Box>
      </Box>
    )
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

claude-plugin/vome-esphome/hooks/register.tsx lines 185–344 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button, Code, Markdown } = $.ui.resolve(e)
    const current = (await $.state.get(build)).value ?? null
    const known = (await $.state.get(devices)).value ?? null
    const refusal = (await $.state.get(blocked)).value ?? null
    const isFxEnabled = (await $.state.get(fxOn)).value ?? true
    const view = (await $.state.get(config)).value ?? null
    const isFullLog = (await $.state.get(showLog)).value ?? false
    const siblingHint =
      !hasSibling && ((await $.state.get(sibling)).value ?? false) ? (
        <Box flexDirection="row" gap={2} marginTop={1}>
          <Text dimColor wrap="wrap">
            Working on automations too? The automation pane shows them, and their runs: <Text color="suggestion">{AUTOMATION_INSTALL}</Text>
          </Text>
          <Button
            key="hide-sibling"
            dimColor
            onPress={async () => {
              await $.store.set('siblingHintOff', true).catch(() => undefined)
              await $.state.set(sibling, false)
            }}
          >
            Hide
          </Button>
        </Box>
      ) : null
    const width = Math.max(20, e.props.bodyColumns)
    const rows = Math.max(6, (e.viewport?.rows ?? 30) - 14)

    const deviceRows = known && known.length > 0 ? (
      <Box flexDirection="column" marginTop={1}>
        <Text bold>Devices</Text>
        {known.map(d => {
          const isBehind = d.deployed !== null && d.current !== null && d.deployed !== d.current
          return (
            <Text wrap="truncate-end">
              <Text color={isBehind ? 'warning' : undefined}>{isBehind ? '↑ ' : '  '}</Text>
              {d.name}
              <Text dimColor>
                {'  '}
                {d.configuration}
                {d.deployed ? `  ${d.deployed}` : ''}
                {isBehind ? ` → ${d.current} available` : ''}
              </Text>
            </Text>
          )
        })}
      </Box>
    ) : null

    // Auto mode refuses a background read nobody asked for unless it is allowed by name.
    const help = refusal ? (
      <Box flexDirection="column" borderStyle="round" borderColor="warning" paddingX={1} marginTop={1}>
        <Text color="warning" wrap="wrap">
          Auto mode refused the pane's read of the build's progress or the device's YAML. Add these to permissions.allow
          in {settingsFile}, then the next build shows live:
        </Text>
        <Markdown text={`[${settingsFile}](file://${settingsFile})`} />
        <Code source={allowLines(refusal.server)} />
        <Box flexDirection="row" gap={2}>
          <Button key="copy-rule" hotkey="c" onPress={press => $.ui.copy({ text: allowLines(refusal.server), surface: press.surface })}>
            Copy the lines
          </Button>
          <Button
            key="retry"
            hotkey="r"
            onPress={async () => {
              // Allowed since? Try the reads again now rather than at the next build.
              await $.state.set(blocked, null)
              isUnsupported = false
              configAsked = null
              const running = (await $.state.get(build)).value ?? null
              if (running && running.command !== 'logs') void loadConfig($, refusal.server, running.configuration)
              void poll($)
            }}
          >
            Retry
          </Button>
        </Box>
      </Box>
    ) : null

    const map = view ? deviceMap($.ui.resolve(e), view) : null
    const isStage = e.surface === 'terminal' && isFxEnabled
    const things = view ? thingsOf(view) : []
    const stage = (state: Omit<ChipState, 'things' | 'hasWifi'>) => {
      if (e.surface !== 'terminal') return null
      const { Raster } = $.ui.resolve(e)
      const columns = Math.min(512, width)
      strip = { columns, state: { ...state, things, hasWifi: !!view?.rows.some(row => row.section === 'Network' && row.label === 'wifi') } }
      return <Raster key="chip" columns={columns} rows={STRIP_ROWS} cells={chipFrame(Date.now(), strip.state, columns)} />
    }

    if (!current) {
      if (!isStage) strip = null
      return (
        <Box flexDirection="column">
          {isStage
            ? stage({
                outcome: 'idle',
                scene: 'idle',
                percent: null,
                words: view ? `${view.name} · ${things.length || 'no'} thing${things.length === 1 ? '' : 's'} attached` : 'dreaming of devices…',
                endedAt: null,
              })
            : null}
          {map ?? (
            <Text dimColor wrap="wrap">
              Nothing building. When Claude reads, edits or builds an ESPHome device, its map shows here, and a build's
              progress as it runs.
            </Text>
          )}
          {deviceRows}
          {help}
          {siblingHint}
        </Box>
      )
    }

    const parsed = progressOf(current.lines, current.command)
    const progress = { ...parsed, uploadPercent: uploadShown(parsed, current) }
    const took = elapsed((current.finishedAt ?? Date.now()) - current.startedAt)
    const verb = { validate: 'Checking', compile: 'Compiling', upload: 'Flashing', logs: 'Logs from' }[current.command] ?? current.command
    const done = { validate: 'Valid', compile: 'Compiled', upload: 'Flashed', logs: 'Read the logs' }[current.command] ?? 'Done'
    const status =
      current.outcome === 'running'
        ? `${phaseWords(progress, current.command)} · ${took}`
        : current.outcome === 'ok'
          ? `✓ ${done} in ${took}`
          : `✗ Failed after ${took}`
    const isUploading = current.outcome === 'running' && progress.uploadPercent !== null
    const isCompiling = current.outcome === 'running' && !isUploading && progress.compilePercent !== null
    const kept = current.lines.filter(line => current.command === 'logs' || kindOf(line) !== 'debug')
    // The latest couple of lines unless asked for all; a failure keeps a few more, where it explains itself.
    const tail = isFullLog || current.command === 'logs' ? kept.slice(-rows) : kept.slice(current.outcome === 'failed' ? -6 : -LOG_LINES)

    // The chip on the bench: a Raster, which only the terminal draws. Not for a logs read.
    let chip = null
    if (isStage) {
      // The scene follows the build, not the command: a flash compiles first, then uploads.
      const isUploadPhase = current.command === 'upload' && (progress.uploadPercent !== null || progress.phase === 'uploading')
      const scene: Scene =
        current.command === 'logs' ? 'logs' : current.command === 'validate' ? 'validate' : isUploadPhase ? 'upload' : 'compile'
      const words =
        current.outcome === 'running'
          ? `${scene === 'upload' ? 'flashing' : scene === 'validate' ? 'checking' : scene === 'logs' ? 'listening to' : 'compiling'} ${current.configuration}${(scene === 'upload' ? progress.uploadPercent : progress.compilePercent) !== null && scene !== 'logs' ? ` · ${scene === 'upload' ? progress.uploadPercent : progress.compilePercent}%` : ''}`
          : current.outcome === 'ok'
            ? `✓ ${current.configuration} ${done.toLowerCase()}`
            : `✗ ${current.configuration} failed`
      chip = stage({
        outcome: current.outcome,
        scene,
        percent: scene === 'upload' ? progress.uploadPercent : progress.compilePercent,
        words,
        endedAt: current.finishedAt,
      })
    } else {
      strip = null
    }
Licence text (MIT)
MIT License

Copyright (c) 2026 Andrew Lyeklint Hancock (Vortitron)

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

env varstool callsremembers

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 780616c7a4f7 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 readEvery module hooks/hooks.json names was read.claude-plugin/vome-esphome/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.4 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo 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 openNetwork 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 drawsThe 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, the same in both
Install lineWhether 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 WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn 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 Vortitron/home-assistant-mcp
/plugin install vome-esphome@vome

This installs the marketplace's latest commit, which may not be the one read here (780616c7a4f7). 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 "vortitron-vome-esphome" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs