rightcard-mcp 0.1.23 → 0.1.25
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/configurable.d.ts +9 -0
- package/dist/configurable.js +16 -0
- package/dist/engine.js +9 -2
- package/dist/matching.js +6 -0
- package/dist/model.d.ts +1 -1
- package/dist/model.js +9 -0
- package/dist/tools.js +1 -1
- package/dist/valuation.js +4 -0
- package/package.json +1 -1
package/dist/configurable.d.ts
CHANGED
|
@@ -11,7 +11,16 @@ export interface ConfigurableCardSpec {
|
|
|
11
11
|
* its card in Oct 2026; both names contain "venmo". Mirrors the Swift spec. */
|
|
12
12
|
exactIDs?: string[];
|
|
13
13
|
multiCardMax: number;
|
|
14
|
+
/** A second pick at a lower rate (TD Cash 2%), saved under "<card id>#2"
|
|
15
|
+
* in the picks map. Mirrors ConfigurableCardSpec.secondTier (Nov 19 2026). */
|
|
16
|
+
secondTier?: {
|
|
17
|
+
rate: number;
|
|
18
|
+
eligible: SpendCategory[];
|
|
19
|
+
};
|
|
14
20
|
}
|
|
21
|
+
export declare const secondTierKey: (cardId: string) => string;
|
|
22
|
+
/** The second tier as a spec of its own, so an answer it wins reads at its own rate. */
|
|
23
|
+
export declare function secondTierSpec(spec: ConfigurableCardSpec): ConfigurableCardSpec | null;
|
|
15
24
|
export declare const CONFIGURABLE_SPECS: ConfigurableCardSpec[];
|
|
16
25
|
/** ConfigurableCardCatalog.normalize: lowercase, "+" → "plus", strip non-alphanumerics. */
|
|
17
26
|
export declare function normalizeConfigurable(s: string): string;
|
package/dist/configurable.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
export const secondTierKey = (cardId) => cardId + "#2";
|
|
2
|
+
/** The second tier as a spec of its own, so an answer it wins reads at its own rate. */
|
|
3
|
+
export function secondTierSpec(spec) {
|
|
4
|
+
if (!spec.secondTier)
|
|
5
|
+
return null;
|
|
6
|
+
return { ...spec, key: spec.key + "#2", bonusRate: spec.secondTier.rate, slots: 1,
|
|
7
|
+
eligible: spec.secondTier.eligible, secondTier: undefined, multiCardMax: 1 };
|
|
8
|
+
}
|
|
1
9
|
export const CONFIGURABLE_SPECS = [
|
|
10
|
+
{
|
|
11
|
+
// TD Cash (Nov 19 2026, td.com): a 3% pick and a 2% pick, changeable each quarter.
|
|
12
|
+
key: "td_cash", displayName: "TD Cash", bonusRate: 3, slots: 1,
|
|
13
|
+
eligible: ["dining", "entertainment", "gas", "grocery", "travel"],
|
|
14
|
+
note: "TD Cash pays 3% in one category and 2% in another, from dining, entertainment, gas, groceries and travel. You can change both every quarter. A new card starts at 3% on dining and 2% on groceries.",
|
|
15
|
+
matchNeedles: [], exactIDs: ["td_bank_td_cash_credit_card"], multiCardMax: 1,
|
|
16
|
+
secondTier: { rate: 2, eligible: ["dining", "entertainment", "gas", "grocery", "travel"] },
|
|
17
|
+
},
|
|
2
18
|
{
|
|
3
19
|
key: "amex_business_gold", displayName: "Amex Business Gold", bonusRate: 4, slots: 2,
|
|
4
20
|
// Nov 16 2026: Amex took airfare off the 4X list and added transit (mirrors Swift).
|
package/dist/engine.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Mirrors MerchantYieldEngine (BASE-RATE mode only — offers live on the phone, never here).
|
|
2
2
|
import { ALL_CATEGORIES, CATEGORY_DISPLAY, capCovers, categoryStoreTypes, isPermanentMerchantBenefit, multiplier, requiresApplePay, overrideIsActive, rotatingCap, standingCaps, storeTypes, } from "./model.js";
|
|
3
3
|
import { merchantMatchesCoBrandBenefit, offerMatches } from "./matching.js";
|
|
4
|
-
import { specFor } from "./configurable.js";
|
|
4
|
+
import { specFor, secondTierKey, secondTierSpec } from "./configurable.js";
|
|
5
5
|
import { basisLabel, cashOutCPP, centsPerPoint, earnUnitLabel, effectiveProgram, fmt1, fmtRate, valuesPointsAboveCash, withPooling, } from "./valuation.js";
|
|
6
6
|
/** Where the quarter is turned on. Mirrors MerchantYieldEngine.activationApp. */
|
|
7
7
|
export function activationApp(issuer) {
|
|
@@ -210,6 +210,13 @@ function appliedRate(card, category, subKey, merchantQuery, overrides, cardConfi
|
|
|
210
210
|
winningConfig = spec;
|
|
211
211
|
winningOverride = null;
|
|
212
212
|
}
|
|
213
|
+
const second = spec ? secondTierSpec(spec) : null;
|
|
214
|
+
if (second && second.eligible.includes(category) && cardConfigs[secondTierKey(card.id)]?.has(category)
|
|
215
|
+
&& second.bonusRate > rate) {
|
|
216
|
+
rate = second.bonusRate;
|
|
217
|
+
winningConfig = second;
|
|
218
|
+
winningOverride = null;
|
|
219
|
+
}
|
|
213
220
|
// A standing cap marked used up pays its "after" rate (mirrors the app).
|
|
214
221
|
if (sharesCategoryCap(winningOverride, now) && usedUp.size > 0) {
|
|
215
222
|
for (const cap of standingCaps(card.id)) {
|
|
@@ -496,7 +503,7 @@ export function recommend(input) {
|
|
|
496
503
|
if (capRow.chosen && capRow.categories.length > 0)
|
|
497
504
|
names.unshift("your chosen category");
|
|
498
505
|
const list = names.length > 1 ? new Intl.ListFormat("en", { type: "conjunction" }).format(names) : null;
|
|
499
|
-
const per = capRow.period === "quarter" ? "each quarter" : capRow.period === "billingCycle" ? "each billing cycle" : "a year";
|
|
506
|
+
const per = capRow.period === "quarter" ? "each quarter" : capRow.period === "billingCycle" ? "each billing cycle" : capRow.period === "month" ? "each month" : "a year";
|
|
500
507
|
ctx.capLimit = list
|
|
501
508
|
? `${rate} on your first $${spend} ${per} across ${list}, then ${then}.`
|
|
502
509
|
: `${rate} on your first $${spend} ${per}, then ${then}.`;
|
package/dist/matching.js
CHANGED
|
@@ -21,6 +21,12 @@ const COBRAND_PLACE_WORDS = new Set([
|
|
|
21
21
|
"hotel", "hotels", "resort", "resorts", "suites", "express", "restaurant",
|
|
22
22
|
"restaurants", "collection", "garden", "gardens", "plaza", "club",
|
|
23
23
|
"vacations", "airlines", "airline", "airways", "market", "store", "stores",
|
|
24
|
+
// Nov 20 2026: short brand words (CVS, BJ's, AAA) are dropped, so these kinds
|
|
25
|
+
// of store let "Walmart Pharmacy" match "CVS Pharmacy" and "Whole Foods
|
|
26
|
+
// Market" match "Cub Foods".
|
|
27
|
+
"pharmacy", "drug", "food", "foods", "fresh", "grocery", "travel", "rental",
|
|
28
|
+
"rentals", "house", "shop", "mart", "hardware", "center", "optical", "tire",
|
|
29
|
+
"tires", "business",
|
|
24
30
|
]);
|
|
25
31
|
const TLD_RE = /\.(com|net|org|co|io|tv|shop|store|us)\b/g;
|
|
26
32
|
const isAlnum = (ch) => /[\p{L}\p{N}]/u.test(ch);
|
package/dist/model.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare function rotatingCap(cardId: string): RotatingCap | null;
|
|
|
55
55
|
/** A STANDING category cap (mirrors StandingCap in the app, Oct 14 2026):
|
|
56
56
|
* the bonus stops after a spend amount and comes back next period. Quoted
|
|
57
57
|
* from each issuer page; see the Swift table for the quotes. */
|
|
58
|
-
export type CapPeriod = "quarter" | "calendarYear" | "cardYear" | "billingCycle";
|
|
58
|
+
export type CapPeriod = "quarter" | "calendarYear" | "cardYear" | "billingCycle" | "month";
|
|
59
59
|
export type StandingCap = {
|
|
60
60
|
id: string;
|
|
61
61
|
categories: SpendCategory[];
|
package/dist/model.js
CHANGED
|
@@ -132,9 +132,14 @@ export function standingCaps(cardId) {
|
|
|
132
132
|
return [{ id: "grocery", categories: ["grocery"], limit: 6000, period: "calendarYear", after: 1 }];
|
|
133
133
|
case "american_express_blue_business_cash_card_from_american_express":
|
|
134
134
|
return [{ id: "all", categories: [], everything: true, limit: 50000, period: "calendarYear", after: 1 }];
|
|
135
|
+
// Hilton Honors Business (Nov 19 2026): "5X on the first $100K in eligible purchases per
|
|
136
|
+
// calendar year, 3X Points thereafter."
|
|
137
|
+
case "american_express_hilton_honors_american_express_business_card":
|
|
138
|
+
return [{ id: "all", categories: [], everything: true, limit: 100000, period: "calendarYear", after: 3 }];
|
|
135
139
|
case "sams_club_mastercard":
|
|
136
140
|
return [{ id: "gas", categories: ["gas"], limit: 6000, period: "calendarYear", after: 1 }];
|
|
137
141
|
case "citi_costco_anywhere":
|
|
142
|
+
case "citi_costco_anywhere_visa_business_card_by_citi":
|
|
138
143
|
return [{ id: "gas", categories: ["gas"], limit: 7000, period: "calendarYear", after: 1 }];
|
|
139
144
|
case "marriott_boundless":
|
|
140
145
|
return [{ id: "combined", categories: ["grocery", "gas", "dining"], limit: 6000, period: "cardYear", after: 2 }];
|
|
@@ -142,6 +147,10 @@ export function standingCaps(cardId) {
|
|
|
142
147
|
return [{ id: "combined", categories: ["gas", "grocery"], limit: 5000, period: "cardYear", after: 1 }];
|
|
143
148
|
case "chase_southwest_premier":
|
|
144
149
|
return [{ id: "combined", categories: ["grocery", "dining"], limit: 8000, period: "cardYear", after: 1 }];
|
|
150
|
+
case "chase_southwest_rapid_rewards_premier_business_credit_card":
|
|
151
|
+
return [{ id: "combined", categories: ["gas", "dining"], limit: 8000, period: "cardYear", after: 1 }];
|
|
152
|
+
case "truist_truist_enjoy_cash_credit_card":
|
|
153
|
+
return [{ id: "combined", categories: ["gas", "grocery"], limit: 1000, period: "month", after: 1 }];
|
|
145
154
|
case "chase_ink_business_preferred_credit_card":
|
|
146
155
|
return [{ id: "combined", categories: ["travel", "transit", "phone_internet"], limit: 150000, period: "cardYear", after: 1 }];
|
|
147
156
|
case "chase_ink_business_cash_credit_card":
|
package/dist/tools.js
CHANGED
|
@@ -78,7 +78,7 @@ export function buildServer(getCatalog) {
|
|
|
78
78
|
category: CategorySchema.optional().describe("Spend category when there is no specific store."),
|
|
79
79
|
valuation: z.enum(["cash", "points"]).default("cash").describe("'cash' counts each point at up to 1¢, and hotel/airline points at their lower value (default). 'points' values points per program at conservative travel values."),
|
|
80
80
|
on: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe("Date (YYYY-MM-DD, UTC) for rotating windows; defaults to today."),
|
|
81
|
-
chosen_categories: z.record(z.string(), z.array(CategorySchema)).optional().describe("For choose-your-category cards (Citi Custom Cash, BofA Customized, Venmo): card id → the categories the person set."),
|
|
81
|
+
chosen_categories: z.record(z.string(), z.array(CategorySchema)).optional().describe("For choose-your-category cards (Citi Custom Cash, BofA Customized, Venmo): card id → the categories the person set. TD Cash takes two picks: its 3% one under the card id, its 2% one under \"<card id>#2\"."),
|
|
82
82
|
},
|
|
83
83
|
}, async ({ wallet, merchant, category, valuation, on, chosen_categories }) => {
|
|
84
84
|
const catalog = await getCatalog();
|
package/dist/valuation.js
CHANGED
|
@@ -106,6 +106,10 @@ export function inferProgram(issuer, id, currency) {
|
|
|
106
106
|
// GM — the generic 2¢ fallback read its flat 3x as "6%" (mirrors Swift).
|
|
107
107
|
if (has("gm_rewards", "gm rewards"))
|
|
108
108
|
return "fixedValue";
|
|
109
|
+
// Emirates Skywards (Barclays, Nov 19 2026): no value in our sources, so the
|
|
110
|
+
// 1¢ floor, not the generic 1.5¢ miles guess (mirrors Swift).
|
|
111
|
+
if (has("emirates", "skywards"))
|
|
112
|
+
return "fixedValue";
|
|
109
113
|
// Bank of America Premium Rewards + PenFed points: a set ~1¢, no transfer
|
|
110
114
|
// partners (mirrors RewardValuation.infer, Sep 26 2026).
|
|
111
115
|
if (has("bank of america", "bank_of_america", "penfed") || s.startsWith("bofa"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rightcard-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"mcpName": "ai.rightcard/mcp",
|
|
5
5
|
"description": "RightCard MCP — the card-selection oracle for agents. Which of your credit cards to use at any store, from verified data. No bank login.",
|
|
6
6
|
"type": "module",
|