@syengup/friday-channel-next 0.0.6 → 0.0.8
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.
- package/install.js +30 -9
- package/install.sh +21 -4
- package/package.json +4 -2
package/install.js
CHANGED
|
@@ -88,11 +88,7 @@ process.chdir(PLUGIN_DIR);
|
|
|
88
88
|
// --------------- install + build ---------------
|
|
89
89
|
|
|
90
90
|
log("Installing dependencies...");
|
|
91
|
-
|
|
92
|
-
execSync("pnpm install --frozen-lockfile", { stdio: "inherit" });
|
|
93
|
-
} catch {
|
|
94
|
-
execSync("pnpm install", { stdio: "inherit" });
|
|
95
|
-
}
|
|
91
|
+
execSync("pnpm install", { stdio: "inherit" });
|
|
96
92
|
|
|
97
93
|
log("Building TypeScript...");
|
|
98
94
|
execSync("pnpm build", { stdio: "inherit" });
|
|
@@ -174,13 +170,38 @@ if (bindMode === "lan") {
|
|
|
174
170
|
gatewayUrl = `http://127.0.0.1:${gatewayPort}`;
|
|
175
171
|
}
|
|
176
172
|
|
|
177
|
-
log("--------------------------------------------------");
|
|
178
|
-
log("Installation complete! Friday Next channel is now active.");
|
|
179
173
|
const BOLD_YELLOW = (s) => `\x1b[1;33m${s}\x1b[0m`;
|
|
180
174
|
|
|
175
|
+
log("--------------------------------------------------");
|
|
176
|
+
log("Installation complete! Friday Next channel is now active.");
|
|
181
177
|
log("");
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
|
|
179
|
+
// --------------- QR code ---------------
|
|
180
|
+
|
|
181
|
+
const qrPayload = JSON.stringify({ url: gatewayUrl, token: gatewayToken });
|
|
182
|
+
let qrShown = false;
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const { createRequire } = await import("node:module");
|
|
186
|
+
const qrcode = createRequire(import.meta.url)("qrcode-terminal");
|
|
187
|
+
log(BOLD_YELLOW("Scan below to auto-fill URL & Token in FridayNext app:"));
|
|
188
|
+
log(BOLD_YELLOW("扫描下方二维码自动填入 URL 和 Token:"));
|
|
189
|
+
log("");
|
|
190
|
+
qrcode.generate(qrPayload, { small: true });
|
|
191
|
+
log("");
|
|
192
|
+
log("If QR scan doesn't work, enter manually:");
|
|
193
|
+
log("若二维码无法使用,请手动输入:");
|
|
194
|
+
qrShown = true;
|
|
195
|
+
} catch {
|
|
196
|
+
// qrcode-terminal not available, fall through to manual-only
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// --------------- manual input ---------------
|
|
200
|
+
|
|
201
|
+
if (!qrShown) {
|
|
202
|
+
log(BOLD_YELLOW("Input the URL and Token below into your FridayNext app to connect."));
|
|
203
|
+
log(BOLD_YELLOW("请将下方 URL 和 Token 输入至 FridayNext App 完成连接。"));
|
|
204
|
+
}
|
|
184
205
|
log("");
|
|
185
206
|
log("Gateway URL: " + BOLD_YELLOW(gatewayUrl));
|
|
186
207
|
log("Bearer Token: " + BOLD_YELLOW(gatewayToken));
|
package/install.sh
CHANGED
|
@@ -48,7 +48,7 @@ fi
|
|
|
48
48
|
cd "$PLUGIN_DIR"
|
|
49
49
|
|
|
50
50
|
log "Installing dependencies..."
|
|
51
|
-
pnpm install
|
|
51
|
+
pnpm install
|
|
52
52
|
|
|
53
53
|
log "Building TypeScript..."
|
|
54
54
|
pnpm build
|
|
@@ -132,9 +132,26 @@ const bind = config.gateway?.bind || "localhost";
|
|
|
132
132
|
const host = bind === "lan" ? getLanIp() : "127.0.0.1";
|
|
133
133
|
|
|
134
134
|
const YB = '\x1b[1;33m', N = '\x1b[0m';
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const qrPayload = JSON.stringify({ url: "http://" + host + ":" + port, token: token });
|
|
136
|
+
let qrShown = false;
|
|
137
|
+
try {
|
|
138
|
+
const { createRequire } = await import("node:module");
|
|
139
|
+
const qrcode = createRequire(import.meta.url)("qrcode-terminal");
|
|
140
|
+
console.log("");
|
|
141
|
+
console.log(YB + "Scan below to auto-fill URL & Token in FridayNext app:" + N);
|
|
142
|
+
console.log(YB + "扫描下方二维码自动填入 URL 和 Token:" + N);
|
|
143
|
+
console.log("");
|
|
144
|
+
qrcode.generate(qrPayload, { small: true });
|
|
145
|
+
console.log("");
|
|
146
|
+
console.log("If QR scan doesn't work, enter manually:");
|
|
147
|
+
console.log("若二维码无法使用,请手动输入:");
|
|
148
|
+
qrShown = true;
|
|
149
|
+
} catch {}
|
|
150
|
+
if (!qrShown) {
|
|
151
|
+
console.log("");
|
|
152
|
+
console.log(YB + "Input the URL and Token below into your FridayNext app to connect." + N);
|
|
153
|
+
console.log(YB + "请将下方 URL 和 Token 输入至 FridayNext App 完成连接。" + N);
|
|
154
|
+
}
|
|
138
155
|
console.log("");
|
|
139
156
|
console.log("Gateway URL: " + YB + "http://" + host + ":" + port + N);
|
|
140
157
|
console.log("Bearer Token: " + YB + token + N);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syengup/friday-channel-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "OpenClaw Friday Next Apple channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"install.js",
|
|
10
10
|
"install.sh",
|
|
11
11
|
"tsconfig.json",
|
|
12
|
-
"pnpm-lock.yaml",
|
|
13
12
|
"openclaw.plugin.json"
|
|
14
13
|
],
|
|
15
14
|
"scripts": {
|
|
@@ -53,6 +52,9 @@
|
|
|
53
52
|
"stageRuntimeDependencies": true
|
|
54
53
|
}
|
|
55
54
|
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"qrcode-terminal": "^0.12.0"
|
|
57
|
+
},
|
|
56
58
|
"devDependencies": {
|
|
57
59
|
"@types/node": "^25.6.0",
|
|
58
60
|
"chalk": "^5.6.2",
|