@huaqiu/dsh-tool-quote 0.6.18 → 0.6.20

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/index.mjs CHANGED
@@ -187,6 +187,10 @@ function createQuoteTools(env) {
187
187
  if (a.blength !== void 0) form.blength = a.blength;
188
188
  if (a.bwidth !== void 0) form.bwidth = a.bwidth;
189
189
  if (a.board_tg !== void 0) form.boardTg = a.board_tg;
190
+ if (a.bheight !== void 0) form.bheight = a.bheight;
191
+ if (a.lineweight !== void 0) form.lineweight = a.lineweight;
192
+ if (a.vias !== void 0) form.vias = a.vias;
193
+ if (a.insidecopper !== void 0) form.insidecopper = a.insidecopper;
190
194
  if (a.color !== void 0) form.color = a.color;
191
195
  if (a.cover !== void 0) form.cover = a.cover;
192
196
  if (a.spray !== void 0) form.spray = a.spray;
@@ -196,11 +200,11 @@ function createQuoteTools(env) {
196
200
  const edaFlagProps = {
197
201
  derive_board_size: {
198
202
  type: "boolean",
199
- description: "When true, ask hq-edge to derive board length/width from the current PCB board (approximate bounding box of footprints; only when a board is open in the host)."
203
+ description: "Board length/width are ALWAYS derived from the open board (exact Edge.Cuts outline) when a PCB editor has a board open — no flag needed. Set true to additionally allow the footprint-bbox approximation when the exact outline is unavailable (e.g. no Edge.Cuts)."
200
204
  },
201
205
  derive_board_stackup: {
202
206
  type: "boolean",
203
- description: "NOT SUPPORTED (explicit capability gap): hq-edge has no board-properties source, so stack-up is never derived or fabricated. Provide blayer/bheight explicitly instead."
207
+ description: "Layer count, thickness, min trace/space and min hole are ALWAYS derived from the open board — no flag needed. Set true to require them: the quote then FAILS when no board is available instead of pricing with the reference defaults."
204
208
  },
205
209
  include_raw_response: {
206
210
  type: "boolean",
@@ -210,7 +214,7 @@ function createQuoteTools(env) {
210
214
  return [
211
215
  defineTool({
212
216
  name: "quote_pcb",
213
- description: "Get a real-time PCB fabrication price quote (multi-layer, panel pricing, delivery options) for the requested region through Huaqiu/NextPCB. Use when the user asks how much a PCB would cost, \"报价\", \"价格\", delivery time estimates, or comparing fab options. Returns the itemized price breakdown, total price, and delivery alternatives (name + build time in days + total price) with currency symbol (¥ CN / ¥ intl). When derive_board_size / derive_board_stackup is set, the response also carries the effective quote form: EDA-extracted board facts (length/width from the board outline, layer count + thickness from the stack-up in KiCad) merged with the caller overrides — plus server defaults applied on the wire (e.g. bcount default 5, endpoint-required pbnum=1 / insidecopper). Inspect \"form\" in the result, adjust any parameter the user wants to change (e.g. color, blayer, board_tg), and re-query with the corrected form rather than guessing values. Progressive usage: quote_pcb for PCB fabrication, quote_smt for assembly, then the user places the order in the EDA host. This is a quote-only query — no order is created. All regions are anonymous-queryable (no login required). The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks for one.",
217
+ description: "Get a real-time PCB fabrication price quote (multi-layer, panel pricing, delivery options) for the requested region through Huaqiu/NextPCB. Use when the user asks how much a PCB would cost, \"报价\", \"价格\", delivery time estimates, or comparing fab options. Returns the itemized price breakdown, total price, and delivery alternatives (name + build time in days + total price) with currency symbol (¥ CN / ¥ intl). The quote prices the CURRENTLY OPEN board exactly like the KiCad \"Huaqiu PCB\" plugin: board size, layer count, thickness, min trace/space and min drilled hole are read from the board and snapped to the fabricator menus, so the returned price matches the plugin for the same board. The response carries that effective \"form\"; inspect it, then override any parameter the user wants to change (color, blayer, bheight, lineweight, vias, board_tg, bcount …) and re-query instead of guessing values. Progressive usage: quote_pcb for PCB fabrication, quote_smt for assembly, then the user places the order in the EDA host. This is a quote-only query — no order is created. All regions are anonymous-queryable (no login required). The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks for one.",
214
218
  parameters: {
215
219
  region: {
216
220
  type: "string",
@@ -244,7 +248,23 @@ function createQuoteTools(env) {
244
248
  "tg150",
245
249
  "tg170"
246
250
  ],
247
- description: "Glass transition temperature grade (4+ layers only)."
251
+ description: "Glass transition temperature grade (4+ layers only). Derived from the board (TG130) unless given."
252
+ },
253
+ bheight: {
254
+ type: "number",
255
+ description: "PCB thickness in mm. Derived from the board design thickness and snapped to the fabricator menu (0.6/0.8/1.0/1.2/1.6/2.0/2.5/3.0/3.2 by layer count) unless given."
256
+ },
257
+ lineweight: {
258
+ type: "number",
259
+ description: "Min trace/space in mil. Derived from the board (min routed track / clearance), snapped to 10/8/6/5/4/3.5 mil unless given — a smaller value usually costs more."
260
+ },
261
+ vias: {
262
+ type: "number",
263
+ description: "Min drilled hole in mm. Derived from the board vias, snapped to 0.3/0.25/0.2/0.15 mm unless given — holes under 0.3 mm add a per-hole laser fee."
264
+ },
265
+ insidecopper: {
266
+ type: "number",
267
+ description: "Inner copper weight (oz). 0.5 for boards with more than 2 layers, 0 for 2-layer boards, unless given."
248
268
  },
249
269
  color: {
250
270
  type: "string",
@@ -298,7 +318,7 @@ function createQuoteTools(env) {
298
318
  }),
299
319
  defineTool({
300
320
  name: "quote_smt",
301
- description: "Get a real-time SMT assembly price quote (single/double side, stencil, X-ray, conformal coating, Huaqiu agent part purchasing) for the requested region through Huaqiu/NextPCB. Use when the user asks about assembly costs, \"贴片价格\", \"SMT 报价\", \"焊接费用\", or delivery time for assembly. Embeds the PCB order (layers/size/quantity) used for the assembly quote. Returns the normalized price with SMT fee detail (no-tax, total, tax) and currency symbol. When derive_board_size / derive_board_stackup is set, the response carries the effective form: EDA-extracted board facts (panel size, embedded PCB length/width/layers/thickness) merged with the caller overrides — inspect \"form\" and re-query with corrected parameters instead of guessing. Quote-only — no order is created. The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks.",
321
+ description: "Get a real-time SMT assembly price quote (single/double side, stencil, X-ray, conformal coating, Huaqiu agent part purchasing) for the requested region through Huaqiu/NextPCB. Use when the user asks about assembly costs, \"贴片价格\", \"SMT 报价\", \"焊接费用\", or delivery time for assembly. Embeds the PCB order (layers/size/quantity) used for the assembly quote. Returns the normalized price with SMT fee detail (no-tax, total, tax) and currency symbol. The quote prices the CURRENTLY OPEN board (panel size, embedded PCB facts, SMD/PTH pad counts and distinct value/footprint pairs — the same numbers the KiCad \"Huaqiu PCB\" plugin sends), and the response carries that effective \"form\": inspect it and re-query with corrected parameters instead of guessing. Note: for INTERNATIONAL regions the upstream only returns a rolled-up total when BOM detail is supplied, so totalPrice may be 0 while the fee items are non-zero — report it as \"assembly cost not available without a BOM\" rather than \"free\". Quote-only — no order is created. The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks.",
302
322
  parameters: {
303
323
  region: {
304
324
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaqiu/dsh-tool-quote",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.mts",
@@ -22,7 +22,7 @@
22
22
  "@deepseek-ai/dsh-tools": "^0.2.1-rc.2"
23
23
  },
24
24
  "dependencies": {
25
- "@huaqiu/dsh-plugin-log": "0.6.18"
25
+ "@huaqiu/dsh-plugin-log": "0.6.20"
26
26
  },
27
27
  "files": [
28
28
  "lib",
package/src/tools.ts CHANGED
@@ -62,6 +62,10 @@ export function createQuoteTools(env: QuoteToolEnv) {
62
62
  if (a.blength !== undefined) form.blength = a.blength
63
63
  if (a.bwidth !== undefined) form.bwidth = a.bwidth
64
64
  if (a.board_tg !== undefined) form.boardTg = a.board_tg
65
+ if (a.bheight !== undefined) form.bheight = a.bheight
66
+ if (a.lineweight !== undefined) form.lineweight = a.lineweight
67
+ if (a.vias !== undefined) form.vias = a.vias
68
+ if (a.insidecopper !== undefined) form.insidecopper = a.insidecopper
65
69
  if (a.color !== undefined) form.color = a.color
66
70
  if (a.cover !== undefined) form.cover = a.cover
67
71
  if (a.spray !== undefined) form.spray = a.spray
@@ -73,14 +77,16 @@ export function createQuoteTools(env: QuoteToolEnv) {
73
77
  derive_board_size: {
74
78
  type: 'boolean' as const,
75
79
  description:
76
- 'When true, ask hq-edge to derive board length/width from the current PCB board ' +
77
- '(approximate bounding box of footprints; only when a board is open in the host).',
80
+ 'Board length/width are ALWAYS derived from the open board (exact Edge.Cuts outline) ' +
81
+ 'when a PCB editor has a board open — no flag needed. Set true to additionally allow the ' +
82
+ 'footprint-bbox approximation when the exact outline is unavailable (e.g. no Edge.Cuts).',
78
83
  },
79
84
  derive_board_stackup: {
80
85
  type: 'boolean' as const,
81
86
  description:
82
- 'NOT SUPPORTED (explicit capability gap): hq-edge has no board-properties source, ' +
83
- 'so stack-up is never derived or fabricated. Provide blayer/bheight explicitly instead.',
87
+ 'Layer count, thickness, min trace/space and min hole are ALWAYS derived from the open ' +
88
+ 'board — no flag needed. Set true to require them: the quote then FAILS when no board is ' +
89
+ 'available instead of pricing with the reference defaults.',
84
90
  },
85
91
  include_raw_response: {
86
92
  type: 'boolean' as const,
@@ -97,13 +103,13 @@ export function createQuoteTools(env: QuoteToolEnv) {
97
103
  'would cost, "报价", "价格", delivery time estimates, or comparing fab options. ' +
98
104
  'Returns the itemized price breakdown, total price, and delivery alternatives ' +
99
105
  '(name + build time in days + total price) with currency symbol (¥ CN / ¥ intl). ' +
100
- 'When derive_board_size / derive_board_stackup is set, the response also carries the ' +
101
- 'effective quote form: EDA-extracted board facts (length/width from the board outline, ' +
102
- 'layer count + thickness from the stack-up in KiCad) merged with the caller overrides — ' +
103
- 'plus server defaults applied on the wire (e.g. bcount default 5, endpoint-required ' +
104
- 'pbnum=1 / insidecopper). Inspect "form" in the result, adjust any parameter the user ' +
105
- 'wants to change (e.g. color, blayer, board_tg), and re-query with the corrected form ' +
106
- 'rather than guessing values. Progressive usage: quote_pcb for PCB fabrication, quote_smt ' +
106
+ 'The quote prices the CURRENTLY OPEN board exactly like the KiCad "Huaqiu PCB" plugin: ' +
107
+ 'board size, layer count, thickness, min trace/space and min drilled hole are read from ' +
108
+ 'the board and snapped to the fabricator menus, so the returned price matches the plugin ' +
109
+ 'for the same board. The response carries that effective "form"; inspect it, then override ' +
110
+ 'any parameter the user wants to change (color, blayer, bheight, lineweight, vias, ' +
111
+ 'board_tg, bcount …) and re-query instead of guessing values. Progressive usage: ' +
112
+ 'quote_pcb for PCB fabrication, quote_smt ' +
107
113
  'for assembly, then the user places the order in the EDA host. This is a quote-only ' +
108
114
  'query — no order is created. All regions are anonymous-queryable (no login required). ' +
109
115
  'The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / ' +
@@ -136,7 +142,33 @@ export function createQuoteTools(env: QuoteToolEnv) {
136
142
  board_tg: {
137
143
  type: 'string',
138
144
  enum: ['tg130', 'tg150', 'tg170'],
139
- description: 'Glass transition temperature grade (4+ layers only).',
145
+ description:
146
+ 'Glass transition temperature grade (4+ layers only). Derived from the board ' +
147
+ '(TG130) unless given.',
148
+ },
149
+ bheight: {
150
+ type: 'number',
151
+ description:
152
+ 'PCB thickness in mm. Derived from the board design thickness and snapped to the ' +
153
+ 'fabricator menu (0.6/0.8/1.0/1.2/1.6/2.0/2.5/3.0/3.2 by layer count) unless given.',
154
+ },
155
+ lineweight: {
156
+ type: 'number',
157
+ description:
158
+ 'Min trace/space in mil. Derived from the board (min routed track / clearance), ' +
159
+ 'snapped to 10/8/6/5/4/3.5 mil unless given — a smaller value usually costs more.',
160
+ },
161
+ vias: {
162
+ type: 'number',
163
+ description:
164
+ 'Min drilled hole in mm. Derived from the board vias, snapped to 0.3/0.25/0.2/0.15 mm ' +
165
+ 'unless given — holes under 0.3 mm add a per-hole laser fee.',
166
+ },
167
+ insidecopper: {
168
+ type: 'number',
169
+ description:
170
+ 'Inner copper weight (oz). 0.5 for boards with more than 2 layers, 0 for 2-layer ' +
171
+ 'boards, unless given.',
140
172
  },
141
173
  color: {
142
174
  type: 'string',
@@ -176,10 +208,13 @@ export function createQuoteTools(env: QuoteToolEnv) {
176
208
  'Huaqiu agent part purchasing) for the requested region through Huaqiu/NextPCB. Use when the user ' +
177
209
  'asks about assembly costs, "贴片价格", "SMT 报价", "焊接费用", or delivery time for assembly. ' +
178
210
  'Embeds the PCB order (layers/size/quantity) used for the assembly quote. Returns the normalized ' +
179
- 'price with SMT fee detail (no-tax, total, tax) and currency symbol. When derive_board_size / ' +
180
- 'derive_board_stackup is set, the response carries the effective form: EDA-extracted board facts ' +
181
- '(panel size, embedded PCB length/width/layers/thickness) merged with the caller overrides — ' +
182
- 'inspect "form" and re-query with corrected parameters instead of guessing. Quote-only — no ' +
211
+ 'price with SMT fee detail (no-tax, total, tax) and currency symbol. The quote prices the ' +
212
+ 'CURRENTLY OPEN board (panel size, embedded PCB facts, SMD/PTH pad counts and distinct ' +
213
+ 'value/footprint pairs — the same numbers the KiCad "Huaqiu PCB" plugin sends), and the ' +
214
+ 'response carries that effective "form": inspect it and re-query with corrected parameters ' +
215
+ 'instead of guessing. Note: for INTERNATIONAL regions the upstream only returns a rolled-up ' +
216
+ 'total when BOM detail is supplied, so totalPrice may be 0 while the fee items are non-zero — ' +
217
+ 'report it as "assembly cost not available without a BOM" rather than "free". Quote-only — no ' +
183
218
  'order is created. The pricing region is auto-detected by hq-edge from the trusted request ' +
184
219
  'context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks.',
185
220
  parameters: {