@dondetir/ccmux 0.1.1 → 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.1",
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
@@ -216,6 +216,8 @@ app.get("/v1/models", async (c) => {
216
216
  if (!ollamaOnly) throw e;
217
217
  data = { data: [] };
218
218
  }
219
+ // Same filter the official Copilot CLI uses: only models it groups in its picker.
220
+ data.data = (data.data ?? []).filter((m: any) => m.model_picker_category != null);
219
221
  // Push Ollama models so the alias loop below includes them in the picker.
220
222
  for (const [key, entry] of modelCatalog) {
221
223
  if (entry.provider !== "ollama") continue;
@@ -229,13 +231,16 @@ app.get("/v1/models", async (c) => {
229
231
  // Prefix non-Claude ids so Claude Code's gateway discovery lists gpt/gemini
230
232
  // in /model (it filters to claude-/anthropic-). unaliasModel reverses it on
231
233
  // inbound requests. Fold backend + context size into display_name for the picker.
232
- for (const m of data?.data ?? []) {
233
- 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) {
234
239
  const backend =
235
240
  (m._ccmux_backend ?? modelCatalog.get(m.id)?.provider ?? "copilot") === "ollama" ? "ollama" : "copilot";
236
241
  const ctx = m.capabilities?.limits?.max_context_window_tokens ?? m.capabilities?.limits?.max_prompt_tokens;
237
242
  const ctxStr = ctx ? ` (${Math.round(ctx / 1000)}k ctx)` : "";
238
- m.display_name = `${m.name ?? m.id} [${backend}]${ctxStr}`;
243
+ m.display_name = `${(m.name ?? m.id).padEnd(nameW)} [${backend.padEnd(7)}]${ctxStr}`;
239
244
  delete m._ccmux_backend;
240
245
  m.id = aliasModelId(m.id);
241
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 ?? {}),