sparkecoder 0.1.79 → 0.1.81
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 +2 -2
- package/dist/agent/index.js +21 -6
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +75 -18
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-DT1l57s0.d.ts → index-OhuTM4a0.d.ts} +6 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +73 -17
- package/dist/index.js.map +1 -1
- package/dist/{schema-XcP0dedO.d.ts → schema-CohdIL13.d.ts} +1 -0
- package/dist/server/index.js +73 -17
- package/dist/server/index.js.map +1 -1
- package/dist/skills/default/browser.md +11 -2
- package/dist/tools/index.js +2 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/src/skills/default/browser.md +11 -2
- 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/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/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/package-lock.json +3 -3
- package/web/.next/standalone/web/src/lib/api.ts +1 -0
- /package/web/.next/standalone/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_ssgManifest.js +0 -0
- /package/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_buildManifest.js +0 -0
- /package/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{mEI-vdO1YIKdN2l_2MTLR → CAGGCb0khU_QcA3lh6Rk6}/_ssgManifest.js +0 -0
package/dist/server/index.js
CHANGED
|
@@ -522,7 +522,8 @@ var init_types = __esm({
|
|
|
522
522
|
status: z.enum(["running", "completed", "failed"]),
|
|
523
523
|
result: z.unknown().optional(),
|
|
524
524
|
error: z.string().optional(),
|
|
525
|
-
iterations: z.number().optional()
|
|
525
|
+
iterations: z.number().optional(),
|
|
526
|
+
parentTaskId: z.string().optional()
|
|
526
527
|
});
|
|
527
528
|
SessionConfigSchema = z.object({
|
|
528
529
|
toolApprovals: z.record(z.string(), z.boolean()).optional(),
|
|
@@ -6330,11 +6331,25 @@ Before calling \`complete_task\`, you MUST verify your work completely. Do not j
|
|
|
6330
6331
|
- If something doesn't look right, fix it \u2014 don't complete with known issues.
|
|
6331
6332
|
|
|
6332
6333
|
**Screenshot your completed work:**
|
|
6333
|
-
- After completing a task, take a screenshot of the result when it makes sense (UI changes browser pages, etc.).
|
|
6334
|
-
-
|
|
6335
|
-
|
|
6336
|
-
-
|
|
6337
|
-
|
|
6334
|
+
- After completing a task, take a screenshot of the result when it makes sense (UI changes, browser pages, etc.).
|
|
6335
|
+
- All screenshots and artifacts go under \`.sparkecode-artifacts/\` **inside the working directory**. Create subdirectories as needed:
|
|
6336
|
+
\`\`\`bash
|
|
6337
|
+
mkdir -p .sparkecode-artifacts/screenshots
|
|
6338
|
+
\`\`\`
|
|
6339
|
+
- Before your first screenshot, check that \`.sparkecode-artifacts/\` is listed in the project's \`.gitignore\`. If it is missing, add it:
|
|
6340
|
+
\`\`\`bash
|
|
6341
|
+
grep -q "sparkecode-artifacts" .gitignore 2>/dev/null || echo ".sparkecode-artifacts/" >> .gitignore
|
|
6342
|
+
\`\`\`
|
|
6343
|
+
- Take screenshots with \`agent-browser\` using the full relative path from the working directory:
|
|
6344
|
+
\`\`\`bash
|
|
6345
|
+
agent-browser screenshot ".sparkecode-artifacts/screenshots/result.png"
|
|
6346
|
+
\`\`\`
|
|
6347
|
+
- After taking a screenshot, view it with \`read_file\` and then upload it with \`upload_file\`:
|
|
6348
|
+
\`\`\`
|
|
6349
|
+
read_file({ path: ".sparkecode-artifacts/screenshots/result.png" })
|
|
6350
|
+
upload_file({ path: ".sparkecode-artifacts/screenshots/result.png", name: "result.png" })
|
|
6351
|
+
\`\`\`
|
|
6352
|
+
- In task results, NEVER return local filesystem paths for screenshots/reports. Return only the \`downloadUrl\` from \`upload_file\`.
|
|
6338
6353
|
- This is especially valuable for UI/visual changes, successful test runs, and browser verification \u2014 show, don't just tell.
|
|
6339
6354
|
|
|
6340
6355
|
### Use All Available Tools
|
|
@@ -10066,7 +10081,8 @@ var createTaskSchema = z19.object({
|
|
|
10066
10081
|
model: z19.string().optional(),
|
|
10067
10082
|
workingDirectory: z19.string().optional(),
|
|
10068
10083
|
name: z19.string().optional(),
|
|
10069
|
-
maxIterations: z19.number().int().min(1).max(500).optional()
|
|
10084
|
+
maxIterations: z19.number().int().min(1).max(500).optional(),
|
|
10085
|
+
parentTaskId: z19.string().optional()
|
|
10070
10086
|
});
|
|
10071
10087
|
tasks.post(
|
|
10072
10088
|
"/",
|
|
@@ -10079,17 +10095,52 @@ tasks.post(
|
|
|
10079
10095
|
outputSchema: body.outputSchema,
|
|
10080
10096
|
webhookUrl: body.webhookUrl,
|
|
10081
10097
|
maxIterations: body.maxIterations ?? 50,
|
|
10082
|
-
status: "running"
|
|
10098
|
+
status: "running",
|
|
10099
|
+
parentTaskId: body.parentTaskId
|
|
10083
10100
|
};
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10101
|
+
let agent;
|
|
10102
|
+
if (body.parentTaskId) {
|
|
10103
|
+
const parentSession = await sessionQueries.getById(body.parentTaskId);
|
|
10104
|
+
if (!parentSession) {
|
|
10105
|
+
return c.json({ error: "Parent task not found" }, 404);
|
|
10106
|
+
}
|
|
10107
|
+
const parentTask = parentSession.config?.task;
|
|
10108
|
+
if (!parentTask?.enabled) {
|
|
10109
|
+
return c.json({ error: "Parent session is not a task" }, 400);
|
|
10110
|
+
}
|
|
10111
|
+
if (parentTask.status === "running") {
|
|
10112
|
+
return c.json({ error: "Parent task is still running. Wait for it to complete before chaining." }, 409);
|
|
10113
|
+
}
|
|
10114
|
+
const parentStream = await activeStreamQueries.getBySessionId(body.parentTaskId);
|
|
10115
|
+
if (parentStream) {
|
|
10116
|
+
return c.json({ error: "Parent task has an active stream" }, 409);
|
|
10117
|
+
}
|
|
10118
|
+
agent = await Agent.create({
|
|
10119
|
+
name: body.name || "Task",
|
|
10120
|
+
workingDirectory: body.workingDirectory || parentSession.workingDirectory,
|
|
10121
|
+
model: body.model || parentSession.model,
|
|
10122
|
+
sessionConfig: {
|
|
10123
|
+
toolApprovals: { bash: false, write_file: false, read_file: false },
|
|
10124
|
+
task: taskConfig
|
|
10125
|
+
}
|
|
10126
|
+
});
|
|
10127
|
+
const parentMessages = await messageQueries.getBySession(body.parentTaskId);
|
|
10128
|
+
if (parentMessages.length > 0) {
|
|
10129
|
+
const modelMessages = parentMessages.map((m) => m.modelMessage);
|
|
10130
|
+
await messageQueries.addMany(agent.sessionId, modelMessages);
|
|
10131
|
+
console.log(`[TASK] Copied ${modelMessages.length} messages from parent ${body.parentTaskId} to ${agent.sessionId}`);
|
|
10091
10132
|
}
|
|
10092
|
-
}
|
|
10133
|
+
} else {
|
|
10134
|
+
agent = await Agent.create({
|
|
10135
|
+
name: body.name || "Task",
|
|
10136
|
+
workingDirectory: body.workingDirectory || config.resolvedWorkingDirectory,
|
|
10137
|
+
model: body.model || config.defaultModel,
|
|
10138
|
+
sessionConfig: {
|
|
10139
|
+
toolApprovals: { bash: false, write_file: false, read_file: false },
|
|
10140
|
+
task: taskConfig
|
|
10141
|
+
}
|
|
10142
|
+
});
|
|
10143
|
+
}
|
|
10093
10144
|
const taskId = agent.sessionId;
|
|
10094
10145
|
const abortController = new AbortController();
|
|
10095
10146
|
taskAbortControllers.set(taskId, abortController);
|
|
@@ -10161,7 +10212,11 @@ tasks.post(
|
|
|
10161
10212
|
return readable;
|
|
10162
10213
|
};
|
|
10163
10214
|
await streamContext.resumableStream(streamId, taskStreamProducer);
|
|
10164
|
-
return c.json({
|
|
10215
|
+
return c.json({
|
|
10216
|
+
taskId,
|
|
10217
|
+
status: "running",
|
|
10218
|
+
...body.parentTaskId ? { parentTaskId: body.parentTaskId } : {}
|
|
10219
|
+
}, 201);
|
|
10165
10220
|
}
|
|
10166
10221
|
);
|
|
10167
10222
|
tasks.get("/:id", async (c) => {
|
|
@@ -10191,6 +10246,7 @@ tasks.get("/:id", async (c) => {
|
|
|
10191
10246
|
iterations: task.iterations,
|
|
10192
10247
|
model: session.model,
|
|
10193
10248
|
name: session.name,
|
|
10249
|
+
parentTaskId: task.parentTaskId,
|
|
10194
10250
|
createdAt: session.createdAt.toISOString(),
|
|
10195
10251
|
updatedAt: session.updatedAt.toISOString(),
|
|
10196
10252
|
browserRecordings: browserRecordings.length > 0 ? browserRecordings : void 0
|