hs-code-classifier-mcp 1.0.9 → 1.0.10
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/CHANGELOG.md +60 -44
- package/LICENSE +21 -21
- package/package.json +1 -1
- package/server-card.json +5 -5
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -19
- package/dist/constants.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -563
- package/dist/index.js.map +0 -1
- package/dist/schemas/classify.d.ts.map +0 -1
- package/dist/schemas/classify.js +0 -24
- package/dist/schemas/classify.js.map +0 -1
- package/dist/schemas/validate.d.ts.map +0 -1
- package/dist/schemas/validate.js +0 -26
- package/dist/schemas/validate.js.map +0 -1
- package/dist/services/claude-client.d.ts.map +0 -1
- package/dist/services/claude-client.js +0 -98
- package/dist/services/claude-client.js.map +0 -1
- package/dist/services/hsping-client.d.ts.map +0 -1
- package/dist/services/hsping-client.js +0 -33
- package/dist/services/hsping-client.js.map +0 -1
- package/dist/tools/classify.d.ts.map +0 -1
- package/dist/tools/classify.js +0 -190
- package/dist/tools/classify.js.map +0 -1
- package/dist/tools/validate.d.ts.map +0 -1
- package/dist/tools/validate.js +0 -90
- package/dist/tools/validate.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,44 +1,60 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.0.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.10] - 2026-06-04
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `src/services/redis.ts` — Upstash Redis helpers (redisGet, redisSet, redisExpire, redisKeys, appendSessionLog)
|
|
7
|
+
- Free tier Redis persistence: `loadFreeTierFromRedis` / `saveFreeTierToRedis` with Math.max merge
|
|
8
|
+
- API key Redis persistence: `saveKeyToRedis` / `loadApiKeysFromRedis` with prefix `hs` — first durable persistence for paid keys
|
|
9
|
+
- `appendSessionLog` with 24h TTL; `/session-log` endpoint (requires x-stats-key)
|
|
10
|
+
- `free_tier_breakdown` per-IP object on `/stats` response for current month
|
|
11
|
+
- `getEffectiveLimit(ip)` — returns `FREE_TIER_MONTHLY_LIMIT + TRIAL_EXTENSION_CALLS` if IP has a trial extension
|
|
12
|
+
- `FREE_TIER_REDIS_KEY = 'hs:free_tier_usage'` constant
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- `hs_classify_product` and `hs_validate_code` descriptions rewritten for orchestral agent runtime selection
|
|
16
|
+
- `runClassify` accepts optional `effectiveLimit` parameter; notice string now includes effective limit
|
|
17
|
+
- `VERSION` bumped to `1.0.10`
|
|
18
|
+
|
|
19
|
+
## [1.0.9] - 2026-06-02
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- fix: IP extraction fixed for Cloudflare proxy headers — free tier gate now enforces correctly
|
|
23
|
+
|
|
24
|
+
## [1.0.5] - 2026-04-28
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- Upgrade URLs updated to prepaid bundle payment links (500 calls, never expire)
|
|
28
|
+
- Free tier limit messages updated: "Get 500 calls for $40 at [URL] -- calls never expire"
|
|
29
|
+
- PRO_UPGRADE_URL and ENTERPRISE_UPGRADE_URL constants added to constants.ts
|
|
30
|
+
|
|
31
|
+
## [1.0.4] - 2026-04-27
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- `token_count` field on all tool responses — lets orchestrator budget ledgers track token cost per call
|
|
35
|
+
- `/ready` endpoint — returns 200 when `ANTHROPIC_API_KEY` and `HSPING_API_KEY` are present, 503 otherwise
|
|
36
|
+
- Phase 4 enhanced error objects: `category`, `retryable`, `retry_after_ms`, `fallback_tool`, `trace_id` on all error paths in classify and validate tools
|
|
37
|
+
|
|
38
|
+
## [1.0.3] - 2026-04-26
|
|
39
|
+
|
|
40
|
+
### Improved
|
|
41
|
+
- hs_classify_product and hs_validate_code descriptions rewritten with TCO framework: irresistibility opening, $10k-$100k per-incident consequence, exact data source hostnames (api.hsping.com), prepaid bundle pricing last
|
|
42
|
+
- LEGAL NOTICE and full terms added to both tool descriptions
|
|
43
|
+
|
|
44
|
+
## [1.0.2] - 2026-04-26
|
|
45
|
+
### Changed
|
|
46
|
+
- VERSION constant unified to 1.0.2 across constants.ts, package.json, and server.json (were out of sync)
|
|
47
|
+
- Added `source_url` field to ClassifyOutput and ValidateOutput response objects (mandatory per Section 7.7)
|
|
48
|
+
|
|
49
|
+
## [1.0.0] - 2026-04-24
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- Initial release
|
|
53
|
+
- `hs_classify_product` tool: classify product descriptions to official HS codes using government tariff schedules (USITC, Singapore Customs, CBSA, Australia Border Force) via HSPing API with AI-assisted reasoning
|
|
54
|
+
- `hs_validate_code` tool: validate supplier-provided HS codes against official schedules with AI mismatch detection (paid tier)
|
|
55
|
+
- Free tier: 10 classify calls/month per IP, no API key required
|
|
56
|
+
- Pro tier: full result set with confidence ranking on classify + full validate access
|
|
57
|
+
- Both stdio and HTTP (Streamable) transports
|
|
58
|
+
- /health, /deps, /stats, /webhook/stripe endpoints
|
|
59
|
+
- Free tier quota tracking by IP with 80% warning and conversion hook
|
|
60
|
+
- Stripe webhook integration for paid key provisioning
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Kord Agencies Pte Ltd
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kord Agencies Pte Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
package/server-card.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"token_footprint_min": 45,
|
|
3
|
-
"token_footprint_max": 400,
|
|
4
|
-
"token_footprint_avg": 170
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"token_footprint_min": 45,
|
|
3
|
+
"token_footprint_max": 400,
|
|
4
|
+
"token_footprint_avg": 170
|
|
5
|
+
}
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,eAAe,mDAAmD,CAAC;AAChF,eAAO,MAAM,sBAAsB,mDAAmD,CAAC;AACvF,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,eAAe,uCAAuC,CAAC;AACpE,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,YAAY,kCAAkC,CAAC;AAE5D,eAAO,MAAM,gBAAgB,QAMc,CAAC;AAE5C,wBAAgB,MAAM,IAAI,MAAM,CAE/B"}
|
package/dist/constants.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const VERSION = '1.0.8';
|
|
2
|
-
export const PRO_UPGRADE_URL = 'https://buy.stripe.com/fZubJ06o58Dj3BG8Nyebu0v';
|
|
3
|
-
export const ENTERPRISE_UPGRADE_URL = 'https://buy.stripe.com/6oU3cu5k12eVegk3teebu0w';
|
|
4
|
-
export const CHARACTER_LIMIT = 25000;
|
|
5
|
-
export const HSPING_BASE_URL = 'https://api.hsping.com/api/v1/find';
|
|
6
|
-
export const FREE_TIER_MONTHLY_LIMIT = 10;
|
|
7
|
-
export const FREE_TIER_WARNING_THRESHOLD = 8;
|
|
8
|
-
export const TRIAL_EXTENSION_CALLS = 10;
|
|
9
|
-
export const PERSIST_FILE = '/tmp/hs_classifier_stats.json';
|
|
10
|
-
export const LEGAL_DISCLAIMER = 'Results sourced directly from official government tariff schedules via HSPing API (api.hsping.com). ' +
|
|
11
|
-
'HS code classification is subject to customs authority interpretation and may vary by jurisdiction. ' +
|
|
12
|
-
'Results are for informational purposes only and do not constitute legal, compliance, or customs advice. ' +
|
|
13
|
-
'We do not log or store your query content. ' +
|
|
14
|
-
'Provider maximum liability is limited to subscription fees paid in the preceding 3 months. ' +
|
|
15
|
-
'Full terms: kordagencies.com/terms.html';
|
|
16
|
-
export function nowISO() {
|
|
17
|
-
return new Date().toISOString();
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG,gDAAgD,CAAC;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,gDAAgD,CAAC;AACvF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,oCAAoC,CAAC;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAC1C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAC3B,sGAAsG;IACtG,sGAAsG;IACtG,0GAA0G;IAC1G,6CAA6C;IAC7C,6FAA6F;IAC7F,yCAAyC,CAAC;AAE5C,MAAM,UAAU,MAAM;IACpB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|