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,7 +5,6 @@
"type": "module",
"dependencies": {
"@larksuiteoapi/node-sdk": "^1.61.1",
"qrcode-terminal": "^0.12.0",
"typebox": "1.1.28"
},
"devDependencies": {
@@ -13,7 +12,7 @@
"openclaw": "workspace:*"
},
"peerDependencies": {
"openclaw": ">=2026.4.20"
"openclaw": ">=2026.4.23"
},
"peerDependenciesMeta": {
"openclaw": {
@@ -41,10 +40,10 @@
"install": {
"npmSpec": "@openclaw/feishu",
"defaultChoice": "npm",
"minHostVersion": ">=2026.4.10"
"minHostVersion": ">=2026.4.23"
},
"compat": {
"pluginApi": ">=2026.4.20"
"pluginApi": ">=2026.4.23"
},
"build": {
"openclawVersion": "2026.4.20"

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;
}