sparkecoder 0.1.27 → 0.1.28
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 +18 -16
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +33 -35
- package/dist/cli.js.map +1 -1
- package/dist/{index-CWO1mYcx.d.ts → index-C6EWZ-I9.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/{search-DApagzr3.d.ts → search-CGYXoS4f.d.ts} +1 -1
- package/dist/server/index.js +18 -16
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +15 -13
- 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)/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.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 +5 -5
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +4 -4
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +3 -3
- 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 +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 +2 -2
- 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/chunks/ssr/[root-of-the-server]__2dbf511a._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__397fadd4._.js +1 -1
- package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__f764bebe._.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/standalone/web/.next/static/{static/chunks/0cc382a66266188e.js → chunks/ce505264d78c8eff.js} +1 -1
- package/web/.next/{static/chunks/0cc382a66266188e.js → standalone/web/.next/static/static/chunks/ce505264d78c8eff.js} +1 -1
- package/web/.next/standalone/web/src/app/docs/page.mdx +1 -1
- package/web/.next/standalone/web/src/app/docs/tools/page.mdx +3 -3
- package/web/.next/standalone/web/src/components/ai-elements/search-tool.tsx +3 -3
- package/web/.next/standalone/web/src/components/ai-elements/subagent-modal.tsx +2 -2
- package/web/.next/{standalone/web/.next/static/chunks/0cc382a66266188e.js → static/chunks/ce505264d78c8eff.js} +1 -1
- /package/web/.next/standalone/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_ssgManifest.js +0 -0
- /package/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_buildManifest.js +0 -0
- /package/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{izNDBCFq94JfW7BnJmTC7 → 7lQ63rHHj5A-p0phF3egM}/_ssgManifest.js +0 -0
package/dist/cli.js
CHANGED
|
@@ -3434,13 +3434,13 @@ var MAX_OUTPUT_CHARS4 = 2e4;
|
|
|
3434
3434
|
var MAX_FILE_SIZE2 = 2 * 1024 * 1024;
|
|
3435
3435
|
var SearchSubagent = class extends Subagent {
|
|
3436
3436
|
type = "search";
|
|
3437
|
-
name = "
|
|
3437
|
+
name = "Explore Agent";
|
|
3438
3438
|
constructor(model) {
|
|
3439
3439
|
super(model || SUBAGENT_MODELS.search);
|
|
3440
3440
|
this.maxSteps = 15;
|
|
3441
3441
|
}
|
|
3442
3442
|
getSystemPrompt(options) {
|
|
3443
|
-
return `You are
|
|
3443
|
+
return `You are an Explore agent for codebase discovery. Your job is to map the structure, find relevant files, and surface connections based on the user's query.
|
|
3444
3444
|
|
|
3445
3445
|
Working Directory: ${options.workingDirectory}
|
|
3446
3446
|
|
|
@@ -3450,9 +3450,9 @@ You have these tools available:
|
|
|
3450
3450
|
- read_file: Read contents of a specific file
|
|
3451
3451
|
- list_dir: List directory contents
|
|
3452
3452
|
|
|
3453
|
-
## Strategy -
|
|
3453
|
+
## Strategy - Explore in Parallel
|
|
3454
3454
|
|
|
3455
|
-
IMPORTANT: When
|
|
3455
|
+
IMPORTANT: When exploring, run MULTIPLE searches in PARALLEL to cover different variations and related terms. Don't explore sequentially - batch your searches together!
|
|
3456
3456
|
|
|
3457
3457
|
For example, if asked "how does authentication work":
|
|
3458
3458
|
- Search for "auth", "login", "session", "jwt", "token" all at once
|
|
@@ -3474,10 +3474,11 @@ For example, if asked "how does authentication work":
|
|
|
3474
3474
|
- Search content: patterns, function names, class names
|
|
3475
3475
|
|
|
3476
3476
|
## Execution Flow
|
|
3477
|
-
1.
|
|
3478
|
-
2.
|
|
3479
|
-
3.
|
|
3480
|
-
4.
|
|
3477
|
+
1. Start broad: list likely directories or entry points if the query is open-ended
|
|
3478
|
+
2. Run 2-4 parallel searches covering different angles of the query
|
|
3479
|
+
3. Review results and identify the most relevant files
|
|
3480
|
+
4. Read the key files to understand the full context
|
|
3481
|
+
5. Provide a clear summary with exact file paths and line numbers
|
|
3481
3482
|
|
|
3482
3483
|
Be efficient - you have limited steps. Maximize coverage with parallel tool calls.
|
|
3483
3484
|
|
|
@@ -3486,6 +3487,7 @@ When done, provide a summary with:
|
|
|
3486
3487
|
- Key files/locations found (with full paths)
|
|
3487
3488
|
- Relevant code snippets showing the important parts
|
|
3488
3489
|
- How the pieces connect together
|
|
3490
|
+
- Suggested next files to inspect (if more depth is needed)
|
|
3489
3491
|
|
|
3490
3492
|
Keep your responses concise and focused on actionable information.`;
|
|
3491
3493
|
}
|
|
@@ -3736,13 +3738,13 @@ function createSearchSubagent(model) {
|
|
|
3736
3738
|
var MAX_RESULT_CHARS = 8e3;
|
|
3737
3739
|
function createSearchTool(options) {
|
|
3738
3740
|
return tool8({
|
|
3739
|
-
description: `Delegate a search task to a specialized
|
|
3741
|
+
description: `Delegate a search task to a specialized Explore agent. Use this when you need to:
|
|
3740
3742
|
- Find files or code matching a pattern
|
|
3741
3743
|
- Explore the codebase structure
|
|
3742
3744
|
- Search for specific functions, classes, or variables
|
|
3743
3745
|
- Understand how a feature is implemented
|
|
3744
3746
|
|
|
3745
|
-
The
|
|
3747
|
+
The Explore agent will explore the codebase and return a summary of findings.
|
|
3746
3748
|
This is more thorough than a simple grep because it can follow references and understand context.
|
|
3747
3749
|
|
|
3748
3750
|
Examples:
|
|
@@ -3804,7 +3806,7 @@ Context: ${context}` : query;
|
|
|
3804
3806
|
};
|
|
3805
3807
|
}
|
|
3806
3808
|
const searchResult = result.result;
|
|
3807
|
-
let formattedResult = `##
|
|
3809
|
+
let formattedResult = `## Explore Results
|
|
3808
3810
|
|
|
3809
3811
|
`;
|
|
3810
3812
|
formattedResult += `**Summary:** ${searchResult.summary}
|
|
@@ -4562,7 +4564,7 @@ async function indexRepository(options) {
|
|
|
4562
4564
|
skippedChunks: 0,
|
|
4563
4565
|
failedChunks: 0,
|
|
4564
4566
|
duration: Date.now() - startTime,
|
|
4565
|
-
errors: [{ file: "", error: "
|
|
4567
|
+
errors: [{ file: "", error: "Remote server not configured. Set SPARKECODER_REMOTE_URL/SPARKECODER_AUTH_KEY or remoteServer in sparkecoder.config.json" }]
|
|
4566
4568
|
};
|
|
4567
4569
|
}
|
|
4568
4570
|
try {
|
|
@@ -4699,7 +4701,7 @@ async function getIndexStatus(workingDirectory) {
|
|
|
4699
4701
|
workingDirectory,
|
|
4700
4702
|
config.resolvedVectorGateway.namespace
|
|
4701
4703
|
);
|
|
4702
|
-
const isConfigured =
|
|
4704
|
+
const isConfigured = config.resolvedRemoteServer.isConfigured;
|
|
4703
4705
|
if (!namespace) {
|
|
4704
4706
|
return {
|
|
4705
4707
|
namespace: "",
|
|
@@ -4787,7 +4789,7 @@ Returns matching code snippets with file paths, line numbers, and relevance scor
|
|
|
4787
4789
|
if (!client) {
|
|
4788
4790
|
return {
|
|
4789
4791
|
success: false,
|
|
4790
|
-
error:
|
|
4792
|
+
error: "Remote server not configured. Set SPARKECODER_REMOTE_URL/SPARKECODER_AUTH_KEY or run sparkecoder to register."
|
|
4791
4793
|
};
|
|
4792
4794
|
}
|
|
4793
4795
|
try {
|
|
@@ -4986,7 +4988,7 @@ You have access to powerful tools for:
|
|
|
4986
4988
|
- **linter**: Check files for type errors and lint issues (TypeScript, JavaScript, TSX, JSX)
|
|
4987
4989
|
- **todo**: Manage your task list to track progress on complex operations
|
|
4988
4990
|
- **load_skill**: Load specialized knowledge documents for specific tasks
|
|
4989
|
-
- **search**:
|
|
4991
|
+
- **search**: Explore agent for semantic discovery - for exploratory questions and finding code by meaning
|
|
4990
4992
|
|
|
4991
4993
|
|
|
4992
4994
|
IMPORTANT: If you have zero context of where you are working, always explore it first to understand the structure before doing things for the user.
|
|
@@ -5080,14 +5082,14 @@ Use this proactively after making code changes to catch errors early.
|
|
|
5080
5082
|
|
|
5081
5083
|
**Choose the right search approach:**
|
|
5082
5084
|
|
|
5083
|
-
1. **Use the \`search\` tool (
|
|
5085
|
+
1. **Use the \`search\` tool (Explore agent)** for:
|
|
5084
5086
|
- Semantic/exploratory questions: "How does authentication work?", "Where is user data processed?"
|
|
5085
5087
|
- Finding code by meaning or concept, not exact text
|
|
5086
5088
|
- Understanding how features are implemented across multiple files
|
|
5087
5089
|
- Exploring unfamiliar parts of the codebase
|
|
5088
5090
|
- Questions like "where", "how", "what does X do"
|
|
5089
5091
|
|
|
5090
|
-
The
|
|
5092
|
+
The Explore agent is a mini-agent that intelligently explores the codebase, reads relevant files, and returns a summary of what it found. It's best for understanding and discovery.
|
|
5091
5093
|
|
|
5092
5094
|
2. **Use direct commands (grep/rg, find)** for:
|
|
5093
5095
|
- Exact string matches: \`rg "functionName"\`, \`rg "class MyClass"\`
|
|
@@ -9302,8 +9304,9 @@ program.command("config").description("Show current configuration").option("-c,
|
|
|
9302
9304
|
program.command("index").description("Index repository for semantic search").option("--status", "Show index status instead of indexing").option("--full", "Force full re-index (ignore existing embeddings)").option("-w, --working-dir <path>", "Working directory (defaults to current directory)").option("-c, --config <path>", "Path to config file").option("-v, --verbose", "Show detailed progress").action(async (options) => {
|
|
9303
9305
|
try {
|
|
9304
9306
|
const workingDir = options.workingDir ? resolve10(options.workingDir) : process.cwd();
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
+
let config = loadConfig(options.config, workingDir);
|
|
9308
|
+
const remoteUrl = config.resolvedRemoteServer.url;
|
|
9309
|
+
if (!remoteUrl) {
|
|
9307
9310
|
console.error(chalk.red("Error: Remote server not configured"));
|
|
9308
9311
|
console.log(chalk.dim("Set REMOTE_SERVER_URL environment variable or remoteServer.url in config"));
|
|
9309
9312
|
process.exit(1);
|
|
@@ -9311,9 +9314,16 @@ program.command("index").description("Index repository for semantic search").opt
|
|
|
9311
9314
|
let authKey3 = config.resolvedRemoteServer.authKey;
|
|
9312
9315
|
if (!authKey3) {
|
|
9313
9316
|
console.log(chalk.dim("Registering with remote server..."));
|
|
9314
|
-
authKey3 = await ensureRemoteAuthKey(
|
|
9317
|
+
authKey3 = await ensureRemoteAuthKey(remoteUrl);
|
|
9318
|
+
config = loadConfig(options.config, workingDir);
|
|
9319
|
+
authKey3 = config.resolvedRemoteServer.authKey || authKey3;
|
|
9315
9320
|
}
|
|
9316
|
-
|
|
9321
|
+
if (!authKey3) {
|
|
9322
|
+
console.error(chalk.red("Error: Remote auth key not available"));
|
|
9323
|
+
console.log(chalk.dim("Set SPARKECODER_AUTH_KEY or run sparkecoder to register with the remote server"));
|
|
9324
|
+
process.exit(1);
|
|
9325
|
+
}
|
|
9326
|
+
initDatabase({ url: remoteUrl, authKey: authKey3 });
|
|
9317
9327
|
if (!isGitRepository(workingDir)) {
|
|
9318
9328
|
console.error(chalk.red("Error: Not a git repository"));
|
|
9319
9329
|
console.log(chalk.dim("Semantic indexing requires a git repository with a remote configured."));
|
|
@@ -9340,24 +9350,12 @@ program.command("index").description("Index repository for semantic search").opt
|
|
|
9340
9350
|
console.log(` Last incremental: ${chalk.dim(status.lastIncrementalIndex.toLocaleString())}`);
|
|
9341
9351
|
}
|
|
9342
9352
|
if (!status.isConfigured) {
|
|
9343
|
-
console.log(chalk.yellow("\n\u26A0
|
|
9344
|
-
console.log(chalk.dim(" Set
|
|
9353
|
+
console.log(chalk.yellow("\n\u26A0 Remote server not configured"));
|
|
9354
|
+
console.log(chalk.dim(" Set SPARKECODER_REMOTE_URL/SPARKECODER_AUTH_KEY or remoteServer in sparkecoder.config.json"));
|
|
9345
9355
|
}
|
|
9346
9356
|
console.log();
|
|
9347
9357
|
return;
|
|
9348
9358
|
}
|
|
9349
|
-
if (!config.resolvedVectorGateway.redisUrl) {
|
|
9350
|
-
console.error(chalk.red("Error: Vector Gateway not configured"));
|
|
9351
|
-
console.log(chalk.dim("Set VECTOR_REDIS_URL environment variable or configure vectorGateway in sparkecoder.config.json"));
|
|
9352
|
-
console.log(chalk.dim("\nExample sparkecoder.config.json:"));
|
|
9353
|
-
console.log(chalk.dim(`{
|
|
9354
|
-
"vectorGateway": {
|
|
9355
|
-
"redisUrl": "redis://your-redis-host:6379",
|
|
9356
|
-
"httpUrl": "http://your-vector-gateway:8080"
|
|
9357
|
-
}
|
|
9358
|
-
}`));
|
|
9359
|
-
process.exit(1);
|
|
9360
|
-
}
|
|
9361
9359
|
console.log(chalk.bold(`
|
|
9362
9360
|
Indexing ${chalk.cyan(namespace)}...
|
|
9363
9361
|
`));
|