@hasna/switcher 0.2.8 → 0.2.10

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 CHANGED
@@ -412,7 +412,9 @@ Bind an existing vault key once, then launch without an external wrapper. New bi
412
412
 
413
413
  Real launches now preflight the local inference credential before catalog refresh and before an interactive model picker. An existing environment credential is preserved without creating a binding. An existing binding remains authoritative, including its exact Secrets operator account and allowed provider origins; a locked source, an unauthorized destination, or rejected provider credential is terminal and never falls through to another account.
414
414
 
415
- When a provider credential is missing in an interactive terminal, Switcher uses the trusted `secrets` executable on `PATH` to search metadata only. It displays the selected Secrets account/source and matching vault key references, asks which reference to bind, saves that reference through the existing immutable binding store, resolves the value through the authenticated loopback delivery path, and performs a bounded, non-inference provider authentication check before continuing the original launch. OpenRouter uses its authenticated `GET /api/v1/key` metadata endpoint; its public model catalog is never treated as proof that a key works. Custom providers may declare a relative `credentialCheck` (`GET` or `HEAD`) in provider JSON. Catalog configuration alone is never inferred to validate a credential because a catalog may be public or ignore invalid authorization.
415
+ When a provider credential is missing in an interactive terminal, Switcher uses the trusted `secrets` executable on `PATH` to search metadata only. It displays the selected Secrets account/source and matching vault key references, asks which reference to bind, saves that reference through the existing immutable binding store, resolves the value through the authenticated loopback delivery path, and performs a bounded provider authentication check before continuing the original launch. OpenRouter uses its authenticated `GET /api/v1/key` metadata endpoint; its public model catalog is never treated as proof that a key works. Custom providers may declare a relative `credentialCheck` (`GET` or `HEAD`) in provider JSON. Catalog configuration alone is never inferred to validate a credential because a catalog may be public or ignore invalid authorization.
416
+
417
+ OpenCode Zen checks its supplied key with one fixed synthetic question to the documented free `jev-1.13-free` model. Before sending the selected key, Switcher requires rejection of invalid keys through both the legacy and migrated routes: an existing legacy key may also have been migrated. Anonymous `public` credentials and whitespace-containing tokens are rejected. The check uses a shared ten-second deadline and bounded JSON responses, follows no redirects, sends no user prompt or project data, and has no paid-model fallback. The free alias is a limited-time provider offering; if the check becomes unavailable, launch stops with the selected binding preserved. This proves key authentication, not access to every paid model. The coding model and provider chosen for the actual launch remain unchanged. An explicitly configured `credentialCheck` retains precedence. See [OpenCode's Jev endpoint and free-model pricing](https://opencode.ai/docs/zen/#jev).
416
418
 
417
419
  Discovery requests Secrets' full metadata array with a 257-row limit, preserving compatibility with compact-default and older Secrets CLIs. The extra row detects searches exceeding the 256-reference limit; discovery refuses these results before deduplication and also caps the combined references across searches. Each response remains limited to 256 KiB. This search never requests secret values; broader matches require an explicit vault-key binding.
418
420
 
@@ -456,7 +458,7 @@ switcher credentials repair-executable deepseek --sha256 EXPECTED_EXECUTABLE_SHA
456
458
 
457
459
  For a fresh installation whose unsafe executable prevents creating a binding, use `switcher credentials repair-executable --vault-cli /absolute/path/to/secrets --sha256 EXPECTED_EXECUTABLE_SHA256` first, then bind normally. Select either a binding reference or an explicit path.
458
460
 
459
- The digest is a release-artifact checksum, not a credential. Do not substitute the installed file's own hash: that would trust any altered bytes. Repair checks the exact bytes, file owner/type and every path ancestor, then creates an identical private copy and atomically replaces the writable executable with group/public write permission removed. Cache hardlinks and already-open writers retain the old inode and cannot change the repaired executable. It then runs the ordinary launch checks again. Safe files are unchanged; digest mismatches, unsafe ancestors and unowned files are refused. The command never starts Secrets, contacts the vault, changes bindings, or repairs permissions automatically during launch. Run this explicit step after each affected installation; a later Bun install can reset bin modes again. Reinstall a verified package if its bytes differ.
461
+ The digest is a release-artifact checksum, not a credential. Do not substitute the installed file's own hash: that would trust any altered bytes. Repair checks the exact bytes, file owner/type and every path ancestor, then creates an identical private copy and atomically replaces a writable or hardlinked executable with group/public write permission removed. Cache hardlinks and already-open writers retain the old inode and cannot change the repaired executable. It then runs the ordinary launch checks again. Safe files with a private inode are unchanged; digest mismatches, unsafe ancestors and unowned files are refused. The command never starts Secrets, contacts the vault, changes bindings, or repairs permissions automatically during launch. Run this explicit step after each affected installation; a later Bun install can reset bin modes again. Reinstall a verified package if its bytes differ.
460
462
 
461
463
  For provider keys already stored in macOS Keychain, use `--keychain-service SERVICE --keychain-account ACCOUNT` instead of vault options. Bindings contain only references and authorized origins under `~/.hasna/switcher/config/credential-bindings`, in owner-only files. They remain local even when Switcher uses a remote API. A configured binding takes precedence over environment aliases; an unavailable binding never falls back to another account.
462
464