pub const REFERENCE: &str = "# hardless-http-dialects\n\nTranslates **ePOS-Print-compatible** and **WebPRNT-compatible** XML print requests into ESC/POS\n(FR-31), and writes their responses (FR-34). The printer device parses the ESC/POS into the same\ncommand AST as a Web Serial print, so the renderer, the dashboard and test assertions work the\nsame whichever route printed a receipt. Sans-IO: no network code here.\n\nPart of [Hardless](https://github.com/hardlessdev/hardless), an open-source POS hardware\nemulator. Hardless is not affiliated with Seiko Epson or Star Micronics; both dialects are\nimplemented from their public manuals, and no vendor SDK code is used (NFR-15, NFR-16).\n\n## Usage\n\n```rust\nuse hardless_http_dialects::{epos, Outcome, PrinterStatus};\n\nlet request = epos::parse(r#\"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body>\n <epos-print xmlns=\"http://www.epson-pos.com/schemas/2011/03/epos-print\">\n <text em=\"true\">Total: 1,250 </text><cut type=\"feed\"/>\n </epos-print></s:Body></s:Envelope>\"#).unwrap();\n\n// Feed `request.print.escpos` to an ESC/POS printer, then read its status back with\n// DLE EOT 1, 2 and 4 and report it.\nlet status = PrinterStatus::from_dle_eot(0x12, 0x12, 0x12);\nlet outcome = Outcome::after_print(&status);\nlet xml = epos::response(&outcome, &status, request.print_job_id.as_deref());\nassert!(xml.contains(r#\"success=\"true\"\"#));\n```\n\n## ePOS-Print-compatible (`epos`)\n\nRequest: a SOAP 1.1 envelope whose body holds an `epos-print` document (a bare `epos-print`\ndocument is accepted too). `devid`, `timeout` and `printjobid` may come in the SOAP header.\n\n| Element | Becomes |\n| ------------------------------------------------------------------- | ----------------------------------------------------- |\n| `text` (`align`, `font`, `em`, `ul`, `dw`, `dh`, `width`, `height`) | text and `ESC a`, `ESC M`, `ESC E`, `ESC -`, `GS !` |\n| `feed` (`line`, `unit`) | `ESC d` (units in 30-dot lines) |\n| `cut` (`no_feed`, `feed`, `reserve`) | `GS V` partial cut |\n| `pulse` (`drawer_1`/`drawer_2`, `pulse_100`..`pulse_500`) | `ESC p` on pin 2 or 5 |\n| `barcode` (all types) | `GS H`, `GS w`, `GS h`, `GS k` |\n| `symbol` (`qrcode_model_1/2`) | `GS ( k` QR Code; other symbol types print as unknown |\n| `image` (`mono`, `gray16`) | `GS v 0` raster |\n| `command` | the hexadecimal bytes as they are |\n| `logo` | `GS ( L` (unknown: the emulator stores no logos) |\n| `sound`, `page`, `layout`, ... | a warning; `page` content prints in standard mode |\n\nResponse: `<response success code status battery>` with the manual\'s error codes\n(`EPTR_REC_EMPTY`, `EPTR_COVER_OPEN`, `EX_TIMEOUT`, `SchemaError`, `DeviceNotFound`) and\nstatus bits (print complete, drawer pin 3, offline, cover open, near end, paper end).\n\n## WebPRNT-compatible (`webprnt`)\n\nRequest: a `<root>` document. `text` (`emphasis`, `underline`, `width`, `height`, `font`;\ncontrol characters as `\\xNN`), `alignment`, `feed`, `cutpaper`, `barcode`, `qrcode`, `pdf417`,\n`bitimage`, `peripheral`, `rawdata`, `initialization` and `logo` translate like the ePOS\nelements; `sound`, `ruledline` and `holdprint` give warnings.\n\nResponse: `<root><success/><code/><status/></root>`, where `status` is the Star Automatic\nStatus as hex: header bytes, then status 1 (drawer switch, offline, cover open) and status 4\n(paper near end, paper end), as in the public ASB manual.\n\n## Safety\n\nDocuments over 8 MB and documents with a DTD are refused, so entity expansion and external\nentities cannot reach the emulator. Both parsers are fuzzed nightly (`fuzz/`) and never panic.\n\n## License\n\nApache-2.0\n";Expand description
This crate’s README, which holds the request and response reference for both dialects.
The MCP server’s hardless://docs/http-dialects resource and the docs site read it, so
the reference has one source.