@huaqiu/hardware-artifacts 0.7.20 → 0.7.21

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 validationSummary, B as parsePositions, D as PackageValidation, E as PackageIssueCode, F as ORDER_SOURCE_TID, G as smtOrderForm, H as pcbOrderUrl, I as PositionRow, J as snapHoleTier, K as smtOrderUrl, L as orderBomCsv, M as DEFAULT_ORDER_BASE_URL, N as DEFAULT_ORDER_PAGE_BASE, O as expectedCopperLayers, P as ORDER_PATHS, R as orderBomRows, T as PackageIssue, U as positionsCsv, V as pcbOrderForm, W as readBoardFacts, X as snapTraceTier, Y as snapThickness, _ as OrderConfigInfo, a as FabricationResult, b as PlaceOrderResult, c as HardwareArtifact, d as HardwareProject, f as InstallationInfo, g as OpenArtifactResult, h as OpenArtifactRequest, i as DiscoveryResult, j as BoardFacts, k as validateFabricationPackage, l as HardwareArtifactService, m as NativeApplication, p as Installations, q as smtOrderUrlFromBackend, t as ArtifactKind, u as HardwareArtifactsOptions, y as PlaceOrderRequest, z as orderIdsFromUrl } from "./service-BGecln85.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-D78ML_ef.mjs";
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";
3
3
  import Schema from "@deepseek-ai/schemastery";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  //#region src/tools.d.ts
@@ -120,4 +120,4 @@ declare module '@deepseek-ai/cordis' {
120
120
  }
121
121
  declare function apply(ctx: Context, config?: HardwareArtifactsPluginConfig): void;
122
122
  //#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 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 };
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 };
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-Bo58tzXv.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";
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";
@@ -1,4 +1,4 @@
1
- import { l as HardwareArtifactService } from "./service-BGecln85.mjs";
1
+ import { l as HardwareArtifactService } from "./service-DQV0soSK.mjs";
2
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
3
  //#region src/toolchain/dialog.d.ts
4
4
  /** One file-type filter row. */
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-D78ML_ef.mjs";
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";
2
2
  export { HARDWARE_ROUTE_PREFIX, HardwareHandlerOptions, TOOLCHAIN_ROUTE_PREFIX, WorkspaceResolver, createHardwareHandler };
package/lib/routes.mjs CHANGED
@@ -318,16 +318,6 @@ function createHardwareHandler(service, options = {}) {
318
318
  }
319
319
  if (req.method === "POST" && p === `/api/v1/hardware/order/pcb`) {
320
320
  const body = await readJson(req);
321
- if (body.confirm !== true) {
322
- sendJson(res, 400, {
323
- ok: false,
324
- error: {
325
- code: "confirmation-required",
326
- message: "placing an order uploads the board files and requires explicit confirmation"
327
- }
328
- });
329
- return;
330
- }
331
321
  const artifactPath = asString(body.path);
332
322
  if (artifactPath === void 0) {
333
323
  sendJson(res, 400, {
@@ -361,16 +351,6 @@ function createHardwareHandler(service, options = {}) {
361
351
  }
362
352
  if (req.method === "POST" && p === `/api/v1/hardware/order/smt`) {
363
353
  const body = await readJson(req);
364
- if (body.confirm !== true) {
365
- sendJson(res, 400, {
366
- ok: false,
367
- error: {
368
- code: "confirmation-required",
369
- message: "placing an assembly order uploads the board, BOM and positions and requires explicit confirmation"
370
- }
371
- });
372
- return;
373
- }
374
354
  const artifactPath = asString(body.path);
375
355
  if (artifactPath === void 0) {
376
356
  sendJson(res, 400, {
@@ -212,6 +212,12 @@ interface HardwareArtifact {
212
212
  /** Content hash of the saved source, filled when the source is read. */
213
213
  readonly revision?: string;
214
214
  }
215
+ /** What one manufacturing operation needs from a project, and whether it has it. */
216
+ interface OrderReadiness {
217
+ readonly ready: boolean;
218
+ /** Why the operation is unavailable; absent when `ready`. */
219
+ readonly reason?: string;
220
+ }
215
221
  interface HardwareProject {
216
222
  readonly path: string;
217
223
  readonly name: string;
@@ -227,6 +233,19 @@ interface HardwareProject {
227
233
  readonly boards: readonly HardwareArtifact[];
228
234
  readonly mechanical: readonly HardwareArtifact[];
229
235
  readonly selectionRequired: boolean;
236
+ /**
237
+ * Static order readiness, derived from the artifacts the project already has.
238
+ *
239
+ * Deliberately conservative: PCB needs a saved board; assembly needs a board
240
+ * *and* the project schematic, because the positions and the BOM are exported
241
+ * from it. Neither says anything about KiCad being installed or the user being
242
+ * signed in — those live in the order config, and the panel asks the Host for
243
+ * them separately rather than guessing here.
244
+ */
245
+ readonly order: {
246
+ readonly pcb: OrderReadiness;
247
+ readonly pcba: OrderReadiness;
248
+ };
230
249
  }
231
250
  interface DiscoveryResult {
232
251
  readonly cwd: string;
@@ -656,4 +675,4 @@ declare function parseCsv(text: string): string[][];
656
675
  */
657
676
  declare function groupBomRows(table: readonly string[][]): BomRow[];
658
677
  //#endregion
659
- export { validationSummary as A, parsePositions as B, groupBomRows as C, PackageValidation as D, PackageIssueCode as E, ORDER_SOURCE_TID as F, smtOrderForm as G, pcbOrderUrl as H, PositionRow as I, snapHoleTier as J, smtOrderUrl as K, orderBomCsv as L, DEFAULT_ORDER_BASE_URL as M, DEFAULT_ORDER_PAGE_BASE as N, expectedCopperLayers as O, ORDER_PATHS as P, orderBomRows as R, SourceResult as S, PackageIssue as T, positionsCsv as U, pcbOrderForm as V, readBoardFacts as W, snapTraceTier as X, snapThickness as Y, OrderConfigInfo as _, FabricationResult as a, PlaceOrderResult as b, HardwareArtifact as c, HardwareProject as d, InstallationInfo as f, OpenArtifactResult as g, OpenArtifactRequest as h, DiscoveryResult as i, BoardFacts as j, validateFabricationPackage as k, HardwareArtifactService as l, NativeApplication as m, BomResult as n, GlbRequest as o, Installations as p, smtOrderUrlFromBackend as q, BomRow as r, GlbResult as s, ArtifactKind as t, HardwareArtifactsOptions as u, OrderPackageSummary as v, parseCsv as w, SourceRequest as x, PlaceOrderRequest as y, orderIdsFromUrl as z };
678
+ export { validateFabricationPackage as A, orderIdsFromUrl as B, SourceResult as C, PackageIssueCode as D, PackageIssue as E, ORDER_PATHS as F, readBoardFacts as G, pcbOrderForm as H, ORDER_SOURCE_TID as I, smtOrderUrlFromBackend as J, smtOrderForm as K, PositionRow as L, BoardFacts as M, DEFAULT_ORDER_BASE_URL as N, PackageValidation as O, DEFAULT_ORDER_PAGE_BASE as P, orderBomCsv as R, SourceRequest as S, parseCsv as T, pcbOrderUrl as U, parsePositions as V, positionsCsv as W, snapThickness as X, snapHoleTier as Y, snapTraceTier as Z, OrderConfigInfo as _, FabricationResult as a, PlaceOrderRequest as b, HardwareArtifact as c, HardwareProject as d, InstallationInfo as f, OpenArtifactResult as g, OpenArtifactRequest as h, DiscoveryResult as i, validationSummary as j, expectedCopperLayers as k, HardwareArtifactService as l, NativeApplication as m, BomResult as n, GlbRequest as o, Installations as p, smtOrderUrl as q, BomRow as r, GlbResult as s, ArtifactKind as t, HardwareArtifactsOptions as u, OrderPackageSummary as v, groupBomRows as w, PlaceOrderResult as x, OrderReadiness as y, orderBomRows as z };
@@ -1669,6 +1669,19 @@ var HardwareArtifactService = class {
1669
1669
  const mechanical = manifest?.mechanical !== void 0 ? manifest.mechanical.map((model) => artifact("mechanical-3d", resolvePath(model.path), projectPath)) : walkFiles(dir, (file) => MECHANICAL_EXTENSIONS.has(extname(file).toLowerCase())).map((path) => artifact("mechanical-3d", path, projectPath));
1670
1670
  const sourceSchematic = schematicPath === void 0 ? void 0 : artifact("schematic", schematicPath, projectPath);
1671
1671
  const sourceBoard = ownershipAmbiguous ? void 0 : owned;
1672
+ const order = {
1673
+ pcb: boards.length === 0 ? {
1674
+ ready: false,
1675
+ reason: "no-board"
1676
+ } : { ready: true },
1677
+ pcba: boards.length === 0 ? {
1678
+ ready: false,
1679
+ reason: "no-board"
1680
+ } : sourceSchematic === void 0 ? {
1681
+ ready: false,
1682
+ reason: "no-schematic"
1683
+ } : { ready: true }
1684
+ };
1672
1685
  return {
1673
1686
  path: projectPath,
1674
1687
  name,
@@ -1690,7 +1703,8 @@ var HardwareArtifactService = class {
1690
1703
  sheets,
1691
1704
  boards,
1692
1705
  mechanical,
1693
- selectionRequired: boards.length > 1 && ownershipAmbiguous
1706
+ selectionRequired: boards.length > 1 && ownershipAmbiguous,
1707
+ order
1694
1708
  };
1695
1709
  }
1696
1710
  /** Validate and launch a native application without a shell. */
package/lib/service.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { C as groupBomRows, S as SourceResult, _ as OrderConfigInfo, a as FabricationResult, b as PlaceOrderResult, c as HardwareArtifact, d as HardwareProject, f as InstallationInfo, g as OpenArtifactResult, h as OpenArtifactRequest, i as DiscoveryResult, l as HardwareArtifactService, m as NativeApplication, n as BomResult, o as GlbRequest, p as Installations, r as BomRow, s as GlbResult, t as ArtifactKind, u as HardwareArtifactsOptions, v as OrderPackageSummary, w as parseCsv, x as SourceRequest, y as PlaceOrderRequest } from "./service-BGecln85.mjs";
2
- export { ArtifactKind, BomResult, BomRow, DiscoveryResult, FabricationResult, GlbRequest, GlbResult, HardwareArtifact, HardwareArtifactService, HardwareArtifactsOptions, HardwareProject, InstallationInfo, Installations, NativeApplication, OpenArtifactRequest, OpenArtifactResult, OrderConfigInfo, OrderPackageSummary, PlaceOrderRequest, PlaceOrderResult, SourceRequest, SourceResult, groupBomRows, parseCsv };
1
+ import { C as SourceResult, S as SourceRequest, T as parseCsv, _ 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, l as HardwareArtifactService, m as NativeApplication, n as BomResult, o as GlbRequest, p as Installations, r as BomRow, s as GlbResult, t as ArtifactKind, u as HardwareArtifactsOptions, v as OrderPackageSummary, w as groupBomRows, x as PlaceOrderResult, y as OrderReadiness } from "./service-DQV0soSK.mjs";
2
+ export { ArtifactKind, BomResult, BomRow, DiscoveryResult, FabricationResult, GlbRequest, GlbResult, HardwareArtifact, HardwareArtifactService, HardwareArtifactsOptions, HardwareProject, InstallationInfo, Installations, NativeApplication, OpenArtifactRequest, OpenArtifactResult, OrderConfigInfo, OrderPackageSummary, OrderReadiness, PlaceOrderRequest, PlaceOrderResult, SourceRequest, SourceResult, groupBomRows, parseCsv };
package/lib/service.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as groupBomRows, r as parseCsv, t as HardwareArtifactService } from "./service-Bo58tzXv.mjs";
1
+ import { n as groupBomRows, r as parseCsv, t as HardwareArtifactService } from "./service-JazWEnwB.mjs";
2
2
  export { HardwareArtifactService, groupBomRows, parseCsv };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaqiu/hardware-artifacts",
3
- "version": "0.7.20",
3
+ "version": "0.7.21",
4
4
  "type": "module",
5
5
  "description": "Hardware Engineering host capability: deterministic artifact discovery, installation resolution, native application launch and compact agent context.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -26,6 +26,7 @@ export type {
26
26
  OpenArtifactRequest,
27
27
  OpenArtifactResult,
28
28
  OrderConfigInfo,
29
+ OrderReadiness,
29
30
  PlaceOrderRequest,
30
31
  PlaceOrderResult,
31
32
  } from './service.js'
package/src/routes.ts CHANGED
@@ -291,17 +291,11 @@ export function createHardwareHandler(
291
291
  return
292
292
  }
293
293
  if (req.method === 'POST' && p === `${HARDWARE_ROUTE_PREFIX}/order/pcb`) {
294
+ // No confirmation flag: the user's click on the order card is the
295
+ // request, and the panel shows the package before it appears. The
296
+ // agent's own tools keep their `confirm` argument; that is a model
297
+ // guard, not a second upload dialog.
294
298
  const body = await readJson(req) as Record<string, unknown>
295
- if (body.confirm !== true) {
296
- sendJson(res, 400, {
297
- ok: false,
298
- error: {
299
- code: 'confirmation-required',
300
- message: 'placing an order uploads the board files and requires explicit confirmation',
301
- },
302
- })
303
- return
304
- }
305
299
  const artifactPath = asString(body.path)
306
300
  if (artifactPath === undefined) {
307
301
  sendJson(res, 400, { ok: false, error: { code: 'invalid-request', message: 'path is required' } })
@@ -326,17 +320,8 @@ export function createHardwareHandler(
326
320
  return
327
321
  }
328
322
  if (req.method === 'POST' && p === `${HARDWARE_ROUTE_PREFIX}/order/smt`) {
323
+ // Same one-click contract as PCB: no confirmation-required gate.
329
324
  const body = await readJson(req) as Record<string, unknown>
330
- if (body.confirm !== true) {
331
- sendJson(res, 400, {
332
- ok: false,
333
- error: {
334
- code: 'confirmation-required',
335
- message: 'placing an assembly order uploads the board, BOM and positions and requires explicit confirmation',
336
- },
337
- })
338
- return
339
- }
340
325
  const artifactPath = asString(body.path)
341
326
  if (artifactPath === undefined) {
342
327
  sendJson(res, 400, { ok: false, error: { code: 'invalid-request', message: 'path is required' } })
package/src/service.ts CHANGED
@@ -39,6 +39,13 @@ export interface HardwareArtifact {
39
39
  readonly revision?: string
40
40
  }
41
41
 
42
+ /** What one manufacturing operation needs from a project, and whether it has it. */
43
+ export interface OrderReadiness {
44
+ readonly ready: boolean
45
+ /** Why the operation is unavailable; absent when `ready`. */
46
+ readonly reason?: string
47
+ }
48
+
42
49
  export interface HardwareProject {
43
50
  readonly path: string
44
51
  readonly name: string
@@ -54,6 +61,19 @@ export interface HardwareProject {
54
61
  readonly boards: readonly HardwareArtifact[]
55
62
  readonly mechanical: readonly HardwareArtifact[]
56
63
  readonly selectionRequired: boolean
64
+ /**
65
+ * Static order readiness, derived from the artifacts the project already has.
66
+ *
67
+ * Deliberately conservative: PCB needs a saved board; assembly needs a board
68
+ * *and* the project schematic, because the positions and the BOM are exported
69
+ * from it. Neither says anything about KiCad being installed or the user being
70
+ * signed in — those live in the order config, and the panel asks the Host for
71
+ * them separately rather than guessing here.
72
+ */
73
+ readonly order: {
74
+ readonly pcb: OrderReadiness
75
+ readonly pcba: OrderReadiness
76
+ }
57
77
  }
58
78
 
59
79
  export interface DiscoveryResult {
@@ -849,6 +869,17 @@ export class HardwareArtifactService {
849
869
 
850
870
  const sourceSchematic = schematicPath === undefined ? undefined : artifact('schematic', schematicPath, projectPath)
851
871
  const sourceBoard = ownershipAmbiguous ? undefined : owned
872
+ // Order readiness is a statement about the files, not about the toolchain:
873
+ // a board can be packaged whatever KiCad's state is, and assembly additionally
874
+ // needs the schematic the positions and BOM are exported from.
875
+ const order = {
876
+ pcb: boards.length === 0 ? { ready: false, reason: 'no-board' } : { ready: true },
877
+ pcba: boards.length === 0
878
+ ? { ready: false, reason: 'no-board' }
879
+ : sourceSchematic === undefined
880
+ ? { ready: false, reason: 'no-schematic' }
881
+ : { ready: true },
882
+ } as const
852
883
  return {
853
884
  path: projectPath,
854
885
  name,
@@ -864,6 +895,7 @@ export class HardwareArtifactService {
864
895
  boards,
865
896
  mechanical,
866
897
  selectionRequired: boards.length > 1 && ownershipAmbiguous,
898
+ order,
867
899
  }
868
900
  }
869
901