@soyeht/soyeht 0.2.4 → 0.2.6

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.
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "name": "Soyeht",
7
7
  "description": "Channel plugin for the Soyeht Flutter mobile app",
8
- "version": "0.2.4",
8
+ "version": "0.2.6",
9
9
  "configSchema": {
10
10
  "type": "object",
11
11
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyeht/soyeht",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "OpenClaw channel plugin for the Soyeht Flutter mobile app",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/qr.ts CHANGED
@@ -426,11 +426,19 @@ export function renderQrTerminal(text: string): string | null {
426
426
  }
427
427
 
428
428
  // ▄ (lower half block): foreground = lower half, background = upper half
429
+ // Use 24-bit true color (ESC[48;2;R;G;Bm) for pure black/white contrast.
430
+ // Generic ANSI colors (40/47) map to theme colors which may not be pure B&W.
431
+ const BG_BLACK = "\x1b[48;2;0;0;0m";
432
+ const BG_WHITE = "\x1b[48;2;255;255;255m";
433
+ const FG_BLACK = "\x1b[38;2;0;0;0m";
434
+ const FG_WHITE = "\x1b[38;2;255;255;255m";
435
+ const RST = "\x1b[0m";
436
+
429
437
  function cell(top: number, bottom: number): string {
430
- if (top === 1 && bottom === 1) return "\x1b[40m \x1b[0m"; // both black
431
- if (top === 0 && bottom === 0) return "\x1b[47m \x1b[0m"; // both white
432
- if (top === 1 && bottom === 0) return "\x1b[37;40m\u2584\x1b[0m"; // top black, bottom white
433
- return "\x1b[30;47m\u2584\x1b[0m"; // top white, bottom black
438
+ if (top === 1 && bottom === 1) return `${BG_BLACK} ${RST}`;
439
+ if (top === 0 && bottom === 0) return `${BG_WHITE} ${RST}`;
440
+ if (top === 1 && bottom === 0) return `${FG_WHITE}${BG_BLACK}\u2584${RST}`;
441
+ return `${FG_BLACK}${BG_WHITE}\u2584${RST}`;
434
442
  }
435
443
 
436
444
  const lines: string[] = [];
package/src/service.ts CHANGED
@@ -139,19 +139,23 @@ async function showPairingQr(api: OpenClawPluginApi, v2deps: SecurityV2Deps): Pr
139
139
  });
140
140
 
141
141
  // Compact QR: soyeht://pair?g=<gatewayUrl>&t=<token>&fp=<fingerprint>
142
- // App fetches full key material via RPC soyeht.security.pairing.info
143
- const qrText = `soyeht://pair?g=${encodeURIComponent(gatewayUrl)}&t=${pairingToken}&fp=${fingerprint}`;
142
+ // No encodeURIComponent custom scheme, no escaping needed.
143
+ // App fetches full key material via HTTP GET /soyeht/pairing/info
144
+ const qrText = `soyeht://pair?g=${gatewayUrl}&t=${pairingToken}&fp=${fingerprint}`;
144
145
  const rendered = renderQrTerminal(qrText);
145
146
 
146
147
  if (rendered) {
147
148
  // Write QR directly to stdout to avoid logger prefixes breaking ANSI escape codes
148
149
  process.stdout.write("\n" + rendered + "\n\n");
149
- api.logger.info(`[soyeht] Scan the QR code above with the Soyeht app to pair`);
150
- api.logger.info(`[soyeht] Fingerprint: ${fingerprint}`);
151
- api.logger.info(`[soyeht] QR expires in ${AUTO_PAIRING_TTL_MS / 1000}s — restart plugin to generate a new one`);
150
+ api.logger.info(`[soyeht] Scan the QR code above with the Soyeht app`);
152
151
  } else {
153
- api.logger.warn("[soyeht] QR code too large for terminal rendering. Use RPC soyeht.security.pairing.start instead.");
152
+ api.logger.warn("[soyeht] QR code too large for terminal rendering.");
154
153
  }
154
+
155
+ // Always log the pairing URL as fallback — user can copy-paste into the app
156
+ api.logger.info(`[soyeht] If QR doesn't scan, copy the line below and paste in the app:`);
157
+ process.stdout.write("\n" + qrText + "\n\n");
158
+ api.logger.info(`[soyeht] Expires in ${AUTO_PAIRING_TTL_MS / 1000}s — restart plugin to generate a new one`);
155
159
  }
156
160
 
157
161
  // ---------------------------------------------------------------------------
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const PLUGIN_VERSION = "0.2.4";
1
+ export const PLUGIN_VERSION = "0.2.6";