@h2loop/autosar

中文文档
1.21.0发布于 2026/11/17UNLICENSEDES Module近 30 天下载 9065

AUTOSAR Classic pack for Hydron: ECUC read/edit-in-place/validate/diff on ARXML, config-to-code trace, generator and build runners

原始使用文档
文档目录4 节
  1. Install
  2. Project configuration
  3. Engine CLI
  4. Develop

@h2loop/autosar — AUTOSAR Classic pack for Hydron

Deterministic tools for AUTOSAR Classic integration work, so the agent never hand-writes ARXML:

ToolWhat it doesRuns
ecuc_readECUC configuration as compact ECUC JSON; def summaries (schema)local (Python engine)
ecuc_editset / add / remove by AUTOSAR path; in-place byte patches; all-or-nothing; schema checklocal
ecuc_validatemultiplicity, mandatory, range, enum, type, string, ref target/dest, dangling, duplicates → LSP-like diagnosticslocal
ecuc_findstructured queries over the ECUC (conditions, references to/from)local
ecuc_crosscheckper-module cross-check table (extract, gateway, NvM sizeof, capacity, packing, handles)local
arxml_editstructured edits of System extract / SWC ARXML, incl. new_file (DEST inferred, schema-ordered, missing packages created)local
autosar_add_likeadd a new X like an existing Y (message, port, runnable+event, Dem event, NvM block, ...): clones the whole named chain across ECUC + System ARXML, renamed; links, handle IDs, values; validates or rolls backlocal
autosar_add_signaladd a signal end to end (ECUC + extract chain + DBC), validate or roll backlocal
arxml_diffsemantic diff by AUTOSAR path (ignores UUIDs, order, whitespace, file splits)local
autosar_traceconfig ↔ generated C symbol ↔ in-house callers, via the H2Loop code graphH2Loop backend
autosar_config_lookupelement + children + refs in/out + links from the code graphH2Loop backend
autosar_spec_id_checkcheck requirement IDs (SWS_/TPS_/ECUC_…) against your own spec text exports: DEFINED + text / MENTIONED-ONLY / NOT-FOUNDlocal (specDocs)
autosar_auditintegration review of C code: BSW API handles, direction, widths, NvM NULL_PTR vs ECUClocal
autosar_generate / autosar_buildrun the project's configured generator / build command (asks permission)local

Plus the autosar skill (ECUC model, symbolic-name rule, config classes, project layout, the edit → validate → generate → build → trace loop), the autosar-integrator subagent, and the /autosar-validate and /autosar-trace commands.

Install

hydron plugin add @h2loop/autosar          # or a local path / --project

Requirements: uv (preferred; adds the strict ARXML schema check via autosar-data) or Python ≥ 3.10 on PATH (AUTOSAR_PYTHON overrides). The backend tools use the Hydron login and selected H2Loop project (or workspace_id); KILO_API_URL overrides the backend.

Project configuration

Param definitions are not bundled. The engine finds them in this order: .hydron/autosar.json paramDefs globs → any project .arxml containing ECUC-MODULE-DEF (vendor BSWMD) → $AUTOSAR_PARAMDEFS (path list). Without defs, values are readable but not validated.

{
  "paramDefs": ["SIP/**/bswmd/*.arxml"],
  "config": ["Config/**/*.arxml"],
  "input": ["Input/**/*.arxml"],
  "generate": {"command": "<vendor-cli> --project Config/Ecu.dpa --generate {module}", "timeoutSec": 3600},
  "build": "make -C Build all",
  "specDocs": ["~/autosar/R25-11/txt/*.txt"]
}

ecuc_read / ecuc_find give every value with "@at:<Param>" (file:line of its VALUE element) and integers with "@hex:<Param>"; autosar_trace / autosar_config_lookup add the same per value for elements in the local checkout. specDocs (or $AUTOSAR_SPEC_DOCS) points autosar_spec_id_check at text exports of the AUTOSAR specifications you are licensed to use; the pack bundles no spec text and no requirement-ID index.

Engine CLI

cd python && uv run --no-project --with autosar-data==0.17.0 python -m ecuc_engine --root <project> \
  <info|read [path] [--depth N] [--schema]|edit --ops '<json>' [--dry-run]|validate [--module M] [--file F]|diff A B> --json

Develop

bun install && bun run build && bun run typecheck
bun run test:py        # pytest; R25-11 integration tests run when AUTOSAR_R25_DEFS (or the eval_work copy) exists
hydron plugin validate .

版本与发布记录

@h2loop/autosar 共发布 60 个版本,首次发布于 2026/11/06;过去 12 个月发布了 60 个版本。

版本发布日期距今
1.21.0latest2026/11/17今天
1.20.22026/11/17今天
1.20.12026/11/17今天
1.20.02026/11/16今天
1.19.12026/11/16今天
1.19.02026/11/161 天前

关于 @h2loop/autosar 的常见问题

@h2loop/autosar 是什么?

AUTOSAR Classic pack for Hydron: ECUC read/edit-in-place/validate/diff on ARXML, config-to-code trace, generator and build runners

如何安装 @h2loop/autosar?

在项目目录运行 npm install @h2loop/autosar,或使用 pnpm add / yarn add / bun add。

@h2loop/autosar 支持 TypeScript 吗?

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

@h2loop/autosar 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@h2loop/autosar 可以商用吗?

@h2loop/autosar 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@h2loop/autosar 的下载量有多少?

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

@h2loop/autosar 还在维护吗?

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