@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 +1 -1
- package/src/index.ts +6 -3
- package/src/translate-responses.ts +2 -3
package/package.json
CHANGED
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
|
-
|
|
235
|
-
|
|
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}
|
|
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
|
-
//
|
|
61
|
-
//
|
|
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 ?? {}),
|