sparkecoder 0.1.9 → 0.1.10

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 (146) hide show
  1. package/dist/agent/index.d.ts +3 -3
  2. package/dist/agent/index.js +26 -7
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/{bash-CGAqW7HR.d.ts → bash-C43A-o5X.d.ts} +4 -4
  5. package/dist/cli.js +21 -9
  6. package/dist/cli.js.map +1 -1
  7. package/dist/db/index.d.ts +1 -1
  8. package/dist/{index-BeKylVnB.d.ts → index-DuWb8kNN.d.ts} +6 -6
  9. package/dist/index.d.ts +7 -7
  10. package/dist/index.js +17 -9
  11. package/dist/index.js.map +1 -1
  12. package/dist/{schema-CkrIadxa.d.ts → schema-J6qYlHtl.d.ts} +3 -3
  13. package/dist/server/index.js +17 -9
  14. package/dist/server/index.js.map +1 -1
  15. package/dist/tools/index.d.ts +3 -3
  16. package/dist/tools/index.js +152 -118
  17. package/dist/tools/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/web/.next/BUILD_ID +1 -1
  20. package/web/.next/build-manifest.json +2 -2
  21. package/web/.next/cache/.previewinfo +1 -1
  22. package/web/.next/cache/.rscinfo +1 -1
  23. package/web/.next/cache/.tsbuildinfo +1 -1
  24. package/web/.next/cache/config.json +3 -3
  25. package/web/.next/dev/cache/.rscinfo +1 -1
  26. package/web/.next/dev/cache/config.json +3 -3
  27. package/web/.next/dev/cache/turbopack/731ace46/00000001.sst +0 -0
  28. package/web/.next/dev/cache/turbopack/731ace46/00000002.sst +0 -0
  29. package/web/.next/dev/cache/turbopack/731ace46/00000004.sst +0 -0
  30. package/web/.next/dev/cache/turbopack/731ace46/00000005.sst +0 -0
  31. package/web/.next/dev/cache/turbopack/731ace46/00000007.meta +0 -0
  32. package/web/.next/dev/cache/turbopack/731ace46/00000008.meta +0 -0
  33. package/web/.next/dev/cache/turbopack/731ace46/00000010.meta +0 -0
  34. package/web/.next/dev/cache/turbopack/731ace46/00000011.sst +0 -0
  35. package/web/.next/dev/cache/turbopack/731ace46/00000012.sst +0 -0
  36. package/web/.next/dev/cache/turbopack/731ace46/00000014.sst +0 -0
  37. package/web/.next/dev/cache/turbopack/731ace46/00000015.sst +0 -0
  38. package/web/.next/dev/cache/turbopack/731ace46/00000017.meta +0 -0
  39. package/web/.next/dev/cache/turbopack/731ace46/00000018.meta +0 -0
  40. package/web/.next/dev/cache/turbopack/731ace46/00000019.meta +0 -0
  41. package/web/.next/dev/cache/turbopack/731ace46/00000020.meta +0 -0
  42. package/web/.next/dev/cache/turbopack/731ace46/00000021.sst +0 -0
  43. package/web/.next/dev/cache/turbopack/731ace46/00000022.sst +0 -0
  44. package/web/.next/dev/cache/turbopack/731ace46/00000023.sst +0 -0
  45. package/web/.next/dev/cache/turbopack/731ace46/{00000040.meta → 00000025.meta} +0 -0
  46. package/web/.next/dev/cache/turbopack/731ace46/00000026.meta +0 -0
  47. package/web/.next/dev/cache/turbopack/731ace46/00000027.sst +0 -0
  48. package/web/.next/dev/cache/turbopack/731ace46/00000028.sst +0 -0
  49. package/web/.next/dev/cache/turbopack/731ace46/00000029.sst +0 -0
  50. package/web/.next/dev/cache/turbopack/731ace46/00000030.meta +0 -0
  51. package/web/.next/dev/cache/turbopack/731ace46/{00000045.meta → 00000031.meta} +0 -0
  52. package/web/.next/dev/cache/turbopack/731ace46/{00000029.meta → 00000032.meta} +0 -0
  53. package/web/.next/dev/cache/turbopack/731ace46/00000033.sst +0 -0
  54. package/web/.next/dev/cache/turbopack/731ace46/00000034.sst +0 -0
  55. package/web/.next/dev/cache/turbopack/731ace46/00000035.sst +0 -0
  56. package/web/.next/dev/cache/turbopack/731ace46/00000036.meta +0 -0
  57. package/web/.next/dev/cache/turbopack/731ace46/00000037.meta +0 -0
  58. package/web/.next/dev/cache/turbopack/731ace46/00000038.meta +0 -0
  59. package/web/.next/dev/cache/turbopack/731ace46/00000039.sst +0 -0
  60. package/web/.next/dev/cache/turbopack/731ace46/00000040.sst +0 -0
  61. package/web/.next/dev/cache/turbopack/731ace46/00000041.sst +0 -0
  62. package/web/.next/dev/cache/turbopack/731ace46/00000042.meta +0 -0
  63. package/web/.next/dev/cache/turbopack/731ace46/{00000039.meta → 00000043.meta} +0 -0
  64. package/web/.next/dev/cache/turbopack/731ace46/00000044.meta +0 -0
  65. package/web/.next/dev/cache/turbopack/731ace46/00000045.sst +0 -0
  66. package/web/.next/dev/cache/turbopack/731ace46/{00000042.sst → 00000046.sst} +0 -0
  67. package/web/.next/dev/cache/turbopack/731ace46/00000047.sst +0 -0
  68. package/web/.next/dev/cache/turbopack/731ace46/00000048.meta +0 -0
  69. package/web/.next/dev/cache/turbopack/731ace46/00000049.meta +0 -0
  70. package/web/.next/dev/cache/turbopack/731ace46/00000050.meta +0 -0
  71. package/web/.next/dev/cache/turbopack/731ace46/00000051.sst +0 -0
  72. package/web/.next/dev/cache/turbopack/731ace46/00000052.sst +0 -0
  73. package/web/.next/dev/cache/turbopack/731ace46/00000053.sst +0 -0
  74. package/web/.next/dev/cache/turbopack/731ace46/00000054.meta +0 -0
  75. package/web/.next/dev/cache/turbopack/731ace46/00000055.meta +0 -0
  76. package/web/.next/dev/cache/turbopack/731ace46/00000056.meta +0 -0
  77. package/web/.next/dev/cache/turbopack/731ace46/CURRENT +0 -0
  78. package/web/.next/dev/cache/turbopack/731ace46/LOG +44 -30
  79. package/web/.next/dev/prerender-manifest.json +3 -3
  80. package/web/.next/dev/server/server-reference-manifest.js +1 -1
  81. package/web/.next/dev/server/server-reference-manifest.json +1 -1
  82. package/web/.next/dev/trace +1 -1
  83. package/web/.next/fallback-build-manifest.json +2 -2
  84. package/web/.next/prerender-manifest.json +3 -3
  85. package/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/_global-error.html +2 -2
  88. package/web/.next/server/app/_global-error.rsc +1 -1
  89. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  90. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  91. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  92. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  93. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  94. package/web/.next/server/app/_not-found.html +1 -1
  95. package/web/.next/server/app/_not-found.rsc +1 -1
  96. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  97. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  98. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  99. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  100. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  101. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  102. package/web/.next/server/app/index.html +1 -1
  103. package/web/.next/server/app/index.rsc +1 -1
  104. package/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  105. package/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  106. package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  107. package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  108. package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  109. package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  110. package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js → 2374f__pnpm_2c066fc4._.js} +1 -1
  111. package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js → 2374f__pnpm_6c21de20._.js} +1 -1
  112. package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js → 2374f__pnpm_7261fee6._.js} +1 -1
  113. package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js → 2374f__pnpm_86153ae0._.js} +1 -1
  114. package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js → 2374f__pnpm_b316ce7b._.js} +2 -2
  115. package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js → 2374f__pnpm_e9578f61._.js} +1 -1
  116. package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js → 2374f__pnpm_ef13102d._.js} +1 -1
  117. package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js → 2374f__pnpm_f79c2825._.js} +1 -1
  118. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2dfcd951._.js → [root-of-the-server]__02cdbf0f._.js} +2 -2
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__02cdbf0f._.js.map +1 -0
  120. package/web/.next/server/pages/404.html +1 -1
  121. package/web/.next/server/pages/500.html +2 -2
  122. package/web/.next/server/server-reference-manifest.js +1 -1
  123. package/web/.next/server/server-reference-manifest.json +1 -1
  124. package/web/.next/static/chunks/{bf853305cd7a9765.js → cffe148e9b82e836.js} +3 -3
  125. package/web/.next/trace +1 -1
  126. package/web/.next/trace-build +1 -1
  127. package/web/.next/dev/cache/turbopack/731ace46/00000024.sst +0 -0
  128. package/web/.next/dev/cache/turbopack/731ace46/00000025.sst +0 -0
  129. package/web/.next/dev/cache/turbopack/731ace46/00000028.meta +0 -0
  130. package/web/.next/dev/cache/turbopack/731ace46/00000031.sst +0 -0
  131. package/web/.next/dev/cache/turbopack/731ace46/00000032.sst +0 -0
  132. package/web/.next/dev/cache/turbopack/731ace46/00000043.sst +0 -0
  133. package/web/.next/dev/cache/turbopack/731ace46/00000046.meta +0 -0
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__2dfcd951._.js.map +0 -1
  135. /package/web/.next/dev/cache/turbopack/731ace46/{00000027.meta → 00000024.meta} +0 -0
  136. /package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js.map → 2374f__pnpm_2c066fc4._.js.map} +0 -0
  137. /package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js.map → 2374f__pnpm_6c21de20._.js.map} +0 -0
  138. /package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js.map → 2374f__pnpm_7261fee6._.js.map} +0 -0
  139. /package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js.map → 2374f__pnpm_86153ae0._.js.map} +0 -0
  140. /package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js.map → 2374f__pnpm_b316ce7b._.js.map} +0 -0
  141. /package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js.map → 2374f__pnpm_e9578f61._.js.map} +0 -0
  142. /package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js.map → 2374f__pnpm_ef13102d._.js.map} +0 -0
  143. /package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js.map → 2374f__pnpm_f79c2825._.js.map} +0 -0
  144. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_buildManifest.js +0 -0
  145. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_clientMiddlewareManifest.json +0 -0
  146. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_ssgManifest.js +0 -0
@@ -85,7 +85,7 @@ declare const sessions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
85
85
  tableName: "sessions";
86
86
  dataType: "string";
87
87
  columnType: "SQLiteText";
88
- data: "error" | "active" | "waiting" | "completed";
88
+ data: "active" | "waiting" | "completed" | "error";
89
89
  driverParam: string;
90
90
  notNull: true;
91
91
  hasDefault: true;
@@ -391,7 +391,7 @@ declare const toolExecutions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
391
391
  tableName: "tool_executions";
392
392
  dataType: "string";
393
393
  columnType: "SQLiteText";
394
- data: "error" | "completed" | "pending" | "approved" | "rejected";
394
+ data: "completed" | "error" | "pending" | "approved" | "rejected";
395
395
  driverParam: string;
396
396
  notNull: true;
397
397
  hasDefault: true;
@@ -967,7 +967,7 @@ declare const activeStreams: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
967
967
  tableName: "active_streams";
968
968
  dataType: "string";
969
969
  columnType: "SQLiteText";
970
- data: "error" | "active" | "finished";
970
+ data: "active" | "error" | "finished";
971
971
  driverParam: string;
972
972
  notNull: true;
973
973
  hasDefault: true;
@@ -10,7 +10,7 @@ import { Hono as Hono5 } from "hono";
10
10
  import { serve } from "@hono/node-server";
11
11
  import { cors } from "hono/cors";
12
12
  import { logger } from "hono/logger";
13
- import { existsSync as existsSync7, mkdirSync as mkdirSync2 } from "fs";
13
+ import { existsSync as existsSync7, mkdirSync as mkdirSync3 } from "fs";
14
14
  import { resolve as resolve6, dirname as dirname4, join as join3 } from "path";
15
15
  import { spawn } from "child_process";
16
16
  import { createServer as createNetServer } from "net";
@@ -978,12 +978,12 @@ function calculateContextSize(messages2) {
978
978
  import { exec } from "child_process";
979
979
  import { promisify } from "util";
980
980
  import { mkdir, writeFile, readFile } from "fs/promises";
981
- import { existsSync as existsSync2 } from "fs";
981
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
982
982
  import { join as join2 } from "path";
983
983
  import { nanoid as nanoid2 } from "nanoid";
984
984
  var execAsync = promisify(exec);
985
985
  var SESSION_PREFIX = "spark_";
986
- var LOG_BASE_DIR = ".sparkecoder/sessions";
986
+ var LOG_BASE_DIR = "sessions";
987
987
  var tmuxAvailableCache = null;
988
988
  async function isTmuxAvailable() {
989
989
  if (tmuxAvailableCache !== null) {
@@ -1005,11 +1005,19 @@ function generateTerminalId() {
1005
1005
  function getSessionName(terminalId) {
1006
1006
  return `${SESSION_PREFIX}${terminalId}`;
1007
1007
  }
1008
- function getLogDir(terminalId, workingDirectory, sessionId) {
1008
+ function getTerminalDataDir() {
1009
+ const appDataDir = getAppDataDirectory();
1010
+ if (!existsSync2(appDataDir)) {
1011
+ mkdirSync2(appDataDir, { recursive: true });
1012
+ }
1013
+ return appDataDir;
1014
+ }
1015
+ function getLogDir(terminalId, _workingDirectory, sessionId) {
1016
+ const baseDir = getTerminalDataDir();
1009
1017
  if (sessionId) {
1010
- return join2(workingDirectory, LOG_BASE_DIR, sessionId, "terminals", terminalId);
1018
+ return join2(baseDir, LOG_BASE_DIR, sessionId, "terminals", terminalId);
1011
1019
  }
1012
- return join2(workingDirectory, ".sparkecoder/terminals", terminalId);
1020
+ return join2(baseDir, "terminals", terminalId);
1013
1021
  }
1014
1022
  function shellEscape(str) {
1015
1023
  return `'${str.replace(/'/g, "'\\''")}'`;
@@ -1373,7 +1381,7 @@ bash({ id: "abc123", input: "my text" }) // send text input
1373
1381
  - For npm: add --yes or -y to skip confirmation
1374
1382
  - If prompts are unavoidable, run in background mode and use input/key to respond
1375
1383
 
1376
- Logs are saved to .sparkecoder/terminals/{id}/output.log`,
1384
+ Terminal output is stored in the global SparkECoder data directory. Use the \`tail\` option to read recent output.`,
1377
1385
  inputSchema: bashInputSchema,
1378
1386
  execute: async (inputArgs) => {
1379
1387
  const { command, background, id, kill, tail, input: textInput, key } = inputArgs;
@@ -2361,7 +2369,7 @@ bash({ id: "abc123", input: "my text" }) // send text input
2361
2369
  - Use \`key: "y"\` or \`key: "n"\` for yes/no prompts
2362
2370
  - Use \`input: "text"\` for text input prompts
2363
2371
 
2364
- Logs are saved to \`.sparkecoder/terminals/{id}/output.log\` and can be read with \`read_file\` if needed.
2372
+ Terminal output is stored in the global SparkECoder data directory. Use the \`tail\` option to read recent output.
2365
2373
 
2366
2374
  ## Guidelines
2367
2375
 
@@ -4581,7 +4589,7 @@ async function startServer(options = {}) {
4581
4589
  config.resolvedWorkingDirectory = options.workingDirectory;
4582
4590
  }
4583
4591
  if (!existsSync7(config.resolvedWorkingDirectory)) {
4584
- mkdirSync2(config.resolvedWorkingDirectory, { recursive: true });
4592
+ mkdirSync3(config.resolvedWorkingDirectory, { recursive: true });
4585
4593
  if (!options.quiet) console.log(`\u{1F4C1} Created agent workspace: ${config.resolvedWorkingDirectory}`);
4586
4594
  }
4587
4595
  initDatabase(config.resolvedDatabasePath);