@sliday/tamp 0.2.10 → 0.2.11

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.
Files changed (3) hide show
  1. package/index.js +1 -0
  2. package/package.json +1 -1
  3. package/providers.js +10 -1
package/index.js CHANGED
@@ -174,6 +174,7 @@ return http.createServer(async (req, res) => {
174
174
 
175
175
  try {
176
176
  const parsed = JSON.parse(textBody.toString('utf-8'))
177
+
177
178
  const { body, stats } = await compressRequest(parsed, config, provider)
178
179
  finalBody = Buffer.from(JSON.stringify(body), 'utf-8')
179
180
  // Send uncompressed — simpler and content-length is accurate
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "providers.js",
10
10
  "stats.js"
11
11
  ],
12
- "version": "0.2.10",
12
+ "version": "0.2.11",
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
@@ -66,12 +66,21 @@ const openai = {
66
66
  extract(body) {
67
67
  const targets = []
68
68
 
69
- // Responses API format: body.input with function_call_output items
69
+ // Responses API format: body.input array
70
70
  if (body?.input?.length) {
71
71
  for (let i = 0; i < body.input.length; i++) {
72
72
  const item = body.input[i]
73
73
  if (item.type === 'function_call_output' && typeof item.output === 'string') {
74
74
  targets.push({ path: ['input', i, 'output'], text: item.output, index: i })
75
+ continue
76
+ }
77
+ if (item.type === 'message' && Array.isArray(item.content)) {
78
+ for (let j = 0; j < item.content.length; j++) {
79
+ const part = item.content[j]
80
+ if ((part.type === 'input_text' || part.type === 'output_text') && typeof part.text === 'string') {
81
+ targets.push({ path: ['input', i, 'content', j, 'text'], text: part.text, index: i })
82
+ }
83
+ }
75
84
  }
76
85
  }
77
86
  return targets