mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-03 05:43:27 +00:00
* feat(dashboard): stream agent chat via @langchain/react v2 protocol Replace the bespoke SSE + React Query polling path with LangGraph’s v2 event stream through credentialed dashboard proxies. Run starts go through stream commands; mid-run follow-ups still queue via /messages. * fix import path * fix tests after rebase * format * PR feedback * improved model fallback * fix image handling * embrace sdk * cleanup * cr * more cleanup * fix cors * harden security --------- Co-authored-by: open-swe[bot] <215916821+open-swe[bot]@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
20 lines
556 B
TypeScript
20 lines
556 B
TypeScript
import { parseDiffFromFile } from "@pierre/diffs";
|
|
|
|
export function countLineChanges(
|
|
originalContent: string | null | undefined,
|
|
newContent: string,
|
|
filePath = "file",
|
|
): { additions: number; deletions: number } {
|
|
const meta = parseDiffFromFile(
|
|
{ name: filePath, contents: originalContent ?? "" },
|
|
{ name: filePath, contents: newContent },
|
|
);
|
|
|
|
let additions = 0;
|
|
let deletions = 0;
|
|
for (const hunk of meta.hunks) {
|
|
additions += hunk.additionLines;
|
|
deletions += hunk.deletionLines;
|
|
}
|
|
return { additions, deletions };
|
|
}
|