@sashabogi/argus-mcp 2.0.7 → 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
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -717,7 +711,7 @@ import * as fs from "fs";
717
711
  import { homedir as homedir2 } from "os";
718
712
  import { join as join4, resolve, basename as basename2 } from "path";
719
713
  import * as path2 from "path";
720
- import { execSync as execSync2 } from "child_process";
714
+ import { execSync as execSync2, spawn } from "child_process";
721
715
 
722
716
  // src/core/config.ts
723
717
  init_esm_shims();
@@ -1597,8 +1591,13 @@ function evaluateExpr(expr, content, bindings) {
1597
1591
  const pattern = evaluateExpr(args[0], content, bindings);
1598
1592
  const flags = args[1] ? evaluateExpr(args[1], content, bindings) : "";
1599
1593
  const regex = new RegExp(pattern, flags + "g");
1600
- 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
+ }
1601
1599
  const matches = [];
1600
+ const MAX_MATCHES = 1e3;
1602
1601
  let charIndex = 0;
1603
1602
  for (let lineNum = 0; lineNum < lines.length; lineNum++) {
1604
1603
  const line = lines[lineNum];
@@ -1612,6 +1611,9 @@ function evaluateExpr(expr, content, bindings) {
1612
1611
  index: charIndex + match.index,
1613
1612
  groups: match.slice(1)
1614
1613
  });
1614
+ if (matches.length >= MAX_MATCHES) {
1615
+ return matches;
1616
+ }
1615
1617
  }
1616
1618
  charIndex += line.length + 1;
1617
1619
  }
@@ -1713,7 +1715,7 @@ async function analyze(provider, documentPath, query, options = {}) {
1713
1715
  const dynamicLimit = Math.min(getTurnLimit(query), maxTurns);
1714
1716
  const content = readFileSync4(documentPath, "utf-8");
1715
1717
  const fileCount = (content.match(/^FILE:/gm) || []).length;
1716
- const lineCount = content.split("\n").length;
1718
+ const lineCount = (content.match(/\n/g) || []).length + 1;
1717
1719
  const bindings = /* @__PURE__ */ new Map();
1718
1720
  const commands = [];
1719
1721
  const messages = [
@@ -2136,7 +2138,7 @@ function listProviderTypes() {
2136
2138
  // src/cli.ts
2137
2139
  init_onboarding();
2138
2140
  var program = new Command();
2139
- program.name("argus").description("Codebase Intelligence Beyond Context Limits").version("2.0.7");
2141
+ program.name("argus").description("Codebase Intelligence Beyond Context Limits").version("2.0.9");
2140
2142
  program.command("init").description("Interactive setup wizard").action(async () => {
2141
2143
  console.log("\n\u{1F52E} Argus Setup Wizard\n");
2142
2144
  console.log("This will configure your AI provider and create ~/.argus/config.json\n");
@@ -3004,7 +3006,6 @@ program.command("ui").description("Open the Argus web UI for codebase visualizat
3004
3006
  console.log(`
3005
3007
  Argus UI running at http://localhost:${port}`);
3006
3008
  if (opts.open !== false) {
3007
- const { spawn } = __require("child_process");
3008
3009
  const openUrl = `http://localhost:${port}`;
3009
3010
  const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
3010
3011
  spawn(openCmd, [openUrl], { detached: true, stdio: "ignore" }).unref();
@@ -3018,7 +3019,6 @@ Argus UI running at http://localhost:${port}`);
3018
3019
  } else {
3019
3020
  console.log(` Running development server...`);
3020
3021
  console.log(` Port: ${opts.port}`);
3021
- const { spawn } = __require("child_process");
3022
3022
  const vite = spawn("npm", ["run", "dev", "--", "--port", opts.port], {
3023
3023
  cwd: uiPath,
3024
3024
  stdio: "inherit"