Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencode-sidepulse",
"version": "0.1.6",
"version": "0.1.7",
"description": "Show opencode agent status on a SidePulse Pro or SidePulse Dot LED device.",
"keywords": [
"opencode",
Expand Down
14 changes: 11 additions & 3 deletions plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ const PROGRAMS = {
done: "#00ff22 0.6s cosine\n",
}

// Volume names differ by model (SidePulse, SidePulsePro, SidePulseDot), so match the
// prefix and confirm the control file exists.
// Volume names differ by model (SidePulse, SidePulsePro, PulseDot), so match the prefix
// and confirm the control file exists. The Dot is FAT12, and its 11-character label limit
// rules out "SidePulseDot".
const VOLUME = /^(sidepulse|pulsedot)/i

function mount() {
try {
for (const name of readdirSync("/Volumes")) {
const dir = join("/Volumes", name)
if (/^sidepulse/i.test(name) && existsSync(join(dir, "LEDS.LED"))) return dir
if (VOLUME.test(name) && existsSync(join(dir, "LEDS.LED"))) return dir
}
} catch {}
return undefined
Expand Down Expand Up @@ -383,6 +386,11 @@ if (selfCheck) {
}
}

for (const name of ["SidePulse", "SidePulsePro", "PulseDot"]) {
if (!VOLUME.test(name)) throw new Error(`volume ${name} does not match ${VOLUME}`)
}
if (VOLUME.test("Macintosh HD")) throw new Error(`volume Macintosh HD matches ${VOLUME}`)

console.log(`ok: ${Object.keys(PROGRAMS).length} programs, ${want.length} transitions`)
console.log(` device ${mount() ?? "not mounted"}`)
console.log(` app socket ${socket() ?? "absent, using direct mode"}`)
Expand Down
Loading