Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
import { Fragment } from "react";
import { searchMatchRanges } from "../lib/session-search";
export function SearchHighlight({ text, query }: { text: string; query: string }) {
const ranges = searchMatchRanges(text, query);
let end = 0;
return (
<>
{ranges.map(([start, next]) => {
const before = text.slice(end, start);
end = next;
return (
<Fragment key={start}>
{before}
<mark className="search-hit">{text.slice(start, next)}</mark>
</Fragment>
);
})}
{text.slice(end)}
</>
);
}