@hasna/switcher 0.2.13 → 0.2.14
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.
- package/README.md +12 -0
- package/dist/cli/index.js +1470 -91
- package/dist/gateway-client.d.ts +84 -0
- package/dist/gateway-service.d.ts +60 -0
- package/dist/gateway-supervisor.d.ts +73 -0
- package/dist/harness-process.d.ts +1 -0
- package/dist/harness-types.d.ts +3 -1
- package/dist/inference-gateway.d.ts +25 -2
- package/dist/launcher.d.ts +11 -1
- package/dist/mcp/index.js +2 -2
- package/dist/process-table.d.ts +28 -0
- package/dist/serve/index.js +2 -2
- package/docs/GATEWAY-SERVICE.md +179 -0
- package/hasna.contract.json +1 -1
- package/openapi.json +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -619,6 +619,18 @@ Cline uses its native ACP backend with per-launch configuration, durable session
|
|
|
619
619
|
|
|
620
620
|
`switcher launch opencode --provider PROVIDER --model MODEL` selects legacy OpenCode 1.18.0 or newer, tested with 1.18.29. It is distinct from `opencode2` and uses the legacy singular-provider configuration schema. The adapter supplies the provider catalog, preserves supported native instructions and permission rules, and stores sessions per profile. Chat, Responses and Messages have controlled native tool/read/resume coverage. Use native `models` for its full provider-qualified catalog; visual picker acceptance is recorded separately.
|
|
621
621
|
|
|
622
|
+
## Background sessions and the persistent gateway
|
|
623
|
+
|
|
624
|
+
Launches register with one persistent gateway per user on a stable `127.0.0.1` port. A launch's token keeps working for as long as any process it started still runs, including Claude Code's detached background host and its background sessions after `switcher launch` exits. When nothing from the launch remains, the token is revoked. For the default `~/.hasna/switcher` home the gateway runs under launchd (macOS) or systemd `--user` (Linux), starts at login, and is installed automatically by the first launch of the installed `switcher`. Other homes and other copies of Switcher use a detached gateway that exits when idle.
|
|
625
|
+
|
|
626
|
+
```sh
|
|
627
|
+
switcher gateway status # running, pid, port, launches and login unit
|
|
628
|
+
switcher gateway install # install or refresh the login unit and start it
|
|
629
|
+
switcher gateway stop | uninstall
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
Provider credentials stay in gateway memory only. After a gateway restart, a credential from `switcher credentials bind` is read again; an environment-only credential is not recoverable, and its sessions get a 401 naming the fix instead of a refused connection. `SWITCHER_GATEWAY=local` selects the previous per-launch gateway. See [persistent gateway](docs/GATEWAY-SERVICE.md).
|
|
633
|
+
|
|
622
634
|
## Run a persistent service
|
|
623
635
|
|
|
624
636
|
For a private local/self-hosted service, inject a random operator token of at least 24 characters as `HASNA_SWITCHER_API_KEY`. For a hosted PostgreSQL service, inject `HASNA_SWITCHER_API_SIGNING_KEY` (or the shared `HASNA_API_SIGNING_KEY` / `API_KEY_SIGNING_SECRET`) and issue revocable, scoped `switcher:read` / `switcher:write` client keys through `@hasna/contracts`. Exactly one authentication mode is accepted. Provider credentials stay in each launcher process; hosted catalog refresh uploads metadata only.
|