Commit Graph
33 Commits
Author SHA1 Message Date
redshift f427cc75ea feat: pass routstrPubkey from config to routeRequests when set 2026-05-14 17:43:30 +05:30
redshift bcbf5bfc44 feat(daemon): wire SdkLogger through daemon with per-request reqId prefixing
- daemon/index.ts: add makeSdkLogger() factory, wire daemonSdkLogger into
  createBunSqliteDriver, createProviderRegistryFromStore, ModelManager, ProviderManager
- daemon/http/index.ts: add makeSdkLogger() factory, generate per-request
  reqId via randomBytes(4), pass reqLogger = sdkLogger.child("req:${reqId}")
  to routeRequests so every log line from a request is prefixed [req:XXXXXXXX]
- start-daemon.ts: remove >> logfile 2>&1 redirect and getTodayLogFile();
  all file logging now goes through the daemon's writeLog() with daily rotation

Result: Every log line from a request is prefixed [req:XXXXXXXX], all entries
have [ISO] [INFO/ERROR/DEBUG] timestamps, no duplicates, and the log file
rotates correctly at midnight.
2026-05-08 19:20:00 +08:00
redshift 306dec5943 feat(clients): support ownerNpub field and remove CLI-side suffixing
- Add ownerNpub?: string to ClientEntry and DaemonClient interfaces
- Update getClientsFromStore() to preserve ownerNpub field
- GET /clients: include ownerNpub in daemon response
- POST /clients/add: accept and store ownerNpub from auth proxy
- Remove getNpubSuffix/addSuffixToId/removeSuffixFromId from clients.ts (moved to auth proxy)
- Remove CLI-side suffixing in addDaemonClient and deleteClientAction
- Remove config loading from getClientsList (no longer needed for filtering)
- CLI output now shows raw client IDs without suffix stripping
2026-05-03 15:04:57 +08:00
redshift fc7113be4b refactor: read clients list through abstraction for local and remote mode
Replace direct store.getState().clientIds access with a shared utility:
- getClientsFromStore(store) for daemon/local usage
- getClientsList() for remote CLI usage via daemon API

This ensures integration refresh logic and client management work
consistently whether running inside the daemon or connecting to a
remote daemon where store access is unavailable.

Updated:
- src/daemon/index.ts: use getClientsFromStore for integration refresh
- src/daemon/http/index.ts: use getClientsFromStore in /clients endpoints
- src/utils/daemon-client.ts: use getClientsList in ensureDaemonClient
- src/cli.ts: use getClientsList in clients list command
2026-04-28 15:22:21 +05:30
redshift 97302af836 feat(daemon): make client id required in /clients/add endpoint 2026-04-28 14:48:59 +05:30
redshift 2b6876ccd6 feat: add clients delete command
Add 'routstrd clients delete <id>' CLI command and POST /clients/delete
HTTP endpoint to remove a client by its ID.
2026-04-27 19:22:56 +05:30
redshift 3a5d760b37 replaced routeRequestsNodeResponse with just routeRequests. 2026-04-22 23:39:57 +05:30
redshift 9ece12d565 removed duplicate entries for rpoviders and clients endpoints. 2026-04-21 08:10:56 +02:00
redshift 7d439967ce feat(models): add model provider lookup with pricing info
Add -m/--model option to models serving a
specific model with their pricing details (prompt, completion, request,
max_cost in sats). Providers are sorted by max_cost (cheapest first).

New endpoint: GET /models/:id/providers
New function: getModelProviders() in model service
2026-04-09 16:45:32 +01:00
redshift c04eaf0981 provdier list debugging 2026-04-03 13:11:04 +02:00
redshift fcae75fa7c provider manage instnace is now persisted across calls. 2026-04-01 21:11:19 +02:00
redshift fe61ea43c0 fix: remove createUsageTracker, use usageTrackingDriver consistently
- Removed broken merge artifact with createUsageTracker
- Updated createDaemonRequestHandler to use usageTrackingDriver for all usage tracking
- Added walletClient to deps type
- Removed unused runWalletCommand and parseBalances from deps type
- Cleaned up unused imports in daemon/index.ts
2026-04-01 16:18:06 +02:00
redshift 243967f7a5 fixing merge issues 2026-04-01 16:14:11 +02:00
redshift dca3ca992f Merge branch 'wallet-integration' of github.com-red:Routstr/routstrd 2026-04-01 15:55:35 +02:00
redshift 849a4b6850 fixed the data limit 2026-03-30 21:54:57 +01:00
redshift 07adab2265 added a way to add clients 2026-03-30 21:06:30 +01:00
redshift e03342d119 fixed v1/messages pass thorugh bug 2026-03-28 19:12:01 +00:00
redshift cb699a3882 added a way to disable providers 2026-03-28 18:17:39 +00:00
redshift f1b388ef43 removed lazyrefund completely 2026-03-28 14:02:19 +00:00
redshift d5656e488c fixed legacySDK reading 2026-03-28 11:09:42 +00:00
redshift 020606d276 fixed usage tracking db 2026-03-28 08:42:25 +00:00
redshift 631f5832a1 checkpoint 2026-03-26 17:22:03 +00:00
redshift 44e439631e debug logs from sdk are now shown in routstrd logs 2026-03-23 13:24:19 +00:00
Evan Yang 851e35c3cd Return 400 for invalid wallet JSON bodies 2026-03-23 11:02:52 +08:00
Evan Yang 10a6c5c131 Merge origin/main into wallet-integration 2026-03-23 10:43:48 +08:00
redshift d4c578c246 removed logs 2026-03-22 15:31:17 +00:00
redshift 57aa6c2387 tui: display system status and mode in overview tab
- Add mode to /status endpoint response
- Add fetchStatus() to retrieve daemon status
- Display System Status box next to Balance box in overview tab
- Show daemon state, wallet state, and current mode
- Color code status values (green/red for healthy/error states)
2026-03-22 13:04:44 +00:00
redshift 310e7076c3 Add mode parameter to routeRequests and CLI command
- Add mode config option (xcashu, lazyrefund, apikeys) to RoutstrdConfig
- Pass mode parameter to routeRequests in daemon HTTP handler
- Add 'routstrd mode' CLI command to set mode interactively
- Mode command shows current mode, prompts for selection, updates config,
  and restarts the daemon
2026-03-21 22:07:28 +00:00
redshift ed01942391 everything works as expected OOOOOFF 2026-03-21 20:44:46 +00:00
redshift 0cb95cdae2 feat(daemon): include client ID in usage tracking entries
- Add getClientIdFromRequest helper to extract API key from Authorization header
- Look up clientId from store's clientIds array
- Include client field in both streaming and non-streaming usage entries
- Enables per-client usage tracking for integrations
2026-03-21 16:42:59 +00:00
Evan Yang 76ce27d518 Add cocod-backed wallet integration 2026-03-21 12:40:47 +08:00
redshift 473565ed23 readded mdoels refresh functionality 2026-03-19 22:00:29 +00:00
redshift e299c80d5b refactored the daemon 2026-03-19 16:25:57 +00:00