{"_id":"@emdzej/ncsx-fa-asw","_rev":"6-8ef55cedccbde05a8dd2b47b168598bb","name":"@emdzej/ncsx-fa-asw","dist-tags":{"latest":"0.9.0"},"versions":{"0.4.0":{"name":"@emdzej/ncsx-fa-asw","version":"0.4.0","_id":"@emdzej/ncsx-fa-asw@0.4.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/ncsx#readme","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"dist":{"shasum":"cc16a83ba4c2122d2a4bc2a90dd13bdf8ad125a4","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.4.0.tgz","fileCount":19,"integrity":"sha512-A3yy5drXFJG3RiMLS/fk3Tmu539HUgalBSs0K4q2QYzEVhKHAmT+1M6mXQd/C1TOcEy3/n1jt1x/k9dx5p+WmA==","signatures":[{"sig":"MEQCICxgD/5QoO03LkTGrrjO35Qta1Jxb9v/12hye9B1LbkqAiARzfbl1goR1JUi6M01QCCQbJU8N8TWkiV5nGb9fz0izg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26097},"main":"dist/index.js","type":"module","_from":"file:emdzej-ncsx-fa-asw-0.4.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/e0fc69229eba0d35893d91b9b3148fd6/emdzej-ncsx-fa-asw-0.4.0.tgz","_integrity":"sha512-A3yy5drXFJG3RiMLS/fk3Tmu539HUgalBSs0K4q2QYzEVhKHAmT+1M6mXQd/C1TOcEy3/n1jt1x/k9dx5p+WmA==","repository":{"url":"git+https://github.com/emdzej/ncsx.git","type":"git","directory":"packages/fa-asw"},"_npmVersion":"11.14.1","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/ncsx-chassis":"0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","@types/node":"^22.13.1","@emdzej/ncsx-predicate":"0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/ncsx-fa-asw_0.4.0_1779705642969_0.2557079681005201","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@emdzej/ncsx-fa-asw","version":"0.5.1","_id":"@emdzej/ncsx-fa-asw@0.5.1","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/ncsx#readme","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"dist":{"shasum":"627ced84a3b29746964db1d23c5d817fbe8d495a","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.5.1.tgz","fileCount":19,"integrity":"sha512-lx6Cqba+IagD6Qay2UPAI6H3j8MVLjZJjFX/gszGoFEq+CZ752LUjRGgCH6Mln72Ot1kEuG4RmteKIxCq9y2Og==","signatures":[{"sig":"MEQCIH9t7Hd1gy7xpCHMabl69WrUCekSEzGn8lxMVQwfVSgHAiBWndKuvqdTlXwNWzUfShxzmF9Nmw8roqeAWY2PqRl56w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26097},"main":"dist/index.js","type":"module","_from":"file:emdzej-ncsx-fa-asw-0.5.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/92480819e120f9455a7b56de880e0f54/emdzej-ncsx-fa-asw-0.5.1.tgz","_integrity":"sha512-lx6Cqba+IagD6Qay2UPAI6H3j8MVLjZJjFX/gszGoFEq+CZ752LUjRGgCH6Mln72Ot1kEuG4RmteKIxCq9y2Og==","repository":{"url":"git+https://github.com/emdzej/ncsx.git","type":"git","directory":"packages/fa-asw"},"_npmVersion":"11.14.1","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/ncsx-chassis":"0.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","@types/node":"^22.13.1","@emdzej/ncsx-predicate":"0.5.1"},"_npmOperationalInternal":{"tmp":"tmp/ncsx-fa-asw_0.5.1_1779876451555_0.5428824825478349","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@emdzej/ncsx-fa-asw","version":"0.6.0","_id":"@emdzej/ncsx-fa-asw@0.6.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/ncsx#readme","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"dist":{"shasum":"e1c06e806c9abf63030aeafc1c9a020095136a79","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.6.0.tgz","fileCount":19,"integrity":"sha512-2mGD3ocJlh0PxWsBV9UriOIit5vPPdpmUGOkXGfuelJCo7Djj+qeojd+KH6ZyyMl1PNgTdfRK1X90xrKvC5WzA==","signatures":[{"sig":"MEQCIFgvEdu5wnbHtEm+AcaheazEYmkD8uH9F7HgxqmwD2XJAiBwmBo121j30HPQhOMKisGzB7QrW5fxJhyQUPIYX3LOdA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26097},"main":"dist/index.js","type":"module","_from":"file:emdzej-ncsx-fa-asw-0.6.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/1caf93b9036e1cc9e843046c81d4f17a/emdzej-ncsx-fa-asw-0.6.0.tgz","_integrity":"sha512-2mGD3ocJlh0PxWsBV9UriOIit5vPPdpmUGOkXGfuelJCo7Djj+qeojd+KH6ZyyMl1PNgTdfRK1X90xrKvC5WzA==","repository":{"url":"git+https://github.com/emdzej/ncsx.git","type":"git","directory":"packages/fa-asw"},"_npmVersion":"11.14.1","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/ncsx-chassis":"0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","@types/node":"^22.13.1","@emdzej/ncsx-predicate":"0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/ncsx-fa-asw_0.6.0_1779981255245_0.8530193939016235","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@emdzej/ncsx-fa-asw","version":"0.7.0","_id":"@emdzej/ncsx-fa-asw@0.7.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/ncsx#readme","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"dist":{"shasum":"969f644999bfc57529cfe49997c8d525decd5bbd","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.7.0.tgz","fileCount":19,"integrity":"sha512-6GA2TVOPwzRPVsR22yHIvptI5gxXfycJTJtaKHLiOjQBMWOP5+aMkJwk/6YCFCljXZfjcghZaKB2t9mRve5axw==","signatures":[{"sig":"MEUCIHz/Qt5BSkAHFrolk60HD674JdjbMXjfIlr3QT29xJE1AiEAommeHXo2mOiEGepJxC4sQiYInvGDtVfSA3cijKMLHJc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26097},"main":"dist/index.js","type":"module","_from":"file:emdzej-ncsx-fa-asw-0.7.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/ddb5cba66bd6562514793ea1a7201a43/emdzej-ncsx-fa-asw-0.7.0.tgz","_integrity":"sha512-6GA2TVOPwzRPVsR22yHIvptI5gxXfycJTJtaKHLiOjQBMWOP5+aMkJwk/6YCFCljXZfjcghZaKB2t9mRve5axw==","repository":{"url":"git+https://github.com/emdzej/ncsx.git","type":"git","directory":"packages/fa-asw"},"_npmVersion":"11.14.1","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/ncsx-chassis":"0.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","@types/node":"^22.13.1","@emdzej/ncsx-predicate":"0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/ncsx-fa-asw_0.7.0_1780063021326_0.9352638760867116","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@emdzej/ncsx-fa-asw","version":"0.8.0","_id":"@emdzej/ncsx-fa-asw@0.8.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/ncsx#readme","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"dist":{"shasum":"e613e1d4d78b52c94f98c4a54f7be403c5c114b7","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.8.0.tgz","fileCount":19,"integrity":"sha512-sixK6RZv7xuNvR8muH4E9ERj6ZcrSPBiTTGarecDrAxOuscMgxnIKnxioIGp25lnqW2a5wr3NuV1rx1f3pPY4Q==","signatures":[{"sig":"MEYCIQCKBPODBbkAV64VBj8aE7L2vecF191CB5qABx6+NtNRVAIhALyv1iPY+xRPPmTbtV/H6Q+6qpsw+wWiedtg0Msjj++X","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26097},"main":"dist/index.js","type":"module","_from":"file:emdzej-ncsx-fa-asw-0.8.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/453113ad99aa8fda7d8369e400a94cc0/emdzej-ncsx-fa-asw-0.8.0.tgz","_integrity":"sha512-sixK6RZv7xuNvR8muH4E9ERj6ZcrSPBiTTGarecDrAxOuscMgxnIKnxioIGp25lnqW2a5wr3NuV1rx1f3pPY4Q==","repository":{"url":"git+https://github.com/emdzej/ncsx.git","type":"git","directory":"packages/fa-asw"},"_npmVersion":"11.16.0","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/ncsx-chassis":"0.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","@types/node":"^22.13.1","@emdzej/ncsx-predicate":"0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/ncsx-fa-asw_0.8.0_1780758431425_0.35112968743172424","host":"s3://npm-registry-packages-npm-production"}},"0.9.0":{"name":"@emdzej/ncsx-fa-asw","version":"0.9.0","description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","main":"dist/index.js","types":"dist/index.d.ts","type":"module","dependencies":{"@emdzej/ncsx-chassis":"0.9.0"},"devDependencies":{"@types/node":"^22.13.1","vitest":"^2.1.8","@emdzej/ncsx-predicate":"0.9.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/emdzej/ncsx.git","directory":"packages/fa-asw"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run --passWithNoTests","test:watch":"vitest","lint":"eslint .","typecheck":"tsc --noEmit","clean":"rm -rf dist .turbo *.tsbuildinfo"},"_id":"@emdzej/ncsx-fa-asw@0.9.0","bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"homepage":"https://github.com/emdzej/ncsx#readme","_integrity":"sha512-J00EIiDbOue5mLwil2xBxhm6ULFRqTcRhIVirSgl/hFiyj6Y0scnt9sAAO2p89eG3TTcFmwuF50edR/WyjqVEg==","_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/ebef09f7477f1f6eb01b032a2b36885d/emdzej-ncsx-fa-asw-0.9.0.tgz","_from":"file:emdzej-ncsx-fa-asw-0.9.0.tgz","_nodeVersion":"22.22.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-J00EIiDbOue5mLwil2xBxhm6ULFRqTcRhIVirSgl/hFiyj6Y0scnt9sAAO2p89eG3TTcFmwuF50edR/WyjqVEg==","shasum":"af0a45681cbb3b458a8a4fc0442f81d118a49034","tarball":"https://registry.npmjs.org/@emdzej/ncsx-fa-asw/-/ncsx-fa-asw-0.9.0.tgz","fileCount":19,"unpackedSize":26097,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICK8M3giAq9m2j9TJIWJ5YBIB5ZdhqkwLpCZsd1JYoOQAiEA4KylCbLZA1DDytrtcObj1C2T8q6DlQVfBQ2LSsUpsGY="}]},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"directories":{},"maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ncsx-fa-asw_0.9.0_1783336574552_0.395136452212542"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-25T10:40:42.802Z","modified":"2026-07-06T11:16:14.859Z","0.4.0":"2026-05-25T10:40:43.136Z","0.5.1":"2026-05-27T10:07:31.722Z","0.6.0":"2026-05-28T15:14:15.395Z","0.7.0":"2026-05-29T13:57:01.465Z","0.8.0":"2026-06-06T15:07:11.581Z","0.9.0":"2026-07-06T11:16:14.673Z"},"bugs":{"url":"https://github.com/emdzej/ncsx/issues"},"homepage":"https://github.com/emdzej/ncsx#readme","repository":{"type":"git","url":"git+https://github.com/emdzej/ncsx.git","directory":"packages/fa-asw"},"description":"FA token string → ASW bit set converter. Spec: ../../docs/ecu-selection.md §3.3","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"readme":"# @emdzej/ncsx-fa-asw\n\nConverts a user-facing **FA string** (Auftrag — the comma/space-separated list of factory\noption codes like `\"0205 0502 0524\"`) into the **ASW bit set** that the\n[`@emdzej/ncsx-predicate`](../predicate/) evaluator consumes to match `AUFTRAGSAUSDRUCK`\nrows in `<BR>SGET.000` and `<BR>CVT.000`.\n\nNCSEXPER equivalent: `coapiGetAswFromAuftrag` → `RecFncAsw`.\n\nSpec: [`../../docs/ecu-selection.md` §3.3](../../docs/ecu-selection.md#33-step-3--fa--zcs--asw).\n\n## Mental model\n\n```\n   FA string             AT records              SWTASW                ASW bit set\n\"$0902 $0524 $0205\" ──→ ['SWA', 'CL', …] ──→  KEYID lookups   ──→  Set<u16>\n                          (FSW names)            (per FSW)\n```\n\n1. Tokenise the FA string (whitespace / commas; strip `$` and category-letter prefixes).\n2. Look each token up in `chassis.at` to get the FSW names it implies.\n3. Look each FSW name up in `chassis.swtAsw` to get its u16 KEYID.\n4. Optionally pull in additional Zwang (forced-inclusion) codes from `chassis.atM00`.\n\n## Install\n\n```bash\npnpm add @emdzej/ncsx-fa-asw\n# or:\n\"@emdzej/ncsx-fa-asw\": \"workspace:*\"\n```\n\n## Quick start\n\n```ts\nimport { loadChassis } from '@emdzej/ncsx-chassis';\nimport { nodeChassisSource } from '@emdzej/ncsx-chassis/node';\nimport { faToAsw } from '@emdzej/ncsx-fa-asw';\n\nconst chassis = await loadChassis(nodeChassisSource('…/DATEN'), 'E46');\nconst asw = faToAsw('$0902 $0524 $0205', { chassis });\n// asw is a Set<number> of u16 KEYIDs that the predicate evaluator consumes.\n\n// Feed it to a predicate (typically via ecu-select, but you can call it directly):\nimport { evalAuftragsausdruck } from '@emdzej/ncsx-predicate';\nevalAuftragsausdruck(predicateBytes, asw);\n```\n\n## API\n\n| Export             | Purpose                                                          |\n|--------------------|------------------------------------------------------------------|\n| `faToAsw(fa, opts)` | The pipeline: FA string → ASW bit set                           |\n| `tokenizeFa(fa)`   | Just the FA tokeniser (handy for UI input echo / validation)     |\n| `aswFromIds(ids)`  | Build an `AswSet` directly from a list of KEYIDs                 |\n| `AswSet`           | Type alias: `Set<number>`                                        |\n\n### `faToAsw` options\n\n```ts\nfaToAsw(fa, {\n  chassis,                  // required — supplies AT + SWTASW + AT.M00\n  strict: false,            // when true, throws on unknown FA codes / FSWs\n  includeZwang: true,       // when true, add KEYIDs from AT.M00 Z records\n  onWarning: (w) => { … },  // unknown FA code, unknown FSW, no SWT table, …\n});\n```\n\n## FA-string syntax accepted\n\n- Whitespace OR commas as separators: `\"0902,0524,0205\"` works the same as `\"0902 0524 0205\"`.\n- Optional `$` prefix per token: `\"$0902\"` (matches the convention NCSEXPER's editor uses).\n- Optional leading category letter: `\"W0902\"` is the same as `\"0902\"`.\n- Leading zeros are tolerated — `\"0205\"` and `\"205\"` both resolve.\n\n## Warnings\n\n`onWarning` receives objects like:\n\n- `{ kind: 'unknown-fa-code', code: '999', message: … }` — token not in `chassis.at`.\n- `{ kind: 'unknown-fsw', fsw: 'GHOST', message: … }` — AT record references a FSW not in SWTASW.\n- `{ kind: 'no-swt', message: … }` — chassis bundle has no SWTASW table loaded.\n\nIn `strict: true` mode each of these throws instead.\n\n## What this *doesn't* do (yet)\n\n- **ZCS → ASW** decoding. A car's ZCS (Zentral-Codier-Schlüssel) is another way of\n  expressing FA; converting it requires the per-module ZCS decoder. Wait for a future\n  `zcs-asw` package or do it yourself via `chassis.zcsut`.\n- **FSW-keyword to ASW lookup.** The predicate's `S<id>` opcode references SA codes, not\n  FSW IDs. If you want to test \"is FSW SWA active?\", use `chassis.zst` to find which SA\n  codes contribute to that FSW, then check whether those SAs are in the ASW.\n\n## Related\n\n- [`@emdzej/ncsx-chassis`](../chassis/) — supplies the `AT` + `SWTASW` + `AT.M00` tables.\n- [`@emdzej/ncsx-predicate`](../predicate/) — consumes the `AswSet` this produces.\n- [`@emdzej/ncsx-ecu-select`](../ecu-select/) — most common downstream caller.\n- Spec: [`../../docs/ecu-selection.md` §3.3](../../docs/ecu-selection.md#33-step-3--fa--zcs--asw).\n","readmeFilename":"README.md"}