@skaile/transform-proxy 0.2.4 → 0.2.5
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 +3 -3
- package/dist/omp/index.d.mts +1 -1
- package/dist/omp/index.mjs +6 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.5
|
|
4
|
+
|
|
5
|
+
- omp extension: the status is `🟢A` (on), `🔴A` (off), `🟠A` (error) instead of `A`, `Ⱥ`, `A!`. The crossed A was not legible in common terminal fonts, and omp strips ANSI colour from extension statuses, so the colour comes from an emoji.
|
|
6
|
+
|
|
3
7
|
## 0.2.4
|
|
4
8
|
|
|
5
9
|
- 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.
|
package/README.md
CHANGED
|
@@ -93,9 +93,9 @@ 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 a
|
|
96
|
+
It adds the command `/anon on|off|status` and a compact status: `🟢A` (on), `🔴A` (off) or `🟠A` (error). The colour is in the emoji because omp strips ANSI colour from extension statuses and draws them in its accent colour. Unless `SKAILE_TRANSFORM_PROXY_URL` names a running proxy, it needs Node ≥ 22 on `PATH` (or its path in `SKAILE_TRANSFORM_PROXY_NODE`).
|
|
97
97
|
|
|
98
|
-
omp shows extension statuses on an extra line below the status line. To show the
|
|
98
|
+
omp shows extension statuses on an extra line below the status line. To show the status 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
99
|
|
|
100
100
|
```yaml
|
|
101
101
|
statusLine:
|
|
@@ -110,7 +110,7 @@ statusLine:
|
|
|
110
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.
|
|
111
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.
|
|
112
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.
|
|
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
|
|
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`.
|
|
114
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.
|
|
115
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.
|
|
116
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 status shows `
|
|
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 status shows `
|
|
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,9 +265,12 @@ function createAnonController(deps) {
|
|
|
265
265
|
function stateLabel() {
|
|
266
266
|
return enabled ? "on" : wanted ? "error" : "off";
|
|
267
267
|
}
|
|
268
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* Compact status for omp's main status line. omp strips ANSI colour from extension statuses and
|
|
270
|
+
* paints them in its accent colour, so the colour comes from an emoji: green on, red off, orange error.
|
|
271
|
+
*/
|
|
269
272
|
function showStatus(ctx) {
|
|
270
|
-
ctx.ui.setStatus(STATUS_KEY, enabled ? "A" : wanted ? "A
|
|
273
|
+
ctx.ui.setStatus(STATUS_KEY, enabled ? "🟢A" : wanted ? "🟠A" : "🔴A");
|
|
271
274
|
}
|
|
272
275
|
function statusText(ctx) {
|
|
273
276
|
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.5",
|
|
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",
|