@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 +12 -0
- package/dist/claude-desktop.js +8 -8
- package/dist/cli/index.js +1500 -93
- 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/index.js +9 -9
- package/dist/inference-gateway.d.ts +25 -2
- package/dist/launcher.d.ts +11 -1
- package/dist/mcp/index.js +13 -13
- package/dist/process-table.d.ts +28 -0
- package/dist/sdk.js +9 -9
- 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 +8 -4
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.
|
package/dist/claude-desktop.js
CHANGED
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
609
|
+
// node_modules/zod/v3/types.js
|
|
610
610
|
class ParseInputLazyPath {
|
|
611
611
|
constructor(parent, value, path, key) {
|
|
612
612
|
this._cachedPath = [];
|