feat(connections): Signal channel via signal-cli (device-link pairing + send-only)#12
Merged
Conversation
…elivery
Pipeline-facing seam so a running pipeline can push a notification to the user
out a connected channel — the outbound complement to the inbound chatbot flow.
- PipelineContext.notify(text, opts?) gated by NETWORK_FETCH; NotifyFn injected
via BuildContextDeps + SchedulerOptions where `complete` is threaded
(top-level + sub-agent). Core stays decoupled (channel: string, not ChannelId).
- Graceful: missing channel/destination/resolver -> {delivered:false,reason};
only a capability violation throws.
- Host makeNotifyFn (CLI) resolves channel + pairing-persisted owner chatId,
sends through the daemon's running handler, audits each send on events
(notification_sent/notification_failed; body + chat id never logged).
- config.notify.defaultChannel normalization; no migration, no new capability,
no new dependency.
890 tests / 0 fail (+20); 100% line+func coverage on new units; Biome clean.
… + send-only) Completes the channel set with Signal, the last deferred channel. signal-cli is an external binary (no SDK), so Signal is a core handler on the existing ProcessRunner seam — zero new dependencies. - SignalHandler (ChannelHandler + Pairable): send via per-call `signal-cli send` (NETWORK_FETCH asserted; subprocess egress, allowlist N/A for local-cli), no-op receive (send-only v1), self-driving device-link QR pairing. - SignalCli seam: probe/send over the batch ProcessRunner; link over a streaming Bun.spawn (URI prints before exit). Parsing + line-merge pure + unit-tested. - Pairing persists the linked number to the vault + emits it as chatId, so a paired Signal is a ctx.notify target. Reuses the whatsapp-web self-driving coordinator branch unchanged. - Plugin + catalog ready; ConnectionErrorReason gains not_installed. - No new dependency, no migration, no Capability-union change. 916 tests / 0 fail (+26); signal.ts 100% / signal-cli.ts 86% coverage; Biome clean.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Signal was the one channel from the connections umbrella still unbuilt — a catalog entry + tutorial only. It is the most privacy-aligned channel and the natural target for the proactive
ctx.notifyshipped in #11: a pipeline result lands in the user's own Signal. Unlike Telegram/Discord (hosted bot APIs) and WhatsApp-Web (a bundled library), Signal has no hosted API and no npm SDK — it is reached through the localsignal-clibinary, exactly the bring-your-own-binary model Vesper already uses for the LLM CLIs. So Signal is a core handler with zero new dependencies.This is the disciplined first increment — device-link pairing + send-only — mirroring how WhatsApp shipped (no-op
receive). Inbound receive is deferred.What changed
SignalHandler(connections/signal.ts,ChannelHandler+Pairable):sendvia per-callsignal-cli send(assertsNETWORK_FETCH; subprocess egress, so the host-allowlist is N/A for thislocal-clitransport);receiveis a no-opStoppable(send-only v1);startPairingis self-driving device-link QR.SignalCliseam (connections/signal-cli.ts):probe/sendride the batchProcessRunner;linkrides a streamingBun.spawn(thesgnl://linkdeviceURI prints while the process blocks awaiting a scan). Parsing (parseSignalLinkLine) and line handling (streamLines/mergeStreamLines/linkEventsFromLines) are pure and unit-tested — the suite spawns nothing.signal_account) and emits it as thechatId, so the coordinator records it asparams.defaultChatId→ a paired Signal is actx.notifytarget (Note to Self). Reuses the whatsapp-web self-driving coordinator branch (pairingNeedsInbound:false) unchanged.status: ready;ConnectionErrorReasongainsnot_installed(honest "install signal-cli" reason).No new npm dependency, no migration, no Capability-union change, no
PairingCoordinatorchange.Test plan
bun test— 916 pass / 0 fail (+26).signal.ts100%,signal-cli.ts86% (uncovered = theBun.spawnglue, likerunProcess).bun run lint(Biome) — clean.tsc --noEmit— 0 new errors.Associated with:line format are signal-cli-version-dependent — the main unverified risk; isolated behind the seam.Issue-capped workspace: the record is
specs/signal-channel.md(local) + thecycle-log.mdentry + this PR (Rule 11 fallback).Follow-ups
signal-cli daemon --httpJSON-RPC transport; egress would then rideallowlistedFetchto 127.0.0.1).