@clawapps/cli 0.6.1 → 0.6.2
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
1
2
|
import { createLoginCode } from '../lib/login-service.js';
|
|
2
3
|
/**
|
|
3
4
|
* Create a login code and QR image. Returns immediately (non-blocking).
|
|
5
|
+
* Outputs JSON metadata + QR code text to stdout.
|
|
4
6
|
* Designed for AI agent integration.
|
|
5
7
|
*/
|
|
6
8
|
export async function loginCodeCommand() {
|
|
@@ -10,11 +12,11 @@ export async function loginCodeCommand() {
|
|
|
10
12
|
code: result.code,
|
|
11
13
|
url: result.qr_url,
|
|
12
14
|
qr_image: result.qr_image,
|
|
13
|
-
qr_text: result.qr_text,
|
|
14
15
|
expires_at: result.expires_at,
|
|
15
16
|
next: `clawapps login-poll ${result.code}`,
|
|
16
|
-
instructions: 'Read qr_text file to display QR code to user. Then run the next command to wait for verification.',
|
|
17
17
|
}) + '\n');
|
|
18
|
+
// Print QR text directly so agent sees it in stdout
|
|
19
|
+
process.stdout.write(readFileSync(result.qr_text, 'utf-8'));
|
|
18
20
|
}
|
|
19
21
|
catch (err) {
|
|
20
22
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-code.js","sourceRoot":"","sources":["../../src/commands/login-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"login-code.js","sourceRoot":"","sources":["../../src/commands/login-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;YAClC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,GAAG,EAAE,MAAM,CAAC,MAAM;YAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,IAAI,EAAE,uBAAuB,MAAM,CAAC,IAAI,EAAE;SAC3C,CAAC,GAAG,IAAI,CAAC,CAAC;QACX,oDAAoD;QACpD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|