sparkecoder 0.1.65 → 0.1.66
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 +31 -28
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +96 -118
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-BhKQYdOx.d.ts → index-Db23cukG.d.ts} +25 -25
- package/dist/index.d.ts +5 -5
- package/dist/index.js +96 -118
- package/dist/index.js.map +1 -1
- package/dist/{schema-XcP0dedO.d.ts → schema-C7Mm4Ykn.d.ts} +3 -3
- package/dist/{search-DkNNtC5A.d.ts → search-CVVfuBPZ.d.ts} +5 -4
- package/dist/server/index.js +96 -118
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.js +16 -11
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- 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.js.nft.json +1 -1
- 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/{2374f_708e1a2e._.js → 2374f_02a118f9._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_3db08933._.js → 2374f_0ed477f8._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_7d957e38._.js → 2374f_12bad06e._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_1225fb9d._.js → 2374f_2526ca80._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_95e53328._.js → 2374f_3b51a934._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_f1f229dd._.js → 2374f_3e519469._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_a19628a3._.js → 2374f_5ebfcf1a._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_a90b70ee._.js → 2374f_a0f483d1._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_2775224f._.js → 2374f_acf3dfe4._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_32fd5733._.js → 2374f_ad08e83a._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_2eac907f._.js → 2374f_c1d54c16._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_51500fd2._.js → 2374f_db3e363b._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_8385a57b._.js → 2374f_f0d7e130._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_6f1ea3a7._.js → 2374f_fc992d90._.js} +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__5bde4c40._.js → [root-of-the-server]__06818a54._.js} +2 -2
- package/web/.next/standalone/web/.next/server/chunks/ssr/{[root-of-the-server]__4085bf35._.js → [root-of-the-server]__c71f29f9._.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/chunks/ssr/web_5cca707f._.js +7 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_935e81f5._.js +7 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/{web_14735895._.js → web_cc5f7515._.js} +2 -2
- 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/4b6a9454bc6460c5.js → standalone/web/.next/static/chunks/31208ade542a0fcb.js} +3 -3
- package/web/.next/{static/chunks/4a490bc538aa0940.js → standalone/web/.next/static/chunks/4e673433173ad456.js} +3 -3
- package/web/.next/standalone/web/.next/static/chunks/{c2dccd8f56d8eb5a.js → 515f0c0bd6087843.js} +5 -5
- package/web/.next/standalone/web/.next/static/chunks/fd39dd62879495e1.css +1 -0
- package/web/.next/standalone/web/.next/static/static/chunks/{4b6a9454bc6460c5.js → 31208ade542a0fcb.js} +3 -3
- package/web/.next/standalone/web/.next/static/static/chunks/{4a490bc538aa0940.js → 4e673433173ad456.js} +3 -3
- package/web/.next/standalone/web/.next/static/static/chunks/{c2dccd8f56d8eb5a.js → 515f0c0bd6087843.js} +5 -5
- package/web/.next/standalone/web/.next/static/static/chunks/fd39dd62879495e1.css +1 -0
- package/web/.next/standalone/web/src/components/chat-interface.tsx +96 -1
- package/web/.next/standalone/web/src/lib/api.ts +24 -0
- package/web/.next/{standalone/web/.next/static/chunks/4b6a9454bc6460c5.js → static/chunks/31208ade542a0fcb.js} +3 -3
- package/web/.next/{standalone/web/.next/static/chunks/4a490bc538aa0940.js → static/chunks/4e673433173ad456.js} +3 -3
- package/web/.next/static/chunks/{c2dccd8f56d8eb5a.js → 515f0c0bd6087843.js} +5 -5
- package/web/.next/static/chunks/fd39dd62879495e1.css +1 -0
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_08bbd8c8._.js +0 -7
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_c729ad51._.js +0 -7
- package/web/.next/standalone/web/.next/static/chunks/8b53c110c5a6f9a0.css +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/8b53c110c5a6f9a0.css +0 -1
- package/web/.next/static/chunks/8b53c110c5a6f9a0.css +0 -1
- /package/web/.next/standalone/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_ssgManifest.js +0 -0
- /package/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_buildManifest.js +0 -0
- /package/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{NuySHGSR0CchKU9zo42LK → UMGGmtMDTCI6fL-AIFkiM}/_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-C7Mm4Ykn.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-C7Mm4Ykn.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-C7Mm4Ykn.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-CVVfuBPZ.js';
|
|
5
5
|
|
|
6
6
|
declare const ToolApprovalConfigSchema: z.ZodObject<{
|
|
7
7
|
bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -37,54 +37,54 @@ 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: "
|
|
41
|
-
outputSchema: Record<string, unknown>;
|
|
40
|
+
status: "running" | "completed" | "failed";
|
|
42
41
|
enabled: boolean;
|
|
43
|
-
|
|
44
|
-
maxIterations?: number | undefined;
|
|
42
|
+
outputSchema: Record<string, unknown>;
|
|
45
43
|
webhookUrl?: string | undefined;
|
|
44
|
+
maxIterations?: number | undefined;
|
|
46
45
|
result?: unknown;
|
|
46
|
+
error?: string | undefined;
|
|
47
47
|
iterations?: number | undefined;
|
|
48
48
|
}, {
|
|
49
|
-
status: "
|
|
50
|
-
outputSchema: Record<string, unknown>;
|
|
49
|
+
status: "running" | "completed" | "failed";
|
|
51
50
|
enabled: boolean;
|
|
52
|
-
|
|
53
|
-
maxIterations?: number | undefined;
|
|
51
|
+
outputSchema: Record<string, unknown>;
|
|
54
52
|
webhookUrl?: string | undefined;
|
|
53
|
+
maxIterations?: number | undefined;
|
|
55
54
|
result?: unknown;
|
|
55
|
+
error?: string | undefined;
|
|
56
56
|
iterations?: number | undefined;
|
|
57
57
|
}>>;
|
|
58
58
|
}, "strip", z.ZodTypeAny, {
|
|
59
59
|
maxContextChars: number;
|
|
60
60
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
61
61
|
approvalWebhook?: string | undefined;
|
|
62
|
+
skillsDirectory?: string | undefined;
|
|
62
63
|
task?: {
|
|
63
|
-
status: "
|
|
64
|
-
outputSchema: Record<string, unknown>;
|
|
64
|
+
status: "running" | "completed" | "failed";
|
|
65
65
|
enabled: boolean;
|
|
66
|
-
|
|
67
|
-
maxIterations?: number | undefined;
|
|
66
|
+
outputSchema: Record<string, unknown>;
|
|
68
67
|
webhookUrl?: string | undefined;
|
|
68
|
+
maxIterations?: number | undefined;
|
|
69
69
|
result?: unknown;
|
|
70
|
+
error?: string | undefined;
|
|
70
71
|
iterations?: number | undefined;
|
|
71
72
|
} | 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;
|
|
76
78
|
task?: {
|
|
77
|
-
status: "
|
|
78
|
-
outputSchema: Record<string, unknown>;
|
|
79
|
+
status: "running" | "completed" | "failed";
|
|
79
80
|
enabled: boolean;
|
|
80
|
-
|
|
81
|
-
maxIterations?: number | undefined;
|
|
81
|
+
outputSchema: Record<string, unknown>;
|
|
82
82
|
webhookUrl?: string | undefined;
|
|
83
|
+
maxIterations?: number | undefined;
|
|
83
84
|
result?: unknown;
|
|
85
|
+
error?: string | undefined;
|
|
84
86
|
iterations?: number | undefined;
|
|
85
87
|
} | 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,7 +179,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
179
179
|
exclude?: string[] | undefined;
|
|
180
180
|
}>>;
|
|
181
181
|
}, "strip", z.ZodTypeAny, {
|
|
182
|
-
defaultModel: string;
|
|
183
182
|
toolApprovals: {
|
|
184
183
|
bash: boolean;
|
|
185
184
|
write_file: boolean;
|
|
@@ -187,6 +186,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
187
186
|
load_skill: boolean;
|
|
188
187
|
todo: boolean;
|
|
189
188
|
};
|
|
189
|
+
defaultModel: string;
|
|
190
190
|
skills: {
|
|
191
191
|
directory: string;
|
|
192
192
|
additionalDirectories: string[];
|
|
@@ -202,8 +202,8 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
202
202
|
publicUrl?: string | undefined;
|
|
203
203
|
};
|
|
204
204
|
databasePath: string;
|
|
205
|
-
workingDirectory?: string | undefined;
|
|
206
205
|
approvalWebhook?: string | undefined;
|
|
206
|
+
workingDirectory?: string | undefined;
|
|
207
207
|
remoteServer?: {
|
|
208
208
|
url?: string | undefined;
|
|
209
209
|
authKey?: string | undefined;
|
|
@@ -217,8 +217,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
217
217
|
namespace?: string | undefined;
|
|
218
218
|
} | undefined;
|
|
219
219
|
}, {
|
|
220
|
-
defaultModel?: string | undefined;
|
|
221
|
-
workingDirectory?: string | undefined;
|
|
222
220
|
toolApprovals?: {
|
|
223
221
|
bash?: boolean | undefined;
|
|
224
222
|
write_file?: boolean | undefined;
|
|
@@ -227,6 +225,8 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
227
225
|
todo?: boolean | undefined;
|
|
228
226
|
} | undefined;
|
|
229
227
|
approvalWebhook?: string | undefined;
|
|
228
|
+
workingDirectory?: 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-Db23cukG.js';
|
|
2
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-Db23cukG.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-C7Mm4Ykn.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-C7Mm4Ykn.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-CVVfuBPZ.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'hono/types';
|
package/dist/index.js
CHANGED
|
@@ -1784,19 +1784,14 @@ __export(stream_proxy_exports, {
|
|
|
1784
1784
|
import WebSocket from "ws";
|
|
1785
1785
|
import { EventEmitter } from "events";
|
|
1786
1786
|
function getOrCreateProxy(sessionId, port) {
|
|
1787
|
-
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
proxy.on("close", () => {
|
|
1796
|
-
activeProxies.delete(sessionId);
|
|
1797
|
-
});
|
|
1798
|
-
proxy.connect();
|
|
1799
|
-
}
|
|
1787
|
+
const existing = activeProxies.get(sessionId);
|
|
1788
|
+
if (existing) return existing;
|
|
1789
|
+
const proxy = new BrowserStreamProxy(port);
|
|
1790
|
+
activeProxies.set(sessionId, proxy);
|
|
1791
|
+
proxy.on("close", () => {
|
|
1792
|
+
activeProxies.delete(sessionId);
|
|
1793
|
+
});
|
|
1794
|
+
proxy.connect();
|
|
1800
1795
|
return proxy;
|
|
1801
1796
|
}
|
|
1802
1797
|
function getProxy(sessionId) {
|
|
@@ -1813,8 +1808,8 @@ var RECONNECT_DELAY_MS, MAX_RECONNECT_ATTEMPTS, FRAME_THROTTLE_MS, BrowserStream
|
|
|
1813
1808
|
var init_stream_proxy = __esm({
|
|
1814
1809
|
"src/browser/stream-proxy.ts"() {
|
|
1815
1810
|
"use strict";
|
|
1816
|
-
RECONNECT_DELAY_MS =
|
|
1817
|
-
MAX_RECONNECT_ATTEMPTS =
|
|
1811
|
+
RECONNECT_DELAY_MS = 1e3;
|
|
1812
|
+
MAX_RECONNECT_ATTEMPTS = 20;
|
|
1818
1813
|
FRAME_THROTTLE_MS = 100;
|
|
1819
1814
|
BrowserStreamProxy = class extends EventEmitter {
|
|
1820
1815
|
ws = null;
|
|
@@ -1864,8 +1859,11 @@ var init_stream_proxy = __esm({
|
|
|
1864
1859
|
}
|
|
1865
1860
|
});
|
|
1866
1861
|
this.ws.on("close", () => {
|
|
1862
|
+
const wasConnected = this._connected;
|
|
1867
1863
|
this._connected = false;
|
|
1868
|
-
|
|
1864
|
+
if (wasConnected) {
|
|
1865
|
+
this.emit("status", { connected: false, screencasting: false });
|
|
1866
|
+
}
|
|
1869
1867
|
if (!this.destroyed) {
|
|
1870
1868
|
this.scheduleReconnect();
|
|
1871
1869
|
}
|
|
@@ -1907,7 +1905,7 @@ var init_stream_proxy = __esm({
|
|
|
1907
1905
|
return;
|
|
1908
1906
|
}
|
|
1909
1907
|
this.reconnectAttempts++;
|
|
1910
|
-
const delay = RECONNECT_DELAY_MS * this.reconnectAttempts;
|
|
1908
|
+
const delay = this.reconnectAttempts <= 5 ? RECONNECT_DELAY_MS : RECONNECT_DELAY_MS * (this.reconnectAttempts - 4);
|
|
1911
1909
|
this.reconnectTimer = setTimeout(() => this.doConnect(), delay);
|
|
1912
1910
|
}
|
|
1913
1911
|
/**
|
|
@@ -2612,15 +2610,15 @@ function getBrowserStreamPort(sessionId) {
|
|
|
2612
2610
|
}
|
|
2613
2611
|
return port;
|
|
2614
2612
|
}
|
|
2615
|
-
function
|
|
2616
|
-
return /\bagent-browser\
|
|
2613
|
+
function hasAgentBrowserCommand(command) {
|
|
2614
|
+
return /\bagent-browser\b/.test(command);
|
|
2617
2615
|
}
|
|
2618
2616
|
function isAgentBrowserCloseCommand(command) {
|
|
2619
|
-
return /\bagent-browser\s+close\b/.test(command);
|
|
2617
|
+
return /\bagent-browser\s+(close|close\s+--all)\b/.test(command);
|
|
2620
2618
|
}
|
|
2621
2619
|
function injectBrowserStreamPort(command, port) {
|
|
2622
2620
|
return command.replace(
|
|
2623
|
-
/\bagent-browser\b
|
|
2621
|
+
/\bagent-browser\b/g,
|
|
2624
2622
|
`AGENT_BROWSER_STREAM_PORT=${port} agent-browser`
|
|
2625
2623
|
);
|
|
2626
2624
|
}
|
|
@@ -2790,12 +2788,14 @@ Terminal output is stored in the global SparkECoder data directory. Use the \`ta
|
|
|
2790
2788
|
};
|
|
2791
2789
|
}
|
|
2792
2790
|
let actualCommand = command;
|
|
2793
|
-
const
|
|
2791
|
+
const hasAgentBrowser = hasAgentBrowserCommand(command);
|
|
2794
2792
|
const browserClose = isAgentBrowserCloseCommand(command);
|
|
2795
2793
|
let browserPort;
|
|
2796
|
-
if (
|
|
2794
|
+
if (hasAgentBrowser) {
|
|
2797
2795
|
browserPort = getBrowserStreamPort(options.sessionId);
|
|
2798
|
-
|
|
2796
|
+
if (!browserClose) {
|
|
2797
|
+
actualCommand = injectBrowserStreamPort(command, browserPort);
|
|
2798
|
+
}
|
|
2799
2799
|
}
|
|
2800
2800
|
const canUseTmux = await shouldUseTmux();
|
|
2801
2801
|
if (background) {
|
|
@@ -2811,9 +2811,6 @@ Terminal output is stored in the global SparkECoder data directory. Use the \`ta
|
|
|
2811
2811
|
sessionId: options.sessionId,
|
|
2812
2812
|
terminalId
|
|
2813
2813
|
});
|
|
2814
|
-
if (browserOpen && browserPort) {
|
|
2815
|
-
options.onProgress?.({ terminalId, status: "running", command, browserStreamPort: browserPort });
|
|
2816
|
-
}
|
|
2817
2814
|
return {
|
|
2818
2815
|
success: true,
|
|
2819
2816
|
id: result.id,
|
|
@@ -2832,7 +2829,13 @@ Terminal output is stored in the global SparkECoder data directory. Use the \`ta
|
|
|
2832
2829
|
});
|
|
2833
2830
|
const truncatedOutput = truncateOutput(result.output, MAX_OUTPUT_CHARS2);
|
|
2834
2831
|
options.onOutput?.(truncatedOutput);
|
|
2835
|
-
options.onProgress?.({
|
|
2832
|
+
options.onProgress?.({
|
|
2833
|
+
terminalId,
|
|
2834
|
+
status: "completed",
|
|
2835
|
+
command,
|
|
2836
|
+
browserStreamPort: browserPort,
|
|
2837
|
+
browserClosed: browserClose || void 0
|
|
2838
|
+
});
|
|
2836
2839
|
return {
|
|
2837
2840
|
success: result.exitCode === 0,
|
|
2838
2841
|
id: result.id,
|
|
@@ -8097,42 +8100,6 @@ function enrichPromptWithDevtoolsContext(sessionId, prompt) {
|
|
|
8097
8100
|
|
|
8098
8101
|
${prompt}`;
|
|
8099
8102
|
}
|
|
8100
|
-
async function encodAndUploadRecording(sessionId, recorder) {
|
|
8101
|
-
if (!isRemoteConfigured()) {
|
|
8102
|
-
console.log("[RECORDING] Remote server not configured, skipping upload");
|
|
8103
|
-
recorder.clear();
|
|
8104
|
-
return;
|
|
8105
|
-
}
|
|
8106
|
-
console.log(`[RECORDING] Encoding ${recorder.frameCount} frames for session ${sessionId}...`);
|
|
8107
|
-
const result = await recorder.encode();
|
|
8108
|
-
recorder.clear();
|
|
8109
|
-
if (!result) {
|
|
8110
|
-
console.log("[RECORDING] Encoding failed or produced no output");
|
|
8111
|
-
return;
|
|
8112
|
-
}
|
|
8113
|
-
try {
|
|
8114
|
-
const { storageQueries: storageQueries2 } = await Promise.resolve().then(() => (init_remote(), remote_exports));
|
|
8115
|
-
const { readFile: readFile11, unlink: unlink3 } = await import("fs/promises");
|
|
8116
|
-
const uploadInfo = await storageQueries2.getUploadUrl(
|
|
8117
|
-
sessionId,
|
|
8118
|
-
`browser-recording-${Date.now()}.mp4`,
|
|
8119
|
-
"video/mp4",
|
|
8120
|
-
"browser-recording"
|
|
8121
|
-
);
|
|
8122
|
-
const fileData = await readFile11(result.path);
|
|
8123
|
-
await fetch(uploadInfo.uploadUrl, {
|
|
8124
|
-
method: "PUT",
|
|
8125
|
-
headers: { "Content-Type": "video/mp4" },
|
|
8126
|
-
body: fileData
|
|
8127
|
-
});
|
|
8128
|
-
await storageQueries2.updateFile(uploadInfo.fileId, { sizeBytes: result.sizeBytes });
|
|
8129
|
-
console.log(`[RECORDING] Uploaded recording for session ${sessionId} (${result.sizeBytes} bytes)`);
|
|
8130
|
-
await unlink3(result.path).catch(() => {
|
|
8131
|
-
});
|
|
8132
|
-
} catch (err) {
|
|
8133
|
-
console.error("[RECORDING] Upload failed:", err.message);
|
|
8134
|
-
}
|
|
8135
|
-
}
|
|
8136
8103
|
var agents = new Hono2();
|
|
8137
8104
|
var attachmentSchema = z16.object({
|
|
8138
8105
|
type: z16.enum(["image", "file"]),
|
|
@@ -8347,30 +8314,38 @@ ${prompt}` });
|
|
|
8347
8314
|
await new Promise((resolve11) => setTimeout(resolve11, 0));
|
|
8348
8315
|
}
|
|
8349
8316
|
const browserPort = progress.data?.browserStreamPort;
|
|
8350
|
-
|
|
8317
|
+
const browserClosed = progress.data?.browserClosed;
|
|
8318
|
+
if (progress.toolName === "bash" && browserClosed) {
|
|
8319
|
+
console.log(`[BROWSER-STREAM] agent-browser close detected, destroying proxy`);
|
|
8320
|
+
destroyProxy(sessionId);
|
|
8321
|
+
} else if (progress.toolName === "bash" && browserPort) {
|
|
8322
|
+
console.log(`[BROWSER-STREAM] agent-browser command detected, ensuring proxy on port ${browserPort}`);
|
|
8351
8323
|
const proxy = getOrCreateProxy(sessionId, browserPort);
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
recorder = new FrameRecorder(sessionId);
|
|
8324
|
+
if (!sessionRecorders.has(sessionId)) {
|
|
8325
|
+
const recorder = new FrameRecorder(sessionId);
|
|
8355
8326
|
recorder.start();
|
|
8356
8327
|
sessionRecorders.set(sessionId, recorder);
|
|
8357
8328
|
}
|
|
8358
|
-
proxy.
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8329
|
+
if (proxy.listenerCount("frame") === 0) {
|
|
8330
|
+
proxy.on("frame", (frame) => {
|
|
8331
|
+
const rec = sessionRecorders.get(sessionId);
|
|
8332
|
+
rec?.addFrame(frame);
|
|
8333
|
+
writeSSE(JSON.stringify({
|
|
8334
|
+
type: "browser-frame",
|
|
8335
|
+
data: frame.data,
|
|
8336
|
+
metadata: frame.metadata
|
|
8337
|
+
})).catch(() => {
|
|
8338
|
+
});
|
|
8365
8339
|
});
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8340
|
+
proxy.on("status", (s) => {
|
|
8341
|
+
console.log(`[BROWSER-STREAM] Status:`, s);
|
|
8342
|
+
writeSSE(JSON.stringify({
|
|
8343
|
+
type: "browser-status",
|
|
8344
|
+
...s
|
|
8345
|
+
})).catch(() => {
|
|
8346
|
+
});
|
|
8372
8347
|
});
|
|
8373
|
-
}
|
|
8348
|
+
}
|
|
8374
8349
|
}
|
|
8375
8350
|
},
|
|
8376
8351
|
onStepFinish: async () => {
|
|
@@ -8482,15 +8457,6 @@ ${prompt}` });
|
|
|
8482
8457
|
}
|
|
8483
8458
|
} finally {
|
|
8484
8459
|
cleanupAbortController();
|
|
8485
|
-
destroyProxy(sessionId);
|
|
8486
|
-
const recorder = sessionRecorders.get(sessionId);
|
|
8487
|
-
if (recorder && recorder.frameCount > 0) {
|
|
8488
|
-
sessionRecorders.delete(sessionId);
|
|
8489
|
-
recorder.stop();
|
|
8490
|
-
encodAndUploadRecording(sessionId, recorder).catch((err) => {
|
|
8491
|
-
console.error("[RECORDING] Failed to encode/upload:", err.message);
|
|
8492
|
-
});
|
|
8493
|
-
}
|
|
8494
8460
|
await writeSSE("[DONE]");
|
|
8495
8461
|
await safeClose();
|
|
8496
8462
|
}
|
|
@@ -8846,30 +8812,38 @@ agents.post(
|
|
|
8846
8812
|
await new Promise((resolve11) => setTimeout(resolve11, 0));
|
|
8847
8813
|
}
|
|
8848
8814
|
const browserPort = progress.data?.browserStreamPort;
|
|
8849
|
-
|
|
8815
|
+
const browserClosed = progress.data?.browserClosed;
|
|
8816
|
+
if (progress.toolName === "bash" && browserClosed) {
|
|
8817
|
+
console.log(`[BROWSER-STREAM] agent-browser close detected`);
|
|
8818
|
+
destroyProxy(session.id);
|
|
8819
|
+
} else if (progress.toolName === "bash" && browserPort) {
|
|
8820
|
+
console.log(`[BROWSER-STREAM] agent-browser command detected, port ${browserPort}`);
|
|
8850
8821
|
const proxy = getOrCreateProxy(session.id, browserPort);
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
recorder = new FrameRecorder(session.id);
|
|
8822
|
+
if (!sessionRecorders.has(session.id)) {
|
|
8823
|
+
const recorder = new FrameRecorder(session.id);
|
|
8854
8824
|
recorder.start();
|
|
8855
8825
|
sessionRecorders.set(session.id, recorder);
|
|
8856
8826
|
}
|
|
8857
|
-
proxy.
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
|
|
8827
|
+
if (proxy.listenerCount("frame") === 0) {
|
|
8828
|
+
proxy.on("frame", (frame) => {
|
|
8829
|
+
const rec = sessionRecorders.get(session.id);
|
|
8830
|
+
rec?.addFrame(frame);
|
|
8831
|
+
writeSSE(JSON.stringify({
|
|
8832
|
+
type: "browser-frame",
|
|
8833
|
+
data: frame.data,
|
|
8834
|
+
metadata: frame.metadata
|
|
8835
|
+
})).catch(() => {
|
|
8836
|
+
});
|
|
8864
8837
|
});
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8838
|
+
proxy.on("status", (s) => {
|
|
8839
|
+
console.log(`[BROWSER-STREAM] Status:`, s);
|
|
8840
|
+
writeSSE(JSON.stringify({
|
|
8841
|
+
type: "browser-status",
|
|
8842
|
+
...s
|
|
8843
|
+
})).catch(() => {
|
|
8844
|
+
});
|
|
8871
8845
|
});
|
|
8872
|
-
}
|
|
8846
|
+
}
|
|
8873
8847
|
}
|
|
8874
8848
|
},
|
|
8875
8849
|
onStepFinish: async () => {
|
|
@@ -8975,15 +8949,6 @@ agents.post(
|
|
|
8975
8949
|
}
|
|
8976
8950
|
} finally {
|
|
8977
8951
|
cleanupAbortController();
|
|
8978
|
-
destroyProxy(session.id);
|
|
8979
|
-
const recorder = sessionRecorders.get(session.id);
|
|
8980
|
-
if (recorder && recorder.frameCount > 0) {
|
|
8981
|
-
sessionRecorders.delete(session.id);
|
|
8982
|
-
recorder.stop();
|
|
8983
|
-
encodAndUploadRecording(session.id, recorder).catch((err) => {
|
|
8984
|
-
console.error("[RECORDING] Failed to encode/upload:", err.message);
|
|
8985
|
-
});
|
|
8986
|
-
}
|
|
8987
8952
|
await writeSSE("[DONE]");
|
|
8988
8953
|
await safeClose();
|
|
8989
8954
|
}
|
|
@@ -9043,6 +9008,19 @@ agents.post(
|
|
|
9043
9008
|
return c.json({ success: true });
|
|
9044
9009
|
}
|
|
9045
9010
|
);
|
|
9011
|
+
agents.get("/:id/browser-stream", async (c) => {
|
|
9012
|
+
const sessionId = c.req.param("id");
|
|
9013
|
+
const proxy = getProxy(sessionId);
|
|
9014
|
+
return c.json({
|
|
9015
|
+
sessionId,
|
|
9016
|
+
active: !!proxy?.connected,
|
|
9017
|
+
hasProxy: !!proxy,
|
|
9018
|
+
latestFrame: proxy?.latestFrame ? {
|
|
9019
|
+
metadata: proxy.latestFrame.metadata,
|
|
9020
|
+
timestamp: proxy.latestFrame.timestamp
|
|
9021
|
+
} : null
|
|
9022
|
+
});
|
|
9023
|
+
});
|
|
9046
9024
|
|
|
9047
9025
|
// src/server/routes/health.ts
|
|
9048
9026
|
init_config();
|