@chatpanel/gateway 0.85.3 → 0.85.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.
@@ -1,2 +1,2 @@
1
- import{pathToFileURL as s}from"node:url";import{createRequire as m}from"node:module";import{existsSync as l,readFileSync as c}from"node:fs";import{join as f}from"node:path";import{homedir as p}from"node:os";import{normalizeRegistries as u}from"@chatpanel/events/registries.js";import d from"../assets/ort-wasm-simd-threaded.wasm";import g from"../assets/ort-wasm-simd-threaded.mjs";import{findNativeBinding as _,ensureNativeOrt as h}from"../src/ort-native.js";function A(){try{const e=process.env.CHATPANEL_GATEWAY_CONFIG||f(p(),".chatpanel","gateway.config.json"),i=l(e)?JSON.parse(c(e,"utf8")):{},r={npm:process.env.CHATPANEL_REGISTRY_NPM,models:process.env.CHATPANEL_REGISTRY_MODELS};return u({...i.registries||{},...r.npm?{npm:r.npm}:{},...r.models?{models:r.models}:{}})}catch{return{}}}const t=e=>{try{process.stderr.write(`[ort] ${e}
2
- `)}catch{}};let n=null,a=!1;function N(e){if(a)return n;a=!0;try{n=m(import.meta.url)(e),t(`native runtime loaded — ${e}`)}catch(i){t(`native runtime would not load (${String(i?.message||i).slice(0,120)}) — falling back to WASM`),n=null}return n}let o=_();o||h({registries:A(),onProgress:e=>{e.phase==="download"&&t(`fetching the native runtime once (~108 MB) from ${new URL(e.url).host} — WASM answers until it lands`)}}).then(e=>t(`native runtime ready — ${e} (restart to use it)`)).catch(e=>t(`no native runtime (${String(e?.message||e).slice(0,120)}) — staying on WASM`)),o?globalThis.__CHATPANEL_ORT_BINDING__=()=>N(o):globalThis.__CHATPANEL_WASM_PATHS__={wasm:s(d).href,mjs:s(g).href},await import("./chatpanel-gateway.js");
1
+ import{pathToFileURL as o}from"node:url";import{createRequire as l}from"node:module";import{existsSync as f,readFileSync as u}from"node:fs";import{join as g}from"node:path";import{homedir as h}from"node:os";import{normalizeRegistries as p}from"@chatpanel/events/registries.js";import d from"../assets/ort-wasm-simd-threaded.wasm";import _ from"../assets/ort-wasm-simd-threaded.mjs";import{findNativeBinding as v,ensureNativeOrt as a}from"../src/ort-native.js";function m(){try{const e=process.env.CHATPANEL_GATEWAY_CONFIG||g(h(),".chatpanel","gateway.config.json"),r=f(e)?JSON.parse(u(e,"utf8")):{},n={npm:process.env.CHATPANEL_REGISTRY_NPM,models:process.env.CHATPANEL_REGISTRY_MODELS};return p({...r.registries||{},...n.npm?{npm:n.npm}:{},...n.models?{models:n.models}:{}})}catch{return{}}}const t=e=>{try{process.stderr.write(`[ort] ${e}
2
+ `)}catch{}};let s=null,c=!1;function w(e){if(c)return s;c=!0;try{s=l(import.meta.url)(e),t(`native runtime loaded — ${e}`)}catch(r){t(`native runtime would not load (${String(r?.message||r).slice(0,120)}) — falling back to WASM`),s=null}return s}let i=v();const A=process.argv.includes("--install")||process.argv.includes("--fetch-runtime");if(!i&&A)try{i=await a({registries:m(),onProgress:e=>{e.phase==="download"&&t(`fetching the native runtime once (~108 MB) from ${new URL(e.url).host}…`)}}),t(`native runtime ready — ${i}`)}catch(e){t(`no native runtime yet (${String(e?.message||e).slice(0,120)}) — the gateway will fetch it when it starts`)}process.argv.includes("--fetch-runtime")&&process.exit(i?0:1),i||a({registries:m(),onProgress:e=>{e.phase==="download"&&t(`fetching the native runtime once (~108 MB) from ${new URL(e.url).host} — WASM answers until it lands`)}}).then(e=>t(`native runtime ready — ${e} (restart to use it)`)).catch(e=>t(`no native runtime (${String(e?.message||e).slice(0,120)}) — staying on WASM`)),i?globalThis.__CHATPANEL_ORT_BINDING__=()=>w(i):globalThis.__CHATPANEL_WASM_PATHS__={wasm:o(d).href,mjs:o(_).href},await import("./chatpanel-gateway.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/gateway",
3
- "version": "0.85.3",
3
+ "version": "0.85.4",
4
4
  "description": "Local privacy gateway — redacts PII out of OpenAI/Anthropic API traffic before it reaches a model, then restores it in the reply. Point opencode, codex, aider, Claude Code, etc. at it.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/version.js CHANGED
@@ -1 +1 @@
1
- const o="0.85.3";export{o as VERSION};
1
+ const o="0.85.4";export{o as VERSION};