@huaqiu/dsh-tool-quote 0.5.3 → 0.5.4
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 +5 -7
- package/package.json +2 -2
- package/src/tools.ts +22 -15
package/lib/index.mjs
CHANGED
|
@@ -171,7 +171,7 @@ function createQuoteTools(env) {
|
|
|
171
171
|
};
|
|
172
172
|
return [defineTool({
|
|
173
173
|
name: "quote_pcb",
|
|
174
|
-
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). 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.",
|
|
174
|
+
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.",
|
|
175
175
|
parameters: {
|
|
176
176
|
region: {
|
|
177
177
|
type: "string",
|
|
@@ -180,8 +180,7 @@ function createQuoteTools(env) {
|
|
|
180
180
|
"eu_us",
|
|
181
181
|
"jp"
|
|
182
182
|
],
|
|
183
|
-
|
|
184
|
-
description: "Pricing region. \"cn\" = Huaqiu China (eda.cn, ¥), \"eu_us\" = NextPCB EU/US, \"jp\" = NextPCB Japan (both ¥)."
|
|
183
|
+
description: "Optional explicit override. When omitted, hq-edge auto-detects the pricing region from the trusted request context (CN / JP / INTERNATIONAL). \"cn\" = Huaqiu China (eda.cn, ¥), \"eu_us\" = NextPCB EU/US, \"jp\" = NextPCB Japan (both ¥)."
|
|
185
184
|
},
|
|
186
185
|
bcount: {
|
|
187
186
|
type: "integer",
|
|
@@ -259,7 +258,7 @@ function createQuoteTools(env) {
|
|
|
259
258
|
}
|
|
260
259
|
}), defineTool({
|
|
261
260
|
name: "quote_smt",
|
|
262
|
-
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.",
|
|
261
|
+
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.",
|
|
263
262
|
parameters: {
|
|
264
263
|
region: {
|
|
265
264
|
type: "string",
|
|
@@ -268,8 +267,7 @@ function createQuoteTools(env) {
|
|
|
268
267
|
"eu_us",
|
|
269
268
|
"jp"
|
|
270
269
|
],
|
|
271
|
-
|
|
272
|
-
description: "Pricing region. \"cn\" = Huaqiu China (eda.cn, ¥), \"eu_us\" = NextPCB EU/US, \"jp\" = NextPCB Japan (both ¥)."
|
|
270
|
+
description: "Optional explicit override. When omitted, hq-edge auto-detects the pricing region from the trusted request context (CN / JP / INTERNATIONAL). \"cn\" = Huaqiu China (eda.cn, ¥), \"eu_us\" = NextPCB EU/US, \"jp\" = NextPCB Japan (both ¥)."
|
|
273
271
|
},
|
|
274
272
|
number: {
|
|
275
273
|
type: "string",
|
|
@@ -303,7 +301,7 @@ function createQuoteTools(env) {
|
|
|
303
301
|
},
|
|
304
302
|
pcb_bcount: {
|
|
305
303
|
type: "integer",
|
|
306
|
-
description: "Embedded PCB panel quantity, >= 1. Default 5."
|
|
304
|
+
description: "Embedded PCB panel quantity, >= 1. Default 5. NOTE: the embedded board size (pcb_blength/pcb_bwidth) is also used as the assembly panel size (panel = single board) when no explicit panel size is given — the Intl SMT endpoint rejects the request otherwise (\"pcb_width can not empty\", response_code 1003)."
|
|
307
305
|
},
|
|
308
306
|
...edaFlagProps
|
|
309
307
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-tool-quote",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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.1.0-rc.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@huaqiu/dsh-plugin-log": "0.5.
|
|
25
|
+
"@huaqiu/dsh-plugin-log": "0.5.4"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"lib",
|
package/src/tools.ts
CHANGED
|
@@ -100,19 +100,22 @@ export function createQuoteTools(env: QuoteToolEnv) {
|
|
|
100
100
|
'When derive_board_size / derive_board_stackup is set, the response also carries the ' +
|
|
101
101
|
'effective quote form: EDA-extracted board facts (length/width from the board outline, ' +
|
|
102
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
|
|
104
|
-
'result, adjust any parameter the user
|
|
105
|
-
're-query with the corrected form
|
|
106
|
-
'
|
|
107
|
-
'host. This is a quote-only
|
|
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 ' +
|
|
107
|
+
'for assembly, then the user places the order in the EDA host. This is a quote-only ' +
|
|
108
|
+
'query — no order is created. All regions are anonymous-queryable (no login required). ' +
|
|
109
|
+
'The pricing region is auto-detected by hq-edge from the trusted request context (CN / JP / ' +
|
|
110
|
+
'INTERNATIONAL) — do NOT force a region unless the user explicitly asks for one.',
|
|
108
111
|
parameters: {
|
|
109
112
|
region: {
|
|
110
113
|
type: 'string',
|
|
111
114
|
enum: ['cn', 'eu_us', 'jp'],
|
|
112
|
-
required: true,
|
|
113
115
|
description:
|
|
114
|
-
'
|
|
115
|
-
'"
|
|
116
|
+
'Optional explicit override. When omitted, hq-edge auto-detects the pricing region from ' +
|
|
117
|
+
'the trusted request context (CN / JP / INTERNATIONAL). "cn" = Huaqiu China (eda.cn, ¥), ' +
|
|
118
|
+
'"eu_us" = NextPCB EU/US, "jp" = NextPCB Japan (both ¥).',
|
|
116
119
|
},
|
|
117
120
|
bcount: {
|
|
118
121
|
type: 'integer',
|
|
@@ -177,15 +180,16 @@ export function createQuoteTools(env: QuoteToolEnv) {
|
|
|
177
180
|
'derive_board_stackup is set, the response carries the effective form: EDA-extracted board facts ' +
|
|
178
181
|
'(panel size, embedded PCB length/width/layers/thickness) merged with the caller overrides — ' +
|
|
179
182
|
'inspect "form" and re-query with corrected parameters instead of guessing. Quote-only — no ' +
|
|
180
|
-
'order is created.'
|
|
183
|
+
'order is created. The pricing region is auto-detected by hq-edge from the trusted request ' +
|
|
184
|
+
'context (CN / JP / INTERNATIONAL) — do NOT force a region unless the user explicitly asks.',
|
|
181
185
|
parameters: {
|
|
182
186
|
region: {
|
|
183
187
|
type: 'string',
|
|
184
188
|
enum: ['cn', 'eu_us', 'jp'],
|
|
185
|
-
required: true,
|
|
186
189
|
description:
|
|
187
|
-
'
|
|
188
|
-
'"
|
|
190
|
+
'Optional explicit override. When omitted, hq-edge auto-detects the pricing region from ' +
|
|
191
|
+
'the trusted request context (CN / JP / INTERNATIONAL). "cn" = Huaqiu China (eda.cn, ¥), ' +
|
|
192
|
+
'"eu_us" = NextPCB EU/US, "jp" = NextPCB Japan (both ¥).',
|
|
189
193
|
},
|
|
190
194
|
number: {
|
|
191
195
|
type: 'string',
|
|
@@ -218,12 +222,15 @@ export function createQuoteTools(env: QuoteToolEnv) {
|
|
|
218
222
|
},
|
|
219
223
|
pcb_bcount: {
|
|
220
224
|
type: 'integer',
|
|
221
|
-
description:
|
|
225
|
+
description:
|
|
226
|
+
'Embedded PCB panel quantity, >= 1. Default 5. NOTE: the embedded board size ' +
|
|
227
|
+
'(pcb_blength/pcb_bwidth) is also used as the assembly panel size (panel = single ' +
|
|
228
|
+
'board) when no explicit panel size is given — the Intl SMT endpoint rejects the ' +
|
|
229
|
+
'request otherwise ("pcb_width can not empty", response_code 1003).',
|
|
222
230
|
},
|
|
223
231
|
...edaFlagProps,
|
|
224
232
|
},
|
|
225
|
-
output: { schema: { type: 'json' }, render: renderJson },
|
|
226
|
-
async execute(args: unknown, exec: ToolExecLike): Promise<Json> {
|
|
233
|
+
output: { schema: { type: 'json' }, render: renderJson }, async execute(args: unknown, exec: ToolExecLike): Promise<Json> {
|
|
227
234
|
const a = args as Record<string, unknown>
|
|
228
235
|
const form: Record<string, unknown> = {}
|
|
229
236
|
if (a.number !== undefined) form.number = a.number
|