@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
|
@@ -1942,7 +1942,8 @@ var init_generators = __esm({
|
|
|
1942
1942
|
// src/core/navigators/generators/prescribed.ts
|
|
1943
1943
|
var prescribed_exports = {};
|
|
1944
1944
|
__export(prescribed_exports, {
|
|
1945
|
-
default: () => PrescribedCardsGenerator
|
|
1945
|
+
default: () => PrescribedCardsGenerator,
|
|
1946
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1946
1947
|
});
|
|
1947
1948
|
function dedupe(arr) {
|
|
1948
1949
|
return [...new Set(arr)];
|
|
@@ -1982,6 +1983,19 @@ function formatAge(ms) {
|
|
|
1982
1983
|
if (hours < 24) return `${hours}h`;
|
|
1983
1984
|
return `${Math.round(hours / 24)}d`;
|
|
1984
1985
|
}
|
|
1986
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1987
|
+
if (minCount <= 0) return [];
|
|
1988
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
1989
|
+
for (const tag of tags) {
|
|
1990
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
1991
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
1992
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
1993
|
+
}
|
|
1994
|
+
return [...exposeTags].filter((tag) => {
|
|
1995
|
+
const tagElo = userTagElo[tag];
|
|
1996
|
+
return !tagElo || tagElo.count < minCount;
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1985
1999
|
function pickTopByScore(cards, limit) {
|
|
1986
2000
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
1987
2001
|
}
|
|
@@ -2280,6 +2294,7 @@ var init_prescribed = __esm({
|
|
|
2280
2294
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2281
2295
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2282
2296
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2297
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2283
2298
|
hierarchyWalk: {
|
|
2284
2299
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2285
2300
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2355,18 +2370,11 @@ var init_prescribed = __esm({
|
|
|
2355
2370
|
group.hierarchyWalk?.enabled !== false,
|
|
2356
2371
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2357
2372
|
);
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2366
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2367
|
-
const tagElo = userTagElo[tag];
|
|
2368
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2369
|
-
});
|
|
2373
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2374
|
+
tags,
|
|
2375
|
+
userTagElo,
|
|
2376
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2377
|
+
);
|
|
2370
2378
|
if (unmetExposeTags.length > 0) {
|
|
2371
2379
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2372
2380
|
}
|