@mycadet/cli 0.13.0-dev.202611141959.760a53b → 0.13.0-dev.202611142107.f5e00a2
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.
- package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/shared/package.json +1 -1
- package/node_modules/@mycadet/local-mode/package.json +1 -1
- package/node_modules/@mycadet/local-mode/src/__tests__/upgrade-root-recovery.test.ts +1 -1
- package/node_modules/@mycadet/local-mode/src/index.ts +1 -0
- package/node_modules/@mycadet/local-mode/src/operations/pair.ts +2 -1
- package/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/shared/package.json +1 -1
- package/package.json +1 -1
- package/src/commands/pair.ts +7 -6
|
@@ -130,7 +130,7 @@ test("versioned restore installs roots into stopped target containers before fir
|
|
|
130
130
|
await mockChildProcessSpawn((command, args) => {
|
|
131
131
|
if (command === "docker" && args[0] === "inspect") {
|
|
132
132
|
return {
|
|
133
|
-
stdout: JSON.stringify(["
|
|
133
|
+
stdout: JSON.stringify(["PATH=/usr/local/bin:/usr/bin"]),
|
|
134
134
|
code: 0,
|
|
135
135
|
pid: 4242,
|
|
136
136
|
unref: () => {},
|
|
@@ -23,7 +23,8 @@ export interface PairDeviceIdentity {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The gateway CLI prints the pair payload as single-line JSON; its last
|
|
26
|
-
* stdout line is the answer (earlier lines may carry warnings).
|
|
26
|
+
* stdout line is the answer (earlier lines may carry warnings). The CLI
|
|
27
|
+
* itself runs with pino silenced, so the payload line is reliably last.
|
|
27
28
|
*/
|
|
28
29
|
export function pairCliStdoutToResult(stdout: string): PairOperationResult {
|
|
29
30
|
const lastLine = stdout.split("\n").filter(Boolean).pop() ?? "";
|
package/package.json
CHANGED
package/src/commands/pair.ts
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
getAssistantDisplayName,
|
|
37
37
|
lookupAssistantByIdentifier,
|
|
38
38
|
loopbackSafeFetch,
|
|
39
|
+
pairCliStdoutToResult,
|
|
39
40
|
pairDocker,
|
|
40
41
|
pairLocal,
|
|
41
42
|
} from "@mycadet/local-mode";
|
|
@@ -201,18 +202,18 @@ async function mintPairingChallengeOrExit(
|
|
|
201
202
|
return parseMintedChallenge(stdout);
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
/** Parse the mint's
|
|
205
|
+
/** Parse the mint's JSON stdout line into the challenge response. */
|
|
205
206
|
function parseMintedChallenge(
|
|
206
207
|
stdout: string,
|
|
207
208
|
): RemoteWebPairingChallengeResponse {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
} catch {
|
|
209
|
+
// Same last-line JSON contract the guardian lease's pair door uses — the
|
|
210
|
+
// CLI runs with pino silenced, so the payload line is reliably last.
|
|
211
|
+
const parsed = pairCliStdoutToResult(stdout);
|
|
212
|
+
if (!parsed.ok) {
|
|
213
213
|
console.error("Error: could not parse the gateway's pairing mint output.");
|
|
214
214
|
process.exit(1);
|
|
215
215
|
}
|
|
216
|
+
const challenge = parsed.response as RemoteWebPairingChallengeResponse;
|
|
216
217
|
if (!challenge.deviceCode || !challenge.userCode) {
|
|
217
218
|
console.error(
|
|
218
219
|
"Error: the gateway's pairing mint output is missing the challenge codes.",
|