hermes-agent/plugins/platforms/photon/sidecar
峯岸 亮 19c7710174 chore(deps): update protobufjs to 8.7.1
Update root and Photon sidecar npm overrides and lockfile to address protobufjs security advisories.
2026-07-28 22:34:31 -07:00
..
.gitignore fix(photon): surface npm install failures in check_requirements() diagnostic chain 2026-07-28 18:20:06 -07:00
index.mjs fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics 2026-07-28 22:22:42 -07:00
package-lock.json chore(deps): update protobufjs to 8.7.1 2026-07-28 22:34:31 -07:00
package.json chore(deps): update protobufjs to 8.7.1 2026-07-28 22:34:31 -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 feat(photon): support rich link previews 2026-07-28 22:10:57 -07:00
send-format.mjs test(photon): replace source-grep URL-routing tests with behavior tests 2026-07-28 22:22:42 -07:00
stream-staleness.mjs fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics 2026-07-28 22:22:42 -07:00

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 here automatically.

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.