@getpaseo/cli 0.2.0-beta.3 → 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
|
-
|
|
74
|
-
|
|
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
|
package/dist/commands/onboard.js
CHANGED
|
@@ -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
|
-
|
|
410
|
-
|
|
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,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
|
|
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
|
|
31
|
-
"@getpaseo/protocol": "0.2.0
|
|
32
|
-
"@getpaseo/server": "0.2.0
|
|
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",
|