dsh-metaphysics 0.50.1 → 0.50.5
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 +57 -9
- package/README.md +11 -9
- package/client.js +516 -36
- package/docs/assets/dsh-metaphysics-group.jpg +0 -0
- package/engine/bazi.js +11 -1
- package/engine/classics.js +13 -0
- package/engine/diff.js +301 -197
- package/engine/geju.js +29 -9
- package/engine/index.js +90 -6
- package/engine/interpret-knowledge.js +5 -5
- package/engine/interpret-plain.js +4 -1
- package/engine/interpret.js +8 -5
- package/index.js +12 -2
- package/package.json +2 -2
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +572 -35
- package/docs/assets/dsh-metaphysics-group.png +0 -0
package/engine/index.js
CHANGED
|
@@ -24,7 +24,8 @@ import { buildStar } from './star.js';
|
|
|
24
24
|
import { buildNumerology } from './numerology.js';
|
|
25
25
|
import { buildMbti, mbtiPaper } from './mbti.js';
|
|
26
26
|
import { buildConvert } from './convert.js';
|
|
27
|
-
import { classicsFor, classicsText, suiyunClassicOf, CLASSIC_BOOKS } from './classics.js';
|
|
27
|
+
import { classicsFor, classicsText, suiyunClassicOf, classicOf, CLASSIC_BOOKS } from './classics.js';
|
|
28
|
+
import { diffObjects, summarize, sortDiffs, labelOf, rootOf, categoryOf, formatValue, CALIBER_SWITCHES } from './diff.js';
|
|
28
29
|
import { buildTrend } from './trend.js';
|
|
29
30
|
import { buildFengshui } from './fengshui.js';
|
|
30
31
|
import { buildName } from './name.js';
|
|
@@ -127,15 +128,21 @@ function baziText(r) {
|
|
|
127
128
|
`${g.cat}|` + g.items.map((i) => `${i.name}(${i.pillars.map((k) => SHORT[k]).join('')})`).join('、')).join(';')
|
|
128
129
|
: '神煞:—';
|
|
129
130
|
const ry = r.renyuan;
|
|
131
|
+
const rySrc = classicOf('smt-renyuan');
|
|
130
132
|
const renyuanLine = ry
|
|
131
|
-
? `人元:${ry.month}月第${ry.day}日,${ry.active}${ry.activeElement}司权(${ry.segments.map((s) => `${s.stem}${s.from}–${s.to}`).join(' ')})${ry.beyond ? ';已过 30 日表,按本气算' : ''}`
|
|
133
|
+
? `人元:${ry.month}月第${ry.day}日,${ry.active}${ry.activeElement}司权(${ry.segments.map((s) => `${s.stem}${s.from}–${s.to}`).join(' ')})${ry.beyond ? ';已过 30 日表,按本气算' : ''}${rySrc ? `|原文见《${CLASSIC_BOOKS[rySrc.book].name}·${rySrc.chapter}》` : ''}`
|
|
132
134
|
: '';
|
|
135
|
+
const ysd = (r.frame && r.frame.yongshen && r.frame.yongshen.disputed) || [];
|
|
136
|
+
const disText = ysd.length
|
|
137
|
+
? ` 有争议:${ysd.map((d) => `${d.element}(${d.favorRole};${d.climate}盘调候忌${d.element})`).join('、')}`
|
|
138
|
+
: '';
|
|
139
|
+
const disEls = new Set(ysd.map((d) => d.element));
|
|
133
140
|
const gejuLine = r.frame ? [
|
|
134
141
|
`格局:${r.frame.primary ? `${r.frame.primary.name}(${r.frame.primary.evidence})` : '—'}`,
|
|
135
142
|
` ${r.frame.geju.map((g) => `${g.name}[${g.kind}]`).join(' ')}`,
|
|
136
|
-
`用神:喜${r.frame.yongshen.favor.join('')}(${r.frame.yongshen.favorTenGods.join('、')}) 忌${r.frame.yongshen.avoid.join('')}(${r.frame.yongshen.avoidTenGods.join('、')}
|
|
143
|
+
`用神:喜${r.frame.yongshen.favor.join('')}(${r.frame.yongshen.favorTenGods.join('、')}) 忌${r.frame.yongshen.avoid.join('')}(${r.frame.yongshen.avoidTenGods.join('、')})${disText} ${r.frame.yongshen.method}`,
|
|
137
144
|
` ${r.frame.yongshen.detail}`,
|
|
138
|
-
`寒暖:${r.climate ? `${r.climate.label}(${(r.climate.evidence || []).join('、')})${r.climate.need ? ` 调候取${r.climate.need.stem}${r.climate.need.element} 忌${r.climate.avoidElement}` : ''}` : '—'}` +
|
|
145
|
+
`寒暖:${r.climate ? `${r.climate.label}(${(r.climate.evidence || []).join('、')})${r.climate.need ? ` 调候取${r.climate.need.stem}${r.climate.need.element} 忌${r.climate.avoidElement}${disEls.has(r.climate.avoidElement) ? '(有争议)' : ''}` : ''}` : '—'}` +
|
|
139
146
|
(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})` : ''),
|
|
140
147
|
`十神权重:${Object.entries(r.frame.godStats.groups).map(([k, v]) => `${k}${v}`).join(' ')}`,
|
|
141
148
|
] : [];
|
|
@@ -158,8 +165,8 @@ function baziText(r) {
|
|
|
158
165
|
`流年:${r.liunian.slice(0, 10).map((l) => `${l.year}${l.ganzhi}(${l.stemTenGod})${l.luck ? `·${l.luck.tier}` : ''}`).join(' ')}`,
|
|
159
166
|
(() => {
|
|
160
167
|
const hits = r.liunian.filter((l) => l.suiyun && l.suiyun.signals && l.suiyun.signals.length);
|
|
161
|
-
if (!hits.length) return '
|
|
162
|
-
const label = (s) => `${s.type}${s.type.startsWith('流年') && s.target ? `(${s.target})` : ''}`;
|
|
168
|
+
if (!hits.length) return '岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)';
|
|
169
|
+
const label = (s) => `${s.type}${(s.type.startsWith('流年') || s.type.startsWith('大运')) && s.target ? `(${s.target})` : ''}`;
|
|
163
170
|
const e = suiyunClassicOf(r);
|
|
164
171
|
const src = e ? `|古籍见《${CLASSIC_BOOKS[e.book].name}·${e.chapter}》` : '';
|
|
165
172
|
return '岁运提示(只标干支变动,不判吉凶):' + hits
|
|
@@ -443,6 +450,11 @@ export function compute(args = {}) {
|
|
|
443
450
|
// 岁运提示的原文不占五条上限:只在盘面真有岁运信号时挂到结果上,摘要、解析层与面板各自取用
|
|
444
451
|
const syc = suiyunClassicOf(r);
|
|
445
452
|
if (syc) r.suiyunClassic = { ...syc, bookName: CLASSIC_BOOKS[syc.book].name };
|
|
453
|
+
// 人元司事的原文同样不进五条取条表:每张八字盘都有人元,随「人元司权」一节给出
|
|
454
|
+
if (r.renyuan) {
|
|
455
|
+
const ryc = classicOf('smt-renyuan');
|
|
456
|
+
if (ryc) r.renyuanClassic = { ...ryc, bookName: CLASSIC_BOOKS[ryc.book].name };
|
|
457
|
+
}
|
|
446
458
|
}
|
|
447
459
|
// 超出 ΔT 覆盖范围时把精度提示顶到摘要最前,别让远期盘悄悄出错
|
|
448
460
|
if (r && r.precision && r.precision.level === 'approx' && r.summary) {
|
|
@@ -563,6 +575,69 @@ export function interpretText(i) {
|
|
|
563
575
|
return out.join('\n');
|
|
564
576
|
}
|
|
565
577
|
|
|
578
|
+
/** 对照时不参与计算的参数:它们只影响解析/附加模块,不影响盘面 */
|
|
579
|
+
const CALIBER_IGNORE_ARGS = ['cross', 'verifyPast', 'withInterpret', 'question', 'direction', 'ask', 'geocode', 'rectify', 'events'];
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* 口径对照:同一组输入,只把某一个口径开关换成它的另一档,逐字段列出变化。
|
|
583
|
+
* 这一步不新增断法,也不改盘;返回根因字段、分类计数与一句话总结,供面板/独立页/工具共用。
|
|
584
|
+
*/
|
|
585
|
+
export function caliberCompare(args = {}, opts = {}) {
|
|
586
|
+
const system = opts.system || args.system;
|
|
587
|
+
const switches = opts.switches || CALIBER_SWITCHES[system] || [];
|
|
588
|
+
if (!switches.length) return { system, switches: [], affected: 0, total: 0 };
|
|
589
|
+
const base = { ...args };
|
|
590
|
+
for (const k of CALIBER_IGNORE_ARGS) delete base[k];
|
|
591
|
+
const rows = switches.map((sw) => {
|
|
592
|
+
const current = sw.read(base);
|
|
593
|
+
const alt = sw.alt(current);
|
|
594
|
+
let diffs = [];
|
|
595
|
+
let error = '';
|
|
596
|
+
try {
|
|
597
|
+
diffs = diffObjects(
|
|
598
|
+
compute({ ...base, [sw.key]: current }),
|
|
599
|
+
compute({ ...base, [sw.key]: alt }),
|
|
600
|
+
);
|
|
601
|
+
} catch (e) {
|
|
602
|
+
error = (e && e.message) || String(e);
|
|
603
|
+
}
|
|
604
|
+
const roots = sortDiffs(diffs.filter((d) => rootOf(d.path))).map((d) => ({
|
|
605
|
+
path: d.path,
|
|
606
|
+
label: labelOf(d.path),
|
|
607
|
+
from: formatValue(d.from),
|
|
608
|
+
to: formatValue(d.to),
|
|
609
|
+
}));
|
|
610
|
+
const counts = new Map();
|
|
611
|
+
for (const d of diffs) {
|
|
612
|
+
const c = categoryOf(d.path) || '其他';
|
|
613
|
+
counts.set(c, (counts.get(c) || 0) + 1);
|
|
614
|
+
}
|
|
615
|
+
const categories = [...counts.entries()]
|
|
616
|
+
.map(([name, count]) => ({ name, count }))
|
|
617
|
+
.sort((a, b) => b.count - a.count || a.name.localeCompare(b.name, 'zh-Hans-CN'));
|
|
618
|
+
return {
|
|
619
|
+
key: sw.key,
|
|
620
|
+
title: sw.title,
|
|
621
|
+
short: sw.short,
|
|
622
|
+
current,
|
|
623
|
+
alt,
|
|
624
|
+
currentLabel: sw.label(current),
|
|
625
|
+
altLabel: sw.label(alt),
|
|
626
|
+
total: diffs.length,
|
|
627
|
+
summary: error ? '' : summarize(diffs),
|
|
628
|
+
roots,
|
|
629
|
+
categories,
|
|
630
|
+
error,
|
|
631
|
+
};
|
|
632
|
+
});
|
|
633
|
+
return {
|
|
634
|
+
system,
|
|
635
|
+
switches: rows,
|
|
636
|
+
affected: rows.filter((r) => !r.error && r.total > 0).length,
|
|
637
|
+
total: rows.reduce((n, r) => n + r.total, 0),
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
|
|
566
641
|
const JU_METHODS = ['chaibu', 'chaoshen', 'zhirun'];
|
|
567
642
|
const TAROT_COUNTS = [1, 3, 5];
|
|
568
643
|
const LATE_ZI_MODES = ['same-day', 'next-day'];
|
|
@@ -1188,6 +1263,15 @@ export function renderText(result) {
|
|
|
1188
1263
|
if (extra) parts.push(extra);
|
|
1189
1264
|
}
|
|
1190
1265
|
if (result.cross) parts.push(`【八字 × 紫微 交叉验证】\n${crossText(result.cross)}`);
|
|
1266
|
+
if (result.caliber && Array.isArray(result.caliber.switches) && result.caliber.switches.length) {
|
|
1267
|
+
const c = result.caliber;
|
|
1268
|
+
parts.push('【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)\n'
|
|
1269
|
+
+ c.switches.map((s) => {
|
|
1270
|
+
if (s.error) return `· ${s.title}:未能对照(${s.error})`;
|
|
1271
|
+
if (!s.total) return `· ${s.title}:${s.currentLabel} → ${s.altLabel},本盘无变化`;
|
|
1272
|
+
return `· ${s.title}:${s.currentLabel} → ${s.altLabel}\n ${s.summary}`;
|
|
1273
|
+
}).join('\n'));
|
|
1274
|
+
}
|
|
1191
1275
|
if (result.followup) {
|
|
1192
1276
|
const f = result.followup;
|
|
1193
1277
|
parts.push(`【追问】${f.question}\n${f.answer}${f.evidence && f.evidence.length ? `\n 依据:${f.evidence.join(';')} 置信度:${f.confidence}` : ''}`);
|
|
@@ -15,10 +15,10 @@ export const KNOWLEDGE = [
|
|
|
15
15
|
id: 'bazi-yueling-siquan',
|
|
16
16
|
system: 'bazi', dims: ['overall', 'career'],
|
|
17
17
|
gist: '月令不是「一个月」,是当月最有权的那一个字。',
|
|
18
|
-
detail: '月令藏干按本气、中气、余气分日用事,本气当权的时间最长。所以判旺衰先看日主在月令是得令还是失令——得令者未看全局,已有三分底气。本插件按 30
|
|
19
|
-
source: '
|
|
18
|
+
detail: '月令藏干按本气、中气、余气分日用事,本气当权的时间最长。所以判旺衰先看日主在月令是得令还是失令——得令者未看全局,已有三分底气。本插件按 30 日表算出「生在本月第几日、哪一干当权」,给的是月内轮值这一层细节;旺衰与取格仍以月令本气、透干与会支为主,不随轮值改判。三命通会卷二·论人元司事另列一套日数(寅月五日/五日/二十日),与本插件取的通行表不同;原文并列,不改判。',
|
|
19
|
+
source: '《子平真诠》论用神;人元司权分日之说见《渊海子平》;三命通会卷二·论人元司事(典藏网 7529)另列一套日数',
|
|
20
20
|
status: 'variant',
|
|
21
|
-
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18 等多说);本插件固定通行 30 日表(如寅月戊7丙7甲16),节当日为第 1 日,第 31
|
|
21
|
+
note: '各家对中气、余气各主几日分法不同(有 7/7/16、9/3/18 等多说);本插件固定通行 30 日表(如寅月戊7丙7甲16),节当日为第 1 日,第 31 日以后按本气算、不硬分摊。三命通会此本寅月作 5/5/20、卯月作 7/23,与通行表不同,两表各照原样。司权表与本柱藏干表口径不同(子月壬、卯月甲、午月丙、酉月庚、亥月戊只出现在司权表里),两表各照原样;取格不随轮值改判。',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
id: 'bazi-tonggen-tougan',
|
|
@@ -66,10 +66,10 @@ export const KNOWLEDGE = [
|
|
|
66
66
|
id: 'bazi-suiyun',
|
|
67
67
|
system: 'bazi', dims: ['overall', 'career'],
|
|
68
68
|
gist: '大运管十年基调,流年管当年触发。',
|
|
69
|
-
detail: '
|
|
69
|
+
detail: '大运像换了条路,流年像这条路上某一段的天气。岁运并临(当值大运与流年干支相同)、运年反吟(大运与流年天克地冲)、大运伏吟(大运与原局某柱干支相同)、大运反吟(大运与原局某柱天克地冲)、流年伏吟(流年与原局某柱干支相同)、流年反吟(流年与原局某柱天克地冲),是传统上标记「变动较大」的年份,属于提示而非断语。本插件逐年标出六类信号:当值大运按该年立春到次年立春的区间取,交运落在年内时前后两步并列;大运与本命四柱的伏吟/反吟整步大运都在,会连续多年重复列出;只标干支重复与对冲,不折分数。原文里「返吟」指岁运与日柱相对、「伏吟」指岁运压日,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义,两者并列、不合并。',
|
|
70
70
|
source: '《三命通会》卷二·总论岁运(https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html);岁运并临之说出自《渊海子平》',
|
|
71
71
|
status: 'variant',
|
|
72
|
-
note: '
|
|
72
|
+
note: '「岁运并临主大凶」是流传最广也最被滥用的说法,本插件只作变动提示,不断吉凶;大运与本命四柱的伏吟/反吟会连续多年出现,不逐年加重;四柱十神层面的引化也未叠入。',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
id: 'bazi-liuqin',
|
|
@@ -239,6 +239,9 @@ export function buildPlain(r, ask, ctx = {}) {
|
|
|
239
239
|
const ys = (r.frame && r.frame.yongshen) || {};
|
|
240
240
|
const favor = join(ys.favor);
|
|
241
241
|
const avoid = join(ys.avoid);
|
|
242
|
+
const dis = Array.isArray(ys.disputed) && ys.disputed.length
|
|
243
|
+
? `有一点要说明:${ys.disputed.map((d) => d.element).join('、')}在扶抑里算${ys.disputed.map((d) => d.favorRole).join('、')}(能${ys.disputed.map((d) => d.favorVerb).join('、')}),按调候看又偏忌(${ys.disputed.map((d) => `${d.climate}盘忌${d.element}`).join('、')}),两派说法不一;实际用在什么时候,看季节和环境取舍,不必当成绝对的好或坏。`
|
|
244
|
+
: '';
|
|
242
245
|
const strength = STRENGTH_PLAIN[st.level] || '力量偏中性';
|
|
243
246
|
const tiaohou = ys.tiaohou && ys.tiaohou.note ? `另外,${ys.tiaohou.note},所以「暖一点、亮一点」的环境通常更舒服。` : '';
|
|
244
247
|
const sy = (r.liunian || []).find((l) => l.suiyun && Array.isArray(l.suiyun.signals) && l.suiyun.signals.length);
|
|
@@ -247,7 +250,7 @@ export function buildPlain(r, ask, ctx = {}) {
|
|
|
247
250
|
: '';
|
|
248
251
|
return `你的命局属于「${s(st.level, '中性')}」:${strength}。` +
|
|
249
252
|
`${favor ? `能补${favor}的环境(行业、方位、作息、相处的人)会让你省力;${avoid ? `而${avoid}偏重的场合容易空耗,能绕就绕。` : ''}` : ''}` +
|
|
250
|
-
tiaohou + syPlain;
|
|
253
|
+
dis + tiaohou + syPlain;
|
|
251
254
|
}
|
|
252
255
|
if (r.system === 'ziwei') {
|
|
253
256
|
const body = r.body || {};
|
package/engine/interpret.js
CHANGED
|
@@ -170,6 +170,7 @@ function baziInterpret(r) {
|
|
|
170
170
|
const level = pick(st, 'level', '中和');
|
|
171
171
|
const favor = Array.isArray(ys.favor) ? ys.favor : [];
|
|
172
172
|
const avoid = Array.isArray(ys.avoid) ? ys.avoid : [];
|
|
173
|
+
const disputed = Array.isArray(ys.disputed) ? ys.disputed : [];
|
|
173
174
|
const primary = pick(frame, 'primaryName', '未取定');
|
|
174
175
|
const gender = pick(r.input, 'gender', '');
|
|
175
176
|
const isMale = gender === 'male';
|
|
@@ -401,11 +402,13 @@ function baziInterpret(r) {
|
|
|
401
402
|
const nextSeg = ry.next ? `,第 ${ry.next.from} 日起交 ${ry.next.stem}${ry.next.element}` : '';
|
|
402
403
|
const outside = ry.inHidden ? '' : ` 表里的 ${ry.active} 不在本柱藏干表中(属余气口径),两表各照原样,不互相改写。`;
|
|
403
404
|
const beyond = ry.beyond ? ' 你生在第 31 日以后,已超出 30 日表,按本气算,不硬分摊。' : '';
|
|
405
|
+
const ryc = r.renyuanClassic || classicOf('smt-renyuan');
|
|
406
|
+
const src = ryc ? `\n原文:《${CLASSIC_BOOKS[ryc.book].name}·${ryc.chapter}》「${ryc.quote}」\n白话:${ryc.plain}` : '';
|
|
404
407
|
return {
|
|
405
408
|
key: 'renyuan', label: '人元司权',
|
|
406
409
|
text: `生于${ry.month}月第 ${ry.day} 日(从${ry.term ? ry.term.name : '节'}起算,节当日为第 1 日,日差按本盘所用时刻所在日计):这一日由 **${ry.active}${ry.activeElement}** 司权,第 ${ry.segment.from}–${ry.segment.to} 日属它${nextSeg}。\n`
|
|
407
410
|
+ '月令这一个月里,余气、中气、本气轮值,不是整月同一个五行当值——所以「月令是什么」,还要看生在第几日。\n'
|
|
408
|
-
+
|
|
411
|
+
+ `**口径**:本插件固定通行 30 日表(${table});另有 7/7/16、9/3/18 等分法,三命通会此本又作 5/5/20(见下原文),各家不一。分日只作解释层的一层细节,**不改取格**:取格仍按本气、透干与会支判定。${outside}${beyond}` + src,
|
|
409
412
|
};
|
|
410
413
|
})()] : []),
|
|
411
414
|
{
|
|
@@ -437,8 +440,8 @@ function baziInterpret(r) {
|
|
|
437
440
|
const stem = (l.suiyun.dayun || []).map((d) => `第${d.step}步${d.ganzhi}`).join('、');
|
|
438
441
|
return `${l.year} ${l.ganzhi}(${stem || '未到起运'}):${l.suiyun.signals.map((s) => s.detail).join(';')}`;
|
|
439
442
|
}).join('\n') +
|
|
440
|
-
'\n
|
|
441
|
-
: '
|
|
443
|
+
'\n读法:岁运并临、运年反吟、大运与流年的伏吟/反吟只说明干支层面重复或对冲,传统上当作「变动感较强」的信号;本插件不据此判吉凶,要落到具体年份,仍看该年是否动到用神。大运与本命四柱的伏吟/反吟整步大运都在,会连续多年出现,不当成逐年加重。' + src
|
|
444
|
+
: '近十年没有岁运并临、运年反吟或大运/流年伏吟、反吟。「岁运并临主大凶」这类说法流传很广,本插件只把它当变动提示,没有命中就不作额外解读。',
|
|
442
445
|
};
|
|
443
446
|
})(),
|
|
444
447
|
{
|
|
@@ -475,7 +478,7 @@ function baziInterpret(r) {
|
|
|
475
478
|
...(cli ? [{
|
|
476
479
|
key: 'climate', label: '寒暖燥湿',
|
|
477
480
|
text: `${cli.narration}${cli.need
|
|
478
|
-
? `调候取${cli.need.stem}${cli.need.element},忌${cli.avoidElement};${cli.clash ? '与扶抑冲突,本盘以调候为先' : '与扶抑同向'}`
|
|
481
|
+
? `调候取${cli.need.stem}${cli.need.element},忌${cli.avoidElement}${disputed.some((d) => d.element === cli.avoidElement) ? '(有争议:该行在扶抑中为喜,见用神节)' : ''};${cli.clash ? '与扶抑冲突,本盘以调候为先' : disputed.some((d) => d.element === cli.avoidElement) ? '调候所忌在扶抑里为喜,两说并存' : '与扶抑同向'}`
|
|
479
482
|
: '气候平和,调候不作主取'}。`,
|
|
480
483
|
}] : []),
|
|
481
484
|
...(ys.qt ? [{
|
|
@@ -1703,7 +1706,7 @@ const BUILDERS = {
|
|
|
1703
1706
|
import { interpretQimen } from './qimen-interpret.js';
|
|
1704
1707
|
import { buildAnswer, buildPlain, buildGlossary, buildFollowups, dimensionPlain } from './interpret-plain.js';
|
|
1705
1708
|
import { knowledgeFor, caveatsFor, STATUS_LABEL } from './interpret-knowledge.js';
|
|
1706
|
-
import { CLASSIC_BOOKS, suiyunClassicOf } from './classics.js';
|
|
1709
|
+
import { CLASSIC_BOOKS, suiyunClassicOf, classicOf } from './classics.js';
|
|
1707
1710
|
|
|
1708
1711
|
/**
|
|
1709
1712
|
* 给任意体系的解析结果补上「白话四层」:直答 / 说人话 / 每维一句话 / 追问建议。
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Host 半:把排盘引擎注册成一个模型可调用的工具。
|
|
3
3
|
* 纯计算;唯一的网络行为是按需把地址解析成经度(失败即退回内置坐标表)。
|
|
4
4
|
*/
|
|
5
|
-
import { compute, renderText, geocodeAddress } from './engine/index.js';
|
|
5
|
+
import { compute, renderText, geocodeAddress, caliberCompare } from './engine/index.js';
|
|
6
6
|
import { createLru } from './engine/lru.js';
|
|
7
7
|
import { cacheMetrics } from './engine/calendar.js';
|
|
8
8
|
|
|
@@ -98,7 +98,13 @@ export function apply(ctx) {
|
|
|
98
98
|
&& next.fortuneYear === undefined) {
|
|
99
99
|
next.fortuneYear = now.getFullYear();
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
const out = compute(next);
|
|
102
|
+
// 显式要求时才做口径对照:每次要额外排 2–3 张盘,默认不付这笔开销
|
|
103
|
+
if (next.diff === true) {
|
|
104
|
+
const cmp = caliberCompare(next);
|
|
105
|
+
if (cmp.switches.length) out.caliber = cmp;
|
|
106
|
+
}
|
|
107
|
+
return out;
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
const definition = {
|
|
@@ -208,6 +214,10 @@ export function apply(ctx) {
|
|
|
208
214
|
type: 'boolean',
|
|
209
215
|
description: '八字 / 紫微专用:为同一份出生信息再排另一套盘,返回「八字 × 紫微 交叉验证」(同向 / 有张力 / 互补),不合并数值。',
|
|
210
216
|
},
|
|
217
|
+
diff: {
|
|
218
|
+
type: 'boolean',
|
|
219
|
+
description: '口径对照(bazi / ziwei / qimen):同一组输入分别按当前口径与另一档各排一次,列出根因字段(如日柱、命宫、局数)与连带变化数。只列差异,不判哪套口径更准,也不改盘面。',
|
|
220
|
+
},
|
|
211
221
|
verifyPast: {
|
|
212
222
|
type: 'number',
|
|
213
223
|
description: '验前事(仅八字):传年数(如 6),返回过去 N 年的流年信号行,供用户勾选「准/不准」并算贴合度;只读,不改盘。',
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-metaphysics",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.5",
|
|
4
4
|
"type": "module",
|
|
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, 391-char name library with per-character pinyin, Kangxi stroke counts, five-grid (五格/三才) analysis and mechanical phonetics checks, 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 (闰月按日切分/整月归次月/整月归本月)
|
|
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, 391-char name library with per-character pinyin, Kangxi stroke counts, five-grid (五格/三才) analysis and mechanical phonetics checks, 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 (闰月按日切分/整月归次月/整月归本月) nine school switches (亮度/庚干四化/天马/天空/截空旬空/魁钺/天伤天使/长生/晚子时) for ziwei, caliber diffs for bazi/ziwei/qimen (same inputs, one switch, root-field changes), and a bundled offline single-file page (命理排盘.html), and a panel-to-chat handoff that asks the Harness about a finished chart.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"玄学",
|
|
8
8
|
"玄学排盘",
|