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
This commit is contained in:
2026-07-06 14:19:16 +08:00
parent 08389601ac
commit 21f8fbcd0b
6 changed files with 952 additions and 41 deletions
+9 -2
View File
@@ -1,14 +1,21 @@
export interface ServeOptions {
port: string;
host?: string;
mqttPort?: string;
}
export interface CompileOptions {
output: string;
}
export type ServeCommandHandler = (dir: string, options: ServeOptions) => Promise<void>;
export type CompileCommandHandler = (dir: string, options: CompileOptions) => Promise<void>;
export type ServeCommandHandler = (
dir: string,
options: ServeOptions,
) => Promise<void>;
export type CompileCommandHandler = (
dir: string,
options: CompileOptions,
) => Promise<void>;
export interface MarkdownFile {
path: string;