sparkecoder 0.1.31 → 0.1.32

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.
Files changed (83) hide show
  1. package/dist/agent/index.d.ts +2 -2
  2. package/dist/cli.js +63 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{index-C6EWZ-I9.d.ts → index-CsZVebwZ.d.ts} +1 -1
  5. package/dist/index.d.ts +3 -3
  6. package/dist/{search-CGYXoS4f.d.ts → search-Bk0sOPXw.d.ts} +2 -2
  7. package/dist/tools/index.d.ts +2 -2
  8. package/package.json +1 -1
  9. package/web/.next/BUILD_ID +1 -1
  10. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  11. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  12. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  13. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  14. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  15. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  16. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  17. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  21. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
  22. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  23. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  25. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  29. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
  30. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
  31. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
  33. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  34. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  35. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  37. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  38. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  46. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  47. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
  48. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  55. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  56. package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
  57. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  59. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  64. package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  66. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  67. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  68. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  72. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  73. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  74. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  75. /package/web/.next/standalone/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_buildManifest.js +0 -0
  76. /package/web/.next/standalone/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_clientMiddlewareManifest.json +0 -0
  77. /package/web/.next/standalone/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_ssgManifest.js +0 -0
  78. /package/web/.next/standalone/web/.next/static/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_buildManifest.js +0 -0
  79. /package/web/.next/standalone/web/.next/static/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_clientMiddlewareManifest.json +0 -0
  80. /package/web/.next/standalone/web/.next/static/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_ssgManifest.js +0 -0
  81. /package/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_buildManifest.js +0 -0
  82. /package/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_clientMiddlewareManifest.json +0 -0
  83. /package/web/.next/static/{FSNZXTnxdYh33x-oK2uMY → 4Qd7gbyP-9Akkkk8I1vrs}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import 'ai';
2
2
  import '../schema-NcQknWCg.js';
3
- export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, M as MessageAttachment, d as buildSystemPrompt } from '../index-C6EWZ-I9.js';
4
- import '../search-CGYXoS4f.js';
3
+ export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, M as MessageAttachment, d as buildSystemPrompt } from '../index-CsZVebwZ.js';
4
+ import '../search-Bk0sOPXw.js';
5
5
  import 'zod';
package/dist/cli.js CHANGED
@@ -9462,6 +9462,69 @@ Indexing ${chalk.cyan(namespace)}...
9462
9462
  process.exit(1);
9463
9463
  }
9464
9464
  });
9465
+ program.command("search").description("Search indexed repository using semantic search").argument("<query>", "Search query").option("-n, --num <count>", "Number of results to show", "5").option("-w, --working-dir <path>", "Working directory (defaults to current directory)").option("-c, --config <path>", "Path to config file").action(async (query, options) => {
9466
+ try {
9467
+ const workingDir = options.workingDir ? resolve10(options.workingDir) : process.cwd();
9468
+ const config = loadConfig(options.config, workingDir);
9469
+ const remoteUrl = config.resolvedRemoteServer.url;
9470
+ if (!remoteUrl) {
9471
+ console.error(chalk.red("Error: Remote server not configured"));
9472
+ process.exit(1);
9473
+ }
9474
+ let authKey3 = config.resolvedRemoteServer.authKey;
9475
+ if (!authKey3) {
9476
+ authKey3 = await ensureRemoteAuthKey(remoteUrl);
9477
+ }
9478
+ if (!authKey3) {
9479
+ console.error(chalk.red("Error: Remote auth key not available"));
9480
+ process.exit(1);
9481
+ }
9482
+ initDatabase({ url: remoteUrl, authKey: authKey3 });
9483
+ const namespace = await getRepoNamespace(workingDir, config.resolvedVectorGateway.namespace);
9484
+ if (!namespace) {
9485
+ console.error(chalk.red("Error: Could not determine repository namespace"));
9486
+ console.log(chalk.dim("Ensure git remote is configured or run sparkecoder index first"));
9487
+ process.exit(1);
9488
+ }
9489
+ const client = getVectorClient();
9490
+ if (!client) {
9491
+ console.error(chalk.red("Error: Vector client not configured"));
9492
+ process.exit(1);
9493
+ }
9494
+ console.log(chalk.dim(`Searching "${query}" in ${namespace}...
9495
+ `));
9496
+ const topK = parseInt(options.num) || 5;
9497
+ const result = await client.search.queryAndWait(query, {
9498
+ namespace,
9499
+ topK
9500
+ });
9501
+ if (result.matches.length === 0) {
9502
+ console.log(chalk.yellow("No results found."));
9503
+ console.log(chalk.dim("Make sure you have indexed the repository with: sparkecoder index"));
9504
+ } else {
9505
+ console.log(chalk.bold(`Top ${result.matches.length} results:
9506
+ `));
9507
+ for (let i = 0; i < result.matches.length; i++) {
9508
+ const match = result.matches[i];
9509
+ const metadata = match.metadata;
9510
+ const filePath = metadata?.filePath || "unknown";
9511
+ const startLine = metadata?.startLine;
9512
+ const endLine = metadata?.endLine;
9513
+ const score = (match.score * 100).toFixed(1);
9514
+ const location = startLine ? `${filePath}:${startLine}-${endLine}` : filePath;
9515
+ console.log(` ${chalk.cyan(`${i + 1}.`)} ${chalk.white(location)} ${chalk.dim(`(${score}%)`)}`);
9516
+ if (metadata?.symbolName) {
9517
+ console.log(` ${chalk.dim("Symbol:")} ${metadata.symbolName}`);
9518
+ }
9519
+ }
9520
+ }
9521
+ await closeVectorClient();
9522
+ console.log();
9523
+ } catch (error) {
9524
+ console.error(chalk.red(`Error: ${error.message}`));
9525
+ process.exit(1);
9526
+ }
9527
+ });
9465
9528
  program.command("api-key").description("Manage API keys for AI providers").argument("[provider]", "Provider name (anthropic, openai, google, xai, ai-gateway)").argument("[key]", "API key to set (if not provided, shows status)").option("-l, --list", "List all API key statuses").action((provider, key, options) => {
9466
9529
  try {
9467
9530
  ensureAppDataDirectory();