sparkecoder 0.1.69 → 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.d.ts +3 -3
- package/dist/agent/index.js +11 -4
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +75 -62
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-DqaHLgSC.d.ts → index-Dm6wGcYv.d.ts} +19 -19
- package/dist/index.d.ts +5 -5
- package/dist/index.js +75 -62
- package/dist/index.js.map +1 -1
- package/dist/{schema-Bq4tID-f.d.ts → schema-XcP0dedO.d.ts} +3 -3
- package/dist/{search-BRnGaIl-.d.ts → search-CCffrVJE.d.ts} +7 -7
- package/dist/server/index.js +75 -62
- package/dist/server/index.js.map +1 -1
- package/dist/skills/default/qa.md +376 -106
- package/dist/tools/index.d.ts +2 -2
- 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 +2 -2
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
- 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/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/standalone/web/.next/static/chunks/41a5c049931b2c77.css +1 -0
- package/web/.next/standalone/web/.next/static/chunks/{b6ec74cad9ffd3ee.js → f95d41079838994a.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/{b6ec74cad9ffd3ee.js → f95d41079838994a.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 +49 -4
- package/web/.next/static/chunks/41a5c049931b2c77.css +1 -0
- package/web/.next/static/chunks/{b6ec74cad9ffd3ee.js → f95d41079838994a.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/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
- /package/web/.next/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_buildManifest.js +0 -0
- /package/web/.next/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{XB638PEDChQhwk6wSMrSh → PpaOWDfndYJrA-tJYr7gU}/_ssgManifest.js +0 -0
package/dist/db/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-
|
|
2
|
-
export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-
|
|
1
|
+
import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-XcP0dedO.js';
|
|
2
|
+
export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-XcP0dedO.js';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelMessage, streamText } from 'ai';
|
|
2
|
-
import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-
|
|
2
|
+
import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-XcP0dedO.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-
|
|
4
|
+
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-CCffrVJE.js';
|
|
5
5
|
|
|
6
6
|
declare const ToolApprovalConfigSchema: z.ZodObject<{
|
|
7
7
|
bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -37,21 +37,21 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
37
37
|
error: z.ZodOptional<z.ZodString>;
|
|
38
38
|
iterations: z.ZodOptional<z.ZodNumber>;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
status: "completed" | "
|
|
41
|
-
enabled: boolean;
|
|
40
|
+
status: "completed" | "failed" | "running";
|
|
42
41
|
outputSchema: Record<string, unknown>;
|
|
42
|
+
enabled: boolean;
|
|
43
43
|
error?: string | undefined;
|
|
44
|
-
webhookUrl?: string | undefined;
|
|
45
44
|
maxIterations?: number | undefined;
|
|
45
|
+
webhookUrl?: string | undefined;
|
|
46
46
|
result?: unknown;
|
|
47
47
|
iterations?: number | undefined;
|
|
48
48
|
}, {
|
|
49
|
-
status: "completed" | "
|
|
50
|
-
enabled: boolean;
|
|
49
|
+
status: "completed" | "failed" | "running";
|
|
51
50
|
outputSchema: Record<string, unknown>;
|
|
51
|
+
enabled: boolean;
|
|
52
52
|
error?: string | undefined;
|
|
53
|
-
webhookUrl?: string | undefined;
|
|
54
53
|
maxIterations?: number | undefined;
|
|
54
|
+
webhookUrl?: string | undefined;
|
|
55
55
|
result?: unknown;
|
|
56
56
|
iterations?: number | undefined;
|
|
57
57
|
}>>;
|
|
@@ -59,32 +59,32 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
59
59
|
maxContextChars: number;
|
|
60
60
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
61
61
|
approvalWebhook?: string | undefined;
|
|
62
|
-
skillsDirectory?: string | undefined;
|
|
63
62
|
task?: {
|
|
64
|
-
status: "completed" | "
|
|
65
|
-
enabled: boolean;
|
|
63
|
+
status: "completed" | "failed" | "running";
|
|
66
64
|
outputSchema: Record<string, unknown>;
|
|
65
|
+
enabled: boolean;
|
|
67
66
|
error?: string | undefined;
|
|
68
|
-
webhookUrl?: string | undefined;
|
|
69
67
|
maxIterations?: number | undefined;
|
|
68
|
+
webhookUrl?: string | undefined;
|
|
70
69
|
result?: unknown;
|
|
71
70
|
iterations?: number | undefined;
|
|
72
71
|
} | undefined;
|
|
72
|
+
skillsDirectory?: string | undefined;
|
|
73
73
|
}, {
|
|
74
74
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
75
75
|
approvalWebhook?: string | undefined;
|
|
76
|
-
skillsDirectory?: string | undefined;
|
|
77
|
-
maxContextChars?: number | undefined;
|
|
78
76
|
task?: {
|
|
79
|
-
status: "completed" | "
|
|
80
|
-
enabled: boolean;
|
|
77
|
+
status: "completed" | "failed" | "running";
|
|
81
78
|
outputSchema: Record<string, unknown>;
|
|
79
|
+
enabled: boolean;
|
|
82
80
|
error?: string | undefined;
|
|
83
|
-
webhookUrl?: string | undefined;
|
|
84
81
|
maxIterations?: number | undefined;
|
|
82
|
+
webhookUrl?: string | undefined;
|
|
85
83
|
result?: unknown;
|
|
86
84
|
iterations?: number | undefined;
|
|
87
85
|
} | undefined;
|
|
86
|
+
skillsDirectory?: string | undefined;
|
|
87
|
+
maxContextChars?: number | undefined;
|
|
88
88
|
}>;
|
|
89
89
|
declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
90
90
|
defaultModel: z.ZodDefault<z.ZodString>;
|
|
@@ -179,6 +179,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
179
179
|
exclude?: string[] | undefined;
|
|
180
180
|
}>>;
|
|
181
181
|
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
defaultModel: string;
|
|
182
183
|
toolApprovals: {
|
|
183
184
|
bash: boolean;
|
|
184
185
|
write_file: boolean;
|
|
@@ -186,7 +187,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
186
187
|
load_skill: boolean;
|
|
187
188
|
todo: boolean;
|
|
188
189
|
};
|
|
189
|
-
defaultModel: string;
|
|
190
190
|
skills: {
|
|
191
191
|
directory: string;
|
|
192
192
|
additionalDirectories: string[];
|
|
@@ -217,6 +217,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
217
217
|
namespace?: string | undefined;
|
|
218
218
|
} | undefined;
|
|
219
219
|
}, {
|
|
220
|
+
defaultModel?: string | undefined;
|
|
220
221
|
workingDirectory?: string | undefined;
|
|
221
222
|
toolApprovals?: {
|
|
222
223
|
bash?: boolean | undefined;
|
|
@@ -226,7 +227,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
226
227
|
todo?: boolean | undefined;
|
|
227
228
|
} | undefined;
|
|
228
229
|
approvalWebhook?: string | undefined;
|
|
229
|
-
defaultModel?: string | undefined;
|
|
230
230
|
skills?: {
|
|
231
231
|
directory?: string | undefined;
|
|
232
232
|
additionalDirectories?: string[] | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as ResolvedConfig } from './index-
|
|
2
|
-
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-
|
|
1
|
+
import { R as ResolvedConfig } from './index-Dm6wGcYv.js';
|
|
2
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-Dm6wGcYv.js';
|
|
3
3
|
export { ServerOptions, createApp, startServer, stopServer } from './server/index.js';
|
|
4
4
|
export { checkpointQueries, closeDatabase, fileBackupQueries, getDb, initDatabase, messageQueries, sessionQueries, skillQueries, todoQueries, toolExecutionQueries } from './db/index.js';
|
|
5
|
-
import { F as FileBackup, C as Checkpoint } from './schema-
|
|
6
|
-
export { a as Message, M as ModelMessage, S as Session, q as SessionConfig, f as Terminal, T as TodoItem, b as ToolExecution } from './schema-
|
|
5
|
+
import { F as FileBackup, C as Checkpoint } from './schema-XcP0dedO.js';
|
|
6
|
+
export { a as Message, M as ModelMessage, S as Session, q as SessionConfig, f as Terminal, T as TodoItem, b as ToolExecution } from './schema-XcP0dedO.js';
|
|
7
7
|
export { createLoadSkillTool, createReadFileTool, createTodoTool, createTools } from './tools/index.js';
|
|
8
|
-
export { c as createBashTool, a as createWriteFileTool } from './search-
|
|
8
|
+
export { c as createBashTool, a as createWriteFileTool } from './search-CCffrVJE.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'hono/types';
|
package/dist/index.js
CHANGED
|
@@ -1858,10 +1858,6 @@ var init_stream_proxy = __esm({
|
|
|
1858
1858
|
console.log(`[BROWSER-WS] Connected to ${url} (after ${this.reconnectAttempts} retries)`);
|
|
1859
1859
|
this.reconnectAttempts = 0;
|
|
1860
1860
|
this._connected = true;
|
|
1861
|
-
this.emit("status", {
|
|
1862
|
-
connected: true,
|
|
1863
|
-
screencasting: true
|
|
1864
|
-
});
|
|
1865
1861
|
});
|
|
1866
1862
|
this.ws.on("message", (raw) => {
|
|
1867
1863
|
try {
|
|
@@ -1947,6 +1943,17 @@ var init_stream_proxy = __esm({
|
|
|
1947
1943
|
this.ws.send(JSON.stringify(event));
|
|
1948
1944
|
}
|
|
1949
1945
|
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Ask the StreamServer to send its current status (triggers sendStatus and
|
|
1948
|
+
* re-evaluates screencasting). Useful when listeners are replaced on a new
|
|
1949
|
+
* stream and we want a fresh status event.
|
|
1950
|
+
*/
|
|
1951
|
+
requestStatus() {
|
|
1952
|
+
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
1953
|
+
console.log(`[BROWSER-WS] Requesting fresh status from StreamServer`);
|
|
1954
|
+
this.ws.send(JSON.stringify({ type: "status" }));
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1950
1957
|
destroy() {
|
|
1951
1958
|
console.log(`[BROWSER-WS] Destroying proxy for port ${this.port} (emitted ${this.frameCount} frames, throttled ${this.throttledCount})`);
|
|
1952
1959
|
this.destroyed = true;
|
|
@@ -8507,37 +8514,40 @@ ${prompt}` });
|
|
|
8507
8514
|
recorder.start();
|
|
8508
8515
|
sessionRecorders.set(sessionId, recorder);
|
|
8509
8516
|
}
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8517
|
+
const oldFrameListeners = proxy.listenerCount("frame");
|
|
8518
|
+
if (oldFrameListeners > 0) {
|
|
8519
|
+
console.log(`[BROWSER-STREAM:${streamId}] Replacing ${oldFrameListeners} stale frame listener(s) from previous stream`);
|
|
8520
|
+
proxy.removeAllListeners("frame");
|
|
8521
|
+
proxy.removeAllListeners("status");
|
|
8522
|
+
}
|
|
8523
|
+
console.log(`[BROWSER-STREAM:${streamId}] Attaching frame+status listeners to proxy`);
|
|
8524
|
+
proxy.on("frame", (frame) => {
|
|
8525
|
+
sseBrowserFrameCount++;
|
|
8526
|
+
if (sseBrowserFrameCount === 1) {
|
|
8527
|
+
console.log(`[BROWSER-STREAM:${streamId}] First browser frame received! dataSize=${frame.data?.length ?? 0} writerClosed=${writerClosed}`);
|
|
8528
|
+
} else if (sseBrowserFrameCount % 50 === 0) {
|
|
8529
|
+
console.log(`[BROWSER-STREAM:${streamId}] Browser frame #${sseBrowserFrameCount} (writerClosed=${writerClosed})`);
|
|
8530
|
+
}
|
|
8531
|
+
const rec = sessionRecorders.get(sessionId);
|
|
8532
|
+
rec?.addFrame(frame);
|
|
8533
|
+
writeSSE(JSON.stringify({
|
|
8534
|
+
type: "browser-frame",
|
|
8535
|
+
data: frame.data,
|
|
8536
|
+
metadata: frame.metadata
|
|
8537
|
+
})).catch((err) => {
|
|
8538
|
+
console.warn(`[BROWSER-STREAM:${streamId}] Failed to send browser-frame via SSE:`, err);
|
|
8528
8539
|
});
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
});
|
|
8540
|
+
});
|
|
8541
|
+
proxy.on("status", (s) => {
|
|
8542
|
+
console.log(`[BROWSER-STREAM:${streamId}] Browser status event: connected=${s.connected} screencasting=${s.screencasting} viewport=${s.viewportWidth}x${s.viewportHeight}`);
|
|
8543
|
+
writeSSE(JSON.stringify({
|
|
8544
|
+
type: "browser-status",
|
|
8545
|
+
...s
|
|
8546
|
+
})).catch((err) => {
|
|
8547
|
+
console.warn(`[BROWSER-STREAM:${streamId}] Failed to send browser-status via SSE:`, err);
|
|
8537
8548
|
});
|
|
8538
|
-
}
|
|
8539
|
-
|
|
8540
|
-
}
|
|
8549
|
+
});
|
|
8550
|
+
proxy.requestStatus();
|
|
8541
8551
|
}
|
|
8542
8552
|
},
|
|
8543
8553
|
onStepFinish: async () => {
|
|
@@ -9032,37 +9042,40 @@ agents.post(
|
|
|
9032
9042
|
recorder.start();
|
|
9033
9043
|
sessionRecorders.set(session.id, recorder);
|
|
9034
9044
|
}
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9045
|
+
const oldFrameListeners = proxy.listenerCount("frame");
|
|
9046
|
+
if (oldFrameListeners > 0) {
|
|
9047
|
+
console.log(`[BROWSER-STREAM:${streamId}] Replacing ${oldFrameListeners} stale frame listener(s) from previous stream`);
|
|
9048
|
+
proxy.removeAllListeners("frame");
|
|
9049
|
+
proxy.removeAllListeners("status");
|
|
9050
|
+
}
|
|
9051
|
+
console.log(`[BROWSER-STREAM:${streamId}] Attaching frame+status listeners to proxy`);
|
|
9052
|
+
proxy.on("frame", (frame) => {
|
|
9053
|
+
sseBrowserFrameCount++;
|
|
9054
|
+
if (sseBrowserFrameCount === 1) {
|
|
9055
|
+
console.log(`[BROWSER-STREAM:${streamId}] First browser frame received! dataSize=${frame.data?.length ?? 0} writerClosed=${writerClosed}`);
|
|
9056
|
+
} else if (sseBrowserFrameCount % 50 === 0) {
|
|
9057
|
+
console.log(`[BROWSER-STREAM:${streamId}] Browser frame #${sseBrowserFrameCount} (writerClosed=${writerClosed})`);
|
|
9058
|
+
}
|
|
9059
|
+
const rec = sessionRecorders.get(session.id);
|
|
9060
|
+
rec?.addFrame(frame);
|
|
9061
|
+
writeSSE(JSON.stringify({
|
|
9062
|
+
type: "browser-frame",
|
|
9063
|
+
data: frame.data,
|
|
9064
|
+
metadata: frame.metadata
|
|
9065
|
+
})).catch((err) => {
|
|
9066
|
+
console.warn(`[BROWSER-STREAM:${streamId}] Failed to send browser-frame via SSE:`, err);
|
|
9053
9067
|
});
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
});
|
|
9068
|
+
});
|
|
9069
|
+
proxy.on("status", (s) => {
|
|
9070
|
+
console.log(`[BROWSER-STREAM:${streamId}] Browser status event: connected=${s.connected} screencasting=${s.screencasting} viewport=${s.viewportWidth}x${s.viewportHeight}`);
|
|
9071
|
+
writeSSE(JSON.stringify({
|
|
9072
|
+
type: "browser-status",
|
|
9073
|
+
...s
|
|
9074
|
+
})).catch((err) => {
|
|
9075
|
+
console.warn(`[BROWSER-STREAM:${streamId}] Failed to send browser-status via SSE:`, err);
|
|
9062
9076
|
});
|
|
9063
|
-
}
|
|
9064
|
-
|
|
9065
|
-
}
|
|
9077
|
+
});
|
|
9078
|
+
proxy.requestStatus();
|
|
9066
9079
|
}
|
|
9067
9080
|
},
|
|
9068
9081
|
onStepFinish: async () => {
|