mingpan 0.1.5 → 0.1.6
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/README.en.md +3 -5
- package/README.ja.md +3 -5
- package/README.md +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/dist/tools/baziTools.d.ts +1 -1
- package/dist/tools/baziTools.d.ts.map +1 -1
- package/dist/tools/calendarTools.d.ts +1 -1
- package/dist/tools/calendarTools.d.ts.map +1 -1
- package/dist/tools/divinationTools.d.ts +1 -1
- package/dist/tools/divinationTools.d.ts.map +1 -1
- package/dist/tools/qimenTools.d.ts +1 -1
- package/dist/tools/qimenTools.d.ts.map +1 -1
- package/dist/tools/schemas.d.ts +1 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/ziweiTools.d.ts +1 -1
- package/dist/tools/ziweiTools.d.ts.map +1 -1
- package/dist/worker.d.ts +9 -13
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +15 -36
- package/dist/worker.js.map +1 -1
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -17,7 +17,7 @@ An [MCP](https://modelcontextprotocol.io) server that computes traditional Chine
|
|
|
17
17
|
LLMs are unreliable at the computational half of Chinese divination: deriving ganzhi pillars from solar terms, converting between lunar and solar calendars, adjusting for timezones and true solar time. They hallucinate these values. Mingpan is the deterministic other half:
|
|
18
18
|
|
|
19
19
|
- **Deterministic-only output policy.** Every value a tool returns — four pillars, hidden stems, ten gods, na yin, life palace, palaces & stars, mutagens, hexagram lines — is a verifiable fact from classical lookup tables. Fortune scores, auspiciousness labels, and interpretive judgments are deliberately excluded: those belong to your AI.
|
|
20
|
-
- **Correctness discipline.**
|
|
20
|
+
- **Correctness discipline.** 288 tests including minute-level LiChun (Start of Spring) boundary cases, golden cases verified against historical records and classical texts, and cross-validation against reference implementations (lunar-javascript, iztro, kinqimen). All caliber decisions are documented in-repo.
|
|
21
21
|
- **Timezone & true-solar-time aware.** IANA timezone input with historical DST handling (including China's 1986–1991 DST), longitude-based true solar time correction applied consistently to all four pillars. CI enforces cross-timezone reproducibility.
|
|
22
22
|
|
|
23
23
|
## Tools (16)
|
|
@@ -30,6 +30,7 @@ LLMs are unreliable at the computational half of Chinese divination: deriving ga
|
|
|
30
30
|
| MeiHua YiShu | `meihua_basic` | Time- or number-cast hexagrams, mutual/transformed, ti-yong relation |
|
|
31
31
|
| Da Liu Ren | `daliuren_basic` | Just supply a Gregorian time — seasonal general, pillars, four lessons, three transmissions, twelve generals |
|
|
32
32
|
| Qi Men Dun Jia | `qimen_basic`, `qimen_yongshen` | Rotating & flying styles, four pan types, chaibu/maoshan; yong-shen analysis with deterministic facts only |
|
|
33
|
+
| Calendar primitives | `jieqi_query`, `calendar_convert` | 24 solar terms to the second (AI's most-hallucinated value) · Solar↔lunar conversion with leap months |
|
|
33
34
|
|
|
34
35
|
## Example output (`bazi_basic`)
|
|
35
36
|
|
|
@@ -57,8 +58,5 @@ Year range 1900–2100 · Beijing time (UTC+8) as internal canonical representat
|
|
|
57
58
|
## Documentation
|
|
58
59
|
|
|
59
60
|
- [README(简体中文 · authoritative)](README.md) — full parameter reference, calendar conventions, version history
|
|
60
|
-
- [`docs/qimen-correctness-notes.md`](docs/qimen-correctness-notes.md) — Qi Men caliber adjudications
|
|
61
|
-
- [`docs/product-roadmap.md`](docs/product-roadmap.md) — product principles & roadmap
|
|
62
|
-
- [`docs/release-notes-0.1.4.md`](docs/release-notes-0.1.4.md) — latest release notes
|
|
63
61
|
|
|
64
|
-
Apache-2.0 · This is a condensed edition; the Chinese README is the single source of truth. Last synced: **v0.1.
|
|
62
|
+
Apache-2.0 · This is a condensed edition; the Chinese README is the single source of truth. Last synced: **v0.1.5**
|
package/README.ja.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
LLMは干支・節気・暦の換算を確実には行えません——推論で誤った柱を「幻覚」として出力してしまいます。Mingpanは計算側だけを担う確定性エンジンです:
|
|
18
18
|
|
|
19
19
|
- **確定的な値のみ出力。** 四柱・納音・蔵干・十神・命宮・胎元・十二宮星曜・四化・卦構造など、出力はすべて検証可能な事実(古典の参照表に基づく)。五行スコアや吉凶ラベル、解釈的判断は意図的に含めません——それはAIの役割です。
|
|
20
|
-
- **正確性の規律。**
|
|
20
|
+
- **正確性の規律。** 288テスト。立春境界の分レベル検証、史料・古典文献によるゴールデンケース、参照実装(lunar-javascript / iztro / kinqimen)との相互検証。口径(計算方式)の裁定はすべてリポジトリ内に文書化されています。
|
|
21
21
|
- **タイムゾーン・真太陽時対応。** IANAタイムゾーン入力(1986–91年の中国夏時間を含む歴史的DSTを処理)、経度による真太陽時補正は四柱すべてに一貫適用。CIでタイムゾーン横断の再現性を保証。
|
|
22
22
|
|
|
23
23
|
## ツール(16)
|
|
@@ -30,6 +30,7 @@ LLMは干支・節気・暦の換算を確実には行えません——推論
|
|
|
30
30
|
| 梅花易数 | `meihua_basic` | 時間・数字起卦、本卦・変卦・互卦、体用の五行関係 |
|
|
31
31
|
| 大六壬 | `daliuren_basic` | 西暦日時を入力するだけで排盤(月将・四課・三伝・十二天将) |
|
|
32
32
|
| 奇門遁甲 | `qimen_basic`, `qimen_yongshen` | 転盤・飛盤、時盤・日盤・月盤・年盤、拆補法・茅山法 |
|
|
33
|
+
| 歴法プリミティブ | `jieqi_query`, `calendar_convert` | 二十四節気の秒級時刻(AIが最も幻覚しやすい値)· 太陽暦↔太陰暦変換(閏月対応) |
|
|
33
34
|
|
|
34
35
|
## 出力例(`bazi_basic`)
|
|
35
36
|
|
|
@@ -57,8 +58,5 @@ LLMは干支・節気・暦の換算を確実には行えません——推論
|
|
|
57
58
|
## ドキュメント
|
|
58
59
|
|
|
59
60
|
- [README(简体中文・正本)](README.md) — パラメータ完全リファレンス
|
|
60
|
-
- [`docs/qimen-correctness-notes.md`](docs/qimen-correctness-notes.md) — 奇門遁甲の口径裁定記録
|
|
61
|
-
- [`docs/product-roadmap.md`](docs/product-roadmap.md) — 製品原則とロードマップ
|
|
62
|
-
- [`docs/release-notes-0.1.4.md`](docs/release-notes-0.1.4.md) — 最新リリースノート
|
|
63
61
|
|
|
64
|
-
Apache-2.0 · 本ページは簡潔版です。詳細は中国語READMEが正本です。最終同期:**v0.1.
|
|
62
|
+
Apache-2.0 · 本ページは簡潔版です。詳細は中国語READMEが正本です。最終同期:**v0.1.5**
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**简体中文(主文档)** | [English](README.en.md) | [日本語](README.ja.md)
|
|
4
4
|
|
|
5
|
-
[](https://github.com/ChesterRa/mingpan)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
8
|
**命盘(Mingpan)** 是一个中华传统术数 MCP 服务,为 Claude 等 AI 应用提供命理排盘与占卜起卦的计算能力。
|
|
@@ -249,10 +249,10 @@ npm run dev # 监听变化
|
|
|
249
249
|
|
|
250
250
|
| 版本 | 说明 |
|
|
251
251
|
| ---- | ---- |
|
|
252
|
-
| 0.1.
|
|
253
|
-
| 0.1.
|
|
254
|
-
| 0.1.
|
|
255
|
-
| 0.1.
|
|
252
|
+
| 0.1.6 | **MCP SDK v2 迁移**(2026-07-28 无状态协议,原生支持 Cloudflare Workers,向后兼容旧客户端);远程 HTTP 入口从 50 行简化为 20 行(createMcpHandler);Workers 打包 gzip 638→606KB;测试 288 |
|
|
253
|
+
| 0.1.5 | **口径裁决**:子初换日(23:00 起日柱时柱同属次日,全五系统统一);起运权威化(lunar 节气表 + 交运日历定位);奇门年盘按《遁甲演义》典籍修正;真太阳时四柱全量生效;**新能力**:历法原语层(jieqi_query + calendar_convert);测试 218→288 |
|
|
254
|
+
| 0.1.4 | **正确性修复**:八字立春换年、奇门四类口径修正、stdio 日志修复;**输出定位确立**:只输出确定性排盘量;大六壬时间起课、多时区;测试 117→218 |
|
|
255
|
+
| 0.1.3 | 奇门用神分析与择日 |
|
|
256
256
|
| 0.1.2 | 六爻、梅花易数、大六壬 |
|
|
257
257
|
| 0.1.0 | 首个发布:八字、紫微 |
|
|
258
258
|
|
package/dist/index.js
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
* 入口層統一完成農曆轉換與時區換算(見 utils/timeNormalization.ts)。
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
const
|
|
19
|
+
const stdio_1 = require("@modelcontextprotocol/server/stdio");
|
|
20
20
|
const logger_1 = require("./shared/logger");
|
|
21
21
|
const server_1 = require("./server");
|
|
22
22
|
const logger = new logger_1.Logger("mingpan");
|
|
23
23
|
async function main() {
|
|
24
24
|
const server = (0, server_1.createMingpanServer)();
|
|
25
|
-
const transport = new
|
|
25
|
+
const transport = new stdio_1.StdioServerTransport();
|
|
26
26
|
await server.connect(transport);
|
|
27
27
|
logger.info(`Mingpan MCP server started (v${server_1.SERVER_VERSION})`);
|
|
28
28
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;GAcG;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;;GAcG;;AAEH,8DAA0E;AAE1E,4CAAyC;AACzC,qCAA+D;AAE/D,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAC;AAErC,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAA,4BAAmB,GAAE,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,4BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,CAAC,IAAI,CAAC,gCAAgC,uBAAc,GAAG,CAAC,CAAC;AACjE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* 構建並註冊全部術數工具(八字/紫微/六爻/梅花/大六壬/奇門)。
|
|
5
5
|
* 入口(index.ts)連接 stdio 傳輸;測試可連接 InMemoryTransport。
|
|
6
6
|
*/
|
|
7
|
-
import { McpServer } from "@modelcontextprotocol/
|
|
7
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
8
8
|
export declare const SERVER_NAME = "mingpan";
|
|
9
|
-
export declare const SERVER_VERSION = "0.1.
|
|
9
|
+
export declare const SERVER_VERSION = "0.1.6";
|
|
10
10
|
export declare function createMingpanServer(): McpServer;
|
|
11
11
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOzD,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,wBAAgB,mBAAmB,IAAI,SAAS,CAoB/C"}
|
package/dist/server.js
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.SERVER_VERSION = exports.SERVER_NAME = void 0;
|
|
10
10
|
exports.createMingpanServer = createMingpanServer;
|
|
11
|
-
const
|
|
11
|
+
const server_1 = require("@modelcontextprotocol/server");
|
|
12
12
|
const baziTools_1 = require("./tools/baziTools");
|
|
13
13
|
const ziweiTools_1 = require("./tools/ziweiTools");
|
|
14
14
|
const divinationTools_1 = require("./tools/divinationTools");
|
|
15
15
|
const qimenTools_1 = require("./tools/qimenTools");
|
|
16
16
|
const calendarTools_1 = require("./tools/calendarTools");
|
|
17
17
|
exports.SERVER_NAME = "mingpan";
|
|
18
|
-
exports.SERVER_VERSION = "0.1.
|
|
18
|
+
exports.SERVER_VERSION = "0.1.6";
|
|
19
19
|
function createMingpanServer() {
|
|
20
|
-
const server = new
|
|
20
|
+
const server = new server_1.McpServer({
|
|
21
21
|
name: exports.SERVER_NAME,
|
|
22
22
|
version: exports.SERVER_VERSION,
|
|
23
23
|
}, {
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAYH,kDAoBC;AA9BD,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAYH,kDAoBC;AA9BD,yDAAyD;AACzD,iDAAsD;AACtD,mDAAwD;AACxD,6DAAkE;AAClE,mDAAwD;AACxD,yDAA8D;AAEjD,QAAA,WAAW,GAAG,SAAS,CAAC;AACxB,QAAA,cAAc,GAAG,OAAO,CAAC;AAEtC,SAAgB,mBAAmB;IACjC,MAAM,MAAM,GAAG,IAAI,kBAAS,CAC1B;QACE,IAAI,EAAE,mBAAW;QACjB,OAAO,EAAE,sBAAc;KACxB,EACD;QACE,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE;SACV;KACF,CACF,CAAC;IAEF,IAAA,6BAAiB,EAAC,MAAM,CAAC,CAAC;IAC1B,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;IAC3B,IAAA,yCAAuB,EAAC,MAAM,CAAC,CAAC;IAChC,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;IAC3B,IAAA,qCAAqB,EAAC,MAAM,CAAC,CAAC;IAE9B,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* - bazi_liuyue 流月列表(節氣月)
|
|
9
9
|
* - bazi_liuri 流日列表
|
|
10
10
|
*/
|
|
11
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
11
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
12
12
|
export declare function registerBaziTools(server: McpServer): void;
|
|
13
13
|
//# sourceMappingURL=baziTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baziTools.d.ts","sourceRoot":"","sources":["../../src/tools/baziTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"baziTools.d.ts","sourceRoot":"","sources":["../../src/tools/baziTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAmC9D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsXzD"}
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* 农历闰月分配是历表查询(AI 经常猜错)。
|
|
8
8
|
* 两者完全满足输出准入三条件(确定/权威/AI 不易获知)。
|
|
9
9
|
*/
|
|
10
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
10
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
11
11
|
export declare function registerCalendarTools(server: McpServer): void;
|
|
12
12
|
//# sourceMappingURL=calendarTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendarTools.d.ts","sourceRoot":"","sources":["../../src/tools/calendarTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"calendarTools.d.ts","sourceRoot":"","sources":["../../src/tools/calendarTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAM9D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6G7D"}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* 設計原則:占卜工具的時間參數為「起卦/起課時間」,
|
|
5
5
|
* 節氣、干支等曆法量一律由 MCP 自動推得(LLM 手推干支極易出錯)。
|
|
6
6
|
*/
|
|
7
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
7
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
8
8
|
export declare function registerDivinationTools(server: McpServer): void;
|
|
9
9
|
//# sourceMappingURL=divinationTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divinationTools.d.ts","sourceRoot":"","sources":["../../src/tools/divinationTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"divinationTools.d.ts","sourceRoot":"","sources":["../../src/tools/divinationTools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAwB9D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuM/D"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* - qimen_basic 基礎排盤(九宮布局、三奇六儀、八門九星八神、格局檢測)
|
|
6
6
|
* - qimen_yongshen 用神分析(按事類,僅確定性信息)
|
|
7
7
|
*/
|
|
8
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
8
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
9
9
|
export declare function registerQimenTools(server: McpServer): void;
|
|
10
10
|
//# sourceMappingURL=qimenTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qimenTools.d.ts","sourceRoot":"","sources":["../../src/tools/qimenTools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"qimenTools.d.ts","sourceRoot":"","sources":["../../src/tools/qimenTools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAwB9D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmH1D"}
|
package/dist/tools/schemas.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 服務層只消費北京時間規範分量
|
|
12
12
|
*/
|
|
13
13
|
import { z } from 'zod';
|
|
14
|
-
import type { CallToolResult } from '@modelcontextprotocol/
|
|
14
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
15
15
|
export declare const yearField: z.ZodNumber;
|
|
16
16
|
export declare const monthField: z.ZodNumber;
|
|
17
17
|
export declare const dayField: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/tools/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOnE,eAAO,MAAM,SAAS,aAAiE,CAAC;AACxF,eAAO,MAAM,UAAU,aAAqD,CAAC;AAC7E,eAAO,MAAM,QAAQ,aAAqD,CAAC;AAC3E,eAAO,MAAM,SAAS,aAAqD,CAAC;AAC5E,eAAO,MAAM,WAAW,0CAAgF,CAAC;AACzG,eAAO,MAAM,WAAW;;;EAAoD,CAAC;AAC7E,eAAO,MAAM,cAAc,4BAAwE,CAAC;AACpG,eAAO,MAAM,SAAS,4BAA6C,CAAC;AAEpE,eAAO,MAAM,YAAY,2CAAmE,CAAC;AAE7F,eAAO,MAAM,aAAa,4BAEzB,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,eAAe;;;;;;;;CAQ3B,CAAC;AAEF,4BAA4B;AAC5B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CAK/B,CAAC;AAMF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC;IACd,gBAAgB;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,qBAAqB,EAAE,KAAK,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAyBpG;AAWD;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GACjC,OAAO,CAAC,cAAc,CAAC,CAYzB;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAGpF;AAUD,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAMhF;AAED,2BAA2B;AAC3B,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAcxF;AAED,oCAAoC;AACpC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAO/D;AAED,+BAA+B;AAC/B,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQnG"}
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* - ziwei_liuyue 流月列表(農曆月)
|
|
10
10
|
* - ziwei_liuri 流日列表(農曆日)
|
|
11
11
|
*/
|
|
12
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
12
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
13
13
|
export declare function registerZiweiTools(server: McpServer): void;
|
|
14
14
|
//# sourceMappingURL=ziweiTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ziweiTools.d.ts","sourceRoot":"","sources":["../../src/tools/ziweiTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ziweiTools.d.ts","sourceRoot":"","sources":["../../src/tools/ziweiTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAyC9D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsgB1D"}
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cloudflare Workers
|
|
2
|
+
* Cloudflare Workers 入口(MCP v2 · 2026-07-28 无状态协议)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* v2 SDK 的 createMcpHandler 是官方推荐的 HTTP 入口:
|
|
5
|
+
* - 原生支持 2026-07-28 无状态协议(无需 initialize 握手 / session)
|
|
6
|
+
* - 自动向后兼容 2025 Streamable HTTP 旧客户端(legacyStatelessFallback)
|
|
7
|
+
* - 无需手动管理 transport——handler 即 Request → Response
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* - 无状态模式(sessionIdGenerator: undefined):每个请求独立处理,
|
|
10
|
-
* 正适合本项目无会话的纯计算特性,且无需 Durable Objects。
|
|
11
|
-
* - 引擎与 stdio 形态共用 createMingpanServer(),输出逐字节一致。
|
|
12
|
-
* - 代码已去本地时区化(Date.UTC 载体约定),Workers 恒 UTC 运行时下
|
|
13
|
-
* 排盘结果与本地形态一致(三时区 CI 矩阵看守)。
|
|
9
|
+
* 部署:`npm run deploy:worker`
|
|
14
10
|
*/
|
|
15
11
|
export interface Env {
|
|
16
12
|
}
|
|
17
|
-
/** 可测试的请求处理函数(Node 测试与 Workers 共用) */
|
|
18
|
-
export declare function handleMcpRequest(request: Request, _env?: Env): Promise<Response>;
|
|
19
13
|
declare const _default: {
|
|
20
|
-
fetch(request: Request,
|
|
14
|
+
fetch(request: Request, _env: Env): Promise<Response>;
|
|
21
15
|
};
|
|
22
16
|
export default _default;
|
|
17
|
+
/** 可测试的请求处理函数(Node 测试与 Workers 共用) */
|
|
18
|
+
export declare function handleMcpRequest(request: Request, _env?: Env): Promise<Response>;
|
|
23
19
|
//# sourceMappingURL=worker.d.ts.map
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,WAAW,GAAG;CAAG;;mBAKN,OAAO,QAAQ,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;;AADvD,wBAIE;AAEF,sCAAsC;AACtC,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAEtF"}
|
package/dist/worker.js
CHANGED
|
@@ -1,47 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Cloudflare Workers
|
|
3
|
+
* Cloudflare Workers 入口(MCP v2 · 2026-07-28 无状态协议)
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* v2 SDK 的 createMcpHandler 是官方推荐的 HTTP 入口:
|
|
6
|
+
* - 原生支持 2026-07-28 无状态协议(无需 initialize 握手 / session)
|
|
7
|
+
* - 自动向后兼容 2025 Streamable HTTP 旧客户端(legacyStatelessFallback)
|
|
8
|
+
* - 无需手动管理 transport——handler 即 Request → Response
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
* - 无状态模式(sessionIdGenerator: undefined):每个请求独立处理,
|
|
11
|
-
* 正适合本项目无会话的纯计算特性,且无需 Durable Objects。
|
|
12
|
-
* - 引擎与 stdio 形态共用 createMingpanServer(),输出逐字节一致。
|
|
13
|
-
* - 代码已去本地时区化(Date.UTC 载体约定),Workers 恒 UTC 运行时下
|
|
14
|
-
* 排盘结果与本地形态一致(三时区 CI 矩阵看守)。
|
|
10
|
+
* 部署:`npm run deploy:worker`
|
|
15
11
|
*/
|
|
16
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
13
|
exports.handleMcpRequest = handleMcpRequest;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
async function handleMcpRequest(request, _env) {
|
|
22
|
-
const url = new URL(request.url);
|
|
23
|
-
if (url.pathname !== "/mcp") {
|
|
24
|
-
return new Response("Not Found", { status: 404 });
|
|
25
|
-
}
|
|
26
|
-
if (request.method === "GET" || request.method === "DELETE") {
|
|
27
|
-
// 无状态模式不支持 SSE 长连接与会话删除
|
|
28
|
-
return new Response("Method Not Allowed", { status: 405 });
|
|
29
|
-
}
|
|
30
|
-
if (request.method !== "POST") {
|
|
31
|
-
return new Response("Method Not Allowed", { status: 405, headers: { Allow: "POST" } });
|
|
32
|
-
}
|
|
33
|
-
// 无状态:每请求一组 server+transport
|
|
34
|
-
const server = (0, server_1.createMingpanServer)();
|
|
35
|
-
const transport = new webStandardStreamableHttp_js_1.WebStandardStreamableHTTPServerTransport({
|
|
36
|
-
sessionIdGenerator: undefined,
|
|
37
|
-
});
|
|
38
|
-
await server.connect(transport);
|
|
39
|
-
// Web 标准 transport:Request → Response,Workers/Node 通用
|
|
40
|
-
return transport.handleRequest(request);
|
|
41
|
-
}
|
|
14
|
+
const server_1 = require("@modelcontextprotocol/server");
|
|
15
|
+
const server_2 = require("./server");
|
|
16
|
+
const handler = (0, server_1.createMcpHandler)(() => (0, server_2.createMingpanServer)());
|
|
42
17
|
exports.default = {
|
|
43
|
-
fetch(request,
|
|
44
|
-
return
|
|
18
|
+
fetch(request, _env) {
|
|
19
|
+
return handler.fetch(request);
|
|
45
20
|
},
|
|
46
21
|
};
|
|
22
|
+
/** 可测试的请求处理函数(Node 测试与 Workers 共用) */
|
|
23
|
+
async function handleMcpRequest(request, _env) {
|
|
24
|
+
return handler.fetch(request);
|
|
25
|
+
}
|
|
47
26
|
//# sourceMappingURL=worker.js.map
|
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAgBH,4CAEC;AAhBD,yDAAgE;AAChE,qCAA+C;AAI/C,MAAM,OAAO,GAAG,IAAA,yBAAgB,EAAC,GAAG,EAAE,CAAC,IAAA,4BAAmB,GAAE,CAAC,CAAC;AAE9D,kBAAe;IACb,KAAK,CAAC,OAAgB,EAAE,IAAS;QAC/B,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACF,CAAC;AAEF,sCAAsC;AAC/B,KAAK,UAAU,gBAAgB,CAAC,OAAgB,EAAE,IAAU;IACjE,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mingpan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "MCP service for Chinese metaphysics chart calculations: BaZi, ZiWei Dou Shu, LiuYao, MeiHua YiShu, DaLiuRen, and QiMen DunJia",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"author": "ChesterRa",
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@modelcontextprotocol/
|
|
51
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
52
52
|
"iztro": "^2.6.0",
|
|
53
53
|
"lunar-javascript": "^1.7.7",
|
|
54
54
|
"zod": "^4.4.3"
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^20.11.17",
|
|
58
58
|
"typescript": "^5.3.3",
|
|
59
|
-
"vitest": "^1.6.1"
|
|
59
|
+
"vitest": "^1.6.1",
|
|
60
|
+
"@modelcontextprotocol/client": "^2.0.0"
|
|
60
61
|
},
|
|
61
62
|
"engines": {
|
|
62
63
|
"node": ">=20.0.0"
|