From decf18049ff06f582cbdab49dc4bc0f234df97d3 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Tue, 5 May 2026 09:51:21 +0000 Subject: [PATCH] =?UTF-8?q?setup:=20add=20=E2=86=90=20Back=20option=20to?= =?UTF-8?q?=20Signal=20channel=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stacked on #2269 (back-nav scaffolding) plus the Telegram, Slack, and Teams PRs. They share the same scaffolding file from #2269 — they don't compile without it, so they have to stack. Signal had no user-facing prompt before the install kicked off, so there was nothing to attach a Back option to. This adds a brief "Set up Signal" info card (what's about to happen, no new phone number needed) followed by a Continue/Back brightSelect. The card serves double duty — context for the install plus the Back gate. Co-Authored-By: Claude Opus 4.7 (1M context) --- setup/auto.ts | 2 +- setup/channels/signal.ts | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/setup/auto.ts b/setup/auto.ts index 8185b22..91ad83a 100644 --- a/setup/auto.ts +++ b/setup/auto.ts @@ -460,7 +460,7 @@ async function main(): Promise { } else if (channelChoice === 'whatsapp') { result = await runWhatsAppChannel(displayName!); } else if (channelChoice === 'signal') { - await runSignalChannel(displayName!); + result = await runSignalChannel(displayName!); } else if (channelChoice === 'teams') { result = await runTeamsChannel(displayName!); } else if (channelChoice === 'slack') { diff --git a/setup/channels/signal.ts b/setup/channels/signal.ts index 8462a56..498690f 100644 --- a/setup/channels/signal.ts +++ b/setup/channels/signal.ts @@ -33,6 +33,8 @@ import k from 'kleur'; import * as setupLog from '../logs.js'; import { getLaunchdLabel, getSystemdUnit } from '../../src/install-slug.js'; +import { BACK_TO_CHANNEL_SELECTION, type ChannelFlowResult } from '../lib/back-nav.js'; +import { brightSelect } from '../lib/bright-select.js'; import { type Block, type StepResult, @@ -48,7 +50,33 @@ import { accentGreen, fmtDuration, note } from '../lib/theme.js'; const DEFAULT_AGENT_NAME = 'Nano'; -export async function runSignalChannel(displayName: string): Promise { +export async function runSignalChannel(displayName: string): Promise { + note( + [ + "NanoClaw links to Signal as a *secondary* device on your existing", + "phone — no new number needed. Your assistant will send and receive", + "messages as the number on that phone.", + '', + "Here's what's about to happen:", + '', + ' 1. Check that signal-cli is installed (we\'ll guide you if not)', + ' 2. Install the Signal adapter', + ' 3. Show a QR code — scan it from Signal → Settings → Linked Devices', + ' 4. Wire your assistant and send a welcome message', + ].join('\n'), + 'Set up Signal', + ); + + const proceed = ensureAnswer(await brightSelect<'continue' | 'back'>({ + message: 'Ready to set up Signal?', + options: [ + { value: 'continue', label: 'Continue' }, + { value: 'back', label: '← Back to channel selection' }, + ], + initialValue: 'continue', + })); + if (proceed === 'back') return BACK_TO_CHANNEL_SELECTION; + await ensureSignalCli(); const install = await runQuietChild(