@geminilight/mindos 0.5.23 → 0.5.25
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/app/app/api/setup/check-port/route.ts +10 -9
- package/app/components/AskFab.tsx +1 -1
- package/app/package.json +2 -2
- package/bin/cli.js +1 -1
- package/bin/lib/gateway.js +4 -2
- package/package.json +1 -1
- package/scripts/setup.js +1 -1
|
@@ -15,16 +15,17 @@ function isPortInUse(port: number): Promise<boolean> {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
async function isSelfPort(port: number): Promise<boolean> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
for (const host of ['127.0.0.1', 'localhost']) {
|
|
19
|
+
try {
|
|
20
|
+
const res = await fetch(`http://${host}:${port}/api/health`, {
|
|
21
|
+
signal: AbortSignal.timeout(2000),
|
|
22
|
+
});
|
|
23
|
+
if (!res.ok) continue;
|
|
24
|
+
const data = await res.json() as Record<string, unknown>;
|
|
25
|
+
if (data.service === 'mindos') return true;
|
|
26
|
+
} catch { /* try next host */ }
|
|
27
27
|
}
|
|
28
|
+
return false;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
async function findFreePort(start: number, selfPorts: Set<number>): Promise<number | null> {
|
|
@@ -35,7 +35,7 @@ export default function AskFab({ onToggle, askPanelOpen }: AskFabProps) {
|
|
|
35
35
|
<Sparkles size={16} className="relative z-10 shrink-0" />
|
|
36
36
|
<span className="
|
|
37
37
|
relative z-10
|
|
38
|
-
group-hover:max-w-[120px]
|
|
38
|
+
max-w-0 group-hover:max-w-[120px]
|
|
39
39
|
opacity-0 group-hover:opacity-100
|
|
40
40
|
transition-all duration-200 ease-out
|
|
41
41
|
whitespace-nowrap overflow-hidden
|
package/app/package.json
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@codemirror/state": "^6.5.4",
|
|
17
17
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
18
18
|
"@codemirror/view": "^6.39.16",
|
|
19
|
-
"@mariozechner/pi-agent-core": "^0.
|
|
20
|
-
"@mariozechner/pi-ai": "^0.
|
|
19
|
+
"@mariozechner/pi-agent-core": "^0.60.0",
|
|
20
|
+
"@mariozechner/pi-ai": "^0.60.0",
|
|
21
21
|
"@sinclair/typebox": "^0.34.33",
|
|
22
22
|
"@tiptap/extension-image": "^3.20.1",
|
|
23
23
|
"@tiptap/extension-link": "^3.20.1",
|
package/bin/cli.js
CHANGED
|
@@ -245,7 +245,7 @@ const commands = {
|
|
|
245
245
|
// Do NOT call start() here — kickstart -k would kill the just-started process,
|
|
246
246
|
// causing a port-conflict race condition with KeepAlive restart loops.
|
|
247
247
|
console.log(dim(' (First run may take a few minutes to install dependencies and build the app.)'));
|
|
248
|
-
const ready = await waitForHttp(Number(webPort), { retries:
|
|
248
|
+
const ready = await waitForHttp(Number(webPort), { retries: 180, intervalMs: 2000, label: 'Web UI', logFile: LOG_PATH });
|
|
249
249
|
if (!ready) {
|
|
250
250
|
console.error(red('\n✘ Service started but Web UI did not become ready in time.'));
|
|
251
251
|
console.error(dim(' Check logs with: mindos logs\n'));
|
package/bin/lib/gateway.js
CHANGED
|
@@ -124,13 +124,15 @@ export async function waitForHttp(port, { retries = 60, intervalMs = 2000, label
|
|
|
124
124
|
for (let i = 0; i < retries; i++) {
|
|
125
125
|
try {
|
|
126
126
|
const { request } = await import('node:http');
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
// Try both 127.0.0.1 and localhost — Next.js may bind differently
|
|
128
|
+
const tryHost = async (hostname) => new Promise((resolve) => {
|
|
129
|
+
const req = request({ hostname, port, path: '/api/health', method: 'GET', timeout: 5000 },
|
|
129
130
|
(res) => { res.resume(); resolve(res.statusCode < 500); });
|
|
130
131
|
req.on('error', () => resolve(false));
|
|
131
132
|
req.on('timeout', () => { req.destroy(); resolve(false); });
|
|
132
133
|
req.end();
|
|
133
134
|
});
|
|
135
|
+
const ok = await tryHost('127.0.0.1') || await tryHost('localhost');
|
|
134
136
|
if (ok) {
|
|
135
137
|
process.stdout.write(`\r\x1b[K`);
|
|
136
138
|
process.stdout.write(` ${green('\u2714')} ${label} ready ${dim(`(${elapsed()})`)}\n`);
|
package/package.json
CHANGED
package/scripts/setup.js
CHANGED
|
@@ -902,7 +902,7 @@ async function startGuiSetup() {
|
|
|
902
902
|
|
|
903
903
|
// Wait for the server to be ready (120s timeout)
|
|
904
904
|
const { waitForHttp } = await import('../bin/lib/gateway.js');
|
|
905
|
-
const ready = await waitForHttp(usePort, { retries:
|
|
905
|
+
const ready = await waitForHttp(usePort, { retries: 180, intervalMs: 1000, label: 'MindOS', logFile: LOG_PATH });
|
|
906
906
|
|
|
907
907
|
if (!ready) {
|
|
908
908
|
write(c.red('\n✘ Server failed to start.\n'));
|