@skaile/transform-proxy 0.2.3 → 0.2.4
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/CHANGELOG.md +4 -0
- package/README.md +12 -2
- package/dist/omp/index.d.mts +1 -1
- package/dist/omp/index.mjs +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.4
|
|
4
|
+
|
|
5
|
+
- omp extension: the status is one glyph instead of a word: `A` (on), `Ⱥ` (crossed A, off), `A!` (error; was `anon on`, `anon off`, `anon error`). It fits omp's `status` status-line segment; the README shows the `statusLine` config that puts it into the main line.
|
|
6
|
+
|
|
3
7
|
## 0.2.3
|
|
4
8
|
|
|
5
9
|
- omp extension: without `SKAILE_TRANSFORM_PROXY_URL`, `/anon on` starts the proxy as a child process under the system Node (`SKAILE_TRANSFORM_PROXY_NODE`, else `node` from `PATH`; Node ≥ 22) instead of inside omp. omp is a compiled Bun executable whose resolver cannot load transform modules with native or ML dependencies from `node_modules`: under omp 18.14.2, `/anon on` failed with `transform "anon": cannot load module @skaile/forge-anon/proxy: Cannot find package 'ibantools'`. The child runs this package's CLI with the found config, `--port 0 --host 127.0.0.1 --exit-with-stdin` and a random token, which every routed provider sends as `x-skaile-transform-token`. A child that exits before `listening <url>` or stays silent for 60 s fails `/anon on` with its last stderr lines (token redacted). The child exits with omp, does not keep omp's event loop alive, and is replaced on the next turn when it dies. A rotated-out proxy session is no longer dropped: the child keeps its state in memory until it exits, and no request carries that id again.
|
package/README.md
CHANGED
|
@@ -93,14 +93,24 @@ The package ships an [omp](https://omp.sh) extension (subpath `@skaile/transform
|
|
|
93
93
|
omp plugin install @skaile/transform-proxy
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
It adds the command `/anon on|off|status` and
|
|
96
|
+
It adds the command `/anon on|off|status` and a one-glyph status: `A` (on), `Ⱥ` (crossed A, off) or `A!` (error). Unless `SKAILE_TRANSFORM_PROXY_URL` names a running proxy, it needs Node ≥ 22 on `PATH` (or its path in `SKAILE_TRANSFORM_PROXY_NODE`).
|
|
97
|
+
|
|
98
|
+
omp shows extension statuses on an extra line below the status line. To show the glyph in the status line itself, add the `status` segment and turn the extra line off in `~/.omp/agent/config.yml` (`showHookStatus: false` moves every extension status, not just this one, into the segment):
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
statusLine:
|
|
102
|
+
preset: custom
|
|
103
|
+
leftSegments: [vim, model, status, mode, path, git, pr]
|
|
104
|
+
rightSegments: [session_name, token_total, cost, context_pct]
|
|
105
|
+
showHookStatus: false
|
|
106
|
+
```
|
|
97
107
|
|
|
98
108
|
- `/anon on` routes every provider of omp's model registry through the proxy: the provider's `baseUrl` becomes the proxy URL, and the original base URL travels in `x-skaile-transform-upstream`, next to `x-skaile-transform-session` (the omp session id) and the token. The provider's own headers and auth stay in place and are relayed.
|
|
99
109
|
- With `SKAILE_TRANSFORM_PROXY_URL` (and `SKAILE_TRANSFORM_PROXY_TOKEN`) set, it uses that running proxy, and the proxy applies its `defaultPipeline`.
|
|
100
110
|
- Otherwise it starts one proxy per omp process as a child process: the system Node (`SKAILE_TRANSFORM_PROXY_NODE`, else `node` from `PATH`) runs this package's CLI with the config lookup of the CLI (`./.skaile/transform-proxy.yaml`, then `~/.config/skaile/transform-proxy.yaml`), `--port 0 --host 127.0.0.1 --exit-with-stdin` and a random token in `SKAILE_TRANSFORM_PROXY_TOKEN`, which every routed provider sends. That config must set `defaultPipeline`. Without a config, `/anon on` refuses and says where to put one. A child that exits before printing `listening <url>`, or stays silent for 60 s, fails `/anon on` with its last stderr lines.
|
|
101
111
|
- omp is a compiled Bun executable, and its resolver cannot load transform modules with native or ML dependencies (`onnxruntime-node`, `@huggingface/transformers`, `ibantools`) from `node_modules`; Node can. The child exits with omp: its stdin pipe closes when omp exits (SIGKILL included), and omp kills it on a normal exit. It does not keep omp's event loop alive. A child that dies later is replaced on the next turn.
|
|
102
112
|
- Providers on a wire the proxy does not rewrite (Bedrock, Vertex, Gemini, agent bridges, providers without a base URL) are routed too, so the proxy refuses their requests: the setup fails closed. `/anon status` lists them as refused.
|
|
103
|
-
- The session's active model is rebound to the re-routed one, so the next request already uses the new base URL. A rebind that fails is an activation failure: `/anon on` rolls the routes back, saves nothing and stays off. When anon is required, or a later turn's rebind fails while anon is on, the
|
|
113
|
+
- The session's active model is rebound to the re-routed one, so the next request already uses the new base URL. A rebind that fails is an activation failure: `/anon on` rolls the routes back, saves nothing and stays off. When anon is required, or a later turn's rebind fails while anon is on, the status shows `A!`.
|
|
104
114
|
- While anon is on or in error, a `before_provider_request` handler checks every model request: a request whose model does not target the proxy gets its payload replaced with an empty object, so no conversation text leaves, and an error notice names the model. omp has no hook that cancels a provider request, and a throwing handler is only logged, so this replacement is the block.
|
|
105
115
|
- The proxy session follows the root omp session: on `/new`, `/resume`, `/fork` (`session_switch`) and on a root `session_start` with a new session id, every provider is re-routed with the new `x-skaile-transform-session`. The proxy keeps the old session's state in memory until it exits; no request carries that id again. A `session_start` of a headless `print` session (how omp runs subagents) keeps the parent's id, so subagents share its pseudonyms.
|
|
106
116
|
- `/anon off` restores the original base URLs and headers.
|
package/dist/omp/index.d.mts
CHANGED
|
@@ -124,7 +124,7 @@ interface AnonController {
|
|
|
124
124
|
*
|
|
125
125
|
* `wanted`: model requests must go through the proxy (required mode, or `/anon on`).
|
|
126
126
|
* `enabled`: every provider is routed and the active model is rebound. `wanted` without
|
|
127
|
-
* `enabled` is the error state: the
|
|
127
|
+
* `enabled` is the error state: the status shows `A!` and `providerRequest` refuses
|
|
128
128
|
* every request that would bypass the proxy.
|
|
129
129
|
*/
|
|
130
130
|
export declare function createAnonController(deps: AnonControllerDeps): AnonController;
|
package/dist/omp/index.mjs
CHANGED
|
@@ -50,7 +50,7 @@ const VERBS = [
|
|
|
50
50
|
*
|
|
51
51
|
* `wanted`: model requests must go through the proxy (required mode, or `/anon on`).
|
|
52
52
|
* `enabled`: every provider is routed and the active model is rebound. `wanted` without
|
|
53
|
-
* `enabled` is the error state: the
|
|
53
|
+
* `enabled` is the error state: the status shows `A!` and `providerRequest` refuses
|
|
54
54
|
* every request that would bypass the proxy.
|
|
55
55
|
*/
|
|
56
56
|
function createAnonController(deps) {
|
|
@@ -265,8 +265,9 @@ function createAnonController(deps) {
|
|
|
265
265
|
function stateLabel() {
|
|
266
266
|
return enabled ? "on" : wanted ? "error" : "off";
|
|
267
267
|
}
|
|
268
|
+
/** One glyph per state, so the status fits into omp's main status line: `A` on, `Ⱥ` (crossed A) off, `A!` error. */
|
|
268
269
|
function showStatus(ctx) {
|
|
269
|
-
ctx.ui.setStatus(STATUS_KEY,
|
|
270
|
+
ctx.ui.setStatus(STATUS_KEY, enabled ? "A" : wanted ? "A!" : "Ⱥ");
|
|
270
271
|
}
|
|
271
272
|
function statusText(ctx) {
|
|
272
273
|
const registry = ctx.modelRegistry;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skaile/transform-proxy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Same-protocol passthrough proxy that runs model requests and replies through a chain of text transforms (Anthropic Messages, OpenAI chat, OpenAI responses)",
|
|
6
6
|
"license": "MIT",
|