@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/avatar-manifest",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/ipc-server-utils",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/avatar-manifest",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/ipc-server-utils",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/shared",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "exports": {
6
6
  ".": "./index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/local-mode",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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(["ACTOR_TOKEN_SIGNING_KEY=" + "01".repeat(32)]),
133
+ stdout: JSON.stringify(["PATH=/usr/local/bin:/usr/bin"]),
134
134
  code: 0,
135
135
  pid: 4242,
136
136
  unref: () => {},
@@ -194,6 +194,7 @@ export {
194
194
 
195
195
  export { loopbackSafeFetch, isLoopbackUrl } from "./loopback-fetch";
196
196
  export {
197
+ pairCliStdoutToResult,
197
198
  pairDevice,
198
199
  type PairDeviceIdentity,
199
200
  type PairOperationResult,
@@ -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() ?? "";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/service-contracts",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/shared",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "private": true,
5
5
  "exports": {
6
6
  ".": "./index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mycadet/cli",
3
- "version": "0.13.0-dev.202611141959.760a53b",
3
+ "version": "0.13.0-dev.202611142107.f5e00a2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vargasjr-dev/mycadet-temp.git"
@@ -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 last stdout line into the challenge response. */
205
+ /** Parse the mint's JSON stdout line into the challenge response. */
205
206
  function parseMintedChallenge(
206
207
  stdout: string,
207
208
  ): RemoteWebPairingChallengeResponse {
208
- const lastLine = stdout.split("\n").filter(Boolean).pop() ?? "";
209
- let challenge: RemoteWebPairingChallengeResponse;
210
- try {
211
- challenge = JSON.parse(lastLine) as RemoteWebPairingChallengeResponse;
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.",