@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.mjs
CHANGED
|
@@ -1867,7 +1867,8 @@ var init_generators = __esm({
|
|
|
1867
1867
|
// src/core/navigators/generators/prescribed.ts
|
|
1868
1868
|
var prescribed_exports = {};
|
|
1869
1869
|
__export(prescribed_exports, {
|
|
1870
|
-
default: () => PrescribedCardsGenerator
|
|
1870
|
+
default: () => PrescribedCardsGenerator,
|
|
1871
|
+
unmetIntroExposeTags: () => unmetIntroExposeTags
|
|
1871
1872
|
});
|
|
1872
1873
|
function dedupe(arr) {
|
|
1873
1874
|
return [...new Set(arr)];
|
|
@@ -1907,6 +1908,19 @@ function formatAge(ms) {
|
|
|
1907
1908
|
if (hours < 24) return `${hours}h`;
|
|
1908
1909
|
return `${Math.round(hours / 24)}d`;
|
|
1909
1910
|
}
|
|
1911
|
+
function unmetIntroExposeTags(tags, userTagElo, minCount) {
|
|
1912
|
+
if (minCount <= 0) return [];
|
|
1913
|
+
const exposeTags = new Set(tags.filter((tag) => tag.startsWith("gpc:expose:")));
|
|
1914
|
+
for (const tag of tags) {
|
|
1915
|
+
if (!tag.startsWith("gpc:intro:")) continue;
|
|
1916
|
+
const suffix = tag.slice("gpc:intro:".length);
|
|
1917
|
+
if (suffix) exposeTags.add(`gpc:expose:${suffix}`);
|
|
1918
|
+
}
|
|
1919
|
+
return [...exposeTags].filter((tag) => {
|
|
1920
|
+
const tagElo = userTagElo[tag];
|
|
1921
|
+
return !tagElo || tagElo.count < minCount;
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1910
1924
|
function pickTopByScore(cards, limit) {
|
|
1911
1925
|
return [...cards].sort((a, b) => b.score - a.score || a.cardId.localeCompare(b.cardId)).slice(0, limit);
|
|
1912
1926
|
}
|
|
@@ -2205,6 +2219,7 @@ var init_prescribed = __esm({
|
|
|
2205
2219
|
freshnessWindowSessions: typeof raw.freshnessWindowSessions === "number" ? raw.freshnessWindowSessions : DEFAULT_FRESHNESS_WINDOW,
|
|
2206
2220
|
maxDirectTargetsPerRun: typeof raw.maxDirectTargetsPerRun === "number" ? raw.maxDirectTargetsPerRun : DEFAULT_MAX_DIRECT_PER_RUN,
|
|
2207
2221
|
maxSupportCardsPerRun: typeof raw.maxSupportCardsPerRun === "number" ? raw.maxSupportCardsPerRun : DEFAULT_MAX_SUPPORT_PER_RUN,
|
|
2222
|
+
introExposeMinCount: typeof raw.introExposeMinCount === "number" ? raw.introExposeMinCount : DEFAULT_MIN_COUNT,
|
|
2208
2223
|
hierarchyWalk: {
|
|
2209
2224
|
enabled: raw.hierarchyWalk?.enabled !== false,
|
|
2210
2225
|
maxDepth: typeof raw.hierarchyWalk?.maxDepth === "number" ? raw.hierarchyWalk.maxDepth : DEFAULT_HIERARCHY_DEPTH
|
|
@@ -2280,18 +2295,11 @@ var init_prescribed = __esm({
|
|
|
2280
2295
|
group.hierarchyWalk?.enabled !== false,
|
|
2281
2296
|
group.hierarchyWalk?.maxDepth ?? DEFAULT_HIERARCHY_DEPTH
|
|
2282
2297
|
);
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
exposeTags.add(`gpc:expose:${suffix}`);
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
const unmetExposeTags = [...exposeTags].filter((tag) => {
|
|
2292
|
-
const tagElo = userTagElo[tag];
|
|
2293
|
-
return !tagElo || tagElo.count < DEFAULT_MIN_COUNT;
|
|
2294
|
-
});
|
|
2298
|
+
const unmetExposeTags = unmetIntroExposeTags(
|
|
2299
|
+
tags,
|
|
2300
|
+
userTagElo,
|
|
2301
|
+
group.introExposeMinCount ?? DEFAULT_MIN_COUNT
|
|
2302
|
+
);
|
|
2295
2303
|
if (unmetExposeTags.length > 0) {
|
|
2296
2304
|
unmetExposeTags.forEach((tag) => supportTags.add(tag));
|
|
2297
2305
|
}
|