@realtimex/folio 0.1.12 → 0.1.13

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.
@@ -242,6 +242,19 @@ export class ModelCapabilityService {
242
242
 
243
243
  const now = new Date();
244
244
  const key = this.capabilityKey(provider, model, modality);
245
+ const existingEntry = map[key];
246
+ if (this.isManualOverrideActive(existingEntry) && reason !== "manual_override") {
247
+ logger.info(
248
+ `Skipping auto capability update for ${provider}/${model} (${modality}) because manual override is active`,
249
+ {
250
+ requestedState: state,
251
+ requestedReason: reason,
252
+ currentState: existingEntry?.state,
253
+ currentReason: existingEntry?.reason,
254
+ }
255
+ );
256
+ return;
257
+ }
245
258
 
246
259
  const nextEntry: StoredVisionCapability = {
247
260
  state,
@@ -347,6 +360,12 @@ export class ModelCapabilityService {
347
360
  return Number.isFinite(expiryTs) && expiryTs <= Date.now();
348
361
  }
349
362
 
363
+ private static isManualOverrideActive(entry: StoredVisionCapability | undefined): boolean {
364
+ if (!entry) return false;
365
+ if (entry.reason !== "manual_override") return false;
366
+ return !this.isExpired(entry);
367
+ }
368
+
350
369
  private static nextFailureCount(entry: StoredVisionCapability | undefined, nowTs: number): number {
351
370
  if (!entry || entry.state !== "pending_unsupported" || this.isExpired(entry)) {
352
371
  return 1;
@@ -687,7 +706,7 @@ export class ModelCapabilityService {
687
706
  this.providerCapabilityHints(provider, modality)
688
707
  );
689
708
  if (providerSpecificMatches.length > 0) {
690
- score += 2;
709
+ score += 3;
691
710
  evidence.push(...providerSpecificMatches.map((match) => `provider:${match}`));
692
711
  }
693
712
 
@@ -761,7 +780,6 @@ export class ModelCapabilityService {
761
780
  if (normalized.includes("realtimex")) {
762
781
  return [
763
782
  "unsupported file input",
764
- "invalid model",
765
783
  ];
766
784
  }
767
785
  return [];
@@ -790,7 +808,6 @@ export class ModelCapabilityService {
790
808
 
791
809
  if (normalized.includes("realtimex")) {
792
810
  return [
793
- "invalid model",
794
811
  "text-only model",
795
812
  ];
796
813
  }