claude-sdk-proxy 2.3.0 → 2.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-sdk-proxy",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Anthropic Messages API proxy backed by Claude Agent SDK — use Claude Max with any API client",
5
5
  "type": "module",
6
6
  "main": "./src/proxy/server.ts",
@@ -435,8 +435,8 @@ export function createProxyServer(config: Partial<ProxyConfig> = {}) {
435
435
  // Client tool mode: serialize all messages as context, inject tools
436
436
  const conversationParts = messages
437
437
  .map((m) => {
438
- const label = m.role === "assistant" ? "[assistant]" : "[user]"
439
- return `${label}\n${serializeContent(m.content, tempFiles)}`
438
+ const tag = m.role === "assistant" ? "assistant_message" : "user_message"
439
+ return `<${tag}>\n${serializeContent(m.content, tempFiles)}\n</${tag}>`
440
440
  })
441
441
  .join("\n\n")
442
442
  const toolsSection = buildClientToolsPrompt(body.tools)
@@ -449,15 +449,15 @@ export function createProxyServer(config: Partial<ProxyConfig> = {}) {
449
449
  systemPrompt = systemContext || undefined
450
450
  prompt = serializeContent(messages[0]!.content, tempFiles)
451
451
  } else {
452
- // Multi-turn: build conversation context with neutral delimiters.
452
+ // Multi-turn: build conversation context with XML-delimited turns.
453
453
  // Put prior turns in system prompt as context, last user message as prompt.
454
454
  const lastMsg = messages[messages.length - 1]!
455
455
  const priorMsgs = messages.slice(0, -1)
456
456
 
457
457
  const contextParts = priorMsgs
458
458
  .map((m) => {
459
- const label = m.role === "assistant" ? "[assistant]" : "[user]"
460
- return `${label}\n${serializeContent(m.content, tempFiles)}`
459
+ const tag = m.role === "assistant" ? "assistant_message" : "user_message"
460
+ return `<${tag}>\n${serializeContent(m.content, tempFiles)}\n</${tag}>`
461
461
  })
462
462
  .join("\n\n")
463
463