fix: wrap clack notes for cleaner boxes
This commit is contained in:
@@ -4,7 +4,6 @@ import {
|
||||
confirm as clackConfirm,
|
||||
intro as clackIntro,
|
||||
multiselect as clackMultiselect,
|
||||
note as clackNote,
|
||||
outro as clackOutro,
|
||||
select as clackSelect,
|
||||
text as clackText,
|
||||
@@ -26,6 +25,7 @@ import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
import { listChatProviders } from "../providers/registry.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import {
|
||||
stylePromptHint,
|
||||
stylePromptMessage,
|
||||
@@ -90,8 +90,6 @@ const intro = (message: string) =>
|
||||
clackIntro(stylePromptTitle(message) ?? message);
|
||||
const outro = (message: string) =>
|
||||
clackOutro(stylePromptTitle(message) ?? message);
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
const text = (params: Parameters<typeof clackText>[0]) =>
|
||||
clackText({
|
||||
...params,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import {
|
||||
buildAuthHealthSummary,
|
||||
DEFAULT_OAUTH_WARN_MS,
|
||||
@@ -14,12 +12,9 @@ import {
|
||||
resolveProfileUnusableUntilForDisplay,
|
||||
} from "../agents/auth-profiles.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import type { DoctorPrompter } from "./doctor-prompter.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
export async function maybeRepairAnthropicOAuthProfileId(
|
||||
cfg: ClawdbotConfig,
|
||||
prompter: DoctorPrompter,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import path from "node:path";
|
||||
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { resolveGatewayPort, resolveIsNixMode } from "../config/paths.js";
|
||||
import { resolveGatewayLaunchAgentLabel } from "../daemon/constants.js";
|
||||
@@ -26,7 +24,7 @@ import {
|
||||
} from "../daemon/service-audit.js";
|
||||
import { buildServiceEnvironment } from "../daemon/service-env.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import {
|
||||
DEFAULT_GATEWAY_DAEMON_RUNTIME,
|
||||
GATEWAY_DAEMON_RUNTIME_OPTIONS,
|
||||
@@ -34,9 +32,6 @@ import {
|
||||
} from "./daemon-runtime.js";
|
||||
import type { DoctorOptions, DoctorPrompter } from "./doctor-prompter.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
function detectGatewayRuntime(
|
||||
programArguments: string[] | undefined,
|
||||
): GatewayDaemonRuntime {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import {
|
||||
CONFIG_PATH_CLAWDBOT,
|
||||
@@ -12,12 +10,9 @@ import {
|
||||
writeConfigFile,
|
||||
} from "../config/config.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
function resolveLegacyConfigPath(env: NodeJS.ProcessEnv): string {
|
||||
const override = env.CLAWDIS_CONFIG_PATH?.trim();
|
||||
if (override) return override;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import {
|
||||
DEFAULT_SANDBOX_BROWSER_IMAGE,
|
||||
DEFAULT_SANDBOX_COMMON_IMAGE,
|
||||
@@ -12,13 +10,10 @@ import {
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { runCommandWithTimeout, runExec } from "../process/exec.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { replaceModernName } from "./doctor-legacy-config.js";
|
||||
import type { DoctorPrompter } from "./doctor-prompter.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
type SandboxScriptInfo = {
|
||||
scriptPath: string;
|
||||
cwd: string;
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { readProviderAllowFromStore } from "../pairing/pairing-store.js";
|
||||
import { readTelegramAllowFromStore } from "../telegram/pairing-store.js";
|
||||
import { resolveTelegramToken } from "../telegram/token.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { normalizeE164 } from "../utils.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
export async function noteSecurityWarnings(cfg: ClawdbotConfig) {
|
||||
const warnings: string[] = [];
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import { resolveDefaultAgentId } from "../agents/agent-scope.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { resolveOAuthDir, resolveStateDir } from "../config/paths.js";
|
||||
@@ -14,10 +12,7 @@ import {
|
||||
resolveSessionTranscriptsDirForAgent,
|
||||
resolveStorePath,
|
||||
} from "../config/sessions.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
import { note } from "../terminal/note.js";
|
||||
|
||||
type DoctorPrompterLike = {
|
||||
confirmSkipInNonInteractive: (params: {
|
||||
|
||||
@@ -3,7 +3,6 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import {
|
||||
intro as clackIntro,
|
||||
note as clackNote,
|
||||
outro as clackOutro,
|
||||
} from "@clack/prompts";
|
||||
import {
|
||||
@@ -41,6 +40,7 @@ import { runCommandWithTimeout } from "../process/exec.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { sleep } from "../utils.js";
|
||||
import {
|
||||
DEFAULT_GATEWAY_DAEMON_RUNTIME,
|
||||
@@ -97,8 +97,6 @@ const intro = (message: string) =>
|
||||
clackIntro(stylePromptTitle(message) ?? message);
|
||||
const outro = (message: string) =>
|
||||
clackOutro(stylePromptTitle(message) ?? message);
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
|
||||
function resolveMode(cfg: ClawdbotConfig): "local" | "remote" {
|
||||
return cfg.gateway?.mode === "remote" ? "remote" : "local";
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
|
||||
import {
|
||||
enableSystemdUserLinger,
|
||||
isSystemdUserServiceAvailable,
|
||||
readSystemdUserLingerStatus,
|
||||
} from "../daemon/systemd.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
|
||||
const note = (message: string, title?: string) =>
|
||||
clackNote(message, stylePromptTitle(title));
|
||||
import { note } from "../terminal/note.js";
|
||||
|
||||
export type LingerPrompter = {
|
||||
confirm?: (params: {
|
||||
|
||||
Reference in New Issue
Block a user