@huaqiu/hardware-engineering 0.0.0-stage → 0.7.11

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 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,76 @@
1
- # Temporary Holding Version
1
+ # @huaqiu/hardware-engineering
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
+ The Huaqiu Hardware Engineering **product bundle** for DeepSeek Harness.
4
+
5
+ It is not a plugin. It is the package a DSH profile selects so that the nine
6
+ Huaqiu plugins ship with the installation and activate on first launch, offline,
7
+ without HQ Edge.
8
+
9
+ ```jsonc
10
+ // $DSH_HOME/profiles/<profile>/package.json
11
+ {
12
+ "dsh": {
13
+ "profile": {
14
+ "bundles": [
15
+ "@deepseek-ai/dsh-base",
16
+ "@deepseek-ai/dsh-web-app",
17
+ "@huaqiu/hardware-engineering"
18
+ ]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## What it owns
25
+
26
+ | Concern | Where |
27
+ |---|---|
28
+ | Product-level composition and activation order | `cordis.patch.yml` |
29
+ | The machine-readable copy of that composition | `src/index.ts` (`HARDWARE_ENGINEERING_PLUGINS`) |
30
+ | Exact plugin versions tested together | `package.json` `dependencies` |
31
+ | The DSH runtime compatibility gate | `package.json` `engines.dsh` |
32
+
33
+ Everything else — tools, services, client halves, host capability boundaries —
34
+ belongs to the individual plugin packages. This package must never import them.
35
+
36
+ ## Why one row per plugin lives here
37
+
38
+ DSH resolves a loader row's module name from the runtime resolution table, which
39
+ is built by walking the **installation** dependency graph: `apps/cli` →
40
+ `@huaqiu/hardware-engineering` → this package's `dependencies`. That is why the
41
+ plugins are reachable from the installation anchor with no profile-local install
42
+ and no network access at boot.
43
+
44
+ Declaring a dependency installs a package. It does not activate it. The patch is
45
+ what inserts the rows.
46
+
47
+ ## Row order
48
+
49
+ Row order carries no load semantics in DSH: activation is service-availability
50
+ driven, so a consumer waits in `pending` until its provider provides the service.
51
+ Providers are nevertheless written first so the file reads in dependency order.
52
+
53
+ The edges that matter:
54
+
55
+ - `huaqiu-tool-symbol-footprint` → `huaqiuAuth`, `huaqiuArtifacts`, `webServer`
56
+ - all capability rows → `tools` / `skills` / `fs` / `webServer`
57
+
58
+ ## Deliberately excluded
59
+
60
+ | Package | Why |
61
+ |---|---|
62
+ | `@huaqiu/dsh-eda-host` | Its 11 tools read an HQ Edge HTTP bridge that does not exist in the target runtime. |
63
+ | `@huaqiu/dsh-tool-plugin-update` | Update discovery/install is HQ Edge-owned business logic with no DSH-native equivalent. |
64
+ | `@huaqiu/dsh-hqsch` | Teaches TypeScript against HQ EDA; outside this product's workflow. |
65
+ | `@huaqiu/dsh-analytics` | Telemetry; not required to prove the product. |
66
+
67
+ ## Verification
68
+
69
+ ```bash
70
+ pnpm --filter @huaqiu/hardware-engineering test # patch ↔ ledger contract
71
+ pnpm --filter @huaqiu/hardware-engineering build
72
+ pnpm pack --filter @huaqiu/hardware-engineering # then inspect the tarball
73
+ ```
74
+
75
+ The contract test does not prove activation. That needs a real DSH boot; see
76
+ `M1-hardware-engineering-poc-report.md`.
@@ -0,0 +1,85 @@
1
+ # DSH bundle patch — @huaqiu/hardware-engineering
2
+ #
3
+ # THE PRODUCT BUNDLE. A profile selects this one package
4
+ # (`dsh.profile.bundles: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app',
5
+ # '@huaqiu/hardware-engineering']`); this patch is what actually mounts the
6
+ # nine Huaqiu plugin rows. The plugin packages are plain `dependencies` of
7
+ # this package — declaring a dependency installs it, it does not activate it.
8
+ #
9
+ # ── Why the rows live here and not in the profile ──────────────────────────
10
+ # A row's `name` is resolved from the runtime resolution table, which is built
11
+ # by walking the *installation* dependency graph (apps/cli → this package →
12
+ # its dependencies). That is why every plugin below is reachable without a
13
+ # profile-local install and without network at boot.
14
+ #
15
+ # ── Row order ──────────────────────────────────────────────────────────────
16
+ # Row order carries no load semantics in DSH — activation is service-
17
+ # availability driven, so a consumer waits in `pending` until its provider
18
+ # provides the service (see `packages/bundle/base/cordis.patch.yml`: "Row order
19
+ # carries no load semantics"). Providers are nevertheless listed first so the
20
+ # file reads in dependency order and a human can audit it.
21
+ #
22
+ # Dependency edges that actually matter at activation time:
23
+ # huaqiu-tool-symbol-footprint → huaqiuAuth, huaqiuArtifacts, webServer
24
+ # every Huaqiu row → webServer (routes) / tools / skills / fs
25
+ #
26
+ # ── What is deliberately NOT here ──────────────────────────────────────────
27
+ # @huaqiu/dsh-eda-host netlist/selection/board snapshots are served
28
+ # by an HQ Edge HTTP bridge that does not exist
29
+ # in the target runtime; its 11 tools would all
30
+ # fail. Deferred to the native EDA-host work.
31
+ # @huaqiu/dsh-tool-plugin-update update discovery/install is HQ Edge-owned
32
+ # business logic with no DSH-native equivalent.
33
+ # Deferred.
34
+ # @huaqiu/dsh-hqsch teaches TypeScript-against-HQ-EDA, which is
35
+ # not the workflow this product bundle targets.
36
+ # @huaqiu/dsh-analytics telemetry; not required to prove the product.
37
+ #
38
+ # ── Do not also list the child bundles in the profile ──────────────────────
39
+ # Listing e.g. `@huaqiu/dsh-kicad` in `dsh.profile.bundles` *as well as* this
40
+ # package inserts the same row id twice. The ids below intentionally match each
41
+ # package's own cordis.patch.yml so that mistake surfaces as an id collision.
42
+
43
+ # The bundled Huaqiu Web presentation layer replaces the official brand row.
44
+ # This override must live here because the theme is mounted by this patch, not
45
+ # by its own bundle layer.
46
+ - id: ui-brand-official
47
+ disabled: true
48
+
49
+ - insert:
50
+ # ── Service providers ───────────────────────────────────────────────────
51
+ - id: huaqiu-auth
52
+ name: '@huaqiu/dsh-auth'
53
+ inject: ['webServer']
54
+
55
+ - id: huaqiu-artifacts
56
+ name: '@huaqiu/dsh-artifacts'
57
+ inject: ['webServer']
58
+
59
+ # ── Node-side capability plugins ────────────────────────────────────────
60
+ - id: huaqiu-dsh-kicad
61
+ name: '@huaqiu/dsh-kicad'
62
+ inject: ['skills', 'tools']
63
+
64
+ - id: dsh-tool-kicad-schematic-gen
65
+ name: '@huaqiu/dsh-tool-kicad-schematic-gen'
66
+ inject: ['tools', 'fs', 'sandboxPolicy', 'skills', 'webServer']
67
+
68
+ - id: huaqiu-tool-part-search
69
+ name: '@huaqiu/dsh-tool-part-search'
70
+ inject: ['tools']
71
+
72
+ - id: huaqiu-tool-quote
73
+ name: '@huaqiu/dsh-tool-quote'
74
+ inject: ['tools']
75
+
76
+ - id: huaqiu-tool-symbol-footprint
77
+ name: '@huaqiu/dsh-tool-symbol-footprint'
78
+ inject: ['tools', 'huaqiuAuth', 'huaqiuArtifacts', 'webServer']
79
+
80
+ # ── Presentation ────────────────────────────────────────────────────────
81
+ - id: ui-theme-huaqiu
82
+ name: '@huaqiu/dsh-ui-theme-huaqiu'
83
+
84
+ - id: dsh-huaqiu-about
85
+ name: '@huaqiu/dsh-huaqiu-about'
@@ -0,0 +1,67 @@
1
+ //#region src/index.d.ts
2
+ /**
3
+ * `@huaqiu/hardware-engineering` — the Huaqiu Hardware Engineering product bundle.
4
+ *
5
+ * This package is a **bundle**, not a plugin. It is never mounted as a loader
6
+ * row: DSH reads its `dsh.bundle.patch` (`./cordis.patch.yml`), merges that
7
+ * patch into the profile's layer stack, and mounts the nine plugin rows the
8
+ * patch inserts. The plugin packages themselves are ordinary `dependencies` of
9
+ * this package, which is what makes them resolvable from the installation
10
+ * anchor without a profile-local install.
11
+ *
12
+ * ── Why the manifest below exists ──────────────────────────────────────────
13
+ * A YAML patch is not importable, so nothing can prove it stayed in sync with
14
+ * the package's dependency ledger. {@link HARDWARE_ENGINEERING_PLUGINS} is the
15
+ * machine-readable copy of the same facts; `test/bundle.test.ts` asserts it
16
+ * against both `cordis.patch.yml` and `package.json`, so a row added to one
17
+ * place and forgotten in the other fails the build instead of failing silently
18
+ * at profile boot (where a bad row only produces a stderr skip line).
19
+ *
20
+ * Keep {@link HARDWARE_ENGINEERING_PLUGINS} in the same order as the patch.
21
+ *
22
+ * ── Ownership ──────────────────────────────────────────────────────────────
23
+ * The bundle owns composition and activation order only. Each plugin owns its
24
+ * own tools, services, client half and host capability boundaries; this package
25
+ * must not import them or reach into their internals.
26
+ *
27
+ * @module @huaqiu/hardware-engineering
28
+ */
29
+ /** The bundle package name — the identity a profile lists in `dsh.profile.bundles`. */
30
+ declare const BUNDLE_PACKAGE = "@huaqiu/hardware-engineering";
31
+ /** Human-readable bundle id used by diagnostics and the POC report. */
32
+ declare const BUNDLE_ID = "huaqiu-hardware-engineering";
33
+ /** Which layer of the product a row belongs to. */
34
+ type HardwareEngineeringPluginRole = 'provider' | 'capability' | 'presentation';
35
+ /** One loader row the bundle patch inserts. */
36
+ interface HardwareEngineeringPlugin {
37
+ /** Loader entry id — identical to the plugin package's own patch id. */
38
+ readonly id: string;
39
+ /** npm package name mounted by the row. */
40
+ readonly name: string;
41
+ /** Cordis services the row gates activation on. */
42
+ readonly inject: readonly string[];
43
+ /** Cordis services the row provides to other rows. */
44
+ readonly provides: readonly string[];
45
+ /** Composition layer, for readers and for the report. */
46
+ readonly role: HardwareEngineeringPluginRole;
47
+ }
48
+ /**
49
+ * The plugin set shipped by this bundle, in patch order.
50
+ *
51
+ * Empty `inject` means the row needs no service to activate (a browser-only or
52
+ * route-only plugin whose node half has nothing to wait for).
53
+ */
54
+ declare const HARDWARE_ENGINEERING_PLUGINS: readonly HardwareEngineeringPlugin[];
55
+ /** Package names the bundle depends on and mounts, in patch order. */
56
+ declare const HARDWARE_ENGINEERING_PLUGIN_NAMES: readonly string[];
57
+ /**
58
+ * Every Cordis service name this bundle requires from the host profile.
59
+ *
60
+ * Used by the activation test to distinguish "the bundle is complete" from
61
+ * "the host profile happens to supply everything it needs".
62
+ */
63
+ declare const HARDWARE_ENGINEERING_REQUIRED_SERVICES: readonly string[];
64
+ /** Every Cordis service the bundle itself provides (as opposed to consuming). */
65
+ declare const HARDWARE_ENGINEERING_PROVIDED_SERVICES: readonly string[];
66
+ //#endregion
67
+ export { BUNDLE_ID, BUNDLE_PACKAGE, HARDWARE_ENGINEERING_PLUGINS, HARDWARE_ENGINEERING_PLUGIN_NAMES, HARDWARE_ENGINEERING_PROVIDED_SERVICES, HARDWARE_ENGINEERING_REQUIRED_SERVICES, HardwareEngineeringPlugin, HardwareEngineeringPluginRole };
package/lib/index.mjs ADDED
@@ -0,0 +1,127 @@
1
+ //#region src/index.ts
2
+ /**
3
+ * `@huaqiu/hardware-engineering` — the Huaqiu Hardware Engineering product bundle.
4
+ *
5
+ * This package is a **bundle**, not a plugin. It is never mounted as a loader
6
+ * row: DSH reads its `dsh.bundle.patch` (`./cordis.patch.yml`), merges that
7
+ * patch into the profile's layer stack, and mounts the nine plugin rows the
8
+ * patch inserts. The plugin packages themselves are ordinary `dependencies` of
9
+ * this package, which is what makes them resolvable from the installation
10
+ * anchor without a profile-local install.
11
+ *
12
+ * ── Why the manifest below exists ──────────────────────────────────────────
13
+ * A YAML patch is not importable, so nothing can prove it stayed in sync with
14
+ * the package's dependency ledger. {@link HARDWARE_ENGINEERING_PLUGINS} is the
15
+ * machine-readable copy of the same facts; `test/bundle.test.ts` asserts it
16
+ * against both `cordis.patch.yml` and `package.json`, so a row added to one
17
+ * place and forgotten in the other fails the build instead of failing silently
18
+ * at profile boot (where a bad row only produces a stderr skip line).
19
+ *
20
+ * Keep {@link HARDWARE_ENGINEERING_PLUGINS} in the same order as the patch.
21
+ *
22
+ * ── Ownership ──────────────────────────────────────────────────────────────
23
+ * The bundle owns composition and activation order only. Each plugin owns its
24
+ * own tools, services, client half and host capability boundaries; this package
25
+ * must not import them or reach into their internals.
26
+ *
27
+ * @module @huaqiu/hardware-engineering
28
+ */
29
+ /** The bundle package name — the identity a profile lists in `dsh.profile.bundles`. */
30
+ const BUNDLE_PACKAGE = "@huaqiu/hardware-engineering";
31
+ /** Human-readable bundle id used by diagnostics and the POC report. */
32
+ const BUNDLE_ID = "huaqiu-hardware-engineering";
33
+ /**
34
+ * The plugin set shipped by this bundle, in patch order.
35
+ *
36
+ * Empty `inject` means the row needs no service to activate (a browser-only or
37
+ * route-only plugin whose node half has nothing to wait for).
38
+ */
39
+ const HARDWARE_ENGINEERING_PLUGINS = Object.freeze([
40
+ Object.freeze({
41
+ id: "huaqiu-auth",
42
+ name: "@huaqiu/dsh-auth",
43
+ inject: ["webServer"],
44
+ provides: ["huaqiuAuth"],
45
+ role: "provider"
46
+ }),
47
+ Object.freeze({
48
+ id: "huaqiu-artifacts",
49
+ name: "@huaqiu/dsh-artifacts",
50
+ inject: ["webServer"],
51
+ provides: ["huaqiuArtifacts"],
52
+ role: "provider"
53
+ }),
54
+ Object.freeze({
55
+ id: "huaqiu-dsh-kicad",
56
+ name: "@huaqiu/dsh-kicad",
57
+ inject: ["skills", "tools"],
58
+ provides: [],
59
+ role: "capability"
60
+ }),
61
+ Object.freeze({
62
+ id: "dsh-tool-kicad-schematic-gen",
63
+ name: "@huaqiu/dsh-tool-kicad-schematic-gen",
64
+ inject: [
65
+ "tools",
66
+ "fs",
67
+ "sandboxPolicy",
68
+ "skills",
69
+ "webServer"
70
+ ],
71
+ provides: [],
72
+ role: "capability"
73
+ }),
74
+ Object.freeze({
75
+ id: "huaqiu-tool-part-search",
76
+ name: "@huaqiu/dsh-tool-part-search",
77
+ inject: ["tools"],
78
+ provides: [],
79
+ role: "capability"
80
+ }),
81
+ Object.freeze({
82
+ id: "huaqiu-tool-quote",
83
+ name: "@huaqiu/dsh-tool-quote",
84
+ inject: ["tools"],
85
+ provides: [],
86
+ role: "capability"
87
+ }),
88
+ Object.freeze({
89
+ id: "huaqiu-tool-symbol-footprint",
90
+ name: "@huaqiu/dsh-tool-symbol-footprint",
91
+ inject: [
92
+ "tools",
93
+ "huaqiuAuth",
94
+ "huaqiuArtifacts",
95
+ "webServer"
96
+ ],
97
+ provides: [],
98
+ role: "capability"
99
+ }),
100
+ Object.freeze({
101
+ id: "ui-theme-huaqiu",
102
+ name: "@huaqiu/dsh-ui-theme-huaqiu",
103
+ inject: [],
104
+ provides: [],
105
+ role: "presentation"
106
+ }),
107
+ Object.freeze({
108
+ id: "dsh-huaqiu-about",
109
+ name: "@huaqiu/dsh-huaqiu-about",
110
+ inject: [],
111
+ provides: [],
112
+ role: "presentation"
113
+ })
114
+ ]);
115
+ /** Package names the bundle depends on and mounts, in patch order. */
116
+ const HARDWARE_ENGINEERING_PLUGIN_NAMES = Object.freeze(HARDWARE_ENGINEERING_PLUGINS.map((plugin) => plugin.name));
117
+ /**
118
+ * Every Cordis service name this bundle requires from the host profile.
119
+ *
120
+ * Used by the activation test to distinguish "the bundle is complete" from
121
+ * "the host profile happens to supply everything it needs".
122
+ */
123
+ const HARDWARE_ENGINEERING_REQUIRED_SERVICES = Object.freeze([...new Set(HARDWARE_ENGINEERING_PLUGINS.flatMap((plugin) => [...plugin.inject]))].sort());
124
+ /** Every Cordis service the bundle itself provides (as opposed to consuming). */
125
+ const HARDWARE_ENGINEERING_PROVIDED_SERVICES = Object.freeze([...new Set(HARDWARE_ENGINEERING_PLUGINS.flatMap((plugin) => [...plugin.provides]))].sort());
126
+ //#endregion
127
+ export { BUNDLE_ID, BUNDLE_PACKAGE, HARDWARE_ENGINEERING_PLUGINS, HARDWARE_ENGINEERING_PLUGIN_NAMES, HARDWARE_ENGINEERING_PROVIDED_SERVICES, HARDWARE_ENGINEERING_REQUIRED_SERVICES };
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@huaqiu/hardware-engineering",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.7.11",
4
+ "type": "module",
5
+ "description": "Huaqiu Hardware Engineering product bundle: the DSH plugin set that ships with the installation and activates as one profile bundle.",
6
+ "keywords": [
7
+ "dsh",
8
+ "dsh-bundle",
9
+ "huaqiu",
10
+ "hardware-engineering",
11
+ "eda",
12
+ "kicad"
13
+ ],
14
+ "license": "MIT",
15
+ "main": "./lib/index.mjs",
16
+ "types": "./lib/index.d.mts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./lib/index.d.mts",
20
+ "default": "./lib/index.mjs"
21
+ },
22
+ "./cordis.patch.yml": "./cordis.patch.yml",
23
+ "./package.json": "./package.json"
24
+ },
25
+ "dsh": {
26
+ "bundle": {
27
+ "patch": "./cordis.patch.yml",
28
+ "listedByDefault": false
29
+ }
30
+ },
31
+ "engines": {
32
+ "dsh": "^0.2.2-rc.1"
33
+ },
34
+ "peerDependencies": {
35
+ "@deepseek-ai/cordis": "^4.0.1"
36
+ },
37
+ "dependencies": {
38
+ "@huaqiu/dsh-huaqiu-about": "0.7.11",
39
+ "@huaqiu/dsh-kicad": "0.7.11",
40
+ "@huaqiu/dsh-tool-part-search": "0.7.11",
41
+ "@huaqiu/dsh-tool-quote": "0.7.11",
42
+ "@huaqiu/dsh-tool-symbol-footprint": "0.7.11",
43
+ "@huaqiu/dsh-artifacts": "0.7.11",
44
+ "@huaqiu/dsh-auth": "0.7.11",
45
+ "@huaqiu/dsh-tool-kicad-schematic-gen": "0.7.11",
46
+ "@huaqiu/dsh-ui-theme-huaqiu": "0.7.11"
47
+ },
48
+ "files": [
49
+ "lib",
50
+ "src",
51
+ "cordis.patch.yml",
52
+ "README.md"
53
+ ],
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "scripts": {
58
+ "typecheck": "tsc --noEmit",
59
+ "build": "tsdown",
60
+ "test": "vitest run"
61
+ }
6
62
  }
package/src/index.ts ADDED
@@ -0,0 +1,103 @@
1
+ /**
2
+ * `@huaqiu/hardware-engineering` — the Huaqiu Hardware Engineering product bundle.
3
+ *
4
+ * This package is a **bundle**, not a plugin. It is never mounted as a loader
5
+ * row: DSH reads its `dsh.bundle.patch` (`./cordis.patch.yml`), merges that
6
+ * patch into the profile's layer stack, and mounts the nine plugin rows the
7
+ * patch inserts. The plugin packages themselves are ordinary `dependencies` of
8
+ * this package, which is what makes them resolvable from the installation
9
+ * anchor without a profile-local install.
10
+ *
11
+ * ── Why the manifest below exists ──────────────────────────────────────────
12
+ * A YAML patch is not importable, so nothing can prove it stayed in sync with
13
+ * the package's dependency ledger. {@link HARDWARE_ENGINEERING_PLUGINS} is the
14
+ * machine-readable copy of the same facts; `test/bundle.test.ts` asserts it
15
+ * against both `cordis.patch.yml` and `package.json`, so a row added to one
16
+ * place and forgotten in the other fails the build instead of failing silently
17
+ * at profile boot (where a bad row only produces a stderr skip line).
18
+ *
19
+ * Keep {@link HARDWARE_ENGINEERING_PLUGINS} in the same order as the patch.
20
+ *
21
+ * ── Ownership ──────────────────────────────────────────────────────────────
22
+ * The bundle owns composition and activation order only. Each plugin owns its
23
+ * own tools, services, client half and host capability boundaries; this package
24
+ * must not import them or reach into their internals.
25
+ *
26
+ * @module @huaqiu/hardware-engineering
27
+ */
28
+
29
+ /** The bundle package name — the identity a profile lists in `dsh.profile.bundles`. */
30
+ export const BUNDLE_PACKAGE = '@huaqiu/hardware-engineering'
31
+
32
+ /** Human-readable bundle id used by diagnostics and the POC report. */
33
+ export const BUNDLE_ID = 'huaqiu-hardware-engineering'
34
+
35
+ /** Which layer of the product a row belongs to. */
36
+ export type HardwareEngineeringPluginRole = 'provider' | 'capability' | 'presentation'
37
+
38
+ /** One loader row the bundle patch inserts. */
39
+ export interface HardwareEngineeringPlugin {
40
+ /** Loader entry id — identical to the plugin package's own patch id. */
41
+ readonly id: string
42
+ /** npm package name mounted by the row. */
43
+ readonly name: string
44
+ /** Cordis services the row gates activation on. */
45
+ readonly inject: readonly string[]
46
+ /** Cordis services the row provides to other rows. */
47
+ readonly provides: readonly string[]
48
+ /** Composition layer, for readers and for the report. */
49
+ readonly role: HardwareEngineeringPluginRole
50
+ }
51
+
52
+ /**
53
+ * The plugin set shipped by this bundle, in patch order.
54
+ *
55
+ * Empty `inject` means the row needs no service to activate (a browser-only or
56
+ * route-only plugin whose node half has nothing to wait for).
57
+ */
58
+ export const HARDWARE_ENGINEERING_PLUGINS: readonly HardwareEngineeringPlugin[] = Object.freeze([
59
+ // Service providers first: consumers below wait on these two.
60
+ Object.freeze({ id: 'huaqiu-auth', name: '@huaqiu/dsh-auth', inject: ['webServer'], provides: ['huaqiuAuth'], role: 'provider' }),
61
+ Object.freeze({ id: 'huaqiu-artifacts', name: '@huaqiu/dsh-artifacts', inject: ['webServer'], provides: ['huaqiuArtifacts'], role: 'provider' }),
62
+
63
+ Object.freeze({ id: 'huaqiu-dsh-kicad', name: '@huaqiu/dsh-kicad', inject: ['skills', 'tools'], provides: [], role: 'capability' }),
64
+ Object.freeze({
65
+ id: 'dsh-tool-kicad-schematic-gen',
66
+ name: '@huaqiu/dsh-tool-kicad-schematic-gen',
67
+ inject: ['tools', 'fs', 'sandboxPolicy', 'skills', 'webServer'],
68
+ provides: [],
69
+ role: 'capability',
70
+ }),
71
+ Object.freeze({ id: 'huaqiu-tool-part-search', name: '@huaqiu/dsh-tool-part-search', inject: ['tools'], provides: [], role: 'capability' }),
72
+ Object.freeze({ id: 'huaqiu-tool-quote', name: '@huaqiu/dsh-tool-quote', inject: ['tools'], provides: [], role: 'capability' }),
73
+ Object.freeze({
74
+ id: 'huaqiu-tool-symbol-footprint',
75
+ name: '@huaqiu/dsh-tool-symbol-footprint',
76
+ inject: ['tools', 'huaqiuAuth', 'huaqiuArtifacts', 'webServer'],
77
+ provides: [],
78
+ role: 'capability',
79
+ }),
80
+
81
+ Object.freeze({ id: 'ui-theme-huaqiu', name: '@huaqiu/dsh-ui-theme-huaqiu', inject: [], provides: [], role: 'presentation' }),
82
+ Object.freeze({ id: 'dsh-huaqiu-about', name: '@huaqiu/dsh-huaqiu-about', inject: [], provides: [], role: 'presentation' }),
83
+ ]) as readonly HardwareEngineeringPlugin[]
84
+
85
+ /** Package names the bundle depends on and mounts, in patch order. */
86
+ export const HARDWARE_ENGINEERING_PLUGIN_NAMES: readonly string[] = Object.freeze(
87
+ HARDWARE_ENGINEERING_PLUGINS.map((plugin) => plugin.name),
88
+ )
89
+
90
+ /**
91
+ * Every Cordis service name this bundle requires from the host profile.
92
+ *
93
+ * Used by the activation test to distinguish "the bundle is complete" from
94
+ * "the host profile happens to supply everything it needs".
95
+ */
96
+ export const HARDWARE_ENGINEERING_REQUIRED_SERVICES: readonly string[] = Object.freeze(
97
+ [...new Set(HARDWARE_ENGINEERING_PLUGINS.flatMap((plugin) => [...plugin.inject]))].sort(),
98
+ )
99
+
100
+ /** Every Cordis service the bundle itself provides (as opposed to consuming). */
101
+ export const HARDWARE_ENGINEERING_PROVIDED_SERVICES: readonly string[] = Object.freeze(
102
+ [...new Set(HARDWARE_ENGINEERING_PLUGINS.flatMap((plugin) => [...plugin.provides]))].sort(),
103
+ )