@proxysoul/soulforge 2.14.8 → 2.14.9
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/index.js +484 -694
- package/dist/workers/io.worker.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -57928,7 +57928,7 @@ var package_default;
|
|
|
57928
57928
|
var init_package = __esm(() => {
|
|
57929
57929
|
package_default = {
|
|
57930
57930
|
name: "@proxysoul/soulforge",
|
|
57931
|
-
version: "2.14.
|
|
57931
|
+
version: "2.14.9",
|
|
57932
57932
|
description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
|
|
57933
57933
|
repository: {
|
|
57934
57934
|
type: "git",
|
|
@@ -88782,7 +88782,6 @@ var init_tool_names = __esm(() => {
|
|
|
88782
88782
|
soul_analyze: "SoulAnalyze",
|
|
88783
88783
|
soul_impact: "SoulImpact",
|
|
88784
88784
|
discover_pattern: "DiscoverPattern",
|
|
88785
|
-
test_scaffold: "TestScaffold",
|
|
88786
88785
|
editor: "Editor",
|
|
88787
88786
|
skills: "Skills",
|
|
88788
88787
|
request_tools: "RequestTools",
|
|
@@ -354824,7 +354823,6 @@ var init_constants = __esm(() => {
|
|
|
354824
354823
|
move_symbol: "Move a symbol between files with import updates",
|
|
354825
354824
|
rename_file: "Rename/move a file with import path updates",
|
|
354826
354825
|
refactor: "LSP code transforms: extract function/variable, format, organize imports",
|
|
354827
|
-
test_scaffold: "Generate test skeleton for a file",
|
|
354828
354826
|
memory: "Read/write persistent memories across sessions",
|
|
354829
354827
|
editor: "Open file in embedded Neovim editor",
|
|
354830
354828
|
task_list: "Create and track tasks for the current session",
|
|
@@ -378058,195 +378056,6 @@ ${added.join(`
|
|
|
378058
378056
|
};
|
|
378059
378057
|
});
|
|
378060
378058
|
|
|
378061
|
-
// src/core/tools/test-scaffold.ts
|
|
378062
|
-
import { access as access5, mkdir as mkdir6, stat as stat5, writeFile as writeFile13 } from "fs/promises";
|
|
378063
|
-
import { basename as basename6, dirname as dirname15, extname as extname10, join as join33, relative as relative11, resolve as resolve34 } from "path";
|
|
378064
|
-
async function fileExists(path) {
|
|
378065
|
-
try {
|
|
378066
|
-
await access5(path);
|
|
378067
|
-
return true;
|
|
378068
|
-
} catch {
|
|
378069
|
-
return false;
|
|
378070
|
-
}
|
|
378071
|
-
}
|
|
378072
|
-
async function detectTestFramework(cwd2) {
|
|
378073
|
-
if (await fileExists(join33(cwd2, "bun.lock")) || await fileExists(join33(cwd2, "bun.lockb")))
|
|
378074
|
-
return "bun";
|
|
378075
|
-
if (await fileExists(join33(cwd2, "vitest.config.ts")) || await fileExists(join33(cwd2, "vitest.config.js")))
|
|
378076
|
-
return "vitest";
|
|
378077
|
-
if (await fileExists(join33(cwd2, "jest.config.ts")) || await fileExists(join33(cwd2, "jest.config.js")))
|
|
378078
|
-
return "jest";
|
|
378079
|
-
if (await fileExists(join33(cwd2, "pytest.ini")) || await fileExists(join33(cwd2, "pyproject.toml")))
|
|
378080
|
-
return "pytest";
|
|
378081
|
-
if (await fileExists(join33(cwd2, "go.mod")))
|
|
378082
|
-
return "go";
|
|
378083
|
-
if (await fileExists(join33(cwd2, "Cargo.toml")))
|
|
378084
|
-
return "cargo";
|
|
378085
|
-
if (await fileExists(join33(cwd2, "package.json")))
|
|
378086
|
-
return "vitest";
|
|
378087
|
-
return "vitest";
|
|
378088
|
-
}
|
|
378089
|
-
async function inferTestPath(sourcePath) {
|
|
378090
|
-
const dir = dirname15(sourcePath);
|
|
378091
|
-
const base = basename6(sourcePath, extname10(sourcePath));
|
|
378092
|
-
const ext = extname10(sourcePath);
|
|
378093
|
-
const testsDir = join33(dir, "__tests__");
|
|
378094
|
-
try {
|
|
378095
|
-
if ((await stat5(testsDir)).isDirectory()) {
|
|
378096
|
-
return join33(testsDir, `${base}.test${ext}`);
|
|
378097
|
-
}
|
|
378098
|
-
} catch {}
|
|
378099
|
-
return join33(dir, `${base}.test${ext}`);
|
|
378100
|
-
}
|
|
378101
|
-
var testScaffoldTool;
|
|
378102
|
-
var init_test_scaffold = __esm(() => {
|
|
378103
|
-
init_intelligence();
|
|
378104
|
-
init_forbidden();
|
|
378105
|
-
init_file_events();
|
|
378106
|
-
testScaffoldTool = {
|
|
378107
|
-
name: "test_scaffold",
|
|
378108
|
-
description: "Generate a test skeleton from a source file's exports.",
|
|
378109
|
-
execute: async (args2) => {
|
|
378110
|
-
try {
|
|
378111
|
-
const client = getIntelligenceClient();
|
|
378112
|
-
const router2 = getIntelligenceRouter(process.cwd());
|
|
378113
|
-
const file2 = resolve34(args2.file);
|
|
378114
|
-
const language = router2.detectLanguage(file2);
|
|
378115
|
-
const framework = args2.framework ?? await detectTestFramework(process.cwd());
|
|
378116
|
-
let outline;
|
|
378117
|
-
if (client) {
|
|
378118
|
-
const tracked2 = await client.routerGetFileOutline(file2);
|
|
378119
|
-
outline = tracked2?.value ?? null;
|
|
378120
|
-
} else {
|
|
378121
|
-
outline = await router2.executeWithFallback(language, "getFileOutline", (b) => b.getFileOutline ? b.getFileOutline(file2) : Promise.resolve(null));
|
|
378122
|
-
}
|
|
378123
|
-
if (!outline) {
|
|
378124
|
-
return {
|
|
378125
|
-
success: false,
|
|
378126
|
-
output: "Could not analyze file \u2014 no backend available",
|
|
378127
|
-
error: "unsupported"
|
|
378128
|
-
};
|
|
378129
|
-
}
|
|
378130
|
-
const exports = outline.exports;
|
|
378131
|
-
if (exports.length === 0) {
|
|
378132
|
-
return {
|
|
378133
|
-
success: false,
|
|
378134
|
-
output: "No exports found in file",
|
|
378135
|
-
error: "no exports"
|
|
378136
|
-
};
|
|
378137
|
-
}
|
|
378138
|
-
const exportDetails = await Promise.all(exports.map(async (exp) => {
|
|
378139
|
-
let typeInfo;
|
|
378140
|
-
if (client) {
|
|
378141
|
-
const tracked2 = await client.routerGetTypeInfo(file2, exp.name);
|
|
378142
|
-
typeInfo = tracked2?.value ?? null;
|
|
378143
|
-
} else {
|
|
378144
|
-
typeInfo = await router2.executeWithFallback(language, "getTypeInfo", (b) => b.getTypeInfo ? b.getTypeInfo(file2, exp.name) : Promise.resolve(null));
|
|
378145
|
-
}
|
|
378146
|
-
return {
|
|
378147
|
-
name: exp.name,
|
|
378148
|
-
kind: exp.kind,
|
|
378149
|
-
type: typeInfo?.type
|
|
378150
|
-
};
|
|
378151
|
-
}));
|
|
378152
|
-
const outputPath = args2.output ?? await inferTestPath(file2);
|
|
378153
|
-
const relativePath = relative11(dirname15(outputPath), file2).replace(/\\/g, "/");
|
|
378154
|
-
const importPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
378155
|
-
const importPathNoExt = importPath.replace(/\.(ts|tsx|js|jsx|mts|cts|mjs|cjs)$/, "");
|
|
378156
|
-
const lines = [];
|
|
378157
|
-
const importNames = exports.filter((e) => !e.isDefault).map((e) => e.name);
|
|
378158
|
-
const defaultExport = exports.find((e) => e.isDefault);
|
|
378159
|
-
if (framework === "bun") {
|
|
378160
|
-
lines.push(`import { describe, it, expect } from "bun:test";`);
|
|
378161
|
-
} else if (framework === "vitest" || framework === "jest") {
|
|
378162
|
-
lines.push(`import { describe, it, expect } from "${framework}";`);
|
|
378163
|
-
}
|
|
378164
|
-
const importParts = [];
|
|
378165
|
-
if (defaultExport) {
|
|
378166
|
-
importParts.push(defaultExport.name === "default" ? "defaultExport" : defaultExport.name);
|
|
378167
|
-
}
|
|
378168
|
-
if (importNames.length > 0) {
|
|
378169
|
-
const namedPart = `{ ${importNames.join(", ")} }`;
|
|
378170
|
-
if (importParts.length > 0) {
|
|
378171
|
-
importParts.push(namedPart);
|
|
378172
|
-
} else {
|
|
378173
|
-
importParts.push(namedPart);
|
|
378174
|
-
}
|
|
378175
|
-
}
|
|
378176
|
-
if (importParts.length > 0) {
|
|
378177
|
-
const importSpec = defaultExport && importNames.length > 0 ? `${importParts[0]}, ${importParts[1]}` : importParts.join(", ");
|
|
378178
|
-
lines.push(`import ${importSpec} from "${importPathNoExt}";`);
|
|
378179
|
-
}
|
|
378180
|
-
lines.push("");
|
|
378181
|
-
const sourceBasename = basename6(file2, extname10(file2));
|
|
378182
|
-
lines.push(`describe("${sourceBasename}", () => {`);
|
|
378183
|
-
for (const exp of exportDetails) {
|
|
378184
|
-
if (exp.name === "default")
|
|
378185
|
-
continue;
|
|
378186
|
-
lines.push("");
|
|
378187
|
-
if (exp.kind === "function") {
|
|
378188
|
-
const typeHint = exp.type ? ` // ${exp.type}` : "";
|
|
378189
|
-
lines.push(` describe("${exp.name}", () => {${typeHint}`);
|
|
378190
|
-
lines.push(` it("should work correctly", () => {`);
|
|
378191
|
-
lines.push(` // TODO: implement test`);
|
|
378192
|
-
lines.push(` expect(${exp.name}).toBeDefined();`);
|
|
378193
|
-
lines.push(` });`);
|
|
378194
|
-
lines.push(` });`);
|
|
378195
|
-
} else if (exp.kind === "class") {
|
|
378196
|
-
lines.push(` describe("${exp.name}", () => {`);
|
|
378197
|
-
lines.push(` it("should be instantiable", () => {`);
|
|
378198
|
-
lines.push(` // TODO: implement test`);
|
|
378199
|
-
lines.push(` expect(${exp.name}).toBeDefined();`);
|
|
378200
|
-
lines.push(` });`);
|
|
378201
|
-
lines.push(` });`);
|
|
378202
|
-
} else {
|
|
378203
|
-
lines.push(` it("should export ${exp.name}", () => {`);
|
|
378204
|
-
lines.push(` expect(${exp.name}).toBeDefined();`);
|
|
378205
|
-
lines.push(` });`);
|
|
378206
|
-
}
|
|
378207
|
-
}
|
|
378208
|
-
lines.push("});");
|
|
378209
|
-
lines.push("");
|
|
378210
|
-
const content = lines.join(`
|
|
378211
|
-
`);
|
|
378212
|
-
const resolvedOutput = resolve34(outputPath);
|
|
378213
|
-
const blocked = isForbidden(resolvedOutput);
|
|
378214
|
-
if (blocked) {
|
|
378215
|
-
return {
|
|
378216
|
-
success: false,
|
|
378217
|
-
output: `Access denied: output path matches forbidden pattern "${blocked}"`,
|
|
378218
|
-
error: "forbidden"
|
|
378219
|
-
};
|
|
378220
|
-
}
|
|
378221
|
-
if (!resolvedOutput.startsWith(process.cwd())) {
|
|
378222
|
-
return {
|
|
378223
|
-
success: false,
|
|
378224
|
-
output: "Output path must be within the project directory",
|
|
378225
|
-
error: "path outside project"
|
|
378226
|
-
};
|
|
378227
|
-
}
|
|
378228
|
-
await mkdir6(dirname15(resolvedOutput), {
|
|
378229
|
-
recursive: true
|
|
378230
|
-
});
|
|
378231
|
-
await writeFile13(resolvedOutput, content, "utf-8");
|
|
378232
|
-
emitFileEdited(resolvedOutput, content);
|
|
378233
|
-
return {
|
|
378234
|
-
success: true,
|
|
378235
|
-
output: `Generated test scaffold at ${outputPath}
|
|
378236
|
-
${String(exports.length)} export(s) \u2192 ${String(exportDetails.length)} test case(s)`
|
|
378237
|
-
};
|
|
378238
|
-
} catch (err2) {
|
|
378239
|
-
const msg = err2 instanceof Error ? err2.message : String(err2);
|
|
378240
|
-
return {
|
|
378241
|
-
success: false,
|
|
378242
|
-
output: msg,
|
|
378243
|
-
error: msg
|
|
378244
|
-
};
|
|
378245
|
-
}
|
|
378246
|
-
}
|
|
378247
|
-
};
|
|
378248
|
-
});
|
|
378249
|
-
|
|
378250
378059
|
// node_modules/uc.micro/properties/Any/regex.mjs
|
|
378251
378060
|
var regex_default;
|
|
378252
378061
|
var init_regex2 = __esm(() => {
|
|
@@ -379894,7 +379703,7 @@ var init_web_search2 = __esm(() => {
|
|
|
379894
379703
|
|
|
379895
379704
|
// src/core/tools/bus-cache.ts
|
|
379896
379705
|
import { readFile as readFileAsync } from "fs/promises";
|
|
379897
|
-
import { resolve as
|
|
379706
|
+
import { resolve as resolve34 } from "path";
|
|
379898
379707
|
function wrapWithBusCache(tools, bus, agentId) {
|
|
379899
379708
|
const wrapped = {
|
|
379900
379709
|
...tools
|
|
@@ -379988,7 +379797,7 @@ function wrapWithBusCache(tools, bus, agentId) {
|
|
|
379988
379797
|
const result = await origEdit(args2, opts);
|
|
379989
379798
|
const isOk = result && typeof result === "object" && result.success === true;
|
|
379990
379799
|
if (isOk) {
|
|
379991
|
-
readFileAsync(
|
|
379800
|
+
readFileAsync(resolve34(normalized), "utf-8").then((fresh) => bus.updateFile(normalized, fresh, agentId), () => bus.invalidateFile(normalized));
|
|
379992
379801
|
} else {
|
|
379993
379802
|
bus.invalidateFile(normalized);
|
|
379994
379803
|
}
|
|
@@ -380026,7 +379835,7 @@ ${text2}`;
|
|
|
380026
379835
|
const result = await origMultiEdit(args2, opts);
|
|
380027
379836
|
const isOk = result && typeof result === "object" && result.success === true;
|
|
380028
379837
|
if (isOk) {
|
|
380029
|
-
readFileAsync(
|
|
379838
|
+
readFileAsync(resolve34(normalized), "utf-8").then((fresh) => bus.updateFile(normalized, fresh, agentId), () => bus.invalidateFile(normalized));
|
|
380030
379839
|
} else {
|
|
380031
379840
|
bus.invalidateFile(normalized);
|
|
380032
379841
|
}
|
|
@@ -380107,8 +379916,8 @@ var init_bus_cache = __esm(() => {
|
|
|
380107
379916
|
});
|
|
380108
379917
|
|
|
380109
379918
|
// src/core/tools/interactive.ts
|
|
380110
|
-
import { mkdir as
|
|
380111
|
-
import { join as
|
|
379919
|
+
import { mkdir as mkdir6, writeFile as writeFile13 } from "fs/promises";
|
|
379920
|
+
import { join as join33 } from "path";
|
|
380112
379921
|
function planFileName2(sessionId) {
|
|
380113
379922
|
return sessionId ? `plan-${sessionId}.md` : "plan.md";
|
|
380114
379923
|
}
|
|
@@ -380244,13 +380053,13 @@ ${errors4.map((e) => `- ${e}`).join(`
|
|
|
380244
380053
|
lines.push(`- ${v}`);
|
|
380245
380054
|
}
|
|
380246
380055
|
}
|
|
380247
|
-
const dir =
|
|
380248
|
-
await
|
|
380056
|
+
const dir = join33(cwd2, ".soulforge", "plans");
|
|
380057
|
+
await mkdir6(dir, {
|
|
380249
380058
|
recursive: true
|
|
380250
380059
|
});
|
|
380251
380060
|
const planContent = lines.join(`
|
|
380252
380061
|
`) + validationWarnings;
|
|
380253
|
-
await
|
|
380062
|
+
await writeFile13(join33(dir, fname), planContent);
|
|
380254
380063
|
const plan = {
|
|
380255
380064
|
title: args2.title,
|
|
380256
380065
|
depth,
|
|
@@ -380338,7 +380147,7 @@ var init_interactive = __esm(() => {
|
|
|
380338
380147
|
});
|
|
380339
380148
|
|
|
380340
380149
|
// src/core/tools/index.ts
|
|
380341
|
-
import { resolve as
|
|
380150
|
+
import { resolve as resolve35 } from "path";
|
|
380342
380151
|
function deferExecute(fn) {
|
|
380343
380152
|
return async (args2) => {
|
|
380344
380153
|
await new Promise((r) => setTimeout(r, 0));
|
|
@@ -380497,7 +380306,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380497
380306
|
outputs.push(warn.trim());
|
|
380498
380307
|
const batchResults = await Promise.all(fileSpecs.map(async (spec3) => {
|
|
380499
380308
|
const fp = spec3.path;
|
|
380500
|
-
const normPath =
|
|
380309
|
+
const normPath = resolve35(fp);
|
|
380501
380310
|
const hasRanges = spec3.ranges && spec3.ranges.length > 0;
|
|
380502
380311
|
const isFullRead = !hasRanges && !spec3.target;
|
|
380503
380312
|
if (!args2.fresh && fullReadCache.has(normPath)) {
|
|
@@ -380559,7 +380368,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380559
380368
|
path: fp,
|
|
380560
380369
|
results
|
|
380561
380370
|
} of batchResults) {
|
|
380562
|
-
sequentialReadFiles.add(
|
|
380371
|
+
sequentialReadFiles.add(resolve35(fp));
|
|
380563
380372
|
if (multiFile)
|
|
380564
380373
|
outputs.push(`\u2500\u2500 ${fp} \u2500\u2500`);
|
|
380565
380374
|
for (const r of results) {
|
|
@@ -380585,7 +380394,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380585
380394
|
lineStart: exports_external.preprocess(coerceInt, exports_external.number()).nullable().optional().transform(nullToUndef).describe("1-indexed start line from your last read output. " + "The range is derived from oldString line count \u2014 lineStart anchors where to look.")
|
|
380586
380395
|
}),
|
|
380587
380396
|
execute: deferExecute(async (args2) => {
|
|
380588
|
-
const gate = await gateOutsideCwd("edit_file",
|
|
380397
|
+
const gate = await gateOutsideCwd("edit_file", resolve35(args2.path));
|
|
380589
380398
|
if (gate.blocked)
|
|
380590
380399
|
return gate.result;
|
|
380591
380400
|
if (opts?.onApproveDestructive && isSensitiveFile(args2.path)) {
|
|
@@ -380599,7 +380408,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380599
380408
|
};
|
|
380600
380409
|
}
|
|
380601
380410
|
}
|
|
380602
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380411
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.path));
|
|
380603
380412
|
const result = await editFileTool.execute({
|
|
380604
380413
|
...args2,
|
|
380605
380414
|
tabId: opts?.tabId
|
|
@@ -380639,7 +380448,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380639
380448
|
}))).describe("Array of edits to apply atomically")
|
|
380640
380449
|
}),
|
|
380641
380450
|
execute: deferExecute(async (args2) => {
|
|
380642
|
-
const gate = await gateOutsideCwd("multi_edit",
|
|
380451
|
+
const gate = await gateOutsideCwd("multi_edit", resolve35(args2.path));
|
|
380643
380452
|
if (gate.blocked)
|
|
380644
380453
|
return gate.result;
|
|
380645
380454
|
if (opts?.onApproveDestructive && isSensitiveFile(args2.path)) {
|
|
@@ -380653,7 +380462,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380653
380462
|
};
|
|
380654
380463
|
}
|
|
380655
380464
|
}
|
|
380656
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380465
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.path));
|
|
380657
380466
|
const result = await multiEditTool.execute({
|
|
380658
380467
|
...args2,
|
|
380659
380468
|
tabId: opts?.tabId
|
|
@@ -380690,7 +380499,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380690
380499
|
}))).nullable().optional().transform(nullToUndef).describe("Atomic multi-operation mode: array of {action, target?, name?, value?, newCode?, index?}. All-or-nothing.")
|
|
380691
380500
|
}),
|
|
380692
380501
|
execute: deferExecute(async (args2) => {
|
|
380693
|
-
const gate = await gateOutsideCwd("ast_edit",
|
|
380502
|
+
const gate = await gateOutsideCwd("ast_edit", resolve35(args2.path));
|
|
380694
380503
|
if (gate.blocked)
|
|
380695
380504
|
return gate.result;
|
|
380696
380505
|
if (opts?.onApproveDestructive && isSensitiveFile(args2.path)) {
|
|
@@ -380821,7 +380630,7 @@ function buildTools(cwd2, _editorSettings, onApproveWebSearch, opts) {
|
|
|
380821
380630
|
resetReadCounter();
|
|
380822
380631
|
resetReadCache();
|
|
380823
380632
|
if (args2.cwd) {
|
|
380824
|
-
const gate = await gateOutsideCwd("shell",
|
|
380633
|
+
const gate = await gateOutsideCwd("shell", resolve35(args2.cwd));
|
|
380825
380634
|
if (gate.blocked)
|
|
380826
380635
|
return gate.result;
|
|
380827
380636
|
}
|
|
@@ -380963,15 +380772,15 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
380963
380772
|
count: exports_external.number().nullable().optional().transform(nullToUndef).describe("For terminal_output: max lines to read (default: 100)")
|
|
380964
380773
|
}),
|
|
380965
380774
|
execute: deferExecute((args2) => {
|
|
380966
|
-
const
|
|
380967
|
-
if (
|
|
380775
|
+
const access5 = _editorSettings?.agentAccess ?? "on";
|
|
380776
|
+
if (access5 === "off") {
|
|
380968
380777
|
return Promise.resolve({
|
|
380969
380778
|
success: false,
|
|
380970
380779
|
output: "Editor tool is disabled. Change in /editor-config \u2192 Agent editor access.",
|
|
380971
380780
|
error: "editor access disabled"
|
|
380972
380781
|
});
|
|
380973
380782
|
}
|
|
380974
|
-
if (
|
|
380783
|
+
if (access5 === "when-open" && opts?.contextManager && !opts.contextManager.isEditorOpen()) {
|
|
380975
380784
|
return Promise.resolve({
|
|
380976
380785
|
success: false,
|
|
380977
380786
|
output: "Editor tool requires the editor panel to be open (agent access = when-open). Use edit_file instead, or open the editor panel.",
|
|
@@ -381013,11 +380822,11 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381013
380822
|
}),
|
|
381014
380823
|
execute: deferExecute(async (args2) => {
|
|
381015
380824
|
if (args2.file) {
|
|
381016
|
-
const gate = await gateOutsideCwd("rename_symbol",
|
|
380825
|
+
const gate = await gateOutsideCwd("rename_symbol", resolve35(args2.file));
|
|
381017
380826
|
if (gate.blocked)
|
|
381018
380827
|
return gate.result;
|
|
381019
380828
|
}
|
|
381020
|
-
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380829
|
+
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.file)) : null;
|
|
381021
380830
|
const result = await renameSymbolTool.execute({
|
|
381022
380831
|
...args2,
|
|
381023
380832
|
tabId: opts?.tabId
|
|
@@ -381037,11 +380846,11 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381037
380846
|
to: exports_external.string().describe("Target file path (created if it doesn't exist)")
|
|
381038
380847
|
}),
|
|
381039
380848
|
execute: deferExecute(async (args2) => {
|
|
381040
|
-
const gate = await gateOutsideCwd("move_symbol",
|
|
380849
|
+
const gate = await gateOutsideCwd("move_symbol", resolve35(args2.to));
|
|
381041
380850
|
if (gate.blocked)
|
|
381042
380851
|
return gate.result;
|
|
381043
|
-
const fromWarn = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381044
|
-
const toWarn = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380852
|
+
const fromWarn = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.from));
|
|
380853
|
+
const toWarn = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.to));
|
|
381045
380854
|
const result = await moveSymbolTool.execute({
|
|
381046
380855
|
...args2,
|
|
381047
380856
|
tabId: opts?.tabId
|
|
@@ -381060,10 +380869,10 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381060
380869
|
to: exports_external.string().describe("New file path")
|
|
381061
380870
|
}),
|
|
381062
380871
|
execute: deferExecute(async (args2) => {
|
|
381063
|
-
const gate = await gateOutsideCwd("rename_file",
|
|
380872
|
+
const gate = await gateOutsideCwd("rename_file", resolve35(args2.to));
|
|
381064
380873
|
if (gate.blocked)
|
|
381065
380874
|
return gate.result;
|
|
381066
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380875
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.from));
|
|
381067
380876
|
const result = await renameFileTool.execute({
|
|
381068
380877
|
...args2,
|
|
381069
380878
|
tabId: opts?.tabId
|
|
@@ -381088,11 +380897,11 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381088
380897
|
}),
|
|
381089
380898
|
execute: deferExecute(async (args2) => {
|
|
381090
380899
|
if (args2.file) {
|
|
381091
|
-
const gate = await gateOutsideCwd("refactor",
|
|
380900
|
+
const gate = await gateOutsideCwd("refactor", resolve35(args2.file));
|
|
381092
380901
|
if (gate.blocked)
|
|
381093
380902
|
return gate.result;
|
|
381094
380903
|
}
|
|
381095
|
-
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
380904
|
+
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.file)) : null;
|
|
381096
380905
|
const result = await refactorTool.execute({
|
|
381097
380906
|
...args2,
|
|
381098
380907
|
tabId: opts?.tabId
|
|
@@ -381137,22 +380946,6 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381137
380946
|
return discoverPatternTool.execute(args2);
|
|
381138
380947
|
})
|
|
381139
380948
|
}),
|
|
381140
|
-
test_scaffold: tool({
|
|
381141
|
-
...TEXT_OUTPUT,
|
|
381142
|
-
description: testScaffoldTool.description,
|
|
381143
|
-
inputSchema: exports_external.object({
|
|
381144
|
-
file: exports_external.string().describe("Source file to generate tests for"),
|
|
381145
|
-
framework: exports_external.enum(["vitest", "jest", "bun", "pytest", "go", "cargo"]).nullable().optional().transform(nullToUndef).describe("Test framework (auto-detected from project toolchain)"),
|
|
381146
|
-
output: exports_external.string().nullable().optional().transform(nullToUndef).describe("Output path for test file")
|
|
381147
|
-
}),
|
|
381148
|
-
execute: deferExecute(async (args2) => {
|
|
381149
|
-
const result = await testScaffoldTool.execute(args2);
|
|
381150
|
-
if (result.success && args2.output) {
|
|
381151
|
-
claimAfterCompoundEdit(opts?.tabId, opts?.tabLabel, [resolve36(args2.output)]);
|
|
381152
|
-
}
|
|
381153
|
-
return result;
|
|
381154
|
-
})
|
|
381155
|
-
}),
|
|
381156
380949
|
project: tool({
|
|
381157
380950
|
...TEXT_OUTPUT,
|
|
381158
380951
|
providerOptions: progProviderOpts,
|
|
@@ -381330,7 +381123,7 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381330
381123
|
view_range
|
|
381331
381124
|
}) => {
|
|
381332
381125
|
const fs2 = await import("fs");
|
|
381333
|
-
const absPath = path.startsWith("/") ? path :
|
|
381126
|
+
const absPath = path.startsWith("/") ? path : resolve35(effectiveCwd, path);
|
|
381334
381127
|
switch (command) {
|
|
381335
381128
|
case "view": {
|
|
381336
381129
|
if (!fs2.existsSync(absPath))
|
|
@@ -381348,7 +381141,7 @@ ${crossTabWarning}` : `Shell: ${desc}
|
|
|
381348
381141
|
`);
|
|
381349
381142
|
}
|
|
381350
381143
|
case "create": {
|
|
381351
|
-
fs2.mkdirSync(
|
|
381144
|
+
fs2.mkdirSync(resolve35(absPath, ".."), {
|
|
381352
381145
|
recursive: true
|
|
381353
381146
|
});
|
|
381354
381147
|
fs2.writeFileSync(absPath, file_text ?? "", "utf-8");
|
|
@@ -381764,7 +381557,7 @@ function buildSubagentCodeTools(opts) {
|
|
|
381764
381557
|
lineStart: exports_external.preprocess(coerceInt, exports_external.number()).nullable().optional().transform(nullToUndef).describe("1-indexed start line from your last read output. " + "The range is derived from oldString line count \u2014 lineStart anchors where to look.")
|
|
381765
381558
|
}),
|
|
381766
381559
|
execute: deferExecute(async (args2) => {
|
|
381767
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381560
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.path));
|
|
381768
381561
|
const result = await editFileTool.execute({
|
|
381769
381562
|
...args2,
|
|
381770
381563
|
tabId: opts?.tabId
|
|
@@ -381791,7 +381584,7 @@ function buildSubagentCodeTools(opts) {
|
|
|
381791
381584
|
}))).describe("Array of edits to apply atomically")
|
|
381792
381585
|
}),
|
|
381793
381586
|
execute: deferExecute(async (args2) => {
|
|
381794
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381587
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.path));
|
|
381795
381588
|
const result = await multiEditTool.execute({
|
|
381796
381589
|
...args2,
|
|
381797
381590
|
tabId: opts?.tabId
|
|
@@ -381808,7 +381601,7 @@ function buildSubagentCodeTools(opts) {
|
|
|
381808
381601
|
file: exports_external.string().nullable().optional().transform(nullToUndef).describe("File where the symbol is defined (optional)")
|
|
381809
381602
|
}),
|
|
381810
381603
|
execute: deferExecute(async (args2) => {
|
|
381811
|
-
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381604
|
+
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.file)) : null;
|
|
381812
381605
|
const result = await renameSymbolTool.execute({
|
|
381813
381606
|
...args2,
|
|
381814
381607
|
tabId: opts?.tabId
|
|
@@ -381828,8 +381621,8 @@ function buildSubagentCodeTools(opts) {
|
|
|
381828
381621
|
to: exports_external.string().describe("Target file path")
|
|
381829
381622
|
}),
|
|
381830
381623
|
execute: deferExecute(async (args2) => {
|
|
381831
|
-
const fromWarn = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381832
|
-
const toWarn = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381624
|
+
const fromWarn = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.from));
|
|
381625
|
+
const toWarn = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.to));
|
|
381833
381626
|
const result = await moveSymbolTool.execute({
|
|
381834
381627
|
...args2,
|
|
381835
381628
|
tabId: opts?.tabId
|
|
@@ -381848,7 +381641,7 @@ function buildSubagentCodeTools(opts) {
|
|
|
381848
381641
|
to: exports_external.string().describe("New file path")
|
|
381849
381642
|
}),
|
|
381850
381643
|
execute: deferExecute(async (args2) => {
|
|
381851
|
-
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381644
|
+
const warning = checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.from));
|
|
381852
381645
|
const result = await renameFileTool.execute({
|
|
381853
381646
|
...args2,
|
|
381854
381647
|
tabId: opts?.tabId
|
|
@@ -381872,7 +381665,7 @@ function buildSubagentCodeTools(opts) {
|
|
|
381872
381665
|
apply: exports_external.boolean().nullable().optional().transform(nullToUndef).describe("Apply changes to disk (default true)")
|
|
381873
381666
|
}),
|
|
381874
381667
|
execute: deferExecute(async (args2) => {
|
|
381875
|
-
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel,
|
|
381668
|
+
const warning = args2.file ? checkAndClaim(opts?.tabId, opts?.tabLabel, resolve35(args2.file)) : null;
|
|
381876
381669
|
const result = await refactorTool.execute({
|
|
381877
381670
|
...args2,
|
|
381878
381671
|
tabId: opts?.tabId
|
|
@@ -381981,7 +381774,6 @@ var init_tools = __esm(() => {
|
|
|
381981
381774
|
init_soul_grep();
|
|
381982
381775
|
init_soul_impact();
|
|
381983
381776
|
init_task_list();
|
|
381984
|
-
init_test_scaffold();
|
|
381985
381777
|
init_web_search2();
|
|
381986
381778
|
init_bus_cache();
|
|
381987
381779
|
init_constants();
|
|
@@ -382915,7 +382707,7 @@ var init_explore = __esm(() => {
|
|
|
382915
382707
|
import { spawn as spawn15 } from "child_process";
|
|
382916
382708
|
import { existsSync as existsSync29, readFileSync as readFileSync21, unlinkSync as unlinkSync7, writeFileSync as writeFileSync14 } from "fs";
|
|
382917
382709
|
import { tmpdir as tmpdir4 } from "os";
|
|
382918
|
-
import { resolve as
|
|
382710
|
+
import { resolve as resolve36 } from "path";
|
|
382919
382711
|
async function compressImageForApi(data, mediaType) {
|
|
382920
382712
|
const original = {
|
|
382921
382713
|
data,
|
|
@@ -382924,8 +382716,8 @@ async function compressImageForApi(data, mediaType) {
|
|
|
382924
382716
|
if (data.length <= MAX_RAW_BYTES)
|
|
382925
382717
|
return original;
|
|
382926
382718
|
const id = `sf-compress-${String(Date.now())}-${String(Math.random()).slice(2, 8)}`;
|
|
382927
|
-
const srcPath =
|
|
382928
|
-
const dstPath =
|
|
382719
|
+
const srcPath = resolve36(tmpdir4(), `${id}-src.png`);
|
|
382720
|
+
const dstPath = resolve36(tmpdir4(), `${id}-dst.jpg`);
|
|
382929
382721
|
try {
|
|
382930
382722
|
writeFileSync14(srcPath, data);
|
|
382931
382723
|
const qualities = [85, 70, 50, 30];
|
|
@@ -383020,17 +382812,17 @@ async function tryFfmpegOrMagickResize(src, dst, scalePercent, quality) {
|
|
|
383020
382812
|
return false;
|
|
383021
382813
|
}
|
|
383022
382814
|
function spawnQuiet(cmd, args2) {
|
|
383023
|
-
return new Promise((
|
|
382815
|
+
return new Promise((resolve37, reject) => {
|
|
383024
382816
|
const proc = spawn15(cmd, args2, {
|
|
383025
382817
|
stdio: ["ignore", "ignore", "ignore"],
|
|
383026
382818
|
timeout: 15000
|
|
383027
382819
|
});
|
|
383028
382820
|
proc.on("error", reject);
|
|
383029
|
-
proc.on("close", (code) =>
|
|
382821
|
+
proc.on("close", (code) => resolve37(code ?? 1));
|
|
383030
382822
|
});
|
|
383031
382823
|
}
|
|
383032
382824
|
function spawnStdout(cmd, args2) {
|
|
383033
|
-
return new Promise((
|
|
382825
|
+
return new Promise((resolve37, reject) => {
|
|
383034
382826
|
const proc = spawn15(cmd, args2, {
|
|
383035
382827
|
stdio: ["ignore", "pipe", "ignore"],
|
|
383036
382828
|
timeout: 5000
|
|
@@ -383040,7 +382832,7 @@ function spawnStdout(cmd, args2) {
|
|
|
383040
382832
|
out2 += chunk.toString();
|
|
383041
382833
|
});
|
|
383042
382834
|
proc.on("error", reject);
|
|
383043
|
-
proc.on("close", () =>
|
|
382835
|
+
proc.on("close", () => resolve37(out2));
|
|
383044
382836
|
});
|
|
383045
382837
|
}
|
|
383046
382838
|
function safeUnlink3(path) {
|
|
@@ -383703,9 +383495,9 @@ var name38 = "AI_MCPClientError", marker39, symbol39, _a40, _b29, MCPClientError
|
|
|
383703
383495
|
return withUserAgentSuffix(headers, `ai-sdk/${VERSION17}`, getRuntimeEnvironmentUserAgent());
|
|
383704
383496
|
}
|
|
383705
383497
|
async start() {
|
|
383706
|
-
return new Promise((
|
|
383498
|
+
return new Promise((resolve37, reject) => {
|
|
383707
383499
|
if (this.connected) {
|
|
383708
|
-
return
|
|
383500
|
+
return resolve37();
|
|
383709
383501
|
}
|
|
383710
383502
|
this.abortController = new AbortController;
|
|
383711
383503
|
const establishConnection = async (triedAuth = false) => {
|
|
@@ -383774,7 +383566,7 @@ var name38 = "AI_MCPClientError", marker39, symbol39, _a40, _b29, MCPClientError
|
|
|
383774
383566
|
});
|
|
383775
383567
|
}
|
|
383776
383568
|
this.connected = true;
|
|
383777
|
-
|
|
383569
|
+
resolve37();
|
|
383778
383570
|
} else if (event === "message") {
|
|
383779
383571
|
try {
|
|
383780
383572
|
const message = JSONRPCMessageSchema.parse(JSON.parse(data));
|
|
@@ -384311,7 +384103,7 @@ var name38 = "AI_MCPClientError", marker39, symbol39, _a40, _b29, MCPClientError
|
|
|
384311
384103
|
resultSchema,
|
|
384312
384104
|
options
|
|
384313
384105
|
}) {
|
|
384314
|
-
return new Promise((
|
|
384106
|
+
return new Promise((resolve37, reject) => {
|
|
384315
384107
|
if (this.isClosed) {
|
|
384316
384108
|
return reject(new MCPClientError({
|
|
384317
384109
|
message: "Attempted to send a request from a closed client"
|
|
@@ -384341,7 +384133,7 @@ var name38 = "AI_MCPClientError", marker39, symbol39, _a40, _b29, MCPClientError
|
|
|
384341
384133
|
}
|
|
384342
384134
|
try {
|
|
384343
384135
|
const result = resultSchema.parse(response.result);
|
|
384344
|
-
|
|
384136
|
+
resolve37(result);
|
|
384345
384137
|
} catch (error48) {
|
|
384346
384138
|
const parseError = new MCPClientError({
|
|
384347
384139
|
message: "Failed to parse server response",
|
|
@@ -385073,15 +384865,15 @@ var require_windows = __commonJS((exports, module2) => {
|
|
|
385073
384865
|
}
|
|
385074
384866
|
return false;
|
|
385075
384867
|
}
|
|
385076
|
-
function checkStat(
|
|
385077
|
-
if (!
|
|
384868
|
+
function checkStat(stat5, path, options) {
|
|
384869
|
+
if (!stat5.isSymbolicLink() && !stat5.isFile()) {
|
|
385078
384870
|
return false;
|
|
385079
384871
|
}
|
|
385080
384872
|
return checkPathExt(path, options);
|
|
385081
384873
|
}
|
|
385082
384874
|
function isexe(path, options, cb) {
|
|
385083
|
-
fs2.stat(path, function(er,
|
|
385084
|
-
cb(er, er ? false : checkStat(
|
|
384875
|
+
fs2.stat(path, function(er, stat5) {
|
|
384876
|
+
cb(er, er ? false : checkStat(stat5, path, options));
|
|
385085
384877
|
});
|
|
385086
384878
|
}
|
|
385087
384879
|
function sync(path, options) {
|
|
@@ -385095,20 +384887,20 @@ var require_mode = __commonJS((exports, module2) => {
|
|
|
385095
384887
|
isexe.sync = sync;
|
|
385096
384888
|
var fs2 = __require("fs");
|
|
385097
384889
|
function isexe(path, options, cb) {
|
|
385098
|
-
fs2.stat(path, function(er,
|
|
385099
|
-
cb(er, er ? false : checkStat(
|
|
384890
|
+
fs2.stat(path, function(er, stat5) {
|
|
384891
|
+
cb(er, er ? false : checkStat(stat5, options));
|
|
385100
384892
|
});
|
|
385101
384893
|
}
|
|
385102
384894
|
function sync(path, options) {
|
|
385103
384895
|
return checkStat(fs2.statSync(path), options);
|
|
385104
384896
|
}
|
|
385105
|
-
function checkStat(
|
|
385106
|
-
return
|
|
384897
|
+
function checkStat(stat5, options) {
|
|
384898
|
+
return stat5.isFile() && checkMode(stat5, options);
|
|
385107
384899
|
}
|
|
385108
|
-
function checkMode(
|
|
385109
|
-
var mod =
|
|
385110
|
-
var uid =
|
|
385111
|
-
var gid =
|
|
384900
|
+
function checkMode(stat5, options) {
|
|
384901
|
+
var mod = stat5.mode;
|
|
384902
|
+
var uid = stat5.uid;
|
|
384903
|
+
var gid = stat5.gid;
|
|
385112
384904
|
var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid();
|
|
385113
384905
|
var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid();
|
|
385114
384906
|
var u = parseInt("100", 8);
|
|
@@ -385140,12 +384932,12 @@ var require_isexe = __commonJS((exports, module2) => {
|
|
|
385140
384932
|
if (typeof Promise !== "function") {
|
|
385141
384933
|
throw new TypeError("callback not provided");
|
|
385142
384934
|
}
|
|
385143
|
-
return new Promise(function(
|
|
384935
|
+
return new Promise(function(resolve37, reject) {
|
|
385144
384936
|
isexe(path, options || {}, function(er, is3) {
|
|
385145
384937
|
if (er) {
|
|
385146
384938
|
reject(er);
|
|
385147
384939
|
} else {
|
|
385148
|
-
|
|
384940
|
+
resolve37(is3);
|
|
385149
384941
|
}
|
|
385150
384942
|
});
|
|
385151
384943
|
});
|
|
@@ -385207,27 +384999,27 @@ var require_which = __commonJS((exports, module2) => {
|
|
|
385207
384999
|
opt = {};
|
|
385208
385000
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
385209
385001
|
const found = [];
|
|
385210
|
-
const step = (i2) => new Promise((
|
|
385002
|
+
const step = (i2) => new Promise((resolve37, reject) => {
|
|
385211
385003
|
if (i2 === pathEnv.length)
|
|
385212
|
-
return opt.all && found.length ?
|
|
385004
|
+
return opt.all && found.length ? resolve37(found) : reject(getNotFoundError(cmd));
|
|
385213
385005
|
const ppRaw = pathEnv[i2];
|
|
385214
385006
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
385215
385007
|
const pCmd = path.join(pathPart, cmd);
|
|
385216
385008
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
385217
|
-
|
|
385009
|
+
resolve37(subStep(p, i2, 0));
|
|
385218
385010
|
});
|
|
385219
|
-
const subStep = (p, i2, ii) => new Promise((
|
|
385011
|
+
const subStep = (p, i2, ii) => new Promise((resolve37, reject) => {
|
|
385220
385012
|
if (ii === pathExt.length)
|
|
385221
|
-
return
|
|
385013
|
+
return resolve37(step(i2 + 1));
|
|
385222
385014
|
const ext = pathExt[ii];
|
|
385223
385015
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is3) => {
|
|
385224
385016
|
if (!er && is3) {
|
|
385225
385017
|
if (opt.all)
|
|
385226
385018
|
found.push(p + ext);
|
|
385227
385019
|
else
|
|
385228
|
-
return
|
|
385020
|
+
return resolve37(p + ext);
|
|
385229
385021
|
}
|
|
385230
|
-
return
|
|
385022
|
+
return resolve37(subStep(p, i2, ii + 1));
|
|
385231
385023
|
});
|
|
385232
385024
|
});
|
|
385233
385025
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -386371,7 +386163,7 @@ class StdioClientTransport {
|
|
|
386371
386163
|
if (this._process) {
|
|
386372
386164
|
throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
386373
386165
|
}
|
|
386374
|
-
return new Promise((
|
|
386166
|
+
return new Promise((resolve37, reject) => {
|
|
386375
386167
|
this._process = import_cross_spawn.default(this._serverParams.command, this._serverParams.args ?? [], {
|
|
386376
386168
|
env: {
|
|
386377
386169
|
...getDefaultEnvironment(),
|
|
@@ -386387,7 +386179,7 @@ class StdioClientTransport {
|
|
|
386387
386179
|
this.onerror?.(error48);
|
|
386388
386180
|
});
|
|
386389
386181
|
this._process.on("spawn", () => {
|
|
386390
|
-
|
|
386182
|
+
resolve37();
|
|
386391
386183
|
});
|
|
386392
386184
|
this._process.on("close", (_code) => {
|
|
386393
386185
|
this._process = undefined;
|
|
@@ -386434,20 +386226,20 @@ class StdioClientTransport {
|
|
|
386434
386226
|
if (this._process) {
|
|
386435
386227
|
const processToClose = this._process;
|
|
386436
386228
|
this._process = undefined;
|
|
386437
|
-
const closePromise = new Promise((
|
|
386229
|
+
const closePromise = new Promise((resolve37) => {
|
|
386438
386230
|
processToClose.once("close", () => {
|
|
386439
|
-
|
|
386231
|
+
resolve37();
|
|
386440
386232
|
});
|
|
386441
386233
|
});
|
|
386442
386234
|
try {
|
|
386443
386235
|
processToClose.stdin?.end();
|
|
386444
386236
|
} catch {}
|
|
386445
|
-
await Promise.race([closePromise, new Promise((
|
|
386237
|
+
await Promise.race([closePromise, new Promise((resolve37) => setTimeout(resolve37, 2000).unref())]);
|
|
386446
386238
|
if (processToClose.exitCode === null) {
|
|
386447
386239
|
try {
|
|
386448
386240
|
processToClose.kill("SIGTERM");
|
|
386449
386241
|
} catch {}
|
|
386450
|
-
await Promise.race([closePromise, new Promise((
|
|
386242
|
+
await Promise.race([closePromise, new Promise((resolve37) => setTimeout(resolve37, 2000).unref())]);
|
|
386451
386243
|
}
|
|
386452
386244
|
if (processToClose.exitCode === null) {
|
|
386453
386245
|
try {
|
|
@@ -386458,15 +386250,15 @@ class StdioClientTransport {
|
|
|
386458
386250
|
this._readBuffer.clear();
|
|
386459
386251
|
}
|
|
386460
386252
|
send(message) {
|
|
386461
|
-
return new Promise((
|
|
386253
|
+
return new Promise((resolve37) => {
|
|
386462
386254
|
if (!this._process?.stdin) {
|
|
386463
386255
|
throw new Error("Not connected");
|
|
386464
386256
|
}
|
|
386465
386257
|
const json3 = serializeMessage(message);
|
|
386466
386258
|
if (this._process.stdin.write(json3)) {
|
|
386467
|
-
|
|
386259
|
+
resolve37();
|
|
386468
386260
|
} else {
|
|
386469
|
-
this._process.stdin.once("drain",
|
|
386261
|
+
this._process.stdin.once("drain", resolve37);
|
|
386470
386262
|
}
|
|
386471
386263
|
});
|
|
386472
386264
|
}
|
|
@@ -386857,11 +386649,11 @@ function sanitizeToolName(name39) {
|
|
|
386857
386649
|
return name39.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 128);
|
|
386858
386650
|
}
|
|
386859
386651
|
function withTimeout(promise2, ms, message) {
|
|
386860
|
-
return new Promise((
|
|
386652
|
+
return new Promise((resolve37, reject) => {
|
|
386861
386653
|
const timer = setTimeout(() => reject(new Error(message)), ms);
|
|
386862
386654
|
promise2.then((v) => {
|
|
386863
386655
|
clearTimeout(timer);
|
|
386864
|
-
|
|
386656
|
+
resolve37(v);
|
|
386865
386657
|
}, (e) => {
|
|
386866
386658
|
clearTimeout(timer);
|
|
386867
386659
|
reject(e);
|
|
@@ -386901,8 +386693,8 @@ var init_mcp2 = __esm(() => {
|
|
|
386901
386693
|
});
|
|
386902
386694
|
|
|
386903
386695
|
// src/core/agents/agent-results.ts
|
|
386904
|
-
import { mkdir as
|
|
386905
|
-
import { join as
|
|
386696
|
+
import { mkdir as mkdir7, readdir as readdir6, rm as rm2, writeFile as writeFile14 } from "fs/promises";
|
|
386697
|
+
import { join as join34 } from "path";
|
|
386906
386698
|
function extractFinalText(result) {
|
|
386907
386699
|
for (let i2 = result.steps.length - 1;i2 >= 0; i2--) {
|
|
386908
386700
|
const step = result.steps[i2];
|
|
@@ -386942,11 +386734,11 @@ function busFooter(filesExamined, filesEdited) {
|
|
|
386942
386734
|
`);
|
|
386943
386735
|
}
|
|
386944
386736
|
async function writeAgentContext(dispatchId, agentId, task, agentResult, findings, agentText, cwd2, tabId) {
|
|
386945
|
-
const dir = tabId ? dispatchDir(cwd2, tabId, dispatchId) :
|
|
386946
|
-
await
|
|
386737
|
+
const dir = tabId ? dispatchDir(cwd2, tabId, dispatchId) : join34(cwd2, ".soulforge", "dispatch", dispatchId);
|
|
386738
|
+
await mkdir7(dir, {
|
|
386947
386739
|
recursive: true
|
|
386948
386740
|
});
|
|
386949
|
-
const filePath =
|
|
386741
|
+
const filePath = join34(dir, `${agentId}.md`);
|
|
386950
386742
|
const lines = [];
|
|
386951
386743
|
lines.push(`# Agent: ${agentId} (${task.role})`);
|
|
386952
386744
|
lines.push(`Task: ${task.task.slice(0, 300)}`);
|
|
@@ -386997,17 +386789,17 @@ async function writeAgentContext(dispatchId, agentId, task, agentResult, finding
|
|
|
386997
386789
|
lines.push(agentText.trim());
|
|
386998
386790
|
lines.push("");
|
|
386999
386791
|
}
|
|
387000
|
-
await
|
|
386792
|
+
await writeFile14(filePath, lines.join(`
|
|
387001
386793
|
`), "utf-8");
|
|
387002
386794
|
return filePath;
|
|
387003
386795
|
}
|
|
387004
386796
|
async function cleanupDispatchDir(cwd2, tabId, keepDispatchId) {
|
|
387005
|
-
const tabDir =
|
|
386797
|
+
const tabDir = join34(cwd2, ".soulforge", "dispatch", `tab-${tabId}`);
|
|
387006
386798
|
try {
|
|
387007
386799
|
for (const entry of await readdir6(tabDir)) {
|
|
387008
386800
|
if (entry !== keepDispatchId) {
|
|
387009
386801
|
try {
|
|
387010
|
-
await rm2(
|
|
386802
|
+
await rm2(join34(tabDir, entry), {
|
|
387011
386803
|
recursive: true
|
|
387012
386804
|
});
|
|
387013
386805
|
} catch {}
|
|
@@ -387016,7 +386808,7 @@ async function cleanupDispatchDir(cwd2, tabId, keepDispatchId) {
|
|
|
387016
386808
|
} catch {}
|
|
387017
386809
|
}
|
|
387018
386810
|
function dispatchDir(cwd2, tabId, dispatchId) {
|
|
387019
|
-
return
|
|
386811
|
+
return join34(cwd2, ".soulforge", "dispatch", `tab-${tabId}`, dispatchId);
|
|
387020
386812
|
}
|
|
387021
386813
|
var TRUNCATE_THRESHOLD = 4000, HEAD_CHARS = 2000, TAIL_CHARS = 1000;
|
|
387022
386814
|
var init_agent_results = () => {};
|
|
@@ -387061,22 +386853,22 @@ async function selfHealProxyIfNeeded(error48) {
|
|
|
387061
386853
|
if (await proxyHealthProbe())
|
|
387062
386854
|
return false;
|
|
387063
386855
|
try {
|
|
387064
|
-
await Promise.race([bounceProxy(), new Promise((
|
|
386856
|
+
await Promise.race([bounceProxy(), new Promise((resolve37) => setTimeout(() => resolve37(false), PROXY_BOUNCE_TIMEOUT_MS))]);
|
|
387065
386857
|
return true;
|
|
387066
386858
|
} catch {
|
|
387067
386859
|
return false;
|
|
387068
386860
|
}
|
|
387069
386861
|
}
|
|
387070
386862
|
function sleep3(ms, signal) {
|
|
387071
|
-
return new Promise((
|
|
386863
|
+
return new Promise((resolve37) => {
|
|
387072
386864
|
if (signal?.aborted) {
|
|
387073
|
-
|
|
386865
|
+
resolve37();
|
|
387074
386866
|
return;
|
|
387075
386867
|
}
|
|
387076
|
-
const timer = setTimeout(
|
|
386868
|
+
const timer = setTimeout(resolve37, ms);
|
|
387077
386869
|
signal?.addEventListener("abort", () => {
|
|
387078
386870
|
clearTimeout(timer);
|
|
387079
|
-
|
|
386871
|
+
resolve37();
|
|
387080
386872
|
}, {
|
|
387081
386873
|
once: true
|
|
387082
386874
|
});
|
|
@@ -388502,7 +388294,7 @@ ${postParts.join(`
|
|
|
388502
388294
|
const acquireConcurrencySlot = async () => {
|
|
388503
388295
|
const maxConcurrent = getMaxConcurrentAgents();
|
|
388504
388296
|
while (inflightCount >= maxConcurrent) {
|
|
388505
|
-
await new Promise((
|
|
388297
|
+
await new Promise((resolve37) => inflightWaiters.push(resolve37));
|
|
388506
388298
|
}
|
|
388507
388299
|
inflightCount++;
|
|
388508
388300
|
};
|
|
@@ -389092,7 +388884,6 @@ function createForgeAgent({
|
|
|
389092
388884
|
"rename_symbol",
|
|
389093
388885
|
"move_symbol",
|
|
389094
388886
|
"rename_file",
|
|
389095
|
-
"test_scaffold",
|
|
389096
388887
|
"discover_pattern",
|
|
389097
388888
|
"web_search",
|
|
389098
388889
|
"fetch_page",
|
|
@@ -389177,14 +388968,23 @@ function createForgeAgent({
|
|
|
389177
388968
|
forgeTools,
|
|
389178
388969
|
parentMessagesRef
|
|
389179
388970
|
});
|
|
388971
|
+
const interactiveCallbacks = interactive ?? {
|
|
388972
|
+
onPlanCreate: () => {},
|
|
388973
|
+
onPlanStepUpdate: () => {},
|
|
388974
|
+
onPlanReview: async () => "execute",
|
|
388975
|
+
onAskUser: async (_q, options, allowSkip) => allowSkip ? "__skipped__" : options[0]?.value ?? "",
|
|
388976
|
+
onOpenEditor: async () => {},
|
|
388977
|
+
onWebSearchApproval: async () => true,
|
|
388978
|
+
onFetchPageApproval: async () => true
|
|
388979
|
+
};
|
|
389180
388980
|
const allTools = {
|
|
389181
388981
|
...orderedTools,
|
|
389182
388982
|
...subagentTools,
|
|
389183
|
-
...
|
|
388983
|
+
...buildInteractiveTools(interactiveCallbacks, {
|
|
389184
388984
|
cwd: cwd2,
|
|
389185
388985
|
sessionId,
|
|
389186
388986
|
forgeMode
|
|
389187
|
-
})
|
|
388987
|
+
})
|
|
389188
388988
|
};
|
|
389189
388989
|
const allToolNames = Object.keys(allTools);
|
|
389190
388990
|
const restrictedSet = new Set(RESTRICTED_TOOL_NAMES);
|
|
@@ -391984,7 +391784,7 @@ var require_safe_stable_stringify = __commonJS((exports, module2) => {
|
|
|
391984
391784
|
return circularValue;
|
|
391985
391785
|
}
|
|
391986
391786
|
let res = "";
|
|
391987
|
-
let
|
|
391787
|
+
let join35 = ",";
|
|
391988
391788
|
const originalIndentation = indentation;
|
|
391989
391789
|
if (Array.isArray(value)) {
|
|
391990
391790
|
if (value.length === 0) {
|
|
@@ -391998,7 +391798,7 @@ var require_safe_stable_stringify = __commonJS((exports, module2) => {
|
|
|
391998
391798
|
indentation += spacer;
|
|
391999
391799
|
res += `
|
|
392000
391800
|
${indentation}`;
|
|
392001
|
-
|
|
391801
|
+
join35 = `,
|
|
392002
391802
|
${indentation}`;
|
|
392003
391803
|
}
|
|
392004
391804
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -392006,13 +391806,13 @@ ${indentation}`;
|
|
|
392006
391806
|
for (;i2 < maximumValuesToStringify - 1; i2++) {
|
|
392007
391807
|
const tmp2 = stringifyFnReplacer(String(i2), value, stack, replacer, spacer, indentation);
|
|
392008
391808
|
res += tmp2 !== undefined ? tmp2 : "null";
|
|
392009
|
-
res +=
|
|
391809
|
+
res += join35;
|
|
392010
391810
|
}
|
|
392011
391811
|
const tmp = stringifyFnReplacer(String(i2), value, stack, replacer, spacer, indentation);
|
|
392012
391812
|
res += tmp !== undefined ? tmp : "null";
|
|
392013
391813
|
if (value.length - 1 > maximumBreadth) {
|
|
392014
391814
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
392015
|
-
res += `${
|
|
391815
|
+
res += `${join35}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
392016
391816
|
}
|
|
392017
391817
|
if (spacer !== "") {
|
|
392018
391818
|
res += `
|
|
@@ -392033,7 +391833,7 @@ ${originalIndentation}`;
|
|
|
392033
391833
|
let separator = "";
|
|
392034
391834
|
if (spacer !== "") {
|
|
392035
391835
|
indentation += spacer;
|
|
392036
|
-
|
|
391836
|
+
join35 = `,
|
|
392037
391837
|
${indentation}`;
|
|
392038
391838
|
whitespace2 = " ";
|
|
392039
391839
|
}
|
|
@@ -392047,13 +391847,13 @@ ${indentation}`;
|
|
|
392047
391847
|
const tmp = stringifyFnReplacer(key3, value, stack, replacer, spacer, indentation);
|
|
392048
391848
|
if (tmp !== undefined) {
|
|
392049
391849
|
res += `${separator}${strEscape(key3)}:${whitespace2}${tmp}`;
|
|
392050
|
-
separator =
|
|
391850
|
+
separator = join35;
|
|
392051
391851
|
}
|
|
392052
391852
|
}
|
|
392053
391853
|
if (keyLength > maximumBreadth) {
|
|
392054
391854
|
const removedKeys = keyLength - maximumBreadth;
|
|
392055
391855
|
res += `${separator}"...":${whitespace2}"${getItemCount(removedKeys)} not stringified"`;
|
|
392056
|
-
separator =
|
|
391856
|
+
separator = join35;
|
|
392057
391857
|
}
|
|
392058
391858
|
if (spacer !== "" && separator.length > 1) {
|
|
392059
391859
|
res = `
|
|
@@ -392093,7 +391893,7 @@ ${originalIndentation}`;
|
|
|
392093
391893
|
}
|
|
392094
391894
|
const originalIndentation = indentation;
|
|
392095
391895
|
let res = "";
|
|
392096
|
-
let
|
|
391896
|
+
let join35 = ",";
|
|
392097
391897
|
if (Array.isArray(value)) {
|
|
392098
391898
|
if (value.length === 0) {
|
|
392099
391899
|
return "[]";
|
|
@@ -392106,7 +391906,7 @@ ${originalIndentation}`;
|
|
|
392106
391906
|
indentation += spacer;
|
|
392107
391907
|
res += `
|
|
392108
391908
|
${indentation}`;
|
|
392109
|
-
|
|
391909
|
+
join35 = `,
|
|
392110
391910
|
${indentation}`;
|
|
392111
391911
|
}
|
|
392112
391912
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -392114,13 +391914,13 @@ ${indentation}`;
|
|
|
392114
391914
|
for (;i2 < maximumValuesToStringify - 1; i2++) {
|
|
392115
391915
|
const tmp2 = stringifyArrayReplacer(String(i2), value[i2], stack, replacer, spacer, indentation);
|
|
392116
391916
|
res += tmp2 !== undefined ? tmp2 : "null";
|
|
392117
|
-
res +=
|
|
391917
|
+
res += join35;
|
|
392118
391918
|
}
|
|
392119
391919
|
const tmp = stringifyArrayReplacer(String(i2), value[i2], stack, replacer, spacer, indentation);
|
|
392120
391920
|
res += tmp !== undefined ? tmp : "null";
|
|
392121
391921
|
if (value.length - 1 > maximumBreadth) {
|
|
392122
391922
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
392123
|
-
res += `${
|
|
391923
|
+
res += `${join35}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
392124
391924
|
}
|
|
392125
391925
|
if (spacer !== "") {
|
|
392126
391926
|
res += `
|
|
@@ -392133,7 +391933,7 @@ ${originalIndentation}`;
|
|
|
392133
391933
|
let whitespace2 = "";
|
|
392134
391934
|
if (spacer !== "") {
|
|
392135
391935
|
indentation += spacer;
|
|
392136
|
-
|
|
391936
|
+
join35 = `,
|
|
392137
391937
|
${indentation}`;
|
|
392138
391938
|
whitespace2 = " ";
|
|
392139
391939
|
}
|
|
@@ -392142,7 +391942,7 @@ ${indentation}`;
|
|
|
392142
391942
|
const tmp = stringifyArrayReplacer(key3, value[key3], stack, replacer, spacer, indentation);
|
|
392143
391943
|
if (tmp !== undefined) {
|
|
392144
391944
|
res += `${separator}${strEscape(key3)}:${whitespace2}${tmp}`;
|
|
392145
|
-
separator =
|
|
391945
|
+
separator = join35;
|
|
392146
391946
|
}
|
|
392147
391947
|
}
|
|
392148
391948
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -392199,20 +391999,20 @@ ${originalIndentation}`;
|
|
|
392199
391999
|
indentation += spacer;
|
|
392200
392000
|
let res2 = `
|
|
392201
392001
|
${indentation}`;
|
|
392202
|
-
const
|
|
392002
|
+
const join36 = `,
|
|
392203
392003
|
${indentation}`;
|
|
392204
392004
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
392205
392005
|
let i2 = 0;
|
|
392206
392006
|
for (;i2 < maximumValuesToStringify - 1; i2++) {
|
|
392207
392007
|
const tmp2 = stringifyIndent(String(i2), value[i2], stack, spacer, indentation);
|
|
392208
392008
|
res2 += tmp2 !== undefined ? tmp2 : "null";
|
|
392209
|
-
res2 +=
|
|
392009
|
+
res2 += join36;
|
|
392210
392010
|
}
|
|
392211
392011
|
const tmp = stringifyIndent(String(i2), value[i2], stack, spacer, indentation);
|
|
392212
392012
|
res2 += tmp !== undefined ? tmp : "null";
|
|
392213
392013
|
if (value.length - 1 > maximumBreadth) {
|
|
392214
392014
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
392215
|
-
res2 += `${
|
|
392015
|
+
res2 += `${join36}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
392216
392016
|
}
|
|
392217
392017
|
res2 += `
|
|
392218
392018
|
${originalIndentation}`;
|
|
@@ -392228,16 +392028,16 @@ ${originalIndentation}`;
|
|
|
392228
392028
|
return '"[Object]"';
|
|
392229
392029
|
}
|
|
392230
392030
|
indentation += spacer;
|
|
392231
|
-
const
|
|
392031
|
+
const join35 = `,
|
|
392232
392032
|
${indentation}`;
|
|
392233
392033
|
let res = "";
|
|
392234
392034
|
let separator = "";
|
|
392235
392035
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
392236
392036
|
if (isTypedArrayWithEntries(value)) {
|
|
392237
|
-
res += stringifyTypedArray(value,
|
|
392037
|
+
res += stringifyTypedArray(value, join35, maximumBreadth);
|
|
392238
392038
|
keys2 = keys2.slice(value.length);
|
|
392239
392039
|
maximumPropertiesToStringify -= value.length;
|
|
392240
|
-
separator =
|
|
392040
|
+
separator = join35;
|
|
392241
392041
|
}
|
|
392242
392042
|
if (deterministic) {
|
|
392243
392043
|
keys2 = sort(keys2, comparator);
|
|
@@ -392248,13 +392048,13 @@ ${indentation}`;
|
|
|
392248
392048
|
const tmp = stringifyIndent(key3, value[key3], stack, spacer, indentation);
|
|
392249
392049
|
if (tmp !== undefined) {
|
|
392250
392050
|
res += `${separator}${strEscape(key3)}: ${tmp}`;
|
|
392251
|
-
separator =
|
|
392051
|
+
separator = join35;
|
|
392252
392052
|
}
|
|
392253
392053
|
}
|
|
392254
392054
|
if (keyLength > maximumBreadth) {
|
|
392255
392055
|
const removedKeys = keyLength - maximumBreadth;
|
|
392256
392056
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
392257
|
-
separator =
|
|
392057
|
+
separator = join35;
|
|
392258
392058
|
}
|
|
392259
392059
|
if (separator !== "") {
|
|
392260
392060
|
res = `
|
|
@@ -393746,7 +393546,7 @@ var require_buffer_list = __commonJS((exports, module2) => {
|
|
|
393746
393546
|
}
|
|
393747
393547
|
}, {
|
|
393748
393548
|
key: "join",
|
|
393749
|
-
value: function
|
|
393549
|
+
value: function join35(s) {
|
|
393750
393550
|
if (this.length === 0)
|
|
393751
393551
|
return "";
|
|
393752
393552
|
var p = this.head;
|
|
@@ -394320,14 +394120,14 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394320
394120
|
};
|
|
394321
394121
|
}
|
|
394322
394122
|
function readAndResolve(iter) {
|
|
394323
|
-
var
|
|
394324
|
-
if (
|
|
394123
|
+
var resolve37 = iter[kLastResolve];
|
|
394124
|
+
if (resolve37 !== null) {
|
|
394325
394125
|
var data = iter[kStream].read();
|
|
394326
394126
|
if (data !== null) {
|
|
394327
394127
|
iter[kLastPromise] = null;
|
|
394328
394128
|
iter[kLastResolve] = null;
|
|
394329
394129
|
iter[kLastReject] = null;
|
|
394330
|
-
|
|
394130
|
+
resolve37(createIterResult(data, false));
|
|
394331
394131
|
}
|
|
394332
394132
|
}
|
|
394333
394133
|
}
|
|
@@ -394335,13 +394135,13 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394335
394135
|
process.nextTick(readAndResolve, iter);
|
|
394336
394136
|
}
|
|
394337
394137
|
function wrapForNext(lastPromise, iter) {
|
|
394338
|
-
return function(
|
|
394138
|
+
return function(resolve37, reject) {
|
|
394339
394139
|
lastPromise.then(function() {
|
|
394340
394140
|
if (iter[kEnded]) {
|
|
394341
|
-
|
|
394141
|
+
resolve37(createIterResult(undefined, true));
|
|
394342
394142
|
return;
|
|
394343
394143
|
}
|
|
394344
|
-
iter[kHandlePromise](
|
|
394144
|
+
iter[kHandlePromise](resolve37, reject);
|
|
394345
394145
|
}, reject);
|
|
394346
394146
|
};
|
|
394347
394147
|
}
|
|
@@ -394360,12 +394160,12 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394360
394160
|
return Promise.resolve(createIterResult(undefined, true));
|
|
394361
394161
|
}
|
|
394362
394162
|
if (this[kStream].destroyed) {
|
|
394363
|
-
return new Promise(function(
|
|
394163
|
+
return new Promise(function(resolve37, reject) {
|
|
394364
394164
|
process.nextTick(function() {
|
|
394365
394165
|
if (_this[kError]) {
|
|
394366
394166
|
reject(_this[kError]);
|
|
394367
394167
|
} else {
|
|
394368
|
-
|
|
394168
|
+
resolve37(createIterResult(undefined, true));
|
|
394369
394169
|
}
|
|
394370
394170
|
});
|
|
394371
394171
|
});
|
|
@@ -394388,13 +394188,13 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394388
394188
|
return this;
|
|
394389
394189
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
394390
394190
|
var _this2 = this;
|
|
394391
|
-
return new Promise(function(
|
|
394191
|
+
return new Promise(function(resolve37, reject) {
|
|
394392
394192
|
_this2[kStream].destroy(null, function(err2) {
|
|
394393
394193
|
if (err2) {
|
|
394394
394194
|
reject(err2);
|
|
394395
394195
|
return;
|
|
394396
394196
|
}
|
|
394397
|
-
|
|
394197
|
+
resolve37(createIterResult(undefined, true));
|
|
394398
394198
|
});
|
|
394399
394199
|
});
|
|
394400
394200
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -394416,15 +394216,15 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394416
394216
|
value: stream._readableState.endEmitted,
|
|
394417
394217
|
writable: true
|
|
394418
394218
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
394419
|
-
value: function value(
|
|
394219
|
+
value: function value(resolve37, reject) {
|
|
394420
394220
|
var data = iterator[kStream].read();
|
|
394421
394221
|
if (data) {
|
|
394422
394222
|
iterator[kLastPromise] = null;
|
|
394423
394223
|
iterator[kLastResolve] = null;
|
|
394424
394224
|
iterator[kLastReject] = null;
|
|
394425
|
-
|
|
394225
|
+
resolve37(createIterResult(data, false));
|
|
394426
394226
|
} else {
|
|
394427
|
-
iterator[kLastResolve] =
|
|
394227
|
+
iterator[kLastResolve] = resolve37;
|
|
394428
394228
|
iterator[kLastReject] = reject;
|
|
394429
394229
|
}
|
|
394430
394230
|
},
|
|
@@ -394443,12 +394243,12 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394443
394243
|
iterator[kError] = err2;
|
|
394444
394244
|
return;
|
|
394445
394245
|
}
|
|
394446
|
-
var
|
|
394447
|
-
if (
|
|
394246
|
+
var resolve37 = iterator[kLastResolve];
|
|
394247
|
+
if (resolve37 !== null) {
|
|
394448
394248
|
iterator[kLastPromise] = null;
|
|
394449
394249
|
iterator[kLastResolve] = null;
|
|
394450
394250
|
iterator[kLastReject] = null;
|
|
394451
|
-
|
|
394251
|
+
resolve37(createIterResult(undefined, true));
|
|
394452
394252
|
}
|
|
394453
394253
|
iterator[kEnded] = true;
|
|
394454
394254
|
});
|
|
@@ -394460,7 +394260,7 @@ var require_async_iterator = __commonJS((exports, module2) => {
|
|
|
394460
394260
|
|
|
394461
394261
|
// node_modules/readable-stream/lib/internal/streams/from.js
|
|
394462
394262
|
var require_from = __commonJS((exports, module2) => {
|
|
394463
|
-
function asyncGeneratorStep(gen,
|
|
394263
|
+
function asyncGeneratorStep(gen, resolve37, reject, _next, _throw, key2, arg) {
|
|
394464
394264
|
try {
|
|
394465
394265
|
var info2 = gen[key2](arg);
|
|
394466
394266
|
var value = info2.value;
|
|
@@ -394469,7 +394269,7 @@ var require_from = __commonJS((exports, module2) => {
|
|
|
394469
394269
|
return;
|
|
394470
394270
|
}
|
|
394471
394271
|
if (info2.done) {
|
|
394472
|
-
|
|
394272
|
+
resolve37(value);
|
|
394473
394273
|
} else {
|
|
394474
394274
|
Promise.resolve(value).then(_next, _throw);
|
|
394475
394275
|
}
|
|
@@ -394477,13 +394277,13 @@ var require_from = __commonJS((exports, module2) => {
|
|
|
394477
394277
|
function _asyncToGenerator(fn) {
|
|
394478
394278
|
return function() {
|
|
394479
394279
|
var self2 = this, args2 = arguments;
|
|
394480
|
-
return new Promise(function(
|
|
394280
|
+
return new Promise(function(resolve37, reject) {
|
|
394481
394281
|
var gen = fn.apply(self2, args2);
|
|
394482
394282
|
function _next(value) {
|
|
394483
|
-
asyncGeneratorStep(gen,
|
|
394283
|
+
asyncGeneratorStep(gen, resolve37, reject, _next, _throw, "next", value);
|
|
394484
394284
|
}
|
|
394485
394285
|
function _throw(err2) {
|
|
394486
|
-
asyncGeneratorStep(gen,
|
|
394286
|
+
asyncGeneratorStep(gen, resolve37, reject, _next, _throw, "throw", err2);
|
|
394487
394287
|
}
|
|
394488
394288
|
_next(undefined);
|
|
394489
394289
|
});
|
|
@@ -396323,11 +396123,11 @@ var require_awaitify = __commonJS((exports, module2) => {
|
|
|
396323
396123
|
if (typeof args2[arity2 - 1] === "function") {
|
|
396324
396124
|
return asyncFn.apply(this, args2);
|
|
396325
396125
|
}
|
|
396326
|
-
return new Promise((
|
|
396126
|
+
return new Promise((resolve37, reject) => {
|
|
396327
396127
|
args2[arity2 - 1] = (err2, ...cbArgs) => {
|
|
396328
396128
|
if (err2)
|
|
396329
396129
|
return reject(err2);
|
|
396330
|
-
|
|
396130
|
+
resolve37(cbArgs.length > 1 ? cbArgs : cbArgs[0]);
|
|
396331
396131
|
};
|
|
396332
396132
|
asyncFn.apply(this, args2);
|
|
396333
396133
|
});
|
|
@@ -396943,11 +396743,11 @@ var require_diagnostics = __commonJS((exports, module2) => {
|
|
|
396943
396743
|
}
|
|
396944
396744
|
if (!async.length)
|
|
396945
396745
|
return false;
|
|
396946
|
-
return new Promise(function pinky(
|
|
396746
|
+
return new Promise(function pinky(resolve37) {
|
|
396947
396747
|
Promise.all(async.map(function prebind(fn) {
|
|
396948
396748
|
return fn(namespace);
|
|
396949
396749
|
})).then(function resolved(values) {
|
|
396950
|
-
|
|
396750
|
+
resolve37(values.some(Boolean));
|
|
396951
396751
|
});
|
|
396952
396752
|
});
|
|
396953
396753
|
}
|
|
@@ -399111,7 +398911,7 @@ var require_file = __commonJS((exports, module2) => {
|
|
|
399111
398911
|
stat(callback) {
|
|
399112
398912
|
const target = this._getFile();
|
|
399113
398913
|
const fullpath = path.join(this.dirname, target);
|
|
399114
|
-
fs2.stat(fullpath, (err2,
|
|
398914
|
+
fs2.stat(fullpath, (err2, stat5) => {
|
|
399115
398915
|
if (err2 && err2.code === "ENOENT") {
|
|
399116
398916
|
debug("ENOENT\xA0ok", fullpath);
|
|
399117
398917
|
this.filename = target;
|
|
@@ -399121,11 +398921,11 @@ var require_file = __commonJS((exports, module2) => {
|
|
|
399121
398921
|
debug(`err ${err2.code} ${fullpath}`);
|
|
399122
398922
|
return callback(err2);
|
|
399123
398923
|
}
|
|
399124
|
-
if (!
|
|
398924
|
+
if (!stat5 || this._needsNewFile(stat5.size)) {
|
|
399125
398925
|
return this._incFile(() => this.stat(callback));
|
|
399126
398926
|
}
|
|
399127
398927
|
this.filename = target;
|
|
399128
|
-
callback(null,
|
|
398928
|
+
callback(null, stat5.size);
|
|
399129
398929
|
});
|
|
399130
398930
|
}
|
|
399131
398931
|
close(cb) {
|
|
@@ -399192,42 +398992,42 @@ var require_file = __commonJS((exports, module2) => {
|
|
|
399192
398992
|
_incFile(callback) {
|
|
399193
398993
|
debug("_incFile", this.filename);
|
|
399194
398994
|
const ext = path.extname(this._basename);
|
|
399195
|
-
const
|
|
398995
|
+
const basename6 = path.basename(this._basename, ext);
|
|
399196
398996
|
const tasks = [];
|
|
399197
398997
|
if (this.zippedArchive) {
|
|
399198
398998
|
tasks.push(function(cb) {
|
|
399199
398999
|
const num = this._created > 0 && !this.tailable ? this._created : "";
|
|
399200
|
-
this._compressFile(path.join(this.dirname, `${
|
|
399000
|
+
this._compressFile(path.join(this.dirname, `${basename6}${num}${ext}`), path.join(this.dirname, `${basename6}${num}${ext}.gz`), cb);
|
|
399201
399001
|
}.bind(this));
|
|
399202
399002
|
}
|
|
399203
399003
|
tasks.push(function(cb) {
|
|
399204
399004
|
if (!this.tailable) {
|
|
399205
399005
|
this._created += 1;
|
|
399206
|
-
this._checkMaxFilesIncrementing(ext,
|
|
399006
|
+
this._checkMaxFilesIncrementing(ext, basename6, cb);
|
|
399207
399007
|
} else {
|
|
399208
|
-
this._checkMaxFilesTailable(ext,
|
|
399008
|
+
this._checkMaxFilesTailable(ext, basename6, cb);
|
|
399209
399009
|
}
|
|
399210
399010
|
}.bind(this));
|
|
399211
399011
|
asyncSeries(tasks, callback);
|
|
399212
399012
|
}
|
|
399213
399013
|
_getFile() {
|
|
399214
399014
|
const ext = path.extname(this._basename);
|
|
399215
|
-
const
|
|
399015
|
+
const basename6 = path.basename(this._basename, ext);
|
|
399216
399016
|
const isRotation = this.rotationFormat ? this.rotationFormat() : this._created;
|
|
399217
|
-
return !this.tailable && this._created ? `${
|
|
399017
|
+
return !this.tailable && this._created ? `${basename6}${isRotation}${ext}` : `${basename6}${ext}`;
|
|
399218
399018
|
}
|
|
399219
|
-
_checkMaxFilesIncrementing(ext,
|
|
399019
|
+
_checkMaxFilesIncrementing(ext, basename6, callback) {
|
|
399220
399020
|
if (!this.maxFiles || this._created < this.maxFiles) {
|
|
399221
399021
|
return setImmediate(callback);
|
|
399222
399022
|
}
|
|
399223
399023
|
const oldest = this._created - this.maxFiles;
|
|
399224
399024
|
const isOldest = oldest !== 0 ? oldest : "";
|
|
399225
399025
|
const isZipped = this.zippedArchive ? ".gz" : "";
|
|
399226
|
-
const filePath = `${
|
|
399026
|
+
const filePath = `${basename6}${isOldest}${ext}${isZipped}`;
|
|
399227
399027
|
const target = path.join(this.dirname, filePath);
|
|
399228
399028
|
fs2.unlink(target, callback);
|
|
399229
399029
|
}
|
|
399230
|
-
_checkMaxFilesTailable(ext,
|
|
399030
|
+
_checkMaxFilesTailable(ext, basename6, callback) {
|
|
399231
399031
|
const tasks = [];
|
|
399232
399032
|
if (!this.maxFiles) {
|
|
399233
399033
|
return;
|
|
@@ -399235,19 +399035,19 @@ var require_file = __commonJS((exports, module2) => {
|
|
|
399235
399035
|
const isZipped = this.zippedArchive ? ".gz" : "";
|
|
399236
399036
|
for (let x = this.maxFiles - 1;x > 1; x--) {
|
|
399237
399037
|
tasks.push(function(i2, cb) {
|
|
399238
|
-
let fileName = `${
|
|
399038
|
+
let fileName = `${basename6}${i2 - 1}${ext}${isZipped}`;
|
|
399239
399039
|
const tmppath = path.join(this.dirname, fileName);
|
|
399240
399040
|
fs2.exists(tmppath, (exists) => {
|
|
399241
399041
|
if (!exists) {
|
|
399242
399042
|
return cb(null);
|
|
399243
399043
|
}
|
|
399244
|
-
fileName = `${
|
|
399044
|
+
fileName = `${basename6}${i2}${ext}${isZipped}`;
|
|
399245
399045
|
fs2.rename(tmppath, path.join(this.dirname, fileName), cb);
|
|
399246
399046
|
});
|
|
399247
399047
|
}.bind(this, x));
|
|
399248
399048
|
}
|
|
399249
399049
|
asyncSeries(tasks, () => {
|
|
399250
|
-
fs2.rename(path.join(this.dirname, `${
|
|
399050
|
+
fs2.rename(path.join(this.dirname, `${basename6}${ext}${isZipped}`), path.join(this.dirname, `${basename6}1${ext}${isZipped}`), callback);
|
|
399251
399051
|
});
|
|
399252
399052
|
}
|
|
399253
399053
|
_compressFile(src, dest, callback) {
|
|
@@ -400778,11 +400578,11 @@ var require_logger2 = __commonJS((exports) => {
|
|
|
400778
400578
|
var require_Base = __commonJS((exports) => {
|
|
400779
400579
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
400780
400580
|
function adopt(value) {
|
|
400781
|
-
return value instanceof P ? value : new P(function(
|
|
400782
|
-
|
|
400581
|
+
return value instanceof P ? value : new P(function(resolve37) {
|
|
400582
|
+
resolve37(value);
|
|
400783
400583
|
});
|
|
400784
400584
|
}
|
|
400785
|
-
return new (P || (P = Promise))(function(
|
|
400585
|
+
return new (P || (P = Promise))(function(resolve37, reject) {
|
|
400786
400586
|
function fulfilled(value) {
|
|
400787
400587
|
try {
|
|
400788
400588
|
step(generator.next(value));
|
|
@@ -400798,7 +400598,7 @@ var require_Base = __commonJS((exports) => {
|
|
|
400798
400598
|
}
|
|
400799
400599
|
}
|
|
400800
400600
|
function step(result) {
|
|
400801
|
-
result.done ?
|
|
400601
|
+
result.done ? resolve37(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
400802
400602
|
}
|
|
400803
400603
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
400804
400604
|
});
|
|
@@ -400815,7 +400615,7 @@ var require_Base = __commonJS((exports) => {
|
|
|
400815
400615
|
constructor({ transport, data, logger, metadata: metadata2, client }) {
|
|
400816
400616
|
super();
|
|
400817
400617
|
this._isReady = Promise.resolve(false);
|
|
400818
|
-
this[_a31] = (name39, args2 = []) => new Promise((
|
|
400618
|
+
this[_a31] = (name39, args2 = []) => new Promise((resolve37, reject) => {
|
|
400819
400619
|
this.transport.request(name39, args2, (err2, res) => {
|
|
400820
400620
|
if (this.logger.level === "debug") {
|
|
400821
400621
|
let logData;
|
|
@@ -400829,7 +400629,7 @@ var require_Base = __commonJS((exports) => {
|
|
|
400829
400629
|
if (err2) {
|
|
400830
400630
|
reject(new Error(`${name39}: ${err2[1]}`));
|
|
400831
400631
|
} else {
|
|
400832
|
-
|
|
400632
|
+
resolve37(res);
|
|
400833
400633
|
}
|
|
400834
400634
|
});
|
|
400835
400635
|
});
|
|
@@ -400909,11 +400709,11 @@ var require_Base = __commonJS((exports) => {
|
|
|
400909
400709
|
var require_Buffer = __commonJS((exports) => {
|
|
400910
400710
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
400911
400711
|
function adopt(value) {
|
|
400912
|
-
return value instanceof P ? value : new P(function(
|
|
400913
|
-
|
|
400712
|
+
return value instanceof P ? value : new P(function(resolve37) {
|
|
400713
|
+
resolve37(value);
|
|
400914
400714
|
});
|
|
400915
400715
|
}
|
|
400916
|
-
return new (P || (P = Promise))(function(
|
|
400716
|
+
return new (P || (P = Promise))(function(resolve37, reject) {
|
|
400917
400717
|
function fulfilled(value) {
|
|
400918
400718
|
try {
|
|
400919
400719
|
step(generator.next(value));
|
|
@@ -400929,7 +400729,7 @@ var require_Buffer = __commonJS((exports) => {
|
|
|
400929
400729
|
}
|
|
400930
400730
|
}
|
|
400931
400731
|
function step(result) {
|
|
400932
|
-
result.done ?
|
|
400732
|
+
result.done ? resolve37(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
400933
400733
|
}
|
|
400934
400734
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
400935
400735
|
});
|
|
@@ -401293,11 +401093,11 @@ var require_types2 = __commonJS((exports) => {
|
|
|
401293
401093
|
var require_transport = __commonJS((exports) => {
|
|
401294
401094
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
401295
401095
|
function adopt(value) {
|
|
401296
|
-
return value instanceof P ? value : new P(function(
|
|
401297
|
-
|
|
401096
|
+
return value instanceof P ? value : new P(function(resolve37) {
|
|
401097
|
+
resolve37(value);
|
|
401298
401098
|
});
|
|
401299
401099
|
}
|
|
401300
|
-
return new (P || (P = Promise))(function(
|
|
401100
|
+
return new (P || (P = Promise))(function(resolve37, reject) {
|
|
401301
401101
|
function fulfilled(value) {
|
|
401302
401102
|
try {
|
|
401303
401103
|
step(generator.next(value));
|
|
@@ -401313,7 +401113,7 @@ var require_transport = __commonJS((exports) => {
|
|
|
401313
401113
|
}
|
|
401314
401114
|
}
|
|
401315
401115
|
function step(result) {
|
|
401316
|
-
result.done ?
|
|
401116
|
+
result.done ? resolve37(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
401317
401117
|
}
|
|
401318
401118
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
401319
401119
|
});
|
|
@@ -401442,8 +401242,8 @@ var require_transport = __commonJS((exports) => {
|
|
|
401442
401242
|
}
|
|
401443
401243
|
close() {
|
|
401444
401244
|
return __awaiter2(this, undefined, undefined, function* () {
|
|
401445
|
-
return new Promise((
|
|
401446
|
-
this.writer.end(
|
|
401245
|
+
return new Promise((resolve37) => {
|
|
401246
|
+
this.writer.end(resolve37);
|
|
401447
401247
|
});
|
|
401448
401248
|
});
|
|
401449
401249
|
}
|
|
@@ -401720,11 +401520,11 @@ var require_Neovim = __commonJS((exports) => {
|
|
|
401720
401520
|
var require_client = __commonJS((exports) => {
|
|
401721
401521
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
401722
401522
|
function adopt(value) {
|
|
401723
|
-
return value instanceof P ? value : new P(function(
|
|
401724
|
-
|
|
401523
|
+
return value instanceof P ? value : new P(function(resolve37) {
|
|
401524
|
+
resolve37(value);
|
|
401725
401525
|
});
|
|
401726
401526
|
}
|
|
401727
|
-
return new (P || (P = Promise))(function(
|
|
401527
|
+
return new (P || (P = Promise))(function(resolve37, reject) {
|
|
401728
401528
|
function fulfilled(value) {
|
|
401729
401529
|
try {
|
|
401730
401530
|
step(generator.next(value));
|
|
@@ -401740,7 +401540,7 @@ var require_client = __commonJS((exports) => {
|
|
|
401740
401540
|
}
|
|
401741
401541
|
}
|
|
401742
401542
|
function step(result) {
|
|
401743
|
-
result.done ?
|
|
401543
|
+
result.done ? resolve37(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
401744
401544
|
}
|
|
401745
401545
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
401746
401546
|
});
|
|
@@ -401845,12 +401645,12 @@ var require_client = __commonJS((exports) => {
|
|
|
401845
401645
|
this._isReady = this.generateApi();
|
|
401846
401646
|
}
|
|
401847
401647
|
requestApi() {
|
|
401848
|
-
return new Promise((
|
|
401648
|
+
return new Promise((resolve37, reject) => {
|
|
401849
401649
|
this.transport.request("nvim_get_api_info", [], (err2, res) => {
|
|
401850
401650
|
if (err2) {
|
|
401851
401651
|
reject(err2);
|
|
401852
401652
|
} else {
|
|
401853
|
-
|
|
401653
|
+
resolve37(res);
|
|
401854
401654
|
}
|
|
401855
401655
|
});
|
|
401856
401656
|
});
|
|
@@ -402016,11 +401816,11 @@ var require_properties = __commonJS((exports) => {
|
|
|
402016
401816
|
var require_NvimPlugin = __commonJS((exports) => {
|
|
402017
401817
|
var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
402018
401818
|
function adopt(value) {
|
|
402019
|
-
return value instanceof P ? value : new P(function(
|
|
402020
|
-
|
|
401819
|
+
return value instanceof P ? value : new P(function(resolve37) {
|
|
401820
|
+
resolve37(value);
|
|
402021
401821
|
});
|
|
402022
401822
|
}
|
|
402023
|
-
return new (P || (P = Promise))(function(
|
|
401823
|
+
return new (P || (P = Promise))(function(resolve37, reject) {
|
|
402024
401824
|
function fulfilled(value) {
|
|
402025
401825
|
try {
|
|
402026
401826
|
step(generator.next(value));
|
|
@@ -402036,7 +401836,7 @@ var require_NvimPlugin = __commonJS((exports) => {
|
|
|
402036
401836
|
}
|
|
402037
401837
|
}
|
|
402038
401838
|
function step(result) {
|
|
402039
|
-
result.done ?
|
|
401839
|
+
result.done ? resolve37(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
402040
401840
|
}
|
|
402041
401841
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
402042
401842
|
});
|
|
@@ -402728,7 +402528,7 @@ __export(exports_neovim, {
|
|
|
402728
402528
|
import { spawn as spawn17 } from "child_process";
|
|
402729
402529
|
import { existsSync as existsSync30, rmSync as rmSync4 } from "fs";
|
|
402730
402530
|
import { homedir as homedir23 } from "os";
|
|
402731
|
-
import { join as
|
|
402531
|
+
import { join as join35 } from "path";
|
|
402732
402532
|
function killAllNvimProcesses() {
|
|
402733
402533
|
for (const proc of _activePtyProcs) {
|
|
402734
402534
|
try {
|
|
@@ -402754,8 +402554,8 @@ async function launchNeovim(nvimPath, cols = DEFAULT_COLS, rows = DEFAULT_ROWS,
|
|
|
402754
402554
|
const socketPath = `/tmp/sf-nvim-${process.pid}-${Date.now()}.sock`;
|
|
402755
402555
|
const args2 = ["-i", "NONE", "--listen", socketPath];
|
|
402756
402556
|
const isBundled = import.meta.url.includes("$bunfs");
|
|
402757
|
-
const bundledInit =
|
|
402758
|
-
const devInit =
|
|
402557
|
+
const bundledInit = join35(homedir23(), ".soulforge", "init.lua");
|
|
402558
|
+
const devInit = join35(import.meta.dir, "init.lua");
|
|
402759
402559
|
const shippedInit = isBundled ? bundledInit : existsSync30(devInit) ? devInit : bundledInit;
|
|
402760
402560
|
switch (configMode) {
|
|
402761
402561
|
case "none":
|
|
@@ -402907,7 +402707,7 @@ function killBootstrap() {
|
|
|
402907
402707
|
_bootstrapProc.kill();
|
|
402908
402708
|
} catch {}
|
|
402909
402709
|
_bootstrapProc = null;
|
|
402910
|
-
const lazyDir =
|
|
402710
|
+
const lazyDir = join35(homedir23(), ".local", "share", "soulforge", "lazy");
|
|
402911
402711
|
try {
|
|
402912
402712
|
rmSync4(lazyDir, {
|
|
402913
402713
|
recursive: true,
|
|
@@ -402918,13 +402718,13 @@ function killBootstrap() {
|
|
|
402918
402718
|
}
|
|
402919
402719
|
function bootstrapNeovimPlugins(nvimPath) {
|
|
402920
402720
|
const isBundled = import.meta.url.includes("$bunfs");
|
|
402921
|
-
const bundledInit =
|
|
402922
|
-
const devInit =
|
|
402721
|
+
const bundledInit = join35(homedir23(), ".soulforge", "init.lua");
|
|
402722
|
+
const devInit = join35(import.meta.dir, "init.lua");
|
|
402923
402723
|
const shippedInit = isBundled ? bundledInit : existsSync30(devInit) ? devInit : bundledInit;
|
|
402924
402724
|
if (!existsSync30(shippedInit))
|
|
402925
402725
|
return;
|
|
402926
|
-
const dataDir =
|
|
402927
|
-
const lazyDir =
|
|
402726
|
+
const dataDir = join35(homedir23(), ".local", "share", "soulforge");
|
|
402727
|
+
const lazyDir = join35(dataDir, "lazy");
|
|
402928
402728
|
if (existsSync30(lazyDir))
|
|
402929
402729
|
return;
|
|
402930
402730
|
const proc = spawn17(nvimPath, ["--headless", "-i", "NONE", "-u", shippedInit, "+Lazy! install", "+MasonToolsInstallSync", "+qa"], {
|
|
@@ -403371,7 +403171,7 @@ var init_prompts = __esm(() => {
|
|
|
403371
403171
|
|
|
403372
403172
|
// src/core/workers/intelligence-client.ts
|
|
403373
403173
|
import { homedir as homedir24 } from "os";
|
|
403374
|
-
import { join as
|
|
403174
|
+
import { join as join36 } from "path";
|
|
403375
403175
|
var IS_COMPILED2, IS_DIST2, IntelligenceClient;
|
|
403376
403176
|
var init_intelligence_client = __esm(() => {
|
|
403377
403177
|
init_errors();
|
|
@@ -403399,7 +403199,7 @@ var init_intelligence_client = __esm(() => {
|
|
|
403399
403199
|
onStaleSymbols = null;
|
|
403400
403200
|
static SCAN_IDLE_TIMEOUT = 600000;
|
|
403401
403201
|
constructor(cwd2) {
|
|
403402
|
-
const workerPath = IS_COMPILED2 ?
|
|
403202
|
+
const workerPath = IS_COMPILED2 ? join36(homedir24(), ".soulforge", "workers", "intelligence.worker.js") : IS_DIST2 ? join36(import.meta.dir, "workers", "intelligence.worker.js") : join36(import.meta.dir, "intelligence.worker.ts");
|
|
403403
403203
|
super(workerPath, {
|
|
403404
403204
|
cwd: cwd2
|
|
403405
403205
|
});
|
|
@@ -403815,10 +403615,10 @@ var init_intelligence_client = __esm(() => {
|
|
|
403815
403615
|
|
|
403816
403616
|
// src/core/context/toolchain.ts
|
|
403817
403617
|
import { existsSync as existsSync31 } from "fs";
|
|
403818
|
-
import { join as
|
|
403618
|
+
import { join as join37 } from "path";
|
|
403819
403619
|
function detectToolchain(cwd2) {
|
|
403820
403620
|
for (const [file2, tool4] of TOOLCHAIN_MARKERS) {
|
|
403821
|
-
if (existsSync31(
|
|
403621
|
+
if (existsSync31(join37(cwd2, file2)))
|
|
403822
403622
|
return tool4;
|
|
403823
403623
|
}
|
|
403824
403624
|
return null;
|
|
@@ -403893,7 +403693,7 @@ __export(exports_manager2, {
|
|
|
403893
403693
|
});
|
|
403894
403694
|
import { existsSync as existsSync32 } from "fs";
|
|
403895
403695
|
import { readFile as readFile19 } from "fs/promises";
|
|
403896
|
-
import { join as
|
|
403696
|
+
import { join as join38 } from "path";
|
|
403897
403697
|
|
|
403898
403698
|
class ContextManager {
|
|
403899
403699
|
cwd;
|
|
@@ -404280,12 +404080,12 @@ class ContextManager {
|
|
|
404280
404080
|
return Promise.resolve(false);
|
|
404281
404081
|
if (this.isRepoMapReady())
|
|
404282
404082
|
return Promise.resolve(true);
|
|
404283
|
-
return new Promise((
|
|
404083
|
+
return new Promise((resolve37) => {
|
|
404284
404084
|
const start2 = Date.now();
|
|
404285
|
-
const onAbort = () =>
|
|
404085
|
+
const onAbort = () => resolve37(false);
|
|
404286
404086
|
if (signal) {
|
|
404287
404087
|
if (signal.aborted)
|
|
404288
|
-
return
|
|
404088
|
+
return resolve37(false);
|
|
404289
404089
|
signal.addEventListener("abort", onAbort, {
|
|
404290
404090
|
once: true
|
|
404291
404091
|
});
|
|
@@ -404293,11 +404093,11 @@ class ContextManager {
|
|
|
404293
404093
|
const check2 = () => {
|
|
404294
404094
|
if (this.isRepoMapReady()) {
|
|
404295
404095
|
signal?.removeEventListener("abort", onAbort);
|
|
404296
|
-
return
|
|
404096
|
+
return resolve37(true);
|
|
404297
404097
|
}
|
|
404298
404098
|
if (signal?.aborted || Date.now() - start2 > timeoutMs) {
|
|
404299
404099
|
signal?.removeEventListener("abort", onAbort);
|
|
404300
|
-
return
|
|
404100
|
+
return resolve37(false);
|
|
404301
404101
|
}
|
|
404302
404102
|
setTimeout(check2, 200);
|
|
404303
404103
|
};
|
|
@@ -404395,9 +404195,9 @@ class ContextManager {
|
|
|
404395
404195
|
Database: Database3
|
|
404396
404196
|
} = await import("bun:sqlite");
|
|
404397
404197
|
const {
|
|
404398
|
-
join:
|
|
404198
|
+
join: join39
|
|
404399
404199
|
} = await import("path");
|
|
404400
|
-
const dbPath =
|
|
404200
|
+
const dbPath = join39(this.cwd, ".soulforge", "repomap.db");
|
|
404401
404201
|
const db = new Database3(dbPath);
|
|
404402
404202
|
db.run("PRAGMA journal_mode = WAL");
|
|
404403
404203
|
db.run("PRAGMA busy_timeout = 5000");
|
|
@@ -404410,7 +404210,7 @@ class ContextManager {
|
|
|
404410
404210
|
continue;
|
|
404411
404211
|
const pathLabel = file2.path.length > 30 ? `...${file2.path.slice(-27)}` : file2.path;
|
|
404412
404212
|
store.setLspProgress(`${String(fi + 1)}/${String(files.length)}: ${pathLabel}`);
|
|
404413
|
-
const absPath =
|
|
404213
|
+
const absPath = join39(this.cwd, file2.path);
|
|
404414
404214
|
let raw;
|
|
404415
404215
|
try {
|
|
404416
404216
|
raw = await documentSymbols2(absPath);
|
|
@@ -404831,10 +404631,10 @@ ${skillBlocks}
|
|
|
404831
404631
|
const MAX_RICH_BLOCKS = 5;
|
|
404832
404632
|
let richBlockCount = 0;
|
|
404833
404633
|
for (const file2 of changed.slice(0, 15)) {
|
|
404834
|
-
const absPath =
|
|
404835
|
-
const
|
|
404634
|
+
const absPath = join38(this.cwd, file2);
|
|
404635
|
+
const fileExists = existsSync32(absPath);
|
|
404836
404636
|
const block = this.soulMapDiffBlocks.get(file2);
|
|
404837
|
-
if (!
|
|
404637
|
+
if (!fileExists) {
|
|
404838
404638
|
lines.push(`- ${file2}`);
|
|
404839
404639
|
} else if (hasSnapshot && !this.soulMapSnapshotPaths.has(file2)) {
|
|
404840
404640
|
const tag = block ? `${file2}:${block.radiusTag} [NEW FILE]` : `${file2}: [NEW FILE]`;
|
|
@@ -404946,7 +404746,7 @@ ${skillBlocks}
|
|
|
404946
404746
|
}];
|
|
404947
404747
|
for (const check2 of checks3) {
|
|
404948
404748
|
try {
|
|
404949
|
-
await readFile19(
|
|
404749
|
+
await readFile19(join38(this.cwd, check2.file), "utf-8");
|
|
404950
404750
|
const toolchain = this.detectToolchain();
|
|
404951
404751
|
const profileStr = this.buildProfileString();
|
|
404952
404752
|
const info2 = `${check2.label}${toolchain ? ` \xB7 Toolchain: ${toolchain}` : ""}${profileStr}`;
|
|
@@ -412948,12 +412748,12 @@ function mergeObjects2(target, ...sources) {
|
|
|
412948
412748
|
});
|
|
412949
412749
|
return target;
|
|
412950
412750
|
}
|
|
412951
|
-
function
|
|
412751
|
+
function basename6(path) {
|
|
412952
412752
|
const idx = ~path.lastIndexOf("/") || ~path.lastIndexOf("\\");
|
|
412953
412753
|
if (idx === 0) {
|
|
412954
412754
|
return path;
|
|
412955
412755
|
} else if (~idx === path.length - 1) {
|
|
412956
|
-
return
|
|
412756
|
+
return basename6(path.substring(0, path.length - 1));
|
|
412957
412757
|
} else {
|
|
412958
412758
|
return path.substr(~idx + 1);
|
|
412959
412759
|
}
|
|
@@ -414196,7 +413996,7 @@ var CAPTURING_REGEX_SOURCE, RegexSource = class {
|
|
|
414196
413996
|
this._contentNameIsCapturing = RegexSource.hasCaptures(this._contentName);
|
|
414197
413997
|
}
|
|
414198
413998
|
get debugName() {
|
|
414199
|
-
const location = this.$location ? `${
|
|
413999
|
+
const location = this.$location ? `${basename6(this.$location.filename)}:${this.$location.line}` : "unknown";
|
|
414200
414000
|
return `${this.constructor.name}#${this.id} @ ${location}`;
|
|
414201
414001
|
}
|
|
414202
414002
|
getName(lineText, captureIndices) {
|
|
@@ -423598,7 +423398,7 @@ __export(exports_instructions, {
|
|
|
423598
423398
|
});
|
|
423599
423399
|
import { existsSync as existsSync33, readFileSync as readFileSync22, realpathSync as realpathSync4 } from "fs";
|
|
423600
423400
|
import { homedir as homedir25 } from "os";
|
|
423601
|
-
import { join as
|
|
423401
|
+
import { join as join39 } from "path";
|
|
423602
423402
|
function parseInstructionStructure(content) {
|
|
423603
423403
|
const tokens = g.lexer(content);
|
|
423604
423404
|
const sections = [];
|
|
@@ -423654,7 +423454,7 @@ function canonicalPath(path) {
|
|
|
423654
423454
|
}
|
|
423655
423455
|
function readInstructionFromRoot(rootDir, source, scope) {
|
|
423656
423456
|
for (const file2 of source.files) {
|
|
423657
|
-
const fullPath =
|
|
423457
|
+
const fullPath = join39(rootDir, file2);
|
|
423658
423458
|
if (!existsSync33(fullPath))
|
|
423659
423459
|
continue;
|
|
423660
423460
|
try {
|
|
@@ -423683,7 +423483,7 @@ function loadInstructions(cwd2, enabledIds, opts) {
|
|
|
423683
423483
|
continue;
|
|
423684
423484
|
const projectMatch = readInstructionFromRoot(projectRoot, source, "project");
|
|
423685
423485
|
const globalMatch = hasDistinctGlobalRoot ? readInstructionFromRoot(globalRoot, source, "global") : null;
|
|
423686
|
-
const sameInstructionFile = projectMatch && globalMatch && canonicalPath(
|
|
423486
|
+
const sameInstructionFile = projectMatch && globalMatch && canonicalPath(join39(projectRoot, projectMatch.file)) === canonicalPath(join39(globalRoot, globalMatch.file));
|
|
423687
423487
|
if (projectMatch)
|
|
423688
423488
|
results.push(projectMatch);
|
|
423689
423489
|
if (globalMatch && !sameInstructionFile)
|
|
@@ -423783,7 +423583,7 @@ var init_instructions = __esm(() => {
|
|
|
423783
423583
|
|
|
423784
423584
|
// src/headless/run.ts
|
|
423785
423585
|
import { existsSync as existsSync34, readFileSync as readFileSync23 } from "fs";
|
|
423786
|
-
import { resolve as
|
|
423586
|
+
import { resolve as resolve37 } from "path";
|
|
423787
423587
|
function reraiseOrExit(code) {
|
|
423788
423588
|
if (code === EXIT_ABORT) {
|
|
423789
423589
|
process.removeAllListeners("SIGINT");
|
|
@@ -424099,7 +423899,7 @@ async function runPrompt(opts, merged) {
|
|
|
424099
423899
|
if (opts.include && opts.include.length > 0) {
|
|
424100
423900
|
const fileParts = [];
|
|
424101
423901
|
for (const file2 of opts.include) {
|
|
424102
|
-
const fullPath =
|
|
423902
|
+
const fullPath = resolve37(env.cwd, file2);
|
|
424103
423903
|
if (!existsSync34(fullPath)) {
|
|
424104
423904
|
stderrWarn(`--include file not found: ${file2}`);
|
|
424105
423905
|
continue;
|
|
@@ -424245,7 +424045,7 @@ ${prompt}`;
|
|
|
424245
424045
|
reraiseOrExit(exitCode);
|
|
424246
424046
|
}
|
|
424247
424047
|
function readPromptFromStdin() {
|
|
424248
|
-
return new Promise((
|
|
424048
|
+
return new Promise((resolve38) => {
|
|
424249
424049
|
while (stdinBuf.includes(`
|
|
424250
424050
|
`)) {
|
|
424251
424051
|
const idx = stdinBuf.indexOf(`
|
|
@@ -424259,14 +424059,14 @@ ${stdinBuf}`;
|
|
|
424259
424059
|
}
|
|
424260
424060
|
const prompt = line2.trim();
|
|
424261
424061
|
if (prompt.length > 0) {
|
|
424262
|
-
|
|
424062
|
+
resolve38(prompt);
|
|
424263
424063
|
return;
|
|
424264
424064
|
}
|
|
424265
424065
|
}
|
|
424266
424066
|
if (stdinEnded) {
|
|
424267
424067
|
const prompt = stdinBuf.trim();
|
|
424268
424068
|
stdinBuf = "";
|
|
424269
|
-
|
|
424069
|
+
resolve38(prompt.length > 0 ? prompt : null);
|
|
424270
424070
|
return;
|
|
424271
424071
|
}
|
|
424272
424072
|
if (process.stdin.isPaused())
|
|
@@ -424287,7 +424087,7 @@ ${stdinBuf}`;
|
|
|
424287
424087
|
const prompt = line2.trim();
|
|
424288
424088
|
cleanup();
|
|
424289
424089
|
process.stdin.pause();
|
|
424290
|
-
|
|
424090
|
+
resolve38(prompt.length > 0 ? prompt : null);
|
|
424291
424091
|
return;
|
|
424292
424092
|
}
|
|
424293
424093
|
};
|
|
@@ -424296,7 +424096,7 @@ ${stdinBuf}`;
|
|
|
424296
424096
|
cleanup();
|
|
424297
424097
|
const prompt = stdinBuf.trim();
|
|
424298
424098
|
stdinBuf = "";
|
|
424299
|
-
|
|
424099
|
+
resolve38(prompt.length > 0 ? prompt : null);
|
|
424300
424100
|
};
|
|
424301
424101
|
function cleanup() {
|
|
424302
424102
|
process.stdin.removeListener("data", onData);
|
|
@@ -424668,12 +424468,12 @@ class TabLoop {
|
|
|
424668
424468
|
const next = this.queue.shift();
|
|
424669
424469
|
if (next)
|
|
424670
424470
|
return Promise.resolve(next.text);
|
|
424671
|
-
return new Promise((
|
|
424471
|
+
return new Promise((resolve38) => {
|
|
424672
424472
|
if (this.closed) {
|
|
424673
|
-
|
|
424473
|
+
resolve38(null);
|
|
424674
424474
|
return;
|
|
424675
424475
|
}
|
|
424676
|
-
this.waiters.push(
|
|
424476
|
+
this.waiters.push(resolve38);
|
|
424677
424477
|
});
|
|
424678
424478
|
}
|
|
424679
424479
|
queueLength() {
|
|
@@ -424888,7 +424688,7 @@ var init_workspace = __esm(() => {
|
|
|
424888
424688
|
// src/hearth/daemon.ts
|
|
424889
424689
|
import { appendFileSync as appendFileSync3, chmodSync as chmodSync4, existsSync as existsSync35, mkdirSync as mkdirSync14, readFileSync as readFileSync24, unlinkSync as unlinkSync8, writeFileSync as writeFileSync15 } from "fs";
|
|
424890
424690
|
import { createServer as createServer2 } from "net";
|
|
424891
|
-
import { dirname as
|
|
424691
|
+
import { dirname as dirname15 } from "path";
|
|
424892
424692
|
|
|
424893
424693
|
class HearthDaemon {
|
|
424894
424694
|
opts;
|
|
@@ -424965,7 +424765,7 @@ class HearthDaemon {
|
|
|
424965
424765
|
this.log(`hearth starting \u2014 socket: ${this.config.daemon.socketPath}`);
|
|
424966
424766
|
const pidPath = DEFAULT_PID_PATH;
|
|
424967
424767
|
try {
|
|
424968
|
-
mkdirSync14(
|
|
424768
|
+
mkdirSync14(dirname15(pidPath), {
|
|
424969
424769
|
recursive: true,
|
|
424970
424770
|
mode: 448
|
|
424971
424771
|
});
|
|
@@ -425138,7 +424938,7 @@ class HearthDaemon {
|
|
|
425138
424938
|
reason: "surface offline"
|
|
425139
424939
|
};
|
|
425140
424940
|
}
|
|
425141
|
-
return new Promise((
|
|
424941
|
+
return new Promise((resolve38) => {
|
|
425142
424942
|
const entry = this.approvals.register({
|
|
425143
424943
|
sessionId: req.sessionId,
|
|
425144
424944
|
toolName: req.toolName,
|
|
@@ -425146,7 +424946,7 @@ class HearthDaemon {
|
|
|
425146
424946
|
cwd: req.cwd,
|
|
425147
424947
|
tabId: req.tabId,
|
|
425148
424948
|
toolInput: req.toolInput
|
|
425149
|
-
},
|
|
424949
|
+
}, resolve38);
|
|
425150
424950
|
this.host.requestApproval(surfaceId, externalId, {
|
|
425151
424951
|
approvalId: entry.id,
|
|
425152
424952
|
toolName: req.toolName,
|
|
@@ -425170,7 +424970,7 @@ class HearthDaemon {
|
|
|
425170
424970
|
}
|
|
425171
424971
|
async startSocket() {
|
|
425172
424972
|
const path = this.config.daemon.socketPath;
|
|
425173
|
-
mkdirSync14(
|
|
424973
|
+
mkdirSync14(dirname15(path), {
|
|
425174
424974
|
recursive: true,
|
|
425175
424975
|
mode: 448
|
|
425176
424976
|
});
|
|
@@ -425207,7 +425007,7 @@ class HearthDaemon {
|
|
|
425207
425007
|
onError: (err2) => this.log(`socket error: ${err2.message}`)
|
|
425208
425008
|
});
|
|
425209
425009
|
});
|
|
425210
|
-
await new Promise((
|
|
425010
|
+
await new Promise((resolve38, reject) => {
|
|
425211
425011
|
const server2 = this.socketServer;
|
|
425212
425012
|
if (!server2) {
|
|
425213
425013
|
reject(new Error("socket server not initialised"));
|
|
@@ -425220,7 +425020,7 @@ class HearthDaemon {
|
|
|
425220
425020
|
} catch (e) {
|
|
425221
425021
|
this.log(`failed to chmod socket: ${e instanceof Error ? e.message : String(e)}`);
|
|
425222
425022
|
}
|
|
425223
|
-
|
|
425023
|
+
resolve38();
|
|
425224
425024
|
});
|
|
425225
425025
|
});
|
|
425226
425026
|
this.log(`socket listening: ${path}`);
|
|
@@ -426050,7 +425850,7 @@ class HearthDaemon {
|
|
|
426050
425850
|
activeTabId: ws.getActiveTabId() ?? undefined
|
|
426051
425851
|
}))
|
|
426052
425852
|
};
|
|
426053
|
-
mkdirSync14(
|
|
425853
|
+
mkdirSync14(dirname15(this.config.daemon.stateFile), {
|
|
426054
425854
|
recursive: true,
|
|
426055
425855
|
mode: 448
|
|
426056
425856
|
});
|
|
@@ -426069,7 +425869,7 @@ function createFileLogger(logPath) {
|
|
|
426069
425869
|
if (!logPath)
|
|
426070
425870
|
return () => {};
|
|
426071
425871
|
try {
|
|
426072
|
-
const dir =
|
|
425872
|
+
const dir = dirname15(logPath);
|
|
426073
425873
|
if (!existsSync35(dir))
|
|
426074
425874
|
mkdirSync14(dir, {
|
|
426075
425875
|
recursive: true
|
|
@@ -426226,9 +426026,9 @@ async function runStart(detach) {
|
|
|
426226
426026
|
|
|
426227
426027
|
`);
|
|
426228
426028
|
await daemon.start();
|
|
426229
|
-
await new Promise((
|
|
426029
|
+
await new Promise((resolve38) => {
|
|
426230
426030
|
const onExit = () => {
|
|
426231
|
-
|
|
426031
|
+
resolve38();
|
|
426232
426032
|
};
|
|
426233
426033
|
process.once("SIGINT", onExit);
|
|
426234
426034
|
process.once("SIGTERM", onExit);
|
|
@@ -426405,8 +426205,8 @@ async function runLogs(follow) {
|
|
|
426405
426205
|
const child = spawn18("tail", args2, {
|
|
426406
426206
|
stdio: "inherit"
|
|
426407
426207
|
});
|
|
426408
|
-
return new Promise((
|
|
426409
|
-
child.once("close", (code) =>
|
|
426208
|
+
return new Promise((resolve38) => {
|
|
426209
|
+
child.once("close", (code) => resolve38(code ?? 0));
|
|
426410
426210
|
process.once("SIGINT", () => child.kill("SIGINT"));
|
|
426411
426211
|
});
|
|
426412
426212
|
}
|
|
@@ -426445,9 +426245,9 @@ var init_cli = __esm(() => {
|
|
|
426445
426245
|
var exports_approve_cli = {};
|
|
426446
426246
|
import { existsSync as existsSync37, readFileSync as readFileSync25 } from "fs";
|
|
426447
426247
|
import { homedir as homedir26 } from "os";
|
|
426448
|
-
import { join as
|
|
426248
|
+
import { join as join40, resolve as resolvePath } from "path";
|
|
426449
426249
|
function expandHome2(p2) {
|
|
426450
|
-
return p2.startsWith("~/") ?
|
|
426250
|
+
return p2.startsWith("~/") ? join40(homedir26(), p2.slice(2)) : p2;
|
|
426451
426251
|
}
|
|
426452
426252
|
function globToRegex3(pattern) {
|
|
426453
426253
|
const expanded = expandHome2(pattern);
|
|
@@ -426471,10 +426271,10 @@ function readStdinSync() {
|
|
|
426471
426271
|
}
|
|
426472
426272
|
}
|
|
426473
426273
|
function getSocketPath() {
|
|
426474
|
-
return process.env.SOULFORGE_HEARTH_SOCKET ??
|
|
426274
|
+
return process.env.SOULFORGE_HEARTH_SOCKET ?? join40(homedir26(), ".soulforge", "hearth.sock");
|
|
426475
426275
|
}
|
|
426476
426276
|
function loadExtraDenylist(cwd2) {
|
|
426477
|
-
const paths = [
|
|
426277
|
+
const paths = [join40(homedir26(), ".soulforge", "hearth.json"), join40(cwd2, ".soulforge", "hearth.json")];
|
|
426478
426278
|
const extras = new Set;
|
|
426479
426279
|
for (const p2 of paths) {
|
|
426480
426280
|
if (!existsSync37(p2))
|
|
@@ -427147,18 +426947,18 @@ import { EventEmitter } from "events";
|
|
|
427147
426947
|
import { Buffer as Buffer22 } from "buffer";
|
|
427148
426948
|
import { Buffer as Buffer32 } from "buffer";
|
|
427149
426949
|
import { EventEmitter as EventEmitter2 } from "events";
|
|
427150
|
-
import { resolve as
|
|
426950
|
+
import { resolve as resolve38, dirname as dirname16 } from "path";
|
|
427151
426951
|
import { fileURLToPath } from "url";
|
|
427152
426952
|
import { resolve as resolve210, isAbsolute as isAbsolute2, parse as parse7 } from "path";
|
|
427153
426953
|
import { existsSync as existsSync38 } from "fs";
|
|
427154
|
-
import { basename as
|
|
426954
|
+
import { basename as basename7, join as join41 } from "path";
|
|
427155
426955
|
import os from "os";
|
|
427156
426956
|
import path from "path";
|
|
427157
426957
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
427158
426958
|
import path2 from "path";
|
|
427159
426959
|
import { readFile as readFile22, writeFile as writeFile22, mkdir as mkdir22 } from "fs/promises";
|
|
427160
426960
|
import * as path4 from "path";
|
|
427161
|
-
import { mkdir as
|
|
426961
|
+
import { mkdir as mkdir8, readFile as readFile20, writeFile as writeFile15 } from "fs/promises";
|
|
427162
426962
|
import * as path3 from "path";
|
|
427163
426963
|
import { readdir as readdir7 } from "fs/promises";
|
|
427164
426964
|
import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr4 } from "bun:ffi";
|
|
@@ -430380,13 +430180,13 @@ class DebounceController {
|
|
|
430380
430180
|
}
|
|
430381
430181
|
debounce(id, ms, fn) {
|
|
430382
430182
|
const scopeMap = TIMERS_MAP.get(this.scopeId);
|
|
430383
|
-
return new Promise((
|
|
430183
|
+
return new Promise((resolve40, reject) => {
|
|
430384
430184
|
if (scopeMap.has(id)) {
|
|
430385
430185
|
clearTimeout(scopeMap.get(id));
|
|
430386
430186
|
}
|
|
430387
430187
|
const timerId = setTimeout(() => {
|
|
430388
430188
|
try {
|
|
430389
|
-
|
|
430189
|
+
resolve40(fn());
|
|
430390
430190
|
} catch (error48) {
|
|
430391
430191
|
reject(error48);
|
|
430392
430192
|
}
|
|
@@ -430476,25 +430276,25 @@ function getParsers() {
|
|
|
430476
430276
|
filetype: "javascript",
|
|
430477
430277
|
aliases: ["javascriptreact"],
|
|
430478
430278
|
queries: {
|
|
430479
|
-
highlights: [
|
|
430279
|
+
highlights: [resolve38(dirname16(fileURLToPath(import.meta.url)), highlights_default)]
|
|
430480
430280
|
},
|
|
430481
|
-
wasm:
|
|
430281
|
+
wasm: resolve38(dirname16(fileURLToPath(import.meta.url)), tree_sitter_javascript_default)
|
|
430482
430282
|
},
|
|
430483
430283
|
{
|
|
430484
430284
|
filetype: "typescript",
|
|
430485
430285
|
aliases: ["typescriptreact"],
|
|
430486
430286
|
queries: {
|
|
430487
|
-
highlights: [
|
|
430287
|
+
highlights: [resolve38(dirname16(fileURLToPath(import.meta.url)), highlights_default2)]
|
|
430488
430288
|
},
|
|
430489
|
-
wasm:
|
|
430289
|
+
wasm: resolve38(dirname16(fileURLToPath(import.meta.url)), tree_sitter_typescript_default)
|
|
430490
430290
|
},
|
|
430491
430291
|
{
|
|
430492
430292
|
filetype: "markdown",
|
|
430493
430293
|
queries: {
|
|
430494
|
-
highlights: [
|
|
430495
|
-
injections: [
|
|
430294
|
+
highlights: [resolve38(dirname16(fileURLToPath(import.meta.url)), highlights_default3)],
|
|
430295
|
+
injections: [resolve38(dirname16(fileURLToPath(import.meta.url)), injections_default)]
|
|
430496
430296
|
},
|
|
430497
|
-
wasm:
|
|
430297
|
+
wasm: resolve38(dirname16(fileURLToPath(import.meta.url)), tree_sitter_markdown_default),
|
|
430498
430298
|
injectionMapping: {
|
|
430499
430299
|
nodeTypes: {
|
|
430500
430300
|
inline: "markdown_inline",
|
|
@@ -430517,16 +430317,16 @@ function getParsers() {
|
|
|
430517
430317
|
{
|
|
430518
430318
|
filetype: "markdown_inline",
|
|
430519
430319
|
queries: {
|
|
430520
|
-
highlights: [
|
|
430320
|
+
highlights: [resolve38(dirname16(fileURLToPath(import.meta.url)), highlights_default4)]
|
|
430521
430321
|
},
|
|
430522
|
-
wasm:
|
|
430322
|
+
wasm: resolve38(dirname16(fileURLToPath(import.meta.url)), tree_sitter_markdown_inline_default)
|
|
430523
430323
|
},
|
|
430524
430324
|
{
|
|
430525
430325
|
filetype: "zig",
|
|
430526
430326
|
queries: {
|
|
430527
|
-
highlights: [
|
|
430327
|
+
highlights: [resolve38(dirname16(fileURLToPath(import.meta.url)), highlights_default5)]
|
|
430528
430328
|
},
|
|
430529
|
-
wasm:
|
|
430329
|
+
wasm: resolve38(dirname16(fileURLToPath(import.meta.url)), tree_sitter_zig_default)
|
|
430530
430330
|
}
|
|
430531
430331
|
];
|
|
430532
430332
|
}
|
|
@@ -430539,7 +430339,7 @@ function getBunfsRootPath() {
|
|
|
430539
430339
|
return process.platform === "win32" ? "B:\\~BUN\\root" : "/$bunfs/root";
|
|
430540
430340
|
}
|
|
430541
430341
|
function normalizeBunfsPath(fileName) {
|
|
430542
|
-
return
|
|
430342
|
+
return join41(getBunfsRootPath(), basename7(fileName));
|
|
430543
430343
|
}
|
|
430544
430344
|
function addDefaultParsers(parsers) {
|
|
430545
430345
|
for (const parser of parsers) {
|
|
@@ -430666,7 +430466,7 @@ class DownloadUtils {
|
|
|
430666
430466
|
cacheFileName = path3.basename(source);
|
|
430667
430467
|
}
|
|
430668
430468
|
const cacheFile = path3.join(cacheDir, cacheSubdir, cacheFileName);
|
|
430669
|
-
await
|
|
430469
|
+
await mkdir8(path3.dirname(cacheFile), { recursive: true });
|
|
430670
430470
|
try {
|
|
430671
430471
|
const cachedContent = await readFile20(cacheFile);
|
|
430672
430472
|
if (cachedContent.byteLength > 0) {
|
|
@@ -430682,7 +430482,7 @@ class DownloadUtils {
|
|
|
430682
430482
|
}
|
|
430683
430483
|
const content = Buffer.from(await response.arrayBuffer());
|
|
430684
430484
|
try {
|
|
430685
|
-
await
|
|
430485
|
+
await writeFile15(cacheFile, Buffer.from(content));
|
|
430686
430486
|
console.log(`Cached: ${source}`);
|
|
430687
430487
|
} catch (cacheError) {
|
|
430688
430488
|
console.warn(`Failed to cache: ${cacheError}`);
|
|
@@ -430703,7 +430503,7 @@ class DownloadUtils {
|
|
|
430703
430503
|
}
|
|
430704
430504
|
static async downloadToPath(source, targetPath) {
|
|
430705
430505
|
const isUrl22 = source.startsWith("http://") || source.startsWith("https://");
|
|
430706
|
-
await
|
|
430506
|
+
await mkdir8(path3.dirname(targetPath), { recursive: true });
|
|
430707
430507
|
if (isUrl22) {
|
|
430708
430508
|
try {
|
|
430709
430509
|
console.log(`Downloading from URL: ${source}`);
|
|
@@ -430712,7 +430512,7 @@ class DownloadUtils {
|
|
|
430712
430512
|
return { error: `Failed to fetch from ${source}: ${response.statusText}` };
|
|
430713
430513
|
}
|
|
430714
430514
|
const content = Buffer.from(await response.arrayBuffer());
|
|
430715
|
-
await
|
|
430515
|
+
await writeFile15(targetPath, Buffer.from(content));
|
|
430716
430516
|
console.log(`Downloaded: ${source} -> ${targetPath}`);
|
|
430717
430517
|
return { content, filePath: targetPath };
|
|
430718
430518
|
} catch (error48) {
|
|
@@ -430722,7 +430522,7 @@ class DownloadUtils {
|
|
|
430722
430522
|
try {
|
|
430723
430523
|
console.log(`Copying from local path: ${source}`);
|
|
430724
430524
|
const content = await readFile20(source);
|
|
430725
|
-
await
|
|
430525
|
+
await writeFile15(targetPath, Buffer.from(content));
|
|
430726
430526
|
return { content, filePath: targetPath };
|
|
430727
430527
|
} catch (error48) {
|
|
430728
430528
|
return { error: `Error copying from local path ${source}: ${error48}` };
|
|
@@ -434042,8 +433842,8 @@ function convertToDebugSymbols(symbols) {
|
|
|
434042
433842
|
const p99Width = Math.max(p99Header.length, ...allStats.map((s2) => s2.p99.toFixed(2).length));
|
|
434043
433843
|
lines.push(`${nameHeader.padEnd(nameWidth)} | ${callsHeader.padStart(countWidth)} | ${totalHeader.padStart(totalWidth)} | ${avgHeader.padStart(avgWidth)} | ${minHeader.padStart(statWidthMin)} | ${maxHeader.padStart(statWidthMax)} | ${medHeader.padStart(medianWidth)} | ${p90Header.padStart(p90Width)} | ${p99Header.padStart(p99Width)}`);
|
|
434044
433844
|
lines.push(`${"-".repeat(nameWidth)}-+-${"-".repeat(countWidth)}-+-${"-".repeat(totalWidth)}-+-${"-".repeat(avgWidth)}-+-${"-".repeat(statWidthMin)}-+-${"-".repeat(statWidthMax)}-+-${"-".repeat(medianWidth)}-+-${"-".repeat(p90Width)}-+-${"-".repeat(p99Width)}`);
|
|
434045
|
-
allStats.forEach((
|
|
434046
|
-
lines.push(`${
|
|
433845
|
+
allStats.forEach((stat5) => {
|
|
433846
|
+
lines.push(`${stat5.name.padEnd(nameWidth)} | ${String(stat5.count).padStart(countWidth)} | ${stat5.total.toFixed(2).padStart(totalWidth)} | ${stat5.average.toFixed(2).padStart(avgWidth)} | ${stat5.min.toFixed(2).padStart(statWidthMin)} | ${stat5.max.toFixed(2).padStart(statWidthMax)} | ${stat5.median.toFixed(2).padStart(medianWidth)} | ${stat5.p90.toFixed(2).padStart(p90Width)} | ${stat5.p99.toFixed(2).padStart(p99Width)}`);
|
|
434047
433847
|
});
|
|
434048
433848
|
}
|
|
434049
433849
|
lines.push("-------------------------------------------------------------------------------------------------------------------------");
|
|
@@ -463587,8 +463387,8 @@ It can also happen if the client has a browser extension installed which messes
|
|
|
463587
463387
|
currentEntangledActionThenable = {
|
|
463588
463388
|
status: "pending",
|
|
463589
463389
|
value: undefined,
|
|
463590
|
-
then: function(
|
|
463591
|
-
entangledListeners.push(
|
|
463390
|
+
then: function(resolve40) {
|
|
463391
|
+
entangledListeners.push(resolve40);
|
|
463592
463392
|
}
|
|
463593
463393
|
};
|
|
463594
463394
|
}
|
|
@@ -463612,8 +463412,8 @@ It can also happen if the client has a browser extension installed which messes
|
|
|
463612
463412
|
status: "pending",
|
|
463613
463413
|
value: null,
|
|
463614
463414
|
reason: null,
|
|
463615
|
-
then: function(
|
|
463616
|
-
listeners2.push(
|
|
463415
|
+
then: function(resolve40) {
|
|
463416
|
+
listeners2.push(resolve40);
|
|
463617
463417
|
}
|
|
463618
463418
|
};
|
|
463619
463419
|
thenable.then(function() {
|
|
@@ -472235,7 +472035,7 @@ var init_shallow2 = __esm(() => {
|
|
|
472235
472035
|
});
|
|
472236
472036
|
|
|
472237
472037
|
// src/stores/checkpoints.ts
|
|
472238
|
-
import { relative as
|
|
472038
|
+
import { relative as relative12 } from "path";
|
|
472239
472039
|
function withGitLock(cwd2, fn) {
|
|
472240
472040
|
const prev = _gitLocks.get(cwd2) ?? Promise.resolve();
|
|
472241
472041
|
const next = prev.then(fn, fn);
|
|
@@ -472518,15 +472318,15 @@ var init_checkpoints = __esm(() => {
|
|
|
472518
472318
|
if (filesToRevert.size > 0) {
|
|
472519
472319
|
await withGitLock(cwd2, async () => {
|
|
472520
472320
|
const {
|
|
472521
|
-
writeFile:
|
|
472321
|
+
writeFile: writeFile16,
|
|
472522
472322
|
unlink: unlink3
|
|
472523
472323
|
} = await import("fs/promises");
|
|
472524
472324
|
const ref = restoreTag ?? "HEAD";
|
|
472525
472325
|
for (const absPath of filesToRevert) {
|
|
472526
|
-
const relPath =
|
|
472326
|
+
const relPath = relative12(cwd2, absPath);
|
|
472527
472327
|
const result = await run2(["show", `${ref}:${relPath}`], cwd2, 1e4);
|
|
472528
472328
|
if (result.ok) {
|
|
472529
|
-
await
|
|
472329
|
+
await writeFile16(absPath, result.stdout);
|
|
472530
472330
|
restoredFiles.push(absPath);
|
|
472531
472331
|
} else {
|
|
472532
472332
|
try {
|
|
@@ -472581,13 +472381,13 @@ var init_checkpoints = __esm(() => {
|
|
|
472581
472381
|
if (redoCp.gitTag && allFiles.size > 0) {
|
|
472582
472382
|
await withGitLock(cwd2, async () => {
|
|
472583
472383
|
const {
|
|
472584
|
-
writeFile:
|
|
472384
|
+
writeFile: writeFile16
|
|
472585
472385
|
} = await import("fs/promises");
|
|
472586
472386
|
for (const absPath of allFiles) {
|
|
472587
|
-
const relPath =
|
|
472387
|
+
const relPath = relative12(cwd2, absPath);
|
|
472588
472388
|
const result = await run2(["show", `${redoCp.gitTag}:${relPath}`], cwd2, 1e4);
|
|
472589
472389
|
if (result.ok) {
|
|
472590
|
-
await
|
|
472390
|
+
await writeFile16(absPath, result.stdout);
|
|
472591
472391
|
restoredFiles.push(absPath);
|
|
472592
472392
|
}
|
|
472593
472393
|
}
|
|
@@ -472686,7 +472486,7 @@ var init_checkpoints = __esm(() => {
|
|
|
472686
472486
|
// src/core/commands/utils.ts
|
|
472687
472487
|
import { existsSync as existsSync39, readdirSync as readdirSync9, statSync as statSync9 } from "fs";
|
|
472688
472488
|
import { homedir as homedir27 } from "os";
|
|
472689
|
-
import { join as
|
|
472489
|
+
import { join as join44 } from "path";
|
|
472690
472490
|
function sysMsg(ctx, content) {
|
|
472691
472491
|
ctx.chat.setMessages((prev) => [...prev, {
|
|
472692
472492
|
id: crypto.randomUUID(),
|
|
@@ -472707,7 +472507,7 @@ function dirSize(dirPath) {
|
|
|
472707
472507
|
return 0;
|
|
472708
472508
|
let total = 0;
|
|
472709
472509
|
for (const entry of readdirSync9(dirPath)) {
|
|
472710
|
-
const fp =
|
|
472510
|
+
const fp = join44(dirPath, entry);
|
|
472711
472511
|
try {
|
|
472712
472512
|
const s2 = statSync9(fp);
|
|
472713
472513
|
total += s2.isDirectory() ? dirSize(fp) : s2.size;
|
|
@@ -472724,19 +472524,19 @@ function fileSize(filePath) {
|
|
|
472724
472524
|
}
|
|
472725
472525
|
function computeStorageSizes(cwd2) {
|
|
472726
472526
|
const home = homedir27();
|
|
472727
|
-
const projectDir =
|
|
472728
|
-
const globalDir =
|
|
472729
|
-
const repoMap = fileSize(
|
|
472730
|
-
const projectMemory = fileSize(
|
|
472731
|
-
const sessions = dirSize(
|
|
472732
|
-
const plans = dirSize(
|
|
472733
|
-
const projectConfig = fileSize(
|
|
472527
|
+
const projectDir = join44(cwd2, ".soulforge");
|
|
472528
|
+
const globalDir = join44(home, ".soulforge");
|
|
472529
|
+
const repoMap = fileSize(join44(projectDir, "repomap.db")) + fileSize(join44(projectDir, "repomap.db-wal")) + fileSize(join44(projectDir, "repomap.db-shm"));
|
|
472530
|
+
const projectMemory = fileSize(join44(projectDir, "memory.db")) + fileSize(join44(projectDir, "memory.db-wal"));
|
|
472531
|
+
const sessions = dirSize(join44(projectDir, "sessions"));
|
|
472532
|
+
const plans = dirSize(join44(projectDir, "plans"));
|
|
472533
|
+
const projectConfig = fileSize(join44(projectDir, "config.json")) + fileSize(join44(projectDir, "forbidden.json"));
|
|
472734
472534
|
const projectTotal = repoMap + projectMemory + sessions + plans + projectConfig;
|
|
472735
|
-
const history = fileSize(
|
|
472736
|
-
const globalMemory = fileSize(
|
|
472737
|
-
const globalConfig2 = fileSize(
|
|
472738
|
-
const bins = dirSize(
|
|
472739
|
-
const fonts2 = dirSize(
|
|
472535
|
+
const history = fileSize(join44(globalDir, "history.db")) + fileSize(join44(globalDir, "history.db-wal"));
|
|
472536
|
+
const globalMemory = fileSize(join44(globalDir, "memory.db")) + fileSize(join44(globalDir, "memory.db-wal"));
|
|
472537
|
+
const globalConfig2 = fileSize(join44(globalDir, "config.json")) + fileSize(join44(globalDir, "secrets.json"));
|
|
472538
|
+
const bins = dirSize(join44(globalDir, "bin"));
|
|
472539
|
+
const fonts2 = dirSize(join44(globalDir, "fonts"));
|
|
472740
472540
|
const globalTotal = history + globalMemory + globalConfig2 + bins + fonts2;
|
|
472741
472541
|
return {
|
|
472742
472542
|
projectDir,
|
|
@@ -472912,10 +472712,10 @@ var init_checkpoint = __esm(() => {
|
|
|
472912
472712
|
});
|
|
472913
472713
|
|
|
472914
472714
|
// src/core/commands/claims.ts
|
|
472915
|
-
import { relative as
|
|
472715
|
+
import { relative as relative13 } from "path";
|
|
472916
472716
|
function displayPath2(absPath) {
|
|
472917
472717
|
const cwd2 = process.cwd();
|
|
472918
|
-
return absPath.startsWith(cwd2) ?
|
|
472718
|
+
return absPath.startsWith(cwd2) ? relative13(cwd2, absPath) : absPath;
|
|
472919
472719
|
}
|
|
472920
472720
|
function handleClaims(_input, ctx) {
|
|
472921
472721
|
const coordinator = getWorkspaceCoordinator();
|
|
@@ -473178,7 +472978,7 @@ __export(exports_terminal_font, {
|
|
|
473178
472978
|
import { execSync as execSync9 } from "child_process";
|
|
473179
472979
|
import { existsSync as existsSync40, mkdirSync as mkdirSync15, readFileSync as readFileSync26, writeFileSync as writeFileSync17 } from "fs";
|
|
473180
472980
|
import { homedir as homedir28 } from "os";
|
|
473181
|
-
import { join as
|
|
472981
|
+
import { join as join45 } from "path";
|
|
473182
472982
|
function detectTerminal() {
|
|
473183
472983
|
const env2 = process.env;
|
|
473184
472984
|
if (env2.KITTY_WINDOW_ID) {
|
|
@@ -473283,7 +473083,7 @@ function getCurrentFont() {
|
|
|
473283
473083
|
const term = detectTerminal();
|
|
473284
473084
|
switch (term.id) {
|
|
473285
473085
|
case "kitty": {
|
|
473286
|
-
const conf =
|
|
473086
|
+
const conf = join45(homedir28(), ".config", "kitty", "kitty.conf");
|
|
473287
473087
|
if (!existsSync40(conf))
|
|
473288
473088
|
return null;
|
|
473289
473089
|
const content = readFileSync26(conf, "utf-8");
|
|
@@ -473299,7 +473099,7 @@ function getCurrentFont() {
|
|
|
473299
473099
|
return match2?.[1] ?? null;
|
|
473300
473100
|
}
|
|
473301
473101
|
case "ghostty": {
|
|
473302
|
-
const conf =
|
|
473102
|
+
const conf = join45(homedir28(), ".config", "ghostty", "config");
|
|
473303
473103
|
if (!existsSync40(conf))
|
|
473304
473104
|
return null;
|
|
473305
473105
|
const content = readFileSync26(conf, "utf-8");
|
|
@@ -473307,7 +473107,7 @@ function getCurrentFont() {
|
|
|
473307
473107
|
return match2?.[1]?.trim() ?? null;
|
|
473308
473108
|
}
|
|
473309
473109
|
case "foot": {
|
|
473310
|
-
const conf =
|
|
473110
|
+
const conf = join45(homedir28(), ".config", "foot", "foot.ini");
|
|
473311
473111
|
if (!existsSync40(conf))
|
|
473312
473112
|
return null;
|
|
473313
473113
|
const content = readFileSync26(conf, "utf-8");
|
|
@@ -473357,8 +473157,8 @@ function setTerminalFont(fontFamily, fontSize) {
|
|
|
473357
473157
|
}
|
|
473358
473158
|
}
|
|
473359
473159
|
function setKittyFont(family, size) {
|
|
473360
|
-
const confDir =
|
|
473361
|
-
const conf =
|
|
473160
|
+
const confDir = join45(homedir28(), ".config", "kitty");
|
|
473161
|
+
const conf = join45(confDir, "kitty.conf");
|
|
473362
473162
|
mkdirSync15(confDir, {
|
|
473363
473163
|
recursive: true
|
|
473364
473164
|
});
|
|
@@ -473391,14 +473191,14 @@ ${content}`;
|
|
|
473391
473191
|
};
|
|
473392
473192
|
}
|
|
473393
473193
|
function findAlacrittyConfig() {
|
|
473394
|
-
const paths = [
|
|
473194
|
+
const paths = [join45(homedir28(), ".config", "alacritty", "alacritty.toml"), join45(homedir28(), ".config", "alacritty", "alacritty.yml"), join45(homedir28(), ".alacritty.toml"), join45(homedir28(), ".alacritty.yml")];
|
|
473395
473195
|
return paths.find((p2) => existsSync40(p2)) ?? null;
|
|
473396
473196
|
}
|
|
473397
473197
|
function setAlacrittyFont(family, size) {
|
|
473398
|
-
const confDir =
|
|
473198
|
+
const confDir = join45(homedir28(), ".config", "alacritty");
|
|
473399
473199
|
let conf = findAlacrittyConfig();
|
|
473400
473200
|
if (!conf) {
|
|
473401
|
-
conf =
|
|
473201
|
+
conf = join45(confDir, "alacritty.toml");
|
|
473402
473202
|
mkdirSync15(confDir, {
|
|
473403
473203
|
recursive: true
|
|
473404
473204
|
});
|
|
@@ -473506,8 +473306,8 @@ function setTerminalAppFont(family, size) {
|
|
|
473506
473306
|
}
|
|
473507
473307
|
}
|
|
473508
473308
|
function setGhosttyFont(family, size) {
|
|
473509
|
-
const confDir =
|
|
473510
|
-
const conf =
|
|
473309
|
+
const confDir = join45(homedir28(), ".config", "ghostty");
|
|
473310
|
+
const conf = join45(confDir, "config");
|
|
473511
473311
|
mkdirSync15(confDir, {
|
|
473512
473312
|
recursive: true
|
|
473513
473313
|
});
|
|
@@ -473532,8 +473332,8 @@ ${content}`;
|
|
|
473532
473332
|
};
|
|
473533
473333
|
}
|
|
473534
473334
|
function setFootFont(family, size) {
|
|
473535
|
-
const confDir =
|
|
473536
|
-
const conf =
|
|
473335
|
+
const confDir = join45(homedir28(), ".config", "foot");
|
|
473336
|
+
const conf = join45(confDir, "foot.ini");
|
|
473537
473337
|
mkdirSync15(confDir, {
|
|
473538
473338
|
recursive: true
|
|
473539
473339
|
});
|
|
@@ -475064,7 +474864,7 @@ __export(exports_tui_host, {
|
|
|
475064
474864
|
TuiHost: () => TuiHost
|
|
475065
474865
|
});
|
|
475066
474866
|
import { appendFileSync as appendFileSync4, existsSync as existsSync41, mkdirSync as mkdirSync16, unlinkSync as unlinkSync9, unwatchFile, watchFile } from "fs";
|
|
475067
|
-
import { dirname as
|
|
474867
|
+
import { dirname as dirname19 } from "path";
|
|
475068
474868
|
|
|
475069
474869
|
class TuiHost {
|
|
475070
474870
|
config;
|
|
@@ -475772,7 +475572,7 @@ function getTuiHost() {
|
|
|
475772
475572
|
const logPath = cfg.daemon.logFile;
|
|
475773
475573
|
try {
|
|
475774
475574
|
if (logPath) {
|
|
475775
|
-
const dir =
|
|
475575
|
+
const dir = dirname19(logPath);
|
|
475776
475576
|
if (!existsSync41(dir))
|
|
475777
475577
|
mkdirSync16(dir, {
|
|
475778
475578
|
recursive: true
|
|
@@ -475823,7 +475623,7 @@ __export(exports_service, {
|
|
|
475823
475623
|
import { spawn as spawn18 } from "child_process";
|
|
475824
475624
|
import { existsSync as existsSync42, mkdirSync as mkdirSync17, unlinkSync as unlinkSync10, writeFileSync as writeFileSync18 } from "fs";
|
|
475825
475625
|
import { homedir as homedir29, platform as platform4, userInfo as userInfo2 } from "os";
|
|
475826
|
-
import { join as
|
|
475626
|
+
import { join as join46 } from "path";
|
|
475827
475627
|
function currentPlatform() {
|
|
475828
475628
|
const p2 = platform4();
|
|
475829
475629
|
if (p2 === "darwin")
|
|
@@ -475833,16 +475633,16 @@ function currentPlatform() {
|
|
|
475833
475633
|
return "unsupported";
|
|
475834
475634
|
}
|
|
475835
475635
|
function macosPlistPath() {
|
|
475836
|
-
return
|
|
475636
|
+
return join46(homedir29(), "Library", "LaunchAgents", `${MACOS_LABEL}.plist`);
|
|
475837
475637
|
}
|
|
475838
475638
|
function linuxUnitPath() {
|
|
475839
|
-
return
|
|
475639
|
+
return join46(homedir29(), ".config", "systemd", "user", LINUX_UNIT_NAME);
|
|
475840
475640
|
}
|
|
475841
475641
|
function defaultLogPath() {
|
|
475842
|
-
return
|
|
475642
|
+
return join46(homedir29(), ".soulforge", "hearth.log");
|
|
475843
475643
|
}
|
|
475844
475644
|
function defaultErrPath() {
|
|
475845
|
-
return
|
|
475645
|
+
return join46(homedir29(), ".soulforge", "hearth.err");
|
|
475846
475646
|
}
|
|
475847
475647
|
function plistEscape(s2) {
|
|
475848
475648
|
return s2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -475858,7 +475658,7 @@ function systemdArg(s2) {
|
|
|
475858
475658
|
return `"${esc3}"`;
|
|
475859
475659
|
}
|
|
475860
475660
|
function runCmd(cmd, args2) {
|
|
475861
|
-
return new Promise((
|
|
475661
|
+
return new Promise((resolve40) => {
|
|
475862
475662
|
const proc = spawn18(cmd, args2, {
|
|
475863
475663
|
stdio: ["ignore", "pipe", "pipe"]
|
|
475864
475664
|
});
|
|
@@ -475870,12 +475670,12 @@ function runCmd(cmd, args2) {
|
|
|
475870
475670
|
proc.stderr.on("data", (d3) => {
|
|
475871
475671
|
stderr += d3.toString();
|
|
475872
475672
|
});
|
|
475873
|
-
proc.on("close", (code) =>
|
|
475673
|
+
proc.on("close", (code) => resolve40({
|
|
475874
475674
|
code: code ?? 1,
|
|
475875
475675
|
stdout,
|
|
475876
475676
|
stderr
|
|
475877
475677
|
}));
|
|
475878
|
-
proc.on("error", (err2) =>
|
|
475678
|
+
proc.on("error", (err2) => resolve40({
|
|
475879
475679
|
code: 1,
|
|
475880
475680
|
stdout,
|
|
475881
475681
|
stderr: err2.message
|
|
@@ -475950,7 +475750,7 @@ async function installService(opts) {
|
|
|
475950
475750
|
if (plat === "darwin") {
|
|
475951
475751
|
const plistPath = macosPlistPath();
|
|
475952
475752
|
try {
|
|
475953
|
-
mkdirSync17(
|
|
475753
|
+
mkdirSync17(join46(homedir29(), "Library", "LaunchAgents"), {
|
|
475954
475754
|
recursive: true
|
|
475955
475755
|
});
|
|
475956
475756
|
writeFileSync18(plistPath, buildMacosPlist(opts), {
|
|
@@ -475992,7 +475792,7 @@ async function installService(opts) {
|
|
|
475992
475792
|
if (plat === "linux") {
|
|
475993
475793
|
const unitPath = linuxUnitPath();
|
|
475994
475794
|
try {
|
|
475995
|
-
mkdirSync17(
|
|
475795
|
+
mkdirSync17(join46(homedir29(), ".config", "systemd", "user"), {
|
|
475996
475796
|
recursive: true
|
|
475997
475797
|
});
|
|
475998
475798
|
writeFileSync18(unitPath, buildLinuxUnit(opts), {
|
|
@@ -476152,7 +475952,7 @@ var init_service = () => {};
|
|
|
476152
475952
|
// src/core/commands/hearth.ts
|
|
476153
475953
|
import { existsSync as existsSync43 } from "fs";
|
|
476154
475954
|
import { homedir as homedir30 } from "os";
|
|
476155
|
-
import { join as
|
|
475955
|
+
import { join as join47 } from "path";
|
|
476156
475956
|
async function daemonHealth(socketPath) {
|
|
476157
475957
|
if (!existsSync43(socketPath))
|
|
476158
475958
|
return null;
|
|
@@ -476414,7 +476214,7 @@ function handleHearthDocs(_input, ctx) {
|
|
|
476414
476214
|
color: getThemeTokens().textMuted
|
|
476415
476215
|
}, {
|
|
476416
476216
|
type: "text",
|
|
476417
|
-
label: `${
|
|
476217
|
+
label: `${join47(homedir30(), ".soulforge", "hearth.log")} \u2014 daemon log`,
|
|
476418
476218
|
color: getThemeTokens().textMuted
|
|
476419
476219
|
}]
|
|
476420
476220
|
});
|
|
@@ -476681,7 +476481,7 @@ var init_terminals = __esm(() => {
|
|
|
476681
476481
|
});
|
|
476682
476482
|
|
|
476683
476483
|
// src/core/terminal/manager.ts
|
|
476684
|
-
import { basename as
|
|
476484
|
+
import { basename as basename10 } from "path";
|
|
476685
476485
|
function onTerminalData(cb) {
|
|
476686
476486
|
dataListeners.add(cb);
|
|
476687
476487
|
return () => dataListeners.delete(cb);
|
|
@@ -476739,7 +476539,7 @@ function spawnTerminal(cwd2, cols = 80, rows = 24) {
|
|
|
476739
476539
|
});
|
|
476740
476540
|
handle3.proc = proc;
|
|
476741
476541
|
termId = store.addTerminal({
|
|
476742
|
-
label:
|
|
476542
|
+
label: basename10(shell2),
|
|
476743
476543
|
cwd: effectiveCwd,
|
|
476744
476544
|
active: true,
|
|
476745
476545
|
pid: proc.pid ?? null
|
|
@@ -477059,10 +476859,10 @@ function getPerPidRssKB(pids) {
|
|
|
477059
476859
|
if (pids.length === 0)
|
|
477060
476860
|
return Promise.resolve(result);
|
|
477061
476861
|
if (process.platform === "win32") {
|
|
477062
|
-
return new Promise((
|
|
476862
|
+
return new Promise((resolve40) => {
|
|
477063
476863
|
execFile2("wmic", ["process", "where", `(${pids.map((p2) => `ProcessId=${String(p2)}`).join(" or ")})`, "get", "ProcessId,WorkingSetSize", "/format:csv"], (err2, stdout) => {
|
|
477064
476864
|
if (err2) {
|
|
477065
|
-
|
|
476865
|
+
resolve40(result);
|
|
477066
476866
|
return;
|
|
477067
476867
|
}
|
|
477068
476868
|
for (const line2 of stdout.split(`
|
|
@@ -477078,14 +476878,14 @@ function getPerPidRssKB(pids) {
|
|
|
477078
476878
|
}
|
|
477079
476879
|
}
|
|
477080
476880
|
}
|
|
477081
|
-
|
|
476881
|
+
resolve40(result);
|
|
477082
476882
|
});
|
|
477083
476883
|
});
|
|
477084
476884
|
}
|
|
477085
|
-
return new Promise((
|
|
476885
|
+
return new Promise((resolve40) => {
|
|
477086
476886
|
execFile2("ps", ["-p", pids.join(","), "-o", "pid=,rss="], (err2, stdout) => {
|
|
477087
476887
|
if (err2) {
|
|
477088
|
-
|
|
476888
|
+
resolve40(result);
|
|
477089
476889
|
return;
|
|
477090
476890
|
}
|
|
477091
476891
|
for (const line2 of stdout.split(`
|
|
@@ -477104,7 +476904,7 @@ function getPerPidRssKB(pids) {
|
|
|
477104
476904
|
}
|
|
477105
476905
|
}
|
|
477106
476906
|
}
|
|
477107
|
-
|
|
476907
|
+
resolve40(result);
|
|
477108
476908
|
});
|
|
477109
476909
|
});
|
|
477110
476910
|
}
|
|
@@ -477116,24 +476916,24 @@ async function getMainFootprintMB() {
|
|
|
477116
476916
|
return footprint ?? rssMB;
|
|
477117
476917
|
}
|
|
477118
476918
|
function macFootprintMB(pid) {
|
|
477119
|
-
return new Promise((
|
|
476919
|
+
return new Promise((resolve40) => {
|
|
477120
476920
|
execFile2("vmmap", ["--summary", String(pid)], {
|
|
477121
476921
|
timeout: 2000,
|
|
477122
476922
|
maxBuffer: 1024 * 1024
|
|
477123
476923
|
}, (err2, stdout) => {
|
|
477124
476924
|
if (err2) {
|
|
477125
|
-
|
|
476925
|
+
resolve40(null);
|
|
477126
476926
|
return;
|
|
477127
476927
|
}
|
|
477128
476928
|
const m5 = stdout.match(/Physical footprint:\s+([\d.]+)([KMGT])/);
|
|
477129
476929
|
if (!m5?.[1] || !m5[2]) {
|
|
477130
|
-
|
|
476930
|
+
resolve40(null);
|
|
477131
476931
|
return;
|
|
477132
476932
|
}
|
|
477133
476933
|
const n = Number.parseFloat(m5[1]);
|
|
477134
476934
|
const unit = m5[2];
|
|
477135
476935
|
const mb = unit === "G" ? n * 1024 : unit === "M" ? n : unit === "K" ? n / 1024 : unit === "T" ? n * 1024 * 1024 : n;
|
|
477136
|
-
|
|
476936
|
+
resolve40(Math.round(mb));
|
|
477137
476937
|
});
|
|
477138
476938
|
});
|
|
477139
476939
|
}
|
|
@@ -477754,7 +477554,7 @@ __export(exports_prerequisites, {
|
|
|
477754
477554
|
import { execSync as execSync10 } from "child_process";
|
|
477755
477555
|
import { existsSync as existsSync44 } from "fs";
|
|
477756
477556
|
import { homedir as homedir31, platform as platform5 } from "os";
|
|
477757
|
-
import { join as
|
|
477557
|
+
import { join as join48 } from "path";
|
|
477758
477558
|
function commandExists3(cmd) {
|
|
477759
477559
|
try {
|
|
477760
477560
|
execSync10(`command -v ${cmd}`, {
|
|
@@ -477774,7 +477574,7 @@ function lspExists(...cmds) {
|
|
|
477774
477574
|
for (const cmd of cmds) {
|
|
477775
477575
|
if (commandExists3(cmd))
|
|
477776
477576
|
return true;
|
|
477777
|
-
if (existsSync44(
|
|
477577
|
+
if (existsSync44(join48(MASON_BIN, cmd)))
|
|
477778
477578
|
return true;
|
|
477779
477579
|
}
|
|
477780
477580
|
return false;
|
|
@@ -477799,7 +477599,7 @@ function getMissingRequired() {
|
|
|
477799
477599
|
var MASON_BIN, PREREQUISITES;
|
|
477800
477600
|
var init_prerequisites = __esm(() => {
|
|
477801
477601
|
init_install();
|
|
477802
|
-
MASON_BIN =
|
|
477602
|
+
MASON_BIN = join48(homedir31(), ".local", "share", "nvim", "mason", "bin");
|
|
477803
477603
|
PREREQUISITES = [{
|
|
477804
477604
|
name: "Neovim",
|
|
477805
477605
|
description: "Embedded editor (required, v0.11+)",
|
|
@@ -480218,7 +480018,7 @@ __export(exports_export, {
|
|
|
480218
480018
|
exportChat: () => exportChat
|
|
480219
480019
|
});
|
|
480220
480020
|
import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync19 } from "fs";
|
|
480221
|
-
import { dirname as
|
|
480021
|
+
import { dirname as dirname20, join as join49 } from "path";
|
|
480222
480022
|
function formatTimestamp(ts) {
|
|
480223
480023
|
const d3 = new Date(ts);
|
|
480224
480024
|
return d3.toLocaleString("en-US", {
|
|
@@ -480390,17 +480190,17 @@ function exportChat(messages, opts) {
|
|
|
480390
480190
|
const ext = format === "json" ? ".json" : ".md";
|
|
480391
480191
|
let outPath;
|
|
480392
480192
|
if (opts.outPath) {
|
|
480393
|
-
outPath = opts.outPath.startsWith("/") ? opts.outPath :
|
|
480193
|
+
outPath = opts.outPath.startsWith("/") ? opts.outPath : join49(opts.cwd, opts.outPath);
|
|
480394
480194
|
} else {
|
|
480395
|
-
const exportDir =
|
|
480195
|
+
const exportDir = join49(opts.cwd, ".soulforge", "exports");
|
|
480396
480196
|
mkdirSync18(exportDir, {
|
|
480397
480197
|
recursive: true
|
|
480398
480198
|
});
|
|
480399
480199
|
const stamp = new Date().toISOString().slice(0, 19).replace(/[T:]/g, "-");
|
|
480400
480200
|
const slug = slugify3(title);
|
|
480401
|
-
outPath =
|
|
480201
|
+
outPath = join49(exportDir, `${slug}-${stamp}${ext}`);
|
|
480402
480202
|
}
|
|
480403
|
-
const parentDir =
|
|
480203
|
+
const parentDir = dirname20(outPath);
|
|
480404
480204
|
mkdirSync18(parentDir, {
|
|
480405
480205
|
recursive: true
|
|
480406
480206
|
});
|
|
@@ -480422,14 +480222,14 @@ async function handleExportAll(ctx) {
|
|
|
480422
480222
|
writeFileSync: writeFileSync20
|
|
480423
480223
|
} = await import("fs");
|
|
480424
480224
|
const {
|
|
480425
|
-
join:
|
|
480225
|
+
join: join50
|
|
480426
480226
|
} = await import("path");
|
|
480427
|
-
const exportDir =
|
|
480227
|
+
const exportDir = join50(ctx.cwd, ".soulforge", "exports");
|
|
480428
480228
|
mkdirSync19(exportDir, {
|
|
480429
480229
|
recursive: true
|
|
480430
480230
|
});
|
|
480431
480231
|
const stamp = new Date().toISOString().slice(0, 19).replace(/[T:]/g, "-");
|
|
480432
|
-
const outPath =
|
|
480232
|
+
const outPath = join50(exportDir, `diagnostic-${stamp}.json`);
|
|
480433
480233
|
const activeModel = ctx.chat.activeModel;
|
|
480434
480234
|
const systemPrompt = ctx.contextManager.buildSystemPrompt(activeModel);
|
|
480435
480235
|
const coreMessages = ctx.chat.coreMessages;
|
|
@@ -480486,9 +480286,9 @@ async function handleExportAll(ctx) {
|
|
|
480486
480286
|
const relPath = outPath.startsWith(ctx.cwd) ? outPath.slice(ctx.cwd.length + 1) : outPath;
|
|
480487
480287
|
sysMsg(ctx, `Diagnostic export \u2192 \`${relPath}\` (system prompt: ${String(Math.round(systemPrompt.length / 4))} tokens, ${String(coreMessages.length)} core messages, ${String(chatMessages.length)} chat messages)`);
|
|
480488
480288
|
const {
|
|
480489
|
-
dirname:
|
|
480289
|
+
dirname: dirname21
|
|
480490
480290
|
} = await import("path");
|
|
480491
|
-
Bun.spawn([process.platform === "darwin" ? "open" : "xdg-open",
|
|
480291
|
+
Bun.spawn([process.platform === "darwin" ? "open" : "xdg-open", dirname21(outPath)]);
|
|
480492
480292
|
}
|
|
480493
480293
|
async function handleExport(input, ctx) {
|
|
480494
480294
|
const trimmed = input.trim();
|
|
@@ -480535,9 +480335,9 @@ async function handleExport(input, ctx) {
|
|
|
480535
480335
|
const relPath = result.path.startsWith(ctx.cwd) ? result.path.slice(ctx.cwd.length + 1) : result.path;
|
|
480536
480336
|
sysMsg(ctx, `Exported ${String(result.messageCount)} messages \u2192 \`${relPath}\``);
|
|
480537
480337
|
const {
|
|
480538
|
-
dirname:
|
|
480338
|
+
dirname: dirname21
|
|
480539
480339
|
} = await import("path");
|
|
480540
|
-
const dir =
|
|
480340
|
+
const dir = dirname21(result.path);
|
|
480541
480341
|
const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "explorer" : "xdg-open";
|
|
480542
480342
|
Bun.spawn([opener, dir]);
|
|
480543
480343
|
}
|
|
@@ -480647,7 +480447,7 @@ var init_session = __esm(() => {
|
|
|
480647
480447
|
// src/core/commands/storage.ts
|
|
480648
480448
|
import { Database as Database3 } from "bun:sqlite";
|
|
480649
480449
|
import { existsSync as existsSync45, rmSync as rmSync5 } from "fs";
|
|
480650
|
-
import { join as
|
|
480450
|
+
import { join as join50 } from "path";
|
|
480651
480451
|
function openStorageMenu(ctx) {
|
|
480652
480452
|
const show = () => {
|
|
480653
480453
|
const s2 = computeStorageSizes(ctx.cwd);
|
|
@@ -480731,7 +480531,7 @@ function openStorageMenu(ctx) {
|
|
|
480731
480531
|
const cleared = sm.clearAllSessions();
|
|
480732
480532
|
sysMsg(ctx, `Cleared ${String(cleared)} sessions (freed ~${formatBytes(s2.sessions)}).`);
|
|
480733
480533
|
} else if (value === "clear-history") {
|
|
480734
|
-
const historyPath =
|
|
480534
|
+
const historyPath = join50(s2.globalDir, "history.db");
|
|
480735
480535
|
if (existsSync45(historyPath) && s2.history > 0) {
|
|
480736
480536
|
try {
|
|
480737
480537
|
const db = new Database3(historyPath);
|
|
@@ -480744,7 +480544,7 @@ function openStorageMenu(ctx) {
|
|
|
480744
480544
|
}
|
|
480745
480545
|
}
|
|
480746
480546
|
} else if (value === "clear-plans") {
|
|
480747
|
-
const plansDir =
|
|
480547
|
+
const plansDir = join50(s2.projectDir, "plans");
|
|
480748
480548
|
if (existsSync45(plansDir) && s2.plans > 0) {
|
|
480749
480549
|
rmSync5(plansDir, {
|
|
480750
480550
|
recursive: true
|
|
@@ -480753,7 +480553,7 @@ function openStorageMenu(ctx) {
|
|
|
480753
480553
|
}
|
|
480754
480554
|
} else if (value === "vacuum") {
|
|
480755
480555
|
let freed = 0;
|
|
480756
|
-
const dbs = [
|
|
480556
|
+
const dbs = [join50(s2.projectDir, "repomap.db"), join50(s2.projectDir, "memory.db"), join50(s2.globalDir, "history.db"), join50(s2.globalDir, "memory.db")];
|
|
480757
480557
|
for (const dbPath of dbs) {
|
|
480758
480558
|
if (!existsSync45(dbPath))
|
|
480759
480559
|
continue;
|
|
@@ -481748,7 +481548,7 @@ var init_registry = __esm(() => {
|
|
|
481748
481548
|
// src/core/terminal/suspend.ts
|
|
481749
481549
|
import { spawn as spawn19 } from "child_process";
|
|
481750
481550
|
function suspendAndRun(opts) {
|
|
481751
|
-
return new Promise((
|
|
481551
|
+
return new Promise((resolve40) => {
|
|
481752
481552
|
if (process.stdin.isTTY) {
|
|
481753
481553
|
process.stdin.setRawMode(false);
|
|
481754
481554
|
}
|
|
@@ -481770,7 +481570,7 @@ function suspendAndRun(opts) {
|
|
|
481770
481570
|
process.stdin.setRawMode(true);
|
|
481771
481571
|
process.stdin.resume();
|
|
481772
481572
|
}
|
|
481773
|
-
|
|
481573
|
+
resolve40({
|
|
481774
481574
|
exitCode: code
|
|
481775
481575
|
});
|
|
481776
481576
|
});
|
|
@@ -481782,7 +481582,7 @@ function suspendAndRun(opts) {
|
|
|
481782
481582
|
process.stdin.setRawMode(true);
|
|
481783
481583
|
process.stdin.resume();
|
|
481784
481584
|
}
|
|
481785
|
-
|
|
481585
|
+
resolve40({
|
|
481786
481586
|
exitCode: null
|
|
481787
481587
|
});
|
|
481788
481588
|
});
|
|
@@ -483137,7 +482937,7 @@ var init_useVersionCheck = __esm(() => {
|
|
|
483137
482937
|
var DEFAULT_DISABLED, useToolsStore;
|
|
483138
482938
|
var init_tools2 = __esm(() => {
|
|
483139
482939
|
init_esm();
|
|
483140
|
-
DEFAULT_DISABLED = ["request_tools", "release_tools", "skills", "editor"
|
|
482940
|
+
DEFAULT_DISABLED = ["request_tools", "release_tools", "skills", "editor"];
|
|
483141
482941
|
useToolsStore = create()((set3) => ({
|
|
483142
482942
|
disabledTools: new Set(DEFAULT_DISABLED),
|
|
483143
482943
|
toggleTool: (name39) => set3((s2) => {
|
|
@@ -486555,7 +486355,7 @@ function buildAssistantMessage({
|
|
|
486555
486355
|
|
|
486556
486356
|
// src/hooks/useChat.ts
|
|
486557
486357
|
import { readFile as readFile21 } from "fs/promises";
|
|
486558
|
-
import { join as
|
|
486358
|
+
import { join as join51 } from "path";
|
|
486559
486359
|
function pruneOldToolResults(msgs) {
|
|
486560
486360
|
let protectedTokens = 0;
|
|
486561
486361
|
let prunableTokens = 0;
|
|
@@ -486800,9 +486600,8 @@ function useChat({
|
|
|
486800
486600
|
return next;
|
|
486801
486601
|
}, [setForgeMode]);
|
|
486802
486602
|
import_react32.useEffect(() => {
|
|
486803
|
-
|
|
486804
|
-
|
|
486805
|
-
}, [visible, forgeMode, contextManager]);
|
|
486603
|
+
contextManager.setForgeMode(forgeMode);
|
|
486604
|
+
}, [forgeMode, contextManager]);
|
|
486806
486605
|
import_react32.useEffect(() => {
|
|
486807
486606
|
setCoAuthorEnabled(coAuthorCommits);
|
|
486808
486607
|
setShellCoAuthorEnabled(coAuthorCommits);
|
|
@@ -487426,7 +487225,7 @@ INCLUDE the plan progress above VERBATIM in ## Current State so the agent knows
|
|
|
487426
487225
|
const result = mutexRef.current.then(() => {
|
|
487427
487226
|
if (autoApproveRef.current)
|
|
487428
487227
|
return true;
|
|
487429
|
-
return new Promise((
|
|
487228
|
+
return new Promise((resolve40) => {
|
|
487430
487229
|
let done = false;
|
|
487431
487230
|
let remoteCancel = null;
|
|
487432
487231
|
const settle = (allowed, fromLocal, isAlways) => {
|
|
@@ -487439,7 +487238,7 @@ INCLUDE the plan progress above VERBATIM in ## Current State so the agent knows
|
|
|
487439
487238
|
autoApproveRef.current = true;
|
|
487440
487239
|
if (fromLocal && remoteCancel)
|
|
487441
487240
|
remoteCancel();
|
|
487442
|
-
|
|
487241
|
+
resolve40(allowed);
|
|
487443
487242
|
};
|
|
487444
487243
|
setPendingQuestion({
|
|
487445
487244
|
id: crypto.randomUUID(),
|
|
@@ -487512,7 +487311,7 @@ Fetch: ${url2}`, (url2) => ({
|
|
|
487512
487311
|
|
|
487513
487312
|
${path6}`), []);
|
|
487514
487313
|
const promptDestructive = import_react32.useCallback((description) => {
|
|
487515
|
-
return new Promise((
|
|
487314
|
+
return new Promise((resolve40) => {
|
|
487516
487315
|
setPendingQuestion({
|
|
487517
487316
|
id: crypto.randomUUID(),
|
|
487518
487317
|
question: `\u26A0 Potentially destructive action:
|
|
@@ -487528,7 +487327,7 @@ ${description}`,
|
|
|
487528
487327
|
allowSkip: false,
|
|
487529
487328
|
resolve: (answer) => {
|
|
487530
487329
|
setPendingQuestion(null);
|
|
487531
|
-
|
|
487330
|
+
resolve40(answer === "allow");
|
|
487532
487331
|
}
|
|
487533
487332
|
});
|
|
487534
487333
|
});
|
|
@@ -487559,13 +487358,13 @@ ${description}`,
|
|
|
487559
487358
|
setSidebarPlan(updater);
|
|
487560
487359
|
},
|
|
487561
487360
|
onPlanReview: (plan, planFile, planContent) => {
|
|
487562
|
-
return new Promise((
|
|
487361
|
+
return new Promise((resolve40) => {
|
|
487563
487362
|
let done = false;
|
|
487564
487363
|
const applyAction = async (action) => {
|
|
487565
487364
|
if (action === "execute" || action === "clear_execute") {
|
|
487566
487365
|
let content = null;
|
|
487567
487366
|
try {
|
|
487568
|
-
content = await readFile21(
|
|
487367
|
+
content = await readFile21(join51(cwd2, ".soulforge", "plans", planFileName(sessionIdRef.current)), "utf-8");
|
|
487569
487368
|
} catch {
|
|
487570
487369
|
content = planContent;
|
|
487571
487370
|
}
|
|
@@ -487594,7 +487393,7 @@ ${description}`,
|
|
|
487594
487393
|
done = true;
|
|
487595
487394
|
setPendingPlanReview(null);
|
|
487596
487395
|
applyAction(action).then(() => {
|
|
487597
|
-
|
|
487396
|
+
resolve40(action);
|
|
487598
487397
|
abortRef.current?.abort();
|
|
487599
487398
|
});
|
|
487600
487399
|
};
|
|
@@ -487624,14 +487423,14 @@ ${description}`,
|
|
|
487624
487423
|
});
|
|
487625
487424
|
},
|
|
487626
487425
|
onAskUser: (question, options, allowSkip) => {
|
|
487627
|
-
return new Promise((
|
|
487426
|
+
return new Promise((resolve40) => {
|
|
487628
487427
|
let done = false;
|
|
487629
487428
|
const settle = (v4) => {
|
|
487630
487429
|
if (done)
|
|
487631
487430
|
return;
|
|
487632
487431
|
done = true;
|
|
487633
487432
|
setPendingQuestion(null);
|
|
487634
|
-
|
|
487433
|
+
resolve40(v4);
|
|
487635
487434
|
};
|
|
487636
487435
|
setPendingQuestion({
|
|
487637
487436
|
id: crypto.randomUUID(),
|
|
@@ -488114,7 +487913,7 @@ ${description}`,
|
|
|
488114
487913
|
};
|
|
488115
487914
|
if (!contextManager.isRepoMapReady()) {
|
|
488116
487915
|
setIsLoading(true);
|
|
488117
|
-
const answer = await new Promise((
|
|
487916
|
+
const answer = await new Promise((resolve40) => {
|
|
488118
487917
|
const questionId = crypto.randomUUID();
|
|
488119
487918
|
const warning = `
|
|
488120
487919
|
|
|
@@ -488145,7 +487944,7 @@ Proceeding without it will significantly reduce capabilities \u2014 no soul tool
|
|
|
488145
487944
|
resolve: (answer2) => {
|
|
488146
487945
|
cleanup();
|
|
488147
487946
|
setPendingQuestion(null);
|
|
488148
|
-
|
|
487947
|
+
resolve40(answer2);
|
|
488149
487948
|
}
|
|
488150
487949
|
});
|
|
488151
487950
|
const progressTimer = setInterval(updateQuestion, 500);
|
|
@@ -488153,12 +487952,12 @@ Proceeding without it will significantly reduce capabilities \u2014 no soul tool
|
|
|
488153
487952
|
if (contextManager.isRepoMapReady()) {
|
|
488154
487953
|
cleanup();
|
|
488155
487954
|
setPendingQuestion(null);
|
|
488156
|
-
|
|
487955
|
+
resolve40("ready");
|
|
488157
487956
|
}
|
|
488158
487957
|
}, 200);
|
|
488159
487958
|
abortController.signal.addEventListener("abort", () => {
|
|
488160
487959
|
cleanup();
|
|
488161
|
-
|
|
487960
|
+
resolve40("abort");
|
|
488162
487961
|
}, {
|
|
488163
487962
|
once: true
|
|
488164
487963
|
});
|
|
@@ -489014,7 +488813,7 @@ ${errStack}` : `Error: ${displayErr}`);
|
|
|
489014
488813
|
proxyBounced = true;
|
|
489015
488814
|
const healthy = await proxyHealthProbe().catch(() => false);
|
|
489016
488815
|
if (!healthy) {
|
|
489017
|
-
await Promise.race([bounceProxy().catch(() => false), new Promise((
|
|
488816
|
+
await Promise.race([bounceProxy().catch(() => false), new Promise((resolve40) => setTimeout(() => resolve40(false), 8000))]);
|
|
489018
488817
|
}
|
|
489019
488818
|
}
|
|
489020
488819
|
const isStallRetry = isAbort && stallTriggered && !userAborted && stallRetryCountRef.current <= STALL_MAX_RETRIES;
|
|
@@ -489089,12 +488888,12 @@ ${errStack}` : `Error: ${displayErr}`);
|
|
|
489089
488888
|
setStreamSegments([]);
|
|
489090
488889
|
setLiveToolCalls([]);
|
|
489091
488890
|
stallRetryPendingRef.current = true;
|
|
489092
|
-
await new Promise((
|
|
488891
|
+
await new Promise((resolve40) => setTimeout(resolve40, delay3));
|
|
489093
488892
|
continue;
|
|
489094
488893
|
} else {
|
|
489095
488894
|
stallRetryPendingRef.current = true;
|
|
489096
488895
|
const backoffDelay = RETRY_BASE_DELAY_MS * 2 ** (streamRetryCount - 1) + Math.random() * 500;
|
|
489097
|
-
await new Promise((
|
|
488896
|
+
await new Promise((resolve40) => setTimeout(resolve40, backoffDelay));
|
|
489098
488897
|
continue;
|
|
489099
488898
|
}
|
|
489100
488899
|
}
|
|
@@ -489979,13 +489778,13 @@ var init_CheckpointRail = __esm(() => {
|
|
|
489979
489778
|
// src/core/history/db.ts
|
|
489980
489779
|
import { Database as Database4 } from "bun:sqlite";
|
|
489981
489780
|
import { existsSync as existsSync46, mkdirSync as mkdirSync19 } from "fs";
|
|
489982
|
-
import { dirname as
|
|
489781
|
+
import { dirname as dirname21 } from "path";
|
|
489983
489782
|
|
|
489984
489783
|
class HistoryDB {
|
|
489985
489784
|
db;
|
|
489986
489785
|
writesSincePrune = 0;
|
|
489987
489786
|
constructor(dbPath) {
|
|
489988
|
-
const dir =
|
|
489787
|
+
const dir = dirname21(dbPath);
|
|
489989
489788
|
if (!existsSync46(dir))
|
|
489990
489789
|
mkdirSync19(dir, {
|
|
489991
489790
|
recursive: true
|
|
@@ -490146,7 +489945,7 @@ function readClipboardImageAsync() {
|
|
|
490146
489945
|
}
|
|
490147
489946
|
function readClipboardImageDarwinAsync() {
|
|
490148
489947
|
const tmpFile = `/tmp/soulforge-clipboard-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.png`;
|
|
490149
|
-
return new Promise((
|
|
489948
|
+
return new Promise((resolve40) => {
|
|
490150
489949
|
exec(`osascript -e '
|
|
490151
489950
|
try
|
|
490152
489951
|
set pngData to the clipboard as \xABclass PNGf\xBB
|
|
@@ -490164,14 +489963,14 @@ end try
|
|
|
490164
489963
|
}, (err2, stdout) => {
|
|
490165
489964
|
if (err2 || !stdout.toString().trim().startsWith("ok")) {
|
|
490166
489965
|
cleanup(tmpFile);
|
|
490167
|
-
|
|
489966
|
+
resolve40(null);
|
|
490168
489967
|
return;
|
|
490169
489968
|
}
|
|
490170
489969
|
try {
|
|
490171
489970
|
const data = readFileSync27(tmpFile);
|
|
490172
489971
|
unlinkSync11(tmpFile);
|
|
490173
489972
|
if (data.length > 0) {
|
|
490174
|
-
|
|
489973
|
+
resolve40({
|
|
490175
489974
|
data,
|
|
490176
489975
|
mediaType: "image/png"
|
|
490177
489976
|
});
|
|
@@ -490180,19 +489979,19 @@ end try
|
|
|
490180
489979
|
} catch {} finally {
|
|
490181
489980
|
cleanup(tmpFile);
|
|
490182
489981
|
}
|
|
490183
|
-
|
|
489982
|
+
resolve40(null);
|
|
490184
489983
|
});
|
|
490185
489984
|
});
|
|
490186
489985
|
}
|
|
490187
489986
|
function readClipboardImageLinuxAsync() {
|
|
490188
|
-
return new Promise((
|
|
489987
|
+
return new Promise((resolve40) => {
|
|
490189
489988
|
exec("xclip -selection clipboard -t image/png -o 2>/dev/null", {
|
|
490190
489989
|
timeout: 3000,
|
|
490191
489990
|
maxBuffer: 20 * 1024 * 1024,
|
|
490192
489991
|
encoding: "buffer"
|
|
490193
489992
|
}, (err2, stdout) => {
|
|
490194
489993
|
if (!err2 && stdout && stdout.length > 0) {
|
|
490195
|
-
|
|
489994
|
+
resolve40({
|
|
490196
489995
|
data: stdout,
|
|
490197
489996
|
mediaType: "image/png"
|
|
490198
489997
|
});
|
|
@@ -490204,13 +490003,13 @@ function readClipboardImageLinuxAsync() {
|
|
|
490204
490003
|
encoding: "buffer"
|
|
490205
490004
|
}, (err22, stdout2) => {
|
|
490206
490005
|
if (!err22 && stdout2 && stdout2.length > 0) {
|
|
490207
|
-
|
|
490006
|
+
resolve40({
|
|
490208
490007
|
data: stdout2,
|
|
490209
490008
|
mediaType: "image/png"
|
|
490210
490009
|
});
|
|
490211
490010
|
return;
|
|
490212
490011
|
}
|
|
490213
|
-
|
|
490012
|
+
resolve40(null);
|
|
490214
490013
|
});
|
|
490215
490014
|
});
|
|
490216
490015
|
});
|
|
@@ -490224,7 +490023,7 @@ var init_clipboard = () => {};
|
|
|
490224
490023
|
|
|
490225
490024
|
// src/components/chat/InputBox.tsx
|
|
490226
490025
|
import { homedir as homedir32 } from "os";
|
|
490227
|
-
import { join as
|
|
490026
|
+
import { join as join52 } from "path";
|
|
490228
490027
|
function getCommands() {
|
|
490229
490028
|
if (!_commands) {
|
|
490230
490029
|
_commands = getCommandDefs().filter((c) => !c.hidden).map((c) => ({
|
|
@@ -490400,7 +490199,7 @@ var init_InputBox = __esm(async () => {
|
|
|
490400
490199
|
const historyStash = import_react36.useRef("");
|
|
490401
490200
|
const getHistoryDB = import_react36.useCallback(() => {
|
|
490402
490201
|
if (!historyDBRef.current) {
|
|
490403
|
-
historyDBRef.current = new HistoryDB(
|
|
490202
|
+
historyDBRef.current = new HistoryDB(join52(homedir32(), ".soulforge", "history.db"));
|
|
490404
490203
|
}
|
|
490405
490204
|
return historyDBRef.current;
|
|
490406
490205
|
}, []);
|
|
@@ -491130,7 +490929,6 @@ function getToolIconColors() {
|
|
|
491130
490929
|
rename_file: t2.amber,
|
|
491131
490930
|
refactor: t2.amber,
|
|
491132
490931
|
project: t2.error,
|
|
491133
|
-
test_scaffold: t2.brandAlt,
|
|
491134
490932
|
discover_pattern: t2.brandAlt,
|
|
491135
490933
|
plan: t2.info,
|
|
491136
490934
|
update_plan_step: t2.info,
|
|
@@ -491168,7 +490966,6 @@ var init_tool_display = __esm(() => {
|
|
|
491168
490966
|
rename_file: "code",
|
|
491169
490967
|
refactor: "code",
|
|
491170
490968
|
project: "shell",
|
|
491171
|
-
test_scaffold: "code",
|
|
491172
490969
|
discover_pattern: "code",
|
|
491173
490970
|
ast_edit: "morph",
|
|
491174
490971
|
editor: "editor",
|
|
@@ -491223,7 +491020,6 @@ var init_tool_display = __esm(() => {
|
|
|
491223
491020
|
rename_file: "arrow_right",
|
|
491224
491021
|
refactor: "wrench",
|
|
491225
491022
|
project: "terminal",
|
|
491226
|
-
test_scaffold: "plan",
|
|
491227
491023
|
discover_pattern: "search",
|
|
491228
491024
|
editor_panel: "pencil",
|
|
491229
491025
|
plan: "plan",
|
|
@@ -491269,7 +491065,6 @@ var init_tool_display = __esm(() => {
|
|
|
491269
491065
|
rename_file: "Moving file",
|
|
491270
491066
|
refactor: "Refactoring",
|
|
491271
491067
|
project: "Project",
|
|
491272
|
-
test_scaffold: "Scaffolding tests",
|
|
491273
491068
|
discover_pattern: "Discovering",
|
|
491274
491069
|
ast_edit: "morphing",
|
|
491275
491070
|
editor_panel: "Opening editor",
|
|
@@ -491308,7 +491103,6 @@ var init_tool_display = __esm(() => {
|
|
|
491308
491103
|
rename_file: "Moved file",
|
|
491309
491104
|
refactor: "Refactored",
|
|
491310
491105
|
project: "Project",
|
|
491311
|
-
test_scaffold: "Scaffolded tests",
|
|
491312
491106
|
discover_pattern: "Discovered",
|
|
491313
491107
|
ast_edit: "morphed",
|
|
491314
491108
|
editor_panel: "Opened editor",
|
|
@@ -491382,7 +491176,7 @@ var init_plan_schema = __esm(() => {
|
|
|
491382
491176
|
});
|
|
491383
491177
|
|
|
491384
491178
|
// src/components/layout/ChangedFiles.tsx
|
|
491385
|
-
import { basename as
|
|
491179
|
+
import { basename as basename11, relative as relative14 } from "path";
|
|
491386
491180
|
function addFile(fileMap, path6, created = false) {
|
|
491387
491181
|
const existing = fileMap.get(path6);
|
|
491388
491182
|
if (existing) {
|
|
@@ -491538,7 +491332,7 @@ function ChangedFilesBar(t0) {
|
|
|
491538
491332
|
}, undefined, false, undefined, this) : null,
|
|
491539
491333
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
491540
491334
|
fg: f_0.created ? t2.success : t2.amber,
|
|
491541
|
-
children:
|
|
491335
|
+
children: basename11(f_0.path)
|
|
491542
491336
|
}, undefined, false, undefined, this)
|
|
491543
491337
|
]
|
|
491544
491338
|
}, f_0.path, true, undefined, this);
|
|
@@ -491667,7 +491461,7 @@ function buildTree(files, cwd2) {
|
|
|
491667
491461
|
children: new Map
|
|
491668
491462
|
};
|
|
491669
491463
|
for (const f3 of files) {
|
|
491670
|
-
const rel =
|
|
491464
|
+
const rel = relative14(cwd2, f3.path) || basename11(f3.path);
|
|
491671
491465
|
const parts2 = rel.split("/");
|
|
491672
491466
|
let node2 = root2;
|
|
491673
491467
|
for (let i4 = 0;i4 < parts2.length - 1; i4++) {
|
|
@@ -492941,7 +492735,7 @@ var init_diff2 = __esm(() => {
|
|
|
492941
492735
|
// src/core/utils/syntax.ts
|
|
492942
492736
|
import { existsSync as existsSync47, readdirSync as readdirSync10 } from "fs";
|
|
492943
492737
|
import { homedir as homedir33 } from "os";
|
|
492944
|
-
import { dirname as
|
|
492738
|
+
import { dirname as dirname22, join as join53, resolve as resolve40 } from "path";
|
|
492945
492739
|
function discoverParsers() {
|
|
492946
492740
|
const parsers = [];
|
|
492947
492741
|
let dirs;
|
|
@@ -492953,13 +492747,13 @@ function discoverParsers() {
|
|
|
492953
492747
|
return parsers;
|
|
492954
492748
|
}
|
|
492955
492749
|
for (const dir of dirs) {
|
|
492956
|
-
const langDir =
|
|
492750
|
+
const langDir = resolve40(coreAssetsDir, dir);
|
|
492957
492751
|
const wasmFiles = readdirSync10(langDir).filter((f3) => f3.endsWith(".wasm"));
|
|
492958
492752
|
const wasmFile = wasmFiles[0];
|
|
492959
492753
|
if (!wasmFile)
|
|
492960
492754
|
continue;
|
|
492961
|
-
const highlights =
|
|
492962
|
-
const injections =
|
|
492755
|
+
const highlights = resolve40(langDir, "highlights.scm");
|
|
492756
|
+
const injections = resolve40(langDir, "injections.scm");
|
|
492963
492757
|
const hasHighlights = existsSync47(highlights);
|
|
492964
492758
|
const hasInjections = existsSync47(injections);
|
|
492965
492759
|
if (!hasHighlights)
|
|
@@ -492972,7 +492766,7 @@ function discoverParsers() {
|
|
|
492972
492766
|
injections: [injections]
|
|
492973
492767
|
} : {}
|
|
492974
492768
|
},
|
|
492975
|
-
wasm:
|
|
492769
|
+
wasm: resolve40(langDir, wasmFile),
|
|
492976
492770
|
...TS_ALIASES[dir] ? {
|
|
492977
492771
|
aliases: TS_ALIASES[dir]
|
|
492978
492772
|
} : {},
|
|
@@ -492989,7 +492783,7 @@ function discoverParsers() {
|
|
|
492989
492783
|
queries: {
|
|
492990
492784
|
highlights: [highlights]
|
|
492991
492785
|
},
|
|
492992
|
-
wasm:
|
|
492786
|
+
wasm: resolve40(langDir, wasmFile)
|
|
492993
492787
|
});
|
|
492994
492788
|
}
|
|
492995
492789
|
}
|
|
@@ -493013,15 +492807,15 @@ var init_syntax = __esm(async () => {
|
|
|
493013
492807
|
await init_core4();
|
|
493014
492808
|
IS_COMPILED3 = import.meta.url.includes("$bunfs");
|
|
493015
492809
|
IS_DIST3 = !IS_COMPILED3 && import.meta.dir.includes("/dist");
|
|
493016
|
-
bundledAssets =
|
|
493017
|
-
distAssets =
|
|
492810
|
+
bundledAssets = join53(homedir33(), ".soulforge", "opentui-assets");
|
|
492811
|
+
distAssets = join53(import.meta.dir, "opentui-assets");
|
|
493018
492812
|
if (IS_COMPILED3) {
|
|
493019
492813
|
coreAssetsDir = bundledAssets;
|
|
493020
492814
|
} else if (IS_DIST3) {
|
|
493021
492815
|
coreAssetsDir = existsSync47(distAssets) ? distAssets : bundledAssets;
|
|
493022
492816
|
} else {
|
|
493023
492817
|
try {
|
|
493024
|
-
coreAssetsDir =
|
|
492818
|
+
coreAssetsDir = resolve40(dirname22(__require.resolve("@opentui/core")), "assets");
|
|
493025
492819
|
} catch {
|
|
493026
492820
|
coreAssetsDir = bundledAssets;
|
|
493027
492821
|
}
|
|
@@ -493080,10 +492874,10 @@ var init_syntax = __esm(async () => {
|
|
|
493080
492874
|
};
|
|
493081
492875
|
addDefaultParsers(discoverParsers());
|
|
493082
492876
|
if (IS_COMPILED3) {
|
|
493083
|
-
process.env.OTUI_TREE_SITTER_WORKER_PATH =
|
|
492877
|
+
process.env.OTUI_TREE_SITTER_WORKER_PATH = join53(homedir33(), ".soulforge", "opentui-assets", "parser.worker.js");
|
|
493084
492878
|
} else if (IS_DIST3) {
|
|
493085
492879
|
try {
|
|
493086
|
-
const coreWorker =
|
|
492880
|
+
const coreWorker = resolve40(dirname22(__require.resolve("@opentui/core")), "parser.worker.js");
|
|
493087
492881
|
if (existsSync47(coreWorker)) {
|
|
493088
492882
|
process.env.OTUI_TREE_SITTER_WORKER_PATH = coreWorker;
|
|
493089
492883
|
}
|
|
@@ -493934,7 +493728,7 @@ var init_dispatch_display = __esm(async () => {
|
|
|
493934
493728
|
});
|
|
493935
493729
|
|
|
493936
493730
|
// src/components/chat/ImageDisplay.tsx
|
|
493937
|
-
import { basename as
|
|
493731
|
+
import { basename as basename12 } from "path";
|
|
493938
493732
|
function buildPlaceholderRow(cols, row) {
|
|
493939
493733
|
const rowDia = String.fromCodePoint(DIACRITICS[row] ?? 773);
|
|
493940
493734
|
let result = "";
|
|
@@ -493952,7 +493746,7 @@ function ImageHeader(t0) {
|
|
|
493952
493746
|
const t2 = useTheme();
|
|
493953
493747
|
let t1;
|
|
493954
493748
|
if ($5[0] !== img.name) {
|
|
493955
|
-
t1 =
|
|
493749
|
+
t1 = basename12(img.name);
|
|
493956
493750
|
$5[0] = img.name;
|
|
493957
493751
|
$5[1] = t1;
|
|
493958
493752
|
} else {
|
|
@@ -494224,7 +494018,7 @@ var init_ImageDisplay = __esm(() => {
|
|
|
494224
494018
|
});
|
|
494225
494019
|
|
|
494226
494020
|
// src/components/chat/tool-formatters.ts
|
|
494227
|
-
import { resolve as
|
|
494021
|
+
import { resolve as resolve41 } from "path";
|
|
494228
494022
|
function isObj(v4) {
|
|
494229
494023
|
return v4 != null && typeof v4 === "object" && !Array.isArray(v4);
|
|
494230
494024
|
}
|
|
@@ -494405,9 +494199,6 @@ function formatArgs(toolName, args2) {
|
|
|
494405
494199
|
if (toolName === "discover_pattern" && parsed.query) {
|
|
494406
494200
|
return String(parsed.query);
|
|
494407
494201
|
}
|
|
494408
|
-
if (toolName === "test_scaffold" && parsed.file) {
|
|
494409
|
-
return String(parsed.file);
|
|
494410
|
-
}
|
|
494411
494202
|
if (toolName === "write_plan" || toolName === "plan") {
|
|
494412
494203
|
if (parsed.title)
|
|
494413
494204
|
return String(parsed.title);
|
|
@@ -494755,7 +494546,7 @@ function checkPath(p2) {
|
|
|
494755
494546
|
return null;
|
|
494756
494547
|
if (!p2.startsWith("/") && !p2.startsWith("~"))
|
|
494757
494548
|
return null;
|
|
494758
|
-
const resolved =
|
|
494549
|
+
const resolved = resolve41(p2);
|
|
494759
494550
|
if (isInsideCwd(resolved, process.cwd()))
|
|
494760
494551
|
return null;
|
|
494761
494552
|
return classifyPath(canonicalizePath(resolved), process.cwd());
|
|
@@ -494851,7 +494642,6 @@ var init_tool_formatters = __esm(async () => {
|
|
|
494851
494642
|
analyze: ["file"],
|
|
494852
494643
|
refactor: ["file"],
|
|
494853
494644
|
project: ["file"],
|
|
494854
|
-
test_scaffold: ["file"],
|
|
494855
494645
|
discover_pattern: ["file"],
|
|
494856
494646
|
soul_grep: ["path"],
|
|
494857
494647
|
soul_find: ["path"],
|
|
@@ -497709,7 +497499,7 @@ var init_tool_grouping = __esm(() => {
|
|
|
497709
497499
|
|
|
497710
497500
|
// src/components/chat/MessageList.tsx
|
|
497711
497501
|
import { readFile as readFile25 } from "fs/promises";
|
|
497712
|
-
import { join as
|
|
497502
|
+
import { join as join54 } from "path";
|
|
497713
497503
|
function useReasoningExpanded() {
|
|
497714
497504
|
return import_react44.useContext(ReasoningExpandedContext);
|
|
497715
497505
|
}
|
|
@@ -498554,7 +498344,7 @@ function WritePlanCall(t0) {
|
|
|
498554
498344
|
if (!planFile) {
|
|
498555
498345
|
return;
|
|
498556
498346
|
}
|
|
498557
|
-
readFile25(
|
|
498347
|
+
readFile25(join54(process.cwd(), planFile), "utf-8").then(setMarkdown).catch(() => setMarkdown(null));
|
|
498558
498348
|
};
|
|
498559
498349
|
t4 = [planFile];
|
|
498560
498350
|
$5[4] = planFile;
|
|
@@ -508366,7 +508156,7 @@ var init_TerminalList = __esm(() => {
|
|
|
508366
508156
|
|
|
508367
508157
|
// src/components/layout/TabInstance.tsx
|
|
508368
508158
|
import { unlink as unlink3 } from "fs/promises";
|
|
508369
|
-
import { join as
|
|
508159
|
+
import { join as join55 } from "path";
|
|
508370
508160
|
function getScrollbarVisible(tk) {
|
|
508371
508161
|
return {
|
|
508372
508162
|
visible: true,
|
|
@@ -508684,7 +508474,7 @@ var init_TabInstance = __esm(async () => {
|
|
|
508684
508474
|
useCheckpointStore.getState().cleanupGitTags(tabId, cwd2);
|
|
508685
508475
|
}
|
|
508686
508476
|
useCheckpointStore.getState().clear(tabId);
|
|
508687
|
-
const p2 =
|
|
508477
|
+
const p2 = join55(cwd2, ".soulforge", "plans", planFileName(chat.sessionId));
|
|
508688
508478
|
unlink3(p2).catch(() => {});
|
|
508689
508479
|
};
|
|
508690
508480
|
}, [contextManager, tabId, cwd2, chat.sessionId]);
|
|
@@ -508854,7 +508644,7 @@ var init_TabInstance = __esm(async () => {
|
|
|
508854
508644
|
chat.setMessages(updated);
|
|
508855
508645
|
}, [chat.messages.length]);
|
|
508856
508646
|
const cleanupPlanFile = import_react70.useCallback(() => {
|
|
508857
|
-
const p_0 =
|
|
508647
|
+
const p_0 = join55(cwd2, ".soulforge", "plans", planFileName(chat.sessionId));
|
|
508858
508648
|
unlink3(p_0).catch(() => {});
|
|
508859
508649
|
}, [cwd2, chat.sessionId]);
|
|
508860
508650
|
const onAcceptPlan = import_react70.useCallback(() => {
|
|
@@ -524230,7 +524020,7 @@ function EditorSettings(t0) {
|
|
|
524230
524020
|
t7 = $5[19];
|
|
524231
524021
|
}
|
|
524232
524022
|
const enabled = t7.length;
|
|
524233
|
-
const
|
|
524023
|
+
const access5 = current.agentAccess ?? "on";
|
|
524234
524024
|
const t8 = `${enabled} / ${FEATURES.length} enabled \xB7 scope: ${scope}`;
|
|
524235
524025
|
let t9;
|
|
524236
524026
|
if ($5[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -524297,14 +524087,14 @@ function EditorSettings(t0) {
|
|
|
524297
524087
|
t14 = $5[28];
|
|
524298
524088
|
}
|
|
524299
524089
|
let t15;
|
|
524300
|
-
if ($5[29] !==
|
|
524090
|
+
if ($5[29] !== access5) {
|
|
524301
524091
|
t15 = /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SegmentedControl, {
|
|
524302
524092
|
label: "Agent access",
|
|
524303
524093
|
labelWidth: 14,
|
|
524304
524094
|
options: t14,
|
|
524305
|
-
value:
|
|
524095
|
+
value: access5
|
|
524306
524096
|
}, undefined, false, undefined, this);
|
|
524307
|
-
$5[29] =
|
|
524097
|
+
$5[29] = access5;
|
|
524308
524098
|
$5[30] = t15;
|
|
524309
524099
|
} else {
|
|
524310
524100
|
t15 = $5[30];
|
|
@@ -524555,7 +524345,7 @@ var init_hearth2 = __esm(() => {
|
|
|
524555
524345
|
import { execSync as execSync11, spawn as spawn22 } from "child_process";
|
|
524556
524346
|
import { appendFileSync as appendFileSync5, existsSync as existsSync48, readFileSync as readFileSync28, statSync as statSync10, watch as watch3 } from "fs";
|
|
524557
524347
|
import { homedir as homedir34, tmpdir as tmpdir5 } from "os";
|
|
524558
|
-
import { delimiter, dirname as
|
|
524348
|
+
import { delimiter, dirname as dirname23, join as join56, resolve as resolve42 } from "path";
|
|
524559
524349
|
function surfaceIdFrom(kind, id) {
|
|
524560
524350
|
return `${kind}:${id}`;
|
|
524561
524351
|
}
|
|
@@ -525244,7 +525034,7 @@ function HearthSettings({
|
|
|
525244
525034
|
flashMsg("err", "could not locate a soulforge launcher \u2014 set SOULFORGE_HEARTH_LAUNCHER or run `soulforge hearth start` manually");
|
|
525245
525035
|
return;
|
|
525246
525036
|
}
|
|
525247
|
-
const bootLog =
|
|
525037
|
+
const bootLog = join56(tmpdir5(), `soulforge-hearth-boot-${String(Date.now())}.log`);
|
|
525248
525038
|
appendFileSync5(bootLog, `# ${new Date().toISOString()} starting via ${launcher.kind}
|
|
525249
525039
|
` + `# cmd: ${launcher.cmd} ${launcher.args.join(" ")}
|
|
525250
525040
|
|
|
@@ -525298,7 +525088,7 @@ function HearthSettings({
|
|
|
525298
525088
|
return;
|
|
525299
525089
|
}
|
|
525300
525090
|
}
|
|
525301
|
-
const pidPath =
|
|
525091
|
+
const pidPath = join56(homedir34(), ".soulforge", "hearth.pid");
|
|
525302
525092
|
let pid = null;
|
|
525303
525093
|
if (existsSync48(pidPath)) {
|
|
525304
525094
|
const raw_0 = readFileSync28(pidPath, "utf-8").trim();
|
|
@@ -528254,9 +528044,9 @@ function resolveLauncher() {
|
|
|
528254
528044
|
}
|
|
528255
528045
|
const checkout = findSourceCheckout(process.argv[1] ?? process.cwd());
|
|
528256
528046
|
if (checkout) {
|
|
528257
|
-
const bootTsx =
|
|
528258
|
-
const distEntry =
|
|
528259
|
-
const bin =
|
|
528047
|
+
const bootTsx = join56(checkout, "src", "boot.tsx");
|
|
528048
|
+
const distEntry = join56(checkout, "dist", "bin.sh");
|
|
528049
|
+
const bin = join56(checkout, "bin", "soulforge");
|
|
528260
528050
|
if (existsSync48(bootTsx)) {
|
|
528261
528051
|
const bunBin = process.execPath.includes("bun") ? process.execPath : findBinaryOnPath("bun") ?? "bun";
|
|
528262
528052
|
return {
|
|
@@ -528290,9 +528080,9 @@ function resolveLauncher() {
|
|
|
528290
528080
|
return null;
|
|
528291
528081
|
}
|
|
528292
528082
|
function findSourceCheckout(startPath) {
|
|
528293
|
-
let dir = startPath && existsSync48(startPath) ?
|
|
528083
|
+
let dir = startPath && existsSync48(startPath) ? resolve42(dirname23(startPath)) : resolve42(process.cwd());
|
|
528294
528084
|
for (let i4 = 0;i4 < 6; i4++) {
|
|
528295
|
-
const pkg =
|
|
528085
|
+
const pkg = join56(dir, "package.json");
|
|
528296
528086
|
if (existsSync48(pkg)) {
|
|
528297
528087
|
try {
|
|
528298
528088
|
const parsed = JSON.parse(readFileSync28(pkg, "utf-8"));
|
|
@@ -528301,7 +528091,7 @@ function findSourceCheckout(startPath) {
|
|
|
528301
528091
|
}
|
|
528302
528092
|
} catch {}
|
|
528303
528093
|
}
|
|
528304
|
-
const parent =
|
|
528094
|
+
const parent = dirname23(dir);
|
|
528305
528095
|
if (parent === dir)
|
|
528306
528096
|
break;
|
|
528307
528097
|
dir = parent;
|
|
@@ -528327,7 +528117,7 @@ function findBinaryOnPath(name39) {
|
|
|
528327
528117
|
return which;
|
|
528328
528118
|
} catch {}
|
|
528329
528119
|
for (const dir of (process.env.PATH ?? "").split(delimiter)) {
|
|
528330
|
-
const candidate =
|
|
528120
|
+
const candidate = join56(dir, name39);
|
|
528331
528121
|
if (existsSync48(candidate) && isExecutable(candidate))
|
|
528332
528122
|
return candidate;
|
|
528333
528123
|
}
|
|
@@ -528424,7 +528214,7 @@ var init_HearthSettings = __esm(async () => {
|
|
|
528424
528214
|
import { execSync as execSync12, spawn as spawn23 } from "child_process";
|
|
528425
528215
|
import { chmodSync as chmodSync5, existsSync as existsSync49, mkdirSync as mkdirSync20, readFileSync as readFileSync29, unlinkSync as unlinkSync12, writeFileSync as writeFileSync20 } from "fs";
|
|
528426
528216
|
import { homedir as homedir35 } from "os";
|
|
528427
|
-
import { join as
|
|
528217
|
+
import { join as join57 } from "path";
|
|
528428
528218
|
function parsePurl(id) {
|
|
528429
528219
|
const match2 = id.match(/^pkg:(\w+)\/(.+?)@(.+)$/);
|
|
528430
528220
|
if (!match2)
|
|
@@ -528512,7 +528302,7 @@ function loadRegistry() {
|
|
|
528512
528302
|
return [];
|
|
528513
528303
|
}
|
|
528514
528304
|
async function downloadRegistry() {
|
|
528515
|
-
mkdirSync20(
|
|
528305
|
+
mkdirSync20(join57(homedir35(), ".soulforge"), {
|
|
528516
528306
|
recursive: true
|
|
528517
528307
|
});
|
|
528518
528308
|
try {
|
|
@@ -528532,17 +528322,17 @@ async function downloadRegistry() {
|
|
|
528532
528322
|
if (!zipResp.ok)
|
|
528533
528323
|
throw new Error(`Download HTTP ${String(zipResp.status)}`);
|
|
528534
528324
|
const zipBuf = await zipResp.arrayBuffer();
|
|
528535
|
-
const tmpZip =
|
|
528325
|
+
const tmpZip = join57(homedir35(), ".soulforge", "mason-registry.zip");
|
|
528536
528326
|
writeFileSync20(tmpZip, Buffer.from(zipBuf));
|
|
528537
528327
|
const {
|
|
528538
528328
|
execSync: execSync13
|
|
528539
528329
|
} = await import("child_process");
|
|
528540
|
-
execSync13(`unzip -qo "${tmpZip}" registry.json -d "${
|
|
528330
|
+
execSync13(`unzip -qo "${tmpZip}" registry.json -d "${join57(homedir35(), ".soulforge")}"`, {
|
|
528541
528331
|
stdio: "ignore",
|
|
528542
528332
|
timeout: 1e4
|
|
528543
528333
|
});
|
|
528544
528334
|
unlinkSync12(tmpZip);
|
|
528545
|
-
const jsonPath =
|
|
528335
|
+
const jsonPath = join57(homedir35(), ".soulforge", "registry.json");
|
|
528546
528336
|
const text3 = readFileSync29(jsonPath, "utf-8");
|
|
528547
528337
|
writeFileSync20(REGISTRY_CACHE, text3);
|
|
528548
528338
|
unlinkSync12(jsonPath);
|
|
@@ -528596,7 +528386,7 @@ function loadVersions() {
|
|
|
528596
528386
|
function saveVersions(map2) {
|
|
528597
528387
|
versionCache = map2;
|
|
528598
528388
|
try {
|
|
528599
|
-
mkdirSync20(
|
|
528389
|
+
mkdirSync20(join57(homedir35(), ".soulforge"), {
|
|
528600
528390
|
recursive: true
|
|
528601
528391
|
});
|
|
528602
528392
|
writeFileSync20(VERSIONS_FILE, JSON.stringify(map2, null, 2), "utf-8");
|
|
@@ -528634,17 +528424,17 @@ function checkPackageStatus(pkg) {
|
|
|
528634
528424
|
source = "PATH";
|
|
528635
528425
|
break;
|
|
528636
528426
|
}
|
|
528637
|
-
if (existsSync49(
|
|
528427
|
+
if (existsSync49(join57(SOULFORGE_LSP_DIR, "node_modules", ".bin", bin))) {
|
|
528638
528428
|
installed2 = true;
|
|
528639
528429
|
source = "soulforge";
|
|
528640
528430
|
break;
|
|
528641
528431
|
}
|
|
528642
|
-
if (existsSync49(
|
|
528432
|
+
if (existsSync49(join57(SOULFORGE_LSP_DIR, "bin", bin))) {
|
|
528643
528433
|
installed2 = true;
|
|
528644
528434
|
source = "soulforge";
|
|
528645
528435
|
break;
|
|
528646
528436
|
}
|
|
528647
|
-
if (existsSync49(
|
|
528437
|
+
if (existsSync49(join57(MASON_BIN_DIR2, bin))) {
|
|
528648
528438
|
installed2 = true;
|
|
528649
528439
|
source = "mason";
|
|
528650
528440
|
break;
|
|
@@ -528734,7 +528524,7 @@ async function installPackage(pkg, onProgress) {
|
|
|
528734
528524
|
});
|
|
528735
528525
|
return "bun";
|
|
528736
528526
|
} catch {
|
|
528737
|
-
const sfBin =
|
|
528527
|
+
const sfBin = join57(homedir35(), ".soulforge", "bin", "bun");
|
|
528738
528528
|
if (existsSync49(sfBin))
|
|
528739
528529
|
return sfBin;
|
|
528740
528530
|
return "bun";
|
|
@@ -528747,8 +528537,8 @@ async function installPackage(pkg, onProgress) {
|
|
|
528747
528537
|
}
|
|
528748
528538
|
case "pypi": {
|
|
528749
528539
|
log(`Installing ${purl.name} via pip3...`);
|
|
528750
|
-
const binDir =
|
|
528751
|
-
const pipDir =
|
|
528540
|
+
const binDir = join57(SOULFORGE_LSP_DIR, "bin");
|
|
528541
|
+
const pipDir = join57(SOULFORGE_LSP_DIR, "pip-packages");
|
|
528752
528542
|
mkdirSync20(binDir, {
|
|
528753
528543
|
recursive: true
|
|
528754
528544
|
});
|
|
@@ -528758,7 +528548,7 @@ async function installPackage(pkg, onProgress) {
|
|
|
528758
528548
|
await runCommand("pip3", ["install", "--target", pipDir, `${purl.name}==${purl.version}`], log);
|
|
528759
528549
|
if (pkg.bin) {
|
|
528760
528550
|
for (const binName of Object.keys(pkg.bin)) {
|
|
528761
|
-
const wrapper =
|
|
528551
|
+
const wrapper = join57(binDir, binName);
|
|
528762
528552
|
writeFileSync20(wrapper, `#!/usr/bin/env bash
|
|
528763
528553
|
PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${purl.name.replace(/-/g, "_")} "$@"
|
|
528764
528554
|
`);
|
|
@@ -528769,7 +528559,7 @@ PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${purl.name.replace(/-/g, "_"
|
|
|
528769
528559
|
}
|
|
528770
528560
|
case "golang": {
|
|
528771
528561
|
log(`Installing ${purl.namespace}/${purl.name} via go install...`);
|
|
528772
|
-
const binDir =
|
|
528562
|
+
const binDir = join57(SOULFORGE_LSP_DIR, "bin");
|
|
528773
528563
|
mkdirSync20(binDir, {
|
|
528774
528564
|
recursive: true
|
|
528775
528565
|
});
|
|
@@ -528781,7 +528571,7 @@ PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${purl.name.replace(/-/g, "_"
|
|
|
528781
528571
|
}
|
|
528782
528572
|
case "cargo": {
|
|
528783
528573
|
log(`Installing ${purl.name} via cargo...`);
|
|
528784
|
-
mkdirSync20(
|
|
528574
|
+
mkdirSync20(join57(SOULFORGE_LSP_DIR, "bin"), {
|
|
528785
528575
|
recursive: true
|
|
528786
528576
|
});
|
|
528787
528577
|
await runCommand("cargo", ["install", purl.name, "--version", purl.version, "--root", SOULFORGE_LSP_DIR], log);
|
|
@@ -528789,7 +528579,7 @@ PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${purl.name.replace(/-/g, "_"
|
|
|
528789
528579
|
}
|
|
528790
528580
|
case "github": {
|
|
528791
528581
|
log(`Downloading ${purl.namespace}/${purl.name} from GitHub...`);
|
|
528792
|
-
const binDir =
|
|
528582
|
+
const binDir = join57(SOULFORGE_LSP_DIR, "bin");
|
|
528793
528583
|
mkdirSync20(binDir, {
|
|
528794
528584
|
recursive: true
|
|
528795
528585
|
});
|
|
@@ -528802,28 +528592,28 @@ PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${purl.name.replace(/-/g, "_"
|
|
|
528802
528592
|
}
|
|
528803
528593
|
const version2 = purl.version;
|
|
528804
528594
|
const fileUrl = `https://github.com/${purl.namespace}/${purl.name}/releases/download/${version2}/${resolveAssetTemplate(asset.file, version2)}`;
|
|
528805
|
-
const tmpDir =
|
|
528595
|
+
const tmpDir = join57(SOULFORGE_LSP_DIR, ".tmp");
|
|
528806
528596
|
mkdirSync20(tmpDir, {
|
|
528807
528597
|
recursive: true
|
|
528808
528598
|
});
|
|
528809
528599
|
log(`Downloading ${fileUrl}...`);
|
|
528810
|
-
await runCommand("curl", ["-fSL", "-o",
|
|
528600
|
+
await runCommand("curl", ["-fSL", "-o", join57(tmpDir, "download"), fileUrl], log);
|
|
528811
528601
|
const fname = asset.file.toLowerCase();
|
|
528812
528602
|
if (fname.endsWith(".tar.gz") || fname.endsWith(".tgz")) {
|
|
528813
|
-
await runCommand("tar", ["-xzf",
|
|
528603
|
+
await runCommand("tar", ["-xzf", join57(tmpDir, "download"), "-C", tmpDir], log);
|
|
528814
528604
|
} else if (fname.endsWith(".zip")) {
|
|
528815
|
-
await runCommand("unzip", ["-o",
|
|
528605
|
+
await runCommand("unzip", ["-o", join57(tmpDir, "download"), "-d", tmpDir], log);
|
|
528816
528606
|
}
|
|
528817
528607
|
if (pkg.bin) {
|
|
528818
528608
|
for (const [binName, binPath] of Object.entries(pkg.bin)) {
|
|
528819
528609
|
const resolvedBin = binPath.includes("{{") ? asset.bin ?? binName : binPath;
|
|
528820
|
-
const candidates = [
|
|
528610
|
+
const candidates = [join57(tmpDir, resolvedBin), join57(tmpDir, binName), join57(tmpDir, purl.name, resolvedBin), join57(tmpDir, purl.name, binName)];
|
|
528821
528611
|
for (const candidate of candidates) {
|
|
528822
528612
|
if (existsSync49(candidate)) {
|
|
528823
528613
|
const {
|
|
528824
528614
|
copyFileSync
|
|
528825
528615
|
} = await import("fs");
|
|
528826
|
-
const dest =
|
|
528616
|
+
const dest = join57(binDir, binName);
|
|
528827
528617
|
copyFileSync(candidate, dest);
|
|
528828
528618
|
chmodSync5(dest, 493);
|
|
528829
528619
|
break;
|
|
@@ -528886,7 +528676,7 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
528886
528676
|
unlinkSync: unlinkSync13
|
|
528887
528677
|
} = await import("fs");
|
|
528888
528678
|
for (const bin of binaries) {
|
|
528889
|
-
const binPath =
|
|
528679
|
+
const binPath = join57(SOULFORGE_LSP_DIR, "node_modules", ".bin", bin);
|
|
528890
528680
|
try {
|
|
528891
528681
|
unlinkSync13(binPath);
|
|
528892
528682
|
} catch {}
|
|
@@ -528900,8 +528690,8 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
528900
528690
|
rmSync: rmSync6,
|
|
528901
528691
|
unlinkSync: unlinkSync13
|
|
528902
528692
|
} = await import("fs");
|
|
528903
|
-
const pipDir =
|
|
528904
|
-
const pkgDir =
|
|
528693
|
+
const pipDir = join57(SOULFORGE_LSP_DIR, "pip-packages");
|
|
528694
|
+
const pkgDir = join57(pipDir, purl.name.replace(/-/g, "_"));
|
|
528905
528695
|
try {
|
|
528906
528696
|
rmSync6(pkgDir, {
|
|
528907
528697
|
recursive: true,
|
|
@@ -528910,7 +528700,7 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
528910
528700
|
} catch {}
|
|
528911
528701
|
for (const bin of binaries) {
|
|
528912
528702
|
try {
|
|
528913
|
-
unlinkSync13(
|
|
528703
|
+
unlinkSync13(join57(SOULFORGE_LSP_DIR, "bin", bin));
|
|
528914
528704
|
} catch {}
|
|
528915
528705
|
}
|
|
528916
528706
|
break;
|
|
@@ -528923,7 +528713,7 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
528923
528713
|
} = await import("fs");
|
|
528924
528714
|
for (const bin of binaries) {
|
|
528925
528715
|
try {
|
|
528926
|
-
unlinkSync13(
|
|
528716
|
+
unlinkSync13(join57(SOULFORGE_LSP_DIR, "bin", bin));
|
|
528927
528717
|
} catch {}
|
|
528928
528718
|
}
|
|
528929
528719
|
break;
|
|
@@ -528935,7 +528725,7 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
528935
528725
|
} = await import("fs");
|
|
528936
528726
|
for (const bin of binaries) {
|
|
528937
528727
|
try {
|
|
528938
|
-
unlinkSync13(
|
|
528728
|
+
unlinkSync13(join57(SOULFORGE_LSP_DIR, "bin", bin));
|
|
528939
528729
|
} catch {}
|
|
528940
528730
|
}
|
|
528941
528731
|
break;
|
|
@@ -529002,7 +528792,7 @@ function resolveAssetTemplate(template, version2) {
|
|
|
529002
528792
|
return template.replace(/\{\{\s*version\s*\}\}/g, version2).replace(/\{\{\s*version\s*\|\s*strip_prefix\s*"v"\s*\}\}/g, version2.replace(/^v/, ""));
|
|
529003
528793
|
}
|
|
529004
528794
|
function runCommand(cmd, args2, log, extraEnv) {
|
|
529005
|
-
return new Promise((
|
|
528795
|
+
return new Promise((resolve43, reject) => {
|
|
529006
528796
|
const proc = spawn23(cmd, args2, {
|
|
529007
528797
|
stdio: ["ignore", "pipe", "pipe"],
|
|
529008
528798
|
env: {
|
|
@@ -529021,7 +528811,7 @@ function runCommand(cmd, args2, log, extraEnv) {
|
|
|
529021
528811
|
});
|
|
529022
528812
|
proc.on("close", (code) => {
|
|
529023
528813
|
if (code === 0) {
|
|
529024
|
-
|
|
528814
|
+
resolve43();
|
|
529025
528815
|
} else {
|
|
529026
528816
|
reject(new Error(`${cmd} exited with code ${String(code)}: ${stderr.slice(0, 500).trim()}`));
|
|
529027
528817
|
}
|
|
@@ -529033,11 +528823,11 @@ function runCommand(cmd, args2, log, extraEnv) {
|
|
|
529033
528823
|
}
|
|
529034
528824
|
var SOULFORGE_LSP_DIR, VERSIONS_FILE, MASON_REGISTRY_LOCAL, MASON_REGISTRY_RELEASE_URL = "https://api.github.com/repos/mason-org/mason-registry/releases/latest", REGISTRY_CACHE, MASON_BIN_DIR2, registryCache = null, pathCache, versionCache = null, PROJECT_INDICATORS;
|
|
529035
528825
|
var init_installer = __esm(() => {
|
|
529036
|
-
SOULFORGE_LSP_DIR =
|
|
529037
|
-
VERSIONS_FILE =
|
|
529038
|
-
MASON_REGISTRY_LOCAL =
|
|
529039
|
-
REGISTRY_CACHE =
|
|
529040
|
-
MASON_BIN_DIR2 =
|
|
528826
|
+
SOULFORGE_LSP_DIR = join57(homedir35(), ".soulforge", "lsp-servers");
|
|
528827
|
+
VERSIONS_FILE = join57(homedir35(), ".soulforge", "lsp-versions.json");
|
|
528828
|
+
MASON_REGISTRY_LOCAL = join57(homedir35(), ".local", "share", "nvim", "mason", "registries", "github", "mason-org", "mason-registry", "registry.json");
|
|
528829
|
+
REGISTRY_CACHE = join57(homedir35(), ".soulforge", "mason-registry.json");
|
|
528830
|
+
MASON_BIN_DIR2 = join57(homedir35(), ".local", "share", "soulforge", "mason", "bin");
|
|
529041
528831
|
pathCache = new Map;
|
|
529042
528832
|
PROJECT_INDICATORS = {
|
|
529043
528833
|
TypeScript: ["tsconfig.json", "*.ts", "*.tsx"],
|
|
@@ -529066,7 +528856,7 @@ var init_installer = __esm(() => {
|
|
|
529066
528856
|
|
|
529067
528857
|
// src/components/settings/LspInstallSearch.tsx
|
|
529068
528858
|
import { existsSync as existsSync50 } from "fs";
|
|
529069
|
-
import { join as
|
|
528859
|
+
import { join as join58 } from "path";
|
|
529070
528860
|
function methodLabel(status) {
|
|
529071
528861
|
if (status.requiresToolchain && !status.toolchainAvailable) {
|
|
529072
528862
|
return `[requires ${status.requiresToolchain}]`;
|
|
@@ -529328,7 +529118,7 @@ function LspInstallSearch({
|
|
|
529328
529118
|
const defaultScopeCursor = detectScope("disabledLspServers") === "project" ? 0 : 1;
|
|
529329
529119
|
const [scopeCursor, setScopeCursor] = import_react129.useState(defaultScopeCursor);
|
|
529330
529120
|
const downloadAttemptedRef = import_react129.useRef(false);
|
|
529331
|
-
const isInProject = existsSync50(
|
|
529121
|
+
const isInProject = existsSync50(join58(cwd2, ".git"));
|
|
529332
529122
|
const {
|
|
529333
529123
|
width: termCols,
|
|
529334
529124
|
height: termRows
|
|
@@ -534209,7 +533999,7 @@ var init_RouterSettings = __esm(async () => {
|
|
|
534209
533999
|
|
|
534210
534000
|
// src/components/settings/SkillSearch.tsx
|
|
534211
534001
|
import { existsSync as existsSync51 } from "fs";
|
|
534212
|
-
import { join as
|
|
534002
|
+
import { join as join59 } from "path";
|
|
534213
534003
|
function SearchSkillRow(t0) {
|
|
534214
534004
|
const $5 = import_compiler_runtime74.c(32);
|
|
534215
534005
|
const {
|
|
@@ -534576,7 +534366,7 @@ function SkillSearch(t0) {
|
|
|
534576
534366
|
const debounceRef = import_react139.useRef(null);
|
|
534577
534367
|
let t5;
|
|
534578
534368
|
if ($5[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
534579
|
-
t5 = existsSync51(
|
|
534369
|
+
t5 = existsSync51(join59(process.cwd(), ".git"));
|
|
534580
534370
|
$5[4] = t5;
|
|
534581
534371
|
} else {
|
|
534582
534372
|
t5 = $5[4];
|
|
@@ -535656,7 +535446,7 @@ __export(exports_App, {
|
|
|
535656
535446
|
App: () => App
|
|
535657
535447
|
});
|
|
535658
535448
|
import { spawn as spawn24 } from "child_process";
|
|
535659
|
-
import { join as
|
|
535449
|
+
import { join as join60 } from "path";
|
|
535660
535450
|
function truncate5(str, max) {
|
|
535661
535451
|
return str.length > max ? `${str.slice(0, max - 1)}\u2026` : str;
|
|
535662
535452
|
}
|
|
@@ -536785,11 +536575,11 @@ function App({
|
|
|
536785
536575
|
(async () => {
|
|
536786
536576
|
try {
|
|
536787
536577
|
const {
|
|
536788
|
-
mkdir:
|
|
536789
|
-
writeFile:
|
|
536578
|
+
mkdir: mkdir9,
|
|
536579
|
+
writeFile: writeFile16
|
|
536790
536580
|
} = await import("fs/promises");
|
|
536791
|
-
const dir =
|
|
536792
|
-
await
|
|
536581
|
+
const dir = join60(cwd2, ".soulforge");
|
|
536582
|
+
await mkdir9(dir, {
|
|
536793
536583
|
recursive: true
|
|
536794
536584
|
});
|
|
536795
536585
|
const activeChat_2 = tabMgr.getActiveChat();
|
|
@@ -536798,7 +536588,7 @@ function App({
|
|
|
536798
536588
|
label: t_3.label,
|
|
536799
536589
|
activeModel: t_3.id === tabMgr.activeTabId ? activeChat_2?.activeModel : undefined
|
|
536800
536590
|
}));
|
|
536801
|
-
await
|
|
536591
|
+
await writeFile16(join60(dir, "tabs.json"), JSON.stringify(layout, null, 2));
|
|
536802
536592
|
} catch {}
|
|
536803
536593
|
})();
|
|
536804
536594
|
}, [tabMgr.tabCount, tabMgr.activeTabId]);
|
|
@@ -537715,7 +537505,7 @@ init_splash();
|
|
|
537715
537505
|
init_errors();
|
|
537716
537506
|
import { existsSync as existsSync53, readFileSync as readFileSync30 } from "fs";
|
|
537717
537507
|
import { homedir as homedir36 } from "os";
|
|
537718
|
-
import { join as
|
|
537508
|
+
import { join as join61 } from "path";
|
|
537719
537509
|
globalThis.AI_SDK_LOG_WARNINGS = false;
|
|
537720
537510
|
installGlobalFetch();
|
|
537721
537511
|
reapOrphanedLspProcesses();
|
|
@@ -537747,13 +537537,13 @@ if (hasCli) {
|
|
|
537747
537537
|
}
|
|
537748
537538
|
var isCompiledBinary = import.meta.url.includes("$bunfs");
|
|
537749
537539
|
if (isCompiledBinary) {
|
|
537750
|
-
const bundledWorker =
|
|
537540
|
+
const bundledWorker = join61(homedir36(), ".soulforge", "opentui-assets", "parser.worker.js");
|
|
537751
537541
|
if (!process.env.OTUI_TREE_SITTER_WORKER_PATH && existsSync53(bundledWorker)) {
|
|
537752
537542
|
process.env.OTUI_TREE_SITTER_WORKER_PATH = bundledWorker;
|
|
537753
537543
|
}
|
|
537754
537544
|
}
|
|
537755
537545
|
try {
|
|
537756
|
-
const raw2 = readFileSync30(
|
|
537546
|
+
const raw2 = readFileSync30(join61(homedir36(), ".soulforge", "config.json"), "utf-8");
|
|
537757
537547
|
const cfg = JSON.parse(raw2);
|
|
537758
537548
|
if (cfg.theme?.name)
|
|
537759
537549
|
applyTheme(cfg.theme.name, cfg.theme?.transparent, {
|