switchboard-router 0.6.3 → 0.6.4
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/README.md +40 -0
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
- package/app/.next-cli-build/server/chunks/194.js +1 -1
- package/app/.next-cli-build/server/chunks/4126.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1321-c8ffcb14dcf776aa.js → 1321-5429c7d81eb38c6f.js} +1 -1
- package/app/package.json +1 -1
- package/app/src/lib/updater/updater.js +41 -12
- package/cli.js +401 -320
- package/package.json +1 -1
- package/src/cli/cliOptions.js +139 -0
- package/src/cli/menus/settings.js +2 -2
- package/src/cli/processManager.js +186 -0
- package/src/cli/serverStatus.js +90 -0
- package/src/cli/terminalUI.js +12 -11
- package/src/cli/tray/autostart.js +35 -14
- package/src/cli/tray/tray.js +34 -32
- package/src/cli/tray/trayWin.js +23 -9
- package/src/cli/utils/input.js +10 -1
- /package/app/.next-cli-build/static/{emM_vF1dDbzWCO6J4_WjU → 88rQB4DdrBDjq9aWvSEH4}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{emM_vF1dDbzWCO6J4_WjU → 88rQB4DdrBDjq9aWvSEH4}/_ssgManifest.js +0 -0
package/app/package.json
CHANGED
|
@@ -20,6 +20,8 @@ const waitMaxMs = parseInt(process.env.UPDATER_WAIT_MAX_MS || "15000", 10);
|
|
|
20
20
|
const waitCheckMs = parseInt(process.env.UPDATER_WAIT_CHECK_MS || "500", 10);
|
|
21
21
|
const statusStartupTimeoutMs = parseInt(process.env.UPDATER_STARTUP_TIMEOUT_MS || "2000", 10);
|
|
22
22
|
const appPort = parseInt(process.env.UPDATER_APP_PORT || "20128", 10);
|
|
23
|
+
const readyFile = process.env.UPDATER_READY_FILE || "";
|
|
24
|
+
const readyToken = process.env.UPDATER_READY_TOKEN || "";
|
|
23
25
|
const allowedStatusOrigins = new Set([
|
|
24
26
|
`http://127.0.0.1:${appPort}`,
|
|
25
27
|
`http://localhost:${appPort}`,
|
|
@@ -70,6 +72,14 @@ function setPhase(phase) {
|
|
|
70
72
|
persistStatus();
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
function publishReady() {
|
|
76
|
+
if (!readyFile || !readyToken) return;
|
|
77
|
+
const tmp = `${readyFile}.tmp-${process.pid}`;
|
|
78
|
+
fs.mkdirSync(path.dirname(readyFile), { recursive: true });
|
|
79
|
+
fs.writeFileSync(tmp, readyToken, { mode: 0o600 });
|
|
80
|
+
fs.renameSync(tmp, readyFile);
|
|
81
|
+
}
|
|
82
|
+
|
|
73
83
|
// HTTP server exposing status (browser polls this while Next server is dead)
|
|
74
84
|
const server = http.createServer((req, res) => {
|
|
75
85
|
const origin = req.headers.origin;
|
|
@@ -88,6 +98,7 @@ const server = http.createServer((req, res) => {
|
|
|
88
98
|
});
|
|
89
99
|
|
|
90
100
|
let statusServerReady = false;
|
|
101
|
+
let finalized = false;
|
|
91
102
|
let statusServerFailed = false;
|
|
92
103
|
let statusServerStartupTimer = null;
|
|
93
104
|
|
|
@@ -124,8 +135,14 @@ statusServerStartupTimer = setTimeout(() => {
|
|
|
124
135
|
|
|
125
136
|
try {
|
|
126
137
|
server.listen(port, "127.0.0.1", () => {
|
|
127
|
-
statusServerReady = true;
|
|
128
138
|
if (statusServerStartupTimer) clearTimeout(statusServerStartupTimer);
|
|
139
|
+
try {
|
|
140
|
+
publishReady();
|
|
141
|
+
} catch (error) {
|
|
142
|
+
failStatusServer(new Error(`could not publish readiness: ${error.message}`));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
statusServerReady = true;
|
|
129
146
|
persistStatus();
|
|
130
147
|
waitForAppExit().then(runInstall).catch((error) => {
|
|
131
148
|
pushLog(`[updater] wait failed: ${error.message}`);
|
|
@@ -178,6 +195,7 @@ function sleep(ms) {
|
|
|
178
195
|
}
|
|
179
196
|
|
|
180
197
|
function runInstall() {
|
|
198
|
+
if (finalized) return;
|
|
181
199
|
state.attempt += 1;
|
|
182
200
|
setPhase("installing");
|
|
183
201
|
pushLog(`[updater] attempt ${state.attempt}/${maxRetries} — npm i -g ${packageName} --prefer-online`);
|
|
@@ -201,23 +219,30 @@ function runInstall() {
|
|
|
201
219
|
persistStatus();
|
|
202
220
|
});
|
|
203
221
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (code === 0) {
|
|
222
|
+
let attemptSettled = false;
|
|
223
|
+
const settleAttempt = (code, spawnError = null) => {
|
|
224
|
+
if (attemptSettled || finalized) return;
|
|
225
|
+
attemptSettled = true;
|
|
226
|
+
if (spawnError) pushLog(`[updater] spawn error: ${spawnError}`);
|
|
227
|
+
else pushLog(`[updater] npm exited with code ${code}`);
|
|
228
|
+
if (!spawnError && code === 0) {
|
|
212
229
|
finalize(true, code, null);
|
|
213
230
|
return;
|
|
214
231
|
}
|
|
215
232
|
if (state.attempt < maxRetries) {
|
|
216
233
|
pushLog(`[updater] retrying in ${Math.round(retryDelayMs / 1000)}s...`);
|
|
217
|
-
setTimeout(runInstall, retryDelayMs);
|
|
234
|
+
setTimeout(() => { if (!finalized) runInstall(); }, retryDelayMs);
|
|
218
235
|
return;
|
|
219
236
|
}
|
|
220
|
-
finalize(false, code, `Install failed after ${maxRetries} attempts`);
|
|
237
|
+
finalize(false, code, spawnError || `Install failed after ${maxRetries} attempts`);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
child.on("error", (e) => {
|
|
241
|
+
settleAttempt(null, e.message);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
child.on("close", (code) => {
|
|
245
|
+
settleAttempt(code);
|
|
221
246
|
});
|
|
222
247
|
}
|
|
223
248
|
|
|
@@ -278,13 +303,17 @@ function relaunchApp() {
|
|
|
278
303
|
}
|
|
279
304
|
|
|
280
305
|
function finalize(success, exitCode, error) {
|
|
306
|
+
if (finalized) return;
|
|
307
|
+
finalized = true;
|
|
281
308
|
state.done = true;
|
|
282
309
|
state.success = success;
|
|
283
310
|
state.exitCode = exitCode;
|
|
284
311
|
state.error = error;
|
|
285
312
|
state.finishedAt = Date.now();
|
|
286
313
|
setPhase(success ? "done" : "error");
|
|
287
|
-
|
|
314
|
+
// Restore service even when installation fails; the previously installed
|
|
315
|
+
// package is still the safest recovery target.
|
|
316
|
+
relaunchApp();
|
|
288
317
|
// Linger so browser can poll final status, then exit & close the port
|
|
289
318
|
setTimeout(() => {
|
|
290
319
|
try { server.close(); } catch { /* ignore */ }
|