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
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'ai';
|
|
2
|
-
import '../schema-
|
|
3
|
-
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, d as buildSystemPrompt } from '../index-
|
|
4
|
-
import '../bash-
|
|
2
|
+
import '../schema-J6qYlHtl.js';
|
|
3
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, d as buildSystemPrompt } from '../index-DuWb8kNN.js';
|
|
4
|
+
import '../bash-C43A-o5X.js';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
6
6
|
import 'zod';
|
package/dist/agent/index.js
CHANGED
|
@@ -480,6 +480,17 @@ var SparkcoderConfigSchema = z.object({
|
|
|
480
480
|
});
|
|
481
481
|
|
|
482
482
|
// src/config/index.ts
|
|
483
|
+
function getAppDataDirectory() {
|
|
484
|
+
const appName = "sparkecoder";
|
|
485
|
+
switch (platform()) {
|
|
486
|
+
case "darwin":
|
|
487
|
+
return join(homedir(), "Library", "Application Support", appName);
|
|
488
|
+
case "win32":
|
|
489
|
+
return join(process.env.APPDATA || join(homedir(), "AppData", "Roaming"), appName);
|
|
490
|
+
default:
|
|
491
|
+
return join(process.env.XDG_DATA_HOME || join(homedir(), ".local", "share"), appName);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
483
494
|
var cachedConfig = null;
|
|
484
495
|
function getConfig() {
|
|
485
496
|
if (!cachedConfig) {
|
|
@@ -541,12 +552,12 @@ function calculateContextSize(messages2) {
|
|
|
541
552
|
import { exec } from "child_process";
|
|
542
553
|
import { promisify } from "util";
|
|
543
554
|
import { mkdir, writeFile, readFile } from "fs/promises";
|
|
544
|
-
import { existsSync as existsSync2 } from "fs";
|
|
555
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
545
556
|
import { join as join2 } from "path";
|
|
546
557
|
import { nanoid as nanoid2 } from "nanoid";
|
|
547
558
|
var execAsync = promisify(exec);
|
|
548
559
|
var SESSION_PREFIX = "spark_";
|
|
549
|
-
var LOG_BASE_DIR = "
|
|
560
|
+
var LOG_BASE_DIR = "sessions";
|
|
550
561
|
var tmuxAvailableCache = null;
|
|
551
562
|
async function isTmuxAvailable() {
|
|
552
563
|
if (tmuxAvailableCache !== null) {
|
|
@@ -568,11 +579,19 @@ function generateTerminalId() {
|
|
|
568
579
|
function getSessionName(terminalId) {
|
|
569
580
|
return `${SESSION_PREFIX}${terminalId}`;
|
|
570
581
|
}
|
|
571
|
-
function
|
|
582
|
+
function getTerminalDataDir() {
|
|
583
|
+
const appDataDir = getAppDataDirectory();
|
|
584
|
+
if (!existsSync2(appDataDir)) {
|
|
585
|
+
mkdirSync2(appDataDir, { recursive: true });
|
|
586
|
+
}
|
|
587
|
+
return appDataDir;
|
|
588
|
+
}
|
|
589
|
+
function getLogDir(terminalId, _workingDirectory, sessionId) {
|
|
590
|
+
const baseDir = getTerminalDataDir();
|
|
572
591
|
if (sessionId) {
|
|
573
|
-
return join2(
|
|
592
|
+
return join2(baseDir, LOG_BASE_DIR, sessionId, "terminals", terminalId);
|
|
574
593
|
}
|
|
575
|
-
return join2(
|
|
594
|
+
return join2(baseDir, "terminals", terminalId);
|
|
576
595
|
}
|
|
577
596
|
function shellEscape(str) {
|
|
578
597
|
return `'${str.replace(/'/g, "'\\''")}'`;
|
|
@@ -888,7 +907,7 @@ bash({ id: "abc123", input: "my text" }) // send text input
|
|
|
888
907
|
- For npm: add --yes or -y to skip confirmation
|
|
889
908
|
- If prompts are unavoidable, run in background mode and use input/key to respond
|
|
890
909
|
|
|
891
|
-
|
|
910
|
+
Terminal output is stored in the global SparkECoder data directory. Use the \`tail\` option to read recent output.`,
|
|
892
911
|
inputSchema: bashInputSchema,
|
|
893
912
|
execute: async (inputArgs) => {
|
|
894
913
|
const { command, background, id, kill, tail, input: textInput, key } = inputArgs;
|
|
@@ -1740,7 +1759,7 @@ bash({ id: "abc123", input: "my text" }) // send text input
|
|
|
1740
1759
|
- Use \`key: "y"\` or \`key: "n"\` for yes/no prompts
|
|
1741
1760
|
- Use \`input: "text"\` for text input prompts
|
|
1742
1761
|
|
|
1743
|
-
|
|
1762
|
+
Terminal output is stored in the global SparkECoder data directory. Use the \`tail\` option to read recent output.
|
|
1744
1763
|
|
|
1745
1764
|
## Guidelines
|
|
1746
1765
|
|