sparkecoder 0.1.87 → 0.1.94
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/README.md +1 -1
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +158 -68
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +416 -108
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-BvIissiB.d.ts → index-C7Kkn5vq.d.ts} +29 -29
- package/dist/index.d.ts +5 -5
- package/dist/index.js +272 -97
- package/dist/index.js.map +1 -1
- package/dist/{schema-CohdIL13.d.ts → schema-D7BJyHLl.d.ts} +3 -3
- package/dist/{search-CCffrVJE.d.ts → search-CVVfuBPZ.d.ts} +4 -4
- package/dist/server/index.js +272 -97
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +31 -4
- package/dist/tools/index.js +38 -4
- package/dist/tools/index.js.map +1 -1
- package/package.json +5 -5
- 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_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 +1 -1
- 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 +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +3 -3
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +2 -2
- 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 +2 -2
- 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 +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +3 -3
- 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 +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 +2 -2
- 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 +3 -3
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +3 -3
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +2 -2
- 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 +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +3 -3
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +3 -3
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +2 -2
- 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 +1 -1
- package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__36edac7c._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_page_tsx_5ac4794b._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_components_sessions-sidebar_tsx_92510070._.js +1 -1
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/{static/chunks/26eb5fab5216f3cc.js → standalone/web/.next/static/chunks/58fd0aaa2746b444.js} +1 -1
- package/web/.next/standalone/web/.next/static/chunks/9fce2ce79c4c834e.js +1 -0
- package/web/.next/standalone/web/.next/static/chunks/{8d3efc76109d2efc.js → a888d448ceab1abe.js} +1 -1
- package/web/.next/standalone/web/.next/static/static/chunks/{26eb5fab5216f3cc.js → 58fd0aaa2746b444.js} +1 -1
- package/web/.next/standalone/web/.next/static/static/chunks/9fce2ce79c4c834e.js +1 -0
- package/web/.next/{static/chunks/8d3efc76109d2efc.js → standalone/web/.next/static/static/chunks/a888d448ceab1abe.js} +1 -1
- package/web/.next/standalone/web/package-lock.json +27 -27
- package/web/.next/standalone/web/package.json +1 -1
- package/web/.next/standalone/web/src/app/(main)/page.tsx +2 -2
- package/web/.next/standalone/web/src/app/api/config/route.ts +3 -2
- package/web/.next/standalone/web/src/components/sessions-sidebar.tsx +1 -1
- package/web/.next/standalone/web/src/lib/config.ts +2 -1
- package/web/.next/{standalone/web/.next/static/chunks/26eb5fab5216f3cc.js → static/chunks/58fd0aaa2746b444.js} +1 -1
- package/web/.next/static/chunks/9fce2ce79c4c834e.js +1 -0
- package/web/.next/{standalone/web/.next/static/static/chunks/8d3efc76109d2efc.js → static/chunks/a888d448ceab1abe.js} +1 -1
- package/web/package.json +1 -1
- package/web/.next/standalone/web/.next/static/chunks/b31b0765abe0c427.js +0 -1
- package/web/.next/standalone/web/.next/static/static/chunks/b31b0765abe0c427.js +0 -1
- package/web/.next/static/chunks/b31b0765abe0c427.js +0 -1
- /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{static/uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/glGjCSPew_3EV65tkHmVO}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/glGjCSPew_3EV65tkHmVO}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → static/glGjCSPew_3EV65tkHmVO}/_ssgManifest.js +0 -0
- /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_buildManifest.js +0 -0
- /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{uUaN7Xe5kF_pP6zhfaeYi → glGjCSPew_3EV65tkHmVO}/_ssgManifest.js +0 -0
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { ToolSet } from 'ai';
|
|
3
|
-
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from '../search-
|
|
4
|
-
export { b as BashToolOptions, d as SearchToolOptions, e as WriteFileToolOptions, c as createBashTool, f as createSearchTool, a as createWriteFileTool } from '../search-
|
|
3
|
+
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from '../search-CVVfuBPZ.js';
|
|
4
|
+
export { b as BashToolOptions, d as SearchToolOptions, e as WriteFileToolOptions, c as createBashTool, f as createSearchTool, a as createWriteFileTool } from '../search-CVVfuBPZ.js';
|
|
5
5
|
|
|
6
6
|
interface TaskCompletionSignal {
|
|
7
7
|
status: 'completed' | 'failed';
|
|
8
8
|
result?: unknown;
|
|
9
9
|
error?: string;
|
|
10
10
|
}
|
|
11
|
+
interface TaskQuestion {
|
|
12
|
+
questionId: string;
|
|
13
|
+
question: string;
|
|
14
|
+
context?: string;
|
|
15
|
+
choices?: string[];
|
|
16
|
+
}
|
|
11
17
|
interface CreateTaskToolsOptions {
|
|
12
18
|
outputSchema: Record<string, unknown>;
|
|
13
19
|
onComplete: (signal: TaskCompletionSignal) => void;
|
|
20
|
+
onQuestion?: (question: TaskQuestion) => Promise<{
|
|
21
|
+
answer: string;
|
|
22
|
+
answeredBy?: string;
|
|
23
|
+
}>;
|
|
14
24
|
}
|
|
15
25
|
declare function createCompleteTaskTool(options: CreateTaskToolsOptions): ai.Tool<{
|
|
16
26
|
result: Record<string, unknown>;
|
|
@@ -35,6 +45,23 @@ declare function createTaskFailedTool(options: Pick<CreateTaskToolsOptions, 'onC
|
|
|
35
45
|
status: string;
|
|
36
46
|
message: string;
|
|
37
47
|
}>;
|
|
48
|
+
declare function createAskQuestionToUserTool(options: Pick<CreateTaskToolsOptions, 'onQuestion'>): ai.Tool<{
|
|
49
|
+
question: string;
|
|
50
|
+
context?: string | undefined;
|
|
51
|
+
choices?: string[] | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
status: string;
|
|
54
|
+
message: string;
|
|
55
|
+
questionId?: undefined;
|
|
56
|
+
answer?: undefined;
|
|
57
|
+
answeredBy?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
status: string;
|
|
60
|
+
questionId: string;
|
|
61
|
+
answer: string;
|
|
62
|
+
answeredBy: string;
|
|
63
|
+
message?: undefined;
|
|
64
|
+
}>;
|
|
38
65
|
|
|
39
66
|
interface ReadFileToolOptions {
|
|
40
67
|
workingDirectory: string;
|
|
@@ -83,7 +110,7 @@ interface TodoToolOptions {
|
|
|
83
110
|
workingDirectory: string;
|
|
84
111
|
}
|
|
85
112
|
declare function createTodoTool(options: TodoToolOptions): ai.Tool<{
|
|
86
|
-
action: "
|
|
113
|
+
action: "clear" | "add" | "list" | "mark" | "save_plan" | "list_plans" | "get_plan" | "delete_plan";
|
|
87
114
|
status?: "completed" | "pending" | "in_progress" | "cancelled" | undefined;
|
|
88
115
|
items?: {
|
|
89
116
|
content: string;
|
|
@@ -661,4 +688,4 @@ interface CreateToolsOptions {
|
|
|
661
688
|
*/
|
|
662
689
|
declare function createTools(options: CreateToolsOptions): Promise<ToolSet>;
|
|
663
690
|
|
|
664
|
-
export { BashToolProgress, type CodeGraphToolOptions, type ComputerUseToolOptions, type CreateTaskToolsOptions, type CreateToolsOptions, type EnableComputerUseToolOptions, type LinterToolOptions, type LoadSkillToolOptions, type ReadFileToolOptions, SearchToolProgress, type SemanticSearchResult, type SemanticSearchToolOptions, type TaskCompletionSignal, type TodoToolOptions, type UploadFileToolOptions, WriteFileProgress, createCodeGraphTool, createCompleteTaskTool, createComputerUseTool, createEnableComputerUseTool, createLinterTool, createLoadSkillTool, createReadFileTool, createSemanticSearchTool, createTaskFailedTool, createTodoTool, createTools, createUploadFileTool };
|
|
691
|
+
export { BashToolProgress, type CodeGraphToolOptions, type ComputerUseToolOptions, type CreateTaskToolsOptions, type CreateToolsOptions, type EnableComputerUseToolOptions, type LinterToolOptions, type LoadSkillToolOptions, type ReadFileToolOptions, SearchToolProgress, type SemanticSearchResult, type SemanticSearchToolOptions, type TaskCompletionSignal, type TodoToolOptions, type UploadFileToolOptions, WriteFileProgress, createAskQuestionToUserTool, createCodeGraphTool, createCompleteTaskTool, createComputerUseTool, createEnableComputerUseTool, createLinterTool, createLoadSkillTool, createReadFileTool, createSemanticSearchTool, createTaskFailedTool, createTodoTool, createTools, createUploadFileTool };
|
package/dist/tools/index.js
CHANGED
|
@@ -107,7 +107,7 @@ var init_types = __esm({
|
|
|
107
107
|
}).optional();
|
|
108
108
|
SparkcoderConfigSchema = z.object({
|
|
109
109
|
// Default model to use (Vercel AI Gateway format)
|
|
110
|
-
defaultModel: z.string().default("anthropic/claude-opus-4
|
|
110
|
+
defaultModel: z.string().default("anthropic/claude-opus-4.7"),
|
|
111
111
|
// Working directory for file operations
|
|
112
112
|
workingDirectory: z.string().optional(),
|
|
113
113
|
// Tool approval settings
|
|
@@ -4913,6 +4913,7 @@ init_semantic_search();
|
|
|
4913
4913
|
import { tool as tool11 } from "ai";
|
|
4914
4914
|
import { z as z12 } from "zod";
|
|
4915
4915
|
import Ajv from "ajv";
|
|
4916
|
+
import { nanoid as nanoid3 } from "nanoid";
|
|
4916
4917
|
var ajv = new Ajv({ allErrors: true });
|
|
4917
4918
|
function createCompleteTaskTool(options) {
|
|
4918
4919
|
const validate = ajv.compile(options.outputSchema);
|
|
@@ -4959,6 +4960,37 @@ function createTaskFailedTool(options) {
|
|
|
4959
4960
|
}
|
|
4960
4961
|
});
|
|
4961
4962
|
}
|
|
4963
|
+
function createAskQuestionToUserTool(options) {
|
|
4964
|
+
return tool11({
|
|
4965
|
+
description: "Ask the user a blocking clarification question when you cannot safely continue without more information. Use this only after trying to infer the answer from the available context. The task will pause until the orchestrator or user answers.",
|
|
4966
|
+
inputSchema: z12.object({
|
|
4967
|
+
question: z12.string().min(1).describe("The concise question you need answered."),
|
|
4968
|
+
context: z12.string().optional().describe("Brief context explaining why this answer is needed and what you already tried."),
|
|
4969
|
+
choices: z12.array(z12.string().min(1)).max(10).optional().describe("Optional suggested answer choices when the question is multiple choice.")
|
|
4970
|
+
}),
|
|
4971
|
+
execute: async (input) => {
|
|
4972
|
+
if (!options.onQuestion) {
|
|
4973
|
+
return {
|
|
4974
|
+
status: "unavailable",
|
|
4975
|
+
message: "Question routing is not configured for this task. Continue with the best safe assumption or call task_failed if blocked."
|
|
4976
|
+
};
|
|
4977
|
+
}
|
|
4978
|
+
const questionId = `q_${nanoid3(12)}`;
|
|
4979
|
+
const answer = await options.onQuestion({
|
|
4980
|
+
questionId,
|
|
4981
|
+
question: input.question,
|
|
4982
|
+
context: input.context,
|
|
4983
|
+
choices: input.choices
|
|
4984
|
+
});
|
|
4985
|
+
return {
|
|
4986
|
+
status: "answered",
|
|
4987
|
+
questionId,
|
|
4988
|
+
answer: answer.answer,
|
|
4989
|
+
answeredBy: answer.answeredBy ?? "unknown"
|
|
4990
|
+
};
|
|
4991
|
+
}
|
|
4992
|
+
});
|
|
4993
|
+
}
|
|
4962
4994
|
|
|
4963
4995
|
// src/tools/upload-file.ts
|
|
4964
4996
|
import { tool as tool12 } from "ai";
|
|
@@ -5064,7 +5096,7 @@ import { promisify as promisify5 } from "util";
|
|
|
5064
5096
|
import { mkdirSync as mkdirSync5, existsSync as existsSync15, readFileSync as readFileSync7, unlinkSync as unlinkSync2 } from "fs";
|
|
5065
5097
|
import { join as join8 } from "path";
|
|
5066
5098
|
import { tmpdir } from "os";
|
|
5067
|
-
import { nanoid as
|
|
5099
|
+
import { nanoid as nanoid4 } from "nanoid";
|
|
5068
5100
|
var execAsync5 = promisify5(exec5);
|
|
5069
5101
|
var DEFAULT_WIDTH = 1280;
|
|
5070
5102
|
var DEFAULT_HEIGHT = 800;
|
|
@@ -5286,7 +5318,7 @@ function createComputerUseTool(options) {
|
|
|
5286
5318
|
try {
|
|
5287
5319
|
switch (input.action) {
|
|
5288
5320
|
case "screenshot": {
|
|
5289
|
-
const path = join8(tmpdir(), `cu-${
|
|
5321
|
+
const path = join8(tmpdir(), `cu-${nanoid4(8)}.png`);
|
|
5290
5322
|
await runScreencapture(path);
|
|
5291
5323
|
const resized = await resizeScreenshotToPoints(path, displayWidth, displayHeight);
|
|
5292
5324
|
try {
|
|
@@ -5417,7 +5449,7 @@ function createComputerUseTool(options) {
|
|
|
5417
5449
|
case "zoom": {
|
|
5418
5450
|
const region = input.region ?? [0, 0, displayWidth, displayHeight];
|
|
5419
5451
|
const [x1, y1, x2, y2] = region;
|
|
5420
|
-
const tmpPath = join8(tmpdir(), `cu-zoom-${
|
|
5452
|
+
const tmpPath = join8(tmpdir(), `cu-zoom-${nanoid4(8)}.png`);
|
|
5421
5453
|
await runScreencapture(tmpPath);
|
|
5422
5454
|
const sharpModule = await import("sharp");
|
|
5423
5455
|
const sharp2 = sharpModule.default || sharpModule;
|
|
@@ -5696,10 +5728,12 @@ async function createTools(options) {
|
|
|
5696
5728
|
if (options.taskTools) {
|
|
5697
5729
|
tools.complete_task = createCompleteTaskTool(options.taskTools);
|
|
5698
5730
|
tools.task_failed = createTaskFailedTool(options.taskTools);
|
|
5731
|
+
tools.ask_question_to_user = createAskQuestionToUserTool(options.taskTools);
|
|
5699
5732
|
}
|
|
5700
5733
|
return tools;
|
|
5701
5734
|
}
|
|
5702
5735
|
export {
|
|
5736
|
+
createAskQuestionToUserTool,
|
|
5703
5737
|
createBashTool,
|
|
5704
5738
|
createCodeGraphTool,
|
|
5705
5739
|
createCompleteTaskTool,
|