@chatpanel/gateway 0.1.8 → 0.1.9
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/package.json +1 -1
- package/src/configstore.js +10 -0
- package/src/ner.js +2 -2
- package/src/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/gateway",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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/configstore.js
CHANGED
|
@@ -52,6 +52,16 @@ export function applyConfigPatch(cfg, patch = {}) {
|
|
|
52
52
|
if (typeof patch.bridge.url === 'string') cfg.bridge.url = patch.bridge.url;
|
|
53
53
|
if (typeof patch.bridge.agent === 'string') cfg.bridge.agent = patch.bridge.agent;
|
|
54
54
|
}
|
|
55
|
+
// api backend: where redacted traffic is forwarded (the client still picks the
|
|
56
|
+
// model + sends its own key).
|
|
57
|
+
if (patch.upstreams && typeof patch.upstreams === 'object') {
|
|
58
|
+
for (const k of ['openai', 'anthropic']) {
|
|
59
|
+
const u = patch.upstreams[k];
|
|
60
|
+
if (u && typeof u.baseUrl === 'string' && u.baseUrl.trim()) {
|
|
61
|
+
cfg.upstreams[k] = { ...cfg.upstreams[k], baseUrl: u.baseUrl.trim() };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
if (patch.redaction && typeof patch.redaction === 'object') {
|
|
56
66
|
const r = patch.redaction;
|
|
57
67
|
if (r.tier === 'basic' || r.tier === 'full') cfg.redaction.tier = r.tier;
|
package/src/ner.js
CHANGED
|
@@ -124,12 +124,12 @@ export function startNer(cfg) {
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
// 3) Poll for readiness; wire detection when up.
|
|
127
|
-
const deadline = Date.now() +
|
|
127
|
+
const deadline = Date.now() + 300_000; // generous: first run installs deps
|
|
128
128
|
while (Date.now() < deadline && !stopped) {
|
|
129
129
|
if (await nerReachable(port, ac.signal)) { wire('ready'); return; }
|
|
130
130
|
await sleep(1000);
|
|
131
131
|
}
|
|
132
|
-
if (!stopped) console.log('[ner] not ready after
|
|
132
|
+
if (!stopped) console.log('[ner] not ready after 300s — continuing deterministic-only (run ./ner/run.sh manually to debug).');
|
|
133
133
|
})();
|
|
134
134
|
|
|
135
135
|
const stop = () => {
|
package/src/server.js
CHANGED
|
@@ -31,7 +31,7 @@ import * as openai from './openai.js';
|
|
|
31
31
|
import * as responses from './responses.js';
|
|
32
32
|
import * as anthropic from './anthropic.js';
|
|
33
33
|
|
|
34
|
-
export const VERSION = '0.1.
|
|
34
|
+
export const VERSION = '0.1.9';
|
|
35
35
|
|
|
36
36
|
const KNOWN_AGENTS = new Set(['codex', 'claude', 'opencode', 'pi', 'kiro', 'antigravity']);
|
|
37
37
|
|