@hasna/switcher 0.2.13 → 0.2.15

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
@@ -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.
@@ -20,7 +20,7 @@ import { lstat as lstat4, opendir as opendir2, realpath as realpath2, stat as st
20
20
  import { lstatSync as lstatSync3 } from "node:fs";
21
21
  import { isAbsolute as isAbsolute3, join as join4, relative as relative2, resolve as resolve3 } from "node:path";
22
22
 
23
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
23
+ // node_modules/zod/v3/external.js
24
24
  var exports_external = {};
25
25
  __export(exports_external, {
26
26
  void: () => voidType,
@@ -132,7 +132,7 @@ __export(exports_external, {
132
132
  BRAND: () => BRAND
133
133
  });
134
134
 
135
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
135
+ // node_modules/zod/v3/helpers/util.js
136
136
  var util;
137
137
  (function(util2) {
138
138
  util2.assertEqual = (_) => {};
@@ -263,7 +263,7 @@ var getParsedType = (data) => {
263
263
  }
264
264
  };
265
265
 
266
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
266
+ // node_modules/zod/v3/ZodError.js
267
267
  var ZodIssueCode = util.arrayToEnum([
268
268
  "invalid_type",
269
269
  "invalid_literal",
@@ -382,7 +382,7 @@ ZodError.create = (issues) => {
382
382
  return error;
383
383
  };
384
384
 
385
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
385
+ // node_modules/zod/v3/locales/en.js
386
386
  var errorMap = (issue, _ctx) => {
387
387
  let message;
388
388
  switch (issue.code) {
@@ -485,7 +485,7 @@ var errorMap = (issue, _ctx) => {
485
485
  };
486
486
  var en_default = errorMap;
487
487
 
488
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
488
+ // node_modules/zod/v3/errors.js
489
489
  var overrideErrorMap = en_default;
490
490
  function setErrorMap(map) {
491
491
  overrideErrorMap = map;
@@ -493,7 +493,7 @@ function setErrorMap(map) {
493
493
  function getErrorMap() {
494
494
  return overrideErrorMap;
495
495
  }
496
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
496
+ // node_modules/zod/v3/helpers/parseUtil.js
497
497
  var makeIssue = (params) => {
498
498
  const { data, path, errorMaps, issueData } = params;
499
499
  const fullPath = [...path, ...issueData.path || []];
@@ -599,14 +599,14 @@ var isAborted = (x) => x.status === "aborted";
599
599
  var isDirty = (x) => x.status === "dirty";
600
600
  var isValid = (x) => x.status === "valid";
601
601
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
602
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
602
+ // node_modules/zod/v3/helpers/errorUtil.js
603
603
  var errorUtil;
604
604
  (function(errorUtil2) {
605
605
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
606
606
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
607
607
  })(errorUtil || (errorUtil = {}));
608
608
 
609
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
609
+ // node_modules/zod/v3/types.js
610
610
  class ParseInputLazyPath {
611
611
  constructor(parent, value, path, key) {
612
612
  this._cachedPath = [];