hermes-agent/plugins/platforms/photon/sidecar
Teknium 244759114a
docs(photon): document immutable-install sidecar resolution (setup step + sidecar README)
2026-07-28 22:36:13 -07:00
..
.gitignore fix(photon): surface npm install failures in check_requirements() diagnostic chain 2026-07-28 18:20:06 -07:00
README.md docs(photon): document immutable-install sidecar resolution (setup step + sidecar README) 2026-07-28 22:36:13 -07:00
index.mjs fix(photon): tolerate SDK builds without the iMessage effect surface 2026-07-28 22:10:57 -07:00
package-lock.json fix(photon): upgrade spectrum-ts sidecar to v8.0.0 2026-06-27 00:51:34 -07:00
package.json fix(photon): upgrade spectrum-ts sidecar to v8.0.0 2026-06-27 00:51:34 -07:00
patch-spectrum-mixed-attachments.mjs feat(photon): upgrade spectrum-ts sidecar to v7.0.0 2026-06-27 00:51:34 -07:00

README.md

Photon sidecar

Small Node helper that bridges Hermes Agent to Photon's Spectrum SDK (spectrum-ts). Hermes is Python; Photon has no public HTTP send-message endpoint today; replies therefore go through this sidecar.

The sidecar:

  • runs Spectrum({ projectId, projectSecret, providers: [imessage.config()] })
  • exposes a loopback-only HTTP control channel for the Python adapter to push send/typing requests (auth via X-Hermes-Sidecar-Token)
  • drains the inbound message stream so spectrum-ts keeps its reconnect/heartbeat machinery alive and Hermes can receive inbound messages over the adapter's loopback GET /inbound stream

Install

cd plugins/platforms/photon/sidecar
npm install

The Hermes plugin's hermes photon setup command runs npm install automatically. When the plugin directory is read-only (Docker/Podman images, immutable install trees), deps resolve through sidecar_paths.resolve_sidecar_dir(): an explicit PHOTON_SIDECAR_DIR override → writable-in-place → a baked image copy → a mirror under ~/.hermes/photon/sidecar (created and installed on demand).

Run standalone

For debugging:

PHOTON_PROJECT_ID=... PHOTON_PROJECT_SECRET=... \
PHOTON_SIDECAR_PORT=8789 PHOTON_SIDECAR_TOKEN=$(openssl rand -hex 16) \
node index.mjs

In normal use, the Python adapter supervises this process — start, restart on crash, kill on shutdown — and never asks the user to run it by hand.

Why a sidecar at all?

Photon's Spectrum send path is exposed through the TypeScript SDK's Space.send(...) API. Hermes is Python, so replies go through this sidecar until Photon ships a public HTTP send endpoint.

When Photon ships an HTTP send endpoint, the plan is to retire this sidecar entirely and call it directly from Python. The plugin's outbound code path is already isolated behind small helpers (_sidecar_send, _sidecar_send_richlink, and _sidecar_send_attachment in adapter.py) to make that swap localized.