@vue-skuilder/db 0.2.26 → 0.2.27
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/dist/core/index.js +21 -13
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +21 -13
- package/dist/core/index.mjs.map +1 -1
- package/dist/impl/couch/index.js +21 -13
- package/dist/impl/couch/index.js.map +1 -1
- package/dist/impl/couch/index.mjs +21 -13
- package/dist/impl/couch/index.mjs.map +1 -1
- package/dist/impl/static/index.js +21 -13
- package/dist/impl/static/index.js.map +1 -1
- package/dist/impl/static/index.mjs +21 -13
- package/dist/impl/static/index.mjs.map +1 -1
- package/dist/index.js +21 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/navigators/generators/prescribed.ts +43 -14
- package/tests/core/navigators/prescribedIntroExposure.test.ts +29 -0
package/dist/index.js
CHANGED
|
@@ -2000,7 +2000,8 @@ var init_generators = __esm({
|
|
|
2000
2000
|
// src/core/navigators/generators/prescribed.ts
|
|
2001
2001
|
var prescribed_exports = {};
|
|
2002
2002
|
__export(prescribed_exports, {
|
|
2003
|
-
default: () => PrescribedCardsGenerator
|
|
2003
|
+
default: () => PrescribedCardsGenerator,
|
|
2004
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
2004
2005
|
});
|
|
2005
2006
|
function dedupe(arr) {
|
|
2006
2007
|
return [...new Set(arr)];
|
|
@@ -2040,6 +2041,19 @@ function formatAge(ms) {
|
|
|
2040
2041
|
if (hours < 24) return `${hours}h`;
|
|
2041
2042
|
return `${Math.round(hours / 24)}d`;
|
|
2042
2043
|
}
|
|
2044
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2045
|
+
if (minCount <= 0) return [];
|
|
2046
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
2047
|
+
for (const tag of tags) {
|
|
2048
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
2049
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
2050
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
2051
|
+
}
|
|
2052
|
+
return [...exposeTags].filter((tag) => {
|
|
2053
|
+
const tagElo = userTagElo[tag];
|
|
2054
|
+
return !tagElo || tagElo.count < minCount;
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2043
2057
|
function pickTopByScore(cards, limit) {
|
|
2044
2058
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2045
2059
|
}
|
|
@@ -2338,6 +2352,7 @@ var init_prescribed = __esm({
|
|
|
2338
2352
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2339
2353
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2340
2354
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2355
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2341
2356
|
hierarchyWalk: {
|
|
2342
2357
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2343
2358
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2413,18 +2428,11 @@ var init_prescribed = __esm({
|
|
|
2413
2428
|
group.hierarchyWalk?.enabled !== false,
|
|
2414
2429
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2415
2430
|
);
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2425
|
-
const tagElo = userTagElo[tag];
|
|
2426
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2427
|
-
});
|
|
2431
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2432
|
+
tags,
|
|
2433
|
+
userTagElo,
|
|
2434
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2435
|
+
);
|
|
2428
2436
|
if (unmetExposeTags.length > 0) {
|
|
2429
2437
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2430
2438
|
}
|