@huaqiu/dsh-analytics 0.6.24 → 0.6.25
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/lib/client.js +18 -2
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +3 -0
- package/package.json +3 -3
- package/src/client/index.ts +20 -2
- package/src/generated/builtin-tools.ts +3 -0
package/lib/index.mjs
CHANGED
|
@@ -41,6 +41,8 @@ const BUILTIN_TOOLS = [
|
|
|
41
41
|
"get_pcb_board",
|
|
42
42
|
"get_pcb_selection",
|
|
43
43
|
"get_project_netlist",
|
|
44
|
+
"get_schematic_png_screenshot",
|
|
45
|
+
"get_schematic_render_capabilities",
|
|
44
46
|
"get_selection_netlist",
|
|
45
47
|
"import_kicad_component",
|
|
46
48
|
"import_kicad_symbol",
|
|
@@ -55,6 +57,7 @@ const BUILTIN_TOOLS = [
|
|
|
55
57
|
"kicad_pcb_refill_zones",
|
|
56
58
|
"kicad_pcb_remove_selected_items",
|
|
57
59
|
"kicad_pcb_update_selected_track_width",
|
|
60
|
+
"list_schematic_sheets",
|
|
58
61
|
"localize_kicad_module_footprints",
|
|
59
62
|
"match_bom",
|
|
60
63
|
"pcb_cancel_route",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-analytics",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.25",
|
|
4
4
|
"description": "Huaqiu Sensors Analytics integration for DeepSeek Harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.mjs",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"sa-sdk-javascript": "1.16.16",
|
|
38
|
-
"@huaqiu/dsh-plugin-log": "0.6.
|
|
39
|
-
"@huaqiu/dsh-auth": "0.6.
|
|
38
|
+
"@huaqiu/dsh-plugin-log": "0.6.25",
|
|
39
|
+
"@huaqiu/dsh-auth": "0.6.25"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"lib",
|
package/src/client/index.ts
CHANGED
|
@@ -65,9 +65,27 @@ export function apply(ctx: ClientContext): () => void {
|
|
|
65
65
|
const disposers: Array<() => void> = []
|
|
66
66
|
let disposed = false
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
// The bridge reports generic until the EDA handshake finishes.
|
|
69
|
+
const waitForTargetHost = (): Promise<string | null> => new Promise(resolve => {
|
|
70
|
+
let timer: number | undefined
|
|
71
|
+
const finish = (targetHost: string | null) => {
|
|
72
|
+
if (timer !== undefined) window.clearInterval(timer)
|
|
73
|
+
resolve(targetHost)
|
|
74
|
+
}
|
|
75
|
+
const read = () => {
|
|
76
|
+
if (disposed) return finish(null)
|
|
77
|
+
const targetHost = ctx.get?.<HqEdgeService>('hqEdge')?.context?.getTargetHost?.() ?? ''
|
|
78
|
+
if (targetHost === 'hq-eda' || targetHost === 'kicad') finish(targetHost)
|
|
79
|
+
}
|
|
80
|
+
timer = window.setInterval(read, 200)
|
|
81
|
+
disposers.push(() => finish(null))
|
|
82
|
+
read()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
void resolveHostMode().then(async (hostMode) => {
|
|
69
86
|
if (disposed) return
|
|
70
|
-
const targetHost =
|
|
87
|
+
const targetHost = hostMode ? await waitForTargetHost() : ''
|
|
88
|
+
if (disposed || targetHost === null) return
|
|
71
89
|
const analytics = createAnalytics(sensors as unknown as SensorsClient, { hostMode, targetHost })
|
|
72
90
|
|
|
73
91
|
const disposeProvide = ctx.provide?.('huaqiuAnalytics', analytics)
|
|
@@ -23,6 +23,8 @@ export const BUILTIN_TOOLS = [
|
|
|
23
23
|
"get_pcb_board",
|
|
24
24
|
"get_pcb_selection",
|
|
25
25
|
"get_project_netlist",
|
|
26
|
+
"get_schematic_png_screenshot",
|
|
27
|
+
"get_schematic_render_capabilities",
|
|
26
28
|
"get_selection_netlist",
|
|
27
29
|
"import_kicad_component",
|
|
28
30
|
"import_kicad_symbol",
|
|
@@ -37,6 +39,7 @@ export const BUILTIN_TOOLS = [
|
|
|
37
39
|
"kicad_pcb_refill_zones",
|
|
38
40
|
"kicad_pcb_remove_selected_items",
|
|
39
41
|
"kicad_pcb_update_selected_track_width",
|
|
42
|
+
"list_schematic_sheets",
|
|
40
43
|
"localize_kicad_module_footprints",
|
|
41
44
|
"match_bom",
|
|
42
45
|
"pcb_cancel_route",
|