@realtimex/folio 0.1.12 → 0.1.14

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.
@@ -9,8 +9,12 @@ export class ModelCapabilityService {
9
9
  static UNSUPPORTED_CONFIRMATION_FAILURES = 2;
10
10
  static UNSUPPORTED_SCORE_THRESHOLD = 3;
11
11
  static resolveVisionSupport(settingsRow, modality = "image") {
12
- const provider = (settingsRow?.llm_provider || SDKService.DEFAULT_LLM_PROVIDER).trim();
13
- const model = (settingsRow?.llm_model || SDKService.DEFAULT_LLM_MODEL).trim();
12
+ const provider = (settingsRow?.ingestion_llm_provider ||
13
+ settingsRow?.llm_provider ||
14
+ SDKService.DEFAULT_LLM_PROVIDER).trim();
15
+ const model = (settingsRow?.ingestion_llm_model ||
16
+ settingsRow?.llm_model ||
17
+ SDKService.DEFAULT_LLM_MODEL).trim();
14
18
  const state = this.getVisionState(settingsRow?.vision_model_capabilities, provider, model, modality);
15
19
  return {
16
20
  provider,
@@ -126,6 +130,16 @@ export class ModelCapabilityService {
126
130
  }
127
131
  const now = new Date();
128
132
  const key = this.capabilityKey(provider, model, modality);
133
+ const existingEntry = map[key];
134
+ if (this.isManualOverrideActive(existingEntry) && reason !== "manual_override") {
135
+ logger.info(`Skipping auto capability update for ${provider}/${model} (${modality}) because manual override is active`, {
136
+ requestedState: state,
137
+ requestedReason: reason,
138
+ currentState: existingEntry?.state,
139
+ currentReason: existingEntry?.reason,
140
+ });
141
+ return;
142
+ }
129
143
  const nextEntry = {
130
144
  state,
131
145
  learned_at: now.toISOString(),
@@ -212,6 +226,13 @@ export class ModelCapabilityService {
212
226
  const expiryTs = Date.parse(entry.expires_at);
213
227
  return Number.isFinite(expiryTs) && expiryTs <= Date.now();
214
228
  }
229
+ static isManualOverrideActive(entry) {
230
+ if (!entry)
231
+ return false;
232
+ if (entry.reason !== "manual_override")
233
+ return false;
234
+ return !this.isExpired(entry);
235
+ }
215
236
  static nextFailureCount(entry, nowTs) {
216
237
  if (!entry || entry.state !== "pending_unsupported" || this.isExpired(entry)) {
217
238
  return 1;
@@ -496,7 +517,7 @@ export class ModelCapabilityService {
496
517
  }
497
518
  const providerSpecificMatches = this.matchMessage(signal.message, this.providerCapabilityHints(provider, modality));
498
519
  if (providerSpecificMatches.length > 0) {
499
- score += 2;
520
+ score += 3;
500
521
  evidence.push(...providerSpecificMatches.map((match) => `provider:${match}`));
501
522
  }
502
523
  const weakCapabilityHints = this.matchMessage(signal.message, modality === "pdf"
@@ -561,7 +582,6 @@ export class ModelCapabilityService {
561
582
  if (normalized.includes("realtimex")) {
562
583
  return [
563
584
  "unsupported file input",
564
- "invalid model",
565
585
  ];
566
586
  }
567
587
  return [];
@@ -586,7 +606,6 @@ export class ModelCapabilityService {
586
606
  }
587
607
  if (normalized.includes("realtimex")) {
588
608
  return [
589
- "invalid model",
590
609
  "text-only model",
591
610
  ];
592
611
  }