dsh-metaphysics 0.62.5 → 0.63.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 +79 -3
- package/client.almanac.js +49 -49
- package/client.chart.js +222 -0
- package/client.chenggu.js +57 -57
- package/client.convert.js +50 -50
- package/client.daliuren.js +113 -102
- package/client.fengshui.js +44 -44
- package/client.js +390 -281
- package/client.liuyao.js +112 -101
- package/client.mbti.js +50 -50
- package/client.name.js +51 -51
- package/client.numerology.js +50 -50
- package/client.qimen.js +110 -99
- package/client.star.js +51 -51
- package/client.tarot.js +111 -100
- package/client.xiaoliuren.js +51 -51
- package/client.zeri.js +49 -49
- package/engine/index.js +29 -1
- package/engine/interpret.js +33 -1
- package/engine/structure.js +1 -1
- package/engine/xiaoliuren.js +6 -2
- package/package.json +1 -1
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +277 -30
- package/client.bazi.js +0 -211
- package/client.hepan.js +0 -210
- package/client.trend.js +0 -202
- package/client.ziwei.js +0 -211
package/engine/index.js
CHANGED
|
@@ -110,6 +110,13 @@ function baziText(r) {
|
|
|
110
110
|
const jiao = r.dayun.jiao && r.dayun.jiao.at
|
|
111
111
|
? `;交运 ${r.dayun.jiao.at}(${r.dayun.jiao.frame},距${r.dayun.jiao.from.name} ${r.dayun.jiao.spanDays} 天,三日折一年)`
|
|
112
112
|
: '';
|
|
113
|
+
// 起运岁精确值(截断到年月日时):上面 startAge 是四舍五入到月的口语写法,两者同源、并列给出。
|
|
114
|
+
// 第三方对拍里截断到月 23/23 全中、四舍五入只有 15/23——差别就在这串日时上,所以必须看得见。
|
|
115
|
+
const sae = r.dayun.startAgeExact;
|
|
116
|
+
const startAgeExactLine = sae && Number.isInteger(sae.years)
|
|
117
|
+
? `起运岁(精确):${sae.years} 年 ${sae.months} 个月 ${sae.days} 天 ${sae.hours} 小时`
|
|
118
|
+
+ `(${sae.caliber};上面「${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月」是四舍五入到月,两者同源)`
|
|
119
|
+
: '';
|
|
113
120
|
// 阈值 20 分钟:与 NAOJ 历要项对拍实测,本引擎节气最多偏早 13.5 分钟(Meeus 低精度上限约 14 分钟)
|
|
114
121
|
const near = r.jieqi.nearBoundaryMinutes < 20
|
|
115
122
|
? `\n⚠ 出生时刻距「节」仅 ${r.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`
|
|
@@ -142,6 +149,22 @@ function baziText(r) {
|
|
|
142
149
|
(r.frame.yongshen.qt ? ` 穷通:${r.frame.yongshen.qt.month}${r.frame.yongshen.qt.stem}取${r.frame.yongshen.qt.yong.join('、')}(首取${r.frame.yongshen.qt.primary})` : ''),
|
|
143
150
|
`十神权重:${Object.entries(r.frame.godStats.groups).map(([k, v]) => `${k}${v}`).join(' ')}`,
|
|
144
151
|
] : [];
|
|
152
|
+
// 八大地支结构(炳祥课静态口径):算得出但没有输出通道的字段等于没做,这里补一行摘要。
|
|
153
|
+
// 只报「哪几支成党、异类是哪支、静态从格概率」,与上面旺衰分是两套并列口径,不互相覆盖。
|
|
154
|
+
// 三柱模式第四支是正午占位:照实标「占位」,不把它说成实有的时支。
|
|
155
|
+
const bs = r.strength && r.strength.branchStructure;
|
|
156
|
+
const bsCols = bs ? bs.branches.map((b) => `${b.label}${b.branch}${b.camp}${bs.placeholderHour && b.key === 'hour' ? '·占位' : ''}`).join('、') : '';
|
|
157
|
+
// 注意 bs.word 本身已含三柱说明(bazi.js 的 hourUnknown 分支会改写它),这里不重复追加
|
|
158
|
+
const bsTail = bs && !bs.placeholderHour && !bs.complete ? ' 时柱暂缺,只列三支' : '';
|
|
159
|
+
const branchStructureLine = bs
|
|
160
|
+
? `地支结构:${bs.placeholderHour ? '三支+占位' : '四支'} ${bs.code}(${bsCols}) `
|
|
161
|
+
+ `${bs.word}${bs.congProb != null ? `(静态从格 ${bs.congRange})` : ''}${bsTail}`
|
|
162
|
+
: '';
|
|
163
|
+
// 暗合:另列不并入合冲刑害。只出现一对时按课里口径「可忽略」,所以照实写出来但不升级为断语。
|
|
164
|
+
const anhe = (r.relations && Array.isArray(r.relations.anhe)) ? r.relations.anhe : [];
|
|
165
|
+
const anheLine = anhe.length
|
|
166
|
+
? `暗合:${anhe.join(' ')}(另列,不并入上面的合冲刑害;${anhe.length === 1 ? '只一对,按口径可忽略' : `共 ${anhe.length} 对`})`
|
|
167
|
+
: '';
|
|
145
168
|
const hourMissing = r.hourUnknown === true || !P.hour;
|
|
146
169
|
return [
|
|
147
170
|
`【四柱】${P.year.ganzhi} ${P.month.ganzhi} ${P.day.ganzhi}${P.hour ? ` ${P.hour.ganzhi}` : '(时柱暂缺)'}`,
|
|
@@ -151,14 +174,17 @@ function baziText(r) {
|
|
|
151
174
|
`五行:${wuxing}`,
|
|
152
175
|
...(palaces ? [palaces] : []),
|
|
153
176
|
`日主强弱:${r.strength.level}(${r.strength.score}) ${r.strength.detail}`,
|
|
177
|
+
...(branchStructureLine ? [branchStructureLine] : []),
|
|
154
178
|
...gejuLine,
|
|
155
179
|
`天干关系:${(r.relations && r.relations.stems.length) ? r.relations.stems.join(' ') : '—'}`,
|
|
156
180
|
`地支关系:${(r.relations && r.relations.branches.length) ? r.relations.branches.join(' ') : '—'}`,
|
|
181
|
+
...(anheLine ? [anheLine] : []),
|
|
157
182
|
shenshaLine,
|
|
158
183
|
`真太阳时:${r.solarTime.trueSolarText}(${r.input.geo ? r.input.geo.note + ';' : ''}${r.solarTime.note}) 晚子时:${r.input.lateZi ? '23:00 后算次日' : '23:00 后仍算当日'}`,
|
|
159
184
|
`节气:上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time}`,
|
|
160
185
|
...(renyuanLine ? [renyuanLine] : []),
|
|
161
186
|
`大运:${r.dayun.rule}(${r.dayun.direction}),${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月起运${jiao}`,
|
|
187
|
+
...(startAgeExactLine ? [startAgeExactLine] : []),
|
|
162
188
|
` ${dayun}`,
|
|
163
189
|
`流年:${r.liunian.slice(0, 10).map((l) => `${l.year}${l.ganzhi}(${l.stemTenGod})${l.luck ? `·${l.luck.tier}` : ''}`).join(' ')}`,
|
|
164
190
|
(() => {
|
|
@@ -1785,8 +1811,10 @@ function chengguText(r) {
|
|
|
1785
1811
|
|
|
1786
1812
|
/** 小六壬文本 */
|
|
1787
1813
|
function xiaoliurenText(r) {
|
|
1814
|
+
// 所问从顶层读(引擎把 question 挂顶层,不进 meta——meta 要能被句柄完整复现)
|
|
1815
|
+
const q = r.question || (r.meta && r.meta.question) || null;
|
|
1788
1816
|
return [
|
|
1789
|
-
`【小六壬·${r.meta.mode}】${
|
|
1817
|
+
`【小六壬·${r.meta.mode}】${q ? `所问:${q}` : ''}`,
|
|
1790
1818
|
r.meta.originText,
|
|
1791
1819
|
`落宫:${r.steps.join(' → ')}`,
|
|
1792
1820
|
`断语:${r.result.palace}(${r.result.luck}) ${r.result.text}`,
|
package/engine/interpret.js
CHANGED
|
@@ -428,7 +428,12 @@ function baziInterpret(r) {
|
|
|
428
428
|
const jiaoLine = r.dayun && r.dayun.jiao && r.dayun.jiao.at
|
|
429
429
|
? `起运交运时刻 ${r.dayun.jiao.at}(${r.dayun.jiao.frame};三日折一年,距${r.dayun.jiao.from.name} ${r.dayun.jiao.spanDays} 天)。每步大运在同月同日同时刻换,逐年日期见下方大运表「交运」列。\n`
|
|
430
430
|
: '';
|
|
431
|
-
|
|
431
|
+
// 精确起运岁:与「几岁几个月」的口语写法并列。对上第三方排盘时差的就是日、时这两位。
|
|
432
|
+
const sae = r.dayun && r.dayun.startAgeExact;
|
|
433
|
+
const exactLine = sae && Number.isInteger(sae.years)
|
|
434
|
+
? `起运岁精确值:${sae.years} 年 ${sae.months} 个月 ${sae.days} 天 ${sae.hours} 小时(${sae.caliber})。与摘要「${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月」同源:后者四舍五入到月,差一个月的边界常出在这里——第三方给到日/时的,按这一行核对。\n`
|
|
435
|
+
: '';
|
|
436
|
+
return `${jiaoLine}${exactLine}当前大运:${pick(cur, 'ganzhi', '—')}(${curSpan})。后续两步:${nextTwo}。\n近五年流年:${years || '—'}。\n读法:大运管"这十年的大环境",流年管"今年的具体天气";两者打架时,以能否动到用神为准。`;
|
|
432
437
|
})(),
|
|
433
438
|
},
|
|
434
439
|
{ key: 'years', label: '流年时间轴', text: yearsText },
|
|
@@ -515,6 +520,33 @@ function baziInterpret(r) {
|
|
|
515
520
|
key: 'xianshen', label: '闲神',
|
|
516
521
|
text: `【${frame.xianshen.level}】${frame.xianshen.detail}\n口径:${frame.xianshen.method}`,
|
|
517
522
|
}] : []),
|
|
523
|
+
// 八大地支结构:与旺衰分并列的第二套静态视图。算出来却没人看得见的字段等于没做,
|
|
524
|
+
// 所以这里单独给一节,写清「它是什么、跟上面旺衰分的区别、能不能据此断从格」。
|
|
525
|
+
...(r.strength && r.strength.branchStructure ? [{
|
|
526
|
+
key: 'structure', label: '地支结构',
|
|
527
|
+
text: (() => {
|
|
528
|
+
const b = r.strength.branchStructure;
|
|
529
|
+
const cols = b.branches.map((x) => `${x.label}支${x.branch}(${x.support}·${x.camp} 档 ${x.weight} 分${b.placeholderHour && x.key === 'hour' ? '·占位' : ''})`).join(';');
|
|
530
|
+
const odd = b.odd && b.odd.length ? `异类:${b.odd.map((x) => `${x.label}支${x.branch}(${x.weight} 分)`).join('、')}。` : '四支二对二或同党,无异类。';
|
|
531
|
+
const bal = b.balance || {};
|
|
532
|
+
return `【${b.code}】${b.detail}\n`
|
|
533
|
+
+ `逐支:${cols}\n`
|
|
534
|
+
+ `${odd}${b.halfSupported && b.halfSupported.length ? `半得地:${b.halfSupported.join('、')}(按 0.2–0.5 折算,不计入身强阵营)。` : ''}\n`
|
|
535
|
+
+ `地支 身强 ${bal.branch ? bal.branch.A : '—'} : 身弱 ${bal.branch ? bal.branch.B : '—'},加天干后 ${bal.total ? `${bal.total.A}:${bal.total.B}` : '—'}(宫位权重年 11 / 月 36 / 日 27 / 时 16)。\n`
|
|
536
|
+
+ `${b.word}${b.congProb != null ? `——静态从格概率 ${b.congRange}。` : '。'}\n`
|
|
537
|
+
+ `口径:${b.method}\n`
|
|
538
|
+
+ `与「日主强弱」的关系:这是并列的第二套静态视图,不改上面的旺衰评分,也不参与取格与喜忌——两者是同一组四支的两种读法,不是先后两步。\n`
|
|
539
|
+
+ `边界:${b.note}`;
|
|
540
|
+
})(),
|
|
541
|
+
}] : []),
|
|
542
|
+
// 暗合:另列不并。这一条最容易被人当成「合」读进旺衰,所以把边界写在节里。
|
|
543
|
+
...(r.relations && Array.isArray(r.relations.anhe) && r.relations.anhe.length ? [{
|
|
544
|
+
key: 'anhe', label: '暗合',
|
|
545
|
+
text: `${r.relations.anhe.join('\n')}\n`
|
|
546
|
+
+ `口径:${r.relations.anheNote || '暗合只作取象,不参与旺衰与格局。'}\n`
|
|
547
|
+
+ `边界:暗合与上面的「地支关系」(三合、三会、六合、六冲、刑、害)是两条线,本插件不把它们合并计分;`
|
|
548
|
+
+ `${r.relations.anhe.length === 1 ? '本盘只出现一对,按课里口径可以直接忽略。' : `本盘共 ${r.relations.anhe.length} 对,可作取象参考,但仍不折旺衰。`}`,
|
|
549
|
+
}] : []),
|
|
518
550
|
(() => {
|
|
519
551
|
const ss = r.shensha;
|
|
520
552
|
const cols = { year: '年', month: '月', day: '日', hour: '时' };
|
package/engine/structure.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// 八大地支结构(炳祥课堂口径)
|
|
2
2
|
//
|
|
3
3
|
// 定位:只做「静态结构 + 宫位权重」的只读标注,不改旺衰、不改喜忌。
|
|
4
|
-
//
|
|
4
|
+
// 课堂口径来源:炳祥八字课程笔记(内部资料,不随包发布);
|
|
5
5
|
// 这里把「四个地支落在身强阵营还是身弱阵营」按年支定 A 档(年支那一档记 A,另一档记 B),
|
|
6
6
|
// 于是八种排布可以写成 AAAA / ABBB / AAAB / AABA / ABAA / AABB / ABAB / ABBA,
|
|
7
7
|
// 再从「异类那一支的宫位权重」读出静态从格概率:
|
package/engine/xiaoliuren.js
CHANGED
|
@@ -77,10 +77,14 @@ export function buildXiaoliuren(input) {
|
|
|
77
77
|
const info = PALACES[p3];
|
|
78
78
|
return {
|
|
79
79
|
system: 'xiaoliuren',
|
|
80
|
-
|
|
80
|
+
// question 放在顶层,不放进 meta:句柄按设计不收 question(它不影响盘面),
|
|
81
|
+
// 放进 meta 会让「句柄回放」与「原始调用」的 meta 不一致(回放后变 null),
|
|
82
|
+
// 看起来像盘变了。其余体系也都是把 question 挂顶层。
|
|
83
|
+
meta: { mode: mode === 'time' ? '时间起课' : '报数起课', originText },
|
|
84
|
+
question: input.question || null,
|
|
81
85
|
steps: [p1, p2, p3],
|
|
82
86
|
result: { palace: p3, luck: info.luck, text: info.text },
|
|
83
|
-
sources: ['
|
|
87
|
+
sources: ['掌诀口径:通行马前口诀(白话提炼,非原文照录)'],
|
|
84
88
|
disclaimer: '小六壬为轻量快占,属民俗娱乐参考;重要事项请综合现实信息判断。',
|
|
85
89
|
};
|
|
86
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-metaphysics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "命理排盘(玄学 xuanxue)for DeepSeek Harness: nineteen systems and eleven quick references (almanac, solar–lunar conversion, …), with climate adjustment (tiaohou), the 120 Qiongtong Baojian entries, 1,062-char name library with per-character pinyin, Kangxi stroke counts, five-grid (五格/三才) analysis and mechanical phonetics checks, a 78-card tarot library on the Rider-Waite-Smith base (per-card English name, image description, core meaning and astrological correspondence, cross-checked against three published sources; court cards carry no zodiac by design and the chart says so), classical quotes (Ziping Zhenquan / Di Tian Sui / San Ming Tong Hui), hexagram body relations (六冲/六合/伏吟/反吟/化进神/化退神) plus yongshen placement (用神落位) with month/day strength (月建日辰旺衰) and whole-hexagram per-line strength (全卦逐爻旺衰) and response-time clues (应期线索:逢值/逢冲/逢合 + 月建五态快慢) for liuyao, plus an MBTI-style 16-type questionnaire and exact dayun handover dates (交运日) with annual suiyun hints (岁运并临/伏吟反吟), palace conditions (击刑/入墓), month states (旺相休囚死) and stem–palace relations (天盘干与宫生克) for qimen, flying four-transformations with chained flights (四化飞星串连), three-way-four-corner composite flights (三方四正复合飞化), switchable leap-month policy (闰月按日切分/整月归次月/整月归本月) eleven school switches (亮度/庚干四化/天马/天空/截空旬空/魁钺/天伤天使/长生/晚子时/身主/杂曜全表) for ziwei, the last one opting in to a 61-star minor-star (杂曜) table where each of the twelve extra stars carries its placement verse and the palace it landed in (verses accepted only when at least two independent published editions give the same table, homonymous stars never merged), caliber diffs for bazi/ziwei/qimen (same inputs, one switch, root-field changes), shadow-chart IDs (same normalized params → same ID; version bumps auto-diff chart fields), step-by-step deduction traces (liuyao najia→liuqin→shiying→fushen→strength; bazi strength score and pattern/yongshen; ziwei pattern conditions), and a bundled offline single-file page (命理排盘.html), a panel-to-chat handoff that asks the Harness about a finished chart, per-tab lazy engine chunks so the first-screen client bundle stays under 100KB gzip, and a public verification report (128 classical hexagram cases, 312 Zi Wei charts × 34 patterns, 12 dayun handover cases) generated from the same source that gates CI.",
|
|
6
6
|
"keywords": [
|