[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

ref: rename to layout.wasm and input.wasm

authored by

Nate Moore and committed by
Nate Moore
(May 28, 2026, 12:58 AM EDT) 94460116 210631c6

+39 -29
+4 -2
.github/workflows/verify.yaml
··· 45 45 with: 46 46 name: clayterm-wasm 47 47 path: | 48 - clayterm.wasm 49 - wasm.ts 48 + layout.wasm 49 + input.wasm 50 + layout.wasm.ts 51 + input.wasm.ts 50 52 51 53 test-alt-os: 52 54 needs: test
+4 -4
.gitignore
··· 1 1 /.agent-shell/ 2 - /clayterm-layout.wasm 3 - /clayterm-input.wasm 4 - /wasm-layout.ts 5 - /wasm-input.ts 2 + /layout.wasm 3 + /input.wasm 4 + /layout.wasm.ts 5 + /input.wasm.ts 6 6 /build/ 7 7 /node_modules/
+13 -9
BUILD.md
··· 18 18 19 19 It generates: 20 20 21 - - `clayterm.wasm` — the compiled WebAssembly module built from the C sources 22 - - `wasm.ts` — a generated TypeScript file derived from `clayterm.wasm` 21 + - `layout.wasm` — the layout WebAssembly module built from the C sources 22 + - `input.wasm` — the input WebAssembly module built from the C sources 23 + - `layout.wasm.ts` — generated TypeScript derived from `layout.wasm` 24 + - `input.wasm.ts` — generated TypeScript derived from `input.wasm` 23 25 24 - `wasm.ts` is generated output, not hand-maintained source. 26 + These `.ts` files are generated output, not hand-maintained source. 25 27 26 28 ## Clone the repo with submodules 27 29 ··· 182 184 183 185 This should produce: 184 186 185 - - `clayterm.wasm` 186 - - `wasm.ts` 187 + - `layout.wasm` 188 + - `input.wasm` 189 + - `layout.wasm.ts` 190 + - `input.wasm.ts` 187 191 188 192 For a clean rebuild: 189 193 ··· 197 201 198 202 - you change files under `src/` 199 203 - you update the `clay` submodule 200 - - `clayterm.wasm` or `wasm.ts` is missing 204 + - `layout.wasm`, `input.wasm`, `layout.wasm.ts`, or `input.wasm.ts` is missing 201 205 - generated outputs look stale after switching branches or pulling changes 202 206 203 207 When in doubt, use a clean rebuild: ··· 247 251 Symptoms may include: 248 252 249 253 - target-related `clang` errors mentioning `wasm32` 250 - - linker failures while producing `clayterm.wasm` 254 + - linker failures while producing the `.wasm` outputs 251 255 252 256 Recovery: 253 257 ··· 267 271 268 272 Symptoms may include: 269 273 270 - - `clayterm.wasm` is missing 271 - - `wasm.ts` is missing 274 + - `layout.wasm` or `input.wasm` is missing 275 + - `layout.wasm.ts` or `input.wasm.ts` is missing 272 276 - you changed `src/` or updated `clay/`, but the generated outputs do not match 273 277 274 278 Recovery:
+10 -10
Makefile
··· 49 49 50 50 DEPS = $(wildcard src/*.c src/*.h) 51 51 52 - all: clayterm-layout.wasm clayterm-input.wasm wasm-layout.ts wasm-input.ts 53 - @echo "Built clayterm-layout.wasm ($$(wc -c < clayterm-layout.wasm) bytes raw, $$(gzip -c clayterm-layout.wasm | wc -c) bytes gzip)" 54 - @echo "Built clayterm-input.wasm ($$(wc -c < clayterm-input.wasm) bytes raw, $$(gzip -c clayterm-input.wasm | wc -c) bytes gzip)" 52 + all: layout.wasm input.wasm layout.wasm.ts input.wasm.ts 53 + @echo "Built layout.wasm ($$(wc -c < layout.wasm) bytes raw, $$(gzip -c layout.wasm | wc -c) bytes gzip)" 54 + @echo "Built input.wasm ($$(wc -c < input.wasm) bytes raw, $$(gzip -c input.wasm | wc -c) bytes gzip)" 55 55 56 - clayterm-layout.wasm: $(DEPS) 56 + layout.wasm: $(DEPS) 57 57 $(CC) $(CFLAGS) $(LAYOUT_LDFLAGS) -o $@ src/module-layout.c 58 58 59 - clayterm-input.wasm: $(DEPS) 59 + input.wasm: $(DEPS) 60 60 $(CC) $(filter-out -DCLAY_IMPLEMENTATION -DCLAY_WASM, $(CFLAGS)) $(INPUT_LDFLAGS) -o $@ src/module-input.c 61 61 62 - wasm-layout.ts: clayterm-layout.wasm 63 - deno run --allow-read --allow-write tasks/bundle-wasm.ts clayterm-layout.wasm wasm-layout.ts 62 + layout.wasm.ts: layout.wasm 63 + deno run --allow-read --allow-write tasks/bundle-wasm.ts layout.wasm layout.wasm.ts 64 64 65 - wasm-input.ts: clayterm-input.wasm 66 - deno run --allow-read --allow-write tasks/bundle-wasm.ts clayterm-input.wasm wasm-input.ts 65 + input.wasm.ts: input.wasm 66 + deno run --allow-read --allow-write tasks/bundle-wasm.ts input.wasm input.wasm.ts 67 67 68 68 clean: 69 - rm -f clayterm.wasm clayterm-layout.wasm clayterm-input.wasm wasm.ts wasm-layout.ts wasm-input.ts 69 + rm -f layout.wasm input.wasm layout.wasm.ts input.wasm.ts 70 70 71 71 .PHONY: all clean
+1 -1
deno.json
··· 27 27 }, 28 28 "publish": { 29 29 "include": ["*.ts"], 30 - "exclude": ["!wasm-layout.ts", "!wasm-input.ts"] 30 + "exclude": ["!layout.wasm.ts", "!input.wasm.ts"] 31 31 }, 32 32 "nodeModulesDir": "auto", 33 33 "fmt": {
+1 -1
input-native.ts
··· 169 169 delay(st: number): number; 170 170 } 171 171 172 - import { compiled } from "./wasm-input.ts"; 172 + import { compiled } from "./input.wasm.ts"; 173 173 174 174 export async function createInputNative( 175 175 escLatency: number,
+5 -1
tasks/bundle-wasm.ts
··· 1 1 import { encodeBase64 } from "@std/encoding/base64"; 2 2 3 - const [input = "clayterm.wasm", output = "wasm.ts"] = Deno.args; 3 + const [input, output] = Deno.args; 4 + if (!input || !output) { 5 + console.error("Usage: bundle-wasm.ts <input.wasm> <output.ts>"); 6 + Deno.exit(1); 7 + } 4 8 5 9 const wasm = await Deno.readFile(input); 6 10 const base64 = encodeBase64(wasm);
+1 -1
term-native.ts
··· 31 31 errorMessage(ct: number, index: number): string; 32 32 } 33 33 34 - import { compiled } from "./wasm-layout.ts"; 34 + import { compiled } from "./layout.wasm.ts"; 35 35 36 36 export async function createTermNative( 37 37 w: number,