orbitchat 3.0.0 → 3.1.1

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 (62) hide show
  1. package/README.md +93 -90
  2. package/bin/orbitchat.js +517 -430
  3. package/dist/assets/{ChartRenderer-B1mYF_kk.js → ChartRenderer-CapBCpbV.js} +1 -1
  4. package/dist/assets/{MermaidRenderer-Dhffx5mc.js → MermaidRenderer-DQJRirnm.js} +5 -5
  5. package/dist/assets/{MusicRenderer-DbXJ8e4-.js → MusicRenderer-9vnA54gg.js} +2 -2
  6. package/dist/assets/{SVGRenderer-EhamRX_K.js → SVGRenderer-By7CKtqU.js} +1 -1
  7. package/dist/assets/{_basePickBy-C2AibBqo.js → _basePickBy-Dm-zx8im.js} +1 -1
  8. package/dist/assets/{_baseUniq-D52pUSvn.js → _baseUniq-DLPvoy-d.js} +1 -1
  9. package/dist/assets/{architectureDiagram-VXUJARFQ-BLMvVsZu.js → architectureDiagram-VXUJARFQ-B1kMlTMW.js} +1 -1
  10. package/dist/assets/{blockDiagram-VD42YOAC-CTz0dv5u.js → blockDiagram-VD42YOAC-BlglDb-U.js} +1 -1
  11. package/dist/assets/{c4Diagram-YG6GDRKO-BjbN-GGh.js → c4Diagram-YG6GDRKO-CaZm--Yy.js} +1 -1
  12. package/dist/assets/channel-BjUDQMqf.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-DEMWGIsU.js → chunk-4BX2VUAB-4Kq-2AyN.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-BYaauHLT.js → chunk-55IACEB6-FApueVFk.js} +1 -1
  15. package/dist/assets/{chunk-B4BG7PRW-D3_GFcfd.js → chunk-B4BG7PRW-CHox7be9.js} +1 -1
  16. package/dist/assets/{chunk-DI55MBZ5-Dy2EuzfA.js → chunk-DI55MBZ5-N5sePLFo.js} +1 -1
  17. package/dist/assets/{chunk-FMBD7UC4-C9XHmwza.js → chunk-FMBD7UC4-BSbBs0xy.js} +1 -1
  18. package/dist/assets/{chunk-QN33PNHL-BOCltIi9.js → chunk-QN33PNHL-ByurI9-W.js} +1 -1
  19. package/dist/assets/{chunk-QZHKN3VN-CvA964eQ.js → chunk-QZHKN3VN-Yy8VVut9.js} +1 -1
  20. package/dist/assets/{chunk-TZMSLE5B-B-3rZz90.js → chunk-TZMSLE5B-B5oe8pT4.js} +1 -1
  21. package/dist/assets/classDiagram-2ON5EDUG-BhHCvLfM.js +1 -0
  22. package/dist/assets/classDiagram-v2-WZHVMYZB-BhHCvLfM.js +1 -0
  23. package/dist/assets/clone-oQOn4Sap.js +1 -0
  24. package/dist/assets/{cose-bilkent-S5V4N54A-CzPip3he.js → cose-bilkent-S5V4N54A-DS_-k6qR.js} +1 -1
  25. package/dist/assets/{dagre-6UL2VRFP-CfCXYus3.js → dagre-6UL2VRFP-DgkwJjVY.js} +1 -1
  26. package/dist/assets/{diagram-PSM6KHXK-DyI2eDqp.js → diagram-PSM6KHXK-C9su64f9.js} +1 -1
  27. package/dist/assets/{diagram-QEK2KX5R-DuakIh40.js → diagram-QEK2KX5R-DY6-9Dbc.js} +1 -1
  28. package/dist/assets/{diagram-S2PKOQOG-C3-4IORM.js → diagram-S2PKOQOG-_Wub-Eik.js} +1 -1
  29. package/dist/assets/{erDiagram-Q2GNP2WA-Dt-nZEaD.js → erDiagram-Q2GNP2WA-Gwx9nSAM.js} +1 -1
  30. package/dist/assets/{flowDiagram-NV44I4VS-B-2wjyTQ.js → flowDiagram-NV44I4VS-DmrXTF_S.js} +1 -1
  31. package/dist/assets/{ganttDiagram-JELNMOA3-CHTvjPq0.js → ganttDiagram-JELNMOA3-DymVUgsd.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-V2S2FVAM-d5GWmgY4.js → gitGraphDiagram-V2S2FVAM-D3VSQFT4.js} +1 -1
  33. package/dist/assets/{graph-COgkbiU8.js → graph-BIe-N9yO.js} +1 -1
  34. package/dist/assets/index-B-NnBj1Y.js +624 -0
  35. package/dist/assets/index-BA5Mw76S.css +1 -0
  36. package/dist/assets/{index-DN2bBcCs.js → index-BiM6VNSE.js} +1 -1
  37. package/dist/assets/{infoDiagram-HS3SLOUP-30Hn0iLj.js → infoDiagram-HS3SLOUP-D2DeUrgk.js} +1 -1
  38. package/dist/assets/{journeyDiagram-XKPGCS4Q-CMOYXQ79.js → journeyDiagram-XKPGCS4Q-GxFhv1XB.js} +1 -1
  39. package/dist/assets/{kanban-definition-3W4ZIXB7-dt3376cq.js → kanban-definition-3W4ZIXB7-BhT-ga9I.js} +1 -1
  40. package/dist/assets/{layout-DH97sy5g.js → layout-38O87Ivt.js} +1 -1
  41. package/dist/assets/{mindmap-definition-VGOIOE7T-BcZHPAlA.js → mindmap-definition-VGOIOE7T-DfKjmcaV.js} +1 -1
  42. package/dist/assets/{pieDiagram-ADFJNKIX-DXjvgcgl.js → pieDiagram-ADFJNKIX-D7lDWRGN.js} +1 -1
  43. package/dist/assets/{quadrantDiagram-AYHSOK5B-CICk2FdS.js → quadrantDiagram-AYHSOK5B-CPtZ8LgW.js} +1 -1
  44. package/dist/assets/{requirementDiagram-UZGBJVZJ-BdtxpQRA.js → requirementDiagram-UZGBJVZJ-h-H7R8sR.js} +1 -1
  45. package/dist/assets/{sankeyDiagram-TZEHDZUN-BVNS9BQJ.js → sankeyDiagram-TZEHDZUN-C6cn5g4m.js} +1 -1
  46. package/dist/assets/{sequenceDiagram-WL72ISMW-DF4fJTM7.js → sequenceDiagram-WL72ISMW-B6AwcQ4F.js} +1 -1
  47. package/dist/assets/{stateDiagram-FKZM4ZOC-C8H8HujX.js → stateDiagram-FKZM4ZOC-B4ne7z3I.js} +1 -1
  48. package/dist/assets/stateDiagram-v2-4FDKWEC3-C_qp8U90.js +1 -0
  49. package/dist/assets/{timeline-definition-IT6M3QCI-DUSG5Vfy.js → timeline-definition-IT6M3QCI-BmjJnJ-r.js} +1 -1
  50. package/dist/assets/treemap-GDKQZRPO-CBUbyJIX.js +160 -0
  51. package/dist/assets/{xychartDiagram-PRI3JC2R-CFPJj8WK.js → xychartDiagram-PRI3JC2R-C3lVgboM.js} +1 -1
  52. package/dist/index.html +2 -2
  53. package/orbitchat.sh +305 -0
  54. package/package.json +6 -2
  55. package/dist/assets/channel-ryTtfXZE.js +0 -1
  56. package/dist/assets/classDiagram-2ON5EDUG-VbShFIzz.js +0 -1
  57. package/dist/assets/classDiagram-v2-WZHVMYZB-VbShFIzz.js +0 -1
  58. package/dist/assets/clone-BlhdKVDQ.js +0 -1
  59. package/dist/assets/index-DtztdW2a.js +0 -643
  60. package/dist/assets/index-lGqyWNWb.css +0 -1
  61. package/dist/assets/stateDiagram-v2-4FDKWEC3-DwtU033b.js +0 -1
  62. package/dist/assets/treemap-GDKQZRPO-1PI2PY4S.js +0 -160
package/README.md CHANGED
@@ -16,6 +16,10 @@ Or install locally:
16
16
  npm install orbitchat
17
17
  ```
18
18
 
19
+ Installed CLI commands:
20
+ - `orbitchat` — starts the ORBIT Chat server directly
21
+ - `orbitchat-daemon` — shell wrapper with `--start/--stop/--restart/--force-restart/--status`
22
+
19
23
  ## Quick Start
20
24
 
21
25
  1. Define your adapters (agents) via the `ORBIT_ADAPTERS` or `VITE_ADAPTERS` environment variable:
@@ -27,7 +31,7 @@ npm install orbitchat
27
31
 
28
32
  2. Run the CLI:
29
33
  ```bash
30
- orbitchat --enable-upload --port 5173
34
+ orbitchat --config ./orbitchat.yaml --port 5173
31
35
  ```
32
36
 
33
37
  3. Open `http://localhost:5173` — select an agent and start chatting.
@@ -50,49 +54,21 @@ The frontend never handles API keys. Instead:
50
54
  orbitchat [options]
51
55
 
52
56
  Options:
53
- --api-url URL Default backend URL (default: http://localhost:3000)
54
- --default-adapter NAME Adapter to preselect for new conversations
55
- --application-name NAME Name shown in browser tab (default: ORBIT Chat)
56
- --application-description TEXT Subtitle shown under the welcome heading
57
- --default-input-placeholder TEXT Message input placeholder (default: Message ORBIT...)
58
- --console-debug Enable console debug logging (default: false)
59
- --enable-upload Enable file upload button (default: false)
60
- --enable-audio Enable audio output button (default: false)
61
- --enable-audio-input Enable microphone input button (default: false)
62
- --enable-feedback Enable feedback buttons (default: false)
63
- --enable-autocomplete Enable autocomplete suggestions (default: false)
64
- --voice-silence-timeout-ms N Auto-stop voice capture after N ms of silence (default: 4000)
65
- --voice-recognition-lang LANG Speech recognition language code (default: browser locale)
66
- --out-of-service-message TEXT Show maintenance screen blocking access
67
- --max-files-per-conversation N Max files per conversation (default: 5)
68
- --max-file-size-mb N Max file size in MB (default: 50)
69
- --max-total-files N Max total files (default: 100, 0 = unlimited)
70
- --max-conversations N Max conversations (default: 10, 0 = unlimited)
71
- --max-messages-per-conversation N Max messages per conversation (default: 1000, 0 = unlimited)
72
- --max-messages-per-thread N Max messages per thread (default: 1000, 0 = unlimited)
73
- --max-total-messages N Max total messages (default: 10000, 0 = unlimited)
74
- --max-message-length N Max message length (default: 1000)
75
- --port PORT Server port (default: 5173)
76
- --host HOST Server host (default: localhost)
77
- --open Open browser automatically
78
- --api-only Run API proxy only (no UI serving, no build required)
79
- --cors-origin ORIGIN Allowed CORS origin in api-only mode (default: *)
80
- --config PATH Path to config file (default: ~/.orbit-chat-app/config.json)
81
- --help, -h Show help message
82
- --version, -v Show version number
57
+ --port PORT Server port (default: 5173)
58
+ --host HOST Server host (default: localhost)
59
+ --open Open browser automatically
60
+ --config PATH Path to orbitchat.yaml (default: ./orbitchat.yaml)
61
+ --api-only Run API proxy only (no UI serving)
62
+ --cors-origin URL Allowed CORS origin in api-only mode (default: *)
63
+ --help, -h Show help message
64
+ --version, -v Show version number
83
65
  ```
84
66
 
85
67
  ### Examples
86
68
 
87
69
  ```bash
88
- # Start with custom API URL and port
89
- orbitchat --api-url http://localhost:3000 --port 8080
90
-
91
- # Start with upload, audio output, mic input, and autocomplete enabled
92
- orbitchat --enable-upload --enable-audio --enable-audio-input --enable-autocomplete --open
93
-
94
70
  # Start with a custom config file
95
- orbitchat --config /path/to/config.json
71
+ orbitchat --config /path/to/orbitchat.yaml
96
72
 
97
73
  # Start with adapters defined inline
98
74
  ORBIT_ADAPTERS='[{"name":"Chat","apiKey":"mykey","apiUrl":"https://api.example.com"}]' orbitchat
@@ -204,11 +180,11 @@ Each adapter object supports:
204
180
  |-------|----------|-------------|
205
181
  | `name` | Yes | Display name shown in the agent selector |
206
182
  | `apiKey` | Yes | Backend API key (never exposed to the browser) |
207
- | `apiUrl` | No | Backend URL (defaults to `--api-url` value) |
183
+ | `apiUrl` | No | Backend URL (defaults to `api.url` in `orbitchat.yaml`, then `http://localhost:3000`) |
208
184
  | `description` | No | Short summary shown in dropdowns |
209
185
  | `notes` | No | Markdown content shown in the chat empty state |
210
186
 
211
- If `--default-adapter` is not specified, the first adapter in the list is preselected for new conversations.
187
+ If `api.defaultAdapter` is not set (or left as `default-key`), the first adapter in the list is used.
212
188
 
213
189
  ### Agent Selector UX
214
190
 
@@ -219,56 +195,38 @@ If `--default-adapter` is not specified, the first adapter in the list is presel
219
195
 
220
196
  ## Configuration
221
197
 
222
- ### Configuration Priority
223
-
224
- Configuration is loaded in the following priority order:
225
- 1. CLI arguments (highest priority)
226
- 2. Config file (`~/.orbit-chat-app/config.json`)
227
- 3. Environment variables (`VITE_*`)
228
- 4. Default values (lowest priority)
229
-
230
- ### Configuration File
231
-
232
- Create a config file at `~/.orbit-chat-app/config.json`:
233
-
234
- ```json
235
- {
236
- "apiUrl": "http://localhost:3000",
237
- "defaultKey": "Simple Chat",
238
- "port": 5173,
239
- "host": "localhost",
240
- "enableUploadButton": false,
241
- "enableFeedbackButtons": false,
242
- "maxFilesPerConversation": 5,
243
- "maxFileSizeMB": 50,
244
- "maxTotalFiles": 100,
245
- "maxConversations": 10,
246
- "maxMessagesPerConversation": 1000,
247
- "maxTotalMessages": 10000,
248
- "maxMessageLength": 1000
249
- }
250
- ```
198
+ ### Runtime Config File
199
+
200
+ Runtime settings are loaded from `orbitchat.yaml` (see `orbitchat.yaml.example`).
251
201
 
252
- > **Note:** `defaultKey` should be set to an adapter name (e.g. `"Simple Chat"`). If left as `"default-key"` or empty, the app falls back to the first adapter in `ORBIT_ADAPTERS`.
202
+ Config lookup:
203
+ 1. `--config /path/to/orbitchat.yaml` if provided
204
+ 2. `./orbitchat.yaml` (current working directory)
205
+
206
+ Header logo (`header.logoUrl`) supports:
207
+ - Remote URLs, for example `https://example.com/logo.png`
208
+ - Local file paths (absolute or relative to `orbitchat.yaml`), for example `./public/logo.png`
209
+
210
+ When a local file path is used, the CLI serves it on an internal route (`/__orbitchat_assets/...`) at runtime.
253
211
 
254
212
  ### Environment Variables
255
213
 
256
- For development, set configuration via environment variables:
214
+ Adapter secrets are provided via environment variables:
257
215
 
258
216
  ```bash
259
- VITE_API_URL=http://localhost:3000
260
- VITE_DEFAULT_KEY=Simple Chat # Adapter name to preselect
261
- VITE_ENABLE_UPLOAD=false
262
- VITE_ENABLE_AUDIO_OUTPUT=false
263
- VITE_ENABLE_AUDIO_INPUT=false
264
- VITE_VOICE_SILENCE_TIMEOUT_MS=4000
265
- VITE_VOICE_RECOGNITION_LANG=
266
- VITE_ENABLE_FEEDBACK=false
267
- VITE_ENABLE_AUTOCOMPLETE=false
268
- VITE_CONSOLE_DEBUG=false
217
+ ORBIT_ADAPTERS='[{"name":"Simple Chat","apiKey":"default-key","apiUrl":"http://localhost:3000"}]'
269
218
  ```
270
219
 
271
- > **Note:** GitHub stats and owner/repo are hardcoded and only configurable via build-time environment variables (`VITE_SHOW_GITHUB_STATS`, `VITE_GITHUB_OWNER`, `VITE_GITHUB_REPO`) for developers who fork the repository.
220
+ - `ORBIT_ADAPTERS` is preferred.
221
+ - `VITE_ADAPTERS` is also supported for compatibility.
222
+ - If both are set, `ORBIT_ADAPTERS` takes precedence.
223
+
224
+ Auth secrets are read from:
225
+ - `VITE_AUTH_DOMAIN`
226
+ - `VITE_AUTH_CLIENT_ID`
227
+ - `VITE_AUTH_AUDIENCE`
228
+
229
+ The CLI also loads `.env` and `.env.local` from the current working directory on startup.
272
230
 
273
231
  ## Development
274
232
 
@@ -307,13 +265,40 @@ orbitchat --port 8080
307
265
 
308
266
  ### Running as a Daemon
309
267
 
310
- Use the included `run-chat-app.sh` script:
268
+ For npm package installs, use:
269
+
270
+ ```bash
271
+ orbitchat-daemon --start # Start in background
272
+ orbitchat-daemon --start 8080 # Start on custom port
273
+ orbitchat-daemon --stop # Stop
274
+ orbitchat-daemon --status # Check status
275
+ ```
276
+
277
+ From a source checkout, you can also run:
278
+
279
+ ```bash
280
+ ./orbitchat.sh --start
281
+ ```
282
+
283
+ Daemon state files:
284
+ - Default PID/log directory: `$XDG_STATE_HOME/orbitchat` or `~/.local/state/orbitchat`
285
+ - Override with: `ORBITCHAT_STATE_DIR=/path/to/state`
311
286
 
287
+ Daemon examples with config:
312
288
  ```bash
313
- ./run-chat-app.sh --start # Start in background
314
- ./run-chat-app.sh --start 8080 # Start on custom port
315
- ./run-chat-app.sh --stop # Stop
316
- ./run-chat-app.sh --status # Check status
289
+ orbitchat-daemon --config /home/ubuntu/orbitchat/orbitchat.yaml --start
290
+ orbitchat-daemon --config /home/ubuntu/orbitchat/orbitchat.yaml --force-restart
291
+ ```
292
+
293
+ Using `sudo`:
294
+ - `sudo` may drop environment variables (including `ORBIT_ADAPTERS`).
295
+ - Preserve adapter env explicitly:
296
+ ```bash
297
+ sudo --preserve-env=ORBIT_ADAPTERS orbitchat-daemon --config /home/ubuntu/orbitchat/orbitchat.yaml --start
298
+ ```
299
+ - If needed, set writable daemon state dir explicitly:
300
+ ```bash
301
+ sudo ORBITCHAT_STATE_DIR=/var/tmp/orbitchat orbitchat-daemon --config /home/ubuntu/orbitchat/orbitchat.yaml --start
317
302
  ```
318
303
 
319
304
  ## Available Scripts
@@ -394,6 +379,22 @@ If the agent selector shows no adapters:
394
379
  2. Check the CLI startup logs for "Available Adapters: ..."
395
380
  3. Verify each adapter has a `name` and `apiKey` field
396
381
 
382
+ If adapters load but descriptions/notes are missing in packaged installs (`npm pack` + install), while `npm run dev` works:
383
+ 1. Prefer `ORBIT_ADAPTERS` (it takes precedence over `VITE_ADAPTERS` when both are set)
384
+ 2. Ensure `orbitchat.yaml` contains adapter metadata and adapter `name` values exactly match `ORBIT_ADAPTERS`
385
+ 3. Rebuild and repack from the updated source: `npm run build && npm pack`
386
+ 4. Reinstall the newly generated tarball
387
+ 5. Restart with a clean process/port: `orbitchat-daemon --force-restart` (or `./orbitchat.sh --force-restart` in source checkout)
388
+ 6. Verify runtime output:
389
+ - Startup log shows `Available Adapters: ...`
390
+ - `GET /api/adapters` returns `description`/`notes` for each adapter
391
+
392
+ If logs show an adapter not in your current config (for example `Cross Domain`):
393
+ 1. Check startup log `Available Adapters: ...` to confirm what the server actually loaded
394
+ 2. Clear browser site data/localStorage for the app origin or open an incognito window
395
+ 3. Start a new conversation and reselect the agent
396
+ 4. Confirm requests no longer send stale `X-Adapter-Name` values
397
+
397
398
  ### File Upload Issues
398
399
 
399
400
  - **File size exceeded** — Check file size against the configured limit
@@ -405,9 +406,11 @@ If the agent selector shows no adapters:
405
406
 
406
407
  Enable debug logging:
407
408
  ```bash
408
- orbitchat --console-debug
409
+ # in orbitchat.yaml
410
+ debug:
411
+ consoleDebug: true
409
412
  ```
410
- Or set `VITE_CONSOLE_DEBUG=true` during development. This shows detailed API and file upload information in the browser console.
413
+ This enables detailed runtime logging from the CLI server.
411
414
 
412
415
  ## Deployment Checklist
413
416
 
@@ -416,4 +419,4 @@ Or set `VITE_CONSOLE_DEBUG=true` during development. This shows detailed API and
416
419
  3. **Run behind HTTPS** — use a reverse proxy like nginx or Caddy in front of `orbitchat`
417
420
  4. **Bind to the right interface**: use `--host 0.0.0.0` to allow external access, or keep the default `localhost` for local-only
418
421
  5. **Tune limits** — set `--max-conversations`, `--max-message-length`, etc. appropriate for your deployment
419
- 6. **Monitor logs** — use `run-chat-app.sh --start` for daemon mode with log file, or run directly and pipe to your log aggregator
422
+ 6. **Monitor logs** — use `orbitchat-daemon --start` for daemon mode with log file, or run directly and pipe to your log aggregator