fix(qr): replace qrcode-terminal with qrcode-tui

Replace legacy qrcode-terminal usage with shared qrcode-tui media helpers, bound QR PNG rendering options, and raise bundled plugin host floors for the new SDK runtime surface.
This commit is contained in:
Vincent Koc
2026-04-23 13:06:14 -07:00
committed by GitHub
parent 6f74763f1d
commit ea25d7ed5b
29 changed files with 336 additions and 193 deletions

View File

@@ -5,8 +5,8 @@
* Replaces axios with native fetch, removes inquirer/ora/chalk in favor of
* the openclaw WizardPrompter surface.
*/
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
import { renderQrTerminal } from "./qr-terminal.js";
import type { FeishuDomain } from "./types.js";
// ---------------------------------------------------------------------------
@@ -252,9 +252,8 @@ export async function pollAppRegistration(params: {
* otherwise the pattern is corrupted and cannot be scanned.
*/
export async function printQrCode(url: string): Promise<void> {
const mod = await import("qrcode-terminal");
const qrcode = mod.default ?? mod;
qrcode.generate(url, { small: true });
const output = await renderQrTerminal(url, { small: true });
process.stdout.write(output.endsWith("\n") ? output : `${output}\n`);
}
/**

View File

@@ -0,0 +1 @@
export { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";

View File

@@ -1,12 +0,0 @@
declare module "qrcode-terminal" {
type GenerateOptions = {
small?: boolean;
};
type QrCodeTerminal = {
generate: (input: string, options?: GenerateOptions, cb?: (output: string) => void) => void;
};
const qrcode: QrCodeTerminal;
export default qrcode;
}