Commit Graph
28 Commits
Author SHA1 Message Date
9qeklajc f90e65aa09 fix breaking hermes config 2026-07-11 16:33:28 +02:00
redshiftandGitHub f9a85b3fc6 Merge pull request #38 from Routstr/feat/pi-integration-contexts
feat: add context window support to pi integration
2026-05-30 06:22:03 +00:00
redshift 17529e762e feat: add context window support to pi integration
- Add optional contextWindow field to PiModelEntry type
- Map model.context_length to contextWindow when available
- Add context_length to RoutstrModel type in registry
2026-05-30 14:04:24 +08:00
Jeroen UbbinkandClaude Sonnet 4.6 739034b043 fix(onboard): show integration menu and progress in terminal
The logger utility in this project is a file-only logger — every call to
logger.log() / logger.error() writes to ~/.routstrd/logs/YYYY-MM-DD.log
and produces no terminal output whatsoever. This is intentional and correct
for the background daemon (daemon/, start-daemon.ts), which has no attached
terminal.

However, the onboarding and integration code was mistakenly using logger.log
instead of console.log for all of its user-facing output:

- setupIntegration() printed the 1-6 integration menu with logger.log, so
  the user only ever saw the bare prompt 'Select integration [1]: ' with no
  options above it. The selection appeared to be broken.

- Every install*Integration function (opencode, openclaw, claudecode, hermes,
  pi) reported all progress and results with logger.log, so after picking an
  integration nothing appeared to happen.

- initDaemon() used logger.log for 'Initialization complete!' and the
  follow-up wallet instructions, so those were also silently dropped.

- installCocodOrExit() used logger.log for the 'cocod not found, installing'
  message and the success/failure result.

Fix: replace logger.log/logger.error with console.log/console.error in all
CLI-facing code paths (cli.ts, integrations/index.ts, and all five
integration installers). Remove the now-unused logger import from the five
integration files. The logger import in integrations/index.ts is kept because
refreshModelsAndIntegrations() is called by the daemon's internal scheduler
and correctly logs to file there.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:02:36 +02:00
redshift 10937f851c feat: add Hermes integration
- Add new installHermesIntegration to write ~/.hermes/config.yaml
- Prepend model block with base_url/api_key/default model at top
- Append custom_providers block at the bottom
- Use 3rd model in daemon list as default
- Add Hermes to setup menu and registry
2026-04-30 21:42:53 +05:30
redshift c1c72bc147 Add 'refresh' CLI command to refresh models and integrations
- Added 'routstrd refresh' command that:
  - Calls /v1/models?refresh=true to refresh routstr21 models
  - Calls runIntegrationsForClients() for all registered clients
- Fixed type signature in refreshModelsAndIntegrations (returns any[] not void)
- Imports getClientsList and runIntegrationsForClients in cli.ts
2026-04-30 12:04:13 +05:30
redshift a5d68ccd0d Extract refreshModelsAndIntegrations into src/integrations/index.ts
- Created reusable refreshModelsAndIntegrations() function that combines
  model refresh with client integration refresh
- Updated src/daemon/index.ts to use the new function in both the scheduled
  refresh job and the initial bootstrap refresh
- Merged two chained .then() calls into one in the initial bootstrap flow
- Removed redundant imports (runIntegrationsForClients, getClientsList) from
  daemon/index.ts since they're now encapsulated in the function
2026-04-30 11:56:09 +05:30
redshift 0dc40884a5 Simplify client creation: fetch list first instead of catch-and-fallback
Replace ensureDaemonClient (try-create → catch 'already exists' → fetch list) with
a single addDaemonClient that fetches the list first, checks if client exists,
then creates only if needed. Returns { client, created } in all cases.
2026-04-30 09:21:01 +05:30
redshift 366a129c3c refactor: move client logic from cli.ts and daemon-client.ts to clients.ts
- Moved addDaemonClient and ensureDaemonClient from daemon-client.ts to clients.ts
- Moved clients list/delete/add action handlers from cli.ts to clients.ts
- Updated cli.ts to call the new action functions from clients.ts
- Updated integrations/index.ts to import ensureDaemonClient from clients.ts
- Fixed circular dependency by having clients.ts import from ../integrations/registry instead of ../integrations
2026-04-29 23:14:10 +05:30
redshift 711a04f09d refactor: consolidate ensureDaemonClient in daemon-client.ts
- Move get-or-create client logic from integrations/index.ts into
  ensureDaemonClient() in daemon-client.ts as a generic utility.
- Update setupIntegration() and the CLI clients add --<integration>
  paths to use the new helper.
- Return { client, created } so callers can decide whether to log.
- Remove IntegrationClient alias and ensureIntegrationClient export.
2026-04-28 15:04:52 +05:30
redshift a207acb645 refactor: extract addDaemonClient to eliminate duplicate /clients/add calls
- Add shared DaemonClient type and addDaemonClient() helper in
daemon-client.ts as the single source for POST /clients/add.
- Update ensureIntegrationClient() to use the new helper.
- Update CLI clients add command to use the new helper.
- Keeps existing error handling and 'already exists' fallback in
ensureIntegrationClient().
2026-04-28 14:34:12 +05:30
redshift f9a7db9ae0 refactor: create integration clients through daemon instead of local sqlite
- clients add --pi-agent/--opencode/--openclaw/--claude-code now call
  /clients/add on the daemon instead of writing to local Bun SQLite
- add ensureIntegrationClient helper that creates via daemon and falls
  back to fetching existing client on 409
- update install*Integration signatures to accept apiKey instead of SdkStore
- update onboard setupIntegration to use daemon-backed path
- update daemon scheduled refresh to pass apiKeys directly
2026-04-28 13:08:00 +05:30
redshift 6461b0f84a fix(integrations): use remote daemon URL and callDaemon for client setups
- Export getDaemonBaseUrl from daemon-client for shared URL resolution
- Replace all hardcoded http://localhost: in client integrations
  (opencode, claudecode, openclaw, pi) with getDaemonBaseUrl(config)
- Replace raw fetch(http://localhost:/models) with callDaemon("/models")
  so model fetching works with remote daemons and gets NIP-98 signed
- Fix clients add command output to print the actual daemon base URL
  instead of hardcoded localhost
2026-04-28 10:07:20 +05:30
redshift 3a81b97371 models read frmo routstr21 2026-04-23 17:09:27 +05:30
redshift 5c9665eaea added claude integration 2026-04-20 20:05:06 +02:00
redshift 5e984e3f5e routstrd skill. decreased refresh interval to 21 mins.
centralized config in registry.
2026-04-03 23:50:10 +02:00
redshift d1574b6e9c integrations are updated automatically on model refresh. 2026-04-03 14:56:40 +02:00
redshift ed01942391 everything works as expected OOOOOFF 2026-03-21 20:44:46 +00:00
redshift cb793be8de integrations with unique api keys 2026-03-21 13:22:30 +00:00
redshift e299c80d5b refactored the daemon 2026-03-19 16:25:57 +00:00
redshift 052659350d added openclaw 2026-03-18 16:25:59 +00:00
redshift 1b5a456189 removed alias, model ids and apikey 2026-03-04 10:47:23 +00:00
redshift 1b005a9802 lcoalhost url 2026-03-04 10:30:45 +00:00
redshift 95769a51fe fixed hanging 2026-03-04 10:21:22 +00:00
redshift e2b25eeaa5 fix 2026-03-04 10:20:16 +00:00
redshift 6941d547d2 added openclaw and fixed status for different ports. 2026-03-04 09:54:20 +00:00
redshift e131fd4d94 added the models endpoint 2026-03-04 08:43:43 +00:00
redshift bc20df04f2 added small model and fixed cli init a bit . 2026-03-03 12:36:58 +00:00