forked from farhoodlabs/paperclip
8c2bf0a2e6
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>
25 lines
635 B
TypeScript
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 };
|
|
}
|