@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/impl/couch/index.js
CHANGED
|
@@ -1964,7 +1964,8 @@ var init_generators = __esm({
|
|
|
1964
1964
|
// src/core/navigators/generators/prescribed.ts
|
|
1965
1965
|
var prescribed_exports = {};
|
|
1966
1966
|
__export(prescribed_exports, {
|
|
1967
|
-
default: () => PrescribedCardsGenerator
|
|
1967
|
+
default: () => PrescribedCardsGenerator,
|
|
1968
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1968
1969
|
});
|
|
1969
1970
|
function dedupe(arr) {
|
|
1970
1971
|
return [...new Set(arr)];
|
|
@@ -2004,6 +2005,19 @@ function formatAge(ms) {
|
|
|
2004
2005
|
if (hours < 24) return `${hours}h`;
|
|
2005
2006
|
return `${Math.round(hours / 24)}d`;
|
|
2006
2007
|
}
|
|
2008
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
2009
|
+
if (minCount <= 0) return [];
|
|
2010
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
2011
|
+
for (const tag of tags) {
|
|
2012
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
2013
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
2014
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
2015
|
+
}
|
|
2016
|
+
return [...exposeTags].filter((tag) => {
|
|
2017
|
+
const tagElo = userTagElo[tag];
|
|
2018
|
+
return !tagElo || tagElo.count < minCount;
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2007
2021
|
function pickTopByScore(cards, limit) {
|
|
2008
2022
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
2009
2023
|
}
|
|
@@ -2302,6 +2316,7 @@ var init_prescribed = __esm({
|
|
|
2302
2316
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2303
2317
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2304
2318
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2319
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2305
2320
|
hierarchyWalk: {
|
|
2306
2321
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2307
2322
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2377,18 +2392,11 @@ var init_prescribed = __esm({
|
|
|
2377
2392
|
group.hierarchyWalk?.enabled !== false,
|
|
2378
2393
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2379
2394
|
);
|
|
2380
|
-
const
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2386
|
-
}
|
|
2387
|
-
}
|
|
2388
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2389
|
-
const tagElo = userTagElo[tag];
|
|
2390
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2391
|
-
});
|
|
2395
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2396
|
+
tags,
|
|
2397
|
+
userTagElo,
|
|
2398
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2399
|
+
);
|
|
2392
2400
|
if (unmetExposeTags.length > 0) {
|
|
2393
2401
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2394
2402
|
}
|