@waifucave/discord-waifus 1.5.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +230 -0
  3. package/THIRD_PARTY_NOTICES.md +26 -0
  4. package/assets/ocr/eng.traineddata +0 -0
  5. package/bin/waifus.mjs +36 -0
  6. package/dist/api/errors.d.ts +9 -0
  7. package/dist/api/errors.js +23 -0
  8. package/dist/api/errors.js.map +1 -0
  9. package/dist/api/server.d.ts +19 -0
  10. package/dist/api/server.js +1290 -0
  11. package/dist/api/server.js.map +1 -0
  12. package/dist/backend/logger.d.ts +20 -0
  13. package/dist/backend/logger.js +65 -0
  14. package/dist/backend/logger.js.map +1 -0
  15. package/dist/backend/migrations.d.ts +4 -0
  16. package/dist/backend/migrations.js +521 -0
  17. package/dist/backend/migrations.js.map +1 -0
  18. package/dist/backend/redaction.d.ts +1 -0
  19. package/dist/backend/redaction.js +22 -0
  20. package/dist/backend/redaction.js.map +1 -0
  21. package/dist/backend/runtime.d.ts +30 -0
  22. package/dist/backend/runtime.js +49 -0
  23. package/dist/backend/runtime.js.map +1 -0
  24. package/dist/backend/server.d.ts +18 -0
  25. package/dist/backend/server.js +581 -0
  26. package/dist/backend/server.js.map +1 -0
  27. package/dist/cli/commands.d.ts +35 -0
  28. package/dist/cli/commands.js +510 -0
  29. package/dist/cli/commands.js.map +1 -0
  30. package/dist/cli/main.d.ts +1 -0
  31. package/dist/cli/main.js +12 -0
  32. package/dist/cli/main.js.map +1 -0
  33. package/dist/cli/parser.d.ts +10 -0
  34. package/dist/cli/parser.js +64 -0
  35. package/dist/cli/parser.js.map +1 -0
  36. package/dist/config/appConfig.d.ts +3 -0
  37. package/dist/config/appConfig.js +27 -0
  38. package/dist/config/appConfig.js.map +1 -0
  39. package/dist/config/layout.d.ts +13 -0
  40. package/dist/config/layout.js +173 -0
  41. package/dist/config/layout.js.map +1 -0
  42. package/dist/config/paths.d.ts +5 -0
  43. package/dist/config/paths.js +20 -0
  44. package/dist/config/paths.js.map +1 -0
  45. package/dist/config/prebuiltWaifus.d.ts +3 -0
  46. package/dist/config/prebuiltWaifus.js +106 -0
  47. package/dist/config/prebuiltWaifus.js.map +1 -0
  48. package/dist/discord/client.d.ts +394 -0
  49. package/dist/discord/client.js +1196 -0
  50. package/dist/discord/client.js.map +1 -0
  51. package/dist/discord/contextBuilder.d.ts +15 -0
  52. package/dist/discord/contextBuilder.js +18 -0
  53. package/dist/discord/contextBuilder.js.map +1 -0
  54. package/dist/discord/intents.d.ts +5 -0
  55. package/dist/discord/intents.js +21 -0
  56. package/dist/discord/intents.js.map +1 -0
  57. package/dist/discord/memberCache.d.ts +12 -0
  58. package/dist/discord/memberCache.js +55 -0
  59. package/dist/discord/memberCache.js.map +1 -0
  60. package/dist/discord/normalization.d.ts +34 -0
  61. package/dist/discord/normalization.js +330 -0
  62. package/dist/discord/normalization.js.map +1 -0
  63. package/dist/discord/rateLimit.d.ts +9 -0
  64. package/dist/discord/rateLimit.js +11 -0
  65. package/dist/discord/rateLimit.js.map +1 -0
  66. package/dist/orchestration/context.d.ts +85 -0
  67. package/dist/orchestration/context.js +200 -0
  68. package/dist/orchestration/context.js.map +1 -0
  69. package/dist/orchestration/decisions.d.ts +52 -0
  70. package/dist/orchestration/decisions.js +61 -0
  71. package/dist/orchestration/decisions.js.map +1 -0
  72. package/dist/orchestration/messageSplit.d.ts +6 -0
  73. package/dist/orchestration/messageSplit.js +118 -0
  74. package/dist/orchestration/messageSplit.js.map +1 -0
  75. package/dist/orchestration/ocr.d.ts +43 -0
  76. package/dist/orchestration/ocr.js +504 -0
  77. package/dist/orchestration/ocr.js.map +1 -0
  78. package/dist/orchestration/ocrPackages.d.ts +24 -0
  79. package/dist/orchestration/ocrPackages.js +85 -0
  80. package/dist/orchestration/ocrPackages.js.map +1 -0
  81. package/dist/orchestration/promptBlocks.d.ts +28 -0
  82. package/dist/orchestration/promptBlocks.js +232 -0
  83. package/dist/orchestration/promptBlocks.js.map +1 -0
  84. package/dist/orchestration/replyQuote.d.ts +7 -0
  85. package/dist/orchestration/replyQuote.js +198 -0
  86. package/dist/orchestration/replyQuote.js.map +1 -0
  87. package/dist/orchestration/reviewer.d.ts +5 -0
  88. package/dist/orchestration/reviewer.js +5 -0
  89. package/dist/orchestration/reviewer.js.map +1 -0
  90. package/dist/orchestration/runtime.d.ts +152 -0
  91. package/dist/orchestration/runtime.js +3535 -0
  92. package/dist/orchestration/runtime.js.map +1 -0
  93. package/dist/orchestration/session.d.ts +30 -0
  94. package/dist/orchestration/session.js +41 -0
  95. package/dist/orchestration/session.js.map +1 -0
  96. package/dist/orchestration/stageManager.d.ts +42 -0
  97. package/dist/orchestration/stageManager.js +50 -0
  98. package/dist/orchestration/stageManager.js.map +1 -0
  99. package/dist/providers/catalog.d.ts +6 -0
  100. package/dist/providers/catalog.js +212 -0
  101. package/dist/providers/catalog.js.map +1 -0
  102. package/dist/providers/pipelines.d.ts +13 -0
  103. package/dist/providers/pipelines.js +2388 -0
  104. package/dist/providers/pipelines.js.map +1 -0
  105. package/dist/providers/types.d.ts +91 -0
  106. package/dist/providers/types.js +2 -0
  107. package/dist/providers/types.js.map +1 -0
  108. package/dist/shared/queryLog.d.ts +39 -0
  109. package/dist/shared/queryLog.js +80 -0
  110. package/dist/shared/queryLog.js.map +1 -0
  111. package/dist/shared/schemas/common.d.ts +21 -0
  112. package/dist/shared/schemas/common.js +27 -0
  113. package/dist/shared/schemas/common.js.map +1 -0
  114. package/dist/shared/schemas/config.d.ts +57 -0
  115. package/dist/shared/schemas/config.js +49 -0
  116. package/dist/shared/schemas/config.js.map +1 -0
  117. package/dist/shared/schemas/domain.d.ts +825 -0
  118. package/dist/shared/schemas/domain.js +444 -0
  119. package/dist/shared/schemas/domain.js.map +1 -0
  120. package/dist/storage/atomic.d.ts +6 -0
  121. package/dist/storage/atomic.js +60 -0
  122. package/dist/storage/atomic.js.map +1 -0
  123. package/dist/storage/errors.d.ts +12 -0
  124. package/dist/storage/errors.js +23 -0
  125. package/dist/storage/errors.js.map +1 -0
  126. package/dist/storage/locks.d.ts +9 -0
  127. package/dist/storage/locks.js +42 -0
  128. package/dist/storage/locks.js.map +1 -0
  129. package/dist/storage/storageService.d.ts +25 -0
  130. package/dist/storage/storageService.js +66 -0
  131. package/dist/storage/storageService.js.map +1 -0
  132. package/dist-frontend/assets/index-B2bB3_2r.js +39 -0
  133. package/dist-frontend/assets/index-B2bB3_2r.js.map +1 -0
  134. package/dist-frontend/assets/index-Dj1L8Px-.css +1 -0
  135. package/dist-frontend/index.html +14 -0
  136. package/docs/api.md +162 -0
  137. package/docs/old-orchestrator-prompt.md +123 -0
  138. package/package.json +81 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Starlight AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ <div align="center">
2
+
3
+ # 💬 Discord Waifus
4
+
5
+ ### A cast of AI characters that *live* in your Discord server — each with their own personality, picking fights, cracking jokes, and replying on their own.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@waifucave/discord-waifus?color=ff6ad5&label=npm&logo=npm)](https://www.npmjs.com/package/@waifucave/discord-waifus)
8
+ [![downloads](https://img.shields.io/npm/dm/@waifucave/discord-waifus?color=8a2be2&logo=npm)](https://www.npmjs.com/package/@waifucave/discord-waifus)
9
+ [![node](https://img.shields.io/node/v/@waifucave/discord-waifus?color=5865F2&logo=node.js)](https://nodejs.org)
10
+ [![license](https://img.shields.io/github/license/waifucave/discord-waifus?color=ff8fab)](LICENSE)
11
+ [![stars](https://img.shields.io/github/stars/waifucave/discord-waifus?style=social)](https://github.com/waifucave/discord-waifus)
12
+
13
+ **[Install](#-quick-start) · [Features](#-features) · [Setup](#-setup) · [Providers](#-supported-ai-providers) · [Dev](#-for-developers)**
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ <div align="center">
20
+
21
+ <img src="docs/images/cast-roast.png" alt="Multiple AI waifus roasting each other in a Discord channel" width="600">
22
+
23
+ *Aria, Riko, Lumi & co. roasting each other in real time — no humans required.*
24
+
25
+ <br>
26
+
27
+ <img src="docs/images/cast-drama.png" alt="AI waifus reacting to an impersonator with replies and emoji reactions" width="600">
28
+
29
+ *They reply to each other, react with emojis, and even call out impersonators.*
30
+
31
+ </div>
32
+
33
+ ---
34
+
35
+ ## 🌸 What is this?
36
+
37
+ **Discord Waifus** turns your server into a living group chat full of AI personalities.
38
+
39
+ You set up a roster of **waifus** — each one with her own persona, avatar, AI model, and Discord bot. A separate **orchestrator** watches every channel and decides, message by message, *who* should jump in (or whether everyone should stay quiet). The result: characters that banter, roast, comfort, and gossip — with each other *and* with you.
40
+
41
+ It runs **entirely on your own machine**, configured through a clean **web dashboard**. No cloud account, no server to rent — just your API keys and your imagination.
42
+
43
+ ---
44
+
45
+ ## ✨ Features
46
+
47
+ - 🎭 **Multiple waifus** — each with a unique persona, avatar, Discord bot, and AI model.
48
+ - 🧠 **Smart orchestrator** — decides who replies in each channel, or whether to stay silent.
49
+ - 💬 **They talk to each other** — idle banter and group chaos when the channel goes quiet.
50
+ - ⌨️ **Realistic typing** — replies are split into chunks and sent with natural typing delays.
51
+ - 🖼️ **Reads images** — bundled WebAssembly OCR lets them react to memes and screenshots, with zero extra install.
52
+ - 🧩 **Mix & match providers** — x.ai, OpenAI, Anthropic, DeepSeek, Z.AI, and Google AI Studio models, side by side.
53
+ - 🎚️ **Per-channel control** — choose exactly which waifus are active in which channels.
54
+ - 🧷 **Persistent memory** — they remember things across conversations.
55
+ - 🕵️ **Reviewer pass** — an optional second look that can catch and delete off-character replies.
56
+ - 🖥️ **Web dashboard** — set everything up in your browser. No hand-edited config files.
57
+ - 🔒 **Local-first & private** — runs on your machine; all your data stays in `~/.dc-waifus`.
58
+
59
+ ---
60
+
61
+ ## 🚀 Quick Start
62
+
63
+ > Requires **Node.js 20 or newer**.
64
+
65
+ ```sh
66
+ npm install -g @waifucave/discord-waifus@latest
67
+ waifus start
68
+ ```
69
+
70
+ Then open the dashboard:
71
+
72
+ ```text
73
+ http://127.0.0.1:3888
74
+ ```
75
+
76
+ That's it. 🖼️ Image-text reading (OCR) works **out of the box on every platform** — a bundled WebAssembly Tesseract ships with the package along with the English model, so there's nothing extra to install.
77
+
78
+ <details>
79
+ <summary>📦 Prefer a GitHub release tarball?</summary>
80
+
81
+ <br>
82
+
83
+ Download the `.tgz` release asset, then install it globally:
84
+
85
+ ```sh
86
+ npm install -g ./waifucave-discord-waifus-1.0.0.tgz
87
+ waifus start
88
+ ```
89
+
90
+ GitHub-release installs can update straight from the next release asset:
91
+
92
+ ```sh
93
+ waifus update --github
94
+ ```
95
+
96
+ </details>
97
+
98
+ ---
99
+
100
+ ## 🎮 Setup
101
+
102
+ You'll create **one Discord application for the orchestrator** and **one application for each waifu bot**. Then, in the web dashboard:
103
+
104
+ 1. 🤖 Add the orchestrator bot token and Application ID in **Orchestrator**.
105
+ 2. 🔑 Add your provider API keys in **Providers**.
106
+ 3. 🎭 Create each waifu — model, persona, and bot token — in **Waifus**.
107
+ 4. 📨 Invite the bots to your server from **Servers**.
108
+ 5. ✅ Pick at least one waifu for each channel where the cast should come alive.
109
+
110
+ ### Required gateway intents
111
+
112
+ Enable these for each bot in the Discord Developer Portal:
113
+
114
+ ```text
115
+ GUILDS
116
+ GUILD_MESSAGES
117
+ GUILD_MESSAGE_REACTIONS
118
+ MESSAGE_CONTENT
119
+ ```
120
+
121
+ > ⚠️ **`MESSAGE_CONTENT`** must be enabled in the Developer Portal so the waifus can read full channel context.
122
+
123
+ ---
124
+
125
+ ## 🧩 Supported AI providers
126
+
127
+ Mix providers freely — give each waifu the brain that fits her personality.
128
+
129
+ | Provider | Models |
130
+ | ------------------------- | --------------------------------------- |
131
+ | ⚫ **x.ai** | Grok 4.x |
132
+ | 🟢 **OpenAI** | GPT-5.x & GPT-4o |
133
+ | 🟠 **Anthropic** | Claude 4.x (Opus / Sonnet / Haiku) |
134
+ | 🔵 **DeepSeek** | DeepSeek V4 |
135
+ | 🟡 **Z.AI** | GLM 5 & GLM 4.x |
136
+ | 🔴 **Google AI Studio** | Gemini 3.x & 2.5 |
137
+
138
+ Each model has its own dedicated request pipeline, so provider-specific options (like reasoning/thinking controls) are exposed properly instead of being flattened into one generic shape.
139
+
140
+ ---
141
+
142
+ ## ⌨️ CLI
143
+
144
+ Everything is also drivable from the terminal via the global `waifus` command:
145
+
146
+ | Command | What it does |
147
+ | ------------------ | ------------------------------------------------------- |
148
+ | `waifus start` | Boot the backend + dashboard. |
149
+ | `waifus stop` | Stop the running app. |
150
+ | `waifus restart` | Restart it. |
151
+ | `waifus status` | Show whether it's running and where. |
152
+ | `waifus doctor` | Health check (incl. whether bundled OCR is usable). |
153
+ | `waifus clean` | Delete saved user data (use intentionally!). |
154
+ | `waifus update` | Update the installed package. |
155
+
156
+ Common flags: `--host 127.0.0.1`, `--port 3888`, `--data-root PATH`.
157
+
158
+ `waifus update` updates the installed package (default `--npm`); use `waifus update --github` to pull the latest release `.tgz`. Set `DC_WAIFUS_HOME=PATH` to override the default `~/.dc-waifus` data root.
159
+
160
+ ---
161
+
162
+ ## ⭐ Star History
163
+
164
+ If your server's waifus made you laugh, consider dropping a star — it genuinely helps. 💖
165
+
166
+ <div align="center">
167
+ <a href="https://star-history.com/#waifucave/discord-waifus&Date">
168
+ <img src="https://api.star-history.com/svg?repos=waifucave/discord-waifus&type=Date" alt="Star History Chart" width="600">
169
+ </a>
170
+ </div>
171
+
172
+ ---
173
+
174
+ ## 🧰 For developers
175
+
176
+ <details>
177
+ <summary>Build from source, run in dev mode, and where data lives</summary>
178
+
179
+ <br>
180
+
181
+ **Build & run from source:**
182
+
183
+ ```sh
184
+ git clone https://github.com/waifucave/discord-waifus.git
185
+ cd discord-waifus
186
+ npm install
187
+ npm run build
188
+ npm run waifus -- start
189
+ ```
190
+
191
+ **Local development** (backend in dev + Vite dashboard on `:5173` proxying `/api` to `127.0.0.1:3888`):
192
+
193
+ ```sh
194
+ npm run waifus -- dev
195
+ npm run dev:frontend
196
+ ```
197
+
198
+ **Data layout** — runtime and user config live under `~/.dc-waifus`:
199
+
200
+ ```text
201
+ ~/.dc-waifus/config.toml
202
+ ~/.dc-waifus/user/providers.json
203
+ ~/.dc-waifus/user/discord-bots.json
204
+ ~/.dc-waifus/user/waifus/
205
+ ~/.dc-waifus/user/servers/
206
+ ~/.dc-waifus/user/memories.json
207
+ ~/.dc-waifus/app/logs/
208
+ ~/.dc-waifus/app/cache/ocr/
209
+ ~/.dc-waifus/app/tmp/ocr/
210
+ ```
211
+
212
+ **Architecture & contributor notes:** see [`CLAUDE.md`](CLAUDE.md) and [`AGENTS.md`](AGENTS.md). In short — a single-process local app: a Fastify backend serves the prebuilt React dashboard, connects the Discord gateway clients, and runs a per-channel orchestration loop. User data is revisioned JSON under `~/.dc-waifus/user/`.
213
+
214
+ </details>
215
+
216
+ ---
217
+
218
+ ## 📄 License
219
+
220
+ Discord Waifus is released under the **MIT License** — see [`LICENSE`](LICENSE).
221
+
222
+ The bundled OCR runtime (`tesseract.js` / `tesseract.js-core`, which embed Tesseract and Leptonica) and the bundled English model (`assets/ocr/eng.traineddata`) are third-party components under the **Apache License 2.0**; see [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
223
+
224
+ <div align="center">
225
+
226
+ <br>
227
+
228
+ *Made for chaotic group chats. 🌙*
229
+
230
+ </div>
@@ -0,0 +1,26 @@
1
+ # Third-Party Notices
2
+
3
+ Discord Waifus (`@starlight-ai/discord-waifus`) is licensed under the MIT
4
+ License. It bundles and depends on the following third-party components for its
5
+ optional image-text (OCR) feature.
6
+
7
+ ## tesseract.js and tesseract.js-core
8
+
9
+ - License: Apache License 2.0
10
+ - Source: https://github.com/naptha/tesseract.js
11
+
12
+ `tesseract.js-core` is a WebAssembly build that embeds:
13
+
14
+ - **Tesseract OCR** — Apache License 2.0 — https://github.com/tesseract-ocr/tesseract
15
+ - **Leptonica** — BSD-2-Clause-like license — https://github.com/DanBloomberg/leptonica
16
+
17
+ ## English trained data (`assets/ocr/eng.traineddata`)
18
+
19
+ - License: Apache License 2.0
20
+ - Source: https://github.com/tesseract-ocr/tessdata
21
+
22
+ The bundled model lets OCR run fully offline, without downloading language data
23
+ at runtime.
24
+
25
+ Each component is distributed under its own license; the full license texts are
26
+ available at the source URLs above.
Binary file
package/bin/waifus.mjs ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import path from "node:path";
5
+ import { pathToFileURL, fileURLToPath } from "node:url";
6
+
7
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
8
+ const compiled = path.join(root, "dist", "cli", "main.js");
9
+ const source = path.join(root, "src", "cli", "main.ts");
10
+
11
+ if (existsSync(compiled)) {
12
+ await import(pathToFileURL(compiled).href);
13
+ } else if (existsSync(source)) {
14
+ const tsxBin = path.join(
15
+ root,
16
+ "node_modules",
17
+ ".bin",
18
+ process.platform === "win32" ? "tsx.cmd" : "tsx"
19
+ );
20
+
21
+ if (!existsSync(tsxBin)) {
22
+ console.error(
23
+ "waifus is not built yet and local tsx is missing. Run `npm install`, then `npm run build` or retry the command."
24
+ );
25
+ process.exit(1);
26
+ }
27
+
28
+ const result = spawnSync(tsxBin, [source, ...process.argv.slice(2)], {
29
+ cwd: root,
30
+ stdio: "inherit"
31
+ });
32
+ process.exit(result.status ?? 1);
33
+ } else {
34
+ console.error("waifus CLI entrypoint is missing. Reinstall @waifucave/discord-waifus.");
35
+ process.exit(1);
36
+ }
@@ -0,0 +1,9 @@
1
+ export declare class ApiError extends Error {
2
+ readonly statusCode: number;
3
+ readonly details?: unknown | undefined;
4
+ constructor(statusCode: number, message: string, details?: unknown | undefined);
5
+ }
6
+ export declare function badRequest(message: string, details?: unknown): ApiError;
7
+ export declare function notFound(message: string): ApiError;
8
+ export declare function conflict(message: string, details?: unknown): ApiError;
9
+ export declare function preconditionRequired(message: string): ApiError;
@@ -0,0 +1,23 @@
1
+ export class ApiError extends Error {
2
+ statusCode;
3
+ details;
4
+ constructor(statusCode, message, details) {
5
+ super(message);
6
+ this.statusCode = statusCode;
7
+ this.details = details;
8
+ this.name = "ApiError";
9
+ }
10
+ }
11
+ export function badRequest(message, details) {
12
+ return new ApiError(400, message, details);
13
+ }
14
+ export function notFound(message) {
15
+ return new ApiError(404, message);
16
+ }
17
+ export function conflict(message, details) {
18
+ return new ApiError(409, message, details);
19
+ }
20
+ export function preconditionRequired(message) {
21
+ return new ApiError(428, message);
22
+ }
23
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEtB;IAEA;IAHX,YACW,UAAkB,EAC3B,OAAe,EACN,OAAiB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,eAAU,GAAV,UAAU,CAAQ;QAElB,YAAO,GAAP,OAAO,CAAU;QAG1B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,OAAiB;IAC3D,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,OAAiB;IACzD,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { FastifyInstance } from "fastify";
2
+ import { Logger } from "../backend/logger.js";
3
+ import { RuntimeState } from "../backend/runtime.js";
4
+ import { RuntimeOrchestrator } from "../orchestration/runtime.js";
5
+ import { StorageService } from "../storage/storageService.js";
6
+ export type ApiServerOptions = {
7
+ dataRoot: string;
8
+ storage?: StorageService;
9
+ runtime: RuntimeState;
10
+ runtimeOrchestrator?: RuntimeOrchestrator;
11
+ runtimeControl?: {
12
+ getOrchestrator: () => RuntimeOrchestrator | undefined;
13
+ pause: () => Promise<void>;
14
+ resume: () => Promise<void>;
15
+ reload: (reason: string) => Promise<void>;
16
+ };
17
+ logger?: Logger;
18
+ };
19
+ export declare function createApiServer(options: ApiServerOptions): Promise<FastifyInstance>;