Skip to content

Hardcoded Channels: Refactor out to configuration #109

@dagelf

Description

@dagelf

What’s required to add a new channel today

  1. Implement a new channel client (queue in/out + attachments) modeled on existing ones in src/channels/discord-client.ts, src/channels/telegram-client.ts, src/channels/whatsapp-client.ts.
  2. Wire it into scripts and orchestration:
    • Add it to ALL_CHANNELS and config maps in lib/common.sh.
    • Add to setup flow in lib/setup-wizard.sh (name, token prompts, settings JSON).
    • Add to daemon pane routing in lib/daemon.sh.
    • Add to logging/reset helpers in lib/messaging.sh.
  3. Extend settings types in src/lib/types.ts to include the new channel config.
  4. Add a package.json script to run it (like the existing channel scripts).

Flow

  1. Hard‑coded channel registry in shell scripts (lib/common.sh, lib/setup-wizard.sh, lib/daemon.sh) keeps setup/ops simple and deterministic.
  2. Channel clients are independent entrypoints (src/channels/discord-client.ts, src/channels/telegram-client.ts, src/channels/whatsapp-client.ts) with their own auth flows.
  3. Queue processor is channel‑agnostic (src/queue-processor.ts), so channels are “edge adapters” around a stable core.

Plan

  1. Introduce a channel plugin interface (e.g., a manifest + entrypoint) and a registry loader that reads a channels/ directory or config/channels.json.
  2. Replace ALL_CHANNELS and per‑channel maps in shell scripts with dynamic enumeration of installed/enabled channels.
  3. Update setup to ask per‑channel questions from manifest metadata instead of fixed prompts in lib/setup-wizard.sh.
  4. Adjust typings so settings.channels is a map keyed by channel id rather than fixed properties in src/lib/types.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions