@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/core/index.js
CHANGED
|
@@ -1889,7 +1889,8 @@ var init_generators = __esm({
|
|
|
1889
1889
|
// src/core/navigators/generators/prescribed.ts
|
|
1890
1890
|
var prescribed_exports = {};
|
|
1891
1891
|
__export(prescribed_exports, {
|
|
1892
|
-
default: () => PrescribedCardsGenerator
|
|
1892
|
+
default: () => PrescribedCardsGenerator,
|
|
1893
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1893
1894
|
});
|
|
1894
1895
|
function dedupe(arr) {
|
|
1895
1896
|
return [...new Set(arr)];
|
|
@@ -1929,6 +1930,19 @@ function formatAge(ms) {
|
|
|
1929
1930
|
if (hours < 24) return `${hours}h`;
|
|
1930
1931
|
return `${Math.round(hours / 24)}d`;
|
|
1931
1932
|
}
|
|
1933
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1934
|
+
if (minCount <= 0) return [];
|
|
1935
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
1936
|
+
for (const tag of tags) {
|
|
1937
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
1938
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
1939
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
1940
|
+
}
|
|
1941
|
+
return [...exposeTags].filter((tag) => {
|
|
1942
|
+
const tagElo = userTagElo[tag];
|
|
1943
|
+
return !tagElo || tagElo.count < minCount;
|
|
1944
|
+
});
|
|
1945
|
+
}
|
|
1932
1946
|
function pickTopByScore(cards, limit) {
|
|
1933
1947
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
1934
1948
|
}
|
|
@@ -2227,6 +2241,7 @@ var init_prescribed = __esm({
|
|
|
2227
2241
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2228
2242
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2229
2243
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2244
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2230
2245
|
hierarchyWalk: {
|
|
2231
2246
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2232
2247
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2302,18 +2317,11 @@ var init_prescribed = __esm({
|
|
|
2302
2317
|
group.hierarchyWalk?.enabled !== false,
|
|
2303
2318
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2304
2319
|
);
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2314
|
-
const tagElo = userTagElo[tag];
|
|
2315
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2316
|
-
});
|
|
2320
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2321
|
+
tags,
|
|
2322
|
+
userTagElo,
|
|
2323
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2324
|
+
);
|
|
2317
2325
|
if (unmetExposeTags.length > 0) {
|
|
2318
2326
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2319
2327
|
}
|