mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
Make Photon iMessage a first-class persistent-connection channel like Discord/Slack, using the spectrum-ts gRPC stream for both directions. - Inbound: the sidecar forwards the SDK's app.messages gRPC stream to the adapter over a loopback GET /inbound (NDJSON) instead of webhooks. Drops the aiohttp webhook server, HMAC signature verification, public URL, and PHOTON_WEBHOOK_* config; adapter reconnects with backoff. - Management plane: device login uses client_id=photon-cli against the single dashboard host (Bearer), matching the official photon-hq/cli; find-or-create "Hermes Agent" project, enable Spectrum, rotate secret, register user (with phone dedup), surface the assigned iMessage line. - SDK projectId is the project's spectrumProjectId, not the dashboard id; runtime creds persist to ~/.hermes/.env like every other channel. - CLI: 6-step setup, webhook subcommands removed. - Tests/docs updated for the gRPC flow; sidecar pins spectrum-ts ^1.17.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72 lines
3.2 KiB
YAML
72 lines
3.2 KiB
YAML
name: photon-platform
|
|
label: Photon iMessage
|
|
kind: platform
|
|
version: 0.2.0
|
|
description: >
|
|
Photon Spectrum gateway adapter for Hermes Agent.
|
|
Connects to iMessage (and other Spectrum interfaces) through Photon's
|
|
managed Spectrum platform. Both directions run over the `spectrum-ts`
|
|
SDK's long-lived gRPC stream via a small supervised Node sidecar —
|
|
inbound messages arrive on the SDK's `app.messages` stream (no webhook,
|
|
no public URL, no signing secret), and outbound messages are sent over
|
|
the same sidecar.
|
|
|
|
The plugin ships with a `hermes photon` CLI for the one-time device
|
|
login + project + user setup. Runtime credentials are written to
|
|
``~/.hermes/.env`` (``PHOTON_PROJECT_ID`` = the Spectrum project id,
|
|
``PHOTON_PROJECT_SECRET``) like every other channel, with management
|
|
metadata (device token, dashboard project id) in ``~/.hermes/auth.json``.
|
|
Photon's free shared-line model lets users get started without a paid plan.
|
|
author: NousResearch
|
|
requires_env:
|
|
- name: PHOTON_PROJECT_ID
|
|
description: "Spectrum project id (the project's spectrumProjectId; set by `hermes photon setup`)"
|
|
prompt: "Photon Spectrum project id"
|
|
url: "https://app.photon.codes/"
|
|
password: false
|
|
- name: PHOTON_PROJECT_SECRET
|
|
description: "Project secret paired with the Spectrum project id (set by `hermes photon setup`)"
|
|
prompt: "Photon project secret"
|
|
url: "https://app.photon.codes/"
|
|
password: true
|
|
optional_env:
|
|
- name: PHOTON_SIDECAR_PORT
|
|
description: "Loopback port for the Node sidecar control + inbound channel (default 8789)"
|
|
prompt: "Sidecar control port"
|
|
password: false
|
|
- name: PHOTON_SIDECAR_AUTOSTART
|
|
description: "Spawn the Node sidecar on connect (true/false, default true)"
|
|
prompt: "Auto-start the sidecar?"
|
|
password: false
|
|
- name: PHOTON_NODE_BIN
|
|
description: "Path to the node binary (default: shutil.which('node'))"
|
|
prompt: "Node executable path"
|
|
password: false
|
|
- name: PHOTON_DASHBOARD_HOST
|
|
description: "Photon Dashboard API host (default https://app.photon.codes)"
|
|
prompt: "Dashboard host"
|
|
password: false
|
|
- name: PHOTON_ALLOWED_USERS
|
|
description: "Comma-separated E.164 phone numbers allowed to talk to the bot"
|
|
prompt: "Allowed users (comma-separated)"
|
|
password: false
|
|
- name: PHOTON_ALLOW_ALL_USERS
|
|
description: "Allow any sender to trigger the bot (dev only — disables allowlist)"
|
|
prompt: "Allow all users? (true/false)"
|
|
password: false
|
|
- name: PHOTON_REQUIRE_MENTION
|
|
description: "Ignore group-chat messages unless they match a mention wake word (true/false, default false)"
|
|
prompt: "Require a mention in group chats?"
|
|
password: false
|
|
- name: PHOTON_MENTION_PATTERNS
|
|
description: "Mention wake-word regexes for group chats (JSON list or comma/newline-separated; defaults to Hermes wake words)"
|
|
prompt: "Group mention patterns"
|
|
password: false
|
|
- name: PHOTON_HOME_CHANNEL
|
|
description: "Default Spectrum space id for cron / notification delivery"
|
|
prompt: "Home space id"
|
|
password: false
|
|
- name: PHOTON_HOME_CHANNEL_NAME
|
|
description: "Human label for the home channel"
|
|
prompt: "Home channel display name"
|
|
password: false
|