@huaqiu/dsh-hardware-ui 0.0.0-stage → 0.7.13
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/LICENSE +21 -0
- package/README.md +56 -2
- package/cordis.patch.yml +9 -0
- package/lib/client.js +143486 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.mts +17 -0
- package/lib/index.mjs +22 -0
- package/package.json +62 -3
- package/src/client/components.tsx +317 -0
- package/src/client/ecad.ts +65 -0
- package/src/client/glb.ts +171 -0
- package/src/client/index.ts +188 -0
- package/src/client/model.ts +141 -0
- package/src/client/preview.tsx +260 -0
- package/src/client/store.ts +123 -0
- package/src/client/transport.ts +135 -0
- package/src/index.ts +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 深圳华秋智联股份有限公司
|
|
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/README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @huaqiu/dsh-hardware-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hardware Engineering product UI for the Huaqiu DSH Desktop profile.
|
|
4
|
+
|
|
5
|
+
## What it contributes
|
|
6
|
+
|
|
7
|
+
- **Five** persistent engineering destinations in `conversation.header.leading`:
|
|
8
|
+
Schematic, PCB, BOM, 3D CAD and Order Placing. DFM is out of scope for this
|
|
9
|
+
POC and no mechanical-model destination exists; `mechanical[]` may still
|
|
10
|
+
appear in a manifest for agent context, but it never drives the viewer.
|
|
11
|
+
- One `keepMounted` right-panel tab (`hardware-engineering`) that renders the
|
|
12
|
+
selected artifact from its **saved** file: schematic and PCB through
|
|
13
|
+
`@huaqiu/ecad-renderer`, 3D through the host-generated PCB GLB in Three.js,
|
|
14
|
+
BOM from the host's KiCad BOM projection, plus deterministic selectors,
|
|
15
|
+
explicit loading/error states and the canonical artifact identity.
|
|
16
|
+
- **Open in KiCad** lives in the viewer header and carries the exact resolved
|
|
17
|
+
artifact (schematic → eeschema, PCB and 3D → pcbnew). There is no
|
|
18
|
+
conversation-level native action: that seat could never resolve which artifact
|
|
19
|
+
to open. SolidCraft has no native action in this POC.
|
|
20
|
+
- A Hardware Engineering settings section with KiCad and SolidCraft installation
|
|
21
|
+
roots, persisted through DSH's host-backed config forms.
|
|
22
|
+
- Order Placing shows the selected board and its BOM context plus the exact
|
|
23
|
+
existing agent tool calls (`quote_pcb`, `quote_smt`, `place_pcb_order`,
|
|
24
|
+
`place_smt_order`). The UI never builds a quote URL or a second backend, and
|
|
25
|
+
never places an order itself.
|
|
26
|
+
|
|
27
|
+
All host-side work (discovery, hierarchy resolution, authorized reads, GLB/BOM
|
|
28
|
+
generation, installation probing, shell-free process creation) is delegated to
|
|
29
|
+
`@huaqiu/hardware-artifacts` through its same-origin `/api/v1/hardware/*` routes.
|
|
30
|
+
The browser half never touches Node APIs and never launches a process.
|
|
31
|
+
|
|
32
|
+
## Rendering dependencies
|
|
33
|
+
|
|
34
|
+
`@huaqiu/kicad-sexpr-parser`, `@huaqiu/ecad-renderer` and `three` are
|
|
35
|
+
**devDependencies**: they are inlined into `lib/client.js` at build time
|
|
36
|
+
(`tsdown.config.ts → deps.alwaysBundle`) because the DSH client ModuleLoader can
|
|
37
|
+
only `require` its own injected modules. Keeping them out of `dependencies`
|
|
38
|
+
keeps them out of the Desktop runtime closure.
|
|
39
|
+
|
|
40
|
+
## Extension points used
|
|
41
|
+
|
|
42
|
+
| Seat | Purpose |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `conversation.header.leading` | one product navigation occupant |
|
|
45
|
+
| `sidebar.right.pane.tab` | artifact viewer body (`keepMounted`) |
|
|
46
|
+
| `settings.section` | CAD installation settings |
|
|
47
|
+
|
|
48
|
+
No DSH core change and no new runtime is required.
|
|
49
|
+
|
|
50
|
+
## Runtime states
|
|
51
|
+
|
|
52
|
+
Every mount is keyed by the navigation revision and owns an `AbortController`:
|
|
53
|
+
a superseded navigation disposes the previous renderer or GLB view instead of
|
|
54
|
+
painting over it. A missing project, a missing root schematic, an ambiguous
|
|
55
|
+
board set, an unconfigured or version-probe-failed KiCad installation, a source
|
|
56
|
+
that changed since it was selected, and a failed `kicad-cli` export each surface
|
|
57
|
+
as an explicit state rather than a blank canvas.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# DSH bundle patch — @huaqiu/dsh-hardware-ui
|
|
2
|
+
#
|
|
3
|
+
# The browser half is loaded from the package's `./client` export by DSH's
|
|
4
|
+
# classic client module loader (see `dsh.client.platform` in package.json).
|
|
5
|
+
# The node half exists only to give the product bundle one installable identity;
|
|
6
|
+
# it deliberately provides no host service and injects nothing.
|
|
7
|
+
- insert:
|
|
8
|
+
- id: dsh-hardware-ui
|
|
9
|
+
name: '@huaqiu/dsh-hardware-ui'
|