import {
  formatAgentToolOutput
} from "../../chunk-QRXG5CAZ.js";
import {
  LocalRipgrepProvider
} from "../../chunk-XNBQJSLI.js";
import "../../chunk-G2RSY56Q.js";
import "../../chunk-YPKNMYD4.js";
import "../../chunk-TPP2UGQP.js";
import {
  buildInitialState,
  calculateContextBudget,
  formatListDirectoryTree,
  formatTurnMessage,
  normalizeFinishFiles,
  readFinishFiles,
  toolGlob,
  toolGrep,
  toolListDirectory,
  toolRead
} from "../../chunk-VNAGVCSP.js";
import {
  extractPathFromCommand,
  parseFinishFiles,
  parseReadLines
} from "../../chunk-FBRNUWEB.js";
import {
  AGENT_CONFIG,
  DEFAULT_EXCLUDES
} from "../../chunk-I3J46TSB.js";
import "../../chunk-PZ5AY32C.js";

// tools/warp_grep/harness.ts
async function resolveFinishFiles(provider, files) {
  return readFinishFiles("", files, async (p, s, e) => {
    const r = await provider.read({ path: p, start: s, end: e });
    return r.lines.map((l) => {
      const idx = l.indexOf("|");
      return idx >= 0 ? l.slice(idx + 1) : l;
    });
  });
}
export {
  AGENT_CONFIG,
  DEFAULT_EXCLUDES,
  LocalRipgrepProvider,
  buildInitialState,
  calculateContextBudget,
  extractPathFromCommand,
  formatListDirectoryTree,
  formatAgentToolOutput as formatToolResult,
  formatTurnMessage,
  normalizeFinishFiles,
  parseFinishFiles,
  parseReadLines,
  readFinishFiles,
  resolveFinishFiles,
  toolGlob,
  toolGrep,
  toolListDirectory,
  toolRead
};
//# sourceMappingURL=harness.js.map