jeopi-cli 16.2.28 → 16.2.29

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,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "jeopi-cli",
4
- "version": "16.2.28",
4
+ "version": "16.2.29",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/akillness/jeopi",
7
7
  "author": "Can Boluk",
@@ -57,17 +57,17 @@
57
57
  "@agentclientprotocol/sdk": "0.25.0",
58
58
  "@babel/parser": "^7.29.7",
59
59
  "@mozilla/readability": "^0.6.0",
60
- "jeopi-hashline": "16.2.28",
61
- "jeopi-stats": "16.2.28",
62
- "jeopi-agent-core": "16.2.28",
63
- "jeopi-ai": "16.2.28",
64
- "jeopi-catalog": "16.2.28",
65
- "jeopi-mnemopi": "16.2.28",
66
- "jeopi-natives": "16.2.28",
67
- "jeopi-tui": "16.2.28",
68
- "jeopi-utils": "16.2.28",
69
- "jeopi-wire": "16.2.28",
70
- "jeopi-snapcompact": "16.2.28",
60
+ "jeopi-hashline": "16.2.29",
61
+ "jeopi-stats": "16.2.29",
62
+ "jeopi-agent-core": "16.2.29",
63
+ "jeopi-ai": "16.2.29",
64
+ "jeopi-catalog": "16.2.29",
65
+ "jeopi-mnemopi": "16.2.29",
66
+ "jeopi-natives": "16.2.29",
67
+ "jeopi-tui": "16.2.29",
68
+ "jeopi-utils": "16.2.29",
69
+ "jeopi-wire": "16.2.29",
70
+ "jeopi-snapcompact": "16.2.29",
71
71
  "@opentelemetry/api": "^1.9.1",
72
72
  "@opentelemetry/context-async-hooks": "^2.7.1",
73
73
  "@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
@@ -156,6 +156,17 @@ const AUTHORITATIVE_RUNTIME_CATALOG_PROVIDERS = new Set<string>(
156
156
  ),
157
157
  );
158
158
 
159
+ function isAuthoritativeLocalDiscovery(providerConfig: DiscoveryProviderConfig): boolean {
160
+ switch (providerConfig.discovery.type) {
161
+ case "ollama":
162
+ case "llama.cpp":
163
+ case "lm-studio":
164
+ return true;
165
+ default:
166
+ return false;
167
+ }
168
+ }
169
+
159
170
  function isAuthoritativeProjectCatalogModel(model: Model<Api>): boolean {
160
171
  return (
161
172
  model.provider === "google-vertex" &&
@@ -1334,7 +1345,21 @@ export class ModelRegistry {
1334
1345
  this.#discoverBuiltInProviderModels(strategy, providerFilter),
1335
1346
  ]);
1336
1347
  const discovered = [...configuredDiscovered, ...builtInDiscovery.models];
1337
- if (discovered.length === 0 && builtInDiscovery.authoritativeProviders.size === 0) {
1348
+ const successfulAuthoritativeDiscoverableProviders = new Set<string>();
1349
+ for (const providerConfig of selectedDiscoverableProviders) {
1350
+ if (!isAuthoritativeLocalDiscovery(providerConfig)) {
1351
+ continue;
1352
+ }
1353
+ const state = this.#providerDiscoveryStates.get(providerConfig.provider);
1354
+ if (state && (state.status === "ok" || state.status === "empty") && !state.stale) {
1355
+ successfulAuthoritativeDiscoverableProviders.add(providerConfig.provider);
1356
+ }
1357
+ }
1358
+ if (
1359
+ discovered.length === 0 &&
1360
+ builtInDiscovery.authoritativeProviders.size === 0 &&
1361
+ successfulAuthoritativeDiscoverableProviders.size === 0
1362
+ ) {
1338
1363
  return;
1339
1364
  }
1340
1365
  const discoveredModels = this.#applyHardcodedModelPolicies(
@@ -1350,6 +1375,9 @@ export class ModelRegistry {
1350
1375
  for (const provider of builtInDiscovery.authoritativeProviders) {
1351
1376
  authoritativeProviders.add(provider);
1352
1377
  }
1378
+ for (const provider of successfulAuthoritativeDiscoverableProviders) {
1379
+ authoritativeProviders.add(provider);
1380
+ }
1353
1381
  const baseModels =
1354
1382
  authoritativeProviders.size > 0 ? dropProviderModels(this.#models, authoritativeProviders) : this.#models;
1355
1383
  const resolved = this.#mergeResolvedModels(baseModels, discoveredModels);
@@ -1385,9 +1413,9 @@ export class ModelRegistry {
1385
1413
  const cacheProviderId = this.#configuredDiscoveryCacheProviderId(providerConfig);
1386
1414
  const cached = readModelCache<Api>(cacheProviderId, 24 * 60 * 60 * 1000, Date.now, this.#cacheDbPath);
1387
1415
  const cacheOlderThanConfig = cached !== null && this.#isDiscoveryCacheOlderThanModelsConfig(cached.updatedAt);
1388
- const bypassFreshCache = providerConfig.discovery.type === "llama.cpp" && strategy === "online-if-uncached";
1389
- const effectiveStrategy =
1390
- strategy === "online-if-uncached" && (cacheOlderThanConfig || bypassFreshCache) ? "online" : strategy;
1416
+ const shouldForceOnlineDiscovery =
1417
+ strategy === "online-if-uncached" && (cacheOlderThanConfig || isAuthoritativeLocalDiscovery(providerConfig));
1418
+ const effectiveStrategy = shouldForceOnlineDiscovery ? "online" : strategy;
1391
1419
  const requiresAuth = !this.#keylessProviders.has(providerConfig.provider);
1392
1420
  if (requiresAuth) {
1393
1421
  const apiKey = await this.#peekApiKeyForProvider(providerConfig.provider);
@@ -1450,7 +1478,10 @@ export class ModelRegistry {
1450
1478
  provider: providerId,
1451
1479
  status,
1452
1480
  optional: providerConfig.optional ?? false,
1453
- stale: result.stale || status === "cached" || ((cacheOlderThanConfig || bypassFreshCache) && status !== "ok"),
1481
+ stale:
1482
+ result.stale ||
1483
+ status === "cached" ||
1484
+ (shouldForceOnlineDiscovery && status !== "ok" && status !== "empty"),
1454
1485
  fetchedAt: discoveryError ? cached?.updatedAt : Date.now(),
1455
1486
  models: result.models.map(model => model.id),
1456
1487
  error: discoveryError,
@@ -1627,7 +1658,9 @@ export class ModelRegistry {
1627
1658
  ): Promise<BuiltInDiscoveryResult> {
1628
1659
  try {
1629
1660
  const manager = createModelManager({ ...options, cacheDbPath: this.#cacheDbPath });
1630
- const result = await manager.refresh(strategy);
1661
+ const effectiveStrategy =
1662
+ strategy === "online-if-uncached" && options.providerId === "lm-studio" ? "online" : strategy;
1663
+ const result = await manager.refresh(effectiveStrategy);
1631
1664
  const models = result.models.map(model =>
1632
1665
  model.provider === options.providerId ? model : { ...model, provider: options.providerId },
1633
1666
  );