@blockrun/clawrouter 0.9.13 → 0.9.15

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/cli.js CHANGED
@@ -1356,7 +1356,7 @@ function route(prompt, systemPrompt, maxOutputTokens, options) {
1356
1356
 
1357
1357
  // src/models.ts
1358
1358
  var MODEL_ALIASES = {
1359
- // Claude
1359
+ // Claude - short names
1360
1360
  claude: "anthropic/claude-sonnet-4",
1361
1361
  sonnet: "anthropic/claude-sonnet-4",
1362
1362
  opus: "anthropic/claude-opus-4.6",
@@ -1364,6 +1364,11 @@ var MODEL_ALIASES = {
1364
1364
  "opus-46": "anthropic/claude-opus-4.6",
1365
1365
  "opus-45": "anthropic/claude-opus-4.5",
1366
1366
  haiku: "anthropic/claude-haiku-4.5",
1367
+ // Claude - provider/shortname patterns (common in agent frameworks)
1368
+ "anthropic/sonnet": "anthropic/claude-sonnet-4",
1369
+ "anthropic/opus": "anthropic/claude-opus-4.6",
1370
+ "anthropic/haiku": "anthropic/claude-haiku-4.5",
1371
+ "anthropic/claude": "anthropic/claude-sonnet-4",
1367
1372
  // OpenAI
1368
1373
  gpt: "openai/gpt-4o",
1369
1374
  gpt4: "openai/gpt-4o",
@@ -4231,6 +4236,7 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
4231
4236
  isStreaming = parsed.stream === true;
4232
4237
  modelId = parsed.model || "";
4233
4238
  maxTokens = parsed.max_tokens || 4096;
4239
+ let bodyModified = false;
4234
4240
  if (sessionId && Array.isArray(parsed.messages)) {
4235
4241
  const messages = parsed.messages;
4236
4242
  const lastUserMsg = [...messages].reverse().find((m) => m.role === "user");
@@ -4248,13 +4254,13 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
4248
4254
  messages.unshift({ role: "system", content: journalText });
4249
4255
  }
4250
4256
  parsed.messages = messages;
4257
+ bodyModified = true;
4251
4258
  console.log(
4252
4259
  `[ClawRouter] Injected session journal (${journalText.length} chars) for session ${sessionId.slice(0, 8)}...`
4253
4260
  );
4254
4261
  }
4255
4262
  }
4256
4263
  }
4257
- let bodyModified = false;
4258
4264
  if (parsed.stream === true) {
4259
4265
  parsed.stream = false;
4260
4266
  bodyModified = true;