agentgui 1.0.886 → 1.0.888
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/package.json
CHANGED
|
@@ -96,8 +96,8 @@ async function main() {
|
|
|
96
96
|
cwd: ROOT,
|
|
97
97
|
});
|
|
98
98
|
const srvLog = [];
|
|
99
|
-
server.stdout.on('data', d => srvLog.push(d));
|
|
100
|
-
server.stderr.on('data', d => srvLog.push(d));
|
|
99
|
+
server.stdout.on('data', d => { srvLog.push(d); process.stdout.write(d); });
|
|
100
|
+
server.stderr.on('data', d => { srvLog.push(d); process.stderr.write(d); });
|
|
101
101
|
|
|
102
102
|
const cleanup = () => {
|
|
103
103
|
try { server.kill('SIGTERM'); } catch {}
|
|
@@ -106,8 +106,12 @@ async function main() {
|
|
|
106
106
|
process.on('exit', cleanup);
|
|
107
107
|
process.on('SIGINT', () => { cleanup(); process.exit(130); });
|
|
108
108
|
|
|
109
|
+
let serverExitCode = null;
|
|
110
|
+
server.on('exit', (code) => { serverExitCode = code ?? 0; });
|
|
111
|
+
|
|
109
112
|
try {
|
|
110
113
|
await waitForHealthy(`${BASE}/api/health`);
|
|
114
|
+
if (serverExitCode !== null) throw new Error(`Server exited with code ${serverExitCode} before becoming healthy`);
|
|
111
115
|
console.log('[capture] server healthy — launching browser');
|
|
112
116
|
|
|
113
117
|
const { default: puppeteer } = await import('puppeteer-core');
|
|
@@ -128,7 +132,7 @@ async function main() {
|
|
|
128
132
|
|
|
129
133
|
for (const s of shots) {
|
|
130
134
|
const page = await browser.newPage();
|
|
131
|
-
page.setDefaultNavigationTimeout(
|
|
135
|
+
page.setDefaultNavigationTimeout(30000);
|
|
132
136
|
await page.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: 'reduce' }]);
|
|
133
137
|
await page.evaluateOnNewDocument((theme) => {
|
|
134
138
|
try { localStorage.setItem('theme', theme); } catch {}
|
|
@@ -144,7 +148,7 @@ async function main() {
|
|
|
144
148
|
}, s.theme);
|
|
145
149
|
|
|
146
150
|
console.log(`[capture] -> ${s.name} (${s.theme})`);
|
|
147
|
-
await page.goto(s.url, { waitUntil: '
|
|
151
|
+
await page.goto(s.url, { waitUntil: 'domcontentloaded' });
|
|
148
152
|
// Determinism: wait until the sidebar has transitioned out of "Loading..."
|
|
149
153
|
// and rendered at least one conversation row.
|
|
150
154
|
await page.waitForFunction(() => {
|