dsh-metaphysics 0.50.1 → 0.55.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/engine/shensha.js CHANGED
@@ -5,6 +5,7 @@
5
5
  // · 命中按柱记录,同时给出按类别归并的 chart 级视图,供 UI 分组展示。
6
6
  // 神煞只作参考,不可直接断吉凶——吉凶仍须看格局、旺衰、行运。
7
7
  import { BRANCHES } from './calendar.js';
8
+ import { sanheGroupOf } from './sanhe.js';
8
9
 
9
10
  export const PILLAR_KEYS = ['year', 'month', 'day', 'hour'];
10
11
  export const PILLAR_LABEL = { year: '年柱', month: '月柱', day: '日柱', hour: '时柱' };
@@ -14,9 +15,11 @@ const STEMS_LIST = ['甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬
14
15
  const STEM_VIA = { year: '年干', month: '月干', day: '日干', hour: '时干' };
15
16
  const BRANCH_VIA = { year: '年支', month: '月支', day: '日支', hour: '时支' };
16
17
 
17
- // 三合局(将星、驿马、桃花等以年支、日支双查)
18
- const SANHE = { 寅午戌: ['寅', '午', '戌'], 申子辰: ['申', '子', '辰'], 巳酉丑: ['巳', '酉', '丑'], 亥卯未: ['亥', '卯', '未'] };
19
- const trioKey = (b) => Object.keys(SANHE).find((k) => SANHE[k].includes(b));
18
+ // 三合局(将星、驿马、桃花等以年支、日支双查):成员表统一从 sanhe.js 取,避免两处分写走散
19
+ const trioKey = (b) => {
20
+ const g = sanheGroupOf(b);
21
+ return g ? g.branches.join('') : undefined;
22
+ };
20
23
  // 方局(孤辰、寡宿以年支查)
21
24
  const FANGJU = { 亥子丑: ['寅', '戌'], 寅卯辰: ['巳', '丑'], 巳午未: ['申', '辰'], 申酉戌: ['亥', '未'] };
22
25
  const fangjuKey = (b) => Object.keys(FANGJU).find((k) => k.includes(b));
@@ -0,0 +1,270 @@
1
+ // A1 推导链:把排盘过程中真正用到的中间层摊开,每层给
2
+ // { field, rule, inputs, result, source }。
3
+ //
4
+ // 只读结果、不重算、不读时间与随机:trace 开着或关掉,盘面必须逐字节一致。
5
+ // 目前覆盖六爻(纳甲→六亲→世应→伏神→旺衰)、八字(旺衰分值、格局取用)
6
+ // 与紫微(格局命中条件);其余体系不产出 trace。
7
+ import { PATTERN_TONE } from './ziwei.js';
8
+ import { yongshenOf, yongshenStrength, fushenAccess } from './liuyao.js';
9
+
10
+ const SYSTEM_LABEL = { liuyao: '六爻', bazi: '八字', ziwei: '紫微' };
11
+
12
+ const text = (v, fallback = '—') => {
13
+ if (v === undefined || v === null || v === '') return fallback;
14
+ return String(v);
15
+ };
16
+ const list = (v, fallback = '—') => (Array.isArray(v) ? v.filter((x) => x !== undefined && x !== null && x !== '').join('、') : '') || fallback;
17
+ const pairs = (rows) => rows.map(([label, value]) => ({ label: String(label), value: text(value) }));
18
+ const step = (key, field, rule, inputs, result, source) => ({
19
+ key,
20
+ field,
21
+ rule: text(rule, ''),
22
+ inputs: pairs(inputs),
23
+ result: text(result, ''),
24
+ source: text(source, ''),
25
+ });
26
+
27
+ function lineAt(lines, position) {
28
+ return (Array.isArray(lines) ? lines : []).find((l) => l.position === position) || null;
29
+ }
30
+
31
+ function liuyaoTrace(r, opts = {}) {
32
+ const ben = r.ben && typeof r.ben === 'object' ? r.ben : {};
33
+ const lines = Array.isArray(ben.lines) ? ben.lines : [];
34
+ const bian = r.bian && typeof r.bian === 'object' ? r.bian : null;
35
+ const moving = Array.isArray(r.cast && r.cast.movingPositions) ? r.cast.movingPositions : [];
36
+ const ug = r.useGod && typeof r.useGod === 'object' ? r.useGod : null;
37
+ const direction = (ug && ug.direction) || opts.direction || 'general';
38
+ const us = r.useGodStrength && typeof r.useGodStrength === 'object' ? r.useGodStrength : null;
39
+ const hs = r.hexStrength && typeof r.hexStrength === 'object' ? r.hexStrength : null;
40
+ const fa = r.fushenAccess && typeof r.fushenAccess === 'object' ? r.fushenAccess : null;
41
+ const shi = lineAt(lines, ben.shi);
42
+ const ying = lineAt(lines, ben.ying);
43
+ const month = (us && us.month) || (hs && hs.month) || null;
44
+ const day = (us && us.day) || (hs && hs.day) || null;
45
+
46
+ const najia = step(
47
+ 'najia',
48
+ '纳甲',
49
+ '京房纳甲:八经卦各配天干与三爻地支,内卦取前三爻、外卦取后三爻;动爻再成变卦。',
50
+ [
51
+ ['本卦', `${text(ben.name)}(上${text(ben.upper)}·下${text(ben.lower)})`],
52
+ ['动爻', moving.length ? `${moving.join('、')}爻` : '无(静卦)'],
53
+ ['变卦', bian ? `${text(bian.name)}(上${text(bian.upper)}·下${text(bian.lower)})` : '无'],
54
+ ],
55
+ lines.map((l) => `${l.position}爻 ${text(l.ganzhi)}${text(l.element)}`).join('|'),
56
+ '京房纳甲诀;engine/liuyao.js · NAJIA',
57
+ );
58
+
59
+ const liuqin = step(
60
+ 'liuqin',
61
+ '六亲',
62
+ '以卦宫五行为「我」:同我为兄弟、生我为父母、我生为子孙、克我为官鬼、我克为妻财。',
63
+ [
64
+ ['卦宫', `${text(ben.palace)}(${text(ben.palaceElement)})`],
65
+ ['爻五行', list([...new Set(lines.map((l) => l.element))])],
66
+ ['日干起六神', `${text(r.dayGanZhi && r.dayGanZhi.stem)}日`],
67
+ ],
68
+ lines.map((l) => `${l.position}爻 ${text(l.liuqin)}(${text(l.element)})`).join('|'),
69
+ '五行生克;engine/liuyao.js · liuqin()',
70
+ );
71
+
72
+ const shiying = step(
73
+ 'shiying',
74
+ '世应',
75
+ '八宫首卦世在上爻,一世至五世依次初至五爻,游魂四爻、归魂三爻;应爻与世相隔三位。',
76
+ [
77
+ ['卦名', `${text(ben.name)}(${text(ben.palace)})`],
78
+ ['世位', `${text(ben.shi)}爻`],
79
+ ['应位', `${text(ben.ying)}爻`],
80
+ ],
81
+ `${text(ben.shi)}爻${shi ? ` ${text(shi.liuqin)}·${text(shi.ganzhi)}${text(shi.element)}` : ''}为世,`
82
+ + `${text(ben.ying)}爻${ying ? ` ${text(ying.liuqin)}·${text(ying.ganzhi)}${text(ying.element)}` : ''}为应`,
83
+ '八宫世应诀;engine/liuyao.js · SHI_POSITION',
84
+ );
85
+
86
+ let fushen;
87
+ if (!ug || !ug.liuqin) {
88
+ const why = direction === 'general'
89
+ ? '未选询问方向(当前为综合),未取用神'
90
+ : '未取到用神';
91
+ fushen = step(
92
+ 'fushen',
93
+ '伏神',
94
+ '用神不上卦时,回本宫首卦的同位取伏神;飞伏之间只判生克与助压。',
95
+ [['用神', ug && ug.ask ? ug.ask : '未取']],
96
+ `${why};本层不适用。`,
97
+ 'engine/liuyao.js · yongshenOf()',
98
+ );
99
+ } else if (ug.missing) {
100
+ const hidden = (ug.fushen || []).map((f) => {
101
+ const fei = f.fei ? `${text(f.fei.ganzhi)}${text(f.fei.element)}(${text(f.fei.liuqin)})` : '—';
102
+ return `${f.position}爻 ${text(f.ganzhi)}${text(f.element)}(${text(f.liuqin)}),飞神 ${fei},${text(f.relation)}`;
103
+ }).join(';');
104
+ const access = fa && Array.isArray(fa.items)
105
+ ? fa.items.map((i) => `${i.position}爻${text(i.verdict)}`).join('、')
106
+ : '';
107
+ fushen = step(
108
+ 'fushen',
109
+ '伏神',
110
+ '用神不上卦时,回本宫首卦的同位取伏神;飞伏之间只判生克,再叠月建日辰给出伏条件,不换算应期。',
111
+ [
112
+ ['用神', `${ug.liuqin}(不上卦)`],
113
+ ['伏位', list((ug.fushen || []).map((f) => `${f.position}爻`))],
114
+ ['月建 / 日辰', `${text(month && month.branch)} / ${text(day && day.branch)}`],
115
+ ],
116
+ `${hidden || '本卦无此六亲,首卦同位也未取到伏神'}${access ? `;出伏:${access}` : ''}`,
117
+ '本宫首卦取伏;engine/liuyao.js · fushenAccess()',
118
+ );
119
+ } else {
120
+ fushen = step(
121
+ 'fushen',
122
+ '伏神',
123
+ '用神已在卦上时不取伏神;伏神层只在本卦找不到用神时启用。',
124
+ [
125
+ ['用神', ug.liuqin],
126
+ ['在位', list((ug.found || []).map((l) => `${l.position}爻`))],
127
+ ],
128
+ `用神 ${ug.liuqin} 已在 ${list((ug.found || []).map((l) => `${l.position}爻`))},无需伏神。`,
129
+ 'engine/liuyao.js · yongshenOf()',
130
+ );
131
+ }
132
+
133
+ const useStrength = us && Array.isArray(us.lines)
134
+ ? us.lines.map((l) => `${l.position}爻${text(l.branch)}${text(l.element)}:月${text(l.monthState)}·${text(l.dayRelation)}`).join(';')
135
+ : '';
136
+ const wangsheng = step(
137
+ 'wangsheng',
138
+ '旺衰',
139
+ '月建主这一段的旺衰(旺相休囚死),日辰看当天的生克扶压;只给状态标签,不折分数、不单独断吉凶。',
140
+ [
141
+ ['月建', month ? `${text(month.branch)}(${text(month.element)})` : '缺'],
142
+ ['日辰', day ? `${text(day.branch)}(${text(day.element)})` : '缺'],
143
+ ['用神', ug && ug.liuqin ? ug.liuqin : '未取'],
144
+ ['旬空', list(r.xunKong)],
145
+ ],
146
+ [
147
+ useStrength ? `用神:${useStrength}${us.labels && us.labels.length ? `(${us.labels.join('、')})` : ''}` : '用神:未取,只看全卦',
148
+ hs && hs.labels && hs.labels.length ? `全卦:${hs.labels.join('、')}` : '',
149
+ ].filter(Boolean).join(';'),
150
+ '月建主旺衰、日辰司生克;engine/liuyao.js · yongshenStrength / hexagramStrength',
151
+ );
152
+
153
+ return [najia, liuqin, shiying, fushen, wangsheng];
154
+ }
155
+
156
+ function baziTrace(r) {
157
+ const s = r.strength && typeof r.strength === 'object' ? r.strength : {};
158
+ const parts = s.parts && typeof s.parts === 'object' ? s.parts : {};
159
+ const season = parts.season && typeof parts.season === 'object' ? parts.season : {};
160
+ const frame = r.frame && typeof r.frame === 'object' ? r.frame : {};
161
+ const ys = frame.yongshen && typeof frame.yongshen === 'object' ? frame.yongshen : {};
162
+ const primary = frame.primary && typeof frame.primary === 'object' ? frame.primary : null;
163
+ const climate = r.climate && typeof r.climate === 'object' ? r.climate : {};
164
+ const godGroups = frame.godStats && frame.godStats.groups ? frame.godStats.groups : {};
165
+
166
+ const strength = step(
167
+ 'strength',
168
+ '旺衰分值',
169
+ text(s.method, '月令权重 + 地支藏干通根 + 天干帮扶,量化后分档。'),
170
+ [
171
+ ['日主', r.dayMaster ? `${text(r.dayMaster.stem)}(${text(r.dayMaster.element)})` : '—'],
172
+ ['月令', `${text(season.branch)}(${text(season.element)}·${text(season.word)},权重 ${text(season.weight)})`],
173
+ ['通根', `${list(parts.roots)}(${text(parts.rootScore)})`],
174
+ ['天干帮扶 / 耗泄', `帮 ${list(parts.helpers)};泄 ${list(parts.drainers)}(${text(parts.helpScore)})`],
175
+ ],
176
+ `${text(s.level)}(${text(s.score)} 分):${text(s.detail)}`,
177
+ 'engine/bazi.js · 旺衰量化(月令权重 + 藏干通根 + 天干帮扶)',
178
+ );
179
+
180
+ const primaryName = text(frame.primaryName || (primary && primary.name), '未取格局');
181
+ const extraGeju = list((frame.geju || []).map((g) => g && g.name).filter((name) => name && name !== primaryName), '');
182
+ const favor = list(ys.favor);
183
+ const avoid = list(ys.avoid);
184
+ const disputed = list((ys.disputed || []).map((d) => d && d.element), '');
185
+ const tiaohou = ys.tiaohou && typeof ys.tiaohou === 'object' ? ys.tiaohou : climate;
186
+ const need = tiaohou && tiaohou.need ? tiaohou.need : null;
187
+ const resultParts = [
188
+ primaryName === '未取格局' ? primaryName : `主格 ${primaryName}${extraGeju ? `;兼格 ${extraGeju}` : ''}`,
189
+ `喜 ${favor},忌 ${avoid}`,
190
+ disputed ? `有争议 ${disputed}` : '',
191
+ tiaohou && tiaohou.kind
192
+ ? `调候 ${text(tiaohou.kind)}${need && need.element ? `,取 ${text(need.element)}` : ''}${tiaohou.avoidElement && tiaohou.avoidElement !== '—' ? `,忌 ${text(tiaohou.avoidElement)}` : ''}`
193
+ : '',
194
+ ].filter(Boolean).join(';');
195
+
196
+ const geju = step(
197
+ 'geju',
198
+ '格局取用',
199
+ text(ys.method, '先按月令与透干取格,再以扶抑为主、调候校验取用。'),
200
+ [
201
+ ['月令格', primary ? `${text(primary.name)}(${text(primary.kind)})` : '—'],
202
+ ['取格依据', primary ? text(primary.evidence) : '—'],
203
+ ['十神分量', Object.entries(godGroups).map(([k, v]) => `${k}${v}`).join(' / ') || '—'],
204
+ ['调候', tiaohou && tiaohou.kind ? `${text(tiaohou.kind)}${need && need.element ? ` → ${text(need.element)}` : ''}` : '—'],
205
+ ],
206
+ `${resultParts}`,
207
+ '子平真诠 · 月令取格;engine/geju.js · yongshenOf()',
208
+ );
209
+
210
+ return [strength, geju];
211
+ }
212
+
213
+ function ziweiTrace(r) {
214
+ const patterns = Array.isArray(r.patterns) ? r.patterns : [];
215
+ const total = Object.keys(PATTERN_TONE).length;
216
+ const soul = r.soul && typeof r.soul === 'object' ? r.soul : {};
217
+ const bureau = r.bureau && typeof r.bureau === 'object' ? r.bureau : {};
218
+ const hit = patterns.map((p) => `${text(p.name)}:${text(p.evidence)}`).join(';');
219
+ return [step(
220
+ 'patterns',
221
+ '格局命中条件',
222
+ `已收录 ${total} 条格局,逐条校验命宫三方四正的星曜组合;只判结构成立与否,不折吉凶。`,
223
+ [
224
+ ['命宫', text(soul.ganzhi)],
225
+ ['五行局', text(bureau.name)],
226
+ ['命主 / 身主', `${text(r.lifeMaster)} / ${text(r.bodyMaster)}`],
227
+ ['命中数', `${patterns.length} / ${total}`],
228
+ ],
229
+ patterns.length ? `命中 ${patterns.length} 条:${hit}` : '未命中已收录的格局条件(不表示命盘无结构,只是不在已收录清单内)。',
230
+ '紫微斗数全书 · 格局条件;engine/ziwei.js · detectPatterns()',
231
+ )];
232
+ }
233
+
234
+ /**
235
+ * @param {object} result compute 的结果
236
+ * @param {{direction?:string, gender?:string, refresh?:boolean}} [opts]
237
+ * refresh=true 时按当前询问方向重算六爻的用神 / 旺衰 / 伏神层(只重建 trace,不改盘面)
238
+ * @returns {Array<{key:string, field:string, rule:string, inputs:Array<{label:string,value:string}>, result:string, source:string}>|null}
239
+ */
240
+ export function buildTrace(result, opts = {}) {
241
+ if (!result || typeof result !== 'object') return null;
242
+ let layers = null;
243
+ if (result.system === 'liuyao') {
244
+ let view = result;
245
+ // 面板改了「询问方向」但不想重摇一卦:只按新方向重算用神相关三层
246
+ if (opts.refresh === true) {
247
+ try {
248
+ const ug = yongshenOf(result, { direction: opts.direction, gender: opts.gender });
249
+ const monthBranch = (result.hexStrength && result.hexStrength.month && result.hexStrength.month.branch)
250
+ || (result.useGodStrength && result.useGodStrength.month && result.useGodStrength.month.branch)
251
+ || null;
252
+ const dayBranch = result.dayGanZhi ? result.dayGanZhi.branch : null;
253
+ if (ug.liuqin) {
254
+ const us = yongshenStrength(result, ug, { monthBranch, dayBranch });
255
+ const fa = fushenAccess(result, ug, { monthBranch, dayBranch });
256
+ view = { ...result, useGod: ug, useGodStrength: us || undefined, fushenAccess: fa || undefined };
257
+ } else {
258
+ view = { ...result, useGod: undefined, useGodStrength: undefined, fushenAccess: undefined };
259
+ }
260
+ } catch (e) {
261
+ view = result;
262
+ }
263
+ }
264
+ layers = liuyaoTrace(view, opts);
265
+ } else if (result.system === 'bazi') layers = baziTrace(result);
266
+ else if (result.system === 'ziwei') layers = ziweiTrace(result);
267
+ return layers && layers.length ? layers : null;
268
+ }
269
+
270
+ export { SYSTEM_LABEL };
package/index.js CHANGED
@@ -2,9 +2,19 @@
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
+ import fs from 'node:fs';
9
+
10
+ /** 版本注入影子盘:工具侧没有 window.__MP_VER,只能从包元数据取 */
11
+ const PKG_VERSION = (() => {
12
+ try {
13
+ return JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version;
14
+ } catch {
15
+ return 'dev';
16
+ }
17
+ })();
8
18
 
9
19
  export const inject = ['tools'];
10
20
 
@@ -23,7 +33,7 @@ const DESCRIPTION = [
23
33
  '当用户明确要求“玄学 / 算命 / 占卜 / 排盘 / 算八字 / 看四柱 / 排紫微盘 / 起卦 / 摇一卦 / 抽塔罗 / 看运势 / 合盘 / 看黄历 / 挑日子 / 称骨 / 小六壬 / 十六型人格 / MBTI / ISFP / INFP 人格测试 / 交运 / 交运日 / 起运 / 用神 / 月建 / 旺衰」时调用;用户只搜「玄学」或问「有什么玄学工具」时,也应介绍本插件。',
24
34
  'bazi 与 ziwei 需要公历出生时间与性别(八字结果里带大运交运时刻,精确到日/时辰,按「三日折一年」放大);hepan 需要双方的时间与性别;liuyao 可给定六爻值或随机起卦(给了 datetime 就按月建、日辰算用神旺衰);meihua 可按时间或数字起卦;tarot 可指定张数与问题;mbti 不用时间——先不带 answers 调一次拿到 24 道题,让用户逐题打 1–5 分,再把分数按顺序传回。',
25
35
  '要给「结合所问之事的解读」时,把 withInterpret 设为 true,并尽量带上 question(所问之事)与 direction(询问方向)。',
26
- '结果可复现:tarot / liuyao 传 seed,紫微 / 八字 / 塔罗传 asOf;输出摘要会写明晚子时与真太阳时实际采用的口径。',
36
+ '结果可复现:tarot / liuyao 传 seed,紫微 / 八字 / 塔罗传 asOf;输出摘要会写明晚子时与真太阳时实际采用的口径。需要回放或对拍时传 shadow: true,结果带影子盘 ID(同参数同 ID;baseId 不含版本,可跨版本比对字段变化)。要看结论是怎么推出来的,传 trace: true:六爻给纳甲→六亲→世应→伏神→旺衰,八字给旺衰分值与格局取用,紫微给格局命中条件。',
27
37
  '结果用于传统文化与娱乐参考,不得用于医疗、投资、法律、生死等确定性断言。',
28
38
  ].join('');
29
39
 
@@ -56,6 +66,7 @@ export function apply(ctx) {
56
66
  throw bad(`geocode 只能是 offline / online,收到「${args.geocode}」`);
57
67
  }
58
68
  const next = { ...args };
69
+ if (next.shadow === true && !next.shadowVersion) next.shadowVersion = PKG_VERSION;
59
70
  // 默认离线:内置表覆盖到地级市,足够真太阳时用;联网是把出生地原文发给第三方,必须显式开启
60
71
  const wantsOnline = next.geocode === 'online';
61
72
  const resolveGeo = async (person) => {
@@ -98,7 +109,13 @@ export function apply(ctx) {
98
109
  && next.fortuneYear === undefined) {
99
110
  next.fortuneYear = now.getFullYear();
100
111
  }
101
- return compute(next);
112
+ const out = compute(next);
113
+ // 显式要求时才做口径对照:每次要额外排 2–3 张盘,默认不付这笔开销
114
+ if (next.diff === true) {
115
+ const cmp = caliberCompare(next);
116
+ if (cmp.switches.length) out.caliber = cmp;
117
+ }
118
+ return out;
102
119
  }
103
120
 
104
121
  const definition = {
@@ -208,6 +225,18 @@ export function apply(ctx) {
208
225
  type: 'boolean',
209
226
  description: '八字 / 紫微专用:为同一份出生信息再排另一套盘,返回「八字 × 紫微 交叉验证」(同向 / 有张力 / 互补),不合并数值。',
210
227
  },
228
+ diff: {
229
+ type: 'boolean',
230
+ description: '口径对照(bazi / ziwei / qimen):同一组输入分别按当前口径与另一档各排一次,列出根因字段(如日柱、命宫、局数)与连带变化数。只列差异,不判哪套口径更准,也不改盘面。',
231
+ },
232
+ shadow: {
233
+ type: 'boolean',
234
+ description: '影子盘:为结果附一个短 ID。同一组归一化参数在任何参数顺序下得到同一 ID;baseId 不含版本,跨版本复用 baseId 即可自动 diff 字段变化。写回、对拍、回放时使用,默认 false。',
235
+ },
236
+ trace: {
237
+ type: 'boolean',
238
+ description: '推导链:六爻返回纳甲→六亲→世应→伏神→旺衰,八字返回旺衰分值与格局取用,紫微返回格局命中条件。每层含 field / rule / inputs / result / source;只读盘面,不重算、不改盘。默认 false。',
239
+ },
211
240
  verifyPast: {
212
241
  type: 'number',
213
242
  description: '验前事(仅八字):传年数(如 6),返回过去 N 年的流年信号行,供用户勾选「准/不准」并算贴合度;只读,不改盘。',
package/package.json CHANGED
@@ -1,106 +1,112 @@
1
- {
2
- "name": "dsh-metaphysics",
3
- "version": "0.50.1",
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 (闰月按日切分/整月归次月/整月归本月) and nine school switches (亮度/庚干四化/天马/天空/截空旬空/魁钺/天伤天使/长生/晚子时) for ziwei, and a bundled offline single-file page (命理排盘.html), and a panel-to-chat handoff that asks the Harness about a finished chart.",
6
- "keywords": [
7
- "玄学",
8
- "玄学排盘",
9
- "算命",
10
- "占卜",
11
- "运势",
12
- "传统命理",
13
- "dsh-plugin",
14
- "dsh-bundle",
15
- "dsh-market",
16
- "metaphysics",
17
- "bazi",
18
- "four-pillars",
19
- "ziwei",
20
- "ziwei-doushu",
21
- "liuyao",
22
- "tarot",
23
- "divination",
24
- "命理",
25
- "命理排盘",
26
- "八字",
27
- "四柱",
28
- "神煞",
29
- "紫微斗数",
30
- "六爻",
31
- "塔罗",
32
- "meihua-yishu",
33
- "da-liu-ren",
34
- "大六壬",
35
- "梅花易数",
36
- "almanac",
37
- "黄历",
38
- "择日",
39
- "称骨",
40
- "小六壬",
41
- "feng-shui",
42
- "风水",
43
- "起名",
44
- "numerology",
45
- "生命数字",
46
- "horoscope",
47
- "星座"
48
- ],
49
- "license": "MIT",
50
- "author": "xuanfu-web",
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/xuanfu-web/dsh-metaphysics.git"
54
- },
55
- "homepage": "https://github.com/xuanfu-web/dsh-metaphysics#readme",
56
- "bugs": {
57
- "url": "https://github.com/xuanfu-web/dsh-metaphysics/issues"
58
- },
59
- "engines": {
60
- "node": ">=18",
61
- "dsh": ">=0.2.0"
62
- },
63
- "scripts": {
64
- "build": "node tools/build-client.mjs",
65
- "build:html": "node tools/build-html.mjs",
66
- "build:desktop": "node tools/build-html.mjs --desktop",
67
- "test": "node tools/test-all.mjs",
68
- "test:ci": "node tools/build-client.mjs && node tools/check-bundle.mjs && node tools/test-all.mjs && node tools/check-assertions.mjs && node tools/verify-tests-can-fail.mjs && node tools/check-html-sinks.mjs && node tools/check-patterns.mjs",
69
- "test:baseline": "node tools/check-assertions.mjs --update",
70
- "check:html": "node tools/check-html-sinks.mjs",
71
- "check:bundle": "node tools/check-bundle.mjs",
72
- "check:patterns": "node tools/check-patterns.mjs",
73
- "release": "node tools/release.mjs"
74
- },
75
- "exports": {
76
- ".": "./index.js",
77
- "./client": "./client.js",
78
- "./package.json": "./package.json",
79
- "./locale/*.json": "./locale/*.json",
80
- "./icon": "./icon.svg",
81
- "./命理排盘.html": "./命理排盘.html"
82
- },
83
- "files": [
84
- "index.js",
85
- "client.js",
86
- "命理排盘.html",
87
- "engine",
88
- "cordis.patch.yml",
89
- "locale/*.json",
90
- "icon.svg",
91
- "README.md",
92
- "CHANGELOG.md",
93
- "docs/assets",
94
- "LICENSE"
95
- ],
96
- "dsh": {
97
- "bundle": {
98
- "patch": "./cordis.patch.yml"
99
- },
100
- "client": {
101
- "platform": "web",
102
- "immediately": true,
103
- "inject": []
104
- }
105
- }
106
- }
1
+ {
2
+ "name": "dsh-metaphysics",
3
+ "version": "0.55.0",
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 (闰月按日切分/整月归次月/整月归本月) nine school switches (亮度/庚干四化/天马/天空/截空旬空/魁钺/天伤天使/长生/晚子时) for ziwei, 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
+ "keywords": [
7
+ "玄学",
8
+ "玄学排盘",
9
+ "算命",
10
+ "占卜",
11
+ "运势",
12
+ "传统命理",
13
+ "dsh-plugin",
14
+ "dsh-bundle",
15
+ "dsh-market",
16
+ "metaphysics",
17
+ "bazi",
18
+ "four-pillars",
19
+ "ziwei",
20
+ "ziwei-doushu",
21
+ "liuyao",
22
+ "tarot",
23
+ "divination",
24
+ "命理",
25
+ "命理排盘",
26
+ "八字",
27
+ "四柱",
28
+ "神煞",
29
+ "紫微斗数",
30
+ "六爻",
31
+ "塔罗",
32
+ "meihua-yishu",
33
+ "da-liu-ren",
34
+ "大六壬",
35
+ "梅花易数",
36
+ "almanac",
37
+ "黄历",
38
+ "择日",
39
+ "称骨",
40
+ "小六壬",
41
+ "feng-shui",
42
+ "风水",
43
+ "起名",
44
+ "numerology",
45
+ "生命数字",
46
+ "horoscope",
47
+ "星座"
48
+ ],
49
+ "license": "MIT",
50
+ "author": "xuanfu-web",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/xuanfu-web/dsh-metaphysics.git"
54
+ },
55
+ "homepage": "https://github.com/xuanfu-web/dsh-metaphysics#readme",
56
+ "bugs": {
57
+ "url": "https://github.com/xuanfu-web/dsh-metaphysics/issues"
58
+ },
59
+ "engines": {
60
+ "node": ">=18",
61
+ "dsh": ">=0.2.0"
62
+ },
63
+ "scripts": {
64
+ "build": "node tools/build-client.mjs",
65
+ "build:html": "node tools/build-html.mjs",
66
+ "build:desktop": "node tools/build-html.mjs --desktop",
67
+ "build:verification": "node tools/verification.mjs",
68
+ "test": "node tools/test-all.mjs",
69
+ "test:ci": "node tools/build-client.mjs && node tools/check-bundle.mjs && node tools/test-all.mjs && node tools/check-assertions.mjs && node tools/verify-tests-can-fail.mjs && node tools/check-html-sinks.mjs && node tools/check-patterns.mjs",
70
+ "test:baseline": "node tools/check-assertions.mjs --update",
71
+ "check:html": "node tools/check-html-sinks.mjs",
72
+ "check:bundle": "node tools/check-bundle.mjs",
73
+ "check:patterns": "node tools/check-patterns.mjs",
74
+ "release": "node tools/release.mjs"
75
+ },
76
+ "exports": {
77
+ ".": "./index.js",
78
+ "./client": "./client.js",
79
+ "./client.*.js": "./client.*.js",
80
+ "./package.json": "./package.json",
81
+ "./locale/*.json": "./locale/*.json",
82
+ "./icon": "./icon.svg",
83
+ "./命理排盘.html": "./命理排盘.html"
84
+ },
85
+ "files": [
86
+ "index.js",
87
+ "client.js",
88
+ "client.*.js",
89
+ "命理排盘.html",
90
+ "engine",
91
+ "cordis.patch.yml",
92
+ "locale/*.json",
93
+ "icon.svg",
94
+ "README.md",
95
+ "CHANGELOG.md",
96
+ "docs/assets",
97
+ "LICENSE"
98
+ ],
99
+ "dsh": {
100
+ "bundle": {
101
+ "patch": "./cordis.patch.yml"
102
+ },
103
+ "client": {
104
+ "platform": "web",
105
+ "immediately": true,
106
+ "inject": []
107
+ }
108
+ },
109
+ "devDependencies": {
110
+ "esbuild": "^0.28.2"
111
+ }
112
+ }