omnigateway 0.1.6 → 0.1.7

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 (37) hide show
  1. package/README.md +24 -5
  2. package/bin/omni.js +454 -228
  3. package/gateway.js +225 -59
  4. package/package.json +1 -1
  5. package/public/assets/{Chip-Ccqsb_Mq.js → Chip-C69u2U_b.js} +2 -2
  6. package/public/assets/{CopyValue-cAwgC1sU.js → CopyValue-CJy2T0H6.js} +1 -1
  7. package/public/assets/{Field-Devm4K46.js → Field-Sc8mDqJv.js} +1 -1
  8. package/public/assets/{Lamp-BXSUIAtG.js → Lamp-7jD_9929.js} +2 -2
  9. package/public/assets/{Meter-Fn8X7t60.js → Meter-C0nUftAa.js} +2 -2
  10. package/public/assets/{Modal-Dqir9wBz.js → Modal-CiVHSJmm.js} +2 -2
  11. package/public/assets/Rack-CMqGBP4I.js +147 -0
  12. package/public/assets/{Readout-BKpOZIGX.js → Readout-Dv2dZWtI.js} +4 -4
  13. package/public/assets/{States-DBzsiHjQ.js → States-D55MhqMx.js} +10 -10
  14. package/public/assets/{Table-DPDJeeVc.js → Table-DBB3jdgi.js} +1 -1
  15. package/public/assets/{Toggle-BhViDMm9.js → Toggle-BoGjb5oi.js} +3 -3
  16. package/public/assets/_app-p5Mz7sXD.js +1 -0
  17. package/public/assets/_app.accounts-B5wMO9TH.js +51 -0
  18. package/public/assets/_app.console-Bka7AkiL.js +25 -0
  19. package/public/assets/_app.index-MnQuadXb.js +61 -0
  20. package/public/assets/_app.keys-BX8k8COP.js +39 -0
  21. package/public/assets/_app.logs-DD-sd4fn.js +33 -0
  22. package/public/assets/_app.models-CezFNL6y.js +144 -0
  23. package/public/assets/{_app.settings-DA1aYcR4.js → _app.settings-D1taAt8B.js} +3 -3
  24. package/public/assets/{_app.usage-DAyYUfIi.js → _app.usage-BRhEvwVr.js} +28 -28
  25. package/public/assets/index-vCuK1fRQ.js +170 -0
  26. package/public/assets/{login-DXHM-Noj.js → login-DaC-wVpI.js} +8 -8
  27. package/public/assets/{queries-BMwc6EvM.js → queries-2E6-CboE.js} +12 -12
  28. package/public/assets/{trash-2-JF_uX2gE.js → trash-2--aH2iKg-.js} +1 -1
  29. package/public/index.html +2 -2
  30. package/public/assets/Rack-XtfiZ6GC.js +0 -147
  31. package/public/assets/_app-B8lqq_ks.js +0 -1
  32. package/public/assets/_app.accounts-DSMHSYBF.js +0 -51
  33. package/public/assets/_app.index-DXH5sH41.js +0 -61
  34. package/public/assets/_app.keys-DdEyVy_b.js +0 -39
  35. package/public/assets/_app.logs-Camxditb.js +0 -33
  36. package/public/assets/_app.models-CuD-JtGS.js +0 -144
  37. package/public/assets/index-BtjyVE1i.js +0 -170
package/README.md CHANGED
@@ -167,6 +167,7 @@ installation other than the default.
167
167
  | `omni start` / `stop` / `restart` | run the gateway; `--foreground` attaches it to your terminal |
168
168
  | `omni doctor` | which installation it resolved, and whether it can act on it |
169
169
  | `omni logs` | recent requests as the gateway recorded them |
170
+ | `omni console` | the gateway process's own output: boot, refreshes, quota, errors |
170
171
  | `omni usage` | spend and tokens, by provider, model, key, or day |
171
172
  | `omni connect <provider>` | authorize an account from the terminal |
172
173
  | `omni credentials …` | list, show, enable, disable, retier, refresh, remove |
@@ -191,7 +192,7 @@ On a machine with systemd:
191
192
  ```bash
192
193
  omni service install --enable # writes a user unit for this installation
193
194
  omni start # from here on, start/stop delegate to systemctl
194
- omni logs --service # reads the journal
195
+ omni console # reads the journal (or the log file, without systemd)
195
196
  ```
196
197
 
197
198
  Use `--system` for a system-wide unit (needs root). Without systemd, `omni
@@ -212,19 +213,37 @@ Configuration is environment variables, read from the installation's `.env`:
212
213
  | `OMNI_BASE_URL` | No | derived from host and port | Public origin for OAuth callbacks; set this behind a reverse proxy |
213
214
  | `OMNI_STATIC_DIR` | No | the console shipped with the server | Serve a different console build |
214
215
  | `OMNI_LOG_LEVEL` | No | `info` | Stdout threshold: `debug`, `info`, `warn`, or `error` |
216
+ | `OMNI_LOG_FILE` | No | the systemd journal, when there is one | Where stdout was already redirected, so the Console screen can read it back. Names a file; does not create one |
215
217
 
216
- Gateway events are written to stdout as one greppable line each. At `info`, every completed
217
- request produces an access line alongside process lifecycle and error events. Use `debug` to see
218
- routing decisions, failover attempts, OAuth refreshes, quota probes, and upstream HTTP timing:
218
+ Gateway events are written to stdout as one greppable line each: process lifecycle, OAuth
219
+ refreshes, quota probes, failover, and errors. Completed requests are *not* among them they
220
+ are recorded in the database and read back through `omni logs` and the console's Logs screen.
221
+ Use `debug` to add routing decisions, per-attempt tracing, and upstream HTTP timing:
219
222
 
220
223
  ```text
221
- 2026-08-09T04:12:03.114Z INFO request done requestId=req_9f2 surface=anthropic status=200 provider=anthropic model=claude-opus-5 attempts=1 inputTokens=1204 outputTokens=88 durationMs=2100
224
+ 2026-08-09T04:12:04.881Z WARN attempt failed; retrying requestId=req_9f2 provider=anthropic attempt=1 code=UPSTREAM retryable=true
222
225
  ```
223
226
 
224
227
  Fields are a closed allowlist: logs never include request or response bodies, headers, OAuth
225
228
  tokens, API keys, admin passwords, or encryption keys. `OMNI_LOG_LEVEL` is read once at boot;
226
229
  an invalid value falls back to `info` and is reported in the boot log.
227
230
 
231
+ The Console screen and `omni console` show these lines. A process cannot read back its own
232
+ stdout, so both read whatever captured it: `OMNI_LOG_FILE` if set, otherwise the systemd
233
+ journal. Run the gateway in the foreground and its output goes to your terminal, where nothing
234
+ captured it — both surfaces say so rather than showing an empty log.
235
+
236
+ `OMNI_LOG_FILE` *names* where output was captured; it does not redirect it. Setting it alone
237
+ leaves the log empty, because the gateway still writes to stdout. Redirect the output and name
238
+ the same path:
239
+
240
+ ```bash
241
+ bun apps/gateway/src/index.ts >> /var/log/omni.log 2>&1
242
+ ```
243
+
244
+ `omni start` does both for the gateway it supervises, and under systemd the journal needs no
245
+ setup.
246
+
228
247
  Routing behaviour — weights, retry limits, request deadline, log retention,
229
248
  how often provider quota is polled — lives in the database, not the
230
249
  environment. Edit it with `omni settings set` or in the console.