diff --git a/AGENTS.md b/AGENTS.md
index 3e47283..83c3c65 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -8,12 +8,13 @@ Do **not** add or maintain code paths for opening the overlay as **`file://`**.
## Files of interest
-- [`index.html`](index.html) — Page shell: markup for map info, time bar, score, settings dialog; pulls `index.css` and `index.js`.
-- [`index.js`](index.js) — Connects to BS+ WebSocket, parses JSON events (`gameState`, `mapInfo`, `pause`, `resume`, `score`), updates DOM; optional BeatSaver API fetch for custom maps; reads/writes settings from URL hash.
+- [`index.html`](index.html) — Page shell: markup for map info, time bar, score, settings dialog; pulls `index.css` and bundled `index.js` module.
+- [`index.ts`](index.ts) — Main overlay source in TypeScript; connects to BS+ WebSocket, parses events (`gameState`, `mapInfo`, `pause`, `resume`, `score`), updates DOM, and manages settings/hash state.
+- [`types.ts`](types.ts) — Shared TypeScript types for BS+ payloads/events and chat request JSON.
+- [`index.js`](index.js) — Bundled browser output generated from `index.ts` via `deno task build`.
- [`index.css`](index.css) — Layout, theming, visibility toggles driven by body classes and CSS variables from settings.
- [`serve.ts`](serve.ts) — Deno static server + optional mapping of `ChatRequest.json` / `database.json` to the real BS+ `Database.json` path.
-- [`types.d.ts`](types.d.ts) — JSDoc typedefs for BS+ payloads and events (editor/IDE hints only).
-- [`jsconfig.json`](jsconfig.json) — JS project roots/path so editors resolve modules and `types.d.ts`.
+- [`deno.json`](deno.json) — Deno tasks and TypeScript compiler options (`build`, `serve`, `dev`).
- [`images/`](images/) — Cover fallback (`unknown.svg`), characteristic icons under `images/characteristic/` (filenames match BS+ characteristic strings).
- [`README.md`](README.md) — User-facing usage (Deno, OBS URL, BS+ module).
- [`dprint.json`](dprint.json) — Formatter config for the repo.
@@ -21,4 +22,4 @@ Do **not** add or maintain code paths for opening the overlay as **`file://`**.
## Out of scope here
-Beat Saber Plus itself (game mod) exposes the socket; this repo is only the HTML/CSS/JS client.
+Beat Saber Plus itself (game mod) exposes the socket; this repo is only the HTML/CSS/TS client.
diff --git a/README.md b/README.md
index 9504ba8..a6070f2 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,8 @@ Requires [BeatSaberPlus](https://github.com/hardcpp/BeatSaberPlus)
Install [Deno](https://docs.deno.com/runtime/getting_started/installation/) and serve the overlay over HTTP (see below).
+The browser overlay source is now TypeScript (`index.ts`) and is bundled to `index.js` with `deno task build` (run automatically by `deno task serve`).
+
The server must know where Beat Saber Plus stores **`ChatRequest/Database.json`**. It then serves that file as `ChatRequest.json` and `database.json` (same data) over HTTP—no symlink.
**Easiest:** copy `chat-request-database.path.example` to **`chat-request-database.path`** in this repo and put **one line**: the absolute path to `Database.json` (gitignored, so it stays on your machine).
@@ -29,3 +31,9 @@ If neither the path file nor `CHAT_REQUEST_DATABASE` is set, the overlay only fi
### Usage
Clone the repo and run `deno task serve` as above.
+
+### Development tasks
+
+- `deno task build` - bundle/check `index.ts` for browser output (`index.js`)
+- `deno task serve` - build, then serve `index.html` and JSON files
+- `deno task dev` - watch and rebuild `index.js` when `index.ts` changes
diff --git a/deno.json b/deno.json
index 0de2691..696221e 100644
--- a/deno.json
+++ b/deno.json
@@ -1,6 +1,11 @@
{
- "tasks": {
- "serve": "deno run --allow-net --allow-read --allow-env serve.ts",
- "dev": "deno run --watch --allow-net --allow-read --allow-env serve.ts"
- }
+ "compilerOptions": {
+ "strict": true,
+ "lib": ["dom", "dom.iterable", "deno.ns", "esnext"]
+ },
+ "tasks": {
+ "build": "deno bundle --platform=browser --check index.ts -o index.js",
+ "serve": "deno task build && deno run --allow-net --allow-read --allow-env serve.ts",
+ "dev": "deno bundle --platform=browser --watch --check index.ts -o index.js"
+ }
}
diff --git a/index.html b/index.html
index 88ce702..af01196 100644
--- a/index.html
+++ b/index.html
@@ -74,6 +74,6 @@
About
This was forked from Iza's overlay
-
+