sparkecoder 0.1.76 → 0.1.77

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 (92) hide show
  1. package/dist/agent/index.d.ts +3 -3
  2. package/dist/agent/index.js +9 -3
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/cli.js +20 -8
  5. package/dist/cli.js.map +1 -1
  6. package/dist/db/index.d.ts +2 -2
  7. package/dist/{index-DRscBFFX.d.ts → index-DT1l57s0.d.ts} +25 -25
  8. package/dist/index.d.ts +5 -5
  9. package/dist/index.js +20 -8
  10. package/dist/index.js.map +1 -1
  11. package/dist/{schema-C7Mm4Ykn.d.ts → schema-XcP0dedO.d.ts} +3 -3
  12. package/dist/{search-CVVfuBPZ.d.ts → search-CCffrVJE.d.ts} +4 -4
  13. package/dist/server/index.js +20 -8
  14. package/dist/server/index.js.map +1 -1
  15. package/dist/tools/index.d.ts +3 -3
  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/_global-error.html +2 -2
  22. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  23. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  25. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  29. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
  30. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  31. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  33. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  34. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  35. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  37. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  46. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
  47. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
  48. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  55. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
  56. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
  57. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
  59. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  64. package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  66. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  67. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  68. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  72. package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
  73. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  74. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  76. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  77. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  78. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  80. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  81. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  82. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  83. package/web/.next/standalone/web/package-lock.json +3 -3
  84. /package/web/.next/standalone/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_buildManifest.js +0 -0
  85. /package/web/.next/standalone/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_clientMiddlewareManifest.json +0 -0
  86. /package/web/.next/standalone/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_ssgManifest.js +0 -0
  87. /package/web/.next/standalone/web/.next/static/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_buildManifest.js +0 -0
  88. /package/web/.next/standalone/web/.next/static/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_clientMiddlewareManifest.json +0 -0
  89. /package/web/.next/standalone/web/.next/static/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_ssgManifest.js +0 -0
  90. /package/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_buildManifest.js +0 -0
  91. /package/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_clientMiddlewareManifest.json +0 -0
  92. /package/web/.next/static/{nZpzcWd5nqIPZFd3PiefU → jEMyQksXLQ60IvC0f9PYc}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
- import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-C7Mm4Ykn.js';
2
- export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-C7Mm4Ykn.js';
1
+ import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-XcP0dedO.js';
2
+ export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-XcP0dedO.js';
3
3
  import 'drizzle-orm/sqlite-core';
4
4
 
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import { ModelMessage, streamText } from 'ai';
2
- import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-C7Mm4Ykn.js';
2
+ import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-XcP0dedO.js';
3
3
  import { z } from 'zod';
4
- import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-CVVfuBPZ.js';
4
+ import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-CCffrVJE.js';
5
5
 
6
6
  declare const ToolApprovalConfigSchema: z.ZodObject<{
7
7
  bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -37,54 +37,54 @@ declare const SessionConfigSchema: z.ZodObject<{
37
37
  error: z.ZodOptional<z.ZodString>;
38
38
  iterations: z.ZodOptional<z.ZodNumber>;
39
39
  }, "strip", z.ZodTypeAny, {
40
- status: "running" | "completed" | "failed";
41
- enabled: boolean;
40
+ status: "completed" | "failed" | "running";
42
41
  outputSchema: Record<string, unknown>;
43
- webhookUrl?: string | undefined;
42
+ enabled: boolean;
43
+ error?: string | undefined;
44
44
  maxIterations?: number | undefined;
45
+ webhookUrl?: string | undefined;
45
46
  result?: unknown;
46
- error?: string | undefined;
47
47
  iterations?: number | undefined;
48
48
  }, {
49
- status: "running" | "completed" | "failed";
50
- enabled: boolean;
49
+ status: "completed" | "failed" | "running";
51
50
  outputSchema: Record<string, unknown>;
52
- webhookUrl?: string | undefined;
51
+ enabled: boolean;
52
+ error?: string | undefined;
53
53
  maxIterations?: number | undefined;
54
+ webhookUrl?: string | undefined;
54
55
  result?: unknown;
55
- error?: string | undefined;
56
56
  iterations?: number | undefined;
57
57
  }>>;
58
58
  }, "strip", z.ZodTypeAny, {
59
59
  maxContextChars: number;
60
60
  toolApprovals?: Record<string, boolean> | undefined;
61
61
  approvalWebhook?: string | undefined;
62
- skillsDirectory?: string | undefined;
63
62
  task?: {
64
- status: "running" | "completed" | "failed";
65
- enabled: boolean;
63
+ status: "completed" | "failed" | "running";
66
64
  outputSchema: Record<string, unknown>;
67
- webhookUrl?: string | undefined;
65
+ enabled: boolean;
66
+ error?: string | undefined;
68
67
  maxIterations?: number | undefined;
68
+ webhookUrl?: string | undefined;
69
69
  result?: unknown;
70
- error?: string | undefined;
71
70
  iterations?: number | undefined;
72
71
  } | undefined;
72
+ skillsDirectory?: string | undefined;
73
73
  }, {
74
74
  toolApprovals?: Record<string, boolean> | undefined;
75
75
  approvalWebhook?: string | undefined;
76
- skillsDirectory?: string | undefined;
77
- maxContextChars?: number | undefined;
78
76
  task?: {
79
- status: "running" | "completed" | "failed";
80
- enabled: boolean;
77
+ status: "completed" | "failed" | "running";
81
78
  outputSchema: Record<string, unknown>;
82
- webhookUrl?: string | undefined;
79
+ enabled: boolean;
80
+ error?: string | undefined;
83
81
  maxIterations?: number | undefined;
82
+ webhookUrl?: string | undefined;
84
83
  result?: unknown;
85
- error?: string | undefined;
86
84
  iterations?: number | undefined;
87
85
  } | undefined;
86
+ skillsDirectory?: string | undefined;
87
+ maxContextChars?: number | undefined;
88
88
  }>;
89
89
  declare const SparkcoderConfigSchema: z.ZodObject<{
90
90
  defaultModel: z.ZodDefault<z.ZodString>;
@@ -179,6 +179,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
179
179
  exclude?: string[] | undefined;
180
180
  }>>;
181
181
  }, "strip", z.ZodTypeAny, {
182
+ defaultModel: string;
182
183
  toolApprovals: {
183
184
  bash: boolean;
184
185
  write_file: boolean;
@@ -186,7 +187,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
186
187
  load_skill: boolean;
187
188
  todo: boolean;
188
189
  };
189
- defaultModel: string;
190
190
  skills: {
191
191
  directory: string;
192
192
  additionalDirectories: string[];
@@ -202,8 +202,8 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
202
202
  publicUrl?: string | undefined;
203
203
  };
204
204
  databasePath: string;
205
- approvalWebhook?: string | undefined;
206
205
  workingDirectory?: string | undefined;
206
+ approvalWebhook?: string | undefined;
207
207
  remoteServer?: {
208
208
  url?: string | undefined;
209
209
  authKey?: string | undefined;
@@ -217,6 +217,8 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
217
217
  namespace?: string | undefined;
218
218
  } | undefined;
219
219
  }, {
220
+ defaultModel?: string | undefined;
221
+ workingDirectory?: string | undefined;
220
222
  toolApprovals?: {
221
223
  bash?: boolean | undefined;
222
224
  write_file?: boolean | undefined;
@@ -225,8 +227,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
225
227
  todo?: boolean | undefined;
226
228
  } | undefined;
227
229
  approvalWebhook?: string | undefined;
228
- workingDirectory?: string | undefined;
229
- defaultModel?: string | undefined;
230
230
  skills?: {
231
231
  directory?: string | undefined;
232
232
  additionalDirectories?: string[] | undefined;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { R as ResolvedConfig } from './index-DRscBFFX.js';
2
- export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-DRscBFFX.js';
1
+ import { R as ResolvedConfig } from './index-DT1l57s0.js';
2
+ export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-DT1l57s0.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
- import { F as FileBackup, C as Checkpoint } from './schema-C7Mm4Ykn.js';
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-C7Mm4Ykn.js';
5
+ import { F as FileBackup, C as Checkpoint } from './schema-XcP0dedO.js';
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-XcP0dedO.js';
7
7
  export { createLoadSkillTool, createReadFileTool, createTodoTool, createTools } from './tools/index.js';
8
- export { c as createBashTool, a as createWriteFileTool } from './search-CVVfuBPZ.js';
8
+ export { c as createBashTool, a as createWriteFileTool } from './search-CCffrVJE.js';
9
9
  import 'ai';
10
10
  import 'zod';
11
11
  import 'hono/types';
package/dist/index.js CHANGED
@@ -6836,6 +6836,13 @@ function truncateWriteFileInput(input) {
6836
6836
  return out;
6837
6837
  }
6838
6838
  var approvalResolvers = /* @__PURE__ */ new Map();
6839
+ function stripDataUrlPrefix(data) {
6840
+ const commaIdx = data.indexOf(",");
6841
+ if (commaIdx !== -1 && data.startsWith("data:")) {
6842
+ return data.slice(commaIdx + 1);
6843
+ }
6844
+ return data;
6845
+ }
6839
6846
  var Agent = class _Agent {
6840
6847
  session;
6841
6848
  context;
@@ -6936,8 +6943,7 @@ ${prompt}` });
6936
6943
  if (attachment.type === "image") {
6937
6944
  contentParts.push({
6938
6945
  type: "image",
6939
- image: attachment.data,
6940
- // base64 data URL or raw base64
6946
+ image: stripDataUrlPrefix(attachment.data),
6941
6947
  mediaType: attachment.mediaType,
6942
6948
  filename: attachment.filename,
6943
6949
  savedPath: attachment.savedPath
@@ -6945,7 +6951,7 @@ ${prompt}` });
6945
6951
  } else {
6946
6952
  contentParts.push({
6947
6953
  type: "file",
6948
- data: attachment.data,
6954
+ data: stripDataUrlPrefix(attachment.data),
6949
6955
  mediaType: attachment.mediaType || "application/octet-stream",
6950
6956
  filename: attachment.filename,
6951
6957
  savedPath: attachment.savedPath
@@ -8642,6 +8648,13 @@ async function saveAttachmentToDisk(sessionId, attachment, index) {
8642
8648
  writeFileSync4(filePath, buffer);
8643
8649
  return filePath;
8644
8650
  }
8651
+ function stripDataUrlPrefix2(data) {
8652
+ const commaIdx = data.indexOf(",");
8653
+ if (commaIdx !== -1 && data.startsWith("data:")) {
8654
+ return data.slice(commaIdx + 1);
8655
+ }
8656
+ return data;
8657
+ }
8645
8658
  function getExtensionFromMediaType(mediaType, type) {
8646
8659
  if (!mediaType) {
8647
8660
  return type === "image" ? ".png" : ".bin";
@@ -8733,7 +8746,7 @@ ${prompt}` });
8733
8746
  if (attachment.type === "image") {
8734
8747
  contentParts.push({
8735
8748
  type: "image",
8736
- image: attachment.data,
8749
+ image: stripDataUrlPrefix2(attachment.data),
8737
8750
  mediaType: attachment.mediaType,
8738
8751
  filename: attachment.filename,
8739
8752
  savedPath: attachment.savedPath
@@ -8741,7 +8754,7 @@ ${prompt}` });
8741
8754
  } else {
8742
8755
  contentParts.push({
8743
8756
  type: "file",
8744
- data: attachment.data,
8757
+ data: stripDataUrlPrefix2(attachment.data),
8745
8758
  mediaType: attachment.mediaType || "application/octet-stream",
8746
8759
  filename: attachment.filename,
8747
8760
  savedPath: attachment.savedPath
@@ -9028,8 +9041,7 @@ ${prompt}` });
9028
9041
  if (attachment.type === "image") {
9029
9042
  contentParts.push({
9030
9043
  type: "image",
9031
- image: attachment.data,
9032
- // base64 data URL or raw base64
9044
+ image: stripDataUrlPrefix2(attachment.data),
9033
9045
  mediaType: attachment.mediaType,
9034
9046
  filename: attachment.filename,
9035
9047
  savedPath: attachment.savedPath
@@ -9037,7 +9049,7 @@ ${prompt}` });
9037
9049
  } else {
9038
9050
  contentParts.push({
9039
9051
  type: "file",
9040
- data: attachment.data,
9052
+ data: stripDataUrlPrefix2(attachment.data),
9041
9053
  mediaType: attachment.mediaType || "application/octet-stream",
9042
9054
  filename: attachment.filename,
9043
9055
  savedPath: attachment.savedPath