@getpaseo/cli 0.2.0-beta.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import { generateLocalPairingOffer, loadConfig, resolvePaseoHome } from "@getpas
4
4
  import { tryConnectToDaemon } from "../../utils/client.js";
5
5
  import { resolveLocalDaemonState, resolveTcpHostFromListen } from "./local-daemon.js";
6
6
  import { addJsonOption } from "../../utils/command-options.js";
7
+ import { formatPairingInstructions } from "../../output/pairing.js";
7
8
  const PAIRING_DAEMON_RPC_TIMEOUT_MS = 1500;
8
9
  export function pairCommand() {
9
10
  return addJsonOption(new Command("pair").description("Print the daemon pairing QR code and link"))
@@ -70,7 +71,10 @@ function outputPairingResult(pairing, options) {
70
71
  }, null, 2)}\n`);
71
72
  return;
72
73
  }
73
- const qrBlock = pairing.qr ? `${pairing.qr}\n` : "";
74
- process.stdout.write(`\nScan to pair:\n${qrBlock}${pairing.url}\n`);
74
+ process.stdout.write(formatPairingInstructions({
75
+ url: pairing.url,
76
+ qr: pairing.qr,
77
+ columns: process.stdout.columns,
78
+ }));
75
79
  }
76
80
  //# sourceMappingURL=pair.js.map
@@ -5,6 +5,7 @@ import path from "node:path";
5
5
  import { generateLocalPairingOffer, loadConfig, loadPersistedConfig, } from "@getpaseo/server";
6
6
  import { resolveLocalPaseoHome, resolveLocalDaemonState, resolveTcpHostFromListen, startLocalDaemonDetached, tailDaemonLog, } from "./daemon/local-daemon.js";
7
7
  import { tryConnectToDaemon } from "../utils/client.js";
8
+ import { formatPairingInstructions } from "../output/pairing.js";
8
9
  const DEFAULT_READY_TIMEOUT_MS = 10 * 60 * 1000;
9
10
  const READY_PROBE_TIMEOUT_MS = 1200;
10
11
  class OnboardCancelledError extends Error {
@@ -406,8 +407,11 @@ export async function runOnboard(options) {
406
407
  }
407
408
  return;
408
409
  }
409
- renderNote(pairing.qr ?? "QR is unavailable in this terminal. Use the pairing link below.", "Scan to pair");
410
- renderNote(pairing.url, "Pairing link");
410
+ process.stdout.write(formatPairingInstructions({
411
+ url: pairing.url,
412
+ qr: pairing.qr,
413
+ columns: process.stdout.columns,
414
+ }));
411
415
  printNextSteps(pairing.url, paseoHome, richUi);
412
416
  if (richUi) {
413
417
  outro("Paseo is ready!");
@@ -0,0 +1,8 @@
1
+ interface PairingInstructions {
2
+ url: string;
3
+ qr: string | null;
4
+ columns?: number;
5
+ }
6
+ export declare function formatPairingInstructions({ url, qr, columns }: PairingInstructions): string;
7
+ export {};
8
+ //# sourceMappingURL=pairing.d.ts.map
@@ -0,0 +1,24 @@
1
+ const ANSI_PATTERN = new RegExp(`${String.fromCharCode(0x1b)}\\[[0-9;]*m`, "g");
2
+ function visibleWidth(value) {
3
+ return Math.max(...value
4
+ .replace(ANSI_PATTERN, "")
5
+ .split("\n")
6
+ .map((line) => line.length));
7
+ }
8
+ function formatQr(qr, columns) {
9
+ if (!qr) {
10
+ return "QR code is unavailable. Use the pairing link below.";
11
+ }
12
+ if (columns === undefined) {
13
+ return "QR code not shown because terminal width could not be detected.";
14
+ }
15
+ const width = visibleWidth(qr);
16
+ if (columns <= width) {
17
+ return `QR code not shown. Resize the terminal to at least ${width + 1} columns, then run this command again.`;
18
+ }
19
+ return qr;
20
+ }
21
+ export function formatPairingInstructions({ url, qr, columns }) {
22
+ return `\nScan to pair:\n${formatQr(qr, columns)}\n\nPairing link:\n${url}\n`;
23
+ }
24
+ //# sourceMappingURL=pairing.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/cli",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0",
4
4
  "description": "Paseo CLI - control your AI coding agents from the command line",
5
5
  "bin": {
6
6
  "paseo": "bin/paseo"
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@clack/prompts": "^1.0.0",
30
- "@getpaseo/client": "0.2.0-beta.4",
31
- "@getpaseo/protocol": "0.2.0-beta.4",
32
- "@getpaseo/server": "0.2.0-beta.4",
30
+ "@getpaseo/client": "0.2.0",
31
+ "@getpaseo/protocol": "0.2.0",
32
+ "@getpaseo/server": "0.2.0",
33
33
  "chalk": "^5.3.0",
34
34
  "commander": "^12.0.0",
35
35
  "mime-types": "^2.1.35",