sparkecoder 0.1.36 → 0.1.38

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 (125) hide show
  1. package/dist/agent/index.d.ts +2 -2
  2. package/dist/agent/index.js +4 -4
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/cli.js +92 -4
  5. package/dist/cli.js.map +1 -1
  6. package/dist/{index-BSbFzE22.d.ts → index-D2eLXP9V.d.ts} +1 -1
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +92 -4
  9. package/dist/index.js.map +1 -1
  10. package/dist/{search-CrICQDSa.d.ts → search-D3Wtf7TJ.d.ts} +1 -1
  11. package/dist/server/index.js +92 -4
  12. package/dist/server/index.js.map +1 -1
  13. package/dist/tools/index.d.ts +2 -2
  14. package/dist/tools/index.js +4 -4
  15. package/dist/tools/index.js.map +1 -1
  16. package/package.json +1 -1
  17. package/web/.next/BUILD_ID +1 -1
  18. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  19. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  20. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  21. package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
  22. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
  23. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  25. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  29. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  30. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  31. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  32. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  33. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +2 -2
  34. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  35. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  37. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  40. package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
  41. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  42. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +2 -2
  43. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +2 -2
  44. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +2 -2
  46. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +2 -2
  47. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  48. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  53. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +2 -2
  54. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +2 -2
  55. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  56. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +2 -2
  57. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +2 -2
  58. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  59. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  63. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +2 -2
  64. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +2 -2
  65. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  66. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +2 -2
  67. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +2 -2
  68. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  72. package/web/.next/standalone/web/.next/server/app/docs.rsc +2 -2
  73. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  74. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  76. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  77. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  78. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  80. package/web/.next/standalone/web/.next/server/app/index.rsc +4 -4
  81. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
  82. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
  83. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +4 -4
  84. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  85. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +2 -2
  86. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  87. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_184c536d._.js → 2374f_147b1db0._.js} +1 -1
  88. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_be7e7ab5._.js → 2374f_36dd81aa._.js} +1 -1
  89. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_4efa2a34._.js → 2374f_3eca1553._.js} +1 -1
  90. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_d3aec1c3._.js → 2374f_4d1accac._.js} +1 -1
  91. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_ced8bc96._.js → 2374f_4e2c9d06._.js} +2 -2
  92. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_75261269._.js → 2374f_b30bed04._.js} +1 -1
  93. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_84476e55._.js → 2374f_c99180da._.js} +1 -1
  94. package/web/.next/standalone/web/.next/server/chunks/ssr/{2374f_d7e5f4a0._.js → 2374f_f5998fca._.js} +1 -1
  95. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__a7aab2da._.js +4 -2
  96. package/web/.next/standalone/web/.next/server/chunks/ssr/web_76ccf09f._.js +1 -1
  97. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  98. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  99. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  100. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  101. package/web/.next/standalone/web/.next/static/chunks/{6407c045dfc908fe.js → 1e9fdac31c7fd474.js} +3 -3
  102. package/web/.next/standalone/web/.next/static/chunks/{165f43d544d3a988.js → 6b8642759b62770c.js} +6 -4
  103. package/web/.next/standalone/web/.next/static/chunks/f81a19eca278424b.css +1 -0
  104. package/web/.next/{static/chunks/6407c045dfc908fe.js → standalone/web/.next/static/static/chunks/1e9fdac31c7fd474.js} +3 -3
  105. package/web/.next/standalone/web/.next/static/static/chunks/{165f43d544d3a988.js → 6b8642759b62770c.js} +6 -4
  106. package/web/.next/standalone/web/.next/static/static/chunks/f81a19eca278424b.css +1 -0
  107. package/web/.next/standalone/web/src/components/ai-elements/search-tool.tsx +107 -59
  108. package/web/.next/standalone/web/src/components/ai-elements/subagent-modal.tsx +116 -172
  109. package/web/.next/standalone/web/src/components/chat-interface.tsx +68 -3
  110. package/web/.next/standalone/web/src/lib/api.ts +33 -0
  111. package/web/.next/{standalone/web/.next/static/static/chunks/6407c045dfc908fe.js → static/chunks/1e9fdac31c7fd474.js} +3 -3
  112. package/web/.next/static/chunks/{165f43d544d3a988.js → 6b8642759b62770c.js} +6 -4
  113. package/web/.next/static/chunks/f81a19eca278424b.css +1 -0
  114. package/web/.next/standalone/web/.next/static/chunks/971d802e445eb147.css +0 -1
  115. package/web/.next/standalone/web/.next/static/static/chunks/971d802e445eb147.css +0 -1
  116. package/web/.next/static/chunks/971d802e445eb147.css +0 -1
  117. /package/web/.next/standalone/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_buildManifest.js +0 -0
  118. /package/web/.next/standalone/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_clientMiddlewareManifest.json +0 -0
  119. /package/web/.next/standalone/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_ssgManifest.js +0 -0
  120. /package/web/.next/standalone/web/.next/static/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_buildManifest.js +0 -0
  121. /package/web/.next/standalone/web/.next/static/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_clientMiddlewareManifest.json +0 -0
  122. /package/web/.next/standalone/web/.next/static/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_ssgManifest.js +0 -0
  123. /package/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_buildManifest.js +0 -0
  124. /package/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_clientMiddlewareManifest.json +0 -0
  125. /package/web/.next/static/{IF96MaB6ualjuLVOykhqq → RyJoI9WcF0eCUVsGPZmWy}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import { ModelMessage, streamText } from 'ai';
2
2
  import { S as Session, b as ToolExecution } from './schema-NcQknWCg.js';
3
3
  import { z } from 'zod';
4
- import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-CrICQDSa.js';
4
+ import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-D3Wtf7TJ.js';
5
5
 
6
6
  declare const ToolApprovalConfigSchema: z.ZodObject<{
7
7
  bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { R as ResolvedConfig } from './index-BSbFzE22.js';
2
- export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-BSbFzE22.js';
1
+ import { R as ResolvedConfig } from './index-D2eLXP9V.js';
2
+ export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-D2eLXP9V.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
5
  import { F as FileBackup, C as Checkpoint } from './schema-NcQknWCg.js';
6
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-NcQknWCg.js';
7
7
  export { createLoadSkillTool, createReadFileTool, createTodoTool, createTools } from './tools/index.js';
8
- export { c as createBashTool, a as createWriteFileTool } from './search-CrICQDSa.js';
8
+ export { c as createBashTool, a as createWriteFileTool } from './search-D3Wtf7TJ.js';
9
9
  import 'ai';
10
10
  import 'zod';
11
11
  import 'hono/types';
package/dist/index.js CHANGED
@@ -465,9 +465,9 @@ function resolveModel(modelId) {
465
465
  return gateway(modelId.trim());
466
466
  }
467
467
  var SUBAGENT_MODELS = {
468
- search: "google/gemini-2.0-flash",
469
- analyze: "google/gemini-2.0-flash",
470
- default: "google/gemini-2.0-flash"
468
+ search: "google/gemini-3-flash-preview",
469
+ analyze: "google/gemini-3-flash-preview",
470
+ default: "google/gemini-3-flash-preview"
471
471
  };
472
472
 
473
473
  // src/agent/index.ts
@@ -3178,7 +3178,7 @@ import {
3178
3178
  } from "ai";
3179
3179
  import { nanoid as nanoid2 } from "nanoid";
3180
3180
  var Subagent = class {
3181
- /** Model to use (defaults to gemini-2.0-flash) */
3181
+ /** Model to use (defaults to gemini-3-flash-preview) */
3182
3182
  model;
3183
3183
  /** Maximum steps before stopping */
3184
3184
  maxSteps = 20;
@@ -4927,6 +4927,24 @@ import { readdir as readdir4 } from "fs/promises";
4927
4927
  import { join as join6, basename as basename3, extname as extname7, relative as relative8 } from "path";
4928
4928
  import { nanoid as nanoid4 } from "nanoid";
4929
4929
  var sessions = new Hono();
4930
+ var pendingInputStore = /* @__PURE__ */ new Map();
4931
+ var devtoolsContextStore = /* @__PURE__ */ new Map();
4932
+ function cleanupPendingInputs() {
4933
+ const now = Date.now();
4934
+ for (const [sessionId, entry] of pendingInputStore) {
4935
+ if (now - entry.createdAt.getTime() > 5 * 60 * 1e3) {
4936
+ pendingInputStore.delete(sessionId);
4937
+ }
4938
+ }
4939
+ }
4940
+ function cleanupDevtoolsContexts() {
4941
+ const now = Date.now();
4942
+ for (const [sessionId, ctx] of devtoolsContextStore) {
4943
+ if (now - ctx.lastHeartbeat.getTime() > 30 * 1e3) {
4944
+ devtoolsContextStore.delete(sessionId);
4945
+ }
4946
+ }
4947
+ }
4930
4948
  var createSessionSchema = z12.object({
4931
4949
  name: z12.string().optional(),
4932
4950
  workingDirectory: z12.string().optional(),
@@ -5150,6 +5168,76 @@ sessions.post("/:id/clear", async (c) => {
5150
5168
  await agent.clearContext();
5151
5169
  return c.json({ success: true, sessionId: id });
5152
5170
  });
5171
+ var pendingInputSchema = z12.object({
5172
+ text: z12.string()
5173
+ });
5174
+ sessions.post(
5175
+ "/:id/pending-input",
5176
+ zValidator("json", pendingInputSchema),
5177
+ async (c) => {
5178
+ const id = c.req.param("id");
5179
+ const { text } = c.req.valid("json");
5180
+ const session = await sessionQueries.getById(id);
5181
+ if (!session) {
5182
+ return c.json({ error: "Session not found" }, 404);
5183
+ }
5184
+ pendingInputStore.set(id, { text, createdAt: /* @__PURE__ */ new Date() });
5185
+ cleanupPendingInputs();
5186
+ return c.json({ success: true, sessionId: id });
5187
+ }
5188
+ );
5189
+ sessions.get("/:id/pending-input", async (c) => {
5190
+ const id = c.req.param("id");
5191
+ cleanupPendingInputs();
5192
+ const pending = pendingInputStore.get(id);
5193
+ if (!pending) {
5194
+ return c.json({ hasPendingInput: false, text: null });
5195
+ }
5196
+ pendingInputStore.delete(id);
5197
+ return c.json({
5198
+ hasPendingInput: true,
5199
+ text: pending.text,
5200
+ createdAt: pending.createdAt.toISOString()
5201
+ });
5202
+ });
5203
+ var devtoolsContextSchema = z12.object({
5204
+ url: z12.string(),
5205
+ path: z12.string(),
5206
+ pageName: z12.string().optional()
5207
+ });
5208
+ sessions.post(
5209
+ "/:id/devtools-context",
5210
+ zValidator("json", devtoolsContextSchema),
5211
+ async (c) => {
5212
+ const id = c.req.param("id");
5213
+ const body = c.req.valid("json");
5214
+ devtoolsContextStore.set(id, {
5215
+ url: body.url,
5216
+ path: body.path,
5217
+ pageName: body.pageName || body.path,
5218
+ lastHeartbeat: /* @__PURE__ */ new Date()
5219
+ });
5220
+ cleanupDevtoolsContexts();
5221
+ return c.json({ success: true, sessionId: id });
5222
+ }
5223
+ );
5224
+ sessions.get("/:id/devtools-context", async (c) => {
5225
+ const id = c.req.param("id");
5226
+ cleanupDevtoolsContexts();
5227
+ const ctx = devtoolsContextStore.get(id);
5228
+ if (!ctx) {
5229
+ return c.json({ connected: false, context: null });
5230
+ }
5231
+ return c.json({
5232
+ connected: true,
5233
+ context: {
5234
+ url: ctx.url,
5235
+ path: ctx.path,
5236
+ pageName: ctx.pageName,
5237
+ lastHeartbeat: ctx.lastHeartbeat.toISOString()
5238
+ }
5239
+ });
5240
+ });
5153
5241
  sessions.get("/:id/todos", async (c) => {
5154
5242
  const id = c.req.param("id");
5155
5243
  const session = await sessionQueries.getById(id);