guanwei 1.2.6 → 1.3.0

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.md CHANGED
@@ -87,6 +87,33 @@ AI 层:多 LLM 适配(OpenAI 兼容 / Google 格式,DeepSeek / Gemini / Gr
87
87
  ③ 历史:GET /api/divine?username= → 档案管理页列表/详情/删除
88
88
  ```
89
89
 
90
+ ## 🤖 开放分发(v1.3.0 · 程序化调用排盘)
91
+
92
+ 排盘能力已封装为可被程序调用的服务(与 Web 端共用 `shared/core` 单一算法副本):
93
+
94
+ **MCP Server**(Claude Code / Cursor 等 agent 直接调用):
95
+
96
+ ```jsonc
97
+ // claude_desktop_config.json
98
+ { "mcpServers": { "guanwei": { "command": "npx", "args": ["tsx", "packages/guanwei-api/src/mcp.ts"], "cwd": "/你的/guanwei路径" } } }
99
+ ```
100
+
101
+ ```text
102
+ agent:用观微排一个 1993-01-23 寅时的八字
103
+ → 工具 guanwei_chart(art: "bazi", inputs: {...}) → 完整盘面
104
+ ```
105
+
106
+ **REST API**(`packages/guanwei-api`,免费无 Key):
107
+
108
+ ```bash
109
+ cd packages/guanwei-api && npm start # http://127.0.0.1:3020/v1
110
+ curl -X POST http://127.0.0.1:3020/v1/chart -H "Content-Type: application/json" \
111
+ -d '{"art":"liuren","inputs":{"datetime":"2026-08-29T12:00:00"}}'
112
+ curl http://127.0.0.1:3020/v1/arts # 九术能力清单 + 参数 schema
113
+ ```
114
+
115
+ > 排盘免费(纯计算零 token);协议风格与未来托管 API 一致(/v1、统一错误码),本地自部署与第三方集成同源。
116
+
90
117
  ## 🚀 快速开始(一行命令)
91
118
 
92
119
  ### ⚡ 方式一:npm 一行安装(推荐,国内几秒装完)