@radsoft/markbase-mcp 2026.8.3 → 2026.10.1
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/client.js +22 -16
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -56,24 +56,30 @@ export async function request(path, init) {
|
|
|
56
56
|
export function padClass(v) {
|
|
57
57
|
return /^\d+$/.test(v) ? v.padStart(3, "0") : v;
|
|
58
58
|
}
|
|
59
|
+
// uspto status codes don't fall into tidy ranges — 630 is a brand new
|
|
60
|
+
// application and 602 an abandoned one. groups follow uspto.report's live/dead
|
|
61
|
+
// table, plus 610 (terminated after sanctions) and 781-783 (newer cancellations)
|
|
62
|
+
// checked against tsdr. anything not listed is unknown rather than a guess.
|
|
63
|
+
const STATUS_GROUPS = {
|
|
64
|
+
pending: "410 413 616 620 630 631 638 640-661 663-668 672 680-682 686 688-690 692-694 " +
|
|
65
|
+
"718-722 724 725 730-734 740 744-746 748 752 753 756 757 760 762-766 771-775 " +
|
|
66
|
+
"777 779 794 801-804 806-825 969 973",
|
|
67
|
+
registered: "624 625 700-708 717 739 778 780 790 800",
|
|
68
|
+
dead: "402 411 412 416 600-610 612 614 618 632 901",
|
|
69
|
+
cancelled: "400 401 403-406 414 415 417 626 709-715 781-783",
|
|
70
|
+
expired: "900",
|
|
71
|
+
};
|
|
72
|
+
const STATUS_BY_CODE = new Map();
|
|
73
|
+
for (const [status, list] of Object.entries(STATUS_GROUPS)) {
|
|
74
|
+
for (const part of list.split(" ")) {
|
|
75
|
+
const [from, to = from] = part.split("-").map(Number);
|
|
76
|
+
for (let n = from; n <= to; n++)
|
|
77
|
+
STATUS_BY_CODE.set(n, status);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
59
80
|
// numeric USPTO status codes are meaningless to a model without this
|
|
60
81
|
export function statusLabel(code) {
|
|
61
|
-
|
|
62
|
-
return "unknown";
|
|
63
|
-
const n = parseInt(code, 10);
|
|
64
|
-
if (Number.isNaN(n))
|
|
65
|
-
return "unknown";
|
|
66
|
-
if (n >= 600 && n < 700)
|
|
67
|
-
return "dead";
|
|
68
|
-
if (n >= 710 && n < 720)
|
|
69
|
-
return "cancelled";
|
|
70
|
-
if (n >= 900)
|
|
71
|
-
return "expired";
|
|
72
|
-
if (n >= 800 || n === 700 || (n >= 730 && n < 740))
|
|
73
|
-
return "registered";
|
|
74
|
-
if (n < 600)
|
|
75
|
-
return "pending";
|
|
76
|
-
return "registered";
|
|
82
|
+
return STATUS_BY_CODE.get(parseInt(code ?? "", 10)) ?? "unknown";
|
|
77
83
|
}
|
|
78
84
|
export function isoDate(d) {
|
|
79
85
|
if (!d || d.length !== 8)
|
package/package.json
CHANGED