@proxysoul/soulforge 1.3.1 → 1.3.2

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 CHANGED
@@ -67324,7 +67324,7 @@ __export(exports_tree_sitter2, {
67324
67324
  import { existsSync as existsSync11 } from "fs";
67325
67325
  import { readFile as readFile6 } from "fs/promises";
67326
67326
  import { homedir as homedir9 } from "os";
67327
- import { join as join10, resolve as resolve6 } from "path";
67327
+ import { dirname as dirname4, join as join10, resolve as resolve6 } from "path";
67328
67328
  function extractImportSpecifiers(node, language) {
67329
67329
  const specifiers = [];
67330
67330
  collectSpecifiers(node, language, specifiers);
@@ -68459,11 +68459,17 @@ var init_tree_sitter2 = __esm(() => {
68459
68459
  if (TreeSitterBackend.IS_BUNDLED) {
68460
68460
  return join10(BUNDLED_WASM_DIR, basename2);
68461
68461
  }
68462
- const cwd = process.cwd();
68463
- const devPaths = [join10(cwd, "node_modules", "web-tree-sitter", basename2), join10(cwd, "node_modules", "tree-sitter-wasms", "out", basename2)];
68464
- for (const p of devPaths) {
68465
- if (existsSync11(p))
68466
- return p;
68462
+ let dir = import.meta.dir;
68463
+ for (let i2 = 0;i2 < 5; i2++) {
68464
+ for (const sub of ["node_modules/web-tree-sitter", "node_modules/tree-sitter-wasms/out"]) {
68465
+ const p = join10(dir, sub, basename2);
68466
+ if (existsSync11(p))
68467
+ return p;
68468
+ }
68469
+ const parent = dirname4(dir);
68470
+ if (parent === dir)
68471
+ break;
68472
+ dir = parent;
68467
68473
  }
68468
68474
  return join10(BUNDLED_WASM_DIR, basename2);
68469
68475
  }
@@ -239279,7 +239285,7 @@ var require_path_browserify = __commonJS((exports, module2) => {
239279
239285
  _makeLong: function _makeLong(path) {
239280
239286
  return path;
239281
239287
  },
239282
- dirname: function dirname4(path) {
239288
+ dirname: function dirname5(path) {
239283
239289
  assertPath(path);
239284
239290
  if (path.length === 0)
239285
239291
  return ".";
@@ -311940,7 +311946,7 @@ import { Database as Database2 } from "bun:sqlite";
311940
311946
  import { execSync as execSync4 } from "child_process";
311941
311947
  import { chmodSync as chmodSync3, existsSync as existsSync14, mkdirSync as mkdirSync7, readFileSync as readFileSync8, statSync } from "fs";
311942
311948
  import { stat as statAsync } from "fs/promises";
311943
- import { dirname as dirname4, extname as extname3, join as join15, relative as relative2, resolve as resolve9 } from "path";
311949
+ import { dirname as dirname5, extname as extname3, join as join15, relative as relative2, resolve as resolve9 } from "path";
311944
311950
 
311945
311951
  class RepoMap {
311946
311952
  db;
@@ -312654,7 +312660,7 @@ class RepoMap {
312654
312660
  return this.tsconfigPaths;
312655
312661
  }
312656
312662
  resolveImportSource(importSource, importerAbsPath) {
312657
- const importerDir = dirname4(importerAbsPath);
312663
+ const importerDir = dirname5(importerAbsPath);
312658
312664
  let normalized = null;
312659
312665
  if (importSource.startsWith("./") || importSource.startsWith("../")) {
312660
312666
  normalized = importSource.replace(/\.(m?js|cjs|jsx)$/, "");
@@ -317126,7 +317132,7 @@ var init_post_edit = __esm(() => {
317126
317132
 
317127
317133
  // src/core/tools/edit-file.ts
317128
317134
  import { mkdir as mkdir2, readFile as readFile10, stat as statAsync3, writeFile as writeFile3 } from "fs/promises";
317129
- import { dirname as dirname5, resolve as resolve13 } from "path";
317135
+ import { dirname as dirname6, resolve as resolve13 } from "path";
317130
317136
  function formatMetricDelta(label, before, after) {
317131
317137
  const delta = after - before;
317132
317138
  if (delta === 0)
@@ -317322,7 +317328,7 @@ var init_edit_file = __esm(() => {
317322
317328
  const oldStr = args2.oldString;
317323
317329
  const newStr = args2.newString;
317324
317330
  if (oldStr === "") {
317325
- const dir = dirname5(filePath);
317331
+ const dir = dirname6(filePath);
317326
317332
  let dirCreated = false;
317327
317333
  try {
317328
317334
  await statAsync3(dir);
@@ -333484,7 +333490,7 @@ var init_post_edit_fix = __esm(() => {
333484
333490
 
333485
333491
  // src/core/tools/move-symbol.ts
333486
333492
  import { access as access2, mkdir as mkdir3, readFile as readFile12, unlink as unlink2, writeFile as writeFile5 } from "fs/promises";
333487
- import { dirname as dirname6, relative as relative5, resolve as resolve18 } from "path";
333493
+ import { dirname as dirname7, relative as relative5, resolve as resolve18 } from "path";
333488
333494
 
333489
333495
  class WriteTransaction {
333490
333496
  writes = [];
@@ -333511,7 +333517,7 @@ class WriteTransaction {
333511
333517
  throw new Error(`Cannot write forbidden file: ${w.path} (${blocked})`);
333512
333518
  }
333513
333519
  for (const w of this.writes) {
333514
- const dir = dirname6(w.path);
333520
+ const dir = dirname7(w.path);
333515
333521
  await mkdir3(dir, {
333516
333522
  recursive: true
333517
333523
  });
@@ -333616,7 +333622,7 @@ function findCommentStart(lines, defStart) {
333616
333622
  return start2;
333617
333623
  }
333618
333624
  async function findProjectRoot(file2) {
333619
- let dir = dirname6(resolve18(file2));
333625
+ let dir = dirname7(resolve18(file2));
333620
333626
  for (let depth = 0;depth < 20; depth++) {
333621
333627
  for (const m of ["tsconfig.json", "package.json", "Cargo.toml", "go.mod", "pyproject.toml", "Makefile"]) {
333622
333628
  try {
@@ -333624,12 +333630,12 @@ async function findProjectRoot(file2) {
333624
333630
  return dir;
333625
333631
  } catch {}
333626
333632
  }
333627
- const parent = dirname6(dir);
333633
+ const parent = dirname7(dir);
333628
333634
  if (parent === dir)
333629
333635
  break;
333630
333636
  dir = parent;
333631
333637
  }
333632
- return dirname6(file2);
333638
+ return dirname7(file2);
333633
333639
  }
333634
333640
  async function grepSymbol(symbol26, root) {
333635
333641
  try {
@@ -333770,7 +333776,7 @@ ${lines[j] ?? ""}`;
333770
333776
  async resolveSource(source, contextFile) {
333771
333777
  if (!source.startsWith("."))
333772
333778
  return null;
333773
- const dir = dirname6(contextFile);
333779
+ const dir = dirname7(contextFile);
333774
333780
  const base = source.replace(/\.(js|ts|jsx|tsx|mjs|cjs)$/, "");
333775
333781
  for (const ext of [".ts", ".tsx", ".js", ".jsx"]) {
333776
333782
  const p = resolve18(dir, base + ext);
@@ -333782,7 +333788,7 @@ ${lines[j] ?? ""}`;
333782
333788
  return null;
333783
333789
  },
333784
333790
  computePath(fromFile, toFile) {
333785
- let rel = relative5(dirname6(fromFile), toFile).replace(/\.tsx?$/, ".js");
333791
+ let rel = relative5(dirname7(fromFile), toFile).replace(/\.tsx?$/, ".js");
333786
333792
  if (!rel.startsWith("."))
333787
333793
  rel = `./${rel}`;
333788
333794
  return rel;
@@ -333827,9 +333833,9 @@ ${lines[j] ?? ""}`;
333827
333833
  const dots = source.match(/^(\.+)/);
333828
333834
  const dotStr = dots?.[1] ?? ".";
333829
333835
  const levels = dotStr.length - 1;
333830
- let dir = dirname6(contextFile);
333836
+ let dir = dirname7(contextFile);
333831
333837
  for (let i2 = 0;i2 < levels; i2++)
333832
- dir = dirname6(dir);
333838
+ dir = dirname7(dir);
333833
333839
  const parts3 = source.slice(dotStr.length).split(".");
333834
333840
  const modPath2 = resolve18(dir, ...parts3);
333835
333841
  if (await fileExists(`${modPath2}.py`))
@@ -333839,7 +333845,7 @@ ${lines[j] ?? ""}`;
333839
333845
  return null;
333840
333846
  }
333841
333847
  const parts2 = source.split(".");
333842
- const modPath = resolve18(dirname6(contextFile), ...parts2);
333848
+ const modPath = resolve18(dirname7(contextFile), ...parts2);
333843
333849
  if (await fileExists(`${modPath}.py`))
333844
333850
  return `${modPath}.py`;
333845
333851
  if (await fileExists(resolve18(modPath, "__init__.py")))
@@ -333847,7 +333853,7 @@ ${lines[j] ?? ""}`;
333847
333853
  return null;
333848
333854
  },
333849
333855
  computePath(fromFile, toFile) {
333850
- const rel = relative5(dirname6(fromFile), toFile).replace(/\.py$/, "");
333856
+ const rel = relative5(dirname7(fromFile), toFile).replace(/\.py$/, "");
333851
333857
  const parts2 = rel.split("/");
333852
333858
  const upCount = parts2.filter((p) => p === "..").length;
333853
333859
  const downParts = parts2.filter((p) => p !== "..");
@@ -333987,7 +333993,7 @@ ${lines[j] ?? ""}`;
333987
333993
  return result;
333988
333994
  },
333989
333995
  async resolveSource(source, contextFile) {
333990
- const p = resolve18(dirname6(contextFile), source);
333996
+ const p = resolve18(dirname7(contextFile), source);
333991
333997
  try {
333992
333998
  await access2(p);
333993
333999
  return p;
@@ -333996,7 +334002,7 @@ ${lines[j] ?? ""}`;
333996
334002
  }
333997
334003
  },
333998
334004
  computePath(fromFile, toFile) {
333999
- return relative5(dirname6(fromFile), toFile);
334005
+ return relative5(dirname7(fromFile), toFile);
334000
334006
  },
334001
334007
  generate(_s, path) {
334002
334008
  return `#include "${path}"`;
@@ -335981,7 +335987,7 @@ ${diagOutput}`;
335981
335987
 
335982
335988
  // src/core/tools/rename-file.ts
335983
335989
  import { mkdir as mkdir4, readFile as readFile15, rename as rename2, stat as statAsync7, writeFile as writeFile8 } from "fs/promises";
335984
- import { dirname as dirname7, relative as relative6, resolve as resolve24 } from "path";
335990
+ import { dirname as dirname8, relative as relative6, resolve as resolve24 } from "path";
335985
335991
  var renameFileTool;
335986
335992
  var init_rename_file = __esm(() => {
335987
335993
  init_intelligence();
@@ -336076,7 +336082,7 @@ var init_rename_file = __esm(() => {
336076
336082
  appliedFiles.push(edit.file);
336077
336083
  } catch {}
336078
336084
  }
336079
- const toDir = dirname7(to);
336085
+ const toDir = dirname8(to);
336080
336086
  await mkdir4(toDir, {
336081
336087
  recursive: true
336082
336088
  });
@@ -336397,10 +336403,10 @@ async function locateSymbol(router2, symbol26, hint) {
336397
336403
  }
336398
336404
  async function findProjectRoot2(file2) {
336399
336405
  const {
336400
- dirname: dirname8,
336406
+ dirname: dirname9,
336401
336407
  join: join20
336402
336408
  } = __require("path");
336403
- let dir = dirname8(file2);
336409
+ let dir = dirname9(file2);
336404
336410
  const cwd2 = process.cwd();
336405
336411
  while (dir.length >= cwd2.length) {
336406
336412
  for (const marker21 of ["tsconfig.json", "package.json", "Cargo.toml", "go.mod", "pyproject.toml"]) {
@@ -336409,12 +336415,12 @@ async function findProjectRoot2(file2) {
336409
336415
  return dir;
336410
336416
  } catch {}
336411
336417
  }
336412
- const parent = dirname8(dir);
336418
+ const parent = dirname9(dir);
336413
336419
  if (parent === dir)
336414
336420
  break;
336415
336421
  dir = parent;
336416
336422
  }
336417
- return dirname8(file2);
336423
+ return dirname9(file2);
336418
336424
  }
336419
336425
  async function findRemainingReferences(symbol26, definitionFile) {
336420
336426
  try {
@@ -337149,7 +337155,7 @@ ${hint}` : stdout || stderr;
337149
337155
  // src/core/skills/manager.ts
337150
337156
  import { existsSync as existsSync16, readdirSync as readdirSync5, readFileSync as readFileSync9, realpathSync as realpathSync2, rmSync as rmSync2, statSync as statSync4 } from "fs";
337151
337157
  import { homedir as homedir13 } from "os";
337152
- import { dirname as dirname8, join as join20 } from "path";
337158
+ import { dirname as dirname9, join as join20 } from "path";
337153
337159
  async function searchSkills(query2) {
337154
337160
  const url2 = `https://skills.sh/api/search?q=${encodeURIComponent(query2)}`;
337155
337161
  const res = await fetch(url2);
@@ -337292,7 +337298,7 @@ function loadSkill(path) {
337292
337298
  }
337293
337299
  function removeInstalledSkill(skill) {
337294
337300
  try {
337295
- const dir = dirname8(skill.path);
337301
+ const dir = dirname9(skill.path);
337296
337302
  if (existsSync16(dir)) {
337297
337303
  rmSync2(dir, {
337298
337304
  recursive: true
@@ -339324,7 +339330,7 @@ ${added.join(`
339324
339330
 
339325
339331
  // src/core/tools/test-scaffold.ts
339326
339332
  import { access as access4, mkdir as mkdir5, stat as stat5, writeFile as writeFile10 } from "fs/promises";
339327
- import { basename as basename4, dirname as dirname9, extname as extname8, join as join22, relative as relative11, resolve as resolve27 } from "path";
339333
+ import { basename as basename4, dirname as dirname10, extname as extname8, join as join22, relative as relative11, resolve as resolve27 } from "path";
339328
339334
  async function fileExists(path) {
339329
339335
  try {
339330
339336
  await access4(path);
@@ -339351,7 +339357,7 @@ async function detectTestFramework(cwd2) {
339351
339357
  return "vitest";
339352
339358
  }
339353
339359
  async function inferTestPath(sourcePath) {
339354
- const dir = dirname9(sourcePath);
339360
+ const dir = dirname10(sourcePath);
339355
339361
  const base = basename4(sourcePath, extname8(sourcePath));
339356
339362
  const ext = extname8(sourcePath);
339357
339363
  const testsDir = join22(dir, "__tests__");
@@ -339414,7 +339420,7 @@ var init_test_scaffold = __esm(() => {
339414
339420
  };
339415
339421
  }));
339416
339422
  const outputPath = args2.output ?? await inferTestPath(file2);
339417
- const relativePath = relative11(dirname9(outputPath), file2).replace(/\\/g, "/");
339423
+ const relativePath = relative11(dirname10(outputPath), file2).replace(/\\/g, "/");
339418
339424
  const importPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
339419
339425
  const importPathNoExt = importPath.replace(/\.(ts|tsx|js|jsx|mts|cts|mjs|cjs)$/, "");
339420
339426
  const lines = [];
@@ -339489,7 +339495,7 @@ var init_test_scaffold = __esm(() => {
339489
339495
  error: "path outside project"
339490
339496
  };
339491
339497
  }
339492
- await mkdir5(dirname9(resolvedOutput), {
339498
+ await mkdir5(dirname10(resolvedOutput), {
339493
339499
  recursive: true
339494
339500
  });
339495
339501
  await writeFile10(resolvedOutput, content, "utf-8");
@@ -382217,7 +382223,7 @@ import { EventEmitter } from "events";
382217
382223
  import { Buffer as Buffer2 } from "buffer";
382218
382224
  import { Buffer as Buffer3 } from "buffer";
382219
382225
  import { EventEmitter as EventEmitter2 } from "events";
382220
- import { resolve as resolve31, dirname as dirname10 } from "path";
382226
+ import { resolve as resolve31, dirname as dirname11 } from "path";
382221
382227
  import { fileURLToPath } from "url";
382222
382228
  import { resolve as resolve210, isAbsolute, parse as parse7 } from "path";
382223
382229
  import { existsSync as existsSync23 } from "fs";
@@ -385418,25 +385424,25 @@ function getParsers() {
385418
385424
  filetype: "javascript",
385419
385425
  aliases: ["javascriptreact"],
385420
385426
  queries: {
385421
- highlights: [resolve31(dirname10(fileURLToPath(import.meta.url)), highlights_default)]
385427
+ highlights: [resolve31(dirname11(fileURLToPath(import.meta.url)), highlights_default)]
385422
385428
  },
385423
- wasm: resolve31(dirname10(fileURLToPath(import.meta.url)), tree_sitter_javascript_default)
385429
+ wasm: resolve31(dirname11(fileURLToPath(import.meta.url)), tree_sitter_javascript_default)
385424
385430
  },
385425
385431
  {
385426
385432
  filetype: "typescript",
385427
385433
  aliases: ["typescriptreact"],
385428
385434
  queries: {
385429
- highlights: [resolve31(dirname10(fileURLToPath(import.meta.url)), highlights_default2)]
385435
+ highlights: [resolve31(dirname11(fileURLToPath(import.meta.url)), highlights_default2)]
385430
385436
  },
385431
- wasm: resolve31(dirname10(fileURLToPath(import.meta.url)), tree_sitter_typescript_default)
385437
+ wasm: resolve31(dirname11(fileURLToPath(import.meta.url)), tree_sitter_typescript_default)
385432
385438
  },
385433
385439
  {
385434
385440
  filetype: "markdown",
385435
385441
  queries: {
385436
- highlights: [resolve31(dirname10(fileURLToPath(import.meta.url)), highlights_default3)],
385437
- injections: [resolve31(dirname10(fileURLToPath(import.meta.url)), injections_default)]
385442
+ highlights: [resolve31(dirname11(fileURLToPath(import.meta.url)), highlights_default3)],
385443
+ injections: [resolve31(dirname11(fileURLToPath(import.meta.url)), injections_default)]
385438
385444
  },
385439
- wasm: resolve31(dirname10(fileURLToPath(import.meta.url)), tree_sitter_markdown_default),
385445
+ wasm: resolve31(dirname11(fileURLToPath(import.meta.url)), tree_sitter_markdown_default),
385440
385446
  injectionMapping: {
385441
385447
  nodeTypes: {
385442
385448
  inline: "markdown_inline",
@@ -385459,16 +385465,16 @@ function getParsers() {
385459
385465
  {
385460
385466
  filetype: "markdown_inline",
385461
385467
  queries: {
385462
- highlights: [resolve31(dirname10(fileURLToPath(import.meta.url)), highlights_default4)]
385468
+ highlights: [resolve31(dirname11(fileURLToPath(import.meta.url)), highlights_default4)]
385463
385469
  },
385464
- wasm: resolve31(dirname10(fileURLToPath(import.meta.url)), tree_sitter_markdown_inline_default)
385470
+ wasm: resolve31(dirname11(fileURLToPath(import.meta.url)), tree_sitter_markdown_inline_default)
385465
385471
  },
385466
385472
  {
385467
385473
  filetype: "zig",
385468
385474
  queries: {
385469
- highlights: [resolve31(dirname10(fileURLToPath(import.meta.url)), highlights_default5)]
385475
+ highlights: [resolve31(dirname11(fileURLToPath(import.meta.url)), highlights_default5)]
385470
385476
  },
385471
- wasm: resolve31(dirname10(fileURLToPath(import.meta.url)), tree_sitter_zig_default)
385477
+ wasm: resolve31(dirname11(fileURLToPath(import.meta.url)), tree_sitter_zig_default)
385472
385478
  }
385473
385479
  ];
385474
385480
  }
@@ -430417,7 +430423,7 @@ __export(exports_export, {
430417
430423
  exportChat: () => exportChat
430418
430424
  });
430419
430425
  import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync8 } from "fs";
430420
- import { dirname as dirname13, join as join37 } from "path";
430426
+ import { dirname as dirname14, join as join37 } from "path";
430421
430427
  function formatTimestamp(ts) {
430422
430428
  const d3 = new Date(ts);
430423
430429
  return d3.toLocaleString("en-US", {
@@ -430599,7 +430605,7 @@ function exportChat(messages, opts) {
430599
430605
  const slug = slugify2(title);
430600
430606
  outPath = join37(exportDir, `${slug}-${stamp}${ext}`);
430601
430607
  }
430602
- const parentDir = dirname13(outPath);
430608
+ const parentDir = dirname14(outPath);
430603
430609
  mkdirSync10(parentDir, {
430604
430610
  recursive: true
430605
430611
  });
@@ -430685,9 +430691,9 @@ async function handleExportAll(ctx) {
430685
430691
  const relPath = outPath.startsWith(ctx.cwd) ? outPath.slice(ctx.cwd.length + 1) : outPath;
430686
430692
  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)`);
430687
430693
  const {
430688
- dirname: dirname14
430694
+ dirname: dirname15
430689
430695
  } = await import("path");
430690
- Bun.spawn([process.platform === "darwin" ? "open" : "xdg-open", dirname14(outPath)]);
430696
+ Bun.spawn([process.platform === "darwin" ? "open" : "xdg-open", dirname15(outPath)]);
430691
430697
  }
430692
430698
  async function handleExport(input, ctx) {
430693
430699
  const trimmed = input.trim();
@@ -430734,9 +430740,9 @@ async function handleExport(input, ctx) {
430734
430740
  const relPath = result.path.startsWith(ctx.cwd) ? result.path.slice(ctx.cwd.length + 1) : result.path;
430735
430741
  sysMsg(ctx, `Exported ${String(result.messageCount)} messages \u2192 \`${relPath}\``);
430736
430742
  const {
430737
- dirname: dirname14
430743
+ dirname: dirname15
430738
430744
  } = await import("path");
430739
- const dir = dirname14(result.path);
430745
+ const dir = dirname15(result.path);
430740
430746
  const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? "explorer" : "xdg-open";
430741
430747
  Bun.spawn([opener, dir]);
430742
430748
  }
@@ -439076,13 +439082,13 @@ var init_useChat = __esm(() => {
439076
439082
  // src/core/history/db.ts
439077
439083
  import { Database as Database4 } from "bun:sqlite";
439078
439084
  import { existsSync as existsSync30, mkdirSync as mkdirSync11 } from "fs";
439079
- import { dirname as dirname14 } from "path";
439085
+ import { dirname as dirname15 } from "path";
439080
439086
 
439081
439087
  class HistoryDB {
439082
439088
  db;
439083
439089
  writesSincePrune = 0;
439084
439090
  constructor(dbPath) {
439085
- const dir = dirname14(dbPath);
439091
+ const dir = dirname15(dbPath);
439086
439092
  if (!existsSync30(dir))
439087
439093
  mkdirSync11(dir, {
439088
439094
  recursive: true
@@ -439984,7 +439990,7 @@ var init_InputBox = __esm(async () => {
439984
439990
  // src/core/utils/syntax.ts
439985
439991
  import { existsSync as existsSync31, readdirSync as readdirSync8 } from "fs";
439986
439992
  import { homedir as homedir20 } from "os";
439987
- import { dirname as dirname15, join as join41, resolve as resolve33 } from "path";
439993
+ import { dirname as dirname16, join as join41, resolve as resolve33 } from "path";
439988
439994
  function discoverParsers() {
439989
439995
  const parsers = [];
439990
439996
  let dirs;
@@ -440060,7 +440066,7 @@ var init_syntax = __esm(async () => {
440060
440066
  coreAssetsDir = bundledAssets;
440061
440067
  } else {
440062
440068
  try {
440063
- coreAssetsDir = resolve33(dirname15(__require.resolve("@opentui/core")), "assets");
440069
+ coreAssetsDir = resolve33(dirname16(__require.resolve("@opentui/core")), "assets");
440064
440070
  } catch {
440065
440071
  coreAssetsDir = bundledAssets;
440066
440072
  }
package/dist/init.lua ADDED
@@ -0,0 +1,348 @@
1
+ -- SoulForge default neovim config (LazyVim distribution)
2
+ -- Only loaded when user has no ~/.config/nvim/init.{lua,vim}
3
+ -- Data isolated via NVIM_APPNAME=soulforge → ~/.local/share/soulforge/
4
+
5
+ local o = vim.o
6
+ local opt = vim.opt
7
+
8
+ -- ─── Leader key (must be set before lazy) ───
9
+ vim.g.mapleader = " "
10
+ vim.g.maplocalleader = "\\"
11
+
12
+ -- ─── Embedded mode: suppress all prompts before plugins load ───
13
+ vim.opt.shortmess:append("aAIcCFsWqtTo")
14
+ vim.o.more = false
15
+ vim.o.cmdheight = 1
16
+
17
+ -- ─── Bootstrap lazy.nvim ───
18
+ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
19
+ if not vim.uv.fs_stat(lazypath) then
20
+ local out = vim.fn.system({
21
+ "git", "clone", "--filter=blob:none",
22
+ "https://github.com/folke/lazy.nvim.git",
23
+ "--branch=stable",
24
+ lazypath,
25
+ })
26
+ if vim.v.shell_error ~= 0 then
27
+ vim.api.nvim_echo({
28
+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
29
+ { out, "WarningMsg" },
30
+ }, true, {})
31
+ return
32
+ end
33
+ end
34
+ vim.opt.rtp:prepend(lazypath)
35
+
36
+ -- ─── Mason tools (shared between mason.nvim and mason-tool-installer) ───
37
+ local mason_tools = {
38
+ -- Web (JS/TS)
39
+ "typescript-language-server",
40
+ "eslint-lsp",
41
+ "biome",
42
+ "tailwindcss-language-server",
43
+ "css-lsp",
44
+ "html-lsp",
45
+ "emmet-language-server",
46
+ "svelte-language-server",
47
+ "vue-language-server",
48
+ "graphql-language-service-cli",
49
+ "astro-language-server",
50
+ -- Python
51
+ "pyright",
52
+ "ruff",
53
+ -- Rust
54
+ "rust-analyzer",
55
+ -- Go
56
+ "gopls",
57
+ -- C/C++
58
+ "clangd",
59
+ -- Lua
60
+ "lua-language-server",
61
+ -- Shell
62
+ "bash-language-server",
63
+ -- Data / Config
64
+ "json-lsp",
65
+ "yaml-language-server",
66
+ "taplo",
67
+ -- Docker
68
+ "dockerfile-language-server",
69
+ "docker-compose-language-service",
70
+ -- Markdown
71
+ "marksman",
72
+ -- SQL
73
+ "sqlls",
74
+ -- Formatters
75
+ "prettier",
76
+ "shfmt",
77
+ "stylua",
78
+ "black",
79
+ "isort",
80
+ -- Linters
81
+ "shellcheck",
82
+ }
83
+
84
+ -- ─── Setup LazyVim ───
85
+ require("lazy").setup({
86
+ spec = {
87
+ { "LazyVim/LazyVim", import = "lazyvim.plugins" },
88
+
89
+ -- ── Disable GPL-3.0 plugin (incompatible with BUSL-1.1) ──
90
+ { "akinsho/bufferline.nvim", enabled = false },
91
+
92
+ -- ── Theme: Catppuccin Mocha ──
93
+ {
94
+ "catppuccin/nvim",
95
+ name = "catppuccin",
96
+ lazy = false,
97
+ priority = 1000,
98
+ opts = {
99
+ flavour = "mocha",
100
+ transparent_background = true,
101
+ integrations = {
102
+ bufferline = true,
103
+ gitsigns = true,
104
+ indent_blankline = { enabled = true },
105
+ mini = { enabled = true },
106
+ native_lsp = {
107
+ enabled = true,
108
+ underlines = {
109
+ errors = { "undercurl" },
110
+ hints = { "undercurl" },
111
+ warnings = { "undercurl" },
112
+ information = { "undercurl" },
113
+ },
114
+ },
115
+ neotree = true,
116
+ noice = true,
117
+ notify = true,
118
+ treesitter = true,
119
+ which_key = true,
120
+ },
121
+ },
122
+ },
123
+
124
+ -- ── Dashboard: SoulForge branding ──
125
+ {
126
+ "folke/snacks.nvim",
127
+ opts = {
128
+ dashboard = {
129
+ preset = {
130
+ header = table.concat({
131
+ "",
132
+ " ███████╗ ██████╗ ██╗ ██╗██╗ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗",
133
+ " ██╔════╝██╔═══██╗██║ ██║██║ ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝",
134
+ " ███████╗██║ ██║██║ ██║██║ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗ ",
135
+ " ╚════██║██║ ██║██║ ██║██║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ",
136
+ " ███████║╚██████╔╝╚██████╔╝███████╗██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗",
137
+ " ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝",
138
+ "",
139
+ " ⚡ Graph-Powered Code Intelligence",
140
+ "",
141
+ }, "\n"),
142
+ },
143
+ },
144
+ },
145
+ },
146
+
147
+ -- ── Mason: ensure LSP servers + formatters + linters ──
148
+ {
149
+ "mason-org/mason.nvim",
150
+ opts = { ensure_installed = mason_tools },
151
+ },
152
+
153
+ -- ── Mason Tool Installer (headless bootstrap + auto-install on start) ──
154
+ {
155
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
156
+ dependencies = { "mason-org/mason.nvim" },
157
+ lazy = false,
158
+ opts = {
159
+ ensure_installed = mason_tools,
160
+ auto_update = false,
161
+ run_on_start = true,
162
+ start_delay = 1000,
163
+ debounce_hours = 24,
164
+ },
165
+ },
166
+
167
+ -- ── Tree-sitter: ensure common parsers ──
168
+ {
169
+ "nvim-treesitter/nvim-treesitter",
170
+ opts = {
171
+ ensure_installed = {
172
+ "typescript", "tsx", "javascript", "json", "json5", "jsonc",
173
+ "html", "css", "scss", "graphql", "svelte", "vue",
174
+ "rust", "go", "c", "cpp", "zig",
175
+ "lua", "python", "ruby", "bash",
176
+ "markdown", "markdown_inline", "yaml", "toml", "dockerfile",
177
+ "sql", "prisma",
178
+ "vim", "vimdoc", "regex", "query", "diff",
179
+ "git_config", "gitcommit", "gitignore",
180
+ },
181
+ },
182
+ },
183
+
184
+ -- ── Gitsigns: custom signs ──
185
+ {
186
+ "lewis6991/gitsigns.nvim",
187
+ opts = {
188
+ signs = {
189
+ add = { text = "▎" },
190
+ change = { text = "▎" },
191
+ delete = { text = "▁" },
192
+ topdelete = { text = "▔" },
193
+ changedelete = { text = "▎" },
194
+ },
195
+ },
196
+ },
197
+ },
198
+
199
+ defaults = {
200
+ lazy = false,
201
+ version = false,
202
+ },
203
+ install = {
204
+ colorscheme = { "catppuccin", "tokyonight", "habamax" },
205
+ },
206
+ checker = { enabled = false },
207
+ change_detection = { enabled = false },
208
+ performance = {
209
+ rtp = {
210
+ disabled_plugins = {
211
+ "gzip", "tarPlugin", "tohtml", "tutor", "zipPlugin",
212
+ },
213
+ },
214
+ },
215
+ })
216
+
217
+ -- ─── Auto-close Lazy UI (embedded mode — user shouldn't need to press q) ───
218
+ -- Close the Lazy floating window after install/sync/update finishes
219
+ for _, event in ipairs({ "LazyInstall", "LazySync", "LazyUpdate" }) do
220
+ vim.api.nvim_create_autocmd("User", {
221
+ pattern = event,
222
+ callback = function()
223
+ vim.defer_fn(function()
224
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
225
+ if vim.api.nvim_win_is_valid(win) then
226
+ local buf = vim.api.nvim_win_get_buf(win)
227
+ if vim.bo[buf].filetype == "lazy" then
228
+ pcall(vim.api.nvim_win_close, win, true)
229
+ end
230
+ end
231
+ end
232
+ end, 2000)
233
+ end,
234
+ })
235
+ end
236
+
237
+ -- ─── Post-plugin overrides (embedded mode + sane defaults for non-vim users) ───
238
+
239
+ -- Display — predictable line numbers, no relative (confuses non-vim users)
240
+ o.number = true
241
+ o.relativenumber = false
242
+ o.cursorline = true
243
+ o.signcolumn = "yes"
244
+ o.wrap = true
245
+ o.linebreak = true
246
+ o.breakindent = true
247
+ opt.breakindentopt = { "shift:2" }
248
+ o.showbreak = "↪ "
249
+ o.conceallevel = 0
250
+ o.cmdheight = 1
251
+ o.fillchars = "eob: "
252
+ o.pumheight = 12
253
+ o.scrolloff = 8
254
+ o.sidescrolloff = 8
255
+
256
+ -- Indentation — 2-space tabs (web-dev friendly)
257
+ o.tabstop = 2
258
+ o.shiftwidth = 2
259
+ o.expandtab = true
260
+ o.smartindent = true
261
+ o.shiftround = true
262
+
263
+ -- Search — case-insensitive unless uppercase used
264
+ o.ignorecase = true
265
+ o.smartcase = true
266
+
267
+ -- Behavior (embedded mode — suppress all prompts, clipboard integration)
268
+ o.swapfile = false
269
+ o.clipboard = "unnamedplus"
270
+ o.mouse = "a"
271
+ o.splitright = true
272
+ o.splitbelow = true
273
+ o.confirm = true
274
+ o.undofile = true
275
+ o.updatetime = 300
276
+ opt.shortmess:append("aAIcCFsWqtTo")
277
+ o.more = false
278
+ o.inccommand = "split"
279
+ o.completeopt = "menuone,noselect,popup"
280
+
281
+ -- Make window separators visible
282
+ vim.api.nvim_set_hl(0, "WinSeparator", { fg = "#333333", bg = "NONE" })
283
+
284
+ -- ─── VS Code muscle memory keybindings ───
285
+
286
+ -- Save with Ctrl+S (works in all modes)
287
+ vim.keymap.set({ "n", "i", "v" }, "<C-s>", "<cmd>write<CR><Esc>", { silent = true, desc = "Save file" })
288
+
289
+ -- Undo with Ctrl+Z in insert mode
290
+ vim.keymap.set("i", "<C-z>", "<cmd>undo<CR>", { silent = true, desc = "Undo" })
291
+
292
+ -- jk to exit insert mode (beginner escape hatch)
293
+ vim.keymap.set("i", "jk", "<Esc>", { silent = true, desc = "Exit insert mode" })
294
+
295
+ -- Stay in visual mode when indenting
296
+ vim.keymap.set("v", "<", "<gv", { silent = true })
297
+ vim.keymap.set("v", ">", ">gv", { silent = true })
298
+
299
+ -- Move lines up/down in visual mode (Alt+j/k)
300
+ vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { silent = true })
301
+ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { silent = true })
302
+
303
+ -- ─── SoulForge autocmds ───
304
+
305
+ -- Auto-reload files changed on disk
306
+ vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, {
307
+ pattern = "*",
308
+ command = "silent! checktime",
309
+ })
310
+
311
+ -- Highlight on yank (visual feedback when copying)
312
+ vim.api.nvim_create_autocmd("TextYankPost", {
313
+ callback = function()
314
+ pcall(vim.highlight.on_yank, { higroup = "IncSearch", timeout = 200 })
315
+ end,
316
+ })
317
+
318
+ -- Restore cursor position when reopening files
319
+ vim.api.nvim_create_autocmd("BufReadPost", {
320
+ callback = function()
321
+ local mark = vim.api.nvim_buf_get_mark(0, '"')
322
+ local lines = vim.api.nvim_buf_line_count(0)
323
+ if mark[1] > 0 and mark[1] <= lines then
324
+ pcall(vim.api.nvim_win_set_cursor, 0, mark)
325
+ end
326
+ end,
327
+ })
328
+
329
+ -- Trim trailing whitespace on save
330
+ vim.api.nvim_create_autocmd("BufWritePre", {
331
+ callback = function()
332
+ local ft = vim.bo.filetype
333
+ if ft == "diff" or ft == "mail" then return end
334
+ local pos = vim.api.nvim_win_get_cursor(0)
335
+ vim.cmd([[silent! %s/\s\+$//e]])
336
+ pcall(vim.api.nvim_win_set_cursor, 0, pos)
337
+ end,
338
+ })
339
+
340
+ -- Notify SoulForge on buffer write (repo map live updates)
341
+ vim.api.nvim_create_autocmd("BufWritePost", {
342
+ callback = function()
343
+ local path = vim.api.nvim_buf_get_name(0)
344
+ if path and path ~= "" then
345
+ pcall(vim.rpcnotify, 0, "soulforge:file_written", path)
346
+ end
347
+ end,
348
+ })
@@ -22207,7 +22207,7 @@ __export(exports_tree_sitter2, {
22207
22207
  import { existsSync as existsSync2 } from "fs";
22208
22208
  import { readFile } from "fs/promises";
22209
22209
  import { homedir as homedir2 } from "os";
22210
- import { join as join4, resolve as resolve2 } from "path";
22210
+ import { dirname, join as join4, resolve as resolve2 } from "path";
22211
22211
  function extractImportSpecifiers(node, language) {
22212
22212
  const specifiers = [];
22213
22213
  collectSpecifiers(node, language, specifiers);
@@ -23342,11 +23342,17 @@ var init_tree_sitter2 = __esm(() => {
23342
23342
  if (TreeSitterBackend.IS_BUNDLED) {
23343
23343
  return join4(BUNDLED_WASM_DIR, basename3);
23344
23344
  }
23345
- const cwd = process.cwd();
23346
- const devPaths = [join4(cwd, "node_modules", "web-tree-sitter", basename3), join4(cwd, "node_modules", "tree-sitter-wasms", "out", basename3)];
23347
- for (const p2 of devPaths) {
23348
- if (existsSync2(p2))
23349
- return p2;
23345
+ let dir = import.meta.dir;
23346
+ for (let i4 = 0;i4 < 5; i4++) {
23347
+ for (const sub of ["node_modules/web-tree-sitter", "node_modules/tree-sitter-wasms/out"]) {
23348
+ const p2 = join4(dir, sub, basename3);
23349
+ if (existsSync2(p2))
23350
+ return p2;
23351
+ }
23352
+ const parent = dirname(dir);
23353
+ if (parent === dir)
23354
+ break;
23355
+ dir = parent;
23350
23356
  }
23351
23357
  return join4(BUNDLED_WASM_DIR, basename3);
23352
23358
  }
@@ -24069,7 +24075,7 @@ import { Database } from "bun:sqlite";
24069
24075
  import { execSync } from "child_process";
24070
24076
  import { chmodSync, existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, statSync } from "fs";
24071
24077
  import { stat as statAsync } from "fs/promises";
24072
- import { dirname, extname as extname2, join as join5, relative, resolve as resolve3 } from "path";
24078
+ import { dirname as dirname2, extname as extname2, join as join5, relative, resolve as resolve3 } from "path";
24073
24079
 
24074
24080
  class RepoMap {
24075
24081
  db;
@@ -24783,7 +24789,7 @@ class RepoMap {
24783
24789
  return this.tsconfigPaths;
24784
24790
  }
24785
24791
  resolveImportSource(importSource, importerAbsPath) {
24786
- const importerDir = dirname(importerAbsPath);
24792
+ const importerDir = dirname2(importerAbsPath);
24787
24793
  let normalized = null;
24788
24794
  if (importSource.startsWith("./") || importSource.startsWith("../")) {
24789
24795
  normalized = importSource.replace(/\.(m?js|cjs|jsx)$/, "");
@@ -29705,7 +29711,7 @@ __export(exports_lsp, {
29705
29711
  });
29706
29712
  import { existsSync as existsSync7 } from "fs";
29707
29713
  import { readdir as readdir2, readFile as readFile4 } from "fs/promises";
29708
- import { dirname as dirname2, join as join9, resolve as resolve4 } from "path";
29714
+ import { dirname as dirname3, join as join9, resolve as resolve4 } from "path";
29709
29715
  function getNvimBridge() {
29710
29716
  if (_nvimBridge === null) {
29711
29717
  try {
@@ -30857,14 +30863,14 @@ function findProjectRootForLanguage(file, language) {
30857
30863
  const markers = PROJECT_FILES[language];
30858
30864
  if (!markers)
30859
30865
  return null;
30860
- let dir = dirname2(resolve4(file));
30866
+ let dir = dirname3(resolve4(file));
30861
30867
  const root2 = resolve4("/");
30862
30868
  while (dir !== root2) {
30863
30869
  for (const marker of markers) {
30864
30870
  if (existsSync7(join9(dir, marker)))
30865
30871
  return dir;
30866
30872
  }
30867
- dir = dirname2(dir);
30873
+ dir = dirname3(dir);
30868
30874
  }
30869
30875
  return null;
30870
30876
  }
@@ -201584,7 +201590,7 @@ var require_path_browserify = __commonJS((exports, module2) => {
201584
201590
  _makeLong: function _makeLong(path) {
201585
201591
  return path;
201586
201592
  },
201587
- dirname: function dirname3(path) {
201593
+ dirname: function dirname4(path) {
201588
201594
  assertPath(path);
201589
201595
  if (path.length === 0)
201590
201596
  return ".";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -83,4 +83,4 @@
83
83
  "zod": "4.3.6",
84
84
  "zustand": "5.0.12"
85
85
  }
86
- }
86
+ }