Commit Graph

29 Commits

Author SHA1 Message Date
hypercross 9a312f76ad fix(completions): instantiate Slugger per file
Move Slugger instantiation inside the file loops to prevent
state leakage between files, as Slugger is stateful.
2026-07-07 19:07:37 +08:00
hypercross 2f29f8774d feat: add spark table completion and rolling support
Implement "spark tables" functionality, which allows users to roll
dice against markdown tables to retrieve specific values.

- Add `sparkTablesSource` to scan markdown files for tables starting
  with a dice notation (e.g., d6, d20).
- Implement `/spark` command in the journal to resolve and roll
  spark tables.
- Add a new message type `spark` with a dedicated UI component to
  render the results.
- Update completions API to include spark table metadata.
2026-07-07 19:02:17 +08:00
hypercross e0d61cf91e feat: improve completions loading and UI handling
Refactor the completions system to support both CLI mode (via
`/__COMPLETIONS.json`) and a client-side fallback scan for dev mode.

- Implement client-side scanning of the file index for dice and headings
- Add `ensureCompletions` to allow components to await data readiness
- Update `JournalInput` to handle "no results" states in the dropdown
- Improve keyboard navigation (Tab to accept, Enter to select)
- Update dice regex to support `:md-dice[...]` syntax
2026-07-06 17:13:11 +08:00
hypercross 8284f5caee feat: add completions API and scanning logic
Implement a new completions system that scans markdown files for
dice notation and headings. The server now exposes a
`/__COMPLETIONS.json`
endpoint and automatically recomputes the completion index when
files are added, updated, or deleted.
2026-07-06 16:50:45 +08:00
hypercross 6b5fcdc051 fix(cli): use async broker creation in journal server
Use `AedesFactory.createBroker()` instead of the constructor to ensure
persistence is properly initialized before handling connections.
2026-07-06 16:01:29 +08:00
hypercross 98c4a195e8 refactor: replace websocket-stream with native ws utility
Remove the `websocket-stream` dependency in favor of
`createWebSocketStream`
from the `ws` package. This simplifies the MQTT broker setup in the
journal server and removes unnecessary transitive dependencies.

Also improve the JournalPanel UI with smoother transitions and better
visibility handling.
2026-07-06 15:53:52 +08:00
hypercross 34d647d611 feat: implement websocket-stream for journal server
Integrate `websocket-stream` to handle MQTT broker upgrades in the
CLI and add granular connection status tracking to the UI.

- Add `websocket-stream` dependency
- Update CLI to use `websocket-stream` for socket upgrades
- Enhance `journalStream` store with `connectionStatus` and
  `connectionError` states
- Add visual connection status indicators to `App` and `JournalPanel`
2026-07-06 15:38:28 +08:00
hypercross 862ba9c01b feat: simplify journal connection via WebSocket upgrade
Refactor the journal server to run over WebSockets on the existing
HTTP server instead of a separate MQTT TCP port. This removes the need
for a separate port configuration and simplifies the connection flow
by auto-connecting to the current host.

- Remove `--mqtt-port` CLI option
- Attach Aedes broker to the HTTP server via WebSocket upgrade
- Update UI to remove manual broker URL and player name inputs
- Add "Content Source" access from the sidebar
- Update JournalPanel to auto-connect to the local server
2026-07-06 15:30:21 +08:00
hypercross 21f8fbcd0b feat: add MQTT journal server for session persistence
Implement a journal server that uses an Aedes MQTT broker to
persist stream messages to JSONL files and manage session metadata
via a manifest.

- Add `aedes`, `mqtt`, and `zod` dependencies
- Implement `createJournalServer` in `src/cli/journal.ts`
- Integrate journal server into the `serve` command
- Add `--mqtt-port` option to the CLI
- Add session lifecycle management (create, update, delete) via
  retained MQTT topics
2026-07-06 14:19:16 +08:00
hyper afe2eb4af8 fix: cli file change detection now includes csv/yarn 2026-04-08 19:43:32 +08:00
hypercross 3d9617f06c fix: host addr 2026-03-21 00:29:36 +08:00
hypercross 71ab7523da fix: shutdown 2026-03-18 15:27:06 +08:00
hypercross e5ce8c20b5 fix: mcp serve 2026-03-18 15:19:55 +08:00
hypercross 5389345a00 feat: mcp serve preview 2026-03-18 14:47:56 +08:00
hypercross 1d2b4b3e1e feat: layer docs 2026-03-18 14:28:44 +08:00
hypercross 301f499494 feat: resources? 2026-03-18 13:25:01 +08:00
hypercross 8213092bb6 fix: docs 2026-03-18 13:02:50 +08:00
hypercross 4f9d295bd5 feat: mcp prompts 2026-03-18 12:13:15 +08:00
hypercross 62aff91a86 fix: mcp 2026-03-18 12:08:28 +08:00
hypercross eecf429a20 fix: env and __CONTENT_INDEX 2026-03-18 11:31:13 +08:00
hyper 7b68504b1e feat: mcp server! 2026-03-17 22:49:47 +08:00
hyper 834db72ec4 feat: mcp server? 2026-03-17 20:01:04 +08:00
hypercross 748f57dd55 fix: refactor stuff 2026-03-13 16:02:09 +08:00
hypercross e57e09ae05 fix: misc 2026-02-26 16:35:57 +08:00
hypercross 04dfa77eaf fix: cli dist/web path 2026-02-26 16:11:56 +08:00
hypercross c6889ac65d refactor: only index md files 2026-02-26 14:14:26 +08:00
hypercross b5fbdc17d2 fix: path 2026-02-26 13:57:59 +08:00
hypercross 8d7f745df2 feat: ai's attempt 2026-02-26 13:35:09 +08:00
hypercross 3c9cf552e5 feat: ai's first take... 2026-02-26 00:17:23 +08:00