mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-04 10:14:47 +08:00
setup: add ← Back option to Signal channel flow
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) <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -460,7 +460,7 @@ async function main(): Promise<void> {
|
||||
} 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') {
|
||||
|
||||
@@ -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<void> {
|
||||
export async function runSignalChannel(displayName: string): Promise<ChannelFlowResult> {
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user