@sashabogi/argus-mcp 2.0.8 → 2.0.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/cli.mjs CHANGED
@@ -1591,8 +1591,13 @@ function evaluateExpr(expr, content, bindings) {
1591
1591
  const pattern = evaluateExpr(args[0], content, bindings);
1592
1592
  const flags = args[1] ? evaluateExpr(args[1], content, bindings) : "";
1593
1593
  const regex = new RegExp(pattern, flags + "g");
1594
- const lines = content.split("\n");
1594
+ let lines = bindings.get("__cached_lines__");
1595
+ if (!lines) {
1596
+ lines = content.split("\n");
1597
+ bindings.set("__cached_lines__", lines);
1598
+ }
1595
1599
  const matches = [];
1600
+ const MAX_MATCHES = 1e3;
1596
1601
  let charIndex = 0;
1597
1602
  for (let lineNum = 0; lineNum < lines.length; lineNum++) {
1598
1603
  const line = lines[lineNum];
@@ -1606,6 +1611,9 @@ function evaluateExpr(expr, content, bindings) {
1606
1611
  index: charIndex + match.index,
1607
1612
  groups: match.slice(1)
1608
1613
  });
1614
+ if (matches.length >= MAX_MATCHES) {
1615
+ return matches;
1616
+ }
1609
1617
  }
1610
1618
  charIndex += line.length + 1;
1611
1619
  }
@@ -1707,7 +1715,7 @@ async function analyze(provider, documentPath, query, options = {}) {
1707
1715
  const dynamicLimit = Math.min(getTurnLimit(query), maxTurns);
1708
1716
  const content = readFileSync4(documentPath, "utf-8");
1709
1717
  const fileCount = (content.match(/^FILE:/gm) || []).length;
1710
- const lineCount = content.split("\n").length;
1718
+ const lineCount = (content.match(/\n/g) || []).length + 1;
1711
1719
  const bindings = /* @__PURE__ */ new Map();
1712
1720
  const commands = [];
1713
1721
  const messages = [
@@ -2130,7 +2138,7 @@ function listProviderTypes() {
2130
2138
  // src/cli.ts
2131
2139
  init_onboarding();
2132
2140
  var program = new Command();
2133
- program.name("argus").description("Codebase Intelligence Beyond Context Limits").version("2.0.8");
2141
+ program.name("argus").description("Codebase Intelligence Beyond Context Limits").version("2.0.9");
2134
2142
  program.command("init").description("Interactive setup wizard").action(async () => {
2135
2143
  console.log("\n\u{1F52E} Argus Setup Wizard\n");
2136
2144
  console.log("This will configure your AI provider and create ~/.argus/config.json\n");