dsh-metaphysics 0.50.5 → 0.56.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 +1102 -1005
- package/README.md +367 -355
- package/client.almanac.js +129 -0
- package/client.bazi.js +168 -0
- package/client.chenggu.js +129 -0
- package/client.convert.js +129 -0
- package/client.daliuren.js +167 -0
- package/client.fengshui.js +128 -0
- package/client.hepan.js +167 -0
- package/client.js +638 -18939
- package/client.liuyao.js +167 -0
- package/client.mbti.js +129 -0
- package/client.name.js +129 -0
- package/client.numerology.js +129 -0
- package/client.qimen.js +167 -0
- package/client.star.js +129 -0
- package/client.tarot.js +167 -0
- package/client.trend.js +167 -0
- package/client.xiaoliuren.js +129 -0
- package/client.zeri.js +129 -0
- package/client.ziwei.js +168 -0
- package/docs/assets/verification-badge.svg +13 -0
- package/engine/almanac.js +4 -4
- package/engine/bazi.js +98 -21
- package/engine/citations.js +320 -0
- package/engine/classics.js +567 -559
- package/engine/diff.js +350 -301
- package/engine/fengshui.js +272 -28
- package/engine/fingerprint.js +76 -0
- package/engine/followup.js +31 -3
- package/engine/geju.js +531 -475
- package/engine/index.js +311 -13
- package/engine/interpret-knowledge.js +502 -484
- package/engine/interpret-plain.js +383 -383
- package/engine/interpret.js +1885 -1867
- package/engine/qimen-ganying.js +134 -0
- package/engine/qimen-interpret.js +31 -9
- package/engine/qimen.js +16 -1
- package/engine/shensha.js +6 -3
- package/engine/trace.js +456 -0
- package/engine/ziwei.js +117 -8
- package/index.js +51 -3
- package/package.json +113 -106
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +9418 -7122
package/index.js
CHANGED
|
@@ -5,6 +5,16 @@
|
|
|
5
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) => {
|
|
@@ -218,6 +229,14 @@ export function apply(ctx) {
|
|
|
218
229
|
type: 'boolean',
|
|
219
230
|
description: '口径对照(bazi / ziwei / qimen):同一组输入分别按当前口径与另一档各排一次,列出根因字段(如日柱、命宫、局数)与连带变化数。只列差异,不判哪套口径更准,也不改盘面。',
|
|
220
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
|
+
},
|
|
221
240
|
verifyPast: {
|
|
222
241
|
type: 'number',
|
|
223
242
|
description: '验前事(仅八字):传年数(如 6),返回过去 N 年的流年信号行,供用户勾选「准/不准」并算贴合度;只读,不改盘。',
|
|
@@ -341,10 +360,15 @@ export function apply(ctx) {
|
|
|
341
360
|
enum: ['current-day', 'next-day', 'all-current', 'day-cur-time-next'],
|
|
342
361
|
description: '紫微斗数:晚子时口径。current-day(默认,23:00 后仍按当日)、next-day(起盘日顺延次日);另两个别名保留为兼容值。',
|
|
343
362
|
},
|
|
363
|
+
shenzhuSchool: {
|
|
364
|
+
type: 'string',
|
|
365
|
+
enum: ['common', 'verse'],
|
|
366
|
+
description: '紫微斗数:身主安法(只影响子/午年生人)。common(默认,通行表)子午皆火星;verse 按安身主诀「子午安身铃火宿」逐字取子铃星、午火星。',
|
|
367
|
+
},
|
|
344
368
|
action: {
|
|
345
369
|
type: 'string',
|
|
346
370
|
enum: ['natal', 'advise', 'xuankong', 'assess', 'generate'],
|
|
347
|
-
description: '子动作。fengshui:natal(默认,算八宅命卦+流年飞星,需生日与性别)、advise(算宅卦门主灶布局,需 sitting 或 facing,出生信息可选)、xuankong
|
|
371
|
+
description: '子动作。fengshui:natal(默认,算八宅命卦+流年飞星,需生日与性别)、advise(算宅卦门主灶布局,需 sitting 或 facing,出生信息可选)、xuankong(玄空下卦/替卦九宫盘,需 sitting 或 facing,运由 period 或 fortuneYear 定,缺省九运并注明;兼向报 sittingOffset/degree,飞星报 fortuneDate/fortuneTime);name:assess(默认,评估已有名字,需 surname + givenName)、generate(生成候选名,需生辰,可选 surname / limit)。',
|
|
348
372
|
},
|
|
349
373
|
toAge: {
|
|
350
374
|
type: 'number',
|
|
@@ -358,7 +382,31 @@ export function apply(ctx) {
|
|
|
358
382
|
},
|
|
359
383
|
period: {
|
|
360
384
|
type: 'number',
|
|
361
|
-
description: '仅 fengshui xuankong:三元九运的运(1–9)。优先于 fortuneYear
|
|
385
|
+
description: '仅 fengshui xuankong:三元九运的运(1–9)。优先于 fortuneYear 与飞星日期;省略时按 fortuneYear 定,再缺省按九运(2024–2043)并注明。',
|
|
386
|
+
},
|
|
387
|
+
sittingOffset: {
|
|
388
|
+
type: 'number',
|
|
389
|
+
description: '仅 fengshui xuankong:坐山偏离本山中心的度数(−7.5–7.5,正数向下一山)。超过 4.5° 自动按沈氏替卦排盘。与 sittingDegree 二选一;坐向都给须一致。',
|
|
390
|
+
},
|
|
391
|
+
sittingDegree: {
|
|
392
|
+
type: 'number',
|
|
393
|
+
description: '仅 fengshui xuankong:坐山罗盘度数(0–360)。引擎换算为相对本山中心的偏移,超过 4.5° 用替卦。',
|
|
394
|
+
},
|
|
395
|
+
facingOffset: {
|
|
396
|
+
type: 'number',
|
|
397
|
+
description: '仅 fengshui xuankong:向山偏离本山中心的度数(−7.5–7.5)。给了 sittingOffset/degree 时可省略;两者都给须一致。',
|
|
398
|
+
},
|
|
399
|
+
facingDegree: {
|
|
400
|
+
type: 'number',
|
|
401
|
+
description: '仅 fengshui xuankong:向山罗盘度数(0–360)。用于反推兼向,与坐山读数须一致。',
|
|
402
|
+
},
|
|
403
|
+
fortuneDate: {
|
|
404
|
+
type: 'string',
|
|
405
|
+
description: '仅 fengshui xuankong:飞星日期 YYYY-MM-DD(公历)。给了才排月/日/时紫白;只给 fortuneYear 时只排年星。',
|
|
406
|
+
},
|
|
407
|
+
fortuneTime: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
description: '仅 fengshui xuankong:飞星时刻 HH:MM(默认 12:00);日星 23:00 后归次日。',
|
|
362
410
|
},
|
|
363
411
|
surname: { type: 'string', description: '仅 name 使用:姓氏,如「李」(复姓整体写,如「欧阳」)。' },
|
|
364
412
|
givenName: { type: 'string', description: '仅 name assess 使用:名(1–2 个汉字)。' },
|
package/package.json
CHANGED
|
@@ -1,106 +1,113 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-metaphysics",
|
|
3
|
-
"version": "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), and a bundled offline single-file page (命理排盘.html),
|
|
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
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"test
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"check:
|
|
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
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-metaphysics",
|
|
3
|
+
"version": "0.56.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
|
+
"build:citations": "node tools/citations.mjs",
|
|
69
|
+
"test": "node tools/test-all.mjs",
|
|
70
|
+
"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",
|
|
71
|
+
"test:baseline": "node tools/check-assertions.mjs --update",
|
|
72
|
+
"check:html": "node tools/check-html-sinks.mjs",
|
|
73
|
+
"check:bundle": "node tools/check-bundle.mjs",
|
|
74
|
+
"check:patterns": "node tools/check-patterns.mjs",
|
|
75
|
+
"release": "node tools/release.mjs"
|
|
76
|
+
},
|
|
77
|
+
"exports": {
|
|
78
|
+
".": "./index.js",
|
|
79
|
+
"./client": "./client.js",
|
|
80
|
+
"./client.*.js": "./client.*.js",
|
|
81
|
+
"./package.json": "./package.json",
|
|
82
|
+
"./locale/*.json": "./locale/*.json",
|
|
83
|
+
"./icon": "./icon.svg",
|
|
84
|
+
"./命理排盘.html": "./命理排盘.html"
|
|
85
|
+
},
|
|
86
|
+
"files": [
|
|
87
|
+
"index.js",
|
|
88
|
+
"client.js",
|
|
89
|
+
"client.*.js",
|
|
90
|
+
"命理排盘.html",
|
|
91
|
+
"engine",
|
|
92
|
+
"cordis.patch.yml",
|
|
93
|
+
"locale/*.json",
|
|
94
|
+
"icon.svg",
|
|
95
|
+
"README.md",
|
|
96
|
+
"CHANGELOG.md",
|
|
97
|
+
"docs/assets",
|
|
98
|
+
"LICENSE"
|
|
99
|
+
],
|
|
100
|
+
"dsh": {
|
|
101
|
+
"bundle": {
|
|
102
|
+
"patch": "./cordis.patch.yml"
|
|
103
|
+
},
|
|
104
|
+
"client": {
|
|
105
|
+
"platform": "web",
|
|
106
|
+
"immediately": true,
|
|
107
|
+
"inject": []
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"devDependencies": {
|
|
111
|
+
"esbuild": "^0.28.2"
|
|
112
|
+
}
|
|
113
|
+
}
|