dsh-metaphysics 0.18.4 → 0.20.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/CHANGELOG.md +22 -0
- package/README.md +16 -13
- package/client.js +754 -67
- package/engine/almanac.js +137 -3
- package/engine/bazi.js +2 -1
- package/engine/convert.js +137 -0
- package/engine/geju.js +67 -46
- package/engine/geo.js +1 -1
- package/engine/index.js +52 -5
- package/engine/interpret.js +1365 -1356
- package/engine/tiaohou.js +228 -0
- package/engine/zeri.js +29 -2
- package/index.js +15 -5
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// 调候:寒暖燥湿判定 + 用神仲裁
|
|
2
|
+
//
|
|
3
|
+
// 定位:八字取用,传统上先看「气候」——冬生水冷木寒,先要火来解冻;
|
|
4
|
+
// 夏生火炎土燥,先要水来润泽。扶抑法管的是「强弱」,调候管的是「冷暖」,
|
|
5
|
+
// 两者不是一回事,冲突时要显式裁决,而不是悄悄按扶抑打分。
|
|
6
|
+
//
|
|
7
|
+
// 本模块只做三件事:
|
|
8
|
+
// 1) 从月令 + 五行分布 + 地支燥湿,判出寒 / 热 / 燥 / 湿 / 平和,并给出依据;
|
|
9
|
+
// 2) 给出调候所需之物(丙火 / 壬水),以及与之相反的忌物;
|
|
10
|
+
// 3) 生成一段「说人话」的气候叙述,供解释层与面板直接使用。
|
|
11
|
+
//
|
|
12
|
+
// 口径:空调候取用以月令寒暖 + 全局水火燥湿为主,属通行做法;
|
|
13
|
+
// 穷通宝鉴 120 条全表未逐条录入,日主五行的细化另由 need 的调候星表达。
|
|
14
|
+
|
|
15
|
+
const STEM_ELEMENT = {
|
|
16
|
+
甲: '木', 乙: '木', 丙: '火', 丁: '火', 戊: '土',
|
|
17
|
+
己: '土', 庚: '金', 辛: '金', 壬: '水', 癸: '水',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** 月令的寒暖基准:-2 最寒(子月),+2 最热(午月) */
|
|
21
|
+
const SEASON_TEMP = {
|
|
22
|
+
亥: -1.8, 子: -2, 丑: -1.5,
|
|
23
|
+
寅: -0.4, 卯: 0.2, 辰: 0.5,
|
|
24
|
+
巳: 1.3, 午: 2, 未: 1.5,
|
|
25
|
+
申: 0.6, 酉: 0.2, 戌: -0.2,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const SEASON_NAME = {
|
|
29
|
+
亥: '初冬', 子: '仲冬', 丑: '季冬',
|
|
30
|
+
寅: '初春', 卯: '仲春', 辰: '季春',
|
|
31
|
+
巳: '初夏', 午: '仲夏', 未: '季夏',
|
|
32
|
+
申: '初秋', 酉: '仲秋', 戌: '季秋',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** 湿土 / 燥土:丑辰为湿,未戌为燥;亥子水气重,巳午火气重 */
|
|
36
|
+
const WET_BRANCH = { 丑: 1, 辰: 1, 子: 0.6, 亥: 0.5 };
|
|
37
|
+
const DRY_BRANCH = { 未: 1, 戌: 1, 午: 0.4, 巳: 0.4 };
|
|
38
|
+
|
|
39
|
+
/** 各气候的调候所需 */
|
|
40
|
+
const NEED = {
|
|
41
|
+
寒湿: { element: '火', stem: '丙', avoid: '水', why: '冻土要太阳来解,水再多只会更冷' },
|
|
42
|
+
寒燥: { element: '火', stem: '丙', avoid: '水', why: '天寒地干,先要一点阳和之气' },
|
|
43
|
+
寒: { element: '火', stem: '丙', avoid: '水', why: '冬令气寒,非火不暖' },
|
|
44
|
+
温热: { element: '水', stem: '壬', avoid: '火', why: '火气初旺,得水润泽才好用' },
|
|
45
|
+
燥热: { element: '水', stem: '壬', avoid: '火', why: '火炎土燥,非水不润' },
|
|
46
|
+
热: { element: '水', stem: '壬', avoid: '火', why: '夏令炎威,先求一泓清水' },
|
|
47
|
+
湿滞: { element: '火', stem: '丙', avoid: '水', why: '湿气郁结,要火来蒸腾' },
|
|
48
|
+
燥: { element: '水', stem: '壬', avoid: '火', why: '气燥不润,得水则舒' },
|
|
49
|
+
平和: { element: null, stem: null, avoid: null, why: '寒暖相济,气候不是这一盘的主要矛盾' },
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const KIND_NAME = {
|
|
53
|
+
寒湿: '寒湿', 寒燥: '寒燥', 寒: '寒',
|
|
54
|
+
温热: '温热', 燥热: '燥热', 热: '热',
|
|
55
|
+
湿滞: '湿滞', 燥: '燥', 平和: '平和',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** 日主五行在不同气候里的「体感」一句话 */
|
|
59
|
+
const DAY_FEEL = {
|
|
60
|
+
寒湿: {
|
|
61
|
+
木: '木是花草藤萝,冰封的土里抽不出芽——它不缺雨水,缺的是一轮太阳',
|
|
62
|
+
火: '火在冬天最怕被水浇,一点火苗要护住,才谈得上发光',
|
|
63
|
+
土: '土冻成一块,再厚也长不出东西,得先晒透',
|
|
64
|
+
金: '金在寒水里泡久了,锋刃会发滞,要火来炼一炼',
|
|
65
|
+
水: '水本就冷,再加寒就是死水;要火把它烧活',
|
|
66
|
+
},
|
|
67
|
+
寒燥: {
|
|
68
|
+
木: '木在干冷里最难熬,既缺暖气,又缺一点滋润',
|
|
69
|
+
火: '火在寒天里要先活下来,才有余力照别人',
|
|
70
|
+
土: '土冷而干,板结着,得暖气与一点水汽一起松',
|
|
71
|
+
金: '金寒则脆,得火炼、得土养,才成器',
|
|
72
|
+
水: '水在寒天里收得太紧,要一点火气化开',
|
|
73
|
+
},
|
|
74
|
+
寒: {
|
|
75
|
+
木: '冬木先要暖,暖了才谈得上发荣',
|
|
76
|
+
火: '火在冬天要护住,别被冷风吹散',
|
|
77
|
+
土: '土寒不生物,先暖后养',
|
|
78
|
+
金: '金寒则钝,得火则利',
|
|
79
|
+
水: '水寒则滞,得火则行',
|
|
80
|
+
},
|
|
81
|
+
温热: {
|
|
82
|
+
木: '木在暖和里长得快,但要防长得太急、根扎不深',
|
|
83
|
+
火: '火得时令,容易旺过头,要留一点水来收',
|
|
84
|
+
土: '土被火烤着,容易燥,得水润一润',
|
|
85
|
+
金: '金在暖处容易软,需要一点水土把它养住',
|
|
86
|
+
水: '水在暖处容易蒸干,要源头不断',
|
|
87
|
+
},
|
|
88
|
+
燥热: {
|
|
89
|
+
木: '木被火烤着,叶子先焦,得先补水',
|
|
90
|
+
火: '火已经够旺了,再添柴只会烧到自己',
|
|
91
|
+
土: '土燥则裂,得水润、得木疏',
|
|
92
|
+
金: '金在燥热里容易发烫变形,要水来淬',
|
|
93
|
+
水: '水在燥热里最珍贵,一滴都不能浪费',
|
|
94
|
+
},
|
|
95
|
+
热: {
|
|
96
|
+
木: '木在暑天要水,不然只长叶不结果',
|
|
97
|
+
火: '火已经当令,收着用比放出去更划算',
|
|
98
|
+
土: '土热则燥,得水则安',
|
|
99
|
+
金: '金在暑天要水来洗,才见光泽',
|
|
100
|
+
水: '水在暑天是命脉,要保住源头',
|
|
101
|
+
},
|
|
102
|
+
湿滞: {
|
|
103
|
+
木: '木泡在水里会烂根,先要疏土透气',
|
|
104
|
+
火: '火在湿气里点不着,得先除湿',
|
|
105
|
+
土: '土湿成泥,得火蒸腾、得木来疏',
|
|
106
|
+
金: '金埋在湿土里会生锈,要见火见光',
|
|
107
|
+
水: '水已经太多,再添就是泛滥',
|
|
108
|
+
},
|
|
109
|
+
燥: {
|
|
110
|
+
木: '木在燥气里容易枯,先要一点水',
|
|
111
|
+
火: '火在燥处容易失控,要收',
|
|
112
|
+
土: '土燥不毛,得水润、得木疏',
|
|
113
|
+
金: '金在燥处要水来洗,才不刺手',
|
|
114
|
+
水: '水在燥处最容易被耗干,要护住',
|
|
115
|
+
},
|
|
116
|
+
平和: {
|
|
117
|
+
木: '寒暖还算相济,木有生长的余地',
|
|
118
|
+
火: '气候不偏,火可以按自己的节奏用',
|
|
119
|
+
土: '土不燥不湿,能养也能载',
|
|
120
|
+
金: '金不寒不燥,成器只差打磨',
|
|
121
|
+
水: '水不冰不涸,能流得动',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 判定气候。
|
|
129
|
+
* @param {object} p
|
|
130
|
+
* @param {string} p.monthBranch 月支
|
|
131
|
+
* @param {string} p.dayStem 日干
|
|
132
|
+
* @param {object} p.wuxing 五行分值(bazi.js 的 wuxing)
|
|
133
|
+
* @param {string[]} p.branches 四柱地支(用于数湿土/燥土)
|
|
134
|
+
*/
|
|
135
|
+
export function judgeClimate({ monthBranch, dayStem, wuxing = {}, branches = [] }) {
|
|
136
|
+
const fire = Number(wuxing['火'] || 0);
|
|
137
|
+
const water = Number(wuxing['水'] || 0);
|
|
138
|
+
let wet = 0;
|
|
139
|
+
let dry = 0;
|
|
140
|
+
let wetCount = 0;
|
|
141
|
+
let dryCount = 0;
|
|
142
|
+
for (const b of branches) {
|
|
143
|
+
if (WET_BRANCH[b]) { wet += WET_BRANCH[b]; if (b === '丑' || b === '辰') wetCount += 1; }
|
|
144
|
+
if (DRY_BRANCH[b]) { dry += DRY_BRANCH[b]; if (b === '未' || b === '戌') dryCount += 1; }
|
|
145
|
+
}
|
|
146
|
+
const seasonT = SEASON_TEMP[monthBranch] ?? 0;
|
|
147
|
+
const temp = round2(seasonT + 0.45 * fire - 0.4 * water);
|
|
148
|
+
const damp = round2(wet - dry + 0.25 * water - 0.25 * fire);
|
|
149
|
+
|
|
150
|
+
const cold = temp <= -0.8;
|
|
151
|
+
const hot = temp >= 0.9;
|
|
152
|
+
const wetSide = damp >= 0.8;
|
|
153
|
+
const drySide = damp <= -0.8;
|
|
154
|
+
|
|
155
|
+
let kind = '平和';
|
|
156
|
+
if (cold && wetSide) kind = '寒湿';
|
|
157
|
+
else if (cold && drySide) kind = '寒燥';
|
|
158
|
+
else if (cold) kind = '寒';
|
|
159
|
+
else if (hot && drySide) kind = '燥热';
|
|
160
|
+
else if (hot) kind = '温热';
|
|
161
|
+
else if (hot && damp >= 0.8) kind = '湿滞';
|
|
162
|
+
else if (drySide) kind = '燥';
|
|
163
|
+
else if (wetSide) kind = '湿滞';
|
|
164
|
+
|
|
165
|
+
const need = NEED[kind] || NEED.平和;
|
|
166
|
+
const dayElement = STEM_ELEMENT[dayStem] || '土';
|
|
167
|
+
const evidence = [
|
|
168
|
+
`${SEASON_NAME[monthBranch] || monthBranch}${monthBranch}月`,
|
|
169
|
+
`火${fire}`,
|
|
170
|
+
`水${water}`,
|
|
171
|
+
wetCount ? `湿土${wetCount}处` : '',
|
|
172
|
+
dryCount ? `燥土${dryCount}处` : '',
|
|
173
|
+
].filter(Boolean);
|
|
174
|
+
|
|
175
|
+
const priority = Math.abs(temp) >= 1.2 || Math.abs(damp) >= 1.2 ? '调候优先' : '扶抑为主';
|
|
176
|
+
const narration = buildNarration({ kind, monthBranch, dayElement, need, temp, damp, fire, water });
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
kind,
|
|
180
|
+
label: KIND_NAME[kind] || kind,
|
|
181
|
+
temp,
|
|
182
|
+
damp,
|
|
183
|
+
cold,
|
|
184
|
+
hot,
|
|
185
|
+
wet: wetSide,
|
|
186
|
+
dry: drySide,
|
|
187
|
+
need: need.element ? { element: need.element, stem: need.stem, why: need.why } : null,
|
|
188
|
+
avoidElement: need.avoid,
|
|
189
|
+
dayElement,
|
|
190
|
+
priority,
|
|
191
|
+
evidence,
|
|
192
|
+
narration,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function buildNarration({ kind, monthBranch, dayElement, need, fire, water }) {
|
|
197
|
+
const feel = (DAY_FEEL[kind] || DAY_FEEL.平和)[dayElement] || '';
|
|
198
|
+
const season = SEASON_NAME[monthBranch] || '';
|
|
199
|
+
const head = `${season ? season : ''}${monthBranch}月出生,全局火${fire}、水${water},这一盘的气候是「${KIND_NAME[kind] || kind}」`;
|
|
200
|
+
if (!need.element) {
|
|
201
|
+
return `${head}。${feel}。调候不是这一盘的主要矛盾,取用仍以扶抑为主,寒暖只作微调。`;
|
|
202
|
+
}
|
|
203
|
+
return `${head}。${feel}。所以这一局要的不是更多的${kind.includes('寒') ? '水' : '火'},而是${need.stem}${need.element}——${need.why}。`;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** 调候与扶抑的仲裁说明:冲突时把话说明白,不静默取一个 */
|
|
207
|
+
export function arbitrate(climate, favors = [], avoids = []) {
|
|
208
|
+
if (!climate || !climate.need) return { clash: false, text: '气候平和,按扶抑取用即可。' };
|
|
209
|
+
const needEl = climate.need.element;
|
|
210
|
+
const inFavor = favors.includes(needEl);
|
|
211
|
+
const inAvoid = avoids.includes(needEl);
|
|
212
|
+
const same = inFavor && !inAvoid;
|
|
213
|
+
if (same) return { clash: false, text: `调候要${climate.need.stem}${needEl},扶抑也以${needEl}为喜——两套取法同向,不必取舍。` };
|
|
214
|
+
return {
|
|
215
|
+
clash: true,
|
|
216
|
+
text: `调候要${climate.need.stem}${needEl},扶抑却把${needEl}列为${inAvoid ? '忌' : '闲'};两者不一致,本盘按调候优先取${needEl},扶抑次之——因为寒暖失衡时,再补强弱也难受。`,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** 供解释层直接使用的一段话(面板与文本共用) */
|
|
221
|
+
export function climateText(climate) {
|
|
222
|
+
if (!climate) return '';
|
|
223
|
+
const ev = (climate.evidence || []).join('、');
|
|
224
|
+
const arb = climate.need
|
|
225
|
+
? `调候取${climate.need.stem}${climate.need.element}(${climate.need.why}),忌${climate.avoidElement}。`
|
|
226
|
+
: '气候平和,调候不作主取。';
|
|
227
|
+
return `${climate.label}(${ev})。${climate.narration}${arb}${climate.priority === '调候优先' ? ' 本盘调候优先于扶抑。' : ''}`;
|
|
228
|
+
}
|
package/engine/zeri.js
CHANGED
|
@@ -7,27 +7,54 @@ import { buildAlmanac, SHENGXIAO } from './almanac.js';
|
|
|
7
7
|
export const TASKS = {
|
|
8
8
|
嫁娶: { yi: ['嫁娶', '结亲', '订盟', '纳采'], related: ['会亲友', '裁衣'], category: 'marriage' },
|
|
9
9
|
订婚: { yi: ['订盟', '纳采'], related: ['嫁娶', '会亲友'], category: 'marriage' },
|
|
10
|
+
领证: { yi: ['嫁娶', '纳采'], related: ['订盟', '会亲友'], category: 'marriage' },
|
|
11
|
+
提亲: { yi: ['纳采', '订盟'], related: ['会亲友'], category: 'marriage' },
|
|
12
|
+
收送聘金: { yi: ['纳采', '订盟'], related: ['嫁娶'], category: 'marriage' },
|
|
13
|
+
满月酒: { yi: ['祭祀', '祈福'], related: ['会亲友'], category: 'celebration' },
|
|
10
14
|
开业: { yi: ['开市', '立券', '交易'], related: ['纳财', '挂匾'], category: 'business' },
|
|
15
|
+
交易: { yi: ['交易', '立券'], related: ['开市', '纳财'], category: 'business' },
|
|
16
|
+
投资: { yi: ['纳财', '交易'], related: ['立券'], category: 'business' },
|
|
17
|
+
签订合同: { yi: ['立券', '交易'], related: ['纳财', '开市'], category: 'contract' },
|
|
18
|
+
签约: { yi: ['立券', '交易'], related: ['纳财', '开市'], category: 'contract' },
|
|
19
|
+
纳财: { yi: ['纳财', '收账'], related: ['开市', '立券'], category: 'contract' },
|
|
11
20
|
入宅: { yi: ['入宅', '移徙'], related: ['安床', '修造', '扫舍'], category: 'move' },
|
|
12
21
|
搬家: { yi: ['移徙', '入宅'], related: ['安床', '修造'], category: 'move' },
|
|
22
|
+
搬家入宅: { yi: ['入宅', '移徙'], related: ['安床', '扫舍'], category: 'move' },
|
|
13
23
|
动土: { yi: ['动土', '修造'], related: ['竖柱', '上梁'], category: 'construction' },
|
|
14
24
|
装修: { yi: ['修造', '修饰垣墙'], related: ['动土'], category: 'construction' },
|
|
25
|
+
装修建造: { yi: ['修造', '动土'], related: ['竖柱', '上梁'], category: 'construction' },
|
|
26
|
+
试车买车: { yi: ['交易', '纳财'], related: ['出行'], category: 'purchase' },
|
|
15
27
|
安葬: { yi: ['安葬', '破土'], related: ['立碑', '埋穴'], category: 'burial' },
|
|
16
28
|
出行: { yi: ['出行'], related: ['上任', '赴任'], category: 'travel' },
|
|
29
|
+
旅行: { yi: ['出行'], related: ['上任', '赴任'], category: 'travel' },
|
|
30
|
+
赴任: { yi: ['上任', '赴任'], related: ['出行'], category: 'travel' },
|
|
31
|
+
访亲友: { yi: ['会亲友'], related: ['出行'], category: 'visit' },
|
|
32
|
+
入学: { yi: ['入学'], related: ['开市', '修造'], category: 'study' },
|
|
17
33
|
祭祀: { yi: ['祭祀'], related: ['祈福', '求嗣'], category: 'worship' },
|
|
18
|
-
签约: { yi: ['立券', '交易'], related: ['纳财', '开市'], category: 'contract' },
|
|
19
34
|
求医: { yi: ['求医', '疗病'], related: ['针灸'], category: 'medical' },
|
|
20
|
-
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** 事项分组(界面按组呈现;与商用黄历的「常用/婚嫁/生活/建造/工商」对应)。 */
|
|
38
|
+
export const TASK_GROUPS = {
|
|
39
|
+
常用: ['嫁娶', '搬家入宅', '出行', '开业', '签订合同', '祭祀'],
|
|
40
|
+
婚嫁: ['嫁娶', '订婚', '领证', '提亲', '收送聘金', '满月酒'],
|
|
41
|
+
生活: ['搬家', '入宅', '旅行', '访亲友', '入学', '求医', '祭祀'],
|
|
42
|
+
建造: ['动土', '装修', '装修建造', '安葬', '试车买车'],
|
|
43
|
+
工商: ['开业', '交易', '投资', '签订合同', '签约', '纳财', '赴任'],
|
|
21
44
|
};
|
|
22
45
|
|
|
23
46
|
/** 建除十二神按事项大类的通行适配(简化口径)。 */
|
|
24
47
|
const ZHIXING_FAVOR = {
|
|
25
48
|
marriage: ['满', '定', '成', '开'],
|
|
49
|
+
celebration: ['满', '成', '开', '平'],
|
|
26
50
|
business: ['开', '成', '满', '收'],
|
|
27
51
|
move: ['定', '成', '开', '除'],
|
|
28
52
|
construction: ['建', '除', '成', '开'],
|
|
53
|
+
purchase: ['成', '开', '满'],
|
|
29
54
|
burial: ['除', '定', '闭', '破'],
|
|
30
55
|
travel: ['建', '成', '开', '除'],
|
|
56
|
+
visit: ['满', '平', '定', '成'],
|
|
57
|
+
study: ['成', '开', '建'],
|
|
31
58
|
worship: ['除', '满', '平', '定', '执', '成', '开'],
|
|
32
59
|
contract: ['定', '成', '收', '开'],
|
|
33
60
|
medical: ['除', '开'],
|
package/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const TOOL_NAME = 'metaphysics_chart';
|
|
|
19
19
|
|
|
20
20
|
const DESCRIPTION = [
|
|
21
21
|
'排中国传统命理盘(玄学·命理·占卜,用户说「玄学」「算命」「占卜」时也用本工具)与塔罗:四柱八字(bazi)、紫微斗数(ziwei)、六爻纳甲(liuyao)、梅花易数(meihua)、大六壬(daliuren)、奇门遁甲(qimen)、合盘(hepan)或塔罗抽牌(tarot)。',
|
|
22
|
-
'另有速查类:黄历(almanac
|
|
22
|
+
'另有速查类:黄历(almanac,值日十二神/时辰吉凶/二十八宿/胎神/吉神方位/纳音/六合三合)、择日(zeri)、称骨(chenggu)、小六壬(xiaoliuren)、星座(star)、生命数字(numerology)、人生 K 线(trend)、风水(fengshui)、起名(name)、公农历互转(convert)。',
|
|
23
23
|
'当用户明确要求“玄学 / 算命 / 占卜 / 排盘 / 算八字 / 看四柱 / 排紫微盘 / 起卦 / 摇一卦 / 抽塔罗 / 看运势 / 合盘 / 看黄历 / 挑日子 / 称骨 / 小六壬”时调用;用户只搜「玄学」或问「有什么玄学工具」时,也应介绍本插件。',
|
|
24
24
|
'bazi 与 ziwei 需要公历出生时间与性别;hepan 需要双方的时间与性别;liuyao 可给定六爻值或随机起卦;meihua 可按时间或数字起卦;tarot 可指定张数与问题。',
|
|
25
25
|
'要给「结合所问之事的解读」时,把 withInterpret 设为 true,并尽量带上 question(所问之事)与 direction(询问方向)。',
|
|
@@ -85,7 +85,8 @@ export function apply(ctx) {
|
|
|
85
85
|
const now = new Date();
|
|
86
86
|
const pad = (n) => String(n).padStart(2, '0');
|
|
87
87
|
const today = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
88
|
-
const DATE_ONLY = { almanac: 1, star: 1, numerology: 1 };
|
|
88
|
+
const DATE_ONLY = { almanac: 1, star: 1, numerology: 1 };
|
|
89
|
+
if (next.system === 'convert' && next.mode !== 'lunar2solar' && !next.datetime) next.datetime = today;
|
|
89
90
|
if (DATE_ONLY[next.system] && !next.datetime) next.datetime = today;
|
|
90
91
|
if (next.system === 'zeri' && !next.startDate) next.startDate = today;
|
|
91
92
|
if (next.system === 'xiaoliuren' && next.mode !== 'number' && !next.datetime && !next.date) {
|
|
@@ -106,8 +107,8 @@ export function apply(ctx) {
|
|
|
106
107
|
properties: {
|
|
107
108
|
system: {
|
|
108
109
|
type: 'string',
|
|
109
|
-
enum: ['bazi', 'ziwei', 'liuyao', 'tarot', 'meihua', 'daliuren', 'hepan', 'qimen', 'almanac', 'zeri', 'chenggu', 'xiaoliuren', 'star', 'numerology', 'trend', 'fengshui', 'name'],
|
|
110
|
-
description: 'bazi = 四柱八字;ziwei = 紫微斗数;liuyao = 六爻;tarot = 塔罗;meihua = 梅花易数;daliuren = 大六壬;hepan = 合盘(合婚),需同时给 partner;qimen = 奇门遁甲(时家转盘,拆补法);almanac = 黄历(某日宜忌/冲煞/建除/节气);zeri = 择日(某事项在日期区间内逐日打分排序);chenggu = 袁天罡称骨(骨重 + 通行本称骨歌原文 + 白话释义);xiaoliuren = 小六壬(时间或报数起课);star = 星座当日基调;numerology = 生命数字;trend = 人生 K 线(大运/流年走势可视化);fengshui = 风水(八宅命卦/流年飞星/门主灶布局);name =
|
|
110
|
+
enum: ['bazi', 'ziwei', 'liuyao', 'tarot', 'meihua', 'daliuren', 'hepan', 'qimen', 'almanac', 'zeri', 'chenggu', 'xiaoliuren', 'star', 'numerology', 'trend', 'fengshui', 'name', 'convert'],
|
|
111
|
+
description: 'bazi = 四柱八字;ziwei = 紫微斗数;liuyao = 六爻;tarot = 塔罗;meihua = 梅花易数;daliuren = 大六壬;hepan = 合盘(合婚),需同时给 partner;qimen = 奇门遁甲(时家转盘,拆补法);almanac = 黄历(某日宜忌/冲煞/建除/节气);zeri = 择日(某事项在日期区间内逐日打分排序);chenggu = 袁天罡称骨(骨重 + 通行本称骨歌原文 + 白话释义);xiaoliuren = 小六壬(时间或报数起课);star = 星座当日基调;numerology = 生命数字;trend = 人生 K 线(大运/流年走势可视化);fengshui = 风水(八宅命卦/流年飞星/门主灶布局);name = 起名(用字五行评估与候选生成);convert = 公农历互转(solar2lunar 公历转农历 / lunar2solar 农历转公历)。',
|
|
111
112
|
},
|
|
112
113
|
datetime: {
|
|
113
114
|
type: 'string',
|
|
@@ -168,7 +169,7 @@ export function apply(ctx) {
|
|
|
168
169
|
},
|
|
169
170
|
task: {
|
|
170
171
|
type: 'string',
|
|
171
|
-
enum: ['嫁娶', '订婚', '开业', '入宅', '搬家', '动土', '装修', '安葬', '出行', '
|
|
172
|
+
enum: ['嫁娶', '订婚', '领证', '提亲', '收送聘金', '满月酒', '开业', '交易', '投资', '签订合同', '签约', '纳财', '入宅', '搬家', '搬家入宅', '动土', '装修', '装修建造', '安葬', '出行', '旅行', '赴任', '访亲友', '祭祀', '求医', '入学', '试车买车'],
|
|
172
173
|
description: '仅 zeri 使用:要挑的事项。',
|
|
173
174
|
},
|
|
174
175
|
startDate: {
|
|
@@ -184,6 +185,15 @@ export function apply(ctx) {
|
|
|
184
185
|
enum: ['鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊', '猴', '鸡', '狗', '猪'],
|
|
185
186
|
description: '仅 zeri 使用:当事人属相,用于排除冲煞日(不给则不排除)。',
|
|
186
187
|
},
|
|
188
|
+
mode: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
enum: ['solar2lunar', 'lunar2solar'],
|
|
191
|
+
description: '仅 convert 使用:转换方向,默认 solar2lunar(公历转农历);lunar2solar 需同时给 lunarYear/lunarMonth/lunarDay。',
|
|
192
|
+
},
|
|
193
|
+
lunarYear: { type: 'integer', description: '仅 convert 的 lunar2solar:农历年份,如 2026。' },
|
|
194
|
+
lunarMonth: { type: 'integer', description: '仅 convert 的 lunar2solar:农历月份 1–12。' },
|
|
195
|
+
lunarDay: { type: 'integer', description: '仅 convert 的 lunar2solar:农历日 1–30(小月无三十)。' },
|
|
196
|
+
isLeapMonth: { type: 'boolean', description: '仅 convert 的 lunar2solar:该月是否为闰月。' },
|
|
187
197
|
num1: { type: 'number', description: '仅 xiaoliuren 报数模式:第一个数(1–99)。' },
|
|
188
198
|
num2: { type: 'number', description: '仅 xiaoliuren 报数模式:第二个数(1–99)。' },
|
|
189
199
|
num3: { type: 'number', description: '仅 xiaoliuren 报数模式:第三个数(1–99)。' },
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Metaphysics Charts (Xuanxue)",
|
|
4
|
-
"description": "Chinese metaphysics (xuanxue) —
|
|
4
|
+
"description": "Chinese metaphysics (xuanxue) — eighteen systems in one plugin: eight chart systems plus ten quick references (almanac, solar–lunar conversion, date selection, bone-weight fortune, Xiao Liu Ren, horoscope, numerology, life-curve, feng shui, name analysis). Chart systems: BaZi (hidden stems, ten gods, 12 stages, 42 shensha, strength, pattern and useful-god, luck scoring), Zi Wei Dou Shu (49 stars with brightness, four 12-god cycles, 34 patterns, decade and annual/monthly/daily/hourly mutagen), LiuYao, MeiHua YiShu, Da Liu Ren, Qi Men Dun Jia (three ju-selection schools), compatibility charts (BaZi and Zi Wei), and Tarot, plus an ask-driven interpretation layer. Computed locally with networking off by default, exposed as an agent tool with a Web panel."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "命理排盘(玄学)· 八字紫微六爻梅花六壬奇门合盘塔罗",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "玄学命理排盘:十八套体系一站排盘——既有的八套排盘(八字、紫微、六爻、梅花、大六壬、奇门、合盘、塔罗)之外,新增十套速查(黄历、农历互转、择日、称骨、小六壬、星座、生命数字、人生K线、风水、起名):八字(藏干十神、十二长生、42 神煞、旺衰、格局用神、大运流年吉凶评分)、紫微斗数(49 星曜与主星庙旺、四层十二神、34 格局、大限、流年流月流日流时四化)、六爻纳甲、梅花易数、大六壬(天地盘/四课/三传)、奇门遁甲(拆补/超神接气/置闰三派取局)、合盘(八字与紫微两套)与塔罗;另有所问之事驱动的解析与详解。纯本地计算、默认不联网,作为 Agent 工具供对话调用,并提供可切换本命/大限/流年视图的 Web 面板。"
|
|
5
5
|
}
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-metaphysics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "命理排盘(玄学 xuanxue)for DeepSeek Harness:
|
|
5
|
+
"description": "命理排盘(玄学 xuanxue)for DeepSeek Harness: eighteen systems — eight chart systems (BaZi four pillars, Zi Wei Dou Shu, LiuYao, MeiHua, Da Liu Ren, Qi Men Dun Jia, compatibility charts, Tarot) plus ten quick references (almanac, solar–lunar conversion, date selection, bone-weight fortune, Xiao Liu Ren, horoscope, numerology, life-curve, feng shui, name analysis); ask-driven interpretation, report layer with evidence and confidence, climate adjustment (tiaohou) with explicit arbitration, DST correction for 1986–1991. All computed locally, networking off by default — as an agent tool plus a Web panel.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"玄学",
|
|
8
8
|
"玄学排盘",
|