mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +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,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"
|
||||
|
||||
@@ -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