rightcard-mcp 0.1.10 → 0.1.11
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/matching.js +12 -1
- package/package.json +1 -1
package/dist/matching.js
CHANGED
|
@@ -14,6 +14,14 @@ const GENERIC_PLACE = new Set([
|
|
|
14
14
|
"center", "centre", "outlet", "express", "shopping", "inc", "llc", "farmers",
|
|
15
15
|
]);
|
|
16
16
|
const COBRAND_GENERIC = new Set(["incorporated", "corporation", "company"]);
|
|
17
|
+
/** Words that name a kind of place, not a brand: sharing only one of these is
|
|
18
|
+
* a different business (Hotels.com is not Hilton Hotels & Resorts, Express is
|
|
19
|
+
* not Holiday Inn Express). Mirrors MerchantYieldEngine.coBrandPlaceWords. */
|
|
20
|
+
const COBRAND_PLACE_WORDS = new Set([
|
|
21
|
+
"hotel", "hotels", "resort", "resorts", "suites", "express", "restaurant",
|
|
22
|
+
"restaurants", "collection", "garden", "gardens", "plaza", "club",
|
|
23
|
+
"vacations", "airlines", "airline", "airways", "market", "store", "stores",
|
|
24
|
+
]);
|
|
17
25
|
const TLD_RE = /\.(com|net|org|co|io|tv|shop|store|us)\b/g;
|
|
18
26
|
const isAlnum = (ch) => /[\p{L}\p{N}]/u.test(ch);
|
|
19
27
|
const cache = new Map();
|
|
@@ -104,10 +112,13 @@ export function merchantMatchesCoBrandBenefit(benefit, query) {
|
|
|
104
112
|
const distinctive = (s) => new Set(s.toLowerCase().replace(/\.(com|net|org|co|io)\b/g, " ")
|
|
105
113
|
.split(/[^\p{L}\p{N}]+/u)
|
|
106
114
|
.filter((t) => t.length >= 4 && !COBRAND_GENERIC.has(t)));
|
|
115
|
+
const plain = (s) => s.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter((t) => t.length > 0).join(" ");
|
|
116
|
+
if (plain(benefit) !== "" && plain(benefit) === plain(query))
|
|
117
|
+
return true;
|
|
107
118
|
const b = distinctive(benefit), q = distinctive(query);
|
|
108
119
|
if (b.size === 0 || q.size === 0)
|
|
109
120
|
return false;
|
|
110
|
-
if (![...b].some((x) => q.has(x)))
|
|
121
|
+
if (![...b].some((x) => q.has(x) && !COBRAND_PLACE_WORDS.has(x)))
|
|
111
122
|
return false;
|
|
112
123
|
return isSubset(q, b);
|
|
113
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rightcard-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
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",
|