openzoo 0.50.6 → 0.50.7

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/lib/launch.js CHANGED
@@ -142,7 +142,12 @@ export function claudeZooEnv(baseEnv = process.env, { base, port } = {}) {
142
142
  delete env.ANTHROPIC_API_KEY;
143
143
  env.ANTHROPIC_BASE_URL = url;
144
144
  env.ANTHROPIC_AUTH_TOKEN = baseEnv.ANTHROPIC_AUTH_TOKEN || 'sk-openzoo';
145
- const extras = claudeCodeBinDirs().filter((d) => {
145
+ // HONOUR OPENZOO_CLAUDE_PATH_ONLY HERE TOO. resolveClaudeCli already skips
146
+ // the well-known bin dirs under this flag, but this function was prepending
147
+ // them onto PATH regardless — so the resolver then found `claude` through the
148
+ // doctored PATH and the flag did nothing. The two must agree, or "search only
149
+ // what I gave you" is not a thing a caller can actually ask for.
150
+ const extras = baseEnv.OPENZOO_CLAUDE_PATH_ONLY === '1' ? [] : claudeCodeBinDirs().filter((d) => {
146
151
  try { return fs.existsSync(d); } catch { return false; }
147
152
  });
148
153
  const pathDirs = String(env.PATH || '').split(path.delimiter).filter(Boolean);
package/lib/models.js CHANGED
@@ -332,9 +332,43 @@ export function augmentModelList(payload, { aliases: withAliases = true } = {})
332
332
  };
333
333
  })
334
334
  : [];
335
+
336
+ // BARE-NAME TWINS, DERIVED FROM THE LIVE CATALOG.
337
+ //
338
+ // ALIAS_IDS is thirty hand-written strings against a ~435-model catalog, so
339
+ // it drifts: `/model deepseek-v4-pro` answered "Model not found" purely
340
+ // because nobody had typed that string into the list, while
341
+ // `deepseek/deepseek-v4-pro-0813` worked. Claude Code validates /model
342
+ // CLIENT-SIDE against this payload, so the shim's similarity rewriter never
343
+ // gets a chance — the id has to be in the list or the picker refuses it.
344
+ //
345
+ // For every `vendor/name` row, publish `name` too. That is the form people
346
+ // actually type, and it needs no maintenance as the catalog moves.
347
+ //
348
+ // FIRST WRITER WINS on a collision: two vendors can ship the same bare name
349
+ // and silently resolving to whichever sorted last would answer from the
350
+ // wrong model. A bare name that is already a real id is never shadowed.
351
+ const bare = [];
352
+ if (withAliases) {
353
+ const taken = new Set([...have, ...aliases.map((a) => a.id)]);
354
+ for (const m of data) {
355
+ const short = String(m.id).includes('/') ? String(m.id).split('/').pop() : null;
356
+ if (!short || taken.has(short)) continue;
357
+ taken.add(short);
358
+ bare.push({
359
+ id: short,
360
+ object: 'model',
361
+ owned_by: 'openzoo-alias',
362
+ ...(m.context_length ? { context_length: m.context_length, context_window: m.context_window ?? m.context_length } : {}),
363
+ ...(m.pricing ? { pricing: m.pricing } : {}),
364
+ served_by: m.id,
365
+ });
366
+ }
367
+ }
368
+
335
369
  // Auto is no longer published: routing lives on the backend, and a shim
336
370
  // that advertises openzoo/auto would have to route it.
337
- return { ...payload, object: payload?.object || 'list', data: [...data, ...aliases] };
371
+ return { ...payload, object: payload?.object || 'list', data: [...data, ...aliases, ...bare] };
338
372
  }
339
373
 
340
374
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.50.6",
3
+ "version": "0.50.7",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",