@nashihang777/dsh-solids-world 0.0.0-stage → 1.0.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 ADDED
@@ -0,0 +1,16 @@
1
+ # 变更日志
2
+
3
+ 本文件记录 `@nashihang777/dsh-solids-world` 的发布变更。
4
+
5
+ ## 1.0.0
6
+
7
+ 首个版本:把桌面应用 [solids-world](https://github.com/nashihang777/solids-world)
8
+ 的 3D 图鉴移植为 DeepSeek Harness 插件。
9
+
10
+ - 侧栏图标 + `main` 整页面板两个插槽入口,面板随宿主明暗主题与界面语言;
11
+ - 53 个中英双语条目、五个板块,全部 3D 几何由物理公式实时生成;
12
+ - 分步讲解与镜头联动、小测验与进度、逐条笔记与 Markdown 导出、图鉴画廊;
13
+ - 中/英/别名/拼音检索、超胞与成键/标注/剖切/自旋、轨道与动力学参数控制;
14
+ - 本地 CIF 导入(词法、语法、空间群展开、结构提取全部离线);
15
+ - 客户端为自包含产物(three.js 内联,仅从宿主取 `react`),样式表作用域到
16
+ `.sw-atlas`,不改动宿主界面;设置与笔记存于页面 `localStorage`。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nashihang777
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,36 @@
1
+ solids-world for DeepSeek Harness
2
+ =================================
3
+
4
+ This package re-hosts the desktop application "solids-world" inside the DeepSeek
5
+ Harness Web page.
6
+
7
+ Upstream work
8
+ -------------
9
+
10
+ solids-world — 开源可交互的固体物理与原子物理 3D 图鉴
11
+ Copyright © 2026 世界航海
12
+ Licensed under the MIT License (see LICENSE).
13
+
14
+ Reused from the upstream project, with modifications:
15
+
16
+ - src/atlas/** renderer components, atlas data (zh/en), lessons, quizzes,
17
+ i18n dictionaries, stylesheet, 3D builders, CIF-driven
18
+ custom structures
19
+ - src/electron/** CIF lexer/parser/space-group expansion/structure extraction,
20
+ settings and notes schema
21
+
22
+ Modifications: the stylesheet is scoped to `.sw-atlas`; the 3D stage is driven by
23
+ plain three.js instead of @react-three/fiber, @react-three/drei and n8ao; the
24
+ Vite-only builder registry is replaced by a generated static map; the Electron
25
+ preload bridge is replaced by a page-side implementation; drag-and-drop and
26
+ keyboard handling are scoped to the panel; a CIF file picker and a download-based
27
+ notes export replace the native menu and save dialog.
28
+
29
+ Original to this package
30
+ ------------------------
31
+
32
+ - index.js, client.js (build output), cordis.patch.yml, package.json
33
+ - src/client/** slot registration, theme and locale inheritance, the page
34
+ bridge, the panel shell styles
35
+ - scripts/build.mjs build pipeline
36
+ - icon.svg original artwork
package/README.md CHANGED
@@ -1,3 +1,158 @@
1
- # Temporary Holding Version
1
+ # solids-world for DeepSeek Harness
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An interactive 3D atlas of solid-state and atomic physics, delivered as a DeepSeek
4
+ Harness plugin: **固体世界 / Solids world**.
5
+
6
+ This package re-hosts the desktop app
7
+ [solids-world](https://github.com/nashihang777/solids-world) inside the Harness
8
+ Web page. It contributes a global sidebar icon and a full central panel, so the
9
+ atlas reads like a first-class part of the app rather than a widget.
10
+
11
+ ## What it does
12
+
13
+ - **53 bilingual atlas entries** in five sections: crystal structures (12),
14
+ Bravais lattices (14), atoms and orbitals (11), symmetry (11), lattice
15
+ dynamics (5).
16
+ - **Programmatic 3D**: every model is computed from the physics at run time —
17
+ spheres, bonds, cell frames, isosurfaces and animations. No model files, no
18
+ network access.
19
+ - **Stepped lessons** whose camera focus and hotspot highlights follow each step,
20
+ plus a **quiz** per entry; passing both is recorded in the entry's progress.
21
+ - **Notes** per entry, an aggregate view, and one-click **Markdown export**
22
+ (downloads a `.md` file).
23
+ - **Gallery** of all entries with lesson/quiz status.
24
+ - **Search** over Chinese, English, aliases and pinyin (`/` focuses the box).
25
+ - **3D controls**: 1×/2× supercell, bonds, atom labels, clipping planes, spin,
26
+ reset/focus/zoom; orbitals add isosurface threshold, phase mode, opacity,
27
+ nodal surfaces and radial range; symmetry and dynamics entries add play,
28
+ pause, speed, single-step and parameter sliders.
29
+ - **CIF import**: drop a `.cif` file onto the panel or use **Open CIF** in the
30
+ top bar. Lexing, parsing, space-group expansion and structure extraction all
31
+ run locally; syntax errors, unknown space groups and oversized files are
32
+ reported.
33
+ - **Bilingual** UI with a zh/en switch, a light/dark theme, and respect for the
34
+ system "reduce motion" preference.
35
+ - **Keyboard**: arrow keys step entries, `/` focuses search, `F` focuses the
36
+ stage, `Ctrl/⌘+D` opens a random entry, `Esc` closes the topmost layer.
37
+
38
+ ## Install
39
+
40
+ From the workspace that contains this directory:
41
+
42
+ 1. Make sure `client.js` is present (it is committed). To rebuild it, see below.
43
+ 2. Install the bundle from the parent directory with the plugin manager,
44
+ pointing at this package directory:
45
+
46
+ ```
47
+ plugin_manager action=install_bundle target=<absolute path to solids-world-harness>
48
+ ```
49
+
50
+ 3. Open **固体世界 / Solids world** from the sidebar panel column. Its icon sits
51
+ below the built-in panel icons.
52
+
53
+ The bundle stores settings and notes in the page's `localStorage`, so they
54
+ survive a restart, and stay independent of any other profile data.
55
+
56
+ ## Build
57
+
58
+ `client.js` is generated. Rebuild after changing anything under `src/`:
59
+
60
+ ```bash
61
+ node scripts/build.mjs
62
+ ```
63
+
64
+ The build needs esbuild, postcss and `three`. It looks for them in
65
+ `node_modules/` here first, then in a `solids-world` checkout (default: the
66
+ sibling `../solids-world`, or wherever `SOLIDS_WORLD_SRC` points). So either
67
+ `npm install` in this folder, or clone the
68
+ [upstream app](https://github.com/nashihang777/solids-world) and point
69
+ `SOLIDS_WORLD_SRC` at it. Running the plugin never needs either: `client.js` is
70
+ standalone.
71
+
72
+ `tsconfig.json` is for editors and type checking only. The build pins its own
73
+ compiler options (`tsconfigRaw`), so it cannot drift with that file — notably it
74
+ keeps `useDefineForClassFields: false`, the semantics the upstream Vite build
75
+ used.
76
+
77
+ The script:
78
+
79
+ 1. generates `src/atlas/three/builders-map.ts` — the desktop app enumerated its
80
+ 53 builders with Vite's `import.meta.glob`, which esbuild does not support;
81
+ 2. scopes the desktop stylesheet to `.sw-atlas` with PostCSS, so the atlas
82
+ cannot restyle the host page;
83
+ 3. bundles `src/client/index.tsx` as an IIFE with three.js inlined and `react`
84
+ resolved to the host's instance;
85
+ 4. wraps the bundle in the `window.__ModuleLoader__.load` factory contract.
86
+
87
+ ## Verify
88
+
89
+ Two headless checks ship with the sources. Both reuse the `solids-world`
90
+ checkout's `node_modules`, so no install is needed:
91
+
92
+ ```bash
93
+ node scripts/smoke.mjs # loads client.js like the module loader does
94
+ node scripts/check-content.mjs # atlas data, 53 models, CIF samples
95
+ ```
96
+
97
+ `smoke.mjs` runs the built bundle inside jsdom with a stand-in module loader and
98
+ host context, mounts the panel and asserts what a broken port would lose: the
99
+ scoped panel root, inherited theme and locale, all 53 library rows, entry
100
+ selection, the help modal, the CIF input, settings/notes persistence, language
101
+ switching, and cleanup on unload. jsdom has no WebGL, so the 3D stage degrades
102
+ to its fallback notice there.
103
+
104
+ `check-content.mjs` asserts that both locales expose the same 53 entries with
105
+ lessons and quizzes, that every entry owns exactly one 3D builder, that all 53
106
+ models construct in 1× and 2× supercells, that a parsed CIF becomes a model, and
107
+ that the bundled CIF samples still produce their recorded atoms, elements and
108
+ error codes.
109
+
110
+ Type checking uses the same checkout:
111
+
112
+ ```bash
113
+ New-Item -ItemType Junction -Path node_modules -Target ../solids-world/node_modules
114
+ node node_modules/typescript/bin/tsc -p tsconfig.json --noEmit
115
+ ```
116
+
117
+ A page refresh (or a Harness restart) is needed after rebuilding `client.js` to
118
+ load the new Client module generation.
119
+
120
+ ## Layout
121
+
122
+ ```
123
+ index.js Host half (the atlas needs no Host service)
124
+ client.js built Client half
125
+ cordis.patch.yml bundle row
126
+ locale/{en,zh}.json display metadata
127
+ src/client/index.tsx slot registration, theme/locale inheritance, icon
128
+ src/client/bridge.ts page replacement for the Electron preload
129
+ src/atlas/** the desktop renderer, ported
130
+ src/electron/** CIF parser + settings/notes schema, ported
131
+ ```
132
+
133
+ The two regressions worth knowing about when editing `src/atlas`: `three/Stage.tsx`
134
+ is rewritten against plain three.js (the host page supplies no react-three-fiber),
135
+ and `App.tsx` scopes drag-and-drop plus keyboard handling to the panel instead of
136
+ the whole document.
137
+
138
+ ## Differences from the desktop app
139
+
140
+ - **No post-processing**: the N8AO ambient-occlusion and bloom passes are gone,
141
+ because they need react-three-fiber's composer. The `postfx` setting now only
142
+ selects the render resolution tier. Lighting, geometry, materials and colors
143
+ are otherwise unchanged.
144
+ - **No native window chrome**: regressions live in the panel; the Electron menu
145
+ becomes the top bar's **Open CIF** button, and the notes export downloads a
146
+ file instead of opening a save dialog.
147
+ - **Keyboard shortcuts are panel-scoped** so they never steal keys from the
148
+ Harness shell.
149
+ - **Layout breakpoints** are viewport-based in the original stylesheet; in a
150
+ narrow panel on a wide screen the three-column layout keeps its desktop
151
+ proportions.
152
+
153
+ ## Attribution and license
154
+
155
+ MIT. The renderer, entry data, lessons, quizzes and CIF parser come from
156
+ **solids-world** (© 2026 世界航海, MIT) — see [NOTICE](./NOTICE) and
157
+ [LICENSE](./LICENSE). The plugin scaffolding (bundle manifest, client entry,
158
+ page bridge, build script, icon) is original to this package.