sparkecoder 0.1.68 → 0.1.70
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/dist/agent/index.js +49 -10
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +154 -50
- package/dist/cli.js.map +1 -1
- package/dist/index.js +154 -50
- package/dist/index.js.map +1 -1
- package/dist/server/index.js +154 -50
- package/dist/server/index.js.map +1 -1
- package/dist/skills/default/qa.md +376 -106
- package/package.json +1 -1
- package/src/skills/default/qa.md +376 -106
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/embed/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/web/.next/server/app/embed/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__c71f29f9._.js → [root-of-the-server]__a1877334._.js} +4 -4
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_2b3a5919._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_38156da8._.js +1 -1
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/{static/chunks/4e673433173ad456.js → standalone/web/.next/static/chunks/2cafc7cb79454d33.js} +3 -3
- package/web/.next/standalone/web/.next/static/chunks/41a5c049931b2c77.css +1 -0
- package/web/.next/standalone/web/.next/static/chunks/{515f0c0bd6087843.js → f95d41079838994a.js} +3 -3
- package/web/.next/standalone/web/.next/static/chunks/{31208ade542a0fcb.js → fc39a194539da104.js} +3 -3
- package/web/.next/standalone/web/.next/static/{chunks/4e673433173ad456.js → static/chunks/2cafc7cb79454d33.js} +3 -3
- package/web/.next/standalone/web/.next/static/static/chunks/41a5c049931b2c77.css +1 -0
- package/web/.next/standalone/web/.next/static/static/chunks/{515f0c0bd6087843.js → f95d41079838994a.js} +3 -3
- package/web/.next/{static/chunks/31208ade542a0fcb.js → standalone/web/.next/static/static/chunks/fc39a194539da104.js} +3 -3
- package/web/.next/standalone/web/src/components/ai-elements/read-file-tool.tsx +19 -2
- package/web/.next/standalone/web/src/components/chat-interface.tsx +63 -4
- package/web/.next/standalone/web/src/lib/api.ts +89 -16
- package/web/.next/{standalone/web/.next/static/static/chunks/4e673433173ad456.js → static/chunks/2cafc7cb79454d33.js} +3 -3
- package/web/.next/static/chunks/41a5c049931b2c77.css +1 -0
- package/web/.next/static/chunks/{515f0c0bd6087843.js → f95d41079838994a.js} +3 -3
- package/web/.next/{standalone/web/.next/static/static/chunks/31208ade542a0fcb.js → static/chunks/fc39a194539da104.js} +3 -3
- package/web/.next/standalone/web/.next/static/chunks/fd39dd62879495e1.css +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/fd39dd62879495e1.css +0 -1
- package/web/.next/static/chunks/fd39dd62879495e1.css +0 -1
- /package/web/.next/standalone/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
- /package/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{6Dlxqhgk8Mki7q7L-gDbl → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
package/dist/agent/index.js
CHANGED
|
@@ -1417,10 +1417,15 @@ import WebSocket from "ws";
|
|
|
1417
1417
|
import { EventEmitter } from "events";
|
|
1418
1418
|
function getOrCreateProxy(sessionId, port) {
|
|
1419
1419
|
const existing = activeProxies.get(sessionId);
|
|
1420
|
-
if (existing)
|
|
1420
|
+
if (existing) {
|
|
1421
|
+
console.log(`[BROWSER-WS] Reusing existing proxy for session ${sessionId} (connected=${existing.connected})`);
|
|
1422
|
+
return existing;
|
|
1423
|
+
}
|
|
1424
|
+
console.log(`[BROWSER-WS] Creating new proxy for session ${sessionId} on port ${port} (active proxies: ${activeProxies.size})`);
|
|
1421
1425
|
const proxy = new BrowserStreamProxy(port);
|
|
1422
1426
|
activeProxies.set(sessionId, proxy);
|
|
1423
1427
|
proxy.on("close", () => {
|
|
1428
|
+
console.log(`[BROWSER-WS] Proxy closed for session ${sessionId}, removing from registry`);
|
|
1424
1429
|
activeProxies.delete(sessionId);
|
|
1425
1430
|
});
|
|
1426
1431
|
proxy.connect();
|
|
@@ -1432,8 +1437,11 @@ function getProxy(sessionId) {
|
|
|
1432
1437
|
function destroyProxy(sessionId) {
|
|
1433
1438
|
const proxy = activeProxies.get(sessionId);
|
|
1434
1439
|
if (proxy) {
|
|
1440
|
+
console.log(`[BROWSER-WS] destroyProxy() called for session ${sessionId}`);
|
|
1435
1441
|
proxy.destroy();
|
|
1436
1442
|
activeProxies.delete(sessionId);
|
|
1443
|
+
} else {
|
|
1444
|
+
console.log(`[BROWSER-WS] destroyProxy() called but no proxy exists for session ${sessionId}`);
|
|
1437
1445
|
}
|
|
1438
1446
|
}
|
|
1439
1447
|
var RECONNECT_DELAY_MS, MAX_RECONNECT_ATTEMPTS, FRAME_THROTTLE_MS, BrowserStreamProxy, activeProxies;
|
|
@@ -1464,35 +1472,37 @@ var init_stream_proxy = __esm({
|
|
|
1464
1472
|
}
|
|
1465
1473
|
connect() {
|
|
1466
1474
|
if (this.destroyed) return;
|
|
1475
|
+
console.log(`[BROWSER-WS] connect() called for port ${this.port}`);
|
|
1467
1476
|
this.doConnect();
|
|
1468
1477
|
}
|
|
1469
1478
|
doConnect() {
|
|
1470
1479
|
if (this.destroyed) return;
|
|
1471
1480
|
const url = `ws://localhost:${this.port}`;
|
|
1481
|
+
console.log(`[BROWSER-WS] Attempting WebSocket connection to ${url} (attempt ${this.reconnectAttempts + 1}/${MAX_RECONNECT_ATTEMPTS})`);
|
|
1472
1482
|
try {
|
|
1473
1483
|
this.ws = new WebSocket(url);
|
|
1474
|
-
} catch {
|
|
1484
|
+
} catch (err) {
|
|
1485
|
+
console.warn(`[BROWSER-WS] WebSocket constructor threw for ${url}:`, err);
|
|
1475
1486
|
this.scheduleReconnect();
|
|
1476
1487
|
return;
|
|
1477
1488
|
}
|
|
1478
1489
|
this.ws.on("open", () => {
|
|
1490
|
+
console.log(`[BROWSER-WS] Connected to ${url} (after ${this.reconnectAttempts} retries)`);
|
|
1479
1491
|
this.reconnectAttempts = 0;
|
|
1480
1492
|
this._connected = true;
|
|
1481
|
-
this.emit("status", {
|
|
1482
|
-
connected: true,
|
|
1483
|
-
screencasting: true
|
|
1484
|
-
});
|
|
1485
1493
|
});
|
|
1486
1494
|
this.ws.on("message", (raw) => {
|
|
1487
1495
|
try {
|
|
1488
1496
|
const msg = JSON.parse(typeof raw === "string" ? raw : raw.toString("utf8"));
|
|
1489
1497
|
this.handleMessage(msg);
|
|
1490
|
-
} catch {
|
|
1498
|
+
} catch (err) {
|
|
1499
|
+
console.warn(`[BROWSER-WS] Malformed message from ${url}:`, err);
|
|
1491
1500
|
}
|
|
1492
1501
|
});
|
|
1493
|
-
this.ws.on("close", () => {
|
|
1502
|
+
this.ws.on("close", (code, reason) => {
|
|
1494
1503
|
const wasConnected = this._connected;
|
|
1495
1504
|
this._connected = false;
|
|
1505
|
+
console.log(`[BROWSER-WS] Connection closed: code=${code} reason="${reason?.toString() || ""}" wasConnected=${wasConnected} destroyed=${this.destroyed}`);
|
|
1496
1506
|
if (wasConnected) {
|
|
1497
1507
|
this.emit("status", { connected: false, screencasting: false });
|
|
1498
1508
|
}
|
|
@@ -1500,14 +1510,26 @@ var init_stream_proxy = __esm({
|
|
|
1500
1510
|
this.scheduleReconnect();
|
|
1501
1511
|
}
|
|
1502
1512
|
});
|
|
1503
|
-
this.ws.on("error", () => {
|
|
1513
|
+
this.ws.on("error", (err) => {
|
|
1514
|
+
console.warn(`[BROWSER-WS] WebSocket error on port ${this.port}:`, err.message);
|
|
1504
1515
|
});
|
|
1505
1516
|
}
|
|
1517
|
+
frameCount = 0;
|
|
1518
|
+
throttledCount = 0;
|
|
1519
|
+
lastFrameLogTime = 0;
|
|
1506
1520
|
handleMessage(msg) {
|
|
1507
1521
|
if (msg.type === "frame") {
|
|
1508
1522
|
const now = Date.now();
|
|
1509
|
-
if (now - this.lastFrameTime < FRAME_THROTTLE_MS)
|
|
1523
|
+
if (now - this.lastFrameTime < FRAME_THROTTLE_MS) {
|
|
1524
|
+
this.throttledCount++;
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1510
1527
|
this.lastFrameTime = now;
|
|
1528
|
+
this.frameCount++;
|
|
1529
|
+
if (now - this.lastFrameLogTime > 5e3) {
|
|
1530
|
+
console.log(`[BROWSER-WS] Frame stats: emitted=${this.frameCount} throttled=${this.throttledCount} listeners=${this.listenerCount("frame")} dataSize=${msg.data?.length ?? 0}`);
|
|
1531
|
+
this.lastFrameLogTime = now;
|
|
1532
|
+
}
|
|
1511
1533
|
const frame = {
|
|
1512
1534
|
data: msg.data,
|
|
1513
1535
|
metadata: msg.metadata ?? {
|
|
@@ -1523,21 +1545,26 @@ var init_stream_proxy = __esm({
|
|
|
1523
1545
|
this._latestFrame = frame;
|
|
1524
1546
|
this.emit("frame", frame);
|
|
1525
1547
|
} else if (msg.type === "status") {
|
|
1548
|
+
console.log(`[BROWSER-WS] Status message received:`, JSON.stringify(msg));
|
|
1526
1549
|
this.emit("status", {
|
|
1527
1550
|
connected: msg.connected ?? true,
|
|
1528
1551
|
screencasting: msg.screencasting ?? true,
|
|
1529
1552
|
viewportWidth: msg.viewportWidth,
|
|
1530
1553
|
viewportHeight: msg.viewportHeight
|
|
1531
1554
|
});
|
|
1555
|
+
} else {
|
|
1556
|
+
console.log(`[BROWSER-WS] Unknown message type: ${msg.type}`);
|
|
1532
1557
|
}
|
|
1533
1558
|
}
|
|
1534
1559
|
scheduleReconnect() {
|
|
1535
1560
|
if (this.destroyed || this.reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
|
|
1561
|
+
console.log(`[BROWSER-WS] Giving up reconnection: destroyed=${this.destroyed} attempts=${this.reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS}`);
|
|
1536
1562
|
this.emit("close");
|
|
1537
1563
|
return;
|
|
1538
1564
|
}
|
|
1539
1565
|
this.reconnectAttempts++;
|
|
1540
1566
|
const delay = this.reconnectAttempts <= 5 ? RECONNECT_DELAY_MS : RECONNECT_DELAY_MS * (this.reconnectAttempts - 4);
|
|
1567
|
+
console.log(`[BROWSER-WS] Scheduling reconnect in ${delay}ms (attempt ${this.reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS})`);
|
|
1541
1568
|
this.reconnectTimer = setTimeout(() => this.doConnect(), delay);
|
|
1542
1569
|
}
|
|
1543
1570
|
/**
|
|
@@ -1548,7 +1575,19 @@ var init_stream_proxy = __esm({
|
|
|
1548
1575
|
this.ws.send(JSON.stringify(event));
|
|
1549
1576
|
}
|
|
1550
1577
|
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Ask the StreamServer to send its current status (triggers sendStatus and
|
|
1580
|
+
* re-evaluates screencasting). Useful when listeners are replaced on a new
|
|
1581
|
+
* stream and we want a fresh status event.
|
|
1582
|
+
*/
|
|
1583
|
+
requestStatus() {
|
|
1584
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
1585
|
+
console.log(`[BROWSER-WS] Requesting fresh status from StreamServer`);
|
|
1586
|
+
this.ws.send(JSON.stringify({ type: "status" }));
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1551
1589
|
destroy() {
|
|
1590
|
+
console.log(`[BROWSER-WS] Destroying proxy for port ${this.port} (emitted ${this.frameCount} frames, throttled ${this.throttledCount})`);
|
|
1552
1591
|
this.destroyed = true;
|
|
1553
1592
|
if (this.reconnectTimer) {
|
|
1554
1593
|
clearTimeout(this.reconnectTimer);
|