char-slop/berry

multipurpose self-modifiable agentic harness

git clone https://git.t4t.associates/char-slop/berry

Charlotte Somimprove terminal rendering (especially with backgrounds etcetc)51288b6

main
712 B19 linesraw
1import { defineRenderers } from "@berry/api/web.ts";
2import { Ghostty } from "./ghostty.ts";
3import { terminalView } from "./view.tsx";
4import "./web.css";
5
6let loaded: Promise<Ghostty> | undefined;
7// one module for every terminal on the page; it is fetched once something opens one
8const load = () =>
9  loaded ??= fetch(new URL("./ghostty-vt.wasm", import.meta.url))
10    .then((response) => {
11      if (!response.ok) throw new Error(`the terminal's module did not load (${response.status})`);
12      return Ghostty.load(response);
13    })
14    .catch((error) => {
15      loaded = undefined;
16      throw error;
17    });
18
19export default defineRenderers({ view: { label: "term", create: () => terminalView(load) } });