@ai-matrx/agents 0.59.229 → 0.59.230
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 +13 -1
- package/dist/catalog/native/index.cjs +74 -79
- package/dist/catalog/native/index.js +74 -79
- package/dist/catalog/react/index.cjs +75 -83
- package/dist/catalog/react/index.js +75 -83
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.d.cts +4 -4
- package/dist/mandates/index.d.ts +4 -4
- package/dist/mandates/index.js +2 -2
- package/dist/models/index.cjs +19 -9
- package/dist/models/index.d.cts +4 -1
- package/dist/models/index.d.ts +4 -1
- package/dist/models/index.js +19 -9
- package/dist/models/react/index.cjs +0 -3
- package/dist/models/react/index.js +1 -4
- package/dist/quick/index.cjs +205 -82
- package/dist/quick/index.d.cts +110 -45
- package/dist/quick/index.d.ts +110 -45
- package/dist/quick/index.js +205 -82
- package/package.json +4 -4
|
@@ -348,85 +348,6 @@ import {
|
|
|
348
348
|
useState as useState2
|
|
349
349
|
} from "react";
|
|
350
350
|
|
|
351
|
-
// quick/shape.ts
|
|
352
|
-
var QUICK_AGENT_TAG = "kind:quick";
|
|
353
|
-
var QUICK_AGENT_DEFAULT_SETTINGS = Object.freeze({
|
|
354
|
-
temperature: 0.7,
|
|
355
|
-
topP: 1,
|
|
356
|
-
maxOutputTokens: 4096
|
|
357
|
-
});
|
|
358
|
-
function isQuickAgentSummary(row) {
|
|
359
|
-
return row.tags.includes(QUICK_AGENT_TAG);
|
|
360
|
-
}
|
|
361
|
-
function withoutQuickAgents(rows) {
|
|
362
|
-
return rows.filter((row) => !isQuickAgentSummary(row));
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// catalog/types.ts
|
|
366
|
-
function isMandateAgentId(id) {
|
|
367
|
-
return id.startsWith("mandate:");
|
|
368
|
-
}
|
|
369
|
-
var SORT_OPTIONS = [
|
|
370
|
-
{ value: "updated-desc", label: "Recent" },
|
|
371
|
-
{ value: "created-desc", label: "Created" },
|
|
372
|
-
{ value: "name-asc", label: "A \u2192 Z" },
|
|
373
|
-
{ value: "name-desc", label: "Z \u2192 A" },
|
|
374
|
-
{ value: "category-asc", label: "Category" }
|
|
375
|
-
];
|
|
376
|
-
var ARCHIVE_FILTER_ORDER = [
|
|
377
|
-
"active",
|
|
378
|
-
"both",
|
|
379
|
-
"archived"
|
|
380
|
-
];
|
|
381
|
-
var ARCHIVE_FILTER_OPTIONS = [
|
|
382
|
-
{ value: "active", label: "Hide archived", chip: "Archive" },
|
|
383
|
-
{ value: "both", label: "Show all", chip: "All + archived" },
|
|
384
|
-
{ value: "archived", label: "Archived only", chip: "Archived only" }
|
|
385
|
-
];
|
|
386
|
-
function nextArchFilter(current) {
|
|
387
|
-
const index = ARCHIVE_FILTER_ORDER.indexOf(current);
|
|
388
|
-
if (index < 0) return ARCHIVE_FILTER_ORDER[0];
|
|
389
|
-
return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
|
|
390
|
-
}
|
|
391
|
-
var AGENT_NONE_SENTINEL = "__none__";
|
|
392
|
-
|
|
393
|
-
// catalog/labels.ts
|
|
394
|
-
function agentListEmptyLabel(tab, labels) {
|
|
395
|
-
switch (tab) {
|
|
396
|
-
case "system":
|
|
397
|
-
return labels.emptySystem;
|
|
398
|
-
case "shared":
|
|
399
|
-
return labels.emptyShared;
|
|
400
|
-
default:
|
|
401
|
-
return labels.emptyDefault;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function shouldDefaultAgentListToPublicTab(args) {
|
|
405
|
-
if (!args.userId) return true;
|
|
406
|
-
if (!args.agentsLoaded) return false;
|
|
407
|
-
return args.ownedCount === 0;
|
|
408
|
-
}
|
|
409
|
-
function agentArchiveFilterChipLabel(archFilter) {
|
|
410
|
-
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
|
|
411
|
-
}
|
|
412
|
-
function agentArchiveFilterStateLabel(archFilter) {
|
|
413
|
-
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
|
|
414
|
-
}
|
|
415
|
-
function agentArchiveFilterControlLabel(archFilter) {
|
|
416
|
-
return `Archive filter: ${agentArchiveFilterStateLabel(
|
|
417
|
-
archFilter
|
|
418
|
-
).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
|
|
419
|
-
nextArchFilter(archFilter)
|
|
420
|
-
).toLowerCase()}`;
|
|
421
|
-
}
|
|
422
|
-
function agentListFooterLabel(args) {
|
|
423
|
-
const { count, archFilter, archivedHiddenCount } = args;
|
|
424
|
-
if (archFilter === "archived") return `${count} archived shown`;
|
|
425
|
-
const base = `${count} agent${count !== 1 ? "s" : ""}`;
|
|
426
|
-
if (archFilter === "both") return `${base} \xB7 archived shown`;
|
|
427
|
-
return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
351
|
// catalog/score.ts
|
|
431
352
|
function computeAgentSearchScore(agent, query) {
|
|
432
353
|
const q = query.trim().toLowerCase();
|
|
@@ -473,6 +394,34 @@ function agentMatchesSearch(agent, query) {
|
|
|
473
394
|
return computeAgentSearchScore(agent, query) > 0;
|
|
474
395
|
}
|
|
475
396
|
|
|
397
|
+
// catalog/types.ts
|
|
398
|
+
function isMandateAgentId(id) {
|
|
399
|
+
return id.startsWith("mandate:");
|
|
400
|
+
}
|
|
401
|
+
var SORT_OPTIONS = [
|
|
402
|
+
{ value: "updated-desc", label: "Recent" },
|
|
403
|
+
{ value: "created-desc", label: "Created" },
|
|
404
|
+
{ value: "name-asc", label: "A \u2192 Z" },
|
|
405
|
+
{ value: "name-desc", label: "Z \u2192 A" },
|
|
406
|
+
{ value: "category-asc", label: "Category" }
|
|
407
|
+
];
|
|
408
|
+
var ARCHIVE_FILTER_ORDER = [
|
|
409
|
+
"active",
|
|
410
|
+
"both",
|
|
411
|
+
"archived"
|
|
412
|
+
];
|
|
413
|
+
var ARCHIVE_FILTER_OPTIONS = [
|
|
414
|
+
{ value: "active", label: "Hide archived", chip: "Archive" },
|
|
415
|
+
{ value: "both", label: "Show all", chip: "All + archived" },
|
|
416
|
+
{ value: "archived", label: "Archived only", chip: "Archived only" }
|
|
417
|
+
];
|
|
418
|
+
function nextArchFilter(current) {
|
|
419
|
+
const index = ARCHIVE_FILTER_ORDER.indexOf(current);
|
|
420
|
+
if (index < 0) return ARCHIVE_FILTER_ORDER[0];
|
|
421
|
+
return ARCHIVE_FILTER_ORDER[(index + 1) % ARCHIVE_FILTER_ORDER.length];
|
|
422
|
+
}
|
|
423
|
+
var AGENT_NONE_SENTINEL = "__none__";
|
|
424
|
+
|
|
476
425
|
// catalog/selectors.ts
|
|
477
426
|
function memoize1(fn) {
|
|
478
427
|
let lastA;
|
|
@@ -741,6 +690,52 @@ var selectTotalFavoriteAgentsCount = memoize1(
|
|
|
741
690
|
(agents) => countUserRows(agents, "active", isFavorite)
|
|
742
691
|
);
|
|
743
692
|
|
|
693
|
+
// quick/shape.ts
|
|
694
|
+
var QUICK_AGENT_TAG = "kind:quick";
|
|
695
|
+
function isQuickAgentSummary(row) {
|
|
696
|
+
return row.tags.includes(QUICK_AGENT_TAG);
|
|
697
|
+
}
|
|
698
|
+
function withoutQuickAgents(rows) {
|
|
699
|
+
return rows.filter((row) => !isQuickAgentSummary(row));
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// catalog/labels.ts
|
|
703
|
+
function agentListEmptyLabel(tab, labels) {
|
|
704
|
+
switch (tab) {
|
|
705
|
+
case "system":
|
|
706
|
+
return labels.emptySystem;
|
|
707
|
+
case "shared":
|
|
708
|
+
return labels.emptyShared;
|
|
709
|
+
default:
|
|
710
|
+
return labels.emptyDefault;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function shouldDefaultAgentListToPublicTab(args) {
|
|
714
|
+
if (!args.userId) return true;
|
|
715
|
+
if (!args.agentsLoaded) return false;
|
|
716
|
+
return args.ownedCount === 0;
|
|
717
|
+
}
|
|
718
|
+
function agentArchiveFilterChipLabel(archFilter) {
|
|
719
|
+
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.chip ?? "Archive";
|
|
720
|
+
}
|
|
721
|
+
function agentArchiveFilterStateLabel(archFilter) {
|
|
722
|
+
return ARCHIVE_FILTER_OPTIONS.find((o) => o.value === archFilter)?.label ?? "Hide archived";
|
|
723
|
+
}
|
|
724
|
+
function agentArchiveFilterControlLabel(archFilter) {
|
|
725
|
+
return `Archive filter: ${agentArchiveFilterStateLabel(
|
|
726
|
+
archFilter
|
|
727
|
+
).toLowerCase()}. Click for ${agentArchiveFilterStateLabel(
|
|
728
|
+
nextArchFilter(archFilter)
|
|
729
|
+
).toLowerCase()}`;
|
|
730
|
+
}
|
|
731
|
+
function agentListFooterLabel(args) {
|
|
732
|
+
const { count, archFilter, archivedHiddenCount } = args;
|
|
733
|
+
if (archFilter === "archived") return `${count} archived shown`;
|
|
734
|
+
const base = `${count} agent${count !== 1 ? "s" : ""}`;
|
|
735
|
+
if (archFilter === "both") return `${base} \xB7 archived shown`;
|
|
736
|
+
return archivedHiddenCount > 0 ? `${base} \xB7 ${archivedHiddenCount} archived hidden` : base;
|
|
737
|
+
}
|
|
738
|
+
|
|
744
739
|
// catalog/shared/useAgentListCore.ts
|
|
745
740
|
var HOVER_GRACE_MS = 900;
|
|
746
741
|
function coerceVisibleTab(current, allowed, initialTab) {
|
|
@@ -1286,7 +1281,7 @@ var ICON_PATHS = SHAPES;
|
|
|
1286
1281
|
var ICON_NAMES = Object.keys(ICON_PATHS);
|
|
1287
1282
|
|
|
1288
1283
|
// catalog/react/icons.tsx
|
|
1289
|
-
import { FolderIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
|
|
1284
|
+
import { ArrowUpDownIcon, FolderIcon, MessageCircleIcon, RocketIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
|
|
1290
1285
|
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1291
1286
|
function Svg({ children, ...props }) {
|
|
1292
1287
|
return /* @__PURE__ */ jsx5(
|
|
@@ -1333,11 +1328,8 @@ function makeIcon(name) {
|
|
|
1333
1328
|
return /* @__PURE__ */ jsx5(Svg, { ...props, children: /* @__PURE__ */ jsx5(Shape, { name, filled: false }) });
|
|
1334
1329
|
};
|
|
1335
1330
|
}
|
|
1336
|
-
var ArrowUpDownIcon = makeIcon("arrowUpDown");
|
|
1337
1331
|
var LoaderIcon = makeIcon("loader");
|
|
1338
1332
|
var UsersIcon = makeIcon("users");
|
|
1339
|
-
var MessageCircleIcon = makeIcon("messageCircle");
|
|
1340
|
-
var RocketIcon = makeIcon("rocket");
|
|
1341
1333
|
var CircleCheckIcon = makeIcon("circleCheck");
|
|
1342
1334
|
var AlertTriangleIcon = makeIcon("alertTriangle");
|
|
1343
1335
|
var Music4Icon = makeIcon("music4");
|
package/dist/mandates/index.cjs
CHANGED
|
@@ -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: "
|
|
50
|
+
aidreamRevision: "35a306a12eb221459872bac8ef0b97639a997020",
|
|
51
51
|
generatorVersion: "1.0.0",
|
|
52
|
-
packageVersion: "0.59.
|
|
52
|
+
packageVersion: "0.59.230",
|
|
53
53
|
retireWindow: 3
|
|
54
54
|
};
|
|
55
55
|
var MANDATE_KEYS = {
|
|
@@ -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:
|
|
9
|
+
* aidream revision: 35a306a12eb221459872bac8ef0b97639a997020
|
|
10
10
|
* generator version: 1.0.0
|
|
11
|
-
* package version: 0.59.
|
|
11
|
+
* package version: 0.59.230
|
|
12
12
|
* active keys: 616
|
|
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: "
|
|
22
|
+
readonly aidreamRevision: "35a306a12eb221459872bac8ef0b97639a997020";
|
|
23
23
|
readonly generatorVersion: "1.0.0";
|
|
24
|
-
readonly packageVersion: "0.59.
|
|
24
|
+
readonly packageVersion: "0.59.230";
|
|
25
25
|
readonly retireWindow: 3;
|
|
26
26
|
};
|
|
27
27
|
/** Every declared mandate key, by THE IDENTIFIER RULE. */
|
package/dist/mandates/index.d.ts
CHANGED
|
@@ -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:
|
|
9
|
+
* aidream revision: 35a306a12eb221459872bac8ef0b97639a997020
|
|
10
10
|
* generator version: 1.0.0
|
|
11
|
-
* package version: 0.59.
|
|
11
|
+
* package version: 0.59.230
|
|
12
12
|
* active keys: 616
|
|
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: "
|
|
22
|
+
readonly aidreamRevision: "35a306a12eb221459872bac8ef0b97639a997020";
|
|
23
23
|
readonly generatorVersion: "1.0.0";
|
|
24
|
-
readonly packageVersion: "0.59.
|
|
24
|
+
readonly packageVersion: "0.59.230";
|
|
25
25
|
readonly retireWindow: 3;
|
|
26
26
|
};
|
|
27
27
|
/** Every declared mandate key, by THE IDENTIFIER RULE. */
|
package/dist/mandates/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// mandates/keys.generated.ts
|
|
2
2
|
var MANDATE_KEYS_META = {
|
|
3
|
-
aidreamRevision: "
|
|
3
|
+
aidreamRevision: "35a306a12eb221459872bac8ef0b97639a997020",
|
|
4
4
|
generatorVersion: "1.0.0",
|
|
5
|
-
packageVersion: "0.59.
|
|
5
|
+
packageVersion: "0.59.230",
|
|
6
6
|
retireWindow: 3
|
|
7
7
|
};
|
|
8
8
|
var MANDATE_KEYS = {
|
package/dist/models/index.cjs
CHANGED
|
@@ -47,6 +47,7 @@ __export(models_exports, {
|
|
|
47
47
|
buildSuccessionIndex: () => buildSuccessionIndex,
|
|
48
48
|
catalogFingerprint: () => catalogFingerprint,
|
|
49
49
|
catalogForApp: () => catalogForApp,
|
|
50
|
+
catalogKeyColumn: () => catalogKeyColumn,
|
|
50
51
|
catalogKindOf: () => catalogKindOf,
|
|
51
52
|
cheapestAdequateModel: () => cheapestAdequateModel,
|
|
52
53
|
classConfigKey: () => classConfigKey,
|
|
@@ -290,6 +291,12 @@ function isInteractionMode(value) {
|
|
|
290
291
|
return typeof value === "string" && INTERACTION_MODES.includes(value);
|
|
291
292
|
}
|
|
292
293
|
|
|
294
|
+
// models/catalog-key.ts
|
|
295
|
+
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
296
|
+
function catalogKeyColumn(value) {
|
|
297
|
+
return (0, import_uuid.isUuidShape)(value.trim()) ? "id" : "name";
|
|
298
|
+
}
|
|
299
|
+
|
|
293
300
|
// models/model-normalizer.ts
|
|
294
301
|
var LEGACY_KEY_MAP = {
|
|
295
302
|
max_tokens: "max_output_tokens",
|
|
@@ -789,7 +796,7 @@ function serviceCountLabel(count) {
|
|
|
789
796
|
}
|
|
790
797
|
|
|
791
798
|
// models/favorites.ts
|
|
792
|
-
var
|
|
799
|
+
var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
793
800
|
var MODEL_FAVORITE_ENTITY_TYPE = "ai_model";
|
|
794
801
|
function reconcileModelFavoriteIds(cached, canonical) {
|
|
795
802
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -837,7 +844,7 @@ function createModelFavorites(config) {
|
|
|
837
844
|
};
|
|
838
845
|
cache.subscribe?.(refresh);
|
|
839
846
|
const writeCanonical = async (id, isFavorite) => {
|
|
840
|
-
if (!(0,
|
|
847
|
+
if (!(0, import_uuid2.isUuidShape)(id)) {
|
|
841
848
|
sink({ code: "model-favorite-not-a-uuid", message: "not a model uuid \u2014 skipped ues_set", context: { id } });
|
|
842
849
|
return;
|
|
843
850
|
}
|
|
@@ -1007,7 +1014,7 @@ function createModelRecords(config) {
|
|
|
1007
1014
|
};
|
|
1008
1015
|
async function readFullModel(modelId) {
|
|
1009
1016
|
const relation = await isSignedIn() ? "model_config" : "model_public";
|
|
1010
|
-
const { data, error } = await ai().from(relation).select(MODEL_CONFIG_COLUMNS).eq(
|
|
1017
|
+
const { data, error } = await ai().from(relation).select(MODEL_CONFIG_COLUMNS).eq(catalogKeyColumn(modelId), modelId).maybeSingle();
|
|
1011
1018
|
if (error) throw error;
|
|
1012
1019
|
const row = data;
|
|
1013
1020
|
if (!row) throw new Error(`AI model ${modelId} is not available (ai.${relation} has no such row)`);
|
|
@@ -1060,7 +1067,7 @@ function createModelRecords(config) {
|
|
|
1060
1067
|
}
|
|
1061
1068
|
for (const id of Object.keys(known.identityById)) {
|
|
1062
1069
|
jobs.push(
|
|
1063
|
-
Promise.resolve(ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(
|
|
1070
|
+
Promise.resolve(ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(catalogKeyColumn(id), id).maybeSingle()).then(
|
|
1064
1071
|
({ data, error }) => {
|
|
1065
1072
|
if (error) throw error;
|
|
1066
1073
|
if (data) update((s3) => ({ ...s3, identityById: { ...s3.identityById, [id]: data } }));
|
|
@@ -1290,14 +1297,14 @@ function createModelRecords(config) {
|
|
|
1290
1297
|
return once(`identity:${modelId}`, async () => {
|
|
1291
1298
|
update((s3) => ({ ...s3, identityStatusById: { ...s3.identityStatusById, [modelId]: "loading" } }));
|
|
1292
1299
|
try {
|
|
1293
|
-
const { data, error } = await ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(
|
|
1300
|
+
const { data, error } = await ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(catalogKeyColumn(modelId), modelId).maybeSingle();
|
|
1294
1301
|
if (error) throw error;
|
|
1295
1302
|
if (!data) throw new Error(`AI model ${modelId} is not available (ai.model_definition has no such row)`);
|
|
1296
1303
|
const row = data;
|
|
1297
1304
|
update((s3) => ({
|
|
1298
1305
|
...s3,
|
|
1299
|
-
identityById: { ...s3.identityById, [row.id]: row },
|
|
1300
|
-
identityStatusById: { ...s3.identityStatusById, [row.id]: "succeeded" }
|
|
1306
|
+
identityById: { ...s3.identityById, [row.id]: row, [modelId]: row },
|
|
1307
|
+
identityStatusById: { ...s3.identityStatusById, [row.id]: "succeeded", [modelId]: "succeeded" }
|
|
1301
1308
|
}));
|
|
1302
1309
|
} catch (err) {
|
|
1303
1310
|
errorSink({ code: "model-records-identity-failed", message: messageOf(err), context: { modelId } });
|
|
@@ -1810,8 +1817,9 @@ function resetSuccessionLogForTests() {
|
|
|
1810
1817
|
async function resolveLiveModelId(client, modelId) {
|
|
1811
1818
|
const index = /* @__PURE__ */ new Map();
|
|
1812
1819
|
let want = modelId;
|
|
1820
|
+
let startId = modelId;
|
|
1813
1821
|
for (let hop = 0; want && hop <= MAX_SUCCESSION_HOPS && !index.has(want); hop += 1) {
|
|
1814
|
-
const { data, error } = await client.schema("ai").from("model_public").select("id, is_deprecated, retired_at, successor_id").in("id", [want]);
|
|
1822
|
+
const { data, error } = await client.schema("ai").from("model_public").select("id, is_deprecated, retired_at, successor_id").in(hop === 0 ? catalogKeyColumn(want) : "id", [want]);
|
|
1815
1823
|
if (error) {
|
|
1816
1824
|
console.warn(`[models/succession] ${modelId}: the catalog could not be read (${error.message}); keeping the model as given.`);
|
|
1817
1825
|
return modelId;
|
|
@@ -1825,9 +1833,11 @@ async function resolveLiveModelId(client, modelId) {
|
|
|
1825
1833
|
successorId: typeof row.successor_id === "string" ? row.successor_id : null
|
|
1826
1834
|
};
|
|
1827
1835
|
index.set(node.id, node);
|
|
1836
|
+
if (hop === 0) startId = node.id;
|
|
1828
1837
|
want = isSupersedable(node) ? node.successorId : null;
|
|
1829
1838
|
}
|
|
1830
|
-
|
|
1839
|
+
const resolved = resolveSuccessor(startId, index);
|
|
1840
|
+
return resolved === startId ? modelId : resolved;
|
|
1831
1841
|
}
|
|
1832
1842
|
|
|
1833
1843
|
// models/local.ts
|
package/dist/models/index.d.cts
CHANGED
|
@@ -71,6 +71,9 @@ declare function isContentType(value: unknown): value is ContentType;
|
|
|
71
71
|
declare function isFeatureKey(value: unknown): value is FeatureKey;
|
|
72
72
|
declare function isInteractionMode(value: unknown): value is InteractionMode;
|
|
73
73
|
|
|
74
|
+
type CatalogKeyColumn = "id" | "name";
|
|
75
|
+
declare function catalogKeyColumn(value: string): CatalogKeyColumn;
|
|
76
|
+
|
|
74
77
|
/**
|
|
75
78
|
* Normalizes legacy model control keys and prompt settings keys to their
|
|
76
79
|
* current backend equivalents.
|
|
@@ -1808,4 +1811,4 @@ catalog?: SuccessionClient): Promise<NewAgentModel>;
|
|
|
1808
1811
|
*/
|
|
1809
1812
|
declare function resolveModelMapKnob(value: unknown, catalog: SuccessionClient): Promise<Record<string, string>>;
|
|
1810
1813
|
|
|
1811
|
-
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, resolveModelMapKnob, 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 };
|
|
1814
|
+
export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKeyColumn, 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, catalogKeyColumn, 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, resolveModelMapKnob, 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 };
|
package/dist/models/index.d.ts
CHANGED
|
@@ -71,6 +71,9 @@ declare function isContentType(value: unknown): value is ContentType;
|
|
|
71
71
|
declare function isFeatureKey(value: unknown): value is FeatureKey;
|
|
72
72
|
declare function isInteractionMode(value: unknown): value is InteractionMode;
|
|
73
73
|
|
|
74
|
+
type CatalogKeyColumn = "id" | "name";
|
|
75
|
+
declare function catalogKeyColumn(value: string): CatalogKeyColumn;
|
|
76
|
+
|
|
74
77
|
/**
|
|
75
78
|
* Normalizes legacy model control keys and prompt settings keys to their
|
|
76
79
|
* current backend equivalents.
|
|
@@ -1808,4 +1811,4 @@ catalog?: SuccessionClient): Promise<NewAgentModel>;
|
|
|
1808
1811
|
*/
|
|
1809
1812
|
declare function resolveModelMapKnob(value: unknown, catalog: SuccessionClient): Promise<Record<string, string>>;
|
|
1810
1813
|
|
|
1811
|
-
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, resolveModelMapKnob, 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 };
|
|
1814
|
+
export { type AdminOffering, type AdminPricingBand, type ArtifactUse, type AuditCapabilitiesRecord, CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, type CapabilitiesParseContext, type CatalogKeyColumn, 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, catalogKeyColumn, 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, resolveModelMapKnob, 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 };
|
package/dist/models/index.js
CHANGED
|
@@ -132,6 +132,12 @@ function isInteractionMode(value) {
|
|
|
132
132
|
return typeof value === "string" && INTERACTION_MODES.includes(value);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
// models/catalog-key.ts
|
|
136
|
+
import { isUuidShape } from "@ai-matrx/kit/uuid";
|
|
137
|
+
function catalogKeyColumn(value) {
|
|
138
|
+
return isUuidShape(value.trim()) ? "id" : "name";
|
|
139
|
+
}
|
|
140
|
+
|
|
135
141
|
// models/model-normalizer.ts
|
|
136
142
|
var LEGACY_KEY_MAP = {
|
|
137
143
|
max_tokens: "max_output_tokens",
|
|
@@ -631,7 +637,7 @@ function serviceCountLabel(count) {
|
|
|
631
637
|
}
|
|
632
638
|
|
|
633
639
|
// models/favorites.ts
|
|
634
|
-
import { isUuidShape } from "@ai-matrx/kit/uuid";
|
|
640
|
+
import { isUuidShape as isUuidShape2 } from "@ai-matrx/kit/uuid";
|
|
635
641
|
var MODEL_FAVORITE_ENTITY_TYPE = "ai_model";
|
|
636
642
|
function reconcileModelFavoriteIds(cached, canonical) {
|
|
637
643
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -679,7 +685,7 @@ function createModelFavorites(config) {
|
|
|
679
685
|
};
|
|
680
686
|
cache.subscribe?.(refresh);
|
|
681
687
|
const writeCanonical = async (id, isFavorite) => {
|
|
682
|
-
if (!
|
|
688
|
+
if (!isUuidShape2(id)) {
|
|
683
689
|
sink({ code: "model-favorite-not-a-uuid", message: "not a model uuid \u2014 skipped ues_set", context: { id } });
|
|
684
690
|
return;
|
|
685
691
|
}
|
|
@@ -849,7 +855,7 @@ function createModelRecords(config) {
|
|
|
849
855
|
};
|
|
850
856
|
async function readFullModel(modelId) {
|
|
851
857
|
const relation = await isSignedIn() ? "model_config" : "model_public";
|
|
852
|
-
const { data, error } = await ai().from(relation).select(MODEL_CONFIG_COLUMNS).eq(
|
|
858
|
+
const { data, error } = await ai().from(relation).select(MODEL_CONFIG_COLUMNS).eq(catalogKeyColumn(modelId), modelId).maybeSingle();
|
|
853
859
|
if (error) throw error;
|
|
854
860
|
const row = data;
|
|
855
861
|
if (!row) throw new Error(`AI model ${modelId} is not available (ai.${relation} has no such row)`);
|
|
@@ -902,7 +908,7 @@ function createModelRecords(config) {
|
|
|
902
908
|
}
|
|
903
909
|
for (const id of Object.keys(known.identityById)) {
|
|
904
910
|
jobs.push(
|
|
905
|
-
Promise.resolve(ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(
|
|
911
|
+
Promise.resolve(ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(catalogKeyColumn(id), id).maybeSingle()).then(
|
|
906
912
|
({ data, error }) => {
|
|
907
913
|
if (error) throw error;
|
|
908
914
|
if (data) update((s3) => ({ ...s3, identityById: { ...s3.identityById, [id]: data } }));
|
|
@@ -1132,14 +1138,14 @@ function createModelRecords(config) {
|
|
|
1132
1138
|
return once(`identity:${modelId}`, async () => {
|
|
1133
1139
|
update((s3) => ({ ...s3, identityStatusById: { ...s3.identityStatusById, [modelId]: "loading" } }));
|
|
1134
1140
|
try {
|
|
1135
|
-
const { data, error } = await ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(
|
|
1141
|
+
const { data, error } = await ai().from("model_definition").select("id, name, common_name, is_deprecated").eq(catalogKeyColumn(modelId), modelId).maybeSingle();
|
|
1136
1142
|
if (error) throw error;
|
|
1137
1143
|
if (!data) throw new Error(`AI model ${modelId} is not available (ai.model_definition has no such row)`);
|
|
1138
1144
|
const row = data;
|
|
1139
1145
|
update((s3) => ({
|
|
1140
1146
|
...s3,
|
|
1141
|
-
identityById: { ...s3.identityById, [row.id]: row },
|
|
1142
|
-
identityStatusById: { ...s3.identityStatusById, [row.id]: "succeeded" }
|
|
1147
|
+
identityById: { ...s3.identityById, [row.id]: row, [modelId]: row },
|
|
1148
|
+
identityStatusById: { ...s3.identityStatusById, [row.id]: "succeeded", [modelId]: "succeeded" }
|
|
1143
1149
|
}));
|
|
1144
1150
|
} catch (err) {
|
|
1145
1151
|
errorSink({ code: "model-records-identity-failed", message: messageOf(err), context: { modelId } });
|
|
@@ -1652,8 +1658,9 @@ function resetSuccessionLogForTests() {
|
|
|
1652
1658
|
async function resolveLiveModelId(client, modelId) {
|
|
1653
1659
|
const index = /* @__PURE__ */ new Map();
|
|
1654
1660
|
let want = modelId;
|
|
1661
|
+
let startId = modelId;
|
|
1655
1662
|
for (let hop = 0; want && hop <= MAX_SUCCESSION_HOPS && !index.has(want); hop += 1) {
|
|
1656
|
-
const { data, error } = await client.schema("ai").from("model_public").select("id, is_deprecated, retired_at, successor_id").in("id", [want]);
|
|
1663
|
+
const { data, error } = await client.schema("ai").from("model_public").select("id, is_deprecated, retired_at, successor_id").in(hop === 0 ? catalogKeyColumn(want) : "id", [want]);
|
|
1657
1664
|
if (error) {
|
|
1658
1665
|
console.warn(`[models/succession] ${modelId}: the catalog could not be read (${error.message}); keeping the model as given.`);
|
|
1659
1666
|
return modelId;
|
|
@@ -1667,9 +1674,11 @@ async function resolveLiveModelId(client, modelId) {
|
|
|
1667
1674
|
successorId: typeof row.successor_id === "string" ? row.successor_id : null
|
|
1668
1675
|
};
|
|
1669
1676
|
index.set(node.id, node);
|
|
1677
|
+
if (hop === 0) startId = node.id;
|
|
1670
1678
|
want = isSupersedable(node) ? node.successorId : null;
|
|
1671
1679
|
}
|
|
1672
|
-
|
|
1680
|
+
const resolved = resolveSuccessor(startId, index);
|
|
1681
|
+
return resolved === startId ? modelId : resolved;
|
|
1673
1682
|
}
|
|
1674
1683
|
|
|
1675
1684
|
// models/local.ts
|
|
@@ -2760,6 +2769,7 @@ export {
|
|
|
2760
2769
|
buildSuccessionIndex,
|
|
2761
2770
|
catalogFingerprint,
|
|
2762
2771
|
catalogForApp,
|
|
2772
|
+
catalogKeyColumn,
|
|
2763
2773
|
catalogKindOf,
|
|
2764
2774
|
cheapestAdequateModel,
|
|
2765
2775
|
classConfigKey,
|
|
@@ -282,11 +282,8 @@ function makeIcon(name) {
|
|
|
282
282
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Svg, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Shape, { name, filled: false }) });
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
|
-
var ArrowUpDownIcon = makeIcon("arrowUpDown");
|
|
286
285
|
var LoaderIcon = makeIcon("loader");
|
|
287
286
|
var UsersIcon = makeIcon("users");
|
|
288
|
-
var MessageCircleIcon = makeIcon("messageCircle");
|
|
289
|
-
var RocketIcon = makeIcon("rocket");
|
|
290
287
|
var CircleCheckIcon = makeIcon("circleCheck");
|
|
291
288
|
var AlertTriangleIcon = makeIcon("alertTriangle");
|
|
292
289
|
var Music4Icon = makeIcon("music4");
|
|
@@ -226,7 +226,7 @@ var ICON_PATHS = SHAPES;
|
|
|
226
226
|
var ICON_NAMES = Object.keys(ICON_PATHS);
|
|
227
227
|
|
|
228
228
|
// catalog/react/icons.tsx
|
|
229
|
-
import { FolderIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
|
|
229
|
+
import { ArrowUpDownIcon, FolderIcon, MessageCircleIcon, RocketIcon, RotateCcwIcon, TagIcon } from "@ai-matrx/design-system/icons";
|
|
230
230
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
231
231
|
function Svg({ children, ...props }) {
|
|
232
232
|
return /* @__PURE__ */ jsx2(
|
|
@@ -273,11 +273,8 @@ function makeIcon(name) {
|
|
|
273
273
|
return /* @__PURE__ */ jsx2(Svg, { ...props, children: /* @__PURE__ */ jsx2(Shape, { name, filled: false }) });
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
var ArrowUpDownIcon = makeIcon("arrowUpDown");
|
|
277
276
|
var LoaderIcon = makeIcon("loader");
|
|
278
277
|
var UsersIcon = makeIcon("users");
|
|
279
|
-
var MessageCircleIcon = makeIcon("messageCircle");
|
|
280
|
-
var RocketIcon = makeIcon("rocket");
|
|
281
278
|
var CircleCheckIcon = makeIcon("circleCheck");
|
|
282
279
|
var AlertTriangleIcon = makeIcon("alertTriangle");
|
|
283
280
|
var Music4Icon = makeIcon("music4");
|