@ai-matrx/agents 0.59.202 → 0.59.204

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/CHANGELOG.md CHANGED
@@ -1,10 +1,15 @@
1
1
  # Changelog
2
2
 
3
- ## 0.59.202
3
+ ## 0.59.204
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/matrx-agents/src`.
7
7
 
8
+ ## 0.59.202
9
+
10
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 6085e09f65 87ac441108 -- apps/shared/matrx-agents/src`
11
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
12
+
8
13
  ## 0.59.201
9
14
 
10
15
  Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff ea809490d8 6085e09f65 -- apps/shared/matrx-agents/src`
@@ -703,7 +703,7 @@ var MANDATE_KEYS = {
703
703
  */
704
704
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
705
705
  /**
706
- * @deprecated retiring since 0.59.202 — no longer declared in
706
+ * @deprecated retiring since 0.59.204 — no longer declared in
707
707
  * aidream. It leaves this union once no snapshot within the last
708
708
  * 3 published versions still carries it as active.
709
709
  */
@@ -680,7 +680,7 @@ var MANDATE_KEYS = {
680
680
  */
681
681
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
682
682
  /**
683
- * @deprecated retiring since 0.59.202 — no longer declared in
683
+ * @deprecated retiring since 0.59.204 — no longer declared in
684
684
  * aidream. It leaves this union once no snapshot within the last
685
685
  * 3 published versions still carries it as active.
686
686
  */
@@ -656,7 +656,7 @@ var MANDATE_KEYS = {
656
656
  */
657
657
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
658
658
  /**
659
- * @deprecated retiring since 0.59.202 — no longer declared in
659
+ * @deprecated retiring since 0.59.204 — no longer declared in
660
660
  * aidream. It leaves this union once no snapshot within the last
661
661
  * 3 published versions still carries it as active.
662
662
  */
@@ -628,7 +628,7 @@ var MANDATE_KEYS = {
628
628
  */
629
629
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
630
630
  /**
631
- * @deprecated retiring since 0.59.202 — no longer declared in
631
+ * @deprecated retiring since 0.59.204 — no longer declared in
632
632
  * aidream. It leaves this union once no snapshot within the last
633
633
  * 3 published versions still carries it as active.
634
634
  */
@@ -47,9 +47,9 @@ module.exports = __toCommonJS(mandates_exports);
47
47
 
48
48
  // mandates/keys.generated.ts
49
49
  var MANDATE_KEYS_META = {
50
- aidreamRevision: "87ac44110804dd25042da72a232bde2061bd528c",
50
+ aidreamRevision: "4d832f50ff335ff7d2858da508739243d30fdcc7",
51
51
  generatorVersion: "1.0.0",
52
- packageVersion: "0.59.202",
52
+ packageVersion: "0.59.204",
53
53
  retireWindow: 3
54
54
  };
55
55
  var MANDATE_KEYS = {
@@ -666,7 +666,7 @@ var MANDATE_KEYS = {
666
666
  */
667
667
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
668
668
  /**
669
- * @deprecated retiring since 0.59.202 — no longer declared in
669
+ * @deprecated retiring since 0.59.204 — no longer declared in
670
670
  * aidream. It leaves this union once no snapshot within the last
671
671
  * 3 published versions still carries it as active.
672
672
  */
@@ -693,7 +693,7 @@ var MANDATE_KEYS = {
693
693
  var ALL_MANDATE_KEYS = Object.values(MANDATE_KEYS);
694
694
  var RETIRING_MANDATE_KEYS = {
695
695
  "brand_discovery.offering_roles": "0.59.0",
696
- "coding_session.managed_translation_reference": "0.59.202",
696
+ "coding_session.managed_translation_reference": "0.59.204",
697
697
  "pdf.content_cleaner": "0.59.0",
698
698
  "sms.owner_beta": "0.59.0",
699
699
  "voice.owner_beta": "0.59.0"
@@ -6,9 +6,9 @@
6
6
  * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the
7
7
  * boot sync writes to the database from. There is no hand list anywhere.
8
8
  *
9
- * aidream revision: 87ac44110804dd25042da72a232bde2061bd528c
9
+ * aidream revision: 4d832f50ff335ff7d2858da508739243d30fdcc7
10
10
  * generator version: 1.0.0
11
- * package version: 0.59.202
11
+ * package version: 0.59.204
12
12
  * active keys: 606
13
13
  * retiring keys: 5
14
14
  *
@@ -19,9 +19,9 @@
19
19
  */
20
20
  /** Where this module came from — surfaced so a report can name the exact build. */
21
21
  declare const MANDATE_KEYS_META: {
22
- readonly aidreamRevision: "87ac44110804dd25042da72a232bde2061bd528c";
22
+ readonly aidreamRevision: "4d832f50ff335ff7d2858da508739243d30fdcc7";
23
23
  readonly generatorVersion: "1.0.0";
24
- readonly packageVersion: "0.59.202";
24
+ readonly packageVersion: "0.59.204";
25
25
  readonly retireWindow: 3;
26
26
  };
27
27
  /** Every declared mandate key, by THE IDENTIFIER RULE. */
@@ -639,7 +639,7 @@ declare const MANDATE_KEYS: {
639
639
  */
640
640
  readonly brand_discovery__offering_roles: "brand_discovery.offering_roles";
641
641
  /**
642
- * @deprecated retiring since 0.59.202 — no longer declared in
642
+ * @deprecated retiring since 0.59.204 — no longer declared in
643
643
  * aidream. It leaves this union once no snapshot within the last
644
644
  * 3 published versions still carries it as active.
645
645
  */
@@ -670,7 +670,7 @@ declare const ALL_MANDATE_KEYS: readonly MandateKey[];
670
670
  /** Keys still in the union but no longer declared (two-phase retire, phase 1). */
671
671
  declare const RETIRING_MANDATE_KEYS: {
672
672
  readonly "brand_discovery.offering_roles": "0.59.0";
673
- readonly "coding_session.managed_translation_reference": "0.59.202";
673
+ readonly "coding_session.managed_translation_reference": "0.59.204";
674
674
  readonly "pdf.content_cleaner": "0.59.0";
675
675
  readonly "sms.owner_beta": "0.59.0";
676
676
  readonly "voice.owner_beta": "0.59.0";
@@ -6,9 +6,9 @@
6
6
  * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the
7
7
  * boot sync writes to the database from. There is no hand list anywhere.
8
8
  *
9
- * aidream revision: 87ac44110804dd25042da72a232bde2061bd528c
9
+ * aidream revision: 4d832f50ff335ff7d2858da508739243d30fdcc7
10
10
  * generator version: 1.0.0
11
- * package version: 0.59.202
11
+ * package version: 0.59.204
12
12
  * active keys: 606
13
13
  * retiring keys: 5
14
14
  *
@@ -19,9 +19,9 @@
19
19
  */
20
20
  /** Where this module came from — surfaced so a report can name the exact build. */
21
21
  declare const MANDATE_KEYS_META: {
22
- readonly aidreamRevision: "87ac44110804dd25042da72a232bde2061bd528c";
22
+ readonly aidreamRevision: "4d832f50ff335ff7d2858da508739243d30fdcc7";
23
23
  readonly generatorVersion: "1.0.0";
24
- readonly packageVersion: "0.59.202";
24
+ readonly packageVersion: "0.59.204";
25
25
  readonly retireWindow: 3;
26
26
  };
27
27
  /** Every declared mandate key, by THE IDENTIFIER RULE. */
@@ -639,7 +639,7 @@ declare const MANDATE_KEYS: {
639
639
  */
640
640
  readonly brand_discovery__offering_roles: "brand_discovery.offering_roles";
641
641
  /**
642
- * @deprecated retiring since 0.59.202 — no longer declared in
642
+ * @deprecated retiring since 0.59.204 — no longer declared in
643
643
  * aidream. It leaves this union once no snapshot within the last
644
644
  * 3 published versions still carries it as active.
645
645
  */
@@ -670,7 +670,7 @@ declare const ALL_MANDATE_KEYS: readonly MandateKey[];
670
670
  /** Keys still in the union but no longer declared (two-phase retire, phase 1). */
671
671
  declare const RETIRING_MANDATE_KEYS: {
672
672
  readonly "brand_discovery.offering_roles": "0.59.0";
673
- readonly "coding_session.managed_translation_reference": "0.59.202";
673
+ readonly "coding_session.managed_translation_reference": "0.59.204";
674
674
  readonly "pdf.content_cleaner": "0.59.0";
675
675
  readonly "sms.owner_beta": "0.59.0";
676
676
  readonly "voice.owner_beta": "0.59.0";
@@ -1,8 +1,8 @@
1
1
  // mandates/keys.generated.ts
2
2
  var MANDATE_KEYS_META = {
3
- aidreamRevision: "87ac44110804dd25042da72a232bde2061bd528c",
3
+ aidreamRevision: "4d832f50ff335ff7d2858da508739243d30fdcc7",
4
4
  generatorVersion: "1.0.0",
5
- packageVersion: "0.59.202",
5
+ packageVersion: "0.59.204",
6
6
  retireWindow: 3
7
7
  };
8
8
  var MANDATE_KEYS = {
@@ -619,7 +619,7 @@ var MANDATE_KEYS = {
619
619
  */
620
620
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
621
621
  /**
622
- * @deprecated retiring since 0.59.202 — no longer declared in
622
+ * @deprecated retiring since 0.59.204 — no longer declared in
623
623
  * aidream. It leaves this union once no snapshot within the last
624
624
  * 3 published versions still carries it as active.
625
625
  */
@@ -646,7 +646,7 @@ var MANDATE_KEYS = {
646
646
  var ALL_MANDATE_KEYS = Object.values(MANDATE_KEYS);
647
647
  var RETIRING_MANDATE_KEYS = {
648
648
  "brand_discovery.offering_roles": "0.59.0",
649
- "coding_session.managed_translation_reference": "0.59.202",
649
+ "coding_session.managed_translation_reference": "0.59.204",
650
650
  "pdf.content_cleaner": "0.59.0",
651
651
  "sms.owner_beta": "0.59.0",
652
652
  "voice.owner_beta": "0.59.0"
@@ -116,6 +116,7 @@ __export(models_exports, {
116
116
  resolveNewAgentModelId: () => resolveNewAgentModelId,
117
117
  resolvePreferredModelChoice: () => resolvePreferredModelChoice,
118
118
  resolveSuccessor: () => resolveSuccessor,
119
+ runtimesOnEngine: () => runtimesOnEngine,
119
120
  seesImages: () => seesImages,
120
121
  selectActiveModels: () => selectActiveModels,
121
122
  selectActiveModelsReady: () => selectActiveModelsReady,
@@ -149,6 +150,7 @@ __export(models_exports, {
149
150
  takesInput: () => takesInput,
150
151
  toAuditRecord: () => toAuditRecord,
151
152
  validateModelSet: () => validateModelSet,
153
+ variantVerdict: () => variantVerdict,
152
154
  withModelClass: () => withModelClass
153
155
  });
154
156
  module.exports = __toCommonJS(models_exports);
@@ -1880,13 +1882,26 @@ function byOrder(a, b) {
1880
1882
  function asCandidate(j) {
1881
1883
  return j.candidate ?? { variant: j.variant, build: null, hardware_class: null, compat: "expected", fits: null };
1882
1884
  }
1883
- function judgeAll(model, want, device, runtimes) {
1885
+ function judgeAll(model, want, device, runtimes, options = {}) {
1884
1886
  const checkFormat = runtimes.length > 0 || device !== null;
1885
1887
  const list = want.variant_policy === "exact" ? model.variants.filter((x) => x.key === want.variant_key) : model.variants;
1886
- return list.map((v) => judge(v, device, runtimes, checkFormat));
1888
+ return list.map((v) => judge(v, device, options.onEngine && device ? runtimesOnEngine(runtimes, v, device) : runtimes, checkFormat));
1887
1889
  }
1888
- function rankVariants(model, want, device, runtimes) {
1889
- const judged = judgeAll(model, want, device, runtimes);
1890
+ function ggufEngine(runtimes, device) {
1891
+ const arch = normalizeArch(device.arch);
1892
+ for (const r of runtimes)
1893
+ for (const b of r.builds)
1894
+ if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
1895
+ return null;
1896
+ }
1897
+ function runtimesOnEngine(runtimes, variant, device) {
1898
+ const engine = ggufEngine(runtimes, device);
1899
+ if (!engine || variant.format !== "gguf") return [...runtimes];
1900
+ const rows3 = device.classes.map((hardware_class) => ({ hardware_class, format: variant.format, quant: variant.quant, architecture: variant.architecture, chat_template_kind: variant.chat_template_kind, status: "expected" }));
1901
+ return runtimes.map((r) => ({ ...r, builds: r.builds.map((b) => b === engine ? { ...b, compat: [...b.compat, ...rows3] } : b) }));
1902
+ }
1903
+ function rankVariants(model, want, device, runtimes, options = {}) {
1904
+ const judged = judgeAll(model, want, device, runtimes, options);
1890
1905
  const usable = judged.filter((j) => j.usable).sort((a, b) => byOrder(asCandidate(a), asCandidate(b)));
1891
1906
  const rest = judged.filter((j) => !j.usable);
1892
1907
  return [...usable, ...rest].map((j, i) => ({
@@ -1895,9 +1910,31 @@ function rankVariants(model, want, device, runtimes) {
1895
1910
  reasons: j.reasons,
1896
1911
  recommended: j.usable && i === 0,
1897
1912
  fits: j.candidate?.fits ?? null,
1898
- build: j.candidate?.build ?? null
1913
+ build: j.candidate?.build ?? null,
1914
+ compat: j.usable ? j.candidate?.compat ?? null : null,
1915
+ engine: j.usable ? engineName(j, runtimes, device) : null
1899
1916
  }));
1900
1917
  }
1918
+ function engineName(j, runtimes, device) {
1919
+ if (j.candidate?.compat === "app_runtime") return "Matrx\u2019s own engine";
1920
+ const build = j.candidate?.build ?? (device ? null : runtimes.flatMap((r) => r.builds).find((b) => b.is_active && b.compat.some((c) => c.format === j.variant.format)) ?? null);
1921
+ if (!build) return null;
1922
+ return runtimes.find((r) => r.builds.some((b) => b.id === build.id))?.name ?? null;
1923
+ }
1924
+ var RUNS_ON = /^Runs on /;
1925
+ function variantVerdict(ranked, mode) {
1926
+ const rt = ranked.variant.discovery?.runtime ?? null;
1927
+ if (mode === "catalog") {
1928
+ const runtime = rt ? rt.available ? `Runs on ${rt.name}` : rt.note || `Matrx 2 has no ${rt.name} runtime yet.` : null;
1929
+ return { runs: null, badge: null, runtime, reason: null, lines: ranked.reasons.filter((l) => !RUNS_ON.test(l)) };
1930
+ }
1931
+ const lines = ranked.reasons.filter((l) => !RUNS_ON.test(l));
1932
+ if (!ranked.usable) {
1933
+ return { runs: false, badge: "Will not run", runtime: null, reason: lines[0] ?? "This version does not run on this computer.", lines: lines.slice(1) };
1934
+ }
1935
+ const name = ranked.engine ?? (rt?.available ? rt.name : null);
1936
+ return { runs: true, badge: null, runtime: name ? `Runs on ${name}` : null, reason: null, lines };
1937
+ }
1901
1938
  function selectVariant(model, want, device, runtimes) {
1902
1939
  if (!model.variants.length) return { ok: false, code: "no_variant", reason: "This model has no downloadable form yet" };
1903
1940
  const judged = judgeAll(model, want, device, runtimes);
@@ -2287,13 +2324,6 @@ function pickProjector(quant, projectors) {
2287
2324
  }
2288
2325
  return null;
2289
2326
  }
2290
- function ggufEngine(runtimes, device) {
2291
- const arch = normalizeArch(device.arch);
2292
- for (const r of runtimes)
2293
- for (const b of r.builds)
2294
- if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
2295
- return null;
2296
- }
2297
2327
  var extOf = (name) => {
2298
2328
  const i = name.lastIndexOf(".");
2299
2329
  return i > 0 ? name.slice(i).toLowerCase() : "";
@@ -1188,12 +1188,28 @@ interface RankedVariant {
1188
1188
  fits: boolean | null;
1189
1189
  /** The runtime build it runs on here (null on the web or for an app-shipped runtime). */
1190
1190
  build: LocalRuntimeBuild | null;
1191
+ /** How it runs here: tested, expected (not yet tested), Matrx's own engine; null when it does not run or on the web. */
1192
+ compat: CompatStatus | "app_runtime" | null;
1193
+ /** The name of the runtime it runs on ("llama.cpp", "Matrx’s own engine"); null when it does not run or is unknown. */
1194
+ engine: string | null;
1191
1195
  }
1192
1196
  /** The parts of a sharded set that are missing ("part 2 of 3"), from the files' own shard numbers. */
1193
1197
  declare function missingShards(variant: LocalVariant): Array<{
1194
1198
  index: number;
1195
1199
  count: number;
1196
1200
  }>;
1201
+ /** The active llama-server build for this computer that runs GGUF, or null. */
1202
+ declare function ggufEngine(runtimes: readonly LocalRuntime[], device: SelectDevice): LocalRuntimeBuild | null;
1203
+ /**
1204
+ * The runtimes a version NO catalog reviewed (the person's own model, a version found on Hugging Face) is
1205
+ * judged against: our GGUF engine on this computer takes its signature as "expected" (not yet tested),
1206
+ * so it is judged on what our runtime runs, never on the reviewed list. Without an engine, unchanged.
1207
+ */
1208
+ declare function runtimesOnEngine(runtimes: readonly LocalRuntime[], variant: LocalVariant, device: SelectDevice): LocalRuntime[];
1209
+ interface RankOptions {
1210
+ /** Judge every version on our engine for its format (`runtimesOnEngine`): a person's own or found model, never on a reviewed list. */
1211
+ onEngine?: boolean;
1212
+ }
1197
1213
  /**
1198
1214
  * THE judge every screen shows (unified-models §1.4a): every variant of `model` with whether it can be
1199
1215
  * used here, its reasons in plain words (format our runtimes run, a complete file set, os/arch, and
@@ -1201,7 +1217,23 @@ declare function missingShards(variant: LocalVariant): Array<{
1201
1217
  * memory line says what it needs instead of yes/no. Ordered: the recommended first, then the other
1202
1218
  * usable ones in the selection order, then the rest. `selectVariant` is this judge's winner.
1203
1219
  */
1204
- declare function rankVariants(model: LocalModel, want: Want, device: SelectDevice | null, runtimes: readonly LocalRuntime[]): RankedVariant[];
1220
+ declare function rankVariants(model: LocalModel, want: Want, device: SelectDevice | null, runtimes: readonly LocalRuntime[], options?: RankOptions): RankedVariant[];
1221
+ /**
1222
+ * ONE verdict for a version on a screen (Find models, the Discovery page): every line a version row
1223
+ * draws comes from this, so a row can never say "Will not run" beside "Runs on llama.cpp". `runs` false:
1224
+ * `reason` is the first plain line (memory with both numbers, or the format) and there is NO runtime line.
1225
+ * `runs` true: `runtime` names what it runs on ("Runs on llama.cpp") when known. `lines` are the rest.
1226
+ * Catalog mode (admin) never gates: `runs` is null and the runtime line is the server's per-runtime word.
1227
+ */
1228
+ interface VariantVerdict {
1229
+ runs: boolean | null;
1230
+ /** "Will not run" when it does not run here; null otherwise. */
1231
+ badge: string | null;
1232
+ runtime: string | null;
1233
+ reason: string | null;
1234
+ lines: string[];
1235
+ }
1236
+ declare function variantVerdict(ranked: RankedVariant, mode: "device" | "catalog"): VariantVerdict;
1205
1237
  /**
1206
1238
  * Choose the variant of `model` this device downloads and runs, and exactly the files to fetch — the
1207
1239
  * recommended entry of `rankVariants`. The choice is returned with `decided_by` (the order step that
@@ -1452,8 +1484,6 @@ declare const quantFromName: (name: string) => string | null;
1452
1484
  declare function splitSetProblems(names: readonly string[]): string[];
1453
1485
  /** huggingface.py pick_projector over names: the projector a variant of `quant` takes, or null. */
1454
1486
  declare function pickProjector(quant: string | null, projectors: readonly string[]): string | null;
1455
- /** The active llama-server build for this computer that runs GGUF, or null. */
1456
- declare function ggufEngine(runtimes: readonly LocalRuntime[], device: SelectDevice): LocalRuntime["builds"][number] | null;
1457
1487
  /**
1458
1488
  * Judge `primary` (the file the person chose) with the files beside it (`siblings`: the rest of its
1459
1489
  * folder or download; split parts and projectors are taken from here, anything else is ignored).
@@ -1756,4 +1786,4 @@ interface NewAgentModel {
1756
1786
  /** The model a new agent starts on. `resolveKnob(fullKey)` is the host's effective-knob read. Throws, naming the knob, when it answers nothing. */
1757
1787
  declare function resolveNewAgentModelId(resolveKnob: (fullKey: string) => Promise<unknown>): Promise<NewAgentModel>;
1758
1788
 
1759
- export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKindInput, type CatalogModel, type CatalogTier, type CheapestAdequateOptions, type CompatStatus, type ContentType, type CuratedCatalogClient, type CuratedModel, type CuratedPresentation, type CuratedRows, type CuratedVariant, DEFAULT_CAPABILITIES, type DecidedBy, type DeviceGraphics, type DeviceHardware, type DiscoveryAmbiguity, type DiscoveryArtifact, type DiscoveryMedia, type DiscoveryResult, type DiscoveryRuntime, type DiscoverySource, type DiscoveryVariant, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, type FeatureBucket, type FeatureBucketMeta, type FeatureKey, type FitCapabilities, GgufError, type GgufHeader, type GgufRead, type GgufTensor, type GroupedFeatures, type HardwareClass, type HardwareClasses, type HeaderFlag, type HeaderJudgement, type HeaderRefusal, INPUT_MODALITIES, INTERACTION_MODES, type Interaction, type InteractionMode, type LocalArtifact, type LocalCatalogClient, type LocalCatalogQuery, type LocalCompatRow, type LocalModel, type LocalModelCatalog, type LocalPresentation, type LocalRuntime, type LocalRuntimeBuild, type LocalVariant, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, type Modality, type ModelCapabilities, type ModelCatalog, type ModelCatalogClient, type ModelCatalogConfig, type ModelCatalogErrorSink, type ModelCatalogPgError, type ModelCatalogPgResult, type ModelCatalogQuery, type ModelCatalogState, type ModelCatalogVariant, type ModelCatalogVariantState, type ModelClassConfig, type ModelClassEntry, type ModelClassIndex, type ModelDiagnosticEntry, type ModelDiagnosticsSink, type ModelFavorites, type ModelFavoritesCache, type ModelFavoritesClient, type ModelFavoritesConfig, type ModelFavoritesErrorSink, type ModelFavoritesState, type ModelFetchScope, type ModelFileHandle, type ModelFit, type ModelIdentityRow, type ModelJson, type ModelNeed, type ModelOfferingRow, type ModelOption, type ModelOptionWithLifecycle, type ModelRecord, type ModelRecordFetchType, type ModelRecords, type ModelRecordsClient, type ModelRecordsConfig, type ModelRecordsState, type ModelSelectionPurpose, type ModelSetEnv, type ModelSetFacts, type ModelSetValidation, NEW_AGENT_DEFAULT_MODEL_KNOB, type NewAgentModel, type NoSelection, OUTPUT_MODALITIES, type OrderedLike, type PreferredModelChoice, type PreferredModelChoicePorts, type PriceTier, type PricedCatalogModel, type RankedVariant, type ReadModelCatalogOptions, SERVICE_LABEL, SERVICE_LABEL_PLURAL, type SelectDevice, type Selection, type ShardName, type SuccessionClient, type SuccessionIndex, type SuccessionNode, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, type VariantDiscovery, type Want, acceptsTextInstructions, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelClassKnobFor, modelClassName, modelClassPinOf, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readGgufHeader, readModelCatalog, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifacts, resetSuccessionLogForTests, resolveLiveModelId, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, validateModelSet, withModelClass };
1789
+ export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKindInput, type CatalogModel, type CatalogTier, type CheapestAdequateOptions, type CompatStatus, type ContentType, type CuratedCatalogClient, type CuratedModel, type CuratedPresentation, type CuratedRows, type CuratedVariant, DEFAULT_CAPABILITIES, type DecidedBy, type DeviceGraphics, type DeviceHardware, type DiscoveryAmbiguity, type DiscoveryArtifact, type DiscoveryMedia, type DiscoveryResult, type DiscoveryRuntime, type DiscoverySource, type DiscoveryVariant, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, type FeatureBucket, type FeatureBucketMeta, type FeatureKey, type FitCapabilities, GgufError, type GgufHeader, type GgufRead, type GgufTensor, type GroupedFeatures, type HardwareClass, type HardwareClasses, type HeaderFlag, type HeaderJudgement, type HeaderRefusal, INPUT_MODALITIES, INTERACTION_MODES, type Interaction, type InteractionMode, type LocalArtifact, type LocalCatalogClient, type LocalCatalogQuery, type LocalCompatRow, type LocalModel, type LocalModelCatalog, type LocalPresentation, type LocalRuntime, type LocalRuntimeBuild, type LocalVariant, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, type Modality, type ModelCapabilities, type ModelCatalog, type ModelCatalogClient, type ModelCatalogConfig, type ModelCatalogErrorSink, type ModelCatalogPgError, type ModelCatalogPgResult, type ModelCatalogQuery, type ModelCatalogState, type ModelCatalogVariant, type ModelCatalogVariantState, type ModelClassConfig, type ModelClassEntry, type ModelClassIndex, type ModelDiagnosticEntry, type ModelDiagnosticsSink, type ModelFavorites, type ModelFavoritesCache, type ModelFavoritesClient, type ModelFavoritesConfig, type ModelFavoritesErrorSink, type ModelFavoritesState, type ModelFetchScope, type ModelFileHandle, type ModelFit, type ModelIdentityRow, type ModelJson, type ModelNeed, type ModelOfferingRow, type ModelOption, type ModelOptionWithLifecycle, type ModelRecord, type ModelRecordFetchType, type ModelRecords, type ModelRecordsClient, type ModelRecordsConfig, type ModelRecordsState, type ModelSelectionPurpose, type ModelSetEnv, type ModelSetFacts, type ModelSetValidation, NEW_AGENT_DEFAULT_MODEL_KNOB, type NewAgentModel, type NoSelection, OUTPUT_MODALITIES, type OrderedLike, type PreferredModelChoice, type PreferredModelChoicePorts, type PriceTier, type PricedCatalogModel, type RankOptions, type RankedVariant, type ReadModelCatalogOptions, SERVICE_LABEL, SERVICE_LABEL_PLURAL, type SelectDevice, type Selection, type ShardName, type SuccessionClient, type SuccessionIndex, type SuccessionNode, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, type VariantDiscovery, type VariantVerdict, type Want, acceptsTextInstructions, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelClassKnobFor, modelClassName, modelClassPinOf, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readGgufHeader, readModelCatalog, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifacts, resetSuccessionLogForTests, resolveLiveModelId, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, validateModelSet, variantVerdict, withModelClass };
@@ -1188,12 +1188,28 @@ interface RankedVariant {
1188
1188
  fits: boolean | null;
1189
1189
  /** The runtime build it runs on here (null on the web or for an app-shipped runtime). */
1190
1190
  build: LocalRuntimeBuild | null;
1191
+ /** How it runs here: tested, expected (not yet tested), Matrx's own engine; null when it does not run or on the web. */
1192
+ compat: CompatStatus | "app_runtime" | null;
1193
+ /** The name of the runtime it runs on ("llama.cpp", "Matrx’s own engine"); null when it does not run or is unknown. */
1194
+ engine: string | null;
1191
1195
  }
1192
1196
  /** The parts of a sharded set that are missing ("part 2 of 3"), from the files' own shard numbers. */
1193
1197
  declare function missingShards(variant: LocalVariant): Array<{
1194
1198
  index: number;
1195
1199
  count: number;
1196
1200
  }>;
1201
+ /** The active llama-server build for this computer that runs GGUF, or null. */
1202
+ declare function ggufEngine(runtimes: readonly LocalRuntime[], device: SelectDevice): LocalRuntimeBuild | null;
1203
+ /**
1204
+ * The runtimes a version NO catalog reviewed (the person's own model, a version found on Hugging Face) is
1205
+ * judged against: our GGUF engine on this computer takes its signature as "expected" (not yet tested),
1206
+ * so it is judged on what our runtime runs, never on the reviewed list. Without an engine, unchanged.
1207
+ */
1208
+ declare function runtimesOnEngine(runtimes: readonly LocalRuntime[], variant: LocalVariant, device: SelectDevice): LocalRuntime[];
1209
+ interface RankOptions {
1210
+ /** Judge every version on our engine for its format (`runtimesOnEngine`): a person's own or found model, never on a reviewed list. */
1211
+ onEngine?: boolean;
1212
+ }
1197
1213
  /**
1198
1214
  * THE judge every screen shows (unified-models §1.4a): every variant of `model` with whether it can be
1199
1215
  * used here, its reasons in plain words (format our runtimes run, a complete file set, os/arch, and
@@ -1201,7 +1217,23 @@ declare function missingShards(variant: LocalVariant): Array<{
1201
1217
  * memory line says what it needs instead of yes/no. Ordered: the recommended first, then the other
1202
1218
  * usable ones in the selection order, then the rest. `selectVariant` is this judge's winner.
1203
1219
  */
1204
- declare function rankVariants(model: LocalModel, want: Want, device: SelectDevice | null, runtimes: readonly LocalRuntime[]): RankedVariant[];
1220
+ declare function rankVariants(model: LocalModel, want: Want, device: SelectDevice | null, runtimes: readonly LocalRuntime[], options?: RankOptions): RankedVariant[];
1221
+ /**
1222
+ * ONE verdict for a version on a screen (Find models, the Discovery page): every line a version row
1223
+ * draws comes from this, so a row can never say "Will not run" beside "Runs on llama.cpp". `runs` false:
1224
+ * `reason` is the first plain line (memory with both numbers, or the format) and there is NO runtime line.
1225
+ * `runs` true: `runtime` names what it runs on ("Runs on llama.cpp") when known. `lines` are the rest.
1226
+ * Catalog mode (admin) never gates: `runs` is null and the runtime line is the server's per-runtime word.
1227
+ */
1228
+ interface VariantVerdict {
1229
+ runs: boolean | null;
1230
+ /** "Will not run" when it does not run here; null otherwise. */
1231
+ badge: string | null;
1232
+ runtime: string | null;
1233
+ reason: string | null;
1234
+ lines: string[];
1235
+ }
1236
+ declare function variantVerdict(ranked: RankedVariant, mode: "device" | "catalog"): VariantVerdict;
1205
1237
  /**
1206
1238
  * Choose the variant of `model` this device downloads and runs, and exactly the files to fetch — the
1207
1239
  * recommended entry of `rankVariants`. The choice is returned with `decided_by` (the order step that
@@ -1452,8 +1484,6 @@ declare const quantFromName: (name: string) => string | null;
1452
1484
  declare function splitSetProblems(names: readonly string[]): string[];
1453
1485
  /** huggingface.py pick_projector over names: the projector a variant of `quant` takes, or null. */
1454
1486
  declare function pickProjector(quant: string | null, projectors: readonly string[]): string | null;
1455
- /** The active llama-server build for this computer that runs GGUF, or null. */
1456
- declare function ggufEngine(runtimes: readonly LocalRuntime[], device: SelectDevice): LocalRuntime["builds"][number] | null;
1457
1487
  /**
1458
1488
  * Judge `primary` (the file the person chose) with the files beside it (`siblings`: the rest of its
1459
1489
  * folder or download; split parts and projectors are taken from here, anything else is ignored).
@@ -1756,4 +1786,4 @@ interface NewAgentModel {
1756
1786
  /** The model a new agent starts on. `resolveKnob(fullKey)` is the host's effective-knob read. Throws, naming the knob, when it answers nothing. */
1757
1787
  declare function resolveNewAgentModelId(resolveKnob: (fullKey: string) => Promise<unknown>): Promise<NewAgentModel>;
1758
1788
 
1759
- export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKindInput, type CatalogModel, type CatalogTier, type CheapestAdequateOptions, type CompatStatus, type ContentType, type CuratedCatalogClient, type CuratedModel, type CuratedPresentation, type CuratedRows, type CuratedVariant, DEFAULT_CAPABILITIES, type DecidedBy, type DeviceGraphics, type DeviceHardware, type DiscoveryAmbiguity, type DiscoveryArtifact, type DiscoveryMedia, type DiscoveryResult, type DiscoveryRuntime, type DiscoverySource, type DiscoveryVariant, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, type FeatureBucket, type FeatureBucketMeta, type FeatureKey, type FitCapabilities, GgufError, type GgufHeader, type GgufRead, type GgufTensor, type GroupedFeatures, type HardwareClass, type HardwareClasses, type HeaderFlag, type HeaderJudgement, type HeaderRefusal, INPUT_MODALITIES, INTERACTION_MODES, type Interaction, type InteractionMode, type LocalArtifact, type LocalCatalogClient, type LocalCatalogQuery, type LocalCompatRow, type LocalModel, type LocalModelCatalog, type LocalPresentation, type LocalRuntime, type LocalRuntimeBuild, type LocalVariant, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, type Modality, type ModelCapabilities, type ModelCatalog, type ModelCatalogClient, type ModelCatalogConfig, type ModelCatalogErrorSink, type ModelCatalogPgError, type ModelCatalogPgResult, type ModelCatalogQuery, type ModelCatalogState, type ModelCatalogVariant, type ModelCatalogVariantState, type ModelClassConfig, type ModelClassEntry, type ModelClassIndex, type ModelDiagnosticEntry, type ModelDiagnosticsSink, type ModelFavorites, type ModelFavoritesCache, type ModelFavoritesClient, type ModelFavoritesConfig, type ModelFavoritesErrorSink, type ModelFavoritesState, type ModelFetchScope, type ModelFileHandle, type ModelFit, type ModelIdentityRow, type ModelJson, type ModelNeed, type ModelOfferingRow, type ModelOption, type ModelOptionWithLifecycle, type ModelRecord, type ModelRecordFetchType, type ModelRecords, type ModelRecordsClient, type ModelRecordsConfig, type ModelRecordsState, type ModelSelectionPurpose, type ModelSetEnv, type ModelSetFacts, type ModelSetValidation, NEW_AGENT_DEFAULT_MODEL_KNOB, type NewAgentModel, type NoSelection, OUTPUT_MODALITIES, type OrderedLike, type PreferredModelChoice, type PreferredModelChoicePorts, type PriceTier, type PricedCatalogModel, type RankedVariant, type ReadModelCatalogOptions, SERVICE_LABEL, SERVICE_LABEL_PLURAL, type SelectDevice, type Selection, type ShardName, type SuccessionClient, type SuccessionIndex, type SuccessionNode, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, type VariantDiscovery, type Want, acceptsTextInstructions, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelClassKnobFor, modelClassName, modelClassPinOf, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readGgufHeader, readModelCatalog, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifacts, resetSuccessionLogForTests, resolveLiveModelId, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, validateModelSet, withModelClass };
1789
+ export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKindInput, type CatalogModel, type CatalogTier, type CheapestAdequateOptions, type CompatStatus, type ContentType, type CuratedCatalogClient, type CuratedModel, type CuratedPresentation, type CuratedRows, type CuratedVariant, DEFAULT_CAPABILITIES, type DecidedBy, type DeviceGraphics, type DeviceHardware, type DiscoveryAmbiguity, type DiscoveryArtifact, type DiscoveryMedia, type DiscoveryResult, type DiscoveryRuntime, type DiscoverySource, type DiscoveryVariant, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, type FeatureBucket, type FeatureBucketMeta, type FeatureKey, type FitCapabilities, GgufError, type GgufHeader, type GgufRead, type GgufTensor, type GroupedFeatures, type HardwareClass, type HardwareClasses, type HeaderFlag, type HeaderJudgement, type HeaderRefusal, INPUT_MODALITIES, INTERACTION_MODES, type Interaction, type InteractionMode, type LocalArtifact, type LocalCatalogClient, type LocalCatalogQuery, type LocalCompatRow, type LocalModel, type LocalModelCatalog, type LocalPresentation, type LocalRuntime, type LocalRuntimeBuild, type LocalVariant, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, type Modality, type ModelCapabilities, type ModelCatalog, type ModelCatalogClient, type ModelCatalogConfig, type ModelCatalogErrorSink, type ModelCatalogPgError, type ModelCatalogPgResult, type ModelCatalogQuery, type ModelCatalogState, type ModelCatalogVariant, type ModelCatalogVariantState, type ModelClassConfig, type ModelClassEntry, type ModelClassIndex, type ModelDiagnosticEntry, type ModelDiagnosticsSink, type ModelFavorites, type ModelFavoritesCache, type ModelFavoritesClient, type ModelFavoritesConfig, type ModelFavoritesErrorSink, type ModelFavoritesState, type ModelFetchScope, type ModelFileHandle, type ModelFit, type ModelIdentityRow, type ModelJson, type ModelNeed, type ModelOfferingRow, type ModelOption, type ModelOptionWithLifecycle, type ModelRecord, type ModelRecordFetchType, type ModelRecords, type ModelRecordsClient, type ModelRecordsConfig, type ModelRecordsState, type ModelSelectionPurpose, type ModelSetEnv, type ModelSetFacts, type ModelSetValidation, NEW_AGENT_DEFAULT_MODEL_KNOB, type NewAgentModel, type NoSelection, OUTPUT_MODALITIES, type OrderedLike, type PreferredModelChoice, type PreferredModelChoicePorts, type PriceTier, type PricedCatalogModel, type RankOptions, type RankedVariant, type ReadModelCatalogOptions, SERVICE_LABEL, SERVICE_LABEL_PLURAL, type SelectDevice, type Selection, type ShardName, type SuccessionClient, type SuccessionIndex, type SuccessionNode, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, type VariantDiscovery, type VariantVerdict, type Want, acceptsTextInstructions, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelClassKnobFor, modelClassName, modelClassPinOf, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readGgufHeader, readModelCatalog, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifacts, resetSuccessionLogForTests, resolveLiveModelId, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, validateModelSet, variantVerdict, withModelClass };
@@ -1725,13 +1725,26 @@ function byOrder(a, b) {
1725
1725
  function asCandidate(j) {
1726
1726
  return j.candidate ?? { variant: j.variant, build: null, hardware_class: null, compat: "expected", fits: null };
1727
1727
  }
1728
- function judgeAll(model, want, device, runtimes) {
1728
+ function judgeAll(model, want, device, runtimes, options = {}) {
1729
1729
  const checkFormat = runtimes.length > 0 || device !== null;
1730
1730
  const list = want.variant_policy === "exact" ? model.variants.filter((x) => x.key === want.variant_key) : model.variants;
1731
- return list.map((v) => judge(v, device, runtimes, checkFormat));
1731
+ return list.map((v) => judge(v, device, options.onEngine && device ? runtimesOnEngine(runtimes, v, device) : runtimes, checkFormat));
1732
1732
  }
1733
- function rankVariants(model, want, device, runtimes) {
1734
- const judged = judgeAll(model, want, device, runtimes);
1733
+ function ggufEngine(runtimes, device) {
1734
+ const arch = normalizeArch(device.arch);
1735
+ for (const r of runtimes)
1736
+ for (const b of r.builds)
1737
+ if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
1738
+ return null;
1739
+ }
1740
+ function runtimesOnEngine(runtimes, variant, device) {
1741
+ const engine = ggufEngine(runtimes, device);
1742
+ if (!engine || variant.format !== "gguf") return [...runtimes];
1743
+ const rows3 = device.classes.map((hardware_class) => ({ hardware_class, format: variant.format, quant: variant.quant, architecture: variant.architecture, chat_template_kind: variant.chat_template_kind, status: "expected" }));
1744
+ return runtimes.map((r) => ({ ...r, builds: r.builds.map((b) => b === engine ? { ...b, compat: [...b.compat, ...rows3] } : b) }));
1745
+ }
1746
+ function rankVariants(model, want, device, runtimes, options = {}) {
1747
+ const judged = judgeAll(model, want, device, runtimes, options);
1735
1748
  const usable = judged.filter((j) => j.usable).sort((a, b) => byOrder(asCandidate(a), asCandidate(b)));
1736
1749
  const rest = judged.filter((j) => !j.usable);
1737
1750
  return [...usable, ...rest].map((j, i) => ({
@@ -1740,9 +1753,31 @@ function rankVariants(model, want, device, runtimes) {
1740
1753
  reasons: j.reasons,
1741
1754
  recommended: j.usable && i === 0,
1742
1755
  fits: j.candidate?.fits ?? null,
1743
- build: j.candidate?.build ?? null
1756
+ build: j.candidate?.build ?? null,
1757
+ compat: j.usable ? j.candidate?.compat ?? null : null,
1758
+ engine: j.usable ? engineName(j, runtimes, device) : null
1744
1759
  }));
1745
1760
  }
1761
+ function engineName(j, runtimes, device) {
1762
+ if (j.candidate?.compat === "app_runtime") return "Matrx\u2019s own engine";
1763
+ const build = j.candidate?.build ?? (device ? null : runtimes.flatMap((r) => r.builds).find((b) => b.is_active && b.compat.some((c) => c.format === j.variant.format)) ?? null);
1764
+ if (!build) return null;
1765
+ return runtimes.find((r) => r.builds.some((b) => b.id === build.id))?.name ?? null;
1766
+ }
1767
+ var RUNS_ON = /^Runs on /;
1768
+ function variantVerdict(ranked, mode) {
1769
+ const rt = ranked.variant.discovery?.runtime ?? null;
1770
+ if (mode === "catalog") {
1771
+ const runtime = rt ? rt.available ? `Runs on ${rt.name}` : rt.note || `Matrx 2 has no ${rt.name} runtime yet.` : null;
1772
+ return { runs: null, badge: null, runtime, reason: null, lines: ranked.reasons.filter((l) => !RUNS_ON.test(l)) };
1773
+ }
1774
+ const lines = ranked.reasons.filter((l) => !RUNS_ON.test(l));
1775
+ if (!ranked.usable) {
1776
+ return { runs: false, badge: "Will not run", runtime: null, reason: lines[0] ?? "This version does not run on this computer.", lines: lines.slice(1) };
1777
+ }
1778
+ const name = ranked.engine ?? (rt?.available ? rt.name : null);
1779
+ return { runs: true, badge: null, runtime: name ? `Runs on ${name}` : null, reason: null, lines };
1780
+ }
1746
1781
  function selectVariant(model, want, device, runtimes) {
1747
1782
  if (!model.variants.length) return { ok: false, code: "no_variant", reason: "This model has no downloadable form yet" };
1748
1783
  const judged = judgeAll(model, want, device, runtimes);
@@ -2132,13 +2167,6 @@ function pickProjector(quant, projectors) {
2132
2167
  }
2133
2168
  return null;
2134
2169
  }
2135
- function ggufEngine(runtimes, device) {
2136
- const arch = normalizeArch(device.arch);
2137
- for (const r of runtimes)
2138
- for (const b of r.builds)
2139
- if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
2140
- return null;
2141
- }
2142
2170
  var extOf = (name) => {
2143
2171
  const i = name.lastIndexOf(".");
2144
2172
  return i > 0 ? name.slice(i).toLowerCase() : "";
@@ -2692,6 +2720,7 @@ export {
2692
2720
  resolveNewAgentModelId,
2693
2721
  resolvePreferredModelChoice,
2694
2722
  resolveSuccessor,
2723
+ runtimesOnEngine,
2695
2724
  seesImages,
2696
2725
  selectActiveModels,
2697
2726
  selectActiveModelsReady,
@@ -2725,5 +2754,6 @@ export {
2725
2754
  takesInput,
2726
2755
  toAuditRecord,
2727
2756
  validateModelSet,
2757
+ variantVerdict,
2728
2758
  withModelClass
2729
2759
  };
@@ -2378,13 +2378,26 @@ function byOrder(a, b) {
2378
2378
  function asCandidate(j) {
2379
2379
  return j.candidate ?? { variant: j.variant, build: null, hardware_class: null, compat: "expected", fits: null };
2380
2380
  }
2381
- function judgeAll(model, want, device, runtimes) {
2381
+ function judgeAll(model, want, device, runtimes, options = {}) {
2382
2382
  const checkFormat = runtimes.length > 0 || device !== null;
2383
2383
  const list = want.variant_policy === "exact" ? model.variants.filter((x) => x.key === want.variant_key) : model.variants;
2384
- return list.map((v) => judge(v, device, runtimes, checkFormat));
2384
+ return list.map((v) => judge(v, device, options.onEngine && device ? runtimesOnEngine(runtimes, v, device) : runtimes, checkFormat));
2385
2385
  }
2386
- function rankVariants(model, want, device, runtimes) {
2387
- const judged = judgeAll(model, want, device, runtimes);
2386
+ function ggufEngine(runtimes, device) {
2387
+ const arch = normalizeArch(device.arch);
2388
+ for (const r of runtimes)
2389
+ for (const b of r.builds)
2390
+ if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
2391
+ return null;
2392
+ }
2393
+ function runtimesOnEngine(runtimes, variant, device) {
2394
+ const engine = ggufEngine(runtimes, device);
2395
+ if (!engine || variant.format !== "gguf") return [...runtimes];
2396
+ const rows = device.classes.map((hardware_class) => ({ hardware_class, format: variant.format, quant: variant.quant, architecture: variant.architecture, chat_template_kind: variant.chat_template_kind, status: "expected" }));
2397
+ return runtimes.map((r) => ({ ...r, builds: r.builds.map((b) => b === engine ? { ...b, compat: [...b.compat, ...rows] } : b) }));
2398
+ }
2399
+ function rankVariants(model, want, device, runtimes, options = {}) {
2400
+ const judged = judgeAll(model, want, device, runtimes, options);
2388
2401
  const usable = judged.filter((j) => j.usable).sort((a, b) => byOrder(asCandidate(a), asCandidate(b)));
2389
2402
  const rest = judged.filter((j) => !j.usable);
2390
2403
  return [...usable, ...rest].map((j, i) => ({
@@ -2393,9 +2406,31 @@ function rankVariants(model, want, device, runtimes) {
2393
2406
  reasons: j.reasons,
2394
2407
  recommended: j.usable && i === 0,
2395
2408
  fits: j.candidate?.fits ?? null,
2396
- build: j.candidate?.build ?? null
2409
+ build: j.candidate?.build ?? null,
2410
+ compat: j.usable ? j.candidate?.compat ?? null : null,
2411
+ engine: j.usable ? engineName(j, runtimes, device) : null
2397
2412
  }));
2398
2413
  }
2414
+ function engineName(j, runtimes, device) {
2415
+ if (j.candidate?.compat === "app_runtime") return "Matrx\u2019s own engine";
2416
+ const build = j.candidate?.build ?? (device ? null : runtimes.flatMap((r) => r.builds).find((b) => b.is_active && b.compat.some((c) => c.format === j.variant.format)) ?? null);
2417
+ if (!build) return null;
2418
+ return runtimes.find((r) => r.builds.some((b) => b.id === build.id))?.name ?? null;
2419
+ }
2420
+ var RUNS_ON = /^Runs on /;
2421
+ function variantVerdict(ranked, mode) {
2422
+ const rt = ranked.variant.discovery?.runtime ?? null;
2423
+ if (mode === "catalog") {
2424
+ const runtime = rt ? rt.available ? `Runs on ${rt.name}` : rt.note || `Matrx 2 has no ${rt.name} runtime yet.` : null;
2425
+ return { runs: null, badge: null, runtime, reason: null, lines: ranked.reasons.filter((l) => !RUNS_ON.test(l)) };
2426
+ }
2427
+ const lines = ranked.reasons.filter((l) => !RUNS_ON.test(l));
2428
+ if (!ranked.usable) {
2429
+ return { runs: false, badge: "Will not run", runtime: null, reason: lines[0] ?? "This version does not run on this computer.", lines: lines.slice(1) };
2430
+ }
2431
+ const name = ranked.engine ?? (rt?.available ? rt.name : null);
2432
+ return { runs: true, badge: null, runtime: name ? `Runs on ${name}` : null, reason: null, lines };
2433
+ }
2399
2434
  var USES = ["core", "vision", "audio_in", "voices"];
2400
2435
  function fromDiscovery(result) {
2401
2436
  const ambiguities = result.ambiguities ?? [];
@@ -2652,7 +2687,7 @@ function SearchTab({ port, onPick }) {
2652
2687
  }
2653
2688
  function DiscoveryResultView({ result, device, runtimes, want = DEFAULT_WANT, chooseLabel = "Choose", mode = "device", onChoose, renderVariantActions, renderActions }) {
2654
2689
  const model = (0, import_react4.useMemo)(() => fromDiscovery(result), [result]);
2655
- const ranked = (0, import_react4.useMemo)(() => rankVariants(model, want, device, runtimes), [model, want, device, runtimes]);
2690
+ const ranked = (0, import_react4.useMemo)(() => rankVariants(model, want, device, runtimes, { onEngine: mode === "device" }), [model, want, device, runtimes, mode]);
2656
2691
  const [choosing, setChoosing] = (0, import_react4.useState)(null);
2657
2692
  const [done, setDone] = (0, import_react4.useState)(null);
2658
2693
  const logo = (result.media ?? []).find((m) => m.kind === "maker_logo");
@@ -2703,27 +2738,26 @@ function DiscoveryResultView({ result, device, runtimes, want = DEFAULT_WANT, ch
2703
2738
  }
2704
2739
  function VariantRow({ ranked, mode, chooseLabel, busy, choosingThis, onChoose, extra }) {
2705
2740
  const v = ranked.variant;
2706
- const runtime = v.discovery?.runtime ?? null;
2707
2741
  const catalog = mode === "catalog";
2708
- const blocked = !catalog && !ranked.usable;
2709
- const why = blocked ? ranked.reasons[0] ?? "This version does not run on this computer." : null;
2742
+ const verdict = variantVerdict(ranked, mode);
2743
+ const blocked = !catalog && verdict.runs === false;
2710
2744
  const label = v.quant || v.key;
2711
2745
  const publisher = v.discovery?.publisher ?? null;
2712
2746
  const size = sizeOf(v.total_bytes);
2713
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex flex-col gap-2 rounded-md border border-border p-3", "data-testid": "discovery-variant", "data-recommended": ranked.recommended ? "true" : void 0, children: [
2747
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex flex-col gap-2 rounded-md border border-border p-3", "data-testid": "discovery-variant", "data-runs": verdict.runs === null ? void 0 : String(verdict.runs), "data-recommended": ranked.recommended ? "true" : void 0, children: [
2714
2748
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
2715
2749
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-sm font-medium text-foreground", children: label }),
2716
2750
  ranked.recommended ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_controls2.Badge, { tone: "primary", children: "Recommended" }) : null,
2717
- ranked.usable || catalog ? null : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_controls2.Badge, { tone: "warning", children: "Will not run" }),
2751
+ verdict.badge ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_controls2.Badge, { tone: "warning", children: verdict.badge }) : null,
2718
2752
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground", children: [v.format.toUpperCase(), size, publisher ? `by ${publisher}` : null].filter(Boolean).join(" \xB7 ") }),
2719
2753
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "ml-auto flex items-center gap-2", children: [
2720
2754
  extra,
2721
- why ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground", "data-testid": "choose-reason", children: why }) : null,
2755
+ verdict.reason ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground", "data-testid": "choose-reason", children: verdict.reason }) : null,
2722
2756
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_controls2.Button, { variant: ranked.recommended ? "primary" : "outline", disabled: busy || blocked, onClick: onChoose, children: choosingThis ? "Working\u2026" : chooseLabel })
2723
2757
  ] })
2724
2758
  ] }),
2725
- runtime ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: runtime.available ? "text-xs text-muted-foreground" : "text-xs text-foreground", "data-testid": "variant-runtime", children: runtime.available ? `Runs on ${runtime.name}` : runtime.note || `Matrx 2 has no ${runtime.name} runtime yet.` }) : null,
2726
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "flex flex-col gap-0.5", children: ranked.reasons.map((line) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "text-xs text-muted-foreground", children: line }, line)) }),
2759
+ verdict.runtime ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-xs text-muted-foreground", "data-testid": "variant-runtime", children: verdict.runtime }) : null,
2760
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "flex flex-col gap-0.5", children: verdict.lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "text-xs text-muted-foreground", children: line }, line)) }),
2727
2761
  v.artifacts.length ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system2.Collapsible, { children: [
2728
2762
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_design_system2.CollapsibleTrigger, { className: "text-xs text-muted-foreground hover:text-foreground", children: [
2729
2763
  "Files in this version (",
@@ -770,6 +770,10 @@ interface RankedVariant {
770
770
  fits: boolean | null;
771
771
  /** The runtime build it runs on here (null on the web or for an app-shipped runtime). */
772
772
  build: LocalRuntimeBuild | null;
773
+ /** How it runs here: tested, expected (not yet tested), Matrx's own engine; null when it does not run or on the web. */
774
+ compat: CompatStatus | "app_runtime" | null;
775
+ /** The name of the runtime it runs on ("llama.cpp", "Matrx’s own engine"); null when it does not run or is unknown. */
776
+ engine: string | null;
773
777
  }
774
778
  /** One file of a discovered variant. Newer servers send `path`/`size`; older ones `path_in_repo`/`size_bytes`. */
775
779
  interface DiscoveryArtifact {
@@ -770,6 +770,10 @@ interface RankedVariant {
770
770
  fits: boolean | null;
771
771
  /** The runtime build it runs on here (null on the web or for an app-shipped runtime). */
772
772
  build: LocalRuntimeBuild | null;
773
+ /** How it runs here: tested, expected (not yet tested), Matrx's own engine; null when it does not run or on the web. */
774
+ compat: CompatStatus | "app_runtime" | null;
775
+ /** The name of the runtime it runs on ("llama.cpp", "Matrx’s own engine"); null when it does not run or is unknown. */
776
+ engine: string | null;
773
777
  }
774
778
  /** One file of a discovered variant. Newer servers send `path`/`size`; older ones `path_in_repo`/`size_bytes`. */
775
779
  interface DiscoveryArtifact {
@@ -2360,13 +2360,26 @@ function byOrder(a, b) {
2360
2360
  function asCandidate(j) {
2361
2361
  return j.candidate ?? { variant: j.variant, build: null, hardware_class: null, compat: "expected", fits: null };
2362
2362
  }
2363
- function judgeAll(model, want, device, runtimes) {
2363
+ function judgeAll(model, want, device, runtimes, options = {}) {
2364
2364
  const checkFormat = runtimes.length > 0 || device !== null;
2365
2365
  const list = want.variant_policy === "exact" ? model.variants.filter((x) => x.key === want.variant_key) : model.variants;
2366
- return list.map((v) => judge(v, device, runtimes, checkFormat));
2366
+ return list.map((v) => judge(v, device, options.onEngine && device ? runtimesOnEngine(runtimes, v, device) : runtimes, checkFormat));
2367
2367
  }
2368
- function rankVariants(model, want, device, runtimes) {
2369
- const judged = judgeAll(model, want, device, runtimes);
2368
+ function ggufEngine(runtimes, device) {
2369
+ const arch = normalizeArch(device.arch);
2370
+ for (const r of runtimes)
2371
+ for (const b of r.builds)
2372
+ if (b.is_active && normalizeOs(b.os) === normalizeOs(device.os) && normalizeArch(b.arch) === arch && b.compat.some((c) => c.format === "gguf")) return b;
2373
+ return null;
2374
+ }
2375
+ function runtimesOnEngine(runtimes, variant, device) {
2376
+ const engine = ggufEngine(runtimes, device);
2377
+ if (!engine || variant.format !== "gguf") return [...runtimes];
2378
+ const rows = device.classes.map((hardware_class) => ({ hardware_class, format: variant.format, quant: variant.quant, architecture: variant.architecture, chat_template_kind: variant.chat_template_kind, status: "expected" }));
2379
+ return runtimes.map((r) => ({ ...r, builds: r.builds.map((b) => b === engine ? { ...b, compat: [...b.compat, ...rows] } : b) }));
2380
+ }
2381
+ function rankVariants(model, want, device, runtimes, options = {}) {
2382
+ const judged = judgeAll(model, want, device, runtimes, options);
2370
2383
  const usable = judged.filter((j) => j.usable).sort((a, b) => byOrder(asCandidate(a), asCandidate(b)));
2371
2384
  const rest = judged.filter((j) => !j.usable);
2372
2385
  return [...usable, ...rest].map((j, i) => ({
@@ -2375,9 +2388,31 @@ function rankVariants(model, want, device, runtimes) {
2375
2388
  reasons: j.reasons,
2376
2389
  recommended: j.usable && i === 0,
2377
2390
  fits: j.candidate?.fits ?? null,
2378
- build: j.candidate?.build ?? null
2391
+ build: j.candidate?.build ?? null,
2392
+ compat: j.usable ? j.candidate?.compat ?? null : null,
2393
+ engine: j.usable ? engineName(j, runtimes, device) : null
2379
2394
  }));
2380
2395
  }
2396
+ function engineName(j, runtimes, device) {
2397
+ if (j.candidate?.compat === "app_runtime") return "Matrx\u2019s own engine";
2398
+ const build = j.candidate?.build ?? (device ? null : runtimes.flatMap((r) => r.builds).find((b) => b.is_active && b.compat.some((c) => c.format === j.variant.format)) ?? null);
2399
+ if (!build) return null;
2400
+ return runtimes.find((r) => r.builds.some((b) => b.id === build.id))?.name ?? null;
2401
+ }
2402
+ var RUNS_ON = /^Runs on /;
2403
+ function variantVerdict(ranked, mode) {
2404
+ const rt = ranked.variant.discovery?.runtime ?? null;
2405
+ if (mode === "catalog") {
2406
+ const runtime = rt ? rt.available ? `Runs on ${rt.name}` : rt.note || `Matrx 2 has no ${rt.name} runtime yet.` : null;
2407
+ return { runs: null, badge: null, runtime, reason: null, lines: ranked.reasons.filter((l) => !RUNS_ON.test(l)) };
2408
+ }
2409
+ const lines = ranked.reasons.filter((l) => !RUNS_ON.test(l));
2410
+ if (!ranked.usable) {
2411
+ return { runs: false, badge: "Will not run", runtime: null, reason: lines[0] ?? "This version does not run on this computer.", lines: lines.slice(1) };
2412
+ }
2413
+ const name = ranked.engine ?? (rt?.available ? rt.name : null);
2414
+ return { runs: true, badge: null, runtime: name ? `Runs on ${name}` : null, reason: null, lines };
2415
+ }
2381
2416
  var USES = ["core", "vision", "audio_in", "voices"];
2382
2417
  function fromDiscovery(result) {
2383
2418
  const ambiguities = result.ambiguities ?? [];
@@ -2634,7 +2669,7 @@ function SearchTab({ port, onPick }) {
2634
2669
  }
2635
2670
  function DiscoveryResultView({ result, device, runtimes, want = DEFAULT_WANT, chooseLabel = "Choose", mode = "device", onChoose, renderVariantActions, renderActions }) {
2636
2671
  const model = useMemo3(() => fromDiscovery(result), [result]);
2637
- const ranked = useMemo3(() => rankVariants(model, want, device, runtimes), [model, want, device, runtimes]);
2672
+ const ranked = useMemo3(() => rankVariants(model, want, device, runtimes, { onEngine: mode === "device" }), [model, want, device, runtimes, mode]);
2638
2673
  const [choosing, setChoosing] = useState2(null);
2639
2674
  const [done, setDone] = useState2(null);
2640
2675
  const logo = (result.media ?? []).find((m) => m.kind === "maker_logo");
@@ -2685,27 +2720,26 @@ function DiscoveryResultView({ result, device, runtimes, want = DEFAULT_WANT, ch
2685
2720
  }
2686
2721
  function VariantRow({ ranked, mode, chooseLabel, busy, choosingThis, onChoose, extra }) {
2687
2722
  const v = ranked.variant;
2688
- const runtime = v.discovery?.runtime ?? null;
2689
2723
  const catalog = mode === "catalog";
2690
- const blocked = !catalog && !ranked.usable;
2691
- const why = blocked ? ranked.reasons[0] ?? "This version does not run on this computer." : null;
2724
+ const verdict = variantVerdict(ranked, mode);
2725
+ const blocked = !catalog && verdict.runs === false;
2692
2726
  const label = v.quant || v.key;
2693
2727
  const publisher = v.discovery?.publisher ?? null;
2694
2728
  const size = sizeOf(v.total_bytes);
2695
- return /* @__PURE__ */ jsxs4("li", { className: "flex flex-col gap-2 rounded-md border border-border p-3", "data-testid": "discovery-variant", "data-recommended": ranked.recommended ? "true" : void 0, children: [
2729
+ return /* @__PURE__ */ jsxs4("li", { className: "flex flex-col gap-2 rounded-md border border-border p-3", "data-testid": "discovery-variant", "data-runs": verdict.runs === null ? void 0 : String(verdict.runs), "data-recommended": ranked.recommended ? "true" : void 0, children: [
2696
2730
  /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-2", children: [
2697
2731
  /* @__PURE__ */ jsx5("span", { className: "text-sm font-medium text-foreground", children: label }),
2698
2732
  ranked.recommended ? /* @__PURE__ */ jsx5(Badge, { tone: "primary", children: "Recommended" }) : null,
2699
- ranked.usable || catalog ? null : /* @__PURE__ */ jsx5(Badge, { tone: "warning", children: "Will not run" }),
2733
+ verdict.badge ? /* @__PURE__ */ jsx5(Badge, { tone: "warning", children: verdict.badge }) : null,
2700
2734
  /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", children: [v.format.toUpperCase(), size, publisher ? `by ${publisher}` : null].filter(Boolean).join(" \xB7 ") }),
2701
2735
  /* @__PURE__ */ jsxs4("span", { className: "ml-auto flex items-center gap-2", children: [
2702
2736
  extra,
2703
- why ? /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", "data-testid": "choose-reason", children: why }) : null,
2737
+ verdict.reason ? /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", "data-testid": "choose-reason", children: verdict.reason }) : null,
2704
2738
  /* @__PURE__ */ jsx5(Button, { variant: ranked.recommended ? "primary" : "outline", disabled: busy || blocked, onClick: onChoose, children: choosingThis ? "Working\u2026" : chooseLabel })
2705
2739
  ] })
2706
2740
  ] }),
2707
- runtime ? /* @__PURE__ */ jsx5("p", { className: runtime.available ? "text-xs text-muted-foreground" : "text-xs text-foreground", "data-testid": "variant-runtime", children: runtime.available ? `Runs on ${runtime.name}` : runtime.note || `Matrx 2 has no ${runtime.name} runtime yet.` }) : null,
2708
- /* @__PURE__ */ jsx5("ul", { className: "flex flex-col gap-0.5", children: ranked.reasons.map((line) => /* @__PURE__ */ jsx5("li", { className: "text-xs text-muted-foreground", children: line }, line)) }),
2741
+ verdict.runtime ? /* @__PURE__ */ jsx5("p", { className: "text-xs text-muted-foreground", "data-testid": "variant-runtime", children: verdict.runtime }) : null,
2742
+ /* @__PURE__ */ jsx5("ul", { className: "flex flex-col gap-0.5", children: verdict.lines.map((line) => /* @__PURE__ */ jsx5("li", { className: "text-xs text-muted-foreground", children: line }, line)) }),
2709
2743
  v.artifacts.length ? /* @__PURE__ */ jsxs4(Collapsible, { children: [
2710
2744
  /* @__PURE__ */ jsxs4(CollapsibleTrigger, { className: "text-xs text-muted-foreground hover:text-foreground", children: [
2711
2745
  "Files in this version (",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/agents",
3
- "version": "0.59.202",
3
+ "version": "0.59.204",
4
4
  "description": "Portable AI Matrx agent stream protocol, event projection, and safe result-presentation primitives.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -511,9 +511,9 @@
511
511
  "@ai-matrx/alchemy": "latest",
512
512
  "@ai-matrx/api": "latest",
513
513
  "@ai-matrx/associations": "latest",
514
- "@ai-matrx/content-ir": "latest",
515
- "@ai-matrx/data": "latest",
516
514
  "@ai-matrx/design-system": "latest",
515
+ "@ai-matrx/data": "latest",
516
+ "@ai-matrx/content-ir": "latest",
517
517
  "@ai-matrx/diff": "latest",
518
518
  "@ai-matrx/icons": "latest",
519
519
  "@ai-matrx/kit": "latest"
@@ -561,5 +561,5 @@
561
561
  "verify:tarball": "node ./scripts/verify-tarball.mjs",
562
562
  "typegen:self-test": "node scripts/typegen/drop-guard.self-test.mjs && node scripts/typegen/check-api-types-fresh.mjs --self-test"
563
563
  },
564
- "gitHead": "87ac44110804dd25042da72a232bde2061bd528c"
564
+ "gitHead": "4d832f50ff335ff7d2858da508739243d30fdcc7"
565
565
  }