@dondetir/ccmux 0.1.2 → 0.1.3

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": "@dondetir/ccmux",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Run Claude Code on GitHub Copilot's backend, a local Anthropic-to-Copilot proxy",
5
5
  "private": false,
6
6
  "publishConfig": {
package/src/index.ts CHANGED
@@ -231,13 +231,16 @@ app.get("/v1/models", async (c) => {
231
231
  // Prefix non-Claude ids so Claude Code's gateway discovery lists gpt/gemini
232
232
  // in /model (it filters to claude-/anthropic-). unaliasModel reverses it on
233
233
  // inbound requests. Fold backend + context size into display_name for the picker.
234
- for (const m of data?.data ?? []) {
235
- if (!m?.id) continue;
234
+ // Pad the name column so the [backend] provider lines up across rows (picker
235
+ // is monospace). Two passes: measure widest name, then format.
236
+ const rows = (data?.data ?? []).filter((m: any) => m?.id);
237
+ const nameW = Math.max(0, ...rows.map((m: any) => (m.name ?? m.id).length));
238
+ for (const m of rows) {
236
239
  const backend =
237
240
  (m._ccmux_backend ?? modelCatalog.get(m.id)?.provider ?? "copilot") === "ollama" ? "ollama" : "copilot";
238
241
  const ctx = m.capabilities?.limits?.max_context_window_tokens ?? m.capabilities?.limits?.max_prompt_tokens;
239
242
  const ctxStr = ctx ? ` (${Math.round(ctx / 1000)}k ctx)` : "";
240
- m.display_name = `${m.name ?? m.id} [${backend}]${ctxStr}`;
243
+ m.display_name = `${(m.name ?? m.id).padEnd(nameW)} [${backend.padEnd(7)}]${ctxStr}`;
241
244
  delete m._ccmux_backend;
242
245
  m.id = aliasModelId(m.id);
243
246
  }
@@ -57,11 +57,10 @@ export function anthropicToResponses(body: AnthropicBody): any {
57
57
 
58
58
  case "tool_use":
59
59
  flushText();
60
- // id = item id for streaming delta routing; call_id = the Anthropic tool_use id.
61
- // Responses API preserves whatever call_id you provide, including toolu_* ids.
60
+ // call_id = the Anthropic tool_use id (toolu_* or call_*), preserved as-is.
61
+ // No `id`: on input it must be a server-issued fc_* id, which we don't have.
62
62
  input.push({
63
63
  type: "function_call",
64
- id: block.id,
65
64
  call_id: block.id,
66
65
  name: block.name,
67
66
  arguments: JSON.stringify(block.input ?? {}),