Files
paperclip/cli/src/prompts/server.ts
T
Forgotten 8c2bf0a2e6 Remove contextMode, consolidate wake policies, and default serveUi to true
Drop the unused contextMode field from the agent schema, shared types, validators,
and all UI references. Merge wakeOnOnDemand and wakeOnAutomation into a single
wakeOnDemand toggle. Default serveUi to true and remove the onboarding prompt for it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 16:46:29 -06:00

25 lines
635 B
TypeScript

import * as p from "@clack/prompts";
import type { ServerConfig } from "../config/schema.js";
export async function promptServer(): Promise<ServerConfig> {
const portStr = await p.text({
message: "Server port",
defaultValue: "3100",
placeholder: "3100",
validate: (val) => {
const n = Number(val);
if (isNaN(n) || n < 1 || n > 65535 || !Number.isInteger(n)) {
return "Must be an integer between 1 and 65535";
}
},
});
if (p.isCancel(portStr)) {
p.cancel("Setup cancelled.");
process.exit(0);
}
const port = Number(portStr) || 3100;
return { port, serveUi: true };
}