@seaveyon/harness-switch 0.32.0 → 0.33.0
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 +6 -5
- package/dist/harness-switch.js +3155 -427
- package/package.json +1 -1
- package/public/assets/main.b618b240.js +63 -0
- package/public/assets/main.c678f743.css +2 -0
- package/public/index.html +1 -1
- package/public/assets/main.2a32cf81.js +0 -63
- package/public/assets/main.729e43ad.css +0 -2
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ Notes on individual harnesses:
|
|
|
94
94
|
- **Claude Code** defaults to `ANTHROPIC_AUTH_TOKEN`, which is what most third-party relays require. Switch the profile to `ANTHROPIC_API_KEY` for the official API.
|
|
95
95
|
- **Codex** defaults to putting the token in `config.toml` as `experimental_bearer_token`. The alternative that writes `auth.json` will overwrite your ChatGPT login cache, so it is opt-in; the previous `auth.json` is captured in a backup first either way.
|
|
96
96
|
- **Kimi Code** (`~/.kimi-code`) is a different product from Kimi CLI (`~/.kimi`), even though both provide a `kimi` command. This project targets Kimi Code, which does not read credentials from the shell at all. Its config holds many providers plus one pointer, so switching back to official login only moves `default_model` to the managed provider that `/login` provisioned — every third-party entry stays on disk for the next switch, and the OAuth cache under `credentials/` is never touched. If `config.toml` holds no managed entry (you never completed `/login`), the switch is refused with a hint to log in once in a terminal.
|
|
97
|
-
- **Pi** (`@earendil-works/pi-coding-agent`) registers a custom provider in `models.json` and points `settings.json` at it via `defaultProvider` / `defaultModel`. The API key must live in that provider entry (or `auth.json`); otherwise Pi shows "No models available" and asks for `/login`. A `--model` flag still overrides the default at runtime.
|
|
97
|
+
- **Pi** (`@earendil-works/pi-coding-agent`) registers a custom provider in `models.json` and points `settings.json` at it via `defaultProvider` / `defaultModel`. The API key must live in that provider entry (or `auth.json`); otherwise Pi shows "No models available" and asks for `/login`. A `--model` flag still overrides the default at runtime. Switching back to official login only drops the pointer when `defaultProvider` names a custom provider — every `models.json` entry stays; `auth.json` is read, never written, and the switch is refused when it holds no `/login` credential.
|
|
98
98
|
- **DeepSeek Harness** registers a custom `llm-pi-ai` provider, stores the API key in its separate credentials document, and updates `agent-default-model`. Existing sessions keep their selected route; newly created sessions use the activated profile.
|
|
99
99
|
|
|
100
100
|
`~/.harness-switch/env.sh` is only a compatibility layer for Codex’s environment-variable auth mode:
|
|
@@ -252,7 +252,7 @@ The service defaults to loopback only. Do **not** expose the management port dir
|
|
|
252
252
|
|
|
253
253
|
API keys are encrypted with AES-256-GCM in `~/.harness-switch/profiles.json`; the local encryption key lives in `~/.harness-switch/aes-256-gcm.key`. Those files, the generated password, and `env.sh` are stored with permissions set to `0600` on POSIX systems. When writing a harness's own configuration file, existing permissions are preserved and newly created files start at `0600`.
|
|
254
254
|
|
|
255
|
-
Web sessions live in `~/.harness-switch/sessions.json` (also `0600`) so restarting the service does not log you out. Only a SHA-256 digest of each session token is stored, so the file cannot be replayed as a cookie, and the table is tied to a fingerprint of the password that issued it: replacing `web_password` invalidates every existing session.
|
|
255
|
+
Web sessions live in `~/.harness-switch/sessions.json` (also `0600`) so restarting the service does not log you out. A session expires after an idle window — `HSW_SESSION_TTL_HOURS`, 48 hours by default — of no signed-in requests; each authenticated request extends it again. Only a SHA-256 digest of each session token is stored, so the file cannot be replayed as a cookie, and the table is tied to a fingerprint of the password that issued it: replacing `web_password` invalidates every existing session.
|
|
256
256
|
|
|
257
257
|
Two places deliberately expose a key to an authenticated session: the raw config preview and the generated files themselves must contain the credential to be useful. Profile listings never echo it.
|
|
258
258
|
|
|
@@ -269,7 +269,7 @@ This protects against accidental plaintext disclosure in profile storage, but do
|
|
|
269
269
|
| `HSW_HOME_DIR` | `$HOME` | Service owner's home override, mainly for tests and containers. |
|
|
270
270
|
| `HSW_USERS` | auto-discovered | Comma-separated allowlist such as `root,alice`. The service owner is always manageable. |
|
|
271
271
|
| `HSW_UPDATE_CHECK` | `1` | Set to `0` to skip npm registry update checks. The local development command sets this automatically. |
|
|
272
|
-
| `HSW_SESSION_TTL_HOURS` | `
|
|
272
|
+
| `HSW_SESSION_TTL_HOURS` | `48` | Idle window for a Web login: a session expires after this many hours without a signed-in request, and any signed-in request extends it again. Sessions survive a service restart. |
|
|
273
273
|
| `HSW_BACKUP_RETAIN` | `10` | Number of snapshots to keep. |
|
|
274
274
|
| `HSW_JOURNAL_RETAIN` | `50` | Number of operation receipts to keep. |
|
|
275
275
|
| `HSW_PUBLIC_DIR` | auto | Optional override for the built frontend directory. |
|
|
@@ -341,7 +341,8 @@ so the package runner fetches the newest release before running. The same execut
|
|
|
341
341
|
|
|
342
342
|
The daemon writes its PID, instance identity, and listening address to `~/.harness-switch/daemon.pid` and its log to
|
|
343
343
|
`~/.harness-switch/daemon.log` (a fresh log per start). The first run creates
|
|
344
|
-
the web password in `~/.harness-switch/web_password`
|
|
344
|
+
the web password in `~/.harness-switch/web_password` (mode `0600`); the log and
|
|
345
|
+
`harness-switch status` only ever print that path, never the password itself.
|
|
345
346
|
When a daemon is already running, a new invocation stops it before starting the
|
|
346
347
|
new process, so the port never conflicts and the newest code wins.
|
|
347
348
|
|
|
@@ -410,7 +411,7 @@ The web dev server listens on `http://127.0.0.1:5173` and proxies `/api` to the
|
|
|
410
411
|
|
|
411
412
|
## Release
|
|
412
413
|
|
|
413
|
-
Pushes to `main` run [semantic-release](https://semantic-release.gitbook.io/). It reads conventional commits
|
|
414
|
+
Pushes to `main` run [semantic-release](https://semantic-release.gitbook.io/). It reads conventional commits and computes the next version from them; the version bump is applied only to the build workspace, never committed. The tarball is published to npm via Trusted Publishing **before** the `v*` tag and GitHub release are created, so a failed registry publish never leaves a tag without a matching npm version. The tag and the release are created on the commit the workflow checked out — release notes live on the GitHub Release, and `CHANGELOG.md` is no longer updated. If a version is already on the registry, the run reuses it only when npm's provenance shows it was published from that same commit; otherwise it fails instead of pointing an old tarball's tag at new code. Re-running a commit that already carries its version tag resumes: the version and notes are re-derived from the tag, the npm source is re-verified, and a missing tag or release is repaired — even after main has moved on. A run whose commit a newer main commit has superseded skips itself; the newer run publishes those changes. The provenance check guards against mislabeling, not against a hostile publisher — npm's attestation is not cryptographically verified here.
|
|
414
415
|
|
|
415
416
|
| Commit | Version bump |
|
|
416
417
|
|---|---|
|