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.
- package/dist/agent/index.d.ts +3 -3
- package/dist/agent/index.js +26 -7
- package/dist/agent/index.js.map +1 -1
- package/dist/{bash-CGAqW7HR.d.ts → bash-C43A-o5X.d.ts} +4 -4
- package/dist/cli.js +21 -9
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/{index-BeKylVnB.d.ts → index-DuWb8kNN.d.ts} +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/{schema-CkrIadxa.d.ts → schema-J6qYlHtl.d.ts} +3 -3
- package/dist/server/index.js +17 -9
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.js +152 -118
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/.tsbuildinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/dev/cache/.rscinfo +1 -1
- package/web/.next/dev/cache/config.json +3 -3
- package/web/.next/dev/cache/turbopack/731ace46/00000001.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000002.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000004.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000005.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000007.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000008.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000010.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000011.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000012.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000014.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000015.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000017.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000018.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000019.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000020.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000021.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000022.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000023.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/{00000040.meta → 00000025.meta} +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000026.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000027.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000028.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000029.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000030.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/{00000045.meta → 00000031.meta} +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/{00000029.meta → 00000032.meta} +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000033.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000034.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000035.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000036.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000037.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000038.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000039.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000040.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000041.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000042.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/{00000039.meta → 00000043.meta} +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000044.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000045.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/{00000042.sst → 00000046.sst} +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000047.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000048.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000049.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000050.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000051.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000052.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000053.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000054.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000055.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000056.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/CURRENT +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/LOG +44 -30
- package/web/.next/dev/prerender-manifest.json +3 -3
- package/web/.next/dev/server/server-reference-manifest.js +1 -1
- package/web/.next/dev/server/server-reference-manifest.json +1 -1
- package/web/.next/dev/trace +1 -1
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
- package/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/index.html +1 -1
- package/web/.next/server/app/index.rsc +1 -1
- package/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js → 2374f__pnpm_2c066fc4._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js → 2374f__pnpm_6c21de20._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js → 2374f__pnpm_7261fee6._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js → 2374f__pnpm_86153ae0._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js → 2374f__pnpm_b316ce7b._.js} +2 -2
- package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js → 2374f__pnpm_e9578f61._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js → 2374f__pnpm_ef13102d._.js} +1 -1
- package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js → 2374f__pnpm_f79c2825._.js} +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__2dfcd951._.js → [root-of-the-server]__02cdbf0f._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__02cdbf0f._.js.map +1 -0
- package/web/.next/server/pages/404.html +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/static/chunks/{bf853305cd7a9765.js → cffe148e9b82e836.js} +3 -3
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/web/.next/dev/cache/turbopack/731ace46/00000024.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000025.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000028.meta +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000031.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000032.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000043.sst +0 -0
- package/web/.next/dev/cache/turbopack/731ace46/00000046.meta +0 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2dfcd951._.js.map +0 -1
- /package/web/.next/dev/cache/turbopack/731ace46/{00000027.meta → 00000024.meta} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js.map → 2374f__pnpm_2c066fc4._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js.map → 2374f__pnpm_6c21de20._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js.map → 2374f__pnpm_7261fee6._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js.map → 2374f__pnpm_86153ae0._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js.map → 2374f__pnpm_b316ce7b._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js.map → 2374f__pnpm_e9578f61._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js.map → 2374f__pnpm_ef13102d._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js.map → 2374f__pnpm_f79c2825._.js.map} +0 -0
- /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_buildManifest.js +0 -0
- /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_clientMiddlewareManifest.json +0 -0
- /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: "
|
|
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: "
|
|
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: "
|
|
970
|
+
data: "active" | "error" | "finished";
|
|
971
971
|
driverParam: string;
|
|
972
972
|
notNull: true;
|
|
973
973
|
hasDefault: true;
|
package/dist/server/index.js
CHANGED
|
@@ -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
|
|
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 = "
|
|
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
|
|
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(
|
|
1018
|
+
return join2(baseDir, LOG_BASE_DIR, sessionId, "terminals", terminalId);
|
|
1011
1019
|
}
|
|
1012
|
-
return join2(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|