dsh-ziwei 1.3.1 → 1.3.2

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 CHANGED
@@ -9,15 +9,30 @@
9
9
  > 本轮开源源就绪改动先记在 `Unreleased`;具体发版版本号由维护者按 SemVer 决定
10
10
  > (`package.json` 当前仍为 `1.2.0`,本次不擅自升版)。
11
11
 
12
+ ## [1.3.2] — 2026-11-08
13
+
14
+ ### Fixed
15
+
16
+ - **四柱月柱默认口径改为节气**(八字通行):用户报告 1993-07-17 18:00 男命显示「戊午」、
17
+ 期望「己未」。原默认是「农历月」(农历五月 = 午月);改为默认「节气」(小暑后 = 未月)后
18
+ 1993-07-17 显示「己未」。
19
+ 该设置只影响四柱月柱显示;命宫、星曜、四化与十二宫仍按农历月计算,不受影响。需要紫微传统
20
+ 口径可在「排盘设置 → 月柱」切回「农历月」。
21
+
12
22
  ## [1.3.1] — 2026-11-08
13
23
 
14
- 首个 npm 发布版本。
24
+ 首个 npm 发布版本(2026-11-08 发布 `dsh-ziwei@1.3.1`)。
15
25
 
16
26
  ### Added
17
27
 
18
28
  - 作者联系邮箱 `neo2025new@gmail.com` 写入 README / SECURITY / CODE_OF_CONDUCT / package.json / Issue 模板。
19
29
  - README 增加界面预览(真实组件树本地渲染,非占位图)。
20
30
 
31
+ ### Verified
32
+
33
+ - 2026-11-08 作者在真实 DSH 宿主完成 v3 界面验收(浅/深色、侧栏展开/折叠、窄屏、键盘),
34
+ 无阻塞问题;npm `dsh-ziwei@1.3.1` 与 GitHub v1.3.1 同日发布。
35
+
21
36
  ### Changed
22
37
 
23
38
  - 仓库与 npm 名称统一为 `dsh-ziwei`;GitHub release v1.3.0 为首个公开 tag。
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  [![CI](https://github.com/NeoJubao/dsh-ziwei/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/NeoJubao/dsh-ziwei/actions/workflows/ci.yml)
7
7
  ![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)
8
+ [![npm](https://img.shields.io/npm/v/dsh-ziwei?logo=npm)](https://www.npmjs.com/package/dsh-ziwei)
8
9
  ![DSH plugin](https://img.shields.io/badge/DSH-plugin-4b5563)
9
10
  [![GitHub](https://img.shields.io/badge/GitHub-NeoJubao%2Fdsh--ziwei-181717?logo=github)](https://github.com/NeoJubao/dsh-ziwei)
10
11
  ![DSH plugin](https://img.shields.io/badge/DSH-plugin-4b5563)
@@ -23,16 +24,27 @@ official DeepSeek product.
23
24
 
24
25
  ## 界面预览
25
26
 
26
- > 下面是用真实 `client.js` 组件树 + 无头 Chrome 渲染的界面预览(非占位图)。
27
- > 真实 DSH 宿主截图(浅 / 深色、侧栏展开与折叠)在发布前补齐,规范见
28
- > [docs/assets/README.md](docs/assets/README.md)。
27
+ 真实 DSH 宿主截图(macOS,浅色主题,1280×820 窗口 @2x)。
29
28
 
30
- ![浅色主题 · 中宽工作台](docs/design/assets/v3-ui-mid-1160.png)
29
+ **本命盘工作台**:确定性排盘 + 左栏命主信息 / 命盘库,右侧十二宫与宫位详情。
31
30
 
32
- ![深色主题 · 中宽工作台](docs/design/assets/v3-ui-dark-1160.png)
31
+ ![紫微斗数 Pro 在 DSH 宿主中的本命盘工作台](docs/assets/screenshot-light.png)
32
+
33
+ **紫微师 · 直接聊**:命盘自动带入,用已配置的模型回答;示例问「这个大限要注意什么」。
34
+
35
+ ![紫微师直接聊:命盘自动带入,回答大限问题](docs/assets/screenshot-ai.png)
36
+
37
+ **侧栏入口**(DSH 左侧栏中的「紫微斗数 Pro」):
38
+
39
+ ![DSH 侧栏中的紫微斗数 Pro 入口](docs/assets/screenshot-sidebar.png)
40
+
41
+ > 深色主题与四档宽度的渲染预览见 [docs/design/assets/](docs/design/assets/);
42
+ > 截图规范见 [docs/assets/README.md](docs/assets/README.md)。
33
43
 
34
44
  ## 功能
35
45
 
46
+ - **四柱月柱默认按节气**(八字通行口径),可在「排盘设置 → 月柱」切回「农历月」;
47
+ 命宫、星曜、四化与十二宫始终按农历月计算,不受该设置影响。
36
48
  - **排盘只有一个来源**:工作台引擎(`src/engine-core.js` → `engine-built.js`)是
37
49
  **独立实现**,结果与来源产品逐字段对齐验证(20 个跨世纪 / 立春 / 早晚子时 /
38
50
  极端经度 / 男女用例)。排盘只接原始四要素(日期 / 钟表时间 / 性别 / 出生地经度),
@@ -60,8 +72,11 @@ official DeepSeek product.
60
72
  和排障都在 **[docs/INSTALL.md](docs/INSTALL.md)**。最短路径:
61
73
 
62
74
  ```bash
75
+ # 从 npm 安装(推荐给普通用户)
76
+ dash plugin --profile <profile> add dsh-ziwei@1.3.1
77
+
63
78
  # 开发者:把本地插件目录装进一个 profile(也可在 DSH Web Plugins 页添加)
64
- dsh plugin --profile <profile> add "/绝对路径/到/ziwei-workbench"
79
+ dash plugin --profile <profile> add "/绝对路径/到/ziwei-workbench"
65
80
  ```
66
81
 
67
82
  > **Host 半(工具 / 提示词 / 路由)装完或更新后必须手动重启 DSH**;只改浏览器半
package/client.js CHANGED
@@ -495,7 +495,8 @@ function __ziweiBootstrapKernel() {
495
495
  function computeChart(input) {
496
496
  var settings = {
497
497
  yearDivide: 'normal',
498
- monthDivide: 'normal',
498
+ /* 四柱月柱默认按节气(八字通行口径);命宫/星曜仍按农历月,不受此设置影响 */
499
+ monthDivide: 'exact',
499
500
  /* 晚子时安星口径: 'current' = 仍按当日(紫微师/独立版 iztro runner 的口径),
500
501
  'forward' = 换到次日。默认取 'current',保证同一生辰在这里与紫微师
501
502
  来源产品排出同一张盘(约 1/13 的出生时间落在 23 点段)。 */
@@ -1706,6 +1707,7 @@ window.__ModuleLoader__.load({
1706
1707
  compute: '排 盘',
1707
1708
  settings: '排盘设置', yearDivide: '年柱', ydNormal: '正月初一', ydExact: '立春',
1708
1709
  monthDivide: '月柱', mdNormal: '农历月', mdExact: '节气',
1710
+ monthDivideHint: '四柱月柱默认按节气;命宫/星曜仍按农历月,不受此处影响。',
1709
1711
  dayDivide: '晚子时', ddForward: '按次日', ddCurrent: '按当日',
1710
1712
  fixLeap: '闰月', flTrue: '下半月按下月', flFalse: '整月按本月',
1711
1713
  summaryTitle: '命主信息', solarLabel: '公历', lunarLabel: '农历',
@@ -1774,6 +1776,7 @@ window.__ModuleLoader__.load({
1774
1776
  compute: 'Draw Chart',
1775
1777
  settings: 'Options', yearDivide: 'Year', ydNormal: 'LNY', ydExact: 'Lichun',
1776
1778
  monthDivide: 'Month', mdNormal: 'Lunar', mdExact: 'Terms',
1779
+ monthDivideHint: 'Month pillar uses solar terms by default; palaces and stars still use the lunar month.',
1777
1780
  dayDivide: 'Late Rat', ddForward: 'Next Day', ddCurrent: 'Same Day',
1778
1781
  fixLeap: 'Leap', flTrue: '2nd half next', flFalse: 'whole month',
1779
1782
  summaryTitle: 'Profile', solarLabel: 'Solar', lunarLabel: 'Lunar',
@@ -2869,7 +2872,8 @@ body[data-ds-dark-theme] .zp-mu { background: color-mix(in srgb, currentColor 18
2869
2872
  value: f.settings.monthDivide,
2870
2873
  options: [{ value: 'normal', label: t('mdNormal') }, { value: 'exact', label: t('mdExact') }],
2871
2874
  onChange: function (v) { setSetting('monthDivide', v); }
2872
- })),
2875
+ }),
2876
+ h('div', { className: 'zp-settings-hint' }, t('monthDivideHint'))),
2873
2877
  h('div', { className: 'zp-field' },
2874
2878
  h('label', { className: 'zp-field-label' }, t('dayDivide')),
2875
2879
  h(Seg, {
@@ -4163,7 +4167,7 @@ body[data-ds-dark-theme] .zp-mu { background: color-mix(in srgb, currentColor 18
4163
4167
  isLeap: false, hour: 15, minute: 30, gender: 'male',
4164
4168
  longitude: '', place: '', occupation: '',
4165
4169
  /* dayDivide 默认 current(按当日),与紫微师/独立版 iztro runner 一致 */
4166
- settings: { yearDivide: 'normal', monthDivide: 'normal', dayDivide: 'current', fixLeap: true }
4170
+ settings: { yearDivide: 'normal', monthDivide: 'exact', dayDivide: 'current', fixLeap: true }
4167
4171
  };
4168
4172
 
4169
4173
  /* ---------------- 错误边界 ---------------- */
package/engine-built.js CHANGED
@@ -489,7 +489,8 @@
489
489
  function computeChart(input) {
490
490
  var settings = {
491
491
  yearDivide: 'normal',
492
- monthDivide: 'normal',
492
+ /* 四柱月柱默认按节气(八字通行口径);命宫/星曜仍按农历月,不受此设置影响 */
493
+ monthDivide: 'exact',
493
494
  /* 晚子时安星口径: 'current' = 仍按当日(紫微师/独立版 iztro runner 的口径),
494
495
  'forward' = 换到次日。默认取 'current',保证同一生辰在这里与紫微师
495
496
  来源产品排出同一张盘(约 1/13 的出生时间落在 23 点段)。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ziwei",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "紫微斗数排盘工作台(DSH 插件):确定性排盘、十二宫/四化/大限与面板内解读。A Zi Wei Dou Shu (Purple Star Astrology) workbench plugin for DeepSeek Harness.",
@@ -489,7 +489,8 @@
489
489
  function computeChart(input) {
490
490
  var settings = {
491
491
  yearDivide: 'normal',
492
- monthDivide: 'normal',
492
+ /* 四柱月柱默认按节气(八字通行口径);命宫/星曜仍按农历月,不受此设置影响 */
493
+ monthDivide: 'exact',
493
494
  /* 晚子时安星口径: 'current' = 仍按当日(紫微师/独立版 iztro runner 的口径),
494
495
  'forward' = 换到次日。默认取 'current',保证同一生辰在这里与紫微师
495
496
  来源产品排出同一张盘(约 1/13 的出生时间落在 23 点段)。 */
package/verify/verify.mjs CHANGED
@@ -43,6 +43,18 @@ ok('黄金用例 4/4 断言通过', golden.ok === true, JSON.stringify(golden.fa
43
43
  ok('黄金用例: 真太阳时 08:37 / 辰时 / 索引 4',
44
44
  golden.actual && golden.actual.solarTime === '08:37' && golden.actual.timeName === '辰时' && golden.actual.timeIndex === 4,
45
45
  JSON.stringify(golden.actual));
46
+ /* 月柱默认口径:1993-07-17 18:00 男,农历五月廿八(午月),节气已过小暑(未月)。
47
+ 八字通行口径应显示 己未;「农历月」选项保留 戊午。命宫/星曜不随该设置变化。 */
48
+ {
49
+ const base = { calendar: 'solar', year: 1993, month: 7, day: 17, hour: 18, minute: 0, gender: 'male' };
50
+ const cDefault = engine.computeChart(base);
51
+ const cLunar = engine.computeChart(Object.assign({}, base, { settings: { monthDivide: 'normal' } }));
52
+ ok('月柱默认按节气: 1993-07-17 18:00 → 己未', cDefault.pillars && cDefault.pillars.monthly === '己未', cDefault.pillars && cDefault.pillars.monthly);
53
+ ok('月柱可选农历月: 同一生辰 → 戊午', cLunar.pillars && cLunar.pillars.monthly === '戊午', cLunar.pillars && cLunar.pillars.monthly);
54
+ ok('月柱口径不影响命宫/星曜', cDefault.soulIndex === cLunar.soulIndex &&
55
+ JSON.stringify(cDefault.palaces.map((p) => p.major.map((x) => x.name))) ===
56
+ JSON.stringify(cLunar.palaces.map((p) => p.major.map((x) => x.name))));
57
+ }
46
58
  ok('黄金用例: 命宫丑 · 太阳太阴 · 木三局',
47
59
  golden.actual && golden.actual.soulBranch === '丑' && golden.actual.soulMajor.join(',') === '太阳,太阴' && golden.actual.fiveElementsClass === '木三局');
48
60
 
@@ -392,7 +404,7 @@ ok('engine-built.js 与内核解耦(不含 UI)', !/__ModuleLoader__/.test(re
392
404
  ok('autoOpen 默认关闭(不劫持主面板;用户可在设置里开启)',
393
405
  /localStorage\.getItem\('ziwei-pro\.autopen'\) === '1'/.test(client) && !/getItem\('ziwei-pro\.autopen'\) !== '0'/.test(client));
394
406
  ok('面板默认 dayDivide = current(与紫微师口径一致)',
395
- /settings: \{ yearDivide: 'normal', monthDivide: 'normal', dayDivide: 'current', fixLeap: true \}/.test(client));
407
+ /settings: \{ yearDivide: 'normal', monthDivide: 'exact', dayDivide: 'current', fixLeap: true \}/.test(client));
396
408
 
397
409
  /* 引擎默认口径必须进产物 */
398
410
  ok('引擎默认 dayDivide = current', /dayDivide: 'current'/.test(readFileSync(join(root, 'engine-built.js'), 'utf8')));