@sliday/tamp 0.2.0 → 0.2.1

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/index.js CHANGED
@@ -94,7 +94,8 @@ return http.createServer(async (req, res) => {
94
94
  }
95
95
 
96
96
  const upstream = config.upstreams?.[provider.name] || config.upstream
97
- const upstreamUrl = new URL(req.url, upstream)
97
+ const reqUrl = provider.normalizeUrl ? provider.normalizeUrl(req.url) : req.url
98
+ const upstreamUrl = new URL(reqUrl, upstream)
98
99
 
99
100
  const chunks = []
100
101
  let size = 0
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "providers.js",
10
10
  "stats.js"
11
11
  ],
12
- "version": "0.2.0",
12
+ "version": "0.2.1",
13
13
  "description": "Token compression proxy for coding agents. Works with Claude Code, Aider, Cursor, Cline, Windsurf. 33.9% fewer input tokens.",
14
14
  "type": "module",
15
15
  "main": "index.js",
package/providers.js CHANGED
@@ -51,7 +51,11 @@ const anthropic = {
51
51
  const openai = {
52
52
  name: 'openai',
53
53
  match(method, url) {
54
- return method === 'POST' && url.startsWith('/v1/chat/completions')
54
+ return method === 'POST' && (url.startsWith('/v1/chat/completions') || url.startsWith('/chat/completions'))
55
+ },
56
+ normalizeUrl(url) {
57
+ if (url.startsWith('/chat/completions')) return '/v1' + url
58
+ return url
55
59
  },
56
60
  extract(body) {
57
61
  const targets = []