@customize-agent/cad-native

中文文档
1.0.3发布于 2026/10/29GPL-3.0-or-later零依赖近 30 天下载 2304

Prebuilt native DWG sidecar (LibreDWG 0.14) for customize-agent

原始使用文档
文档目录6 节
  1. Build LibreDWG 0.14
  2. macOS / Linux
  3. Windows (MSVC / CMake)
  4. Build the sidecar
  5. macOS / Linux
  6. Windows (MSVC, no MinGW)

cad-native

Native DWG-to-DXF-group-code sidecar. It reads a DWG with LibreDWG's C API and writes a DXF pair stream to stdout. It does not call dwg_write_dxf; the existing buildCadScene consumes the output unchanged.

  • LibreDWG: GNU official 0.14 stable source
  • Source archive SHA256: 62ebb73b984f865960f20ed26619ea5f8789d5e3fd088fa40a2598384da81275
  • The corresponding source archive is shipped as libredwg-0.14.tar.xz in this directory for GPL compliance.
  • License: GPL-3.0-or-later (LibreDWG); this sidecar source is GPL-3.0-or-later as a derivative work.
  • The sidecar is built natively on each platform. Do not cross-compile with MinGW: macOS uses Clang, Windows uses MSVC.

Build LibreDWG 0.14

Use the official source from https://ftp.gnu.org/gnu/libredwg/libredwg-0.14.tar.xz.

macOS / Linux

tar -xJf libredwg-0.14.tar.xz
cd libredwg-0.14
./configure --prefix="$PWD/install" --disable-shared --enable-static \
  --disable-bindings --disable-docs --disable-python \
  --disable-dxf --disable-json --disable-write --disable-werror --disable-dependency-tracking
make -j4

The static library is src/.libs/libredwg.a.

Windows (MSVC / CMake)

Build the same LibreDWG 0.14 source with CMake and MSVC (no MinGW), producing redwg.lib. The upstream source ships a CMake build; keep DEBUG_CLASSES enabled if the Windows build needs complete DWG object coverage.

Build the sidecar

macOS / Linux

bash build-macos.sh /path/to/libredwg-0.14   # or build-linux.sh

Windows (MSVC, no MinGW)

Use the official libredwg-0.14-win64.zip from the LibreDWG 0.14 release. The script generates a MSVC import library from the official DLL with dumpbin/lib, compiles the sidecar with CMake + Visual Studio 2022, and copies libredwg-0.dll and its runtime DLLs beside the executable:

.\build-windows.ps1 -LibreDwgWin64Zip C:\path\to\libredwg-0.14-win64.zip

The sidecar links the static MSVC CRT (CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded). It must not depend on VCRUNTIME140.dll or the UCRT: end-user machines without the VC++ 2015-2022 Redistributable would fail to start it at load time (exit 0xC0000135, no stderr). The build script verifies the dependency table with dumpbin /dependents and fails on any MSVC/UCRT runtime DLL.

The build scripts write the result to the platform directory:

  • macOS: native/darwin-arm64/cad-native or native/darwin-x64/cad-native
  • Linux: native/linux-x64/cad-native
  • Windows: native/win32-x64/cad-native.exe (plus the runtime DLLs in the same directory)

@customize-agent/knowledge depends on this package and resolves native/<platform>-<arch>/cad-native inside it; CUSTOMIZE_CAD_NATIVE_BINARY can override the path for tests.

版本与发布记录

@customize-agent/cad-native 共发布 5 个版本,首次发布于 2026/10/27;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.0.3latest2026/10/2913 天前
1.0.22026/10/2814 天前
1.0.12026/10/2715 天前
1.0.02026/10/2715 天前
0.0.0-stage2026/10/2715 天前

关于 @customize-agent/cad-native 的常见问题

@customize-agent/cad-native 是什么?

Prebuilt native DWG sidecar (LibreDWG 0.14) for customize-agent

如何安装 @customize-agent/cad-native?

在项目目录运行 npm install @customize-agent/cad-native,或使用 pnpm add / yarn add / bun add。

@customize-agent/cad-native 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/customize-agent__cad-native 是否存在。

@customize-agent/cad-native 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@customize-agent/cad-native 可以商用吗?

@customize-agent/cad-native 使用 GPL-3.0-or-later 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

@customize-agent/cad-native 的下载量有多少?

根据 npm 官方下载统计,@customize-agent/cad-native 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,304 次,日均约 77 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@customize-agent/cad-native 还在维护吗?

最新版本 1.0.3 发布于 2026/10/29(13 天前);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/10/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。