@syengup/friday-channel-next 0.0.9 → 0.0.10
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 +28 -5
- package/install.sh +25 -4
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -181,15 +181,38 @@ async function verifyGateway(url, token, retries = 6) {
|
|
|
181
181
|
req.end();
|
|
182
182
|
});
|
|
183
183
|
if (res.status === 200) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
try {
|
|
185
|
+
const data = JSON.parse(res.body);
|
|
186
|
+
if (data.ok) {
|
|
187
|
+
log("Gateway verified OK (friday-next " + data.version + ", " + data.connections + " connections).");
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
warn("Plugin responded but ok=false — " + JSON.stringify(data));
|
|
191
|
+
return false;
|
|
192
|
+
} catch {
|
|
193
|
+
// body is not JSON (e.g. HTML control panel) — plugin route not registered yet
|
|
194
|
+
if (i < 3) {
|
|
195
|
+
warn(`Plugin routes not registered yet, retrying (${i}/${retries})...`);
|
|
196
|
+
} else if (i < retries) {
|
|
197
|
+
warn(`Gateway is up but plugin routes missing — may need config reload, retrying (${i}/${retries})...`);
|
|
198
|
+
} else {
|
|
199
|
+
warn("Gateway is running but plugin routes were not loaded. Check plugin config in openclaw.json.");
|
|
200
|
+
}
|
|
201
|
+
continue;
|
|
188
202
|
}
|
|
189
203
|
}
|
|
204
|
+
if (res.status === 401) {
|
|
205
|
+
warn("Auth token mismatch — check gateway.auth.token in openclaw.json.");
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
if (res.status === 404) {
|
|
209
|
+
warn("Route /friday-next/status not found — plugin may not be loaded.");
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
190
212
|
if (i < retries) warn(`Gateway responded ${res.status}, retrying (${i}/${retries})...`);
|
|
191
213
|
} catch {
|
|
192
|
-
|
|
214
|
+
// Connection refused / timeout — gateway not running yet
|
|
215
|
+
if (i < retries) warn(`Gateway not reachable, retrying (${i}/${retries})...`);
|
|
193
216
|
}
|
|
194
217
|
}
|
|
195
218
|
warn("Gateway verification timed out — check 'openclaw gateway status' manually.");
|
package/install.sh
CHANGED
|
@@ -148,15 +148,36 @@ async function verifyGateway() {
|
|
|
148
148
|
req.end();
|
|
149
149
|
});
|
|
150
150
|
if (res.status === 200) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
try {
|
|
152
|
+
const data = JSON.parse(res.body);
|
|
153
|
+
if (data.ok) {
|
|
154
|
+
console.log(" Gateway verified OK (friday-next " + data.version + ", " + data.connections + " connections).");
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
console.log(" ! Plugin responded but ok=false — " + JSON.stringify(data));
|
|
154
158
|
return;
|
|
159
|
+
} catch {
|
|
160
|
+
if (i < 3) {
|
|
161
|
+
console.log(" ! Plugin routes not registered yet, retrying (" + i + "/6)...");
|
|
162
|
+
} else if (i < 6) {
|
|
163
|
+
console.log(" ! Gateway is up but plugin routes missing — may need config reload, retrying (" + i + "/6)...");
|
|
164
|
+
} else {
|
|
165
|
+
console.log(" ! Gateway is running but plugin routes were not loaded. Check plugin config in openclaw.json.");
|
|
166
|
+
}
|
|
167
|
+
continue;
|
|
155
168
|
}
|
|
156
169
|
}
|
|
170
|
+
if (res.status === 401) {
|
|
171
|
+
console.log(" ! Auth token mismatch — check gateway.auth.token in openclaw.json.");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (res.status === 404) {
|
|
175
|
+
console.log(" ! Route /friday-next/status not found — plugin may not be loaded.");
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
157
178
|
if (i < 6) console.log(" ! Gateway responded " + res.status + ", retrying (" + i + "/6)...");
|
|
158
179
|
} catch {
|
|
159
|
-
if (i < 6) console.log(" ! Gateway not
|
|
180
|
+
if (i < 6) console.log(" ! Gateway not reachable, retrying (" + i + "/6)...");
|
|
160
181
|
}
|
|
161
182
|
}
|
|
162
183
|
console.log(" ! Gateway verification timed out — check '\''openclaw gateway status'\'' manually.");
|