mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 17:10:44 +00:00
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:
@@ -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`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
extensions/feishu/src/qr-terminal.ts
Normal file
1
extensions/feishu/src/qr-terminal.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
|
||||
12
extensions/feishu/src/qrcode-terminal.d.ts
vendored
12
extensions/feishu/src/qrcode-terminal.d.ts
vendored
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user