sparkecoder 0.1.139 → 0.1.140
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 +107 -6
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +114 -6
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-BAsQWqZj.d.ts → index-Cl_eUatM.d.ts} +96 -96
- package/dist/index.d.ts +5 -5
- package/dist/index.js +114 -6
- package/dist/index.js.map +1 -1
- package/dist/{schema-Dz-wABVY.d.ts → schema-BSz4MzhJ.d.ts} +3 -3
- package/dist/{search-CVVfuBPZ.d.ts → search-DOzC4ojH.d.ts} +4 -4
- package/dist/server/index.js +114 -6
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +3 -3
- 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/_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.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
- 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/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
- 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.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- 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/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
- 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 +1 -1
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +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/standalone/web/runtime-config.json +2 -2
- /package/web/.next/standalone/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_ssgManifest.js +0 -0
- /package/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_buildManifest.js +0 -0
- /package/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rY6TfiRfMLnxUYYyNit1Q → QkKMkVPV-LLRD2i9PBP_Y}/_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, s as TaskMcpServerSummary, t as TaskSkillSummary, U as UserContentPart, u as UserFilePart, v as UserImagePart, w as UserModelMessage, x 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-BSz4MzhJ.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, s as TaskMcpServerSummary, t as TaskSkillSummary, U as UserContentPart, u as UserFilePart, v as UserImagePart, w as UserModelMessage, x as UserTextPart } from '../schema-BSz4MzhJ.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-BSz4MzhJ.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-DOzC4ojH.js';
|
|
5
5
|
|
|
6
6
|
declare const ToolApprovalConfigSchema: z.ZodObject<{
|
|
7
7
|
bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -39,25 +39,25 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
39
39
|
iterations: z.ZodOptional<z.ZodNumber>;
|
|
40
40
|
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
status: "
|
|
42
|
+
status: "completed" | "failed" | "running";
|
|
43
43
|
enabled: boolean;
|
|
44
44
|
outputSchema: Record<string, unknown>;
|
|
45
|
-
|
|
45
|
+
error?: string | undefined;
|
|
46
46
|
maxIterations?: number | undefined;
|
|
47
|
+
webhookUrl?: string | undefined;
|
|
48
|
+
parentTaskId?: string | undefined;
|
|
47
49
|
result?: unknown;
|
|
48
|
-
error?: string | undefined;
|
|
49
50
|
iterations?: number | undefined;
|
|
50
|
-
parentTaskId?: string | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
status: "
|
|
52
|
+
status: "completed" | "failed" | "running";
|
|
53
53
|
enabled: boolean;
|
|
54
54
|
outputSchema: Record<string, unknown>;
|
|
55
|
-
|
|
55
|
+
error?: string | undefined;
|
|
56
56
|
maxIterations?: number | undefined;
|
|
57
|
+
webhookUrl?: string | undefined;
|
|
58
|
+
parentTaskId?: string | undefined;
|
|
57
59
|
result?: unknown;
|
|
58
|
-
error?: string | undefined;
|
|
59
60
|
iterations?: number | undefined;
|
|
60
|
-
parentTaskId?: string | undefined;
|
|
61
61
|
}>>;
|
|
62
62
|
role: z.ZodOptional<z.ZodEnum<["orchestrator", "worker", "chat"]>>;
|
|
63
63
|
personality: z.ZodOptional<z.ZodString>;
|
|
@@ -88,17 +88,17 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
88
88
|
enabled: boolean;
|
|
89
89
|
id: string;
|
|
90
90
|
name: string;
|
|
91
|
-
cron: string;
|
|
92
|
-
prompt: string;
|
|
93
91
|
createdAt: string;
|
|
92
|
+
prompt: string;
|
|
93
|
+
cron: string;
|
|
94
94
|
replyChannel?: string | undefined;
|
|
95
95
|
lastFiredAt?: string | undefined;
|
|
96
96
|
}, {
|
|
97
97
|
id: string;
|
|
98
98
|
name: string;
|
|
99
|
-
cron: string;
|
|
100
|
-
prompt: string;
|
|
101
99
|
createdAt: string;
|
|
100
|
+
prompt: string;
|
|
101
|
+
cron: string;
|
|
102
102
|
enabled?: boolean | undefined;
|
|
103
103
|
replyChannel?: string | undefined;
|
|
104
104
|
lastFiredAt?: string | undefined;
|
|
@@ -113,19 +113,19 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
113
113
|
lastHitAt: z.ZodOptional<z.ZodString>;
|
|
114
114
|
createdAt: z.ZodString;
|
|
115
115
|
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
token: string;
|
|
116
117
|
id: string;
|
|
117
118
|
name: string;
|
|
118
119
|
createdAt: string;
|
|
119
|
-
token: string;
|
|
120
120
|
wake: "now" | "next";
|
|
121
121
|
hitCount: number;
|
|
122
122
|
template?: string | undefined;
|
|
123
123
|
lastHitAt?: string | undefined;
|
|
124
124
|
}, {
|
|
125
|
+
token: string;
|
|
125
126
|
id: string;
|
|
126
127
|
name: string;
|
|
127
128
|
createdAt: string;
|
|
128
|
-
token: string;
|
|
129
129
|
wake?: "now" | "next" | undefined;
|
|
130
130
|
template?: string | undefined;
|
|
131
131
|
hitCount?: number | undefined;
|
|
@@ -135,90 +135,90 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
135
135
|
maxContextChars: number;
|
|
136
136
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
137
137
|
approvalWebhook?: string | undefined;
|
|
138
|
-
|
|
138
|
+
webhooks?: {
|
|
139
|
+
token: string;
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
wake: "now" | "next";
|
|
144
|
+
hitCount: number;
|
|
145
|
+
template?: string | undefined;
|
|
146
|
+
lastHitAt?: string | undefined;
|
|
147
|
+
}[] | undefined;
|
|
148
|
+
slack?: {
|
|
149
|
+
channel?: string | undefined;
|
|
150
|
+
threadTs?: string | undefined;
|
|
151
|
+
teamId?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
139
153
|
task?: {
|
|
140
|
-
status: "
|
|
154
|
+
status: "completed" | "failed" | "running";
|
|
141
155
|
enabled: boolean;
|
|
142
156
|
outputSchema: Record<string, unknown>;
|
|
143
|
-
|
|
157
|
+
error?: string | undefined;
|
|
144
158
|
maxIterations?: number | undefined;
|
|
159
|
+
webhookUrl?: string | undefined;
|
|
160
|
+
parentTaskId?: string | undefined;
|
|
145
161
|
result?: unknown;
|
|
146
|
-
error?: string | undefined;
|
|
147
162
|
iterations?: number | undefined;
|
|
148
|
-
parentTaskId?: string | undefined;
|
|
149
163
|
} | undefined;
|
|
164
|
+
skillsDirectory?: string | undefined;
|
|
150
165
|
role?: "orchestrator" | "worker" | "chat" | undefined;
|
|
151
166
|
personality?: string | undefined;
|
|
152
167
|
orchestratorSessionId?: string | undefined;
|
|
153
|
-
slack?: {
|
|
154
|
-
channel?: string | undefined;
|
|
155
|
-
threadTs?: string | undefined;
|
|
156
|
-
teamId?: string | undefined;
|
|
157
|
-
} | undefined;
|
|
158
168
|
schedules?: {
|
|
159
169
|
enabled: boolean;
|
|
160
170
|
id: string;
|
|
161
171
|
name: string;
|
|
162
|
-
cron: string;
|
|
163
|
-
prompt: string;
|
|
164
172
|
createdAt: string;
|
|
173
|
+
prompt: string;
|
|
174
|
+
cron: string;
|
|
165
175
|
replyChannel?: string | undefined;
|
|
166
176
|
lastFiredAt?: string | undefined;
|
|
167
177
|
}[] | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
toolApprovals?: Record<string, boolean> | undefined;
|
|
180
|
+
approvalWebhook?: string | undefined;
|
|
168
181
|
webhooks?: {
|
|
182
|
+
token: string;
|
|
169
183
|
id: string;
|
|
170
184
|
name: string;
|
|
171
185
|
createdAt: string;
|
|
172
|
-
|
|
173
|
-
wake: "now" | "next";
|
|
174
|
-
hitCount: number;
|
|
186
|
+
wake?: "now" | "next" | undefined;
|
|
175
187
|
template?: string | undefined;
|
|
188
|
+
hitCount?: number | undefined;
|
|
176
189
|
lastHitAt?: string | undefined;
|
|
177
190
|
}[] | undefined;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
191
|
+
slack?: {
|
|
192
|
+
channel?: string | undefined;
|
|
193
|
+
threadTs?: string | undefined;
|
|
194
|
+
teamId?: string | undefined;
|
|
195
|
+
} | undefined;
|
|
183
196
|
task?: {
|
|
184
|
-
status: "
|
|
197
|
+
status: "completed" | "failed" | "running";
|
|
185
198
|
enabled: boolean;
|
|
186
199
|
outputSchema: Record<string, unknown>;
|
|
187
|
-
|
|
200
|
+
error?: string | undefined;
|
|
188
201
|
maxIterations?: number | undefined;
|
|
202
|
+
webhookUrl?: string | undefined;
|
|
203
|
+
parentTaskId?: string | undefined;
|
|
189
204
|
result?: unknown;
|
|
190
|
-
error?: string | undefined;
|
|
191
205
|
iterations?: number | undefined;
|
|
192
|
-
parentTaskId?: string | undefined;
|
|
193
206
|
} | undefined;
|
|
207
|
+
skillsDirectory?: string | undefined;
|
|
208
|
+
maxContextChars?: number | undefined;
|
|
194
209
|
role?: "orchestrator" | "worker" | "chat" | undefined;
|
|
195
210
|
personality?: string | undefined;
|
|
196
211
|
orchestratorSessionId?: string | undefined;
|
|
197
|
-
slack?: {
|
|
198
|
-
channel?: string | undefined;
|
|
199
|
-
threadTs?: string | undefined;
|
|
200
|
-
teamId?: string | undefined;
|
|
201
|
-
} | undefined;
|
|
202
212
|
schedules?: {
|
|
203
213
|
id: string;
|
|
204
214
|
name: string;
|
|
205
|
-
cron: string;
|
|
206
|
-
prompt: string;
|
|
207
215
|
createdAt: string;
|
|
216
|
+
prompt: string;
|
|
217
|
+
cron: string;
|
|
208
218
|
enabled?: boolean | undefined;
|
|
209
219
|
replyChannel?: string | undefined;
|
|
210
220
|
lastFiredAt?: string | undefined;
|
|
211
221
|
}[] | undefined;
|
|
212
|
-
webhooks?: {
|
|
213
|
-
id: string;
|
|
214
|
-
name: string;
|
|
215
|
-
createdAt: string;
|
|
216
|
-
token: string;
|
|
217
|
-
wake?: "now" | "next" | undefined;
|
|
218
|
-
template?: string | undefined;
|
|
219
|
-
hitCount?: number | undefined;
|
|
220
|
-
lastHitAt?: string | undefined;
|
|
221
|
-
}[] | undefined;
|
|
222
222
|
}>;
|
|
223
223
|
declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
224
224
|
defaultModel: z.ZodDefault<z.ZodString>;
|
|
@@ -397,12 +397,12 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
397
397
|
enabled: boolean;
|
|
398
398
|
id: string;
|
|
399
399
|
name: string;
|
|
400
|
-
createdAt: string;
|
|
401
400
|
transport: "http" | "sse" | "stdio";
|
|
402
|
-
|
|
401
|
+
createdAt: string;
|
|
403
402
|
url?: string | undefined;
|
|
404
403
|
headers?: Record<string, string> | undefined;
|
|
405
404
|
command?: string | undefined;
|
|
405
|
+
args?: string[] | undefined;
|
|
406
406
|
oauth?: {
|
|
407
407
|
authorizationUrl?: string | undefined;
|
|
408
408
|
tokenUrl?: string | undefined;
|
|
@@ -415,13 +415,13 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
415
415
|
}, {
|
|
416
416
|
id: string;
|
|
417
417
|
name: string;
|
|
418
|
-
createdAt: string;
|
|
419
418
|
transport: "http" | "sse" | "stdio";
|
|
419
|
+
createdAt: string;
|
|
420
420
|
enabled?: boolean | undefined;
|
|
421
|
-
args?: string[] | undefined;
|
|
422
421
|
url?: string | undefined;
|
|
423
422
|
headers?: Record<string, string> | undefined;
|
|
424
423
|
command?: string | undefined;
|
|
424
|
+
args?: string[] | undefined;
|
|
425
425
|
oauth?: {
|
|
426
426
|
authorizationUrl?: string | undefined;
|
|
427
427
|
tokenUrl?: string | undefined;
|
|
@@ -437,12 +437,12 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
437
437
|
enabled: boolean;
|
|
438
438
|
id: string;
|
|
439
439
|
name: string;
|
|
440
|
-
createdAt: string;
|
|
441
440
|
transport: "http" | "sse" | "stdio";
|
|
442
|
-
|
|
441
|
+
createdAt: string;
|
|
443
442
|
url?: string | undefined;
|
|
444
443
|
headers?: Record<string, string> | undefined;
|
|
445
444
|
command?: string | undefined;
|
|
445
|
+
args?: string[] | undefined;
|
|
446
446
|
oauth?: {
|
|
447
447
|
authorizationUrl?: string | undefined;
|
|
448
448
|
tokenUrl?: string | undefined;
|
|
@@ -457,13 +457,13 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
457
457
|
servers?: {
|
|
458
458
|
id: string;
|
|
459
459
|
name: string;
|
|
460
|
-
createdAt: string;
|
|
461
460
|
transport: "http" | "sse" | "stdio";
|
|
461
|
+
createdAt: string;
|
|
462
462
|
enabled?: boolean | undefined;
|
|
463
|
-
args?: string[] | undefined;
|
|
464
463
|
url?: string | undefined;
|
|
465
464
|
headers?: Record<string, string> | undefined;
|
|
466
465
|
command?: string | undefined;
|
|
466
|
+
args?: string[] | undefined;
|
|
467
467
|
oauth?: {
|
|
468
468
|
authorizationUrl?: string | undefined;
|
|
469
469
|
tokenUrl?: string | undefined;
|
|
@@ -506,6 +506,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
506
506
|
allowedEmails?: string[] | undefined;
|
|
507
507
|
}>>;
|
|
508
508
|
}, "strip", z.ZodTypeAny, {
|
|
509
|
+
defaultModel: string;
|
|
509
510
|
toolApprovals: {
|
|
510
511
|
bash: boolean;
|
|
511
512
|
write_file: boolean;
|
|
@@ -513,7 +514,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
513
514
|
load_skill: boolean;
|
|
514
515
|
todo: boolean;
|
|
515
516
|
};
|
|
516
|
-
defaultModel: string;
|
|
517
517
|
skills: {
|
|
518
518
|
directory: string;
|
|
519
519
|
additionalDirectories: string[];
|
|
@@ -533,21 +533,11 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
533
533
|
intervalHours: number;
|
|
534
534
|
};
|
|
535
535
|
databasePath: string;
|
|
536
|
+
workingDirectory?: string | undefined;
|
|
536
537
|
approvalWebhook?: string | undefined;
|
|
537
|
-
slack?: {
|
|
538
|
-
botToken?: string | undefined;
|
|
539
|
-
signingSecret?: string | undefined;
|
|
540
|
-
defaultOrchestratorName?: string | undefined;
|
|
541
|
-
allowedUsers?: string[] | undefined;
|
|
542
|
-
allowedChannels?: string[] | undefined;
|
|
543
|
-
allowDmsFromAnyone?: boolean | undefined;
|
|
544
|
-
deniedReplyEnabled?: boolean | undefined;
|
|
545
|
-
deniedReplyTemplate?: string | undefined;
|
|
546
|
-
} | undefined;
|
|
547
538
|
webhooks?: {
|
|
548
539
|
token?: string | undefined;
|
|
549
540
|
} | undefined;
|
|
550
|
-
workingDirectory?: string | undefined;
|
|
551
541
|
remoteServer?: {
|
|
552
542
|
url?: string | undefined;
|
|
553
543
|
authKey?: string | undefined;
|
|
@@ -560,17 +550,27 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
560
550
|
httpUrl?: string | undefined;
|
|
561
551
|
namespace?: string | undefined;
|
|
562
552
|
} | undefined;
|
|
553
|
+
slack?: {
|
|
554
|
+
botToken?: string | undefined;
|
|
555
|
+
signingSecret?: string | undefined;
|
|
556
|
+
defaultOrchestratorName?: string | undefined;
|
|
557
|
+
allowedUsers?: string[] | undefined;
|
|
558
|
+
allowedChannels?: string[] | undefined;
|
|
559
|
+
allowDmsFromAnyone?: boolean | undefined;
|
|
560
|
+
deniedReplyEnabled?: boolean | undefined;
|
|
561
|
+
deniedReplyTemplate?: string | undefined;
|
|
562
|
+
} | undefined;
|
|
563
563
|
mcp?: {
|
|
564
564
|
servers?: {
|
|
565
565
|
enabled: boolean;
|
|
566
566
|
id: string;
|
|
567
567
|
name: string;
|
|
568
|
-
createdAt: string;
|
|
569
568
|
transport: "http" | "sse" | "stdio";
|
|
570
|
-
|
|
569
|
+
createdAt: string;
|
|
571
570
|
url?: string | undefined;
|
|
572
571
|
headers?: Record<string, string> | undefined;
|
|
573
572
|
command?: string | undefined;
|
|
573
|
+
args?: string[] | undefined;
|
|
574
574
|
oauth?: {
|
|
575
575
|
authorizationUrl?: string | undefined;
|
|
576
576
|
tokenUrl?: string | undefined;
|
|
@@ -591,6 +591,8 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
591
591
|
allowedEmails?: string[] | undefined;
|
|
592
592
|
} | undefined;
|
|
593
593
|
}, {
|
|
594
|
+
defaultModel?: string | undefined;
|
|
595
|
+
workingDirectory?: string | undefined;
|
|
594
596
|
toolApprovals?: {
|
|
595
597
|
bash?: boolean | undefined;
|
|
596
598
|
write_file?: boolean | undefined;
|
|
@@ -599,21 +601,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
599
601
|
todo?: boolean | undefined;
|
|
600
602
|
} | undefined;
|
|
601
603
|
approvalWebhook?: string | undefined;
|
|
602
|
-
slack?: {
|
|
603
|
-
botToken?: string | undefined;
|
|
604
|
-
signingSecret?: string | undefined;
|
|
605
|
-
defaultOrchestratorName?: string | undefined;
|
|
606
|
-
allowedUsers?: string[] | undefined;
|
|
607
|
-
allowedChannels?: string[] | undefined;
|
|
608
|
-
allowDmsFromAnyone?: boolean | undefined;
|
|
609
|
-
deniedReplyEnabled?: boolean | undefined;
|
|
610
|
-
deniedReplyTemplate?: string | undefined;
|
|
611
|
-
} | undefined;
|
|
612
|
-
webhooks?: {
|
|
613
|
-
token?: string | undefined;
|
|
614
|
-
} | undefined;
|
|
615
|
-
workingDirectory?: string | undefined;
|
|
616
|
-
defaultModel?: string | undefined;
|
|
617
604
|
skills?: {
|
|
618
605
|
directory?: string | undefined;
|
|
619
606
|
additionalDirectories?: string[] | undefined;
|
|
@@ -628,6 +615,9 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
628
615
|
host?: string | undefined;
|
|
629
616
|
publicUrl?: string | undefined;
|
|
630
617
|
} | undefined;
|
|
618
|
+
webhooks?: {
|
|
619
|
+
token?: string | undefined;
|
|
620
|
+
} | undefined;
|
|
631
621
|
autoUpdate?: {
|
|
632
622
|
enabled?: boolean | undefined;
|
|
633
623
|
intervalHours?: number | undefined;
|
|
@@ -645,17 +635,27 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
645
635
|
include?: string[] | undefined;
|
|
646
636
|
exclude?: string[] | undefined;
|
|
647
637
|
} | undefined;
|
|
638
|
+
slack?: {
|
|
639
|
+
botToken?: string | undefined;
|
|
640
|
+
signingSecret?: string | undefined;
|
|
641
|
+
defaultOrchestratorName?: string | undefined;
|
|
642
|
+
allowedUsers?: string[] | undefined;
|
|
643
|
+
allowedChannels?: string[] | undefined;
|
|
644
|
+
allowDmsFromAnyone?: boolean | undefined;
|
|
645
|
+
deniedReplyEnabled?: boolean | undefined;
|
|
646
|
+
deniedReplyTemplate?: string | undefined;
|
|
647
|
+
} | undefined;
|
|
648
648
|
mcp?: {
|
|
649
649
|
servers?: {
|
|
650
650
|
id: string;
|
|
651
651
|
name: string;
|
|
652
|
-
createdAt: string;
|
|
653
652
|
transport: "http" | "sse" | "stdio";
|
|
653
|
+
createdAt: string;
|
|
654
654
|
enabled?: boolean | undefined;
|
|
655
|
-
args?: string[] | undefined;
|
|
656
655
|
url?: string | undefined;
|
|
657
656
|
headers?: Record<string, string> | undefined;
|
|
658
657
|
command?: string | undefined;
|
|
658
|
+
args?: string[] | undefined;
|
|
659
659
|
oauth?: {
|
|
660
660
|
authorizationUrl?: string | undefined;
|
|
661
661
|
tokenUrl?: 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-Cl_eUatM.js';
|
|
2
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-Cl_eUatM.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-BSz4MzhJ.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-BSz4MzhJ.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-DOzC4ojH.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'hono/types';
|
package/dist/index.js
CHANGED
|
@@ -7669,6 +7669,105 @@ var init_cap_image_count = __esm({
|
|
|
7669
7669
|
}
|
|
7670
7670
|
});
|
|
7671
7671
|
|
|
7672
|
+
// src/utils/sanitize-images.ts
|
|
7673
|
+
function hasImageMagic(bytes) {
|
|
7674
|
+
if (bytes.length < 12) return false;
|
|
7675
|
+
if (bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return true;
|
|
7676
|
+
if (bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return true;
|
|
7677
|
+
if (bytes[0] === 71 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 56) return true;
|
|
7678
|
+
if (bytes[0] === 82 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 70 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) return true;
|
|
7679
|
+
return false;
|
|
7680
|
+
}
|
|
7681
|
+
function extractBase64(part) {
|
|
7682
|
+
const raw = typeof part?.data === "string" ? part.data : typeof part?.image === "string" ? part.image : null;
|
|
7683
|
+
if (typeof raw !== "string" || raw.length === 0) return null;
|
|
7684
|
+
if (/^https?:\/\//i.test(raw)) return null;
|
|
7685
|
+
const dataUrl = raw.match(/^data:[^;,]+;base64,([\s\S]*)$/);
|
|
7686
|
+
return dataUrl ? dataUrl[1] : raw;
|
|
7687
|
+
}
|
|
7688
|
+
function isInvalidImagePart(part) {
|
|
7689
|
+
if (!part || typeof part !== "object") return false;
|
|
7690
|
+
const t = part.type;
|
|
7691
|
+
if (t !== "image" && t !== "image-data" && t !== "media") return false;
|
|
7692
|
+
const mt = part.mediaType;
|
|
7693
|
+
const b64 = extractBase64(part);
|
|
7694
|
+
if (b64 === null) {
|
|
7695
|
+
return typeof mt === "string" && mt.startsWith("image/") && !SUPPORTED_IMAGE_TYPES.includes(mt);
|
|
7696
|
+
}
|
|
7697
|
+
let bytes;
|
|
7698
|
+
try {
|
|
7699
|
+
bytes = Buffer.from(b64, "base64");
|
|
7700
|
+
} catch {
|
|
7701
|
+
return true;
|
|
7702
|
+
}
|
|
7703
|
+
if (bytes.length === 0) return true;
|
|
7704
|
+
return !hasImageMagic(bytes);
|
|
7705
|
+
}
|
|
7706
|
+
function placeholder() {
|
|
7707
|
+
return { type: "text", text: INVALID_IMAGE_PLACEHOLDER };
|
|
7708
|
+
}
|
|
7709
|
+
function sanitizeInvalidImages(messages) {
|
|
7710
|
+
if (!Array.isArray(messages) || messages.length === 0) return messages;
|
|
7711
|
+
let mutated = false;
|
|
7712
|
+
let dropped = 0;
|
|
7713
|
+
const out = messages.slice();
|
|
7714
|
+
for (let i = 0; i < out.length; i++) {
|
|
7715
|
+
const msg = out[i];
|
|
7716
|
+
if (!Array.isArray(msg.content)) continue;
|
|
7717
|
+
let contentCloned = false;
|
|
7718
|
+
const ensureCloned = () => {
|
|
7719
|
+
if (contentCloned) return;
|
|
7720
|
+
out[i] = { ...msg, content: [...msg.content] };
|
|
7721
|
+
contentCloned = true;
|
|
7722
|
+
};
|
|
7723
|
+
const content = () => out[i].content;
|
|
7724
|
+
for (let j = 0; j < content().length; j++) {
|
|
7725
|
+
const part = content()[j];
|
|
7726
|
+
if (isInvalidImagePart(part)) {
|
|
7727
|
+
ensureCloned();
|
|
7728
|
+
out[i].content[j] = placeholder();
|
|
7729
|
+
mutated = true;
|
|
7730
|
+
dropped++;
|
|
7731
|
+
continue;
|
|
7732
|
+
}
|
|
7733
|
+
if (part && typeof part === "object" && part.type === "tool-result" && part.output && part.output.type === "content" && Array.isArray(part.output.value)) {
|
|
7734
|
+
const innerValue = part.output.value;
|
|
7735
|
+
let innerMutated = false;
|
|
7736
|
+
const newValue = innerValue.slice();
|
|
7737
|
+
for (let k = 0; k < newValue.length; k++) {
|
|
7738
|
+
if (isInvalidImagePart(newValue[k])) {
|
|
7739
|
+
newValue[k] = placeholder();
|
|
7740
|
+
innerMutated = true;
|
|
7741
|
+
dropped++;
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7744
|
+
if (innerMutated) {
|
|
7745
|
+
ensureCloned();
|
|
7746
|
+
out[i].content[j] = {
|
|
7747
|
+
...part,
|
|
7748
|
+
output: { ...part.output, value: newValue }
|
|
7749
|
+
};
|
|
7750
|
+
mutated = true;
|
|
7751
|
+
}
|
|
7752
|
+
}
|
|
7753
|
+
}
|
|
7754
|
+
}
|
|
7755
|
+
if (mutated) {
|
|
7756
|
+
console.warn(
|
|
7757
|
+
`[sanitize-images] Replaced ${dropped} invalid image part(s) with a text placeholder (non-image bytes / unsupported type) to avoid provider 400 "invalid image" errors.`
|
|
7758
|
+
);
|
|
7759
|
+
}
|
|
7760
|
+
return mutated ? out : messages;
|
|
7761
|
+
}
|
|
7762
|
+
var SUPPORTED_IMAGE_TYPES, INVALID_IMAGE_PLACEHOLDER;
|
|
7763
|
+
var init_sanitize_images = __esm({
|
|
7764
|
+
"src/utils/sanitize-images.ts"() {
|
|
7765
|
+
"use strict";
|
|
7766
|
+
SUPPORTED_IMAGE_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
|
|
7767
|
+
INVALID_IMAGE_PLACEHOLDER = "[invalid image omitted \u2014 the data was not a valid jpeg/png/gif/webp]";
|
|
7768
|
+
}
|
|
7769
|
+
});
|
|
7770
|
+
|
|
7672
7771
|
// src/agent/model-limits.ts
|
|
7673
7772
|
function getModelLimits(modelId) {
|
|
7674
7773
|
const normalized = modelId.trim().toLowerCase();
|
|
@@ -7984,6 +8083,7 @@ var init_context = __esm({
|
|
|
7984
8083
|
init_prompts();
|
|
7985
8084
|
init_sanitize_messages();
|
|
7986
8085
|
init_cap_image_count();
|
|
8086
|
+
init_sanitize_images();
|
|
7987
8087
|
init_model_limits();
|
|
7988
8088
|
TOOL_OUTPUT_TRIM_CHARS = 400;
|
|
7989
8089
|
COMPACTABLE_TOOLS = /* @__PURE__ */ new Set([
|
|
@@ -8033,6 +8133,7 @@ ${summaryContent}`
|
|
|
8033
8133
|
messages = repairToolPairing(messages);
|
|
8034
8134
|
messages = ensureToolResultsFollowCalls(messages);
|
|
8035
8135
|
messages = ensureEndsWithUserOrTool(messages);
|
|
8136
|
+
messages = sanitizeInvalidImages(messages);
|
|
8036
8137
|
messages = capImageCount(messages);
|
|
8037
8138
|
messages = this.enforceHardCap(messages);
|
|
8038
8139
|
return messages;
|
|
@@ -8044,28 +8145,35 @@ ${summaryContent}`
|
|
|
8044
8145
|
* repairs tool pairing so dropping can't orphan a tool result.
|
|
8045
8146
|
*/
|
|
8046
8147
|
enforceHardCap(messages) {
|
|
8047
|
-
const {
|
|
8048
|
-
const
|
|
8148
|
+
const { rollingTarget } = getModelLimits(this.modelId);
|
|
8149
|
+
const MAX_MESSAGES = 120;
|
|
8150
|
+
const tokenCeiling = Math.max(2e4, Math.floor(rollingTarget * 1.5));
|
|
8049
8151
|
const tokens = messages.map((m) => this.messageTokens(m));
|
|
8050
8152
|
let total = tokens.reduce((a, b) => a + b, 0);
|
|
8051
|
-
if (total <= ceiling) return messages;
|
|
8052
8153
|
const hasLeadingSummary = messages.length > 0 && messages[0].role === "system";
|
|
8053
8154
|
const firstBody = hasLeadingSummary ? 1 : 0;
|
|
8054
8155
|
const lastIndex = messages.length - 1;
|
|
8156
|
+
const bodyCount = messages.length - firstBody;
|
|
8157
|
+
if (bodyCount <= MAX_MESSAGES && total <= tokenCeiling) return messages;
|
|
8055
8158
|
let start = firstBody;
|
|
8056
|
-
|
|
8159
|
+
const countDropTarget = messages.length - MAX_MESSAGES;
|
|
8160
|
+
while (start < countDropTarget && start < lastIndex) {
|
|
8161
|
+
total -= tokens[start];
|
|
8162
|
+
start += 1;
|
|
8163
|
+
}
|
|
8164
|
+
while (start < lastIndex && total > tokenCeiling) {
|
|
8057
8165
|
total -= tokens[start];
|
|
8058
8166
|
start += 1;
|
|
8059
8167
|
}
|
|
8060
8168
|
let out = hasLeadingSummary ? [messages[0], ...messages.slice(start)] : messages.slice(start);
|
|
8061
|
-
if (total >
|
|
8169
|
+
if (total > tokenCeiling) {
|
|
8062
8170
|
out = out.map((m) => hardTruncateMessageText(m));
|
|
8063
8171
|
}
|
|
8064
8172
|
out = repairToolPairing(out);
|
|
8065
8173
|
out = ensureToolResultsFollowCalls(out);
|
|
8066
8174
|
out = ensureEndsWithUserOrTool(out);
|
|
8067
8175
|
console.warn(
|
|
8068
|
-
`[Context] hard cap engaged for ${this.modelId}: trimmed ${messages.length}\u2192${out.length} msgs (ceiling ${
|
|
8176
|
+
`[Context] hard cap engaged for ${this.modelId}: trimmed ${messages.length}\u2192${out.length} msgs (ceiling ${tokenCeiling} est-tokens / ${MAX_MESSAGES} msgs).`
|
|
8069
8177
|
);
|
|
8070
8178
|
return out;
|
|
8071
8179
|
}
|