@huaqiu/hardware-artifacts 0.7.23 → 0.7.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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as validateFabricationPackage, B as orderIdsFromUrl, D as PackageIssueCode, E as PackageIssue, F as ORDER_PATHS, G as readBoardFacts, H as pcbOrderForm, I as ORDER_SOURCE_TID, J as smtOrderUrlFromBackend, K as smtOrderForm, L as PositionRow, M as BoardFacts, N as DEFAULT_ORDER_BASE_URL, O as PackageValidation, P as DEFAULT_ORDER_PAGE_BASE, R as orderBomCsv, U as pcbOrderUrl, V as parsePositions, W as positionsCsv, X as snapThickness, Y as snapHoleTier, Z as snapTraceTier, _ as OrderConfigInfo, a as FabricationResult, b as PlaceOrderRequest, c as HardwareArtifact, d as HardwareProject, f as InstallationInfo, g as OpenArtifactResult, h as OpenArtifactRequest, i as DiscoveryResult, j as validationSummary, k as expectedCopperLayers, l as HardwareArtifactService, m as NativeApplication, p as Installations, q as smtOrderUrl, t as ArtifactKind, u as HardwareArtifactsOptions, x as PlaceOrderResult, y as OrderReadiness, z as orderBomRows } from "./service-DQV0soSK.mjs";
2
- import { _ as ManifestFailure, a as createHardwareHandler, b as ToolchainSource, c as ToolchainManager, d as ToolchainStatus, f as ValidationOutcome, g as ManifestEntry, h as InstallPhase, i as WorkspaceResolver, l as ToolchainManagerOptions, m as InstallJobSnapshot, n as HardwareHandlerOptions, o as ToolStatus, p as InstallErrorCode, r as TOOLCHAIN_ROUTE_PREFIX, s as ToolchainConfigPatch, t as HARDWARE_ROUTE_PREFIX, u as ToolchainSettings, v as ToolDiscovery, y as ToolchainId } from "./routes-CzTSZSfL.mjs";
1
+ import { $ as BoardFacts, B as SmtQuote, C as QuotePcbResult, F as QUOTE_PATHS, G as pcbQuoteForm, H as leadTimeDays, I as QuoteColor, J as PackageIssueCode, K as smtQuoteForm, L as QuoteDelivery, M as DEFAULT_QUOTE_QUANTITY, N as PcbQuote, P as PcbQuoteOverrides, Q as validationSummary, R as QuoteFee, S as QuotePcbRequest, T as QuoteSmtResult, U as parsePcbQuote, V as SmtQuoteOverrides, W as parseSmtQuote, X as expectedCopperLayers, Y as PackageValidation, Z as validateFabricationPackage, _ as OrderConfigInfo, _t as snapThickness, a as FabricationResult, at as orderBomCsv, b as PlaceOrderRequest, c as HardwareArtifact, ct as parsePositions, d as HardwareProject, dt as positionsCsv, et as DEFAULT_ORDER_BASE_URL, f as InstallationInfo, ft as readBoardFacts, g as OpenArtifactResult, gt as snapHoleTier, h as OpenArtifactRequest, ht as smtOrderUrlFromBackend, i as DiscoveryResult, it as PositionRow, j as DEFAULT_QUOTE_BASE_URL, l as HardwareArtifactService, lt as pcbOrderForm, m as NativeApplication, mt as smtOrderUrl, nt as ORDER_PATHS, ot as orderBomRows, p as Installations, pt as smtOrderForm, q as PackageIssue, rt as ORDER_SOURCE_TID, st as orderIdsFromUrl, t as ArtifactKind, tt as DEFAULT_ORDER_PAGE_BASE, u as HardwareArtifactsOptions, ut as pcbOrderUrl, vt as snapTraceTier, w as QuoteSmtRequest, x as PlaceOrderResult, y as OrderReadiness, z as QuoteSurfaceFinish } from "./service-DDUXPMvb.mjs";
2
+ import { _ as ManifestFailure, a as createHardwareHandler, b as ToolchainSource, c as ToolchainManager, d as ToolchainStatus, f as ValidationOutcome, g as ManifestEntry, h as InstallPhase, i as WorkspaceResolver, l as ToolchainManagerOptions, m as InstallJobSnapshot, n as HardwareHandlerOptions, o as ToolStatus, p as InstallErrorCode, r as TOOLCHAIN_ROUTE_PREFIX, s as ToolchainConfigPatch, t as HARDWARE_ROUTE_PREFIX, u as ToolchainSettings, v as ToolDiscovery, y as ToolchainId } from "./routes-DgdeewkN.mjs";
3
3
  import Schema from "@deepseek-ai/schemastery";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  //#region src/tools.d.ts
@@ -19,6 +19,73 @@ declare function createHardwareTools(env: HardwareToolEnv): import("@deepseek-ai
19
19
  /** The tool names this package registers; the bundle test asserts them. */
20
20
  declare function hardwareToolNames(): string[];
21
21
  //#endregion
22
+ //#region src/solidcraft-inputs.d.ts
23
+ /**
24
+ * What SolidCraft verifiably opens, and what it only writes.
25
+ *
26
+ * This list is **evidence**, not preference. It was read from the installed
27
+ * distribution's own command surface (`solidcraft-cli.exe --help` and
28
+ * `solidcraft-cli.exe commands export`, SolidCraft 0.49.1, `7b2bd2be`):
29
+ *
30
+ * - Native *inputs* are the two the CLI takes positionally or after `--in`:
31
+ * `<design.sc|part.step>`. `.stp` is the same STEP family the reader accepts.
32
+ * - `.stl`, `.obj`, `.3mf`, `.glb` and friends are `file.export*` **outputs**,
33
+ * not inputs. Other formats reach a design only through an installed importer
34
+ * *plugin* (`file.import`, `plugin.list importers`), whose presence is per
35
+ * machine and therefore cannot be promised by a document action.
36
+ *
37
+ * Keeping this list here — one module, imported by the launch path, the
38
+ * capability report and the agent prompt — is what stops the product from
39
+ * inheriting the *previewer's* format list. §7.1 of the task says exactly that:
40
+ * a format Three.js can draw is not thereby a format SolidCraft can open.
41
+ *
42
+ * @module @huaqiu/hardware-artifacts/solidcraft-inputs
43
+ */
44
+ /** Suffixes SolidCraft 0.49.1 opens without an importer plugin, lower case, no dot. */
45
+ declare const SOLIDCRAFT_INPUT_EXTENSIONS: readonly string[];
46
+ /** Display form of {@link SOLIDCRAFT_INPUT_EXTENSIONS}, for capability text and prompts. */
47
+ declare const SOLIDCRAFT_INPUT_FORMATS: readonly string[];
48
+ /**
49
+ * Is this path one SolidCraft opens natively?
50
+ * @param path - any filesystem path or bare file name; only its suffix is read.
51
+ * @returns true for a verified SolidCraft input, false for everything else.
52
+ */
53
+ declare function isSolidcraftInput(path: string): boolean;
54
+ //#endregion
55
+ //#region src/kicad-inputs.d.ts
56
+ /**
57
+ * What KiCad verifiably opens as a *design document*, and what it does not.
58
+ *
59
+ * This list is the routing table's KiCad half, and it is deliberately short:
60
+ * each suffix here has an editor resolution behind it in `service.open()` —
61
+ * `eeschema` for a schematic, `pcbnew` for a board, `kicad` for a project — and
62
+ * that resolution is what the launch path has always used and what the tests
63
+ * exercise. A suffix without an editor is not offered, because §2 of the
64
+ * toolchain-aware open-in-app task enables a format only after its support is
65
+ * verified rather than assumed.
66
+ *
67
+ * `.kicad_wks` is the case that proves the rule: KiCad's page-layout editor does
68
+ * open worksheet files from its own File menu, but this product resolves no
69
+ * worksheet editor, has no launch path for one, and therefore does not claim it.
70
+ * Adding it later is adding a resolution *and* a test, not adding a string here.
71
+ *
72
+ * The list lives in this module — not in the client action, not in the previewer
73
+ * — so the document action, the launch route and the agent prompt cannot
74
+ * disagree about what a KiCad hand-off accepts.
75
+ *
76
+ * @module @huaqiu/hardware-artifacts/kicad-inputs
77
+ */
78
+ /** Suffixes KiCad's editors open as design documents, lower case, no dot. */
79
+ declare const KICAD_INPUT_EXTENSIONS: readonly string[];
80
+ /** Display form of {@link KICAD_INPUT_EXTENSIONS}, for capability text and prompts. */
81
+ declare const KICAD_INPUT_FORMATS: readonly string[];
82
+ /**
83
+ * Is this path a KiCad document this product can hand to a configured editor?
84
+ * @param path - any filesystem path or bare file name; only its suffix is read.
85
+ * @returns true for a verified KiCad design document, false for everything else.
86
+ */
87
+ declare function isKicadInput(path: string): boolean;
88
+ //#endregion
22
89
  //#region src/index.d.ts
23
90
  declare const name = "@huaqiu/hardware-artifacts";
24
91
  declare const inject: readonly ["webServer", "systemPrompt"];
@@ -120,4 +187,4 @@ declare module '@deepseek-ai/cordis' {
120
187
  }
121
188
  declare function apply(ctx: Context, config?: HardwareArtifactsPluginConfig): void;
122
189
  //#endregion
123
- export { type ArtifactKind, type BoardFacts, Config, ConfigValue, DEFAULT_ORDER_BASE_URL, DEFAULT_ORDER_PAGE_BASE, type DiscoveryResult, type FabricationResult, HARDWARE_ROUTE_PREFIX, type HardwareArtifact, HardwareArtifactService, type HardwareArtifactsOptions, HardwareArtifactsPluginConfig, type HardwareHandlerOptions, type HardwareProject, type HardwareToolEnv, type InstallErrorCode, type InstallJobSnapshot, type InstallPhase, type InstallationInfo, type Installations, type ManifestEntry, type ManifestFailure, type NativeApplication, ORDER_PATHS, ORDER_SOURCE_TID, type OpenArtifactRequest, type OpenArtifactResult, type OrderConfigInfo, type OrderReadiness, type PackageIssue, type PackageIssueCode, type PackageValidation, type PlaceOrderRequest, type PlaceOrderResult, type PositionRow, TOOLCHAIN_ROUTE_PREFIX, type ToolDiscovery, type ToolStatus, type ToolchainConfigPatch, type ToolchainId, ToolchainManager, type ToolchainManagerOptions, type ToolchainSettings, type ToolchainSource, type ToolchainStatus, type ValidationOutcome, type WorkspaceResolver, apply, createHardwareHandler, createHardwareTools, expectedCopperLayers, hardwareToolNames, inject, name, orderBomCsv, orderBomRows, orderIdsFromUrl, parsePositions, pcbOrderForm, pcbOrderUrl, positionsCsv, readBoardFacts, smtOrderForm, smtOrderUrl, smtOrderUrlFromBackend, snapHoleTier, snapThickness, snapTraceTier, validateFabricationPackage, validationSummary };
190
+ export { type ArtifactKind, type BoardFacts, Config, ConfigValue, DEFAULT_ORDER_BASE_URL, DEFAULT_ORDER_PAGE_BASE, DEFAULT_QUOTE_BASE_URL, DEFAULT_QUOTE_QUANTITY, type DiscoveryResult, type FabricationResult, HARDWARE_ROUTE_PREFIX, type HardwareArtifact, HardwareArtifactService, type HardwareArtifactsOptions, HardwareArtifactsPluginConfig, type HardwareHandlerOptions, type HardwareProject, type HardwareToolEnv, type InstallErrorCode, type InstallJobSnapshot, type InstallPhase, type InstallationInfo, type Installations, KICAD_INPUT_EXTENSIONS, KICAD_INPUT_FORMATS, type ManifestEntry, type ManifestFailure, type NativeApplication, ORDER_PATHS, ORDER_SOURCE_TID, type OpenArtifactRequest, type OpenArtifactResult, type OrderConfigInfo, type OrderReadiness, type PackageIssue, type PackageIssueCode, type PackageValidation, type PcbQuote, type PcbQuoteOverrides, type PlaceOrderRequest, type PlaceOrderResult, type PositionRow, QUOTE_PATHS, type QuoteColor, type QuoteDelivery, type QuoteFee, type QuotePcbRequest, type QuotePcbResult, type QuoteSmtRequest, type QuoteSmtResult, type QuoteSurfaceFinish, SOLIDCRAFT_INPUT_EXTENSIONS, SOLIDCRAFT_INPUT_FORMATS, type SmtQuote, type SmtQuoteOverrides, TOOLCHAIN_ROUTE_PREFIX, type ToolDiscovery, type ToolStatus, type ToolchainConfigPatch, type ToolchainId, ToolchainManager, type ToolchainManagerOptions, type ToolchainSettings, type ToolchainSource, type ToolchainStatus, type ValidationOutcome, type WorkspaceResolver, apply, createHardwareHandler, createHardwareTools, expectedCopperLayers, hardwareToolNames, inject, isKicadInput, isSolidcraftInput, leadTimeDays, name, orderBomCsv, orderBomRows, orderIdsFromUrl, parsePcbQuote, parsePositions, parseSmtQuote, pcbOrderForm, pcbOrderUrl, pcbQuoteForm, positionsCsv, readBoardFacts, smtOrderForm, smtOrderUrl, smtOrderUrlFromBackend, smtQuoteForm, snapHoleTier, snapThickness, snapTraceTier, validateFabricationPackage, validationSummary };
package/lib/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { HARDWARE_ROUTE_PREFIX, TOOLCHAIN_ROUTE_PREFIX, createHardwareHandler } from "./routes.mjs";
2
- import { A as snapTraceTier, C as positionsCsv, D as smtOrderUrlFromBackend, E as smtOrderUrl, O as snapHoleTier, S as pcbOrderUrl, T as smtOrderForm, _ as orderBomCsv, a as installRootFromExecutable, b as parsePositions, c as normalizeVersion, d as validateFabricationPackage, f as validationSummary, g as ORDER_SOURCE_TID, h as ORDER_PATHS, i as canonicalPath, k as snapThickness, l as resolveToolchain, m as DEFAULT_ORDER_PAGE_BASE, o as installationRootOf, p as DEFAULT_ORDER_BASE_URL, s as label, t as HardwareArtifactService, u as expectedCopperLayers, v as orderBomRows, w as readBoardFacts, x as pcbOrderForm, y as orderIdsFromUrl } from "./service-JazWEnwB.mjs";
2
+ import { A as ORDER_SOURCE_TID, B as smtOrderUrl, C as validationSummary, D as DEFAULT_ORDER_BASE_URL, E as isKicadInput, F as pcbOrderForm, H as snapHoleTier, I as pcbOrderUrl, L as positionsCsv, M as orderBomRows, N as orderIdsFromUrl, O as DEFAULT_ORDER_PAGE_BASE, P as parsePositions, R as readBoardFacts, S as validateFabricationPackage, T as KICAD_INPUT_FORMATS, U as snapThickness, V as smtOrderUrlFromBackend, W as snapTraceTier, _ as parsePcbQuote, a as installRootFromExecutable, b as smtQuoteForm, c as normalizeVersion, d as SOLIDCRAFT_INPUT_FORMATS, f as isSolidcraftInput, g as leadTimeDays, h as QUOTE_PATHS, i as canonicalPath, j as orderBomCsv, k as ORDER_PATHS, l as resolveToolchain, m as DEFAULT_QUOTE_QUANTITY, o as installationRootOf, p as DEFAULT_QUOTE_BASE_URL, s as label, t as HardwareArtifactService, u as SOLIDCRAFT_INPUT_EXTENSIONS, v as parseSmtQuote, w as KICAD_INPUT_EXTENSIONS, x as expectedCopperLayers, y as pcbQuoteForm, z as smtOrderForm } from "./service-DFQ0q0uR.mjs";
3
3
  import Schema from "@deepseek-ai/schemastery";
4
4
  import { createReadStream, createWriteStream, existsSync, readdirSync, statSync } from "node:fs";
5
5
  import { execFile } from "node:child_process";
@@ -18,6 +18,8 @@ import { createInflateRaw } from "node:zlib";
18
18
  * hardware_projects which projects/boards this workspace has, and
19
19
  * whether a `kicad-cli` can export from them
20
20
  * hardware_bom the grouped BOM of one root schematic
21
+ * hardware_quote_pcb real-time PCB fabrication price (no order)
22
+ * hardware_quote_smt real-time SMT assembly price (no order)
21
23
  * hardware_fabricate gerber + drill (+ assembly inputs), validated
22
24
  * hardware_place_pcb_order upload the package and enter the hqpcb order flow
23
25
  * hardware_place_smt_order the same for assembly (board zip + BOM + positions)
@@ -30,6 +32,12 @@ import { createInflateRaw } from "node:zlib";
30
32
  * how a working order turned into `403 artifact is outside the authorized
31
33
  * workspace`.
32
34
  *
35
+ * The two quote tools answer "how much?" without touching any of that: they
36
+ * read the board file, post the form to the vendor's anonymous valuation
37
+ * endpoint and return the itemized price. No `kicad-cli`, no upload, no order,
38
+ * no confirmation — asking what something costs must never cost the user an
39
+ * order page.
40
+ *
33
41
  * Every name is prefixed with this plugin's own `hardware_` namespace. The
34
42
  * order tools deliberately do not reuse `@huaqiu/dsh-tool-quote`'s bare
35
43
  * `place_pcb_order`/`place_smt_order`: that plugin drives the EDA host's own
@@ -123,6 +131,58 @@ function placedOrderJson(placed) {
123
131
  ...placed.assembly === void 0 ? {} : { assembly: placed.assembly }
124
132
  });
125
133
  }
134
+ /** One line an agent can relay without re-doing the arithmetic. */
135
+ function priceLine(symbol, quantity, totalPrice, unitPrice, what, leadTimeDays) {
136
+ const each = quantity > 1 ? ` (${symbol}${unitPrice.toFixed(2)} each)` : "";
137
+ const lead = leadTimeDays === void 0 ? "" : `, lead time ${String(leadTimeDays)} days`;
138
+ return `${symbol}${totalPrice.toFixed(2)} for ${String(quantity)} ${quantity === 1 ? "board" : "boards"}${what}${each}${lead}`;
139
+ }
140
+ /** A PCB price: the price, the facts it came from, and the form that was sent. */
141
+ function pcbQuoteJson(quote) {
142
+ return asJson({
143
+ ok: true,
144
+ kind: quote.kind,
145
+ summary: priceLine(quote.currencySymbol, quote.quantity, quote.totalPrice, quote.unitPrice, "", quote.leadTimeDays),
146
+ boardPath: quote.boardPath,
147
+ generatedAt: quote.generatedAt,
148
+ endpoint: quote.endpoint,
149
+ price: {
150
+ currency: quote.currency,
151
+ currencySymbol: quote.currencySymbol,
152
+ quantity: quote.quantity,
153
+ totalPrice: quote.totalPrice,
154
+ unitPrice: quote.unitPrice,
155
+ ...quote.shipping === void 0 ? {} : { shipping: quote.shipping },
156
+ ...quote.leadTimeDays === void 0 ? {} : { leadTimeDays: quote.leadTimeDays },
157
+ items: quote.items,
158
+ delivery: quote.delivery
159
+ },
160
+ facts: quote.facts,
161
+ form: quote.form
162
+ });
163
+ }
164
+ /** An assembly price. The tax split the CN body reports is kept explicit. */
165
+ function smtQuoteJson(quote) {
166
+ return asJson({
167
+ ok: true,
168
+ kind: quote.kind,
169
+ summary: priceLine(quote.currencySymbol, quote.quantity, quote.totalPrice, quote.unitPrice, " assembled"),
170
+ boardPath: quote.boardPath,
171
+ generatedAt: quote.generatedAt,
172
+ endpoint: quote.endpoint,
173
+ price: {
174
+ currency: quote.currency,
175
+ currencySymbol: quote.currencySymbol,
176
+ quantity: quote.quantity,
177
+ totalPrice: quote.totalPrice,
178
+ unitPrice: quote.unitPrice,
179
+ items: quote.items,
180
+ smt: quote.smt
181
+ },
182
+ facts: quote.facts,
183
+ form: quote.form
184
+ });
185
+ }
126
186
  function createHardwareTools(env) {
127
187
  const { service } = env;
128
188
  return [
@@ -213,6 +273,111 @@ function createHardwareTools(env) {
213
273
  }
214
274
  }
215
275
  }),
276
+ defineTool({
277
+ name: "hardware_quote_pcb",
278
+ description: "Get the real-time PCB fabrication price of one .kicad_pcb. Price only: nothing is uploaded, no order is created, and no confirmation is needed — use this whenever the user asks what a board would cost (\"多少钱\", \"报价\", \"打样价格\", \"how much\"), or wants to compare quantity, layer count, thickness, colour or finish. Reads the board file itself (outline size, copper layers, design thickness, min track, min hole, copper weight), so no KiCad installation and no `kicad-cli` run are involved. Prices through Huaqiu China (¥), the same origin hardware_place_pcb_order submits to, and the total INCLUDES shipping. Returns summary (one relay-able line), price.totalPrice, price.unitPrice, price.leadTimeDays, the itemized fees under the vendor's own keys, the delivery options, and the effective `form`. Inspect that form and re-query with an override rather than guessing: `layers` prices a what-if stack-up, `quantity` a different run size. Always state the quantity the total covers. This is a quote, not an order — when the user decides to buy, that is hardware_place_pcb_order with confirm true.",
279
+ parameters: {
280
+ path: {
281
+ type: "string",
282
+ required: true,
283
+ description: "Board (.kicad_pcb) path, absolute or relative to the workspace."
284
+ },
285
+ quantity: {
286
+ type: "integer",
287
+ description: "Boards to price (default 5). `price.totalPrice` covers this many boards and `price.unitPrice` is per board."
288
+ },
289
+ layers: {
290
+ type: "integer",
291
+ description: "Price a different copper layer count than the file has, e.g. 4 for a 2-layer design. The thickness menu, inner copper and TG grade follow that count. Omit to price the board as designed."
292
+ },
293
+ thickness_mm: {
294
+ type: "number",
295
+ description: "Board thickness in mm, snapped onto the fabricator's menu for the layer count. Omit to use the thickness recorded in the board file."
296
+ },
297
+ color: {
298
+ type: "string",
299
+ enum: [
300
+ "green",
301
+ "red",
302
+ "yellow",
303
+ "blue",
304
+ "white",
305
+ "black",
306
+ "matte_black"
307
+ ],
308
+ description: "Solder mask colour. Default green (the order form's default)."
309
+ },
310
+ surface_finish: {
311
+ type: "string",
312
+ enum: [
313
+ "hasl_lf",
314
+ "hasl_lead",
315
+ "enig",
316
+ "osp"
317
+ ],
318
+ description: "Surface finish. Default hasl_lf (lead-free HASL); enig (ENIG) is the pricier upgrade a user usually asks about."
319
+ }
320
+ },
321
+ output: {
322
+ schema: { type: "json" },
323
+ render: renderJson
324
+ },
325
+ async execute(args, exec) {
326
+ const a = args ?? {};
327
+ try {
328
+ const cwd = await workspaceOf(env, exec);
329
+ return pcbQuoteJson(await service.quotePcb({
330
+ boardPath: resolveUnder(cwd, a.path),
331
+ ...typeof a.quantity === "number" ? { quantity: a.quantity } : {},
332
+ ...typeof a.layers === "number" ? { layers: a.layers } : {},
333
+ ...typeof a.thickness_mm === "number" ? { thicknessMm: a.thickness_mm } : {},
334
+ ...typeof a.color === "string" ? { color: a.color } : {},
335
+ ...typeof a.surface_finish === "string" ? { surfaceFinish: a.surface_finish } : {},
336
+ ...exec.signal === void 0 ? {} : { signal: exec.signal }
337
+ }));
338
+ } catch (error) {
339
+ return failure$1(error);
340
+ }
341
+ }
342
+ }),
343
+ defineTool({
344
+ name: "hardware_quote_smt",
345
+ description: "Get the real-time SMT assembly price of one .kicad_pcb. Price only: no BOM is required, nothing is uploaded and no order is created. Use when the user asks about assembly or placement cost (\"贴片多少钱\", \"SMT 报价\", \"焊接费用\", \"assembly cost\"). The pad counts (SMD pads, plated holes) and the distinct value/footprint pairs are read from the board's own footprints, so no BOM export, no KiCad installation and no `kicad-cli` run are involved. Prices through Huaqiu China (¥). Returns price.totalPrice (tax included), price.unitPrice, the itemized assembly fees (stencil, placement, soldering, X-ray …) and `price.smt` with the endpoint's net/tax split, plus the effective `form`. The price is labour + fixtures for the quantity given: it does NOT include component cost, because no part list is supplied — say so instead of implying a complete turnkey quote. Quote, not order: hardware_place_smt_order places it.",
346
+ parameters: {
347
+ path: {
348
+ type: "string",
349
+ required: true,
350
+ description: "Board (.kicad_pcb) path, absolute or relative to the workspace."
351
+ },
352
+ quantity: {
353
+ type: "integer",
354
+ description: "Assembled quantity (default 5). totalPrice covers this many boards."
355
+ },
356
+ sides: {
357
+ type: "string",
358
+ enum: ["single", "double"],
359
+ description: "Single-side or double-side assembly. Default double (the reference default)."
360
+ }
361
+ },
362
+ output: {
363
+ schema: { type: "json" },
364
+ render: renderJson
365
+ },
366
+ async execute(args, exec) {
367
+ const a = args ?? {};
368
+ try {
369
+ const cwd = await workspaceOf(env, exec);
370
+ return smtQuoteJson(await service.quoteSmt({
371
+ boardPath: resolveUnder(cwd, a.path),
372
+ ...typeof a.quantity === "number" ? { quantity: a.quantity } : {},
373
+ ...a.sides === "single" || a.sides === "double" ? { sides: a.sides } : {},
374
+ ...exec.signal === void 0 ? {} : { signal: exec.signal }
375
+ }));
376
+ } catch (error) {
377
+ return failure$1(error);
378
+ }
379
+ }
380
+ }),
216
381
  defineTool({
217
382
  name: "hardware_fabricate",
218
383
  description: "Export and validate the fabrication package for one .kicad_pcb: gerbers, Excellon drill, and — when a schematic is given — the assembly inputs (positions CSV + grouped BOM). Runs `kicad-cli` in the board directory; no PCB editor needs to be open and no HQ Edge service is involved. Returns the board facts read from the file (layers, outline size, thickness, min track/hole, copper weight), the archive manifest, and a `validation` with `ok` plus `errors`/`warnings`. `ok: false` means the package must not be ordered (for example a copper layer that was not plotted, or no board outline): report the issues instead of retrying. Pass `output_dir` when the user wants the files on disk.",
@@ -360,6 +525,8 @@ function hardwareToolNames() {
360
525
  return [
361
526
  "hardware_projects",
362
527
  "hardware_bom",
528
+ "hardware_quote_pcb",
529
+ "hardware_quote_smt",
363
530
  "hardware_fabricate",
364
531
  "hardware_place_pcb_order",
365
532
  "hardware_place_smt_order"
@@ -2163,6 +2330,9 @@ var ToolchainManager = class {
2163
2330
  const base = {
2164
2331
  tool,
2165
2332
  discovery: this.discovery[tool],
2333
+ guiAvailable: resolution.guiAvailable,
2334
+ cliAvailable: resolution.cliAvailable,
2335
+ ...tool === "solidcraft" ? { inputFormats: SOLIDCRAFT_INPUT_FORMATS } : {},
2166
2336
  ...entry === void 0 ? {} : { download: {
2167
2337
  version: entry.version,
2168
2338
  url: entry.url
@@ -2493,11 +2663,15 @@ var ToolchainManager = class {
2493
2663
  };
2494
2664
  }
2495
2665
  /**
2496
- * Compact capability facts for the agent (§12.1).
2666
+ * Compact capability facts for the agent (§12.1 of the toolchain spec, §8 of
2667
+ * the 3D/SolidCraft task).
2497
2668
  *
2498
- * Versions and availability only: an agent needs to know whether an export is
2499
- * possible, not where the binary lives, and the tools resolve the executable
2500
- * themselves from the same configuration.
2669
+ * Versions and availability only: an agent needs to know whether an export or
2670
+ * a hand-off is possible, not where the binary lives, and the tools resolve
2671
+ * the executable themselves from the same configuration. SolidCraft answers
2672
+ * per half — `guiLaunch` is "the document action can hand a file over",
2673
+ * `cliAvailable` is "a command can be run" — and lists the formats that are
2674
+ * verified inputs rather than the formats this product can preview.
2501
2675
  */
2502
2676
  async capabilities() {
2503
2677
  const [kicad, solidcraft] = await Promise.all([this.toolStatus("kicad"), this.toolStatus("solidcraft")]);
@@ -2509,7 +2683,9 @@ var ToolchainManager = class {
2509
2683
  solidcraft: {
2510
2684
  available: solidcraft.state === "configured",
2511
2685
  ...solidcraft.version === void 0 ? {} : { version: solidcraft.version },
2512
- cliAvailable: solidcraft.state === "configured" && solidcraft.cliPath !== void 0
2686
+ guiLaunch: solidcraft.state === "configured" && solidcraft.guiAvailable,
2687
+ cliAvailable: solidcraft.state === "configured" && solidcraft.cliAvailable,
2688
+ inputFormats: SOLIDCRAFT_INPUT_FORMATS
2513
2689
  }
2514
2690
  };
2515
2691
  }
@@ -2705,4 +2881,4 @@ function apply(ctx, config = {}) {
2705
2881
  }), "hardware-artifacts: compact agent environment");
2706
2882
  }
2707
2883
  //#endregion
2708
- export { Config, DEFAULT_ORDER_BASE_URL, DEFAULT_ORDER_PAGE_BASE, HARDWARE_ROUTE_PREFIX, HardwareArtifactService, ORDER_PATHS, ORDER_SOURCE_TID, TOOLCHAIN_ROUTE_PREFIX, ToolchainManager, apply, createHardwareHandler, createHardwareTools, expectedCopperLayers, hardwareToolNames, inject, name, orderBomCsv, orderBomRows, orderIdsFromUrl, parsePositions, pcbOrderForm, pcbOrderUrl, positionsCsv, readBoardFacts, smtOrderForm, smtOrderUrl, smtOrderUrlFromBackend, snapHoleTier, snapThickness, snapTraceTier, validateFabricationPackage, validationSummary };
2884
+ export { Config, DEFAULT_ORDER_BASE_URL, DEFAULT_ORDER_PAGE_BASE, DEFAULT_QUOTE_BASE_URL, DEFAULT_QUOTE_QUANTITY, HARDWARE_ROUTE_PREFIX, HardwareArtifactService, KICAD_INPUT_EXTENSIONS, KICAD_INPUT_FORMATS, ORDER_PATHS, ORDER_SOURCE_TID, QUOTE_PATHS, SOLIDCRAFT_INPUT_EXTENSIONS, SOLIDCRAFT_INPUT_FORMATS, TOOLCHAIN_ROUTE_PREFIX, ToolchainManager, apply, createHardwareHandler, createHardwareTools, expectedCopperLayers, hardwareToolNames, inject, isKicadInput, isSolidcraftInput, leadTimeDays, name, orderBomCsv, orderBomRows, orderIdsFromUrl, parsePcbQuote, parsePositions, parseSmtQuote, pcbOrderForm, pcbOrderUrl, pcbQuoteForm, positionsCsv, readBoardFacts, smtOrderForm, smtOrderUrl, smtOrderUrlFromBackend, smtQuoteForm, snapHoleTier, snapThickness, snapTraceTier, validateFabricationPackage, validationSummary };
@@ -1,4 +1,4 @@
1
- import { l as HardwareArtifactService } from "./service-DQV0soSK.mjs";
1
+ import { l as HardwareArtifactService } from "./service-DDUXPMvb.mjs";
2
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
3
  //#region src/toolchain/dialog.d.ts
4
4
  /** One file-type filter row. */
@@ -210,6 +210,10 @@ interface ToolStatus {
210
210
  readonly installPath?: string;
211
211
  readonly cliPath?: string;
212
212
  readonly appPath?: string;
213
+ /** GUI half present, judged on its own (§6.2). */
214
+ readonly guiAvailable: boolean;
215
+ /** CLI half present, judged on its own (§6.2). */
216
+ readonly cliAvailable: boolean;
213
217
  readonly version?: string;
214
218
  readonly source?: ToolchainSource;
215
219
  readonly validatedAt?: number;
@@ -220,6 +224,11 @@ interface ToolStatus {
220
224
  readonly version: string;
221
225
  readonly url: string;
222
226
  };
227
+ /**
228
+ * Suffixes this tool opens natively, when that is a verified fact rather than
229
+ * an inference. Only SolidCraft publishes one (see `../solidcraft-inputs.ts`).
230
+ */
231
+ readonly inputFormats?: readonly string[];
223
232
  }
224
233
  /** Everything the settings/wizard surface needs, in one poll. */
225
234
  interface ToolchainStatus {
@@ -397,11 +406,15 @@ declare class ToolchainManager {
397
406
  */
398
407
  browse(tool: ToolchainId, signal?: AbortSignal): Promise<BrowseOutcome>;
399
408
  /**
400
- * Compact capability facts for the agent (§12.1).
409
+ * Compact capability facts for the agent (§12.1 of the toolchain spec, §8 of
410
+ * the 3D/SolidCraft task).
401
411
  *
402
- * Versions and availability only: an agent needs to know whether an export is
403
- * possible, not where the binary lives, and the tools resolve the executable
404
- * themselves from the same configuration.
412
+ * Versions and availability only: an agent needs to know whether an export or
413
+ * a hand-off is possible, not where the binary lives, and the tools resolve
414
+ * the executable themselves from the same configuration. SolidCraft answers
415
+ * per half — `guiLaunch` is "the document action can hand a file over",
416
+ * `cliAvailable` is "a command can be run" — and lists the formats that are
417
+ * verified inputs rather than the formats this product can preview.
405
418
  */
406
419
  capabilities(): Promise<{
407
420
  readonly kicad: {
@@ -411,7 +424,12 @@ declare class ToolchainManager {
411
424
  readonly solidcraft: {
412
425
  readonly available: boolean;
413
426
  readonly version?: string;
427
+ /** GUI launch is possible: the executable is present in the configured root. */
428
+ readonly guiLaunch: boolean;
429
+ /** The CLI is present and answered its version probe. */
414
430
  readonly cliAvailable: boolean;
431
+ /** Verified native inputs; never inferred from the document previewer. */
432
+ readonly inputFormats: readonly string[];
415
433
  };
416
434
  }>;
417
435
  }
package/lib/routes.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createHardwareHandler, i as WorkspaceResolver, n as HardwareHandlerOptions, r as TOOLCHAIN_ROUTE_PREFIX, t as HARDWARE_ROUTE_PREFIX } from "./routes-CzTSZSfL.mjs";
1
+ import { a as createHardwareHandler, i as WorkspaceResolver, n as HardwareHandlerOptions, r as TOOLCHAIN_ROUTE_PREFIX, t as HARDWARE_ROUTE_PREFIX } from "./routes-DgdeewkN.mjs";
2
2
  export { HARDWARE_ROUTE_PREFIX, HardwareHandlerOptions, TOOLCHAIN_ROUTE_PREFIX, WorkspaceResolver, createHardwareHandler };
package/lib/routes.mjs CHANGED
@@ -505,11 +505,11 @@ function createHardwareHandler(service, options = {}) {
505
505
  const application = asString(body.application);
506
506
  const artifactPath = asString(body.artifactPath);
507
507
  const kind = asString(body.kind);
508
- if (application !== "kicad") {
508
+ if (application !== "kicad" && application !== "solidcraft") {
509
509
  sendJson(res, 400, {
510
510
  error: {
511
511
  code: "invalid-application",
512
- message: "application must be kicad"
512
+ message: "application must be kicad or solidcraft"
513
513
  },
514
514
  ok: false
515
515
  });
@@ -528,7 +528,7 @@ function createHardwareHandler(service, options = {}) {
528
528
  try {
529
529
  sendJson(res, 200, {
530
530
  ok: true,
531
- ...service.open({
531
+ ...await service.open({
532
532
  application,
533
533
  artifactPath,
534
534
  kind,