altium-toolkit 1.4.17 → 1.4.18

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/docs/api.md CHANGED
@@ -619,3 +619,13 @@ Each script reads one input file and writes text, CSV, or JSON to stdout. The
619
619
  corpus smoke script reads a caller-provided directory and can include aggregate
620
620
  parser coverage and field-gap counters. The scripts are examples of library
621
621
  usage, not installed package binaries.
622
+
623
+ ## Loaded queries and retained native models
624
+
625
+ `LoadedDesignNetlistService` also accepts canonical document envelopes whose
626
+ explicit `extensions.altium.native` field retains the normalized source model.
627
+ The library resolves that model before design discovery, component/net queries,
628
+ and traversal, preserving session ids and active selection. Callers do not need
629
+ to unwrap documents or add legacy properties to the canonical envelope.
630
+ Canonical documents without a retained native model should use the shared
631
+ `QueryService` from `altium-toolkit/query` instead of this native query API.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "altium-toolkit",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "Altium document parsing and non-interactive rendering utilities",
5
5
  "keywords": [
6
6
  "altium",
@@ -2,6 +2,7 @@
2
2
  //
3
3
  // SPDX-License-Identifier: GPL-3.0-or-later
4
4
 
5
+ import { AltiumExtensionResolver } from '../../convergence/AltiumExtensionResolver.mjs'
5
6
  import { ComponentGrouping, MPN_MISSING_NOTE } from './ComponentGrouping.mjs'
6
7
  import { CircuitTraversal } from './CircuitTraversal.mjs'
7
8
  import { QueryNetlistBuilder } from './QueryNetlistBuilder.mjs'
@@ -571,7 +572,10 @@ export class LoadedDesignNetlistService {
571
572
  * @returns {object}
572
573
  */
573
574
  static #normalizeEntry(entry) {
574
- const documentModel = entry?.documentModel || entry
575
+ const sourceDocument = entry?.documentModel || entry
576
+ const documentModel =
577
+ AltiumExtensionResolver.nativeModel(sourceDocument) ||
578
+ sourceDocument
575
579
  return {
576
580
  id: String(entry?.id || documentModel?.id || ''),
577
581
  active: entry?.active === true,