wisp-router 2.0.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 ADDED
@@ -0,0 +1,27 @@
1
+ # wisp-router
2
+
3
+ **Wisp** — a BYOK model router, in your terminal.
4
+
5
+ - `wisp` — the TUI: pick a Provider (OpenCode Go, Codex/ChatGPT, Anthropic/Claude.ai, OpenAI, Groq, Mistral, OpenRouter, Ollama, and more), set keys or OAuth sign-in, edit the Routing map, host the Bridge.
6
+ - `wisp serve` — the headless Bridge: a local OpenAI-compatible **and** Anthropic-compatible endpoint that routes to whichever backend you configured.
7
+ - `claude-wisp` — launch Claude Code pre-wired to the Bridge (env on the child only, argv passed through verbatim).
8
+
9
+ ## Install
10
+
11
+ ```
12
+ npm i -g wisp-router
13
+ ```
14
+
15
+ Ships as a compiled per-platform binary (win32-x64, darwin-arm64, darwin-x64, linux-x64) — no Bun or particular Node version needed at runtime.
16
+
17
+ ## Quick start
18
+
19
+ ```
20
+ wisp # the TUI — type / for commands (/providers, /key, /model, /routing, /bridge, …)
21
+ wisp serve # headless Bridge host
22
+ claude-wisp # Claude Code through the Bridge (start the Bridge first)
23
+ ```
24
+
25
+ State lives in `~/.wisp/` (`config.json` + owner-only `auth.json`), shared with the Wisp VS Code extension.
26
+
27
+ Source and docs: [github.com/EstarinAzx/Wisp-Router](https://github.com/EstarinAzx/Wisp-Router).
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ // ---------- claude-wisp.js — npm thin shell: same binary, claude-wisp dispatch token ---------- //
3
+
4
+ // One compiled binary serves both bins — `wisp claude-wisp …` reaches the launcher (#67).
5
+ require('./wisp.js').run(['claude-wisp']);
package/bin/wisp.js ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ // ------------- wisp.js — npm thin shell: locate the platform binary and hand over ------------- //
3
+
4
+ /*
5
+ * Depends on:
6
+ * - child_process (node stdlib): spawnSync with inherited stdio — the binary owns the terminal.
7
+ *
8
+ * Data shapes: none. The real program is the bun-compiled `wisp` binary shipped by the
9
+ * per-platform optionalDependency (esbuild/biome pattern); this shim only resolves and runs it.
10
+ */
11
+
12
+ const { spawnSync } = require('child_process');
13
+
14
+ // platform-arch → the optionalDependency that carries its compiled binary.
15
+ // ponytail: musl (Alpine) matches linux-x64 but the glibc-linked binary fails at dlopen —
16
+ // add a musl probe with a plain error if it ever bites.
17
+ const PLATFORM_PACKAGES = {
18
+ 'win32-x64': '@tsd47216/wisp-router-win32-x64',
19
+ 'darwin-arm64': '@tsd47216/wisp-router-darwin-arm64',
20
+ 'darwin-x64': '@tsd47216/wisp-router-darwin-x64',
21
+ 'linux-x64': '@tsd47216/wisp-router-linux-x64',
22
+ };
23
+
24
+ const resolveBinary = () => {
25
+ const key = `${process.platform}-${process.arch}`;
26
+ const pkg = PLATFORM_PACKAGES[key];
27
+ if (!pkg) {
28
+ console.error(`wisp-router: unsupported platform ${key} (supported: ${Object.keys(PLATFORM_PACKAGES).join(', ')})`);
29
+ process.exit(1);
30
+ }
31
+ try {
32
+ return require.resolve(`${pkg}/bin/${process.platform === 'win32' ? 'wisp.exe' : 'wisp'}`);
33
+ } catch {
34
+ console.error(`wisp-router: platform package ${pkg} is missing — reinstall without --no-optional/--omit=optional.`);
35
+ process.exit(1);
36
+ }
37
+ };
38
+
39
+ // Run the binary with extra leading args (the claude-wisp shim passes its dispatch token here).
40
+ const run = (extraArgs) => {
41
+ // Ctrl+C belongs to the child (TUI / claude handle their own); default would kill this shim first.
42
+ process.on('SIGINT', () => {});
43
+ const result = spawnSync(resolveBinary(), [...extraArgs, ...process.argv.slice(2)], { stdio: 'inherit' });
44
+ if (result.error) {
45
+ console.error(`wisp-router: failed to start the platform binary: ${result.error.message}`);
46
+ process.exit(1);
47
+ }
48
+ process.exit(result.status ?? 1);
49
+ };
50
+
51
+ module.exports = { run };
52
+ if (require.main === module) run([]);
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "wisp-router",
3
+ "version": "2.0.0",
4
+ "description": "Wisp — BYOK model router: terminal UI, local Bridge (OpenAI + Anthropic doors), and the claude-wisp launcher for Claude Code",
5
+ "bin": {
6
+ "wisp": "bin/wisp.js",
7
+ "claude-wisp": "bin/claude-wisp.js"
8
+ },
9
+ "files": [
10
+ "bin/"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/EstarinAzx/Wisp-Router.git"
15
+ },
16
+ "engines": {
17
+ "node": ">=16"
18
+ },
19
+ "optionalDependencies": {
20
+ "@tsd47216/wisp-router-win32-x64": "2.0.0",
21
+ "@tsd47216/wisp-router-darwin-arm64": "2.0.0",
22
+ "@tsd47216/wisp-router-darwin-x64": "2.0.0",
23
+ "@tsd47216/wisp-router-linux-x64": "2.0.0"
24
+ }
25
+ }