@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.mjs
CHANGED
|
@@ -1978,7 +1978,8 @@ var init_generators = __esm({
|
|
|
1978
1978
|
// src/core/navigators/generators/prescribed.ts
|
|
1979
1979
|
var prescribed_exports = {};
|
|
1980
1980
|
__export(prescribed_exports, {
|
|
1981
|
-
default: () => PrescribedCardsGenerator
|
|
1981
|
+
default: () => PrescribedCardsGenerator,
|
|
1982
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1982
1983
|
});
|
|
1983
1984
|
function dedupe(arr) {
|
|
1984
1985
|
return [...new Set(arr)];
|
|
@@ -2018,6 +2019,19 @@ function formatAge(ms) {
|
|
|
2018
2019
|
if (hours < 24) return `${hours}h`;
|
|
2019
2020
|
return `${Math.round(hours / 24)}d`;
|
|
2020
2021
|
}
|
|
2022
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2023
|
+
if (minCount <= 0) return [];
|
|
2024
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
2025
|
+
for (const tag of tags) {
|
|
2026
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
2027
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
2028
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
2029
|
+
}
|
|
2030
|
+
return [...exposeTags].filter((tag) => {
|
|
2031
|
+
const tagElo = userTagElo[tag];
|
|
2032
|
+
return !tagElo || tagElo.count < minCount;
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2021
2035
|
function pickTopByScore(cards, limit) {
|
|
2022
2036
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2023
2037
|
}
|
|
@@ -2316,6 +2330,7 @@ var init_prescribed = __esm({
|
|
|
2316
2330
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2317
2331
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2318
2332
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2333
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2319
2334
|
hierarchyWalk: {
|
|
2320
2335
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2321
2336
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2391,18 +2406,11 @@ var init_prescribed = __esm({
|
|
|
2391
2406
|
group.hierarchyWalk?.enabled !== false,
|
|
2392
2407
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2393
2408
|
);
|
|
2394
|
-
const
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2400
|
-
}
|
|
2401
|
-
}
|
|
2402
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2403
|
-
const tagElo = userTagElo[tag];
|
|
2404
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2405
|
-
});
|
|
2409
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2410
|
+
tags,
|
|
2411
|
+
userTagElo,
|
|
2412
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2413
|
+
);
|
|
2406
2414
|
if (unmetExposeTags.length > 0) {
|
|
2407
2415
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2408
2416
|
}
|