unbound-claude-code 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/dist/interceptor.d.ts +2 -4
- package/dist/interceptor.d.ts.map +1 -1
- package/dist/interceptor.js +7 -314
- package/dist/interceptor.js.map +1 -1
- package/package.json +10 -3
package/dist/interceptor.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Unbound Code Interceptor
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* the Anthropic request format intact. Only the response is converted.
|
|
4
|
+
* Ultra-thin interceptor that only handles URL redirection and authentication.
|
|
5
|
+
* All processing is done by the gateway - no format conversion in client.
|
|
7
6
|
*/
|
|
8
7
|
import { UnboundConfig } from "./types";
|
|
9
8
|
export declare class UnboundInterceptor {
|
|
@@ -12,7 +11,6 @@ export declare class UnboundInterceptor {
|
|
|
12
11
|
constructor(config?: UnboundConfig);
|
|
13
12
|
setApiKey(apiKey: string): void;
|
|
14
13
|
private isAnthropicAPI;
|
|
15
|
-
private convertOpenAIToAnthropic;
|
|
16
14
|
instrumentFetch(): void;
|
|
17
15
|
instrumentAll(): void;
|
|
18
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMxC,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAuB;gBAEzB,MAAM,GAAE,aAAkB;IAQ/B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAItC,OAAO,CAAC,cAAc;IAKf,eAAe,IAAI,IAAI;IAmEvB,aAAa,IAAI,IAAI;CAG5B;AAKD,wBAAgB,4BAA4B,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,kBAAkB,CASvF;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CAEjE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAIrD"}
|
package/dist/interceptor.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Unbound Code Interceptor
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the Anthropic request format intact. Only the response is converted.
|
|
5
|
+
* Ultra-thin interceptor that only handles URL redirection and authentication.
|
|
6
|
+
* All processing is done by the gateway - no format conversion in client.
|
|
8
7
|
*/
|
|
9
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
9
|
exports.UnboundInterceptor = void 0;
|
|
@@ -30,41 +29,6 @@ class UnboundInterceptor {
|
|
|
30
29
|
const urlString = typeof url === "string" ? url : url.toString();
|
|
31
30
|
return urlString.includes("api.anthropic.com") && urlString.includes("/v1/messages");
|
|
32
31
|
}
|
|
33
|
-
convertOpenAIToAnthropic(openAIResponse) {
|
|
34
|
-
// Convert OpenAI response format to Anthropic format
|
|
35
|
-
const content = [];
|
|
36
|
-
// Handle tool calls first
|
|
37
|
-
if (openAIResponse.choices?.[0]?.message?.tool_calls) {
|
|
38
|
-
for (const toolCall of openAIResponse.choices[0].message.tool_calls) {
|
|
39
|
-
content.push({
|
|
40
|
-
type: "tool_use",
|
|
41
|
-
id: toolCall.id,
|
|
42
|
-
name: toolCall.function?.name || "unknown",
|
|
43
|
-
input: JSON.parse(toolCall.function?.arguments || "{}")
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Handle text content
|
|
48
|
-
if (openAIResponse.choices?.[0]?.message?.content) {
|
|
49
|
-
content.push({
|
|
50
|
-
type: "text",
|
|
51
|
-
text: openAIResponse.choices?.[0]?.message?.content,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
id: openAIResponse.id || `msg_${Date.now()}`,
|
|
56
|
-
type: "message",
|
|
57
|
-
role: "assistant",
|
|
58
|
-
content: content,
|
|
59
|
-
model: openAIResponse.model || "claude-sonnet-4-20250514",
|
|
60
|
-
stop_reason: openAIResponse.choices?.[0]?.finish_reason === "tool_calls" ? "tool_use" : "end_turn",
|
|
61
|
-
stop_sequence: null,
|
|
62
|
-
usage: {
|
|
63
|
-
input_tokens: openAIResponse.usage?.prompt_tokens || 0,
|
|
64
|
-
output_tokens: openAIResponse.usage?.completion_tokens || 0,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
32
|
instrumentFetch() {
|
|
69
33
|
if (!global.fetch) {
|
|
70
34
|
return;
|
|
@@ -85,303 +49,32 @@ class UnboundInterceptor {
|
|
|
85
49
|
throw new Error("Unbound API key not set. Please set your API key first.");
|
|
86
50
|
}
|
|
87
51
|
try {
|
|
88
|
-
//
|
|
89
|
-
let claudeApiKey = null;
|
|
90
|
-
if (init.headers) {
|
|
91
|
-
if (init.headers instanceof Headers) {
|
|
92
|
-
claudeApiKey = init.headers.get('authorization')?.replace('Bearer ', '') || null;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
const headers = init.headers;
|
|
96
|
-
claudeApiKey = headers['authorization']?.replace('Bearer ', '') || null;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Parse original request body (keep in Anthropic format)
|
|
100
|
-
let requestBody = {};
|
|
101
|
-
if (init.body) {
|
|
102
|
-
try {
|
|
103
|
-
requestBody = JSON.parse(init.body);
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
return originalFetch(input, init);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
// Prepare new request to Unbound API v1/messages endpoint
|
|
52
|
+
// Redirect URL to Unbound gateway
|
|
110
53
|
const unboundUrl = `${interceptor.config.baseUrl}/messages`;
|
|
111
|
-
//
|
|
54
|
+
// Copy all original headers
|
|
112
55
|
const unboundHeaders = {};
|
|
113
|
-
// Copy original headers
|
|
114
56
|
if (init.headers) {
|
|
115
57
|
if (init.headers instanceof Headers) {
|
|
116
|
-
// Convert Headers object to plain object with lowercase keys
|
|
117
58
|
init.headers.forEach((value, key) => {
|
|
118
59
|
unboundHeaders[key.toLowerCase()] = value;
|
|
119
60
|
});
|
|
120
61
|
}
|
|
121
62
|
else {
|
|
122
|
-
// Copy from plain object
|
|
123
63
|
Object.entries(init.headers).forEach(([key, value]) => {
|
|
124
|
-
// Handle both string and array of strings
|
|
125
64
|
const headerValue = Array.isArray(value) ? value.join(', ') : String(value);
|
|
126
65
|
unboundHeaders[key.toLowerCase()] = headerValue;
|
|
127
66
|
});
|
|
128
67
|
}
|
|
129
68
|
}
|
|
130
|
-
// Replace Authorization with Unbound API key and add
|
|
69
|
+
// Replace Authorization with Unbound API key and add metadata
|
|
131
70
|
unboundHeaders["authorization"] = `Bearer ${interceptor.apiKey}`;
|
|
132
71
|
Object.assign(unboundHeaders, DEFAULT_HEADERS);
|
|
133
|
-
if (claudeApiKey) {
|
|
134
|
-
unboundHeaders["claude-code-key"] = claudeApiKey;
|
|
135
|
-
}
|
|
136
72
|
const newInit = {
|
|
137
73
|
...init,
|
|
138
|
-
method: "POST",
|
|
139
74
|
headers: unboundHeaders,
|
|
140
|
-
body: JSON.stringify(requestBody), // Send Anthropic format as-is
|
|
141
75
|
};
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
if (!response.ok) {
|
|
145
|
-
const errorText = await response.text();
|
|
146
|
-
throw new Error(`Unbound API error: ${response.status} ${response.statusText} - ${errorText}`);
|
|
147
|
-
}
|
|
148
|
-
// Handle streaming response
|
|
149
|
-
if (requestBody.stream) {
|
|
150
|
-
const reader = response.body?.getReader();
|
|
151
|
-
if (!reader) {
|
|
152
|
-
throw new Error("No readable stream in response");
|
|
153
|
-
}
|
|
154
|
-
// Create a new ReadableStream that converts OpenAI chunks to Anthropic format
|
|
155
|
-
const transformedStream = new ReadableStream({
|
|
156
|
-
async start(controller) {
|
|
157
|
-
const decoder = new TextDecoder();
|
|
158
|
-
const encoder = new TextEncoder();
|
|
159
|
-
let buffer = "";
|
|
160
|
-
let hasStartedContent = false;
|
|
161
|
-
let hasStartedToolUse = false;
|
|
162
|
-
let currentToolUseIndex = 0;
|
|
163
|
-
let currentToolCall = null;
|
|
164
|
-
let messageId = `msg_${Date.now()}`;
|
|
165
|
-
let finalInputTokens = 0;
|
|
166
|
-
let finalOutputTokens = 0;
|
|
167
|
-
let pingInterval;
|
|
168
|
-
try {
|
|
169
|
-
// Send initial message_start event with proper SSE format
|
|
170
|
-
const messageStart = {
|
|
171
|
-
type: "message_start",
|
|
172
|
-
message: {
|
|
173
|
-
id: messageId,
|
|
174
|
-
type: "message",
|
|
175
|
-
role: "assistant",
|
|
176
|
-
content: [],
|
|
177
|
-
model: "claude-sonnet-4-20250514",
|
|
178
|
-
stop_reason: null,
|
|
179
|
-
stop_sequence: null,
|
|
180
|
-
usage: { input_tokens: 0, output_tokens: 0 }
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
controller.enqueue(encoder.encode(`event: message_start\ndata: ${JSON.stringify(messageStart)}\n\n`));
|
|
184
|
-
// Start periodic ping events (every 15 seconds)
|
|
185
|
-
pingInterval = setInterval(() => {
|
|
186
|
-
try {
|
|
187
|
-
const pingEvent = { type: "ping" };
|
|
188
|
-
controller.enqueue(encoder.encode(`event: ping\ndata: ${JSON.stringify(pingEvent)}\n\n`));
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
// If enqueue fails, clear the interval to prevent memory leak
|
|
192
|
-
if (pingInterval) {
|
|
193
|
-
clearInterval(pingInterval);
|
|
194
|
-
pingInterval = undefined;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}, 15000);
|
|
198
|
-
while (true) {
|
|
199
|
-
const { done, value } = await reader.read();
|
|
200
|
-
if (done) {
|
|
201
|
-
// Clear ping interval
|
|
202
|
-
if (pingInterval) {
|
|
203
|
-
clearInterval(pingInterval);
|
|
204
|
-
}
|
|
205
|
-
// Send content_block_stop for any open tool use
|
|
206
|
-
if (hasStartedToolUse) {
|
|
207
|
-
const toolUseStop = {
|
|
208
|
-
type: "content_block_stop",
|
|
209
|
-
index: currentToolUseIndex
|
|
210
|
-
};
|
|
211
|
-
controller.enqueue(encoder.encode(`event: content_block_stop\ndata: ${JSON.stringify(toolUseStop)}\n\n`));
|
|
212
|
-
}
|
|
213
|
-
// Send content_block_stop if we started content
|
|
214
|
-
if (hasStartedContent) {
|
|
215
|
-
const contentStop = {
|
|
216
|
-
type: "content_block_stop",
|
|
217
|
-
index: currentToolUseIndex
|
|
218
|
-
};
|
|
219
|
-
controller.enqueue(encoder.encode(`event: content_block_stop\ndata: ${JSON.stringify(contentStop)}\n\n`));
|
|
220
|
-
}
|
|
221
|
-
// Send message_delta with final usage
|
|
222
|
-
const messageDelta = {
|
|
223
|
-
type: "message_delta",
|
|
224
|
-
delta: {
|
|
225
|
-
stop_reason: "end_turn",
|
|
226
|
-
stop_sequence: null
|
|
227
|
-
},
|
|
228
|
-
usage: {
|
|
229
|
-
input_tokens: finalInputTokens,
|
|
230
|
-
output_tokens: finalOutputTokens
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
controller.enqueue(encoder.encode(`event: message_delta\ndata: ${JSON.stringify(messageDelta)}\n\n`));
|
|
234
|
-
// Send message_stop
|
|
235
|
-
const messageStop = {
|
|
236
|
-
type: "message_stop"
|
|
237
|
-
};
|
|
238
|
-
controller.enqueue(encoder.encode(`event: message_stop\ndata: ${JSON.stringify(messageStop)}\n\n`));
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
buffer += decoder.decode(value, { stream: true });
|
|
242
|
-
const lines = buffer.split("\n");
|
|
243
|
-
buffer = lines.pop() || "";
|
|
244
|
-
for (const line of lines) {
|
|
245
|
-
if (line.trim().startsWith("data: ")) {
|
|
246
|
-
const jsonPart = line.substring(6).trim();
|
|
247
|
-
if (jsonPart === "[DONE]")
|
|
248
|
-
continue;
|
|
249
|
-
try {
|
|
250
|
-
const openAIChunk = JSON.parse(jsonPart);
|
|
251
|
-
// Extract final token usage from the complete response (usually in the last chunk)
|
|
252
|
-
if (openAIChunk.usage) {
|
|
253
|
-
finalInputTokens = openAIChunk.usage.prompt_tokens || finalInputTokens;
|
|
254
|
-
finalOutputTokens = openAIChunk.usage.completion_tokens || finalOutputTokens;
|
|
255
|
-
}
|
|
256
|
-
// Handle tool calls first (they come before content)
|
|
257
|
-
if (openAIChunk.choices?.[0]?.delta?.tool_calls) {
|
|
258
|
-
const toolCall = openAIChunk.choices[0]?.delta?.tool_calls[0];
|
|
259
|
-
if (toolCall && toolCall.id && !hasStartedToolUse) {
|
|
260
|
-
// Start new tool use block - use exact ID from gateway
|
|
261
|
-
const toolId = toolCall.id;
|
|
262
|
-
currentToolCall = {
|
|
263
|
-
id: toolId,
|
|
264
|
-
name: toolCall.function?.name || "unknown",
|
|
265
|
-
input: ""
|
|
266
|
-
};
|
|
267
|
-
const toolUseStart = {
|
|
268
|
-
type: "content_block_start",
|
|
269
|
-
index: currentToolUseIndex,
|
|
270
|
-
content_block: {
|
|
271
|
-
type: "tool_use",
|
|
272
|
-
id: toolId,
|
|
273
|
-
name: currentToolCall.name,
|
|
274
|
-
input: {}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
controller.enqueue(encoder.encode(`event: content_block_start\ndata: ${JSON.stringify(toolUseStart)}\n\n`));
|
|
278
|
-
hasStartedToolUse = true;
|
|
279
|
-
}
|
|
280
|
-
// Stream tool arguments
|
|
281
|
-
if (toolCall?.function?.arguments && currentToolCall) {
|
|
282
|
-
const argumentDelta = {
|
|
283
|
-
type: "content_block_delta",
|
|
284
|
-
index: currentToolUseIndex,
|
|
285
|
-
delta: {
|
|
286
|
-
type: "input_json_delta",
|
|
287
|
-
partial_json: toolCall.function.arguments
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
controller.enqueue(encoder.encode(`event: content_block_delta\ndata: ${JSON.stringify(argumentDelta)}\n\n`));
|
|
291
|
-
currentToolCall.input += toolCall.function.arguments;
|
|
292
|
-
}
|
|
293
|
-
// Complete tool use if done
|
|
294
|
-
if (openAIChunk.choices[0]?.finish_reason === "tool_calls" && hasStartedToolUse) {
|
|
295
|
-
const toolUseStop = {
|
|
296
|
-
type: "content_block_stop",
|
|
297
|
-
index: currentToolUseIndex
|
|
298
|
-
};
|
|
299
|
-
controller.enqueue(encoder.encode(`event: content_block_stop\ndata: ${JSON.stringify(toolUseStop)}\n\n`));
|
|
300
|
-
currentToolUseIndex++;
|
|
301
|
-
hasStartedToolUse = false;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
// Handle text content (comes after tool calls)
|
|
305
|
-
if (openAIChunk.choices?.[0]?.delta?.content) {
|
|
306
|
-
// Send content_block_start if this is the first content
|
|
307
|
-
if (!hasStartedContent) {
|
|
308
|
-
const contentStart = {
|
|
309
|
-
type: "content_block_start",
|
|
310
|
-
index: currentToolUseIndex,
|
|
311
|
-
content_block: {
|
|
312
|
-
type: "text",
|
|
313
|
-
text: ""
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
controller.enqueue(encoder.encode(`event: content_block_start\ndata: ${JSON.stringify(contentStart)}\n\n`));
|
|
317
|
-
hasStartedContent = true;
|
|
318
|
-
}
|
|
319
|
-
// Send content delta
|
|
320
|
-
const contentDelta = {
|
|
321
|
-
type: "content_block_delta",
|
|
322
|
-
index: currentToolUseIndex,
|
|
323
|
-
delta: {
|
|
324
|
-
type: "text_delta",
|
|
325
|
-
text: openAIChunk.choices[0]?.delta?.content
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
controller.enqueue(encoder.encode(`event: content_block_delta\ndata: ${JSON.stringify(contentDelta)}\n\n`));
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
catch (e) {
|
|
332
|
-
console.error("Error processing chunk:", e);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
catch (error) {
|
|
339
|
-
// Clear ping interval on error
|
|
340
|
-
if (pingInterval) {
|
|
341
|
-
clearInterval(pingInterval);
|
|
342
|
-
}
|
|
343
|
-
controller.error(error);
|
|
344
|
-
}
|
|
345
|
-
finally {
|
|
346
|
-
// Ensure ping interval is cleared
|
|
347
|
-
if (pingInterval) {
|
|
348
|
-
clearInterval(pingInterval);
|
|
349
|
-
}
|
|
350
|
-
controller.close();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
return new Response(transformedStream, {
|
|
355
|
-
status: response.status,
|
|
356
|
-
statusText: response.statusText,
|
|
357
|
-
headers: {
|
|
358
|
-
...Object.fromEntries(response.headers.entries()),
|
|
359
|
-
"Content-Type": "text/event-stream",
|
|
360
|
-
},
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
// Non-streaming response
|
|
365
|
-
const responseText = await response.text();
|
|
366
|
-
let unboundResponse;
|
|
367
|
-
try {
|
|
368
|
-
unboundResponse = JSON.parse(responseText);
|
|
369
|
-
}
|
|
370
|
-
catch (error) {
|
|
371
|
-
throw new Error(`Failed to parse Unbound API response: ${error instanceof Error ? error.message : 'Invalid JSON'}`);
|
|
372
|
-
}
|
|
373
|
-
// Convert OpenAI response to Anthropic format
|
|
374
|
-
const anthropicResponse = interceptor.convertOpenAIToAnthropic(unboundResponse);
|
|
375
|
-
// Return the response directly in JSON format
|
|
376
|
-
return new Response(JSON.stringify(anthropicResponse), {
|
|
377
|
-
status: response.status,
|
|
378
|
-
statusText: response.statusText,
|
|
379
|
-
headers: {
|
|
380
|
-
...Object.fromEntries(response.headers.entries()),
|
|
381
|
-
"Content-Type": "application/json",
|
|
382
|
-
},
|
|
383
|
-
});
|
|
384
|
-
}
|
|
76
|
+
// Direct passthrough - gateway handles everything
|
|
77
|
+
return originalFetch(unboundUrl, newInit);
|
|
385
78
|
}
|
|
386
79
|
catch (error) {
|
|
387
80
|
console.error("Unbound interceptor error:", error);
|
package/dist/interceptor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptor.js","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA+aH,oEASC;AAED,sDAEC;AAED,4CAIC;AA9bD,MAAM,eAAe,GAAG;IACvB,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC;CAChG,CAAA;AAED,MAAa,kBAAkB;IAI9B,YAAY,SAAwB,EAAE;QAF9B,WAAM,GAAkB,IAAI,CAAC;QAGpC,IAAI,CAAC,MAAM,GAAG;YACb,OAAO,EAAE,8BAA8B;YACvC,QAAQ,EAAE,MAAM;YAChB,GAAG,MAAM;SACT,CAAC;IACH,CAAC;IAEM,SAAS,CAAC,MAAc;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAEO,cAAc,CAAC,GAAiB;QACvC,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACjE,OAAO,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC;IAEO,wBAAwB,CAAC,cAAmB;QACnD,qDAAqD;QACrD,MAAM,OAAO,GAAU,EAAE,CAAC;QAE1B,0BAA0B;QAC1B,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAA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AiB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unbound-claude-code",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Claude Code with Unbound integration - Drop-in replacement for Claude Code with multi-provider routing and cost optimization",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"dev": "tsc --watch --preserveWatchOutput",
|
|
12
12
|
"clean": "rm -rf dist",
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test:watch": "jest --watch",
|
|
16
|
+
"test:coverage": "jest --coverage",
|
|
14
17
|
"prepare": "npm run build",
|
|
15
18
|
"prepublishOnly": "npm run clean && npm run build && npm run typecheck"
|
|
16
19
|
},
|
|
@@ -46,13 +49,17 @@
|
|
|
46
49
|
"win32"
|
|
47
50
|
],
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@types/
|
|
52
|
+
"@types/jest": "^30.0.0",
|
|
50
53
|
"@types/node": "^20.0.0",
|
|
54
|
+
"electron-rebuild": "^3.2.9",
|
|
55
|
+
"jest": "^30.0.2",
|
|
56
|
+
"ts-jest": "^29.4.0",
|
|
51
57
|
"typescript": "^5.0.0"
|
|
52
58
|
},
|
|
53
59
|
"dependencies": {
|
|
54
60
|
"@anthropic-ai/claude-code": ">=0.1.0",
|
|
55
|
-
"keytar": "^7.9.0"
|
|
61
|
+
"keytar": "^7.9.0",
|
|
62
|
+
"rebuild": "^0.1.2"
|
|
56
63
|
},
|
|
57
64
|
"peerDependencies": {
|
|
58
65
|
"@anthropic-ai/claude-code": ">=0.1.0"
|