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