maxpool 1.24.31 → 1.24.32
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/package.json +1 -1
- package/src/reset-policy.js +9 -4
package/package.json
CHANGED
package/src/reset-policy.js
CHANGED
|
@@ -71,6 +71,7 @@ export function decideZai(account, cards, now = Date.now()) {
|
|
|
71
71
|
|
|
72
72
|
const weeklyCard = weeklyCards[0] || null;
|
|
73
73
|
const sesCard = sesCards[0] || null;
|
|
74
|
+
let weeklyHeld = false; // R6: weekly card HELD for the free refill (5h branch may still fire)
|
|
74
75
|
|
|
75
76
|
// --- weekly card: clears BOTH windows (z.ai docs; measured: glm1 100%->0% both)
|
|
76
77
|
if (weeklyCard) {
|
|
@@ -81,20 +82,24 @@ export function decideZai(account, cards, now = Date.now()) {
|
|
|
81
82
|
if (atWall || dying) {
|
|
82
83
|
// R6: a wall redeem waits when the FREE weekly refill is imminent and the
|
|
83
84
|
// account isn't critically full (dying-value redeems stay exempt above).
|
|
85
|
+
// A HELD weekly card is spendable-redundant, not absent: the 5h branch below
|
|
86
|
+
// may still fire (red-team: holding must not starve a 5h wall — the 5h card
|
|
87
|
+
// sits redundant behind the free refill anyway, so spending it is pure gain).
|
|
84
88
|
if (atWall && !dying && q.providerWkReset != null
|
|
85
89
|
&& msLeft(q.providerWkReset, now) < POLICY.freeRefillWaitMs
|
|
86
90
|
&& wkUtil < POLICY.freeRefillImmediate) {
|
|
87
|
-
|
|
91
|
+
weeklyHeld = true; // fall through — do NOT return; the 5h branch checks this
|
|
92
|
+
} else {
|
|
93
|
+
return { kind: 'card', card: weeklyCard, resetType: 'WEEK',
|
|
94
|
+
reason: atWall ? 'weekly at wall' : 'dying value' };
|
|
88
95
|
}
|
|
89
|
-
return { kind: 'card', card: weeklyCard, resetType: 'WEEK',
|
|
90
|
-
reason: atWall ? 'weekly at wall' : 'dying value' };
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
// --- 5h card: clears only the session window
|
|
95
100
|
if (sesCard) {
|
|
96
101
|
const atWall = sesUtil != null && sesUtil >= POLICY.wallSes
|
|
97
|
-
&& (weeklyCard == null); // R4: a weekly card can do this job AND more
|
|
102
|
+
&& (weeklyCard == null || weeklyHeld); // R4: a weekly card can do this job AND more — except when R6 HELD it for the free refill
|
|
98
103
|
const dying = msLeft(sesCard.expiresAt, now) < POLICY.dyingWindowMs
|
|
99
104
|
&& (sesUtil ?? 0) >= POLICY.dyingMinUtilSes;
|
|
100
105
|
if (atWall || dying) {
|