diff --git a/cli/package.json b/cli/package.json index 9be7fa2c04..77ce5f6dbc 100644 --- a/cli/package.json +++ b/cli/package.json @@ -36,7 +36,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@clack/prompts": "^0.11.0", + "@clack/prompts": "^1.7.0", "@paperclipai/adapter-claude-local": "workspace:*", "@paperclipai/adapter-codex-local": "workspace:*", "@paperclipai/adapter-cursor-cloud": "workspace:*", diff --git a/cli/src/__tests__/env-lab.test.ts b/cli/src/__tests__/env-lab.test.ts index 6afa22660b..144311a351 100644 --- a/cli/src/__tests__/env-lab.test.ts +++ b/cli/src/__tests__/env-lab.test.ts @@ -246,8 +246,8 @@ describe("env-lab doctor cleanup hint instance", () => { // `p.log`, so the test replaces each channel and reads the captured lines. function captureDoctorMessages(): string[] { const messages: string[] = []; - vi.spyOn(p.log, "message").mockImplementation((message?: string) => { - messages.push(message ?? ""); + vi.spyOn(p.log, "message").mockImplementation((message?: string | string[]) => { + messages.push(Array.isArray(message) ? message.join("\n") : (message ?? "")); }); vi.spyOn(p.log, "success").mockImplementation(() => {}); vi.spyOn(p.log, "warn").mockImplementation(() => {}); diff --git a/cli/src/prompts/server.ts b/cli/src/prompts/server.ts index 404d4ea575..bff9e18072 100644 --- a/cli/src/prompts/server.ts +++ b/cli/src/prompts/server.ts @@ -84,7 +84,7 @@ export async function promptServer(opts?: { : "dotta-macbook-pro, host.docker.internal", validate: (val) => { try { - parseHostnameCsv(val); + parseHostnameCsv(val ?? ""); return; } catch (err) { return err instanceof Error ? err.message : "Invalid hostname list"; @@ -156,7 +156,7 @@ export async function promptServer(opts?: { defaultValue: defaultHost, placeholder: defaultHost, validate: (val) => { - if (!val.trim()) return "Host is required"; + if (!val || !val.trim()) return "Host is required"; if (deploymentMode === "local_trusted" && !isLoopbackHost(val.trim())) { return "Local trusted mode requires a loopback host such as 127.0.0.1"; } @@ -173,7 +173,7 @@ export async function promptServer(opts?: { placeholder: "dotta-macbook-pro, your-host.tailnet.ts.net", validate: (val) => { try { - parseHostnameCsv(val); + parseHostnameCsv(val ?? ""); return; } catch (err) { return err instanceof Error ? err.message : "Invalid hostname list"; @@ -192,7 +192,7 @@ export async function promptServer(opts?: { defaultValue: currentAuth?.publicBaseUrl ?? "", placeholder: "https://paperclip.example.com", validate: (val) => { - const candidate = val.trim(); + const candidate = val?.trim() ?? ""; if (!candidate) return "Public base URL is required for public exposure"; try { const url = new URL(candidate); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62115b057f..bc73d4d114 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,8 +50,8 @@ importers: cli: dependencies: '@clack/prompts': - specifier: ^0.11.0 - version: 0.11.0 + specifier: ^1.7.0 + version: 1.7.0 '@paperclipai/adapter-claude-local': specifier: workspace:* version: link:../packages/adapters/claude-local @@ -1578,16 +1578,10 @@ packages: '@chevrotain/types@11.1.2': resolution: {integrity: sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==} - '@clack/core@0.5.0': - resolution: {integrity: sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow==} - '@clack/core@1.4.3': resolution: {integrity: sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==} engines: {node: '>= 20.12.0'} - '@clack/prompts@0.11.0': - resolution: {integrity: sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw==} - '@clack/prompts@1.7.0': resolution: {integrity: sha512-y7/yvZ2TPAnR9+jnc00klvNNLkJiXFFrQA/hlLCcxA9a2A4zQIOimyFQ9XfwYKiGD1fb5GY8vbKIIgO8d5Tb2A==} engines: {node: '>= 20.12.0'} @@ -9791,22 +9785,11 @@ snapshots: '@chevrotain/types@11.1.2': {} - '@clack/core@0.5.0': - dependencies: - picocolors: 1.1.1 - sisteransi: 1.0.5 - '@clack/core@1.4.3': dependencies: fast-wrap-ansi: 0.2.2 sisteransi: 1.0.5 - '@clack/prompts@0.11.0': - dependencies: - '@clack/core': 0.5.0 - picocolors: 1.1.1 - sisteransi: 1.0.5 - '@clack/prompts@1.7.0': dependencies: '@clack/core': 1.4.3