@ngosangns/ns-bridge 0.1.23 → 0.1.25
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/NOTICE +35 -0
- package/README.md +58 -28
- package/dist/catalog.d.ts +2 -1
- package/dist/catalog.js +5 -3
- package/dist/catalog.js.map +1 -1
- package/dist/cli.d.ts +6 -3
- package/dist/cli.js +83 -61
- package/dist/cli.js.map +1 -1
- package/dist/dsh-patch.d.ts +42 -0
- package/dist/dsh-patch.js +186 -0
- package/dist/dsh-patch.js.map +1 -0
- package/dist/hosts/dsh/arnict/dist/index.js +2297 -0
- package/dist/hosts/dsh/arnict/package.json +28 -0
- package/dist/hosts/dsh/devin/dist/index.js +5034 -0
- package/dist/hosts/dsh/devin/package.json +28 -0
- package/dist/hosts/dsh/grok/dist/index.js +2523 -0
- package/dist/hosts/dsh/grok/package.json +28 -0
- package/dist/hosts/dsh/kiro/dist/index.js +5996 -0
- package/dist/hosts/dsh/kiro/package.json +28 -0
- package/dist/hosts/dsh/qoder/dist/index.js +21194 -0
- package/dist/hosts/dsh/qoder/package.json +28 -0
- package/dist/hosts/omp/dist/index.js +26632 -0
- package/dist/hosts/omp/package.json +25 -0
- package/dist/hosts/pi/dist/index.js +31924 -0
- package/dist/hosts/pi/package.json +13 -0
- package/dist/hosts.d.ts +52 -11
- package/dist/hosts.js +244 -33
- package/dist/hosts.js.map +1 -1
- package/dist/providers.d.ts +4 -5
- package/dist/providers.js +23 -39
- package/dist/providers.js.map +1 -1
- package/dist/refresh-entry.js +1053 -773
- package/dist/refresh.d.ts +2 -1
- package/dist/refresh.js +1 -1
- package/dist/refresh.js.map +1 -1
- package/dist/selection.d.ts +1 -1
- package/dist/selection.js +11 -5
- package/dist/selection.js.map +1 -1
- package/dist/self.d.ts +1 -1
- package/dist/self.js +1 -1
- package/dist/serve-entry.js +3 -12
- package/dist/usage.d.ts +4 -0
- package/dist/usage.js +33 -1
- package/dist/usage.js.map +1 -1
- package/dist/zcode.d.ts +1 -1
- package/dist/zcode.js +14 -8
- package/dist/zcode.js.map +1 -1
- package/package.json +13 -4
package/NOTICE
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
ns-bridge
|
|
2
|
+
Copyright (c) 2026 ngosangns
|
|
3
|
+
|
|
4
|
+
`@ngosangns/ns-bridge` bundles its own source tree into `dist/hosts/**`, and
|
|
5
|
+
ships those prebuilt host extensions for Pi, OMP, and the DeepSeek Harness.
|
|
6
|
+
The bundled sources include:
|
|
7
|
+
|
|
8
|
+
- `packages/pi-provider`, `packages/omp-provider*`, `packages/dsh-llm-*` —
|
|
9
|
+
authored here, MIT.
|
|
10
|
+
- `packages/kiro-core`, ported from pi-provider-kiro
|
|
11
|
+
(https://github.com/mikeyobrien/pi-provider-kiro), Copyright (c) Mike
|
|
12
|
+
O'Brien, MIT. See the repository NOTICE for the full port description.
|
|
13
|
+
- `packages/devin-core`, ported from oh-my-pi
|
|
14
|
+
(https://github.com/can1357/oh-my-pi), MIT.
|
|
15
|
+
|
|
16
|
+
`packages/pi-provider` carries its own NOTICE for the upstream projects it
|
|
17
|
+
adapts:
|
|
18
|
+
|
|
19
|
+
----
|
|
20
|
+
ns-pi-provider
|
|
21
|
+
Copyright (c) 2026 ngosangns
|
|
22
|
+
|
|
23
|
+
This package adapts patterns and portions of the following MIT-licensed projects:
|
|
24
|
+
|
|
25
|
+
- pi-kiro-provider (MasuRii) — https://github.com/MasuRii/pi-kiro-provider
|
|
26
|
+
- pi-kiro-api (satiyap) — https://github.com/satiyap/pi-kiro-api
|
|
27
|
+
(which itself vendors streaming core from pi-kiro under MIT)
|
|
28
|
+
- pi-devin-provider (fadlee) — https://github.com/fadlee/pi-devin-provider
|
|
29
|
+
- pi-grok-sdk (Ankit Chouhan) — https://github.com/ankitchouhan1020/pi-grok-sdk
|
|
30
|
+
- grok-pi — model-cache / CLI bridge patterns
|
|
31
|
+
- Pi custom-provider docs and examples from badlogic/pi-mono / earendil-works
|
|
32
|
+
|
|
33
|
+
See each upstream LICENSE for full copyright notices. Adaptations are under the
|
|
34
|
+
MIT license of this package; original authorship remains with upstream authors.
|
|
35
|
+
----
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ngosangns/ns-bridge
|
|
2
2
|
|
|
3
|
-
CLI for the [ns-bridge](https://github.com/ngosangns/ns-bridge) providers. It
|
|
3
|
+
CLI for the [ns-bridge](https://github.com/ngosangns/ns-bridge) providers. It ships the host extensions prebuilt, registers them with Pi, OMP, and DSH, and writes model catalogs in its own process.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @ngosangns/ns-bridge
|
|
@@ -9,58 +9,88 @@ ns-bridge help
|
|
|
9
9
|
|
|
10
10
|
## Commands
|
|
11
11
|
|
|
12
|
-
Mutating commands
|
|
12
|
+
Mutating commands apply by default. Pass `--dry-run` to preview them.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
ns-bridge install [pi|omp|dsh|all] [--
|
|
16
|
-
ns-bridge update [--
|
|
17
|
-
ns-bridge update <pi|omp|dsh|all> [--
|
|
18
|
-
ns-bridge uninstall [pi|omp|dsh|all] [--
|
|
19
|
-
ns-bridge providers status [pi|omp|dsh|all] [kiro|devin|grok] [--profile <name>]
|
|
20
|
-
ns-bridge providers enable|disable <pi|omp|dsh> <kiro|devin|grok> [--
|
|
21
|
-
ns-bridge usage [--vendor <kiro|devin|grok>] [--day YYYY-MM-DD] [--days <n>] [--json]
|
|
15
|
+
ns-bridge install [pi|omp|dsh|all] [--dry-run] [--profile <name>]
|
|
16
|
+
ns-bridge update [--dry-run]
|
|
17
|
+
ns-bridge update <pi|omp|dsh|all> [--dry-run] [--profile <name>]
|
|
18
|
+
ns-bridge uninstall [pi|omp|dsh|all] [--dry-run] [--profile <name>]
|
|
19
|
+
ns-bridge providers status [pi|omp|dsh|all] [kiro|devin|grok|arnict|qoder] [--profile <name>]
|
|
20
|
+
ns-bridge providers enable|disable <pi|omp|dsh> <kiro|devin|grok|arnict|qoder> [--dry-run] [--profile <name>]
|
|
21
|
+
ns-bridge usage [--vendor <kiro|devin|grok|arnict|qoder>] [--day YYYY-MM-DD] [--days <n>] [--json]
|
|
22
22
|
ns-bridge usage --session <id> [--vendor <name>] [--json]
|
|
23
|
-
ns-bridge models list [kiro|devin|grok|all]
|
|
24
|
-
ns-bridge models refresh [kiro|devin|grok|all] [--
|
|
23
|
+
ns-bridge models list [kiro|devin|grok|arnict|qoder|all]
|
|
24
|
+
ns-bridge models refresh [kiro|devin|grok|arnict|qoder|all] [--dry-run]
|
|
25
25
|
ns-bridge kiro profile [list]
|
|
26
|
-
ns-bridge kiro profile use <name|region|arn> [--
|
|
27
|
-
ns-bridge kiro profile reset [--
|
|
26
|
+
ns-bridge kiro profile use <name|region|arn> [--dry-run]
|
|
27
|
+
ns-bridge kiro profile reset [--dry-run]
|
|
28
28
|
ns-bridge serve [--port N] [--host H] [--allow-remote]
|
|
29
|
-
ns-bridge zcode setup [--
|
|
29
|
+
ns-bridge zcode setup [--dry-run] [--vendors <list>] [--default <vendor>/<model>]
|
|
30
30
|
[--force] [--no-service]
|
|
31
31
|
ns-bridge zcode status
|
|
32
|
-
ns-bridge zcode remove [--
|
|
32
|
+
ns-bridge zcode remove [--dry-run] [--force]
|
|
33
33
|
ns-bridge status
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
`serve` and `zcode` register the same vendors for the ZCode app through a local Anthropic-Messages server; see the root [README](https://github.com/ngosangns/ns-bridge#zcode).
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
| --- | --- | --- | --- |
|
|
40
|
-
| pi | `pi install npm:@ngosangns/ns-pi-provider` | `pi update --extension npm:@ngosangns/ns-pi-provider` | `pi uninstall npm:@ngosangns/ns-pi-provider` |
|
|
41
|
-
| omp | `omp plugin install ns-omp-provider-kiro` | `omp plugin upgrade ns-omp-provider-kiro` | `omp plugin uninstall ns-omp-provider-kiro ns-omp-provider` |
|
|
42
|
-
| dsh | `dsh plugin --profile <name> add ns-dsh-llm-kiro ns-dsh-llm-devin ns-dsh-llm-grok` | `dsh plugin --profile <name> update …` | `dsh plugin --profile <name> remove …` |
|
|
38
|
+
## Host extensions come from this package
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
The provider packages are no longer published. Every extension this CLI
|
|
41
|
+
registers ships inside it, built at pack time:
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
```
|
|
44
|
+
dist/hosts/pi/ @ngosangns/ns-pi-provider (kiro, devin, grok, arnict, qoder)
|
|
45
|
+
dist/hosts/omp/ ns-omp-provider (kiro, arnict, qoder)
|
|
46
|
+
dist/hosts/dsh/<vendor>/ ns-dsh-llm-<vendor> (kiro, devin, grok, arnict, qoder)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`install` registers those directories in place:
|
|
50
|
+
|
|
51
|
+
| Host | Commands |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| pi | `pi uninstall npm:@ngosangns/ns-pi-provider` (tolerated), `pi install <cli>/dist/hosts/pi`, then stale local entries in `~/.pi/agent/settings.json` are pruned |
|
|
54
|
+
| omp | `omp plugin uninstall ns-omp-provider-kiro` (tolerated), `omp plugin install <cli>/dist/hosts/omp` |
|
|
55
|
+
| dsh | `dsh plugin --profile <name> add link:<cli>/dist/hosts/dsh/{kiro,devin,grok,arnict,qoder}`, then the five blocks are ensured in the profile's `cordis.patch.yml` |
|
|
56
|
+
|
|
57
|
+
OMP ships `devin`, `xai`, and `xai-oauth` itself, so only `kiro`, `arnict`, and `qoder` come from this project there (`/login devin`, `/login xai-oauth`). Model ids `devin/…` and `grok/…` in OMP's `config.yml` resolve to OMP's own `devin` and (for Grok) `xai-oauth/…` or `xai/…`.
|
|
47
58
|
|
|
48
|
-
|
|
59
|
+
DSH requires `--profile`. Profile `desktop` is refused: the Electron app owns it. `install` and `update <host>` without `--profile` skip DSH and still handle Pi and OMP.
|
|
49
60
|
|
|
50
|
-
`
|
|
61
|
+
`update <host>` plans the same steps as `install`, so re-running it repairs a
|
|
62
|
+
host after the CLI moved or was reinstalled. `update` with no host updates this
|
|
63
|
+
CLI instead: it asks npm for the latest `@ngosangns/ns-bridge` and runs
|
|
64
|
+
`npm install -g @ngosangns/ns-bridge@<latest>`.
|
|
65
|
+
|
|
66
|
+
Because hosts point into this package, uninstalling or moving it breaks their
|
|
67
|
+
extensions. `ns-bridge status` reports missing bundles; re-running `install`
|
|
68
|
+
after a reinstall repairs the paths. The CLI refuses to register bundles while
|
|
69
|
+
it runs from an `npx` cache, where the path disappears.
|
|
70
|
+
|
|
71
|
+
Rolling back: the old npm packages are still on npm at their last versions
|
|
72
|
+
(`npm:@ngosangns/ns-pi-provider`, `ns-omp-provider-kiro`,
|
|
73
|
+
`ns-dsh-llm-*`). `ns-bridge uninstall <host>` removes the local bundles first;
|
|
74
|
+
then install the npm package you want with the host's own command.
|
|
75
|
+
|
|
76
|
+
## Providers
|
|
77
|
+
|
|
78
|
+
`providers enable` and `providers disable` turn one of `kiro`, `devin`, `grok`, `arnict`, or `qoder` on or off. Pi and OMP share `~/.ns-bridge/providers.json` (`NS_BRIDGE_PROVIDERS` overrides the path); the extension reads it at launch. With no file, all five are on. OMP only takes `kiro`, `arnict`, and `qoder` from it: `providers enable omp devin|grok` is refused with the reason, `providers disable omp devin|grok` changes nothing, `providers status omp` shows them as `not provided`, and `devin` or `grok` in the file or in an env list are ignored by the OMP plugin (they still apply to Pi). `NS_OMP_PROVIDERS` replaces the file, `NS_OMP_PROVIDER_ENABLE` adds, and `NS_OMP_PROVIDER_DISABLE` removes. DSH writes `disabled: true` on that plugin's id in the profile's `cordis.patch.yml`. In OMP, `kiro` stays with the old `ns-omp-provider-kiro` plugin while it is installed, but install/update remove it. Only the key you change is written; defaults never land in the file.
|
|
51
79
|
|
|
52
80
|
`usage` reads the ledger the plugins write while they work in Pi, OMP, and DSH. Each model response appends one JSON line to `~/.ns-bridge/usage/<day>/<vendor>/<session>.jsonl` (`NS_BRIDGE_USAGE_DIR` moves the root). A response with no session id goes to `_no-session.jsonl`. Plugins record unless `NS_BRIDGE_USAGE=0`. The command makes no network call and writes nothing.
|
|
53
81
|
|
|
54
|
-
The default view groups the newest 10 days by day and vendor. `--session <id>` lists one session step by step. `hit` is `cacheRead` over prompt tokens (`input + cacheRead + cacheWrite`), summed over the rows, not an average of per-step ratios. `source` says where a row's cache numbers came from. `wire` rows are counters the provider sent (Grok, Devin). A step whose provider sent none has a `null` ratio, is left out of both sides, and counts under `no cache data`. Kiro sends no cache counters, so ns-bridge works them out from the credits Kiro bills. Kiro prices a cached prefix at about half the cold rate, but new tokens appended after it at about ten times the cached rate, so a turn that adds 10% to its prompt costs as much as a cold one. When the bill is under that ceiling it fixes the cached share: those rows are `from credits`, with a `*` after the ratio in `--session`. When the bill is on the ceiling, the share cannot be known and the row shows an upper bound such as `<=90%*` and counts under `credits cap`. Both are a calculation from a bill, not a count. It needs `kiro-cli` installed (for the per-model rate), a model measured in `kiro-core` (haiku, sonnet,
|
|
82
|
+
The default view groups the newest 10 days by day and vendor. `--session <id>` lists one session step by step. `hit` is `cacheRead` over prompt tokens (`input + cacheRead + cacheWrite`), summed over the rows, not an average of per-step ratios. `source` says where a row's cache numbers came from. `wire` rows are counters the provider sent (Grok, Devin). A step whose provider sent none has a `null` ratio, is left out of both sides, and counts under `no cache data`. Kiro sends no cache counters, so ns-bridge works them out from the credits Kiro bills. Kiro prices a cached prefix at about half the cold rate, but new tokens appended after it at about ten times the cached rate, so a turn that adds 10% to its prompt costs as much as a cold one. When the bill is under that ceiling it fixes the cached share: those rows are `from credits`, with a `*` after the ratio in `--session`. When the bill is on the ceiling, the share cannot be known and the row shows an upper bound such as `<=90%*` and counts under `credits cap`. Both are a calculation from a bill, not a count. It needs `kiro-cli` installed (for the per-model rate), a model measured in `kiro-core` (auto, haiku-4-5, opus-5, sonnet-5-5, gpt-5-6-luna), a prompt of at least 2,000 tokens, and Kiro reporting credits; otherwise the row says `no cache data`. The DSH Kiro plugin separately guesses a cache read so the Harness can draw a cache-hit bar; the ledger ignores that guess. The ledger keeps 30 days and 50 MB; older day folders are deleted whole.
|
|
83
|
+
|
|
84
|
+
`cold` counts steps whose bill sits on the no-cache ceiling (`credits cap`) although the prefix should have been cached, over the steps whose bill speaks about the cache (`from credits` plus `credits cap`). It leaves out a session's first step, a step whose prompt is shorter than the step before (compaction rewrites the prefix), and a step after 245 s or more of idle time (the cache expires). What remains means the prompt prefix changed between two close steps. Only rows with credits-derived data have a value; the others show `-`.
|
|
55
85
|
|
|
56
86
|
`models list` and `status` read the catalog files and do not import the provider cores:
|
|
57
87
|
|
|
58
88
|
- Kiro: `~/.ns-kiro-provider-models-cache.json`
|
|
59
89
|
- Devin: `$NS_DEVIN_MODEL_CACHE`, or `$XDG_DATA_HOME/ns-devin-provider/models.json`
|
|
60
|
-
- Grok: `~/.pi/agent/cache/ns-pi-provider
|
|
90
|
+
- Grok, Arnict, Qoder: `~/.pi/agent/cache/ns-pi-provider/<vendor>.models.json`
|
|
61
91
|
|
|
62
|
-
`models refresh
|
|
92
|
+
`models refresh` writes those files from the bundled refresh. A missing file is reported as missing. The command does not print the in-memory fallback list.
|
|
63
93
|
|
|
64
94
|
Pi, OMP, and DSH read those files while they run. They do not refresh them.
|
|
65
95
|
|
|
66
|
-
`kiro profile` lists the Kiro profiles your login can use (it asks Kiro in `us-east-1`, `eu-central-1`, and the login's own region) and marks the one requests run on. `(login)` tags the profile the login carries on its own, which is what Kiro uses when nothing is pinned: kiro-cli's pick at `kiro-cli login`, or for a social (desktop) login the token's own profile. `use` takes a profile name, a region that holds exactly one profile, or an ARN. A well-formed ARN the listing does not show (a profile in another region) is pinned with a warning; Kiro rejects requests if the login cannot use it. The pin lives in `~/.ns-bridge/kiro-profile.json`.
|
|
96
|
+
`kiro profile` lists the Kiro profiles your login can use (it asks Kiro in `us-east-1`, `eu-central-1`, and the login's own region) and marks the one requests run on. `(login)` tags the profile the login carries on its own, which is what Kiro uses when nothing is pinned: kiro-cli's pick at `kiro-cli login`, or for a social (desktop) login the token's own profile. `use` takes a profile name, a region that holds exactly one profile, or an ARN. A well-formed ARN the listing does not show (a profile in another region) is pinned with a warning; Kiro rejects requests if the login cannot use it. The pin lives in `~/.ns-bridge/kiro-profile.json`. It also fetches that profile's catalog the first time. The Kiro cache keeps one catalog per profile, so switching back and forth later needs no fetch. `reset` removes the pin. Pi, OMP, and DSH read the pin on every request, so a switch applies from the next turn. A host's model list reloads when the host restarts. `KIRO_PROFILE_ARN` outranks the pin.
|
package/dist/catalog.d.ts
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Read the catalog files the hosts already use. This module does not import
|
|
3
3
|
* the vendor cores, so `ns-bridge status` and `models list` stay off the network.
|
|
4
4
|
*/
|
|
5
|
-
export type Vendor = "kiro" | "devin" | "grok" | "arnict";
|
|
5
|
+
export type Vendor = "kiro" | "devin" | "grok" | "arnict" | "qoder";
|
|
6
6
|
export interface CatalogPaths {
|
|
7
7
|
kiro: string;
|
|
8
8
|
devin: string;
|
|
9
9
|
grok: string;
|
|
10
10
|
arnict: string;
|
|
11
|
+
qoder: string;
|
|
11
12
|
}
|
|
12
13
|
/** One listed model, with the compaction budget the catalog wrote for it. */
|
|
13
14
|
export interface CatalogEntry {
|
package/dist/catalog.js
CHANGED
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
-
const VENDORS = ["kiro", "devin", "grok", "arnict"];
|
|
8
|
+
const VENDORS = ["kiro", "devin", "grok", "arnict", "qoder"];
|
|
9
9
|
export function parseVendors(target) {
|
|
10
10
|
if (!target || target === "all")
|
|
11
11
|
return [...VENDORS];
|
|
12
|
-
if (target === "kiro" || target === "devin" || target === "grok" || target === "arnict")
|
|
12
|
+
if (target === "kiro" || target === "devin" || target === "grok" || target === "arnict" || target === "qoder") {
|
|
13
13
|
return [target];
|
|
14
|
-
|
|
14
|
+
}
|
|
15
|
+
return { error: `unknown vendor ${target} (expected kiro, devin, grok, arnict, qoder, or all)` };
|
|
15
16
|
}
|
|
16
17
|
/** Same files the provider packages write. Overrides match those packages. */
|
|
17
18
|
export function catalogPaths(env = process.env, home = homedir()) {
|
|
@@ -21,6 +22,7 @@ export function catalogPaths(env = process.env, home = homedir()) {
|
|
|
21
22
|
devin: env.NS_DEVIN_MODEL_CACHE ?? join(dataHome, "ns-devin-provider", "models.json"),
|
|
22
23
|
grok: join(home, ".pi", "agent", "cache", "ns-pi-provider", "grok.models.json"),
|
|
23
24
|
arnict: join(home, ".pi", "agent", "cache", "ns-pi-provider", "arnict.models.json"),
|
|
25
|
+
qoder: join(home, ".pi", "agent", "cache", "ns-pi-provider", "qoder.models.json"),
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
export function readCatalogs(paths, vendors = VENDORS) {
|
package/dist/catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA0CjC,MAAM,OAAO,GAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEhF,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,IAAI,CAAC,MAAM,IAAI,MAA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,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,OAAO,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,OAAO,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,OAAO,CAAC;IACvC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,OAAO,CAAC;AAC1C,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ns-bridge` command dispatcher.
|
|
3
3
|
*
|
|
4
|
-
* Mutating commands
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Mutating commands apply by default. `--dry-run` prints the host argv and
|
|
5
|
+
* exits 0 without spawning. A write is the default; a preview is the explicit
|
|
6
|
+
* flag.
|
|
7
7
|
*/
|
|
8
8
|
import { type ArnictIo } from "./arnict.js";
|
|
9
9
|
import { type CatalogPaths } from "./catalog.js";
|
|
10
|
+
import { type HostPaths } from "./hosts.js";
|
|
10
11
|
import { type KiroProfileOps } from "./kiro-profile.js";
|
|
11
12
|
import { type ProviderPaths } from "./providers.js";
|
|
12
13
|
import { type ModelRefresh } from "./refresh.js";
|
|
@@ -45,6 +46,8 @@ export interface RunOptions {
|
|
|
45
46
|
platform?: NodeJS.Platform;
|
|
46
47
|
/** Installed CLI version. Tests pass this so they do not read package.json. */
|
|
47
48
|
version?: string;
|
|
49
|
+
/** Where host bundles, Pi settings, and DSH profiles live. Tests pass a temp tree. */
|
|
50
|
+
hostPaths?: HostPaths;
|
|
48
51
|
}
|
|
49
52
|
export declare function spawnRunner(): Runner;
|
|
50
53
|
export declare function run(argv: readonly string[], options?: RunOptions): Promise<number>;
|
package/dist/cli.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ns-bridge` command dispatcher.
|
|
3
3
|
*
|
|
4
|
-
* Mutating commands
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Mutating commands apply by default. `--dry-run` prints the host argv and
|
|
5
|
+
* exits 0 without spawning. A write is the default; a preview is the explicit
|
|
6
|
+
* flag.
|
|
7
7
|
*/
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { runArnict } from "./arnict.js";
|
|
11
11
|
import { catalogPaths, formatCatalog, parseVendors, readCatalogs } from "./catalog.js";
|
|
12
|
-
import { formatCommand, parseHosts, planHostCommands } from "./hosts.js";
|
|
12
|
+
import { defaultHostPaths, formatCommand, missingHostBundles, parseHosts, planHostCommands, } from "./hosts.js";
|
|
13
13
|
import { defaultKiroProfiles, findKiroProfile, formatKiroProfiles } from "./kiro-profile.js";
|
|
14
14
|
import { formatProviderPlan, planProviders, providerPaths } from "./providers.js";
|
|
15
15
|
import { defaultModelRefresh, refreshLine } from "./refresh.js";
|
|
@@ -19,28 +19,28 @@ import { formatSession, formatSummary, localDay, readUsage, summarize, usageRoot
|
|
|
19
19
|
import { runZcode } from "./zcode.js";
|
|
20
20
|
const HELP = `ns-bridge — install, update, and refresh providers outside Pi, OMP, and DSH.
|
|
21
21
|
|
|
22
|
-
Mutating commands
|
|
23
|
-
|
|
22
|
+
Mutating commands apply by default. Pass --dry-run to preview them without
|
|
23
|
+
spawning.
|
|
24
24
|
|
|
25
25
|
Usage:
|
|
26
|
-
ns-bridge install [pi|omp|dsh|all] [--
|
|
27
|
-
ns-bridge update [--
|
|
28
|
-
ns-bridge update <pi|omp|dsh|all> [--
|
|
29
|
-
ns-bridge uninstall [pi|omp|dsh|all] [--
|
|
30
|
-
ns-bridge providers status [pi|omp|dsh|all] [kiro|devin|grok|arnict] [--profile <name>]
|
|
31
|
-
ns-bridge providers enable|disable <pi|omp|dsh> <kiro|devin|grok|arnict> [--
|
|
32
|
-
ns-bridge usage [--vendor <kiro|devin|grok|arnict>] [--day YYYY-MM-DD] [--days <n>] [--json]
|
|
26
|
+
ns-bridge install [pi|omp|dsh|all] [--dry-run] [--profile <name>]
|
|
27
|
+
ns-bridge update [--dry-run]
|
|
28
|
+
ns-bridge update <pi|omp|dsh|all> [--dry-run] [--profile <name>]
|
|
29
|
+
ns-bridge uninstall [pi|omp|dsh|all] [--dry-run] [--profile <name>]
|
|
30
|
+
ns-bridge providers status [pi|omp|dsh|all] [kiro|devin|grok|arnict|qoder] [--profile <name>]
|
|
31
|
+
ns-bridge providers enable|disable <pi|omp|dsh> <kiro|devin|grok|arnict|qoder> [--dry-run] [--profile <name>]
|
|
32
|
+
ns-bridge usage [--vendor <kiro|devin|grok|arnict|qoder>] [--day YYYY-MM-DD] [--days <n>] [--json]
|
|
33
33
|
ns-bridge usage --session <id> [--vendor <name>] [--json]
|
|
34
|
-
ns-bridge models list [kiro|devin|grok|arnict|all]
|
|
35
|
-
ns-bridge models refresh [kiro|devin|grok|arnict|all] [--
|
|
34
|
+
ns-bridge models list [kiro|devin|grok|arnict|qoder|all]
|
|
35
|
+
ns-bridge models refresh [kiro|devin|grok|arnict|qoder|all] [--dry-run]
|
|
36
36
|
ns-bridge kiro profile [list]
|
|
37
|
-
ns-bridge kiro profile use <name|region|arn> [--
|
|
38
|
-
ns-bridge kiro profile reset [--
|
|
37
|
+
ns-bridge kiro profile use <name|region|arn> [--dry-run]
|
|
38
|
+
ns-bridge kiro profile reset [--dry-run]
|
|
39
39
|
ns-bridge serve [--port N] [--host H] [--allow-remote]
|
|
40
|
-
ns-bridge zcode setup [--
|
|
40
|
+
ns-bridge zcode setup [--dry-run] [--vendors <list>] [--default <vendor>/<model>]
|
|
41
41
|
[--force] [--no-service]
|
|
42
42
|
ns-bridge zcode status
|
|
43
|
-
ns-bridge zcode remove [--
|
|
43
|
+
ns-bridge zcode remove [--dry-run] [--force]
|
|
44
44
|
ns-bridge arnict login [--stdin]
|
|
45
45
|
ns-bridge arnict logout
|
|
46
46
|
ns-bridge arnict status [--json]
|
|
@@ -48,33 +48,31 @@ Usage:
|
|
|
48
48
|
ns-bridge help
|
|
49
49
|
|
|
50
50
|
Hosts:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
OMP has its own devin, xai, and xai-oauth providers (/login devin, /login xai-oauth)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
dsh plugin --profile <name> update …
|
|
61
|
-
dsh plugin --profile <name> remove …
|
|
51
|
+
The CLI ships prebuilt extensions under its own dist/hosts and registers
|
|
52
|
+
those directories in place; no provider package is fetched from npm.
|
|
53
|
+
pi pi install <ns-bridge>/dist/hosts/pi
|
|
54
|
+
removes npm:@ngosangns/ns-pi-provider and stale local copies first
|
|
55
|
+
omp omp plugin install <ns-bridge>/dist/hosts/omp
|
|
56
|
+
removes ns-omp-provider-kiro first and replaces an npm ns-omp-provider.
|
|
57
|
+
OMP has its own devin, xai, and xai-oauth providers (/login devin, /login xai-oauth)
|
|
58
|
+
dsh dsh plugin --profile <name> add link:<ns-bridge>/dist/hosts/dsh/<vendor> …
|
|
59
|
+
then keeps one insert per provider in the profile's cordis.patch.yml
|
|
62
60
|
|
|
63
61
|
providers enable/disable writes the host's own switch:
|
|
64
62
|
pi ~/.ns-bridge/providers.json (the extension reads it at launch)
|
|
65
|
-
omp the same file, kiro and
|
|
63
|
+
omp the same file, kiro, arnict, and qoder; devin and grok are OMP's own, so they are not offered
|
|
66
64
|
dsh disabled: true on the plugin id in the profile's cordis.patch.yml
|
|
67
65
|
|
|
68
66
|
DSH requires --profile. Profile "desktop" is refused: the Electron app owns it.
|
|
69
|
-
install/update <host> without --profile skips DSH and still
|
|
70
|
-
|
|
67
|
+
install/update <host> without --profile skips DSH and still handles Pi and OMP.
|
|
68
|
+
Install and update are the same command; re-running repairs a moved CLI.
|
|
71
69
|
|
|
72
70
|
usage reads the ledger the plugins write under ~/.ns-bridge/usage/<day>/<vendor>/<session>.jsonl.
|
|
73
71
|
It never calls the network. Hit is cacheRead over prompt tokens, summed, not an average of
|
|
74
72
|
per-step ratios. NS_BRIDGE_USAGE=0 stops the plugins from recording.
|
|
75
73
|
|
|
76
74
|
update with no host updates this CLI. It looks up the latest @ngosangns/ns-bridge
|
|
77
|
-
on npm and
|
|
75
|
+
on npm and runs npm install -g @ngosangns/ns-bridge@<latest>.
|
|
78
76
|
It does not touch host plugins. A host argument updates those plugins instead.
|
|
79
77
|
|
|
80
78
|
kiro profile lists the Kiro profiles your login can use and marks the active one.
|
|
@@ -84,7 +82,7 @@ Hosts read the pin on every request. KIRO_PROFILE_ARN outranks it.
|
|
|
84
82
|
|
|
85
83
|
Model catalogs are files the hosts read. Providers do not refresh them.
|
|
86
84
|
This command writes those files:
|
|
87
|
-
ns-bridge models refresh
|
|
85
|
+
ns-bridge models refresh
|
|
88
86
|
|
|
89
87
|
serve runs a local Anthropic-Messages server ZCode can point an Anthropic
|
|
90
88
|
client at: http://127.0.0.1:<port>/<vendor>/v1/messages with vendor in
|
|
@@ -97,7 +95,7 @@ zcode registers those endpoints as personal providers in the ZCode app
|
|
|
97
95
|
(~/.zcode/v2/provider_config.json; ZCODE_PERSONAL_PROVIDER_CONFIG_FILE moves
|
|
98
96
|
it). setup writes that file — quit ZCode first, because the app keeps it in
|
|
99
97
|
memory and rewrites it when it saves or quits, and restart ZCode afterwards.
|
|
100
|
-
|
|
98
|
+
setup also installs a launch agent
|
|
101
99
|
(dev.ngosangns.ns-bridge.serve) that keeps ns-bridge serve running;
|
|
102
100
|
--no-service skips it. remove strips the providers and the agent but leaves
|
|
103
101
|
~/.ns-bridge/zcode.json alone. Vendors switched off in
|
|
@@ -164,7 +162,12 @@ export async function run(argv, options = {}) {
|
|
|
164
162
|
err(`status takes no arguments (got ${target})`);
|
|
165
163
|
return 1;
|
|
166
164
|
}
|
|
167
|
-
|
|
165
|
+
const code = printCatalogs(log, options, ["kiro", "devin", "grok", "arnict", "qoder"], "status");
|
|
166
|
+
const missing = missingHostBundles(options.hostPaths ?? defaultHostPaths());
|
|
167
|
+
if (missing.length > 0) {
|
|
168
|
+
log(`# host bundles missing (${missing.join(", ")}); re-run ns-bridge install`);
|
|
169
|
+
}
|
|
170
|
+
return code;
|
|
168
171
|
}
|
|
169
172
|
if (command === "models") {
|
|
170
173
|
if (target !== "list" && target !== "refresh") {
|
|
@@ -267,8 +270,8 @@ export async function run(argv, options = {}) {
|
|
|
267
270
|
return 1;
|
|
268
271
|
}
|
|
269
272
|
function runUsage(parsed, log, err, options) {
|
|
270
|
-
if (parsed.vendor && !["kiro", "devin", "grok", "arnict"].includes(parsed.vendor)) {
|
|
271
|
-
err(`unknown vendor ${parsed.vendor} (kiro, devin, grok, arnict)`);
|
|
273
|
+
if (parsed.vendor && !["kiro", "devin", "grok", "arnict", "qoder"].includes(parsed.vendor)) {
|
|
274
|
+
err(`unknown vendor ${parsed.vendor} (kiro, devin, grok, arnict, qoder)`);
|
|
272
275
|
return 1;
|
|
273
276
|
}
|
|
274
277
|
if (parsed.day && !/^\d{4}-\d{2}-\d{2}$/.test(parsed.day)) {
|
|
@@ -311,7 +314,7 @@ function printCatalogs(log, options, vendors, mode) {
|
|
|
311
314
|
}
|
|
312
315
|
async function refreshModels(log, err, apply, vendors, options) {
|
|
313
316
|
if (!apply) {
|
|
314
|
-
log("# dry-run (
|
|
317
|
+
log("# dry-run (run without --dry-run to apply)");
|
|
315
318
|
for (const vendor of vendors)
|
|
316
319
|
log(`refresh ${vendor}`);
|
|
317
320
|
return 0;
|
|
@@ -352,7 +355,7 @@ async function runSelfUpdate(parsed, log, err, options) {
|
|
|
352
355
|
return 0;
|
|
353
356
|
}
|
|
354
357
|
if (!parsed.apply) {
|
|
355
|
-
log("# dry-run (
|
|
358
|
+
log("# dry-run (run without --dry-run to apply)");
|
|
356
359
|
log(`${PACKAGE_NAME} ${current} → ${latest}`);
|
|
357
360
|
log(formatCommand(plan.command));
|
|
358
361
|
return 0;
|
|
@@ -376,36 +379,56 @@ async function runHost(action, target, parsed, log, err, options) {
|
|
|
376
379
|
err(hosts.error);
|
|
377
380
|
return 1;
|
|
378
381
|
}
|
|
379
|
-
const plan = planHostCommands(action, hosts, parsed.profile);
|
|
382
|
+
const plan = planHostCommands(action, hosts, parsed.profile, options.hostPaths ?? defaultHostPaths());
|
|
380
383
|
if (plan.error) {
|
|
381
384
|
err(plan.error);
|
|
382
385
|
return 1;
|
|
383
386
|
}
|
|
384
387
|
if (!parsed.apply) {
|
|
385
|
-
log("# dry-run (
|
|
386
|
-
for (const
|
|
387
|
-
log(
|
|
388
|
-
if (plan.skipDsh)
|
|
389
|
-
log("# dsh skipped: pass --profile <name>");
|
|
388
|
+
log("# dry-run (run without --dry-run to apply)");
|
|
389
|
+
for (const line of planLines(plan))
|
|
390
|
+
log(line);
|
|
390
391
|
return 0;
|
|
391
392
|
}
|
|
392
393
|
const runner = options.runner ?? spawnRunner();
|
|
393
|
-
for (const
|
|
394
|
-
|
|
395
|
-
|
|
394
|
+
for (const step of plan.steps) {
|
|
395
|
+
if (!step.argv)
|
|
396
|
+
continue;
|
|
397
|
+
log(formatCommand(step.argv));
|
|
398
|
+
const result = await runner(step.argv);
|
|
396
399
|
if (result.stdout.trim())
|
|
397
400
|
log(result.stdout.trimEnd());
|
|
398
|
-
if (result.code
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
if (result.code === 0)
|
|
402
|
+
continue;
|
|
403
|
+
if (step.tolerate) {
|
|
404
|
+
log(`# ignored: ${formatCommand(step.argv)} exited ${result.code}`);
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
if (result.stderr.trim())
|
|
408
|
+
err(result.stderr.trimEnd());
|
|
409
|
+
err(`${formatCommand(step.argv)} exited ${result.code}`);
|
|
410
|
+
return 2;
|
|
411
|
+
}
|
|
412
|
+
for (const step of plan.steps) {
|
|
413
|
+
if (!step.apply)
|
|
414
|
+
continue;
|
|
415
|
+
const result = step.apply();
|
|
416
|
+
if (typeof result !== "string") {
|
|
417
|
+
err(result.error);
|
|
418
|
+
return 1;
|
|
403
419
|
}
|
|
420
|
+
log(result);
|
|
404
421
|
}
|
|
405
422
|
if (plan.skipDsh)
|
|
406
423
|
log("# dsh skipped: pass --profile <name>");
|
|
407
424
|
return 0;
|
|
408
425
|
}
|
|
426
|
+
function planLines(plan) {
|
|
427
|
+
const lines = plan.steps.map((step) => (step.argv ? formatCommand(step.argv) : (step.label ?? step.host)));
|
|
428
|
+
if (plan.skipDsh)
|
|
429
|
+
lines.push("# dsh skipped: pass --profile <name>");
|
|
430
|
+
return lines;
|
|
431
|
+
}
|
|
409
432
|
async function runKiroProfile(parsed, log, err, options) {
|
|
410
433
|
const [, area, action = "list", query] = parsed.positionals;
|
|
411
434
|
const usage = "usage: ns-bridge kiro profile [list] | use <name|region|arn> | reset";
|
|
@@ -431,7 +454,7 @@ async function runKiroProfile(parsed, log, err, options) {
|
|
|
431
454
|
const pinned = existsSync(ops.selectionPath);
|
|
432
455
|
const noPin = `no pin at ${ops.selectionPath}; Kiro already follows the login's profile`;
|
|
433
456
|
if (!parsed.apply) {
|
|
434
|
-
log("# dry-run (
|
|
457
|
+
log("# dry-run (run without --dry-run to apply)");
|
|
435
458
|
log(pinned ? `remove ${ops.selectionPath}` : noPin);
|
|
436
459
|
return 0;
|
|
437
460
|
}
|
|
@@ -467,7 +490,7 @@ async function runKiroProfile(parsed, log, err, options) {
|
|
|
467
490
|
err(`# ${match.arn} is not in this login's listing; Kiro rejects requests if the login cannot use it`);
|
|
468
491
|
}
|
|
469
492
|
if (!parsed.apply) {
|
|
470
|
-
log("# dry-run (
|
|
493
|
+
log("# dry-run (run without --dry-run to apply)");
|
|
471
494
|
log(`pin ${label} in ${ops.selectionPath}`);
|
|
472
495
|
return 0;
|
|
473
496
|
}
|
|
@@ -487,7 +510,7 @@ async function runKiroProfile(parsed, log, err, options) {
|
|
|
487
510
|
}
|
|
488
511
|
catch (error) {
|
|
489
512
|
err(`kiro: ${error instanceof Error ? error.message : String(error)}`);
|
|
490
|
-
err("the pin is saved; run ns-bridge models refresh kiro
|
|
513
|
+
err("the pin is saved; run ns-bridge models refresh kiro to fetch its catalog");
|
|
491
514
|
return 2;
|
|
492
515
|
}
|
|
493
516
|
}
|
|
@@ -535,7 +558,7 @@ function applySteps(steps, log, err) {
|
|
|
535
558
|
}
|
|
536
559
|
function parseArgs(argv) {
|
|
537
560
|
const positionals = [];
|
|
538
|
-
let apply =
|
|
561
|
+
let apply = true;
|
|
539
562
|
let profile;
|
|
540
563
|
let help = false;
|
|
541
564
|
let stdin = false;
|
|
@@ -563,8 +586,7 @@ function parseArgs(argv) {
|
|
|
563
586
|
continue;
|
|
564
587
|
}
|
|
565
588
|
if (arg === "--apply") {
|
|
566
|
-
apply
|
|
567
|
-
continue;
|
|
589
|
+
return { error: "--apply was removed; mutating commands apply by default. Pass --dry-run to preview." };
|
|
568
590
|
}
|
|
569
591
|
if (arg === "--dry-run") {
|
|
570
592
|
apply = false;
|